@wrongstack/webui 0.296.2 → 0.296.4

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.
Files changed (97) hide show
  1. package/dist/assets/{AgentRosterView-CG7hiTO5.js → AgentRosterView-DTbg5NoZ.js} +1 -1
  2. package/dist/assets/{AnalyticsDashboard-BQH6L1S1.js → AnalyticsDashboard-Xc8aG4ev.js} +1 -1
  3. package/dist/assets/{AudienceMemoryPanel-DX4uLxnp.js → AudienceMemoryPanel-C1mj_XOq.js} +1 -1
  4. package/dist/assets/{ChangesView-B2DsGWiA.js → ChangesView-W_UTPolz.js} +1 -1
  5. package/dist/assets/{ChronicleDashboard-DI6fBbLJ.js → ChronicleDashboard-BivxCmdl.js} +1 -1
  6. package/dist/assets/{CodeEditor-CgXWP1-I.js → CodeEditor-NAOGCzZS.js} +1 -1
  7. package/dist/assets/{CronJobsPanel-ByrWTFMO.js → CronJobsPanel-0virGKLS.js} +1 -1
  8. package/dist/assets/DeadCodeScanPanel-DHsw8Nn4.js +2 -0
  9. package/dist/assets/{DebugDashboard-C4jNeXwd.js → DebugDashboard-DYEVc0PA.js} +1 -1
  10. package/dist/assets/{DesignGalleryView-DR2MqDGO.js → DesignGalleryView-BSBDNBNf.js} +1 -1
  11. package/dist/assets/{GoalView-BsZXe4sN.js → GoalView-C_wodXvj.js} +1 -1
  12. package/dist/assets/{KanbanView-CjAQz5ko.js → KanbanView-D7SKeieE.js} +1 -1
  13. package/dist/assets/{LazyMarkdown-BGp00cAh.js → LazyMarkdown-Bt3iw3ZV.js} +1 -1
  14. package/dist/assets/{MailboxDetailView-D2zOtsHb.js → MailboxDetailView-BaFQIyhC.js} +1 -1
  15. package/dist/assets/{MemoryManager-C0c6SLEn.js → MemoryManager-CWkdwf8F.js} +1 -1
  16. package/dist/assets/{ModelPicker-HVIA8pKx.js → ModelPicker-CJBOoZME.js} +1 -1
  17. package/dist/assets/{OfficeMapPanel-DtMjwPJ2.js → OfficeMapPanel-BopbmfGN.js} +1 -1
  18. package/dist/assets/{ProcessMonitor-Es5rkf_W.js → ProcessMonitor-d_5Iwyo7.js} +1 -1
  19. package/dist/assets/{QueuePanel-BO4V720k.js → QueuePanel-DlNF8CUn.js} +1 -1
  20. package/dist/assets/{RefreshDebugView-CnOMdm5p.js → RefreshDebugView-gPMro5jy.js} +1 -1
  21. package/dist/assets/{SageTabs-C630-UtZ.js → SageTabs-yP5fr4lP.js} +2 -2
  22. package/dist/assets/{SddHub-BUPmZYcI.js → SddHub-DjeM7IaL.js} +1 -1
  23. package/dist/assets/{SessionsDashboard-_a7mqxAP.js → SessionsDashboard-D7b7aEse.js} +1 -1
  24. package/dist/assets/SetupScreen-Dsek43zs.js +1 -0
  25. package/dist/assets/{SkillDetailView-BucSq6E1.js → SkillDetailView-DxdqTQ5E.js} +1 -1
  26. package/dist/assets/{SpecsView-C4BODULT.js → SpecsView-Bu8xHf5j.js} +1 -1
  27. package/dist/assets/{TechStackView-CibHS3rz.js → TechStackView--7TPHg0R.js} +1 -1
  28. package/dist/assets/{TerminalPanel-AM_WVT3e.js → TerminalPanel-gA6ThdVE.js} +1 -1
  29. package/dist/assets/{Toaster-C6a7sphP.js → Toaster-DTJHnKyl.js} +1 -1
  30. package/dist/assets/{i18n-CIqbHugq.js → i18n-C2VyJ0Kz.js} +2 -2
  31. package/dist/assets/index-3CuRO3-V.css +1 -0
  32. package/dist/assets/{index-Dy7C2V-G.js → index-DSXHr5yP.js} +31 -30
  33. package/dist/assets/{progress-ring-D8StLpFh.js → progress-ring-BEsRLdjq.js} +1 -1
  34. package/dist/assets/{roster-ws-DOgj2SAo.js → roster-ws-CVCrt_ih.js} +1 -1
  35. package/dist/assets/settings-C5F2tQ7C.js +1 -0
  36. package/dist/assets/settings-Cdk8i_p6.js +1 -0
  37. package/dist/assets/settings-D6wFOw5n.js +1 -0
  38. package/dist/assets/settings-DCEOkxYE.js +1 -0
  39. package/dist/assets/settings-DEmKlLmn.js +1 -0
  40. package/dist/assets/settings-DsflqNn0.js +1 -0
  41. package/dist/assets/settings-skShEZ2B.js +1 -0
  42. package/dist/assets/{stores-nxVpq1NP.js → stores-hEu6z1qz.js} +1 -1
  43. package/dist/assets/ui-store-BI3LH2q8.js +1 -0
  44. package/dist/assets/{useWebSocket-DLQNx26C.js → useWebSocket-Ba38Sknk.js} +2 -2
  45. package/dist/assets/{view-navigation-DuOBOluC.js → view-navigation-BSA3_knE.js} +1 -1
  46. package/dist/assets/ws-client-eyEv8wbm.js +1 -0
  47. package/dist/components/AgentOfficeDetails.d.ts.map +1 -1
  48. package/dist/components/AgentOfficeView.d.ts.map +1 -1
  49. package/dist/components/AgentRosterView.d.ts.map +1 -1
  50. package/dist/components/ChatInput.d.ts.map +1 -1
  51. package/dist/components/ChatView/index.d.ts.map +1 -1
  52. package/dist/components/CodeMap.d.ts.map +1 -1
  53. package/dist/components/DeadCodeScanPanel/DeadCodeScanPanel.d.ts.map +1 -1
  54. package/dist/components/MessageBubble/ToolLedgerCard.d.ts.map +1 -1
  55. package/dist/components/MessageBubble/index.d.ts.map +1 -1
  56. package/dist/components/NextStepsBar.d.ts +9 -3
  57. package/dist/components/NextStepsBar.d.ts.map +1 -1
  58. package/dist/components/OfficeMapCanvas/CanvasPanels.d.ts.map +1 -1
  59. package/dist/components/OfficeMapCanvas.d.ts.map +1 -1
  60. package/dist/components/SettingsPanel/ConnectionsHealthSection.d.ts.map +1 -1
  61. package/dist/components/SetupScreen/ProviderKeyCard.d.ts.map +1 -1
  62. package/dist/components/SetupScreen.d.ts.map +1 -1
  63. package/dist/components/ToolResult.d.ts +8 -1
  64. package/dist/components/ToolResult.d.ts.map +1 -1
  65. package/dist/components/context-editor/ContextWindowEditor.d.ts.map +1 -1
  66. package/dist/hooks/ws-handlers/chat-handlers.d.ts.map +1 -1
  67. package/dist/index.html +12 -12
  68. package/dist/index.js +3285 -2912
  69. package/dist/index.js.map +4 -4
  70. package/dist/lib/sage-block.d.ts.map +1 -1
  71. package/dist/lib/ws-client.d.ts +11 -1
  72. package/dist/lib/ws-client.d.ts.map +1 -1
  73. package/dist/stores/local-prefs.d.ts +1 -1
  74. package/dist/stores/local-prefs.d.ts.map +1 -1
  75. package/dist/stores/types.d.ts +9 -0
  76. package/dist/stores/types.d.ts.map +1 -1
  77. package/dist/types/client-message.d.ts +6 -0
  78. package/dist/types/client-message.d.ts.map +1 -1
  79. package/dist/types/connections.d.ts +6 -0
  80. package/dist/types/connections.d.ts.map +1 -1
  81. package/dist/types/protocol-core.d.ts +6 -0
  82. package/dist/types/protocol-core.d.ts.map +1 -1
  83. package/dist/types/server-message.d.ts +4 -1
  84. package/dist/types/server-message.d.ts.map +1 -1
  85. package/package.json +7 -7
  86. package/dist/assets/DeadCodeScanPanel-mREO2zoW.js +0 -2
  87. package/dist/assets/SetupScreen-BiOzT5PT.js +0 -1
  88. package/dist/assets/index-B_lRId11.css +0 -1
  89. package/dist/assets/settings-BHVrMeiB.js +0 -1
  90. package/dist/assets/settings-BNkUdI3D.js +0 -1
  91. package/dist/assets/settings-ByapDpso.js +0 -1
  92. package/dist/assets/settings-DDjoc06u.js +0 -1
  93. package/dist/assets/settings-DgZ3cEL3.js +0 -1
  94. package/dist/assets/settings-iiGjrvpU.js +0 -1
  95. package/dist/assets/settings-oGMBWYjV.js +0 -1
  96. package/dist/assets/ui-store-CBdBem9f.js +0 -1
  97. package/dist/assets/ws-client-D0KuNwAk.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Bi as t,Cr as n,Hr as r,Yr as i,Yt as a,cn as o,et as s,ga as c,gi as l,ji as u,pa as d,xa as f,xt as p,ya as m}from"./vendor-9hC4n4Me.js";import"./i18n-CIqbHugq.js";import{b as h}from"./index-Dy7C2V-G.js";var g=e(f(),1),_=s();function v({title:e,value:t,subtitle:n,icon:r,color:i=`text-primary`,trend:a}){let{t:o}=c();return(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium`,children:e}),(0,_.jsx)(`p`,{className:`mt-1 truncate text-xl font-semibold tabular-nums sm:text-2xl ${i}`,children:t}),n&&(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n})]}),(0,_.jsx)(`div`,{className:`shrink-0 rounded-lg bg-muted/70 p-2 ${i}`,children:(0,_.jsx)(r,{className:`w-5 h-5`})})]}),a&&(0,_.jsxs)(`div`,{className:`mt-2 flex items-center gap-1`,children:[a===`up`&&(0,_.jsx)(p,{className:`w-3 h-3 text-success`}),a===`down`&&(0,_.jsx)(p,{className:`w-3 h-3 rotate-180 text-destructive`}),(0,_.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o(a===`up`?`activity:debug.trendUp`:a===`down`?`activity:debug.trendDown`:`activity:debug.trendStable`)})]})]})}function y(){let{t:e}=c(),[s,f]=(0,g.useState)({fileWatcher:null,system:null,lastUpdated:null,error:null}),[y,S]=(0,g.useState)(!0),[C,w]=(0,g.useState)(2e3),T=(0,g.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch(`/debug/watcher-metrics`),fetch(`/debug/system`,{cache:`no-store`})]),n=null,r=e.headers.get(`content-type`)??``;if(e.ok&&r.includes(`application/json`)&&(n=await e.json()),!t.ok)throw Error(`System metrics request failed (${t.status})`);let i=await t.json();f({fileWatcher:n,system:i,lastUpdated:new Date,error:null})}catch(e){f(t=>({...t,error:e instanceof Error?e.message:m.t(`activity:debug.fetchFailed`)}))}finally{S(!1)}},[]);return(0,g.useEffect)(()=>{T();let e=setInterval(T,C);return()=>clearInterval(e)},[T,C]),(0,_.jsx)(`div`,{ref:h(`debug`),className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-col gap-5`,children:[(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`h1`,{className:`flex items-center gap-2 text-lg font-semibold sm:text-xl`,children:[(0,_.jsx)(t,{className:`h-5 w-5 text-primary`}),e(`activity:debug.heading`)]}),(0,_.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`activity:debug.subtitle`)})]}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,_.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,_.jsx)(o,{className:`w-4 h-4 text-muted-foreground`}),(0,_.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e(`activity:debug.refreshLabel`)}),(0,_.jsxs)(`select`,{value:C,onChange:e=>w(Number(e.target.value)),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm`,children:[(0,_.jsx)(`option`,{value:1e3,children:`1s`}),(0,_.jsx)(`option`,{value:2e3,children:`2s`}),(0,_.jsx)(`option`,{value:5e3,children:`5s`}),(0,_.jsx)(`option`,{value:1e4,children:`10s`})]})]}),(0,_.jsxs)(`button`,{type:`button`,onClick:()=>{S(!0),T()},disabled:y,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 disabled:opacity-50`,children:[(0,_.jsx)(o,{className:`w-4 h-4 ${y?`animate-spin`:``}`}),e(`common:action.refresh`)]})]})]})}),s.lastUpdated&&(0,_.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 bg-card/55 px-3 py-2 text-sm text-muted-foreground`,children:[(0,_.jsx)(l,{className:`w-4 h-4`}),e(`activity:debug.lastUpdated`,{time:s.lastUpdated.toLocaleTimeString()})]}),s.error&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-destructive/25 bg-destructive/10 p-4 text-destructive`,children:[(0,_.jsx)(u,{className:`w-5 h-5 flex-shrink-0`}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`p`,{className:`font-medium`,children:e(`activity:debug.fetchFailed`)}),(0,_.jsx)(`p`,{className:`text-sm opacity-80`,children:s.error})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(i,{className:`h-4 w-4 text-primary`}),e(`activity:debug.fileWatcher`)]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:e(`activity:debug.watcherStatus`),value:s.fileWatcher?.watcherActive?e(`activity:debug.running`):e(`activity:debug.stopped`),icon:a,color:s.fileWatcher?.watcherActive?`text-success`:`text-destructive`}),(0,_.jsx)(v,{title:e(`activity:debug.activeProjects`),value:s.fileWatcher?.activeProjects??0,subtitle:e(`activity:debug.projectsWatched`),icon:r,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.fileChanges`),value:s.fileWatcher?.fileChangesDetected??0,subtitle:e(`activity:debug.totalDetected`),icon:d,color:`text-primary`,trend:`neutral`}),(0,_.jsx)(v,{title:e(`activity:debug.filesProcessed`),value:s.fileWatcher?.filesProcessed??0,subtitle:e(`activity:debug.afterHash`),icon:n,color:`text-success`})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mt-4`,children:[(0,_.jsx)(v,{title:e(`activity:debug.broadcastsSent`),value:s.fileWatcher?.broadcastsSent??0,subtitle:e(`activity:debug.toClients`),icon:p,color:`text-success`}),(0,_.jsx)(v,{title:e(`activity:debug.debounceResets`),value:s.fileWatcher?.debounceResets??0,subtitle:e(`activity:debug.rapidWrites`),icon:o,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.avgDebounce`),value:`${(s.fileWatcher?.averageDebounceDelayMs??0).toFixed(1)}ms`,subtitle:e(`activity:debug.actualDelay`),icon:l,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.totalDelay`),value:`${(s.fileWatcher?.totalDebounceDelayMs??0).toFixed(0)}ms`,subtitle:e(`activity:debug.sumDelays`),icon:t,color:`text-primary`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(n,{className:`h-4 w-4 text-primary`}),`WebUI Server Process`]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:`Process RAM (RSS)`,value:b(s.system?.memoryUsage?.rss??0),subtitle:s.system?`PID ${s.system.pid}`:void 0,icon:a,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapUsed`),value:b(s.system?.memoryUsage?.heapUsed??0),subtitle:e(`activity:debug.jsHeap`),icon:t,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapTotal`),value:b(s.system?.memoryUsage?.heapTotal??0),subtitle:e(`activity:debug.totalHeap`),icon:t,color:`text-success`}),(0,_.jsx)(v,{title:`V8 Heap Limit`,value:b(s.system?.heapLimit??0),subtitle:`Configured old-space ceiling`,icon:n,color:`text-warning`}),(0,_.jsx)(v,{title:`Server Uptime`,value:x(s.system?.uptime??0),subtitle:`Since process start`,icon:l,color:`text-primary`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(a,{className:`h-4 w-4 text-primary`}),`Codebase Index Server`]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:`Connection`,value:s.system?.codebaseIndexServer?.health?.status??s.system?.codebaseIndexServer?.status??`unknown`,subtitle:s.system?.codebaseIndexServer?.pid?`PID ${s.system.codebaseIndexServer.pid} · RTT ${s.system.codebaseIndexServer.health?.latencyMs??`—`}ms`:`No connected project server`,icon:d,color:s.system?.codebaseIndexServer?.health?.status===`healthy`?`text-success`:s.system?.codebaseIndexServer?.status===`unresponsive`||s.system?.codebaseIndexServer?.status===`error`?`text-destructive`:`text-warning`}),(0,_.jsx)(v,{title:`Index RAM (RSS)`,value:b(s.system?.codebaseIndexServer?.health?.server?.memory.rss??0),subtitle:`Heap ${b(s.system?.codebaseIndexServer?.health?.server?.memory.heapUsed??0)} / ${b(s.system?.codebaseIndexServer?.health?.server?.memory.heapTotal??0)}`,icon:t,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Workload`,value:`${s.system?.codebaseIndexServer?.health?.server?.activeRequests??0} requests`,subtitle:`${s.system?.codebaseIndexServer?.health?.server?.activeWrites??0} writes · ${s.system?.codebaseIndexServer?.health?.server?.queuedWrites??0} queued`,icon:n,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Watcher`,value:s.system?.codebaseIndexServer?.health?.server?.watchingExternal?`Active`:`Off`,subtitle:`${s.system?.codebaseIndexServer?.health?.server?.watchingClients??0} owners · ${s.system?.codebaseIndexServer?.health?.server?.pendingExternalFiles??0} pending`,icon:i,color:s.system?.codebaseIndexServer?.health?.server?.watchingExternal?`text-success`:`text-muted-foreground`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(d,{className:`h-4 w-4 text-primary`}),e(`activity:debug.rawData`)]}),(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsx)(`pre`,{className:`overflow-x-auto text-xs font-mono text-muted-foreground`,children:JSON.stringify({fileWatcher:s.fileWatcher,serverPid:s.system?.pid,serverMemory:s.system?.memoryUsage,serverHeapLimit:s.system?.heapLimit,serverUptime:s.system?.uptime,codebaseIndexServer:s.system?.codebaseIndexServer},null,2)})})]})]})})}function b(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/t**r).toFixed(1)} ${n[r]}`}function x(e){return e<60?`${e.toFixed(0)}s`:e<3600?`${(e/60).toFixed(1)}m`:`${(e/3600).toFixed(1)}h`}export{y as DebugDashboard};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Bi as t,Cr as n,Hr as r,Yr as i,Yt as a,cn as o,et as s,ga as c,gi as l,ji as u,pa as d,xa as f,xt as p,ya as m}from"./vendor-9hC4n4Me.js";import"./i18n-C2VyJ0Kz.js";import{b as h}from"./index-DSXHr5yP.js";var g=e(f(),1),_=s();function v({title:e,value:t,subtitle:n,icon:r,color:i=`text-primary`,trend:a}){let{t:o}=c();return(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium`,children:e}),(0,_.jsx)(`p`,{className:`mt-1 truncate text-xl font-semibold tabular-nums sm:text-2xl ${i}`,children:t}),n&&(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n})]}),(0,_.jsx)(`div`,{className:`shrink-0 rounded-lg bg-muted/70 p-2 ${i}`,children:(0,_.jsx)(r,{className:`w-5 h-5`})})]}),a&&(0,_.jsxs)(`div`,{className:`mt-2 flex items-center gap-1`,children:[a===`up`&&(0,_.jsx)(p,{className:`w-3 h-3 text-success`}),a===`down`&&(0,_.jsx)(p,{className:`w-3 h-3 rotate-180 text-destructive`}),(0,_.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o(a===`up`?`activity:debug.trendUp`:a===`down`?`activity:debug.trendDown`:`activity:debug.trendStable`)})]})]})}function y(){let{t:e}=c(),[s,f]=(0,g.useState)({fileWatcher:null,system:null,lastUpdated:null,error:null}),[y,S]=(0,g.useState)(!0),[C,w]=(0,g.useState)(2e3),T=(0,g.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch(`/debug/watcher-metrics`),fetch(`/debug/system`,{cache:`no-store`})]),n=null,r=e.headers.get(`content-type`)??``;if(e.ok&&r.includes(`application/json`)&&(n=await e.json()),!t.ok)throw Error(`System metrics request failed (${t.status})`);let i=await t.json();f({fileWatcher:n,system:i,lastUpdated:new Date,error:null})}catch(e){f(t=>({...t,error:e instanceof Error?e.message:m.t(`activity:debug.fetchFailed`)}))}finally{S(!1)}},[]);return(0,g.useEffect)(()=>{T();let e=setInterval(T,C);return()=>clearInterval(e)},[T,C]),(0,_.jsx)(`div`,{ref:h(`debug`),className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-col gap-5`,children:[(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`h1`,{className:`flex items-center gap-2 text-lg font-semibold sm:text-xl`,children:[(0,_.jsx)(t,{className:`h-5 w-5 text-primary`}),e(`activity:debug.heading`)]}),(0,_.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`activity:debug.subtitle`)})]}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,_.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,_.jsx)(o,{className:`w-4 h-4 text-muted-foreground`}),(0,_.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e(`activity:debug.refreshLabel`)}),(0,_.jsxs)(`select`,{value:C,onChange:e=>w(Number(e.target.value)),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm`,children:[(0,_.jsx)(`option`,{value:1e3,children:`1s`}),(0,_.jsx)(`option`,{value:2e3,children:`2s`}),(0,_.jsx)(`option`,{value:5e3,children:`5s`}),(0,_.jsx)(`option`,{value:1e4,children:`10s`})]})]}),(0,_.jsxs)(`button`,{type:`button`,onClick:()=>{S(!0),T()},disabled:y,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 disabled:opacity-50`,children:[(0,_.jsx)(o,{className:`w-4 h-4 ${y?`animate-spin`:``}`}),e(`common:action.refresh`)]})]})]})}),s.lastUpdated&&(0,_.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 bg-card/55 px-3 py-2 text-sm text-muted-foreground`,children:[(0,_.jsx)(l,{className:`w-4 h-4`}),e(`activity:debug.lastUpdated`,{time:s.lastUpdated.toLocaleTimeString()})]}),s.error&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-destructive/25 bg-destructive/10 p-4 text-destructive`,children:[(0,_.jsx)(u,{className:`w-5 h-5 flex-shrink-0`}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`p`,{className:`font-medium`,children:e(`activity:debug.fetchFailed`)}),(0,_.jsx)(`p`,{className:`text-sm opacity-80`,children:s.error})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(i,{className:`h-4 w-4 text-primary`}),e(`activity:debug.fileWatcher`)]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:e(`activity:debug.watcherStatus`),value:s.fileWatcher?.watcherActive?e(`activity:debug.running`):e(`activity:debug.stopped`),icon:a,color:s.fileWatcher?.watcherActive?`text-success`:`text-destructive`}),(0,_.jsx)(v,{title:e(`activity:debug.activeProjects`),value:s.fileWatcher?.activeProjects??0,subtitle:e(`activity:debug.projectsWatched`),icon:r,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.fileChanges`),value:s.fileWatcher?.fileChangesDetected??0,subtitle:e(`activity:debug.totalDetected`),icon:d,color:`text-primary`,trend:`neutral`}),(0,_.jsx)(v,{title:e(`activity:debug.filesProcessed`),value:s.fileWatcher?.filesProcessed??0,subtitle:e(`activity:debug.afterHash`),icon:n,color:`text-success`})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mt-4`,children:[(0,_.jsx)(v,{title:e(`activity:debug.broadcastsSent`),value:s.fileWatcher?.broadcastsSent??0,subtitle:e(`activity:debug.toClients`),icon:p,color:`text-success`}),(0,_.jsx)(v,{title:e(`activity:debug.debounceResets`),value:s.fileWatcher?.debounceResets??0,subtitle:e(`activity:debug.rapidWrites`),icon:o,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.avgDebounce`),value:`${(s.fileWatcher?.averageDebounceDelayMs??0).toFixed(1)}ms`,subtitle:e(`activity:debug.actualDelay`),icon:l,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.totalDelay`),value:`${(s.fileWatcher?.totalDebounceDelayMs??0).toFixed(0)}ms`,subtitle:e(`activity:debug.sumDelays`),icon:t,color:`text-primary`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(n,{className:`h-4 w-4 text-primary`}),`WebUI Server Process`]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:`Process RAM (RSS)`,value:b(s.system?.memoryUsage?.rss??0),subtitle:s.system?`PID ${s.system.pid}`:void 0,icon:a,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapUsed`),value:b(s.system?.memoryUsage?.heapUsed??0),subtitle:e(`activity:debug.jsHeap`),icon:t,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapTotal`),value:b(s.system?.memoryUsage?.heapTotal??0),subtitle:e(`activity:debug.totalHeap`),icon:t,color:`text-success`}),(0,_.jsx)(v,{title:`V8 Heap Limit`,value:b(s.system?.heapLimit??0),subtitle:`Configured old-space ceiling`,icon:n,color:`text-warning`}),(0,_.jsx)(v,{title:`Server Uptime`,value:x(s.system?.uptime??0),subtitle:`Since process start`,icon:l,color:`text-primary`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(a,{className:`h-4 w-4 text-primary`}),`Codebase Index Server`]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,_.jsx)(v,{title:`Connection`,value:s.system?.codebaseIndexServer?.health?.status??s.system?.codebaseIndexServer?.status??`unknown`,subtitle:s.system?.codebaseIndexServer?.pid?`PID ${s.system.codebaseIndexServer.pid} · RTT ${s.system.codebaseIndexServer.health?.latencyMs??`—`}ms`:`No connected project server`,icon:d,color:s.system?.codebaseIndexServer?.health?.status===`healthy`?`text-success`:s.system?.codebaseIndexServer?.status===`unresponsive`||s.system?.codebaseIndexServer?.status===`error`?`text-destructive`:`text-warning`}),(0,_.jsx)(v,{title:`Index RAM (RSS)`,value:b(s.system?.codebaseIndexServer?.health?.server?.memory.rss??0),subtitle:`Heap ${b(s.system?.codebaseIndexServer?.health?.server?.memory.heapUsed??0)} / ${b(s.system?.codebaseIndexServer?.health?.server?.memory.heapTotal??0)}`,icon:t,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Workload`,value:`${s.system?.codebaseIndexServer?.health?.server?.activeRequests??0} requests`,subtitle:`${s.system?.codebaseIndexServer?.health?.server?.activeWrites??0} writes · ${s.system?.codebaseIndexServer?.health?.server?.queuedWrites??0} queued`,icon:n,color:`text-primary`}),(0,_.jsx)(v,{title:`Index Watcher`,value:s.system?.codebaseIndexServer?.health?.server?.watchingExternal?`Active`:`Off`,subtitle:`${s.system?.codebaseIndexServer?.health?.server?.watchingClients??0} owners · ${s.system?.codebaseIndexServer?.health?.server?.pendingExternalFiles??0} pending`,icon:i,color:s.system?.codebaseIndexServer?.health?.server?.watchingExternal?`text-success`:`text-muted-foreground`})]})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,_.jsx)(d,{className:`h-4 w-4 text-primary`}),e(`activity:debug.rawData`)]}),(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsx)(`pre`,{className:`overflow-x-auto text-xs font-mono text-muted-foreground`,children:JSON.stringify({fileWatcher:s.fileWatcher,serverPid:s.system?.pid,serverMemory:s.system?.memoryUsage,serverHeapLimit:s.system?.heapLimit,serverUptime:s.system?.uptime,codebaseIndexServer:s.system?.codebaseIndexServer},null,2)})})]})]})})}function b(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/t**r).toFixed(1)} ${n[r]}`}function x(e){return e<60?`${e.toFixed(0)}s`:e<3600?`${(e/60).toFixed(1)}m`:`${(e/3600).toFixed(1)}h`}export{y as DebugDashboard};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ri as t,Tn as n,Ut as r,Zt as i,at as a,et as o,ga as s,ni as c,xa as l,ya as u}from"./vendor-9hC4n4Me.js";import"./i18n-CIqbHugq.js";import{t as d}from"./useWebSocket-DLQNx26C.js";import{t as f}from"./utils-DzRQUvln.js";import{o as p}from"./view-navigation-DuOBOluC.js";import{b as m}from"./index-Dy7C2V-G.js";var h=e(l(),1);function g(e,t,n){return e<t?t:e>n?n:e}function _(e){let t=/^oklch\(\s*([^)]+)\)$/i.exec(e.trim());if(!t?.[1])return null;let n=(t[1].split(`/`)[0]??``).trim().split(/\s+/);if(n.length<3||!n[0]||!n[1]||!n[2])return null;let r=n[0].endsWith(`%`)?Number.parseFloat(n[0])/100:Number.parseFloat(n[0]),i=n[1].endsWith(`%`)?Number.parseFloat(n[1])/100*.4:Number.parseFloat(n[1]),a=Number.parseFloat(n[2].replace(/deg$/i,``));return[r,i,a].every(Number.isFinite)?[g(r,0,1),Math.max(0,i),a]:null}function v(e){return g(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function y(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function b(e){let t=_(e);if(!t)return null;let[n,r,i]=t,a=i*Math.PI/180,o=r*Math.cos(a),s=r*Math.sin(a),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,g=-.0041960863*d-.7034186147*f+1.707614701*p;return`#${y(v(m))}${y(v(h))}${y(v(g))}`}function x(e){let t=e.trim(),n=b(t);if(n)return n.toLowerCase();let r=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t);if(r?.[1])return`#${r[1].toLowerCase()}`;let i=/^#([0-9a-f]{3})$/i.exec(t);return i?.[1]?`#${i[1].split(``).map(e=>e+e).join(``).toLowerCase()}`:null}var S=o(),C=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],w=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function T(e,t,n){let r={...e};for(let[e,i]of Object.entries(t))e.startsWith(`light.`)?n===`light`&&(r[e.slice(6)]=i):e.startsWith(`dark.`)?n===`dark`&&(r[e.slice(5)]=i):r[e]=i;return r}function E({t:e,label:t}){let n=e.bg??`#fff`,r=e.surface??n,i=e.fg??`#111`,a=e.muted??i,o=e.primary??`#3b82f6`,s=e.accent??o,c=e.border??a,l=e[`radius-md`]??e.radius??`0.5rem`,u=e[`font-sans`]??e.fontSans??`system-ui, sans-serif`,d=e[`font-display`]??e.fontDisplay??u,f=e[`shadow-2`]??(e.shadow&&e.shadow!==`none`?e.shadow:void 0);return(0,S.jsxs)(`div`,{style:{background:n,color:i,fontFamily:u},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,S.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:a},children:t}),(0,S.jsxs)(`div`,{style:{background:r,border:`1px solid ${c}`,borderRadius:l,boxShadow:f},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,S.jsx)(`div`,{style:{fontFamily:d},className:`text-base font-bold leading-tight`,children:`Aa Heading`}),(0,S.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:a},children:`The quick brown fox jumps over the lazy dog.`}),(0,S.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,S.jsx)(`span`,{style:{background:o,color:n,borderRadius:l},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:`Primary`}),(0,S.jsx)(`span`,{style:{border:`1px solid ${c}`,color:i,borderRadius:l},className:`shrink-0 px-2 py-1 text-[10px]`,children:`Ghost`}),(0,S.jsx)(`span`,{style:{background:s,color:n,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:`Badge`})]}),(0,S.jsx)(`div`,{style:{border:`1px solid ${c}`,borderRadius:l,color:a},className:`text-[10px] px-2 py-1.5 mt-1`,children:`Input field…`})]})]})}function D({kit:e,overrides:t,onSet:n}){let[r,i]=(0,h.useState)(`light`),{t:a}=s(),o=T(r===`light`?e.light:e.dark,t,r);return(0,S.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,S.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:a(`activity:design.colors`)}),(0,S.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:f(`text-[10px] px-1.5 py-0.5`,r===e?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e},e))})]}),(0,S.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:w.filter(e=>o[e]).map(e=>{let t=x(o[e]??``)??`#000000`;return(0,S.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${o[e]}`,children:[(0,S.jsx)(`input`,{type:`color`,value:t,onChange:t=>n(`${r}.${e}`,t.target.value),className:`w-6 h-6 rounded cursor-pointer bg-transparent border border-border/60 p-0`}),(0,S.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function O({onTune:e}){let[t,n]=(0,h.useState)(``),r=({label:t,knob:n,values:r})=>(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:t}),(0,S.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map(t=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>e({[n]:t}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-primary hover:text-primary-foreground`,children:t},t))})]});return(0,S.jsxs)(`div`,{className:`mt-1 flex flex-col gap-1.5 rounded-lg border border-border/60 bg-muted/30 p-2`,children:[(0,S.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:`Tune`}),(0,S.jsx)(r,{label:`Radius`,knob:`radius`,values:[`none`,`sm`,`md`,`lg`,`xl`,`full`]}),(0,S.jsx)(r,{label:`Density`,knob:`density`,values:[`compact`,`cozy`,`comfortable`]}),(0,S.jsx)(r,{label:`Motion`,knob:`motion`,values:[`snappy`,`smooth`,`none`]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:`Font`}),(0,S.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),onKeyDown:n=>{n.key===`Enter`&&t.trim()&&e({font:t.trim()})},placeholder:`Space Grotesk…`,className:`h-6 min-w-0 flex-1 rounded border border-border/60 bg-background/70 px-1.5 text-[10px]`}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>t.trim()&&e({font:t.trim()}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-muted`,children:`Set`})]})]})}function k({className:e}){let{client:o}=d(),{t:l}=s(),[g,_]=(0,h.useState)([]),[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)({}),[w,k]=(0,h.useState)(`web`),[A,j]=(0,h.useState)(``),[M,N]=(0,h.useState)(null);(0,h.useEffect)(()=>{if(!o)return;let e=e=>{let t=e.payload;_(t?.kits??[]),y(t?.activeKit??null),x(t?.overrides??{})},t=e=>{let t=e.payload;t?.ok&&t.kit&&(y(t.kit),x(t.overrides??{}))},n=e=>{let t=e.payload;t?.ok&&t.overrides&&x(t.overrides)},r=e=>{let t=e.payload;t?.ok&&t.overrides?(x(t.overrides),N(`Tuned`)):t?.error&&N(`Tune failed: ${t.error}`)},i=e=>{let t=e.payload;t?.ok&&t.kit&&(y(t.kit),x(t.overrides??{}),N(`Swapped to ${t.kit}`))},a=e=>{let t=e.payload;N(t?.ok?u.t(`activity:design.wrote`,{path:t.path}):u.t(`activity:design.materializeFailed`,{error:t?.error??`error`}))},s=e=>{let t=e.payload;if(!t?.ok){N(u.t(`activity:design.verifyError`,{error:t?.error??`error`}));return}let n=Math.round((t.score??1)*100);N(t.violationCount?u.t(`activity:design.verifyOffPalette`,{pct:n,count:t.violationCount,files:t.filesScanned}):u.t(`activity:design.verifyClean`,{files:t.filesScanned}))};return o.on(`design.list`,e),o.on(`design.use`,t),o.on(`design.set`,n),o.on(`design.tune`,r),o.on(`design.swap`,i),o.on(`design.materialize`,a),o.on(`design.verify`,s),o.send({type:`design.list`}),()=>{o.off(`design.list`,e),o.off(`design.use`,t),o.off(`design.set`,n),o.off(`design.tune`,r),o.off(`design.swap`,i),o.off(`design.materialize`,a),o.off(`design.verify`,s)}},[o]);let P=(0,h.useCallback)(e=>o?.send({type:`design.use`,payload:{kit:e,stack:w}}),[o,w]),F=(0,h.useCallback)((e,t)=>{x(n=>({...n,[e]:t})),o?.send({type:`design.set`,payload:{overrides:{[e]:t}}})},[o]),I=(0,h.useCallback)(e=>o?.send({type:`design.tune`,payload:{tune:e}}),[o]),L=(0,h.useCallback)(()=>{N(u.t(`activity:design.writing`)),o?.send({type:`design.materialize`,payload:{stack:w}})},[o,w]),R=(0,h.useCallback)(()=>{N(u.t(`activity:design.scanning`)),o?.send({type:`design.verify`})},[o]),z=(0,h.useMemo)(()=>{let e=A.trim().toLowerCase();return[...e?g.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):g].sort((e,t)=>e.name.localeCompare(t.name))},[g,A]);return(0,S.jsxs)(`div`,{className:f(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)]`,e),children:[(0,S.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,S.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,S.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,S.jsx)(n,{className:`h-4 w-4`})}),(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:l(`activity:design.heading`)}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l(`activity:design.kitsCount`,{count:z.length})})]})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,S.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,S.jsx)(i,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,S.jsx)(`input`,{value:A,onChange:e=>j(e.target.value),placeholder:l(`activity:design.searchPlaceholder`),className:`h-9 w-full rounded-md border border-border/70 bg-background/70 pl-8 pr-3 text-sm shadow-sm outline-none transition focus:border-primary/40 focus:ring-2 focus:ring-ring/30`})]}),(0,S.jsx)(`select`,{value:w,onChange:e=>k(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:l(`activity:design.stackTitle`),children:C.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))}),M&&(0,S.jsx)(`span`,{className:`min-w-0 truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[11px] text-muted-foreground sm:max-w-56`,children:M}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>p(`chat`),className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,title:l(`common:action.close`),children:(0,S.jsx)(a,{className:`h-4 w-4`})})]})]})})}),(0,S.jsx)(`div`,{ref:m(`design-gallery`),className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain p-3 sm:p-4`,children:z.length===0?(0,S.jsxs)(`div`,{className:`ws-surface mx-auto mt-8 flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,S.jsx)(n,{className:`h-8 w-8 text-primary/60`}),(0,S.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:l(`activity:design.kitsCount`,{count:0})}),(0,S.jsx)(`p`,{className:`text-xs`,children:l(`activity:design.searchPlaceholder`)})]}):(0,S.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:z.map(e=>{let n=v===e.id,i=n?b:{};return(0,S.jsxs)(`div`,{className:f(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,n?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,S.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,S.jsx)(E,{t:T(e.light,i,`light`),label:l(`activity:designStudio.light`)}),(0,S.jsx)(E,{t:T(e.dark,i,`dark`),label:l(`activity:designStudio.dark`)})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,S.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),n&&(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,S.jsx)(t,{className:`w-3 h-3`}),` `,l(`activity:design.active`)]})]}),(0,S.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,S.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>P(e.id),className:f(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,n?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:l(n?`activity:design.reapply`:`activity:design.use`)}),n&&(0,S.jsxs)(`button`,{type:`button`,onClick:L,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:l(`activity:design.materializeTitle`,{stack:w}),children:[(0,S.jsx)(c,{className:`w-3 h-3`}),` `,l(`activity:design.materialize`)]}),n&&(0,S.jsxs)(`button`,{type:`button`,onClick:R,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:l(`activity:design.verifyTitle`),children:[(0,S.jsx)(r,{className:`w-3 h-3`}),` `,l(`activity:design.verify`)]}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),n&&(0,S.jsx)(D,{kit:e,overrides:i,onSet:F}),n&&(0,S.jsx)(O,{onTune:I})]})]},e.id)})})})]})}export{k as DesignGalleryView};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ri as t,Tn as n,Ut as r,Zt as i,at as a,et as o,ga as s,ni as c,xa as l,ya as u}from"./vendor-9hC4n4Me.js";import"./i18n-C2VyJ0Kz.js";import{t as d}from"./useWebSocket-Ba38Sknk.js";import{t as f}from"./utils-DzRQUvln.js";import{o as p}from"./view-navigation-BSA3_knE.js";import{b as m}from"./index-DSXHr5yP.js";var h=e(l(),1);function g(e,t,n){return e<t?t:e>n?n:e}function _(e){let t=/^oklch\(\s*([^)]+)\)$/i.exec(e.trim());if(!t?.[1])return null;let n=(t[1].split(`/`)[0]??``).trim().split(/\s+/);if(n.length<3||!n[0]||!n[1]||!n[2])return null;let r=n[0].endsWith(`%`)?Number.parseFloat(n[0])/100:Number.parseFloat(n[0]),i=n[1].endsWith(`%`)?Number.parseFloat(n[1])/100*.4:Number.parseFloat(n[1]),a=Number.parseFloat(n[2].replace(/deg$/i,``));return[r,i,a].every(Number.isFinite)?[g(r,0,1),Math.max(0,i),a]:null}function v(e){return g(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function y(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function b(e){let t=_(e);if(!t)return null;let[n,r,i]=t,a=i*Math.PI/180,o=r*Math.cos(a),s=r*Math.sin(a),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,g=-.0041960863*d-.7034186147*f+1.707614701*p;return`#${y(v(m))}${y(v(h))}${y(v(g))}`}function x(e){let t=e.trim(),n=b(t);if(n)return n.toLowerCase();let r=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t);if(r?.[1])return`#${r[1].toLowerCase()}`;let i=/^#([0-9a-f]{3})$/i.exec(t);return i?.[1]?`#${i[1].split(``).map(e=>e+e).join(``).toLowerCase()}`:null}var S=o(),C=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],w=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function T(e,t,n){let r={...e};for(let[e,i]of Object.entries(t))e.startsWith(`light.`)?n===`light`&&(r[e.slice(6)]=i):e.startsWith(`dark.`)?n===`dark`&&(r[e.slice(5)]=i):r[e]=i;return r}function E({t:e,label:t}){let n=e.bg??`#fff`,r=e.surface??n,i=e.fg??`#111`,a=e.muted??i,o=e.primary??`#3b82f6`,s=e.accent??o,c=e.border??a,l=e[`radius-md`]??e.radius??`0.5rem`,u=e[`font-sans`]??e.fontSans??`system-ui, sans-serif`,d=e[`font-display`]??e.fontDisplay??u,f=e[`shadow-2`]??(e.shadow&&e.shadow!==`none`?e.shadow:void 0);return(0,S.jsxs)(`div`,{style:{background:n,color:i,fontFamily:u},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,S.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:a},children:t}),(0,S.jsxs)(`div`,{style:{background:r,border:`1px solid ${c}`,borderRadius:l,boxShadow:f},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,S.jsx)(`div`,{style:{fontFamily:d},className:`text-base font-bold leading-tight`,children:`Aa Heading`}),(0,S.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:a},children:`The quick brown fox jumps over the lazy dog.`}),(0,S.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,S.jsx)(`span`,{style:{background:o,color:n,borderRadius:l},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:`Primary`}),(0,S.jsx)(`span`,{style:{border:`1px solid ${c}`,color:i,borderRadius:l},className:`shrink-0 px-2 py-1 text-[10px]`,children:`Ghost`}),(0,S.jsx)(`span`,{style:{background:s,color:n,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:`Badge`})]}),(0,S.jsx)(`div`,{style:{border:`1px solid ${c}`,borderRadius:l,color:a},className:`text-[10px] px-2 py-1.5 mt-1`,children:`Input field…`})]})]})}function D({kit:e,overrides:t,onSet:n}){let[r,i]=(0,h.useState)(`light`),{t:a}=s(),o=T(r===`light`?e.light:e.dark,t,r);return(0,S.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,S.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:a(`activity:design.colors`)}),(0,S.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:f(`text-[10px] px-1.5 py-0.5`,r===e?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e},e))})]}),(0,S.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:w.filter(e=>o[e]).map(e=>{let t=x(o[e]??``)??`#000000`;return(0,S.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${o[e]}`,children:[(0,S.jsx)(`input`,{type:`color`,value:t,onChange:t=>n(`${r}.${e}`,t.target.value),className:`w-6 h-6 rounded cursor-pointer bg-transparent border border-border/60 p-0`}),(0,S.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function O({onTune:e}){let[t,n]=(0,h.useState)(``),r=({label:t,knob:n,values:r})=>(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:t}),(0,S.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map(t=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>e({[n]:t}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-primary hover:text-primary-foreground`,children:t},t))})]});return(0,S.jsxs)(`div`,{className:`mt-1 flex flex-col gap-1.5 rounded-lg border border-border/60 bg-muted/30 p-2`,children:[(0,S.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:`Tune`}),(0,S.jsx)(r,{label:`Radius`,knob:`radius`,values:[`none`,`sm`,`md`,`lg`,`xl`,`full`]}),(0,S.jsx)(r,{label:`Density`,knob:`density`,values:[`compact`,`cozy`,`comfortable`]}),(0,S.jsx)(r,{label:`Motion`,knob:`motion`,values:[`snappy`,`smooth`,`none`]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:`Font`}),(0,S.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),onKeyDown:n=>{n.key===`Enter`&&t.trim()&&e({font:t.trim()})},placeholder:`Space Grotesk…`,className:`h-6 min-w-0 flex-1 rounded border border-border/60 bg-background/70 px-1.5 text-[10px]`}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>t.trim()&&e({font:t.trim()}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-muted`,children:`Set`})]})]})}function k({className:e}){let{client:o}=d(),{t:l}=s(),[g,_]=(0,h.useState)([]),[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)({}),[w,k]=(0,h.useState)(`web`),[A,j]=(0,h.useState)(``),[M,N]=(0,h.useState)(null);(0,h.useEffect)(()=>{if(!o)return;let e=e=>{let t=e.payload;_(t?.kits??[]),y(t?.activeKit??null),x(t?.overrides??{})},t=e=>{let t=e.payload;t?.ok&&t.kit&&(y(t.kit),x(t.overrides??{}))},n=e=>{let t=e.payload;t?.ok&&t.overrides&&x(t.overrides)},r=e=>{let t=e.payload;t?.ok&&t.overrides?(x(t.overrides),N(`Tuned`)):t?.error&&N(`Tune failed: ${t.error}`)},i=e=>{let t=e.payload;t?.ok&&t.kit&&(y(t.kit),x(t.overrides??{}),N(`Swapped to ${t.kit}`))},a=e=>{let t=e.payload;N(t?.ok?u.t(`activity:design.wrote`,{path:t.path}):u.t(`activity:design.materializeFailed`,{error:t?.error??`error`}))},s=e=>{let t=e.payload;if(!t?.ok){N(u.t(`activity:design.verifyError`,{error:t?.error??`error`}));return}let n=Math.round((t.score??1)*100);N(t.violationCount?u.t(`activity:design.verifyOffPalette`,{pct:n,count:t.violationCount,files:t.filesScanned}):u.t(`activity:design.verifyClean`,{files:t.filesScanned}))};return o.on(`design.list`,e),o.on(`design.use`,t),o.on(`design.set`,n),o.on(`design.tune`,r),o.on(`design.swap`,i),o.on(`design.materialize`,a),o.on(`design.verify`,s),o.send({type:`design.list`}),()=>{o.off(`design.list`,e),o.off(`design.use`,t),o.off(`design.set`,n),o.off(`design.tune`,r),o.off(`design.swap`,i),o.off(`design.materialize`,a),o.off(`design.verify`,s)}},[o]);let P=(0,h.useCallback)(e=>o?.send({type:`design.use`,payload:{kit:e,stack:w}}),[o,w]),F=(0,h.useCallback)((e,t)=>{x(n=>({...n,[e]:t})),o?.send({type:`design.set`,payload:{overrides:{[e]:t}}})},[o]),I=(0,h.useCallback)(e=>o?.send({type:`design.tune`,payload:{tune:e}}),[o]),L=(0,h.useCallback)(()=>{N(u.t(`activity:design.writing`)),o?.send({type:`design.materialize`,payload:{stack:w}})},[o,w]),R=(0,h.useCallback)(()=>{N(u.t(`activity:design.scanning`)),o?.send({type:`design.verify`})},[o]),z=(0,h.useMemo)(()=>{let e=A.trim().toLowerCase();return[...e?g.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):g].sort((e,t)=>e.name.localeCompare(t.name))},[g,A]);return(0,S.jsxs)(`div`,{className:f(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)]`,e),children:[(0,S.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,S.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,S.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,S.jsx)(n,{className:`h-4 w-4`})}),(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:l(`activity:design.heading`)}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l(`activity:design.kitsCount`,{count:z.length})})]})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,S.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,S.jsx)(i,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,S.jsx)(`input`,{value:A,onChange:e=>j(e.target.value),placeholder:l(`activity:design.searchPlaceholder`),className:`h-9 w-full rounded-md border border-border/70 bg-background/70 pl-8 pr-3 text-sm shadow-sm outline-none transition focus:border-primary/40 focus:ring-2 focus:ring-ring/30`})]}),(0,S.jsx)(`select`,{value:w,onChange:e=>k(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:l(`activity:design.stackTitle`),children:C.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))}),M&&(0,S.jsx)(`span`,{className:`min-w-0 truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[11px] text-muted-foreground sm:max-w-56`,children:M}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>p(`chat`),className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,title:l(`common:action.close`),children:(0,S.jsx)(a,{className:`h-4 w-4`})})]})]})})}),(0,S.jsx)(`div`,{ref:m(`design-gallery`),className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain p-3 sm:p-4`,children:z.length===0?(0,S.jsxs)(`div`,{className:`ws-surface mx-auto mt-8 flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,S.jsx)(n,{className:`h-8 w-8 text-primary/60`}),(0,S.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:l(`activity:design.kitsCount`,{count:0})}),(0,S.jsx)(`p`,{className:`text-xs`,children:l(`activity:design.searchPlaceholder`)})]}):(0,S.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:z.map(e=>{let n=v===e.id,i=n?b:{};return(0,S.jsxs)(`div`,{className:f(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,n?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,S.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,S.jsx)(E,{t:T(e.light,i,`light`),label:l(`activity:designStudio.light`)}),(0,S.jsx)(E,{t:T(e.dark,i,`dark`),label:l(`activity:designStudio.dark`)})]}),(0,S.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,S.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),n&&(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,S.jsx)(t,{className:`w-3 h-3`}),` `,l(`activity:design.active`)]})]}),(0,S.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,S.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>P(e.id),className:f(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,n?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:l(n?`activity:design.reapply`:`activity:design.use`)}),n&&(0,S.jsxs)(`button`,{type:`button`,onClick:L,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:l(`activity:design.materializeTitle`,{stack:w}),children:[(0,S.jsx)(c,{className:`w-3 h-3`}),` `,l(`activity:design.materialize`)]}),n&&(0,S.jsxs)(`button`,{type:`button`,onClick:R,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:l(`activity:design.verifyTitle`),children:[(0,S.jsx)(r,{className:`w-3 h-3`}),` `,l(`activity:design.verify`)]}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),n&&(0,S.jsx)(D,{kit:e,overrides:i,onSet:F}),n&&(0,S.jsx)(O,{onTune:I})]})]},e.id)})})})]})}export{k as DesignGalleryView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-DaSs2P3S.js";import{Ai as n,Kn as r,Mt as i,Si as a,an as o,at as s,di as c,et as l,ga as u,gi as d,gt as f,in as p,ir as m,it as h,mn as g,pn as _,tn as v,xa as y,xi as b,ya as x,yn as S,yt as C}from"./vendor-9hC4n4Me.js";import"./i18n-CIqbHugq.js";import{t as w}from"./useWebSocket-DLQNx26C.js";import{t as T}from"./utils-DzRQUvln.js";import{m as E,p as D,t as O}from"./stores-nxVpq1NP.js";import{o as k}from"./view-navigation-DuOBOluC.js";import{t as A}from"./button-Bmh1yFe5.js";import{S as j,n as M,r as ee,t as te}from"./index-Dy7C2V-G.js";var N=e(y(),1),P=l(),F={pending:{icon:(0,P.jsx)(b,{className:`w-4 h-4`}),color:`text-muted-foreground`,label:`Pending`},in_progress:{icon:(0,P.jsx)(d,{className:`w-4 h-4 animate-spin`}),color:`text-primary`,label:`In Progress`},blocked:{icon:(0,P.jsx)(S,{className:`w-4 h-4`}),color:`text-warning`,label:`Blocked`},failed:{icon:(0,P.jsx)(a,{className:`w-4 h-4`}),color:`text-destructive`,label:`Failed`},review:{icon:(0,P.jsx)(p,{className:`w-4 h-4`}),color:`text-info`,label:`Review`},completed:{icon:(0,P.jsx)(n,{className:`w-4 h-4`}),color:`text-success`,label:`Done`}},I={critical:`bg-destructive/15 text-destructive`,high:`bg-warning/15 text-warning`,medium:`bg-info/15 text-info`,low:`bg-muted text-muted-foreground`},L={feature:`bg-success/15 text-success`,bugfix:`bg-destructive/15 text-destructive`,refactor:`bg-primary/15 text-primary`,docs:`bg-info/15 text-info`,test:`bg-primary/15 text-primary`,chore:`bg-muted text-muted-foreground`};function R(e){if(!e)return``;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}h ${r}m`:`${n}h`}function z({task:e,onStatusChange:t,onRetry:n,agents:r,onAssign:i,compact:a,className:o}){let{t:s}=u(),c=F[e.status],[l,m]=(0,N.useState)(!1),h=e.status===`in_progress`;return(0,P.jsxs)(`div`,{className:T(`w-full text-left rounded-lg border p-3 transition-all hover:shadow-sm`,h?`border-primary/40 bg-primary/5`:e.status===`completed`?`border-success/35 bg-success/6`:e.status===`failed`?`border-destructive/40 bg-destructive/5`:`border-border bg-card`,o),children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,P.jsx)(`span`,{className:T(`mt-0.5`,c.color),role:`img`,"aria-label":h?s(`common:status.inProgress`):void 0,children:c.icon}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,P.jsx)(`span`,{className:T(`px-1.5 py-0.5 rounded text-[10px] font-medium`,I[e.priority]),children:e.priority}),(0,P.jsx)(`span`,{className:T(`px-1.5 py-0.5 rounded text-[10px] font-medium`,L[e.type]),children:e.type})]}),e.description&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.description})]})]}),e.assignee&&(0,P.jsxs)(`div`,{className:T(`mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium`,h?`bg-primary/15 text-primary`:`bg-muted text-muted-foreground`),children:[h&&(0,P.jsx)(d,{className:`w-3 h-3 animate-spin`,"aria-label":s(`common:status.working`)}),(0,P.jsx)(`span`,{children:e.assignee})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[e.estimateHours?(0,P.jsxs)(`span`,{children:[`~`,e.estimateHours,`h`]}):null,e.actualHours?(0,P.jsxs)(`span`,{children:[`• `,e.actualHours,`h`]}):null,e.startedAt?(0,P.jsxs)(`span`,{children:[`• `,R(Date.now()-e.startedAt)]}):null]}),e.tags.length>0&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:e.tags.map(e=>(0,P.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))}),!a&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-2`,children:[t&&e.status!==`in_progress`&&e.status!==`completed`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`in_progress`),className:`px-2 py-0.5 text-[10px] rounded bg-primary/15 text-primary hover:bg-primary/25 transition-colors`,children:s(`activity:task.start`)}),t&&e.status===`in_progress`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`completed`),className:`px-2 py-0.5 text-[10px] rounded bg-success/15 text-success hover:bg-success/25 transition-colors`,children:s(`activity:task.complete`)}),n&&(e.status===`failed`||e.status===`completed`)&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,children:[(0,P.jsx)(p,{className:`w-3 h-3`}),` `,s(`activity:task.retry`)]}),i&&r&&r.length>0&&(l?(0,P.jsxs)(`select`,{defaultValue:e.assignee??``,onChange:t=>{i(e.id,t.target.value),m(!1)},onBlur:()=>m(!1),className:`px-1 py-0.5 text-[10px] rounded border border-border bg-card`,children:[(0,P.jsx)(`option`,{value:``,children:s(`activity:task.unassigned`)}),r.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>m(!0),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,title:s(`activity:task.assignTitle`),children:[(0,P.jsx)(f,{className:`w-3 h-3`}),` `,s(`activity:task.assign`)]}))]})]})}var B=[{key:`pending`,label:`Pending`,match:[`pending`,`blocked`]},{key:`in_progress`,label:`In Progress`,match:[`in_progress`]},{key:`review`,label:`Review`,match:[`review`]},{key:`failed`,label:`Failed`,match:[`failed`]},{key:`completed`,label:`Done`,match:[`completed`]}],V={pending:`bg-muted text-muted-foreground`,ready:`bg-info/15 text-info`,running:`bg-primary/15 text-primary`,paused:`bg-warning/15 text-warning`,completed:`bg-success/15 text-success`,failed:`bg-destructive/15 text-destructive`,skipped:`bg-muted text-muted-foreground`};function ne(){let{client:e}=w(),{t}=u(),n=D(e=>e.phases),r=D(e=>e.multiBoard),[i,a]=(0,N.useState)(`phase`),[o,s]=(0,N.useState)(null),[l,d]=(0,N.useState)(null),[f,p]=(0,N.useState)(0),m=Math.min(f,Math.max(0,n.length-1)),h=r?n[m]:void 0,g=(0,N.useMemo)(()=>n.flatMap(e=>(e.tasks??[]).map(t=>({...t,phaseId:e.id}))),[n]),_=(0,N.useMemo)(()=>[...new Set(g.map(e=>e.assignee).filter(e=>!!e))],[g]),y=(0,N.useCallback)(t=>e?.send?.(t),[e]),b=(0,N.useCallback)((e,t)=>y({type:`goal.taskStatus`,payload:{taskId:e,status:t}}),[y]),x=(0,N.useCallback)(e=>y({type:`goal.retryTask`,payload:{taskId:e}}),[y]),S=(0,N.useCallback)((e,t)=>y({type:`goal.assignTask`,payload:{taskId:e,agentName:t||void 0}}),[y]),C=(0,N.useCallback)(e=>{j({title:t(`activity:board.newTaskTitle`),placeholder:t(`activity:board.newTaskPlaceholder`),confirmLabel:t(`activity:board.addTask`)}).then(t=>{t&&y({type:`goal.addTask`,payload:{phaseId:e,title:t}})})},[y]),E=(0,N.useCallback)(e=>{o&&y({type:`goal.moveTask`,payload:{taskId:o,toPhaseId:e}}),s(null),d(null)},[o,y]),O=(0,N.useCallback)(e=>{o&&y({type:`goal.taskStatus`,payload:{taskId:o,status:e}}),s(null),d(null)},[o,y]),k={onStatusChange:b,onRetry:x,agents:_,onAssign:S};function A(e){return{draggable:!0,onDragStart:t=>{s(e),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>{s(null),d(null)}}}function M(e,t){return{onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,l!==e&&d(e)},onDragLeave:()=>d(t=>t===e?null:t),onDrop:e=>{e.preventDefault(),t()},"data-hover":l===e||void 0}}return n.length===0?(0,P.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 items-center justify-center text-muted-foreground`,children:(0,P.jsx)(`p`,{className:`text-sm`,children:t(`activity:board.empty`)})}):(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2`,children:[(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`activity:board.summary`,{phases:n.length,tasks:g.length})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(`phase`),className:T(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,i===`phase`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(c,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.phases`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(`status`),className:T(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,i===`status`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(v,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.statusTab`)]})]})]}),r&&h?(0,P.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,P.jsx)(`div`,{className:`flex shrink-0 gap-1 overflow-x-auto border-b border-border px-3 py-1.5`,children:n.map((e,t)=>(0,P.jsxs)(`button`,{type:`button`,onClick:()=>p(t),className:T(`shrink-0 rounded-t px-3 py-1.5 text-xs font-medium transition-colors`,t===m?`border-primary/40 bg-primary/10 text-primary`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,P.jsx)(`span`,{className:`truncate`,children:e.name}),(0,P.jsxs)(`span`,{className:`ml-1.5 text-[10px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount]})]},e.id))}),(0,P.jsx)(W,{phase:h,allTasks:g,layout:i,dragId:o,hoverKey:l,callbacks:k,draggable:A,dropZone:M,dropToPhase:E,dropToStatus:O,onAddTask:C})]}):(0,P.jsx)(U,{phases:n,allTasks:g,layout:i,dragId:o,hoverKey:l,callbacks:k,draggable:A,dropZone:M,dropToPhase:E,dropToStatus:O,onAddTask:C})]})}function H({phase:e,phaseTasks:t,callbacks:n,draggable:r,dropZone:i,dropToPhase:a,onAddTask:o,dragId:s,hoverKey:c}){let{t:l}=u();return(0,P.jsxs)(`div`,{...i(`phase:${e.id}`,()=>a(e.id)),className:T(`flex min-h-0 w-80 shrink-0 flex-col rounded-lg border bg-muted/30 transition-colors`,c===`phase:${e.id}`?`border-primary/60 bg-primary/5`:`border-border`),children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,P.jsx)(`span`,{className:T(`rounded px-1.5 py-0.5 text-[10px] font-medium capitalize`,V[e.status]),children:e.status})]}),(0,P.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount,` · `,e.progressPercent,`%`]})]}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>o(e.id),title:l(`activity:board.addTask`),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,P.jsx)(_,{className:`h-4 w-4`})})]}),(0,P.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-2`,children:t.length===0?(0,P.jsx)(`p`,{className:`px-1 py-4 text-center text-[11px] text-muted-foreground`,children:l(`activity:board.dropHere`)}):t.map(e=>(0,P.jsx)(`div`,{...r(e.id),className:T(s===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,...n})},e.id))})]})}function U({phases:e,allTasks:t,layout:n,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,dropToStatus:l,onAddTask:u}){return(0,P.jsx)(P.Fragment,{children:n===`phase`?(0,P.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:e.map(e=>(0,P.jsx)(H,{phase:e,phaseTasks:t.filter(t=>t.phaseId===e.id),callbacks:a,draggable:o,dropZone:s,dropToPhase:c,onAddTask:u,dragId:r,hoverKey:i},e.id))}):(0,P.jsx)(G,{phases:e,allTasks:t,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToStatus:l})})}function W({phase:e,allTasks:t,layout:n,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,dropToStatus:l,onAddTask:d}){let f=t.filter(t=>t.phaseId===e.id),{t:p}=u();return n===`phase`?(0,P.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:(0,P.jsx)(H,{phase:e,phaseTasks:f,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,onAddTask:d,dragId:r,hoverKey:i})}):(0,P.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain p-3`,children:(0,P.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${B.length}, minmax(0, 1fr))`},children:[(0,P.jsx)(`div`,{}),B.map(e=>(0,P.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:p(`activity:board.status.${e.key}`)},e.key)),(0,P.jsxs)(K,{children:[(0,P.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,P.jsx)(`span`,{className:T(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(t=>{let n=f.filter(e=>t.match.includes(e.status)),c=`cell:${e.id}:${t.key}`;return(0,P.jsx)(`div`,{...s(c,()=>l(t.key)),className:T(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,i===c?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:n.map(e=>(0,P.jsx)(`div`,{...o(e.id),className:T(r===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...a})},e.id))},t.key)})]},e.id)]})})}function G({phases:e,allTasks:t,dragId:n,hoverKey:r,callbacks:i,draggable:a,dropZone:o,dropToStatus:s}){let{t:c}=u();return(0,P.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${B.length}, minmax(0, 1fr))`},children:[(0,P.jsx)(`div`,{}),B.map(e=>(0,P.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:c(`activity:board.status.${e.key}`)},e.key)),e.map(e=>(0,P.jsxs)(K,{children:[(0,P.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,P.jsx)(`span`,{className:T(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(c=>{let l=t.filter(t=>t.phaseId===e.id&&c.match.includes(t.status)),u=`cell:${e.id}:${c.key}`;return(0,P.jsx)(`div`,{...o(u,()=>s(c.key)),className:T(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,r===u?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:l.map(e=>(0,P.jsx)(`div`,{...a(e.id),className:T(n===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...i})},e.id))},c.key)})]},e.id))]})}function K({children:e}){return(0,P.jsx)(P.Fragment,{children:e})}function q({onClose:e}){let{client:n}=w(),{t:a}=u(),c=D(e=>e.phases),l=D(e=>e.overallPercent),d=D(e=>e.autonomous),f=D(e=>e.title),p=D(e=>e.goal),v=D(e=>e.status),y=D(e=>e.lastError),b=D(e=>e.graphs);(0,N.useEffect)(()=>{n?.send?.({type:`goal.list`}),n?.send?.({type:`goal.state`})},[n]);let j=O(e=>e.worktrees),F=O(e=>e.baseBranch),[I,L]=(0,N.useState)(``),[R,z]=(0,N.useState)(null),[B,V]=(0,N.useState)(!1),[H,U]=(0,N.useState)(!0),[W,G]=(0,N.useState)(!1),[K,q]=(0,N.useState)(!1),[J,re]=(0,N.useState)(!1),Y=E(e=>e.result),X=E(e=>e.loading),Z=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(Z.current&&clearTimeout(Z.current),!I.trim()){E.getState().clear();return}return Z.current=setTimeout(()=>{E.getState().setLoading();let e=E.getState().nextSeq();n?.send?.({type:`goal.assess`,payload:{goal:I,seq:e}})},800),()=>{Z.current&&clearTimeout(Z.current)}},[I,n]),(0,N.useEffect)(()=>{!I.trim()&&!R&&E.getState().clear()},[I,R]);let Q=c.length>0,ie=R!=null&&!Q;(0,N.useEffect)(()=>{Q&&z(null)},[Q]);let ae=(0,N.useCallback)(()=>{let e=I.trim();if(!e||R!=null)return;let r=t.getState();r.addMessage({role:`user`,content:e}),r.addMessage({role:`assistant`,content:x.t(`activity:goalRun.planningAck`)}),z(e),L(``),n?.send?.({type:`goal.start`,payload:{title:e,autonomous:!0,worktrees:H,multiBoard:W,verifyTasks:K,chimeraReview:J}}),k(`chat`)},[I,R,n,H]),oe=(0,N.useCallback)(()=>{n?.send?.({type:`goal.stop`,payload:{}}),z(null)},[n]),se=(0,N.useCallback)(()=>{n?.send?.({type:`goal.toggleAutonomous`,payload:{}})},[n]),ce=(0,N.useCallback)(()=>{n?.send?.(v===`paused`?{type:`goal.resume`,payload:{}}:{type:`goal.pause`,payload:{}})},[n,v]),le=(0,N.useCallback)(()=>{n?.send?.({type:`goal.stop`,payload:{}})},[n]),ue=(0,N.useCallback)(()=>{n?.send?.({type:`goal.clear`,payload:{}}),D.getState().clear(),z(null),L(``)},[n]),[de,$]=(0,N.useState)(!1),fe=(0,N.useCallback)(()=>{n?.send?.({type:`goal.revert`,payload:{}}),$(!1)},[n]),pe=v===`running`||v===`paused`,me=v===`stopped`||v===`completed`||v===`failed`,he=(0,N.useCallback)(e=>{e&&n?.send?.({type:`goal.load`,payload:{graphId:e}})},[n]);return(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,P.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2 border-b bg-card px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(m,{className:`h-5 w-5 text-muted-foreground`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`text-lg font-semibold`,children:Q&&f||`Goal`}),Q&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`activity:goalRun.summary`,{count:c.length,pct:l})})]}),Q&&(0,P.jsx)(`span`,{className:T(`rounded border px-2 py-0.5 text-[11px] font-medium capitalize`,v===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:v===`paused`||v===`stopped`?`border-warning/40 bg-warning/10 text-warning`:v===`completed`?`border-success/40 bg-success/10 text-success`:`border-primary/30 bg-primary/10 text-primary`),title:y??void 0,children:v})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 sm:justify-end`,children:[b.length>0&&(0,P.jsxs)(`select`,{value:Q?b.find(e=>e.title===f)?.id??``:``,onChange:e=>he(e.target.value),title:a(`activity:goalRun.switchBoard`),className:`min-w-0 flex-1 rounded border border-border bg-card px-2 py-1 text-xs text-foreground sm:w-72 sm:flex-none`,children:[(0,P.jsx)(`option`,{value:``,disabled:!0,children:a(`activity:goalRun.boardsCount`,{count:b.length})}),b.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.title,` · `,e.status]},e.id))]}),Q&&(0,P.jsxs)(`button`,{type:`button`,onClick:se,title:a(`activity:goalRun.toggleAutonomousTitle`),className:T(`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs transition-colors`,d?`border-primary/30 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(h,{className:`h-3.5 w-3.5`}),` `,a(d?`activity:goalRun.autonomous`:`activity:goalRun.manual`)]}),pe&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ce,title:a(v===`paused`?`activity:goalRun.resumeTitle`:`activity:goalRun.pauseTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[v===`paused`?(0,P.jsx)(g,{className:`h-3.5 w-3.5`}):(0,P.jsx)(S,{className:`h-3.5 w-3.5`}),a(v===`paused`?`activity:goalRun.resume`:`activity:goalRun.pause`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:le,title:a(`activity:goalRun.stopTitle`),className:`inline-flex items-center gap-1 rounded border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20`,children:[(0,P.jsx)(i,{className:`h-3.5 w-3.5 fill-current`}),` `,a(`activity:goalRun.stop`)]})]}),Q&&me&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ue,title:a(`activity:goalRun.newTitle`),className:`inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-2 py-1 text-xs font-medium text-primary transition-colors hover:bg-primary/20`,children:[(0,P.jsx)(_,{className:`h-3.5 w-3.5`}),` `,a(`activity:goalRun.newLabel`)]}),de?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 text-xs`,children:[(0,P.jsx)(`span`,{className:`text-warning`,children:a(`activity:goalRun.revertConfirm`)}),(0,P.jsx)(`button`,{type:`button`,onClick:fe,className:`rounded bg-destructive/15 px-1.5 py-0.5 font-medium text-destructive hover:bg-destructive/25`,children:a(`common:action.yes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>$(!1),className:`rounded px-1.5 py-0.5 text-muted-foreground hover:text-foreground`,children:a(`common:action.no`)})]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>$(!0),title:a(`activity:goalRun.revertTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,P.jsx)(C,{className:`h-3.5 w-3.5`}),` `,a(`activity:goalRun.revert`)]})]}),(0,P.jsx)(A,{variant:`ghost`,size:`icon`,onClick:e,children:(0,P.jsx)(s,{className:`h-4 w-4`})})]})]}),Q&&p&&(0,P.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 bg-muted/20 px-4 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(o,{className:`h-3 w-3`}),` `,a(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:p})]}),Q?(0,P.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,P.jsx)(ne,{})}):ie?(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-5 text-center`,children:[(0,P.jsx)(r,{className:`h-10 w-10 mx-auto animate-spin text-primary/70`}),(0,P.jsxs)(`div`,{className:`space-y-1`,children:[(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:a(`activity:goalRun.planning`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`activity:goalRun.planningBody`)})]}),(0,P.jsxs)(`div`,{className:`rounded-lg border border-border bg-card px-4 py-3 text-left`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(o,{className:`h-3 w-3`}),` `,a(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:R})]}),(0,P.jsxs)(A,{variant:`outline`,onClick:oe,className:`gap-2`,children:[(0,P.jsx)(i,{className:`h-4 w-4 fill-current`}),` `,a(`common:action.cancel`)]})]})}):(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-6`,children:[(0,P.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,P.jsx)(o,{className:`h-10 w-10 mx-auto text-primary/60`}),(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:a(`activity:goalRun.startHeading`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`activity:goalRun.startBody`)})]}),(0,P.jsx)(`textarea`,{value:I,onChange:e=>L(e.target.value),placeholder:a(`activity:goalRun.startPlaceholder`),rows:5,className:`w-full rounded-lg border border-border bg-card px-4 py-3 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground/70`,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),ae())}}),X&&(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(r,{className:`h-3 w-3 animate-spin`}),a(`activity:goalRun.assess.analyzing`)]}),!X&&Y&&!Y.parseFailed&&(0,P.jsxs)(`div`,{className:T(`rounded-lg border px-3 py-2 text-xs space-y-1.5`,Y.realistic?`border-success/40 bg-success/10`:`border-warning/40 bg-warning/10`),children:[(0,P.jsx)(`div`,{className:`flex items-center gap-1.5 font-medium`,children:Y.realistic?(0,P.jsx)(`span`,{className:`text-success`,children:a(`activity:goalRun.assess.realistic`)}):(0,P.jsx)(`span`,{className:`text-warning`,children:a(`activity:goalRun.assess.durationConcern`)})}),Y.durationClaimed&&(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:a(`activity:goalRun.assess.durationClaimed`,{duration:Y.durationClaimed})}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:Y.explanation}),Y.recommendedDuration&&(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:a(`activity:goalRun.assess.recommendation`,{duration:Y.recommendedDuration})}),Y.concerns.length>0&&(0,P.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,P.jsx)(`p`,{className:`font-medium text-foreground/80`,children:a(`activity:goalRun.assess.concerns`)}),(0,P.jsx)(`ul`,{className:`list-disc pl-4 space-y-0.5 text-muted-foreground`,children:Y.concerns.map((e,t)=>(0,P.jsx)(`li`,{children:e},t))})]})]}),!X&&Y?.parseFailed&&(0,P.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-muted/20 px-3 py-2 text-xs text-muted-foreground`,children:a(`activity:goalRun.assess.analysisFailed`)}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:H,onChange:e=>U(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.isolateLabel`)]}),(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-3 text-xs text-muted-foreground`,children:[(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:W,onChange:e=>G(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.multiBoardLabel`)]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:K,onChange:e=>q(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.verifyTasksLabel`)]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:J,onChange:e=>re(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.chimeraReviewLabel`)]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[!X&&Y&&!Y.realistic&&!Y.parseFailed&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>E.getState().clear(),className:`shrink-0 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,title:a(`activity:goalRun.assess.overrideTitle`),children:a(`activity:goalRun.assess.override`)}),(0,P.jsxs)(A,{onClick:ae,disabled:!I.trim()||R!=null||X||!X&&Y!=null&&!Y.parseFailed&&!Y.realistic,className:`flex-1 gap-2`,title:I.trim()&&!X&&Y&&!Y.parseFailed&&!Y.realistic?a(`activity:goalRun.assess.disableTitle`):``,children:[(0,P.jsx)(g,{className:`h-4 w-4`}),a(`activity:goalRun.startButton`)]})]}),(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[a(`activity:goalRun.ctrlHint`),` ·`,` `,a(H?`activity:goalRun.isolateOn`:`activity:goalRun.isolateOff`)]})]})}),j.length>0&&(0,P.jsxs)(`div`,{className:`border-t bg-card/50 shrink-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-4 pt-2 text-xs`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!1),className:T(`rounded px-2 py-0.5 border transition-colors`,B?`border-border text-muted-foreground hover:text-foreground`:`bg-primary/10 border-primary/30 text-primary`),children:a(`activity:goalRun.lanes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:T(`rounded px-2 py-0.5 border transition-colors`,B?`bg-primary/10 border-primary/30 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:a(`activity:goalRun.graph`)})]}),(0,P.jsxs)(`div`,{className:`space-y-2 px-4 pb-3`,children:[(0,P.jsx)(te,{}),B?(0,P.jsx)(ee,{worktrees:j,baseBranch:F}):(0,P.jsx)(M,{worktrees:j,baseBranch:F})]})]})]})}export{q as GoalView};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-DaSs2P3S.js";import{Ai as n,Kn as r,Mt as i,Si as a,an as o,at as s,di as c,et as l,ga as u,gi as d,gt as f,in as p,ir as m,it as h,mn as g,pn as _,tn as v,xa as y,xi as b,ya as x,yn as S,yt as C}from"./vendor-9hC4n4Me.js";import"./i18n-C2VyJ0Kz.js";import{t as w}from"./useWebSocket-Ba38Sknk.js";import{t as T}from"./utils-DzRQUvln.js";import{m as E,p as D,t as O}from"./stores-hEu6z1qz.js";import{o as k}from"./view-navigation-BSA3_knE.js";import{t as A}from"./button-Bmh1yFe5.js";import{S as j,n as M,r as ee,t as te}from"./index-DSXHr5yP.js";var N=e(y(),1),P=l(),F={pending:{icon:(0,P.jsx)(b,{className:`w-4 h-4`}),color:`text-muted-foreground`,label:`Pending`},in_progress:{icon:(0,P.jsx)(d,{className:`w-4 h-4 animate-spin`}),color:`text-primary`,label:`In Progress`},blocked:{icon:(0,P.jsx)(S,{className:`w-4 h-4`}),color:`text-warning`,label:`Blocked`},failed:{icon:(0,P.jsx)(a,{className:`w-4 h-4`}),color:`text-destructive`,label:`Failed`},review:{icon:(0,P.jsx)(p,{className:`w-4 h-4`}),color:`text-info`,label:`Review`},completed:{icon:(0,P.jsx)(n,{className:`w-4 h-4`}),color:`text-success`,label:`Done`}},I={critical:`bg-destructive/15 text-destructive`,high:`bg-warning/15 text-warning`,medium:`bg-info/15 text-info`,low:`bg-muted text-muted-foreground`},L={feature:`bg-success/15 text-success`,bugfix:`bg-destructive/15 text-destructive`,refactor:`bg-primary/15 text-primary`,docs:`bg-info/15 text-info`,test:`bg-primary/15 text-primary`,chore:`bg-muted text-muted-foreground`};function R(e){if(!e)return``;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}h ${r}m`:`${n}h`}function z({task:e,onStatusChange:t,onRetry:n,agents:r,onAssign:i,compact:a,className:o}){let{t:s}=u(),c=F[e.status],[l,m]=(0,N.useState)(!1),h=e.status===`in_progress`;return(0,P.jsxs)(`div`,{className:T(`w-full text-left rounded-lg border p-3 transition-all hover:shadow-sm`,h?`border-primary/40 bg-primary/5`:e.status===`completed`?`border-success/35 bg-success/6`:e.status===`failed`?`border-destructive/40 bg-destructive/5`:`border-border bg-card`,o),children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,P.jsx)(`span`,{className:T(`mt-0.5`,c.color),role:`img`,"aria-label":h?s(`common:status.inProgress`):void 0,children:c.icon}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,P.jsx)(`span`,{className:T(`px-1.5 py-0.5 rounded text-[10px] font-medium`,I[e.priority]),children:e.priority}),(0,P.jsx)(`span`,{className:T(`px-1.5 py-0.5 rounded text-[10px] font-medium`,L[e.type]),children:e.type})]}),e.description&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.description})]})]}),e.assignee&&(0,P.jsxs)(`div`,{className:T(`mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium`,h?`bg-primary/15 text-primary`:`bg-muted text-muted-foreground`),children:[h&&(0,P.jsx)(d,{className:`w-3 h-3 animate-spin`,"aria-label":s(`common:status.working`)}),(0,P.jsx)(`span`,{children:e.assignee})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[e.estimateHours?(0,P.jsxs)(`span`,{children:[`~`,e.estimateHours,`h`]}):null,e.actualHours?(0,P.jsxs)(`span`,{children:[`• `,e.actualHours,`h`]}):null,e.startedAt?(0,P.jsxs)(`span`,{children:[`• `,R(Date.now()-e.startedAt)]}):null]}),e.tags.length>0&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:e.tags.map(e=>(0,P.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))}),!a&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-2`,children:[t&&e.status!==`in_progress`&&e.status!==`completed`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`in_progress`),className:`px-2 py-0.5 text-[10px] rounded bg-primary/15 text-primary hover:bg-primary/25 transition-colors`,children:s(`activity:task.start`)}),t&&e.status===`in_progress`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`completed`),className:`px-2 py-0.5 text-[10px] rounded bg-success/15 text-success hover:bg-success/25 transition-colors`,children:s(`activity:task.complete`)}),n&&(e.status===`failed`||e.status===`completed`)&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,children:[(0,P.jsx)(p,{className:`w-3 h-3`}),` `,s(`activity:task.retry`)]}),i&&r&&r.length>0&&(l?(0,P.jsxs)(`select`,{defaultValue:e.assignee??``,onChange:t=>{i(e.id,t.target.value),m(!1)},onBlur:()=>m(!1),className:`px-1 py-0.5 text-[10px] rounded border border-border bg-card`,children:[(0,P.jsx)(`option`,{value:``,children:s(`activity:task.unassigned`)}),r.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>m(!0),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,title:s(`activity:task.assignTitle`),children:[(0,P.jsx)(f,{className:`w-3 h-3`}),` `,s(`activity:task.assign`)]}))]})]})}var B=[{key:`pending`,label:`Pending`,match:[`pending`,`blocked`]},{key:`in_progress`,label:`In Progress`,match:[`in_progress`]},{key:`review`,label:`Review`,match:[`review`]},{key:`failed`,label:`Failed`,match:[`failed`]},{key:`completed`,label:`Done`,match:[`completed`]}],V={pending:`bg-muted text-muted-foreground`,ready:`bg-info/15 text-info`,running:`bg-primary/15 text-primary`,paused:`bg-warning/15 text-warning`,completed:`bg-success/15 text-success`,failed:`bg-destructive/15 text-destructive`,skipped:`bg-muted text-muted-foreground`};function ne(){let{client:e}=w(),{t}=u(),n=D(e=>e.phases),r=D(e=>e.multiBoard),[i,a]=(0,N.useState)(`phase`),[o,s]=(0,N.useState)(null),[l,d]=(0,N.useState)(null),[f,p]=(0,N.useState)(0),m=Math.min(f,Math.max(0,n.length-1)),h=r?n[m]:void 0,g=(0,N.useMemo)(()=>n.flatMap(e=>(e.tasks??[]).map(t=>({...t,phaseId:e.id}))),[n]),_=(0,N.useMemo)(()=>[...new Set(g.map(e=>e.assignee).filter(e=>!!e))],[g]),y=(0,N.useCallback)(t=>e?.send?.(t),[e]),b=(0,N.useCallback)((e,t)=>y({type:`goal.taskStatus`,payload:{taskId:e,status:t}}),[y]),x=(0,N.useCallback)(e=>y({type:`goal.retryTask`,payload:{taskId:e}}),[y]),S=(0,N.useCallback)((e,t)=>y({type:`goal.assignTask`,payload:{taskId:e,agentName:t||void 0}}),[y]),C=(0,N.useCallback)(e=>{j({title:t(`activity:board.newTaskTitle`),placeholder:t(`activity:board.newTaskPlaceholder`),confirmLabel:t(`activity:board.addTask`)}).then(t=>{t&&y({type:`goal.addTask`,payload:{phaseId:e,title:t}})})},[y]),E=(0,N.useCallback)(e=>{o&&y({type:`goal.moveTask`,payload:{taskId:o,toPhaseId:e}}),s(null),d(null)},[o,y]),O=(0,N.useCallback)(e=>{o&&y({type:`goal.taskStatus`,payload:{taskId:o,status:e}}),s(null),d(null)},[o,y]),k={onStatusChange:b,onRetry:x,agents:_,onAssign:S};function A(e){return{draggable:!0,onDragStart:t=>{s(e),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>{s(null),d(null)}}}function M(e,t){return{onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,l!==e&&d(e)},onDragLeave:()=>d(t=>t===e?null:t),onDrop:e=>{e.preventDefault(),t()},"data-hover":l===e||void 0}}return n.length===0?(0,P.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 items-center justify-center text-muted-foreground`,children:(0,P.jsx)(`p`,{className:`text-sm`,children:t(`activity:board.empty`)})}):(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2`,children:[(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`activity:board.summary`,{phases:n.length,tasks:g.length})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(`phase`),className:T(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,i===`phase`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(c,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.phases`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(`status`),className:T(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,i===`status`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(v,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.statusTab`)]})]})]}),r&&h?(0,P.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,P.jsx)(`div`,{className:`flex shrink-0 gap-1 overflow-x-auto border-b border-border px-3 py-1.5`,children:n.map((e,t)=>(0,P.jsxs)(`button`,{type:`button`,onClick:()=>p(t),className:T(`shrink-0 rounded-t px-3 py-1.5 text-xs font-medium transition-colors`,t===m?`border-primary/40 bg-primary/10 text-primary`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,P.jsx)(`span`,{className:`truncate`,children:e.name}),(0,P.jsxs)(`span`,{className:`ml-1.5 text-[10px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount]})]},e.id))}),(0,P.jsx)(W,{phase:h,allTasks:g,layout:i,dragId:o,hoverKey:l,callbacks:k,draggable:A,dropZone:M,dropToPhase:E,dropToStatus:O,onAddTask:C})]}):(0,P.jsx)(U,{phases:n,allTasks:g,layout:i,dragId:o,hoverKey:l,callbacks:k,draggable:A,dropZone:M,dropToPhase:E,dropToStatus:O,onAddTask:C})]})}function H({phase:e,phaseTasks:t,callbacks:n,draggable:r,dropZone:i,dropToPhase:a,onAddTask:o,dragId:s,hoverKey:c}){let{t:l}=u();return(0,P.jsxs)(`div`,{...i(`phase:${e.id}`,()=>a(e.id)),className:T(`flex min-h-0 w-80 shrink-0 flex-col rounded-lg border bg-muted/30 transition-colors`,c===`phase:${e.id}`?`border-primary/60 bg-primary/5`:`border-border`),children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,P.jsx)(`span`,{className:T(`rounded px-1.5 py-0.5 text-[10px] font-medium capitalize`,V[e.status]),children:e.status})]}),(0,P.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount,` · `,e.progressPercent,`%`]})]}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>o(e.id),title:l(`activity:board.addTask`),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,P.jsx)(_,{className:`h-4 w-4`})})]}),(0,P.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-2`,children:t.length===0?(0,P.jsx)(`p`,{className:`px-1 py-4 text-center text-[11px] text-muted-foreground`,children:l(`activity:board.dropHere`)}):t.map(e=>(0,P.jsx)(`div`,{...r(e.id),className:T(s===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,...n})},e.id))})]})}function U({phases:e,allTasks:t,layout:n,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,dropToStatus:l,onAddTask:u}){return(0,P.jsx)(P.Fragment,{children:n===`phase`?(0,P.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:e.map(e=>(0,P.jsx)(H,{phase:e,phaseTasks:t.filter(t=>t.phaseId===e.id),callbacks:a,draggable:o,dropZone:s,dropToPhase:c,onAddTask:u,dragId:r,hoverKey:i},e.id))}):(0,P.jsx)(G,{phases:e,allTasks:t,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToStatus:l})})}function W({phase:e,allTasks:t,layout:n,dragId:r,hoverKey:i,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,dropToStatus:l,onAddTask:d}){let f=t.filter(t=>t.phaseId===e.id),{t:p}=u();return n===`phase`?(0,P.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:(0,P.jsx)(H,{phase:e,phaseTasks:f,callbacks:a,draggable:o,dropZone:s,dropToPhase:c,onAddTask:d,dragId:r,hoverKey:i})}):(0,P.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain p-3`,children:(0,P.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${B.length}, minmax(0, 1fr))`},children:[(0,P.jsx)(`div`,{}),B.map(e=>(0,P.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:p(`activity:board.status.${e.key}`)},e.key)),(0,P.jsxs)(K,{children:[(0,P.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,P.jsx)(`span`,{className:T(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(t=>{let n=f.filter(e=>t.match.includes(e.status)),c=`cell:${e.id}:${t.key}`;return(0,P.jsx)(`div`,{...s(c,()=>l(t.key)),className:T(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,i===c?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:n.map(e=>(0,P.jsx)(`div`,{...o(e.id),className:T(r===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...a})},e.id))},t.key)})]},e.id)]})})}function G({phases:e,allTasks:t,dragId:n,hoverKey:r,callbacks:i,draggable:a,dropZone:o,dropToStatus:s}){let{t:c}=u();return(0,P.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${B.length}, minmax(0, 1fr))`},children:[(0,P.jsx)(`div`,{}),B.map(e=>(0,P.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:c(`activity:board.status.${e.key}`)},e.key)),e.map(e=>(0,P.jsxs)(K,{children:[(0,P.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,P.jsx)(`span`,{className:T(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(c=>{let l=t.filter(t=>t.phaseId===e.id&&c.match.includes(t.status)),u=`cell:${e.id}:${c.key}`;return(0,P.jsx)(`div`,{...o(u,()=>s(c.key)),className:T(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,r===u?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:l.map(e=>(0,P.jsx)(`div`,{...a(e.id),className:T(n===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...i})},e.id))},c.key)})]},e.id))]})}function K({children:e}){return(0,P.jsx)(P.Fragment,{children:e})}function q({onClose:e}){let{client:n}=w(),{t:a}=u(),c=D(e=>e.phases),l=D(e=>e.overallPercent),d=D(e=>e.autonomous),f=D(e=>e.title),p=D(e=>e.goal),v=D(e=>e.status),y=D(e=>e.lastError),b=D(e=>e.graphs);(0,N.useEffect)(()=>{n?.send?.({type:`goal.list`}),n?.send?.({type:`goal.state`})},[n]);let j=O(e=>e.worktrees),F=O(e=>e.baseBranch),[I,L]=(0,N.useState)(``),[R,z]=(0,N.useState)(null),[B,V]=(0,N.useState)(!1),[H,U]=(0,N.useState)(!0),[W,G]=(0,N.useState)(!1),[K,q]=(0,N.useState)(!1),[J,re]=(0,N.useState)(!1),Y=E(e=>e.result),X=E(e=>e.loading),Z=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(Z.current&&clearTimeout(Z.current),!I.trim()){E.getState().clear();return}return Z.current=setTimeout(()=>{E.getState().setLoading();let e=E.getState().nextSeq();n?.send?.({type:`goal.assess`,payload:{goal:I,seq:e}})},800),()=>{Z.current&&clearTimeout(Z.current)}},[I,n]),(0,N.useEffect)(()=>{!I.trim()&&!R&&E.getState().clear()},[I,R]);let Q=c.length>0,ie=R!=null&&!Q;(0,N.useEffect)(()=>{Q&&z(null)},[Q]);let ae=(0,N.useCallback)(()=>{let e=I.trim();if(!e||R!=null)return;let r=t.getState();r.addMessage({role:`user`,content:e}),r.addMessage({role:`assistant`,content:x.t(`activity:goalRun.planningAck`)}),z(e),L(``),n?.send?.({type:`goal.start`,payload:{title:e,autonomous:!0,worktrees:H,multiBoard:W,verifyTasks:K,chimeraReview:J}}),k(`chat`)},[I,R,n,H]),oe=(0,N.useCallback)(()=>{n?.send?.({type:`goal.stop`,payload:{}}),z(null)},[n]),se=(0,N.useCallback)(()=>{n?.send?.({type:`goal.toggleAutonomous`,payload:{}})},[n]),ce=(0,N.useCallback)(()=>{n?.send?.(v===`paused`?{type:`goal.resume`,payload:{}}:{type:`goal.pause`,payload:{}})},[n,v]),le=(0,N.useCallback)(()=>{n?.send?.({type:`goal.stop`,payload:{}})},[n]),ue=(0,N.useCallback)(()=>{n?.send?.({type:`goal.clear`,payload:{}}),D.getState().clear(),z(null),L(``)},[n]),[de,$]=(0,N.useState)(!1),fe=(0,N.useCallback)(()=>{n?.send?.({type:`goal.revert`,payload:{}}),$(!1)},[n]),pe=v===`running`||v===`paused`,me=v===`stopped`||v===`completed`||v===`failed`,he=(0,N.useCallback)(e=>{e&&n?.send?.({type:`goal.load`,payload:{graphId:e}})},[n]);return(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,P.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2 border-b bg-card px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(m,{className:`h-5 w-5 text-muted-foreground`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`text-lg font-semibold`,children:Q&&f||`Goal`}),Q&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`activity:goalRun.summary`,{count:c.length,pct:l})})]}),Q&&(0,P.jsx)(`span`,{className:T(`rounded border px-2 py-0.5 text-[11px] font-medium capitalize`,v===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:v===`paused`||v===`stopped`?`border-warning/40 bg-warning/10 text-warning`:v===`completed`?`border-success/40 bg-success/10 text-success`:`border-primary/30 bg-primary/10 text-primary`),title:y??void 0,children:v})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 sm:justify-end`,children:[b.length>0&&(0,P.jsxs)(`select`,{value:Q?b.find(e=>e.title===f)?.id??``:``,onChange:e=>he(e.target.value),title:a(`activity:goalRun.switchBoard`),className:`min-w-0 flex-1 rounded border border-border bg-card px-2 py-1 text-xs text-foreground sm:w-72 sm:flex-none`,children:[(0,P.jsx)(`option`,{value:``,disabled:!0,children:a(`activity:goalRun.boardsCount`,{count:b.length})}),b.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.title,` · `,e.status]},e.id))]}),Q&&(0,P.jsxs)(`button`,{type:`button`,onClick:se,title:a(`activity:goalRun.toggleAutonomousTitle`),className:T(`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs transition-colors`,d?`border-primary/30 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(h,{className:`h-3.5 w-3.5`}),` `,a(d?`activity:goalRun.autonomous`:`activity:goalRun.manual`)]}),pe&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ce,title:a(v===`paused`?`activity:goalRun.resumeTitle`:`activity:goalRun.pauseTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[v===`paused`?(0,P.jsx)(g,{className:`h-3.5 w-3.5`}):(0,P.jsx)(S,{className:`h-3.5 w-3.5`}),a(v===`paused`?`activity:goalRun.resume`:`activity:goalRun.pause`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:le,title:a(`activity:goalRun.stopTitle`),className:`inline-flex items-center gap-1 rounded border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20`,children:[(0,P.jsx)(i,{className:`h-3.5 w-3.5 fill-current`}),` `,a(`activity:goalRun.stop`)]})]}),Q&&me&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ue,title:a(`activity:goalRun.newTitle`),className:`inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-2 py-1 text-xs font-medium text-primary transition-colors hover:bg-primary/20`,children:[(0,P.jsx)(_,{className:`h-3.5 w-3.5`}),` `,a(`activity:goalRun.newLabel`)]}),de?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 text-xs`,children:[(0,P.jsx)(`span`,{className:`text-warning`,children:a(`activity:goalRun.revertConfirm`)}),(0,P.jsx)(`button`,{type:`button`,onClick:fe,className:`rounded bg-destructive/15 px-1.5 py-0.5 font-medium text-destructive hover:bg-destructive/25`,children:a(`common:action.yes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>$(!1),className:`rounded px-1.5 py-0.5 text-muted-foreground hover:text-foreground`,children:a(`common:action.no`)})]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>$(!0),title:a(`activity:goalRun.revertTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,P.jsx)(C,{className:`h-3.5 w-3.5`}),` `,a(`activity:goalRun.revert`)]})]}),(0,P.jsx)(A,{variant:`ghost`,size:`icon`,onClick:e,children:(0,P.jsx)(s,{className:`h-4 w-4`})})]})]}),Q&&p&&(0,P.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 bg-muted/20 px-4 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(o,{className:`h-3 w-3`}),` `,a(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:p})]}),Q?(0,P.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,P.jsx)(ne,{})}):ie?(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-5 text-center`,children:[(0,P.jsx)(r,{className:`h-10 w-10 mx-auto animate-spin text-primary/70`}),(0,P.jsxs)(`div`,{className:`space-y-1`,children:[(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:a(`activity:goalRun.planning`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`activity:goalRun.planningBody`)})]}),(0,P.jsxs)(`div`,{className:`rounded-lg border border-border bg-card px-4 py-3 text-left`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(o,{className:`h-3 w-3`}),` `,a(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:R})]}),(0,P.jsxs)(A,{variant:`outline`,onClick:oe,className:`gap-2`,children:[(0,P.jsx)(i,{className:`h-4 w-4 fill-current`}),` `,a(`common:action.cancel`)]})]})}):(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-6`,children:[(0,P.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,P.jsx)(o,{className:`h-10 w-10 mx-auto text-primary/60`}),(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:a(`activity:goalRun.startHeading`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`activity:goalRun.startBody`)})]}),(0,P.jsx)(`textarea`,{value:I,onChange:e=>L(e.target.value),placeholder:a(`activity:goalRun.startPlaceholder`),rows:5,className:`w-full rounded-lg border border-border bg-card px-4 py-3 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground/70`,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),ae())}}),X&&(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(r,{className:`h-3 w-3 animate-spin`}),a(`activity:goalRun.assess.analyzing`)]}),!X&&Y&&!Y.parseFailed&&(0,P.jsxs)(`div`,{className:T(`rounded-lg border px-3 py-2 text-xs space-y-1.5`,Y.realistic?`border-success/40 bg-success/10`:`border-warning/40 bg-warning/10`),children:[(0,P.jsx)(`div`,{className:`flex items-center gap-1.5 font-medium`,children:Y.realistic?(0,P.jsx)(`span`,{className:`text-success`,children:a(`activity:goalRun.assess.realistic`)}):(0,P.jsx)(`span`,{className:`text-warning`,children:a(`activity:goalRun.assess.durationConcern`)})}),Y.durationClaimed&&(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:a(`activity:goalRun.assess.durationClaimed`,{duration:Y.durationClaimed})}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:Y.explanation}),Y.recommendedDuration&&(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:a(`activity:goalRun.assess.recommendation`,{duration:Y.recommendedDuration})}),Y.concerns.length>0&&(0,P.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,P.jsx)(`p`,{className:`font-medium text-foreground/80`,children:a(`activity:goalRun.assess.concerns`)}),(0,P.jsx)(`ul`,{className:`list-disc pl-4 space-y-0.5 text-muted-foreground`,children:Y.concerns.map((e,t)=>(0,P.jsx)(`li`,{children:e},t))})]})]}),!X&&Y?.parseFailed&&(0,P.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-muted/20 px-3 py-2 text-xs text-muted-foreground`,children:a(`activity:goalRun.assess.analysisFailed`)}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:H,onChange:e=>U(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.isolateLabel`)]}),(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-3 text-xs text-muted-foreground`,children:[(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:W,onChange:e=>G(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.multiBoardLabel`)]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:K,onChange:e=>q(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.verifyTasksLabel`)]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:J,onChange:e=>re(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),a(`activity:goalRun.chimeraReviewLabel`)]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[!X&&Y&&!Y.realistic&&!Y.parseFailed&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>E.getState().clear(),className:`shrink-0 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,title:a(`activity:goalRun.assess.overrideTitle`),children:a(`activity:goalRun.assess.override`)}),(0,P.jsxs)(A,{onClick:ae,disabled:!I.trim()||R!=null||X||!X&&Y!=null&&!Y.parseFailed&&!Y.realistic,className:`flex-1 gap-2`,title:I.trim()&&!X&&Y&&!Y.parseFailed&&!Y.realistic?a(`activity:goalRun.assess.disableTitle`):``,children:[(0,P.jsx)(g,{className:`h-4 w-4`}),a(`activity:goalRun.startButton`)]})]}),(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[a(`activity:goalRun.ctrlHint`),` ·`,` `,a(H?`activity:goalRun.isolateOn`:`activity:goalRun.isolateOff`)]})]})}),j.length>0&&(0,P.jsxs)(`div`,{className:`border-t bg-card/50 shrink-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-4 pt-2 text-xs`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!1),className:T(`rounded px-2 py-0.5 border transition-colors`,B?`border-border text-muted-foreground hover:text-foreground`:`bg-primary/10 border-primary/30 text-primary`),children:a(`activity:goalRun.lanes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:T(`rounded px-2 py-0.5 border transition-colors`,B?`bg-primary/10 border-primary/30 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:a(`activity:goalRun.graph`)})]}),(0,P.jsxs)(`div`,{className:`space-y-2 px-4 pb-3`,children:[(0,P.jsx)(te,{}),B?(0,P.jsx)(ee,{worktrees:j,baseBranch:F}):(0,P.jsx)(M,{worktrees:j,baseBranch:F})]})]})]})}export{q as GoalView};