@xopcai/xopc 0.0.167 → 0.0.169

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 (137) 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/{activity-store-DjEDu38T.js → activity-store-DumQD8EX.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DQULz7qY.js → agent-avatar-dicebear-CNI1HQdV.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agents-CnzkBgKC.js → agents-DfpeWAnu.js} +2 -2
  6. package/dist/gateway/static/root/assets/{api-DwVCuPOb.js → api-D7eNcGmE.js} +1 -1
  7. package/dist/gateway/static/root/assets/{app-management-settings-panel-DOjWALVF.js → app-management-settings-panel-BPbnbnFn.js} +1 -1
  8. package/dist/gateway/static/root/assets/{appearance-settings-C31COUIC.js → appearance-settings-WWFCDver.js} +1 -1
  9. package/dist/gateway/static/root/assets/{apps-page-lSC486eu.js → apps-page-B27faKqW.js} +1 -1
  10. package/dist/gateway/static/root/assets/{archive-plugin-DQPvLqfx.js → archive-plugin-Cu2dsFtI.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-DwT1x1rc.js → attachment-load-C9mycbtr.js} +1 -1
  12. package/dist/gateway/static/root/assets/{automation-suggestion-card-ByYBiiMR.js → automation-suggestion-card-DtHqVViI.js} +1 -1
  13. package/dist/gateway/static/root/assets/{automations-page-iZTnc1YZ.js → automations-page-BoH5grBX.js} +1 -1
  14. package/dist/gateway/static/root/assets/{binary-plugins-CRXiHoZS.js → binary-plugins-DqrPRyjm.js} +1 -1
  15. package/dist/gateway/static/root/assets/{block-editor-CHO6ILiz.js → block-editor-B9dc3pqc.js} +1 -1
  16. package/dist/gateway/static/root/assets/{browser-settings-page-C-OOPZcJ.js → browser-settings-page-CK2fnxHY.js} +1 -1
  17. package/dist/gateway/static/root/assets/{browser-workflow-inputs-3UaarfXS.js → browser-workflow-inputs-70k5yvTc.js} +1 -1
  18. package/dist/gateway/static/root/assets/{browser-workflows-page-BFaa-N_D.js → browser-workflows-page-DBNuaWwR.js} +1 -1
  19. package/dist/gateway/static/root/assets/{capabilities-settings-panel-BayH0Uom.js → capabilities-settings-panel-gg9GXU00.js} +6 -6
  20. package/dist/gateway/static/root/assets/{capability-presets-api-DdCHSzcA.js → capability-presets-api-CvV4M4Oe.js} +1 -1
  21. package/dist/gateway/static/root/assets/capability-presets-settings-panel-A1qGVyll.js +1 -0
  22. package/dist/gateway/static/root/assets/{channel-recipient-api-BOkLI89e.js → channel-recipient-api-BnLOBd7v.js} +1 -1
  23. package/dist/gateway/static/root/assets/{channels-settings-C-Spmwr5.js → channels-settings-H4vCzqiD.js} +1 -1
  24. package/dist/gateway/static/root/assets/channels-status-swr-DtswVkDX.js +1 -0
  25. package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-uQ0fehio.js → chunk-KS7C4IRE-BMhrPKJC.js} +2 -2
  26. package/dist/gateway/static/root/assets/{connector-logo-CbcC0T6i.js → connector-logo-CYQPu4Nn.js} +1 -1
  27. package/dist/gateway/static/root/assets/{connectors-page-DpDmJ3Nx.js → connectors-page-DphVkloc.js} +1 -1
  28. package/dist/gateway/static/root/assets/{desktop-pet-CR7RGQff.js → desktop-pet-Deb8fsr-.js} +1 -1
  29. package/dist/gateway/static/root/assets/{desktop-pet-settings-BudmCcPE.js → desktop-pet-settings-DHTY5Ku1.js} +1 -1
  30. package/dist/gateway/static/root/assets/{directory-picker-path-field-BLG2Oe6z.js → directory-picker-path-field-cGL2aEB6.js} +1 -1
  31. package/dist/gateway/static/root/assets/{dreaming-settings-BwBGC0SG.js → dreaming-settings-C2XF2wL4.js} +1 -1
  32. package/dist/gateway/static/root/assets/{extension-debug-page-Pr65_hLC.js → extension-debug-page-F8AzDx0d.js} +1 -1
  33. package/dist/gateway/static/root/assets/{extension-page-BuJDcoKn.js → extension-page-ZrX_Ge87.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-settings-page-B3802tn5.js → extension-settings-page-VypAD6ok.js} +1 -1
  35. package/dist/gateway/static/root/assets/{gateway-config-api-D-NVkfts.js → gateway-config-api-C-UsxEKi.js} +1 -1
  36. package/dist/gateway/static/root/assets/{gateway-settings-DIdsKVXv.js → gateway-settings-ChG26Coy.js} +1 -1
  37. package/dist/gateway/static/root/assets/{gateway-startup-retry-qnEmj-vL.js → gateway-startup-retry-D73V3EVy.js} +1 -1
  38. package/dist/gateway/static/root/assets/{goal-create-dialog-51j_DxgV.js → goal-create-dialog-B6aBG2KK.js} +1 -1
  39. package/dist/gateway/static/root/assets/{goal-detail-page-CeqMr5GF.js → goal-detail-page-B_G9oVL1.js} +3 -3
  40. package/dist/gateway/static/root/assets/{goals-config-api-BkVBh7ct.js → goals-config-api-fv7JLhjy.js} +1 -1
  41. package/dist/gateway/static/root/assets/{goals-page-lf3oM4Xa.js → goals-page-BQmg_7aD.js} +1 -1
  42. package/dist/gateway/static/root/assets/{goals-settings-Cg7MJLvx.js → goals-settings-DlfyneMz.js} +1 -1
  43. package/dist/gateway/static/root/assets/{heartbeat-settings-BV3kJOcX.js → heartbeat-settings-BPyFbSbh.js} +1 -1
  44. package/dist/gateway/static/root/assets/image-generation-api-CSKX7PsM.js +1 -0
  45. package/dist/gateway/static/root/assets/index-DJtuKve9.js +199 -0
  46. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B9K5rTZZ.js → keyboard-shortcuts-settings-BUxrnWH_.js} +1 -1
  47. package/dist/gateway/static/root/assets/{local-app-workbench-page-ehzr9CBG.js → local-app-workbench-page-Dzlj4fH8.js} +1 -1
  48. package/dist/gateway/static/root/assets/{local-apps-page-BBx6mfAD.js → local-apps-page-BsZMeDnS.js} +1 -1
  49. package/dist/gateway/static/root/assets/{locale-store-tnRLWdx2.js → locale-store-DXq-Y8Bi.js} +1 -1
  50. package/dist/gateway/static/root/assets/{logs-page-xuwEkusZ.js → logs-page-Bg1B-cKU.js} +1 -1
  51. package/dist/gateway/static/root/assets/{markdown-split-DRDddIt8.js → markdown-split-Cmaw70yM.js} +1 -1
  52. package/dist/gateway/static/root/assets/{media-plugins-Dn3hxhOV.js → media-plugins-Blqj_oJD.js} +1 -1
  53. package/dist/gateway/static/root/assets/{messages-B1EG4gdu.js → messages-Cj_n7gUv.js} +2 -2
  54. package/dist/gateway/static/root/assets/notes-page-B6Fdlf_s.js +1 -0
  55. package/dist/gateway/static/root/assets/{notes-workbench-DXGXn5XF.js → notes-workbench-4HYPR6Hb.js} +2 -2
  56. package/dist/gateway/static/root/assets/{page-tabs-P2BEd1D8.js → page-tabs-D6zFoyJY.js} +1 -1
  57. package/dist/gateway/static/root/assets/{preview-open-alternatives-DrkjmW0F.js → preview-open-alternatives-BLoo7Ad8.js} +1 -1
  58. package/dist/gateway/static/root/assets/{product-open-page-CGzMEowb.js → product-open-page-0-tt2dp7.js} +1 -1
  59. package/dist/gateway/static/root/assets/{project-detail-page-IiE2ddWb.js → project-detail-page-CGa68F1d.js} +1 -1
  60. package/dist/gateway/static/root/assets/{projects-page-DGOVhaYI.js → projects-page-BXmIeErj.js} +1 -1
  61. package/dist/gateway/static/root/assets/{remote-access-hub-l_y_Shgl.js → remote-access-hub-bxrIHaRt.js} +1 -1
  62. package/dist/gateway/static/root/assets/{save-bar-controls-BkGrufxl.js → save-bar-controls-9ujl7LRy.js} +1 -1
  63. package/dist/gateway/static/root/assets/{schedule-field-A8tDpL-9.js → schedule-field-e80Mj-0z.js} +1 -1
  64. package/dist/gateway/static/root/assets/{schema-form-N6_hDWgx.js → schema-form-DYZQD-PL.js} +1 -1
  65. package/dist/gateway/static/root/assets/{sessions-page-CAX4ipPv.js → sessions-page-D_7ms_LG.js} +1 -1
  66. package/dist/gateway/static/root/assets/settings-advanced-gate-VLuu9WHc.js +1 -0
  67. package/dist/gateway/static/root/assets/{settings-form-section-Bb6yYt5f.js → settings-form-section-Clt3p-mk.js} +1 -1
  68. package/dist/gateway/static/root/assets/{settings-loading-skeleton-Q_Vh6HEl.js → settings-loading-skeleton-CTuS66nC.js} +1 -1
  69. package/dist/gateway/static/root/assets/{settings-page-CjOtQpbR.js → settings-page-CMP_owwc.js} +1 -1
  70. package/dist/gateway/static/root/assets/{settings-page-layout-CtESNNdx.js → settings-page-layout-BWUV_wx6.js} +1 -1
  71. package/dist/gateway/static/root/assets/{setup-status-panel-CGxHXgJB.js → setup-status-panel-CAClgrxi.js} +1 -1
  72. package/dist/gateway/static/root/assets/{share-preview-page-C65IsFmd.js → share-preview-page-tISZJtRK.js} +1 -1
  73. package/dist/gateway/static/root/assets/{shares-settings-Ct3fcbHr.js → shares-settings-t-hP0QDv.js} +1 -1
  74. package/dist/gateway/static/root/assets/skill-reload-api-CYRaxTqs.js +1 -0
  75. package/dist/gateway/static/root/assets/{skills-page-FeieOEn3.js → skills-page-C6CXLWnN.js} +1 -1
  76. package/dist/gateway/static/root/assets/{system-settings-panel-CdUl2I0D.js → system-settings-panel-6u0k0wJi.js} +1 -1
  77. package/dist/gateway/static/root/assets/{theme-store-H9T49Iar.js → theme-store-DSpAOJ9G.js} +1 -1
  78. package/dist/gateway/static/root/assets/{time-picker-EkhqT3fS.js → time-picker-BF3f8el1.js} +1 -1
  79. package/dist/gateway/static/root/assets/{typed-models-lib-5xRRUE9Y.js → typed-models-lib-CyRCjjGS.js} +1 -1
  80. package/dist/gateway/static/root/assets/{use-channel-catalog-UACJTyH0.js → use-channel-catalog-B_Igd7ec.js} +1 -1
  81. package/dist/gateway/static/root/assets/{user-context-page-DHiRvd4i.js → user-context-page-B3zeQLeM.js} +1 -1
  82. package/dist/gateway/static/root/assets/{voice-api-key-field-Bql0SPCp.js → voice-api-key-field-BanJk_cf.js} +1 -1
  83. package/dist/gateway/static/root/assets/{work-discovery-page-BcmZux7y.js → work-discovery-page-BCANmOUS.js} +1 -1
  84. package/dist/gateway/static/root/assets/{work-item-detail-page-D94Q5zVD.js → work-item-detail-page-t5xiIEFv.js} +1 -1
  85. package/dist/gateway/static/root/assets/{work-page-DdFBMDcB.js → work-page-CEI3zs-y.js} +1 -1
  86. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Dow7ZztR.js → workflow-run-setup-panel-DCXTQx7p.js} +1 -1
  87. package/dist/gateway/static/root/assets/{workflows-page-wOVSoduy.js → workflows-page-B8FRLCHp.js} +3 -3
  88. package/dist/gateway/static/root/index.html +7 -7
  89. package/dist/package.js +1 -1
  90. package/dist/src/agent/agent-manager.js +12 -5
  91. package/dist/src/agent/memory/dreaming/config.js +1 -1
  92. package/dist/src/agent/models/manager.d.ts +5 -0
  93. package/dist/src/agent/models/manager.js +8 -0
  94. package/dist/src/agent/prompt/sections/messaging-runtime.js +1 -1
  95. package/dist/src/agent/prompt/sections/tooling.js +1 -1
  96. package/dist/src/agent/tools/communication.js +25 -7
  97. package/dist/src/agent-runtime/index.js +1 -1
  98. package/dist/src/agent-runtime/runtime-profile.js +1 -1
  99. package/dist/src/channels/plugin-registry.js +6 -1
  100. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  101. package/dist/src/config/agent-profile.js +1 -1
  102. package/dist/src/gateway/agents-admin.js +1 -1
  103. package/dist/src/gateway/hono/routes/composer-history.d.ts +3 -0
  104. package/dist/src/gateway/hono/routes/composer-history.js +28 -0
  105. package/dist/src/gateway/hono/routes/index.js +2 -0
  106. package/dist/src/session/client-history.d.ts +2 -0
  107. package/dist/src/session/client-history.js +2 -0
  108. package/dist/src/session/patch-metadata.d.ts +2 -0
  109. package/dist/src/session/patch-metadata.js +2 -0
  110. package/dist/src/storage/sqlite/composer-input-history-repository.d.ts +12 -0
  111. package/dist/src/storage/sqlite/composer-input-history-repository.js +42 -0
  112. package/dist/src/storage/sqlite/index.d.ts +1 -0
  113. package/dist/src/storage/sqlite/index.js +2 -1
  114. package/dist/src/storage/sqlite/migrations/059_composer_input_history.sql +8 -0
  115. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  116. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  117. package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
  118. package/dist/src/storage/sqlite/schema.js +1 -1
  119. package/dist/src/tui/backends/embedded-backend.d.ts +5 -1
  120. package/dist/src/tui/backends/embedded-backend.js +53 -9
  121. package/dist/src/tui/backends/gateway-sse-backend.d.ts +3 -1
  122. package/dist/src/tui/backends/gateway-sse-backend.js +23 -3
  123. package/dist/src/tui/components/custom-editor.d.ts +1 -0
  124. package/dist/src/tui/components/custom-editor.js +6 -0
  125. package/dist/src/tui/tui-backend.d.ts +11 -0
  126. package/dist/src/tui/tui-empty-session-cleanup.d.ts +11 -0
  127. package/dist/src/tui/tui-empty-session-cleanup.js +37 -0
  128. package/dist/src/tui/tui-submit.d.ts +1 -0
  129. package/dist/src/tui/tui-submit.js +1 -1
  130. package/dist/src/tui/tui.js +101 -17
  131. package/package.json +1 -1
  132. package/dist/gateway/static/root/assets/capability-presets-settings-panel-JlhjAhT7.js +0 -2
  133. package/dist/gateway/static/root/assets/channels-status-swr-ZrqadU60.js +0 -1
  134. package/dist/gateway/static/root/assets/index-B24B26og.js +0 -199
  135. package/dist/gateway/static/root/assets/notes-page-BtKHSb4z.js +0 -1
  136. package/dist/gateway/static/root/assets/settings-advanced-gate-eVlH9brU.js +0 -1
  137. package/dist/gateway/static/root/assets/skill-reload-api-ElA5kabh.js +0 -1
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,t as a}from"./chunk-KS7C4IRE-uQ0fehio.js";import{t as o}from"./cn-JdwAhgNB.js";import{t as s}from"./messages-B1EG4gdu.js";import{l as c,n as l}from"./locale-store-tnRLWdx2.js";import{i as u}from"./vendor-swr-BIWyz7Rc.js";import{$l as d,Ac as f,Es as p,Fu as m,Gl as h,Go as g,Gr as _,Is as v,It as y,Jo as b,Ko as x,Ls as S,Nc as C,Ns as w,Nu as T,Ou as E,Sc as D,Uo as O,Wo as k,Yo as A,Ys as j,_l as M,as as N,cs as P,dc as F,ls as I,ms as L,os as ee,ps as R,qo as z,rl as B,yu as te}from"./index-B24B26og.js";import{n as V,r as H}from"./settings-page-layout-CtESNNdx.js";import{n as ne,r as re}from"./settings-loading-skeleton-Q_Vh6HEl.js";import{n as ie,t as ae}from"./settings-form-section-Bb6yYt5f.js";import{a as oe,i as se,n as ce,o as le,r as ue,t as de}from"./capability-presets-api-DdCHSzcA.js";import{a as fe,i as pe,o as U,s as W,t as G}from"./typed-models-lib-5xRRUE9Y.js";var K=n(),q=e(t(),1),J=r(),me=[`deep`,`fast`,`cheap`,`code`,`review`];function he(e){return me.includes(e)}function ge(e){let{rows:t,onChange:n,disabled:r,defaultRole:i,chat:a,labels:o}=e,s=(0,q.useRef)([]),c=(0,q.useRef)(0);for(;s.current.length<t.length;)s.current.push(`preset-model-row-${c.current++}`);s.current.length>t.length&&(s.current.length=t.length);let l=i??(t.some(e=>e.id===`deep`)?`deep`:t[0]?.id)??`deep`,u=t.findIndex(e=>e.id===l),d=u>=0?t[u]:void 0,f=t.map((e,t)=>({row:e,index:t})).filter(({index:e})=>e!==u),p=(e,r)=>{n(t.map((t,n)=>n===e?{...t,...r}:t))},m=e=>{if(u>=0){p(u,{model:e});return}s.current.unshift(`preset-model-row-${c.current++}`),n([{id:l,model:e,fallbacks:[],description:he(l)?o.roleDescriptions[l]:``},...t])},h=e=>{let n=t[e];n&&p(e,{fallbacks:[...n.fallbacks??[],``]})},g=(e,n,r)=>{let i=t[e];if(!i)return;let a=[...i.fallbacks??[]];a[n]=r,p(e,{fallbacks:a})},_=(e,n)=>{let r=t[e];r&&p(e,{fallbacks:(r.fallbacks??[]).filter((e,t)=>t!==n)})},v=e=>{s.current.splice(e,1),n(t.filter((t,n)=>n!==e))},b=e=>{if(!e)return;let r=e===`__custom__`?``:e;s.current.push(`preset-model-row-${c.current++}`),n([...t,{id:r,model:``,fallbacks:[],description:he(r)?o.roleDescriptions[r]:``}])},x=[...me.filter(e=>e!==l&&!t.some(t=>t.id===e)).map(e=>({value:e,label:o.roleNames[e]})),{value:`__custom__`,label:o.customRole}],S=(e,t)=>(0,J.jsxs)(`div`,{className:`grid gap-3 border-t border-edge-subtle pt-3 dark:border-edge`,children:[(0,J.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:o.fallbackModels}),(0,J.jsxs)(w,{type:`button`,variant:`secondary`,className:`h-7 gap-1 px-2 text-xs`,disabled:r,onClick:()=>h(t),children:[(0,J.jsx)(C,{className:`size-3.5`,"aria-hidden":!0}),o.addFallback]})]}),(e.fallbacks??[]).length>0?(0,J.jsx)(`div`,{className:`grid gap-1.5`,children:(e.fallbacks??[]).map((e,n)=>(0,J.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-2`,children:[(0,J.jsx)(y,{value:e,disabled:r,placeholder:o.fallbackPlaceholder,searchPlaceholder:a.modelSearchPlaceholder,noMatches:a.modelNoMatches,className:`w-full max-w-none`,contentAlign:`start`,onChange:e=>g(t,n,e)}),(0,J.jsx)(w,{type:`button`,variant:`secondary`,className:`shrink-0 px-2`,disabled:r,"aria-label":o.removeFallback,onClick:()=>_(t,n),children:(0,J.jsx)(j,{className:`size-4`,"aria-hidden":!0})})]},`${s.current[t]}-fallback-${n}`))}):(0,J.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-subtle`,children:o.fallbackEmptyHint})]}),(0,J.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-fg-muted`,children:[o.description,(0,J.jsx)(`input`,{type:`text`,className:W(),value:e.description,disabled:r,placeholder:o.descriptionPlaceholder,onChange:e=>p(t,{description:e.target.value})})]})]});return(0,J.jsxs)(`div`,{className:`grid gap-5`,children:[(0,J.jsxs)(`div`,{className:`rounded-xl border border-edge bg-surface-base p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:o.defaultTitle}),(0,J.jsx)(`span`,{className:`rounded-full bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent`,children:o.defaultBadge})]}),(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:o.defaultHint})]}),(0,J.jsxs)(`span`,{className:`rounded-md bg-surface-panel px-2 py-1 font-mono text-[11px] text-fg-subtle`,children:[o.roleId,`: `,l]})]}),(0,J.jsxs)(`div`,{className:`mt-4 grid gap-1.5`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:o.primaryModel}),(0,J.jsx)(y,{value:d?.model??``,disabled:r,placeholder:a.modelPlaceholder,searchPlaceholder:a.modelSearchPlaceholder,noMatches:a.modelNoMatches,className:`w-full max-w-none`,contentAlign:`start`,onChange:m})]}),d?(0,J.jsxs)(`details`,{className:`group mt-3`,children:[(0,J.jsxs)(`summary`,{className:`flex w-fit cursor-pointer list-none items-center gap-1.5 rounded-md text-xs font-medium text-fg-muted hover:text-fg`,children:[o.moreSettings,(0,J.jsx)(te,{className:`size-3.5 transition-transform group-open:rotate-180`,"aria-hidden":!0})]}),(0,J.jsx)(`div`,{className:`mt-3`,children:S(d,u)})]}):null]}),(0,J.jsxs)(`section`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:o.otherRolesTitle}),(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:o.otherRolesHint})]}),f.length>0?(0,J.jsx)(`div`,{className:`mt-3 grid gap-2`,children:f.map(({row:e,index:t})=>{let n=he(e.id)?e.id:void 0;return(0,J.jsxs)(`div`,{className:`rounded-lg border border-edge-subtle bg-surface-panel/60 p-3 dark:border-edge`,children:[(0,J.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-[minmax(8rem,12rem)_minmax(0,1fr)] md:items-end`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n?o.roleNames[n]:o.customRole}),n?(0,J.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-fg-subtle`,children:e.id}):(0,J.jsxs)(`label`,{className:`mt-1 grid gap-1 text-[11px] text-fg-muted`,children:[o.roleId,(0,J.jsx)(`input`,{type:`text`,className:W(),value:e.id,disabled:r,placeholder:o.roleIdPlaceholder,onChange:e=>p(t,{id:e.target.value.toLowerCase()})})]})]}),(0,J.jsxs)(`label`,{className:`grid min-w-0 gap-1.5 text-xs font-medium text-fg-muted`,children:[o.primaryModel,(0,J.jsx)(y,{value:e.model,disabled:r,placeholder:a.modelPlaceholder,searchPlaceholder:a.modelSearchPlaceholder,noMatches:a.modelNoMatches,className:`w-full max-w-none`,contentAlign:`start`,onChange:e=>p(t,{model:e})})]})]}),(0,J.jsxs)(`details`,{className:`group mt-3`,children:[(0,J.jsxs)(`summary`,{className:`flex w-fit cursor-pointer list-none items-center gap-1.5 text-xs font-medium text-fg-muted hover:text-fg`,children:[o.moreSettings,(0,J.jsx)(te,{className:`size-3.5 transition-transform group-open:rotate-180`,"aria-hidden":!0})]}),(0,J.jsxs)(`div`,{className:`mt-3`,children:[S(e,t),(0,J.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,J.jsxs)(w,{type:`button`,variant:`secondary`,disabled:r,onClick:()=>v(t),children:[(0,J.jsx)(j,{className:`size-4`,"aria-hidden":!0}),o.removeRole]})})]})]})]},s.current[t])})}):(0,J.jsx)(`p`,{className:`mt-3 rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:o.otherRolesEmpty}),(0,J.jsx)(N,{value:``,options:x,placeholder:o.addTaskModel,allowEmpty:!1,disabled:r,triggerClassName:`mt-3 w-fit`,onChange:b})]})]})}function _e(e){let t=(0,K.c)(34),{extendsIds:n,onExtendsChange:r,presetOptions:i,jsonFields:a,onJsonFieldsChange:o,disabled:s,labels:c}=e,l;t[0]===a?l=t[1]:(l=Object.keys(a),t[0]=a,t[1]=l);let u=l,d;t[2]===c.inheritanceTitle?d=t[3]:(d=(0,J.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:c.inheritanceTitle}),t[2]=c.inheritanceTitle,t[3]=d);let f;t[4]===c.inheritanceHint?f=t[5]:(f=(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:c.inheritanceHint}),t[4]=c.inheritanceHint,t[5]=f);let p;t[6]!==s||t[7]!==n||t[8]!==c.inheritanceEmpty||t[9]!==r||t[10]!==i?(p=i.length>0?(0,J.jsx)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:i.map(e=>{let t=n.includes(e.id);return(0,J.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-lg bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,J.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 shrink-0 rounded border-edge`,checked:t,disabled:s,onChange:()=>r(t?n.filter(t=>t!==e.id):[...n,e.id])}),(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:e.name}),(0,J.jsx)(`span`,{className:`mt-0.5 block font-mono text-[11px] text-fg-subtle`,children:e.id})]})]},e.id)})}):(0,J.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:c.inheritanceEmpty}),t[6]=s,t[7]=n,t[8]=c.inheritanceEmpty,t[9]=r,t[10]=i,t[11]=p):p=t[11];let m;t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,J.jsxs)(`section`,{children:[d,f,p]}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c.jsonTitle?h=t[17]:(h=(0,J.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:c.jsonTitle}),t[16]=c.jsonTitle,t[17]=h);let g;t[18]===c.jsonHint?g=t[19]:(g=(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:c.jsonHint}),t[18]=c.jsonHint,t[19]=g);let _;t[20]!==s||t[21]!==u||t[22]!==a||t[23]!==c.fieldHints||t[24]!==c.fieldLabels||t[25]!==o?(_=(0,J.jsx)(`div`,{className:`mt-3 grid gap-4 lg:grid-cols-2`,children:u.map(e=>(0,J.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:c.fieldLabels[e]}),(0,J.jsx)(`span`,{className:`min-h-8 text-xs leading-relaxed text-fg-muted`,children:c.fieldHints[e]}),(0,J.jsx)(`textarea`,{className:`min-h-36 resize-y rounded-lg border border-edge bg-surface-base px-3 py-2 font-mono text-xs leading-relaxed text-fg placeholder:text-fg-subtle focus:border-edge-strong focus:outline-none`,value:a[e],disabled:s,spellCheck:!1,placeholder:`{}`,onChange:t=>o({...a,[e]:t.target.value})})]},e))}),t[20]=s,t[21]=u,t[22]=a,t[23]=c.fieldHints,t[24]=c.fieldLabels,t[25]=o,t[26]=_):_=t[26];let v;t[27]!==h||t[28]!==g||t[29]!==_?(v=(0,J.jsxs)(`section`,{children:[h,g,_]}),t[27]=h,t[28]=g,t[29]=_,t[30]=v):v=t[30];let y;return t[31]!==m||t[32]!==v?(y=(0,J.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[m,v]}),t[31]=m,t[32]=v,t[33]=y):y=t[33],y}function Y(e){return e.name||e.directoryId}function ve(e){let t=(0,K.c)(56),{mode:n,selected:r,catalog:i,loading:a,disabled:s,onModeChange:c,onSelectedChange:l,labels:u}=e,d=n===`allowlist`||n===`denylist`,f;t[0]===i?f=t[1]:(f=i.map(Y).filter(Boolean),t[0]=i,t[1]=f);let p=f,m;bb0:{if(n===`inherit`){m=u.inheritSummary;break bb0}if(n===`all`){m=u.allSummary;break bb0}if(n===`off`){m=u.offSummary;break bb0}let e=n===`allowlist`?u.allowSummary:u.denySummary,i;t[2]!==r.size||t[3]!==e?(i=e.replace(`{{count}}`,String(r.size)),t[2]=r.size,t[3]=e,t[4]=i):i=t[4],m=i}let h=m,g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),t[5]=g):g=t[5];let _;t[6]===u.overrideSummaryTitle?_=t[7]:(_=(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[g,u.overrideSummaryTitle]}),t[6]=u.overrideSummaryTitle,t[7]=_);let v;t[8]===h?v=t[9]:(v=(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:h}),t[8]=h,t[9]=v);let y;t[10]!==_||t[11]!==v?(y=(0,J.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/70 px-3 py-2 shadow-surface`,children:[_,v]}),t[10]=_,t[11]=v,t[12]=y):y=t[12];let b;t[13]===u.modeLabel?b=t[14]:(b=(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:u.modeLabel}),t[13]=u.modeLabel,t[14]=b);let x;t[15]===u.modeInherit?x=t[16]:(x=[`inherit`,u.modeInherit],t[15]=u.modeInherit,t[16]=x);let S;t[17]===u.modeAll?S=t[18]:(S=[`all`,u.modeAll],t[17]=u.modeAll,t[18]=S);let C;t[19]===u.modeAllowlist?C=t[20]:(C=[`allowlist`,u.modeAllowlist],t[19]=u.modeAllowlist,t[20]=C);let T;t[21]===u.modeDenylist?T=t[22]:(T=[`denylist`,u.modeDenylist],t[21]=u.modeDenylist,t[22]=T);let D;t[23]===u.modeOff?D=t[24]:(D=[`off`,u.modeOff],t[23]=u.modeOff,t[24]=D);let O;t[25]!==T||t[26]!==D||t[27]!==x||t[28]!==S||t[29]!==C?(O=[x,S,C,T,D],t[25]=T,t[26]=D,t[27]=x,t[28]=S,t[29]=C,t[30]=O):O=t[30];let k=O,A;t[31]!==s||t[32]!==n||t[33]!==c||t[34]!==k?(A=(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:k.map(e=>{let[t,r]=e;return(0,J.jsx)(`button`,{type:`button`,className:o(`rounded-lg px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,n===t?`bg-accent-soft text-accent-fg`:`bg-surface-panel text-fg hover:bg-surface-hover/55`),disabled:s,onClick:()=>c(t),children:r},t)})}),t[31]=s,t[32]=n,t[33]=c,t[34]=k,t[35]=A):A=t[35];let j;t[36]!==A||t[37]!==b?(j=(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[b,A]}),t[36]=A,t[37]=b,t[38]=j):j=t[38];let M;t[39]!==i||t[40]!==p||t[41]!==s||t[42]!==u.emptyCatalog||t[43]!==u.noDescription||t[44]!==u.quickActionsLabel||t[45]!==u.quickClear||t[46]!==u.quickSelectAll||t[47]!==a||t[48]!==l||t[49]!==d||t[50]!==r?(M=d?(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:u.quickActionsLabel}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsx)(w,{type:`button`,variant:`secondary`,className:U,disabled:s||a||p.length===0,onClick:()=>l(new Set(p)),children:u.quickSelectAll}),(0,J.jsx)(w,{type:`button`,variant:`secondary`,className:U,disabled:s||a||r.size===0,onClick:()=>l(new Set),children:u.quickClear})]})]}),a?(0,J.jsx)(re,{rows:3}):i.length===0?(0,J.jsx)(`p`,{className:`text-sm text-fg-muted`,children:u.emptyCatalog}):(0,J.jsx)(`ul`,{className:`flex flex-col gap-2.5 text-sm`,children:i.map(e=>{let t=Y(e),n=r.has(t),i=typeof e.description==`string`?e.description.trim():``,a=i||u.noDescription;return(0,J.jsx)(`li`,{className:`h-16 shrink-0 overflow-hidden rounded-xl bg-surface-panel/70 px-3 shadow-surface`,children:(0,J.jsxs)(`label`,{className:`flex h-full cursor-pointer items-center gap-3 text-sm`,children:[(0,J.jsx)(`input`,{type:`checkbox`,className:`shrink-0 rounded border-edge`,checked:n,disabled:s,onChange:()=>{let e=new Set(r);n?e.delete(t):e.add(t),l(e)},"aria-label":t}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:[(0,J.jsx)(`div`,{className:`truncate font-mono text-xs font-medium text-fg`,title:t,children:t}),(0,J.jsx)(`p`,{className:o(`mt-0.5 truncate text-xs leading-tight text-fg-muted`,!i&&`italic text-fg-subtle`),title:a,children:a})]})]})},t)})})]}):null,t[39]=i,t[40]=p,t[41]=s,t[42]=u.emptyCatalog,t[43]=u.noDescription,t[44]=u.quickActionsLabel,t[45]=u.quickClear,t[46]=u.quickSelectAll,t[47]=a,t[48]=l,t[49]=d,t[50]=r,t[51]=M):M=t[51];let N;return t[52]!==j||t[53]!==M||t[54]!==y?(N=(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[y,j,M]}),t[52]=j,t[53]=M,t[54]=y,t[55]=N):N=t[55],N}var ye=[`write_file`,`apply_patch`,`exec_command`,`execute_code`],be=[`exec_command`,`execute_code`,`automation`,`extensions`,`bundle-mcp`,`skill_manage`],X=[`send_message`,`send_media`,`text_to_speech`,`create_share`],xe=[`read_file`,`list_dir`,`grep`,`find`,`web_search`,`web_fetch`,`web_extract`],Se=[...ye,...X],Ce=[`read_file`,`write_file`,`apply_patch`,`list_dir`,`grep`,`find`,`web_search`,`web_fetch`],we=[`send_message`,`send_media`];function Te(e,t){let n={};for(let[r,i]of t)for(let t of r)e.has(t)&&(n[t]={mode:i});return n}function Ee(e){let t=(0,K.c)(105),{builtinToolIds:n,toolPolicies:r,onChange:i,disabled:a,getToolDescription:s,getGroupTitle:c,labels:l}=e,u;t[0]===n?u=t[1]:(u=new Set(n),t[0]=n,t[1]=u);let d=u,f;t[2]!==d||t[3]!==r?(f=Object.entries(r).filter(e=>{let[t]=e;return d.has(t)}).toSorted(De),t[2]=d,t[3]=r,t[4]=f):f=t[4];let p=f,m;if(t[5]!==d||t[6]!==n){m=[];for(let e of oe){let t=e.toolIds.filter(e=>d.has(e));t.length>0&&m.push({key:e.key,ids:[...t]})}let e;t[8]===n?e=t[9]:(e=le(n),t[8]=n,t[9]=e);let r=e;if(r.length>0){let e;t[10]===r?e=t[11]:(e={key:`misc`,ids:r},t[10]=r,t[11]=e),m.push(e)}t[5]=d,t[6]=n,t[7]=m}else m=t[7];let h=m,g;t[12]!==i||t[13]!==r?(g=(e,t)=>{let n={...r};t===`inherit`?delete n[e]:n[e]={...n[e],mode:t},i(n)},t[12]=i,t[13]=r,t[14]=g):g=t[14];let _=g,v;t[15]!==i||t[16]!==r?(v=(e,t)=>{let n=r[e];n&&i({...r,[e]:t(n)})},t[15]=i,t[16]=r,t[17]=v):v=t[17];let y=v,b;t[18]!==d||t[19]!==i?(b=e=>{i(Te(d,e))},t[18]=d,t[19]=i,t[20]=b):b=t[20];let x=b;if(n.length===0){let e;return t[21]===l.emptyBuiltin?e=t[22]:(e=(0,J.jsx)(`p`,{className:`text-sm text-fg-muted`,children:l.emptyBuiltin}),t[21]=l.emptyBuiltin,t[22]=e),e}let S;t[23]===l.quickActionsLabel?S=t[24]:(S=(0,J.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:l.quickActionsLabel}),t[23]=l.quickActionsLabel,t[24]=S);let C;t[25]===i?C=t[26]:(C=()=>i({}),t[25]=i,t[26]=C);let T;t[27]!==a||t[28]!==l.quickClearOverrides||t[29]!==C?(T=(0,J.jsx)(w,{type:`button`,variant:`secondary`,className:U,disabled:a,onClick:C,children:l.quickClearOverrides}),t[27]=a,t[28]=l.quickClearOverrides,t[29]=C,t[30]=T):T=t[30];let E;t[31]===x?E=t[32]:(E=()=>x([[ye,`deny`]]),t[31]=x,t[32]=E);let D;t[33]!==a||t[34]!==l.quickReadOnlyWorkspace||t[35]!==E?(D=(0,J.jsx)(w,{type:`button`,variant:`secondary`,className:U,disabled:a,onClick:E,children:l.quickReadOnlyWorkspace}),t[33]=a,t[34]=l.quickReadOnlyWorkspace,t[35]=E,t[36]=D):D=t[36];let O;t[37]===x?O=t[38]:(O=()=>x([[be,`deny`]]),t[37]=x,t[38]=O);let k;t[39]!==a||t[40]!==l.quickHighRiskOff||t[41]!==O?(k=(0,J.jsx)(w,{type:`button`,variant:`secondary`,className:U,disabled:a,onClick:O,children:l.quickHighRiskOff}),t[39]=a,t[40]=l.quickHighRiskOff,t[41]=O,t[42]=k):k=t[42];let A;t[43]===x?A=t[44]:(A=()=>x([[X,`deny`]]),t[43]=x,t[44]=A);let j;t[45]!==a||t[46]!==l.quickNoOutbound||t[47]!==A?(j=(0,J.jsx)(w,{type:`button`,variant:`secondary`,className:U,disabled:a,onClick:A,children:l.quickNoOutbound}),t[45]=a,t[46]=l.quickNoOutbound,t[47]=A,t[48]=j):j=t[48];let M;t[49]===x?M=t[50]:(M=()=>x([[xe,`allow`],[Se,`deny`]]),t[49]=x,t[50]=M);let N;t[51]!==a||t[52]!==l.quickResearchMode||t[53]!==M?(N=(0,J.jsx)(w,{type:`button`,variant:`secondary`,className:U,disabled:a,onClick:M,children:l.quickResearchMode}),t[51]=a,t[52]=l.quickResearchMode,t[53]=M,t[54]=N):N=t[54];let F;t[55]===x?F=t[56]:(F=()=>x([[Ce,`allow`],[we,`deny`]]),t[55]=x,t[56]=F);let I;t[57]!==a||t[58]!==l.quickCodingMode||t[59]!==F?(I=(0,J.jsx)(w,{type:`button`,variant:`secondary`,className:U,disabled:a,onClick:F,children:l.quickCodingMode}),t[57]=a,t[58]=l.quickCodingMode,t[59]=F,t[60]=I):I=t[60];let L;t[61]!==k||t[62]!==j||t[63]!==N||t[64]!==I||t[65]!==T||t[66]!==D?(L=(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[T,D,k,j,N,I]}),t[61]=k,t[62]=j,t[63]=N,t[64]=I,t[65]=T,t[66]=D,t[67]=L):L=t[67];let R;t[68]!==L||t[69]!==S?(R=(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,L]}),t[68]=L,t[69]=S,t[70]=R):R=t[70];let z;t[71]===l.overrideSummaryTitle?z=t[72]:(z=(0,J.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:l.overrideSummaryTitle}),t[71]=l.overrideSummaryTitle,t[72]=z);let B;t[73]!==l.modeAllow||t[74]!==l.modeConfirm||t[75]!==l.modeDeny||t[76]!==l.noOverrides||t[77]!==p?(B=p.length>0?(0,J.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:p.map(e=>{let[t,n]=e;return(0,J.jsxs)(`span`,{className:o(`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 font-mono text-[11px]`,n.mode===`deny`&&`border-red-500/25 bg-red-500/10 text-red-700 dark:text-red-300`,n.mode===`confirm`&&`border-amber-500/25 bg-amber-500/10 text-amber-700 dark:text-amber-300`,n.mode===`allow`&&`border-accent/25 bg-accent/10 text-accent`),children:[t,(0,J.jsx)(`span`,{className:`font-sans opacity-80`,children:n.mode===`allow`?l.modeAllow:n.mode===`confirm`?l.modeConfirm:l.modeDeny})]},t)})}):(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:l.noOverrides}),t[73]=l.modeAllow,t[74]=l.modeConfirm,t[75]=l.modeDeny,t[76]=l.noOverrides,t[77]=p,t[78]=B):B=t[78];let te;t[79]!==z||t[80]!==B?(te=(0,J.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/70 px-3 py-2 shadow-surface`,children:[z,B]}),t[79]=z,t[80]=B,t[81]=te):te=t[81];let V;t[82]!==a||t[83]!==c||t[84]!==s||t[85]!==h||t[86]!==l.inheritedMode||t[87]!==l.maxCallsLabel||t[88]!==l.modeAllow||t[89]!==l.modeConfirm||t[90]!==l.modeDeny||t[91]!==l.scopeInherit||t[92]!==l.scopeLabel||t[93]!==l.scopeReadonly||t[94]!==l.scopeUnrestricted||t[95]!==l.scopeWorkspace||t[96]!==l.timeoutLabel||t[97]!==_||t[98]!==r||t[99]!==y?(V=(0,J.jsx)(`div`,{className:`flex flex-col gap-5`,children:h.map(e=>{let{key:t,ids:n}=e;return(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:c(t)}),(0,J.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:n.map(e=>{let t=s(e),n=r[e],i=n?n.mode:`inherit`;return(0,J.jsxs)(`li`,{className:o(`rounded-xl px-3 py-2.5 shadow-surface transition-colors`,i===`inherit`?`bg-surface-panel/50`:`bg-surface-panel`),children:[(0,J.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-[minmax(0,1fr)_auto] md:items-center`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`div`,{className:`font-mono text-xs font-medium text-fg`,children:e}),t?(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:t}):null]}),(0,J.jsx)(`div`,{className:`inline-flex w-fit rounded-lg border border-edge-subtle bg-surface-base p-0.5`,children:[`inherit`,`allow`,`confirm`,`deny`].map(t=>(0,J.jsx)(`button`,{type:`button`,className:o(`rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,i===t?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`),disabled:a,onClick:()=>_(e,t),children:t===`inherit`?l.inheritedMode:t===`allow`?l.modeAllow:t===`confirm`?l.modeConfirm:l.modeDeny},t))})]}),n?(0,J.jsxs)(`div`,{className:`mt-3 grid gap-2 border-t border-edge-subtle pt-3 sm:grid-cols-3 dark:border-edge`,children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-fg-muted`,children:[l.scopeLabel,(0,J.jsxs)(ee,{value:n.scope??``,disabled:a,onChange:t=>y(e,e=>{let n=t.target.value;if(!n){let{scope:t,...n}=e;return n}return{...e,scope:n}}),children:[(0,J.jsx)(P,{value:``,children:l.scopeInherit}),(0,J.jsx)(P,{value:`readonly`,children:l.scopeReadonly}),(0,J.jsx)(P,{value:`workspace`,children:l.scopeWorkspace}),(0,J.jsx)(P,{value:`unrestricted`,children:l.scopeUnrestricted})]})]}),(0,J.jsx)(ke,{label:l.maxCallsLabel,value:n.limits?.maxCallsPerTurn,disabled:a,onChange:t=>y(e,e=>Oe(e,`maxCallsPerTurn`,t))}),(0,J.jsx)(ke,{label:l.timeoutLabel,value:n.limits?.timeoutMs,disabled:a,onChange:t=>y(e,e=>Oe(e,`timeoutMs`,t))})]}):null]},e)})})]},t)})}),t[82]=a,t[83]=c,t[84]=s,t[85]=h,t[86]=l.inheritedMode,t[87]=l.maxCallsLabel,t[88]=l.modeAllow,t[89]=l.modeConfirm,t[90]=l.modeDeny,t[91]=l.scopeInherit,t[92]=l.scopeLabel,t[93]=l.scopeReadonly,t[94]=l.scopeUnrestricted,t[95]=l.scopeWorkspace,t[96]=l.timeoutLabel,t[97]=_,t[98]=r,t[99]=y,t[100]=V):V=t[100];let H;return t[101]!==R||t[102]!==te||t[103]!==V?(H=(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[R,te,V]}),t[101]=R,t[102]=te,t[103]=V,t[104]=H):H=t[104],H}function De(e,t){let[n]=e,[r]=t;return n.localeCompare(r)}function Oe(e,t,n){let r={...e.limits};if(n===void 0?delete r[t]:r[t]=n,Object.keys(r).length===0){let{limits:t,...n}=e;return n}return{...e,limits:r}}function ke(e){let t=(0,K.c)(9),n=e.value??``,r;t[0]===e?r=t[1]:(r=t=>{let n=t.target.value.trim();e.onChange(n?Number(n):void 0)},t[0]=e,t[1]=r);let i;t[2]!==e.disabled||t[3]!==n||t[4]!==r?(i=(0,J.jsx)(`input`,{type:`number`,min:1,step:1,className:`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:border-edge-strong focus:outline-none`,value:n,disabled:e.disabled,onChange:r}),t[2]=e.disabled,t[3]=n,t[4]=r,t[5]=i):i=t[5];let a;return t[6]!==e.label||t[7]!==i?(a=(0,J.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-fg-muted`,children:[e.label,i]}),t[6]=e.label,t[7]=i,t[8]=a):a=t[8],a}var Ae=[`blank`,`safe-coder`,`read-only`,`low-cost`],je=[{id:`overview`,icon:d},{id:`models`,icon:M},{id:`tools`,icon:S},{id:`skills`,icon:f},{id:`advanced`,icon:F},{id:`impact`,icon:h}];function Me(e){return pe(Object.entries(e?.models?.roles??{}).map(([e,t])=>({id:e,model:t.model,fallbacks:t.fallbacks??[],description:t.description})))}function Ne(e){return structuredClone(e?.tools?.builtin??{})}function Z(e){let t=e?.skills;if(!t)return new Set;let n=t.mode===`denylist`?t.deny:t.allow;return new Set(n??[])}function Pe(){return{primary:``,fallbacks:``,timeoutMs:``,autoProviderFallback:``}}function Fe(e){return{primary:e?.primary??``,fallbacks:e?.fallbacks?.join(`
2
- `)??``,timeoutMs:e?.timeoutMs?String(e.timeoutMs):``,autoProviderFallback:e?.autoProviderFallback===void 0?``:e.autoProviderFallback?`true`:`false`}}function Ie(){return{imageModel:Pe(),imageGenerationModel:Pe(),allowFallbacks:``,maxCostTier:``}}function Q(e){return{imageModel:Fe(e?.models?.imageModel),imageGenerationModel:Fe(e?.models?.imageGenerationModel),allowFallbacks:e?.models?.policy?.allowFallbacks===void 0?``:e.models.policy.allowFallbacks?`true`:`false`,maxCostTier:e?.models?.policy?.maxCostTier??``}}function $(e){return e===void 0?``:JSON.stringify(e,null,2)}function Le(){return{mcp:``,workflows:``,boundaries:``,runtime:``,locks:``}}function Re(e){return{mcp:$(e?.tools?.mcp),workflows:$(e?.workflows),boundaries:$(e?.boundaries),runtime:$(e?.runtime),locks:$(e?.locks)}}function ze(e){return{id:e?.id??``,name:e?.name??``,description:e?.description??``,modelRows:Me(e),modelAdvanced:Q(e),toolPolicies:Ne(e),skillMode:e?.skills?.mode??`inherit`,skillPick:Z(e),extendsIds:[...e?.extends??[]],jsonFields:Re(e)}}function Be(e){let t=e.primary.trim();if(!t)return;let n=e.fallbacks.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean),r=e.timeoutMs.trim()?Number(e.timeoutMs):void 0,i=e.autoProviderFallback===``?void 0:e.autoProviderFallback===`true`;return{primary:t,...n.length>0?{fallbacks:n}:{},...r?{timeoutMs:r}:{},...i===void 0?{}:{autoProviderFallback:i}}}function Ve(e,t){let n=G(e.modelRows),r=Be(e.modelAdvanced.imageModel),i=Be(e.modelAdvanced.imageGenerationModel),a=e.modelAdvanced.allowFallbacks||e.modelAdvanced.maxCostTier?{...e.modelAdvanced.allowFallbacks?{allowFallbacks:e.modelAdvanced.allowFallbacks===`true`}:{},...e.modelAdvanced.maxCostTier?{maxCostTier:e.modelAdvanced.maxCostTier}:{}}:void 0,o={...t?.models?.defaultRole?{defaultRole:t.models.defaultRole}:{},...n?.roles?{roles:n.roles}:{},...r?{imageModel:r}:{},...i?{imageGenerationModel:i}:{},...a?{policy:a}:{}};return Object.keys(o).length>0?o:null}function He(e){return e.trim()?JSON.parse(e):void 0}function Ue(e){if(!e.trim())return``;try{return JSON.stringify(JSON.parse(e))}catch{return`!invalid:${e}`}}function We(e){let t=Object.fromEntries(Object.entries(e.toolPolicies).toSorted(([e],[t])=>e.localeCompare(t))),n=He(e.jsonFields.mcp);return Object.keys(t).length>0||n?{builtin:t,...n?{mcp:n}:{}}:null}function Ge(e){return Object.fromEntries(Object.entries(e??{}).toSorted(([e],[t])=>e.localeCompare(t)))}function Ke(e){if(e.skillMode===`inherit`)return null;let t=[...e.skillPick].toSorted((e,t)=>e.localeCompare(t));return e.skillMode===`allowlist`?{mode:`allowlist`,allow:t}:e.skillMode===`denylist`?{mode:`denylist`,deny:t}:{mode:e.skillMode}}function qe(e,t){return{id:e.id.trim(),name:e.name.trim(),description:e.description.trim(),models:Ve(e,t),tools:{builtin:Ge(e.toolPolicies),mcp:Ue(e.jsonFields.mcp)},skills:Ke(e),extends:[...e.extendsIds].toSorted(),workflows:Ue(e.jsonFields.workflows),boundaries:Ue(e.jsonFields.boundaries),runtime:Ue(e.jsonFields.runtime),locks:Ue(e.jsonFields.locks)}}function Je(e){return e?{id:e.id,name:e.name,description:e.description??``,models:e.models??null,tools:{builtin:Ge(e.tools?.builtin),mcp:Ue($(e.tools?.mcp))},skills:e.skills??null,extends:[...e.extends??[]].toSorted(),workflows:Ue($(e.workflows)),boundaries:Ue($(e.boundaries)),runtime:Ue($(e.runtime)),locks:Ue($(e.locks))}:null}function Ye(e,t){return[e.models?.roles?t.summaryModels.replace(`{{count}}`,String(Object.keys(e.models.roles).length)):``,e.tools?.builtin?t.summaryTools.replace(`{{count}}`,String(Object.keys(e.tools.builtin).length)):``,e.skills?t.summarySkills.replace(`{{mode}}`,t.skillModeLabels[e.skills.mode]):``].filter(Boolean).join(` · `)||t.summaryEmpty}function Xe(){return{modelAdvanced:Ie(),extendsIds:[],jsonFields:Le()}}function Ze(e,t){return{extends:[...e.extendsIds],models:Ve(e,t)??void 0,tools:We(e)??void 0,skills:Ke(e)??void 0,workflows:He(e.jsonFields.workflows),boundaries:He(e.jsonFields.boundaries),runtime:He(e.jsonFields.runtime),locks:He(e.jsonFields.locks)}}function Qe(e,t){return e===`safe-coder`?{id:`safe-coder`,name:t.starters[`safe-coder`].title,description:t.starters[`safe-coder`].description,modelRows:[{id:`deep`,model:``,fallbacks:[],description:t.modelRoleDescriptions.deep},{id:`code`,model:``,fallbacks:[],description:t.modelRoleDescriptions.code},{id:`review`,model:``,fallbacks:[],description:t.modelRoleDescriptions.review}],toolPolicies:{exec_command:{mode:`deny`},send_message:{mode:`deny`},send_media:{mode:`deny`}},skillMode:`allowlist`,skillPick:new Set([`diagnose`,`tdd`]),...Xe()}:e===`read-only`?{id:`read-only-research`,name:t.starters[`read-only`].title,description:t.starters[`read-only`].description,modelRows:[{id:`deep`,model:``,fallbacks:[],description:t.modelRoleDescriptions.deep},{id:`fast`,model:``,fallbacks:[],description:t.modelRoleDescriptions.fast}],toolPolicies:{write_file:{mode:`deny`},apply_patch:{mode:`deny`},exec_command:{mode:`deny`},send_message:{mode:`deny`},send_media:{mode:`deny`}},skillMode:`all`,skillPick:new Set,...Xe()}:e===`low-cost`?{id:`low-cost-assistant`,name:t.starters[`low-cost`].title,description:t.starters[`low-cost`].description,modelRows:[{id:`deep`,model:``,fallbacks:[],description:t.modelRoleDescriptions.deep},{id:`fast`,model:``,fallbacks:[],description:t.modelRoleDescriptions.fast},{id:`cheap`,model:``,fallbacks:[],description:t.modelRoleDescriptions.cheap}],toolPolicies:{},skillMode:`inherit`,skillPick:new Set,...Xe()}:{id:``,name:``,description:``,modelRows:[],toolPolicies:{},skillMode:`inherit`,skillPick:new Set,...Xe()}}function $e(){let e=s(l(e=>e.language)),t=e.capabilityPresetsSettings,n=(0,J.jsx)(w,{asChild:!0,type:`button`,variant:`secondary`,children:(0,J.jsxs)(a,{to:`/agents`,children:[t.manageAgents,(0,J.jsx)(T,{className:`size-4`,"aria-hidden":!0})]})}),r=!!c(e=>e.token),{data:y,error:E,isLoading:N,mutate:P}=u(r?`settings-capability-presets`:null,ue,{revalidateOnFocus:!1}),{data:ee=[],isLoading:te}=u(r?`settings-capability-presets-skills-catalog`:null,_,{revalidateOnFocus:!1}),[re,oe]=i(),[le,pe]=(0,q.useState)(``),[U,W]=(0,q.useState)(`overview`),[G,K]=(0,q.useState)(()=>Qe(`blank`,t)),[me,he]=(0,q.useState)(null),[Y,ye]=(0,q.useState)(!1),[be,X]=(0,q.useState)(null),[xe,Se]=(0,q.useState)(!1),[Ce,we]=(0,q.useState)(null),[Te,De]=(0,q.useState)(null),Oe=y?.presets??[],ke=y?.defaultPresetId??`default`,Me=Oe.find(e=>e.id===ke)??null,Ne=Oe.filter(e=>e.id!==ke),Z=(0,q.useMemo)(()=>Oe.find(e=>e.id===le)??Oe[0]??null,[Oe,le]),Pe=!Z||G.id.trim()!==Z.id,Fe=!!(Z&&Z.id===ke),Ie=JSON.stringify(qe(G,Z))!==JSON.stringify(Je(Z)),Q=qe(G,Z),$=Je(Z),Le=[Q.id!==$?.id||Q.name!==$?.name||Q.description!==$?.description?t.tabs.overview:``,JSON.stringify(Q.models)===JSON.stringify($?.models)?``:t.tabs.models,JSON.stringify(Q.tools)===JSON.stringify($?.tools)?``:t.tabs.tools,JSON.stringify(Q.skills)===JSON.stringify($?.skills)?``:t.tabs.skills,JSON.stringify({extends:Q.extends,workflows:Q.workflows,boundaries:Q.boundaries,runtime:Q.runtime,locks:Q.locks})===JSON.stringify({extends:$?.extends,workflows:$?.workflows,boundaries:$?.boundaries,runtime:$?.runtime,locks:$?.locks})?``:t.tabs.advanced].filter(Boolean),Re=be??(E instanceof Error?E.message:null),Be=re.get(`action`)===`new`||!!re.get(`preset`),Ve=re.get(`action`)===`new`&&me===null,Ue=Pe?t.newPreset:Z?.name??t.editorTitle,We=t=>e.agentsSettings.toolsDisableGroups[t],Ge=t=>t in e.agentsSettings.toolDescriptions?e.agentsSettings.toolDescriptions[t]:``;(0,q.useEffect)(()=>{if(!y||Y)return;if(re.get(`action`)===`new`){pe(``),K(Qe(`blank`,t)),W(`overview`);return}let e=re.get(`preset`)?.trim(),n=e?y.presets.find(t=>t.id===e):null;if(n){pe(n.id),K(ze(n)),W(re.get(`tab`)??`overview`);return}Z&&(pe(Z.id),K(e=>e.id===Z.id?e:ze(Z)))},[Y,y,re,Z]);function Ke(e){he(null),pe(e.id),K(ze(e)),oe({preset:e.id},{replace:!0}),W(`overview`)}function Xe(){he(null),pe(``),K(Qe(`blank`,t)),X(null),oe({action:`new`},{replace:!0}),W(`overview`)}function $e(e){he(e),K(Qe(e,t)),X(null),W(`overview`)}function nt(){if(me){let e=Qe(me,t);if(JSON.stringify(qe(G,null))!==JSON.stringify(qe(e,null))&&!window.confirm(t.changeTemplateConfirm))return}he(null),X(null)}function rt(){!Ve&&Ie&&!window.confirm(t.discardConfirm)||(Se(!1),we(null),oe({},{replace:!0}),he(null),X(null),K(ze(Z)),W(`overview`))}async function it(){let e=fe(G.modelRows,{invalidId:t.invalidModelRoleId,duplicateId:t.duplicateModelRoleId,invalidModel:t.invalidModelRef});if(e){X(e),W(`models`);return}for(let e of[G.modelAdvanced.imageModel,G.modelAdvanced.imageGenerationModel]){if([e.primary,...e.fallbacks.split(/\r?\n|,/)].map(e=>e.trim()).filter(Boolean).some(e=>!/^[^/\s]+\/.+/.test(e))){X(t.invalidModelRef),W(`models`);return}if(e.timeoutMs.trim()&&(!Number.isInteger(Number(e.timeoutMs))||Number(e.timeoutMs)<=0)){X(t.advancedPositiveIntegerError),W(`models`);return}}for(let e of Object.values(G.toolPolicies))if([e.limits?.maxCallsPerTurn,e.limits?.timeoutMs].filter(e=>e!==void 0).some(e=>!Number.isInteger(e)||e<=0)){X(t.advancedPositiveIntegerError),W(`tools`);return}for(let e of Object.keys(G.jsonFields))try{He(G.jsonFields[e])}catch{X(t.advancedJsonError.replace(`{{field}}`,t.advancedFieldLabels[e])),W(`advanced`);return}ye(!0),X(null);try{let e=Ze(G,Z);if(Pe){let t=await de({id:G.id.trim(),name:G.name.trim(),...G.description.trim()?{description:G.description.trim()}:{},...e});await P(t.presets,{revalidate:!1}),pe(t.presetId),he(null),oe({preset:t.presetId},{replace:!0})}else Z&&await P(await se(Z.id,{name:G.name.trim(),description:G.description.trim()||null,extends:e.extends??null,models:e.models??null,tools:e.tools??null,skills:e.skills??null,workflows:e.workflows??null,boundaries:e.boundaries??null,runtime:e.runtime??null,locks:e.locks??null}),{revalidate:!1})}catch(e){X(e instanceof Error?e.message:t.saveError)}finally{ye(!1)}}async function at(){if(Z){ye(!0),X(null),we(null);try{await P(await ce(Z.id),{revalidate:!1}),Se(!1),pe(``),he(null),K(Qe(`blank`,t)),W(`overview`),oe({},{replace:!0})}catch(e){we(e instanceof Error?e.message:t.deleteError)}finally{ye(!1)}}}return r?(0,J.jsxs)(H,{gap:`gap-5`,className:`pb-24`,children:[(0,J.jsx)(V,{title:t.title,subtitle:t.subtitle,actions:(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[n,(0,J.jsxs)(w,{type:`button`,onClick:Xe,disabled:Y,children:[(0,J.jsx)(C,{className:`size-4`,"aria-hidden":!0}),t.newPreset]})]})}),Re?(0,J.jsx)(`div`,{className:`rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`,children:Re}):null,N?(0,J.jsx)(ne,{sections:2}):(0,J.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[Me?(0,J.jsxs)(ae,{children:[(0,J.jsx)(ie,{icon:M,title:t.globalDefaultsTitle,subtitle:t.globalDefaultsHint}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>Ke(Me),className:`group rounded-lg bg-accent/5 px-4 py-3 text-left text-fg shadow-surface transition-colors hover:bg-accent/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:Me.name}),(0,J.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-[11px] font-medium text-accent`,children:t.globalDefaultsBadge})]}),(0,J.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-fg-subtle`,children:Me.id})]}),(0,J.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-panel px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:t.globalDefaultsInherited})]}),Me.description?(0,J.jsx)(`p`,{className:`mt-3 line-clamp-2 text-xs leading-relaxed text-fg-muted`,children:Me.description}):null,(0,J.jsx)(`div`,{className:`mt-3 text-xs text-fg-subtle`,children:Ye(Me,t)})]})]}):null,(0,J.jsxs)(ae,{children:[(0,J.jsx)(ie,{icon:M,title:t.listTitle,subtitle:t.listHint}),Ne.length===0?(0,J.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-lg bg-surface-panel/70 px-3 py-4 text-sm text-fg-muted shadow-surface`,children:[(0,J.jsx)(`p`,{children:t.empty}),(0,J.jsxs)(w,{type:`button`,variant:`secondary`,onClick:Xe,disabled:Y,children:[(0,J.jsx)(C,{className:`size-4`,"aria-hidden":!0}),t.newPreset]})]}):(0,J.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:Ne.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>Ke(e),className:`group min-h-36 rounded-lg bg-surface-panel/80 px-4 py-3 text-left text-fg shadow-surface transition-colors hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`div`,{className:`truncate text-sm font-semibold text-fg`,children:e.name}),(0,J.jsx)(`div`,{className:`mt-1 truncate font-mono text-[11px] text-fg-subtle`,children:e.id})]}),(0,J.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:e.usage.length})]}),e.description?(0,J.jsx)(`p`,{className:`mt-3 line-clamp-2 text-xs leading-relaxed text-fg-muted`,children:e.description}):null,(0,J.jsx)(`div`,{className:`mt-3 truncate text-xs text-fg-subtle`,children:Ye(e,t)})]},e.id))})]})]}),(0,J.jsx)(O,{open:Be,onOpenChange:e=>{e||rt()},children:(0,J.jsxs)(b,{children:[(0,J.jsx)(z,{className:o(`xopc-dialog-overlay fixed inset-0 bg-scrim`,L)}),(0,J.jsx)(g,{ref:De,className:o(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(90vh,760px)] w-[min(100%-2rem,64rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-popover dark:border-edge`,R),onOpenAutoFocus:e=>e.preventDefault(),children:(0,J.jsxs)(I,{layer:`modal`,portalContainer:Te,children:[(0,J.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-4 py-3 dark:border-edge`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[!Ve&&Pe&&me?(0,J.jsx)(`button`,{type:`button`,className:o(p,`shrink-0 p-1.5 hover:bg-surface-base`),onClick:nt,"aria-label":t.changeTemplate,title:t.changeTemplate,children:(0,J.jsx)(m,{className:`size-4`,"aria-hidden":!0})}):null,(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(A,{className:`truncate text-base font-semibold text-fg`,children:Ue}),(0,J.jsx)(x,{className:`mt-0.5 truncate text-xs text-fg-muted`,children:Ve?t.templatePickerSubtitle:Pe&&me?`${t.editorHint} · ${t.basedOnTemplate.replace(`{{template}}`,t.starters[me].title)}`:Pe?t.editorHint:G.id})]})]}),(0,J.jsx)(k,{asChild:!0,children:(0,J.jsx)(`button`,{type:`button`,className:o(p,`shrink-0 p-1.5 hover:bg-surface-base`),"aria-label":t.closeDialog,children:(0,J.jsx)(v,{className:`size-4`,"aria-hidden":!0})})})]}),Ve?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 sm:p-5`,children:(0,J.jsx)(`div`,{className:`mx-auto grid max-w-3xl gap-3 sm:grid-cols-2`,children:Ae.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:`group min-h-32 rounded-xl border border-edge-subtle bg-surface-base px-4 py-4 text-left text-fg transition-colors hover:border-edge hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>$e(e),children:[(0,J.jsxs)(`span`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:t.starters[e].title}),e===`blank`?(0,J.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:t.templateRecommended}):null]}),(0,J.jsx)(`span`,{className:`mt-2 block text-xs leading-relaxed text-fg-muted`,children:t.starters[e].description})]},e))})}),(0,J.jsx)(`div`,{className:`flex shrink-0 justify-end border-t border-edge-subtle px-4 py-3 dark:border-edge`,children:(0,J.jsx)(w,{type:`button`,variant:`secondary`,onClick:rt,children:t.cancel})})]}):(0,J.jsxs)(J.Fragment,{children:[Re?(0,J.jsx)(`div`,{className:`mx-4 mt-3 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`,children:Re}):null,(0,J.jsx)(`div`,{className:`flex shrink-0 flex-wrap gap-2 border-b border-edge-subtle bg-surface-base px-4 py-2 dark:border-edge`,children:je.map(({id:e,icon:n})=>(0,J.jsxs)(`button`,{type:`button`,className:o(`inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,U===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),onClick:()=>W(e),children:[(0,J.jsx)(n,{className:`size-4`,"aria-hidden":!0}),t.tabs[e]]},e))}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:(0,J.jsxs)(`div`,{className:`w-full`,children:[U===`overview`?(0,J.jsxs)(ae,{children:[(0,J.jsx)(ie,{icon:d,title:t.overviewTitle,subtitle:t.overviewHint}),(0,J.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,J.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:t.idLabel}),(0,J.jsx)(`input`,{className:`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:border-edge-strong focus:outline-none`,value:G.id,disabled:Y||!Pe,onChange:e=>K(t=>({...t,id:e.target.value.toLowerCase()})),placeholder:`safe-coder`})]}),!Pe&&Z?(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:t.versionLabel}),(0,J.jsx)(`div`,{className:`rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg-muted`,children:t.versionAutomatic.replace(`{{version}}`,String(Z.version))})]}):null,(0,J.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:t.nameLabel}),(0,J.jsx)(`input`,{className:`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:border-edge-strong focus:outline-none`,value:G.name,disabled:Y,onChange:e=>K(t=>({...t,name:e.target.value})),placeholder:t.namePlaceholder})]}),(0,J.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:t.descriptionLabel}),(0,J.jsx)(`textarea`,{className:`min-h-24 w-full resize-y rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:border-edge-strong focus:outline-none`,value:G.description,disabled:Y,onChange:e=>K(t=>({...t,description:e.target.value})),placeholder:t.descriptionPlaceholder})]})]}),(0,J.jsxs)(`div`,{className:`mt-5 grid gap-2 sm:grid-cols-3`,children:[(0,J.jsx)(et,{icon:M,label:t.modelsTitle,value:String(G.modelRows.length)}),(0,J.jsx)(et,{icon:S,label:t.toolsTitle,value:String(Object.keys(G.toolPolicies).length)}),(0,J.jsx)(et,{icon:f,label:t.skillsTitle,value:t.skillModeLabels[G.skillMode]})]})]}):null,U===`models`?(0,J.jsxs)(ae,{children:[(0,J.jsx)(ie,{icon:M,title:t.modelsTitle,subtitle:t.modelsHint}),(0,J.jsx)(ge,{rows:G.modelRows,onChange:e=>K(t=>({...t,modelRows:e})),disabled:Y,defaultRole:Z?.models?.defaultRole,chat:e.chat,labels:{defaultTitle:t.modelDefaultTitle,defaultHint:t.modelDefaultHint,defaultBadge:t.modelDefaultBadge,roleId:t.modelRoleIdLabel,description:t.modelRoleDescriptionLabel,descriptionPlaceholder:t.modelRoleDescriptionPlaceholder,primaryModel:t.modelPrimaryModelLabel,fallbackModels:t.modelFallbackModelsLabel,addFallback:t.modelAddFallback,removeFallback:t.modelRemoveFallback,fallbackPlaceholder:t.modelFallbackPlaceholder,fallbackEmptyHint:t.modelFallbackEmptyHint,moreSettings:t.modelMoreSettings,otherRolesTitle:t.modelOtherRolesTitle,otherRolesHint:t.modelOtherRolesHint,otherRolesEmpty:t.modelOtherRolesEmpty,addTaskModel:t.modelAddTaskModel,customRole:t.modelCustomRole,removeRole:t.removeModelRole,roleIdPlaceholder:`custom-role`,roleNames:t.modelRoleNames,roleDescriptions:t.modelRoleDescriptions}}),(0,J.jsx)(tt,{value:G.modelAdvanced,onChange:e=>K(t=>({...t,modelAdvanced:e})),disabled:Y,cp:t})]}):null,U===`tools`?(0,J.jsxs)(ae,{children:[(0,J.jsx)(ie,{icon:S,title:t.toolsTitle,subtitle:t.toolsHint}),(0,J.jsx)(Ee,{builtinToolIds:y?.builtinToolIds??[],toolPolicies:G.toolPolicies,onChange:e=>K(t=>({...t,toolPolicies:e})),disabled:Y,getToolDescription:Ge,getGroupTitle:We,labels:{quickActionsLabel:t.toolsQuickActionsLabel,quickClearOverrides:t.toolsQuickClearOverrides,quickReadOnlyWorkspace:t.toolsQuickReadOnlyWorkspace,quickHighRiskOff:t.toolsQuickHighRiskOff,quickNoOutbound:t.toolsQuickNoOutbound,quickResearchMode:t.toolsQuickResearchMode,quickCodingMode:t.toolsQuickCodingMode,emptyBuiltin:t.toolsEmptyBuiltin,overrideSummaryTitle:t.toolsOverrideSummaryTitle,noOverrides:t.toolsNoOverrides,inheritedMode:t.toolModes.inherit,modeAllow:t.toolModes.allow,modeConfirm:t.toolModes.confirm,modeDeny:t.toolModes.deny,scopeLabel:t.toolScopeLabel,scopeInherit:t.toolScopeInherit,scopeReadonly:t.toolScopeReadonly,scopeWorkspace:t.toolScopeWorkspace,scopeUnrestricted:t.toolScopeUnrestricted,maxCallsLabel:t.toolMaxCallsLabel,timeoutLabel:t.toolTimeoutLabel}})]}):null,U===`skills`?(0,J.jsxs)(ae,{children:[(0,J.jsx)(ie,{icon:f,title:t.skillsTitle,subtitle:t.skillsHint}),(0,J.jsx)(ve,{mode:G.skillMode,selected:G.skillPick,catalog:ee,loading:te,disabled:Y,onModeChange:e=>K(t=>({...t,skillMode:e})),onSelectedChange:e=>K(t=>({...t,skillPick:e})),labels:{modeLabel:t.skillsModeLabel,modeInherit:t.skillsModeInherit,modeAll:t.skillsModeAll,modeAllowlist:t.skillsModeAllowlist,modeDenylist:t.skillsModeDenylist,modeOff:t.skillsModeOff,quickActionsLabel:t.skillsQuickActionsLabel,quickSelectAll:t.skillsQuickSelectAll,quickClear:t.skillsQuickClear,catalogLoading:t.skillsCatalogLoading,emptyCatalog:t.skillsEmptyCatalog,noDescription:t.skillsNoDescription,overrideSummaryTitle:t.skillsOverrideSummaryTitle,inheritSummary:t.skillsInheritSummary,allSummary:t.skillsAllSummary,offSummary:t.skillsOffSummary,allowSummary:t.skillsAllowSummary,denySummary:t.skillsDenySummary}})]}):null,U===`advanced`?(0,J.jsxs)(ae,{children:[(0,J.jsx)(ie,{icon:F,title:t.advancedTitle,subtitle:t.advancedHint}),(0,J.jsx)(_e,{extendsIds:G.extendsIds,onExtendsChange:e=>K(t=>({...t,extendsIds:e})),presetOptions:Oe.filter(e=>e.id!==Z?.id&&e.id!==ke),jsonFields:G.jsonFields,onJsonFieldsChange:e=>K(t=>({...t,jsonFields:e})),disabled:Y,labels:{inheritanceTitle:t.advancedInheritanceTitle,inheritanceHint:t.advancedInheritanceHint,inheritanceEmpty:t.advancedInheritanceEmpty,jsonTitle:t.advancedJsonTitle,jsonHint:t.advancedJsonHint,fieldLabels:t.advancedFieldLabels,fieldHints:t.advancedFieldHints}})]}):null,U===`impact`?(0,J.jsxs)(ae,{children:[(0,J.jsx)(ie,{icon:h,title:t.usageTitle,subtitle:t.usageHint}),(0,J.jsxs)(`div`,{className:`mb-4 rounded-lg bg-surface-panel/70 px-3 py-2 shadow-surface`,children:[(0,J.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:t.changePreviewTitle}),(0,J.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:Le.length>0?t.changePreviewSections.replace(`{{sections}}`,Le.join(`、`)):t.changePreviewEmpty})]}),Z?.usage.length?(0,J.jsx)(`div`,{className:`grid gap-2`,children:Z.usage.map(e=>(0,J.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/80 px-3 py-2 shadow-surface`,children:[(0,J.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e.agentName||e.agentId}),(0,J.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-fg-muted`,children:e.agentId}),(0,J.jsx)(`div`,{className:`mt-1 text-[11px] text-fg-subtle`,children:e.direct?t.usageDirect:t.usageIndirect})]},e.agentId))}):(0,J.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noUsage})]}):null]})}),(0,J.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3 border-t border-edge-subtle px-4 py-3 dark:border-edge`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 text-sm`,children:[(0,J.jsx)(`div`,{className:`font-medium text-fg`,children:Ie?t.unsavedTitle:t.noUnsavedTitle}),(0,J.jsx)(`div`,{className:`text-xs text-fg-muted`,children:Ie?(Z?.usage.length??0)>0?t.unsavedImpact.replace(`{{count}}`,String(Z?.usage.length??0)):t.unsavedNoImpact:t.noUnsavedHint})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[Ie?(0,J.jsx)(w,{type:`button`,variant:`secondary`,disabled:Y,onClick:()=>K(ze(Z)),children:t.discard}):null,Z&&!Fe?(0,J.jsxs)(w,{type:`button`,variant:`secondary`,disabled:Y,onClick:()=>{we(null),Se(!0)},children:[(0,J.jsx)(j,{className:`size-4`,"aria-hidden":!0}),t.delete]}):null,(0,J.jsxs)(w,{type:`button`,disabled:Y||!G.id.trim()||!G.name.trim()||!Ie,onClick:()=>void it(),children:[(0,J.jsx)(D,{className:`size-4`,"aria-hidden":!0}),t.savePreset]})]})]})]})]})})]})}),(0,J.jsx)(O,{open:xe,onOpenChange:e=>{Y||(Se(e),e||we(null))},children:(0,J.jsxs)(b,{children:[(0,J.jsx)(z,{className:o(`xopc-dialog-overlay fixed inset-0 bg-scrim`,L)}),(0,J.jsxs)(g,{className:o(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-popover dark:border-edge`,R),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,J.jsxs)(`div`,{className:`border-b border-edge-subtle px-4 py-3 dark:border-edge`,children:[(0,J.jsx)(A,{className:`text-base font-semibold text-fg`,children:t.deleteDialogTitle}),(0,J.jsx)(x,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:Z?t.deleteConfirm.replace(`{{name}}`,Z.name):t.deleteConfirmFallback})]}),Ce?(0,J.jsx)(`div`,{className:`mx-4 mt-4 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`,children:Ce}):null,(0,J.jsxs)(`div`,{className:`flex justify-end gap-2 px-4 py-3`,children:[(0,J.jsx)(w,{type:`button`,variant:`secondary`,disabled:Y,onClick:()=>Se(!1),children:t.cancel}),(0,J.jsxs)(w,{type:`button`,disabled:Y||!Z,className:`bg-red-600 text-white shadow-surface hover:bg-red-700 focus-visible:ring-red-600 dark:bg-red-500 dark:hover:bg-red-600`,onClick:()=>void at(),children:[Y?(0,J.jsx)(B,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,J.jsx)(j,{className:`size-4`,"aria-hidden":!0}),Y?t.deleting:t.delete]})]})]})]})})]}):(0,J.jsxs)(H,{gap:`gap-3`,children:[(0,J.jsx)(V,{title:t.title,actions:n}),(0,J.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.needToken})]})}function et(e){let t=(0,K.c)(10),{icon:n,label:r,value:i}=e,a;t[0]===n?a=t[1]:(a=(0,J.jsx)(n,{className:`size-3.5`,"aria-hidden":!0}),t[0]=n,t[1]=a);let o;t[2]!==r||t[3]!==a?(o=(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[a,r]}),t[2]=r,t[3]=a,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=(0,J.jsx)(`div`,{className:`mt-1 text-sm font-medium text-fg`,children:i}),t[5]=i,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,J.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/80 px-3 py-2 shadow-surface`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function tt(e){let t=(0,K.c)(102),{value:n,onChange:r,disabled:i,cp:a}=e,o;t[0]!==r||t[1]!==n?(o=(e,t)=>{r({...n,[e]:t})},t[0]=r,t[1]=n,t[2]=o):o=t[2];let s=o,c;t[3]===a.modelSpecializedTitle?c=t[4]:(c=(0,J.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:a.modelSpecializedTitle}),t[3]=a.modelSpecializedTitle,t[4]=c);let l;t[5]!==a.modelNotSet||t[6]!==a.modelSpecializedSummary||t[7]!==n.imageGenerationModel.primary||t[8]!==n.imageModel.primary?(l=a.modelSpecializedSummary.replace(`{{image}}`,n.imageModel.primary||a.modelNotSet).replace(`{{generation}}`,n.imageGenerationModel.primary||a.modelNotSet),t[5]=a.modelNotSet,t[6]=a.modelSpecializedSummary,t[7]=n.imageGenerationModel.primary,t[8]=n.imageModel.primary,t[9]=l):l=t[9];let u;t[10]===l?u=t[11]:(u=(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:l}),t[10]=l,t[11]=u);let d;t[12]!==c||t[13]!==u?(d=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[c,u]}),t[12]=c,t[13]=u,t[14]=d):d=t[14];let f;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,J.jsx)(te,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-open:rotate-180`,"aria-hidden":!0}),t[15]=f):f=t[15];let p;t[16]===d?p=t[17]:(p=(0,J.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 p-4`,children:[d,f]}),t[16]=d,t[17]=p);let m;t[18]===s?m=t[19]:(m=e=>s(`imageModel`,e),t[18]=s,t[19]=m);let h;t[20]!==a||t[21]!==i||t[22]!==m||t[23]!==n.imageModel?(h=(0,J.jsx)(nt,{title:a.imageUnderstandingTitle,value:n.imageModel,onChange:m,disabled:i,cp:a}),t[20]=a,t[21]=i,t[22]=m,t[23]=n.imageModel,t[24]=h):h=t[24];let g;t[25]===s?g=t[26]:(g=e=>s(`imageGenerationModel`,e),t[25]=s,t[26]=g);let _;t[27]!==a||t[28]!==i||t[29]!==g||t[30]!==n.imageGenerationModel?(_=(0,J.jsx)(nt,{title:a.imageGenerationTitle,value:n.imageGenerationModel,onChange:g,disabled:i,cp:a}),t[27]=a,t[28]=i,t[29]=g,t[30]=n.imageGenerationModel,t[31]=_):_=t[31];let v;t[32]!==_||t[33]!==h?(v=(0,J.jsxs)(`div`,{className:`grid gap-3 border-t border-edge-subtle p-4 dark:border-edge lg:grid-cols-2`,children:[h,_]}),t[32]=_,t[33]=h,t[34]=v):v=t[34];let y;t[35]!==v||t[36]!==p?(y=(0,J.jsxs)(`details`,{className:`group rounded-xl border border-edge bg-surface-base`,children:[p,v]}),t[35]=v,t[36]=p,t[37]=y):y=t[37];let b;t[38]===a.modelAdvancedTitle?b=t[39]:(b=(0,J.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:a.modelAdvancedTitle}),t[38]=a.modelAdvancedTitle,t[39]=b);let x;t[40]===a.modelAdvancedHint?x=t[41]:(x=(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:a.modelAdvancedHint}),t[40]=a.modelAdvancedHint,t[41]=x);let S;t[42]!==b||t[43]!==x?(S=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[b,x]}),t[42]=b,t[43]=x,t[44]=S):S=t[44];let C;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,J.jsx)(te,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-open:rotate-180`,"aria-hidden":!0}),t[45]=C):C=t[45];let w;t[46]===S?w=t[47]:(w=(0,J.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 p-4`,children:[S,C]}),t[46]=S,t[47]=w);let T;t[48]===a.modelAllowFallbacksLabel?T=t[49]:(T=(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:a.modelAllowFallbacksLabel}),t[48]=a.modelAllowFallbacksLabel,t[49]=T);let E;t[50]!==r||t[51]!==n?(E=e=>r({...n,allowFallbacks:e.target.value}),t[50]=r,t[51]=n,t[52]=E):E=t[52];let D;t[53]===a.policyInherit?D=t[54]:(D=(0,J.jsx)(P,{value:``,children:a.policyInherit}),t[53]=a.policyInherit,t[54]=D);let O;t[55]===a.policyEnabled?O=t[56]:(O=(0,J.jsx)(P,{value:`true`,children:a.policyEnabled}),t[55]=a.policyEnabled,t[56]=O);let k;t[57]===a.policyDisabled?k=t[58]:(k=(0,J.jsx)(P,{value:`false`,children:a.policyDisabled}),t[57]=a.policyDisabled,t[58]=k);let A;t[59]!==i||t[60]!==E||t[61]!==D||t[62]!==O||t[63]!==k||t[64]!==n.allowFallbacks?(A=(0,J.jsxs)(ee,{value:n.allowFallbacks,disabled:i,onChange:E,children:[D,O,k]}),t[59]=i,t[60]=E,t[61]=D,t[62]=O,t[63]=k,t[64]=n.allowFallbacks,t[65]=A):A=t[65];let j;t[66]!==T||t[67]!==A?(j=(0,J.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[T,A]}),t[66]=T,t[67]=A,t[68]=j):j=t[68];let M;t[69]===a.modelMaxCostTierLabel?M=t[70]:(M=(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:a.modelMaxCostTierLabel}),t[69]=a.modelMaxCostTierLabel,t[70]=M);let N;t[71]!==r||t[72]!==n?(N=e=>r({...n,maxCostTier:e.target.value}),t[71]=r,t[72]=n,t[73]=N):N=t[73];let F;t[74]===a.policyInherit?F=t[75]:(F=(0,J.jsx)(P,{value:``,children:a.policyInherit}),t[74]=a.policyInherit,t[75]=F);let I;t[76]===a.costTierLow?I=t[77]:(I=(0,J.jsx)(P,{value:`low`,children:a.costTierLow}),t[76]=a.costTierLow,t[77]=I);let L;t[78]===a.costTierMedium?L=t[79]:(L=(0,J.jsx)(P,{value:`medium`,children:a.costTierMedium}),t[78]=a.costTierMedium,t[79]=L);let R;t[80]===a.costTierHigh?R=t[81]:(R=(0,J.jsx)(P,{value:`high`,children:a.costTierHigh}),t[80]=a.costTierHigh,t[81]=R);let z;t[82]!==i||t[83]!==N||t[84]!==F||t[85]!==I||t[86]!==L||t[87]!==R||t[88]!==n.maxCostTier?(z=(0,J.jsxs)(ee,{value:n.maxCostTier,disabled:i,onChange:N,children:[F,I,L,R]}),t[82]=i,t[83]=N,t[84]=F,t[85]=I,t[86]=L,t[87]=R,t[88]=n.maxCostTier,t[89]=z):z=t[89];let B;t[90]!==M||t[91]!==z?(B=(0,J.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[M,z]}),t[90]=M,t[91]=z,t[92]=B):B=t[92];let V;t[93]!==j||t[94]!==B?(V=(0,J.jsxs)(`div`,{className:`grid gap-3 border-t border-edge-subtle p-4 dark:border-edge sm:grid-cols-2`,children:[j,B]}),t[93]=j,t[94]=B,t[95]=V):V=t[95];let H;t[96]!==w||t[97]!==V?(H=(0,J.jsxs)(`details`,{className:`group rounded-xl border border-edge bg-surface-base`,children:[w,V]}),t[96]=w,t[97]=V,t[98]=H):H=t[98];let ne;return t[99]!==y||t[100]!==H?(ne=(0,J.jsxs)(`div`,{className:`mt-5 grid gap-3 border-t border-edge-subtle pt-5 dark:border-edge`,children:[y,H]}),t[99]=y,t[100]=H,t[101]=ne):ne=t[101],ne}function nt(e){let t=(0,K.c)(69),{title:n,value:r,onChange:i,disabled:a,cp:s}=e,c;t[0]===n?c=t[1]:(c=(0,J.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n}),t[0]=n,t[1]=c);let l=r.primary||s.modelNotSet,u;t[2]===l?u=t[3]:(u=(0,J.jsx)(`span`,{className:`max-w-48 truncate font-mono text-xs text-fg-muted`,children:l}),t[2]=l,t[3]=u);let d;t[4]!==c||t[5]!==u?(d=(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2.5`,children:[c,u]}),t[4]=c,t[5]=u,t[6]=d):d=t[6];let f=s.modelToolPrimaryLabel,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=o(`rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:border-edge-strong focus:outline-none`,`font-mono text-xs`),t[7]=p):p=t[7];let m;t[8]!==i||t[9]!==r?(m=e=>i({...r,primary:e.target.value}),t[8]=i,t[9]=r,t[10]=m):m=t[10];let h;t[11]!==a||t[12]!==m||t[13]!==r.primary?(h=(0,J.jsx)(`input`,{className:p,value:r.primary,disabled:a,placeholder:`provider/model`,onChange:m}),t[11]=a,t[12]=m,t[13]=r.primary,t[14]=h):h=t[14];let g;t[15]!==s.modelToolPrimaryLabel||t[16]!==h?(g=(0,J.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-fg-muted`,children:[f,h]}),t[15]=s.modelToolPrimaryLabel,t[16]=h,t[17]=g):g=t[17];let _=s.modelToolFallbacksLabel,v;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(v=o(`rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:border-edge-strong focus:outline-none`,`min-h-20 resize-y font-mono text-xs`),t[18]=v):v=t[18];let y;t[19]!==i||t[20]!==r?(y=e=>i({...r,fallbacks:e.target.value}),t[19]=i,t[20]=r,t[21]=y):y=t[21];let b;t[22]!==s.modelToolFallbacksPlaceholder||t[23]!==a||t[24]!==y||t[25]!==r.fallbacks?(b=(0,J.jsx)(`textarea`,{className:v,value:r.fallbacks,disabled:a,placeholder:s.modelToolFallbacksPlaceholder,onChange:y}),t[22]=s.modelToolFallbacksPlaceholder,t[23]=a,t[24]=y,t[25]=r.fallbacks,t[26]=b):b=t[26];let x;t[27]!==s.modelToolFallbacksLabel||t[28]!==b?(x=(0,J.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-fg-muted`,children:[_,b]}),t[27]=s.modelToolFallbacksLabel,t[28]=b,t[29]=x):x=t[29];let S;t[30]!==i||t[31]!==r?(S=e=>i({...r,timeoutMs:e.target.value}),t[30]=i,t[31]=r,t[32]=S):S=t[32];let C;t[33]!==a||t[34]!==S||t[35]!==r.timeoutMs?(C=(0,J.jsx)(`input`,{type:`number`,min:1,step:1,className:`rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:border-edge-strong focus:outline-none`,value:r.timeoutMs,disabled:a,onChange:S}),t[33]=a,t[34]=S,t[35]=r.timeoutMs,t[36]=C):C=t[36];let w;t[37]!==s.toolTimeoutLabel||t[38]!==C?(w=(0,J.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-fg-muted`,children:[s.toolTimeoutLabel,C]}),t[37]=s.toolTimeoutLabel,t[38]=C,t[39]=w):w=t[39];let T;t[40]!==i||t[41]!==r?(T=e=>i({...r,autoProviderFallback:e.target.value}),t[40]=i,t[41]=r,t[42]=T):T=t[42];let E;t[43]===s.policyInherit?E=t[44]:(E=(0,J.jsx)(P,{value:``,children:s.policyInherit}),t[43]=s.policyInherit,t[44]=E);let D;t[45]===s.policyEnabled?D=t[46]:(D=(0,J.jsx)(P,{value:`true`,children:s.policyEnabled}),t[45]=s.policyEnabled,t[46]=D);let O;t[47]===s.policyDisabled?O=t[48]:(O=(0,J.jsx)(P,{value:`false`,children:s.policyDisabled}),t[47]=s.policyDisabled,t[48]=O);let k;t[49]!==a||t[50]!==T||t[51]!==E||t[52]!==D||t[53]!==O||t[54]!==r.autoProviderFallback?(k=(0,J.jsxs)(ee,{value:r.autoProviderFallback,disabled:a,onChange:T,children:[E,D,O]}),t[49]=a,t[50]=T,t[51]=E,t[52]=D,t[53]=O,t[54]=r.autoProviderFallback,t[55]=k):k=t[55];let A;t[56]!==s.modelAutoProviderFallbackLabel||t[57]!==k?(A=(0,J.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-fg-muted`,children:[s.modelAutoProviderFallbackLabel,k]}),t[56]=s.modelAutoProviderFallbackLabel,t[57]=k,t[58]=A):A=t[58];let j;t[59]!==w||t[60]!==A?(j=(0,J.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[w,A]}),t[59]=w,t[60]=A,t[61]=j):j=t[61];let M;t[62]!==x||t[63]!==j||t[64]!==g?(M=(0,J.jsxs)(`div`,{className:`grid gap-3 border-t border-edge-subtle p-3 dark:border-edge`,children:[g,x,j]}),t[62]=x,t[63]=j,t[64]=g,t[65]=M):M=t[65];let N;return t[66]!==M||t[67]!==d?(N=(0,J.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/70 shadow-surface`,children:[d,M]}),t[66]=M,t[67]=d,t[68]=N):N=t[68],N}export{$e as CapabilityPresetsSettingsPanel};
@@ -1 +0,0 @@
1
- import{r as e}from"./locale-store-tnRLWdx2.js";import{n as t}from"./channel-recipient-api-BOkLI89e.js";function n(){return e(`/api/channels/status`)}var r=t;export{r as n,n as t};