vibelet 1.2.240 → 1.2.241

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.
Files changed (123) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/inventory-scan-worker.cjs +1 -1
  3. package/dist/remoteDirect/manifest.json +65 -0
  4. package/dist/runtime-version.cjs +1 -1
  5. package/dist/web/assets/App-DXhmlTQu.js +2 -0
  6. package/dist/web/assets/{App-B0w50ugd.css → App-DoFtS2ld.css} +1 -1
  7. package/dist/web/assets/{BrowserControlPanel-0BJ0UEIg.js → BrowserControlPanel-HSOIppjA.js} +1 -1
  8. package/dist/web/assets/ChatPane-BaAKWPnJ.js +2 -0
  9. package/dist/web/assets/{ChipGroup-B4vUfB2t.js → ChipGroup-CXqq2wlt.js} +1 -1
  10. package/dist/web/assets/{ComposerMenus-DzcPREkw.js → ComposerMenus-rXTcwRKu.js} +1 -1
  11. package/dist/web/assets/{DiffDrawer-BznOAVqb.js → DiffDrawer-CXfOImnm.js} +1 -1
  12. package/dist/web/assets/{FilesControlPanel-Czt8c-TF.js → FilesControlPanel-Dlvt1Gp1.js} +1 -1
  13. package/dist/web/assets/{GlobalPendingDialog-DexSMOb1.js → GlobalPendingDialog-B4mfzOBi.js} +1 -1
  14. package/dist/web/assets/{ImageViewer-BQZAWRHv.js → ImageViewer-C36pXFoT.js} +1 -1
  15. package/dist/web/assets/{LanguageSettingsPanel-CcKwfMci.js → LanguageSettingsPanel-Bb44m-LR.js} +1 -1
  16. package/dist/web/assets/{MarkdownModePanel-Djl7nwaJ.js → MarkdownModePanel-CNaSfmI8.js} +1 -1
  17. package/dist/web/assets/{MessageImage-BNOsxgJR.js → MessageImage-CAhJXwr7.js} +1 -1
  18. package/dist/web/assets/{NewSessionDialog-EXTRdgtg.js → NewSessionDialog-BIVNe-MJ.js} +1 -1
  19. package/dist/web/assets/{NotificationSettingsPanel-Clp5I7Xt.js → NotificationSettingsPanel-FbuRkW04.js} +1 -1
  20. package/dist/web/assets/{PanelFind-DtJNet9b.js → PanelFind-DnzTO9GZ.js} +1 -1
  21. package/dist/web/assets/{RemoteLifeOSBlock-B5kU_35n.js → RemoteLifeOSBlock-Bhm7Sf00.js} +2 -2
  22. package/dist/web/assets/{RemoteWorkspaceSettings-DiV8YdWM.js → RemoteWorkspaceSettings-DX0IhsyZ.js} +1 -1
  23. package/dist/web/assets/{SessionTerminalPanel-CfChktgw.js → SessionTerminalPanel-CBbwf8LG.js} +2 -2
  24. package/dist/web/assets/{SpeechInputSettingsPanel-BT-RXrZI.js → SpeechInputSettingsPanel-Cx71yVTZ.js} +1 -1
  25. package/dist/web/assets/{ThemeSettingsPanel-BMeMeln2.js → ThemeSettingsPanel-CxEeL1Yb.js} +1 -1
  26. package/dist/web/assets/{__vite-browser-external-2447137e-DZMxqW1v.js → __vite-browser-external-2447137e-DrC7dgv5.js} +1 -1
  27. package/dist/web/assets/{abnfDiagram-VRR7QNED-DK2hMaza.js → abnfDiagram-VRR7QNED-ChWHpAet.js} +1 -1
  28. package/dist/web/assets/{arc-CzrEQYq_.js → arc-Dfxnvl-t.js} +1 -1
  29. package/dist/web/assets/{architectureDiagram-ZJ3FMSHR-DZxghfRl.js → architectureDiagram-ZJ3FMSHR-kBLnPqES.js} +1 -1
  30. package/dist/web/assets/{arrow-left-CaVb4nSl.js → arrow-left-BUz_m4Oq.js} +1 -1
  31. package/dist/web/assets/{arrow-right-BzeEEQgJ.js → arrow-right-BY4NPg2p.js} +1 -1
  32. package/dist/web/assets/{blockDiagram-677ZJIJ3-BkA7tw-T.js → blockDiagram-677ZJIJ3-BNtwjuTh.js} +1 -1
  33. package/dist/web/assets/{c4Diagram-LMCZKHZV-B7XTpVaD.js → c4Diagram-LMCZKHZV-8D-Mwesb.js} +1 -1
  34. package/dist/web/assets/channel-DZo4wTF7.js +1 -0
  35. package/dist/web/assets/chevron-up-DQfpYsuw.js +1 -0
  36. package/dist/web/assets/{chunk-2Q5K7J3B-Bss5s9E2.js → chunk-2Q5K7J3B-B5fYkjtP.js} +1 -1
  37. package/dist/web/assets/{chunk-32BRIVSS-CA1C0nXS.js → chunk-32BRIVSS-tN_bs2O_.js} +1 -1
  38. package/dist/web/assets/{chunk-5VM5RSS4-BH6U7p_f.js → chunk-5VM5RSS4-BVcBoYrd.js} +1 -1
  39. package/dist/web/assets/{chunk-EX3LRPZG-CcqWCMjI.js → chunk-EX3LRPZG-CuXY6NcI.js} +1 -1
  40. package/dist/web/assets/{chunk-JWPE2WC7-B-4yNTb8.js → chunk-JWPE2WC7-C9fui0AP.js} +1 -1
  41. package/dist/web/assets/{chunk-MOJQB5TN-Bwvx3fwJ.js → chunk-MOJQB5TN-BsNzYnoh.js} +1 -1
  42. package/dist/web/assets/{chunk-RYQCIY6F-Bb4gbrTX.js → chunk-RYQCIY6F-KV-COyMH.js} +1 -1
  43. package/dist/web/assets/{chunk-V7JOEXUC-DKK57hpe.js → chunk-V7JOEXUC-BtdUd2AL.js} +1 -1
  44. package/dist/web/assets/{chunk-VR4S4FIN--Lw_tXW6.js → chunk-VR4S4FIN-CvibGV30.js} +1 -1
  45. package/dist/web/assets/{chunk-XXDRQBXY-BmnjnFO6.js → chunk-XXDRQBXY-BQgo6g4Q.js} +1 -1
  46. package/dist/web/assets/classDiagram-OUVF2IWQ-kVNkVXMH.js +1 -0
  47. package/dist/web/assets/classDiagram-v2-EOCWNBFH-kVNkVXMH.js +1 -0
  48. package/dist/web/assets/{collectMessageImages-C3-JxSH9.js → collectMessageImages-DfQK7APc.js} +1 -1
  49. package/dist/web/assets/{cose-bilkent-JH36ORCC-BxPt-mvK.js → cose-bilkent-JH36ORCC-DqJjP-1o.js} +1 -1
  50. package/dist/web/assets/{cynefin-VYW2F7L2-XMhkQxq7.js → cynefin-VYW2F7L2-CYle_Oh3.js} +1 -1
  51. package/dist/web/assets/{cynefinDiagram-TSTJHNR4-Dxsg5z0o.js → cynefinDiagram-TSTJHNR4-Cs6U5rP8.js} +1 -1
  52. package/dist/web/assets/{dagre-VKFMJZFB-BTkUFd1o.js → dagre-VKFMJZFB-B0PDjiVu.js} +1 -1
  53. package/dist/web/assets/{diagram-FQU43EPY-C1CbNvfX.js → diagram-FQU43EPY-D1G0yF91.js} +1 -1
  54. package/dist/web/assets/{diagram-G47NLZAW-BlP_2bxX.js → diagram-G47NLZAW-jMb0G0ac.js} +1 -1
  55. package/dist/web/assets/{diagram-NH7WQ7WH-QGwfazGi.js → diagram-NH7WQ7WH-Dsybvax5.js} +1 -1
  56. package/dist/web/assets/{diagram-OA4YK3LP-DMuz6rJC.js → diagram-OA4YK3LP-C-mEVY1q.js} +1 -1
  57. package/dist/web/assets/{diagram-WEI45ONY-B2xDOQNA.js → diagram-WEI45ONY-AWFjaNNW.js} +1 -1
  58. package/dist/web/assets/{ebnfDiagram-CCIWWBDH-CerWiTMA.js → ebnfDiagram-CCIWWBDH-DDcjK3O9.js} +1 -1
  59. package/dist/web/assets/{erDiagram-Q63AITRT-B-ssV3I1.js → erDiagram-Q63AITRT-EbcQ9tS4.js} +1 -1
  60. package/dist/web/assets/{file-editor-FileCodeEditor-DHRDHCQw.js → file-editor-FileCodeEditor-b6IgEhB0.js} +1 -1
  61. package/dist/web/assets/{file-editor-ObsidianCodeEditor-DTwaAF2M.js → file-editor-ObsidianCodeEditor-B8GDcuAu.js} +1 -1
  62. package/dist/web/assets/{file-editor-ObsidianFileEditor-HVqh_MR8.js → file-editor-ObsidianFileEditor-xduoJU9L.js} +1 -1
  63. package/dist/web/assets/{flowDiagram-23GEKE2U-CK4bbOLH.js → flowDiagram-23GEKE2U-Duhlfe1V.js} +1 -1
  64. package/dist/web/assets/{folder-plus-ROMRV3aa.js → folder-plus-CPlBpAjK.js} +1 -1
  65. package/dist/web/assets/{ganttDiagram-NO4QXBWP-BeljgJy_.js → ganttDiagram-NO4QXBWP-rxIBQVNR.js} +1 -1
  66. package/dist/web/assets/{gitGraphDiagram-IHSO6WYX-Cxm3yG2c.js → gitGraphDiagram-IHSO6WYX-CfgOr47E.js} +1 -1
  67. package/dist/web/assets/highlighted-body-TPN3WLV5-Cnt0-aIs.js +1 -0
  68. package/dist/web/assets/{imageViewerCopy-DZnSk47F.js → imageViewerCopy-DbcGAYOb.js} +1 -1
  69. package/dist/web/assets/{index-D0cZ64pO.js → index-C0OnaOQ9.js} +1 -1
  70. package/dist/web/assets/{index-D0cm1aa-.js → index-CUEPjMAK.js} +1 -1
  71. package/dist/web/assets/index-Cg-hTlne.js +2 -0
  72. package/dist/web/assets/{index-ucaYl4gM.js → index-DIhhLINU.js} +1 -1
  73. package/dist/web/assets/infoDiagram-FWYZ7A6U-ClEYLmSr.js +1 -0
  74. package/dist/web/assets/{ishikawaDiagram-FXEZZL3T-no1azdW5.js → ishikawaDiagram-FXEZZL3T-CrwkydfS.js} +1 -1
  75. package/dist/web/assets/{journeyDiagram-5HDEW3XC-D69pbBkz.js → journeyDiagram-5HDEW3XC-9mpjCVzY.js} +1 -1
  76. package/dist/web/assets/{kanban-definition-HUTT4EX6-DF9jBMQX.js → kanban-definition-HUTT4EX6-BHH-hi9E.js} +1 -1
  77. package/dist/web/assets/{key-round-Cz5tcv0j.js → key-round-BTcpevK5.js} +1 -1
  78. package/dist/web/assets/{linear-BvELtO_n.js → linear-BFyDT02f.js} +1 -1
  79. package/dist/web/assets/{mermaid-O7DHMXV3-DQT4ZA59.js → mermaid-O7DHMXV3-Btm49B1f.js} +2 -2
  80. package/dist/web/assets/{mermaid.core-Cqy39_Ub.js → mermaid.core-DsV-uGyB.js} +2 -2
  81. package/dist/web/assets/{mic-CfwPV1bx.js → mic--tu-R1CO.js} +1 -1
  82. package/dist/web/assets/{mindmap-definition-LN4V7U3C-rUKSYXvP.js → mindmap-definition-LN4V7U3C-BKiIDYsx.js} +1 -1
  83. package/dist/web/assets/{pegDiagram-2B236MQR-C_nLcufF.js → pegDiagram-2B236MQR-sKr_MbJ8.js} +1 -1
  84. package/dist/web/assets/{pieDiagram-ENE6RG2P-lKOgx3ur.js → pieDiagram-ENE6RG2P-BDfwhOm3.js} +1 -1
  85. package/dist/web/assets/{quadrantDiagram-ABIIQ3AL-CmD-Y89j.js → quadrantDiagram-ABIIQ3AL-DP98F4Tc.js} +1 -1
  86. package/dist/web/assets/{railroadDiagram-RFXS5EU6-BtUqJU9X.js → railroadDiagram-RFXS5EU6-CEIxXnOV.js} +1 -1
  87. package/dist/web/assets/{requirementDiagram-TGXJPOKE-BTuqBSlC.js → requirementDiagram-TGXJPOKE-BFQiFukq.js} +1 -1
  88. package/dist/web/assets/{sankeyDiagram-HTMAVEWB-BIe_zpdG.js → sankeyDiagram-HTMAVEWB-CK7qSKcH.js} +1 -1
  89. package/dist/web/assets/{sequenceDiagram-DBY2YBRQ-D4KPMbym.js → sequenceDiagram-DBY2YBRQ-DAsJtbEE.js} +1 -1
  90. package/dist/web/assets/{shield-check-BIUOkwl_.js → shield-check-DPmOpYg5.js} +1 -1
  91. package/dist/web/assets/{sizeCapture-X5ZJPWSS-CzD-vufl.js → sizeCapture-X5ZJPWSS-BGpUlliu.js} +1 -1
  92. package/dist/web/assets/{stateDiagram-2N3HPSRC-C1i-TljJ.js → stateDiagram-2N3HPSRC-C54QLFU7.js} +1 -1
  93. package/dist/web/assets/stateDiagram-v2-6OUMAXLB-C1gZlI03.js +1 -0
  94. package/dist/web/assets/{swimlanes-5IMT3BWC-CNe1pOBr.js → swimlanes-5IMT3BWC-BiTjNgIT.js} +2 -2
  95. package/dist/web/assets/swimlanesDiagram-G3AALYLV-DMEyjS0M.js +1 -0
  96. package/dist/web/assets/{timeline-definition-FHXFAJF6-CMs8BbV7.js → timeline-definition-FHXFAJF6-C8-hX5IV.js} +1 -1
  97. package/dist/web/assets/{useComposerCompletion-Brvpj9zV.js → useComposerCompletion-gVIPCpAa.js} +1 -1
  98. package/dist/web/assets/{useMessageImage-CNR1wZjv.js → useMessageImage-IJxrl7nu.js} +1 -1
  99. package/dist/web/assets/{vennDiagram-L72KCM5P-aQDmSxcV.js → vennDiagram-L72KCM5P-Dsqo3cMF.js} +1 -1
  100. package/dist/web/assets/{wardleyDiagram-EHGQE667-B77JdKDN.js → wardleyDiagram-EHGQE667-CeAk-yQG.js} +1 -1
  101. package/dist/web/assets/{xychartDiagram-FW5EYKEG-RXhJfM4g.js → xychartDiagram-FW5EYKEG-y6abbBAM.js} +1 -1
  102. package/dist/web/assets/{zap-CIk2VoXi.js → zap-BBEUMj_u.js} +1 -1
  103. package/dist/web/index.html +1 -1
  104. package/dist/web/obsidian-editor-assets.json +1 -1
  105. package/package.json +10 -3
  106. package/scripts/install-remote-direct.mjs +50 -0
  107. package/dist/remoteDirect/vibelet-remote-direct-darwin-amd64 +0 -0
  108. package/dist/remoteDirect/vibelet-remote-direct-darwin-arm64 +0 -0
  109. package/dist/remoteDirect/vibelet-remote-direct-linux-amd64 +0 -0
  110. package/dist/remoteDirect/vibelet-remote-direct-linux-arm64 +0 -0
  111. package/dist/remoteDirect/vibelet-remote-direct-win32-amd64.exe +0 -0
  112. package/dist/remoteDirect/vibelet-remote-direct-win32-arm64.exe +0 -0
  113. package/dist/web/assets/App-NMmWfGoY.js +0 -2
  114. package/dist/web/assets/ChatPane-DeCnLcyQ.js +0 -2
  115. package/dist/web/assets/channel-KKpxBoQi.js +0 -1
  116. package/dist/web/assets/chevron-up-d3Fwun7t.js +0 -1
  117. package/dist/web/assets/classDiagram-OUVF2IWQ-CHHZpVy2.js +0 -1
  118. package/dist/web/assets/classDiagram-v2-EOCWNBFH-CHHZpVy2.js +0 -1
  119. package/dist/web/assets/highlighted-body-TPN3WLV5-BQu24dd9.js +0 -1
  120. package/dist/web/assets/index-DUrY8OKv.js +0 -2
  121. package/dist/web/assets/infoDiagram-FWYZ7A6U-D1XxPfE7.js +0 -1
  122. package/dist/web/assets/stateDiagram-v2-6OUMAXLB-km2c4PyD.js +0 -1
  123. package/dist/web/assets/swimlanesDiagram-G3AALYLV-Da0hYc5p.js +0 -1
