hermes-web-ui 0.6.24 → 0.6.25

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 (55) hide show
  1. package/dist/client/assets/js/{ChannelsView-DV-LtXVi.js → ChannelsView-p3dSvD02.js} +1 -1
  2. package/dist/client/assets/js/{ChatPanel-DyZWRnQs.js → ChatPanel-DRCE0v4g.js} +1 -1
  3. package/dist/client/assets/js/{ChatView-CuWpMwOd.js → ChatView-CAoJp8-Q.js} +1 -1
  4. package/dist/client/assets/js/{CodingAgentsView-D_Ngirz0.js → CodingAgentsView-X0I-H0Yu.js} +1 -1
  5. package/dist/client/assets/js/{DesktopPetView-BGY-7Dcd.js → DesktopPetView-BH9a1zur.js} +1 -1
  6. package/dist/client/assets/js/{DevicesView-BNZqDe2U.js → DevicesView-CMcwuGZ6.js} +1 -1
  7. package/dist/client/assets/js/{FileEditor-BPFC-M3W.js → FileEditor-CzWdryd5.js} +1 -1
  8. package/dist/client/assets/js/{FileRenameModal-5mJtyNBP.js → FileRenameModal-C2YmHkSN.js} +1 -1
  9. package/dist/client/assets/js/{FilesView-CRbkvC6l.js → FilesView-CKxvh6yi.js} +1 -1
  10. package/dist/client/assets/js/{GlobalAgentView-my3AKdll.js → GlobalAgentView-77p8MKvy.js} +1 -1
  11. package/dist/client/assets/js/{GroupChatView-btwSVoC0.js → GroupChatView-D1WFEfIs.js} +1 -1
  12. package/dist/client/assets/js/{HistoryMessageList-IubX9-tb.js → HistoryMessageList-BcG-gj6N.js} +1 -1
  13. package/dist/client/assets/js/{HistoryView-N3v7MNfo.js → HistoryView-CzybyBXj.js} +1 -1
  14. package/dist/client/assets/js/{JobsView-CHq_TJQ6.js → JobsView-BviznpSY.js} +1 -1
  15. package/dist/client/assets/js/{KanbanView-BMh8IgQo.js → KanbanView-B0c6OMrf.js} +1 -1
  16. package/dist/client/assets/js/{LoginView-sE4g4Zua.js → LoginView-B9nES8-3.js} +1 -1
  17. package/dist/client/assets/js/{LogsView-awh5ZCp8.js → LogsView-kLI6-05w.js} +1 -1
  18. package/dist/client/assets/js/{MarkdownRenderer-BbGvq6C-.js → MarkdownRenderer-DQvs79tf.js} +1 -1
  19. package/dist/client/assets/js/{McpManagerView-CnSCITtQ.js → McpManagerView-BZU1Puf0.js} +1 -1
  20. package/dist/client/assets/js/{MemoryView-CbQOeUKI.js → MemoryView-BH4LZtYd.js} +1 -1
  21. package/dist/client/assets/js/{MessageItem-DSHiAgFE.js → MessageItem-Cu3_aQT8.js} +2 -2
  22. package/dist/client/assets/js/{MessageList-oRCKlivC.js → MessageList-Ds_mjMbf.js} +1 -1
  23. package/dist/client/assets/js/{ModelsView-B0esXyBm.js → ModelsView-CZK6wwtt.js} +1 -1
  24. package/dist/client/assets/js/{OutlinePanel-BofcYepl.js → OutlinePanel-CYuSrNX9.js} +1 -1
  25. package/dist/client/assets/js/{PageSidebarFooter-BPeWlPvZ.js → PageSidebarFooter-Dk-OfmNy.js} +1 -1
  26. package/dist/client/assets/js/{PerformanceView-gc12dWCZ.js → PerformanceView-DkXk4HB_.js} +1 -1
  27. package/dist/client/assets/js/{PetdexView-CZjbg41u.js → PetdexView-DGkSZYVi.js} +1 -1
  28. package/dist/client/assets/js/{PluginsView-DRwyXTJC.js → PluginsView-D197obRC.js} +1 -1
  29. package/dist/client/assets/js/{ProfilesView-zVd3TfNW.js → ProfilesView-BhGBaYDE.js} +1 -1
  30. package/dist/client/assets/js/{SettingRow-G7ZusJw_.js → SettingRow-DfRI-z7L.js} +1 -1
  31. package/dist/client/assets/js/{SettingsCircuitBadge-CFo2KqP-.js → SettingsCircuitBadge-Eiv8LQz0.js} +1 -1
  32. package/dist/client/assets/js/{SettingsView-DDjt6UpN.js → SettingsView-B4ipIIOj.js} +1 -1
  33. package/dist/client/assets/js/{SkillsUsageView-DnVnAYHG.js → SkillsUsageView-DT4o1LA9.js} +1 -1
  34. package/dist/client/assets/js/{SkillsView-CHi4L7Oi.js → SkillsView-CUK-9OLz.js} +1 -1
  35. package/dist/client/assets/js/{TerminalPanel-Dx7huJY2.js → TerminalPanel-gyT2AS7Z.js} +1 -1
  36. package/dist/client/assets/js/{TerminalView-PQIIFHwX.js → TerminalView-C3a6BwEG.js} +1 -1
  37. package/dist/client/assets/js/{UsageView-Dzr2wBc7.js → UsageView-DrUS9OIk.js} +1 -1
  38. package/dist/client/assets/js/{VersionPreviewView-JQrieRPU.js → VersionPreviewView-qbXwqYd3.js} +1 -1
  39. package/dist/client/assets/js/{WorkflowView-DRanDY9s.js → WorkflowView-D-6z--9A.js} +1 -1
  40. package/dist/client/assets/js/{_plugin-vue_export-helper-fFMkIM4P.js → _plugin-vue_export-helper-CvnFozKy.js} +2 -2
  41. package/dist/client/assets/js/{chat-timestamp-CZtP79YD.js → chat-timestamp-CkDNtK9Y.js} +1 -1
  42. package/dist/client/assets/js/{files-DOpu4Qfg.js → files-CBYc0MSs.js} +1 -1
  43. package/dist/client/assets/js/index-B2IKGvbR.js +3 -0
  44. package/dist/client/assets/js/{models-y7NaVj-e.js → models-DetB4_Ug.js} +1 -1
  45. package/dist/client/assets/js/{session-browser-prefs-BOqwOeHi.js → session-browser-prefs-BYjSnxJq.js} +1 -1
  46. package/dist/client/assets/js/{skills-D7ZMzzzG.js → skills-5qxphanX.js} +1 -1
  47. package/dist/client/assets/js/{system-CRmVbE8Z.js → system-Onp4yS9N.js} +1 -1
  48. package/dist/client/assets/js/{ttsHelpers-vHLmbeY4.js → ttsHelpers-DNcZ5khq.js} +1 -1
  49. package/dist/client/assets/js/{useSttSettings-s4LBWl55.js → useSttSettings-C-jexrW7.js} +1 -1
  50. package/dist/client/index.html +3 -3
  51. package/dist/server/agent-bridge/python/bridge_runtime.py +2 -2
  52. package/dist/server/index.js +3 -3
  53. package/dist/server/openapi.json +1 -1
  54. package/package.json +1 -1
  55. package/dist/client/assets/js/index-Brl4qW5V.js +0 -3
