pisper 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/web/.vite/manifest.json +256 -256
- package/web/assets/{AppOverlays-D-yAp1vf.js → AppOverlays-CR5iJcP5.js} +1 -1
- package/web/assets/{AppShortcuts-CtNLVerh.js → AppShortcuts-BachmLQ3.js} +1 -1
- package/web/assets/{AssetsPage-DOzB9Wnk.js → AssetsPage-BltehMID.js} +1 -1
- package/web/assets/{ChannelsPage-DAPrpSTC.js → ChannelsPage-Tuw_qicj.js} +1 -1
- package/web/assets/{ChatAppearancePage-Q8jLnp7A.js → ChatAppearancePage-DME3PgDr.js} +2 -2
- package/web/assets/{ChatDockView-1fxZrR7W.js → ChatDockView-DoGtrBpY.js} +1 -1
- package/web/assets/{ChatHistoryPage-Bpyxsay_.js → ChatHistoryPage-DTXS6i3n.js} +1 -1
- package/web/assets/{ChatPage-CVOjCtOP.js → ChatPage-ibc_7olm.js} +3 -3
- package/web/assets/{ConfigPage-sVAdZytK.js → ConfigPage-CI6one5Y.js} +1 -1
- package/web/assets/{DecisionsPage-zq88dfkB.js → DecisionsPage-DOhLbIaD.js} +1 -1
- package/web/assets/{DesktopWindowControls-DYmSShHE.js → DesktopWindowControls-KmgemDO8.js} +1 -1
- package/web/assets/{FloatingWidgets-CFY30wFr.js → FloatingWidgets-Bs7ec6lW.js} +1 -1
- package/web/assets/{GitDiffViewer-BZV0A9mh.js → GitDiffViewer-xm2LnN9r.js} +1 -1
- package/web/assets/{MarkdownMessage-_VrT_sON.js → MarkdownMessage-H1336cMr.js} +1 -1
- package/web/assets/{McpPage-ROftSC8m.js → McpPage-Ck-7aLuZ.js} +1 -1
- package/web/assets/{MemoryPage-DkBjt-3Y.js → MemoryPage-BEdNJ3ot.js} +1 -1
- package/web/assets/{MobileContextScreen-BEss6aR9.js → MobileContextScreen-Dasny2J9.js} +2 -2
- package/web/assets/{MobileThreePane-DjyMuG9k.js → MobileThreePane-DEKMHPfN.js} +1 -1
- package/web/assets/{PageHeader-DyoCht8Y.js → PageHeader-C_bfu8Ir.js} +1 -1
- package/web/assets/{PluginsPage-DjaIps8G.js → PluginsPage-BPx5ERHL.js} +1 -1
- package/web/assets/{QuickPromptIdeas-B8P77vjW.js → QuickPromptIdeas-Bs-udcSZ.js} +1 -1
- package/web/assets/{SchedulesPage-CsJS8r9L.js → SchedulesPage-W4Mg7frl.js} +1 -1
- package/web/assets/{SessionContextPanel-BYlJfIxm.js → SessionContextPanel-lu9F9AJg.js} +1 -1
- package/web/assets/{SessionFilesPane-DWuwTplj.js → SessionFilesPane-BIRQ_hHi.js} +2 -2
- package/web/assets/{SidebarMoreTools-C2kAUJm0.js → SidebarMoreTools-BDqt5VTG.js} +1 -1
- package/web/assets/{SidebarRecentSessions-CoaY-U88.js → SidebarRecentSessions-1G_huYu9.js} +1 -1
- package/web/assets/{SidebarSettingsButton-BvmP3q5N.js → SidebarSettingsButton-B4_vEBS5.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-DHxZy6-o.js → SidebarUpdateStatus-DD8f4Fxv.js} +1 -1
- package/web/assets/{SkillsPage-CX55drgE.js → SkillsPage-CpRRosmo.js} +1 -1
- package/web/assets/{TerminalPanel-gBBjaBlu.js → TerminalPanel-DVKC4htc.js} +1 -1
- package/web/assets/{ThemeToggleButton-D6NR_guG.js → ThemeToggleButton-CXXbLtcY.js} +1 -1
- package/web/assets/{WebDesktopPet-BKP_jSW2.js → WebDesktopPet-DWFspeZE.js} +1 -1
- package/web/assets/{WorkbenchSidebarToggle-Kxa_tpUy.js → WorkbenchSidebarToggle-AgjfcT29.js} +1 -1
- package/web/assets/{WorkflowsPage-CNVCHm3u.js → WorkflowsPage-bhQlHSzS.js} +1 -1
- package/web/assets/{api-BbC90EzT.js → api-Dzobr-o_.js} +1 -1
- package/web/assets/catalog-D4eaIju4.js +1 -0
- package/web/assets/{chat-api-BWIsQYmQ.js → chat-api-DfnvubiW.js} +1 -1
- package/web/assets/{client-store-CAjI7P8I.js → client-store-DPMvgPNS.js} +1 -1
- package/web/assets/{component-api-CQ_xu0Wa.js → component-api-Nwo2yGZI.js} +1 -1
- package/web/assets/{config-search-BnPZPrUR.js → config-search-CwVhh2uc.js} +1 -1
- package/web/assets/{events-DJwBfKGM.js → events-Bwv6HmwM.js} +1 -1
- package/web/assets/{floating-widgets-store-DGeXH0NK.js → floating-widgets-store-DIy4GSy4.js} +2 -2
- package/web/assets/{http-BrDjjNkv.js → http-DphgzWtw.js} +1 -1
- package/web/assets/{i18n-Bo7twSO7.js → i18n-7QvbQzOQ.js} +1 -1
- package/web/assets/{index-IemAtsU4.js → index-iBrSU61i.js} +2 -2
- package/web/assets/{local-path-reveal-BSjf-Pum.js → local-path-reveal-DWhkyox-.js} +1 -1
- package/web/assets/{mount-app-AtqeFC4t.js → mount-app-n_05p6iW.js} +3 -3
- package/web/assets/{pick-system-directory-Wa63igLM.js → pick-system-directory-R1F5WyaB.js} +1 -1
- package/web/assets/{public-CsBeGSro.js → public-BcTP7F3I.js} +1 -1
- package/web/assets/{public-components-BYWnKxmu.js → public-components-Ck5BYo6M.js} +1 -1
- package/web/assets/{runtime-capabilities-store-BxCUS5xR.js → runtime-capabilities-store-DaWPY5y-.js} +1 -1
- package/web/assets/{session-change-summary-api-x1sTdOgD.js → session-change-summary-api-DFgTzTci.js} +1 -1
- package/web/assets/{session-list-DPpH_zbz.js → session-list-CMaoK_ZX.js} +1 -1
- package/web/assets/{session-streaming-state-OU65zaiO.js → session-streaming-state-llCTupbI.js} +1 -1
- package/web/assets/{shortcuts-B3q7nKdq.js → shortcuts-BO-h6OmP.js} +1 -1
- package/web/assets/{speech-session-BB9aLyRQ.js → speech-session-DKjw0mV_.js} +1 -1
- package/web/assets/{startup-queries-C-Xq7N50.js → startup-queries-CAQZvUIR.js} +1 -1
- package/web/assets/{ui-store-3r51KJe8.js → ui-store-2wpnH8Kf.js} +1 -1
- package/web/assets/{use-i18n-DyzoXal-.js → use-i18n-BSZKFkMb.js} +1 -1
- package/web/assets/{useCustomUiComponents-B3Z-pphj.js → useCustomUiComponents-BH86kuaq.js} +1 -1
- package/web/assets/{web-preview-panel-DNEqdotS.js → web-preview-panel-DVQxVfig.js} +4 -4
- package/web/index.html +1 -1
- package/web/assets/catalog-BPgyo6Yf.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-DyzoXal-.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-BbC90EzT.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"./use-animation-visibility-_Xe7jeUy.js";import{t as ae}from"./StarOrbit-BAAjh-hY.js";import{t as oe}from"./usePagePrimaryAction-CWPC0C_f.js";var se=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`}]]),ce=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),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}=ie(),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]!`;oe(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)(ce,{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)(se,{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)(ae,{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-BSZKFkMb.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-Dzobr-o_.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"./use-animation-visibility-_Xe7jeUy.js";import{t as ae}from"./StarOrbit-BAAjh-hY.js";import{t as oe}from"./usePagePrimaryAction-CWPC0C_f.js";var se=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`}]]),ce=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),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}=ie(),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]!`;oe(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)(ce,{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)(se,{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)(ae,{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,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AssetsPage-
|
|
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-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AssetsPage-BltehMID.js","assets/rolldown-runtime-B0Z9INg1.js","assets/index-iBrSU61i.js","assets/vendor-router-CZg2bCPV.js","assets/vendor-react-DwNgTV1j.js","assets/index-CdASiNlI.css","assets/use-i18n-BSZKFkMb.js","assets/i18n-7QvbQzOQ.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-Dzobr-o_.js","assets/http-DphgzWtw.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-H1336cMr.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/local-path-reveal-DWhkyox-.js","assets/route-context-DvWDul4T.js","assets/mobile-runtime-recovery-tbTyacip.js","assets/PluginsPage-BPx5ERHL.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/pick-system-directory-R1F5WyaB.js","assets/runtime-capabilities-store-DaWPY5y-.js","assets/tool-labels-DJzY62Yr.js","assets/TerminalPanel-DVKC4htc.js","assets/minus-BuutOHSj.js","assets/square-terminal-BVG6cUT1.js","assets/events-Bwv6HmwM.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-BSZKFkMb.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"./square-terminal-BVG6cUT1.js";import{t as u}from"./button-CQA36izu.js";import{t as d}from"./SessionFilesPane-BIRQ_hHi.js";import{n as f,r as p,t as m}from"./local-path-reveal-DWhkyox-.js";var h=e(n(),1),g=r(),_=(0,h.lazy)(()=>t(()=>import(`./AssetsPage-BltehMID.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,50]))),v=(0,h.lazy)(()=>t(()=>import(`./PluginsPage-BPx5ERHL.js`).then(e=>({default:e.PluginsPage})),__vite__mapDeps([51,1,4,6,7,3,2,5,8,9,26,30,52,53,54,55,37,56,35,27,25,10,46,57,58,59,60,12,61,62,63,64,65,66,17,67,68,18,19,21,22,23,24,69,20,33,34,36,38,70,40,71,72]))),y=(0,h.lazy)(()=>t(()=>import(`./TerminalPanel-DVKC4htc.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([73,1,4,10,57,74,16,75,20,21,22,3,7,2,5,8,23,24,25,26,27,76,77]))),b=[{id:`assets`,icon:c},{id:`changes`,icon:s},{id:`extensions`,icon:o},{id:`terminal`,icon:l}];function x(){let[e,t]=(0,h.useState)(null);return{action:e,register:(0,h.useCallback)(e=>(t(()=>e),()=>t(t=>t===e?null:t)),[])}}function S({visible:e,sessionStreaming:t,onCloseTerminal:n,onOpenChat:r,tab:o,onTabChange:s,activeSessionId:S,query:C,notify:w,requestConfirm:T,requestText:E,onUseAsset:D,terminalSupported:O,terminalLabels:k,resolveSessionCwd:A}){let{t:j}=i(),M={assets:j(`navigation:navigation.assets`),changes:j(`navigation:mobileShell.changes`),extensions:j(`navigation:mobileShell.extensions`),terminal:j(`navigation:mobileShell.terminal`)},[N,P]=(0,h.useState)(!1),F=(0,h.useRef)(!1),I=async()=>{if(!(F.current||!S)){F.current=!0,P(!0);try{let e=await A(S);if(!e.trim()){w(j(`navigation:mobileShell.workspaceUnavailable`),`error`);return}await f(e,p)}catch(e){w(e instanceof m&&e.reason===`unavailable`?j(`common:markdownMessage.revealLocalPathUnavailable`):e instanceof m&&e.reason===`timeout`?j(`common:markdownMessage.revealLocalPathTimeout`):j(`navigation:mobileShell.openWorkspaceFailed`),`error`)}finally{F.current=!1,P(!1)}}},L=x(),R=x(),[z,B]=(0,h.useState)(()=>new Set([o]));(0,h.useEffect)(()=>{B(e=>e.has(o)?e:new Set([...e,o]))},[o]);let V=e=>z.has(e)||o===e;return(0,g.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,"data-mobile-context-screen":!0,children:[(0,g.jsxs)(`div`,{className:`flex min-w-0 flex-none items-center gap-1 border-b border-[var(--stroke-soft)] px-2 py-1.5`,"data-swipe-ignore":!0,children:[(0,g.jsx)(`div`,{className:`flex min-w-0 flex-1 gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,role:`tablist`,"aria-label":j(`navigation:mobileShell.context`),children:b.map(({id:e,icon:t})=>{let n=o===e;return(0,g.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,g.jsx)(t,{size:14,"aria-hidden":`true`}),M[e]]},e)})}),(0,g.jsxs)(u,{variant:`ghost`,size:`sm`,className:`h-8 shrink-0`,disabled:N||!S,"aria-busy":N,"aria-label":j(`navigation:mobileShell.openWorkspace`),title:j(`navigation:mobileShell.openWorkspace`),onClick:()=>void I(),children:[(0,g.jsx)(c,{size:14,"aria-hidden":`true`}),j(`navigation:mobileShell.files`)]})]}),(0,g.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:[V(`assets`)&&(0,g.jsxs)(`div`,{hidden:o!==`assets`,className:`h-full overflow-auto px-3 py-3 [&_.asset-grid]:!grid-cols-1`,children:[(0,g.jsx)(u,{className:`mb-3`,disabled:!L.action,onClick:()=>L.action?.(),children:j(`assets:assetsPage.addLink`)}),(0,g.jsx)(h.Suspense,{fallback:null,children:(0,g.jsx)(_,{query:C,notify:w,registerPrimaryAction:L.register,requestConfirm:T,onUse:D},S)})]}),o===`changes`&&(S?t===null?(0,g.jsx)(u,{className:`m-3`,variant:`outline`,onClick:r,children:j(`navigation:mobileShell.changesOpenChat`)}):(0,g.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:(0,g.jsx)(d,{sessionId:S,streaming:t,requestConfirm:T},S)}):(0,g.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground`,children:j(`navigation:mobileShell.noSessionChanges`)})),V(`extensions`)&&(0,g.jsxs)(`div`,{hidden:o!==`extensions`,className:`h-full overflow-auto px-3 py-3`,children:[(0,g.jsx)(u,{className:`mb-3`,disabled:!R.action,onClick:()=>R.action?.(),children:j(`plugins:pluginsPage.savePolicy`)}),(0,g.jsx)(h.Suspense,{fallback:null,children:(0,g.jsx)(v,{query:C,notify:w,registerPrimaryAction:R.register,requestText:E,requestConfirm:T})})]}),V(`terminal`)&&(0,g.jsx)(`div`,{hidden:o!==`terminal`,className:`h-full min-h-0`,children:O?(0,g.jsx)(h.Suspense,{fallback:null,children:(0,g.jsx)(y,{layout:`fill`,open:e&&o===`terminal`,height:480,labels:k,activeSessionId:S,resolveSessionCwd:A,onOpenChange:e=>{e||n()},onHeightChange:()=>{}})}):(0,g.jsxs)(`div`,{className:`grid h-full place-content-center gap-2 px-6 text-center text-sm text-muted-foreground`,children:[(0,g.jsx)(l,{className:`mx-auto`,size:22,"aria-hidden":`true`}),(0,g.jsx)(`p`,{children:j(`navigation:mobileShell.terminalUnavailable`)})]})})]})]})}export{S 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-
|
|
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-BSZKFkMb.js";import{t as i}from"./utils-C8uzG5AZ.js";import{t as a}from"./chevron-left-BAtyp3_6.js";import{t as o}from"./chevron-right-C3t2Rckj.js";import{t as s}from"./button-CQA36izu.js";import{a as c,n as l,o as u,r as d,t as f}from"./mobile-shell-layout-CMpTmYRX.js";var p=e(t(),1);function m(e,t,n){let r=(0,p.useRef)(null),i=(0,p.useRef)({pane:t,onPaneChange:n});i.current={pane:t,onPaneChange:n};let a=(0,p.useRef)(null),o=(0,p.useCallback)(e=>{a.current?.settle(l(e)),(0,p.startTransition)(()=>i.current.onPaneChange(e))},[]),s=(0,p.useCallback)(e=>{let t=a.current?.index()??l(i.current.pane);o(d(f[t],e))},[o]);return(0,p.useLayoutEffect)(()=>{let t=r.current;if(!e||!t)return;let n=Array.from(t.children),s=window.matchMedia(`(prefers-reduced-motion: reduce)`),p=()=>document.documentElement.dataset.motion===`reduced`||s.matches&&document.documentElement.dataset.motion!==`full`,m=[],h=null,g=0,_=l(i.current.pane),v=_,y=_,b=t.parentElement?.clientWidth||1,x=e=>`translate3d(${e*b}px,0,0)`,S=null,C=e=>`perspective(1100px) rotateY(${Math.max(-1,Math.min(1,e))*72}deg)`,w=()=>{g&&cancelAnimationFrame(g),g=0;for(let e of m)e.onfinish=null,e.cancel();m=[],h=null},T=(e,r)=>{_=e,r?(t.style.transform=x(v-e),t.style.willChange=`transform`):(v=e,t.style.marginLeft=`${-e*100}%`,t.style.transform=``,t.style.willChange=``),n.forEach((t,n)=>{let i=n-e,a=r&&!p()&&Math.abs(i)<=1;t.style.transform=a?C(i):``,t.style.willChange=a?`transform`:``,t.style.transformOrigin=r?i<0?`right center`:`left center`:``})},E=()=>{if(h){let e=h.animation.effect?.getComputedTiming().progress??0;return h.from+(h.to-h.from)*e}let e=new DOMMatrixReadOnly(getComputedStyle(t).transform);return v-e.m41/b},D=e=>{if(e===y&&!S&&(m.length||Math.abs(_-e)<.001))return;let r=m.length?E():_;if(y=e,w(),S=null,T(e,!1),p()||Math.abs(r-e)<.001)return;let i={duration:220,easing:`cubic-bezier(.2,.8,.2,1)`};if(Math.abs(r-e)>1.9){let t=Math.round(r),a=n[t],o=n[e],s=e>r?1:-1;a.style.willChange=`transform, opacity`,o.style.willChange=`transform`,m=[o.animate([{transform:C(s),transformOrigin:s>0?`left center`:`right center`},{transform:C(0),transformOrigin:s>0?`left center`:`right center`}],i),a.animate([{transform:`${x(e-t)} ${C(0)}`,opacity:1,transformOrigin:s>0?`right center`:`left center`},{transform:`${x(e-t)} ${C(-s)}`,opacity:0,transformOrigin:s>0?`right center`:`left center`}],i)],h={from:r,to:e,animation:m[0]}}else t.style.willChange=`transform`,m=[t.animate([{transform:x(e-r)},{transform:x(0)}],i)],n.forEach((t,n)=>{if(n<Math.floor(Math.min(r,e))||n>Math.ceil(Math.max(r,e)))return;let a=n<=Math.min(r,e)?`right center`:`left center`;t.style.willChange=`transform`,m.push(t.animate([{transform:C(n-r),transformOrigin:a},{transform:C(n-e),transformOrigin:a}],i))});m[0].onfinish=()=>{w(),T(e,!1)}},O=()=>{S&&D(y)},k=e=>{if(e.touches.length!==1){O();return}if(c(e.target)||window.getSelection()?.isCollapsed===!1)return;let t=e.touches[0],n=m.length?E():_;w(),T(n,!1),S={id:t.identifier,x:t.clientX,y:t.clientY,position:n,locked:!1}},A=e=>{if(!S)return;if(e.touches.length!==1){O();return}let t=e.touches[0];if(t.identifier!==S.id)return;let n=t.clientX-S.x,r=t.clientY-S.y;if(!S.locked){if(Math.max(Math.abs(n),Math.abs(r))<10)return;if(Math.abs(n)<=Math.abs(r)*1.2){O();return}S.locked=!0}if(!e.cancelable){O();return}e.preventDefault();let i=Math.max(0,Math.min(2,S.position-n/b));g&&cancelAnimationFrame(g),g=requestAnimationFrame(()=>{g=0,T(i,!0)})},j=e=>{if(!S)return;let t=Array.from(e.changedTouches).find(e=>e.identifier===S?.id);if(!t)return;let n=S.locked?u(t.clientX-S.x,t.clientY-S.y):0,r=n?d(f[y],n):f[y];n&&r!==f[y]?(S=null,o(r)):D(y)},M=()=>{w(),S=null,b=t.parentElement?.clientWidth||1,T(y,!1)};a.current={settle:D,index:()=>y},T(_,!1);let N=new MutationObserver(M);return N.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-motion`]}),s.addEventListener(`change`,M),window.addEventListener(`resize`,M),t.addEventListener(`touchstart`,k,{passive:!0}),t.addEventListener(`touchmove`,A,{passive:!1}),t.addEventListener(`touchend`,j),t.addEventListener(`touchcancel`,O),()=>{w(),N.disconnect(),s.removeEventListener(`change`,M),window.removeEventListener(`resize`,M),t.removeEventListener(`touchstart`,k),t.removeEventListener(`touchmove`,A),t.removeEventListener(`touchend`,j),t.removeEventListener(`touchcancel`,O),t.style.marginLeft=``,t.style.transform=``,t.style.willChange=``,n.forEach(e=>{e.style.transform=``,e.style.transformOrigin=``,e.style.willChange=``}),a.current=null}},[e,o]),(0,p.useLayoutEffect)(()=>{a.current?.settle(l(t))},[t,e]),{trackRef:r,requestPane:o,stepPane:s}}var h=n();function g({enabled:e,mode:t,pane:n,onPaneChange:c,sessions:u,chat:d,context:f}){let{t:g}=r(),_=e&&t===`phone`,{trackRef:v,requestPane:y,stepPane:b}=m(_,n,c),x=(0,p.useId)();if(!e||t===`off`)return(0,h.jsxs)(h.Fragment,{children:[u,d]});let S=[{id:`sessions`,label:g(`navigation:mobileShell.sessions`),node:u},{id:`chat`,label:g(`navigation:mobileShell.chat`),node:d},{id:`context`,label:g(`navigation:mobileShell.context`),node:f}];return(0,h.jsxs)(`div`,{className:i(`relative h-full min-h-0 min-w-0 flex-1 overflow-hidden`,_?`flex flex-col`:`grid min-h-0 grid-cols-[minmax(220px,260px)_minmax(0,1fr)_minmax(280px,360px)] grid-rows-[minmax(0,1fr)]`),"data-mobile-shell":t,children:[_&&(0,h.jsxs)(`div`,{className:`[[data-mobile-keyboard='open']_&]:hidden flex h-11 flex-none items-center gap-1 border-b border-[var(--stroke-soft)] bg-[var(--sidebar-bg)] px-1`,children:[(0,h.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,className:`size-11 shrink-0 disabled:opacity-30`,"aria-label":g(`navigation:mobileShell.previousPane`),title:g(`navigation:mobileShell.previousPane`),disabled:n===`sessions`,onClick:()=>b(-1),children:(0,h.jsx)(a,{size:18,"aria-hidden":`true`})}),(0,h.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center justify-center gap-1`,role:`tablist`,"aria-label":g(`navigation:mobileShell.pager`),children:S.map(e=>{let t=n===e.id;return(0,h.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,"aria-controls":`${x}-${e.id}`,tabIndex:t?0:-1,onKeyDown:t=>{let n=l(e.id),r=t.key===`ArrowRight`?(n+1)%S.length:t.key===`ArrowLeft`?(n+S.length-1)%S.length:t.key===`Home`?0:t.key===`End`?S.length-1:-1;r<0||(t.preventDefault(),y(S[r].id),(t.currentTarget.parentElement?.querySelectorAll(`button`))?.[r]?.focus())},className:i(`h-9 min-w-0 truncate rounded-full px-2.5 text-[11px] font-medium`,t?`bg-[var(--star-soft)] text-[var(--star-strong)]`:`text-[var(--text-muted)]`),onClick:()=>y(e.id),children:e.label},e.id)})}),(0,h.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,className:`size-11 shrink-0 disabled:opacity-30`,"aria-label":g(`navigation:mobileShell.nextPane`),title:g(`navigation:mobileShell.nextPane`),disabled:n===`context`,onClick:()=>b(1),children:(0,h.jsx)(o,{size:18,"aria-hidden":`true`})})]}),(0,h.jsx)(`div`,{ref:v,className:i(`min-h-0 min-w-0 flex-1`,_?`flex w-[300%]`:`contents`),children:S.map(e=>(0,h.jsx)(`section`,{id:`${x}-${e.id}`,role:_?`tabpanel`:void 0,className:i(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,_?`w-1/3 shrink-0 bg-background`:`min-w-0`),"aria-label":e.label,"aria-hidden":_&&n!==e.id?!0:void 0,..._&&n!==e.id?{inert:!0}:{},children:e.node},e.id))})]})}export{g as MobileThreePane};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-
|
|
1
|
+
import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-BSZKFkMb.js";import{t as n}from"./utils-C8uzG5AZ.js";import{t as r}from"./ThemeToggleButton-CXXbLtcY.js";import{t as i}from"./link-2-mgasYn21.js";import{t as a}from"./WorkbenchSidebarToggle-AgjfcT29.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-BO-h6OmP.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-DyzoXal-.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-BbC90EzT.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{n as V,t as H}from"./pick-system-directory-Wa63igLM.js";import{t as se}from"./usePagePrimaryAction-CWPC0C_f.js";import{i as ce,t as le}from"./runtime-capabilities-store-BxCUS5xR.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=le(e=>e.capabilities),c=ce(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]);se(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
|
+
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-BSZKFkMb.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-Dzobr-o_.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{n as V,t as H}from"./pick-system-directory-R1F5WyaB.js";import{t as se}from"./usePagePrimaryAction-CWPC0C_f.js";import{i as ce,t as le}from"./runtime-capabilities-store-DaWPY5y-.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=le(e=>e.capabilities),c=ce(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]);se(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-
|
|
1
|
+
import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-BSZKFkMb.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-lg border border-border/70 bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,d.jsx)(e.icon,{size:14,className:`text-foreground`}),e.label]},e.label))})]})}export{p as default};
|