@@ -1 +1 @@
1
- import{j as e,r as s,u as n,f as i,t}from"./index-DUrY8OKv.js";/* empty css */import{d as l,X as a,C as d}from"./App-NMmWfGoY.js";import{S as o}from"./shield-check-BIUOkwl_.js";import{K as r}from"./key-round-Cz5tcv0j.js";function c({activeApproval:s,activeQuestion:n,busy:i,questionAnswers:t,t:c,onCancelQuestion:u,onQuestionChoice:p,onRespondApproval:h,onRespondQuestion:j}){const x=Boolean(s||n);return e.jsxs(e.Fragment,{children:[x?null:e.jsxs("section",{className:"control-section",children:[e.jsx("h2",{children:c.pendingActions}),e.jsx("p",{className:"empty-copy",children:c.noPendingActions})]}),s?e.jsxs("section",{className:"attention-panel",children:[e.jsxs("div",{className:"attention-head",children:[e.jsx(o,{"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("h2",{children:c.approvalRequired}),e.jsx("p",{children:s.toolName})]})]}),e.jsx("p",{children:s.description}),"string"==typeof s.input?.command&&e.jsx("pre",{children:s.input.command}),e.jsxs("details",{className:"interaction-details",children:[e.jsx("summary",{children:c.interactionDetails}),e.jsx("pre",{children:l(s.input)})]},s.requestId),e.jsxs("div",{className:"attention-actions approval-actions",children:[e.jsxs("button",{type:"button",className:"danger-button",onClick:()=>h(!1),disabled:i,children:[e.jsx(a,{"aria-hidden":"true"}),c.deny]}),e.jsxs("button",{type:"button",className:"approve-button",onClick:()=>h(!0),disabled:i,children:[e.jsx(d,{"aria-hidden":"true"}),c.approve]})]})]}):null,n?e.jsxs("section",{className:"attention-panel",children:[e.jsxs("div",{className:"attention-head",children:[e.jsx(r,{"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("h2",{children:c.inputNeeded}),e.jsx("p",{children:c.notificationQuestionCount(n.questions.length)})]})]}),n.questions.map(s=>e.jsxs("div",{className:"question-block",children:[e.jsx("strong",{children:s.question}),e.jsx("div",{className:"choice-list",children:s.options.map(n=>{const i=(t[s.id]??[]).includes(n.label);return e.jsxs("button",{className:i?"selected":"","aria-pressed":i,onClick:()=>p(s.id,n.label,s.multiSelect),type:"button",children:[e.jsx("span",{children:n.label}),n.description?e.jsx("small",{children:n.description}):null]},n.label)})})]},s.id)),e.jsxs("div",{className:"attention-actions",children:[e.jsxs("button",{type:"button",className:"danger-button",onClick:u,disabled:i,children:[e.jsx(a,{"aria-hidden":"true"}),c.cancel]}),e.jsxs("button",{type:"button",className:"approve-button",onClick:j,disabled:i||n.questions.some(e=>!t[e.id]?.length),children:[e.jsx(d,{"aria-hidden":"true"}),c.submit]})]})]}):null]})}function u(l){const{activeApproval:d,activeQuestion:o,pendingCount:r,requestKey:u,sessions:p,t:h,errorText:j}=l,[x,m]=s.useState(null),[b,g]=s.useState(!1),v=b||r>0&&x!==u,N=()=>{m(u),g(!1)};s.useEffect(()=>{r>0&&g(!1);const e=()=>{m(null),g(0===r)};return window.addEventListener("vibelet.pending.open",e),()=>window.removeEventListener("vibelet.pending.open",e)},[r]);const y=n(N,void 0,v),q=s=>{const n=p.find(e=>e.sessionId===s);return e.jsxs("dl",{className:"global-pending-session-context",children:[e.jsxs("div",{children:[e.jsx("dt",{children:h.session}),e.jsx("dd",{className:"global-pending-session",children:n?t(n):s})]}),e.jsxs("div",{children:[e.jsx("dt",{children:h.workingDirectory}),e.jsx("dd",{className:"global-pending-directory",children:n?.cwd||h.unknown})]})]})};return v?i.createPortal(e.jsxs("div",{className:"global-pending-layer",children:[e.jsx("div",{className:"global-pending-backdrop","aria-hidden":"true",onClick:N}),e.jsxs("div",{className:"global-pending-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"global-pending-title",tabIndex:-1,ref:y,children:[e.jsxs("header",{className:"global-pending-header",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"global-pending-title",children:h.pendingActions}),e.jsx("p",{"aria-live":"polite",children:h.pendingActionCount(r)})]}),e.jsxs("div",{className:"global-pending-header-actions",children:[e.jsx("button",{className:"global-pending-clear",type:"button",disabled:0===r,onClick:l.onClearRequests,children:h.clearPendingRequests}),e.jsx("button",{className:"icon-button",type:"button","aria-label":h.close,title:h.close,onClick:N,children:e.jsx(a,{"aria-hidden":"true"})})]})]}),e.jsxs("div",{className:"global-pending-content",children:[0===r&&e.jsx("p",{className:"empty-copy",children:h.noPendingActions}),d&&e.jsxs("section",{"data-pending-session":d.sessionId,children:[e.jsxs("div",{className:"global-pending-session-row",children:[q(d.sessionId),e.jsx("button",{type:"button","aria-label":h.dismissPendingRequest,title:h.dismissPendingRequest,onClick:()=>l.onDismissRequest("approval",d.sessionId,d.requestId),children:e.jsx(a,{"aria-hidden":"true"})})]}),e.jsx(c,{...l,activeQuestion:null})]}),o&&e.jsxs("section",{"data-pending-session":o.sessionId,children:[e.jsxs("div",{className:"global-pending-session-row",children:[q(o.sessionId),e.jsx("button",{type:"button","aria-label":h.dismissPendingRequest,title:h.dismissPendingRequest,onClick:()=>l.onDismissRequest("question",o.sessionId,o.requestId),children:e.jsx(a,{"aria-hidden":"true"})})]}),e.jsx(c,{...l,activeApproval:null})]}),j&&e.jsx("p",{role:"alert",className:"global-pending-error",children:j})]})]})]}),document.body):null}export{u as default};
1
+ import{j as e,r as s,u as n,f as i,t}from"./index-Cg-hTlne.js";/* empty css */import{d as l,X as a,C as d}from"./App-DXhmlTQu.js";import{S as o}from"./shield-check-DPmOpYg5.js";import{K as r}from"./key-round-BTcpevK5.js";function c({activeApproval:s,activeQuestion:n,busy:i,questionAnswers:t,t:c,onCancelQuestion:u,onQuestionChoice:p,onRespondApproval:h,onRespondQuestion:j}){const x=Boolean(s||n);return e.jsxs(e.Fragment,{children:[x?null:e.jsxs("section",{className:"control-section",children:[e.jsx("h2",{children:c.pendingActions}),e.jsx("p",{className:"empty-copy",children:c.noPendingActions})]}),s?e.jsxs("section",{className:"attention-panel",children:[e.jsxs("div",{className:"attention-head",children:[e.jsx(o,{"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("h2",{children:c.approvalRequired}),e.jsx("p",{children:s.toolName})]})]}),e.jsx("p",{children:s.description}),"string"==typeof s.input?.command&&e.jsx("pre",{children:s.input.command}),e.jsxs("details",{className:"interaction-details",children:[e.jsx("summary",{children:c.interactionDetails}),e.jsx("pre",{children:l(s.input)})]},s.requestId),e.jsxs("div",{className:"attention-actions approval-actions",children:[e.jsxs("button",{type:"button",className:"danger-button",onClick:()=>h(!1),disabled:i,children:[e.jsx(a,{"aria-hidden":"true"}),c.deny]}),e.jsxs("button",{type:"button",className:"approve-button",onClick:()=>h(!0),disabled:i,children:[e.jsx(d,{"aria-hidden":"true"}),c.approve]})]})]}):null,n?e.jsxs("section",{className:"attention-panel",children:[e.jsxs("div",{className:"attention-head",children:[e.jsx(r,{"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("h2",{children:c.inputNeeded}),e.jsx("p",{children:c.notificationQuestionCount(n.questions.length)})]})]}),n.questions.map(s=>e.jsxs("div",{className:"question-block",children:[e.jsx("strong",{children:s.question}),e.jsx("div",{className:"choice-list",children:s.options.map(n=>{const i=(t[s.id]??[]).includes(n.label);return e.jsxs("button",{className:i?"selected":"","aria-pressed":i,onClick:()=>p(s.id,n.label,s.multiSelect),type:"button",children:[e.jsx("span",{children:n.label}),n.description?e.jsx("small",{children:n.description}):null]},n.label)})})]},s.id)),e.jsxs("div",{className:"attention-actions",children:[e.jsxs("button",{type:"button",className:"danger-button",onClick:u,disabled:i,children:[e.jsx(a,{"aria-hidden":"true"}),c.cancel]}),e.jsxs("button",{type:"button",className:"approve-button",onClick:j,disabled:i||n.questions.some(e=>!t[e.id]?.length),children:[e.jsx(d,{"aria-hidden":"true"}),c.submit]})]})]}):null]})}function u(l){const{activeApproval:d,activeQuestion:o,pendingCount:r,requestKey:u,sessions:p,t:h,errorText:j}=l,[x,m]=s.useState(null),[b,g]=s.useState(!1),v=b||r>0&&x!==u,N=()=>{m(u),g(!1)};s.useEffect(()=>{r>0&&g(!1);const e=()=>{m(null),g(0===r)};return window.addEventListener("vibelet.pending.open",e),()=>window.removeEventListener("vibelet.pending.open",e)},[r]);const y=n(N,void 0,v),q=s=>{const n=p.find(e=>e.sessionId===s);return e.jsxs("dl",{className:"global-pending-session-context",children:[e.jsxs("div",{children:[e.jsx("dt",{children:h.session}),e.jsx("dd",{className:"global-pending-session",children:n?t(n):s})]}),e.jsxs("div",{children:[e.jsx("dt",{children:h.workingDirectory}),e.jsx("dd",{className:"global-pending-directory",children:n?.cwd||h.unknown})]})]})};return v?i.createPortal(e.jsxs("div",{className:"global-pending-layer",children:[e.jsx("div",{className:"global-pending-backdrop","aria-hidden":"true",onClick:N}),e.jsxs("div",{className:"global-pending-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"global-pending-title",tabIndex:-1,ref:y,children:[e.jsxs("header",{className:"global-pending-header",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"global-pending-title",children:h.pendingActions}),e.jsx("p",{"aria-live":"polite",children:h.pendingActionCount(r)})]}),e.jsxs("div",{className:"global-pending-header-actions",children:[e.jsx("button",{className:"global-pending-clear",type:"button",disabled:0===r,onClick:l.onClearRequests,children:h.clearPendingRequests}),e.jsx("button",{className:"icon-button",type:"button","aria-label":h.close,title:h.close,onClick:N,children:e.jsx(a,{"aria-hidden":"true"})})]})]}),e.jsxs("div",{className:"global-pending-content",children:[0===r&&e.jsx("p",{className:"empty-copy",children:h.noPendingActions}),d&&e.jsxs("section",{"data-pending-session":d.sessionId,children:[e.jsxs("div",{className:"global-pending-session-row",children:[q(d.sessionId),e.jsx("button",{type:"button","aria-label":h.dismissPendingRequest,title:h.dismissPendingRequest,onClick:()=>l.onDismissRequest("approval",d.sessionId,d.requestId),children:e.jsx(a,{"aria-hidden":"true"})})]}),e.jsx(c,{...l,activeQuestion:null})]}),o&&e.jsxs("section",{"data-pending-session":o.sessionId,children:[e.jsxs("div",{className:"global-pending-session-row",children:[q(o.sessionId),e.jsx("button",{type:"button","aria-label":h.dismissPendingRequest,title:h.dismissPendingRequest,onClick:()=>l.onDismissRequest("question",o.sessionId,o.requestId),children:e.jsx(a,{"aria-hidden":"true"})})]}),e.jsx(c,{...l,activeApproval:null})]}),j&&e.jsx("p",{role:"alert",className:"global-pending-error",children:j})]})]})]}),document.body):null}export{u as default};
@@ -1 +1 @@
1
- import{c as e,r as a,b as s,d as r,u as t,f as i,j as o}from"./index-DUrY8OKv.js";import{i as l,w as n}from"./imageViewerCopy-DZnSk47F.js";import{f as c,Z as d,L as m,a as p,X as g}from"./App-NMmWfGoY.js";import{u,b as f,I as h}from"./useMessageImage-CNR1wZjv.js";import{A as j}from"./arrow-right-BzeEEQgJ.js";import{A as x}from"./arrow-left-CaVb4nSl.js";const w=e("file-image",[["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:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);function v({request:e,onClose:v}){const[y,b]=a.useState(e.index),[k,N]=a.useState("idle"),A=e.images[y],{url:M,error:C,fail:E}=u(A.src,A.cwd,null),I=f(A.src),L=A.alt||c(I??A.src),z=s(r().language),B=l(z),D=t(v);a.useEffect(()=>{const e=document.getElementById("vibelet-workspace"),a=e?.inert;return e&&(e.inert=!0),()=>{e&&(e.inert=Boolean(a))}},[]),a.useEffect(()=>N("idle"),[y]);const P=a=>b(s=>Math.max(0,Math.min(e.images.length-1,s+a))),R=(e,a,s,r=!1)=>o.jsx("button",{type:"button",className:"icon-button",title:e,"aria-label":e,onClick:s,disabled:r,children:a});return i.createPortal(o.jsx("div",{className:"image-viewer-backdrop",onClick:e=>{e.target===e.currentTarget&&v()},children:o.jsxs("div",{ref:D,className:"image-viewer",role:"dialog","aria-modal":"true","aria-label":B.title,tabIndex:-1,onKeyDown:e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),e.stopPropagation(),P("ArrowLeft"===e.key?-1:1))},children:[o.jsxs("header",{className:"image-viewer-toolbar",children:[o.jsx("span",{className:"image-viewer-caption",title:L,children:L}),o.jsxs("span",{className:"image-viewer-count","aria-live":"polite",children:[y+1," / ",e.images.length]}),R(B.copy,o.jsx(p,{}),()=>{(async()=>{if(M)try{await n(M),N("copied")}catch{N("failed")}})()},!M||C),R(B.open,o.jsx(w,{}),()=>{v(),e.onOpen(I??A.src,A.cwd)}),R(B.close,o.jsx(g,{}),v)]}),o.jsxs("div",{className:"image-viewer-stage",children:[R(B.previous,o.jsx(x,{}),()=>P(-1),0===y),o.jsx("div",{className:"image-viewer-content",children:C?o.jsxs("p",{role:"status",children:[o.jsx(h,{}),B.unavailable]}):M?o.jsx(d,{src:M,alt:L,onError:E,keyboardRoot:D},`${y}:${A.src}`):o.jsx(m,{className:"session-running-icon","aria-label":B.title})}),R(B.next,o.jsx(j,{}),()=>P(1),y===e.images.length-1)]}),o.jsx("div",{className:"image-viewer-status",role:"status",children:"copied"===k?B.copied:"failed"===k?B.failed:""})]})}),document.body)}export{v as default};
1
+ import{c as e,r as a,b as s,d as r,u as t,f as i,j as o}from"./index-Cg-hTlne.js";import{i as l,w as n}from"./imageViewerCopy-DbcGAYOb.js";import{f as c,Z as d,L as m,a as p,X as g}from"./App-DXhmlTQu.js";import{u,b as f,I as h}from"./useMessageImage-IJxrl7nu.js";import{A as j}from"./arrow-right-BY4NPg2p.js";import{A as x}from"./arrow-left-BUz_m4Oq.js";const w=e("file-image",[["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:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);function v({request:e,onClose:v}){const[y,b]=a.useState(e.index),[k,N]=a.useState("idle"),A=e.images[y],{url:M,error:C,fail:E}=u(A.src,A.cwd,null),I=f(A.src),L=A.alt||c(I??A.src),z=s(r().language),B=l(z),D=t(v);a.useEffect(()=>{const e=document.getElementById("vibelet-workspace"),a=e?.inert;return e&&(e.inert=!0),()=>{e&&(e.inert=Boolean(a))}},[]),a.useEffect(()=>N("idle"),[y]);const P=a=>b(s=>Math.max(0,Math.min(e.images.length-1,s+a))),R=(e,a,s,r=!1)=>o.jsx("button",{type:"button",className:"icon-button",title:e,"aria-label":e,onClick:s,disabled:r,children:a});return i.createPortal(o.jsx("div",{className:"image-viewer-backdrop",onClick:e=>{e.target===e.currentTarget&&v()},children:o.jsxs("div",{ref:D,className:"image-viewer",role:"dialog","aria-modal":"true","aria-label":B.title,tabIndex:-1,onKeyDown:e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),e.stopPropagation(),P("ArrowLeft"===e.key?-1:1))},children:[o.jsxs("header",{className:"image-viewer-toolbar",children:[o.jsx("span",{className:"image-viewer-caption",title:L,children:L}),o.jsxs("span",{className:"image-viewer-count","aria-live":"polite",children:[y+1," / ",e.images.length]}),R(B.copy,o.jsx(p,{}),()=>{(async()=>{if(M)try{await n(M),N("copied")}catch{N("failed")}})()},!M||C),R(B.open,o.jsx(w,{}),()=>{v(),e.onOpen(I??A.src,A.cwd)}),R(B.close,o.jsx(g,{}),v)]}),o.jsxs("div",{className:"image-viewer-stage",children:[R(B.previous,o.jsx(x,{}),()=>P(-1),0===y),o.jsx("div",{className:"image-viewer-content",children:C?o.jsxs("p",{role:"status",children:[o.jsx(h,{}),B.unavailable]}):M?o.jsx(d,{src:M,alt:L,onError:E,keyboardRoot:D},`${y}:${A.src}`):o.jsx(m,{className:"session-running-icon","aria-label":B.title})}),R(B.next,o.jsx(j,{}),()=>P(1),y===e.images.length-1)]}),o.jsx("div",{className:"image-viewer-status",role:"status",children:"copied"===k?B.copied:"failed"===k?B.failed:""})]})}),document.body)}export{v as default};
@@ -1 +1 @@
1
- import{j as e}from"./index-DUrY8OKv.js";import{C as a}from"./ChipGroup-B4vUfB2t.js";import{F as l}from"./App-NMmWfGoY.js";function s({language:s,t:n,onLanguageChange:i,showFeedback:o=!0}){return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"control-section compact-section",children:[e.jsx("h2",{children:n.language}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:n.displayLanguage}),e.jsx(a,{ariaLabel:n.displayLanguage,options:[{value:"system",label:n.followSystem},{value:"en",label:n.english},{value:"zh",label:n.chinese},{value:"zh-TW",label:n.traditionalChinese}],value:s,onChange:e=>i(e)})]})]}),o&&e.jsx(l,{language:s})]})}export{s as LanguageSettingsPanel};
1
+ import{j as e}from"./index-Cg-hTlne.js";import{C as a}from"./ChipGroup-CXqq2wlt.js";import{F as l}from"./App-DXhmlTQu.js";function s({language:s,t:n,onLanguageChange:i,showFeedback:o=!0}){return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"control-section compact-section",children:[e.jsx("h2",{children:n.language}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:n.displayLanguage}),e.jsx(a,{ariaLabel:n.displayLanguage,options:[{value:"system",label:n.followSystem},{value:"en",label:n.english},{value:"zh",label:n.chinese},{value:"zh-TW",label:n.traditionalChinese}],value:s,onChange:e=>i(e)})]})]}),o&&e.jsx(l,{language:s})]})}export{s as LanguageSettingsPanel};
@@ -1 +1 @@
1
- import{r as e,j as r}from"./index-DUrY8OKv.js";function s({text:s,labels:a={read:"浏览",live:"编辑",edit:"可视化编辑",source:"源码"},readOnly:d,modes:i=["read","live","edit","source"],initialMode:l="read",renderVisual:t,renderCode:o}){const[c,n]=e.useState(l),[u,m]=e.useState("source"===l||"live"===l),x="source"===c||"live"===c;return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"segmented editor-mode-tabs",role:"group","aria-label":"Markdown 模式",children:i.filter(e=>!d||"read"===e||"source"===e).map(e=>r.jsx("button",{type:"button","aria-pressed":c===e,className:c===e?"selected":"",onClick:()=>{n(e),"source"!==e&&"live"!==e||m(!0)},children:a[e]},e))}),r.jsx("div",{className:"file-editor-surface",hidden:x,children:r.jsx(e.Suspense,{fallback:r.jsx("pre",{className:"remote-editor",children:s}),children:t("read"===c||Boolean(d))})}),u&&r.jsx("div",{className:"file-editor-surface",hidden:!x,children:r.jsx(e.Suspense,{fallback:r.jsx("pre",{className:"remote-editor",children:s}),children:o("live"===c)})})]})}export{s as MarkdownModePanel};
1
+ import{r as e,j as r}from"./index-Cg-hTlne.js";function s({text:s,labels:a={read:"浏览",live:"编辑",edit:"可视化编辑",source:"源码"},readOnly:d,modes:i=["read","live","edit","source"],initialMode:l="read",renderVisual:t,renderCode:o}){const[c,n]=e.useState(l),[u,m]=e.useState("source"===l||"live"===l),x="source"===c||"live"===c;return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"segmented editor-mode-tabs",role:"group","aria-label":"Markdown 模式",children:i.filter(e=>!d||"read"===e||"source"===e).map(e=>r.jsx("button",{type:"button","aria-pressed":c===e,className:c===e?"selected":"",onClick:()=>{n(e),"source"!==e&&"live"!==e||m(!0)},children:a[e]},e))}),r.jsx("div",{className:"file-editor-surface",hidden:x,children:r.jsx(e.Suspense,{fallback:r.jsx("pre",{className:"remote-editor",children:s}),children:t("read"===c||Boolean(d))})}),u&&r.jsx("div",{className:"file-editor-surface",hidden:!x,children:r.jsx(e.Suspense,{fallback:r.jsx("pre",{className:"remote-editor",children:s}),children:o("live"===c)})})]})}export{s as MarkdownModePanel};
@@ -1 +1 @@
1
- import{k as a,b as s,d as e,j as r}from"./index-DUrY8OKv.js";import{f as i,L as n,o as l}from"./App-NMmWfGoY.js";import{b as t,u as o,I as c}from"./useMessageImage-CNR1wZjv.js";function d({src:d,alt:m,cwd:p,onOpen:g,gallery:u}){const x=t(d),{url:j,error:f,fail:h}=o(d,p),w=a[s(e().language)],b=m||i(x??d);return r.jsx("button",{className:"message-image-preview","data-image-src":d,"data-image-cwd":p,type:"button",title:x??d,"aria-label":`${w.preview}: ${b}`,onClick:async a=>{a.preventDefault(),a.stopPropagation();const s=await(u?.())??[{src:d,alt:b,cwd:p}],e=s.findIndex(a=>a.src===d||x&&t(a.src)===x);l({images:e<0?[{src:d,alt:b,cwd:p}]:s,index:Math.max(0,e),onOpen:g})},children:f?r.jsxs("span",{className:"message-image-placeholder",children:[r.jsx(c,{"aria-hidden":"true"}),b," · ",w.fileOpenFailed]}):j?r.jsx("img",{src:j,alt:b,loading:"lazy",onError:h}):r.jsxs("span",{className:"message-image-placeholder",children:[r.jsx(n,{className:"session-running-icon","aria-hidden":"true"}),b]})})}export{d as M};
1
+ import{k as a,b as s,d as e,j as r}from"./index-Cg-hTlne.js";import{f as i,L as n,o as l}from"./App-DXhmlTQu.js";import{b as t,u as o,I as c}from"./useMessageImage-IJxrl7nu.js";function d({src:d,alt:m,cwd:p,onOpen:g,gallery:u}){const x=t(d),{url:j,error:f,fail:h}=o(d,p),w=a[s(e().language)],b=m||i(x??d);return r.jsx("button",{className:"message-image-preview","data-image-src":d,"data-image-cwd":p,type:"button",title:x??d,"aria-label":`${w.preview}: ${b}`,onClick:async a=>{a.preventDefault(),a.stopPropagation();const s=await(u?.())??[{src:d,alt:b,cwd:p}],e=s.findIndex(a=>a.src===d||x&&t(a.src)===x);l({images:e<0?[{src:d,alt:b,cwd:p}]:s,index:Math.max(0,e),onOpen:g})},children:f?r.jsxs("span",{className:"message-image-placeholder",children:[r.jsx(c,{"aria-hidden":"true"}),b," · ",w.fileOpenFailed]}):j?r.jsx("img",{src:j,alt:b,loading:"lazy",onError:h}):r.jsxs("span",{className:"message-image-placeholder",children:[r.jsx(n,{className:"session-running-icon","aria-hidden":"true"}),b]})})}export{d as M};
@@ -1 +1 @@
1
- import{c as e,r as t,i as s,h as n,j as a,u as o,f as r}from"./index-DUrY8OKv.js";import{s as i,u as l,C as c,a as d,b as u,c as p,d as f,e as m,f as h,g as w,G as g,h as v,S as y,i as b}from"./useComposerCompletion-Brvpj9zV.js";import{x,y as j,z as k,X as S}from"./App-NMmWfGoY.js";import{C}from"./ComposerMenus-DzcPREkw.js";import{S as M}from"./shield-check-BIUOkwl_.js";import{C as D,Z as N}from"./zap-CIk2VoXi.js";import{F as E}from"./folder-plus-ROMRV3aa.js";import{A as I}from"./__vite-browser-external-2447137e-DZMxqW1v.js";import"./useMessageImage-CNR1wZjv.js";import"./MessageImage-BNOsxgJR.js";import"./chevron-up-d3Fwun7t.js";const T=e("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),K=e("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),A=e("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),L="vibelet.web.recentCreations";function R(e){try{const t=JSON.parse(s().getItem(L)||"{}")[e];return Array.isArray(t)?t.filter(e=>"string"==typeof e.cwd&&["claude","codex"].includes(e.agent)&&Number.isFinite(e.createdAt)).slice(0,8):[]}catch{return[]}}const F="vibelet.web.initialMessageHistory";function O(){try{const e=JSON.parse(s().getItem(F)||"[]");return Array.isArray(e)?[...new Set(e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean))].slice(0,20):[]}catch{return[]}}const B="vibelet.web.newSessionCreateShortcut";function q({cwd:e,connected:s,load:n,t:o}){const[r,i]=t.useState();t.useEffect(()=>{if(!e||!s)return;let t=!1,a=!1;const o=()=>{a||"hidden"===document.visibilityState||(a=!0,n(e).then(s=>{t||i({cwd:e,data:s})}).catch(s=>{t||i({cwd:e,error:s instanceof Error?s.message:String(s)})}).finally(()=>{a=!1}))},r=window.setTimeout(o,250),l=window.setInterval(o,5e3);return window.addEventListener("focus",o),()=>{t=!0,window.clearTimeout(r),window.clearInterval(l),window.removeEventListener("focus",o)}},[e,s,n]);const l=s&&r?.cwd===e?r.data:void 0,c=l?.branches[e],d=l?.diffStats[e];return a.jsx("div",{className:"new-session-git",role:"status",title:r?.cwd===e?r.error:void 0,children:c||d?a.jsxs(a.Fragment,{children:[a.jsx(K,{size:14,"aria-hidden":"true"}),a.jsx("span",{className:"new-session-git-branch",title:c||"HEAD",children:c||"HEAD"}),d&&(d.additions>0||d.deletions>0)&&a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"diff-add",children:["+",d.additions]}),a.jsxs("span",{className:"diff-del",children:["−",d.deletions]})]})]}):s&&e&&r?.cwd!==e?o.loading:" "})}function z({recent:e,chinese:t,onSelectRecent:s}){return a.jsxs("div",{className:"new-session-history",children:[" ",a.jsx(C,{icon:x,label:t?"最近创建":"Recent creations",menuLabel:t?"最近创建":"Recent creations",align:"right",value:"",options:e.length?e.map((e,t)=>({value:String(t),label:e.cwd,description:"claude"===e.agent?"Claude":"Codex"})):[{value:"",label:t?"暂无创建记录":"No recent creations",disabled:!0}],onSelect:t=>{const n=e[Number(t)];n&&s(n)}})]})}function P({chinese:e,onSelectMessage:s}){const[n]=t.useState(O);return a.jsxs("div",{className:"new-session-history",children:[" ",a.jsx(C,{icon:A,label:e?"消息历史":"Message history",menuLabel:e?"消息历史":"Message history",align:"right",value:"",options:n.length?n.map((e,t)=>({value:String(t),label:e})):[{value:"",label:e?"暂无消息历史":"No message history",disabled:!0}],onSelect:e=>{const t=n[Number(e)];t&&s(t)}})]})}function J({client:e,cwd:s="",agent:n="codex",controls:o,submit:r,draft:i,textareaRef:f,onOpen:m,onChange:h,onKeyDown:w,connected:g,chinese:v,files:y,t:b}){const x=t.useRef(null),j=t.useRef(null),[k,S]=t.useState([]),[C,M]=t.useState(""),[D,N]=t.useState(0);t.useEffect(()=>{let t=!1;if(S([]),M(""),!e||!g)return;const n=setTimeout(()=>{e.request({action:"skills.list",id:e.makeId("skills"),cwd:s.trim()||void 0}).then(e=>{t||S(e.skills??[])}).catch(e=>{t||M(b.resourceLoadFailed(b.skills,e instanceof Error?e.message:String(e)))})},200);return()=>{t=!0,clearTimeout(n)}},[e,g,s,D,b]);const E=l({draft:i,onChange:h,textareaRef:f??j,agent:n,skills:k,onRefreshSkills:()=>N(e=>e+1),t:b});return a.jsxs("div",{className:"new-session-message","aria-busy":y.uploadBusy,onDragOver:e=>{e.dataTransfer.types.includes("Files")&&e.preventDefault()},onDrop:e=>{e.dataTransfer.files.length&&(e.preventDefault(),g&&y.upload(e.dataTransfer.files))},children:[a.jsxs("div",{className:"new-session-field-heading",children:[a.jsx("label",{htmlFor:"new-session-initial-message",children:v?"初始消息(可选)":"Initial message (optional)"}),a.jsx(P,{chinese:v,onSelectMessage:h})]}),a.jsxs("div",{className:"new-session-message-box",children:[E.popovers,a.jsx(c,{id:"new-session-initial-message",textareaRef:f??j,value:i,onValueChange:h,...E.textareaProps,onKeyDown:e=>{E.handleKeyDown(e)||w(e)},rows:3,onPaste:e=>{g&&e.clipboardData.files.length&&(e.preventDefault(),y.upload(e.clipboardData.files))}}),a.jsx("input",{ref:x,type:"file",hidden:!0,multiple:!0,onChange:e=>{y.upload(e.currentTarget.files),e.currentTarget.value=""}}),a.jsx(d,{onOpen:m,attachments:y.attachments,uploadBusy:y.uploadBusy,onRemove:y.remove,t:b}),a.jsx(u,{leading:a.jsx(p,{t:b,toolsDisabled:!g||y.uploadBusy,onUpload:()=>x.current?.click(),onSkills:E.handleOpenSkills,onCommands:E.handleOpenCommands}),controls:o,submit:r})]}),y.uploadBusy&&a.jsx("small",{role:"status",children:b.uploading}),C&&a.jsx("p",{role:"alert",children:C}),y.error&&a.jsx("p",{role:"alert",children:y.error})]})}function H(e){const{t}=e,s="desktop"===n().kind,o=f(t),r=m(t),i=h(e.models,t),l=i.find(t=>t.value===e.model)?.label??(e.model||t.defaultOption);return a.jsxs("div",{className:"new-session-options composer-control-strip "+(s?"new-session-desktop-options":""),children:[a.jsx("div",{className:"composer-permission "+("autoApprove"===e.approvalMode?"full-access":""),children:a.jsx(C,{icon:M,label:o.find(t=>t.value===e.approvalMode)?.label??t.approvalMode,menuLabel:t.approvalMode,value:e.approvalMode,onSelect:e.onApprovalModeChange,options:o,wide:!0,blendBackground:!0})}),s?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"composer-toolbar-spacer"}),a.jsx(w,{...e,modelLabel:l,modelOptions:i,effortLabel:r.find(t=>t.value===e.effort)?.label??t.effort,effortOptions:r})]}):a.jsxs(a.Fragment,{children:[a.jsx(C,{icon:D,label:l,menuLabel:t.model,value:e.model,onSelect:e.onModelChange,options:i}),a.jsx(C,{icon:N,label:e.fastMode?t.fast:t.normal,menuLabel:t.fastMode,value:e.fastMode?"on":"off",onSelect:t=>e.onFastModeChange("on"===t),selected:e.fastMode,options:[{value:"off",label:t.normal,description:t.standardExecution,icon:g},{value:"on",label:t.fast,description:t.preferFasterResponses,icon:N}]})]})]})}function U(e){const{t:l,device:c,onClose:d,onListDirectories:u}=e,p="New session"!==l.newSession,[f,m]=t.useState(e.cwd),[h,w]=t.useState(e.agent),[g,C]=t.useState(e.approvalMode),[M,D]=t.useState(e.model),[N,K]=t.useState(e.effort),[A,P]=t.useState(e.fastMode),[U,G]=t.useState(""),V=function(e,s){const[n,a]=t.useState([]),[o,r]=t.useState(!1),[i,l]=t.useState(""),c=t.useRef(new Set);return t.useEffect(()=>()=>{for(const e of c.current)e.abort();c.current.clear()},[]),{attachments:n,uploadBusy:o,error:i,upload:async t=>{if(!t?.length||!e)return;const n=new AbortController;c.current.add(n),r(!0),l("");try{for(const o of Array.from(t)){const t=await j(o,e.pairToken,n.signal,s);if(n.signal.aborted)return;a(e=>[...e,t])}}catch(o){n.signal.aborted||l(o instanceof Error?o.message:String(o))}finally{c.current.delete(n)&&r(c.current.size>0)}},remove:e=>a(t=>t.filter(t=>t.path!==e))}}(e.pairing,l),[W,$]=t.useState([]),_=v(e.client,h,f.trim(),void 0,M,W,l),[Z,Q]=t.useState("");t.useEffect(()=>{let t=!1;return $([]),Q(""),e.onListModels(h).then(e=>{t||$(e)}).catch(()=>{t||Q(p?"模型加载失败,请重新选择代理重试。":"Models unavailable. Select the agent again to retry.")}),()=>{t=!0}},[h,e.onListModels,p]);const[X,Y]=t.useState([]),[ee,te]=t.useState(-1),[se,ne]=t.useState(!1),[ae,oe]=t.useState(""),[re,ie]=t.useState(!1),[le,ce]=t.useState(!1),[de,ue]=t.useState(null),pe=function(e){const s=t.useRef(null),n=JSON.stringify([e.cwd.trim(),e.agent,e.approvalMode,e.model.trim(),e.fastMode]);return t.useEffect(()=>{const t=e.client;if(!e.enabled||"codex"!==e.agent||!e.cwd.trim()||!t?.isConnected)return;let a;const o=setTimeout(()=>{a={id:t.makeId("prewarm"),key:n,client:t,taken:!1},s.current=a,t.request({action:"session.prewarm",id:t.makeId("prewarm-request"),preparationId:a.id,cwd:e.cwd.trim(),approvalMode:e.approvalMode,model:e.model.trim()||void 0,fastMode:e.fastMode}).catch(()=>{})},300);return()=>{clearTimeout(o),a&&(s.current===a&&(s.current=null),a.taken||t.request({action:"session.prewarm.cancel",id:t.makeId("prewarm-cancel"),preparationId:a.id}).catch(()=>{}))}},[n,e.client,e.enabled]),()=>{const t=s.current;if(t&&t.key===n&&t.client===e.client)return t.taken=!0,t.id}}({client:e.client,enabled:e.connected&&!se&&!le&&null===de,cwd:f,agent:h,approvalMode:g,model:M,fastMode:A}),fe=t.useRef(null),me=t.useRef(null),he=o(d,me),[we]=t.useState(()=>R(c));t.useEffect(()=>{if(Y([]),te(-1),oe(""),!se||!e.connected)return;let t=!1;const s=/^(?:[a-z]:[\\/]|\\\\)/i.test(f)?f.replaceAll("\\","/"):f,n=s.lastIndexOf("/"),a=n<0?".":s.slice(0,n+1)||"/",o=s.slice(n+1).toLowerCase(),r=window.setTimeout(()=>{ie(!0),u(a).then(e=>{t||Y(e.filter(e=>e.isDirectory&&e.name.toLowerCase().startsWith(o)).map(e=>k(a,e.name)).slice(0,12))}).catch(e=>{t||oe(String(e instanceof Error?e.message:e))}).finally(()=>{t||ie(!1)})},180);return()=>{t=!0,window.clearTimeout(r),ie(!1)}},[f,se,e.connected,u]);const ge=e=>{m(e+(e.endsWith("/")?"":"/")),fe.current?.focus()},ve=async()=>{if(de?.trim()&&!/[/\\]/.test(de)&&![".",".."].includes(de.trim())&&!le&&e.connected){ce(!0),oe("");try{const t=k(f,de.trim());await e.onCreateDirectory(t),m(t),ue(null),me.current?.focus()}catch(t){oe(String(t))}finally{ce(!1)}}},ye=()=>{f.trim()&&e.connected&&!le&&!V.uploadBusy&&(e.onCreate(f.trim(),h,{draft:U,approvalMode:g,model:M,effort:N,fastMode:A,attachments:V.attachments,preparationId:pe()}),function(e){const t=e.trim();if(t)try{s().setItem(F,JSON.stringify([t,...O().filter(e=>e!==t)].slice(0,20)))}catch{}}(U),function(e,t){try{const n=JSON.parse(s().getItem(L)||"{}");n[e]=[t,...R(e).filter(e=>e.cwd!==t.cwd||e.agent!==t.agent)].slice(0,8),s().setItem(L,JSON.stringify(n))}catch{}}(c,{cwd:f.trim(),agent:h,createdAt:Date.now()}),d())},be=function(e){const a="desktop"===n().kind,[o,r]=t.useState(()=>{try{const e=s().getItem(B);return"modEnter"===e||"shiftEnter"===e?e:"enter"}catch{return"enter"}});return{enabled:a,shortcut:o,update:e=>{r(e);try{s().setItem(B,e)}catch{}},onKeyDown:t=>{a&&!t.defaultPrevented&&"Enter"===t.key&&(t.nativeEvent.isComposing||229===t.keyCode?t.preventDefault():i(o,t)?(t.preventDefault(),t.repeat||e()):"INPUT"===t.currentTarget.tagName&&t.preventDefault())}}}(ye);return r.createPortal(a.jsxs("div",{className:"new-session-layer",children:[a.jsx("div",{className:"new-session-backdrop",onClick:d}),a.jsxs("div",{className:"new-session-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"new-session-title",ref:he,tabIndex:-1,children:[a.jsxs("header",{children:[a.jsx("h2",{id:"new-session-title",children:l.newSession}),a.jsx("button",{type:"button",className:"icon-button","aria-label":l.close,title:l.close,onClick:d,children:a.jsx(S,{})})]}),a.jsxs("form",{onSubmit:e=>{e.preventDefault(),ye()},children:[a.jsx("div",{className:"new-session-agents",children:["claude","codex"].map(e=>a.jsxs("button",{type:"button","aria-pressed":h===e,onClick:()=>{w(e),D("")},children:[a.jsx(T,{size:18}),"claude"===e?"Claude":"Codex"]},e))}),a.jsxs("div",{className:"new-session-path-field",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ne(!1)},children:[a.jsxs("div",{className:"new-session-field",children:[a.jsxs("div",{className:"new-session-field-heading",children:[a.jsx("label",{htmlFor:"new-session-cwd",children:l.workingDirectory}),a.jsx(z,{recent:we,chinese:p,onSelectRecent:e=>{m(e.cwd),w(e.agent),D("")}})]}),a.jsxs("div",{className:"new-session-path-row",children:[a.jsx("input",{id:"new-session-cwd",ref:fe,value:f,"aria-label":l.workingDirectory,role:"combobox","aria-autocomplete":"list",spellCheck:!1,"aria-expanded":se&&e.connected,"aria-controls":"new-session-paths","aria-activedescendant":ee>=0?`new-session-path-${ee}`:void 0,onFocus:()=>ne(!0),onChange:e=>m(e.target.value),onKeyDown:e=>{if(e.nativeEvent.isComposing||229===e.keyCode)be.onKeyDown(e);else{if(!("desktop"!==n().kind||"Tab"!==e.key||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey))return e.preventDefault(),ee>=0&&X[ee]&&ge(X[ee]),void me.current?.focus();!X.length||"ArrowDown"!==e.key&&"ArrowUp"!==e.key?("Enter"===e.key||"Tab"===e.key)&&ee>=0&&X[ee]&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),ge(X[ee])):(e.preventDefault(),te(t=>t<0?"ArrowDown"===e.key?0:X.length-1:(t+("ArrowDown"===e.key?1:-1)+X.length)%X.length)),be.onKeyDown(e)}}}),a.jsx("button",{type:"button",className:"icon-button","aria-label":l.browseDirectories,title:l.browseDirectories,onMouseDown:e=>e.preventDefault(),onClick:()=>(ge(f||e.cwd||"/"),void ne(!0)),children:a.jsx(x,{})})]})]}),se&&e.connected&&a.jsxs("div",{className:"new-session-paths",children:[a.jsx("div",{id:"new-session-paths",role:"listbox","aria-label":l.browseDirectories,children:X.map((e,t)=>a.jsxs("button",{type:"button",id:`new-session-path-${t}`,role:"option","aria-selected":ee===t,onMouseDown:e=>e.preventDefault(),onClick:()=>ge(e),title:e,children:[a.jsx(x,{size:14}),e]},e))}),a.jsxs("button",{type:"button",className:"new-session-folder-action",disabled:!f.trim()||le,onMouseDown:e=>e.preventDefault(),onClick:()=>{ne(!1),ue("")},children:[a.jsx(E,{size:14}),p?"新建文件夹":"New folder"]})]}),a.jsx("div",{className:"new-session-path-status",children:re||ae||Z?a.jsx("small",{role:ae||Z?"alert":"status",children:ae||Z||l.loadingDirectories}):a.jsx(q,{cwd:f.trim(),connected:e.connected,load:e.onLoadGitMetadata,t:l})}),null!==de&&a.jsxs("div",{className:"new-session-path-row new-session-folder-form",children:[a.jsx("input",{autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),e.nativeEvent.isComposing||ve()),"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),ue(null),fe.current?.focus())},"aria-label":p?"文件夹名称":"Folder name",value:de,onChange:e=>ue(e.target.value)}),a.jsx("button",{type:"button",disabled:le||!de.trim()||/[/\\]/.test(de),onClick:()=>{ve()},children:p?"创建文件夹":"Create folder"}),a.jsx("button",{type:"button",onClick:()=>ue(null),children:l.close})]})]}),a.jsx(J,{client:e.client,cwd:f,agent:h,controls:a.jsx(H,{t:l,models:_,approvalMode:g,onApprovalModeChange:C,model:M,onModelChange:D,effort:N,onEffortChange:K,fastMode:A,onFastModeChange:P}),submit:a.jsxs("div",{className:"submit-button-group",children:[" ",be.enabled&&a.jsx(y,{shortcut:be.shortcut,onChange:be.update,action:"create",t:l}),a.jsx(b,{type:"submit","aria-label":l.newSession,title:l.newSession,disabled:!e.connected||!f.trim()||le||V.uploadBusy,children:a.jsx(I,{"aria-hidden":"true"})})]}),textareaRef:me,onOpen:t=>e.onOpenRemoteFile(t,f),draft:U,onChange:G,onKeyDown:e=>{if(!("desktop"!==n().kind||"Tab"!==e.key||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey))return e.preventDefault(),void fe.current?.focus();be.onKeyDown(e)},connected:e.connected,chinese:p,files:V,t:l}),!e.connected&&a.jsx("p",{role:"status",children:p?"请先连接设备,再创建会话。":"Connect a device before creating a session."}),a.jsxs("footer",{children:[a.jsx("p",{className:"new-session-create-hint",children:p?"创建后自动发送初始消息":"The initial message is sent after creation"}),"desktop"!==n().kind&&a.jsx("button",{type:"button",onClick:d,children:p?"取消":"Cancel"})]})]})]})]}),document.body)}export{U as default};
1
+ import{c as e,r as t,i as s,h as n,j as a,u as o,f as r}from"./index-Cg-hTlne.js";import{s as i,u as l,C as c,a as d,b as u,c as p,d as f,e as m,f as h,g as w,G as g,h as v,S as y,i as b}from"./useComposerCompletion-gVIPCpAa.js";import{x,y as j,z as k,X as S}from"./App-DXhmlTQu.js";import{C}from"./ComposerMenus-rXTcwRKu.js";import{S as M}from"./shield-check-DPmOpYg5.js";import{C as D,Z as N}from"./zap-BBEUMj_u.js";import{F as E}from"./folder-plus-CPlBpAjK.js";import{A as I}from"./__vite-browser-external-2447137e-DrC7dgv5.js";import"./useMessageImage-IJxrl7nu.js";import"./MessageImage-CAhJXwr7.js";import"./chevron-up-DQfpYsuw.js";const T=e("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),K=e("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),A=e("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),L="vibelet.web.recentCreations";function R(e){try{const t=JSON.parse(s().getItem(L)||"{}")[e];return Array.isArray(t)?t.filter(e=>"string"==typeof e.cwd&&["claude","codex"].includes(e.agent)&&Number.isFinite(e.createdAt)).slice(0,8):[]}catch{return[]}}const F="vibelet.web.initialMessageHistory";function O(){try{const e=JSON.parse(s().getItem(F)||"[]");return Array.isArray(e)?[...new Set(e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean))].slice(0,20):[]}catch{return[]}}const B="vibelet.web.newSessionCreateShortcut";function q({cwd:e,connected:s,load:n,t:o}){const[r,i]=t.useState();t.useEffect(()=>{if(!e||!s)return;let t=!1,a=!1;const o=()=>{a||"hidden"===document.visibilityState||(a=!0,n(e).then(s=>{t||i({cwd:e,data:s})}).catch(s=>{t||i({cwd:e,error:s instanceof Error?s.message:String(s)})}).finally(()=>{a=!1}))},r=window.setTimeout(o,250),l=window.setInterval(o,5e3);return window.addEventListener("focus",o),()=>{t=!0,window.clearTimeout(r),window.clearInterval(l),window.removeEventListener("focus",o)}},[e,s,n]);const l=s&&r?.cwd===e?r.data:void 0,c=l?.branches[e],d=l?.diffStats[e];return a.jsx("div",{className:"new-session-git",role:"status",title:r?.cwd===e?r.error:void 0,children:c||d?a.jsxs(a.Fragment,{children:[a.jsx(K,{size:14,"aria-hidden":"true"}),a.jsx("span",{className:"new-session-git-branch",title:c||"HEAD",children:c||"HEAD"}),d&&(d.additions>0||d.deletions>0)&&a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"diff-add",children:["+",d.additions]}),a.jsxs("span",{className:"diff-del",children:["−",d.deletions]})]})]}):s&&e&&r?.cwd!==e?o.loading:" "})}function z({recent:e,chinese:t,onSelectRecent:s}){return a.jsxs("div",{className:"new-session-history",children:[" ",a.jsx(C,{icon:x,label:t?"最近创建":"Recent creations",menuLabel:t?"最近创建":"Recent creations",align:"right",value:"",options:e.length?e.map((e,t)=>({value:String(t),label:e.cwd,description:"claude"===e.agent?"Claude":"Codex"})):[{value:"",label:t?"暂无创建记录":"No recent creations",disabled:!0}],onSelect:t=>{const n=e[Number(t)];n&&s(n)}})]})}function P({chinese:e,onSelectMessage:s}){const[n]=t.useState(O);return a.jsxs("div",{className:"new-session-history",children:[" ",a.jsx(C,{icon:A,label:e?"消息历史":"Message history",menuLabel:e?"消息历史":"Message history",align:"right",value:"",options:n.length?n.map((e,t)=>({value:String(t),label:e})):[{value:"",label:e?"暂无消息历史":"No message history",disabled:!0}],onSelect:e=>{const t=n[Number(e)];t&&s(t)}})]})}function J({client:e,cwd:s="",agent:n="codex",controls:o,submit:r,draft:i,textareaRef:f,onOpen:m,onChange:h,onKeyDown:w,connected:g,chinese:v,files:y,t:b}){const x=t.useRef(null),j=t.useRef(null),[k,S]=t.useState([]),[C,M]=t.useState(""),[D,N]=t.useState(0);t.useEffect(()=>{let t=!1;if(S([]),M(""),!e||!g)return;const n=setTimeout(()=>{e.request({action:"skills.list",id:e.makeId("skills"),cwd:s.trim()||void 0}).then(e=>{t||S(e.skills??[])}).catch(e=>{t||M(b.resourceLoadFailed(b.skills,e instanceof Error?e.message:String(e)))})},200);return()=>{t=!0,clearTimeout(n)}},[e,g,s,D,b]);const E=l({draft:i,onChange:h,textareaRef:f??j,agent:n,skills:k,onRefreshSkills:()=>N(e=>e+1),t:b});return a.jsxs("div",{className:"new-session-message","aria-busy":y.uploadBusy,onDragOver:e=>{e.dataTransfer.types.includes("Files")&&e.preventDefault()},onDrop:e=>{e.dataTransfer.files.length&&(e.preventDefault(),g&&y.upload(e.dataTransfer.files))},children:[a.jsxs("div",{className:"new-session-field-heading",children:[a.jsx("label",{htmlFor:"new-session-initial-message",children:v?"初始消息(可选)":"Initial message (optional)"}),a.jsx(P,{chinese:v,onSelectMessage:h})]}),a.jsxs("div",{className:"new-session-message-box",children:[E.popovers,a.jsx(c,{id:"new-session-initial-message",textareaRef:f??j,value:i,onValueChange:h,...E.textareaProps,onKeyDown:e=>{E.handleKeyDown(e)||w(e)},rows:3,onPaste:e=>{g&&e.clipboardData.files.length&&(e.preventDefault(),y.upload(e.clipboardData.files))}}),a.jsx("input",{ref:x,type:"file",hidden:!0,multiple:!0,onChange:e=>{y.upload(e.currentTarget.files),e.currentTarget.value=""}}),a.jsx(d,{onOpen:m,attachments:y.attachments,uploadBusy:y.uploadBusy,onRemove:y.remove,t:b}),a.jsx(u,{leading:a.jsx(p,{t:b,toolsDisabled:!g||y.uploadBusy,onUpload:()=>x.current?.click(),onSkills:E.handleOpenSkills,onCommands:E.handleOpenCommands}),controls:o,submit:r})]}),y.uploadBusy&&a.jsx("small",{role:"status",children:b.uploading}),C&&a.jsx("p",{role:"alert",children:C}),y.error&&a.jsx("p",{role:"alert",children:y.error})]})}function H(e){const{t}=e,s="desktop"===n().kind,o=f(t),r=m(t),i=h(e.models,t),l=i.find(t=>t.value===e.model)?.label??(e.model||t.defaultOption);return a.jsxs("div",{className:"new-session-options composer-control-strip "+(s?"new-session-desktop-options":""),children:[a.jsx("div",{className:"composer-permission "+("autoApprove"===e.approvalMode?"full-access":""),children:a.jsx(C,{icon:M,label:o.find(t=>t.value===e.approvalMode)?.label??t.approvalMode,menuLabel:t.approvalMode,value:e.approvalMode,onSelect:e.onApprovalModeChange,options:o,wide:!0,blendBackground:!0})}),s?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"composer-toolbar-spacer"}),a.jsx(w,{...e,modelLabel:l,modelOptions:i,effortLabel:r.find(t=>t.value===e.effort)?.label??t.effort,effortOptions:r})]}):a.jsxs(a.Fragment,{children:[a.jsx(C,{icon:D,label:l,menuLabel:t.model,value:e.model,onSelect:e.onModelChange,options:i}),a.jsx(C,{icon:N,label:e.fastMode?t.fast:t.normal,menuLabel:t.fastMode,value:e.fastMode?"on":"off",onSelect:t=>e.onFastModeChange("on"===t),selected:e.fastMode,options:[{value:"off",label:t.normal,description:t.standardExecution,icon:g},{value:"on",label:t.fast,description:t.preferFasterResponses,icon:N}]})]})]})}function U(e){const{t:l,device:c,onClose:d,onListDirectories:u}=e,p="New session"!==l.newSession,[f,m]=t.useState(e.cwd),[h,w]=t.useState(e.agent),[g,C]=t.useState(e.approvalMode),[M,D]=t.useState(e.model),[N,K]=t.useState(e.effort),[A,P]=t.useState(e.fastMode),[U,G]=t.useState(""),V=function(e,s){const[n,a]=t.useState([]),[o,r]=t.useState(!1),[i,l]=t.useState(""),c=t.useRef(new Set);return t.useEffect(()=>()=>{for(const e of c.current)e.abort();c.current.clear()},[]),{attachments:n,uploadBusy:o,error:i,upload:async t=>{if(!t?.length||!e)return;const n=new AbortController;c.current.add(n),r(!0),l("");try{for(const o of Array.from(t)){const t=await j(o,e.pairToken,n.signal,s);if(n.signal.aborted)return;a(e=>[...e,t])}}catch(o){n.signal.aborted||l(o instanceof Error?o.message:String(o))}finally{c.current.delete(n)&&r(c.current.size>0)}},remove:e=>a(t=>t.filter(t=>t.path!==e))}}(e.pairing,l),[W,$]=t.useState([]),_=v(e.client,h,f.trim(),void 0,M,W,l),[Z,Q]=t.useState("");t.useEffect(()=>{let t=!1;return $([]),Q(""),e.onListModels(h).then(e=>{t||$(e)}).catch(()=>{t||Q(p?"模型加载失败,请重新选择代理重试。":"Models unavailable. Select the agent again to retry.")}),()=>{t=!0}},[h,e.onListModels,p]);const[X,Y]=t.useState([]),[ee,te]=t.useState(-1),[se,ne]=t.useState(!1),[ae,oe]=t.useState(""),[re,ie]=t.useState(!1),[le,ce]=t.useState(!1),[de,ue]=t.useState(null),pe=function(e){const s=t.useRef(null),n=JSON.stringify([e.cwd.trim(),e.agent,e.approvalMode,e.model.trim(),e.fastMode]);return t.useEffect(()=>{const t=e.client;if(!e.enabled||"codex"!==e.agent||!e.cwd.trim()||!t?.isConnected)return;let a;const o=setTimeout(()=>{a={id:t.makeId("prewarm"),key:n,client:t,taken:!1},s.current=a,t.request({action:"session.prewarm",id:t.makeId("prewarm-request"),preparationId:a.id,cwd:e.cwd.trim(),approvalMode:e.approvalMode,model:e.model.trim()||void 0,fastMode:e.fastMode}).catch(()=>{})},300);return()=>{clearTimeout(o),a&&(s.current===a&&(s.current=null),a.taken||t.request({action:"session.prewarm.cancel",id:t.makeId("prewarm-cancel"),preparationId:a.id}).catch(()=>{}))}},[n,e.client,e.enabled]),()=>{const t=s.current;if(t&&t.key===n&&t.client===e.client)return t.taken=!0,t.id}}({client:e.client,enabled:e.connected&&!se&&!le&&null===de,cwd:f,agent:h,approvalMode:g,model:M,fastMode:A}),fe=t.useRef(null),me=t.useRef(null),he=o(d,me),[we]=t.useState(()=>R(c));t.useEffect(()=>{if(Y([]),te(-1),oe(""),!se||!e.connected)return;let t=!1;const s=/^(?:[a-z]:[\\/]|\\\\)/i.test(f)?f.replaceAll("\\","/"):f,n=s.lastIndexOf("/"),a=n<0?".":s.slice(0,n+1)||"/",o=s.slice(n+1).toLowerCase(),r=window.setTimeout(()=>{ie(!0),u(a).then(e=>{t||Y(e.filter(e=>e.isDirectory&&e.name.toLowerCase().startsWith(o)).map(e=>k(a,e.name)).slice(0,12))}).catch(e=>{t||oe(String(e instanceof Error?e.message:e))}).finally(()=>{t||ie(!1)})},180);return()=>{t=!0,window.clearTimeout(r),ie(!1)}},[f,se,e.connected,u]);const ge=e=>{m(e+(e.endsWith("/")?"":"/")),fe.current?.focus()},ve=async()=>{if(de?.trim()&&!/[/\\]/.test(de)&&![".",".."].includes(de.trim())&&!le&&e.connected){ce(!0),oe("");try{const t=k(f,de.trim());await e.onCreateDirectory(t),m(t),ue(null),me.current?.focus()}catch(t){oe(String(t))}finally{ce(!1)}}},ye=()=>{f.trim()&&e.connected&&!le&&!V.uploadBusy&&(e.onCreate(f.trim(),h,{draft:U,approvalMode:g,model:M,effort:N,fastMode:A,attachments:V.attachments,preparationId:pe()}),function(e){const t=e.trim();if(t)try{s().setItem(F,JSON.stringify([t,...O().filter(e=>e!==t)].slice(0,20)))}catch{}}(U),function(e,t){try{const n=JSON.parse(s().getItem(L)||"{}");n[e]=[t,...R(e).filter(e=>e.cwd!==t.cwd||e.agent!==t.agent)].slice(0,8),s().setItem(L,JSON.stringify(n))}catch{}}(c,{cwd:f.trim(),agent:h,createdAt:Date.now()}),d())},be=function(e){const a="desktop"===n().kind,[o,r]=t.useState(()=>{try{const e=s().getItem(B);return"modEnter"===e||"shiftEnter"===e?e:"enter"}catch{return"enter"}});return{enabled:a,shortcut:o,update:e=>{r(e);try{s().setItem(B,e)}catch{}},onKeyDown:t=>{a&&!t.defaultPrevented&&"Enter"===t.key&&(t.nativeEvent.isComposing||229===t.keyCode?t.preventDefault():i(o,t)?(t.preventDefault(),t.repeat||e()):"INPUT"===t.currentTarget.tagName&&t.preventDefault())}}}(ye);return r.createPortal(a.jsxs("div",{className:"new-session-layer",children:[a.jsx("div",{className:"new-session-backdrop",onClick:d}),a.jsxs("div",{className:"new-session-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"new-session-title",ref:he,tabIndex:-1,children:[a.jsxs("header",{children:[a.jsx("h2",{id:"new-session-title",children:l.newSession}),a.jsx("button",{type:"button",className:"icon-button","aria-label":l.close,title:l.close,onClick:d,children:a.jsx(S,{})})]}),a.jsxs("form",{onSubmit:e=>{e.preventDefault(),ye()},children:[a.jsx("div",{className:"new-session-agents",children:["claude","codex"].map(e=>a.jsxs("button",{type:"button","aria-pressed":h===e,onClick:()=>{w(e),D("")},children:[a.jsx(T,{size:18}),"claude"===e?"Claude":"Codex"]},e))}),a.jsxs("div",{className:"new-session-path-field",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ne(!1)},children:[a.jsxs("div",{className:"new-session-field",children:[a.jsxs("div",{className:"new-session-field-heading",children:[a.jsx("label",{htmlFor:"new-session-cwd",children:l.workingDirectory}),a.jsx(z,{recent:we,chinese:p,onSelectRecent:e=>{m(e.cwd),w(e.agent),D("")}})]}),a.jsxs("div",{className:"new-session-path-row",children:[a.jsx("input",{id:"new-session-cwd",ref:fe,value:f,"aria-label":l.workingDirectory,role:"combobox","aria-autocomplete":"list",spellCheck:!1,"aria-expanded":se&&e.connected,"aria-controls":"new-session-paths","aria-activedescendant":ee>=0?`new-session-path-${ee}`:void 0,onFocus:()=>ne(!0),onChange:e=>m(e.target.value),onKeyDown:e=>{if(e.nativeEvent.isComposing||229===e.keyCode)be.onKeyDown(e);else{if(!("desktop"!==n().kind||"Tab"!==e.key||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey))return e.preventDefault(),ee>=0&&X[ee]&&ge(X[ee]),void me.current?.focus();!X.length||"ArrowDown"!==e.key&&"ArrowUp"!==e.key?("Enter"===e.key||"Tab"===e.key)&&ee>=0&&X[ee]&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),ge(X[ee])):(e.preventDefault(),te(t=>t<0?"ArrowDown"===e.key?0:X.length-1:(t+("ArrowDown"===e.key?1:-1)+X.length)%X.length)),be.onKeyDown(e)}}}),a.jsx("button",{type:"button",className:"icon-button","aria-label":l.browseDirectories,title:l.browseDirectories,onMouseDown:e=>e.preventDefault(),onClick:()=>(ge(f||e.cwd||"/"),void ne(!0)),children:a.jsx(x,{})})]})]}),se&&e.connected&&a.jsxs("div",{className:"new-session-paths",children:[a.jsx("div",{id:"new-session-paths",role:"listbox","aria-label":l.browseDirectories,children:X.map((e,t)=>a.jsxs("button",{type:"button",id:`new-session-path-${t}`,role:"option","aria-selected":ee===t,onMouseDown:e=>e.preventDefault(),onClick:()=>ge(e),title:e,children:[a.jsx(x,{size:14}),e]},e))}),a.jsxs("button",{type:"button",className:"new-session-folder-action",disabled:!f.trim()||le,onMouseDown:e=>e.preventDefault(),onClick:()=>{ne(!1),ue("")},children:[a.jsx(E,{size:14}),p?"新建文件夹":"New folder"]})]}),a.jsx("div",{className:"new-session-path-status",children:re||ae||Z?a.jsx("small",{role:ae||Z?"alert":"status",children:ae||Z||l.loadingDirectories}):a.jsx(q,{cwd:f.trim(),connected:e.connected,load:e.onLoadGitMetadata,t:l})}),null!==de&&a.jsxs("div",{className:"new-session-path-row new-session-folder-form",children:[a.jsx("input",{autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),e.nativeEvent.isComposing||ve()),"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),ue(null),fe.current?.focus())},"aria-label":p?"文件夹名称":"Folder name",value:de,onChange:e=>ue(e.target.value)}),a.jsx("button",{type:"button",disabled:le||!de.trim()||/[/\\]/.test(de),onClick:()=>{ve()},children:p?"创建文件夹":"Create folder"}),a.jsx("button",{type:"button",onClick:()=>ue(null),children:l.close})]})]}),a.jsx(J,{client:e.client,cwd:f,agent:h,controls:a.jsx(H,{t:l,models:_,approvalMode:g,onApprovalModeChange:C,model:M,onModelChange:D,effort:N,onEffortChange:K,fastMode:A,onFastModeChange:P}),submit:a.jsxs("div",{className:"submit-button-group",children:[" ",be.enabled&&a.jsx(y,{shortcut:be.shortcut,onChange:be.update,action:"create",t:l}),a.jsx(b,{type:"submit","aria-label":l.newSession,title:l.newSession,disabled:!e.connected||!f.trim()||le||V.uploadBusy,children:a.jsx(I,{"aria-hidden":"true"})})]}),textareaRef:me,onOpen:t=>e.onOpenRemoteFile(t,f),draft:U,onChange:G,onKeyDown:e=>{if(!("desktop"!==n().kind||"Tab"!==e.key||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey))return e.preventDefault(),void fe.current?.focus();be.onKeyDown(e)},connected:e.connected,chinese:p,files:V,t:l}),!e.connected&&a.jsx("p",{role:"status",children:p?"请先连接设备,再创建会话。":"Connect a device before creating a session."}),a.jsxs("footer",{children:[a.jsx("p",{className:"new-session-create-hint",children:p?"创建后自动发送初始消息":"The initial message is sent after creation"}),"desktop"!==n().kind&&a.jsx("button",{type:"button",onClick:d,children:p?"取消":"Cancel"})]})]})]})]}),document.body)}export{U as default};
@@ -1 +1 @@
1
- import{j as e}from"./index-DUrY8OKv.js";import{B as s}from"./App-NMmWfGoY.js";function i({notificationsBlocked:i,permission:n,settings:t,t:c,onToggleEnabled:o}){return e.jsxs("section",{className:"control-section compact-section",children:[e.jsx("h2",{children:c.notifications}),e.jsxs("label",{className:"toggle-field notification-toggle "+(i?"disabled":""),children:[e.jsxs("span",{children:[e.jsx(s,{"aria-hidden":"true"}),c.browserAlerts]}),e.jsx("input",{type:"checkbox",role:"switch","aria-checked":t.enabled&&!i&&"granted"===n,className:"settings-switch",checked:t.enabled&&!i&&"granted"===n,disabled:i,onChange:e=>o(e.target.checked)})]}),i?e.jsx("p",{className:"empty-copy",children:c.notificationsBlocked}):null]})}export{i as NotificationSettingsPanel};
1
+ import{j as e}from"./index-Cg-hTlne.js";import{B as s}from"./App-DXhmlTQu.js";function i({notificationsBlocked:i,permission:n,settings:t,t:c,onToggleEnabled:o}){return e.jsxs("section",{className:"control-section compact-section",children:[e.jsx("h2",{children:c.notifications}),e.jsxs("label",{className:"toggle-field notification-toggle "+(i?"disabled":""),children:[e.jsxs("span",{children:[e.jsx(s,{"aria-hidden":"true"}),c.browserAlerts]}),e.jsx("input",{type:"checkbox",role:"switch","aria-checked":t.enabled&&!i&&"granted"===n,className:"settings-switch",checked:t.enabled&&!i&&"granted"===n,disabled:i,onChange:e=>o(e.target.checked)})]}),i?e.jsx("p",{className:"empty-copy",children:c.notificationsBlocked}):null]})}export{i as NotificationSettingsPanel};
@@ -1 +1 @@
1
- import{r as e,j as t}from"./index-DUrY8OKv.js";import{s as r,A as n,X as a}from"./App-NMmWfGoY.js";import{A as s}from"./__vite-browser-external-2447137e-DZMxqW1v.js";function i({panel:i,search:l,visible:o,t:c}){const[u,f]=e.useState(!1),[d,b]=e.useState(""),[p,v]=e.useState({active:0,total:0}),x=e.useRef(null),h=e.useRef(0),j="浏览器"===c.browser?"查找":"瀏覽器"===c.browser?"尋找":"Find",m="浏览器"===c.browser?"上一个匹配项":"瀏覽器"===c.browser?"上一個匹配項":"Previous match",w="浏览器"===c.browser?"下一个匹配项":"瀏覽器"===c.browser?"下一個匹配項":"Next match",y=(e,t=!0,r=!1)=>{const n=++h.current;if(!e)return l.current?.clear(),void v({active:0,total:0});l.current?.find(e,t,r,e=>{h.current===n&&v(e)})},E=()=>{h.current++,f(!1),l.current?.clear(),l.current?.focus?.()};return e.useEffect(()=>{const e=i.current,t=e=>{if(!o||!l.current)return;const t=e.detail;"searchMessages"===t?(f(!0),y(d),requestAnimationFrame(()=>{x.current?.focus(),x.current?.select()})):u&&y(d,"findPrevious"!==t,!0)};return e?.addEventListener("vibelet.panel.find",t),()=>e?.removeEventListener("vibelet.panel.find",t)},[o,u,d]),e.useEffect(()=>()=>{h.current++,l.current?.clear()},[]),u?t.jsxs("div",{className:"panel-find",role:"search","aria-label":j,children:[t.jsx("input",{ref:x,"aria-label":j,placeholder:j,value:d,onChange:e=>{b(e.target.value),y(e.target.value)},onKeyDown:e=>{e.nativeEvent.isComposing||("Enter"===e.key&&(e.preventDefault(),y(d,!e.shiftKey,!0)),"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),E()))}}),t.jsxs("span",{"aria-live":"polite",children:[p.active," / ",p.total]}),t.jsx("button",{type:"button","aria-label":m,title:r(m,"findPrevious"),disabled:!p.total,onClick:()=>y(d,!1,!0),children:t.jsx(s,{})}),t.jsx("button",{type:"button","aria-label":w,title:r(w,"findNext"),disabled:!p.total,onClick:()=>y(d,!0,!0),children:t.jsx(n,{})}),t.jsx("button",{type:"button","aria-label":c.close,title:c.close,onClick:E,children:t.jsx(a,{})})]}):null}export{i as P};
1
+ import{r as e,j as t}from"./index-Cg-hTlne.js";import{s as r,A as n,X as a}from"./App-DXhmlTQu.js";import{A as s}from"./__vite-browser-external-2447137e-DrC7dgv5.js";function i({panel:i,search:l,visible:o,t:c}){const[u,f]=e.useState(!1),[d,b]=e.useState(""),[p,v]=e.useState({active:0,total:0}),x=e.useRef(null),h=e.useRef(0),j="浏览器"===c.browser?"查找":"瀏覽器"===c.browser?"尋找":"Find",m="浏览器"===c.browser?"上一个匹配项":"瀏覽器"===c.browser?"上一個匹配項":"Previous match",w="浏览器"===c.browser?"下一个匹配项":"瀏覽器"===c.browser?"下一個匹配項":"Next match",y=(e,t=!0,r=!1)=>{const n=++h.current;if(!e)return l.current?.clear(),void v({active:0,total:0});l.current?.find(e,t,r,e=>{h.current===n&&v(e)})},E=()=>{h.current++,f(!1),l.current?.clear(),l.current?.focus?.()};return e.useEffect(()=>{const e=i.current,t=e=>{if(!o||!l.current)return;const t=e.detail;"searchMessages"===t?(f(!0),y(d),requestAnimationFrame(()=>{x.current?.focus(),x.current?.select()})):u&&y(d,"findPrevious"!==t,!0)};return e?.addEventListener("vibelet.panel.find",t),()=>e?.removeEventListener("vibelet.panel.find",t)},[o,u,d]),e.useEffect(()=>()=>{h.current++,l.current?.clear()},[]),u?t.jsxs("div",{className:"panel-find",role:"search","aria-label":j,children:[t.jsx("input",{ref:x,"aria-label":j,placeholder:j,value:d,onChange:e=>{b(e.target.value),y(e.target.value)},onKeyDown:e=>{e.nativeEvent.isComposing||("Enter"===e.key&&(e.preventDefault(),y(d,!e.shiftKey,!0)),"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),E()))}}),t.jsxs("span",{"aria-live":"polite",children:[p.active," / ",p.total]}),t.jsx("button",{type:"button","aria-label":m,title:r(m,"findPrevious"),disabled:!p.total,onClick:()=>y(d,!1,!0),children:t.jsx(s,{})}),t.jsx("button",{type:"button","aria-label":w,title:r(w,"findNext"),disabled:!p.total,onClick:()=>y(d,!0,!0),children:t.jsx(n,{})}),t.jsx("button",{type:"button","aria-label":c.close,title:c.close,onClick:E,children:t.jsx(a,{})})]}):null}export{i as P};