@xopcai/xopc 0.0.408 → 0.0.410

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 (196) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B0em9Xfs.js → agent-avatar-dicebear-ColV_Z1C.js} +1 -1
  4. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-rgRXzBCX.js +1 -0
  5. package/dist/gateway/static/root/assets/agents-C1rSl_yE.js +77 -0
  6. package/dist/gateway/static/root/assets/app-management-settings-panel-B-Cl1lzt.js +1 -0
  7. package/dist/gateway/static/root/assets/appearance-settings-byEnJz9H.js +1 -0
  8. package/dist/gateway/static/root/assets/apps-page-BfVMfjkC.js +1 -0
  9. package/dist/gateway/static/root/assets/{archive-plugin-BjWaZIHe.js → archive-plugin-BXssEuq3.js} +1 -1
  10. package/dist/gateway/static/root/assets/{automations-page-IkrLEkMb.js → automations-page-C-puATkS.js} +1 -1
  11. package/dist/gateway/static/root/assets/automations-workspace-b7MTHd-X.js +6 -0
  12. package/dist/gateway/static/root/assets/{binary-plugins-DKy1DC62.js → binary-plugins-DBz_2AhG.js} +1 -1
  13. package/dist/gateway/static/root/assets/{block-editor-4E-OdmNm.js → block-editor-BOO5kjIl.js} +4 -4
  14. package/dist/gateway/static/root/assets/browser-automation-inputs-D8bZ9iz2.js +1 -0
  15. package/dist/gateway/static/root/assets/browser-automations-page-DMqDOJgO.js +3 -0
  16. package/dist/gateway/static/root/assets/browser-settings-page-KZStwhX7.js +3 -0
  17. package/dist/gateway/static/root/assets/button-aIC072nz.js +1 -0
  18. package/dist/gateway/static/root/assets/capabilities-page-DeJuO2rf.js +2 -0
  19. package/dist/gateway/static/root/assets/capabilities-settings-panel-DPxL_3Km.js +8 -0
  20. package/dist/gateway/static/root/assets/capability-header-actions-yfPUz5Wt.js +1 -0
  21. package/dist/gateway/static/root/assets/channels-Cp4F9zPz.js +1 -0
  22. package/dist/gateway/static/root/assets/{chat-terminal-dock-vb3kBSeI.js → chat-terminal-dock-Dlzn80cK.js} +2 -2
  23. package/dist/gateway/static/root/assets/computer-settings-page-BXhmUWbA.js +1 -0
  24. package/dist/gateway/static/root/assets/connector-service-page-B1oJCj74.js +1 -0
  25. package/dist/gateway/static/root/assets/connectors-page-Da_M7h3m.js +1 -0
  26. package/dist/gateway/static/root/assets/date-picker-DGjpqOKx.js +1 -0
  27. package/dist/gateway/static/root/assets/dependency-picker-BfWUD3LG.js +1 -0
  28. package/dist/gateway/static/root/assets/{desktop-pet-Bb-s29ag.js → desktop-pet-CPEi55Vt.js} +1 -1
  29. package/dist/gateway/static/root/assets/desktop-pet-settings-CmQ_H-nM.js +1 -0
  30. package/dist/gateway/static/root/assets/device-pairing-wizard-BeTjXc3C.js +1 -0
  31. package/dist/gateway/static/root/assets/{directory-picker-path-field-CkGfC105.js → directory-picker-path-field-CwT1LcLR.js} +1 -1
  32. package/dist/gateway/static/root/assets/dist-C3DSFZCi.js +1 -0
  33. package/dist/gateway/static/root/assets/{extension-debug-page-Cm0F3rcI.js → extension-debug-page-DX-hX_d0.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-page-B72a-tnZ.js → extension-page-Cji87mN9.js} +1 -1
  35. package/dist/gateway/static/root/assets/extension-settings-page-BulzpwBD.js +1 -0
  36. package/dist/gateway/static/root/assets/file-archive-DanfQJNe.js +1 -0
  37. package/dist/gateway/static/root/assets/file-braces-BoAMI_k9.js +1 -0
  38. package/dist/gateway/static/root/assets/file-image-CDUPkZvG.js +1 -0
  39. package/dist/gateway/static/root/assets/gateway-settings-CIdEroWr.js +1 -0
  40. package/dist/gateway/static/root/assets/globe-DSSGFWFn.js +1 -0
  41. package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-BWjkqT5j.js → highlighted-body-KQOG7T2V-BgTqMa_d.js} +1 -1
  42. package/dist/gateway/static/root/assets/home-page-BSbYrVda.js +2 -0
  43. package/dist/gateway/static/root/assets/image-generation-api-BfPYnMoc.js +1 -0
  44. package/dist/gateway/static/root/assets/imports-page-DYSOfHfw.js +1 -0
  45. package/dist/gateway/static/root/assets/index-D2hEKnTM.js +267 -0
  46. package/dist/gateway/static/root/assets/index-SmKNPEmJ.css +1 -0
  47. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Cf29ltoI.js → keyboard-shortcuts-settings-BwsGM6Yd.js} +1 -1
  48. package/dist/gateway/static/root/assets/loader-circle-CifKLtgG.js +1 -0
  49. package/dist/gateway/static/root/assets/local-app-workbench-page-K6UR6cAx.js +1 -0
  50. package/dist/gateway/static/root/assets/local-apps-page-gkdwtjDE.js +1 -0
  51. package/dist/gateway/static/root/assets/logs-page-BAQNYk0e.js +2 -0
  52. package/dist/gateway/static/root/assets/management-settings-CMVRLGox.js +1 -0
  53. package/dist/gateway/static/root/assets/{markdown-view-B35a4o1v.js → markdown-view-Ljt0bhfF.js} +6 -6
  54. package/dist/gateway/static/root/assets/{media-plugins-Bl1Xga_v.js → media-plugins-DQJXvbr_.js} +1 -1
  55. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Cx0bXBqu.js +1 -0
  56. package/dist/gateway/static/root/assets/note-detail-panel-1GCqp26U.js +5 -0
  57. package/dist/gateway/static/root/assets/note-image-lightbox-B7RA-WsY.js +1 -0
  58. package/dist/gateway/static/root/assets/notes-page-DnjlEdzM.js +8 -0
  59. package/dist/gateway/static/root/assets/page-context-capture-button-BAwI_3uh.js +1 -0
  60. package/dist/gateway/static/root/assets/personal-page-XoLrcR0U.js +1 -0
  61. package/dist/gateway/static/root/assets/personal-settings-panel-DzubCRqj.js +1 -0
  62. package/dist/gateway/static/root/assets/plugin-details-dialog-BjzIp3T5.js +1 -0
  63. package/dist/gateway/static/root/assets/popover-select-DGKUpVsz.js +1 -0
  64. package/dist/gateway/static/root/assets/{preview-open-alternatives-6XU-2lVI.js → preview-open-alternatives-2YjwlRHu.js} +1 -1
  65. package/dist/gateway/static/root/assets/product-open-page-Bfqez8Je.js +1 -0
  66. package/dist/gateway/static/root/assets/product-preview-content-D7wLwrqj.js +1 -0
  67. package/dist/gateway/static/root/assets/project-detail-page-1ueRCmXg.js +1 -0
  68. package/dist/gateway/static/root/assets/projects-page-CDQycMPo.js +1 -0
  69. package/dist/gateway/static/root/assets/remote-access-hub-YvVmZA4K.js +1 -0
  70. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-DSsANtha.js +1 -0
  71. package/dist/gateway/static/root/assets/schema-form-vbhv4JE6.js +1 -0
  72. package/dist/gateway/static/root/assets/sessions-page-B3rPljgr.js +1 -0
  73. package/dist/gateway/static/root/assets/settings-advanced-gate-Ch20Ptzp.js +1 -0
  74. package/dist/gateway/static/root/assets/{settings-form-section-Cl0eF4hl.js → settings-form-section-4nn0sb6v.js} +1 -1
  75. package/dist/gateway/static/root/assets/{settings-page-1jcGeVtB.js → settings-page-_HB9FC08.js} +1 -1
  76. package/dist/gateway/static/root/assets/settings-shell-dialog-layer-BU3UuiJr.js +1 -0
  77. package/dist/gateway/static/root/assets/setup-status-panel-L1HHrvzi.js +1 -0
  78. package/dist/gateway/static/root/assets/share-preview-page-C4lC0W3d.js +2 -0
  79. package/dist/gateway/static/root/assets/shares-settings-DtHZ9z5K.js +1 -0
  80. package/dist/gateway/static/root/assets/skeleton-BI5TyibZ.js +1 -0
  81. package/dist/gateway/static/root/assets/{skill-api-BxCyuPhf.js → skill-api-CyO89DKl.js} +1 -1
  82. package/dist/gateway/static/root/assets/skill-reload-api-Drg356Pb.js +1 -0
  83. package/dist/gateway/static/root/assets/skills-page-XhCLHKlK.js +2 -0
  84. package/dist/gateway/static/root/assets/style-DTLpCnuA.js +7 -0
  85. package/dist/gateway/static/root/assets/{system-settings-panel-C9ejxax1.js → system-settings-panel-bSogz4S-.js} +1 -1
  86. package/dist/gateway/static/root/assets/task-detail-page-CSv2x4q-.js +2 -0
  87. package/dist/gateway/static/root/assets/{task-expandable-content-BMCvE36l.js → task-expandable-content-4s_FTl-9.js} +1 -1
  88. package/dist/gateway/static/root/assets/tracing-settings-page-CZ5XLQmX.js +1 -0
  89. package/dist/gateway/static/root/assets/tunnel-api-DOUyF9Ew.js +1 -0
  90. package/dist/gateway/static/root/assets/usage-page-Bv3fdfw1.js +1 -0
  91. package/dist/gateway/static/root/assets/use-autosave-D0MhLMD2.js +1 -0
  92. package/dist/gateway/static/root/assets/user-model-page-BD7WvhI0.js +2 -0
  93. package/dist/gateway/static/root/assets/{voice-api-key-field-Bk947X8N.js → voice-api-key-field-Ds_ADBQH.js} +1 -1
  94. package/dist/gateway/static/root/assets/work-discovery-overlay-CDJp2_l2.js +1 -0
  95. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-xQUvtVUU.js → workflow-run-setup-panel-CR4fRhZZ.js} +2 -2
  96. package/dist/gateway/static/root/assets/workflows-page-BeJw5liC.js +6 -0
  97. package/dist/gateway/static/root/assets/xopc-cloud-account-card-Di-oEpCt.js +1 -0
  98. package/dist/gateway/static/root/index.html +13 -7
  99. package/dist/package.js +1 -1
  100. package/dist/src/agent/background-review/prompts.d.ts +8 -0
  101. package/dist/src/agent/background-review/prompts.js +9 -2
  102. package/dist/src/agent/background-review/run-background-review.js +73 -11
  103. package/dist/src/agent/inbound/attachment-pipeline.d.ts +2 -0
  104. package/dist/src/agent/inbound/attachment-pipeline.js +10 -5
  105. package/dist/src/agent/tools/factory.js +15 -1
  106. package/dist/src/agent/tools/session-recall-tool.d.ts +3 -0
  107. package/dist/src/agent/tools/session-recall-tool.js +3 -0
  108. package/dist/src/agent/tools/session-search-tool.d.ts +3 -0
  109. package/dist/src/agent/tools/session-search-tool.js +20 -4
  110. package/dist/src/knowledge-memory/repository.d.ts +3 -1
  111. package/dist/src/knowledge-memory/repository.js +10 -3
  112. package/dist/src/memory-learning/forget-capture.d.ts +14 -0
  113. package/dist/src/memory-learning/forget-capture.js +100 -0
  114. package/dist/src/memory-learning/forgotten-history.d.ts +5 -0
  115. package/dist/src/memory-learning/forgotten-history.js +33 -0
  116. package/dist/src/memory-learning/work-capture.js +2 -1
  117. package/dist/src/providers/domestic-presets.d.ts +12 -5
  118. package/dist/src/providers/domestic-presets.js +27 -28
  119. package/dist/src/providers/presentation.js +7 -19
  120. package/dist/src/providers/setup/engine.js +2 -2
  121. package/dist/src/session/store.d.ts +1 -0
  122. package/dist/src/storage/sqlite/fts.d.ts +4 -0
  123. package/dist/src/storage/sqlite/fts.js +13 -4
  124. package/dist/src/storage/sqlite/session-repository.js +6 -3
  125. package/dist/src/storage/sqlite/transcript-repository.d.ts +1 -0
  126. package/dist/src/storage/sqlite/transcript-repository.js +14 -12
  127. package/dist/src/user-model/capture/semantic.d.ts +18 -1
  128. package/dist/src/user-model/capture/semantic.js +26 -1
  129. package/package.json +10 -10
  130. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CtE1h2xU.js +0 -1
  131. package/dist/gateway/static/root/assets/agents-DAgFeHEb.js +0 -77
  132. package/dist/gateway/static/root/assets/app-management-settings-panel-B1qR8ElB.js +0 -1
  133. package/dist/gateway/static/root/assets/appearance-settings-GA819R2q.js +0 -1
  134. package/dist/gateway/static/root/assets/apps-page-DZptDZ7h.js +0 -1
  135. package/dist/gateway/static/root/assets/automations-workspace-qfEjk_ws.js +0 -6
  136. package/dist/gateway/static/root/assets/browser-automation-inputs-Bs-AkQ1q.js +0 -1
  137. package/dist/gateway/static/root/assets/browser-automations-page-D0Vbe1Q_.js +0 -3
  138. package/dist/gateway/static/root/assets/browser-settings-page-BXCNNpQd.js +0 -3
  139. package/dist/gateway/static/root/assets/capabilities-page-DMtxaYgt.js +0 -2
  140. package/dist/gateway/static/root/assets/capabilities-settings-panel-BlWrMG6Z.js +0 -8
  141. package/dist/gateway/static/root/assets/capability-header-actions-BMffrHhT.js +0 -1
  142. package/dist/gateway/static/root/assets/channels-C96r2Rqq.js +0 -1
  143. package/dist/gateway/static/root/assets/computer-settings-page-75SDQxQW.js +0 -1
  144. package/dist/gateway/static/root/assets/connector-service-page-DmJ9dIql.js +0 -1
  145. package/dist/gateway/static/root/assets/connectors-page-Bua_nhSH.js +0 -1
  146. package/dist/gateway/static/root/assets/date-picker-BEDH1AbM.js +0 -1
  147. package/dist/gateway/static/root/assets/dependency-picker-LwWL5fo8.js +0 -1
  148. package/dist/gateway/static/root/assets/desktop-pet-settings-Btt-DzyT.js +0 -1
  149. package/dist/gateway/static/root/assets/device-pairing-wizard-_UWo9-4N.js +0 -1
  150. package/dist/gateway/static/root/assets/ellipsis-0k4rZLoy.js +0 -1
  151. package/dist/gateway/static/root/assets/extension-settings-page-BEDAm_Ib.js +0 -1
  152. package/dist/gateway/static/root/assets/eye-CABVeTq0.js +0 -1
  153. package/dist/gateway/static/root/assets/files-Bw4SBGdM.js +0 -1
  154. package/dist/gateway/static/root/assets/folder-open-CyzJ19I9.js +0 -1
  155. package/dist/gateway/static/root/assets/gateway-settings-BapgXAhB.js +0 -1
  156. package/dist/gateway/static/root/assets/home-page-DNGjF6h4.js +0 -2
  157. package/dist/gateway/static/root/assets/image-generation-api-Bi1-Hvtr.js +0 -1
  158. package/dist/gateway/static/root/assets/imports-page-b4VDs6Bd.js +0 -1
  159. package/dist/gateway/static/root/assets/index-Cgd4fGVP.js +0 -267
  160. package/dist/gateway/static/root/assets/index-gYRNcY2Q.css +0 -1
  161. package/dist/gateway/static/root/assets/local-app-workbench-page-dgUxHhW8.js +0 -1
  162. package/dist/gateway/static/root/assets/local-apps-page-D3k9GjgF.js +0 -1
  163. package/dist/gateway/static/root/assets/logs-page-BUlU7t8l.js +0 -2
  164. package/dist/gateway/static/root/assets/management-settings-2L7XFZXc.js +0 -1
  165. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Bi62iXra.js +0 -1
  166. package/dist/gateway/static/root/assets/note-detail-panel-ogBu93h0.js +0 -5
  167. package/dist/gateway/static/root/assets/note-image-lightbox-Dxvo_WsE.js +0 -1
  168. package/dist/gateway/static/root/assets/notes-page-CNdoxzIZ.js +0 -8
  169. package/dist/gateway/static/root/assets/page-context-capture-button-Bq4Xpop5.js +0 -1
  170. package/dist/gateway/static/root/assets/personal-page-7P2leCsB.js +0 -1
  171. package/dist/gateway/static/root/assets/personal-settings-panel-D6n6TObP.js +0 -1
  172. package/dist/gateway/static/root/assets/plugin-details-dialog-JTxDbMI4.js +0 -1
  173. package/dist/gateway/static/root/assets/product-open-page-BpB0klIl.js +0 -1
  174. package/dist/gateway/static/root/assets/product-preview-content-DxQaoQew.js +0 -1
  175. package/dist/gateway/static/root/assets/project-detail-page-LilHE2OV.js +0 -1
  176. package/dist/gateway/static/root/assets/projects-page-D4Jxhuhq.js +0 -1
  177. package/dist/gateway/static/root/assets/remote-access-hub-Cy71CCQq.js +0 -1
  178. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-CrbjrokA.js +0 -1
  179. package/dist/gateway/static/root/assets/schema-form-DITi2cne.js +0 -1
  180. package/dist/gateway/static/root/assets/sessions-page-D1THmRXE.js +0 -1
  181. package/dist/gateway/static/root/assets/settings-advanced-gate-CjRLXfoo.js +0 -1
  182. package/dist/gateway/static/root/assets/setup-status-panel-CFhDHkyK.js +0 -1
  183. package/dist/gateway/static/root/assets/share-preview-page-By4IKKgg.js +0 -2
  184. package/dist/gateway/static/root/assets/shares-settings-q2sa1VvF.js +0 -1
  185. package/dist/gateway/static/root/assets/skill-reload-api-CIHSQxr1.js +0 -1
  186. package/dist/gateway/static/root/assets/skills-page-BQaej_2C.js +0 -2
  187. package/dist/gateway/static/root/assets/style-Dt_oHNvB.js +0 -7
  188. package/dist/gateway/static/root/assets/task-detail-page-SipLlGGk.js +0 -2
  189. package/dist/gateway/static/root/assets/tracing-settings-page-bn9vnLrf.js +0 -1
  190. package/dist/gateway/static/root/assets/tunnel-api-BeTAD8BN.js +0 -1
  191. package/dist/gateway/static/root/assets/usage-page-BPuc6leN.js +0 -1
  192. package/dist/gateway/static/root/assets/use-autosave-DwcmmxWR.js +0 -1
  193. package/dist/gateway/static/root/assets/user-model-page-YWSqv_kR.js +0 -2
  194. package/dist/gateway/static/root/assets/work-discovery-overlay-mjj7w_wU.js +0 -1
  195. package/dist/gateway/static/root/assets/workflows-page-DbKRAEWP.js +0 -6
  196. package/dist/gateway/static/root/assets/xopc-cloud-account-card-C4jQM6Uo.js +0 -1
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./popover-select-DGKUpVsz.js";import{a as r,r as i}from"./locale-store-D_migb9R.js";function a(e){return{id:e.id,name:e.definition.name,description:e.definition.description,verified:e.verified,revision:e.revision,enabled:e.status===`enabled`,risk:e.definition.risk,domains:e.definition.allowedDomains,inputs:e.definition.inputs,createdAtMs:e.createdAtMs,updatedAtMs:e.updatedAtMs}}var o={recordingAvailability:()=>r(i(`/api/browser/recordings/availability`)),recording:(e,t)=>r(i(`/api/browser/recordings/control`),{method:`POST`,body:JSON.stringify({operation:e,endpointId:t})}),list:async()=>({automations:(await r(i(`/api/browser/automations`))).automations.map(a)}),setEnabled:async(e,t)=>({automation:a((await r(i(`/api/browser/automations/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify({status:t?`enabled`:`disabled`})})).automation)}),remove:e=>r(i(`/api/browser/automations/${encodeURIComponent(e)}`),{method:`DELETE`}),run:(e,t)=>r(i(`/api/browser/automations/${encodeURIComponent(e)}/run`),{method:`POST`,body:JSON.stringify({inputs:t,clientRequestId:crypto.randomUUID()})}),getRun:e=>r(i(`/api/browser/automation-runs/${encodeURIComponent(e)}`)),listRuns:e=>r(i(`/api/browser/automation-runs?automationId=${encodeURIComponent(e)}`)),cancel:e=>r(i(`/api/browser/automation-runs/${encodeURIComponent(e)}/cancel`),{method:`POST`})};function s(e){return Object.fromEntries(Object.entries(e.inputs).flatMap(([e,t])=>t.default===void 0?[]:[[e,t.default]]))}function c(e,t){return!Object.entries(e.inputs).some(([e,n])=>n.required&&(t[e]===void 0||t[e]===``))}var l=e(),u=t();function d(e){let t=(0,l.c)(53),{name:r,input:i,value:a,yes:o,no:s,onChange:c}=e,d;t[0]!==i.description||t[1]!==r?(d=i.description?.trim()||r,t[0]=i.description,t[1]=r,t[2]=d):d=t[2];let p=d;if(i.choices?.length){let e;t[3]===i.choices?e=t[4]:(e=i.choices.map(f),t[3]=i.choices,t[4]=e);let r=e,o=i.required?` *`:``,s;t[5]!==p||t[6]!==o?(s=(0,u.jsxs)(`span`,{className:`mb-1.5 block font-medium`,children:[p,o]}),t[5]=p,t[6]=o,t[7]=s):s=t[7];let l;t[8]===a?l=t[9]:(l=a===void 0?``:JSON.stringify(a),t[8]=a,t[9]=l);let d;t[10]===c?d=t[11]:(d=e=>c(JSON.parse(e)),t[10]=c,t[11]=d);let m;t[12]!==p||t[13]!==r||t[14]!==l||t[15]!==d?(m=(0,u.jsx)(n,{value:l,options:r,placeholder:p,onChange:d}),t[12]=p,t[13]=r,t[14]=l,t[15]=d,t[16]=m):m=t[16];let h;return t[17]!==s||t[18]!==m?(h=(0,u.jsxs)(`label`,{className:`block text-sm text-fg`,children:[s,m]}),t[17]=s,t[18]=m,t[19]=h):h=t[19],h}if(i.type===`boolean`){let e=i.required?` *`:``,r;t[20]!==p||t[21]!==e?(r=(0,u.jsxs)(`span`,{className:`mb-1.5 block font-medium`,children:[p,e]}),t[20]=p,t[21]=e,t[22]=r):r=t[22];let l=typeof a==`boolean`?String(a):``,d;t[23]===o?d=t[24]:(d={value:`true`,label:o},t[23]=o,t[24]=d);let f;t[25]===s?f=t[26]:(f={value:`false`,label:s},t[25]=s,t[26]=f);let m;t[27]!==d||t[28]!==f?(m=[d,f],t[27]=d,t[28]=f,t[29]=m):m=t[29];let h;t[30]===c?h=t[31]:(h=e=>c(e===`true`),t[30]=c,t[31]=h);let g;t[32]!==p||t[33]!==l||t[34]!==m||t[35]!==h?(g=(0,u.jsx)(n,{value:l,options:m,placeholder:p,onChange:h}),t[32]=p,t[33]=l,t[34]=m,t[35]=h,t[36]=g):g=t[36];let _;return t[37]!==r||t[38]!==g?(_=(0,u.jsxs)(`label`,{className:`block text-sm text-fg`,children:[r,g]}),t[37]=r,t[38]=g,t[39]=_):_=t[39],_}let m=i.type===`number`,h=i.required?` *`:``,g;t[40]!==p||t[41]!==h?(g=(0,u.jsxs)(`span`,{className:`mb-1.5 block font-medium`,children:[p,h]}),t[40]=p,t[41]=h,t[42]=g):g=t[42];let _=m?`number`:`text`,v=a===void 0?``:String(a),y;t[43]!==m||t[44]!==c?(y=e=>c(m?e.target.value===``?void 0:Number(e.target.value):e.target.value),t[43]=m,t[44]=c,t[45]=y):y=t[45];let b;t[46]!==_||t[47]!==v||t[48]!==y?(b=(0,u.jsx)(`input`,{type:_,value:v,onChange:y,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-sm text-fg outline-none focus:border-accent`}),t[46]=_,t[47]=v,t[48]=y,t[49]=b):b=t[49];let x;return t[50]!==g||t[51]!==b?(x=(0,u.jsxs)(`label`,{className:`block text-sm text-fg`,children:[g,b]}),t[50]=g,t[51]=b,t[52]=x):x=t[52],x}function f(e){return{value:JSON.stringify(e),label:String(e)}}function p(e){let t=(0,l.c)(7),{automation:n,values:r,language:i,onChange:a}=e,o;t[0]===n.inputs?o=t[1]:(o=Object.entries(n.inputs),t[0]=n.inputs,t[1]=o);let s;return t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==r?(s=(0,u.jsx)(`div`,{className:`grid gap-4`,children:o.map(e=>{let[t,n]=e;return(0,u.jsx)(d,{name:t,input:n,value:r[t],yes:i===`zh`?`是`:`Yes`,no:i===`zh`?`否`:`No`,onChange:e=>a({...r,[t]:e})},t)})}),t[2]=i,t[3]=a,t[4]=o,t[5]=r,t[6]=s):s=t[6],s}export{o as i,c as n,s as r,p as t};
@@ -0,0 +1,3 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{f as r}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as i}from"./popover-select-DGKUpVsz.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./x-B_N4OPjy.js";import{a as s,n as c,r as l}from"./locale-store-D_migb9R.js";import{t as u}from"./button-aIC072nz.js";import{t as d}from"./skeleton-BI5TyibZ.js";import{$d as f,B as p,Fd as m,H as h,Kd as g,Ol as ee,bl as _,ef as v,mf as y,mu as b,os as x,uu as S,yu as C,zl as w}from"./index-D2hEKnTM.js";import{i as T,n as E,r as D,t as O}from"./browser-automation-inputs-D8bZ9iz2.js";var k=e(t(),1),A=n();function j({availability:e,endpointId:t,recordingBusy:n,onSelect:f,onRefresh:m,onStart:g,onClose:ee}){let _=c(e=>e.language)===`zh`,v=r(),[y,b]=(0,k.useState)(),[x,C]=(0,k.useState)(!0),[w,T]=(0,k.useState)(!1),[E,D]=(0,k.useState)(``),[O,j]=(0,k.useState)(!1),M=e.endpoints.length>0,N=e.state===`update_required`;(0,k.useEffect)(()=>{let e=!1;if(M){C(!1);return}return s(l(`/api/browser/extension-status`)).then(t=>{e||b(t)}).catch(t=>{e||D(t instanceof Error?t.message:String(t))}).finally(()=>{e||C(!1)}),()=>{e=!0}},[M]);let P=async()=>{T(!0),D(``);try{(N||!y?.artifacts?.installed||y.artifacts.needsRefresh)&&await p(N||!!y?.artifacts?.needsRefresh),await h(y?.artifacts?.installed?`chrome`:`both`),j(!0),await m()}catch(e){D(e instanceof Error?e.message:String(e))}finally{T(!1)}};return(0,A.jsxs)(`section`,{role:`status`,"aria-live":`polite`,className:`mb-4 shrink-0 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(S,{className:`mt-0.5 size-5 shrink-0 text-accent`}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:M?_?`浏览器已连接`:`Browser connected`:N?_?`更新扩展后即可录制`:`Update the extension to record`:_?`连接 Chrome,录制你的操作`:`Connect Chrome to record your actions`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:M?_?`在 Chrome 中切换到要录制的网页,然后开始录制。`:`Switch to the website you want to record in Chrome, then start recording.`:N?_?`当前扩展还不支持录制。更新扩展文件后,在 Chrome 扩展页重新加载 xopc。`:`Your connected extension does not support recording yet. Update its files, then reload xopc in Chrome Extensions.`:_?`录制需要 xopc Chrome 扩展。已有扩展请打开 xopc 侧栏,它会自动连接本机服务。`:`Recording uses the xopc Chrome extension. If already installed, open its side panel to connect to your local Gateway.`})]}),(0,A.jsx)(`button`,{type:`button`,disabled:w||n,onClick:ee,"aria-label":_?`收起连接引导`:`Close connection guide`,className:`rounded p-1 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(o,{className:`size-4`})})]}),O&&!M&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:y?.artifacts?.installed?_?`重新加载后打开 xopc 侧栏。连接状态会自动更新。`:`After reloading, open the xopc side panel. Connection status updates automatically.`:_?`在 Chrome 扩展页开启开发者模式,点击“加载已解压的扩展程序”,选择已打开的扩展目录,再打开 xopc 侧栏。连接状态会自动更新。`:`Enable Developer mode in Chrome Extensions, choose Load unpacked and select the opened extension folder, then open the xopc side panel. Connection status updates automatically.`}),M&&e.endpoints.length>1&&(0,A.jsx)(`div`,{className:`mt-3 max-w-sm`,children:(0,A.jsx)(i,{value:t??``,ariaLabel:_?`选择录制浏览器`:`Choose a browser to record`,placeholder:_?`选择浏览器`:`Choose a browser`,allowEmpty:!1,options:e.endpoints.map(e=>({value:e.endpointId,label:e.displayName})),onChange:f})}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[M?(0,A.jsx)(u,{onClick:g,disabled:n||!t&&e.endpoints.length>1,children:_?`开始录制`:`Start recording`}):x?(0,A.jsx)(d,{className:`h-9 w-32 rounded-lg`}):y?.artifacts?.extensionDir?(0,A.jsxs)(u,{onClick:()=>void P(),disabled:w,children:[w&&(0,A.jsx)(a,{className:`size-4 animate-spin`}),N?_?`更新并打开扩展页`:`Update and open extensions`:y.artifacts.installed?_?`打开 Chrome 扩展页`:`Open Chrome Extensions`:_?`安装 Chrome 扩展`:`Install Chrome extension`]}):(0,A.jsx)(u,{onClick:()=>v(`/settings/agent-browser`),children:_?`设置浏览器连接`:`Set up browser connection`}),!M&&(0,A.jsx)(u,{variant:`secondary`,disabled:w,onClick:()=>void m().catch(e=>D(e instanceof Error?e.message:String(e))),children:_?`检查连接`:`Check connection`})]}),E&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-danger`,role:`alert`,children:E})]})}var M={en:{record:`Record my actions`,finishRecording:`Finish and save`,recording:`Recording`,syncing:`Saved locally, syncing…`,verified:`Result verified`,saved:`Saved draft`,unknown:`Check the business result before repeating`,title:`Browser automations`,subtitle:`Let your assistant repeat routine actions on the web.`,emptyTitle:`No browser automations yet`,emptyBody:`Tell your assistant what to do on the web. Once it works, save it and run it again whenever you need.`,create:`Create with assistant`,edit:`Edit with assistant`,run:`Run now`,stop:`Stop`,enable:`Enable`,pause:`Pause`,enabled:`Enabled`,paused:`Paused`,inputs:`Before running`,noInputs:`This automation is ready to run.`,history:`Recent activity`,delete:`Delete automation`,confirmDelete:`Delete this browser automation?`,required:`Please complete all required fields.`,queued:`Waiting to start`,running:`Running`,succeeded:`Completed`,failed:`Needs attention`,cancelled:`Stopped`,result:`Result`,read:`Reads information`,draft:`Edits the page locally`,external_effect:`Affects an external system`,destructive:`Destructive action`,sensitive:`Sensitive action`,createPrompt:`Help me create a reusable browser automation. Ask what I want the browser to do, perform it once with me, then save the successful steps. Keep all technical details hidden.`,editPrompt:`Help me update the browser automation "{name}" (id: {id}). Ask what should change, test the new browser steps, then save it.`},zh:{record:`录制我的操作`,finishRecording:`完成并保存`,recording:`正在录制`,syncing:`已保存到本机,正在同步…`,verified:`结果已验证`,saved:`已保存草稿`,unknown:`结果待检查,请先检查业务结果再重复运行`,title:`浏览器自动化`,subtitle:`让助手自动重复完成网页上的固定操作。`,emptyTitle:`还没有浏览器自动化`,emptyBody:`告诉助手你希望在网页上自动完成什么。成功执行一次后,即可保存并重复运行。`,create:`让助手帮我创建`,edit:`让助手帮我修改`,run:`立即运行`,stop:`停止`,enable:`启用`,pause:`暂停`,enabled:`已启用`,paused:`已暂停`,inputs:`运行前需要填写`,noInputs:`这个自动化可以直接运行。`,history:`最近运行`,delete:`删除自动化`,confirmDelete:`确定删除这个浏览器自动化吗?`,required:`请填写所有必填内容。`,queued:`等待开始`,running:`正在运行`,succeeded:`已完成`,failed:`需要处理`,cancelled:`已停止`,result:`运行结果`,read:`仅读取信息`,draft:`仅在页面内编辑`,external_effect:`会影响外部系统`,destructive:`破坏性操作`,sensitive:`包含敏感操作`,createPrompt:`请帮我创建一个可重复运行的浏览器自动化。先询问我希望浏览器完成什么,陪我实际执行成功一次,然后保存成功步骤。不要让我处理技术细节。`,editPrompt:`请帮我修改浏览器自动化“{name}”(id:{id})。先询问我要修改什么,实际测试新的浏览器步骤,然后保存。`}};function N(e){return e!==`queued`&&e!==`running`}function P(e){return e==null?`-`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.map(e=>`• ${P(e)}`).join(`
2
+ `):typeof e==`object`?Object.entries(e).map(([e,t])=>`${e}: ${P(t)}`).join(`
3
+ `):String(e)}function F(){let e=c(e=>e.language),t=M[e],n=r(),i=x(e=>e.setPageHeader),a=x(e=>e.clearPageHeader),[o,s]=(0,k.useState)(null),[l,p]=(0,k.useState)(),[h,S]=(0,k.useState)({}),[F,I]=(0,k.useState)([]),[L,R]=(0,k.useState)(),[z,B]=(0,k.useState)(``),[V,H]=(0,k.useState)(!1),[U,W]=(0,k.useState)(),[G,K]=(0,k.useState)(),[q,J]=(0,k.useState)(),Y=(0,k.useMemo)(()=>o?.find(e=>e.id===l),[l,o]),X=(0,k.useCallback)(async()=>{let e=await T.list();s(e.automations),p(t=>t&&e.automations.some(e=>e.id===t)?t:e.automations[0]?.id)},[]);(0,k.useEffect)(()=>{X().catch(e=>B(String(e)))},[X]),(0,k.useEffect)(()=>{Y&&(S(D(Y)),R(void 0),B(``),T.listRuns(Y.id).then(e=>I(e.runs)).catch(e=>B(String(e))))},[Y?.id,Y?.revision]),(0,k.useEffect)(()=>{if(!L||N(L.status))return;let e=window.setInterval(()=>{T.getRun(L.id).then(({run:e})=>{R(e),N(e.status)&&Y&&(T.listRuns(Y.id).then(e=>I(e.runs)),X())}).catch(e=>B(String(e)))},700);return()=>window.clearInterval(e)},[L,Y]);let Z=(0,k.useCallback)(async()=>{H(!0),B(``);try{let e=U&&[`recording`,`paused`].includes(U.state),t=G;if(!e){let e=await T.recordingAvailability();if(e.endpoints.length===1?t=e.endpoints[0].endpointId:e.endpoints.some(e=>e.endpointId===t)||(t=void 0),K(t),!t){J(e);return}}let n=await T.recording(e?`finish`:`start`,t);W(n.value),K(n.endpointId),J(void 0)}catch(e){let t=e.body;t?.code&&[`connect_required`,`update_required`,`choose_browser`].includes(t.code)?J({state:t.code,endpoints:t.endpoints??[]}):B(e instanceof Error?e.message:String(e))}finally{H(!1)}},[U,G]),te=(0,k.useCallback)(async()=>{let e=await T.recordingAvailability();J(e),K(t=>e.endpoints.length===1?e.endpoints[0].endpointId:e.endpoints.some(e=>e.endpointId===t)?t:void 0)},[]);(0,k.useEffect)(()=>{if(!q)return;let e=!1,t=window.setInterval(()=>{T.recordingAvailability().then(t=>{e||(J(t),K(e=>t.endpoints.length===1?t.endpoints[0].endpointId:t.endpoints.some(t=>t.endpointId===e)?e:void 0))}).catch(()=>void 0)},3e3);return()=>{e=!0,window.clearInterval(t)}},[!!q]),(0,k.useEffect)(()=>{if(!U||U.automationId)return;let e=!1,t=window.setInterval(()=>{T.recording(`status`,G).then(async t=>{let n=t.value.find(e=>e.id===U.id);!e&&n&&(W(n),n.automationId&&(await X(),e||p(n.automationId)))}).catch(t=>{e||B(String(t))})},1500);return()=>{e=!0,window.clearInterval(t)}},[U,G,X]);let Q=(0,k.useCallback)(e=>{n(`/chat/new?draft=${encodeURIComponent(e)}`)},[n]),ne=(0,k.useMemo)(()=>(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[z&&(0,A.jsx)(`span`,{role:`alert`,className:`max-w-64 truncate text-xs text-red-600`,title:z,children:z}),U?.state===`stopped`&&!U.automationId&&(0,A.jsx)(`span`,{role:`status`,className:`text-xs text-fg-muted`,children:U.error||t.syncing}),(0,A.jsxs)(u,{variant:`secondary`,disabled:V,onClick:()=>void Z(),children:[(0,A.jsx)(_,{className:`size-4`}),U&&[`recording`,`paused`].includes(U.state)?t.finishRecording:t.record]}),(0,A.jsxs)(u,{onClick:()=>Q(t.createPrompt),children:[(0,A.jsx)(y,{className:`size-4`}),t.create]})]}),[Q,t,V,Z,U,z]);(0,k.useLayoutEffect)(()=>(i({startExtra:null,main:(0,A.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),end:ne}),()=>a()),[a,ne,i,t.title]);let re=async()=>{if(Y){H(!0);try{await T.setEnabled(Y.id,!Y.enabled),await X()}catch(e){B(String(e))}finally{H(!1)}}},ie=async()=>{if(Y){if(!E(Y,h)){B(t.required);return}H(!0);try{let{run:e}=await T.run(Y.id,h);R(e),B(``)}catch(e){B(String(e))}finally{H(!1)}}},ae=async()=>{if(!(!Y||!window.confirm(t.confirmDelete))){H(!0);try{await T.remove(Y.id),p(void 0),I([]),await X()}catch(e){B(String(e))}finally{H(!1)}}},$=q&&(0,A.jsx)(j,{availability:q,endpointId:G,recordingBusy:V,onSelect:K,onRefresh:te,onStart:()=>void Z(),onClose:()=>J(void 0)});return o===null?(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,A.jsx)(d,{className:`h-[420px] rounded-xl`}),(0,A.jsx)(d,{className:`h-[420px] rounded-xl`})]})]}):o.length===0?(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`m-auto max-w-md py-12 text-center`,children:[(0,A.jsx)(y,{className:`mx-auto size-10 text-accent`}),(0,A.jsx)(`h2`,{className:`mt-4 text-lg font-semibold text-fg`,children:t.emptyTitle}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:t.emptyBody}),(0,A.jsxs)(u,{className:`mt-5`,onClick:()=>Q(t.createPrompt),children:[(0,A.jsx)(y,{className:`size-4`}),t.create]})]})]}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel px-4 pb-4 pt-3 sm:px-6 sm:pb-6 lg:pt-4`,children:[$,(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,A.jsx)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-2`,children:o.map(e=>(0,A.jsxs)(`button`,{onClick:()=>p(e.id),className:`mb-1 w-full rounded-lg p-3 text-left ${l===e.id?`bg-accent-soft text-accent-fg`:`hover:bg-surface-hover`}`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,A.jsxs)(`span`,{className:`mt-1 flex items-center gap-1.5 text-xs text-fg-muted`,children:[e.enabled?(0,A.jsx)(f,{className:`size-3.5 text-emerald-600`}):(0,A.jsx)(v,{className:`size-3.5`}),e.enabled?t.enabled:t.paused]})]},e.id))}),Y&&(0,A.jsxs)(`main`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-5 sm:p-6`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:Y.name}),Y.description&&(0,A.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:Y.description}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[(0,A.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:t[Y.risk]}),(0,A.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:Y.verified?t.verified:t.saved}),Y.domains.map(e=>(0,A.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:[(0,A.jsx)(m,{className:`size-3`}),e]},e))]})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(u,{variant:`secondary`,disabled:V,onClick:()=>void re(),children:[Y.enabled?(0,A.jsx)(v,{className:`size-4`}):(0,A.jsx)(f,{className:`size-4`}),Y.enabled?t.pause:t.enable]}),(0,A.jsxs)(u,{variant:`secondary`,onClick:()=>Q(t.editPrompt.replace(`{name}`,Y.name).replace(`{id}`,Y.id)),children:[(0,A.jsx)(C,{className:`size-4`}),t.edit]})]})]}),(0,A.jsxs)(`section`,{className:`mt-7 max-w-xl`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.inputs}),Object.keys(Y.inputs).length===0?(0,A.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.noInputs}):(0,A.jsx)(`div`,{className:`mt-3`,children:(0,A.jsx)(O,{automation:Y,values:h,language:e,onChange:S})}),(0,A.jsxs)(`div`,{className:`mt-5 flex gap-2`,children:[(0,A.jsxs)(u,{variant:`primary`,disabled:!Y.enabled||V||!!(L&&!N(L.status)),onClick:()=>void ie(),children:[(0,A.jsx)(b,{className:`size-4`}),t.run]}),L&&!N(L.status)&&(0,A.jsxs)(u,{variant:`secondary`,onClick:()=>void T.cancel(L.id),children:[(0,A.jsx)(w,{className:`size-4`}),t.stop]})]}),z&&(0,A.jsx)(`p`,{className:`mt-3 text-sm text-red-700 dark:text-red-300`,children:z})]}),L&&(0,A.jsxs)(`section`,{className:`mt-7 rounded-xl border border-edge bg-surface-inset p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,A.jsx)(g,{className:`size-4`}),L.businessOutcome===`verified`?t.verified:t[L.status]]}),L.businessOutcome===`unknown`&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.unknown}),L.error&&(0,A.jsx)(`p`,{className:`mt-2 text-sm text-red-700 dark:text-red-300`,children:L.error}),L.status===`succeeded`&&L.result!==void 0&&(0,A.jsxs)(`div`,{className:`mt-3`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:t.result}),(0,A.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap text-sm text-fg`,children:P(L.result)})]})]}),(0,A.jsxs)(`section`,{className:`mt-8`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.history}),(0,A.jsx)(`div`,{className:`mt-2 divide-y divide-edge`,children:F.slice(0,10).map(e=>(0,A.jsxs)(`button`,{className:`flex w-full items-center justify-between gap-3 py-3 text-left text-sm hover:text-accent`,onClick:()=>R(e),children:[(0,A.jsx)(`span`,{children:t[e.status]}),(0,A.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[new Date(e.createdAtMs).toLocaleString(),e.durationMs?` · ${Math.max(1,Math.round(e.durationMs/1e3))}s`:``]})]},e.id))})]}),(0,A.jsx)(`div`,{className:`mt-8 border-t border-edge pt-4`,children:(0,A.jsxs)(u,{variant:`ghost`,className:`text-red-700 dark:text-red-300`,disabled:V,onClick:()=>void ae(),children:[(0,A.jsx)(ee,{className:`size-4`}),t.delete]})})]})]})]})}export{F as BrowserAutomationsPage};
@@ -0,0 +1,3 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as o}from"./popover-select-DGKUpVsz.js";import{t as s}from"./circle-check-C23XjkUj.js";import{t as c}from"./download-Dk-ZjtO6.js";import{t as l}from"./external-link-DjqjBmc3.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{t as d}from"./messages-D__oW2yE.js";import{a as f,c as p,n as m,r as h}from"./locale-store-D_migb9R.js";import{i as g}from"./vendor-swr-BIWyz7Rc.js";import{t as _}from"./button-aIC072nz.js";import{t as v}from"./skeleton-BI5TyibZ.js";import{n as y,r as b}from"./gateway-config-swr-CTXr917C.js";import{B as x,Cd as S,Dl as C,G as w,H as T,Hu as ee,Ld as te,R as ne,U as E,Un as D,V as re,bd as O,go as k,ho as ie,hu as ae,jd as A,ku as j,ou as oe,z as M}from"./index-D2hEKnTM.js";import{t as se}from"./number-input-DDeqHK-G.js";import{n as N,r as P}from"./settings-page-layout-Dx5S-Msc.js";import{n as ce,t as F}from"./use-autosave-D0MhLMD2.js";var I=n(),L=e(t(),1);function R(e){let[t,n]=(0,L.useState)(!1),[r,i]=(0,L.useState)(!1),[a,o]=(0,L.useState)(null),[s,c]=(0,L.useState)(null),l=(0,L.useRef)(null);return{running:t,cancelling:r,progress:a,error:s,install:(0,L.useCallback)(async()=>{if(l.current)return;let t=new AbortController;l.current=t,n(!0),o(null),c(null);try{let n=await re(o,t.signal);if(!n.ok){n.error!==`cancelled`&&c(n.message??n.error);return}e()}catch(e){t.signal.aborted||c(e instanceof Error?e.message:String(e))}finally{l.current===t&&(l.current=null),n(!1),i(!1)}},[e]),cancel:(0,L.useCallback)(async()=>{l.current&&(i(!0),await ne().catch(()=>{}),l.current.abort())},[])}}var z=r(),B={extension:`Chrome extension`,playwright:`Playwright Chromium`,cdp:`CDP`,remote:`Remote browser`};function le(e){let{enabled:t,driverKind:n,autosaveStatus:r,zh:a}=e,o=i(),c=g(t?[`browser-control-status`,n]:null,M,{revalidateOnFocus:!0,refreshInterval:n===`extension`?3e3:0}),[l,d]=(0,L.useState)(null),[f,p]=(0,L.useState)(null),[m,h]=(0,L.useState)(null),y=r===`dirty`||r===`saving`;(0,L.useEffect)(()=>{r===`saved`&&c.mutate()},[r,c.mutate]);let b=(0,L.useCallback)(async(e,t,n)=>{d(e),p(null),h(null);try{await t(),h(n),await c.mutate()}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(null)}},[c.mutate]),x=R((0,L.useCallback)(()=>{h(a?`Chromium 已安装,可以开始连接测试。`:`Chromium is installed and ready to test.`),c.mutate()},[c.mutate,a])),S=c.data?.payload,w=S?.driverKind===n,T=t?y||!w?`syncing`:S?.state:`disabled`;return(0,z.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(T===`ready`?s:T===`syncing`?u:C,{className:`size-4 shrink-0 ${T===`ready`?`text-success`:T===`syncing`?`animate-spin text-fg-muted`:T===`disabled`?`text-fg-subtle`:`text-warning`}`}),(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:a?`浏览器就绪状态`:`Browser readiness`}),(0,z.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs ${T===`ready`?`bg-success-soft text-success`:T===`disabled`?`bg-surface-hover text-fg-muted`:`bg-warning-soft text-warning`}`,children:T===`ready`?a?`已就绪`:`Ready`:T===`disabled`?a?`未启用`:`Disabled`:T===`syncing`?a?`正在应用配置`:`Applying configuration`:a?`需要处理`:`Needs attention`})]}),(0,z.jsxs)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:[B[n],S?.detail&&w?` · ${S.detail}`:``]})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsxs)(_,{variant:`ghost`,className:`h-9`,onClick:()=>void c.mutate(),disabled:c.isValidating,children:[(0,z.jsx)(oe,{className:`size-3.5 ${c.isValidating?`animate-spin`:``}`}),a?`刷新`:`Refresh`]}),(0,z.jsxs)(_,{variant:`secondary`,className:`h-9`,disabled:!t||y||l!==null||x.running,onClick:()=>void b(`test`,E,a?`连接测试成功。`:`Connection test passed.`),children:[l===`test`?(0,z.jsx)(u,{className:`size-3.5 animate-spin`}):(0,z.jsx)(ae,{className:`size-3.5`}),a?`测试连接`:`Test connection`]})]})]}),t&&c.isLoading?(0,z.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-3`,children:[(0,z.jsx)(v,{className:`h-12`}),(0,z.jsx)(v,{className:`h-12`}),(0,z.jsx)(v,{className:`h-12`})]}):null,t&&c.error?(0,z.jsx)(U,{tone:`error`,children:c.error instanceof Error?c.error.message:String(c.error)}):null,f||x.error?(0,z.jsx)(U,{tone:`error`,children:f??x.error}):null,m?(0,z.jsx)(U,{tone:`success`,children:m}):null,t&&n===`extension`&&w?(0,z.jsx)(V,{status:S?.driverStatus,zh:a,busy:l,run:b,onConnectRemote:()=>o(`/settings/devices?startDevicePairing=browser`)}):null,t&&n===`playwright`&&w?(0,z.jsx)(fe,{status:S?.driverStatus,zh:a,installer:x}):null,t&&n===`cdp`?(0,z.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-muted`,children:a?`连接测试会验证已保存的 CDP 地址,并复用浏览器中现有的标签页和登录状态。`:`The connection test verifies the saved CDP endpoint and reuses that browser’s existing tabs and signed-in state.`}):null,t&&n===`remote`?(0,z.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-muted`,children:a?`连接测试会在服务商侧创建一个临时浏览器会话,并在测试结束后立即关闭。`:`The connection test creates a temporary provider session and closes it immediately after the test.`}):null]})}function V(e){let t=(0,I.c)(70),{status:n,zh:r,busy:i,run:a,onConnectRemote:o}=e,s=n?.artifacts,d=r?`扩展文件`:`Extension files`,f=s?.installed===!0,p=s?.installed?r?`已安装`:`Installed`:r?`未安装或需更新`:`Install or update required`,m;t[0]!==d||t[1]!==f||t[2]!==p?(m=(0,z.jsx)(H,{label:d,ok:f,value:p}),t[0]=d,t[1]=f,t[2]=p,t[3]=m):m=t[3];let h=r?`本机自动发现`:`Local auto-discovery`,g=s?.nativeHost?.installed===!0,v=s?.nativeHost?.installed?r?`已就绪`:`Ready`:s?.nativeHost?.reason??(r?`需要修复`:`Repair required`),y;t[4]!==h||t[5]!==g||t[6]!==v?(y=(0,z.jsx)(H,{label:h,ok:g,value:v}),t[4]=h,t[5]=g,t[6]=v,t[7]=y):y=t[7];let b=r?`安全通道`:`Secure channel`,C=n?.transport===`gateway-realtime`,w=n?.transport===`gateway-realtime`?`Gateway Realtime`:r?`不可用`:`Unavailable`,T;t[8]!==w||t[9]!==b||t[10]!==C?(T=(0,z.jsx)(H,{label:b,ok:C,value:w}),t[8]=w,t[9]=b,t[10]=C,t[11]=T):T=t[11];let ee=r?`Chrome 连接`:`Chrome connection`,te=n?.connected===!0,ne=n?.connected?r?`已连接`:`Connected`:n?.socketConnected?r?`需要重新加载扩展`:`Reload extension`:r?`等待扩展连接`:`Waiting for extension`,E;t[12]!==ee||t[13]!==te||t[14]!==ne?(E=(0,z.jsx)(H,{label:ee,ok:te,value:ne}),t[12]=ee,t[13]=te,t[14]=ne,t[15]=E):E=t[15];let D;t[16]!==T||t[17]!==E||t[18]!==m||t[19]!==y?(D=(0,z.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[m,y,T,E]}),t[16]=T,t[17]=E,t[18]=m,t[19]=y,t[20]=D):D=t[20];let re=s?.extensionDir??`Gateway Realtime`,O;t[21]===re?O=t[22]:(O=(0,z.jsx)(`p`,{className:`mt-3 break-all text-xs text-fg-subtle`,children:re}),t[21]=re,t[22]=O);let k=s?.installed?`secondary`:`primary`,ie=i!==null,A;t[23]!==s?.installed||t[24]!==a||t[25]!==r?(A=()=>void a(`extension-install`,()=>x(!!s?.installed),r?`扩展文件已准备好。`:`Extension files are ready.`),t[23]=s?.installed,t[24]=a,t[25]=r,t[26]=A):A=t[26];let j;t[27]===i?j=t[28]:(j=i===`extension-install`?(0,z.jsx)(u,{className:`size-3.5 animate-spin`}):(0,z.jsx)(c,{className:`size-3.5`}),t[27]=i,t[28]=j);let oe=s?.installed?r?`刷新扩展文件`:`Refresh files`:r?`安装扩展文件`:`Install extension`,M;t[29]!==k||t[30]!==ie||t[31]!==A||t[32]!==j||t[33]!==oe?(M=(0,z.jsxs)(_,{className:`h-9`,variant:k,disabled:ie,onClick:A,children:[j,oe]}),t[29]=k,t[30]=ie,t[31]=A,t[32]=j,t[33]=oe,t[34]=M):M=t[34];let se=!s?.installed||i!==null,N;t[35]!==a||t[36]!==r?(N=()=>void a(`extension-open`,de,r?`已打开 Chrome 扩展页。`:`Chrome extensions opened.`),t[35]=a,t[36]=r,t[37]=N):N=t[37];let P;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,z.jsx)(l,{className:`size-3.5`}),t[38]=P):P=t[38];let ce=r?`打开扩展页`:`Open extensions`,F;t[39]!==se||t[40]!==N||t[41]!==ce?(F=(0,z.jsxs)(_,{className:`h-9`,variant:`secondary`,disabled:se,onClick:N,children:[P,ce]}),t[39]=se,t[40]=N,t[41]=ce,t[42]=F):F=t[42];let L=!s?.installed||i!==null,R;t[43]!==a||t[44]!==r?(R=()=>void a(`extension-folder`,ue,r?`已打开扩展目录。`:`Extension folder opened.`),t[43]=a,t[44]=r,t[45]=R):R=t[45];let B;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,z.jsx)(S,{className:`size-3.5`}),t[46]=B):B=t[46];let le=r?`打开扩展目录`:`Open folder`,V;t[47]!==L||t[48]!==R||t[49]!==le?(V=(0,z.jsxs)(_,{className:`h-9`,variant:`ghost`,disabled:L,onClick:R,children:[B,le]}),t[47]=L,t[48]=R,t[49]=le,t[50]=V):V=t[50];let fe=i!==null,U;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,z.jsx)(ae,{className:`size-3.5`}),t[51]=U):U=t[51];let pe=r?`连接远程 Chrome`:`Connect remote Chrome`,W;t[52]!==o||t[53]!==fe||t[54]!==pe?(W=(0,z.jsxs)(_,{className:`h-9`,variant:`secondary`,disabled:fe,onClick:o,children:[U,pe]}),t[52]=o,t[53]=fe,t[54]=pe,t[55]=W):W=t[55];let G;t[56]!==M||t[57]!==F||t[58]!==V||t[59]!==W?(G=(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[M,F,V,W]}),t[56]=M,t[57]=F,t[58]=V,t[59]=W,t[60]=G):G=t[60];let K;t[61]!==n?.connected||t[62]!==n?.socketConnected||t[63]!==r?(K=n?.connected?null:(0,z.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-fg-muted`,children:n?.socketConnected?r?`扩展仍在运行旧协议。请打开 Chrome 扩展页,找到 xopc 并点击“重新加载”,然后刷新状态。`:`The extension is still running an older protocol. Open Chrome Extensions, find xopc, click Reload, then refresh status.`:r?`打开 xopc Chrome 扩展后,它会自动发现并安全连接本机 Gateway;只有连接另一台电脑时才需要一次性邀请和手动确认。`:`Open the xopc Chrome extension to discover and securely connect to a local Gateway automatically. A one-time invitation and explicit approval are only required for Chrome on another computer.`}),t[61]=n?.connected,t[62]=n?.socketConnected,t[63]=r,t[64]=K):K=t[64];let q;return t[65]!==D||t[66]!==O||t[67]!==G||t[68]!==K?(q=(0,z.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base/45 p-4`,children:[D,O,G,K]}),t[65]=D,t[66]=O,t[67]=G,t[68]=K,t[69]=q):q=t[69],q}function ue(){return T(`folder`)}function de(){return T(`chrome`)}function fe(e){let t=(0,I.c)(28),{status:n,zh:r,installer:i}=e,a=n?.installed===!0,o=n?.installed?r?`已安装`:`Installed`:n?.reason??(r?`未安装`:`Not installed`),s;t[0]!==a||t[1]!==o?(s=(0,z.jsx)(H,{label:`Chromium`,ok:a,value:o}),t[0]=a,t[1]=o,t[2]=s):s=t[2];let l;t[3]===n?l=t[4]:(l=n?.executablePath?(0,z.jsx)(`p`,{className:`mt-2 break-all text-xs text-fg-subtle`,children:n.executablePath}):null,t[3]=n,t[4]=l);let d;t[5]===i.progress?d=t[6]:(d=i.progress?(0,z.jsxs)(`div`,{className:`mt-3`,children:[(0,z.jsxs)(`div`,{className:`flex justify-between text-xs text-fg-muted`,children:[(0,z.jsx)(`span`,{children:i.progress.message??i.progress.phase}),(0,z.jsx)(`span`,{children:i.progress.percent==null?``:`${Math.round(i.progress.percent)}%`})]}),(0,z.jsx)(`div`,{className:`mt-1 h-1.5 overflow-hidden rounded-full bg-surface-hover`,children:(0,z.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-[width]`,style:{width:`${i.progress.percent??8}%`}})})]}):null,t[5]=i.progress,t[6]=d);let f=n?.installed?`secondary`:`primary`,p;t[7]===i?p=t[8]:(p=()=>void i.install(),t[7]=i,t[8]=p);let m;t[9]===i.running?m=t[10]:(m=i.running?(0,z.jsx)(u,{className:`size-3.5 animate-spin`}):(0,z.jsx)(c,{className:`size-3.5`}),t[9]=i.running,t[10]=m);let h=n?.installed?r?`重新安装 Chromium`:`Reinstall Chromium`:r?`安装 Chromium`:`Install Chromium`,g;t[11]!==i.running||t[12]!==f||t[13]!==p||t[14]!==m||t[15]!==h?(g=(0,z.jsxs)(_,{variant:f,className:`h-9`,disabled:i.running,onClick:p,children:[m,h]}),t[11]=i.running,t[12]=f,t[13]=p,t[14]=m,t[15]=h,t[16]=g):g=t[16];let v;t[17]!==i||t[18]!==r?(v=i.running?(0,z.jsx)(_,{variant:`ghost`,className:`h-9`,disabled:i.cancelling,onClick:()=>void i.cancel(),children:i.cancelling?r?`正在取消…`:`Cancelling…`:r?`取消`:`Cancel`}):null,t[17]=i,t[18]=r,t[19]=v):v=t[19];let y;t[20]!==v||t[21]!==g?(y=(0,z.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[g,v]}),t[20]=v,t[21]=g,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==s||t[25]!==l||t[26]!==d?(b=(0,z.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base/45 p-4`,children:[s,l,d,y]}),t[23]=y,t[24]=s,t[25]=l,t[26]=d,t[27]=b):b=t[27],b}function H(e){let t=(0,I.c)(11),{label:n,ok:r,value:i}=e,a;t[0]===n?a=t[1]:(a=(0,z.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n}),t[0]=n,t[1]=a);let o=`mt-1 flex items-center gap-1.5 text-sm ${r?`text-success`:`text-fg-muted`}`,s=`size-1.5 rounded-full ${r?`bg-success`:`bg-warning`}`,c;t[2]===s?c=t[3]:(c=(0,z.jsx)(`span`,{className:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c||t[6]!==i?(l=(0,z.jsxs)(`p`,{className:o,children:[c,i]}),t[4]=o,t[5]=c,t[6]=i,t[7]=l):l=t[7];let u;return t[8]!==a||t[9]!==l?(u=(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-inset px-3 py-2`,children:[a,l]}),t[8]=a,t[9]=l,t[10]=u):u=t[10],u}function U(e){let t=(0,I.c)(4),{tone:n,children:r}=e,i=`mt-3 rounded-lg px-3 py-2 text-xs ${n===`success`?`bg-success-soft text-success`:`bg-danger-soft text-danger`}`,a=n===`error`?`alert`:`status`,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,z.jsx)(`p`,{className:i,role:a,children:r}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function pe(e){let t=(0,I.c)(36),{sectionId:n,vm:r,children:i}=e,a=m(W),o;t[0]===a?o=t[1]:(o=d(a),t[0]=a,t[1]=o);let s=o,c=s.agentSettings,l=s.settingsSections[n]??n;if(!r.hasToken){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,z.jsx)(te,{className:`mt-0.5 size-5 shrink-0 text-fg-subtle`,strokeWidth:1.75}),t[2]=e):e=t[2];let n;t[3]===l?n=t[4]:(n=(0,z.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:l}),t[3]=l,t[4]=n);let r;t[5]===c.needToken?r=t[6]:(r=(0,z.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:c.needToken}),t[5]=c.needToken,t[6]=r);let i;return t[7]!==n||t[8]!==r?(i=(0,z.jsx)(P,{gap:`gap-3`,padding:`px-3 py-10 sm:px-5 xl:px-6`,children:(0,z.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[e,(0,z.jsxs)(`div`,{children:[n,r]})]})}),t[7]=n,t[8]=r,t[9]=i):i=t[9],i}if(r.loading){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,z.jsx)(P,{gap:`gap-6`,padding:`px-3 py-8 sm:px-5 xl:px-6`,children:(0,z.jsx)(D,{sections:1})}),t[10]=e):e=t[10],e}if(!r.form){let e=r.error??r.fetchError??c.loadError,n;t[11]===e?n=t[12]:(n=(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e}),t[11]=e,t[12]=n);let i;t[13]===r?i=t[14]:(i=()=>void r.mutate(),t[13]=r,t[14]=i);let a;t[15]!==s.logs.refresh||t[16]!==i?(a=(0,z.jsx)(_,{type:`button`,variant:`secondary`,onClick:i,children:s.logs.refresh}),t[15]=s.logs.refresh,t[16]=i,t[17]=a):a=t[17];let o;return t[18]!==n||t[19]!==a?(o=(0,z.jsxs)(P,{gap:`gap-3`,padding:`px-3 py-10 sm:px-5 xl:px-6`,children:[n,a]}),t[18]=n,t[19]=a,t[20]=o):o=t[20],o}let u;t[21]!==r.autosaveStatus||t[22]!==r.error?(u=(0,z.jsx)(ce,{status:r.autosaveStatus,error:r.error}),t[21]=r.autosaveStatus,t[22]=r.error,t[23]=u):u=t[23];let f;t[24]!==l||t[25]!==u?(f=(0,z.jsx)(N,{title:l,actions:u}),t[24]=l,t[25]=u,t[26]=f):f=t[26];let p;t[27]===r.error?p=t[28]:(p=r.error?(0,z.jsx)(`div`,{className:`rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/50 dark:text-red-400`,role:`alert`,children:r.error}):null,t[27]=r.error,t[28]=p);let h;t[29]===i?h=t[30]:(h=(0,z.jsx)(`div`,{className:`flex min-w-0 flex-col gap-5 pb-8`,children:i}),t[29]=i,t[30]=h);let g;return t[31]!==f||t[32]!==p||t[33]!==h||t[34]!==r.onBlurCapture?(g=(0,z.jsxs)(P,{gap:`gap-6`,onBlurCapture:r.onBlurCapture,children:[f,p,h]}),t[31]=f,t[32]=p,t[33]=h,t[34]=r.onBlurCapture,t[35]=g):g=t[35],g}function W(e){return e.language}var G={enabled:!0,driverKind:`extension`,headless:!1,executablePath:``,cdpEndpoint:`http://127.0.0.1:9222`,remoteProvider:`browserbase`,remoteApiKey:``,remoteProjectId:``,remoteRegion:``,maxNodes:180,maxCharacters:12e3,visualFallback:!0,actionTimeoutMs:3e4,sessionTimeoutMs:9e5,maxSequenceLength:5,allowedPrivateHosts:``,crossDomainNavigation:`allow`,uploads:`allow`,consequentialActions:`allow`};function K(e){let t=J(J(e).browser),n=J(t.driver),r=J(t.observation),i=J(t.limits),a=J(t.security),o=n.kind;return{...G,enabled:t.enabled!==!1,driverKind:o===`playwright`||o===`cdp`||o===`remote`?o:`extension`,headless:n.headless===!0,executablePath:Y(n.executablePath,``),cdpEndpoint:Y(n.endpoint,G.cdpEndpoint),remoteProvider:n.provider===`browser-use`?`browser-use`:`browserbase`,remoteApiKey:Y(n.apiKey,``),remoteProjectId:Y(n.projectId,``),remoteRegion:Y(n.region,``),maxNodes:X(r.maxNodes,G.maxNodes),maxCharacters:X(r.maxCharacters,G.maxCharacters),visualFallback:r.visualFallback!==!1,actionTimeoutMs:X(i.actionTimeoutMs,G.actionTimeoutMs),sessionTimeoutMs:X(i.sessionTimeoutMs,G.sessionTimeoutMs),maxSequenceLength:X(i.maxSequenceLength,G.maxSequenceLength),allowedPrivateHosts:Array.isArray(a.allowedPrivateHosts)?a.allowedPrivateHosts.filter(e=>typeof e==`string`).join(`
2
+ `):``,crossDomainNavigation:ge(a.crossDomainNavigation),uploads:ge(a.uploads),consequentialActions:ge(a.consequentialActions)}}function q(e){let t=e.driverKind===`extension`?{kind:`extension`}:e.driverKind===`playwright`?{kind:`playwright`,headless:e.headless,...e.executablePath.trim()?{executablePath:e.executablePath.trim()}:{}}:e.driverKind===`cdp`?{kind:`cdp`,endpoint:e.cdpEndpoint.trim()}:{kind:`remote`,provider:e.remoteProvider,...e.remoteApiKey.trim()?{apiKey:e.remoteApiKey.trim()}:{},...e.remoteProjectId.trim()?{projectId:e.remoteProjectId.trim()}:{},...e.remoteRegion.trim()?{region:e.remoteRegion.trim()}:{}};return{enabled:e.enabled,driver:t,observation:{maxNodes:e.maxNodes,maxCharacters:e.maxCharacters,visualFallback:e.visualFallback},limits:{actionTimeoutMs:e.actionTimeoutMs,sessionTimeoutMs:e.sessionTimeoutMs,maxSequenceLength:e.maxSequenceLength},security:{privateNetworks:`deny`,allowedPrivateHosts:e.allowedPrivateHosts.split(`
3
+ `).map(e=>e.trim()).filter(Boolean),crossDomainNavigation:e.crossDomainNavigation,uploads:e.uploads,consequentialActions:e.consequentialActions}}}function me(e){if(e.driverKind===`cdp`)try{let t=new URL(e.cdpEndpoint);if(t.protocol!==`http:`&&t.protocol!==`https:`&&t.protocol!==`ws:`&&t.protocol!==`wss:`)return`CDP endpoint must use http, https, ws, or wss.`}catch{return`Enter a valid CDP endpoint URL.`}return!Number.isInteger(e.maxNodes)||e.maxNodes<20||e.maxNodes>500?`Max nodes must be between 20 and 500.`:!Number.isInteger(e.maxCharacters)||e.maxCharacters<1e3||e.maxCharacters>5e4?`Max characters must be between 1,000 and 50,000.`:!Number.isInteger(e.actionTimeoutMs)||e.actionTimeoutMs<1e3||e.actionTimeoutMs>12e4?`Action timeout must be between 1,000 and 120,000 ms.`:!Number.isInteger(e.sessionTimeoutMs)||e.sessionTimeoutMs<6e4||e.sessionTimeoutMs>36e5?`Session timeout must be between 60,000 and 3,600,000 ms.`:!Number.isInteger(e.maxSequenceLength)||e.maxSequenceLength<1||e.maxSequenceLength>10?`Sequence length must be between 1 and 10.`:null}async function he(e){await f(h(`/api/config`),{method:`PATCH`,body:JSON.stringify({browser:q(e)})}),y()}function J(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function Y(e,t){return typeof e==`string`?e:t}function X(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function ge(e){return e===`deny`?`deny`:`allow`}var _e=ie();function ve(e){let t=!!p(e=>e.conversationId),[n,r]=(0,L.useReducer)(_e,{form:null,baseline:null}),i=n.form,a=n.baseline,o=(0,L.useRef)(!1),s=(0,L.useRef)(i);s.current=i;let c=(0,L.useRef)(null),{data:l,error:u,isLoading:d,mutate:f}=b(t);k({enabled:t,parsed:(0,L.useMemo)(()=>l?.payload?.config===void 0?null:K(l.payload.config),[l]),dirty:o.current,trackedParsedRef:c,dispatch:r,onResetDirty:()=>{o.current=!1}});let m=!!(t&&d&&l===void 0&&!u),h=u instanceof Error?u.message:u?String(u):null,g=(0,L.useMemo)(()=>!i||!a?!1:JSON.stringify(i)!==JSON.stringify(a),[i,a]),_=(0,L.useCallback)(e=>{o.current=!0,r({type:`patch`,patch:e})},[]),v=F({value:i,dirty:g,onSave:(0,L.useCallback)(async t=>{try{await he(t),r({type:`saved`,value:t}),o.current=!!(s.current&&JSON.stringify(s.current)!==JSON.stringify(t))}catch(t){throw Error(t instanceof Error?t.message:e.saveError)}},[e.saveError]),validate:me});return{hasToken:t,loading:m,fetchError:h,form:i,update:_,autosaveStatus:v.status,error:v.error,onBlurCapture:v.onBlurCapture,mutate:f}}var ye=[`extension`,`playwright`,`cdp`,`remote`];function be(){let e=(0,I.c)(29),t=m(xe),n;e[0]===t?n=e[1]:(n=d(t),e[0]=t,e[1]=n);let r=ve(n.agentSettings),i=r.form,s=t===`zh`,[c]=a(),l=(0,L.useRef)(!1),u;e[2]!==i||e[3]!==c||e[4]!==r?(u=()=>{if(!i||l.current)return;l.current=!0;let e=c.get(`driver`);ye.includes(e)&&e!==i.driverKind&&r.update({driverKind:e})},e[2]=i,e[3]=c,e[4]=r,e[5]=u):u=e[5];let f;e[6]!==i||e[7]!==c||e[8]!==r.update?(f=[i,c,r.update],e[6]=i,e[7]=c,e[8]=r.update,e[9]=f):f=e[9],(0,L.useEffect)(u,f);let p=s?`Chrome 扩展(推荐)`:`Chrome extension (recommended)`,h;e[10]===p?h=e[11]:(h={value:`extension`,label:p},e[10]=p,e[11]=h);let g;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(g={value:`playwright`,label:`Playwright Chromium`},e[12]=g):g=e[12];let _=s?`CDP 已有浏览器`:`Existing browser over CDP`,v;e[13]===_?v=e[14]:(v={value:`cdp`,label:_},e[13]=_,e[14]=v);let y=s?`远程浏览器`:`Remote browser`,b;e[15]===y?b=e[16]:(b={value:`remote`,label:y},e[15]=y,e[16]=b);let x;e[17]!==h||e[18]!==v||e[19]!==b?(x=[h,g,v,b],e[17]=h,e[18]=v,e[19]=b,e[20]=x):x=e[20];let S=x,C;e[21]!==S||e[22]!==i||e[23]!==r||e[24]!==s?(C=i?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(le,{enabled:i.enabled,driverKind:i.driverKind,autosaveStatus:r.autosaveStatus,zh:s}),(0,z.jsxs)(Ce,{title:s?`运行方式`:`Connection`,icon:(0,z.jsx)(j,{className:`size-4`}),children:[(0,z.jsx)(we,{label:s?`启用浏览器控制`:`Enable browser control`,checked:i.enabled,onChange:e=>r.update({enabled:e})}),(0,z.jsx)(Z,{label:s?`浏览器连接`:`Browser connection`,children:(0,z.jsx)(o,{value:i.driverKind,options:S,placeholder:s?`选择连接方式`:`Choose a connection`,allowEmpty:!1,onChange:e=>r.update({driverKind:e})})}),(0,z.jsx)(Se,{kind:i.driverKind,zh:s}),i.driverKind===`playwright`?(0,z.jsxs)(`div`,{className:`space-y-4 rounded-lg bg-surface-inset p-4`,children:[(0,z.jsx)(we,{label:s?`无头模式`:`Headless mode`,description:s?`后台运行,不显示浏览器窗口。关闭后可观察智能体的操作过程。`:`Run in the background without a visible window. Turn off to watch the agent work.`,checked:i.headless,onChange:e=>r.update({headless:e})}),(0,z.jsx)(w,{title:s?`自定义 Chromium`:`Custom Chromium`,summary:i.executablePath||(s?`使用 xopc 安装的 Chromium`:`Use Chromium installed by xopc`),children:(0,z.jsx)(Q,{label:s?`Chromium 可执行文件(可选)`:`Chromium executable (optional)`,description:s?`留空时使用由 xopc 安装的 Chromium。`:`Leave empty to use Chromium installed by xopc.`,value:i.executablePath,onChange:e=>r.update({executablePath:e})})})]}):null,i.driverKind===`cdp`?(0,z.jsx)(`div`,{className:`rounded-lg bg-surface-inset p-4`,children:(0,z.jsx)(Q,{label:`CDP endpoint`,description:s?`例如 http://127.0.0.1:9222。Chrome 需要开启 remote debugging。`:`For example http://127.0.0.1:9222. Chrome must be started with remote debugging enabled.`,value:i.cdpEndpoint,onChange:e=>r.update({cdpEndpoint:e})})}):null,i.driverKind===`remote`?(0,z.jsxs)(`div`,{className:`space-y-4 rounded-lg bg-surface-inset p-4`,children:[(0,z.jsx)(Z,{label:s?`服务商`:`Provider`,children:(0,z.jsx)(o,{value:i.remoteProvider,options:[{value:`browserbase`,label:`Browserbase`},{value:`browser-use`,label:`Browser Use`}],placeholder:s?`选择服务商`:`Choose a provider`,allowEmpty:!1,onChange:e=>r.update({remoteProvider:e})})}),(0,z.jsx)(Q,{label:`API key`,type:`password`,autoComplete:`off`,value:i.remoteApiKey,onChange:e=>r.update({remoteApiKey:e})}),(0,z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,z.jsx)(Q,{label:`Project ID`,value:i.remoteProjectId,onChange:e=>r.update({remoteProjectId:e})}),(0,z.jsx)(Q,{label:`Region`,value:i.remoteRegion,onChange:e=>r.update({remoteRegion:e})})]})]}):null]}),(0,z.jsx)(w,{title:s?`页面理解与执行限制`:`Observation and execution limits`,summary:s?`当前截图、页面大小和超时策略继续生效。`:`Current screenshot, page size and timeout policies remain active.`,children:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Ce,{title:s?`页面理解`:`Page understanding`,icon:(0,z.jsx)(A,{className:`size-4`}),children:[(0,z.jsx)(we,{label:s?`需要时附加截图`:`Attach screenshots when needed`,checked:i.visualFallback,onChange:e=>r.update({visualFallback:e})}),(0,z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,z.jsx)($,{label:s?`语义节点上限`:`Semantic node limit`,description:`20–500`,min:20,max:500,value:i.maxNodes,onChange:e=>r.update({maxNodes:e})}),(0,z.jsx)($,{label:s?`文本字符上限`:`Text character limit`,description:`1,000–50,000`,min:1e3,max:5e4,step:1e3,value:i.maxCharacters,onChange:e=>r.update({maxCharacters:e})})]})]}),(0,z.jsx)(Ce,{title:s?`执行限制`:`Execution limits`,icon:(0,z.jsx)(O,{className:`size-4`}),children:(0,z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,z.jsx)($,{label:s?`操作超时(毫秒)`:`Action timeout (ms)`,min:1e3,max:12e4,step:1e3,value:i.actionTimeoutMs,onChange:e=>r.update({actionTimeoutMs:e})}),(0,z.jsx)($,{label:s?`会话超时(毫秒)`:`Session timeout (ms)`,min:6e4,max:36e5,step:6e4,value:i.sessionTimeoutMs,onChange:e=>r.update({sessionTimeoutMs:e})}),(0,z.jsx)($,{label:s?`批量步骤上限`:`Sequence step limit`,min:1,max:10,value:i.maxSequenceLength,onChange:e=>r.update({maxSequenceLength:e})})]})})]})}),(0,z.jsxs)(Ce,{title:s?`访问策略`:`Access policies`,icon:(0,z.jsx)(ee,{className:`size-4`}),children:[(0,z.jsx)(w,{title:s?`私网访问例外`:`Private network exceptions`,summary:i.allowedPrivateHosts||(s?`未设置私网例外`:`No private network exceptions`),children:(0,z.jsx)(Q,{label:s?`允许访问的私网主机`:`Allowed private hosts`,description:s?`每行一个主机名或 IP,不支持通配符。`:`One hostname or IP per line. Wildcards are not supported.`,multiline:!0,value:i.allowedPrivateHosts,onChange:e=>r.update({allowedPrivateHosts:e})})}),(0,z.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,z.jsx)(Te,{zh:s,label:s?`跨域导航`:`Cross-domain navigation`,value:i.crossDomainNavigation,onChange:e=>r.update({crossDomainNavigation:e})}),(0,z.jsx)(Te,{zh:s,label:s?`高影响动作`:`Consequential actions`,value:i.consequentialActions,onChange:e=>r.update({consequentialActions:e})}),(0,z.jsx)(Te,{zh:s,label:s?`文件上传`:`File uploads`,value:i.uploads,onChange:e=>r.update({uploads:e})})]})]})]}):null,e[21]=S,e[22]=i,e[23]=r,e[24]=s,e[25]=C):C=e[25];let T;return e[26]!==C||e[27]!==r?(T=(0,z.jsx)(pe,{sectionId:`agent-browser`,vm:r,children:C}),e[26]=C,e[27]=r,e[28]=T):T=e[28],T}function xe(e){return e.language}function Se(e){let t=(0,I.c)(7),{kind:n,zh:r}=e,i=r?`直接操作你正在使用的 Chrome,保留登录状态和现有标签页;最适合日常协作。`:`Operate your current Chrome with its signed-in state and existing tabs; best for daily collaboration.`,a=r?`由 xopc 启动独立 Chromium,环境隔离、自动化稳定,适合无人值守任务。`:`Let xopc launch an isolated Chromium; stable for unattended automation.`,o=r?`连接已开启远程调试的 Chrome 或 Chromium,适合自定义浏览器启动方式。`:`Connect to Chrome or Chromium already running with remote debugging.`,s=r?`使用 Browserbase 或 Browser Use 的云端浏览器,适合服务器环境和长任务。`:`Use a Browserbase or Browser Use cloud browser for servers and long-running tasks.`,c;t[0]!==i||t[1]!==a||t[2]!==o||t[3]!==s?(c={extension:i,playwright:a,cdp:o,remote:s},t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c):c=t[4];let l=c[n],u;return t[5]===l?u=t[6]:(u=(0,z.jsx)(`p`,{className:`rounded-lg bg-surface-inset px-3 py-2 text-xs leading-5 text-fg-muted`,children:l}),t[5]=l,t[6]=u),u}function Ce(e){let t=(0,I.c)(17),{title:n,description:r,icon:i,children:a}=e,o;t[0]===i?o=t[1]:(o=(0,z.jsx)(`span`,{className:`mt-0.5 text-fg-subtle`,children:i}),t[0]=i,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),t[2]=n,t[3]=s);let c;t[4]===r?c=t[5]:(c=r?(0,z.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r}):null,t[4]=r,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,z.jsxs)(`div`,{children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==o||t[10]!==l?(u=(0,z.jsxs)(`div`,{className:`mb-4 flex items-start gap-2`,children:[o,l]}),t[9]=o,t[10]=l,t[11]=u):u=t[11];let d;t[12]===a?d=t[13]:(d=(0,z.jsx)(`div`,{className:`space-y-4`,children:a}),t[12]=a,t[13]=d);let f;return t[14]!==u||t[15]!==d?(f=(0,z.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[u,d]}),t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function Z(e){let t=(0,I.c)(8),{label:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,z.jsx)(`span`,{className:`mb-1.5 block font-medium`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,z.jsx)(`span`,{className:`mt-1.5 block text-xs leading-5 text-fg-subtle`,children:r}):null,t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,z.jsxs)(`label`,{className:`block text-sm text-fg`,children:[a,i,o]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Q(e){let t=(0,I.c)(10),{label:n,description:r,value:i,onChange:a,type:o,multiline:s,autoComplete:c}=e,l=o===void 0?`text`:o,u=s===void 0?!1:s,d;t[0]!==c||t[1]!==u||t[2]!==a||t[3]!==l||t[4]!==i?(d=u?(0,z.jsx)(`textarea`,{rows:3,value:i,onChange:e=>a(e.target.value),className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg outline-none focus:border-accent`}):(0,z.jsx)(`input`,{type:l,autoComplete:c,value:i,onChange:e=>a(e.target.value),className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg outline-none focus:border-accent`}),t[0]=c,t[1]=u,t[2]=a,t[3]=l,t[4]=i,t[5]=d):d=t[5];let f;return t[6]!==r||t[7]!==n||t[8]!==d?(f=(0,z.jsx)(Z,{label:n,description:r,children:d}),t[6]=r,t[7]=n,t[8]=d,t[9]=f):f=t[9],f}function $(e){let t=(0,I.c)(12),{label:n,description:r,value:i,onChange:a,min:o,max:s,step:c}=e,l=c===void 0?1:c,u;t[0]===a?u=t[1]:(u=e=>{let t=Number(e.target.value);Number.isFinite(t)&&a(t)},t[0]=a,t[1]=u);let d;t[2]!==s||t[3]!==o||t[4]!==l||t[5]!==u||t[6]!==i?(d=(0,z.jsx)(se,{type:`number`,min:o,max:s,step:l,value:i,onChange:u,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-sm text-fg outline-none focus:border-accent`}),t[2]=s,t[3]=o,t[4]=l,t[5]=u,t[6]=i,t[7]=d):d=t[7];let f;return t[8]!==r||t[9]!==n||t[10]!==d?(f=(0,z.jsx)(Z,{label:n,description:r,children:d}),t[8]=r,t[9]=n,t[10]=d,t[11]=f):f=t[11],f}function we(e){let t=(0,I.c)(15),{label:n,description:r,checked:i,onChange:a}=e,o;t[0]===a?o=t[1]:(o=e=>a(e.target.checked),t[0]=a,t[1]=o);let s;t[2]!==i||t[3]!==o?(s=(0,z.jsx)(`input`,{type:`checkbox`,checked:i,onChange:o,className:`mt-0.5 size-4 accent-accent`}),t[2]=i,t[3]=o,t[4]=s):s=t[4];let c;t[5]===n?c=t[6]:(c=(0,z.jsx)(`span`,{className:`block font-medium`,children:n}),t[5]=n,t[6]=c);let l;t[7]===r?l=t[8]:(l=r?(0,z.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-subtle`,children:r}):null,t[7]=r,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,z.jsxs)(`span`,{children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==s||t[13]!==u?(d=(0,z.jsxs)(`label`,{className:`flex items-start gap-3 text-sm text-fg`,children:[s,u]}),t[12]=s,t[13]=u,t[14]=d):d=t[14],d}function Te(e){let t=(0,I.c)(17),{zh:n,label:r,value:i,onChange:a}=e,s=n?`允许`:`Allow`,c;t[0]===s?c=t[1]:(c={value:`allow`,label:s},t[0]=s,t[1]=c);let l=n?`拒绝`:`Deny`,u;t[2]===l?u=t[3]:(u={value:`deny`,label:l},t[2]=l,t[3]=u);let d;t[4]!==c||t[5]!==u?(d=[c,u],t[4]=c,t[5]=u,t[6]=d):d=t[6];let f=d,p=n?`选择策略`:`Choose a policy`,m;t[7]===a?m=t[8]:(m=e=>a(e),t[7]=a,t[8]=m);let h;t[9]!==f||t[10]!==p||t[11]!==m||t[12]!==i?(h=(0,z.jsx)(o,{value:i,options:f,placeholder:p,allowEmpty:!1,onChange:m}),t[9]=f,t[10]=p,t[11]=m,t[12]=i,t[13]=h):h=t[13];let g;return t[14]!==r||t[15]!==h?(g=(0,z.jsx)(Z,{label:r,children:h}),t[14]=r,t[15]=h,t[16]=g):g=t[16],g}export{be as AgentBrowserSettingsPage};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./cn-0WouolD0.js";import{t as i}from"./dist-CxGUk8J-.js";var a=t();e();var o=n(),s={primary:`bg-accent text-on-accent shadow-none sm:shadow-surface hover:bg-accent-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`,secondary:`bg-surface-panel text-fg border border-edge shadow-none sm:shadow-surface hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel dark:border-edge`,ghost:`text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,segmented:``};function c(e){let t=(0,a.c)(16),n,c,l,u,d,f;t[0]===e?(n=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6]):({className:n,variant:u,asChild:d,type:f,ref:l,...c}=e,t[0]=e,t[1]=n,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f);let p=u===void 0?`secondary`:u,m=d===void 0?!1:d,h=f===void 0?`button`:f,g=m?i:`button`,_=m?void 0:h,v=s[p],y;t[7]!==n||t[8]!==v?(y=r(`touch-target inline-flex items-center justify-center gap-2 rounded-xl px-3 py-2 text-sm font-medium`,`transition-colors duration-150 ease-out transition-transform`,`active:scale-[0.98] motion-reduce:transition-none motion-reduce:active:scale-100`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,v,n),t[7]=n,t[8]=v,t[9]=y):y=t[9];let b;return t[10]!==g||t[11]!==c||t[12]!==l||t[13]!==_||t[14]!==y?(b=(0,o.jsx)(g,{ref:l,type:_,className:y,...c}),t[10]=g,t[11]=c,t[12]=l,t[13]=_,t[14]=y,t[15]=b):b=t[15],b}export{c as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/skills-page-XhCLHKlK.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-D2hEKnTM.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/middleware-Pd0e8Igk.js","assets/locale-store-D_migb9R.js","assets/messages-D__oW2yE.js","assets/dist-CI_fqRk-.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-Ljt0bhfF.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-B2HK1psj.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/mermaid-render-604gISVe.js","assets/xml-_d7dTN2Q.js","assets/app-link-BV_eGr7l.js","assets/product-delivery-DwmnNJvk.js","assets/schemas-CObaziC7.js","assets/local-apps-yys1VChX.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-ixUWAmoy.css","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/popover-select-DGKUpVsz.js","assets/dist-C3DSFZCi.js","assets/skeleton-BI5TyibZ.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/external-link-DjqjBmc3.js","assets/file-archive-DanfQJNe.js","assets/file-braces-BoAMI_k9.js","assets/globe-DSSGFWFn.js","assets/loader-circle-CifKLtgG.js","assets/session-manager-D2sLfkw-.js","assets/gateway-realtime-CP6L2jIR.js","assets/gateway-realtime-store-yXB4a40_.js","assets/local-session-drafts-TqLFKwYo.js","assets/session-api-aQLptIs9.js","assets/gateway-startup-retry-DD2fsxdd.js","assets/personal-proactivity-BJcZ3Yhi.js","assets/constants-DeXt1mV-.js","assets/tool-activity-BtJkgjFf.js","assets/registry-api-4NZOh0iz.js","assets/attachment-utils-core-BIOUBrpT.js","assets/agents-admin-api-D0UyB0Y_.js","assets/gateway-config-swr-CTXr917C.js","assets/capabilities-CD6PzNK7.js","assets/tasks-B4bZpO6O.js","assets/specialists-4bkS5rZ4.js","assets/button-aIC072nz.js","assets/sliding-indicator-hwz0sx3h.js","assets/index-SmKNPEmJ.css","assets/capability-header-actions-yfPUz5Wt.js","assets/skill-api-CyO89DKl.js","assets/skill-reload-api-Drg356Pb.js","assets/connectors-page-Da_M7h3m.js","assets/number-input-DDeqHK-G.js","assets/connector-service-page-B1oJCj74.js","assets/plugin-details-dialog-BjzIp3T5.js","assets/plugin-presentation-CO5BFDGW.js","assets/apps-page-BfVMfjkC.js","assets/agents-C1rSl_yE.js","assets/directory-picker-path-field-CwT1LcLR.js","assets/image-generation-api-BfPYnMoc.js","assets/settings-page-layout-Dx5S-Msc.js","assets/channels-Cp4F9zPz.js","assets/schema-form-vbhv4JE6.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{f as a,g as o,m as s,r as c,t as l}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as ee}from"./messages-D__oW2yE.js";import{n as te}from"./locale-store-D_migb9R.js";import{t as u}from"./skeleton-BI5TyibZ.js";import{hl as d,ml as f,os as p,st as m}from"./index-D2hEKnTM.js";import{t as ne}from"./capability-header-actions-yfPUz5Wt.js";var h=n(),g=r();function re(e){let t=(0,h.c)(11),{section:n,zh:r}=e,i;t[0]!==n||t[1]!==r?(i=n===`skills`?{text:r?`查看 Agent 可使用的技能。插件附带的技能由所属插件统一更新和卸载。`:`Browse skills available to agents. Skills included in a plugin are updated and removed with that plugin.`,href:`/capabilities/extensions?tab=user`,label:r?`管理插件`:`Manage plugins`}:n===`connectors`?{text:r?`管理账号连接与授权。插件提供的账号统一在插件详情中连接。`:`Manage accounts and authorization. Connect plugin accounts from their plugin details.`,href:`/capabilities/extensions?tab=marketplace`,label:r?`发现更多插件`:`Discover plugins`}:n===`extensions`?{text:r?`安装和管理整套能力,包括技能、工具与账号连接。默认供所有 Agent 使用。`:`Install and manage skills, tools and account connections together. Available to all agents by default.`,href:`/capabilities/connectors?tab=connected`,label:r?`查看账号连接`:`View connections`}:null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let a=i;if(!a)return null;let o;t[3]===a.text?o=t[4]:(o=(0,g.jsx)(`p`,{className:`text-fg-muted`,children:a.text}),t[3]=a.text,t[4]=o);let s;t[5]!==a.href||t[6]!==a.label?(s=(0,g.jsx)(l,{className:`rounded text-accent hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,to:a.href,children:a.label}),t[5]=a.href,t[6]=a.label,t[7]=s):s=t[7];let c;return t[8]!==o||t[9]!==s?(c=(0,g.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-wrap items-center gap-x-3 gap-y-1 px-4 pb-1 pt-3 text-xs leading-5 sm:px-6 lg:px-8`,children:[o,s]}),t[8]=o,t[9]=s,t[10]=c):c=t[10],c}var _=e(t(),1),ie=(0,_.lazy)(()=>i(()=>import(`./skills-page-XhCLHKlK.js`).then(e=>({default:e.SkillsPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64]))),ae=(0,_.lazy)(()=>i(()=>import(`./connectors-page-Da_M7h3m.js`).then(e=>({default:e.ConnectorsPage})),__vite__mapDeps([65,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,66,62,67]))),oe=(0,_.lazy)(()=>i(()=>import(`./plugin-details-dialog-BjzIp3T5.js`).then(e=>({default:e.PluginDetailsDialog})),__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,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,69]))),se=(0,_.lazy)(()=>i(()=>import(`./apps-page-BfVMfjkC.js`).then(e=>({default:e.ExtensionsPage})),__vite__mapDeps([70,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,69]))),ce=(0,_.lazy)(()=>i(()=>import(`./agents-C1rSl_yE.js`).then(e=>({default:e.AgentsSettingsPanel})),__vite__mapDeps([71,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,66,72,73,74]))),v=(0,_.lazy)(()=>i(()=>import(`./channels-Cp4F9zPz.js`).then(e=>({default:e.ChannelsSettingsPanel})),__vite__mapDeps([75,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,76,66,74])));function y(e){return f.includes(e)?e:null}function b(e){let t=(0,h.c)(3),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Array.from({length:6},x),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,g.jsx)(`div`,{className:`mx-auto grid w-full max-w-7xl gap-4 px-4 pb-7 pt-3 sm:grid-cols-2 sm:px-6 lg:grid-cols-3 lg:px-8 lg:pb-9 lg:pt-4`,"aria-label":n,"aria-busy":!0,children:r}),t[1]=n,t[2]=i),i}function x(e,t){return(0,g.jsx)(u,{className:`h-40 rounded-xl`},t)}function S(){let e=(0,h.c)(70),t=te(T),n;e[0]===t?n=e[1]:(n=ee(t),e[0]=t,e[1]=n);let r=n,i=r.capabilitiesHub,{section:l,detailId:u}=s(),[x]=o(),S=a(),E;e[2]===x?E=e[3]:(E=x.get(`plugin`),e[2]=x,e[3]=E);let D=E,O;e[4]!==S||e[5]!==x?(O=()=>{let e=new URLSearchParams(x);e.delete(`plugin`),e.delete(`connect`),S({search:e.toString()},{replace:!0,preventScrollReset:!0})},e[4]=S,e[5]=x,e[6]=O):O=e[6];let k=O,A;e[7]===l?A=e[8]:(A=y(l),e[7]=l,e[8]=A);let j=A,M=j??f[0],N=r.productNavigation.sections[`capabilities-${M}`],P=p(w),F=p(C),I;e[9]===M?I=e[10]:(I={section:M,value:null},e[9]=M,e[10]=I);let[L,R]=(0,_.useState)(I),z=M===`extensions`&&u?null:L.section===M?L.value:null,B;e[11]===M?B=e[12]:(B=e=>{R({section:M,value:e})},e[11]=M,e[12]=B);let V=B,H,U;if(e[13]!==F||e[14]!==z||e[15]!==N||e[16]!==P?(H=()=>(P({startExtra:null,main:(0,g.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:N}),end:(0,g.jsx)(ne,{contribution:z})}),()=>F()),U=[F,z,N,P],e[13]=F,e[14]=z,e[15]=N,e[16]=P,e[17]=H,e[18]=U):(H=e[17],U=e[18]),(0,_.useLayoutEffect)(H,U),M===`extensions`&&u){let t;e[19]===x?t=e[20]:(t=x.get(`from`)===`connections`?`connections`:x.get(`from`)===`skills`?`skills`:`installed`,e[19]=x,e[20]=t);let n;e[21]===x?n=e[22]:(n=x.get(`connect`),e[21]=x,e[22]=n);let r=n===`1`,i;e[23]!==u||e[24]!==x||e[25]!==r||e[26]!==t?(i=m(u,t,r,x.get(`returnTo`)??void 0),e[23]=u,e[24]=x,e[25]=r,e[26]=t,e[27]=i):i=e[27];let a;return e[28]===i?a=e[29]:(a=(0,g.jsx)(c,{replace:!0,to:i}),e[28]=i,e[29]=a),a}if(!j){let t;return e[30]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,g.jsx)(c,{to:d(f[0]),replace:!0}),e[30]=t):t=e[30],t}let W;e[31]!==u||e[32]!==t||e[33]!==M?(W=u?null:(0,g.jsx)(re,{section:M,zh:t.startsWith(`zh`)}),e[31]=u,e[32]=t,e[33]=M,e[34]=W):W=e[34];let G;e[35]===i.discoverLoading?G=e[36]:(G=(0,g.jsx)(b,{label:i.discoverLoading}),e[35]=i.discoverLoading,e[36]=G);let K;e[37]!==u||e[38]!==V||e[39]!==M?(K=M===`agents`?(0,g.jsx)(ce,{agentId:u,onHeaderActionChange:V}):null,e[37]=u,e[38]=V,e[39]=M,e[40]=K):K=e[40];let q;e[41]!==V||e[42]!==M?(q=M===`skills`?(0,g.jsx)(ie,{embedded:!0,onHeaderActionChange:V}):null,e[41]=V,e[42]=M,e[43]=q):q=e[43];let J;e[44]!==V||e[45]!==M?(J=M===`connectors`?(0,g.jsx)(ae,{embedded:!0,onHeaderActionChange:V}):null,e[44]=V,e[45]=M,e[46]=J):J=e[46];let Y;e[47]!==u||e[48]!==V||e[49]!==M?(Y=M===`channels`?(0,g.jsx)(v,{channelId:u,onHeaderActionChange:V}):null,e[47]=u,e[48]=V,e[49]=M,e[50]=Y):Y=e[50];let X;e[51]!==V||e[52]!==M?(X=M===`extensions`?(0,g.jsx)(se,{embedded:!0,onHeaderActionChange:V}):null,e[51]=V,e[52]=M,e[53]=X):X=e[53];let Z;e[54]!==M||e[55]!==K||e[56]!==q||e[57]!==J||e[58]!==Y||e[59]!==X||e[60]!==G?(Z=(0,g.jsxs)(_.Suspense,{fallback:G,children:[K,q,J,Y,X]},M),e[54]=M,e[55]=K,e[56]=q,e[57]=J,e[58]=Y,e[59]=X,e[60]=G,e[61]=Z):Z=e[61];let Q;e[62]!==k||e[63]!==D||e[64]!==x?(Q=D?(0,g.jsx)(_.Suspense,{fallback:null,children:(0,g.jsx)(oe,{pluginId:D,initialConnect:x.get(`connect`)===`1`,onClose:k},D)}):null,e[62]=k,e[63]=D,e[64]=x,e[65]=Q):Q=e[65];let $;return e[66]!==Z||e[67]!==Q||e[68]!==W?($=(0,g.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[W,Z,Q]}),e[66]=Z,e[67]=Q,e[68]=W,e[69]=$):$=e[69],$}function C(e){return e.clearPageHeader}function w(e){return e.setPageHeader}function T(e){return e.language}export{S as CapabilitiesPage};