@xopcai/xopc 0.0.330 → 0.0.332

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 (166) 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-BDG0hI-J.js → agent-avatar-dicebear-C2wg3xC_.js} +1 -1
  4. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Se1Z72VG.js +1 -0
  5. package/dist/gateway/static/root/assets/{agent-plugin-dialog-BX_Bhre1.js → agent-plugin-dialog-BeNnu1Ts.js} +1 -1
  6. package/dist/gateway/static/root/assets/agents-udIitwV8.js +70 -0
  7. package/dist/gateway/static/root/assets/{app-management-settings-panel-DgttzUCG.js → app-management-settings-panel-etFSkfzl.js} +1 -1
  8. package/dist/gateway/static/root/assets/{appearance-settings-CHpyWV8Z.js → appearance-settings-DKmU2VAP.js} +1 -1
  9. package/dist/gateway/static/root/assets/apps-page-DVNySL58.js +1 -0
  10. package/dist/gateway/static/root/assets/{archive-plugin-B7Q7Oeo7.js → archive-plugin-D0z_Fr2G.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-BYwqQ8qN.js → attachment-load-DNCDbeOX.js} +1 -1
  12. package/dist/gateway/static/root/assets/{automations-page-CsvAtTNd.js → automations-page-B7_C-p66.js} +1 -1
  13. package/dist/gateway/static/root/assets/automations-workspace-BMgJvdcv.js +7 -0
  14. package/dist/gateway/static/root/assets/{binary-plugins-DdgWCI-M.js → binary-plugins-BYn2hScX.js} +1 -1
  15. package/dist/gateway/static/root/assets/{block-editor-DyOagNnn.js → block-editor-ChWW8Z9L.js} +3 -3
  16. package/dist/gateway/static/root/assets/{browser-automation-inputs-CwF8OQFN.js → browser-automation-inputs-C5s1yHOu.js} +1 -1
  17. package/dist/gateway/static/root/assets/{browser-automations-page-D_EQjiiu.js → browser-automations-page-BV00BXRb.js} +2 -2
  18. package/dist/gateway/static/root/assets/browser-settings-page-xwTmuZjS.js +3 -0
  19. package/dist/gateway/static/root/assets/capabilities-CHA-sTAZ.js +1 -0
  20. package/dist/gateway/static/root/assets/capabilities-page-v0WkhV5o.js +2 -0
  21. package/dist/gateway/static/root/assets/capabilities-settings-panel-DefBGjhV.js +8 -0
  22. package/dist/gateway/static/root/assets/{capability-header-actions-C5F2GNE9.js → capability-header-actions-vmx35sbu.js} +1 -1
  23. package/dist/gateway/static/root/assets/channels-Eo4ONF5X.js +1 -0
  24. package/dist/gateway/static/root/assets/{chat-terminal-dock-C6tl9Rfw.js → chat-terminal-dock-C41mXCAi.js} +1 -1
  25. package/dist/gateway/static/root/assets/{computer-settings-page-C0MsVw4l.js → computer-settings-page-BJkqok2G.js} +1 -1
  26. package/dist/gateway/static/root/assets/{connector-service-page-DsF60pPs.js → connector-service-page-BKCZMmwm.js} +1 -1
  27. package/dist/gateway/static/root/assets/connectors-page-DZYgogQw.js +2 -0
  28. package/dist/gateway/static/root/assets/{date-picker-CELKKqYN.js → date-picker-CrOV4Ynd.js} +1 -1
  29. package/dist/gateway/static/root/assets/{dependency-picker-BcEwCnI5.js → dependency-picker-CqADAHZp.js} +1 -1
  30. package/dist/gateway/static/root/assets/{desktop-pet-Ww7Gm8-x.js → desktop-pet-Bab-iWED.js} +1 -1
  31. package/dist/gateway/static/root/assets/{desktop-pet-settings-D-dbAxGu.js → desktop-pet-settings-BqgzLOdi.js} +1 -1
  32. package/dist/gateway/static/root/assets/{device-pairing-wizard-DsYY6szg.js → device-pairing-wizard-DFg7FDPf.js} +1 -1
  33. package/dist/gateway/static/root/assets/{directory-picker-path-field-CVmuCRyO.js → directory-picker-path-field-hqJ9sFCR.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-debug-page-UUHNJj-d.js → extension-debug-page-DX3PFhRE.js} +1 -1
  35. package/dist/gateway/static/root/assets/{extension-page-BvL452mX.js → extension-page-DkREdHLs.js} +1 -1
  36. package/dist/gateway/static/root/assets/{extension-settings-page-CrNnUSOs.js → extension-settings-page-wF-HNTM-.js} +1 -1
  37. package/dist/gateway/static/root/assets/{gateway-config-swr-DMm1vU51.js → gateway-config-swr-cR-tz7-Q.js} +1 -1
  38. package/dist/gateway/static/root/assets/gateway-settings-Du-Dos9O.js +1 -0
  39. package/dist/gateway/static/root/assets/{gateway-startup-retry-Ck6tj6yE.js → gateway-startup-retry-6jLRcQsu.js} +1 -1
  40. package/dist/gateway/static/root/assets/home-page-D7YoMHq4.js +1 -0
  41. package/dist/gateway/static/root/assets/{image-generation-api-BOh6j0BF.js → image-generation-api-CSSkwsyC.js} +1 -1
  42. package/dist/gateway/static/root/assets/{imports-page-BuqdzA7h.js → imports-page-B80Cv043.js} +1 -1
  43. package/dist/gateway/static/root/assets/index-BEw0xrde.css +1 -0
  44. package/dist/gateway/static/root/assets/index-DalslRUx.js +121 -0
  45. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D9L7IdUg.js → keyboard-shortcuts-settings-BgoFaTwv.js} +1 -1
  46. package/dist/gateway/static/root/assets/local-app-workbench-page-BKL5UZAj.js +1 -0
  47. package/dist/gateway/static/root/assets/local-apps-page-HO6OQlQT.js +1 -0
  48. package/dist/gateway/static/root/assets/{locale-store-DAOwT3Zp.js → locale-store-wNXWkWu5.js} +1 -1
  49. package/dist/gateway/static/root/assets/logs-page-CjzR9Rpj.js +2 -0
  50. package/dist/gateway/static/root/assets/management-settings-Dk_gTJb9.js +1 -0
  51. package/dist/gateway/static/root/assets/{markdown-view-nL4xzvI8.js → markdown-view-DlT9KqwF.js} +1 -1
  52. package/dist/gateway/static/root/assets/{media-plugins-dHbcqMan.js → media-plugins-Dlj6TD3M.js} +1 -1
  53. package/dist/gateway/static/root/assets/messages-fmf0dnr4.js +3 -0
  54. package/dist/gateway/static/root/assets/note-detail-panel-BebJPjjk.js +5 -0
  55. package/dist/gateway/static/root/assets/notes-page-CmS_hvz8.js +8 -0
  56. package/dist/gateway/static/root/assets/{page-context-capture-button-BKsMcPOy.js → page-context-capture-button-BArPtqp5.js} +1 -1
  57. package/dist/gateway/static/root/assets/page-tabs-vqI30Yrg.js +1 -0
  58. package/dist/gateway/static/root/assets/{preview-open-alternatives-Du18QgWc.js → preview-open-alternatives-B-mwPBJW.js} +1 -1
  59. package/dist/gateway/static/root/assets/product-open-page-D--sj_uN.js +1 -0
  60. package/dist/gateway/static/root/assets/project-detail-page-BFUdtWXF.js +1 -0
  61. package/dist/gateway/static/root/assets/{projects-page-BdYbDNUn.js → projects-page-DBsBwAQ6.js} +1 -1
  62. package/dist/gateway/static/root/assets/{registry-api-DCFXWBOt.js → registry-api-BIpltJ47.js} +1 -1
  63. package/dist/gateway/static/root/assets/remote-access-hub-BurdDY0m.js +1 -0
  64. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CuTFmXyj.js → runtime-tools-settings-panel-CAnb0PNY.js} +1 -1
  65. package/dist/gateway/static/root/assets/scenes-page-Cj8xtr5t.js +2 -0
  66. package/dist/gateway/static/root/assets/{schema-form-qWQii8IU.js → schema-form-BKj6wIMb.js} +1 -1
  67. package/dist/gateway/static/root/assets/sessions-page-BCsjgkCs.js +1 -0
  68. package/dist/gateway/static/root/assets/settings-advanced-gate-BLL7csOJ.js +1 -0
  69. package/dist/gateway/static/root/assets/{settings-form-section-B0ZBr0L9.js → settings-form-section-78ycUHfv.js} +1 -1
  70. package/dist/gateway/static/root/assets/{settings-page-DpII4NO3.js → settings-page-BOdxIVzo.js} +1 -1
  71. package/dist/gateway/static/root/assets/setup-status-panel-CbKHBjrU.js +1 -0
  72. package/dist/gateway/static/root/assets/{share-preview-page-B2CGYZHc.js → share-preview-page-DyLfktib.js} +1 -1
  73. package/dist/gateway/static/root/assets/shares-settings-BzvSNouj.js +1 -0
  74. package/dist/gateway/static/root/assets/{skill-api-_ddww47C.js → skill-api-CiBGQ0Jg.js} +1 -1
  75. package/dist/gateway/static/root/assets/skill-reload-api-BHnru0F5.js +1 -0
  76. package/dist/gateway/static/root/assets/skills-page-C35VKjhb.js +2 -0
  77. package/dist/gateway/static/root/assets/{system-settings-panel-25ABVt7H.js → system-settings-panel-CyJUeREH.js} +1 -1
  78. package/dist/gateway/static/root/assets/task-detail-page-Bd1_Fguk.js +1 -0
  79. package/dist/gateway/static/root/assets/{tunnel-api-CwQGBI_4.js → tunnel-api-Day9zhKi.js} +1 -1
  80. package/dist/gateway/static/root/assets/{use-autosave-CL3wytbs.js → use-autosave-Bj9hC6ML.js} +1 -1
  81. package/dist/gateway/static/root/assets/user-model-page-DuYzuR1T.js +2 -0
  82. package/dist/gateway/static/root/assets/{voice-api-key-field-zjAzQrx4.js → voice-api-key-field-fWRD6B8r.js} +1 -1
  83. package/dist/gateway/static/root/assets/{voice-config-api-DvzQ-128.js → voice-config-api-ujEySjyc.js} +1 -1
  84. package/dist/gateway/static/root/assets/{work-discovery-overlay-MaPPjWwl.js → work-discovery-overlay-CnxdvIk8.js} +1 -1
  85. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-C3dQN1fE.js → workflow-run-setup-panel-DlWNN1VA.js} +2 -2
  86. package/dist/gateway/static/root/assets/workflows-page-B45YDiEw.js +6 -0
  87. package/dist/gateway/static/root/index.html +9 -9
  88. package/dist/package.js +1 -1
  89. package/dist/packages/gateway-contract/src/automations.js +15 -0
  90. package/dist/src/agent/orchestration/agent-orchestrator.js +0 -21
  91. package/dist/src/automations/capabilities/write.d.ts +17 -0
  92. package/dist/src/automations/capabilities/write.js +26 -2
  93. package/dist/src/automations/domain/defaults.js +1 -1
  94. package/dist/src/automations/domain/index.js +2 -2
  95. package/dist/src/automations/domain/types.d.ts +22 -0
  96. package/dist/src/automations/domain/validation.d.ts +68 -0
  97. package/dist/src/automations/domain/validation.js +17 -1
  98. package/dist/src/automations/draft/automation-draft-validator.d.ts +9 -0
  99. package/dist/src/automations/draft/automation-draft-validator.js +1 -0
  100. package/dist/src/automations/index.js +2 -2
  101. package/dist/src/automations/service/action-executor.js +16 -0
  102. package/dist/src/automations/storage/automation-repository.js +4 -3
  103. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  104. package/dist/src/config/schema.d.ts +4 -0
  105. package/dist/src/config/schema.js +4 -0
  106. package/dist/src/gateway/home-intelligence-automation-reconciler.d.ts +3 -0
  107. package/dist/src/gateway/home-intelligence-automation-reconciler.js +49 -0
  108. package/dist/src/gateway/hono/routes/config-patch/misc.js +16 -2
  109. package/dist/src/gateway/hono/routes/home.js +0 -1
  110. package/dist/src/gateway/hono/routes/update.js +6 -1
  111. package/dist/src/gateway/memory-maintenance-automation-reconciler.js +17 -14
  112. package/dist/src/gateway/service.d.ts +1 -0
  113. package/dist/src/gateway/service.js +35 -13
  114. package/dist/src/home-intelligence/host.d.ts +1 -1
  115. package/dist/src/home-intelligence/host.js +2 -10
  116. package/dist/src/home-intelligence/notification.js +1 -1
  117. package/dist/src/home-intelligence/repository.d.ts +1 -1
  118. package/dist/src/infra/update-check.d.ts +8 -4
  119. package/dist/src/infra/update-check.js +43 -41
  120. package/dist/src/infra/update-startup.d.ts +7 -1
  121. package/dist/src/infra/update-startup.js +15 -6
  122. package/dist/src/memory-maintenance/index.js +2 -2
  123. package/dist/src/memory-maintenance/schedule.d.ts +0 -3
  124. package/dist/src/memory-maintenance/schedule.js +1 -8
  125. package/dist/src/storage/sqlite/migrations/208_automation_management.sql +2 -0
  126. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  127. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  128. package/dist/src/storage/sqlite/schema.js +1 -1
  129. package/dist/src/tasks/home-query-service.js +1 -0
  130. package/dist/src/user-context/config.d.ts +9 -0
  131. package/dist/src/user-context/config.js +13 -4
  132. package/package.json +2 -2
  133. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-ArM6Sm9S.js +0 -1
  134. package/dist/gateway/static/root/assets/agents-BiQqpMw0.js +0 -70
  135. package/dist/gateway/static/root/assets/apps-page-BhfYQcm8.js +0 -1
  136. package/dist/gateway/static/root/assets/automations-workspace-DMH_1Ped.js +0 -7
  137. package/dist/gateway/static/root/assets/browser-settings-page-BE6691Jz.js +0 -3
  138. package/dist/gateway/static/root/assets/capabilities-page-MweWNrC1.js +0 -2
  139. package/dist/gateway/static/root/assets/capabilities-sAZT4brT.js +0 -1
  140. package/dist/gateway/static/root/assets/capabilities-settings-panel-CdSWkh89.js +0 -8
  141. package/dist/gateway/static/root/assets/channels-NGfwR3He.js +0 -1
  142. package/dist/gateway/static/root/assets/connectors-page-BE8NdQcR.js +0 -2
  143. package/dist/gateway/static/root/assets/gateway-settings-DrHhtZqv.js +0 -1
  144. package/dist/gateway/static/root/assets/home-page-YgI6jfGA.js +0 -1
  145. package/dist/gateway/static/root/assets/index-DJmO2VAY.css +0 -1
  146. package/dist/gateway/static/root/assets/index-vCIBfJp7.js +0 -121
  147. package/dist/gateway/static/root/assets/local-app-workbench-page-DO8uUtos.js +0 -1
  148. package/dist/gateway/static/root/assets/local-apps-page-BEvyufm7.js +0 -1
  149. package/dist/gateway/static/root/assets/logs-page-Jev1m9sS.js +0 -2
  150. package/dist/gateway/static/root/assets/management-settings-41i7B1RO.js +0 -1
  151. package/dist/gateway/static/root/assets/messages-BZbt9x1y.js +0 -3
  152. package/dist/gateway/static/root/assets/note-detail-panel-DonP0E6Q.js +0 -5
  153. package/dist/gateway/static/root/assets/notes-page-CYHMeVKo.js +0 -8
  154. package/dist/gateway/static/root/assets/product-open-page-IY1QL6s0.js +0 -1
  155. package/dist/gateway/static/root/assets/project-detail-page-Bpw9mxfV.js +0 -1
  156. package/dist/gateway/static/root/assets/remote-access-hub-CLhbz3TF.js +0 -1
  157. package/dist/gateway/static/root/assets/scenes-page-XwK2IEmr.js +0 -2
  158. package/dist/gateway/static/root/assets/sessions-page-4-QoiDES.js +0 -1
  159. package/dist/gateway/static/root/assets/settings-advanced-gate-BggQVM1y.js +0 -1
  160. package/dist/gateway/static/root/assets/setup-status-panel-HPpC7EE0.js +0 -1
  161. package/dist/gateway/static/root/assets/shares-settings-DhVCRYGP.js +0 -1
  162. package/dist/gateway/static/root/assets/skill-reload-api-XPZkWJJe.js +0 -1
  163. package/dist/gateway/static/root/assets/skills-page-uF7DkJMC.js +0 -2
  164. package/dist/gateway/static/root/assets/task-detail-page-gepxhO4j.js +0 -1
  165. package/dist/gateway/static/root/assets/user-model-page-DldQW9Wh.js +0 -2
  166. package/dist/gateway/static/root/assets/workflows-page-B9lnTU3U.js +0 -6
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./popover-select-DcsFzD_i.js";import{a as r,r as i}from"./locale-store-DAOwT3Zp.js";function a(e){return{id:e.id,name:e.definition.name,description:e.definition.description,enabled:e.status===`enabled`,risk:e.definition.risk,domains:e.definition.allowedDomains,inputs:e.definition.inputs,createdAtMs:e.createdAtMs,updatedAtMs:e.updatedAtMs}}var o={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})}),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};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./popover-select-DcsFzD_i.js";import{a as r,r as i}from"./locale-store-wNXWkWu5.js";function a(e){return{id:e.id,name:e.definition.name,description:e.definition.description,enabled:e.status===`enabled`,risk:e.definition.risk,domains:e.definition.allowedDomains,inputs:e.definition.inputs,createdAtMs:e.createdAtMs,updatedAtMs:e.updatedAtMs}}var o={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})}),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};
@@ -1,3 +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-BMYIfy9x.js";import{t as i}from"./pencil-DmIY3Oa-.js";import{n as a}from"./locale-store-DAOwT3Zp.js";import{t as o}from"./button-CS04eWY9.js";import{t as s}from"./skeleton-BwbyijEw.js";import{$u as c,Ao as l,Iu as u,Ku as d,Yc as f,ed as p,md as m,xl as h,zc as g}from"./index-vCIBfJp7.js";import{i as _,n as v,r as y,t as b}from"./browser-automation-inputs-CwF8OQFN.js";var x=e(t(),1),S=n(),C={en:{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:{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 w(e){return e!==`queued`&&e!==`running`}function T(e){return e==null?`-`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.map(e=>`• ${T(e)}`).join(`
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-BMYIfy9x.js";import{t as i}from"./pencil-DmIY3Oa-.js";import{n as a}from"./locale-store-wNXWkWu5.js";import{t as o}from"./button-CS04eWY9.js";import{t as s}from"./skeleton-BwbyijEw.js";import{$u as c,Fu as l,Gu as u,Ho as d,Jc as f,Qu as p,Rc as m,bl as h,pd as g}from"./index-DalslRUx.js";import{i as _,n as v,r as y,t as b}from"./browser-automation-inputs-C5s1yHOu.js";var x=e(t(),1),S=n(),C={en:{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:{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 w(e){return e!==`queued`&&e!==`running`}function T(e){return e==null?`-`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.map(e=>`• ${T(e)}`).join(`
2
2
  `):typeof e==`object`?Object.entries(e).map(([e,t])=>`${e}: ${T(t)}`).join(`
