pisper 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/package.json +6 -6
  2. package/web/.vite/manifest.json +315 -377
  3. package/web/assets/{AppDialog-BOGrPFbo.js → AppDialog-DW5knado.js} +1 -1
  4. package/web/assets/{AppOverlays-D1vfPPIC.js → AppOverlays-Bp8RcUF5.js} +1 -1
  5. package/web/assets/AppSelect-D149YYg1.js +1 -0
  6. package/web/assets/{AppShortcuts-Dd4gu7qz.js → AppShortcuts-D1jjdZDS.js} +1 -1
  7. package/web/assets/{AssetsPage-BPhPo5eU.js → AssetsPage-C7AlHS3s.js} +1 -1
  8. package/web/assets/{ChannelsPage-Cu4v-GU2.js → ChannelsPage-BJltcbA8.js} +1 -1
  9. package/web/assets/ChatAppearancePage-BXvAK8yY.js +2 -0
  10. package/web/assets/{ChatHistoryPage-BYqJFbY5.js → ChatHistoryPage-D3fm9Tw9.js} +1 -1
  11. package/web/assets/ChatPage-BFJm1sNL.js +554 -0
  12. package/web/assets/{ConfigPage-Z-BQwP2X.js → ConfigPage-DLgNJdgQ.js} +1 -1
  13. package/web/assets/{DecisionsPage-Db6MIGD2.js → DecisionsPage-57a_ZuRk.js} +1 -1
  14. package/web/assets/{DesktopWindowControls-CBYGv94u.js → DesktopWindowControls-xHry1hUJ.js} +1 -1
  15. package/web/assets/{FloatingWidgets-dzsQIxAO.js → FloatingWidgets-CJQjpX-U.js} +1 -1
  16. package/web/assets/{GitDiffViewer-m5aLB7Li.js → GitDiffViewer-91SrTCWo.js} +1 -1
  17. package/web/assets/{MarkdownMessage-CA9ODRKk.js → MarkdownMessage-DeTzbwid.js} +1 -1
  18. package/web/assets/{McpPage-rerFxjYZ.js → McpPage-CTJ_aKOo.js} +1 -1
  19. package/web/assets/{MemoryPage-cukfU824.js → MemoryPage-DRTc4YT9.js} +1 -1
  20. package/web/assets/MobileContextScreen-CnaR6ssx.js +2 -0
  21. package/web/assets/{MobileNavigation-CEVgs1Ke.js → MobileNavigation-Cw7L9pSg.js} +1 -1
  22. package/web/assets/{PageHeader-DIs9bESb.js → PageHeader-B2qhKXvC.js} +1 -1
  23. package/web/assets/{PluginsPage-09Um3mY4.js → PluginsPage-DVCWLVRB.js} +1 -1
  24. package/web/assets/{QuickPromptIdeas-DGIL0nN7.js → QuickPromptIdeas-xQFMgSGF.js} +1 -1
  25. package/web/assets/{SchedulesPage-C75QUeB5.js → SchedulesPage-B_YjdfoV.js} +1 -1
  26. package/web/assets/SessionContextPanel-BwHEDkJE.js +1 -0
  27. package/web/assets/{SessionFilesPane-DPijesqH.js → SessionFilesPane-CUhqwp87.js} +2 -2
  28. package/web/assets/{SidebarMoreTools-D1nDS3i0.js → SidebarMoreTools-BHJuLoCs.js} +1 -1
  29. package/web/assets/SidebarRecentSessions-CVIFZ66b.js +2 -0
  30. package/web/assets/{SidebarSettingsButton-CRdV0Vft.js → SidebarSettingsButton-5N0RlmoI.js} +1 -1
  31. package/web/assets/{SidebarUpdateStatus-DgNJBwgT.js → SidebarUpdateStatus-CVxo4zaS.js} +1 -1
  32. package/web/assets/{SkillsPage-DLirgTyX.js → SkillsPage-KsP2YFgx.js} +1 -1
  33. package/web/assets/{TerminalPanel-CJPy4Qhs.js → TerminalPanel-PK0ubUYF.js} +1 -1
  34. package/web/assets/{ThemeToggleButton-C5QA5Kf2.js → ThemeToggleButton-BFby07PX.js} +1 -1
  35. package/web/assets/{WebDesktopPet-DgyHLE9y.js → WebDesktopPet-juirMq3L.js} +1 -1
  36. package/web/assets/{WorkbenchSidebarToggle-CcO1Al5A.js → WorkbenchSidebarToggle-B-YDZEZn.js} +1 -1
  37. package/web/assets/WorkflowsPage-Bsw_TnA6.js +1 -0
  38. package/web/assets/WorkspacePicker-CDJPgjpW.js +1 -0
  39. package/web/assets/{api-YI8_cHpR.js → api-DmuPqjXK.js} +1 -1
  40. package/web/assets/{app-primitives-SxfoFmHc.js → app-primitives-BBXY6U2S.js} +1 -1
  41. package/web/assets/catalog-Cs8cjmnr.js +1 -0
  42. package/web/assets/{chat-api-CqF-FICX.js → chat-api-cEcUMaNX.js} +1 -1
  43. package/web/assets/{client-store-BP_3-plw.js → client-store-CV7NgPf7.js} +1 -1
  44. package/web/assets/{component-api-CN9Tcn5p.js → component-api-guxJtKAP.js} +1 -1
  45. package/web/assets/{config-search-DOIJENN1.js → config-search-DzgcCirf.js} +1 -1
  46. package/web/assets/dist-DAs5KRGl.js +1 -0
  47. package/web/assets/dist-swnK7PHk.js +1 -0
  48. package/web/assets/{dropdown-menu-pKRdLJUe.js → dropdown-menu-DmL4pJTo.js} +1 -1
  49. package/web/assets/{events-KqdUtjsm.js → events-DjkpUZEu.js} +1 -1
  50. package/web/assets/{floating-widgets-store-Pjm1AdvO.js → floating-widgets-store-C3frcaki.js} +2 -2
  51. package/web/assets/{http-Be2GB6DH.js → http-C4bTWPzF.js} +1 -1
  52. package/web/assets/i18n-DKgrgj0w.js +1 -0
  53. package/web/assets/index-DJAtBVyc.css +2 -0
  54. package/web/assets/{index-AF29hfx9.js → index-Dm1UDg72.js} +2 -2
  55. package/web/assets/mount-app-Brtj-l-d.js +9 -0
  56. package/web/assets/panels-top-left-K8n2CefH.js +1 -0
  57. package/web/assets/{popover-CQqAaq-c.js → popover-BgmMy1PJ.js} +1 -1
  58. package/web/assets/public-BDXsCmtv.js +1 -0
  59. package/web/assets/{public-components-C4ndcOCF.js → public-components-w2PENGYg.js} +1 -1
  60. package/web/assets/{runtime-capabilities-store-CiL3ZPEo.js → runtime-capabilities-store-1N8axw9r.js} +1 -1
  61. package/web/assets/{session-change-summary-api--7cl4LDn.js → session-change-summary-api-BQILNzT4.js} +1 -1
  62. package/web/assets/{session-context-store-DJnHgWwb.js → session-context-store-DQHmNaRN.js} +1 -1
  63. package/web/assets/{session-list-DkNhT87s.js → session-list-JA31_Ff4.js} +1 -1
  64. package/web/assets/{settings-navigation-CI7Yt4Or.js → settings-navigation-dqR4yOPY.js} +1 -1
  65. package/web/assets/{shortcuts-C_Cph88H.js → shortcuts-CAX2SVZi.js} +1 -1
  66. package/web/assets/{side-chat-context-Dn8w9ut8.js → side-chat-context-B0oP2eS-.js} +2 -2
  67. package/web/assets/{speech-session-CoUr4n9Q.js → speech-session-C-vI4YXQ.js} +1 -1
  68. package/web/assets/{startup-queries-ByepQfGF.js → startup-queries-Ci3kCPI9.js} +1 -1
  69. package/web/assets/tabs-DQYVDdOp.js +1 -0
  70. package/web/assets/{ui-store-BGs-dEVz.js → ui-store-DLloh4Rv.js} +1 -1
  71. package/web/assets/{use-i18n-a84Zp9dV.js → use-i18n-C7st2Mx5.js} +1 -1
  72. package/web/assets/{useCustomUiComponents-BaQ_fwbr.js → useCustomUiComponents-B5fflBrn.js} +1 -1
  73. package/web/index.html +2 -2
  74. package/web/assets/AppSelect-BCexz4Ty.js +0 -1
  75. package/web/assets/ChatAppearancePage-BLRQ7aH6.js +0 -2
  76. package/web/assets/ChatPage-tqAIj2Go.js +0 -554
  77. package/web/assets/MobileContextScreen-W8V4H3Xv.js +0 -2
  78. package/web/assets/SessionContextPanel-oaKXyi7k.js +0 -1
  79. package/web/assets/SidebarRecentSessions-a7z2ZvDv.js +0 -2
  80. package/web/assets/WorkflowsPage-DrKHzJvb.js +0 -1
  81. package/web/assets/WorkspacePicker-B3liZkwe.js +0 -1
  82. package/web/assets/arrow-up-DST6-qVQ.js +0 -1
  83. package/web/assets/catalog-BPCnu3F8.js +0 -1
  84. package/web/assets/dist-B7rNRXig.js +0 -1
  85. package/web/assets/dist-C3P9WH0T.js +0 -1
  86. package/web/assets/dist-CXiO_DNx.js +0 -1
  87. package/web/assets/dist-D8Wfxh48.js +0 -1
  88. package/web/assets/folder-DPM8D8cf.js +0 -1
  89. package/web/assets/house-BNrzTkx9.js +0 -1
  90. package/web/assets/i18n-8nTnthu6.js +0 -1
  91. package/web/assets/index-BAmsg90v.css +0 -2
  92. package/web/assets/mount-app-WW5hteuX.js +0 -9
  93. package/web/assets/panels-top-left-BlZftvhg.js +0 -1
  94. package/web/assets/public-c36e4881.js +0 -1
  95. package/web/assets/tabs-B60r4YwO.js +0 -1
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-a84Zp9dV.js";import{t as i}from"./AppSelect-BCexz4Ty.js";import{i as a,n as o,t as s}from"./tooltip-Bxq7c2mZ.js";import{t as c}from"./createLucideIcon-Cd-3GVxJ.js";import{t as l}from"./check-2vYc6QaP.js";import{t as u}from"./chevron-right-C3t2Rckj.js";import{t as d}from"./file-code-corner-BnE1ljT0.js";import{t as ee}from"./info-DATxy0fb.js";import{t as f}from"./loader-circle-BOwQzHB-.js";import{t as p}from"./pencil-U08v_vV9.js";import{t as te}from"./plus-fQbSqB1n.js";import{t as ne}from"./refresh-cw-TbWxTY4K.js";import{t as re}from"./trash-2-CNrPOoPR.js";import{t as m}from"./x-07u4-129.js";import{t as h}from"./api-YI8_cHpR.js";import{t as g}from"./button-CQA36izu.js";import{t as _}from"./field-3bN8nouy.js";import{i as v,n as y,o as b,t as x}from"./app-primitives-SxfoFmHc.js";import{t as ie}from"./StarOrbit-BAAjh-hY.js";import{t as ae}from"./usePagePrimaryAction-CWPC0C_f.js";var oe=c(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),se=c(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),S=e(t(),1);function ce(e={}){let{rootMargin:t=`96px 0px`,threshold:n=0}=e,[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(()=>!document.hidden),[s,c]=(0,S.useState)(!0),l=(0,S.useCallback)(e=>{i(e)},[]);return(0,S.useEffect)(()=>{let e=()=>o(!document.hidden);return e(),document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,S.useEffect)(()=>{if(!r||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>{e&&c(e.isIntersecting)},{rootMargin:t,threshold:n});return e.observe(r),()=>e.disconnect()},[r,t,n]),{ref:l,playing:a&&s}}var C=n(),w={width:600,height:420,cx:300,cy:206},T=24,le=Math.PI*(3-Math.sqrt(5)),ue=[`concept`,`file`,`risk`,`preference`,`decision`,`fact`,`task`];function de(e,t){return t(e===`file`?`memory:memoryPage.fileType`:e===`risk`?`memory:memoryPage.riskType`:e===`preference`?`memory:memoryPage.preferenceType`:e===`decision`?`memory:memoryPage.decisionType`:e===`fact`?`memory:memoryPage.factType`:e===`task`?`memory:memoryPage.taskType`:`memory:memoryPage.conceptType`)}var fe={concept:`var(--g-concept)`,file:`var(--g-file)`,risk:`var(--g-risk)`,preference:`var(--g-preference)`,decision:`var(--g-decision)`,fact:`var(--g-fact)`,task:`var(--g-task)`},pe={concept:`var(--g-concept-glow)`,file:`var(--g-file-glow)`,risk:`var(--g-risk-glow)`,preference:`var(--g-preference-glow)`,decision:`var(--g-decision-glow)`,fact:`var(--g-fact-glow)`,task:`var(--g-task-glow)`};function E(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function me(e,t){let n=e.slice(0,T);if(!n.length)return[];if(n.length===1)return[{node:n[0],x:w.cx,y:w.cy,twinkle:0}];let r=E(t||`galaxy`)%628/100,i=172/Math.sqrt(n.length);return n.map((e,t)=>{let n=E(e.id),a=t*le+r,o=i*Math.sqrt(t+.55)+n%11-5;return{node:e,x:w.cx+Math.cos(a)*o*1.38,y:w.cy+Math.sin(a)*o*.74,twinkle:n%50/10}})}function D(e,t=`zh-CN`){if(!e)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(n)}function O(e,t=e=>e){return e?.kind===`global`?t(`memory:memoryPage.globalMemorySpace`):e?.name||``}function he(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=Math.min(24,a*.16)*(n%2==0?1:-1),s=(e.x+t.x)/2-i/a*o,c=(e.y+t.y)/2+r/a*o;return`M ${e.x.toFixed(1)} ${e.y.toFixed(1)} Q ${s.toFixed(1)} ${c.toFixed(1)} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}function k(e){return e instanceof Error?e.message:String(e)}function A({notify:e,query:t=``,registerPrimaryAction:n,requestConfirm:i}){let{t:c,language:_}=r(),[T,le]=(0,S.useState)({spaces:[],nodes:[],links:[],candidates:[],selectedSpaceId:``}),[A,j]=(0,S.useState)(``),[M,N]=(0,S.useState)(``),P=(0,S.useRef)(0),[ve,ye]=(0,S.useState)(!0),[be,F]=(0,S.useState)(``),[xe,Se]=(0,S.useState)(1),[I,L]=(0,S.useState)(null),[R,z]=(0,S.useState)(null),[Ce,we]=(0,S.useState)(``),[B,V]=(0,S.useState)(``),[H,U]=(0,S.useState)(null),[W,Te]=(0,S.useState)(!1),G=(0,S.useRef)(null),K=(0,S.useRef)(0),{ref:Ee,playing:q}=ce(),De=(0,S.useCallback)(e=>{G.current=e,Ee(e)},[Ee]),Oe=q?``:`[&:before]:[animation-play-state:paused]! [&:after]:[animation-play-state:paused]! [&_*]:[animation-play-state:paused]! [&_*:before]:[animation-play-state:paused]! [&_*:after]:[animation-play-state:paused]!`;ae(n,()=>L({spaceId:A||T.selectedSpaceId}));let ke=e=>{if(!q)return;let t=G.current;if(!t)return;let n=t.getBoundingClientRect(),r=((e.clientX-n.left)/n.width-.5)*2,i=((e.clientY-n.top)/n.height-.5)*2;cancelAnimationFrame(K.current),K.current=requestAnimationFrame(()=>{t.style.setProperty(`--px`,r.toFixed(3)),t.style.setProperty(`--py`,i.toFixed(3))})},Ae=()=>{cancelAnimationFrame(K.current),G.current?.style.setProperty(`--px`,`0`),G.current?.style.setProperty(`--py`,`0`)};(0,S.useEffect)(()=>{q||(cancelAnimationFrame(K.current),K.current=0)},[q]),(0,S.useEffect)(()=>{let e=G.current?.querySelector(`svg`);e&&(q?e.unpauseAnimations():e.pauseAnimations())},[q]);let J=(0,S.useCallback)(async(e=``)=>{let n=++P.current;ye(!0),F(``);try{let r=new URLSearchParams;e&&r.set(`spaceId`,e),t.trim()&&r.set(`query`,t.trim());let i=await h(`/api/memory?${r}`);if(n!==P.current)return;le(i),j(i.selectedSpaceId||``),N(e=>i.nodes.some(t=>t.id===e)?e:i.nodes[0]?.id||``)}catch(e){n===P.current&&F(k(e))}finally{n===P.current&&ye(!1)}},[t]);(0,S.useEffect)(()=>(J(A),()=>{P.current+=1}),[J,A]),(0,S.useEffect)(()=>{let e=!0;return h(`/api/settings/memory`).then(t=>e&&U(t.autoApproveConfidence)).catch(()=>e&&U(60)),()=>{e=!1}},[]);let je=async()=>{let t=H;if(t===null||W)return;let n=Math.min(100,Math.max(0,Math.round(t)));n!==t&&U(n),Te(!0);try{await h(`/api/settings/memory`,{method:`PATCH`,body:{autoApproveConfidence:n}}),e(c(`memory:memoryPage.autoApproveSaved`))}catch(e){F(k(e))}finally{Te(!1)}},Y=T.nodes.find(e=>e.id===M)||null,X=(0,S.useMemo)(()=>me(T.nodes,A),[T.nodes,A]),Z=(0,S.useMemo)(()=>new Map(X.map(e=>[e.node.id,e])),[X]),Me=(0,S.useMemo)(()=>{let e=new Set(X.map(e=>e.node.id));return T.links.filter(t=>e.has(t.sourceId)&&e.has(t.targetId))},[X,T.links]),Ne=new Set(T.links.flatMap(e=>e.sourceId===M?[e.targetId]:e.targetId===M?[e.sourceId]:[])),Q=Ce||M,Pe=new Set(T.links.flatMap(e=>e.sourceId===Q?[e.targetId]:e.targetId===Q?[e.sourceId]:[])),Fe=T.nodes.filter(e=>e.type===`file`&&(Ne.has(e.id)||e.id===M)),$=T.spaces.find(e=>e.id===A),Ie=async t=>{if(await i({title:c(`memory:memoryPage.deleteMemory`),message:c(`memory:memoryPage.deleteMemoryName`,{name:t.title}),confirmLabel:c(`memory:memoryPage.delete`)}))try{await h(`/api/memory/nodes/${encodeURIComponent(t.id)}`,{method:`DELETE`}),e(c(`memory:memoryPage.memoryDeleted`)),await J(A)}catch(e){F(k(e))}},Le=async(t,n)=>{if(!B){V(t.id),F(``);try{await h(`/api/memory/candidates/${encodeURIComponent(t.id)}/${n}`,{method:`POST`,body:`{}`}),e(c(n===`accept`?`memory:memoryPage.memoryCandidateConfirmed`:`memory:memoryPage.memoryCandidateIgnored`)),await J(A)}catch(e){F(k(e))}finally{V(``)}}};return(0,C.jsxs)(`div`,{className:`memory-layout max-[1150px]:grid-cols-[220px_minmax(340px,1fr)] max-[650px]:grid-cols-[1fr] grid min-h-[100%] grid-cols-[230px_minmax(360px,1fr)_290px] gap-[12px]`,children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-[12px]`,children:[(0,C.jsxs)(x,{className:`wiki-panel [&_>_button]:grid [&_>_button]:w-full [&_>_button]:grid-cols-[minmax(0,1fr)_auto_auto] [&_>_button]:items-center [&_>_button]:gap-[6px] [&_>_button]:border-0 [&_>_button]:[border-top:1px_solid_var(--stroke-soft)] [&_>_button]:bg-transparent [&_>_button]:p-[9px_5px] [&_>_button]:text-left [&_>_button]:text-[12px] [&_>_button.active]:rounded-[var(--r-xs)] [&_>_button.active]:bg-[var(--accent-soft)] [&_>_button_small]:text-[var(--text-muted)] [&_>_button_small]:text-[13px]`,children:[(0,C.jsxs)(y,{children:[(0,C.jsx)(b,{title:c(`memory:memoryPage.memorySpaces`)}),(0,C.jsx)(g,{variant:`ghost`,size:`icon`,title:c(`memory:memoryPage.newMemorySpace`),onClick:()=>z({}),children:(0,C.jsx)(te,{size:13})})]}),T.spaces.map(e=>(0,C.jsxs)(`button`,{className:e.id===A?`active`:``,onClick:()=>{j(e.id),N(``)},children:[(0,C.jsx)(`span`,{children:O(e,c)}),(0,C.jsx)(`small`,{children:c(`memory:memoryPage.countMemories`,{count:e.nodeCount})}),(0,C.jsx)(u,{size:13})]},e.id)),$&&(0,C.jsxs)(`div`,{className:`memory-space-actions [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[13px] [&_button.danger]:text-[var(--danger)] flex gap-[6px] [margin-top:10px] [border-top:1px_solid_var(--stroke-soft)] [padding-top:9px]`,children:[(0,C.jsxs)(`button`,{onClick:()=>z($),children:[(0,C.jsx)(p,{size:12}),c(`memory:memoryPage.rename`)]}),$.kind!==`global`&&(0,C.jsxs)(`button`,{className:`danger`,onClick:async()=>{if($&&await i({title:c(`memory:memoryPage.deleteMemorySpace`),message:c(`memory:memoryPage.deleteMemorySpaceNameAndAllMemoriesInIt`,{name:O($,c)}),confirmLabel:c(`memory:memoryPage.delete`)}))try{await h(`/api/memory/spaces/${encodeURIComponent($.id)}`,{method:`DELETE`}),j(``),N(``),e(c(`memory:memoryPage.memorySpaceDeleted`))}catch(e){F(k(e))}},children:[(0,C.jsx)(re,{size:12}),c(`memory:memoryPage.delete`)]})]})]}),(0,C.jsxs)(x,{className:`memory-legend-panel`,children:[(0,C.jsx)(b,{title:c(`memory:memoryPage.memoryMapTypes`)}),(0,C.jsx)(`div`,{className:`galaxy-legend [&_span]:flex [&_span]:items-center [&_span]:gap-[7px] [&_span]:text-[var(--text-soft)] [&_span]:text-[12px] grid grid-cols-[repeat(2,minmax(0,1fr))] gap-[8px_10px] [margin-top:11px]`,children:ue.map(e=>(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`i`,{className:`g-dot [&.g-concept]:bg-[var(--g-concept)] [&.g-concept]:shadow-[0_0_5px_var(--g-concept-glow)] [&.g-file]:bg-[var(--g-file)] [&.g-file]:shadow-[0_0_5px_var(--g-file-glow)] [&.g-risk]:bg-[var(--g-risk)] [&.g-risk]:shadow-[0_0_5px_var(--g-risk-glow)] [&.g-preference]:bg-[var(--g-preference)] [&.g-preference]:shadow-[0_0_5px_var(--g-preference-glow)] [&.g-decision]:bg-[var(--g-decision)] [&.g-decision]:shadow-[0_0_5px_var(--g-decision-glow)] [&.g-fact]:bg-[var(--g-fact)] [&.g-fact]:shadow-[0_0_5px_var(--g-fact-glow)] [&.g-task]:bg-[var(--g-task)] [&.g-task]:shadow-[0_0_5px_var(--g-task-glow)] inline-block w-[7px] h-[7px] flex-none rounded-[50%] g-${e}`}),de(e,c)]},e))})]}),(0,C.jsxs)(x,{className:`min-h-0`,children:[(0,C.jsxs)(y,{children:[(0,C.jsx)(b,{title:`${c(`memory:memoryPage.memoryDrafts`)} · ${T.candidates?.length||0}`}),!!T.candidates?.length&&(0,C.jsxs)(g,{variant:`outline`,className:`bg-surface-subtle`,disabled:!!B,onClick:async()=>{if(!(B||!T.candidates?.length)){V(`__all__`),F(``);try{let t=await h(`/api/memory/candidates/reject-all`,{method:`POST`,body:`{}`});e(c(`memory:memoryPage.ignoredCountMemoryDrafts`,{count:t.rejected||0})),await J(A)}catch(e){F(k(e))}finally{V(``)}}},children:[(0,C.jsx)(m,{size:12}),c(`memory:memoryPage.ignoreAll`)]})]}),H!==null&&(0,C.jsxs)(`div`,{className:`memory-auto-approve-row [&_label]:flex [&_label]:min-w-0 [&_label]:flex-col [&_label]:gap-[2px] [&_label_span]:text-[12px] [&_label_span]:font-[600] [&_label_small]:text-[var(--text-muted)] [&_label_small]:text-[10px] [&_label_small]:leading-[1.4] flex items-center justify-between gap-[10px] [border-bottom:1px_solid_var(--stroke-soft)] [padding:8px_0_10px]`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-center gap-1`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.autoApproveThreshold`)}),(0,C.jsxs)(s,{children:[(0,C.jsx)(a,{asChild:!0,children:(0,C.jsx)(ee,{size:16})}),(0,C.jsx)(o,{align:`center`,side:`top`,children:c(`memory:memoryPage.autoApproveThresholdHint`)})]})]}),(0,C.jsxs)(`span`,{className:`memory-auto-approve-input [&_input]:w-[64px] [&_input]:[border:1px_solid_var(--stroke-soft)] [&_input]:rounded-[6px] [&_input]:bg-[var(--surface-muted)] [&_input]:p-[4px_6px] [&_input]:text-[var(--text)] [&_input]:text-[12px] [&_input]:text-right [&_em]:text-[var(--text-muted)] [&_em]:text-[11px] [&_em]:[font-style:normal] flex flex-none items-center gap-[5px]`,children:[(0,C.jsx)(`input`,{type:`number`,min:0,max:100,step:5,value:H,disabled:W,"aria-label":c(`memory:memoryPage.autoApproveThreshold`),onChange:e=>U(e.target.value?Number(e.target.value):0),onBlur:()=>void je(),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),je())}}),(0,C.jsx)(`em`,{children:`%`}),W&&(0,C.jsx)(f,{className:`animate-spin`,size:12})]})]}),(0,C.jsxs)(`div`,{className:`flex max-h-[300px] flex-col gap-[8px] overflow-auto mt-2`,children:[(T.candidates||[]).map(e=>(0,C.jsxs)(`div`,{className:`memory-candidate [&_>_strong]:text-[12px] [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[11px] [&_>_span]:leading-[1.45] [&_>_small]:text-[var(--text-muted)] [&_>_small]:text-[11px] [&_>_small]:leading-[1.45] [&_>_div]:flex [&_>_div]:gap-[6px] [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:[border:1px_solid_var(--stroke-soft)] [&_button]:rounded-[6px] [&_button]:bg-transparent [&_button]:p-[4px_7px] [&_button]:text-[var(--text)] [&_button]:text-[11px] [&_button.danger]:text-[var(--danger)] flex flex-col gap-[5px] [border:1px_solid_var(--stroke-soft)] rounded-[8px] bg-[var(--surface-muted)] [padding:8px]`,children:[(0,C.jsx)(`strong`,{children:e.title}),(0,C.jsxs)(`small`,{children:[O(T.spaces.find(t=>t.id===e.spaceId),c),` · `,e.sourceType===`agent`?c(`memory:memoryPage.agentProposed`):c(`memory:memoryPage.conversationExtracted`),` · `,c(`memory:memoryPage.confidencePercent`,{value:Math.round((e.confidence||0)*100)})]}),(0,C.jsx)(`span`,{children:e.content}),e.topicKey&&(0,C.jsxs)(`small`,{children:[c(`memory:memoryPage.topic`),`:`,e.topicKey]}),e.evidence&&(0,C.jsxs)(`small`,{children:[c(`memory:memoryPage.evidence`),`:`,e.evidence]}),(0,C.jsxs)(`small`,{children:[c(`memory:memoryPage.created`),`:`,D(e.createdAt,_),e.expiresAt?` · ${c(`memory:memoryPage.expires`)}:${D(e.expiresAt,_)}`:``]}),(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`button`,{disabled:!!B,title:c(`memory:memoryPage.confirm`),onClick:()=>Le(e,`accept`),children:[(0,C.jsx)(l,{size:12}),c(`memory:memoryPage.confirm`)]}),(0,C.jsxs)(`button`,{disabled:!!B,className:`danger`,title:c(`memory:memoryPage.ignore`),onClick:()=>Le(e,`reject`),children:[(0,C.jsx)(m,{size:12}),c(`memory:memoryPage.ignore`)]})]})]},e.id)),!T.candidates?.length&&(0,C.jsx)(`small`,{children:c(`memory:memoryPage.thereAreNoPendingMemoryCandidates`)})]})]})]}),(0,C.jsxs)(x,{className:`graph-panel before:[content:''] before:absolute before:z-[0] before:inset-0 before:pointer-events-none before:bg-[url('/memory-galaxy-background.webp')] before:[background-position:center_48%] before:[background-size:cover] before:bg-no-repeat before:[filter:saturate(.62)_contrast(1.08)] before:[mix-blend-mode:screen] before:opacity-[.42] after:[content:''] after:absolute after:z-[0] after:inset-0 after:pointer-events-none after:[background-image:radial-gradient(var(--galaxy-dot)_.9px,transparent_1.2px),_radial-gradient(var(--galaxy-dot-dim)_.8px,transparent_1.2px),_radial-gradient(var(--galaxy-dot)_1.2px,transparent_1.6px)] after:[background-position:0_0,_37px_53px,_71px_19px] after:[background-size:96px_96px,_152px_152px,_236px_236px] after:[animation:galaxy-field-twinkle_6.4s_ease-in-out_infinite] after:opacity-[.7] before:inset-[-8%] before:[animation:galaxy-background-drift_34s_ease-in-out_infinite_alternate] before:[will-change:transform] after:[animation:galaxy-field-drift_15s_ease-in-out_infinite_alternate] after:[will-change:background-position,opacity] max-[650px]:min-h-[430px] relative min-h-[500px] overflow-hidden [border-color:var(--galaxy-border)] bg-[var(--galaxy-bg)]! [background-image:radial-gradient(ellipse_46%_40%_at_50%_48%,_var(--galaxy-core),_transparent_72%),_radial-gradient(ellipse_62%_48%_at_16%_6%,_var(--galaxy-nebula-a),_transparent_70%),_radial-gradient(ellipse_56%_52%_at_88%_98%,_var(--galaxy-nebula-b),_transparent_72%)] p-0 backdrop-blur-none! galaxy-panel ${Oe}`,onPointerMove:ke,onPointerLeave:Ae,children:[(0,C.jsxs)(`div`,{className:`graph-toolbar [&_button]:grid [&_button]:w-[32px] [&_button]:h-[32px] [&_button]:place-items-center [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[12px] [.galaxy-panel_&]:border-[var(--galaxy-toolbar-border)] [.galaxy-panel_&]:bg-[var(--galaxy-toolbar-bg)] [.galaxy-panel_&]:text-[var(--galaxy-toolbar-text)] [.galaxy-panel_&]:[backdrop-filter:blur(9px)] [.galaxy-panel_&_button:hover]:bg-[var(--galaxy-toolbar-hover)] dark:bg-[var(--solid)] dark:text-[var(--text)] absolute z-[4] [top:10px] [left:10px] flex gap-[3px] [padding:3px] [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--solid)]`,children:[(0,C.jsx)(`button`,{title:c(`memory:memoryPage.addMemory`),onClick:()=>L({spaceId:A}),children:(0,C.jsx)(te,{size:14})}),(0,C.jsx)(`button`,{title:c(`memory:memoryPage.zoomIn`),onClick:()=>Se(e=>Math.min(1.6,Number((e+.15).toFixed(2)))),children:(0,C.jsx)(se,{size:13})}),(0,C.jsx)(`button`,{title:c(`memory:memoryPage.zoomOut`),onClick:()=>Se(e=>Math.max(.7,Number((e-.15).toFixed(2)))),children:(0,C.jsx)(oe,{size:13})}),(0,C.jsx)(`button`,{title:c(`memory:memoryPage.refresh`),onClick:()=>J(A),children:(0,C.jsx)(ne,{className:ve?`animate-spin`:``,size:13})})]}),(0,C.jsxs)(`div`,{className:`galaxy-stage [&_>_svg]:absolute [&_>_svg]:inset-0 [&_>_svg]:w-full [&_>_svg]:h-full [&_>_svg]:overflow-visible [&_>_svg]:z-[1] [&_>_svg]:[transform:translate3d(calc(var(--px,0)_*_9px),calc(var(--py,0)_*_6px),0)] [&_>_svg]:[transition:transform_.9s_var(--ease-out)] absolute z-[1] inset-0 [transform-origin:50%_50%] [transition:transform_var(--d2)_var(--ease-out)] ${Q?`has-focus`:``}`,ref:De,style:{transform:`scale(${xe})`},children:[(0,C.jsx)(`i`,{className:`galaxy-spiral absolute z-[0] block pointer-events-none [left:9%] [top:13%] w-[82%] h-[74%] rounded-[50%] bg-[conic-gradient(from_-18deg,transparent_0deg,var(--galaxy-nebula-a)_28deg,transparent_68deg,var(--galaxy-nebula-b)_118deg,transparent_170deg,var(--galaxy-nebula-a)_224deg,transparent_278deg,var(--galaxy-nebula-b)_322deg,transparent_360deg)] [filter:blur(13px)] [mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [-webkit-mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [mix-blend-mode:screen] opacity-[.38] [animation:galaxy-spiral-turn_42s_linear_infinite] [will-change:transform]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-core absolute z-[0] block pointer-events-none before:[content:''] before:absolute before:left-[50%] before:top-[50%] before:w-[46px] before:h-[46px] before:rounded-[50%] before:bg-[radial-gradient(circle,rgba(255,255,255,.82),rgba(191,219,254,.3)_55%,transparent_76%)] before:[filter:blur(6px)] before:[transform:translate(-50%,-50%)] [left:50%] [top:49%] w-[34%] h-[40%] rounded-[50%] bg-[radial-gradient(ellipse,rgba(219,232,255,.3)_0%,rgba(126,156,255,.15)_36%,transparent_70%)] [filter:blur(9px)] [mix-blend-mode:screen] [transform:translate(-50%,-50%)] [animation:galaxy-core-breathe_7.5s_ease-in-out_infinite] [will-change:transform,opacity]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [left:8%] [top:20%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-a),transparent_70%)] [animation:galaxy-aurora-drift_18s_ease-in-out_infinite_alternate]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [right:5%] [bottom:14%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-b),transparent_70%)] [animation:galaxy-aurora-drift_23s_ease-in-out_-9s_infinite_alternate-reverse]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] galaxy-aurora-three left-[30%] top-[60%] !w-[40%] !h-[27%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-c),transparent_70%)] [animation:galaxy-aurora-drift_27s_ease-in-out_-14s_infinite_alternate]`,"aria-hidden":`true`}),(0,C.jsxs)(`svg`,{viewBox:`0 0 600 420`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,C.jsxs)(`g`,{className:`galaxy-orbits [&_ellipse]:[fill:none] [&_ellipse]:[stroke:var(--galaxy-line)] [&_ellipse]:[stroke-width:.72] [&_ellipse]:[stroke-dasharray:3_7] [&_ellipse]:opacity-[.52] [transform-box:fill-box] [transform-origin:center] [animation:galaxy-orbit-drift_90s_linear_infinite]`,children:[(0,C.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`205`,ry:`122`,transform:`rotate(-8 300 206)`}),(0,C.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`154`,ry:`88`,transform:`rotate(18 300 206)`}),(0,C.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`95`,ry:`54`,transform:`rotate(-24 300 206)`})]}),(0,C.jsx)(`defs`,{children:Me.map((e,t)=>{let n=Z.get(e.sourceId),r=Z.get(e.targetId);return!n||!r?null:(0,C.jsxs)(`linearGradient`,{id:`lg-${t}`,gradientUnits:`userSpaceOnUse`,x1:n.x,y1:n.y,x2:r.x,y2:r.y,children:[(0,C.jsx)(`stop`,{offset:`0`,stopColor:fe[n.node.type]||`var(--galaxy-line-active)`}),(0,C.jsx)(`stop`,{offset:`1`,stopColor:fe[r.node.type]||`var(--galaxy-line-active)`})]},e.id)})}),Me.map((e,t)=>{let n=Z.get(e.sourceId),r=Z.get(e.targetId);if(!n||!r)return null;let i=e.sourceId===Q||e.targetId===Q,a=he(n,r,E(e.id));return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(`path`,{className:`link-path [.galaxy-stage_>_svg_&]:[fill:none] [.galaxy-stage_>_svg_&]:[stroke-width:1.05] [.galaxy-stage_>_svg_&]:[stroke-dasharray:3_5] [.galaxy-stage_>_svg_&]:opacity-[.5] [.galaxy-stage_>_svg_&]:[animation:galaxy-link-flow_30s_linear_infinite] [.galaxy-stage_>_svg_&]:[transition:opacity_var(--d2)_var(--ease-out)] [.galaxy-stage_>_svg_&.active]:[stroke-width:1.55] [.galaxy-stage_>_svg_&.active]:[stroke-dasharray:none] [.galaxy-stage_>_svg_&.active]:opacity-100 [.galaxy-stage_>_svg_&.active]:[filter:drop-shadow(0_0_3.5px_var(--galaxy-line-active))] [.galaxy-stage.has-focus_&]:opacity-[.14] [.galaxy-stage.has-focus_&.active]:opacity-100 ${i?`active`:``}`,d:a,stroke:`url(#lg-${t})`}),i&&(0,C.jsx)(`circle`,{className:`link-pulse [.galaxy-stage_>_svg_&]:[fill:var(--g-star-core)] [.galaxy-stage_>_svg_&]:[filter:drop-shadow(0_0_4px_var(--galaxy-line-active))] [.galaxy-stage_>_svg_&]:pointer-events-none`,r:`2.1`,children:(0,C.jsx)(`animateMotion`,{dur:`2.8s`,repeatCount:`indefinite`,path:a})})]},e.id)})]}),(0,C.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-two [.galaxy-meteor&]:top-[63%] [.galaxy-meteor&]:left-[89%] [.galaxy-meteor&]:[animation:galaxy-meteor-b_17s_linear_4.5s_infinite]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-three [.galaxy-meteor&]:top-[7%] [.galaxy-meteor&]:left-[36%] [.galaxy-meteor&]:[animation:galaxy-meteor-c_23s_linear_11s_infinite]`,"aria-hidden":`true`}),X.map(({node:e,x:t,y:n,twinkle:r},i)=>(0,C.jsxs)(`button`,{className:`galaxy-star focus-visible:rounded-[50%] focus-visible:[outline-color:var(--galaxy-line-active)] before:[content:''] before:absolute before:w-[calc(var(--star-size)_+_26px)] before:h-[calc(var(--star-size)_+_26px)] before:rounded-[50%] before:bg-[radial-gradient(circle,var(--g-star-glow),transparent_68%)] before:[filter:blur(3px)] before:opacity-[.76] before:pointer-events-none [&.active::after]:[content:''] [&.active::after]:absolute [&.active::after]:w-[calc(var(--star-size)_+_31px)] [&.active::after]:h-[calc(var(--star-size)_+_31px)] [&.active::after]:[border:1px_solid_var(--g-star-glow)] [&.active::after]:rounded-[50%] [&.active::after]:pointer-events-none [&.active::after]:[animation:galaxy-star-selection-pulse_2.3s_var(--ease-out)_infinite] [&:hover::before]:opacity-100 [&.active::before]:opacity-100 absolute z-[2] grid w-[52px] h-[52px] min-w-0 min-h-[52px] place-items-center [transform:translate(-50%,-50%)_translate3d(calc(var(--px,0)_*_(9px_+_var(--depth,0)_*_7px)),calc(var(--py,0)_*_(6px_+_var(--depth,0)_*_5px)),0)] border-0 rounded-[50%] bg-transparent p-0 cursor-pointer [transition:transform_.9s_var(--ease-out),opacity_.45s_var(--ease-out),filter_.45s_var(--ease-out)] [animation:galaxy-star-enter_.72s_var(--ease-out)_var(--enter-delay,0ms)_backwards] ${M===e.id?`active`:``} ${Q&&e.id!==Q&&!Pe.has(e.id)?`dimmed [.galaxy-stage.has-focus_.galaxy-star&]:opacity-[.32] [.galaxy-stage.has-focus_.galaxy-star&]:[filter:saturate(.4)_brightness(.82)]`:``}`,onClick:()=>N(e.id),onMouseEnter:()=>we(e.id),onMouseLeave:()=>we(``),style:{left:`${t/w.width*100}%`,top:`${n/w.height*100}%`,"--star-size":`${12+Math.round((e.importance||.5)*9)}px`,"--twinkle-delay":`${r}s`,"--enter-delay":`${i*55}ms`,"--depth":E(e.id)%100/100,"--g-star-color":fe[e.type],"--g-star-glow":pe[e.type]},title:e.content,children:[M===e.id&&(0,C.jsx)(`i`,{className:`orbit-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:[border:1px_solid_var(--galaxy-line-active)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)_rotate(-22deg)_scaleY(.44)] [.galaxy-star_&]:[animation:galaxy-selected-orbit_6s_linear_infinite] [.galaxy-star_&]:opacity-[.8] [.galaxy-star_&::before]:[content:''] [.galaxy-star_&::before]:absolute [.galaxy-star_&::before]:top-[-2.2px] [.galaxy-star_&::before]:left-[50%] [.galaxy-star_&::before]:w-[4.4px] [.galaxy-star_&::before]:h-[4.4px] [.galaxy-star_&::before]:ml-[-2.2px] [.galaxy-star_&::before]:rounded-[50%] [.galaxy-star_&::before]:bg-[var(--g-star-color)] [.galaxy-star_&::before]:shadow-[0_0_6px_1px_var(--g-star-glow)]`,"aria-hidden":`true`}),M===e.id&&(0,C.jsx)(`i`,{className:`dash-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:[border:1px_dashed_var(--g-star-glow)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:opacity-[.9] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)] [.galaxy-star_&]:[animation:galaxy-dash-spin_16s_linear_infinite]`,"aria-hidden":`true`}),(0,C.jsxs)(`svg`,{className:`star-core [.galaxy-star_&]:relative [.galaxy-star_&]:block [.galaxy-star_&]:w-[var(--star-size)] [.galaxy-star_&]:h-[var(--star-size)] [.galaxy-star_&]:[transition:transform_var(--d2)_var(--ease-spring)] [.galaxy-star_&]:[animation:galaxy-star-twinkle_3.8s_ease-in-out_var(--twinkle-delay)_infinite] [.galaxy-star_&]:overflow-visible [.galaxy-star_&]:rounded-[0] [.galaxy-star_&]:bg-transparent [.galaxy-star_&]:shadow-[none] [.galaxy-star_&]:[filter:drop-shadow(0_0_3px_var(--g-star-glow))_drop-shadow(0_0_8px_var(--g-star-glow))] [.galaxy-star_&]:origin-[center] [.galaxy-star:hover_&]:[transform:scale(1.28)] [.galaxy-star.active_&]:[transform:scale(1.32)] [.galaxy-star.active_&]:[animation:galaxy-star-twinkle_2.1s_ease-in-out_var(--twinkle-delay)_infinite]`,viewBox:`0 0 32 32`,"aria-hidden":`true`,children:[(0,C.jsx)(`path`,{className:`star-ray [.galaxy-star_.star-core_&]:[fill:var(--g-star-glow)] [.galaxy-star_.star-core_&]:opacity-[.58] [.galaxy-star_.star-core_&]:[transform-box:fill-box] [.galaxy-star_.star-core_&]:origin-[center] [.galaxy-star_.star-core_&]:[transform:scale(1.45)] [.galaxy-star.active_.star-core_&]:opacity-[.88] [.galaxy-star.active_.star-core_&]:[transform:scale(1.82)]`,d:`M16 0 L19.7 12.3 L32 16 L19.7 19.7 L16 32 L12.3 19.7 L0 16 L12.3 12.3 Z`}),(0,C.jsx)(`path`,{className:`star-shape [.galaxy-star_.star-core_&]:[fill:var(--g-star-color)]`,d:`M16 2 L18.8 13.2 L30 16 L18.8 18.8 L16 30 L13.2 18.8 L2 16 L13.2 13.2 Z`}),(0,C.jsx)(`circle`,{className:`star-heart [.galaxy-star_.star-core_&]:[fill:var(--g-star-core)]`,cx:`16`,cy:`16`,r:`3.2`})]}),(0,C.jsx)(`span`,{className:`star-label [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:opacity-[.3] [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:[transition:opacity_.45s_var(--ease-out)] [.galaxy-star_&]:absolute [.galaxy-star_&]:top-[calc(50%_+_17px)] [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:max-w-[120px] [.galaxy-star_&]:overflow-hidden [.galaxy-star_&]:text-[var(--galaxy-label)] [.galaxy-star_&]:text-[11px] [.galaxy-star_&]:leading-[1.35] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:text-ellipsis [.galaxy-star_&]:[text-shadow:0_1px_7px_var(--galaxy-bg)] [.galaxy-star_&]:[transform:translateX(-50%)] [.galaxy-star_&]:[transition:color_var(--d1)_var(--ease-out)] [.galaxy-star_&]:whitespace-nowrap [.galaxy-star:hover_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:font-[700]`,children:e.title})]},e.id))]}),!!X.length&&(0,C.jsxs)(`span`,{className:`absolute z-[3] [right:12px] [bottom:9px] [border:1px_solid_var(--galaxy-toolbar-border)] rounded-[var(--r-pill)] bg-[rgba(12,11,20,.52)] [padding:3px_10px] text-[var(--galaxy-label)] text-[11px] tracking-[.5px] pointer-events-none [backdrop-filter:blur(6px)]`,children:[`✦`,` `,c(`memory:memoryPage.visibleTotalMemories`,{visible:X.length,total:T.nodes.length})]}),!ve&&!X.length&&(0,C.jsxs)(`div`,{className:`memory-empty [.galaxy-panel_&]:text-[var(--galaxy-label)] [.galaxy-panel_&]:[--stroke:var(--galaxy-toolbar-border)] [.galaxy-panel_&]:[--control-muted:var(--galaxy-label)] [.galaxy-panel_&]:[--star:var(--g-decision)] [.galaxy-panel_&]:[--text-muted:var(--galaxy-label)] absolute z-[3] inset-0 grid [align-content:center] justify-items-center gap-[8px] text-[var(--text-muted)] text-[12px] pointer-events-none`,children:[(0,C.jsx)(ie,{size:44}),(0,C.jsx)(`span`,{children:c(`memory:memoryPage.thisMemorySpaceIsStillUnlitClickInTheTopLeftToPlantTheFirstStar`)})]})]}),(0,C.jsxs)(`div`,{className:`detail-stack flex min-w-0 flex-col gap-[12px] [.mcp-layout_>_&]:min-h-0 max-[1150px]:[.memory-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.memory-layout_>_&]:grid max-[1150px]:[.memory-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.mcp-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.mcp-layout_>_&]:grid max-[1150px]:[.mcp-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.skills-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.skills-layout_>_&]:grid max-[1150px]:[.skills-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:[.memory-layout_>_&]:[grid-column:auto] max-[650px]:[.memory-layout_>_&]:grid-cols-[1fr] max-[650px]:[.mcp-layout_>_&]:[grid-column:auto] max-[650px]:[.mcp-layout_>_&]:grid-cols-[1fr] max-[650px]:[.skills-layout_>_&]:[grid-column:auto] max-[650px]:[.skills-layout_>_&]:grid-cols-[1fr]`,children:[(0,C.jsxs)(x,{children:[(0,C.jsx)(b,{title:c(`memory:memoryPage.selectedMemory`)}),Y?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`h2`,{children:Y.title}),(0,C.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:Y.content}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.memoryType`)}),(0,C.jsxs)(`strong`,{className:`inline-flex items-center gap-[6px]`,children:[(0,C.jsx)(`i`,{className:`g-dot [&.g-concept]:bg-[var(--g-concept)] [&.g-concept]:shadow-[0_0_5px_var(--g-concept-glow)] [&.g-file]:bg-[var(--g-file)] [&.g-file]:shadow-[0_0_5px_var(--g-file-glow)] [&.g-risk]:bg-[var(--g-risk)] [&.g-risk]:shadow-[0_0_5px_var(--g-risk-glow)] [&.g-preference]:bg-[var(--g-preference)] [&.g-preference]:shadow-[0_0_5px_var(--g-preference-glow)] [&.g-decision]:bg-[var(--g-decision)] [&.g-decision]:shadow-[0_0_5px_var(--g-decision-glow)] [&.g-fact]:bg-[var(--g-fact)] [&.g-fact]:shadow-[0_0_5px_var(--g-fact-glow)] [&.g-task]:bg-[var(--g-task)] [&.g-task]:shadow-[0_0_5px_var(--g-task-glow)] inline-block w-[7px] h-[7px] flex-none rounded-[50%] g-${Y.type}`}),de(Y.type,c)]})]}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.source`)}),(0,C.jsx)(`strong`,{children:Y.sourceType===`conversation_confirmed`?c(`memory:memoryPage.userConfirmedConversationCandidate`):Y.sourceType===`user_confirmed`?c(`memory:memoryPage.explicitUserRequest`):Y.sourceType===`agent`?c(`memory:memoryPage.createdByAgent`):c(`memory:memoryPage.addedManually`)})]}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.authority`)}),(0,C.jsxs)(`strong`,{children:[Y.authority??0,`/100`]})]}),Y.evidence&&(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.evidence`)}),(0,C.jsx)(`strong`,{children:Y.evidence})]}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.created`)}),(0,C.jsx)(`strong`,{children:D(Y.createdAt,_)})]}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.relatedMemories`)}),(0,C.jsx)(`strong`,{children:c(`memory:memoryPage.count`,{count:Ne.size})})]}),(0,C.jsxs)(`div`,{className:`mt-[15px] flex gap-2 max-[650px]:flex-wrap`,children:[(0,C.jsxs)(g,{size:`lg`,onClick:()=>L(Y),children:[(0,C.jsx)(p,{size:14}),c(`memory:memoryPage.edit`)]}),(0,C.jsxs)(g,{variant:`destructive`,size:`lg`,onClick:()=>Ie(Y),children:[(0,C.jsx)(re,{size:14}),c(`memory:memoryPage.delete`)]})]})]}):(0,C.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:c(`memory:memoryPage.selectAMemoryInTheMapToViewItsDetails`)}),be&&(0,C.jsx)(v,{children:be})]}),(0,C.jsxs)(x,{children:[(0,C.jsx)(b,{title:c(`memory:memoryPage.relatedFiles`)}),Fe.map(e=>(0,C.jsxs)(`div`,{className:`file-row [&_span]:flex [&_span]:min-w-0 [&_span]:flex-col [&_span]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[13px] grid grid-cols-[auto_minmax(0,1fr)_auto_auto_auto] items-center gap-[6px] [border-top:1px_solid_var(--stroke-soft)] [padding:8px_0]`,children:[(0,C.jsx)(d,{size:15}),(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`strong`,{children:e.title}),(0,C.jsx)(`small`,{children:e.sourcePath||e.cwd||c(`memory:memoryPage.localMemory`)})]}),(0,C.jsx)(`button`,{onClick:()=>N(e.id),children:c(`memory:memoryPage.view`)}),(0,C.jsx)(`button`,{onClick:()=>L(e),children:(0,C.jsx)(p,{size:13})}),(0,C.jsx)(`button`,{className:`danger`,onClick:()=>Ie(e),children:(0,C.jsx)(re,{size:13})})]},e.id)),!Fe.length&&(0,C.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:c(`memory:memoryPage.thisMemoryHasNoRelatedFiles`)})]})]}),I&&(0,C.jsx)(ge,{spaces:T.spaces,node:I.id?I:null,initialSpaceId:I.spaceId||A,onClose:()=>L(null),onSaved:async t=>{L(null),e(t),await J(A)}}),R&&(0,C.jsx)(_e,{space:R.id?R:null,onClose:()=>z(null),onSaved:async(t,n)=>{z(null),j(t.id),e(n)}})]})}function ge({spaces:e,node:t,initialSpaceId:n,onClose:a,onSaved:o}){let{t:s}=r(),[c,l]=(0,S.useState)({spaceId:t?.spaceId||n||e[0]?.id||``,title:t?.title||``,content:t?.content||``,type:t?.type||`concept`,sourcePath:t?.sourcePath||``,importance:t?.importance??.5}),[u,d]=(0,S.useState)(!1),[ee,f]=(0,S.useState)(``);return(0,C.jsx)(`div`,{className:`modal-backdrop max-[650px]:p-[8px] fixed z-[70] inset-0 grid place-items-center overflow-y-auto bg-[var(--modal-overlay)] [backdrop-filter:blur(3px)] [padding:20px] [overscroll-behavior:contain] [animation:fade-in_var(--d1)_var(--ease-out)]`,onMouseDown:e=>!u&&e.target===e.currentTarget&&a(),children:(0,C.jsxs)(`form`,{role:`dialog`,"aria-modal":`true`,"aria-label":s(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`),className:`modal !w-[min(430px,100%)] max-h-[calc(100dvh_-_40px)] overflow-y-auto [overscroll-behavior:contain] [border:1px_solid_var(--surface-highlight)] rounded-[var(--r-md)] bg-[var(--solid)] p-[18px] shadow-[0_26px_70px_-25px_var(--shadow-strong)] [animation:modal-in_var(--d2)_var(--ease-out)] max-[650px]:max-h-[calc(100dvh_-_16px)]`,onSubmit:async e=>{if(e.preventDefault(),!u){d(!0),f(``);try{await h(t?`/api/memory/nodes/${encodeURIComponent(t.id)}`:`/api/memory/nodes`,{method:t?`PATCH`:`POST`,body:JSON.stringify(c)}),await o(s(t?`memory:memoryPage.memoryUpdated`:`memory:memoryPage.memoryCreated`))}catch(e){f(k(e))}finally{d(!1)}}},children:[(0,C.jsxs)(y,{children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{children:s(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`)}),(0,C.jsx)(`p`,{children:s(`memory:memoryPage.lightUpIdeasWorthKeepingAsMemoriesYouCanReturnToLater`)})]}),(0,C.jsx)(g,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":s(`memory:memoryPage.closeDialog`),disabled:u,onClick:a,children:(0,C.jsx)(m,{size:17})})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.memorySpace`),(0,C.jsx)(i,{value:c.spaceId,onChange:e=>l({...c,spaceId:e.target.value}),children:e.map(e=>(0,C.jsx)(`option`,{value:e.id,children:O(e,s)},e.id))})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.memoryTitle`),(0,C.jsx)(`input`,{value:c.title,onChange:e=>l({...c,title:e.target.value}),placeholder:s(`memory:memoryPage.forExampleProjectUIConstraints`)})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.memoryContent`),(0,C.jsx)(`textarea`,{value:c.content,onChange:e=>l({...c,content:e.target.value}),placeholder:s(`memory:memoryPage.recordStandaloneReusableMemoryForFutureChats`)})]}),(0,C.jsxs)(`div`,{className:`form-grid grid gap-[9px]`,children:[(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.memoryType`),(0,C.jsx)(i,{value:c.type,onChange:e=>l({...c,type:e.target.value}),children:ue.map(e=>(0,C.jsx)(`option`,{value:e,children:de(e,s)},e))})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.importance`),(0,C.jsxs)(i,{value:c.importance,onChange:e=>l({...c,importance:Number(e.target.value)}),children:[(0,C.jsx)(`option`,{value:`0.3`,children:s(`memory:memoryPage.normal`)}),(0,C.jsx)(`option`,{value:`0.5`,children:s(`memory:memoryPage.common`)}),(0,C.jsx)(`option`,{value:`0.8`,children:s(`memory:memoryPage.important`)}),(0,C.jsx)(`option`,{value:`1`,children:s(`memory:memoryPage.strict`)})]})]})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.relatedFilePath`),(0,C.jsx)(`input`,{value:c.sourcePath,onChange:e=>l({...c,sourcePath:e.target.value}),placeholder:s(`memory:memoryPage.optionalForExampleECodeProjectREADMEMd`)})]}),ee&&(0,C.jsx)(v,{children:ee}),(0,C.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,C.jsx)(g,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:a,children:s(`memory:memoryPage.cancel`)}),(0,C.jsxs)(g,{size:`lg`,disabled:u||!c.spaceId||!c.title.trim()||!c.content.trim(),children:[u?(0,C.jsx)(ne,{className:`animate-spin`,size:14}):(0,C.jsx)(p,{size:14}),s(u?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}function _e({space:e,onClose:t,onSaved:n}){let{t:i}=r(),[a,o]=(0,S.useState)(e?.name||``),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``);return(0,C.jsx)(`div`,{className:`modal-backdrop max-[650px]:p-[8px] fixed z-[70] inset-0 grid place-items-center overflow-y-auto bg-[var(--modal-overlay)] [backdrop-filter:blur(3px)] [padding:20px] [overscroll-behavior:contain] [animation:fade-in_var(--d1)_var(--ease-out)]`,onMouseDown:e=>!s&&e.target===e.currentTarget&&t(),children:(0,C.jsxs)(`form`,{role:`dialog`,"aria-modal":`true`,"aria-label":i(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`),className:`modal !w-[min(430px,100%)] max-h-[calc(100dvh_-_40px)] overflow-y-auto [overscroll-behavior:contain] [border:1px_solid_var(--surface-highlight)] rounded-[var(--r-md)] bg-[var(--solid)] p-[18px] shadow-[0_26px_70px_-25px_var(--shadow-strong)] [animation:modal-in_var(--d2)_var(--ease-out)] max-[650px]:max-h-[calc(100dvh_-_16px)]`,onSubmit:async t=>{if(t.preventDefault(),!s){c(!0),u(``);try{await n(await h(e?`/api/memory/spaces/${encodeURIComponent(e.id)}`:`/api/memory/spaces`,{method:e?`PATCH`:`POST`,body:JSON.stringify({name:a,kind:`custom`})}),i(e?`memory:memoryPage.memorySpaceRenamed`:`memory:memoryPage.memorySpaceCreated`))}catch(e){u(k(e))}finally{c(!1)}}},children:[(0,C.jsxs)(y,{children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{children:i(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`)}),(0,C.jsx)(`p`,{children:i(`memory:memoryPage.giveEachThemeOrProjectItsOwnMemorySpaceSoDurableMemoriesHaveSomewhereToBelong`)})]}),(0,C.jsx)(g,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":i(`memory:memoryPage.closeDialog`),disabled:s,onClick:t,children:(0,C.jsx)(m,{size:17})})]}),(0,C.jsxs)(_,{variant:`control`,children:[i(`memory:memoryPage.memorySpaceName`),(0,C.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:i(`memory:memoryPage.forExampleProductDesignGuidelines`),autoFocus:!0})]}),l&&(0,C.jsx)(v,{children:l}),(0,C.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,C.jsx)(g,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:t,children:i(`memory:memoryPage.cancel`)}),(0,C.jsxs)(g,{size:`lg`,disabled:s||!a.trim(),children:[s?(0,C.jsx)(ne,{className:`animate-spin`,size:14}):(0,C.jsx)(te,{size:14}),i(s?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}export{A as MemoryPage};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-C7st2Mx5.js";import{t as i}from"./AppSelect-D149YYg1.js";import{i as a,n as o,t as s}from"./tooltip-Bxq7c2mZ.js";import{t as c}from"./createLucideIcon-Cd-3GVxJ.js";import{t as l}from"./check-2vYc6QaP.js";import{t as u}from"./chevron-right-C3t2Rckj.js";import{t as d}from"./file-code-corner-BnE1ljT0.js";import{t as ee}from"./info-DATxy0fb.js";import{t as f}from"./loader-circle-BOwQzHB-.js";import{t as p}from"./pencil-U08v_vV9.js";import{t as te}from"./plus-fQbSqB1n.js";import{t as ne}from"./refresh-cw-TbWxTY4K.js";import{t as re}from"./trash-2-CNrPOoPR.js";import{t as m}from"./x-07u4-129.js";import{t as h}from"./api-DmuPqjXK.js";import{t as g}from"./button-CQA36izu.js";import{t as _}from"./field-3bN8nouy.js";import{i as v,n as y,o as b,t as x}from"./app-primitives-BBXY6U2S.js";import{t as ie}from"./StarOrbit-BAAjh-hY.js";import{t as ae}from"./usePagePrimaryAction-CWPC0C_f.js";var oe=c(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),se=c(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),S=e(t(),1);function ce(e={}){let{rootMargin:t=`96px 0px`,threshold:n=0}=e,[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(()=>!document.hidden),[s,c]=(0,S.useState)(!0),l=(0,S.useCallback)(e=>{i(e)},[]);return(0,S.useEffect)(()=>{let e=()=>o(!document.hidden);return e(),document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,S.useEffect)(()=>{if(!r||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>{e&&c(e.isIntersecting)},{rootMargin:t,threshold:n});return e.observe(r),()=>e.disconnect()},[r,t,n]),{ref:l,playing:a&&s}}var C=n(),w={width:600,height:420,cx:300,cy:206},T=24,le=Math.PI*(3-Math.sqrt(5)),ue=[`concept`,`file`,`risk`,`preference`,`decision`,`fact`,`task`];function de(e,t){return t(e===`file`?`memory:memoryPage.fileType`:e===`risk`?`memory:memoryPage.riskType`:e===`preference`?`memory:memoryPage.preferenceType`:e===`decision`?`memory:memoryPage.decisionType`:e===`fact`?`memory:memoryPage.factType`:e===`task`?`memory:memoryPage.taskType`:`memory:memoryPage.conceptType`)}var fe={concept:`var(--g-concept)`,file:`var(--g-file)`,risk:`var(--g-risk)`,preference:`var(--g-preference)`,decision:`var(--g-decision)`,fact:`var(--g-fact)`,task:`var(--g-task)`},pe={concept:`var(--g-concept-glow)`,file:`var(--g-file-glow)`,risk:`var(--g-risk-glow)`,preference:`var(--g-preference-glow)`,decision:`var(--g-decision-glow)`,fact:`var(--g-fact-glow)`,task:`var(--g-task-glow)`};function E(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function me(e,t){let n=e.slice(0,T);if(!n.length)return[];if(n.length===1)return[{node:n[0],x:w.cx,y:w.cy,twinkle:0}];let r=E(t||`galaxy`)%628/100,i=172/Math.sqrt(n.length);return n.map((e,t)=>{let n=E(e.id),a=t*le+r,o=i*Math.sqrt(t+.55)+n%11-5;return{node:e,x:w.cx+Math.cos(a)*o*1.38,y:w.cy+Math.sin(a)*o*.74,twinkle:n%50/10}})}function D(e,t=`zh-CN`){if(!e)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(n)}function O(e,t=e=>e){return e?.kind===`global`?t(`memory:memoryPage.globalMemorySpace`):e?.name||``}function he(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=Math.min(24,a*.16)*(n%2==0?1:-1),s=(e.x+t.x)/2-i/a*o,c=(e.y+t.y)/2+r/a*o;return`M ${e.x.toFixed(1)} ${e.y.toFixed(1)} Q ${s.toFixed(1)} ${c.toFixed(1)} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}function k(e){return e instanceof Error?e.message:String(e)}function A({notify:e,query:t=``,registerPrimaryAction:n,requestConfirm:i}){let{t:c,language:_}=r(),[T,le]=(0,S.useState)({spaces:[],nodes:[],links:[],candidates:[],selectedSpaceId:``}),[A,j]=(0,S.useState)(``),[M,N]=(0,S.useState)(``),P=(0,S.useRef)(0),[ve,ye]=(0,S.useState)(!0),[be,F]=(0,S.useState)(``),[xe,Se]=(0,S.useState)(1),[I,L]=(0,S.useState)(null),[R,z]=(0,S.useState)(null),[Ce,we]=(0,S.useState)(``),[B,V]=(0,S.useState)(``),[H,U]=(0,S.useState)(null),[W,Te]=(0,S.useState)(!1),G=(0,S.useRef)(null),K=(0,S.useRef)(0),{ref:Ee,playing:q}=ce(),De=(0,S.useCallback)(e=>{G.current=e,Ee(e)},[Ee]),Oe=q?``:`[&:before]:[animation-play-state:paused]! [&:after]:[animation-play-state:paused]! [&_*]:[animation-play-state:paused]! [&_*:before]:[animation-play-state:paused]! [&_*:after]:[animation-play-state:paused]!`;ae(n,()=>L({spaceId:A||T.selectedSpaceId}));let ke=e=>{if(!q)return;let t=G.current;if(!t)return;let n=t.getBoundingClientRect(),r=((e.clientX-n.left)/n.width-.5)*2,i=((e.clientY-n.top)/n.height-.5)*2;cancelAnimationFrame(K.current),K.current=requestAnimationFrame(()=>{t.style.setProperty(`--px`,r.toFixed(3)),t.style.setProperty(`--py`,i.toFixed(3))})},Ae=()=>{cancelAnimationFrame(K.current),G.current?.style.setProperty(`--px`,`0`),G.current?.style.setProperty(`--py`,`0`)};(0,S.useEffect)(()=>{q||(cancelAnimationFrame(K.current),K.current=0)},[q]),(0,S.useEffect)(()=>{let e=G.current?.querySelector(`svg`);e&&(q?e.unpauseAnimations():e.pauseAnimations())},[q]);let J=(0,S.useCallback)(async(e=``)=>{let n=++P.current;ye(!0),F(``);try{let r=new URLSearchParams;e&&r.set(`spaceId`,e),t.trim()&&r.set(`query`,t.trim());let i=await h(`/api/memory?${r}`);if(n!==P.current)return;le(i),j(i.selectedSpaceId||``),N(e=>i.nodes.some(t=>t.id===e)?e:i.nodes[0]?.id||``)}catch(e){n===P.current&&F(k(e))}finally{n===P.current&&ye(!1)}},[t]);(0,S.useEffect)(()=>(J(A),()=>{P.current+=1}),[J,A]),(0,S.useEffect)(()=>{let e=!0;return h(`/api/settings/memory`).then(t=>e&&U(t.autoApproveConfidence)).catch(()=>e&&U(60)),()=>{e=!1}},[]);let je=async()=>{let t=H;if(t===null||W)return;let n=Math.min(100,Math.max(0,Math.round(t)));n!==t&&U(n),Te(!0);try{await h(`/api/settings/memory`,{method:`PATCH`,body:{autoApproveConfidence:n}}),e(c(`memory:memoryPage.autoApproveSaved`))}catch(e){F(k(e))}finally{Te(!1)}},Y=T.nodes.find(e=>e.id===M)||null,X=(0,S.useMemo)(()=>me(T.nodes,A),[T.nodes,A]),Z=(0,S.useMemo)(()=>new Map(X.map(e=>[e.node.id,e])),[X]),Me=(0,S.useMemo)(()=>{let e=new Set(X.map(e=>e.node.id));return T.links.filter(t=>e.has(t.sourceId)&&e.has(t.targetId))},[X,T.links]),Ne=new Set(T.links.flatMap(e=>e.sourceId===M?[e.targetId]:e.targetId===M?[e.sourceId]:[])),Q=Ce||M,Pe=new Set(T.links.flatMap(e=>e.sourceId===Q?[e.targetId]:e.targetId===Q?[e.sourceId]:[])),Fe=T.nodes.filter(e=>e.type===`file`&&(Ne.has(e.id)||e.id===M)),$=T.spaces.find(e=>e.id===A),Ie=async t=>{if(await i({title:c(`memory:memoryPage.deleteMemory`),message:c(`memory:memoryPage.deleteMemoryName`,{name:t.title}),confirmLabel:c(`memory:memoryPage.delete`)}))try{await h(`/api/memory/nodes/${encodeURIComponent(t.id)}`,{method:`DELETE`}),e(c(`memory:memoryPage.memoryDeleted`)),await J(A)}catch(e){F(k(e))}},Le=async(t,n)=>{if(!B){V(t.id),F(``);try{await h(`/api/memory/candidates/${encodeURIComponent(t.id)}/${n}`,{method:`POST`,body:`{}`}),e(c(n===`accept`?`memory:memoryPage.memoryCandidateConfirmed`:`memory:memoryPage.memoryCandidateIgnored`)),await J(A)}catch(e){F(k(e))}finally{V(``)}}};return(0,C.jsxs)(`div`,{className:`memory-layout max-[1150px]:grid-cols-[220px_minmax(340px,1fr)] max-[650px]:grid-cols-[1fr] grid min-h-[100%] grid-cols-[230px_minmax(360px,1fr)_290px] gap-[12px]`,children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-[12px]`,children:[(0,C.jsxs)(x,{className:`wiki-panel [&_>_button]:grid [&_>_button]:w-full [&_>_button]:grid-cols-[minmax(0,1fr)_auto_auto] [&_>_button]:items-center [&_>_button]:gap-[6px] [&_>_button]:border-0 [&_>_button]:[border-top:1px_solid_var(--stroke-soft)] [&_>_button]:bg-transparent [&_>_button]:p-[9px_5px] [&_>_button]:text-left [&_>_button]:text-[12px] [&_>_button.active]:rounded-[var(--r-xs)] [&_>_button.active]:bg-[var(--accent-soft)] [&_>_button_small]:text-[var(--text-muted)] [&_>_button_small]:text-[13px]`,children:[(0,C.jsxs)(y,{children:[(0,C.jsx)(b,{title:c(`memory:memoryPage.memorySpaces`)}),(0,C.jsx)(g,{variant:`ghost`,size:`icon`,title:c(`memory:memoryPage.newMemorySpace`),onClick:()=>z({}),children:(0,C.jsx)(te,{size:13})})]}),T.spaces.map(e=>(0,C.jsxs)(`button`,{className:e.id===A?`active`:``,onClick:()=>{j(e.id),N(``)},children:[(0,C.jsx)(`span`,{children:O(e,c)}),(0,C.jsx)(`small`,{children:c(`memory:memoryPage.countMemories`,{count:e.nodeCount})}),(0,C.jsx)(u,{size:13})]},e.id)),$&&(0,C.jsxs)(`div`,{className:`memory-space-actions [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[13px] [&_button.danger]:text-[var(--danger)] flex gap-[6px] [margin-top:10px] [border-top:1px_solid_var(--stroke-soft)] [padding-top:9px]`,children:[(0,C.jsxs)(`button`,{onClick:()=>z($),children:[(0,C.jsx)(p,{size:12}),c(`memory:memoryPage.rename`)]}),$.kind!==`global`&&(0,C.jsxs)(`button`,{className:`danger`,onClick:async()=>{if($&&await i({title:c(`memory:memoryPage.deleteMemorySpace`),message:c(`memory:memoryPage.deleteMemorySpaceNameAndAllMemoriesInIt`,{name:O($,c)}),confirmLabel:c(`memory:memoryPage.delete`)}))try{await h(`/api/memory/spaces/${encodeURIComponent($.id)}`,{method:`DELETE`}),j(``),N(``),e(c(`memory:memoryPage.memorySpaceDeleted`))}catch(e){F(k(e))}},children:[(0,C.jsx)(re,{size:12}),c(`memory:memoryPage.delete`)]})]})]}),(0,C.jsxs)(x,{className:`memory-legend-panel`,children:[(0,C.jsx)(b,{title:c(`memory:memoryPage.memoryMapTypes`)}),(0,C.jsx)(`div`,{className:`galaxy-legend [&_span]:flex [&_span]:items-center [&_span]:gap-[7px] [&_span]:text-[var(--text-soft)] [&_span]:text-[12px] grid grid-cols-[repeat(2,minmax(0,1fr))] gap-[8px_10px] [margin-top:11px]`,children:ue.map(e=>(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`i`,{className:`g-dot [&.g-concept]:bg-[var(--g-concept)] [&.g-concept]:shadow-[0_0_5px_var(--g-concept-glow)] [&.g-file]:bg-[var(--g-file)] [&.g-file]:shadow-[0_0_5px_var(--g-file-glow)] [&.g-risk]:bg-[var(--g-risk)] [&.g-risk]:shadow-[0_0_5px_var(--g-risk-glow)] [&.g-preference]:bg-[var(--g-preference)] [&.g-preference]:shadow-[0_0_5px_var(--g-preference-glow)] [&.g-decision]:bg-[var(--g-decision)] [&.g-decision]:shadow-[0_0_5px_var(--g-decision-glow)] [&.g-fact]:bg-[var(--g-fact)] [&.g-fact]:shadow-[0_0_5px_var(--g-fact-glow)] [&.g-task]:bg-[var(--g-task)] [&.g-task]:shadow-[0_0_5px_var(--g-task-glow)] inline-block w-[7px] h-[7px] flex-none rounded-[50%] g-${e}`}),de(e,c)]},e))})]}),(0,C.jsxs)(x,{className:`min-h-0`,children:[(0,C.jsxs)(y,{children:[(0,C.jsx)(b,{title:`${c(`memory:memoryPage.memoryDrafts`)} · ${T.candidates?.length||0}`}),!!T.candidates?.length&&(0,C.jsxs)(g,{variant:`outline`,className:`bg-surface-subtle`,disabled:!!B,onClick:async()=>{if(!(B||!T.candidates?.length)){V(`__all__`),F(``);try{let t=await h(`/api/memory/candidates/reject-all`,{method:`POST`,body:`{}`});e(c(`memory:memoryPage.ignoredCountMemoryDrafts`,{count:t.rejected||0})),await J(A)}catch(e){F(k(e))}finally{V(``)}}},children:[(0,C.jsx)(m,{size:12}),c(`memory:memoryPage.ignoreAll`)]})]}),H!==null&&(0,C.jsxs)(`div`,{className:`memory-auto-approve-row [&_label]:flex [&_label]:min-w-0 [&_label]:flex-col [&_label]:gap-[2px] [&_label_span]:text-[12px] [&_label_span]:font-[600] [&_label_small]:text-[var(--text-muted)] [&_label_small]:text-[10px] [&_label_small]:leading-[1.4] flex items-center justify-between gap-[10px] [border-bottom:1px_solid_var(--stroke-soft)] [padding:8px_0_10px]`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-center gap-1`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.autoApproveThreshold`)}),(0,C.jsxs)(s,{children:[(0,C.jsx)(a,{asChild:!0,children:(0,C.jsx)(ee,{size:16})}),(0,C.jsx)(o,{align:`center`,side:`top`,children:c(`memory:memoryPage.autoApproveThresholdHint`)})]})]}),(0,C.jsxs)(`span`,{className:`memory-auto-approve-input [&_input]:w-[64px] [&_input]:[border:1px_solid_var(--stroke-soft)] [&_input]:rounded-[6px] [&_input]:bg-[var(--surface-muted)] [&_input]:p-[4px_6px] [&_input]:text-[var(--text)] [&_input]:text-[12px] [&_input]:text-right [&_em]:text-[var(--text-muted)] [&_em]:text-[11px] [&_em]:[font-style:normal] flex flex-none items-center gap-[5px]`,children:[(0,C.jsx)(`input`,{type:`number`,min:0,max:100,step:5,value:H,disabled:W,"aria-label":c(`memory:memoryPage.autoApproveThreshold`),onChange:e=>U(e.target.value?Number(e.target.value):0),onBlur:()=>void je(),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),je())}}),(0,C.jsx)(`em`,{children:`%`}),W&&(0,C.jsx)(f,{className:`animate-spin`,size:12})]})]}),(0,C.jsxs)(`div`,{className:`flex max-h-[300px] flex-col gap-[8px] overflow-auto mt-2`,children:[(T.candidates||[]).map(e=>(0,C.jsxs)(`div`,{className:`memory-candidate [&_>_strong]:text-[12px] [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[11px] [&_>_span]:leading-[1.45] [&_>_small]:text-[var(--text-muted)] [&_>_small]:text-[11px] [&_>_small]:leading-[1.45] [&_>_div]:flex [&_>_div]:gap-[6px] [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:[border:1px_solid_var(--stroke-soft)] [&_button]:rounded-[6px] [&_button]:bg-transparent [&_button]:p-[4px_7px] [&_button]:text-[var(--text)] [&_button]:text-[11px] [&_button.danger]:text-[var(--danger)] flex flex-col gap-[5px] [border:1px_solid_var(--stroke-soft)] rounded-[8px] bg-[var(--surface-muted)] [padding:8px]`,children:[(0,C.jsx)(`strong`,{children:e.title}),(0,C.jsxs)(`small`,{children:[O(T.spaces.find(t=>t.id===e.spaceId),c),` · `,e.sourceType===`agent`?c(`memory:memoryPage.agentProposed`):c(`memory:memoryPage.conversationExtracted`),` · `,c(`memory:memoryPage.confidencePercent`,{value:Math.round((e.confidence||0)*100)})]}),(0,C.jsx)(`span`,{children:e.content}),e.topicKey&&(0,C.jsxs)(`small`,{children:[c(`memory:memoryPage.topic`),`:`,e.topicKey]}),e.evidence&&(0,C.jsxs)(`small`,{children:[c(`memory:memoryPage.evidence`),`:`,e.evidence]}),(0,C.jsxs)(`small`,{children:[c(`memory:memoryPage.created`),`:`,D(e.createdAt,_),e.expiresAt?` · ${c(`memory:memoryPage.expires`)}:${D(e.expiresAt,_)}`:``]}),(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`button`,{disabled:!!B,title:c(`memory:memoryPage.confirm`),onClick:()=>Le(e,`accept`),children:[(0,C.jsx)(l,{size:12}),c(`memory:memoryPage.confirm`)]}),(0,C.jsxs)(`button`,{disabled:!!B,className:`danger`,title:c(`memory:memoryPage.ignore`),onClick:()=>Le(e,`reject`),children:[(0,C.jsx)(m,{size:12}),c(`memory:memoryPage.ignore`)]})]})]},e.id)),!T.candidates?.length&&(0,C.jsx)(`small`,{children:c(`memory:memoryPage.thereAreNoPendingMemoryCandidates`)})]})]})]}),(0,C.jsxs)(x,{className:`graph-panel before:[content:''] before:absolute before:z-[0] before:inset-0 before:pointer-events-none before:bg-[url('/memory-galaxy-background.webp')] before:[background-position:center_48%] before:[background-size:cover] before:bg-no-repeat before:[filter:saturate(.62)_contrast(1.08)] before:[mix-blend-mode:screen] before:opacity-[.42] after:[content:''] after:absolute after:z-[0] after:inset-0 after:pointer-events-none after:[background-image:radial-gradient(var(--galaxy-dot)_.9px,transparent_1.2px),_radial-gradient(var(--galaxy-dot-dim)_.8px,transparent_1.2px),_radial-gradient(var(--galaxy-dot)_1.2px,transparent_1.6px)] after:[background-position:0_0,_37px_53px,_71px_19px] after:[background-size:96px_96px,_152px_152px,_236px_236px] after:[animation:galaxy-field-twinkle_6.4s_ease-in-out_infinite] after:opacity-[.7] before:inset-[-8%] before:[animation:galaxy-background-drift_34s_ease-in-out_infinite_alternate] before:[will-change:transform] after:[animation:galaxy-field-drift_15s_ease-in-out_infinite_alternate] after:[will-change:background-position,opacity] max-[650px]:min-h-[430px] relative min-h-[500px] overflow-hidden [border-color:var(--galaxy-border)] bg-[var(--galaxy-bg)]! [background-image:radial-gradient(ellipse_46%_40%_at_50%_48%,_var(--galaxy-core),_transparent_72%),_radial-gradient(ellipse_62%_48%_at_16%_6%,_var(--galaxy-nebula-a),_transparent_70%),_radial-gradient(ellipse_56%_52%_at_88%_98%,_var(--galaxy-nebula-b),_transparent_72%)] p-0 backdrop-blur-none! galaxy-panel ${Oe}`,onPointerMove:ke,onPointerLeave:Ae,children:[(0,C.jsxs)(`div`,{className:`graph-toolbar [&_button]:grid [&_button]:w-[32px] [&_button]:h-[32px] [&_button]:place-items-center [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[12px] [.galaxy-panel_&]:border-[var(--galaxy-toolbar-border)] [.galaxy-panel_&]:bg-[var(--galaxy-toolbar-bg)] [.galaxy-panel_&]:text-[var(--galaxy-toolbar-text)] [.galaxy-panel_&]:[backdrop-filter:blur(9px)] [.galaxy-panel_&_button:hover]:bg-[var(--galaxy-toolbar-hover)] dark:bg-[var(--solid)] dark:text-[var(--text)] absolute z-[4] [top:10px] [left:10px] flex gap-[3px] [padding:3px] [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--solid)]`,children:[(0,C.jsx)(`button`,{title:c(`memory:memoryPage.addMemory`),onClick:()=>L({spaceId:A}),children:(0,C.jsx)(te,{size:14})}),(0,C.jsx)(`button`,{title:c(`memory:memoryPage.zoomIn`),onClick:()=>Se(e=>Math.min(1.6,Number((e+.15).toFixed(2)))),children:(0,C.jsx)(se,{size:13})}),(0,C.jsx)(`button`,{title:c(`memory:memoryPage.zoomOut`),onClick:()=>Se(e=>Math.max(.7,Number((e-.15).toFixed(2)))),children:(0,C.jsx)(oe,{size:13})}),(0,C.jsx)(`button`,{title:c(`memory:memoryPage.refresh`),onClick:()=>J(A),children:(0,C.jsx)(ne,{className:ve?`animate-spin`:``,size:13})})]}),(0,C.jsxs)(`div`,{className:`galaxy-stage [&_>_svg]:absolute [&_>_svg]:inset-0 [&_>_svg]:w-full [&_>_svg]:h-full [&_>_svg]:overflow-visible [&_>_svg]:z-[1] [&_>_svg]:[transform:translate3d(calc(var(--px,0)_*_9px),calc(var(--py,0)_*_6px),0)] [&_>_svg]:[transition:transform_.9s_var(--ease-out)] absolute z-[1] inset-0 [transform-origin:50%_50%] [transition:transform_var(--d2)_var(--ease-out)] ${Q?`has-focus`:``}`,ref:De,style:{transform:`scale(${xe})`},children:[(0,C.jsx)(`i`,{className:`galaxy-spiral absolute z-[0] block pointer-events-none [left:9%] [top:13%] w-[82%] h-[74%] rounded-[50%] bg-[conic-gradient(from_-18deg,transparent_0deg,var(--galaxy-nebula-a)_28deg,transparent_68deg,var(--galaxy-nebula-b)_118deg,transparent_170deg,var(--galaxy-nebula-a)_224deg,transparent_278deg,var(--galaxy-nebula-b)_322deg,transparent_360deg)] [filter:blur(13px)] [mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [-webkit-mask-image:radial-gradient(ellipse,transparent_0%,transparent_15%,var(--g-star-core)_38%,transparent_74%)] [mix-blend-mode:screen] opacity-[.38] [animation:galaxy-spiral-turn_42s_linear_infinite] [will-change:transform]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-core absolute z-[0] block pointer-events-none before:[content:''] before:absolute before:left-[50%] before:top-[50%] before:w-[46px] before:h-[46px] before:rounded-[50%] before:bg-[radial-gradient(circle,rgba(255,255,255,.82),rgba(191,219,254,.3)_55%,transparent_76%)] before:[filter:blur(6px)] before:[transform:translate(-50%,-50%)] [left:50%] [top:49%] w-[34%] h-[40%] rounded-[50%] bg-[radial-gradient(ellipse,rgba(219,232,255,.3)_0%,rgba(126,156,255,.15)_36%,transparent_70%)] [filter:blur(9px)] [mix-blend-mode:screen] [transform:translate(-50%,-50%)] [animation:galaxy-core-breathe_7.5s_ease-in-out_infinite] [will-change:transform,opacity]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [left:8%] [top:20%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-a),transparent_70%)] [animation:galaxy-aurora-drift_18s_ease-in-out_infinite_alternate]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] [right:5%] [bottom:14%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-b),transparent_70%)] [animation:galaxy-aurora-drift_23s_ease-in-out_-9s_infinite_alternate-reverse]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-aurora absolute z-[0] block pointer-events-none w-[46%] h-[31%] rounded-[50%] [filter:blur(21px)] [mix-blend-mode:screen] opacity-[.42] [will-change:transform,opacity] galaxy-aurora-three left-[30%] top-[60%] !w-[40%] !h-[27%] bg-[radial-gradient(ellipse,var(--galaxy-nebula-c),transparent_70%)] [animation:galaxy-aurora-drift_27s_ease-in-out_-14s_infinite_alternate]`,"aria-hidden":`true`}),(0,C.jsxs)(`svg`,{viewBox:`0 0 600 420`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[(0,C.jsxs)(`g`,{className:`galaxy-orbits [&_ellipse]:[fill:none] [&_ellipse]:[stroke:var(--galaxy-line)] [&_ellipse]:[stroke-width:.72] [&_ellipse]:[stroke-dasharray:3_7] [&_ellipse]:opacity-[.52] [transform-box:fill-box] [transform-origin:center] [animation:galaxy-orbit-drift_90s_linear_infinite]`,children:[(0,C.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`205`,ry:`122`,transform:`rotate(-8 300 206)`}),(0,C.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`154`,ry:`88`,transform:`rotate(18 300 206)`}),(0,C.jsx)(`ellipse`,{cx:`300`,cy:`206`,rx:`95`,ry:`54`,transform:`rotate(-24 300 206)`})]}),(0,C.jsx)(`defs`,{children:Me.map((e,t)=>{let n=Z.get(e.sourceId),r=Z.get(e.targetId);return!n||!r?null:(0,C.jsxs)(`linearGradient`,{id:`lg-${t}`,gradientUnits:`userSpaceOnUse`,x1:n.x,y1:n.y,x2:r.x,y2:r.y,children:[(0,C.jsx)(`stop`,{offset:`0`,stopColor:fe[n.node.type]||`var(--galaxy-line-active)`}),(0,C.jsx)(`stop`,{offset:`1`,stopColor:fe[r.node.type]||`var(--galaxy-line-active)`})]},e.id)})}),Me.map((e,t)=>{let n=Z.get(e.sourceId),r=Z.get(e.targetId);if(!n||!r)return null;let i=e.sourceId===Q||e.targetId===Q,a=he(n,r,E(e.id));return(0,C.jsxs)(`g`,{children:[(0,C.jsx)(`path`,{className:`link-path [.galaxy-stage_>_svg_&]:[fill:none] [.galaxy-stage_>_svg_&]:[stroke-width:1.05] [.galaxy-stage_>_svg_&]:[stroke-dasharray:3_5] [.galaxy-stage_>_svg_&]:opacity-[.5] [.galaxy-stage_>_svg_&]:[animation:galaxy-link-flow_30s_linear_infinite] [.galaxy-stage_>_svg_&]:[transition:opacity_var(--d2)_var(--ease-out)] [.galaxy-stage_>_svg_&.active]:[stroke-width:1.55] [.galaxy-stage_>_svg_&.active]:[stroke-dasharray:none] [.galaxy-stage_>_svg_&.active]:opacity-100 [.galaxy-stage_>_svg_&.active]:[filter:drop-shadow(0_0_3.5px_var(--galaxy-line-active))] [.galaxy-stage.has-focus_&]:opacity-[.14] [.galaxy-stage.has-focus_&.active]:opacity-100 ${i?`active`:``}`,d:a,stroke:`url(#lg-${t})`}),i&&(0,C.jsx)(`circle`,{className:`link-pulse [.galaxy-stage_>_svg_&]:[fill:var(--g-star-core)] [.galaxy-stage_>_svg_&]:[filter:drop-shadow(0_0_4px_var(--galaxy-line-active))] [.galaxy-stage_>_svg_&]:pointer-events-none`,r:`2.1`,children:(0,C.jsx)(`animateMotion`,{dur:`2.8s`,repeatCount:`indefinite`,path:a})})]},e.id)})]}),(0,C.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-two [.galaxy-meteor&]:top-[63%] [.galaxy-meteor&]:left-[89%] [.galaxy-meteor&]:[animation:galaxy-meteor-b_17s_linear_4.5s_infinite]`,"aria-hidden":`true`}),(0,C.jsx)(`i`,{className:`galaxy-meteor before:[content:''] before:absolute before:top-[50%] before:left-[1px] before:w-[72px] before:h-[1px] before:bg-[linear-gradient(90deg,transparent,var(--galaxy-dot))] before:[transform:translateY(-50%)] absolute [top:14%] [left:80%] w-[2.4px] h-[2.4px] rounded-[50%] bg-[var(--galaxy-label-active)] shadow-[0_0_7px_1px_var(--galaxy-dot)] opacity-0 pointer-events-none [animation:galaxy-meteor_12s_linear_infinite] z-[3] meteor-three [.galaxy-meteor&]:top-[7%] [.galaxy-meteor&]:left-[36%] [.galaxy-meteor&]:[animation:galaxy-meteor-c_23s_linear_11s_infinite]`,"aria-hidden":`true`}),X.map(({node:e,x:t,y:n,twinkle:r},i)=>(0,C.jsxs)(`button`,{className:`galaxy-star focus-visible:rounded-[50%] focus-visible:[outline-color:var(--galaxy-line-active)] before:[content:''] before:absolute before:w-[calc(var(--star-size)_+_26px)] before:h-[calc(var(--star-size)_+_26px)] before:rounded-[50%] before:bg-[radial-gradient(circle,var(--g-star-glow),transparent_68%)] before:[filter:blur(3px)] before:opacity-[.76] before:pointer-events-none [&.active::after]:[content:''] [&.active::after]:absolute [&.active::after]:w-[calc(var(--star-size)_+_31px)] [&.active::after]:h-[calc(var(--star-size)_+_31px)] [&.active::after]:[border:1px_solid_var(--g-star-glow)] [&.active::after]:rounded-[50%] [&.active::after]:pointer-events-none [&.active::after]:[animation:galaxy-star-selection-pulse_2.3s_var(--ease-out)_infinite] [&:hover::before]:opacity-100 [&.active::before]:opacity-100 absolute z-[2] grid w-[52px] h-[52px] min-w-0 min-h-[52px] place-items-center [transform:translate(-50%,-50%)_translate3d(calc(var(--px,0)_*_(9px_+_var(--depth,0)_*_7px)),calc(var(--py,0)_*_(6px_+_var(--depth,0)_*_5px)),0)] border-0 rounded-[50%] bg-transparent p-0 cursor-pointer [transition:transform_.9s_var(--ease-out),opacity_.45s_var(--ease-out),filter_.45s_var(--ease-out)] [animation:galaxy-star-enter_.72s_var(--ease-out)_var(--enter-delay,0ms)_backwards] ${M===e.id?`active`:``} ${Q&&e.id!==Q&&!Pe.has(e.id)?`dimmed [.galaxy-stage.has-focus_.galaxy-star&]:opacity-[.32] [.galaxy-stage.has-focus_.galaxy-star&]:[filter:saturate(.4)_brightness(.82)]`:``}`,onClick:()=>N(e.id),onMouseEnter:()=>we(e.id),onMouseLeave:()=>we(``),style:{left:`${t/w.width*100}%`,top:`${n/w.height*100}%`,"--star-size":`${12+Math.round((e.importance||.5)*9)}px`,"--twinkle-delay":`${r}s`,"--enter-delay":`${i*55}ms`,"--depth":E(e.id)%100/100,"--g-star-color":fe[e.type],"--g-star-glow":pe[e.type]},title:e.content,children:[M===e.id&&(0,C.jsx)(`i`,{className:`orbit-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_36px)] [.galaxy-star_&]:[border:1px_solid_var(--galaxy-line-active)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)_rotate(-22deg)_scaleY(.44)] [.galaxy-star_&]:[animation:galaxy-selected-orbit_6s_linear_infinite] [.galaxy-star_&]:opacity-[.8] [.galaxy-star_&::before]:[content:''] [.galaxy-star_&::before]:absolute [.galaxy-star_&::before]:top-[-2.2px] [.galaxy-star_&::before]:left-[50%] [.galaxy-star_&::before]:w-[4.4px] [.galaxy-star_&::before]:h-[4.4px] [.galaxy-star_&::before]:ml-[-2.2px] [.galaxy-star_&::before]:rounded-[50%] [.galaxy-star_&::before]:bg-[var(--g-star-color)] [.galaxy-star_&::before]:shadow-[0_0_6px_1px_var(--g-star-glow)]`,"aria-hidden":`true`}),M===e.id&&(0,C.jsx)(`i`,{className:`dash-ring [.galaxy-star_&]:absolute [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:top-[50%] [.galaxy-star_&]:w-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:h-[calc(var(--star-size)_+_23px)] [.galaxy-star_&]:[border:1px_dashed_var(--g-star-glow)] [.galaxy-star_&]:rounded-[50%] [.galaxy-star_&]:opacity-[.9] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:[transform:translate(-50%,-50%)] [.galaxy-star_&]:[animation:galaxy-dash-spin_16s_linear_infinite]`,"aria-hidden":`true`}),(0,C.jsxs)(`svg`,{className:`star-core [.galaxy-star_&]:relative [.galaxy-star_&]:block [.galaxy-star_&]:w-[var(--star-size)] [.galaxy-star_&]:h-[var(--star-size)] [.galaxy-star_&]:[transition:transform_var(--d2)_var(--ease-spring)] [.galaxy-star_&]:[animation:galaxy-star-twinkle_3.8s_ease-in-out_var(--twinkle-delay)_infinite] [.galaxy-star_&]:overflow-visible [.galaxy-star_&]:rounded-[0] [.galaxy-star_&]:bg-transparent [.galaxy-star_&]:shadow-[none] [.galaxy-star_&]:[filter:drop-shadow(0_0_3px_var(--g-star-glow))_drop-shadow(0_0_8px_var(--g-star-glow))] [.galaxy-star_&]:origin-[center] [.galaxy-star:hover_&]:[transform:scale(1.28)] [.galaxy-star.active_&]:[transform:scale(1.32)] [.galaxy-star.active_&]:[animation:galaxy-star-twinkle_2.1s_ease-in-out_var(--twinkle-delay)_infinite]`,viewBox:`0 0 32 32`,"aria-hidden":`true`,children:[(0,C.jsx)(`path`,{className:`star-ray [.galaxy-star_.star-core_&]:[fill:var(--g-star-glow)] [.galaxy-star_.star-core_&]:opacity-[.58] [.galaxy-star_.star-core_&]:[transform-box:fill-box] [.galaxy-star_.star-core_&]:origin-[center] [.galaxy-star_.star-core_&]:[transform:scale(1.45)] [.galaxy-star.active_.star-core_&]:opacity-[.88] [.galaxy-star.active_.star-core_&]:[transform:scale(1.82)]`,d:`M16 0 L19.7 12.3 L32 16 L19.7 19.7 L16 32 L12.3 19.7 L0 16 L12.3 12.3 Z`}),(0,C.jsx)(`path`,{className:`star-shape [.galaxy-star_.star-core_&]:[fill:var(--g-star-color)]`,d:`M16 2 L18.8 13.2 L30 16 L18.8 18.8 L16 30 L13.2 18.8 L2 16 L13.2 13.2 Z`}),(0,C.jsx)(`circle`,{className:`star-heart [.galaxy-star_.star-core_&]:[fill:var(--g-star-core)]`,cx:`16`,cy:`16`,r:`3.2`})]}),(0,C.jsx)(`span`,{className:`star-label [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:opacity-[.3] [.galaxy-stage.has-focus_.galaxy-star.dimmed_&]:[transition:opacity_.45s_var(--ease-out)] [.galaxy-star_&]:absolute [.galaxy-star_&]:top-[calc(50%_+_17px)] [.galaxy-star_&]:left-[50%] [.galaxy-star_&]:max-w-[120px] [.galaxy-star_&]:overflow-hidden [.galaxy-star_&]:text-[var(--galaxy-label)] [.galaxy-star_&]:text-[11px] [.galaxy-star_&]:leading-[1.35] [.galaxy-star_&]:pointer-events-none [.galaxy-star_&]:text-ellipsis [.galaxy-star_&]:[text-shadow:0_1px_7px_var(--galaxy-bg)] [.galaxy-star_&]:[transform:translateX(-50%)] [.galaxy-star_&]:[transition:color_var(--d1)_var(--ease-out)] [.galaxy-star_&]:whitespace-nowrap [.galaxy-star:hover_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:text-[var(--galaxy-label-active)] [.galaxy-star.active_&]:font-[700]`,children:e.title})]},e.id))]}),!!X.length&&(0,C.jsxs)(`span`,{className:`absolute z-[3] [right:12px] [bottom:9px] [border:1px_solid_var(--galaxy-toolbar-border)] rounded-[var(--r-pill)] bg-[rgba(12,11,20,.52)] [padding:3px_10px] text-[var(--galaxy-label)] text-[11px] tracking-[.5px] pointer-events-none [backdrop-filter:blur(6px)]`,children:[`✦`,` `,c(`memory:memoryPage.visibleTotalMemories`,{visible:X.length,total:T.nodes.length})]}),!ve&&!X.length&&(0,C.jsxs)(`div`,{className:`memory-empty [.galaxy-panel_&]:text-[var(--galaxy-label)] [.galaxy-panel_&]:[--stroke:var(--galaxy-toolbar-border)] [.galaxy-panel_&]:[--control-muted:var(--galaxy-label)] [.galaxy-panel_&]:[--star:var(--g-decision)] [.galaxy-panel_&]:[--text-muted:var(--galaxy-label)] absolute z-[3] inset-0 grid [align-content:center] justify-items-center gap-[8px] text-[var(--text-muted)] text-[12px] pointer-events-none`,children:[(0,C.jsx)(ie,{size:44}),(0,C.jsx)(`span`,{children:c(`memory:memoryPage.thisMemorySpaceIsStillUnlitClickInTheTopLeftToPlantTheFirstStar`)})]})]}),(0,C.jsxs)(`div`,{className:`detail-stack flex min-w-0 flex-col gap-[12px] [.mcp-layout_>_&]:min-h-0 max-[1150px]:[.memory-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.memory-layout_>_&]:grid max-[1150px]:[.memory-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.mcp-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.mcp-layout_>_&]:grid max-[1150px]:[.mcp-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.skills-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.skills-layout_>_&]:grid max-[1150px]:[.skills-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:[.memory-layout_>_&]:[grid-column:auto] max-[650px]:[.memory-layout_>_&]:grid-cols-[1fr] max-[650px]:[.mcp-layout_>_&]:[grid-column:auto] max-[650px]:[.mcp-layout_>_&]:grid-cols-[1fr] max-[650px]:[.skills-layout_>_&]:[grid-column:auto] max-[650px]:[.skills-layout_>_&]:grid-cols-[1fr]`,children:[(0,C.jsxs)(x,{children:[(0,C.jsx)(b,{title:c(`memory:memoryPage.selectedMemory`)}),Y?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`h2`,{children:Y.title}),(0,C.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:Y.content}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.memoryType`)}),(0,C.jsxs)(`strong`,{className:`inline-flex items-center gap-[6px]`,children:[(0,C.jsx)(`i`,{className:`g-dot [&.g-concept]:bg-[var(--g-concept)] [&.g-concept]:shadow-[0_0_5px_var(--g-concept-glow)] [&.g-file]:bg-[var(--g-file)] [&.g-file]:shadow-[0_0_5px_var(--g-file-glow)] [&.g-risk]:bg-[var(--g-risk)] [&.g-risk]:shadow-[0_0_5px_var(--g-risk-glow)] [&.g-preference]:bg-[var(--g-preference)] [&.g-preference]:shadow-[0_0_5px_var(--g-preference-glow)] [&.g-decision]:bg-[var(--g-decision)] [&.g-decision]:shadow-[0_0_5px_var(--g-decision-glow)] [&.g-fact]:bg-[var(--g-fact)] [&.g-fact]:shadow-[0_0_5px_var(--g-fact-glow)] [&.g-task]:bg-[var(--g-task)] [&.g-task]:shadow-[0_0_5px_var(--g-task-glow)] inline-block w-[7px] h-[7px] flex-none rounded-[50%] g-${Y.type}`}),de(Y.type,c)]})]}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.source`)}),(0,C.jsx)(`strong`,{children:Y.sourceType===`conversation_confirmed`?c(`memory:memoryPage.userConfirmedConversationCandidate`):Y.sourceType===`user_confirmed`?c(`memory:memoryPage.explicitUserRequest`):Y.sourceType===`agent`?c(`memory:memoryPage.createdByAgent`):c(`memory:memoryPage.addedManually`)})]}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.authority`)}),(0,C.jsxs)(`strong`,{children:[Y.authority??0,`/100`]})]}),Y.evidence&&(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.evidence`)}),(0,C.jsx)(`strong`,{children:Y.evidence})]}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.created`)}),(0,C.jsx)(`strong`,{children:D(Y.createdAt,_)})]}),(0,C.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,C.jsx)(`span`,{children:c(`memory:memoryPage.relatedMemories`)}),(0,C.jsx)(`strong`,{children:c(`memory:memoryPage.count`,{count:Ne.size})})]}),(0,C.jsxs)(`div`,{className:`mt-[15px] flex gap-2 max-[650px]:flex-wrap`,children:[(0,C.jsxs)(g,{size:`lg`,onClick:()=>L(Y),children:[(0,C.jsx)(p,{size:14}),c(`memory:memoryPage.edit`)]}),(0,C.jsxs)(g,{variant:`destructive`,size:`lg`,onClick:()=>Ie(Y),children:[(0,C.jsx)(re,{size:14}),c(`memory:memoryPage.delete`)]})]})]}):(0,C.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:c(`memory:memoryPage.selectAMemoryInTheMapToViewItsDetails`)}),be&&(0,C.jsx)(v,{children:be})]}),(0,C.jsxs)(x,{children:[(0,C.jsx)(b,{title:c(`memory:memoryPage.relatedFiles`)}),Fe.map(e=>(0,C.jsxs)(`div`,{className:`file-row [&_span]:flex [&_span]:min-w-0 [&_span]:flex-col [&_span]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[13px] grid grid-cols-[auto_minmax(0,1fr)_auto_auto_auto] items-center gap-[6px] [border-top:1px_solid_var(--stroke-soft)] [padding:8px_0]`,children:[(0,C.jsx)(d,{size:15}),(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`strong`,{children:e.title}),(0,C.jsx)(`small`,{children:e.sourcePath||e.cwd||c(`memory:memoryPage.localMemory`)})]}),(0,C.jsx)(`button`,{onClick:()=>N(e.id),children:c(`memory:memoryPage.view`)}),(0,C.jsx)(`button`,{onClick:()=>L(e),children:(0,C.jsx)(p,{size:13})}),(0,C.jsx)(`button`,{className:`danger`,onClick:()=>Ie(e),children:(0,C.jsx)(re,{size:13})})]},e.id)),!Fe.length&&(0,C.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-muted)] text-[12px] leading-[1.55]`,children:c(`memory:memoryPage.thisMemoryHasNoRelatedFiles`)})]})]}),I&&(0,C.jsx)(ge,{spaces:T.spaces,node:I.id?I:null,initialSpaceId:I.spaceId||A,onClose:()=>L(null),onSaved:async t=>{L(null),e(t),await J(A)}}),R&&(0,C.jsx)(_e,{space:R.id?R:null,onClose:()=>z(null),onSaved:async(t,n)=>{z(null),j(t.id),e(n)}})]})}function ge({spaces:e,node:t,initialSpaceId:n,onClose:a,onSaved:o}){let{t:s}=r(),[c,l]=(0,S.useState)({spaceId:t?.spaceId||n||e[0]?.id||``,title:t?.title||``,content:t?.content||``,type:t?.type||`concept`,sourcePath:t?.sourcePath||``,importance:t?.importance??.5}),[u,d]=(0,S.useState)(!1),[ee,f]=(0,S.useState)(``);return(0,C.jsx)(`div`,{className:`modal-backdrop max-[650px]:p-[8px] fixed z-[70] inset-0 grid place-items-center overflow-y-auto bg-[var(--modal-overlay)] [backdrop-filter:blur(3px)] [padding:20px] [overscroll-behavior:contain] [animation:fade-in_var(--d1)_var(--ease-out)]`,onMouseDown:e=>!u&&e.target===e.currentTarget&&a(),children:(0,C.jsxs)(`form`,{role:`dialog`,"aria-modal":`true`,"aria-label":s(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`),className:`modal !w-[min(430px,100%)] max-h-[calc(100dvh_-_40px)] overflow-y-auto [overscroll-behavior:contain] [border:1px_solid_var(--surface-highlight)] rounded-[var(--r-md)] bg-[var(--solid)] p-[18px] shadow-[0_26px_70px_-25px_var(--shadow-strong)] [animation:modal-in_var(--d2)_var(--ease-out)] max-[650px]:max-h-[calc(100dvh_-_16px)]`,onSubmit:async e=>{if(e.preventDefault(),!u){d(!0),f(``);try{await h(t?`/api/memory/nodes/${encodeURIComponent(t.id)}`:`/api/memory/nodes`,{method:t?`PATCH`:`POST`,body:JSON.stringify(c)}),await o(s(t?`memory:memoryPage.memoryUpdated`:`memory:memoryPage.memoryCreated`))}catch(e){f(k(e))}finally{d(!1)}}},children:[(0,C.jsxs)(y,{children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{children:s(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`)}),(0,C.jsx)(`p`,{children:s(`memory:memoryPage.lightUpIdeasWorthKeepingAsMemoriesYouCanReturnToLater`)})]}),(0,C.jsx)(g,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":s(`memory:memoryPage.closeDialog`),disabled:u,onClick:a,children:(0,C.jsx)(m,{size:17})})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.memorySpace`),(0,C.jsx)(i,{value:c.spaceId,onChange:e=>l({...c,spaceId:e.target.value}),children:e.map(e=>(0,C.jsx)(`option`,{value:e.id,children:O(e,s)},e.id))})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.memoryTitle`),(0,C.jsx)(`input`,{value:c.title,onChange:e=>l({...c,title:e.target.value}),placeholder:s(`memory:memoryPage.forExampleProjectUIConstraints`)})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.memoryContent`),(0,C.jsx)(`textarea`,{value:c.content,onChange:e=>l({...c,content:e.target.value}),placeholder:s(`memory:memoryPage.recordStandaloneReusableMemoryForFutureChats`)})]}),(0,C.jsxs)(`div`,{className:`form-grid grid gap-[9px]`,children:[(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.memoryType`),(0,C.jsx)(i,{value:c.type,onChange:e=>l({...c,type:e.target.value}),children:ue.map(e=>(0,C.jsx)(`option`,{value:e,children:de(e,s)},e))})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.importance`),(0,C.jsxs)(i,{value:c.importance,onChange:e=>l({...c,importance:Number(e.target.value)}),children:[(0,C.jsx)(`option`,{value:`0.3`,children:s(`memory:memoryPage.normal`)}),(0,C.jsx)(`option`,{value:`0.5`,children:s(`memory:memoryPage.common`)}),(0,C.jsx)(`option`,{value:`0.8`,children:s(`memory:memoryPage.important`)}),(0,C.jsx)(`option`,{value:`1`,children:s(`memory:memoryPage.strict`)})]})]})]}),(0,C.jsxs)(_,{variant:`control`,children:[s(`memory:memoryPage.relatedFilePath`),(0,C.jsx)(`input`,{value:c.sourcePath,onChange:e=>l({...c,sourcePath:e.target.value}),placeholder:s(`memory:memoryPage.optionalForExampleECodeProjectREADMEMd`)})]}),ee&&(0,C.jsx)(v,{children:ee}),(0,C.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,C.jsx)(g,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:a,children:s(`memory:memoryPage.cancel`)}),(0,C.jsxs)(g,{size:`lg`,disabled:u||!c.spaceId||!c.title.trim()||!c.content.trim(),children:[u?(0,C.jsx)(ne,{className:`animate-spin`,size:14}):(0,C.jsx)(p,{size:14}),s(u?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}function _e({space:e,onClose:t,onSaved:n}){let{t:i}=r(),[a,o]=(0,S.useState)(e?.name||``),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``);return(0,C.jsx)(`div`,{className:`modal-backdrop max-[650px]:p-[8px] fixed z-[70] inset-0 grid place-items-center overflow-y-auto bg-[var(--modal-overlay)] [backdrop-filter:blur(3px)] [padding:20px] [overscroll-behavior:contain] [animation:fade-in_var(--d1)_var(--ease-out)]`,onMouseDown:e=>!s&&e.target===e.currentTarget&&t(),children:(0,C.jsxs)(`form`,{role:`dialog`,"aria-modal":`true`,"aria-label":i(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`),className:`modal !w-[min(430px,100%)] max-h-[calc(100dvh_-_40px)] overflow-y-auto [overscroll-behavior:contain] [border:1px_solid_var(--surface-highlight)] rounded-[var(--r-md)] bg-[var(--solid)] p-[18px] shadow-[0_26px_70px_-25px_var(--shadow-strong)] [animation:modal-in_var(--d2)_var(--ease-out)] max-[650px]:max-h-[calc(100dvh_-_16px)]`,onSubmit:async t=>{if(t.preventDefault(),!s){c(!0),u(``);try{await n(await h(e?`/api/memory/spaces/${encodeURIComponent(e.id)}`:`/api/memory/spaces`,{method:e?`PATCH`:`POST`,body:JSON.stringify({name:a,kind:`custom`})}),i(e?`memory:memoryPage.memorySpaceRenamed`:`memory:memoryPage.memorySpaceCreated`))}catch(e){u(k(e))}finally{c(!1)}}},children:[(0,C.jsxs)(y,{children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{children:i(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`)}),(0,C.jsx)(`p`,{children:i(`memory:memoryPage.giveEachThemeOrProjectItsOwnMemorySpaceSoDurableMemoriesHaveSomewhereToBelong`)})]}),(0,C.jsx)(g,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":i(`memory:memoryPage.closeDialog`),disabled:s,onClick:t,children:(0,C.jsx)(m,{size:17})})]}),(0,C.jsxs)(_,{variant:`control`,children:[i(`memory:memoryPage.memorySpaceName`),(0,C.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:i(`memory:memoryPage.forExampleProductDesignGuidelines`),autoFocus:!0})]}),l&&(0,C.jsx)(v,{children:l}),(0,C.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,C.jsx)(g,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:t,children:i(`memory:memoryPage.cancel`)}),(0,C.jsxs)(g,{size:`lg`,disabled:s||!a.trim(),children:[s?(0,C.jsx)(ne,{className:`animate-spin`,size:14}):(0,C.jsx)(te,{size:14}),i(s?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})}export{A as MemoryPage};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AssetsPage-C7AlHS3s.js","assets/rolldown-runtime-B0Z9INg1.js","assets/index-Dm1UDg72.js","assets/vendor-router-CZg2bCPV.js","assets/vendor-react-DwNgTV1j.js","assets/index-DJAtBVyc.css","assets/use-i18n-C7st2Mx5.js","assets/i18n-DKgrgj0w.js","assets/storage-BpAqa-YY.js","assets/vendor-state-GkUciC5H.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/download-BCfIiuaL.js","assets/external-link-CEQqPcqc.js","assets/file-Bllajneu.js","assets/link-2-mgasYn21.js","assets/paperclip-BCXrwYpb.js","assets/plus-fQbSqB1n.js","assets/refresh-cw-TbWxTY4K.js","assets/trash-2-CNrPOoPR.js","assets/triangle-alert-CE1q54ci.js","assets/x-07u4-129.js","assets/api-DmuPqjXK.js","assets/http-C4bTWPzF.js","assets/abort-signal-f4JsiYKX.js","assets/button-CQA36izu.js","assets/vendor-ui-DvrYggeS.js","assets/dist-Cfh4kzCK.js","assets/utils-C8uzG5AZ.js","assets/field-3bN8nouy.js","assets/label-BzlNatZM.js","assets/dist-B_a0oV4U.js","assets/separator-BDICnhEL.js","assets/format-BRFKAYMT.js","assets/app-primitives-BBXY6U2S.js","assets/switch-Ci_hmu39.js","assets/dist-TksYpDID.js","assets/tabs-DQYVDdOp.js","assets/dist-DAs5KRGl.js","assets/card-BdUpL1KB.js","assets/StarOrbit-BAAjh-hY.js","assets/usePagePrimaryAction-CWPC0C_f.js","assets/MarkdownMessage-DeTzbwid.js","assets/vendor-markdown-plugins-DisoihU3.js","assets/vendor-shiki-runtime-UFMr0O-Q.js","assets/vendor-markdown-plugins-DEcVZfaU.css","assets/vendor-markdown-Ck4Y_w0n.js","assets/check-2vYc6QaP.js","assets/copy-DHmIFc52.js","assets/route-context-DvWDul4T.js","assets/mobile-runtime-recovery-tbTyacip.js","assets/PluginsPage-DVCWLVRB.js","assets/dist-BdkTa5R3.js","assets/es2015-0QT3KgdC.js","assets/AppSelect-D149YYg1.js","assets/dist-BlIIpW6W.js","assets/dist-alOyD2Bh.js","assets/chevron-down-CxtxIjiP.js","assets/use-mobile-YXncArOq.js","assets/circle-check-iEdCm3Pw.js","assets/earth-Ddy13fHh.js","assets/shield-alert-CvFOTe9h.js","assets/file-code-corner-BnE1ljT0.js","assets/folder-open-FIShC5Qk.js","assets/image-BY_c3FYU.js","assets/loader-circle-BOwQzHB-.js","assets/plug-BsIeHRwC.js","assets/search-D0mqDaf_.js","assets/server-BgNvmqwJ.js","assets/dialog-D-ER2p-D.js","assets/runtime-capabilities-store-1N8axw9r.js","assets/pick-system-directory-BnIFt85A.js","assets/tool-labels-DJzY62Yr.js","assets/TerminalPanel-PK0ubUYF.js","assets/minus-BuutOHSj.js","assets/square-terminal-BVG6cUT1.js","assets/events-DjkpUZEu.js","assets/TerminalPanel-BrP-ENHg.css"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{p as t}from"./vendor-router-CZg2bCPV.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-C7st2Mx5.js";import{t as a}from"./utils-C8uzG5AZ.js";import{t as o}from"./blocks-Olsdp5Lp.js";import{t as s}from"./file-diff-GxOMJkLj.js";import{t as c}from"./folder-open-FIShC5Qk.js";import{t as l}from"./panels-top-left-K8n2CefH.js";import{t as u}from"./square-terminal-BVG6cUT1.js";import{t as d}from"./button-CQA36izu.js";import{t as f}from"./SessionFilesPane-CUhqwp87.js";import{n as p}from"./MobileShellContext-D8qX-BlM.js";var m=e(n(),1),h=r(),g=(0,m.lazy)(()=>t(()=>import(`./AssetsPage-C7AlHS3s.js`).then(e=>({default:e.AssetsPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]))),_=(0,m.lazy)(()=>t(()=>import(`./PluginsPage-DVCWLVRB.js`).then(e=>({default:e.PluginsPage})),__vite__mapDeps([50,1,4,6,7,3,2,5,8,9,26,30,51,52,53,54,37,55,35,27,25,10,46,56,57,58,59,12,60,61,62,63,64,65,17,66,67,18,19,21,22,23,24,68,20,33,34,36,38,69,70,40,71]))),v=(0,m.lazy)(()=>t(()=>import(`./TerminalPanel-PK0ubUYF.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([72,1,4,10,56,73,16,74,20,21,22,3,7,2,5,8,23,24,25,26,27,75,76]))),y=[{id:`assets`,icon:c},{id:`changes`,icon:s},{id:`session-tools`,icon:l},{id:`extensions`,icon:o},{id:`terminal`,icon:u}];function b(){let[e,t]=(0,m.useState)(null);return{action:e,register:(0,m.useCallback)(e=>(t(()=>e),()=>t(t=>t===e?null:t)),[])}}function x({visible:e,sessionStreaming:t,onCloseTerminal:n,onOpenChat:r,tab:o,onTabChange:s,activeSessionId:c,query:l,notify:x,requestConfirm:S,requestText:C,onUseAsset:w,terminalSupported:T,terminalLabels:E,resolveSessionCwd:D}){let{t:O}=i(),{setSessionToolsHost:k}=p(),A={assets:O(`navigation:navigation.assets`),changes:O(`navigation:mobileShell.changes`),"session-tools":O(`navigation:mobileShell.sessionTools`),extensions:O(`navigation:mobileShell.extensions`),terminal:O(`navigation:mobileShell.terminal`)},j=b(),M=b(),[N,P]=(0,m.useState)(()=>new Set([o]));(0,m.useEffect)(()=>{P(e=>e.has(o)?e:new Set([...e,o]))},[o]);let F=e=>N.has(e)||o===e;return(0,h.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,"data-mobile-context-screen":!0,children:[(0,h.jsx)(`div`,{className:`flex flex-none gap-1 overflow-x-auto border-b border-[var(--stroke-soft)] px-2 py-1.5 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,role:`tablist`,"aria-label":O(`navigation:mobileShell.context`),"data-swipe-ignore":!0,children:y.map(({id:e,icon:t})=>{let n=o===e;return(0,h.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":n,className:a(`flex h-8 flex-none items-center gap-1.5 rounded-full px-2.5 text-[12px] font-medium`,n?`bg-[var(--star-soft)] text-[var(--star-strong)]`:`text-[var(--text-muted)]`),onClick:()=>s(e),children:[(0,h.jsx)(t,{size:14,"aria-hidden":`true`}),A[e]]},e)})}),(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:[(0,h.jsx)(`div`,{ref:k,hidden:o!==`session-tools`||t===null,className:`h-full min-h-0`,"data-mobile-session-tools-host":!0}),o===`session-tools`&&t===null&&(0,h.jsx)(d,{className:`m-3`,variant:`outline`,onClick:r,children:O(`navigation:mobileShell.toolsOpenChat`)}),F(`assets`)&&(0,h.jsxs)(`div`,{hidden:o!==`assets`,className:`h-full overflow-auto px-3 py-3 [&_.asset-grid]:!grid-cols-1`,children:[(0,h.jsx)(d,{className:`mb-3`,disabled:!j.action,onClick:()=>j.action?.(),children:O(`assets:assetsPage.addLink`)}),(0,h.jsx)(m.Suspense,{fallback:null,children:(0,h.jsx)(g,{query:l,notify:x,registerPrimaryAction:j.register,requestConfirm:S,onUse:w},c)})]}),o===`changes`&&(c?t===null?(0,h.jsx)(d,{className:`m-3`,variant:`outline`,onClick:r,children:O(`navigation:mobileShell.changesOpenChat`)}):(0,h.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:(0,h.jsx)(f,{sessionId:c,streaming:t,requestConfirm:S},c)}):(0,h.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground`,children:O(`navigation:mobileShell.noSessionChanges`)})),F(`extensions`)&&(0,h.jsxs)(`div`,{hidden:o!==`extensions`,className:`h-full overflow-auto px-3 py-3`,children:[(0,h.jsx)(d,{className:`mb-3`,disabled:!M.action,onClick:()=>M.action?.(),children:O(`plugins:pluginsPage.savePolicy`)}),(0,h.jsx)(m.Suspense,{fallback:null,children:(0,h.jsx)(_,{query:l,notify:x,registerPrimaryAction:M.register,requestText:C,requestConfirm:S})})]}),F(`terminal`)&&(0,h.jsx)(`div`,{hidden:o!==`terminal`,className:`h-full min-h-0`,children:T?(0,h.jsx)(m.Suspense,{fallback:null,children:(0,h.jsx)(v,{layout:`fill`,open:e&&o===`terminal`,height:480,labels:E,activeSessionId:c,resolveSessionCwd:D,onOpenChange:e=>{e||n()},onHeightChange:()=>{}})}):(0,h.jsxs)(`div`,{className:`grid h-full place-content-center gap-2 px-6 text-center text-sm text-muted-foreground`,children:[(0,h.jsx)(u,{className:`mx-auto`,size:22,"aria-hidden":`true`}),(0,h.jsx)(`p`,{children:O(`navigation:mobileShell.terminalUnavailable`)})]})})]})]})}export{x as MobileContextScreen};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-a84Zp9dV.js";import{t as i}from"./utils-C8uzG5AZ.js";import{i as a,r as o}from"./settings-navigation-CI7Yt4Or.js";import{t as s}from"./runtime-capabilities-store-CiL3ZPEo.js";var c=e(t(),1),l=n();function u({page:e,configSection:t,mobileApp:n,onNavigate:u}){let{t:d}=r(),f=a(e,t),p=(0,c.useRef)(null),m=s(e=>e.capabilities),h=(0,c.useMemo)(()=>o(d,{mobileApp:n,capabilities:m}).flatMap(e=>e.items).filter(e=>e.destination.type!==`config`||e.destination.id!==`desktop-pet`),[m,n,d]);return(0,c.useEffect)(()=>{p.current?.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[f]),(0,l.jsx)(`nav`,{"aria-label":d(`config:settingsShell.settingsNavigation`),className:`flex flex-none gap-2 overflow-x-auto px-4 pb-3 pt-1 [-ms-overflow-style:none] [scrollbar-width:none] max-[650px]:px-2 [&::-webkit-scrollbar]:hidden`,"data-mobile-navigation":`settings`,children:h.map(e=>{let t=f===e.key,n=e.icon;return(0,l.jsxs)(`button`,{"aria-current":t?`page`:void 0,className:i(`flex flex-none items-center gap-1.5 rounded-full border px-3 py-1.5 text-[12px] font-medium transition-colors`,t?`border-[var(--star-strong)] bg-[var(--star-soft)] text-[var(--star-strong)]`:`border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text)]`),onClick:()=>u(e.destination),ref:t?p:void 0,children:[(0,l.jsx)(n,{"aria-hidden":`true`,size:14}),(0,l.jsx)(`span`,{children:e.label})]},e.key)})})}export{u as MobileSettingsNavigation};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-C7st2Mx5.js";import{t as i}from"./utils-C8uzG5AZ.js";import{i as a,r as o}from"./settings-navigation-dqR4yOPY.js";import{t as s}from"./runtime-capabilities-store-1N8axw9r.js";var c=e(t(),1),l=n();function u({page:e,configSection:t,mobileApp:n,onNavigate:u}){let{t:d}=r(),f=a(e,t),p=(0,c.useRef)(null),m=s(e=>e.capabilities),h=(0,c.useMemo)(()=>o(d,{mobileApp:n,capabilities:m}).flatMap(e=>e.items).filter(e=>e.destination.type!==`config`||e.destination.id!==`desktop-pet`),[m,n,d]);return(0,c.useEffect)(()=>{p.current?.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[f]),(0,l.jsx)(`nav`,{"aria-label":d(`config:settingsShell.settingsNavigation`),className:`flex flex-none gap-2 overflow-x-auto px-4 pb-3 pt-1 [-ms-overflow-style:none] [scrollbar-width:none] max-[650px]:px-2 [&::-webkit-scrollbar]:hidden`,"data-mobile-navigation":`settings`,children:h.map(e=>{let t=f===e.key,n=e.icon;return(0,l.jsxs)(`button`,{"aria-current":t?`page`:void 0,className:i(`flex flex-none items-center gap-1.5 rounded-full border px-3 py-1.5 text-[12px] font-medium transition-colors`,t?`border-[var(--star-strong)] bg-[var(--star-soft)] text-[var(--star-strong)]`:`border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text)]`),onClick:()=>u(e.destination),ref:t?p:void 0,children:[(0,l.jsx)(n,{"aria-hidden":`true`,size:14}),(0,l.jsx)(`span`,{children:e.label})]},e.key)})})}export{u as MobileSettingsNavigation};
@@ -1 +1 @@
1
- import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-a84Zp9dV.js";import{t as n}from"./utils-C8uzG5AZ.js";import{t as r}from"./ThemeToggleButton-C5QA5Kf2.js";import{t as i}from"./link-2-mgasYn21.js";import{t as a}from"./WorkbenchSidebarToggle-CcO1Al5A.js";import{t as o}from"./play-DNDjDNGn.js";import{t as s}from"./plus-fQbSqB1n.js";import{t as c}from"./rocket-BgLSjoHY.js";import{t as l}from"./save-CHBB52P8.js";import{t as u}from"./search-D0mqDaf_.js";import{t as d}from"./square-terminal-BVG6cUT1.js";import{t as f}from"./square-bHHVTT3G.js";import{t as p}from"./button-CQA36izu.js";import{o as m}from"./shortcuts-C_Cph88H.js";var h=e();function g({elementRef:e,meta:g,page:_,query:v,setQuery:y,configSection:b,onPrimary:x,searchSlot:S,actionsSlot:C,theme:w,onCycleTheme:T,searchInputRef:E,workflowActions:D,desktopPlatform:O,mobileApp:k=!1,terminalOpen:A,onToggleTerminal:j}){let{t:M}=t(),N=m(`primaryAction`),P=m(`toggleTerminal`),F={chatHistory:[M(`navigation:pageHeader.newChat`),s],assets:[M(`navigation:pageHeader.addLink`),i],channels:[M(`navigation:pageHeader.connectChannel`),s],schedules:[M(`navigation:pageHeader.newTask`),s],config:[M(`navigation:pageHeader.quickSetup`),s],plugins:[M(`navigation:pageHeader.savePolicy`),l],memory:[M(`navigation:pageHeader.addMemory`),s],mcp:[M(`navigation:pageHeader.addService`),s],skills:[M(`navigation:pageHeader.installSkill`),s],workflows:[M(`navigation:pageHeader.newWorkflow`),s],workflowCreate:[M(`navigation:pageHeader.publish`),c]},I=_===`config`&&b!==`models`?null:_===`chat`?k?[M(`navigation:pageHeader.newChat`),s]:null:F[_],L=!!O;return(0,h.jsxs)(`header`,{ref:e,"data-window-drag-region":!0,className:n(`relative z-[2] flex min-h-14 flex-none items-center gap-3.5 px-6 pt-[9px] pb-[7px] in-data-[density=compact]:min-h-[50px] in-data-[density=compact]:pt-1.5 in-data-[density=compact]:pb-[5px] max-[650px]:min-h-[126px] max-[650px]:flex-wrap max-[650px]:content-center max-[650px]:gap-2.5 max-[650px]:px-4 max-[650px]:py-2.5`,_===`chat`&&`!min-h-12 px-4 !py-1.5 max-[650px]:!flex-nowrap`,L&&`[-webkit-app-region:drag]`,window.pisperDesktop?.customTitlebar&&`pr-[148px]`,O===`darwin`&&`pl-[74px]`),children:[(0,h.jsx)(a,{}),(0,h.jsxs)(`div`,{className:`mr-auto flex min-w-[170px] items-baseline gap-2.5 max-[650px]:block max-[650px]:min-w-0 max-[650px]:flex-1`,children:[(0,h.jsx)(`h1`,{className:`shrink-0 whitespace-nowrap text-base leading-[1.15] font-semibold tracking-normal max-[650px]:text-[21px]`,children:g[0]}),(0,h.jsx)(`p`,{className:n(`mt-0 min-w-0 overflow-hidden text-[12px] text-ellipsis whitespace-nowrap text-[var(--text-muted)] max-[650px]:mt-[3px] max-[650px]:whitespace-normal`,_===`chat`&&`hidden`),children:g[1]})]}),(0,h.jsxs)(`div`,{className:n(`flex min-w-0 items-center justify-end gap-2 max-[650px]:grid max-[650px]:w-full max-[650px]:grid-cols-[minmax(0,1fr)_auto] max-[650px]:justify-stretch`,_===`workflowCreate`&&`max-[650px]:grid-cols-[repeat(3,auto)] max-[650px]:justify-end`,_===`chat`&&`max-[650px]:!flex max-[650px]:!w-auto max-[650px]:shrink-0`,L&&`[-webkit-app-region:no-drag]`,O&&O!==`darwin`&&`pr-[138px]`),children:[_===`workflowCreate`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(p,{variant:`outline`,size:`lg`,className:`bg-surface-subtle max-[650px]:col-auto max-[650px]:row-start-1`,disabled:!D||D.busy||D.running,onClick:()=>D?.save(),children:[(0,h.jsx)(l,{size:15}),M(`navigation:pageHeader.saveDraft`)]}),(0,h.jsxs)(p,{size:`lg`,className:`max-[650px]:col-auto max-[650px]:row-start-1`,disabled:!D||D.busy,onClick:()=>D?.run(),children:[D?.running?(0,h.jsx)(f,{size:15}):(0,h.jsx)(o,{size:15}),D?.running?M(`navigation:pageHeader.stop`):M(`navigation:pageHeader.testRun`)]})]}):_===`chat`||_===`gameAssetWorkbench`||_===`customComponentTool`?null:_===`config`?S:(0,h.jsxs)(`label`,{className:`flex h-[34px] w-[min(250px,24vw)] items-center gap-[7px] rounded-[var(--r-sm)] border border-[var(--stroke)] bg-[var(--search-bg)] px-2.5 text-[var(--text-muted)] focus-within:border-[var(--focus)] focus-within:shadow-[0_0_0_3px_var(--focus-ring)] in-data-[density=compact]:h-[30px] max-[900px]:w-[190px] max-[650px]:col-start-1 max-[650px]:row-start-1 max-[650px]:w-full max-[650px]:min-w-0`,title:M(`navigation:pageHeader.search`),children:[(0,h.jsx)(u,{size:15}),(0,h.jsx)(`input`,{className:`w-full min-w-0 border-0 bg-transparent text-[length:var(--app-font-size)] font-normal text-[var(--text)] outline-none`,ref:E,value:v,onChange:e=>y(e.target.value),placeholder:_===`mcp`?M(`navigation:pageHeader.searchServicesOrTools`):_===`memory`?M(`navigation:pageHeader.searchMemoriesOrFiles`):M(`navigation:pageHeader.searchPage`,{page:g[0]})})]}),C,I&&(0,h.jsxs)(p,{size:`lg`,variant:_===`workflowCreate`?`outline`:`default`,className:n(`max-[650px]:col-start-2 max-[650px]:row-start-1`,_===`chat`&&k&&`hidden`),title:N?M(`navigation:pageHeader.primaryActionShortcut`,{action:I[0],shortcut:N}):I[0],onClick:x,disabled:_===`workflowCreate`&&(!D||D.busy),children:[(()=>{let e=I[1];return(0,h.jsx)(e,{size:15})})(),I[0]]}),L&&(0,h.jsx)(p,{variant:`ghost`,size:`icon`,className:A?`bg-surface-hover text-brand`:void 0,title:P?`${M(`navigation:pageHeader.toggleTerminal`)} (${P})`:M(`navigation:pageHeader.toggleTerminal`),"aria-label":M(`navigation:pageHeader.toggleTerminal`),"aria-pressed":A,onClick:j,children:(0,h.jsx)(d,{size:16})}),(0,h.jsx)(r,{theme:w,onCycle:T,className:n(`bg-[var(--solid)]`,_!==`chat`&&`max-[650px]:absolute max-[650px]:top-3.5 max-[650px]:right-4`)})]})]})}export{g as PageHeader};
1
+ import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-C7st2Mx5.js";import{t as n}from"./utils-C8uzG5AZ.js";import{t as r}from"./ThemeToggleButton-BFby07PX.js";import{t as i}from"./link-2-mgasYn21.js";import{t as a}from"./WorkbenchSidebarToggle-B-YDZEZn.js";import{t as o}from"./play-DNDjDNGn.js";import{t as s}from"./plus-fQbSqB1n.js";import{t as c}from"./rocket-BgLSjoHY.js";import{t as l}from"./save-CHBB52P8.js";import{t as u}from"./search-D0mqDaf_.js";import{t as d}from"./square-terminal-BVG6cUT1.js";import{t as f}from"./square-bHHVTT3G.js";import{t as p}from"./button-CQA36izu.js";import{o as m}from"./shortcuts-CAX2SVZi.js";var h=e();function g({elementRef:e,meta:g,page:_,query:v,setQuery:y,configSection:b,onPrimary:x,searchSlot:S,actionsSlot:C,theme:w,onCycleTheme:T,searchInputRef:E,workflowActions:D,desktopPlatform:O,mobileApp:k=!1,terminalOpen:A,onToggleTerminal:j}){let{t:M}=t(),N=m(`primaryAction`),P=m(`toggleTerminal`),F={chatHistory:[M(`navigation:pageHeader.newChat`),s],assets:[M(`navigation:pageHeader.addLink`),i],channels:[M(`navigation:pageHeader.connectChannel`),s],schedules:[M(`navigation:pageHeader.newTask`),s],config:[M(`navigation:pageHeader.quickSetup`),s],plugins:[M(`navigation:pageHeader.savePolicy`),l],memory:[M(`navigation:pageHeader.addMemory`),s],mcp:[M(`navigation:pageHeader.addService`),s],skills:[M(`navigation:pageHeader.installSkill`),s],workflows:[M(`navigation:pageHeader.newWorkflow`),s],workflowCreate:[M(`navigation:pageHeader.publish`),c]},I=_===`config`&&b!==`models`?null:_===`chat`?k?[M(`navigation:pageHeader.newChat`),s]:null:F[_],L=!!O;return(0,h.jsxs)(`header`,{ref:e,"data-window-drag-region":!0,className:n(`relative z-[2] flex min-h-14 flex-none items-center gap-3.5 px-6 pt-[9px] pb-[7px] in-data-[density=compact]:min-h-[50px] in-data-[density=compact]:pt-1.5 in-data-[density=compact]:pb-[5px] max-[650px]:min-h-[126px] max-[650px]:flex-wrap max-[650px]:content-center max-[650px]:gap-2.5 max-[650px]:px-4 max-[650px]:py-2.5`,_===`chat`&&`!min-h-12 px-4 !py-1.5 max-[650px]:!flex-nowrap`,L&&`[-webkit-app-region:drag]`,window.pisperDesktop?.customTitlebar&&`pr-[148px]`,O===`darwin`&&`pl-[74px]`),children:[(0,h.jsx)(a,{}),(0,h.jsxs)(`div`,{className:`mr-auto flex min-w-[170px] items-baseline gap-2.5 max-[650px]:block max-[650px]:min-w-0 max-[650px]:flex-1`,children:[(0,h.jsx)(`h1`,{className:`shrink-0 whitespace-nowrap text-base leading-[1.15] font-semibold tracking-normal max-[650px]:text-[21px]`,children:g[0]}),(0,h.jsx)(`p`,{className:n(`mt-0 min-w-0 overflow-hidden text-[12px] text-ellipsis whitespace-nowrap text-[var(--text-muted)] max-[650px]:mt-[3px] max-[650px]:whitespace-normal`,_===`chat`&&`hidden`),children:g[1]})]}),(0,h.jsxs)(`div`,{className:n(`flex min-w-0 items-center justify-end gap-2 max-[650px]:grid max-[650px]:w-full max-[650px]:grid-cols-[minmax(0,1fr)_auto] max-[650px]:justify-stretch`,_===`workflowCreate`&&`max-[650px]:grid-cols-[repeat(3,auto)] max-[650px]:justify-end`,_===`chat`&&`max-[650px]:!flex max-[650px]:!w-auto max-[650px]:shrink-0`,L&&`[-webkit-app-region:no-drag]`,O&&O!==`darwin`&&`pr-[138px]`),children:[_===`workflowCreate`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(p,{variant:`outline`,size:`lg`,className:`bg-surface-subtle max-[650px]:col-auto max-[650px]:row-start-1`,disabled:!D||D.busy||D.running,onClick:()=>D?.save(),children:[(0,h.jsx)(l,{size:15}),M(`navigation:pageHeader.saveDraft`)]}),(0,h.jsxs)(p,{size:`lg`,className:`max-[650px]:col-auto max-[650px]:row-start-1`,disabled:!D||D.busy,onClick:()=>D?.run(),children:[D?.running?(0,h.jsx)(f,{size:15}):(0,h.jsx)(o,{size:15}),D?.running?M(`navigation:pageHeader.stop`):M(`navigation:pageHeader.testRun`)]})]}):_===`chat`||_===`gameAssetWorkbench`||_===`customComponentTool`?null:_===`config`?S:(0,h.jsxs)(`label`,{className:`flex h-[34px] w-[min(250px,24vw)] items-center gap-[7px] rounded-[var(--r-sm)] border border-[var(--stroke)] bg-[var(--search-bg)] px-2.5 text-[var(--text-muted)] focus-within:border-[var(--focus)] focus-within:shadow-[0_0_0_3px_var(--focus-ring)] in-data-[density=compact]:h-[30px] max-[900px]:w-[190px] max-[650px]:col-start-1 max-[650px]:row-start-1 max-[650px]:w-full max-[650px]:min-w-0`,title:M(`navigation:pageHeader.search`),children:[(0,h.jsx)(u,{size:15}),(0,h.jsx)(`input`,{className:`w-full min-w-0 border-0 bg-transparent text-[length:var(--app-font-size)] font-normal text-[var(--text)] outline-none`,ref:E,value:v,onChange:e=>y(e.target.value),placeholder:_===`mcp`?M(`navigation:pageHeader.searchServicesOrTools`):_===`memory`?M(`navigation:pageHeader.searchMemoriesOrFiles`):M(`navigation:pageHeader.searchPage`,{page:g[0]})})]}),C,I&&(0,h.jsxs)(p,{size:`lg`,variant:_===`workflowCreate`?`outline`:`default`,className:n(`max-[650px]:col-start-2 max-[650px]:row-start-1`,_===`chat`&&k&&`hidden`),title:N?M(`navigation:pageHeader.primaryActionShortcut`,{action:I[0],shortcut:N}):I[0],onClick:x,disabled:_===`workflowCreate`&&(!D||D.busy),children:[(()=>{let e=I[1];return(0,h.jsx)(e,{size:15})})(),I[0]]}),L&&(0,h.jsx)(p,{variant:`ghost`,size:`icon`,className:A?`bg-surface-hover text-brand`:void 0,title:P?`${M(`navigation:pageHeader.toggleTerminal`)} (${P})`:M(`navigation:pageHeader.toggleTerminal`),"aria-label":M(`navigation:pageHeader.toggleTerminal`),"aria-pressed":A,onClick:j,children:(0,h.jsx)(d,{size:16})}),(0,h.jsx)(r,{theme:w,onCycle:T,className:n(`bg-[var(--solid)]`,_!==`chat`&&`max-[650px]:absolute max-[650px]:top-3.5 max-[650px]:right-4`)})]})]})}export{g as PageHeader};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-a84Zp9dV.js";import{i}from"./dist-Cfh4kzCK.js";import{o as a,s as o}from"./dist-B_a0oV4U.js";import{a as s,c,i as l,l as u,n as d,o as f,r as p,s as m,t as h}from"./dist-BdkTa5R3.js";import{t as g}from"./AppSelect-BCexz4Ty.js";import{t as _}from"./utils-C8uzG5AZ.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as ee}from"./chevron-down-CxtxIjiP.js";import{t as y}from"./circle-check-iEdCm3Pw.js";import{t as b}from"./earth-Ddy13fHh.js";import{t as x}from"./external-link-CEQqPcqc.js";import{n as S,t as C}from"./shield-alert-CvFOTe9h.js";import{t as w}from"./file-code-corner-BnE1ljT0.js";import{t as T}from"./folder-open-FIShC5Qk.js";import{t as E}from"./image-BY_c3FYU.js";import{t as D}from"./loader-circle-BOwQzHB-.js";import{t as te}from"./plug-BsIeHRwC.js";import{t as O}from"./refresh-cw-TbWxTY4K.js";import{t as k}from"./search-D0mqDaf_.js";import{t as A}from"./server-BgNvmqwJ.js";import{t as ne}from"./trash-2-CNrPOoPR.js";import{t as j}from"./triangle-alert-CE1q54ci.js";import{t as M}from"./api-YI8_cHpR.js";import{t as N}from"./button-CQA36izu.js";import{a as P,i as F,o as I,r as L,s as R,t as z}from"./dialog-D-ER2p-D.js";import{c as re,i as B,l as ie,r as ae,s as oe}from"./app-primitives-SxfoFmHc.js";import{i as se,t as ce}from"./runtime-capabilities-store-CiL3ZPEo.js";import{t as le}from"./usePagePrimaryAction-CWPC0C_f.js";import{a as ue,i as V,n as H,o as de,r as fe,t as pe}from"./tool-labels-DJzY62Yr.js";import{n as U,t as me}from"./pick-system-directory-BnIFt85A.js";var W=e(t(),1),G=n(),he=Object.defineProperty,K=(e,t)=>he(e,`name`,{value:t,configurable:!0}),[q,ge]=o(`AlertDialog`,[u]),J=u(),Y=K(e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,G.jsx)(h,{...r,...n,modal:!0})},`AlertDialog`);W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(c,{...i,...r,ref:t})},`AlertDialogTrigger`));var _e=K(e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,G.jsx)(f,{...r,...n})},`AlertDialogPortal`),ve=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(s,{...i,...r,ref:t})},`AlertDialogOverlay`)),[ye,be]=q(`AlertDialogContent`),xe=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,children:r,...o}=e,s=J(n),c=W.useRef(null),l=i(t,c),u=W.useRef(null);return(0,G.jsx)(ye,{scope:n,cancelRef:u,children:(0,G.jsx)(p,{role:`alertdialog`,...s,...o,ref:l,onOpenAutoFocus:a(o.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Se=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(m,{...i,...r,ref:t})},`AlertDialogTitle`)),Ce=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(l,{...i,...r,ref:t})},`AlertDialogDescription`)),we=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(d,{...i,...r,ref:t})},`AlertDialogAction`)),Te=`AlertDialogCancel`,Ee=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=be(Te,n),o=J(n),s=i(t,a);return(0,G.jsx)(d,{...o,...r,ref:s})},`AlertDialogCancel`)),De=Y,Oe=_e,ke=ve,Ae=xe,je=we,Me=Ee,Ne=Se,Pe=Ce,X=v(`package-plus`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M16 17h6`,key:`1ook5g`}],[`path`,{d:`M19 14v6`,key:`1ckrd5`}],[`path`,{d:`M21 10.535V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955`,key:`28k6lz`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]);function Fe({...e}){return(0,G.jsx)(De,{"data-slot":`alert-dialog`,...e})}function Ie({...e}){return(0,G.jsx)(Oe,{"data-slot":`alert-dialog-portal`,...e})}function Le({className:e,...t}){return(0,G.jsx)(ke,{"data-slot":`alert-dialog-overlay`,className:_(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Re({className:e,size:t=`default`,...n}){return(0,G.jsxs)(Ie,{children:[(0,G.jsx)(Le,{}),(0,G.jsx)(Ae,{"data-slot":`alert-dialog-content`,"data-size":t,className:_(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100vh-2rem)] supports-[height:100dvh]:max-h-[calc(100dvh-2rem)] w-full -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto overscroll-contain rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-[var(--stroke-soft)] duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function ze({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:_(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Be({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:_(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-[var(--surface-subtle)] p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Ve({className:e,...t}){return(0,G.jsx)(Ne,{"data-slot":`alert-dialog-title`,className:_(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function He({className:e,...t}){return(0,G.jsx)(Pe,{"data-slot":`alert-dialog-description`,className:_(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Ue({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,G.jsx)(N,{variant:t,size:n,asChild:!0,children:(0,G.jsx)(je,{"data-slot":`alert-dialog-action`,className:_(e),...r})})}function We({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,G.jsx)(N,{variant:t,size:n,asChild:!0,children:(0,G.jsx)(Me,{"data-slot":`alert-dialog-cancel`,className:_(e),...r})})}function Ge(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Ke({open:e,onOpenChange:t,onInstalled:n}){let{t:i}=r(),[a,o]=(0,W.useState)(``),[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(``);return(0,W.useEffect)(()=>{e||(o(``),c(null),u(!1),f(``))},[e]),(0,G.jsx)(z,{open:e,onOpenChange:e=>!l&&t(e),children:(0,G.jsxs)(L,{className:`z-[220] sm:max-w-xl`,overlayClassName:`z-[220]`,children:[(0,G.jsxs)(I,{children:[(0,G.jsxs)(R,{className:`flex items-center gap-2`,children:[(0,G.jsx)(X,{size:17}),i(`plugins:pluginsPage.installLocalPlugin`)]}),(0,G.jsx)(F,{children:i(`plugins:pluginsPage.installLocalPluginDescription`)})]}),(0,G.jsxs)(`div`,{className:`grid gap-3`,children:[(0,G.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-semibold text-[var(--text-soft)]`,children:[i(`plugins:pluginsPage.pluginDirectory`),(0,G.jsxs)(`span`,{className:`flex min-w-0 gap-2`,children:[(0,G.jsx)(`input`,{className:`h-10 min-w-0 flex-1 rounded-md border border-[var(--stroke)] bg-[var(--solid)] px-3 text-[13px] text-[var(--text)] outline-none focus:border-[var(--star-border)]`,value:a,disabled:l,placeholder:i(`plugins:pluginsPage.pluginDirectoryPlaceholder`),onChange:e=>{o(e.target.value),c(null)}}),me()&&(0,G.jsx)(N,{type:`button`,variant:`ghost`,size:`icon`,className:`size-10 shrink-0`,title:i(`plugins:pluginsPage.chooseDirectory`),onClick:async()=>{f(``);try{let e=await U(a);e&&(o(e),c(null))}catch(e){f(e instanceof Error?e.message:String(e))}},children:(0,G.jsx)(T,{size:16})})]})]}),s&&(0,G.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-[var(--stroke)] bg-[var(--surface-muted)] p-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,G.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-md bg-[var(--success-soft)] text-[var(--success)]`,children:(0,G.jsx)(y,{size:17})}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`strong`,{className:`block truncate text-[13px] text-[var(--text)]`,children:s.plugin.name}),(0,G.jsxs)(`small`,{className:`block truncate text-[12px] text-[var(--text-muted)]`,children:[s.plugin.id,` · v`,s.plugin.version,` · `,s.fileCount,` `,i(`plugins:pluginsPage.files`),` · `,Ge(s.byteCount)]})]})]}),(0,G.jsx)(`div`,{className:`grid gap-1.5`,children:s.plugin.capabilities.map(e=>(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-t border-[var(--stroke-soft)] pt-2 text-xs`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{className:`block text-[var(--text)]`,children:e.label}),(0,G.jsx)(`small`,{className:`text-[var(--text-muted)]`,children:e.description})]}),(0,G.jsx)(`code`,{className:`shrink-0 text-[11px] text-[var(--text-soft)]`,children:e.name})]},e.name))}),(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-[var(--warning-soft)] p-2.5 text-xs leading-5 text-[var(--warning-strong)]`,children:[(0,G.jsx)(j,{className:`mt-0.5 shrink-0`,size:15}),(0,G.jsx)(`span`,{children:i(`plugins:pluginsPage.localPluginSecurityWarning`)})]})]}),d&&(0,G.jsxs)(B,{className:`m-0`,children:[(0,G.jsx)(j,{size:14}),(0,G.jsx)(`span`,{children:d})]})]}),(0,G.jsxs)(P,{children:[(0,G.jsx)(N,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,disabled:l,onClick:()=>t(!1),children:i(`common:ui.cancel`)}),(0,G.jsxs)(N,{type:`button`,size:`lg`,disabled:l||!s&&!a.trim(),onClick:s?async()=>{if(!(!s||l)){u(!0),f(``);try{await M(`/api/plugins/install`,{method:`POST`,body:JSON.stringify({inspectionId:s.inspectionId})}),await n(),t(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(!1)}}}:async()=>{if(!(!a.trim()||l)){u(!0),f(``);try{c(await M(`/api/plugins/inspect`,{method:`POST`,body:JSON.stringify({path:a.trim()})}))}catch(e){c(null),f(e instanceof Error?e.message:String(e))}finally{u(!1)}}},children:[l?(0,G.jsx)(D,{className:`animate-spin`,size:15}):s?(0,G.jsx)(X,{size:15}):(0,G.jsx)(y,{size:15}),i(l?`plugins:pluginsPage.processing`:s?`plugins:pluginsPage.installPlugin`:`plugins:pluginsPage.inspectPlugin`)]})]})]})})}var qe=[`tool`,`prompt`,`skill`];function Je(e){let t=Array.isArray(e.resourceTypes)?e.resourceTypes.filter(e=>qe.includes(e)):[];return t.length?t:[`tool`]}function Ye(e,t){return{tool:t(`plugins:pluginsPage.extensionType.tool`),prompt:t(`plugins:pluginsPage.extensionType.prompt`),skill:t(`plugins:pluginsPage.extensionType.skill`)}[e]}var Xe=[`all`,`builtin`,`local`],Ze={read:S,ls:T,grep:k,find:k,edit:w,write:w,bash:A,web_search:b,browser_automation:b,generate_visual:E};function Z(e,t){return t(e===`builtin`?`plugins:pluginsPage.builtIn`:e===`local`?`plugins:pluginsPage.local`:`plugins:pluginsPage.all`)}function Qe(e){return e.flatMap(e=>e.managedExternally?[]:e.capabilities.filter(e=>e.enabled).map(e=>e.name))}function $e(e){return e.filter(e=>!e.managedExternally||e.source===`pi`).flatMap(e=>e.capabilities.map(t=>({...t,pluginId:e.id,pluginName:e.name,pluginDescription:e.description,pluginVersion:e.version,pluginSource:e.source,pluginBuiltIn:e.builtIn,pluginPermissions:e.permissions||[],pluginSystemAccess:!!e.systemAccess})))}function et(e){return e.find(e=>e.source===`pi`&&e.name===`Computer Use`)?.enabled!==!1}function tt(e){return Object.fromEntries(e.filter(e=>e.source===`pi`&&e.name!==`Computer Use`&&!!e.packageSource).map(e=>[e.packageSource,e.enabled!==!1]))}function nt(e,t){return[...e].sort().join(`\0`)===[...t].sort().join(`\0`)}function Q(e,t){return V({id:e.name,name:e.label},t)}function $(e,t){return e.pluginSource===`pi`?e.pluginName:H(e.pluginName,t)}function rt({value:e,testing:t,onChange:n,onTest:i}){let{t:a}=r();return(0,G.jsxs)(`div`,{className:`plugin-tool-config [&_label]:grid [&_label]:gap-[5px] [&_label]:text-[var(--text-muted)] [&_label]:text-[11px] [&_label]:font-[600] [&_select]:w-full [&_select]:h-[34px] [&_select]:[border:1px_solid_var(--stroke)] [&_select]:rounded-[var(--r-xs)] [&_select]:bg-[var(--solid)] [&_select]:p-[0_8px] [&_select]:text-[var(--text)] [&_select]:text-[12px] [&_input]:w-full [&_input]:h-[34px] [&_input]:[border:1px_solid_var(--stroke)] [&_input]:rounded-[var(--r-xs)] [&_input]:bg-[var(--solid)] [&_input]:p-[0_8px] [&_input]:text-[var(--text)] [&_input]:text-[12px] grid gap-[9px] [border-top:1px_solid_var(--stroke)] [padding-top:10px]`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-3`,children:[(0,G.jsxs)(`label`,{children:[a(`plugins:pluginsPage.defaultLanguage`),(0,G.jsxs)(g,{value:e.language,onChange:t=>n({...e,language:t.target.value}),children:[(0,G.jsx)(`option`,{value:`auto`,children:a(`plugins:pluginsPage.auto`)}),(0,G.jsx)(`option`,{value:`zh-CN`,children:a(`plugins:pluginsPage.simplifiedChinese`)}),(0,G.jsx)(`option`,{value:`en-US`,children:a(`plugins:pluginsPage.english`)})]})]}),(0,G.jsxs)(`label`,{children:[a(`plugins:pluginsPage.safeSearch`),(0,G.jsxs)(g,{value:e.safeSearch,onChange:t=>n({...e,safeSearch:Number(t.target.value)}),children:[(0,G.jsx)(`option`,{value:0,children:a(`plugins:pluginsPage.off`)}),(0,G.jsx)(`option`,{value:1,children:a(`plugins:pluginsPage.moderate`)}),(0,G.jsx)(`option`,{value:2,children:a(`plugins:pluginsPage.strict`)})]})]}),(0,G.jsxs)(`label`,{children:[a(`plugins:pluginsPage.resultCount`),(0,G.jsx)(`input`,{type:`number`,min:`1`,max:`12`,value:e.maxResults,onChange:t=>n({...e,maxResults:Number(t.target.value)})})]})]}),(0,G.jsxs)(N,{type:`button`,variant:`outline`,size:`lg`,className:`justify-self-end bg-surface-subtle`,disabled:t,onClick:i,children:[t?(0,G.jsx)(O,{className:`animate-spin`,size:14}):(0,G.jsx)(b,{size:14}),a(t?`plugins:pluginsPage.testing`:`plugins:pluginsPage.testConnection`)]})]})}function it({query:e,notify:t,requestText:n,requestConfirm:i}){let{t:a}=r(),[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(null),[u,d]=(0,W.useState)([]),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(``),v=(0,W.useCallback)(async(e=``)=>{p(!0),_(``);try{let[t,n]=await Promise.all([M(`/api/extensions/market?name=${encodeURIComponent(e)}`),M(`/api/extensions`)]);l(t),d(n.packages||[])}catch(e){_(e instanceof Error?e.message:String(e))}finally{p(!1)}},[]);(0,W.useEffect)(()=>{v(``)},[v]);let ee=(c?.packages||[]).filter(t=>`${t.name} ${t.description}`.toLowerCase().includes(e.trim().toLowerCase())),y=async e=>{if(await i?.({title:a(`plugins:pluginsPage.installExtension`),message:a(`plugins:pluginsPage.extensionSecurityWarning`,{name:e}),confirmLabel:a(`plugins:pluginsPage.installExtension`),tone:`danger`})!==!1){h(e);try{let n=/^(?:[.~\\/]|[A-Za-z]:[\\/])/.test(e)||/^(?:npm:|https?:\/\/|git\+)/i.test(e)?e:`npm:${e}`,r=await M(`/api/extensions/install`,{method:`POST`,body:JSON.stringify({source:n})});d(r.packages||[]),t(a(`plugins:pluginsPage.extensionInstalled`),`success`)}catch(e){t(e instanceof Error?e.message:String(e),`error`)}finally{h(``)}}},b=async()=>{let e=await n?.({title:a(`plugins:pluginsPage.installExtension`),message:a(`plugins:pluginsPage.extensionSourceHelp`),inputLabel:a(`plugins:pluginsPage.extensionSource`),placeholder:`npm:@scope/package or https://github.com/…`,maxLength:2e3});e?.trim()&&await y(e.trim())},S=async e=>{if(await i?.({title:a(`plugins:pluginsPage.uninstallExtension`),message:a(`plugins:pluginsPage.uninstallExtensionDescription`,{name:e.name}),confirmLabel:a(`plugins:pluginsPage.uninstallExtension`),tone:`danger`})!==!1){h(e.source);try{await M(`/api/extensions`,{method:`DELETE`,body:JSON.stringify({source:e.source,scope:e.scope})}),await v(o),t(a(`plugins:pluginsPage.extensionUninstalled`),`success`)}catch(e){t(e instanceof Error?e.message:String(e),`error`)}finally{h(``)}}},C=qe.map(e=>({type:e,items:u.filter(t=>Je(t).includes(e))})).filter(e=>e.items.length>0);return(0,G.jsxs)(`section`,{className:`plugin-market grid gap-[10px] border-t border-[var(--stroke)] pt-[14px]`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-[10px]`,children:[(0,G.jsx)(`h2`,{className:`m-0 text-[14px] font-[650]`,children:a(`plugins:pluginsPage.extensionMarket`)}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsxs)(N,{type:`button`,variant:`outline`,size:`lg`,onClick:b,disabled:!!m,children:[(0,G.jsx)(X,{size:14}),a(`plugins:pluginsPage.installExtension`)]}),(0,G.jsxs)(`a`,{className:`inline-flex h-[34px] items-center gap-1 rounded-[var(--r-xs)] border border-[var(--stroke)] px-2 text-[12px] text-[var(--text-soft)] no-underline hover:bg-[var(--surface-hover)]`,href:`https://pi.dev/packages`,target:`_blank`,rel:`noreferrer`,children:[(0,G.jsx)(x,{size:13}),a(`plugins:pluginsPage.openPackageCatalog`)]})]})]}),(0,G.jsxs)(`form`,{className:`flex min-w-0 gap-2`,onSubmit:e=>{e.preventDefault(),v(o)},children:[(0,G.jsx)(`input`,{className:`h-[34px] min-w-0 flex-1 rounded-[var(--r-xs)] border border-[var(--stroke)] bg-[var(--solid)] px-2 text-[12px] text-[var(--text)]`,value:o,onChange:e=>s(e.target.value),placeholder:a(`plugins:pluginsPage.searchPackageCatalog`),"aria-label":a(`plugins:pluginsPage.searchPackageCatalog`)}),(0,G.jsxs)(N,{type:`submit`,variant:`outline`,size:`lg`,disabled:f,children:[f?(0,G.jsx)(O,{className:`animate-spin`,size:14}):(0,G.jsx)(k,{size:14}),a(`plugins:pluginsPage.search`)]})]}),g&&(0,G.jsx)(`p`,{className:`m-0 text-[12px] text-[var(--danger)]`,children:g}),C.length>0&&(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[(0,G.jsx)(`h3`,{className:`m-0 text-[12px] font-[650] text-[var(--text-secondary)]`,children:a(`plugins:pluginsPage.installedExtensions`)}),C.map(e=>(0,G.jsxs)(`section`,{className:`grid gap-1`,children:[(0,G.jsx)(`h4`,{className:`m-0 text-[11px] font-[650] text-[var(--text-muted)]`,children:Ye(e.type,a)}),e.items.map(t=>(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2 border-t border-[var(--stroke-soft)] py-2`,children:[(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`strong`,{className:`block overflow-hidden text-ellipsis whitespace-nowrap text-[12px]`,children:t.name}),(0,G.jsxs)(`small`,{className:`block overflow-hidden text-ellipsis whitespace-nowrap text-[11px] text-[var(--text-muted)]`,children:[t.source,` · v`,t.version]})]}),(0,G.jsxs)(N,{type:`button`,variant:`ghost`,size:`sm`,disabled:!!m,onClick:()=>void S(t),children:[m===t.source?(0,G.jsx)(D,{className:`animate-spin`,size:13}):(0,G.jsx)(ne,{size:13}),a(`plugins:pluginsPage.uninstallExtension`)]})]},`${e.type}:${t.scope}:${t.source}`))]},e.type))]}),(0,G.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(230px,1fr))] gap-2`,children:ee.slice(0,12).map(e=>{let t=u.some(t=>t.name===e.name||t.source===`npm:${e.name}`);return(0,G.jsxs)(`article`,{className:`grid min-w-0 gap-2 rounded-[var(--r-xs)] border border-[var(--stroke)] bg-[var(--solid)] p-2`,children:[(0,G.jsx)(`strong`,{className:`overflow-hidden text-ellipsis whitespace-nowrap text-[12px]`,title:e.name,children:e.name}),(0,G.jsx)(`p`,{className:`m-0 line-clamp-3 min-h-[45px] text-[11px] leading-[1.45] text-[var(--text-secondary)]`,children:e.description}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`small`,{className:`text-[10px] text-[var(--text-muted)]`,children:e.published}),(0,G.jsxs)(N,{type:`button`,size:`sm`,disabled:t||!!m,onClick:()=>void y(e.name),children:[m===e.name&&(0,G.jsx)(D,{className:`animate-spin`,size:13}),a(t?`plugins:pluginsPage.installed`:`plugins:pluginsPage.installExtension`)]})]})]},e.name)})})]})}function at({query:e=``,notify:t,registerPrimaryAction:n,requestText:i,requestConfirm:a}){let{t:o}=r(),s=ce(e=>e.capabilities),c=se(s,`plugins`),l=c?Xe:Xe.slice(0,2),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)([]),[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(`all`),[v,y]=(0,W.useState)({provider:`bing`,language:`auto`,safeSearch:1,maxResults:8}),[b,x]=(0,W.useState)(!1),[S,w]=(0,W.useState)(!1),[T,E]=(0,W.useState)(!1),[k,A]=(0,W.useState)(null),[P,F]=(0,W.useState)(!1),[I,L]=(0,W.useState)(``),R=(0,W.useCallback)(e=>{d(e),p(e.plugins),y(e.webSearch)},[]),z=(0,W.useCallback)(async()=>{L(``);try{R(await M(`/api/plugins`))}catch(e){L(e instanceof Error?e.message:String(e))}},[R]);(0,W.useEffect)(()=>{z()},[z]);let V=(0,W.useMemo)(()=>$e(f),[f]),H=(0,W.useMemo)(()=>Qe(f),[f]),U=u?!nt(H,u.enabledTools)||et(f)!==u.computerUseEnabled||JSON.stringify(tt(f))!==JSON.stringify(u.piExtensions)||JSON.stringify(v)!==JSON.stringify(u.webSearch):!1,me=(0,W.useCallback)(async()=>{if(!b){if(!u||!U){u&&t(o(`plugins:pluginsPage.noPluginPolicyChanges`));return}x(!0),L(``);try{let e=await M(`/api/plugins`,{method:`PUT`,body:JSON.stringify({enabledTools:H,webSearch:v,computerUseEnabled:et(f),piExtensions:tt(f)})});R(e),t(o(`plugins:pluginsPage.pluginPolicySavedAgentRuntimeUpdated`))}catch(e){L(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[R,u,U,f,H,t,b,o,v]);le(n,me);let he=async()=>{w(!0),L(``);try{let e=await M(`/api/plugins/web-search/test`,{method:`POST`,body:JSON.stringify(v)});t(o(`plugins:pluginsPage.bingSearchIsAvailableAndReturnedCountResults`,{count:e.count}))}catch(e){let n=e instanceof Error?e.message:String(e);L(n),t(n,`error`)}finally{w(!1)}},K=(e,t,n)=>{p(r=>r.map(r=>{if(r.id!==e)return r;let i=r.source===`pi`&&r.managedExternally;return{...r,enabled:n||r.capabilities.some(e=>e.enabled),capabilities:r.capabilities.map(e=>i||e.name===t?{...e,enabled:n}:e)}}))},q=()=>!U||(L(o(`plugins:pluginsPage.saveBeforePluginChanges`)),!1),ge=async()=>{if(!(!k||P)){F(!0),L(``);try{R(await M(`/api/plugins/${encodeURIComponent(k.pluginId)}`,{method:`DELETE`})),t(o(`plugins:pluginsPage.pluginUninstalled`,{name:k.pluginName})),h(``),A(null)}catch(e){L(e instanceof Error?e.message:String(e))}finally{F(!1)}}};if(!u)return(0,G.jsxs)(ae,{children:[(0,G.jsx)(O,{className:`animate-spin`,size:24}),(0,G.jsx)(`h2`,{children:o(`plugins:pluginsPage.loadingToolPlugins`)}),I&&(0,G.jsxs)(B,{children:[(0,G.jsx)(j,{size:13}),I]})]});let J=e.trim().toLowerCase(),Y=V.filter(e=>g!==`all`&&e.pluginSource!==g?!1:[Q(e,o),e.name,e.description,$(e,o),e.pluginId].join(` `).toLowerCase().includes(J));return(0,G.jsxs)(`div`,{className:`plugins-page flex min-h-[100%] flex-col gap-[12px] max-[900px]:h-auto h-full min-h-0 overflow-y-auto [scrollbar-gutter:stable]`,children:[(0,G.jsxs)(`div`,{className:`plugin-toolbar max-[650px]:items-stretch max-[650px]:flex-col flex items-center justify-between gap-[12px]`,children:[(0,G.jsx)(re,{options:l.map(e=>Z(e,o)),value:Z(g,o),onChange:e=>_(l.find(t=>Z(t,o)===e)||`all`)}),(0,G.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:c&&(0,G.jsxs)(N,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:()=>q()&&E(!0),children:[(0,G.jsx)(X,{size:15}),o(`plugins:pluginsPage.installPlugin`)]})})]}),(0,G.jsxs)(`div`,{className:`plugin-catalog-heading [&_>_span]:flex [&_>_span]:items-center [&_>_span]:gap-[7px] [&_strong]:text-[13px] [&_small]:text-[var(--text-secondary)] [&_small]:text-[12px] [&_small]:[font-variant-numeric:tabular-nums] max-[650px]:items-start flex items-center justify-between gap-[12px] [padding:2px]`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{children:o(`plugins:pluginsPage.toolCatalog`)}),(0,G.jsx)(`small`,{children:Y.length})]}),(0,G.jsxs)(`span`,{className:`plugin-catalog-summary text-[var(--text-secondary)] text-[12px] [font-variant-numeric:tabular-nums] [&_>_i]:w-[7px] [&_>_i]:h-[7px] [&_>_i]:rounded-[50%] [&_>_i]:bg-[var(--status-green)] max-[650px]:flex-wrap max-[650px]:justify-end`,children:[(0,G.jsx)(`i`,{}),V.filter(e=>e.enabled).length,`/`,V.length,` `,o(`plugins:pluginsPage.enabled2`),U&&(0,G.jsx)(ie,{tone:`amber`,children:o(`plugins:pluginsPage.unsaved`)})]})]}),Y.length?(0,G.jsx)(`div`,{className:`plugin-tool-grid max-[650px]:grid-cols-[minmax(0,1fr)] grid grid-cols-[repeat(auto-fill,minmax(310px,1fr))] [align-items:start] gap-[10px] [padding-bottom:4px]`,children:Y.map(e=>{let t=m===e.name,n=Ze[e.name]||te;return(0,G.jsxs)(`article`,{className:`plugin-tool-card [&[data-open]]:border-[var(--stroke-hover)] [&[data-open]]:shadow-[var(--sh-1)] min-w-0 overflow-hidden [border:1px_solid_var(--stroke)] rounded-[var(--r-sm)] bg-[var(--solid)]`,"data-open":t||void 0,children:[(0,G.jsxs)(`div`,{className:`plugin-tool-card-head hover:bg-[var(--surface-hover)] [.plugin-tool-card[data-open]_>_&]:bg-[var(--surface-hover)] max-[650px]:grid-cols-[minmax(0,1fr)_auto] max-[650px]:[padding-inline:8px] grid min-h-[56px] grid-cols-[minmax(0,1fr)_auto] items-center gap-[10px] [padding:7px_10px]`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`grid min-w-0 h-full grid-cols-[32px_minmax(0,1fr)] items-center gap-[9px] border-0 bg-transparent p-0 text-inherit text-left`,"aria-expanded":t,onClick:()=>h(t=>t===e.name?``:e.name),children:[(0,G.jsx)(`span`,{className:`grid w-[32px] h-[32px] place-items-center rounded-[var(--r-xs)] bg-[var(--surface-muted)] text-[var(--text-soft)]`,children:(0,G.jsx)(n,{size:15})}),(0,G.jsxs)(`span`,{className:`plugin-tool-title [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap [&_small]:overflow-hidden [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[11px] flex min-w-0 flex-col gap-[2px]`,children:[(0,G.jsx)(`strong`,{title:Q(e,o),children:Q(e,o)}),(0,G.jsx)(`small`,{children:$(e,o)})]})]}),(0,G.jsxs)(`span`,{className:`plugin-tool-trailing [&_>_i]:w-[7px] [&_>_i]:h-[7px] [&_>_i]:rounded-[50%] [&_>_i]:bg-[var(--status-muted)] [&_>_i[data-enabled]]:bg-[var(--status-green)] max-[650px]:gap-[5px] inline-flex items-center gap-[7px]`,children:[(0,G.jsx)(`i`,{"data-enabled":e.enabled||void 0}),!e.pluginBuiltIn&&(0,G.jsx)(ie,{tone:`amber`,children:o(`plugins:pluginsPage.local`)}),(0,G.jsx)(oe,{value:e.enabled,onChange:t=>K(e.pluginId,e.name,t),ariaLabel:Q(e,o)}),(0,G.jsx)(`button`,{type:`button`,className:`plugin-tool-chevron hover:bg-[var(--surface-muted)] hover:text-[var(--text)] [&_svg]:[transition:transform_var(--d1)_var(--ease-out)] [&[aria-expanded='true']_svg]:[transform:rotate(180deg)] grid w-[24px] h-[24px] place-items-center border-0 rounded-[var(--r-xs)] bg-transparent text-[var(--text-muted)]`,"aria-label":o(`plugins:pluginsPage.toggleToolDetails`,{name:Q(e,o)}),"aria-expanded":t,onClick:()=>h(t=>t===e.name?``:e.name),children:(0,G.jsx)(ee,{size:14})})]})]}),t&&(0,G.jsxs)(`div`,{className:`plugin-tool-details [&_>_p]:m-0 [&_>_p]:text-[var(--text-soft)] [&_>_p]:text-[12px] [&_>_p]:leading-[1.55] [&_>_code]:[overflow-wrap:anywhere] [&_>_code]:text-[var(--text)] [&_>_code]:text-[11px] [&_dl]:grid [&_dl]:grid-cols-[78px_minmax(0,1fr)] [&_dl]:gap-[6px_10px] [&_dl]:m-0 [&_dl_div]:[display:contents] [&_dt]:text-[var(--text-muted)] [&_dt]:text-[11px] [&_dd]:min-w-0 [&_dd]:m-0 [&_dd]:[overflow-wrap:anywhere] [&_dd]:text-[var(--text-soft)] [&_dd]:text-[12px] max-[650px]:[&_dl]:grid-cols-[68px_minmax(0,1fr)] grid gap-[9px] [border-top:1px_solid_var(--stroke)] bg-[var(--surface-subtle)] [padding:11px_13px_13px]`,children:[(0,G.jsx)(`p`,{children:fe({id:e.name,description:e.description},o)}),(0,G.jsx)(`code`,{children:e.name}),(0,G.jsxs)(`dl`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:o(`plugins:pluginsPage.source`)}),(0,G.jsxs)(`dd`,{children:[$(e,o),!e.pluginBuiltIn&&` · v${e.pluginVersion}`]})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:o(`plugins:pluginsPage.riskLevel`)}),(0,G.jsx)(`dd`,{className:pe(e.risk)?`text-[var(--danger)]`:``,children:ue(e.risk,o)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:o(`plugins:pluginsPage.pathScope`)}),(0,G.jsx)(`dd`,{children:de({id:e.name,scope:e.scope},o)})]}),!e.pluginBuiltIn&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:o(`plugins:pluginsPage.executionMode`)}),(0,G.jsx)(`dd`,{children:o(`plugins:pluginsPage.fullAccessOnly`)})]})]}),!e.pluginBuiltIn&&(0,G.jsxs)(`div`,{className:`plugin-tool-warning [&_svg]:flex-none [&_svg]:mt-[1px] flex items-start gap-[7px] rounded-[var(--r-xs)] bg-[var(--warning-soft)] [padding:8px] text-[var(--warning-strong)] text-[11px] leading-[1.5]`,children:[(0,G.jsx)(C,{size:14}),(0,G.jsx)(`span`,{children:o(`plugins:pluginsPage.localPluginSecurityWarning`)})]}),e.name===`web_search`&&(0,G.jsx)(rt,{value:v,testing:S,onChange:y,onTest:he}),!e.pluginBuiltIn&&(0,G.jsxs)(N,{type:`button`,variant:`destructive`,size:`lg`,className:`[justify-self:end]`,onClick:()=>q()&&A(e),children:[(0,G.jsx)(ne,{size:14}),o(`plugins:pluginsPage.uninstallPlugin`)]})]})]},e.name)})}):(0,G.jsx)(`div`,{className:`plugin-empty [&.compact]:min-h-[90px] grid min-h-[180px] place-items-center text-[var(--text-secondary)] text-[12px]`,children:o(`plugins:pluginsPage.noMatchingTools`)}),(0,G.jsx)(it,{query:e,notify:t,requestText:i,requestConfirm:a}),c&&(0,G.jsx)(Ke,{open:T,onOpenChange:E,onInstalled:z}),(0,G.jsx)(Fe,{open:!!k,onOpenChange:e=>!e&&!P&&A(null),children:(0,G.jsxs)(Re,{className:`z-[220]`,children:[(0,G.jsxs)(ze,{children:[(0,G.jsx)(Ve,{children:o(`plugins:pluginsPage.uninstallPlugin`)}),(0,G.jsx)(He,{children:o(`plugins:pluginsPage.uninstallPluginDescription`,{name:k?.pluginName||``})})]}),(0,G.jsxs)(Be,{children:[(0,G.jsx)(We,{disabled:P,children:o(`common:ui.cancel`)}),(0,G.jsxs)(Ue,{variant:`destructive`,disabled:P,onClick:ge,children:[P&&(0,G.jsx)(D,{className:`animate-spin`,size:14}),o(`plugins:pluginsPage.uninstallPlugin`)]})]})]})}),I&&(0,G.jsxs)(B,{className:`fixed z-[21] [right:24px] [bottom:24px] max-w-[360px] shadow-[0_12px_28px_-18px_var(--floating-shadow)]`,children:[(0,G.jsx)(j,{size:13}),I]})]})}export{at as PluginsPage};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-C7st2Mx5.js";import{i}from"./dist-Cfh4kzCK.js";import{o as a,s as o}from"./dist-B_a0oV4U.js";import{a as s,c,i as l,l as u,n as d,o as f,r as p,s as m,t as h}from"./dist-BdkTa5R3.js";import{t as g}from"./AppSelect-D149YYg1.js";import{t as _}from"./utils-C8uzG5AZ.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as ee}from"./chevron-down-CxtxIjiP.js";import{t as y}from"./circle-check-iEdCm3Pw.js";import{t as b}from"./earth-Ddy13fHh.js";import{t as x}from"./external-link-CEQqPcqc.js";import{n as S,t as C}from"./shield-alert-CvFOTe9h.js";import{t as w}from"./file-code-corner-BnE1ljT0.js";import{t as T}from"./folder-open-FIShC5Qk.js";import{t as E}from"./image-BY_c3FYU.js";import{t as D}from"./loader-circle-BOwQzHB-.js";import{t as te}from"./plug-BsIeHRwC.js";import{t as O}from"./refresh-cw-TbWxTY4K.js";import{t as k}from"./search-D0mqDaf_.js";import{t as A}from"./server-BgNvmqwJ.js";import{t as ne}from"./trash-2-CNrPOoPR.js";import{t as j}from"./triangle-alert-CE1q54ci.js";import{t as M}from"./api-DmuPqjXK.js";import{t as N}from"./button-CQA36izu.js";import{a as P,i as F,o as I,r as L,s as R,t as z}from"./dialog-D-ER2p-D.js";import{c as re,i as B,l as ie,r as ae,s as oe}from"./app-primitives-BBXY6U2S.js";import{i as se,t as ce}from"./runtime-capabilities-store-1N8axw9r.js";import{n as V,t as H}from"./pick-system-directory-BnIFt85A.js";import{t as le}from"./usePagePrimaryAction-CWPC0C_f.js";import{a as ue,i as U,n as de,o as fe,r as pe,t as me}from"./tool-labels-DJzY62Yr.js";var W=e(t(),1),G=n(),he=Object.defineProperty,K=(e,t)=>he(e,`name`,{value:t,configurable:!0}),[q,ge]=o(`AlertDialog`,[u]),J=u(),Y=K(e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,G.jsx)(h,{...r,...n,modal:!0})},`AlertDialog`);W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(c,{...i,...r,ref:t})},`AlertDialogTrigger`));var _e=K(e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,G.jsx)(f,{...r,...n})},`AlertDialogPortal`),ve=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(s,{...i,...r,ref:t})},`AlertDialogOverlay`)),[ye,be]=q(`AlertDialogContent`),xe=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,children:r,...o}=e,s=J(n),c=W.useRef(null),l=i(t,c),u=W.useRef(null);return(0,G.jsx)(ye,{scope:n,cancelRef:u,children:(0,G.jsx)(p,{role:`alertdialog`,...s,...o,ref:l,onOpenAutoFocus:a(o.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Se=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(m,{...i,...r,ref:t})},`AlertDialogTitle`)),Ce=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(l,{...i,...r,ref:t})},`AlertDialogDescription`)),we=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,G.jsx)(d,{...i,...r,ref:t})},`AlertDialogAction`)),Te=`AlertDialogCancel`,Ee=W.forwardRef(K(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=be(Te,n),o=J(n),s=i(t,a);return(0,G.jsx)(d,{...o,...r,ref:s})},`AlertDialogCancel`)),De=Y,Oe=_e,ke=ve,Ae=xe,je=we,Me=Ee,Ne=Se,Pe=Ce,X=v(`package-plus`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M16 17h6`,key:`1ook5g`}],[`path`,{d:`M19 14v6`,key:`1ckrd5`}],[`path`,{d:`M21 10.535V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955`,key:`28k6lz`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]);function Fe({...e}){return(0,G.jsx)(De,{"data-slot":`alert-dialog`,...e})}function Ie({...e}){return(0,G.jsx)(Oe,{"data-slot":`alert-dialog-portal`,...e})}function Le({className:e,...t}){return(0,G.jsx)(ke,{"data-slot":`alert-dialog-overlay`,className:_(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Re({className:e,size:t=`default`,...n}){return(0,G.jsxs)(Ie,{children:[(0,G.jsx)(Le,{}),(0,G.jsx)(Ae,{"data-slot":`alert-dialog-content`,"data-size":t,className:_(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100vh-2rem)] supports-[height:100dvh]:max-h-[calc(100dvh-2rem)] w-full -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto overscroll-contain rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-[var(--stroke-soft)] duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function ze({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:_(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Be({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:_(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-[var(--surface-subtle)] p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Ve({className:e,...t}){return(0,G.jsx)(Ne,{"data-slot":`alert-dialog-title`,className:_(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function He({className:e,...t}){return(0,G.jsx)(Pe,{"data-slot":`alert-dialog-description`,className:_(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Ue({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,G.jsx)(N,{variant:t,size:n,asChild:!0,children:(0,G.jsx)(je,{"data-slot":`alert-dialog-action`,className:_(e),...r})})}function We({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,G.jsx)(N,{variant:t,size:n,asChild:!0,children:(0,G.jsx)(Me,{"data-slot":`alert-dialog-cancel`,className:_(e),...r})})}function Ge(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Ke({open:e,onOpenChange:t,onInstalled:n}){let{t:i}=r(),[a,o]=(0,W.useState)(``),[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(``);return(0,W.useEffect)(()=>{e||(o(``),c(null),u(!1),f(``))},[e]),(0,G.jsx)(z,{open:e,onOpenChange:e=>!l&&t(e),children:(0,G.jsxs)(L,{className:`z-[220] sm:max-w-xl`,overlayClassName:`z-[220]`,children:[(0,G.jsxs)(I,{children:[(0,G.jsxs)(R,{className:`flex items-center gap-2`,children:[(0,G.jsx)(X,{size:17}),i(`plugins:pluginsPage.installLocalPlugin`)]}),(0,G.jsx)(F,{children:i(`plugins:pluginsPage.installLocalPluginDescription`)})]}),(0,G.jsxs)(`div`,{className:`grid gap-3`,children:[(0,G.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-semibold text-[var(--text-soft)]`,children:[i(`plugins:pluginsPage.pluginDirectory`),(0,G.jsxs)(`span`,{className:`flex min-w-0 gap-2`,children:[(0,G.jsx)(`input`,{className:`h-10 min-w-0 flex-1 rounded-md border border-[var(--stroke)] bg-[var(--solid)] px-3 text-[13px] text-[var(--text)] outline-none focus:border-[var(--star-border)]`,value:a,disabled:l,placeholder:i(`plugins:pluginsPage.pluginDirectoryPlaceholder`),onChange:e=>{o(e.target.value),c(null)}}),H()&&(0,G.jsx)(N,{type:`button`,variant:`ghost`,size:`icon`,className:`size-10 shrink-0`,title:i(`plugins:pluginsPage.chooseDirectory`),onClick:async()=>{f(``);try{let e=await V(a);e&&(o(e),c(null))}catch(e){f(e instanceof Error?e.message:String(e))}},children:(0,G.jsx)(T,{size:16})})]})]}),s&&(0,G.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-[var(--stroke)] bg-[var(--surface-muted)] p-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,G.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-md bg-[var(--success-soft)] text-[var(--success)]`,children:(0,G.jsx)(y,{size:17})}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`strong`,{className:`block truncate text-[13px] text-[var(--text)]`,children:s.plugin.name}),(0,G.jsxs)(`small`,{className:`block truncate text-[12px] text-[var(--text-muted)]`,children:[s.plugin.id,` · v`,s.plugin.version,` · `,s.fileCount,` `,i(`plugins:pluginsPage.files`),` · `,Ge(s.byteCount)]})]})]}),(0,G.jsx)(`div`,{className:`grid gap-1.5`,children:s.plugin.capabilities.map(e=>(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-t border-[var(--stroke-soft)] pt-2 text-xs`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{className:`block text-[var(--text)]`,children:e.label}),(0,G.jsx)(`small`,{className:`text-[var(--text-muted)]`,children:e.description})]}),(0,G.jsx)(`code`,{className:`shrink-0 text-[11px] text-[var(--text-soft)]`,children:e.name})]},e.name))}),(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-[var(--warning-soft)] p-2.5 text-xs leading-5 text-[var(--warning-strong)]`,children:[(0,G.jsx)(j,{className:`mt-0.5 shrink-0`,size:15}),(0,G.jsx)(`span`,{children:i(`plugins:pluginsPage.localPluginSecurityWarning`)})]})]}),d&&(0,G.jsxs)(B,{className:`m-0`,children:[(0,G.jsx)(j,{size:14}),(0,G.jsx)(`span`,{children:d})]})]}),(0,G.jsxs)(P,{children:[(0,G.jsx)(N,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,disabled:l,onClick:()=>t(!1),children:i(`common:ui.cancel`)}),(0,G.jsxs)(N,{type:`button`,size:`lg`,disabled:l||!s&&!a.trim(),onClick:s?async()=>{if(!(!s||l)){u(!0),f(``);try{await M(`/api/plugins/install`,{method:`POST`,body:JSON.stringify({inspectionId:s.inspectionId})}),await n(),t(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(!1)}}}:async()=>{if(!(!a.trim()||l)){u(!0),f(``);try{c(await M(`/api/plugins/inspect`,{method:`POST`,body:JSON.stringify({path:a.trim()})}))}catch(e){c(null),f(e instanceof Error?e.message:String(e))}finally{u(!1)}}},children:[l?(0,G.jsx)(D,{className:`animate-spin`,size:15}):s?(0,G.jsx)(X,{size:15}):(0,G.jsx)(y,{size:15}),i(l?`plugins:pluginsPage.processing`:s?`plugins:pluginsPage.installPlugin`:`plugins:pluginsPage.inspectPlugin`)]})]})]})})}var qe=[`tool`,`prompt`,`skill`];function Je(e){let t=Array.isArray(e.resourceTypes)?e.resourceTypes.filter(e=>qe.includes(e)):[];return t.length?t:[`tool`]}function Ye(e,t){return{tool:t(`plugins:pluginsPage.extensionType.tool`),prompt:t(`plugins:pluginsPage.extensionType.prompt`),skill:t(`plugins:pluginsPage.extensionType.skill`)}[e]}var Xe=[`all`,`builtin`,`local`],Ze={read:S,ls:T,grep:k,find:k,edit:w,write:w,bash:A,web_search:b,browser_automation:b,generate_visual:E};function Z(e,t){return t(e===`builtin`?`plugins:pluginsPage.builtIn`:e===`local`?`plugins:pluginsPage.local`:`plugins:pluginsPage.all`)}function Qe(e){return e.flatMap(e=>e.managedExternally?[]:e.capabilities.filter(e=>e.enabled).map(e=>e.name))}function $e(e){return e.filter(e=>!e.managedExternally||e.source===`pi`).flatMap(e=>e.capabilities.map(t=>({...t,pluginId:e.id,pluginName:e.name,pluginDescription:e.description,pluginVersion:e.version,pluginSource:e.source,pluginBuiltIn:e.builtIn,pluginPermissions:e.permissions||[],pluginSystemAccess:!!e.systemAccess})))}function et(e){return e.find(e=>e.source===`pi`&&e.name===`Computer Use`)?.enabled!==!1}function tt(e){return Object.fromEntries(e.filter(e=>e.source===`pi`&&e.name!==`Computer Use`&&!!e.packageSource).map(e=>[e.packageSource,e.enabled!==!1]))}function nt(e,t){return[...e].sort().join(`\0`)===[...t].sort().join(`\0`)}function Q(e,t){return U({id:e.name,name:e.label},t)}function $(e,t){return e.pluginSource===`pi`?e.pluginName:de(e.pluginName,t)}function rt({value:e,testing:t,onChange:n,onTest:i}){let{t:a}=r();return(0,G.jsxs)(`div`,{className:`plugin-tool-config [&_label]:grid [&_label]:gap-[5px] [&_label]:text-[var(--text-muted)] [&_label]:text-[11px] [&_label]:font-[600] [&_select]:w-full [&_select]:h-[34px] [&_select]:[border:1px_solid_var(--stroke)] [&_select]:rounded-[var(--r-xs)] [&_select]:bg-[var(--solid)] [&_select]:p-[0_8px] [&_select]:text-[var(--text)] [&_select]:text-[12px] [&_input]:w-full [&_input]:h-[34px] [&_input]:[border:1px_solid_var(--stroke)] [&_input]:rounded-[var(--r-xs)] [&_input]:bg-[var(--solid)] [&_input]:p-[0_8px] [&_input]:text-[var(--text)] [&_input]:text-[12px] grid gap-[9px] [border-top:1px_solid_var(--stroke)] [padding-top:10px]`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-3`,children:[(0,G.jsxs)(`label`,{children:[a(`plugins:pluginsPage.defaultLanguage`),(0,G.jsxs)(g,{value:e.language,onChange:t=>n({...e,language:t.target.value}),children:[(0,G.jsx)(`option`,{value:`auto`,children:a(`plugins:pluginsPage.auto`)}),(0,G.jsx)(`option`,{value:`zh-CN`,children:a(`plugins:pluginsPage.simplifiedChinese`)}),(0,G.jsx)(`option`,{value:`en-US`,children:a(`plugins:pluginsPage.english`)})]})]}),(0,G.jsxs)(`label`,{children:[a(`plugins:pluginsPage.safeSearch`),(0,G.jsxs)(g,{value:e.safeSearch,onChange:t=>n({...e,safeSearch:Number(t.target.value)}),children:[(0,G.jsx)(`option`,{value:0,children:a(`plugins:pluginsPage.off`)}),(0,G.jsx)(`option`,{value:1,children:a(`plugins:pluginsPage.moderate`)}),(0,G.jsx)(`option`,{value:2,children:a(`plugins:pluginsPage.strict`)})]})]}),(0,G.jsxs)(`label`,{children:[a(`plugins:pluginsPage.resultCount`),(0,G.jsx)(`input`,{type:`number`,min:`1`,max:`12`,value:e.maxResults,onChange:t=>n({...e,maxResults:Number(t.target.value)})})]})]}),(0,G.jsxs)(N,{type:`button`,variant:`outline`,size:`lg`,className:`justify-self-end bg-surface-subtle`,disabled:t,onClick:i,children:[t?(0,G.jsx)(O,{className:`animate-spin`,size:14}):(0,G.jsx)(b,{size:14}),a(t?`plugins:pluginsPage.testing`:`plugins:pluginsPage.testConnection`)]})]})}function it({query:e,notify:t,requestText:n,requestConfirm:i}){let{t:a}=r(),[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(null),[u,d]=(0,W.useState)([]),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(``),v=(0,W.useCallback)(async(e=``)=>{p(!0),_(``);try{let[t,n]=await Promise.all([M(`/api/extensions/market?name=${encodeURIComponent(e)}`),M(`/api/extensions`)]);l(t),d(n.packages||[])}catch(e){_(e instanceof Error?e.message:String(e))}finally{p(!1)}},[]);(0,W.useEffect)(()=>{v(``)},[v]);let ee=(c?.packages||[]).filter(t=>`${t.name} ${t.description}`.toLowerCase().includes(e.trim().toLowerCase())),y=async e=>{if(await i?.({title:a(`plugins:pluginsPage.installExtension`),message:a(`plugins:pluginsPage.extensionSecurityWarning`,{name:e}),confirmLabel:a(`plugins:pluginsPage.installExtension`),tone:`danger`})!==!1){h(e);try{let n=/^(?:[.~\\/]|[A-Za-z]:[\\/])/.test(e)||/^(?:npm:|https?:\/\/|git\+)/i.test(e)?e:`npm:${e}`,r=await M(`/api/extensions/install`,{method:`POST`,body:JSON.stringify({source:n})});d(r.packages||[]),t(a(`plugins:pluginsPage.extensionInstalled`),`success`)}catch(e){t(e instanceof Error?e.message:String(e),`error`)}finally{h(``)}}},b=async()=>{let e=await n?.({title:a(`plugins:pluginsPage.installExtension`),message:a(`plugins:pluginsPage.extensionSourceHelp`),inputLabel:a(`plugins:pluginsPage.extensionSource`),placeholder:`npm:@scope/package or https://github.com/…`,maxLength:2e3});e?.trim()&&await y(e.trim())},S=async e=>{if(await i?.({title:a(`plugins:pluginsPage.uninstallExtension`),message:a(`plugins:pluginsPage.uninstallExtensionDescription`,{name:e.name}),confirmLabel:a(`plugins:pluginsPage.uninstallExtension`),tone:`danger`})!==!1){h(e.source);try{await M(`/api/extensions`,{method:`DELETE`,body:JSON.stringify({source:e.source,scope:e.scope})}),await v(o),t(a(`plugins:pluginsPage.extensionUninstalled`),`success`)}catch(e){t(e instanceof Error?e.message:String(e),`error`)}finally{h(``)}}},C=qe.map(e=>({type:e,items:u.filter(t=>Je(t).includes(e))})).filter(e=>e.items.length>0);return(0,G.jsxs)(`section`,{className:`plugin-market grid gap-[10px] border-t border-[var(--stroke)] pt-[14px]`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-[10px]`,children:[(0,G.jsx)(`h2`,{className:`m-0 text-[14px] font-[650]`,children:a(`plugins:pluginsPage.extensionMarket`)}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsxs)(N,{type:`button`,variant:`outline`,size:`lg`,onClick:b,disabled:!!m,children:[(0,G.jsx)(X,{size:14}),a(`plugins:pluginsPage.installExtension`)]}),(0,G.jsxs)(`a`,{className:`inline-flex h-[34px] items-center gap-1 rounded-[var(--r-xs)] border border-[var(--stroke)] px-2 text-[12px] text-[var(--text-soft)] no-underline hover:bg-[var(--surface-hover)]`,href:`https://pi.dev/packages`,target:`_blank`,rel:`noreferrer`,children:[(0,G.jsx)(x,{size:13}),a(`plugins:pluginsPage.openPackageCatalog`)]})]})]}),(0,G.jsxs)(`form`,{className:`flex min-w-0 gap-2`,onSubmit:e=>{e.preventDefault(),v(o)},children:[(0,G.jsx)(`input`,{className:`h-[34px] min-w-0 flex-1 rounded-[var(--r-xs)] border border-[var(--stroke)] bg-[var(--solid)] px-2 text-[12px] text-[var(--text)]`,value:o,onChange:e=>s(e.target.value),placeholder:a(`plugins:pluginsPage.searchPackageCatalog`),"aria-label":a(`plugins:pluginsPage.searchPackageCatalog`)}),(0,G.jsxs)(N,{type:`submit`,variant:`outline`,size:`lg`,disabled:f,children:[f?(0,G.jsx)(O,{className:`animate-spin`,size:14}):(0,G.jsx)(k,{size:14}),a(`plugins:pluginsPage.search`)]})]}),g&&(0,G.jsx)(`p`,{className:`m-0 text-[12px] text-[var(--danger)]`,children:g}),C.length>0&&(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[(0,G.jsx)(`h3`,{className:`m-0 text-[12px] font-[650] text-[var(--text-secondary)]`,children:a(`plugins:pluginsPage.installedExtensions`)}),C.map(e=>(0,G.jsxs)(`section`,{className:`grid gap-1`,children:[(0,G.jsx)(`h4`,{className:`m-0 text-[11px] font-[650] text-[var(--text-muted)]`,children:Ye(e.type,a)}),e.items.map(t=>(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2 border-t border-[var(--stroke-soft)] py-2`,children:[(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`strong`,{className:`block overflow-hidden text-ellipsis whitespace-nowrap text-[12px]`,children:t.name}),(0,G.jsxs)(`small`,{className:`block overflow-hidden text-ellipsis whitespace-nowrap text-[11px] text-[var(--text-muted)]`,children:[t.source,` · v`,t.version]})]}),(0,G.jsxs)(N,{type:`button`,variant:`ghost`,size:`sm`,disabled:!!m,onClick:()=>void S(t),children:[m===t.source?(0,G.jsx)(D,{className:`animate-spin`,size:13}):(0,G.jsx)(ne,{size:13}),a(`plugins:pluginsPage.uninstallExtension`)]})]},`${e.type}:${t.scope}:${t.source}`))]},e.type))]}),(0,G.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(230px,1fr))] gap-2`,children:ee.slice(0,12).map(e=>{let t=u.some(t=>t.name===e.name||t.source===`npm:${e.name}`);return(0,G.jsxs)(`article`,{className:`grid min-w-0 gap-2 rounded-[var(--r-xs)] border border-[var(--stroke)] bg-[var(--solid)] p-2`,children:[(0,G.jsx)(`strong`,{className:`overflow-hidden text-ellipsis whitespace-nowrap text-[12px]`,title:e.name,children:e.name}),(0,G.jsx)(`p`,{className:`m-0 line-clamp-3 min-h-[45px] text-[11px] leading-[1.45] text-[var(--text-secondary)]`,children:e.description}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`small`,{className:`text-[10px] text-[var(--text-muted)]`,children:e.published}),(0,G.jsxs)(N,{type:`button`,size:`sm`,disabled:t||!!m,onClick:()=>void y(e.name),children:[m===e.name&&(0,G.jsx)(D,{className:`animate-spin`,size:13}),a(t?`plugins:pluginsPage.installed`:`plugins:pluginsPage.installExtension`)]})]})]},e.name)})})]})}function at({query:e=``,notify:t,registerPrimaryAction:n,requestText:i,requestConfirm:a}){let{t:o}=r(),s=ce(e=>e.capabilities),c=se(s,`plugins`),l=c?Xe:Xe.slice(0,2),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)([]),[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(`all`),[v,y]=(0,W.useState)({provider:`bing`,language:`auto`,safeSearch:1,maxResults:8}),[b,x]=(0,W.useState)(!1),[S,w]=(0,W.useState)(!1),[T,E]=(0,W.useState)(!1),[k,A]=(0,W.useState)(null),[P,F]=(0,W.useState)(!1),[I,L]=(0,W.useState)(``),R=(0,W.useCallback)(e=>{d(e),p(e.plugins),y(e.webSearch)},[]),z=(0,W.useCallback)(async()=>{L(``);try{R(await M(`/api/plugins`))}catch(e){L(e instanceof Error?e.message:String(e))}},[R]);(0,W.useEffect)(()=>{z()},[z]);let V=(0,W.useMemo)(()=>$e(f),[f]),H=(0,W.useMemo)(()=>Qe(f),[f]),U=u?!nt(H,u.enabledTools)||et(f)!==u.computerUseEnabled||JSON.stringify(tt(f))!==JSON.stringify(u.piExtensions)||JSON.stringify(v)!==JSON.stringify(u.webSearch):!1,de=(0,W.useCallback)(async()=>{if(!b){if(!u||!U){u&&t(o(`plugins:pluginsPage.noPluginPolicyChanges`));return}x(!0),L(``);try{let e=await M(`/api/plugins`,{method:`PUT`,body:JSON.stringify({enabledTools:H,webSearch:v,computerUseEnabled:et(f),piExtensions:tt(f)})});R(e),t(o(`plugins:pluginsPage.pluginPolicySavedAgentRuntimeUpdated`))}catch(e){L(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[R,u,U,f,H,t,b,o,v]);le(n,de);let he=async()=>{w(!0),L(``);try{let e=await M(`/api/plugins/web-search/test`,{method:`POST`,body:JSON.stringify(v)});t(o(`plugins:pluginsPage.bingSearchIsAvailableAndReturnedCountResults`,{count:e.count}))}catch(e){let n=e instanceof Error?e.message:String(e);L(n),t(n,`error`)}finally{w(!1)}},K=(e,t,n)=>{p(r=>r.map(r=>{if(r.id!==e)return r;let i=r.source===`pi`&&r.managedExternally;return{...r,enabled:n||r.capabilities.some(e=>e.enabled),capabilities:r.capabilities.map(e=>i||e.name===t?{...e,enabled:n}:e)}}))},q=()=>!U||(L(o(`plugins:pluginsPage.saveBeforePluginChanges`)),!1),ge=async()=>{if(!(!k||P)){F(!0),L(``);try{R(await M(`/api/plugins/${encodeURIComponent(k.pluginId)}`,{method:`DELETE`})),t(o(`plugins:pluginsPage.pluginUninstalled`,{name:k.pluginName})),h(``),A(null)}catch(e){L(e instanceof Error?e.message:String(e))}finally{F(!1)}}};if(!u)return(0,G.jsxs)(ae,{children:[(0,G.jsx)(O,{className:`animate-spin`,size:24}),(0,G.jsx)(`h2`,{children:o(`plugins:pluginsPage.loadingToolPlugins`)}),I&&(0,G.jsxs)(B,{children:[(0,G.jsx)(j,{size:13}),I]})]});let J=e.trim().toLowerCase(),Y=V.filter(e=>g!==`all`&&e.pluginSource!==g?!1:[Q(e,o),e.name,e.description,$(e,o),e.pluginId].join(` `).toLowerCase().includes(J));return(0,G.jsxs)(`div`,{className:`plugins-page flex min-h-[100%] flex-col gap-[12px] max-[900px]:h-auto h-full min-h-0 overflow-y-auto [scrollbar-gutter:stable]`,children:[(0,G.jsxs)(`div`,{className:`plugin-toolbar max-[650px]:items-stretch max-[650px]:flex-col flex items-center justify-between gap-[12px]`,children:[(0,G.jsx)(re,{options:l.map(e=>Z(e,o)),value:Z(g,o),onChange:e=>_(l.find(t=>Z(t,o)===e)||`all`)}),(0,G.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:c&&(0,G.jsxs)(N,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:()=>q()&&E(!0),children:[(0,G.jsx)(X,{size:15}),o(`plugins:pluginsPage.installPlugin`)]})})]}),(0,G.jsxs)(`div`,{className:`plugin-catalog-heading [&_>_span]:flex [&_>_span]:items-center [&_>_span]:gap-[7px] [&_strong]:text-[13px] [&_small]:text-[var(--text-secondary)] [&_small]:text-[12px] [&_small]:[font-variant-numeric:tabular-nums] max-[650px]:items-start flex items-center justify-between gap-[12px] [padding:2px]`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{children:o(`plugins:pluginsPage.toolCatalog`)}),(0,G.jsx)(`small`,{children:Y.length})]}),(0,G.jsxs)(`span`,{className:`plugin-catalog-summary text-[var(--text-secondary)] text-[12px] [font-variant-numeric:tabular-nums] [&_>_i]:w-[7px] [&_>_i]:h-[7px] [&_>_i]:rounded-[50%] [&_>_i]:bg-[var(--status-green)] max-[650px]:flex-wrap max-[650px]:justify-end`,children:[(0,G.jsx)(`i`,{}),V.filter(e=>e.enabled).length,`/`,V.length,` `,o(`plugins:pluginsPage.enabled2`),U&&(0,G.jsx)(ie,{tone:`amber`,children:o(`plugins:pluginsPage.unsaved`)})]})]}),Y.length?(0,G.jsx)(`div`,{className:`plugin-tool-grid max-[650px]:grid-cols-[minmax(0,1fr)] grid grid-cols-[repeat(auto-fill,minmax(310px,1fr))] [align-items:start] gap-[10px] [padding-bottom:4px]`,children:Y.map(e=>{let t=m===e.name,n=Ze[e.name]||te;return(0,G.jsxs)(`article`,{className:`plugin-tool-card [&[data-open]]:border-[var(--stroke-hover)] [&[data-open]]:shadow-[var(--sh-1)] min-w-0 overflow-hidden [border:1px_solid_var(--stroke)] rounded-[var(--r-sm)] bg-[var(--solid)]`,"data-open":t||void 0,children:[(0,G.jsxs)(`div`,{className:`plugin-tool-card-head hover:bg-[var(--surface-hover)] [.plugin-tool-card[data-open]_>_&]:bg-[var(--surface-hover)] max-[650px]:grid-cols-[minmax(0,1fr)_auto] max-[650px]:[padding-inline:8px] grid min-h-[56px] grid-cols-[minmax(0,1fr)_auto] items-center gap-[10px] [padding:7px_10px]`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`grid min-w-0 h-full grid-cols-[32px_minmax(0,1fr)] items-center gap-[9px] border-0 bg-transparent p-0 text-inherit text-left`,"aria-expanded":t,onClick:()=>h(t=>t===e.name?``:e.name),children:[(0,G.jsx)(`span`,{className:`grid w-[32px] h-[32px] place-items-center rounded-[var(--r-xs)] bg-[var(--surface-muted)] text-[var(--text-soft)]`,children:(0,G.jsx)(n,{size:15})}),(0,G.jsxs)(`span`,{className:`plugin-tool-title [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap [&_small]:overflow-hidden [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[11px] flex min-w-0 flex-col gap-[2px]`,children:[(0,G.jsx)(`strong`,{title:Q(e,o),children:Q(e,o)}),(0,G.jsx)(`small`,{children:$(e,o)})]})]}),(0,G.jsxs)(`span`,{className:`plugin-tool-trailing [&_>_i]:w-[7px] [&_>_i]:h-[7px] [&_>_i]:rounded-[50%] [&_>_i]:bg-[var(--status-muted)] [&_>_i[data-enabled]]:bg-[var(--status-green)] max-[650px]:gap-[5px] inline-flex items-center gap-[7px]`,children:[(0,G.jsx)(`i`,{"data-enabled":e.enabled||void 0}),!e.pluginBuiltIn&&(0,G.jsx)(ie,{tone:`amber`,children:o(`plugins:pluginsPage.local`)}),(0,G.jsx)(oe,{value:e.enabled,onChange:t=>K(e.pluginId,e.name,t),ariaLabel:Q(e,o)}),(0,G.jsx)(`button`,{type:`button`,className:`plugin-tool-chevron hover:bg-[var(--surface-muted)] hover:text-[var(--text)] [&_svg]:[transition:transform_var(--d1)_var(--ease-out)] [&[aria-expanded='true']_svg]:[transform:rotate(180deg)] grid w-[24px] h-[24px] place-items-center border-0 rounded-[var(--r-xs)] bg-transparent text-[var(--text-muted)]`,"aria-label":o(`plugins:pluginsPage.toggleToolDetails`,{name:Q(e,o)}),"aria-expanded":t,onClick:()=>h(t=>t===e.name?``:e.name),children:(0,G.jsx)(ee,{size:14})})]})]}),t&&(0,G.jsxs)(`div`,{className:`plugin-tool-details [&_>_p]:m-0 [&_>_p]:text-[var(--text-soft)] [&_>_p]:text-[12px] [&_>_p]:leading-[1.55] [&_>_code]:[overflow-wrap:anywhere] [&_>_code]:text-[var(--text)] [&_>_code]:text-[11px] [&_dl]:grid [&_dl]:grid-cols-[78px_minmax(0,1fr)] [&_dl]:gap-[6px_10px] [&_dl]:m-0 [&_dl_div]:[display:contents] [&_dt]:text-[var(--text-muted)] [&_dt]:text-[11px] [&_dd]:min-w-0 [&_dd]:m-0 [&_dd]:[overflow-wrap:anywhere] [&_dd]:text-[var(--text-soft)] [&_dd]:text-[12px] max-[650px]:[&_dl]:grid-cols-[68px_minmax(0,1fr)] grid gap-[9px] [border-top:1px_solid_var(--stroke)] bg-[var(--surface-subtle)] [padding:11px_13px_13px]`,children:[(0,G.jsx)(`p`,{children:pe({id:e.name,description:e.description},o)}),(0,G.jsx)(`code`,{children:e.name}),(0,G.jsxs)(`dl`,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:o(`plugins:pluginsPage.source`)}),(0,G.jsxs)(`dd`,{children:[$(e,o),!e.pluginBuiltIn&&` · v${e.pluginVersion}`]})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:o(`plugins:pluginsPage.riskLevel`)}),(0,G.jsx)(`dd`,{className:me(e.risk)?`text-[var(--danger)]`:``,children:ue(e.risk,o)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:o(`plugins:pluginsPage.pathScope`)}),(0,G.jsx)(`dd`,{children:fe({id:e.name,scope:e.scope},o)})]}),!e.pluginBuiltIn&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:o(`plugins:pluginsPage.executionMode`)}),(0,G.jsx)(`dd`,{children:o(`plugins:pluginsPage.fullAccessOnly`)})]})]}),!e.pluginBuiltIn&&(0,G.jsxs)(`div`,{className:`plugin-tool-warning [&_svg]:flex-none [&_svg]:mt-[1px] flex items-start gap-[7px] rounded-[var(--r-xs)] bg-[var(--warning-soft)] [padding:8px] text-[var(--warning-strong)] text-[11px] leading-[1.5]`,children:[(0,G.jsx)(C,{size:14}),(0,G.jsx)(`span`,{children:o(`plugins:pluginsPage.localPluginSecurityWarning`)})]}),e.name===`web_search`&&(0,G.jsx)(rt,{value:v,testing:S,onChange:y,onTest:he}),!e.pluginBuiltIn&&(0,G.jsxs)(N,{type:`button`,variant:`destructive`,size:`lg`,className:`[justify-self:end]`,onClick:()=>q()&&A(e),children:[(0,G.jsx)(ne,{size:14}),o(`plugins:pluginsPage.uninstallPlugin`)]})]})]},e.name)})}):(0,G.jsx)(`div`,{className:`plugin-empty [&.compact]:min-h-[90px] grid min-h-[180px] place-items-center text-[var(--text-secondary)] text-[12px]`,children:o(`plugins:pluginsPage.noMatchingTools`)}),(0,G.jsx)(it,{query:e,notify:t,requestText:i,requestConfirm:a}),c&&(0,G.jsx)(Ke,{open:T,onOpenChange:E,onInstalled:z}),(0,G.jsx)(Fe,{open:!!k,onOpenChange:e=>!e&&!P&&A(null),children:(0,G.jsxs)(Re,{className:`z-[220]`,children:[(0,G.jsxs)(ze,{children:[(0,G.jsx)(Ve,{children:o(`plugins:pluginsPage.uninstallPlugin`)}),(0,G.jsx)(He,{children:o(`plugins:pluginsPage.uninstallPluginDescription`,{name:k?.pluginName||``})})]}),(0,G.jsxs)(Be,{children:[(0,G.jsx)(We,{disabled:P,children:o(`common:ui.cancel`)}),(0,G.jsxs)(Ue,{variant:`destructive`,disabled:P,onClick:ge,children:[P&&(0,G.jsx)(D,{className:`animate-spin`,size:14}),o(`plugins:pluginsPage.uninstallPlugin`)]})]})]})}),I&&(0,G.jsxs)(B,{className:`fixed z-[21] [right:24px] [bottom:24px] max-w-[360px] shadow-[0_12px_28px_-18px_var(--floating-shadow)]`,children:[(0,G.jsx)(j,{size:13}),I]})]})}export{at as PluginsPage};
@@ -1 +1 @@
1
- import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-a84Zp9dV.js";import{t as n}from"./createLucideIcon-Cd-3GVxJ.js";import{t as r}from"./code-xml-BrUXrBax.js";import{t as i}from"./file-text-N9JICX6E.js";import{t as a}from"./flask-conical-DhW5v7Zz.js";import{t as o}from"./list-checks-B5Jl4aiO.js";import{t as s}from"./wand-sparkles-DdQneChm.js";var c=n(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),l=n(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),u=n(`search-check`,[[`path`,{d:`m8 11 2 2 4-4`,key:`1sed1v`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),d=e();function f(e,t){return[{icon:r,label:e(`chat:focusSession.explainCode`),prompt:e(`chat:focusSession.explainHowThisCodeWorks`)},{icon:a,label:e(`chat:focusSession.writeTests`),prompt:e(`chat:focusSession.writeUnitTestsForTheFollowingCode`)},{icon:s,label:e(`chat:focusSession.refactor`),prompt:e(`chat:focusSession.refactorThisCodeAndExplainTheImprovements`)},{icon:c,label:e(`chat:focusSession.findABug`),prompt:e(`chat:focusSession.helpMeLocateAndFixThisBug`)},{icon:i,label:e(`chat:focusSession.summarize`),prompt:e(`chat:focusSession.summarizeContentAndExtractKeyPoints`)},...t?[{icon:o,label:e(`chat:focusSession.makeAPlan`),prompt:e(`chat:focusSession.makeAClearActionablePlanForThisGoal`)}]:[],{icon:l,label:e(`chat:focusSession.organizeInformation`),prompt:e(`chat:focusSession.organizeThisInformationIntoAClearStructure`)},{icon:u,label:e(`chat:focusSession.findIssues`),prompt:e(`chat:focusSession.reviewThisContentAndSuggestImprovements`)}]}function p({plansAvailable:e,onPromptSelect:n}){let{t:r}=t();return(0,d.jsxs)(`section`,{"aria-label":r(`chat:focusSession.promptIdeas`),className:`pt-3 text-center text-xs text-muted-foreground`,children:[(0,d.jsx)(`p`,{className:`mb-2`,children:r(`chat:focusSession.promptIdeas`)}),(0,d.jsx)(`div`,{className:`welcome-chips mx-auto flex max-w-[560px] flex-wrap justify-center gap-2 pt-2`,children:f(r,e).map(e=>(0,d.jsxs)(`button`,{type:`button`,"data-target-cursor":!0,onClick:()=>n(e.prompt),className:`inline-flex min-h-9 items-center gap-2 rounded-full border border-border bg-background px-3 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,d.jsx)(e.icon,{size:14,className:`text-muted-foreground`}),e.label]},e.label))})]})}export{p as default};
1
+ import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-C7st2Mx5.js";import{t as n}from"./createLucideIcon-Cd-3GVxJ.js";import{t as r}from"./code-xml-BrUXrBax.js";import{t as i}from"./file-text-N9JICX6E.js";import{t as a}from"./flask-conical-DhW5v7Zz.js";import{t as o}from"./list-checks-B5Jl4aiO.js";import{t as s}from"./wand-sparkles-DdQneChm.js";var c=n(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),l=n(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),u=n(`search-check`,[[`path`,{d:`m8 11 2 2 4-4`,key:`1sed1v`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),d=e();function f(e,t){return[{icon:r,label:e(`chat:focusSession.explainCode`),prompt:e(`chat:focusSession.explainHowThisCodeWorks`)},{icon:a,label:e(`chat:focusSession.writeTests`),prompt:e(`chat:focusSession.writeUnitTestsForTheFollowingCode`)},{icon:s,label:e(`chat:focusSession.refactor`),prompt:e(`chat:focusSession.refactorThisCodeAndExplainTheImprovements`)},{icon:c,label:e(`chat:focusSession.findABug`),prompt:e(`chat:focusSession.helpMeLocateAndFixThisBug`)},{icon:i,label:e(`chat:focusSession.summarize`),prompt:e(`chat:focusSession.summarizeContentAndExtractKeyPoints`)},...t?[{icon:o,label:e(`chat:focusSession.makeAPlan`),prompt:e(`chat:focusSession.makeAClearActionablePlanForThisGoal`)}]:[],{icon:l,label:e(`chat:focusSession.organizeInformation`),prompt:e(`chat:focusSession.organizeThisInformationIntoAClearStructure`)},{icon:u,label:e(`chat:focusSession.findIssues`),prompt:e(`chat:focusSession.reviewThisContentAndSuggestImprovements`)}]}function p({plansAvailable:e,onPromptSelect:n}){let{t:r}=t();return(0,d.jsxs)(`section`,{"aria-label":r(`chat:focusSession.promptIdeas`),className:`pt-3 text-center text-xs text-muted-foreground`,children:[(0,d.jsx)(`p`,{className:`mb-2`,children:r(`chat:focusSession.promptIdeas`)}),(0,d.jsx)(`div`,{className:`welcome-chips mx-auto flex max-w-[560px] flex-wrap justify-center gap-2 pt-2`,children:f(r,e).map(e=>(0,d.jsxs)(`button`,{type:`button`,"data-target-cursor":!0,onClick:()=>n(e.prompt),className:`inline-flex min-h-9 items-center gap-2 rounded-full border border-border bg-background px-3 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,d.jsx)(e.icon,{size:14,className:`text-muted-foreground`}),e.label]},e.label))})]})}export{p as default};