@wrongstack/webui 1.0.1 → 1.0.3
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-BVjk_vTm.js +12 -0
- package/dist/assets/AnalyticsDashboard-cR9JJBI8.js +1 -0
- package/dist/assets/AudienceMemoryPanel-DyP-vZA-.js +3 -0
- package/dist/assets/ChangesView-DY2KWV9y.js +1 -0
- package/dist/assets/{ChimeraReviewsView-BZ3kmsEA.js → ChimeraReviewsView-nLzoGYHL.js} +1 -1
- package/dist/assets/ChronicleDashboard-D4O8L9vh.js +1 -0
- package/dist/assets/CodeEditor-BZCXLxnq.js +2 -0
- package/dist/assets/CodeMap-CBAbAWkc.js +1 -0
- package/dist/assets/CronJobsPanel-xM7j0r4p.js +1 -0
- package/dist/assets/{DeadCodeScanPanel-CcPRcYm0.js → DeadCodeScanPanel-DWsSzjSp.js} +1 -1
- package/dist/assets/{DebugDashboard-B-aDaDrO.js → DebugDashboard-D9DoHsUb.js} +1 -1
- package/dist/assets/DesignGalleryView-C2SBhANT.js +1 -0
- package/dist/assets/{GoalView-CBDc5nCD.js → GoalView-u24_HH2B.js} +1 -1
- package/dist/assets/KanbanView-BfrSarZw.js +3 -0
- package/dist/assets/MailboxDetailView-POq0LIQF.js +1 -0
- package/dist/assets/{MemoryDrawer-CyN_6CRo.js → MemoryDrawer-B4aW4mVs.js} +1 -1
- package/dist/assets/MemoryManager-BAe2zkyG.js +1 -0
- package/dist/assets/ProcessMonitor-9clcCd5a.js +1 -0
- package/dist/assets/{PromptJournalView-C6O40uTv.js → PromptJournalView-DiinN7LV.js} +1 -1
- package/dist/assets/QueuePanel-DxHkfNun.js +1 -0
- package/dist/assets/RefreshDebugView-DuRu5_AZ.js +1 -0
- package/dist/assets/{RequirementIntakeView-BpFyFOlB.js → RequirementIntakeView-BE1ZpNh1.js} +1 -1
- package/dist/assets/SageTabs-DdwqvEQL.js +2 -0
- package/dist/assets/{SddFlowGraph-CJjawf9r.js → SddFlowGraph-DcUtqxxR.js} +1 -1
- package/dist/assets/SddHub-DYCzKYUr.js +2 -0
- package/dist/assets/SessionInspectView-d9NH-E5d.js +1 -0
- package/dist/assets/SessionList-DP_TUCns.js +1 -0
- package/dist/assets/SessionsDashboard-CvlpSVyY.js +1 -0
- package/dist/assets/SetupScreen-3_DYzzKv.js +1 -0
- package/dist/assets/SkillDetailView-BTuq1wJm.js +3 -0
- package/dist/assets/TechStackView-CQHW3en0.js +2 -0
- package/dist/assets/TerminalPanel-BWr1bOrP.js +1 -0
- package/dist/assets/{activity-Dt348P4m.js → activity-C-Y-_UKp.js} +1 -1
- package/dist/assets/{activity-CCW2-qSA.js → activity-CwnkusGI.js} +1 -1
- package/dist/assets/{activity-CXLMCm4J.js → activity-D4XDbREq.js} +1 -1
- package/dist/assets/{activity-CmzV075e.js → activity-DSr_k7lf.js} +1 -1
- package/dist/assets/{activity-D2D6_ljD.js → activity-IxF62i-n.js} +1 -1
- package/dist/assets/{activity-FxWZooaS.js → activity-NKeG9bGy.js} +1 -1
- package/dist/assets/{activity-87Kr1xrI.js → activity-sgjix1RN.js} +1 -1
- package/dist/assets/{button-rqi3MczV.js → button-BIFXNDDY.js} +1 -1
- package/dist/assets/{css.worker-DRH2OcAG.js → css.worker-NNelxtRr.js} +6 -6
- package/dist/assets/{dialog-xJxaQi60.js → dialog-DT8I6gze.js} +1 -1
- package/dist/assets/{empty-state-BxilAuC3.js → empty-state-DtseAzny.js} +1 -1
- package/dist/assets/{html.worker-DQLddT9h.js → html.worker-B4rXkk6r.js} +6 -6
- package/dist/assets/{i18n-tRUjoMoU.js → i18n-Dq2jJcme.js} +1 -1
- package/dist/assets/index-CbwgQF8l.js +176 -0
- package/dist/assets/index-Cg_zbV9k.css +1 -0
- package/dist/assets/{input-ClZR-odw.js → input-DE1O73TJ.js} +1 -1
- package/dist/assets/{json.worker-D_Dqrls5.js → json.worker-izi4BK3w.js} +4 -4
- package/dist/assets/{markdown-BP6Z3HKc.js → markdown-BzXmcdZg.js} +15 -15
- package/dist/assets/{monaco-_kWjHrlo.js → monaco-LhToOuuW.js} +59 -59
- package/dist/assets/{monaco-theme-Dmx6JuoU.js → monaco-theme-BOzs6u2L.js} +1 -1
- package/dist/assets/{react-core-BNmTiJ-I.js → react-core-D0Ec-185.js} +1 -1
- package/dist/assets/{roster-ws-B4xVrXos.js → roster-ws--cUKX8Eo.js} +1 -1
- package/dist/assets/{shared-D8dubdNH.js → shared-k2sZgl6A.js} +1 -1
- package/dist/assets/{ts.worker-DkYoA6bF.js → ts.worker-Dj4vg72D.js} +114 -114
- package/dist/assets/{ui-store-CLXDcLPI.js → ui-store-BPQ-dcnY.js} +1 -1
- package/dist/assets/{utils-BpBOwXlT.js → utils-CmY0Pw1m.js} +1 -1
- package/dist/assets/{vector-memory-panel-BwPPCCbh.js → vector-memory-panel-UsWhpyqi.js} +1 -1
- package/dist/assets/vendor-DcnGbJ82.js +125 -0
- package/dist/assets/ws-client-DitX7fid.js +22 -0
- package/dist/assets/xterm-DA3G7037.js +16 -0
- package/dist/assets/xyflow-BlkaZTzI.js +7 -0
- package/dist/components/CodeMapVisuals.d.ts +10 -0
- package/dist/components/CustomRosterPanel.d.ts +1 -0
- package/dist/components/QuotaChip.d.ts +21 -0
- package/dist/components/SettingsPanel/OAuthLoginSection.d.ts +4 -5
- package/dist/components/codemap-model.d.ts +21 -1
- package/dist/hooks/ws-handlers/session-execution-handlers.d.ts +8 -0
- package/dist/hooks/ws-handlers/session-handlers.d.ts +1 -1
- package/dist/index.html +13 -22
- package/dist/index.js +2104 -1645
- package/dist/lib/bug-hunt-message.d.ts +3 -0
- package/dist/lib/ws-client-domain-methods.d.ts +14 -3
- package/dist/stores/bug-hunt-run-store.d.ts +44 -0
- package/dist/stores/index.d.ts +3 -0
- package/dist/stores/provider-quota-store.d.ts +69 -0
- package/dist/stores/types.d.ts +1 -0
- package/dist/types/client-message.d.ts +4 -0
- package/dist/types/protocol-core.d.ts +13 -0
- package/dist/types/server-message.d.ts +4 -4
- package/dist/types/system.d.ts +18 -1
- package/package.json +9 -9
- package/dist/assets/AgentRosterView-BXURTwLP.js +0 -12
- package/dist/assets/AnalyticsDashboard-yAGcObTd.js +0 -1
- package/dist/assets/AudienceMemoryPanel-BwtB_jYJ.js +0 -3
- package/dist/assets/ChangesView-BgC27G9n.js +0 -1
- package/dist/assets/ChronicleDashboard-DVor6J-y.js +0 -1
- package/dist/assets/CodeEditor-Dk2WJQks.js +0 -2
- package/dist/assets/CodeMap-CjWRQ37U.js +0 -1
- package/dist/assets/ConfirmModal-C_KAUjBK.js +0 -1
- package/dist/assets/CronJobsPanel-CGq8lhRJ.js +0 -1
- package/dist/assets/DesignGalleryView-Ex3zW5ci.js +0 -1
- package/dist/assets/KanbanView-azjPGLmM.js +0 -3
- package/dist/assets/MailboxDetailView-BXW9zqle.js +0 -1
- package/dist/assets/MemoryManager-BLu0rLEm.js +0 -1
- package/dist/assets/ModelPicker-CXQR8UbH.js +0 -1
- package/dist/assets/ProcessMonitor-CBIQkbLx.js +0 -1
- package/dist/assets/QueuePanel-CutrvgTH.js +0 -1
- package/dist/assets/RefreshDebugView-DDFD26EI.js +0 -1
- package/dist/assets/SageTabs-Cx299O-q.js +0 -2
- package/dist/assets/SddHub-CmSlkvkM.js +0 -2
- package/dist/assets/SessionInspectView-CtrlRlJu.js +0 -1
- package/dist/assets/SessionList-BWoK6Ro5.js +0 -1
- package/dist/assets/SessionsDashboard-7C6Fj9pK.js +0 -1
- package/dist/assets/SetupScreen-IzaqHJ_O.js +0 -1
- package/dist/assets/SkillDetailView-C5nOcysX.js +0 -3
- package/dist/assets/TechStackView-DkNjeYPK.js +0 -2
- package/dist/assets/TerminalPanel-CTr-KAnH.js +0 -1
- package/dist/assets/chat-store-BbBGSliF.js +0 -1
- package/dist/assets/codemap-activity-store-CWi-Yd9Z.js +0 -1
- package/dist/assets/codemap-index-store-3M7F08K_.js +0 -1
- package/dist/assets/index-BnpuNJ9u.js +0 -144
- package/dist/assets/index-CWYymMpa.css +0 -1
- package/dist/assets/mailbox-store-yydAVjyj.js +0 -1
- package/dist/assets/stores-B7GcARdp.js +0 -7
- package/dist/assets/useWebSocket-L5s7ggJm.js +0 -27
- package/dist/assets/vendor-BshlG0z-.js +0 -125
- package/dist/assets/view-navigation-CvWJeGMc.js +0 -1
- package/dist/assets/ws-client-BR51gfnV.js +0 -22
- package/dist/assets/xterm-BWzBEEhg.js +0 -18
- package/dist/assets/xyflow-BNn76cbK.js +0 -7
- /package/dist/assets/{settings-D9AQ5wLT2.js → settings-D9AQ5wLT.js} +0 -0
|
@@ -0,0 +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{Bn as r,Bt as i,Ci as a,Fa as o,Gn as s,K as c,Ni as l,Nn as u,Oi as d,Ra as f,Ri as p,Rr as m,Vt as h,Yt as g,_r as _,_t as v,ca as y,en as b,nt as x,ya as S}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{t as C}from"./utils-CmY0Pw1m.js";import{n as w}from"./ui-store-BPQ-dcnY.js";import{H as T,Z as E,b as D,o as O}from"./index-CbwgQF8l.js";import{t as k}from"./empty-state-DtseAzny.js";var A=e(t(),1),j=n(),M={note:m,ask:l,assign:i,steer:g,btw:y,broadcast:i,status:d,result:p,review:h},N={high:`border-destructive/25 bg-destructive/10 text-destructive`,normal:`border-border bg-muted text-muted-foreground`,low:`border-primary/20 bg-primary/10 text-primary`};function P(e){return new Date(e).toLocaleString()}function F(e){let t=new Date(e),n=Date.now()-t.getTime();return n<6e4?f.t(`common:time.justNow`):n<36e5?f.t(`common:time.minutesAgo`,{count:Math.round(n/6e4)}):n<864e5?f.t(`common:time.hoursAgo`,{count:Math.round(n/36e5)}):n<6048e5?f.t(`common:time.daysAgo`,{count:Math.round(n/864e5)}):t.toLocaleDateString()}function I({readBy:e}){let{t}=o(),n=Object.entries(e);return n.length===0?null:(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsx)(`div`,{className:`text-[10px] font-semibold text-muted-foreground uppercase tracking-wide`,children:t(`activity:mailbox.readBy`)}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:n.map(([e,t])=>(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] bg-success/10 text-success`,title:P(t),children:[(0,j.jsx)(p,{className:`h-2.5 w-2.5`}),e]},e))})]})}function L({className:e}){let{t}=o(),n=w(e=>e.selectedMailMessage),i=w(e=>e.setSelectedMailMessage);(0,A.useEffect)(()=>()=>{i(null)},[i]);function l(){i(null),T(`chat`)}if(!n)return(0,j.jsx)(k,{icon:(0,j.jsx)(r,{className:`h-6 w-6`}),title:t(`activity:mailbox.emptyDetail`),description:t(`activity:mailbox.emptyDetailHint`)});let d=M[n.type]??u,f=t(`activity:mailbox.type.${n.type}`,{defaultValue:n.type}),m=N[n.priority]??N.normal,h=n.scope?{scope:n.scope,recipientSessionId:n.recipientSessionId}:E(n.to),g=n.to===`*`||n.to===`all`?t(`activity:mailbox.everyone`):n.to,y=h.scope===`session`?t(`activity:mailbox.sessionScope`,{sid:h.recipientSessionId??``}):h.scope===`project`?t(`activity:mailbox.projectScope`):t(`activity:mailbox.directScope`);return(0,j.jsx)(`div`,{className:C(`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-border/70 bg-card/75 shadow-sm`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/70 px-3 py-3 sm:px-4 shrink-0`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:l,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:t(`activity:mailbox.backToChat`),children:(0,j.jsx)(S,{className:`h-4 w-4`})}),(0,j.jsx)(`div`,{className:C(`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg`,n.completed?`bg-success/10`:`bg-primary/10`),children:(0,j.jsx)(d,{className:C(`h-4 w-4`,n.completed?`text-success`:`text-primary`)})}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,j.jsx)(`h2`,{className:`text-sm font-semibold text-foreground truncate`,children:n.subject}),n.completed&&(0,j.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md border border-success/25 bg-success/8 px-1.5 py-0.5 text-[10px] font-semibold text-success`,children:[(0,j.jsx)(p,{className:`h-3 w-3`}),t(`activity:mailbox.completed`)]}),(0,j.jsx)(`span`,{className:C(`rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,m),children:n.priority||`normal`}),n.audience===`leaders`&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-primary/25 bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold text-primary`,children:[(0,j.jsx)(s,{className:`h-2.5 w-2.5`}),` `,t(`activity:mailbox.audienceLeaders`)]})]}),(0,j.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,j.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/80`,children:n.from}),(0,j.jsx)(`span`,{children:`→`}),(0,j.jsx)(`span`,{className:`min-w-0 truncate`,children:g}),h.scope===`session`&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold bg-warning/12 text-warning`,title:t(`activity:mailbox.sessionScopeTitle`,{sid:h.recipientSessionId??``}),children:[(0,j.jsx)(s,{className:`h-2.5 w-2.5`}),t(`activity:mailbox.sessionLabel`)]}),h.scope===`project`&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold bg-primary/12 text-primary`,children:[(0,j.jsx)(_,{className:`h-2.5 w-2.5`}),t(`activity:mailbox.projectLabel`)]}),(0,j.jsx)(`span`,{className:`opacity-40`,children:`•`}),(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,j.jsx)(a,{className:`h-3 w-3`}),F(n.timestamp)]})]})]}),(0,j.jsx)(`button`,{type:`button`,onClick:l,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:t(`activity:mailbox.closeTitle`),children:(0,j.jsx)(c,{className:`h-4 w-4`})})]}),(0,j.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,j.jsx)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-5`,children:(0,j.jsx)(`div`,{className:`markdown-content prose prose-sm dark:prose-invert max-w-none text-sm leading-relaxed`,children:(0,j.jsx)(O,{components:D,children:n.body})})})}),(0,j.jsxs)(`div`,{className:`border-t border-border/70 bg-muted/20 px-4 py-3 shrink-0`,children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-x-6 gap-y-2 text-xs`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,j.jsx)(v,{className:`h-3 w-3 shrink-0`}),(0,j.jsx)(`span`,{children:f})]}),(0,j.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,j.jsx)(`span`,{className:C(`rounded border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,m),children:n.priority||`normal`})}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,j.jsx)(x,{className:`h-3 w-3 shrink-0`}),(0,j.jsx)(`span`,{className:`truncate`,title:n.from,children:n.from})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[h.scope===`session`?(0,j.jsx)(s,{className:`h-3 w-3 shrink-0 text-warning`}):(0,j.jsx)(_,{className:`h-3 w-3 shrink-0 text-primary`}),(0,j.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide shrink-0`,children:t(`activity:mailbox.scopeLabel`)}),(0,j.jsx)(`span`,{className:`truncate`,children:y})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,j.jsx)(a,{className:`h-3 w-3 shrink-0`}),(0,j.jsx)(`span`,{children:P(n.timestamp)})]}),n.replyTo&&(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground col-span-2`,children:[(0,j.jsx)(b,{className:`h-3 w-3 shrink-0`}),(0,j.jsx)(`span`,{className:`truncate`,children:t(`activity:mailbox.replyTo`,{id:n.replyTo})})]}),n.completed&&n.completedBy&&(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground col-span-2`,children:[(0,j.jsx)(p,{className:`h-3 w-3 shrink-0 text-success`}),(0,j.jsx)(`span`,{children:n.completedAt?t(`activity:mailbox.completedByAt`,{name:n.completedBy,time:P(n.completedAt)}):t(`activity:mailbox.completedBy`,{name:n.completedBy})})]}),n.outcome&&(0,j.jsxs)(`div`,{className:`flex items-start gap-1.5 text-muted-foreground col-span-2 sm:col-span-4`,children:[(0,j.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide shrink-0 mt-0.5`,children:t(`activity:mailbox.outcome`)}),(0,j.jsx)(`span`,{children:n.outcome})]}),n.taskContext&&(0,j.jsxs)(`div`,{className:`flex items-start gap-1.5 text-muted-foreground col-span-2 sm:col-span-4`,children:[(0,j.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide shrink-0 mt-0.5`,children:t(`activity:mailbox.task`)}),(0,j.jsx)(`span`,{children:n.taskContext})]})]}),Object.keys(n.readBy??{}).length>0&&(0,j.jsx)(`div`,{className:`mt-3 pt-3 border-t border-border/50`,children:(0,j.jsx)(I,{readBy:n.readBy})})]})]})})}export{L as MailboxDetailView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./ws-client-BR51gfnV.js";import{i as n,t as r}from"./react-core-BNmTiJ-I.js";import{$r as i,Et as a,Fa as o,K as s,Kn as c,Qr as l,Rr as u,ki as d,ln as f,lt as p,qi as m,tn as h,vr as g}from"./vendor-BshlG0z-.js";import"./i18n-tRUjoMoU.js";import{t as _}from"./utils-BpBOwXlT.js";import{t as v}from"./button-rqi3MczV.js";import{b as y,x as b}from"./index-BnpuNJ9u.js";import{g as x,h as S,l as C,r as w,v as T}from"./shared-D8dubdNH.js";var E=e(n(),1);function D(e){return e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/\/{2,}/g,`/`).toLowerCase()}var O={filePath:``,primaryMatches:[],symbolMatches:[],relatedMatches:[],totalCount:0,activeCount:0,supersededCount:0,reviewPendingCount:0};function k(e){let{filePath:n,lineStart:r,lineEnd:i,limit:a=50,showSuperseded:o=!0,showDeleted:s=!1,autoFetch:c=!0,sendOptions:l}=e,u=l?JSON.stringify(l):``,[d,f]=(0,E.useState)(null),[p,m]=(0,E.useState)(!1),[h,g]=(0,E.useState)(null),_=(0,E.useRef)(0),v=(0,E.useRef)(null),y=(0,E.useRef)(l);y.current=l;let b=(0,E.useCallback)(()=>{if(!n){f(null),g(null),m(!1);return}let e=++_.current;m(!0),g(null);let c=t();if(!c){g(`WebSocket client unavailable`),m(!1);return}v.current?.(),v.current=null;let l=n,u=c.on(`memory.sage.forFile`,t=>{if(e!==_.current)return;let n=t.payload.response;n&&D(n.filePath)!==D(l)||(t.payload.error?(g(t.payload.error),f(null)):(f(n??O),g(null)),m(!1))});v.current=u;let d={filePath:n,limit:a,showSuperseded:o,showDeleted:s,...r===void 0?{}:{lineStart:r},...i===void 0?{}:{lineEnd:i}};try{c.findMemoriesForFile(d,y.current??void 0)}catch(t){u(),v.current===u&&(v.current=null),e===_.current&&(g(t instanceof Error?t.message:String(t)),m(!1))}},[n,r,i,a,o,s]);(0,E.useEffect)(()=>{if(c)return b(),()=>{_.current++,v.current?.(),v.current=null}},[c,b,u]);let x=(0,E.useCallback)(()=>{b()},[b]);return(0,E.useEffect)(()=>()=>{v.current?.(),v.current=null},[]),{data:d,loading:p,error:h,refetch:x}}var A=r();function j(e){return e>=.9?`bg-success/15 border-success/40`:e>=.7?`bg-info/15 border-info/40`:e>=.4?`bg-warning/10 border-warning/30`:`bg-muted/30 border-border/40`}function M(e){switch(e){case`scope_file`:return`scope: file`;case`scope_symbol`:return`scope: symbol`;case`anchor_file`:return`anchor: file`;case`anchor_symbol`:return`anchor: symbol`;case`anchor_directory`:return`anchor: directory`;case`mention`:return`text mention`}}function N({match:e,cursorBoosted:t,onShowMemory:n,onAcceptDeletion:r,onKeep:i,onUpdate:u,onMarkPermanent:d,onRecover:y,pendingAction:b}){let{t:E}=o(),D=e.memory.status===`deleted`,O=e.memory.status===`superseded`,k=e.pendingReview,N=b!==void 0,P=t===!0;return(0,A.jsxs)(`article`,{className:_(`group relative rounded-md border px-3 py-2 text-sm transition-colors`,j(e.matchStrength),P&&`ring-1 ring-primary/40 ring-offset-0`,D&&`opacity-70`),"data-match-via":e.matchedVia,"data-memory-id":e.memory.id,children:[(0,A.jsx)(`header`,{className:`flex items-start justify-between gap-2`,children:(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] uppercase tracking-wide`,children:[(0,A.jsx)(`span`,{className:_(`font-mono`,S(e.memory.kind)),children:w[e.memory.kind]??e.memory.kind}),(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`·`}),(0,A.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:M(e.matchedVia)}),P&&(0,A.jsxs)(`span`,{className:`flex items-center gap-0.5 rounded-sm bg-primary/15 px-1 py-0.5 font-mono text-primary`,title:E(`activity:memoryManager.anchorCursorHint`),children:[(0,A.jsx)(f,{className:`size-2.5`}),` `,E(`activity:memoryManager.cursorLabel`)]}),k&&(0,A.jsxs)(`span`,{className:`flex items-center gap-0.5 rounded-sm bg-warning/15 px-1 py-0.5 font-mono text-warning`,title:E(`activity:memoryManager.hygieneReviewTitle`,{reason:k.reason,days:k.ageDays}),children:[(0,A.jsx)(p,{className:`size-2.5`}),` `,E(`activity:memoryManager.reviewLabel`)]}),D&&(0,A.jsx)(`span`,{className:`font-mono text-destructive`,children:E(`activity:memoryManager.statusDeleted`)}),O&&!D&&(0,A.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:E(`activity:memoryManager.statusSuperseded`)})]}),(0,A.jsx)(`p`,{className:`mt-1 text-foreground/90`,children:x(e.memory.text,200)}),(0,A.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,A.jsx)(C,{status:e.memory.status}),(0,A.jsx)(`span`,{children:E(`activity:memoryManager.updatedSuffix`,{date:T(e.memory.updatedAt)})})]})]})}),(0,A.jsxs)(`footer`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:[D&&y&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>y(e.memory.id),className:`h-7 gap-1 border-primary/40 px-2 text-[11px] text-primary hover:bg-primary/10`,title:E(`activity:memoryManager.restoreTitle`),children:[(0,A.jsx)(h,{className:`size-3`}),` `,E(`activity:memoryManager.actionRecover`)]}),O&&e.supersededByActiveId&&n&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>n(e.supersededByActiveId),className:`h-7 gap-1 px-2 text-[11px]`,title:E(`activity:memoryManager.supersededJumpTitle`),children:[(0,A.jsx)(g,{className:`size-3`}),` `,E(`activity:memoryManager.actionGoToActive`)]}),k&&(r||i||u||d)&&(0,A.jsxs)(A.Fragment,{children:[k.suggestedAction===`delete`&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`destructive`,disabled:N,onClick:()=>r?.(k.candidateId,e.memory.id),className:`h-7 gap-1 px-2 text-[11px]`,title:E(`activity:memoryManager.acceptSuggestionTitle`),children:[(0,A.jsx)(m,{className:`size-3`}),` `,E(`activity:memoryManager.actionAcceptDeletion`)]}),(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>i?.(k.candidateId,e.memory.id),className:`h-7 gap-1 px-2 text-[11px]`,title:E(`activity:memoryManager.rejectSuggestionTitle`),children:[(0,A.jsx)(s,{className:`size-3`}),` `,E(`activity:memoryManager.actionKeep`)]}),(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>u?.(e.memory.id),className:`h-7 gap-1 px-2 text-[11px]`,title:E(`activity:memoryManager.updateTitle`),children:[(0,A.jsx)(a,{className:`size-3`}),` `,E(`activity:memoryManager.actionUpdate`)]}),d&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>d(e.memory.id),className:`h-7 gap-1 border-warning/40 px-2 text-[11px] text-warning hover:bg-warning/10`,title:E(`activity:memoryManager.promoteTitle`),children:[(0,A.jsx)(f,{className:`size-3`}),` `,E(`activity:memoryManager.actionMarkPermanent`)]})]}),n&&!D&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`ghost`,disabled:N,onClick:()=>n(e.memory.id),className:`h-7 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,title:E(`activity:memoryManager.openRecordTitle`),children:[(0,A.jsx)(l,{className:`size-3`}),` `,E(`activity:memoryManager.actionShowFull`)]}),b&&(0,A.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,A.jsx)(c,{className:`size-3 animate-spin`}),` `,b]})]})]})}function P({icon:e,title:t,count:n,matches:r,cursorBoosted:i=!1,...a}){let{t:s}=o(),c=b(r,10);return r.length===0?null:(0,A.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center gap-1.5 px-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,A.jsx)(e,{className:`size-3`}),(0,A.jsx)(`span`,{children:t}),(0,A.jsxs)(`span`,{className:`font-mono`,children:[`(`,n,`)`]}),i&&(0,A.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5 font-mono text-[9px] text-primary`,children:[(0,A.jsx)(f,{className:`size-2.5`}),` `,s(`activity:memoryManager.cursorBoostTitle`)]})]}),(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:c.pageItems.map(e=>(0,A.jsx)(N,{match:e,cursorBoosted:i&&(e.matchedVia===`anchor_symbol`||e.matchedVia===`scope_symbol`),pendingAction:a.pendingActionById.get(e.memory.id),...a},e.memory.id))}),(0,A.jsx)(y,{page:c.page,pageSize:c.pageSize,totalItems:c.totalItems,onPageChange:c.setPage,compact:!0,itemLabel:s(`activity:memoryManager.itemLabel`)})]})}function F({filePath:e,lineStart:t,lineEnd:n,open:r,onClose:a,onShowMemory:s,onAcceptDeletion:c,onKeep:m,onUpdate:g,onMarkPermanent:y,onRecover:b}){let{t:x}=o(),[S,C]=(0,E.useState)(!1),[w,T]=(0,E.useState)(new Map),D={accepting:x(`activity:memoryManager.pendingAccepting`),keeping:x(`activity:memoryManager.pendingKeeping`),updating:x(`activity:memoryManager.pendingUpdating`),marking:x(`activity:memoryManager.pendingMarking`),recovering:x(`activity:memoryManager.pendingRecovering`)},{data:O,loading:j,error:M,refetch:N}=k({filePath:e,lineStart:t,lineEnd:n,showDeleted:S,autoFetch:r}),F=t!==void 0&&n!==void 0,L=(0,E.useCallback)(async(e,t,n)=>{if(n){T(n=>new Map(n).set(e,t));try{await n(e)}finally{T(t=>{let n=new Map(t);return n.delete(e),n})}}},[]);if((0,E.useEffect)(()=>{C(!1)},[e]),!r)return null;let R=O,z=R?.totalCount??0;return(0,A.jsxs)(`aside`,{className:`flex h-full min-h-0 w-full flex-col border-l border-border/70 bg-card/15`,"aria-label":x(`activity:memoryManager.fileDrawerAria`),"data-file-path":e??``,children:[(0,A.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3 py-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] uppercase tracking-wide text-muted-foreground`,children:[(0,A.jsx)(u,{className:`size-3`}),(0,A.jsx)(`span`,{className:`truncate font-mono`,title:e??``,children:e??x(`activity:memoryManager.noFile`)})]}),(0,A.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,A.jsx)(`span`,{className:`font-mono`,children:x(`activity:memoryManager.memoriesCount`,{count:z})}),R&&R.reviewPendingCount>0&&(0,A.jsxs)(`span`,{className:`flex items-center gap-0.5 font-mono text-warning`,children:[(0,A.jsx)(p,{className:`size-3`}),x(`activity:memoryManager.pendingReviewCount`,{count:R.reviewPendingCount})]}),R&&R.supersededCount>0&&(0,A.jsx)(`span`,{className:`font-mono`,children:x(`activity:memoryManager.supersededCount`,{count:R.supersededCount})})]})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,A.jsx)(v,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>N(),disabled:j||!e,className:`h-7 w-7 p-0`,"aria-label":x(`common:action.refresh`),title:x(`activity:memoryManager.requeryTitle`),children:(0,A.jsx)(h,{className:_(`size-3.5`,j&&`animate-spin`)})}),(0,A.jsx)(v,{type:`button`,size:`sm`,variant:`ghost`,onClick:a,className:`h-7 w-7 p-0`,"aria-label":x(`activity:memoryManager.closeDrawerAria`),title:x(`activity:memoryManager.closeDrawerTitle`),children:(0,A.jsx)(d,{className:`size-3.5`})})]})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border/40 bg-background/40 px-3 py-1.5 text-[10px] text-muted-foreground`,children:[(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:S,onChange:e=>C(e.target.checked),className:`size-3 accent-primary`,disabled:!e,"data-testid":`memory-drawer-show-deleted`}),S?(0,A.jsx)(l,{className:`size-3`}):(0,A.jsx)(i,{className:`size-3`}),(0,A.jsx)(`span`,{children:x(`activity:memoryManager.showRecoverable`)})]}),F&&(0,A.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 font-mono text-[10px] text-primary`,children:[(0,A.jsx)(f,{className:`size-3`}),` `,x(`activity:memoryManager.linesRange`,{start:t,end:n})]})]}),(0,A.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-3 py-3`,children:e?j&&!R?(0,A.jsx)(I,{loading:!0,message:x(`activity:memoryManager.loadingMemories`)}):M?(0,A.jsx)(I,{tone:`error`,message:x(`activity:memoryManager.errorPrefix`,{message:M})}):!R||z===0?(0,A.jsx)(I,{message:x(`activity:memoryManager.emptyNoMemories`,{file:e})}):(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,A.jsx)(P,{icon:f,title:x(`activity:memoryManager.cursorBoostTitle`),count:R.symbolMatches.length,cursorBoosted:F,matches:R.symbolMatches,pendingActionById:w,onShowMemory:s,onAcceptDeletion:(e,t)=>L(t,D.accepting,()=>c?.(e,t)),onKeep:(e,t)=>L(t,D.keeping,()=>m?.(e,t)),onUpdate:e=>L(e,D.updating,()=>g?.(e)),onMarkPermanent:e=>L(e,D.marking,()=>y?.(e)),onRecover:e=>L(e,D.recovering,()=>b?.(e))}),(0,A.jsx)(P,{icon:u,title:x(`activity:memoryManager.fileScopedTitle`),count:R.primaryMatches.length,matches:R.primaryMatches,pendingActionById:w,onShowMemory:s,onAcceptDeletion:(e,t)=>L(t,D.accepting,()=>c?.(e,t)),onKeep:(e,t)=>L(t,D.keeping,()=>m?.(e,t)),onUpdate:e=>L(e,D.updating,()=>g?.(e)),onMarkPermanent:e=>L(e,D.marking,()=>y?.(e)),onRecover:e=>L(e,D.recovering,()=>b?.(e))}),(0,A.jsx)(P,{icon:l,title:x(`activity:memoryManager.mentionedInTitle`),count:R.relatedMatches.length,matches:R.relatedMatches,pendingActionById:w,onShowMemory:s,onAcceptDeletion:(e,t)=>L(t,D.accepting,()=>c?.(e,t)),onKeep:(e,t)=>L(t,D.keeping,()=>m?.(e,t)),onUpdate:e=>L(e,D.updating,()=>g?.(e)),onMarkPermanent:e=>L(e,D.marking,()=>y?.(e)),onRecover:e=>L(e,D.recovering,()=>b?.(e))})]}):(0,A.jsx)(I,{message:x(`activity:memoryManager.emptyOpenFile`)})})]})}function I({message:e,loading:t=!1,tone:n=`default`}){return(0,A.jsxs)(`div`,{className:_(`flex min-h-[120px] flex-col items-center justify-center gap-2 rounded-md border border-dashed border-border/60 px-4 py-6 text-center text-[11px]`,n===`error`?`text-destructive`:`text-muted-foreground`),children:[t&&(0,A.jsx)(c,{className:`size-4 animate-spin`}),(0,A.jsx)(`p`,{children:e})]})}export{F as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./ws-client-DitX7fid.js";import{i as n,t as r}from"./react-core-D0Ec-185.js";import{$r as i,Et as a,Fa as o,K as s,Kn as c,Qr as l,Rr as u,ki as d,ln as f,lt as p,qi as m,tn as h,vr as g}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{t as _}from"./utils-CmY0Pw1m.js";import{t as v}from"./button-BIFXNDDY.js";import{C as y,S as b}from"./index-CbwgQF8l.js";import{g as x,h as S,l as C,r as w,v as T}from"./shared-k2sZgl6A.js";var E=e(n(),1);function D(e){return e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/\/{2,}/g,`/`).toLowerCase()}var O={filePath:``,primaryMatches:[],symbolMatches:[],relatedMatches:[],totalCount:0,activeCount:0,supersededCount:0,reviewPendingCount:0};function k(e){let{filePath:n,lineStart:r,lineEnd:i,limit:a=50,showSuperseded:o=!0,showDeleted:s=!1,autoFetch:c=!0,sendOptions:l}=e,u=l?JSON.stringify(l):``,[d,f]=(0,E.useState)(null),[p,m]=(0,E.useState)(!1),[h,g]=(0,E.useState)(null),_=(0,E.useRef)(0),v=(0,E.useRef)(null),y=(0,E.useRef)(l);y.current=l;let b=(0,E.useCallback)(()=>{if(!n){f(null),g(null),m(!1);return}let e=++_.current;m(!0),g(null);let c=t();if(!c){g(`WebSocket client unavailable`),m(!1);return}v.current?.(),v.current=null;let l=n,u=c.on(`memory.sage.forFile`,t=>{if(e!==_.current)return;let n=t.payload.response;n&&D(n.filePath)!==D(l)||(t.payload.error?(g(t.payload.error),f(null)):(f(n??O),g(null)),m(!1))});v.current=u;let d={filePath:n,limit:a,showSuperseded:o,showDeleted:s,...r===void 0?{}:{lineStart:r},...i===void 0?{}:{lineEnd:i}};try{c.findMemoriesForFile(d,y.current??void 0)}catch(t){u(),v.current===u&&(v.current=null),e===_.current&&(g(t instanceof Error?t.message:String(t)),m(!1))}},[n,r,i,a,o,s]);(0,E.useEffect)(()=>{if(c)return b(),()=>{_.current++,v.current?.(),v.current=null}},[c,b,u]);let x=(0,E.useCallback)(()=>{b()},[b]);return(0,E.useEffect)(()=>()=>{v.current?.(),v.current=null},[]),{data:d,loading:p,error:h,refetch:x}}var A=r();function j(e){return e>=.9?`bg-success/15 border-success/40`:e>=.7?`bg-info/15 border-info/40`:e>=.4?`bg-warning/10 border-warning/30`:`bg-muted/30 border-border/40`}function M(e){switch(e){case`scope_file`:return`scope: file`;case`scope_symbol`:return`scope: symbol`;case`anchor_file`:return`anchor: file`;case`anchor_symbol`:return`anchor: symbol`;case`anchor_directory`:return`anchor: directory`;case`mention`:return`text mention`}}function N({match:e,cursorBoosted:t,onShowMemory:n,onAcceptDeletion:r,onKeep:i,onUpdate:u,onMarkPermanent:d,onRecover:y,pendingAction:b}){let{t:E}=o(),D=e.memory.status===`deleted`,O=e.memory.status===`superseded`,k=e.pendingReview,N=b!==void 0,P=t===!0;return(0,A.jsxs)(`article`,{className:_(`group relative rounded-md border px-3 py-2 text-sm transition-colors`,j(e.matchStrength),P&&`ring-1 ring-primary/40 ring-offset-0`,D&&`opacity-70`),"data-match-via":e.matchedVia,"data-memory-id":e.memory.id,children:[(0,A.jsx)(`header`,{className:`flex items-start justify-between gap-2`,children:(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] uppercase tracking-wide`,children:[(0,A.jsx)(`span`,{className:_(`font-mono`,S(e.memory.kind)),children:w[e.memory.kind]??e.memory.kind}),(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`·`}),(0,A.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:M(e.matchedVia)}),P&&(0,A.jsxs)(`span`,{className:`flex items-center gap-0.5 rounded-sm bg-primary/15 px-1 py-0.5 font-mono text-primary`,title:E(`activity:memoryManager.anchorCursorHint`),children:[(0,A.jsx)(f,{className:`size-2.5`}),` `,E(`activity:memoryManager.cursorLabel`)]}),k&&(0,A.jsxs)(`span`,{className:`flex items-center gap-0.5 rounded-sm bg-warning/15 px-1 py-0.5 font-mono text-warning`,title:E(`activity:memoryManager.hygieneReviewTitle`,{reason:k.reason,days:k.ageDays}),children:[(0,A.jsx)(p,{className:`size-2.5`}),` `,E(`activity:memoryManager.reviewLabel`)]}),D&&(0,A.jsx)(`span`,{className:`font-mono text-destructive`,children:E(`activity:memoryManager.statusDeleted`)}),O&&!D&&(0,A.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:E(`activity:memoryManager.statusSuperseded`)})]}),(0,A.jsx)(`p`,{className:`mt-1 text-foreground/90`,children:x(e.memory.text,200)}),(0,A.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,A.jsx)(C,{status:e.memory.status}),(0,A.jsx)(`span`,{children:E(`activity:memoryManager.updatedSuffix`,{date:T(e.memory.updatedAt)})})]})]})}),(0,A.jsxs)(`footer`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:[D&&y&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>y(e.memory.id),className:`h-7 gap-1 border-primary/40 px-2 text-[11px] text-primary hover:bg-primary/10`,title:E(`activity:memoryManager.restoreTitle`),children:[(0,A.jsx)(h,{className:`size-3`}),` `,E(`activity:memoryManager.actionRecover`)]}),O&&e.supersededByActiveId&&n&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>n(e.supersededByActiveId),className:`h-7 gap-1 px-2 text-[11px]`,title:E(`activity:memoryManager.supersededJumpTitle`),children:[(0,A.jsx)(g,{className:`size-3`}),` `,E(`activity:memoryManager.actionGoToActive`)]}),k&&(r||i||u||d)&&(0,A.jsxs)(A.Fragment,{children:[k.suggestedAction===`delete`&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`destructive`,disabled:N,onClick:()=>r?.(k.candidateId,e.memory.id),className:`h-7 gap-1 px-2 text-[11px]`,title:E(`activity:memoryManager.acceptSuggestionTitle`),children:[(0,A.jsx)(m,{className:`size-3`}),` `,E(`activity:memoryManager.actionAcceptDeletion`)]}),(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>i?.(k.candidateId,e.memory.id),className:`h-7 gap-1 px-2 text-[11px]`,title:E(`activity:memoryManager.rejectSuggestionTitle`),children:[(0,A.jsx)(s,{className:`size-3`}),` `,E(`activity:memoryManager.actionKeep`)]}),(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>u?.(e.memory.id),className:`h-7 gap-1 px-2 text-[11px]`,title:E(`activity:memoryManager.updateTitle`),children:[(0,A.jsx)(a,{className:`size-3`}),` `,E(`activity:memoryManager.actionUpdate`)]}),d&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`outline`,disabled:N,onClick:()=>d(e.memory.id),className:`h-7 gap-1 border-warning/40 px-2 text-[11px] text-warning hover:bg-warning/10`,title:E(`activity:memoryManager.promoteTitle`),children:[(0,A.jsx)(f,{className:`size-3`}),` `,E(`activity:memoryManager.actionMarkPermanent`)]})]}),n&&!D&&(0,A.jsxs)(v,{type:`button`,size:`sm`,variant:`ghost`,disabled:N,onClick:()=>n(e.memory.id),className:`h-7 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,title:E(`activity:memoryManager.openRecordTitle`),children:[(0,A.jsx)(l,{className:`size-3`}),` `,E(`activity:memoryManager.actionShowFull`)]}),b&&(0,A.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,A.jsx)(c,{className:`size-3 animate-spin`}),` `,b]})]})]})}function P({icon:e,title:t,count:n,matches:r,cursorBoosted:i=!1,...a}){let{t:s}=o(),c=y(r,10);return r.length===0?null:(0,A.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center gap-1.5 px-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,A.jsx)(e,{className:`size-3`}),(0,A.jsx)(`span`,{children:t}),(0,A.jsxs)(`span`,{className:`font-mono`,children:[`(`,n,`)`]}),i&&(0,A.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5 font-mono text-[9px] text-primary`,children:[(0,A.jsx)(f,{className:`size-2.5`}),` `,s(`activity:memoryManager.cursorBoostTitle`)]})]}),(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:c.pageItems.map(e=>(0,A.jsx)(N,{match:e,cursorBoosted:i&&(e.matchedVia===`anchor_symbol`||e.matchedVia===`scope_symbol`),pendingAction:a.pendingActionById.get(e.memory.id),...a},e.memory.id))}),(0,A.jsx)(b,{page:c.page,pageSize:c.pageSize,totalItems:c.totalItems,onPageChange:c.setPage,compact:!0,itemLabel:s(`activity:memoryManager.itemLabel`)})]})}function F({filePath:e,lineStart:t,lineEnd:n,open:r,onClose:a,onShowMemory:s,onAcceptDeletion:c,onKeep:m,onUpdate:g,onMarkPermanent:y,onRecover:b}){let{t:x}=o(),[S,C]=(0,E.useState)(!1),[w,T]=(0,E.useState)(new Map),D={accepting:x(`activity:memoryManager.pendingAccepting`),keeping:x(`activity:memoryManager.pendingKeeping`),updating:x(`activity:memoryManager.pendingUpdating`),marking:x(`activity:memoryManager.pendingMarking`),recovering:x(`activity:memoryManager.pendingRecovering`)},{data:O,loading:j,error:M,refetch:N}=k({filePath:e,lineStart:t,lineEnd:n,showDeleted:S,autoFetch:r}),F=t!==void 0&&n!==void 0,L=(0,E.useCallback)(async(e,t,n)=>{if(n){T(n=>new Map(n).set(e,t));try{await n(e)}finally{T(t=>{let n=new Map(t);return n.delete(e),n})}}},[]);if((0,E.useEffect)(()=>{C(!1)},[e]),!r)return null;let R=O,z=R?.totalCount??0;return(0,A.jsxs)(`aside`,{className:`flex h-full min-h-0 w-full flex-col border-l border-border/70 bg-card/15`,"aria-label":x(`activity:memoryManager.fileDrawerAria`),"data-file-path":e??``,children:[(0,A.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3 py-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] uppercase tracking-wide text-muted-foreground`,children:[(0,A.jsx)(u,{className:`size-3`}),(0,A.jsx)(`span`,{className:`truncate font-mono`,title:e??``,children:e??x(`activity:memoryManager.noFile`)})]}),(0,A.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,A.jsx)(`span`,{className:`font-mono`,children:x(`activity:memoryManager.memoriesCount`,{count:z})}),R&&R.reviewPendingCount>0&&(0,A.jsxs)(`span`,{className:`flex items-center gap-0.5 font-mono text-warning`,children:[(0,A.jsx)(p,{className:`size-3`}),x(`activity:memoryManager.pendingReviewCount`,{count:R.reviewPendingCount})]}),R&&R.supersededCount>0&&(0,A.jsx)(`span`,{className:`font-mono`,children:x(`activity:memoryManager.supersededCount`,{count:R.supersededCount})})]})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,A.jsx)(v,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>N(),disabled:j||!e,className:`h-7 w-7 p-0`,"aria-label":x(`common:action.refresh`),title:x(`activity:memoryManager.requeryTitle`),children:(0,A.jsx)(h,{className:_(`size-3.5`,j&&`animate-spin`)})}),(0,A.jsx)(v,{type:`button`,size:`sm`,variant:`ghost`,onClick:a,className:`h-7 w-7 p-0`,"aria-label":x(`activity:memoryManager.closeDrawerAria`),title:x(`activity:memoryManager.closeDrawerTitle`),children:(0,A.jsx)(d,{className:`size-3.5`})})]})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border/40 bg-background/40 px-3 py-1.5 text-[10px] text-muted-foreground`,children:[(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:S,onChange:e=>C(e.target.checked),className:`size-3 accent-primary`,disabled:!e,"data-testid":`memory-drawer-show-deleted`}),S?(0,A.jsx)(l,{className:`size-3`}):(0,A.jsx)(i,{className:`size-3`}),(0,A.jsx)(`span`,{children:x(`activity:memoryManager.showRecoverable`)})]}),F&&(0,A.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 font-mono text-[10px] text-primary`,children:[(0,A.jsx)(f,{className:`size-3`}),` `,x(`activity:memoryManager.linesRange`,{start:t,end:n})]})]}),(0,A.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-3 py-3`,children:e?j&&!R?(0,A.jsx)(I,{loading:!0,message:x(`activity:memoryManager.loadingMemories`)}):M?(0,A.jsx)(I,{tone:`error`,message:x(`activity:memoryManager.errorPrefix`,{message:M})}):!R||z===0?(0,A.jsx)(I,{message:x(`activity:memoryManager.emptyNoMemories`,{file:e})}):(0,A.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,A.jsx)(P,{icon:f,title:x(`activity:memoryManager.cursorBoostTitle`),count:R.symbolMatches.length,cursorBoosted:F,matches:R.symbolMatches,pendingActionById:w,onShowMemory:s,onAcceptDeletion:(e,t)=>L(t,D.accepting,()=>c?.(e,t)),onKeep:(e,t)=>L(t,D.keeping,()=>m?.(e,t)),onUpdate:e=>L(e,D.updating,()=>g?.(e)),onMarkPermanent:e=>L(e,D.marking,()=>y?.(e)),onRecover:e=>L(e,D.recovering,()=>b?.(e))}),(0,A.jsx)(P,{icon:u,title:x(`activity:memoryManager.fileScopedTitle`),count:R.primaryMatches.length,matches:R.primaryMatches,pendingActionById:w,onShowMemory:s,onAcceptDeletion:(e,t)=>L(t,D.accepting,()=>c?.(e,t)),onKeep:(e,t)=>L(t,D.keeping,()=>m?.(e,t)),onUpdate:e=>L(e,D.updating,()=>g?.(e)),onMarkPermanent:e=>L(e,D.marking,()=>y?.(e)),onRecover:e=>L(e,D.recovering,()=>b?.(e))}),(0,A.jsx)(P,{icon:l,title:x(`activity:memoryManager.mentionedInTitle`),count:R.relatedMatches.length,matches:R.relatedMatches,pendingActionById:w,onShowMemory:s,onAcceptDeletion:(e,t)=>L(t,D.accepting,()=>c?.(e,t)),onKeep:(e,t)=>L(t,D.keeping,()=>m?.(e,t)),onUpdate:e=>L(e,D.updating,()=>g?.(e)),onMarkPermanent:e=>L(e,D.marking,()=>y?.(e)),onRecover:e=>L(e,D.recovering,()=>b?.(e))})]}):(0,A.jsx)(I,{message:x(`activity:memoryManager.emptyOpenFile`)})})]})}function I({message:e,loading:t=!1,tone:n=`default`}){return(0,A.jsxs)(`div`,{className:_(`flex min-h-[120px] flex-col items-center justify-center gap-2 rounded-md border border-dashed border-border/60 px-4 py-6 text-center text-[11px]`,n===`error`?`text-destructive`:`text-muted-foreground`),children:[t&&(0,A.jsx)(c,{className:`size-4 animate-spin`}),(0,A.jsx)(`p`,{children:e})]})}export{F as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{et as t}from"./ws-client-DitX7fid.js";import{i as n,t as r}from"./react-core-D0Ec-185.js";import{$n as i,Ct as a,Er as o,Et as s,Fa as c,K as l,Ki as u,Kn as d,Kt as f,Li as p,Nt as m,Ta as h,Ti as ee,Vt as g,Wi as _,Yr as v,_t as y,ci as b,dn as x,ea as S,ft as C,gn as w,hn as te,lt as T,mr as E,n as D,qi as ne,sa as O,sn as k,ta as A,ti as re,tn as j,wn as ie,xr as ae,ya as oe}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{a as M,h as N,n as se,r as P,t as ce,u as le}from"./xyflow-BlkaZTzI.js";import{t as F}from"./utils-CmY0Pw1m.js";import{n as ue}from"./ui-store-BPQ-dcnY.js";import{a as I,i as de,n as fe,o as pe,r as me,t as L}from"./dialog-DT8I6gze.js";import{t as R}from"./button-BIFXNDDY.js";import{t as z}from"./input-DE1O73TJ.js";import{P as he,v as ge}from"./index-CbwgQF8l.js";import{t as B}from"./roster-ws--cUKX8Eo.js";import{_ as _e,a as ve,b as ye,c as be,d as xe,f as Se,g as V,h as Ce,i as we,l as Te,m as H,n as Ee,o as De,p as Oe,r as ke,s as U,t as Ae,u as je,v as Me,y as W}from"./shared-k2sZgl6A.js";import{t as Ne}from"./MemoryDrawer-B4aW4mVs.js";var G=r();function Pe({busyAction:e,deletingId:t,memory:n,onCancel:r,onConfirm:i,onOpenChange:a}){let{t:o}=c();return(0,G.jsx)(L,{open:!!t,onOpenChange:a,children:(0,G.jsxs)(fe,{className:`max-w-md`,children:[(0,G.jsxs)(I,{children:[(0,G.jsx)(`span`,{className:`mb-2 flex size-10 items-center justify-center border border-destructive/35 bg-destructive/10 text-destructive`,children:(0,G.jsx)(C,{className:`size-4`})}),(0,G.jsx)(pe,{children:o(`activity:memoryManager.deleteTitle`)}),(0,G.jsx)(me,{className:`leading-6`,children:o(`activity:deleteMemoryDialog.sageWillMarkTheRecordDeleted`)})]}),(0,G.jsx)(`div`,{className:`border border-border/70 bg-background/45 p-3 text-xs text-muted-foreground`,children:V(n?.text??``,180)}),(0,G.jsxs)(de,{children:[(0,G.jsx)(R,{variant:`outline`,onClick:r,disabled:e===`delete`,children:o(`common:action.cancel`)}),(0,G.jsxs)(R,{variant:`destructive`,onClick:i,disabled:e===`delete`,children:[e===`delete`?(0,G.jsx)(d,{className:`size-4 animate-spin`}):(0,G.jsx)(C,{className:`size-4`}),o(e===`delete`?`activity:memoryManager.deletingLabel`:`activity:memoryManager.actionDeleteMemory`)]})]})]})})}var K=e(n(),1),Fe=212,Ie=188;function Le(e){return e.length>14?`${e.slice(0,11)}…`:e}function Re(e,t=58){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n}function ze(e){return e.type===`symbol`?[e.path,e.symbol?`#${e.symbol}`:``].filter(Boolean).join(``):e.path??e.command??e.symbol??e.role??e.type}function q(e){return e===`active`?`border-success/45 bg-success/10 text-success`:e===`stale`?`border-warning/45 bg-warning/10 text-warning`:e===`contradicted`?`border-destructive/45 bg-destructive/10 text-destructive`:e===`superseded`?`border-warning/35 bg-warning/5 text-warning`:`border-border bg-muted/55 text-muted-foreground`}function J({data:e}){let{entry:t,center:n}=e;return(0,G.jsxs)(`div`,{className:n?`border border-primary/70 bg-card px-3 py-2.5 text-card-foreground shadow-[0_0_0_1px_hsl(var(--primary)/0.2),0_0_24px_hsl(var(--primary)/0.12)]`:`border border-border/80 bg-card/95 px-3 py-2.5 text-card-foreground shadow-lg`,style:{width:Fe},title:t.text,children:[(0,G.jsx)(M,{type:`target`,position:N.Top,className:`!border-background !bg-muted-foreground`}),(0,G.jsx)(M,{type:`source`,position:N.Bottom,className:`!border-background !bg-primary`}),(0,G.jsx)(M,{type:`source`,position:N.Right,className:`!border-background !bg-primary`}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`border px-1.5 py-0.5 text-[9px] font-bold uppercase ${q(t.status)}`,children:t.status}),(0,G.jsx)(`span`,{className:`ml-auto truncate font-mono text-[9px] text-muted-foreground`,children:Le(t.id)})]}),(0,G.jsx)(`p`,{className:`mt-2 line-clamp-2 text-[11px] leading-4 text-foreground/90`,children:Re(t.text)}),(0,G.jsx)(`p`,{className:`mt-1 font-mono text-[9px] uppercase text-muted-foreground`,children:t.kind})]})}function Be({data:e}){return(0,G.jsxs)(`div`,{className:`border border-info/40 bg-info/8 px-2.5 py-2 text-card-foreground shadow-lg`,style:{width:Ie},title:e.label,children:[(0,G.jsx)(M,{type:`target`,position:N.Left,className:`!border-background !bg-info`}),(0,G.jsx)(`p`,{className:`font-mono text-[9px] font-bold uppercase text-info`,children:e.anchor.type}),(0,G.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-foreground/85`,children:e.label})]})}var Y={memoryNode:J,anchorNode:Be};function Ve(e,t){return{id:e,revision:0,scope:`project`,kind:`fact`,status:`deleted`,text:t(`activity:memoryManager.memoryUnavailable`),importance:0,confidence:0,freshness:0,tags:[],anchors:[],createdAt:``,updatedAt:``}}function X({nodes:e,edges:t,className:n}){return(0,G.jsx)(`div`,{className:F(`w-full`,n),children:(0,G.jsxs)(le,{nodes:e,edges:t,nodeTypes:Y,fitView:!0,fitViewOptions:{padding:.24,maxZoom:1.05},minZoom:.4,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!1,zoomOnScroll:!1,proOptions:{hideAttribution:!0},children:[(0,G.jsx)(ce,{variant:se.Dots,gap:18,size:1,color:`hsl(var(--muted-foreground) / 0.18)`}),(0,G.jsx)(P,{showInteractive:!1,className:`!border-border !bg-card !shadow-lg`})]})})}function He({centerMemory:e,allMemories:t,graphEdges:n,loading:r=!1,error:i=null}){let{t:a}=c(),[o,s]=(0,K.useState)(!1),l=`mem:${e.id}`,u=(0,K.useMemo)(()=>n.filter(e=>e.from===l&&e.to.startsWith(`mem:`)||e.to===l&&e.from.startsWith(`mem:`)).slice(0,24),[l,n]),{nodes:d,edges:f}=(0,K.useMemo)(()=>{let n=[],r=[],i=new Map(t.map(e=>[e.id,e]));n.push({id:e.id,type:`memoryNode`,position:{x:320-Fe/2,y:120},data:{entry:e,center:!0}});let o=[...e.supersededBy?[{id:e.supersededBy,relation:`superseded by`}]:[],...(e.supersedes??[]).map(e=>({id:e,relation:`supersedes`})),...(e.contradicts??[]).map(e=>({id:e,relation:`contradicts`}))];for(let e of u){let t=(e.from===l?e.to:e.from).slice(4);o.some(n=>n.id===t&&n.relation===e.relation)||o.push({id:t,relation:e.relation,weight:e.weight,evidence:e.evidence})}let s=320-(o.length-1)*220/2;return o.forEach((t,o)=>{let c=i.get(t.id)??Ve(t.id,a),l=t.relation===`superseded by`,u=l?0:280+Math.floor(o/3)*130,d=l?320-Fe/2:s+o*220-Fe/2;n.push({id:`memory:${t.id}:${o}`,type:`memoryNode`,position:{x:d,y:u},data:{entry:c,center:!1}});let f=t.relation===`contradicts`,p=l?`memory:${t.id}:${o}`:e.id,m=l?e.id:`memory:${t.id}:${o}`;r.push({id:`relation:${t.relation}:${t.id}:${o}`,source:p,target:m,type:`smoothstep`,animated:!f,label:t.weight===void 0?t.relation:`${t.relation} ${t.weight.toFixed(2)}`,data:{evidence:t.evidence??[]},style:{stroke:f?`hsl(var(--destructive))`:`hsl(var(--primary))`,strokeWidth:1.7,...f?{strokeDasharray:`5 4`}:{}},labelStyle:{fill:f?`hsl(var(--destructive))`:`hsl(var(--muted-foreground))`,fontSize:9,fontWeight:700},labelBgStyle:{fill:`hsl(var(--card))`,fillOpacity:.9}})}),e.anchors.forEach((t,i)=>{let a=`anchor:${i}`;n.push({id:a,type:`anchorNode`,position:{x:540,y:120+(i-(e.anchors.length-1)/2)*66},data:{anchor:t,label:ze(t)}}),r.push({id:`anchor-edge:${i}`,source:e.id,target:a,type:`smoothstep`,style:{stroke:`hsl(var(--info))`,strokeWidth:1.3}})}),{nodes:n,edges:r}},[t,e,l,u]);return d.length<=1&&!r&&!i?null:(0,G.jsxs)(`section`,{className:`overflow-hidden border border-border/75 bg-background/35`,"aria-label":a(`activity:memoryManager.graphAria`),children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 bg-card/55 px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`p`,{className:`text-[10px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:a(`activity:memoryManager.graphHeading`)}),d.length>1&&(0,G.jsxs)(R,{variant:`ghost`,size:`sm`,onClick:()=>s(!0),className:`h-6 gap-1 px-2 text-[9px] font-bold uppercase tracking-[0.12em]`,"aria-label":a(`activity:memoryManager.graphFullscreenAria`),children:[(0,G.jsx)(re,{className:`size-3`}),a(`activity:memoryManager.graphOpenFullscreen`)]})]}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:r?a(`activity:memoryManager.loadingGraph`):a(`activity:memoryManager.graphStats`,{nodes:d.length,edges:f.length})})]}),i&&(0,G.jsx)(`p`,{className:`border-b border-destructive/25 bg-destructive/5 px-3 py-2 text-[10px] text-destructive`,children:i}),d.length>1&&(0,G.jsx)(X,{nodes:d,edges:f,className:`h-[320px]`}),u.some(e=>e.evidence?.length)&&(0,G.jsx)(`div`,{className:`grid gap-1 border-t border-border/70 bg-card/35 px-3 py-2`,children:u.filter(e=>e.evidence?.length).slice(0,12).map(e=>{let t=(e.from===l?e.to:e.from).slice(4);return(0,G.jsxs)(`p`,{className:`truncate font-mono text-[9px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`text-info`,children:e.relation}),` `,Le(t),` · why:`,` `,e.evidence?.join(`, `)]},e.id)})}),o&&(0,G.jsx)(L,{open:o,onOpenChange:s,children:(0,G.jsxs)(fe,{className:`flex max-h-[90dvh] max-w-[90vw] flex-col p-0`,showCloseButton:!1,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 bg-card/55 px-4 py-3`,children:[(0,G.jsx)(`p`,{className:`text-[10px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:a(`activity:memoryManager.graphHeadingFull`,{id:e.id})}),(0,G.jsx)(R,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),className:`h-7 gap-1 px-2 text-[10px]`,children:a(`common:action.close`)})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 px-4 pb-4`,children:(0,G.jsx)(X,{nodes:d,edges:f,className:`h-[65vh]`})})]})})]})}function Ue({memory:e,allMemories:t,relatedMemories:n,graphEdges:r,graphLoading:i,graphError:a,onClose:o,onOpenMemory:s,onEdit:l,onDelete:u,onTagSelect:d,onNotice:f}){let{t:p}=c();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/70 bg-card/65 px-4 py-3 backdrop-blur-xl`,children:[(0,G.jsx)(R,{variant:`ghost`,size:`icon`,className:`md:hidden`,onClick:o,"aria-label":p(`activity:memoryManager.backToList`),children:(0,G.jsx)(oe,{className:`size-4`})}),(0,G.jsx)(`span`,{className:F(`text-[10px] font-bold uppercase tracking-[0.14em]`,Ce(e.kind)),children:ke[e.kind]??e.kind}),(0,G.jsx)(Te,{status:e.status}),(0,G.jsx)(`span`,{className:`border border-border/70 px-2 py-0.5 font-mono text-[9px] uppercase text-muted-foreground`,children:e.scope}),e.audience&&(0,G.jsxs)(`span`,{className:`flex items-center gap-1 border border-primary/30 bg-primary/10 px-2 py-0.5 font-mono text-[9px] text-primary`,title:Oe(e.audience),children:[(0,G.jsx)(A,{className:`size-3`}),Oe(e.audience)]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,G.jsx)(R,{variant:`ghost`,size:`icon`,"aria-label":p(`activity:memoryManager.copyId`),title:p(`activity:memoryManager.copyId`),onClick:()=>{navigator.clipboard?.writeText(e.id),f(p(`activity:memoryManager.copiedNotice`))},children:(0,G.jsx)(ee,{className:`size-4`})}),(0,G.jsxs)(R,{variant:`outline`,size:`sm`,onClick:()=>l(e.id),disabled:e.status===`deleted`,children:[(0,G.jsx)(x,{className:`size-3.5`}),` `,p(`common:action.edit`)]}),(0,G.jsxs)(R,{variant:`destructive`,size:`sm`,onClick:u,disabled:e.status===`deleted`,children:[(0,G.jsx)(C,{className:`size-3.5`}),` `,p(`common:action.delete`)]})]})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4 md:p-5`,children:(0,G.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[(0,G.jsx)(We,{memory:e}),(0,G.jsx)(Z,{memory:e}),e.tags.length>0&&(0,G.jsx)(Ge,{tags:e.tags,onTagSelect:d}),e.anchors.length>0&&(0,G.jsx)(Q,{anchors:e.anchors}),n.length>0&&(0,G.jsx)(Ke,{relatedMemories:n,allMemories:t,onOpenMemory:s}),(0,G.jsx)(He,{centerMemory:e,allMemories:t,graphEdges:r,loading:i,error:a}),(0,G.jsx)(qe,{memory:e}),e.status===`deleted`&&(0,G.jsx)($,{contextPolicy:e.contextPolicy})]})})]})}function We({memory:e}){let{t}=c();return(0,G.jsxs)(`div`,{className:`relative overflow-hidden border border-border/75 bg-card/55 p-5 shadow-[inset_0_1px_0_hsl(var(--foreground)/0.04)]`,children:[(0,G.jsx)(`div`,{className:`pointer-events-none absolute -right-10 -top-10 size-36 bg-[radial-gradient(circle,hsl(var(--info)/0.13),transparent_68%)]`}),(0,G.jsx)(`p`,{className:`relative whitespace-pre-wrap text-sm leading-7 text-foreground md:text-[15px]`,children:e.text}),e.summary&&(0,G.jsx)(`p`,{className:`relative mt-4 border-l-2 border-info/50 pl-3 text-xs italic leading-5 text-muted-foreground`,children:e.summary}),(0,G.jsxs)(`div`,{className:`relative mt-5 flex flex-wrap items-center gap-2 border-t border-border/60 pt-3`,children:[(0,G.jsx)(`code`,{className:`min-w-0 break-all font-mono text-[10px] text-muted-foreground`,children:e.id}),(0,G.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-muted-foreground`,children:t(`activity:memoryManager.revisionSuffix`,{n:e.revision})})]})]})}function Z({memory:e}){let{t}=c(),n=[[t(`activity:memoryManager.editorImportance`),e.importance,m],[t(`activity:memoryManager.editorConfidence`),e.confidence,p],[t(`activity:memoryManager.editorFreshness`),e.freshness,j]];return(0,G.jsx)(`div`,{className:`grid gap-px bg-border/60 sm:grid-cols-3`,children:n.map(([e,t,n])=>(0,G.jsxs)(`div`,{className:`bg-card/60 p-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(n,{className:`size-3.5 text-info`}),(0,G.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.13em] text-muted-foreground`,children:e}),(0,G.jsxs)(`span`,{className:`ml-auto font-mono text-xs font-bold tabular-nums`,children:[Math.round(t*100),`%`]})]}),(0,G.jsx)(`div`,{className:`mt-2 h-1 bg-muted`,children:(0,G.jsx)(`div`,{className:`h-full bg-info shadow-[0_0_8px_hsl(var(--info)/0.45)]`,style:{width:`${Math.round(t*100)}%`}})})]},e))})}function Ge({tags:e,onTagSelect:t}){let{t:n}=c();return(0,G.jsxs)(`section`,{children:[(0,G.jsxs)(`h3`,{className:`mb-2 flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:[(0,G.jsx)(y,{className:`size-3.5 text-info`}),` `,n(`activity:memoryManager.tagsLabel`)]}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(e),className:`border border-info/25 bg-info/5 px-2 py-1 font-mono text-[10px] text-info hover:border-info/55 hover:bg-info/10`,children:[`#`,e]},e))})]})}function Q({anchors:e}){let{t}=c();return(0,G.jsxs)(`section`,{className:`border border-border/75 bg-card/40`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/65 px-3 py-2.5`,children:[(0,G.jsxs)(`h3`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:[(0,G.jsx)(v,{className:`size-3.5 text-info`}),` `,t(`activity:memoryManager.editorAnchors`)]}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.length})]}),(0,G.jsx)(`ul`,{className:`divide-y divide-border/55`,children:e.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex min-w-0 items-start gap-3 px-3 py-2.5`,children:[(0,G.jsx)(`span`,{className:`mt-0.5 flex size-7 shrink-0 items-center justify-center border border-info/25 bg-info/5 text-info`,children:e.type===`command`?(0,G.jsx)(a,{className:`size-3.5`}):(0,G.jsx)(v,{className:`size-3.5`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`text-[9px] font-bold uppercase text-muted-foreground`,children:e.type}),(0,G.jsxs)(`p`,{className:`mt-0.5 break-all font-mono text-[10px] leading-4 text-foreground/85`,children:[e.path??e.command??e.role??`—`,e.symbol?`#${e.symbol}`:``]})]}),(e.lineStart||e.lineEnd)&&(0,G.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[9px] text-muted-foreground`,children:[`L`,e.lineStart??`?`,`–`,e.lineEnd??`?`]})]},`${e.type}:${e.path??e.command??e.symbol??e.role}:${t}`))})]})}function Ke({relatedMemories:e,allMemories:t,onOpenMemory:n}){let{t:r}=c();return(0,G.jsxs)(`section`,{className:`border border-border/75 bg-card/40`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/65 px-3 py-2.5`,children:[(0,G.jsxs)(`h3`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:[(0,G.jsx)(ae,{className:`size-3.5 text-info`}),` `,r(`activity:memoryManager.memoryRelationships`)]}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.length})]}),(0,G.jsx)(`ul`,{className:`divide-y divide-border/55`,children:e.map(e=>{let i=t.find(t=>t.id===e.id);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,disabled:!i,onClick:()=>i&&n(i.id),className:`group flex w-full min-w-0 items-center gap-3 px-3 py-2.5 text-left hover:bg-info/5 disabled:cursor-not-allowed disabled:opacity-55`,children:[(0,G.jsx)(`span`,{className:F(`w-24 shrink-0 text-[9px] font-bold uppercase`,e.relation===`Contradicts`?`text-destructive`:`text-info`),children:e.relation}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:i?V(i.text,95):r(`activity:memoryManager.referencedUnavailable`)}),(0,G.jsx)(`code`,{className:`hidden max-w-32 truncate font-mono text-[9px] text-muted-foreground sm:block`,children:e.id}),i&&(0,G.jsx)(_,{className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-info`})]})},`${e.relation}:${e.id}`)})})]})}function qe({memory:e}){let{t}=c(),n=[[t(`activity:memoryManager.metaCreated`),H(e.createdAt),O],[t(`activity:memoryManager.metaUpdated`),H(e.updatedAt),j],[t(`activity:memoryManager.metaLastAccessed`),H(e.lastAccessedAt),ie],[t(`activity:memoryManager.metaLastVerified`),H(e.lastVerifiedAt),m]];return(0,G.jsx)(`section`,{className:`grid gap-px bg-border/60 sm:grid-cols-2 lg:grid-cols-4`,children:n.map(([e,t,n])=>(0,G.jsxs)(`div`,{className:`bg-card/50 p-3`,children:[(0,G.jsx)(n,{className:`size-3.5 text-muted-foreground`}),(0,G.jsx)(`p`,{className:`mt-2 text-[9px] font-bold uppercase tracking-[0.12em] text-muted-foreground`,children:e}),(0,G.jsx)(`p`,{className:`mt-1 text-[10px] leading-4 text-foreground/85`,children:t})]},e))})}function $({contextPolicy:e}){let{t}=c();return(0,G.jsxs)(`div`,{className:`flex items-start gap-3 border border-border bg-muted/50 p-4 text-xs text-muted-foreground`,children:[(0,G.jsx)(h,{className:`mt-0.5 size-4 shrink-0`}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`font-bold text-foreground`,children:t(`activity:memoryManager.deletedMemory`)}),(0,G.jsx)(`p`,{className:`mt-1 leading-5`,children:t(e===`never`?`activity:memoryManager.deletedNeverPolicy`:`activity:memoryManager.deletedEligiblePolicy`)})]})]})}function Je({currentFilePath:e,knownFilePaths:t,drawerActive:n,onFilePathChange:r,onToggleDrawer:i}){let{t:a}=c();return(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border/60 bg-card/30 px-3 py-1.5`,children:[(0,G.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:a(`activity:memoryManager.fileDrawerLabel`)}),(0,G.jsx)(`input`,{type:`text`,list:`memory-drawer-file-list`,value:e??``,onChange:e=>{r(e.target.value.trim()||null)},placeholder:a(`activity:memoryManager.selectFilePlaceholder`),className:`min-w-0 max-w-[260px] flex-1 truncate rounded-sm border border-border/60 bg-background px-1.5 py-0.5 text-[10px] font-mono`,"aria-label":a(`activity:memoryManager.fileForDrawerAria`),"data-testid":`memory-drawer-file-select`}),(0,G.jsx)(`datalist`,{id:`memory-drawer-file-list`,children:[...t].sort().map(e=>(0,G.jsx)(`option`,{value:e},e))}),(0,G.jsxs)(R,{type:`button`,size:`sm`,variant:n?`default`:`outline`,onClick:i,disabled:!e,className:`h-7 shrink-0 gap-1 px-2 text-[11px]`,"aria-pressed":n,title:a(n?`activity:memoryManager.hideFileDrawer`:`activity:memoryManager.showFileDrawer`),children:[n?(0,G.jsx)(w,{className:`size-3`}):(0,G.jsx)(te,{className:`size-3`}),a(n?`activity:memoryManager.hideDrawer`:`activity:memoryManager.showDrawer`)]})]})}function Ye({mode:e,draft:t,busy:n,error:r,onChange:a,onCancel:o,onSubmit:u}){let{t:p}=c(),m=(0,K.useRef)(null),[h,ee]=(0,K.useState)([]);(0,K.useEffect)(()=>{m.current?.focus();let e=new AbortController;return B(`agent-roster.list`,{},e.signal).then(e=>{let t=e.roles;Array.isArray(t)&&ee(t.filter(e=>typeof e==`string`))}).catch(()=>void 0),()=>e.abort()},[]);let g=(e,n)=>{a({...t,[e]:n})},_=()=>{g(`anchors`,[...t.anchors,{type:`file`,path:``}])};return(0,G.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),u()},"aria-busy":n,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/70 bg-card/70 px-4 py-3 backdrop-blur-xl`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`flex size-8 items-center justify-center border border-info/35 bg-info/10 text-info`,children:e===`create`?(0,G.jsx)(s,{className:`size-4`}):(0,G.jsx)(x,{className:`size-4`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-bold`,children:p(e===`create`?`activity:memoryManager.captureMemory`:`activity:memoryManager.editMemory`)}),(0,G.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:p(e===`create`?`activity:memoryManager.editorCreateHint`:`activity:memoryManager.editorEditHint`)})]})]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,G.jsxs)(R,{type:`button`,variant:`ghost`,size:`sm`,onClick:o,disabled:n,children:[(0,G.jsx)(l,{className:`size-3.5`}),` `,p(`common:action.cancel`)]}),(0,G.jsxs)(R,{type:`submit`,size:`sm`,disabled:n||!t.text.trim(),children:[n?(0,G.jsx)(d,{className:`size-3.5 animate-spin`}):e===`create`?(0,G.jsx)(k,{className:`size-3.5`}):(0,G.jsx)(f,{className:`size-3.5`}),p(n?`common:action.saving`:e===`create`?`activity:memoryManager.createMemory`:`activity:memoryManager.saveChanges`)]})]})]}),(0,G.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto overscroll-contain p-4 md:p-5`,children:(0,G.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-5`,children:[r&&(0,G.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2 border border-destructive/40 bg-destructive/10 px-3 py-2.5 text-sm text-destructive`,children:[(0,G.jsx)(T,{className:`mt-0.5 size-4 shrink-0`}),(0,G.jsx)(`span`,{children:r})]}),(0,G.jsxs)(`section`,{className:`border border-border/75 bg-card/45 p-4`,children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-[0.14em]`,children:p(`activity:memoryManager.editorKnowledge`)}),(0,G.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:p(`activity:memEditor.writeTheDurableFactOrDecision`)})]}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground tabular-nums`,children:p(`activity:memoryManager.editorCharCount`,{count:t.text.length})})]}),(0,G.jsx)(`label`,{htmlFor:`memory-text`,className:`sr-only`,children:p(`activity:memoryManager.editorContentLabel`)}),(0,G.jsx)(`textarea`,{ref:m,id:`memory-text`,value:t.text,onChange:e=>g(`text`,e.target.value),rows:7,required:!0,placeholder:p(`activity:memoryManager.editorContentPlaceholder`),className:`min-h-36 w-full resize-y border border-input bg-background/75 px-3 py-3 text-sm leading-6 text-foreground shadow-inner placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`})]}),(0,G.jsxs)(`section`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`label`,{htmlFor:`memory-kind`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memoryManager.editorKind`)}),(0,G.jsx)(`select`,{id:`memory-kind`,value:t.kind,onChange:e=>g(`kind`,e.target.value),className:`h-10 w-full border border-input bg-background px-3 text-sm`,children:we.map(e=>(0,G.jsx)(`option`,{value:e,children:ke[e]},e))})]}),e===`create`?(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`label`,{htmlFor:`memory-scope`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memoryManager.editorScope`)}),(0,G.jsx)(`select`,{id:`memory-scope`,value:t.scope,onChange:e=>g(`scope`,e.target.value),className:`h-10 w-full border border-input bg-background px-3 text-sm`,children:ve.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))})]}):(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`label`,{htmlFor:`memory-status`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memoryManager.editorLifecycleStatus`)}),(0,G.jsx)(`select`,{id:`memory-status`,value:t.status,onChange:e=>g(`status`,e.target.value),className:`h-10 w-full border border-input bg-background px-3 text-sm`,children:Ee.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))})]}),(0,G.jsxs)(`div`,{className:F(`min-w-0`,e===`create`?`sm:col-span-2 lg:col-span-1`:``),children:[(0,G.jsx)(`label`,{htmlFor:`memory-tags`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memoryManager.tagsLabel`)}),(0,G.jsx)(z,{id:`memory-tags`,value:t.tags,onChange:e=>g(`tags`,e.target.value),placeholder:p(`activity:memEditor.architectureWebuiWorkflow`),className:`h-10 bg-background`})]})]}),(0,G.jsxs)(`section`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,G.jsx)(be,{id:`memory-importance`,label:p(`activity:memoryManager.editorImportance`),value:t.importance,onChange:e=>g(`importance`,e)}),(0,G.jsx)(be,{id:`memory-confidence`,label:p(`activity:memoryManager.editorConfidence`),value:t.confidence,onChange:e=>g(`confidence`,e)}),(0,G.jsx)(be,{id:`memory-freshness`,label:p(`activity:memoryManager.editorFreshness`),value:t.freshness,onChange:e=>g(`freshness`,e)})]}),(0,G.jsxs)(`section`,{className:`border border-border/75 bg-card/45 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-[0.14em]`,children:p(`activity:memoryManager.editorAnchors`)}),(0,G.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:p(`activity:memEditor.bindKnowledgeToFilesSymbolsPackages`)})]}),(0,G.jsxs)(R,{type:`button`,variant:`outline`,size:`sm`,onClick:_,children:[(0,G.jsx)(k,{className:`size-3.5`}),` `,p(`activity:memoryManager.addAnchor`)]})]}),t.anchors.length===0?(0,G.jsxs)(`button`,{type:`button`,onClick:_,className:`mt-4 flex w-full items-center justify-center gap-2 border border-dashed border-border px-4 py-7 text-xs text-muted-foreground transition-colors hover:border-info/50 hover:bg-info/5 hover:text-info`,children:[(0,G.jsx)(i,{className:`size-4`}),` `,p(`activity:memoryManager.noAnchors`)]}):(0,G.jsx)(`div`,{className:`mt-4 space-y-2`,children:t.anchors.map((e,n)=>(0,G.jsxs)(`div`,{className:`grid gap-2 border border-border/65 bg-background/40 p-2 sm:grid-cols-[9rem_minmax(0,1fr)_auto]`,children:[(0,G.jsxs)(`label`,{className:`sr-only`,htmlFor:`anchor-type-${n}`,children:[`Anchor `,n+1,` type`]}),(0,G.jsx)(`select`,{id:`anchor-type-${n}`,value:e.type,onChange:e=>{let r=e.target.value,i=r===`command`?{type:r,command:``}:r===`agent`?{type:r,role:``}:{type:r,path:``},a=t.anchors.map((e,t)=>t===n?i:e);g(`anchors`,a)},className:`h-10 border border-input bg-background px-2 text-xs`,children:Ae.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}),(0,G.jsxs)(`div`,{className:F(`grid min-w-0 gap-2`,e.type===`symbol`&&`sm:grid-cols-[minmax(0,1fr)_11rem]`),children:[(0,G.jsxs)(`label`,{className:`sr-only`,htmlFor:`anchor-value-${n}`,children:[`Anchor `,n+1,` value`]}),(0,G.jsx)(z,{id:`anchor-value-${n}`,list:e.type===`agent`?`memory-agent-role-options`:void 0,value:je(e),onChange:e=>{let r=t.anchors.map((t,r)=>r===n?ye(t,e.target.value):t);g(`anchors`,r)},placeholder:e.type===`command`?`pnpm test --filter webui`:e.type===`agent`?`reviewer`:`packages/webui/src/App.tsx`,className:`h-10 min-w-0 bg-background font-mono text-xs`}),e.type===`symbol`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`label`,{className:`sr-only`,htmlFor:`anchor-symbol-${n}`,children:[`Anchor `,n+1,` symbol`]}),(0,G.jsx)(z,{id:`anchor-symbol-${n}`,value:e.symbol??``,onChange:e=>{let r=t.anchors.map((t,r)=>r===n?{...t,symbol:e.target.value}:t);g(`anchors`,r)},placeholder:p(`activity:memoryManager.editorSymbolPlaceholder`),className:`h-10 bg-background font-mono text-xs`})]})]}),(0,G.jsx)(R,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Remove anchor ${n+1}`,onClick:()=>g(`anchors`,t.anchors.filter((e,t)=>t!==n)),children:(0,G.jsx)(C,{className:`size-4 text-destructive`})})]},`${e.type}:${n}`))}),(0,G.jsx)(`datalist`,{id:`memory-agent-role-options`,children:h.map(e=>(0,G.jsx)(`option`,{value:e},e))})]}),(0,G.jsxs)(`section`,{className:`grid gap-3 border border-border/75 bg-card/45 p-4 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,G.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-[0.14em]`,children:p(`activity:memoryManager.editorRelationships`)}),(0,G.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:p(`activity:memoryManager.editorRelationshipsHint`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-supersedes`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memoryManager.editorSupersedes`)}),(0,G.jsx)(z,{id:`memory-supersedes`,value:t.supersedes,onChange:e=>g(`supersedes`,e.target.value),placeholder:p(`activity:memEditor.memIdMemId`),className:`h-10 bg-background font-mono text-xs`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-contradicts`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memoryManager.editorContradicts`)}),(0,G.jsx)(z,{id:`memory-contradicts`,value:t.contradicts,onChange:e=>g(`contradicts`,e.target.value),placeholder:p(`activity:memEditor.memIdMemId`),className:`h-10 bg-background font-mono text-xs`})]})]}),(0,G.jsxs)(`section`,{className:`space-y-2`,children:[(0,G.jsx)(`h3`,{className:`text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memEditor.audienceOptional`)}),(0,G.jsx)(`p`,{className:`text-[10px] text-muted-foreground/70`,children:p(`activity:memEditor.targetThisMemoryToSpecificAgent`)}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-audience-roles`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memEditor.roles`)}),(0,G.jsx)(z,{id:`memory-audience-roles`,value:t.audienceRoles,onChange:e=>g(`audienceRoles`,e.target.value),placeholder:p(`activity:memEditor.reviewerRefactorPlanner`),className:`h-9 bg-background font-mono text-xs`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-audience-task-types`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memoryManager.editorTaskTypes`)}),(0,G.jsx)(z,{id:`memory-audience-task-types`,value:t.audienceTaskTypes,onChange:e=>g(`audienceTaskTypes`,e.target.value),placeholder:p(`activity:memEditor.reviewRefactorBugfix`),className:`h-9 bg-background font-mono text-xs`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`memory-audience-modes`,className:`mb-1.5 block text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:p(`activity:memEditor.modes`)}),(0,G.jsx)(z,{id:`memory-audience-modes`,value:t.audienceModes,onChange:e=>g(`audienceModes`,e.target.value),placeholder:p(`activity:memEditor.teachCodeReview`),className:`h-9 bg-background font-mono text-xs`})]})]})]})})]})}function Xe({searchQuery:e,statusFilter:t,kindFilter:n,audienceOnly:r,tagFilter:i,hasFilters:a,allTags:s,stats:d,onSearchChange:f,onStatusFilterChange:p,onKindFilterChange:m,onToggleAudienceOnly:h,onTagFilterChange:ee,onClearFilters:_}){let{t:v}=c(),[b,x]=(0,K.useState)(!!i),S=b||!!i,C=s.length>0;return(0,G.jsxs)(`div`,{className:`shrink-0 space-y-2 overflow-hidden border-b border-border/70 bg-card/45 p-3`,children:[(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,G.jsx)(g,{className:`pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,G.jsx)(z,{"aria-label":v(`activity:memoryManager.searchAria`),value:e,onChange:e=>f(e.target.value),placeholder:v(`activity:memoryManager.searchPlaceholder`),className:`h-10 min-w-0 bg-background pl-9 pr-8 text-xs`}),e&&(0,G.jsx)(`button`,{type:`button`,"aria-label":v(`activity:memoryManager.clearSearchAria`),onClick:()=>f(``),className:`absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(l,{className:`size-3.5`})})]}),(0,G.jsx)(R,{variant:r?`default`:`ghost`,size:`icon`,onClick:h,"aria-label":v(`activity:memoryManager.audienceFilterAria`),title:v(`activity:memoryManager.audienceFilterTitle`),className:`shrink-0`,children:(0,G.jsx)(A,{className:`size-4`})}),a&&(0,G.jsx)(R,{variant:`ghost`,size:`icon`,onClick:_,"aria-label":v(`activity:memoryManager.clearFiltersAria`),title:v(`activity:memoryManager.clearFiltersTitle`),children:(0,G.jsx)(o,{className:`size-4`})})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,G.jsx)(`label`,{className:`sr-only`,htmlFor:`memory-status-filter`,children:v(`activity:memoryManager.filterByStatus`)}),(0,G.jsxs)(`select`,{id:`memory-status-filter`,value:t,onChange:e=>p(e.target.value),className:`h-9 min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,G.jsx)(`option`,{value:`all`,children:v(`activity:memoryManager.allStatuses`)}),De.map(e=>(0,G.jsxs)(`option`,{value:e,children:[e,` · `,d?.byStatus[e]??0]},e))]}),(0,G.jsx)(`label`,{className:`sr-only`,htmlFor:`memory-kind-filter`,children:v(`activity:memoryManager.filterByKind`)}),(0,G.jsxs)(`select`,{id:`memory-kind-filter`,value:n,onChange:e=>m(e.target.value),className:`h-9 min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,G.jsx)(`option`,{value:`all`,children:v(`activity:memoryManager.allKinds`)}),we.map(e=>(0,G.jsxs)(`option`,{value:e,children:[ke[e],` · `,d?.byKind[e]??0]},e))]})]}),C&&(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{i||x(e=>!e)},"aria-expanded":S,"aria-controls":`memory-tags-panel`,disabled:!!i,className:F(`flex items-center gap-1.5 px-1 py-0.5 text-[10px] uppercase tracking-wide transition-colors`,S?`text-foreground`:`text-muted-foreground hover:text-foreground`,!!i&&`cursor-default`),title:i?`Active filter: ${i} (click the chip to clear)`:S?`Hide tag filters`:`Show tag filters (${s.length})`,children:[(0,G.jsx)(u,{className:F(`size-3 transition-transform`,!S&&`-rotate-90`)}),(0,G.jsx)(y,{className:`size-3`}),(0,G.jsx)(`span`,{className:`font-semibold`,children:v(`activity:memoryManager.tagsLabel`)}),(0,G.jsx)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:s.length})]}),i&&(0,G.jsx)(`span`,{role:`status`,"aria-label":`Active tag filter: ${i}`,className:`border border-info/55 bg-info/10 px-1 font-mono text-[9px] uppercase text-info`,children:i})]}),C&&S&&(0,G.jsxs)(`fieldset`,{id:`memory-tags-panel`,className:`min-w-0 border-0 p-0`,children:[(0,G.jsx)(`legend`,{className:`sr-only`,children:v(`activity:memoryManager.popularTags`)}),(0,G.jsx)(`div`,{className:`no-scrollbar flex gap-1.5 overflow-x-auto pb-0.5`,children:s.slice(0,18).map(([e,t])=>(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":i===e,onClick:()=>ee(i===e?null:e),className:F(`flex shrink-0 items-center gap-1 border px-2 py-1 text-[10px] transition-colors`,i===e?`border-info/55 bg-info/10 text-info`:`border-border/70 bg-background/45 text-muted-foreground hover:border-info/35 hover:text-foreground`),children:[(0,G.jsx)(y,{className:`size-2.5`}),` `,e,(0,G.jsx)(`span`,{className:`font-mono opacity-60`,children:t})]},e))})]})]})}var Ze=100;function Qe({memoryListRef:e,memories:t,filteredMemories:n,selectedId:r,onSelectMemory:i,onOpenCreate:a,onClearFilters:o}){let{t:s}=c(),l=n.length>Ze,u=D({count:n.length,getScrollElement:()=>e.current,estimateSize:()=>100,overscan:8,enabled:l});return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-border/60 px-3 py-2 text-[10px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:s(`activity:memoryManager.memoryCountSummary`,{shown:n.length,total:t.length})}),(0,G.jsx)(`span`,{className:`font-mono uppercase`,children:s(`activity:memoryManager.updatedSortLabel`)})]}),(0,G.jsx)(`section`,{ref:e,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,"aria-label":s(`activity:memoryManager.listAria`),children:n.length===0?(0,G.jsx)($e,{hasMemories:t.length>0,onOpenCreate:a,onClearFilters:o}):l?(0,G.jsx)(`div`,{style:{height:`${u.getTotalSize()}px`,width:`100%`,position:`relative`},children:u.getVirtualItems().map(e=>{let t=n[e.index];return t?(0,G.jsx)(`div`,{"data-index":e.index,ref:u.measureElement,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:(0,G.jsx)(et,{memory:t,isSelected:r===t.id,onClick:()=>i(t.id)})},t.id):null})}):n.map(e=>(0,G.jsx)(et,{memory:e,isSelected:r===e.id,onClick:()=>i(e.id)},e.id))})]})}function $e({hasMemories:e,onOpenCreate:t,onClearFilters:n}){let{t:r}=c();return(0,G.jsxs)(`div`,{className:`flex min-h-64 flex-col items-center justify-center px-6 text-center`,children:[(0,G.jsx)(`span`,{className:`flex size-12 items-center justify-center border border-dashed border-border text-muted-foreground`,children:(0,G.jsx)(b,{className:`size-5`})}),(0,G.jsx)(`h2`,{className:`mt-4 text-sm font-bold`,children:r(e?`activity:memoryManager.noMatching`:`activity:memoryManager.buildGraph`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-xs text-xs leading-5 text-muted-foreground`,children:r(e?`activity:memoryManager.emptyFiltered`:`activity:memoryManager.emptyCapture`)}),(0,G.jsxs)(R,{className:`mt-4`,variant:`outline`,size:`sm`,onClick:e?n:t,children:[e?(0,G.jsx)(o,{className:`size-3.5`}):(0,G.jsx)(k,{className:`size-3.5`}),r(e?`activity:memoryManager.clearFilters`:`activity:memoryManager.createFirst`)]})]})}function et({memory:e,isSelected:t,onClick:n}){return(0,G.jsxs)(`button`,{type:`button`,"aria-current":t?`true`:void 0,onClick:n,className:F(`group relative block w-full border-b border-border/55 px-3 py-3 text-left transition-[background-color,border-color] hover:bg-info/5`,t&&`bg-info/8`),children:[t&&(0,G.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-0.5 bg-info shadow-[0_0_10px_hsl(var(--info)/0.7)]`}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:F(`truncate text-[10px] font-bold uppercase tracking-[0.1em]`,Ce(e.kind)),children:ke[e.kind]??e.kind}),(0,G.jsx)(Te,{status:e.status}),(0,G.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[9px] text-muted-foreground`,children:[`r`,e.revision]})]}),(0,G.jsx)(`p`,{className:F(`mt-2 line-clamp-2 text-xs leading-5 text-foreground/90`,e.status===`deleted`&&`line-through opacity-60`),children:V(e.text)}),(0,G.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`border border-border/60 bg-background/50 px-1.5 py-0.5 font-mono text-[9px] uppercase text-muted-foreground`,children:e.scope}),e.audience&&(0,G.jsxs)(`span`,{className:`flex items-center gap-0.5 border border-primary/30 bg-primary/10 px-1.5 py-0.5 font-mono text-[9px] text-primary`,children:[(0,G.jsx)(A,{className:`size-2.5`}),(e.audience.roles??e.audience.taskTypes??e.audience.modes??[]).slice(0,1)[0]??`scoped`]}),e.tags.slice(0,2).map(e=>(0,G.jsxs)(`span`,{className:`max-w-24 truncate border border-border/60 px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:[`#`,e]},e)),e.tags.length>2&&(0,G.jsxs)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:[`+`,e.tags.length-2]}),(0,G.jsx)(`span`,{className:`ml-auto shrink-0 text-[9px] text-muted-foreground`,children:Me(e.updatedAt)}),(0,G.jsx)(_,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-info`})]})]})}function tt({onCapture:e}){let{t}=c();return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center p-8 text-center`,children:[(0,G.jsxs)(`div`,{className:`relative flex size-20 items-center justify-center border border-info/25 bg-info/5 text-info`,children:[(0,G.jsx)(A,{className:`size-8`}),(0,G.jsx)(`span`,{className:`absolute inset-2 border border-info/10`})]}),(0,G.jsx)(`h2`,{className:`mt-5 text-lg font-bold`,children:t(`activity:memoryManager.emptyTitle`)}),(0,G.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-muted-foreground`,children:t(`activity:memoryManager.emptyBody`)}),(0,G.jsxs)(`div`,{className:`mt-6 grid w-full max-w-lg gap-2 sm:grid-cols-3`,children:[(0,G.jsxs)(`div`,{className:`border border-border/70 bg-card/45 p-3`,children:[(0,G.jsx)(ne,{className:`mx-auto size-4 text-success`}),(0,G.jsx)(`p`,{className:`mt-2 text-[10px] font-bold uppercase`,children:t(`activity:memoryManager.emptyVerifiedAnchors`)})]}),(0,G.jsxs)(`div`,{className:`border border-border/70 bg-card/45 p-3`,children:[(0,G.jsx)(A,{className:`mx-auto size-4 text-info`}),(0,G.jsx)(`p`,{className:`mt-2 text-[10px] font-bold uppercase`,children:t(`activity:memoryManager.emptyTypedRelations`)})]}),(0,G.jsxs)(`div`,{className:`border border-border/70 bg-card/45 p-3`,children:[(0,G.jsx)(k,{className:`mx-auto size-4 text-warning`}),(0,G.jsx)(`p`,{className:`mt-2 text-[10px] font-bold uppercase`,children:t(`activity:memoryManager.emptyAgentRecall`)})]})]}),(0,G.jsxs)(R,{onClick:e,children:[(0,G.jsx)(k,{className:`size-4`}),` `,t(`activity:memoryManager.captureButton`)]})]})}function nt({wsConnected:e,refreshing:t,onRefresh:n,onCreate:r}){let{t:i}=c(),a=ue(e=>e.setCurrentView);return(0,G.jsxs)(`header`,{className:`relative shrink-0 overflow-hidden border-b border-border/70 bg-card/72 px-4 py-3 backdrop-blur-xl sm:px-5`,children:[(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 right-0 w-1/2 bg-[radial-gradient(circle_at_right,hsl(var(--info)/0.11),transparent_68%)]`}),(0,G.jsxs)(`div`,{className:`relative flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(R,{variant:`ghost`,size:`icon`,onClick:()=>a(`chat`),"aria-label":i(`activity:memoryManager.backToChat`),title:i(`activity:memoryManager.backToChat`),children:(0,G.jsx)(oe,{className:`size-4`})}),(0,G.jsx)(`span`,{className:`flex size-10 items-center justify-center border border-info/40 bg-info/10 text-info shadow-[0_0_20px_hsl(var(--info)/0.12)]`,children:(0,G.jsx)(A,{className:`size-5`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`h1`,{className:`text-base font-bold sm:text-lg`,children:i(`activity:memoryManager.sageHeading`)}),(0,G.jsx)(`span`,{className:`border border-success/35 bg-success/10 px-2 py-0.5 font-mono text-[9px] font-bold uppercase text-success`,children:i(`activity:memoryManager.projectKnowledge`)})]}),(0,G.jsx)(`p`,{className:`mt-0.5 max-w-2xl text-[10px] text-muted-foreground sm:text-xs`,children:i(`activity:memoryManager.sageSubtitle`)})]}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,G.jsxs)(`span`,{className:F(`hidden items-center gap-1.5 border px-2 py-1 font-mono text-[9px] uppercase sm:flex`,e?`border-success/30 text-success`:`border-warning/30 text-warning`),children:[(0,G.jsx)(`span`,{className:`size-1.5 bg-current`}),` `,i(e?`activity:memoryManager.liveStore`:`activity:memoryManager.reconnecting`)]}),(0,G.jsxs)(R,{variant:`outline`,size:`sm`,onClick:n,disabled:t,"aria-label":i(`activity:memoryManager.refreshAria`),children:[(0,G.jsx)(j,{className:F(`size-3.5`,t&&`animate-spin`)}),(0,G.jsx)(`span`,{className:`hidden sm:inline`,children:i(`common:action.refresh`)})]}),(0,G.jsxs)(R,{size:`sm`,onClick:r,children:[(0,G.jsx)(k,{className:`size-3.5`}),` `,i(`activity:memoryManager.newMemory`)]})]})]})]})}function rt({stats:e,memories:t,filteredCount:n,allTagsCount:r}){let{t:i}=c(),a=t.filter(e=>e.audience).length,o=new Set;if(a>0){for(let e of t)if(e.audience){for(let t of e.audience.roles??[])o.add(t);for(let t of e.audience.taskTypes??[])o.add(t);for(let t of e.audience.modes??[])o.add(t)}}return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-px border-b border-border/70 bg-border/60 sm:grid-cols-4`,children:[(0,G.jsx)(U,{label:i(`activity:memoryManager.tabMemories`),value:e?.total??t.length,hint:`${n} visible`}),(0,G.jsx)(U,{label:i(`activity:memoryManager.tabActive`),value:e?.byStatus.active??t.filter(e=>e.status===`active`).length,hint:`retrievable`,tone:`success`}),(0,G.jsx)(U,{label:i(`activity:memoryManager.tabNeedsReview`),value:(e?.byStatus.stale??0)+(e?.byStatus.contradicted??0),hint:i(`activity:memoryManager.staleConflicts`),tone:`warning`}),(0,G.jsx)(`div`,{className:`hidden sm:block`,children:(0,G.jsx)(U,{label:i(`activity:memoryManager.tabGraphEdges`),value:e?.edges??0,hint:`${r} tags`,tone:`info`})})]}),a>0&&(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border/70 bg-primary/5 px-4 py-1.5`,children:[(0,G.jsx)(A,{className:`size-3.5 text-primary`}),(0,G.jsxs)(`span`,{className:`text-[11px] font-medium text-primary`,children:[a,` audience-scoped memory`,a===1?``:`ies`]}),o.size>0&&(0,G.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`(`,[...o].sort().join(`, `),`)`]})]})]})}function it({query:e,channel:t,hits:n,loading:r,error:i,onOpenMemory:a,onClear:o}){let{t:l}=c();return e?(0,G.jsxs)(`section`,{"aria-label":l(`activity:memoryManager.searchBreakdownAria`),className:`border-b border-border/60 bg-card/35`,children:[(0,G.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b border-border/55 px-3 py-2 text-[10px] text-muted-foreground`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(s,{className:`size-3 text-info`}),(0,G.jsx)(`span`,{className:`font-mono uppercase tracking-[0.1em]`,children:l(`activity:memoryManager.searchBreakdownTitle`,{query:e})}),t===`breakdown`&&(0,G.jsx)(`span`,{className:`border border-info/40 bg-info/8 px-1.5 py-0.5 font-mono text-[9px] uppercase text-info`,children:l(`activity:memoryManager.searchBreakdownDual`)}),t===`lexical`&&(0,G.jsx)(`span`,{className:`border border-border/60 px-1.5 py-0.5 font-mono text-[9px] uppercase text-muted-foreground`,children:l(`activity:memoryManager.searchBreakdownLexicalOnly`)})]}),(0,G.jsx)(`button`,{type:`button`,onClick:o,className:`font-mono text-[10px] uppercase text-muted-foreground hover:text-foreground`,children:l(`common:action.close`)})]}),r&&(0,G.jsx)(`p`,{className:`px-3 py-3 text-[10px] text-muted-foreground`,children:l(`activity:memoryManager.searchBreakdownLoading`)}),i&&(0,G.jsx)(`p`,{className:`border-t border-border/55 px-3 py-2 text-[10px] text-destructive`,role:`alert`,children:i}),!r&&!i&&n.length===0&&(0,G.jsx)(`p`,{className:`px-3 py-3 text-[10px] text-muted-foreground`,children:l(`activity:memoryManager.searchBreakdownEmpty`)}),(0,G.jsx)(`ul`,{className:`divide-y divide-border/55`,children:n.map(e=>(0,G.jsx)(at,{hit:e,onOpenMemory:a},e.memory.id))})]}):null}function at({hit:e,onOpenMemory:t}){let{t:n}=c(),r=ot(e.lexicalScore),i=ot(e.vectorScore),a=ot(e.finalScore),{accent:o,label:l}=st(e.source);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(e.memory.id),className:`group flex w-full min-w-0 items-start gap-3 px-3 py-2.5 text-left hover:bg-info/5`,children:[(0,G.jsx)(`span`,{className:F(`flex size-7 shrink-0 items-center justify-center border font-mono text-[9px] uppercase`,o),title:n(`activity:memoryManager.searchBreakdownSourceLabel`,{source:l}),children:e.source===`vector`?(0,G.jsx)(s,{className:`size-3.5`}):e.source===`both`?(0,G.jsx)(S,{className:`size-3.5`}):(0,G.jsx)(E,{className:`size-3.5`})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`p`,{className:`line-clamp-2 text-[11px] leading-5 text-foreground/90`,children:e.memory.text}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[9px] text-muted-foreground`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`uppercase text-[9px] text-muted-foreground/80`,children:`L`}),(0,G.jsx)(`span`,{className:`tabular-nums text-foreground/80`,children:r})]}),(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`uppercase text-[9px] text-muted-foreground/80`,children:`V`}),(0,G.jsx)(`span`,{className:F(`tabular-nums`,e.vectorScore===null?`text-muted-foreground/50`:`text-foreground/80`),children:i})]}),(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`uppercase text-[9px] text-muted-foreground/80`,children:`RRF`}),(0,G.jsx)(`span`,{className:`tabular-nums font-bold text-foreground`,children:a})]}),(0,G.jsx)(`span`,{className:`ml-auto uppercase text-[9px]`,children:l})]})]})]})})}function ot(e){return e===null?`—`:`${Math.round(e*100)}%`}function st(e){switch(e){case`vector`:return{accent:`border-accent/40 bg-accent/10 text-accent`,label:`vector`};case`both`:return{accent:`border-info/40 bg-info/10 text-info`,label:`both`};default:return{accent:`border-border/60 bg-background text-muted-foreground`,label:`lexical`}}}function ct({listCandidates:e,resolveCandidate:t,onOpenMemory:n,client:r,active:i}){let{t:a}=c(),[o,s]=(0,K.useState)([]),[u,f]=(0,K.useState)(!1),[p,m]=(0,K.useState)(null),[h,ee]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(()=>new Set),b=(0,K.useRef)(0),x=(0,K.useCallback)(()=>{let t=++b.current;f(!0),m(null);let n=r.on(`memory.sage.listCandidates`,e=>{if(t===b.current){if(n(),e.payload.error)m(String(e.payload.error)),s([]);else{let t=(Array.isArray(e.payload.candidates)?e.payload.candidates:[]).filter(e=>e.status===`pending`);s(t),y(e=>{let n=new Set;for(let r of e)t.some(e=>e.id===r)&&n.add(r);return n})}f(!1)}}),i=setTimeout(()=>{t===b.current&&(n(),f(!1),m(a(`activity:memoryManager.reviewLoadTimeout`)))},15e3);return e({includeResolved:!1},{echoToChat:!1}),()=>{clearTimeout(i),n()}},[r,e,a]);(0,K.useEffect)(()=>{if(i)return x()},[i,x]);let S=(0,K.useCallback)((e,n)=>new Promise(i=>{let a=r.on(`memory.sage.candidateResolve`,e=>{a();let t=e.payload.error;i(!t)});t({candidateId:e,action:n,reason:n===`reject`?`Rejected via Memory Review tab`:void 0},{echoToChat:!1}),setTimeout(()=>{a(),i(!1)},15e3)}),[r,t]),C=(0,K.useCallback)(async(e,t)=>{ee(e),await S(e,t),ee(null),x()},[x,S]),w=(0,K.useCallback)(async e=>{let t=[...v];if(t.length!==0){_(!0);for(let n of t)await S(n,e);_(!1),y(new Set),x()}},[x,S,v]),te=e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},E=()=>{y(new Set(o.map(e=>e.id)))},D=()=>y(new Set);if(u&&o.length===0)return(0,G.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 p-6 text-sm text-muted-foreground`,children:[(0,G.jsx)(d,{className:`size-4 animate-spin`}),a(`activity:memoryManager.reviewLoading`)]});if(p&&o.length===0)return(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,G.jsx)(T,{className:`size-5 text-warning`}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p}),(0,G.jsxs)(R,{size:`sm`,variant:`outline`,onClick:()=>x(),children:[(0,G.jsx)(j,{className:`size-3.5`}),` `,a(`common:action.retry`)]})]});if(o.length===0)return(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center`,children:[(0,G.jsx)(ne,{className:`size-6 text-success`}),(0,G.jsx)(`p`,{className:`text-sm font-medium`,children:a(`activity:memoryManager.reviewEmptyTitle`)}),(0,G.jsx)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:a(`activity:memoryManager.reviewEmptyHint`)}),(0,G.jsxs)(R,{size:`sm`,variant:`ghost`,onClick:()=>x(),children:[(0,G.jsx)(j,{className:`size-3.5`}),` `,a(`common:action.refresh`)]})]});let O=v.size,k=O===o.length&&o.length>0;return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-border/60 px-3 py-2`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:a(`activity:memoryManager.reviewPendingCount`,{count:o.length})}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,G.jsx)(R,{size:`sm`,variant:`ghost`,className:`h-7 text-[11px]`,onClick:k?D:E,children:a(k?`activity:memoryManager.reviewClearSelection`:`activity:memoryManager.reviewSelectAll`)}),(0,G.jsxs)(R,{size:`sm`,className:`h-7`,disabled:O===0||g,onClick:()=>void w(`accept`),children:[g?(0,G.jsx)(d,{className:`size-3 animate-spin`}):(0,G.jsx)(ne,{className:`size-3`}),a(`activity:memoryManager.reviewBulkAccept`),O>0?` (${O})`:``]}),(0,G.jsxs)(R,{size:`sm`,variant:`outline`,className:`h-7`,disabled:O===0||g,onClick:()=>void w(`reject`),children:[(0,G.jsx)(l,{className:`size-3`}),a(`activity:memoryManager.reviewBulkKeep`),O>0?` (${O})`:``]}),(0,G.jsx)(R,{size:`sm`,variant:`ghost`,className:`h-7`,onClick:()=>x(),disabled:u,children:(0,G.jsx)(j,{className:F(`size-3.5`,u&&`animate-spin`)})})]})]}),(0,G.jsx)(`ul`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-3`,children:o.map(e=>{let t=e.targetMemoryId??e.memoryId,r=e.reviewReason??e.reason??``,i=h===e.id||g,o=v.has(e.id);return(0,G.jsx)(`li`,{className:F(`rounded-md border bg-card/60 p-3 text-sm shadow-sm`,o?`border-primary/50 ring-1 ring-primary/20`:`border-border/70`),children:(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-3.5 accent-primary`,checked:o,disabled:g,onChange:()=>te(e.id),"aria-label":a(`activity:memoryManager.reviewSelectOne`)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-wide text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`font-mono text-warning`,children:e.suggestedAction??`review`}),(0,G.jsx)(`span`,{children:`·`}),(0,G.jsx)(`span`,{children:Me(e.createdAt)}),e.tags?.includes(`triage`)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:`·`}),(0,G.jsx)(`span`,{className:`text-info`,children:`triage`})]})]}),(0,G.jsx)(`p`,{className:`mt-1.5 text-[13px] leading-snug text-foreground`,children:V(e.text,220)}),r?(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:r}):null,t?(0,G.jsxs)(`button`,{type:`button`,className:`mt-1 font-mono text-[10px] text-primary hover:underline`,onClick:()=>n?.(t),children:[t.slice(0,16),`…`]}):null,(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[(0,G.jsxs)(R,{size:`sm`,className:`h-7`,disabled:i,onClick:()=>void C(e.id,`accept`),children:[h===e.id?(0,G.jsx)(d,{className:`size-3 animate-spin`}):(0,G.jsx)(ne,{className:`size-3`}),a(`activity:memoryManager.actionAcceptDeletion`)]}),(0,G.jsxs)(R,{size:`sm`,variant:`outline`,className:`h-7`,disabled:i,onClick:()=>void C(e.id,`reject`),children:[(0,G.jsx)(l,{className:`size-3`}),a(`activity:memoryManager.actionKeep`)]})]})]})]})},e.id)})})]})}function lt(e,t){let n=t.searchQuery.trim().toLowerCase();return e.filter(e=>{if(t.statusFilter!==`all`&&e.status!==t.statusFilter||t.kindFilter!==`all`&&e.kind!==t.kindFilter||t.tagFilter&&!e.tags.includes(t.tagFilter)||t.audienceOnly&&!e.audience)return!1;if(!n)return!0;let r=e.anchors.map(e=>[e.path,e.symbol,e.command,e.role].filter(Boolean).join(` `)).join(` `),i=e.audience?[e.audience.roles?.join(` `)??``,e.audience.taskTypes?.join(` `)??``,e.audience.modes?.join(` `)??``].join(` `):``;return[e.id,e.text,e.summary??``,e.kind,e.scope,e.tags.join(` `),r,i].join(` `).toLowerCase().includes(n)})}function ut(e){let t=new Map;for(let n of e)for(let e of n.tags)t.set(e,(t.get(e)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))}function dt(e){if(!e)return[];let t=[];e.supersededBy&&t.push({relation:`Superseded by`,id:e.supersededBy});for(let n of e.supersedes??[])t.push({relation:`Supersedes`,id:n});for(let n of e.contradicts??[])t.push({relation:`Contradicts`,id:n});return t}var ft=100;function pt(){let{t:e}=c(),{client:n,listSageMemoriesPage:r,listMemoryCandidates:i,rememberSage:a,updateSage:o,deleteSage:s,getSageGraph:l,recoverSage:u,resolveMemoryCandidate:d,searchSageBreakdown:f}=he(),p=t(e=>e.wsConnected),[m,h]=(0,K.useState)([]),[ee,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!0),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(null),[te,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(null),[ne,O]=(0,K.useState)([]),[k,A]=(0,K.useState)([]),[re,j]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(!1),[oe,M]=(0,K.useState)(!1),[N,se]=(0,K.useState)(!1),[P,ce]=(0,K.useState)(Se),[le,F]=(0,K.useState)(Se),[ue,I]=(0,K.useState)(null),[de,fe]=(0,K.useState)(null),[pe,me]=(0,K.useState)({hits:[],channel:void 0,loading:!1,error:null}),[L,R]=(0,K.useState)(``),[z,ge]=(0,K.useState)(`all`),[B,ve]=(0,K.useState)(`all`),[ye,be]=(0,K.useState)(!1),[V,Ce]=(0,K.useState)(null),[we,Te]=(0,K.useState)(`active`),H=we===`deleted`,Ee=we===`review`,[De,Oe]=(0,K.useState)(null),[ke,U]=(0,K.useState)(!1),[Ae,je]=(0,K.useState)(!1),[Me,Ne]=(0,K.useState)({}),[G,Pe]=(0,K.useState)(!1),[Fe,Ie]=(0,K.useState)(null),Le=(0,K.useRef)(!1),Re=(0,K.useRef)([]),ze=(0,K.useRef)(0),q=(0,K.useRef)(null),J=(0,K.useRef)(!0),Be=(0,K.useRef)(0),Y=(0,K.useRef)(0),Ve=(0,K.useRef)(null),X=(0,K.useRef)(null),He=(0,K.useMemo)(()=>{let e=new Set;for(let t of m)for(let n of t.anchors??[])n.type===`file`&&n.path&&e.add(n.path);return e},[m]),Ue=(0,K.useMemo)(()=>JSON.stringify(P)!==JSON.stringify(le),[le,P]),We=(0,K.useCallback)(e=>m.find(t=>t.id===e)??pe.hits.find(t=>t.memory.id===e)?.memory??k.find(t=>t.id===e)??null,[k,m,pe.hits]),Z=(0,K.useMemo)(()=>E===null?null:We(E),[We,E]),Ge=(0,K.useCallback)(e=>{let t=e!==null,i=++Be.current;Ve.current?.(),S(null),t?je(!0):(b(!0),Le.current||v(!0));let a=()=>{},o=null,s=!1,c=()=>{s||(s=!0,o!==null&&clearTimeout(o),a(),Ve.current===c&&(Ve.current=null))};a=n.on(`memory.sage.listPage`,e=>{if(i!==Be.current||!J.current){c();return}if(c(),e.payload.error)S(e.payload.error);else{let n=e.payload.memories??[];h(e=>t?[...e,...n]:n),Oe(e.payload.nextCursor??null),U(!!e.payload.nextCursor);let r=e.payload.statusCounts??{};Ne(r);let i=Object.values(r).reduce((e,t)=>e+t,0);e.payload.stats?g(e.payload.stats):g(e=>({total:i,byStatus:r,byKind:e?.byKind??{},edges:e?.edges??0})),Le.current=!0,t||D(e=>e&&(n.some(t=>t.id===e)||Re.current.some(t=>t.memory.id===e))?e:null)}v(!1),b(!1),je(!1)}),o=setTimeout(()=>{i===Be.current&&J.current&&(c(),S(`The memory store did not respond. Check the WebSocket connection and try again.`),v(!1),b(!1),je(!1))},2e4),Ve.current=c,r({limit:ft,...H?{statuses:[`deleted`]}:{},...e?{cursor:e}:{},...L.trim()?{query:L.trim()}:{},...B===`all`?{}:{kind:B}},{echoToChat:!1})},[n,B,r,L,H]),Q=(0,K.useCallback)(()=>{Oe(null),U(!1),Ge(null)},[Ge]),Ke=(0,K.useCallback)(()=>{!Ae&&De&&Ge(De)},[Ge,Ae,De]);(0,K.useEffect)(()=>(J.current=!0,Q(),()=>{J.current=!1,Be.current+=1,Y.current+=1,Ve.current?.(),X.current?.(),q.current?.()}),[Q]),(0,K.useEffect)(()=>{let e=L.trim();if(q.current?.(),e.length===0){me({hits:[],channel:void 0,loading:!1,error:null});return}let t=++ze.current;me(e=>({...e,loading:!0,error:null}));let r=()=>{},i=()=>{q.current===i&&(q.current=null),r()};q.current=i,r=n.on(`memory.sage.searchBreakdown`,e=>{if(t!==ze.current||!J.current){i();return}if(i(),e.payload.error){me({hits:[],channel:void 0,loading:!1,error:e.payload.error});return}me({hits:e.payload.hits??[],channel:e.payload.source,loading:!1,error:null})}),f({query:e,limit:20})},[L,n,f]),(0,K.useEffect)(()=>{Re.current=pe.hits},[pe.hits]),(0,K.useEffect)(()=>{if(O([]),A([]),j(null),!E){ae(!1);return}let e=E;ae(!0);let t=null,r=n.on(`memory.sage.graph`,n=>{n.payload.query===e&&(t!==null&&clearTimeout(t),O(n.payload.edges??[]),A(n.payload.memories??[]),j(n.payload.error??null),ae(!1))});return t=setTimeout(()=>{j(`Relationship graph did not respond in time.`),ae(!1)},15e3),l(e,{maxDepth:1,limit:120},{echoToChat:!1}),()=>{t!==null&&clearTimeout(t),r()}},[n,l,E]);let qe=(0,K.useRef)(p);(0,K.useEffect)(()=>{p&&!qe.current&&Le.current&&Q(),qe.current=p},[Q,p]),(0,K.useEffect)(()=>{if(!te)return;let e=setTimeout(()=>T(null),4e3);return()=>clearTimeout(e)},[te]);let $=(0,K.useCallback)(()=>!Ue||!oe&&!N||window.confirm(`Discard the unsaved memory changes?`),[N,Ue,oe]),Je=(0,K.useCallback)(()=>{if(!$())return;let e=Se();ce(e),F(e),se(!0),M(!1),D(null),w(null)},[$]),Ye=(0,K.useCallback)(e=>{$()&&(D(e),se(!1),M(!1),w(null))},[$]),Xe=(0,K.useCallback)(e=>{let t=e===void 0?Z:We(e);if(!t||t.status===`deleted`)return;e!==void 0&&D(e);let n=xe(t);ce(n),F(n),M(!0),se(!1),w(null)},[We,Z]),Ze=(0,K.useCallback)(()=>{$()&&(M(!1),se(!1),w(null))},[$]),Qe=(0,K.useCallback)((t,r,i)=>{if(!P.text.trim()){w(`Memory content is required.`);return}let a=++Y.current;X.current?.(),I(i),w(null),T(null);let o=()=>{},s=null,c=!1,l=()=>{c||(c=!0,s!==null&&clearTimeout(s),o(),X.current===l&&(X.current=null))},u=t=>{if(a!==Y.current||!J.current){l();return}if(l(),I(null),t.payload.error||!t.payload.memory){w(t.payload.error??`The server returned no memory record.`);return}let n=t.payload.memory;h(e=>{let t=e.filter(e=>e.id!==n.id);return[n,...t]}),D(n.id),se(!1),M(!1),T(e(i===`create`?`activity:memoryManager.memoryCaptured`:`activity:memoryManager.memoryUpdated`)),Q()};o=t===`memory.sage.remember`?n.on(`memory.sage.remember`,u):n.on(`memory.sage.update`,u),s=setTimeout(()=>{a===Y.current&&J.current&&(l(),I(null),w(e(`activity:memoryManager.mutationTimeout`,{verb:e(i===`create`?`activity:memoryManager.createAction`:`common:action.save`)})))},2e4),X.current=l,r()},[n,P.text,Q,e]),$e=(0,K.useCallback)(()=>{Qe(`memory.sage.remember`,()=>a({text:P.text.trim(),kind:P.kind,scope:P.scope,tags:W(P.tags),importance:P.importance,confidence:P.confidence,freshness:P.freshness,anchors:_e(P.anchors),...W(P.audienceRoles).length||W(P.audienceTaskTypes).length||W(P.audienceModes).length?{audience:{roles:W(P.audienceRoles),taskTypes:W(P.audienceTaskTypes),modes:W(P.audienceModes)}}:{},supersedes:W(P.supersedes),contradicts:W(P.contradicts)},{echoToChat:!1}),`create`)},[P,a,Qe]),et=(0,K.useCallback)(()=>{Z&&Qe(`memory.sage.update`,()=>o(Z.id,{text:P.text.trim(),kind:P.kind,status:P.status,tags:W(P.tags),importance:P.importance,confidence:P.confidence,freshness:P.freshness,anchors:_e(P.anchors),...W(P.audienceRoles).length||W(P.audienceTaskTypes).length||W(P.audienceModes).length?{audience:{roles:W(P.audienceRoles),taskTypes:W(P.audienceTaskTypes),modes:W(P.audienceModes)}}:{},supersedes:W(P.supersedes),contradicts:W(P.contradicts)},{echoToChat:!1}),`update`)},[P,Qe,Z,o]),tt=(0,K.useCallback)(()=>{if(!de)return;let e=++Y.current;X.current?.(),I(`delete`),w(null);let t=()=>{},r=null,i=!1,a=()=>{i||(i=!0,r!==null&&clearTimeout(r),t(),X.current===a&&(X.current=null))};t=n.on(`memory.sage.delete`,t=>{if(e!==Y.current||!J.current){a();return}if(a(),I(null),!t.payload.success){w(t.payload.message||`Delete failed.`);return}fe(null),D(null),M(!1),T(`Memory deleted and relationship edges cleaned up.`),Q()}),r=setTimeout(()=>{e===Y.current&&J.current&&(a(),I(null),w(`Delete timed out. The memory may still exist; refresh to confirm.`))},2e4),X.current=a,s(de,`Deleted from the WebUI Memory Manager.`)},[n,s,de,Q]),nt=(0,K.useCallback)((e,t,r)=>{let i=++Y.current;X.current?.(),w(null);let a=()=>{},o=null,s=!1,c=()=>{s||(s=!0,o!==null&&clearTimeout(o),a(),X.current===c&&(X.current=null))};a=n.on(e,e=>{if(i!==Y.current||!J.current){c();return}c(),r(e.payload)}),o=setTimeout(()=>{i===Y.current&&J.current&&(c(),w(`The memory store did not respond. Check the WebSocket connection and try again.`))},2e4),X.current=c,t()},[n]),rt=(0,K.useMemo)(()=>lt(m,{searchQuery:L,statusFilter:z,kindFilter:B,tagFilter:V,audienceOnly:ye}),[ye,B,m,L,z,V]),it=(0,K.useMemo)(()=>ut(m),[m]),at=(0,K.useMemo)(()=>dt(Z),[Z]),ot=(0,K.useCallback)(()=>{R(``),ge(`all`),ve(`all`),be(!1),Ce(null)},[]);return{client:n,wsConnected:p,memories:m,stats:ee,initialLoading:_,refreshing:y,loadError:x,mutationError:C,setMutationError:w,notice:te,setNotice:T,selectedId:E,setSelectedId:D,selectedMemory:Z,graphEdges:ne,graphMemories:k,graphError:re,graphLoading:ie,editing:oe,creating:N,draft:P,setDraft:ce,busyAction:ue,deletingId:de,setDeletingId:fe,searchQuery:L,setSearchQuery:R,searchBreakdown:pe,clearSearchBreakdown:()=>{ze.current+=1,q.current?.(),me({hits:[],channel:void 0,loading:!1,error:null})},statusFilter:z,setStatusFilter:ge,kindFilter:B,setKindFilter:ve,audienceOnly:ye,setAudienceOnly:be,tagFilter:V,setTagFilter:Ce,libraryView:we,setLibraryView:Te,showDeleted:H,showReview:Ee,hasMore:ke,loadingMore:Ae,statusCounts:Me,drawerOpen:G,setDrawerOpen:Pe,currentFilePath:Fe,setCurrentFilePath:Ie,knownFilePaths:He,filteredMemories:rt,allTags:it,relatedMemories:at,hasFilters:!!(L||z!==`all`||B!==`all`||V||ye),detailOpen:N||!!Z,drawerActive:G&&!!Fe,loadMemories:Q,loadMore:Ke,openCreate:Je,openMemory:Ye,openEdit:Xe,cancelEditor:Ze,submitCreate:$e,submitUpdate:et,confirmDelete:tt,sendWithAck:nt,clearFilters:ot,resolveMemoryCandidate:d,updateSage:o,recoverSage:u,listMemoryCandidates:i}}function mt(){let{t:e}=c(),t=ue(e=>e.setCurrentView),n=ge(`memory`),r=pt();return r.initialLoading&&r.memories.length===0?(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-busy":`true`,children:[(0,G.jsxs)(`div`,{className:`border-b border-border/70 bg-card/70 px-5 py-4`,children:[(0,G.jsx)(`div`,{className:`h-3 w-28 animate-pulse bg-muted`}),(0,G.jsx)(`div`,{className:`mt-3 h-7 w-56 animate-pulse bg-muted`})]}),(0,G.jsxs)(`div`,{className:`grid flex-1 gap-px bg-border/60 md:grid-cols-[minmax(300px,0.82fr)_minmax(0,1.35fr)]`,children:[(0,G.jsx)(`div`,{className:`space-y-px bg-background p-4`,children:Array.from({length:7},(e,t)=>(0,G.jsx)(`div`,{className:`h-24 animate-pulse border border-border/60 bg-card/45`},t))}),(0,G.jsx)(`div`,{className:`hidden bg-background p-6 md:block`,children:(0,G.jsx)(`div`,{className:`h-full animate-pulse border border-border/60 bg-card/35`})})]}),(0,G.jsx)(`span`,{className:`sr-only`,role:`status`,children:e(`activity:memoryManager.loadingSageContent`)})]}):r.loadError&&r.memories.length===0?(0,G.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-background p-6`,children:(0,G.jsxs)(`div`,{className:`max-w-md border border-destructive/35 bg-card p-6 shadow-2xl`,children:[(0,G.jsx)(`span`,{className:`flex size-11 items-center justify-center border border-destructive/35 bg-destructive/10 text-destructive`,children:(0,G.jsx)(T,{className:`size-5`})}),(0,G.jsx)(`h2`,{className:`mt-4 text-lg font-bold`,children:e(`activity:memoryManager.storeUnavailable`)}),(0,G.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-muted-foreground`,children:r.loadError}),(0,G.jsxs)(`div`,{className:`mt-5 flex gap-2`,children:[(0,G.jsxs)(R,{onClick:r.loadMemories,children:[(0,G.jsx)(j,{className:`size-4`}),` `,e(`common:action.retry`)]}),(0,G.jsxs)(R,{variant:`outline`,onClick:()=>t(`chat`),children:[(0,G.jsx)(oe,{className:`size-4`}),` `,e(`activity:memoryManager.backToChat`)]})]})]})}):(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden bg-background`,children:[(0,G.jsx)(nt,{wsConnected:r.wsConnected,refreshing:r.refreshing,onRefresh:r.loadMemories,onCreate:r.openCreate}),(0,G.jsx)(rt,{stats:r.stats,memories:r.memories,filteredCount:r.filteredMemories.length,allTagsCount:r.allTags.length}),(r.notice||r.loadError||r.mutationError)&&(0,G.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-2`,"aria-live":`polite`,children:[r.notice&&(0,G.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 text-xs text-success`,children:[(0,G.jsx)(ne,{className:`size-3.5`}),` `,r.notice]}),r.loadError&&(0,G.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-2 text-xs text-warning`,children:[(0,G.jsx)(T,{className:`size-3.5`}),` `,r.loadError,` Existing content remains available.`]}),r.mutationError&&!r.editing&&!r.creating&&(0,G.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-2 text-xs text-destructive`,children:[(0,G.jsx)(T,{className:`size-3.5`}),` `,r.mutationError]})]}),(0,G.jsxs)(`div`,{className:`grid min-h-0 flex-1 md:grid-cols-[minmax(320px,0.82fr)_minmax(0,1.35fr)]`,children:[(0,G.jsxs)(`section`,{className:F(`min-h-0 border-r border-border/70 bg-card/25`,r.detailOpen?`hidden md:flex md:flex-col`:`flex flex-col`),"aria-label":e(`activity:memoryManager.libraryAria`),children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b border-border/60 px-3 pt-1`,role:`tablist`,"aria-label":e(`activity:memoryManager.viewAria`),children:[(0,G.jsx)(R,{type:`button`,variant:`ghost`,size:`sm`,role:`tab`,"aria-selected":r.libraryView===`active`,onClick:()=>r.setLibraryView(`active`),className:F(`h-7 rounded-b-none border-b-2 px-3 text-[11px]`,r.libraryView===`active`?`border-primary text-foreground`:`border-transparent text-muted-foreground`),children:e(`activity:memoryManager.tabActive`)}),(0,G.jsx)(R,{type:`button`,variant:`ghost`,size:`sm`,role:`tab`,"aria-selected":r.showReview,onClick:()=>r.setLibraryView(`review`),className:F(`h-7 rounded-b-none border-b-2 px-3 text-[11px]`,r.showReview?`border-primary text-foreground`:`border-transparent text-muted-foreground`),children:e(`activity:memoryManager.tabReview`)}),(0,G.jsxs)(R,{type:`button`,variant:`ghost`,size:`sm`,role:`tab`,"aria-selected":r.showDeleted,onClick:()=>r.setLibraryView(`deleted`),className:F(`h-7 rounded-b-none border-b-2 px-3 text-[11px]`,r.showDeleted?`border-primary text-foreground`:`border-transparent text-muted-foreground`),children:[e(`activity:memoryManager.tabDeleted`),typeof r.statusCounts.deleted==`number`?` (${r.statusCounts.deleted})`:``]})]}),r.showReview?(0,G.jsx)(ct,{active:r.showReview,client:r.client,listCandidates:r.listMemoryCandidates,resolveCandidate:r.resolveMemoryCandidate,onOpenMemory:r.openMemory}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Xe,{searchQuery:r.searchQuery,statusFilter:r.statusFilter,kindFilter:r.kindFilter,audienceOnly:r.audienceOnly,tagFilter:r.tagFilter,hasFilters:r.hasFilters,allTags:r.allTags,stats:r.stats,onSearchChange:r.setSearchQuery,onStatusFilterChange:r.setStatusFilter,onKindFilterChange:r.setKindFilter,onToggleAudienceOnly:()=>r.setAudienceOnly(e=>!e),onTagFilterChange:r.setTagFilter,onClearFilters:r.clearFilters}),(0,G.jsx)(Qe,{memoryListRef:n,memories:r.memories,filteredMemories:r.filteredMemories,selectedId:r.selectedId,onSelectMemory:r.openMemory,onOpenCreate:r.openCreate,onClearFilters:r.clearFilters}),r.searchQuery.trim().length>0&&(0,G.jsx)(it,{query:r.searchQuery.trim(),channel:r.searchBreakdown.channel,hits:r.searchBreakdown.hits,loading:r.searchBreakdown.loading,error:r.searchBreakdown.error,onOpenMemory:r.openMemory,onClear:r.clearSearchBreakdown}),r.hasMore?(0,G.jsx)(`div`,{className:`shrink-0 border-t border-border/60 p-2`,children:(0,G.jsx)(R,{type:`button`,variant:`outline`,size:`sm`,onClick:r.loadMore,disabled:r.loadingMore,className:`h-7 w-full text-[11px]`,children:r.loadingMore?e(`common:action.loading`):`Load more (${r.memories.length} loaded)`})}):null]})]}),(0,G.jsxs)(`section`,{className:F(`min-h-0 bg-background`,r.detailOpen?`flex flex-col`:`hidden md:flex md:flex-col`),"aria-label":e(`activity:memoryManager.detailAria`),children:[r.memories.some(e=>(e.anchors??[]).some(e=>e.type===`file`&&e.path))&&(0,G.jsx)(Je,{currentFilePath:r.currentFilePath,knownFilePaths:r.knownFilePaths,drawerActive:r.drawerActive,onFilePathChange:e=>{e&&r.knownFilePaths.has(e)?(r.setCurrentFilePath(e),r.setDrawerOpen(!0)):e?r.setCurrentFilePath(e):r.setCurrentFilePath(null)},onToggleDrawer:()=>{r.currentFilePath&&r.setDrawerOpen(e=>!e)}}),r.creating?(0,G.jsx)(Ye,{mode:`create`,draft:r.draft,busy:r.busyAction===`create`,error:r.mutationError,onChange:r.setDraft,onCancel:r.cancelEditor,onSubmit:r.submitCreate}):r.selectedMemory?r.editing?(0,G.jsx)(Ye,{mode:`edit`,draft:r.draft,busy:r.busyAction===`update`,error:r.mutationError,onChange:r.setDraft,onCancel:r.cancelEditor,onSubmit:r.submitUpdate}):r.drawerActive?(0,G.jsx)(Ne,{filePath:r.currentFilePath,open:r.drawerActive,onClose:()=>r.setDrawerOpen(!1),onShowMemory:e=>r.setSelectedId(e),onAcceptDeletion:(e,t)=>{r.sendWithAck(`memory.sage.candidateResolve`,()=>r.resolveMemoryCandidate({candidateId:e,action:`accept`}),n=>{if(n.error){r.setMutationError(n.error);return}r.setNotice(`Accepted hygiene review for ${t.slice(0,12)}… (candidate ${e.slice(0,12)}…).`),r.loadMemories()})},onKeep:(e,t)=>{r.sendWithAck(`memory.sage.candidateResolve`,()=>r.resolveMemoryCandidate({candidateId:e,action:`reject`}),n=>{if(n.error){r.setMutationError(n.error);return}r.setNotice(`Kept ${t.slice(0,12)}… (candidate ${e.slice(0,12)}… rejected).`),r.loadMemories()})},onUpdate:e=>{r.openEdit(e)},onMarkPermanent:e=>{r.sendWithAck(`memory.sage.update`,()=>r.updateSage(e,{persistence:`permanent`}),t=>{if(t.error||!t.memory){r.setMutationError(t.error??`The server returned no memory record.`);return}r.setNotice(`Memory ${e.slice(0,12)}… promoted to permanent.`),r.loadMemories()})},onRecover:e=>{r.sendWithAck(`memory.sage.recover`,()=>r.recoverSage({id:e,reason:`recovered via file drawer`}),t=>{if(t.error){r.setMutationError(t.error);return}r.setNotice(`Recovered ${e.slice(0,12)}…`),r.loadMemories()})}}):(0,G.jsx)(Ue,{memory:r.selectedMemory,allMemories:[...r.memories,...r.graphMemories],relatedMemories:r.relatedMemories,graphEdges:r.graphEdges,graphLoading:r.graphLoading,graphError:r.graphError,onClose:()=>r.setSelectedId(null),onOpenMemory:r.openMemory,onEdit:r.openEdit,onDelete:()=>r.setDeletingId(r.selectedMemory.id),onTagSelect:e=>{r.setTagFilter(e),r.setSelectedId(null)},onNotice:r.setNotice}):(0,G.jsx)(tt,{onCapture:r.openCreate})]})]}),(0,G.jsx)(Pe,{busyAction:r.busyAction,deletingId:r.deletingId,memory:r.selectedMemory,onCancel:()=>r.setDeletingId(null),onConfirm:r.confirmDelete,onOpenChange:e=>{!e&&r.busyAction!==`delete`&&r.setDeletingId(null)}})]})}export{mt as MemoryManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{V as t,et as n,vt as r}from"./ws-client-DitX7fid.js";import{i,t as a}from"./react-core-D0Ec-185.js";import{Fa as o,St as s,ht as c,kt as l}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{t as u}from"./utils-CmY0Pw1m.js";import{n as d,o as f,r as p,t as m}from"./dialog-DT8I6gze.js";import{P as h}from"./index-CbwgQF8l.js";var g=e(i(),1),_=a();function v({open:e,onClose:i,className:a}){let{t:v}=o(),[y,b]=(0,g.useState)([]),x=r(),S=h(),C=n(e=>e.wsConnected),w=(0,g.useRef)(null),T=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(!e||!C||!S.client?.isConnected)return;b([]);let n=()=>{let e=S.client.withSession?.({})??(x?{sessionId:x}:{});S.client.send?.({type:`process.list`,payload:e})};return n(),w.current=S.client.on?.(`process.list`,e=>{let n=e?.payload;n?.processes&&t(n.sessionId,x)&&b(n.processes)})??null,T.current=setInterval(n,3e3),()=>{w.current?.(),T.current&&clearInterval(T.current)}},[e,C,S.client,x]);let E=y.filter(e=>e.status===`running`),D=(0,g.useCallback)(e=>{if(e.background&&!window.confirm(v(`activity:process.confirmKillBackground`,{pid:e.pid,defaultValue:`Terminate detached background process ${e.pid}?`})))return;let t=S.client.withSession?.({pid:e.pid})??{pid:e.pid};S.client.send?.({type:`process.kill`,payload:t})},[v,S.client]),O=(0,g.useCallback)(()=>{if(!window.confirm(v(`activity:process.confirmKillAll`,{count:E.length,defaultValue:`Terminate all ${E.length} running processes?`})))return;let e=S.client.withSession?.({})??(x?{sessionId:x}:{});S.client.send?.({type:`process.killAll`,payload:e})},[E.length,v,S.client,x]);return(0,_.jsx)(m,{open:e,onOpenChange:e=>{e||i()},children:(0,_.jsxs)(d,{className:u(`max-w-lg gap-0 p-0 overflow-hidden flex flex-col max-h-[75dvh] pt-[10dvh]`,a),showCloseButton:!1,children:[(0,_.jsx)(f,{className:`sr-only`,children:v(`activity:process.heading`)}),(0,_.jsx)(p,{className:`sr-only`,children:v(`activity:process.subtitle`,{active:E.length,total:y.length})}),(0,_.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b shrink-0`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,_.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-warning/10 text-warning`,children:(0,_.jsx)(c,{className:`h-4 w-4`})}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h2`,{className:`text-sm font-semibold`,children:v(`activity:process.heading`)}),(0,_.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:v(`activity:process.subtitle`,{active:E.length,total:y.length})})]})]}),(0,_.jsx)(`div`,{className:`flex items-center gap-1`,children:E.length>0&&(0,_.jsxs)(`button`,{type:`button`,onClick:O,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,children:[(0,_.jsx)(s,{className:`h-3 w-3 fill-current`}),v(`activity:process.killAll`)]})})]}),(0,_.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:y.length===0?(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,_.jsx)(c,{className:`h-10 w-10 opacity-15`}),(0,_.jsx)(`p`,{className:`text-sm font-medium`,children:v(`activity:process.emptyTitle`)}),(0,_.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:v(`activity:process.emptyBody`)})]}):(0,_.jsx)(`div`,{className:`divide-y`,children:y.map(e=>{let t=e.status===`running`?Math.floor((Date.now()-e.startedAt)/1e3):null,n=t?t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`:null,r=e.protected===!0,i=e.background===!0;return(0,_.jsxs)(`div`,{className:u(`flex items-center justify-between px-4 py-3 text-xs transition-colors`,e.status===`running`?`bg-background hover:bg-muted/30`:`bg-muted/20 text-muted-foreground`),children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,_.jsx)(`span`,{className:u(`led shrink-0`,e.status===`running`?r?`text-info`:`text-success led-pulse`:`text-muted-foreground`)}),(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:v(`activity:process.pidLabel`,{pid:e.pid})}),(0,_.jsx)(`span`,{className:`font-medium truncate`,children:e.tool}),r&&(0,_.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1 py-0.5 rounded text-[9px] bg-info/10 text-info font-medium shrink-0`,title:v(`activity:process.protectedTitle`),children:[(0,_.jsx)(l,{className:`h-2.5 w-2.5`}),v(`activity:process.protected`)]}),i&&(0,_.jsx)(`span`,{className:`inline-flex items-center px-1 py-0.5 rounded text-[9px] bg-success/10 text-success font-medium shrink-0`,title:v(`activity:process.backgroundTitle`),children:v(`activity:process.background`)})]}),(0,_.jsx)(`code`,{className:`text-[10px] text-muted-foreground/70 truncate block mt-0.5 font-mono`,children:e.command})]})]}),(0,_.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0 ml-3`,children:[n&&(0,_.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:n}),e.status===`running`&&!r&&(0,_.jsx)(`button`,{type:`button`,onClick:()=>D(e),className:`p-1.5 rounded-md hover:bg-destructive/10 hover:text-destructive transition-colors`,title:v(`activity:process.killTitle`,{pid:e.pid}),children:(0,_.jsx)(s,{className:`h-3.5 w-3.5 fill-current`})})]})]},e.pid)})})})]})})}export{v as ProcessMonitor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./ws-client-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./ws-client-DitX7fid.js";import{i as n,t as r}from"./react-core-D0Ec-185.js";import{Fa as i,Ki as a,Rr as o,Ut as s,Wi as c,lt as l,tn as u}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{t as d}from"./utils-CmY0Pw1m.js";var f=e(n(),1),p=r(),m=200,h=new Set([`raw_user`,`refined_user`]),g=[`raw_user`,`refined_user`];function _(e,t){return e(`activity:promptJournal.cat.${t}`,t)}function v(){let{t:e}=i(),n=t(),[r,a]=(0,f.useState)([]),[c,v]=(0,f.useState)(!0),[b,x]=(0,f.useState)(null),[S,C]=(0,f.useState)(!0),[w,T]=(0,f.useState)({category:``,session:``,limit:m}),[E,D]=(0,f.useState)(new Set),O=(0,f.useCallback)(()=>{if(!n.isConnected){C(!1);return}C(!0),x(null),n.send({type:`prompts.journal`,payload:{filter:{...w.category?{category:w.category}:{},limit:w.limit}}})},[n,w.category,w.limit]);(0,f.useEffect)(()=>{let e=e=>{let t=e.payload;v(t.enabled);let n=(t.entries??[]).filter(e=>h.has(e.category));a(n),x(t.error??null),C(!1)};return n.on(`prompts.journal`,e),O(),()=>n.off(`prompts.journal`,e)},[n,O]);let k=(0,f.useMemo)(()=>{let e=w.session.trim().toLowerCase(),t=r.filter(t=>!e||t.sessionId.toLowerCase().includes(e)),n=new Map;for(let e of[...t].reverse()){let t=e.timestamp.slice(0,10),r=n.get(t)??[];r.push(e),n.set(t,r)}return[...n.entries()]},[r,w.session]),A=(0,f.useMemo)(()=>{let e=0;for(let t of r)e+=t.metadata.tokenEstimate??0;return{count:r.length,tokens:e}},[r]),j=e=>{D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},M=(0,f.useMemo)(()=>g.filter(e=>r.some(t=>t.category===e)),[r]);return(0,p.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto`,children:[(0,p.jsxs)(`div`,{className:`border-b border-border/70 px-4 py-3 sm:px-6`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(s,{className:`h-5 w-5 text-primary`}),(0,p.jsx)(`h1`,{className:`text-base font-semibold`,children:e(`activity:promptJournal.title`)})]}),(0,p.jsxs)(`button`,{type:`button`,onClick:O,disabled:S,className:`inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50`,children:[(0,p.jsx)(u,{className:d(`h-3.5 w-3.5`,S&&`animate-spin`)}),e(`activity:promptJournal.refresh`)]})]}),(0,p.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:promptJournal.subtitle`)}),c&&A.count>0&&(0,p.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.statEntries`,{count:A.count})}),(0,p.jsx)(`span`,{children:e(`activity:promptJournal.statTokens`,{count:A.tokens.toLocaleString()})})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/70 px-4 py-2 sm:px-6`,children:[(0,p.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.filterCategory`)}),(0,p.jsxs)(`select`,{value:w.category,onChange:e=>T(t=>({...t,category:e.target.value})),className:`rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:ring-1 focus:ring-primary`,children:[(0,p.jsx)(`option`,{value:``,children:e(`activity:promptJournal.filterAll`)}),M.map(t=>(0,p.jsx)(`option`,{value:t,children:_(e,t)},t))]})]}),(0,p.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.filterSession`)}),(0,p.jsx)(`input`,{type:`text`,value:w.session,onChange:e=>T(t=>({...t,session:e.target.value})),placeholder:`sess_…`,className:`w-40 rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:ring-1 focus:ring-primary`})]}),(0,p.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,p.jsx)(`span`,{children:e(`activity:promptJournal.filterLimit`)}),(0,p.jsxs)(`select`,{value:w.limit,onChange:e=>T(t=>({...t,limit:Number(e.target.value)})),className:`rounded border border-border bg-background px-2 py-1 text-xs outline-none focus:ring-1 focus:ring-primary`,children:[(0,p.jsx)(`option`,{value:50,children:`50`}),(0,p.jsx)(`option`,{value:200,children:`200`}),(0,p.jsx)(`option`,{value:1e3,children:`1000`})]})]})]}),(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 px-4 py-3 sm:px-6`,children:[S&&(0,p.jsx)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:e(`activity:promptJournal.loading`)}),!S&&b&&(0,p.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-10 text-sm text-destructive`,children:[(0,p.jsx)(l,{className:`h-4 w-4`}),b]}),!S&&!b&&!c&&(0,p.jsx)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:e(`activity:promptJournal.disabled`)}),!S&&!b&&c&&k.length===0&&(0,p.jsxs)(`div`,{className:`py-10 text-center`,children:[(0,p.jsx)(o,{className:`mx-auto h-8 w-8 text-muted-foreground/50`}),(0,p.jsx)(`div`,{className:`mt-2 text-sm font-medium text-foreground`,children:e(`activity:promptJournal.emptyTitle`)}),(0,p.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:promptJournal.emptyHint`)})]}),!S&&!b&&c&&k.length>0&&(0,p.jsx)(`div`,{className:`space-y-5`,children:k.map(([e,t])=>(0,p.jsxs)(`section`,{children:[(0,p.jsxs)(`h2`,{className:`sticky top-0 z-10 border-b border-border/60 bg-background/90 py-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground backdrop-blur`,children:[e,(0,p.jsx)(`span`,{className:`ml-2 font-normal normal-case text-muted-foreground/60`,children:t.length})]}),(0,p.jsx)(`ul`,{className:`mt-2 space-y-2`,children:t.map(e=>(0,p.jsx)(y,{entry:e,expanded:E.has(e.id),onToggle:()=>j(e.id)},e.id))})]},e))})]})]})}function y({entry:e,expanded:t,onToggle:n}){let{t:r}=i(),o=e.timestamp.slice(11,19),s=e.metadata,l=e.content.trim().slice(0,240),u=e.rawContent!==void 0&&e.rawContent!==e.content;return(0,p.jsxs)(`li`,{className:`rounded-lg border border-border/70 bg-card/60`,children:[(0,p.jsxs)(`button`,{type:`button`,onClick:n,className:`flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left hover:bg-accent/40`,children:[t?(0,p.jsx)(a,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}):(0,p.jsx)(c,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs`,children:[(0,p.jsx)(`span`,{className:`tabular text-muted-foreground`,children:o}),(0,p.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 font-medium text-primary`,children:_(r,e.category)}),(0,p.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-muted-foreground`,children:e.role}),(0,p.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:e.sessionId})]}),!t&&l&&(0,p.jsx)(`div`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap break-words text-xs text-foreground/80`,children:l})]}),(0,p.jsxs)(`span`,{className:`shrink-0 text-[11px] tabular text-muted-foreground`,children:[`~`,s.tokenEstimate,` `,r(`activity:promptJournal.tokens`)]})]}),t&&(0,p.jsxs)(`div`,{className:`border-t border-border/60 px-3 py-2 pl-9`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:promptJournal.refinedBody`)}),(0,p.jsx)(`pre`,{className:`mt-1 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/50 p-2 text-xs text-foreground`,children:e.content}),u&&(0,p.jsxs)(`div`,{className:`mt-2`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:promptJournal.rawInput`)}),(0,p.jsx)(`pre`,{className:`mt-1 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/30 p-2 text-xs text-muted-foreground`,children:e.rawContent})]})]})]})}export{v as PromptJournalView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{kt as t,vt as n}from"./ws-client-DitX7fid.js";import{i as r,t as i}from"./react-core-D0Ec-185.js";import{Ca as a,Fa as o,K as s,Xn as c,ft as l,ga as u,qi as d}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{t as f}from"./utils-CmY0Pw1m.js";import{n as p,o as m,r as h,t as g}from"./dialog-DT8I6gze.js";import{lt as _}from"./index-CbwgQF8l.js";var v=e(r(),1),y=i(),b={btw:{label:`btw`,titleKey:`btwTitle`,tone:`bg-primary/10 text-primary border-primary/30`},steer:{label:`steer`,titleKey:`steerTitle`,tone:`bg-warning/10 text-warning border-warning/35`},queue:{label:`queue`,titleKey:`queueTitle`,tone:`bg-info/10 text-info border-info/30`}},x=`__no_session__`,S=new Map,C=new Set;t(e=>{S.delete(e),C.add(e)});function w({open:e,onClose:t,className:r}){let{t:i}=o(),w=_(e=>e.queue),T=_(e=>e.removeQueued),E=_(e=>e.clearQueue),[D,O]=(0,v.useState)(`oldest`),k=n(),A=(0,v.useRef)(k??x);(0,v.useLayoutEffect)(()=>{C.has(A.current)||S.set(A.current,D);let e=k??x;C.delete(e),O(S.get(e)??`oldest`),A.current=e},[k]);let j=(0,v.useCallback)(e=>{T(e)},[T]),M=(0,v.useMemo)(()=>{let e=w.map((e,t)=>({item:e,sourceIdx:t}));return e.sort((e,t)=>D===`newest`?t.item.addedAt-e.item.addedAt:e.item.addedAt-t.item.addedAt),e},[w,D]),N=w.length>0&&w.every(e=>e.alreadyDispatched);return(0,y.jsx)(g,{open:e,onOpenChange:e=>{e||t()},children:(0,y.jsxs)(p,{className:f(`max-w-lg gap-0 overflow-hidden border-border/80 bg-card p-0 pt-[10dvh] flex flex-col max-h-[70dvh]`,r),showCloseButton:!1,children:[(0,y.jsx)(m,{className:`sr-only`,children:i(`activity:queue.heading`)}),(0,y.jsx)(h,{className:`sr-only`,children:i(`activity:queue.subtitle`,{count:w.length})}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 bg-card/95 px-4 py-3 shrink-0`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,y.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-md border border-primary/20 bg-primary/10 text-primary`,children:(0,y.jsx)(c,{className:`h-4 w-4`})}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-sm font-semibold`,children:i(`activity:queue.heading`)}),(0,y.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:i(`activity:queue.subtitle`,{count:w.length})})]})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>e===`newest`?`oldest`:`newest`),className:f(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs transition-colors font-medium`,`text-muted-foreground hover:bg-muted hover:text-foreground`),title:i(D===`newest`?`activity:queue.sortNewestTitle`:`activity:queue.sortOldestTitle`),"data-testid":`queue-sort-toggle`,children:[D===`newest`?(0,y.jsx)(a,{className:`h-3 w-3`}):(0,y.jsx)(u,{className:`h-3 w-3`}),i(D===`newest`?`activity:queue.newest`:`activity:queue.oldest`)]}),w.length>0&&!N&&(0,y.jsxs)(`button`,{type:`button`,onClick:()=>E(),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,title:i(`activity:queue.clearDispatchedTitle`),"data-testid":`queue-clear-all`,children:[(0,y.jsx)(l,{className:`h-3 w-3`}),i(`activity:queue.clear`)]})]})]}),(0,y.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:w.length===0?(0,y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,y.jsx)(c,{className:`h-10 w-10 opacity-15`}),(0,y.jsx)(`p`,{className:`text-sm font-medium`,children:i(`activity:queue.emptyTitle`)}),(0,y.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:i(`activity:queue.emptyBody`)})]}):(0,y.jsx)(`ul`,{className:`divide-y divide-border/60`,"data-testid":`queue-list`,children:M.map(({item:e,sourceIdx:t},n)=>{let r=b[e.mode],a=e.alreadyDispatched===!0;return(0,y.jsxs)(`li`,{className:f(`flex items-start justify-between gap-3 px-4 py-3 text-xs transition-colors`,a?`bg-muted/30 text-muted-foreground hover:bg-muted/40`:`hover:bg-muted/35`),"data-testid":`queue-item`,"data-dispatched":a?`true`:void 0,children:[(0,y.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0 flex-1`,children:[(0,y.jsxs)(`span`,{className:`mt-1 text-[10px] font-mono text-muted-foreground shrink-0 w-5 text-right tabular-nums`,children:[n+1,`.`]}),(0,y.jsx)(`span`,{className:f(`shrink-0 inline-flex items-center justify-center rounded border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,r.tone,a&&`opacity-60`),title:i(`activity:queue.${r.titleKey}`),"data-testid":`queue-mode-${e.mode}`,children:r.label}),(0,y.jsx)(`p`,{className:`text-sm leading-relaxed min-w-0 break-words flex-1`,children:e.text.length>120?`${e.text.slice(0,117)}…`:e.text}),a&&(0,y.jsxs)(`span`,{className:`shrink-0 mt-0.5 inline-flex items-center gap-1 text-[10px] font-semibold uppercase text-success`,title:i(`activity:queue.dispatchedTitle`),"data-testid":`queue-dispatched-${t}`,children:[(0,y.jsx)(d,{className:`h-3 w-3`}),i(`activity:queue.dispatchedLabel`)]})]}),!a&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>j(t),className:`ml-1 p-1.5 rounded-md shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors`,title:i(`activity:queue.removeTitle`),"data-testid":`queue-remove-${t}`,children:(0,y.jsx)(s,{className:`h-3.5 w-3.5`})})]},`${e.addedAt}-${t}`)})})}),w.length>0&&(0,y.jsx)(`div`,{className:`border-t border-border/70 bg-muted/20 px-4 py-2.5 shrink-0`,children:(0,y.jsx)(`p`,{className:`text-[10px] text-muted-foreground text-center`,children:i(`activity:queue.footer`)})})]})})}export{w as QueuePanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Z as t}from"./ws-client-DitX7fid.js";import{i as n,t as r}from"./react-core-D0Ec-185.js";import{Da as i,Fa as a,Ri as o,Yt as s,Zt as c,ci as l,lt as u,zt as d}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{n as f}from"./ui-store-BPQ-dcnY.js";import{lt as p}from"./index-CbwgQF8l.js";var m=e(n(),1),h=r();function g(){let e=t(e=>e.session),{t:n}=a(),r=t.getState().session?.id,g=t(e=>e.projectName),x=t(e=>e.cwd),S=t(e=>e.mode),C=t(e=>e.contextMode),w=t(e=>e.lastVisitedAt),T=p(e=>e.messages),E=p(e=>e.queue.length),D=p(e=>e.boundSessionId),O=f(e=>e.currentView),k=f(e=>e.dockSection),[A,j]=(0,m.useState)([]),M=(0,m.useMemo)(()=>{if(typeof window>`u`)return 0;let e=0;for(let t of[`wrongstack-session`,`wrongstack-chat`,`wrongstack-ui`,`wrongstack-config`]){let n=window.localStorage.getItem(t);typeof n==`string`&&(e+=n.length)}return e},[T.length]),N=typeof window<`u`&&!!window.__wrongstackSessionRehydrated,P=typeof window<`u`&&!!window.__wrongstackChatRehydrated;function F(e,t){j(n=>[{ts:Date.now(),note:e,ok:t},...n].slice(0,20))}function I(){F(n(`activity:refresh.simulatedF5`),!0)}let L=D!==null&&r!==void 0&&D!==r;return(0,h.jsx)(`div`,{className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,h.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5 sm:space-y-6`,children:[(0,h.jsx)(`header`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-2 text-xl font-bold sm:text-2xl`,children:[(0,h.jsx)(s,{className:`h-6 w-6 shrink-0 text-primary sm:h-7 sm:w-7`}),n(`activity:refresh.heading`)]}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`activity:refresh.subtitle`)})]}),(0,h.jsx)(`button`,{type:`button`,onClick:I,className:`inline-flex h-9 w-full items-center justify-center rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 sm:w-auto`,children:n(`activity:refresh.recordProbe`)})]})}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(i,{className:`w-5 h-5`}),n(`activity:refresh.latestSession`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.restoredLocal`),ok:N,extra:r?n(`activity:refresh.sessionIdExtra`,{id:r}):n(`activity:refresh.noSessionYet`)}),(0,h.jsx)(_,{label:n(`activity:refresh.activePointer`),ok:!!e?.id,extra:e?y(e):`null`}),(0,h.jsx)(_,{label:n(`activity:refresh.lastVisited`),ok:w>0,extra:w>0?new Date(w).toISOString():n(`activity:refresh.never`)})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(l,{className:`w-5 h-5`}),n(`activity:refresh.persistedEnv`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`projectName`,value:g||`∅`}),(0,h.jsx)(v,{label:`cwd`,value:x||`∅`,mono:!0}),(0,h.jsx)(v,{label:`mode`,value:S,mono:!0}),(0,h.jsx)(v,{label:`contextMode`,value:C,mono:!0})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(c,{className:`w-5 h-5`}),n(`activity:refresh.transcriptRehydrate`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.localTranscript`),ok:P&&(T.length>0||D===null),extra:T.length===0?n(`activity:refresh.noMessages`):n(`activity:refresh.messagesExtra`,{count:T.length,queued:E})}),(0,h.jsx)(_,{label:n(`activity:refresh.noBleed`),ok:!L,extra:L?n(`activity:refresh.bleedExtra`,{bound:D??`∅`,active:r??`∅`}):n(`activity:refresh.transcriptBinds`),warn:L}),T.length>0&&(0,h.jsxs)(`div`,{className:`space-y-1 rounded-lg border border-border/70 bg-card/65 p-3 text-xs font-mono`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`first:`}),` `,b(T[0])]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`last:`}),` `,b(T[T.length-1]??T[0])]})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(d,{className:`w-5 h-5`}),n(`activity:refresh.uiWorkspace`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`currentView`,value:O,mono:!0}),(0,h.jsx)(v,{label:`dockSection`,value:k??n(`activity:refresh.noneValue`),mono:!0})]}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:refresh.payloadSize`,{count:M})})]}),(0,h.jsxs)(`section`,{className:`space-y-2`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold`,children:n(`activity:refresh.probeLog`)}),A.length===0?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`activity:refresh.noProbes`)}):(0,h.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:A.map((e,t)=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.ok?(0,h.jsx)(o,{className:`w-4 h-4 text-success shrink-0`}):(0,h.jsx)(u,{className:`w-4 h-4 text-warning shrink-0`}),(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,h.jsx)(`span`,{children:e.note})]},`${e.ts}-${t}`))})]})]})})}function _({label:e,extra:t,ok:n,warn:r}){return(0,h.jsxs)(`div`,{className:`rounded-lg border px-3 py-2 ${r?`border-warning/40 bg-warning/10 text-warning`:n?`border-success/40 bg-success/10 text-success`:`border-border bg-muted/40 text-muted-foreground`}`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium`,children:[n&&!r?(0,h.jsx)(o,{className:`h-4 w-4 shrink-0`}):(0,h.jsx)(u,{className:`h-4 w-4 shrink-0`}),(0,h.jsx)(`span`,{className:`min-w-0 break-words`,children:e})]}),(0,h.jsx)(`div`,{className:`text-xs font-mono mt-1 break-all`,children:t})]})}function v({label:e,value:t,mono:n}){return(0,h.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-card/75 p-3 shadow-sm`,children:[(0,h.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted-foreground`,children:e}),(0,h.jsx)(`p`,{className:`mt-1 text-sm break-all `+(n?`font-mono`:`font-medium`),children:t})]})}function y(e){let t=e.title?.trim();return t?`${e.id} — "${t}" (${e.provider}/${e.model})`:`${e.id} (${e.provider}/${e.model})`}function b(e){let t=(e.content??``).trim().replace(/\s+/g,` `);return`[${e.role}] ${t.length>100?`${t.slice(0,99)}…`:t}`}export{g as RefreshDebugView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-D0Ec-185.js";import{Fa as r}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{t as i}from"./utils-CmY0Pw1m.js";import{t as a}from"./button-BIFXNDDY.js";import{t as o}from"./input-DE1O73TJ.js";import{g as s}from"./index-CbwgQF8l.js";var c=e(t(),1),l=n(),u=[`feature`,`bug_fix`,`refactor`,`performance`,`security`,`ui_change`,`api_change`,`infrastructure`,`migration`,`testing`,`documentation`,`maintenance`,`other`,`unspecified`],d=[`unspecified`,`low`,`medium`,`high`,`critical`],f={draft:`bg-muted text-muted-foreground`,collecting_information:`bg-warning/15 text-warning`,submitted:`bg-success/15 text-success`,cancelled:`bg-destructive/15 text-destructive`,archived:`bg-muted text-muted-foreground`};function p(e){let t=Date.now()-e;if(t<6e4)return`just now`;let n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function m(){let{t:e}=r(),[t,n]=(0,c.useState)(null),[m,h]=(0,c.useState)([]),[g,_]=(0,c.useState)(!0),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)(``),[S,C]=(0,c.useState)(``),[w,T]=(0,c.useState)(`unspecified`),[E,D]=(0,c.useState)(`unspecified`),[O,k]=(0,c.useState)(!1),[A,j]=(0,c.useState)(null),[M,N]=(0,c.useState)(null),P=(0,c.useCallback)(async()=>{_(!0),y(null);try{let e=await fetch(`/api/requirement-intakes`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error?.message??`List failed (HTTP ${e.status})`)}let t=await e.json();n(t.projectId),h(t.intakes)}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(!1)}},[]);(0,c.useEffect)(()=>{P()},[P]);let F=(0,c.useCallback)(async()=>{let e=b.trim();if(!e){j(`Describe the request first — it is preserved verbatim.`);return}if(!t){j(`No project identity available yet.`);return}k(!0),j(null),N(null);try{let n=await fetch(`/api/projects/${encodeURIComponent(t)}/requirement-intakes`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectId:t,requestedBy:`webui`,originalRequest:e,...S.trim()?{title:S.trim()}:{},...w===`unspecified`?{}:{requestType:w},...E===`unspecified`?{}:{priority:E}})}),r=await n.json().catch(()=>null);if(!n.ok||!r?.record)throw Error(r?.error?.message??`Create failed (HTTP ${n.status})`);let i=await fetch(`/api/requirement-intakes/${r.record.id}/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`});if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.error?.message??`Submit failed (HTTP ${i.status})`)}N(`Intake recorded and submitted (${r.record.id}).`),x(``),C(``),T(`unspecified`),D(`unspecified`),await P()}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}},[b,S,w,E,t,P]);return(0,l.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,l.jsxs)(`header`,{className:`border-b border-border/70 px-5 py-3`,children:[(0,l.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e(`activity:reqIntake.requirementsIntake`)}),(0,l.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e(`activity:reqIntake.collectAndPreserveSoftwareDevelopmentRequests`)})]}),(0,l.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5`,children:[v?(0,l.jsxs)(`div`,{role:`alert`,className:`mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[v,(0,l.jsx)(`button`,{type:`button`,className:`ml-2 underline underline-offset-2`,onClick:()=>void P(),children:e(`activity:reqIntake.retry`)})]}):null,(0,l.jsxs)(`section`,{"aria-label":e(`activity:reqIntake.fileANewIntake`),className:`mb-6 rounded-lg border border-border/70 bg-card/60 p-4`,children:[(0,l.jsx)(`div`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`activity:reqIntake.fileANewRequest`)}),(0,l.jsxs)(`div`,{className:`space-y-3`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`label`,{htmlFor:`intake-request`,className:`mb-1 block text-xs text-foreground`,children:[e(`activity:reqIntake.requestText`),` `,(0,l.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,l.jsx)(`textarea`,{id:`intake-request`,value:b,onChange:e=>x(e.target.value),placeholder:e(`activity:reqIntake.describeTheFeatureBugFixRefactorOrChange`),rows:4,className:i(`w-full resize-y rounded-md border border-border/70 bg-background px-3 py-2`,`text-sm text-foreground placeholder:text-muted-foreground/70`,`focus:outline-none focus:ring-2 focus:ring-ring`)}),/\[VIBE\]/i.test(b)?(0,l.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 rounded bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary`,children:[(0,l.jsx)(`span`,{children:`🌊`}),(0,l.jsxs)(`span`,{children:[(0,l.jsx)(`strong`,{children:`VIBE Protocol Detected:`}),` Three-Stage Verification (Spec-Synthesizer → Coder → Auditor) is active.`]})]}):null,(0,l.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e(`activity:reqIntake.storedVerbatimAsTheRecordApos`)})]}),(0,l.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:`intake-title`,className:`mb-1 block text-xs text-foreground`,children:e(`activity:reqIntake.titleOptional`)}),(0,l.jsx)(o,{id:`intake-title`,value:S,onChange:e=>C(e.target.value),placeholder:e(`activity:reqIntake.shortDisplayTitle`)})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:`intake-type`,className:`mb-1 block text-xs text-foreground`,children:e(`activity:reqIntake.type`)}),(0,l.jsx)(`select`,{id:`intake-type`,value:w,onChange:e=>T(e.target.value),className:i(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:u.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:`intake-priority`,className:`mb-1 block text-xs text-foreground`,children:e(`activity:reqIntake.priority`)}),(0,l.jsx)(`select`,{id:`intake-priority`,value:E,onChange:e=>D(e.target.value),className:i(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:d.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})]})]}),A?(0,l.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:A}):null,M?(0,l.jsx)(`div`,{role:`status`,className:`rounded-md border border-success/30 bg-success/10 px-3 py-2 text-xs text-success`,children:M}):null,(0,l.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,l.jsx)(a,{variant:`secondary`,size:`sm`,disabled:O,onClick:()=>{x(``),j(null),N(null)},children:e(`activity:reqIntake.clear`)}),(0,l.jsx)(a,{size:`sm`,disabled:O||!b.trim(),onClick:()=>void F(),children:O?`Filing…`:`File + submit`})]})]})]}),(0,l.jsxs)(`section`,{"aria-label":e(`activity:reqIntake.intakeRecords`),className:`space-y-2`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,l.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`activity:reqIntake.records`)}),(0,l.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[m.length,` total`]})]}),g?(0,l.jsx)(`div`,{className:`py-8 text-center text-xs text-muted-foreground`,children:e(`activity:reqIntake.loading`)}):m.length===0?(0,l.jsx)(`div`,{className:`rounded-md border border-dashed border-border/70 py-10 text-center text-xs text-muted-foreground`,children:e(`activity:reqIntake.noIntakeRecordsYetFileThe`)}):(0,l.jsx)(`ul`,{className:`space-y-2`,children:m.map(e=>(0,l.jsxs)(`li`,{className:`rounded-md border border-border/70 bg-card/60 p-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,title:e.title,children:e.title}),(0,l.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,l.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1.5`,children:[e.isVibeMode?(0,l.jsx)(s,{variant:`outline`,className:`border-primary/40 bg-primary/10 text-[10px] text-primary`,children:`🌊 VIBE`}):null,(0,l.jsx)(s,{variant:`secondary`,className:`text-[10px]`,children:e.requestType}),(0,l.jsx)(s,{className:i(`text-[10px]`,f[e.status]??`bg-muted text-muted-foreground`),children:e.status})]})]}),(0,l.jsxs)(`div`,{className:`mt-1.5 text-[11px] text-muted-foreground`,children:[e.priority,` · updated `,p(e.updatedAt)]})]},e.id))})]})]})]})}export{m as RequirementIntakeView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MemoryManager-BAe2zkyG.js","assets/rolldown-runtime-hePW80VL.js","assets/ws-client-DitX7fid.js","assets/react-core-D0Ec-185.js","assets/vendor-DcnGbJ82.js","assets/xyflow-BlkaZTzI.js","assets/xyflow-DLioOiRN.css","assets/markdown-BzXmcdZg.js","assets/vendor-BShi5_Dg.css","assets/i18n-Dq2jJcme.js","assets/chat-BITJe8-v.js","assets/commandPalette-BovBiPec.js","assets/common-BBHmIHQW.js","assets/setup-qooXjj4V.js","assets/toasts-DZ6HdKgG.js","assets/vite-preload-Czpn1I53.js","assets/utils-CmY0Pw1m.js","assets/ui-store-BPQ-dcnY.js","assets/dialog-DT8I6gze.js","assets/button-BIFXNDDY.js","assets/input-DE1O73TJ.js","assets/index-CbwgQF8l.js","assets/index-Cg_zbV9k.css","assets/roster-ws--cUKX8Eo.js","assets/shared-k2sZgl6A.js","assets/MemoryDrawer-B4aW4mVs.js","assets/AudienceMemoryPanel-DyP-vZA-.js","assets/vector-memory-panel-UsWhpyqi.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-D0Ec-185.js";import{Fa as r,Zn as i,tt as a,wn as o}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{t as s}from"./vite-preload-Czpn1I53.js";import{t as c}from"./utils-CmY0Pw1m.js";import{D as l,E as u,O as d,T as f}from"./index-CbwgQF8l.js";var p=e(t(),1),m=n(),h=(0,p.lazy)(()=>s(()=>import(`./MemoryManager-BAe2zkyG.js`).then(e=>({default:e.MemoryManager})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]))),g=(0,p.lazy)(()=>s(()=>import(`./AudienceMemoryPanel-DyP-vZA-.js`).then(e=>({default:e.AudienceMemoryPanel})),__vite__mapDeps([26,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,2,17,22,24]))),_=(0,p.lazy)(()=>s(()=>import(`./vector-memory-panel-UsWhpyqi.js`).then(e=>({default:e.VectorMemoryPanel})),__vite__mapDeps([27,1,3,4,5,6,7,8,18,16,19])));function v({label:e}){return(0,m.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-background text-xs text-muted-foreground`,"aria-busy":`true`,children:(0,m.jsxs)(`span`,{className:`font-mono uppercase tracking-wide`,children:[e,`…`]})})}var y=[{value:`all`,label:`activity:memoryManager.tabAllMemories`,hint:`activity:memoryManager.tabAllMemoriesHint`,Icon:i},{value:`audience`,label:`activity:memoryManager.tabAudience`,hint:`activity:memoryManager.tabAudienceHint`,Icon:a},{value:`vector`,label:`activity:memoryManager.tabVectorMemory`,hint:`activity:memoryManager.tabVectorMemoryHint`,Icon:o}];function b({defaultValue:e=`all`}={}){let{t}=r();return(0,m.jsxs)(f,{defaultValue:e,className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,children:[(0,m.jsx)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-border/70 bg-card/55 px-4 py-2 sm:px-5`,role:`presentation`,children:(0,m.jsx)(l,{"aria-label":t(`activity:memoryManager.lensesAria`),className:`h-9 bg-muted/40 p-1 shadow-none`,children:y.map(({value:e,label:n,hint:r,Icon:i})=>(0,m.jsxs)(d,{value:e,className:c(`h-7 gap-2 px-3 text-[11px] font-semibold uppercase tracking-wide`,`data-[state=active]:bg-background data-[state=active]:text-foreground`,`data-[state=active]:shadow-[0_0_0_1px_hsl(var(--border)/0.7)]`),children:[(0,m.jsx)(i,{className:`size-3.5`}),(0,m.jsx)(`span`,{children:t(n)}),(0,m.jsx)(`span`,{className:`hidden font-mono text-[9px] font-normal normal-case text-muted-foreground sm:inline`,children:t(r)})]},e))})}),(0,m.jsx)(u,{value:`all`,className:`mt-0 flex-1 overflow-hidden ring-offset-0 focus-visible:ring-0`,children:(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(v,{label:t(`activity:memoryManager.loadingSage`)}),children:(0,m.jsx)(h,{})})}),(0,m.jsx)(u,{value:`audience`,className:`mt-0 flex-1 overflow-hidden ring-offset-0 focus-visible:ring-0`,children:(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(v,{label:t(`activity:memoryManager.loadingAudience`)}),children:(0,m.jsx)(g,{})})}),(0,m.jsx)(u,{value:`vector`,className:`mt-0 flex-1 overflow-y-auto px-4 pb-6 pt-4 ring-offset-0 focus-visible:ring-0 sm:px-5`,children:(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(v,{label:t(`activity:memoryManager.loadingVectorMemory`)}),children:(0,m.jsx)(_,{})})})]})}export{b as SageTabs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-D0Ec-185.js";import{Fa as r,K as i,Kn as a,Li as o,Pt as s,Tt as c,Xt as l,cn as u,da as d,ea as f,ir as p,lt as m,qi as h,vr as g,xr as _}from"./vendor-DcnGbJ82.js";import"./i18n-Dq2jJcme.js";import{a as v,c as y,h as b,n as x,o as S,p as C,r as w,t as T,u as E}from"./xyflow-BlkaZTzI.js";import{t as D}from"./utils-CmY0Pw1m.js";var O=e(t(),1),k=n();function A({pct:e}){let{t}=r(),n=(0,O.useId)(),i=2*Math.PI*26,a=i-Math.max(0,Math.min(100,e))/100*i;return(0,k.jsxs)(`div`,{className:`relative h-16 w-16 shrink-0`,children:[(0,k.jsxs)(`svg`,{viewBox:`0 0 64 64`,className:`h-16 w-16 -rotate-90`,role:`img`,"aria-label":t(`activity:progressring.progress`),children:[(0,k.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`hsl(var(--muted))`,strokeWidth:`6`}),(0,k.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`url(#${n})`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:i,strokeDashoffset:a,style:{transition:`stroke-dashoffset 0.6s cubic-bezier(0.16,1,0.3,1)`}}),(0,k.jsx)(`defs`,{children:(0,k.jsxs)(`linearGradient`,{id:n,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,k.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--primary))`}),(0,k.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(var(--info))`})]})})]}),(0,k.jsxs)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm font-bold text-foreground`,children:[Math.round(e),`%`]})]})}var j={pending:{label:`Pending`,icon:o,text:`text-muted-foreground`,ring:`border-border/70 bg-muted/45`,dot:`bg-muted-foreground`,hex:`hsl(var(--muted-foreground))`},queued:{label:`Ready`,icon:o,text:`text-primary`,ring:`border-primary/35 bg-primary/10`,dot:`bg-primary`,hex:`hsl(var(--primary))`},in_progress:{label:`Running`,icon:a,spin:!0,text:`text-warning`,ring:`border-warning/45 bg-warning/10`,dot:`bg-warning`,hex:`hsl(var(--warning))`},blocked:{label:`Blocked`,icon:o,text:`text-destructive`,ring:`border-destructive/30 bg-destructive/10`,dot:`bg-destructive`,hex:`hsl(var(--destructive))`},review:{label:`Review`,icon:o,text:`text-primary`,ring:`border-primary/35 bg-primary/10`,dot:`bg-primary`,hex:`hsl(var(--info))`},failed:{label:`Failed`,icon:i,text:`text-destructive`,ring:`border-destructive/45 bg-destructive/10`,dot:`bg-destructive`,hex:`hsl(var(--destructive))`},completed:{label:`Done`,icon:h,text:`text-success`,ring:`border-success/35 bg-success/10`,dot:`bg-success`,hex:`hsl(var(--success))`},cancelled:{label:`Cancelled`,icon:d,text:`text-muted-foreground`,ring:`border-border/70 bg-muted/45`,dot:`bg-muted-foreground`,hex:`hsl(var(--muted-foreground))`}};function M(e){return j[e]??j.pending}var N={critical:{text:`text-destructive`,chip:`bg-destructive/10 text-destructive`},high:{text:`text-warning`,chip:`bg-warning/12 text-warning`},medium:{text:`text-primary`,chip:`bg-primary/10 text-primary`},low:{text:`text-muted-foreground`,chip:`bg-muted text-muted-foreground`}};function P(e){return N[e]??N.medium}var F={running:`border-primary/35 bg-primary/10 text-primary`,paused:`border-warning/35 bg-warning/10 text-warning`,stopped:`border-border/70 bg-muted text-muted-foreground`,completed:`border-success/35 bg-success/10 text-success`,failed:`border-destructive/35 bg-destructive/10 text-destructive`,deadlocked:`border-destructive/35 bg-destructive/10 text-destructive`,idle:`border-border bg-muted text-muted-foreground`},I=[`bg-warning`,`bg-primary`,`bg-success`,`bg-destructive`,`bg-secondary`,`bg-muted-foreground`,`bg-accent`],L={started:{icon:u,color:`text-warning`},completed:{icon:h,color:`text-success`},failed:{icon:i,color:`text-destructive`},retrying:{icon:l,color:`text-warning`},wave:{icon:p,color:`text-primary`},deadlock:{icon:m,color:`text-destructive`},verification_failed:{icon:s,color:`text-destructive`},conflict:{icon:g,color:`text-warning`},split:{icon:c,color:`text-primary`},supervisor:{icon:f,color:`text-primary`}};function R(e){let t=e.trim().split(/\s+/);return((t[0]?.[0]??``)+(t[1]?.[0]??``)).toUpperCase()||`·`}function z(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?t%60?`${n}m ${t%60}s`:`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function B(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m`:`${Math.floor(r/60)}h`}var V=300,H=128,U=240,W={pending:{ring:`border-border/70`,chip:`bg-muted text-muted-foreground`,dot:`bg-muted-foreground`},queued:{ring:`border-primary/35`,chip:`bg-primary/10 text-primary`,dot:`bg-primary`},in_progress:{ring:`border-warning/45`,chip:`bg-warning/12 text-warning`,dot:`bg-warning`},blocked:{ring:`border-destructive/30`,chip:`bg-destructive/10 text-destructive`,dot:`bg-destructive`},review:{ring:`border-primary/35`,chip:`bg-primary/10 text-primary`,dot:`bg-primary`},failed:{ring:`border-destructive/45`,chip:`bg-destructive/10 text-destructive`,dot:`bg-destructive`},completed:{ring:`border-success/35`,chip:`bg-success/12 text-success`,dot:`bg-success`},cancelled:{ring:`border-border/70`,chip:`bg-muted text-muted-foreground`,dot:`bg-muted-foreground`}};function G({data:e}){let t=e.task,{t:n}=r(),s=W[t.displayStatus],c=t.displayStatus===`in_progress`,u=t.displayStatus===`completed`?h:t.displayStatus===`failed`?i:c?a:o;return(0,k.jsxs)(`div`,{className:D(`sdd-node-enter group relative rounded-lg border bg-card/95 px-2.5 py-2 text-left shadow-lg backdrop-blur`,s.ring,c&&`sdd-node-running`,t.displayStatus===`completed`&&`sdd-node-complete`,t.displayStatus===`failed`&&`sdd-node-failed`,e.onTaskClick&&`hover:brightness-125`),style:{width:U,animationDelay:`${Math.min(e.index*45,600)}ms`},children:[e.onTaskClick&&(0,k.jsx)(`button`,{type:`button`,"aria-label":n(`activity:sdd.openTask`,{title:t.title,defaultValue:`Open task: ${t.title}`}),className:`absolute inset-0 z-10 cursor-pointer rounded-lg`,onClick:()=>e.onTaskClick?.(t.id)}),(0,k.jsx)(v,{type:`target`,position:b.Left,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-border`}),(0,k.jsx)(v,{type:`source`,position:b.Right,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-border`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,k.jsx)(u,{className:D(`h-3.5 w-3.5`,c&&`animate-spin`,s.chip.split(` `).find(e=>e.startsWith(`text`)))}),(0,k.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:t.shortId}),(0,k.jsx)(`span`,{className:D(`font-mono text-[10px] font-bold uppercase`,P(t.priority).text),children:t.priority[0]}),(0,k.jsx)(`span`,{className:D(`ml-auto rounded px-1.5 py-px text-[9px] font-medium`,s.chip),children:n(`activity:sdd.status.${t.displayStatus}`)})]}),(0,k.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-foreground`,children:t.title}),(t.agentName||t.worktreeBranch)&&(0,k.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[t.agentName&&(0,k.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,k.jsx)(`span`,{className:D(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,c?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:R(t.agentName)}),(0,k.jsx)(`span`,{className:`max-w-[88px] truncate text-[10px] text-muted-foreground`,children:t.agentName})]}),t.retries?(0,k.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-destructive`,children:[(0,k.jsx)(l,{className:`h-2.5 w-2.5`}),t.retries]}):null,t.worktreeBranch&&(0,k.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5 text-[9px] text-muted-foreground`,title:t.worktreeBranch,children:[(0,k.jsx)(_,{className:`h-2.5 w-2.5`}),(0,k.jsx)(`span`,{className:`max-w-[70px] truncate`,children:t.worktreeBranch.replace(/^.*\//,``)})]})]})]})}function K({data:e}){return(0,k.jsx)(`div`,{className:`whitespace-nowrap text-[11px] font-bold uppercase text-muted-foreground`,children:e.label})}var q={task:G,colLabel:K};function J(e,t,n){let r=new Map(e.map(e=>[e.shortId,e])),i=[],a=0;t.forEach((e,t)=>{i.push({id:`__col_${t}`,position:{x:t*V,y:-52},data:{label:e.label},draggable:!1,selectable:!1,type:`colLabel`,style:{pointerEvents:`none`}}),e.taskIds.forEach((e,o)=>{let s=r.get(e);s&&i.push({id:s.id,position:{x:t*V,y:o*H},data:{task:s,index:a++,onTaskClick:n},type:`task`,draggable:!0})})});let o=[];for(let t of e)for(let e of t.deps){let n=r.get(e);if(!n)continue;let i=n.displayStatus===`completed`&&(t.displayStatus===`in_progress`||t.displayStatus===`queued`);o.push({id:`${n.id}->${t.id}`,source:n.id,target:t.id,animated:i,className:i?`sdd-edge-flow`:void 0,style:{stroke:M(t.displayStatus).hex,strokeWidth:i?2.2:1.4,opacity:t.displayStatus===`pending`?.4:.85}})}return{nodes:i,edges:o}}function Y({tasks:e,columns:t,onTaskClick:n}){let{fitView:r}=C(),{nodes:i,edges:a}=(0,O.useMemo)(()=>J(e,t,n),[e,t,n]),o=e.length;return(0,O.useEffect)(()=>{let e=setTimeout(()=>r({padding:.18,duration:400}),60);return()=>clearTimeout(e)},[o,r]),(0,k.jsxs)(E,{nodes:i,edges:a,nodeTypes:q,fitView:!0,fitViewOptions:{padding:.18},minZoom:.2,maxZoom:1.6,proOptions:{hideAttribution:!0},nodesConnectable:!1,elementsSelectable:!!n,children:[(0,k.jsx)(T,{variant:x.Dots,gap:22,size:1,color:`hsl(var(--border))`}),(0,k.jsx)(w,{showInteractive:!1,className:`!bottom-2 !left-2`}),(0,k.jsx)(S,{pannable:!0,zoomable:!0,nodeStrokeWidth:2,maskColor:`hsl(var(--background) / 0.65)`,nodeColor:e=>{let t=e.data?.task?.displayStatus;return t?M(t).hex:`hsl(var(--muted-foreground))`},className:`!bottom-2 !right-2 !h-24 !w-40 overflow-hidden rounded-md border border-border/70 bg-card`})]})}function X({tasks:e,columns:t,onTaskClick:n}){return(0,k.jsx)(y,{children:(0,k.jsx)(Y,{tasks:e,columns:t,onTaskClick:n})})}export{R as a,P as c,F as i,M as l,I as n,B as o,L as r,z as s,X as t,A as u};
|