pisper 0.6.34 → 0.6.35
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 +5 -5
- package/web/.vite/manifest.json +662 -669
- package/web/assets/{AppDialog-xnUDICdc.js → AppDialog-BIc2uEZh.js} +1 -1
- package/web/assets/{AppOverlays-rUZC1kCv.js → AppOverlays-BlJ0uL_P.js} +1 -1
- package/web/assets/{AssetsPage-XEKK_C-R.js → AssetsPage-B9lqKmXy.js} +1 -1
- package/web/assets/BoardPage-BB_xAnQV.js +3 -0
- package/web/assets/{ChannelsPage-qmX4oWnZ.js → ChannelsPage-DgzuzmFL.js} +1 -1
- package/web/assets/{ChatAppearancePage-BfSCRq3M.js → ChatAppearancePage-98Sa8ZQW.js} +1 -1
- package/web/assets/{ChatHistoryPage-Dn2KO-xs.js → ChatHistoryPage-BHsZFF4a.js} +1 -1
- package/web/assets/ChatPage-C3NC9LNG.js +553 -0
- package/web/assets/{ConfigPage-bwrsIfQ2.js → ConfigPage-D3SyAsIs.js} +2 -2
- package/web/assets/{DesktopWindowControls-BYSFRwAw.js → DesktopWindowControls-BQ0OvDZ8.js} +1 -1
- package/web/assets/{FeaturePage-DTDpEz7O.js → FeaturePage-C0bAQ4el.js} +1 -1
- package/web/assets/{FileAttachmentPreview-DSXCj6RP.js → FileAttachmentPreview-BdMgsecO.js} +1 -1
- package/web/assets/{FloatingWidgets-BbeW1y-O.js → FloatingWidgets-DjMCcqln.js} +1 -1
- package/web/assets/FocusRuntimeControls-DeSe12wJ.js +2 -0
- package/web/assets/{GitDiffViewer-DQVUfRzI.js → GitDiffViewer-hHSTzUJk.js} +1 -1
- package/web/assets/{ManageProjectsDialog-69xTwGhN.js → ManageProjectsDialog-DVLX4ZBu.js} +1 -1
- package/web/assets/{MarkdownMessage-CMM5-pzJ.js → MarkdownMessage-CktdHgKM.js} +1 -1
- package/web/assets/{McpPage-DuR_f74H.js → McpPage-7wR_N0eS.js} +1 -1
- package/web/assets/{MemoryEvolution-Ulreb-P1.js → MemoryEvolution-DBjU-Nr7.js} +1 -1
- package/web/assets/MemoryPage-DiO4GHc7.js +2 -0
- package/web/assets/{MobileNavigation-B6e3f9M1.js → MobileNavigation-B2NKM8rj.js} +1 -1
- package/web/assets/{MorePage-BAEFRO9r.js → MorePage-xB2zBRtU.js} +1 -1
- package/web/assets/{NewFolderDialog-CrIBoIPP.js → NewFolderDialog-CjWMsY2Q.js} +1 -1
- package/web/assets/{PageHeader-CkkhGH11.js → PageHeader-BN-qcxte.js} +1 -1
- package/web/assets/{PhoneDrawer-BQglMtV6.js → PhoneDrawer-utEXi-yp.js} +1 -1
- package/web/assets/{PhoneMenuButton-CudQuQyy.js → PhoneMenuButton-uG_T93KL.js} +1 -1
- package/web/assets/{PhoneTopBar-DyaB9qif.js → PhoneTopBar-DuLewk2J.js} +1 -1
- package/web/assets/{PluginsPage-DMLkkpQg.js → PluginsPage-D0hAMgQ_.js} +1 -1
- package/web/assets/{SafeModePrompt-BWzQ6wxr.js → SafeModePrompt-jV-PRvrW.js} +1 -1
- package/web/assets/{SchedulesPage-CvsxgvB6.js → SchedulesPage-Diethe4H.js} +1 -1
- package/web/assets/{SessionBrowserPane-NHFA_B4m.js → SessionBrowserPane-y7gPArTV.js} +2 -2
- package/web/assets/{SessionContextPanel-DTHjt2nZ.js → SessionContextPanel-Ckca3NrN.js} +2 -2
- package/web/assets/{SessionHome-B1OsYR84.js → SessionHome-CcjiU1fU.js} +1 -1
- package/web/assets/SessionInspector-CNSyVYK6.js +1 -0
- package/web/assets/{SessionShell-BfdEBF6l.js → SessionShell-wOw-rTQD.js} +1 -1
- package/web/assets/{SettingsSidebar-z1Fxmoyd.js → SettingsSidebar-CpAD5iSt.js} +1 -1
- package/web/assets/{ShortcutHelpDialog-DL3H1yOW.js → ShortcutHelpDialog-C2QbSvui.js} +1 -1
- package/web/assets/{ShortcutKeys-DPl0NOHr.js → ShortcutKeys-Dl4Suwhz.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-Cpew_R7W.js → SidebarUpdateStatus-DrS7u_v_.js} +1 -1
- package/web/assets/{SkillsPage-Dl57veVj.js → SkillsPage-CDoMtK-E.js} +1 -1
- package/web/assets/{TaskProcessesPane-B6hiVd6p.js → TaskProcessesPane-Z_9HeVX5.js} +1 -1
- package/web/assets/{TaskTerminalView-jBOqCyhw.js → TaskTerminalView-BTCVpAHF.js} +1 -1
- package/web/assets/{TerminalPanel-CAl3KAS_.js → TerminalPanel-DuUtaPyf.js} +1 -1
- package/web/assets/{WebDesktopPet-kcayOmfs.js → WebDesktopPet-CWviMnct.js} +1 -1
- package/web/assets/{WorkflowsPage-DrX0d5UQ.js → WorkflowsPage-CHvyXwCg.js} +1 -1
- package/web/assets/{WorkspacePicker-Bt_doGjv.js → WorkspacePicker-D6FLo7O1.js} +1 -1
- package/web/assets/{api-C35aq3ml.js → api-Cm58F7OP.js} +1 -1
- package/web/assets/{app-update-5vmM-tQ5.js → app-update-KLjtuCDT.js} +1 -1
- package/web/assets/{approval-confirm-DhWuPa_J.js → approval-confirm-BrorOUHg.js} +1 -1
- package/web/assets/board-messages-3qT8nGsd.js +1 -0
- package/web/assets/{board-projects-Nk7cPRh8.js → board-projects-CeL6PPiY.js} +1 -1
- package/web/assets/{bots-store-CWuQZKi-.js → bots-store-CRGayU4z.js} +1 -1
- package/web/assets/chat-api-DQyHZl-V.js +1 -0
- package/web/assets/{client-store-D1Oy98mB.js → client-store-4G-xfNKc.js} +1 -1
- package/web/assets/{config-search-C5x1n8SB.js → config-search-1BIdouae.js} +1 -1
- package/web/assets/{desktop-hosts-9JgAXtsJ.js → desktop-hosts-uMG7lFRY.js} +1 -1
- package/web/assets/{dialog-27CgEIc2.js → dialog-D23yIdOZ.js} +1 -1
- package/web/assets/{event-stream-DTCmB4AA.js → event-stream-BrDcABQx.js} +1 -1
- package/web/assets/{events-DMbz7S1A.js → events-BgEZwyTb.js} +1 -1
- package/web/assets/{folder-paths-BB2PvkZ4.js → folder-paths-D0-7xV2n.js} +1 -1
- package/web/assets/{hosts-D81SQ3Fm.js → hosts-DljHKUSO.js} +1 -1
- package/web/assets/{http-YNvizzuJ.js → http-DtkTCrZ4.js} +1 -1
- package/web/assets/{http-response-Bb_1H1lE.js → http-response-B2n7HFQ4.js} +1 -1
- package/web/assets/i18n-B7QmqfvO.js +1 -0
- package/web/assets/{index-_WvEqLNn.js → index-79gEOxmD.js} +2 -2
- package/web/assets/index-XwGsScbB.css +2 -0
- package/web/assets/{machine-messages-Cnbja0tj.js → machine-messages-Bd6JwiOe.js} +1 -1
- package/web/assets/{machines-api-p5yRMnI5.js → machines-api-Kg457H3y.js} +1 -1
- package/web/assets/{memory-api-CSEqYBZN.js → memory-api-DHLgFXzZ.js} +1 -1
- package/web/assets/message-square-text-C5MJw0FL.js +1 -0
- package/web/assets/mount-app-BlaI2VZs.js +9 -0
- package/web/assets/{permission-rules-api-BM5qRwQ-.js → permission-rules-api-BZn4yp-J.js} +1 -1
- package/web/assets/{pick-system-directory-CjwfGZuj.js → pick-system-directory-DS_-qn8W.js} +1 -1
- package/web/assets/placements-BMxzzGTX.js +2 -0
- package/web/assets/{popover-CaaxkJV6.js → popover-C5U02alK.js} +1 -1
- package/web/assets/{public-Cs-VgI_R.js → public-B8mbf50i.js} +1 -1
- package/web/assets/public-Be05c5M9.js +2 -0
- package/web/assets/{public-bgEdGMBy.js → public-Bq1VrNr8.js} +2 -2
- package/web/assets/{public-CTCOj1Tc.js → public-DsjuTTt0.js} +1 -1
- package/web/assets/{public-components-Cxirb-D4.js → public-components-CMbKXCZU.js} +1 -1
- package/web/assets/public-diff-4sBkfeo8.js +1 -0
- package/web/assets/public-events-D2kHUhG2.js +1 -0
- package/web/assets/{public-flags-BHDCY_aY.js → public-flags-D8CxujmF.js} +1 -1
- package/web/assets/{public-folder-dialog-MAINAiLs.js → public-folder-dialog-Dnmn6DIU.js} +1 -1
- package/web/assets/{public-greeting-nLVPlZrv.js → public-greeting-Cs-sacVq.js} +1 -1
- package/web/assets/{public-session-qCqrUJ6y.js → public-session-DSLmbBcw.js} +1 -1
- package/web/assets/{public-sidebar-D6Ujh_8I.js → public-sidebar-UNJ9_fD1.js} +1 -1
- package/web/assets/{runtime-capabilities-store-D_0w_fuG.js → runtime-capabilities-store-Y9MaywP8.js} +1 -1
- package/web/assets/{safe-mode-instance-B1xRd2Id.js → safe-mode-instance-CYIRMY5i.js} +1 -1
- package/web/assets/safe-mode-sentinel-Bq9lNJoA.js +1 -0
- package/web/assets/{session-change-summary-api-Bz6qW3dZ.js → session-change-summary-api-Dp9vVPv_.js} +1 -1
- package/web/assets/{session-home-CdOoCouS.js → session-home-DqEkX19H.js} +1 -1
- package/web/assets/{session-inspector-store-BUq8tTV4.js → session-inspector-store-D_mwa4K7.js} +1 -1
- package/web/assets/{session-organization-api-oAt9Tied.js → session-organization-api-ibzfB8fg.js} +1 -1
- package/web/assets/session-questions-94KACguh.js +1 -0
- package/web/assets/{session-scope-PFTSXL_B.js → session-scope-BJIZo6ty.js} +1 -1
- package/web/assets/{session-tree-actions-D-hQZc07.js → session-tree-actions-B8GDKcGe.js} +1 -1
- package/web/assets/{session-tree-summary-gqTig55_.js → session-tree-summary-BTcPaCgY.js} +1 -1
- package/web/assets/{shortcuts-B5Q10H38.js → shortcuts-DRfz9B_B.js} +1 -1
- package/web/assets/side-chat-context-CRQ33Q0D.js +7 -0
- package/web/assets/{sidebar-Dct9J7LY.js → sidebar-DrzZKq2i.js} +1 -1
- package/web/assets/{sidebar-store-CHqFyueh.js → sidebar-store-BvZAgxJg.js} +1 -1
- package/web/assets/{speech-session-BzWOz7_A.js → speech-session-DGkMojp3.js} +1 -1
- package/web/assets/{startup-queries-LEtJRewm.js → startup-queries-BjjeYiQ8.js} +1 -1
- package/web/assets/{use-i18n-QY-mTTDS.js → use-i18n-8V6eRMcE.js} +1 -1
- package/web/assets/{use-open-bot-BCteAGsU.js → use-open-bot-BEhRmhru.js} +1 -1
- package/web/assets/{use-studio-actions-CVQo8gWA.js → use-studio-actions-BsdfCptK.js} +1 -1
- package/web/assets/{useCatalogProjects-B0P8PrPz.js → useCatalogProjects-DKjmAJ2x.js} +1 -1
- package/web/assets/{useMachines-D-YSauyl.js → useMachines-BBeg2uOZ.js} +1 -1
- package/web/assets/useNewProjectPicker-Cmw2SOhW.js +2 -0
- package/web/assets/{useNow-CvnDomJ8.js → useNow-D-gM4IXU.js} +1 -1
- package/web/assets/{usePhoneShell-Cv5Or-Rz.js → usePhoneShell-DRZTDDgZ.js} +1 -1
- package/web/assets/useSessionListQuery-DtpEX8a5.js +2 -0
- package/web/assets/{useSessionRowActions-DaVD7CkP.js → useSessionRowActions-DBqnVodk.js} +1 -1
- package/web/assets/{useSidebarModel-KU2-5Lqq.js → useSidebarModel-DBH3JLQ1.js} +1 -1
- package/web/assets/{workspace-folders-BrwI22Ku.js → workspace-folders-Bu3t-gEw.js} +1 -1
- package/web/assets/{workspace-order-store-04YPBRRV.js → workspace-order-store-DmEFuNUL.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/BoardPage-DsRRgaSA.js +0 -3
- package/web/assets/ChatPage-saAM1R5P.js +0 -553
- package/web/assets/FocusRuntimeControls-CUqEkAM6.js +0 -1
- package/web/assets/MemoryPage-BSAhhmdG.js +0 -2
- package/web/assets/SessionInspector-CIfPX9LJ.js +0 -1
- package/web/assets/board-messages-D6AWGHuF.js +0 -1
- package/web/assets/chat-api-fzSB1i2N.js +0 -1
- package/web/assets/focus-session-composer-bits-B_mOqktE.js +0 -1
- package/web/assets/i18n-CWhhZ2QN.js +0 -1
- package/web/assets/index-BTqJTVNA.css +0 -2
- package/web/assets/mount-app-Dee6SQOq.js +0 -9
- package/web/assets/placements-BvtgsaIH.js +0 -2
- package/web/assets/public-DW6Tkvj2.js +0 -2
- package/web/assets/public-diff-B2iBx26D.js +0 -1
- package/web/assets/public-events-QnPYL1F-.js +0 -1
- package/web/assets/safe-mode-sentinel-DmNv7ZYs.js +0 -1
- package/web/assets/session-questions-Cf-1g85h.js +0 -1
- package/web/assets/side-chat-context-CoDP1BZc.js +0 -7
- package/web/assets/useNewProjectPicker-V3_nwv5l.js +0 -2
- package/web/assets/useSessionListQuery-CuUmG2UC.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,n,r}from"./vendor-react-DwNgTV1j.js";import{f as i,p as a}from"./i18n-CWhhZ2QN.js";import{t as o}from"./use-i18n-QY-mTTDS.js";import{p as s}from"./query-DFQayLF5.js";import{t as c}from"./useQuery-DfOU-27z.js";import{t as l}from"./createLucideIcon-Cd-3GVxJ.js";import{t as u}from"./braces-DQcXLGFF.js";import{t as d}from"./check-2vYc6QaP.js";import{t as f}from"./chevron-right-C3t2Rckj.js";import{t as p}from"./chevrons-up-down-C2sEPdAh.js";import{i as m}from"./focus-session-composer-bits-B_mOqktE.js";import{t as h}from"./search-D0mqDaf_.js";import{i as g,t as _}from"./dist-41X0pdUs.js";import{c as v,n as y}from"./dist-BsRXXcSL.js";import{a as b,o as x,r as S,t as C}from"./dist-BHkR6BLP.js";import{i as w,n as T,t as E}from"./popover-CaaxkJV6.js";import{t as D}from"./slider-De8rWVNs.js";import{t as O}from"./utils-C8uzG5AZ.js";import{n as k,o as A,r as j,t as M}from"./sheet-BTaIEX4w.js";import{n as N,t as P}from"./chat-api-fzSB1i2N.js";import{r as F}from"./format-DMJQzoZ7.js";import{i as I}from"./run-activity-CwfO0cui.js";import"./dialog-27CgEIc2.js";import{n as ee,t as te}from"./input-group-h8z63MzW.js";import{t as L}from"./model-display-kDwvtxrW.js";var ne=l(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),re=l(`square-slash`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),R=e(t(),1);function ie(e){let t=e.match(/^\/btw(?:\s+([\s\S]*))?$/);return t?(t[1]||``).trim():null}function z(e,t,n,r){return n.length?[{invocation:`/${e}`,description:t},...n.map(t=>({invocation:`/${e} ${t.value}`,description:t.label,current:t.current,run:()=>r(t.value)}))]:[]}function ae({t:e,models:t,model:n,onModel:r,thinkingLevels:i,thinkingLevel:a,thinkingLabel:o,onThinking:s,executionModes:c,executionMode:l,executionLabel:u,onExecutionMode:d,runModes:f,runMode:p,runModeLabel:m,onRunMode:h}){return[...z(`model`,e(`chat:commands.builtin.model`),t.map(e=>({value:e.key,label:e.providerName?`${e.label} · ${e.providerName}`:e.label,current:e.key===n})),r),...z(`effort`,e(`chat:commands.builtin.effort`),i.map(e=>({value:e,label:o(e),current:e===a})),s),...z(`approval`,e(`chat:commands.builtin.approval`),c.map(e=>({value:e,label:u(e),current:e===l})),d),...f.length>1?z(`run`,e(`chat:commands.builtin.run`),f.map(e=>({value:e,label:m(e),current:e===p})),h):[]]}function oe(e,t,n){let r=e=>e.toLocaleLowerCase(n),i=r(t),a=i.search(/\s/);if(a<0)return e.filter(e=>!e.invocation.includes(` `)&&r(`${e.invocation} ${e.description}`).includes(i));let o=`/${i.slice(0,a)} `,s=i.slice(a).trim();return e.filter(e=>r(e.invocation).startsWith(o)&&r(`${e.invocation} ${e.description}`).includes(s))}var se=10485760,ce=20971520,le=new Set([`txt`,`md`,`json`,`js`,`jsx`,`ts`,`tsx`,`css`,`html`,`xml`,`yaml`,`yml`,`csv`,`log`,`py`,`java`,`go`,`rs`,`sh`,`ps1`,`toml`,`sql`]),ue=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`svg`]),de=new Set([`pdf`,`docx`,`pptx`,`xlsx`,`odt`,`odp`,`ods`,`rtf`,`epub`]),fe=[`image/*`,`text/*`,`application/json`,...[...ue,...le,...de].map(e=>`.${e}`)].join(`,`);function pe(e){let t=[...e?.files||[]];return t.length?t:[...e?.items||[]].filter(e=>e.kind===`file`).map(e=>e.getAsFile?.()).filter(e=>!!e)}function me(e){return[...e?.types||[]].includes(`Files`)}function he(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(String(i.result).split(`,`)[1]||``),i.onerror=()=>r(i.error||Error(t(`chat:attachments.couldNotReadFile`))),i.readAsDataURL(e)})}function ge(e){return e.toLowerCase().split(`.`).at(-1)||``}async function _e(e,t){let n=[...e].slice(0,8),r=[];for(let e of n){if(e.size>se)throw Error(t(`chat:attachments.nameExceedsThe10MBLimit`,{name:e.name}));let n=ge(e.name),i={id:`${e.name}-${e.lastModified}-${e.size}`,name:e.name,mimeType:e.type||`application/octet-stream`,size:e.size};if(e.type.startsWith(`image/`)||ue.has(n))r.push({...i,kind:`image`,data:await he(e,t)});else if(e.type.startsWith(`text/`)||e.type===`application/json`||le.has(n))r.push({...i,kind:`text`,text:await e.text()});else if(de.has(n))r.push({...i,kind:`document`,extension:n,data:await he(e,t)});else throw Error(t(`chat:attachments.nameIsNotSupportedChooseAnImageOrTextCodeFile`,{name:e.name}))}return r}function ve(e){return e.split(/[\\/]/).filter(Boolean).at(-1)||e}function ye(e){return[...e].map(e=>String(e||``).trim()).filter(Boolean).slice(0,8).map(e=>({id:`path:${e}`,kind:`path`,name:ve(e),path:e}))}function be(e=[],t,n){let r=(0,R.useCallback)((e,t)=>a(e,i(),t),[]),[o,s]=(0,R.useState)(()=>[...e]),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)([]),f=(0,R.useRef)(new Map),p=(0,R.useRef)(0),m=(0,R.useRef)(n);m.current=n,(0,R.useEffect)(()=>{let e=f.current;return d([]),l(``),()=>{for(let t of e.values())t.cancelled=!0;e.clear()}},[n]);let h=(0,R.useRef)([...e]),g=(0,R.useCallback)(e=>{h.current=e,s(e),t?.(e)},[t]),_=(0,R.useCallback)(async e=>{let t=n,i=[...e||[]].slice(0,8).map(e=>{let t=`preparing-${++p.current}`,n={name:e.name,cancelled:!1};return f.current.set(t,n),{id:t,job:n,file:e}}),a=()=>d([...f.current].map(([e,t])=>({id:e,name:t.name})));a(),l(``);let o=!1;for(let{id:e,job:n,file:s}of i)try{let i=await _e([s],r);if(n.cancelled||m.current!==t||!f.current.has(e))continue;let a=[...h.current,...i].slice(0,8);if(a.filter(e=>e.kind!==`path`).reduce((e,t)=>e+(t.size||0),0)>ce)throw Error(r(`chat:attachments.totalAttachmentSizeCannotExceed20MB`));g(a),o=!0}catch(e){!n.cancelled&&m.current===t&&l(e instanceof Error?e.message:String(e))}finally{f.current.delete(e),m.current===t&&a()}return o},[n,g,r]);return{attachments:o,attachmentError:c,preparingAttachments:u,addFiles:_,pasteFiles:(0,R.useCallback)(e=>{let t=pe(e.clipboardData);t.length&&(e.preventDefault(),_(t))},[_]),dropFiles:(0,R.useCallback)(e=>{if(!me(e.dataTransfer))return;e.preventDefault();let t=pe(e.dataTransfer);t.length&&_(t)},[_]),removeAttachment:(0,R.useCallback)(e=>{let t=f.current.get(e);if(t){t.cancelled=!0,f.current.delete(e),d([...f.current].map(([e,t])=>({id:e,name:t.name})));return}g(h.current.filter(t=>t.id!==e))},[g]),clearAttachments:(0,R.useCallback)(()=>{for(let e of f.current.values())e.cancelled=!0;f.current.clear(),d([]),g([])},[g]),addAttachments:(0,R.useCallback)(e=>{if(m.current!==n)return;l(``);let t=[...h.current];for(let n of e)t.some(e=>e.id===n.id)||t.push(n);g(t.slice(0,8))},[n,g]),replaceAttachments:g,setError:(0,R.useCallback)(e=>{l(e instanceof Error?e.message:String(e||``))},[])}}var xe=`new-task`,B=new Map,V=new Map;function Se(e,t){let n=t.match(/^\/[^\s]*(?:\s+([\s\S]*))?$/),r=(n?n[1]||``:t).trim();return`${e}${r?` ${r}`:` `}`}function Ce(e){return{text:e?.text||``,attachments:[...e?.attachments||[]]}}function H(e){return Ce(B.get(e))}function U(e,t){if(!e)return;let n={...H(e),...t};n.attachments=[...n.attachments];let r=H(e);r.text===n.text&&r.attachments.length===n.attachments.length&&r.attachments.every((e,t)=>e===n.attachments[t])||(r.text!==n.text&&V.set(e,(V.get(e)||0)+1),B.delete(e),!(!n.text&&!n.attachments.length)&&B.set(e,n))}function we(e){V.set(e,(V.get(e)||0)+1),B.delete(e)}function Te(e,t){let n=[...e.attachments],r=new Set(n.map(e=>e.id));for(let e of t.attachments){let t=e.id;if(!t||r.has(t)){let n=1;do t=`${e.id||`attachment`}-restored-${n++}`;while(r.has(t))}r.add(t),n.push({...e,id:t})}return{text:e.text&&t.text?`${e.text}\n${t.text}`:e.text||t.text,attachments:n}}function Ee(e){let t=(0,R.useRef)(e);t.current=e;let n=(0,R.useRef)(!0);(0,R.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]);let r=(0,R.useRef)(H(e)),[i,a]=(0,R.useState)(r.current.text),o=(0,R.useCallback)(t=>U(e,{attachments:t}),[e]),s=be(r.current.attachments,o,e),c=s.replaceAttachments,l=s.clearAttachments;return(0,R.useEffect)(()=>{let t=H(e);a(t.text),c(t.attachments)},[c,e]),{value:i,updateValue:(0,R.useCallback)(t=>{a(t),U(e,{text:t})},[e]),selection:s,clearDraft:(0,R.useCallback)(()=>{let r=H(e);r.text!==i||r.attachments.length!==s.attachments.length||r.attachments.some((e,t)=>e!==s.attachments[t])||(we(e),!(!n.current||t.current!==e)&&(a(``),l()))},[l,s.attachments,e,i]),restoreDraft:(0,R.useCallback)(r=>{let i=Te(H(e),r);return U(e,i),!n.current||t.current!==e?!1:(a(i.text),c(i.attachments),!0)},[c,e]),captureSubmission:(0,R.useCallback)(()=>{let r=H(e),i=V.get(e)||0,o=!1;return{accept(){if(o)return;o=!0;let s=H(e),l={text:(V.get(e)||0)===i?``:s.text,attachments:s.attachments.filter(e=>!r.attachments.includes(e))};U(e,l),!(!n.current||t.current!==e)&&(a(l.text),c(l.attachments))}}},[c,e])}}var De=e(n(),1);function Oe({anchor:e,menu:t,viewport:n,placement:r=`top`,align:i=`start`,maxHeight:a=1/0}){let o=n.top+8,s=Math.max(o,n.top+n.height-8),c=n.left+8,l=Math.max(c,n.left+n.width-8),u={top:Math.max(0,Math.min(e.top,s)-o-8),bottom:Math.max(0,s-Math.max(e.bottom,o)-8)},d=Math.min(t.height,a),f=r===`top`?`bottom`:`top`,p=d>u[r]&&u[f]>u[r]?f:r,m=Math.min(a,u[p]),h=Math.min(d,m),g=Math.min(t.width,l-c);return{side:p,left:Math.max(c,Math.min(i===`end`?e.right-g:e.left,l-g)),top:Math.max(o,Math.min(p===`top`?e.top-8-h:e.bottom+8,s-h)),width:g,maxHeight:m}}var W=r();function ke({open:e,anchorRef:t,menuRef:n,placement:r=`top`,align:i=`start`,matchAnchorWidth:a=!1,maxHeight:o,id:s,className:c,role:l,ariaLabel:u,onClose:d,children:f}){return(0,R.useEffect)(()=>{if(!e||!d)return;let t=e=>{e.key===`Escape`&&(e.stopPropagation(),d())};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,d]),(0,R.useLayoutEffect)(()=>{if(!e)return;let s=()=>{let e=n.current,s=t.current;if(!e||!s)return;let c=s.getBoundingClientRect(),l=window.visualViewport;e.style.width=a?`${c.width}px`:``;let u=Oe({anchor:c,menu:{width:e.getBoundingClientRect().width,height:e.scrollHeight},viewport:{left:l?.offsetLeft??0,top:l?.offsetTop??0,width:l?.width??window.innerWidth,height:l?.height??window.innerHeight},placement:r,align:i,maxHeight:o});e.dataset.side=u.side,e.style.maxHeight=`${u.maxHeight}px`,e.style.overflowY=`auto`,e.style.width=`${u.width}px`,e.style.top=`${u.top}px`,e.style.bottom=`auto`,e.style.right=`auto`,e.style.left=`${u.left}px`};s();let c=null,l=()=>{c===null&&(c=window.requestAnimationFrame(()=>{c=null,s()}))},u=typeof ResizeObserver>`u`?null:new ResizeObserver(l);return n.current&&u?.observe(n.current),t.current&&u?.observe(t.current),window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),window.visualViewport?.addEventListener(`resize`,l),window.visualViewport?.addEventListener(`scroll`,l),()=>{u?.disconnect(),c!==null&&window.cancelAnimationFrame(c),window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0),window.visualViewport?.removeEventListener(`resize`,l),window.visualViewport?.removeEventListener(`scroll`,l)}},[e,t,n,r,i,a,o]),e?(0,De.createPortal)((0,W.jsx)(`div`,{ref:n,id:s,className:c,style:{position:`fixed`,zIndex:65},role:l,"aria-label":u,children:f}),document.body):null}function Ae({resourceKey:e,loadCommands:t,builtinCommands:n=[],value:r,onChange:i,inputRef:a,placement:s=`top`}){let{t:c,language:l}=o(),f=(0,R.useId)(),p=(0,R.useRef)(null),m=r.match(/^\/([^\n]{0,120})$/),[h,g]=(0,R.useState)(``),[_,v]=(0,R.useState)(null),[y,b]=(0,R.useState)(!1),[x,S]=(0,R.useState)(!1),[C,w]=(0,R.useState)(0),T=m?.[1]||``,E=/\s/.test(T),D=(0,R.useRef)(t);D.current=t;let O=(0,R.useMemo)(()=>oe(n,T,l),[n,l,T]),k=!!(m&&h!==r&&(!E||O.length));(0,R.useEffect)(()=>{g(``),v(null),S(!1)},[e]),(0,R.useEffect)(()=>{if(!k||_)return;let e=!0;return b(!0),S(!1),D.current().then(t=>{e&&v(t.commands||[])}).catch(()=>{e&&(v([]),S(!0))}).finally(()=>e&&b(!1)),()=>{e=!1}},[_,k,e]);let A=(0,R.useMemo)(()=>{let e=O.map(e=>({kind:`builtin`,command:e}));if(E)return e;let t=T.toLocaleLowerCase(l),n=(_||[]).filter(e=>!t||`${e.invocation} ${e.name} ${e.description}`.toLocaleLowerCase(l).includes(t));return[...e,...n.map(e=>({kind:`resource`,command:e}))]},[E,O,_,l,T]);(0,R.useEffect)(()=>{w(0)},[T,_]);let j=()=>{g(r)},M=e=>{if(e.kind===`builtin`){let t=e.command.run?``:`${e.command.invocation} `;i(t),g(``),w(0),e.command.run&&e.command.run(),requestAnimationFrame(()=>{let e=a.current;e&&(e.focus(),e.setSelectionRange(t.length,t.length))});return}let t=Se(e.command.invocation,r);i(t),g(t),requestAnimationFrame(()=>{let e=a.current;e&&(e.focus(),e.setSelectionRange(t.length,t.length),e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,220)}px`)})};(0,R.useEffect)(()=>{if(!k)return;let e=e=>{if(document.activeElement===a.current){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),j();return}A.length&&(e.key===`ArrowDown`?(e.preventDefault(),e.stopPropagation(),w(e=>(e+1)%A.length)):e.key===`ArrowUp`?(e.preventDefault(),e.stopPropagation(),w(e=>(e-1+A.length)%A.length)):(e.key===`Tab`||e.key===`Enter`&&!e.shiftKey)&&(e.preventDefault(),e.stopPropagation(),M(A[Math.min(C,A.length-1)])))}};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)}),(0,R.useEffect)(()=>{let e=a.current;if(!k||!e)return;let t={role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":`true`,"aria-controls":f,"aria-activedescendant":A.length?`${f}-${Math.min(C,A.length-1)}`:``},n=Object.keys(t).map(t=>[t,e.getAttribute(t)]);for(let[n,r]of Object.entries(t))r?e.setAttribute(n,r):e.removeAttribute(n);return()=>{for(let[t,r]of n)t&&(r===null?e.removeAttribute(t):e.setAttribute(t,r))}},[C,a,f,k,A.length]);let N={user:c(`chat:commands.scope.user`),project:c(`chat:commands.scope.project`),package:c(`chat:commands.scope.package`),custom:c(`chat:commands.scope.custom`)};return(0,W.jsx)(ke,{open:k,anchorRef:a,menuRef:p,placement:s,matchAnchorWidth:!0,maxHeight:330,id:f,role:`listbox`,ariaLabel:c(`chat:commands.open`),className:`permission-mode-menu composer-command-menu overflow-y-auto rounded-md bg-solid p-1 text-content shadow-float`,children:(0,W.jsxs)(`div`,{className:`chat-resource-list composer-command-list flex min-h-0 [flex:1_1_0] flex-col gap-px overflow-y-auto [overscroll-behavior:contain] [scrollbar-gutter:stable] [touch-action:pan-y] [&_>_button]:grid [&_>_button]:w-full [&_>_button]:cursor-pointer [&_>_button]:grid-cols-[28px_minmax(0,1fr)_auto] [&_>_button]:items-center [&_>_button]:gap-2 [&_>_button]:rounded-sm [&_>_button]:px-1.5 [&_>_button]:py-1 [&_>_button]:text-left [&_>_button]:text-content [&_>_button.active]:bg-surface-hover max-[650px]:[&_>_button]:min-h-11 [&_button_>_span:nth-child(2)]:flex [&_button_>_span:nth-child(2)]:min-w-0 [&_button_>_span:nth-child(2)]:flex-col [&_strong]:truncate [&_strong]:font-mono [&_strong]:text-[13px] [&_strong]:font-medium [&_small]:truncate [&_small]:font-sans [&_small]:text-xs [&_small]:font-normal [&_small]:text-content-muted [&_em]:text-xs [&_em]:whitespace-nowrap [&_em]:text-content-muted [&_em]:not-italic [&_>_p]:m-auto [&_>_p]:px-2 [&_>_p]:py-1.5 [&_>_p]:text-xs [&_>_p]:text-content-muted`,children:[A.map((e,t)=>{let{command:n}=e,r=e.kind===`builtin`?e.command.current?d:re:e.command.source===`prompt`?ne:u,i=e.kind===`resource`?e.command:null;return(0,W.jsxs)(`button`,{type:`button`,role:`option`,id:`${f}-${t}`,"aria-selected":t===C,className:t===C?`active`:``,onMouseEnter:()=>w(t),onMouseDown:e=>e.preventDefault(),onClick:()=>M(e),children:[(0,W.jsx)(`span`,{className:`list-icon grid size-7 place-items-center rounded-sm bg-surface-muted text-content-secondary`,children:(0,W.jsx)(r,{size:15})}),(0,W.jsxs)(`span`,{className:`composer-command-copy`,children:[(0,W.jsxs)(`strong`,{children:[n.invocation,i?.argumentHint&&(0,W.jsxs)(`small`,{children:[` `,i.argumentHint]})]}),(0,W.jsx)(`small`,{children:n.description||c(`chat:commands.noDescription`)})]}),(0,W.jsx)(`em`,{children:i?(0,W.jsxs)(W.Fragment,{children:[i.source===`prompt`?c(`chat:commands.prompt`):c(`chat:commands.skill`),` · `,N[i.scope]]}):e.kind===`builtin`&&e.command.current?c(`chat:commands.builtin.current`):c(`chat:commands.builtin.label`)})]},`${e.kind}:${n.invocation}`)}),!A.length&&(0,W.jsx)(`p`,{children:c(y?`chat:commands.loading`:x?`chat:commands.loadError`:`chat:commands.empty`)})]})})}function je({levels:e,value:t,labelFor:n,onCommit:r,disabled:i=!1,ariaLabel:a,title:o,trailing:s,className:c}){let[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=Math.max(0,e.indexOf(t)),h=l??m,g=n(e[h]||t),_=i||d||e.length<2,v=e.join(`|`);(0,R.useEffect)(()=>{u(null)},[t,v]);let y=async n=>{let i=e[n];if(_||p.current||!i||i===t){u(null);return}p.current=!0,f(!0);try{await r(i)}finally{p.current=!1,f(!1),u(null)}};return(0,W.jsxs)(`div`,{className:O(`min-w-0`,c),children:[(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 px-0.5 pb-1`,children:[o&&(0,W.jsx)(`span`,{className:`text-xs font-medium text-content-muted`,children:o}),(0,W.jsxs)(`span`,{className:`ml-auto flex min-w-0 items-baseline gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-[13px] leading-5 font-medium text-accent-fg`,"aria-live":`polite`,children:g}),s]})]}),(0,W.jsx)(D,{className:O(`h-7`,`[&_[data-slot=slider-range]]:bg-[linear-gradient(90deg,var(--star-border),var(--star))]`,`[&_[data-slot=slider-thumb]]:size-4 [&_[data-slot=slider-thumb]]:bg-[radial-gradient(circle,var(--star)_0_2px,var(--key-bg)_2.5px)]`),showSteps:!0,min:0,max:Math.max(1,e.length-1),step:1,value:[h],disabled:_,"aria-label":a,valueText:g,onValueChange:([e])=>u(e),onValueCommit:([e])=>void y(e)}),e.length>1&&(0,W.jsxs)(`div`,{className:`flex justify-between px-0.5 pt-0.5 text-xs text-content-faint`,"aria-hidden":`true`,children:[(0,W.jsx)(`span`,{children:n(e[0])}),(0,W.jsx)(`span`,{children:n(e.at(-1)||``)})]})]})}var Me=96,Ne=.6,Pe=`10%`;function Fe({onDismiss:e,className:t}){let n=(0,R.useRef)(null),r=e=>{e.sheet.style.transform=``,e.sheet.style.transition=``},i=e=>{if(e.button!==0)return;let t=e.currentTarget.closest(`[data-slot="sheet-content"]`);t&&(e.currentTarget.setPointerCapture?.(e.pointerId),t.style.transition=`none`,n.current={pointerId:e.pointerId,startY:e.clientY,startAt:performance.now(),sheet:t,offset:0})},a=e=>{let t=n.current;!t||t.pointerId!==e.pointerId||(t.offset=Math.max(0,e.clientY-t.startY),t.sheet.style.transform=`translateY(${t.offset}px)`)},o=t=>{let{sheet:n}=t;n.style.setProperty(`--tw-exit-translate-y`,`calc(${t.offset}px + ${Pe})`);let i=()=>{n.removeEventListener(`animationstart`,a),r(t),n.style.removeProperty(`--tw-exit-translate-y`)},a=e=>{e.target===n&&n.dataset.state!==`closed`&&i()};n.addEventListener(`animationstart`,a),e(),requestAnimationFrame(()=>{n.isConnected&&n.dataset.state!==`closed`&&i()})},s=e=>{let t=n.current;if(!t||t.pointerId!==e.pointerId)return;n.current=null;let i=t.offset/Math.max(1,performance.now()-t.startAt);if(t.offset>=Me||t.offset>24&&i>=Ne){o(t);return}r(t)},c=()=>{let e=n.current;n.current=null,e&&r(e)};return(0,W.jsx)(`div`,{"aria-hidden":`true`,"data-sheet-drag-handle":!0,className:O(`flex h-8 w-full flex-none cursor-grab touch-none items-start justify-center select-none active:cursor-grabbing`,t),onPointerDown:i,onPointerMove:a,onPointerUp:s,onPointerCancel:c,onLostPointerCapture:c,children:(0,W.jsx)(`span`,{className:`mt-2.5 h-1 w-9 rounded-full bg-stroke-strong`})})}function Ie({sheet:e,title:t,trigger:n,children:r,open:i,onOpenChange:a,align:o,side:s,sideOffset:c,className:l,sheetClassName:u}){let[d,f]=(0,R.useState)(!1),p=i??d,m=e=>{i===void 0&&f(e),a?.(e)};return e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(_,{"aria-haspopup":`dialog`,"aria-expanded":p,onClick:()=>m(!0),children:n}),(0,W.jsx)(M,{open:p,onOpenChange:m,children:(0,W.jsxs)(k,{side:`bottom`,showCloseButton:!1,"data-popover-sheet":!0,className:O(`max-h-[85dvh] gap-1 overflow-y-auto rounded-t-(--r-sheet) px-3 pt-1 pb-[calc(12px+var(--pisper-safe-area-bottom))]`,u),children:[(0,W.jsx)(Fe,{onDismiss:()=>m(!1)}),(0,W.jsx)(A,{className:`px-2 pt-1 pb-1 text-base font-semibold`,children:t}),(0,W.jsx)(j,{className:`sr-only`,children:t}),r]})})]}):(0,W.jsxs)(E,{open:p,onOpenChange:m,children:[(0,W.jsx)(w,{asChild:!0,children:n}),(0,W.jsx)(T,{align:o,side:s,sideOffset:c,className:l,children:r})]})}var Le=1,Re=.9,ze=.8,Be=.17,Ve=.1,He=.999,Ue=.9999,We=.99,Ge=/[\\\/_+.#"@\[\(\{&]/,Ke=/[\\\/_+.#"@\[\(\{&]/g,qe=/[\s-]/,Je=/[\s-]/g;function Ye(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Le:We;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Ye(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Le:Ge.test(e.charAt(l-1))?(d*=ze,p=e.slice(i,l-1).match(Ke),p&&i>0&&(d*=He**+p.length)):qe.test(e.charAt(l-1))?(d*=Re,m=e.slice(i,l-1).match(Je),m&&i>0&&(d*=He**+m.length)):(d*=Be,i>0&&(d*=He**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Ue)),(d<Ve&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Ye(e,t,n,r,l+1,a+2,o),f*Ve>d&&(d=f*Ve)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Xe(e){return e.toLowerCase().replace(Je,` `)}function Ze(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Ye(e,t,Xe(e),Xe(t),0,0,{})}var G=`[cmdk-group=""]`,Qe=`[cmdk-group-items=""]`,$e=`[cmdk-group-heading=""]`,et=`[cmdk-item=""]`,tt=`${et}:not([aria-disabled="true"])`,nt=`cmdk-item-select`,K=`data-value`,rt=(e,t,n)=>Ze(e,t,n),it=R.createContext(void 0),q=()=>R.useContext(it),at=R.createContext(void 0),ot=()=>R.useContext(at),st=R.createContext(void 0),ct=R.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),s=yt(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,b=y(),x=y(),S=y(),C=R.useRef(null),w=xt();Y(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,T.emit()}},[u]),Y(()=>{w(6,j)},[]);let T=R.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=R.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function D(e,t){let r=s.current?.filter??rt;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=C.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Qe);t?t.appendChild(e.parentElement===t?e:e.closest(`${Qe} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Qe} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${G}[${K}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(K);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(G)?.querySelector($e))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${et}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(tt)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(K))}function F(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(K))}function I(e){let t=M()?.closest(G),n;for(;t&&!n;)t=e>0?_t(t,G):vt(t,G),n=t?.querySelector(tt);n?T.setState(`value`,n.getAttribute(K)):F(e)}let ee=()=>P(N().length-1),te=e=>{e.preventDefault(),e.metaKey?ee():e.altKey?I(1):F(1)},L=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return R.createElement(v.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&te(e);break;case`ArrowDown`:te(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),ee();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(nt);t.dispatchEvent(e)}}}}},R.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:Ct},c),Q(e,e=>R.createElement(at.Provider,{value:T},R.createElement(it.Provider,{value:E},e))))}),lt=R.forwardRef((e,t)=>{let n=y(),r=R.useRef(null),i=R.useContext(st),a=q(),o=yt(e),s=o.current?.forceMount??i?.forceMount;Y(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=bt(n,r,[e.value,e.children,r],e.keywords),l=ot(),u=Z(e=>e.value&&e.value===c.current),d=Z(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);R.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(nt,f),()=>t.removeEventListener(nt,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:_,forceMount:b,keywords:x,...S}=e;return R.createElement(v.div,{ref:g(r,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),ut=R.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=y(),s=R.useRef(null),c=R.useRef(null),l=y(),u=q(),d=Z(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Y(()=>u.group(o),[]),bt(o,s,[e.value,e.heading,c]);let f=R.useMemo(()=>({id:o,forceMount:i}),[i]);return R.createElement(v.div,{ref:g(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&R.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Q(e,e=>R.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},R.createElement(st.Provider,{value:f},e))))}),dt=R.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=R.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:R.createElement(v.div,{ref:g(i,t),...r,"cmdk-separator":``,role:`separator`})}),ft=R.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=ot(),o=Z(e=>e.search),s=Z(e=>e.selectedItemId),c=q();return R.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),R.createElement(v.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),pt=R.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=R.useRef(null),o=R.useRef(null),s=Z(e=>e.selectedItemId),c=q();return R.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),R.createElement(v.div,{ref:g(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Q(e,e=>R.createElement(`div`,{ref:g(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),mt=R.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return R.createElement(C,{open:n,onOpenChange:r},R.createElement(x,{container:o},R.createElement(b,{"cmdk-overlay":``,className:i}),R.createElement(S,{"aria-label":e.label,"cmdk-dialog":``,className:a},R.createElement(ct,{ref:t,...s}))))}),ht=R.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?R.createElement(v.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),gt=R.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return R.createElement(v.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>R.createElement(`div`,{"aria-hidden":!0},e)))}),J=Object.assign(ct,{List:pt,Item:lt,Input:ft,Group:ut,Separator:dt,Dialog:mt,Empty:ht,Loading:gt});function _t(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function vt(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function yt(e){let t=R.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?R.useEffect:R.useLayoutEffect;function X(e){let t=R.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=ot(),n=()=>e(t.snapshot());return R.useSyncExternalStore(t.subscribe,n,n)}function bt(e,t,n,r=[]){let i=R.useRef(),a=q();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(K,s),i.current=s}),i}var xt=()=>{let[e,t]=R.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function St(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&R.isValidElement(t)?R.cloneElement(St(t),{ref:t.ref},n(t.props.children)):n(t)}var Ct={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function wt({className:e,...t}){return(0,W.jsx)(J,{"data-slot":`command`,className:O(`flex size-full flex-col overflow-hidden rounded-md! bg-popover p-1 text-popover-foreground`,e),...t})}function Tt({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,W.jsxs)(te,{className:`h-8! rounded-sm! border-stroke bg-surface-subtle shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,W.jsx)(J.Input,{"data-slot":`command-input`,className:O(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,W.jsx)(ee,{children:(0,W.jsx)(h,{className:`size-4 shrink-0 opacity-50`})})]})})}function Et({className:e,...t}){return(0,W.jsx)(J.List,{"data-slot":`command-list`,className:O(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function Dt({className:e,...t}){return(0,W.jsx)(J.Empty,{"data-slot":`command-empty`,className:O(`py-6 text-center text-sm`,e),...t})}function Ot({className:e,...t}){return(0,W.jsx)(J.Group,{"data-slot":`command-group`,className:O(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function kt({className:e,children:t,...n}){return(0,W.jsxs)(J.Item,{"data-slot":`command-item`,className:O(`group/command-item relative flex min-h-7.5 max-[650px]:min-h-11 pointer-coarse:min-h-11 cursor-default items-center gap-2 rounded-sm px-2 py-1 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-accent data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,W.jsx)(d,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}var At={system:`var(--viz-1)`,project:`var(--viz-2)`,skills:`var(--viz-3)`,tools:`var(--viz-4)`,mcp:`var(--viz-5)`,messages:`var(--viz-6)`,toolResults:`var(--viz-7)`},jt=`grid grid-cols-[8px_minmax(0,1fr)_auto_2.25rem] items-center gap-x-2 rounded-[4px] px-1 py-0.5 text-xs`;function Mt({percent:e,compactAtPercent:t}){let{t:n}=o();return(0,W.jsxs)(`div`,{"aria-hidden":`true`,className:`relative h-1 rounded-full bg-surface-active`,children:[e>0&&(0,W.jsx)(`span`,{className:`absolute inset-y-0 left-0 min-w-1 rounded-full bg-content-secondary`,style:{width:`${Math.min(100,e)}%`}}),t!==null&&(0,W.jsx)(`span`,{"data-context-compact-line":!0,title:n(`board:composer.context.compactAt`,{percent:t}),className:`absolute -top-[3px] -bottom-[3px] w-[2px] -translate-x-1/2 rounded-full bg-content`,style:{left:`${t}%`}})]})}function Nt({breakdown:e}){let{t}=o(),[n,r]=(0,R.useState)(null),{contextWindow:i,usedTokens:a,freeTokens:s,compactAtPercent:c}=e,l=e.categories.filter(e=>e.tokens>0),u=e.categories.filter(e=>e.tokens>0||e.id===`mcp`&&e.deferred>0),d={system:t(`board:composer.context.system`),project:t(`board:composer.context.project`),skills:t(`board:composer.context.skills`),tools:t(`board:composer.context.tools`),mcp:t(`board:composer.context.mcp`),messages:t(`board:composer.context.messages`),toolResults:t(`board:composer.context.toolResults`)},f=e=>N(e,a),p=e=>({onMouseEnter:()=>r(e),onMouseLeave:()=>r(null)}),m=[t(`board:composer.context.free`,{tokens:F(s)}),c===null?``:t(`board:composer.context.compactAt`,{percent:c})].filter(Boolean).join(` · `);return(0,W.jsxs)(`div`,{className:`grid gap-2`,"data-context-breakdown":!0,children:[(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,W.jsx)(Mt,{percent:i?a/i*100:0,compactAtPercent:c}),(0,W.jsx)(`span`,{className:`text-[11px] leading-4 text-content-muted`,"data-context-capacity":!0,children:m})]}),l.length>0&&(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,W.jsx)(`span`,{className:`text-[11px] leading-4 text-content-muted`,children:t(`board:composer.context.composition`)}),(0,W.jsx)(`div`,{role:`img`,"aria-label":l.map(e=>`${d[e.id]} ${f(e.tokens)}`).join(`, `),className:`flex h-2.5 w-full gap-[2px]`,children:l.map(e=>(0,W.jsx)(`span`,{"data-context-segment":e.id,title:`${d[e.id]} · ${F(e.tokens)} · ${f(e.tokens)}`,className:O(`min-w-[3px] rounded-[2px] transition-opacity duration-(--d-fast)`,n&&n!==e.id&&`opacity-30`),style:{flexGrow:e.tokens,flexBasis:0,backgroundColor:At[e.id]},...p(e.id)},e.id))})]}),(0,W.jsx)(`ul`,{className:`m-0 grid list-none gap-0 p-0`,children:u.map(e=>(0,W.jsxs)(`li`,{className:`contents`,children:[(0,W.jsxs)(`div`,{"data-context-row":e.id,className:O(jt,n===e.id&&`bg-surface-hover`),...p(e.id),children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-[2px]`,style:{backgroundColor:At[e.id]}}),(0,W.jsxs)(`span`,{className:`min-w-0 truncate text-content-secondary`,children:[d[e.id],e.id===`tools`&&e.count?(0,W.jsxs)(`span`,{className:`text-content-muted`,children:[` · `,e.count]}):null]}),(0,W.jsx)(`span`,{className:`font-medium text-content tabular-nums`,children:F(e.tokens)}),(0,W.jsx)(`span`,{className:`text-right text-content-muted tabular-nums`,children:f(e.tokens)})]}),e.servers.map(e=>{let n=[e.name,e.tools>0?t(`board:composer.context.toolCount`,{count:e.tools}):``,e.calls>0?t(`board:composer.context.callCount`,{count:e.calls}):``].filter(Boolean).join(` · `);return(0,W.jsxs)(`div`,{"data-context-server":e.name,className:O(jt,`py-0 text-content-muted`),children:[(0,W.jsx)(`span`,{"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate`,title:n,children:n}),(0,W.jsx)(`span`,{className:`tabular-nums`,children:F(e.tokens)}),(0,W.jsx)(`span`,{})]},e.name)}),e.deferred>0&&(0,W.jsxs)(`div`,{"data-context-deferred":!0,className:O(jt,`py-0 text-content-muted`),children:[(0,W.jsx)(`span`,{"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`col-span-3 min-w-0`,children:t(`board:composer.context.deferred`,{count:e.deferred})})]})]},e.id))}),(0,W.jsx)(`p`,{className:`m-0 text-[11px] leading-4 text-content-muted`,"data-context-hint":!0,children:e.prefixKnown?e.totalKnown?t(`board:composer.context.estimated`):t(`board:composer.context.allEstimated`):t(`board:composer.context.prefixUnknown`)})]})}function Pt(e,t){let n=t.find(t=>t.key===e);return n?`${n.providerName} · ${n.label}`:e.split(`/`).at(-1)||e}function Ft({label:e,value:t,wide:n=!1,usageKey:r,title:i}){return(0,W.jsxs)(`div`,{className:O(`grid min-w-0 gap-0.5 rounded-[var(--r-md)] bg-surface-subtle px-2 py-1.5 dark:bg-surface-active`,n&&`col-span-2`),"data-usage-row":r,title:i,children:[(0,W.jsx)(`span`,{className:`truncate text-[11px] leading-4 text-content-muted`,children:e}),(0,W.jsx)(`strong`,{className:`truncate text-[13px] leading-4 font-medium text-content`,children:t})]})}function It({model:e,availableModels:t,sessionUsage:n}){let{t:r,language:i}=o(),a=n?.timing&&typeof n.timing==`object`?n.timing:null,s=Math.max(0,Number(a?.firstTokenSamples)||0),c=Math.max(0,Number(a?.requests)||0),l=s>0?Number(a?.firstTokenTotalMs)/s:null,u=c>0?Number(a?.durationTotalMs)/c:null,d=!!n?.cacheReported,f=[[r(`chat:focusSession.statCurrentModel`),e?Pt(e,t||[]):`—`],[r(`chat:focusSession.statInputTokens`),F(n?.input)],[r(`chat:focusSession.statOutputTokens`),F(n?.output)],[r(`chat:focusSession.statCacheReadTokens`),d?F(n?.cacheRead):`—`],[r(`chat:focusSession.statCacheWriteTokens`),d?F(n?.cacheWrite):`—`],[r(`chat:focusSession.statReasoningTokens`),F(n?.reasoning)],[r(`chat:focusSession.statRequests`),String(Math.max(0,Number(n?.requests)||0))],[r(`chat:focusSession.statAvgFirstToken`),l==null?`—`:I(l,i)],[r(`chat:focusSession.statAvgDuration`),u==null?`—`:I(u,i)]];return(0,W.jsxs)(`div`,{className:`session-stats-panel grid grid-cols-2 gap-1`,"aria-label":r(`chat:focusSession.sessionStats`),children:[f.map(([e,t],n)=>(0,W.jsx)(Ft,{label:e,value:t,wide:n===0},e)),(0,W.jsx)(`small`,{className:`col-span-2 text-[11px] leading-4 text-content-muted`,children:r(`chat:focusSession.sessionStatsHint`)})]})}function Lt({sessionId:e,usage:t,sessionUsage:n,model:r,availableModels:i,onThresholdChange:a}){let{t:l}=o(),u=Number(t?.contextWindow)||0,d=t?.compactAtPercent==null?80:Number(t.compactAtPercent),p=Number.isFinite(d)?Math.round(d):80,[m,h]=(0,R.useState)(p),[g,_]=(0,R.useState)(!1),[v,y]=(0,R.useState)(``),b=(0,R.useRef)(p),x=(0,R.useRef)(void 0);(0,R.useEffect)(()=>{window.clearTimeout(x.current),h(p),b.current=p},[p]),(0,R.useEffect)(()=>()=>window.clearTimeout(x.current),[]);let S=c({queryKey:[`context-breakdown`,e,t?.tokens??null,u],queryFn:({signal:t})=>P.getContextBreakdown(String(e),t),enabled:!!e&&u>0,retry:!1,staleTime:5e3,placeholderData:s}).data,C=t?.percent!=null&&Number.isFinite(Number(t.percent))?Math.max(0,Number(t?.percent)):null,w=Math.max(0,Number(n?.processedTokens)||0),T=Number(n?.cacheHitRate),E=n?.cacheHitRate!=null&&Number.isFinite(T),O=t?.tokens==null?S?`≈${F(S.usedTokens)}`:`—`:F(t.tokens),k=u?`${O} / ${F(u)}${C==null?``:` · ${Math.round(C)}%`}`:``,A=t?.autoCompactEnabled&&t.compactionCapacityPercent!=null?l(`chat:focusSession.contextUsageToCompactionTokensPercent`,{percent:Math.round(Number(t.compactionCapacityPercent)),tokens:F(t.remainingBeforeCompaction)}):``,j=async e=>{let t=Math.min(95,Math.max(10,Math.round(e)));if(h(t),!(!a||t===b.current)){_(!0),y(``);try{await a(t),b.current=t}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(!1)}}},M=e=>{window.clearTimeout(x.current),h(e),x.current=window.setTimeout(()=>void j(e),250)},N=e=>{window.clearTimeout(x.current),j(e)};return(0,W.jsxs)(`div`,{className:`context-usage-section grid gap-1.5 border-t border-stroke-soft px-2 pt-2 pb-1.5`,"data-context-usage":!0,children:[k&&(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[((e,t,n,r)=>(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-xs`,"data-usage-row":n,title:r,children:[(0,W.jsx)(`span`,{className:`shrink-0 text-content-muted`,children:e}),(0,W.jsx)(`strong`,{className:`min-w-0 truncate text-right font-medium text-content tabular-nums`,children:t})]}))(l(`board:composer.contextUsage`),k,`context`),S?(0,W.jsx)(Nt,{breakdown:S}):(0,W.jsx)(Mt,{percent:C??0,compactAtPercent:t?.autoCompactEnabled?d:null})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-1`,children:[(0,W.jsx)(Ft,{label:l(`board:composer.sessionTokens`),value:w>0?l(`board:composer.tokens`,{tokens:F(w)}):`—`,usageKey:`tokens`}),(0,W.jsx)(Ft,{label:l(`board:composer.cacheHitLabel`),value:E?`${Math.round(Math.max(0,T))}%`:`—`,usageKey:`cache`,title:E?void 0:l(`chat:focusSession.cacheHitRateUnavailable`)})]}),u>0&&(0,W.jsxs)(`details`,{className:`group/usage min-w-0 text-xs`,onToggle:e=>{let t=e.currentTarget;t.open&&requestAnimationFrame(()=>t.scrollIntoView({block:`nearest`}))},children:[(0,W.jsxs)(`summary`,{className:`flex min-h-7 cursor-pointer list-none items-center gap-1 rounded-sm text-content-secondary hover:text-content focus-visible:outline-2 focus-visible:outline-focus max-[650px]:min-h-11 [&::-webkit-details-marker]:hidden`,children:[(0,W.jsx)(f,{size:13,"aria-hidden":`true`,className:`transition-transform duration-(--d-fast) group-open/usage:rotate-90`}),l(`chat:focusSession.sessionStats`)]}),(0,W.jsxs)(`div`,{className:`grid gap-2 pt-1.5`,children:[(0,W.jsx)(It,{model:r,availableModels:i,sessionUsage:n}),A&&(0,W.jsx)(`small`,{className:`text-content-muted`,children:A}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between font-medium text-content`,children:[(0,W.jsx)(`span`,{children:l(`chat:focusSession.autoCompactionThreshold`)}),(0,W.jsxs)(`output`,{className:`tabular-nums`,children:[m,`%`]})]}),(0,W.jsx)(D,{min:10,max:95,step:1,value:[m],className:`h-5 w-full`,"aria-label":l(`chat:focusSession.autoCompactionThreshold`),valueText:`${m}%`,disabled:g,onValueChange:([e])=>M(e),onValueCommit:([e])=>N(e)}),(0,W.jsx)(`small`,{className:v?`text-danger`:`text-content-muted`,children:v||(g?l(`chat:focusSession.savingCompactionThreshold`):`\xA0`)})]})]})]})}function $(e,t){return{off:e(`chat:focusSession.thinkingLabel.off`),minimal:e(`chat:focusSession.thinkingLabel.minimal`),low:e(`chat:focusSession.thinkingLabel.low`),medium:e(`chat:focusSession.thinkingLabel.medium`),high:e(`chat:focusSession.thinkingLabel.high`),xhigh:e(`chat:focusSession.thinkingLabel.xhigh`),max:e(`chat:focusSession.thinkingLabel.max`)}[t]||t}function Rt({model:e,models:t,onModelChange:n,thinkingLevel:r,levels:i,status:a,message:s,onThinkingChange:c,modelDisabled:l,thinkingDisabled:u,deferred:d=!1,pendingModel:f=!1,usage:h,sheet:g=!1,side:_=`top`,thinkingIsDefault:v=!1,onThinkingReset:y,triggerClassName:b}){let{t:x}=o(),[S,C]=(0,R.useState)(!1),w=t.find(t=>t.key===e),T=t.map(e=>e.label),E=w?.label||e.split(`/`).at(-1)||``,D=E?L(E,T):x(`chat:focusSession.toolbarModel`),k=[...t.reduce((e,t)=>{let n=e.get(t.providerName)||[];return n.push(t),e.set(t.providerName,n)},new Map)],A=a!==`unsupported`&&i.length>0,j=A?$(x,r||i[0]):`—`,M=f?x(`chat:focusSession.thinkingAfterModelSwitch`):A?j:s||x(a===`unsupported`?`chat:focusSession.thinkingLevelUnsupported`:`chat:focusSession.loadingThinkingLevels`),N=u||S||!A||i.length<2,P=`${x(`chat:focusSession.modelAndThinking`)} · ${Pt(e,t)} · ${M}`;return(0,W.jsxs)(Ie,{sheet:g,title:x(`chat:focusSession.modelAndThinking`),align:`end`,side:_,sideOffset:8,className:`model-effort-popover w-[272px] max-w-[calc(100vw_-_24px)] gap-0 p-1`,trigger:(0,W.jsxs)(`button`,{type:`button`,className:O(`model-effort-pill inline-flex h-[30px] min-w-0 max-w-[260px] cursor-pointer items-center gap-1.5 rounded-sm border border-transparent pr-1.5 pl-2.5 text-[13px] text-content transition-colors hover:bg-surface-hover disabled:cursor-default disabled:opacity-60 aria-expanded:bg-surface-hover max-[650px]:h-9 max-[650px]:gap-1 max-[650px]:rounded-full max-[650px]:bg-surface-muted max-[650px]:dark:bg-surface-active max-[650px]:px-3 max-[650px]:text-sm min-[651px]:pointer-coarse:h-11`,m,b),"aria-label":P,title:P,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium max-[650px]:hidden`,children:D}),(0,W.jsx)(`span`,{className:`hidden font-medium whitespace-nowrap max-[650px]:inline`,children:x(`chat:focusSession.modelChipShort`)}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`text-content-faint max-[650px]:hidden`,children:`·`}),(0,W.jsx)(`span`,{className:`shrink-0 text-content-muted max-[650px]:hidden`,children:A?$(x,r||i[0]):`—`}),(0,W.jsx)(p,{size:14,className:`shrink-0 text-content-muted max-[650px]:hidden`,"aria-hidden":`true`})]}),children:[(0,W.jsxs)(`div`,{className:`model-effort-model flex flex-col gap-1 p-1.5 pb-2`,children:[(0,W.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-content-muted`,children:x(`chat:focusSession.toolbarModel`)}),(0,W.jsxs)(wt,{defaultValue:e,filter:(e,t,n)=>+!![e,...n||[]].join(` `).toLowerCase().includes(t.trim().toLowerCase()),className:`rounded-sm! border border-stroke-soft bg-transparent p-0`,"aria-label":x(`chat:focusSession.currentChatModel`),children:[t.length>6&&(0,W.jsx)(Tt,{placeholder:x(`chat:focusSession.searchModels`)}),(0,W.jsxs)(Et,{className:`max-h-56`,children:[(0,W.jsx)(Dt,{className:`py-4 text-xs text-content-muted`,children:t.length?x(`chat:focusSession.noMatchingModels`):x(`chat:focusSession.noModelsAvailable`)}),!w&&e&&(0,W.jsx)(Ot,{children:(0,W.jsx)(kt,{value:e,"data-checked":!0,disabled:!0,children:(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:D})})}),k.map(([t,r])=>(0,W.jsx)(Ot,{heading:t,children:r.map(t=>{let r=L(t.label,T);return(0,W.jsx)(kt,{value:t.key,keywords:[t.label,t.providerName],"data-checked":t.key===e,disabled:l||S,onSelect:()=>{t.key!==e&&n(t.key)},children:(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-col`,title:t.label,children:[(0,W.jsx)(`span`,{className:`wrap-anywhere`,children:r}),r!==t.label&&(0,W.jsx)(`span`,{className:`truncate text-xs text-content-muted`,children:t.label})]})},t.key)})},t))]})]})]}),A&&(0,W.jsx)(je,{className:`border-t border-stroke-soft p-1.5 pt-2`,title:x(`chat:focusSession.thinkingLevelTitle`),levels:i,value:r,labelFor:e=>$(x,e),onCommit:async e=>{C(!0);try{await c(e)}finally{C(!1)}},disabled:N,ariaLabel:x(`chat:focusSession.currentThinkingLevel`),trailing:v?(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-content-faint`,children:x(`chat:focusSession.thinkingModelDefault`)}):y?(0,W.jsx)(`button`,{type:`button`,className:`shrink-0 cursor-pointer rounded-sm text-xs text-content-muted underline-offset-2 hover:text-content hover:underline focus-visible:outline-2 focus-visible:outline-focus`,onClick:y,children:x(`chat:focusSession.thinkingReset`)}):void 0}),d&&(0,W.jsx)(`p`,{className:`px-2 pt-1 pb-2 text-xs leading-4 text-content-muted`,role:`status`,children:x(`chat:focusSession.runtimeSelectionDeferred`)}),(!A||i.length===1)&&(0,W.jsx)(`p`,{className:`border-t border-stroke-soft px-2 pt-2 pb-1.5 text-xs leading-relaxed text-content-muted`,role:`status`,children:A?x(`chat:focusSession.thinkingLevelFixed`,{level:j}):M}),h]})}export{Fe as a,we as c,fe as d,me as f,ne as g,ie as h,Ie as i,Se as l,ae as m,Rt as n,Ae as o,ye as p,$ as r,xe as s,Lt as t,Ee as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MemoryEvolution-Ulreb-P1.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-QY-mTTDS.js","assets/i18n-CWhhZ2QN.js","assets/vendor-router-CSN_DGvx.js","assets/index-_WvEqLNn.js","assets/index-BTqJTVNA.css","assets/storage-DtvZ_lEu.js","assets/vendor-state-GkUciC5H.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/info-DATxy0fb.js","assets/pause-CYWpPg1R.js","assets/play-DNDjDNGn.js","assets/x-07u4-129.js","assets/popover-CaaxkJV6.js","assets/dist-41X0pdUs.js","assets/dist-BsRXXcSL.js","assets/es2015-DTZdOI9P.js","assets/dist-BRjj4UeB.js","assets/dist-OB2r6Xsr.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/dialog-27CgEIc2.js","assets/dist-BHkR6BLP.js","assets/button-CCcCN8tE.js","assets/slider-De8rWVNs.js","assets/dist-DzGQ7sLi.js","assets/dist-BS3ekNDj.js","assets/segmented-control-xkrEOP_d.js","assets/dist-BaBySQmo.js","assets/PageState-Cz6vFMXv.js","assets/motion-DTR4ZVle.js","assets/memory-api-CSEqYBZN.js","assets/api-C35aq3ml.js","assets/abort-signal-f4JsiYKX.js","assets/http-response-Bb_1H1lE.js","assets/event-stream-DTCmB4AA.js","assets/http-YNvizzuJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t,u as n}from"./vendor-router-CSN_DGvx.js";import{t as r}from"./index-_WvEqLNn.js";import{i,r as a}from"./vendor-react-DwNgTV1j.js";import{f as o}from"./routes-DIeaqWVc.js";import{t as s}from"./use-i18n-QY-mTTDS.js";import{t as c}from"./storage-DtvZ_lEu.js";import{i as l}from"./http-response-Bb_1H1lE.js";import"./http-YNvizzuJ.js";import{t as u}from"./createLucideIcon-Cd-3GVxJ.js";import{t as d}from"./archive-ojKJT7Fp.js";import{t as f}from"./book-open-BuHHD9os.js";import{t as p}from"./ellipsis-CfGKfbq6.js";import{t as m}from"./file-code-corner-BnE1ljT0.js";import{n as h,r as g,t as _}from"./undo-2-C-xQ0UVT.js";import{t as v}from"./pencil-U08v_vV9.js";import{t as y}from"./pin-off-BpRu_vrC.js";import{t as b}from"./pin-CU0FG0lI.js";import{t as x}from"./plus-fQbSqB1n.js";import{t as S}from"./refresh-cw-TbWxTY4K.js";import{t as C}from"./rotate-ccw-clock-CO6Bw-sF.js";import{t as w}from"./rotate-ccw-C0v8V77_.js";import{t as T}from"./sliders-horizontal-Dryf1XyC.js";import{t as E}from"./trash-2-CNrPOoPR.js";import{t as D}from"./triangle-alert-CE1q54ci.js";import{t as ee}from"./x-07u4-129.js";import{t as te}from"./more-pages-D_PnxLN0.js";import{c as ne,i as O,p as k,r as re,t as ie}from"./dropdown-menu-Ds0gD8S8.js";import{i as A,n as ae,r as oe,t as se}from"./tabs-DsgBuvJv.js";import{t as ce}from"./segmented-control-xkrEOP_d.js";import{t as j}from"./utils-C8uzG5AZ.js";import{n as M,t as N}from"./button-CCcCN8tE.js";import{s as le}from"./shortcuts-B5Q10H38.js";import{a as P,i as F,l as ue,o as I,s as L,t as de}from"./dialog-27CgEIc2.js";import{t as R}from"./input-CPw-zkYh.js";import{t as fe}from"./textarea-DmATpOqT.js";import{n as z,t as B}from"./PageState-Cz6vFMXv.js";import{a as pe,i as me,n as he,o as ge,r as _e,s as ve,t as ye}from"./FeaturePage-DTDpEz7O.js";import{n as V}from"./field-DoLEb0np.js";import{t as be}from"./AppSelect-DQYKUW5E.js";import{t as H}from"./badge-CWB3lj2H.js";import{i as U}from"./app-primitives-Drz_SjnR.js";import{a as xe,c as Se,f as W,g as G,h as Ce,i as we,l as K,m as Te,n as Ee,o as De,p as Oe,r as ke,s as Ae,t as je,u as Me}from"./memory-api-CSEqYBZN.js";var Ne=u(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),Pe=u(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Fe=u(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Ie=u(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),Le=u(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Re=u(`milestone`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M12 3v3`,key:`1n5kay`}],[`path`,{d:`M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z`,key:`8gz4t4`}]]),ze=u(`replace`,[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),q=e(i(),1),Be={concept:g,file:m,risk:D,preference:T,decision:Re,fact:f,task:h};function Ve(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`)}function He(e,t){return t(e===`manual`?`memory:memoryPage.sourceManual`:e===`user_confirmed`?`memory:memoryPage.sourceUserRequest`:e===`agent`?`memory:memoryPage.sourceAgent`:e===`tool_verified`?`memory:memoryPage.sourceTool`:e===`external`?`memory:memoryPage.sourceExternal`:`memory:memoryPage.sourceConversation`)}function Ue(e,t){return t(e===`assistant`?`memory:memoryPage.roleAssistant`:e===`tool`?`memory:memoryPage.roleTool`:e===`external`?`memory:memoryPage.roleExternal`:e===`manual`?`memory:memoryPage.roleManual`:`memory:memoryPage.roleUser`)}function We(e,t){return[e.pinned&&t(`memory:memoryPage.pinnedBadge`),e.status===`stale`&&t(`memory:memoryPage.staleBadge`),e.tainted&&t(`memory:memoryPage.taintedBadge`),e.status===`archived`&&t(`memory:memoryPage.archivedBadge`),e.status===`superseded`&&t(`memory:memoryPage.supersededBadge`)].filter(e=>!!e)}function J(e,t){return e?.kind===`global`?t(`memory:memoryPage.globalMemorySpace`):e?.name||``}function Y(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 Ge(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`}).format(n)}function Ke(e,t){let n={add:{icon:x,label:()=>t(`memory:memoryPage.eventAdd`)},supersede:{icon:ze,label:()=>t(`memory:memoryPage.eventSupersede`)},merge:{icon:Ie,label:()=>t(`memory:memoryPage.eventMerge`)},archive:{icon:d,label:()=>t(`memory:memoryPage.eventArchive`)},expire:{icon:Pe,label:()=>t(`memory:memoryPage.eventExpire`)},stale:{icon:D,label:()=>t(`memory:memoryPage.eventStale`)},confirm:{icon:Ne,label:()=>t(`memory:memoryPage.eventConfirm`)},restore:{icon:w,label:()=>t(`memory:memoryPage.eventRestore`)},edit:{icon:v,label:()=>t(`memory:memoryPage.eventEdit`)},pin:{icon:b,label:()=>t(`memory:memoryPage.eventPin`)},unpin:{icon:y,label:()=>t(`memory:memoryPage.eventUnpin`)},delete:{icon:E,label:()=>t(`memory:memoryPage.eventDelete`)},purge:{icon:Fe,label:()=>t(`memory:memoryPage.eventPurge`)},undo:{icon:_,label:()=>t(`memory:memoryPage.eventUndo`)},reinforce:{icon:S,label:()=>t(`memory:memoryPage.eventReinforce`)},migrate:{icon:C,label:()=>t(`memory:memoryPage.eventMigrate`)},consolidate:{icon:Ie,label:()=>t(`memory:memoryPage.eventConsolidate`)}}[e];return n?{icon:n.icon,label:n.label()}:{icon:C,label:t(`memory:memoryPage.eventGeneric`)}}function qe(e,t){return e===`user`||e===`manual`||e===`user_confirmed`?t(`memory:memoryPage.actorYou`):[`consolidator`,`reconcile`,`lifecycle`].includes(e)?t(`memory:memoryPage.actorConsolidator`):t(e===`conversation`?`memory:memoryPage.actorConversation`:e===`agent`||e===`tool_verified`?`memory:memoryPage.actorAgent`:e===`external`?`memory:memoryPage.sourceExternal`:`memory:memoryPage.actorSystem`)}function Je(e,t){if(e===`same_identity`)return t(`memory:memoryPage.reasonSameIdentity`);if(e===`lower_authority_conflict`)return t(`memory:memoryPage.reasonLowerAuthority`);if(e===`expired`||e===`retention_expired`)return t(`memory:memoryPage.reasonExpired`);if(e===`unused`||e===`low_utility`)return t(`memory:memoryPage.reasonLowUtility`);if(e===`user_deleted`)return t(`memory:memoryPage.reasonUserDeleted`);if(e===`user_requested`)return t(`memory:memoryPage.reasonUserRequested`);let n=/^digests:(\d+) merged:(\d+)$/.exec(e);if(n){let e=Number(n[1]),r=Number(n[2]);return e&&r?t(`memory:memoryPage.reasonConsolidatedBoth`,{digests:e,merged:r}):r?t(`memory:memoryPage.reasonConsolidatedMerged`,{merged:r}):t(`memory:memoryPage.reasonConsolidatedDigests`,{digests:e})}let r=/^promoted (\d+) pending candidates$/.exec(e);return r?t(`memory:memoryPage.reasonPromoted`,{count:Number(r[1])}):e}var X=a(),Ye=50;function Xe({spaceId:e,refreshKey:t,onChanged:n}){let{t:r,language:i}=s(),[a,o]=(0,q.useState)([]),[c,u]=(0,q.useState)(!0),[d,f]=(0,q.useState)(!1),[p,m]=(0,q.useState)(!1),[h,g]=(0,q.useState)(!1),[v,y]=(0,q.useState)(``),[b,x]=(0,q.useState)(``),S=(0,q.useRef)(0),C=e===`all`?``:e,w=(0,q.useCallback)(async()=>{let e=++S.current;u(!0),y(``);try{let t=await Me({spaceId:C,limit:Ye});if(e!==S.current)return;o(t.events),m(t.events.length>=Ye),g(!1)}catch(t){if(e!==S.current)return;t instanceof l&&t.status===404?g(!0):y(t instanceof Error?t.message:String(t))}finally{e===S.current&&u(!1)}},[C]);(0,q.useEffect)(()=>(w(),()=>{S.current+=1}),[w,t]);let T=async()=>{let e=a.at(-1)?.at;if(!e||d)return;let t=S.current;f(!0);try{let n=await Me({spaceId:C,before:e,limit:Ye});if(t!==S.current)return;o(e=>{let t=new Set(e.map(e=>e.id));return[...e,...n.events.filter(e=>!t.has(e.id))]}),m(n.events.length>=Ye)}catch(e){t===S.current&&y(e instanceof Error?e.message:String(e))}finally{f(!1)}},E=async e=>{if(!b){x(e.id),y(``);try{await Ce(e.id),await n(r(`memory:memoryPage.eventUndone`))}catch(e){y(e instanceof Error?e.message:String(e))}finally{x(``)}}};return h?(0,X.jsx)(B,{compact:!0,title:r(`memory:memoryPage.activityUnsupported`)}):c&&!a.length?(0,X.jsx)(z,{kind:`loading`,title:r(`common:pageTemplate.loading`)}):v&&!a.length?(0,X.jsx)(z,{kind:`error`,title:r(`memory:memoryPage.activityLoadFailed`),description:v,action:(0,X.jsx)(N,{variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>void w(),children:r(`common:pageTemplate.retry`)})}):a.length?(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[v&&(0,X.jsx)(ye,{className:`mt-0`,children:v}),(0,X.jsx)(he,{children:a.map(e=>{let{icon:t,label:n}=Ke(e.action,r),a=e.reason?Je(e.reason,r):``;return(0,X.jsx)(me,{"data-memory-event":e.action,icon:(0,X.jsx)(t,{}),name:n,description:[...new Set(e.titles||[])].join(`、`)||void 0,meta:(0,X.jsxs)(`span`,{className:`truncate tabular-nums`,children:[Y(e.at,i),` · `,qe(e.actor,r),a?` · ${a}`:``]}),status:e.undoneAt?r(`memory:memoryPage.undone`):void 0,actions:e.undoable?(0,X.jsxs)(N,{variant:`ghost`,size:`sm`,disabled:!!b,"aria-label":`${r(`memory:memoryPage.undo`)}: ${n}`,onClick:()=>void E(e),children:[(0,X.jsx)(_,{}),r(`memory:memoryPage.undo`)]}):void 0},e.id)})}),p&&(0,X.jsx)(`div`,{className:`flex justify-center`,children:(0,X.jsx)(N,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,loading:d,disabled:d,onClick:()=>void T(),children:r(`memory:memoryPage.loadMore`)})})]}):(0,X.jsx)(B,{compact:!0,title:r(`memory:memoryPage.noActivity`)})}var Z=`flex min-h-[34px] min-w-0 items-center justify-between gap-4 border-t border-stroke-soft text-sm [&>dd]:min-w-0 [&>dd]:truncate [&>dd]:text-right [&>dd]:text-content [&>dt]:shrink-0 [&>dt]:text-content-muted`;function Ze({labels:e}){return(0,X.jsx)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-1`,children:e.map(e=>(0,X.jsx)(H,{children:e},e))})}function Qe({id:e,fallback:t=null,spaces:n,refreshKey:r=0,withHeading:i=!1,onClose:a,onEdit:o,onChanged:c,onDeleted:l,requestConfirm:u}){let{t:d,language:f}=s(),[p,m]=(0,q.useState)(null),[h,g]=(0,q.useState)(!0),[_,x]=(0,q.useState)(``),[S,C]=(0,q.useState)(``),[T,D]=(0,q.useState)(!1),[te,ne]=(0,q.useState)(0);(0,q.useEffect)(()=>{let t=new AbortController;return g(!0),x(``),K(e,t.signal).then(e=>{t.signal.aborted||(m(e),g(!1))}).catch(e=>{t.signal.aborted||(x(e instanceof Error?e.message:String(e)),g(!1))}),()=>t.abort()},[e,r,te]);let O=(0,q.useCallback)(async(e,t)=>{D(!0),C(``);try{await e(),await c(t)}catch(e){C(e instanceof Error?e.message:String(e))}finally{D(!1)}},[c]),k=p?.item?.id===e?p.item:t,re=p?.item?.id===e?p.history:[],ie=async()=>{if(k&&await u({title:d(`memory:memoryPage.deleteMemory`),message:d(`memory:memoryPage.deleteMemoryName`,{name:k.title}),confirmLabel:d(`memory:memoryPage.delete`)})){D(!0),C(``);try{await xe(k.id),await l(d(`memory:memoryPage.memoryDeleted`))}catch(e){C(e instanceof Error?e.message:String(e)),D(!1)}}};if(!k)return(0,X.jsx)(`div`,{className:`flex min-h-16 items-center gap-2 text-xs text-content-muted`,children:h?(0,X.jsx)(M,{className:`size-4`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(U,{className:`my-0`,children:_||d(`memory:memoryPage.detailLoadFailed`)}),(0,X.jsx)(N,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,onClick:()=>ne(e=>e+1),children:d(`memory:memoryPage.retry`)})]})});let A=n.find(e=>e.id===k.spaceId),ae=k.status===`active`||k.status===`stale`||!k.status,oe=We(k,d);return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,"aria-busy":h||T||void 0,children:[i&&(0,X.jsxs)(`header`,{className:`flex min-w-0 items-start gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,X.jsx)(`h3`,{className:`text-[15px] leading-6 font-medium break-words text-content`,children:k.title}),oe.length>0&&(0,X.jsx)(Ze,{labels:oe})]}),a&&(0,X.jsx)(N,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`-mt-0.5 flex-none max-[650px]:size-11`,"aria-label":d(`memory:memoryPage.closeDetail`),onClick:a,children:(0,X.jsx)(ee,{})})]}),(0,X.jsx)(`p`,{className:`text-[13px] leading-normal break-words whitespace-pre-wrap text-content-secondary`,children:k.content}),k.status===`stale`&&(0,X.jsx)(`p`,{className:`text-xs leading-normal text-content-muted`,children:d(`memory:memoryPage.staleHint`)}),k.tainted&&(0,X.jsx)(`p`,{className:`text-xs leading-normal text-content-muted`,children:d(`memory:memoryPage.taintedHint`)}),(0,X.jsxs)(`dl`,{className:`m-0`,children:[(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.memoryType`)}),(0,X.jsx)(`dd`,{children:Ve(k.type,d)})]}),A&&(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.memorySpace`)}),(0,X.jsx)(`dd`,{children:J(A,d)})]}),(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.source`)}),(0,X.jsx)(`dd`,{children:He(k.sourceType,d)})]}),(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.validFrom`)}),(0,X.jsx)(`dd`,{className:`tabular-nums`,children:Y(k.validFrom,f)})]}),(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.validTo`)}),(0,X.jsx)(`dd`,{className:`tabular-nums`,children:k.validTo?Y(k.validTo,f):d(`memory:memoryPage.stillValid`)})]}),(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.created`)}),(0,X.jsx)(`dd`,{className:`tabular-nums`,children:Y(k.createdAt,f)})]}),(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.confirmCount`)}),(0,X.jsx)(`dd`,{className:`tabular-nums`,children:k.confirmCount??1})]}),k.expiresAt&&(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.expires`)}),(0,X.jsx)(`dd`,{className:`tabular-nums`,children:Y(k.expiresAt,f)})]}),k.sourcePath&&(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.relatedFilePath`)}),(0,X.jsx)(`dd`,{className:`font-mono text-xs`,title:k.sourcePath,children:k.sourcePath})]}),k.archiveReason&&(0,X.jsxs)(`div`,{className:Z,children:[(0,X.jsx)(`dt`,{children:d(`memory:memoryPage.archiveReason`)}),(0,X.jsx)(`dd`,{title:Je(k.archiveReason,d),children:Je(k.archiveReason,d)})]})]}),k.evidence&&(0,X.jsxs)(`section`,{className:`min-w-0`,"aria-label":d(`memory:memoryPage.evidence`),children:[(0,X.jsxs)(`h4`,{className:`mb-1 text-xs font-medium text-content-muted`,children:[d(`memory:memoryPage.evidenceFrom`),` · `,Ue(k.evidenceRole,d)]}),(0,X.jsx)(`blockquote`,{className:`m-0 border-l-2 border-stroke pl-2.5 text-xs leading-normal break-words whitespace-pre-wrap text-content-secondary`,children:k.evidence})]}),re.length>1&&(0,X.jsxs)(`section`,{className:`min-w-0`,"aria-label":d(`memory:memoryPage.versionHistory`),children:[(0,X.jsxs)(`h4`,{className:`mb-1 text-xs font-medium text-content-muted tabular-nums`,children:[d(`memory:memoryPage.versionHistory`),` · `,re.length]}),(0,X.jsx)(`ol`,{"data-memory-history":!0,className:`m-0 flex list-none flex-col p-0`,children:re.map(e=>{let t=e.status===`active`||e.status===`stale`;return(0,X.jsxs)(`li`,{"aria-current":e.id===k.id||void 0,className:j(`flex min-w-0 flex-col gap-0.5 border-t border-stroke-soft py-1.5 text-xs leading-normal`,!t&&`text-content-muted`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 tabular-nums`,children:[Ge(e.validFrom,f),t&&(0,X.jsx)(H,{children:d(`memory:memoryPage.currentVersion`)})]}),(0,X.jsx)(`span`,{className:`break-words whitespace-pre-wrap`,children:e.content})]},e.id)})})]}),S&&(0,X.jsx)(U,{className:`my-0`,children:S}),(0,X.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,X.jsxs)(N,{variant:`ghost`,size:`sm`,className:`text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,disabled:T,onClick:()=>void ie(),children:[(0,X.jsx)(E,{}),d(`memory:memoryPage.delete`)]}),ae?(0,X.jsxs)(X.Fragment,{children:[k.status===`stale`&&(0,X.jsxs)(N,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,disabled:T,onClick:()=>void O(()=>Oe(k.id,`confirm`),d(`memory:memoryPage.confirmed`)),children:[(0,X.jsx)(Ne,{}),d(`memory:memoryPage.confirmStillValid`)]}),(0,X.jsxs)(N,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,disabled:T,onClick:()=>void O(()=>Oe(k.id,k.pinned?`unpin`:`pin`),k.pinned?d(`memory:memoryPage.unpinned`):d(`memory:memoryPage.pinned`)),children:[k.pinned?(0,X.jsx)(y,{}):(0,X.jsx)(b,{}),k.pinned?d(`memory:memoryPage.unpin`):d(`memory:memoryPage.pin`)]}),(0,X.jsxs)(N,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,disabled:T,onClick:()=>o(k),children:[(0,X.jsx)(v,{}),d(`memory:memoryPage.edit`)]})]}):(0,X.jsxs)(N,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,disabled:T,onClick:()=>void O(()=>Oe(k.id,`restore`),d(`memory:memoryPage.restored`)),children:[(0,X.jsx)(w,{}),d(`memory:memoryPage.restore`)]})]})]})}var $e=[`concept`,`file`,`risk`,`preference`,`decision`,`fact`,`task`],et=[.3,.5,.8,1];function tt(e){let t=e??.5;return et.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)}function nt(e){return e instanceof Error?e.message:String(e)}function rt({spaces:e,node:t,initialSpaceId:n,onClose:r,onSaved:i}){let{t:a}=s(),[o,c]=(0,q.useState)({spaceId:t?.spaceId||n||e[0]?.id||``,title:t?.title||``,content:t?.content||``,type:t?.type||`concept`,sourcePath:t?.sourcePath||``,importance:tt(t?.importance)}),[l,u]=(0,q.useState)(!1),[d,f]=(0,q.useState)(``),p=a(t?`memory:memoryPage.editMemory`:`memory:memoryPage.addMemory`),m=async e=>{if(e.preventDefault(),!l){u(!0),f(``);try{t?await G(t.id,o):await ke(o),await i(a(t?`memory:memoryPage.memoryUpdated`:`memory:memoryPage.memoryCreated`))}catch(e){f(nt(e))}finally{u(!1)}}};return(0,X.jsx)(de,{open:!0,busy:l,onOpenChange:e=>!e&&r(),children:(0,X.jsx)(F,{size:`compact`,children:(0,X.jsxs)(`form`,{className:`grid min-w-0 gap-3`,onSubmit:e=>void m(e),children:[(0,X.jsxs)(L,{children:[(0,X.jsx)(ue,{children:p}),(0,X.jsx)(P,{children:a(`memory:memoryPage.memoryDialogHint`)})]}),(0,X.jsxs)(V,{variant:`control`,children:[a(`memory:memoryPage.memoryTitle`),(0,X.jsx)(R,{value:o.title,onChange:e=>c({...o,title:e.target.value}),placeholder:a(`memory:memoryPage.forExampleProjectUIConstraints`)})]}),(0,X.jsxs)(V,{variant:`control`,children:[a(`memory:memoryPage.memoryContent`),(0,X.jsx)(fe,{value:o.content,onChange:e=>c({...o,content:e.target.value}),placeholder:a(`memory:memoryPage.recordStandaloneReusableMemoryForFutureChats`)})]}),(0,X.jsxs)(V,{variant:`control`,children:[a(`memory:memoryPage.memorySpace`),(0,X.jsx)(be,{value:o.spaceId,onChange:e=>c({...o,spaceId:e.target.value}),children:e.map(e=>(0,X.jsx)(`option`,{value:e.id,children:J(e,a)},e.id))})]}),(0,X.jsxs)(`div`,{className:`grid min-w-0 gap-x-2.5 gap-y-3 sm:grid-cols-2`,children:[(0,X.jsxs)(V,{variant:`control`,children:[a(`memory:memoryPage.memoryType`),(0,X.jsx)(be,{value:o.type,onChange:e=>c({...o,type:e.target.value}),children:$e.map(e=>(0,X.jsx)(`option`,{value:e,children:Ve(e,a)},e))})]}),(0,X.jsxs)(V,{variant:`control`,children:[a(`memory:memoryPage.importance`),(0,X.jsxs)(be,{value:o.importance,onChange:e=>c({...o,importance:Number(e.target.value)}),children:[(0,X.jsx)(`option`,{value:`0.3`,children:a(`memory:memoryPage.normal`)}),(0,X.jsx)(`option`,{value:`0.5`,children:a(`memory:memoryPage.common`)}),(0,X.jsx)(`option`,{value:`0.8`,children:a(`memory:memoryPage.important`)}),(0,X.jsx)(`option`,{value:`1`,children:a(`memory:memoryPage.strict`)})]})]})]}),(0,X.jsxs)(V,{variant:`control`,children:[a(`memory:memoryPage.relatedFilePath`),(0,X.jsx)(R,{value:o.sourcePath,onChange:e=>c({...o,sourcePath:e.target.value}),placeholder:a(`memory:memoryPage.optionalForExampleECodeProjectREADMEMd`)})]}),d&&(0,X.jsx)(U,{children:d}),(0,X.jsxs)(I,{children:[(0,X.jsx)(N,{type:`button`,variant:`secondary`,size:`dialogAction`,disabled:l,onClick:r,children:a(`memory:memoryPage.cancel`)}),(0,X.jsxs)(N,{type:`submit`,size:`dialogAction`,disabled:l||!o.spaceId||!o.title.trim()||!o.content.trim(),children:[l&&(0,X.jsx)(M,{className:`text-current`}),a(l?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})})}function it({space:e,onClose:t,onSaved:n}){let{t:r}=s(),[i,a]=(0,q.useState)(e?.name||``),[o,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(``),d=r(e?`memory:memoryPage.renameMemorySpace`:`memory:memoryPage.newMemorySpace`),f=async t=>{if(t.preventDefault(),!o){c(!0),u(``);try{await n(e?await Te(e.id,i):await we(i),r(e?`memory:memoryPage.memorySpaceRenamed`:`memory:memoryPage.memorySpaceCreated`))}catch(e){u(nt(e))}finally{c(!1)}}};return(0,X.jsx)(de,{open:!0,busy:o,onOpenChange:e=>!e&&t(),children:(0,X.jsx)(F,{size:`compact`,children:(0,X.jsxs)(`form`,{className:`grid min-w-0 gap-3`,onSubmit:e=>void f(e),children:[(0,X.jsxs)(L,{children:[(0,X.jsx)(ue,{children:d}),(0,X.jsx)(P,{children:r(`memory:memoryPage.memorySpaceHint`)})]}),(0,X.jsxs)(V,{variant:`control`,children:[r(`memory:memoryPage.memorySpaceName`),(0,X.jsx)(R,{value:i,onChange:e=>a(e.target.value),placeholder:r(`memory:memoryPage.forExampleProductDesignGuidelines`),autoFocus:!0})]}),l&&(0,X.jsx)(U,{children:l}),(0,X.jsxs)(I,{children:[(0,X.jsx)(N,{type:`button`,variant:`secondary`,size:`dialogAction`,disabled:o,onClick:t,children:r(`memory:memoryPage.cancel`)}),(0,X.jsxs)(N,{type:`submit`,size:`dialogAction`,disabled:o||!i.trim(),children:[o&&(0,X.jsx)(M,{className:`text-current`}),r(o?`memory:memoryPage.saving`:`memory:memoryPage.save`)]})]})]})})})}var at=30;function ot({digest:e}){let{t}=s(),r=n(),[i,a]=(0,q.useState)([]);return(0,q.useEffect)(()=>{let t=new AbortController;return K(e.id,t.signal).then(e=>a(e.children||[]),()=>a([])),()=>t.abort()},[e.id]),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,X.jsx)(`p`,{className:`m-0 text-sm leading-relaxed break-words whitespace-pre-wrap`,children:e.text}),i.length>0&&(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`m-0 text-xs font-medium text-content-muted`,children:t(`memory:memoryPage.sessionFacts`)}),(0,X.jsx)(`ul`,{className:`m-0 mt-1 list-disc pl-4 text-sm leading-relaxed`,children:i.map(e=>(0,X.jsx)(`li`,{className:`break-words`,children:e.title},e.id))})]}),e.sessionAvailable&&(0,X.jsx)(`div`,{children:(0,X.jsx)(N,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,onClick:()=>r(o(e.sessionId)),children:t(`memory:memoryPage.openSession`)})})]})}function st({spaceId:e,spaces:t,refreshKey:n}){let{t:r,language:i}=s(),[a,o]=(0,q.useState)([]),[c,u]=(0,q.useState)(!0),[d,f]=(0,q.useState)(!1),[p,m]=(0,q.useState)(!1),[h,g]=(0,q.useState)(!1),[_,v]=(0,q.useState)(``),[y,b]=(0,q.useState)(``),x=(0,q.useRef)(0),S=e===`all`?``:e,C=(0,q.useCallback)(async()=>{let e=++x.current;u(!0),v(``);try{let t=await W({spaceId:S,limit:at});if(e!==x.current)return;o(t.sessions),m(t.sessions.length>=at),g(!1)}catch(t){if(e!==x.current)return;t instanceof l&&t.status===404?g(!0):v(t instanceof Error?t.message:String(t))}finally{e===x.current&&u(!1)}},[S]);(0,q.useEffect)(()=>(C(),()=>{x.current+=1}),[C,n]);let w=async()=>{let e=a.at(-1)?.windowEnd;if(!e||d)return;let t=x.current;f(!0);try{let n=await W({spaceId:S,before:e,limit:at});if(t!==x.current)return;o(e=>{let t=new Set(e.map(e=>e.id));return[...e,...n.sessions.filter(e=>!t.has(e.id))]}),m(n.sessions.length>=at)}catch(e){t===x.current&&v(e instanceof Error?e.message:String(e))}finally{f(!1)}};return h?(0,X.jsx)(B,{compact:!0,title:r(`memory:memoryPage.sessionsUnsupported`)}):c&&!a.length?(0,X.jsx)(z,{kind:`loading`,title:r(`common:pageTemplate.loading`)}):_&&!a.length?(0,X.jsx)(z,{kind:`error`,title:r(`memory:memoryPage.sessionsLoadFailed`),description:_,action:(0,X.jsx)(N,{variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>void C(),children:r(`common:pageTemplate.retry`)})}):a.length?(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[_&&(0,X.jsx)(ye,{className:`mt-0`,children:_}),(0,X.jsx)(he,{children:a.map(n=>{let a=n.sessionName||r(`memory:memoryPage.sessionUntitled`),o=t.find(e=>e.id===n.spaceId);return(0,X.jsx)(me,{"data-memory-session":n.sessionId,icon:(0,X.jsx)(Le,{}),name:a,description:y===n.id?void 0:n.text,meta:(0,X.jsxs)(`span`,{className:`truncate tabular-nums`,children:[Y(n.windowEnd,i),e===`all`&&o?` · ${J(o,r)}`:``]}),expanded:y===n.id,onExpandedChange:e=>b(e?n.id:``),toggleLabel:a,detail:(0,X.jsx)(ot,{digest:n})},n.id)})}),p&&(0,X.jsx)(`div`,{className:`flex justify-center`,children:(0,X.jsx)(N,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,loading:d,disabled:d,onClick:()=>void w(),children:r(`memory:memoryPage.loadMore`)})})]}):(0,X.jsx)(B,{compact:!0,title:r(`memory:memoryPage.noSessionDigests`)})}var ct=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate());function lt(e){let t=ct(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()-(t.getDay()+6)%7)}function ut(e,t,n=Date.now()){let r=new Date(n),i=ct(r).getTime(),a=i-864e5,o=lt(r).getTime(),s=new Map,c=(e,t)=>{let n=s.get(e.key);n?n.items.push(t):s.set(e.key,{...e,items:[t]})};for(let n of e){let e=Date.parse(t(n)||``);if(Number.isNaN(e))c({key:`unknown`,kind:`unknown`},n);else if(e>=i)c({key:`today`,kind:`today`},n);else if(e>=a)c({key:`yesterday`,kind:`yesterday`},n);else if(e>=o)c({key:`week`,kind:`week`},n);else{let t=new Date(e);c({key:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}`,kind:`month`,month:new Date(t.getFullYear(),t.getMonth(),1)},n)}}return[...s.values()]}var dt=(0,q.lazy)(()=>t(()=>import(`./MemoryEvolution-Ulreb-P1.js`),__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]))),Q=`all`;function ft(){try{let e=r.getItem(c.memoryView);return e===`timeline`||e===`sessions`||e===`activity`?e:`evolution`}catch{return`evolution`}}function pt(e){try{r.setItem(c.memoryView,e)}catch{}}function $(e){return e instanceof Error?e.message:String(e)}var mt={spaces:[],selectedSpaceId:``,nodes:[]};function ht({notify:e,onBack:t,requestConfirm:n}){let{t:r,language:i}=s(),a=le(`focusSearch`),[o,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(ft),[d,f]=(0,q.useState)(Q),[m,h]=(0,q.useState)(`current`),[g,_]=(0,q.useState)(mt),[v,y]=(0,q.useState)(!0),[b,C]=(0,q.useState)(!1),[w,T]=(0,q.useState)(!1),[E,D]=(0,q.useState)(``),[ee,j]=(0,q.useState)(``),[M,P]=(0,q.useState)(null),[F,ue]=(0,q.useState)(0),[I,L]=(0,q.useState)(null),[de,R]=(0,q.useState)(null),[fe,V]=(0,q.useState)(!1),H=(0,q.useRef)(0),U=(0,q.useCallback)(async()=>{let e=++H.current;y(!0),D(``);try{let t=await Se({spaceId:d,query:o,status:m});if(e!==H.current)return;_(t),T(!0),t.selectedSpaceId&&t.selectedSpaceId!==d&&f(t.selectedSpaceId)}catch(t){e===H.current&&D($(t))}finally{e===H.current&&y(!1)}},[o,d,m]);(0,q.useEffect)(()=>(U(),()=>{H.current+=1}),[U,F]);let xe=async()=>{let e=g.nodes.at(-1),t=e?.validFrom||e?.createdAt;if(!t||b)return;let n=H.current;C(!0);try{let e=await Se({spaceId:d,status:m,before:t});if(n!==H.current)return;_(t=>{let n=new Set(t.nodes.map(e=>e.id));return{...e,nodes:[...t.nodes,...e.nodes.filter(e=>!n.has(e.id))]}})}catch(e){n===H.current&&D($(e))}finally{C(!1)}},W=(0,q.useCallback)(()=>ue(e=>e+1),[]),G=(0,q.useCallback)(t=>{e(t),W()},[e,W]),Ce=(0,q.useCallback)(e=>{j(``),P(null),G(e)},[G]),we=(0,q.useMemo)(()=>[...g.spaces].sort((e,t)=>Number(t.kind===`global`)-Number(e.kind===`global`)),[g.spaces]),K=g.spaces.find(e=>e.id===d)||null,Te=!!o.trim(),Oe=(0,q.useMemo)(()=>ut(g.nodes,e=>e.validFrom||e.createdAt),[g.nodes]),ke=e=>{let t=e;u(t),pt(t)},Me=e=>{c(e),j(``),e.trim()&&l!==`timeline`&&u(`timeline`)},Ne=e=>{f(e),j(``),P(null)},Pe=async()=>{if(K&&await n({title:r(`memory:memoryPage.deleteMemorySpace`),message:r(`memory:memoryPage.deleteMemorySpaceNameAndAllMemoriesInIt`,{name:J(K,r)}),confirmLabel:r(`memory:memoryPage.delete`)}))try{await De(K.id),Ne(Q),G(r(`memory:memoryPage.memorySpaceDeleted`))}catch(e){D($(e))}},Fe=async()=>{try{let{markdown:t}=await Ae(d===Q?``:d),n=URL.createObjectURL(new Blob([t],{type:`text/markdown;charset=utf-8`})),i=document.createElement(`a`);i.href=n,i.download=`pisper-memory-${new Date().toISOString().slice(0,10)}.md`,i.click(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3),e(r(`memory:memoryPage.exported`))}catch(e){D($(e))}},Ie=async()=>{if(!fe){V(!0),D(``);try{let e=await Ee();G(e.ran?r(`memory:memoryPage.consolidated`):r(`memory:memoryPage.nothingToConsolidate`))}catch(e){D($(e))}finally{V(!1)}}},Le=async()=>{if(await n({title:r(`memory:memoryPage.clearEpisodes`),message:r(`memory:memoryPage.clearEpisodesConfirm`),confirmLabel:r(`memory:memoryPage.clearEpisodesAction`)}))try{let{cleared:e}=await je(d===Q?``:d);G(r(`memory:memoryPage.episodesCleared`,{count:e}))}catch(e){D($(e))}},Re=!!K&&K?.kind!==`global`,ze=e=>(0,X.jsx)(Qe,{id:e.id,fallback:e,spaces:g.spaces,refreshKey:F,onEdit:L,onChanged:G,onDeleted:Ce,requestConfirm:n}),Ue=e=>{let t=Be[e.type]||Be.concept,n=We(e,r),a=g.spaces.find(t=>t.id===e.spaceId);return(0,X.jsx)(me,{"data-memory-node":e.id,icon:(0,X.jsx)(t,{}),name:e.title,nameMeta:Ve(e.type,r),description:ee===e.id?void 0:e.content,meta:(0,X.jsxs)(`span`,{className:`truncate tabular-nums`,children:[Ge(e.validFrom||e.createdAt,i),d===Q&&a?` · ${J(a,r)}`:``,` · ${He(e.sourceType,r)}`]}),status:n.length?(0,X.jsx)(Ze,{labels:n}):void 0,expanded:ee===e.id,onExpandedChange:t=>j(t?e.id:``),toggleLabel:e.title,detail:ze(e)},e.id)},Y=e=>e.kind===`today`?r(`memory:memoryPage.groupToday`):e.kind===`yesterday`?r(`memory:memoryPage.groupYesterday`):e.kind===`week`?r(`memory:memoryPage.groupThisWeek`):e.kind===`unknown`||!e.month?r(`memory:memoryPage.groupUnknown`):new Intl.DateTimeFormat(i,{year:`numeric`,month:`long`}).format(e.month),Ke=r(Te?`memory:memoryPage.noMatchingMemories`:m===`archived`?`memory:memoryPage.noArchivedMemories`:m===`history`?`memory:memoryPage.noHistoryVersions`:`memory:memoryPage.noMemoriesInSpace`);return(0,X.jsx)(se,{asChild:!0,value:l,onValueChange:ke,className:`gap-0`,children:(0,X.jsxs)(_e,{title:r(`navigation:navigation.memory`),description:r(`memory:memoryPage.lede`),back:t&&{label:r(`navigation:sidebar.features`),ariaLabel:r(`navigation:shell.backToFeaturesLabel`),onBack:t},toolbar:(0,X.jsx)(ve,{search:(0,X.jsx)(pe,{id:te,value:o,onValueChange:Me,placeholder:r(`navigation:pageHeader.searchMemoriesOrFiles`),shortcut:a,clearLabel:r(`navigation:more.clearSearch`)}),actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(N,{type:`button`,className:`h-9`,disabled:!w,onClick:()=>L({spaceId:d===Q?`global`:d}),children:[(0,X.jsx)(x,{}),r(`memory:memoryPage.addMemory`)]}),(0,X.jsxs)(ie,{children:[(0,X.jsx)(k,{asChild:!0,children:(0,X.jsx)(N,{type:`button`,variant:`secondary`,size:`icon-lg`,className:`max-[650px]:max-w-11`,disabled:!w,"aria-label":r(`memory:memoryPage.moreActions`),title:r(`memory:memoryPage.moreActions`),children:(0,X.jsx)(p,{})})}),(0,X.jsxs)(re,{align:`end`,children:[(0,X.jsx)(O,{onSelect:()=>R(`new`),children:r(`memory:memoryPage.newMemorySpace`)}),(0,X.jsx)(O,{disabled:!Re,onSelect:()=>K&&R(K),children:r(`memory:memoryPage.renameMemorySpace`)}),(0,X.jsx)(O,{variant:`destructive`,disabled:!Re,onSelect:()=>void Pe(),children:r(`memory:memoryPage.deleteMemorySpace`)}),(0,X.jsx)(ne,{}),(0,X.jsx)(O,{onSelect:()=>void Fe(),children:r(`memory:memoryPage.exportMarkdown`)}),(0,X.jsx)(O,{disabled:fe,onSelect:()=>void Ie(),children:r(`memory:memoryPage.consolidateNow`)}),(0,X.jsx)(O,{onSelect:()=>void Le(),children:r(`memory:memoryPage.clearEpisodes`)})]})]})]}),filters:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2.5`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,X.jsxs)(oe,{"aria-label":r(`memory:memoryPage.viewsLabel`),children:[(0,X.jsx)(A,{value:`evolution`,children:r(`memory:memoryPage.evolutionView`)}),(0,X.jsx)(A,{value:`timeline`,children:r(`memory:memoryPage.timelineView`)}),(0,X.jsx)(A,{value:`sessions`,children:r(`memory:memoryPage.sessionsView`)}),(0,X.jsx)(A,{value:`activity`,children:r(`memory:memoryPage.activityView`)})]}),(0,X.jsxs)(be,{className:`w-[200px] max-w-full max-[650px]:w-full`,"aria-label":r(`memory:memoryPage.memorySpace`),value:d,disabled:!w,onChange:e=>Ne(e.target.value),children:[(0,X.jsx)(`option`,{value:Q,children:r(`memory:memoryPage.allSpaces`)}),we.map(e=>(0,X.jsx)(`option`,{value:e.id,children:`${J(e,r)} · ${e.nodeCount}`},e.id))]})]}),l===`timeline`&&w&&(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[Te?(0,X.jsxs)(`p`,{className:`m-0 text-[13px] font-medium text-content-muted tabular-nums`,children:[r(`memory:memoryPage.searchResults`),` · `,g.nodes.length]}):(0,X.jsx)(ce,{"aria-label":r(`memory:memoryPage.statusFilterLabel`),value:m,onValueChange:e=>{h(e),j(``)},options:[{value:`current`,label:r(`memory:memoryPage.statusCurrent`),count:g.counts?.current},{value:`archived`,label:r(`memory:memoryPage.statusArchived`),count:g.counts?.archived},{value:`history`,label:r(`memory:memoryPage.statusHistory`),count:g.counts?.history}]}),(0,X.jsx)(N,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted max-[650px]:size-11`,loading:v,disabled:v,"aria-label":r(`memory:memoryPage.refresh`),title:r(`memory:memoryPage.refresh`),onClick:W,children:(0,X.jsx)(S,{})})]})]})}),children:[!w&&v?(0,X.jsx)(z,{kind:`loading`,title:r(`common:pageTemplate.loading`)}):w?(0,X.jsxs)(X.Fragment,{children:[E&&(0,X.jsx)(ye,{children:E}),(0,X.jsxs)(`div`,{className:`mt-5 min-w-0`,"aria-busy":v,children:[(0,X.jsxs)(ae,{value:`evolution`,className:`flex min-w-0 flex-col gap-3`,children:[(0,X.jsx)(q.Suspense,{fallback:(0,X.jsx)(z,{kind:`loading`,title:r(`common:pageTemplate.loading`)}),children:(0,X.jsx)(dt,{spaceId:d,refreshKey:F,selectedId:M,onSelect:P})}),(0,X.jsx)(`div`,{role:`region`,"data-memory-detail":!0,"aria-label":r(`memory:memoryPage.selectedMemory`),className:`min-w-0 rounded-[var(--r-md)] border border-stroke px-4 py-3`,children:M?(0,X.jsx)(Qe,{id:M,spaces:g.spaces,refreshKey:F,withHeading:!0,onClose:()=>P(null),onEdit:L,onChanged:G,onDeleted:Ce,requestConfirm:n}):(0,X.jsx)(`p`,{className:`m-0 text-xs leading-normal text-content-muted`,children:r(`memory:memoryPage.selectAMemoryToViewDetails`)})})]}),(0,X.jsxs)(ae,{value:`timeline`,className:`min-w-0`,"data-memory-timeline":!0,children:[g.nodes.length?Te?(0,X.jsx)(he,{children:g.nodes.map(Ue)}):Oe.map(e=>(0,X.jsx)(ge,{"data-memory-group":e.key,className:`mt-5 first:mt-0`,title:Y(e),count:e.items.length,children:(0,X.jsx)(he,{children:e.items.map(Ue)})},e.key)):(0,X.jsx)(B,{compact:!0,title:Ke}),!Te&&g.hasMore&&(0,X.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,X.jsx)(N,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,loading:b,disabled:b,onClick:()=>void xe(),children:r(`memory:memoryPage.loadMore`)})})]}),(0,X.jsx)(ae,{value:`sessions`,className:`min-w-0`,children:(0,X.jsx)(st,{spaceId:d,spaces:g.spaces,refreshKey:F})}),(0,X.jsx)(ae,{value:`activity`,className:`min-w-0`,children:(0,X.jsx)(Xe,{spaceId:d,refreshKey:F,onChanged:G})})]})]}):(0,X.jsx)(z,{kind:`error`,title:r(`memory:memoryPage.loadFailed`),description:E,action:(0,X.jsx)(N,{variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>void U(),children:r(`common:pageTemplate.retry`)})}),I&&(0,X.jsx)(rt,{spaces:we,node:`id`in I?I:null,initialSpaceId:I.spaceId,onClose:()=>L(null),onSaved:e=>{L(null),G(e)}}),de&&(0,X.jsx)(it,{space:de===`new`?null:de,onClose:()=>R(null),onSaved:(e,t)=>{R(null),Ne(e.id),G(t)}})]})})}export{ht as MemoryPage};
|
|
@@ -1 +0,0 @@
|
|
|
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-QY-mTTDS.js";import{t as i}from"./useQuery-DfOU-27z.js";import{i as a}from"./runtime-capabilities-CPDBo3tu.js";import{t as o}from"./runtime-capabilities-store-D_0w_fuG.js";import{t as s}from"./createLucideIcon-Cd-3GVxJ.js";import{r as c}from"./permission-rules-api-BM5qRwQ-.js";import{t as l}from"./bot-B3TaBp_T.js";import{t as u}from"./check-2vYc6QaP.js";import{a as d,c as f,i as p,l as m,n as h,o as g,r as _,t as v}from"./SessionBrowserPane-NHFA_B4m.js";import{c as y}from"./focus-session-composer-bits-B_mOqktE.js";import{t as b}from"./earth-Ddy13fHh.js";import{t as ee}from"./ellipsis-CfGKfbq6.js";import{o as x}from"./GitDiffViewer-DQVUfRzI.js";import{k as te,m as S}from"./side-chat-context-CoDP1BZc.js";import{t as ne}from"./git-branch-N7LGjtzt.js";import{n as re,t as C}from"./undo-2-C-xQ0UVT.js";import{t as w}from"./message-square-SKjZyY3v.js";import{t as ie}from"./plus-fQbSqB1n.js";import{t as T}from"./refresh-cw-TbWxTY4K.js";import{t as ae}from"./square-terminal-BVG6cUT1.js";import{t as E}from"./wrench-6pg6_bqI.js";import{t as oe}from"./x-07u4-129.js";import{c as D,i as O,p as se,r as ce,t as k}from"./dropdown-menu-Ds0gD8S8.js";import{i as le,n as ue,t as de}from"./popover-CaaxkJV6.js";import{t as fe}from"./segmented-control-xkrEOP_d.js";import{t as A}from"./utils-C8uzG5AZ.js";import{t as j}from"./button-CCcCN8tE.js";import{t as pe}from"./chat-api-fzSB1i2N.js";import{a as M,r as N}from"./format-DMJQzoZ7.js";import{t as me}from"./StatusGlyph-1KgitlUg.js";import{s as he}from"./run-activity-CwfO0cui.js";import{t as ge}from"./session-change-summary-api-Bz6qW3dZ.js";import{n as P,t as F}from"./PageState-Cz6vFMXv.js";import{i as _e,n as I,r as ve}from"./MarkdownMessage-CMM5-pzJ.js";import{t as ye}from"./route-context-DvWDul4T.js";import{i as L,r as R}from"./session-web-preview-guvsmkWE.js";import"./public-Cs-VgI_R.js";import{n as be,r as z}from"./terminal-context-aIsIJPn8.js";import{r as B}from"./session-inspector-store-BUq8tTV4.js";import{o as V}from"./web-preview-C7DdG9JP.js";var H=s(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),xe=s(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),U=e(t(),1),W=n(),G=new Set([`queued`,`starting`,`running`]),K=new Set([`starting`,`running`,`stopping`]);function q(e){return typeof e==`string`?e.trim():``}function J(e,t,n){let r=new Map;for(let i of e){if(i?.type!==t)continue;let e=n(i);e&&r.set(String(e.id||r.size),e)}return[...r.values()]}function Y({startedAt:e}){let[t,n]=(0,U.useState)(()=>Date.now());(0,U.useEffect)(()=>{let e=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let r=he(e,null,t);return r?(0,W.jsx)(`span`,{className:`flex-none font-mono text-xs text-content-muted tabular-nums`,children:y(r)}):null}function Se(e,t){let n=t?J(e,`tool`,e=>e).filter(e=>e.status===`running`):[],r=J(e,`agent`,e=>e.agent&&typeof e.agent==`object`?e.agent:null).filter(e=>G.has(String(e.status)));return n.length+r.length}function Ce({sessionId:e,streaming:t,activity:n}){let{t:i}=r(),a=z(e),o=[...t?J(n,`tool`,e=>e).filter(e=>e.status===`running`).map(e=>{let t=e.args||{};return{key:`tool:${String(e.id)}`,icon:(0,W.jsx)(E,{size:14,"aria-hidden":`true`}),name:q(e.name)||i(`board:inspector.runningTool`),detail:q(t.command)||q(t.path)||q(t.file_path),startedAt:q(e.startedAt),status:i(`board:inspector.runningStatus`)}}):[],...J(n,`agent`,e=>e.agent&&typeof e.agent==`object`?e.agent:null).filter(e=>G.has(String(e.status))).map(e=>({key:`agent:${String(e.id)}`,icon:(0,W.jsx)(l,{size:14,"aria-hidden":`true`}),name:q(e.title)||q(e.taskName)||i(`board:inspector.runningAgent`),detail:q(e.message),startedAt:q(e.startedAt),status:e.status===`queued`?i(`board:inspector.runningQueued`):i(`board:inspector.runningStatus`)})),...a.filter(e=>K.has(e.status)).map(e=>({key:`terminal:${e.id}`,icon:(0,W.jsx)(ae,{size:14,"aria-hidden":`true`}),name:e.profileId||i(`board:inspector.terminal`),detail:e.cwd||``,status:e.status===`stopping`?i(`terminal:workspace.stopping`):i(`board:inspector.runningStatus`)}))];return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-3`,"data-inspector-running":!0,children:[o.length?(0,W.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:o.map(e=>(0,W.jsxs)(`li`,{className:`grid min-w-0 grid-cols-[14px_minmax(0,1fr)_auto] items-start gap-2 py-1.5 text-xs`,"data-running-item":e.key.split(`:`)[0],children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-content-secondary`,children:e.icon}),(0,W.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,W.jsx)(`strong`,{className:`truncate text-[13px] font-medium text-content`,children:e.name}),e.detail&&(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-content-muted`,title:e.detail,children:e.detail})]}),(0,W.jsxs)(`span`,{className:`flex flex-none items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-content-muted`,children:e.status}),(0,W.jsx)(Y,{startedAt:e.startedAt})]})]},e.key))}):(0,W.jsx)(F,{compact:!0,title:i(`board:inspector.runningEmpty`)}),(0,W.jsx)(`p`,{className:`mt-3 text-xs leading-relaxed text-content-faint`,children:i(`board:inspector.runningHint`)})]})}var we={running:{kind:`run`,color:`text-st-run`},starting:{kind:`run`,color:`text-st-run`},queued:{kind:`queued`,color:`text-st-queue`},completed:{kind:`done`,color:`text-st-done`},failed:{kind:`failed`,color:`text-st-fail`},interrupted:{kind:`stopped`,color:`text-st-queue`},blocked:{kind:`queued`,color:`text-st-queue`}};function Te(e,t){return t(e===`queued`?`chat:agentRunActivity.teamTaskQueued`:e===`starting`?`chat:agentRunActivity.teamTaskStarting`:e===`running`?`chat:agentRunActivity.teamTaskRunning`:e===`completed`?`chat:agentRunActivity.teamTaskCompleted`:e===`failed`?`chat:agentRunActivity.teamTaskFailed`:e===`interrupted`?`chat:agentRunActivity.teamTaskInterrupted`:e===`blocked`?`chat:agentRunActivity.teamTaskBlocked`:`chat:agentRunActivity.teamTaskStatusUpdated`)}function Ee(e,t){return e.status===`active`?e.mode===`team`?t(`chat:focusSession.runningAsTeam`):t(`chat:focusSession.runningAutonomously`):e.status===`paused`?t(`chat:focusSession.goalPaused`):e.status===`complete`?t(`chat:focusSession.goalComplete`):e.status===`budget_limited`?t(`chat:focusSession.goalReachedItsBudget`):``}function X({title:e,children:t}){return(0,W.jsxs)(`section`,{className:`grid min-w-0 gap-2`,"aria-label":e,children:[(0,W.jsx)(`h3`,{className:`text-xs font-semibold text-content-secondary`,children:e}),t]})}function De({status:e,name:t,detail:n,t:r}){let i=we[String(e)]??{kind:`queued`,color:`text-st-queue`};return(0,W.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 py-1.5 text-xs`,children:[(0,W.jsx)(me,{status:i.kind,className:`mt-px size-3.5 ${i.color}`}),(0,W.jsxs)(`span`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(`strong`,{className:`min-w-0 truncate font-medium text-content`,children:t}),(0,W.jsx)(`span`,{className:`flex-none text-content-muted`,children:Te(e,r)})]}),n&&(0,W.jsx)(`span`,{className:`min-w-0 break-words text-content-muted`,children:n})]})]})}function Oe(e){let t=new Map;for(let n of e){if(n?.type!==`agent`||!n.agent||typeof n.agent!=`object`)continue;let e=n.agent,r=String(e.id||e.taskName||t.size);t.set(r,e)}return[...t.values()]}function ke({plan:e,streaming:t,goal:n,team:i,activity:a}){let{t:o}=r(),s=Array.isArray(i?.tasks)?i.tasks:[],c=Oe(a),l=!!(n?.id&&String(n.objective||``).trim()),u=!!e?.items?.length;if(!l&&!u&&!s.length&&!c.length)return(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:(0,W.jsx)(F,{compact:!0,icon:re,title:o(`chat:sessionContext.planEmpty`)})});let d=Number(n?.mode===`team`?n?.teamTokenBudget:n?.tokenBudget)||0;return(0,W.jsxs)(`div`,{className:`grid min-h-0 flex-1 content-start gap-5 overflow-y-auto p-3`,"data-inspector-plan":!0,children:[l&&n&&(0,W.jsx)(X,{title:o(`board:inspector.goal`),children:(0,W.jsxs)(`div`,{className:`grid gap-1.5 rounded-md border border-stroke-soft bg-surface-subtle p-3 text-xs`,children:[(0,W.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-content`,children:String(n.objective)}),(0,W.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 text-content-muted tabular-nums`,children:[(0,W.jsx)(`span`,{children:Ee(n,o)}),(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,W.jsx)(`span`,{children:d>0?o(`chat:focusSession.usedBudgetTokensUsed`,{used:N(n.tokensUsed),budget:N(d)}):o(`chat:focusSession.usedUnlimitedGoalTokens`,{used:N(n.tokensUsed)})})]})]})}),u&&(0,W.jsx)(X,{title:o(`board:inspector.plan`),children:(0,W.jsx)(m,{plan:e,running:t})}),s.length>0&&(0,W.jsx)(X,{title:o(`board:inspector.team`),children:(0,W.jsx)(`ul`,{className:`divide-y divide-stroke-soft`,children:s.map((e,t)=>(0,W.jsx)(De,{status:e.status,name:e.taskName||o(`chat:agentRunActivity.subagent`),detail:e.error||e.output||``,t:o},e.id||`${e.taskName}-${t}`))})}),c.length>0&&(0,W.jsx)(X,{title:o(`board:inspector.subAgents`),children:(0,W.jsx)(`ul`,{className:`divide-y divide-stroke-soft`,children:c.map((e,t)=>(0,W.jsx)(De,{status:e.status,name:String(e.taskName||``).trim()||o(`chat:agentRunActivity.subagent`),detail:String(e.error||e.message||``).trim(),t:o},String(e.id||t)))})})]})}function Ae({panelId:e,sessionId:t}){let{t:n}=r(),i=R(e=>e.sessions[t]),a=i?.pages,o=a?.filter(e=>e.kind===`browser`)??[],s=(i&&L(i))?.id??``,c=(a?.length??0)>=12,u=(0,U.useRef)(null),[d,f]=(0,U.useState)([]);s&&!d.includes(s)&&f([...d,s]),(0,U.useEffect)(()=>{u.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.closest(`[data-browser-tab]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[s]);let p=t=>`${e}-browser-${t}-tab`,m=t=>`${e}-browser-${t}-panel`,h=e=>R.getState().update(t,`browser`,{type:`browser-tab`,id:e}),g=(e,t,n=``)=>requestAnimationFrame(()=>document.querySelector(`[id="${e(t)}"] ${n}`.trim())?.focus()),_=()=>{let e=R.getState(),n=e.sessions[t]?.contentOpen??!1;if(e.update(t,`browser`,{type:`add`,kind:`browser`})===`limit`)return;n||e.update(t,`browser`,{type:`workspace`,contentOpen:!1});let r=R.getState().sessions[t],i=r&&L(r);i&&g(m,i.id,`input`)},y=e=>{let n=R.getState();if(o.length===1){n.update(t,`browser`,{type:`browser`,id:e,url:``,draft:``,agent:!1}),n.update(t,`browser`,{type:`resource`,id:e,resourceId:``});return}n.update(t,`browser`,{type:`close`,id:e});let r=R.getState().sessions[t],i=r&&L(r);i&&g(p,i.id)};return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b border-stroke-soft px-3 py-1.5`,children:[(0,W.jsx)(`div`,{ref:u,role:`tablist`,"aria-label":n(`common:webPreview.tabs`),className:`flex min-w-0 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]`,onKeyDown:e=>{if(!(e.target instanceof HTMLElement)||e.target.getAttribute(`role`)!==`tab`)return;if(e.key===`Delete`){e.preventDefault(),s&&y(s);return}if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=o.findIndex(e=>e.id===s),n=e.key===`Home`?0:e.key===`End`?o.length-1:(t+(e.key===`ArrowRight`?1:-1)+o.length)%o.length,r=o[n];r&&(h(r.id),g(p,r.id))},children:o.map(e=>{let t=e.id===s,r=e.title||(e.url?V(e.url):n(`common:webPreview.newTab`)),i=o.length>1||!!(e.url||e.resourceId);return(0,W.jsxs)(`div`,{"data-browser-tab":e.id,className:A(`flex min-w-20 flex-[0_1_10rem] items-center rounded-sm text-[13px] transition-colors duration-(--d-fast)`,t?`bg-solid font-medium text-content shadow-edge ring-1 ring-stroke-strong ring-inset`:`text-content-secondary hover:bg-surface-hover hover:text-content`),onAuxClick:t=>{t.button===1&&i&&y(e.id)},children:[(0,W.jsxs)(`button`,{id:p(e.id),type:`button`,role:`tab`,"aria-selected":t,"aria-controls":m(e.id),tabIndex:t?0:-1,title:e.url||r,className:A(`flex h-7 min-w-0 flex-1 items-center rounded-sm pl-2 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,!i&&`pr-2`),onClick:()=>h(e.id),children:[e.agent&&(0,W.jsx)(l,{size:12,className:`mr-1 flex-none text-focus`,role:`img`,"aria-label":n(`common:webPreview.agentTab`)}),(0,W.jsx)(`span`,{className:`truncate`,children:r})]}),i&&(0,W.jsx)(`button`,{type:`button`,tabIndex:t?0:-1,"aria-label":`${n(`common:webPreview.closeTab`)} · ${r}`,className:`mx-0.5 grid size-5 flex-none place-items-center rounded-xs text-content-muted hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:size-11`,onClick:()=>y(e.id),children:(0,W.jsx)(oe,{size:12,"aria-hidden":`true`})})]},e.id)})}),(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none pointer-coarse:size-11`,disabled:c,"aria-label":n(`common:webPreview.newTab`),title:n(c?`chat:sessionContext.pageLimit`:`common:webPreview.newTab`),onClick:_,children:(0,W.jsx)(ie,{"aria-hidden":`true`})})]}),o.filter(e=>d.includes(e.id)).map(e=>{let n=e.id===s;return(0,W.jsx)(`div`,{id:m(e.id),role:`tabpanel`,"aria-labelledby":p(e.id),hidden:!n,className:n?`flex min-h-0 flex-1 flex-col`:`hidden`,children:(0,W.jsx)(v,{sessionId:t,page:e,onChange:n=>R.getState().update(t,`browser`,{type:`browser`,id:e.id,...n}),onClosed:()=>y(e.id)})},e.id)})]})}var Z=100;function je(e){let t=e.trim().toUpperCase();return t===`??`||t.includes(`A`)?`created`:t.includes(`D`)?`deleted`:t.includes(`R`)?`renamed`:t.includes(`M`)?`modified`:`other`}var Q={modified:`M`,created:`A`,deleted:`D`,renamed:`R`,other:`·`},Me={modified:`text-content-secondary`,created:`text-st-done`,deleted:`text-st-fail`,renamed:`text-content-secondary`,other:`text-content-muted`};function Ne(e){let t=e.replace(/\\/g,`/`),n=t.lastIndexOf(`/`);return n<0?{directory:``,name:t}:{directory:t.slice(0,n+1),name:t.slice(n+1)}}function $(e,t){return/^(?:[a-zA-Z]:[\\/]|\/|\\\\)/.test(t)?t:`${e.replace(/[\\/]+$/,``)}/${t}`}function Pe(e,t){window.dispatchEvent(new CustomEvent(ye,{detail:{message:e,tone:t}}))}function Fe({added:e,removed:t}){return e===null||t===null?null:(0,W.jsxs)(`span`,{className:`flex-none font-mono text-xs tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}),` `,(0,W.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]})]})}function Ie({status:e,children:t}){let{t:n}=r();return(0,W.jsxs)(`footer`,{className:`mt-auto flex h-10 shrink-0 items-center gap-2 border-t border-stroke-soft pr-1.5 pl-3 text-xs text-content-muted`,"data-changes-footer":!0,children:[(0,W.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 truncate`,children:e}),(0,W.jsxs)(k,{children:[(0,W.jsx)(se,{asChild:!0,children:(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`pointer-coarse:size-11`,"aria-label":n(`board:changes.more`),title:n(`board:changes.more`),"data-changes-more":!0,children:(0,W.jsx)(ee,{"aria-hidden":`true`})})}),(0,W.jsx)(ce,{align:`end`,side:`top`,className:`min-w-48`,children:t})]})]})}function Le({status:e}){let{t}=r(),n=t(e===`created`?`board:changes.statusCreated`:e===`deleted`?`board:changes.statusDeleted`:e===`renamed`?`board:changes.statusRenamed`:`board:changes.statusModified`);return(0,W.jsxs)(`span`,{className:A(`w-3.5 flex-none text-center font-mono text-xs font-semibold`,Me[e]),title:n,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,children:Q[e]}),(0,W.jsx)(`span`,{className:`sr-only`,children:n})]})}function Re({files:e,selected:t,label:n,onSelect:r}){let i=(0,U.useRef)(null);return(0,W.jsxs)(`ul`,{ref:i,"aria-label":n,className:`max-h-[34%] min-h-11 shrink-0 overflow-y-auto border-b border-stroke-soft py-1`,onKeyDown:e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=[...i.current?.querySelectorAll(`[data-change-file]`)??[]],n=t.findIndex(e=>e===document.activeElement),a=t[e.key===`Home`?0:e.key===`End`?t.length-1:Math.min(t.length-1,Math.max(0,n+(e.key===`ArrowDown`?1:-1)))];a&&(e.preventDefault(),a.focus(),r(a.dataset.changeFile||``))},"data-change-list":!0,children:[e.slice(0,Z).map(e=>{let n=e.path===t,{directory:i,name:a}=Ne(e.path);return(0,W.jsx)(`li`,{className:`px-1`,children:(0,W.jsxs)(`button`,{type:`button`,title:e.path,"aria-label":[e.path,Q[e.status],e.added!==null&&e.removed!==null?`+${e.added} −${e.removed}`:``,e.note||``].filter(Boolean).join(` `),"aria-current":n?`true`:void 0,"data-change-file":e.path,className:A(`flex h-8 w-full min-w-0 items-center gap-2 rounded-sm px-2 text-left text-xs transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus max-[650px]:h-11 pointer-coarse:h-11`,n?`bg-solid shadow-[inset_0_0_0_1px_var(--stroke-strong)]`:`hover:bg-surface-hover`),onClick:()=>r(e.path),children:[(0,W.jsx)(Le,{status:e.status}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 font-mono`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate text-content-muted`,children:i}),(0,W.jsx)(`span`,{className:`flex-none text-content`,children:a})]}),e.note&&(0,W.jsx)(`span`,{className:`flex-none text-content-muted`,children:e.note}),(0,W.jsx)(Fe,{added:e.added,removed:e.removed})]})},e.path)}),e.length>Z&&(0,W.jsx)(`li`,{className:`px-3 py-1.5 text-xs text-content-muted tabular-nums`,children:(0,W.jsx)(ze,{count:e.length-Z})})]})}function ze({count:e}){let{t}=r();return(0,W.jsx)(W.Fragment,{children:t(`chat:focusSession.gitMoreFiles`,{count:e})})}var Be=600;function Ve({sessionId:e,file:t,scope:n,revision:i,view:a,onViewChange:o,footer:s}){let{t:c}=r(),l=B(e=>e.diffMode),u=B(e=>e.setDiffMode),d=(0,U.useRef)(null),[p,m]=(0,U.useState)(0);(0,U.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=()=>m(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let h=p===0||p>=Be,g=h?l:`unified`,_=h?void 0:c(`board:changes.splitTooNarrow`);return(0,W.jsxs)(`section`,{ref:d,className:`flex min-h-0 flex-1 flex-col`,"aria-label":t.path,"data-change-detail":t.path,children:[(0,W.jsxs)(`header`,{className:`flex min-h-10 shrink-0 items-center gap-2 border-b border-stroke-soft py-1.5 pr-2 pl-3`,children:[(0,W.jsx)(Le,{status:t.status}),(0,W.jsx)(`strong`,{className:`min-w-0 flex-1 truncate font-mono text-xs font-semibold text-content`,title:t.path,children:t.path}),(0,W.jsx)(Fe,{added:t.added,removed:t.removed}),(0,W.jsx)(fe,{size:`sm`,"aria-label":c(`board:changes.diffView`),title:_,"aria-description":_,value:g,onValueChange:u,options:[{value:`unified`,label:c(`board:changes.unified`)},{value:`split`,label:c(`board:changes.split`),disabled:!h}]})]}),(0,W.jsx)(f,{sessionId:e,path:t.path,scope:n,revision:i,mode:g,fill:!0,position:a?.reading?.[t.path],onReading:e=>o?.({reading:{...a?.reading,[t.path]:e}})},`${n}:${t.path}`),(0,W.jsx)(`footer`,{className:`flex min-h-10 shrink-0 flex-wrap items-center gap-1 border-t border-stroke-soft py-1 pr-1.5 pl-3 text-xs`,children:s})]})}function He({cwd:e,path:t}){let{t:n}=r();if(!window.pisperDesktop||!e)return null;let i=$(e,t);return(0,W.jsxs)(j,{type:`button`,variant:`ghost`,size:`sm`,className:`max-[650px]:h-11`,onClick:async()=>{try{await ve(i,_e),Pe(n(`common:markdownMessage.revealLocalPathOk`,{path:t}),`info`)}catch(e){Pe(e instanceof I&&e.reason===`unavailable`?n(`common:markdownMessage.revealLocalPathUnavailable`):e instanceof I&&e.reason===`timeout`?n(`common:markdownMessage.revealLocalPathTimeout`):n(`common:markdownMessage.revealLocalPathFailed`,{path:t}),`error`)}},children:[(0,W.jsx)(H,{"aria-hidden":`true`}),n(`chat:chatMessage.fileActionReveal`)]})}function Ue(e){return{path:e.path,status:e.status===`created`?`created`:e.status===`deleted`?`deleted`:`modified`,added:e.added,removed:e.removed}}function We(e,t){if(!e)return;let n=[];return e.lineEnding&&n.push(t(`chat:focusSession.fileChangesLineEnding`,{from:e.lineEnding[0].toUpperCase(),to:e.lineEnding[1].toUpperCase()})),e.bom?.[1]?n.push(t(`chat:focusSession.fileChangesBomAdded`)):e.bom&&n.push(t(`chat:focusSession.fileChangesBomRemoved`)),t(`chat:focusSession.fileChangesFormatOnly`,{detail:n.join(` · `)})}function Ge({sessionId:e,cwd:t,streaming:n,view:i,onViewChange:a,requestConfirm:o}){let{t:s,language:c}=r(),{changes:l,loading:d,running:f,snapshotRevision:p,writesDisabled:m,pendingCount:h,reversibleCount:_,displayedError:v,notice:y,runAction:b,refresh:ee}=g({sessionId:e,streaming:n,requestConfirm:o}),x=l?.files??[],te=i?.expandedFiles?.[0],S=x.find(e=>e.path===te)??x[0],ne=e=>a?.({expandedFiles:[e]}),re=(e,t)=>f?.kind===e&&f.path===t,w=n?s(`chat:focusSession.gitWaitForRunToFinish`):void 0;return(0,W.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":s(`chat:focusSession.fileChanges`),"aria-busy":d||!!f,"data-changes-scope":`session`,children:[(0,W.jsx)(`header`,{className:`flex min-h-10 shrink-0 items-center gap-1.5 border-b border-stroke-soft py-1 pr-1.5 pl-3`,children:(0,W.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-content-secondary`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:s(`board:changes.sessionSummary`,{count:l?.summary.files??0})}),l&&l.summary.files>0&&(0,W.jsx)(Fe,{added:l.summary.added,removed:l.summary.removed})]})}),v&&(0,W.jsx)(`p`,{role:`alert`,className:`shrink-0 px-3 pt-2 text-xs text-st-fail`,children:v}),y&&!v&&(0,W.jsx)(`p`,{role:`status`,className:`shrink-0 px-3 pt-2 text-xs text-content-secondary`,children:y}),d&&!l?(0,W.jsx)(P,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):x.length?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Re,{files:x.map(e=>({...Ue(e),note:e.reverted?s(`chat:focusSession.fileChangesReverted`):e.approved?s(`chat:focusSession.fileChangesApproved`):We(e.formatChange,s)})),selected:S?.path??``,label:s(`board:changes.files`),onSelect:ne}),S&&(0,W.jsx)(Ve,{sessionId:e,file:Ue(S),scope:`task`,revision:p,view:i,onViewChange:a,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:A(`mr-auto flex min-w-0 items-center gap-1.5 truncate`,S.approved?`text-st-done`:`text-content-muted`),"data-change-state":S.reverted?`reverted`:S.approved?`approved`:`pending`,children:[S.approved&&!S.reverted&&(0,W.jsx)(u,{className:`size-3.5 flex-none`,"aria-hidden":`true`}),S.reverted?s(`board:changes.revertedAt`,{time:M(S.changedAt,c)}):S.approved?s(`board:changes.approvedAt`,{time:M(S.changedAt,c)}):s(`board:changes.pendingAt`,{time:M(S.changedAt,c)})]}),S.pending&&!S.approved&&!S.reverted&&(0,W.jsxs)(j,{type:`button`,variant:`ghost`,size:`sm`,disabled:m,title:w,onClick:()=>void b({kind:`approve`,path:S.path}),children:[re(`approve`,S.path)?(0,W.jsx)(T,{className:`animate-spin`}):(0,W.jsx)(u,{}),s(`chat:focusSession.fileChangesApproveFile`)]}),(0,W.jsxs)(j,{type:`button`,variant:`ghost`,size:`sm`,disabled:m||S.reverted||!S.canRevert,title:w,onClick:()=>void b({kind:`revert`,path:S.path}),children:[re(`revert`,S.path)?(0,W.jsx)(T,{className:`animate-spin`}):(0,W.jsx)(C,{}),s(`board:changes.revertFile`)]}),(0,W.jsx)(He,{cwd:t,path:S.path})]})})]}):!v&&(0,W.jsx)(F,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}),(0,W.jsxs)(Ie,{status:f?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(T,{className:`size-3.5 flex-none animate-spin`,"aria-hidden":`true`}),f.kind===`approve`?s(`chat:focusSession.fileChangesApproveAll`):s(`board:changes.revertAll`)]}):h>0?s(`board:changes.pending`,{count:h}):null,children:[h>0&&(0,W.jsxs)(O,{disabled:m,title:w,onSelect:()=>void b({kind:`approve`}),children:[(0,W.jsx)(u,{}),s(`chat:focusSession.fileChangesApproveAll`)]}),(l?.summary.files??0)>0&&(0,W.jsxs)(O,{disabled:m||_===0,title:w??s(`chat:focusSession.fileChangesRevertAllDescription`),onSelect:()=>void b({kind:`revert`}),children:[(0,W.jsx)(C,{}),s(`board:changes.revertAll`)]}),(h>0||(l?.summary.files??0)>0)&&(0,W.jsx)(D,{}),(0,W.jsxs)(O,{disabled:d||!!f,onSelect:ee,children:[(0,W.jsx)(T,{}),s(`chat:focusSession.gitRefresh`)]})]})]})}function Ke({sessionId:e,cwd:t,streaming:n,view:a,onViewChange:o}){let{t:s}=r(),c=i({queryKey:[`task-project-changes`,e,t,n],queryFn:({signal:t})=>pe.getVcsChanges(e,{signal:t})}),l=(0,U.useMemo)(()=>S(c.data?.diff||``,c.data?.files.map(e=>e.path)||[],c.data?.diffTruncated),[c.data]),u=c.error?.message||c.data?.error,d=(c.data?.files||[]).map(e=>({path:e.path,status:je(e.status),added:Object.hasOwn(l.files,e.path)?l.files[e.path].added:null,removed:Object.hasOwn(l.files,e.path)?l.files[e.path].removed:null})),f=a?.expandedFiles?.[0],p=d.find(e=>e.path===f)??d[0];return(0,W.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":s(`chat:workbench.projectChanges`),"aria-busy":c.isFetching,"data-changes-scope":`workspace`,children:[(0,W.jsxs)(`header`,{className:`flex min-h-10 shrink-0 items-center gap-1.5 border-b border-stroke-soft py-1 pr-1.5 pl-3`,children:[(0,W.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-content-secondary`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:s(`board:changes.workspaceSummary`,{count:d.length})}),c.data?.isRepo&&!u&&d.length>0&&(0,W.jsx)(Fe,{added:l.added,removed:l.removed})]}),c.data?.branch&&(0,W.jsxs)(`span`,{className:`inline-flex h-5.5 max-w-[40%] min-w-0 flex-none items-center gap-1 rounded-xs border border-stroke px-1.5 font-mono text-xs text-content-secondary`,title:t,children:[(0,W.jsx)(ne,{size:12,className:`flex-none`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`truncate`,children:c.data.branch})]})]}),c.isPending?(0,W.jsx)(P,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):u?(0,W.jsx)(`p`,{role:`alert`,className:`p-3 text-xs text-st-fail`,children:u}):c.data?.isRepo?d.length?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Re,{files:d,selected:p?.path??``,label:s(`board:changes.files`),onSelect:e=>o?.({expandedFiles:[e]})}),p&&(0,W.jsx)(Ve,{sessionId:e,file:p,scope:`project`,revision:c.dataUpdatedAt,view:a,onViewChange:o,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`mr-auto min-w-0 truncate font-mono text-content-muted`,title:t,children:t}),(0,W.jsx)(He,{cwd:t,path:p.path})]})})]}):(0,W.jsx)(F,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}):(0,W.jsx)(F,{compact:!0,title:s(`chat:workbench.notRepository`)}),(0,W.jsx)(Ie,{status:c.isFetching?(0,W.jsx)(T,{className:`size-3.5 flex-none animate-spin`,"aria-hidden":`true`}):null,children:(0,W.jsxs)(O,{disabled:c.isFetching,onSelect:()=>void c.refetch(),children:[(0,W.jsx)(T,{}),s(`chat:focusSession.gitRefresh`)]})})]})}function qe({sessionId:e,cwd:t,streaming:n,scope:i,onScopeChange:a,vcsAvailable:o,view:s,onViewChange:c,requestConfirm:l}){let{t:u}=r();return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-inspector-changes":i,children:[(0,W.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:(0,W.jsx)(fe,{size:`sm`,"aria-label":u(`board:inspector.changesScope`),value:i,onValueChange:a,options:[{value:`session`,label:u(`board:inspector.scopeSession`)},{value:`workspace`,label:u(`board:inspector.scopeWorkspace`),disabled:!o}]})}),s?i===`workspace`?(0,W.jsx)(Ke,{sessionId:e,cwd:t,streaming:n,view:s,onViewChange:c}):(0,W.jsx)(Ge,{sessionId:e,cwd:t,streaming:n,view:s,onViewChange:c,requestConfirm:l}):(0,W.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-content-muted`,children:u(`chat:focusSession.gitLoading`)})]})}var Je=new Set([`changes`,`terminal`,`files`]),Ye=[];function Xe(e,t,n){return e===`changes`?n===`workspace`?`changes`:`files`:e===`terminal`?t:e===`files`?`sources`:e===`preview`?`browser`:e===`side-chat`?`side-chat`:null}function Ze({panelId:e,sessionId:t,cwd:n,streaming:s,plan:l,goal:u,team:f,activity:m,planTab:g,sources:v,mode:y,requestConfirm:ee,onClose:S,onOpenComponents:ne,componentTabs:C,autoFocus:T=!1,remoteMachine:E=!1}){let{t:D}=r(),O=y===`sheet`,se=be(),ce=o(e=>e.capabilities),k=!!se&&a(ce,`terminal`),pe=a(ce,`vcs`),M=B(e=>e.tab),N=B(e=>e.setTab),me=B(e=>e.terminalView),he=B(e=>e.setTerminalView),P=B(e=>e.changesView),_e=B(e=>e.setChangesView),I=R(e=>e.sessions[t]?.pages)??Ye,ve=I.some(e=>e.kind===`side-chat`),ye=E?`running`:`changes`,L=M===`side-chat`&&!ve||M===`plan`&&!g||E&&Je.has(M)?ye:M,z=Xe(L,me,P),V=z?I.find(e=>e.kind===z):void 0,H=!O&&C?C.tabs(n):[],[G,K]=(0,U.useState)(null),[q,J]=(0,U.useState)(!1),Y=H.some(e=>e.id===G)?G:null;(0,U.useEffect)(()=>K(null),[M]);let we=(0,U.useRef)(null);(0,U.useEffect)(()=>{we.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[L,Y]);let Te=(0,U.useRef)(T);(0,U.useEffect)(()=>{if(!Te.current)return;let e=requestAnimationFrame(()=>we.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]),(0,U.useEffect)(()=>{if(!z||V||(z===`terminal`||z===`processes`)&&!k)return;let e=R.getState(),n=e.sessions[t]?.contentOpen??!1;e.update(t,z,{type:`add`,kind:z}),n||e.update(t,z,{type:`workspace`,contentOpen:!1})},[z,V,t,k]);let Ee=i({queryKey:[`session-change-summary`,t,s],queryFn:()=>ge(t),staleTime:1e4}),X=Ee.data?.status===`known`?Ee.data.changedFiles??0:0,De=Se(m,s),Oe=[...E?[]:[{id:`changes`,icon:x,label:X>0?D(`board:inspector.changesCount`,{count:X}):D(`board:inspector.changes`)},{id:`terminal`,icon:ae,label:D(`board:inspector.terminal`)}],{id:`running`,icon:c,label:De?D(`board:inspector.runningCount`,{count:De}):D(`board:inspector.running`)},...E?[]:[{id:`files`,icon:te,label:D(`board:inspector.files`)}],{id:`preview`,icon:b,label:D(`board:inspector.preview`)},...g?[{id:`plan`,icon:re,label:D(`board:inspector.plan`)}]:[],...ve?[{id:`side-chat`,icon:w,label:D(`board:inspector.sideChat`)}]:[]],Z=e=>{V&&R.getState().update(t,V.kind,{type:`view`,id:V.id,patch:e})},je=()=>{let n=I.find(e=>e.kind===`side-chat`);if(n&&R.getState().update(t,`side-chat`,{type:`close`,id:n.id}),N(`changes`),O){S();return}requestAnimationFrame(()=>document.getElementById(`${e}-changes-tab`)?.focus())},Q=t=>`${e}-component-${t}-tab`,Me=e=>{K(null),N(e)},Ne=t=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(t.key))return;t.preventDefault();let n=[...Oe.map(t=>({fixed:t.id,id:`${e}-${t.id}-tab`})),...H.map(e=>({component:e.id,id:Q(e.id)}))],r=n.findIndex(e=>Y?e.component===Y:e.fixed===L),i=n[t.key===`Home`?0:t.key===`End`?n.length-1:(r+(t.key===`ArrowRight`?1:-1)+n.length)%n.length];i.component?K(i.component):i.fixed&&Me(i.fixed),requestAnimationFrame(()=>document.getElementById(i.id)?.focus())},$=(0,W.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-content-muted`,children:D(`chat:focusSession.gitLoading`)}),Pe;return Pe=Y&&C?C.render(Y,{sessionId:t,cwd:n}):L===`changes`?(0,W.jsx)(qe,{sessionId:t,cwd:n,streaming:s,scope:P,onScopeChange:_e,vcsAvailable:pe,view:V?.view,onViewChange:V?Z:void 0,requestConfirm:ee}):L===`terminal`?k?(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:(0,W.jsx)(fe,{size:`sm`,"aria-label":D(`board:inspector.terminalScope`),value:me,onValueChange:he,options:[{value:`terminal`,label:D(`board:inspector.terminal`)},{value:`processes`,label:D(`board:inspector.processes`)}]})}),(0,W.jsx)(U.Suspense,{fallback:$,children:V?me===`processes`?(0,W.jsx)(p,{sessionId:t,view:V.view,onViewChange:Z,onOpenTerminal:e=>{let n=R.getState(),r=n.sessions[t]?.pages.find(e=>e.kind===`terminal`);r?n.update(t,`terminal`,{type:`resource`,id:r.id,resourceId:e}):n.update(t,`terminal`,{type:`open`,kind:`terminal`,resourceId:e}),he(`terminal`)}}):(0,W.jsx)(d,{sessionId:t,cwd:n,terminalId:V.resourceId||void 0,onCreated:e=>R.getState().update(t,`terminal`,{type:`resource`,id:V.id,resourceId:e})},V.id):$})]}):(0,W.jsx)(F,{compact:!0,icon:ae,title:D(`board:inspector.terminalUnavailable`)}):L===`files`?V?(0,W.jsx)(_,{sources:v,view:V.view,onViewChange:Z}):$:L===`preview`?V?(0,W.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-inspector-preview":!0,children:(0,W.jsx)(Ae,{panelId:e,sessionId:t},t)}):$:L===`plan`?(0,W.jsx)(ke,{plan:l,streaming:s,goal:u,team:f,activity:m}):L===`running`?(0,W.jsx)(Ce,{sessionId:t,streaming:s,activity:m}):(0,W.jsx)(h,{parentId:t,active:!0}),(0,W.jsxs)(`section`,{id:e,"aria-label":D(`board:inspector.label`),"data-session-inspector":y,"data-inspector-tab":L,"data-inspector-component":Y??void 0,className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-panel text-content`,children:[(0,W.jsxs)(`header`,{className:A(`flex shrink-0 items-center gap-1 border-b border-stroke-soft pr-1.5 pl-2`,O?`h-[52px]`:y===`aside`?`h-[52px] [[data-custom-titlebar]_&]:h-11 [[data-custom-titlebar]_&]:pointer-coarse:h-[52px]`:`h-11 pointer-coarse:h-[52px]`),children:[(0,W.jsxs)(`div`,{ref:we,role:`tablist`,"aria-label":D(`board:inspector.tabs`),className:`flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]`,onKeyDown:Ne,children:[Oe.map(({id:t,icon:n,label:r})=>{let i=!Y&&t===L;return(0,W.jsxs)(`button`,{id:`${e}-${t}-tab`,type:`button`,role:`tab`,"aria-selected":i,"aria-controls":`${e}-body`,tabIndex:i?0:-1,"data-inspector-tab-id":t,className:A(`flex flex-none items-center gap-1.5 rounded-sm px-2 text-[13px] whitespace-nowrap transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,O?`h-11 min-w-11 justify-center px-2.5`:`h-8 pointer-coarse:h-11 pointer-coarse:min-w-11`,i?`bg-solid font-medium text-content shadow-edge ring-1 ring-stroke-strong ring-inset`:`text-content-secondary hover:bg-surface-hover hover:text-content`),onClick:()=>Me(t),children:[!O&&(0,W.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),r]},t)}),!Y&&L===`side-chat`&&(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:A(O&&`size-11`),"aria-label":D(`board:inspector.closeTab`,{tab:D(`board:inspector.sideChat`)}),onClick:je,children:(0,W.jsx)(oe,{"aria-hidden":`true`})}),!O&&(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1 h-4 w-px flex-none bg-stroke`}),H.map(({id:t,label:n})=>{let r=t===Y;return(0,W.jsx)(`button`,{id:Q(t),type:`button`,role:`tab`,"aria-selected":r,"aria-controls":`${e}-body`,tabIndex:r?0:-1,"data-inspector-component-tab":t,className:A(`flex h-8 max-w-40 flex-none items-center rounded-sm px-2 text-[13px] whitespace-nowrap transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11 pointer-coarse:min-w-11`,r?`bg-solid font-medium text-content shadow-edge ring-1 ring-stroke-strong ring-inset`:`text-content-secondary hover:bg-surface-hover hover:text-content`),onClick:()=>K(t),children:(0,W.jsx)(`span`,{className:`truncate`,children:n})},t)})]}),!O&&(0,W.jsxs)(de,{open:q,onOpenChange:J,children:[(0,W.jsx)(le,{asChild:!0,children:(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,"aria-label":D(`board:inspector.add`),title:D(`board:inspector.add`),"data-inspector-component-add":!0,children:(0,W.jsx)(ie,{"aria-hidden":`true`})})}),(0,W.jsxs)(ue,{align:`end`,className:`w-64 text-xs`,children:[C?.addMenu?C.addMenu({cwd:n,onAdded:e=>{K(e),J(!1)}}):(0,W.jsx)(`p`,{className:`text-content-secondary`,children:D(`board:inspector.addHint`)}),ne&&(0,W.jsx)(j,{type:`button`,variant:`secondary`,size:`sm`,className:`self-start`,onClick:ne,children:D(`board:inspector.openComponents`)})]})]}),(0,W.jsx)(j,{type:`button`,variant:`ghost`,size:`icon-sm`,className:A(`flex-none`,O&&`size-11`),"aria-label":D(`board:inspector.close`),title:D(`board:inspector.close`),"aria-controls":e,onClick:S,children:y===`aside`?(0,W.jsx)(xe,{"aria-hidden":`true`}):(0,W.jsx)(oe,{"aria-hidden":`true`})})]}),(0,W.jsx)(`div`,{id:`${e}-body`,role:`tabpanel`,"aria-labelledby":Y?Q(Y):`${e}-${L}-tab`,className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:Pe})]})}export{Ze as SessionInspector};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={zh:{"page.title":`全部代理`,"page.summary":`{agents} 个代理 · {projects} 个项目 · {running} 个在运行`,"page.loading":`正在读取代理…`,"page.error":`暂时无法读取会话`,"page.errorHint":`检查本机运行时是否在线,然后重试。`,"page.retry":`重试`,"lane.attention":`需要你`,"lane.running":`运行中`,"lane.queued":`排队`,"lane.done":`已完成`,"lane.orderAttention":`按等待时长`,"lane.orderRunning":`按开始时间`,"lane.orderQueued":`按队列顺序`,"lane.orderDone":`最新的在前`,"lane.history":`全部历史会话`,"status.approval":`等待批准`,"status.failed":`失败`,"status.failedHandled":`失败 · 已查看`,"status.running":`运行中`,"status.queued":`排队中`,"status.done":`已完成`,"status.stopped":`已停止`,"filter.projects":`项目`,"filter.allProjects":`全部项目`,"filter.projectsTitle":`项目:{projects}`,"filter.listSeparator":`、`,"filter.statuses":`状态`,"filter.statusTitle":`状态:{statuses}`,"filter.noProject":`无项目`,"filter.emptyTitle":`筛选后没有卡片`,"filter.emptyHint":`换一个项目或状态,或者清除筛选。`,"filter.clear":`清除筛选`,"group.label":`分组方式`,"group.lane":`按状态`,"group.project":`按项目`,"card.label":`{title},{status}`,"card.more":`“{title}”的更多操作`,"card.pinned":`已置顶`,"card.standard":`常规操作`,"card.critical":`高风险`,"card.criticalWithReason":`高风险 · {reason}`,"card.approvalLoading":`正在读取审批详情…`,"card.approvalUnavailable":`暂时读不到审批详情,请在会话里查看。`,"card.moreApprovals":`还有 {count} 条审批等你处理`,"card.moreApprovalsCritical":`还有 {count} 条审批等你处理,其中有高风险`,"card.deny":`拒绝`,"card.approve":`允许`,"card.approveCritical":`允许…`,"card.retry":`重试`,"card.archive":`归档`,"card.files":`{count} 个文件`,"card.expand":`展开完整命令`,"card.expandArgs":`展开完整参数`,"card.collapse":`收起`,"card.subAgent":`子代理`,"card.subAgentProgress":`子代理 {running} 个运行中,共 {total} 个`,"activity.starting":`启动中`,"activity.thinking":`思考中`,"activity.responding":`回复中`,"activity.working":`处理中`,"activity.compacting":`压缩上下文中`,"menu.open":`打开会话`,"menu.pin":`置顶`,"menu.unpin":`取消置顶`,"menu.markHandled":`标记已处理`,"menu.copyLink":`复制会话链接`,"menu.archive":`归档`,"action.failed":`操作没有完成,请稍后重试。`,"action.archived":`已归档:{title}`,"action.copied":`已复制会话链接`,"action.copyFailed":`无法复制链接`,"confirm.title":`确认高风险操作`,"confirm.titleStandard":`确认批准`,"confirm.description":`这条审批被命令守卫标记为高风险,批准前请核对完整参数。`,"confirm.descriptionCritical":`这是高风险操作(例如安装全局插件或提交表单),批准前请核对完整参数。`,"confirm.descriptionStandard":`批准前请核对完整参数。`,"confirm.descriptionLoading":`正在读取审批详情…`,"confirm.session":`会话`,"confirm.tool":`工具`,"confirm.cwd":`工作目录`,"confirm.fullArgs":`完整参数`,"confirm.loading":`正在读取审批详情,读取完成前不能批准。`,"confirm.hint":`按住确认按钮 0.6 秒,或按`,"confirm.hintTouch":`按住确认按钮 0.6 秒`,"confirm.hold":`按住确认`,"confirm.approving":`正在批准…`,"confirm.cancel":`取消`,"triage.progress":`逐个处理 {index}/{total}`,"triage.approve":`允许`,"triage.deny":`拒绝`,"triage.retry":`重试`,"triage.open":`打开`,"triage.exit":`退出`,"triage.finished":`全部处理完`,"triage.nothing":`没有需要你处理的事项`,"announce.moved":`{title} 进入 {lane}`,"launch.projects":`最近的项目`,"launch.projectLabel":`项目:{project}`,"launch.defaultProject":`默认目录`,"launch.noProject":`不选项目`,"launch.chooseFolder":`选择文件夹…`,"launch.newFolder":`新建文件夹…`,"project.actionsFor":`{project} 的操作`,"project.new":`新建项目…`,"folder.title":`新建文件夹`,"folder.description":`在所选位置新建一个空文件夹,并把它作为这次任务的项目。`,"folder.parent":`位置`,"folder.parentPlaceholder":`绝对路径;留空则使用默认工作目录`,"folder.browse":`浏览…`,"folder.browseTitle":`选择新文件夹的位置`,"folder.browseUnavailable":`这台设备无法打开系统文件管理器,请直接填写位置的路径。`,"folder.name":`名称`,"folder.namePlaceholder":`例如 my-project`,"folder.preview":`将新建:{path}`,"folder.create":`新建`,"folder.creating":`正在新建…`,"folder.error.nameRequired":`请填写文件夹名称。`,"folder.error.nameInvalid":`名称不能包含 / \\ : * ? " < > | 等字符,也不能以点或空格结尾。`,"folder.error.parentMissing":`位置不存在或不是文件夹。`,"folder.error.existsAsFile":`这个位置已经有一个同名的文件。`,"folder.error.permission":`没有权限在这个位置新建文件夹。`,"folder.error.failed":`新建文件夹失败。`,"folder.error.failedWithReason":`新建文件夹失败:{reason}`,"project.manage":`管理项目…`,"project.newTaskHere":`在此项目新建任务`,"project.rename":`重命名…`,"project.resetName":`恢复目录名`,"project.delete":`删除项目…`,"project.remove":`移除项目`,"project.chosen":`已选择项目「{project}」,描述第一个任务即可派发`,"project.pickerDescription":`选择项目所在的文件夹,它会成为启动台的派发目标。`,"project.renameDescription":`自定义全部代理与派发对话框里显示的项目名称,工作目录保持不变。`,"project.manageTitle":`管理项目`,"project.manageDescription":`调整项目的显示顺序与名称。还没有会话的项目可以直接移除,不影响目录与文件;有会话的项目删除时会连同其中的全部会话一起删除。`,"project.sessions":`{count} 个会话`,"project.folderName":`目录名:{name}`,"project.moveUp":`上移 {project}`,"project.moveDown":`下移 {project}`,"project.renameNamed":`重命名 {project}`,"project.resetNamed":`{project} 恢复目录名`,"project.deleteWithChatsNamed":`连同会话一起删除 {project}`,"project.removeNamed":`移除项目 {project}`,"project.listLabel":`项目列表`,"project.empty":`还没有项目`,"project.emptyHint":`新建项目后,在启动台描述第一个任务即可派发。`,"project.loading":`正在读取项目…`,"project.error":`读取项目失败`,"project.deleting":`正在删除…`,"project.done":`完成`,"phone.running":`运行中 {elapsed}`,"phone.changes":`+{count} 改动`,"phone.changesLabel":`查看本会话的 {count} 个改动`,"phone.openInspector":`改动、终端、文件与预览`,"phone.inspectorDescription":`本会话的改动、终端、资料来源与网页预览`,"phone.earlierTurns":`展开更早的对话:{summary}`,"phone.previousTurn":`上一轮`,"session.moveWorkspace":`移动工作区…`,"session.workflowRuns":`工作流运行记录`,"session.workflowRunsEmpty":`这个会话还没有工作流运行记录`,"session.plan":`计划 {done}/{total}`,"session.planLabel":`计划进度:已完成 {done} 项,共 {total} 项`,"session.titleMenu":`{title}:会话操作`,"session.tree":`会话树`,"session.treeBranches":`会话树:{count} 个分支`,"session.changedFiles":`{count} 个文件`,"session.changes":`{count} 个文件 +{added} −{removed}`,"session.contextUsage":`上下文已用 {percent}%`,"session.withShortcut":`{label}({shortcut})`,"session.planOpen":`{plan}:在检查器里查看`,"inspector.label":`检查器`,"inspector.tabs":`检查器标签`,"inspector.changes":`改动`,"inspector.changesCount":`改动 {count}`,"inspector.changesScope":`改动范围`,"inspector.scopeSession":`本会话`,"inspector.scopeWorkspace":`工作区`,"inspector.terminal":`终端`,"inspector.terminalScope":`终端视图`,"inspector.processes":`进程`,"inspector.terminalUnavailable":`这台设备或当前运行时不提供终端`,"inspector.files":`文件`,"inspector.preview":`预览`,"inspector.plan":`计划`,"inspector.sideChat":`侧聊`,"inspector.closeTab":`关闭“{tab}”`,"inspector.add":`添加组件标签`,"inspector.addHint":`组件放到“会话面板”位置后,会作为标签出现在这里。`,"inspector.openComponents":`打开组件页`,"inspector.close":`收起检查器`,"transcript.operations":`{count} 个操作`,"transcript.running":`{count} 运行中`,"transcript.failed":`{count} 失败`,"transcript.turn":`第 {count} 轮`,"composer.placeholder":`回复代理,或用 / 调用命令`,"composer.tokens":`{tokens} tok`,"composer.queuedFollowUp":`本轮后`,"composer.queuedSteer":`排队`,"composer.steerNow":`立即发送`,"composer.steerHint":`打断当前这一步,代理马上读到`,"composer.longPressSteer":`运行中长按立即发送`,"changes.sessionSummary":`本会话改动 {count} 个文件`,"changes.workspaceSummary":`工作区改动 {count} 个文件`,"changes.revertAll":`全部还原`,"changes.more":`更多改动操作`,"changes.pending":`{count} 个待批准`,"changes.revertFile":`还原此文件`,"changes.files":`改动的文件`,"changes.diffView":`差异视图`,"changes.unified":`统一`,"changes.split":`并排`,"changes.splitTooNarrow":`检查器不足 600 像素宽,放不下并排视图;把检查器拖宽后可用。`,"changes.approvedAt":`已批准写入 · {time}`,"changes.pendingAt":`待批准 · {time}`,"changes.revertedAt":`已还原 · {time}`,"changes.statusModified":`已修改`,"changes.statusCreated":`新建`,"changes.statusDeleted":`已删除`,"changes.statusRenamed":`已重命名`,"inspector.goal":`目标`,"inspector.team":`团队`,"inspector.subAgents":`子代理`,"shortcuts.agentPanel":`聚焦侧栏会话列表`,"shortcuts.toggleInspector":`显示 / 隐藏检查器`,"shortcuts.previousAgent":`按侧栏顺序切换到上一个会话`,"shortcuts.nextAgent":`按侧栏顺序切换到下一个会话`,"shortcuts.steerMessage":`运行中立即发送`,"shortcuts.shortcutHelp":`快捷键速查`,"shortcuts.sendMessage":`发送(运行中排队)`,"shortcuts.focusSearch":`聚焦筛选 / 搜索`,"shortcuts.groupGlobal":`全局`,"shortcuts.groupBoard":`全部代理`,"shortcuts.groupSession":`会话`,"shortcuts.globalHint":`带修饰键的组合在输入框内同样生效。`,"shortcuts.boardHint":`只在全部代理页生效;单字母键在焦点不在输入框时生效,只能改成不带修饰键的字母。`,"shortcuts.sessionHint":`只在会话页生效;Esc 永远不用于返回。`,"shortcuts.fixed":`固定`,"shortcuts.boardMove":`在代理之间移动(焦点在行上)`,"shortcuts.boardOpen":`打开会话`,"shortcuts.boardExitTriage":`退出逐个处理`,"shortcuts.newline":`换行`,"shortcuts.stopRun":`停止运行(有打开的浮层时先关闭浮层)`,"shortcuts.helpDescription":`当前设备上的绑定。改绑后这里立即更新。`,"shortcuts.helpCustomize":`在设置中改绑`,"home.draftTitle":`新任务`,"home.draftSubtitle":`发出第一条消息时才会创建会话`,"home.draftHint":`选好项目,描述要做的事。发出第一条消息后,这里就是它的会话;其他代理都在“全部代理”里。`,"home.loading":`正在打开上次的会话…`,"home.loadFailed":`无法读取会话列表`,"home.loadFailedHint":`暂时无法确认上次停留的会话。可以重试,或直接开始一个新任务。`,"home.startDraft":`开始新任务`,"home.goHome":`回到主页`,"shortcuts.openSession":`打开会话主页`,"shortcuts.sessionTree":`会话树(分支与标记)`,"shortcuts.sideChat":`侧聊`,"shortcuts.cycleFocusRegion":`在侧栏、顶栏、对话、输入框之间切换焦点`,"shortcuts.groupSidebar":`侧栏`,"shortcuts.sidebarHint":`焦点在侧栏会话行上时生效;A / D 跟随“全部代理”的允许 / 拒绝键,只处理普通批准。`,"shortcuts.sidebarMove":`在会话行之间移动`,"shortcuts.sidebarOpen":`打开会话`,"sidebar.reason.failed":`运行失败`,"sidebar.reason.approval":`等你批准`,"sidebar.reason.criticalApproval":`高风险批准`,"sidebar.reason.question":`等你回答`,"sidebar.reason.questions":`等你回答 · {count} 个问题`,"sidebar.reason.questionCount":`{count} 个问题`,"sidebar.group.attention":`需要你`,"sidebar.group.running":`运行中`,"sidebar.group.queued":`排队`,"sidebar.group.pinned":`置顶`,"sidebar.group.done":`今天完成`,"sidebar.loading":`正在加载会话`,"sidebar.error":`会话列表加载失败`,"sidebar.retry":`重试`,"sidebar.empty":`还没有代理在运行。用“新任务”派出第一个。`,"sidebar.emptyAttention":`没有等你处理的事`,"sidebar.emptyRunning":`没有在运行的代理`,"sidebar.moreRunning":`还有 {count} 个 →`,"sidebar.allDone":`全部 →`,"sidebar.history":`历史会话`,"sidebar.group.recent":`最近`,"sidebar.emptyRecent":`还没有会话`,"sidebar.allChats":`全部会话`,"sidebar.announce":`{title} 需要你:{reason}`,"sidebar.announceSeparator":`;`,"sidebar.attentionRow":`{title},{reason},已等 {wait}`,"sidebar.attentionRowNoWait":`{title},{reason}`,"sidebar.unread":`未读`,"sidebar.deny":`拒绝`,"sidebar.approve":`允许`,"sidebar.open":`打开`,"sidebar.denyNamed":`拒绝 {title} 的请求`,"sidebar.approveNamed":`允许 {title} 的请求`,"sidebar.openNamed":`打开 {title} 处理`,"sidebar.rowMenu":`{title} 的更多操作`,"sidebar.renameTitle":`重命名会话`,"sidebar.renameLabel":`会话标题`,"sidebar.renameSave":`保存`,"sidebar.renamed":`会话标题已更新`,"sidebar.railAttention":`{count} 个代理需要你,打开全部代理`,"sidebar.railRunning":`{count} 个代理运行中,打开全部代理`,"sidebar.filter.all":`全部`,"sidebar.filter.projectActions":`项目操作`,"sidebar.filter.addProject":`添加项目…`,"sidebar.filter.noProjects":`还没有项目`,"sidebar.fleet.attention":`{count} 个需要你`,"sidebar.fleet.running":`{count} 个运行中`,"sidebar.fleet.label":`{attention} 个代理需要你,{running} 个运行中,打开全部代理`,"menu.rename":`重命名`,"composer.placeholderRunning":`运行中:{queue} 排队,{steer} 立即发送`,"composer.placeholderRunningQueueOnly":`运行中:{queue} 排队`,"composer.placeholderRunningTouch":`运行中:点发送排队,长按立即发送`,"composer.sendQueuedNow":`立即发送这条排队消息`,"composer.editQueued":`编辑排队消息`,"composer.cancelQueued":`取消排队`,"composer.plusMenu":`添加附件、技能或语音输入`,"composer.modeChip":`审批与执行方式`,"composer.goalShort":`Goal`,"composer.teamShort":`Team`,"composer.cycleRunMode":`切换`,"composer.contextUsage":`上下文`,"composer.sessionTokens":`本会话`,"composer.cacheHitLabel":`缓存命中`,"transcript.allDone":`全部完成`,"transcript.copyMarkdown":`复制为 Markdown`,"card.holdToApprove":`按住允许`,"card.holdHint":`高风险操作需按住 0.6 秒`,"card.moreWaiting":`还有 {count} 项等你处理`,"shortcuts.cycleRunMode":`切换执行方式(Plan / Goal / Team)`,"project.moveUpShort":`上移`,"project.moveDownShort":`下移`,"triage.answer":`回答`,"overview.doneUnread":`已完成 · 未读`,"overview.waited":`已等 {wait}`,"overview.ran":`已运行 {time}`,"overview.finishedAt":`{time} 完成`,"overview.openToHandle":`打开处理`,"overview.log":`日志`,"overview.retryNamed":`重试 {title}`,"overview.subAgents":`子代理 {running}/{total}`,"overview.startNow":`立即开始`,"overview.queuedAfter":`排在「{title}」之后`,"overview.queuedAfterUnknown":`等前一个任务结束`,"overview.queuePosition":`第 {n} 位`,"overview.empty":`还没有代理在运行`,"overview.newTask":`新任务`,"overview.widgets":`已放置的组件`,"overview.subAgentSlots":`子代理 {running}/{max}`,"overview.todayTokens":`今日 {tokens} tok`,"overview.memory":`内存 {memory}`,"overview.systemLoading":`正在读取系统信息…`,"overview.systemUnavailable":`暂时读不到系统信息`,"overview.projectAttention":`{count} 个需要你`,"overview.projectRunning":`{count} 个运行中`,"overview.projectQueued":`{count} 个排队`,"overview.projectDone":`{count} 个今天完成`,"question.title":`代理在问你`,"question.label":`代理的提问`,"question.waiting":`还有 {count} 个提问等你回答`,"question.moreAfter":`之后还有 {count} 个`,"question.failed":`没能提交回答,请再试一次(可能已经在别处回答过)`,"question.other":`其他…`,"question.otherLabel":`其他回答:{question}`,"question.otherPlaceholder":`写下你的回答`,"question.skip":`跳过`,"question.submit":`提交`,"question.answerNamed":`回答“{title}”:{option}`,"composer.plusSheetTitle":`添加`,"composer.attachmentShort":`附件`,"composer.voiceInput":`语音输入`,"composer.planShort":`Plan`,"phone.openInspectorShort":`改动与文件`,"inspector.running":`运行中`,"inspector.runningCount":`运行中 {count}`,"inspector.runningStatus":`运行中`,"inspector.runningQueued":`排队中`,"inspector.runningTool":`工具`,"inspector.runningAgent":`子代理`,"inspector.runningEmpty":`这个会话现在没有在运行的命令或子代理`,"inspector.runningHint":`列出代理正在执行的命令和工具、子代理,以及本任务的终端。命令自己转到后台的进程(如 nohup、&)不在其中。`,"launch.machines":`远程机器`,"launch.addMachine":`添加远程机器…`,"machine.folderTitle":`在 {name} 上工作`,"machine.folderDescription":`Agent 的文件和命令工具会在这台机器上运行。`,"machine.folderLabel":`对方机器上的目录`,"machine.folderHint":`留空就是家目录。`,"machine.folderInRoots":`只能选这些目录里的位置:{roots}`,"machine.confirm":`使用这个目录`,"machine.checking":`正在连接…`,"machine.cancel":`取消`,"composer.context.system":`系统提示词`,"composer.context.project":`项目说明`,"composer.context.skills":`技能列表`,"composer.context.tools":`内置工具`,"composer.context.mcp":`MCP 工具`,"composer.context.messages":`对话消息`,"composer.context.toolResults":`工具调用与结果`,"composer.context.free":`剩余 {tokens}`,"composer.context.estimated":`总量来自模型,各部分为估算。`,"composer.context.allEstimated":`模型还没返回用量,都是估算。`,"composer.context.prefixUnknown":`系统提示词和工具要等会话运行后才能统计。`,"composer.context.compactAt":`到 {percent}% 自动压缩`,"composer.context.deferred":`{count} 个待用,用到才占上下文`,"composer.context.callCount":`{count} 次调用`,"composer.context.composition":`占用构成`,"composer.context.toolCount":`{count} 个工具`},en:{"page.title":`All agents`,"page.summary":`{agents} agents · {projects} projects · {running} running`,"page.loading":`Loading agents…`,"page.error":`Sessions could not be loaded`,"page.errorHint":`Check that the local runtime is online, then retry.`,"page.retry":`Retry`,"lane.attention":`Needs you`,"lane.running":`Running`,"lane.queued":`Queued`,"lane.done":`Done`,"lane.orderAttention":`Longest wait first`,"lane.orderRunning":`By start time`,"lane.orderQueued":`Queue order`,"lane.orderDone":`Newest first`,"lane.history":`All sessions`,"status.approval":`Awaiting approval`,"status.failed":`Failed`,"status.failedHandled":`Failed · seen`,"status.running":`Running`,"status.queued":`Queued`,"status.done":`Done`,"status.stopped":`Stopped`,"filter.projects":`Projects`,"filter.allProjects":`All projects`,"filter.projectsTitle":`Project: {projects}`,"filter.listSeparator":`, `,"filter.statuses":`Status`,"filter.statusTitle":`Status: {statuses}`,"filter.noProject":`No project`,"filter.emptyTitle":`No cards match these filters`,"filter.emptyHint":`Pick another project or status, or clear the filters.`,"filter.clear":`Clear filters`,"group.label":`Group by`,"group.lane":`By status`,"group.project":`By project`,"card.label":`{title}, {status}`,"card.more":`More actions for “{title}”`,"card.pinned":`Pinned`,"card.standard":`Routine`,"card.critical":`High risk`,"card.criticalWithReason":`High risk · {reason}`,"card.approvalLoading":`Loading approval details…`,"card.approvalUnavailable":`Approval details are unavailable; check them in the session.`,"card.moreApprovals":`{count} more approvals waiting`,"card.moreApprovalsCritical":`{count} more approvals waiting, including high-risk ones`,"card.deny":`Deny`,"card.approve":`Allow`,"card.approveCritical":`Allow…`,"card.retry":`Retry`,"card.archive":`Archive`,"card.files":`{count} files`,"card.expand":`Show full command`,"card.expandArgs":`Show all arguments`,"card.collapse":`Collapse`,"card.subAgent":`Sub-agent`,"card.subAgentProgress":`Sub-agents: {running} of {total} running`,"activity.starting":`Starting`,"activity.thinking":`Thinking`,"activity.responding":`Responding`,"activity.working":`Working`,"activity.compacting":`Compacting context`,"menu.open":`Open session`,"menu.pin":`Pin`,"menu.unpin":`Unpin`,"menu.markHandled":`Mark as handled`,"menu.copyLink":`Copy session link`,"menu.archive":`Archive`,"action.failed":`That didn't go through. Try again shortly.`,"action.archived":`Archived: {title}`,"action.copied":`Session link copied`,"action.copyFailed":`Couldn't copy the link`,"confirm.title":`Confirm high-risk action`,"confirm.titleStandard":`Confirm approval`,"confirm.description":`The command guard flagged this approval as high risk. Check the full arguments before allowing it.`,"confirm.descriptionCritical":`This is a high-risk action, such as installing a global plugin or submitting a form. Check the full arguments before allowing it.`,"confirm.descriptionStandard":`Check the full arguments before allowing it.`,"confirm.descriptionLoading":`Loading approval details…`,"confirm.session":`Session`,"confirm.tool":`Tool`,"confirm.cwd":`Working folder`,"confirm.fullArgs":`Full arguments`,"confirm.loading":`Loading approval details. You can allow it once they arrive.`,"confirm.hint":`Hold the confirm button for 0.6 s, or press`,"confirm.hintTouch":`Hold the confirm button for 0.6 s`,"confirm.hold":`Hold to confirm`,"confirm.approving":`Allowing…`,"confirm.cancel":`Cancel`,"triage.progress":`Triage {index}/{total}`,"triage.approve":`Allow`,"triage.deny":`Deny`,"triage.retry":`Retry`,"triage.open":`Open`,"triage.exit":`Exit`,"triage.finished":`All handled`,"triage.nothing":`Nothing needs you`,"announce.moved":`{title} moved to {lane}`,"launch.projects":`Recent projects`,"launch.projectLabel":`Project: {project}`,"launch.defaultProject":`Default folder`,"launch.noProject":`No project`,"launch.chooseFolder":`Choose folder…`,"launch.newFolder":`New folder…`,"project.actionsFor":`Actions for {project}`,"project.new":`New project…`,"folder.title":`New folder`,"folder.description":`Create an empty folder at the chosen location and use it as this task's project.`,"folder.parent":`Location`,"folder.parentPlaceholder":`Absolute path; leave empty for the default working folder`,"folder.browse":`Browse…`,"folder.browseTitle":`Choose where to create the new folder`,"folder.browseUnavailable":`This device can't open the system file manager. Type the location path instead.`,"folder.name":`Name`,"folder.namePlaceholder":`e.g. my-project`,"folder.preview":`Will create: {path}`,"folder.create":`Create`,"folder.creating":`Creating…`,"folder.error.nameRequired":`Enter a folder name.`,"folder.error.nameInvalid":`The name can't contain / \\ : * ? " < > | and can't end with a dot or space.`,"folder.error.parentMissing":`The location doesn't exist or isn't a folder.`,"folder.error.existsAsFile":`A file with this name already exists at the location.`,"folder.error.permission":`You don't have permission to create a folder at this location.`,"folder.error.failed":`Couldn't create the folder.`,"folder.error.failedWithReason":`Couldn't create the folder: {reason}`,"project.manage":`Manage projects…`,"project.newTaskHere":`New task in this project`,"project.rename":`Rename…`,"project.resetName":`Use folder name`,"project.delete":`Delete project…`,"project.remove":`Remove project`,"project.chosen":`Project "{project}" selected. Describe the first task to dispatch it.`,"project.pickerDescription":`Choose the project folder. It becomes the launch console target.`,"project.renameDescription":`Customize the project name shown in All agents and the dispatch dialog. The working directory stays the same.`,"project.manageTitle":`Manage projects`,"project.manageDescription":`Change the order and names of your projects. Projects without chats can be removed without touching their folders or files. Deleting a project with chats also deletes all of its chats.`,"project.sessions":`{count} chats`,"project.folderName":`Folder: {name}`,"project.moveUp":`Move {project} up`,"project.moveDown":`Move {project} down`,"project.renameNamed":`Rename {project}`,"project.resetNamed":`Use folder name for {project}`,"project.deleteWithChatsNamed":`Delete {project} and its chats`,"project.removeNamed":`Remove project {project}`,"project.listLabel":`Projects`,"project.empty":`No projects yet`,"project.emptyHint":`Create a project, then describe its first task in the launch console.`,"project.loading":`Loading projects…`,"project.error":`Couldn't load projects`,"project.deleting":`Deleting…`,"project.done":`Done`,"phone.running":`Running {elapsed}`,"phone.changes":`+{count} changes`,"phone.changesLabel":`View the {count} files changed in this session`,"phone.openInspector":`Changes, terminal, files and preview`,"phone.inspectorDescription":`Changes, terminal, sources and web preview for this session`,"phone.earlierTurns":`Show earlier conversation: {summary}`,"phone.previousTurn":`Previous turn`,"session.moveWorkspace":`Move workspace…`,"session.workflowRuns":`Workflow runs`,"session.workflowRunsEmpty":`This session has no workflow runs yet`,"session.plan":`Plan {done}/{total}`,"session.planLabel":`Plan progress: {done} of {total} done`,"session.titleMenu":`{title}: session actions`,"session.tree":`Session tree`,"session.treeBranches":`Session tree: {count} branches`,"session.treeBranches_one":`Session tree: {count} branch`,"session.changedFiles":`{count} files`,"session.changedFiles_one":`{count} file`,"session.changes":`{count} files +{added} −{removed}`,"session.changes_one":`{count} file +{added} −{removed}`,"session.contextUsage":`Context used {percent}%`,"session.withShortcut":`{label} ({shortcut})`,"session.planOpen":`{plan}: view in the inspector`,"inspector.label":`Inspector`,"inspector.tabs":`Inspector tabs`,"inspector.changes":`Changes`,"inspector.changesCount":`Changes {count}`,"inspector.changesScope":`Change scope`,"inspector.scopeSession":`This session`,"inspector.scopeWorkspace":`Workspace`,"inspector.terminal":`Terminal`,"inspector.terminalScope":`Terminal view`,"inspector.processes":`Processes`,"inspector.terminalUnavailable":`This device or runtime does not provide a terminal`,"inspector.files":`Files`,"inspector.preview":`Preview`,"inspector.plan":`Plan`,"inspector.sideChat":`Side chat`,"inspector.closeTab":`Close “{tab}”`,"inspector.add":`Add component tab`,"inspector.addHint":`Components placed in the “session panel” slot show up here as tabs.`,"inspector.openComponents":`Open Components`,"inspector.close":`Hide inspector`,"transcript.operations":`{count} operations`,"transcript.operations_one":`{count} operation`,"transcript.running":`{count} running`,"transcript.failed":`{count} failed`,"transcript.turn":`Turn {count}`,"composer.placeholder":`Reply to the agent, or use / for commands`,"composer.tokens":`{tokens} tok`,"composer.queuedFollowUp":`After run`,"composer.queuedSteer":`Queued`,"composer.steerNow":`Send now`,"composer.steerHint":`Interrupts the current step so the agent reads it right away`,"composer.longPressSteer":`While running, press and hold to send now`,"changes.sessionSummary":`{count} files changed in this session`,"changes.workspaceSummary":`{count} uncommitted files in the workspace`,"changes.revertAll":`Revert all`,"changes.more":`More change actions`,"changes.pending":`{count} pending approval`,"changes.revertFile":`Revert this file`,"changes.files":`Changed files`,"changes.diffView":`Diff view`,"changes.unified":`Unified`,"changes.split":`Split`,"changes.splitTooNarrow":`The inspector is narrower than 600 px, too narrow for side by side. Widen it to use this view.`,"changes.approvedAt":`Write approved · {time}`,"changes.pendingAt":`Awaiting approval · {time}`,"changes.revertedAt":`Reverted · {time}`,"changes.statusModified":`Modified`,"changes.statusCreated":`Added`,"changes.statusDeleted":`Deleted`,"changes.statusRenamed":`Renamed`,"inspector.goal":`Goal`,"inspector.team":`Team`,"inspector.subAgents":`Sub-agents`,"shortcuts.agentPanel":`Focus the sidebar session list`,"shortcuts.toggleInspector":`Show / hide inspector`,"shortcuts.previousAgent":`Previous session in sidebar order`,"shortcuts.nextAgent":`Next session in sidebar order`,"shortcuts.steerMessage":`Send now while running`,"shortcuts.shortcutHelp":`Keyboard shortcuts`,"shortcuts.sendMessage":`Send (queues while running)`,"shortcuts.focusSearch":`Focus filter / search`,"shortcuts.groupGlobal":`Global`,"shortcuts.groupBoard":`All agents`,"shortcuts.groupSession":`Session`,"shortcuts.globalHint":`Chords with a modifier also work while typing.`,"shortcuts.boardHint":`All agents page only. Single-letter keys work when focus is not in a text field and can only be letters without modifiers.`,"shortcuts.sessionHint":`Session page only. Esc never navigates back.`,"shortcuts.fixed":`Fixed`,"shortcuts.boardMove":`Move between agents (row focused)`,"shortcuts.boardOpen":`Open the session`,"shortcuts.boardExitTriage":`Leave triage`,"shortcuts.newline":`New line`,"shortcuts.stopRun":`Stop the run (closes an open overlay first)`,"shortcuts.helpDescription":`Bindings on this device. Changes show up here right away.`,"shortcuts.helpCustomize":`Customize in Settings`,"home.draftTitle":`New task`,"home.draftSubtitle":`A session is created when you send the first message`,"home.draftHint":`Pick a project and describe the task. After the first message this becomes its session; other agents stay in All agents.`,"home.loading":`Opening your last session…`,"home.loadFailed":`Couldn't load sessions`,"home.loadFailedHint":`Your last session can't be confirmed right now. Retry, or start a new task instead.`,"home.startDraft":`Start a new task`,"home.goHome":`Go to home`,"shortcuts.openSession":`Open session home`,"shortcuts.sessionTree":`Session tree (branches and marks)`,"shortcuts.sideChat":`Side chat`,"shortcuts.cycleFocusRegion":`Move focus between sidebar, top bar, conversation and composer`,"shortcuts.groupSidebar":`Sidebar`,"shortcuts.sidebarHint":`When a session row in the sidebar has focus. A / D follow the All agents allow / deny keys and only handle standard approvals.`,"shortcuts.sidebarMove":`Move between session rows`,"shortcuts.sidebarOpen":`Open session`,"sidebar.reason.failed":`Run failed`,"sidebar.reason.approval":`Waiting for your approval`,"sidebar.reason.criticalApproval":`High-risk approval`,"sidebar.reason.question":`Waiting for your answer`,"sidebar.reason.questions":`Waiting for your answer · {count} questions`,"sidebar.reason.questions_one":`Waiting for your answer · {count} question`,"sidebar.reason.questionCount":`{count} questions`,"sidebar.reason.questionCount_one":`{count} question`,"sidebar.group.attention":`Needs you`,"sidebar.group.running":`Running`,"sidebar.group.queued":`Queued`,"sidebar.group.pinned":`Pinned`,"sidebar.group.done":`Done today`,"sidebar.loading":`Loading sessions`,"sidebar.error":`Couldn't load sessions`,"sidebar.retry":`Retry`,"sidebar.empty":`No agents running yet. Start one with New task.`,"sidebar.emptyAttention":`Nothing needs you`,"sidebar.emptyRunning":`No agents running`,"sidebar.moreRunning":`{count} more →`,"sidebar.allDone":`All →`,"sidebar.history":`History`,"sidebar.group.recent":`Recent`,"sidebar.emptyRecent":`No chats yet`,"sidebar.allChats":`All chats`,"sidebar.announce":`{title} needs you: {reason}`,"sidebar.announceSeparator":`; `,"sidebar.attentionRow":`{title}, {reason}, waiting {wait}`,"sidebar.attentionRowNoWait":`{title}, {reason}`,"sidebar.unread":`Unread`,"sidebar.deny":`Deny`,"sidebar.approve":`Allow`,"sidebar.open":`Open`,"sidebar.denyNamed":`Deny the request from {title}`,"sidebar.approveNamed":`Allow the request from {title}`,"sidebar.openNamed":`Open {title} to handle it`,"sidebar.rowMenu":`More actions for {title}`,"sidebar.renameTitle":`Rename session`,"sidebar.renameLabel":`Session title`,"sidebar.renameSave":`Save`,"sidebar.renamed":`Session title updated`,"sidebar.railAttention":`{count} agents need you, open all agents`,"sidebar.railAttention_one":`{count} agent needs you, open all agents`,"sidebar.railRunning":`{count} agents running, open all agents`,"sidebar.railRunning_one":`{count} agent running, open all agents`,"sidebar.filter.all":`All`,"sidebar.filter.projectActions":`Project actions`,"sidebar.filter.addProject":`Add project…`,"sidebar.filter.noProjects":`No projects yet`,"sidebar.fleet.attention":`{count} need you`,"sidebar.fleet.running":`{count} running`,"sidebar.fleet.label":`{attention} need you, {running} running, open all agents`,"menu.rename":`Rename`,"composer.placeholderRunning":`Running: {queue} to queue, {steer} to send now`,"composer.placeholderRunningQueueOnly":`Running: {queue} to queue`,"composer.placeholderRunningTouch":`Running: tap send to queue, hold send to send now`,"composer.sendQueuedNow":`Send this queued message now`,"composer.editQueued":`Edit queued message`,"composer.cancelQueued":`Cancel queued message`,"composer.plusMenu":`Add attachments, skills or voice input`,"composer.modeChip":`Approval and run mode`,"composer.goalShort":`Goal`,"composer.teamShort":`Team`,"composer.cycleRunMode":`Cycle`,"composer.contextUsage":`Context`,"composer.sessionTokens":`This session`,"composer.cacheHitLabel":`Cache hits`,"transcript.allDone":`all done`,"transcript.copyMarkdown":`Copy as Markdown`,"card.holdToApprove":`Hold to allow`,"card.holdHint":`High-risk: hold for 0.6 s`,"card.moreWaiting":`{count} more waiting for you`,"shortcuts.cycleRunMode":`Cycle run mode (Plan / Goal / Team)`,"project.moveUpShort":`Move up`,"project.moveDownShort":`Move down`,"triage.answer":`Answer`,"overview.doneUnread":`Done · unread`,"overview.waited":`waited {wait}`,"overview.ran":`running for {time}`,"overview.finishedAt":`finished at {time}`,"overview.openToHandle":`Open to handle`,"overview.log":`Log`,"overview.retryNamed":`Retry {title}`,"overview.subAgents":`Sub-agents {running}/{total}`,"overview.startNow":`Start now`,"overview.queuedAfter":`After “{title}”`,"overview.queuedAfterUnknown":`Waiting for an earlier task`,"overview.queuePosition":`No. {n} in queue`,"overview.empty":`No agents are running yet`,"overview.newTask":`New task`,"overview.widgets":`Placed components`,"overview.subAgentSlots":`Sub-agents {running}/{max}`,"overview.todayTokens":`{tokens} tok today`,"overview.memory":`Memory {memory}`,"overview.systemLoading":`Reading system info…`,"overview.systemUnavailable":`System info is unavailable right now`,"overview.projectAttention":`{count} need you`,"overview.projectAttention_one":`{count} needs you`,"overview.projectRunning":`{count} running`,"overview.projectQueued":`{count} queued`,"overview.projectDone":`{count} done today`,"question.title":`The agent is asking you`,"question.label":`Agent question`,"question.waiting":`{count} more questions are waiting for you`,"question.moreAfter":`{count} more after this`,"question.failed":`Couldn't send the answer. Try again (it may have been answered elsewhere).`,"question.other":`Other…`,"question.otherLabel":`Other answer: {question}`,"question.otherPlaceholder":`Write your answer`,"question.skip":`Skip`,"question.submit":`Submit`,"question.answerNamed":`Answer “{title}”: {option}`,"composer.plusSheetTitle":`Add`,"composer.attachmentShort":`Attachment`,"composer.voiceInput":`Voice input`,"composer.planShort":`Plan`,"phone.openInspectorShort":`Changes & files`,"inspector.running":`Running`,"inspector.runningCount":`Running {count}`,"inspector.runningStatus":`Running`,"inspector.runningQueued":`Queued`,"inspector.runningTool":`Tool`,"inspector.runningAgent":`Subagent`,"inspector.runningEmpty":`Nothing is running in this chat right now`,"inspector.runningHint":`Shows the commands and tools the agent is running, its subagents, and this task’s terminals. Processes a command sends to the background (nohup, &) are not listed.`,"launch.machines":`Remote machines`,"launch.addMachine":`Add remote machine…`,"machine.folderTitle":`Work on {name}`,"machine.folderDescription":`The agent's file and shell tools will run on this machine.`,"machine.folderLabel":`Folder on that machine`,"machine.folderHint":`Leave empty for the home folder.`,"machine.folderInRoots":`Must be inside: {roots}`,"machine.confirm":`Use this folder`,"machine.checking":`Connecting…`,"machine.cancel":`Cancel`,"composer.context.system":`System prompt`,"composer.context.project":`Project instructions`,"composer.context.skills":`Skill list`,"composer.context.tools":`Built-in tools`,"composer.context.mcp":`MCP tools`,"composer.context.messages":`Messages`,"composer.context.toolResults":`Tool calls & results`,"composer.context.free":`{tokens} free`,"composer.context.estimated":`Total from the model; the parts are estimates.`,"composer.context.allEstimated":`No usage from the model yet; all estimates.`,"composer.context.prefixUnknown":`The system prompt and tools can be counted once the session has run.`,"composer.context.compactAt":`Compacts at {percent}%`,"composer.context.deferred":`{count} on standby, free until called`,"composer.context.callCount":`{count} calls`,"composer.context.composition":`What is using it`,"composer.context.toolCount":`{count} tools`}};export{e as boardMessages};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./startup-queries-LEtJRewm.js";import{t as n}from"./event-stream-DTCmB4AA.js";import{i as r,n as i,t as a}from"./http-YNvizzuJ.js";import{r as o}from"./api-C35aq3ml.js";var s=[`system`,`project`,`skills`,`tools`,`mcp`,`messages`,`toolResults`];function c(e){return e&&typeof e==`object`?e:{}}function l(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:0}function u(e){let t=c(e),n=new Map((Array.isArray(t.categories)?t.categories:[]).map(e=>[c(e).id,c(e)])),r=Number(t.compactAtPercent);return{contextWindow:l(t.contextWindow),usedTokens:l(t.usedTokens),freeTokens:l(t.freeTokens),totalKnown:t.totalKnown===!0,prefixKnown:t.prefixKnown===!0,compactAtPercent:t.compactAtPercent!=null&&r>0&&r<=100?r:null,categories:s.map(e=>{let t=n.get(e)??{};return{id:e,tokens:l(t.tokens),count:t.count==null?null:l(t.count),deferred:l(t.deferred),calls:l(t.calls),servers:(Array.isArray(t.servers)?t.servers:[]).map(e=>{let t=c(e);return{name:typeof t.name==`string`?t.name:``,tools:l(t.tools),calls:l(t.calls),tokens:l(t.tokens)}})}})}}function d(e,t){if(!t||e<=0)return`0%`;let n=e/t*100;return n<1?`<1%`:`${Math.round(n)}%`}var f=e=>`/api/sessions/${encodeURIComponent(e)}`;async function p(t,n={}){let r=await i(t,n);return n.method&&n.method!==`GET`&&(/^\/api\/sessions(?:$|\/[^/]+(?:\/(?:derive|model|cwd|execution-mode|run-mode|thinking-level|goal|tree\/navigate))?$)/.test(t)&&e(`sessions`),t===`/api/settings/compaction`&&e(`config`)),r}var m={listSessions:({refresh:e=!0}={})=>t(`sessions`,e),searchSessionTreeLabels:(e,t=20,n)=>p(`/api/session-labels?${new URLSearchParams({query:e,limit:String(t)})}`,{signal:n}),listSessionTreeLabels:(e=500)=>p(`/api/session-labels?limit=${e}`),createSession:(e,t=``,n={})=>p(`/api/sessions`,{method:`POST`,...n.machine?{timeout:4e4}:{},data:{name:e,...n.machine?{machine:n.machine}:{},...n.projectless?{projectless:!0}:t?{cwd:t}:{}}}),getContextBreakdown:(e,t)=>p(`${f(e)}/context-breakdown`,{signal:t}).then(u),deriveSession:(e,t,n)=>p(`${f(e)}/derive`,{method:`POST`,data:{boundaryEntryId:t,name:n}}),getSessionTree:e=>p(`${f(e)}/tree`),navigateSessionTree:(e,t,n)=>p(`${f(e)}/tree/navigate`,{method:`POST`,data:{targetEntryId:t,summarize:n},timeout:18e4}),navigateSessionTreeTarget:(e,t)=>p(`${f(e)}/tree/navigate`,{method:`POST`,data:{targetEntryId:t,summarize:!1,includeTree:!1},timeout:18e4}),previewFileRewind:(e,t)=>p(`${f(e)}/tree/${encodeURIComponent(t)}/file-rewind`),rewindFiles:(e,t)=>p(`${f(e)}/tree/${encodeURIComponent(t)}/file-rewind`,{method:`POST`,timeout:18e4}),setSessionTreeLabel:(e,t,n)=>p(`${f(e)}/tree/labels/${encodeURIComponent(t)}`,{method:`PUT`,data:{label:n}}),getSessionCommands:e=>p(`${f(e)}/commands`),getWorkspaceCommands:e=>p(`/api/commands?cwd=${encodeURIComponent(e)}`),getConfig:({refresh:e=!1}={})=>t(`config`,e),updateCompactionPreference:e=>p(`/api/settings/compaction`,{method:`PATCH`,data:{thresholdPercent:e}}),getLiveSession:(e,t={})=>p(`${f(e)}/live`,t),getMessages:(e,t)=>{let n=new URLSearchParams({limit:String(t.limit)});return t.before&&n.set(`before`,t.before),p(`${f(e)}/messages?${n}`)},openStream:async(e,t,{signal:n}={})=>{await o({open:async()=>(await r(),fetch(`/api/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e),signal:n})),resume:async(e,t)=>(await r(),fetch(`/api/runs/${encodeURIComponent(e)}/events?after=${t}`,{signal:n})),onEvent:t,signal:n})},askSideQuestion:async(e,t,{signal:i,onDelta:a}={})=>{await r();let o=await fetch(`${f(e)}/side-question`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({question:t}),signal:i}),s=null;if(await n(o,(e,t)=>{if(e===`delta`&&typeof t.text==`string`)a?.(t.text);else if(e===`error`)throw Error(String(t.message||``));else if(e===`done`)return s={text:typeof t.text==`string`?t.text:``,toolCallIgnored:t.toolCallIgnored===!0},!1}),!s)throw Error(`side question ended before completion`);return s},retryLastTurn:async(e,t,{signal:n}={})=>{await o({open:async()=>(await r(),fetch(`${f(e)}/retry`,{method:`POST`,signal:n})),resume:async(e,t)=>(await r(),fetch(`/api/runs/${encodeURIComponent(e)}/events?after=${t}`,{signal:n})),onEvent:t,signal:n})},queueInput:(e,t,n,r)=>p(`${f(e)}/input`,{method:`POST`,data:{message:t,attachments:n,behavior:r}}),sendQueuedInputNow:(e,t)=>p(`${f(e)}/input/${encodeURIComponent(t)}/send-now`,{method:`POST`,data:{}}),withdrawQueuedInput:(e,t)=>p(`${f(e)}/input/${encodeURIComponent(t)}`,{method:`DELETE`}),compactSession:e=>p(`${f(e)}/compact`,{method:`POST`,data:{},timeout:18e4}),getSessionWorkflowRuns:e=>p(`${f(e)}/workflow-runs`),resolveWorkflowApproval:(e,t,n)=>p(`/api/workflow-runs/${encodeURIComponent(e)}/approvals/${encodeURIComponent(t)}`,{method:`POST`,data:{approved:n}}),stopWorkflowRun:e=>p(`/api/workflow-runs/${encodeURIComponent(e)}/stop`,{method:`POST`,data:{}}),abort:e=>p(`${f(e)}/abort`,{method:`POST`,data:{}}),resolveMobileOperation:(e,t,n)=>p(`${f(e)}/mobile-operations/${encodeURIComponent(t)}`,{method:`POST`,data:n}),pauseGoal:e=>p(`${f(e)}/goal`,{method:`PATCH`,data:{action:`pause`}}),setGoalBudget:(e,t)=>p(`${f(e)}/goal`,{method:`PATCH`,data:{action:`set-budget`,tokenBudget:t}}),getGitChanges:e=>p(`${f(e)}/git/changes`),commitGitChanges:(e,t)=>p(`${f(e)}/git/commit`,{method:`POST`,data:{message:t},timeout:6e4}),pushGitChanges:e=>p(`${f(e)}/git/push`,{method:`POST`,data:{},timeout:15e4}),revertGitChanges:e=>p(`${f(e)}/git/revert`,{method:`POST`,data:{},timeout:6e4}),getVcsChanges:(e,t={})=>p(`${f(e)}/vcs/changes`,t),getFileDiff:(e,t,{preferSession:n=!1,...r}={})=>p(`${f(e)}/vcs/file-diff?path=${encodeURIComponent(t)}${n?`&prefer=session`:``}`,r),commitVcsChanges:(e,t)=>p(`${f(e)}/vcs/commit`,{method:`POST`,data:{message:t},timeout:15e4}),pushVcsChanges:e=>p(`${f(e)}/vcs/push`,{method:`POST`,data:{},timeout:15e4}),revertVcsChanges:e=>p(`${f(e)}/vcs/revert`,{method:`POST`,data:{},timeout:6e4}),createHtmlPreview:(e,t)=>p(`${f(e)}/html-preview`,{method:`POST`,body:JSON.stringify({path:t})}),getSessionFileChanges:(e,t={})=>p(`${f(e)}/file-changes`,t),getSessionFileChangeDiff:(e,t,n={})=>p(`${f(e)}/file-changes/diff?path=${encodeURIComponent(t)}`,n),revertSessionFileChanges:(e,t=``)=>p(`${f(e)}/file-changes/revert`,{method:`POST`,data:{path:t},timeout:6e4}),approveSessionFileChanges:(e,t=``)=>p(`${f(e)}/file-changes/approve`,{method:`POST`,data:{path:t}}),updateModel:(e,t,n)=>p(`${f(e)}/model`,{method:`PUT`,data:{provider:t,model:n}}),getThinkingLevel:e=>p(`${f(e)}/thinking-level`),setThinkingLevel:(e,t)=>p(`${f(e)}/thinking-level`,{method:`PUT`,data:{level:t}}),updateExecutionMode:(e,t)=>p(`${f(e)}/execution-mode`,{method:`PUT`,data:{mode:t}}),updateRunMode:(e,t)=>p(`${f(e)}/run-mode`,{method:`PUT`,data:{mode:t}}),resolveApproval:(e,t,n)=>p(`${f(e)}/approvals/${encodeURIComponent(t)}`,{method:`POST`,data:{approved:n}}),answerQuestion:(e,t,n)=>p(`${f(e)}/questions/${encodeURIComponent(t)}`,{method:`POST`,data:n}),startQueuedSession:e=>p(`${f(e)}/queue/start`,{method:`POST`,data:{}}),exportSessionMarkdown:(e,t)=>a(`${f(e)}/export?format=markdown&lang=${t===`en-US`?`en-US`:`zh-CN`}`,{timeout:6e4}),updateCwd:(e,t)=>p(`${f(e)}/cwd`,{method:`PUT`,data:{cwd:t}}),renameSession:(e,t)=>p(f(e),{method:`PATCH`,data:{name:t}})};export{d as n,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
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-QY-mTTDS.js";import{t as i}from"./createLucideIcon-Cd-3GVxJ.js";import{t as a}from"./arrow-up-DST6-qVQ.js";import{t as o}from"./braces-DQcXLGFF.js";import{t as s}from"./pencil-U08v_vV9.js";import{t as c}from"./refresh-cw-TbWxTY4K.js";import{t as l}from"./square-bHHVTT3G.js";import{t as u}from"./wrench-6pg6_bqI.js";import{t as d}from"./x-07u4-129.js";import{t as f}from"./utils-C8uzG5AZ.js";import{n as p}from"./button-CCcCN8tE.js";import{t as m}from"./kbd-CAufZTkl.js";import{s as h}from"./shortcuts-B5Q10H38.js";import{t as g}from"./StatusGlyph-1KgitlUg.js";import{s as _}from"./run-activity-CwfO0cui.js";var v=i(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),y=e(t(),1),b=n(),x=`relative max-[650px]:after:absolute max-[650px]:after:-inset-1`,S=`inline-flex h-7 min-w-0 shrink cursor-pointer items-center gap-1.5 rounded-sm border border-transparent px-2 text-[13px] text-content-secondary transition-colors hover:bg-surface-hover hover:text-content aria-expanded:bg-surface-hover aria-expanded:text-content max-[650px]:h-9 max-[650px]:rounded-full max-[650px]:bg-surface-muted max-[650px]:dark:bg-surface-active max-[650px]:px-3 max-[650px]:text-content min-[651px]:pointer-coarse:h-11 ${x}`,C=`grid size-8 min-w-8 flex-none cursor-pointer place-items-center rounded-sm border-0 bg-transparent text-content-muted transition-colors hover:bg-surface-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50 max-[650px]:size-9 max-[650px]:min-w-9 min-[651px]:pointer-coarse:size-11 min-[651px]:pointer-coarse:min-w-11 ${x}`,w=`max-[650px]:size-4`;function T(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=String(t%60).padStart(2,`0`);return n?`${n}:${String(r).padStart(2,`0`)}:${i}`:`${r}:${i}`}function E({startedAt:e}){let[t,n]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let r=_(e,null,t);return r?(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 font-mono text-[12.5px] text-content-muted tabular-nums`,"data-tray-clock":!0,children:T(r)}):null}var D=`flex min-h-[34px] min-w-0 items-center gap-2 pr-1.5 pl-3 text-[13px] max-[650px]:min-h-11 max-[650px]:pr-0 pointer-coarse:min-h-11`,O=`grid size-[26px] flex-none cursor-pointer place-items-center rounded-sm text-content-muted opacity-0 transition-opacity duration-(--d-fast) group-hover/queued:opacity-100 group-focus-within/queued:opacity-100 hover:bg-surface-hover hover:text-content focus-visible:opacity-100 disabled:cursor-default disabled:opacity-40 max-[650px]:size-11 max-[650px]:opacity-100 pointer-coarse:size-11 pointer-coarse:opacity-100 [@media(hover:none)]:opacity-100`;function k({streaming:e,compaction:t,startedAt:n,stopping:i=!1,onStop:a,queuedInputs:o=[],withdrawingInputIds:c=[],onEdit:u,onCancel:h,onSendNow:_,runRow:y=!0,queueList:x=!0}){let{t:S}=r(),C=!!t?.active,w=!!e&&y||C,T=x?o:[];if(!w&&!T.length)return null;let k=S(`chat:focusSession.sentToTheRunningAgent`);return(0,b.jsxs)(`div`,{className:`composer-tray mx-3.5 flex min-w-0 flex-col overflow-hidden rounded-t-(--r-lg) border border-b-0 border-stroke bg-well text-content-secondary max-[650px]:mx-2 [&>*+*]:border-t [&>*+*]:border-stroke`,"data-composer-tray":!0,children:[w&&(0,b.jsxs)(`div`,{className:D,"data-run-bar":C?`compacting`:`running`,children:[(0,b.jsxs)(`span`,{role:`status`,className:`flex min-w-0 flex-1 items-center gap-2`,children:[C?(0,b.jsx)(p,{className:`size-3.5 flex-none text-content-secondary`}):(0,b.jsx)(g,{status:`run`,className:`size-4`}),(0,b.jsx)(`span`,{className:`shrink-0 text-content`,children:S(C?`chat:focusSession.compactingContext`:`chat:focusSession.running`)}),e&&(0,b.jsx)(E,{startedAt:n})]}),e&&a&&(0,b.jsxs)(`button`,{type:`button`,className:`inline-flex h-[26px] shrink-0 cursor-pointer items-center gap-1.5 rounded-sm px-2 text-[13px] text-content transition-colors hover:bg-surface-hover disabled:cursor-default disabled:opacity-60 max-[650px]:h-11 max-[650px]:min-w-[72px] max-[650px]:justify-center pointer-coarse:h-11 pointer-coarse:min-w-[72px]`,"aria-label":S(i?`chat:focusSession.stopping`:`chat:focusSession.stop`),title:S(`chat:focusSession.stopRunShortcut`),"aria-busy":i||void 0,disabled:i,onClick:a,"data-run-stop":!0,children:[(0,b.jsx)(l,{size:10,fill:`currentColor`,"aria-hidden":`true`}),S(i?`chat:focusSession.stopping`:`chat:focusSession.stop`),(0,b.jsx)(m,{className:`max-[650px]:hidden pointer-coarse:hidden`,children:`Esc`})]})]}),T.length>0&&(0,b.jsx)(`ul`,{className:`m-0 flex max-h-[136px] min-w-0 list-none flex-col overflow-x-hidden overflow-y-auto overscroll-contain p-0 [&>*+*]:border-t [&>*+*]:border-stroke-soft`,"aria-label":k,"data-pisper-queue-size":T.length,tabIndex:T.length>3?0:void 0,children:T.map((e,t)=>{let n=typeof e.id==`string`?e.id:``,r=c.includes(n),i=!n||r,a=String(e.text||``);return(0,b.jsxs)(`li`,{className:f(D,`group/queued`),"aria-busy":r||void 0,children:[(0,b.jsx)(`span`,{className:`inline-flex h-[18px] flex-none items-center rounded-xs border border-stroke bg-solid px-1.5 text-[11.5px] text-content-muted`,"data-queued-behavior":e.behavior===`steer`?`steer`:`followUp`,children:e.behavior===`steer`?S(`board:composer.queuedSteer`):S(`board:composer.queuedFollowUp`)}),(0,b.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-content [overflow-wrap:anywhere]`,title:a,children:a}),_&&(0,b.jsx)(`button`,{type:`button`,className:O,"aria-label":S(`board:composer.sendQueuedNow`),title:S(`board:composer.sendQueuedNow`),disabled:i,"data-queued-send-now":!0,onClick:()=>_(n),children:(0,b.jsx)(v,{size:14,"aria-hidden":`true`})}),u&&(0,b.jsx)(`button`,{type:`button`,className:O,"aria-label":S(`board:composer.editQueued`),title:S(`board:composer.editQueued`),disabled:i,"data-queued-edit":!0,onClick:()=>void u(n),children:(0,b.jsx)(s,{size:14,"aria-hidden":`true`})}),h&&(0,b.jsx)(`button`,{type:`button`,className:O,"aria-label":S(`board:composer.cancelQueued`),title:S(`board:composer.cancelQueued`),disabled:i,"data-queued-cancel":!0,onClick:()=>void h(n),children:(0,b.jsx)(d,{size:14,"aria-hidden":`true`})})]},n||`${e.behavior}-${t}`)})})]})}function A({invocation:e,onRemove:t}){let{t:n}=r();return(0,b.jsxs)(`div`,{className:`composer-resource-chip [&.workflow]:border-success-border [&.workflow]:bg-success-soft [&.workflow]:text-success-strong [&_button]:grid [&_button]:size-6 [&_button]:place-items-center [&_button]:rounded-xs [&_button]:text-content-muted [&_button]:hover:bg-surface-hover [&_button]:hover:text-content inline-flex h-7 self-start items-center gap-1.5 rounded-sm border border-star-border bg-star-soft pr-0.5 pl-2 text-xs font-medium text-star-strong max-[650px]:h-11 max-[650px]:[&_button]:size-11 ${e.kind}`,children:[e.kind===`tool`?(0,b.jsx)(u,{size:13}):(0,b.jsx)(o,{size:13}),(0,b.jsxs)(`span`,{children:[e.kind===`skill`?`Skill`:e.kind===`tool`?n(`chat:resourcePicker.tool`):n(`chat:resourcePicker.workflow`),` `,`· `,e.resourceName]}),(0,b.jsx)(`button`,{type:`button`,"aria-label":n(`chat:resourcePicker.remove`),onClick:t,children:(0,b.jsx)(d,{size:13})})]})}function j({streaming:e,queueing:t,submitting:n=!1,stopping:i=!1,preparing:o=!1,hasDraft:s=!1,canQueue:u=!1,blockedReason:d,disabled:f,onLongPress:p,longPressHint:m,onStop:g}){let{t:_}=r(),v=h(`sendMessage`),S=(0,y.useRef)(null),C=(0,y.useRef)(!1),T=()=>{S.current&&clearTimeout(S.current),S.current=null};(0,y.useEffect)(()=>{let e=S;return()=>{e.current&&clearTimeout(e.current)}},[]);let E=!!(g&&e&&!s),D=!!(e&&!(s&&u))&&!E,O=t||n||i||o,k=f||O||D||!!d,A=_(o?`chat:focusSession.preparingAttachments`:i?`chat:focusSession.stopping`:E?`chat:focusSession.stop`:`chat:focusSession.sendMessage`);return(0,b.jsx)(`button`,{type:E?`button`:`submit`,"data-send-mode":E?`stop`:`send`,className:`send-button grid size-8 min-w-8 flex-none cursor-pointer place-items-center rounded-full border border-transparent bg-star text-on-accent transition-[background-color,opacity] select-none [-webkit-touch-callout:none] hover:enabled:bg-star-hover active:enabled:translate-y-px disabled:cursor-not-allowed disabled:opacity-30 aria-disabled:opacity-30 max-[650px]:disabled:bg-surface-muted max-[650px]:disabled:text-content max-[650px]:disabled:opacity-100 max-[650px]:aria-disabled:bg-surface-muted max-[650px]:aria-disabled:text-content max-[650px]:aria-disabled:opacity-100 max-[650px]:dark:disabled:bg-surface-active max-[650px]:dark:aria-disabled:bg-surface-active data-[send-mode=stop]:bg-surface-muted data-[send-mode=stop]:text-content data-[send-mode=stop]:hover:enabled:bg-surface-hover dark:data-[send-mode=stop]:bg-surface-active max-[650px]:size-9 max-[650px]:min-w-9 min-[651px]:pointer-coarse:size-11 min-[651px]:pointer-coarse:min-w-11 ${x}`,title:d||(!O&&v?`${A} (${v})`:A),"aria-label":d?`${A}: ${d}`:A,"aria-busy":O||void 0,"aria-disabled":k||void 0,"aria-description":p&&!E?m:void 0,"data-long-press":p&&!E?`steer`:void 0,onPointerDown:e=>{C.current=!1,!(!p||E||k||e.pointerType===`mouse`)&&(T(),S.current=setTimeout(()=>{S.current=null,C.current=!0,p()},500))},onPointerUp:T,onPointerCancel:T,onPointerLeave:T,onContextMenu:e=>{p&&e.preventDefault()},onClick:e=>{if(C.current){C.current=!1,e.preventDefault();return}if(k){e.preventDefault();return}E&&g?.()},disabled:!d&&k,children:O?(0,b.jsx)(c,{className:`animate-spin ${w}`,size:17}):E?(0,b.jsx)(l,{size:13,fill:`currentColor`,"aria-hidden":`true`}):(0,b.jsx)(a,{size:17,strokeWidth:2.1,className:w})})}export{A as a,T as c,x as i,C as n,j as o,w as r,k as s,S as t};
|