pisper 0.6.11 → 0.6.12
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 +667 -597
- package/web/assets/{AppDialog-CbXmk5vN.js → AppDialog-B2sA9Pb-.js} +1 -1
- package/web/assets/{AppOverlays-BFLcGGx9.js → AppOverlays-BSQhRkJA.js} +1 -1
- package/web/assets/{AssetsPage-BoB8pJxi.js → AssetsPage-BYt5ux5w.js} +1 -1
- package/web/assets/{BoardPage-C3P69gtK.js → BoardPage-CMlI4ZXS.js} +3 -3
- package/web/assets/{ChannelsPage-yPVopq7h.js → ChannelsPage-D_wMSCSQ.js} +1 -1
- package/web/assets/{ChatAppearancePage-DPulJWKJ.js → ChatAppearancePage-I3n1MqQQ.js} +1 -1
- package/web/assets/{ChatHistoryPage-CZX27BNu.js → ChatHistoryPage-DfYaF_Up.js} +1 -1
- package/web/assets/{ChatPage-Bkv4vff9.js → ChatPage-Da-Olqli.js} +5 -5
- package/web/assets/{ConfigPage-D1MJyBus.js → ConfigPage-BEor5fZj.js} +2 -2
- package/web/assets/{DesktopWindowControls-CKaPEgxw.js → DesktopWindowControls-CNMZrILS.js} +1 -1
- package/web/assets/{DispatchOverlay-CGLJLqZo.js → DispatchOverlay-D-gu_80O.js} +1 -1
- package/web/assets/{FeaturePage-RH3fTWIk.js → FeaturePage-Bh5TePxl.js} +1 -1
- package/web/assets/{FileAttachmentPreview-BhdQDxeP.js → FileAttachmentPreview-BKf_g87y.js} +1 -1
- package/web/assets/{FloatingWidgets-UItLK_UZ.js → FloatingWidgets-C1qQaPBd.js} +1 -1
- package/web/assets/{FocusRuntimeControls-DyexiBAA.js → FocusRuntimeControls-6ayCBCsE.js} +1 -1
- package/web/assets/{GitDiffViewer-dtiUySxH.js → GitDiffViewer-BMyafOfq.js} +1 -1
- package/web/assets/LaunchConsole-DM4YN3y3.js +3 -0
- package/web/assets/ManageProjectsDialog-B694Yqbw.js +1 -0
- package/web/assets/{MarkdownMessage-CYDI17zd.js → MarkdownMessage-mIynIAzE.js} +1 -1
- package/web/assets/McpPage-BfGjtNdb.js +1 -0
- package/web/assets/{MemoryPage-ObL1zsXe.js → MemoryPage-2htmr0tu.js} +1 -1
- package/web/assets/{MobileNavigation-BIPy8A0i.js → MobileNavigation-qjEdcfhX.js} +1 -1
- package/web/assets/{MorePage-CFfeYmW_.js → MorePage-B5nQDAQP.js} +1 -1
- package/web/assets/NewFolderDialog-D68r0xND.js +1 -0
- package/web/assets/{PageHeader-SVPzWuI3.js → PageHeader-BsadnkzI.js} +1 -1
- package/web/assets/{PhoneDrawer-C08oZFjf.js → PhoneDrawer-CGi1h7IU.js} +1 -1
- package/web/assets/{PhoneMenuButton-BCxDG78_.js → PhoneMenuButton-DkkEDkfk.js} +1 -1
- package/web/assets/{PhoneTopBar-6KsMmalq.js → PhoneTopBar-BwIvKnLT.js} +1 -1
- package/web/assets/{PluginsPage-jhrfFTbZ.js → PluginsPage-BV0HrLjj.js} +1 -1
- package/web/assets/{QuickPromptIdeas-CX8dS2LC.js → QuickPromptIdeas-Do7Bs-V_.js} +1 -1
- package/web/assets/{SafeModePrompt-v1_UpOAA.js → SafeModePrompt-zkBI0cAo.js} +1 -1
- package/web/assets/SchedulesPage-Dids4PHA.js +1 -0
- package/web/assets/{SessionBrowserPane-Bvy_BC-s.js → SessionBrowserPane-DXca3lhC.js} +2 -2
- package/web/assets/{SessionContextPanel-B6c71Uom.js → SessionContextPanel-XMQkDDgD.js} +2 -2
- package/web/assets/{SessionHome-B-lxCMjh.js → SessionHome-BoPMlfbE.js} +1 -1
- package/web/assets/{SessionInspector-FhXk25KK.js → SessionInspector-DoXEstqb.js} +1 -1
- package/web/assets/{SessionShell-B-zDO3z-.js → SessionShell-DC0uS7ab.js} +1 -1
- package/web/assets/{SettingsSidebar-K4O49gWb.js → SettingsSidebar-D1F4VOzp.js} +1 -1
- package/web/assets/{ShortcutHelpDialog-LajY5QoG.js → ShortcutHelpDialog-b1wuKRGr.js} +1 -1
- package/web/assets/{ShortcutKeys-BCndDMeY.js → ShortcutKeys-YBlbJmQo.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-2eLpofE7.js → SidebarUpdateStatus-Dn95j8CE.js} +1 -1
- package/web/assets/{SkillsPage-Z_czQryK.js → SkillsPage-_g13X5ID.js} +1 -1
- package/web/assets/{TaskProcessesPane-GyemHu_6.js → TaskProcessesPane-ChitlEI4.js} +1 -1
- package/web/assets/{TaskTerminalView-C7WW5feg.js → TaskTerminalView-od0JCnVb.js} +1 -1
- package/web/assets/{TerminalPanel-Ddu_dEnz.js → TerminalPanel-CW47PtOX.js} +1 -1
- package/web/assets/{WebDesktopPet-DfAoMXEk.js → WebDesktopPet-BgQkrvFd.js} +1 -1
- package/web/assets/{WorkflowsPage-D_wAL0Md.js → WorkflowsPage-BFyP0_j_.js} +1 -1
- package/web/assets/{WorkspacePicker-DsJ0_nq_.js → WorkspacePicker-tsgOFkg0.js} +1 -1
- package/web/assets/{api-DxQIocGp.js → api-DOHQjQrv.js} +1 -1
- package/web/assets/{app-update-awVCww9P.js → app-update-C1oLil1b.js} +1 -1
- package/web/assets/{approval-confirm-9qU8wa0h.js → approval-confirm-Bpma8HMP.js} +1 -1
- package/web/assets/{board-launch-B2PD2yr-.js → board-launch-CM1zjdqN.js} +1 -1
- package/web/assets/board-messages-BOWWyhz_.js +1 -0
- package/web/assets/board-projects-Cm1I_eWA.js +1 -0
- package/web/assets/{chat-api-CjiINBKJ.js → chat-api-tHFjf7aB.js} +1 -1
- package/web/assets/{client-store-H1xTSbo-.js → client-store-CpJ1iryH.js} +1 -1
- package/web/assets/{config-search-hFrcaQf0.js → config-search-CyM8kWGv.js} +1 -1
- package/web/assets/{dialog-Bs9_FZX7.js → dialog-CfgIErMS.js} +1 -1
- package/web/assets/{events-DWUUCmbP.js → events-DV8PYjtk.js} +1 -1
- package/web/assets/{field-DaxtcBBA.js → field-DoLEb0np.js} +1 -1
- package/web/assets/folder-paths-Bky-CpjC.js +1 -0
- package/web/assets/{hosts-DsWmhXz4.js → hosts-DJ2bPahU.js} +1 -1
- package/web/assets/{i18n-BjpQE1sJ.js → i18n-CHHZADSh.js} +1 -1
- package/web/assets/{index-C3xrFlMb.js → index-CKGGgVei.js} +2 -2
- package/web/assets/input-group-h8z63MzW.js +1 -0
- package/web/assets/mount-app-B1dKgqo5.js +9 -0
- package/web/assets/mutation-CEbxdVYy.js +1 -0
- package/web/assets/{palette-navigation-Bni8Mp34.js → palette-navigation-ByC1_QS5.js} +1 -1
- package/web/assets/{permission-rules-api-BO8nujtv.js → permission-rules-api-DS_p7Lik.js} +1 -1
- package/web/assets/{pick-system-directory-C7BKn3Gc.js → pick-system-directory-Bhvwq-o2.js} +1 -1
- package/web/assets/placements-DBcA75II.js +2 -0
- package/web/assets/{popover-BqqbRCrL.js → popover-4UKNni3P.js} +1 -1
- package/web/assets/public-DMzrVWzM.js +1 -0
- package/web/assets/{public-Dp3V7Oez.js → public-QbkhsZjX.js} +2 -2
- package/web/assets/{public-components-CjL2gwlJ.js → public-components-Bvl5b8HI.js} +1 -1
- package/web/assets/public-diff-zWlldwG3.js +1 -0
- package/web/assets/public-launch-WirHCXQ8.js +1 -0
- package/web/assets/query-Bj-DUNYq.js +1 -0
- package/web/assets/runtime-capabilities-4_ZwLBqF.js +1 -0
- package/web/assets/{runtime-capabilities-store-BvWnn9Kx.js → runtime-capabilities-store-CLDMF6_P.js} +1 -1
- package/web/assets/{safe-mode-instance-UY-RZ5fF.js → safe-mode-instance-DPnZDrTR.js} +1 -1
- package/web/assets/safe-mode-sentinel-DNy3YZMh.js +1 -0
- package/web/assets/{session-change-summary-api-CI_mYqV8.js → session-change-summary-api-IM8k3njh.js} +1 -1
- package/web/assets/{session-home-sBII_AAO.js → session-home-BSH7HEmZ.js} +1 -1
- package/web/assets/{session-organization-api-Dt_FNL0d.js → session-organization-api-dGpPgiLe.js} +1 -1
- package/web/assets/{session-scope-SQQU-bRA.js → session-scope-_kqXQnb0.js} +1 -1
- package/web/assets/{session-tree-actions-AdyVzQwO.js → session-tree-actions-WcOcYBo-.js} +1 -1
- package/web/assets/{session-tree-summary-BfBt_ogL.js → session-tree-summary-CpuI5gMj.js} +1 -1
- package/web/assets/session-workspaces-BWTBYaGT.js +1 -0
- package/web/assets/{settings-navigation-DV3N_utl.js → settings-navigation-_yUm71Uk.js} +1 -1
- package/web/assets/{shortcuts-DWF7_dCu.js → shortcuts-BheSJu4D.js} +1 -1
- package/web/assets/{side-chat-context-CtRt4VcS.js → side-chat-context-fHd5qktG.js} +3 -3
- package/web/assets/sidebar-DQjsKcJn.js +2 -0
- package/web/assets/{sidebar-store-Da-3xIaR.js → sidebar-store-0l_ZiIAA.js} +1 -1
- package/web/assets/{speech-session-DjxOmcG7.js → speech-session-CrscgV-X.js} +1 -1
- package/web/assets/startup-queries-B_DpfvaA.js +1 -0
- package/web/assets/{use-i18n-BIJtH0nB.js → use-i18n-BWyVtWF9.js} +1 -1
- package/web/assets/{use-studio-actions-e1FiDWGR.js → use-studio-actions-CdzG_H8p.js} +1 -1
- package/web/assets/{useBoardItems-CzLK6g45.js → useBoardItems-RCXS90vW.js} +1 -1
- package/web/assets/{useFleetSystemInfo-kKFDmOS4.js → useFleetSystemInfo-rj18NGAd.js} +1 -1
- package/web/assets/useNewProjectPicker-q3Albbmn.js +1 -0
- package/web/assets/useNow-DlbPA2gp.js +1 -0
- package/web/assets/{usePhoneShell-BuNqR-TS.js → usePhoneShell-cDHpi_4q.js} +1 -1
- package/web/assets/useQuery-DdcpUQhO.js +1 -0
- package/web/assets/useSessionListQuery-B-MnlVs6.js +2 -0
- package/web/assets/useSessionRowActions-C6dpdoDz.js +1 -0
- package/web/assets/{useSidebarModel-CBd3rSxV.js → useSidebarModel-BIzp9khQ.js} +1 -1
- package/web/assets/{web-preview-DJZpUrZT.js → web-preview-DZqYC0Ca.js} +1 -1
- package/web/assets/{web-preview-events-DRcd0j1W.js → web-preview-events-DQAcSBmI.js} +1 -1
- package/web/assets/workspace-order-store-Cw1fZTM7.js +1 -0
- package/web/index.html +1 -1
- package/web/assets/LaunchConsole-BIiKjt0j.js +0 -2
- package/web/assets/ManageProjectsDialog-CLskSna6.js +0 -1
- package/web/assets/McpPage-DC_9gmSC.js +0 -1
- package/web/assets/SchedulesPage-G1R7ua11.js +0 -1
- package/web/assets/board-messages-xFeTO3o6.js +0 -1
- package/web/assets/board-projects-Dxd3yet9.js +0 -1
- package/web/assets/input-group-CDEyjyK4.js +0 -1
- package/web/assets/launch-defaults-store-DTq_ndTa.js +0 -1
- package/web/assets/mount-app-DQkz4dfd.js +0 -9
- package/web/assets/mutation-Difliohy.js +0 -1
- package/web/assets/placements-Dgq244bc.js +0 -2
- package/web/assets/public-DjZxpaMo.js +0 -1
- package/web/assets/public-diff-BpkmyA3H.js +0 -1
- package/web/assets/public-launch-C4NBmnGZ.js +0 -1
- package/web/assets/runtime-capabilities-BhAMiYhG.js +0 -1
- package/web/assets/safe-mode-sentinel-DnReXgjI.js +0 -1
- package/web/assets/sidebar-DTHEZloM.js +0 -2
- package/web/assets/startup-queries-_OUFiG02.js +0 -1
- package/web/assets/useNow-CpKRH_uQ.js +0 -1
- package/web/assets/useQuery-Bg3cTjsY.js +0 -1
- package/web/assets/useSessionListQuery-jM0IQ1En.js +0 -2
- package/web/assets/useSessionRowActions-BG8yJygF.js +0 -1
|
@@ -1,2 +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-BIJtH0nB.js";import{t as i}from"./useQuery-Bg3cTjsY.js";import{o as a}from"./startup-queries-_OUFiG02.js";import{t as o}from"./runtime-capabilities-store-BvWnn9Kx.js";import{t as s}from"./createLucideIcon-Cd-3GVxJ.js";import{t as ee}from"./arrow-right-DqLOhpA2.js";import{t as c}from"./arrow-up-DST6-qVQ.js";import{t as l}from"./chevron-down-CxtxIjiP.js";import{n as u,r as d,t as f}from"./launch-defaults-store-DTq_ndTa.js";import{t as te}from"./shield-alert-oZqX6MNu.js";import{t as ne}from"./shield-B1ruzHd0.js";import{h as re,l as ie,n as ae,o as oe,s as se,u as ce}from"./FocusRuntimeControls-DyexiBAA.js";import{a as p,c as le,o as m,p as h,r as ue,s as g,t as de}from"./dropdown-menu-CFIFNaKO.js";import{t as _}from"./utils-C8uzG5AZ.js";import{t as fe}from"./button-CCcCN8tE.js";import{c as pe,r as me,t as he}from"./shortcuts-DWF7_dCu.js";import{t as ge}from"./useSessionListQuery-jM0IQ1En.js";import{t as _e}from"./useBoardItems-CzLK6g45.js";import{a as ve}from"./card-presentation-1oph2b8P.js";import{i as ye,n as be,t as xe}from"./board-launch-B2PD2yr-.js";import{t as Se}from"./public-launch-C4NBmnGZ.js";import{t as Ce}from"./shortcut-aria-jHRmld9z.js";import{t as we}from"./touch-target-BsyCgjR5.js";import{a as Te,o as v,r as y,t as b}from"./board-projects-Dxd3yet9.js";var Ee=s(`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`}]]),x=s(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),S=e(t(),1),De=`data-[fade=both]:[mask-image:linear-gradient(to_right,transparent,var(--foreground)_1.25rem,var(--foreground)_calc(100%-1.25rem),transparent)] data-[fade=end]:[mask-image:linear-gradient(to_right,var(--foreground)_calc(100%-1.25rem),transparent)] data-[fade=start]:[mask-image:linear-gradient(to_left,var(--foreground)_calc(100%-1.25rem),transparent)]`;function Oe(e,t=``){let[n,r]=(0,S.useState)();return(0,S.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver!=`function`)return;let n=()=>{let e=t.scrollWidth-t.clientWidth,n=Math.abs(t.scrollLeft),i=e>1&&n>1,a=e>1&&n<e-1;r(i&&a?`both`:i?`start`:a?`end`:void 0)};n();let i=new ResizeObserver(n);i.observe(t);for(let e of Array.from(t.children))i.observe(e);return t.addEventListener(`scroll`,n,{passive:!0}),()=>{i.disconnect(),t.removeEventListener(`scroll`,n)}},[e,t]),n}var C=n();function ke({value:e,onChange:t,size:n,compact:i=!1,className:a}){let{t:o}=r(),{items:s,capabilities:ee}=_e(`today`);if(!ee.sessionQueue)return null;let c=s.filter(e=>e.lane===`running`||e.lane===`queued`),u=s.find(t=>t.id===e);if(!c.length&&!e)return null;let d=u?.title??o(`board:launch.startAfterGone`),f=e?o(`board:launch.startAfterChip`,{title:d}):o(`board:launch.startNowChip`),te=e?o(`board:launch.startAfterShort`,{title:d}):f;return(0,C.jsxs)(de,{children:[(0,C.jsx)(h,{asChild:!0,children:(0,C.jsxs)(ye,{size:n,className:_(`min-w-0 max-w-[24ch] shrink`,e?`min-w-[14ch]`:`border-transparent bg-transparent`,a),title:f,"aria-label":`${o(`board:launch.startAfterLabel`)} · ${f}`,"data-launch-start-after":e||`now`,children:[(0,C.jsx)(x,{"aria-hidden":`true`}),(!i||e)&&(0,C.jsx)(`span`,{className:`min-w-0 truncate`,children:te}),(0,C.jsx)(l,{"aria-hidden":`true`})]})}),(0,C.jsxs)(ue,{align:`start`,className:`max-h-[min(24rem,var(--radix-dropdown-menu-content-available-height))] w-72 overflow-y-auto`,children:[(0,C.jsx)(p,{children:o(`board:launch.startAfterLabel`)}),(0,C.jsxs)(m,{value:e,onValueChange:t,children:[(0,C.jsx)(g,{value:``,children:o(`board:launch.startNowChip`)}),c.map(e=>(0,C.jsx)(g,{value:e.id,"data-start-after-option":e.id,children:(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,C.jsx)(`span`,{className:`truncate`,children:e.title}),(0,C.jsx)(`span`,{className:`text-xs text-content-muted`,children:e.lane===`running`?o(`board:launch.startAfterRunning`):o(`board:launch.startAfterQueued`)})]})},e.id))]}),(0,C.jsx)(`p`,{className:`px-2 py-1.5 text-xs leading-relaxed text-content-muted`,children:o(`board:launch.startAfterHint`)})]})]})}function w(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function T(e){return typeof e==`string`?e:``}function E(e){return(Array.isArray(w(e).providers)?w(e).providers:[]).flatMap(e=>{let t=w(e),n=T(t.id);return!n||t.configured!==!0||t.enabled===!1?[]:(Array.isArray(t.models)?t.models:[]).flatMap(e=>{let r=w(e),i=T(r.id);return!i||r.kind!==`chat`?[]:[{key:`${n}/${i}`,label:T(r.name)||i,providerName:T(t.name)||n,thinkingLevels:Array.isArray(r.thinkingLevels)?r.thinkingLevels.filter(e=>typeof e==`string`):[]}]})})}function Ae(){let e=i(a(`config`)),t=ge(),n=Te(e=>e.names),r=v(e=>e.projects),s=o(e=>e.capabilities.features),ee=(0,S.useMemo)(()=>E(e.data),[e.data]),c=e.data?.provider&&e.data?.model?`${e.data.provider}/${e.data.model}`:``,l=t.data?.sessions,u=(0,S.useMemo)(()=>y(l??[],r,n),[l,n,r]),d=(0,S.useMemo)(()=>b(l??[],u),[l,u]);return{models:ee,defaultModel:c,defaultThinkingLevel:T(e.data?.thinkingLevel)||`medium`,projects:u,defaultCwd:d,goalsAvailable:s.goals!==!1,teamAvailable:s.goals!==!1&&s.multiAgent!==!1,loading:e.isPending,error:e.error??null}}var je=`board:launch`,Me=`home:new`,D=`\0no-project`,Ne=new Set;function Pe(e,t){let n=ie(e).text,r=n.trim()?`${t}\n${n}`:t;ce(e,{text:r});for(let t of Ne)t.key===e&&t.apply(r)}function Fe(){let{t:e}=r();return(0,S.useMemo)(()=>({thinking:t=>({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,execution:{"approval-required":e(`chat:focusSession.approvalRequired`),"workspace-write":e(`chat:focusSession.workspaceWrite`),"full-access":e(`chat:focusSession.fullAccess`)},runMode:{plan:e(`chat:focusSession.planMode`),goal:e(`chat:focusSession.goalMode`),team:e(`chat:focusSession.teamMode`)}}),[e])}function Ie(e){return!e.value||e.selectionStart===0&&e.selectionEnd===0}var O=(0,S.forwardRef)(function({variant:e,autoFocus:t,compactChips:n,touch:i,onDispatched:a,onDetachedFailure:o,onConfigureModels:s,className:ge},Te){let{t:v}=r(),y=Fe(),b=Ae(),x=u(),w=pe(e=>e.bindings.sendMessage),T=(0,S.useRef)(null),E=(0,S.useRef)(null),O=e===`composer`?Me:je,Le=e=>Pe(O,e),[k,Re]=(0,S.useState)(()=>ie(O).text),[A,j]=(0,S.useState)(null),[M,ze]=(0,S.useState)(0),[N,Be]=(0,S.useState)(!1),[P,Ve]=(0,S.useState)(``),{items:He}=_e(`today`),Ue=P?He.find(e=>e.id===P)?.title??v(`board:launch.startAfterGone`):``,F=(0,S.useRef)(!0),I=`launch-input-${e}`,We=`launch-error-${e}`;(0,S.useEffect)(()=>{F.current=!0;let e={key:O,apply:e=>Re(e)};return Ne.add(e),()=>{F.current=!1,Ne.delete(e)}},[O]);let L=(0,S.useCallback)(e=>{Re(e),ce(O,{text:e})},[O]);(0,S.useImperativeHandle)(Te,()=>({focus:()=>T.current?.focus(),focusEnd:()=>{let e=T.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length),e.scrollTop=e.scrollHeight)},fill:e=>{L(e),T.current?.focus()}}),[L]);let Ge=b.models.some(e=>e.key===x.model),R=Ge?x.model:b.defaultModel,z=b.models.find(e=>e.key===R)?.thinkingLevels??[],B=z.includes(x.thinkingLevel)?x.thinkingLevel:``,Ke=B||(z.includes(b.defaultThinkingLevel)?b.defaultThinkingLevel:``),V=N?`full-access`:x.executionMode||`approval-required`,H=x.runMode===`team`&&!b.teamAvailable||x.runMode===`goal`&&!b.goalsAvailable?`plan`:x.runMode,U=(0,S.useMemo)(()=>{if(!x.cwd||b.projects.some(e=>e.cwd===x.cwd))return b.projects;let e=x.cwd.replace(/[\\/]+$/,``).split(/[\\/]/).pop()||x.cwd;return[{key:x.cwd,cwd:x.cwd,label:e},...b.projects]},[x.cwd,b.projects]),W=(0,S.useMemo)(()=>ve(U),[U]),G=x.projectless,K=G?``:x.cwd||b.defaultCwd||U[0]?.cwd||``,q=G?void 0:U.find(e=>e.cwd===K),qe=q?.label||v(G?`board:launch.noProject`:`board:launch.defaultProject`),Je=!b.loading&&!b.error&&b.models.length===0,Ye=e=>{if(U.length<2)return!1;let t=Math.max(0,U.findIndex(e=>e.cwd===K)),n=U[(t+e+U.length)%U.length];return x.rememberLaunch({cwd:n.cwd}),!0},Xe=e=>{Be(e===`full-access`),e!==`full-access`&&x.rememberLaunch({executionMode:e})},Ze=(0,S.useCallback)(()=>Se(K),[K]),Qe=re({t:v,models:b.models,model:R,onModel:e=>x.rememberLaunch({model:e,thinkingLevel:``}),thinkingLevels:z,thinkingLevel:Ke,thinkingLabel:y.thinking,onThinking:e=>x.rememberLaunch({thinkingLevel:e}),executionModes:f,executionMode:V,executionLabel:e=>y.execution[e]||e,onExecutionMode:e=>Xe(e),runModes:[`plan`,...b.goalsAvailable?[`goal`]:[],...b.teamAvailable?[`team`]:[]],runMode:H,runModeLabel:e=>y.runMode[e]||e,onRunMode:e=>x.rememberLaunch({runMode:e})}),$e=(0,C.jsx)(oe,{placement:e===`composer`?`top`:`bottom`,resourceKey:K,loadCommands:Ze,builtinCommands:Qe,value:k,onChange:L,inputRef:T}),J=e===`composer`,et=Oe(E,J?`${K}|${R}|${V}|${H}`:``),Y=async e=>{let t=k.trim();if(!t){T.current?.focus();return}if(J&&M>0)return;if(Je){j({message:v(`board:launch.noModel`),noModel:!0});return}j(null),L(``),se(O),T.current?.focus(),ze(e=>e+1),Be(!1),x.rememberLaunch({...G?{projectless:G}:{cwd:K},model:Ge?R:``,thinkingLevel:B,executionMode:V,runMode:H});let n=P;Ve(``);try{let r=await be({prompt:t,cwd:K,projectless:G,model:Ge?R:``,thinkingLevel:B,executionMode:N?`full-access`:x.executionMode,runMode:H,...n?{startAfter:n}:{}});a?.(r,{open:e})}catch(e){Le(t),F.current&&n&&Ve(n);let r=e instanceof xe||e instanceof Error?e.message:``,i=r?v(`board:launch.failedWithReason`,{reason:r}):v(`board:launch.failed`);F.current?j({message:i,noModel:!1}):o?.(i)}finally{F.current&&ze(e=>Math.max(0,e-1))}},tt=e=>{if(!(e.nativeEvent.isComposing||e.keyCode===229)){if(J){if(me(e.nativeEvent,w)){e.preventDefault(),Y(!0);return}}else if(e.key===`Enter`&&!e.shiftKey&&!e.altKey){e.preventDefault(),Y(e.metaKey||e.ctrlKey);return}e.key===`Tab`&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&Ie(e.currentTarget)&&Ye(1)&&e.preventDefault()}},nt=k.split(`
|
|
2
|
-
`).length,X=e===`sheet`,rt=n||X,Z=X||J?`default`:`sm`,it=X?`min-h-11`:Z===`sm`?`pointer-coarse:min-h-11`:void 0,at=(0,C.jsxs)(de,{children:[(0,C.jsx)(h,{asChild:!0,children:(0,C.jsxs)(ye,{size:Z,className:_(X?`max-w-[13ch] min-w-0 shrink`:J&&i?`max-w-[14ch]`:`max-w-[24ch] min-w-0 shrink`,X?`min-h-11`:Z===`sm`?we:void 0),title:q?.cwd||void 0,"aria-label":v(`board:launch.projectLabel`,{project:q?W.get(q.key)?`${q.label} (${W.get(q.key)})`:q.label:qe}),children:[(0,C.jsx)(d,{"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:_(`truncate`,q?.label&&!X?`min-w-[8ch] font-mono`:`min-w-0`,q?.label&&X&&`font-mono`),children:qe}),(0,C.jsx)(l,{"aria-hidden":`true`})]})}),(0,C.jsx)(ue,{align:`start`,className:`max-h-[min(24rem,var(--radix-dropdown-menu-content-available-height))] w-64 overflow-y-auto`,children:(0,C.jsxs)(m,{value:G?D:K,onValueChange:e=>x.rememberLaunch(e===D?{projectless:!0}:{cwd:e}),children:[(0,C.jsx)(g,{value:D,children:(0,C.jsx)(`span`,{className:`min-w-0 truncate`,children:v(`board:launch.noProject`)})}),(0,C.jsx)(le,{}),(0,C.jsx)(p,{children:v(`board:launch.projects`)}),U.length===0&&(0,C.jsx)(g,{value:``,children:v(`board:launch.defaultProject`)}),U.map(e=>(0,C.jsxs)(g,{value:e.cwd,title:e.cwd,children:[(0,C.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.label}),W.get(e.key)&&(0,C.jsx)(`span`,{className:`ml-auto min-w-0 truncate pl-2 font-mono text-xs text-content-muted`,children:W.get(e.key)})]},e.key))]})})]}),ot=(0,C.jsx)(ae,{sheet:X,side:J?`top`:`bottom`,model:R,models:b.models,onModelChange:e=>x.rememberLaunch({model:e,thinkingLevel:``}),thinkingLevel:Ke,levels:z,status:b.loading?``:`supported`,onThinkingChange:e=>x.rememberLaunch({thinkingLevel:e}),thinkingIsDefault:!B,onThinkingReset:()=>x.rememberLaunch({thinkingLevel:``}),modelDisabled:!b.models.length,triggerClassName:_(X?`max-w-[13ch]`:`max-w-[24ch]`,it)}),st=V===`full-access`?te:ne,Q=H===`plan`?y.execution[V]:`${y.runMode[H]} · ${y.execution[V]}`,ct=(0,C.jsxs)(de,{children:[(0,C.jsx)(h,{asChild:!0,children:(0,C.jsxs)(ye,{size:Z,className:_(`min-w-0 max-w-[26ch] border-transparent bg-transparent`,X&&`flex-none`,it),title:`${v(`chat:focusSession.approvalMode`)} · ${Q}${N?` · ${v(`board:launch.fullAccessOnce`)}`:``}`,"aria-label":`${v(`chat:focusSession.approvalMode`)} · ${Q}${N?` · ${v(`board:launch.fullAccessOnce`)}`:``}`,"data-launch-mode":`${H}:${V}`,children:[(0,C.jsx)(st,{"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`truncate`,children:rt&&H===`plan`&&V!==`full-access`?``:Q}),(0,C.jsx)(l,{"aria-hidden":`true`})]})}),(0,C.jsxs)(ue,{align:`start`,className:`w-64`,children:[(0,C.jsx)(p,{children:v(`chat:focusSession.approvalMode`)}),(0,C.jsx)(m,{value:V,onValueChange:e=>Xe(e),children:f.map(e=>(0,C.jsx)(g,{value:e,children:e===`full-access`?(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,C.jsx)(`span`,{children:y.execution[e]}),(0,C.jsx)(`span`,{className:`text-xs text-content-muted`,children:v(`board:launch.fullAccessOnce`)})]}):y.execution[e]},e))}),(b.goalsAvailable||b.teamAvailable)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(le,{}),(0,C.jsx)(p,{children:v(`chat:focusSession.executionMode`)}),(0,C.jsxs)(m,{value:H,onValueChange:e=>x.rememberLaunch({runMode:e}),children:[(0,C.jsx)(g,{value:`plan`,children:y.runMode.plan}),b.goalsAvailable&&(0,C.jsx)(g,{value:`goal`,children:y.runMode.goal}),b.teamAvailable&&(0,C.jsx)(g,{value:`team`,children:y.runMode.team})]})]})]})]}),lt=(0,C.jsx)(ke,{value:P,onChange:Ve,size:Z,compact:rt,className:_(it,X&&`flex-none`)}),ut=(0,C.jsxs)(`div`,{ref:E,"data-fade":et,"data-launch-chips":!0,className:_(`flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto [scrollbar-width:none]`,De),children:[at,ct,lt]}),dt=J?(0,C.jsx)(fe,{type:`button`,size:`icon`,className:_(`flex-none rounded-full`,i?`size-11`:`size-8 pointer-coarse:size-11`),disabled:M>0,"aria-label":v(`board:home.send`),"aria-keyshortcuts":Ce(w),title:w?`${v(`board:home.send`)} (${he(w)})`:void 0,"data-launch-send":!0,onClick:()=>void Y(!1),children:(0,C.jsx)(c,{"aria-hidden":`true`})}):(0,C.jsxs)(fe,{type:`button`,size:`sm`,className:_(`flex-none`,X&&`min-h-11 px-4`),onClick:()=>void Y(!1),"aria-keyshortcuts":`Enter`,children:[v(`board:launch.dispatch`),!X&&(0,C.jsx)(Ee,{"aria-hidden":`true`,className:`opacity-70`})]}),$=A&&(0,C.jsxs)(`p`,{id:We,role:`alert`,className:`flex min-w-0 items-center gap-2 text-xs text-st-fail`,children:[(0,C.jsx)(`span`,{className:`min-w-0 truncate`,children:A.message}),A.noModel&&(0,C.jsxs)(fe,{variant:`link`,size:`xs`,className:`h-auto px-0`,onClick:s,children:[v(`board:launch.configureModels`),(0,C.jsx)(ee,{"aria-hidden":`true`})]})]}),ft=M>0&&(0,C.jsx)(`span`,{role:`status`,className:`flex-none text-xs text-content-muted`,children:J?v(`board:home.sending`):v(`board:launch.sending`,{count:M})});return J?(0,C.jsxs)(`section`,{"aria-label":v(`board:home.composerLabel`),"data-launch-console":e,className:_(`flex min-w-0 flex-col rounded-[var(--composer-radius,22px)] border border-control bg-panel shadow-composer transition-[border-color,box-shadow] duration-(--d-fast) has-[textarea:focus-visible]:border-focus has-[textarea:focus-visible]:ring-3 has-[textarea:focus-visible]:ring-focus-ring max-[650px]:rounded-2xl`,ge),children:[(0,C.jsx)(`label`,{htmlFor:I,className:`sr-only`,children:v(`board:launch.inputLabel`)}),$e,(0,C.jsx)(`textarea`,{ref:T,id:I,"data-launch-input":!0,autoFocus:t,rows:Math.min(6,Math.max(2,nt)),value:k,placeholder:i?v(`board:home.placeholderTouch`):w?v(`board:home.placeholder`,{send:he(w)}):v(`board:home.placeholderUnbound`),"aria-invalid":A?!0:void 0,"aria-describedby":A?We:void 0,"aria-keyshortcuts":Ce(w),onChange:e=>{L(e.target.value),A&&!A.noModel&&j(null)},onKeyDown:tt,className:_(`max-h-[220px] min-h-11 w-full min-w-0 resize-none bg-transparent px-4 pt-3 pb-1 text-[length:calc(var(--app-message-font-size)*.9375)] leading-5 text-content outline-none placeholder:text-content-muted max-[650px]:px-3.5`,i&&`text-[length:var(--app-message-font-size)]`)}),$&&(0,C.jsx)(`div`,{className:`px-4 max-[650px]:px-3.5`,children:$}),(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 px-2 pt-1 pb-2`,"data-launch-toolbar":!0,children:[ut,ft,(0,C.jsx)(`span`,{className:`flex min-w-0 shrink items-center`,children:ot}),dt]})]}):(0,C.jsxs)(`section`,{"aria-label":v(`board:launch.title`),"data-launch-console":e,className:_(`flex min-w-0 flex-col`,ge),children:[(0,C.jsx)(`label`,{htmlFor:I,className:`sr-only`,children:v(`board:launch.inputLabel`)}),$e,(0,C.jsx)(`textarea`,{ref:T,id:I,"data-launch-input":!0,autoFocus:t,rows:Math.min(8,Math.max(3,nt)),value:k,placeholder:v(X?`board:launch.placeholderTouch`:`board:launch.placeholder`),"aria-invalid":A?!0:void 0,"aria-describedby":A?We:void 0,"aria-keyshortcuts":`Enter Meta+Enter Control+Enter Shift+Enter`,onChange:e=>{L(e.target.value),A&&!A.noModel&&j(null)},onKeyDown:tt,className:_(`w-full min-w-0 resize-none bg-transparent text-content caret-st-attn-fill outline-none placeholder:text-content-muted`,X?`max-h-[40dvh] min-h-[88px] rounded-[var(--r-md)] border border-control bg-panel px-3 py-2.5 text-[16px] leading-6 transition-[border-color,box-shadow] duration-(--d-fast) focus-visible:border-focus focus-visible:ring-3 focus-visible:ring-focus-ring`:`max-h-[240px] min-h-[72px] px-5 pt-1 pb-2 text-[15px] leading-6`)}),$&&(0,C.jsx)(`div`,{className:X?`pt-1.5`:`px-5 pb-1`,children:$}),Ue&&(0,C.jsx)(`p`,{"data-launch-start-after-note":!0,className:_(`text-xs text-content-muted`,X?`pt-1.5`:`px-5 pb-1`),children:v(`board:launch.startAfterNote`,{title:Ue})}),(0,C.jsxs)(`div`,{className:_(`flex min-w-0 items-center gap-1.5`,X?`pt-2`:`px-3 pb-3`),"data-launch-toolbar":!0,children:[(0,C.jsxs)(`div`,{ref:E,"data-launch-chips":!0,className:`flex min-w-0 flex-[1_1_auto] items-center gap-1.5 overflow-hidden`,children:[at,ct,lt]}),ft,(0,C.jsx)(`span`,{className:`flex min-w-0 shrink items-center`,children:ot}),dt]})]})});export{O 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-BIJtH0nB.js";import{t as i}from"./createLucideIcon-Cd-3GVxJ.js";import{t as a}from"./arrow-down-CDGua-ue.js";import{t as o}from"./arrow-up-DST6-qVQ.js";import{t as s}from"./folder-plus-OPHZsJho.js";import{t as c}from"./pencil-U08v_vV9.js";import{t as l}from"./rotate-ccw-C0v8V77_.js";import{t as u}from"./trash-2-CNrPOoPR.js";import{t as d}from"./utils-C8uzG5AZ.js";import{n as f,t as p}from"./button-CCcCN8tE.js";import{t as m}from"./useSessionListQuery-jM0IQ1En.js";import{s as h}from"./card-presentation-1oph2b8P.js";import{a as g,i as _,l as v,n as y,o as b,s as x,t as S}from"./dialog-Bs9_FZX7.js";import{a as C,n as w,o as T}from"./board-projects-Dxd3yet9.js";var E=i(`folder-minus`,[[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),D=e(t(),1),O=n(),k=`flex-none pointer-coarse:size-11 in-data-[phone-shell]:size-11`;function A({open:e,onOpenChange:t,commands:n}){let{t:i}=r(),A=m(),j=C(e=>e.order),M=C(e=>e.names),N=T(e=>e.projects),P=C(e=>e.rememberWorkspaces),F=C(e=>e.moveWorkspace),I=(0,D.useRef)(null),L=(0,D.useRef)(null),[R,z]=(0,D.useState)(null),[B,V]=(0,D.useState)(null),H=(0,D.useMemo)(()=>w(A.data?.sessions??[],N,M,j,i(`board:filter.noProject`)),[A.data,M,j,N,i]),U=(0,D.useMemo)(()=>H.map(e=>e.key),[H]);(0,D.useEffect)(()=>{e&&U.length&&P(U)},[U,e,P]),(0,D.useEffect)(()=>{if(!R)return;let e=I.current,t=t=>e?.querySelector(`[data-project-move="${t}"][data-project-key="${CSS.escape(R.key)}"]`),n=t(R.offset);(n&&!n.disabled?n:t(R.offset===-1?1:-1))?.focus(),z(null)},[R,H]),(0,D.useEffect)(()=>{B&&(V(null),!H.some(e=>e.key===B.key)&&((B.next?I.current?.querySelector(`[data-project-remove][data-project-key="${CSS.escape(B.next)}"]`):null)??L.current)?.focus())},[H,B]);let W=(e,t)=>{F(e.key,t,U),z({key:e.key,offset:t})},G=async(e,t)=>{let r=H[t+1]?.key??H[t-1]?.key??``;e.count===0?n.unregister(e):await n.remove(e),V({key:e.key,next:r})},K=!!n.busyKey,q;return q=A.isPending?(0,O.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 py-6 text-sm text-content-muted`,children:[(0,O.jsx)(f,{className:`size-4`}),i(`board:project.loading`)]}):A.error&&!A.data?(0,O.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-2 py-6 text-sm`,children:[(0,O.jsx)(`p`,{className:`text-content`,children:i(`board:project.error`)}),(0,O.jsx)(p,{variant:`secondary`,size:`sm`,onClick:()=>void A.refetch(),children:i(`board:page.retry`)})]}):H.length===0?(0,O.jsxs)(`div`,{className:`flex flex-col gap-1 py-6 text-sm`,children:[(0,O.jsx)(`p`,{className:`font-medium text-content`,children:i(`board:project.empty`)}),(0,O.jsx)(`p`,{className:`text-content-muted`,children:i(`board:project.emptyHint`)})]}):(0,O.jsx)(`ul`,{ref:I,"aria-label":i(`board:project.listLabel`),className:`flex flex-col divide-y divide-stroke-soft`,"data-manage-projects":!0,children:H.map((e,t)=>{let r=n.busyKey===e.key,s=e.cwd&&e.key!==`\0`,m=e.count===0,g=i(m?`board:project.removeNamed`:`board:project.deleteWithChatsNamed`,{project:e.label});return(0,O.jsxs)(`li`,{"data-project-row":e.key,"data-project-registered-only":m||void 0,"aria-busy":r||void 0,className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 py-2`,children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-7 flex-none place-items-center rounded-sm border border-stroke-strong bg-solid font-mono text-xs font-semibold text-content uppercase`,children:Array.from(e.label)[0]||`·`}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,O.jsx)(`span`,{className:`truncate font-mono text-sm font-semibold text-content`,children:e.label}),(0,O.jsx)(`span`,{className:`truncate font-mono text-xs text-content-muted`,title:e.cwd||void 0,children:e.custom?`${i(`board:project.folderName`,{name:e.folderLabel})} · ${h(e.cwd)}`:e.cwd?h(e.cwd):``})]}),(0,O.jsx)(`span`,{className:`flex-none text-xs text-content-muted tabular-nums max-[480px]:hidden`,children:r?i(`board:project.deleting`):i(`board:project.sessions`,{count:e.count})}),(0,O.jsxs)(`span`,{className:`flex flex-none items-center max-[480px]:w-full max-[480px]:justify-end`,children:[(0,O.jsx)(p,{variant:`ghost`,size:`icon-sm`,className:k,"data-project-move":`-1`,"data-project-key":e.key,disabled:t===0,"aria-label":i(`board:project.moveUp`,{project:e.label}),title:i(`board:project.moveUp`,{project:e.label}),onClick:()=>W(e,-1),children:(0,O.jsx)(o,{"aria-hidden":`true`})}),(0,O.jsx)(p,{variant:`ghost`,size:`icon-sm`,className:k,"data-project-move":`1`,"data-project-key":e.key,disabled:t===H.length-1,"aria-label":i(`board:project.moveDown`,{project:e.label}),title:i(`board:project.moveDown`,{project:e.label}),onClick:()=>W(e,1),children:(0,O.jsx)(a,{"aria-hidden":`true`})}),s&&(0,O.jsx)(p,{variant:`ghost`,size:`icon-sm`,className:k,"aria-label":i(`board:project.renameNamed`,{project:e.label}),title:i(`board:project.renameNamed`,{project:e.label}),onClick:()=>void n.rename(e),children:(0,O.jsx)(c,{"aria-hidden":`true`})}),s&&e.custom&&(0,O.jsx)(p,{variant:`ghost`,size:`icon-sm`,className:k,"aria-label":i(`board:project.resetNamed`,{project:e.label}),title:i(`board:project.resetNamed`,{project:e.label}),onClick:()=>n.resetName(e),children:(0,O.jsx)(l,{"aria-hidden":`true`})}),(0,O.jsx)(p,{variant:`ghost`,size:`icon-sm`,className:d(k,!m&&`text-danger hover:text-danger`),disabled:K,"data-project-remove":m?`unregister`:`delete`,"data-project-key":e.key,"aria-label":g,title:g,onClick:()=>void G(e,t),children:r?(0,O.jsx)(f,{className:`size-4`}):m?(0,O.jsx)(E,{"aria-hidden":`true`}):(0,O.jsx)(u,{"aria-hidden":`true`})})]})]},e.key)})}),(0,O.jsx)(S,{open:e,onOpenChange:t,children:(0,O.jsxs)(_,{size:`wide`,scrollMode:`body`,"aria-describedby":`board-manage-projects`,onOpenAutoFocus:e=>{e.preventDefault(),L.current?.focus()},children:[(0,O.jsxs)(x,{children:[(0,O.jsx)(v,{children:i(`board:project.manageTitle`)}),(0,O.jsx)(g,{id:`board-manage-projects`,children:i(`board:project.manageDescription`)})]}),(0,O.jsx)(y,{className:`-mx-1 px-1`,children:q}),(0,O.jsxs)(b,{children:[(0,O.jsxs)(p,{variant:`outline`,size:`dialogAction`,disabled:n.picking,onClick:()=>{t(!1),n.newProject()},children:[(0,O.jsx)(s,{"aria-hidden":`true`}),i(`board:project.new`)]}),(0,O.jsx)(p,{ref:L,size:`dialogAction`,onClick:()=>t(!1),children:i(`board:project.done`)})]})]})})}export{A as ManageProjectsDialog};
|
|
@@ -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-BIJtH0nB.js";import{S as i,c as a,g as o,m as s,r as c,t as l,u,v as d,y as f}from"./useQuery-Bg3cTjsY.js";import{n as p}from"./mutation-Difliohy.js";import{t as m}from"./queryOptions-Dfvzj6n2.js";import{a as h,l as g}from"./api-DxQIocGp.js";import{t as _}from"./check-2vYc6QaP.js";import{t as v}from"./copy-DHmIFc52.js";import{t as ee}from"./key-round-C29uZbsf.js";import{t as y}from"./plus-fQbSqB1n.js";import{t as te}from"./refresh-cw-TbWxTY4K.js";import{t as b}from"./rotate-ccw-clock-CO6Bw-sF.js";import{t as x}from"./server-BgNvmqwJ.js";import{t as S}from"./trash-2-CNrPOoPR.js";import{t as C}from"./wrench-6pg6_bqI.js";import{t as w}from"./x-07u4-129.js";import{t as T}from"./more-pages-D_PnxLN0.js";import{t as E}from"./switch-D_G8wFhs.js";import{t as D}from"./utils-C8uzG5AZ.js";import{n as O,t as k}from"./button-CCcCN8tE.js";import{s as ne}from"./shortcuts-DWF7_dCu.js";import{a as A}from"./format-DMJQzoZ7.js";import{n as j,t as M}from"./PageState-Cz6vFMXv.js";import{a as N,i as P,l as F,o as I,s as L,t as re}from"./dialog-Bs9_FZX7.js";import{t as R}from"./textarea-DmATpOqT.js";import{t as z}from"./alert-firawb0H.js";import{a as ie,i as B,n as V,o as ae,r as oe,s as se}from"./FeaturePage-RH3fTWIk.js";var ce=class extends i{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),d(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&u(t.mutationKey)!==u(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??p();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){a.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},H=e(t(),1);function le(e,t){let n=c(t);return ue({filters:{...e,status:`pending`}},n).length}function U(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function ue(e={},t){let n=c(t).getMutationCache(),r=H.useRef(e),i=H.useRef(null);return i.current===null&&(i.current=U(n,e)),H.useEffect(()=>{r.current=e}),H.useSyncExternalStore(H.useCallback(e=>n.subscribe(()=>{let t=o(i.current,U(n,r.current));i.current!==t&&(i.current=t,a.schedule(e))}),[n]),()=>i.current,()=>i.current)}function de(e,t){let n=c(t),[r]=H.useState(()=>new ce(n,e));H.useEffect(()=>{r.setOptions(e)},[r,e]);let i=H.useSyncExternalStore(H.useCallback(e=>r.subscribe(a.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=H.useCallback((e,t)=>{r.mutate(e,t).catch(s)},[r]);if(i.error&&f(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function W(e){if(!e||typeof e!=`object`||Array.isArray(e))throw g();return Object.fromEntries(Object.entries(e))}function G(e,t=!1){if(e==null&&!t)return``;if(typeof e!=`string`||t&&!e)throw g();return e}function K(e,t=0){if(e==null)return t;if(typeof e!=`number`||!Number.isFinite(e))throw g();return e}function q(e){if(typeof e!=`boolean`)throw g();return e}function fe(e,t){if(e===void 0)return[];if(!Array.isArray(e))throw g();return e.map(t)}function pe(e){let t=W(e);return{id:G(t.id,!0),name:G(t.name,!0),status:G(t.status),transport:G(t.transport),endpoint:G(t.endpoint),command:G(t.command),workingDirectory:G(t.workingDirectory),enabled:q(t.enabled),error:G(t.error),latencyMs:t.latencyMs==null?null:K(t.latencyMs),lastPingAt:G(t.lastPingAt),auth:G(t.auth),authCount:K(t.authCount)}}function me(e){let t=W(e);return{serviceId:G(t.serviceId,!0),serviceName:G(t.serviceName),name:G(t.name,!0),piName:G(t.piName,!0),description:G(t.description),enabled:q(t.enabled),serviceEnabled:q(t.serviceEnabled),risk:G(t.risk)}}function he(e){let t=W(e);return{id:G(t.id,!0),serviceId:G(t.serviceId,!0),toolName:G(t.toolName),timestamp:G(t.timestamp),status:G(t.status),error:G(t.error),durationMs:K(t.durationMs)}}function J(e){let t=W(e);if(!Array.isArray(t.services))throw g();let n=t.metrics===void 0?{}:W(t.metrics);return{services:t.services.map(pe),tools:fe(t.tools,me),calls:fe(t.calls,he),metrics:{totalServices:K(n.totalServices),onlineServices:K(n.onlineServices),availableTools:K(n.availableTools),restrictedTools:K(n.restrictedTools),errorRate:K(n.errorRate)}}}var Y=e=>`/api/mcp/${encodeURIComponent(e)}`,X={dashboard:e=>h(`/api/mcp?refresh=0`,{signal:e,parse:J}),add:e=>h(`/api/mcp`,{method:`POST`,body:{spec:e},parse:J}),setServerEnabled:(e,t)=>h(Y(e),{method:`PATCH`,body:{enabled:t},parse:J}),setToolEnabled:(e,t,n)=>h(`${Y(e)}/tools/${encodeURIComponent(t)}`,{method:`PATCH`,body:{enabled:n},parse:J}),test:e=>h(`${Y(e)}/test`,{method:`POST`,body:{},parse:J}),remove:async e=>(await h(Y(e),{method:`DELETE`}),X.dashboard())};function ge(e){if(!e||typeof e!=`object`||Array.isArray(e))throw g();return Object.fromEntries(Object.entries(e))}function _e(e){let t=ge(e);if(typeof t.enabled!=`boolean`||typeof t.listening!=`boolean`||typeof t.host!=`string`||typeof t.port!=`number`||!Number.isInteger(t.port)||typeof t.url!=`string`||t.error!==null&&typeof t.error!=`string`)throw g();return{enabled:t.enabled,listening:t.listening,host:t.host,port:t.port,url:t.url,error:t.error}}function ve(e){let t=ge(e);if(typeof t.url!=`string`||!t.url||typeof t.token!=`string`||!t.token)throw g();return{url:t.url,token:t.token}}var Z={status:e=>h(`/api/mcp-host`,{signal:e,parse:_e}),setEnabled:e=>h(`/api/mcp-host`,{method:`PATCH`,body:{enabled:e},parse:_e}),credentials:e=>h(`/api/mcp-host/credentials`,{method:`POST`,body:{},signal:e,parse:ve}),rotateToken:e=>h(`/api/mcp-host/rotate-token`,{method:`POST`,body:{},signal:e,parse:ve})},Q=n(),ye=[`mcp-host`,`status`];function be(e){return JSON.stringify({mcpServers:{pisper:{url:e.url,headers:{Authorization:`Bearer ${e.token}`}}}},null,2)}function xe({notify:e,requestConfirm:t}){let{t:n}=r(),i=c(),[a,o]=(0,H.useState)(!1),[s,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(null),[h,g]=(0,H.useState)(``),_=(0,H.useRef)(null),y=(0,H.useRef)(null),b=typeof window<`u`&&!!window.__PISPER_MOBILE_APP__,S=l({queryKey:ye,queryFn:({signal:e})=>Z.status(e),enabled:!b&&!a,refetchInterval:15e3});if((0,H.useEffect)(()=>()=>{_.current?.abort()},[]),b)return null;let C=S.data,w=p?be(p):``,T=()=>{_.current?.abort(),_.current=null,m(null),g(``),f(!1)},ne=async()=>{_.current?.abort();let e=new AbortController;_.current=e,u(!0),m(null),g(``),f(!0);try{let t=await Z.credentials(e.signal);e.signal.aborted||m(t)}catch(t){e.signal.aborted||g(t instanceof Error?t.message:n(`mcp:hostLoadFailed`))}finally{_.current===e&&(_.current=null,u(!1))}},A=async t=>{o(!0);try{let r=await Z.setEnabled(t);i.setQueryData(ye,r),t||T(),e(r.error||n(t?`mcp:hostEnabledNotice`:`mcp:hostDisabledNotice`),r.error?`error`:`success`)}catch(t){e(t instanceof Error?t.message:n(`mcp:hostUpdateFailed`),`error`)}finally{o(!1)}},j=async()=>{if(t&&!await t({title:n(`mcp:hostRotateTitle`),message:n(`mcp:hostRotateWarning`),confirmLabel:n(`mcp:hostRotate`),tone:`danger`}))return;_.current?.abort();let r=new AbortController;_.current=r,u(!0),g(``),m(null);try{let t=await Z.rotateToken(r.signal);r.signal.aborted||(m(t),e(n(`mcp:hostRotatedNotice`),`success`))}catch(e){r.signal.aborted||g(e instanceof Error?e.message:n(`mcp:hostRotateFailed`))}finally{_.current===r&&(_.current=null,u(!1))}},M=async()=>{try{await navigator.clipboard.writeText(w),e(n(`mcp:hostCopied`),`success`)}catch{y.current?.select(),e(n(`mcp:hostCopyManually`),`error`)}};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(V,{className:`mcp-host mt-7`,children:(0,Q.jsx)(B,{"data-mcp-host":!0,icon:(0,Q.jsx)(x,{}),name:n(`mcp:hostTitle`),description:n(`mcp:hostDescription`),status:C&&(0,Q.jsxs)(`span`,{className:D(`flex items-center gap-1.5`,!C.listening&&C.enabled&&`font-medium text-st-attn`),children:[!C.listening&&C.enabled&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none rounded-full bg-st-attn-fill`}),C.listening?n(`mcp:hostReady`):C.enabled?n(`mcp:hostUnavailable`):n(`mcp:disabled`)]}),actions:(0,Q.jsx)(E,{checked:!!C?.enabled,disabled:!C||a,"aria-label":n(`mcp:hostEnabled`),title:n(`mcp:hostEnabled`),onCheckedChange:e=>void A(e)}),detail:S.isPending||S.error||C?.error||C?.listening?(0,Q.jsxs)(`div`,{className:`grid gap-2`,children:[S.isPending&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-content-muted`,children:n(`mcp:loading`)}),S.error&&(0,Q.jsxs)(z,{className:`flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{children:S.error.message}),(0,Q.jsx)(k,{size:`sm`,variant:`ghost`,className:`max-[650px]:h-11`,onClick:()=>void S.refetch(),children:n(`mcp:retry`)})]}),C?.error&&(0,Q.jsx)(z,{role:`status`,className:`text-xs text-muted-foreground`,children:C.error}),C?.listening&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,Q.jsx)(`code`,{className:`max-w-full min-w-0 rounded-xs border border-stroke bg-code px-2 py-0.5 font-mono text-xs break-all text-content`,children:C.url}),(0,Q.jsxs)(k,{size:`sm`,variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>void ne(),children:[(0,Q.jsx)(ee,{"data-icon":`inline-start`}),n(`mcp:hostShowConfig`)]})]})]}):void 0})}),(0,Q.jsx)(re,{open:d,onOpenChange:e=>!e&&T(),children:(0,Q.jsxs)(P,{className:`min-w-0 grid-cols-[minmax(0,1fr)] sm:max-w-xl`,children:[(0,Q.jsxs)(L,{className:`min-w-0 pr-8 text-left`,children:[(0,Q.jsx)(F,{children:n(`mcp:hostConfigTitle`)}),(0,Q.jsx)(N,{className:`leading-5`,children:n(`mcp:hostConfigDescription`)})]}),s&&(0,Q.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-content-muted`,children:[(0,Q.jsx)(O,{}),n(`mcp:hostLoadingConfig`)]}),h&&(0,Q.jsx)(z,{role:`alert`,className:`text-sm text-muted-foreground`,children:h}),p&&(0,Q.jsx)(R,{ref:y,value:w,readOnly:!0,spellCheck:!1,"aria-label":n(`mcp:hostConfigTitle`),className:`h-52 max-h-[45dvh] resize-y bg-code font-mono text-xs [overflow-wrap:anywhere]`,onFocus:e=>e.currentTarget.select()}),(0,Q.jsxs)(I,{className:`min-w-0 flex-wrap`,children:[(0,Q.jsxs)(k,{variant:`secondary`,disabled:s,onClick:()=>void j(),children:[(0,Q.jsx)(te,{"data-icon":`inline-start`}),n(`mcp:hostRotate`)]}),(0,Q.jsxs)(k,{disabled:!p||s,onClick:()=>void M(),children:[(0,Q.jsx)(v,{"data-icon":`inline-start`}),n(`mcp:hostCopyConfig`)]})]})]})})]})}var $=[`mcp`,`dashboard`],Se=[`mcp`,`change`];function Ce(){return m({queryKey:$,queryFn:({signal:e})=>X.dashboard(e),staleTime:0,retry:!1})}function we(e){return{mutationKey:Se,scope:{id:`mcp-dashboard`},retry:!1,mutationFn:async t=>(await e.cancelQueries({queryKey:$}),t()),onSuccess:t=>e.setQueryData($,t),onSettled:()=>e.invalidateQueries({queryKey:$})}}function Te(){let e=c(),t=le({mutationKey:Se})>0,n=l({...Ce(),enabled:!t,refetchInterval:!t&&1e4}),r=de(we(e));return{data:n.data,loading:n.isPending,error:r.error||n.error,busy:t,change:r.mutateAsync,reload:()=>(r.reset(),n.refetch())}}var Ee=`grid grid-cols-[88px_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-xs [&_dd]:min-w-0 [&_dd]:[overflow-wrap:anywhere] [&_dd]:text-content-soft [&_dt]:text-content-muted [&>div]:contents`;function De(e,t){return e===`online`?[t(`mcp:online`),!1]:e===`connecting`?[t(`mcp:connecting`),!1]:e===`unauthorized`?[t(`mcp:unauthorized`),!0]:e===`disabled`?[t(`mcp:disabled`),!1]:[t(`mcp:offline`),!0]}function Oe(e,t){return e===`high`||e===`高风险`?t(`mcp:highRisk`):e===`medium`||e===`中风险`?t(`mcp:mediumRisk`):e===`low`||e===`低风险`?t(`mcp:lowRisk`):String(e||``)}function ke(e,t){return e.auth===`headers`?t(`mcp:countRequestHeaders`,{count:e.authCount}):e.auth===`environment`?t(`mcp:configuredEnvironmentVariables`):e.auth===`local`?t(`mcp:localProcess`):t(`mcp:none`)}function Ae({notify:e,onBack:t,requestText:n,requestConfirm:i}){let{t:a,language:o}=r(),s=ne(`focusSearch`),{data:c,busy:l,loading:u,error:d,change:f,reload:p}=Te(),[m,h]=(0,H.useState)(``),[g,v]=(0,H.useState)(``),ee=(0,H.useCallback)(async()=>{let t=await n?.({title:a(`mcp:addMCPService`),message:a(`mcp:enterAStreamableHTTPURLAStdioCommandOrJSONContainingHeadersEnv`),inputLabel:a(`mcp:serverConfiguration`),placeholder:`https://server.example.com/mcp`,maxLength:12e3,confirmLabel:a(`mcp:continue`)});if(t?.trim()&&await i?.({title:a(`mcp:connectMCPServer`),message:a(`mcp:mcpServersCanExposeToolsThatPerformExternalActionsConnectOnlyToServersYouTrust`),confirmLabel:a(`mcp:connect`),tone:`danger`})!==!1)try{let n=await f(()=>X.add(t));v(n.services.at(-1)?.id||``),e(a(`mcp:mcpServerAdded`),`success`)}catch(t){e(t instanceof Error?t.message:String(t),`error`)}},[f,e,i,n,a]),O=m.trim().toLowerCase(),N=c?.services||[],P=N.filter(e=>`${e.name} ${e.endpoint}`.toLowerCase().includes(O)),F=(c?.tools||[]).filter(e=>`${e.name} ${e.serviceName} ${e.description}`.toLowerCase().includes(O)),I=c?.metrics||{totalServices:0,onlineServices:0,availableTools:0,restrictedTools:0,errorRate:0},L=async(t,n)=>{try{await f(()=>X.setToolEnabled(t.serviceId,t.name,n))}catch(t){e(t instanceof Error?t.message:String(t),`error`)}},re=async(t,n)=>{try{await f(()=>X.setServerEnabled(t.id,n)),e(a(n?`mcp:mcpServerEnabled`:`mcp:mcpServerDisabled`),`success`)}catch(t){e(t instanceof Error?t.message:String(t),`error`)}},R=async t=>{try{await f(()=>X.test(t.id)),e(a(`mcp:mcpConnectionTestPassed`),`success`)}catch(t){e(t instanceof Error?t.message:String(t),`error`)}},ce=async t=>{if(await i?.({title:a(`mcp:deleteMCPServer`),message:a(`mcp:afterDeletionToolsFromThisServerWillBeRemovedFromSubsequentAgentRuns`),confirmLabel:a(`mcp:delete`),tone:`danger`})!==!1)try{await f(()=>X.remove(t.id)),v(``),e(a(`mcp:mcpServerDeleted`),`success`)}catch(t){e(t instanceof Error?t.message:String(t),`error`)}},le=e=>{let t=(c?.calls||[]).filter(t=>t.serviceId===e.id);return(0,Q.jsxs)(`div`,{className:`mcp-service-detail grid gap-3`,children:[(0,Q.jsx)(`p`,{className:D(`text-xs leading-normal [overflow-wrap:anywhere]`,e.error?`font-mono text-content-secondary`:`text-content-muted`),children:e.error||a(`mcp:thisServerExposesToolsThroughAStandardMCPTransportEnabledToolsAreRegisteredInNewAgentRuntimes`)}),(0,Q.jsx)(`dl`,{className:Ee,children:[[a(`mcp:transport`),e.transport===`stdio`?`stdio`:e.transport===`sse`?`HTTP + SSE`:`Streamable HTTP`,!1],...e.transport===`stdio`?[[a(`mcp:executable`),e.command||`—`,!0],[a(`mcp:workingDirectory`),e.workingDirectory||`—`,!0]]:[[a(`mcp:serverAddress`),e.endpoint||`—`,!0]],[a(`mcp:latency`),e.latencyMs==null?`—`:`${e.latencyMs} ms`,!1],[a(`mcp:lastPing`),e.lastPingAt?A(e.lastPingAt,o):`—`,!1],[a(`mcp:authentication`),ke(e,a),!1]].map(([e,t,n])=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{children:e}),(0,Q.jsx)(`dd`,{className:n?`font-mono`:`tabular-nums`,children:t})]},e))}),(0,Q.jsxs)(`section`,{className:`mcp-calls-panel min-w-0`,"aria-label":a(`mcp:recentCalls`),children:[(0,Q.jsxs)(`h3`,{className:`mb-1 text-xs font-medium text-content-muted tabular-nums`,children:[a(`mcp:recentCalls`),t.length>0&&(0,Q.jsxs)(`span`,{children:[` · `,Math.min(t.length,8)]})]}),t.length?(0,Q.jsx)(`ul`,{role:`list`,className:`m-0 list-none divide-y divide-stroke p-0`,children:t.slice(0,8).map(e=>{let t=e.status===`ok`;return(0,Q.jsxs)(`li`,{className:D(`activity-row grid min-h-10 min-w-0 grid-cols-[16px_minmax(0,1fr)_auto] items-center gap-2.5 py-1.5`,t?`completed`:`failed`),children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 place-items-center text-content-muted [&_svg]:size-3.5 [&_svg]:stroke-[2]`,children:t?(0,Q.jsx)(_,{}):(0,Q.jsx)(w,{})}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsx)(`strong`,{className:`truncate font-mono text-xs font-medium text-content`,children:e.toolName}),(0,Q.jsx)(`small`,{className:`truncate text-xs text-content-muted`,children:t?a(`mcp:callSucceeded`):e.error||a(`mcp:callFailed`)})]}),(0,Q.jsxs)(`span`,{className:`flex flex-col items-end text-xs text-content-muted tabular-nums`,children:[(0,Q.jsxs)(`span`,{className:`text-content-secondary`,children:[e.durationMs,` ms`]}),(0,Q.jsx)(`span`,{children:A(e.timestamp,o)})]})]},e.id)})}):(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 py-1 text-xs text-content-muted`,children:[(0,Q.jsx)(b,{className:`size-3.5`,"aria-hidden":`true`}),a(`mcp:noRecentCalls`)]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,Q.jsxs)(k,{size:`sm`,variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,disabled:l,onClick:()=>void ce(e),children:[(0,Q.jsx)(S,{"data-icon":`inline-start`}),a(`mcp:delete`)]}),(0,Q.jsxs)(k,{size:`sm`,variant:`secondary`,className:`max-[650px]:h-11`,loading:l,disabled:!e.enabled||l,onClick:()=>void R(e),children:[(0,Q.jsx)(te,{"data-icon":`inline-start`}),a(`mcp:testConnection`)]})]})]})};return(0,Q.jsxs)(oe,{title:a(`navigation:navigation.mcp`),description:a(`mcp:lede`),back:t&&{label:a(`navigation:sidebar.features`),ariaLabel:a(`navigation:shell.backToFeaturesLabel`),onBack:t},toolbar:(0,Q.jsx)(se,{search:(0,Q.jsx)(ie,{id:T,value:m,onValueChange:h,placeholder:a(`navigation:pageHeader.searchServicesOrTools`),shortcut:s,clearLabel:a(`navigation:more.clearSearch`)}),actions:(0,Q.jsxs)(k,{type:`button`,className:`h-9`,"data-mcp-add":!0,disabled:l,onClick:()=>void ee(),children:[(0,Q.jsx)(y,{}),a(`navigation:pageHeader.addService`)]})}),children:[(0,Q.jsx)(xe,{notify:e,requestConfirm:i}),u&&!c&&!d?(0,Q.jsx)(j,{kind:`loading`,title:a(`mcp:loading`)}):!c&&d?(0,Q.jsx)(j,{kind:`error`,title:a(`mcp:loadFailed`),description:d.message,action:(0,Q.jsx)(k,{variant:`secondary`,className:`max-[650px]:h-11`,disabled:l,onClick:()=>void p(),children:a(`mcp:retry`)})}):c&&(0,Q.jsxs)(Q.Fragment,{children:[d&&(0,Q.jsxs)(z,{role:`status`,className:`mt-4 flex min-w-0 items-center justify-between gap-3 text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,Q.jsx)(`span`,{children:d.message}),(0,Q.jsx)(k,{variant:`ghost`,className:`max-[650px]:h-11`,disabled:l,onClick:()=>void p(),children:a(`mcp:retry`)})]}),(0,Q.jsx)(ae,{className:`mcp-services`,title:a(`mcp:services`),count:P.length,meta:N.length>0&&a(`mcp:serviceSummary`,{online:I.onlineServices,total:I.totalServices,rate:I.errorRate}),children:P.length?(0,Q.jsx)(V,{children:P.map(e=>{let[t,n]=De(e.status,a),r=e.transport===`stdio`?e.workingDirectory||e.command:e.endpoint;return(0,Q.jsx)(B,{className:`service-row`,"data-mcp-service":e.id,icon:(0,Q.jsx)(x,{}),name:e.name,description:(0,Q.jsx)(`span`,{className:`font-mono text-xs`,title:r,children:r}),status:(0,Q.jsxs)(`span`,{"data-mcp-status":e.status||`offline`,className:D(`flex items-center gap-1.5`,n&&`font-medium text-st-attn`),children:[n&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none rounded-full bg-st-attn-fill`}),t]}),actions:(0,Q.jsx)(E,{checked:e.enabled,disabled:l,"aria-label":a(`mcp:toggleServiceName`,{name:e.name}),onCheckedChange:t=>void re(e,t)}),expanded:g===e.id,onExpandedChange:t=>v(t?e.id:``),toggleLabel:a(`mcp:toggleServiceDetails`,{name:e.name}),detail:le(e)},e.id)})}):(0,Q.jsx)(M,{icon:x,title:a(`mcp:noServerConfigured`),description:N.length?void 0:a(`mcp:emptyAddHint`)})}),(0,Q.jsx)(ae,{className:`mcp-tools-panel`,title:a(`mcp:toolCapabilities`),count:F.length,meta:I.restrictedTools>0&&a(`mcp:toolSummary`,{count:I.restrictedTools}),children:F.length?(0,Q.jsx)(V,{children:F.map(e=>(0,Q.jsx)(B,{className:`tool-row`,"data-mcp-tool":e.piName,icon:(0,Q.jsx)(C,{}),name:(0,Q.jsx)(`span`,{className:`font-mono`,children:e.name}),description:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`font-mono`,children:e.serviceName}),e.description&&(0,Q.jsxs)(Q.Fragment,{children:[` · `,e.description]})]}),status:Oe(e.risk,a),actions:(0,Q.jsx)(E,{checked:!!e.enabled,disabled:l||!e.serviceEnabled,"aria-label":a(`mcp:toggleToolName`,{name:e.name}),onCheckedChange:t=>void L(e,t)})},e.piName))}):(0,Q.jsx)(M,{compact:!0,icon:C,title:a(`mcp:noToolsAvailable`)})})]})]})}export{Ae as McpPage};
|
|
@@ -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-BIJtH0nB.js";import{t as i}from"./api-DxQIocGp.js";import{t as a}from"./bell-BjONAtgH.js";import{t as o}from"./bot-B3TaBp_T.js";import{t as s}from"./calendar-clock-VIxTaqqy.js";import{t as c}from"./circle-check-iEdCm3Pw.js";import{t as l}from"./folder-open-FIShC5Qk.js";import{n as u,t as d}from"./send-QxBfLFo-.js";import{t as f}from"./play-DNDjDNGn.js";import{t as p}from"./plus-fQbSqB1n.js";import{t as m}from"./trash-2-CNrPOoPR.js";import{t as h}from"./triangle-alert-CE1q54ci.js";import{t as g}from"./more-pages-D_PnxLN0.js";import{t as _}from"./switch-D_G8wFhs.js";import{t as v}from"./utils-C8uzG5AZ.js";import{n as y,t as b}from"./button-CCcCN8tE.js";import{s as x}from"./shortcuts-DWF7_dCu.js";import{a as S}from"./format-DMJQzoZ7.js";import{n as C,t as w}from"./PageState-Cz6vFMXv.js";import{a as T,i as E,l as D,s as O,t as k}from"./dialog-Bs9_FZX7.js";import{t as A}from"./input-CPw-zkYh.js";import{t as j}from"./textarea-DmATpOqT.js";import{WorkspacePicker as M}from"./WorkspacePicker-DsJ0_nq_.js";import{a as N,i as P,n as F,o as ee,r as I,s as L,t as R}from"./FeaturePage-RH3fTWIk.js";import{t as z}from"./field-DaxtcBBA.js";import{t as B}from"./StatusGlyph-1KgitlUg.js";import{t as V}from"./pick-system-directory-C7BKn3Gc.js";import{i as H,n as U,s as W,t as G}from"./app-primitives-Drz_SjnR.js";import{t as K}from"./AppSelect-BGVBQRP1.js";var q=e(t(),1),J=n(),te={browser:{name:`通知`,Icon:a},feishu:{name:`飞书`,Icon:o},weixin:{name:`微信`,Icon:u},qq:{name:`QQ`,Icon:u},telegram:{name:`Telegram`,Icon:d}},Y={interval:`每隔一段时间`,daily:`每天`,weekly:`每周`,monthly:`每月`},X={minutes:`分钟`,hours:`小时`,days:`天`},Z=[...new Set([`Asia/Hong_Kong`,`UTC`,...typeof Intl.supportedValuesOf==`function`?Intl.supportedValuesOf(`timeZone`):[]])],ne=[`full-access`],Q=`mt-4 border-t border-stroke-soft pt-1`,$=`form-grid grid gap-x-3 sm:grid-cols-3`,re=`schedule-interval-input grid grid-cols-[minmax(0,1fr)_minmax(84px,auto)] gap-1.5`,ie=`inline-grid h-8 grid-cols-2 rounded-md border border-stroke bg-chrome p-[3px] max-[650px]:h-auto max-[650px]:w-full pointer-coarse:h-auto`,ae=`inline-flex min-w-0 items-center justify-center rounded-sm border border-transparent px-3 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:text-content aria-pressed:border-key-border aria-pressed:bg-key aria-pressed:font-medium aria-pressed:text-content aria-pressed:shadow-key max-[650px]:h-11 pointer-coarse:h-11`;function oe({status:e}){return(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`mt-px grid size-[18px] flex-none place-items-center`,children:(0,J.jsx)(B,{status:e===`running`?`run`:e===`completed`?`done`:`failed`,className:`size-3.5`})})}function se(e){return e(`schedules:schedulesPage.fullAccessHelp`)}function ce(e,t){return t(e===`daily`?`schedules:schedulesPage.daily`:e===`weekly`?`schedules:schedulesPage.weekly`:e===`monthly`?`schedules:schedulesPage.monthly`:`schedules:schedulesPage.atIntervals`)}function le(e,t){return t(e===`hours`?`schedules:schedulesPage.hours`:e===`days`?`schedules:schedulesPage.days`:`schedules:schedulesPage.minutes`)}function ue(e,t){return t(e===`feishu`?`schedules:schedulesPage.feishu`:e===`weixin`?`schedules:schedulesPage.weChat`:e===`qq`?`schedules:schedulesPage.qq`:e===`telegram`?`schedules:schedulesPage.telegram`:`schedules:schedulesPage.browserNotification`)}function de({value:e,onChange:t}){let{t:n}=r();return(0,J.jsxs)(z,{variant:`control`,children:[n(`schedules:schedulesPage.executionMode`),(0,J.jsx)(K,{value:e,onChange:e=>t(e.target.value),children:ne.map(e=>(0,J.jsx)(`option`,{value:e,children:n(`schedules:schedulesPage.fullAccess`)},e))}),(0,J.jsx)(`small`,{children:se(n)})]})}function fe(e){return Object.fromEntries((e?.inputs||[]).map(e=>[e.name,e.defaultValue??``]))}function pe(e,t,n,r,i){if(e===`prompt`)return!!t.trim();let a=i.find(e=>e.id===n);return a?a.inputs.every(e=>{let t=Object.hasOwn(r,e.name)?r[e.name]:e.defaultValue;return!e.required||t!=null&&t!==``}):!1}function me({targetType:e,prompt:t,workflowId:n,workflowInputs:i,workflows:a,onChange:o}){let{t:s}=r(),c=a.find(e=>e.id===n);return(0,J.jsxs)(`div`,{className:`grid`,children:[(0,J.jsxs)(z,{variant:`control`,children:[s(`schedules:schedulesPage.executionTarget`),(0,J.jsxs)(K,{value:e,onChange:e=>{let t=e.target.value,r=a[0];o(t===`workflow`?{targetType:t,workflowId:n||r?.id||``,workflowInputs:n?i:fe(r)}:{targetType:t})},children:[(0,J.jsx)(`option`,{value:`prompt`,children:`Prompt`}),(0,J.jsx)(`option`,{value:`workflow`,children:s(`schedules:schedulesPage.workflow`)})]})]}),e===`prompt`?(0,J.jsxs)(z,{variant:`control`,children:[`Prompt`,(0,J.jsx)(j,{value:t,onChange:e=>o({prompt:e.target.value}),placeholder:s(`schedules:schedulesPage.describeTheWorkTheAgentShouldCompleteEachTime`)})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(z,{variant:`control`,children:[s(`schedules:schedulesPage.workflow`),(0,J.jsxs)(K,{value:n,onChange:e=>{let t=a.find(t=>t.id===e.target.value);o({workflowId:e.target.value,workflowInputs:fe(t)})},children:[(0,J.jsx)(`option`,{value:``,children:s(`schedules:schedulesPage.selectPublishedWorkflow`)}),a.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[e.name,` · v`,e.revision]},e.id))]}),(0,J.jsx)(`small`,{children:c?.description||(a.length?s(`schedules:schedulesPage.workflowUsesItsOwnRuntimeSettings`):s(`schedules:schedulesPage.noPublishedWorkflows`))})]}),c?.inputs.length?(0,J.jsxs)(`div`,{className:`grid`,children:[(0,J.jsxs)(`div`,{className:`schedule-workflow-inputs-heading mt-3 flex items-baseline justify-between gap-3 max-[650px]:flex-col max-[650px]:items-start max-[650px]:gap-0.5 [&_small]:text-xs [&_small]:text-content-muted [&_strong]:text-xs [&_strong]:font-medium [&_strong]:text-content-secondary`,children:[(0,J.jsx)(`strong`,{children:s(`schedules:schedulesPage.workflowInputs`)}),(0,J.jsx)(`small`,{children:s(`schedules:schedulesPage.workflowInputsHelp`)})]}),(0,J.jsx)(`div`,{className:`schedule-workflow-inputs grid gap-x-3 sm:grid-cols-2 [&_input[type=checkbox]]:size-4 [&_input[type=checkbox]]:justify-self-end [&_input[type=checkbox]]:accent-star`,children:c.inputs.map(e=>(0,J.jsxs)(z,{variant:`control`,className:e.type===`boolean`?`grid grid-cols-[minmax(0,1fr)_auto] items-center`:void 0,children:[e.label,e.required?` *`:``,e.type===`boolean`?(0,J.jsx)(_,{checked:!!i[e.name],onCheckedChange:t=>o({workflowInputs:{...i,[e.name]:t}})}):(0,J.jsx)(A,{type:e.type===`number`?`number`:`text`,required:e.required,value:String(i[e.name]??``),onChange:t=>o({workflowInputs:{...i,[e.name]:t.target.value}})}),e.description&&(0,J.jsx)(`small`,{children:e.description})]},e.id))})]}):null]})]})}function he({value:e,onChange:t}){let{t:n}=r(),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(!1),c=async()=>{a(``);try{let r=await V(e,n(`common:workspacePicker.selectWorkspaceForSchedule`));r.status===`picked`?t(r.path):r.status===`unavailable`&&s(!0)}catch(e){a(e instanceof Error?e.message:String(e))}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(z,{variant:`control`,children:[n(`schedules:schedulesPage.workingDirectory`),(0,J.jsxs)(`span`,{className:`schedule-workspace-input grid grid-cols-[minmax(0,1fr)_auto] gap-1.5 [&_input]:min-w-0 [&_input]:font-mono`,children:[(0,J.jsx)(A,{value:e,onChange:e=>t(e.target.value),placeholder:n(`schedules:schedulesPage.enterTheProjectSAbsolutePath`)}),(0,J.jsxs)(b,{type:`button`,variant:`secondary`,className:`h-auto min-h-8`,onClick:()=>void c(),children:[(0,J.jsx)(l,{}),n(`schedules:schedulesPage.browseDirectories`)]})]}),(0,J.jsx)(`small`,{children:n(`schedules:schedulesPage.theScheduledAgentWillRunInThisDirectory`)})]}),i&&(0,J.jsxs)(H,{children:[(0,J.jsx)(h,{size:13}),i]}),(0,J.jsx)(M,{open:o,initialPath:e,description:n(`common:workspacePicker.selectWorkspaceForSchedule`),onOpenChange:s,onSelect:e=>t(e)})]})}function ge(e){return{id:e.id,name:e.name,targetType:e.targetType||`prompt`,prompt:e.prompt,workflowId:e.workflowId||``,workflowInputs:e.workflowInputs||{},enabled:e.enabled,frequency:e.frequency,intervalValue:e.intervalValue||1,intervalUnit:e.intervalUnit||`hours`,time:e.time,timezone:e.timezone,dayOfWeek:e.dayOfWeek,dayOfMonth:e.dayOfMonth,cwd:e.cwd,executionMode:e.executionMode||`full-access`,model:e.model,notifications:e.notifications||[],notifyOn:e.notifyOn||`always`}}function _e(e,t=`zh-CN`){return!e.enabled||!e.nextRunAt?t===`en-US`?`Paused`:`已暂停`:new Intl.DateTimeFormat(t,{timeZone:e.timezone,dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.nextRunAt))}function ve({notify:e,onBack:t,openNotificationSettings:n,requestConfirm:a}){let{t:o,language:c}=r(),l=x(`focusSearch`),[u,d]=(0,q.useState)({tasks:[],runs:[],notificationTargets:{browser:{enabled:!1},feishu:{enabled:!1},weixin:{enabled:!1},qq:{enabled:!1},telegram:{enabled:!1}},workflows:[],defaultCwd:``}),[f,m]=(0,q.useState)(``),[h,_]=(0,q.useState)({}),[v,y]=(0,q.useState)(!0),[S,T]=(0,q.useState)(!1),[E,D]=(0,q.useState)(``),[O,k]=(0,q.useState)(!1),[A,j]=(0,q.useState)(``),[M,z]=(0,q.useState)(!1),[V,H]=(0,q.useState)(``),U=(0,q.useCallback)(async()=>{try{let e=await i(`/api/schedules`);d(e),T(!0),D(``),m(t=>e.tasks.some(e=>e.id===t)?t:``),_(t=>{let n=Object.entries(t).filter(([t])=>e.tasks.some(e=>e.id===t));return n.length===Object.keys(t).length?t:Object.fromEntries(n)})}catch(e){D(e instanceof Error?e.message:String(e))}finally{y(!1)}},[]);(0,q.useEffect)(()=>{U()},[U]),(0,q.useEffect)(()=>{let e=window.setInterval(U,u.tasks.some(e=>e.lastStatus===`running`)?2e3:1e4);return()=>window.clearInterval(e)},[u.tasks,U]);let W=u.tasks.find(e=>e.id===f),G=u.workflows||[],K=W?h[W.id]??ge(W):null,te=(0,q.useMemo)(()=>u.runs.filter(e=>e.taskId===f).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime()).slice(0,20),[u.runs,f]),Y=e=>G.find(t=>t.id===e.workflowId)?.name||o(`schedules:schedulesPage.workflowUnavailable`),X=V.trim().toLocaleLowerCase(),Z=X?u.tasks.filter(e=>`${e.name} ${e.targetType===`workflow`?Y(e):e.prompt}`.toLocaleLowerCase().includes(X)):u.tasks,ne=u.tasks.filter(e=>e.enabled).length,Q=e=>{if(!W)return;let t=ge(W);_(n=>({...n,[t.id]:{...n[t.id]??t,...e}}))},$=e=>{K&&Q({notifications:K.notifications.includes(e)?K.notifications.filter(t=>t!==e):[...K.notifications,e]})},re=async()=>{if(!(!W||!K)){k(!0),j(``);try{let t=await i(`/api/schedules/${encodeURIComponent(W.id)}`,{method:`PATCH`,body:JSON.stringify(K)});d(t.state),_(e=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t.task.id))),e(o(`schedules:schedulesPage.scheduledTaskSaved`))}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}}},ie=async()=>{if(W){k(!0),j(``);try{await i(`/api/schedules/${encodeURIComponent(W.id)}/run`,{method:`POST`,body:`{}`}),await U(),e(o(`schedules:schedulesPage.scheduledTaskStarted`))}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}}},ae=async()=>{if(W&&await a({title:o(`schedules:schedulesPage.deleteScheduledTask`),message:o(`schedules:schedulesPage.deleteScheduledTaskNameAndItsRunHistory`,{name:W.name}),confirmLabel:o(`schedules:schedulesPage.delete`)}))try{await i(`/api/schedules/${encodeURIComponent(W.id)}`,{method:`DELETE`}),await U(),e(o(`schedules:schedulesPage.scheduledTaskDeleted`))}catch(e){j(e instanceof Error?e.message:String(e))}},oe=t=>{d(t.state),m(t.task.id),e(o(`schedules:schedulesPage.scheduledTaskCreated`))},se=e=>(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col items-end gap-0.5 max-[650px]:flex-row max-[650px]:items-center max-[650px]:gap-2`,children:[e.lastStatus===`running`?(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-content-secondary`,children:[(0,J.jsx)(B,{status:`run`,className:`size-3.5`}),o(`schedules:schedulesPage.running`)]}):(0,J.jsx)(`span`,{className:`whitespace-nowrap`,children:e.enabled?o(`schedules:schedulesPage.nextRunTime`,{time:_e(e,c)}):o(`schedules:schedulesPage.pause`)}),e.lastStatus===`failed`&&(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-content-secondary`,children:[(0,J.jsx)(B,{status:`failed`,className:`size-3.5`}),o(`schedules:schedulesPage.lastRunFailed`)]})]}),ue=o(`navigation:navigation.schedules`);return(0,J.jsxs)(I,{title:ue,description:o(`schedules:schedulesPage.lede`),back:t&&{label:o(`navigation:sidebar.features`),ariaLabel:o(`navigation:shell.backToFeaturesLabel`),onBack:t},toolbar:(0,J.jsx)(L,{search:(0,J.jsx)(N,{id:g,value:V,onValueChange:H,placeholder:o(`navigation:pageHeader.searchPage`,{page:ue}),shortcut:l,clearLabel:o(`navigation:more.clearSearch`)}),actions:(0,J.jsxs)(b,{type:`button`,className:`h-9`,disabled:!S,onClick:()=>z(!0),children:[(0,J.jsx)(p,{}),o(`schedules:schedulesPage.newTask`)]})}),children:[v?(0,J.jsx)(C,{kind:`loading`,title:o(`schedules:schedulesPage.loadingScheduledTasks`)}):E&&!S?(0,J.jsx)(C,{kind:`error`,title:o(`schedules:schedulesPage.loadFailed`),description:E,action:(0,J.jsx)(b,{variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>{y(!0),U()},children:o(`common:pageTemplate.retry`)})}):(0,J.jsxs)(J.Fragment,{children:[(A||E)&&(0,J.jsx)(R,{children:A||E}),(0,J.jsx)(ee,{title:o(`schedules:schedulesPage.tasks`),count:u.tasks.length,meta:u.tasks.length?o(`schedules:schedulesPage.enabledCount`,{count:ne}):void 0,children:Z.length?(0,J.jsx)(F,{children:Z.map(e=>{let t=f===e.id;return(0,J.jsx)(P,{"data-schedule-task":e.id,className:`schedule-list-item`,icon:(0,J.jsx)(s,{}),name:e.name,description:e.targetType===`workflow`?(0,J.jsx)(`span`,{className:`font-mono`,children:Y(e)}):e.prompt,meta:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{children:ce(e.frequency,o)}),(0,J.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,J.jsx)(`span`,{className:`tabular-nums`,children:e.frequency===`interval`?`${e.intervalValue} ${le(e.intervalUnit,o)}`:e.time}),(0,J.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.timezone})]}),status:se(e),expanded:t,onExpandedChange:t=>m(t?e.id:``),toggleLabel:o(`schedules:schedulesPage.toggleTaskDetails`,{name:e.name}),detail:t&&K&&W?(0,J.jsx)(ye,{task:W,draft:K,runs:te,saving:O,workflows:G,notificationTargets:u.notificationTargets,language:c,onUpdate:Q,onToggleNotification:$,onRun:ie,onRemove:ae,onSave:re,onEditTemplates:n}):null},e.id)})}):(0,J.jsx)(w,{title:u.tasks.length?o(`schedules:schedulesPage.noMatchingTasks`):o(`schedules:schedulesPage.theTimelineIsStillUnlit`),description:u.tasks.length?void 0:o(`schedules:schedulesPage.createATaskAndLetItSetOutAutomaticallyAtTheAppointedTime`)})}),!u.tasks.length&&(0,J.jsx)(`div`,{className:`mt-7`,"data-schedule-create":!0,children:(0,J.jsx)(be,{notificationTargets:u.notificationTargets,workflows:G,defaultCwd:u.defaultCwd,onCreated:oe})})]}),M&&(0,J.jsx)(xe,{notificationTargets:u.notificationTargets,workflows:G,defaultCwd:u.defaultCwd,onClose:()=>z(!1),onCreated:e=>{z(!1),oe(e)}})]})}function ye({task:e,draft:t,runs:n,saving:i,workflows:a,notificationTargets:o,language:s,onUpdate:l,onToggleNotification:u,onRun:d,onRemove:p,onSave:h,onEditTemplates:g}){let{t:_}=r(),x=e.lastStatus===`running`;return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`label`,{className:`mr-auto inline-flex min-h-8 items-center gap-2.5 text-sm text-content max-[650px]:min-h-11`,children:[(0,J.jsx)(W,{value:t.enabled,onChange:e=>l({enabled:e}),ariaLabel:_(`schedules:schedulesPage.enableTaskName`,{name:t.name})}),t.enabled?_(`schedules:schedulesPage.enabled`):_(`schedules:schedulesPage.pause`)]}),(0,J.jsxs)(b,{variant:`secondary`,size:`sm`,className:`max-[650px]:h-11`,disabled:i||x,onClick:d,children:[x?(0,J.jsx)(y,{}):(0,J.jsx)(f,{}),_(x?`schedules:schedulesPage.running`:`schedules:schedulesPage.runNow`)]}),(0,J.jsx)(b,{variant:`ghost`,size:`icon-sm`,className:`hover:bg-danger-soft hover:text-danger max-[650px]:size-11`,title:_(`schedules:schedulesPage.deleteTask`),"aria-label":_(`schedules:schedulesPage.deleteTask`),onClick:p,children:(0,J.jsx)(m,{})})]}),(0,J.jsx)(me,{targetType:t.targetType,prompt:t.prompt,workflowId:t.workflowId,workflowInputs:t.workflowInputs,workflows:a,onChange:l}),t.targetType===`prompt`&&(0,J.jsx)(he,{value:t.cwd,onChange:e=>l({cwd:e})}),(0,J.jsx)(`div`,{className:Q,children:(0,J.jsxs)(`div`,{className:$,children:[(0,J.jsxs)(z,{variant:`control`,children:[_(`schedules:schedulesPage.frequency`),(0,J.jsx)(K,{value:t.frequency,onChange:e=>l({frequency:e.target.value}),children:Object.keys(Y).map(e=>(0,J.jsx)(`option`,{value:e,children:ce(e,_)},e))})]}),t.frequency===`interval`?(0,J.jsxs)(z,{variant:`control`,children:[_(`schedules:schedulesPage.runInterval`),(0,J.jsxs)(`span`,{className:re,children:[(0,J.jsx)(A,{type:`number`,min:`1`,value:t.intervalValue,onChange:e=>l({intervalValue:Number(e.target.value)})}),(0,J.jsx)(K,{value:t.intervalUnit,onChange:e=>l({intervalUnit:e.target.value}),children:Object.keys(X).map(e=>(0,J.jsx)(`option`,{value:e,children:le(e,_)},e))})]})]}):(0,J.jsxs)(z,{variant:`control`,children:[_(`schedules:schedulesPage.time`),(0,J.jsx)(A,{type:`time`,className:`tabular-nums`,value:t.time,onChange:e=>l({time:e.target.value})})]}),(0,J.jsxs)(z,{variant:`control`,children:[_(`schedules:schedulesPage.timeZone`),(0,J.jsx)(K,{value:t.timezone,onChange:e=>l({timezone:e.target.value}),children:Z.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))})]}),t.targetType===`prompt`&&(0,J.jsx)(de,{value:t.executionMode,onChange:e=>l({executionMode:e})})]})}),(0,J.jsxs)(`div`,{className:v(`schedule-notification-section pt-3`,Q),children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,J.jsx)(`strong`,{className:`text-sm font-medium`,children:_(`schedules:schedulesPage.notificationChannels`)}),(0,J.jsx)(`button`,{type:`button`,className:`text-button text-xs font-medium text-content-secondary underline underline-offset-2 hover:text-content max-[650px]:min-h-11`,onClick:g,children:_(`schedules:schedulesPage.editTemplates`)})]}),(0,J.jsx)(`p`,{className:`mt-0.5 text-xs text-content-muted`,children:_(`schedules:schedulesPage.notificationChannelsHelp`)}),(0,J.jsx)(`div`,{className:`schedule-notification-targets mt-2.5 grid grid-cols-[repeat(auto-fill,minmax(132px,1fr))] gap-2`,children:Object.entries(te).map(([e,n])=>{let r=n.Icon,i=t.notifications.includes(e);return(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":i,className:v(`grid min-h-[52px] grid-cols-[16px_minmax(0,1fr)_16px] items-center gap-2 rounded-md border px-2.5 py-2 text-left transition-colors duration-(--d-fast)`,i?`selected border-star-border bg-star-soft text-star-strong`:`border-stroke bg-panel text-content hover:bg-surface-subtle`),onClick:()=>u(e),children:[(0,J.jsx)(r,{className:`size-4`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,J.jsx)(`strong`,{className:`truncate text-sm font-medium`,children:ue(e,_)}),(0,J.jsx)(`small`,{className:`truncate text-xs text-content-muted`,children:o[e].enabled?_(`schedules:schedulesPage.configured`):_(`schedules:schedulesPage.notConfigured`)})]}),(0,J.jsx)(c,{className:v(`size-4`,i?`text-star-strong`:`text-content-faint`)})]},e)})}),(0,J.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,J.jsx)(`span`,{id:`schedule-notify-on-${e.id}`,className:`text-xs text-content-muted`,children:_(`schedules:schedulesPage.notifyWhen`)}),(0,J.jsx)(`div`,{role:`group`,"aria-labelledby":`schedule-notify-on-${e.id}`,className:v(`schedule-notification-chip`,ie),children:[`always`,`failure`].map(e=>(0,J.jsx)(`button`,{type:`button`,"aria-pressed":t.notifyOn===e,className:ae,onClick:()=>l({notifyOn:e}),children:_(e===`failure`?`schedules:schedulesPage.failuresOnly`:`schedules:schedulesPage.completionAndFailure`)},e))})]})]}),(0,J.jsxs)(`div`,{className:`form-footer mt-4 flex items-center justify-between gap-2.5 border-t border-stroke-soft pt-3 max-[650px]:flex-wrap`,children:[(0,J.jsx)(`span`,{className:`text-xs text-content-muted tabular-nums`,children:e.lastRunAt?_(`schedules:schedulesPage.lastRunTime`,{time:S(e.lastRunAt,s)}):_(`schedules:schedulesPage.nextRunTime`,{time:_e(e,s)})}),(0,J.jsxs)(b,{className:`max-[650px]:h-11 max-[650px]:w-full`,disabled:i||!pe(t.targetType,t.prompt,t.workflowId,t.workflowInputs,a),onClick:h,children:[i?(0,J.jsx)(y,{className:`text-current`}):null,_(i?`schedules:schedulesPage.saving`:`schedules:schedulesPage.saveTask`)]})]})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`schedule-runs-${e.id}`,className:`min-w-0`,children:[(0,J.jsxs)(`h3`,{id:`schedule-runs-${e.id}`,className:`mb-1.5 text-[13px] font-medium text-content-muted tabular-nums`,children:[_(`schedules:schedulesPage.recentRuns`),` · `,n.length]}),n.length?(0,J.jsx)(`ul`,{className:`divide-y divide-stroke-soft overflow-hidden rounded-[var(--r-md)] border border-stroke`,children:n.map(e=>(0,J.jsxs)(`li`,{className:`schedule-run-row grid min-h-11 grid-cols-[18px_minmax(0,1fr)_auto] items-start gap-2.5 px-3 py-2.5 ${e.status}`,children:[(0,J.jsx)(oe,{status:e.status}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,J.jsx)(`strong`,{className:`line-clamp-2 text-sm leading-5 font-medium text-content`,children:e.status===`running`?_(`schedules:schedulesPage.running2`):e.status===`completed`?e.summary||_(`schedules:schedulesPage.taskCompleted`):e.status===`interrupted`?_(`schedules:schedulesPage.taskInterrupted`):e.error||_(`schedules:schedulesPage.taskFailed`)}),(0,J.jsxs)(`small`,{className:`text-xs text-content-muted tabular-nums`,children:[S(e.startedAt,s),` ·`,` `,e.trigger===`manual`?_(`schedules:schedulesPage.manualRun`):_(`schedules:schedulesPage.scheduledTrigger`),e.durationMs?` · ${_(`schedules:schedulesPage.countSec`,{count:Math.round(e.durationMs/1e3)})}`:``]})]}),(0,J.jsx)(`em`,{className:`font-mono text-xs leading-5 text-content-secondary not-italic tabular-nums`,children:new Intl.DateTimeFormat(s,{hour:`2-digit`,minute:`2-digit`}).format(new Date(e.startedAt))})]},e.id))}):(0,J.jsx)(w,{compact:!0,title:_(`schedules:schedulesPage.noRunHistory`)})]})]})}function be({notificationTargets:e,workflows:t,defaultCwd:n,onCreated:a}){let{t:o}=r(),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(`prompt`),[d,f]=(0,q.useState)(``),[m,g]=(0,q.useState)(``),[_,x]=(0,q.useState)({}),[S,C]=(0,q.useState)(n||``),[w,T]=(0,q.useState)(`daily`),[E,D]=(0,q.useState)(`09:00`),[O,k]=(0,q.useState)(`Asia/Hong_Kong`),[j,M]=(0,q.useState)(1),[N,P]=(0,q.useState)(`hours`),[F,ee]=(0,q.useState)(`full-access`),[I,L]=(0,q.useState)(!1),[R,B]=(0,q.useState)(``);return(0,J.jsxs)(G,{className:`p-4 py-4`,children:[(0,J.jsx)(U,{children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{className:`text-[15px]! font-medium`,children:o(`schedules:schedulesPage.newScheduledTask`)}),(0,J.jsx)(`p`,{children:o(`schedules:schedulesPage.youCanContinueEditingTheRunTimeAndNotificationChannelsAfterCreation`)})]})}),(0,J.jsxs)(z,{variant:`control`,children:[o(`schedules:schedulesPage.taskName`),(0,J.jsx)(A,{value:s,onChange:e=>c(e.target.value),placeholder:o(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,J.jsx)(me,{targetType:l,prompt:d,workflowId:m,workflowInputs:_,workflows:t,onChange:e=>{e.targetType&&u(e.targetType),e.prompt!==void 0&&f(e.prompt),e.workflowId!==void 0&&g(e.workflowId),e.workflowInputs!==void 0&&x(e.workflowInputs)}}),l===`prompt`&&(0,J.jsx)(he,{value:S,onChange:C}),(0,J.jsxs)(`div`,{className:v(Q,$),children:[(0,J.jsxs)(z,{variant:`control`,children:[o(`schedules:schedulesPage.frequency`),(0,J.jsx)(K,{value:w,onChange:e=>T(e.target.value),children:Object.keys(Y).map(e=>(0,J.jsx)(`option`,{value:e,children:ce(e,o)},e))})]}),w===`interval`?(0,J.jsxs)(z,{variant:`control`,children:[o(`schedules:schedulesPage.runInterval`),(0,J.jsxs)(`span`,{className:re,children:[(0,J.jsx)(A,{type:`number`,min:`1`,value:j,onChange:e=>M(Number(e.target.value))}),(0,J.jsx)(K,{value:N,onChange:e=>P(e.target.value),children:Object.keys(X).map(e=>(0,J.jsx)(`option`,{value:e,children:le(e,o)},e))})]})]}):(0,J.jsxs)(z,{variant:`control`,children:[o(`schedules:schedulesPage.time`),(0,J.jsx)(A,{type:`time`,className:`tabular-nums`,value:E,onChange:e=>D(e.target.value)})]}),(0,J.jsxs)(z,{variant:`control`,children:[o(`schedules:schedulesPage.timeZone`),(0,J.jsx)(K,{value:O,onChange:e=>k(e.target.value),children:Z.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))})]}),l===`prompt`&&(0,J.jsx)(de,{value:F,onChange:ee})]}),R&&(0,J.jsxs)(H,{children:[(0,J.jsx)(h,{size:13}),R]}),(0,J.jsxs)(`div`,{className:`form-footer mt-4 flex items-center justify-between gap-2.5 border-t border-stroke-soft pt-3 max-[650px]:flex-wrap`,children:[(0,J.jsx)(`span`,{className:`text-xs text-content-muted`,children:o(`schedules:schedulesPage.enabledAutomaticallyAfterCreation`)}),(0,J.jsxs)(b,{className:`max-[650px]:h-11 max-[650px]:w-full`,disabled:I||!s.trim()||!pe(l,d,m,_,t),onClick:async()=>{L(!0),B(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);a(await i(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:s,targetType:l,prompt:d,workflowId:m,workflowInputs:_,cwd:S,enabled:!0,frequency:w,time:E,timezone:O,intervalValue:j,intervalUnit:N,executionMode:F,notifications:t,notifyOn:`always`})}))}catch(e){B(e instanceof Error?e.message:String(e))}finally{L(!1)}},children:[I?(0,J.jsx)(y,{className:`text-current`}):(0,J.jsx)(p,{}),o(I?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})}function xe({notificationTargets:e,workflows:t,defaultCwd:n,onClose:a,onCreated:o}){let{t:s}=r(),[c,l]=(0,q.useState)(``),[u,d]=(0,q.useState)(`prompt`),[f,m]=(0,q.useState)(``),[g,_]=(0,q.useState)(``),[v,x]=(0,q.useState)({}),[S,C]=(0,q.useState)(n||``),[w,j]=(0,q.useState)(`full-access`),[M,N]=(0,q.useState)(!1),[P,F]=(0,q.useState)(``);return(0,J.jsx)(k,{open:!0,onOpenChange:e=>!e&&a(),children:(0,J.jsx)(E,{size:`compact`,children:(0,J.jsxs)(`form`,{className:`grid min-w-0`,onSubmit:async t=>{t.preventDefault(),N(!0),F(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);o(await i(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:c,targetType:u,prompt:f,workflowId:g,workflowInputs:v,cwd:S,enabled:!0,frequency:`daily`,time:`09:00`,timezone:`Asia/Hong_Kong`,executionMode:w,notifications:t,notifyOn:`always`})}))}catch(e){F(e instanceof Error?e.message:String(e))}finally{N(!1)}},children:[(0,J.jsxs)(O,{children:[(0,J.jsx)(D,{children:s(`schedules:schedulesPage.newScheduledTask`)}),(0,J.jsx)(T,{children:s(`schedules:schedulesPage.youCanContinueSettingTheRunTimeAndNotificationChannelsAfterCreation`)})]}),(0,J.jsxs)(z,{variant:`control`,children:[s(`schedules:schedulesPage.taskName`),(0,J.jsx)(A,{value:c,onChange:e=>l(e.target.value),placeholder:s(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,J.jsx)(me,{targetType:u,prompt:f,workflowId:g,workflowInputs:v,workflows:t,onChange:e=>{e.targetType&&d(e.targetType),e.prompt!==void 0&&m(e.prompt),e.workflowId!==void 0&&_(e.workflowId),e.workflowInputs!==void 0&&x(e.workflowInputs)}}),u===`prompt`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(he,{value:S,onChange:C}),(0,J.jsx)(de,{value:w,onChange:j})]}),P&&(0,J.jsxs)(H,{children:[(0,J.jsx)(h,{size:13}),P]}),(0,J.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2 max-[650px]:[&>button]:h-11 max-[650px]:[&>button]:flex-1`,children:[(0,J.jsx)(b,{type:`button`,variant:`secondary`,onClick:a,children:s(`schedules:schedulesPage.cancel`)}),(0,J.jsxs)(b,{type:`submit`,disabled:M||!c.trim()||!pe(u,f,g,v,t),children:[M?(0,J.jsx)(y,{className:`text-current`}):(0,J.jsx)(p,{}),s(M?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})})})}export{ve as SchedulesPage};
|
|
@@ -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.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.title":`新任务`,"launch.inputLabel":`任务描述`,"launch.placeholder":`描述任务…(Tab 切换项目)`,"launch.placeholderTouch":`描述任务…`,"launch.projects":`最近的项目`,"launch.projectLabel":`项目:{project}`,"launch.defaultProject":`默认目录`,"launch.noProject":`不选项目`,"launch.dispatch":`派发`,"launch.sending":`派发中 {count}`,"launch.noModel":`还没有可用的模型`,"launch.configureModels":`配置模型`,"launch.failed":`派发失败,草稿已保留。`,"launch.failedWithReason":`派发失败:{reason}(草稿已保留)`,"launch.dispatched":`已派发,可在全部代理查看进度`,"launch.fullAccessOnce":`仅本次派发,不会被记住`,"launch.startNowChip":`立即开始`,"launch.startAfterChip":`排在 {title} 之后`,"launch.startAfterShort":`等「{title}」`,"launch.startAfterNote":`排在「{title}」之后:它这一轮结束时自动开始。`,"launch.startAfterGone":`已结束的会话`,"launch.startAfterLabel":`什么时候开始`,"launch.startAfterRunning":`运行中`,"launch.startAfterQueued":`排队中`,"launch.startAfterHint":`等它这一轮结束(完成、失败或停止都算)再开始;排队后也可以在全部代理里“立即开始”。`,"dispatch.title":`新任务`,"dispatch.description":`派发后留在当前页面,新代理会出现在侧栏「运行中」。`,"dispatch.descriptionPhone":`派发后留在当前页面,新代理会出现在抽屉的「运行中」。`,"dispatch.hint":`↵ 派发 · ⌘/Ctrl+↵ 派发并打开 · ⇧↵ 换行`,"dispatch.reopen":`重新打开`,"project.actionsFor":`{project} 的操作`,"project.new":`新建项目…`,"project.manage":`管理项目…`,"project.newTaskHere":`在此项目新建任务`,"project.rename":`重命名…`,"project.resetName":`恢复目录名`,"project.delete":`删除项目…`,"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.openSession":`打开会话`,"phone.running":`运行中 {elapsed}`,"phone.changes":`+{count} 改动`,"phone.changesLabel":`查看本会话的 {count} 个改动`,"phone.openInspector":`改动、终端、文件与预览`,"phone.inspectorDescription":`本会话的改动、终端、资料来源与网页预览`,"phone.earlierTurns":`展开更早的对话:{summary}`,"phone.previousTurn":`上一轮`,"session.moveWorkspace":`移动工作区…`,"session.goalMode":`目标模式`,"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.draftHeading":`从一个新任务开始`,"home.draftHint":`选好项目,描述要做的事。发出第一条消息后,这里就是它的会话;其他代理都在“全部代理”里。`,"home.composerLabel":`新任务输入框`,"home.placeholder":`描述要做的事…({send} 发送,Tab 切换项目)`,"home.placeholderUnbound":`描述要做的事…(Tab 切换项目)`,"home.placeholderTouch":`描述要做的事…`,"home.send":`发送`,"home.sending":`正在创建会话…`,"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.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.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}`,"question.open":`打开回答`},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.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.title":`New task`,"launch.inputLabel":`Task description`,"launch.placeholder":`Describe the task… (Tab switches project)`,"launch.placeholderTouch":`Describe the task…`,"launch.projects":`Recent projects`,"launch.projectLabel":`Project: {project}`,"launch.defaultProject":`Default folder`,"launch.noProject":`No project`,"launch.dispatch":`Dispatch`,"launch.sending":`Dispatching {count}`,"launch.noModel":`No model is available yet`,"launch.configureModels":`Set up models`,"launch.failed":`Dispatch failed. Your draft was kept.`,"launch.failedWithReason":`Dispatch failed: {reason} (draft kept)`,"launch.dispatched":`Dispatched. Follow its progress in All agents.`,"launch.fullAccessOnce":`This dispatch only, not remembered`,"launch.startNowChip":`Start now`,"launch.startAfterChip":`After {title}`,"launch.startAfterShort":`After “{title}”`,"launch.startAfterNote":`Queued after “{title}”: starts when that run ends.`,"launch.startAfterGone":`a finished session`,"launch.startAfterLabel":`When to start`,"launch.startAfterRunning":`Running`,"launch.startAfterQueued":`Queued`,"launch.startAfterHint":`Starts when that run ends, whether it finishes, fails or is stopped. You can still start it from All agents.`,"dispatch.title":`New task`,"dispatch.description":`You stay on this page; the new agent shows up under Running in the sidebar.`,"dispatch.descriptionPhone":`You stay on this page; the new agent shows up under Running in the drawer.`,"dispatch.hint":`↵ dispatch · ⌘/Ctrl+↵ dispatch and open · ⇧↵ new line`,"dispatch.reopen":`Reopen`,"project.actionsFor":`Actions for {project}`,"project.new":`New project…`,"project.manage":`Manage projects…`,"project.newTaskHere":`New task in this project`,"project.rename":`Rename…`,"project.resetName":`Use folder name`,"project.delete":`Delete 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.openSession":`Open session`,"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.goalMode":`Goal mode`,"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":`Queued`,"composer.queuedSteer":`Steer`,"composer.steerNow":`Send as steer`,"composer.steerHint":`The agent reads it at its next step instead of after this run`,"composer.longPressSteer":`While running, press and hold to steer`,"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":`Steer 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.draftHeading":`Start a new task`,"home.draftHint":`Pick a project and describe the task. After the first message this becomes its session; other agents stay in All agents.`,"home.composerLabel":`New task composer`,"home.placeholder":`Describe the task… ({send} sends, Tab switches project)`,"home.placeholderUnbound":`Describe the task… (Tab switches project)`,"home.placeholderTouch":`Describe the task…`,"home.send":`Send`,"home.sending":`Creating the session…`,"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.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 steer`,"composer.placeholderRunningQueueOnly":`Running: {queue} to queue`,"composer.placeholderRunningTouch":`Running: tap send to queue, hold send to steer`,"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}`,"question.open":`Open to answer`}};export{e as boardMessages};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./index-C3xrFlMb.js";import{a as t,i as n,o as r}from"./vendor-state-GkUciC5H.js";import{d as i,f as a,h as o,l as s,s as c,u as l}from"./useSessionListQuery-jM0IQ1En.js";import{o as u}from"./card-presentation-1oph2b8P.js";function d(e){if(typeof e!=`string`)return``;let t=e.trim();if(!t||t.length>2048||t.includes(`\0`))return``;let n=/^(?:[A-Za-z]:)?[\\/]+$/u.test(t)?t:t.replace(/[\\/]+$/u,``),r=o(n);return r&&r!==`\0`?n:``}function f(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e){let e=d(r),i=e&&o(e);if(!(!i||t.has(i))&&(t.add(i),n.push(e),n.length>=50))break}return n}function p(e,t){let n=d(t);if(!n)return f(e);let r=o(n);return f([n,...e.filter(e=>o(e)!==r)])}function m(e,t){let n=o(t);return f(e.filter(e=>o(e)!==n))}function h(e,t){let n=new Set(t),r=[];for(let t of f(e)){let e=o(t);n.has(e)||(n.add(e),r.push({key:e,cwd:t}))}return r}var g=`pisper-registered-projects`,_=n(()=>({getItem:t=>{try{return e.getItem(t)}catch{return null}},setItem:(t,n)=>{try{e.setItem(t,n)}catch{}},removeItem:t=>{try{e.removeItem(t)}catch{}}}));function v(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}var y=r()(t((e,t)=>({projects:[],registerProject:n=>{let r=d(n);if(!r)return``;let i=t().projects,a=p(i,r);return v(a,i)||e({projects:a}),r},unregisterProject:n=>{let r=t().projects;return r.some(e=>o(e)===o(n))?(e({projects:m(r,n)}),!0):!1}}),{name:g,storage:_,version:1,partialize:({projects:e})=>({projects:e}),merge:(e,t)=>({...t,projects:f(e&&typeof e==`object`&&`projects`in e?e.projects:void 0)})}));function b(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function x(e){let t=o(e);return t&&t!==`\0`&&!t.includes(`\0`)?t:null}function S(e){let t=Object.create(null);if(!e||typeof e!=`object`||Array.isArray(e))return t;for(let[n,r]of Object.entries(e)){let e=x(n);if(!e||typeof r!=`string`)continue;let i=r.trim();i&&Array.from(i).length<=120&&(t[e]=i)}return t}var C=n(()=>e),w=r()(t((e,t)=>({order:[],names:S(void 0),rememberWorkspaces:n=>{let r=t().order,i=a(r,n);b(i,r)||e({order:i})},moveWorkspace:(n,r,i)=>{let a=t().order,o=l(a,i,n,r);b(o,a)||e({order:o})},setWorkspaceName:(n,r)=>{let i=typeof n==`string`?x(n):null;if(!i||typeof r!=`string`)throw TypeError(`Invalid workspace name`);let a=r.trim();if(Array.from(a).length>120)throw RangeError(`Workspace name is too long`);let o=t().names;if((o[i]||``)===a)return;if(!C)throw Error(`Workspace preferences storage is unavailable`);let s=S(o);a?s[i]=a:delete s[i];try{e({names:s})}catch(t){try{e({names:o})}catch{}throw t}}}),{name:`pisper-workspace-order`,storage:C,version:1,partialize:({order:e,names:t})=>({order:e,names:t}),merge:(e,t)=>({...t,order:i(e&&typeof e==`object`&&`order`in e?e.order:void 0),names:S(e&&typeof e==`object`&&`names`in e?e.names:void 0)})}));function T(e,t){let n=h(t,e.map(e=>e.key)).map(e=>({...e,count:0}));return[...e,...n]}function E(e,t,n){let r=[...e].sort((e,t)=>(Date.parse(t.modified||``)||0)-(Date.parse(e.modified||``)||0)),i=s(r).filter(e=>e.key!==`\0`&&e.cwd);return[...h(t,i.map(e=>e.key)),...i.slice(0,12)].map(e=>({key:e.key,cwd:e.cwd,label:n[e.key]||u(e.cwd)}))}function D(e,t){return E(e,[],{})[0]?.cwd||t[0]?.cwd||``}function O(e,t,n,r,i){let a=s(e).map(e=>({key:e.key,cwd:e.cwd,count:e.sessions.length}));return c(T(a,t).map(e=>{let t=e.cwd?u(e.cwd):i,r=e.key===`\0`?``:n[e.key]||``;return{...e,label:r||t,folderLabel:t,custom:!!r}}),r)}export{w as a,T as i,O as n,y as o,E as r,D as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-B0Z9INg1.js";import{i as e,r as t}from"./vendor-react-DwNgTV1j.js";import{t as n}from"./vendor-ui-DvrYggeS.js";import{t as r}from"./utils-C8uzG5AZ.js";import"./button-CCcCN8tE.js";import{t as i}from"./input-CPw-zkYh.js";import"./textarea-DmATpOqT.js";e();var a=t();function o({className:e,...t}){return(0,a.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:r(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-sm border border-input bg-panel transition-[border-color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-surface-muted has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-focus has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-focus-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var s=n(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function c({className:e,align:t=`inline-start`,...n}){return(0,a.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:r(s({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}n(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-xs px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6.5 rounded-xs p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function l({className:e,...t}){return(0,a.jsx)(i,{"data-slot":`input-group-control`,className:r(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0`,e),...t})}export{c as n,l as r,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t}from"./vendor-state-GkUciC5H.js";import{t as n}from"./createLucideIcon-Cd-3GVxJ.js";import{n as r,r as i}from"./useBoardItems-CzLK6g45.js";var a=n(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),o=`pisper-launch-defaults`,s=[`approval-required`,`workspace-write`,`full-access`],c=[`plan`,`goal`,`team`],l=s.filter(e=>e!==`full-access`);function u(e){return l.includes(e)?e:``}var d={cwd:``,projectless:!1,model:``,thinkingLevel:``,executionMode:``,runMode:`plan`};function f(e,t,n){if(typeof e!=`string`)return``;let r=e.trim();return r.length<=t&&(!n||n.test(r))?r:``}function p(e){let t=i(e);return{cwd:f(t.cwd,4096),projectless:t.projectless===!0,model:f(t.model,256),thinkingLevel:f(t.thinkingLevel,32,/^[a-z][a-z0-9_-]*$/),executionMode:u(t.executionMode),runMode:c.includes(t.runMode)?t.runMode:`plan`}}function m(e,t){let n=t.projectless??(t.cwd===void 0&&e.projectless),r=p({...e,...t,projectless:n});return t.executionMode===`full-access`?{...r,executionMode:u(e.executionMode)}:r}var h=t()(e((e,t)=>({...d,rememberLaunch:n=>{let{cwd:r,projectless:i,model:a,thinkingLevel:o,executionMode:s,runMode:c}=t();e(m({cwd:r,projectless:i,model:a,thinkingLevel:o,executionMode:s,runMode:c},n))},resetLaunchDefaults:()=>e({...d})}),{name:o,storage:r(),version:1,partialize:({cwd:e,projectless:t,model:n,thinkingLevel:r,executionMode:i,runMode:a})=>({cwd:e,projectless:t,model:n,thinkingLevel:r,executionMode:i,runMode:a}),merge:(e,t)=>({...t,...p(e)})}));export{h as n,a as r,s as t};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MobileNavigation-BIPy8A0i.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-BIJtH0nB.js","assets/i18n-BjpQE1sJ.js","assets/vendor-router-CSN_DGvx.js","assets/index-C3xrFlMb.js","assets/index-CfTBR7Rs.css","assets/storage-BY6wEHPw.js","assets/vendor-state-GkUciC5H.js","assets/runtime-capabilities-store-BvWnn9Kx.js","assets/api-DxQIocGp.js","assets/abort-signal-f4JsiYKX.js","assets/runtime-capabilities-BhAMiYhG.js","assets/chevron-left-BAtyp3_6.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/chevron-right-C3t2Rckj.js","assets/settings-navigation-DV3N_utl.js","assets/bell-BjONAtgH.js","assets/bot-B3TaBp_T.js","assets/info-DATxy0fb.js","assets/monitor-ORxecA9m.js","assets/refresh-cw-TbWxTY4K.js","assets/DesktopWindowControls-CKaPEgxw.js","assets/minus-BuutOHSj.js","assets/square-bHHVTT3G.js","assets/x-07u4-129.js","assets/FloatingWidgets-UItLK_UZ.js","assets/routes-Da0OHSy6.js","assets/placements-Dgq244bc.js","assets/useQuery-Bg3cTjsY.js","assets/component-changes-Q9Bf64Ob.js","assets/session-scope-SQQU-bRA.js","assets/session-board-status-D2lpFPiI.js","assets/safe-mode-sentinel-DnReXgjI.js","assets/usePhoneShell-BuNqR-TS.js","assets/use-mobile-DauOEda6.js","assets/client-store-H1xTSbo-.js","assets/AppOverlays-BFLcGGx9.js","assets/startup-queries-_OUFiG02.js","assets/mutation-Difliohy.js","assets/circle-alert-DCChabnT.js","assets/loader-circle-BOwQzHB-.js","assets/message-square-SKjZyY3v.js","assets/plus-fQbSqB1n.js","assets/search-D0mqDaf_.js","assets/square-terminal-BVG6cUT1.js","assets/tag-CqkeJlBf.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/kbd-CAufZTkl.js","assets/events-DWUUCmbP.js","assets/shortcuts-DWF7_dCu.js","assets/chat-api-CjiINBKJ.js","assets/format-DMJQzoZ7.js","assets/dialog-Bs9_FZX7.js","assets/dist-BHkR6BLP.js","assets/dist-41X0pdUs.js","assets/dist-BsRXXcSL.js","assets/es2015-DTZdOI9P.js","assets/button-CCcCN8tE.js","assets/useOverlayFocusReturn-NkxBSSjb.js","assets/palette-navigation-Bni8Mp34.js","assets/blocks-Olsdp5Lp.js","assets/brain-qxhnKqYP.js","assets/calendar-clock-VIxTaqqy.js","assets/folder-open-FIShC5Qk.js","assets/list-T5PqlpS2.js","assets/plug-BsIeHRwC.js","assets/radio-tower-jGQwrFWB.js","assets/rotate-ccw-clock-CO6Bw-sF.js","assets/server-BgNvmqwJ.js","assets/settings-QX0oWnVK.js","assets/sparkles-S_eeuqn9.js","assets/workflow-Bg94dy8I.js","assets/AppDialog-CbXmk5vN.js","assets/label-CVWjEcfV.js","assets/input-CPw-zkYh.js","assets/WebDesktopPet-DfAoMXEk.js","assets/public-components-CjL2gwlJ.js","assets/arrow-right-DqLOhpA2.js","assets/download-BCfIiuaL.js","assets/key-round-C29uZbsf.js","assets/config-search-hFrcaQf0.js","assets/BrandLogo-k3CvJjd4.js","assets/sidebar-DTHEZloM.js","assets/chevron-down-CxtxIjiP.js","assets/ellipsis-CfGKfbq6.js","assets/useSessionRowActions-BG8yJygF.js","assets/launch-defaults-store-DTq_ndTa.js","assets/useBoardItems-CzLK6g45.js","assets/useSessionListQuery-jM0IQ1En.js","assets/session-organization-api-Dt_FNL0d.js","assets/session-questions-Cf-1g85h.js","assets/dropdown-menu-CFIFNaKO.js","assets/check-2vYc6QaP.js","assets/dist-DzGQ7sLi.js","assets/dist-BRjj4UeB.js","assets/dist-OB2r6Xsr.js","assets/dist-BaBySQmo.js","assets/useNow-CpKRH_uQ.js","assets/card-presentation-1oph2b8P.js","assets/board-projects-Dxd3yet9.js","assets/session-home-sBII_AAO.js","assets/motion-DTR4ZVle.js","assets/pick-system-directory-C7BKn3Gc.js","assets/folder-plus-OPHZsJho.js","assets/pin-CU0FG0lI.js","assets/sidebar-store-Da-3xIaR.js","assets/useSidebarModel-CBd3rSxV.js","assets/new-task-C3wuHTor.js","assets/shortcut-aria-jHRmld9z.js","assets/StatusGlyph-1KgitlUg.js","assets/sidebar-commands-ZA1UOA_F.js","assets/PhoneTopBar-6KsMmalq.js","assets/PhoneMenuButton-BCxDG78_.js","assets/public-DjZxpaMo.js","assets/useFleetSystemInfo-kKFDmOS4.js","assets/square-pen-hYbjKh6A.js","assets/PhoneDrawer-C08oZFjf.js","assets/sheet-BTaIEX4w.js","assets/SidebarUpdateStatus-2eLpofE7.js","assets/external-link-CEQqPcqc.js","assets/rocket-BgLSjoHY.js","assets/SettingsSidebar-K4O49gWb.js","assets/arrow-left-B8oVrQ2S.js","assets/back-navigation-CK7X_5Bc.js","assets/DispatchOverlay-CGLJLqZo.js","assets/LaunchConsole-BIiKjt0j.js","assets/arrow-up-DST6-qVQ.js","assets/shield-alert-oZqX6MNu.js","assets/shield-B1ruzHd0.js","assets/FocusRuntimeControls-DyexiBAA.js","assets/braces-DQcXLGFF.js","assets/dist-V8chnW6-.js","assets/file-text-N9JICX6E.js","assets/popover-BqqbRCrL.js","assets/slider-DTmAZl-R.js","assets/input-group-CDEyjyK4.js","assets/textarea-DmATpOqT.js","assets/model-display-kDwvtxrW.js","assets/run-activity-CwfO0cui.js","assets/board-launch-B2PD2yr-.js","assets/public-launch-C4NBmnGZ.js","assets/QuickPromptIdeas-CX8dS2LC.js","assets/code-xml-BrUXrBax.js","assets/wand-sparkles-CvEBNUFz.js","assets/list-checks-B5Jl4aiO.js","assets/session-change-summary-api-CI_mYqV8.js","assets/touch-target-BsyCgjR5.js","assets/ShortcutHelpDialog-LajY5QoG.js","assets/ShortcutKeys-BCndDMeY.js","assets/PageHeader-SVPzWuI3.js","assets/more-pages-D_PnxLN0.js","assets/TerminalPanel-Ddu_dEnz.js","assets/terminal-context-aIsIJPn8.js","assets/TaskTerminalView-C7WW5feg.js","assets/PageState-Cz6vFMXv.js","assets/AppSelect-BGVBQRP1.js","assets/select-DD_WO-gs.js","assets/chevron-up-D_ZcXjqr.js","assets/dist-BiRPwy4W.js","assets/TaskTerminalView-BrP-ENHg.css","assets/MobileViewportStabilizer-OtwVmIPm.js","assets/session-tree-actions-AdyVzQwO.js","assets/session-tree-summary-BfBt_ogL.js","assets/BoardPage-C3P69gtK.js","assets/arrow-down-CDGua-ue.js","assets/corner-down-right--hxi-Ihy.js","assets/rotate-ccw-C0v8V77_.js","assets/trash-2-CNrPOoPR.js","assets/brand-DIEc3fK8.js","assets/segmented-control-BlM_GKV6.js","assets/tooltip-D4MFbqcG.js","assets/esm-DCV8yILT.js","assets/ChatPage-Bkv4vff9.js","assets/permission-rules-api-BO8nujtv.js","assets/session-list-BeyOEzyU.js","assets/circle-check-iEdCm3Pw.js","assets/image-plus-D7bzZog0.js","assets/GitDiffViewer-dtiUySxH.js","assets/file-Bllajneu.js","assets/side-chat-context-CtRt4VcS.js","assets/copy-DHmIFc52.js","assets/eye-uWAPXNzJ.js","assets/shield-check-Gvek4RJ7.js","assets/collapsible-DMaUQRX4.js","assets/alert-firawb0H.js","assets/vendor-motion-DSW3wzXK.js","assets/MarkdownMessage-CYDI17zd.js","assets/vendor-markdown-plugins-CT5L3KA9.js","assets/vendor-shiki-runtime-DM7fm4Bl.js","assets/vendor-markdown-plugins-DEcVZfaU.css","assets/vendor-markdown-CT6Z4fh8.js","assets/route-context-DvWDul4T.js","assets/HoldToConfirmButton-BxdJ7icc.js","assets/card-C3A0b5KR.js","assets/FileAttachmentPreview-BhdQDxeP.js","assets/tabs-DsgBuvJv.js","assets/git-branch-N7LGjtzt.js","assets/link-2-mgasYn21.js","assets/panel-right-BSUtqUd8.js","assets/paperclip-BCXrwYpb.js","assets/pencil-U08v_vV9.js","assets/play-DNDjDNGn.js","assets/triangle-alert-CE1q54ci.js","assets/wrench-6pg6_bqI.js","assets/checkbox-BrEHgFV0.js","assets/progress-5odAz3B9.js","assets/switch-D_G8wFhs.js","assets/WorkspacePicker-DsJ0_nq_.js","assets/app-primitives-Drz_SjnR.js","assets/badge-CWB3lj2H.js","assets/usePagePrimaryAction-CWPC0C_f.js","assets/web-preview-DJZpUrZT.js","assets/tool-labels-BUEvdohv.js","assets/speech-session-DjxOmcG7.js","assets/web-preview-events-DRcd0j1W.js","assets/SessionShell-B-zDO3z-.js","assets/SessionHome-B-lxCMjh.js","assets/MorePage-CFfeYmW_.js","assets/app-window-CPNdvYNt.js","assets/image-BY_c3FYU.js","assets/monitor-smartphone-B1gIjItA.js","assets/ChatHistoryPage-CZX27BNu.js","assets/FeaturePage-RH3fTWIk.js","assets/AssetsPage-BoB8pJxi.js","assets/queryOptions-Dfvzj6n2.js","assets/mobile-runtime-recovery-tbTyacip.js","assets/field-DaxtcBBA.js","assets/separator-BPh_qxvc.js","assets/ChannelsPage-yPVopq7h.js","assets/send-QxBfLFo-.js","assets/SchedulesPage-G1R7ua11.js","assets/ConfigPage-D1MJyBus.js","assets/arrow-up-right-B6l8qFZz.js","assets/zap-DZHw5afO.js","assets/app-update-awVCww9P.js","assets/browser-notifications-DBS0oXqN.js","assets/ChatAppearancePage-DPulJWKJ.js","assets/PluginsPage-jhrfFTbZ.js","assets/earth-Ddy13fHh.js","assets/file-code-corner-BnE1ljT0.js","assets/package-BOmkLaKS.js","assets/save-CHBB52P8.js","assets/MemoryPage-ObL1zsXe.js","assets/McpPage-DC_9gmSC.js","assets/SkillsPage-Z_czQryK.js","assets/public-Dp3V7Oez.js","assets/settings-2-CXJjXJS9.js","assets/use-studio-actions-e1FiDWGR.js","assets/safe-mode-instance-UY-RZ5fF.js","assets/PageFrame-DNwGZ-Dz.js","assets/WorkflowsPage-D_wAL0Md.js","assets/grip-vertical-B__LYT0s.js","assets/vendor-xyflow-hxQFvEHK.js","assets/vendor-xyflow-DLioOiRN.css","assets/navigation-EoDz3gT8.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{a as t,d as n,f as r,h as i,i as a,l as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./vendor-router-CSN_DGvx.js";import{t as p}from"./index-C3xrFlMb.js";import{i as m,n as h,r as g,t as _}from"./vendor-react-DwNgTV1j.js";import{t as v}from"./vendor-ui-DvrYggeS.js";import{a as y,c as b,d as x,f as S,i as ee,l as C,n as w,o as te,r as T,s as ne,t as re,u as ie}from"./routes-Da0OHSy6.js";import{a as E,c as ae,i as oe,l as se,o as ce,r as D,s as le,t as O}from"./i18n-BjpQE1sJ.js";import{n as ue,r as k,t as A}from"./use-i18n-BIJtH0nB.js";import{t as j}from"./storage-BY6wEHPw.js";import{n as de,t as fe}from"./useQuery-Bg3cTjsY.js";import{a as pe,i as me,n as he,o as ge,r as _e,s as ve,t as ye}from"./startup-queries-_OUFiG02.js";import{s as be,t as xe}from"./api-DxQIocGp.js";import{a as Se,i as Ce,r as we}from"./runtime-capabilities-BhAMiYhG.js";import{t as Te}from"./runtime-capabilities-store-BvWnn9Kx.js";import{n as Ee,r as De}from"./use-mobile-DauOEda6.js";import{t as Oe}from"./client-store-H1xTSbo-.js";import{t as M}from"./createLucideIcon-Cd-3GVxJ.js";import{t as ke}from"./circle-check-iEdCm3Pw.js";import{t as Ae}from"./info-DATxy0fb.js";import{a as je,i as Me,n as Ne,o as Pe,t as Fe}from"./settings-navigation-DV3N_utl.js";import{n as Ie,t as Le}from"./list-T5PqlpS2.js";import{t as Re}from"./search-D0mqDaf_.js";import{t as ze}from"./settings-QX0oWnVK.js";import{t as Be}from"./square-pen-hYbjKh6A.js";import{t as Ve}from"./triangle-alert-CE1q54ci.js";import{t as He}from"./x-07u4-129.js";import{i as Ue,n as We,r as Ge,t as Ke}from"./more-pages-D_PnxLN0.js";import{a as qe}from"./dist-41X0pdUs.js";import{a as Je,c as N,i as Ye,l as Xe,o as P,r as Ze,s as Qe,t as F}from"./dist-BsRXXcSL.js";import{r as $e}from"./dist-BiRPwy4W.js";import{n as et}from"./dist-DzGQ7sLi.js";import{c as tt,i as nt,o as rt}from"./es2015-DTZdOI9P.js";import{r as it}from"./tooltip-D4MFbqcG.js";import{t as I}from"./utils-C8uzG5AZ.js";import{n as at,t as ot}from"./button-CCcCN8tE.js";import{t as st}from"./kbd-CAufZTkl.js";import{_ as ct,h as lt,n as ut,t as dt,v as ft}from"./events-DWUUCmbP.js";import{a as pt,c as L,i as mt,n as ht,r as R,s as z}from"./shortcuts-DWF7_dCu.js";import{t as B}from"./sidebar-store-Da-3xIaR.js";import{n as gt,t as _t}from"./new-task-C3wuHTor.js";import{a as vt,i as yt,l as bt,o as xt,s as St,t as V}from"./dialog-Bs9_FZX7.js";import{t as Ct}from"./shortcut-aria-jHRmld9z.js";import{i as wt,t as Tt}from"./back-navigation-CK7X_5Bc.js";import{t as Et}from"./route-context-DvWDul4T.js";import{n as Dt}from"./sidebar-commands-ZA1UOA_F.js";import{r as H}from"./app-primitives-Drz_SjnR.js";import{n as U,r as Ot}from"./web-preview-DJZpUrZT.js";import{t as kt}from"./BrandLogo-k3CvJjd4.js";import{r as W}from"./web-preview-events-DRcd0j1W.js";import{_ as At,a as jt,c as Mt,f as G,h as Nt,l as Pt,n as Ft,r as It,s as Lt,u as K,v as q}from"./app-update-awVCww9P.js";import{i as Rt}from"./browser-notifications-DBS0oXqN.js";import{n as zt,t as Bt}from"./navigation-EoDz3gT8.js";var J=e(m());function Vt({i18n:e,defaultNS:t,children:n}){let r=(0,J.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,J.createElement)(k.Provider,{value:r},n)}var Y=M(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),Ht=M(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Ut=e(h(),1),X=g(),Z=Object.defineProperty,Q=(e,t)=>Z(e,`name`,{value:t,configurable:!0}),Wt=`ToastProvider`,[Gt,Kt,qt]=et(`Toast`),[Jt,Yt]=Qe(`Toast`,[qt]),[Xt,Zt]=Jt(Wt),Qt=Q(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=J.useState(null),[u,d]=J.useState(0),f=J.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Wt}\`. Expected non-empty \`string\`.`),(0,X.jsx)(Gt.Provider,{scope:t,children:(0,X.jsx)(Xt,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:J.useCallback(()=>d(e=>e+1),[]),onToastRemove:J.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),$t=`ToastViewport`,en=[`F8`],tn=`toast.viewportPause`,nn=`toast.viewportResume`,rn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,hotkey:r=en,label:i=`Notifications ({hotkey})`,...a}=e,o=Zt($t,n),s=Kt(n),c=J.useRef(null),l=J.useRef(null),u=J.useRef(null),d=J.useRef(null),f=qe(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;J.useEffect(()=>{let e=Q(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),J.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=Q(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(tn);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=Q(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(nn);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=Q(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=Q(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=J.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...On(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return J.useEffect(()=>{let e=d.current;if(e){let t=Q(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);kn(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,X.jsxs)(rt,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,X.jsx)(on,{ref:l,onFocusFromOutsideViewport:()=>{kn(h({tabbingDirection:`forwards`}))}}),(0,X.jsx)(Gt.Slot,{scope:n,children:(0,X.jsx)(N.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,X.jsx)(on,{ref:u,onFocusFromOutsideViewport:()=>{kn(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),an=`ToastFocusProxy`,on=J.forwardRef(Q(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Zt(an,n);return(0,X.jsx)($e,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),sn=`Toast`,cn=`toast.swipeStart`,ln=`toast.swipeMove`,un=`toast.swipeCancel`,dn=`toast.swipeEnd`,fn=J.forwardRef(Q(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Ye({prop:r,defaultProp:i??!0,onChange:a,caller:sn});return(0,X.jsx)(Ze,{present:n||s,children:(0,X.jsx)(hn,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:F(e.onPause),onResume:F(e.onResume),onSwipeStart:P(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:P(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:P(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:P(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[pn,mn]=Jt(sn,{onClose(){}}),hn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=Zt(sn,n),g=Kt(n),[_,v]=J.useState(null),y=qe(t,v),b=J.useRef(null),x=J.useRef(null),S=i||h.duration,ee=J.useRef(0),C=J.useRef(S),w=J.useRef(0),{onToastAdd:te,onToastRemove:T}=h,ne=F(()=>{_?.contains(document.activeElement)&&h.viewport?.focus(),o()}),re=J.useCallback(e=>{!e||e===1/0||(window.clearTimeout(w.current),ee.current=new Date().getTime(),w.current=window.setTimeout(ne,e))},[ne]);J.useEffect(()=>{let e=h.viewport;if(e){let t=Q(()=>{re(C.current),l?.()},`handleResume`),n=Q(()=>{let e=new Date().getTime()-ee.current;C.current-=e,window.clearTimeout(w.current),c?.()},`handlePause`);return e.addEventListener(tn,n),e.addEventListener(nn,t),()=>{e.removeEventListener(tn,n),e.removeEventListener(nn,t)}}},[h.viewport,S,c,l,re]),J.useEffect(()=>{a&&!h.isClosePausedRef.current&&re(S)},[a,S,h.isClosePausedRef,re]),J.useEffect(()=>()=>{window.clearTimeout(w.current)},[]),J.useEffect(()=>(te(),()=>T()),[te,T]);let ie=J.useMemo(()=>_?Cn(_):null,[_]);return h.viewport?(0,X.jsxs)(X.Fragment,{children:[ie&&(0,X.jsx)(gn,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:ie}),(0,X.jsx)(pn,{scope:n,onClose:ne,children:Ut.createPortal((0,X.jsx)(Gt.ItemSlot,{scope:n,children:(0,X.jsx)(tt,{asChild:!0,onEscapeKeyDown:P(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||ne()}),children:(0,X.jsx)(N.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:P(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||ne())}),onPointerDown:P(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:P(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,wn(ln,d,f,{discrete:!1})):Tn(l,h.swipeDirection,c)?(x.current=l,wn(cn,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:P(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Tn(t,h.swipeDirection,h.swipeThreshold)?wn(dn,p,r,{discrete:!0}):wn(un,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),gn=Q(e=>{let{__scopeToast:t,children:n,...r}=e,i=Zt(sn,t),[a,o]=J.useState(!1),[s,c]=J.useState(!1);return En(()=>o(!0)),J.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,X.jsx)(nt,{asChild:!0,container:i.announcerContainer||void 0,children:(0,X.jsx)($e,{...r,children:a&&(0,X.jsxs)(X.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),_n=J.forwardRef(Q(function(e,t){let{__scopeToast:n,...r}=e;return(0,X.jsx)(N.div,{...r,ref:t})},`ToastDescription`)),vn=`ToastAction`,yn=J.forwardRef(Q(function(e,t){let{altText:n,...r}=e;return n.trim()?(0,X.jsx)(Sn,{altText:n,asChild:!0,children:(0,X.jsx)(xn,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${vn}\`. Expected non-empty \`string\`.`),null)},`ToastAction`)),bn=`ToastClose`,xn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,...r}=e,i=mn(bn,n);return(0,X.jsx)(Sn,{asChild:!0,children:(0,X.jsx)(N.button,{type:`button`,...r,ref:t,onClick:P(e.onClick,i.onClose)})})},`ToastClose`)),Sn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,X.jsx)(N.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Cn(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Dn(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Cn(e))}}}),t}Q(Cn,`getAnnounceTextContent`);function wn(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Xe(i,a):i.dispatchEvent(a)}Q(wn,`handleAndDispatchCustomEvent`);var Tn=Q((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function En(e=()=>{}){let t=F(e);Je(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}Q(En,`useNextFrame`);function Dn(e){return e.nodeType===e.ELEMENT_NODE}Q(Dn,`isHTMLElement`);function On(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Q(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Q(On,`getTabbableCandidates`);function kn(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}Q(kn,`focusFirst`);var An=Qt,jn=rn,Mn=fn,Nn=_n,Pn=yn,Fn=xn,In=_();function Ln({children:e}){let{i18n:t}=ue(),n=se(t.resolvedLanguage)?t.resolvedLanguage:O;return(0,J.useEffect)(()=>{document.documentElement.lang=n;try{p.setItem(j.language,n)}catch{}window.pisperDesktop?.setLanguage?.(n)},[n]),e}function Rn({children:e}){return(0,X.jsx)(Vt,{i18n:ae,children:(0,X.jsx)(Ln,{children:e})})}function zn({children:e}){return(0,J.useEffect)(()=>_e(window),[]),(0,X.jsx)(de,{client:pe,children:(0,X.jsx)(Rn,{children:(0,X.jsx)(it,{delayDuration:200,children:e})})})}function Bn(){return[...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], [role="menu"], [data-slot="popover-content"]`)].some(e=>e.dataset.state!==`closed`&&e.getAttribute(`aria-hidden`)!==`true`&&e.getClientRects().length>0)}function Vn({onRouteBack:e}){let t=(0,J.useRef)(e);return t.current=e,(0,J.useEffect)(()=>{let e=new WeakSet,n=t=>{t.key===`Escape`&&Bn()&&e.add(t)},r=t=>{t.key!==`Escape`||t.defaultPrevented||t.isComposing||e.has(t)||Tt.dismiss()&&t.preventDefault()},i=()=>{let e=Bn(),n=new KeyboardEvent(`keydown`,{key:`Escape`,bubbles:!0,cancelable:!0});return wt(n),(document.activeElement||document.body).dispatchEvent(n),e||n.defaultPrevented?!0:t.current?.()??!1},a=window;return a.__pisperRequestBack=i,window.addEventListener(`keydown`,n,!0),window.addEventListener(`keydown`,r),()=>{a.__pisperRequestBack===i&&delete a.__pisperRequestBack,window.removeEventListener(`keydown`,n,!0),window.removeEventListener(`keydown`,r)}},[]),null}function Hn(){let e=null,t=!1;return{register(n){return e=n,t&&(t=!1,n()),()=>{e===n&&(e=null)}},invoke(){if(e)return e();t=!0},clear(){e=null}}}Object.freeze([`session`,`board`,`more`,`settings`]);var Un=Object.freeze({board:`board`,more:`more`,settings:`config`});function Wn(e,t){return t?`settings`:e===`session`||e===`chat`?`session`:e===`board`?`board`:e===`components`||e===`more`||e===`config`||Ge.has(e)?`more`:null}function Gn({location:e,navigation:t}){return t.state!==`idle`&&t.location?.pathname||e.pathname}function Kn({location:e,navigation:t}){return C(Gn({location:e,navigation:t}))===`session`?null:t.state!==`idle`&&C(e.pathname)===`session`?{to:e.pathname+(e.search||``),replace:!0,state:e.state}:{to:`/`}}var qn=/^\/components\/([^/]+)\/?$/;function Jn(e,t,n,{phone:r=!1,homeEntry:i=!1,canGoBack:a=!1}={}){return e===`session`?i||t===`/`||t===``?null:a?-1:null:e===`components`&&qn.test(t)?`/components`:r&&n&&/^\/config\/[^/]+/.test(t)?ee:Wn(e,n)===`more`&&e!==`more`?`/more`:`/`}var Yn=`flex w-full min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-base text-content transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,Xn=`grid size-8 flex-none place-items-center rounded-[var(--r-sm)] text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus pointer-coarse:size-11`,Zn=`grid size-10 place-items-center rounded-[var(--r-md)] text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus pointer-coarse:size-11`;function Qn(e){let t=e.takeover,n=B(e=>e.collapsed)&&!t,r=B(e=>e.peeking),i=B(e=>e.setPeeking),a=(0,J.useRef)(null),o=(0,J.useRef)(null),s=(0,J.useRef)(!1);return(0,J.useLayoutEffect)(()=>{if(!s.current)return;let e=document.activeElement;e&&e!==document.body&&o.current?.contains(e)||o.current?.querySelector(`[data-sidebar-toggle]`)?.focus()},[n]),(0,J.useEffect)(()=>{t&&r&&i(!1)},[r,i,t]),(0,J.useEffect)(()=>{if(!n||!r)return;let e=e=>e instanceof Element&&!!(a.current?.contains(e)||e.closest(`[role="menu"], [role="dialog"], [data-radix-popper-content-wrapper]`)),t=t=>{e(t.target)||i(!1)},o=t=>{e(t.target)||i(!1)},s=t=>{t.key!==`Escape`||t.defaultPrevented||!e(t.target)||(t.preventDefault(),i(!1))};return document.addEventListener(`focusin`,t),document.addEventListener(`pointerdown`,o),document.addEventListener(`keydown`,s),()=>{document.removeEventListener(`focusin`,t),document.removeEventListener(`pointerdown`,o),document.removeEventListener(`keydown`,s)}},[n,r,i]),(0,X.jsxs)(`div`,{ref:o,"data-shell-sidebar":t?`settings`:n?`rail`:`expanded`,"data-focus-region":`sidebar`,onFocus:()=>{s.current=!0},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(s.current=!1)},className:I(`relative z-20 flex h-full flex-none flex-col bg-sidebar transition-[width] duration-(--d-base) ease-out motion-reduce:transition-none`,n?`w-[60px]`:`w-[268px]`,`dark:border-r dark:border-stroke-soft`),children:[t??(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col animate-in fade-in duration-(--d-fast) motion-reduce:animate-none`,children:n?(0,X.jsx)(nr,{...e}):(0,X.jsx)(tr,{...e})},n?`rail`:`expanded`),n&&r&&(0,X.jsx)(`div`,{ref:a,"data-shell-sidebar-peek":!0,className:`absolute inset-y-0 left-0 z-40 flex w-[268px] flex-col bg-sidebar shadow-float`,children:(0,X.jsx)(tr,{...e,peek:!0})})]})}var $n={newTask:`primaryAction`,search:`commandPalette`,board:`openBoard`,features:`openMore`,settings:`openSettings`};function er(){let{t:e}=A();return{newTask:e(`navigation:shell.newTask`),search:e(`navigation:sidebar.search`),board:e(`navigation:sidebar.allAgents`),features:e(`navigation:sidebar.features`),settings:e(`navigation:navigation.settings`)}}function tr({active:e,onNewTask:t,onSearch:n,onOpenBoard:r,onOpenFeatures:i,onOpenSettings:a,content:o,update:s,peek:c=!1}){let{t:l}=A(),u=er(),d=B(e=>e.toggleCollapsed),f=B(e=>e.setPeeking),p=L(e=>e.bindings),m=p.toggleSidebar,h=z(`toggleSidebar`),g={newTask:z(`primaryAction`),search:z(`commandPalette`),board:z(`openBoard`),features:z(`openMore`),settings:z(`openSettings`)},_=l(c?`navigation:sidebar.expand`:`navigation:sidebar.collapse`),v=(t,n,r)=>{let i=t===`board`?u.board:t===`features`?u.features:u[t],a=g[t],o=t===e;return(0,X.jsxs)(`button`,{type:`button`,"data-sidebar-entry":t,"aria-current":o?`page`:void 0,"aria-keyshortcuts":Ct(p[$n[t]]),className:I(Yn,`h-9 pointer-coarse:h-11`,o&&`bg-surface-active font-medium hover:bg-surface-active`),onClick:r,children:[(0,X.jsx)(n,{className:`size-[18px] flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:i}),a&&(0,X.jsx)(st,{"aria-hidden":`true`,className:`border-transparent bg-transparent text-content-faint shadow-none pointer-coarse:hidden`,children:a})]})};return(0,X.jsxs)(`nav`,{"aria-label":l(`navigation:sidebar.label`),className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{"data-window-drag-region":!0,className:`flex h-[52px] flex-none items-center gap-2 pr-2.5 pl-4`,children:[(0,X.jsx)(kt,{size:22}),(0,X.jsx)(`span`,{className:`text-[15px] font-semibold tracking-[-.01em] text-content`,children:`Pisper`}),(0,X.jsx)(`span`,{className:`flex-1`}),(0,X.jsx)(`button`,{type:`button`,"data-sidebar-toggle":c?void 0:`collapse`,"aria-expanded":!c||void 0,className:Xn,"aria-label":_,"aria-keyshortcuts":c?void 0:Ct(m),title:!c&&h?`${_} (${h})`:_,onClick:()=>c?f(!1):d(),children:c?(0,X.jsx)(Ht,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`}):(0,X.jsx)(Y,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,X.jsxs)(`div`,{className:`flex flex-none flex-col gap-px px-2 pt-0.5 pb-1.5`,children:[v(`newTask`,Be,t),v(`search`,Re,n),v(`board`,Le,r),v(`features`,Ie,i)]}),(0,X.jsx)(`div`,{"data-sidebar-scroll":!0,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-2 pt-1.5`,children:o}),(0,X.jsxs)(`div`,{className:`flex flex-none items-center gap-1 p-2`,children:[(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:v(`settings`,ze,a)}),s]})]})}function nr({active:e,onNewTask:t,onSearch:n,onOpenBoard:r,onOpenFeatures:i,onOpenSettings:a,railCounts:o,update:s}){let{t:c}=A(),l=er(),u=B(e=>e.toggleCollapsed),d=L(e=>e.bindings),f=d.toggleSidebar,p=z(`toggleSidebar`),m=c(`navigation:sidebar.expand`),h=(t,n,r)=>{let i=t===`board`?l.board:t===`features`?l.features:l[t],a=t===e;return(0,X.jsx)(`button`,{type:`button`,"data-sidebar-entry":t,"aria-keyshortcuts":Ct(d[$n[t]]),"aria-label":i,"aria-current":a?`page`:void 0,title:i,className:I(Zn,a&&`bg-surface-active text-content`),onClick:r,children:(0,X.jsx)(n,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`})})};return(0,X.jsxs)(`nav`,{"aria-label":c(`navigation:sidebar.labelCollapsed`),className:`flex min-h-0 flex-1 flex-col items-center gap-1 pb-2`,children:[(0,X.jsx)(`div`,{"data-window-drag-region":!0,className:`flex h-[52px] flex-none items-center`,children:(0,X.jsx)(`button`,{type:`button`,"data-sidebar-toggle":`expand`,"aria-expanded":!1,className:Zn,"aria-label":m,"aria-keyshortcuts":Ct(f),title:p?`${m} (${p})`:m,onClick:u,children:(0,X.jsx)(Ht,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`})})}),h(`newTask`,Be,t),h(`search`,Re,n),(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`my-1.5 h-px w-6 bg-stroke-strong`}),o,(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`my-1.5 h-px w-6 bg-stroke-strong`}),h(`board`,Le,r),h(`features`,Ie,i),(0,X.jsx)(`span`,{className:`flex-1`}),s,h(`settings`,ze,a)]})}function rr({collapsed:e=!1}){let{t}=A();return e?(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`flex flex-col items-center gap-1`,children:[(0,X.jsx)(`span`,{className:`size-10 rounded-[var(--r-md)] bg-surface-hover`}),(0,X.jsx)(`span`,{className:`size-10 rounded-[var(--r-md)] bg-surface-hover`})]}):(0,X.jsx)(`div`,{role:`status`,"aria-busy":`true`,"aria-label":t(`navigation:sidebar.loading`),children:[60,44,70].map(e=>(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`flex h-9 items-center gap-2.5 px-2.5`,children:[(0,X.jsx)(`span`,{className:`size-4 rounded-full bg-surface-hover`}),(0,X.jsx)(`span`,{className:`h-3 rounded-sm bg-surface-hover`,style:{width:`${e}%`}})]},e))})}var ir=`pisper-custom-accent-style`,ar=[`xs`,`sm`,`base`,`lg`,`xl`,`2xl`,`3xl`],or=[12,13,14,16,20,24,28];function sr(e){let{uiFontSize:t}=Nt(typeof e==`number`?{uiFontSize:e}:{fontScale:e});return or.map(e=>Math.round(e*t/14))}function cr(e,t,n=new Date().getHours()){return e===`dark`?!0:e===`light`?!1:e===`system`?t:n>=18||n<8}function lr(e){let t=document.documentElement;t.dataset.accent=e.accent,t.dataset.density=e.density,t.dataset.fontScale=e.fontScale,t.dataset.motion=e.motion,t.dataset.radius=e.radius;let n=Nt(e.uiFontSize===void 0?{fontScale:e.fontScale,codeFontSize:e.codeFontSize}:e);t.style.setProperty(`--ui-font-size`,`${n.uiFontSize}px`),t.style.setProperty(`--font-code-size`,`${n.codeFontSize}px`),sr(n.uiFontSize).forEach((e,n)=>{t.style.setProperty(`--font-ui-${ar[n]}`,`${e}px`)});let r=e.accent===`custom`?q(e.customAccent||``):null,i=document.getElementById(ir);r?(i||(i=document.createElement(`style`),i.id=ir,document.head.append(i)),i.textContent=At(r)):i?.remove()}function ur(e,t){if(!e)return``;let n=t?.sessions?.find(t=>t?.id===e);return n&&n.archived!==!0?e:``}function dr(){let e=o(),t=f();return(0,J.useEffect)(()=>{let n=n=>{if(n.defaultPrevented)return;let r=(n.target instanceof Element?n.target:null)?.closest(`a[href]`);if(!r)return;let i=U({href:r.href,baseUrl:window.location.href,button:n.button,download:r.hasAttribute(`download`),altKey:n.altKey,ctrlKey:n.ctrlKey,metaKey:n.metaKey,shiftKey:n.shiftKey,behavior:r.dataset.webPreview});if(!i)return;if(n.preventDefault(),n.stopPropagation(),x(e.pathname)){W(i);return}let a=ur(p.getItem(j.activeSession),pe.getQueryData(ye));if(!a){window.open(i,`_blank`,`noopener,noreferrer`);return}W(i),t(S(a))};return document.addEventListener(`click`,n,!0),()=>document.removeEventListener(`click`,n,!0)},[e.pathname,t]),null}function fr({blocked:e,onCommandPalette:t,onPrimary:n,onSearch:r,onToggleTerminal:i,onToggleSidebar:a,onAgentPanel:o,onPreviousAgent:s,onNextAgent:c,onSettings:l,onOpenSession:u,onOpenBoard:d,onOpenComponents:f,onOpenMore:p,onJumpToAttention:m,onSessionTree:h,onSideChat:g,onCycleFocusRegion:_,onShortcutHelp:v}){let y=L(e=>e.bindings);return(0,J.useLayoutEffect)(()=>{let b=b=>{if(e||pt(b)||mt(b)&&!b.key.startsWith(`Arrow`))return;let x;R(b,y.commandPalette)?x=t:R(b,y.primaryAction)?x=n:R(b,y.openSession)?x=u:R(b,y.openBoard)?x=d:R(b,y.openComponents)?x=f:R(b,y.openMore)?x=p:R(b,y.jumpToAttention)?x=m:R(b,y.sessionTree)?x=h:R(b,y.sideChat)?x=g:R(b,y.cycleFocusRegion)?x=_:R(b,y.toggleSidebar)?x=a:R(b,y.agentPanel)?x=o:R(b,y.previousAgent)?x=s:R(b,y.nextAgent)?x=c:R(b,y.toggleTerminal)?x=i:R(b,y.openSettings)?x=l:R(b,y.shortcutHelp)?x=v:!ht(b.target)&&R(b,y.focusSearch)&&(x=r),x&&(b.preventDefault(),x())};return window.addEventListener(`keydown`,b),()=>window.removeEventListener(`keydown`,b)},[y,e,o,t,_,m,c,d,f,p,u,s,n,r,h,l,v,g,i,a]),null}var pr=v(`group pointer-events-auto relative flex min-h-11 w-full items-center gap-2 overflow-hidden rounded-md border px-3.5 py-2.5 pr-10 text-[13px] leading-5 font-medium tracking-[0] shadow-float transition data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-right-full data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none`,{variants:{tone:{success:`border-success-border bg-success-soft text-success-strong`,error:`border-danger-border bg-danger-soft text-danger`,info:`border-stroke bg-popover text-foreground`}},defaultVariants:{tone:`success`}});function mr({className:e,tone:t,...n}){return(0,X.jsx)(Mn,{"data-slot":`toast`,className:I(pr({tone:t}),e),...n})}function hr({...e}){return(0,X.jsx)(An,{"data-slot":`toast-provider`,...e})}function gr({className:e,...t}){return(0,X.jsx)(jn,{"data-slot":`toast-viewport`,className:I(`fixed right-5 bottom-5 z-[80] flex w-[min(420px,calc(100vw-40px))] max-w-full flex-col gap-2 outline-none max-sm:right-3 max-sm:bottom-3 max-sm:left-3 max-sm:w-auto`,e),...t})}function _r({className:e,...t}){return(0,X.jsx)(Nn,{"data-slot":`toast-description`,className:I(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e),...t})}function vr({className:e,...t}){return(0,X.jsx)(Fn,{"data-slot":`toast-close`,className:I(`absolute top-1/2 right-1.5 grid size-7 -translate-y-1/2 place-items-center rounded-sm text-current opacity-70 transition hover:bg-black/5 hover:opacity-100 dark:hover:bg-white/10`,e),...t})}var yr={success:ke,error:Ve,info:Ae};function br({message:e,tone:t,closeLabel:n,action:r,...i}){let a=yr[t];return(0,X.jsxs)(mr,{tone:t,type:t===`error`?`foreground`:`background`,...i,children:[(0,X.jsx)(a,{className:`size-[18px] shrink-0`}),(0,X.jsx)(_r,{children:e}),r&&(0,X.jsx)(Pn,{altText:r.label,asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,className:`h-7 shrink-0 rounded-sm border border-current/30 px-2 text-xs font-semibold hover:bg-current/10`,onClick:r.onAction,children:r.label})}),(0,X.jsx)(vr,{"aria-label":n,title:n,children:(0,X.jsx)(He,{className:`size-4`})})]})}function xr(){let{t:e}=A(),[t,n]=(0,J.useState)(null),r=(0,J.useRef)(null),i=(0,J.useCallback)(e=>{r.current?.(e),r.current=null,n(null)},[]),a=(0,J.useCallback)(e=>new Promise(t=>{r.current?.(null),r.current=t,n(e)}),[]),o=(0,J.useCallback)((t={})=>a({type:`confirm`,title:e(`common:useAppDialog.confirmAction`),confirmLabel:e(`common:useAppDialog.confirm`),tone:`danger`,...t}).then(e=>e===!0),[a,e]),s=(0,J.useCallback)((t={})=>a({type:`prompt`,title:e(`common:useAppDialog.enterContent`),confirmLabel:e(`common:useAppDialog.save`),tone:`primary`,value:``,...t}).then(e=>typeof e==`string`?e:null),[a,e]),c=(0,J.useCallback)(()=>i(null),[i]);return(0,J.useEffect)(()=>()=>r.current?.(null),[]),{dialog:t,confirm:o,prompt:s,close:c,finish:i}}var Sr=15e3,Cr=216e5,wr=new Set([`checking`,`downloading`,`downloaded`]);function Tr(e){return!wr.has(e)}function Er(e,t=window){let n=!1,r=!1,i=()=>{n||r||(n=!0,Promise.resolve().then(e).catch(()=>{}).finally(()=>{n=!1}))},a=t.setTimeout(i,Sr),o=t.setInterval(i,Cr);return()=>{r=!0,t.clearTimeout(a),t.clearInterval(o)}}var Dr=new Set([`available`,`downloading`,`installed`,`error`]);function Or(e,t){return t?.find(e=>e.component===`desktop`)?.currentVersion.trim()||e}function kr(e){return e.filter(e=>e.size>0&&(Dr.has(e.state)||e.canInstall))}function Ar(e){return e.replace(/\r/g,``).split(`
|
|
3
|
-
`).filter(e=>!/^\s*#{1,6}\s+Pisper\s+(?:Desktop|TUI|Runtime)\s+v?\d+\.\d+\.\d+\s*$/i.test(e)&&!/^\s*#{1,6}\s+What['’]?s Changed\s*$/i.test(e)&&!/^\s*(?:\*\*)?(?:Full Changelog|完整变更)(?:\*\*)?\s*[::].*$/i.test(e)).join(`
|
|
4
|
-
`).replace(/\n{3,}/g,`
|
|
5
|
-
|
|
6
|
-
`).trim()}function jr(e){let t=e.filter(e=>e.state===`available`||e.state===`downloading`).map(e=>Ar(e.notes)).filter((e,t,n)=>e&&n.indexOf(e)===t);return t.length?`## What's Changed\n\n${t.join(`
|
|
7
|
-
|
|
8
|
-
`)}`:``}function Mr(e,t=new Date().toISOString()){let n=e.filter(e=>e.state===`error`),r=e.filter(e=>e.state===`available`),i=e.some(e=>e.state===`checking`),a=e.filter(e=>e.state===`downloading`),o=e.some(e=>e.state===`installed`),s=a[0]||r[0]||n[0]||e[0],c=jr(e),l=kr(e),u=l.reduce((e,t)=>e+t.size,0),d=l.reduce((e,t)=>t.state===`installed`?e+t.size:t.state===`downloading`?e+Math.min(t.size,Math.max(0,t.transferred||0)):e,0);return{state:a.length?`downloading`:i?`checking`:n.length?`error`:r.length?`available`:o?`installed`:e.length?`current`:`idle`,checkedAt:t,message:n.map(e=>`${e.component}: ${e.message}`).join(`
|
|
9
|
-
`),releaseUrl:s?.releaseUrl,canDownload:r.length>0,availableVersion:s?.availableVersion,notes:c,total:u,transferred:d,percent:u>0?Math.min(100,d/u*100):0}}async function Nr({refresh:e=!1,fetcher:t=fetch}={}){let n=await t(`/api/app-update${e?`?refresh=1`:``}`,{cache:`no-store`}),r=await n.json().catch(()=>null);if(!n.ok){let e=r&&`error`in r&&typeof r.error==`string`?r.error.trim():``;throw Error(e||`更新检查失败:HTTP ${n.status}`)}return r}var Pr=Object.freeze({desktop:!1,packaged:!1,version:`0.6.8`,platform:`browser`,arch:``,releasesUrl:Ft});function Fr(){let e=window.pisperDesktop,t=e?void 0:window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke,[n,r]=(0,J.useState)(Pr),[i,a]=(0,J.useState)({state:`idle`,checkedAt:null}),[o,s]=(0,J.useState)([]),c=(0,J.useRef)(i),l=(0,J.useRef)(null),u=(0,J.useRef)(!1),d=(0,J.useRef)(!1),f=(0,J.useCallback)(e=>{c.current=e,a(e)},[]),p=(0,J.useCallback)(({refresh:n=!0}={})=>{if(l.current)return l.current;f({...c.current,state:`checking`,message:``});let r=(async()=>{try{if(u.current=!1,e?.checkForUpdates)try{let t=await e.checkForUpdates();if(t.state===`available`&&t.canDownload)return u.current=!0,f(t),t}catch{}if(e?.checkComponentUpdates){let t=await e.checkComponentUpdates();s(t);let n=Mr(t);return f(n),!t.some(e=>e.state===`error`||e.state===`available`)&&t.some(e=>e.restartRequired)&&await e.restartForComponentUpdate?.(),n}if(d.current&&t){let e=await t(`mobile_check_app_update`,{refresh:n});return f(e),e}let r=await Nr({refresh:n});return f(r),r}catch(e){let t={state:`error`,message:e instanceof Error?e.message:String(e),checkedAt:new Date().toISOString()};return f(t),t}})();return l.current=r,r.finally(()=>{l.current===r&&(l.current=null)}),r},[f,e,t]);(0,J.useEffect)(()=>{let n=!0,i=()=>{},a=()=>{},o=()=>{i=Er(()=>{if(Tr(c.current.state))return p({refresh:!1})})};if(!e){let e=()=>{n&&p({refresh:!1})};return t?(t(`mobile_app_info`).then(t=>{if(!n)return;if(!t.mobile){e();return}d.current=!0,r(t),s([]),t.update&&f(t.update),p({refresh:!1}),o();let i=()=>{document.visibilityState===`visible`&&Tr(c.current.state)&&p({refresh:!1})};document.addEventListener(`visibilitychange`,i),a=()=>document.removeEventListener(`visibilitychange`,i)}).catch(e),()=>{n=!1,i(),a()}):(e(),()=>{n=!1})}return e.getAppInfo().then(t=>{n&&(r({...t,hostVersion:t.version}),e.componentUpdateStatus?.().then(e=>{n&&(s(e),f(Mr(e)))}).catch(()=>{}),t.packaged&&o())}).catch(()=>{}),()=>{n=!1,i()}},[f,e,p,t]);let m=(0,J.useCallback)(async()=>{if(u.current&&e?.downloadUpdate){f({...c.current,state:`downloading`,message:``,transferred:0,percent:0});let t=e.onUpdateStatus?.(f);try{let t=await e.downloadUpdate();f(t),t.state===`downloaded`&&t.canInstall&&await e.installUpdate?.()}finally{t?.()}return[]}if(!e?.installComponentUpdates)return[];f({...c.current,state:`downloading`,message:``,transferred:0,percent:0});let t=!1,n=!1,r=async()=>{if(!(n||t||!e.componentUpdateStatus)){t=!0;try{let t=await e.componentUpdateStatus();if(n)return;s(t);let r=Mr(t);r.state!==`available`&&f(r)}catch{}finally{t=!1}}},i=window.setInterval(()=>void r(),250);try{let t=await e.installComponentUpdates();return n=!0,s(t),f(Mr(t)),!t.some(e=>e.state===`error`)&&t.some(e=>e.restartRequired)&&await e.restartForComponentUpdate?.(),t}finally{n=!0,window.clearInterval(i)}},[f,e]),h=(0,J.useCallback)(async()=>{if(e)return e.openReleases();let r=i.releaseUrl||n.releasesUrl||`https://github.com/ling-kong-ran/pisper/releases`;return d.current&&t?t(`mobile_open_app_update`,{url:r}):(window.open(r,`_blank`,`noopener,noreferrer`),!0)},[e,n.releasesUrl,t,i.releaseUrl]),g=(0,J.useCallback)(()=>e?.openUpdateLog?.(),[e]),_=(0,J.useCallback)(()=>d.current&&t&&i.downloadUrl?t(`mobile_open_app_update`,{url:i.downloadUrl}):h(),[t,h,i.downloadUrl]),v=(0,J.useCallback)(()=>_(),[_]);return{info:(0,J.useMemo)(()=>({...n,version:n.desktop?Or(n.hostVersion||n.version,o):n.version}),[o,n]),status:i,components:o,check:p,installComponents:m,download:_,install:v,openReleases:h,openUpdateLog:g}}function Ir(e){return!!e.providers?.some(e=>e.configured&&e.models?.some(e=>e.kind===`chat`))}function Lr(e,t){return!t&&!Ir(e)}function Rr(){try{return JSON.parse(p.getItem(j.terminalPanel)||`{}`)}catch{return{}}}var zr=()=>i(()=>import(`./MobileNavigation-BIPy8A0i.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])),Br=(0,J.lazy)(()=>zr().then(e=>({default:e.MobileSettingsBack}))),Vr=(0,J.lazy)(()=>zr().then(e=>({default:e.MobileSettingsList}))),Hr=(0,J.lazy)(()=>i(()=>import(`./DesktopWindowControls-CKaPEgxw.js`).then(e=>({default:e.DesktopWindowControls})),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,24,15,25,26]))),Ur=(0,J.lazy)(()=>i(()=>import(`./FloatingWidgets-UItLK_UZ.js`).then(e=>({default:e.FloatingWidgets})),__vite__mapDeps([27,1,5,2,6,7,28,29,4,8,3,9,30,31,10,11,12,13,32,33,34,35,36,37]))),Wr=(0,J.lazy)(async()=>{let[{CommandPalette:e},{getNavigation:t}]=await Promise.all([i(()=>import(`./AppOverlays-BFLcGGx9.js`),__vite__mapDeps([38,1,2,3,4,5,6,7,8,9,30,39,40,11,12,13,10,15,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,26,56,57,58,59,60,61])),i(()=>import(`./palette-navigation-Bni8Mp34.js`),__vite__mapDeps([62,13,63,15,1,2,64,65,66,67,43,68,69,70,71,72,73,74]))]);function n(n){let{t:r}=A(),i=Te(e=>e.capabilities),a=(0,J.useMemo)(()=>t(r,i),[i,r]);return(0,X.jsx)(e,{...n,navigation:a})}return{default:n}}),Gr=(0,J.lazy)(()=>i(()=>import(`./AppDialog-CbXmk5vN.js`).then(e=>({default:e.AppDialog})),__vite__mapDeps([75,1,2,3,4,5,6,7,8,9,26,15,76,58,57,48,49,60,55,56,59,77]))),Kr=(0,J.lazy)(()=>i(()=>import(`./WebDesktopPet-DfAoMXEk.js`).then(e=>({default:e.WebDesktopPet})),__vite__mapDeps([78,1,6,5,2,7,3,4,8,9,11,12]))),qr=(0,J.lazy)(()=>i(()=>import(`./public-components-CjL2gwlJ.js`).then(e=>({default:e.ConfigSearchBox})),__vite__mapDeps([79,1,2,3,4,5,6,7,8,9,10,11,12,13,80,15,81,82,45,71,26,48,49,60,57,50,83,52,55,56,58,59,77,84]))),Jr=(0,J.lazy)(()=>i(()=>import(`./public-components-CjL2gwlJ.js`).then(e=>({default:e.ModelOnboardingDialog})),__vite__mapDeps([79,1,2,3,4,5,6,7,8,9,10,11,12,13,80,15,81,82,45,71,26,48,49,60,57,50,83,52,55,56,58,59,77,84]))),Yr=()=>Promise.all([i(()=>import(`./sidebar-DTHEZloM.js`),__vite__mapDeps([85,1,5,2,28,3,4,6,7,8,9,15,86,16,87,88,39,30,40,11,12,33,89,90,10,13,91,31,53,92,51,93,94,95,57,58,96,59,97,98,99,48,49,100,101,102,103,104,105,106,107,70,52,108,109,110,111,112,113])),D()]).then(([e])=>e),Xr=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarSessions}))),Zr=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarRailCounts}))),Qr=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarCommands}))),$r=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarBoardFilters}))),ei=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarFleetLine}))),ti=(0,J.lazy)(()=>Promise.all([i(()=>import(`./PhoneTopBar-6KsMmalq.js`),__vite__mapDeps([114,2,1,3,4,5,6,7,8,9,115,15,48,49,108,109,100,39,30,40,11,12,33,51,53,91,31,10,13,92,93,90,101,116,117,54,110,45,118])),D()]).then(([e])=>({default:e.PhoneTopBar}))),ni=(0,J.lazy)(()=>i(()=>import(`./PhoneDrawer-C08oZFjf.js`).then(e=>({default:e.PhoneDrawer})),__vite__mapDeps([119,2,1,3,4,5,6,7,8,9,67,15,45,72,118,48,49,120,26,56,57,58,59,60,108]))),ri=(0,J.lazy)(()=>i(()=>import(`./SidebarUpdateStatus-2eLpofE7.js`),__vite__mapDeps([121,2,1,3,4,5,6,7,8,9,81,15,122,22,123]))),ii=(0,J.lazy)(()=>i(()=>import(`./SettingsSidebar-K4O49gWb.js`).then(e=>({default:e.SettingsSidebar})),__vite__mapDeps([124,1,2,3,4,5,6,7,8,9,10,11,12,13,125,15,80,17,18,19,20,21,22,48,49,50,52,126]))),ai=(0,J.lazy)(async()=>{let[{DispatchOverlay:e}]=await Promise.all([i(()=>import(`./DispatchOverlay-CGLJLqZo.js`),__vite__mapDeps([127,2,1,3,4,5,6,7,8,9,128,30,39,40,11,12,10,13,15,80,129,86,89,90,91,31,33,53,92,51,93,130,131,132,133,95,16,134,135,45,57,58,56,59,136,97,98,48,49,55,26,60,137,96,120,54,138,77,139,140,141,94,99,52,101,142,143,144,14,145,146,147,148,111,149,102,20,61])),D()]);return{default:e}}),oi=(0,J.lazy)(async()=>{let[{ShortcutHelpDialog:e}]=await Promise.all([i(()=>import(`./ShortcutHelpDialog-LajY5QoG.js`),__vite__mapDeps([150,1,2,3,4,5,6,7,8,9,72,15,60,49,57,48,52,55,26,56,58,59,151,50])),D()]);return{default:e}}),si=(0,J.lazy)(()=>i(()=>import(`./PageHeader-SVPzWuI3.js`).then(e=>({default:e.PageHeader})),__vite__mapDeps([152,2,1,3,4,5,6,7,8,9,14,15,46,153,48,49,60,57,52]))),ci=(0,J.lazy)(()=>i(()=>import(`./TerminalPanel-Ddu_dEnz.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([154,1,2,3,4,5,6,7,8,9,15,24,44,46,26,60,49,57,48,155,156,25,157,158,36,159,95,86,160,134,58,161,96,59,97,98,162]))),li=(0,J.lazy)(()=>i(()=>import(`./MobileViewportStabilizer-OtwVmIPm.js`).then(e=>({default:e.MobileViewportStabilizer})),__vite__mapDeps([163,1,2])));function ui(e,t){return String(e||``).replace(/\{\{\s*([\w.]+)\s*\}\}/g,(e,n)=>{let r=n.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t);return r==null?`{{${n}}}`:String(r)})}function di(e){try{return decodeURIComponent(e)}catch{return``}}function fi(e,t){let n=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;return n?n(e,t):Promise.reject(Error(`native bridge unavailable`))}function pi({routerState:e}){let{t}=A();(0,J.useEffect)(()=>ve(`react-app-mounted`),[]);let n=o(),r=f(),s=(0,J.useCallback)(()=>e?.()??{location:n,navigation:{state:`idle`}},[n,e]),c=Te(e=>e.capabilities),l=Te(e=>e.loaded),u=Te(e=>e.load),d=(0,J.useMemo)(()=>Bt(t),[t]),m=C(n.pathname)||`board`,h=!!x(n.pathname),g=m===`config`?di(n.pathname.split(`/`)[2]||`models`):`models`,_=Fe.has(g)&&we(c,g)?g:`models`,v=je(m,_),b=(0,J.useRef)(m),[te,E]=(0,J.useState)(``),[ae,oe]=(0,J.useState)(()=>p.getItem(j.activeSession)||``),se=y(n.pathname,ae),ce=Oe(e=>e.client===`mobile-app`),D=Oe(e=>e.loaded),le=Ee(),O=ce||le,ue=De()&&ce,k=O&&!window.pisperDesktop&&!ue,de=Wn(m,v),_e=de===`board`?`board`:de===`more`?`features`:de===`settings`?`settings`:null,ye=B(e=>e.toggleCollapsed);(0,J.useEffect)(()=>{document.documentElement.toggleAttribute(`data-phone-shell`,k)},[k]),(0,J.useEffect)(()=>{B.getState().setDrawerOpen(!1)},[n.pathname,k]);let[be,M]=(0,J.useState)(!1),[ke,Ae]=(0,J.useState)(!1),[Ie,Le]=(0,J.useState)(!1),Re=G(e=>e.theme),ze=G(e=>e.cycleTheme),Be=G(e=>e.density),Ve=G(e=>e.accent),He=G(e=>e.customAccent),Ge=G(e=>e.fontScale),qe=G(e=>e.uiFontSize),Je=G(e=>e.codeFontSize),N=G(e=>e.radius),Ye=G(e=>e.motion),[Xe,P]=(0,J.useState)([]),[Ze,Qe]=(0,J.useState)(!1),F=Ze?void 0:Xe[0],$e=(0,J.useRef)(F);$e.current=F;let[et,tt]=(0,J.useState)(!1),[nt,rt]=(0,J.useState)(null),{data:it,isPending:I,isSuccess:at}=fe(ge(`config`)),{data:ot}=fe(ge(`notification-settings`)),[st,pt]=(0,J.useState)(!1),[L,mt]=(0,J.useState)({browser:{enabled:!1},connections:{},scopes:[],templates:[]}),[ht,R]=(0,J.useState)(null),z=(0,J.useMemo)(()=>({terminal:t(`terminal:terminalPanel.terminal`),resizeTerminal:t(`terminal:terminalPanel.resizeTerminal`),hideTerminal:t(`terminal:terminalPanel.hideTerminal`),showTerminal:t(`terminal:terminalPanel.showTerminal`),newTerminal:t(`terminal:terminalPanel.newTerminal`),closeTerminal:t(`terminal:terminalPanel.closeTerminal`),maximizeTerminal:t(`terminal:terminalPanel.maximizeTerminal`),openTerminal:t(`terminal:terminalPanel.openTerminal`),usesActiveSessionWorkspace:t(`terminal:terminalPanel.usesActiveSessionWorkspace`),orphanedTerminal:t(`terminal:terminalPanel.orphanedTerminal`),starting:t(`terminal:terminalPanel.starting`),processExited:e=>t(`terminal:terminalPanel.processExited`,{code:e??`-`})}),[t]),[vt,yt]=(0,J.useState)(()=>!!Rr().open),[bt,xt]=(0,J.useState)(()=>Math.max(180,Math.min(640,Number(Rr().height)||300)));(0,J.useEffect)(()=>{let e=()=>{window.pisperDesktop?.terminalProfiles&&Ce(c,`terminal`)&&yt(e=>!e)};return window.addEventListener(`pisper:toggle-terminal`,e),()=>window.removeEventListener(`pisper:toggle-terminal`,e)},[c]);let St=(0,J.useRef)(``),[V]=(0,J.useState)(Hn),Ct=(0,J.useRef)(null),wt=(0,J.useRef)(null),Tt=(0,J.useRef)(0),H=xr(),U=Fr();(0,J.useEffect)(()=>{lr({accent:Ve,density:Be,fontScale:Ge,motion:Ye,radius:N,customAccent:He,uiFontSize:qe,codeFontSize:Je})},[Ve,Be,Ge,Ye,N,He,qe,Je]),(0,J.useEffect)(()=>{p.setItem(j.terminalPanel,JSON.stringify({open:vt,height:bt}))},[bt,vt]),(0,J.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{let t=cr(Re,e.matches);document.documentElement.dataset.theme=t?`dark`:`light`,document.documentElement.classList.toggle(`dark`,t)};if(t(),Re===`system`)return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t);if(Re===`scheduled`){let e=window.setInterval(t,6e4);return()=>window.clearInterval(e)}},[Re]);let W=(0,J.useCallback)((e,t=`success`,n)=>{Tt.current+=1;let r={id:Tt.current,message:e,tone:t,action:n?.action};P(e=>[...e,r])},[]);(0,J.useEffect)(()=>{let e=e=>{let t=$e.current;if(e.key!==`Escape`||!e.isTrusted||!t||!document.querySelector(`[data-radix-popper-content-wrapper], [role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]`))return;e.stopImmediatePropagation(),e.preventDefault();let n=document.activeElement instanceof HTMLElement?document.activeElement:document.body;Qe(!0),P(e=>e.filter(e=>e.id!==t.id)),requestAnimationFrame(()=>requestAnimationFrame(()=>{n.dispatchEvent(new KeyboardEvent(`keydown`,{key:`Escape`,code:`Escape`,bubbles:!0,cancelable:!0})),Qe(!1)}))};return document.addEventListener(`keydown`,e,{capture:!0}),()=>document.removeEventListener(`keydown`,e,{capture:!0})},[]),(0,J.useEffect)(()=>{let e=e=>{let t=e.detail?.id;oe(t??p.getItem(j.activeSession)??``)};window.addEventListener(dt,e);let t=e=>{let t=e.detail;t?.message&&W(t.message,t.tone===`error`?`error`:`info`)};return window.addEventListener(Et,t),Oe.getState().load({refresh:!1}).then(()=>ve(`client-info-loaded`)),u({refresh:!1}).then(()=>ve(`capabilities-loaded`)),()=>{window.removeEventListener(dt,e),window.removeEventListener(Et,t)}},[u,W]);let At=(0,J.useRef)(!1);(0,J.useEffect)(()=>{!D||!ce||At.current||(At.current=!0,(async()=>{await fi(`mobile_ensure_local_network_permission`).catch(()=>void 0)})())},[D,ce]);let Mt=(0,J.useCallback)((e,t,{force:n=!1}={})=>{if(L.browser?.enabled&&!(!n&&document.visibilityState===`visible`&&document.hasFocus())){if(window.pisperDesktop?.showNotification){window.pisperDesktop.showNotification({title:e,body:t}).catch(()=>{});return}if(It()){jt(e,t).catch(()=>{});return}Rt({title:e,body:t,tag:`pisper-${e}`,url:window.location.href}).catch(()=>{})}},[L.browser?.enabled]),Nt=(0,J.useCallback)((e,t,n)=>{let r=L.templates?.find(t=>t.id===e),i=r?.channels?.browser?.content;!r?.enabled||r.channels?.browser?.enabled===!1||!i||Mt(r.name,ui(i,t||{}),n)},[L.templates,Mt]),Pt=(0,J.useCallback)(e=>V.register(e),[V]),Ft=(0,J.useCallback)(()=>{V.invoke()},[V]),Lt=(0,J.useCallback)(e=>(R(e),()=>R(t=>t===e?null:t)),[]),K=(0,J.useCallback)((e,t)=>{if(!(!w.has(e)||!Se(c,e))){if(e===`chat`){if(!h){let e=lt();r(e?.type===`create`?S():e?.type===`open`?S(e.sessionId):`/`,t)}}else r(ie(e),t);E(``)}},[c,r,h]),q=(0,J.useCallback)((e,t=``)=>{e&&(ft(e,`open`,t),h||r(S(e)),E(``))},[r,h]),Vt=(0,J.useRef)(null),Y=(0,J.useCallback)(e=>{if(Gn(s())!==n.pathname){Vt.current=e;return}(m===`board`||m===`session`)&>(e)||Ae(!0)},[n.pathname,m,s]);(0,J.useEffect)(()=>{let e=Vt.current;!e||Gn(s())!==n.pathname||(Vt.current=null,Y(e))},[n,s,Y]);let Ht=(0,J.useCallback)((e,{open:n})=>{Ae(!1),n?q(e):W(t(`board:launch.dispatched`))},[W,q,t]),Ut=(0,J.useCallback)(e=>W(e,`error`,{action:{label:t(`board:dispatch.reopen`),onAction:()=>Ae(!0)}}),[W,t]);(0,J.useEffect)(()=>{if(l&&!Se(c,m)){r(`/`,{replace:!0});return}m===`config`&&g!==_&&r(`/config/${_}`,{replace:!0})},[c,l,_,m,g,r]);let Z=(0,J.useCallback)((e,t)=>{let n=Fe.has(e)&&we(c,e)?e:`models`;r(n===`interface`&&t===`widgets`?T.components:`/config/${n}`),E(``)},[c,r]),Q=(0,J.useCallback)(e=>{if(e===`session`){let e=Kn(s());e&&r(e.to,{replace:e.replace,state:e.state}),E(``)}else e===`settings`?k?r(ee):Z(`models`):K(Un[e])},[K,k,s,r,Z]),Wt=(0,J.useCallback)(()=>x(Gn(s())),[s]),Gt=(0,J.useCallback)(e=>{if(!e)return;let t=s(),n=Gn(t);if(x(n)===e)return;if(E(``),C(n)!==`session`){r(S(e));return}let i=n===`/`?re:t.location.state;r(S(e),{replace:!0,state:i})},[s,r]),Kt=(0,J.useCallback)(e=>{Wt()===e&&r(`/`,{replace:!0})},[Wt,r]),qt=(0,J.useCallback)(()=>{try{p.setItem(j.modelOnboardingDismissed,`1`)}catch{}tt(!1)},[]),Jt=(0,J.useCallback)(()=>{qt(),V.clear(),V.invoke(),Z(`models`)},[qt,V,Z]),Yt=(0,J.useCallback)(()=>{qt(),r(`/config/models?import=1`),E(``)},[qt,r]),Xt=(0,J.useCallback)(()=>Z(`updates`),[Z]),Zt=(0,J.useCallback)(()=>Z(`notifications`),[Z]),Qt=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(!v){Qt.current=null;return}if(Qt.current!==null)return;let e=window.history.state?.idx;Qt.current=typeof e==`number`?e:0},[n.key,v]);let $t=(0,J.useCallback)(()=>{let e=Qt.current,t=window.history.state?.idx;r(e!==null&&e>0&&typeof t==`number`&&t>=e?-(t-e+1):`/`)},[r]),en=(0,J.useCallback)(async e=>e&&(await he(`sessions`)).sessions?.find(t=>t.id===e)?.cwd||``,[]),tn=(0,J.useCallback)(e=>{let t=p.getItem(j.activeSession)||``;rt({asset:e,targetSessionId:t}),t?q(t):r(S())},[q,r]);(0,J.useEffect)(()=>{let e=()=>{!H.dialog&&!et&&M(!0)},t=e=>{if(!(e.defaultPrevented||e.isComposing||e.keyCode===229)&&e.key===`Escape`&&!H.dialog){be&&(M(!1),e.preventDefault());return}};return window.addEventListener(`keydown`,t),window.addEventListener(ut,e),()=>{window.removeEventListener(`keydown`,t),window.removeEventListener(ut,e)}},[H.dialog,et,be]);let nn=(0,J.useRef)(!1);(0,J.useEffect)(()=>{if(I||nn.current||(nn.current=!0,pt(!0),!at||!it))return;ve(`config-loaded`);let e=!1;try{e=p.getItem(j.modelOnboardingDismissed)===`1`}catch{}b.current!==`config`&&Lr(it,e)&&tt(!0)},[it,I,at]),(0,J.useEffect)(()=>{st&&l&&(m===`board`||m===`session`)&&ve(`chat-shell-ready`)},[l,m,st]);let rn=(0,J.useRef)(m);(0,J.useLayoutEffect)(()=>{rn.current===`config`&&m!==`config`&&(me(`config`),me(`notification-settings`)),rn.current=m},[m]),(0,J.useEffect)(()=>{ot&&mt(ot)},[ot]),(0,J.useEffect)(()=>{let e=!0,t=async()=>{try{let t=St.current,n=await pe.fetchQuery({queryKey:[`browser-notification-events`,t],queryFn:()=>xe(`/api/settings/notifications/browser/events?after=${encodeURIComponent(t)}`),staleTime:0,retry:!1});if(!e)return;for(let e of n.events||[])Mt(e.title,e.body,{force:!0});St.current=n.latestId||St.current}catch{}};t();let n=window.setInterval(t,3e3);return()=>{e=!1,window.clearInterval(n)}},[Mt]);let an=m===`chat`?[t(`common:app.sessions`),O?``:t(`common:app.dragTabsOrSplitChatsInAnyDirectionFromTheSessionList`)]:m===`config`?[v&&Me(_)?Pe(t,_):Ne(t,_),``]:m===`workflowCreate`?zt(t,ht?ht.editing:di(n.pathname.split(`/`)[2]||`new`)!==`new`):d[m]||[t(`common:app.sessions`),``],on=(0,J.useCallback)(e=>{pe.cancelQueries({queryKey:[`notification-settings`],exact:!0}),pe.setQueryData([`notification-settings`],e),mt(e)},[]),sn=de===`more`&&m!==`more`,cn=(0,J.useCallback)(()=>r(T.more),[r]),ln={activeSessionId:se,navigate:K,notify:W,browserNotify:Nt,registerPrimaryAction:Pt,invokePrimaryAction:Ft,pendingAsset:nt,onAssetConsumed:()=>rt(null),onUseAsset:tn,requestText:H.prompt,requestConfirm:H.confirm,openNotificationSettings:Zt,configSection:_,setConfigSection:Z,setNotificationSettings:on,appUpdate:U,registerWorkflowActions:Lt,startNewTask:()=>Y(`board`),onBackToFeatures:sn?cn:void 0},un=(0,J.useCallback)(()=>{let e=window.history.state?.idx,t=Jn(m,n.pathname,v,{phone:k,homeEntry:ne(n.state),canGoBack:typeof e==`number`&&e>0});return t===-1?r(-1):t&&r(t),t!==null},[n.pathname,n.state,m,k,r,v]),dn=(0,J.useCallback)(()=>{if(m===`more`)document.getElementById(Ue)?.focus();else if(We.has(m))document.getElementById(Ke)?.focus();else if(m===`board`){let e=document.getElementById(_t);if(e)e.focus();else if(!k&&B.getState().collapsed){B.getState().setPeeking(!0);let e=0,t=()=>{let n=document.getElementById(_t);n?n.focus():(e+=1)<20&&requestAnimationFrame(t)};requestAnimationFrame(t)}}else Ct.current?.focus()},[m,k]),fn=k&&m!==`session`,pn=k&&v&&/^\/config\/?$/.test(n.pathname),mn=![`board`,`session`,`more`,`chat`,`workflowCreate`,`config`].includes(m)&&!We.has(m),hn=v&&!k;if(!st||!l)return(0,X.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`app-startup flex min-h-[100vh] w-full items-center justify-center gap-2.5 bg-chrome text-[13px] text-content-muted`,children:[(0,X.jsx)(kt,{size:30,className:`startup-logo`}),(0,X.jsx)(`strong`,{className:`font-medium`,children:t(`common:app.wakingPisper`)})]});let gn=e=>(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(qr,{query:te,onQueryChange:E,onSelect:Z,inputRef:Ct,placement:e})});return(0,X.jsx)(hr,{duration:2800,swipeDirection:`right`,children:(0,X.jsx)(Ot,{bridge:window.pisperDesktop,children:(0,X.jsxs)(`div`,{ref:wt,className:`app-shell flex w-full h-full min-h-0 flex-col overflow-hidden bg-chrome text-content [&[data-phone-shell]]:bg-panel [&[data-phone-shell][data-shell-canvas]]:bg-background [&[data-phone-shell][data-shell-chrome]]:bg-chrome pt-[var(--pisper-safe-area-top)] pr-[var(--pisper-safe-area-right)] pb-[var(--pisper-safe-area-bottom)] pl-[var(--pisper-safe-area-left)] [&[data-mobile-app]]:h-[100dvh] [&[data-mobile-app]]:min-h-0 [&[data-mobile-app]]:overflow-hidden [&[data-mobile-keyboard='open']]:pb-0 [&[data-phone-shell]]:pb-0`,"data-mobile-app":O||void 0,"data-phone-shell":k||void 0,"data-shell-canvas":m===`board`||m===`more`||void 0,"data-shell-chrome":m===`session`||void 0,"data-custom-titlebar":window.pisperDesktop?.customTitlebar||void 0,children:[window.pisperDesktop?.customTitlebar&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Hr,{})}),(0,X.jsx)(dr,{}),O&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(li,{enabled:D&&st,shellRef:wt})}),Ce(c,`desktopPet`)&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Kr,{})}),(0,X.jsx)(Vn,{onRouteBack:O?un:void 0}),(0,X.jsx)(fr,{blocked:!!(H.dialog||et||be||ke),onCommandPalette:()=>M(!0),onPrimary:()=>Y(`shortcut`),onSearch:dn,onToggleTerminal:window.pisperDesktop?.terminalProfiles&&Ce(c,`terminal`)?()=>yt(e=>!e):void 0,onSettings:()=>Q(`settings`),onOpenSession:()=>Q(`session`),onOpenBoard:()=>Q(`board`),onOpenComponents:()=>K(`components`),onOpenMore:()=>Q(`more`),onToggleSidebar:k?void 0:ye,onAgentPanel:()=>Dt({kind:`focus-list`}),onPreviousAgent:()=>Dt({kind:`adjacent`,direction:-1}),onNextAgent:()=>Dt({kind:`adjacent`,direction:1}),onJumpToAttention:()=>Dt({kind:`focus-attention`}),onSessionTree:m===`session`?()=>ct(`tree`):void 0,onSideChat:m===`session`?()=>ct(`side-chat`):void 0,onCycleFocusRegion:()=>void i(()=>import(`./focus-regions-B9MkPSKC.js`).then(e=>e.cycleFocusRegion()),[]),onShortcutHelp:()=>Le(!0)}),(0,X.jsxs)(`div`,{className:`app-body flex min-h-0 flex-1 overflow-hidden`,"data-mobile-app":O||void 0,children:[!k&&(0,X.jsx)(Qn,{active:_e,onNewTask:()=>Y(`sidebar`),onSearch:()=>M(!0),onOpenBoard:()=>Q(`board`),onOpenFeatures:()=>Q(`more`),onOpenSettings:()=>Q(`settings`),content:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(rr,{}),children:m===`board`?(0,X.jsx)($r,{notify:W,requestConfirm:H.confirm,requestText:H.prompt,onNewTask:()=>Y(`sidebar`),onOpenHistory:()=>K(`chatHistory`)}):(0,X.jsx)(Xr,{currentId:x(n.pathname),notify:W,requestText:H.prompt,onOpenSession:Gt,onOpenBoard:()=>Q(`board`),onOpenHistory:()=>K(`chatHistory`),onArchived:Kt})}),takeover:hn?(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(`nav`,{"aria-busy":`true`,"aria-label":t(`config:settingsShell.settingsNavigation`),className:`flex-1`}),children:(0,X.jsx)(ii,{configSection:_,onSelectSection:Z,onBack:$t,onOpenFeatures:()=>Q(`more`),search:gn(`sidebar`),version:U.info?.version,footer:(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(ei,{onOpenBoard:()=>Q(`board`)})})})}):void 0,railCounts:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(rr,{collapsed:!0}),children:(0,X.jsx)(Zr,{onOpenBoard:()=>Q(`board`)})}),update:U.status&&[`available`,`downloading`,`downloaded`].includes(U.status.state)?(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(`div`,{className:`flex-none [&>button]:size-8 [&>button]:min-h-0 pointer-coarse:[&>button]:size-11`,children:(0,X.jsx)(ri,{update:U,collapsed:!0,onOpen:Xt})})}):void 0}),(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Qr,{resolveCurrentId:Wt,renderedSessionId:m===`session`?x(n.pathname):null,onOpenSession:Gt,onWaiting:({title:e,reason:t})=>Nt(`chat.waiting`,{chat:{title:e,tool:t,reason:t}})})}),(0,X.jsxs)(`main`,{"data-focus-region":`main`,className:`main-surface relative flex min-w-0 flex-1 flex-col overflow-hidden bg-panel`,children:[fn&&(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(`div`,{className:`h-14 flex-none bg-panel`,"aria-hidden":`true`}),children:(0,X.jsx)(ti,{title:pn?t(`navigation:navigation.settings`):an[0],onNewTask:()=>Y(`topbar`),onSearch:m===`board`?()=>M(!0):void 0})}),k&&v&&!pn&&(0,X.jsxs)(J.Suspense,{fallback:null,children:[(0,X.jsx)(Br,{onBack:()=>r(`/config`)}),(0,X.jsx)(`div`,{"data-mobile-settings-search":!0,className:`flex-none px-4 pb-1`,children:gn()})]}),mn&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(si,{meta:an,page:m,desktopPlatform:window.pisperDesktop?.platform||``,terminalOpen:vt,onToggleTerminal:()=>yt(e=>!e),onBackToMore:sn?cn:void 0,phoneShell:k})}),(0,X.jsx)(`div`,{className:`page-content flex-1 min-h-0 overflow-auto ${m===`session`||m===`chat`?`page-chat flex overflow-hidden p-0`:w.has(m)?`page-${m} overflow-hidden p-0`:`page-${m} px-6 pt-5 pb-5 max-[650px]:px-3 max-[650px]:pt-0`}`,children:pn?(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Vr,{onNavigate:Z,onOpenFeatures:()=>Q(`more`)})}):(0,X.jsx)(a,{context:ln})},m),window.pisperDesktop?.terminalProfiles&&Ce(c,`terminal`)&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(ci,{open:vt,height:bt,labels:z,activeSessionId:se,resolveSessionCwd:en,onOpenChange:yt,onHeightChange:xt})})]})]}),k&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(ni,{active:_e,onSearch:()=>M(!0),onNewTask:()=>Y(`sidebar`),onOpenBoard:()=>Q(`board`),onOpenFeatures:()=>Q(`more`),onOpenSettings:()=>Q(`settings`),content:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(rr,{}),children:(0,X.jsx)(Xr,{drawer:!0,currentId:x(n.pathname),notify:W,requestText:H.prompt,onOpenSession:Gt,onOpenBoard:()=>Q(`board`),onOpenHistory:()=>K(`chatHistory`),onArchived:Kt})}),update:U.status&&[`available`,`downloading`,`downloaded`].includes(U.status.state)?(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(`div`,{className:`flex-none [&>button]:size-11 [&>button]:min-h-0`,children:(0,X.jsx)(ri,{update:U,collapsed:!0,onOpen:Xt})})}):void 0})}),(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Ur,{activeSessionId:se,notify:W})}),F&&(0,X.jsx)(br,{open:!0,message:F.message,tone:F.tone,action:F.action,duration:F.action?1e4:void 0,closeLabel:t(`common:ui.closeDialog`),onOpenChange:e=>!e&&P(e=>e.filter(e=>e.id!==F.id))},F.id),(0,X.jsx)(gr,{hotkey:[],label:t(`common:ui.notifications`)}),H.dialog&&(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(`span`,{role:`status`,className:`sr-only`,children:t(`common:pageTemplate.loading`)}),children:(0,X.jsx)(Gr,{dialog:H.dialog,onClose:H.close,onFinish:H.finish})}),(0,X.jsx)(J.Suspense,{fallback:null,children:et&&(0,X.jsx)(Jr,{open:!0,onDismiss:qt,onOpenImport:Yt,onOpenSettings:Jt})}),(0,X.jsxs)(J.Suspense,{fallback:null,children:[be&&(0,X.jsx)(Wr,{onClose:()=>M(!1),onNavigate:K,onOpenSession:async(e,n,r)=>{try{if(n&&!r){let{switchToTurnOnOtherBranch:r}=await i(async()=>{let{switchToTurnOnOtherBranch:e}=await import(`./session-tree-actions-AdyVzQwO.js`);return{switchToTurnOnOtherBranch:e}},__vite__mapDeps([164,51,6,5,1,2,7,8,53,39,30,40,11,4,12,165]));await r({sessionId:e,entryId:n,confirm:H.confirm,open:q,notify:W,t});return}q(e,n)}catch(e){throw W(t(`navigation:appOverlays.openLabeledTurnFailed`),`error`),e}},onNewChat:()=>Y(`palette`),onToggleTheme:ze}),Ie&&(0,X.jsx)(oi,{open:!0,onOpenChange:Le,onCustomize:()=>r(`/config/shortcuts`)})]}),(0,X.jsx)(J.Suspense,{fallback:null,children:ke&&(0,X.jsx)(ai,{open:!0,phone:k,onOpenChange:Ae,onDispatched:Ht,onDetachedFailure:Ut,onConfigureModels:()=>r(`/config/models`)})})]})})})}function mi({children:e}){let{t}=A(),n=f(),r=o(),i=(0,J.useRef)(new Map),a=(0,J.useRef)(new Map),s=(0,J.useRef)(0),[c,l]=(0,J.useState)(0),[d,p]=(0,J.useState)(null),m=(0,J.useRef)(null),[h,g]=(0,J.useState)(!1),_=u(({currentLocation:e,nextLocation:t})=>Pt(e,t)&&Object.values(K(i.current.values())).some(Boolean)),v=(0,J.useRef)(_);v.current=_;let y=(0,J.useCallback)(e=>{m.current=e,p(e)},[]),b=(0,J.useCallback)(e=>{let t=i.current.get(e.id);i.current.set(e.id,e),(!t||t.dirty!==e.dirty||t.saving!==e.saving)&&l(e=>e+1)},[]),x=(0,J.useCallback)(e=>{i.current.delete(e)&&l(e=>e+1)},[]),S=(0,J.useCallback)(()=>{y(null),a.current.clear(),v.current.state===`blocked`&&v.current.reset()},[y]),ee=(0,J.useCallback)((e,t,r)=>{a.current.clear();let i=`navigation-${++s.current}`;r&&a.current.set(i,r),n(e,{...t,state:{...t?.state,[Lt]:i}})},[n]),C=(0,J.useCallback)((e,t)=>{let n=i.current.get(e);if(n?.saving){S(),g(!0);return}if(v.current.state===`blocked`&&v.current.reset(),a.current.clear(),!n?.dirty){y(null),t();return}g(!1),y({kind:`close`,id:e,close:t})},[S,y]);(0,J.useLayoutEffect)(()=>{let e=K(i.current.values());if(_.state===`blocked`)e.saving||!e.dirty?(S(),g(e.saving)):(g(!1),y({kind:`route`}));else if(m.current?.kind===`close`){let e=i.current.get(m.current.id);(!e||e.saving||!e.dirty)&&(y(null),g(!!e?.saving))}},[_,c,S,y]),(0,J.useLayoutEffect)(()=>{let e=r.state?.[Lt],t=typeof e==`string`?a.current.get(e):void 0;t&&(a.current.delete(e),t())},[r]);let w=K(i.current.values());(0,J.useEffect)(()=>{if(!w.dirty&&!w.saving)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[w.dirty,w.saving]);let te=()=>{let e=m.current;if(!e)return;let t=e.kind===`close`?[i.current.get(e.id)].filter(e=>!!e):[...i.current.values()];if(t.some(e=>e.saving)){S(),g(!0);return}y(null);for(let e of t)e.dirty&&e.discard();e.kind===`close`?e.close():v.current.state===`blocked`&&v.current.proceed()},T=(0,J.useMemo)(()=>({update:b,remove:x,requestClose:C,navigate:ee}),[b,x,C,ee]);return(0,X.jsxs)(Mt.Provider,{value:T,children:[e,h&&(0,X.jsx)(`p`,{role:`status`,className:`fixed right-4 bottom-4 z-[300] rounded-lg border bg-popover p-3 text-sm text-popover-foreground shadow-md`,children:t(`common:unsaved.saving`)}),(0,X.jsx)(V,{open:!!d,onOpenChange:e=>{e||S()},children:(0,X.jsxs)(yt,{size:`compact`,surface:`confirmation`,showCloseButton:!1,className:`z-[400]`,overlayClassName:`z-[400]`,children:[(0,X.jsxs)(St,{children:[(0,X.jsx)(bt,{children:t(`common:unsaved.title`)}),(0,X.jsx)(vt,{children:t(`common:unsaved.description`)})]}),(0,X.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),te()},children:(0,X.jsxs)(xt,{children:[(0,X.jsx)(ot,{type:`button`,variant:`outline`,size:`dialogAction`,onClick:S,autoFocus:!0,children:t(`common:unsaved.keepEditing`)}),(0,X.jsx)(ot,{type:`submit`,variant:`destructive`,size:`dialogAction`,children:t(`common:unsaved.discard`)})]})})]})})]})}function hi(){let{t:e}=A();return(0,X.jsxs)(H,{children:[(0,X.jsx)(`span`,{className:`grid place-items-center`,children:(0,X.jsx)(at,{className:`size-6`})}),(0,X.jsx)(`h2`,{children:e(`navigation:pageLoader.lightingUpThisPage`)}),(0,X.jsx)(`p`,{children:e(`navigation:pageLoader.bringingTheNeededCapabilitiesIntoPlace`)})]})}async function gi(){window.__PISPER_MOBILE_APP__&&await be().catch(()=>void 0);let e=new URL(window.location.href);window.__PISPER_MOBILE_APP__&&e.protocol===`http:`&&e.hostname===`127.0.0.1`&&e.searchParams.set(`_pisper_recovery`,String(Date.now())),window.location.replace(e.href)}function _i(){let e=c(),t=s(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:`页面加载失败`;return(0,X.jsxs)(`main`,{className:`app-startup flex min-h-[100vh] w-full items-center justify-center gap-2.5 bg-chrome text-[13px] text-content-muted`,role:`alert`,children:[(0,X.jsx)(`strong`,{className:`font-medium`,children:t}),(0,X.jsx)(ot,{variant:`secondary`,type:`button`,onClick:()=>void gi(),children:`重新加载`})]})}function $(){return n()}async function vi(){let[{BoardPage:e}]=await Promise.all([i(()=>import(`./BoardPage-C3P69gtK.js`),__vite__mapDeps([166,1,5,2,3,4,6,7,8,9,30,29,31,10,11,12,13,32,33,34,36,35,37,15,167,80,129,86,16,168,87,88,28,39,40,89,90,91,53,92,51,93,94,95,57,58,96,59,97,98,99,48,49,100,101,102,103,104,105,107,44,169,118,170,26,171,172,149,173,161,60,50,52,108,117,54,157,148,143,144,14,145,135,146,147,132,133,134,45,56,136,55,137,120,138,77,139,140,141,174,112])),D()]);function t(e){let{origin:t,pathname:n,search:r,hash:i}=window.location;return i.startsWith(`#/`)?`${t}${n}${r}#${S(e)}`:`${t}${S(e)}`}function n(){let n=$(),r=f();return(0,X.jsx)(e,{activeSessionId:n.activeSessionId,onOpenSession:e=>r(S(e)),onOpenHistory:()=>n.navigate(`chatHistory`),onConfigureModels:()=>r(`/config/models`),sessionHref:t,notify:n.notify,requestConfirm:n.requestConfirm,requestText:n.requestText,onNewTask:n.startNewTask})}return{Component:n}}async function yi(){let[{ChatPage:e},{SessionShell:t}]=await Promise.all([i(()=>import(`./ChatPage-Bkv4vff9.js`),__vite__mapDeps([175,1,5,2,6,7,3,4,8,9,30,39,40,11,12,13,10,36,37,15,176,177,129,19,133,95,86,14,16,178,179,168,81,180,26,48,49,60,57,51,174,135,181,182,28,33,35,167,160,183,87,184,66,20,42,21,22,70,169,130,185,47,170,186,58,94,96,59,97,98,99,136,55,56,173,161,52,53,54,157,77,141,187,188,189,190,191,192,193,194,112,104,195,196,84,165,197,198,199,200,43,201,202,203,204,44,45,72,131,118,132,134,137,120,138,139,140,25,205,74,206,171,207,208,209,50,92,93,148,111,149,126,210,105,211,212,213,214,155,215,164,216,217])),i(()=>import(`./SessionShell-B-zDO3z-.js`),__vite__mapDeps([218,1,5,2,28,3,4,6,7,8,9,29,30,31,10,11,12,13,32,33,34,37,35,36,115,15,48,49,108,109,100,39,40,51,53,91,92,93,90,101,116,117,54,110,103])),D()]);function n(){return(0,X.jsx)(t,{context:$(),ChatPage:e})}return{Component:n}}async function bi(){yi().catch(()=>void 0);let[{SessionHome:e}]=await Promise.all([i(()=>import(`./SessionHome-B-lxCMjh.js`),__vite__mapDeps([219,1,5,2,28,3,4,6,7,8,9,35,36,37,11,12,128,30,39,40,10,13,15,80,129,86,89,90,91,31,33,53,92,51,93,130,131,132,133,95,16,134,135,45,57,58,56,59,136,97,98,48,49,55,26,60,137,96,120,54,138,77,139,140,141,94,99,52,101,142,143,144,14,145,146,147,148,111,149,102,115,108,109,100,116,117,110,43,157,103])),D()]);function t(){return(0,X.jsx)(e,{context:$()})}return{Component:t}}async function xi(){let{MorePage:e}=await i(async()=>{let{MorePage:e}=await import(`./MorePage-CFfeYmW_.js`);return{MorePage:e}},__vite__mapDeps([220,1,2,3,4,5,6,7,8,9,30,11,12,13,10,29,31,32,33,34,37,35,36,15,221,63,19,64,65,16,222,223,68,44,69,70,45,71,73,74,26,171,153,48,49,60,57,50,51,83,52]));function t(){let t=$(),n=f();return(0,X.jsx)(e,{onOpen:e=>{e.type===`page`?n(ie(e.id)):e.type===`config`?t.setConfigSection(e.id):n(`/tools/components/${encodeURIComponent(e.id)}`)}})}return{Component:t}}async function Si(){let{ChatHistoryPage:e}=await i(async()=>{let{ChatHistoryPage:e}=await import(`./ChatHistoryPage-CZX27BNu.js`);return{ChatHistoryPage:e}},__vite__mapDeps([224,1,6,5,2,7,3,4,8,9,30,39,40,11,12,35,36,37,15,177,87,203,107,22,118,170,171,153,94,95,16,57,58,96,59,97,98,99,48,49,60,51,52,92,54,157,148,225,86,14,45,205,26,50,112,212]));function t(){let t=$();return(0,X.jsx)(e,{navigate:t.navigate,onBack:t.onBackToFeatures,onNewTask:t.startNewTask,notify:t.notify,requestConfirm:t.requestConfirm,requestText:t.requestText})}return{Component:t}}async function Ci(){let{AssetsPage:e}=await i(async()=>{let{AssetsPage:e}=await import(`./AssetsPage-BoB8pJxi.js`);return{AssetsPage:e}},__vite__mapDeps([226,1,2,4,5,6,7,8,3,9,30,227,11,12,15,81,122,181,200,202,44,22,170,205,26,153,94,95,16,57,58,96,59,97,98,99,48,49,60,52,54,157,55,56,77,225,35,36,37,86,14,45,50,228,229,76,230,189,190,191,192,193,183,194]));function t(){let t=$();return(0,X.jsx)(e,{activeSessionId:t.activeSessionId,onBack:t.onBackToFeatures,notify:t.notify,requestConfirm:t.requestConfirm,onUse:t.onUseAsset})}return{Component:t}}async function wi(){let[{ChannelsPage:e}]=await Promise.all([i(()=>import(`./ChannelsPage-yPVopq7h.js`),__vite__mapDeps([231,1,2,3,4,5,6,7,8,9,11,12,15,19,122,66,232,43,44,22,185,170,205,26,171,153,48,49,60,57,52,54,157,77,138,139,225,35,36,37,86,14,45,50,229,76,58,230,112,211,209,98,198,96,99,212,196,158,159,95,160,134,161,59,97])),oe()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestConfirm:t.requestConfirm})}return{Component:t}}async function Ti(){let{SchedulesPage:e}=await i(async()=>{let{SchedulesPage:e}=await import(`./SchedulesPage-G1R7ua11.js`);return{SchedulesPage:e}},__vite__mapDeps([233,1,2,3,4,5,6,7,8,9,11,12,18,15,19,65,178,66,232,204,44,170,205,153,209,57,58,98,48,49,60,52,54,157,55,26,56,59,77,139,210,95,187,225,35,36,37,86,14,45,50,229,76,230,112,105,211,198,96,99,212,196,158,159,160,134,161,97]));function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestConfirm:t.requestConfirm,openNotificationSettings:t.openNotificationSettings})}return{Component:t}}async function Ei(){let[{ConfigPage:e},{ChatAppearancePage:t}]=await Promise.all([i(()=>import(`./ConfigPage-D1MJyBus.js`),__vite__mapDeps([234,1,5,2,6,7,4,8,3,9,11,12,13,10,37,15,176,125,80,235,18,19,64,95,86,14,41,178,145,183,81,87,122,146,222,17,20,21,22,42,43,223,236,44,123,169,45,71,185,73,46,170,205,206,26,171,57,58,96,186,98,99,94,16,59,97,48,49,136,55,56,60,159,160,134,161,230,137,209,50,83,52,54,157,77,139,140,61,225,35,36,229,76,189,190,191,192,193,194,112,212,211,198,196,158,213,84,237,151,238])),i(()=>import(`./ChatAppearancePage-DPulJWKJ.js`),__vite__mapDeps([239,5,1,2,28,3,4,6,7,8,9])),D(),E()]);function n(){let n=$();return(0,X.jsx)(e,{notify:n.notify,registerPrimaryAction:n.registerPrimaryAction,invokePrimaryAction:n.invokePrimaryAction,section:n.configSection,onBackToFeatures:n.onBackToFeatures,onBrowserNotificationChange:n.setNotificationSettings,requestConfirm:n.requestConfirm,update:n.appUpdate,renderInterfaceSettings:e=>(0,X.jsx)(t,{appearance:e})})}return{Component:n}}async function Di(){let{PluginsPage:e}=await i(async()=>{let{PluginsPage:e}=await import(`./PluginsPage-jhrfFTbZ.js`);return{PluginsPage:e}},__vite__mapDeps([240,1,2,3,4,5,6,7,8,9,11,12,13,10,15,178,241,122,184,242,66,222,243,68,244,45,71,130,170,205,153,57,58,56,59,48,49,60,52,157,55,26,77,225,35,36,37,86,14,50,105,211,209,98,198,96,99,212,196,158,159,95,160,134,161,97,215]));function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}async function Oi(){let{MemoryPage:e}=await i(async()=>{let{MemoryPage:e}=await import(`./MemoryPage-ObL1zsXe.js`);return{MemoryPage:e}},__vite__mapDeps([245,1,2,3,4,5,6,7,8,9,11,12,15,95,242,20,203,44,22,73,170,26,153,173,57,58,161,59,97,98,48,49,60,52,157,77,139,225,35,36,37,86,14,45,205,50,229,76,230,211,209,198,96,99,212,196,158,159,160,134]));function t(){let t=$();return(0,X.jsx)(e,{onBack:t.onBackToFeatures,notify:t.notify,requestConfirm:t.requestConfirm})}return{Component:t}}async function ki(){let[{McpPage:e}]=await Promise.all([i(()=>import(`./McpPage-DC_9gmSC.js`),__vite__mapDeps([246,1,2,3,4,5,6,7,8,9,30,40,227,11,12,95,15,183,82,44,22,70,71,170,206,26,153,209,57,58,98,48,49,60,52,54,157,55,56,59,139,187,225,35,36,37,86,14,45,205,50])),ce()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}async function Ai(){let{SkillsPage:e}=await i(async()=>{let{SkillsPage:e}=await import(`./SkillsPage-Z_czQryK.js`);return{SkillsPage:e}},__vite__mapDeps([247,1,2,3,4,5,6,7,8,9,11,12,242,15,222,243,44,244,73,170,206,153,207,95,57,58,98,48,49,60,52,157,225,35,36,37,86,14,45,205,26,50,211,209,198,96,99,212,196]));function t(){let t=$();return(0,X.jsx)(e,{activeSessionId:t.activeSessionId,notify:t.notify,onBack:t.onBackToFeatures,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}var ji=Object.freeze({componentFromList:!0});function Mi(e){return typeof e==`object`&&!!e&&e.componentFromList===!0}async function Ni(){let[{CustomUiPage:e}]=await Promise.all([i(()=>import(`./public-Dp3V7Oez.js`),__vite__mapDeps([248,1,5,2,28,3,4,6,7,8,9,30,31,32,11,12,33,29,10,13,34,35,36,37,15,221,235,63,95,86,14,16,145,183,81,87,201,44,70,45,249,130,73,170,26,207,57,58,98,48,49,94,96,59,97,99,76,159,160,134,161,209,172,149,60,50,52,120,56,108,117,91,39,40,53,92,51,93,100,90,101,54,116,109,110,157,142,55,77,139,61,212,250,208,230,173,112,251,252])),E()]);function t(){let t=$(),n=f(),i=o(),{componentId:a=``}=r();return(0,X.jsx)(e,{activeSessionId:t.activeSessionId,notify:t.notify,selectedId:a,onSelect:(e,t)=>{!e&&!t&&Mi(i.state)?n(-1):n(te(e),{replace:t||!e,state:e&&!t?ji:void 0})}})}return{Component:t}}async function Pi(){let[{CustomUiToolPage:e}]=await Promise.all([i(()=>import(`./public-Dp3V7Oez.js`),__vite__mapDeps([248,1,5,2,28,3,4,6,7,8,9,30,31,32,11,12,33,29,10,13,34,35,36,37,15,221,235,63,95,86,14,16,145,183,81,87,201,44,70,45,249,130,73,170,26,207,57,58,98,48,49,94,96,59,97,99,76,159,160,134,161,209,172,149,60,50,52,120,56,108,117,91,39,40,53,92,51,93,100,90,101,54,116,109,110,157,142,55,77,139,61,212,250,208,230,173,112,251,252])),E()]);function t(){let t=$(),{componentId:n=``}=r();return(0,X.jsx)(e,{componentId:n,activeSessionId:t.activeSessionId,notify:t.notify})}return{Component:t}}async function Fi(){let[{WorkflowsPage:e}]=await Promise.all([i(()=>import(`./WorkflowsPage-D_wAL0Md.js`),__vite__mapDeps([253,1,5,2,28,4,6,7,8,3,9,30,11,12,35,36,37,15,167,129,18,19,133,95,86,14,16,178,179,145,183,81,87,242,181,199,254,222,42,232,236,201,202,203,204,44,22,123,244,45,71,249,25,170,205,74,26,153,186,57,58,94,96,59,97,98,99,48,49,76,136,55,56,60,208,137,134,209,198,52,120,54,157,77,139,187,225,50,229,230,112,158,159,160,161,238,252,255,256,257])),le()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestConfirm:t.requestConfirm})}return{Component:t}}async function Ii(){let[{WorkflowBuilder:e}]=await Promise.all([i(()=>import(`./WorkflowsPage-D_wAL0Md.js`),__vite__mapDeps([253,1,5,2,28,4,6,7,8,3,9,30,11,12,35,36,37,15,167,129,18,19,133,95,86,14,16,178,179,145,183,81,87,242,181,199,254,222,42,232,236,201,202,203,204,44,22,123,244,45,71,249,25,170,205,74,26,153,186,57,58,94,96,59,97,98,99,48,49,76,136,55,56,60,208,137,134,209,198,52,120,54,157,77,139,187,225,50,229,230,112,158,159,160,161,238,252,255,256,257])),le()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,registerWorkflowActions:t.registerWorkflowActions})}return{Component:t}}var Li=t([{element:(0,X.jsx)(mi,{children:(0,X.jsx)(pi,{routerState:()=>Li.state})}),errorElement:(0,X.jsx)(_i,{}),hydrateFallbackElement:(0,X.jsx)(hi,{}),children:[{index:!0,lazy:bi},{path:T.board,lazy:vi},{path:`/board/:sessionId`,lazy:yi},{path:T.more,lazy:xi},{path:T.chat,element:(0,X.jsx)(l,{to:`/`,replace:!0})},{path:T.chatHistory,lazy:Si},{path:T.assets,lazy:Ci},{path:T.channels,lazy:wi},{path:T.schedules,lazy:Ti},{path:T.config,lazy:Ei},{path:`/config/:configSection`,lazy:Ei},{path:`/config`,element:(0,X.jsx)(l,{to:T.config,replace:!0})},{path:T.plugins,lazy:Di},{path:T.memory,lazy:Oi},{path:T.mcp,lazy:ki},{path:T.skills,lazy:Ai},{path:`/components/:componentId?`,lazy:Ni},{path:`/tools/components/:componentId`,lazy:Pi},{path:T.workflows,lazy:Fi},{path:T.workflowCreate,lazy:Ii},{path:`/workflows/:workflowId`,lazy:Ii},{path:`*`,element:(0,X.jsx)(l,{to:`/`,replace:!0})}]}]),Ri=()=>{document.documentElement.dataset.pageVisibility=document.visibilityState};Ri(),document.addEventListener(`visibilitychange`,Ri);var zi=b(window.location.hash);zi&&window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}#${zi}`);var Bi=document.getElementById(`root`);if(!Bi)throw Error(`Missing #root application mount point`);(0,In.createRoot)(Bi).render((0,X.jsx)(J.StrictMode,{children:(0,X.jsx)(zn,{children:(0,X.jsx)(d,{router:Li})})}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,o as n}from"./useQuery-Bg3cTjsY.js";var r=class extends e{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||i(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=n({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let i=this.state.status===`pending`,a=!this.#r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let n=await this.#r.start();return await this.#n.config.onSuccess?.(n,e,this.state.context,this,r),await this.options.onSuccess?.(n,e,this.state.context,r),await this.#n.config.onSettled?.(n,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(n,null,e,this.state.context,r),this.#i({type:`success`,data:n}),n}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let n=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=n(this.state),t.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function i(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}export{i as n,r as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hosts-DsWmhXz4.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-router-CSN_DGvx.js","assets/vendor-react-DwNgTV1j.js","assets/index-C3xrFlMb.js","assets/index-CfTBR7Rs.css","assets/routes-Da0OHSy6.js","assets/use-i18n-BIJtH0nB.js","assets/i18n-BjpQE1sJ.js","assets/storage-BY6wEHPw.js","assets/vendor-state-GkUciC5H.js","assets/useQuery-Bg3cTjsY.js","assets/session-scope-SQQU-bRA.js","assets/api-DxQIocGp.js","assets/abort-signal-f4JsiYKX.js","assets/session-board-status-D2lpFPiI.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/ellipsis-CfGKfbq6.js","assets/grip-vertical-B__LYT0s.js","assets/plus-fQbSqB1n.js","assets/rotate-ccw-C0v8V77_.js","assets/settings-2-CXJjXJS9.js","assets/x-07u4-129.js","assets/dropdown-menu-CFIFNaKO.js","assets/check-2vYc6QaP.js","assets/chevron-right-C3t2Rckj.js","assets/dist-41X0pdUs.js","assets/dist-BsRXXcSL.js","assets/dist-DzGQ7sLi.js","assets/es2015-DTZdOI9P.js","assets/dist-BRjj4UeB.js","assets/dist-OB2r6Xsr.js","assets/dist-BaBySQmo.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/popover-BqqbRCrL.js","assets/dialog-Bs9_FZX7.js","assets/dist-BHkR6BLP.js","assets/button-CCcCN8tE.js","assets/use-studio-actions-e1FiDWGR.js","assets/checkbox-BrEHgFV0.js","assets/progress-5odAz3B9.js","assets/separator-BPh_qxvc.js","assets/switch-D_G8wFhs.js","assets/segmented-control-BlM_GKV6.js","assets/touch-target-BsyCgjR5.js","assets/tooltip-D4MFbqcG.js","assets/dist-BiRPwy4W.js","assets/kbd-CAufZTkl.js","assets/useSessionListQuery-jM0IQ1En.js","assets/startup-queries-_OUFiG02.js","assets/mutation-Difliohy.js","assets/component-changes-Q9Bf64Ob.js","assets/runtime-capabilities-store-BvWnn9Kx.js","assets/runtime-capabilities-BhAMiYhG.js","assets/chat-api-CjiINBKJ.js","assets/session-organization-api-Dt_FNL0d.js","assets/events-DWUUCmbP.js","assets/session-questions-Cf-1g85h.js","assets/useFleetSystemInfo-kKFDmOS4.js","assets/useNow-CpKRH_uQ.js","assets/useBoardItems-CzLK6g45.js","assets/card-presentation-1oph2b8P.js","assets/format-DMJQzoZ7.js","assets/public-DjZxpaMo.js","assets/useSidebarModel-CBd3rSxV.js","assets/new-task-C3wuHTor.js","assets/board-launch-B2PD2yr-.js","assets/input-CPw-zkYh.js","assets/textarea-DmATpOqT.js","assets/StatusGlyph-1KgitlUg.js","assets/badge-CWB3lj2H.js","assets/safe-mode-instance-UY-RZ5fF.js","assets/safe-mode-sentinel-DnReXgjI.js","assets/SafeModePrompt-v1_UpOAA.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t}from"./vendor-router-CSN_DGvx.js";import{i as n}from"./vendor-react-DwNgTV1j.js";import{a as r}from"./i18n-BjpQE1sJ.js";import{t as i}from"./use-i18n-BIJtH0nB.js";import{r as a,t as o}from"./useQuery-Bg3cTjsY.js";import{n as s}from"./component-changes-Q9Bf64Ob.js";import{t as c}from"./runtime-capabilities-store-BvWnn9Kx.js";import{_ as l,j as u,k as d,n as f,r as p,t as m}from"./session-scope-SQQU-bRA.js";import"./safe-mode-sentinel-DnReXgjI.js";var h=e(n(),1);function g(e){return e.id===`*`?[u.all]:e.reason===`instances`?[u.instances()]:[u.catalog(),u.describe(e.id),u.errors(e.id),u.versions(e.id),u.trash(),u.instances()]}function _(e){let t=0,n=null,r=null;return{retain(i){r=i,t+=1,n??=e(e=>{for(let t of g(e))Promise.resolve(r?.invalidateQueries({queryKey:t})).catch(()=>void 0)});let a=!1;return()=>{a||(a=!0,--t,!(t>0)&&(n?.(),n=null,r=null))}},users:()=>t}}var v=_(s);function y(e){let t=a();(0,h.useEffect)(()=>e?v.retain(t):void 0,[t,e])}function b(){return c(e=>e.capabilities.features[`components.native`])}function x(){let e=b();return y(e),o(f(e))}function S(e){return y(e),o(p(e))}function C(){return S(b())}function w(e){let t=b(),n=S(t),r=(0,h.useMemo)(()=>(n.data?.instances??[]).filter(t=>t.surface===e&&t.enabled),[n.data,e]),i=o(f(t&&r.length>0));return{available:t,placed:(0,h.useMemo)(()=>{if(!i.data)return[];let e=new Map(i.data.components.map(e=>[e.id,e])),t=[];for(let n of r){let r=e.get(n.componentId);r?.kind===`native`&&r.status===`ready`&&r.enabled&&t.push({instance:n,component:r})}return t},[r,i.data]),revision:n.data?.revision??null,isLoading:t&&(n.isPending||r.length>0&&i.isPending),error:n.error??i.error??null,refetch:()=>{n.refetch(),r.length&&i.refetch()}}}function T(e,t,n){return e.filter(({instance:e})=>m(e.scope,t)).map(({instance:e,component:t})=>({id:e.instanceId,label:e.title||t.manifest?.i18n[n]?.name||t.name}))}function E(){let e=S(b());return(0,h.useMemo)(()=>(e.data?.instances??[]).filter(e=>e.enabled).length,[e.data])}function D(){let{language:e}=i(),t=w(`feature-page`),n=(0,h.useMemo)(()=>t.placed.map(({instance:t,component:n})=>({instanceId:t.instanceId,componentId:n.id,name:n.manifest?.i18n[e]?.name||n.name,description:n.manifest?.i18n[e]?.description||n.description,icon:n.manifest?.icon||``})),[e,t.placed]);return{...t,items:n}}var O=()=>Promise.all([t(()=>import(`./hosts-DsWmhXz4.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,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73])),r()]).then(([e])=>e),k=(0,h.lazy)(()=>O().then(e=>({default:e.ComponentHost}))),A=(0,h.lazy)(()=>O().then(e=>({default:e.FloatingComponents}))),j=(0,h.lazy)(()=>Promise.all([t(()=>import(`./SafeModePrompt-v1_UpOAA.js`),__vite__mapDeps([74,1,3,7,8,2,4,5,9,10,38,34,26,33,36,22,16,37,27,29,72,73])),r()]).then(([e])=>({default:e.SafeModePrompt})));function M(){let e=a();return async()=>{let t=(await l()).components.filter(e=>e.kind===`native`&&e.enabled),n=await Promise.allSettled(t.map(e=>d(e.id,!1)));return e.invalidateQueries({queryKey:u.all}),n.every(e=>e.status===`fulfilled`)}}var N=(0,h.lazy)(()=>O().then(e=>({default:e.OverviewComponents}))),P=(0,h.lazy)(()=>O().then(e=>({default:e.SessionPanelComponent}))),F=(0,h.lazy)(()=>O().then(e=>({default:e.SessionComponentAddMenu})));export{F as a,x as c,b as d,M as f,j as i,C as l,D as m,A as n,P as o,E as p,N as r,T as s,k as t,w as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./useSessionListQuery-jM0IQ1En.js";import"./useNow-CpKRH_uQ.js";import"./useFleetSystemInfo-kKFDmOS4.js";import"./useSidebarModel-CBd3rSxV.js";import"./new-task-C3wuHTor.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./GitDiffViewer-dtiUySxH.js";export{e as InlineGitDiff};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./QuickPromptIdeas-CX8dS2LC.js";import"./FocusRuntimeControls-DyexiBAA.js";import{t as e}from"./chat-api-CjiINBKJ.js";import"./session-change-summary-api-CI_mYqV8.js";var t=t=>e.getWorkspaceCommands(t);export{t};
|