pisper 0.6.9 → 0.6.10
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/lib/npm-platform.mjs +0 -1
- package/lib/platform.mjs +2 -1
- package/package.json +6 -7
- package/web/.vite/manifest.json +943 -844
- package/web/assets/{AppDialog-DJZWnxzH.js → AppDialog-1E6olv_T.js} +1 -1
- package/web/assets/{AppOverlays-DICzFYsW.js → AppOverlays-BV_gIt77.js} +1 -1
- package/web/assets/AppSelect-BGVBQRP1.js +1 -0
- package/web/assets/AssetsPage-6HTR2IpQ.js +1 -0
- package/web/assets/{BoardPage-DKjz8Sj_.js → BoardPage-CL2e-8j4.js} +3 -3
- package/web/assets/BrandLogo-k3CvJjd4.js +1 -0
- package/web/assets/ChannelsPage-CmczBcSA.js +1 -0
- package/web/assets/{ChatAppearancePage-6Mq1uFuU.js → ChatAppearancePage-DMAnYGNb.js} +1 -1
- package/web/assets/{ChatHistoryPage-j-_vMM-M.js → ChatHistoryPage-DedOh6aO.js} +1 -1
- package/web/assets/ChatPage-b16p3qWl.js +553 -0
- package/web/assets/ConfigPage-BYB0rL_V.js +5 -0
- package/web/assets/{DesktopWindowControls-BOrn8KGA.js → DesktopWindowControls-DAuHMZFO.js} +1 -1
- package/web/assets/DispatchOverlay-CEbzXIct.js +1 -0
- package/web/assets/{FeaturePage-1MUXz3Y-.js → FeaturePage-BJGDVZ_u.js} +1 -1
- package/web/assets/{FileAttachmentPreview-B17OgdVi.js → FileAttachmentPreview-Cw5-ApIr.js} +1 -1
- package/web/assets/{FloatingWidgets-CcPNUEFB.js → FloatingWidgets-BQXBxVDd.js} +1 -1
- package/web/assets/FocusRuntimeControls-C7b1I2L5.js +1 -0
- package/web/assets/{GitDiffViewer-CSl-SGa1.js → GitDiffViewer-BAZTiiDo.js} +1 -1
- package/web/assets/{HoldToConfirmButton-CVyju89W.js → HoldToConfirmButton-BxdJ7icc.js} +1 -1
- package/web/assets/LaunchConsole-uKHKx4h0.js +2 -0
- package/web/assets/{ManageProjectsDialog-DSN8QUPg.js → ManageProjectsDialog-03d7p6Td.js} +1 -1
- package/web/assets/{MarkdownMessage-BPZcFjyR.js → MarkdownMessage-B_9d8KI-.js} +1 -1
- package/web/assets/McpPage-7NEAc3Rv.js +1 -0
- package/web/assets/MemoryPage-_mnn45jY.js +1 -0
- package/web/assets/{MobileNavigation-Cc4zcU3a.js → MobileNavigation-IXJN0OuM.js} +1 -1
- package/web/assets/{MorePage-B-qsYMAv.js → MorePage-DtqJlHAA.js} +1 -1
- package/web/assets/{PageHeader-mUKoAR30.js → PageHeader-6KRCT1j1.js} +1 -1
- package/web/assets/{PageState-aWHrkE1D.js → PageState-Cz6vFMXv.js} +1 -1
- package/web/assets/{PhoneDrawer-qES4OwMx.js → PhoneDrawer-Cp6X4_ei.js} +1 -1
- package/web/assets/{PhoneMenuButton-DEbqHUUP.js → PhoneMenuButton-Cl7FEYYw.js} +1 -1
- package/web/assets/{PhoneTopBar-CLPmKZ4Q.js → PhoneTopBar-CR1m9vf3.js} +1 -1
- package/web/assets/{PluginsPage-B53DParo.js → PluginsPage-CNddCaYt.js} +1 -1
- package/web/assets/{QuickPromptIdeas-gKobqAO3.js → QuickPromptIdeas-C7X4T7kx.js} +1 -1
- package/web/assets/{SafeModePrompt-Dlq8rlix.js → SafeModePrompt-jSCZVMGa.js} +1 -1
- package/web/assets/SchedulesPage-BRqBCtCf.js +1 -0
- package/web/assets/SessionBrowserPane-maCbfzXl.js +2 -0
- package/web/assets/SessionContextPanel-BSY6NaRx.js +2 -0
- package/web/assets/{SessionHome-CVdMY-bT.js → SessionHome-Wu8JWsto.js} +1 -1
- package/web/assets/SessionInspector-BRIFfuiZ.js +1 -0
- package/web/assets/{SessionShell-Vv2oGR0M.js → SessionShell-Dp94FUuk.js} +1 -1
- package/web/assets/{SettingsSidebar-cG_oKSWN.js → SettingsSidebar-CP1qDAcx.js} +1 -1
- package/web/assets/{ShortcutHelpDialog-C5KKKBZd.js → ShortcutHelpDialog-C5f_x4XG.js} +1 -1
- package/web/assets/{ShortcutKeys-zuzmq8eW.js → ShortcutKeys-Cx8hNJ62.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-BXimwZ77.js → SidebarUpdateStatus-YxE_hT2l.js} +1 -1
- package/web/assets/{SkillsPage-AhmayxVl.js → SkillsPage-z6rTYJ8Z.js} +1 -1
- package/web/assets/TaskProcessesPane-yhEsHe1N.js +1 -0
- package/web/assets/TaskTerminalView-CT6V8AGR.js +18 -0
- package/web/assets/{TerminalPanel-wvzi7jBd.js → TerminalPanel-598uzwoB.js} +1 -1
- package/web/assets/{WebDesktopPet-qREBG08n.js → WebDesktopPet-D6bkGOwL.js} +1 -1
- package/web/assets/WorkflowsPage-DrltlXh1.js +1 -0
- package/web/assets/{WorkspacePicker-B68VTV5x.js → WorkspacePicker-DPwlN6KA.js} +1 -1
- package/web/assets/{api-DVgYxLec.js → api-45iTnFjN.js} +1 -1
- package/web/assets/{app-primitives-Cmdj4cIW.js → app-primitives-Drz_SjnR.js} +1 -1
- package/web/assets/{app-update-BEymQxyl.js → app-update-kStNhVOh.js} +1 -1
- package/web/assets/{approval-confirm-JevCpyyv.js → approval-confirm-CCo7v8Ln.js} +1 -1
- package/web/assets/{badge-Dk1N1mVf.js → badge-CWB3lj2H.js} +1 -1
- package/web/assets/{board-launch-CUV0KEKT.js → board-launch-YigjCnZf.js} +1 -1
- package/web/assets/board-messages-xFeTO3o6.js +1 -0
- package/web/assets/{board-projects-VBEGB9VD.js → board-projects-LnEYyP4h.js} +1 -1
- package/web/assets/{button-Bu_vuij9.js → button-CCcCN8tE.js} +1 -1
- package/web/assets/{chat-api-CQ9MShHZ.js → chat-api-BBuYjxwz.js} +1 -1
- package/web/assets/checkbox-BrEHgFV0.js +1 -0
- package/web/assets/client-store-CAhvptv1.js +1 -0
- package/web/assets/{collapsible-C__hRcbA.js → collapsible-DMaUQRX4.js} +1 -1
- package/web/assets/{config-search-ClE5BFDz.js → config-search-C1YtwJAQ.js} +1 -1
- package/web/assets/{dialog-Kx6RCn3A.js → dialog-2cmY5V75.js} +1 -1
- package/web/assets/{dist-Cfh4kzCK.js → dist-41X0pdUs.js} +1 -1
- package/web/assets/{dist-BdkTa5R3.js → dist-BHkR6BLP.js} +1 -1
- package/web/assets/dist-BRjj4UeB.js +1 -0
- package/web/assets/dist-BaBySQmo.js +1 -0
- package/web/assets/{dist-BlIIpW6W.js → dist-BiRPwy4W.js} +1 -1
- package/web/assets/{dist-B_a0oV4U.js → dist-BsRXXcSL.js} +1 -1
- package/web/assets/dist-DzGQ7sLi.js +1 -0
- package/web/assets/{dist-TksYpDID.js → dist-OB2r6Xsr.js} +1 -1
- package/web/assets/dist-V8chnW6-.js +1 -0
- package/web/assets/dropdown-menu-CFIFNaKO.js +1 -0
- package/web/assets/es2015-DTZdOI9P.js +41 -0
- package/web/assets/{events-ulSEiNKt.js → events-n27XPFgs.js} +1 -1
- package/web/assets/{field-Bnm9KAi2.js → field-DaxtcBBA.js} +1 -1
- package/web/assets/{hosts-B-POTAmu.js → hosts-CmK7Yt82.js} +1 -1
- package/web/assets/i18n-DfsxGeh5.js +1 -0
- package/web/assets/{index-C4CqzQNY.js → index-BDgCJ4Fs.js} +2 -2
- package/web/assets/index-CfTBR7Rs.css +2 -0
- package/web/assets/input-CPw-zkYh.js +1 -0
- package/web/assets/input-group-CDEyjyK4.js +1 -0
- package/web/assets/{label-BzlNatZM.js → label-CVWjEcfV.js} +1 -1
- package/web/assets/{launch-defaults-store-7CojCPDE.js → launch-defaults-store-CGeglXDI.js} +1 -1
- package/web/assets/model-display-kDwvtxrW.js +1 -0
- package/web/assets/mount-app-Bxa7xF8d.js +9 -0
- package/web/assets/{permission-rules-api-BQlSNrYK.js → permission-rules-api-BvKOF7rS.js} +1 -1
- package/web/assets/{pick-system-directory-BgN7vwKS.js → pick-system-directory-DSupTk88.js} +1 -1
- package/web/assets/placements--Zk5njsN.js +2 -0
- package/web/assets/{popover-DT3PkPcL.js → popover-BtcdIPRz.js} +1 -1
- package/web/assets/{progress-YhljaYNy.js → progress-5odAz3B9.js} +1 -1
- package/web/assets/public--8F2_oqP.js +1 -0
- package/web/assets/public-CgydVZuV.js +2 -0
- package/web/assets/public-components-CeIuV0FY.js +1 -0
- package/web/assets/public-diff-DWbitsnS.js +1 -0
- package/web/assets/public-launch-DtVwSANs.js +1 -0
- package/web/assets/run-activity-CwfO0cui.js +1 -0
- package/web/assets/{runtime-capabilities-store--7mKyYAM.js → runtime-capabilities-store-D1FwQXKw.js} +1 -1
- package/web/assets/{safe-mode-instance-fnZLVjjd.js → safe-mode-instance-TonxlRrq.js} +1 -1
- package/web/assets/safe-mode-sentinel-BG78O0yJ.js +1 -0
- package/web/assets/segmented-control-BlM_GKV6.js +1 -0
- package/web/assets/select-DD_WO-gs.js +1 -0
- package/web/assets/{separator-cVAjxx3U.js → separator-BPh_qxvc.js} +1 -1
- package/web/assets/{session-change-summary-api-3216hpjE.js → session-change-summary-api-B9M9m1C0.js} +1 -1
- package/web/assets/{session-home-CM2_V5SZ.js → session-home-BDT4lMMJ.js} +1 -1
- package/web/assets/{session-organization-api-KZqrJZdA.js → session-organization-api-BgCoIi2X.js} +1 -1
- package/web/assets/{session-scope-Bw40iOXx.js → session-scope-t_l7TRH5.js} +1 -1
- package/web/assets/{session-tree-actions-oMnZOFG4.js → session-tree-actions-7q68B3e-.js} +1 -1
- package/web/assets/{session-tree-summary-PpU7AyqE.js → session-tree-summary-CMgz9Uf-.js} +1 -1
- package/web/assets/{sheet-CASx5kBt.js → sheet-BTaIEX4w.js} +1 -1
- package/web/assets/{shortcuts-BOeaPAvF.js → shortcuts-BGzXmClx.js} +1 -1
- package/web/assets/{side-chat-context-BcCF9VZz.js → side-chat-context-D36twdWd.js} +7 -7
- package/web/assets/{sidebar-4xAUV3YP.js → sidebar-BIagLnrN.js} +2 -2
- package/web/assets/{sidebar-store-we4gMwQq.js → sidebar-store-DztdHlUn.js} +1 -1
- package/web/assets/slider-DTmAZl-R.js +1 -0
- package/web/assets/{speech-session-ClA_5hmd.js → speech-session-D0GE-Pym.js} +1 -1
- package/web/assets/{startup-queries--JqGB_Cp.js → startup-queries-BAWDaQY5.js} +1 -1
- package/web/assets/{switch-DRkmP9uM.js → switch-D_G8wFhs.js} +1 -1
- package/web/assets/tabs-DsgBuvJv.js +1 -0
- package/web/assets/{tooltip-EomUbN9-.js → tooltip-D4MFbqcG.js} +1 -1
- package/web/assets/{use-i18n-D2P6OO3w.js → use-i18n-CVZdp2ZN.js} +1 -1
- package/web/assets/use-mobile-DauOEda6.js +1 -0
- package/web/assets/{use-studio-actions-CIA2TwfZ.js → use-studio-actions-C4Zh15Vx.js} +2 -2
- package/web/assets/{useBoardItems-BU9aonpg.js → useBoardItems-DCo-4he0.js} +1 -1
- package/web/assets/{useFleetSystemInfo-BMpdQSqr.js → useFleetSystemInfo-BbQQId7X.js} +1 -1
- package/web/assets/{useNow-DAVNVxdo.js → useNow-CxO2FUQY.js} +1 -1
- package/web/assets/usePhoneShell-m3H_98m_.js +1 -0
- package/web/assets/{useSessionListQuery-DqZ3m8O9.js → useSessionListQuery-CJ-BYuqu.js} +1 -1
- package/web/assets/{useSessionRowActions-DTxXBruc.js → useSessionRowActions-D0GKtBhg.js} +1 -1
- package/web/assets/{useSidebarModel-DtY4PopW.js → useSidebarModel-b5cdTj9-.js} +1 -1
- package/web/assets/{web-preview-tGGVFpDI.js → web-preview-Bdrxyj-l.js} +1 -1
- package/web/assets/{web-preview-events-Bl80SpFF.js → web-preview-events-BBbAgfr4.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/AppSelect-fH3gqflO.js +0 -1
- package/web/assets/AssetsPage-BhrkErwt.js +0 -1
- package/web/assets/BrandLogo-C6O8cv-b.js +0 -1
- package/web/assets/ChannelsPage-C6A-ClM6.js +0 -1
- package/web/assets/ChatPage-B1V00hUs.js +0 -553
- package/web/assets/ComposerCommandMenu-BnwvT15Y.js +0 -1
- package/web/assets/ConfigPage-DwVhvmWL.js +0 -3
- package/web/assets/DispatchOverlay-ByJYJO36.js +0 -1
- package/web/assets/LaunchConsole-DRnR4Irg.js +0 -2
- package/web/assets/McpPage-DeuJ0HzI.js +0 -1
- package/web/assets/MemoryPage-CxFJYVZs.js +0 -1
- package/web/assets/SchedulesPage-BUDQGrHe.js +0 -1
- package/web/assets/SessionBrowserPane-Bq_U_5i9.js +0 -2
- package/web/assets/SessionContextPanel-V4QZj7xu.js +0 -2
- package/web/assets/SessionInspector-C14ilfNC.js +0 -1
- package/web/assets/TaskProcessesPane-hcChPVpA.js +0 -1
- package/web/assets/TaskTerminalView-DcFp0oHH.js +0 -18
- package/web/assets/WorkflowsPage-Dg9Mh9ND.js +0 -1
- package/web/assets/board-messages-CcVs4aSw.js +0 -1
- package/web/assets/checkbox-CG2AnYPm.js +0 -1
- package/web/assets/client-store-B-3_7075.js +0 -1
- package/web/assets/dist-DAs5KRGl.js +0 -1
- package/web/assets/dist-alOyD2Bh.js +0 -1
- package/web/assets/dropdown-menu-gZkWDhaR.js +0 -1
- package/web/assets/es2015-0QT3KgdC.js +0 -41
- package/web/assets/i18n-DPvJ0T4T.js +0 -1
- package/web/assets/index-DbL8igcD.css +0 -2
- package/web/assets/input-DIwJDpj9.js +0 -1
- package/web/assets/mount-app-CxpqEKPV.js +0 -9
- package/web/assets/placements-5xDVBdPk.js +0 -2
- package/web/assets/public-CyIfRdzo.js +0 -1
- package/web/assets/public-DwUlE0fE.js +0 -2
- package/web/assets/public-components-Cv7X4fW8.js +0 -1
- package/web/assets/public-diff-1bDiNGBB.js +0 -1
- package/web/assets/public-launch-D8n5o2kS.js +0 -1
- package/web/assets/safe-mode-sentinel-DEJ0ZBB_.js +0 -1
- package/web/assets/segmented-control-BOJt5SLj.js +0 -1
- package/web/assets/select-JC5m2BRQ.js +0 -1
- package/web/assets/tabs-C4VeYYS2.js +0 -1
- package/web/assets/usePhoneShell-w7JLYU3H.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CVZdp2ZN.js";import{t as i}from"./useQuery-Bg3cTjsY.js";import{i as a}from"./runtime-capabilities-BhAMiYhG.js";import{t as o}from"./runtime-capabilities-store-D1FwQXKw.js";import{t as s}from"./createLucideIcon-Cd-3GVxJ.js";import{i as c}from"./permission-rules-api-BvKOF7rS.js";import{t as l}from"./check-2vYc6QaP.js";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./SessionBrowserPane-maCbfzXl.js";import{t as v}from"./earth-Ddy13fHh.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{o as b}from"./GitDiffViewer-BAZTiiDo.js";import{A as ee,M as te,P as x,c as ne,h as S,p as C,s as re}from"./side-chat-context-D36twdWd.js";import{t as w}from"./git-branch-N7LGjtzt.js";import{t as ie}from"./message-square-SKjZyY3v.js";import{t as ae}from"./plus-fQbSqB1n.js";import{t as T}from"./refresh-cw-TbWxTY4K.js";import{t as oe}from"./square-terminal-BVG6cUT1.js";import{t as se}from"./x-07u4-129.js";import{c as ce,i as E,p as le,r as D,t as O}from"./dropdown-menu-CFIFNaKO.js";import{i as ue,n as de,t as fe}from"./popover-BtcdIPRz.js";import{t as pe}from"./segmented-control-BlM_GKV6.js";import{t as k}from"./utils-C8uzG5AZ.js";import{t as A}from"./button-CCcCN8tE.js";import{t as me}from"./chat-api-BBuYjxwz.js";import{a as j,r as M}from"./format-DMJQzoZ7.js";import{n as he,t as N}from"./PageState-Cz6vFMXv.js";import{t as ge}from"./session-change-summary-api-B9M9m1C0.js";import{i as P,n as F,r as I}from"./MarkdownMessage-B_9d8KI-.js";import{t as _e}from"./route-context-DvWDul4T.js";import{t as ve}from"./StatusGlyph-1KgitlUg.js";import"./web-preview-Bdrxyj-l.js";import{n as ye}from"./terminal-context-aIsIJPn8.js";var be=s(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),xe=s(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),L=e(t(),1),R=n(),z={running:{kind:`run`,color:`text-st-run`},starting:{kind:`run`,color:`text-st-run`},queued:{kind:`queued`,color:`text-st-queue`},completed:{kind:`done`,color:`text-st-done`},failed:{kind:`failed`,color:`text-st-fail`},interrupted:{kind:`stopped`,color:`text-st-queue`},blocked:{kind:`queued`,color:`text-st-queue`}};function Se(e,t){return t(e===`queued`?`chat:agentRunActivity.teamTaskQueued`:e===`starting`?`chat:agentRunActivity.teamTaskStarting`:e===`running`?`chat:agentRunActivity.teamTaskRunning`:e===`completed`?`chat:agentRunActivity.teamTaskCompleted`:e===`failed`?`chat:agentRunActivity.teamTaskFailed`:e===`interrupted`?`chat:agentRunActivity.teamTaskInterrupted`:e===`blocked`?`chat:agentRunActivity.teamTaskBlocked`:`chat:agentRunActivity.teamTaskStatusUpdated`)}function B(e,t){return e.status===`active`?e.mode===`team`?t(`chat:focusSession.runningAsTeam`):t(`chat:focusSession.runningAutonomously`):e.status===`paused`?t(`chat:focusSession.goalPaused`):e.status===`complete`?t(`chat:focusSession.goalComplete`):e.status===`budget_limited`?t(`chat:focusSession.goalReachedItsBudget`):``}function V({title:e,children:t}){return(0,R.jsxs)(`section`,{className:`grid min-w-0 gap-2`,"aria-label":e,children:[(0,R.jsx)(`h3`,{className:`text-xs font-semibold text-content-secondary`,children:e}),t]})}function H({status:e,name:t,detail:n,t:r}){let i=z[String(e)]??{kind:`queued`,color:`text-st-queue`};return(0,R.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 py-1.5 text-xs`,children:[(0,R.jsx)(ve,{status:i.kind,className:`mt-px size-3.5 ${i.color}`}),(0,R.jsxs)(`span`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`strong`,{className:`min-w-0 truncate font-medium text-content`,children:t}),(0,R.jsx)(`span`,{className:`flex-none text-content-muted`,children:Se(e,r)})]}),n&&(0,R.jsx)(`span`,{className:`min-w-0 break-words text-content-muted`,children:n})]})]})}function Ce(e){let t=new Map;for(let n of e){if(n?.type!==`agent`||!n.agent||typeof n.agent!=`object`)continue;let e=n.agent,r=String(e.id||e.taskName||t.size);t.set(r,e)}return[...t.values()]}function we({plan:e,goal:t,team:n,activity:i}){let{t:a}=r(),o=Array.isArray(n?.tasks)?n.tasks:[],s=Ce(i),c=!!(t?.id&&String(t.objective||``).trim()),l=!!e?.items?.length;if(!c&&!l&&!o.length&&!s.length)return(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:(0,R.jsx)(N,{compact:!0,icon:te,title:a(`chat:sessionContext.planEmpty`)})});let u=Number(t?.mode===`team`?t?.teamTokenBudget:t?.tokenBudget)||0;return(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 content-start gap-5 overflow-y-auto p-3`,"data-inspector-plan":!0,children:[c&&t&&(0,R.jsx)(V,{title:a(`board:inspector.goal`),children:(0,R.jsxs)(`div`,{className:`grid gap-1.5 rounded-md border border-stroke-soft bg-surface-subtle p-3 text-xs`,children:[(0,R.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-content`,children:String(t.objective)}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 text-content-muted tabular-nums`,children:[(0,R.jsx)(`span`,{children:B(t,a)}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,R.jsx)(`span`,{children:u>0?a(`chat:focusSession.usedBudgetTokensUsed`,{used:M(t.tokensUsed),budget:M(u)}):a(`chat:focusSession.usedUnlimitedGoalTokens`,{used:M(t.tokensUsed)})})]})]})}),l&&(0,R.jsx)(V,{title:a(`board:inspector.plan`),children:(0,R.jsx)(p,{plan:e})}),o.length>0&&(0,R.jsx)(V,{title:a(`board:inspector.team`),children:(0,R.jsx)(`ul`,{className:`divide-y divide-stroke-soft`,children:o.map((e,t)=>(0,R.jsx)(H,{status:e.status,name:e.taskName||a(`chat:agentRunActivity.subagent`),detail:e.error||e.output||``,t:a},e.id||`${e.taskName}-${t}`))})}),s.length>0&&(0,R.jsx)(V,{title:a(`board:inspector.subAgents`),children:(0,R.jsx)(`ul`,{className:`divide-y divide-stroke-soft`,children:s.map((e,t)=>(0,R.jsx)(H,{status:e.status,name:String(e.taskName||``).trim()||a(`chat:agentRunActivity.subagent`),detail:String(e.error||e.message||``).trim(),t:a},String(e.id||t)))})})]})}var U=100;function W(e){let t=e.trim().toUpperCase();return t===`??`||t.includes(`A`)?`created`:t.includes(`D`)?`deleted`:t.includes(`R`)?`renamed`:t.includes(`M`)?`modified`:`other`}var Te={modified:`M`,created:`A`,deleted:`D`,renamed:`R`,other:`·`},Ee={modified:`text-content-secondary`,created:`text-st-done`,deleted:`text-st-fail`,renamed:`text-content-secondary`,other:`text-content-muted`};function G(e){let t=e.replace(/\\/g,`/`),n=t.lastIndexOf(`/`);return n<0?{directory:``,name:t}:{directory:t.slice(0,n+1),name:t.slice(n+1)}}function K(e,t){return/^(?:[a-zA-Z]:[\\/]|\/|\\\\)/.test(t)?t:`${e.replace(/[\\/]+$/,``)}/${t}`}function De(e,t){window.dispatchEvent(new CustomEvent(_e,{detail:{message:e,tone:t}}))}function q({added:e,removed:t}){return e===null||t===null?null:(0,R.jsxs)(`span`,{className:`flex-none font-mono text-xs tabular-nums`,children:[(0,R.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}),` `,(0,R.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]})]})}function J({status:e,children:t}){let{t:n}=r();return(0,R.jsxs)(`footer`,{className:`mt-auto flex h-10 shrink-0 items-center gap-2 border-t border-stroke-soft pr-1.5 pl-3 text-xs text-content-muted`,"data-changes-footer":!0,children:[(0,R.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 truncate`,children:e}),(0,R.jsxs)(O,{children:[(0,R.jsx)(le,{asChild:!0,children:(0,R.jsx)(A,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`pointer-coarse:size-11`,"aria-label":n(`board:changes.more`),title:n(`board:changes.more`),"data-changes-more":!0,children:(0,R.jsx)(y,{"aria-hidden":`true`})})}),(0,R.jsx)(D,{align:`end`,side:`top`,className:`min-w-48`,children:t})]})]})}function Y({status:e}){let{t}=r(),n=t(e===`created`?`board:changes.statusCreated`:e===`deleted`?`board:changes.statusDeleted`:e===`renamed`?`board:changes.statusRenamed`:`board:changes.statusModified`);return(0,R.jsxs)(`span`,{className:k(`w-3.5 flex-none text-center font-mono text-xs font-semibold`,Ee[e]),title:n,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,children:Te[e]}),(0,R.jsx)(`span`,{className:`sr-only`,children:n})]})}function X({files:e,selected:t,label:n,onSelect:r}){let i=(0,L.useRef)(null);return(0,R.jsxs)(`ul`,{ref:i,"aria-label":n,className:`max-h-[34%] min-h-11 shrink-0 overflow-y-auto border-b border-stroke-soft py-1`,onKeyDown:e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=[...i.current?.querySelectorAll(`[data-change-file]`)??[]],n=t.findIndex(e=>e===document.activeElement),a=t[e.key===`Home`?0:e.key===`End`?t.length-1:Math.min(t.length-1,Math.max(0,n+(e.key===`ArrowDown`?1:-1)))];a&&(e.preventDefault(),a.focus(),r(a.dataset.changeFile||``))},"data-change-list":!0,children:[e.slice(0,U).map(e=>{let n=e.path===t,{directory:i,name:a}=G(e.path);return(0,R.jsx)(`li`,{className:`px-1`,children:(0,R.jsxs)(`button`,{type:`button`,title:e.path,"aria-label":[e.path,Te[e.status],e.added!==null&&e.removed!==null?`+${e.added} −${e.removed}`:``,e.note||``].filter(Boolean).join(` `),"aria-current":n?`true`:void 0,"data-change-file":e.path,className:k(`flex h-8 w-full min-w-0 items-center gap-2 rounded-sm px-2 text-left text-xs transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus max-[650px]:h-11 pointer-coarse:h-11`,n?`bg-solid shadow-[inset_0_0_0_1px_var(--stroke-strong)]`:`hover:bg-surface-hover`),onClick:()=>r(e.path),children:[(0,R.jsx)(Y,{status:e.status}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 font-mono`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate text-content-muted`,children:i}),(0,R.jsx)(`span`,{className:`flex-none text-content`,children:a})]}),e.note&&(0,R.jsx)(`span`,{className:`flex-none text-content-muted`,children:e.note}),(0,R.jsx)(q,{added:e.added,removed:e.removed})]})},e.path)}),e.length>U&&(0,R.jsx)(`li`,{className:`px-3 py-1.5 text-xs text-content-muted tabular-nums`,children:(0,R.jsx)(Oe,{count:e.length-U})})]})}function Oe({count:e}){let{t}=r();return(0,R.jsx)(R.Fragment,{children:t(`chat:focusSession.gitMoreFiles`,{count:e})})}var Z=600;function ke({sessionId:e,file:t,scope:n,revision:i,view:a,onViewChange:o,footer:s}){let{t:l}=r(),u=c(e=>e.diffMode),f=c(e=>e.setDiffMode),p=(0,L.useRef)(null),[m,h]=(0,L.useState)(0);(0,L.useLayoutEffect)(()=>{let e=p.current;if(!e)return;let t=()=>h(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let g=m===0||m>=Z,_=g?u:`unified`,v=g?void 0:l(`board:changes.splitTooNarrow`);return(0,R.jsxs)(`section`,{ref:p,className:`flex min-h-0 flex-1 flex-col`,"aria-label":t.path,"data-change-detail":t.path,children:[(0,R.jsxs)(`header`,{className:`flex min-h-10 shrink-0 items-center gap-2 border-b border-stroke-soft py-1.5 pr-2 pl-3`,children:[(0,R.jsx)(Y,{status:t.status}),(0,R.jsx)(`strong`,{className:`min-w-0 flex-1 truncate font-mono text-xs font-semibold text-content`,title:t.path,children:t.path}),(0,R.jsx)(q,{added:t.added,removed:t.removed}),(0,R.jsx)(pe,{size:`sm`,"aria-label":l(`board:changes.diffView`),title:v,"aria-description":v,value:_,onValueChange:f,options:[{value:`unified`,label:l(`board:changes.unified`)},{value:`split`,label:l(`board:changes.split`),disabled:!g}]})]}),(0,R.jsx)(d,{sessionId:e,path:t.path,scope:n,revision:i,mode:_,fill:!0,position:a?.reading?.[t.path],onReading:e=>o?.({reading:{...a?.reading,[t.path]:e}})},`${n}:${t.path}`),(0,R.jsx)(`footer`,{className:`flex min-h-10 shrink-0 flex-wrap items-center gap-1 border-t border-stroke-soft py-1 pr-1.5 pl-3 text-xs`,children:s})]})}function Ae({cwd:e,path:t}){let{t:n}=r();if(!window.pisperDesktop||!e)return null;let i=K(e,t);return(0,R.jsxs)(A,{type:`button`,variant:`ghost`,size:`sm`,className:`max-[650px]:h-11`,onClick:async()=>{try{await I(i,P),De(n(`common:markdownMessage.revealLocalPathOk`,{path:t}),`info`)}catch(e){De(e instanceof F&&e.reason===`unavailable`?n(`common:markdownMessage.revealLocalPathUnavailable`):e instanceof F&&e.reason===`timeout`?n(`common:markdownMessage.revealLocalPathTimeout`):n(`common:markdownMessage.revealLocalPathFailed`,{path:t}),`error`)}},children:[(0,R.jsx)(be,{"aria-hidden":`true`}),n(`chat:chatMessage.fileActionReveal`)]})}function Q(e){return{path:e.path,status:e.status===`created`?`created`:e.status===`deleted`?`deleted`:`modified`,added:e.added,removed:e.removed}}function $(e,t){if(!e)return;let n=[];return e.lineEnding&&n.push(t(`chat:focusSession.fileChangesLineEnding`,{from:e.lineEnding[0].toUpperCase(),to:e.lineEnding[1].toUpperCase()})),e.bom?.[1]?n.push(t(`chat:focusSession.fileChangesBomAdded`)):e.bom&&n.push(t(`chat:focusSession.fileChangesBomRemoved`)),t(`chat:focusSession.fileChangesFormatOnly`,{detail:n.join(` · `)})}function je({sessionId:e,cwd:t,streaming:n,view:i,onViewChange:a,requestConfirm:o}){let{t:s,language:c}=r(),{changes:u,loading:d,running:f,snapshotRevision:p,writesDisabled:m,pendingCount:g,reversibleCount:_,displayedError:v,notice:y,runAction:b,refresh:te}=h({sessionId:e,streaming:n,requestConfirm:o}),x=u?.files??[],ne=i?.expandedFiles?.[0],S=x.find(e=>e.path===ne)??x[0],C=e=>a?.({expandedFiles:[e]}),re=(e,t)=>f?.kind===e&&f.path===t,w=n?s(`chat:focusSession.gitWaitForRunToFinish`):void 0;return(0,R.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":s(`chat:focusSession.fileChanges`),"aria-busy":d||!!f,"data-changes-scope":`session`,children:[(0,R.jsx)(`header`,{className:`flex min-h-10 shrink-0 items-center gap-1.5 border-b border-stroke-soft py-1 pr-1.5 pl-3`,children:(0,R.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-content-secondary`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:s(`board:changes.sessionSummary`,{count:u?.summary.files??0})}),u&&u.summary.files>0&&(0,R.jsx)(q,{added:u.summary.added,removed:u.summary.removed})]})}),v&&(0,R.jsx)(`p`,{role:`alert`,className:`shrink-0 px-3 pt-2 text-xs text-st-fail`,children:v}),y&&!v&&(0,R.jsx)(`p`,{role:`status`,className:`shrink-0 px-3 pt-2 text-xs text-content-secondary`,children:y}),d&&!u?(0,R.jsx)(he,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):x.length?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(X,{files:x.map(e=>({...Q(e),note:e.reverted?s(`chat:focusSession.fileChangesReverted`):e.approved?s(`chat:focusSession.fileChangesApproved`):$(e.formatChange,s)})),selected:S?.path??``,label:s(`board:changes.files`),onSelect:C}),S&&(0,R.jsx)(ke,{sessionId:e,file:Q(S),scope:`task`,revision:p,view:i,onViewChange:a,footer:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:k(`mr-auto flex min-w-0 items-center gap-1.5 truncate`,S.approved?`text-st-done`:`text-content-muted`),"data-change-state":S.reverted?`reverted`:S.approved?`approved`:`pending`,children:[S.approved&&!S.reverted&&(0,R.jsx)(l,{className:`size-3.5 flex-none`,"aria-hidden":`true`}),S.reverted?s(`board:changes.revertedAt`,{time:j(S.changedAt,c)}):S.approved?s(`board:changes.approvedAt`,{time:j(S.changedAt,c)}):s(`board:changes.pendingAt`,{time:j(S.changedAt,c)})]}),S.pending&&!S.approved&&!S.reverted&&(0,R.jsxs)(A,{type:`button`,variant:`ghost`,size:`sm`,disabled:m,title:w,onClick:()=>void b({kind:`approve`,path:S.path}),children:[re(`approve`,S.path)?(0,R.jsx)(T,{className:`animate-spin`}):(0,R.jsx)(l,{}),s(`chat:focusSession.fileChangesApproveFile`)]}),(0,R.jsxs)(A,{type:`button`,variant:`ghost`,size:`sm`,disabled:m||S.reverted||!S.canRevert,title:w,onClick:()=>void b({kind:`revert`,path:S.path}),children:[re(`revert`,S.path)?(0,R.jsx)(T,{className:`animate-spin`}):(0,R.jsx)(ee,{}),s(`board:changes.revertFile`)]}),(0,R.jsx)(Ae,{cwd:t,path:S.path})]})})]}):!v&&(0,R.jsx)(N,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}),(0,R.jsxs)(J,{status:f?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(T,{className:`size-3.5 flex-none animate-spin`,"aria-hidden":`true`}),f.kind===`approve`?s(`chat:focusSession.fileChangesApproveAll`):s(`board:changes.revertAll`)]}):g>0?s(`board:changes.pending`,{count:g}):null,children:[g>0&&(0,R.jsxs)(E,{disabled:m,title:w,onSelect:()=>void b({kind:`approve`}),children:[(0,R.jsx)(l,{}),s(`chat:focusSession.fileChangesApproveAll`)]}),(u?.summary.files??0)>0&&(0,R.jsxs)(E,{disabled:m||_===0,title:w??s(`chat:focusSession.fileChangesRevertAllDescription`),onSelect:()=>void b({kind:`revert`}),children:[(0,R.jsx)(ee,{}),s(`board:changes.revertAll`)]}),(g>0||(u?.summary.files??0)>0)&&(0,R.jsx)(ce,{}),(0,R.jsxs)(E,{disabled:d||!!f,onSelect:te,children:[(0,R.jsx)(T,{}),s(`chat:focusSession.gitRefresh`)]})]})]})}function Me({sessionId:e,cwd:t,streaming:n,view:a,onViewChange:o}){let{t:s}=r(),c=i({queryKey:[`task-project-changes`,e,t,n],queryFn:({signal:t})=>me.getVcsChanges(e,{signal:t})}),l=(0,L.useMemo)(()=>C(c.data?.diff||``,c.data?.files.map(e=>e.path)||[],c.data?.diffTruncated),[c.data]),u=c.error?.message||c.data?.error,d=(c.data?.files||[]).map(e=>({path:e.path,status:W(e.status),added:Object.hasOwn(l.files,e.path)?l.files[e.path].added:null,removed:Object.hasOwn(l.files,e.path)?l.files[e.path].removed:null})),f=a?.expandedFiles?.[0],p=d.find(e=>e.path===f)??d[0];return(0,R.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":s(`chat:workbench.projectChanges`),"aria-busy":c.isFetching,"data-changes-scope":`workspace`,children:[(0,R.jsxs)(`header`,{className:`flex min-h-10 shrink-0 items-center gap-1.5 border-b border-stroke-soft py-1 pr-1.5 pl-3`,children:[(0,R.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-content-secondary`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:s(`board:changes.workspaceSummary`,{count:d.length})}),c.data?.isRepo&&!u&&d.length>0&&(0,R.jsx)(q,{added:l.added,removed:l.removed})]}),c.data?.branch&&(0,R.jsxs)(`span`,{className:`inline-flex h-5.5 max-w-[40%] min-w-0 flex-none items-center gap-1 rounded-xs border border-stroke px-1.5 font-mono text-xs text-content-secondary`,title:t,children:[(0,R.jsx)(w,{size:12,className:`flex-none`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`truncate`,children:c.data.branch})]})]}),c.isPending?(0,R.jsx)(he,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):u?(0,R.jsx)(`p`,{role:`alert`,className:`p-3 text-xs text-st-fail`,children:u}):c.data?.isRepo?d.length?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(X,{files:d,selected:p?.path??``,label:s(`board:changes.files`),onSelect:e=>o?.({expandedFiles:[e]})}),p&&(0,R.jsx)(ke,{sessionId:e,file:p,scope:`project`,revision:c.dataUpdatedAt,view:a,onViewChange:o,footer:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`mr-auto min-w-0 truncate font-mono text-content-muted`,title:t,children:t}),(0,R.jsx)(Ae,{cwd:t,path:p.path})]})})]}):(0,R.jsx)(N,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}):(0,R.jsx)(N,{compact:!0,title:s(`chat:workbench.notRepository`)}),(0,R.jsx)(J,{status:c.isFetching?(0,R.jsx)(T,{className:`size-3.5 flex-none animate-spin`,"aria-hidden":`true`}):null,children:(0,R.jsxs)(E,{disabled:c.isFetching,onSelect:()=>void c.refetch(),children:[(0,R.jsx)(T,{}),s(`chat:focusSession.gitRefresh`)]})})]})}function Ne({sessionId:e,cwd:t,streaming:n,scope:i,onScopeChange:a,vcsAvailable:o,view:s,onViewChange:c,requestConfirm:l}){let{t:u}=r();return(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-inspector-changes":i,children:[(0,R.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:(0,R.jsx)(pe,{size:`sm`,"aria-label":u(`board:inspector.changesScope`),value:i,onValueChange:a,options:[{value:`session`,label:u(`board:inspector.scopeSession`)},{value:`workspace`,label:u(`board:inspector.scopeWorkspace`),disabled:!o}]})}),s?i===`workspace`?(0,R.jsx)(Me,{sessionId:e,cwd:t,streaming:n,view:s,onViewChange:c}):(0,R.jsx)(je,{sessionId:e,cwd:t,streaming:n,view:s,onViewChange:c,requestConfirm:l}):(0,R.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-content-muted`,children:u(`chat:focusSession.gitLoading`)})]})}var Pe=[];function Fe(e,t,n){return e===`changes`?n===`workspace`?`changes`:`files`:e===`terminal`?t:e===`files`?`sources`:e===`preview`?`browser`:e===`side-chat`?`side-chat`:null}function Ie({panelId:e,sessionId:t,cwd:n,streaming:s,plan:l,goal:d,team:p,activity:h,planTab:y,sources:ee,mode:C,requestConfirm:w,onClose:T,onOpenComponents:ce,componentTabs:E,autoFocus:le=!1}){let{t:D}=r(),O=C===`sheet`,me=ye(),j=o(e=>e.capabilities),M=!!me&&a(j,`terminal`),he=a(j,`vcs`),P=c(e=>e.tab),F=c(e=>e.setTab),I=c(e=>e.terminalView),_e=c(e=>e.setTerminalView),ve=c(e=>e.changesView),be=c(e=>e.setChangesView),z=S(e=>e.sessions[t]?.pages)??Pe,Se=z.some(e=>e.kind===`side-chat`),B=P===`side-chat`&&!Se||P===`plan`&&!y?`changes`:P,V=Fe(B,I,ve),H=V?z.find(e=>e.kind===V):void 0,Ce=!O&&E?E.tabs(n):[],[U,W]=(0,L.useState)(null),[Te,Ee]=(0,L.useState)(!1),G=Ce.some(e=>e.id===U)?U:null;(0,L.useEffect)(()=>W(null),[P]);let K=(0,L.useRef)(null);(0,L.useEffect)(()=>{K.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[B,G]);let De=(0,L.useRef)(le);(0,L.useEffect)(()=>{if(!De.current)return;let e=requestAnimationFrame(()=>K.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]),(0,L.useEffect)(()=>{if(!V||H||(V===`terminal`||V===`processes`)&&!M)return;let e=S.getState(),n=e.sessions[t]?.contentOpen??!1;e.update(t,V,{type:`add`,kind:V}),n||e.update(t,V,{type:`workspace`,contentOpen:!1})},[V,H,t,M]);let q=i({queryKey:[`session-change-summary`,t,s],queryFn:()=>ge(t),staleTime:1e4}),J=q.data?.status===`known`?q.data.changedFiles??0:0,Y=[{id:`changes`,icon:b,label:J>0?D(`board:inspector.changesCount`,{count:J}):D(`board:inspector.changes`)},{id:`terminal`,icon:oe,label:D(`board:inspector.terminal`)},{id:`files`,icon:x,label:D(`board:inspector.files`)},{id:`preview`,icon:v,label:D(`board:inspector.preview`)},...y?[{id:`plan`,icon:te,label:D(`board:inspector.plan`)}]:[],...Se?[{id:`side-chat`,icon:ie,label:D(`board:inspector.sideChat`)}]:[]],X=e=>{H&&S.getState().update(t,H.kind,{type:`view`,id:H.id,patch:e})},Oe=()=>{let n=z.find(e=>e.kind===`side-chat`);if(n&&S.getState().update(t,`side-chat`,{type:`close`,id:n.id}),F(`changes`),O){T();return}requestAnimationFrame(()=>document.getElementById(`${e}-changes-tab`)?.focus())},Z=t=>`${e}-component-${t}-tab`,ke=e=>{W(null),F(e)},Ae=t=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(t.key))return;t.preventDefault();let n=[...Y.map(t=>({fixed:t.id,id:`${e}-${t.id}-tab`})),...Ce.map(e=>({component:e.id,id:Z(e.id)}))],r=n.findIndex(e=>G?e.component===G:e.fixed===B),i=n[t.key===`Home`?0:t.key===`End`?n.length-1:(r+(t.key===`ArrowRight`?1:-1)+n.length)%n.length];i.component?W(i.component):i.fixed&&ke(i.fixed),requestAnimationFrame(()=>document.getElementById(i.id)?.focus())},Q=(0,R.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-content-muted`,children:D(`chat:focusSession.gitLoading`)}),$;if(G&&E)$=E.render(G,{sessionId:t,cwd:n});else if(B===`changes`)$=(0,R.jsx)(Ne,{sessionId:t,cwd:n,streaming:s,scope:ve,onScopeChange:be,vcsAvailable:he,view:H?.view,onViewChange:H?X:void 0,requestConfirm:w});else if(B===`terminal`)$=M?(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,R.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:(0,R.jsx)(pe,{size:`sm`,"aria-label":D(`board:inspector.terminalScope`),value:I,onValueChange:_e,options:[{value:`terminal`,label:D(`board:inspector.terminal`)},{value:`processes`,label:D(`board:inspector.processes`)}]})}),(0,R.jsx)(L.Suspense,{fallback:Q,children:H?I===`processes`?(0,R.jsx)(f,{sessionId:t,view:H.view,onViewChange:X,onOpenTerminal:e=>{let n=S.getState(),r=n.sessions[t]?.pages.find(e=>e.kind===`terminal`);r?n.update(t,`terminal`,{type:`resource`,id:r.id,resourceId:e}):n.update(t,`terminal`,{type:`open`,kind:`terminal`,resourceId:e}),_e(`terminal`)}}):(0,R.jsx)(u,{sessionId:t,cwd:n,terminalId:H.resourceId||void 0,onCreated:e=>S.getState().update(t,`terminal`,{type:`resource`,id:H.id,resourceId:e})},H.id):Q})]}):(0,R.jsx)(N,{compact:!0,icon:oe,title:D(`board:inspector.terminalUnavailable`)});else if(B===`files`)$=H?(0,R.jsx)(g,{sources:ee,view:H.view,onViewChange:X}):Q;else if(B===`preview`){let e=s?re([...h]):null;$=H?(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-inspector-preview":!0,children:[e&&(0,R.jsx)(`div`,{className:`max-h-[50%] shrink-0 overflow-y-auto border-b border-stroke-soft p-2`,children:(0,R.jsx)(ne,{target:e,fallbackImage:e.previewImage,streaming:s})}),(0,R.jsx)(_,{page:H,onChange:e=>S.getState().update(t,`browser`,{type:`browser`,id:H.id,...e})})]}):Q}else $=B===`plan`?(0,R.jsx)(we,{plan:l,goal:d,team:p,activity:h}):(0,R.jsx)(m,{parentId:t,active:!0});return(0,R.jsxs)(`section`,{id:e,"aria-label":D(`board:inspector.label`),"data-session-inspector":C,"data-inspector-tab":B,"data-inspector-component":G??void 0,className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-panel text-content`,children:[(0,R.jsxs)(`header`,{className:k(`flex shrink-0 items-center gap-1 border-b border-stroke-soft pr-1.5 pl-2`,O?`h-[52px]`:C===`aside`?`h-[52px] [[data-custom-titlebar]_&]:h-11 [[data-custom-titlebar]_&]:pointer-coarse:h-[52px]`:`h-11 pointer-coarse:h-[52px]`),children:[(0,R.jsxs)(`div`,{ref:K,role:`tablist`,"aria-label":D(`board:inspector.tabs`),className:`flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]`,onKeyDown:Ae,children:[Y.map(({id:t,icon:n,label:r})=>{let i=!G&&t===B;return(0,R.jsxs)(`button`,{id:`${e}-${t}-tab`,type:`button`,role:`tab`,"aria-selected":i,"aria-controls":`${e}-body`,tabIndex:i?0:-1,"data-inspector-tab-id":t,className:k(`flex flex-none items-center gap-1.5 rounded-sm px-2 text-[13px] whitespace-nowrap transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,O?`h-11 min-w-11 justify-center px-2.5`:`h-8 pointer-coarse:h-11 pointer-coarse:min-w-11`,i?`bg-solid font-medium text-content shadow-edge ring-1 ring-stroke-strong ring-inset`:`text-content-secondary hover:bg-surface-hover hover:text-content`),onClick:()=>ke(t),children:[!O&&(0,R.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),r]},t)}),!G&&B===`side-chat`&&(0,R.jsx)(A,{type:`button`,variant:`ghost`,size:`icon-sm`,className:k(O&&`size-11`),"aria-label":D(`board:inspector.closeTab`,{tab:D(`board:inspector.sideChat`)}),onClick:Oe,children:(0,R.jsx)(se,{"aria-hidden":`true`})}),!O&&(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1 h-4 w-px flex-none bg-stroke`}),Ce.map(({id:t,label:n})=>{let r=t===G;return(0,R.jsx)(`button`,{id:Z(t),type:`button`,role:`tab`,"aria-selected":r,"aria-controls":`${e}-body`,tabIndex:r?0:-1,"data-inspector-component-tab":t,className:k(`flex h-8 max-w-40 flex-none items-center rounded-sm px-2 text-[13px] whitespace-nowrap transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11 pointer-coarse:min-w-11`,r?`bg-solid font-medium text-content shadow-edge ring-1 ring-stroke-strong ring-inset`:`text-content-secondary hover:bg-surface-hover hover:text-content`),onClick:()=>W(t),children:(0,R.jsx)(`span`,{className:`truncate`,children:n})},t)})]}),!O&&(0,R.jsxs)(fe,{open:Te,onOpenChange:Ee,children:[(0,R.jsx)(ue,{asChild:!0,children:(0,R.jsx)(A,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,"aria-label":D(`board:inspector.add`),title:D(`board:inspector.add`),"data-inspector-component-add":!0,children:(0,R.jsx)(ae,{"aria-hidden":`true`})})}),(0,R.jsxs)(de,{align:`end`,className:`w-64 text-xs`,children:[E?.addMenu?E.addMenu({cwd:n,onAdded:e=>{W(e),Ee(!1)}}):(0,R.jsx)(`p`,{className:`text-content-secondary`,children:D(`board:inspector.addHint`)}),ce&&(0,R.jsx)(A,{type:`button`,variant:`secondary`,size:`sm`,className:`self-start`,onClick:ce,children:D(`board:inspector.openComponents`)})]})]}),(0,R.jsx)(A,{type:`button`,variant:`ghost`,size:`icon-sm`,className:k(`flex-none`,O&&`size-11`),"aria-label":D(`board:inspector.close`),title:D(`board:inspector.close`),"aria-controls":e,onClick:T,children:C===`aside`?(0,R.jsx)(xe,{"aria-hidden":`true`}):(0,R.jsx)(se,{"aria-hidden":`true`})})]}),(0,R.jsx)(`div`,{id:`${e}-body`,role:`tabpanel`,"aria-labelledby":G?Z(G):`${e}-${B}-tab`,className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:$})]})}export{Ie as SessionInspector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,u as r}from"./vendor-router-CSN_DGvx.js";import{i,r as a}from"./vendor-react-DwNgTV1j.js";import{f as o,r as s}from"./routes-Da0OHSy6.js";import{t as c}from"./use-i18n-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,u as r}from"./vendor-router-CSN_DGvx.js";import{i,r as a}from"./vendor-react-DwNgTV1j.js";import{f as o,r as s}from"./routes-Da0OHSy6.js";import{t as c}from"./use-i18n-CVZdp2ZN.js";import{a as l,o as u,s as d,u as f}from"./placements--Zk5njsN.js";import{t as p}from"./client-store-CAhvptv1.js";import{t as m}from"./usePhoneShell-m3H_98m_.js";import{t as h}from"./PhoneMenuButton-Cl7FEYYw.js";import{t as g}from"./useSessionListQuery-CJ-BYuqu.js";import"./public--8F2_oqP.js";import{i as _,t as v}from"./session-home-BDT4lMMJ.js";var y=e(i(),1),b=a(),x=`(max-width: 1279px), (max-height: 760px)`,S=`(min-width: 960px) and (min-height: 640px)`;function C(e){let[t,n]=(0,y.useState)(()=>window.matchMedia(e).matches);return(0,y.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function w({context:e,ChatPage:i}){let a=r(),c=n(),{sessionId:l=``}=t(),u=m(),d=p(e=>e.client===`mobile-app`),f=C(`(min-width: 960px) and (min-height: 640px)`)&&d,S=C(x),w=!u||f,E=(0,y.useRef)(l);E.current=l;let D=(0,y.useRef)(c.state);D.current=c.state;let O=(0,y.useCallback)(e=>{if(!e||e===E.current)return;let t=E.current===`new`;a(o(e),{replace:t,state:t?D.current:void 0})},[a]),k=g(),A=!!(l&&l!==`new`&&k.data?.sessions.some(e=>e.id===l));(0,y.useEffect)(()=>{A&&_(l)},[A,l]);let j=T(e.notify,O),M=e.startNewTask,N=(0,y.useMemo)(()=>({compact:S,overlayOnly:d,onOpenComponents:()=>a(s.components),componentTabs:j,onArchived:e=>{v(e),a(`/`,{replace:!0})},onHome:()=>a(`/`),onNewTask:M}),[S,d,a,j,M]),P=(0,y.useMemo)(()=>({...N,phone:{onNewTask:M}}),[N,M]);return(0,b.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,"data-session-shell":w?`desktop`:`phone`,children:(0,b.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:(0,b.jsx)(i,{notify:e.notify,navigate:e.navigate,browserNotify:e.browserNotify,registerPrimaryAction:e.registerPrimaryAction,pendingAsset:e.pendingAsset,onAssetConsumed:e.onAssetConsumed,requestText:e.requestText,requestConfirm:e.requestConfirm,routeSessionId:l,onRouteSessionChange:O,routeLeading:w?void 0:(0,b.jsx)(h,{}),pageChrome:w?N:P})})})}function T(e,t){let{language:n}=c(),{available:r,placed:i}=f(`session-panel`);return(0,y.useMemo)(()=>{if(r)return{tabs:e=>d(i,e,n),render:(n,{sessionId:r,cwd:a})=>{let o=i.find(e=>e.instance.instanceId===n);return o?(0,b.jsx)(y.Suspense,{fallback:null,children:(0,b.jsx)(u,{placed:o,sessionId:r,cwd:a,notify:e,onOpenSession:t})}):null},addMenu:({cwd:t,onAdded:n})=>(0,b.jsx)(y.Suspense,{fallback:null,children:(0,b.jsx)(l,{cwd:t,notify:e,onAdded:n})})}},[r,n,e,t,i])}export{x as SESSION_COMPACT_QUERY,S as SESSION_TABLET_QUERY,w as SessionShell};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CVZdp2ZN.js";import{t as i}from"./runtime-capabilities-store-D1FwQXKw.js";import{t as a}from"./arrow-left-B8oVrQ2S.js";import{t as o}from"./arrow-right-DqLOhpA2.js";import{r as s}from"./settings-navigation-DV3N_utl.js";import{t as c}from"./utils-C8uzG5AZ.js";import{t as l}from"./kbd-CAufZTkl.js";import{n as u}from"./shortcuts-BGzXmClx.js";import{n as d,r as f}from"./back-navigation-CK7X_5Bc.js";var p=e(t(),1);function m(e,t=!0){let n=(0,p.useRef)(e);n.current=e,(0,p.useEffect)(()=>{if(!t)return;let e=new WeakSet,r=t=>{t.key===`Escape`&&d()&&e.add(t)},i=t=>{t.key!==`Escape`||t.defaultPrevented||t.isComposing||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||e.has(t)||u(t.target)&&!f(t)||(t.preventDefault(),n.current())};return window.addEventListener(`keydown`,r,!0),window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,r,!0),window.removeEventListener(`keydown`,i)}},[t])}var h=n(),g=`flex h-8 w-full min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-left text-[length:var(--app-font-size)] text-content transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`;function _({configSection:e,onSelectSection:t,onBack:n,onOpenFeatures:u,search:d,version:f,footer:p}){let{t:_}=r(),v=i(e=>e.capabilities),y=s(_,{capabilities:v});m(n);let b=_(`config:settingsShell.back`);return(0,h.jsxs)(`nav`,{"aria-label":_(`config:settingsShell.settingsNavigation`),"data-settings-sidebar":!0,className:`flex min-h-0 flex-1 flex-col animate-in fade-in duration-(--d-fast) motion-reduce:animate-none`,children:[(0,h.jsxs)(`div`,{"data-window-drag-region":!0,className:`flex h-[52px] flex-none items-center gap-2 pr-3.5 pl-2`,children:[(0,h.jsxs)(`button`,{type:`button`,"data-settings-back":!0,"aria-keyshortcuts":`Escape`,className:`flex h-8 items-center gap-2 rounded-[var(--r-md)] pr-2.5 pl-1.5 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:n,children:[(0,h.jsx)(a,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`}),b]}),(0,h.jsx)(`span`,{className:`flex-1`}),(0,h.jsx)(l,{"aria-hidden":`true`,className:`border-transparent bg-transparent text-content-faint shadow-none pointer-coarse:hidden`,children:`Esc`})]}),(0,h.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-2 pb-2`,children:[(0,h.jsx)(`h2`,{className:`m-0 px-2.5 pt-2.5 pb-3 text-xl leading-7 font-semibold tracking-[-.01em] text-content`,children:_(`navigation:navigation.settings`)}),d&&(0,h.jsx)(`div`,{className:`relative z-20 mb-2 px-0.5`,children:d}),(0,h.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:y.map(n=>{let r=n.section===e;return(0,h.jsx)(`li`,{children:(0,h.jsxs)(`button`,{type:`button`,"data-settings-section":n.section,"aria-current":r?`page`:void 0,className:c(g,r&&`bg-surface-active font-medium hover:bg-surface-active`),onClick:()=>t(n.section),children:[(0,h.jsx)(n.icon,{className:`size-4 flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.label}),n.section===`about`&&f&&(0,h.jsxs)(`small`,{className:`font-mono text-xs font-normal text-content-muted tabular-nums`,children:[`v`,f]})]})},n.section)})}),(0,h.jsxs)(`button`,{type:`button`,"data-settings-features-link":!0,className:`mt-4 flex min-h-8 w-full items-center gap-1 rounded-[var(--r-md)] px-2.5 py-1 text-left text-xs leading-5 text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:min-h-11`,onClick:u,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1`,children:_(`config:settingsShell.featuresHint`)}),(0,h.jsx)(o,{className:`size-3.5 flex-none`,"aria-hidden":`true`})]})]}),p&&(0,h.jsx)(`div`,{className:`flex-none p-2`,children:p})]})}export{_ as SettingsSidebar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CVZdp2ZN.js";import{t as i}from"./settings-QX0oWnVK.js";import{t as a}from"./button-CCcCN8tE.js";import{c as o}from"./shortcuts-BGzXmClx.js";import{a as s,i as c,l,n as u,o as d,s as f,t as p}from"./dialog-2cmY5V75.js";import{a as m,i as h,n as g,r as _,t as v}from"./ShortcutKeys-Cx8hNJ62.js";var y=e(t(),1),b=n();function x({open:e,onOpenChange:t,onCustomize:n}){let{t:x}=r(),S=m(),C=o(e=>e.bindings),w=o(e=>e.boardBindings),[T]=(0,y.useState)(()=>document.activeElement instanceof HTMLElement?document.activeElement:null),E=(0,y.useRef)(null),[D,O]=(0,y.useState)(!0);return(0,b.jsx)(p,{open:e,onOpenChange:t,children:(0,b.jsxs)(c,{size:`wide`,scrollMode:`body`,className:`max-w-[min(92vw,760px)]`,"data-shortcut-help":!0,onOpenAutoFocus:e=>{E.current&&(e.preventDefault(),E.current.focus({preventScroll:!0}))},onCloseAutoFocus:e=>{T?.isConnected&&(e.preventDefault(),T.focus({preventScroll:!0}))},children:[(0,b.jsxs)(f,{className:`pr-8`,children:[(0,b.jsx)(l,{children:x(`board:shortcuts.shortcutHelp`)}),(0,b.jsx)(s,{children:x(`board:shortcuts.helpDescription`)})]}),(0,b.jsx)(u,{ref:E,tabIndex:0,role:`region`,"aria-label":x(`board:shortcuts.shortcutHelp`),"data-quiet-focus":D||void 0,onKeyDown:e=>{let{key:t,metaKey:n,ctrlKey:r,altKey:i}=e;t===`Escape`||t===`Shift`||n||r||i||O(!1)},onBlur:()=>O(!1),className:`-mx-4 px-4 py-2 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus data-quiet-focus:focus-visible:outline-none`,children:(0,b.jsx)(`div`,{className:`grid gap-x-8 gap-y-5 min-[720px]:grid-cols-2`,children:g.map(e=>(0,b.jsxs)(`section`,{"aria-labelledby":`shortcut-help-${e.id}`,"data-shortcut-help-group":e.id,className:e.id===`board`?`min-[720px]:row-span-2`:void 0,children:[(0,b.jsx)(`h3`,{id:`shortcut-help-${e.id}`,className:`text-[13px] leading-5 font-semibold text-content`,children:S.groups[e.id].title}),(0,b.jsx)(`p`,{className:`mb-1 text-xs text-content-muted`,children:S.groups[e.id].hint}),(0,b.jsx)(`dl`,{className:`divide-y divide-stroke-soft`,children:e.entries.map(e=>(0,b.jsxs)(`div`,{className:`flex min-h-7 min-w-0 items-center justify-between gap-3 py-0.5`,"data-shortcut-help-entry":_(e),children:[(0,b.jsx)(`dt`,{className:`min-w-0 text-[13px] text-content`,children:S.label(e)}),(0,b.jsx)(`dd`,{className:`flex-none`,children:(0,b.jsx)(v,{keys:h(e,C,w),className:`justify-end`})})]},_(e)))})]},e.id))})}),n&&(0,b.jsx)(d,{children:(0,b.jsxs)(a,{variant:`outline`,size:`dialogAction`,onClick:()=>{t(!1),n()},children:[(0,b.jsx)(i,{"aria-hidden":`true`}),x(`board:shortcuts.helpCustomize`)]})})]})})}export{x as ShortcutHelpDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CVZdp2ZN.js";import{t as i}from"./utils-C8uzG5AZ.js";import{n as a,t as o}from"./kbd-CAufZTkl.js";import{t as s}from"./shortcuts-BGzXmClx.js";var c=e=>({kind:`app`,action:e}),l=e=>({kind:`board`,action:e}),u=(e,...t)=>({kind:`fixed`,id:e,keys:t}),d=[{id:`global`,entries:[c(`commandPalette`),c(`primaryAction`),c(`toggleSidebar`),c(`agentPanel`),c(`openBoard`),c(`openMore`),c(`openSettings`),c(`jumpToAttention`),c(`previousAgent`),c(`nextAgent`),c(`cycleFocusRegion`),c(`toggleTerminal`),c(`shortcutHelp`),c(`focusComposer`),c(`voiceInput`),c(`openSession`),c(`openComponents`)]},{id:`sidebar`,entries:[u(`sidebarMove`,[`↑`],[`↓`]),u(`sidebarOpen`,[`Enter`])]},{id:`board`,entries:[c(`focusSearch`),l(`boardNext`),l(`boardPrevious`),u(`boardMove`,[`↑`],[`↓`]),u(`boardOpen`,[`Enter`]),l(`boardApprove`),l(`boardDeny`),l(`boardRetry`),l(`boardTriage`),u(`boardExitTriage`,[`Esc`]),l(`boardToggleGrouping`)]},{id:`session`,entries:[c(`toggleInspector`),c(`sessionTree`),c(`sideChat`),c(`sendMessage`),c(`steerMessage`),u(`newline`,[`Shift`,`Enter`]),u(`cycleRunMode`,[`Shift`,`Tab`]),u(`stopRun`,[`Esc`])]}];function f(e){return e.kind===`fixed`?`fixed:${e.id}`:e.action}function p(e,t,n){if(e.kind===`fixed`)return e.keys;let r=s(e.kind===`app`?t[e.action]:n[e.action]);return r?[r.split(` + `)]:null}function m(){let{t:e}=r(),t={commandPalette:e(`config:shortcuts.commandPalette`),primaryAction:e(`config:shortcuts.primaryAction`),focusSearch:e(`board:shortcuts.focusSearch`),toggleSidebar:e(`config:shortcuts.toggleSidebar`),toggleTerminal:e(`config:shortcuts.toggleTerminal`),openSettings:e(`config:shortcuts.openSettings`),focusComposer:e(`config:shortcuts.focusComposer`),sendMessage:e(`board:shortcuts.sendMessage`),voiceInput:e(`config:shortcuts.voiceInput`),openBoard:e(`config:shortcuts.openBoard`),openComponents:e(`config:shortcuts.openComponents`),openMore:e(`config:shortcuts.openMore`),jumpToAttention:e(`config:shortcuts.jumpToAttention`),agentPanel:e(`board:shortcuts.agentPanel`),toggleInspector:e(`board:shortcuts.toggleInspector`),previousAgent:e(`board:shortcuts.previousAgent`),nextAgent:e(`board:shortcuts.nextAgent`),steerMessage:e(`board:shortcuts.steerMessage`),shortcutHelp:e(`board:shortcuts.shortcutHelp`),openSession:e(`board:shortcuts.openSession`),sessionTree:e(`board:shortcuts.sessionTree`),sideChat:e(`board:shortcuts.sideChat`),cycleFocusRegion:e(`board:shortcuts.cycleFocusRegion`)},n={boardNext:e(`config:shortcuts.boardNext`),boardPrevious:e(`config:shortcuts.boardPrevious`),boardApprove:e(`config:shortcuts.boardApprove`),boardDeny:e(`config:shortcuts.boardDeny`),boardRetry:e(`config:shortcuts.boardRetry`),boardTriage:e(`config:shortcuts.boardTriage`),boardToggleGrouping:e(`config:shortcuts.boardToggleGrouping`)},i={sidebarMove:e(`board:shortcuts.sidebarMove`),sidebarOpen:e(`board:shortcuts.sidebarOpen`),boardMove:e(`board:shortcuts.boardMove`),boardOpen:e(`board:shortcuts.boardOpen`),boardExitTriage:e(`board:shortcuts.boardExitTriage`),newline:e(`board:shortcuts.newline`),cycleRunMode:e(`board:shortcuts.cycleRunMode`),stopRun:e(`board:shortcuts.stopRun`)};return{actions:t,boardActions:n,groups:{global:{title:e(`board:shortcuts.groupGlobal`),hint:e(`board:shortcuts.globalHint`)},sidebar:{title:e(`board:shortcuts.groupSidebar`),hint:e(`board:shortcuts.sidebarHint`)},board:{title:e(`board:shortcuts.groupBoard`),hint:e(`board:shortcuts.boardHint`)},session:{title:e(`board:shortcuts.groupSession`),hint:e(`board:shortcuts.sessionHint`)}},label:e=>e.kind===`app`?t[e.action]:e.kind===`board`?n[e.action]:i[e.id]}}var h=e(t(),1),g=n();function _({keys:e,className:t}){let{t:n}=r();return e?.length?(0,g.jsx)(`span`,{className:i(`inline-flex min-w-0 flex-wrap items-center gap-1`,t),children:e.map((e,t)=>(0,g.jsxs)(h.Fragment,{children:[t>0&&(0,g.jsx)(`span`,{"aria-hidden":`true`,className:`text-xs text-content-muted`,children:`/`}),(0,g.jsx)(a,{children:e.map(e=>(0,g.jsx)(o,{className:`text-content-secondary`,children:e},e))})]},e.join(`+`)))}):(0,g.jsx)(`span`,{className:i(`text-xs text-content-muted`,t),children:n(`config:shortcuts.disabled`)})}export{m as a,p as i,d as n,f as r,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-
|
|
1
|
+
import{r as e}from"./vendor-react-DwNgTV1j.js";import{t}from"./use-i18n-CVZdp2ZN.js";import{t as n}from"./download-BCfIiuaL.js";import{t as r}from"./external-link-CEQqPcqc.js";import{t as i}from"./refresh-cw-TbWxTY4K.js";import{t as a}from"./rocket-BgLSjoHY.js";var o=e();function s({update:e,collapsed:s,onOpen:c}){let{t:l}=t(),u=e?.status||{state:`idle`},d=!!(e?.info?.desktop||e?.info?.mobile);if(![`available`,`downloading`,`downloaded`].includes(u.state))return null;let f=u.state===`downloading`,p=u.state===`downloaded`,m=l(p?`navigation:appSidebar.readyToRestart`:f?`navigation:appSidebar.downloading`:d?`navigation:appSidebar.updateAvailable`:`navigation:appSidebar.sourceUpdatesAvailable`),h=f?`${Math.round(u.percent||0)}%`:d&&u.availableVersion?`v${u.availableVersion}`:u.behindBy?l(`navigation:appSidebar.countCommitsBehindBranch`,{branch:u.branch||`main`,count:u.behindBy}):u.availableCommit?u.availableCommit.slice(0,7):l(`navigation:appSidebar.viewUpdateDetails`),g=p?a:f?i:d?n:r;return(0,o.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center rounded-sm border border-star-border bg-star-soft text-content transition-colors duration-[var(--d-fast)] hover:bg-surface-hover ${s?`justify-center px-0`:`gap-2.5 px-3 text-left`}`,title:`${m} · ${h}`,"aria-label":`${m} · ${h}`,onClick:c,children:[(0,o.jsx)(g,{className:`shrink-0 text-accent-fg ${f?`animate-spin`:``}`,size:16}),!s&&(0,o.jsxs)(`span`,{className:`min-w-0`,children:[(0,o.jsx)(`strong`,{className:`block truncate text-xs font-medium`,children:m}),(0,o.jsx)(`small`,{className:`mt-0.5 block truncate text-xs text-content-muted tabular-nums`,children:h})]})]})}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-D2P6OO3w.js";import{t as i}from"./api-DVgYxLec.js";import{t as a}from"./file-code-corner-BnE1ljT0.js";import{t as o}from"./image-BY_c3FYU.js";import{t as s}from"./package-BOmkLaKS.js";import{t as c}from"./plus-fQbSqB1n.js";import{t as l}from"./save-CHBB52P8.js";import{t as u}from"./sparkles-S_eeuqn9.js";import{t as d}from"./trash-2-CNrPOoPR.js";import{t as f}from"./wrench-6pg6_bqI.js";import{t as p}from"./more-pages-D_PnxLN0.js";import{t as ee}from"./checkbox-CG2AnYPm.js";import{t as m}from"./button-Bu_vuij9.js";import{s as h}from"./shortcuts-BOeaPAvF.js";import{n as g,t as _}from"./PageState-aWHrkE1D.js";import{a as v,i as y,n as b,o as x,r as S,s as te,t as ne}from"./FeaturePage-1MUXz3Y-.js";import{c as C,s as w}from"./app-primitives-Cmdj4cIW.js";var T=e(t(),1),E=n(),D=[`all`,`global`,`project`,`design`,`code`,`docs`,`privileged`],O=`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 k(e,t=``){return t?`${e}${e.includes(`?`)?`&`:`?`}sessionId=${encodeURIComponent(t)}`:e}function A(e,t){return t(e===`global`?`skills:skillsPage.global`:e===`project`?`skills:skillsPage.project`:e===`design`?`skills:skillsPage.design`:e===`code`?`skills:skillsPage.code`:e===`docs`?`skills:skillsPage.documents`:e===`privileged`?`skills:skillsPage.highPrivilege`:`skills:skillsPage.all`)}function j(e){let t=`${e?.name||``} ${e?.description||``}`.toLowerCase();return/image|visual|design|figma|svg|图片|视觉|设计/.test(t)?o:/doc|pdf|文档|说明/.test(t)?a:/install|package|market|安装|包/.test(t)?s:/code|test|plugin|skill|代码|测试|插件|技能/.test(t)?f:u}function re(e,t){if(t===`all`)return!0;if(t===`global`)return e.sourceInfo?.scope!==`project`;if(t===`project`)return e.sourceInfo?.scope===`project`;let n=`${e.name} ${e.description} ${(e.allowedTools||[]).join(` `)}`.toLowerCase();return t===`design`?/image|visual|design|figma|svg|图片|视觉|设计/.test(n):t===`code`?/code|test|plugin|代码|测试|插件/.test(n):t===`docs`?/doc|pdf|文档|说明/.test(n):t!==`privileged`||(e.allowedTools||[]).some(e=>[`bash`,`write`,`edit`].includes(e))}function M({notify:e,activeSessionId:t=``,onBack:n,requestText:a,requestConfirm:o}){let{t:u}=r(),f=h(`focusSearch`),[M,ie]=(0,T.useState)(``),[N,P]=(0,T.useState)(null),[F,I]=(0,T.useState)(``),[L,R]=(0,T.useState)(`all`),[z,B]=(0,T.useState)(!1),[V,H]=(0,T.useState)(!0),[U,W]=(0,T.useState)(``),G=(0,T.useCallback)(async()=>{W(``);try{let e=await i(k(`/api/skills`,t));return P(e),I(t=>e.skills.some(e=>e.id===t)?t:``),e}catch(e){return W(e instanceof Error?e.message:String(e)),null}finally{H(!1)}},[t]);(0,T.useEffect)(()=>{G()},[G]);let K=(0,T.useCallback)(async()=>{let n=await a?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.globalSkillSourceHelp`),inputLabel:u(`skills:skillsPage.skillSource`),placeholder:`E:\\path\\to\\skill, npm:@scope/package, or https://github.com/...`,maxLength:2e3,confirmLabel:u(`skills:skillsPage.continue`)});if(n?.trim()&&await o?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.skillsProvideInstructionsToTheAgentAndMayIncludeExecutableScriptsConfirmThatYouTrustTheSource`),confirmLabel:u(`skills:skillsPage.import`),tone:`danger`})!==!1){B(!0),W(``);try{let r=await i(k(`/api/skills/install`,t),{method:`POST`,body:JSON.stringify({source:n})});P(r),I(r.installed?.[0]?.id||``),e(u(`skills:skillsPage.skillInstalledAndLoadedIntoTheAgentRuntime`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);W(n),e(n,`error`)}finally{B(!1)}}},[t,e,o,a,u]),q=N?.skills||[],J=M.trim().toLowerCase(),Y=q.filter(e=>re(e,L)&&`${e.name} ${e.description}`.toLowerCase().includes(J)),ae=q.filter(e=>e.sourceInfo?.scope!==`project`),oe=q.filter(e=>e.sourceInfo?.scope===`project`),se=Y.filter(e=>e.sourceInfo?.scope!==`project`),ce=Y.filter(e=>e.sourceInfo?.scope===`project`),X=(N?.packages||[]).map(e=>({source:e.source,description:e.scope===`project`?u(`skills:skillsPage.projectScopedConfiguration`):u(`skills:skillsPage.userScopedConfiguration`),status:e.installed?u(`skills:skillsPage.locallyReady`):u(`skills:skillsPage.notMaterialized`)})).filter(e=>`${e.source} ${e.description}`.toLowerCase().includes(J)),Z=async(e,n)=>{if(e){B(!0),W(``);try{let r=await i(k(`/api/skills/${encodeURIComponent(e.id)}`,t),{method:`PATCH`,body:JSON.stringify(n)});P(e=>{if(!e)return e;let t=e.skills.map(e=>e.id===r.id?r:e);return{...e,skills:t,counts:{...e.counts,enabled:t.filter(e=>e.enabled).length,modelInvocable:t.filter(e=>e.enabled&&e.modelInvocationEnabled).length}}})}catch(e){W(e instanceof Error?e.message:String(e))}finally{B(!1)}}},le=async()=>{B(!0),W(``);try{P(await i(k(`/api/skills/reload`,t),{method:`POST`,body:`{}`})),e(u(`skills:skillsPage.skillSettingsSavedAndReloaded`),`success`)}catch(e){W(e instanceof Error?e.message:String(e))}finally{B(!1)}},ue=async n=>{if(n.removable&&await o?.({title:u(`skills:skillsPage.uninstallSkill`),message:u(`skills:skillsPage.thisRemovesTheSkillDirectoryInstalledByPisperItDoesNotUninstallTheOriginalNpmOrGitPackage`),confirmLabel:u(`skills:skillsPage.uninstall`),tone:`danger`})!==!1){B(!0),W(``);try{await i(k(`/api/skills/${encodeURIComponent(n.id)}`,t),{method:`DELETE`}),await G(),I(``),e(u(`skills:skillsPage.skillUninstalled`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);W(n),e(n,`error`)}finally{B(!1)}}},de=e=>(0,E.jsxs)(`div`,{className:`skill-detail grid gap-3`,children:[(0,E.jsx)(`p`,{className:`text-sm leading-relaxed whitespace-pre-line text-content-soft`,children:e.description||u(`skills:skillsPage.addGlobalOrProjectSkill`)}),(0,E.jsx)(`dl`,{className:O,children:[[u(`skills:skillsPage.triggerMode`),e.modelInvocationEnabled?u(`skills:skillsPage.automaticManual`):u(`skills:skillsPage.manualOnly`),!1],[u(`skills:skillsPage.permissions`),e.allowedTools?.length?e.allowedTools.join(`, `):u(`skills:skillsPage.usesChatToolPermissions`),!!e.allowedTools?.length],[u(`skills:skillsPage.scope`),e.sourceInfo?.scope===`project`?u(`skills:skillsPage.project`):u(`skills:skillsPage.global`),!1],[u(`skills:skillsPage.version`),e.version||`latest`,!0],[u(`skills:skillsPage.source`),e.source||`—`,!0]].map(([e,t,n])=>(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{children:e}),(0,E.jsx)(`dd`,{className:n?`font-mono`:void 0,children:t})]},e))}),(0,E.jsxs)(`fieldset`,{className:`grid min-w-0 gap-0.5`,children:[(0,E.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-content-muted`,children:u(`skills:skillsPage.triggerConditions`)}),[[u(`skills:skillsPage.allowAutomaticModelInvocation`),!!e.modelInvocationEnabled,!1,t=>void Z(e,{modelInvocationEnabled:t})],[u(`skills:skillsPage.supportManualSkillCommand`),!!e.command,!0],[u(`skills:skillsPage.projectScopedSkill`),e.sourceInfo?.scope===`project`,!0],[u(`skills:skillsPage.declaresRequiredTools`),!!e.allowedTools?.length,!0]].map(([e,t,n,r])=>(0,E.jsxs)(`label`,{className:`check-row flex min-h-8 items-center gap-2.5 text-sm text-content has-disabled:text-content-muted max-[650px]:min-h-11`,children:[(0,E.jsx)(ee,{checked:t,disabled:z||n,onCheckedChange:e=>r?.(e===!0)}),(0,E.jsx)(`span`,{children:e})]},e))]}),(0,E.jsx)(`div`,{className:`flex justify-end`,children:e.removable?(0,E.jsxs)(m,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,disabled:z,onClick:()=>void ue(e),children:[(0,E.jsx)(d,{}),u(`skills:skillsPage.uninstallSkill`)]}):(0,E.jsxs)(m,{variant:`secondary`,className:`max-[650px]:h-11`,loading:z,disabled:z,onClick:le,children:[(0,E.jsx)(l,{}),u(`skills:skillsPage.saveSettings`)]})})]}),Q=(e,t,n,r,i=``)=>(0,E.jsx)(x,{className:`skill-scope`,title:e,count:t.length,description:i&&(0,E.jsx)(`span`,{className:`font-mono`,children:i}),children:t.length?(0,E.jsx)(b,{children:t.map(e=>{let t=j(e);return(0,E.jsx)(y,{className:`skill-row`,"data-skill-row":e.id,icon:(0,E.jsx)(t,{}),name:(0,E.jsx)(`span`,{className:`font-mono`,children:e.name}),description:e.description,actions:(0,E.jsx)(w,{value:e.enabled,disabled:z,ariaLabel:u(`skills:skillsPage.toggleSkillName`,{name:e.name}),onChange:t=>void Z(e,{enabled:t})}),expanded:F===e.id,onExpandedChange:t=>I(t?e.id:``),toggleLabel:u(`skills:skillsPage.toggleSkillDetails`,{name:e.name}),detail:de(e)},e.id)})}):(0,E.jsx)(`p`,{className:`skills-empty-copy border-t border-stroke py-3 text-xs leading-normal text-content-muted`,children:n.length?u(`skills:skillsPage.noSkillsMatchTheCurrentFilter`):r})}),$=u(`navigation:navigation.skills`);return(0,E.jsx)(S,{title:$,description:u(`skills:skillsPage.lede`),back:n&&{label:u(`navigation:sidebar.features`),ariaLabel:u(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,E.jsx)(te,{search:(0,E.jsx)(v,{id:p,value:M,onValueChange:ie,placeholder:u(`navigation:pageHeader.searchPage`,{page:$}),shortcut:f,clearLabel:u(`navigation:more.clearSearch`)}),actions:(0,E.jsxs)(m,{type:`button`,className:`h-9`,"data-skills-install":!0,disabled:z||!N,onClick:()=>void K(),children:[(0,E.jsx)(c,{}),u(`navigation:pageHeader.installSkill`)]}),filters:(0,E.jsx)(C,{options:D.map(e=>A(e,u)),value:A(L,u),onChange:e=>R(D.find(t=>A(t,u)===e)||`all`)})}),children:V&&!N?(0,E.jsx)(g,{kind:`loading`,title:u(`skills:skillsPage.loadingSkills`),description:u(`skills:skillsPage.scanningSkillDirectoriesAndConfiguredPackages`)}):N?(0,E.jsxs)(E.Fragment,{children:[U&&(0,E.jsx)(ne,{children:U}),L!==`project`&&Q(u(`skills:skillsPage.globalSkills`),se,ae,u(`skills:skillsPage.noGlobalSkills`),N.locations?.global||`~/.pisper/agent/skills`),L!==`global`&&Q(u(`skills:skillsPage.projectSkills`),ce,oe,u(`skills:skillsPage.noProjectSkills`),N.locations?.project||(N.cwd?`${N.cwd.replace(/[\\/]$/,``)}/.pisper/skills`:``)),(0,E.jsx)(x,{className:`skill-packages`,title:u(`skills:skillsPage.configuredSkillPackages`),count:X.length,children:X.length?(0,E.jsx)(b,{children:X.map(e=>(0,E.jsx)(y,{className:`market-row`,icon:(0,E.jsx)(s,{}),name:(0,E.jsx)(`span`,{className:`font-mono`,title:e.source,children:e.source}),description:e.description,status:e.status},e.source))}):(0,E.jsx)(_,{compact:!0,icon:s,title:u(`skills:skillsPage.noSkillPackagesAreConfiguredYetAfterYouInstallASkillItsSourceWillAppearHere`)})})]}):(0,E.jsx)(g,{kind:`error`,title:u(`skills:skillsPage.loadFailed`),description:U,action:(0,E.jsx)(m,{variant:`secondary`,className:`max-[650px]:h-11`,loading:V,disabled:V,onClick:()=>{H(!0),G()},children:u(`common:pageTemplate.retry`)})})})}export{M as SkillsPage};
|
|
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-CVZdp2ZN.js";import{t as i}from"./api-45iTnFjN.js";import{t as a}from"./file-code-corner-BnE1ljT0.js";import{t as o}from"./image-BY_c3FYU.js";import{t as s}from"./package-BOmkLaKS.js";import{t as c}from"./plus-fQbSqB1n.js";import{t as l}from"./save-CHBB52P8.js";import{t as u}from"./sparkles-S_eeuqn9.js";import{t as d}from"./trash-2-CNrPOoPR.js";import{t as f}from"./wrench-6pg6_bqI.js";import{t as p}from"./more-pages-D_PnxLN0.js";import{t as ee}from"./checkbox-BrEHgFV0.js";import{t as m}from"./button-CCcCN8tE.js";import{s as h}from"./shortcuts-BGzXmClx.js";import{n as g,t as _}from"./PageState-Cz6vFMXv.js";import{a as v,i as y,n as b,o as x,r as S,s as te,t as ne}from"./FeaturePage-BJGDVZ_u.js";import{c as C,s as w}from"./app-primitives-Drz_SjnR.js";var T=e(t(),1),E=n(),D=[`all`,`global`,`project`,`design`,`code`,`docs`,`privileged`],O=`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 k(e,t=``){return t?`${e}${e.includes(`?`)?`&`:`?`}sessionId=${encodeURIComponent(t)}`:e}function A(e,t){return t(e===`global`?`skills:skillsPage.global`:e===`project`?`skills:skillsPage.project`:e===`design`?`skills:skillsPage.design`:e===`code`?`skills:skillsPage.code`:e===`docs`?`skills:skillsPage.documents`:e===`privileged`?`skills:skillsPage.highPrivilege`:`skills:skillsPage.all`)}function j(e){let t=`${e?.name||``} ${e?.description||``}`.toLowerCase();return/image|visual|design|figma|svg|图片|视觉|设计/.test(t)?o:/doc|pdf|文档|说明/.test(t)?a:/install|package|market|安装|包/.test(t)?s:/code|test|plugin|skill|代码|测试|插件|技能/.test(t)?f:u}function re(e,t){if(t===`all`)return!0;if(t===`global`)return e.sourceInfo?.scope!==`project`;if(t===`project`)return e.sourceInfo?.scope===`project`;let n=`${e.name} ${e.description} ${(e.allowedTools||[]).join(` `)}`.toLowerCase();return t===`design`?/image|visual|design|figma|svg|图片|视觉|设计/.test(n):t===`code`?/code|test|plugin|代码|测试|插件/.test(n):t===`docs`?/doc|pdf|文档|说明/.test(n):t!==`privileged`||(e.allowedTools||[]).some(e=>[`bash`,`write`,`edit`].includes(e))}function M({notify:e,activeSessionId:t=``,onBack:n,requestText:a,requestConfirm:o}){let{t:u}=r(),f=h(`focusSearch`),[M,ie]=(0,T.useState)(``),[N,P]=(0,T.useState)(null),[F,I]=(0,T.useState)(``),[L,R]=(0,T.useState)(`all`),[z,B]=(0,T.useState)(!1),[V,H]=(0,T.useState)(!0),[U,W]=(0,T.useState)(``),G=(0,T.useCallback)(async()=>{W(``);try{let e=await i(k(`/api/skills`,t));return P(e),I(t=>e.skills.some(e=>e.id===t)?t:``),e}catch(e){return W(e instanceof Error?e.message:String(e)),null}finally{H(!1)}},[t]);(0,T.useEffect)(()=>{G()},[G]);let K=(0,T.useCallback)(async()=>{let n=await a?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.globalSkillSourceHelp`),inputLabel:u(`skills:skillsPage.skillSource`),placeholder:`E:\\path\\to\\skill, npm:@scope/package, or https://github.com/...`,maxLength:2e3,confirmLabel:u(`skills:skillsPage.continue`)});if(n?.trim()&&await o?.({title:u(`skills:skillsPage.importGlobalSkill`),message:u(`skills:skillsPage.skillsProvideInstructionsToTheAgentAndMayIncludeExecutableScriptsConfirmThatYouTrustTheSource`),confirmLabel:u(`skills:skillsPage.import`),tone:`danger`})!==!1){B(!0),W(``);try{let r=await i(k(`/api/skills/install`,t),{method:`POST`,body:JSON.stringify({source:n})});P(r),I(r.installed?.[0]?.id||``),e(u(`skills:skillsPage.skillInstalledAndLoadedIntoTheAgentRuntime`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);W(n),e(n,`error`)}finally{B(!1)}}},[t,e,o,a,u]),q=N?.skills||[],J=M.trim().toLowerCase(),Y=q.filter(e=>re(e,L)&&`${e.name} ${e.description}`.toLowerCase().includes(J)),ae=q.filter(e=>e.sourceInfo?.scope!==`project`),oe=q.filter(e=>e.sourceInfo?.scope===`project`),se=Y.filter(e=>e.sourceInfo?.scope!==`project`),ce=Y.filter(e=>e.sourceInfo?.scope===`project`),X=(N?.packages||[]).map(e=>({source:e.source,description:e.scope===`project`?u(`skills:skillsPage.projectScopedConfiguration`):u(`skills:skillsPage.userScopedConfiguration`),status:e.installed?u(`skills:skillsPage.locallyReady`):u(`skills:skillsPage.notMaterialized`)})).filter(e=>`${e.source} ${e.description}`.toLowerCase().includes(J)),Z=async(e,n)=>{if(e){B(!0),W(``);try{let r=await i(k(`/api/skills/${encodeURIComponent(e.id)}`,t),{method:`PATCH`,body:JSON.stringify(n)});P(e=>{if(!e)return e;let t=e.skills.map(e=>e.id===r.id?r:e);return{...e,skills:t,counts:{...e.counts,enabled:t.filter(e=>e.enabled).length,modelInvocable:t.filter(e=>e.enabled&&e.modelInvocationEnabled).length}}})}catch(e){W(e instanceof Error?e.message:String(e))}finally{B(!1)}}},le=async()=>{B(!0),W(``);try{P(await i(k(`/api/skills/reload`,t),{method:`POST`,body:`{}`})),e(u(`skills:skillsPage.skillSettingsSavedAndReloaded`),`success`)}catch(e){W(e instanceof Error?e.message:String(e))}finally{B(!1)}},ue=async n=>{if(n.removable&&await o?.({title:u(`skills:skillsPage.uninstallSkill`),message:u(`skills:skillsPage.thisRemovesTheSkillDirectoryInstalledByPisperItDoesNotUninstallTheOriginalNpmOrGitPackage`),confirmLabel:u(`skills:skillsPage.uninstall`),tone:`danger`})!==!1){B(!0),W(``);try{await i(k(`/api/skills/${encodeURIComponent(n.id)}`,t),{method:`DELETE`}),await G(),I(``),e(u(`skills:skillsPage.skillUninstalled`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);W(n),e(n,`error`)}finally{B(!1)}}},de=e=>(0,E.jsxs)(`div`,{className:`skill-detail grid gap-3`,children:[(0,E.jsx)(`p`,{className:`text-sm leading-relaxed whitespace-pre-line text-content-soft`,children:e.description||u(`skills:skillsPage.addGlobalOrProjectSkill`)}),(0,E.jsx)(`dl`,{className:O,children:[[u(`skills:skillsPage.triggerMode`),e.modelInvocationEnabled?u(`skills:skillsPage.automaticManual`):u(`skills:skillsPage.manualOnly`),!1],[u(`skills:skillsPage.permissions`),e.allowedTools?.length?e.allowedTools.join(`, `):u(`skills:skillsPage.usesChatToolPermissions`),!!e.allowedTools?.length],[u(`skills:skillsPage.scope`),e.sourceInfo?.scope===`project`?u(`skills:skillsPage.project`):u(`skills:skillsPage.global`),!1],[u(`skills:skillsPage.version`),e.version||`latest`,!0],[u(`skills:skillsPage.source`),e.source||`—`,!0]].map(([e,t,n])=>(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{children:e}),(0,E.jsx)(`dd`,{className:n?`font-mono`:void 0,children:t})]},e))}),(0,E.jsxs)(`fieldset`,{className:`grid min-w-0 gap-0.5`,children:[(0,E.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-content-muted`,children:u(`skills:skillsPage.triggerConditions`)}),[[u(`skills:skillsPage.allowAutomaticModelInvocation`),!!e.modelInvocationEnabled,!1,t=>void Z(e,{modelInvocationEnabled:t})],[u(`skills:skillsPage.supportManualSkillCommand`),!!e.command,!0],[u(`skills:skillsPage.projectScopedSkill`),e.sourceInfo?.scope===`project`,!0],[u(`skills:skillsPage.declaresRequiredTools`),!!e.allowedTools?.length,!0]].map(([e,t,n,r])=>(0,E.jsxs)(`label`,{className:`check-row flex min-h-8 items-center gap-2.5 text-sm text-content has-disabled:text-content-muted max-[650px]:min-h-11`,children:[(0,E.jsx)(ee,{checked:t,disabled:z||n,onCheckedChange:e=>r?.(e===!0)}),(0,E.jsx)(`span`,{children:e})]},e))]}),(0,E.jsx)(`div`,{className:`flex justify-end`,children:e.removable?(0,E.jsxs)(m,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger max-[650px]:h-11`,disabled:z,onClick:()=>void ue(e),children:[(0,E.jsx)(d,{}),u(`skills:skillsPage.uninstallSkill`)]}):(0,E.jsxs)(m,{variant:`secondary`,className:`max-[650px]:h-11`,loading:z,disabled:z,onClick:le,children:[(0,E.jsx)(l,{}),u(`skills:skillsPage.saveSettings`)]})})]}),Q=(e,t,n,r,i=``)=>(0,E.jsx)(x,{className:`skill-scope`,title:e,count:t.length,description:i&&(0,E.jsx)(`span`,{className:`font-mono`,children:i}),children:t.length?(0,E.jsx)(b,{children:t.map(e=>{let t=j(e);return(0,E.jsx)(y,{className:`skill-row`,"data-skill-row":e.id,icon:(0,E.jsx)(t,{}),name:(0,E.jsx)(`span`,{className:`font-mono`,children:e.name}),description:e.description,actions:(0,E.jsx)(w,{value:e.enabled,disabled:z,ariaLabel:u(`skills:skillsPage.toggleSkillName`,{name:e.name}),onChange:t=>void Z(e,{enabled:t})}),expanded:F===e.id,onExpandedChange:t=>I(t?e.id:``),toggleLabel:u(`skills:skillsPage.toggleSkillDetails`,{name:e.name}),detail:de(e)},e.id)})}):(0,E.jsx)(`p`,{className:`skills-empty-copy border-t border-stroke py-3 text-xs leading-normal text-content-muted`,children:n.length?u(`skills:skillsPage.noSkillsMatchTheCurrentFilter`):r})}),$=u(`navigation:navigation.skills`);return(0,E.jsx)(S,{title:$,description:u(`skills:skillsPage.lede`),back:n&&{label:u(`navigation:sidebar.features`),ariaLabel:u(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,E.jsx)(te,{search:(0,E.jsx)(v,{id:p,value:M,onValueChange:ie,placeholder:u(`navigation:pageHeader.searchPage`,{page:$}),shortcut:f,clearLabel:u(`navigation:more.clearSearch`)}),actions:(0,E.jsxs)(m,{type:`button`,className:`h-9`,"data-skills-install":!0,disabled:z||!N,onClick:()=>void K(),children:[(0,E.jsx)(c,{}),u(`navigation:pageHeader.installSkill`)]}),filters:(0,E.jsx)(C,{options:D.map(e=>A(e,u)),value:A(L,u),onChange:e=>R(D.find(t=>A(t,u)===e)||`all`)})}),children:V&&!N?(0,E.jsx)(g,{kind:`loading`,title:u(`skills:skillsPage.loadingSkills`),description:u(`skills:skillsPage.scanningSkillDirectoriesAndConfiguredPackages`)}):N?(0,E.jsxs)(E.Fragment,{children:[U&&(0,E.jsx)(ne,{children:U}),L!==`project`&&Q(u(`skills:skillsPage.globalSkills`),se,ae,u(`skills:skillsPage.noGlobalSkills`),N.locations?.global||`~/.pisper/agent/skills`),L!==`global`&&Q(u(`skills:skillsPage.projectSkills`),ce,oe,u(`skills:skillsPage.noProjectSkills`),N.locations?.project||(N.cwd?`${N.cwd.replace(/[\\/]$/,``)}/.pisper/skills`:``)),(0,E.jsx)(x,{className:`skill-packages`,title:u(`skills:skillsPage.configuredSkillPackages`),count:X.length,children:X.length?(0,E.jsx)(b,{children:X.map(e=>(0,E.jsx)(y,{className:`market-row`,icon:(0,E.jsx)(s,{}),name:(0,E.jsx)(`span`,{className:`font-mono`,title:e.source,children:e.source}),description:e.description,status:e.status},e.source))}):(0,E.jsx)(_,{compact:!0,icon:s,title:u(`skills:skillsPage.noSkillPackagesAreConfiguredYetAfterYouInstallASkillItsSourceWillAppearHere`)})})]}):(0,E.jsx)(g,{kind:`error`,title:u(`skills:skillsPage.loadFailed`),description:U,action:(0,E.jsx)(m,{variant:`secondary`,className:`max-[650px]:h-11`,loading:V,disabled:V,onClick:()=>{H(!0),G()},children:u(`common:pageTemplate.retry`)})})})}export{M as SkillsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./use-i18n-CVZdp2ZN.js";import{t as i}from"./chevron-right-C3t2Rckj.js";import{t as a}from"./square-terminal-BVG6cUT1.js";import{t as o}from"./square-bHHVTT3G.js";import{t as s}from"./checkbox-BrEHgFV0.js";import{n as c,t as l}from"./button-CCcCN8tE.js";import{n as u}from"./PageState-Cz6vFMXv.js";import{t as d}from"./AppSelect-BGVBQRP1.js";import{n as f,r as p}from"./terminal-context-aIsIJPn8.js";var m=e(t(),1),h=n();function g({record:e,follow:t,initialTop:n,onFollow:i,onScroll:a}){let{t:o}=r(),c=(0,m.useRef)(null),l=(0,m.useRef)(n);return(0,m.useLayoutEffect)(()=>{c.current&&(c.current.scrollTop=l.current)},[]),(0,m.useLayoutEffect)(()=>{t&&c.current&&(c.current.scrollTop=c.current.scrollHeight)},[e.output,t]),(0,h.jsxs)(`div`,{className:`border-t border-stroke-soft bg-code px-3 py-2.5`,children:[(0,h.jsxs)(`label`,{className:`mb-2 flex min-h-6 cursor-pointer items-center gap-2 text-xs text-content-muted pointer-coarse:min-h-11`,children:[(0,h.jsx)(s,{checked:t,onCheckedChange:e=>i(e===!0)}),o(`terminal:workspace.follow`)]}),e.truncated&&(0,h.jsx)(`p`,{className:`mb-2 text-xs text-content-muted`,children:o(`terminal:workspace.truncated`)}),(0,h.jsx)(`pre`,{ref:c,tabIndex:0,onWheel:e=>{e.deltaY<0&&i(!1)},onScroll:e=>{let t=e.currentTarget;t.scrollTop+t.clientHeight<t.scrollHeight-4&&i(!1),a(t.scrollTop)},className:`max-h-80 overflow-auto whitespace-pre-wrap break-all font-mono text-xs leading-relaxed text-content-soft focus-visible:-outline-offset-2`,children:e.output||o(`terminal:workspace.noOutput`)})]})}function _({sessionId:e,onOpenTerminal:t,view:n,onViewChange:s}){let{t:_}=r(),v=f(),y=p(e),b=n.filter||`all`,x=new Set(n.expandedProcesses),[S,C]=(0,m.useState)(``);if(!v)return(0,h.jsx)(u,{kind:`empty`,title:_(`terminal:workspace.unavailable`),description:_(`terminal:workspace.nativeOnly`)});let w={starting:_(`terminal:workspace.starting`),running:_(`terminal:workspace.running`),stopping:_(`terminal:workspace.stopping`),exited:_(`terminal:workspace.exited`),error:_(`terminal:workspace.error`)},T=y.filter(e=>b===`all`||e.status===b),E=`max-[650px]:size-11`;return(0,h.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:[(0,h.jsx)(`span`,{className:`min-w-0 flex-1 text-xs text-content-muted`,children:_(`terminal:workspace.ownedProcesses`)}),(0,h.jsxs)(d,{"aria-label":_(`terminal:workspace.filter`),value:b,onChange:e=>s({filter:e.target.value}),className:`w-auto`,children:[(0,h.jsx)(`option`,{value:`all`,children:_(`terminal:workspace.all`)}),Object.entries(w).map(([e,t])=>(0,h.jsx)(`option`,{value:e,children:t},e))]})]}),S&&(0,h.jsx)(`p`,{role:`alert`,className:`p-3 text-sm text-danger`,children:S}),(0,h.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:T.length?T.map(e=>(0,h.jsxs)(`article`,{className:`border-b border-stroke-soft`,children:[(0,h.jsxs)(`div`,{className:`flex min-h-11 min-w-0 items-center gap-2 py-1 pr-1.5 pl-1.5 ${x.has(e.id)?`bg-surface-subtle`:``}`,children:[(0,h.jsx)(l,{variant:`ghost`,size:`icon`,className:E,"aria-expanded":x.has(e.id),"aria-label":_(`terminal:workspace.logs`),onClick:()=>s({expandedProcesses:x.has(e.id)?n.expandedProcesses.filter(t=>t!==e.id):[...n.expandedProcesses,e.id]}),children:(0,h.jsx)(i,{className:`text-content-muted transition-transform duration-(--d-fast) ${x.has(e.id)?`rotate-90`:``}`})}),e.status===`running`||e.status===`starting`?(0,h.jsx)(c,{className:`size-3.5`}):(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-[2px] ${e.status===`error`?`bg-danger`:`bg-content-faint`}`}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`strong`,{className:`block truncate font-mono text-sm font-medium`,children:e.profileId}),(0,h.jsx)(`span`,{className:`block truncate font-mono text-xs text-content-muted`,title:e.cwd,children:e.cwd})]}),(0,h.jsx)(`span`,{className:`shrink-0 text-xs ${e.status===`error`?`text-danger`:`text-content-muted`}`,children:w[e.status]||_(`terminal:workspace.unknown`)}),(0,h.jsx)(l,{variant:`ghost`,size:`icon`,className:E,"aria-label":_(`terminal:workspace.open`),onClick:()=>t(e.id),children:(0,h.jsx)(a,{})}),e.status!==`exited`&&(0,h.jsx)(l,{variant:`ghost`,size:`icon`,className:`${E} hover:text-danger`,disabled:e.status===`stopping`,"aria-label":_(`terminal:workspace.stop`),onClick:()=>{C(``),v.registry.stop(e.id).catch(e=>C(String(e)))},children:(0,h.jsx)(o,{className:`size-3.5`})})]}),e.error&&(0,h.jsx)(`p`,{className:`px-3 pb-2 text-xs text-danger`,children:e.error}),x.has(e.id)&&(0,h.jsx)(g,{record:e,follow:n.processFollow[e.id]!==!1,initialTop:n.processScroll[e.id]||0,onFollow:t=>s({processFollow:{...n.processFollow,[e.id]:t}}),onScroll:t=>s({processScroll:{...n.processScroll,[e.id]:t}})})]},e.id)):(0,h.jsx)(u,{kind:`empty`,title:y.length?_(`terminal:workspace.noMatch`):_(`terminal:workspace.noProcesses`)})})]})}export{_ as TaskProcessesPane};
|