@wrongstack/webui 1.0.3 → 1.0.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.
- package/dist/assets/AgentRosterView-CoD9SgNh.js +12 -0
- package/dist/assets/{AnalyticsDashboard-cR9JJBI8.js → AnalyticsDashboard-SAH8yxTa.js} +1 -1
- package/dist/assets/{AudienceMemoryPanel-DyP-vZA-.js → AudienceMemoryPanel-C_JHPr_q.js} +2 -2
- package/dist/assets/{ChangesView-DY2KWV9y.js → ChangesView-BRdNlV9e.js} +1 -1
- package/dist/assets/{ChimeraReviewsView-nLzoGYHL.js → ChimeraReviewsView-B8ecsRM9.js} +1 -1
- package/dist/assets/ChronicleDashboard-B2qq4Ax7.js +1 -0
- package/dist/assets/CodeEditor-B-zhjWYw.js +2 -0
- package/dist/assets/CodeMap-BgOJwRYK.js +1 -0
- package/dist/assets/{CronJobsPanel-xM7j0r4p.js → CronJobsPanel-CsbjBcuL.js} +1 -1
- package/dist/assets/{DeadCodeScanPanel-DWsSzjSp.js → DeadCodeScanPanel-CSr2alPo.js} +1 -1
- package/dist/assets/{DebugDashboard-D9DoHsUb.js → DebugDashboard-Ctw40UDW.js} +1 -1
- package/dist/assets/{DesignGalleryView-C2SBhANT.js → DesignGalleryView-DFMq7qzt.js} +1 -1
- package/dist/assets/{GoalView-u24_HH2B.js → GoalView-CHO3i5LQ.js} +1 -1
- package/dist/assets/KanbanView-DxCgCuzq.js +3 -0
- package/dist/assets/{MailboxDetailView-POq0LIQF.js → MailboxDetailView-CjOZymFt.js} +1 -1
- package/dist/assets/{MemoryDrawer-B4aW4mVs.js → MemoryDrawer-DlTa24j0.js} +1 -1
- package/dist/assets/MemoryManager-BvhuaBnp.js +1 -0
- package/dist/assets/{ProcessMonitor-9clcCd5a.js → ProcessMonitor-BB1j59e7.js} +1 -1
- package/dist/assets/{PromptJournalView-DiinN7LV.js → PromptJournalView-BxhsHl73.js} +1 -1
- package/dist/assets/{QueuePanel-DxHkfNun.js → QueuePanel-SirB3W9f.js} +1 -1
- package/dist/assets/{RefreshDebugView-DuRu5_AZ.js → RefreshDebugView-DVUmjUXS.js} +1 -1
- package/dist/assets/RepositoryHistoryView-Cr-UBUel.js +2 -0
- package/dist/assets/{RequirementIntakeView-BE1ZpNh1.js → RequirementIntakeView-BkztR0C2.js} +1 -1
- package/dist/assets/{SageTabs-DdwqvEQL.js → SageTabs-Bb04xdXQ.js} +2 -2
- package/dist/assets/{SddFlowGraph-DcUtqxxR.js → SddFlowGraph-dcuamshO.js} +1 -1
- package/dist/assets/SddHub-E6nNmKTl.js +2 -0
- package/dist/assets/{SessionInspectView-d9NH-E5d.js → SessionInspectView-M3HH5k-z.js} +1 -1
- package/dist/assets/SessionList-BkRdBhqJ.js +1 -0
- package/dist/assets/{SessionsDashboard-CvlpSVyY.js → SessionsDashboard-BW_sONY5.js} +1 -1
- package/dist/assets/SetupScreen-CoQOGYNC.js +1 -0
- package/dist/assets/SkillDetailView-3YHXo_2F.js +3 -0
- package/dist/assets/TechStackView-Bs8OpeDl.js +2 -0
- package/dist/assets/{TerminalPanel-BWr1bOrP.js → TerminalPanel-Mv04uw-A.js} +1 -1
- package/dist/assets/{activity-CwnkusGI.js → activity-B9cZQdVv.js} +1 -1
- package/dist/assets/{activity-C-Y-_UKp.js → activity-ByjzcTzj.js} +1 -1
- package/dist/assets/{activity-sgjix1RN.js → activity-ClXUH80G.js} +1 -1
- package/dist/assets/{activity-DSr_k7lf.js → activity-DBsqMkAC.js} +1 -1
- package/dist/assets/{activity-IxF62i-n.js → activity-DFMEXTAP.js} +1 -1
- package/dist/assets/{activity-D4XDbREq.js → activity-KXlU1-QD.js} +1 -1
- package/dist/assets/{activity-NKeG9bGy.js → activity-PRYzlsxa.js} +1 -1
- package/dist/assets/{button-BIFXNDDY.js → button-Bv5PYkY5.js} +1 -1
- package/dist/assets/{dialog-DT8I6gze.js → dialog-DyGu9hTX.js} +1 -1
- package/dist/assets/{empty-state-DtseAzny.js → empty-state-Dy__H8vX.js} +1 -1
- package/dist/assets/i18n-CEYnEdVi.js +2 -0
- package/dist/assets/index-VSjrOYGx.css +1 -0
- package/dist/assets/{index-CbwgQF8l.js → index-r9OdFrxf.js} +79 -79
- package/dist/assets/{input-DE1O73TJ.js → input-DdFYcw53.js} +1 -1
- package/dist/assets/{roster-ws--cUKX8Eo.js → roster-ws-BDcOlcE2.js} +1 -1
- package/dist/assets/settings-AxDNIcz1.js +1 -0
- package/dist/assets/settings-BcejxgTD.js +1 -0
- package/dist/assets/settings-CAfe70nd.js +1 -0
- package/dist/assets/settings-CxqeEzzD.js +1 -0
- package/dist/assets/settings-D90wMI-3.js +1 -0
- package/dist/assets/settings-DKSmPD2M.js +1 -0
- package/dist/assets/settings-DWXLaAFN.js +1 -0
- package/dist/assets/{shared-k2sZgl6A.js → shared-hOwESeA9.js} +1 -1
- package/dist/assets/ui-store-vtaLeTKu.js +1 -0
- package/dist/assets/{utils-CmY0Pw1m.js → utils-YeTxmVPQ.js} +1 -1
- package/dist/assets/{vector-memory-panel-UsWhpyqi.js → vector-memory-panel-BK3Q4TEg.js} +1 -1
- package/dist/assets/{vendor-DcnGbJ82.js → vendor-CkMYDhDf.js} +27 -27
- package/dist/assets/{ws-client-DitX7fid.js → ws-client-BG2ZSPmv.js} +4 -4
- package/dist/components/ContextBreakdownModal.d.ts +1 -1
- package/dist/components/FallbackModal.d.ts +1 -1
- package/dist/components/RepositoryHistoryView.d.ts +21 -0
- package/dist/components/SettingsPanel/YoloConfirmList.d.ts +21 -0
- package/dist/index.html +10 -10
- package/dist/index.js +12286 -11125
- package/dist/lib/view-navigation.d.ts +1 -1
- package/dist/lib/ws-client-domain-methods.d.ts +7 -0
- package/dist/stores/local-prefs.d.ts +9 -0
- package/dist/stores/ui-store-types.d.ts +1 -1
- package/dist/types/client-message.d.ts +20 -0
- package/dist/types/connections.d.ts +1 -1
- package/dist/types/server-message-files.d.ts +57 -0
- package/package.json +9 -9
- package/dist/assets/AgentRosterView-BVjk_vTm.js +0 -12
- package/dist/assets/ChronicleDashboard-D4O8L9vh.js +0 -1
- package/dist/assets/CodeEditor-BZCXLxnq.js +0 -2
- package/dist/assets/CodeMap-CBAbAWkc.js +0 -1
- package/dist/assets/KanbanView-BfrSarZw.js +0 -3
- package/dist/assets/MemoryManager-BAe2zkyG.js +0 -1
- package/dist/assets/SddHub-DYCzKYUr.js +0 -2
- package/dist/assets/SessionList-DP_TUCns.js +0 -1
- package/dist/assets/SetupScreen-3_DYzzKv.js +0 -1
- package/dist/assets/SkillDetailView-BTuq1wJm.js +0 -3
- package/dist/assets/TechStackView-CQHW3en0.js +0 -2
- package/dist/assets/i18n-Dq2jJcme.js +0 -2
- package/dist/assets/index-Cg_zbV9k.css +0 -1
- package/dist/assets/settings-B1vpPbTt.js +0 -1
- package/dist/assets/settings-BZnHCnGT.js +0 -1
- package/dist/assets/settings-BcB2BIE2.js +0 -1
- package/dist/assets/settings-D9AQ5wLT.js +0 -1
- package/dist/assets/settings-DiVpBZQ2.js +0 -1
- package/dist/assets/settings-DwbEJvxt.js +0 -1
- package/dist/assets/settings-WuyKla3E.js +0 -1
- package/dist/assets/ui-store-BPQ-dcnY.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-D0Ec-185.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-D0Ec-185.js";import{La as r}from"./vendor-CkMYDhDf.js";import"./i18n-CEYnEdVi.js";var i=e(t(),1),a=n(),o={0:`P0 Dead Package`,1:`P1 Dead File`,2:`P2 Dead Symbol`},s={0:`hsl(var(--destructive))`,1:`hsl(var(--warning))`,2:`hsl(var(--info))`};async function c(e){let t=await e.text();try{return JSON.parse(t)}catch{let e=t.length>300?`${t.slice(0,300)}…`:t;throw console.warn(JSON.stringify({level:`warn`,event:`deadcode_parse_error`,preview:e,timestamp:new Date().toISOString()})),Error(`The server returned a non-JSON response (possibly an HTML error page). Check that the backend is running and the /api/deadcode/* routes are wired.`)}}function l(){let{t:e}=r(),[t,n]=(0,i.useState)(`idle`),[l,u]=(0,i.useState)(`idle`),[m,h]=(0,i.useState)(null),[g,_]=(0,i.useState)(null),[v,y]=(0,i.useState)(null),b=(0,i.useCallback)(async()=>{n(`scanning`),y(null),h(null),_(null),u(`idle`);try{let e=await fetch(`/api/deadcode/scan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});if(!e.ok){let t=await c(e);throw Error(t.detail??t.error??`HTTP ${e.status}`)}let t=await c(e);h(t),n(`done`)}catch(e){y(e instanceof Error?e.message:String(e)),n(`error`)}},[]),x=(0,i.useCallback)(async()=>{if(m){u(`generating`),y(null);try{let e=await fetch(`/api/deadcode/action-plan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(m)});if(!e.ok){let t=await c(e);throw Error(t.detail??t.error??`HTTP ${e.status}`)}let t=await c(e);_(t),u(`ready`)}catch(e){y(e instanceof Error?e.message:String(e)),u(`idle`)}}},[m]),S=(0,i.useCallback)(()=>{if(!g)return;u(`executing`);let e=[`# Dead-Code Cleanup Plan`,``,g.summary,``,`## Files to address (in priority order)`,...g.files.map((e,t)=>`${t+1}. [${o[e.priority]}] ${e.file} — ${e.symbolCount} symbol(s) to remove`+(e.symbols.length>0?`\n Symbols: ${e.symbols.slice(0,5).join(`, `)}${e.symbols.length>5?` and ${e.symbols.length-5} more`:``}`:``))].join(`
|
|
2
2
|
`),t=window.__WS;t&&t.readyState===WebSocket.OPEN?t.send(JSON.stringify({type:`user.message`,payload:{text:e,action:`send`}})):(navigator.clipboard.writeText(e),y(`Agent not connected. Plan copied to clipboard — paste it into the chat.`)),u(`idle`)},[g]);return(0,a.jsxs)(`div`,{style:{padding:`16px`,fontFamily:`var(--font-sans, system-ui, sans-serif)`,color:`hsl(var(--foreground))`,background:`hsl(var(--background))`},children:[(0,a.jsx)(`h2`,{style:{margin:`0 0 16px`,fontSize:`18px`,fontWeight:600,color:`hsl(var(--foreground))`},children:e(`activity:deadCode.deadCodeScan`)}),(0,a.jsx)(`button`,{type:`button`,onClick:b,disabled:t===`scanning`,style:{padding:`8px 16px`,fontSize:`14px`,fontWeight:500,background:t===`scanning`?`hsl(var(--muted))`:`hsl(var(--primary))`,color:t===`scanning`?`hsl(var(--muted-foreground))`:`hsl(var(--primary-foreground))`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,cursor:t===`scanning`?`not-allowed`:`pointer`},children:t===`scanning`?`Scanning…`:`Scan for Dead Code`}),v&&(0,a.jsxs)(`div`,{style:{marginTop:`12px`,padding:`8px 12px`,background:`hsl(var(--destructive) / 0.1)`,color:`hsl(var(--destructive))`,border:`1px solid hsl(var(--destructive) / 0.3)`,borderRadius:`0`,fontSize:`13px`},children:[v,(0,a.jsx)(`button`,{type:`button`,onClick:()=>y(null),style:{marginLeft:`12px`,background:`none`,border:`none`,cursor:`pointer`,fontWeight:600,color:`hsl(var(--destructive))`},children:`✕`})]}),m&&(0,a.jsxs)(`div`,{style:{marginTop:`16px`},children:[(0,a.jsxs)(`div`,{style:{display:`flex`,gap:`12px`,marginBottom:`12px`},children:[(0,a.jsx)(d,{label:e(`activity:deadCode.totalSymbols`),value:m.stats.totalSymbols,token:`info`}),(0,a.jsx)(d,{label:e(`activity:deadCode.alive`),value:m.stats.alive,token:`success`}),(0,a.jsx)(d,{label:e(`activity:deadCode.dead`),value:m.stats.dead,token:`destructive`})]}),m.deadPackages.length>0&&(0,a.jsx)(f,{title:`Dead Packages (${m.deadPackages.length})`,token:`destructive`,children:m.deadPackages.map(e=>(0,a.jsx)(p,{columns:[e.package,e.path,`${e.fileCount} file(s)`]},e.package))}),m.deadFiles.length>0&&(0,a.jsx)(f,{title:`Dead Files (${m.deadFiles.length})`,token:`warning`,children:m.deadFiles.map(e=>(0,a.jsx)(p,{columns:[e.file,`${e.symbolCount} symbol(s)`,e.lang]},e.file))}),m.deadSymbols.length>0&&(0,a.jsxs)(f,{title:`Dead Symbols (${m.deadSymbols.length})`,token:`info`,children:[m.deadSymbols.slice(0,50).map(e=>(0,a.jsx)(p,{columns:[e.name,e.kind,e.file.split(`/`).pop()??e.file,`line ${e.line}`]},`${e.file}:${e.line}:${e.name}`)),m.deadSymbols.length>50&&(0,a.jsxs)(`div`,{style:{padding:`6px 8px`,color:`hsl(var(--muted-foreground))`,fontSize:`12px`},children:[`… and `,m.deadSymbols.length-50,` more`]})]}),t===`done`&&(0,a.jsx)(`button`,{type:`button`,onClick:x,disabled:l===`generating`,style:{marginTop:`12px`,padding:`8px 16px`,fontSize:`14px`,fontWeight:500,background:l===`generating`?`hsl(var(--muted))`:`hsl(var(--accent))`,color:l===`generating`?`hsl(var(--muted-foreground))`:`hsl(var(--accent-foreground))`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,cursor:l===`generating`?`not-allowed`:`pointer`},children:l===`generating`?`Generating…`:`Generate Action Plan`})]}),g&&(0,a.jsxs)(`div`,{style:{marginTop:`16px`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,padding:`12px`,background:`hsl(var(--card))`},children:[(0,a.jsx)(`h3`,{style:{margin:`0 0 8px`,fontSize:`15px`,fontWeight:600,color:`hsl(var(--card-foreground))`},children:e(`activity:deadCode.actionPlan`)}),(0,a.jsx)(`p`,{style:{fontSize:`13px`,color:`hsl(var(--muted-foreground))`,margin:`0 0 12px`},children:g.summary}),g.files.map((e,t)=>(0,a.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:`8px`,padding:`6px 0`,borderBottom:t<g.files.length-1?`1px solid hsl(var(--border))`:`none`,fontSize:`13px`},children:[(0,a.jsx)(`span`,{style:{background:s[e.priority]??`hsl(var(--muted-foreground))`,color:`hsl(var(--primary-foreground))`,borderRadius:`0`,padding:`2px 6px`,fontSize:`11px`,fontWeight:600,whiteSpace:`nowrap`,flexShrink:0},children:o[e.priority]??`P${e.priority}`}),(0,a.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,a.jsx)(`div`,{style:{fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`hsl(var(--foreground))`},children:e.file}),(0,a.jsxs)(`div`,{style:{color:`hsl(var(--muted-foreground))`,fontSize:`12px`},children:[e.symbolCount,` symbol(s)`,e.symbols.length>0&&` · ${e.symbols.slice(0,2).join(`, `)}${e.symbols.length>2?`…`:``}`]})]})]},e.file)),(0,a.jsx)(`button`,{type:`button`,onClick:S,disabled:l===`executing`,style:{marginTop:`12px`,padding:`8px 16px`,fontSize:`14px`,fontWeight:500,background:l===`executing`?`hsl(var(--muted))`:`hsl(var(--success))`,color:`hsl(var(--primary-foreground))`,border:`1px solid hsl(var(--border))`,borderRadius:`0`,cursor:l===`executing`?`not-allowed`:`pointer`},children:l===`executing`?`Sending…`:`Execute Plan via Agent`})]})]})}var u={success:`hsl(var(--success))`,warning:`hsl(var(--warning))`,info:`hsl(var(--info))`,destructive:`hsl(var(--destructive))`,primary:`hsl(var(--primary))`};function d({label:e,value:t,token:n}){let r=u[n];return(0,a.jsxs)(`div`,{style:{flex:1,padding:`10px`,borderRadius:`0`,border:`1px solid hsl(var(--border))`,background:`hsl(var(--card))`,textAlign:`center`},children:[(0,a.jsx)(`div`,{style:{fontSize:`24px`,fontWeight:700,color:r},children:t}),(0,a.jsx)(`div`,{style:{fontSize:`12px`,color:`hsl(var(--muted-foreground))`,marginTop:`2px`},children:e})]})}function f({title:e,token:t,children:n}){let r=u[t];return(0,a.jsxs)(`div`,{style:{marginBottom:`12px`},children:[(0,a.jsx)(`h3`,{style:{margin:`0 0 6px`,fontSize:`14px`,fontWeight:600,color:r,borderLeft:`3px solid ${r}`,paddingLeft:`8px`},children:e}),(0,a.jsx)(`div`,{style:{border:`1px solid hsl(var(--border))`,borderRadius:`0`,overflow:`hidden`,fontSize:`13px`},children:n})]})}function p({columns:e}){return(0,a.jsx)(`div`,{style:{display:`flex`,gap:`8px`,padding:`5px 8px`,borderBottom:`1px solid hsl(var(--border))`,fontSize:`13px`,fontFamily:`var(--font-mono, monospace)`,background:`hsl(var(--card))`,color:`hsl(var(--card-foreground))`},children:e.map((e,t)=>(0,a.jsx)(`span`,{style:{flex:t===0?2:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e},t))})}export{l as DeadCodeScanPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-D0Ec-185.js";import{Bi as r,Ci as i,Da as a,Fa as o,Gr as s,Qr as c,Ra as l,Tr as u,Xi as d,tn as f,ut as p,zt as m}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{v as h}from"./index-CbwgQF8l.js";var g=e(t(),1),_=n();function v({title:e,value:t,subtitle:n,icon:r,color:i=`text-primary`,trend:a}){let{t:s}=o();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:s(a===`up`?`activity:debug.trendUp`:a===`down`?`activity:debug.trendDown`:`activity:debug.trendStable`)})]})]})}function y(){let{t:e}=o(),[t,n]=(0,g.useState)({fileWatcher:null,system:null,lastUpdated:null,error:null}),[y,C]=(0,g.useState)(!0),[w,T]=(0,g.useState)(2e3),E=(0,g.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch(`/debug/watcher-metrics`),fetch(`/debug/system`,{cache:`no-store`})]),r=null,i=e.headers.get(`content-type`)??``;if(e.ok&&i.includes(`application/json`)&&(r=await e.json()),!t.ok)throw Error(`System metrics request failed (${t.status})`);let a=await t.json();n({fileWatcher:r,system:a,lastUpdated:new Date,error:null})}catch(e){n(t=>({...t,error:e instanceof Error?e.message:l.t(`activity:debug.fetchFailed`)}))}finally{C(!1)}},[]);return(0,g.useEffect)(()=>{E();let e=setInterval(E,w);return()=>clearInterval(e)},[E,w]),(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)(d,{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)(f,{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:w,onChange:e=>T(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:()=>{C(!0),E()},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)(f,{className:`w-4 h-4 ${y?`animate-spin`:``}`}),e(`common:action.refresh`)]})]})]})}),t.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)(i,{className:`w-4 h-4`}),e(`activity:debug.lastUpdated`,{time:t.lastUpdated.toLocaleTimeString()})]}),t.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)(r,{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:t.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)(c,{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:t.fileWatcher?.watcherActive?e(`activity:debug.running`):e(`activity:debug.stopped`),icon:m,color:t.fileWatcher?.watcherActive?`text-success`:`text-destructive`}),(0,_.jsx)(v,{title:e(`activity:debug.activeProjects`),value:t.fileWatcher?.activeProjects??0,subtitle:e(`activity:debug.projectsWatched`),icon:s,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.fileChanges`),value:t.fileWatcher?.fileChangesDetected??0,subtitle:e(`activity:debug.totalDetected`),icon:a,color:`text-primary`,trend:`neutral`}),(0,_.jsx)(v,{title:e(`activity:debug.filesProcessed`),value:t.fileWatcher?.filesProcessed??0,subtitle:e(`activity:debug.afterHash`),icon:u,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:t.fileWatcher?.broadcastsSent??0,subtitle:e(`activity:debug.toClients`),icon:p,color:`text-success`}),(0,_.jsx)(v,{title:e(`activity:debug.debounceResets`),value:t.fileWatcher?.debounceResets??0,subtitle:e(`activity:debug.rapidWrites`),icon:f,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.avgDebounce`),value:`${(t.fileWatcher?.averageDebounceDelayMs??0).toFixed(1)}ms`,subtitle:e(`activity:debug.actualDelay`),icon:i,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.totalDelay`),value:`${(t.fileWatcher?.totalDebounceDelayMs??0).toFixed(0)}ms`,subtitle:e(`activity:debug.sumDelays`),icon:d,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)(u,{className:`h-4 w-4 text-primary`}),e(`activity:debugDash.webuiServerProcess`)]}),(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:debugDash.processRamRss`),value:b(t.system?.memoryUsage?.rss??0),subtitle:t.system?`PID ${t.system.pid}`:void 0,icon:m,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapUsed`),value:b(t.system?.memoryUsage?.heapUsed??0),subtitle:e(`activity:debug.jsHeap`),icon:d,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapTotal`),value:b(t.system?.memoryUsage?.heapTotal??0),subtitle:e(`activity:debug.totalHeap`),icon:d,color:`text-success`}),(0,_.jsx)(v,{title:e(`activity:debugDash.v8HeapLimit`),value:b(t.system?.heapLimit??0),subtitle:e(`activity:debugDash.oldSpaceCeiling`),icon:u,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debugDash.serverUptime`),value:S(t.system?.uptime??0),subtitle:e(`activity:debugDash.sinceProcessStart`),icon:i,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`}),e(`activity:debugDash.liveWrongstackProcesses`)]}),(0,_.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-border/70 bg-card/75 shadow-sm`,children:(0,_.jsxs)(`table`,{className:`w-full min-w-[980px] text-left text-xs`,children:[(0,_.jsx)(`thead`,{className:`border-b border-border/70 bg-muted/35 text-muted-foreground`,children:(0,_.jsxs)(`tr`,{children:[(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.surface`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.memory`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.growthSignal`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.workload`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.hqOfflineQueue`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.resourcesHotspot`)})]})}),(0,_.jsxs)(`tbody`,{children:[(t.system?.processes??[]).map(e=>{let t=[e.workload.messages===void 0?void 0:`${e.workload.messages} msgs`,e.workload.messageEstimatedTokens===void 0?void 0:`${e.workload.messageEstimatedTokens.toLocaleString()} ctx tokens`,e.workload.historyEntries===void 0?void 0:`${e.workload.historyMountedEntries??0}/${e.workload.historyEntries} history mounted`,e.workload.appRenders===void 0?void 0:`${e.workload.appRenders} renders`,e.workload.metricsDroppedObservations?`${e.workload.metricsDroppedObservations} metric drops`:void 0,e.workload.kanbanSyncActive?`kanban sync active`:void 0,e.workload.kanbanSyncPendingBoards?`${e.workload.kanbanSyncPendingBoards} kanban pending`:void 0,e.workload.kanbanSyncFullRescanPending?`kanban full rescan pending`:void 0,e.workload.kanbanSyncRemoteApplyQueued?`${e.workload.kanbanSyncPendingRemoteBoards??0} remote boards queued`:void 0,e.workload.kanbanSyncCoalescedRefreshes?`${e.workload.kanbanSyncCoalescedRefreshes} kanban coalesced`:void 0,e.workload.kanbanSupervisorSnapshots?`${e.workload.kanbanSupervisorSnapshots} supervised boards`:void 0,e.workload.kanbanSupervisorScheduledBoards?`${e.workload.kanbanSupervisorScheduledBoards} supervisor schedules`:void 0].filter(Boolean).join(` · `);return(0,_.jsxs)(`tr`,{className:`border-b border-border/50 align-top last:border-b-0`,children:[(0,_.jsxs)(`td`,{className:`px-3 py-3`,children:[(0,_.jsx)(`div`,{className:`font-medium text-foreground`,children:e.surface}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`PID `,e.pid]}),(0,_.jsx)(`div`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()})]}),(0,_.jsxs)(`td`,{className:`px-3 py-3 tabular-nums`,children:[(0,_.jsxs)(`div`,{children:[`RSS `,b(e.memory.rss)]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`heap `,b(e.memory.heapUsed),e.memory.retainedHeapUsed===void 0?``:` · retained ${b(e.memory.retainedHeapUsed)}`]}),e.memory.nativeResidual===void 0?null:(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`native `,b(e.memory.nativeResidual)]}),e.memory.external===void 0?null:(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`external `,b(e.memory.external),e.memory.arrayBuffers===void 0?``:` · buffers ${b(e.memory.arrayBuffers)}`]})]}),(0,_.jsxs)(`td`,{className:`px-3 py-3 tabular-nums`,children:[(0,_.jsx)(`div`,{className:e.signal===`stable`?`text-success`:e.signal?`text-warning`:`text-muted-foreground`,children:e.signal??`sampling`}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`heap `,x(e.heapGrowthBytesPerHour)]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`RSS `,x(e.rssGrowthBytesPerHour)]})]}),(0,_.jsx)(`td`,{className:`px-3 py-3 text-muted-foreground`,children:t||`—`}),(0,_.jsx)(`td`,{className:`px-3 py-3 tabular-nums`,children:e.hqQueue?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{children:[e.hqQueue.entries,` frames ·`,` `,b(e.hqQueue.bytes),` /`,` `,b(e.hqQueue.maxBytes)]}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[e.hqQueue.coalescedFrames,` coalesced ·`,` `,e.hqQueue.droppedFrames,` dropped`]}),e.hqSnapshot?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`snapshot`,` `,e.hqSnapshot.inFlight?`in-flight`:e.hqSnapshot.pending?`pending`:e.hqSnapshot.timerScheduled?`scheduled`:`idle`]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`events`,` `,e.hqSnapshot.eventInFlight?`in-flight`:`idle`,` ·`,` `,e.hqSnapshot.pendingEvents,` pending ·`,` `,e.hqSnapshot.coalescedEvents,` coalesced ·`,` `,e.hqSnapshot.droppedEvents,` dropped`]})]}):null]}):(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,_.jsxs)(`td`,{className:`max-w-[360px] px-3 py-3 text-muted-foreground`,children:[(0,_.jsxs)(`div`,{children:[e.resources.active??0,` active`,e.resources.types?` · ${e.resources.types}`:``]}),e.profileTopStack?(0,_.jsxs)(`div`,{className:`mt-1 truncate`,title:e.profileTopStack,children:[e.profileTopStackBytes===void 0?``:`${b(e.profileTopStackBytes)} · `,e.profileTopStack]}):null]})]},e.pid)}),(t.system?.processes?.length??0)===0?(0,_.jsx)(`tr`,{children:(0,_.jsx)(`td`,{className:`px-3 py-5 text-muted-foreground`,colSpan:6,children:e(`activity:debugDash.waitingForHeapFlightRecorderSamples`)})}):null]})]})})]}),(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)(m,{className:`h-4 w-4 text-primary`}),e(`activity:debugDash.codebaseIndexServer`)]}),(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:debugDash.connection`),value:t.system?.codebaseIndexServer?.health?.status??t.system?.codebaseIndexServer?.status??`unknown`,subtitle:t.system?.codebaseIndexServer?.pid?`PID ${t.system.codebaseIndexServer.pid} · RTT ${t.system.codebaseIndexServer.health?.latencyMs??`—`}ms`:`No connected project server`,icon:a,color:t.system?.codebaseIndexServer?.health?.status===`healthy`?`text-success`:t.system?.codebaseIndexServer?.status===`unresponsive`||t.system?.codebaseIndexServer?.status===`error`?`text-destructive`:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debugDash.indexRamRss`),value:b(t.system?.codebaseIndexServer?.health?.server?.memory.rss??0),subtitle:`Heap ${b(t.system?.codebaseIndexServer?.health?.server?.memory.heapUsed??0)} / ${b(t.system?.codebaseIndexServer?.health?.server?.memory.heapTotal??0)}`,icon:d,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debugDash.indexWorkload`),value:`${t.system?.codebaseIndexServer?.health?.server?.activeRequests??0} requests`,subtitle:`${t.system?.codebaseIndexServer?.health?.server?.activeWrites??0} writes · ${t.system?.codebaseIndexServer?.health?.server?.queuedWrites??0} queued`,icon:u,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debugDash.indexWatcher`),value:t.system?.codebaseIndexServer?.health?.server?.watchingExternal?`Active`:`Off`,subtitle:`${t.system?.codebaseIndexServer?.health?.server?.watchingClients??0} owners · ${t.system?.codebaseIndexServer?.health?.server?.pendingExternalFiles??0} pending`,icon:c,color:t.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)(a,{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:t.fileWatcher,serverPid:t.system?.pid,serverMemory:t.system?.memoryUsage,serverHeapLimit:t.system?.heapLimit,serverUptime:t.system?.uptime,processes:t.system?.processes,codebaseIndexServer:t.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===void 0?`—`:`${e>0?`+`:e<0?`−`:``}${b(Math.abs(e))}/h`}function S(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-hePW80VL.js";import{i as t,t as n}from"./react-core-D0Ec-185.js";import{$r as r,Ba as i,Er as a,Kr as o,La as s,Vi as c,Zi as l,ka as u,tn as d,ut as f,wi as p,zt as m}from"./vendor-CkMYDhDf.js";import"./i18n-CEYnEdVi.js";import{v as h}from"./index-r9OdFrxf.js";var g=e(t(),1),_=n();function v({title:e,value:t,subtitle:n,icon:r,color:i=`text-primary`,trend:a}){let{t:o}=s();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)(f,{className:`w-3 h-3 text-success`}),a===`down`&&(0,_.jsx)(f,{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}=s(),[t,n]=(0,g.useState)({fileWatcher:null,system:null,lastUpdated:null,error:null}),[y,C]=(0,g.useState)(!0),[w,T]=(0,g.useState)(2e3),E=(0,g.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch(`/debug/watcher-metrics`),fetch(`/debug/system`,{cache:`no-store`})]),r=null,i=e.headers.get(`content-type`)??``;if(e.ok&&i.includes(`application/json`)&&(r=await e.json()),!t.ok)throw Error(`System metrics request failed (${t.status})`);let a=await t.json();n({fileWatcher:r,system:a,lastUpdated:new Date,error:null})}catch(e){n(t=>({...t,error:e instanceof Error?e.message:i.t(`activity:debug.fetchFailed`)}))}finally{C(!1)}},[]);return(0,g.useEffect)(()=>{E();let e=setInterval(E,w);return()=>clearInterval(e)},[E,w]),(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)(l,{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)(d,{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:w,onChange:e=>T(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:()=>{C(!0),E()},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)(d,{className:`w-4 h-4 ${y?`animate-spin`:``}`}),e(`common:action.refresh`)]})]})]})}),t.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)(p,{className:`w-4 h-4`}),e(`activity:debug.lastUpdated`,{time:t.lastUpdated.toLocaleTimeString()})]}),t.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)(c,{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:t.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)(r,{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:t.fileWatcher?.watcherActive?e(`activity:debug.running`):e(`activity:debug.stopped`),icon:m,color:t.fileWatcher?.watcherActive?`text-success`:`text-destructive`}),(0,_.jsx)(v,{title:e(`activity:debug.activeProjects`),value:t.fileWatcher?.activeProjects??0,subtitle:e(`activity:debug.projectsWatched`),icon:o,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.fileChanges`),value:t.fileWatcher?.fileChangesDetected??0,subtitle:e(`activity:debug.totalDetected`),icon:u,color:`text-primary`,trend:`neutral`}),(0,_.jsx)(v,{title:e(`activity:debug.filesProcessed`),value:t.fileWatcher?.filesProcessed??0,subtitle:e(`activity:debug.afterHash`),icon:a,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:t.fileWatcher?.broadcastsSent??0,subtitle:e(`activity:debug.toClients`),icon:f,color:`text-success`}),(0,_.jsx)(v,{title:e(`activity:debug.debounceResets`),value:t.fileWatcher?.debounceResets??0,subtitle:e(`activity:debug.rapidWrites`),icon:d,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.avgDebounce`),value:`${(t.fileWatcher?.averageDebounceDelayMs??0).toFixed(1)}ms`,subtitle:e(`activity:debug.actualDelay`),icon:p,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debug.totalDelay`),value:`${(t.fileWatcher?.totalDebounceDelayMs??0).toFixed(0)}ms`,subtitle:e(`activity:debug.sumDelays`),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`}),e(`activity:debugDash.webuiServerProcess`)]}),(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:debugDash.processRamRss`),value:b(t.system?.memoryUsage?.rss??0),subtitle:t.system?`PID ${t.system.pid}`:void 0,icon:m,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapUsed`),value:b(t.system?.memoryUsage?.heapUsed??0),subtitle:e(`activity:debug.jsHeap`),icon:l,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debug.heapTotal`),value:b(t.system?.memoryUsage?.heapTotal??0),subtitle:e(`activity:debug.totalHeap`),icon:l,color:`text-success`}),(0,_.jsx)(v,{title:e(`activity:debugDash.v8HeapLimit`),value:b(t.system?.heapLimit??0),subtitle:e(`activity:debugDash.oldSpaceCeiling`),icon:a,color:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debugDash.serverUptime`),value:S(t.system?.uptime??0),subtitle:e(`activity:debugDash.sinceProcessStart`),icon:p,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)(u,{className:`h-4 w-4 text-primary`}),e(`activity:debugDash.liveWrongstackProcesses`)]}),(0,_.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-border/70 bg-card/75 shadow-sm`,children:(0,_.jsxs)(`table`,{className:`w-full min-w-[980px] text-left text-xs`,children:[(0,_.jsx)(`thead`,{className:`border-b border-border/70 bg-muted/35 text-muted-foreground`,children:(0,_.jsxs)(`tr`,{children:[(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.surface`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.memory`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.growthSignal`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.workload`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.hqOfflineQueue`)}),(0,_.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:e(`activity:debugDash.resourcesHotspot`)})]})}),(0,_.jsxs)(`tbody`,{children:[(t.system?.processes??[]).map(e=>{let t=[e.workload.messages===void 0?void 0:`${e.workload.messages} msgs`,e.workload.messageEstimatedTokens===void 0?void 0:`${e.workload.messageEstimatedTokens.toLocaleString()} ctx tokens`,e.workload.historyEntries===void 0?void 0:`${e.workload.historyMountedEntries??0}/${e.workload.historyEntries} history mounted`,e.workload.appRenders===void 0?void 0:`${e.workload.appRenders} renders`,e.workload.metricsDroppedObservations?`${e.workload.metricsDroppedObservations} metric drops`:void 0,e.workload.kanbanSyncActive?`kanban sync active`:void 0,e.workload.kanbanSyncPendingBoards?`${e.workload.kanbanSyncPendingBoards} kanban pending`:void 0,e.workload.kanbanSyncFullRescanPending?`kanban full rescan pending`:void 0,e.workload.kanbanSyncRemoteApplyQueued?`${e.workload.kanbanSyncPendingRemoteBoards??0} remote boards queued`:void 0,e.workload.kanbanSyncCoalescedRefreshes?`${e.workload.kanbanSyncCoalescedRefreshes} kanban coalesced`:void 0,e.workload.kanbanSupervisorSnapshots?`${e.workload.kanbanSupervisorSnapshots} supervised boards`:void 0,e.workload.kanbanSupervisorScheduledBoards?`${e.workload.kanbanSupervisorScheduledBoards} supervisor schedules`:void 0].filter(Boolean).join(` · `);return(0,_.jsxs)(`tr`,{className:`border-b border-border/50 align-top last:border-b-0`,children:[(0,_.jsxs)(`td`,{className:`px-3 py-3`,children:[(0,_.jsx)(`div`,{className:`font-medium text-foreground`,children:e.surface}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`PID `,e.pid]}),(0,_.jsx)(`div`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()})]}),(0,_.jsxs)(`td`,{className:`px-3 py-3 tabular-nums`,children:[(0,_.jsxs)(`div`,{children:[`RSS `,b(e.memory.rss)]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`heap `,b(e.memory.heapUsed),e.memory.retainedHeapUsed===void 0?``:` · retained ${b(e.memory.retainedHeapUsed)}`]}),e.memory.nativeResidual===void 0?null:(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`native `,b(e.memory.nativeResidual)]}),e.memory.external===void 0?null:(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`external `,b(e.memory.external),e.memory.arrayBuffers===void 0?``:` · buffers ${b(e.memory.arrayBuffers)}`]})]}),(0,_.jsxs)(`td`,{className:`px-3 py-3 tabular-nums`,children:[(0,_.jsx)(`div`,{className:e.signal===`stable`?`text-success`:e.signal?`text-warning`:`text-muted-foreground`,children:e.signal??`sampling`}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[`heap `,x(e.heapGrowthBytesPerHour)]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`RSS `,x(e.rssGrowthBytesPerHour)]})]}),(0,_.jsx)(`td`,{className:`px-3 py-3 text-muted-foreground`,children:t||`—`}),(0,_.jsx)(`td`,{className:`px-3 py-3 tabular-nums`,children:e.hqQueue?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{children:[e.hqQueue.entries,` frames ·`,` `,b(e.hqQueue.bytes),` /`,` `,b(e.hqQueue.maxBytes)]}),(0,_.jsxs)(`div`,{className:`mt-1 text-muted-foreground`,children:[e.hqQueue.coalescedFrames,` coalesced ·`,` `,e.hqQueue.droppedFrames,` dropped`]}),e.hqSnapshot?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`snapshot`,` `,e.hqSnapshot.inFlight?`in-flight`:e.hqSnapshot.pending?`pending`:e.hqSnapshot.timerScheduled?`scheduled`:`idle`]}),(0,_.jsxs)(`div`,{className:`text-muted-foreground`,children:[`events`,` `,e.hqSnapshot.eventInFlight?`in-flight`:`idle`,` ·`,` `,e.hqSnapshot.pendingEvents,` pending ·`,` `,e.hqSnapshot.coalescedEvents,` coalesced ·`,` `,e.hqSnapshot.droppedEvents,` dropped`]})]}):null]}):(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,_.jsxs)(`td`,{className:`max-w-[360px] px-3 py-3 text-muted-foreground`,children:[(0,_.jsxs)(`div`,{children:[e.resources.active??0,` active`,e.resources.types?` · ${e.resources.types}`:``]}),e.profileTopStack?(0,_.jsxs)(`div`,{className:`mt-1 truncate`,title:e.profileTopStack,children:[e.profileTopStackBytes===void 0?``:`${b(e.profileTopStackBytes)} · `,e.profileTopStack]}):null]})]},e.pid)}),(t.system?.processes?.length??0)===0?(0,_.jsx)(`tr`,{children:(0,_.jsx)(`td`,{className:`px-3 py-5 text-muted-foreground`,colSpan:6,children:e(`activity:debugDash.waitingForHeapFlightRecorderSamples`)})}):null]})]})})]}),(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)(m,{className:`h-4 w-4 text-primary`}),e(`activity:debugDash.codebaseIndexServer`)]}),(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:debugDash.connection`),value:t.system?.codebaseIndexServer?.health?.status??t.system?.codebaseIndexServer?.status??`unknown`,subtitle:t.system?.codebaseIndexServer?.pid?`PID ${t.system.codebaseIndexServer.pid} · RTT ${t.system.codebaseIndexServer.health?.latencyMs??`—`}ms`:`No connected project server`,icon:u,color:t.system?.codebaseIndexServer?.health?.status===`healthy`?`text-success`:t.system?.codebaseIndexServer?.status===`unresponsive`||t.system?.codebaseIndexServer?.status===`error`?`text-destructive`:`text-warning`}),(0,_.jsx)(v,{title:e(`activity:debugDash.indexRamRss`),value:b(t.system?.codebaseIndexServer?.health?.server?.memory.rss??0),subtitle:`Heap ${b(t.system?.codebaseIndexServer?.health?.server?.memory.heapUsed??0)} / ${b(t.system?.codebaseIndexServer?.health?.server?.memory.heapTotal??0)}`,icon:l,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debugDash.indexWorkload`),value:`${t.system?.codebaseIndexServer?.health?.server?.activeRequests??0} requests`,subtitle:`${t.system?.codebaseIndexServer?.health?.server?.activeWrites??0} writes · ${t.system?.codebaseIndexServer?.health?.server?.queuedWrites??0} queued`,icon:a,color:`text-primary`}),(0,_.jsx)(v,{title:e(`activity:debugDash.indexWatcher`),value:t.system?.codebaseIndexServer?.health?.server?.watchingExternal?`Active`:`Off`,subtitle:`${t.system?.codebaseIndexServer?.health?.server?.watchingClients??0} owners · ${t.system?.codebaseIndexServer?.health?.server?.pendingExternalFiles??0} pending`,icon:r,color:t.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)(u,{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:t.fileWatcher,serverPid:t.system?.pid,serverMemory:t.system?.memoryUsage,serverHeapLimit:t.system?.heapLimit,serverUptime:t.system?.uptime,processes:t.system?.processes,codebaseIndexServer:t.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===void 0?`—`:`${e>0?`+`:e<0?`−`:``}${b(Math.abs(e))}/h`}function S(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-hePW80VL.js";import{vt as t}from"./ws-client-DitX7fid.js";import{i as n,t as r}from"./react-core-D0Ec-185.js";import{Fa as i,K as a,Nt as o,Ra as s,Vt as c,bn as l,oi as u,qi as d}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{t as f}from"./utils-CmY0Pw1m.js";import{H as p,P as m,v as h}from"./index-CbwgQF8l.js";var g=e(n(),1);function _(e,t,n){return e<t?t:e>n?n:e}function v(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)?[_(r,0,1),Math.max(0,i),a]:null}function y(e){return _(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function b(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function x(e){let t=v(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`#${b(y(m))}${b(y(h))}${b(y(g))}`}function S(e){let t=e.trim(),n=x(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 C=r(),w=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],T=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function E(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 D({t:e,label:t}){let{t:n}=i(),r=e.bg??`#fff`,a=e.surface??r,o=e.fg??`#111`,s=e.muted??o,c=e.primary??`#3b82f6`,l=e.accent??c,u=e.border??s,d=e[`radius-md`]??e.radius??`0.5rem`,f=e[`font-sans`]??e.fontSans??`system-ui, sans-serif`,p=e[`font-display`]??e.fontDisplay??f,m=e[`shadow-2`]??(e.shadow&&e.shadow!==`none`?e.shadow:void 0);return(0,C.jsxs)(`div`,{style:{background:r,color:o,fontFamily:f},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,C.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:s},children:t}),(0,C.jsxs)(`div`,{style:{background:a,border:`1px solid ${u}`,borderRadius:d,boxShadow:m},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,C.jsx)(`div`,{style:{fontFamily:p},className:`text-base font-bold leading-tight`,children:n(`activity:designStudio.aaHeading`)}),(0,C.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:s},children:n(`activity:designStudio.theQuickBrownFoxJumpsOver`)}),(0,C.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,C.jsx)(`span`,{style:{background:c,color:r,borderRadius:d},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:n(`activity:designStudio.primary`)}),(0,C.jsx)(`span`,{style:{border:`1px solid ${u}`,color:o,borderRadius:d},className:`shrink-0 px-2 py-1 text-[10px]`,children:n(`activity:designStudio.ghost`)}),(0,C.jsx)(`span`,{style:{background:l,color:r,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:n(`activity:designStudio.badge`)})]}),(0,C.jsx)(`div`,{style:{border:`1px solid ${u}`,borderRadius:d,color:s},className:`text-[10px] px-2 py-1.5 mt-1`,children:n(`activity:designStudio.inputField`)})]})]})}function O({kit:e,overrides:t,onSet:n}){let[r,a]=(0,g.useState)(`light`),{t:o}=i(),s=E(r===`light`?e.light:e.dark,t,r);return(0,C.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,C.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:o(`activity:design.colors`)}),(0,C.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,C.jsx)(`button`,{type:`button`,onClick:()=>a(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,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:T.filter(e=>s[e]).map(e=>{let t=S(s[e]??``)??`#000000`;return(0,C.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${s[e]}`,children:[(0,C.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,C.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function k({onTune:e}){let{t}=i(),[n,r]=(0,g.useState)(``),a=({label:t,knob:n,values:r})=>(0,C.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,C.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:t}),(0,C.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map(t=>(0,C.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,C.jsxs)(`div`,{className:`mt-1 flex flex-col gap-1.5 rounded-lg border border-border/60 bg-muted/30 p-2`,children:[(0,C.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:t(`activity:designStudio.tune`)}),(0,C.jsx)(a,{label:t(`activity:designStudio.radius`),knob:`radius`,values:[`none`,`sm`,`md`,`lg`,`xl`,`full`]}),(0,C.jsx)(a,{label:t(`activity:designStudio.density`),knob:`density`,values:[`compact`,`cozy`,`comfortable`]}),(0,C.jsx)(a,{label:t(`activity:designStudio.motion`),knob:`motion`,values:[`snappy`,`smooth`,`none`]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,C.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:t(`activity:designStudio.font`)}),(0,C.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),onKeyDown:t=>{t.key===`Enter`&&n.trim()&&e({font:n.trim()})},placeholder:t(`activity:designStudio.spaceGrotesk`),className:`h-6 min-w-0 flex-1 rounded border border-border/60 bg-background/70 px-1.5 text-[10px]`}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>n.trim()&&e({font:n.trim()}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-muted`,children:t(`activity:designStudio.set`)})]})]})}function A({className:e}){let{client:n}=m(),r=t(),{t:_}=i(),[v,y]=(0,g.useState)([]),[b,x]=(0,g.useState)(null),[S,T]=(0,g.useState)({}),[A,j]=(0,g.useState)(`web`),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(null);(0,g.useEffect)(()=>{if(!n)return;let e=e=>{let t=e.payload?.sessionId;return typeof t!=`string`||t.length===0?r!==null:t!==r},t=t=>{if(e(t))return;let n=t.payload;y(n?.kits??[]),x(n?.activeKit??null),T(n?.overrides??{})},i=t=>{if(e(t))return;let n=t.payload;n?.ok&&n.kit&&(x(n.kit),T(n.overrides??{}))},a=t=>{if(e(t))return;let n=t.payload;n?.ok&&n.overrides&&T(n.overrides)},o=t=>{if(e(t))return;let n=t.payload;n?.ok&&n.overrides?(T(n.overrides),F(`Tuned`)):n?.error&&F(`Tune failed: ${n.error}`)},c=t=>{if(e(t))return;let n=t.payload;n?.ok&&n.kit&&(x(n.kit),T(n.overrides??{}),F(`Swapped to ${n.kit}`))},l=t=>{if(e(t))return;let n=t.payload;F(n?.ok?s.t(`activity:design.wrote`,{path:n.path}):s.t(`activity:design.materializeFailed`,{error:n?.error??`error`}))},u=t=>{if(e(t))return;let n=t.payload;if(!n?.ok){F(s.t(`activity:design.verifyError`,{error:n?.error??`error`}));return}let r=Math.round((n.score??1)*100);F(n.violationCount?s.t(`activity:design.verifyOffPalette`,{pct:r,count:n.violationCount,files:n.filesScanned}):s.t(`activity:design.verifyClean`,{files:n.filesScanned}))};return n.on(`design.list`,t),n.on(`design.use`,i),n.on(`design.set`,a),n.on(`design.tune`,o),n.on(`design.swap`,c),n.on(`design.materialize`,l),n.on(`design.verify`,u),n.send({type:`design.list`,payload:n.withSession({})}),()=>{n.off(`design.list`,t),n.off(`design.use`,i),n.off(`design.set`,a),n.off(`design.tune`,o),n.off(`design.swap`,c),n.off(`design.materialize`,l),n.off(`design.verify`,u)}},[n,r]);let I=(0,g.useCallback)(e=>n?.send({type:`design.use`,payload:n.withSession({kit:e,stack:A})}),[n,A]),L=(0,g.useCallback)((e,t)=>{T(n=>({...n,[e]:t})),n?.send({type:`design.set`,payload:n.withSession({overrides:{[e]:t}})})},[n]),R=(0,g.useCallback)(e=>n?.send({type:`design.tune`,payload:n.withSession({tune:e})}),[n]),z=(0,g.useCallback)(()=>{F(s.t(`activity:design.writing`)),n?.send({type:`design.materialize`,payload:n.withSession({stack:A})})},[n,A]),B=(0,g.useCallback)(()=>{F(s.t(`activity:design.scanning`)),n?.send({type:`design.verify`,payload:n.withSession({})})},[n]),V=(0,g.useMemo)(()=>{let e=M.trim().toLowerCase();return[...e?v.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):v].sort((e,t)=>e.name.localeCompare(t.name))},[v,M]);return(0,C.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,C.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,C.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,C.jsx)(l,{className:`h-4 w-4`})}),(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:_(`activity:design.heading`)}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_(`activity:design.kitsCount`,{count:V.length})})]})]}),(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,C.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,C.jsx)(c,{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,C.jsx)(`input`,{value:M,onChange:e=>N(e.target.value),placeholder:_(`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,C.jsx)(`select`,{value:A,onChange:e=>j(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:_(`activity:design.stackTitle`),children:w.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))}),P&&(0,C.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:P}),(0,C.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:_(`common:action.close`),children:(0,C.jsx)(a,{className:`h-4 w-4`})})]})]})})}),(0,C.jsx)(`div`,{ref:h(`design-gallery`),className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain p-3 sm:p-4`,children:V.length===0?(0,C.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,C.jsx)(l,{className:`h-8 w-8 text-primary/60`}),(0,C.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:_(`activity:design.kitsCount`,{count:0})}),(0,C.jsx)(`p`,{className:`text-xs`,children:_(`activity:design.searchPlaceholder`)})]}):(0,C.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:V.map(e=>{let t=b===e.id,n=t?S:{};return(0,C.jsxs)(`div`,{className:f(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,t?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,C.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,C.jsx)(D,{t:E(e.light,n,`light`),label:_(`activity:designStudio.light`)}),(0,C.jsx)(D,{t:E(e.dark,n,`dark`),label:_(`activity:designStudio.dark`)})]}),(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,C.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,C.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),t&&(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,C.jsx)(d,{className:`w-3 h-3`}),` `,_(`activity:design.active`)]})]}),(0,C.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,C.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,C.jsx)(`button`,{type:`button`,onClick:()=>I(e.id),className:f(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,t?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:_(t?`activity:design.reapply`:`activity:design.use`)}),t&&(0,C.jsxs)(`button`,{type:`button`,onClick:z,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:_(`activity:design.materializeTitle`,{stack:A}),children:[(0,C.jsx)(u,{className:`w-3 h-3`}),` `,_(`activity:design.materialize`)]}),t&&(0,C.jsxs)(`button`,{type:`button`,onClick:B,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:_(`activity:design.verifyTitle`),children:[(0,C.jsx)(o,{className:`w-3 h-3`}),` `,_(`activity:design.verify`)]}),(0,C.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),t&&(0,C.jsx)(O,{kit:e,overrides:n,onSet:L}),t&&(0,C.jsx)(k,{onTune:R})]})]},e.id)})})})]})}export{A as DesignGalleryView};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{vt as t}from"./ws-client-BG2ZSPmv.js";import{i as n,t as r}from"./react-core-D0Ec-185.js";import{Ba as i,Ji as a,K as o,La as s,Nt as c,Vt as l,bn as u,si as d}from"./vendor-CkMYDhDf.js";import"./i18n-CEYnEdVi.js";import{t as f}from"./utils-YeTxmVPQ.js";import{H as p,P as m,v as h}from"./index-r9OdFrxf.js";var g=e(n(),1);function _(e,t,n){return e<t?t:e>n?n:e}function v(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)?[_(r,0,1),Math.max(0,i),a]:null}function y(e){return _(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function b(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function x(e){let t=v(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`#${b(y(m))}${b(y(h))}${b(y(g))}`}function S(e){let t=e.trim(),n=x(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 C=r(),w=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],T=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function E(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 D({t:e,label:t}){let{t:n}=s(),r=e.bg??`#fff`,i=e.surface??r,a=e.fg??`#111`,o=e.muted??a,c=e.primary??`#3b82f6`,l=e.accent??c,u=e.border??o,d=e[`radius-md`]??e.radius??`0.5rem`,f=e[`font-sans`]??e.fontSans??`system-ui, sans-serif`,p=e[`font-display`]??e.fontDisplay??f,m=e[`shadow-2`]??(e.shadow&&e.shadow!==`none`?e.shadow:void 0);return(0,C.jsxs)(`div`,{style:{background:r,color:a,fontFamily:f},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,C.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:o},children:t}),(0,C.jsxs)(`div`,{style:{background:i,border:`1px solid ${u}`,borderRadius:d,boxShadow:m},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,C.jsx)(`div`,{style:{fontFamily:p},className:`text-base font-bold leading-tight`,children:n(`activity:designStudio.aaHeading`)}),(0,C.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:o},children:n(`activity:designStudio.theQuickBrownFoxJumpsOver`)}),(0,C.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,C.jsx)(`span`,{style:{background:c,color:r,borderRadius:d},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:n(`activity:designStudio.primary`)}),(0,C.jsx)(`span`,{style:{border:`1px solid ${u}`,color:a,borderRadius:d},className:`shrink-0 px-2 py-1 text-[10px]`,children:n(`activity:designStudio.ghost`)}),(0,C.jsx)(`span`,{style:{background:l,color:r,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:n(`activity:designStudio.badge`)})]}),(0,C.jsx)(`div`,{style:{border:`1px solid ${u}`,borderRadius:d,color:o},className:`text-[10px] px-2 py-1.5 mt-1`,children:n(`activity:designStudio.inputField`)})]})]})}function O({kit:e,overrides:t,onSet:n}){let[r,i]=(0,g.useState)(`light`),{t:a}=s(),o=E(r===`light`?e.light:e.dark,t,r);return(0,C.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,C.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:a(`activity:design.colors`)}),(0,C.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,C.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,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:T.filter(e=>o[e]).map(e=>{let t=S(o[e]??``)??`#000000`;return(0,C.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${o[e]}`,children:[(0,C.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,C.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function k({onTune:e}){let{t}=s(),[n,r]=(0,g.useState)(``),i=({label:t,knob:n,values:r})=>(0,C.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,C.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:t}),(0,C.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map(t=>(0,C.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,C.jsxs)(`div`,{className:`mt-1 flex flex-col gap-1.5 rounded-lg border border-border/60 bg-muted/30 p-2`,children:[(0,C.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:t(`activity:designStudio.tune`)}),(0,C.jsx)(i,{label:t(`activity:designStudio.radius`),knob:`radius`,values:[`none`,`sm`,`md`,`lg`,`xl`,`full`]}),(0,C.jsx)(i,{label:t(`activity:designStudio.density`),knob:`density`,values:[`compact`,`cozy`,`comfortable`]}),(0,C.jsx)(i,{label:t(`activity:designStudio.motion`),knob:`motion`,values:[`snappy`,`smooth`,`none`]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,C.jsx)(`span`,{className:`w-16 shrink-0 text-[9px] uppercase text-muted-foreground`,children:t(`activity:designStudio.font`)}),(0,C.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),onKeyDown:t=>{t.key===`Enter`&&n.trim()&&e({font:n.trim()})},placeholder:t(`activity:designStudio.spaceGrotesk`),className:`h-6 min-w-0 flex-1 rounded border border-border/60 bg-background/70 px-1.5 text-[10px]`}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>n.trim()&&e({font:n.trim()}),className:`rounded border border-border/60 px-1.5 py-0.5 text-[10px] hover:bg-muted`,children:t(`activity:designStudio.set`)})]})]})}function A({className:e}){let{client:n}=m(),r=t(),{t:_}=s(),[v,y]=(0,g.useState)([]),[b,x]=(0,g.useState)(null),[S,T]=(0,g.useState)({}),[A,j]=(0,g.useState)(`web`),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(null);(0,g.useEffect)(()=>{if(!n)return;let e=e=>{let t=e.payload?.sessionId;return typeof t!=`string`||t.length===0?r!==null:t!==r},t=t=>{if(e(t))return;let n=t.payload;y(n?.kits??[]),x(n?.activeKit??null),T(n?.overrides??{})},a=t=>{if(e(t))return;let n=t.payload;n?.ok&&n.kit&&(x(n.kit),T(n.overrides??{}))},o=t=>{if(e(t))return;let n=t.payload;n?.ok&&n.overrides&&T(n.overrides)},s=t=>{if(e(t))return;let n=t.payload;n?.ok&&n.overrides?(T(n.overrides),F(`Tuned`)):n?.error&&F(`Tune failed: ${n.error}`)},c=t=>{if(e(t))return;let n=t.payload;n?.ok&&n.kit&&(x(n.kit),T(n.overrides??{}),F(`Swapped to ${n.kit}`))},l=t=>{if(e(t))return;let n=t.payload;F(n?.ok?i.t(`activity:design.wrote`,{path:n.path}):i.t(`activity:design.materializeFailed`,{error:n?.error??`error`}))},u=t=>{if(e(t))return;let n=t.payload;if(!n?.ok){F(i.t(`activity:design.verifyError`,{error:n?.error??`error`}));return}let r=Math.round((n.score??1)*100);F(n.violationCount?i.t(`activity:design.verifyOffPalette`,{pct:r,count:n.violationCount,files:n.filesScanned}):i.t(`activity:design.verifyClean`,{files:n.filesScanned}))};return n.on(`design.list`,t),n.on(`design.use`,a),n.on(`design.set`,o),n.on(`design.tune`,s),n.on(`design.swap`,c),n.on(`design.materialize`,l),n.on(`design.verify`,u),n.send({type:`design.list`,payload:n.withSession({})}),()=>{n.off(`design.list`,t),n.off(`design.use`,a),n.off(`design.set`,o),n.off(`design.tune`,s),n.off(`design.swap`,c),n.off(`design.materialize`,l),n.off(`design.verify`,u)}},[n,r]);let I=(0,g.useCallback)(e=>n?.send({type:`design.use`,payload:n.withSession({kit:e,stack:A})}),[n,A]),L=(0,g.useCallback)((e,t)=>{T(n=>({...n,[e]:t})),n?.send({type:`design.set`,payload:n.withSession({overrides:{[e]:t}})})},[n]),R=(0,g.useCallback)(e=>n?.send({type:`design.tune`,payload:n.withSession({tune:e})}),[n]),z=(0,g.useCallback)(()=>{F(i.t(`activity:design.writing`)),n?.send({type:`design.materialize`,payload:n.withSession({stack:A})})},[n,A]),B=(0,g.useCallback)(()=>{F(i.t(`activity:design.scanning`)),n?.send({type:`design.verify`,payload:n.withSession({})})},[n]),V=(0,g.useMemo)(()=>{let e=M.trim().toLowerCase();return[...e?v.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):v].sort((e,t)=>e.name.localeCompare(t.name))},[v,M]);return(0,C.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,C.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,C.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,C.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,C.jsx)(u,{className:`h-4 w-4`})}),(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:_(`activity:design.heading`)}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_(`activity:design.kitsCount`,{count:V.length})})]})]}),(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,C.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,C.jsx)(l,{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,C.jsx)(`input`,{value:M,onChange:e=>N(e.target.value),placeholder:_(`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,C.jsx)(`select`,{value:A,onChange:e=>j(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:_(`activity:design.stackTitle`),children:w.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))}),P&&(0,C.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:P}),(0,C.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:_(`common:action.close`),children:(0,C.jsx)(o,{className:`h-4 w-4`})})]})]})})}),(0,C.jsx)(`div`,{ref:h(`design-gallery`),className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain p-3 sm:p-4`,children:V.length===0?(0,C.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,C.jsx)(u,{className:`h-8 w-8 text-primary/60`}),(0,C.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:_(`activity:design.kitsCount`,{count:0})}),(0,C.jsx)(`p`,{className:`text-xs`,children:_(`activity:design.searchPlaceholder`)})]}):(0,C.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:V.map(e=>{let t=b===e.id,n=t?S:{};return(0,C.jsxs)(`div`,{className:f(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,t?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,C.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,C.jsx)(D,{t:E(e.light,n,`light`),label:_(`activity:designStudio.light`)}),(0,C.jsx)(D,{t:E(e.dark,n,`dark`),label:_(`activity:designStudio.dark`)})]}),(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,C.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,C.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),t&&(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,C.jsx)(a,{className:`w-3 h-3`}),` `,_(`activity:design.active`)]})]}),(0,C.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,C.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,C.jsx)(`button`,{type:`button`,onClick:()=>I(e.id),className:f(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,t?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:_(t?`activity:design.reapply`:`activity:design.use`)}),t&&(0,C.jsxs)(`button`,{type:`button`,onClick:z,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:_(`activity:design.materializeTitle`,{stack:A}),children:[(0,C.jsx)(d,{className:`w-3 h-3`}),` `,_(`activity:design.materialize`)]}),t&&(0,C.jsxs)(`button`,{type:`button`,onClick:B,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:_(`activity:design.verifyTitle`),children:[(0,C.jsx)(c,{className:`w-3 h-3`}),` `,_(`activity:design.verify`)]}),(0,C.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),t&&(0,C.jsx)(O,{kit:e,overrides:n,onSet:L}),t&&(0,C.jsx)(k,{onTune:R})]})]},e.id)})})})]})}export{A as DesignGalleryView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-D0Ec-185.js";import{Ci as r,Fa as i,G as a,K as o,Kn as s,Oi as c,Qt as l,Ra as u,Ri as d,St as f,Xt as p,_i as m,cn as h,ir as g,it as _,ki as v,pn as y,qt as b,sn as x,st as S}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{t as C}from"./utils-CmY0Pw1m.js";import{t as w}from"./button-BIFXNDDY.js";import{H as T,P as E,U as D,j as O,lt as k,n as A,nt as j,r as ee,t as te,tt as M}from"./index-CbwgQF8l.js";var N=e(t(),1),P=n(),F={pending:{icon:(0,P.jsx)(c,{className:`w-4 h-4`}),color:`text-muted-foreground`},in_progress:{icon:(0,P.jsx)(r,{className:`w-4 h-4 animate-spin`}),color:`text-primary`},blocked:{icon:(0,P.jsx)(y,{className:`w-4 h-4`}),color:`text-warning`},failed:{icon:(0,P.jsx)(v,{className:`w-4 h-4`}),color:`text-destructive`},review:{icon:(0,P.jsx)(p,{className:`w-4 h-4`}),color:`text-info`},completed:{icon:(0,P.jsx)(d,{className:`w-4 h-4`}),color:`text-success`}},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:a,onAssign:o,compact:s,className:c}){let{t:l}=i(),u=F[e.status],[d,f]=(0,N.useState)(!1),m=e.status===`in_progress`;return(0,P.jsxs)(`div`,{className:C(`w-full text-left rounded-lg border p-3 transition-all hover:shadow-sm`,m?`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`,c),children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,P.jsx)(`span`,{className:C(`mt-0.5`,u.color),role:`img`,"aria-label":m?l(`common:status.inProgress`):void 0,children:u.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:C(`px-1.5 py-0.5 rounded text-[10px] font-medium`,I[e.priority]),children:e.priority}),(0,P.jsx)(`span`,{className:C(`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:C(`mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium`,m?`bg-primary/15 text-primary`:`bg-muted text-muted-foreground`),children:[m&&(0,P.jsx)(r,{className:`w-3 h-3 animate-spin`,"aria-label":l(`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))}),!s&&(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:l(`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:l(`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`}),` `,l(`activity:task.retry`)]}),o&&a&&a.length>0&&(d?(0,P.jsxs)(`select`,{defaultValue:e.assignee??``,onChange:t=>{o(e.id,t.target.value),f(!1)},onBlur:()=>f(!1),className:`px-1 py-0.5 text-[10px] rounded border border-border bg-card`,children:[(0,P.jsx)(`option`,{value:``,children:l(`activity:task.unassigned`)}),a.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>f(!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:l(`activity:task.assignTitle`),children:[(0,P.jsx)(_,{className:`w-3 h-3`}),` `,l(`activity:task.assign`)]}))]})]})}var B=[{key:`pending`,match:[`pending`,`blocked`]},{key:`in_progress`,match:[`in_progress`]},{key:`review`,match:[`review`]},{key:`failed`,match:[`failed`]},{key:`completed`,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}=E(),{t}=i(),n=M(e=>e.phases),r=M(e=>e.multiBoard),[a,o]=(0,N.useState)(`phase`),[s,c]=(0,N.useState)(null),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(0),p=Math.min(d,Math.max(0,n.length-1)),h=r?n[p]: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]),v=(0,N.useCallback)(t=>e?.send?.(t),[e]),y=(0,N.useCallback)((e,t)=>v({type:`goal.taskStatus`,payload:{taskId:e,status:t}}),[v]),x=(0,N.useCallback)(e=>v({type:`goal.retryTask`,payload:{taskId:e}}),[v]),S=(0,N.useCallback)((e,t)=>v({type:`goal.assignTask`,payload:{taskId:e,agentName:t||void 0}}),[v]),w=(0,N.useCallback)(e=>{O({title:t(`activity:board.newTaskTitle`),placeholder:t(`activity:board.newTaskPlaceholder`),confirmLabel:t(`activity:board.addTask`)}).then(t=>{t&&v({type:`goal.addTask`,payload:{phaseId:e,title:t}})})},[v]),T=(0,N.useCallback)(e=>{s&&v({type:`goal.moveTask`,payload:{taskId:s,toPhaseId:e}}),c(null),u(null)},[s,v]),D=(0,N.useCallback)(e=>{s&&v({type:`goal.taskStatus`,payload:{taskId:s,status:e}}),c(null),u(null)},[s,v]),k={onStatusChange:y,onRetry:x,agents:_,onAssign:S};function A(e){return{draggable:!0,onDragStart:t=>{c(e),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>{c(null),u(null)}}}function j(e,t){return{onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,l!==e&&u(e)},onDragLeave:()=>u(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:()=>o(`phase`),className:C(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,a===`phase`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(m,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.phases`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>o(`status`),className:C(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,a===`status`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(b,{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:()=>f(t),className:C(`shrink-0 rounded-t px-3 py-1.5 text-xs font-medium transition-colors`,t===p?`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:a,dragId:s,hoverKey:l,callbacks:k,draggable:A,dropZone:j,dropToPhase:T,dropToStatus:D,onAddTask:w})]}):(0,P.jsx)(U,{phases:n,allTasks:g,layout:a,dragId:s,hoverKey:l,callbacks:k,draggable:A,dropZone:j,dropToPhase:T,dropToStatus:D,onAddTask:w})]})}function H({phase:e,phaseTasks:t,callbacks:n,draggable:r,dropZone:a,dropToPhase:o,onAddTask:s,dragId:c,hoverKey:l}){let{t:u}=i();return(0,P.jsxs)(`div`,{...a(`phase:${e.id}`,()=>o(e.id)),className:C(`flex min-h-0 w-80 shrink-0 flex-col rounded-lg border bg-muted/30 transition-colors`,l===`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:C(`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:()=>s(e.id),title:u(`activity:board.addTask`),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,P.jsx)(x,{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:u(`activity:board.dropHere`)}):t.map(e=>(0,P.jsx)(`div`,{...r(e.id),className:C(c===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=>{let n=t.filter(t=>t.phaseId===e.id);return(0,P.jsx)(H,{phase:e,phaseTasks:n,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:a,callbacks:o,draggable:s,dropZone:c,dropToPhase:l,dropToStatus:u,onAddTask:d}){let f=t.filter(t=>t.phaseId===e.id),{t:p}=i();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:o,draggable:s,dropZone:c,dropToPhase:l,onAddTask:d,dragId:r,hoverKey:a})}):(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:C(`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)),i=`cell:${e.id}:${t.key}`;return(0,P.jsx)(`div`,{...c(i,()=>u(t.key)),className:C(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,a===i?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:n.map(e=>(0,P.jsx)(`div`,{...s(e.id),className:C(r===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...o})},e.id))},t.key)})]},e.id)]})})}function G({phases:e,allTasks:t,dragId:n,hoverKey:r,callbacks:a,draggable:o,dropZone:s,dropToStatus:c}){let{t:l}=i();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:l(`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:C(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(i=>{let l=t.filter(t=>t.phaseId===e.id&&i.match.includes(t.status)),u=`cell:${e.id}:${i.key}`;return(0,P.jsx)(`div`,{...s(u,()=>c(i.key)),className:C(`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`,{...o(e.id),className:C(n===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...a})},e.id))},i.key)})]},e.id))]})}function K({children:e}){return(0,P.jsx)(P.Fragment,{children:e})}function q({onClose:e}){let{client:t}=E(),{t:n}=i(),r=M(e=>e.phases),c=M(e=>e.overallPercent),d=M(e=>e.autonomous),p=M(e=>e.title),m=M(e=>e.goal),_=M(e=>e.status),v=M(e=>e.lastError),b=M(e=>e.graphs);(0,N.useEffect)(()=>{t?.send?.({type:`goal.list`}),t?.send?.({type:`goal.state`})},[t]);let O=D(e=>e.worktrees),F=D(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=j(e=>e.result),X=j(e=>e.loading),Z=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(Z.current&&clearTimeout(Z.current),!I.trim()){j.getState().clear();return}return Z.current=setTimeout(()=>{j.getState().setLoading();let e=j.getState().nextSeq();t?.send?.({type:`goal.assess`,payload:{goal:I,seq:e}})},800),()=>{Z.current&&clearTimeout(Z.current)}},[I,t]),(0,N.useEffect)(()=>{!I.trim()&&!R&&j.getState().clear()},[I,R]);let Q=r.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 n=k.getState();n.addMessage({role:`user`,content:e}),n.addMessage({role:`assistant`,content:u.t(`activity:goalRun.planningAck`)}),z(e),L(``),t?.send?.({type:`goal.start`,payload:{title:e,autonomous:!0,worktrees:H,multiBoard:W,verifyTasks:K,chimeraReview:J}}),T(`chat`)},[I,R,t,H]),oe=(0,N.useCallback)(()=>{t?.send?.({type:`goal.stop`,payload:{}}),z(null)},[t]),se=(0,N.useCallback)(()=>{t?.send?.({type:`goal.toggleAutonomous`,payload:{}})},[t]),ce=(0,N.useCallback)(()=>{t?.send?.(_===`paused`?{type:`goal.resume`,payload:{}}:{type:`goal.pause`,payload:{}})},[t,_]),le=(0,N.useCallback)(()=>{t?.send?.({type:`goal.stop`,payload:{}})},[t]),ue=(0,N.useCallback)(()=>{t?.send?.({type:`goal.clear`,payload:{}}),M.getState().clear(),z(null),L(``)},[t]),[de,$]=(0,N.useState)(!1),fe=(0,N.useCallback)(()=>{t?.send?.({type:`goal.revert`,payload:{}}),$(!1)},[t]),pe=_===`running`||_===`paused`,me=_===`stopped`||_===`completed`||_===`failed`,he=(0,N.useCallback)(e=>{e&&t?.send?.({type:`goal.load`,payload:{graphId:e}})},[t]);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)(g,{className:`h-5 w-5 text-muted-foreground`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`text-lg font-semibold`,children:Q&&p||`Goal`}),Q&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:goalRun.summary`,{count:r.length,pct:c})})]}),Q&&(0,P.jsx)(`span`,{className:C(`rounded border px-2 py-0.5 text-[11px] font-medium capitalize`,_===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:_===`paused`||_===`stopped`?`border-warning/40 bg-warning/10 text-warning`:_===`completed`?`border-success/40 bg-success/10 text-success`:`border-primary/30 bg-primary/10 text-primary`),title:v??void 0,children:_})]}),(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===p)?.id??``:``,onChange:e=>he(e.target.value),title:n(`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:n(`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:n(`activity:goalRun.toggleAutonomousTitle`),className:C(`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)(a,{className:`h-3.5 w-3.5`}),` `,n(d?`activity:goalRun.autonomous`:`activity:goalRun.manual`)]}),pe&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ce,title:n(_===`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:[_===`paused`?(0,P.jsx)(h,{className:`h-3.5 w-3.5`}):(0,P.jsx)(y,{className:`h-3.5 w-3.5`}),n(_===`paused`?`activity:goalRun.resume`:`activity:goalRun.pause`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:le,title:n(`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)(f,{className:`h-3.5 w-3.5 fill-current`}),` `,n(`activity:goalRun.stop`)]})]}),Q&&me&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ue,title:n(`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)(x,{className:`h-3.5 w-3.5`}),` `,n(`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:n(`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:n(`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:n(`common:action.no`)})]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>$(!0),title:n(`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)(S,{className:`h-3.5 w-3.5`}),` `,n(`activity:goalRun.revert`)]})]}),(0,P.jsx)(w,{variant:`ghost`,size:`icon`,onClick:e,children:(0,P.jsx)(o,{className:`h-4 w-4`})})]})]}),Q&&m&&(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)(l,{className:`h-3 w-3`}),` `,n(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:m})]}),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)(s,{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:n(`activity:goalRun.planning`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`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)(l,{className:`h-3 w-3`}),` `,n(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:R})]}),(0,P.jsxs)(w,{variant:`outline`,onClick:oe,className:`gap-2`,children:[(0,P.jsx)(f,{className:`h-4 w-4 fill-current`}),` `,n(`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)(l,{className:`h-10 w-10 mx-auto text-primary/60`}),(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:n(`activity:goalRun.startHeading`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`activity:goalRun.startBody`)})]}),(0,P.jsx)(`textarea`,{value:I,onChange:e=>L(e.target.value),placeholder:n(`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)(s,{className:`h-3 w-3 animate-spin`}),n(`activity:goalRun.assess.analyzing`)]}),!X&&Y&&!Y.parseFailed&&(0,P.jsxs)(`div`,{className:C(`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:n(`activity:goalRun.assess.realistic`)}):(0,P.jsx)(`span`,{className:`text-warning`,children:n(`activity:goalRun.assess.durationConcern`)})}),Y.durationClaimed&&(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:n(`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:n(`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:n(`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:n(`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`}),n(`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`}),n(`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`}),n(`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`}),n(`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:()=>j.getState().clear(),className:`shrink-0 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,title:n(`activity:goalRun.assess.overrideTitle`),children:n(`activity:goalRun.assess.override`)}),(0,P.jsxs)(w,{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?n(`activity:goalRun.assess.disableTitle`):``,children:[(0,P.jsx)(h,{className:`h-4 w-4`}),n(`activity:goalRun.startButton`)]})]}),(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[n(`activity:goalRun.ctrlHint`),` ·`,` `,n(H?`activity:goalRun.isolateOn`:`activity:goalRun.isolateOff`)]})]})}),O.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:C(`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:n(`activity:goalRun.lanes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:C(`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:n(`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:O,baseBranch:F}):(0,P.jsx)(A,{worktrees:O,baseBranch:F})]})]})]})}export{q as GoalView};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-D0Ec-185.js";import{Ai as r,Ba as i,G as a,K as o,Kn as s,La as c,Qt as l,St as u,Xt as d,cn as f,ir as p,it as m,ki as h,pn as g,qt as _,sn as v,st as y,vi as b,wi as x,zi as S}from"./vendor-CkMYDhDf.js";import"./i18n-CEYnEdVi.js";import{t as C}from"./utils-YeTxmVPQ.js";import{t as w}from"./button-Bv5PYkY5.js";import{H as T,P as E,U as D,j as O,lt as k,n as A,nt as j,r as ee,t as te,tt as M}from"./index-r9OdFrxf.js";var N=e(t(),1),P=n(),F={pending:{icon:(0,P.jsx)(h,{className:`w-4 h-4`}),color:`text-muted-foreground`},in_progress:{icon:(0,P.jsx)(x,{className:`w-4 h-4 animate-spin`}),color:`text-primary`},blocked:{icon:(0,P.jsx)(g,{className:`w-4 h-4`}),color:`text-warning`},failed:{icon:(0,P.jsx)(r,{className:`w-4 h-4`}),color:`text-destructive`},review:{icon:(0,P.jsx)(d,{className:`w-4 h-4`}),color:`text-info`},completed:{icon:(0,P.jsx)(S,{className:`w-4 h-4`}),color:`text-success`}},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}=c(),l=F[e.status],[u,f]=(0,N.useState)(!1),p=e.status===`in_progress`;return(0,P.jsxs)(`div`,{className:C(`w-full text-left rounded-lg border p-3 transition-all hover:shadow-sm`,p?`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:C(`mt-0.5`,l.color),role:`img`,"aria-label":p?s(`common:status.inProgress`):void 0,children:l.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:C(`px-1.5 py-0.5 rounded text-[10px] font-medium`,I[e.priority]),children:e.priority}),(0,P.jsx)(`span`,{className:C(`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:C(`mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium`,p?`bg-primary/15 text-primary`:`bg-muted text-muted-foreground`),children:[p&&(0,P.jsx)(x,{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)(d,{className:`w-3 h-3`}),` `,s(`activity:task.retry`)]}),i&&r&&r.length>0&&(u?(0,P.jsxs)(`select`,{defaultValue:e.assignee??``,onChange:t=>{i(e.id,t.target.value),f(!1)},onBlur:()=>f(!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:()=>f(!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)(m,{className:`w-3 h-3`}),` `,s(`activity:task.assign`)]}))]})]})}var B=[{key:`pending`,match:[`pending`,`blocked`]},{key:`in_progress`,match:[`in_progress`]},{key:`review`,match:[`review`]},{key:`failed`,match:[`failed`]},{key:`completed`,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}=E(),{t}=c(),n=M(e=>e.phases),r=M(e=>e.multiBoard),[i,a]=(0,N.useState)(`phase`),[o,s]=(0,N.useState)(null),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(0),p=Math.min(d,Math.max(0,n.length-1)),m=r?n[p]:void 0,h=(0,N.useMemo)(()=>n.flatMap(e=>(e.tasks??[]).map(t=>({...t,phaseId:e.id}))),[n]),g=(0,N.useMemo)(()=>[...new Set(h.map(e=>e.assignee).filter(e=>!!e))],[h]),v=(0,N.useCallback)(t=>e?.send?.(t),[e]),y=(0,N.useCallback)((e,t)=>v({type:`goal.taskStatus`,payload:{taskId:e,status:t}}),[v]),x=(0,N.useCallback)(e=>v({type:`goal.retryTask`,payload:{taskId:e}}),[v]),S=(0,N.useCallback)((e,t)=>v({type:`goal.assignTask`,payload:{taskId:e,agentName:t||void 0}}),[v]),w=(0,N.useCallback)(e=>{O({title:t(`activity:board.newTaskTitle`),placeholder:t(`activity:board.newTaskPlaceholder`),confirmLabel:t(`activity:board.addTask`)}).then(t=>{t&&v({type:`goal.addTask`,payload:{phaseId:e,title:t}})})},[v]),T=(0,N.useCallback)(e=>{o&&v({type:`goal.moveTask`,payload:{taskId:o,toPhaseId:e}}),s(null),u(null)},[o,v]),D=(0,N.useCallback)(e=>{o&&v({type:`goal.taskStatus`,payload:{taskId:o,status:e}}),s(null),u(null)},[o,v]),k={onStatusChange:y,onRetry:x,agents:g,onAssign:S};function A(e){return{draggable:!0,onDragStart:t=>{s(e),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>{s(null),u(null)}}}function j(e,t){return{onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,l!==e&&u(e)},onDragLeave:()=>u(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:h.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:C(`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)(b,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.phases`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(`status`),className:C(`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)(_,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.statusTab`)]})]})]}),r&&m?(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:()=>f(t),className:C(`shrink-0 rounded-t px-3 py-1.5 text-xs font-medium transition-colors`,t===p?`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:m,allTasks:h,layout:i,dragId:o,hoverKey:l,callbacks:k,draggable:A,dropZone:j,dropToPhase:T,dropToStatus:D,onAddTask:w})]}):(0,P.jsx)(U,{phases:n,allTasks:h,layout:i,dragId:o,hoverKey:l,callbacks:k,draggable:A,dropZone:j,dropToPhase:T,dropToStatus:D,onAddTask:w})]})}function H({phase:e,phaseTasks:t,callbacks:n,draggable:r,dropZone:i,dropToPhase:a,onAddTask:o,dragId:s,hoverKey:l}){let{t:u}=c();return(0,P.jsxs)(`div`,{...i(`phase:${e.id}`,()=>a(e.id)),className:C(`flex min-h-0 w-80 shrink-0 flex-col rounded-lg border bg-muted/30 transition-colors`,l===`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:C(`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:u(`activity:board.addTask`),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,P.jsx)(v,{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:u(`activity:board.dropHere`)}):t.map(e=>(0,P.jsx)(`div`,{...r(e.id),className:C(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=>{let n=t.filter(t=>t.phaseId===e.id);return(0,P.jsx)(H,{phase:e,phaseTasks:n,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:l,dropToStatus:u,onAddTask:d}){let f=t.filter(t=>t.phaseId===e.id),{t:p}=c();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:l,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:C(`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,()=>u(t.key)),className:C(`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:C(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:l}=c();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:l(`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:C(`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:C(`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:C(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:t}=E(),{t:n}=c(),r=M(e=>e.phases),d=M(e=>e.overallPercent),m=M(e=>e.autonomous),h=M(e=>e.title),_=M(e=>e.goal),b=M(e=>e.status),x=M(e=>e.lastError),S=M(e=>e.graphs);(0,N.useEffect)(()=>{t?.send?.({type:`goal.list`}),t?.send?.({type:`goal.state`})},[t]);let O=D(e=>e.worktrees),F=D(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=j(e=>e.result),X=j(e=>e.loading),Z=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(Z.current&&clearTimeout(Z.current),!I.trim()){j.getState().clear();return}return Z.current=setTimeout(()=>{j.getState().setLoading();let e=j.getState().nextSeq();t?.send?.({type:`goal.assess`,payload:{goal:I,seq:e}})},800),()=>{Z.current&&clearTimeout(Z.current)}},[I,t]),(0,N.useEffect)(()=>{!I.trim()&&!R&&j.getState().clear()},[I,R]);let Q=r.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 n=k.getState();n.addMessage({role:`user`,content:e}),n.addMessage({role:`assistant`,content:i.t(`activity:goalRun.planningAck`)}),z(e),L(``),t?.send?.({type:`goal.start`,payload:{title:e,autonomous:!0,worktrees:H,multiBoard:W,verifyTasks:K,chimeraReview:J}}),T(`chat`)},[I,R,t,H]),oe=(0,N.useCallback)(()=>{t?.send?.({type:`goal.stop`,payload:{}}),z(null)},[t]),se=(0,N.useCallback)(()=>{t?.send?.({type:`goal.toggleAutonomous`,payload:{}})},[t]),ce=(0,N.useCallback)(()=>{t?.send?.(b===`paused`?{type:`goal.resume`,payload:{}}:{type:`goal.pause`,payload:{}})},[t,b]),le=(0,N.useCallback)(()=>{t?.send?.({type:`goal.stop`,payload:{}})},[t]),ue=(0,N.useCallback)(()=>{t?.send?.({type:`goal.clear`,payload:{}}),M.getState().clear(),z(null),L(``)},[t]),[de,$]=(0,N.useState)(!1),fe=(0,N.useCallback)(()=>{t?.send?.({type:`goal.revert`,payload:{}}),$(!1)},[t]),pe=b===`running`||b===`paused`,me=b===`stopped`||b===`completed`||b===`failed`,he=(0,N.useCallback)(e=>{e&&t?.send?.({type:`goal.load`,payload:{graphId:e}})},[t]);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)(p,{className:`h-5 w-5 text-muted-foreground`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`text-lg font-semibold`,children:Q&&h||`Goal`}),Q&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:goalRun.summary`,{count:r.length,pct:d})})]}),Q&&(0,P.jsx)(`span`,{className:C(`rounded border px-2 py-0.5 text-[11px] font-medium capitalize`,b===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:b===`paused`||b===`stopped`?`border-warning/40 bg-warning/10 text-warning`:b===`completed`?`border-success/40 bg-success/10 text-success`:`border-primary/30 bg-primary/10 text-primary`),title:x??void 0,children:b})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 sm:justify-end`,children:[S.length>0&&(0,P.jsxs)(`select`,{value:Q?S.find(e=>e.title===h)?.id??``:``,onChange:e=>he(e.target.value),title:n(`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:n(`activity:goalRun.boardsCount`,{count:S.length})}),S.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:n(`activity:goalRun.toggleAutonomousTitle`),className:C(`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs transition-colors`,m?`border-primary/30 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(a,{className:`h-3.5 w-3.5`}),` `,n(m?`activity:goalRun.autonomous`:`activity:goalRun.manual`)]}),pe&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ce,title:n(b===`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:[b===`paused`?(0,P.jsx)(f,{className:`h-3.5 w-3.5`}):(0,P.jsx)(g,{className:`h-3.5 w-3.5`}),n(b===`paused`?`activity:goalRun.resume`:`activity:goalRun.pause`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:le,title:n(`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)(u,{className:`h-3.5 w-3.5 fill-current`}),` `,n(`activity:goalRun.stop`)]})]}),Q&&me&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:ue,title:n(`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)(v,{className:`h-3.5 w-3.5`}),` `,n(`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:n(`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:n(`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:n(`common:action.no`)})]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>$(!0),title:n(`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)(y,{className:`h-3.5 w-3.5`}),` `,n(`activity:goalRun.revert`)]})]}),(0,P.jsx)(w,{variant:`ghost`,size:`icon`,onClick:e,children:(0,P.jsx)(o,{className:`h-4 w-4`})})]})]}),Q&&_&&(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)(l,{className:`h-3 w-3`}),` `,n(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:_})]}),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)(s,{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:n(`activity:goalRun.planning`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`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)(l,{className:`h-3 w-3`}),` `,n(`activity:goalRun.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:R})]}),(0,P.jsxs)(w,{variant:`outline`,onClick:oe,className:`gap-2`,children:[(0,P.jsx)(u,{className:`h-4 w-4 fill-current`}),` `,n(`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)(l,{className:`h-10 w-10 mx-auto text-primary/60`}),(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:n(`activity:goalRun.startHeading`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`activity:goalRun.startBody`)})]}),(0,P.jsx)(`textarea`,{value:I,onChange:e=>L(e.target.value),placeholder:n(`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)(s,{className:`h-3 w-3 animate-spin`}),n(`activity:goalRun.assess.analyzing`)]}),!X&&Y&&!Y.parseFailed&&(0,P.jsxs)(`div`,{className:C(`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:n(`activity:goalRun.assess.realistic`)}):(0,P.jsx)(`span`,{className:`text-warning`,children:n(`activity:goalRun.assess.durationConcern`)})}),Y.durationClaimed&&(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:n(`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:n(`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:n(`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:n(`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`}),n(`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`}),n(`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`}),n(`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`}),n(`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:()=>j.getState().clear(),className:`shrink-0 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,title:n(`activity:goalRun.assess.overrideTitle`),children:n(`activity:goalRun.assess.override`)}),(0,P.jsxs)(w,{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?n(`activity:goalRun.assess.disableTitle`):``,children:[(0,P.jsx)(f,{className:`h-4 w-4`}),n(`activity:goalRun.startButton`)]})]}),(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[n(`activity:goalRun.ctrlHint`),` ·`,` `,n(H?`activity:goalRun.isolateOn`:`activity:goalRun.isolateOff`)]})]})}),O.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:C(`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:n(`activity:goalRun.lanes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:C(`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:n(`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:O,baseBranch:F}):(0,P.jsx)(A,{worktrees:O,baseBranch:F})]})]})]})}export{q as GoalView};
|