@hienlh/ppm 0.20.6 → 0.20.8
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/CHANGELOG.md +11 -0
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/http-api.md +1 -1
- package/dist/web/assets/{accounts-settings-section-B-F7U-gq.js → accounts-settings-section-CRXY4Bsc.js} +1 -1
- package/dist/web/assets/{ai-resource-editor-qRHwpktf.js → ai-resource-editor-CMQfhxXp.js} +1 -1
- package/dist/web/assets/ai-settings-section-446NZWhI.js +1 -0
- package/dist/web/assets/{ai-settings-section-DSlsTrpf.js → ai-settings-section-M07DCjAI.js} +1 -1
- package/dist/web/assets/api-client-CYZ79uUS.js +1 -0
- package/dist/web/assets/{api-client-CEYCBt_0.js → api-client-DwXlVfXP.js} +1 -1
- package/dist/web/assets/{api-settings-D18Q4Ocp.js → api-settings-BQIwZoLm.js} +1 -1
- package/dist/web/assets/{api-themes-sSv-6OLk.js → api-themes-CmJZLEY1.js} +1 -1
- package/dist/web/assets/{appearance-settings-section-BMlkj9U2.js → appearance-settings-section-BBlJtEm5.js} +1 -1
- package/dist/web/assets/arrow-left-DpXaakMC.js +1 -0
- package/dist/web/assets/{audio-preview-B4E5_7TW.js → audio-preview-DPMXOZ55.js} +1 -1
- package/dist/web/assets/{bot-D6sx11y0.js → bot-D3-n2i31.js} +1 -1
- package/dist/web/assets/{brain-KDa9jFRq.js → brain-CuAQMSBE.js} +1 -1
- package/dist/web/assets/{button-DX32ffge.js → button-zgoXa9r7.js} +1 -1
- package/dist/web/assets/{calendar-clock-C1asT-gk.js → calendar-clock-CDP7AVjA.js} +1 -1
- package/dist/web/assets/{chat-tab-DmqV3MlC.js → chat-tab-Dn45anqr.js} +4 -4
- package/dist/web/assets/check-BQKbhtoA.js +1 -0
- package/dist/web/assets/{chevron-down-Dp0rpHb8.js → chevron-down-B9puixxZ.js} +1 -1
- package/dist/web/assets/chevron-right-DK_HbYZC.js +1 -0
- package/dist/web/assets/{chevron-up-8PbsNiJp.js → chevron-up-BPAINgoK.js} +1 -1
- package/dist/web/assets/circle-OKk7s0DX.js +1 -0
- package/dist/web/assets/{circle-question-mark-CzR7YRc-.js → circle-question-mark-qcWYO1P_.js} +1 -1
- package/dist/web/assets/clock-BmPiGrSF.js +1 -0
- package/dist/web/assets/code-CRiIHSiv.js +1 -0
- package/dist/web/assets/{code-editor-C4CriX9c.js → code-editor-CKASeDbu.js} +2 -2
- package/dist/web/assets/{conflict-editor-LfQoRcK-.js → conflict-editor-C-Nv8YYj.js} +1 -1
- package/dist/web/assets/{context-menu-CJL8L98s.js → context-menu-DM9CgxGh.js} +1 -1
- package/dist/web/assets/{copy-BewHj66E.js → copy-CXuIH4VC.js} +1 -1
- package/dist/web/assets/{createLucideIcon-D8pyde1A.js → createLucideIcon-D6fVXe3s.js} +1 -1
- package/dist/web/assets/{csv-preview-BEYKn68B.js → csv-preview-ou3KFzIH.js} +1 -1
- package/dist/web/assets/{data-grid-overlay-editor-CbBkhhJa.js → data-grid-overlay-editor-dnWnblYo.js} +1 -1
- package/dist/web/assets/{data-grid-types-DeY60CLU.js → data-grid-types-BfGeMDy0.js} +1 -1
- package/dist/web/assets/{database-Y3ESDK4-.js → database-Dz0W7OH7.js} +1 -1
- package/dist/web/assets/{database-viewer-BL9R-ciJ.js → database-viewer-Ckqg_-SS.js} +1 -1
- package/dist/web/assets/{diff-viewer-D91SI_zb.js → diff-viewer-CMzFnBCD.js} +1 -1
- package/dist/web/assets/{dist-B0J2eYBz.js → dist-CWMPvPem.js} +1 -1
- package/dist/web/assets/{docx-preview-Xy7SZ7Vf.js → docx-preview-B7Aospmh.js} +1 -1
- package/dist/web/assets/{download-DG3_9xXy.js → download-D70Q4Ba6.js} +1 -1
- package/dist/web/assets/{edit-diff-preview-xdDQvPhs.js → edit-diff-preview-BvgPvuhH.js} +1 -1
- package/dist/web/assets/{esm-B-vXxHUd.js → esm-BHyWbWKE.js} +1 -1
- package/dist/web/assets/{explorer-body-ColVUjgk.js → explorer-body-CVx4qaIF.js} +1 -1
- package/dist/web/assets/explorer-window-content-CqKVMkgW.js +1 -0
- package/dist/web/assets/{extension-manager-section-B-BRHGu1.js → extension-manager-section-CtcpVMWs.js} +1 -1
- package/dist/web/assets/{extension-webview-DufzanN9.js → extension-webview-DZ_QRZSM.js} +1 -1
- package/dist/web/assets/{eye-gWwaF4Lg.js → eye-dfZn7evX.js} +1 -1
- package/dist/web/assets/{eye-off-GjXVuAOn.js → eye-off-CmtfyRUD.js} +1 -1
- package/dist/web/assets/{file-exclamation-point-JzhTU2TX.js → file-exclamation-point-D5K2aaLi.js} +1 -1
- package/dist/web/assets/{files-settings-section-Do5YbTUK.js → files-settings-section-D7v-6nTa.js} +1 -1
- package/dist/web/assets/{flask-conical-tp8gyZGh.js → flask-conical-Dix4qNDj.js} +1 -1
- package/dist/web/assets/{folder-symlink-fQRoG_rV.js → folder-symlink-BavsIzoj.js} +1 -1
- package/dist/web/assets/{general-settings-section-B-n_PYzs.js → general-settings-section-BW_h8pdA.js} +1 -1
- package/dist/web/assets/{git-log-panel-BQzOHgxG.js → git-log-panel-BQZkJDu0.js} +1 -1
- package/dist/web/assets/{glide-data-grid-BUS44oLM.js → glide-data-grid-JKEslqGe.js} +4 -4
- package/dist/web/assets/{group-chat-tab-CkHXqorZ.js → group-chat-tab-CTAhtVCr.js} +1 -1
- package/dist/web/assets/{hand-x0ejq3fS.js → hand-CIPALZsE.js} +1 -1
- package/dist/web/assets/{image-preview-fuU4h2nr.js → image-preview-V5SglTWk.js} +1 -1
- package/dist/web/assets/{index-Cx1meAwb.js → index-DVNJ2W5R.js} +7 -7
- package/dist/web/assets/{jira-watcher-section-BQ4hVqWo.js → jira-watcher-section-VyzVbAnw.js} +1 -1
- package/dist/web/assets/{key-round-CQpDrDxg.js → key-round-oIll4vo-.js} +1 -1
- package/dist/web/assets/keybindings-store-B5dEz0n1.js +1 -0
- package/dist/web/assets/{keyboard-DiOYrs6C.js → keyboard-BLwfiRkT.js} +1 -1
- package/dist/web/assets/{keyboard-shortcuts-section-BZUYdXGx.js → keyboard-shortcuts-section-DOJi75mV.js} +1 -1
- package/dist/web/assets/{lib-el9rA30D.js → lib-BAsciSLw.js} +1 -1
- package/dist/web/assets/loader-circle-DxI3O9_f.js +1 -0
- package/dist/web/assets/markdown-renderer-BGPo364Y.js +1 -0
- package/dist/web/assets/markdown-renderer-DtQIHtLs.js +3 -0
- package/dist/web/assets/{media-url-BMeBaB0q.js → media-url-TYMlO0M5.js} +1 -1
- package/dist/web/assets/{mobile-bottom-sheet-CmySDB6I.js → mobile-bottom-sheet-Ch1e_JBq.js} +1 -1
- package/dist/web/assets/mobile-explorer-sheet-C1q_DhrI.js +1 -0
- package/dist/web/assets/{monitor-C835ucWH.js → monitor-CG69bSMW.js} +1 -1
- package/dist/web/assets/notification-store-DvUtkAXs.js +1 -0
- package/dist/web/assets/{notifications-settings-section-JQ3l-Qp-.js → notifications-settings-section-CeRvkXOM.js} +1 -1
- package/dist/web/assets/{number-overlay-editor-DRjTIcPH.js → number-overlay-editor-DldrUNs4.js} +1 -1
- package/dist/web/assets/{overview-panel-DiiA3B_Z.js → overview-panel-DA0QB1-5.js} +1 -1
- package/dist/web/assets/{panel-store-BmdcSBNb.js → panel-store-D42k25jy.js} +1 -1
- package/dist/web/assets/{pdf-preview-B-JAU8JV.js → pdf-preview-Cq33D5ej.js} +1 -1
- package/dist/web/assets/portal-container-context-DeLx1cOI.js +1 -0
- package/dist/web/assets/{postgres-viewer-B--Y59n5.js → postgres-viewer-C__Z0C0s.js} +3 -3
- package/dist/web/assets/power-CvtnQHU4.js +1 -0
- package/dist/web/assets/{ppmbot-settings-section-D1SCOc0_.js → ppmbot-settings-section-Cma4VU7p.js} +1 -1
- package/dist/web/assets/{process-table-D9z7cEmb.js → process-table-DH_HXtGc.js} +1 -1
- package/dist/web/assets/{project-store-wWZ6bjwq.js → project-store-C83MMnlt.js} +1 -1
- package/dist/web/assets/{proxy-settings-section-y7VwH0Hf.js → proxy-settings-section-xrTsFlTF.js} +1 -1
- package/dist/web/assets/{query-audit-section-Ca_gRQ_s.js → query-audit-section-Drk97gb8.js} +1 -1
- package/dist/web/assets/{react-D1Yg256j.js → react-DqIU0LFM.js} +1 -1
- package/dist/web/assets/remote-desktop-mobile-sheet-6JdUr0Bj.js +2 -0
- package/dist/web/assets/{remote-desktop-mobile-view-CGQ8vSf1.js → remote-desktop-mobile-view-Gk8UCVIx.js} +1 -1
- package/dist/web/assets/{remote-desktop-readiness-gate-BmC3b05e.js → remote-desktop-readiness-gate-6reSZvad.js} +1 -1
- package/dist/web/assets/{remote-desktop-window-content-Cdaoltdz.js → remote-desktop-window-content-BW2KqONI.js} +1 -1
- package/dist/web/assets/{run-in-terminal-wHKwAnWP.js → run-in-terminal-DoTOtgQS.js} +1 -1
- package/dist/web/assets/{save-CipGrG1k.js → save-B1y4KIK9.js} +1 -1
- package/dist/web/assets/{schedules-settings-section--0s10CfA.js → schedules-settings-section-DcKEz-S7.js} +1 -1
- package/dist/web/assets/{send-Bb0jtcR6.js → send-B9VUQlEK.js} +1 -1
- package/dist/web/assets/{send-to-chat-BI7-fFpG.js → send-to-chat-Kl-0dNwN.js} +1 -1
- package/dist/web/assets/{separator-W_hJcXPk.js → separator-DvCsdlws.js} +1 -1
- package/dist/web/assets/{settings-body-DEMqFm5z.js → settings-body-CcKls51a.js} +2 -2
- package/dist/web/assets/{settings-store-CzLnTR8p.js → settings-store-_s4xFcFq.js} +2 -2
- package/dist/web/assets/settings-tab-ChAk8nh2.js +1 -0
- package/dist/web/assets/settings-window-content-sA1K0cPW.js +1 -0
- package/dist/web/assets/{shield-check-BsG3LV8i.js → shield-check-BJSX7cAS.js} +1 -1
- package/dist/web/assets/{shield-off-7jKWpJBD.js → shield-off-E1cQwXdc.js} +1 -1
- package/dist/web/assets/{sparkles-Dh-_J2Rd.js → sparkles-blTKn0vi.js} +1 -1
- package/dist/web/assets/{sql-query-editor-Clo90z8-.js → sql-query-editor-BoYxc5vd.js} +1 -1
- package/dist/web/assets/{sqlite-viewer-C08QQR_L.js → sqlite-viewer-O5lF3MMj.js} +1 -1
- package/dist/web/assets/{streaming-store-9XVmAMfV.js → streaming-store-QQvg1cS-.js} +1 -1
- package/dist/web/assets/{system-monitor-body-30-TFH3a.js → system-monitor-body-C2mVJ7PV.js} +2 -2
- package/dist/web/assets/system-monitor-tab-tXkg3jpV.js +1 -0
- package/dist/web/assets/system-monitor-window-content-BaKoFDEz.js +1 -0
- package/dist/web/assets/{tab-host-window-content-C6eG_Rf1.js → tab-host-window-content-C7F6D8hJ.js} +1 -1
- package/dist/web/assets/{tab-store-1xYJb0gM.js → tab-store-B2ip0-Mv.js} +1 -1
- package/dist/web/assets/{table-CRJsmfeg.js → table-8HT8BG30.js} +1 -1
- package/dist/web/assets/team-member-sheet-BA70_jmM.js +2 -0
- package/dist/web/assets/{team-member-window-content-BN3luct-.js → team-member-window-content-BwOTsc9r.js} +1 -1
- package/dist/web/assets/{terminal-tab-afylLiLY.js → terminal-tab-DlZW3MCn.js} +1 -1
- package/dist/web/assets/{text-wrap-oiekm5SB.js → text-wrap-DafY0-Pa.js} +1 -1
- package/dist/web/assets/{tool-cards-Ct1QdT8c.js → tool-cards-yiwO861p.js} +3 -3
- package/dist/web/assets/{use-accounts-data-C0bvcMhi.js → use-accounts-data-B9t4BQaI.js} +1 -1
- package/dist/web/assets/{use-blob-url-CrwoZJUJ.js → use-blob-url-D358Rpyp.js} +1 -1
- package/dist/web/assets/{use-coarse-long-press-BmI_GVW5.js → use-coarse-long-press-BsBpxWup.js} +1 -1
- package/dist/web/assets/{use-inline-blame-C1G-_NjC.js → use-inline-blame-D2pZjDoA.js} +1 -1
- package/dist/web/assets/{use-is-mobile-D1weanbj.js → use-is-mobile-Bi42QhIi.js} +1 -1
- package/dist/web/assets/{use-monaco-theme-cgPbRDUm.js → use-monaco-theme-DTPfPPvF.js} +1 -1
- package/dist/web/assets/use-open-team-member-DGEx9xB0.js +1 -0
- package/dist/web/assets/{use-remote-desktop-display-choice-DSqF1Rgx.js → use-remote-desktop-display-choice-BnVT4dhX.js} +1 -1
- package/dist/web/assets/{use-visual-viewport-Bfl3Bxxb.js → use-visual-viewport-CNdG4QHH.js} +1 -1
- package/dist/web/assets/use-websocket-DQg9BQcq.js +1 -0
- package/dist/web/assets/{vendor-markdown-Ls5AcU91.js → vendor-markdown-CuWCHIVb.js} +1 -1
- package/dist/web/assets/{vendor-ui-CaeeFO0B.js → vendor-ui-BBdkypKW.js} +1 -1
- package/dist/web/assets/{video-preview-BTzstVhM.js → video-preview-Dc4YbBqm.js} +1 -1
- package/dist/web/assets/{window-pip-registry-CrCYYTTf.js → window-pip-registry-BWxaVLj5.js} +1 -1
- package/dist/web/assets/{window-store-D0HbQ1pM.js → window-store-CfxP5yor.js} +1 -1
- package/dist/web/assets/ws-auth-FRzMmfQx.js +1 -0
- package/dist/web/assets/x-Bdaog6Az.js +1 -0
- package/dist/web/index.html +38 -38
- package/dist/web/sw.js +1 -1
- package/docs/architecture/ai-chat-and-providers.md +4 -0
- package/package.json +1 -1
- package/src/services/db.service.ts +18 -4
- package/src/web/components/shared/markdown-context.ts +6 -0
- package/src/web/components/shared/markdown-renderer.tsx +7 -3
- package/src/web/hooks/use-chat.ts +4 -0
- package/src/web/hooks/use-websocket.ts +7 -1
- package/dist/web/assets/ai-settings-section-BePrVceb.js +0 -1
- package/dist/web/assets/api-client-QfreGirP.js +0 -1
- package/dist/web/assets/arrow-left-CyFcsyzD.js +0 -1
- package/dist/web/assets/check-DN75Ucvz.js +0 -1
- package/dist/web/assets/chevron-right-De-Wz5Lz.js +0 -1
- package/dist/web/assets/circle-BCy0AUCo.js +0 -1
- package/dist/web/assets/clock-C1CQUQPZ.js +0 -1
- package/dist/web/assets/code-DJgYrFzm.js +0 -1
- package/dist/web/assets/explorer-window-content-VSMJfZC2.js +0 -1
- package/dist/web/assets/keybindings-store-yYx88hvw.js +0 -1
- package/dist/web/assets/loader-circle-DPMrnLQ2.js +0 -1
- package/dist/web/assets/markdown-renderer-BA3C2L-a.js +0 -3
- package/dist/web/assets/markdown-renderer-CMFkajd7.js +0 -1
- package/dist/web/assets/mobile-explorer-sheet-gvO7a80O.js +0 -1
- package/dist/web/assets/notification-store-CCh6a8RD.js +0 -1
- package/dist/web/assets/portal-container-context-DKymYOY-.js +0 -1
- package/dist/web/assets/power-CriQkeK5.js +0 -1
- package/dist/web/assets/remote-desktop-mobile-sheet-CdO2aMXl.js +0 -2
- package/dist/web/assets/settings-tab-Dh1FpBny.js +0 -1
- package/dist/web/assets/settings-window-content-3KrQ6imZ.js +0 -1
- package/dist/web/assets/system-monitor-tab-ChIXfOWg.js +0 -1
- package/dist/web/assets/system-monitor-window-content-C1Cd_pT7.js +0 -1
- package/dist/web/assets/team-member-sheet-BhatQbL1.js +0 -2
- package/dist/web/assets/use-open-team-member-CSUU7Z8N.js +0 -1
- package/dist/web/assets/use-websocket-BQssVSIR.js +0 -1
- package/dist/web/assets/ws-auth-D111jj32.js +0 -1
- package/dist/web/assets/x-CxoBA0po.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/general-settings-section-
|
|
2
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import{t as r}from"./createLucideIcon-D8pyde1A.js";import{t as i}from"./arrow-left-CyFcsyzD.js";import{t as a}from"./bot-D6sx11y0.js";import{t as o}from"./calendar-clock-C1asT-gk.js";import{t as s}from"./chevron-right-De-Wz5Lz.js";import{t as c}from"./key-round-CQpDrDxg.js";import{t as l}from"./keyboard-DiOYrs6C.js";import{t as u}from"./loader-circle-DPMrnLQ2.js";import{q as d}from"./vendor-mermaid-CfY1-PkA.js";import{n as f}from"./utils-IrnQujwR.js";import{t as p}from"./button-DX32ffge.js";import{Ir as m,J as h,Kn as g,Lr as _,Zn as v,_r as y,rr as b}from"./index-Cx1meAwb.js";import{t as x}from"./separator-W_hJcXPk.js";var S=r(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]),C=r(`database-zap`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 15 21.84`,key:`14ibmq`}],[`path`,{d:`M21 5V8`,key:`1marbg`}],[`path`,{d:`M21 12L18 17H22L19 22`,key:`zafso`}],[`path`,{d:`M3 12A9 3 0 0 0 14.59 14.87`,key:`1y4wr8`}]]),w=r(`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`}]]),T=[{id:`core`,label:null},{id:`ai`,label:`AI & Accounts`},{id:`integrations`,label:`Integrations`},{id:`advanced`,label:`Advanced`}],E=[{id:`general`,group:`core`,label:`General`,subtitle:`Device name, password, version`,icon:g},{id:`appearance`,group:`core`,label:`Appearance`,subtitle:`Theme, tabs, explorer skin`,icon:b},{id:`ai-provider`,group:`ai`,label:`AI Provider`,subtitle:`Model, execution mode, limits`,icon:a},{id:`accounts`,group:`ai`,label:`Accounts`,subtitle:`Claude and Codex sign-ins, rotation`,icon:c},{id:`ppmbot`,group:`integrations`,label:`PPMBot`,subtitle:`Telegram AI bot`,icon:_},{id:`notifications`,group:`integrations`,label:`Notifications`,subtitle:`Push & Telegram alerts`,icon:S},{id:`jira`,group:`integrations`,label:`Jira Watcher`,subtitle:`Auto-debug Jira tickets`,icon:m},{id:`extensions`,group:`integrations`,label:`Extensions`,subtitle:`Install and manage extensions`,icon:v},{id:`proxy`,group:`integrations`,label:`API Proxy`,subtitle:`Expose accounts as Anthropic API`,icon:y},{id:`schedules`,group:`advanced`,label:`Scheduled Agents`,subtitle:`Run Claude on a cron schedule`,icon:o},{id:`shortcuts`,group:`advanced`,label:`Keyboard Shortcuts`,subtitle:`Customize key bindings`,icon:l},{id:`files`,group:`advanced`,label:`File Filters`,subtitle:`Exclude patterns, ignore files`,icon:w},{id:`query-audit`,group:`advanced`,label:`Query Audit Log`,subtitle:`SQL history retention and size`,icon:C}];function D(e){return typeof e==`string`&&E.some(t=>t.id===e)}function O(e){return E.find(t=>t.id===e)}function k(e){return E.filter(t=>t.group===e)}var A=n();function j({active:e,onSelect:t}){return(0,A.jsx)(h,{className:`h-full`,children:(0,A.jsx)(`nav`,{className:`p-2 space-y-4`,"aria-label":`Settings categories`,children:T.map(n=>{let r=k(n.id);return r.length===0?null:(0,A.jsxs)(`div`,{className:`space-y-1`,children:[n.label&&(0,A.jsx)(`h3`,{className:`px-2 pt-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:n.label}),r.map(n=>{let r=n.icon,i=n.id===e;return(0,A.jsxs)(`button`,{onClick:()=>t(n.id),"data-testid":`settings-rail-${n.id}`,"aria-current":i?`page`:void 0,className:f(`w-full flex items-center gap-2.5 px-2.5 py-2 rounded-md text-left cursor-pointer transition-colors`,i?`bg-accent text-accent-foreground`:`hover:bg-accent/50 active:bg-accent`),children:[(0,A.jsx)(r,{className:f(`size-4 shrink-0`,i?`text-foreground`:`text-muted-foreground`)}),(0,A.jsx)(`span`,{className:`text-sm truncate`,children:n.label})]},n.id)})]},n.id)})})})}function M({onSelect:e}){return(0,A.jsx)(h,{className:`h-full`,children:(0,A.jsx)(`nav`,{className:`p-3 space-y-5`,"aria-label":`Settings categories`,children:T.map(t=>{let n=k(t.id);return n.length===0?null:(0,A.jsxs)(`div`,{className:`space-y-1`,children:[t.label&&(0,A.jsx)(`h3`,{className:`px-1 pb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:t.label}),n.map(t=>{let n=t.icon;return(0,A.jsxs)(`button`,{onClick:()=>e(t.id),"data-testid":`settings-index-${t.id}`,className:`w-full flex items-center gap-3 px-2.5 py-3 rounded-lg text-left cursor-pointer group hover:bg-accent/50 active:bg-accent transition-colors`,children:[(0,A.jsx)(`div`,{className:`size-10 rounded-md bg-muted flex items-center justify-center shrink-0 group-hover:bg-accent`,children:(0,A.jsx)(n,{className:`size-4 text-muted-foreground`})}),(0,A.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium truncate`,children:t.label}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:t.subtitle})]}),(0,A.jsx)(s,{className:`size-4 text-muted-foreground shrink-0`})]},t.id)})]},t.id)})})})}var N=e(t(),1),P={general:(0,N.lazy)(()=>d(()=>import(`./general-settings-section-B-n_PYzs.js`).then(e=>({default:e.GeneralSettingsSection})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46]))),appearance:(0,N.lazy)(()=>d(()=>import(`./appearance-settings-section-BMlkj9U2.js`).then(e=>({default:e.AppearanceSettingsSection})),__vite__mapDeps([47,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,48,46]))),"ai-provider":(0,N.lazy)(()=>d(()=>import(`./ai-settings-section-BePrVceb.js`).then(e=>({default:e.AISettingsSection})),__vite__mapDeps([49,4,1,5,27,29,28,50,2,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,51]))),accounts:(0,N.lazy)(()=>d(()=>import(`./accounts-settings-section-B-F7U-gq.js`).then(e=>({default:e.AccountsSettingsSection})),__vite__mapDeps([52,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,53,45,54,51]))),ppmbot:(0,N.lazy)(()=>d(()=>import(`./ppmbot-settings-section-D1SCOc0_.js`).then(e=>({default:e.PPMBotSettingsSection})),__vite__mapDeps([55,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,56,57,46]))),notifications:(0,N.lazy)(()=>d(()=>import(`./notifications-settings-section-JQ3l-Qp-.js`).then(e=>({default:e.NotificationsSettingsSection})),__vite__mapDeps([58,2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46]))),jira:(0,N.lazy)(()=>d(()=>import(`./jira-watcher-section-BQ4hVqWo.js`).then(e=>({default:e.JiraWatcherSection})),__vite__mapDeps([59,2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]))),extensions:(0,N.lazy)(()=>d(()=>import(`./extension-manager-section-B-BRHGu1.js`).then(e=>({default:e.ExtensionManagerSection})),__vite__mapDeps([60,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,61,62]))),proxy:(0,N.lazy)(()=>d(()=>import(`./proxy-settings-section-y7VwH0Hf.js`).then(e=>({default:e.ProxySettingsSection})),__vite__mapDeps([63,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,53,51]))),schedules:(0,N.lazy)(()=>d(()=>import(`./schedules-settings-section--0s10CfA.js`).then(e=>({default:e.SchedulesSettingsSection})),__vite__mapDeps([64,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,65,62]))),shortcuts:(0,N.lazy)(()=>d(()=>import(`./keyboard-shortcuts-section-BZUYdXGx.js`).then(e=>({default:e.KeyboardShortcutsSection})),__vite__mapDeps([66,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]))),files:(0,N.lazy)(()=>d(()=>import(`./files-settings-section-Do5YbTUK.js`).then(e=>({default:e.FilesSettingsSection})),__vite__mapDeps([67,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46]))),"query-audit":(0,N.lazy)(()=>d(()=>import(`./query-audit-section-Ca_gRQ_s.js`).then(e=>({default:e.QueryAuditSection})),__vite__mapDeps([68,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,51])))};function F({category:e}){let t=P[e];return(0,A.jsx)(N.Suspense,{fallback:(0,A.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,A.jsx)(u,{className:`size-5 animate-spin text-muted-foreground`})}),children:(0,A.jsx)(t,{})})}function I({initialCategory:e,onCategoryChange:t}){let[n,r]=(0,N.useState)(e??`general`),[a,o]=(0,N.useState)(e===void 0),s=O(n),c=s.icon;function l(e){r(e),o(!1),t?.(e)}return(0,A.jsx)(`div`,{className:`@container h-full w-full`,"data-testid":`settings-window`,"data-category":n,children:(0,A.jsxs)(`div`,{className:`h-full w-full flex`,children:[(0,A.jsx)(`aside`,{className:`hidden @[640px]:flex @[640px]:flex-col w-[210px] shrink-0 border-r border-border min-h-0`,"data-testid":`settings-rail`,children:(0,A.jsx)(j,{active:n,onSelect:l})}),(0,A.jsxs)(`div`,{className:`relative flex-1 min-w-0`,children:[(0,A.jsxs)(`div`,{className:`h-full flex flex-col min-h-0`,children:[(0,A.jsxs)(`div`,{className:`shrink-0 flex items-center gap-2 px-2 py-2.5 @[640px]:px-4`,children:[(0,A.jsx)(p,{variant:`ghost`,size:`icon`,"aria-label":`Back to settings list`,className:`size-9 shrink-0 cursor-pointer @[640px]:hidden`,onClick:()=>o(!0),children:(0,A.jsx)(i,{className:`size-4`})}),(0,A.jsx)(c,{className:`size-4 text-muted-foreground shrink-0`}),(0,A.jsx)(`h2`,{className:`text-sm font-semibold truncate`,"data-testid":`settings-pane-title`,children:s.label})]}),(0,A.jsx)(x,{}),(0,A.jsx)(h,{className:`flex-1 min-h-0`,children:(0,A.jsx)(`div`,{className:`p-4 pb-8`,children:(0,A.jsx)(F,{category:n})})})]}),a&&(0,A.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background flex flex-col min-h-0 @[640px]:hidden`,"data-testid":`settings-index`,children:[(0,A.jsx)(`div`,{className:`shrink-0 px-4 py-3`,children:(0,A.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Settings`})}),(0,A.jsx)(x,{}),(0,A.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,A.jsx)(M,{onSelect:l})})]})]})]})})}export{D as n,I as t};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/general-settings-section-BW_h8pdA.js","assets/rolldown-runtime-FhOqtrmT.js","assets/index-DVNJ2W5R.js","assets/vendor-mermaid-CfY1-PkA.js","assets/vendor-ui-BBdkypKW.js","assets/vendor-markdown-CuWCHIVb.js","assets/button-zgoXa9r7.js","assets/utils-IrnQujwR.js","assets/createLucideIcon-D6fVXe3s.js","assets/arrow-left-DpXaakMC.js","assets/bot-D3-n2i31.js","assets/check-BQKbhtoA.js","assets/chevron-down-B9puixxZ.js","assets/chevron-right-DK_HbYZC.js","assets/chevron-up-BPAINgoK.js","assets/circle-OKk7s0DX.js","assets/clock-BmPiGrSF.js","assets/sparkles-blTKn0vi.js","assets/copy-CXuIH4VC.js","assets/database-Dz0W7OH7.js","assets/download-D70Q4Ba6.js","assets/use-coarse-long-press-BsBpxWup.js","assets/eye-off-CmtfyRUD.js","assets/eye-dfZn7evX.js","assets/loader-circle-DxI3O9_f.js","assets/monitor-CG69bSMW.js","assets/x-Bdaog6Az.js","assets/api-client-DwXlVfXP.js","assets/react-DqIU0LFM.js","assets/window-store-CfxP5yor.js","assets/window-pip-registry-BWxaVLj5.js","assets/panel-store-D42k25jy.js","assets/context-menu-DM9CgxGh.js","assets/portal-container-context-DeLx1cOI.js","assets/mobile-bottom-sheet-Ch1e_JBq.js","assets/use-visual-viewport-CNdG4QHH.js","assets/use-is-mobile-Bi42QhIi.js","assets/project-store-C83MMnlt.js","assets/ws-auth-FRzMmfQx.js","assets/settings-store-_s4xFcFq.js","assets/streaming-store-QQvg1cS-.js","assets/tab-store-B2ip0-Mv.js","assets/apply-theme-BVXAUYoN.js","assets/resolve-theme-CMp5xxCW.js","assets/index-B9Wbjl0o.css","assets/key-round-oIll4vo-.js","assets/separator-DvCsdlws.js","assets/appearance-settings-section-BBlJtEm5.js","assets/text-wrap-DafY0-Pa.js","assets/ai-settings-section-446NZWhI.js","assets/ai-settings-section-M07DCjAI.js","assets/api-settings-BQIwZoLm.js","assets/accounts-settings-section-CRXY4Bsc.js","assets/flask-conical-Dix4qNDj.js","assets/use-accounts-data-B9t4BQaI.js","assets/ppmbot-settings-section-Cma4VU7p.js","assets/brain-CuAQMSBE.js","assets/send-B9VUQlEK.js","assets/notifications-settings-section-CeRvkXOM.js","assets/jira-watcher-section-VyzVbAnw.js","assets/extension-manager-section-CtcpVMWs.js","assets/folder-symlink-BavsIzoj.js","assets/power-CvtnQHU4.js","assets/proxy-settings-section-xrTsFlTF.js","assets/schedules-settings-section-DcKEz-S7.js","assets/calendar-clock-CDP7AVjA.js","assets/keyboard-shortcuts-section-DOJi75mV.js","assets/files-settings-section-D7v-6nTa.js","assets/query-audit-section-Drk97gb8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import{t as r}from"./createLucideIcon-D6fVXe3s.js";import{t as i}from"./arrow-left-DpXaakMC.js";import{t as a}from"./bot-D3-n2i31.js";import{t as o}from"./calendar-clock-CDP7AVjA.js";import{t as s}from"./chevron-right-DK_HbYZC.js";import{t as c}from"./key-round-oIll4vo-.js";import{t as l}from"./keyboard-BLwfiRkT.js";import{t as u}from"./loader-circle-DxI3O9_f.js";import{q as d}from"./vendor-mermaid-CfY1-PkA.js";import{n as f}from"./utils-IrnQujwR.js";import{t as p}from"./button-zgoXa9r7.js";import{Ir as m,J as h,Kn as g,Lr as _,Zn as v,_r as y,rr as b}from"./index-DVNJ2W5R.js";import{t as x}from"./separator-DvCsdlws.js";var S=r(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]),C=r(`database-zap`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 15 21.84`,key:`14ibmq`}],[`path`,{d:`M21 5V8`,key:`1marbg`}],[`path`,{d:`M21 12L18 17H22L19 22`,key:`zafso`}],[`path`,{d:`M3 12A9 3 0 0 0 14.59 14.87`,key:`1y4wr8`}]]),w=r(`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`}]]),T=[{id:`core`,label:null},{id:`ai`,label:`AI & Accounts`},{id:`integrations`,label:`Integrations`},{id:`advanced`,label:`Advanced`}],E=[{id:`general`,group:`core`,label:`General`,subtitle:`Device name, password, version`,icon:g},{id:`appearance`,group:`core`,label:`Appearance`,subtitle:`Theme, tabs, explorer skin`,icon:b},{id:`ai-provider`,group:`ai`,label:`AI Provider`,subtitle:`Model, execution mode, limits`,icon:a},{id:`accounts`,group:`ai`,label:`Accounts`,subtitle:`Claude and Codex sign-ins, rotation`,icon:c},{id:`ppmbot`,group:`integrations`,label:`PPMBot`,subtitle:`Telegram AI bot`,icon:_},{id:`notifications`,group:`integrations`,label:`Notifications`,subtitle:`Push & Telegram alerts`,icon:S},{id:`jira`,group:`integrations`,label:`Jira Watcher`,subtitle:`Auto-debug Jira tickets`,icon:m},{id:`extensions`,group:`integrations`,label:`Extensions`,subtitle:`Install and manage extensions`,icon:v},{id:`proxy`,group:`integrations`,label:`API Proxy`,subtitle:`Expose accounts as Anthropic API`,icon:y},{id:`schedules`,group:`advanced`,label:`Scheduled Agents`,subtitle:`Run Claude on a cron schedule`,icon:o},{id:`shortcuts`,group:`advanced`,label:`Keyboard Shortcuts`,subtitle:`Customize key bindings`,icon:l},{id:`files`,group:`advanced`,label:`File Filters`,subtitle:`Exclude patterns, ignore files`,icon:w},{id:`query-audit`,group:`advanced`,label:`Query Audit Log`,subtitle:`SQL history retention and size`,icon:C}];function D(e){return typeof e==`string`&&E.some(t=>t.id===e)}function O(e){return E.find(t=>t.id===e)}function k(e){return E.filter(t=>t.group===e)}var A=n();function j({active:e,onSelect:t}){return(0,A.jsx)(h,{className:`h-full`,children:(0,A.jsx)(`nav`,{className:`p-2 space-y-4`,"aria-label":`Settings categories`,children:T.map(n=>{let r=k(n.id);return r.length===0?null:(0,A.jsxs)(`div`,{className:`space-y-1`,children:[n.label&&(0,A.jsx)(`h3`,{className:`px-2 pt-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:n.label}),r.map(n=>{let r=n.icon,i=n.id===e;return(0,A.jsxs)(`button`,{onClick:()=>t(n.id),"data-testid":`settings-rail-${n.id}`,"aria-current":i?`page`:void 0,className:f(`w-full flex items-center gap-2.5 px-2.5 py-2 rounded-md text-left cursor-pointer transition-colors`,i?`bg-accent text-accent-foreground`:`hover:bg-accent/50 active:bg-accent`),children:[(0,A.jsx)(r,{className:f(`size-4 shrink-0`,i?`text-foreground`:`text-muted-foreground`)}),(0,A.jsx)(`span`,{className:`text-sm truncate`,children:n.label})]},n.id)})]},n.id)})})})}function M({onSelect:e}){return(0,A.jsx)(h,{className:`h-full`,children:(0,A.jsx)(`nav`,{className:`p-3 space-y-5`,"aria-label":`Settings categories`,children:T.map(t=>{let n=k(t.id);return n.length===0?null:(0,A.jsxs)(`div`,{className:`space-y-1`,children:[t.label&&(0,A.jsx)(`h3`,{className:`px-1 pb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:t.label}),n.map(t=>{let n=t.icon;return(0,A.jsxs)(`button`,{onClick:()=>e(t.id),"data-testid":`settings-index-${t.id}`,className:`w-full flex items-center gap-3 px-2.5 py-3 rounded-lg text-left cursor-pointer group hover:bg-accent/50 active:bg-accent transition-colors`,children:[(0,A.jsx)(`div`,{className:`size-10 rounded-md bg-muted flex items-center justify-center shrink-0 group-hover:bg-accent`,children:(0,A.jsx)(n,{className:`size-4 text-muted-foreground`})}),(0,A.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium truncate`,children:t.label}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:t.subtitle})]}),(0,A.jsx)(s,{className:`size-4 text-muted-foreground shrink-0`})]},t.id)})]},t.id)})})})}var N=e(t(),1),P={general:(0,N.lazy)(()=>d(()=>import(`./general-settings-section-BW_h8pdA.js`).then(e=>({default:e.GeneralSettingsSection})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46]))),appearance:(0,N.lazy)(()=>d(()=>import(`./appearance-settings-section-BBlJtEm5.js`).then(e=>({default:e.AppearanceSettingsSection})),__vite__mapDeps([47,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,48,46]))),"ai-provider":(0,N.lazy)(()=>d(()=>import(`./ai-settings-section-446NZWhI.js`).then(e=>({default:e.AISettingsSection})),__vite__mapDeps([49,4,1,5,27,29,28,50,2,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,51]))),accounts:(0,N.lazy)(()=>d(()=>import(`./accounts-settings-section-CRXY4Bsc.js`).then(e=>({default:e.AccountsSettingsSection})),__vite__mapDeps([52,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,53,45,54,51]))),ppmbot:(0,N.lazy)(()=>d(()=>import(`./ppmbot-settings-section-Cma4VU7p.js`).then(e=>({default:e.PPMBotSettingsSection})),__vite__mapDeps([55,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,56,57,46]))),notifications:(0,N.lazy)(()=>d(()=>import(`./notifications-settings-section-CeRvkXOM.js`).then(e=>({default:e.NotificationsSettingsSection})),__vite__mapDeps([58,2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46]))),jira:(0,N.lazy)(()=>d(()=>import(`./jira-watcher-section-VyzVbAnw.js`).then(e=>({default:e.JiraWatcherSection})),__vite__mapDeps([59,2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]))),extensions:(0,N.lazy)(()=>d(()=>import(`./extension-manager-section-CtcpVMWs.js`).then(e=>({default:e.ExtensionManagerSection})),__vite__mapDeps([60,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,61,62]))),proxy:(0,N.lazy)(()=>d(()=>import(`./proxy-settings-section-xrTsFlTF.js`).then(e=>({default:e.ProxySettingsSection})),__vite__mapDeps([63,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,53,51]))),schedules:(0,N.lazy)(()=>d(()=>import(`./schedules-settings-section-DcKEz-S7.js`).then(e=>({default:e.SchedulesSettingsSection})),__vite__mapDeps([64,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,65,62]))),shortcuts:(0,N.lazy)(()=>d(()=>import(`./keyboard-shortcuts-section-DOJi75mV.js`).then(e=>({default:e.KeyboardShortcutsSection})),__vite__mapDeps([66,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]))),files:(0,N.lazy)(()=>d(()=>import(`./files-settings-section-D7v-6nTa.js`).then(e=>({default:e.FilesSettingsSection})),__vite__mapDeps([67,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46]))),"query-audit":(0,N.lazy)(()=>d(()=>import(`./query-audit-section-Drk97gb8.js`).then(e=>({default:e.QueryAuditSection})),__vite__mapDeps([68,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,51])))};function F({category:e}){let t=P[e];return(0,A.jsx)(N.Suspense,{fallback:(0,A.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,A.jsx)(u,{className:`size-5 animate-spin text-muted-foreground`})}),children:(0,A.jsx)(t,{})})}function I({initialCategory:e,onCategoryChange:t}){let[n,r]=(0,N.useState)(e??`general`),[a,o]=(0,N.useState)(e===void 0),s=O(n),c=s.icon;function l(e){r(e),o(!1),t?.(e)}return(0,A.jsx)(`div`,{className:`@container h-full w-full`,"data-testid":`settings-window`,"data-category":n,children:(0,A.jsxs)(`div`,{className:`h-full w-full flex`,children:[(0,A.jsx)(`aside`,{className:`hidden @[640px]:flex @[640px]:flex-col w-[210px] shrink-0 border-r border-border min-h-0`,"data-testid":`settings-rail`,children:(0,A.jsx)(j,{active:n,onSelect:l})}),(0,A.jsxs)(`div`,{className:`relative flex-1 min-w-0`,children:[(0,A.jsxs)(`div`,{className:`h-full flex flex-col min-h-0`,children:[(0,A.jsxs)(`div`,{className:`shrink-0 flex items-center gap-2 px-2 py-2.5 @[640px]:px-4`,children:[(0,A.jsx)(p,{variant:`ghost`,size:`icon`,"aria-label":`Back to settings list`,className:`size-9 shrink-0 cursor-pointer @[640px]:hidden`,onClick:()=>o(!0),children:(0,A.jsx)(i,{className:`size-4`})}),(0,A.jsx)(c,{className:`size-4 text-muted-foreground shrink-0`}),(0,A.jsx)(`h2`,{className:`text-sm font-semibold truncate`,"data-testid":`settings-pane-title`,children:s.label})]}),(0,A.jsx)(x,{}),(0,A.jsx)(h,{className:`flex-1 min-h-0`,children:(0,A.jsx)(`div`,{className:`p-4 pb-8`,children:(0,A.jsx)(F,{category:n})})})]}),a&&(0,A.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background flex flex-col min-h-0 @[640px]:hidden`,"data-testid":`settings-index`,children:[(0,A.jsx)(`div`,{className:`shrink-0 px-4 py-3`,children:(0,A.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Settings`})}),(0,A.jsx)(x,{}),(0,A.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,A.jsx)(M,{onSelect:l})})]})]})]})})}export{D as n,I as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/api-themes-
|
|
2
|
-
import{r as e}from"./api-client-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/api-themes-CmJZLEY1.js","assets/vendor-ui-BBdkypKW.js","assets/rolldown-runtime-FhOqtrmT.js","assets/vendor-markdown-CuWCHIVb.js","assets/api-client-DwXlVfXP.js","assets/api-settings-BQIwZoLm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./api-client-DwXlVfXP.js";import{t}from"./react-DqIU0LFM.js";import{q as n}from"./vendor-mermaid-CfY1-PkA.js";var r=`ppm-settings`,i=[`aurora`,`slate`,`precision`,`custom`],a=[`dark`,`light`,`system`];function o(){try{let e=localStorage.getItem(r);if(e)return JSON.parse(e)}catch{}return{}}function s(e){return e.themeStyle&&i.includes(e.themeStyle)&&e.themeMode&&a.includes(e.themeMode)?{style:e.themeStyle,mode:e.themeMode,customThemeId:e.customThemeId}:e.theme&&a.includes(e.theme)?{style:`aurora`,mode:e.theme}:{style:`aurora`,mode:`system`}}function c(e){return typeof e==`string`?[`explorer`,`git`,`database`,`search`,`jira`,`ai-resources`,`history`,`tunnels`,`teams`].includes(e)||e.startsWith(`ext:`):!1}function l(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e)c(r)&&!t.has(r)&&(t.add(r),n.push(r));return n}var u={conns:[],groups:[`__ungrouped__`],tables:[]},d={conns:200,groups:200,tables:500};function f(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e,n=(e,t)=>Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0&&e.length<=300).slice(0,t):[];return{conns:Array.isArray(t.conns)?t.conns.filter(e=>typeof e==`number`&&Number.isInteger(e)).slice(0,d.conns):[],groups:n(t.groups,d.groups),tables:n(t.tables,d.tables)}}function p(e){let t=o();localStorage.setItem(r,JSON.stringify({...t,...e}))}var m=null,h={};function g(t){let{theme:n,themeStyle:r,themeMode:i,customThemeId:a,...o}=t;Object.keys(o).length!==0&&(Object.assign(h,o),m&&clearTimeout(m),m=setTimeout(()=>{let t=h;h={},m=null;let n=e();fetch(`/api/settings/ui-prefs`,{method:`PUT`,headers:{"Content-Type":`application/json`,...n?{Authorization:`Bearer ${n}`}:{}},body:JSON.stringify(t)}).catch(()=>{})},400))}function _(e){p(e),g(e)}function v(t,n,r){let i=e();return fetch(`/api/settings/theme`,{method:`PUT`,headers:{"Content-Type":`application/json`,...i?{Authorization:`Bearer ${i}`}:{}},body:JSON.stringify({style:t,mode:n,...r?{customThemeId:r}:{}})}).then(()=>{}).catch(()=>{})}function y(e){let t={};typeof e.wordWrap==`boolean`&&(t.wordWrap=e.wordWrap),typeof e.inlineBlame==`boolean`&&(t.inlineBlame=e.inlineBlame),typeof e.tabWrap==`boolean`&&(t.tabWrap=e.tabWrap),typeof e.sidebarCollapsed==`boolean`&&(t.sidebarCollapsed=e.sidebarCollapsed),typeof e.sidebarWidth==`number`&&e.sidebarWidth>=200&&e.sidebarWidth<=600&&(t.sidebarWidth=e.sidebarWidth),(e.gitStatusViewMode===`flat`||e.gitStatusViewMode===`tree`)&&(t.gitStatusViewMode=e.gitStatusViewMode),(e.editorTabStyle===`default`||e.editorTabStyle===`boxed`||e.editorTabStyle===`pill`)&&(t.editorTabStyle=e.editorTabStyle),c(e.sidebarActiveTab)&&(t.sidebarActiveTab=e.sidebarActiveTab),Array.isArray(e.sidebarTabOrder)&&(t.sidebarTabOrder=l(e.sidebarTabOrder)),typeof e.jiraEnabled==`boolean`&&(t.jiraEnabled=e.jiraEnabled),(e.dockPosition===`left`||e.dockPosition===`bottom`||e.dockPosition===`right`)&&(t.dockPosition=e.dockPosition),(e.explorerSkin===`auto`||e.explorerSkin===`windows`||e.explorerSkin===`macos`)&&(t.explorerSkin=e.explorerSkin),typeof e.remoteDesktopStatsVisible==`boolean`&&(t.remoteDesktopStatsVisible=e.remoteDesktopStatsVisible),typeof e.remoteDesktopWarningDismissed==`boolean`&&(t.remoteDesktopWarningDismissed=e.remoteDesktopWarningDismissed),typeof e.keepScreenAwake==`boolean`&&(t.keepScreenAwake=e.keepScreenAwake);let n=f(e.dbSidebarExpanded);n&&(t.dbSidebarExpanded=n),Object.keys(t).length!==0&&(p(t),S.setState(t))}var b=o(),x=s(b),S=t((t,r)=>({themeStyle:x.style,themeMode:x.mode,customThemeId:x.customThemeId,customThemes:[],sidebarCollapsed:b.sidebarCollapsed??!1,sidebarWidth:b.sidebarWidth??280,gitStatusViewMode:b.gitStatusViewMode===`flat`?`flat`:`tree`,inlineBlame:b.inlineBlame??!1,wordWrap:b.wordWrap??!1,tabWrap:b.tabWrap??!1,editorTabStyle:b.editorTabStyle===`boxed`||b.editorTabStyle===`pill`?b.editorTabStyle:`default`,sidebarActiveTab:c(b.sidebarActiveTab)?b.sidebarActiveTab:`history`,sidebarTabOrder:l(b.sidebarTabOrder),jiraEnabled:b.jiraEnabled??!1,dockPosition:b.dockPosition===`left`||b.dockPosition===`right`?b.dockPosition:`bottom`,dbSidebarExpanded:f(b.dbSidebarExpanded)??u,explorerSkin:b.explorerSkin===`windows`||b.explorerSkin===`macos`?b.explorerSkin:`auto`,remoteDesktopStatsVisible:b.remoteDesktopStatsVisible??!1,remoteDesktopWarningDismissed:b.remoteDesktopWarningDismissed??!1,keepScreenAwake:b.keepScreenAwake??!0,deviceName:null,version:null,tunnelActive:!1,setThemeStyle:e=>{let n=r().themeMode,i=e===`custom`?r().customThemeId:void 0;p({themeStyle:e,customThemeId:i}),t({themeStyle:e,customThemeId:i}),v(e,n,i)},setThemeMode:e=>{p({themeMode:e}),t({themeMode:e}),v(r().themeStyle,e,r().customThemeId)},setCustomTheme:e=>{p({themeStyle:`custom`,customThemeId:e}),t({themeStyle:`custom`,customThemeId:e}),v(`custom`,r().themeMode,e)},setThemeFromPayload:({style:e,mode:n,customThemeId:r})=>{let o=i.includes(e)?e:`aurora`,s=a.includes(n)?n:`system`;p({themeStyle:o,themeMode:s,customThemeId:r}),t({themeStyle:o,themeMode:s,customThemeId:r})},setCustomThemes:e=>t({customThemes:e}),fetchThemes:async()=>{try{let{fetchImportedThemes:e}=await n(async()=>{let{fetchImportedThemes:e}=await import(`./api-themes-CmJZLEY1.js`);return{fetchImportedThemes:e}},__vite__mapDeps([0,1,2,3,4]));t({customThemes:await e()})}catch{}},importThemeFrom:async e=>{let{importTheme:t}=await n(async()=>{let{importTheme:e}=await import(`./api-themes-CmJZLEY1.js`);return{importTheme:e}},__vite__mapDeps([0,1,2,3,4])),i=await t(e);return await r().fetchThemes(),i},deleteCustomTheme:async e=>{let{deleteImportedTheme:i}=await n(async()=>{let{deleteImportedTheme:e}=await import(`./api-themes-CmJZLEY1.js`);return{deleteImportedTheme:e}},__vite__mapDeps([0,1,2,3,4]));await i(e),await r().fetchThemes(),r().themeStyle===`custom`&&r().customThemeId===e&&(p({themeStyle:`aurora`,themeMode:r().themeMode,customThemeId:void 0}),t({themeStyle:`aurora`,customThemeId:void 0}),v(`aurora`,r().themeMode))},setDeviceName:async e=>{let r=e.trim();t({deviceName:r||null}),r?document.title=`PPM — ${r}`:document.title=`PPM`;try{let{updateDeviceName:e}=await n(async()=>{let{updateDeviceName:e}=await import(`./api-settings-BQIwZoLm.js`);return{updateDeviceName:e}},__vite__mapDeps([5,1,2,3,4]));await e(r)}catch{}},setJiraEnabled:e=>{if(_({jiraEnabled:e}),t({jiraEnabled:e}),!e&&r().sidebarActiveTab===`jira`){let e=`explorer`;_({sidebarActiveTab:e}),t({sidebarActiveTab:e})}},toggleSidebar:()=>{let e=!r().sidebarCollapsed;_({sidebarCollapsed:e}),t({sidebarCollapsed:e})},setSidebarWidth:e=>{let n=Math.max(200,Math.min(600,e));_({sidebarWidth:n}),t({sidebarWidth:n})},setGitStatusViewMode:e=>{_({gitStatusViewMode:e}),t({gitStatusViewMode:e})},toggleInlineBlame:()=>{let e=!r().inlineBlame;_({inlineBlame:e}),t({inlineBlame:e})},toggleWordWrap:()=>{let e=!r().wordWrap;_({wordWrap:e}),t({wordWrap:e})},toggleTabWrap:()=>{let e=!r().tabWrap;_({tabWrap:e}),t({tabWrap:e})},toggleRemoteDesktopStatsVisible:()=>{let e=!r().remoteDesktopStatsVisible;_({remoteDesktopStatsVisible:e}),t({remoteDesktopStatsVisible:e})},setRemoteDesktopWarningDismissed:e=>{_({remoteDesktopWarningDismissed:e}),t({remoteDesktopWarningDismissed:e})},setKeepScreenAwake:e=>{_({keepScreenAwake:e}),t({keepScreenAwake:e})},setEditorTabStyle:e=>{_({editorTabStyle:e}),t({editorTabStyle:e})},setSidebarActiveTab:e=>{_({sidebarActiveTab:e}),t({sidebarActiveTab:e})},setSidebarTabOrder:e=>{let n=l(e);_({sidebarTabOrder:n}),t({sidebarTabOrder:n})},setDockPosition:e=>{_({dockPosition:e}),t({dockPosition:e})},setDbSidebarExpanded:e=>{let n=f(e)??u;_({dbSidebarExpanded:n}),t({dbSidebarExpanded:n})},setExplorerSkin:e=>{_({explorerSkin:e}),t({explorerSkin:e})},fetchServerInfo:async()=>{try{let n=e(),i=n?{headers:{Authorization:`Bearer ${n}`}}:{},[a,o,s]=await Promise.all([fetch(`/api/info`,i),fetch(`/api/settings/theme`,i),fetch(`/api/settings/ui-prefs`,i)]),c=await a.json();if(c.ok){let{device_name:e,version:n,tunnel_active:r}=c.data;t({deviceName:e||null,version:n||null,tunnelActive:!!r}),e&&(document.title=`PPM — ${e}`)}let l=await o.json(),u=l.ok?l.data?.theme:null;u&&typeof u==`object`&&typeof u.style==`string`&&r().setThemeFromPayload({style:u.style,mode:u.mode,customThemeId:u.customThemeId});let d=await s.json();d.ok&&d.data&&y(d.data),r().fetchThemes()}catch{}},syncThemeToServer:async()=>{await v(r().themeStyle,r().themeMode,r().customThemeId)}}));export{S as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-BBdkypKW.js";import{n as t,t as n}from"./settings-body-CcKls51a.js";import"./vendor-mermaid-CfY1-PkA.js";import"./button-zgoXa9r7.js";import"./separator-DvCsdlws.js";var r=e(),i=({metadata:e})=>(0,r.jsx)(n,{initialCategory:t(e?.category)?e.category:void 0});export{i as SettingsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-BBdkypKW.js";import{n as t,t as n}from"./settings-body-CcKls51a.js";import"./vendor-mermaid-CfY1-PkA.js";import{t as r}from"./window-store-CfxP5yor.js";import"./button-zgoXa9r7.js";import"./separator-DvCsdlws.js";var i=e();function a({id:e,payload:a}){let o=r(e=>e.setPayload);return(0,i.jsx)(n,{initialCategory:t(a?.category)?a.category:void 0,onCategoryChange:t=>o(e,{category:t})})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-D6fVXe3s.js";var t=e(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-D6fVXe3s.js";var t=e(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-D6fVXe3s.js";var t=e(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),n=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]);export{t as n,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import{a as r,i,r as a}from"./glide-data-grid-JKEslqGe.js";import{s as o}from"./index-DVNJ2W5R.js";import{t as s}from"./use-monaco-theme-DTPfPPvF.js";var c=e(t(),1),l=n();function u({onExecute:e,loading:t,defaultValue:n=`SELECT * FROM `,schemaInfo:u,onSqlChange:d,persistedSql:f}){let[p,m]=(0,c.useState)(()=>f??n),h=(0,c.useRef)(!!f),g=(0,c.useRef)(null),_=(0,c.useRef)(null),v=(0,c.useRef)(null),y=(0,c.useRef)(e);y.current=e;let b=s();(0,c.useEffect)(()=>{if(!(!_.current||!u))return v.current?.dispose(),a(),v.current=_.current.languages.registerCompletionItemProvider(`sql`,i(_.current,u)),()=>{v.current?.dispose()}},[u]);let x=(0,c.useCallback)((e,t)=>{g.current=e,_.current=t,e.addAction({id:`run-query-at-cursor`,label:`Run Statement at Cursor`,keybindings:[t.KeyMod.CtrlCmd|t.KeyCode.Enter],run:e=>{let t=e.getPosition();if(!t)return;let n=r(e.getValue(),t.lineNumber);n&&y.current(n)}}),u&&(v.current?.dispose(),v.current=t.languages.registerCompletionItemProvider(`sql`,i(t,u)))},[u]);return(0,c.useEffect)(()=>{h.current||m(n)},[n]),(0,l.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,l.jsx)(o,{height:`100%`,language:`sql`,theme:b,value:p,onChange:e=>{let t=e??``;m(t),h.current=!0,d?.(t)},onMount:x,options:{minimap:{enabled:!1},lineNumbers:`off`,scrollBeyondLastLine:!1,wordWrap:`on`,fontSize:12,tabSize:2,renderLineHighlight:`none`,overviewRulerLanes:0,hideCursorInOverviewRuler:!0,scrollbar:{vertical:`auto`,horizontal:`auto`,verticalScrollbarSize:6,horizontalScrollbarSize:6},padding:{top:4,bottom:4},lineDecorationsWidth:4,lineNumbersMinChars:0,glyphMargin:!1,folding:!1,fixedOverflowWidgets:!0}})})}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-BBdkypKW.js";import{t as r}from"./database-Dz0W7OH7.js";import{t as i}from"./glide-data-grid-JKEslqGe.js";import{t as a}from"./loader-circle-DxI3O9_f.js";import{t as o}from"./table-8HT8BG30.js";import{i as s,n as c,s as l}from"./api-client-DwXlVfXP.js";import"./vendor-mermaid-CfY1-PkA.js";import"./settings-store-_s4xFcFq.js";import"./panel-store-D42k25jy.js";import"./window-store-CfxP5yor.js";import"./tab-store-B2ip0-Mv.js";import{Mr as u,Xn as d}from"./index-DVNJ2W5R.js";import"./data-grid-types-BfGeMDy0.js";import"./use-monaco-theme-DTPfPPvF.js";import{t as f}from"./sql-query-editor-BoYxc5vd.js";var p=e(t(),1);function m(e,t,n){let[r,i]=(0,p.useState)([]),[a,o]=(0,p.useState)(null),[u,d]=(0,p.useState)(null),[f,m]=(0,p.useState)([]),[h,g]=(0,p.useState)(!1),[_,v]=(0,p.useState)(null),[y,b]=(0,p.useState)(1),[x,S]=(0,p.useState)(null),[C,w]=(0,p.useState)(null),[T,E]=(0,p.useState)(!1),D=n?`/api/db/connections/${n}`:null,O=!n&&!e&&/^(\/|[A-Za-z]:[/\\])/.test(t),k=D??(O?`/api/fs/sqlite`:`${s(e)}/sqlite`),A=D?``:`path=${encodeURIComponent(t)}`,j=(0,p.useCallback)(async()=>{g(!0),v(null);try{let e=D?`?cached=1`:A?`?${A}`:``,t=await c.get(`${k}/tables${e}`);i(t),!D&&t.length>0&&!a&&o(t[0].name)}catch(e){v(e.message)}finally{g(!1)}},[k,A,D]);(0,p.useEffect)(()=>{j()},[j]);let M=(0,p.useCallback)(async()=>{if(a){g(!0);try{let e=A?`${A}&`:``,[t,n]=await Promise.all([c.get(`${k}/data?${e}table=${encodeURIComponent(a)}&page=${y}&limit=100`),c.get(`${k}/schema?${e}table=${encodeURIComponent(a)}`)]);d(t),m(n)}catch(e){v(e.message)}finally{g(!1)}}},[k,A,a,y]);(0,p.useEffect)(()=>{M()},[M]);let N=(0,p.useCallback)(e=>{o(e),b(1),S(null)},[]),P=(0,p.useCallback)(async e=>{E(!0),w(null);try{let n=D?{sql:e}:{path:t,sql:e},r=await c.post(`${k}/query`,n);S(r),r.changeType===`modify`&&M()}catch(e){w(e.message)}finally{E(!1)}},[k,D,t,M]),F=(0,p.useCallback)((e,t)=>{let n=t.message;v(n),l.error(`${e} failed`,{description:n})},[]);return{tables:r,selectedTable:a,selectTable:N,tableData:u,schema:f,loading:h,error:_,page:y,setPage:b,queryResult:x,queryError:C,queryLoading:T,executeQuery:P,updateCell:(0,p.useCallback)(async(e,n,r)=>{if(a)try{D?await c.put(`${k}/cell`,{table:a,pkColumn:`rowid`,pkValue:e,column:n,value:r}):await c.put(`${k}/cell`,{path:t,table:a,rowid:e,column:n,value:r}),M()}catch(e){F(`Update cell`,e)}},[k,D,t,a,M,F]),deleteRow:(0,p.useCallback)(async e=>{if(a)try{D?await c.del(`${k}/row`,{table:a,pkColumn:`rowid`,pkValue:e}):await c.del(`${k}/row`,{path:t,table:a,rowid:e}),M(),j()}catch(e){F(`Delete row`,e)}},[k,D,t,a,M,j,F]),refreshTables:j,refreshData:M}}var h=n();function g({tables:e,selectedTable:t,onSelect:n,onRefresh:r}){return(0,h.jsxs)(`div`,{className:`w-48 shrink-0 flex flex-col bg-background overflow-hidden`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Tables`}),(0,h.jsx)(`button`,{type:`button`,onClick:r,className:`text-muted-foreground hover:text-foreground transition-colors`,title:`Refresh tables`,children:(0,h.jsx)(d,{className:`size-3`})})]}),(0,h.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[e.map(e=>(0,h.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors ${t===e.name?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`}`,children:[(0,h.jsx)(o,{className:`size-3 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate flex-1`,children:e.name}),(0,h.jsx)(`span`,{className:`text-[10px] opacity-60`,children:e.rowCount})]},e.name)),e.length===0&&(0,h.jsx)(`p`,{className:`px-3 py-4 text-xs text-muted-foreground text-center`,children:`No tables found`})]})]})}function _({onExecute:e,loading:t}){return(0,h.jsx)(f,{onExecute:e,loading:t})}function v({metadata:e}){let t=e?.filePath,n=e?.projectName,i=e?.connectionId,a=e?.tableName,[o,s]=(0,p.useState)(!1);if(i)return(0,h.jsx)(y,{projectName:``,dbPath:``,connectionId:i,connectionName:e?.connectionName,initialTable:a,queryPanelOpen:o,onToggleQueryPanel:()=>s(e=>!e),hideTableList:!0});let c=!!t&&!n&&/^(\/|[A-Za-z]:[/\\])/.test(t);return!t||!n&&!c?(0,h.jsxs)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:[(0,h.jsx)(r,{className:`size-5 mr-2`}),` No database file selected.`]}):(0,h.jsx)(y,{projectName:n??``,dbPath:t,queryPanelOpen:o,onToggleQueryPanel:()=>s(e=>!e)})}function y({projectName:e,dbPath:t,connectionId:n,connectionName:o,initialTable:s,queryPanelOpen:c,onToggleQueryPanel:l,hideTableList:d}){let f=m(e,t,n),v=(0,p.useRef)(!1);return(0,p.useEffect)(()=>{s&&!v.current&&f.tables.length>0&&(v.current=!0,f.selectTable(s))},[s,f.tables]),f.error&&f.tables.length===0?(0,h.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,h.jsx)(u,{className:`size-10 text-destructive`}),(0,h.jsx)(`p`,{className:`text-sm`,children:f.error})]}):f.loading&&f.tables.length===0?(0,h.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-text-secondary`,children:[(0,h.jsx)(a,{className:`size-5 animate-spin`}),(0,h.jsx)(`span`,{className:`text-sm`,children:`Loading database...`})]}):(0,h.jsxs)(`div`,{className:`flex h-full w-full overflow-hidden`,children:[!d&&(0,h.jsx)(g,{tables:f.tables,selectedTable:f.selectedTable,onSelect:f.selectTable,onRefresh:f.refreshTables}),(0,h.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden ${d?``:`border-l border-border`}`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border bg-background shrink-0`,children:[(0,h.jsx)(r,{className:`size-3.5 text-muted-foreground`}),(0,h.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:o??t}),(0,h.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f.selectedTable&&`/ ${f.selectedTable}`}),(0,h.jsx)(`div`,{className:`ml-auto`,children:(0,h.jsx)(`button`,{type:`button`,onClick:l,className:`px-2 py-1 rounded text-xs transition-colors ${c?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,children:`SQL`})})]}),(0,h.jsx)(`div`,{className:`flex-1 overflow-hidden ${c?`max-h-[60%]`:``}`,children:f.tableData?(0,h.jsx)(i,{columns:f.tableData.columns,rows:f.tableData.rows,total:f.tableData.total,limit:f.tableData.limit,schema:f.schema.map(e=>({name:e.name,type:e.type,nullable:!e.notnull,pk:!!e.pk,defaultValue:e.dflt_value,fk:e.fk??null})),loading:f.loading,page:f.page,onPageChange:f.setPage,onCellUpdate:(e,t,n,r)=>f.updateCell(t,n,r),onRowDelete:(e,t)=>f.deleteRow(t)}):(0,h.jsx)(`div`,{className:`flex items-center justify-center h-full text-xs text-muted-foreground`,children:f.loading?(0,h.jsx)(a,{className:`size-4 animate-spin`}):`Select a table`})}),c&&(0,h.jsx)(`div`,{className:`border-t border-border h-[40%] shrink-0`,children:(0,h.jsx)(_,{onExecute:f.executeQuery,loading:f.queryLoading})})]})]})}export{v as SqliteViewer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-
|
|
1
|
+
import{t as e}from"./react-DqIU0LFM.js";var t=e(e=>({sessions:new Map,setStreaming:(t,n,r)=>e(e=>{let i=new Map(e.sessions);return n?i.set(t,r??i.get(t)??``):i.delete(t),{sessions:i}}),replaceAllStreaming:t=>e(()=>({sessions:new Map(t.map(e=>[e.sessionId,e.projectName]))})),dropSession:t=>e(e=>{if(!e.sessions.has(t))return e;let n=new Map(e.sessions);return n.delete(t),{sessions:n}})})),n=e=>t=>{if(!e)return!1;for(let n of t.sessions.values())if(n===e)return!0;return!1};export{t as n,n as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/overview-panel-
|
|
2
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/overview-panel-DA0QB1-5.js","assets/rolldown-runtime-FhOqtrmT.js","assets/vendor-markdown-CuWCHIVb.js","assets/utils-IrnQujwR.js","assets/format-bytes-Bc6SqF7M.js","assets/process-table-DH_HXtGc.js","assets/index-DVNJ2W5R.js","assets/vendor-mermaid-CfY1-PkA.js","assets/vendor-ui-BBdkypKW.js","assets/button-zgoXa9r7.js","assets/createLucideIcon-D6fVXe3s.js","assets/arrow-left-DpXaakMC.js","assets/bot-D3-n2i31.js","assets/check-BQKbhtoA.js","assets/chevron-down-B9puixxZ.js","assets/chevron-right-DK_HbYZC.js","assets/chevron-up-BPAINgoK.js","assets/circle-OKk7s0DX.js","assets/clock-BmPiGrSF.js","assets/sparkles-blTKn0vi.js","assets/copy-CXuIH4VC.js","assets/database-Dz0W7OH7.js","assets/download-D70Q4Ba6.js","assets/use-coarse-long-press-BsBpxWup.js","assets/eye-off-CmtfyRUD.js","assets/eye-dfZn7evX.js","assets/loader-circle-DxI3O9_f.js","assets/monitor-CG69bSMW.js","assets/x-Bdaog6Az.js","assets/api-client-DwXlVfXP.js","assets/react-DqIU0LFM.js","assets/window-store-CfxP5yor.js","assets/window-pip-registry-BWxaVLj5.js","assets/panel-store-D42k25jy.js","assets/context-menu-DM9CgxGh.js","assets/portal-container-context-DeLx1cOI.js","assets/mobile-bottom-sheet-Ch1e_JBq.js","assets/use-visual-viewport-CNdG4QHH.js","assets/use-is-mobile-Bi42QhIi.js","assets/project-store-C83MMnlt.js","assets/ws-auth-FRzMmfQx.js","assets/settings-store-_s4xFcFq.js","assets/streaming-store-QQvg1cS-.js","assets/tab-store-B2ip0-Mv.js","assets/apply-theme-BVXAUYoN.js","assets/resolve-theme-CMp5xxCW.js","assets/index-B9Wbjl0o.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import{t as r}from"./createLucideIcon-D6fVXe3s.js";import{q as i}from"./vendor-mermaid-CfY1-PkA.js";import{n as a}from"./utils-IrnQujwR.js";import{Mn as o,_ as s}from"./index-DVNJ2W5R.js";var c=r(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),l=e(t(),1),u=n(),d=(0,l.lazy)(()=>i(()=>import(`./overview-panel-DA0QB1-5.js`).then(e=>({default:e.OverviewPanel})),__vite__mapDeps([0,1,2,3,4]))),f=(0,l.lazy)(()=>i(()=>import(`./process-table-DH_HXtGc.js`).then(e=>({default:e.ProcessTable})),__vite__mapDeps([5,1,6,7,8,2,9,3,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,4])));function p({isConnected:e,elapsed:t,tickCount:n}){return(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-text-subtle`,"data-testid":`sysmon-connection`,"data-tick-count":n,children:[e?(0,u.jsx)(c,{className:`size-3 text-success`}):(0,u.jsx)(o,{className:`size-3 text-error`}),(0,u.jsx)(`span`,{children:e?`Updated ${t}s ago`:`Disconnected`})]})}var m=(0,l.memo)(function({initialTab:e=`overview`,onTabChange:t,variant:n=`tab`}){let{latest:r,history:i,isConnected:o,tickCount:c}=s({processes:!0}),[m,h]=(0,l.useState)(e),g=e=>{h(e),t?.(e)},_=r?Math.round((Date.now()-r.ts)/1e3):0,v=r?.warnings??[];return(0,u.jsxs)(`div`,{className:`h-full flex flex-col overflow-hidden`,"data-testid":`system-monitor-window`,children:[n===`tab`&&(0,u.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border shrink-0`,children:[(0,u.jsx)(`h2`,{className:`text-sm font-medium`,children:`System Monitor`}),(0,u.jsx)(p,{isConnected:o,elapsed:_,tickCount:c})]}),v.length>0&&(0,u.jsx)(`div`,{className:`px-3 py-1.5 text-[11px] text-warning bg-warning/10 border-b border-border shrink-0 space-y-0.5`,"data-testid":`sysmon-warnings`,children:v.map((e,t)=>(0,u.jsx)(`div`,{children:e},t))}),(0,u.jsxs)(`div`,{className:`flex items-center border-b border-border shrink-0`,role:`tablist`,children:[(0,u.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":m===`overview`,"data-testid":`sysmon-tab-overview`,onClick:()=>g(`overview`),className:a(`flex-1 md:flex-none min-h-11 px-4 text-sm font-medium transition-colors`,m===`overview`?`text-text-primary border-b-2 border-primary -mb-px`:`text-text-subtle hover:text-text-secondary`),children:`Overview`}),(0,u.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":m===`processes`,"data-testid":`sysmon-tab-processes`,onClick:()=>g(`processes`),className:a(`flex-1 md:flex-none min-h-11 px-4 text-sm font-medium transition-colors`,m===`processes`?`text-text-primary border-b-2 border-primary -mb-px`:`text-text-subtle hover:text-text-secondary`),children:`Processes`}),n===`window`&&(0,u.jsx)(`div`,{className:`ml-auto pr-3`,children:(0,u.jsx)(p,{isConnected:o,elapsed:_,tickCount:c})})]}),(0,u.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto`,children:(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(`div`,{className:`p-4 text-xs text-text-subtle`,children:`Loading…`}),children:r?m===`overview`?(0,u.jsx)(d,{system:r.system,history:i}):(0,u.jsx)(f,{snapshot:r}):(0,u.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-subtle text-sm p-4`,children:o?`Waiting for data…`:`Connecting to resource monitor…`})})})]})});export{m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-BBdkypKW.js";import{t}from"./system-monitor-body-C2mVJ7PV.js";import"./api-client-DwXlVfXP.js";import"./vendor-mermaid-CfY1-PkA.js";var n=e(),r=()=>(0,n.jsx)(t,{});export{r as SystemMonitorTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-BBdkypKW.js";import{t}from"./system-monitor-body-C2mVJ7PV.js";import"./api-client-DwXlVfXP.js";import"./vendor-mermaid-CfY1-PkA.js";import{t as n}from"./window-store-CfxP5yor.js";var r=e();function i({id:e,payload:i}){let a=n(e=>e.setPayload);return(0,r.jsx)(t,{initialTab:i?.tab===`processes`?`processes`:`overview`,onTabChange:t=>a(e,{tab:t}),variant:`window`})}export{i as default};
|
package/dist/web/assets/{tab-host-window-content-C6eG_Rf1.js → tab-host-window-content-C7F6D8hJ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-BBdkypKW.js";import"./vendor-mermaid-CfY1-PkA.js";import"./portal-container-context-DeLx1cOI.js";import{p as r,t as i}from"./panel-store-D42k25jy.js";import"./window-store-CfxP5yor.js";import"./use-is-mobile-Bi42QhIi.js";import"./window-pip-registry-BWxaVLj5.js";import{Jt as a}from"./index-DVNJ2W5R.js";var o=e(t(),1),s=n();function c({id:e,payload:t}){let n=r(e),c=(i(e=>e.panels[n])?.tabs.length??0)>0,l=(0,o.useRef)(!1);c&&(l.current=!0);let u=typeof t?.originPanelId==`string`?t.originPanelId:null,d=(0,o.useRef)(u);d.current=u;let f=(0,o.useCallback)(e=>a(n,e),[n]),p=(0,o.useRef)(null);return(0,o.useLayoutEffect)(()=>(p.current=null,()=>{let t={};p.current=t,queueMicrotask(()=>{p.current===t&&(p.current=null,i.getState().redockFromWindow(e,d.current))})}),[e]),(0,s.jsxs)(`div`,{className:`relative h-full w-full`,children:[(0,s.jsx)(`div`,{ref:f,className:`absolute inset-0`}),!c&&!l.current&&(0,s.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-xs text-text-2 pointer-events-none`,children:`Loading…`})]})}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-
|
|
1
|
+
import{t as e}from"./react-DqIU0LFM.js";import{s as t,t as n}from"./panel-store-D42k25jy.js";var r=e()(()=>({tabs:[],activeTabId:null,tabHistory:[],currentProject:null,switchProject:e=>{n.getState().switchProject(e),i()},openTab:e=>{let t=n.getState().openTab(e);return i(),t},closeTab:e=>{n.getState().closeTab(e),i()},setActiveTab:e=>{n.getState().setActiveTab(e),i()},updateTab:(e,t)=>{n.getState().updateTab(e,t),i()},openNewFile:e=>{let r=n.getState(),a=t(r.panels),o=r.openTab({type:`editor`,title:e?.title??`Untitled-${a}`,projectId:null,metadata:{isUntitled:!0,untitledNumber:a,...e?.language?{language:e.language}:{}},closable:!0});return i(),o}}));function i(){let e=n.getState(),t=e.panels[e.focusedPanelId];r.setState({tabs:t?.tabs??[],activeTabId:t?.activeTabId??null,tabHistory:t?.tabHistory??[],currentProject:e.currentProject})}n.subscribe(()=>i());export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-D6fVXe3s.js";var t=e(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]);export{t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/team-member-window-content-BwOTsc9r.js","assets/rolldown-runtime-FhOqtrmT.js","assets/index-DVNJ2W5R.js","assets/vendor-mermaid-CfY1-PkA.js","assets/vendor-ui-BBdkypKW.js","assets/vendor-markdown-CuWCHIVb.js","assets/button-zgoXa9r7.js","assets/utils-IrnQujwR.js","assets/createLucideIcon-D6fVXe3s.js","assets/arrow-left-DpXaakMC.js","assets/bot-D3-n2i31.js","assets/check-BQKbhtoA.js","assets/chevron-down-B9puixxZ.js","assets/chevron-right-DK_HbYZC.js","assets/chevron-up-BPAINgoK.js","assets/circle-OKk7s0DX.js","assets/clock-BmPiGrSF.js","assets/sparkles-blTKn0vi.js","assets/copy-CXuIH4VC.js","assets/database-Dz0W7OH7.js","assets/download-D70Q4Ba6.js","assets/use-coarse-long-press-BsBpxWup.js","assets/eye-off-CmtfyRUD.js","assets/eye-dfZn7evX.js","assets/loader-circle-DxI3O9_f.js","assets/monitor-CG69bSMW.js","assets/x-Bdaog6Az.js","assets/api-client-DwXlVfXP.js","assets/react-DqIU0LFM.js","assets/window-store-CfxP5yor.js","assets/window-pip-registry-BWxaVLj5.js","assets/panel-store-D42k25jy.js","assets/context-menu-DM9CgxGh.js","assets/portal-container-context-DeLx1cOI.js","assets/mobile-bottom-sheet-Ch1e_JBq.js","assets/use-visual-viewport-CNdG4QHH.js","assets/use-is-mobile-Bi42QhIi.js","assets/project-store-C83MMnlt.js","assets/ws-auth-FRzMmfQx.js","assets/settings-store-_s4xFcFq.js","assets/streaming-store-QQvg1cS-.js","assets/tab-store-B2ip0-Mv.js","assets/apply-theme-BVXAUYoN.js","assets/resolve-theme-CMp5xxCW.js","assets/index-B9Wbjl0o.css","assets/tool-cards-yiwO861p.js","assets/circle-question-mark-qcWYO1P_.js","assets/code-CRiIHSiv.js","assets/send-B9VUQlEK.js","assets/use-blob-url-D358Rpyp.js","assets/image-gallery-J8h8IY0c.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-BBdkypKW.js";import{t as r}from"./x-Bdaog6Az.js";import{q as i}from"./vendor-mermaid-CfY1-PkA.js";import"./portal-container-context-DeLx1cOI.js";import"./window-store-CfxP5yor.js";import"./use-is-mobile-Bi42QhIi.js";import{t as a}from"./mobile-bottom-sheet-Ch1e_JBq.js";import"./use-visual-viewport-CNdG4QHH.js";import{n as o}from"./use-open-team-member-DGEx9xB0.js";var s=e(t(),1),c=n(),l=(0,s.lazy)(()=>i(()=>import(`./team-member-window-content-BwOTsc9r.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50])));function u(){let e=o(e=>e.payload),t=o(e=>e.close);return e?(0,c.jsxs)(a,{open:!0,onClose:t,zIndex:45,className:`flex h-[var(--sheet-vh)] flex-col p-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,c.jsxs)(`span`,{className:`truncate text-sm font-medium text-text-primary`,children:[`Session — `,e.memberName]}),(0,c.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto flex size-11 items-center justify-center rounded text-text-secondary hover:text-text-primary`,"aria-label":`Close`,children:(0,c.jsx)(r,{className:`size-5`})})]}),(0,c.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`p-4 text-sm text-text-2`,children:`Loading…`}),children:(0,c.jsx)(l,{id:`sheet-${e.memberName}`,payload:e})})})]}):null}export{u as TeamMemberSheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-BBdkypKW.js";import{t as r}from"./tool-cards-yiwO861p.js";import{t as i}from"./loader-circle-DxI3O9_f.js";import{n as a}from"./api-client-DwXlVfXP.js";import"./vendor-mermaid-CfY1-PkA.js";import{n as o}from"./utils-IrnQujwR.js";import"./panel-store-D42k25jy.js";import"./window-store-CfxP5yor.js";import"./tab-store-B2ip0-Mv.js";import{Xn as s}from"./index-DVNJ2W5R.js";import"./use-blob-url-D358Rpyp.js";var c=e(t(),1),l=3e3,u=2e3;function d(e,t){let[n,r]=(0,c.useState)([]),[i,o]=(0,c.useState)(!0),[s,d]=(0,c.useState)(null),[f,p]=(0,c.useState)(0);return(0,c.useEffect)(()=>{if(!e||!t){d(`Missing team or member`),o(!1);return}let n=!1,i=0,s=!1;r([]),o(!0),d(null);let c=async()=>{if(s)return;s=!0;let c=i===0;try{let o=await a.get(`/api/teams/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}/transcript?sinceBytes=${i}`);if(n)return;i=o?.nextBytes??i;let s=o?.events??[];c||o?.restarted?r(s.slice(-u)):s.length>0&&r(e=>[...e,...s].slice(-u)),d(null)}catch{!n&&c&&d(`Could not read this member's session`)}finally{s=!1,n||o(!1)}};c();let f=setInterval(()=>void c(),l);return()=>{n=!0,clearInterval(f)}},[e,t,f]),{events:n,loading:i,error:s,refresh:(0,c.useCallback)(()=>p(e=>e+1),[])}}var f=n();function p({payload:e}){let{teamName:t,memberName:n,projectName:a}=e??{},{events:c,loading:l,error:u,refresh:p}=d(t,n);return(0,f.jsxs)(`div`,{className:`flex flex-col h-full min-h-0 bg-surface`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/30 shrink-0`,children:[(0,f.jsx)(`span`,{className:`text-xs font-medium truncate`,children:n}),(0,f.jsx)(`span`,{className:`text-[10px] text-text-subtle`,children:c.length>0?`${c.length} steps`:``}),(0,f.jsx)(`button`,{type:`button`,onClick:p,className:`ml-auto text-text-subtle hover:text-foreground p-1 shrink-0`,"aria-label":`Reload session`,children:(0,f.jsx)(s,{className:o(`size-3`,l&&`animate-spin`)})})]}),l&&c.length===0?(0,f.jsxs)(`div`,{className:`flex-1 flex items-center justify-center gap-2 text-xs text-text-subtle`,children:[(0,f.jsx)(i,{className:`size-3 animate-spin`}),`Loading session…`]}):u?(0,f.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-error px-4 text-center`,children:u}):c.length===0?(0,f.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-subtle`,children:`This member has no recorded session`}):(0,f.jsx)(r,{events:c,projectName:a,className:`flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-1`})]})}export{p as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-BBdkypKW.js";import{t as r}from"./createLucideIcon-D6fVXe3s.js";import{t as i}from"./copy-CXuIH4VC.js";import{t as a}from"./loader-circle-DxI3O9_f.js";import{n as o,s}from"./api-client-DwXlVfXP.js";import"./vendor-mermaid-CfY1-PkA.js";import{t as c}from"./settings-store-_s4xFcFq.js";import{n as l}from"./utils-IrnQujwR.js";import"./portal-container-context-DeLx1cOI.js";import{t as u}from"./panel-store-D42k25jy.js";import"./window-store-CfxP5yor.js";import{r as d,t as f}from"./apply-theme-BVXAUYoN.js";import{t as p}from"./mobile-bottom-sheet-Ch1e_JBq.js";import"./use-visual-viewport-CNdG4QHH.js";import{t as m}from"./resolve-theme-CMp5xxCW.js";import{t as h}from"./ws-auth-FRzMmfQx.js";import{Dr as g,Yn as _,an as v,dr as y,kr as b,nn as x,sr as S}from"./index-DVNJ2W5R.js";import{r as C}from"./send-to-chat-Kl-0dNwN.js";import{n as w,t as T}from"./run-in-terminal-DoTOtgQS.js";import{i as E,n as D,r as O,t as k}from"./vendor-xterm-YQlzIWv2.js";var A=r(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),j=r(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),M=r(`text-select`,[[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 14v1`,key:`169vum`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M9 3h1`,key:`1yesri`}]]),N=e(t(),1);function P(e){let t=e.tokens;if(e.terminal){let n=e.terminal.ansi;return{background:t.bgSolid,foreground:t.text,cursor:e.terminal.cursor,cursorAccent:e.terminal.cursorAccent??t.bgSolid,selectionBackground:e.terminal.selection,black:n[0],red:n[1],green:n[2],yellow:n[3],blue:n[4],magenta:n[5],cyan:n[6],white:n[7],brightBlack:n[8],brightRed:n[9],brightGreen:n[10],brightYellow:n[11],brightBlue:n[12],brightMagenta:n[13],brightCyan:n[14],brightWhite:n[15]}}let n=e.mode===`dark`,r=n?`#1b1f2a`:`#2b2f38`,i=n?`#d7dce8`:`#e9edf5`,a=t.text3,o=n?`#f7f9ff`:`#ffffff`;return{background:t.bgSolid,foreground:t.text,cursor:t.accent,cursorAccent:t.bgSolid,selectionBackground:t.accentWash,black:r,red:t.error,green:t.success,yellow:t.warning,blue:t.accent,magenta:t.accent2,cyan:t.info,white:i,brightBlack:a,brightRed:t.error,brightGreen:t.success,brightYellow:t.warning,brightBlue:t.accent,brightMagenta:t.accent2,brightCyan:t.info,brightWhite:o}}function F(){let e=c.getState();return P(d()??m(e.themeStyle,e.themeMode,e.customThemes,e.customThemeId))}var ee=/[).,;:'"\]}>]+$/,te=/\bhttps?:\/\/[^\s<>"'`]+/g,I=5e3,L=100,R=250,z=3e3,B=`RESIZE:`,ne=`PING`,re=`PONG`,ie=15e3,ae=35e3;function V(e){let{sessionId:t,containerRef:n}=e,r=(0,N.useRef)(null),i=(0,N.useRef)(null),a=(0,N.useRef)(null),o=(0,N.useRef)(null),s=(0,N.useRef)(0),c=(0,N.useRef)(!1),l=(0,N.useRef)(Date.now()),[u,d]=(0,N.useState)(!1),[p,m]=(0,N.useState)(!1),[g,_]=(0,N.useState)(!1),[y,b]=(0,N.useState)(!1),x=(0,N.useRef)(null),S=(0,N.useRef)(null),C=e.tabId?`ppm:terminal-session:${e.tabId}`:null,w=(0,N.useRef)((()=>{if(C)try{return localStorage.getItem(C)??t}catch{}return t})()),T=(0,N.useRef)(0),A=(0,N.useRef)(-1),j=(0,N.useCallback)(e=>{let t=a.current;t?.readyState===WebSocket.OPEN&&t.send(e)},[]),M=(0,N.useCallback)(()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>b(!0),R)},[]),P=(0,N.useCallback)(()=>r.current?.getSelection()??``,[]),V=(0,N.useCallback)(()=>{let e=r.current;if(!e)return``;let t=e.buffer.active,n=T.current,i=t.baseY+t.cursorY,a=[];for(let e=n;e<=i;e++){let n=t.getLine(e);n&&a.push(n.translateToString(!0))}for(;a.length>0&&a[a.length-1].trim()===``;)a.pop();return a.join(`
|
|
2
2
|
`)},[]),H=(0,N.useCallback)(()=>{let e=r.current;return!e||A.current<0?``:e.buffer.active.getLine(A.current)?.translateToString(!0).trimEnd()??``},[]),U=(0,N.useCallback)(()=>{let e=r.current;if(!e)return[];let t=e.buffer.active,n=t.baseY+t.cursorY,i=Math.max(0,n-I),a=[],o=``;for(let e=i;e<=n;e++){let n=t.getLine(e);n&&(o+=n.translateToString(!0),!t.getLine(e+1)?.isWrapped&&(a.push(o),o=``))}o&&a.push(o);let s=new Set,c=[];for(let e of a)for(let t of e.match(te)??[]){let e=t.replace(ee,``);!e||s.has(e)||(s.add(e),c.push(e))}return c.reverse()},[]),W=(0,N.useCallback)(()=>{let e=r.current,t=a.current;e&&t?.readyState===WebSocket.OPEN&&t.send(`${B}${e.cols},${e.rows}`)},[]),G=(0,N.useCallback)(()=>{if(o.current&&clearTimeout(o.current),a.current?.close(),a.current=null,w.current=`new`,C)try{localStorage.removeItem(C)}catch{}s.current=0,_(!1),b(!1),d(!1),m(!1),setTimeout(()=>K(),0)},[]),K=(0,N.useCallback)(()=>{o.current&&=(clearTimeout(o.current),null),a.current&&=(a.current.onclose=null,a.current.close(),null);let t=r.current;if(!t)return;let n=window.location.protocol===`https:`?`wss:`:`ws:`,i=e.projectName??``,u=w.current,f=u===`new`&&e.cwd?`?cwd=${encodeURIComponent(e.cwd)}`:``,p=h(`/ws/project/${encodeURIComponent(i)}/terminal/${u}${f}`),g=`${n}//${window.location.host}${p}`,v=new WebSocket(g);a.current=v,v.onopen=()=>{c.current&&r.current&&r.current.clear(),c.current=!0,l.current=Date.now(),d(!0),m(!1),s.current=0,w.current===`new`&&b(!1),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>b(!0),z),W()},v.onmessage=e=>{if(l.current=Date.now(),typeof e.data==`string`){if(e.data===re)return;if(e.data.startsWith(`{`))try{let n=JSON.parse(e.data);if(n.type){if(n.type===`session`&&n.id&&(w.current=n.id,C))try{localStorage.setItem(C,n.id)}catch{}n.type===`error`&&t.write(`\r\n\x1b[31mError: ${n.message}\x1b[0m\r\n`),n.type===`exited`&&_(!0);return}}catch{}M(),t.write(e.data)}},v.onclose=()=>{d(!1),J()},v.onerror=()=>{v.close()}},[W]),q=(0,N.useCallback)(()=>{if(document.visibilityState!==`visible`)return;let e=a.current;if(!e||e.readyState!==WebSocket.OPEN){K();return}if(Date.now()-l.current>ae){K();return}try{e.send(ne)}catch{K()}},[K]);function J(){let e=Math.min(1e3*2**s.current,3e4);s.current++,m(!0),o.current=setTimeout(()=>{K()},e)}return(0,N.useEffect)(()=>{let e=n.current;if(!e)return;let t=new E({cursorBlink:!0,fontSize:13,scrollback:5e4,fontFamily:`Consolas, 'Cascadia Mono', Menlo, 'DejaVu Sans Mono', 'Courier New', monospace`,theme:F()}),s=new O,c=new D;if(t.loadAddon(s),t.loadAddon(c),t.open(e),!(`ontouchstart`in window||navigator.maxTouchPoints>0))try{let e=new k;e.onContextLoss(()=>e.dispose()),t.loadAddon(e)}catch{}s.fit(),r.current=t,i.current=s,t.onData(e=>{if(e.includes(`\r`)||e.includes(`
|
|
3
3
|
`)){let e=t.buffer.active;A.current=e.baseY+e.cursorY,T.current=A.current+1}let n=a.current;n?.readyState===WebSocket.OPEN&&n.send(e)}),K();let l=setInterval(q,ie),u=e.ownerDocument,d=()=>{u.visibilityState===`visible`&&q()};u.addEventListener(`visibilitychange`,d);let p=null,m=new ResizeObserver(e=>{let t=e[0];!t||t.contentRect.width===0||t.contentRect.height===0||(p&&clearTimeout(p),p=setTimeout(()=>{try{s.fit(),W()}catch{}},L))});m.observe(e);let h=v(e,()=>{try{s.fit(),W()}catch{}}),g=()=>{t.options.theme=F()};window.addEventListener(f,g);let _=()=>window.removeEventListener(f,g);return()=>{_(),h(),p&&clearTimeout(p),m.disconnect(),clearInterval(l),u.removeEventListener(`visibilitychange`,d),o.current&&clearTimeout(o.current),x.current&&clearTimeout(x.current),S.current&&clearTimeout(S.current),a.current?.close(),a.current=null,t.dispose(),r.current=null,i.current=null}},[]),{connected:u,reconnecting:p,exited:g,shellReady:y,sendData:j,getSelection:P,getLastCommandOutput:V,getLastCommand:H,getBufferUrls:U,restart:G}}function H(e,t,n){return new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,clientX:t.clientX,clientY:t.clientY,screenX:t.screenX,screenY:t.screenY,button:0,buttons:n,detail:1})}function U(e,t){(0,N.useEffect)(()=>{let n=e.current;if(!t||!n)return;let r=n.querySelector(`.xterm`);if(!r)return;let i=e=>{let t=e.touches[0];!t||e.touches.length>1||(e.preventDefault(),e.stopPropagation(),r.dispatchEvent(H(`mousedown`,t,1)))},a=e=>{let t=e.touches[0];t&&(e.preventDefault(),e.stopPropagation(),document.dispatchEvent(H(`mousemove`,t,1)))},o=e=>{let t=e.changedTouches[0];t&&(e.preventDefault(),e.stopPropagation(),document.dispatchEvent(H(`mouseup`,t,0)))},s={capture:!0,passive:!1};return n.addEventListener(`touchstart`,i,s),n.addEventListener(`touchmove`,a,s),n.addEventListener(`touchend`,o,s),n.addEventListener(`touchcancel`,o,s),()=>{n.removeEventListener(`touchstart`,i,s),n.removeEventListener(`touchmove`,a,s),n.removeEventListener(`touchend`,o,s),n.removeEventListener(`touchcancel`,o,s)}},[e,t])}var W=40;function G(e){if(!e||typeof e.checkVisibility==`function`&&!e.checkVisibility({visibilityProperty:!0}))return!1;let t=e.getBoundingClientRect();return t.width<W||t.height<W?!1:t.bottom>0&&t.right>0&&t.top<window.innerHeight&&t.left<window.innerWidth}function K({tabId:e,metadata:t,shellReady:n,sendData:r,focusTerminal:i,containerRef:a}){let o=(0,N.useRef)(null),[s,c]=(0,N.useState)(0),l=(0,N.useCallback)(e=>{o.current=e,c(e=>e+1)},[]),d=t?.pendingCommand;(0,N.useEffect)(()=>{if(!(typeof d!=`string`||!d)&&(l(d),e)){let n={...t??{}};delete n.pendingCommand,u.getState().updateTab(e,{metadata:n})}},[d,e,l]),(0,N.useEffect)(()=>{let e=e=>{let t=e.detail;t?.command&&G(a.current)&&(l(t.command),window.dispatchEvent(new Event(T)))};return window.addEventListener(w,e),()=>window.removeEventListener(w,e)},[a,l]),(0,N.useEffect)(()=>{if(!n)return;let e=o.current;e&&(o.current=null,r(e),i())},[n,s,r,i])}var q=n(),J=[{label:`Tab`,value:` `},{label:`Esc`,value:`\x1B`},{label:`Ctrl`,value:null},{label:`↑`,value:`\x1B[A`},{label:`↓`,value:`\x1B[B`},{label:`←`,value:`\x1B[D`},{label:`→`,value:`\x1B[C`},{label:`^C`,value:``}],Y=`flex items-center justify-center shrink-0 min-w-11 min-h-11 rounded text-xs bg-surface-elevated text-text-primary active:bg-primary active:text-primary-foreground transition-colors select-none`;function oe({ctrlMode:e,onToggleCtrl:t,selectMode:n,onToggleSelect:r,onKey:a,onCopy:o,onPaste:s,onSendToChat:c,onOpenLinks:u}){return(0,q.jsxs)(`div`,{className:`relative shrink-0 bg-surface border-t border-border`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1.5 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:[(0,q.jsx)(`button`,{onClick:r,"aria-label":`Select text`,"aria-pressed":n,className:l(Y,n&&`bg-primary text-primary-foreground`),children:(0,q.jsx)(M,{size:16})}),(0,q.jsx)(`button`,{onClick:o,"aria-label":`Copy`,className:Y,children:(0,q.jsx)(i,{size:16})}),(0,q.jsx)(`button`,{onClick:s,"aria-label":`Paste`,className:Y,children:(0,q.jsx)(b,{size:16})}),(0,q.jsx)(`button`,{onClick:u,"aria-label":`Links`,className:Y,children:(0,q.jsx)(y,{size:16})}),(0,q.jsx)(`button`,{onClick:c,"aria-label":`Send to Chat`,className:Y,children:(0,q.jsx)(S,{size:16})}),(0,q.jsx)(`div`,{className:`w-px h-6 shrink-0 bg-border mx-0.5`}),J.map(n=>(0,q.jsx)(`button`,{onClick:()=>n.value===null?t():a(n.value),className:l(Y,`font-mono`,n.value===null&&e&&`bg-primary text-primary-foreground`),children:n.label},n.label)),(0,q.jsx)(`div`,{className:`w-6 shrink-0`,"aria-hidden":!0})]}),(0,q.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-surface to-transparent`,"aria-hidden":!0})]})}var se=new Set([`localhost`,`::1`]);function X(e){let t=e.replace(/^\[|\]$/g,``).toLowerCase();return se.has(t)?!0:/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function Z(e){let t;try{t=new URL(e)}catch{return null}let n=t.searchParams.get(`redirect_uri`)??t.searchParams.get(`redirectUri`);if(!n)return null;try{let e=new URL(n);return X(e.hostname)?e.port||(e.protocol===`https:`?`443`:`80`):null}catch{return null}}function Q(e){try{let t=new URL(e.trim());return(t.protocol===`http:`||t.protocol===`https:`)&&X(t.hostname)}catch{return!1}}function ce({onDone:e}){let[t,n]=(0,N.useState)(``),[r,i]=(0,N.useState)(!1),c=t.trim(),l=!r&&Q(c),u=async()=>{i(!0);try{await o.post(`/api/loopback/callback`,{url:c}),s.success(`Sent to the waiting command`,{duration:2e3}),n(``),e()}catch(e){s.error(e.message,{duration:4e3})}finally{i(!1)}};return(0,q.jsxs)(`div`,{className:`shrink-0 border-t border-border px-3 py-3`,children:[(0,q.jsx)(`p`,{className:`pb-2 text-[11px] leading-snug text-text-secondary`,children:`Finished signing in and landed on a page that would not load? Paste that address here — the machine will deliver it to the command still waiting.`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),inputMode:`url`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,placeholder:`http://127.0.0.1:54132/oauth/callback?code=…`,"aria-label":`Callback address`,className:`h-11 min-w-0 flex-1 rounded-lg border border-border bg-surface px-3 font-mono text-xs text-foreground placeholder:text-text-subtle`}),(0,q.jsx)(`button`,{onClick:()=>void u(),disabled:!l,"aria-label":`Finish login`,className:`flex size-11 shrink-0 items-center justify-center rounded-lg bg-primary text-primary-foreground disabled:opacity-40 active:opacity-80 transition-opacity`,children:r?(0,q.jsx)(a,{className:`size-4 animate-spin`}):(0,q.jsx)(j,{className:`size-4`})})]}),c!==``&&!Q(c)&&(0,q.jsx)(`p`,{className:`pt-1.5 text-[11px] text-error`,children:`Needs to be the http://127.0.0.1:… address the sign-in redirected to.`})]})}function le({open:e,onClose:t,urls:n}){let r=async e=>{let n=await x(e);s[n?`success`:`error`](n?`Link copied`:`Could not copy link`,{duration:1500}),t()},a=[...new Set(n.map(Z).filter(e=>!!e))];return(0,q.jsxs)(p,{open:e,onClose:t,zIndex:70,className:`flex flex-col max-h-[70vh]`,children:[(0,q.jsx)(`div`,{className:`shrink-0 px-4 pb-2 text-xs font-medium text-text-secondary`,children:n.length>0?`Links in terminal (${n.length})`:`Links in terminal`}),(0,q.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto px-2 pb-2`,children:n.length===0?(0,q.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-8 text-center text-sm text-text-secondary`,children:[(0,q.jsx)(A,{className:`size-5 text-text-subtle`}),`No links found in the visible scrollback.`]}):n.map(e=>{let n=Z(e);return(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-stretch gap-1`,children:[(0,q.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,onClick:t,className:`flex min-h-11 flex-1 min-w-0 items-center gap-2 rounded-lg px-3 py-2 text-sm text-foreground active:bg-accent transition-colors`,children:[(0,q.jsx)(g,{className:`size-4 shrink-0 text-text-subtle`}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left font-mono text-xs`,children:e})]}),(0,q.jsx)(`button`,{onClick:()=>void r(e),"aria-label":`Copy ${e}`,className:`flex size-11 shrink-0 items-center justify-center rounded-lg text-text-secondary active:bg-accent transition-colors`,children:(0,q.jsx)(i,{className:`size-4`})})]}),n&&(0,q.jsxs)(`p`,{className:`px-3 pb-2 text-[11px] leading-snug text-text-secondary`,children:[`Signing in here sends you back to port `,n,` `,(0,q.jsx)(`strong`,{children:`on the machine`}),`, not this device — so the terminal keeps waiting. Afterwards, paste the address bar below to finish it.`]})]},e)})}),a.length>0&&(0,q.jsx)(ce,{onDone:t})]})}var $=(0,N.memo)(function({metadata:e,tabId:t}){let n=e?.sessionId??`new`,r=e?.projectName,i=e?.cwd,a=(0,N.useRef)(null),{connected:o,reconnecting:c,exited:u,shellReady:d,sendData:f,getSelection:p,getLastCommandOutput:m,getLastCommand:h,getBufferUrls:g,restart:v}=V({sessionId:n,projectName:r,cwd:i,containerRef:a,tabId:t}),[y,b]=(0,N.useState)(!1),[w,T]=(0,N.useState)(!1),[E,D]=(0,N.useState)(!1);U(a,w);let O=(0,N.useCallback)(()=>{(a.current?.querySelector(`.xterm-helper-textarea`))?.focus()},[]);K({tabId:t,metadata:e,shellReady:d,sendData:f,focusTerminal:O,containerRef:a}),(0,N.useEffect)(()=>{let e=a.current;if(!e||w)return;let t=()=>O();return e.addEventListener(`touchend`,t,{capture:!0}),()=>e.removeEventListener(`touchend`,t,{capture:!0})},[O,w]);let k=(0,N.useCallback)(e=>{if(O(),y&&e.length===1){let t=e.toLowerCase().charCodeAt(0)-96;t>=1&&t<=26&&f(String.fromCharCode(t)),b(!1);return}f(e)},[y,f,O]),A=(0,N.useCallback)(async()=>{let e=p(),t=e||m();if(!t.trim()){s(`Nothing to copy`,{duration:1500});return}let n=await x(t);s[n?`success`:`error`](n?e?`Selection copied`:`Last output copied`:`Could not copy`,{duration:1500})},[p,m]),j=(0,N.useCallback)(async()=>{try{let e=await navigator.clipboard.readText();e&&(f(e),O())}catch{s.error(`Clipboard blocked — paste with the keyboard instead`,{duration:2500})}},[f,O]),M=(0,N.useCallback)(()=>{let e=p(),t=e||m();if(!t.trim())return;let n=e?``:h();C({text:"```bash\n"+(n?`${n}\n${t}`:t)+"\n```",label:e?`Terminal selection`:`Terminal output`,projectName:r}),s.success(`Sent to chat`,{duration:1500})},[p,m,h,r]),P=typeof window<`u`&&`ontouchstart`in window;return(0,q.jsxs)(`div`,{className:`flex flex-col h-full min-h-0`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1 bg-surface border-b border-border text-xs`,children:[(0,q.jsx)(`span`,{className:l(`size-2 rounded-full`,u?`bg-error`:o?`bg-success`:c?`bg-warning`:`bg-error`)}),(0,q.jsx)(`span`,{className:`text-text-secondary`,children:u?`Process exited`:o?`Connected`:c?`Reconnecting...`:`Disconnected`}),u&&(0,q.jsxs)(`button`,{onClick:v,className:`flex items-center gap-1 px-1.5 py-0.5 rounded text-xs bg-surface-elevated text-text-primary hover:bg-primary hover:text-primary-foreground active:bg-primary active:text-primary-foreground transition-colors`,children:[(0,q.jsx)(_,{size:10}),`Restart`]}),(0,q.jsxs)(`button`,{onClick:M,title:`Send to Chat`,className:`flex items-center gap-1 px-1.5 py-0.5 rounded text-xs bg-surface-elevated text-text-primary hover:bg-primary hover:text-primary-foreground active:bg-primary active:text-primary-foreground transition-colors ml-auto`,children:[(0,q.jsx)(S,{size:10}),`Chat`]}),(0,q.jsx)(`span`,{className:`text-text-subtle font-mono`,children:n})]}),(0,q.jsx)(`div`,{ref:a,onClick:w?void 0:O,className:l(`flex-1 min-h-0 bg-background p-1`,w&&`touch-none`)}),P&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(oe,{ctrlMode:y,onToggleCtrl:()=>b(!y),selectMode:w,onToggleSelect:()=>T(!w),onKey:k,onCopy:()=>void A(),onPaste:()=>void j(),onSendToChat:M,onOpenLinks:()=>D(!0)}),(0,q.jsx)(le,{open:E,onClose:()=>D(!1),urls:E?g():[]})]})]})});export{$ as TerminalTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-D6fVXe3s.js";var t=e(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]);export{t};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-renderer-
|
|
2
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-renderer-BGPo364Y.js","assets/vendor-mermaid-CfY1-PkA.js","assets/rolldown-runtime-FhOqtrmT.js","assets/vendor-ui-BBdkypKW.js","assets/vendor-markdown-CuWCHIVb.js","assets/markdown-renderer-DtQIHtLs.js","assets/index-DVNJ2W5R.js","assets/button-zgoXa9r7.js","assets/utils-IrnQujwR.js","assets/createLucideIcon-D6fVXe3s.js","assets/arrow-left-DpXaakMC.js","assets/bot-D3-n2i31.js","assets/check-BQKbhtoA.js","assets/chevron-down-B9puixxZ.js","assets/chevron-right-DK_HbYZC.js","assets/chevron-up-BPAINgoK.js","assets/circle-OKk7s0DX.js","assets/clock-BmPiGrSF.js","assets/sparkles-blTKn0vi.js","assets/copy-CXuIH4VC.js","assets/database-Dz0W7OH7.js","assets/download-D70Q4Ba6.js","assets/use-coarse-long-press-BsBpxWup.js","assets/eye-off-CmtfyRUD.js","assets/eye-dfZn7evX.js","assets/loader-circle-DxI3O9_f.js","assets/monitor-CG69bSMW.js","assets/x-Bdaog6Az.js","assets/api-client-DwXlVfXP.js","assets/react-DqIU0LFM.js","assets/window-store-CfxP5yor.js","assets/window-pip-registry-BWxaVLj5.js","assets/panel-store-D42k25jy.js","assets/context-menu-DM9CgxGh.js","assets/portal-container-context-DeLx1cOI.js","assets/mobile-bottom-sheet-Ch1e_JBq.js","assets/use-visual-viewport-CNdG4QHH.js","assets/use-is-mobile-Bi42QhIi.js","assets/project-store-C83MMnlt.js","assets/ws-auth-FRzMmfQx.js","assets/settings-store-_s4xFcFq.js","assets/streaming-store-QQvg1cS-.js","assets/tab-store-B2ip0-Mv.js","assets/apply-theme-BVXAUYoN.js","assets/resolve-theme-CMp5xxCW.js","assets/index-B9Wbjl0o.css","assets/image-gallery-J8h8IY0c.js","assets/run-in-terminal-DoTOtgQS.js","assets/edit-diff-preview-BvgPvuhH.js","assets/libesm-CdttTIAd.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import{t as r}from"./createLucideIcon-D6fVXe3s.js";import{n as i,t as a}from"./circle-question-mark-qcWYO1P_.js";import{t as o}from"./bot-D3-n2i31.js";import{t as s}from"./chevron-down-B9puixxZ.js";import{t as c}from"./chevron-right-DK_HbYZC.js";import{t as l}from"./clock-BmPiGrSF.js";import{t as u}from"./code-CRiIHSiv.js";import{n as d,t as f}from"./sparkles-blTKn0vi.js";import{t as p}from"./loader-circle-DxI3O9_f.js";import{t as m}from"./send-B9VUQlEK.js";import{q as h}from"./vendor-mermaid-CfY1-PkA.js";import{t as g}from"./utils-IrnQujwR.js";import{t as _}from"./tab-store-B2ip0-Mv.js";import{Ar as v,Dr as y,It as b,Mr as x,Nn as S,Rn as C,_r as w,nn as T,qn as E,r as D}from"./index-DVNJ2W5R.js";import{t as O}from"./use-blob-url-D358Rpyp.js";import{r as k,t as A}from"./image-gallery-J8h8IY0c.js";var j=r(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),M=r(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),N=r(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),P=r(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),F=r(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),I=r(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),L=r(`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`}]]),R=r(`list-todo`,[[`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`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),z=e(t(),1),B=n(),ee=(0,z.lazy)(()=>h(()=>import(`./markdown-renderer-BGPo364Y.js`).then(e=>({default:e.MarkdownRenderer})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])));function V({content:e,maxHeight:t=`max-h-48`}){return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded`}),children:(0,B.jsx)(ee,{content:e,className:`text-text-secondary overflow-auto ${t}`})})}var te={task_assignment:{label:`task`,className:`bg-primary/20 text-primary`},idle_notification:{label:`idle`,className:`bg-warning/20 text-warning`},completion:{label:`done`,className:`bg-success/20 text-success`},shutdown_request:{label:`shutdown`,className:`bg-error/20 text-error`},shutdown_approved:{label:`shutdown ✓`,className:`bg-text-3/20 text-text-3`},shutdown_response:{label:`shutdown reply`,className:`bg-text-3/20 text-text-3`},plan_approval_request:{label:`plan review`,className:`bg-primary/20 text-primary`},plan_approval_response:{label:`plan reply`,className:`bg-primary/20 text-primary`}},ne=new Set([`to`,`message`,`summary`,`notify_when_idle`,`recipient`,`content`,`type`]),H=e=>typeof e==`string`?e:e==null?``:String(e);function U(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;return typeof t.type!=`string`||!t.type?null:{type:t.type,request_id:typeof t.request_id==`string`?t.request_id:void 0,approve:typeof t.approve==`boolean`?t.approve:void 0,reason:typeof t.reason==`string`?t.reason:void 0,feedback:typeof t.feedback==`string`?t.feedback:void 0}}function re(e){let t=e.trim();if(!t.startsWith(`{`))return null;try{return U(JSON.parse(t))}catch{return null}}function W(e){let t=H(e.to)||H(e.recipient),n=e.message??e.content,r=U(n)??re(H(n)),i=r?``:H(n),a=H(e.type),o=r?.type||(a&&a!==`message`?a:`message`),s=H(e.summary).trim(),c=Object.entries(e).filter(([e])=>!ne.has(e)).map(([e,t])=>({key:e,value:typeof t==`string`?t:JSON.stringify(t)??``}));return{to:t,summary:s||void 0,text:i,firstLine:i.split(`
|
|
3
3
|
`).map(e=>e.trim()).find(e=>e.length>0)??``,protocol:r??void 0,kind:o,notifyWhenIdle:e.notify_when_idle===!0,extras:c}}function G(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(Array.isArray(t)){let e=H(t.find(e=>e&&typeof e==`object`&&e.type===`text`)?.text);if(!e)return null;try{t=JSON.parse(e)}catch{return null}}if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(typeof n.success!=`boolean`)return null;let r=n.pin&&typeof n.pin==`object`?n.pin:null;return{ok:n.success,detail:H(n.message)||H(n.error)||void 0,peer:r&&H(r.name)||void 0,ref:r&&H(r.ref)||void 0}}function ie({kind:e}){if(e===`message`)return null;let t=te[e];return(0,B.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-[10px] ${t?.className??`bg-panel-2 text-text-3`}`,children:t?.label??e})}function ae({name:e,input:t}){let n=W(t),r=n.summary||n.firstLine||(n.protocol?n.kind:``),a=r.length>72?`${r.slice(0,72)}…`:r;return(0,B.jsxs)(B.Fragment,{children:[e,` `,(0,B.jsxs)(`span`,{className:`text-text-subtle`,children:[(0,B.jsx)(i,{className:`size-3 inline`}),` `,n.to||`unknown`,a?` · ${a}`:``]}),n.notifyWhenIdle&&(0,B.jsx)(l,{className:`size-3 inline ml-1 text-text-3`})]})}function oe({input:e}){let t=W(e);return(0,B.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`text-text-subtle`,children:`To`}),(0,B.jsx)(`span`,{className:`font-medium text-text-primary`,children:t.to||`unknown`}),(0,B.jsx)(ie,{kind:t.kind}),t.notifyWhenIdle&&(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] bg-panel-2 text-text-3`,children:[(0,B.jsx)(l,{className:`size-3`}),` notify when idle`]})]}),!!t.text&&(0,B.jsx)(V,{content:t.text,maxHeight:`max-h-40`}),t.protocol&&(0,B.jsxs)(`div`,{className:`space-y-0.5 text-text-secondary`,children:[t.protocol.approve!=null&&(0,B.jsxs)(`p`,{children:[t.protocol.approve?`Approved`:`Rejected`,t.protocol.request_id?(0,B.jsxs)(`span`,{className:`text-text-subtle font-mono`,children:[` · `,t.protocol.request_id]}):null]}),!!t.protocol.reason&&(0,B.jsx)(`p`,{className:`text-text-subtle`,children:t.protocol.reason}),!!t.protocol.feedback&&(0,B.jsx)(`p`,{className:`text-text-subtle`,children:t.protocol.feedback})]}),t.extras.length>0&&(0,B.jsx)(`div`,{className:`space-y-0.5`,children:t.extras.map(e=>(0,B.jsxs)(`p`,{className:`text-text-subtle`,children:[(0,B.jsx)(`span`,{className:`font-mono`,children:e.key}),`: `,e.value]},e.key))})]})}function se({output:e}){let[t,n]=(0,z.useState)(!1),r=G(e);return r?(0,B.jsxs)(`div`,{className:`border-t border-border pt-1.5 space-y-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[r.ok?(0,B.jsx)(v,{className:`size-3 text-success shrink-0`}):(0,B.jsx)(j,{className:`size-3 text-error shrink-0`}),(0,B.jsx)(`span`,{className:r.ok?`text-success`:`text-error`,children:r.ok?`Delivered`:`Not delivered`}),!!r.detail&&(0,B.jsxs)(`span`,{className:`text-text-subtle`,children:[`· `,r.detail]}),!!r.ref&&(0,B.jsxs)(`span`,{className:`text-text-3 font-mono text-[10px]`,children:[`[`,r.ref,`]`]})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex items-center gap-1 text-[10px] text-text-subtle hover:text-text-secondary transition-colors`,children:[(0,B.jsx)(u,{className:`size-3`}),t?`Hide`:`Show`,` raw`]}),t&&(0,B.jsx)(`pre`,{className:`overflow-x-auto text-text-subtle font-mono max-h-40 whitespace-pre-wrap break-all text-[10px]`,children:e})]}):null}var ce=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.avif`,`.ico`]);function le(e){let t=e.lastIndexOf(`.`);return t===-1?!1:ce.has(e.slice(t).toLowerCase())}var ue=/^\[image(?: · [\d.]+(?:B|KB|MB))?\]$/;function de(e){if(!e.startsWith(`[`))return!1;let t;try{t=JSON.parse(e)}catch{return!1}return Array.isArray(t)?t.some(e=>{let t=e;return t?.type===`text`&&typeof t.text==`string`&&ue.test(t.text)}):!1}var fe=`Async agent launched successfully`;function pe(e){return!!e&&e.includes(fe)}var me=`text-[var(--img-meta-label)] @max-[470px]:hidden`,he=[`60%`,`45%`,`80%`];function ge({aspect:e,actions:t}){return(0,B.jsxs)(`div`,{className:`grid grid-cols-[132px_1fr] items-start gap-[14px] overflow-hidden rounded-lg border border-border bg-panel p-[14px] @max-[470px]:grid-cols-[64px_1fr] @max-[470px]:gap-[11px] @max-[470px]:p-[11px]`,children:[(0,B.jsx)(`div`,{className:`img-skeleton rounded-lg`,style:{aspectRatio:e}}),(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-[9px]`,children:[(0,B.jsx)(`div`,{className:`img-skeleton h-[13px] w-2/5 rounded @max-[470px]:hidden`}),(0,B.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-[14px] gap-y-[4px] font-mono text-[11.5px] @max-[470px]:grid-cols-[1fr]`,children:[`dimensions`,`size`,`path`].map((e,t)=>(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(`dt`,{className:me,children:e}),(0,B.jsx)(`dd`,{className:`flex items-center`,children:(0,B.jsx)(`span`,{className:`img-skeleton h-[11px] rounded`,style:{width:he[t]}})})]},e))}),t]})]})}function _e({code:e,onRetry:t}){return(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-panel px-2.5 py-2 font-mono text-[12px] text-text-2`,children:[(0,B.jsx)(x,{className:`size-3 shrink-0`}),(0,B.jsxs)(`span`,{className:`truncate`,children:[`preview unavailable`,e?` · ${e}`:``]}),(0,B.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto shrink-0 text-accent`,children:`retry`})]})}var ve=.62;function ye(e,t){let n=e.w/e.h;if(n>2.4)return{variant:`band`,aspect:n,fit:`contain`};let r=Math.max(ve,n),i=t/r;return e.w<t&&e.h<i?{variant:`split`,aspect:r,fit:`native`}:{variant:`split`,aspect:r,fit:n<.62?`contain`:`cover`}}function be(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function xe(e,t){let n=`${e.w} × ${e.h} px`;return t===`native`?`${n} · shown 1:1`:n}var K=new Map;function Se(e){return K.get(e)}function Ce(e,t){K.set(e,t)}var we=4/5,q=`text-[var(--img-meta-label)] @max-[470px]:hidden`,J=`truncate text-text @max-[470px]:text-text-2`,Y=`h-[30px] @max-[470px]:h-[36px] shrink-0 rounded-[7px] px-[9px] font-mono text-[11.5px] text-text-2 bg-[var(--img-ghost)] border border-[var(--img-ghost-border)] backdrop-blur-[6px] transition-colors can-hover:hover:bg-[var(--img-ghost-hover)] can-hover:hover:border-[var(--img-ghost-hover-border)] can-hover:hover:text-text`;function Te({filePath:e,projectName:t}){let[n,r]=(0,z.useState)(0),{blobUrl:i,blob:a,error:o,errorCode:s}=O(e,t,void 0,n),[c,l]=(0,z.useState)(()=>Se(e)),[u,d]=(0,z.useState)(!1),[f,p]=(0,z.useState)(!1),m=D(e=>e.open),{openTab:h}=_(b(e=>({openTab:e.openTab}))),v=g(e);(0,z.useEffect)(()=>{if(!f)return;let e=setTimeout(()=>p(!1),1200);return()=>clearTimeout(e)},[f]);let y=t=>{let n={w:t.naturalWidth,h:t.naturalHeight};if(!n.w||!n.h)return d(!0);Ce(e,n),l(n)},x=()=>{d(!1),r(e=>e+1)};if(o||u)return(0,B.jsx)(`div`,{className:`border-t border-border pt-1.5`,children:(0,B.jsx)(_e,{code:u?void 0:s??void 0,onRetry:x})});let S=c?ye(c,132):null,C=S?.aspect??we,w=(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-[6px]`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:E,className:Y,children:[(0,B.jsx)(`span`,{className:`@max-[470px]:hidden`,children:`open in editor`}),(0,B.jsx)(`span`,{className:`hidden @max-[470px]:inline`,children:`open`})]}),(0,B.jsx)(`button`,{type:`button`,onClick:j,className:Y,children:f?`copied`:`copy path`}),(0,B.jsx)(`button`,{type:`button`,onClick:M,className:Y,children:`full size`})]});function E(){t&&h({type:`editor`,title:v,metadata:{filePath:e,projectName:t},projectId:t,closable:!0})}function j(){T(e).then(()=>p(!0))}function M(e){i&&m(i,v,k(e.currentTarget))}if(!i||!S||!c)return(0,B.jsxs)(`div`,{className:`@container border-t border-border pt-1.5`,children:[i&&(0,B.jsx)(`img`,{src:i,alt:``,className:`hidden`,onLoad:e=>y(e.currentTarget),onError:()=>d(!0)}),(0,B.jsx)(ge,{aspect:C,actions:w})]});let N=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{className:q,children:`dimensions`}),(0,B.jsx)(`dd`,{className:J,children:xe(c,S.fit)}),a&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{className:q,children:`size`}),(0,B.jsxs)(`dd`,{className:J,children:[be(a.size),a.type?` · ${a.type}`:``]})]}),(0,B.jsx)(`dt`,{className:q,children:`path`}),(0,B.jsx)(`dd`,{dir:`rtl`,className:`${J} text-left`,children:e})]}),P=(0,B.jsx)(`img`,{src:i,alt:v,[A]:``,onLoad:e=>y(e.currentTarget),onError:()=>d(!0),className:S.fit===`cover`?`size-full object-cover`:S.fit===`contain`?`size-full object-contain`:`max-h-full max-w-full`});return(0,B.jsx)(`div`,{className:`@container border-t border-border pt-1.5`,children:(0,B.jsxs)(`div`,{className:`relative overflow-hidden rounded-lg border border-border p-[14px] @max-[470px]:p-[11px]`,children:[(0,B.jsx)(`img`,{"aria-hidden":`true`,alt:``,src:i,className:`absolute inset-0 size-full object-cover`,style:{filter:`var(--img-backdrop)`,transform:`scale(1.3)`}}),(0,B.jsx)(`div`,{className:`absolute inset-0`,style:{background:`var(--img-veil)`}}),S.variant===`band`?(0,B.jsxs)(`div`,{className:`relative grid gap-[11px]`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:M,title:`Open ${v}`,className:`img-checkerboard w-full cursor-zoom-in overflow-hidden rounded-lg border border-[var(--img-plate-border)]`,style:{aspectRatio:S.aspect},children:P}),(0,B.jsx)(`dl`,{className:`grid grid-cols-[auto_auto_1fr] gap-x-[18px] font-mono text-[11.5px] [&_dt]:hidden`,children:N}),w]}):(0,B.jsxs)(`div`,{className:`relative grid grid-cols-[132px_1fr] items-start gap-[14px] @max-[470px]:grid-cols-[64px_1fr] @max-[470px]:gap-[11px]`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:M,title:`Open ${v}`,className:`cursor-zoom-in overflow-hidden rounded-lg border border-[var(--img-plate-border)] bg-[var(--img-plate)] shadow-[var(--img-plate-shadow)] ${S.fit===`cover`?``:`img-checkerboard flex items-center justify-center`}`,style:{aspectRatio:S.aspect},children:P}),(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-[9px]`,children:[(0,B.jsx)(`p`,{className:`truncate text-[13px] font-semibold text-text @max-[470px]:hidden`,children:v}),(0,B.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-[14px] gap-y-[4px] font-mono text-[11.5px] @max-[470px]:grid-cols-[1fr]`,children:N}),w]})]})]})})}function X(e,t){if(e!==`Agent`&&e!==`Task`)return null;let n=t.name;return typeof n==`string`&&n.trim()?n.trim():null}function Ee(e,t,n=!1){if(t&&(e===`Bash`||e===`PowerShell`))return{Icon:C,cls:`bg-error/15 text-error`};if(n)return{Icon:S,cls:`bg-accent-2/15 text-accent-2`};switch(e){case`Read`:case`Glob`:case`LS`:return{Icon:F,cls:`bg-accent-wash text-primary`};case`Grep`:case`Search`:case`WebSearch`:case`ToolSearch`:return{Icon:E,cls:`bg-accent-wash text-primary`};case`WebFetch`:case`Fetch`:return{Icon:w,cls:`bg-info/15 text-info`};case`Edit`:case`MultiEdit`:case`NotebookEdit`:return{Icon:N,cls:`bg-accent-2/15 text-accent-2`};case`Write`:return{Icon:P,cls:`bg-success/15 text-success`};case`Bash`:case`PowerShell`:return{Icon:C,cls:`bg-panel-2 text-text-2`};case`TodoWrite`:return{Icon:L,cls:`bg-warning/15 text-warning`};case`Task`:case`Agent`:return{Icon:o,cls:`bg-accent-wash text-primary`};case`SendMessage`:return{Icon:m,cls:`bg-info/15 text-info`};case`AskUserQuestion`:return{Icon:a,cls:`bg-accent-wash text-primary`};case`ExitPlanMode`:return{Icon:M,cls:`bg-accent-wash text-primary`};case`Skill`:return{Icon:f,cls:`bg-accent-2/15 text-accent-2`};case`ImageGen`:return{Icon:I,cls:`bg-accent-2/15 text-accent-2`};default:return{Icon:u,cls:`bg-panel-2 text-text-2`}}}function De(e){let t=e.type===`approval_request`;return{toolName:e.type===`tool_use`?e.tool:t?e.tool??`Tool`:`Tool`,input:e.type===`tool_use`?e.input:t?e.input??{}:{}}}var Oe=new Set([`Read`,`ImageGen`]);function Z(e){if(e.type!==`tool_use`||!Oe.has(e.tool))return null;let t=e.input?.file_path;return typeof t!=`string`||!/^(\/|[A-Za-z]:[/\\])/.test(t)?null:le(t)?t:null}function Q({tool:e,result:t,completed:n,projectName:r,bashPartialOutput:i}){let[a,o]=(0,z.useState)(()=>{let n=(e.type,e.tool),r=t?.type===`tool_result`&&!!t.isError;return(n===`Edit`||n===`MultiEdit`)&&!r?!0:!!Z(e)});if(e.type===`error`)return(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded bg-error/10 border border-error/20 px-2 py-1.5 text-xs text-error`,children:[(0,B.jsx)(x,{className:`size-3`}),(0,B.jsx)(`span`,{children:e.message})]});let{toolName:l,input:u}=De(e),d=t?.type===`tool_result`,f=d&&!!t.isError,m=d&&typeof t.exitCode==`number`?t.exitCode:void 0,h=l===`AskUserQuestion`&&!!u?.answers,g=e.type===`approval_request`&&e.approved!=null,_=(l===`Agent`||l===`Task`)&&e.type===`tool_use`,y=_?e.children:void 0,b=y&&y.length>0,S=_&&e.type===`tool_use`?e.bgStatus:void 0,C=_&&(S!=null||d&&!f&&pe(String(t.output??``)))&&S==null,w=S===`failed`||S===`stopped`,T=C?!1:d||h||g||n,E=[`Edit`,`MultiEdit`,`Write`,`NotebookEdit`].includes(l),D=Z(e),O=d&&de(String(t.output??``)),k=!!D,A=e.type===`tool_use`?e.toolUseId:void 0,M=(l===`Bash`||l===`PowerShell`)&&!d&&A?i?.current?.get(A):void 0,N=!!M;(0,z.useEffect)(()=>{N&&!a&&o(!0)},[N]);let P=(0,z.useRef)(!1);(0,z.useEffect)(()=>{f&&(l===`Edit`||l===`MultiEdit`)&&!P.current&&(P.current=!0,o(!1))},[f,l]);let{Icon:F,cls:I}=Ee(l,f,!!X(l,u)),L=l===`AskUserQuestion`||l===`ExitPlanMode`||_;return(0,B.jsxs)(`div`,{"data-tool-ref":A,className:`rounded-[11px] border overflow-hidden text-xs bg-panel ${L?`border-accent-wash-border`:`border-border`}`,children:[(0,B.jsxs)(`button`,{onClick:()=>o(!a),className:`flex items-center gap-2.5 px-2.5 py-2 w-full text-left hover:bg-panel-2/40 transition-colors min-w-0`,children:[(0,B.jsx)(`span`,{className:`inline-flex items-center justify-center size-6 rounded-[7px] shrink-0 ${I}`,children:(0,B.jsx)(F,{className:`size-3.5`})}),(0,B.jsx)(`span`,{className:`truncate text-text font-medium`,children:(0,B.jsx)(ke,{name:l,input:u})}),(0,B.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 shrink-0`,children:[N&&(0,B.jsxs)(`span`,{className:`text-[10px] text-warning`,children:[M.lineCount,` line`,M.lineCount===1?``:`s`,` streaming…`]}),b&&!N&&(0,B.jsxs)(`span`,{className:`text-[10px] text-text-3 font-mono`,children:[y.length,` steps`]}),C&&(0,B.jsx)(`span`,{className:`text-[10px] text-primary`,children:`running…`}),m!=null&&(0,B.jsxs)(`span`,{className:`text-[10px] font-mono ${m===0?`text-text-3`:`text-error`}`,children:[`exit `,m]}),f||w?(0,B.jsx)(j,{className:`size-3.5 text-error`}):T?(0,B.jsx)(v,{className:`size-3.5 text-success`}):(0,B.jsx)(p,{className:`size-3.5 text-primary animate-spin`}),a?(0,B.jsx)(s,{className:`size-3 text-text-3`}):(0,B.jsx)(c,{className:`size-3 text-text-3`})]})]}),a&&(0,B.jsxs)(`div`,{className:`px-2 pb-2 space-y-1.5 select-text`,children:[(e.type===`tool_use`||e.type===`approval_request`)&&(0,B.jsx)(Ae,{name:l,input:u,projectName:r,toolUseId:A}),M&&(0,B.jsx)(Ie,{content:M.content,lineCount:M.lineCount}),b&&(0,B.jsx)(Fe,{events:y,projectName:r}),D&&(0,B.jsx)(Te,{filePath:D,projectName:r??``}),d&&!(E&&!f)&&!(O&&!f)&&!(k&&!f)&&(0,B.jsx)(Ne,{toolName:l,output:t.output})]})]})}function ke({name:e,input:t}){let n=e=>String(e??``);switch(e){case`Read`:case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:return(0,B.jsxs)(B.Fragment,{children:[e,` `,(0,B.jsx)(`span`,{className:`text-text-subtle`,children:g(n(t.file_path))})]});case`Bash`:case`PowerShell`:{let r=t.description?n(t.description):n(t.command);return(0,B.jsxs)(B.Fragment,{children:[e,` `,(0,B.jsx)(`span`,{className:`text-text-subtle${t.description?``:` font-mono`}`,children:$(r,60)})]})}case`Glob`:return(0,B.jsxs)(B.Fragment,{children:[e,` `,(0,B.jsx)(`span`,{className:`font-mono text-text-subtle`,children:n(t.pattern)})]});case`Grep`:return(0,B.jsxs)(B.Fragment,{children:[e,` `,(0,B.jsx)(`span`,{className:`font-mono text-text-subtle`,children:$(n(t.pattern),40)})]});case`WebSearch`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(E,{className:`size-3 inline`}),` `,e,` `,(0,B.jsx)(`span`,{className:`text-text-subtle`,children:$(n(t.query),50)})]});case`WebFetch`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(w,{className:`size-3 inline`}),` `,e,` `,(0,B.jsx)(`span`,{className:`text-text-subtle`,children:$(n(t.url),50)})]});case`ToolSearch`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(E,{className:`size-3 inline`}),` `,e,` `,(0,B.jsx)(`span`,{className:`text-text-subtle`,children:$(n(t.query),50)})]});case`ImageGen`:{let e=(n(t.prompt).split(`
|
|
4
4
|
`).find(e=>e.trim())??``)||g(n(t.file_path));return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(I,{className:`size-3 inline`}),` Image`,(0,B.jsxs)(`span`,{className:`text-text-subtle`,children:[` `,$(e,50)]})]})}case`Agent`:case`Task`:{let r=X(e,t),i=$(n(t.description||t.prompt),r?44:60);return(0,B.jsxs)(B.Fragment,{children:[!r&&(0,B.jsx)(o,{className:`size-3 inline`}),` `,e,` `,r&&(0,B.jsx)(`span`,{className:`text-text-primary font-medium`,children:r}),(0,B.jsx)(`span`,{className:`text-text-subtle`,children:r?` · ${i}`:i})]})}case`SendMessage`:return(0,B.jsx)(ae,{name:e,input:t});case`TodoWrite`:{let n=Array.isArray(t.todos)?t.todos:[],r=n.filter(e=>e.status===`completed`).length;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(R,{className:`size-3 inline`}),` `,e,` `,(0,B.jsxs)(`span`,{className:`text-text-subtle`,children:[r,`/`,n.length,` done`]})]})}case`AskUserQuestion`:{let n=Array.isArray(t.questions)?t.questions:[],r=!!t.answers;return(0,B.jsxs)(B.Fragment,{children:[e,` `,(0,B.jsxs)(`span`,{className:`text-text-subtle`,children:[n.length,` question`,n.length===1?``:`s`,r?` ✓`:``]})]})}case`ScheduleWakeup`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(l,{className:`size-3 inline`}),` `,e,` `,(0,B.jsxs)(`span`,{className:`text-text-subtle`,children:[`in `,Be(Number(t.delaySeconds)),t.reason?` — ${$(n(t.reason),50)}`:``]})]});case`TaskCreate`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(R,{className:`size-3 inline`}),` `,e,` `,(0,B.jsx)(`span`,{className:`text-text-subtle`,children:$(n(t.subject),60)})]});case`TaskUpdate`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(R,{className:`size-3 inline`}),` `,e,` `,(0,B.jsxs)(`span`,{className:`text-text-subtle`,children:[`#`,n(t.taskId),` → `,n(t.status)]})]});case`TaskStop`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(R,{className:`size-3 inline`}),` `,e,` `,(0,B.jsxs)(`span`,{className:`text-text-subtle`,children:[`#`,n(t.taskId),` stopped`]})]});default:return(0,B.jsx)(B.Fragment,{children:e})}}function Ae({name:e,input:t,projectName:n,toolUseId:r}){let i=e=>String(e??``),{openTab:a}=_(b(e=>({openTab:e.openTab}))),o=e=>{n&&a({type:`editor`,title:g(e),metadata:{filePath:e,projectName:n},projectId:n,closable:!0})},s=(e,t,r)=>{a({type:`git-diff`,title:`Diff ${g(e)}`,metadata:{filePath:e,projectName:n,original:t,modified:r},projectId:n??null,closable:!0})};switch(e){case`Bash`:case`PowerShell`:return(0,B.jsxs)(`div`,{className:`space-y-1`,children:[!!t.description&&(0,B.jsx)(`p`,{className:`text-text-subtle italic`,children:i(t.description)}),(0,B.jsx)(`pre`,{className:`font-mono text-text-secondary overflow-x-auto whitespace-pre-wrap break-all`,children:i(t.command)})]});case`Read`:case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:{let n=i(t.notebook_path||t.file_path),a=e===`Edit`&&(!!t.old_string||!!t.new_string),c=e=>r?`${r}-${e}`:void 0;return(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`font-mono text-text-secondary break-all hover:text-primary hover:underline text-left flex items-center gap-1 min-w-0`,onClick:()=>o(n),title:`Open file in editor`,children:[(0,B.jsx)(y,{className:`size-3 shrink-0`}),n]}),a&&(0,B.jsxs)(`button`,{type:`button`,className:`text-text-subtle hover:text-primary hover:underline flex items-center gap-1 shrink-0 whitespace-nowrap`,onClick:()=>s(n,i(t.old_string),i(t.new_string)),title:`View diff in new tab`,children:[(0,B.jsx)(d,{className:`size-3 shrink-0`}),`View Diff`]})]}),a&&(0,B.jsx)(`div`,{"data-edit-ref":c(0),children:(0,B.jsx)(ze,{oldStr:i(t.old_string),newStr:i(t.new_string),filePath:n})}),e===`MultiEdit`&&Array.isArray(t.edits)&&(0,B.jsx)(`div`,{className:`space-y-1.5`,children:t.edits.map((e,t)=>(0,B.jsxs)(`div`,{"data-edit-ref":c(t),className:`space-y-0.5`,children:[(0,B.jsxs)(`p`,{className:`text-text-subtle text-[10px]`,children:[`Edit `,t+1]}),(0,B.jsx)(ze,{oldStr:i(e.old_string),newStr:i(e.new_string),filePath:n})]},t))}),e===`Write`&&!!t.content&&(0,B.jsx)(`pre`,{"data-edit-ref":c(0),className:`font-mono text-text-subtle overflow-x-auto max-h-32 whitespace-pre-wrap`,children:$(i(t.content),300)})]})}case`Glob`:return(0,B.jsxs)(`p`,{className:`font-mono text-text-secondary`,children:[i(t.pattern),t.path?` in ${i(t.path)}`:``]});case`Grep`:return(0,B.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,B.jsxs)(`p`,{className:`font-mono text-text-secondary`,children:[`/`,i(t.pattern),`/`]}),!!t.path&&(0,B.jsxs)(`p`,{className:`text-text-subtle`,children:[`in `,i(t.path)]})]});case`TodoWrite`:return(0,B.jsx)(Me,{todos:t.todos??[]});case`Agent`:case`Task`:{let n=X(e,t);return(0,B.jsxs)(`div`,{className:`space-y-1`,children:[!!n&&(0,B.jsxs)(`p`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`text-text-subtle`,children:`Name`}),(0,B.jsx)(`span`,{className:`font-medium text-text-primary`,children:n}),(0,B.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-[10px] bg-accent-2/15 text-accent-2`,children:`teammate`}),t.isolation===`worktree`&&(0,B.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-[10px] bg-panel-2 text-text-3`,children:`worktree`})]}),!!t.description&&(0,B.jsx)(`p`,{className:`text-text-secondary font-medium`,children:i(t.description)}),!!t.subagent_type&&(0,B.jsxs)(`p`,{className:`text-text-subtle`,children:[`Type: `,i(t.subagent_type)]}),!!t.prompt&&(0,B.jsx)(V,{content:i(t.prompt),maxHeight:`max-h-48`})]})}case`SendMessage`:return(0,B.jsx)(oe,{input:t});case`ToolSearch`:return(0,B.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,B.jsx)(`p`,{className:`font-mono text-text-secondary`,children:i(t.query)}),!!t.max_results&&(0,B.jsxs)(`p`,{className:`text-text-subtle`,children:[`Max results: `,i(t.max_results)]})]});case`WebFetch`:return(0,B.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,B.jsxs)(`a`,{href:i(t.url),target:`_blank`,rel:`noopener noreferrer`,className:`font-mono text-primary hover:underline break-all flex items-center gap-1`,children:[(0,B.jsx)(w,{className:`size-3 shrink-0`}),i(t.url)]}),!!t.prompt&&(0,B.jsx)(`p`,{className:`text-text-subtle`,children:$(i(t.prompt),100)})]});case`AskUserQuestion`:{let e=t.questions??[],n=t.answers??{};return(0,B.jsx)(`div`,{className:`space-y-2`,children:e.map((e,t)=>(0,B.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,B.jsxs)(`p`,{className:`text-text-primary font-medium`,children:[e.header?`${e.header}: `:``,e.question]}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.options.map((t,r)=>(0,B.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-xs border ${(n[e.question]??``).split(`, `).includes(t.label)?`border-primary bg-primary/20 text-text-primary`:`border-border text-text-subtle`}`,children:t.label},r))}),n[e.question]&&(0,B.jsxs)(`p`,{className:`text-foreground text-xs`,children:[`Answer: `,n[e.question]]})]},t))})}case`ScheduleWakeup`:{let e=Number(t.delaySeconds)||0;return(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`p`,{className:`text-text-secondary`,children:[(0,B.jsx)(l,{className:`size-3 inline mr-1`}),`Wake in `,(0,B.jsx)(`span`,{className:`font-medium text-text-primary`,children:Be(e)}),(0,B.jsxs)(`span`,{className:`text-text-subtle`,children:[` (`,e,`s)`]})]}),!!t.reason&&(0,B.jsx)(`p`,{className:`text-text-secondary italic`,children:i(t.reason)}),!!t.prompt&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-text-subtle text-[10px] mb-0.5`,children:`Prompt on wake`}),(0,B.jsx)(V,{content:i(t.prompt),maxHeight:`max-h-48`})]})]})}case`TaskCreate`:return(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`p`,{className:`text-text-primary font-medium`,children:i(t.subject)}),!!t.description&&(0,B.jsx)(`p`,{className:`text-text-subtle`,children:i(t.description)}),!!t.activeForm&&(0,B.jsx)(`p`,{className:`text-text-subtle italic`,children:i(t.activeForm)})]});case`TaskUpdate`:return(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsxs)(`span`,{className:`font-mono text-text-secondary`,children:[`#`,i(t.taskId)]}),(0,B.jsx)(je,{status:i(t.status)})]});case`TaskStop`:return(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsxs)(`span`,{className:`font-mono text-text-secondary`,children:[`#`,i(t.taskId)]}),(0,B.jsx)(je,{status:`stopped`})]});case`ImageGen`:return(0,B.jsxs)(`div`,{className:`space-y-1`,children:[!!t.prompt&&(0,B.jsx)(`p`,{className:`text-text-secondary whitespace-pre-wrap`,children:i(t.prompt)}),t.transparentBackground===!0&&(0,B.jsx)(`p`,{className:`text-text-subtle`,children:`Transparent background`})]});default:return(0,B.jsx)(`pre`,{className:`overflow-x-auto text-text-secondary font-mono whitespace-pre-wrap break-all`,children:JSON.stringify(t,null,2)})}}function je({status:e}){return(0,B.jsx)(`span`,{className:`inline-block rounded px-1.5 py-0.5 text-[10px] border ${e===`completed`?`text-success border-success/30 bg-success/10`:e===`in_progress`?`text-warning border-warning/30 bg-warning/10`:`text-text-subtle border-border bg-surface`}`,children:e})}function Me({todos:e}){return(0,B.jsx)(`div`,{className:`space-y-0.5`,children:e.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,B.jsx)(`span`,{className:`shrink-0 mt-0.5 ${e.status===`completed`?`text-success`:e.status===`in_progress`?`text-warning`:`text-text-subtle`}`,children:e.status===`completed`?`✓`:e.status===`in_progress`?`▶`:`○`}),(0,B.jsx)(`span`,{className:e.status===`completed`?`line-through text-text-subtle`:`text-text-secondary`,children:e.content})]},t))})}function Ne({toolName:e,output:t}){let[n,r]=(0,z.useState)(!1),i=(0,z.useMemo)(()=>{if(e!==`Agent`&&e!==`Task`)return null;try{let e=JSON.parse(t);if(Array.isArray(e)){let t=e.filter(e=>e.type===`text`&&e.text).map(e=>e.text).join(`
|
|
5
5
|
|
|
6
6
|
`);if(t)return t}if(typeof e==`string`)return e}catch{if(t&&!t.startsWith(`[{`))return t}return null},[e,t]);return e===`SendMessage`&&G(t)?(0,B.jsx)(se,{output:t}):i?(0,B.jsxs)(`div`,{className:`border-t border-border pt-1.5 space-y-1`,children:[(0,B.jsx)(V,{content:i,maxHeight:`max-h-60`}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(!n),className:`flex items-center gap-1 text-[10px] text-text-subtle hover:text-text-secondary transition-colors`,children:[(0,B.jsx)(u,{className:`size-3`}),n?`Hide`:`Show`,` raw`]}),n&&(0,B.jsx)(`pre`,{className:`overflow-x-auto text-text-subtle font-mono max-h-40 whitespace-pre-wrap break-all text-[10px]`,children:t})]}):(0,B.jsx)(Pe,{output:t})}function Pe({output:e}){let t=e.split(`
|
|
7
7
|
`).length,n=t>3||e.length>200,[r,i]=(0,z.useState)(n);return(0,B.jsxs)(`div`,{className:`border-t border-border pt-1.5`,children:[n&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),className:`flex items-center gap-1 text-[10px] text-text-subtle hover:text-text-secondary transition-colors mb-1`,children:[r?(0,B.jsx)(c,{className:`size-3`}):(0,B.jsx)(s,{className:`size-3`}),`Output (`,t,` lines)`]}),(0,B.jsx)(`pre`,{className:`overflow-x-auto text-text-subtle font-mono whitespace-pre-wrap break-all ${r?`max-h-16 overflow-hidden`:`max-h-60`}`,children:e})]})}function Fe({events:e,projectName:t,className:n}){let r=[],i=``;for(let t of e)if(t.type===`text`)i+=t.content;else if(t.type===`tool_use`)i&&=(r.push({kind:`text`,content:i}),``),r.push({kind:`tool`,tool:t});else if(t.type===`tool_result`){let e=t.toolUseId,n=e?r.find(t=>t.kind===`tool`&&t.tool.type===`tool_use`&&t.tool.toolUseId===e&&!t.result):r.findLast(e=>e.kind===`tool`&&!e.result);n&&(n.result=t)}i&&r.push({kind:`text`,content:i});let a=(0,z.useRef)(null),o=(0,z.useRef)(!1);return(0,z.useEffect)(()=>{a.current&&!o.current&&(a.current.scrollTop=a.current.scrollHeight)},[r.length]),(0,B.jsx)(`div`,{ref:a,onScroll:e=>{let t=e.currentTarget;o.current=t.scrollTop+t.clientHeight<t.scrollHeight-20},className:n??`border-l-2 border-accent/20 pl-2 space-y-1 mt-1 max-h-64 md:max-h-96 overflow-y-auto`,children:r.map((e,n)=>e.kind===`text`?(0,B.jsx)(`div`,{className:`text-text-secondary text-[11px]`,children:(0,B.jsx)(V,{content:e.content,maxHeight:`max-h-24`})},`st-${n}`):(0,B.jsx)(Q,{tool:e.tool,result:e.result,completed:!!e.result,projectName:t},`sc-${n}`))})}function Ie({content:e,lineCount:t}){let n=(0,z.useRef)(null),r=(0,z.useRef)(!1);return(0,z.useEffect)(()=>{n.current&&!r.current&&(n.current.scrollTop=n.current.scrollHeight)},[e]),(0,B.jsxs)(`div`,{className:`border-t border-border pt-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-warning mb-1`,children:[(0,B.jsx)(p,{className:`size-3 animate-spin`}),(0,B.jsxs)(`span`,{children:[`Output (`,t,` line`,t===1?``:`s`,`, streaming...)`]})]}),(0,B.jsx)(`pre`,{ref:n,onScroll:e=>{let t=e.currentTarget;r.current=t.scrollTop+t.clientHeight<t.scrollHeight-20},className:`overflow-x-auto overflow-y-auto max-h-60 text-text-subtle font-mono whitespace-pre-wrap break-all text-[11px]`,children:e.split(`
|
|
8
8
|
`).slice(-200).join(`
|
|
9
|
-
`)})]})}var Le=h(()=>import(`./edit-diff-preview-
|
|
9
|
+
`)})]})}var Le=h(()=>import(`./edit-diff-preview-BvgPvuhH.js`),__vite__mapDeps([48,2,4,49])),Re=(0,z.lazy)(()=>Le);function ze(e){return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{className:`animate-pulse h-8 bg-muted rounded`}),children:(0,B.jsx)(Re,{...e})})}function $(e,t=50){return e?e.length>t?e.slice(0,t)+`…`:e:``}function Be(e){if(!Number.isFinite(e)||e<=0)return`0s`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.round(e%60),i=[];return t&&i.push(`${t}h`),n&&i.push(`${n}m`),(r||i.length===0)&&i.push(`${r}s`),i.join(` `)}export{M as a,R as i,Q as n,j as o,te as r,Fe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{S as t,x as n}from"./vendor-markdown-Ls5AcU91.js";import{t as r}from"./download-DG3_9xXy.js";import{t as i}from"./eye-gWwaF4Lg.js";import{t as a}from"./key-round-CQpDrDxg.js";import{t as o}from"./x-CxoBA0po.js";import{t as s}from"./button-DX32ffge.js";import{Dn as c,G as l,Ln as u,On as d,Xn as f,kn as p}from"./index-Cx1meAwb.js";import{getAccounts as m,getActiveAccount as h,getAllAccountUsages as g,patchAccount as _}from"./api-settings-D18Q4Ocp.js";function v(e){return e>=90?`text-error`:e>=70?`text-warning`:`text-success`}function y(e){return e>=90?`bg-error`:e>=70?`bg-warning`:`bg-success`}function b(e){if(!e)return null;let t=null;if(e.resetsInMinutes!=null)t=e.resetsInMinutes;else if(e.resetsInHours!=null)t=Math.round(e.resetsInHours*60);else if(e.resetsAt){let n=new Date(e.resetsAt).getTime()-Date.now();t=n>0?Math.ceil(n/6e4):0}if(t==null)return null;if(t<=0)return`now`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60;return n>0?i>0?`${n}d ${r}h ${i}m`:r>0?`${n}d ${r}h`:`${n}d`:r>0?i>0?`${r}h ${i}m`:`${r}h`:`${i}m`}function x(e){if(!e)return null;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null}function S(e){let t=e-Date.now();if(t<=0)return`expired`;let n=Math.ceil(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}d ${r%24}h`:r>0?`${r}h ${n%60}m`:`${n}m`}function C(e){if(!e)return{label:`unknown`,tip:`No account info available`,color:`text-text-subtle`};if(!e.expiresAt)return{label:`key`,tip:`API key (no expiry)`,color:`text-text-subtle`};if(e.reauthRequired)return{label:`sign in again`,tip:`Anthropic rejected this account's refresh token. Sign in again to restore it.`,color:`text-error`};let t=e.expiresAt*1e3<Date.now();return t&&e.hasRefreshToken?{label:`expired`,tip:`Token expired but has refresh token — will auto-renew`,color:`text-warning`}:t?{label:`expired`,tip:`Token expired, no refresh token`,color:`text-error`}:e.hasRefreshToken?{label:`long-lived`,tip:`OAuth token with refresh — long-lived`,color:`text-success`}:{label:`temp`,tip:`Temporary token without refresh — will expire`,color:`text-warning`}}function w(e){if(!e)return null;let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60),i=n%60;return r<24?i>0?`${r}h ${i}m ago`:`${r}h ago`:`${Math.floor(r/24)}d ago`}var T=n();function E({label:e,pct:t,reset:n,resetsAt:r}){let i=x(r);return(0,T.jsxs)(`div`,{className:`space-y-1`,"data-testid":`account-usage-bar`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`span`,{className:`text-xs font-medium text-text-primary`,children:e}),n&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsxs)(`span`,{className:`text-[10px] text-text-subtle cursor-default`,children:[`↻ `,n]})}),(0,T.jsx)(d,{side:`top`,children:i?`Resets ${i}`:`Resets in`})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-border overflow-hidden`,children:t!=null&&(0,T.jsx)(`div`,{className:`h-full rounded-full transition-all ${y(t)}`,style:{width:`${Math.min(t,100)}%`}})}),(0,T.jsx)(`span`,{className:`text-xs font-medium tabular-nums w-10 text-right ${t==null?`text-text-subtle`:v(t)}`,children:t==null?`—`:`${t}%`})]})]})}function D({label:e,bucket:t}){return t?(0,T.jsx)(E,{label:e,pct:Math.round(t.utilization*100),reset:b(t),resetsAt:t.resetsAt}):null}function O({hint:e,className:t,children:n}){return(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{type:`button`,className:[`cursor-help text-left`,t].filter(Boolean).join(` `),children:n})}),(0,T.jsx)(d,{side:`top`,className:`max-w-[260px] text-xs leading-relaxed`,children:e})]})}function k({description:e,onRefresh:t,refreshing:n,disabled:r,actions:i}){return(0,T.jsxs)(`section`,{className:`space-y-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,T.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-8 shrink-0 cursor-pointer`,onClick:t,disabled:r||n,title:`Refresh`,"aria-label":`Refresh accounts`,children:(0,T.jsx)(f,{className:`size-4 ${n?`animate-spin`:``}`})})]}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i})]})}function A({message:e,onDismiss:t}){return e?(0,T.jsxs)(`div`,{className:`flex items-start gap-2 text-xs p-2 rounded bg-muted`,role:`status`,children:[(0,T.jsx)(`span`,{className:`flex-1`,children:e}),(0,T.jsx)(`button`,{onClick:t,className:`shrink-0 text-muted-foreground hover:text-foreground cursor-pointer`,"aria-label":`Dismiss message`,children:(0,T.jsx)(o,{className:`size-3.5`})})]}):null}function j({children:e}){return(0,T.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1 -mx-1 px-1 snap-x snap-mandatory scrollbar-thin`,children:e})}function M({active:e,flash:t,dense:n,children:r,...i}){return(0,T.jsx)(`div`,{...i,className:[`rounded-md border transition-colors duration-500`,n?`p-2.5 space-y-1.5`:`p-3 space-y-2`,t?`bg-primary/10 border-primary/40`:``,e?`border-primary/30 bg-primary/5`:`border-border/50`,i.className??``].filter(Boolean).join(` `),children:r})}var N={readOnly:`min-w-[220px]`,withActions:`min-w-[300px]`};function P({entry:e,isActive:t,accountInfo:n,onToggle:o,toggling:s,onDelete:m,onExport:h,onViewProfile:g,flash:_,onSelect:v,unselectableReason:y,selecting:b,planLabel:x,layout:E=`list`}){let{usage:k}=e,A=k.session||k.weekly||k.weeklyOpus||k.weeklySonnet,j=n?.status??e.accountStatus,P=!!(n&&!n.hasRefreshToken&&n.expiresAt&&n.expiresAt<Math.floor(Date.now()/1e3)),F=C(n),I=!!n?.reauthRequired,L=n?.grantExpiresAt?n.grantExpiresAt*1e3:null,R=!!L&&L-Date.now()<5*864e5,z=!!n&&(F.label===`temp`||F.label===`unknown`||F.label===`expired`&&!P&&!I),B=L?new Date(L).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null,V=!!(o||m||h||g),H=P?`Token expired — sign in again`:I?`Sign in again to use this account`:y??null,U=E===`list`?``:E===`grid`?`flex flex-col justify-evenly overflow-hidden min-h-0`:`shrink-0 snap-start ${V?N.withActions:N.readOnly}`;return(0,T.jsxs)(M,{active:t,flash:_,dense:E!==`list`,className:[U,P||I?`opacity-50`:``].filter(Boolean).join(` `)||void 0,"data-testid":`account-card`,"data-account-id":e.accountId,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.accountLabel??e.accountId.slice(0,8)}),t&&(0,T.jsx)(O,{className:`text-[10px] text-primary shrink-0 font-medium`,hint:`The next turn will run on this account.`,children:`Active`}),v&&!t&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{type:`button`,onClick:()=>v(e.accountId),disabled:b,className:[`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium transition-colors cursor-pointer disabled:cursor-wait`,H?`text-text-subtle hover:text-error hover:bg-error/10`:`text-text-secondary hover:text-foreground hover:bg-surface-elevated`].join(` `),children:b?`Switching…`:`Use`})}),(0,T.jsx)(d,{side:`top`,children:H??`Use this account for this chat`})]}),P&&(0,T.jsx)(O,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`This token has expired and carries no refresh token, so nothing can renew it. Add the account again.`,children:`Expired`}),I&&!P&&(0,T.jsx)(O,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`Anthropic rejected this account's refresh token, so no turn can run on it. Signing in again is the only thing that restores it.`,children:`Sign in again`}),!e.isOAuth&&!P&&(0,T.jsx)(O,{className:`text-[10px] text-text-subtle shrink-0`,hint:`A static API key rather than a sign-in: nothing to expire and nothing to renew.`,children:`API key`}),x&&(0,T.jsx)(O,{className:`text-[10px] uppercase tracking-wide text-text-subtle shrink-0`,hint:`The subscription this account is on. It decides which quota windows the account has — some plans have a weekly limit and no shorter one.`,children:x}),(0,T.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[!P&&g&&n?.profileData&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-foreground hover:bg-surface-elevated transition-colors`,onClick:()=>g(n.profileData,e.accountId),"aria-label":`View profile`,children:(0,T.jsx)(i,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`View profile`})]}),!P&&h&&e.isOAuth&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-primary hover:bg-surface-elevated transition-colors`,onClick:()=>h(e.accountId),"aria-label":`Export this account`,children:(0,T.jsx)(r,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`Export this account`})]}),!P&&o&&(0,T.jsx)(l,{checked:j!==`disabled`,onCheckedChange:()=>o(e.accountId,j),disabled:s||j===`cooldown`,"aria-label":j===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer`}),m&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors`,onClick:()=>m(e.accountId,e.accountLabel??e.accountId.slice(0,8)),"aria-label":`Remove account`,children:(0,T.jsx)(u,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`Remove account`})]})]})]}),A?(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(D,{label:`5-Hour Session`,bucket:k.session}),(0,T.jsx)(D,{label:`Weekly`,bucket:k.weekly}),(0,T.jsx)(D,{label:`Weekly (Opus)`,bucket:k.weeklyOpus}),(0,T.jsx)(D,{label:`Weekly (Sonnet)`,bucket:k.weeklySonnet})]}):(0,T.jsx)(`p`,{className:`text-xs text-text-subtle`,children:e.isOAuth?`No usage data yet`:`Usage tracking not available for API keys`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-text-subtle flex-wrap`,children:[k.lastFetchedAt&&(0,T.jsxs)(O,{className:`inline-flex items-center gap-1`,hint:`Usage last read from Anthropic on ${new Date(k.lastFetchedAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}. The bars above are only as current as this.`,children:[(0,T.jsx)(f,{className:`size-3 shrink-0`,"aria-hidden":!0}),w(new Date(k.lastFetchedAt).getTime())]}),L&&!I&&(0,T.jsxs)(O,{className:[`inline-flex items-center gap-1`,R?`text-warning`:``].filter(Boolean).join(` `),hint:`Sign-in stops working on ${B}. Anthropic ends every sign-in on a fixed schedule from the day it was made, whether or not the account gets used — refreshing does not extend it. After that the account fails until you sign in again.`,children:[(0,T.jsx)(a,{className:`size-3 shrink-0`,"aria-hidden":!0}),`sign-in `,S(L)]}),z&&(0,T.jsxs)(O,{className:F.color,hint:F.tip,children:[`© `,F.label]})]})]})}var F=e(t(),1);function I(e){let t=e.usage;return[t.session?.utilization,t.weekly?.utilization,t.weeklyOpus?.utilization,t.weeklySonnet?.utilization].join(`|`)}function L(e=!0){let[t,n]=(0,F.useState)([]),[r,i]=(0,F.useState)([]),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(!0),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(new Set),[p,v]=(0,F.useState)(null),y=(0,F.useRef)([]),b=(0,F.useRef)(void 0),x=(0,F.useCallback)(async()=>{let e=y.current.length>0;e?u(!0):c(!0);let[t,r,a]=await Promise.allSettled([g(),m(),h()]);if(t.status===`fulfilled`){let r=t.value;if(e){let e=new Map(y.current.map(e=>[e.accountId,I(e)])),t=new Set(r.filter(t=>e.get(t.accountId)!==I(t)).map(e=>e.accountId));t.size>0&&(f(t),clearTimeout(b.current),b.current=setTimeout(()=>f(new Set),1500))}y.current=r,n(r)}r.status===`fulfilled`&&i(r.value),a.status===`fulfilled`&&o(a.value?.id??null),c(!1),u(!1)},[]),S=(0,F.useCallback)(async(e,t)=>{v(e);let n=null;try{await _(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){n=e.message}return v(null),await x(),n},[x]);return(0,F.useEffect)(()=>(e&&x(),()=>clearTimeout(b.current)),[e,x]),{usages:t,accounts:r,activeAccountId:a,initialLoading:s,refreshing:l,flashIds:d,reload:x,toggle:S,togglingId:p}}export{k as a,E as c,M as i,w as l,P as n,A as o,j as r,D as s,L as t,b as u};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import{t as r}from"./download-D70Q4Ba6.js";import{t as i}from"./eye-dfZn7evX.js";import{t as a}from"./key-round-oIll4vo-.js";import{t as o}from"./x-Bdaog6Az.js";import{t as s}from"./button-zgoXa9r7.js";import{Dn as c,G as l,Ln as u,On as d,Xn as f,kn as p}from"./index-DVNJ2W5R.js";import{getAccounts as m,getActiveAccount as h,getAllAccountUsages as g,patchAccount as _}from"./api-settings-BQIwZoLm.js";function v(e){return e>=90?`text-error`:e>=70?`text-warning`:`text-success`}function y(e){return e>=90?`bg-error`:e>=70?`bg-warning`:`bg-success`}function b(e){if(!e)return null;let t=null;if(e.resetsInMinutes!=null)t=e.resetsInMinutes;else if(e.resetsInHours!=null)t=Math.round(e.resetsInHours*60);else if(e.resetsAt){let n=new Date(e.resetsAt).getTime()-Date.now();t=n>0?Math.ceil(n/6e4):0}if(t==null)return null;if(t<=0)return`now`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60;return n>0?i>0?`${n}d ${r}h ${i}m`:r>0?`${n}d ${r}h`:`${n}d`:r>0?i>0?`${r}h ${i}m`:`${r}h`:`${i}m`}function x(e){if(!e)return null;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null}function S(e){let t=e-Date.now();if(t<=0)return`expired`;let n=Math.ceil(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}d ${r%24}h`:r>0?`${r}h ${n%60}m`:`${n}m`}function C(e){if(!e)return{label:`unknown`,tip:`No account info available`,color:`text-text-subtle`};if(!e.expiresAt)return{label:`key`,tip:`API key (no expiry)`,color:`text-text-subtle`};if(e.reauthRequired)return{label:`sign in again`,tip:`Anthropic rejected this account's refresh token. Sign in again to restore it.`,color:`text-error`};let t=e.expiresAt*1e3<Date.now();return t&&e.hasRefreshToken?{label:`expired`,tip:`Token expired but has refresh token — will auto-renew`,color:`text-warning`}:t?{label:`expired`,tip:`Token expired, no refresh token`,color:`text-error`}:e.hasRefreshToken?{label:`long-lived`,tip:`OAuth token with refresh — long-lived`,color:`text-success`}:{label:`temp`,tip:`Temporary token without refresh — will expire`,color:`text-warning`}}function w(e){if(!e)return null;let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60),i=n%60;return r<24?i>0?`${r}h ${i}m ago`:`${r}h ago`:`${Math.floor(r/24)}d ago`}var T=n();function E({label:e,pct:t,reset:n,resetsAt:r}){let i=x(r);return(0,T.jsxs)(`div`,{className:`space-y-1`,"data-testid":`account-usage-bar`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`span`,{className:`text-xs font-medium text-text-primary`,children:e}),n&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsxs)(`span`,{className:`text-[10px] text-text-subtle cursor-default`,children:[`↻ `,n]})}),(0,T.jsx)(d,{side:`top`,children:i?`Resets ${i}`:`Resets in`})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-border overflow-hidden`,children:t!=null&&(0,T.jsx)(`div`,{className:`h-full rounded-full transition-all ${y(t)}`,style:{width:`${Math.min(t,100)}%`}})}),(0,T.jsx)(`span`,{className:`text-xs font-medium tabular-nums w-10 text-right ${t==null?`text-text-subtle`:v(t)}`,children:t==null?`—`:`${t}%`})]})]})}function D({label:e,bucket:t}){return t?(0,T.jsx)(E,{label:e,pct:Math.round(t.utilization*100),reset:b(t),resetsAt:t.resetsAt}):null}function O({hint:e,className:t,children:n}){return(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{type:`button`,className:[`cursor-help text-left`,t].filter(Boolean).join(` `),children:n})}),(0,T.jsx)(d,{side:`top`,className:`max-w-[260px] text-xs leading-relaxed`,children:e})]})}function k({description:e,onRefresh:t,refreshing:n,disabled:r,actions:i}){return(0,T.jsxs)(`section`,{className:`space-y-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,T.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-8 shrink-0 cursor-pointer`,onClick:t,disabled:r||n,title:`Refresh`,"aria-label":`Refresh accounts`,children:(0,T.jsx)(f,{className:`size-4 ${n?`animate-spin`:``}`})})]}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i})]})}function A({message:e,onDismiss:t}){return e?(0,T.jsxs)(`div`,{className:`flex items-start gap-2 text-xs p-2 rounded bg-muted`,role:`status`,children:[(0,T.jsx)(`span`,{className:`flex-1`,children:e}),(0,T.jsx)(`button`,{onClick:t,className:`shrink-0 text-muted-foreground hover:text-foreground cursor-pointer`,"aria-label":`Dismiss message`,children:(0,T.jsx)(o,{className:`size-3.5`})})]}):null}function j({children:e}){return(0,T.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1 -mx-1 px-1 snap-x snap-mandatory scrollbar-thin`,children:e})}function M({active:e,flash:t,dense:n,children:r,...i}){return(0,T.jsx)(`div`,{...i,className:[`rounded-md border transition-colors duration-500`,n?`p-2.5 space-y-1.5`:`p-3 space-y-2`,t?`bg-primary/10 border-primary/40`:``,e?`border-primary/30 bg-primary/5`:`border-border/50`,i.className??``].filter(Boolean).join(` `),children:r})}var N={readOnly:`min-w-[220px]`,withActions:`min-w-[300px]`};function P({entry:e,isActive:t,accountInfo:n,onToggle:o,toggling:s,onDelete:m,onExport:h,onViewProfile:g,flash:_,onSelect:v,unselectableReason:y,selecting:b,planLabel:x,layout:E=`list`}){let{usage:k}=e,A=k.session||k.weekly||k.weeklyOpus||k.weeklySonnet,j=n?.status??e.accountStatus,P=!!(n&&!n.hasRefreshToken&&n.expiresAt&&n.expiresAt<Math.floor(Date.now()/1e3)),F=C(n),I=!!n?.reauthRequired,L=n?.grantExpiresAt?n.grantExpiresAt*1e3:null,R=!!L&&L-Date.now()<5*864e5,z=!!n&&(F.label===`temp`||F.label===`unknown`||F.label===`expired`&&!P&&!I),B=L?new Date(L).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null,V=!!(o||m||h||g),H=P?`Token expired — sign in again`:I?`Sign in again to use this account`:y??null,U=E===`list`?``:E===`grid`?`flex flex-col justify-evenly overflow-hidden min-h-0`:`shrink-0 snap-start ${V?N.withActions:N.readOnly}`;return(0,T.jsxs)(M,{active:t,flash:_,dense:E!==`list`,className:[U,P||I?`opacity-50`:``].filter(Boolean).join(` `)||void 0,"data-testid":`account-card`,"data-account-id":e.accountId,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.accountLabel??e.accountId.slice(0,8)}),t&&(0,T.jsx)(O,{className:`text-[10px] text-primary shrink-0 font-medium`,hint:`The next turn will run on this account.`,children:`Active`}),v&&!t&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{type:`button`,onClick:()=>v(e.accountId),disabled:b,className:[`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium transition-colors cursor-pointer disabled:cursor-wait`,H?`text-text-subtle hover:text-error hover:bg-error/10`:`text-text-secondary hover:text-foreground hover:bg-surface-elevated`].join(` `),children:b?`Switching…`:`Use`})}),(0,T.jsx)(d,{side:`top`,children:H??`Use this account for this chat`})]}),P&&(0,T.jsx)(O,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`This token has expired and carries no refresh token, so nothing can renew it. Add the account again.`,children:`Expired`}),I&&!P&&(0,T.jsx)(O,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`Anthropic rejected this account's refresh token, so no turn can run on it. Signing in again is the only thing that restores it.`,children:`Sign in again`}),!e.isOAuth&&!P&&(0,T.jsx)(O,{className:`text-[10px] text-text-subtle shrink-0`,hint:`A static API key rather than a sign-in: nothing to expire and nothing to renew.`,children:`API key`}),x&&(0,T.jsx)(O,{className:`text-[10px] uppercase tracking-wide text-text-subtle shrink-0`,hint:`The subscription this account is on. It decides which quota windows the account has — some plans have a weekly limit and no shorter one.`,children:x}),(0,T.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[!P&&g&&n?.profileData&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-foreground hover:bg-surface-elevated transition-colors`,onClick:()=>g(n.profileData,e.accountId),"aria-label":`View profile`,children:(0,T.jsx)(i,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`View profile`})]}),!P&&h&&e.isOAuth&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-primary hover:bg-surface-elevated transition-colors`,onClick:()=>h(e.accountId),"aria-label":`Export this account`,children:(0,T.jsx)(r,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`Export this account`})]}),!P&&o&&(0,T.jsx)(l,{checked:j!==`disabled`,onCheckedChange:()=>o(e.accountId,j),disabled:s||j===`cooldown`,"aria-label":j===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer`}),m&&(0,T.jsxs)(c,{children:[(0,T.jsx)(p,{asChild:!0,children:(0,T.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors`,onClick:()=>m(e.accountId,e.accountLabel??e.accountId.slice(0,8)),"aria-label":`Remove account`,children:(0,T.jsx)(u,{className:`size-4`})})}),(0,T.jsx)(d,{side:`top`,children:`Remove account`})]})]})]}),A?(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(D,{label:`5-Hour Session`,bucket:k.session}),(0,T.jsx)(D,{label:`Weekly`,bucket:k.weekly}),(0,T.jsx)(D,{label:`Weekly (Opus)`,bucket:k.weeklyOpus}),(0,T.jsx)(D,{label:`Weekly (Sonnet)`,bucket:k.weeklySonnet})]}):(0,T.jsx)(`p`,{className:`text-xs text-text-subtle`,children:e.isOAuth?`No usage data yet`:`Usage tracking not available for API keys`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-text-subtle flex-wrap`,children:[k.lastFetchedAt&&(0,T.jsxs)(O,{className:`inline-flex items-center gap-1`,hint:`Usage last read from Anthropic on ${new Date(k.lastFetchedAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}. The bars above are only as current as this.`,children:[(0,T.jsx)(f,{className:`size-3 shrink-0`,"aria-hidden":!0}),w(new Date(k.lastFetchedAt).getTime())]}),L&&!I&&(0,T.jsxs)(O,{className:[`inline-flex items-center gap-1`,R?`text-warning`:``].filter(Boolean).join(` `),hint:`Sign-in stops working on ${B}. Anthropic ends every sign-in on a fixed schedule from the day it was made, whether or not the account gets used — refreshing does not extend it. After that the account fails until you sign in again.`,children:[(0,T.jsx)(a,{className:`size-3 shrink-0`,"aria-hidden":!0}),`sign-in `,S(L)]}),z&&(0,T.jsxs)(O,{className:F.color,hint:F.tip,children:[`© `,F.label]})]})]})}var F=e(t(),1);function I(e){let t=e.usage;return[t.session?.utilization,t.weekly?.utilization,t.weeklyOpus?.utilization,t.weeklySonnet?.utilization].join(`|`)}function L(e=!0){let[t,n]=(0,F.useState)([]),[r,i]=(0,F.useState)([]),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(!0),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(new Set),[p,v]=(0,F.useState)(null),y=(0,F.useRef)([]),b=(0,F.useRef)(void 0),x=(0,F.useCallback)(async()=>{let e=y.current.length>0;e?u(!0):c(!0);let[t,r,a]=await Promise.allSettled([g(),m(),h()]);if(t.status===`fulfilled`){let r=t.value;if(e){let e=new Map(y.current.map(e=>[e.accountId,I(e)])),t=new Set(r.filter(t=>e.get(t.accountId)!==I(t)).map(e=>e.accountId));t.size>0&&(f(t),clearTimeout(b.current),b.current=setTimeout(()=>f(new Set),1500))}y.current=r,n(r)}r.status===`fulfilled`&&i(r.value),a.status===`fulfilled`&&o(a.value?.id??null),c(!1),u(!1)},[]),S=(0,F.useCallback)(async(e,t)=>{v(e);let n=null;try{await _(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){n=e.message}return v(null),await x(),n},[x]);return(0,F.useEffect)(()=>(e&&x(),()=>clearTimeout(b.current)),[e,x]),{usages:t,accounts:r,activeAccountId:a,initialLoading:s,refreshing:l,flashIds:d,reload:x,toggle:S,togglingId:p}}export{k as a,E as c,M as i,w as l,P as n,A as o,j as r,D as s,L as t,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t}from"./vendor-markdown-CuWCHIVb.js";import{i as n,r}from"./api-client-DwXlVfXP.js";var i=e(t(),1);function a(e,t,a,o=0){let[s,c]=(0,i.useState)(null),[l,u]=(0,i.useState)(null),[d,f]=(0,i.useState)(!1),[p,m]=(0,i.useState)(null),h=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let i=!1;f(!1),m(null);let o=/^(\/|[A-Za-z]:[/\\])/.test(e)?`/api/fs/raw?path=${encodeURIComponent(e)}`:`${n(t)}/files/raw?path=${encodeURIComponent(e)}`,s=r();return fetch(o,{headers:s?{Authorization:`Bearer ${s}`}:{}}).then(e=>{if(!e.ok)throw Error(String(e.status));return e.blob()}).then(e=>{if(i)return;let t=a?new Blob([e],{type:a}):e,n=URL.createObjectURL(t);h.current&&URL.revokeObjectURL(h.current),h.current=n,c(n),u(t)}).catch(e=>{i||(f(!0),m(/^\d+$/.test(e.message)?e.message:`network`))}),()=>{i=!0}},[e,t,a,o]),(0,i.useEffect)(()=>()=>{h.current&&URL.revokeObjectURL(h.current)},[]),{blobUrl:s,blob:l,error:d,errorCode:p}}export{a as t};
|