@@ -1 +1 @@
1
- import{n as S}from"./rolldown-runtime-M0oDzQ_3.js";import{An as Ae,Bn as Ie,Bt as Be,Hn as r,It as u,Kt as W,Nn as Pe,Ot as te,Pn as Ve,Qn as P,Rt as Re,V as Le,an as U,cn as b,cr as e,er as D,fn as $,g as ke,hn as Q,in as De,jn as v,kn as $e,m as h,on as F,pn as n,pr as T,sn as x,t as O,tn as C,ur as ne}from"./ui-vendor-DDMfmCj2.js";import{O as E,k as K}from"./vue-vendor-BsMpqyaC.js";import{n as j,t as G}from"./_plugin-vue_export-helper-fFMkIM4P.js";import{Dt as Ne,Et as We,G as Qe,H as Fe,L as we,R as ye,U as Oe,V as Ee,q as Ke}from"./index-Brl4qW5V.js";import{n as je,t as s}from"./SettingRow-G7ZusJw_.js";var ie,re,oe,se,qe,de=S((()=>{W(),O(),E(),ie={class:"platform-info"},re=["innerHTML"],oe={class:"platform-name"},se={key:0,class:"platform-card-body"},qe=Q({__name:"PlatformCard",props:{platformKey:{},name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(A){const g=A,y=D(!0),{t:a}=K(),H=De(()=>{const _=g.credentials;if(!_)return!1;if(g.platformKey==="matrix"){const z=_.extra||{},M=String(z.homeserver||"").trim(),q=String(_.token||"").trim(),I=String(z.user_id||"").trim(),p=String(z.password||"").trim();return!!(M&&(q||I&&p))}const w=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[_,_.extra].filter(Boolean).some(z=>w.some(M=>{const q=z[M];return q!=null&&q!==""&&q!==!1}))});return(_,w)=>(v(),b("div",{class:ne(["platform-card",{configured:H.value}])},[U("div",{class:"platform-card-header",onClick:w[0]||(w[0]=z=>y.value=!y.value)},[U("div",ie,[U("span",{class:"platform-icon",innerHTML:A.icon},null,8,re),U("span",oe,T(A.name),1),n(e(Be),{type:H.value?"success":"default",size:"small",round:""},{default:r(()=>[$(T(H.value?e(a)("common.configured"):e(a)("common.notConfigured")),1)]),_:1},8,["type"])]),U("span",{class:ne(["expand-icon",{expanded:y.value}])},"▾",2)]),y.value?(v(),b("div",se,[A.exclusive?(v(),F(e(Re),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:r(()=>[$(T(e(a)("platform.exclusiveTokenWarning")),1)]),_:1})):x("",!0),Ve(_.$slots,"default",{},void 0,!0)])):x("",!0)],2))}})})),Ge=S((()=>{})),ze,Je=S((()=>{de(),de(),Ge(),j(),ze=G(qe,[["__scopeId","data-v-23f12852"]])})),ue,pe,me,fe,ce,Ce,ve=S((()=>{W(),O(),E(),we(),Fe(),Je(),je(),ue={class:"settings-section"},pe={class:"weixin-qr-section"},me={key:1,class:"weixin-qr-loading"},fe={key:2,class:"weixin-qr-hint"},ce={class:"platform-actions"},Ce=Q({__name:"PlatformSettings",setup(A){const g=ye(),y=Le(),{t:a}=K(),H=P({}),_=P({}),w=P({}),z=P({}),M=P({});function q(i){return JSON.parse(JSON.stringify(i||{}))}function I(i,l){for(const[f,t]of Object.entries(l))t&&typeof t=="object"&&!Array.isArray(t)?i[f]=I({...i[f]||{}},t):i[f]=t;return i}function p(i){return _[i]||(_[i]=q(g[i])),_[i]}function d(i){return w[i]||(w[i]=q(B(i))),w[i]}function c(i,l){_[i]=I({...p(i)},l),z[i]=!0}function m(i,l){w[i]=I({...d(i)},l),M[i]=!0}function J(i,l){return JSON.stringify(i||{})===JSON.stringify(l||{})}function X(i){return!!z[i]&&!!_[i]&&!J(_[i],g[i])}function Y(i){return!!M[i]&&!!w[i]&&!J(w[i],B(i))}function Se(i){return X(i)||Y(i)}function o(i){return!!H[i]}async function Me(i){H[i]=!0;try{const l=X(i),f=Y(i);l&&await g.saveSection(i,p(i),{restart:!f}),f&&(await Qe(i,d(i)),await g.fetchSettings()),_[i]=q(g[i]),w[i]=q(B(i)),z[i]=!1,M[i]=!1,y.success(a("settings.saved"))}catch(l){y.error(l?.message||a("settings.saveFailed"))}finally{H[i]=!1}}function B(i){return g.platforms[i]||{}}function Z(i){return i===!0||i==="true"}const ee=D(""),V=D(""),k=D("idle");let R=null;async function Te(){k.value="loading",ee.value="",V.value="",le();try{const i=await Ee();V.value=i.qrcode,ee.value=i.qrcode_url,window.open(i.qrcode_url,"_blank"),k.value="waiting",L()}catch(i){k.value="error",y.error(i.message||a("platform.qrFetching"))}}function L(){V.value&&(R=setTimeout(async()=>{try{const i=await Oe(V.value);i.status==="wait"?L():i.status==="scaned"?(k.value="scaned",L()):i.status==="expired"?k.value="expired":i.status==="confirmed"&&(k.value="confirmed",await Ke({account_id:i.account_id,token:i.token,base_url:i.base_url}),await g.fetchSettings(),y.success(a("settings.saved")))}catch{L()}},3e3))}function le(){R&&(clearTimeout(R),R=null)}Ae(()=>{le()});const ae=[{key:"telegram",name:"Telegram",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>'},{key:"discord",name:"Discord",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>'},{key:"slack",name:"Slack",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>'},{key:"whatsapp",name:"WhatsApp",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>'},{key:"matrix",name:"Matrix",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>'},{key:"feishu",name:"Feishu",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>'},{key:"dingtalk",name:"DingTalk",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M19.76 7.05c-.23-.52-.7-.9-1.26-1.02L5.35 3.2c-.77-.16-1.51.38-1.58 1.16-.22 2.55.17 5.4 1.13 7.66.97 2.29 2.52 4.11 4.45 4.82l-1.28 3.03c-.17.4.24.79.63.59l9.47-4.83c.34-.17.55-.52.55-.9v-3.12c.73-.4 1.22-1.17 1.22-2.06 0-.87-.08-1.73-.18-2.5zm-3.66 5.95-5.19 2.65.76-1.8c.12-.29-.03-.62-.33-.72-2.1-.73-3.56-3.54-3.95-6.73l9.27 2c.04.38.07.76.07 1.15 0 .45-.36.81-.81.81h-2.79c-.35 0-.63.28-.63.63s.28.63.63.63h2.97V13z"/></svg>'},{key:"qqbot",name:"QQBot",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C7.58 2 4 5.27 4 9.31c0 2.3 1.15 4.34 2.95 5.68-.13.58-.48 1.62-1.26 2.53-.24.28-.05.72.32.73 1.72.05 3.02-.68 3.69-1.15.72.16 1.49.25 2.3.25 4.42 0 8-3.27 8-7.31S16.42 2 12 2zm-3.2 7.63c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zm6.4 0c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zM5.5 20.5a.5.5 0 0 1 .5-.5h12a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z"/></svg>'},{key:"weixin",name:"Weixin",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'},{key:"wecom",name:"WeCom",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'}];return Ie(()=>ae.map(i=>({key:i.key,config:g[i.key],credentials:B(i.key)})),i=>{for(const l of i)z[l.key]||(_[l.key]=q(l.config)),M[l.key]||(w[l.key]=q(l.credentials))},{deep:!0,immediate:!0}),(i,l)=>(v(),b("section",ue,[(v(),b(C,null,Pe(ae,f=>n(ze,{key:f.key,name:f.name,icon:f.icon,"platform-key":f.key,exclusive:f.exclusive,config:e(g)[f.key],credentials:B(f.key)},{default:r(()=>[f.key==="telegram"?(v(),b(C,{key:0},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:r(()=>[n(e(u),{value:d("telegram").token||"",loading:o("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...","onUpdate:value":l[0]||(l[0]=t=>m("telegram",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.proxyUrl"),hint:e(a)("platform.proxyUrlHint")},{default:r(()=>[n(e(u),{value:d("telegram").proxy||"",loading:o("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"socks5://127.0.0.1:7890","onUpdate:value":l[1]||(l[1]=t=>m("telegram",{proxy:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:r(()=>[n(e(h),{value:p("telegram").require_mention,loading:o("telegram"),"onUpdate:value":l[2]||(l[2]=t=>c("telegram",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:r(()=>[n(e(h),{value:p("telegram").reactions,loading:o("telegram"),"onUpdate:value":l[3]||(l[3]=t=>c("telegram",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:r(()=>[n(e(u),{value:p("telegram").free_response_chats||"",loading:o("telegram"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[4]||(l[4]=t=>c("telegram",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:r(()=>[n(e(u),{value:(p("telegram").mention_patterns||[]).join(", "),loading:o("telegram"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[5]||(l[5]=t=>c("telegram",{mention_patterns:t?t.split(",").map(N=>N.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="discord"?(v(),b(C,{key:1},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:r(()=>[n(e(u),{value:d("discord").token||"",loading:o("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...","onUpdate:value":l[6]||(l[6]=t=>m("discord",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.proxyUrl"),hint:e(a)("platform.proxyUrlHint")},{default:r(()=>[n(e(u),{value:d("discord").proxy||"",loading:o("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"socks5://127.0.0.1:7890","onUpdate:value":l[7]||(l[7]=t=>m("discord",{proxy:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:r(()=>[n(e(h),{value:p("discord").require_mention,loading:o("discord"),"onUpdate:value":l[8]||(l[8]=t=>c("discord",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHint")},{default:r(()=>[n(e(h),{value:p("discord").auto_thread,loading:o("discord"),"onUpdate:value":l[9]||(l[9]=t=>c("discord",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:r(()=>[n(e(h),{value:p("discord").reactions,loading:o("discord"),"onUpdate:value":l[10]||(l[10]=t=>c("discord",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:r(()=>[n(e(u),{value:p("discord").free_response_channels||"",loading:o("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[11]||(l[11]=t=>c("discord",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedChannels"),hint:e(a)("platform.allowedChannelsHint")},{default:r(()=>[n(e(u),{value:p("discord").allowed_channels||"",loading:o("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[12]||(l[12]=t=>c("discord",{allowed_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.ignoredChannels"),hint:e(a)("platform.ignoredChannelsHint")},{default:r(()=>[n(e(u),{value:p("discord").ignored_channels||"",loading:o("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[13]||(l[13]=t=>c("discord",{ignored_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.noThreadChannels"),hint:e(a)("platform.noThreadChannelsHint")},{default:r(()=>[n(e(u),{value:p("discord").no_thread_channels||"",loading:o("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[14]||(l[14]=t=>c("discord",{no_thread_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="slack"?(v(),b(C,{key:2},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:r(()=>[n(e(u),{value:d("slack").token||"",loading:o("slack"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...","onUpdate:value":l[15]||(l[15]=t=>m("slack",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:r(()=>[n(e(h),{value:p("slack").require_mention,loading:o("slack"),"onUpdate:value":l[16]||(l[16]=t=>c("slack",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowBots"),hint:e(a)("platform.allowBotsHint")},{default:r(()=>[n(e(h),{value:p("slack").allow_bots,loading:o("slack"),"onUpdate:value":l[17]||(l[17]=t=>c("slack",{allow_bots:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:r(()=>[n(e(u),{value:p("slack").free_response_channels||"",loading:o("slack"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[18]||(l[18]=t=>c("slack",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="whatsapp"?(v(),b(C,{key:3},[n(s,{label:e(a)("platform.waEnabled"),hint:e(a)("platform.waEnabledHint")},{default:r(()=>[n(e(h),{value:d("whatsapp").enabled,loading:o("whatsapp"),"onUpdate:value":l[19]||(l[19]=t=>m("whatsapp",{enabled:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:r(()=>[n(e(h),{value:p("whatsapp").require_mention,loading:o("whatsapp"),"onUpdate:value":l[20]||(l[20]=t=>c("whatsapp",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:r(()=>[n(e(u),{value:p("whatsapp").free_response_chats||"",loading:o("whatsapp"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[21]||(l[21]=t=>c("whatsapp",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:r(()=>[n(e(u),{value:(p("whatsapp").mention_patterns||[]).join(", "),loading:o("whatsapp"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[22]||(l[22]=t=>c("whatsapp",{mention_patterns:t?t.split(",").map(N=>N.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="matrix"?(v(),b(C,{key:4},[n(s,{label:e(a)("platform.accessToken"),hint:e(a)("platform.accessTokenHint")},{default:r(()=>[n(e(u),{value:d("matrix").token||"",loading:o("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...","onUpdate:value":l[23]||(l[23]=t=>m("matrix",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.matrixUserId"),hint:e(a)("platform.matrixUserIdHint")},{default:r(()=>[n(e(u),{value:d("matrix").extra?.user_id||"",loading:o("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"@hermes:example.org","onUpdate:value":l[24]||(l[24]=t=>m("matrix",{extra:{...d("matrix").extra,user_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.matrixPassword"),hint:e(a)("platform.matrixPasswordHint")},{default:r(()=>[n(e(u),{value:d("matrix").extra?.password||"",loading:o("matrix"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Matrix password","onUpdate:value":l[25]||(l[25]=t=>m("matrix",{extra:{...d("matrix").extra,password:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.homeserver"),hint:e(a)("platform.homeserverHint")},{default:r(()=>[n(e(u),{value:d("matrix").extra?.homeserver||"",loading:o("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org","onUpdate:value":l[26]||(l[26]=t=>m("matrix",{extra:{...d("matrix").extra,homeserver:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.proxyUrl"),hint:e(a)("platform.proxyUrlHint")},{default:r(()=>[n(e(u),{value:d("matrix").proxy||"",loading:o("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"socks5://127.0.0.1:7890","onUpdate:value":l[27]||(l[27]=t=>m("matrix",{proxy:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionRoom")},{default:r(()=>[n(e(h),{value:p("matrix").require_mention,loading:o("matrix"),"onUpdate:value":l[28]||(l[28]=t=>c("matrix",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHintRoom")},{default:r(()=>[n(e(h),{value:p("matrix").auto_thread,loading:o("matrix"),"onUpdate:value":l[29]||(l[29]=t=>c("matrix",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.dmMentionThreads"),hint:e(a)("platform.dmMentionThreadsHint")},{default:r(()=>[n(e(h),{value:p("matrix").dm_mention_threads,loading:o("matrix"),"onUpdate:value":l[30]||(l[30]=t=>c("matrix",{dm_mention_threads:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseRooms"),hint:e(a)("platform.freeResponseRoomsHint")},{default:r(()=>[n(e(u),{value:p("matrix").free_response_rooms||"",loading:o("matrix"),size:"small",placeholder:"room_id1,room_id2","onUpdate:value":l[31]||(l[31]=t=>c("matrix",{free_response_rooms:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="feishu"?(v(),b(C,{key:5},[n(s,{label:e(a)("platform.appId"),hint:e(a)("platform.appIdHint")},{default:r(()=>[n(e(u),{value:d("feishu").extra?.app_id||"",loading:o("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...","onUpdate:value":l[32]||(l[32]=t=>m("feishu",{extra:{...d("feishu").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.appSecretHint")},{default:r(()=>[n(e(u),{value:d("feishu").extra?.app_secret||"",loading:o("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[33]||(l[33]=t=>m("feishu",{extra:{...d("feishu").extra,app_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.encryptKey"),hint:e(a)("platform.encryptKeyHint")},{default:r(()=>[n(e(u),{value:d("feishu").extra?.encrypt_key||"",loading:o("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Encrypt Key","onUpdate:value":l[34]||(l[34]=t=>m("feishu",{extra:{...d("feishu").extra,encrypt_key:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.verificationToken"),hint:e(a)("platform.verificationTokenHint")},{default:r(()=>[n(e(u),{value:d("feishu").extra?.verification_token||"",loading:o("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Verification Token","onUpdate:value":l[35]||(l[35]=t=>m("feishu",{extra:{...d("feishu").extra,verification_token:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:r(()=>[n(e(h),{value:p("feishu").require_mention,loading:o("feishu"),"onUpdate:value":l[36]||(l[36]=t=>c("feishu",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:r(()=>[n(e(u),{value:p("feishu").free_response_chats||"",loading:o("feishu"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[37]||(l[37]=t=>c("feishu",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="dingtalk"?(v(),b(C,{key:6},[n(s,{label:e(a)("platform.clientId"),hint:e(a)("platform.clientIdHint")},{default:r(()=>[n(e(u),{value:d("dingtalk").extra?.client_id||"",loading:o("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID","onUpdate:value":l[38]||(l[38]=t=>m("dingtalk",{extra:{...d("dingtalk").extra,client_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.clientSecret"),hint:e(a)("platform.clientSecretHint")},{default:r(()=>[n(e(u),{value:d("dingtalk").extra?.client_secret||"",loading:o("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret","onUpdate:value":l[39]||(l[39]=t=>m("dingtalk",{extra:{...d("dingtalk").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.cardTemplateId"),hint:e(a)("platform.cardTemplateIdHint")},{default:r(()=>[n(e(u),{value:d("dingtalk").extra?.card_template_id||"",loading:o("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"AI Card Template ID","onUpdate:value":l[40]||(l[40]=t=>m("dingtalk",{extra:{...d("dingtalk").extra,card_template_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:r(()=>[n(e(h),{value:Z(d("dingtalk").allow_all_users),loading:o("dingtalk"),"onUpdate:value":l[41]||(l[41]=t=>m("dingtalk",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:r(()=>[n(e(u),{value:d("dingtalk").allowed_users||"",loading:o("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2","onUpdate:value":l[42]||(l[42]=t=>m("dingtalk",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:r(()=>[n(e(h),{value:p("dingtalk").require_mention,loading:o("dingtalk"),"onUpdate:value":l[43]||(l[43]=t=>c("dingtalk",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:r(()=>[n(e(u),{value:p("dingtalk").free_response_chats||"",loading:o("dingtalk"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[44]||(l[44]=t=>c("dingtalk",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="qqbot"?(v(),b(C,{key:7},[n(s,{label:e(a)("platform.qqAppId"),hint:e(a)("platform.qqAppIdHint")},{default:r(()=>[n(e(u),{value:d("qqbot").extra?.app_id||"",loading:o("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID","onUpdate:value":l[45]||(l[45]=t=>m("qqbot",{extra:{...d("qqbot").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqAppSecret"),hint:e(a)("platform.qqAppSecretHint")},{default:r(()=>[n(e(u),{value:d("qqbot").extra?.client_secret||"",loading:o("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[46]||(l[46]=t=>m("qqbot",{extra:{...d("qqbot").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:r(()=>[n(e(u),{value:d("qqbot").allowed_users||"",loading:o("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2","onUpdate:value":l[47]||(l[47]=t=>m("qqbot",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:r(()=>[n(e(h),{value:Z(d("qqbot").allow_all_users),loading:o("qqbot"),"onUpdate:value":l[48]||(l[48]=t=>m("qqbot",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqMarkdown"),hint:e(a)("platform.qqMarkdownHint")},{default:r(()=>[n(e(h),{value:p("qqbot").extra?.markdown_support??!0,loading:o("qqbot"),"onUpdate:value":l[49]||(l[49]=t=>c("qqbot",{extra:{...p("qqbot").extra,markdown_support:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="weixin"?(v(),b(C,{key:8},[U("div",pe,[k.value==="idle"||k.value==="error"||k.value==="expired"||k.value==="confirmed"?(v(),F(e(te),{key:0,type:"primary",size:"small",onClick:Te},{default:r(()=>[$(T(k.value==="confirmed"?e(a)("platform.qrRelogin"):e(a)("platform.qrLogin")),1)]),_:1})):x("",!0),k.value==="loading"?(v(),b("div",me,[n(e(ke),{size:"small"}),U("span",null,T(e(a)("platform.qrFetching")),1)])):x("",!0),k.value==="waiting"||k.value==="scaned"?(v(),b("div",fe,T(k.value==="scaned"?e(a)("platform.qrScanedHint"):e(a)("platform.qrScanHint")),1)):x("",!0)]),n(s,{label:e(a)("platform.weixinToken"),hint:e(a)("platform.weixinTokenHint")},{default:r(()=>[n(e(u),{value:d("weixin").token||"",loading:o("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Token","onUpdate:value":l[50]||(l[50]=t=>m("weixin",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.accountId"),hint:e(a)("platform.accountIdHint")},{default:r(()=>[n(e(u),{value:d("weixin").extra?.account_id||"",loading:o("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID","onUpdate:value":l[51]||(l[51]=t=>m("weixin",{extra:{...d("weixin").extra,account_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="wecom"?(v(),b(C,{key:9},[n(s,{label:e(a)("platform.botId"),hint:e(a)("platform.botIdHint")},{default:r(()=>[n(e(u),{value:d("wecom").extra?.bot_id||"",loading:o("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID","onUpdate:value":l[52]||(l[52]=t=>m("wecom",{extra:{...d("wecom").extra,bot_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.wecomSecretHint")},{default:r(()=>[n(e(u),{value:d("wecom").extra?.secret||"",loading:o("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret","onUpdate:value":l[53]||(l[53]=t=>m("wecom",{extra:{...d("wecom").extra,secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),U("div",ce,[n(e(te),{type:"primary",size:"small",loading:o(f.key),disabled:!Se(f.key),onClick:t=>Me(f.key)},{default:r(()=>[$(T(e(a)("common.save")),1)]),_:1},8,["loading","disabled","onClick"])])]),_:2},1032,["name","icon","platform-key","exclusive","config","credentials"])),64))]))}})})),Xe=S((()=>{})),Ue,Ye=S((()=>{ve(),ve(),Xe(),j(),Ue=G(Ce,[["__scopeId","data-v-8cae539d"]])})),ge,_e,he,be,He,xe=S((()=>{W(),O(),E(),we(),We(),Ye(),ge={class:"channels-view"},_e={class:"page-header"},he={class:"header-title"},be={class:"channels-content"},He=Q({__name:"ChannelsView",setup(A){const g=ye(),y=Ne(),{t:a}=K();async function H(){(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles(),await g.fetchSettings()}return $e(()=>{H()}),(_,w)=>(v(),b("div",ge,[U("header",_e,[U("h2",he,T(e(a)("sidebar.channels")),1)]),U("div",be,[n(e(ke),{show:e(g).loading||e(g).saving,size:"large",description:e(a)("common.loading")},{default:r(()=>[e(g).loading?x("",!0):(v(),F(Ue,{key:0}))]),_:1},8,["show","description"])])]))}})})),Ze=S((()=>{})),el,ll=S((()=>{xe(),xe(),Ze(),j(),el=G(He,[["__scopeId","data-v-2a2475d5"]])}));ll();export{el as default};
1
+ import{n as S}from"./rolldown-runtime-M0oDzQ_3.js";import{An as Ae,Bn as Ie,Bt as Be,Hn as r,It as u,Kt as W,Nn as Pe,Ot as te,Pn as Ve,Qn as P,Rt as Re,V as Le,an as U,cn as b,cr as e,er as D,fn as $,g as ke,hn as Q,in as De,jn as v,kn as $e,m as h,on as F,pn as n,pr as T,sn as x,t as O,tn as C,ur as ne}from"./ui-vendor-DDMfmCj2.js";import{O as E,k as K}from"./vue-vendor-BsMpqyaC.js";import{n as j,t as G}from"./_plugin-vue_export-helper-CvnFozKy.js";import{Dt as Ne,Et as We,G as Qe,H as Fe,L as we,R as ye,U as Oe,V as Ee,q as Ke}from"./index-B2IKGvbR.js";import{n as je,t as s}from"./SettingRow-DfRI-z7L.js";var ie,re,oe,se,qe,de=S((()=>{W(),O(),E(),ie={class:"platform-info"},re=["innerHTML"],oe={class:"platform-name"},se={key:0,class:"platform-card-body"},qe=Q({__name:"PlatformCard",props:{platformKey:{},name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(A){const g=A,y=D(!0),{t:a}=K(),H=De(()=>{const _=g.credentials;if(!_)return!1;if(g.platformKey==="matrix"){const z=_.extra||{},M=String(z.homeserver||"").trim(),q=String(_.token||"").trim(),I=String(z.user_id||"").trim(),p=String(z.password||"").trim();return!!(M&&(q||I&&p))}const w=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[_,_.extra].filter(Boolean).some(z=>w.some(M=>{const q=z[M];return q!=null&&q!==""&&q!==!1}))});return(_,w)=>(v(),b("div",{class:ne(["platform-card",{configured:H.value}])},[U("div",{class:"platform-card-header",onClick:w[0]||(w[0]=z=>y.value=!y.value)},[U("div",ie,[U("span",{class:"platform-icon",innerHTML:A.icon},null,8,re),U("span",oe,T(A.name),1),n(e(Be),{type:H.value?"success":"default",size:"small",round:""},{default:r(()=>[$(T(H.value?e(a)("common.configured"):e(a)("common.notConfigured")),1)]),_:1},8,["type"])]),U("span",{class:ne(["expand-icon",{expanded:y.value}])},"▾",2)]),y.value?(v(),b("div",se,[A.exclusive?(v(),F(e(Re),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:r(()=>[$(T(e(a)("platform.exclusiveTokenWarning")),1)]),_:1})):x("",!0),Ve(_.$slots,"default",{},void 0,!0)])):x("",!0)],2))}})})),Ge=S((()=>{})),ze,Je=S((()=>{de(),de(),Ge(),j(),ze=G(qe,[["__scopeId","data-v-23f12852"]])})),ue,pe,me,fe,ce,Ce,ve=S((()=>{W(),O(),E(),we(),Fe(),Je(),je(),ue={class:"settings-section"},pe={class:"weixin-qr-section"},me={key:1,class:"weixin-qr-loading"},fe={key:2,class:"weixin-qr-hint"},ce={class:"platform-actions"},Ce=Q({__name:"PlatformSettings",setup(A){const g=ye(),y=Le(),{t:a}=K(),H=P({}),_=P({}),w=P({}),z=P({}),M=P({});function q(i){return JSON.parse(JSON.stringify(i||{}))}function I(i,l){for(const[f,t]of Object.entries(l))t&&typeof t=="object"&&!Array.isArray(t)?i[f]=I({...i[f]||{}},t):i[f]=t;return i}function p(i){return _[i]||(_[i]=q(g[i])),_[i]}function d(i){return w[i]||(w[i]=q(B(i))),w[i]}function c(i,l){_[i]=I({...p(i)},l),z[i]=!0}function m(i,l){w[i]=I({...d(i)},l),M[i]=!0}function J(i,l){return JSON.stringify(i||{})===JSON.stringify(l||{})}function X(i){return!!z[i]&&!!_[i]&&!J(_[i],g[i])}function Y(i){return!!M[i]&&!!w[i]&&!J(w[i],B(i))}function Se(i){return X(i)||Y(i)}function o(i){return!!H[i]}async function Me(i){H[i]=!0;try{const l=X(i),f=Y(i);l&&await g.saveSection(i,p(i),{restart:!f}),f&&(await Qe(i,d(i)),await g.fetchSettings()),_[i]=q(g[i]),w[i]=q(B(i)),z[i]=!1,M[i]=!1,y.success(a("settings.saved"))}catch(l){y.error(l?.message||a("settings.saveFailed"))}finally{H[i]=!1}}function B(i){return g.platforms[i]||{}}function Z(i){return i===!0||i==="true"}const ee=D(""),V=D(""),k=D("idle");let R=null;async function Te(){k.value="loading",ee.value="",V.value="",le();try{const i=await Ee();V.value=i.qrcode,ee.value=i.qrcode_url,window.open(i.qrcode_url,"_blank"),k.value="waiting",L()}catch(i){k.value="error",y.error(i.message||a("platform.qrFetching"))}}function L(){V.value&&(R=setTimeout(async()=>{try{const i=await Oe(V.value);i.status==="wait"?L():i.status==="scaned"?(k.value="scaned",L()):i.status==="expired"?k.value="expired":i.status==="confirmed"&&(k.value="confirmed",await Ke({account_id:i.account_id,token:i.token,base_url:i.base_url}),await g.fetchSettings(),y.success(a("settings.saved")))}catch{L()}},3e3))}function le(){R&&(clearTimeout(R),R=null)}Ae(()=>{le()});const ae=[{key:"telegram",name:"Telegram",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>'},{key:"discord",name:"Discord",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>'},{key:"slack",name:"Slack",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>'},{key:"whatsapp",name:"WhatsApp",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>'},{key:"matrix",name:"Matrix",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>'},{key:"feishu",name:"Feishu",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>'},{key:"dingtalk",name:"DingTalk",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M19.76 7.05c-.23-.52-.7-.9-1.26-1.02L5.35 3.2c-.77-.16-1.51.38-1.58 1.16-.22 2.55.17 5.4 1.13 7.66.97 2.29 2.52 4.11 4.45 4.82l-1.28 3.03c-.17.4.24.79.63.59l9.47-4.83c.34-.17.55-.52.55-.9v-3.12c.73-.4 1.22-1.17 1.22-2.06 0-.87-.08-1.73-.18-2.5zm-3.66 5.95-5.19 2.65.76-1.8c.12-.29-.03-.62-.33-.72-2.1-.73-3.56-3.54-3.95-6.73l9.27 2c.04.38.07.76.07 1.15 0 .45-.36.81-.81.81h-2.79c-.35 0-.63.28-.63.63s.28.63.63.63h2.97V13z"/></svg>'},{key:"qqbot",name:"QQBot",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C7.58 2 4 5.27 4 9.31c0 2.3 1.15 4.34 2.95 5.68-.13.58-.48 1.62-1.26 2.53-.24.28-.05.72.32.73 1.72.05 3.02-.68 3.69-1.15.72.16 1.49.25 2.3.25 4.42 0 8-3.27 8-7.31S16.42 2 12 2zm-3.2 7.63c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zm6.4 0c-.63 0-1.14-.55-1.14-1.23s.51-1.23 1.14-1.23 1.14.55 1.14 1.23-.51 1.23-1.14 1.23zM5.5 20.5a.5.5 0 0 1 .5-.5h12a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5z"/></svg>'},{key:"weixin",name:"Weixin",exclusive:!0,icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'},{key:"wecom",name:"WeCom",icon:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>'}];return Ie(()=>ae.map(i=>({key:i.key,config:g[i.key],credentials:B(i.key)})),i=>{for(const l of i)z[l.key]||(_[l.key]=q(l.config)),M[l.key]||(w[l.key]=q(l.credentials))},{deep:!0,immediate:!0}),(i,l)=>(v(),b("section",ue,[(v(),b(C,null,Pe(ae,f=>n(ze,{key:f.key,name:f.name,icon:f.icon,"platform-key":f.key,exclusive:f.exclusive,config:e(g)[f.key],credentials:B(f.key)},{default:r(()=>[f.key==="telegram"?(v(),b(C,{key:0},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:r(()=>[n(e(u),{value:d("telegram").token||"",loading:o("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...","onUpdate:value":l[0]||(l[0]=t=>m("telegram",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.proxyUrl"),hint:e(a)("platform.proxyUrlHint")},{default:r(()=>[n(e(u),{value:d("telegram").proxy||"",loading:o("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"socks5://127.0.0.1:7890","onUpdate:value":l[1]||(l[1]=t=>m("telegram",{proxy:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:r(()=>[n(e(h),{value:p("telegram").require_mention,loading:o("telegram"),"onUpdate:value":l[2]||(l[2]=t=>c("telegram",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:r(()=>[n(e(h),{value:p("telegram").reactions,loading:o("telegram"),"onUpdate:value":l[3]||(l[3]=t=>c("telegram",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:r(()=>[n(e(u),{value:p("telegram").free_response_chats||"",loading:o("telegram"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[4]||(l[4]=t=>c("telegram",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:r(()=>[n(e(u),{value:(p("telegram").mention_patterns||[]).join(", "),loading:o("telegram"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[5]||(l[5]=t=>c("telegram",{mention_patterns:t?t.split(",").map(N=>N.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="discord"?(v(),b(C,{key:1},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:r(()=>[n(e(u),{value:d("discord").token||"",loading:o("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...","onUpdate:value":l[6]||(l[6]=t=>m("discord",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.proxyUrl"),hint:e(a)("platform.proxyUrlHint")},{default:r(()=>[n(e(u),{value:d("discord").proxy||"",loading:o("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"socks5://127.0.0.1:7890","onUpdate:value":l[7]||(l[7]=t=>m("discord",{proxy:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:r(()=>[n(e(h),{value:p("discord").require_mention,loading:o("discord"),"onUpdate:value":l[8]||(l[8]=t=>c("discord",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHint")},{default:r(()=>[n(e(h),{value:p("discord").auto_thread,loading:o("discord"),"onUpdate:value":l[9]||(l[9]=t=>c("discord",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.reactions"),hint:e(a)("platform.reactionsHint")},{default:r(()=>[n(e(h),{value:p("discord").reactions,loading:o("discord"),"onUpdate:value":l[10]||(l[10]=t=>c("discord",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:r(()=>[n(e(u),{value:p("discord").free_response_channels||"",loading:o("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[11]||(l[11]=t=>c("discord",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedChannels"),hint:e(a)("platform.allowedChannelsHint")},{default:r(()=>[n(e(u),{value:p("discord").allowed_channels||"",loading:o("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[12]||(l[12]=t=>c("discord",{allowed_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.ignoredChannels"),hint:e(a)("platform.ignoredChannelsHint")},{default:r(()=>[n(e(u),{value:p("discord").ignored_channels||"",loading:o("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[13]||(l[13]=t=>c("discord",{ignored_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.noThreadChannels"),hint:e(a)("platform.noThreadChannelsHint")},{default:r(()=>[n(e(u),{value:p("discord").no_thread_channels||"",loading:o("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[14]||(l[14]=t=>c("discord",{no_thread_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="slack"?(v(),b(C,{key:2},[n(s,{label:e(a)("platform.botToken"),hint:e(a)("platform.botTokenHint")},{default:r(()=>[n(e(u),{value:d("slack").token||"",loading:o("slack"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...","onUpdate:value":l[15]||(l[15]=t=>m("slack",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionChannel")},{default:r(()=>[n(e(h),{value:p("slack").require_mention,loading:o("slack"),"onUpdate:value":l[16]||(l[16]=t=>c("slack",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowBots"),hint:e(a)("platform.allowBotsHint")},{default:r(()=>[n(e(h),{value:p("slack").allow_bots,loading:o("slack"),"onUpdate:value":l[17]||(l[17]=t=>c("slack",{allow_bots:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChannels"),hint:e(a)("platform.freeResponseChannelsHint")},{default:r(()=>[n(e(u),{value:p("slack").free_response_channels||"",loading:o("slack"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":l[18]||(l[18]=t=>c("slack",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="whatsapp"?(v(),b(C,{key:3},[n(s,{label:e(a)("platform.waEnabled"),hint:e(a)("platform.waEnabledHint")},{default:r(()=>[n(e(h),{value:d("whatsapp").enabled,loading:o("whatsapp"),"onUpdate:value":l[19]||(l[19]=t=>m("whatsapp",{enabled:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:r(()=>[n(e(h),{value:p("whatsapp").require_mention,loading:o("whatsapp"),"onUpdate:value":l[20]||(l[20]=t=>c("whatsapp",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:r(()=>[n(e(u),{value:p("whatsapp").free_response_chats||"",loading:o("whatsapp"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[21]||(l[21]=t=>c("whatsapp",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.mentionPatterns"),hint:e(a)("platform.mentionPatternsHint")},{default:r(()=>[n(e(u),{value:(p("whatsapp").mention_patterns||[]).join(", "),loading:o("whatsapp"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":l[22]||(l[22]=t=>c("whatsapp",{mention_patterns:t?t.split(",").map(N=>N.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="matrix"?(v(),b(C,{key:4},[n(s,{label:e(a)("platform.accessToken"),hint:e(a)("platform.accessTokenHint")},{default:r(()=>[n(e(u),{value:d("matrix").token||"",loading:o("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...","onUpdate:value":l[23]||(l[23]=t=>m("matrix",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.matrixUserId"),hint:e(a)("platform.matrixUserIdHint")},{default:r(()=>[n(e(u),{value:d("matrix").extra?.user_id||"",loading:o("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"@hermes:example.org","onUpdate:value":l[24]||(l[24]=t=>m("matrix",{extra:{...d("matrix").extra,user_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.matrixPassword"),hint:e(a)("platform.matrixPasswordHint")},{default:r(()=>[n(e(u),{value:d("matrix").extra?.password||"",loading:o("matrix"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Matrix password","onUpdate:value":l[25]||(l[25]=t=>m("matrix",{extra:{...d("matrix").extra,password:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.homeserver"),hint:e(a)("platform.homeserverHint")},{default:r(()=>[n(e(u),{value:d("matrix").extra?.homeserver||"",loading:o("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org","onUpdate:value":l[26]||(l[26]=t=>m("matrix",{extra:{...d("matrix").extra,homeserver:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.proxyUrl"),hint:e(a)("platform.proxyUrlHint")},{default:r(()=>[n(e(u),{value:d("matrix").proxy||"",loading:o("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"socks5://127.0.0.1:7890","onUpdate:value":l[27]||(l[27]=t=>m("matrix",{proxy:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionRoom")},{default:r(()=>[n(e(h),{value:p("matrix").require_mention,loading:o("matrix"),"onUpdate:value":l[28]||(l[28]=t=>c("matrix",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.autoThread"),hint:e(a)("platform.autoThreadHintRoom")},{default:r(()=>[n(e(h),{value:p("matrix").auto_thread,loading:o("matrix"),"onUpdate:value":l[29]||(l[29]=t=>c("matrix",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.dmMentionThreads"),hint:e(a)("platform.dmMentionThreadsHint")},{default:r(()=>[n(e(h),{value:p("matrix").dm_mention_threads,loading:o("matrix"),"onUpdate:value":l[30]||(l[30]=t=>c("matrix",{dm_mention_threads:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseRooms"),hint:e(a)("platform.freeResponseRoomsHint")},{default:r(()=>[n(e(u),{value:p("matrix").free_response_rooms||"",loading:o("matrix"),size:"small",placeholder:"room_id1,room_id2","onUpdate:value":l[31]||(l[31]=t=>c("matrix",{free_response_rooms:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="feishu"?(v(),b(C,{key:5},[n(s,{label:e(a)("platform.appId"),hint:e(a)("platform.appIdHint")},{default:r(()=>[n(e(u),{value:d("feishu").extra?.app_id||"",loading:o("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...","onUpdate:value":l[32]||(l[32]=t=>m("feishu",{extra:{...d("feishu").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.appSecretHint")},{default:r(()=>[n(e(u),{value:d("feishu").extra?.app_secret||"",loading:o("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[33]||(l[33]=t=>m("feishu",{extra:{...d("feishu").extra,app_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.encryptKey"),hint:e(a)("platform.encryptKeyHint")},{default:r(()=>[n(e(u),{value:d("feishu").extra?.encrypt_key||"",loading:o("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Encrypt Key","onUpdate:value":l[34]||(l[34]=t=>m("feishu",{extra:{...d("feishu").extra,encrypt_key:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.verificationToken"),hint:e(a)("platform.verificationTokenHint")},{default:r(()=>[n(e(u),{value:d("feishu").extra?.verification_token||"",loading:o("feishu"),type:"password","show-password-on":"click",clearable:"",size:"small",class:"input-lg",placeholder:"Verification Token","onUpdate:value":l[35]||(l[35]=t=>m("feishu",{extra:{...d("feishu").extra,verification_token:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:r(()=>[n(e(h),{value:p("feishu").require_mention,loading:o("feishu"),"onUpdate:value":l[36]||(l[36]=t=>c("feishu",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:r(()=>[n(e(u),{value:p("feishu").free_response_chats||"",loading:o("feishu"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[37]||(l[37]=t=>c("feishu",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="dingtalk"?(v(),b(C,{key:6},[n(s,{label:e(a)("platform.clientId"),hint:e(a)("platform.clientIdHint")},{default:r(()=>[n(e(u),{value:d("dingtalk").extra?.client_id||"",loading:o("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID","onUpdate:value":l[38]||(l[38]=t=>m("dingtalk",{extra:{...d("dingtalk").extra,client_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.clientSecret"),hint:e(a)("platform.clientSecretHint")},{default:r(()=>[n(e(u),{value:d("dingtalk").extra?.client_secret||"",loading:o("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret","onUpdate:value":l[39]||(l[39]=t=>m("dingtalk",{extra:{...d("dingtalk").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.cardTemplateId"),hint:e(a)("platform.cardTemplateIdHint")},{default:r(()=>[n(e(u),{value:d("dingtalk").extra?.card_template_id||"",loading:o("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"AI Card Template ID","onUpdate:value":l[40]||(l[40]=t=>m("dingtalk",{extra:{...d("dingtalk").extra,card_template_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:r(()=>[n(e(h),{value:Z(d("dingtalk").allow_all_users),loading:o("dingtalk"),"onUpdate:value":l[41]||(l[41]=t=>m("dingtalk",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:r(()=>[n(e(u),{value:d("dingtalk").allowed_users||"",loading:o("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2","onUpdate:value":l[42]||(l[42]=t=>m("dingtalk",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.requireMention"),hint:e(a)("platform.requireMentionGroup")},{default:r(()=>[n(e(h),{value:p("dingtalk").require_mention,loading:o("dingtalk"),"onUpdate:value":l[43]||(l[43]=t=>c("dingtalk",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.freeResponseChats"),hint:e(a)("platform.freeResponseChatsHint")},{default:r(()=>[n(e(u),{value:p("dingtalk").free_response_chats||"",loading:o("dingtalk"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":l[44]||(l[44]=t=>c("dingtalk",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="qqbot"?(v(),b(C,{key:7},[n(s,{label:e(a)("platform.qqAppId"),hint:e(a)("platform.qqAppIdHint")},{default:r(()=>[n(e(u),{value:d("qqbot").extra?.app_id||"",loading:o("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID","onUpdate:value":l[45]||(l[45]=t=>m("qqbot",{extra:{...d("qqbot").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqAppSecret"),hint:e(a)("platform.qqAppSecretHint")},{default:r(()=>[n(e(u),{value:d("qqbot").extra?.client_secret||"",loading:o("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":l[46]||(l[46]=t=>m("qqbot",{extra:{...d("qqbot").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowedUsers"),hint:e(a)("platform.allowedUsersHint")},{default:r(()=>[n(e(u),{value:d("qqbot").allowed_users||"",loading:o("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2","onUpdate:value":l[47]||(l[47]=t=>m("qqbot",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.allowAllUsers"),hint:e(a)("platform.allowAllUsersHint")},{default:r(()=>[n(e(h),{value:Z(d("qqbot").allow_all_users),loading:o("qqbot"),"onUpdate:value":l[48]||(l[48]=t=>m("qqbot",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.qqMarkdown"),hint:e(a)("platform.qqMarkdownHint")},{default:r(()=>[n(e(h),{value:p("qqbot").extra?.markdown_support??!0,loading:o("qqbot"),"onUpdate:value":l[49]||(l[49]=t=>c("qqbot",{extra:{...p("qqbot").extra,markdown_support:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="weixin"?(v(),b(C,{key:8},[U("div",pe,[k.value==="idle"||k.value==="error"||k.value==="expired"||k.value==="confirmed"?(v(),F(e(te),{key:0,type:"primary",size:"small",onClick:Te},{default:r(()=>[$(T(k.value==="confirmed"?e(a)("platform.qrRelogin"):e(a)("platform.qrLogin")),1)]),_:1})):x("",!0),k.value==="loading"?(v(),b("div",me,[n(e(ke),{size:"small"}),U("span",null,T(e(a)("platform.qrFetching")),1)])):x("",!0),k.value==="waiting"||k.value==="scaned"?(v(),b("div",fe,T(k.value==="scaned"?e(a)("platform.qrScanedHint"):e(a)("platform.qrScanHint")),1)):x("",!0)]),n(s,{label:e(a)("platform.weixinToken"),hint:e(a)("platform.weixinTokenHint")},{default:r(()=>[n(e(u),{value:d("weixin").token||"",loading:o("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Token","onUpdate:value":l[50]||(l[50]=t=>m("weixin",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.accountId"),hint:e(a)("platform.accountIdHint")},{default:r(()=>[n(e(u),{value:d("weixin").extra?.account_id||"",loading:o("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID","onUpdate:value":l[51]||(l[51]=t=>m("weixin",{extra:{...d("weixin").extra,account_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),f.key==="wecom"?(v(),b(C,{key:9},[n(s,{label:e(a)("platform.botId"),hint:e(a)("platform.botIdHint")},{default:r(()=>[n(e(u),{value:d("wecom").extra?.bot_id||"",loading:o("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID","onUpdate:value":l[52]||(l[52]=t=>m("wecom",{extra:{...d("wecom").extra,bot_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(a)("platform.appSecret"),hint:e(a)("platform.wecomSecretHint")},{default:r(()=>[n(e(u),{value:d("wecom").extra?.secret||"",loading:o("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret","onUpdate:value":l[53]||(l[53]=t=>m("wecom",{extra:{...d("wecom").extra,secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):x("",!0),U("div",ce,[n(e(te),{type:"primary",size:"small",loading:o(f.key),disabled:!Se(f.key),onClick:t=>Me(f.key)},{default:r(()=>[$(T(e(a)("common.save")),1)]),_:1},8,["loading","disabled","onClick"])])]),_:2},1032,["name","icon","platform-key","exclusive","config","credentials"])),64))]))}})})),Xe=S((()=>{})),Ue,Ye=S((()=>{ve(),ve(),Xe(),j(),Ue=G(Ce,[["__scopeId","data-v-8cae539d"]])})),ge,_e,he,be,He,xe=S((()=>{W(),O(),E(),we(),We(),Ye(),ge={class:"channels-view"},_e={class:"page-header"},he={class:"header-title"},be={class:"channels-content"},He=Q({__name:"ChannelsView",setup(A){const g=ye(),y=Ne(),{t:a}=K();async function H(){(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles(),await g.fetchSettings()}return $e(()=>{H()}),(_,w)=>(v(),b("div",ge,[U("header",_e,[U("h2",he,T(e(a)("sidebar.channels")),1)]),U("div",be,[n(e(ke),{show:e(g).loading||e(g).saving,size:"large",description:e(a)("common.loading")},{default:r(()=>[e(g).loading?x("",!0):(v(),F(Ue,{key:0}))]),_:1},8,["show","description"])])]))}})})),Ze=S((()=>{})),el,ll=S((()=>{xe(),xe(),Ze(),j(),el=G(He,[["__scopeId","data-v-2a2475d5"]])}));ll();export{el as default};
@@ -1 +1 @@
1
- import{n as q}from"./rolldown-runtime-M0oDzQ_3.js";import{$t as Vt,An as Is,Bn as xe,Hn as g,I as Ka,It as Me,K as ze,Kt as et,Nn as re,Ot as T,P as Ha,Qt as Xe,Un as Ye,V as ja,an as a,cn as d,cr as s,ct as Xa,er as i,fn as V,fr as Ya,hn as tt,in as h,jn as r,kn as lt,mt as ee,nt as Ja,on as N,ot as Je,pn as c,pr as u,sn as m,t as Ds,tn as j,ur as R,ut as Qa,w as Za,wn as qt}from"./ui-vendor-DDMfmCj2.js";import{M as eo,O as st,P as to,k as at}from"./vue-vendor-BsMpqyaC.js";import{d as lo,f as Bs,n as ot,t as nt,u as Us}from"./_plugin-vue_export-helper-fFMkIM4P.js";import{$ as so,Dt as ao,E as oo,Et as no,Ot as Os,T as io,bt as ro,ct as uo,et as Wt,it as Kt,kt as Rs,tt as co,ut as vo,vt as po,xt as fo}from"./index-Brl4qW5V.js";import{i as ho,t as mo}from"./files-DOpu4Qfg.js";import{r as _o,t as wo}from"./FileEditor-BPFC-M3W.js";import{n as go,t as yo}from"./session-browser-prefs-BOqwOeHi.js";import{n as bo,t as Ht}from"./clipboard-1NPxC3YL.js";import{a as jt,i as So,n as ko,o as Co,r as Mo,t as xo}from"./MessageList-oRCKlivC.js";import{a as Xt,i as Po,n as Ao,o as Yt,r as Jt,s as Fo,t as $o}from"./OutlinePanel-BofcYepl.js";import{a as Lo,c as No,d as To,f as Io,g as Do,h as Bo,i as Uo,l as Oo,m as Ro,n as zo,o as Eo,p as Go,r as Vo,s as qo,t as Wo,u as Ko}from"./FileRenameModal-5mJtyNBP.js";import{n as Ho,t as jo}from"./TerminalPanel-Dx7huJY2.js";import{i as Xo,n as Yo,r as Jo,t as Qo}from"./SettingsCircuitBadge-CFo2KqP-.js";async function Zo(D={}){const n=new URLSearchParams;return D.humanOnly===!1&&n.set("humanOnly","false"),D.source&&n.set("source",D.source),D.limit!=null&&n.set("limit",String(D.limit)),(await Bs(`/api/hermes/sessions/conversations${n.toString()?`?${n.toString()}`:""}`)).sessions}async function en(D,n={}){const _=new URLSearchParams;n.humanOnly===!1&&_.set("humanOnly","false"),n.source&&_.set("source",n.source);const k=_.toString()?`?${_.toString()}`:"";return Bs(`/api/hermes/sessions/conversations/${encodeURIComponent(D)}/messages${k}`)}var tn=q((()=>{Us()})),Qt,Zt,el,tl,ll,sl,al,ol,nl,il,rl,ul,dl,cl,vl,pl,fl,hl,ml,_l,wl,gl,zs,yl=q((()=>{et(),tn(),Fo(),Os(),st(),Qt={class:"conversation-monitor"},Zt={class:"conversation-monitor__sidebar"},el={key:0,class:"conversation-monitor__empty"},tl={key:1,class:"conversation-monitor__empty"},ll=["aria-pressed","onClick"],sl={class:"conversation-monitor__session-title-row"},al={class:"conversation-monitor__session-title"},ol={key:0,class:"conversation-monitor__session-live"},nl={class:"conversation-monitor__session-meta"},il={key:0,class:"conversation-monitor__session-preview"},rl={class:"conversation-monitor__detail"},ul={key:0,class:"conversation-monitor__detail-header"},dl={class:"conversation-monitor__detail-title"},cl={class:"conversation-monitor__detail-meta"},vl=["title"],pl={key:1,class:"conversation-monitor__empty conversation-monitor__empty--error"},fl={key:2,class:"conversation-monitor__empty"},hl={key:3,class:"conversation-monitor__empty"},ml={key:4,class:"conversation-monitor__messages"},_l={class:"conversation-monitor__message-meta"},wl={class:"conversation-monitor__message-content"},gl=15e3,zs=tt({__name:"ConversationMonitorPane",props:{humanOnly:{type:Boolean}},setup(D){const n=D,{t:_}=at(),k=Rs(),C=i([]),y=i(null),p=i(null),o=i(!1),B=i(!1),A=i("");let X=null,z=0,E=0;const F=h(()=>C.value.find(b=>b.id===y.value)||null),te=h(()=>F.value?.model?k.displayModelName(F.value.model,F.value.provider):"");function $(b){return _(b==="user"?"chat.monitorRoleUser":"chat.monitorRoleAssistant")}function S(b){return _("chat.linkedSessions",{count:b})}function L(){z+=1,E+=1}async function Y(b=!1){const w=++z;b||(o.value=!0,A.value="");try{const f=await Zo({humanOnly:n.humanOnly});if(w!==z)return;if(C.value=f,!f.length){y.value=null,p.value=null;return}(!y.value||!f.some(M=>M.id===y.value))&&(y.value=f[0].id)}catch(f){if(w!==z||b)return;A.value=f?.message||String(f),C.value=[],y.value=null,p.value=null}finally{!b&&w===z&&(o.value=!1)}}async function W(b,w=!1){const f=++E;if(!b){p.value=null;return}const M=n.humanOnly;w||(B.value=!0,A.value="");try{const x=await en(b,{humanOnly:M});if(f!==E||b!==y.value||M!==n.humanOnly)return;p.value=x}catch(x){if(f!==E||w)return;A.value=x?.message||String(x),p.value=null}finally{!w&&f===E&&(B.value=!1)}}return xe(y,async b=>{await W(b,!1)}),xe(()=>n.humanOnly,async()=>{L(),y.value=null,p.value=null,await Y(!1)}),lt(async()=>{await Y(!1),X=setInterval(async()=>{await Y(!0),y.value&&await W(y.value,!0)},gl)}),Is(()=>{L(),X&&clearInterval(X)}),(b,w)=>(r(),d("div",Qt,[a("aside",Zt,[o.value&&C.value.length===0?(r(),d("div",el,u(s(_)("common.loading")),1)):C.value.length===0?(r(),d("div",tl,u(s(_)("chat.noSessions")),1)):m("",!0),(r(!0),d(j,null,re(C.value,f=>(r(),d("button",{key:f.id,class:R(["conversation-monitor__session",{active:f.id===y.value}]),"aria-pressed":f.id===y.value,onClick:M=>y.value=f.id},[a("div",sl,[a("span",al,u(f.title||f.preview||f.id),1),f.is_active?(r(),d("span",ol,u(s(_)("chat.recentBadge")),1)):m("",!0)]),a("div",nl,u(s(Yt)(f.source))+" · "+u(s(Xt)(f.last_active)),1),f.preview?(r(),d("div",il,u(f.preview),1)):m("",!0)],10,ll))),128))]),a("section",rl,[F.value?(r(),d("header",ul,[a("div",dl,u(F.value.title||F.value.preview||F.value.id),1),a("div",cl,[a("span",null,u(s(Yt)(F.value.source)),1),w[0]||(w[0]=a("span",null,"·",-1)),a("span",{title:F.value.model},u(te.value),9,vl),w[1]||(w[1]=a("span",null,"·",-1)),a("span",null,u(S(F.value.thread_session_count)),1)])])):m("",!0),A.value?(r(),d("div",pl,u(A.value),1)):B.value&&!p.value?(r(),d("div",fl,u(s(_)("common.loading")),1)):!p.value||p.value.messages.length===0?(r(),d("div",hl,u(s(_)("chat.noVisibleMessages")),1)):(r(),d("div",ml,[(r(!0),d(j,null,re(p.value.messages,f=>(r(),d("article",{key:`${f.session_id}-${f.id}`,class:R(["conversation-monitor__message",`role-${f.role}`])},[a("div",_l,u($(f.role))+" · "+u(s(Xt)(f.timestamp)),1),a("div",wl,u(f.content),1)],2))),128))]))])]))}})})),ln=q((()=>{})),Es,sn=q((()=>{yl(),yl(),ln(),ot(),Es=nt(zs,[["__scopeId","data-v-71fcd8c4"]])})),bl,Sl,kl,Cl,Gs,Ml=q((()=>{et(),mo(),st(),Ds(),Do(),Ro(),Io(),Ko(),No(),_o(),Eo(),Uo(),zo(),bl={class:"files-panel-drawer"},Sl={class:"files-main-panel"},kl={class:"main-toolbar"},Cl={class:"files-content"},Gs=tt({__name:"FilesPanel",setup(D){const n=ho(),{t:_}=at(),k=i(null),C=i(!1),y=i(!1),p=i("newFile"),o=i(null),B=i(null),A=i(!1);function X($,S){k.value?.show($,S)}function z(){p.value="newFile",o.value=null,B.value=null,y.value=!0}function E(){p.value="newFolder",o.value=null,B.value=null,y.value=!0}function F($){p.value="newFolder",o.value=null,B.value=$.isDir?$.path:n.currentPath,y.value=!0}function te($){p.value="rename",o.value=$,B.value=null,y.value=!0}return lt(()=>{n.fetchEntries("",{profile:null})}),($,S)=>(r(),d("div",bl,[A.value?(r(),d("div",{key:0,class:"sidebar-overlay",onClick:S[0]||(S[0]=L=>A.value=!1)})):m("",!0),a("div",{class:R(["files-tree-panel",{"mobile-visible":A.value}])},[c(Bo)],2),a("div",Sl,[a("div",kl,[c(s(T),{size:"small",onClick:S[1]||(S[1]=L=>A.value=!A.value),class:"sidebar-toggle"},{icon:g(()=>[...S[5]||(S[5]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),a("line",{x1:"9",y1:"3",x2:"9",y2:"21"})],-1)])]),default:g(()=>[V(" "+u(s(_)("files.fileTree")),1)]),_:1}),c(To,{onShowNewFile:z,onShowNewFolder:E,onShowUpload:S[2]||(S[2]=L=>C.value=!0)})]),c(Go),a("div",Cl,[s(n).editingFile?(r(),N(wo,{key:0})):s(n).previewFile?(r(),N(Lo,{key:1})):(r(),N(Oo,{key:2,onContextmenuEntry:X}))])]),c(qo,{ref_key:"contextMenuRef",ref:k,onRename:te,onNewFolder:F},null,512),c(Vo,{show:C.value,"onUpdate:show":S[3]||(S[3]=L=>C.value=L)},null,8,["show"]),c(Wo,{show:y.value,"onUpdate:show":S[4]||(S[4]=L=>y.value=L),mode:p.value,entry:o.value,"target-path":B.value},null,8,["show","mode","entry","target-path"])]))}})})),an=q((()=>{})),Vs,on=q((()=>{Ml(),Ml(),an(),ot(),Vs=nt(Gs,[["__scopeId","data-v-4efbc0dc"]])})),xl,Pl,Al,Fl,$l,Ll,Nl,Tl,Il,Dl,Bl,Ul,Ol,Rl,zl,El,Gl,Vl,ql,Wl,Kl,Hl,jl,Xl,Yl,Jl,Ql,Zl,es,ts,ls,ss,as,os,ns,is,rs,us,ds,cs,vs,ps,fs,hs,ms,_s,ws,gs,ys,bs,Ss,ks,Cs,Ms,xs,Ps,As,Fs,$s,Ls,Ns,Qe,Ze,qs,Ts=q((()=>{et(),po(),co(),io(),Os(),no(),yo(),Ds(),eo(),st(),bo(),Co(),So(),sn(),ko(),Po(),Ao(),on(),Ho(),Xo(),Yo(),Us(),xl={class:"chat-panel"},Pl={key:0,class:"page-sidebar-top"},Al={class:"session-list-toolbar"},Fl={class:"session-list-actions"},$l={key:1,class:"session-items"},Ll={key:0,class:"session-loading"},Nl={key:1,class:"session-empty"},Tl={class:"session-group-header session-group-header--static"},Il={class:"session-group-label"},Dl={class:"session-group-count"},Bl={key:2,class:"page-sidebar-bottom"},Ul={class:"session-model-list"},Ol=["onClick"],Rl={class:"session-model-group-label"},zl={class:"session-model-group-count"},El={class:"session-model-group-items"},Gl=["title","onClick"],Vl={class:"session-model-item-label"},ql={class:"session-model-item-name"},Wl={key:0,class:"session-model-item-id"},Kl={key:0,class:"session-model-badge-preview"},Hl={key:1,class:"session-model-badge-disabled"},jl={key:2,class:"session-model-badge-custom"},Xl={key:3,class:"session-model-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},Yl={key:0,class:"session-model-empty"},Jl={class:"session-model-custom"},Ql={class:"session-model-custom-row"},Zl={class:"session-model-custom-hint"},es={class:"new-chat-form"},ts={class:"new-chat-field"},ls={class:"new-chat-label"},ss={key:0,class:"new-chat-field"},as={class:"new-chat-label"},os={class:"new-chat-field"},ns={class:"new-chat-label"},is={key:1,class:"new-chat-field"},rs={class:"new-chat-label"},us={key:2,class:"new-chat-field"},ds={class:"new-chat-label"},cs={key:3,class:"new-chat-field"},vs={class:"new-chat-label"},ps={key:4,class:"new-chat-field"},fs={class:"new-chat-label"},hs={key:5,class:"new-chat-field"},ms={class:"new-chat-label"},_s={class:"new-chat-field"},ws={class:"new-chat-label"},gs={class:"new-chat-actions"},ys={class:"chat-main"},bs={class:"chat-header"},Ss={class:"header-left"},ks={class:"header-session-title"},Cs=["title"],Ms={class:"header-actions"},xs={class:"chat-main-content"},Ps={class:"chat-tool-panel-inner"},As={class:"chat-tool-tabs",role:"tablist"},Fs=["aria-selected"],$s=["aria-selected"],Ls={class:"chat-tool-content"},Ns=360,Qe=560,Ze="hermes.chat.toolPanelWidth",qs=tt({__name:"ChatPanel",setup(D){const n=oo(),_=Rs(),k=ao(),C=go(),y=to(),p=ja(),{t:o}=at(),B=h(()=>lo()),A=i(!1),X=i(null),z=i(null),E=i(null),F=i(0),te=i(!1),$=i(!1),S=i("files"),L=i(js()),Y=i(null),W=i("chat"),b=i(!1),w=i(new Set),f=i(!1),M=i(!1),x=i(typeof window>"u"||!window.matchMedia("(max-width: 768px)").matches);let fe=null;const J=i(!1),Ws=h(()=>({width:J.value?"100%":`${L.value}px`}));function Ee(e){return y.resolve({name:n.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:e}}).href}function Ks(e){typeof window>"u"||window.open(Ee(e),"_blank","noopener,noreferrer")}function Hs(e){X.value?.scrollToAnchor(e.messageId,e.anchorId),J.value&&(A.value=!1)}function js(){if(typeof window>"u")return Qe;const e=Number.parseInt(window.localStorage.getItem(Ze)||"",10);return Number.isFinite(e)?Math.round(e):Qe}function Xs(){if(typeof window>"u")return 1180;if(J.value)return window.innerWidth;const e=E.value?.clientWidth||window.innerWidth;return Math.max(320,Math.min(Math.floor(e*.88),e-120))}function it(e){const t=Xs();return Math.min(t,Math.max(Math.min(Ns,t),Math.round(e)))}function Pe(){J.value||(L.value=it(L.value))}function rt(e){const t=Y.value;if(!t)return;const l=t.x-e.clientX;L.value=it(t.width+l)}function Ge(){Y.value&&(Y.value=null,window.removeEventListener("pointermove",rt),window.removeEventListener("pointerup",Ge),J.value||window.localStorage.setItem(Ze,String(L.value)),document.body.style.userSelect="",document.body.style.cursor="")}function Ys(e){J.value||(e.preventDefault(),Y.value={x:e.clientX,width:L.value},window.addEventListener("pointermove",rt),window.addEventListener("pointerup",Ge),document.body.style.userSelect="none",document.body.style.cursor="col-resize")}function Ae(e){return Array.from(e.dataTransfer?.types||[]).includes("Files")}function ut(){F.value=0,te.value=!1}function Js(e){Ae(e)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"))}function Qs(e){Ae(e)&&(e.preventDefault(),F.value+=1,te.value=!0)}function Zs(e){Ae(e)&&(F.value-=1,F.value<=0&&ut())}function ea(e){if(!Ae(e))return;e.preventDefault();const t=Array.from(e.dataTransfer?.files||[]),l=e.target instanceof Element?e.target:null;ut(),!(!t.length||l?.closest(".chat-input-area"))&&z.value?.addFiles?.(t)}async function dt(e){n.clearSessionCompletedUnread(e),await y.push({name:n.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:e}}),n.activeSessionId!==e&&await n.switchSession(e),fe?.matches&&(x.value=!1)}function Ve(e){J.value=e.matches,e.matches&&x.value&&(x.value=!1)}function ct(){x.value=!0}lt(()=>{fe=window.matchMedia("(max-width: 768px)"),Ve(fe),fe.addEventListener("change",Ve),window.addEventListener("hermes:open-page-sidebar",ct),window.addEventListener("resize",Pe),Pe(),k.profiles.length===0&&k.fetchProfiles()}),Is(()=>{fe?.removeEventListener("change",Ve),window.removeEventListener("hermes:open-page-sidebar",ct),window.removeEventListener("resize",Pe),Ge()}),xe($,async e=>{!e||J.value||(await qt(),Pe())});const Fe=i(!1),le=i(""),he=i(null),vt=i(null),ta=h(()=>n.sessionProfileFilter),la=h(()=>[{label:o("chat.allProfiles"),value:"__all__"},...k.profiles.map(e=>({label:e.name,value:e.name}))]);async function sa(e){n.sessionProfileFilter=e==="__all__"?null:e,await n.loadSessions(n.sessionProfileFilter)}function pt(e){return[...e].sort((t,l)=>{const v=n.isSessionLive(t.id);return v!==n.isSessionLive(l.id)?v?-1:1:(l.updatedAt||0)-(t.updatedAt||0)})}const qe=h(()=>pt(n.sessions.filter(e=>C.isPinned(e.id)))),aa=h(()=>pt(n.sessions.filter(e=>!C.isPinned(e.id))));xe(()=>[n.sessionsLoaded,...n.sessions.map(e=>e.id)],e=>{const t=e.slice(1);!e[0]||t.length===0||C.pruneMissingSessions(t)},{immediate:!0});const oa=h(()=>n.activeSession?.title||o("chat.newChat")),na=h(()=>{const e=n.activeSession;return e?.model?_.displayModelName(e.model,e.provider):o("models.selectModel")}),ia=h(()=>W.value==="live"?o("chat.liveSessions"):oa.value),ue=i(!1),I=i("hermes"),G=i("scoped"),Q=i("default"),K=i(""),se=i(""),ae=i(""),de=i(""),me=i("codex_responses"),$e=i(""),H=i(!1),ra=new Set(["openai-codex","copilot","xai-oauth","nous","google-gemini-cli","claude-oauth"]),ua=h(()=>[{label:"Hermes",value:"hermes"},{label:"Claude Code",value:"claude-code"},{label:"Codex",value:"codex"}]),ft=h(()=>[{label:o("codingAgents.protocolOpenAiChat"),value:"chat_completions"},{label:o("codingAgents.protocolOpenAiResponses"),value:"codex_responses"},{label:o("codingAgents.protocolAnthropicMessages"),value:"anthropic_messages"}]),da=h(()=>[{label:o("codingAgents.launchModeGlobal"),value:"global"},{label:o("codingAgents.launchModeScoped"),value:"scoped"}]);function ht(e){return _.profileModelGroups.find(t=>t.profile===e)?.groups||[]}function mt(e){return ra.has(String(e||"").toLowerCase())}function ca(e){return I.value!=="hermes"&&G.value==="scoped"?!mt(e.provider):!0}function _t(e){return ht(e).filter(ca)}function va(e){const t=_t(e),l=k.activeProfileName||"default",v=_.selectedProvider||"",U=_.selectedModel||"",Z=v?t.find(ie=>ie.provider===v):void 0;if(e===l&&Z?.models.includes(U))return{provider:v,model:U};const O=_.profileModelGroups.find(ie=>ie.profile===e),pe=O?.default_provider||"",Gt=O?.default||"",je=(pe?t.find(ie=>ie.provider===pe):void 0)||t.find(ie=>ie.models.length>0);return{provider:je?.provider||"",model:je?.models.includes(Gt)?Gt:je?.models[0]||""}}const pa=h(()=>(k.profiles.length>0?k.profiles:[{name:"default"}]).map(e=>({label:e.name,value:e.name}))),We=h(()=>_t(Q.value)),fa=h(()=>We.value.map(e=>({label:e.label||e.provider,value:e.provider}))),wt=h(()=>{const e=We.value.find(t=>t.provider===K.value);return(e?.models||[]).map(t=>({label:_.displayModelName(t,e?.provider),value:t}))}),_e=h(()=>We.value.find(e=>e.provider===K.value)),ce=h(()=>I.value!=="hermes"),ha=h(()=>ce.value&&G.value==="global"),Le=h(()=>!ha.value),gt=h(()=>ce.value&&G.value==="scoped"&&!_e.value?.base_url),yt=h(()=>ce.value&&G.value==="scoped"&&!_e.value?.api_key),ma=h(()=>Q.value?Le.value?!K.value||!se.value?!1:ce.value?!(!me.value||gt.value&&!ae.value.trim()||yt.value&&!de.value.trim()):!0:!0:!1);function _a(e){const t=String(e?.provider||K.value||"").toLowerCase(),l=String(e?.base_url||ae.value||"").toLowerCase();return Kt(e?.api_mode,Wt(t,l))}function Ke(){me.value=_a(_e.value)}function He(){const e=va(Q.value);K.value=e.provider,se.value=e.model,ae.value="",de.value="",Ke()}function wa(){if(!Le.value)return;const e=_e.value;if(e&&e.models.includes(se.value)){Ke();return}He()}xe(()=>[I.value,G.value,Q.value],()=>wa());async function bt(){b.value=!1,w.value.clear(),f.value=!1,ue.value=!0,H.value=!0;try{k.profiles.length===0&&await k.fetchProfiles(),_.modelGroups.length===0&&_.profileModelGroups.length===0&&await _.loadModels(),$e.value="",Q.value=k.activeProfileName||k.profiles.find(e=>e.active)?.name||k.profiles[0]?.name||"default",He()}finally{H.value=!1}}function ga(e){Q.value=e,He()}function ya(e){K.value=e,se.value=wt.value[0]?.value||"",ae.value="",de.value="",Ke()}async function ba(){if(I.value!=="hermes"){H.value=!0;try{const Z=I.value,O=(await so()).tools.find(pe=>pe.id===Z);if(!O?.installed){const pe=Z==="codex"?"Codex":"Claude Code";p.warning(o("codingAgents.installRequired",{agent:O?.name||pe})),ue.value=!1,await y.push({name:"hermes.codingAgents"});return}}catch{p.error(o("codingAgents.loadFailed"));return}finally{H.value=!1}}const e=_e.value,t=I.value==="hermes"?"cli":"coding_agent",l=t==="coding_agent"&&G.value==="global",v=I.value==="codex"?"codex":I.value==="claude-code"?"claude":"hermes",U=n.newChat({profile:Q.value,provider:l?void 0:K.value,model:l?void 0:se.value,source:t,agent:v,codingAgentId:I.value==="hermes"?void 0:I.value,codingAgentMode:t==="coding_agent"?G.value:void 0,workspace:$e.value||null,baseUrl:t==="coding_agent"&&!l&&(e?.base_url||ae.value.trim())||void 0,apiKey:t==="coding_agent"&&!l&&(e?.api_key||de.value.trim())||void 0,apiMode:t==="coding_agent"&&!l?me.value:void 0});await y.push({name:n.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:U.id}}),ue.value=!1}function Sa(e){return n.sessions.find(t=>t.id===e)?.profile||null}function ka(e,t){const l=y.resolve({name:n.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:e},query:t?{profile:t}:void 0}).href;return`${window.location.origin}${window.location.pathname}${l}`}async function Ca(e){const t=e||n.activeSessionId;t&&(await Ht(ka(t,Sa(t)))?p.success(o("common.copied")):p.error(o("common.copied")+" ✗"))}async function St(e){const t=e||n.activeSessionId;t&&(await Ht(t)?p.success(o("common.copied")):p.error(o("common.copied")+" ✗"))}async function kt(e){if(!await n.deleteSession(e)){p.error(o("common.deleteFailed"));return}C.removePinned(e),p.success(o("chat.sessionDeleted"))}function Ct(){M.value||(b.value=!b.value,b.value||(w.value.clear(),f.value=!1))}function we(e){return`${e.profile||"default"}\0${e.id}`}function Mt(e){if(M.value)return;const t=we(e);w.value.has(t)?w.value.delete(t):w.value.add(t),w.value=new Set(w.value),w.value.size===0&&(f.value=!1)}function xt(e){return w.value.has(we(e))}async function Ma(){if(w.value.size===0||M.value)return;const e=new Map(n.sessions.map(l=>[we(l),l])),t=Array.from(w.value).map(l=>e.get(l)).filter(l=>!!l).map(l=>({id:l.id,profile:l.profile||null}));if(t.length!==0){M.value=!0;try{const l=await uo(t);if(l.deleted>0){for(const v of t)C.removePinned(v.id);await n.loadSessions(n.sessionProfileFilter),p.success(o("chat.batchDeleteSuccess",{count:l.deleted})),l.failed>0&&p.warning(o("chat.batchDeletePartial",{failed:l.failed}))}else p.error(o("chat.batchDeleteFailed"))}catch{p.error(o("chat.batchDeleteFailed"))}finally{M.value=!1,f.value=!1,b.value=!1,w.value.clear()}}}function xa(){return Ma(),!1}function Pa(){if(!M.value){w.value.clear();for(const e of n.sessions)e.id!==n.activeSessionId&&w.value.add(we(e));w.value=new Set(w.value)}}const Pt=h(()=>w.value.size),Aa=h(()=>n.sessions.some(e=>e.id!==n.activeSessionId)),P=i(null),Fa=h(()=>P.value?C.isPinned(P.value):!1),Ne=h(()=>P.value&&n.sessions.find(e=>e.id===P.value)||null),$a=h(()=>{const e=[{label:o(Fa.value?"chat.unpin":"chat.pin"),key:"pin"},{label:o("chat.rename"),key:"rename"}];return Ne.value?.source!=="global_agent"&&e.push({label:o("chat.archiveSession"),key:"archive"}),e.push({label:o("chat.setWorkspace"),key:"workspace"}),(Ne.value?.source==="cli"||Ne.value?.source==="coding_agent")&&e.push({label:o("chat.setModel"),key:"model"}),e.push({label:o("chat.export"),key:"export",children:[{label:o("chat.exportFull"),key:"export-full",children:[{label:"JSON",key:"export-full-json"},{label:"TXT",key:"export-full-txt"}]},{label:o("chat.exportCompressed"),key:"export-compressed",children:[{label:"JSON",key:"export-compressed-json"},{label:"TXT",key:"export-compressed-txt"}]}]}),e.push({label:o("chat.openSessionInNewTab"),key:"open-link"}),e.push({label:o("chat.copySessionLink"),key:"copy-link"}),e.push({label:o("chat.copySessionId"),key:"copy-id"}),e});function La(){y.push({name:"hermes.settings"})}function At(e,t){e.preventDefault(),P.value=t,Te.value=!0,Ft.value=e.clientX,$t.value=e.clientY}const Te=i(!1),Ft=i(0),$t=i(0);function Lt(e){return e==="export-full-json"?{mode:"full",ext:"json"}:e==="export-full-txt"?{mode:"full",ext:"txt"}:e==="export-compressed-json"?{mode:"compressed",ext:"json"}:e==="export-compressed-txt"?{mode:"compressed",ext:"txt"}:null}async function Na(e){if(Te.value=!1,!!P.value){if(e==="pin"){C.togglePinned(P.value);return}if(e==="copy-link")Ca(P.value);else if(e==="copy-id")St(P.value);else if(e==="open-link")Ks(P.value);else if(e==="archive"){const t=Ne.value;await n.archiveSession(P.value)?(C.removePinned(P.value),t&&(w.value.delete(we(t)),w.value=new Set(w.value)),p.success(o("chat.sessionArchived"))):p.error(o("chat.archiveSessionFailed"))}else if(Lt(e)){const{mode:t,ext:l}=Lt(e),v=t==="compressed"?p.loading(o("chat.exportCompressing"),{duration:0}):null;try{await vo(P.value,t,l),v?.destroy(),p.success(o("chat.exportSuccess"))}catch{v?.destroy(),p.error(o("chat.exportFailed"))}}else if(e==="workspace"){const t=n.sessions.find(l=>l.id===P.value);ve.value=P.value,oe.value=t?.workspace||"",ge.value=!0}else if(e==="model")await Ot(P.value);else if(e==="rename"){const t=n.sessions.find(l=>l.id===P.value);he.value=P.value,le.value=t?.title||"",Fe.value=!0,qt(()=>{vt.value?.focus()})}}}function Ta(){Te.value=!1}async function Nt(){if(!(!he.value||!le.value.trim())){if(await ro(he.value,le.value.trim())){const e=n.sessions.find(t=>t.id===he.value);e&&(e.title=le.value.trim()),n.activeSession?.id===he.value&&(n.activeSession.title=le.value.trim()),p.success(o("chat.renamed"))}else p.error(o("chat.renameFailed"));Fe.value=!1}}const ge=i(!1),oe=i(""),ve=i(null);function Ia(){const e=n.activeSession;e?.id&&(ve.value=e.id,oe.value=e.workspace||"",ge.value=!0)}async function Da(){if(ve.value){if(await fo(ve.value,oe.value||null)){const e=n.sessions.find(t=>t.id===ve.value);e&&(e.workspace=oe.value||null),n.activeSession?.id===ve.value&&(n.activeSession.workspace=oe.value||null),p.success(o("chat.workspaceSet"))}else p.error(o("chat.workspaceSetFailed"));ge.value=!1}}const Ie=i(!1),ye=i(!1),ne=i(null),be=i(""),De=i({}),Be=i(""),Se=i(""),Ue=i(""),Oe=i(""),ke=i("codex_responses"),Re=i(null),Tt=h(()=>n.sessions.find(e=>e.id===ne.value)?.profile||null),It=h(()=>n.sessions.find(e=>e.id===ne.value)||(n.activeSession?.id===ne.value?n.activeSession:void 0)),Dt=h(()=>It.value?.source==="coding_agent"&&It.value?.codingAgentMode!=="global"),Ce=h(()=>Tt.value?ht(Tt.value).filter(e=>!Dt.value||!mt(e.provider)):[]),Ba=h(()=>Ce.value.map(e=>({label:e.label,value:e.provider}))),Bt=h(()=>Ce.value.map(e=>({...e,models:[...e.models,...(_.customModels[e.provider]||[]).filter(t=>!e.models.includes(t))]}))),Ut=h(()=>{const e=be.value.trim().toLowerCase();return e?Bt.value.map(t=>({...t,models:t.models.filter(l=>{const v=_.displayModelName(l,t.provider);return l.toLowerCase().includes(e)||v.toLowerCase().includes(e)})})).filter(t=>t.models.length>0||t.label.toLowerCase().includes(e)):Bt.value});async function Ot(e){_.modelGroups.length===0&&_.profileModelGroups.length===0&&await _.loadModels();const t=n.sessions.find(O=>O.id===e)||(n.activeSession?.id===e?n.activeSession:void 0);ne.value=e;const l=Ce.value,v=t?.provider?l.find(O=>O.provider===t.provider):void 0,U=v||l.find(O=>O.models.length>0),Z={provider:U?.provider||"",model:U?.models.includes(t?.model||"")?t?.model||"":U?.models[0]||""};Be.value=v?t?.model||Z.model||"":Z.model||"",Se.value=v?t?.provider||"":Z.provider||"",Oe.value=Se.value,be.value="",Ue.value="",De.value={},Ie.value=!0}function Ua(){const e=n.activeSession?.id;if(!e){bt();return}Ot(e)}function Rt(e){return!!De.value[e]}function Oa(e){De.value[e]=!De.value[e]}function Ra(e,t){return(_.customModels[t]||[]).includes(e)}function za(e,t){return _.displayModelName(e,t)}function Ea(e,t){return _.getModelAlias(e,t)}function Ga(e){const t=Ce.value.find(U=>U.provider===e),l=String(t?.provider||e||"").toLowerCase(),v=String(t?.base_url||"").toLowerCase();return Kt(t?.api_mode,Wt(l,v))}async function zt(e,t,l){ne.value&&(await n.switchSessionModel(e,t,ne.value,l)?(Be.value=e,Se.value=t,l&&(ke.value=l),Re.value=null,ye.value=!1,Ie.value=!1,p.success(o("chat.modelSet"))):p.error(o("chat.modelSetFailed")))}async function Et(e,t){if(!(Ce.value.find(l=>l.provider===t)?.model_meta?.[e]?.disabled||!ne.value)){if(Dt.value){Re.value={model:e,provider:t},ke.value=Ga(t),ye.value=!0;return}await zt(e,t)}}async function Va(){const e=Re.value;e&&await zt(e.model,e.provider,ke.value)}function qa(){Re.value=null,ye.value=!1}async function Wa(){const e=Ue.value.trim(),t=Oe.value;!e||!t||await Et(e,t)}return(e,t)=>(r(),d("div",xl,[W.value==="chat"?(r(),d("div",{key:0,class:R(["session-backdrop",{active:x.value}]),onClick:t[0]||(t[0]=l=>x.value=!1)},null,2)):m("",!0),W.value==="chat"?(r(),d("aside",{key:1,class:R(["session-list",{collapsed:!x.value}])},[x.value?(r(),d("div",Pl,[c(Jo,{active:s(n).runtimeMode==="global_agent"?"global":"chat","primary-label":s(o)("chat.newChat"),onPrimary:bt},null,8,["active","primary-label"]),a("div",Al,[c(s(ee),{class:"session-profile-filter",value:ta.value||"__all__",options:la.value,size:"small",loading:s(k).loading,"onUpdate:value":sa},null,8,["value","options","loading"]),a("div",Fl,[a("button",{class:"session-close-btn",onClick:t[1]||(t[1]=l=>x.value=!1)},[...t[28]||(t[28]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),b.value?m("",!0):(r(),N(s(T),{key:0,quaternary:"",size:"tiny",onClick:Ct,title:s(o)("chat.toggleBatchMode")},{icon:g(()=>[...t[29]||(t[29]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("path",{d:"M9 11l3 3L22 4"}),a("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["title"])),b.value?(r(),N(s(T),{key:1,quaternary:"",size:"tiny",onClick:Pa,disabled:!Aa.value||M.value,title:s(o)("chat.selectAll")},{icon:g(()=>[...t[30]||(t[30]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("path",{d:"M9 11l3 3L22 4"}),a("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["disabled","title"])):m("",!0),b.value&&Pt.value>0?(r(),N(s(Za),{key:2,show:f.value,"onUpdate:show":t[2]||(t[2]=l=>f.value=l),"positive-button-props":{loading:M.value,disabled:M.value},"negative-button-props":{disabled:M.value},onPositiveClick:xa},{trigger:g(()=>[c(s(T),{quaternary:"",size:"tiny",type:"error",loading:M.value,disabled:M.value},{icon:g(()=>[...t[31]||(t[31]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("polyline",{points:"3 6 5 6 21 6"}),a("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])]),_:1},8,["loading","disabled"])]),default:g(()=>[V(" "+u(s(o)("chat.confirmBatchDelete",{count:Pt.value})),1)]),_:1},8,["show","positive-button-props","negative-button-props"])):m("",!0),b.value?(r(),N(s(T),{key:3,quaternary:"",size:"tiny",onClick:Ct,disabled:M.value},{icon:g(()=>[...t[32]||(t[32]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),_:1},8,["disabled"])):m("",!0)])])])):m("",!0),x.value?(r(),d("div",$l,[s(n).isLoadingSessions&&s(n).sessions.length===0?(r(),d("div",Ll,u(s(o)("common.loading")),1)):s(n).sessions.length===0?(r(),d("div",Nl,u(s(o)("chat.noSessions")),1)):m("",!0),qe.value.length>0?(r(),d(j,{key:2},[a("div",Tl,[a("span",Il,u(s(o)("chat.pinned")),1),a("span",Dl,u(qe.value.length),1)]),(r(!0),d(j,null,re(qe.value,l=>(r(),N(Jt,{key:`pinned-${l.id}`,session:l,active:l.id===s(n).activeSessionId,pinned:!0,"can-delete":l.id!==s(n).activeSessionId||s(n).sessions.length>1,streaming:s(n).isSessionLive(l.id),"completed-unread":s(n).isSessionCompletedUnread(l.id),selectable:b.value,selected:xt(l),"show-profile":!0,to:Ee(l.id),onSelect:v=>dt(l.id),onContextmenu:v=>At(v,l.id),onDelete:v=>kt(l.id),onToggleSelect:v=>Mt(l)},null,8,["session","active","can-delete","streaming","completed-unread","selectable","selected","to","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))],64)):m("",!0),(r(!0),d(j,null,re(aa.value,l=>(r(),N(Jt,{key:l.id,session:l,active:l.id===s(n).activeSessionId,pinned:!1,"can-delete":l.id!==s(n).activeSessionId||s(n).sessions.length>1,streaming:s(n).isSessionLive(l.id),"completed-unread":s(n).isSessionCompletedUnread(l.id),selectable:b.value,selected:xt(l),"show-profile":!0,to:Ee(l.id),onSelect:v=>dt(l.id),onContextmenu:v=>At(v,l.id),onDelete:v=>kt(l.id),onToggleSelect:v=>Mt(l)},null,8,["session","active","can-delete","streaming","completed-unread","selectable","selected","to","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))])):m("",!0),x.value?(r(),d("div",Bl,[a("button",{class:"page-sidebar-menu-btn",type:"button",onClick:La},[t[33]||(t[33]=a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[a("circle",{cx:"12",cy:"12",r:"3"}),a("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)),a("span",null,u(s(o)("sidebar.settings")),1)]),c(Qo)])):m("",!0)],2)):m("",!0),c(s(Ja),{placement:"bottom-start",trigger:"manual",x:Ft.value,y:$t.value,options:$a.value,show:Te.value,onSelect:Na,onClickoutside:Ta},null,8,["x","y","options","show"]),c(s(ze),{show:Fe.value,"onUpdate:show":t[4]||(t[4]=l=>Fe.value=l),preset:"dialog",title:s(o)("chat.renameSession"),"positive-text":s(o)("common.ok"),"negative-text":s(o)("common.cancel"),onPositiveClick:Nt},{default:g(()=>[c(s(Me),{ref_key:"renameInputRef",ref:vt,value:le.value,"onUpdate:value":t[3]||(t[3]=l=>le.value=l),placeholder:s(o)("chat.enterNewTitle"),onKeydown:Vt(Nt,["enter"])},null,8,["value","placeholder"])]),_:1},8,["show","title","positive-text","negative-text"]),c(s(ze),{show:ge.value,"onUpdate:show":t[6]||(t[6]=l=>ge.value=l),preset:"dialog",title:s(o)("chat.setWorkspaceTitle"),"positive-text":s(o)("common.ok"),"negative-text":s(o)("common.cancel"),style:{width:"520px"},onPositiveClick:Da},{default:g(()=>[c(jt,{modelValue:oe.value,"onUpdate:modelValue":t[5]||(t[5]=l=>oe.value=l)},null,8,["modelValue"])]),_:1},8,["show","title","positive-text","negative-text"]),c(s(ze),{show:Ie.value,"onUpdate:show":t[10]||(t[10]=l=>Ie.value=l),preset:"card",title:s(o)("chat.setModelTitle"),style:{width:"min(480px, calc(100vw - 32px))"},"mask-closable":!0},{default:g(()=>[c(s(Me),{value:be.value,"onUpdate:value":t[7]||(t[7]=l=>be.value=l),placeholder:s(o)("models.searchPlaceholder"),clearable:"",size:"small",class:"session-model-search"},null,8,["value","placeholder"]),a("div",Ul,[(r(!0),d(j,null,re(Ut.value,l=>(r(),d("div",{key:l.provider,class:"session-model-group"},[a("div",{class:"session-model-group-header",onClick:v=>Oa(l.provider)},[(r(),d("svg",{class:R(["session-model-group-arrow",{collapsed:Rt(l.provider)}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...t[34]||(t[34]=[a("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),a("span",Rl,u(l.label),1),a("span",zl,u(l.models.length),1)],8,Ol),Ye(a("div",El,[(r(!0),d(j,null,re(l.models,v=>(r(),d("div",{key:v,class:R(["session-model-item",{active:v===Be.value&&l.provider===Se.value,disabled:!!l.model_meta?.[v]?.disabled}]),title:l.model_meta?.[v]?.disabled?s(o)("models.disabledTooltip"):"",onClick:U=>Et(v,l.provider)},[a("span",Vl,[a("span",ql,u(za(v,l.provider)),1),Ea(v,l.provider)?(r(),d("span",Wl,u(s(o)("models.aliasCanonical",{model:v})),1)):m("",!0)]),l.model_meta?.[v]?.preview?(r(),d("span",Kl,u(s(o)("models.previewBadge")),1)):m("",!0),l.model_meta?.[v]?.disabled?(r(),d("span",Hl,u(s(o)("models.disabledBadge")),1)):m("",!0),Ra(v,l.provider)?(r(),d("span",jl,u(s(o)("models.customBadge")),1)):m("",!0),v===Be.value&&l.provider===Se.value?(r(),d("svg",Xl,[...t[35]||(t[35]=[a("polyline",{points:"20 6 9 17 4 12"},null,-1)])])):m("",!0)],10,Gl))),128))],512),[[Xe,!Rt(l.provider)]])]))),128)),Ut.value.length===0?(r(),d("div",Yl,u(be.value?"No results":"No models"),1)):m("",!0),a("div",Jl,[a("div",Ql,[c(s(ee),{value:Oe.value,"onUpdate:value":t[8]||(t[8]=l=>Oe.value=l),options:Ba.value,size:"small",class:"session-model-custom-provider"},null,8,["value","options"]),c(s(Me),{value:Ue.value,"onUpdate:value":t[9]||(t[9]=l=>Ue.value=l),placeholder:s(o)("models.customModelPlaceholder"),size:"small",class:"session-model-custom-input",onKeydown:Vt(Wa,["enter"])},null,8,["value","placeholder"])]),a("div",Zl,u(s(o)("models.customModelHint")),1)])])]),_:1},8,["show","title"]),c(s(ze),{show:ye.value,"onUpdate:show":t[12]||(t[12]=l=>ye.value=l),preset:"dialog",title:s(o)("codingAgents.protocolScope"),"mask-closable":!0,style:{width:"min(420px, calc(100vw - 32px))"}},{action:g(()=>[c(s(T),{size:"small",onClick:qa},{default:g(()=>[V(u(s(o)("common.cancel")),1)]),_:1}),c(s(T),{size:"small",type:"primary",onClick:Va},{default:g(()=>[V(u(s(o)("common.confirm")),1)]),_:1})]),default:g(()=>[c(s(ee),{value:ke.value,"onUpdate:value":t[11]||(t[11]=l=>ke.value=l),options:ft.value},null,8,["value","options"])]),_:1},8,["show","title"]),c(s(Ka),{show:ue.value,"onUpdate:show":t[21]||(t[21]=l=>ue.value=l),class:"new-chat-drawer",placement:"right",width:"min(440px, 100vw)","mask-closable":!0},{default:g(()=>[c(s(Ha),{title:s(o)("chat.newChat"),closable:""},{footer:g(()=>[a("div",gs,[c(s(T),{onClick:t[20]||(t[20]=l=>ue.value=!1)},{default:g(()=>[V(u(s(o)("common.cancel")),1)]),_:1}),c(s(T),{type:"primary",disabled:!ma.value,onClick:ba},{default:g(()=>[V(u(s(o)("common.create")),1)]),_:1},8,["disabled"])])]),default:g(()=>[a("div",es,[a("label",ts,[a("span",ls,u(s(o)("chat.agent")),1),c(s(ee),{value:I.value,"onUpdate:value":t[13]||(t[13]=l=>I.value=l),options:ua.value,disabled:H.value},null,8,["value","options","disabled"])]),ce.value?(r(),d("label",ss,[a("span",as,u(s(o)("codingAgents.launchModeScope")),1),c(s(Xa),{value:G.value,"onUpdate:value":t[14]||(t[14]=l=>G.value=l),name:"new-chat-coding-agent-mode"},{default:g(()=>[(r(!0),d(j,null,re(da.value,l=>(r(),N(s(Qa),{key:l.value,value:l.value},{default:g(()=>[V(u(l.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])):m("",!0),a("label",os,[a("span",ns,u(s(o)("sidebar.profiles")),1),c(s(ee),{value:Q.value,options:pa.value,loading:H.value||s(k).loading,"onUpdate:value":ga},null,8,["value","options","loading"])]),Le.value?(r(),d("label",is,[a("span",rs,u(s(o)("models.provider")),1),c(s(ee),{value:K.value,options:fa.value,disabled:H.value,"onUpdate:value":ya},null,8,["value","options","disabled"])])):m("",!0),Le.value?(r(),d("label",us,[a("span",ds,u(s(o)("models.models")),1),c(s(ee),{value:se.value,"onUpdate:value":t[15]||(t[15]=l=>se.value=l),options:wt.value,disabled:H.value||!K.value,filterable:""},null,8,["value","options","disabled"])])):m("",!0),ce.value&&G.value==="scoped"?(r(),d("label",cs,[a("span",vs,u(s(o)("codingAgents.protocolScope")),1),c(s(ee),{value:me.value,"onUpdate:value":t[16]||(t[16]=l=>me.value=l),options:ft.value,disabled:H.value},null,8,["value","options","disabled"])])):m("",!0),gt.value?(r(),d("label",ps,[a("span",fs,u(s(o)("models.baseUrl")),1),c(s(Me),{value:ae.value,"onUpdate:value":t[17]||(t[17]=l=>ae.value=l),placeholder:s(o)("models.baseUrlPlaceholder")},null,8,["value","placeholder"])])):m("",!0),yt.value?(r(),d("label",hs,[a("span",ms,u(s(o)("models.apiKey")),1),c(s(Me),{value:de.value,"onUpdate:value":t[18]||(t[18]=l=>de.value=l),type:"password","show-password-on":"click",placeholder:s(o)("models.apiKeyPlaceholder")},null,8,["value","placeholder"])])):m("",!0),a("div",_s,[a("span",ws,u(s(o)("chat.workspace")),1),c(jt,{modelValue:$e.value,"onUpdate:modelValue":t[19]||(t[19]=l=>$e.value=l)},null,8,["modelValue"])])])]),_:1},8,["title"])]),_:1},8,["show"]),a("div",ys,[a("header",bs,[a("div",Ss,[W.value==="chat"?(r(),N(s(T),{key:0,class:"header-sidebar-toggle",quaternary:"",size:"small",onClick:t[22]||(t[22]=l=>x.value=!x.value),circle:""},{icon:g(()=>[...t[36]||(t[36]=[a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a("rect",{x:"3",y:"3",width:"7",height:"7"}),a("rect",{x:"14",y:"3",width:"7",height:"7"}),a("rect",{x:"3",y:"14",width:"7",height:"7"}),a("rect",{x:"14",y:"14",width:"7",height:"7"})],-1)])]),_:1})):m("",!0),a("span",ks,u(ia.value),1),s(n).activeSession?.workspace?(r(),d("button",{key:1,class:"workspace-badge",type:"button",title:s(n).activeSession.workspace,onClick:Ia},[t[37]||(t[37]=a("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[a("path",{d:"M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"})],-1)),a("span",null,u(s(n).activeSession.workspace.split("/").pop()||s(n).activeSession.workspace),1)],8,Cs)):m("",!0)]),a("div",Ms,[W.value==="chat"?(r(),d(j,{key:0},[B.value?(r(),N(s(Je),{key:0,trigger:"hover"},{trigger:g(()=>[c(s(T),{class:R(["header-tool-toggle",{active:$.value}]),quaternary:"",size:"small",onClick:t[23]||(t[23]=l=>$.value=!$.value),circle:""},{icon:g(()=>[...t[38]||(t[38]=[a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),a("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),a("line",{x1:"15",y1:"3",x2:"15",y2:"21"})],-1)])]),_:1},8,["class"])]),default:g(()=>[V(" "+u(s(o)("drawer.files"))+" / "+u(s(o)("drawer.terminal")),1)]),_:1})):m("",!0),c(s(Je),{trigger:"hover"},{trigger:g(()=>[c(s(T),{quaternary:"",size:"small",onClick:t[24]||(t[24]=l=>A.value=!A.value),circle:""},{icon:g(()=>[...t[39]||(t[39]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a("path",{d:"M3 12h18M3 6h18M3 18h18"})],-1)])]),_:1})]),default:g(()=>[V(" "+u(s(o)("chat.outlineTitle")),1)]),_:1}),c(s(Je),{trigger:"hover"},{trigger:g(()=>[c(s(T),{quaternary:"",size:"small",onClick:t[25]||(t[25]=l=>St()),circle:""},{icon:g(()=>[...t[40]||(t[40]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)])]),_:1})]),default:g(()=>[V(" "+u(s(o)("chat.copySessionId")),1)]),_:1})],64)):m("",!0)])]),W.value==="chat"?(r(),d("div",{key:0,ref_key:"chatContentWrapperRef",ref:E,class:R(["chat-content-wrapper",{"chat-content-wrapper--drop-active":te.value}]),onDragover:Js,onDragenter:Qs,onDragleave:Zs,onDrop:ea},[a("div",xs,[c(xo,{ref_key:"messageListRef",ref:X},null,512),c(Mo,{ref_key:"chatInputRef",ref:z,"model-label":na.value,onModelClick:Ua},null,8,["model-label"])]),A.value?(r(),N($o,{key:0,messages:s(n).messages,onNavigate:Hs},null,8,["messages"])):m("",!0),$.value?(r(),d("aside",{key:1,class:"chat-tool-panel",style:Ya(Ws.value)},[a("div",{class:"chat-tool-resize-handle",onPointerdown:Ys},null,32),a("div",Ps,[a("div",As,[a("button",{class:R(["chat-tool-tab",{active:S.value==="files"}]),type:"button",role:"tab","aria-selected":S.value==="files",onClick:t[26]||(t[26]=l=>S.value="files")},u(s(o)("drawer.files")),11,Fs),a("button",{class:R(["chat-tool-tab",{active:S.value==="terminal"}]),type:"button",role:"tab","aria-selected":S.value==="terminal",onClick:t[27]||(t[27]=l=>S.value="terminal")},u(s(o)("drawer.terminal")),11,$s)]),a("div",Ls,[Ye(c(Vs,null,null,512),[[Xe,S.value==="files"]]),Ye(c(jo,{visible:$.value&&S.value==="terminal"},null,8,["visible"]),[[Xe,S.value==="terminal"]])])])],4)):m("",!0)],34)):(r(),N(Es,{key:1,"human-only":s(C).humanOnly},null,8,["human-only"]))])]))}})})),nn=q((()=>{})),rn,Rn=q((()=>{Ts(),Ts(),nn(),ot(),rn=nt(qs,[["__scopeId","data-v-bc14664f"]])}));export{Rn as n,rn as t};
1
+ import{n as q}from"./rolldown-runtime-M0oDzQ_3.js";import{$t as Vt,An as Is,Bn as xe,Hn as g,I as Ka,It as Me,K as ze,Kt as et,Nn as re,Ot as T,P as Ha,Qt as Xe,Un as Ye,V as ja,an as a,cn as d,cr as s,ct as Xa,er as i,fn as V,fr as Ya,hn as tt,in as h,jn as r,kn as lt,mt as ee,nt as Ja,on as N,ot as Je,pn as c,pr as u,sn as m,t as Ds,tn as j,ur as R,ut as Qa,w as Za,wn as qt}from"./ui-vendor-DDMfmCj2.js";import{M as eo,O as st,P as to,k as at}from"./vue-vendor-BsMpqyaC.js";import{d as lo,f as Bs,n as ot,t as nt,u as Us}from"./_plugin-vue_export-helper-CvnFozKy.js";import{$ as so,Dt as ao,E as oo,Et as no,Ot as Os,T as io,bt as ro,ct as uo,et as Wt,it as Kt,kt as Rs,tt as co,ut as vo,vt as po,xt as fo}from"./index-B2IKGvbR.js";import{i as ho,t as mo}from"./files-CBYc0MSs.js";import{r as _o,t as wo}from"./FileEditor-CzWdryd5.js";import{n as go,t as yo}from"./session-browser-prefs-BYjSnxJq.js";import{n as bo,t as Ht}from"./clipboard-1NPxC3YL.js";import{a as jt,i as So,n as ko,o as Co,r as Mo,t as xo}from"./MessageList-Ds_mjMbf.js";import{a as Xt,i as Po,n as Ao,o as Yt,r as Jt,s as Fo,t as $o}from"./OutlinePanel-CYuSrNX9.js";import{a as Lo,c as No,d as To,f as Io,g as Do,h as Bo,i as Uo,l as Oo,m as Ro,n as zo,o as Eo,p as Go,r as Vo,s as qo,t as Wo,u as Ko}from"./FileRenameModal-C2YmHkSN.js";import{n as Ho,t as jo}from"./TerminalPanel-gyT2AS7Z.js";import{i as Xo,n as Yo,r as Jo,t as Qo}from"./SettingsCircuitBadge-Eiv8LQz0.js";async function Zo(D={}){const n=new URLSearchParams;return D.humanOnly===!1&&n.set("humanOnly","false"),D.source&&n.set("source",D.source),D.limit!=null&&n.set("limit",String(D.limit)),(await Bs(`/api/hermes/sessions/conversations${n.toString()?`?${n.toString()}`:""}`)).sessions}async function en(D,n={}){const _=new URLSearchParams;n.humanOnly===!1&&_.set("humanOnly","false"),n.source&&_.set("source",n.source);const k=_.toString()?`?${_.toString()}`:"";return Bs(`/api/hermes/sessions/conversations/${encodeURIComponent(D)}/messages${k}`)}var tn=q((()=>{Us()})),Qt,Zt,el,tl,ll,sl,al,ol,nl,il,rl,ul,dl,cl,vl,pl,fl,hl,ml,_l,wl,gl,zs,yl=q((()=>{et(),tn(),Fo(),Os(),st(),Qt={class:"conversation-monitor"},Zt={class:"conversation-monitor__sidebar"},el={key:0,class:"conversation-monitor__empty"},tl={key:1,class:"conversation-monitor__empty"},ll=["aria-pressed","onClick"],sl={class:"conversation-monitor__session-title-row"},al={class:"conversation-monitor__session-title"},ol={key:0,class:"conversation-monitor__session-live"},nl={class:"conversation-monitor__session-meta"},il={key:0,class:"conversation-monitor__session-preview"},rl={class:"conversation-monitor__detail"},ul={key:0,class:"conversation-monitor__detail-header"},dl={class:"conversation-monitor__detail-title"},cl={class:"conversation-monitor__detail-meta"},vl=["title"],pl={key:1,class:"conversation-monitor__empty conversation-monitor__empty--error"},fl={key:2,class:"conversation-monitor__empty"},hl={key:3,class:"conversation-monitor__empty"},ml={key:4,class:"conversation-monitor__messages"},_l={class:"conversation-monitor__message-meta"},wl={class:"conversation-monitor__message-content"},gl=15e3,zs=tt({__name:"ConversationMonitorPane",props:{humanOnly:{type:Boolean}},setup(D){const n=D,{t:_}=at(),k=Rs(),C=i([]),y=i(null),p=i(null),o=i(!1),B=i(!1),A=i("");let X=null,z=0,E=0;const F=h(()=>C.value.find(b=>b.id===y.value)||null),te=h(()=>F.value?.model?k.displayModelName(F.value.model,F.value.provider):"");function $(b){return _(b==="user"?"chat.monitorRoleUser":"chat.monitorRoleAssistant")}function S(b){return _("chat.linkedSessions",{count:b})}function L(){z+=1,E+=1}async function Y(b=!1){const w=++z;b||(o.value=!0,A.value="");try{const f=await Zo({humanOnly:n.humanOnly});if(w!==z)return;if(C.value=f,!f.length){y.value=null,p.value=null;return}(!y.value||!f.some(M=>M.id===y.value))&&(y.value=f[0].id)}catch(f){if(w!==z||b)return;A.value=f?.message||String(f),C.value=[],y.value=null,p.value=null}finally{!b&&w===z&&(o.value=!1)}}async function W(b,w=!1){const f=++E;if(!b){p.value=null;return}const M=n.humanOnly;w||(B.value=!0,A.value="");try{const x=await en(b,{humanOnly:M});if(f!==E||b!==y.value||M!==n.humanOnly)return;p.value=x}catch(x){if(f!==E||w)return;A.value=x?.message||String(x),p.value=null}finally{!w&&f===E&&(B.value=!1)}}return xe(y,async b=>{await W(b,!1)}),xe(()=>n.humanOnly,async()=>{L(),y.value=null,p.value=null,await Y(!1)}),lt(async()=>{await Y(!1),X=setInterval(async()=>{await Y(!0),y.value&&await W(y.value,!0)},gl)}),Is(()=>{L(),X&&clearInterval(X)}),(b,w)=>(r(),d("div",Qt,[a("aside",Zt,[o.value&&C.value.length===0?(r(),d("div",el,u(s(_)("common.loading")),1)):C.value.length===0?(r(),d("div",tl,u(s(_)("chat.noSessions")),1)):m("",!0),(r(!0),d(j,null,re(C.value,f=>(r(),d("button",{key:f.id,class:R(["conversation-monitor__session",{active:f.id===y.value}]),"aria-pressed":f.id===y.value,onClick:M=>y.value=f.id},[a("div",sl,[a("span",al,u(f.title||f.preview||f.id),1),f.is_active?(r(),d("span",ol,u(s(_)("chat.recentBadge")),1)):m("",!0)]),a("div",nl,u(s(Yt)(f.source))+" · "+u(s(Xt)(f.last_active)),1),f.preview?(r(),d("div",il,u(f.preview),1)):m("",!0)],10,ll))),128))]),a("section",rl,[F.value?(r(),d("header",ul,[a("div",dl,u(F.value.title||F.value.preview||F.value.id),1),a("div",cl,[a("span",null,u(s(Yt)(F.value.source)),1),w[0]||(w[0]=a("span",null,"·",-1)),a("span",{title:F.value.model},u(te.value),9,vl),w[1]||(w[1]=a("span",null,"·",-1)),a("span",null,u(S(F.value.thread_session_count)),1)])])):m("",!0),A.value?(r(),d("div",pl,u(A.value),1)):B.value&&!p.value?(r(),d("div",fl,u(s(_)("common.loading")),1)):!p.value||p.value.messages.length===0?(r(),d("div",hl,u(s(_)("chat.noVisibleMessages")),1)):(r(),d("div",ml,[(r(!0),d(j,null,re(p.value.messages,f=>(r(),d("article",{key:`${f.session_id}-${f.id}`,class:R(["conversation-monitor__message",`role-${f.role}`])},[a("div",_l,u($(f.role))+" · "+u(s(Xt)(f.timestamp)),1),a("div",wl,u(f.content),1)],2))),128))]))])]))}})})),ln=q((()=>{})),Es,sn=q((()=>{yl(),yl(),ln(),ot(),Es=nt(zs,[["__scopeId","data-v-71fcd8c4"]])})),bl,Sl,kl,Cl,Gs,Ml=q((()=>{et(),mo(),st(),Ds(),Do(),Ro(),Io(),Ko(),No(),_o(),Eo(),Uo(),zo(),bl={class:"files-panel-drawer"},Sl={class:"files-main-panel"},kl={class:"main-toolbar"},Cl={class:"files-content"},Gs=tt({__name:"FilesPanel",setup(D){const n=ho(),{t:_}=at(),k=i(null),C=i(!1),y=i(!1),p=i("newFile"),o=i(null),B=i(null),A=i(!1);function X($,S){k.value?.show($,S)}function z(){p.value="newFile",o.value=null,B.value=null,y.value=!0}function E(){p.value="newFolder",o.value=null,B.value=null,y.value=!0}function F($){p.value="newFolder",o.value=null,B.value=$.isDir?$.path:n.currentPath,y.value=!0}function te($){p.value="rename",o.value=$,B.value=null,y.value=!0}return lt(()=>{n.fetchEntries("",{profile:null})}),($,S)=>(r(),d("div",bl,[A.value?(r(),d("div",{key:0,class:"sidebar-overlay",onClick:S[0]||(S[0]=L=>A.value=!1)})):m("",!0),a("div",{class:R(["files-tree-panel",{"mobile-visible":A.value}])},[c(Bo)],2),a("div",Sl,[a("div",kl,[c(s(T),{size:"small",onClick:S[1]||(S[1]=L=>A.value=!A.value),class:"sidebar-toggle"},{icon:g(()=>[...S[5]||(S[5]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),a("line",{x1:"9",y1:"3",x2:"9",y2:"21"})],-1)])]),default:g(()=>[V(" "+u(s(_)("files.fileTree")),1)]),_:1}),c(To,{onShowNewFile:z,onShowNewFolder:E,onShowUpload:S[2]||(S[2]=L=>C.value=!0)})]),c(Go),a("div",Cl,[s(n).editingFile?(r(),N(wo,{key:0})):s(n).previewFile?(r(),N(Lo,{key:1})):(r(),N(Oo,{key:2,onContextmenuEntry:X}))])]),c(qo,{ref_key:"contextMenuRef",ref:k,onRename:te,onNewFolder:F},null,512),c(Vo,{show:C.value,"onUpdate:show":S[3]||(S[3]=L=>C.value=L)},null,8,["show"]),c(Wo,{show:y.value,"onUpdate:show":S[4]||(S[4]=L=>y.value=L),mode:p.value,entry:o.value,"target-path":B.value},null,8,["show","mode","entry","target-path"])]))}})})),an=q((()=>{})),Vs,on=q((()=>{Ml(),Ml(),an(),ot(),Vs=nt(Gs,[["__scopeId","data-v-4efbc0dc"]])})),xl,Pl,Al,Fl,$l,Ll,Nl,Tl,Il,Dl,Bl,Ul,Ol,Rl,zl,El,Gl,Vl,ql,Wl,Kl,Hl,jl,Xl,Yl,Jl,Ql,Zl,es,ts,ls,ss,as,os,ns,is,rs,us,ds,cs,vs,ps,fs,hs,ms,_s,ws,gs,ys,bs,Ss,ks,Cs,Ms,xs,Ps,As,Fs,$s,Ls,Ns,Qe,Ze,qs,Ts=q((()=>{et(),po(),co(),io(),Os(),no(),yo(),Ds(),eo(),st(),bo(),Co(),So(),sn(),ko(),Po(),Ao(),on(),Ho(),Xo(),Yo(),Us(),xl={class:"chat-panel"},Pl={key:0,class:"page-sidebar-top"},Al={class:"session-list-toolbar"},Fl={class:"session-list-actions"},$l={key:1,class:"session-items"},Ll={key:0,class:"session-loading"},Nl={key:1,class:"session-empty"},Tl={class:"session-group-header session-group-header--static"},Il={class:"session-group-label"},Dl={class:"session-group-count"},Bl={key:2,class:"page-sidebar-bottom"},Ul={class:"session-model-list"},Ol=["onClick"],Rl={class:"session-model-group-label"},zl={class:"session-model-group-count"},El={class:"session-model-group-items"},Gl=["title","onClick"],Vl={class:"session-model-item-label"},ql={class:"session-model-item-name"},Wl={key:0,class:"session-model-item-id"},Kl={key:0,class:"session-model-badge-preview"},Hl={key:1,class:"session-model-badge-disabled"},jl={key:2,class:"session-model-badge-custom"},Xl={key:3,class:"session-model-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},Yl={key:0,class:"session-model-empty"},Jl={class:"session-model-custom"},Ql={class:"session-model-custom-row"},Zl={class:"session-model-custom-hint"},es={class:"new-chat-form"},ts={class:"new-chat-field"},ls={class:"new-chat-label"},ss={key:0,class:"new-chat-field"},as={class:"new-chat-label"},os={class:"new-chat-field"},ns={class:"new-chat-label"},is={key:1,class:"new-chat-field"},rs={class:"new-chat-label"},us={key:2,class:"new-chat-field"},ds={class:"new-chat-label"},cs={key:3,class:"new-chat-field"},vs={class:"new-chat-label"},ps={key:4,class:"new-chat-field"},fs={class:"new-chat-label"},hs={key:5,class:"new-chat-field"},ms={class:"new-chat-label"},_s={class:"new-chat-field"},ws={class:"new-chat-label"},gs={class:"new-chat-actions"},ys={class:"chat-main"},bs={class:"chat-header"},Ss={class:"header-left"},ks={class:"header-session-title"},Cs=["title"],Ms={class:"header-actions"},xs={class:"chat-main-content"},Ps={class:"chat-tool-panel-inner"},As={class:"chat-tool-tabs",role:"tablist"},Fs=["aria-selected"],$s=["aria-selected"],Ls={class:"chat-tool-content"},Ns=360,Qe=560,Ze="hermes.chat.toolPanelWidth",qs=tt({__name:"ChatPanel",setup(D){const n=oo(),_=Rs(),k=ao(),C=go(),y=to(),p=ja(),{t:o}=at(),B=h(()=>lo()),A=i(!1),X=i(null),z=i(null),E=i(null),F=i(0),te=i(!1),$=i(!1),S=i("files"),L=i(js()),Y=i(null),W=i("chat"),b=i(!1),w=i(new Set),f=i(!1),M=i(!1),x=i(typeof window>"u"||!window.matchMedia("(max-width: 768px)").matches);let fe=null;const J=i(!1),Ws=h(()=>({width:J.value?"100%":`${L.value}px`}));function Ee(e){return y.resolve({name:n.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:e}}).href}function Ks(e){typeof window>"u"||window.open(Ee(e),"_blank","noopener,noreferrer")}function Hs(e){X.value?.scrollToAnchor(e.messageId,e.anchorId),J.value&&(A.value=!1)}function js(){if(typeof window>"u")return Qe;const e=Number.parseInt(window.localStorage.getItem(Ze)||"",10);return Number.isFinite(e)?Math.round(e):Qe}function Xs(){if(typeof window>"u")return 1180;if(J.value)return window.innerWidth;const e=E.value?.clientWidth||window.innerWidth;return Math.max(320,Math.min(Math.floor(e*.88),e-120))}function it(e){const t=Xs();return Math.min(t,Math.max(Math.min(Ns,t),Math.round(e)))}function Pe(){J.value||(L.value=it(L.value))}function rt(e){const t=Y.value;if(!t)return;const l=t.x-e.clientX;L.value=it(t.width+l)}function Ge(){Y.value&&(Y.value=null,window.removeEventListener("pointermove",rt),window.removeEventListener("pointerup",Ge),J.value||window.localStorage.setItem(Ze,String(L.value)),document.body.style.userSelect="",document.body.style.cursor="")}function Ys(e){J.value||(e.preventDefault(),Y.value={x:e.clientX,width:L.value},window.addEventListener("pointermove",rt),window.addEventListener("pointerup",Ge),document.body.style.userSelect="none",document.body.style.cursor="col-resize")}function Ae(e){return Array.from(e.dataTransfer?.types||[]).includes("Files")}function ut(){F.value=0,te.value=!1}function Js(e){Ae(e)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"))}function Qs(e){Ae(e)&&(e.preventDefault(),F.value+=1,te.value=!0)}function Zs(e){Ae(e)&&(F.value-=1,F.value<=0&&ut())}function ea(e){if(!Ae(e))return;e.preventDefault();const t=Array.from(e.dataTransfer?.files||[]),l=e.target instanceof Element?e.target:null;ut(),!(!t.length||l?.closest(".chat-input-area"))&&z.value?.addFiles?.(t)}async function dt(e){n.clearSessionCompletedUnread(e),await y.push({name:n.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:e}}),n.activeSessionId!==e&&await n.switchSession(e),fe?.matches&&(x.value=!1)}function Ve(e){J.value=e.matches,e.matches&&x.value&&(x.value=!1)}function ct(){x.value=!0}lt(()=>{fe=window.matchMedia("(max-width: 768px)"),Ve(fe),fe.addEventListener("change",Ve),window.addEventListener("hermes:open-page-sidebar",ct),window.addEventListener("resize",Pe),Pe(),k.profiles.length===0&&k.fetchProfiles()}),Is(()=>{fe?.removeEventListener("change",Ve),window.removeEventListener("hermes:open-page-sidebar",ct),window.removeEventListener("resize",Pe),Ge()}),xe($,async e=>{!e||J.value||(await qt(),Pe())});const Fe=i(!1),le=i(""),he=i(null),vt=i(null),ta=h(()=>n.sessionProfileFilter),la=h(()=>[{label:o("chat.allProfiles"),value:"__all__"},...k.profiles.map(e=>({label:e.name,value:e.name}))]);async function sa(e){n.sessionProfileFilter=e==="__all__"?null:e,await n.loadSessions(n.sessionProfileFilter)}function pt(e){return[...e].sort((t,l)=>{const v=n.isSessionLive(t.id);return v!==n.isSessionLive(l.id)?v?-1:1:(l.updatedAt||0)-(t.updatedAt||0)})}const qe=h(()=>pt(n.sessions.filter(e=>C.isPinned(e.id)))),aa=h(()=>pt(n.sessions.filter(e=>!C.isPinned(e.id))));xe(()=>[n.sessionsLoaded,...n.sessions.map(e=>e.id)],e=>{const t=e.slice(1);!e[0]||t.length===0||C.pruneMissingSessions(t)},{immediate:!0});const oa=h(()=>n.activeSession?.title||o("chat.newChat")),na=h(()=>{const e=n.activeSession;return e?.model?_.displayModelName(e.model,e.provider):o("models.selectModel")}),ia=h(()=>W.value==="live"?o("chat.liveSessions"):oa.value),ue=i(!1),I=i("hermes"),G=i("scoped"),Q=i("default"),K=i(""),se=i(""),ae=i(""),de=i(""),me=i("codex_responses"),$e=i(""),H=i(!1),ra=new Set(["openai-codex","copilot","xai-oauth","nous","google-gemini-cli","claude-oauth"]),ua=h(()=>[{label:"Hermes",value:"hermes"},{label:"Claude Code",value:"claude-code"},{label:"Codex",value:"codex"}]),ft=h(()=>[{label:o("codingAgents.protocolOpenAiChat"),value:"chat_completions"},{label:o("codingAgents.protocolOpenAiResponses"),value:"codex_responses"},{label:o("codingAgents.protocolAnthropicMessages"),value:"anthropic_messages"}]),da=h(()=>[{label:o("codingAgents.launchModeGlobal"),value:"global"},{label:o("codingAgents.launchModeScoped"),value:"scoped"}]);function ht(e){return _.profileModelGroups.find(t=>t.profile===e)?.groups||[]}function mt(e){return ra.has(String(e||"").toLowerCase())}function ca(e){return I.value!=="hermes"&&G.value==="scoped"?!mt(e.provider):!0}function _t(e){return ht(e).filter(ca)}function va(e){const t=_t(e),l=k.activeProfileName||"default",v=_.selectedProvider||"",U=_.selectedModel||"",Z=v?t.find(ie=>ie.provider===v):void 0;if(e===l&&Z?.models.includes(U))return{provider:v,model:U};const O=_.profileModelGroups.find(ie=>ie.profile===e),pe=O?.default_provider||"",Gt=O?.default||"",je=(pe?t.find(ie=>ie.provider===pe):void 0)||t.find(ie=>ie.models.length>0);return{provider:je?.provider||"",model:je?.models.includes(Gt)?Gt:je?.models[0]||""}}const pa=h(()=>(k.profiles.length>0?k.profiles:[{name:"default"}]).map(e=>({label:e.name,value:e.name}))),We=h(()=>_t(Q.value)),fa=h(()=>We.value.map(e=>({label:e.label||e.provider,value:e.provider}))),wt=h(()=>{const e=We.value.find(t=>t.provider===K.value);return(e?.models||[]).map(t=>({label:_.displayModelName(t,e?.provider),value:t}))}),_e=h(()=>We.value.find(e=>e.provider===K.value)),ce=h(()=>I.value!=="hermes"),ha=h(()=>ce.value&&G.value==="global"),Le=h(()=>!ha.value),gt=h(()=>ce.value&&G.value==="scoped"&&!_e.value?.base_url),yt=h(()=>ce.value&&G.value==="scoped"&&!_e.value?.api_key),ma=h(()=>Q.value?Le.value?!K.value||!se.value?!1:ce.value?!(!me.value||gt.value&&!ae.value.trim()||yt.value&&!de.value.trim()):!0:!0:!1);function _a(e){const t=String(e?.provider||K.value||"").toLowerCase(),l=String(e?.base_url||ae.value||"").toLowerCase();return Kt(e?.api_mode,Wt(t,l))}function Ke(){me.value=_a(_e.value)}function He(){const e=va(Q.value);K.value=e.provider,se.value=e.model,ae.value="",de.value="",Ke()}function wa(){if(!Le.value)return;const e=_e.value;if(e&&e.models.includes(se.value)){Ke();return}He()}xe(()=>[I.value,G.value,Q.value],()=>wa());async function bt(){b.value=!1,w.value.clear(),f.value=!1,ue.value=!0,H.value=!0;try{k.profiles.length===0&&await k.fetchProfiles(),_.modelGroups.length===0&&_.profileModelGroups.length===0&&await _.loadModels(),$e.value="",Q.value=k.activeProfileName||k.profiles.find(e=>e.active)?.name||k.profiles[0]?.name||"default",He()}finally{H.value=!1}}function ga(e){Q.value=e,He()}function ya(e){K.value=e,se.value=wt.value[0]?.value||"",ae.value="",de.value="",Ke()}async function ba(){if(I.value!=="hermes"){H.value=!0;try{const Z=I.value,O=(await so()).tools.find(pe=>pe.id===Z);if(!O?.installed){const pe=Z==="codex"?"Codex":"Claude Code";p.warning(o("codingAgents.installRequired",{agent:O?.name||pe})),ue.value=!1,await y.push({name:"hermes.codingAgents"});return}}catch{p.error(o("codingAgents.loadFailed"));return}finally{H.value=!1}}const e=_e.value,t=I.value==="hermes"?"cli":"coding_agent",l=t==="coding_agent"&&G.value==="global",v=I.value==="codex"?"codex":I.value==="claude-code"?"claude":"hermes",U=n.newChat({profile:Q.value,provider:l?void 0:K.value,model:l?void 0:se.value,source:t,agent:v,codingAgentId:I.value==="hermes"?void 0:I.value,codingAgentMode:t==="coding_agent"?G.value:void 0,workspace:$e.value||null,baseUrl:t==="coding_agent"&&!l&&(e?.base_url||ae.value.trim())||void 0,apiKey:t==="coding_agent"&&!l&&(e?.api_key||de.value.trim())||void 0,apiMode:t==="coding_agent"&&!l?me.value:void 0});await y.push({name:n.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:U.id}}),ue.value=!1}function Sa(e){return n.sessions.find(t=>t.id===e)?.profile||null}function ka(e,t){const l=y.resolve({name:n.runtimeMode==="global_agent"?"hermes.globalAgentSession":"hermes.session",params:{sessionId:e},query:t?{profile:t}:void 0}).href;return`${window.location.origin}${window.location.pathname}${l}`}async function Ca(e){const t=e||n.activeSessionId;t&&(await Ht(ka(t,Sa(t)))?p.success(o("common.copied")):p.error(o("common.copied")+" ✗"))}async function St(e){const t=e||n.activeSessionId;t&&(await Ht(t)?p.success(o("common.copied")):p.error(o("common.copied")+" ✗"))}async function kt(e){if(!await n.deleteSession(e)){p.error(o("common.deleteFailed"));return}C.removePinned(e),p.success(o("chat.sessionDeleted"))}function Ct(){M.value||(b.value=!b.value,b.value||(w.value.clear(),f.value=!1))}function we(e){return`${e.profile||"default"}\0${e.id}`}function Mt(e){if(M.value)return;const t=we(e);w.value.has(t)?w.value.delete(t):w.value.add(t),w.value=new Set(w.value),w.value.size===0&&(f.value=!1)}function xt(e){return w.value.has(we(e))}async function Ma(){if(w.value.size===0||M.value)return;const e=new Map(n.sessions.map(l=>[we(l),l])),t=Array.from(w.value).map(l=>e.get(l)).filter(l=>!!l).map(l=>({id:l.id,profile:l.profile||null}));if(t.length!==0){M.value=!0;try{const l=await uo(t);if(l.deleted>0){for(const v of t)C.removePinned(v.id);await n.loadSessions(n.sessionProfileFilter),p.success(o("chat.batchDeleteSuccess",{count:l.deleted})),l.failed>0&&p.warning(o("chat.batchDeletePartial",{failed:l.failed}))}else p.error(o("chat.batchDeleteFailed"))}catch{p.error(o("chat.batchDeleteFailed"))}finally{M.value=!1,f.value=!1,b.value=!1,w.value.clear()}}}function xa(){return Ma(),!1}function Pa(){if(!M.value){w.value.clear();for(const e of n.sessions)e.id!==n.activeSessionId&&w.value.add(we(e));w.value=new Set(w.value)}}const Pt=h(()=>w.value.size),Aa=h(()=>n.sessions.some(e=>e.id!==n.activeSessionId)),P=i(null),Fa=h(()=>P.value?C.isPinned(P.value):!1),Ne=h(()=>P.value&&n.sessions.find(e=>e.id===P.value)||null),$a=h(()=>{const e=[{label:o(Fa.value?"chat.unpin":"chat.pin"),key:"pin"},{label:o("chat.rename"),key:"rename"}];return Ne.value?.source!=="global_agent"&&e.push({label:o("chat.archiveSession"),key:"archive"}),e.push({label:o("chat.setWorkspace"),key:"workspace"}),(Ne.value?.source==="cli"||Ne.value?.source==="coding_agent")&&e.push({label:o("chat.setModel"),key:"model"}),e.push({label:o("chat.export"),key:"export",children:[{label:o("chat.exportFull"),key:"export-full",children:[{label:"JSON",key:"export-full-json"},{label:"TXT",key:"export-full-txt"}]},{label:o("chat.exportCompressed"),key:"export-compressed",children:[{label:"JSON",key:"export-compressed-json"},{label:"TXT",key:"export-compressed-txt"}]}]}),e.push({label:o("chat.openSessionInNewTab"),key:"open-link"}),e.push({label:o("chat.copySessionLink"),key:"copy-link"}),e.push({label:o("chat.copySessionId"),key:"copy-id"}),e});function La(){y.push({name:"hermes.settings"})}function At(e,t){e.preventDefault(),P.value=t,Te.value=!0,Ft.value=e.clientX,$t.value=e.clientY}const Te=i(!1),Ft=i(0),$t=i(0);function Lt(e){return e==="export-full-json"?{mode:"full",ext:"json"}:e==="export-full-txt"?{mode:"full",ext:"txt"}:e==="export-compressed-json"?{mode:"compressed",ext:"json"}:e==="export-compressed-txt"?{mode:"compressed",ext:"txt"}:null}async function Na(e){if(Te.value=!1,!!P.value){if(e==="pin"){C.togglePinned(P.value);return}if(e==="copy-link")Ca(P.value);else if(e==="copy-id")St(P.value);else if(e==="open-link")Ks(P.value);else if(e==="archive"){const t=Ne.value;await n.archiveSession(P.value)?(C.removePinned(P.value),t&&(w.value.delete(we(t)),w.value=new Set(w.value)),p.success(o("chat.sessionArchived"))):p.error(o("chat.archiveSessionFailed"))}else if(Lt(e)){const{mode:t,ext:l}=Lt(e),v=t==="compressed"?p.loading(o("chat.exportCompressing"),{duration:0}):null;try{await vo(P.value,t,l),v?.destroy(),p.success(o("chat.exportSuccess"))}catch{v?.destroy(),p.error(o("chat.exportFailed"))}}else if(e==="workspace"){const t=n.sessions.find(l=>l.id===P.value);ve.value=P.value,oe.value=t?.workspace||"",ge.value=!0}else if(e==="model")await Ot(P.value);else if(e==="rename"){const t=n.sessions.find(l=>l.id===P.value);he.value=P.value,le.value=t?.title||"",Fe.value=!0,qt(()=>{vt.value?.focus()})}}}function Ta(){Te.value=!1}async function Nt(){if(!(!he.value||!le.value.trim())){if(await ro(he.value,le.value.trim())){const e=n.sessions.find(t=>t.id===he.value);e&&(e.title=le.value.trim()),n.activeSession?.id===he.value&&(n.activeSession.title=le.value.trim()),p.success(o("chat.renamed"))}else p.error(o("chat.renameFailed"));Fe.value=!1}}const ge=i(!1),oe=i(""),ve=i(null);function Ia(){const e=n.activeSession;e?.id&&(ve.value=e.id,oe.value=e.workspace||"",ge.value=!0)}async function Da(){if(ve.value){if(await fo(ve.value,oe.value||null)){const e=n.sessions.find(t=>t.id===ve.value);e&&(e.workspace=oe.value||null),n.activeSession?.id===ve.value&&(n.activeSession.workspace=oe.value||null),p.success(o("chat.workspaceSet"))}else p.error(o("chat.workspaceSetFailed"));ge.value=!1}}const Ie=i(!1),ye=i(!1),ne=i(null),be=i(""),De=i({}),Be=i(""),Se=i(""),Ue=i(""),Oe=i(""),ke=i("codex_responses"),Re=i(null),Tt=h(()=>n.sessions.find(e=>e.id===ne.value)?.profile||null),It=h(()=>n.sessions.find(e=>e.id===ne.value)||(n.activeSession?.id===ne.value?n.activeSession:void 0)),Dt=h(()=>It.value?.source==="coding_agent"&&It.value?.codingAgentMode!=="global"),Ce=h(()=>Tt.value?ht(Tt.value).filter(e=>!Dt.value||!mt(e.provider)):[]),Ba=h(()=>Ce.value.map(e=>({label:e.label,value:e.provider}))),Bt=h(()=>Ce.value.map(e=>({...e,models:[...e.models,...(_.customModels[e.provider]||[]).filter(t=>!e.models.includes(t))]}))),Ut=h(()=>{const e=be.value.trim().toLowerCase();return e?Bt.value.map(t=>({...t,models:t.models.filter(l=>{const v=_.displayModelName(l,t.provider);return l.toLowerCase().includes(e)||v.toLowerCase().includes(e)})})).filter(t=>t.models.length>0||t.label.toLowerCase().includes(e)):Bt.value});async function Ot(e){_.modelGroups.length===0&&_.profileModelGroups.length===0&&await _.loadModels();const t=n.sessions.find(O=>O.id===e)||(n.activeSession?.id===e?n.activeSession:void 0);ne.value=e;const l=Ce.value,v=t?.provider?l.find(O=>O.provider===t.provider):void 0,U=v||l.find(O=>O.models.length>0),Z={provider:U?.provider||"",model:U?.models.includes(t?.model||"")?t?.model||"":U?.models[0]||""};Be.value=v?t?.model||Z.model||"":Z.model||"",Se.value=v?t?.provider||"":Z.provider||"",Oe.value=Se.value,be.value="",Ue.value="",De.value={},Ie.value=!0}function Ua(){const e=n.activeSession?.id;if(!e){bt();return}Ot(e)}function Rt(e){return!!De.value[e]}function Oa(e){De.value[e]=!De.value[e]}function Ra(e,t){return(_.customModels[t]||[]).includes(e)}function za(e,t){return _.displayModelName(e,t)}function Ea(e,t){return _.getModelAlias(e,t)}function Ga(e){const t=Ce.value.find(U=>U.provider===e),l=String(t?.provider||e||"").toLowerCase(),v=String(t?.base_url||"").toLowerCase();return Kt(t?.api_mode,Wt(l,v))}async function zt(e,t,l){ne.value&&(await n.switchSessionModel(e,t,ne.value,l)?(Be.value=e,Se.value=t,l&&(ke.value=l),Re.value=null,ye.value=!1,Ie.value=!1,p.success(o("chat.modelSet"))):p.error(o("chat.modelSetFailed")))}async function Et(e,t){if(!(Ce.value.find(l=>l.provider===t)?.model_meta?.[e]?.disabled||!ne.value)){if(Dt.value){Re.value={model:e,provider:t},ke.value=Ga(t),ye.value=!0;return}await zt(e,t)}}async function Va(){const e=Re.value;e&&await zt(e.model,e.provider,ke.value)}function qa(){Re.value=null,ye.value=!1}async function Wa(){const e=Ue.value.trim(),t=Oe.value;!e||!t||await Et(e,t)}return(e,t)=>(r(),d("div",xl,[W.value==="chat"?(r(),d("div",{key:0,class:R(["session-backdrop",{active:x.value}]),onClick:t[0]||(t[0]=l=>x.value=!1)},null,2)):m("",!0),W.value==="chat"?(r(),d("aside",{key:1,class:R(["session-list",{collapsed:!x.value}])},[x.value?(r(),d("div",Pl,[c(Jo,{active:s(n).runtimeMode==="global_agent"?"global":"chat","primary-label":s(o)("chat.newChat"),onPrimary:bt},null,8,["active","primary-label"]),a("div",Al,[c(s(ee),{class:"session-profile-filter",value:ta.value||"__all__",options:la.value,size:"small",loading:s(k).loading,"onUpdate:value":sa},null,8,["value","options","loading"]),a("div",Fl,[a("button",{class:"session-close-btn",onClick:t[1]||(t[1]=l=>x.value=!1)},[...t[28]||(t[28]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),b.value?m("",!0):(r(),N(s(T),{key:0,quaternary:"",size:"tiny",onClick:Ct,title:s(o)("chat.toggleBatchMode")},{icon:g(()=>[...t[29]||(t[29]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("path",{d:"M9 11l3 3L22 4"}),a("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["title"])),b.value?(r(),N(s(T),{key:1,quaternary:"",size:"tiny",onClick:Pa,disabled:!Aa.value||M.value,title:s(o)("chat.selectAll")},{icon:g(()=>[...t[30]||(t[30]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("path",{d:"M9 11l3 3L22 4"}),a("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})],-1)])]),_:1},8,["disabled","title"])):m("",!0),b.value&&Pt.value>0?(r(),N(s(Za),{key:2,show:f.value,"onUpdate:show":t[2]||(t[2]=l=>f.value=l),"positive-button-props":{loading:M.value,disabled:M.value},"negative-button-props":{disabled:M.value},onPositiveClick:xa},{trigger:g(()=>[c(s(T),{quaternary:"",size:"tiny",type:"error",loading:M.value,disabled:M.value},{icon:g(()=>[...t[31]||(t[31]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("polyline",{points:"3 6 5 6 21 6"}),a("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])]),_:1},8,["loading","disabled"])]),default:g(()=>[V(" "+u(s(o)("chat.confirmBatchDelete",{count:Pt.value})),1)]),_:1},8,["show","positive-button-props","negative-button-props"])):m("",!0),b.value?(r(),N(s(T),{key:3,quaternary:"",size:"tiny",onClick:Ct,disabled:M.value},{icon:g(()=>[...t[32]||(t[32]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[a("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),_:1},8,["disabled"])):m("",!0)])])])):m("",!0),x.value?(r(),d("div",$l,[s(n).isLoadingSessions&&s(n).sessions.length===0?(r(),d("div",Ll,u(s(o)("common.loading")),1)):s(n).sessions.length===0?(r(),d("div",Nl,u(s(o)("chat.noSessions")),1)):m("",!0),qe.value.length>0?(r(),d(j,{key:2},[a("div",Tl,[a("span",Il,u(s(o)("chat.pinned")),1),a("span",Dl,u(qe.value.length),1)]),(r(!0),d(j,null,re(qe.value,l=>(r(),N(Jt,{key:`pinned-${l.id}`,session:l,active:l.id===s(n).activeSessionId,pinned:!0,"can-delete":l.id!==s(n).activeSessionId||s(n).sessions.length>1,streaming:s(n).isSessionLive(l.id),"completed-unread":s(n).isSessionCompletedUnread(l.id),selectable:b.value,selected:xt(l),"show-profile":!0,to:Ee(l.id),onSelect:v=>dt(l.id),onContextmenu:v=>At(v,l.id),onDelete:v=>kt(l.id),onToggleSelect:v=>Mt(l)},null,8,["session","active","can-delete","streaming","completed-unread","selectable","selected","to","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))],64)):m("",!0),(r(!0),d(j,null,re(aa.value,l=>(r(),N(Jt,{key:l.id,session:l,active:l.id===s(n).activeSessionId,pinned:!1,"can-delete":l.id!==s(n).activeSessionId||s(n).sessions.length>1,streaming:s(n).isSessionLive(l.id),"completed-unread":s(n).isSessionCompletedUnread(l.id),selectable:b.value,selected:xt(l),"show-profile":!0,to:Ee(l.id),onSelect:v=>dt(l.id),onContextmenu:v=>At(v,l.id),onDelete:v=>kt(l.id),onToggleSelect:v=>Mt(l)},null,8,["session","active","can-delete","streaming","completed-unread","selectable","selected","to","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))])):m("",!0),x.value?(r(),d("div",Bl,[a("button",{class:"page-sidebar-menu-btn",type:"button",onClick:La},[t[33]||(t[33]=a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[a("circle",{cx:"12",cy:"12",r:"3"}),a("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)),a("span",null,u(s(o)("sidebar.settings")),1)]),c(Qo)])):m("",!0)],2)):m("",!0),c(s(Ja),{placement:"bottom-start",trigger:"manual",x:Ft.value,y:$t.value,options:$a.value,show:Te.value,onSelect:Na,onClickoutside:Ta},null,8,["x","y","options","show"]),c(s(ze),{show:Fe.value,"onUpdate:show":t[4]||(t[4]=l=>Fe.value=l),preset:"dialog",title:s(o)("chat.renameSession"),"positive-text":s(o)("common.ok"),"negative-text":s(o)("common.cancel"),onPositiveClick:Nt},{default:g(()=>[c(s(Me),{ref_key:"renameInputRef",ref:vt,value:le.value,"onUpdate:value":t[3]||(t[3]=l=>le.value=l),placeholder:s(o)("chat.enterNewTitle"),onKeydown:Vt(Nt,["enter"])},null,8,["value","placeholder"])]),_:1},8,["show","title","positive-text","negative-text"]),c(s(ze),{show:ge.value,"onUpdate:show":t[6]||(t[6]=l=>ge.value=l),preset:"dialog",title:s(o)("chat.setWorkspaceTitle"),"positive-text":s(o)("common.ok"),"negative-text":s(o)("common.cancel"),style:{width:"520px"},onPositiveClick:Da},{default:g(()=>[c(jt,{modelValue:oe.value,"onUpdate:modelValue":t[5]||(t[5]=l=>oe.value=l)},null,8,["modelValue"])]),_:1},8,["show","title","positive-text","negative-text"]),c(s(ze),{show:Ie.value,"onUpdate:show":t[10]||(t[10]=l=>Ie.value=l),preset:"card",title:s(o)("chat.setModelTitle"),style:{width:"min(480px, calc(100vw - 32px))"},"mask-closable":!0},{default:g(()=>[c(s(Me),{value:be.value,"onUpdate:value":t[7]||(t[7]=l=>be.value=l),placeholder:s(o)("models.searchPlaceholder"),clearable:"",size:"small",class:"session-model-search"},null,8,["value","placeholder"]),a("div",Ul,[(r(!0),d(j,null,re(Ut.value,l=>(r(),d("div",{key:l.provider,class:"session-model-group"},[a("div",{class:"session-model-group-header",onClick:v=>Oa(l.provider)},[(r(),d("svg",{class:R(["session-model-group-arrow",{collapsed:Rt(l.provider)}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...t[34]||(t[34]=[a("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),a("span",Rl,u(l.label),1),a("span",zl,u(l.models.length),1)],8,Ol),Ye(a("div",El,[(r(!0),d(j,null,re(l.models,v=>(r(),d("div",{key:v,class:R(["session-model-item",{active:v===Be.value&&l.provider===Se.value,disabled:!!l.model_meta?.[v]?.disabled}]),title:l.model_meta?.[v]?.disabled?s(o)("models.disabledTooltip"):"",onClick:U=>Et(v,l.provider)},[a("span",Vl,[a("span",ql,u(za(v,l.provider)),1),Ea(v,l.provider)?(r(),d("span",Wl,u(s(o)("models.aliasCanonical",{model:v})),1)):m("",!0)]),l.model_meta?.[v]?.preview?(r(),d("span",Kl,u(s(o)("models.previewBadge")),1)):m("",!0),l.model_meta?.[v]?.disabled?(r(),d("span",Hl,u(s(o)("models.disabledBadge")),1)):m("",!0),Ra(v,l.provider)?(r(),d("span",jl,u(s(o)("models.customBadge")),1)):m("",!0),v===Be.value&&l.provider===Se.value?(r(),d("svg",Xl,[...t[35]||(t[35]=[a("polyline",{points:"20 6 9 17 4 12"},null,-1)])])):m("",!0)],10,Gl))),128))],512),[[Xe,!Rt(l.provider)]])]))),128)),Ut.value.length===0?(r(),d("div",Yl,u(be.value?"No results":"No models"),1)):m("",!0),a("div",Jl,[a("div",Ql,[c(s(ee),{value:Oe.value,"onUpdate:value":t[8]||(t[8]=l=>Oe.value=l),options:Ba.value,size:"small",class:"session-model-custom-provider"},null,8,["value","options"]),c(s(Me),{value:Ue.value,"onUpdate:value":t[9]||(t[9]=l=>Ue.value=l),placeholder:s(o)("models.customModelPlaceholder"),size:"small",class:"session-model-custom-input",onKeydown:Vt(Wa,["enter"])},null,8,["value","placeholder"])]),a("div",Zl,u(s(o)("models.customModelHint")),1)])])]),_:1},8,["show","title"]),c(s(ze),{show:ye.value,"onUpdate:show":t[12]||(t[12]=l=>ye.value=l),preset:"dialog",title:s(o)("codingAgents.protocolScope"),"mask-closable":!0,style:{width:"min(420px, calc(100vw - 32px))"}},{action:g(()=>[c(s(T),{size:"small",onClick:qa},{default:g(()=>[V(u(s(o)("common.cancel")),1)]),_:1}),c(s(T),{size:"small",type:"primary",onClick:Va},{default:g(()=>[V(u(s(o)("common.confirm")),1)]),_:1})]),default:g(()=>[c(s(ee),{value:ke.value,"onUpdate:value":t[11]||(t[11]=l=>ke.value=l),options:ft.value},null,8,["value","options"])]),_:1},8,["show","title"]),c(s(Ka),{show:ue.value,"onUpdate:show":t[21]||(t[21]=l=>ue.value=l),class:"new-chat-drawer",placement:"right",width:"min(440px, 100vw)","mask-closable":!0},{default:g(()=>[c(s(Ha),{title:s(o)("chat.newChat"),closable:""},{footer:g(()=>[a("div",gs,[c(s(T),{onClick:t[20]||(t[20]=l=>ue.value=!1)},{default:g(()=>[V(u(s(o)("common.cancel")),1)]),_:1}),c(s(T),{type:"primary",disabled:!ma.value,onClick:ba},{default:g(()=>[V(u(s(o)("common.create")),1)]),_:1},8,["disabled"])])]),default:g(()=>[a("div",es,[a("label",ts,[a("span",ls,u(s(o)("chat.agent")),1),c(s(ee),{value:I.value,"onUpdate:value":t[13]||(t[13]=l=>I.value=l),options:ua.value,disabled:H.value},null,8,["value","options","disabled"])]),ce.value?(r(),d("label",ss,[a("span",as,u(s(o)("codingAgents.launchModeScope")),1),c(s(Xa),{value:G.value,"onUpdate:value":t[14]||(t[14]=l=>G.value=l),name:"new-chat-coding-agent-mode"},{default:g(()=>[(r(!0),d(j,null,re(da.value,l=>(r(),N(s(Qa),{key:l.value,value:l.value},{default:g(()=>[V(u(l.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])):m("",!0),a("label",os,[a("span",ns,u(s(o)("sidebar.profiles")),1),c(s(ee),{value:Q.value,options:pa.value,loading:H.value||s(k).loading,"onUpdate:value":ga},null,8,["value","options","loading"])]),Le.value?(r(),d("label",is,[a("span",rs,u(s(o)("models.provider")),1),c(s(ee),{value:K.value,options:fa.value,disabled:H.value,"onUpdate:value":ya},null,8,["value","options","disabled"])])):m("",!0),Le.value?(r(),d("label",us,[a("span",ds,u(s(o)("models.models")),1),c(s(ee),{value:se.value,"onUpdate:value":t[15]||(t[15]=l=>se.value=l),options:wt.value,disabled:H.value||!K.value,filterable:""},null,8,["value","options","disabled"])])):m("",!0),ce.value&&G.value==="scoped"?(r(),d("label",cs,[a("span",vs,u(s(o)("codingAgents.protocolScope")),1),c(s(ee),{value:me.value,"onUpdate:value":t[16]||(t[16]=l=>me.value=l),options:ft.value,disabled:H.value},null,8,["value","options","disabled"])])):m("",!0),gt.value?(r(),d("label",ps,[a("span",fs,u(s(o)("models.baseUrl")),1),c(s(Me),{value:ae.value,"onUpdate:value":t[17]||(t[17]=l=>ae.value=l),placeholder:s(o)("models.baseUrlPlaceholder")},null,8,["value","placeholder"])])):m("",!0),yt.value?(r(),d("label",hs,[a("span",ms,u(s(o)("models.apiKey")),1),c(s(Me),{value:de.value,"onUpdate:value":t[18]||(t[18]=l=>de.value=l),type:"password","show-password-on":"click",placeholder:s(o)("models.apiKeyPlaceholder")},null,8,["value","placeholder"])])):m("",!0),a("div",_s,[a("span",ws,u(s(o)("chat.workspace")),1),c(jt,{modelValue:$e.value,"onUpdate:modelValue":t[19]||(t[19]=l=>$e.value=l)},null,8,["modelValue"])])])]),_:1},8,["title"])]),_:1},8,["show"]),a("div",ys,[a("header",bs,[a("div",Ss,[W.value==="chat"?(r(),N(s(T),{key:0,class:"header-sidebar-toggle",quaternary:"",size:"small",onClick:t[22]||(t[22]=l=>x.value=!x.value),circle:""},{icon:g(()=>[...t[36]||(t[36]=[a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a("rect",{x:"3",y:"3",width:"7",height:"7"}),a("rect",{x:"14",y:"3",width:"7",height:"7"}),a("rect",{x:"3",y:"14",width:"7",height:"7"}),a("rect",{x:"14",y:"14",width:"7",height:"7"})],-1)])]),_:1})):m("",!0),a("span",ks,u(ia.value),1),s(n).activeSession?.workspace?(r(),d("button",{key:1,class:"workspace-badge",type:"button",title:s(n).activeSession.workspace,onClick:Ia},[t[37]||(t[37]=a("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[a("path",{d:"M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"})],-1)),a("span",null,u(s(n).activeSession.workspace.split("/").pop()||s(n).activeSession.workspace),1)],8,Cs)):m("",!0)]),a("div",Ms,[W.value==="chat"?(r(),d(j,{key:0},[B.value?(r(),N(s(Je),{key:0,trigger:"hover"},{trigger:g(()=>[c(s(T),{class:R(["header-tool-toggle",{active:$.value}]),quaternary:"",size:"small",onClick:t[23]||(t[23]=l=>$.value=!$.value),circle:""},{icon:g(()=>[...t[38]||(t[38]=[a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),a("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),a("line",{x1:"15",y1:"3",x2:"15",y2:"21"})],-1)])]),_:1},8,["class"])]),default:g(()=>[V(" "+u(s(o)("drawer.files"))+" / "+u(s(o)("drawer.terminal")),1)]),_:1})):m("",!0),c(s(Je),{trigger:"hover"},{trigger:g(()=>[c(s(T),{quaternary:"",size:"small",onClick:t[24]||(t[24]=l=>A.value=!A.value),circle:""},{icon:g(()=>[...t[39]||(t[39]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a("path",{d:"M3 12h18M3 6h18M3 18h18"})],-1)])]),_:1})]),default:g(()=>[V(" "+u(s(o)("chat.outlineTitle")),1)]),_:1}),c(s(Je),{trigger:"hover"},{trigger:g(()=>[c(s(T),{quaternary:"",size:"small",onClick:t[25]||(t[25]=l=>St()),circle:""},{icon:g(()=>[...t[40]||(t[40]=[a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)])]),_:1})]),default:g(()=>[V(" "+u(s(o)("chat.copySessionId")),1)]),_:1})],64)):m("",!0)])]),W.value==="chat"?(r(),d("div",{key:0,ref_key:"chatContentWrapperRef",ref:E,class:R(["chat-content-wrapper",{"chat-content-wrapper--drop-active":te.value}]),onDragover:Js,onDragenter:Qs,onDragleave:Zs,onDrop:ea},[a("div",xs,[c(xo,{ref_key:"messageListRef",ref:X},null,512),c(Mo,{ref_key:"chatInputRef",ref:z,"model-label":na.value,onModelClick:Ua},null,8,["model-label"])]),A.value?(r(),N($o,{key:0,messages:s(n).messages,onNavigate:Hs},null,8,["messages"])):m("",!0),$.value?(r(),d("aside",{key:1,class:"chat-tool-panel",style:Ya(Ws.value)},[a("div",{class:"chat-tool-resize-handle",onPointerdown:Ys},null,32),a("div",Ps,[a("div",As,[a("button",{class:R(["chat-tool-tab",{active:S.value==="files"}]),type:"button",role:"tab","aria-selected":S.value==="files",onClick:t[26]||(t[26]=l=>S.value="files")},u(s(o)("drawer.files")),11,Fs),a("button",{class:R(["chat-tool-tab",{active:S.value==="terminal"}]),type:"button",role:"tab","aria-selected":S.value==="terminal",onClick:t[27]||(t[27]=l=>S.value="terminal")},u(s(o)("drawer.terminal")),11,$s)]),a("div",Ls,[Ye(c(Vs,null,null,512),[[Xe,S.value==="files"]]),Ye(c(jo,{visible:$.value&&S.value==="terminal"},null,8,["visible"]),[[Xe,S.value==="terminal"]])])])],4)):m("",!0)],34)):(r(),N(Es,{key:1,"human-only":s(C).humanOnly},null,8,["human-only"]))])]))}})})),nn=q((()=>{})),rn,Rn=q((()=>{Ts(),Ts(),nn(),ot(),rn=nt(qs,[["__scopeId","data-v-bc14664f"]])}));export{Rn as n,rn as t};
@@ -1 +1 @@
1
- import{n as r}from"./rolldown-runtime-M0oDzQ_3.js";import{An as S,Bn as _,Kt as w,cn as g,hn as y,in as n,jn as C,kn as P,pn as V}from"./ui-vendor-DDMfmCj2.js";import{M as x,N as M,P as R}from"./vue-vendor-BsMpqyaC.js";import{n as k,t as b}from"./_plugin-vue_export-helper-fFMkIM4P.js";import{Dt as B,E,Et as A,L as F,Ot as I,R as L,T as N,kt as T}from"./index-Brl4qW5V.js";import{n as j,t as q}from"./ChatPanel-DyZWRnQs.js";var l,i,p,c=r((()=>{w(),x(),j(),I(),N(),A(),F(),l={class:"chat-view"},i="Hermes Studio",p=y({__name:"ChatView",setup(O){const m=T(),t=E(),d=B(),f=L(),a=M(),v=R(),s=n(()=>{const e=a.params.sessionId;return typeof e=="string"&&e.trim()?e:null}),h=n(()=>{const e=a.query.profile;return typeof e=="string"&&e.trim()?e:null});_(n(()=>a.name!=="hermes.session"?i:t.activeSession?.title?.trim()||i),e=>{document.title=e},{immediate:!0}),S(()=>{document.title=i});async function o(){await t.loadSessions(t.sessionProfileFilter,s.value),s.value&&t.activeSessionId!==s.value&&await v.replace({name:"hermes.chat"})}return P(async()=>{t.setRuntimeMode("default"),m.loadModels(),await Promise.all([d.fetchProfiles(),f.fetchSettings()]),await o()}),_([s,h],async([e])=>{if(t.sessionsLoaded){if(!e){await t.loadSessions(t.sessionProfileFilter);return}if(t.activeSessionId!==e){if(!t.sessions.some(u=>u.id===e)){await o();return}await t.switchSession(e)}}}),(e,u)=>(C(),g("div",l,[V(q)]))}})})),D=r((()=>{})),H,K=r((()=>{c(),c(),D(),k(),H=b(p,[["__scopeId","data-v-724670c2"]])}));K();export{H as default};
1
+ import{n as r}from"./rolldown-runtime-M0oDzQ_3.js";import{An as S,Bn as _,Kt as w,cn as g,hn as y,in as n,jn as C,kn as P,pn as V}from"./ui-vendor-DDMfmCj2.js";import{M as x,N as M,P as R}from"./vue-vendor-BsMpqyaC.js";import{n as k,t as b}from"./_plugin-vue_export-helper-CvnFozKy.js";import{Dt as B,E,Et as A,L as F,Ot as I,R as L,T as N,kt as T}from"./index-B2IKGvbR.js";import{n as j,t as q}from"./ChatPanel-DRCE0v4g.js";var l,i,p,c=r((()=>{w(),x(),j(),I(),N(),A(),F(),l={class:"chat-view"},i="Hermes Studio",p=y({__name:"ChatView",setup(O){const m=T(),t=E(),d=B(),f=L(),a=M(),v=R(),s=n(()=>{const e=a.params.sessionId;return typeof e=="string"&&e.trim()?e:null}),h=n(()=>{const e=a.query.profile;return typeof e=="string"&&e.trim()?e:null});_(n(()=>a.name!=="hermes.session"?i:t.activeSession?.title?.trim()||i),e=>{document.title=e},{immediate:!0}),S(()=>{document.title=i});async function o(){await t.loadSessions(t.sessionProfileFilter,s.value),s.value&&t.activeSessionId!==s.value&&await v.replace({name:"hermes.chat"})}return P(async()=>{t.setRuntimeMode("default"),m.loadModels(),await Promise.all([d.fetchProfiles(),f.fetchSettings()]),await o()}),_([s,h],async([e])=>{if(t.sessionsLoaded){if(!e){await t.loadSessions(t.sessionProfileFilter);return}if(t.activeSessionId!==e){if(!t.sessions.some(u=>u.id===e)){await o();return}await t.switchSession(e)}}}),(e,u)=>(C(),g("div",l,[V(q)]))}})})),D=r((()=>{})),H,K=r((()=>{c(),c(),D(),k(),H=b(p,[["__scopeId","data-v-724670c2"]])}));K();export{H as default};
@@ -1 +1 @@
1
- import{n as X}from"./rolldown-runtime-M0oDzQ_3.js";import{A as ia,Bn as oa,Bt as M,Hn as o,It as da,K as ua,Kt as ra,M as oe,Nn as W,O as V,Ot as w,Rt as de,V as ca,an as s,cn as h,cr as l,ct as ga,er as u,fn as v,g as ue,hn as va,in as p,jn as r,kn as fa,mt as Y,nn as _a,on as f,pn as c,pr as d,sn as m,t as pa,tn as $,ur as re,ut as ha}from"./ui-vendor-DDMfmCj2.js";import{O as ma,k as ya}from"./vue-vendor-BsMpqyaC.js";import{n as Aa,t as Ca}from"./_plugin-vue_export-helper-fFMkIM4P.js";import{a as ba,l as wa}from"./system-CRmVbE8Z.js";import{$ as xa,Dt as Fa,Et as Sa,Q as Pa,at as Ma,et as ka,it as La,nt as Ta,ot as Ba,rt as Na,st as Va,tt as Oa}from"./index-Brl4qW5V.js";import{n as za,t as Ia}from"./TerminalPanel-Dx7huJY2.js";var ce,ge,ve,fe,_e,pe,he,me,ye,Ae,Ce,be,we,xe,Fe,Se,Pe,Me,ke,Le,Te,Be,Ne,Ve,Oe,ze,Ie,Ee,je=X((()=>{ra(),pa(),ma(),Oa(),wa(),Sa(),za(),ce={class:"coding-agents-view"},ge={class:"page-header"},ve={class:"header-title"},fe={class:"coding-agents-content"},_e={class:"content-description"},pe={class:"agent-blocks"},he={class:"agent-block-header"},me=["src"],ye={class:"agent-install-state"},Ae={class:"install-state-main"},Ce={class:"install-state-title"},be={class:"install-state-value"},we={class:"version-text"},xe={key:0,class:"install-error-detail"},Fe={class:"config-file-section"},Se={class:"config-file-title"},Pe={class:"config-file-list"},Me=["onClick"],ke={class:"inline-config-editor"},Le={class:"config-editor-meta"},Te={class:"config-editor-path"},Be={class:"config-editor-actions"},Ne={class:"drawer-header"},Ve={class:"drawer-tabs"},Oe={class:"tab-button active",type:"button"},ze={class:"drawer-content"},Ie={class:"drawer-pane"},Ee=va({__name:"CodingAgentsView",setup(Ra){const{t:n}=ya(),g=ca(),Ke=Fa(),k=u(!1),O=u(""),z=u([]),I=u({"claude-code":!1,codex:!1}),x=u({"claude-code":"",codex:""}),F=u({"claude-code":"",codex:""}),j=u({"claude-code":!1,codex:!1}),L=u(!1),H=u(!1),E=u(!1),K=u(!1),D=u("claude-code"),G=u([]),S=u("scoped"),y=u(""),A=u(""),T=u("codex_responses"),q=u(null),P=u(!1),Z=u(""),ee=u(0),Re=new Set(["openai-codex","copilot","xai-oauth","nous","google-gemini-cli","claude-oauth"]),Ue={"Claude Code":"/coding-agents/claude-code.svg",Codex:"/coding-agents/codex-openai.png"},$e=[{id:"claude-code",tool:"Claude Code",provider:"Anthropic"},{id:"codex",tool:"Codex",provider:"OpenAI"}],B={"claude-code":[{key:"settings",path:"~/.claude/settings.json",language:"json"},{key:"mcp",path:"~/.claude.json",language:"json"},{key:"prompt",path:"~/.claude/CLAUDE.md",language:"markdown"}],codex:[{key:"auth",path:"~/.codex/auth.json",language:"json"},{key:"config",path:"~/.codex/config.toml",language:"ini"},{key:"agents",path:"~/.codex/AGENTS.md",language:"markdown"}]},_=u({"claude-code":{selectedKey:"settings",content:"",originalContent:"",loading:!1,saving:!1},codex:{selectedKey:"config",content:"",originalContent:"",loading:!1,saving:!1}}),He=p(()=>z.value.reduce((e,t)=>(e[t.id]=t,e),{})),R=p(()=>Ke.activeProfileName||"default");function De(e){const t=String(e.provider||"").toLowerCase();return Re.has(t)}const N=p(()=>S.value==="scoped"?G.value.filter(e=>!De(e)):G.value),Ge=p(()=>N.value.map(e=>({label:e.label&&e.label!==e.provider?`${e.label} (${e.provider})`:e.provider,value:e.provider}))),J=p(()=>N.value.find(e=>e.provider===y.value)||null),qe=p(()=>J.value?.models.map(e=>({label:e,value:e}))||[]),Je=p(()=>[{label:n("codingAgents.protocolOpenAiChat"),value:"chat_completions"},{label:n("codingAgents.protocolOpenAiResponses"),value:"codex_responses"},{label:n("codingAgents.protocolAnthropicMessages"),value:"anthropic_messages"}]),Qe=p(()=>[{label:n("codingAgents.launchModeGlobal"),value:"global"},{label:n("codingAgents.launchModeScoped"),value:"scoped"}]),We={buttonColorActive:"#111827",buttonTextColorActive:"#fff",buttonBorderColorActive:"#111827",buttonBoxShadow:"inset 0 0 0 1px var(--border-color)",buttonBoxShadowHover:"inset 0 0 0 1px #111827"},C=p(()=>S.value==="global");function b(e){return He.value[e]}function Ye(e){return B[e]}function ae(e){return B[e].find(t=>t.key===_.value[e].selectedKey)||B[e][0]}function Xe(e){const t=_.value[e];return t.content!==t.originalContent}async function te(){k.value=!0,O.value="";try{z.value=(await xa()).tools}catch(e){O.value=e?.message||n("codingAgents.loadFailed")}finally{k.value=!1}}async function Q(e,t){const a=_.value[e];a.selectedKey=t.key,a.loading=!0;try{const i=await Ba(e,t.key);a.content=i.content,a.originalContent=i.content,a.absolutePath=i.absolutePath,a.exists=i.exists}catch(i){g.error(i?.message||n("codingAgents.configLoadFailed"))}finally{a.loading=!1}}async function Ze(e){const t=_.value[e],a=ae(e);if(a){t.saving=!0;try{const i=await Va(e,a.key,t.content);t.originalContent=i.content,t.absolutePath=i.absolutePath,t.exists=i.exists,g.success(n("files.saved"))}catch(i){g.error(i?.message||n("files.saveFailed"))}finally{t.saving=!1}}}function le(){const e=N.value[0];y.value=e?.provider||"",A.value=e?.models[0]||"",T.value=ne(e)}function ea(e){const t=N.value.find(a=>a.provider===e);A.value=t?.models[0]||"",T.value=ne(t)}oa([N,S],()=>{C.value||J.value||le()});function ne(e){return La(e?.api_mode,ka(e?.provider,e?.base_url))}async function aa(e){D.value=e,S.value="scoped",L.value=!0,q.value=null,H.value=!0;try{G.value=(await ba(R.value)).groups||[],le()}catch(t){g.error(t?.message||n("codingAgents.loadProvidersFailed"))}finally{H.value=!1}}function se(){if(C.value)return{mode:"global",profile:R.value};const e=J.value;return{mode:"scoped",profile:R.value,provider:y.value,model:A.value,baseUrl:e?.base_url||"",apiKey:e?.api_key||"",apiMode:T.value}}function U(e,t,a="codingAgents.installFailed"){return e==="node_environment_missing"?n("codingAgents.nodeEnvironmentMissing"):t||n(a)}function ie(e){const t=String(e?.message||""),a=t.indexOf("{");if(a<0)return null;try{const i=JSON.parse(t.slice(a));return i&&typeof i=="object"?i:null}catch{return null}}async function ta(){if(!C.value&&(!y.value||!A.value)){g.error(n("codingAgents.selectProviderModel"));return}E.value=!0;try{q.value=await Ma(D.value,se()),Z.value=q.value.shellCommand,ee.value+=1,L.value=!1,P.value=!0,g.success(n("codingAgents.launchPrepared"))}catch(e){g.error(e?.message||n("codingAgents.launchPrepareFailed"))}finally{E.value=!1}}async function la(){if(!C.value&&(!y.value||!A.value)){g.error(n("codingAgents.selectProviderModel"));return}K.value=!0;try{await Na(D.value,se()),L.value=!1,g.success(n("codingAgents.nativeLaunchStarted"))}catch(e){g.error(e?.message||n("codingAgents.nativeLaunchFailed"))}finally{K.value=!1}}async function na(e){I.value[e]=!0,x.value[e]="",F.value[e]="";try{const t=await Ta(e);if(z.value=t.tools,t.success)g.success(n("codingAgents.installSuccess")),x.value[e]="",F.value[e]="";else{const a=U(t.code,t.message,"codingAgents.installFailed");g.error(a),x.value[e]=n("codingAgents.installFailedHermesHint"),F.value[e]=a}}catch(t){const a=ie(t),i=U(a?.code,a?.message||t?.message,"codingAgents.installFailed");g.error(i),x.value[e]=n("codingAgents.installFailedHermesHint"),F.value[e]=i}finally{I.value[e]=!1}}async function sa(e){j.value[e]=!0;try{const t=await Pa(e);z.value=t.tools,t.success?g.success(n("codingAgents.deleteSuccess")):g.error(U(t.code,t.message,"codingAgents.deleteFailed"))}catch(t){const a=ie(t);g.error(U(a?.code,a?.message||t?.message,"codingAgents.deleteFailed"))}finally{j.value[e]=!1}}return fa(()=>{te(),Q("claude-code",B["claude-code"][0]),Q("codex",B.codex[1])}),(e,t)=>(r(),h("div",ce,[s("header",ge,[s("h2",ve,d(l(n)("codingAgents.title")),1),c(l(w),{size:"small",quaternary:"",loading:k.value,onClick:te},{default:o(()=>[v(d(l(n)("codingAgents.refresh")),1)]),_:1},8,["loading"])]),s("div",fe,[O.value?(r(),f(l(de),{key:0,type:"error",class:"status-alert"},{default:o(()=>[v(d(O.value),1)]),_:1})):m("",!0),s("p",_e,d(l(n)("codingAgents.notice")),1),s("div",pe,[(r(),h($,null,W($e,a=>s("section",{key:a.tool,class:"agent-block"},[s("header",he,[s("img",{class:"agent-logo",src:Ue[a.tool],alt:""},null,8,me),s("div",null,[s("h3",null,d(a.tool),1),c(l(M),{class:"provider-tag",size:"small"},{default:o(()=>[v(d(a.provider),1)]),_:2},1024)])]),s("div",ye,[s("div",Ae,[s("div",Ce,d(l(n)("codingAgents.installStatus")),1),s("div",be,[k.value&&!b(a.id)?(r(),f(l(M),{key:0,size:"small"},{default:o(()=>[v(d(l(n)("codingAgents.checking")),1)]),_:1})):b(a.id)?.installed?(r(),h($,{key:1},[c(l(M),{size:"small",type:"success"},{default:o(()=>[v(d(l(n)("codingAgents.installed")),1)]),_:1}),s("span",we,d(b(a.id)?.version||b(a.id)?.rawVersion),1)],64)):(r(),f(l(M),{key:2,size:"small",type:"warning"},{default:o(()=>[v(d(l(n)("codingAgents.notInstalled")),1)]),_:1}))])]),b(a.id)?.installed?(r(),f(l(w),{key:0,size:"small",type:"error",secondary:"",loading:j.value[a.id],onClick:i=>sa(a.id)},{default:o(()=>[v(d(j.value[a.id]?l(n)("codingAgents.deleting"):l(n)("codingAgents.deleteNow")),1)]),_:2},1032,["loading","onClick"])):(r(),f(l(w),{key:1,size:"small",type:"primary",secondary:"",loading:I.value[a.id],disabled:k.value&&!b(a.id),onClick:i=>na(a.id)},{default:o(()=>[v(d(I.value[a.id]?l(n)("codingAgents.installing"):l(n)("codingAgents.installNow")),1)]),_:2},1032,["loading","disabled","onClick"]))]),x.value[a.id]?(r(),f(l(de),{key:0,class:"install-helper-alert",type:"warning",bordered:!1},{default:o(()=>[s("div",null,d(x.value[a.id]),1),F.value[a.id]?(r(),h("div",xe,d(l(n)("codingAgents.installFailureReason"))+": "+d(F.value[a.id]),1)):m("",!0)]),_:2},1024)):m("",!0),s("div",Fe,[s("div",Se,d(l(n)("codingAgents.configFiles")),1),s("div",Pe,[(r(!0),h($,null,W(Ye(a.id),i=>(r(),h("button",{key:i.key,class:re(["config-file-cell",{active:_.value[a.id].selectedKey===i.key}]),type:"button",onClick:Ua=>Q(a.id,i)},d(i.path),11,Me))),128))])]),s("div",ke,[s("div",Le,[s("span",Te,d(ae(a.id)?.path),1),_.value[a.id].exists===!1?(r(),f(l(M),{key:0,size:"small",type:"warning"},{default:o(()=>[v(d(l(n)("codingAgents.configFileNotCreated")),1)]),_:1})):m("",!0)]),c(l(ue),{show:_.value[a.id].loading},{default:o(()=>[c(l(da),{value:_.value[a.id].content,"onUpdate:value":i=>_.value[a.id].content=i,type:"textarea",class:"config-textarea",disabled:_.value[a.id].loading},null,8,["value","onUpdate:value","disabled"])]),_:2},1032,["show"]),s("div",Be,[c(l(oe),{justify:"end"},{default:o(()=>[c(l(w),{size:"small",type:"primary",loading:_.value[a.id].saving,disabled:_.value[a.id].loading||!Xe(a.id),onClick:i=>Ze(a.id)},{default:o(()=>[v(d(l(n)("files.saveFile")),1)]),_:1},8,["loading","disabled","onClick"]),c(l(w),{size:"small",type:"primary",disabled:!b(a.id)?.installed,onClick:i=>aa(a.id)},{default:o(()=>[v(d(l(n)("codingAgents.launch")),1)]),_:1},8,["disabled","onClick"])]),_:2},1024)])])])),64))])]),c(l(ua),{show:L.value,"onUpdate:show":t[4]||(t[4]=a=>L.value=a),preset:"card",class:"launch-modal",style:{width:"620px",maxWidth:"calc(100vw - 32px)"},title:l(n)("codingAgents.launchTitle"),bordered:!1},{footer:o(()=>[c(l(oe),{justify:"end"},{default:o(()=>[c(l(w),{secondary:"",loading:E.value,disabled:K.value,onClick:ta},{default:o(()=>[v(d(l(n)("codingAgents.builtInTerminal")),1)]),_:1},8,["loading","disabled"]),c(l(w),{type:"primary",loading:K.value,disabled:E.value,onClick:la},{default:o(()=>[v(d(l(n)("codingAgents.nativeTerminal")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:o(()=>[c(l(ue),{show:H.value},{default:o(()=>[c(l(ia),{"label-placement":"top"},{default:o(()=>[c(l(V),{label:l(n)("codingAgents.profileScope")},{default:o(()=>[c(l(M),{size:"small"},{default:o(()=>[v(d(R.value),1)]),_:1})]),_:1},8,["label"]),c(l(V),{label:l(n)("codingAgents.launchModeScope")},{default:o(()=>[c(l(ga),{value:S.value,"onUpdate:value":t[0]||(t[0]=a=>S.value=a),name:"coding-agent-launch-mode","theme-overrides":We},{default:o(()=>[(r(!0),h($,null,W(Qe.value,a=>(r(),f(l(ha),{key:a.value,value:a.value},{default:o(()=>[v(d(a.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"]),C.value?m("",!0):(r(),f(l(V),{key:0,label:l(n)("codingAgents.providerScope")},{default:o(()=>[c(l(Y),{value:y.value,"onUpdate:value":[t[1]||(t[1]=a=>y.value=a),ea],options:Ge.value,placeholder:l(n)("codingAgents.providerPlaceholder"),filterable:""},null,8,["value","options","placeholder"])]),_:1},8,["label"])),C.value?m("",!0):(r(),f(l(V),{key:1,label:l(n)("codingAgents.modelScope")},{default:o(()=>[c(l(Y),{value:A.value,"onUpdate:value":t[2]||(t[2]=a=>A.value=a),options:qe.value,placeholder:l(n)("codingAgents.modelPlaceholder"),filterable:""},null,8,["value","options","placeholder"])]),_:1},8,["label"])),C.value?m("",!0):(r(),f(l(V),{key:2,label:l(n)("codingAgents.protocolScope")},{default:o(()=>[c(l(Y),{value:T.value,"onUpdate:value":t[3]||(t[3]=a=>T.value=a),options:Je.value},null,8,["value","options"])]),_:1},8,["label"]))]),_:1})]),_:1},8,["show"])]),_:1},8,["show","title"]),(r(),f(_a,{to:"body"},[P.value?(r(),h("div",{key:0,class:"drawer-overlay",onClick:t[5]||(t[5]=a=>P.value=!1)})):m("",!0),s("div",{class:re(["drawer-panel",{show:P.value}])},[s("div",Ne,[s("div",Ve,[s("button",Oe,d(l(n)("codingAgents.terminalTitle")),1)]),s("button",{class:"close-button",type:"button",onClick:t[6]||(t[6]=a=>P.value=!1)},[...t[7]||(t[7]=[s("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[s("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),s("div",ze,[s("div",Ie,[(r(),f(Ia,{key:ee.value,visible:P.value,"initial-command":Z.value},null,8,["visible","initial-command"]))])])],2)]))]))}})})),ja=X((()=>{})),Ea,Ka=X((()=>{je(),je(),ja(),Aa(),Ea=Ca(Ee,[["__scopeId","data-v-6e71231c"]])}));Ka();export{Ea as default};
1
+ import{n as X}from"./rolldown-runtime-M0oDzQ_3.js";import{A as ia,Bn as oa,Bt as M,Hn as o,It as da,K as ua,Kt as ra,M as oe,Nn as W,O as V,Ot as w,Rt as de,V as ca,an as s,cn as h,cr as l,ct as ga,er as u,fn as v,g as ue,hn as va,in as p,jn as r,kn as fa,mt as Y,nn as _a,on as f,pn as c,pr as d,sn as m,t as pa,tn as $,ur as re,ut as ha}from"./ui-vendor-DDMfmCj2.js";import{O as ma,k as ya}from"./vue-vendor-BsMpqyaC.js";import{n as Aa,t as Ca}from"./_plugin-vue_export-helper-CvnFozKy.js";import{a as ba,l as wa}from"./system-Onp4yS9N.js";import{$ as xa,Dt as Fa,Et as Sa,Q as Pa,at as Ma,et as ka,it as La,nt as Ta,ot as Ba,rt as Na,st as Va,tt as Oa}from"./index-B2IKGvbR.js";import{n as za,t as Ia}from"./TerminalPanel-gyT2AS7Z.js";var ce,ge,ve,fe,_e,pe,he,me,ye,Ae,Ce,be,we,xe,Fe,Se,Pe,Me,ke,Le,Te,Be,Ne,Ve,Oe,ze,Ie,Ee,je=X((()=>{ra(),pa(),ma(),Oa(),wa(),Sa(),za(),ce={class:"coding-agents-view"},ge={class:"page-header"},ve={class:"header-title"},fe={class:"coding-agents-content"},_e={class:"content-description"},pe={class:"agent-blocks"},he={class:"agent-block-header"},me=["src"],ye={class:"agent-install-state"},Ae={class:"install-state-main"},Ce={class:"install-state-title"},be={class:"install-state-value"},we={class:"version-text"},xe={key:0,class:"install-error-detail"},Fe={class:"config-file-section"},Se={class:"config-file-title"},Pe={class:"config-file-list"},Me=["onClick"],ke={class:"inline-config-editor"},Le={class:"config-editor-meta"},Te={class:"config-editor-path"},Be={class:"config-editor-actions"},Ne={class:"drawer-header"},Ve={class:"drawer-tabs"},Oe={class:"tab-button active",type:"button"},ze={class:"drawer-content"},Ie={class:"drawer-pane"},Ee=va({__name:"CodingAgentsView",setup(Ra){const{t:n}=ya(),g=ca(),Ke=Fa(),k=u(!1),O=u(""),z=u([]),I=u({"claude-code":!1,codex:!1}),x=u({"claude-code":"",codex:""}),F=u({"claude-code":"",codex:""}),j=u({"claude-code":!1,codex:!1}),L=u(!1),H=u(!1),E=u(!1),K=u(!1),D=u("claude-code"),G=u([]),S=u("scoped"),y=u(""),A=u(""),T=u("codex_responses"),q=u(null),P=u(!1),Z=u(""),ee=u(0),Re=new Set(["openai-codex","copilot","xai-oauth","nous","google-gemini-cli","claude-oauth"]),Ue={"Claude Code":"/coding-agents/claude-code.svg",Codex:"/coding-agents/codex-openai.png"},$e=[{id:"claude-code",tool:"Claude Code",provider:"Anthropic"},{id:"codex",tool:"Codex",provider:"OpenAI"}],B={"claude-code":[{key:"settings",path:"~/.claude/settings.json",language:"json"},{key:"mcp",path:"~/.claude.json",language:"json"},{key:"prompt",path:"~/.claude/CLAUDE.md",language:"markdown"}],codex:[{key:"auth",path:"~/.codex/auth.json",language:"json"},{key:"config",path:"~/.codex/config.toml",language:"ini"},{key:"agents",path:"~/.codex/AGENTS.md",language:"markdown"}]},_=u({"claude-code":{selectedKey:"settings",content:"",originalContent:"",loading:!1,saving:!1},codex:{selectedKey:"config",content:"",originalContent:"",loading:!1,saving:!1}}),He=p(()=>z.value.reduce((e,t)=>(e[t.id]=t,e),{})),R=p(()=>Ke.activeProfileName||"default");function De(e){const t=String(e.provider||"").toLowerCase();return Re.has(t)}const N=p(()=>S.value==="scoped"?G.value.filter(e=>!De(e)):G.value),Ge=p(()=>N.value.map(e=>({label:e.label&&e.label!==e.provider?`${e.label} (${e.provider})`:e.provider,value:e.provider}))),J=p(()=>N.value.find(e=>e.provider===y.value)||null),qe=p(()=>J.value?.models.map(e=>({label:e,value:e}))||[]),Je=p(()=>[{label:n("codingAgents.protocolOpenAiChat"),value:"chat_completions"},{label:n("codingAgents.protocolOpenAiResponses"),value:"codex_responses"},{label:n("codingAgents.protocolAnthropicMessages"),value:"anthropic_messages"}]),Qe=p(()=>[{label:n("codingAgents.launchModeGlobal"),value:"global"},{label:n("codingAgents.launchModeScoped"),value:"scoped"}]),We={buttonColorActive:"#111827",buttonTextColorActive:"#fff",buttonBorderColorActive:"#111827",buttonBoxShadow:"inset 0 0 0 1px var(--border-color)",buttonBoxShadowHover:"inset 0 0 0 1px #111827"},C=p(()=>S.value==="global");function b(e){return He.value[e]}function Ye(e){return B[e]}function ae(e){return B[e].find(t=>t.key===_.value[e].selectedKey)||B[e][0]}function Xe(e){const t=_.value[e];return t.content!==t.originalContent}async function te(){k.value=!0,O.value="";try{z.value=(await xa()).tools}catch(e){O.value=e?.message||n("codingAgents.loadFailed")}finally{k.value=!1}}async function Q(e,t){const a=_.value[e];a.selectedKey=t.key,a.loading=!0;try{const i=await Ba(e,t.key);a.content=i.content,a.originalContent=i.content,a.absolutePath=i.absolutePath,a.exists=i.exists}catch(i){g.error(i?.message||n("codingAgents.configLoadFailed"))}finally{a.loading=!1}}async function Ze(e){const t=_.value[e],a=ae(e);if(a){t.saving=!0;try{const i=await Va(e,a.key,t.content);t.originalContent=i.content,t.absolutePath=i.absolutePath,t.exists=i.exists,g.success(n("files.saved"))}catch(i){g.error(i?.message||n("files.saveFailed"))}finally{t.saving=!1}}}function le(){const e=N.value[0];y.value=e?.provider||"",A.value=e?.models[0]||"",T.value=ne(e)}function ea(e){const t=N.value.find(a=>a.provider===e);A.value=t?.models[0]||"",T.value=ne(t)}oa([N,S],()=>{C.value||J.value||le()});function ne(e){return La(e?.api_mode,ka(e?.provider,e?.base_url))}async function aa(e){D.value=e,S.value="scoped",L.value=!0,q.value=null,H.value=!0;try{G.value=(await ba(R.value)).groups||[],le()}catch(t){g.error(t?.message||n("codingAgents.loadProvidersFailed"))}finally{H.value=!1}}function se(){if(C.value)return{mode:"global",profile:R.value};const e=J.value;return{mode:"scoped",profile:R.value,provider:y.value,model:A.value,baseUrl:e?.base_url||"",apiKey:e?.api_key||"",apiMode:T.value}}function U(e,t,a="codingAgents.installFailed"){return e==="node_environment_missing"?n("codingAgents.nodeEnvironmentMissing"):t||n(a)}function ie(e){const t=String(e?.message||""),a=t.indexOf("{");if(a<0)return null;try{const i=JSON.parse(t.slice(a));return i&&typeof i=="object"?i:null}catch{return null}}async function ta(){if(!C.value&&(!y.value||!A.value)){g.error(n("codingAgents.selectProviderModel"));return}E.value=!0;try{q.value=await Ma(D.value,se()),Z.value=q.value.shellCommand,ee.value+=1,L.value=!1,P.value=!0,g.success(n("codingAgents.launchPrepared"))}catch(e){g.error(e?.message||n("codingAgents.launchPrepareFailed"))}finally{E.value=!1}}async function la(){if(!C.value&&(!y.value||!A.value)){g.error(n("codingAgents.selectProviderModel"));return}K.value=!0;try{await Na(D.value,se()),L.value=!1,g.success(n("codingAgents.nativeLaunchStarted"))}catch(e){g.error(e?.message||n("codingAgents.nativeLaunchFailed"))}finally{K.value=!1}}async function na(e){I.value[e]=!0,x.value[e]="",F.value[e]="";try{const t=await Ta(e);if(z.value=t.tools,t.success)g.success(n("codingAgents.installSuccess")),x.value[e]="",F.value[e]="";else{const a=U(t.code,t.message,"codingAgents.installFailed");g.error(a),x.value[e]=n("codingAgents.installFailedHermesHint"),F.value[e]=a}}catch(t){const a=ie(t),i=U(a?.code,a?.message||t?.message,"codingAgents.installFailed");g.error(i),x.value[e]=n("codingAgents.installFailedHermesHint"),F.value[e]=i}finally{I.value[e]=!1}}async function sa(e){j.value[e]=!0;try{const t=await Pa(e);z.value=t.tools,t.success?g.success(n("codingAgents.deleteSuccess")):g.error(U(t.code,t.message,"codingAgents.deleteFailed"))}catch(t){const a=ie(t);g.error(U(a?.code,a?.message||t?.message,"codingAgents.deleteFailed"))}finally{j.value[e]=!1}}return fa(()=>{te(),Q("claude-code",B["claude-code"][0]),Q("codex",B.codex[1])}),(e,t)=>(r(),h("div",ce,[s("header",ge,[s("h2",ve,d(l(n)("codingAgents.title")),1),c(l(w),{size:"small",quaternary:"",loading:k.value,onClick:te},{default:o(()=>[v(d(l(n)("codingAgents.refresh")),1)]),_:1},8,["loading"])]),s("div",fe,[O.value?(r(),f(l(de),{key:0,type:"error",class:"status-alert"},{default:o(()=>[v(d(O.value),1)]),_:1})):m("",!0),s("p",_e,d(l(n)("codingAgents.notice")),1),s("div",pe,[(r(),h($,null,W($e,a=>s("section",{key:a.tool,class:"agent-block"},[s("header",he,[s("img",{class:"agent-logo",src:Ue[a.tool],alt:""},null,8,me),s("div",null,[s("h3",null,d(a.tool),1),c(l(M),{class:"provider-tag",size:"small"},{default:o(()=>[v(d(a.provider),1)]),_:2},1024)])]),s("div",ye,[s("div",Ae,[s("div",Ce,d(l(n)("codingAgents.installStatus")),1),s("div",be,[k.value&&!b(a.id)?(r(),f(l(M),{key:0,size:"small"},{default:o(()=>[v(d(l(n)("codingAgents.checking")),1)]),_:1})):b(a.id)?.installed?(r(),h($,{key:1},[c(l(M),{size:"small",type:"success"},{default:o(()=>[v(d(l(n)("codingAgents.installed")),1)]),_:1}),s("span",we,d(b(a.id)?.version||b(a.id)?.rawVersion),1)],64)):(r(),f(l(M),{key:2,size:"small",type:"warning"},{default:o(()=>[v(d(l(n)("codingAgents.notInstalled")),1)]),_:1}))])]),b(a.id)?.installed?(r(),f(l(w),{key:0,size:"small",type:"error",secondary:"",loading:j.value[a.id],onClick:i=>sa(a.id)},{default:o(()=>[v(d(j.value[a.id]?l(n)("codingAgents.deleting"):l(n)("codingAgents.deleteNow")),1)]),_:2},1032,["loading","onClick"])):(r(),f(l(w),{key:1,size:"small",type:"primary",secondary:"",loading:I.value[a.id],disabled:k.value&&!b(a.id),onClick:i=>na(a.id)},{default:o(()=>[v(d(I.value[a.id]?l(n)("codingAgents.installing"):l(n)("codingAgents.installNow")),1)]),_:2},1032,["loading","disabled","onClick"]))]),x.value[a.id]?(r(),f(l(de),{key:0,class:"install-helper-alert",type:"warning",bordered:!1},{default:o(()=>[s("div",null,d(x.value[a.id]),1),F.value[a.id]?(r(),h("div",xe,d(l(n)("codingAgents.installFailureReason"))+": "+d(F.value[a.id]),1)):m("",!0)]),_:2},1024)):m("",!0),s("div",Fe,[s("div",Se,d(l(n)("codingAgents.configFiles")),1),s("div",Pe,[(r(!0),h($,null,W(Ye(a.id),i=>(r(),h("button",{key:i.key,class:re(["config-file-cell",{active:_.value[a.id].selectedKey===i.key}]),type:"button",onClick:Ua=>Q(a.id,i)},d(i.path),11,Me))),128))])]),s("div",ke,[s("div",Le,[s("span",Te,d(ae(a.id)?.path),1),_.value[a.id].exists===!1?(r(),f(l(M),{key:0,size:"small",type:"warning"},{default:o(()=>[v(d(l(n)("codingAgents.configFileNotCreated")),1)]),_:1})):m("",!0)]),c(l(ue),{show:_.value[a.id].loading},{default:o(()=>[c(l(da),{value:_.value[a.id].content,"onUpdate:value":i=>_.value[a.id].content=i,type:"textarea",class:"config-textarea",disabled:_.value[a.id].loading},null,8,["value","onUpdate:value","disabled"])]),_:2},1032,["show"]),s("div",Be,[c(l(oe),{justify:"end"},{default:o(()=>[c(l(w),{size:"small",type:"primary",loading:_.value[a.id].saving,disabled:_.value[a.id].loading||!Xe(a.id),onClick:i=>Ze(a.id)},{default:o(()=>[v(d(l(n)("files.saveFile")),1)]),_:1},8,["loading","disabled","onClick"]),c(l(w),{size:"small",type:"primary",disabled:!b(a.id)?.installed,onClick:i=>aa(a.id)},{default:o(()=>[v(d(l(n)("codingAgents.launch")),1)]),_:1},8,["disabled","onClick"])]),_:2},1024)])])])),64))])]),c(l(ua),{show:L.value,"onUpdate:show":t[4]||(t[4]=a=>L.value=a),preset:"card",class:"launch-modal",style:{width:"620px",maxWidth:"calc(100vw - 32px)"},title:l(n)("codingAgents.launchTitle"),bordered:!1},{footer:o(()=>[c(l(oe),{justify:"end"},{default:o(()=>[c(l(w),{secondary:"",loading:E.value,disabled:K.value,onClick:ta},{default:o(()=>[v(d(l(n)("codingAgents.builtInTerminal")),1)]),_:1},8,["loading","disabled"]),c(l(w),{type:"primary",loading:K.value,disabled:E.value,onClick:la},{default:o(()=>[v(d(l(n)("codingAgents.nativeTerminal")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:o(()=>[c(l(ue),{show:H.value},{default:o(()=>[c(l(ia),{"label-placement":"top"},{default:o(()=>[c(l(V),{label:l(n)("codingAgents.profileScope")},{default:o(()=>[c(l(M),{size:"small"},{default:o(()=>[v(d(R.value),1)]),_:1})]),_:1},8,["label"]),c(l(V),{label:l(n)("codingAgents.launchModeScope")},{default:o(()=>[c(l(ga),{value:S.value,"onUpdate:value":t[0]||(t[0]=a=>S.value=a),name:"coding-agent-launch-mode","theme-overrides":We},{default:o(()=>[(r(!0),h($,null,W(Qe.value,a=>(r(),f(l(ha),{key:a.value,value:a.value},{default:o(()=>[v(d(a.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"]),C.value?m("",!0):(r(),f(l(V),{key:0,label:l(n)("codingAgents.providerScope")},{default:o(()=>[c(l(Y),{value:y.value,"onUpdate:value":[t[1]||(t[1]=a=>y.value=a),ea],options:Ge.value,placeholder:l(n)("codingAgents.providerPlaceholder"),filterable:""},null,8,["value","options","placeholder"])]),_:1},8,["label"])),C.value?m("",!0):(r(),f(l(V),{key:1,label:l(n)("codingAgents.modelScope")},{default:o(()=>[c(l(Y),{value:A.value,"onUpdate:value":t[2]||(t[2]=a=>A.value=a),options:qe.value,placeholder:l(n)("codingAgents.modelPlaceholder"),filterable:""},null,8,["value","options","placeholder"])]),_:1},8,["label"])),C.value?m("",!0):(r(),f(l(V),{key:2,label:l(n)("codingAgents.protocolScope")},{default:o(()=>[c(l(Y),{value:T.value,"onUpdate:value":t[3]||(t[3]=a=>T.value=a),options:Je.value},null,8,["value","options"])]),_:1},8,["label"]))]),_:1})]),_:1},8,["show"])]),_:1},8,["show","title"]),(r(),f(_a,{to:"body"},[P.value?(r(),h("div",{key:0,class:"drawer-overlay",onClick:t[5]||(t[5]=a=>P.value=!1)})):m("",!0),s("div",{class:re(["drawer-panel",{show:P.value}])},[s("div",Ne,[s("div",Ve,[s("button",Oe,d(l(n)("codingAgents.terminalTitle")),1)]),s("button",{class:"close-button",type:"button",onClick:t[6]||(t[6]=a=>P.value=!1)},[...t[7]||(t[7]=[s("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[s("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),s("div",ze,[s("div",Ie,[(r(),f(Ia,{key:ee.value,visible:P.value,"initial-command":Z.value},null,8,["visible","initial-command"]))])])],2)]))]))}})})),ja=X((()=>{})),Ea,Ka=X((()=>{je(),je(),ja(),Aa(),Ea=Ca(Ee,[["__scopeId","data-v-6e71231c"]])}));Ka();export{Ea as default};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-M0oDzQ_3.js";import{Kt as n,cn as p,hn as s,jn as r,pn as a}from"./ui-vendor-DDMfmCj2.js";import{n as o,t as u}from"./_plugin-vue_export-helper-fFMkIM4P.js";import{n as l,t as d}from"./index-Brl4qW5V.js";var t,i,_=e((()=>{n(),l(),t={class:"desktop-pet-view"},i=s({__name:"DesktopPetView",setup(f){return(k,w)=>(r(),p("main",t,[a(d,{"desktop-window":""})]))}})})),m=e((()=>{})),v,c=e((()=>{_(),_(),m(),o(),v=u(i,[["__scopeId","data-v-8265b18e"]])}));c();export{v as default};
1
+ import{n as e}from"./rolldown-runtime-M0oDzQ_3.js";import{Kt as n,cn as p,hn as s,jn as r,pn as a}from"./ui-vendor-DDMfmCj2.js";import{n as o,t as u}from"./_plugin-vue_export-helper-CvnFozKy.js";import{n as l,t as d}from"./index-B2IKGvbR.js";var t,i,_=e((()=>{n(),l(),t={class:"desktop-pet-view"},i=s({__name:"DesktopPetView",setup(f){return(k,w)=>(r(),p("main",t,[a(d,{"desktop-window":""})]))}})})),m=e((()=>{})),v,c=e((()=>{_(),_(),m(),o(),v=u(i,[["__scopeId","data-v-8265b18e"]])}));c();export{v as default};