pisper 0.6.19 → 0.6.20
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 +558 -550
- package/web/assets/{AppDialog-Bq_kuweh.js → AppDialog-BKTqwx46.js} +1 -1
- package/web/assets/{AppOverlays-C6-uz2I7.js → AppOverlays-DEYd3Zud.js} +1 -1
- package/web/assets/{AssetsPage-nWK-SI9U.js → AssetsPage-BsIG0e5H.js} +1 -1
- package/web/assets/{BoardPage-BdI3hfz8.js → BoardPage-CgbOwsbF.js} +3 -3
- package/web/assets/{ChannelsPage-CP8J3G-V.js → ChannelsPage-C9eEdxbz.js} +1 -1
- package/web/assets/{ChatAppearancePage-Cr8N98HJ.js → ChatAppearancePage-CBnvknpv.js} +1 -1
- package/web/assets/{ChatHistoryPage-9AWN-55B.js → ChatHistoryPage-Bq-_Qawn.js} +1 -1
- package/web/assets/ChatPage-Bwn6Qfok.js +553 -0
- package/web/assets/{ConfigPage-CU_oPhEG.js → ConfigPage-D44C5I7w.js} +2 -2
- package/web/assets/{DesktopWindowControls-CoqP7BM1.js → DesktopWindowControls-DGhN5dWj.js} +1 -1
- package/web/assets/{FeaturePage-C6kLKix5.js → FeaturePage-B3PLRtEG.js} +1 -1
- package/web/assets/{FileAttachmentPreview-C4qvBJGC.js → FileAttachmentPreview-fSmyWf24.js} +1 -1
- package/web/assets/{FloatingWidgets-DSbRqMGT.js → FloatingWidgets-C1_4vp7k.js} +1 -1
- package/web/assets/{FocusRuntimeControls-DlBh7Vqg.js → FocusRuntimeControls-DraooZz_.js} +1 -1
- package/web/assets/{GitDiffViewer-DGkjG02b.js → GitDiffViewer-XzdYQWbX.js} +1 -1
- package/web/assets/{ManageProjectsDialog-BFiDAKW5.js → ManageProjectsDialog-BlXjm1PQ.js} +1 -1
- package/web/assets/{MarkdownMessage-BiGbYY8R.js → MarkdownMessage-B-IixrQ3.js} +1 -1
- package/web/assets/{McpPage-myrbtgSi.js → McpPage-D0Zmfgbq.js} +1 -1
- package/web/assets/{MemoryPage-BhKLCAgT.js → MemoryPage-DgZ7cL70.js} +1 -1
- package/web/assets/{MobileNavigation-BrLK8gc5.js → MobileNavigation-BIt1CBum.js} +1 -1
- package/web/assets/{MorePage-B6UzpykD.js → MorePage-BZ4iZ1n_.js} +1 -1
- package/web/assets/{NewFolderDialog-CdALMU5C.js → NewFolderDialog-W9wLUVXP.js} +1 -1
- package/web/assets/{PageHeader-CpubVScP.js → PageHeader-DcCyaFp0.js} +1 -1
- package/web/assets/{PhoneDrawer-BapKZhl9.js → PhoneDrawer-B_eKy4tt.js} +1 -1
- package/web/assets/{PhoneMenuButton-WhIGM1zy.js → PhoneMenuButton-CBT0H1Cn.js} +1 -1
- package/web/assets/{PhoneTopBar-CjMeneXU.js → PhoneTopBar-Czpvw2ML.js} +1 -1
- package/web/assets/{PluginsPage-BEpVVSAC.js → PluginsPage-wk5WpJ7Z.js} +1 -1
- package/web/assets/{SafeModePrompt-HogcxEdk.js → SafeModePrompt-Dtq5wVfV.js} +1 -1
- package/web/assets/{SchedulesPage-ML5Sl4S4.js → SchedulesPage-BtRe2Qht.js} +1 -1
- package/web/assets/SessionBrowserPane-D2Z-J6tl.js +2 -0
- package/web/assets/{SessionContextPanel-guilbPz7.js → SessionContextPanel-Cg8AW4l1.js} +2 -2
- package/web/assets/{SessionHome-BLhLJsZO.js → SessionHome-DIpyJQVn.js} +1 -1
- package/web/assets/SessionInspector-DdpBBhNr.js +1 -0
- package/web/assets/{SessionShell-CMGzYCcG.js → SessionShell-ocBFDevg.js} +1 -1
- package/web/assets/{SettingsSidebar-BKdrNAvp.js → SettingsSidebar-CP5t-q0e.js} +1 -1
- package/web/assets/{ShortcutHelpDialog-DgQKobJy.js → ShortcutHelpDialog-BOcP90RU.js} +1 -1
- package/web/assets/{ShortcutKeys-B1HCKuqe.js → ShortcutKeys-CBl2x5Yl.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-DtpsclSa.js → SidebarUpdateStatus-CqZx7khD.js} +1 -1
- package/web/assets/{SkillsPage-JwfOUart.js → SkillsPage-BGyMMq-9.js} +1 -1
- package/web/assets/{TaskProcessesPane-CUUFhziU.js → TaskProcessesPane-B43p2Dvr.js} +1 -1
- package/web/assets/{TaskTerminalView-BgxdaUIZ.js → TaskTerminalView-BMjmp-4_.js} +1 -1
- package/web/assets/{TerminalPanel-B4VMm8q_.js → TerminalPanel-CH2-Yc1F.js} +1 -1
- package/web/assets/{WebDesktopPet-C10BvWBl.js → WebDesktopPet-Fy9xj1bh.js} +1 -1
- package/web/assets/{WorkflowsPage-iqO_9OJO.js → WorkflowsPage-DvZsyJSV.js} +1 -1
- package/web/assets/{WorkspacePicker-C0t_ekAf.js → WorkspacePicker-LbBXFH77.js} +1 -1
- package/web/assets/{api-Dg-aNpVe.js → api-m-Yq8n0q.js} +1 -1
- package/web/assets/{app-update-8hmqlQl6.js → app-update-DVn3toIR.js} +1 -1
- package/web/assets/{approval-confirm-77ZLTNZI.js → approval-confirm-Ch86qdyC.js} +1 -1
- package/web/assets/{board-projects-CnDn05fw.js → board-projects-KHcPQYWz.js} +1 -1
- package/web/assets/bots-store-BMcWJ2Gm.js +1 -0
- package/web/assets/{chat-api-Dy5Hkicx.js → chat-api-DgJdhfOP.js} +1 -1
- package/web/assets/{client-store-DF9a8Ka9.js → client-store-BkVlLM-4.js} +1 -1
- package/web/assets/{config-search-BA9qWX5h.js → config-search-BqYT_Xre.js} +1 -1
- package/web/assets/{dialog-CtFjznlx.js → dialog-5MLAAE-f.js} +1 -1
- package/web/assets/{events-D0dbOYFR.js → events-B0F69Vd3.js} +1 -1
- package/web/assets/{folder-paths-DEFkIxr2.js → folder-paths-CdOS1VLF.js} +1 -1
- package/web/assets/{hosts-BBCDdN-M.js → hosts-CoGHAtF9.js} +1 -1
- package/web/assets/i18n-Du-JO3Qx.js +1 -0
- package/web/assets/index-BY7X-ZtU.css +2 -0
- package/web/assets/{index-DsXdZRdL.js → index-DmohsuQg.js} +2 -2
- package/web/assets/{mount-app-BDzqFalE.js → mount-app-Cr5Uq-cP.js} +3 -3
- package/web/assets/{permission-rules-api-CPImVuda.js → permission-rules-api-CAxfABVR.js} +1 -1
- package/web/assets/{pick-system-directory-B1clvHS6.js → pick-system-directory-ByTVOp-v.js} +1 -1
- package/web/assets/{placements-DNdBLaY4.js → placements-CuVM9Xxs.js} +2 -2
- package/web/assets/{popover-DN1mndHQ.js → popover-DUWwlhPy.js} +1 -1
- package/web/assets/{public-Cec32eBv.js → public-B00uoqCB.js} +2 -2
- package/web/assets/{public-CNoWpIiC.js → public-CGbDaxd0.js} +1 -1
- package/web/assets/public-CWbnixwI.js +3 -0
- package/web/assets/{public-components-BpHOXPbD.js → public-components-DGfACSCk.js} +1 -1
- package/web/assets/public-diff-DIMQ2JTm.js +1 -0
- package/web/assets/public-events-CxK6EdoY.js +1 -0
- package/web/assets/{public-flags-BYEBqRMd.js → public-flags-BRenaSzJ.js} +1 -1
- package/web/assets/public-session-BeSwdD6a.js +1 -0
- package/web/assets/public-sidebar-CAWnINZG.js +1 -0
- package/web/assets/{runtime-capabilities-store-B5Bam7pC.js → runtime-capabilities-store-DWW9jolt.js} +1 -1
- package/web/assets/{safe-mode-instance-CJE36ukZ.js → safe-mode-instance-65Kg_IPn.js} +1 -1
- package/web/assets/safe-mode-sentinel-CIemi_6b.js +1 -0
- package/web/assets/{session-change-summary-api-CTAw_Fpq.js → session-change-summary-api-CbVgbX2o.js} +1 -1
- package/web/assets/{session-home-BrU5Pj9S.js → session-home-LwsMdqJu.js} +1 -1
- package/web/assets/{session-organization-api-I4CSVACP.js → session-organization-api-BmX-aNPa.js} +1 -1
- package/web/assets/{session-scope-7eIXCeDX.js → session-scope-Bz6CeMq0.js} +1 -1
- package/web/assets/{session-tree-actions-CnUc7KFV.js → session-tree-actions-BLL1s_Ws.js} +1 -1
- package/web/assets/{session-tree-summary-C224W_G6.js → session-tree-summary-BfRtAGwx.js} +1 -1
- package/web/assets/{shortcuts-LBxOVau1.js → shortcuts-Cgx6V2jI.js} +1 -1
- package/web/assets/side-chat-context-Cm84nqzk.js +7 -0
- package/web/assets/{sidebar-rMS3pmrQ.js → sidebar-C0AjfIUc.js} +1 -1
- package/web/assets/{sidebar-store-BGW5sD2q.js → sidebar-store-BhEocW8t.js} +1 -1
- package/web/assets/{speech-session-DTzw8niM.js → speech-session-BI_qH5Lw.js} +1 -1
- package/web/assets/{startup-queries-qM8tclDJ.js → startup-queries-Cevfi-_Z.js} +1 -1
- package/web/assets/{use-i18n-BuN5i-jP.js → use-i18n-Cyg5th6Z.js} +1 -1
- package/web/assets/{use-open-bot-J8_CcQDt.js → use-open-bot-HoswiH7t.js} +1 -1
- package/web/assets/{use-studio-actions-kEfc-Vr2.js → use-studio-actions-CGzcb2Fx.js} +1 -1
- package/web/assets/{useCatalogProjects-MO_MVlJu.js → useCatalogProjects-hKlUioWa.js} +1 -1
- package/web/assets/{useNewProjectPicker-B5OQ8T-2.js → useNewProjectPicker-C9X_vJdU.js} +2 -2
- package/web/assets/{useNow-ChT5op7P.js → useNow-BBVE-LCR.js} +1 -1
- package/web/assets/{usePhoneShell-Bkus67DO.js → usePhoneShell-CDP-O4Gc.js} +1 -1
- package/web/assets/{useSessionListQuery-DdFrJGiI.js → useSessionListQuery-BpWfS-tU.js} +1 -1
- package/web/assets/{useSessionRowActions-CTYVP4el.js → useSessionRowActions-Dd5ulVpS.js} +1 -1
- package/web/assets/{useSidebarModel-BdWaL9Nn.js → useSidebarModel-uxFT2LRy.js} +1 -1
- package/web/assets/{web-preview-DUIdcsL2.js → web-preview-Bo8YMR-t.js} +1 -1
- package/web/assets/{web-preview-events-4X_JU_UG.js → web-preview-events-DIPJR6oR.js} +1 -1
- package/web/assets/{workspace-order-store-DlMf7MI6.js → workspace-order-store-DshLVZf8.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/ChatPage-Bl94kmVS.js +0 -553
- package/web/assets/SessionBrowserPane-DOmbqdHK.js +0 -2
- package/web/assets/SessionInspector-DewgkKy9.js +0 -1
- package/web/assets/bots-store-DE76fA7-.js +0 -1
- package/web/assets/i18n-CyyEaQdX.js +0 -1
- package/web/assets/index-C13rJGuY.css +0 -2
- package/web/assets/public-CUO7iS84.js +0 -3
- package/web/assets/public-diff-A9crjZfM.js +0 -1
- package/web/assets/public-events-iJAi2TnD.js +0 -1
- package/web/assets/public-session-DM4y_qrY.js +0 -1
- package/web/assets/public-sidebar-Ce5o13yN.js +0 -1
- package/web/assets/safe-mode-sentinel-AmgPcPSa.js +0 -1
- package/web/assets/side-chat-context-hRj7FqXK.js +0 -7
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GitDiffViewer-DGkjG02b.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-BuN5i-jP.js","assets/i18n-CyyEaQdX.js","assets/vendor-router-CSN_DGvx.js","assets/index-DsXdZRdL.js","assets/index-C13rJGuY.css","assets/storage-8QW6lXuT.js","assets/vendor-state-GkUciC5H.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/x-07u4-129.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/button-CCcCN8tE.js","assets/dist-41X0pdUs.js","assets/events-D0dbOYFR.js","assets/esm-DCV8yILT.js","assets/TaskTerminalView-BgxdaUIZ.js","assets/square-terminal-BVG6cUT1.js","assets/square-bHHVTT3G.js","assets/PageState-Cz6vFMXv.js","assets/AppSelect-BD6RAaJ5.js","assets/use-mobile-C2tPBAza.js","assets/select-DD_WO-gs.js","assets/check-2vYc6QaP.js","assets/chevron-down-CxtxIjiP.js","assets/chevron-up-D_ZcXjqr.js","assets/dist-V8chnW6-.js","assets/dist-BsRXXcSL.js","assets/dist-BiRPwy4W.js","assets/dist-DzGQ7sLi.js","assets/es2015-DTZdOI9P.js","assets/dist-BRjj4UeB.js","assets/dist-OB2r6Xsr.js","assets/terminal-context-aIsIJPn8.js","assets/TaskTerminalView-BrP-ENHg.css","assets/TaskProcessesPane-CUUFhziU.js","assets/chevron-right-C3t2Rckj.js","assets/checkbox-BrEHgFV0.js","assets/FileAttachmentPreview-C4qvBJGC.js","assets/api-Dg-aNpVe.js","assets/abort-signal-f4JsiYKX.js","assets/download-BCfIiuaL.js","assets/file-Bllajneu.js","assets/refresh-cw-TbWxTY4K.js","assets/tabs-DsgBuvJv.js","assets/dist-BaBySQmo.js","assets/format-DMJQzoZ7.js","assets/dialog-CtFjznlx.js","assets/dist-BHkR6BLP.js","assets/MarkdownMessage-BiGbYY8R.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/copy-DHmIFc52.js","assets/route-context-DvWDul4T.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,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-BuN5i-jP.js";import{t as a}from"./useQuery-DdcpUQhO.js";import{t as o}from"./createLucideIcon-Cd-3GVxJ.js";import{t as s}from"./arrow-up-DST6-qVQ.js";import{t as c}from"./check-2vYc6QaP.js";import{t as l}from"./chevron-down-CxtxIjiP.js";import{t as u}from"./chevron-right-C3t2Rckj.js";import{t as d}from"./earth-Ddy13fHh.js";import{t as f}from"./external-link-CEQqPcqc.js";import{i as p}from"./GitDiffViewer-DGkjG02b.js";import{t as m}from"./file-Bllajneu.js";import{M as h,a as g,i as _,l as v,m as y,o as b,p as x,r as S}from"./side-chat-context-hRj7FqXK.js";import{t as C}from"./git-branch-N7LGjtzt.js";import{t as w}from"./image-BY_c3FYU.js";import{t as T}from"./link-2-mgasYn21.js";import{t as E}from"./message-square-SKjZyY3v.js";import{t as D}from"./refresh-cw-TbWxTY4K.js";import{t as O}from"./square-bHHVTT3G.js";import"./tooltip-D4MFbqcG.js";import{t as k}from"./utils-C8uzG5AZ.js";import{n as A,t as j}from"./button-CCcCN8tE.js";import{c as M,r as ee}from"./shortcuts-LBxOVau1.js";import{t as N}from"./chat-api-Dy5Hkicx.js";import{t as P}from"./input-CPw-zkYh.js";import{n as F}from"./session-change-summary-api-CTAw_Fpq.js";import{n as I,t as L}from"./PageState-Cz6vFMXv.js";import{t as R}from"./AppSelect-BD6RAaJ5.js";import{t as z}from"./web-preview-DUIdcsL2.js";import"./collapsible-Dcoy-qnz.js";import{o as B}from"./session-tree-summary-C224W_G6.js";var te=o(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),V=o(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),H=o(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),U=e(n(),1),W=r(),G={completed:`completed`,in_progress:`running`,blocked:`blocked`,pending:`pending`};function K(e){let t=new Map(e.map(e=>[String(e.id||``),e])),n=e=>e?.status===`completed`;return e.map(e=>{let r=String(e.id||``),i=(Array.isArray(e.dependsOn)?e.dependsOn:[]).map(e=>t.get(String(e))).filter(e=>!!e&&!n(e)),a=e.status!==`completed`&&(e.status===`blocked`||i.length>0);return{...e,id:r,blocked:a,blockedBy:i}})}function q({status:e,t}){let n=t(e===`completed`?`chat:planBoard.completed`:e===`in_progress`?`chat:planBoard.inProgress`:e===`blocked`?`chat:planBoard.blocked`:`chat:planBoard.pending`);return(0,W.jsxs)(`span`,{className:`plan-board-status grid size-[18px] flex-none place-items-center rounded-xs text-content-muted [&.completed]:bg-success-soft [&.completed]:text-success [&.running]:text-accent-fg [&.blocked]:bg-danger-soft [&.blocked]:text-danger ${G[String(e)]||`pending`}`,title:n,children:[e===`completed`?(0,W.jsx)(c,{size:12,strokeWidth:2.25}):e===`in_progress`?(0,W.jsx)(A,{className:`size-3.5`}):e===`blocked`?(0,W.jsx)(H,{size:11,strokeWidth:2}):(0,W.jsx)(te,{size:11,strokeWidth:2}),(0,W.jsx)(`span`,{className:`sr-only`,children:n})]})}function J({item:e,current:t,t:n}){return(0,W.jsxs)(`li`,{className:`plan-board-row flex min-w-0 flex-col gap-[2px] rounded-sm px-[6px] py-[6px] aria-[current=step]:bg-surface-subtle ${e.blocked?`blocked`:``}`,"aria-current":t?`step`:void 0,"data-pisper-plan-current":t?`true`:void 0,"data-pisper-plan-id":e.id,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-[10px]`,children:[(0,W.jsx)(q,{status:e.blocked?`blocked`:e.status,t:n}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${e.status===`completed`?`text-content-muted`:`text-foreground`}`,title:e.title,children:e.title}),e.assignee?(0,W.jsxs)(`span`,{className:`inline-flex max-w-[40%] flex-none items-center gap-[4px] truncate rounded-xs border border-stroke px-[6px] font-mono text-[12px] leading-[18px] text-content-secondary`,title:n(`chat:planBoard.assignedTo`,{name:e.assignee}),children:[(0,W.jsx)(h,{size:11,className:`flex-none`}),e.assignee]}):e.status!==`completed`&&(0,W.jsx)(`span`,{className:`flex-none text-[12px] text-content-muted`,children:n(`chat:planBoard.unassigned`)})]}),e.blockedBy.length>0&&(0,W.jsxs)(`div`,{className:`inline-flex min-w-0 items-center gap-[5px] pl-[28px] text-[12px] text-content-muted`,children:[(0,W.jsx)(H,{size:11,className:`flex-none`}),(0,W.jsx)(`span`,{className:`truncate`,children:n(`chat:planBoard.waitingFor`,{tasks:e.blockedBy.map(e=>e.title||e.id).join(` · `)})})]})]})}function Y({plan:e,header:t,collapsible:n=!1}){let{t:r}=i(),a=(0,U.useRef)(null),[o,s]=(0,U.useState)(!0),c=e?.items||[],u=K(c),d=u.filter(e=>e.status===`completed`).length,f=u.filter(e=>e.status===`in_progress`&&!e.blocked).length,p=u.filter(e=>e.blocked).length,m=u.find(e=>e.status===`in_progress`&&!e.blocked)?.id??u.find(e=>e.blocked)?.id??u.find(e=>e.status===`pending`)?.id??u.at(-1)?.id;if((0,U.useLayoutEffect)(()=>{if(n&&!o)return;let e=a.current,t=e?.querySelector(`[data-pisper-plan-current="true"]`);if(!e||!t)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();i.top<r.top?e.scrollTop-=r.top-i.top:i.bottom>r.bottom&&(e.scrollTop+=i.bottom-r.bottom)},[n,m,o,u.length]),!c.length)return null;let h=u.find(e=>e.id===m),g=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(V,{className:`flex-none text-content-muted`,size:15}),(0,W.jsx)(`strong`,{className:`tabular-nums`,children:r(`chat:planBoard.progress`,{completed:d,total:c.length})}),h?(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-content-secondary`,title:h.title,children:h.title}):null,(0,W.jsxs)(`span`,{className:`plan-board-counts inline-flex flex-none items-center gap-[8px] text-content-muted tabular-nums @max-[470px]:hidden`,children:[f>0&&(0,W.jsx)(`span`,{children:r(`chat:planBoard.countInProgress`,{count:f})}),p>0&&(0,W.jsx)(`span`,{className:`blocked text-danger`,children:r(`chat:planBoard.countBlocked`,{count:p})})]}),t,n?(0,W.jsx)(l,{className:`plan-board-chevron flex-none text-content-muted transition-transform duration-(--d-fast) ease-precise [.plan-board-collapsible[open]_&]:rotate-180`,size:15}):null]}),_=(0,W.jsx)(`ul`,{ref:a,className:`plan-board-list [.plan-board-collapsible_>_&]:border-t [.plan-board-collapsible_>_&]:border-stroke-soft [.plan-board-collapsible_>_&]:p-[6px_8px_8px] m-0 flex list-none flex-col gap-[1px] pt-[6px]${u.length>4?` is-scrollable [.session-plan-popover_.plan-board-list&]:[block-size:min(250px,38dvh)] [.plan-board-list&]:[block-size:min(220px,34dvh)] [.plan-board-list&]:overflow-y-auto [.plan-board-list&]:[overscroll-behavior:contain] [.plan-board-list&]:pr-[4px] [.plan-board-list&]:[scrollbar-gutter:stable] [.plan-board-list&:focus-visible]:outline-2 [.plan-board-list&:focus-visible]:outline-focus [.plan-board-list&:focus-visible]:outline-offset-2`:``}`,tabIndex:u.length>4?0:void 0,children:u.map(e=>(0,W.jsx)(J,{item:e,current:e.id===m,t:r},e.id))});return n?(0,W.jsxs)(`details`,{className:`plan-board plan-board-collapsible m-[0_auto] flex w-[min(900px,100%)] flex-col overflow-hidden rounded-md border border-stroke bg-panel !p-0 [.session-plan-popover_&]:w-full [.session-plan-popover_&]:border-0 [.session-plan-popover_&]:bg-transparent`,open:o,onToggle:e=>s(e.currentTarget.open),children:[(0,W.jsx)(`summary`,{className:`plan-board-summary flex min-w-0 items-center gap-[8px] border-b border-stroke-soft pb-[8px] text-[13px] text-content-secondary [&_strong]:flex-none [&_strong]:font-medium [&_strong]:text-foreground [.plan-board-collapsible_>_&]:min-h-[34px] [.plan-board-collapsible_>_&]:cursor-pointer [.plan-board-collapsible_>_&]:list-none [.plan-board-collapsible_>_&]:border-0 [.plan-board-collapsible_>_&]:p-[6px_12px] max-[650px]:[.plan-board-collapsible_>_&]:min-h-11 [.plan-board-collapsible_>_&::-webkit-details-marker]:hidden [.plan-board-collapsible_>_&:hover]:bg-surface-subtle [.plan-board-collapsible_>_&:focus-visible]:outline-2 [.plan-board-collapsible_>_&:focus-visible]:-outline-offset-2 [.plan-board-collapsible_>_&:focus-visible]:outline-focus`,"aria-label":r(`chat:planBoard.toggleAriaLabel`),children:g}),_]}):(0,W.jsxs)(`section`,{className:`plan-board m-[0_auto] flex w-[min(900px,100%)] flex-col rounded-md border border-stroke bg-panel p-[10px_12px] [.session-plan-popover_&]:w-full [.session-plan-popover_&]:border-0 [.session-plan-popover_&]:bg-transparent [.session-plan-popover_&]:p-0`,"aria-label":r(`chat:planBoard.ariaLabel`),children:[(0,W.jsx)(`div`,{className:`plan-board-summary flex min-w-0 items-center gap-[8px] border-b border-stroke-soft pb-[8px] text-[13px] text-content-secondary [&_strong]:flex-none [&_strong]:font-medium [&_strong]:text-foreground [.plan-board-collapsible_>_&]:min-h-[34px] [.plan-board-collapsible_>_&]:cursor-pointer [.plan-board-collapsible_>_&]:list-none [.plan-board-collapsible_>_&]:border-0 [.plan-board-collapsible_>_&]:p-[6px_12px] max-[650px]:[.plan-board-collapsible_>_&]:min-h-11 [.plan-board-collapsible_>_&::-webkit-details-marker]:hidden [.plan-board-collapsible_>_&:hover]:bg-surface-subtle [.plan-board-collapsible_>_&:focus-visible]:outline-2 [.plan-board-collapsible_>_&:focus-visible]:-outline-offset-2 [.plan-board-collapsible_>_&:focus-visible]:outline-focus`,children:g}),_]})}var X=(0,U.memo)(Y),ne=(0,U.lazy)(()=>t(()=>import(`./GitDiffViewer-DGkjG02b.js`).then(e=>e.n).then(e=>({default:e.InlineGitDiff})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])));function Z({sessionId:e,path:t,scope:n,revision:r=0,position:o,onReading:s,mode:c,fill:l=!1}){let{t:u}=i(),d=a({queryKey:[`task-file-diff`,e,n,t,r],queryFn:({signal:r})=>n===`project`?N.getFileDiff(e,t,{signal:r}):N.getSessionFileChangeDiff(e,t,{signal:r})});return d.isPending?(0,W.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 px-3 py-2.5 text-xs text-content-muted`,children:[(0,W.jsx)(A,{className:`size-3.5`}),u(`chat:focusSession.gitLoading`)]}):d.isError?(0,W.jsxs)(`div`,{className:`px-3 py-2.5`,children:[(0,W.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:d.error.message}),(0,W.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void d.refetch(),children:u(`chat:chatMessage.filePreviewRetry`)})]}):(0,W.jsx)(U.Suspense,{fallback:null,children:(0,W.jsx)(ne,{position:o,onReading:s,diff:d.data.diff,truncated:d.data.diffTruncated,mode:c,fill:l})})}function re({sessionId:e,cwd:t,streaming:n,view:r,onViewChange:o}){let{t:s}=i(),c=a({queryKey:[`task-project-changes`,e,t,n],queryFn:({signal:t})=>N.getVcsChanges(e,{signal:t})}),l=p(r.reading?.list,e=>o({reading:{...r.reading,list:e}})),d=(0,U.useMemo)(()=>x(c.data?.diff||``,c.data?.files.map(e=>e.path)||[],c.data?.diffTruncated),[c.data]),f=r.expandedFiles.filter(e=>c.data&&!c.data.files.some(t=>t.path===e)),m=c.error?.message||c.data?.error,h=c.data?.files||[];return(0,W.jsxs)(`section`,{"aria-label":s(`chat:workbench.projectChanges`),className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`header`,{className:`flex min-h-10 min-w-0 shrink-0 items-center gap-2 border-b border-stroke-soft pr-1.5 pl-3`,children:[(0,W.jsx)(`h2`,{className:`min-w-0 flex-1 truncate text-xs font-medium tracking-[.02em] text-content-muted`,children:s(`chat:workbench.projectChanges`)}),c.data?.isRepo&&!m&&(0,W.jsxs)(`span`,{className:`shrink-0 font-mono text-xs tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,d.added]}),` `,(0,W.jsxs)(`span`,{className:`text-danger`,children:[`−`,d.removed]})]}),(0,W.jsx)(j,{variant:`ghost`,size:`icon`,className:`max-[650px]:size-11`,"aria-label":s(`chat:focusSession.gitRefresh`),disabled:c.isFetching,onClick:()=>void c.refetch(),children:(0,W.jsx)(D,{size:15,className:c.isFetching?`animate-spin`:void 0})})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-stroke-soft px-3 py-2.5`,children:[(0,W.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:s(`chat:workbench.projectScope`)}),(0,W.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs`,title:t,children:[c.data?.branch&&(0,W.jsxs)(`span`,{className:`inline-flex h-5.5 max-w-[45%] shrink-0 items-center gap-1 rounded-xs border border-stroke px-1.5 font-mono text-content-secondary`,children:[(0,W.jsx)(C,{size:12,className:`shrink-0`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`truncate`,children:c.data.branch})]}),(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-content-muted`,children:t})]}),(0,W.jsxs)(`div`,{className:`flex gap-1`,children:[(0,W.jsx)(j,{variant:`ghost`,size:`sm`,disabled:!h.length||!!m,onClick:()=>o({expandedFiles:h.map(e=>e.path)}),children:s(`chat:workbench.expandAll`)}),(0,W.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>o({expandedFiles:[]}),children:s(`chat:workbench.collapseAll`)})]})]}),!c.isFetching&&!m&&f.map(e=>(0,W.jsx)(`p`,{role:`status`,className:`break-all px-3 pt-2 text-xs text-content-muted`,children:s(`chat:workbench.fileNoLongerChanged`,{path:e})},e)),c.isPending?(0,W.jsx)(I,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):m?(0,W.jsx)(`p`,{role:`alert`,className:`p-3 text-sm text-danger`,children:m}):c.data?.isRepo?h.length?(0,W.jsx)(`div`,{ref:l.ref,className:`min-h-0 flex-1 overflow-y-auto`,children:h.map(t=>{let n=r.expandedFiles.includes(t.path);return(0,W.jsxs)(`article`,{className:`border-b border-stroke-soft`,children:[(0,W.jsxs)(`button`,{"aria-expanded":n,title:t.path,className:`flex min-h-9 w-full min-w-0 items-center gap-2 pr-3 pl-2 text-left text-sm hover:bg-surface-subtle focus-visible:-outline-offset-2 max-[650px]:min-h-11 pointer-coarse:min-h-11 ${n?`bg-surface-subtle`:``}`,onClick:()=>o({expandedFiles:n?r.expandedFiles.filter(e=>e!==t.path):[...r.expandedFiles,t.path]}),children:[(0,W.jsx)(u,{size:14,className:`shrink-0 text-content-muted transition-transform duration-(--d-fast) ${n?`rotate-90`:``}`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:t.path}),(0,W.jsx)(`span`,{className:`min-w-4 shrink-0 text-center font-mono text-xs font-medium text-content-secondary`,children:t.status}),Object.hasOwn(d.files,t.path)&&(0,W.jsxs)(`span`,{className:`shrink-0 font-mono text-xs tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,d.files[t.path].added]}),` `,(0,W.jsxs)(`span`,{className:`text-danger`,children:[`−`,d.files[t.path].removed]})]})]}),n&&(0,W.jsx)(`p`,{className:`break-all px-3 py-1.5 font-mono text-xs text-content-muted`,children:t.path}),n&&(0,W.jsx)(Z,{sessionId:e,path:t.path,scope:`project`,position:r.reading?.[t.path],onReading:e=>o({reading:{...r.reading,[t.path]:e}}),revision:c.dataUpdatedAt})]},t.path)})}):(0,W.jsx)(L,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}):(0,W.jsx)(L,{compact:!0,title:s(`chat:workbench.notRepository`)})]})}function Q(e){return e instanceof Error?e.message:String(e)}function ie({sessionId:e,streaming:t,requestConfirm:n}){let{t:r}=i(),[a,o]=(0,U.useState)(0),[s,c]=(0,U.useState)(0),[l,u]=(0,U.useState)(null),[d,f]=(0,U.useState)(!0),[p,m]=(0,U.useState)(``),[h,g]=(0,U.useState)(``),[_,v]=(0,U.useState)(``),[y,b]=(0,U.useState)(null),[x,S]=(0,U.useState)(null),[C,w]=(0,U.useState)(null),T=(0,U.useRef)(!1),E=(0,U.useRef)(0),D=(0,U.useRef)(0),O=(0,U.useRef)(!0),k=(0,U.useRef)(!1),A=(0,U.useRef)(t);return(0,U.useLayoutEffect)(()=>{A.current=t},[t]),(0,U.useLayoutEffect)(()=>(T.current=!0,()=>{T.current=!1,E.current+=1,D.current+=1}),[]),(0,U.useEffect)(()=>{let t=++E.current;return D.current+=1,S(null),w(null),O.current=!0,f(!0),m(``),N.getSessionFileChanges(e).then(e=>{T.current&&t===E.current&&(u(e),c(e=>e+1))},e=>{T.current&&t===E.current&&m(Q(e))}).finally(()=>{T.current&&t===E.current&&(O.current=!1,f(!1))}),()=>{E.current+=1}},[a,e,t]),{changes:l,loading:d,error:p,actionError:h,notice:_,running:y,diff:x,setDiff:S,diffLoading:C,snapshotRevision:s,writesDisabled:d||t||!!y||!!p||!l,pendingCount:l?.summary.pending||0,reversibleCount:l?.files.filter(e=>e.canRevert&&!e.reverted).length||0,displayedError:h||p,viewDiff:async t=>{if(k.current||O.current)return;let n=++D.current;w(t),g(``);try{let i=await N.getSessionFileChangeDiff(e,t);if(!T.current||n!==D.current)return;if(!i.diff?.trim()){g(r(`chat:focusSession.fileChangesNoSnapshot`));return}S({diff:i.diff,truncated:!!i.diffTruncated})}catch(e){T.current&&n===D.current&&g(Q(e))}finally{T.current&&n===D.current&&w(null)}},runAction:async t=>{if(!T.current||k.current||O.current||A.current||!l||p||!l.files.filter(e=>t.kind===`approve`?e.pending&&!e.approved&&!e.reverted:e.canRevert&&!e.reverted).some(e=>t.path===void 0||e.path===t.path))return;k.current=!0,b(t),g(``),v(``);let i=++E.current;D.current+=1,S(null),w(null);let a=!1;try{if(t.kind===`revert`&&!await n({title:t.path?r(`chat:focusSession.fileChangesRevertFile`):r(`chat:focusSession.fileChangesRevertAll`),message:t.path?r(`chat:focusSession.fileChangesRevertFileDescription`,{path:t.path}):r(`chat:focusSession.fileChangesRevertAllDescription`),confirmLabel:r(`chat:focusSession.fileChangesConfirmRevert`),tone:`danger`})||!T.current||A.current||O.current||i!==E.current)return;a=!0;let o=t.kind===`approve`?await N.approveSessionFileChanges(e,t.path):await N.revertSessionFileChanges(e,t.path);if(F(e),!T.current||i!==E.current)return;u(o),t.kind===`approve`?v(t.path?r(`chat:focusSession.fileChangesApproved`):r(`chat:focusSession.fileChangesApproveDone`)):o.reverted?t.path===void 0&&o.files.some(e=>e.pending)?v(r(`chat:focusSession.fileChangesRevertPartial`,{count:o.reverted})):v(r(`chat:focusSession.fileChangesRevertDone`)):v(r(`chat:focusSession.fileChangesRevertUnavailable`))}catch(e){T.current&&i===E.current&&g(Q(e))}finally{k.current=!1,T.current&&(b(null),a&&(O.current=!0,f(!0),o(e=>e+1)))}},refresh:()=>{O.current=!0,f(!0),g(``),o(e=>e+1)}}}var ae=(0,U.lazy)(()=>t(()=>import(`./TaskTerminalView-BgxdaUIZ.js`).then(e=>({default:e.TaskTerminalView})),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,19,10,20,14,13,15,12,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]))),oe=(0,U.lazy)(()=>t(()=>import(`./TaskProcessesPane-CUUFhziU.js`).then(e=>({default:e.TaskProcessesPane})),__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,38,10,19,20,39,25,15,29,34,12,13,14,21,22,23,24,26,27,28,30,31,32,33,35]))),se=(0,U.lazy)(()=>t(()=>import(`./FileAttachmentPreview-C4qvBJGC.js`).then(e=>e.n).then(e=>({default:e.FileAttachmentPreview})),__vite__mapDeps([40,1,2,3,4,5,6,7,8,9,41,42,43,10,44,45,11,46,13,29,15,31,47,12,14,48,49,50,32,51,52,53,54,55,25,56,57])));function ce({sources:e,view:t,onViewChange:n}){let{t:r}=i(),a=p(t.reading?.list,e=>n({reading:{...t.reading,list:e}})),o=(0,U.useContext)(y),[s,c]=(0,U.useState)(``),l=(0,U.useRef)(null),d=e.find(e=>e.id===s),f=e.filter(e=>(!t.filter||e.kind===t.filter)&&e.name.toLocaleLowerCase().includes(t.query.toLocaleLowerCase()));return(0,W.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":r(`chat:workbench.sources`),children:[(0,W.jsxs)(`header`,{className:`flex min-h-10 min-w-0 shrink-0 items-center gap-2 border-b border-stroke-soft pr-1.5 pl-3`,children:[(0,W.jsxs)(`h2`,{className:`min-w-0 flex-1 truncate text-xs font-medium tracking-[.02em] text-content-muted`,children:[r(`chat:workbench.sources`),(0,W.jsx)(`span`,{className:`ml-1.5 tabular-nums`,children:e.length})]}),(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-content-muted`,children:r(`chat:workbench.addSource`)}),(0,W.jsx)(`div`,{ref:o?.setSourceActionHost,className:`grid min-h-7 min-w-7 place-items-center`})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-stroke-soft px-3 py-2.5`,children:[(0,W.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:r(`chat:workbench.sourcesScope`)}),(0,W.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,W.jsx)(P,{className:`min-w-0 flex-1`,"aria-label":r(`chat:workbench.searchSources`),placeholder:r(`chat:workbench.searchSources`),value:t.query,onChange:e=>n({query:e.target.value})}),(0,W.jsxs)(R,{"aria-label":r(`chat:workbench.sourceType`),className:`w-auto max-w-[45%] shrink-0`,value:t.filter,onChange:e=>n({filter:e.target.value}),children:[(0,W.jsx)(`option`,{value:``,children:r(`chat:workbench.allTypes`)}),(0,W.jsx)(`option`,{value:`image`,children:r(`chat:workbench.images`)}),(0,W.jsx)(`option`,{value:`text`,children:r(`chat:workbench.text`)}),(0,W.jsx)(`option`,{value:`file`,children:r(`chat:workbench.files`)})]})]})]}),(0,W.jsxs)(`div`,{ref:a.ref,className:`min-h-0 flex-1 overflow-y-auto`,children:[!f.length&&(0,W.jsx)(L,{compact:!0,title:e.length?r(`chat:workbench.noMatches`):r(`chat:workbench.noSources`)}),f.map(e=>{let i=t.selectedSourceId===e.id,a=e.kind===`image`?w:e.method===`path`?T:m;return(0,W.jsxs)(`article`,{className:`border-b border-stroke-soft`,children:[(0,W.jsxs)(`button`,{className:`flex min-h-9 w-full min-w-0 items-center gap-2 px-2 text-left hover:bg-surface-subtle focus-visible:-outline-offset-2 max-[650px]:min-h-11 pointer-coarse:min-h-11 ${i?`bg-surface-subtle`:``}`,"aria-expanded":i,onClick:()=>n({selectedSourceId:i?``:e.id}),children:[(0,W.jsx)(u,{size:14,className:`shrink-0 text-content-muted transition-transform duration-(--d-fast) ${i?`rotate-90`:``}`}),(0,W.jsx)(a,{className:`size-3.5 shrink-0 text-content-muted`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e.name||r(`chat:chatMessage.fileAttachment`)})]}),i&&(0,W.jsxs)(`div`,{className:`space-y-1.5 border-t border-stroke-soft bg-code py-2.5 pr-3 pl-8 text-xs text-content-muted`,children:[(0,W.jsx)(`p`,{className:`break-all font-mono text-content-secondary`,children:e.attachment.path||e.attachment.id||r(`chat:workbench.unavailable`)}),(0,W.jsx)(`p`,{className:`font-mono`,children:e.attachment.mimeType||`application/octet-stream`}),(0,W.jsx)(`p`,{children:e.method===`asset`?r(`chat:workbench.registeredAsset`):e.method===`path`?r(`chat:workbench.pathReference`):r(`chat:workbench.invalidReference`)}),(0,W.jsx)(j,{variant:`secondary`,size:`sm`,className:`mt-1`,disabled:!e.available,onClick:t=>{l.current=t.currentTarget,c(e.id)},children:r(`chat:chatMessage.fileActionPreview`)})]})]},e.id)})]}),d&&(0,W.jsx)(U.Suspense,{fallback:null,children:(0,W.jsx)(se,{attachment:d.attachment,onClose:()=>c(``),onRestoreFocus:()=>l.current?.focus(),onDownload:()=>{typeof d.attachment.downloadUrl==`string`&&window.open(d.attachment.downloadUrl,`_blank`,`noopener,noreferrer`)}})})]})}function le({parentId:e,active:t}){let{t:n}=i(),{entry:r,runtime:a,load:o,setDraft:c}=S(e),l=r.session?.id??``,u=(0,U.useMemo)(()=>e=>a.subscribeSessionState(l,e),[a,l]),d=(0,U.useMemo)(()=>()=>a.getSessionState(l),[a,l]),f=(0,U.useSyncExternalStore)(u,d),[p,m]=(0,U.useState)(!1),[h,y]=(0,U.useState)(!1),[x,C]=(0,U.useState)(``),w=(0,U.useRef)(!1),T=(0,U.useRef)(!1),D=(0,U.useRef)(r.draft);D.current=r.draft;let k=(0,U.useRef)(null),N=M(e=>e.bindings),P=_(f,r.session);(0,U.useEffect)(()=>{t&&o(e)},[t,o,e]);let F=async t=>{t.preventDefault();let n=D.current.trim();if(!(!n||w.current||P||r.expired)){w.current=!0,m(!0),C(``);try{let t=await o(e,!r.session);if(!t?.session)return;let i=t.session.id;if(a.getSessionState(i).streaming)return;D.current.trim()===n&&c(e,``),m(!1),await a.send(i,n),await o(e)}catch(e){C(B(e))}finally{w.current=!1,m(!1)}}},I=(0,U.useCallback)(async()=>{if(!(!l||a.getSessionState(l).streaming)){C(``);try{await a.retry(l),await o(e)}catch(e){C(B(e))}}},[o,e,a,l]),L=async()=>{if(!(!l||h)){y(!0);try{C(``),await a.abort(l)}catch(e){C(B(e))}finally{y(!1)}}},R=(0,W.jsxs)(`div`,{className:`grid h-full min-h-36 place-content-center justify-items-center gap-2 px-3 text-center text-xs text-content-muted`,children:[(0,W.jsx)(`span`,{className:`mb-1 grid size-8 place-items-center rounded-md bg-key text-content-secondary shadow-key ring-1 ring-key-border`,children:(0,W.jsx)(E,{className:`size-4`,"aria-hidden":`true`})}),(0,W.jsx)(`p`,{className:`max-w-64 leading-relaxed`,children:r.expired?n(`chat:sideChat.expired`):n(`chat:sideChat.empty`)}),r.expired&&(0,W.jsxs)(j,{variant:`secondary`,size:`sm`,className:`mt-1`,disabled:r.loading,onClick:async()=>{(await o(e,!0))?.session&&k.current?.focus()},children:[r.loading&&(0,W.jsx)(A,{className:`size-3.5 text-current`}),n(`chat:sideChat.restart`)]})]}),z=x||r.error||f.error;return(0,W.jsxs)(`section`,{"data-side-chat-parent":e,"aria-label":n(`chat:sideChat.title`),className:`flex h-full min-h-0 min-w-0 flex-1 flex-col [container-type:inline-size]`,children:[(0,W.jsx)(`p`,{className:`shrink-0 border-b border-stroke-soft px-3 py-2 text-xs leading-relaxed text-content-muted`,children:n(`chat:sideChat.retention`)}),l?(0,W.jsx)(b,{sessionId:l,messages:f.messages,transcriptLoadState:f.loaded?`ready`:f.error?`error`:`loading`,emptyState:R,messageStart:f.messageStart,hasOlder:f.hasOlder,loadingOlder:f.loadingOlder,olderError:f.olderError,activityFeed:f.activityFeed,tools:f.tools,thinkingText:f.thinkingText,currentActivity:f.currentActivity,compaction:f.compaction,streaming:P,runStartedAt:f.runStartedAt,lastActivityAt:f.lastActivityAt,runFinishedAt:f.runFinishedAt,runStopped:f.runStopped,runNotice:f.runNotice,error:f.error,cwd:r.session?.cwd,onLoadOlder:()=>a.loadOlderMessages(l),onRetryLastTurn:I}):(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:R}),(0,W.jsxs)(`form`,{className:`flex shrink-0 flex-col gap-2 border-t border-stroke-soft p-3`,onSubmit:F,children:[z&&(0,W.jsx)(v,{error:z,onRetry:r.error||!f.loaded?async()=>{await o(e)}:I}),(0,W.jsx)(g,{approvals:f.approvals,onResolve:async(e,t)=>{try{await a.approve(l,e,t)}catch{}}}),(0,W.jsxs)(`div`,{className:`flex min-w-0 items-end gap-2 rounded-[var(--composer-radius,22px)] border border-control bg-panel py-2 pr-2 pl-3 shadow-composer transition-[border-color,box-shadow] duration-(--d-fast) focus-within:border-focus focus-within:ring-3 focus-within:ring-focus-ring`,children:[(0,W.jsx)(`textarea`,{ref:k,rows:2,value:r.draft,"aria-label":n(`chat:sideChat.message`),placeholder:n(`chat:sideChat.placeholder`),className:`max-h-40 min-h-14 min-w-0 flex-1 resize-y border-0 bg-transparent px-1 py-1 text-sm leading-relaxed text-content caret-focus outline-none placeholder:text-content-muted`,onChange:t=>c(e,t.target.value),onCompositionStart:()=>{T.current=!0},onCompositionEnd:()=>{T.current=!1},onKeyDown:e=>{!T.current&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==229&&ee(e.nativeEvent,N.sendMessage)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),(0,W.jsx)(j,{type:P?`button`:`submit`,size:`icon`,className:`size-8 shrink-0 rounded-full max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":n(P?`chat:sideChat.stop`:`chat:sideChat.send`),disabled:P?h:p||r.loading||r.expired||!r.draft.trim(),onClick:P?()=>void L():void 0,children:p||h?(0,W.jsx)(A,{className:`size-4 text-current`}):P?(0,W.jsx)(O,{size:13,fill:`currentColor`}):(0,W.jsx)(s,{size:17})})]})]})]})}var $=(0,U.createContext)(null),ue=()=>{let e=(0,U.useContext)($);if(!e)throw Error(`WebPreview components must be used within a WebPreview`);return e},de=({className:e,children:t,defaultUrl:n=``,onUrlChange:r,...i})=>{let[a,o]=(0,U.useState)(n),[s,c]=(0,U.useState)(!1),l=(0,U.useCallback)(e=>{o(e),r?.(e)},[r]),u=(0,U.useMemo)(()=>({consoleOpen:s,setConsoleOpen:c,setUrl:l,url:a}),[s,l,a]);return(0,W.jsx)($.Provider,{value:u,children:(0,W.jsx)(`div`,{className:k(`flex size-full min-h-0 flex-col rounded-lg border bg-card`,e),...i,children:t})})},fe=({className:e,loading:t,src:n,...r})=>{let{url:i}=ue();return(0,W.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden bg-background`,children:[(0,W.jsx)(`iframe`,{className:k(`block size-full border-0 bg-background`,e),loading:`lazy`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-presentation`,src:(n??i)||void 0,title:`Preview`,...r}),t]})};function pe({page:e,onChange:t}){let{t:n}=i(),{draft:r,url:a}=e,[o,s]=(0,U.useState)(!1);return(0,W.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col gap-2 p-3`,"aria-label":n(`common:webPreview.title`),children:[(0,W.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault();let n=z(r,window.location.href);s(!n),n&&t({url:n})},children:[(0,W.jsx)(P,{"aria-label":n(`common:webPreview.url`),className:`flex-1 font-mono`,value:r,onChange:e=>t({draft:e.target.value}),placeholder:n(`common:webPreview.urlPlaceholder`),maxLength:2048}),(0,W.jsx)(j,{type:`submit`,variant:`secondary`,children:n(`chat:sessionContext.openUrl`)})]}),o&&(0,W.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:n(`chat:sessionContext.invalidUrl`)}),a?(0,W.jsx)(de,{className:`min-h-0 flex-1 overflow-hidden rounded-md border-stroke`,defaultUrl:a,children:(0,W.jsx)(fe,{src:a,title:n(`common:webPreview.title`)})},a):(0,W.jsx)(L,{icon:d,className:`min-h-0 flex-1`,title:n(`chat:sessionContext.browserEmpty`)}),a&&(0,W.jsxs)(j,{type:`button`,variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>window.open(a,`_blank`,`noopener,noreferrer`),children:[(0,W.jsx)(f,{size:14}),n(`common:webPreview.openExternal`)]}),(0,W.jsx)(`p`,{className:`text-xs text-content-muted`,children:n(`common:webPreview.embedNotice`)})]})}export{ae as a,Z as c,oe as i,X as l,le as n,ie as o,ce as r,re as s,pe 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-BuN5i-jP.js";import{t as i}from"./useQuery-DdcpUQhO.js";import{i as a}from"./runtime-capabilities-CHYOF_hE.js";import{t as o}from"./runtime-capabilities-store-B5Bam7pC.js";import{t as s}from"./createLucideIcon-Cd-3GVxJ.js";import{i as c}from"./permission-rules-api-CPImVuda.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 ee,r as h,t as g}from"./SessionBrowserPane-DOmbqdHK.js";import{t as _}from"./earth-Ddy13fHh.js";import{t as v}from"./ellipsis-CfGKfbq6.js";import{o as y}from"./GitDiffViewer-DGkjG02b.js";import{F as te,L as b,N as ne,c as re,h as x,p as S,s as ie}from"./side-chat-context-hRj7FqXK.js";import{t as C}from"./git-branch-N7LGjtzt.js";import{t as ae}from"./message-square-SKjZyY3v.js";import{t as oe}from"./plus-fQbSqB1n.js";import{t as w}from"./refresh-cw-TbWxTY4K.js";import{t as se}from"./square-terminal-BVG6cUT1.js";import{t as ce}from"./x-07u4-129.js";import{c as le,i as T,p as ue,r as E,t as D}from"./dropdown-menu-CFIFNaKO.js";import{i as de,n as fe,t as pe}from"./popover-DN1mndHQ.js";import{t as me}from"./segmented-control-BlM_GKV6.js";import{t as O}from"./utils-C8uzG5AZ.js";import{t as k}from"./button-CCcCN8tE.js";import{t as he}from"./chat-api-Dy5Hkicx.js";import{a as A,r as j}from"./format-DMJQzoZ7.js";import{t as ge}from"./StatusGlyph-1KgitlUg.js";import{t as _e}from"./session-change-summary-api-CTAw_Fpq.js";import{n as M,t as N}from"./PageState-Cz6vFMXv.js";import{i as ve,n as P,r as ye}from"./MarkdownMessage-BiGbYY8R.js";import{t as be}from"./route-context-DvWDul4T.js";import"./web-preview-DUIdcsL2.js";import{n as xe}from"./terminal-context-aIsIJPn8.js";var Se=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`}]]),Ce=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`}]]),F=e(t(),1),I=n(),L={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 we(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 R(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 z({title:e,children:t}){return(0,I.jsxs)(`section`,{className:`grid min-w-0 gap-2`,"aria-label":e,children:[(0,I.jsx)(`h3`,{className:`text-xs font-semibold text-content-secondary`,children:e}),t]})}function B({status:e,name:t,detail:n,t:r}){let i=L[String(e)]??{kind:`queued`,color:`text-st-queue`};return(0,I.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 py-1.5 text-xs`,children:[(0,I.jsx)(ge,{status:i.kind,className:`mt-px size-3.5 ${i.color}`}),(0,I.jsxs)(`span`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`strong`,{className:`min-w-0 truncate font-medium text-content`,children:t}),(0,I.jsx)(`span`,{className:`flex-none text-content-muted`,children:we(e,r)})]}),n&&(0,I.jsx)(`span`,{className:`min-w-0 break-words text-content-muted`,children:n})]})]})}function V(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 Te({plan:e,goal:t,team:n,activity:i}){let{t:a}=r(),o=Array.isArray(n?.tasks)?n.tasks:[],s=V(i),c=!!(t?.id&&String(t.objective||``).trim()),l=!!e?.items?.length;if(!c&&!l&&!o.length&&!s.length)return(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:(0,I.jsx)(N,{compact:!0,icon:te,title:a(`chat:sessionContext.planEmpty`)})});let u=Number(t?.mode===`team`?t?.teamTokenBudget:t?.tokenBudget)||0;return(0,I.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,I.jsx)(z,{title:a(`board:inspector.goal`),children:(0,I.jsxs)(`div`,{className:`grid gap-1.5 rounded-md border border-stroke-soft bg-surface-subtle p-3 text-xs`,children:[(0,I.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-content`,children:String(t.objective)}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 text-content-muted tabular-nums`,children:[(0,I.jsx)(`span`,{children:R(t,a)}),(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsx)(`span`,{children:u>0?a(`chat:focusSession.usedBudgetTokensUsed`,{used:j(t.tokensUsed),budget:j(u)}):a(`chat:focusSession.usedUnlimitedGoalTokens`,{used:j(t.tokensUsed)})})]})]})}),l&&(0,I.jsx)(z,{title:a(`board:inspector.plan`),children:(0,I.jsx)(p,{plan:e})}),o.length>0&&(0,I.jsx)(z,{title:a(`board:inspector.team`),children:(0,I.jsx)(`ul`,{className:`divide-y divide-stroke-soft`,children:o.map((e,t)=>(0,I.jsx)(B,{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,I.jsx)(z,{title:a(`board:inspector.subAgents`),children:(0,I.jsx)(`ul`,{className:`divide-y divide-stroke-soft`,children:s.map((e,t)=>(0,I.jsx)(B,{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 H=100;function U(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 Ee={modified:`M`,created:`A`,deleted:`D`,renamed:`R`,other:`·`},De={modified:`text-content-secondary`,created:`text-st-done`,deleted:`text-st-fail`,renamed:`text-content-secondary`,other:`text-content-muted`};function W(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 G(e,t){return/^(?:[a-zA-Z]:[\\/]|\/|\\\\)/.test(t)?t:`${e.replace(/[\\/]+$/,``)}/${t}`}function Oe(e,t){window.dispatchEvent(new CustomEvent(be,{detail:{message:e,tone:t}}))}function K({added:e,removed:t}){return e===null||t===null?null:(0,I.jsxs)(`span`,{className:`flex-none font-mono text-xs tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}),` `,(0,I.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]})]})}function q({status:e,children:t}){let{t:n}=r();return(0,I.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,I.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 truncate`,children:e}),(0,I.jsxs)(D,{children:[(0,I.jsx)(ue,{asChild:!0,children:(0,I.jsx)(k,{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,I.jsx)(v,{"aria-hidden":`true`})})}),(0,I.jsx)(E,{align:`end`,side:`top`,className:`min-w-48`,children:t})]})]})}function J({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,I.jsxs)(`span`,{className:O(`w-3.5 flex-none text-center font-mono text-xs font-semibold`,De[e]),title:n,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:Ee[e]}),(0,I.jsx)(`span`,{className:`sr-only`,children:n})]})}function Y({files:e,selected:t,label:n,onSelect:r}){let i=(0,F.useRef)(null);return(0,I.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,H).map(e=>{let n=e.path===t,{directory:i,name:a}=W(e.path);return(0,I.jsx)(`li`,{className:`px-1`,children:(0,I.jsxs)(`button`,{type:`button`,title:e.path,"aria-label":[e.path,Ee[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:O(`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,I.jsx)(J,{status:e.status}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 font-mono`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate text-content-muted`,children:i}),(0,I.jsx)(`span`,{className:`flex-none text-content`,children:a})]}),e.note&&(0,I.jsx)(`span`,{className:`flex-none text-content-muted`,children:e.note}),(0,I.jsx)(K,{added:e.added,removed:e.removed})]})},e.path)}),e.length>H&&(0,I.jsx)(`li`,{className:`px-3 py-1.5 text-xs text-content-muted tabular-nums`,children:(0,I.jsx)(ke,{count:e.length-H})})]})}function ke({count:e}){let{t}=r();return(0,I.jsx)(I.Fragment,{children:t(`chat:focusSession.gitMoreFiles`,{count:e})})}var X=600;function Z({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,F.useRef)(null),[m,ee]=(0,F.useState)(0);(0,F.useLayoutEffect)(()=>{let e=p.current;if(!e)return;let t=()=>ee(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let h=m===0||m>=X,g=h?u:`unified`,_=h?void 0:l(`board:changes.splitTooNarrow`);return(0,I.jsxs)(`section`,{ref:p,className:`flex min-h-0 flex-1 flex-col`,"aria-label":t.path,"data-change-detail":t.path,children:[(0,I.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,I.jsx)(J,{status:t.status}),(0,I.jsx)(`strong`,{className:`min-w-0 flex-1 truncate font-mono text-xs font-semibold text-content`,title:t.path,children:t.path}),(0,I.jsx)(K,{added:t.added,removed:t.removed}),(0,I.jsx)(me,{size:`sm`,"aria-label":l(`board:changes.diffView`),title:_,"aria-description":_,value:g,onValueChange:f,options:[{value:`unified`,label:l(`board:changes.unified`)},{value:`split`,label:l(`board:changes.split`),disabled:!h}]})]}),(0,I.jsx)(d,{sessionId:e,path:t.path,scope:n,revision:i,mode:g,fill:!0,position:a?.reading?.[t.path],onReading:e=>o?.({reading:{...a?.reading,[t.path]:e}})},`${n}:${t.path}`),(0,I.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=G(e,t);return(0,I.jsxs)(k,{type:`button`,variant:`ghost`,size:`sm`,className:`max-[650px]:h-11`,onClick:async()=>{try{await ye(i,ve),Oe(n(`common:markdownMessage.revealLocalPathOk`,{path:t}),`info`)}catch(e){Oe(e instanceof P&&e.reason===`unavailable`?n(`common:markdownMessage.revealLocalPathUnavailable`):e instanceof P&&e.reason===`timeout`?n(`common:markdownMessage.revealLocalPathTimeout`):n(`common:markdownMessage.revealLocalPathFailed`,{path:t}),`error`)}},children:[(0,I.jsx)(Se,{"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:h,reversibleCount:g,displayedError:_,notice:v,runAction:y,refresh:te}=ee({sessionId:e,streaming:n,requestConfirm:o}),b=u?.files??[],re=i?.expandedFiles?.[0],x=b.find(e=>e.path===re)??b[0],S=e=>a?.({expandedFiles:[e]}),ie=(e,t)=>f?.kind===e&&f.path===t,C=n?s(`chat:focusSession.gitWaitForRunToFinish`):void 0;return(0,I.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,I.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,I.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-content-secondary`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:s(`board:changes.sessionSummary`,{count:u?.summary.files??0})}),u&&u.summary.files>0&&(0,I.jsx)(K,{added:u.summary.added,removed:u.summary.removed})]})}),_&&(0,I.jsx)(`p`,{role:`alert`,className:`shrink-0 px-3 pt-2 text-xs text-st-fail`,children:_}),v&&!_&&(0,I.jsx)(`p`,{role:`status`,className:`shrink-0 px-3 pt-2 text-xs text-content-secondary`,children:v}),d&&!u?(0,I.jsx)(M,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):b.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Y,{files:b.map(e=>({...Q(e),note:e.reverted?s(`chat:focusSession.fileChangesReverted`):e.approved?s(`chat:focusSession.fileChangesApproved`):$(e.formatChange,s)})),selected:x?.path??``,label:s(`board:changes.files`),onSelect:S}),x&&(0,I.jsx)(Z,{sessionId:e,file:Q(x),scope:`task`,revision:p,view:i,onViewChange:a,footer:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:O(`mr-auto flex min-w-0 items-center gap-1.5 truncate`,x.approved?`text-st-done`:`text-content-muted`),"data-change-state":x.reverted?`reverted`:x.approved?`approved`:`pending`,children:[x.approved&&!x.reverted&&(0,I.jsx)(l,{className:`size-3.5 flex-none`,"aria-hidden":`true`}),x.reverted?s(`board:changes.revertedAt`,{time:A(x.changedAt,c)}):x.approved?s(`board:changes.approvedAt`,{time:A(x.changedAt,c)}):s(`board:changes.pendingAt`,{time:A(x.changedAt,c)})]}),x.pending&&!x.approved&&!x.reverted&&(0,I.jsxs)(k,{type:`button`,variant:`ghost`,size:`sm`,disabled:m,title:C,onClick:()=>void y({kind:`approve`,path:x.path}),children:[ie(`approve`,x.path)?(0,I.jsx)(w,{className:`animate-spin`}):(0,I.jsx)(l,{}),s(`chat:focusSession.fileChangesApproveFile`)]}),(0,I.jsxs)(k,{type:`button`,variant:`ghost`,size:`sm`,disabled:m||x.reverted||!x.canRevert,title:C,onClick:()=>void y({kind:`revert`,path:x.path}),children:[ie(`revert`,x.path)?(0,I.jsx)(w,{className:`animate-spin`}):(0,I.jsx)(ne,{}),s(`board:changes.revertFile`)]}),(0,I.jsx)(Ae,{cwd:t,path:x.path})]})})]}):!_&&(0,I.jsx)(N,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}),(0,I.jsxs)(q,{status:f?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(w,{className:`size-3.5 flex-none animate-spin`,"aria-hidden":`true`}),f.kind===`approve`?s(`chat:focusSession.fileChangesApproveAll`):s(`board:changes.revertAll`)]}):h>0?s(`board:changes.pending`,{count:h}):null,children:[h>0&&(0,I.jsxs)(T,{disabled:m,title:C,onSelect:()=>void y({kind:`approve`}),children:[(0,I.jsx)(l,{}),s(`chat:focusSession.fileChangesApproveAll`)]}),(u?.summary.files??0)>0&&(0,I.jsxs)(T,{disabled:m||g===0,title:C??s(`chat:focusSession.fileChangesRevertAllDescription`),onSelect:()=>void y({kind:`revert`}),children:[(0,I.jsx)(ne,{}),s(`board:changes.revertAll`)]}),(h>0||(u?.summary.files??0)>0)&&(0,I.jsx)(le,{}),(0,I.jsxs)(T,{disabled:d||!!f,onSelect:te,children:[(0,I.jsx)(w,{}),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})=>he.getVcsChanges(e,{signal:t})}),l=(0,F.useMemo)(()=>S(c.data?.diff||``,c.data?.files.map(e=>e.path)||[],c.data?.diffTruncated),[c.data]),u=c.error?.message||c.data?.error,d=(c.data?.files||[]).map(e=>({path:e.path,status:U(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,I.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,I.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,I.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-content-secondary`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:s(`board:changes.workspaceSummary`,{count:d.length})}),c.data?.isRepo&&!u&&d.length>0&&(0,I.jsx)(K,{added:l.added,removed:l.removed})]}),c.data?.branch&&(0,I.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,I.jsx)(C,{size:12,className:`flex-none`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`truncate`,children:c.data.branch})]})]}),c.isPending?(0,I.jsx)(M,{kind:`loading`,title:s(`chat:focusSession.gitLoading`)}):u?(0,I.jsx)(`p`,{role:`alert`,className:`p-3 text-xs text-st-fail`,children:u}):c.data?.isRepo?d.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Y,{files:d,selected:p?.path??``,label:s(`board:changes.files`),onSelect:e=>o?.({expandedFiles:[e]})}),p&&(0,I.jsx)(Z,{sessionId:e,file:p,scope:`project`,revision:c.dataUpdatedAt,view:a,onViewChange:o,footer:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`mr-auto min-w-0 truncate font-mono text-content-muted`,title:t,children:t}),(0,I.jsx)(Ae,{cwd:t,path:p.path})]})})]}):(0,I.jsx)(N,{compact:!0,title:s(`chat:focusSession.fileChangesEmpty`)}):(0,I.jsx)(N,{compact:!0,title:s(`chat:workbench.notRepository`)}),(0,I.jsx)(q,{status:c.isFetching?(0,I.jsx)(w,{className:`size-3.5 flex-none animate-spin`,"aria-hidden":`true`}):null,children:(0,I.jsxs)(T,{disabled:c.isFetching,onSelect:()=>void c.refetch(),children:[(0,I.jsx)(w,{}),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,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-inspector-changes":i,children:[(0,I.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:(0,I.jsx)(me,{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,I.jsx)(Me,{sessionId:e,cwd:t,streaming:n,view:s,onViewChange:c}):(0,I.jsx)(je,{sessionId:e,cwd:t,streaming:n,view:s,onViewChange:c,requestConfirm:l}):(0,I.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:ee,planTab:v,sources:ne,mode:S,requestConfirm:C,onClose:w,onOpenComponents:le,componentTabs:T,autoFocus:ue=!1}){let{t:E}=r(),D=S===`sheet`,he=xe(),A=o(e=>e.capabilities),j=!!he&&a(A,`terminal`),ge=a(A,`vcs`),M=c(e=>e.tab),ve=c(e=>e.setTab),P=c(e=>e.terminalView),ye=c(e=>e.setTerminalView),be=c(e=>e.changesView),Se=c(e=>e.setChangesView),L=x(e=>e.sessions[t]?.pages)??Pe,we=L.some(e=>e.kind===`side-chat`),R=M===`side-chat`&&!we||M===`plan`&&!v?`changes`:M,z=Fe(R,P,be),B=z?L.find(e=>e.kind===z):void 0,V=!D&&T?T.tabs(n):[],[H,U]=(0,F.useState)(null),[Ee,De]=(0,F.useState)(!1),W=V.some(e=>e.id===H)?H:null;(0,F.useEffect)(()=>U(null),[M]);let G=(0,F.useRef)(null);(0,F.useEffect)(()=>{G.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[R,W]);let Oe=(0,F.useRef)(ue);(0,F.useEffect)(()=>{if(!Oe.current)return;let e=requestAnimationFrame(()=>G.current?.querySelector(`[role="tab"][aria-selected="true"]`)?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]),(0,F.useEffect)(()=>{if(!z||B||(z===`terminal`||z===`processes`)&&!j)return;let e=x.getState(),n=e.sessions[t]?.contentOpen??!1;e.update(t,z,{type:`add`,kind:z}),n||e.update(t,z,{type:`workspace`,contentOpen:!1})},[z,B,t,j]);let K=i({queryKey:[`session-change-summary`,t,s],queryFn:()=>_e(t),staleTime:1e4}),q=K.data?.status===`known`?K.data.changedFiles??0:0,J=[{id:`changes`,icon:y,label:q>0?E(`board:inspector.changesCount`,{count:q}):E(`board:inspector.changes`)},{id:`terminal`,icon:se,label:E(`board:inspector.terminal`)},{id:`files`,icon:b,label:E(`board:inspector.files`)},{id:`preview`,icon:_,label:E(`board:inspector.preview`)},...v?[{id:`plan`,icon:te,label:E(`board:inspector.plan`)}]:[],...we?[{id:`side-chat`,icon:ae,label:E(`board:inspector.sideChat`)}]:[]],Y=e=>{B&&x.getState().update(t,B.kind,{type:`view`,id:B.id,patch:e})},ke=()=>{let n=L.find(e=>e.kind===`side-chat`);if(n&&x.getState().update(t,`side-chat`,{type:`close`,id:n.id}),ve(`changes`),D){w();return}requestAnimationFrame(()=>document.getElementById(`${e}-changes-tab`)?.focus())},X=t=>`${e}-component-${t}-tab`,Z=e=>{U(null),ve(e)},Ae=t=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(t.key))return;t.preventDefault();let n=[...J.map(t=>({fixed:t.id,id:`${e}-${t.id}-tab`})),...V.map(e=>({component:e.id,id:X(e.id)}))],r=n.findIndex(e=>W?e.component===W:e.fixed===R),i=n[t.key===`Home`?0:t.key===`End`?n.length-1:(r+(t.key===`ArrowRight`?1:-1)+n.length)%n.length];i.component?U(i.component):i.fixed&&Z(i.fixed),requestAnimationFrame(()=>document.getElementById(i.id)?.focus())},Q=(0,I.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-content-muted`,children:E(`chat:focusSession.gitLoading`)}),$;if(W&&T)$=T.render(W,{sessionId:t,cwd:n});else if(R===`changes`)$=(0,I.jsx)(Ne,{sessionId:t,cwd:n,streaming:s,scope:be,onScopeChange:Se,vcsAvailable:ge,view:B?.view,onViewChange:B?Y:void 0,requestConfirm:C});else if(R===`terminal`)$=j?(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-stroke-soft px-3 py-2`,children:(0,I.jsx)(me,{size:`sm`,"aria-label":E(`board:inspector.terminalScope`),value:P,onValueChange:ye,options:[{value:`terminal`,label:E(`board:inspector.terminal`)},{value:`processes`,label:E(`board:inspector.processes`)}]})}),(0,I.jsx)(F.Suspense,{fallback:Q,children:B?P===`processes`?(0,I.jsx)(f,{sessionId:t,view:B.view,onViewChange:Y,onOpenTerminal:e=>{let n=x.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}),ye(`terminal`)}}):(0,I.jsx)(u,{sessionId:t,cwd:n,terminalId:B.resourceId||void 0,onCreated:e=>x.getState().update(t,`terminal`,{type:`resource`,id:B.id,resourceId:e})},B.id):Q})]}):(0,I.jsx)(N,{compact:!0,icon:se,title:E(`board:inspector.terminalUnavailable`)});else if(R===`files`)$=B?(0,I.jsx)(h,{sources:ne,view:B.view,onViewChange:Y}):Q;else if(R===`preview`){let e=s?ie([...ee]):null;$=B?(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-inspector-preview":!0,children:[e&&(0,I.jsx)(`div`,{className:`max-h-[50%] shrink-0 overflow-y-auto border-b border-stroke-soft p-2`,children:(0,I.jsx)(re,{target:e,fallbackImage:e.previewImage,streaming:s})}),(0,I.jsx)(g,{page:B,onChange:e=>x.getState().update(t,`browser`,{type:`browser`,id:B.id,...e})})]}):Q}else $=R===`plan`?(0,I.jsx)(Te,{plan:l,goal:d,team:p,activity:ee}):(0,I.jsx)(m,{parentId:t,active:!0});return(0,I.jsxs)(`section`,{id:e,"aria-label":E(`board:inspector.label`),"data-session-inspector":S,"data-inspector-tab":R,"data-inspector-component":W??void 0,className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-panel text-content`,children:[(0,I.jsxs)(`header`,{className:O(`flex shrink-0 items-center gap-1 border-b border-stroke-soft pr-1.5 pl-2`,D?`h-[52px]`:S===`aside`?`h-[52px] [[data-custom-titlebar]_&]:h-11 [[data-custom-titlebar]_&]:pointer-coarse:h-[52px]`:`h-11 pointer-coarse:h-[52px]`),children:[(0,I.jsxs)(`div`,{ref:G,role:`tablist`,"aria-label":E(`board:inspector.tabs`),className:`flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]`,onKeyDown:Ae,children:[J.map(({id:t,icon:n,label:r})=>{let i=!W&&t===R;return(0,I.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:O(`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`,D?`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:()=>Z(t),children:[!D&&(0,I.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),r]},t)}),!W&&R===`side-chat`&&(0,I.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-sm`,className:O(D&&`size-11`),"aria-label":E(`board:inspector.closeTab`,{tab:E(`board:inspector.sideChat`)}),onClick:ke,children:(0,I.jsx)(ce,{"aria-hidden":`true`})}),!D&&(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1 h-4 w-px flex-none bg-stroke`}),V.map(({id:t,label:n})=>{let r=t===W;return(0,I.jsx)(`button`,{id:X(t),type:`button`,role:`tab`,"aria-selected":r,"aria-controls":`${e}-body`,tabIndex:r?0:-1,"data-inspector-component-tab":t,className:O(`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:()=>U(t),children:(0,I.jsx)(`span`,{className:`truncate`,children:n})},t)})]}),!D&&(0,I.jsxs)(pe,{open:Ee,onOpenChange:De,children:[(0,I.jsx)(de,{asChild:!0,children:(0,I.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,"aria-label":E(`board:inspector.add`),title:E(`board:inspector.add`),"data-inspector-component-add":!0,children:(0,I.jsx)(oe,{"aria-hidden":`true`})})}),(0,I.jsxs)(fe,{align:`end`,className:`w-64 text-xs`,children:[T?.addMenu?T.addMenu({cwd:n,onAdded:e=>{U(e),De(!1)}}):(0,I.jsx)(`p`,{className:`text-content-secondary`,children:E(`board:inspector.addHint`)}),le&&(0,I.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`self-start`,onClick:le,children:E(`board:inspector.openComponents`)})]})]}),(0,I.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-sm`,className:O(`flex-none`,D&&`size-11`),"aria-label":E(`board:inspector.close`),title:E(`board:inspector.close`),"aria-controls":e,onClick:w,children:S===`aside`?(0,I.jsx)(Ce,{"aria-hidden":`true`}):(0,I.jsx)(ce,{"aria-hidden":`true`})})]}),(0,I.jsx)(`div`,{id:`${e}-body`,role:`tabpanel`,"aria-labelledby":W?X(W):`${e}-${R}-tab`,className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:$})]})}export{Ie as SessionInspector};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t}from"./vendor-react-DwNgTV1j.js";import{c as n}from"./i18n-CyyEaQdX.js";import{o as r}from"./vendor-state-GkUciC5H.js";import{n as i}from"./startup-queries-qM8tclDJ.js";import{a,l as o}from"./api-Dg-aNpVe.js";import{a as s,o as c}from"./BotAvatar-CNL-APwP.js";n.addResourceBundle(`zh-CN`,`bots`,{"sidebar.title":`Bots`,"sidebar.newBot":`新建 Bot`,"sidebar.showAll":`显示全部({count})`,"sidebar.showLess":`收起`,"activity.idle":`空闲`,"activity.paused":`已暂停`,"character.blob":`小圆`,"character.bean":`豆豆`,"character.robot":`机器人`,"character.cat":`小猫`,"character.owl":`猫头鹰`,"character.ghost":`小幽灵`,"character.cloud":`云朵`,"character.octo":`章鱼`,"character.bunny":`兔子`,"character.bear":`小熊`,"character.fox":`小狐`,"character.star":`星星`,"new.title":`新建 Bot`,"new.description":`起个名字就能开始。它负责什么可以现在写,也可以之后在对话里告诉它。`,"new.name":`名字`,"new.namePlaceholder":`例如:审查员`,"new.character":`角色`,"new.color":`颜色`,"new.colorOption":`颜色 {index}`,"new.pick":`选择…`,"new.cancel":`取消`,"new.create":`开始对话`,"new.creating":`正在创建…`,"page.disabledTitle":`Bots 还没打开`,"page.disabledDescription":`Bots 是实验功能,在设置 › 实验功能里打开后就能用。`,"page.openLabs":`去实验功能`,"page.loading":`正在读取…`,"page.notFound":`这个 Bot 不存在了`,"page.emptyTitle":`还没有 Bot`,"page.emptyDescription":`Bot 是常驻的同事:一个长期对话,你随时找它,聊天软件和定时任务也能找它。`,"details.instructions":`它负责什么`,"details.instructionsPlaceholder":`例如:你负责 pisper 仓库的 PR 审查;小问题直接改,其余只提建议;先跑 npm test 再下结论。`,"details.save":`保存`,"details.acceptsWork":`接收聊天与定时的消息`,"details.permission":`权限`,"details.modeApproval":`每一步都问我`,"details.modeWorkspace":`危险操作才问`,"details.modeFull":`完全访问`,"details.permissionHint":`它在这台电脑上自己改文件、跑命令,不限于起始目录。“危险操作才问”:只有命令守卫标出的危险命令、浏览器里的点击与填写、第三方插件才停下来问你。能在群聊里叫它时不能选完全访问。`,"computer.description":`它在这台电脑上读写代码、跑命令。可以换成另一台运行 pisper executor 的电脑。`,"computer.runsOn":`运行在`,"computer.local":`本机`,"activity.approval":`等你批准一个操作`,"activity.question":`有问题问你`,"details.tools":`可用工具`,"details.toolsAll":`全部工具`,"details.toolsReadOnly":`只读`,"details.toolsCustom":`自定义({count} 个)`,"details.toolsHint":`只读:能读代码、搜索,不能改文件、不能跑命令。范围外的工具在执行前就会被拦下。`,"computer.unnamed":`未命名的电脑`,"computer.online":`在线`,"computer.offline":`离线`,"computer.option":`{name}({state})`,"computer.folder":`起始目录`,"computer.folderPlaceholder":`/path/to/repo`,"computer.folderInRoots":`必须在这台电脑允许的目录里:{roots}`,"computer.switch":`换到这里`,"computer.listTitle":`电脑`,"computer.usedBy":`{names} 在用`,"computer.remove":`移除`,"computer.confirmRemove":`确定移除`,"computer.cancel":`取消`,"computer.add":`添加电脑`,"computer.addTitle":`添加一台电脑`,"computer.done":`完成`,"computer.code":`配对码`,"computer.codeHint":`10 分钟内有效,只能用一次`,"computer.remoteOff":`先打开远程访问,那台电脑才连得上这里。`,"computer.openRemote":`打开远程访问`,"computer.runThere":`在那台电脑上运行(把目录换成允许 Bot 读写的代码目录,可以写多个 --root):`,"computer.rootPlaceholder":`~/code`,"computer.rootHint":`那台电脑只需要 Node.js,不需要模型密钥。`,"computer.copy":`复制命令`,"computer.copied":`已复制`,"computer.brainPlaceholder":`https://<这台电脑的远程访问地址>`,"triggers.chats":`可以叫它的聊天`,"triggers.chatsHint":`在这些聊天里发“/{name} 要做的事”或“@Pisper {name} 要做的事”就能叫它。聊天与人的 ID 在聊天里发 /whoami 查看。`,"triggers.p2p":`私聊`,"triggers.group":`群聊`,"triggers.peers":`聊天 {ids}`,"triggers.allPeers":`所有聊天`,"triggers.senders":`{ids} 能叫它`,"triggers.ownerOnly":`只有你能叫它`,"triggers.remove":`删除`,"triggers.platform":`渠道`,"triggers.peerIds":`聊天 ID`,"triggers.peerIdsPlaceholder":`聊天 ID,多个用逗号分开;不填表示所有聊天`,"triggers.senderIds":`谁能叫它`,"triggers.senderIdsPlaceholder":`谁能叫它(ID,逗号分开);不填只有你`,"triggers.senderIdsRequired":`谁能叫它(ID,逗号分开);群聊必须填写`,"triggers.cancel":`取消`,"triggers.add":`添加`,"triggers.addChat":`添加聊天`,"triggers.feishu":`飞书`,"triggers.weixin":`微信`,"triggers.qq":`QQ`,"triggers.telegram":`Telegram`,"triggers.schedules":`定时让它做`,"triggers.scheduleEnabled":`启用这个定时`,"triggers.scheduleMessage":`要做的事`,"triggers.scheduleMessagePlaceholder":`例如:检查依赖有没有安全更新`,"triggers.frequency":`频率`,"triggers.daily":`每天`,"triggers.weekly":`每周`,"triggers.once":`一次`,"triggers.weekday":`星期`,"triggers.date":`日期`,"triggers.time":`时间`,"triggers.addSchedule":`添加定时`,"triggers.monday":`周一`,"triggers.tuesday":`周二`,"triggers.wednesday":`周三`,"triggers.thursday":`周四`,"triggers.friday":`周五`,"triggers.saturday":`周六`,"triggers.sunday":`周日`,"triggers.onceAt":`{date} {time} 一次`,"triggers.weeklyAt":`每{day} {time}`,"triggers.dailyAt":`每天 {time}`,"triggers.otherSchedule":`按定时任务页里的设置`,"new.shuffle":`换一个样子`,"new.chooseLook":`自己挑样子`,"new.duty":`它负责什么(可选)`,"new.dutyPlaceholder":`例如:审查 pisper 仓库的 PR;小问题直接改,其余只提建议。`,"new.folder":`起始目录`,"new.folderDefault":`不填就从默认工作目录开始`,"new.folderSummary":`从本机的默认工作目录开始干活。`,"new.changeFolder":`换个目录`,"settings.changeLook":`换个样子`,"settings.doneLook":`选好了`,"settings.computer":`电脑`,"settings.computerSummary":`{computer} · {folder}`,"settings.chatsCount":`{count} 个聊天`,"settings.notSet":`未设置`,"settings.advanced":`高级`,"settings.advancedSummary":`权限:{permission} · 工具、暂停`,"activity.busy":`正在忙`,"settingsPage.backToChat":`和 {name} 聊天`,"settingsPage.title":`{name} 的设置`,"model.title":`模型`,"model.summary":`{model} · 思考:{thinking}`,"model.model":`模型`,"model.thinking":`思考`,"model.hint":`它的会话用这里的模型和思考等级,改了下一轮生效。档位跟着“设置 › 子代理”里的模型档位走。`,"model.tierFast":`快速档`,"model.tierStandard":`标准档`,"model.tierStrong":`强档`,"model.thinkingDefault":`模型默认`,"model.thinkingOff":`关闭`,"model.thinkingMinimal":`极轻`,"model.thinkingLow":`轻度`,"model.thinkingMedium":`标准`,"model.thinkingHigh":`深度`,"model.thinkingXhigh":`极深`}),n.addResourceBundle(`en-US`,`bots`,{"sidebar.title":`Bots`,"sidebar.newBot":`New Bot`,"sidebar.showAll":`Show all ({count})`,"sidebar.showLess":`Show less`,"activity.idle":`Idle`,"activity.paused":`Paused`,"character.blob":`Blob`,"character.bean":`Bean`,"character.robot":`Robot`,"character.cat":`Cat`,"character.owl":`Owl`,"character.ghost":`Ghost`,"character.cloud":`Cloud`,"character.octo":`Octopus`,"character.bunny":`Bunny`,"character.bear":`Bear`,"character.fox":`Fox`,"character.star":`Star`,"new.title":`New Bot`,"new.description":`A name is all it needs. Say what it’s responsible for now, or tell it later in the chat.`,"new.name":`Name`,"new.namePlaceholder":`e.g. Reviewer`,"new.character":`Character`,"new.color":`Color`,"new.colorOption":`Color {index}`,"new.pick":`Choose…`,"new.cancel":`Cancel`,"new.create":`Start chatting`,"new.creating":`Creating…`,"page.disabledTitle":`Bots are turned off`,"page.disabledDescription":`Bots is a Labs feature. Turn it on in Settings › Labs.`,"page.openLabs":`Open Labs`,"page.loading":`Loading…`,"page.notFound":`This Bot no longer exists`,"page.emptyTitle":`No Bots yet`,"page.emptyDescription":`A Bot is a teammate that's always around: one long conversation you can pick up anytime, and chats and schedules can reach it too.`,"details.instructions":`What it’s responsible for`,"details.instructionsPlaceholder":`e.g. You review PRs in the pisper repo; fix small issues directly, otherwise only suggest; run npm test before concluding.`,"details.save":`Save`,"details.acceptsWork":`Take messages from chats and schedules`,"details.permission":`Permission`,"details.modeApproval":`Ask before every step`,"details.modeWorkspace":`Ask only if risky`,"details.modeFull":`Full access`,"details.permissionHint":`It edits files and runs commands on this computer on its own, not only in the starting folder. “Ask only if risky”: it stops to ask only for commands the guard flags as dangerous, clicks and typing in the browser, and third-party plugins. Bots you can call from a group chat can’t use full access.`,"computer.description":`It reads and writes code and runs commands on this computer. You can switch it to another computer running pisper executor.`,"computer.runsOn":`Runs on`,"computer.local":`This computer`,"activity.approval":`Waiting for your approval`,"activity.question":`Has a question for you`,"details.tools":`Tools`,"details.toolsAll":`All tools`,"details.toolsReadOnly":`Read only`,"details.toolsCustom":`Custom ({count})`,"details.toolsHint":`Read only: it can read and search code but not edit files or run commands. Tools outside the scope are blocked before they run.`,"computer.unnamed":`Unnamed computer`,"computer.online":`online`,"computer.offline":`offline`,"computer.option":`{name} ({state})`,"computer.folder":`Starting folder`,"computer.folderPlaceholder":`/path/to/repo`,"computer.folderInRoots":`Must be inside a folder this computer allows: {roots}`,"computer.switch":`Switch here`,"computer.listTitle":`Computers`,"computer.usedBy":`Used by {names}`,"computer.remove":`Remove`,"computer.confirmRemove":`Yes, remove`,"computer.cancel":`Cancel`,"computer.add":`Add a computer`,"computer.addTitle":`Add a computer`,"computer.done":`Done`,"computer.code":`Pairing code`,"computer.codeHint":`valid for 10 minutes, single use`,"computer.remoteOff":`Turn on remote access first so the other computer can reach this one.`,"computer.openRemote":`Open remote access`,"computer.runThere":`Run this on that computer (replace the folder with the code folder Bots may use; repeat --root for more):`,"computer.rootPlaceholder":`~/code`,"computer.rootHint":`That computer only needs Node.js, no model keys.`,"computer.copy":`Copy commands`,"computer.copied":`Copied`,"computer.brainPlaceholder":`https://<remote-access-address-of-this-computer>`,"triggers.chats":`Chats that can call it`,"triggers.chatsHint":`In these chats, send “/{name} what to do” or “@Pisper {name} what to do”. Send /whoami in a chat to see its IDs.`,"triggers.p2p":`Direct`,"triggers.group":`Group`,"triggers.peers":`chats {ids}`,"triggers.allPeers":`all chats`,"triggers.senders":`{ids} can call it`,"triggers.ownerOnly":`only you can call it`,"triggers.remove":`Remove`,"triggers.platform":`Channel`,"triggers.peerIds":`Chat IDs`,"triggers.peerIdsPlaceholder":`Chat IDs, comma separated; empty means all chats`,"triggers.senderIds":`Who can call it`,"triggers.senderIdsPlaceholder":`Who can call it (IDs, comma separated); empty means only you`,"triggers.senderIdsRequired":`Who can call it (IDs, comma separated); required for groups`,"triggers.cancel":`Cancel`,"triggers.add":`Add`,"triggers.addChat":`Add a chat`,"triggers.feishu":`Feishu`,"triggers.weixin":`WeChat`,"triggers.qq":`QQ`,"triggers.telegram":`Telegram`,"triggers.schedules":`On a schedule`,"triggers.scheduleEnabled":`Schedule on`,"triggers.scheduleMessage":`What to do`,"triggers.scheduleMessagePlaceholder":`e.g. Check dependencies for security updates`,"triggers.frequency":`Frequency`,"triggers.daily":`Daily`,"triggers.weekly":`Weekly`,"triggers.once":`Once`,"triggers.weekday":`Day`,"triggers.date":`Date`,"triggers.time":`Time`,"triggers.addSchedule":`Add a schedule`,"triggers.monday":`Monday`,"triggers.tuesday":`Tuesday`,"triggers.wednesday":`Wednesday`,"triggers.thursday":`Thursday`,"triggers.friday":`Friday`,"triggers.saturday":`Saturday`,"triggers.sunday":`Sunday`,"triggers.onceAt":`Once on {date} at {time}`,"triggers.weeklyAt":`Every {day} at {time}`,"triggers.dailyAt":`Daily at {time}`,"triggers.otherSchedule":`As set on the Schedules page`,"new.shuffle":`Try another look`,"new.chooseLook":`Pick a look`,"new.duty":`What it’s responsible for (optional)`,"new.dutyPlaceholder":`e.g. Review PRs in the pisper repo; fix small issues, otherwise only suggest.`,"new.folder":`Starting folder`,"new.folderDefault":`Leave empty to start in the default working folder`,"new.folderSummary":`Starts in the default working folder on this computer.`,"new.changeFolder":`Change folder`,"settings.changeLook":`Change look`,"settings.doneLook":`Done`,"settings.computer":`Computer`,"settings.computerSummary":`{computer} · {folder}`,"settings.chatsCount":`{count} chats`,"settings.notSet":`Not set`,"settings.advanced":`Advanced`,"settings.advancedSummary":`Permission: {permission} · tools, pause`,"activity.busy":`Busy`,"settingsPage.backToChat":`Chat with {name}`,"settingsPage.title":`{name} settings`,"model.title":`Model`,"model.summary":`{model} · thinking: {thinking}`,"model.model":`Model`,"model.thinking":`Thinking`,"model.hint":`Its session uses this model and thinking level; changes apply from the next turn. Tiers follow the model tiers in Settings › Subagents.`,"model.tierFast":`Fast tier`,"model.tierStandard":`Standard tier`,"model.tierStrong":`Strong tier`,"model.thinkingDefault":`Model default`,"model.thinkingOff":`Off`,"model.thinkingMinimal":`Minimal`,"model.thinkingLow":`Low`,"model.thinkingMedium":`Medium`,"model.thinkingHigh":`High`,"model.thinkingXhigh":`Extra high`});var l=[`read`,`grep`,`find`,`ls`];function u(e){if(e===null)return`all`;let t=[...e].sort();return t.length===l.length&&[...l].sort().every((e,n)=>t[n]===e)?`read-only`:`custom`}function d(e,{expanded:t,currentId:n}){let r=e=>e.activity?.needsYou?0:e.activity?.status===`running`?1:2,i=e.map((e,t)=>({bot:e,index:t})).sort((e,t)=>r(e.bot)-r(t.bot)||e.index-t.index).map(e=>e.bot);if(t||i.length<=3)return{shown:i,hidden:0};let a=i.filter((e,t)=>t<3||n!==void 0&&e.id===n);return{shown:a,hidden:i.length-a.length}}function f(e){return e.activity?.needsYou?`need`:e.activity?.status===`running`?`running`:`idle`}function p(e,t){if(!t.enabled)return e(`bots:activity.paused`);let n=t.activity;return n?.waiting===`approval`?e(`bots:activity.approval`):n?.waiting===`question`?e(`bots:activity.question`):n?.status===`running`?e(`bots:activity.busy`):e(`bots:activity.idle`)}var m=e(t(),1),h=[`fast`,`standard`,`strong`],g=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],_=[`feishu`,`weixin`,`qq`,`telegram`];function v(e){return Array.isArray(e)?e.flatMap(e=>{let t=e&&typeof e==`object`?e:{};if(!_.includes(t.platform))return[];let n=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[];return[{platform:t.platform,chatType:t.chatType===`group`?`group`:`p2p`,peerIds:Array.isArray(t.peerIds)?n(t.peerIds):null,senderIds:n(t.senderIds)}]}):[]}function y(e){if(!e||typeof e!=`object`||Array.isArray(e))throw o();return e}function b(e,t=``){return typeof e==`string`?e:t}function x(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.waiting===`approval`||t.waiting===`question`?t.waiting:null;return{status:t.status===`running`?`running`:`idle`,waiting:n,needsYou:t.needsYou===!0||n!==null}}function S(e){let t=y(e),n=y(t.avatar??{}),r=y(t.workspace??{});if(typeof t.id!=`string`||typeof t.name!=`string`)throw o();return{id:t.id,name:t.name,avatar:{character:s(n.character)?n.character:`blob`,color:c(n.color)?n.color:`blue`},enabled:t.enabled!==!1,instructions:b(t.instructions),executionMode:t.executionMode===`workspace-write`||t.executionMode===`full-access`?t.executionMode:`approval-required`,model:C(t.model),thinking:g.find(e=>e===t.thinking)??null,channels:v(t.channels),tools:Array.isArray(t.tools)?t.tools.filter(e=>typeof e==`string`):null,workspace:{environmentId:b(r.environmentId,`local`),cwd:b(r.cwd)},threadSessionId:b(t.threadSessionId),activity:x(t.activity)}}function C(e){let t=y(e??{});return typeof t.ref==`string`&&t.ref.includes(`/`)?{ref:t.ref}:{tier:h.find(e=>e===t.tier)??`standard`}}async function w(){let e=y(await i(`config`));return(Array.isArray(e.providers)?e.providers:[]).flatMap(e=>{let t=y(e);if(typeof t.id!=`string`||!t.configured||t.enabled===!1)return[];let n=b(t.name,t.id);return(Array.isArray(t.models)?t.models:[]).flatMap(e=>{let r=y(e);return typeof r.id!=`string`||r.kind!==`chat`?[]:[{ref:`${t.id}/${r.id}`,name:b(r.name,r.id),providerName:n}]})})}function T(e,t){return n=>t(y(n)[e])}function E(e){return a(`/api/bots`,{signal:e,parse:e=>{let t=y(e).bots;if(!Array.isArray(t))throw o();return t.map(S)}})}function D(e){return a(`/api/bots`,{method:`POST`,data:e,parse:T(`bot`,S)})}function O(e,t){return a(`/api/bots/${encodeURIComponent(e)}`,{method:`PATCH`,data:t,parse:T(`bot`,S)})}function k(e){return a(`/api/bots/${encodeURIComponent(e)}/session`,{method:`POST`,data:{},parse:e=>{let t=y(e).sessionId;if(typeof t!=`string`||!t)throw o();return t}})}function A(e){let t=e&&typeof e==`object`?e:{};return{enabled:t.enabled===!0,endpoints:Array.isArray(t.endpoints)?t.endpoints.filter(e=>typeof e==`string`&&/^https:\/\//.test(e)):[],fingerprint:typeof t.fingerprint==`string`?t.fingerprint:null}}function j(e){let t=y(e);if(typeof t.id!=`string`||!t.id)throw o();let n=t.capabilities&&typeof t.capabilities==`object`?t.capabilities:{};return{id:t.id,kind:t.kind===`node`?`node`:`local`,name:b(t.name),online:t.online===!0,roots:Array.isArray(t.roots)?t.roots.filter(e=>typeof e==`string`):[],shell:n.shell===!0,usedBy:Array.isArray(t.usedBy)?t.usedBy.flatMap(e=>{let t=e&&typeof e==`object`?e:{};return typeof t.id==`string`&&typeof t.name==`string`?[{id:t.id,name:t.name}]:[]}):[],lastSeenAt:typeof t.lastSeenAt==`string`?t.lastSeenAt:null}}function M(e){return a(`/api/environments`,{signal:e,parse:e=>{let t=y(e);if(!Array.isArray(t.environments))throw o();return{environments:t.environments.map(j),remote:A(t.remote)}}})}function N(){return a(`/api/environments/pairing`,{method:`POST`,data:{},parse:e=>{let t=y(e),n=y(t.pairing);if(typeof n.code!=`string`)throw o();return{code:n.code,expiresAt:b(n.expiresAt),remote:A(t.remote)}}})}function P(e){return a(`/api/environments/${encodeURIComponent(e)}`,{method:`DELETE`,parse:()=>void 0})}function F(e,t){let n=y(e).tasks;if(!Array.isArray(n))throw o();return n.flatMap(e=>{let n=e&&typeof e==`object`?e:{};if(n.targetType!==`bot`||n.botId!==t||typeof n.id!=`string`)return[];let r=[`once`,`interval`,`daily`,`weekly`,`monthly`].includes(String(n.frequency))?n.frequency:`daily`;return[{id:n.id,enabled:n.enabled!==!1,botMessage:b(n.botMessage),frequency:r,time:b(n.time),date:b(n.date),dayOfWeek:Number(n.dayOfWeek)||0,nextRunAt:typeof n.nextRunAt==`string`?n.nextRunAt:null}]})}function I(e,t){return a(`/api/schedules`,{signal:t,parse:t=>F(t,e)})}function L(e){return a(`/api/schedules`,{method:`POST`,data:{...e,targetType:`bot`,enabled:!0},parse:()=>void 0})}function R(e,t){return a(`/api/schedules/${encodeURIComponent(e)}`,{method:`PATCH`,data:{enabled:t},parse:()=>void 0})}function z(e){return a(`/api/schedules/${encodeURIComponent(e)}`,{method:`DELETE`,parse:()=>void 0})}var B=null,V=r()((e,t)=>({bots:[],loaded:!1,error:``,load:()=>(B??=E().then(t=>e({bots:t,loaded:!0,error:``})).catch(t=>e({loaded:!0,error:t instanceof Error?t.message:String(t)})).finally(()=>{B=null}),B),upsert:n=>{let r=t().bots;e({bots:r.findIndex(e=>e.id===n.id)<0?[...r,n]:r.map(e=>e.id===n.id?{...n,activity:e.activity}:e)})}}));function H(e){let t=V(e=>e.load),n=V(e=>e.bots.some(e=>e.activity?.status===`running`));(0,m.useEffect)(()=>{if(!e)return;t();let r=window.setInterval(()=>{document.visibilityState===`visible`&&t()},n?3e3:1e4);return()=>window.clearInterval(r)},[e,n,t])}export{l as _,g as a,u as b,N as c,I as d,M as f,O as g,R as h,_ as i,z as l,P as m,V as n,D as o,k as p,h as r,L as s,H as t,w as u,p as v,d as x,f as y};
|