3
- `):String(e)}function E(){let e=a(e=>e.language),t=C[e],n=r(),E=l(e=>e.setPageHeader),D=l(e=>e.clearPageHeader),[O,k]=(0,x.useState)(null),[A,j]=(0,x.useState)(),[M,N]=(0,x.useState)({}),[P,F]=(0,x.useState)([]),[I,L]=(0,x.useState)(),[R,z]=(0,x.useState)(``),[B,V]=(0,x.useState)(!1),H=(0,x.useMemo)(()=>O?.find(e=>e.id===A),[A,O]),U=(0,x.useCallback)(async()=>{let e=await _.list();k(e.automations),j(t=>t&&e.automations.some(e=>e.id===t)?t:e.automations[0]?.id)},[]);(0,x.useEffect)(()=>{U().catch(e=>z(String(e)))},[U]),(0,x.useEffect)(()=>{H&&(N(y(H)),L(void 0),z(``),_.listRuns(H.id).then(e=>F(e.runs)).catch(e=>z(String(e))))},[H]),(0,x.useEffect)(()=>{if(!I||w(I.status))return;let e=window.setInterval(()=>{_.getRun(I.id).then(({run:e})=>{L(e),w(e.status)&&H&&_.listRuns(H.id).then(e=>F(e.runs))}).catch(e=>z(String(e)))},700);return()=>window.clearInterval(e)},[I,H]);let W=(0,x.useCallback)(e=>{n(`/chat/new?draft=${encodeURIComponent(e)}`)},[n]),G=(0,x.useMemo)(()=>(0,S.jsxs)(o,{onClick:()=>W(t.createPrompt),children:[(0,S.jsx)(m,{className:`size-4`}),t.create]}),[W,t.create,t.createPrompt]);(0,x.useLayoutEffect)(()=>(E({startExtra:null,main:(0,S.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),end:G}),()=>D()),[D,G,E,t.title]);let K=async()=>{if(H){V(!0);try{await _.setEnabled(H.id,!H.enabled),await U()}catch(e){z(String(e))}finally{V(!1)}}},q=async()=>{if(H){if(!v(H,M)){z(t.required);return}V(!0);try{let{run:e}=await _.run(H.id,M);L(e),z(``)}catch(e){z(String(e))}finally{V(!1)}}},J=async()=>{if(!(!H||!window.confirm(t.confirmDelete))){V(!0);try{await _.remove(H.id),j(void 0),F([]),await U()}catch(e){z(String(e))}finally{V(!1)}}};return O===null?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel p-4 sm:p-6`,children:(0,S.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,S.jsx)(s,{className:`h-[420px] rounded-xl`}),(0,S.jsx)(s,{className:`h-[420px] rounded-xl`})]})}):O.length===0?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel p-4 sm:p-6`,children:(0,S.jsxs)(`div`,{className:`m-auto max-w-md py-12 text-center`,children:[(0,S.jsx)(m,{className:`mx-auto size-10 text-accent`}),(0,S.jsx)(`h2`,{className:`mt-4 text-lg font-semibold text-fg`,children:t.emptyTitle}),(0,S.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:t.emptyBody}),(0,S.jsxs)(o,{className:`mt-5`,onClick:()=>W(t.createPrompt),children:[(0,S.jsx)(m,{className:`size-4`}),t.create]})]})}):(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel p-4 sm:p-6`,children:(0,S.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,S.jsx)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-2`,children:O.map(e=>(0,S.jsxs)(`button`,{onClick:()=>j(e.id),className:`mb-1 w-full rounded-lg p-3 text-left ${A===e.id?`bg-accent-soft text-accent-fg`:`hover:bg-surface-hover`}`,children:[(0,S.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,S.jsxs)(`span`,{className:`mt-1 flex items-center gap-1.5 text-xs text-fg-muted`,children:[e.enabled?(0,S.jsx)(c,{className:`size-3.5 text-emerald-600`}):(0,S.jsx)(p,{className:`size-3.5`}),e.enabled?t.enabled:t.paused]})]},e.id))}),H&&(0,S.jsxs)(`main`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-5 sm:p-6`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:H.name}),H.description&&(0,S.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:H.description}),(0,S.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[(0,S.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:t[H.risk]}),H.domains.map(e=>(0,S.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:[(0,S.jsx)(u,{className:`size-3`}),e]},e))]})]}),(0,S.jsxs)(`div`,{className:`flex gap-2`,children:[(0,S.jsxs)(o,{variant:`secondary`,disabled:B,onClick:()=>void K(),children:[H.enabled?(0,S.jsx)(p,{className:`size-4`}):(0,S.jsx)(c,{className:`size-4`}),H.enabled?t.pause:t.enable]}),(0,S.jsxs)(o,{variant:`secondary`,onClick:()=>W(t.editPrompt.replace(`{name}`,H.name).replace(`{id}`,H.id)),children:[(0,S.jsx)(i,{className:`size-4`}),t.edit]})]})]}),(0,S.jsxs)(`section`,{className:`mt-7 max-w-xl`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.inputs}),Object.keys(H.inputs).length===0?(0,S.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.noInputs}):(0,S.jsx)(`div`,{className:`mt-3`,children:(0,S.jsx)(b,{automation:H,values:M,language:e,onChange:N})}),(0,S.jsxs)(`div`,{className:`mt-5 flex gap-2`,children:[(0,S.jsxs)(o,{variant:`primary`,disabled:!H.enabled||B||!!(I&&!w(I.status)),onClick:()=>void q(),children:[(0,S.jsx)(h,{className:`size-4`}),t.run]}),I&&!w(I.status)&&(0,S.jsxs)(o,{variant:`secondary`,onClick:()=>void _.cancel(I.id),children:[(0,S.jsx)(f,{className:`size-4`}),t.stop]})]}),R&&(0,S.jsx)(`p`,{className:`mt-3 text-sm text-red-700 dark:text-red-300`,children:R})]}),I&&(0,S.jsxs)(`section`,{className:`mt-7 rounded-xl border border-edge bg-surface-inset p-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,S.jsx)(d,{className:`size-4`}),t[I.status]]}),I.error&&(0,S.jsx)(`p`,{className:`mt-2 text-sm text-red-700 dark:text-red-300`,children:I.error}),I.status===`succeeded`&&I.result!==void 0&&(0,S.jsxs)(`div`,{className:`mt-3`,children:[(0,S.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:t.result}),(0,S.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap text-sm text-fg`,children:T(I.result)})]})]}),(0,S.jsxs)(`section`,{className:`mt-8`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.history}),(0,S.jsx)(`div`,{className:`mt-2 divide-y divide-edge`,children:P.slice(0,10).map(e=>(0,S.jsxs)(`button`,{className:`flex w-full items-center justify-between gap-3 py-3 text-left text-sm hover:text-accent`,onClick:()=>L(e),children:[(0,S.jsx)(`span`,{children:t[e.status]}),(0,S.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,S.jsx)(`div`,{className:`mt-8 border-t border-edge pt-4`,children:(0,S.jsxs)(o,{variant:`ghost`,className:`text-red-700 dark:text-red-300`,disabled:B,onClick:()=>void J(),children:[(0,S.jsx)(g,{className:`size-4`}),t.delete]})})]})]})})}export{E as BrowserAutomationsPage};
3
+ `):String(e)}function E(){let e=a(e=>e.language),t=C[e],n=r(),E=d(e=>e.setPageHeader),D=d(e=>e.clearPageHeader),[O,k]=(0,x.useState)(null),[A,j]=(0,x.useState)(),[M,N]=(0,x.useState)({}),[P,F]=(0,x.useState)([]),[I,L]=(0,x.useState)(),[R,z]=(0,x.useState)(``),[B,V]=(0,x.useState)(!1),H=(0,x.useMemo)(()=>O?.find(e=>e.id===A),[A,O]),U=(0,x.useCallback)(async()=>{let e=await _.list();k(e.automations),j(t=>t&&e.automations.some(e=>e.id===t)?t:e.automations[0]?.id)},[]);(0,x.useEffect)(()=>{U().catch(e=>z(String(e)))},[U]),(0,x.useEffect)(()=>{H&&(N(y(H)),L(void 0),z(``),_.listRuns(H.id).then(e=>F(e.runs)).catch(e=>z(String(e))))},[H]),(0,x.useEffect)(()=>{if(!I||w(I.status))return;let e=window.setInterval(()=>{_.getRun(I.id).then(({run:e})=>{L(e),w(e.status)&&H&&_.listRuns(H.id).then(e=>F(e.runs))}).catch(e=>z(String(e)))},700);return()=>window.clearInterval(e)},[I,H]);let W=(0,x.useCallback)(e=>{n(`/chat/new?draft=${encodeURIComponent(e)}`)},[n]),G=(0,x.useMemo)(()=>(0,S.jsxs)(o,{onClick:()=>W(t.createPrompt),children:[(0,S.jsx)(g,{className:`size-4`}),t.create]}),[W,t.create,t.createPrompt]);(0,x.useLayoutEffect)(()=>(E({startExtra:null,main:(0,S.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),end:G}),()=>D()),[D,G,E,t.title]);let K=async()=>{if(H){V(!0);try{await _.setEnabled(H.id,!H.enabled),await U()}catch(e){z(String(e))}finally{V(!1)}}},q=async()=>{if(H){if(!v(H,M)){z(t.required);return}V(!0);try{let{run:e}=await _.run(H.id,M);L(e),z(``)}catch(e){z(String(e))}finally{V(!1)}}},J=async()=>{if(!(!H||!window.confirm(t.confirmDelete))){V(!0);try{await _.remove(H.id),j(void 0),F([]),await U()}catch(e){z(String(e))}finally{V(!1)}}};return O===null?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel p-4 sm:p-6`,children:(0,S.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,S.jsx)(s,{className:`h-[420px] rounded-xl`}),(0,S.jsx)(s,{className:`h-[420px] rounded-xl`})]})}):O.length===0?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel p-4 sm:p-6`,children:(0,S.jsxs)(`div`,{className:`m-auto max-w-md py-12 text-center`,children:[(0,S.jsx)(g,{className:`mx-auto size-10 text-accent`}),(0,S.jsx)(`h2`,{className:`mt-4 text-lg font-semibold text-fg`,children:t.emptyTitle}),(0,S.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:t.emptyBody}),(0,S.jsxs)(o,{className:`mt-5`,onClick:()=>W(t.createPrompt),children:[(0,S.jsx)(g,{className:`size-4`}),t.create]})]})}):(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-surface-panel p-4 sm:p-6`,children:(0,S.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 lg:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,S.jsx)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-2`,children:O.map(e=>(0,S.jsxs)(`button`,{onClick:()=>j(e.id),className:`mb-1 w-full rounded-lg p-3 text-left ${A===e.id?`bg-accent-soft text-accent-fg`:`hover:bg-surface-hover`}`,children:[(0,S.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,S.jsxs)(`span`,{className:`mt-1 flex items-center gap-1.5 text-xs text-fg-muted`,children:[e.enabled?(0,S.jsx)(p,{className:`size-3.5 text-emerald-600`}):(0,S.jsx)(c,{className:`size-3.5`}),e.enabled?t.enabled:t.paused]})]},e.id))}),H&&(0,S.jsxs)(`main`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge bg-surface-base p-5 sm:p-6`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:H.name}),H.description&&(0,S.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:H.description}),(0,S.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[(0,S.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:t[H.risk]}),H.domains.map(e=>(0,S.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-surface-inset px-2.5 py-1 text-fg-muted`,children:[(0,S.jsx)(l,{className:`size-3`}),e]},e))]})]}),(0,S.jsxs)(`div`,{className:`flex gap-2`,children:[(0,S.jsxs)(o,{variant:`secondary`,disabled:B,onClick:()=>void K(),children:[H.enabled?(0,S.jsx)(c,{className:`size-4`}):(0,S.jsx)(p,{className:`size-4`}),H.enabled?t.pause:t.enable]}),(0,S.jsxs)(o,{variant:`secondary`,onClick:()=>W(t.editPrompt.replace(`{name}`,H.name).replace(`{id}`,H.id)),children:[(0,S.jsx)(i,{className:`size-4`}),t.edit]})]})]}),(0,S.jsxs)(`section`,{className:`mt-7 max-w-xl`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.inputs}),Object.keys(H.inputs).length===0?(0,S.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t.noInputs}):(0,S.jsx)(`div`,{className:`mt-3`,children:(0,S.jsx)(b,{automation:H,values:M,language:e,onChange:N})}),(0,S.jsxs)(`div`,{className:`mt-5 flex gap-2`,children:[(0,S.jsxs)(o,{variant:`primary`,disabled:!H.enabled||B||!!(I&&!w(I.status)),onClick:()=>void q(),children:[(0,S.jsx)(h,{className:`size-4`}),t.run]}),I&&!w(I.status)&&(0,S.jsxs)(o,{variant:`secondary`,onClick:()=>void _.cancel(I.id),children:[(0,S.jsx)(f,{className:`size-4`}),t.stop]})]}),R&&(0,S.jsx)(`p`,{className:`mt-3 text-sm text-red-700 dark:text-red-300`,children:R})]}),I&&(0,S.jsxs)(`section`,{className:`mt-7 rounded-xl border border-edge bg-surface-inset p-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,S.jsx)(u,{className:`size-4`}),t[I.status]]}),I.error&&(0,S.jsx)(`p`,{className:`mt-2 text-sm text-red-700 dark:text-red-300`,children:I.error}),I.status===`succeeded`&&I.result!==void 0&&(0,S.jsxs)(`div`,{className:`mt-3`,children:[(0,S.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:t.result}),(0,S.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto whitespace-pre-wrap text-sm text-fg`,children:T(I.result)})]})]}),(0,S.jsxs)(`section`,{className:`mt-8`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.history}),(0,S.jsx)(`div`,{className:`mt-2 divide-y divide-edge`,children:P.slice(0,10).map(e=>(0,S.jsxs)(`button`,{className:`flex w-full items-center justify-between gap-3 py-3 text-left text-sm hover:text-accent`,onClick:()=>L(e),children:[(0,S.jsx)(`span`,{children:t[e.status]}),(0,S.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,S.jsx)(`div`,{className:`mt-8 border-t border-edge pt-4`,children:(0,S.jsxs)(o,{variant:`ghost`,className:`text-red-700 dark:text-red-300`,disabled:B,onClick:()=>void J(),children:[(0,S.jsx)(m,{className:`size-4`}),t.delete]})})]})]})})}export{E 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-BMYIfy9x.js";import{t as o}from"./popover-select-DcsFzD_i.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"./eye-CABVeTq0.js";import{t as d}from"./folder-open-CyzJ19I9.js";import{t as f}from"./loader-circle-CifKLtgG.js";import{t as p}from"./messages-fmf0dnr4.js";import{a as m,c as h,n as g,r as _}from"./locale-store-wNXWkWu5.js";import{i as v}from"./vendor-swr-BIWyz7Rc.js";import{t as y}from"./button-CS04eWY9.js";import{n as b,r as x}from"./gateway-config-swr-cR-tz7-Q.js";import{t as S}from"./skeleton-BwbyijEw.js";import{Aa as C,G as w,H as T,K as E,Lc as ee,Lu as D,Nl as O,U as te,W as ne,Wl as k,fl as re,ja as ie,q as A,xl as ae,xu as j}from"./index-DalslRUx.js";import{n as oe,r as M}from"./settings-page-layout-X1x-2Cp9.js";import{n as se}from"./settings-loading-skeleton-CAmWMaOT.js";import{n as N,t as P}from"./use-autosave-Bj9hC6ML.js";import{t as ce}from"./settings-advanced-gate-BLL7csOJ.js";var F=n(),I=e(t(),1);function le(e){let[t,n]=(0,I.useState)(!1),[r,i]=(0,I.useState)(!1),[a,o]=(0,I.useState)(null),[s,c]=(0,I.useState)(null),l=(0,I.useRef)(null);return{running:t,cancelling:r,progress:a,error:s,install:(0,I.useCallback)(async()=>{if(l.current)return;let t=new AbortController;l.current=t,n(!0),o(null),c(null);try{let n=await w(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,I.useCallback)(async()=>{l.current&&(i(!0),await T().catch(()=>{}),l.current.abort())},[])}}var L=r(),R={extension:`Chrome extension`,playwright:`Playwright Chromium`,cdp:`CDP`,remote:`Remote browser`};function z(e){let{enabled:t,driverKind:n,autosaveStatus:r,zh:a}=e,o=i(),c=v(t?[`browser-control-status`,n]:null,te,{revalidateOnFocus:!0,refreshInterval:n===`extension`?3e3:0}),[l,u]=(0,I.useState)(null),[d,p]=(0,I.useState)(null),[m,h]=(0,I.useState)(null),g=r===`dirty`||r===`saving`;(0,I.useEffect)(()=>{r===`saved`&&c.mutate()},[r,c.mutate]);let _=(0,I.useCallback)(async(e,t,n)=>{u(e),p(null),h(null);try{await t(),h(n),await c.mutate()}catch(e){p(e instanceof Error?e.message:String(e))}finally{u(null)}},[c.mutate]),b=le((0,I.useCallback)(()=>{h(a?`Chromium 已安装,可以开始连接测试。`:`Chromium is installed and ready to test.`),c.mutate()},[c.mutate,a])),x=c.data?.payload,C=x?.driverKind===n,w=t?g||!C?`syncing`:x?.state:`disabled`;return(0,L.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(w===`ready`?s:w===`syncing`?f:ee,{className:`size-4 shrink-0 ${w===`ready`?`text-success`:w===`syncing`?`animate-spin text-fg-muted`:w===`disabled`?`text-fg-subtle`:`text-warning`}`}),(0,L.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:a?`浏览器就绪状态`:`Browser readiness`}),(0,L.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs ${w===`ready`?`bg-success-soft text-success`:w===`disabled`?`bg-surface-hover text-fg-muted`:`bg-warning-soft text-warning`}`,children:w===`ready`?a?`已就绪`:`Ready`:w===`disabled`?a?`未启用`:`Disabled`:w===`syncing`?a?`正在应用配置`:`Applying configuration`:a?`需要处理`:`Needs attention`})]}),(0,L.jsxs)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:[R[n],x?.detail&&C?` · ${x.detail}`:``]})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsxs)(y,{variant:`ghost`,className:`h-9`,onClick:()=>void c.mutate(),disabled:c.isValidating,children:[(0,L.jsx)(re,{className:`size-3.5 ${c.isValidating?`animate-spin`:``}`}),a?`刷新`:`Refresh`]}),(0,L.jsxs)(y,{variant:`secondary`,className:`h-9`,disabled:!t||g||l!==null||b.running,onClick:()=>void _(`test`,A,a?`连接测试成功。`:`Connection test passed.`),children:[l===`test`?(0,L.jsx)(f,{className:`size-3.5 animate-spin`}):(0,L.jsx)(ae,{className:`size-3.5`}),a?`测试连接`:`Test connection`]})]})]}),t&&c.isLoading?(0,L.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-3`,children:[(0,L.jsx)(S,{className:`h-12`}),(0,L.jsx)(S,{className:`h-12`}),(0,L.jsx)(S,{className:`h-12`})]}):null,t&&c.error?(0,L.jsx)(H,{tone:`error`,children:c.error instanceof Error?c.error.message:String(c.error)}):null,d||b.error?(0,L.jsx)(H,{tone:`error`,children:d??b.error}):null,m?(0,L.jsx)(H,{tone:`success`,children:m}):null,t&&n===`extension`&&C?(0,L.jsx)(ue,{status:x?.driverStatus,zh:a,busy:l,run:_,onConnectRemote:()=>o(`/settings/devices?startDevicePairing=browser`)}):null,t&&n===`playwright`&&C?(0,L.jsx)(B,{status:x?.driverStatus,zh:a,installer:b}):null,t&&n===`cdp`?(0,L.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,L.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 ue(e){let t=(0,F.c)(70),{status:n,zh:r,busy:i,run:a,onConnectRemote:o}=e,s=n?.artifacts,u=r?`扩展文件`:`Extension files`,p=s?.installed===!0,m=s?.installed?r?`已安装`:`Installed`:r?`未安装或需更新`:`Install or update required`,h;t[0]!==u||t[1]!==p||t[2]!==m?(h=(0,L.jsx)(V,{label:u,ok:p,value:m}),t[0]=u,t[1]=p,t[2]=m,t[3]=h):h=t[3];let g=r?`本机自动发现`:`Local auto-discovery`,_=s?.nativeHost?.installed===!0,v=s?.nativeHost?.installed?r?`已就绪`:`Ready`:s?.nativeHost?.reason??(r?`需要修复`:`Repair required`),b;t[4]!==g||t[5]!==_||t[6]!==v?(b=(0,L.jsx)(V,{label:g,ok:_,value:v}),t[4]=g,t[5]=_,t[6]=v,t[7]=b):b=t[7];let x=r?`安全通道`:`Secure channel`,S=n?.transport===`gateway-realtime`,C=n?.transport===`gateway-realtime`?`Gateway Realtime`:r?`不可用`:`Unavailable`,w;t[8]!==C||t[9]!==x||t[10]!==S?(w=(0,L.jsx)(V,{label:x,ok:S,value:C}),t[8]=C,t[9]=x,t[10]=S,t[11]=w):w=t[11];let T=r?`Chrome 连接`:`Chrome connection`,E=n?.connected===!0,ee=n?.connected?r?`已连接`:`Connected`:n?.socketConnected?r?`需要重新加载扩展`:`Reload extension`:r?`等待扩展连接`:`Waiting for extension`,D;t[12]!==T||t[13]!==E||t[14]!==ee?(D=(0,L.jsx)(V,{label:T,ok:E,value:ee}),t[12]=T,t[13]=E,t[14]=ee,t[15]=D):D=t[15];let O;t[16]!==w||t[17]!==D||t[18]!==h||t[19]!==b?(O=(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[h,b,w,D]}),t[16]=w,t[17]=D,t[18]=h,t[19]=b,t[20]=O):O=t[20];let te=s?.extensionDir??`Gateway Realtime`,k;t[21]===te?k=t[22]:(k=(0,L.jsx)(`p`,{className:`mt-3 break-all text-xs text-fg-subtle`,children:te}),t[21]=te,t[22]=k);let re=s?.installed?`secondary`:`primary`,ie=i!==null,A;t[23]!==s?.installed||t[24]!==a||t[25]!==r?(A=()=>void a(`extension-install`,()=>ne(!!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,L.jsx)(f,{className:`size-3.5 animate-spin`}):(0,L.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]!==re||t[30]!==ie||t[31]!==A||t[32]!==j||t[33]!==oe?(M=(0,L.jsxs)(y,{className:`h-9`,variant:re,disabled:ie,onClick:A,children:[j,oe]}),t[29]=re,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`,fe,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,L.jsx)(l,{className:`size-3.5`}),t[38]=P):P=t[38];let ce=r?`打开扩展页`:`Open extensions`,I;t[39]!==se||t[40]!==N||t[41]!==ce?(I=(0,L.jsxs)(y,{className:`h-9`,variant:`secondary`,disabled:se,onClick:N,children:[P,ce]}),t[39]=se,t[40]=N,t[41]=ce,t[42]=I):I=t[42];let le=!s?.installed||i!==null,R;t[43]!==a||t[44]!==r?(R=()=>void a(`extension-folder`,de,r?`已打开扩展目录。`:`Extension folder opened.`),t[43]=a,t[44]=r,t[45]=R):R=t[45];let z;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,L.jsx)(d,{className:`size-3.5`}),t[46]=z):z=t[46];let ue=r?`打开扩展目录`:`Open folder`,B;t[47]!==le||t[48]!==R||t[49]!==ue?(B=(0,L.jsxs)(y,{className:`h-9`,variant:`ghost`,disabled:le,onClick:R,children:[z,ue]}),t[47]=le,t[48]=R,t[49]=ue,t[50]=B):B=t[50];let H=i!==null,U;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,L.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]!==H||t[54]!==pe?(W=(0,L.jsxs)(y,{className:`h-9`,variant:`secondary`,disabled:H,onClick:o,children:[U,pe]}),t[52]=o,t[53]=H,t[54]=pe,t[55]=W):W=t[55];let G;t[56]!==M||t[57]!==I||t[58]!==B||t[59]!==W?(G=(0,L.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[M,I,B,W]}),t[56]=M,t[57]=I,t[58]=B,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,L.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]!==O||t[66]!==k||t[67]!==G||t[68]!==K?(q=(0,L.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base/45 p-4`,children:[O,k,G,K]}),t[65]=O,t[66]=k,t[67]=G,t[68]=K,t[69]=q):q=t[69],q}function de(){return E(`folder`)}function fe(){return E(`chrome`)}function B(e){let t=(0,F.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,L.jsx)(V,{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,L.jsx)(`p`,{className:`mt-2 break-all text-xs text-fg-subtle`,children:n.executablePath}):null,t[3]=n,t[4]=l);let u;t[5]===i.progress?u=t[6]:(u=i.progress?(0,L.jsxs)(`div`,{className:`mt-3`,children:[(0,L.jsxs)(`div`,{className:`flex justify-between text-xs text-fg-muted`,children:[(0,L.jsx)(`span`,{children:i.progress.message??i.progress.phase}),(0,L.jsx)(`span`,{children:i.progress.percent==null?``:`${Math.round(i.progress.percent)}%`})]}),(0,L.jsx)(`div`,{className:`mt-1 h-1.5 overflow-hidden rounded-full bg-surface-hover`,children:(0,L.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-[width]`,style:{width:`${i.progress.percent??8}%`}})})]}):null,t[5]=i.progress,t[6]=u);let d=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,L.jsx)(f,{className:`size-3.5 animate-spin`}):(0,L.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]!==d||t[13]!==p||t[14]!==m||t[15]!==h?(g=(0,L.jsxs)(y,{variant:d,className:`h-9`,disabled:i.running,onClick:p,children:[m,h]}),t[11]=i.running,t[12]=d,t[13]=p,t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;t[17]!==i||t[18]!==r?(_=i.running?(0,L.jsx)(y,{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]=_):_=t[19];let v;t[20]!==_||t[21]!==g?(v=(0,L.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[g,_]}),t[20]=_,t[21]=g,t[22]=v):v=t[22];let b;return t[23]!==v||t[24]!==s||t[25]!==l||t[26]!==u?(b=(0,L.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base/45 p-4`,children:[s,l,u,v]}),t[23]=v,t[24]=s,t[25]=l,t[26]=u,t[27]=b):b=t[27],b}function V(e){let t=(0,F.c)(11),{label:n,ok:r,value:i}=e,a;t[0]===n?a=t[1]:(a=(0,L.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,L.jsx)(`span`,{className:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c||t[6]!==i?(l=(0,L.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,L.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 H(e){let t=(0,F.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,L.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 U(e){let t=(0,F.c)(36),{sectionId:n,vm:r,children:i}=e,a=g(pe),o;t[0]===a?o=t[1]:(o=p(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,L.jsx)(D,{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,L.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,L.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,L.jsx)(M,{gap:`gap-3`,padding:`px-3 py-10 sm:px-5 xl:px-6`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[e,(0,L.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,L.jsx)(M,{gap:`gap-6`,padding:`px-3 py-8 sm:px-5 xl:px-6`,children:(0,L.jsx)(se,{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,L.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,L.jsx)(y,{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,L.jsxs)(M,{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,L.jsx)(N,{status:r.autosaveStatus,error:r.error}),t[21]=r.autosaveStatus,t[22]=r.error,t[23]=u):u=t[23];let d;t[24]!==l||t[25]!==u?(d=(0,L.jsx)(oe,{title:l,actions:u}),t[24]=l,t[25]=u,t[26]=d):d=t[26];let f;t[27]===r.error?f=t[28]:(f=r.error?(0,L.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]=f);let m;t[29]===i?m=t[30]:(m=(0,L.jsx)(`div`,{className:`flex min-w-0 flex-col gap-5 pb-8`,children:i}),t[29]=i,t[30]=m);let h;return t[31]!==d||t[32]!==f||t[33]!==m||t[34]!==r.onBlurCapture?(h=(0,L.jsxs)(M,{gap:`gap-6`,onBlurCapture:r.onBlurCapture,children:[d,f,m]}),t[31]=d,t[32]=f,t[33]=m,t[34]=r.onBlurCapture,t[35]=h):h=t[35],h}function pe(e){return e.language}var W={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:`ask`,uploads:`ask`,consequentialActions:`ask`};function G(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{...W,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,W.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,W.maxNodes),maxCharacters:X(r.maxCharacters,W.maxCharacters),visualFallback:r.visualFallback!==!1,actionTimeoutMs:X(i.actionTimeoutMs,W.actionTimeoutMs),sessionTimeoutMs:X(i.sessionTimeoutMs,W.sessionTimeoutMs),maxSequenceLength:X(i.maxSequenceLength,W.maxSequenceLength),allowedPrivateHosts:Array.isArray(a.allowedPrivateHosts)?a.allowedPrivateHosts.filter(e=>typeof e==`string`).join(`
2
+ `):``,crossDomainNavigation:he(a.crossDomainNavigation),uploads:he(a.uploads),consequentialActions:he(a.consequentialActions)}}function K(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 q(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 me(e){await m(_(`/api/config`),{method:`PATCH`,body:JSON.stringify({browser:K(e)})}),b()}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 he(e){return e===`allow`||e===`deny`?e:`ask`}var ge=C();function _e(e){let t=!!h(e=>e.conversationId),[n,r]=(0,I.useReducer)(ge,{form:null,baseline:null}),i=n.form,a=n.baseline,o=(0,I.useRef)(!1),s=(0,I.useRef)(i);s.current=i;let c=(0,I.useRef)(null),{data:l,error:u,isLoading:d,mutate:f}=x(t);ie({enabled:t,parsed:(0,I.useMemo)(()=>l?.payload?.config===void 0?null:G(l.payload.config),[l]),dirty:o.current,trackedParsedRef:c,dispatch:r,onResetDirty:()=>{o.current=!1}});let p=!!(t&&d&&l===void 0&&!u),m=u instanceof Error?u.message:u?String(u):null,g=(0,I.useMemo)(()=>!i||!a?!1:JSON.stringify(i)!==JSON.stringify(a),[i,a]),_=(0,I.useCallback)(e=>{o.current=!0,r({type:`patch`,patch:e})},[]),v=P({value:i,dirty:g,onSave:(0,I.useCallback)(async t=>{try{await me(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:q});return{hasToken:t,loading:p,fetchError:m,form:i,update:_,autosaveStatus:v.status,error:v.error,onBlurCapture:v.onBlurCapture,mutate:f}}var ve=[`extension`,`playwright`,`cdp`,`remote`];function ye(){let e=(0,F.c)(29),t=g(be),n;e[0]===t?n=e[1]:(n=p(t),e[0]=t,e[1]=n);let r=_e(n.agentSettings),i=r.form,s=t===`zh`,[c]=a(),l=(0,I.useRef)(!1),d;e[2]!==i||e[3]!==c||e[4]!==r?(d=()=>{if(!i||l.current)return;l.current=!0;let e=c.get(`driver`);ve.includes(e)&&e!==i.driverKind&&r.update({driverKind:e})},e[2]=i,e[3]=c,e[4]=r,e[5]=d):d=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,I.useEffect)(d,f);let m=s?`Chrome 扩展(推荐)`:`Chrome extension (recommended)`,h;e[10]===m?h=e[11]:(h={value:`extension`,label:m},e[10]=m,e[11]=h);let _;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_={value:`playwright`,label:`Playwright Chromium`},e[12]=_):_=e[12];let v=s?`CDP 已有浏览器`:`Existing browser over CDP`,y;e[13]===v?y=e[14]:(y={value:`cdp`,label:v},e[13]=v,e[14]=y);let b=s?`远程浏览器`:`Remote browser`,x;e[15]===b?x=e[16]:(x={value:`remote`,label:b},e[15]=b,e[16]=x);let S;e[17]!==h||e[18]!==y||e[19]!==x?(S=[h,_,y,x],e[17]=h,e[18]=y,e[19]=x,e[20]=S):S=e[20];let C=S,w;e[21]!==C||e[22]!==i||e[23]!==r||e[24]!==s?(w=i?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(z,{enabled:i.enabled,driverKind:i.driverKind,autosaveStatus:r.autosaveStatus,zh:s}),(0,L.jsxs)(Se,{title:s?`运行方式`:`Connection`,icon:(0,L.jsx)(O,{className:`size-4`}),children:[(0,L.jsx)(Ce,{label:s?`启用浏览器控制`:`Enable browser control`,checked:i.enabled,onChange:e=>r.update({enabled:e})}),(0,L.jsx)(Z,{label:s?`浏览器连接`:`Browser connection`,children:(0,L.jsx)(o,{value:i.driverKind,options:C,placeholder:s?`选择连接方式`:`Choose a connection`,allowEmpty:!1,onChange:e=>r.update({driverKind:e})})}),(0,L.jsx)(xe,{kind:i.driverKind,zh:s}),i.driverKind===`playwright`?(0,L.jsxs)(`div`,{className:`space-y-4 rounded-lg bg-surface-inset p-4`,children:[(0,L.jsx)(Ce,{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,L.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,L.jsx)(`div`,{className:`rounded-lg bg-surface-inset p-4`,children:(0,L.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,L.jsxs)(`div`,{className:`space-y-4 rounded-lg bg-surface-inset p-4`,children:[(0,L.jsx)(Z,{label:s?`服务商`:`Provider`,children:(0,L.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,L.jsx)(Q,{label:`API key`,type:`password`,autoComplete:`off`,value:i.remoteApiKey,onChange:e=>r.update({remoteApiKey:e})}),(0,L.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,L.jsx)(Q,{label:`Project ID`,value:i.remoteProjectId,onChange:e=>r.update({remoteProjectId:e})}),(0,L.jsx)(Q,{label:`Region`,value:i.remoteRegion,onChange:e=>r.update({remoteRegion:e})})]})]}):null]}),(0,L.jsx)(ce,{children:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(Se,{title:s?`页面理解`:`Page understanding`,icon:(0,L.jsx)(u,{className:`size-4`}),children:[(0,L.jsx)(Ce,{label:s?`需要时附加截图`:`Attach screenshots when needed`,checked:i.visualFallback,onChange:e=>r.update({visualFallback:e})}),(0,L.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,L.jsx)($,{label:s?`语义节点上限`:`Semantic node limit`,description:`20–500`,min:20,max:500,value:i.maxNodes,onChange:e=>r.update({maxNodes:e})}),(0,L.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,L.jsx)(Se,{title:s?`执行限制`:`Execution limits`,icon:(0,L.jsx)(j,{className:`size-4`}),children:(0,L.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,L.jsx)($,{label:s?`操作超时(毫秒)`:`Action timeout (ms)`,min:1e3,max:12e4,step:1e3,value:i.actionTimeoutMs,onChange:e=>r.update({actionTimeoutMs:e})}),(0,L.jsx)($,{label:s?`会话超时(毫秒)`:`Session timeout (ms)`,min:6e4,max:36e5,step:6e4,value:i.sessionTimeoutMs,onChange:e=>r.update({sessionTimeoutMs:e})}),(0,L.jsx)($,{label:s?`批量步骤上限`:`Sequence step limit`,min:1,max:10,value:i.maxSequenceLength,onChange:e=>r.update({maxSequenceLength:e})})]})}),(0,L.jsxs)(Se,{title:s?`安全与审批`:`Safety and approvals`,icon:(0,L.jsx)(k,{className:`size-4`}),children:[(0,L.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,L.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,L.jsx)(we,{zh:s,label:s?`跨域导航`:`Cross-domain navigation`,value:i.crossDomainNavigation,onChange:e=>r.update({crossDomainNavigation:e})}),(0,L.jsx)(we,{zh:s,label:s?`高影响动作`:`Consequential actions`,value:i.consequentialActions,onChange:e=>r.update({consequentialActions:e})}),(0,L.jsx)(we,{zh:s,label:s?`文件上传`:`File uploads`,value:i.uploads,onChange:e=>r.update({uploads:e})})]})]})]})})]}):null,e[21]=C,e[22]=i,e[23]=r,e[24]=s,e[25]=w):w=e[25];let T;return e[26]!==w||e[27]!==r?(T=(0,L.jsx)(U,{sectionId:`agent-browser`,vm:r,children:w}),e[26]=w,e[27]=r,e[28]=T):T=e[28],T}function be(e){return e.language}function xe(e){let t=(0,F.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,L.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 Se(e){let t=(0,F.c)(17),{title:n,description:r,icon:i,children:a}=e,o;t[0]===i?o=t[1]:(o=(0,L.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,L.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,L.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,L.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,L.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,L.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,L.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,F.c)(8),{label:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,L.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,L.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,L.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,F.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,L.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,L.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,L.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,F.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,L.jsx)(`input`,{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,L.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 Ce(e){let t=(0,F.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,L.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,L.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,L.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,L.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,L.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 we(e){let t=(0,F.c)(20),{zh:n,label:r,value:i,onChange:a}=e,s=n?`每次询问`:`Ask each time`,c;t[0]===s?c=t[1]:(c={value:`ask`,label:s},t[0]=s,t[1]=c);let l=n?`允许`:`Allow`,u;t[2]===l?u=t[3]:(u={value:`allow`,label:l},t[2]=l,t[3]=u);let d=n?`拒绝`:`Deny`,f;t[4]===d?f=t[5]:(f={value:`deny`,label:d},t[4]=d,t[5]=f);let p;t[6]!==c||t[7]!==u||t[8]!==f?(p=[c,u,f],t[6]=c,t[7]=u,t[8]=f,t[9]=p):p=t[9];let m=p,h=n?`选择策略`:`Choose a policy`,g;t[10]===a?g=t[11]:(g=e=>a(e),t[10]=a,t[11]=g);let _;t[12]!==m||t[13]!==h||t[14]!==g||t[15]!==i?(_=(0,L.jsx)(o,{value:i,options:m,placeholder:h,allowEmpty:!1,onChange:g}),t[12]=m,t[13]=h,t[14]=g,t[15]=i,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_?(v=(0,L.jsx)(Z,{label:r,children:_}),t[17]=r,t[18]=_,t[19]=v):v=t[19],v}export{ye as AgentBrowserSettingsPage};
@@ -0,0 +1 @@
1
+ import{_ as e,a as t,c as n,d as r,f as i,g as a,h as ee,i as o,l as s,n as te,o as c,p as l,r as u,s as d,t as f,u as p}from"./schemas-88fK3zzl.js";import{_ as m,c as ne,d as re,f as h,h as ie,l as g,n as ae,o as _,s as oe}from"./tasks-CDR_RVbQ.js";import{i as se,n as ce,t as v}from"./local-apps-Bpja8nC6.js";var le=p({id:l(),kind:f([`task`,`connector_approval`]),title:l(),detail:l().optional(),reason:f([`needs_input`,`blocked`,`user_input`,`user_approval`,`dependency`,`external`,`scheduled`,`retry`,`paused`,`overdue`,`due_soon`,`decision_needed`,`approval_required`]),urgency:f([`now`,`soon`]),href:l(),projectId:l().optional(),projectName:l().optional(),dueAt:s().int().nonnegative().optional(),updatedAt:s(),response:t(`kind`,[p({kind:d(`connector_approval`),approvalId:l()})]).optional()});p({id:l(),kind:f([`automation_run`,`workflow_run`]),runId:l(),title:l(),detail:l(),reason:f([`run_failed`,`run_timeout`]),href:l(),updatedAt:s(),conversationId:l().optional()});var y=t(`type`,[p({type:d(`open`),label:l(),href:l()}),p({type:d(`connector_decision`),label:l(),approvalId:l(),decision:f([`approve`,`deny`])}),p({type:d(`retry_run`),label:l(),subjectKind:f([`automation_run`,`workflow_run`]),runId:l()}),p({type:d(`acknowledge_run`),label:l(),subjectKind:f([`automation_run`,`workflow_run`]),runId:l()})]),b=p({id:l(),kind:f([`decision`,`failure`,`running`,`scheduled`]),title:l(),summary:l(),recommendation:l().optional(),dueAt:s().int().nonnegative().optional(),statusLabel:l().optional(),updatedAt:s(),openAction:y.optional(),primaryAction:y.optional(),secondaryActions:u(y).max(2).default([])}),ue=p({conversationId:l(),runId:l(),title:l().optional(),agentId:l().optional(),updatedAt:s()}),de=i({id:l().trim().min(1).max(300),sourceType:f([`project`,`task`,`conversation`,`scene`,`calendar`,`mail`,`communication`,`file`,`user_model`]),sourceRef:l().trim().min(1).max(1e3),revision:l().trim().min(1).max(300),observation:l().trim().min(1).max(1e3),observedAt:s().int().nonnegative(),freshUntil:s().int().nonnegative(),href:l().trim().min(1).max(2e3).optional()}),fe=i({kind:f([`connector`,`skill`,`agent`]),capability:l().trim().min(1).max(200),resolvedId:l().trim().min(1).max(300).optional(),readiness:f([`ready`,`needs_setup`,`unavailable`]),required:o(),recoveryPath:l().trim().min(1).max(2e3).optional(),reason:l().trim().min(1).max(500).optional()}),pe=i({kind:f([`connector`,`skill`,`agent`]),capability:l().trim().min(1).max(200),code:f([`not_installed`,`disabled`,`agent_not_allowed`,`scope_too_narrow`,`connection_missing`,`account_selection_required`,`reauthorization_required`,`requirements_unmet`,`model_invocation_disabled`,`tool_gated`,`agent_unavailable`]),message:l().trim().min(1).max(500),recoveryPath:l().trim().min(1).max(2e3)}),me=t(`state`,[i({state:d(`ready`)}),i({state:d(`needs_setup`),blockers:u(pe).min(1).max(12),recoveryActions:u(i({capability:l().trim().min(1).max(200),href:l().trim().min(1).max(2e3)})).min(1).max(12),degradedAction:i({mode:d(`degraded_start`)}).optional()})]),x=i({id:l().trim().min(1).max(200),revision:s().int().positive(),kind:f([`project_next_step`,`delivery_risk`,`meeting_prep`,`commitment_follow_up`,`automation_candidate`]),projectId:l().trim().min(1).max(200).optional(),title:l().trim().min(1).max(160),outcome:l().trim().min(1).max(1e3),rationale:l().trim().min(1).max(1500),evidence:u(de).min(1).max(8),confidence:f([`high`,`medium`,`low`]),urgency:f([`now`,`today`,`this_week`]),estimatedMinutes:s().int().min(1).max(480).optional(),risk:f([`analysis`,`external_read`,`file_write`,`external_write`]),proposedSteps:u(l().trim().min(1).max(500)).min(1).max(6),capabilities:u(fe).max(12),verification:u(l().trim().min(1).max(500)).max(8),actionPrompt:l().trim().min(1).max(4e3),degradedActionPrompt:l().trim().min(1).max(4e3).optional(),continuation:t(`kind`,[i({kind:d(`scene`),reason:d(`prior_success`),href:l().trim().min(1).max(2e3)}),i({kind:d(`automation`),reason:d(`repeated_success`),href:l().trim().min(1).max(4e3),successCount:s().int().min(2)})]).optional(),actions:i({canStart:o(),canDiscuss:o(),degradedStartAvailable:o()}),generatedAt:s().int().nonnegative(),expiresAt:s().int().nonnegative()}),he=i({id:l().trim().min(1).max(200),revision:s().int().positive(),question:l().trim().min(1).max(500),options:u(i({id:l().trim().min(1).max(100),label:l().trim().min(1).max(200)})).min(2).max(3),evidenceIds:u(l().trim().min(1).max(300)).min(1).max(8)}),ge=t(`state`,[i({state:d(`disabled`)}),i({state:d(`quiet`),reason:f([`no_change`,`insufficient_value`,`model_unavailable`,`generation_failed`,`budget_exhausted`])}),i({state:d(`refreshing`),previous:x.optional(),requestedAt:s().int().nonnegative()}),i({state:d(`clarification`),question:he,generatedAt:s().int().nonnegative(),expiresAt:s().int().nonnegative()}),i({state:d(`ready`),primary:x,alternatives:u(x).max(2),placement:f([`primary`,`compact`]),generatedAt:s().int().nonnegative(),expiresAt:s().int().nonnegative(),stale:o()})]);i({idempotencyKey:l().trim().min(1).max(200),locale:l().trim().max(30).optional()}),i({idempotencyKey:l().trim().min(1).max(200),expectedRevision:s().int().positive(),kind:f([`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]),reasonCode:l().trim().min(1).max(100).optional(),note:l().trim().min(1).max(1e3).optional(),snoozedUntil:s().int().nonnegative().optional()}),i({idempotencyKey:l().trim().min(1).max(200)});var _e=i({items:u(i({opportunity:x,status:f([`available`,`started`,`discussing`,`completed`,`snoozed`,`dismissed`,`expired`,`superseded`]),feedbackKind:f([`started`,`discussed`,`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]).optional(),updatedAt:s().int().nonnegative(),snoozedUntil:s().int().nonnegative().optional(),href:l().trim().min(1).max(2e3).optional()})).max(100)});i({idempotencyKey:l().trim().min(1).max(200),expectedRevision:s().int().positive(),mode:f([`start`,`degraded_start`,`discuss`])});var ve=t(`outcome`,[i({outcome:d(`task`),taskId:l(),href:l()}),i({outcome:d(`chat_draft`),href:l()}),i({outcome:d(`needs_setup`),preflight:me})]),ye=p({runningConversations:u(ue).default([]),needsUser:u(b),background:u(b),backgroundCount:s().int().nonnegative(),decisions:u(le),advisor:ge,attentionPolicy:p({visibleDecisionCount:s().int().nonnegative(),suppressedDecisionCount:s().int().nonnegative(),visibleAttentionCount:s().int().nonnegative(),suppressedAttentionCount:s().int().nonnegative()}).default({visibleDecisionCount:0,suppressedDecisionCount:0,visibleAttentionCount:0,suppressedAttentionCount:0})});i({window:i({since:s().int().nonnegative(),until:s().int().nonnegative()}),currentStrategyVersion:l().trim().min(1).max(100),generations:i({total:s().int().nonnegative(),succeeded:s().int().nonnegative(),quiet:s().int().nonnegative(),failed:s().int().nonnegative(),estimatedCostUsd:s().nonnegative()}),outcomes:i({opportunities:s().int().nonnegative(),started:s().int().nonnegative(),discussed:s().int().nonnegative(),completed:s().int().nonnegative(),corrected:s().int().nonnegative(),expired:s().int().nonnegative()}),rates:i({start:s().min(0).max(1),completionFromStarted:s().min(0).max(1),correction:s().min(0).max(1)}),feedback:i({alreadyDone:s().int().nonnegative(),irrelevant:s().int().nonnegative(),tooEarly:s().int().nonnegative(),sourceIncorrect:s().int().nonnegative(),lessLikeThis:s().int().nonnegative()}),strategies:u(i({version:l().trim().min(1).max(100),generations:s().int().nonnegative(),opportunities:s().int().nonnegative(),started:s().int().nonnegative(),completed:s().int().nonnegative()}))});var S=p({northStar:p({weeklyTrustedProgress:s(),weeklyActiveUsers:s(),trustedProgressPerWeeklyActiveUser:s()}),tasks:p({total:s(),achieved:s(),partial:s(),notAchieved:s(),userCorrected:s(),achievementRate:s(),correctionRate:s(),trusted:s(),trustedRate:s()})});function be(e){return ye.parse(e)}var xe=t(`kind`,[p({kind:d(`once`),at:l()}),p({kind:d(`interval`),everyMs:s().positive(),anchorMs:s().optional()}),p({kind:d(`cron`),expr:l(),tz:l().optional()})]),C=t(`kind`,[p({kind:d(`manual`)}),p({kind:d(`schedule`),schedule:xe}),p({kind:d(`webhook`),secretId:l().optional()}),p({kind:d(`event`),eventType:l(),source:l().optional(),payloadMatch:r(l(),ee([l(),s(),o(),te()])).optional()})]),w=t(`kind`,[p({kind:d(`agent`),agentId:l().optional(),instruction:l(),workingDirectory:l().optional(),model:l().optional(),timeoutSeconds:s().positive().optional()}),p({kind:d(`workflow`),workflowId:l(),agentId:l().optional(),input:a().optional(),inputEnvelope:a().optional(),goal:l().optional(),concurrency:s().int().positive().optional(),maxSubagents:s().int().nonnegative().optional(),timeoutSeconds:s().positive().optional()}),p({kind:d(`browser_automation`),automationId:l(),inputs:r(l(),a()).optional(),timeoutSeconds:s().positive().optional()}),p({kind:d(`task_command`),taskId:l(),command:ae}),p({kind:d(`system`),capability:f([`home.advisor.refresh`,`memory.temporal_sweep`,`memory.daily_reconciliation`,`memory.weekly_knowledge`])})]),T=f([`queued`,`running`,`cancelling`,`succeeded`,`failed`,`cancelled`,`timeout`]),E=p({id:l(),name:l(),description:l().optional(),projectId:l().optional(),enabled:o(),trigger:C,action:w,safety:p({mode:f([`suggest_only`,`ask_before_apply`,`auto_apply`])}).optional(),conversationMode:f([`new_session`,`continuous`]).optional(),notificationPolicy:f([`attention`,`all`,`none`]).optional(),completionWebhookUrl:l().optional(),reliability:p({executionTimeoutSeconds:s().positive().optional(),timeoutSeconds:s().positive().optional(),retryCount:s().int().nonnegative().optional(),maxConcurrentRuns:s().int().positive().optional(),disableAfterConsecutiveFailures:s().int().positive().optional()}).optional(),management:p({owner:l(),editable:u(f([`enabled`,`trigger`])),runnable:o(),deletable:o()}).optional(),state:p({nextRunAtMs:s().optional(),runningRunId:l().optional(),lastRunAtMs:s().optional(),lastRunStatus:T.optional(),lastError:l().optional(),consecutiveFailures:s().int().nonnegative().optional()}),createdAtMs:s(),updatedAtMs:s()}),D=p({id:l(),automationId:l(),automationName:l(),status:T,triggerSnapshot:C,actionSnapshot:w,manual:o(),createdAtMs:s(),startedAtMs:s().optional(),endedAtMs:s().optional(),durationMs:s().optional(),summary:l().optional(),error:l().optional(),conversationId:l().optional(),workflowRunId:l().optional(),model:l().optional(),deadlineAtMs:s().optional(),currentPhase:f([`queued`,`action`,`completion_hook`,`cancelling`,`completed`]).optional(),cancelRequestedAtMs:s().optional(),cancelConfirmedAtMs:s().optional(),termination:p({reason:f([`completed`,`failed`,`user_cancelled`,`deadline_exceeded`]),component:f([`automation`,`agent_turn`,`tool`,`mcp`,`process`]).optional(),componentName:l().optional(),cancellationConfirmed:o()}).optional(),heartbeatAtMs:s().optional(),leaseOwner:l().optional(),leaseExpiresAtMs:s().optional(),attemptNumber:s().int().positive().optional(),rootRunId:l().optional()}),O=p({id:l(),runId:l(),automationId:l(),type:f([`run.queued`,`run.started`,`run.deadline_resolved`,`run.cancel_requested`,`run.cancel_confirmed`,`run.cancellation_unconfirmed`,`run.recovered`,`action.started`,`action.retry_scheduled`,`action.completed`,`action.failed`,`completion_hook.started`,`completion_hook.completed`,`completion_hook.failed`,`run.completed`]),message:l(),data:a().optional(),createdAtMs:s()}),k=p({totalAutomations:s().int().nonnegative(),enabledAutomations:s().int().nonnegative(),runningRuns:s().int().nonnegative(),failedLastHour:s().int().nonnegative(),nextRun:p({automationId:l(),name:l(),runAtMs:s()}).optional()}),A=i({kind:f([`note`,`task`,`project`,`scene`,`local_app`]),id:l().min(1).max(512),revision:l().min(1).max(128)}),j=i({version:d(1),clientInstanceId:l().uuid(),tabId:l().uuid(),sequence:s().int().nonnegative().max(2**53-1),surface:f([`web`,`electron`,`mobile`]),resourceRefs:u(A).max(20),selection:i({text:l().max(16e3),draft:o().default(!1)}).optional(),capturedAt:s().int().nonnegative().max(2**53-1)}),M=p({snapshot:j,resources:u(p({reference:A,title:l(),text:l().max(16e3),truncated:o()})).max(20),selectionTrust:d(`user-supplied`)});function Se(e){let t=j.parse(e);if(new TextEncoder().encode(JSON.stringify(t)).byteLength>65536)throw Error(`App context exceeds 64 KiB`);let n=t.resourceRefs.map(e=>`${e.kind}:${e.id}`);if(new Set(n).size!==n.length)throw Error(`App context contains duplicate resources`);return t}var N=l().trim().min(1).max(200),P=u(N).max(100).refine(e=>new Set(e).size===e.length,`Duplicate identifiers`),Ce=[`no_change`,`observation`,`artifact`,`decision`,`state_change`,`effect_proposal`,`receipt`],F=[`needs_setup`,`active`,`paused`,`completed`,`archived`],we=t(`kind`,[i({kind:d(`personal`)}),i({kind:d(`project`),id:N}),i({kind:d(`conversation`),id:N}),i({kind:d(`objects`),ids:P.refine(e=>e.length>0)})]),Te=i({timeoutSeconds:s().int().min(1).max(600),maxIterations:s().int().min(1).max(30),maxToolCalls:s().int().min(0).max(100),maxOutputTokens:s().int().min(1).max(32768)}),I=i({schemaVersion:d(1),key:l().regex(/^[a-z][a-z0-9-]{0,79}$/),version:l().regex(/^\d+\.\d+\.\d+$/),title:l().trim().min(1).max(120),description:l().trim().min(1).max(2e3),goalMode:f([`finite`,`ongoing`]),contextProviders:P,triggers:u(t(`type`,[i({id:N,type:d(`manual`)}),i({id:N,type:d(`event`),eventType:N}),i({id:N,type:d(`schedule`)})])).min(1).max(20).refine(e=>new Set(e.map(e=>e.id)).size===e.length,`Duplicate trigger IDs`),execution:i({kind:d(`agent`),instruction:l().trim().min(1).max(32e3),limits:Te}),allowedOutcomeKinds:u(f(Ce)).min(1),allowedEffectHandlers:P}),Ee=i({accountIds:P,contextProviders:P,effectHandlers:P}),L=i({expectedRevision:s().int().nonnegative(),content:l().trim().max(32e3),validUntil:s().int().nonnegative().nullable().default(null)}),R=i({templateKey:N,templateVersion:N,goal:l().trim().min(1).max(12e3),scope:we,permissions:Ee}),z=R.extend({id:N,ownerId:N,workspaceId:l().min(1),status:f(F),setupMissing:u(l()).optional(),revision:s().int().positive()}),De=R.pick({goal:!0,scope:!0,permissions:!0}).extend({expectedRevision:s().int().positive()}),Oe=i({expectedRevision:s().int().positive(),status:f(F)}),B=i({subjectId:N,accountId:N,dueAt:s().int().nonnegative()}),ke=i({expectedRevision:s().int().positive(),dueAt:s().int().nonnegative().optional(),status:f([`watching`,`paused`,`completed`]).optional()}).refine(e=>e.dueAt!==void 0||e.status!==void 0,`Work item update is empty`),V=B.extend({id:N,activationId:N,revision:s().int().positive(),status:f([`watching`,`paused`,`completed`])}),H=s().int().min(0).max(23),U=i({level:f([`quiet`,`balanced`,`active`]).default(`balanced`),timezone:l().min(1).max(100).refine(e=>{try{return new Intl.DateTimeFormat(`en`,{timeZone:e}),!0}catch{return!1}}).default(`Asia/Shanghai`),quietStartHour:H.default(22),quietEndHour:H.default(8),dailyNotificationLimit:s().int().min(0).max(30).default(3),digestEnabled:o().default(!1),digestHour:H.default(18),digestMinute:s().int().min(0).max(59).default(0),preferredChannel:f([`in_app`,`browser`]).default(`browser`),suppressWhileViewing:o().default(!0),checksPaused:o().default(!1),checksPausedUntil:l().datetime({offset:!0}).nullable().default(null),notificationsMuted:o().default(!1)}),W=U.shape;i({expectedRevision:s().int().nonnegative(),level:W.level.removeDefault().optional(),timezone:W.timezone.removeDefault().optional(),quietStartHour:W.quietStartHour.removeDefault().optional(),quietEndHour:W.quietEndHour.removeDefault().optional(),dailyNotificationLimit:W.dailyNotificationLimit.removeDefault().optional(),digestEnabled:W.digestEnabled.removeDefault().optional(),digestHour:W.digestHour.removeDefault().optional(),digestMinute:W.digestMinute.removeDefault().optional(),preferredChannel:W.preferredChannel.removeDefault().optional(),suppressWhileViewing:W.suppressWhileViewing.removeDefault().optional(),checksPaused:W.checksPaused.removeDefault().optional(),checksPausedUntil:W.checksPausedUntil.removeDefault().optional(),notificationsMuted:W.notificationsMuted.removeDefault().optional()});var Ae=i({expectedRevision:s().int().nonnegative(),rating:f([`useful`,`not_useful`]),note:l().trim().max(2e3).optional()}),je=i({weekdays:u(s().int().min(0).max(6)).min(1).max(7).refine(e=>new Set(e).size===e.length,`Duplicate weekdays`),hour:s().int().min(0).max(23),minute:s().int().min(0).max(59),timeZone:l().trim().min(1).max(100).refine(e=>{try{return new Intl.DateTimeFormat(`en`,{timeZone:e}),!0}catch{return!1}},`Invalid time zone`)});f([`http`,`agent`,`cli`,`automation`,`mcp`,`extension`]),f([`INVALID_INPUT`,`FORBIDDEN`,`NOT_FOUND`,`REVISION_CONFLICT`,`CONTRACT_CHANGED`,`APPROVAL_REQUIRED`,`IN_PROGRESS`,`UNAVAILABLE`,`OUTCOME_UNKNOWN`,`CANCELLED`,`INTERNAL`]);var Me=i({majorVersion:s().int().positive(),descriptorDigest:l().regex(/^[a-f0-9]{64}$/),input:c(),idempotencyKey:l().min(1).max(200).optional()}),Ne=p({triggerSummary:l(),actionSummary:l(),safetyNotes:u(l()),requiredConfirmations:u(l()),canRunNow:o(),runNowBlockedReason:l().optional()});i({agentId:l().trim().min(1).max(64).optional(),language:f([`en`,`zh`]).default(`en`)}),p({draftId:l(),explanation:l(),assumptions:u(l()),risks:u(l()),automation:n({name:l(),trigger:c(),action:c()}),simulation:Ne,repairAttempts:s().int().nonnegative()}),p({draftId:l(),patch:r(l(),c()),explanation:l(),expectedEffect:l(),risks:u(l()),requiresApproval:o(),repairAttempts:s().int().nonnegative()});var Pe=i({eventId:l().min(1),kind:f([`note`,`task`,`project`,`automation`,`scene`,`local_app`]),id:l().min(1),revision:s().int().nonnegative(),operation:f([`created`,`updated`,`deleted`]),operationId:l().optional()}),G=i({id:l().trim().min(1).max(512)}),K=i({limit:s().int().min(1).max(100).default(50),afterId:l().max(200).default(``)});p({activation:z}),Oe.extend({id:l().min(1).max(512)}),p({activation:z}),U.extend({revision:s().int().positive()}),Ae.extend({id:l().min(1).max(512)}),p({revision:s().int().positive()}),G.extend({read:o()}),p({ok:d(!0),presentationId:l(),read:o()}),G.extend({triggerKey:l().min(1).max(200),expectedRevision:s().int().nonnegative(),schedule:je}),p({revision:s().int().positive()}),De.extend({id:l().min(1).max(512)}),p({activation:z}),p({intentId:l()}),L.extend({id:l().min(1).max(512)}),p({revision:s().int().positive()}),B.extend({id:l().min(1).max(512)}),p({workItem:V}),ke.safeExtend({id:l().min(1).max(512)}),p({workItem:V});var q=n({id:l(),activationId:l(),outcomeId:l(),status:l(),content:c(),readOnly:o(),createdAt:s(),sources:u(p({kind:l(),title:l(),sender:l(),href:l()})),sourceHealth:r(l(),c()).nullable()});G.extend({expectedVersion:s().int().positive(),reason:l().trim().min(1).max(4096).default(`TaskRun cancelled`)}),G.extend({rating:f([`helpful`,`not_helpful`]),reason:l().trim().max(4096).optional()}),p({ok:d(!0),feedback:p({id:l(),runId:l(),rating:f([`helpful`,`not_helpful`]),reason:l().optional(),createdAt:s()})}),p({ok:d(!0),run:h,receipt:g,model:_.pick({task:!0,operationalState:!0,attention:!0,allowedCommands:!0}),executionStopConfirmed:d(!1)}),G.extend({enabled:o(),expectedRevision:s().int().nonnegative()}),p({ok:d(!0),automation:E.loose()}).extend({run:D.loose()}),p({ok:d(!0),cancelled:o(),confirmed:o()}),p({ok:d(!0),marked:d(!0)}),i({projectId:l().trim().min(1).max(512).optional()}),p({ok:d(!0),count:s().int().nonnegative()}),G.extend({expectedRevision:s().int().nonnegative().nullable()}),p({ok:d(!0),removed:o(),automation:E.loose().optional(),cancelRunId:l().optional()});var Fe=i({status:f([`inbox`,`processed`,`archived`,`trashed`]).optional(),kind:f([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]).optional(),tag:l().max(512).optional(),projectId:l().min(1).max(512).optional(),unassigned:o().optional(),agentEdited:o().optional(),search:l().max(4096).optional(),pinned:o().optional(),limit:s().int().min(1).max(100).default(20),offset:s().int().min(0).default(0),sortBy:f([`createdAt`,`updatedAt`,`lastOpenedAt`]).optional(),sortOrder:f([`asc`,`desc`]).optional()}),J=n({id:l().min(1),markdown:l(),kind:f([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]),status:f([`inbox`,`processed`,`archived`,`trashed`]),createdAt:s(),updatedAt:s(),title:l().optional(),localVersion:s().optional()}),Ie=p({note:J});G.extend({expectedRevision:s().int().positive(),revokeShares:o().default(!0)}),p({deleted:d(!0),revokedShares:s().int().nonnegative()});var Le=i({title:l().max(1e3).optional(),markdown:l().max(2e6).default(``),kind:J.shape.kind.optional(),tags:u(l().max(512)).max(100).optional(),capturedVia:i({channel:f([`app`,`web`,`electron`,`tui`,`telegram`,`wechat`,`feishu`]),platform:f([`ios`,`android`,`harmonyos`]).optional()}).default({channel:`web`}),pinned:o().default(!1),projectId:l().min(1).optional()});i({id:l().min(1),expectedRevision:s().int().positive(),trigger:f([`edit`,`ai_edit`,`sync`,`restore`]).optional(),patch:i({title:l().max(1e3).optional(),markdown:l().max(2e6).optional(),tags:u(l().max(512)).max(100).optional(),pinned:o().optional(),kind:J.shape.kind.optional(),status:J.shape.status.optional(),localVersion:s().int().positive().optional(),ai:r(l(),c()).optional(),aiDeep:n({processedAt:s()}).optional()})}),i({text:l().trim().min(1).max(2e6),capturedVia:Le.shape.capturedVia}),i({id:l().min(1),expectedRevision:s().int().positive().optional(),content:l().trim().min(1).max(2e6),heading:l().trim().min(1).max(1e3).default(`AI 讨论沉淀`)}),i({id:l().min(1),timestamp:s().int().positive(),expectedRevision:s().int().positive()});var Re=n({items:u(n({id:l().min(1)})),total:s().int().nonnegative()}),ze=i({phase:ie.optional(),priority:ne.optional(),projectId:l().min(1).max(512).optional(),search:l().max(4096).optional(),limit:s().int().min(1).max(200).default(50),offset:s().int().nonnegative().default(0)}),Y=n({id:l().min(1),name:l(),slug:l(),status:f([`planned`,`active`,`paused`,`completed`,`cancelled`,`archived`]),executionMode:f([`local_checkout`,`managed_worktree`]),successCriteria:u(l()),scope:r(l(),a()),nonGoals:u(l()),health:f([`unknown`,`on_track`,`at_risk`,`off_track`]),version:s().int().positive(),createdAt:s(),updatedAt:s(),workspaceRoot:l().optional(),defaultAgentId:l().optional()}),Be=i({id:l().trim().min(1),expectedVersion:s().int().positive(),pinned:o()});p({ok:d(!0),project:Y}),i({workspacePath:l().trim().min(1).max(4096),agentId:l().trim().min(1).max(512).optional(),defaultAgentId:l().trim().max(512).optional(),projectKind:f([`auto`,`coding`,`general`,`unknown`]).optional(),autoCreate:o().default(!1),conversationId:e().optional()}),p({ok:d(!0),project:Y.nullable(),reason:f([`exact`,`contained`,`auto_created`]).optional(),created:o().optional()}),Be.omit({pinned:!0}),p({ok:d(!0),deleted:d(!0),executionStopConfirmed:d(!1)});var X={name:l().trim().min(1).max(1e3).optional(),description:l().max(2e4).optional(),defaultAgentId:l().trim().max(512).optional(),workspaceRoot:l().trim().min(1).max(4096).optional(),createWorkspaceRoot:o().optional(),executionMode:Y.shape.executionMode.optional(),brief:l().max(2e4).optional(),instructions:l().max(1e5).optional(),outcome:l().max(2e4).optional(),successCriteria:u(l().max(4096)).max(100).optional(),scope:r(l(),c()).optional(),nonGoals:u(l().max(4096)).max(100).optional(),health:Y.shape.health.optional(),ownerId:l().max(512).optional(),targetAt:s().finite().optional()};i({...X,projectKind:f([`auto`,`coding`,`general`,`unknown`]).optional(),autoUnderstand:o().default(!1)}).refine(e=>!!(e.name||e.workspaceRoot),`name or workspaceRoot is required`),i({id:l().trim().min(1),expectedVersion:s().int().positive(),patch:i({...X,status:Y.shape.status.optional(),description:X.description.unwrap().nullable().optional(),defaultAgentId:X.defaultAgentId.unwrap().nullable().optional(),workspaceRoot:l().trim().max(4096).nullable().optional(),brief:X.brief.unwrap().nullable().optional(),instructions:X.instructions.unwrap().nullable().optional(),outcome:X.outcome.unwrap().nullable().optional(),ownerId:X.ownerId.unwrap().nullable().optional(),targetAt:X.targetAt.unwrap().nullable().optional()}).refine(e=>Object.values(e).some(e=>e!==void 0),`Empty project patch`)});var Ve=i({status:Y.shape.status.optional(),search:l().max(4096).optional(),sortBy:f([`updatedAt`,`createdAt`,`name`]).optional(),sortOrder:f([`asc`,`desc`]).optional(),limit:s().int().min(1).max(500).default(50),offset:s().int().nonnegative().default(0)}),Z=n({id:l(),projectId:l(),title:l(),status:f([`planned`,`active`,`completed`,`cancelled`]),sortOrder:s(),createdAt:s(),updatedAt:s()}),Q=n({id:l(),projectId:l(),summary:l(),health:Y.shape.health,createdAt:s()}),$={title:l().trim().min(1).max(1e3),description:l().max(2e4).optional(),status:Z.shape.status.optional(),targetAt:s().int().nonnegative().optional(),sortOrder:s().int().optional()};i({projectId:l().trim().min(1),...$}),i({projectId:l().trim().min(1),id:l().trim().min(1),expectedRevision:s().int().nonnegative(),patch:i({...$,description:l().max(2e4).nullable().optional(),targetAt:s().int().nonnegative().nullable().optional()}).partial().refine(e=>Object.values(e).some(e=>e!==void 0),`Empty milestone patch`)}).omit({patch:!0}),p({ok:d(!0),milestone:Z,project:Y}),p({ok:d(!0),deleted:d(!0)}),i({projectId:l().trim().min(1),expectedVersion:s().int().positive(),health:Y.shape.health,summary:l().trim().min(1).max(2e4),progress:u(l().max(1e4)).max(100).default([]),risks:u(l().max(1e4)).max(100).default([]),nextSteps:u(l().max(1e4)).max(100).default([])}),p({ok:d(!0),update:Q,project:Y});var He={"xopc.context.resolve":{input:j,output:M},"xopc.notes.preview_edit":{input:G.extend({instruction:l().trim().min(1).max(16e3),markdown:l().max(2e6).optional()}),output:p({message:l(),patch:p({id:l(),summary:l(),operations:u(p({type:d(`replaceRange`),from:s().int().nonnegative(),to:s().int().nonnegative(),markdown:l()}))})})},"xopc.automations.get_run":{input:G,output:p({ok:d(!0),run:D.loose()})},"xopc.automations.run_events":{input:G,output:p({ok:d(!0),events:u(O.loose())})},"xopc.automations.metrics":{input:i({}),output:p({ok:d(!0),metrics:k})},"xopc.automations.product_events":{input:i({eventType:l().trim().min(1).max(512),source:l().trim().min(1).max(512).optional(),payloadKey:l().trim().min(1).max(512).optional(),payloadValue:l().max(4096).optional(),limit:s().int().min(1).max(100).default(10)}).refine(e=>e.payloadKey===void 0==(e.payloadValue===void 0),`payloadKey and payloadValue must be supplied together`),output:p({ok:d(!0),items:u(p({run:D.loose(),triggerEvent:O.loose()}))})},"xopc.automations.list":{input:i({projectId:l().trim().min(1).optional()}),output:p({ok:d(!0),items:u(E.loose()),projectId:l().optional()})},"xopc.automations.get":{input:G,output:p({ok:d(!0),automation:E.loose()})},"xopc.automations.history":{input:i({automationId:l().trim().min(1).optional(),projectId:l().trim().min(1).optional(),limit:s().int().min(1).max(200).default(50)}),output:p({ok:d(!0),items:u(D.loose()),projectId:l().optional()})},"xopc.scenes.templates":{input:i({}),output:p({templates:u(I)})},"xopc.scenes.mail_accounts":{input:i({}),output:p({accounts:u(p({id:l(),label:l()}))})},"xopc.scenes.mail_sources":{input:K,output:p({sources:u(p({id:l(),accountId:l(),subject:l(),sender:l()})),nextCursor:l().nullable()})},"xopc.scenes.results":{input:K.extend({activationId:l().min(1).max(200).optional()}),output:p({outcomes:u(q),nextCursor:l().nullable()})},"xopc.scenes.get_presentation":{input:G,output:p({outcome:q})},"xopc.scenes.get_feedback":{input:G,output:p({feedback:p({rating:f([`useful`,`not_useful`]),note:l(),revision:s().int().nonnegative()}).nullable()})},"xopc.scenes.digest_results":{input:K.extend({id:l().min(1).max(512)}),output:p({outcomes:u(q),nextCursor:l().nullable()})},"xopc.scenes.metrics":{input:i({days:s().int().min(1).max(90).default(7)}),output:p({window:p({since:s(),until:s(),days:s().int()}),ratedOutcomes:s().int().nonnegative(),usefulOutcomes:s().int().nonnegative(),unhelpfulOutcomes:s().int().nonnegative(),scenesWithUsefulOutcomes:s().int().nonnegative(),checks:s().int().nonnegative(),failedChecks:s().int().nonnegative(),skippedChecks:s().int().nonnegative()})},"xopc.scenes.diagnostics":{input:i({}),output:p({checksPaused:o(),currentModel:l().nullable(),pendingChecks:s().int().nonnegative(),oldestDueWaitMs:s().nonnegative(),lastSevenDays:p({modelCalls:s().int().nonnegative(),connectorReads:s().int().nonnegative(),tokens:s().nonnegative(),estimatedCost:s().nonnegative()}),notifications:u(p({status:l(),count:s().int().nonnegative()})),activations:u(r(l(),c()))})},"xopc.scenes.get_preferences":{input:i({}),output:U.extend({revision:s().int().nonnegative()})},"xopc.scenes.preflight":{input:R,output:p({ready:o(),missing:u(l())})},"xopc.scenes.get_template":{input:i({key:l().min(1).max(200),version:l().min(1).max(200)}),output:p({template:I})},"xopc.scenes.list":{input:K,output:p({activations:u(z),nextCursor:l().nullable()})},"xopc.scenes.get":{input:G,output:p({activation:z,runs:u(n({id:l(),status:l(),attempt:s().int(),reason:l().nullable(),createdAt:s()})),schedules:u(n({triggerKey:l(),revision:s().int(),nextDueAt:s(),schedule:c()}))})},"xopc.scenes.read_notes":{input:G,output:p({notes:p({content:l(),revision:s().int().nonnegative(),validUntil:s().nullable()})})},"xopc.scenes.list_runs":{input:K.extend({id:l().min(1).max(512)}),output:p({runs:u(n({id:l(),activationId:l(),status:l(),attempt:s().int(),reason:l().nullable(),createdAt:s()})),nextCursor:l().nullable()})},"xopc.scenes.list_schedules":{input:G,output:p({schedules:u(n({triggerKey:l(),revision:s().int(),nextDueAt:s(),schedule:c()}))})},"xopc.scenes.list_work_items":{input:K.extend({id:l().min(1).max(512)}),output:p({workItems:u(n({id:l(),subjectId:l(),accountId:l(),dueAt:s(),status:l(),revision:s().int(),lastCheckReason:l().nullable()})),nextCursor:l().nullable()})},"xopc.settings.open":{input:i({section:l().trim().regex(/^[a-z0-9][a-z0-9/_-]*$/i).max(512).default(`overview`),title:l().trim().min(1).max(512).default(`Settings`),summary:l().trim().max(4096).optional()}),output:p({ok:d(!0),settings:p({section:l(),title:l(),summary:l().optional()})})},"xopc.local_apps.list":{input:i({}),output:p({apps:u(ce)})},"xopc.local_apps.get":{input:G,output:p({app:v})},"xopc.local_apps.validate":{input:G,output:p({validation:se})},"xopc.projects.get":{input:G,output:p({ok:d(!0),project:Y})},"xopc.projects.list":{input:Ve,output:n({ok:d(!0),items:u(Y),total:s().int().nonnegative()})},"xopc.projects.list_milestones":{input:G,output:p({ok:d(!0),projectId:l(),items:u(Z)})},"xopc.projects.list_updates":{input:G.extend({limit:s().int().min(1).max(500).default(20)}),output:p({ok:d(!0),projectId:l(),items:u(Q)})},"xopc.task_runs.get":{input:G,output:p({ok:d(!0),run:h,receipt:g.optional(),events:u(re),activeWaits:u(m)})},"xopc.task_runs.list":{input:i({taskId:l().trim().min(1),limit:s().int().min(1).max(200).default(20)}),output:p({ok:d(!0),taskId:l(),items:u(h),receipts:u(g),activeWaits:u(m)})},"xopc.notes.project_summaries":{input:i({}),output:p({items:u(p({id:l(),name:l(),description:l().optional(),noteCount:s().int().nonnegative(),updatedAt:s().optional()}))})},"xopc.notes.history":{input:G,output:p({entries:u(p({timestamp:s().int().nonnegative(),trigger:f([`edit`,`ai_edit`,`sync`,`restore`]),snippet:l().optional()}))})},"xopc.notes.snapshot":{input:G.extend({timestamp:s().int().nonnegative()}),output:p({snapshot:p({noteId:l(),timestamp:s().int().nonnegative(),trigger:f([`edit`,`ai_edit`,`sync`,`restore`]),title:l().optional(),markdown:l(),tags:u(l()).optional(),kind:J.shape.kind,status:J.shape.status})})},"xopc.notes.get":{input:G,output:Ie},"xopc.notes.list":{input:Fe,output:Re},"xopc.tasks.metrics":{input:i({}),output:p({ok:d(!0),metrics:S})},"xopc.tasks.get":{input:G,output:_},"xopc.tasks.list":{input:ze,output:oe.extend({total:s().int().nonnegative()})}};export{ve as a,Se as i,He as n,_e as o,Pe as r,be as s,Me as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/skills-page-C35VKjhb.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-DalslRUx.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-CI_fqRk-.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-DlT9KqwF.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-BMYIfy9x.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/locale-store-wNXWkWu5.js","assets/messages-fmf0dnr4.js","assets/cn-JdwAhgNB.js","assets/app-link-C6gA5Nck.js","assets/product-delivery-bv3z8Xkh.js","assets/schemas-88fK3zzl.js","assets/local-apps-Bpja8nC6.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-DSjfHfaW.css","assets/dist-Che_jiQF.js","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/popover-select-DcsFzD_i.js","assets/dist-3h6cXXhT.js","assets/skeleton-BwbyijEw.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/settings-shell-layer-context-BTQUDoJ2.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/globe-DSSGFWFn.js","assets/link-2-D_ZKYUW7.js","assets/loader-circle-CifKLtgG.js","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/pencil-DmIY3Oa-.js","assets/rotate-cw-LIg3Am9S.js","assets/search-DA7gz22f.js","assets/middleware-Pd0e8Igk.js","assets/capabilities-CHA-sTAZ.js","assets/tasks-CDR_RVbQ.js","assets/conversation-identity-Cw0n9uzK.js","assets/files-BK6enEvD.js","assets/tool-activity-BtJkgjFf.js","assets/turn-outcome-D0SnyZ3Z.js","assets/button-CS04eWY9.js","assets/registry-api-BIpltJ47.js","assets/gateway-startup-retry-6jLRcQsu.js","assets/gateway-config-swr-cR-tz7-Q.js","assets/electron-env-Dit0bHgy.js","assets/index-BEw0xrde.css","assets/page-tabs-vqI30Yrg.js","assets/capability-header-actions-vmx35sbu.js","assets/capability-icon-BYm2-nS-.js","assets/skill-api-CiBGQ0Jg.js","assets/skill-reload-api-BHnru0F5.js","assets/connectors-page-DZYgogQw.js","assets/connector-service-page-BKCZMmwm.js","assets/agent-plugin-dialog-BeNnu1Ts.js","assets/apps-page-DVNySL58.js","assets/agents-udIitwV8.js","assets/directory-picker-path-field-hqJ9sFCR.js","assets/settings-page-layout-X1x-2Cp9.js","assets/channels-Eo4ONF5X.js","assets/browser-BLJWD7WI.js","assets/schema-form-BKj6wIMb.js","assets/settings-loading-skeleton-CAmWMaOT.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{m as a,r as o}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as s}from"./messages-fmf0dnr4.js";import{n as c}from"./locale-store-wNXWkWu5.js";import{t as l}from"./skeleton-BwbyijEw.js";import{Ec as u,Ho as d}from"./index-DalslRUx.js";import{t as f}from"./capability-header-actions-vmx35sbu.js";var p=n(),m=e(t(),1),h=r(),g=(0,m.lazy)(()=>i(()=>import(`./skills-page-C35VKjhb.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]))),_=(0,m.lazy)(()=>i(()=>import(`./connectors-page-DZYgogQw.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,67]))),v=(0,m.lazy)(()=>i(()=>import(`./apps-page-DVNySL58.js`).then(e=>({default:e.ExtensionsPage})),__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,62,67]))),y=(0,m.lazy)(()=>i(()=>import(`./agents-udIitwV8.js`).then(e=>({default:e.AgentsSettingsPanel})),__vite__mapDeps([69,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,70,71]))),b=(0,m.lazy)(()=>i(()=>import(`./channels-Eo4ONF5X.js`).then(e=>({default:e.ChannelsSettingsPanel})),__vite__mapDeps([72,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,73,74,75,71])));function x(e){return u.includes(e)?e:null}function S(e){let t=(0,p.c)(3),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Array.from({length:6},C),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,h.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 C(e,t){return(0,h.jsx)(l,{className:`h-40 rounded-xl`},t)}function w(){let e=(0,p.c)(41),t=c(D),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n,i=r.capabilitiesHub,{section:l,detailId:u}=a(),C;e[2]===l?C=e[3]:(C=x(l),e[2]=l,e[3]=C);let w=C,O=w??`skills`,k=r.productNavigation.sections[`capabilities-${O}`],A=d(E),j=d(T),M;e[4]===O?M=e[5]:(M={section:O,value:null},e[4]=O,e[5]=M);let[N,P]=(0,m.useState)(M),F=N.section===O?N.value:null,I;e[6]===O?I=e[7]:(I=e=>{P({section:O,value:e})},e[6]=O,e[7]=I);let L=I,R,z;if(e[8]!==j||e[9]!==F||e[10]!==k||e[11]!==A?(R=()=>(A({startExtra:null,main:(0,h.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:k}),end:(0,h.jsx)(f,{contribution:F})}),()=>j()),z=[j,F,k,A],e[8]=j,e[9]=F,e[10]=k,e[11]=A,e[12]=R,e[13]=z):(R=e[12],z=e[13]),(0,m.useLayoutEffect)(R,z),!w){let t;return e[14]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(o,{to:`/capabilities/skills`,replace:!0}),e[14]=t):t=e[14],t}let B;e[15]===i.discoverLoading?B=e[16]:(B=(0,h.jsx)(S,{label:i.discoverLoading}),e[15]=i.discoverLoading,e[16]=B);let V;e[17]!==u||e[18]!==L||e[19]!==O?(V=O===`agents`?(0,h.jsx)(y,{agentId:u,onHeaderActionChange:L}):null,e[17]=u,e[18]=L,e[19]=O,e[20]=V):V=e[20];let H;e[21]!==L||e[22]!==O?(H=O===`skills`?(0,h.jsx)(g,{embedded:!0,onHeaderActionChange:L}):null,e[21]=L,e[22]=O,e[23]=H):H=e[23];let U;e[24]!==L||e[25]!==O?(U=O===`connectors`?(0,h.jsx)(_,{embedded:!0,onHeaderActionChange:L}):null,e[24]=L,e[25]=O,e[26]=U):U=e[26];let W;e[27]!==u||e[28]!==L||e[29]!==O?(W=O===`channels`?(0,h.jsx)(b,{channelId:u,onHeaderActionChange:L}):null,e[27]=u,e[28]=L,e[29]=O,e[30]=W):W=e[30];let G;e[31]!==L||e[32]!==O?(G=O===`extensions`?(0,h.jsx)(v,{embedded:!0,onHeaderActionChange:L}):null,e[31]=L,e[32]=O,e[33]=G):G=e[33];let K;return e[34]!==W||e[35]!==G||e[36]!==B||e[37]!==V||e[38]!==H||e[39]!==U?(K=(0,h.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:(0,h.jsxs)(m.Suspense,{fallback:B,children:[V,H,U,W,G]})}),e[34]=W,e[35]=G,e[36]=B,e[37]=V,e[38]=H,e[39]=U,e[40]=K):K=e[40],K}function T(e){return e.clearPageHeader}function E(e){return e.setPageHeader}function D(e){return e.language}export{w as CapabilitiesPage};