@quanthermes/hermes-web-ui 0.6.12 → 0.6.13
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.
- package/bin/hermes-web-ui.mjs +7 -0
- package/dist/client/assets/js/{ChannelsView-BAbGxkKW.js → ChannelsView-BduiL1-M.js} +1 -1
- package/dist/client/assets/js/{ChatView-hdWG7dhS.js → ChatView-C-84i0a3.js} +1 -1
- package/dist/client/assets/js/{CodingAgentsView-BB79rLb_.js → CodingAgentsView-Cu5bfdCo.js} +1 -1
- package/dist/client/assets/js/{DevicesView-DEdHwkrV.js → DevicesView-BwVqTyuH.js} +1 -1
- package/dist/client/assets/js/{FileRenameModal-CdKXqr0a.js → FileRenameModal-DMqVjoLN.js} +1 -1
- package/dist/client/assets/js/{FilesView-C49jsfxy.js → FilesView-Ce30F1_8.js} +1 -1
- package/dist/client/assets/js/{GroupChatView-DwL-zIjT.js → GroupChatView-BQqM5noE.js} +1 -1
- package/dist/client/assets/js/{HistoryMessageList-B1ORl6-d.js → HistoryMessageList-B3TsU-9g.js} +1 -1
- package/dist/client/assets/js/{HistoryView-CdlRAUh5.js → HistoryView-qhTXEU5G.js} +1 -1
- package/dist/client/assets/js/{JobsView-BPZ4Wv0y.js → JobsView-BszCmau_.js} +1 -1
- package/dist/client/assets/js/{KanbanView-UHzayv3c.js → KanbanView-BMa_FMqS.js} +1 -1
- package/dist/client/assets/js/{LoginView-BYrZGFRC.js → LoginView-v4Lvgu2R.js} +1 -1
- package/dist/client/assets/js/{LogsView-CyfCeIeY.js → LogsView-CuwioOCX.js} +1 -1
- package/dist/client/assets/js/{MarkdownRenderer-D-IgakCO.js → MarkdownRenderer-2bwbBjlK.js} +1 -1
- package/dist/client/assets/js/{McpManagerView-DMbmKtiH.js → McpManagerView-BDJSjkHx.js} +1 -1
- package/dist/client/assets/js/{MemoryView-iYE-K13x.js → MemoryView-rYoZbfMb.js} +1 -1
- package/dist/client/assets/js/{MessageItem-Be7fqF3P.js → MessageItem-OSBjfS2l.js} +1 -1
- package/dist/client/assets/js/{ModelsView-XRIIk2f7.js → ModelsView-DGPA2heM.js} +1 -1
- package/dist/client/assets/js/{OutlinePanel-BSPx9YaI.js → OutlinePanel-CN0TVZ0B.js} +1 -1
- package/dist/client/assets/js/{PerformanceView-m3deuRba.js → PerformanceView-0GmZ2GXR.js} +1 -1
- package/dist/client/assets/js/{PluginsView-BBrFPfSn.js → PluginsView-D6XEulKx.js} +1 -1
- package/dist/client/assets/js/{ProfilesView-G_eYB34O.js → ProfilesView-CCPI-DaB.js} +1 -1
- package/dist/client/assets/js/{SettingRow-wqcLQ0FL.js → SettingRow-B0WJ-Iqa.js} +1 -1
- package/dist/client/assets/js/{SettingsView-DMOWr41T.js → SettingsView-BaZ_P8Wu.js} +1 -1
- package/dist/client/assets/js/{SkillsUsageView-fn3jivrH.js → SkillsUsageView-BJVHpo4D.js} +1 -1
- package/dist/client/assets/js/{SkillsView-CXDdZj7R.js → SkillsView-vhxQVIz8.js} +1 -1
- package/dist/client/assets/js/{TerminalPanel-CqIASgSb.js → TerminalPanel-C50X3--t.js} +1 -1
- package/dist/client/assets/js/{TerminalView-ycEOrgth.js → TerminalView-1qIvfZKj.js} +1 -1
- package/dist/client/assets/js/{UsageView-BhNclgOH.js → UsageView-CLUP9AqF.js} +1 -1
- package/dist/client/assets/js/{VersionPreviewView-DoG0hdD2.js → VersionPreviewView-C9I3ZH13.js} +1 -1
- package/dist/client/assets/js/{VirtualMessageList-B_teFrlt.js → VirtualMessageList-D6BvQLbe.js} +1 -1
- package/dist/client/assets/js/{_plugin-vue_export-helper-D4mtpdbl.js → _plugin-vue_export-helper-CtZk2OSc.js} +2 -2
- package/dist/client/assets/js/{index-BHU-82RO.js → index-DyLZQAQu.js} +1 -1
- package/dist/client/assets/js/{models-BX7pr_Gd.js → models-CjHxxDse.js} +1 -1
- package/dist/client/assets/js/{session-browser-prefs-OR-qaA1z.js → session-browser-prefs-kGpZZDQo.js} +1 -1
- package/dist/client/assets/js/{skills-fBzB8FGc.js → skills-CDjYTDMo.js} +1 -1
- package/dist/client/assets/js/{system-vQTkarwT.js → system-Pg8JEuA6.js} +1 -1
- package/dist/client/index.html +3 -3
- package/dist/server/index.js +3 -3
- package/package.json +1 -1
package/bin/hermes-web-ui.mjs
CHANGED
|
@@ -25,6 +25,9 @@ const WEB_UI_DB_FILE = join(WEB_UI_HOME, 'hermes-web-ui.db')
|
|
|
25
25
|
const DEFAULT_PORT = 8648
|
|
26
26
|
const DEFAULT_USERNAME = 'quanthermes'
|
|
27
27
|
const DEFAULT_PASSWORD = '12345678'
|
|
28
|
+
const STOP_POLL_INTERVAL_MS = 100
|
|
29
|
+
const DAEMON_RESTART_GRACE_MS = 5000
|
|
30
|
+
const DAEMON_STOP_GRACE_MS = 15000
|
|
28
31
|
|
|
29
32
|
// 鈹€鈹€鈹€ Auto-fix node-pty native module 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€
|
|
30
33
|
function ensureNativeModules() {
|
|
@@ -747,6 +750,10 @@ function runUpdateInstall(npm) {
|
|
|
747
750
|
})
|
|
748
751
|
}
|
|
749
752
|
|
|
753
|
+
function getDaemonStopGraceMs({ restart } = {}) {
|
|
754
|
+
return restart ? DAEMON_RESTART_GRACE_MS : DAEMON_STOP_GRACE_MS
|
|
755
|
+
}
|
|
756
|
+
|
|
750
757
|
if (process.argv[1] && realpathSync(resolve(process.argv[1])) === __filename) {
|
|
751
758
|
main().catch(err => {
|
|
752
759
|
console.error(` 鉁?${err?.message || err}`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as H}from"./rolldown-runtime-M0oDzQ_3.js";import{$n as S,$t as z,An as o,At as u,Bn as D,Bt as W,Cn as Te,Jn as e,Mt as Be,On as Pe,Pt as Ie,Qt as Re,Xn as te,Yt as C,an as L,bn as Ve,en as Q,g as xe,m as g,nn as _,on as n,sn as F,t as J,tn as b,wn as De,wt as ne,xn as v,yn as Le,z as $e,zn as P}from"./ui-vendor-DNWaqYj5.js";import{c as O,l as j}from"./vue-vendor-VX6KvV1_.js";import{n as E,t as G}from"./_plugin-vue_export-helper-D4mtpdbl.js";import{A as Ne,C as we,D as We,E as Qe,S as ye,T as Fe,X as Je,Y as Oe,k as je}from"./index-BHU-82RO.js";import{n as Ee,t as s}from"./SettingRow-wqcLQ0FL.js";var ie,oe,re,se,qe,de=H((()=>{W(),J(),O(),ie={class:"platform-info"},oe=["innerHTML"],re={class:"platform-name"},se={key:0,class:"platform-card-body"},qe=F({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(A){const h=A,y=D(!0),{t:l}=j(),U=Re(()=>{const k=h.credentials;if(!k)return!1;const w=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[k,k.extra].filter(Boolean).some(M=>w.some(T=>{const q=M[T];return q!=null&&q!==""&&q!==!1}))});return(k,w)=>(v(),_("div",{class:te(["platform-card",{configured:U.value}])},[z("div",{class:"platform-card-header",onClick:w[0]||(w[0]=M=>y.value=!y.value)},[z("div",ie,[z("span",{class:"platform-icon",innerHTML:A.icon},null,8,oe),z("span",re,S(A.name),1),n(e(Ie),{type:U.value?"success":"default",size:"small",round:""},{default:o(()=>[L(S(U.value?e(l)("common.configured"):e(l)("common.notConfigured")),1)]),_:1},8,["type"])]),z("span",{class:te(["expand-icon",{expanded:y.value}])},"▾",2)]),y.value?(v(),_("div",se,[A.exclusive?(v(),Q(e(Be),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[L(S(e(l)("platform.exclusiveTokenWarning")),1)]),_:1})):b("",!0),De(k.$slots,"default",{},void 0,!0)])):b("",!0)],2))}})})),Ge=H((()=>{})),Ce,Ye=H((()=>{de(),de(),Ge(),E(),Ce=G(qe,[["__scopeId","data-v-e27ecbbe"]])})),ue,pe,ce,me,fe,ze,ve=H((()=>{W(),J(),O(),ye(),Qe(),Ye(),Ee(),ue={class:"settings-section"},pe={class:"weixin-qr-section"},ce={key:1,class:"weixin-qr-loading"},me={key:2,class:"weixin-qr-hint"},fe={class:"platform-actions"},ze=F({__name:"PlatformSettings",setup(A){const h=we(),y=$e(),{t:l}=j(),U=P({}),k=P({}),w=P({}),M=P({}),T=P({});function q(i){return JSON.parse(JSON.stringify(i||{}))}function $(i,a){for(const[m,t]of Object.entries(a))t&&typeof t=="object"&&!Array.isArray(t)?i[m]=$({...i[m]||{}},t):i[m]=t;return i}function p(i){return k[i]||(k[i]=q(h[i])),k[i]}function d(i){return w[i]||(w[i]=q(B(i))),w[i]}function c(i,a){k[i]=$({...p(i)},a),M[i]=!0}function f(i,a){w[i]=$({...d(i)},a),T[i]=!0}function Y(i,a){return JSON.stringify(i||{})===JSON.stringify(a||{})}function X(i){return!!M[i]&&!!k[i]&&!Y(k[i],h[i])}function K(i){return!!T[i]&&!!w[i]&&!Y(w[i],B(i))}function Se(i){return X(i)||K(i)}function r(i){return!!U[i]}async function Me(i){U[i]=!0;try{const a=X(i),m=K(i);a&&await h.saveSection(i,p(i),{restart:!m}),m&&(await je(i,d(i)),await h.fetchSettings()),k[i]=q(h[i]),w[i]=q(B(i)),M[i]=!1,T[i]=!1,y.success(l("settings.saved"))}catch(a){y.error(a?.message||l("settings.saveFailed"))}finally{U[i]=!1}}function B(i){return h.platforms[i]||{}}function Z(i){return i===!0||i==="true"}const ee=D(""),I=D(""),x=D("idle");let R=null;async function Ae(){x.value="loading",ee.value="",I.value="",ae();try{const i=await Fe();I.value=i.qrcode,ee.value=i.qrcode_url,window.open(i.qrcode_url,"_blank"),x.value="waiting",V()}catch(i){x.value="error",y.error(i.message||l("platform.qrFetching"))}}function V(){I.value&&(R=setTimeout(async()=>{try{const i=await We(I.value);i.status==="wait"?V():i.status==="scaned"?(x.value="scaned",V()):i.status==="expired"?x.value="expired":i.status==="confirmed"&&(x.value="confirmed",await Ne({account_id:i.account_id,token:i.token,base_url:i.base_url}),await h.fetchSettings(),y.success(l("settings.saved")))}catch{V()}},3e3))}function ae(){R&&(clearTimeout(R),R=null)}Ve(()=>{ae()});const le=[{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 Pe(()=>le.map(i=>({key:i.key,config:h[i.key],credentials:B(i.key)})),i=>{for(const a of i)M[a.key]||(k[a.key]=q(a.config)),T[a.key]||(w[a.key]=q(a.credentials))},{deep:!0,immediate:!0}),(i,a)=>(v(),_("section",ue,[(v(),_(C,null,Te(le,m=>n(Ce,{key:m.key,name:m.name,icon:m.icon,exclusive:m.exclusive,config:e(h)[m.key],credentials:B(m.key)},{default:o(()=>[m.key==="telegram"?(v(),_(C,{key:0},[n(s,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("telegram").token||"",loading:r("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...","onUpdate:value":a[0]||(a[0]=t=>f("telegram",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("telegram").require_mention,loading:r("telegram"),"onUpdate:value":a[1]||(a[1]=t=>c("telegram",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.reactions"),hint:e(l)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:p("telegram").reactions,loading:r("telegram"),"onUpdate:value":a[2]||(a[2]=t=>c("telegram",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("telegram").free_response_chats||"",loading:r("telegram"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":a[3]||(a[3]=t=>c("telegram",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.mentionPatterns"),hint:e(l)("platform.mentionPatternsHint")},{default:o(()=>[n(e(u),{value:(p("telegram").mention_patterns||[]).join(", "),loading:r("telegram"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":a[4]||(a[4]=t=>c("telegram",{mention_patterns:t?t.split(",").map(N=>N.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="discord"?(v(),_(C,{key:1},[n(s,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("discord").token||"",loading:r("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...","onUpdate:value":a[5]||(a[5]=t=>f("discord",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:p("discord").require_mention,loading:r("discord"),"onUpdate:value":a[6]||(a[6]=t=>c("discord",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.autoThread"),hint:e(l)("platform.autoThreadHint")},{default:o(()=>[n(e(g),{value:p("discord").auto_thread,loading:r("discord"),"onUpdate:value":a[7]||(a[7]=t=>c("discord",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.reactions"),hint:e(l)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:p("discord").reactions,loading:r("discord"),"onUpdate:value":a[8]||(a[8]=t=>c("discord",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChannels"),hint:e(l)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").free_response_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[9]||(a[9]=t=>c("discord",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowedChannels"),hint:e(l)("platform.allowedChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").allowed_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[10]||(a[10]=t=>c("discord",{allowed_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.ignoredChannels"),hint:e(l)("platform.ignoredChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").ignored_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[11]||(a[11]=t=>c("discord",{ignored_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.noThreadChannels"),hint:e(l)("platform.noThreadChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").no_thread_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[12]||(a[12]=t=>c("discord",{no_thread_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="slack"?(v(),_(C,{key:2},[n(s,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("slack").token||"",loading:r("slack"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...","onUpdate:value":a[13]||(a[13]=t=>f("slack",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:p("slack").require_mention,loading:r("slack"),"onUpdate:value":a[14]||(a[14]=t=>c("slack",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowBots"),hint:e(l)("platform.allowBotsHint")},{default:o(()=>[n(e(g),{value:p("slack").allow_bots,loading:r("slack"),"onUpdate:value":a[15]||(a[15]=t=>c("slack",{allow_bots:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChannels"),hint:e(l)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(u),{value:p("slack").free_response_channels||"",loading:r("slack"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[16]||(a[16]=t=>c("slack",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="whatsapp"?(v(),_(C,{key:3},[n(s,{label:e(l)("platform.waEnabled"),hint:e(l)("platform.waEnabledHint")},{default:o(()=>[n(e(g),{value:d("whatsapp").enabled,loading:r("whatsapp"),"onUpdate:value":a[17]||(a[17]=t=>f("whatsapp",{enabled:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("whatsapp").require_mention,loading:r("whatsapp"),"onUpdate:value":a[18]||(a[18]=t=>c("whatsapp",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("whatsapp").free_response_chats||"",loading:r("whatsapp"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":a[19]||(a[19]=t=>c("whatsapp",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.mentionPatterns"),hint:e(l)("platform.mentionPatternsHint")},{default:o(()=>[n(e(u),{value:(p("whatsapp").mention_patterns||[]).join(", "),loading:r("whatsapp"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":a[20]||(a[20]=t=>c("whatsapp",{mention_patterns:t?t.split(",").map(N=>N.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="matrix"?(v(),_(C,{key:4},[n(s,{label:e(l)("platform.accessToken"),hint:e(l)("platform.accessTokenHint")},{default:o(()=>[n(e(u),{value:d("matrix").token||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...","onUpdate:value":a[21]||(a[21]=t=>f("matrix",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.homeserver"),hint:e(l)("platform.homeserverHint")},{default:o(()=>[n(e(u),{value:d("matrix").extra?.homeserver||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org","onUpdate:value":a[22]||(a[22]=t=>f("matrix",{extra:{...d("matrix").extra,homeserver:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionRoom")},{default:o(()=>[n(e(g),{value:p("matrix").require_mention,loading:r("matrix"),"onUpdate:value":a[23]||(a[23]=t=>c("matrix",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.autoThread"),hint:e(l)("platform.autoThreadHintRoom")},{default:o(()=>[n(e(g),{value:p("matrix").auto_thread,loading:r("matrix"),"onUpdate:value":a[24]||(a[24]=t=>c("matrix",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.dmMentionThreads"),hint:e(l)("platform.dmMentionThreadsHint")},{default:o(()=>[n(e(g),{value:p("matrix").dm_mention_threads,loading:r("matrix"),"onUpdate:value":a[25]||(a[25]=t=>c("matrix",{dm_mention_threads:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseRooms"),hint:e(l)("platform.freeResponseRoomsHint")},{default:o(()=>[n(e(u),{value:p("matrix").free_response_rooms||"",loading:r("matrix"),size:"small",placeholder:"room_id1,room_id2","onUpdate:value":a[26]||(a[26]=t=>c("matrix",{free_response_rooms:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="feishu"?(v(),_(C,{key:5},[n(s,{label:e(l)("platform.appId"),hint:e(l)("platform.appIdHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.app_id||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...","onUpdate:value":a[27]||(a[27]=t=>f("feishu",{extra:{...d("feishu").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.appSecret"),hint:e(l)("platform.appSecretHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.app_secret||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":a[28]||(a[28]=t=>f("feishu",{extra:{...d("feishu").extra,app_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("feishu").require_mention,loading:r("feishu"),"onUpdate:value":a[29]||(a[29]=t=>c("feishu",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("feishu").free_response_chats||"",loading:r("feishu"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":a[30]||(a[30]=t=>c("feishu",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="dingtalk"?(v(),_(C,{key:6},[n(s,{label:e(l)("platform.clientId"),hint:e(l)("platform.clientIdHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.client_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID","onUpdate:value":a[31]||(a[31]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,client_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.clientSecret"),hint:e(l)("platform.clientSecretHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.client_secret||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret","onUpdate:value":a[32]||(a[32]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.cardTemplateId"),hint:e(l)("platform.cardTemplateIdHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.card_template_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"AI Card Template ID","onUpdate:value":a[33]||(a[33]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,card_template_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowAllUsers"),hint:e(l)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(d("dingtalk").allow_all_users),loading:r("dingtalk"),"onUpdate:value":a[34]||(a[34]=t=>f("dingtalk",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowedUsers"),hint:e(l)("platform.allowedUsersHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").allowed_users||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2","onUpdate:value":a[35]||(a[35]=t=>f("dingtalk",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("dingtalk").require_mention,loading:r("dingtalk"),"onUpdate:value":a[36]||(a[36]=t=>c("dingtalk",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("dingtalk").free_response_chats||"",loading:r("dingtalk"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":a[37]||(a[37]=t=>c("dingtalk",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="qqbot"?(v(),_(C,{key:7},[n(s,{label:e(l)("platform.qqAppId"),hint:e(l)("platform.qqAppIdHint")},{default:o(()=>[n(e(u),{value:d("qqbot").extra?.app_id||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID","onUpdate:value":a[38]||(a[38]=t=>f("qqbot",{extra:{...d("qqbot").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.qqAppSecret"),hint:e(l)("platform.qqAppSecretHint")},{default:o(()=>[n(e(u),{value:d("qqbot").extra?.client_secret||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":a[39]||(a[39]=t=>f("qqbot",{extra:{...d("qqbot").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowedUsers"),hint:e(l)("platform.allowedUsersHint")},{default:o(()=>[n(e(u),{value:d("qqbot").allowed_users||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2","onUpdate:value":a[40]||(a[40]=t=>f("qqbot",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowAllUsers"),hint:e(l)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(d("qqbot").allow_all_users),loading:r("qqbot"),"onUpdate:value":a[41]||(a[41]=t=>f("qqbot",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.qqMarkdown"),hint:e(l)("platform.qqMarkdownHint")},{default:o(()=>[n(e(g),{value:p("qqbot").extra?.markdown_support??!0,loading:r("qqbot"),"onUpdate:value":a[42]||(a[42]=t=>c("qqbot",{extra:{...p("qqbot").extra,markdown_support:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="weixin"?(v(),_(C,{key:8},[z("div",pe,[x.value==="idle"||x.value==="error"||x.value==="expired"||x.value==="confirmed"?(v(),Q(e(ne),{key:0,type:"primary",size:"small",onClick:Ae},{default:o(()=>[L(S(x.value==="confirmed"?e(l)("platform.qrRelogin"):e(l)("platform.qrLogin")),1)]),_:1})):b("",!0),x.value==="loading"?(v(),_("div",ce,[n(e(xe),{size:"small"}),z("span",null,S(e(l)("platform.qrFetching")),1)])):b("",!0),x.value==="waiting"||x.value==="scaned"?(v(),_("div",me,S(x.value==="scaned"?e(l)("platform.qrScanedHint"):e(l)("platform.qrScanHint")),1)):b("",!0)]),n(s,{label:e(l)("platform.weixinToken"),hint:e(l)("platform.weixinTokenHint")},{default:o(()=>[n(e(u),{value:d("weixin").token||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Token","onUpdate:value":a[43]||(a[43]=t=>f("weixin",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.accountId"),hint:e(l)("platform.accountIdHint")},{default:o(()=>[n(e(u),{value:d("weixin").extra?.account_id||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID","onUpdate:value":a[44]||(a[44]=t=>f("weixin",{extra:{...d("weixin").extra,account_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="wecom"?(v(),_(C,{key:9},[n(s,{label:e(l)("platform.botId"),hint:e(l)("platform.botIdHint")},{default:o(()=>[n(e(u),{value:d("wecom").extra?.bot_id||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID","onUpdate:value":a[45]||(a[45]=t=>f("wecom",{extra:{...d("wecom").extra,bot_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.appSecret"),hint:e(l)("platform.wecomSecretHint")},{default:o(()=>[n(e(u),{value:d("wecom").extra?.secret||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret","onUpdate:value":a[46]||(a[46]=t=>f("wecom",{extra:{...d("wecom").extra,secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),z("div",fe,[n(e(ne),{type:"primary",size:"small",loading:r(m.key),disabled:!Se(m.key),onClick:t=>Me(m.key)},{default:o(()=>[L(S(e(l)("common.save")),1)]),_:1},8,["loading","disabled","onClick"])])]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))]))}})})),Xe=H((()=>{})),Ue,Ke=H((()=>{ve(),ve(),Xe(),E(),Ue=G(ze,[["__scopeId","data-v-f6e465ec"]])})),ge,_e,he,be,He,ke=H((()=>{W(),J(),O(),ye(),Oe(),Ke(),ge={class:"channels-view"},_e={class:"page-header"},he={class:"header-title"},be={class:"channels-content"},He=F({__name:"ChannelsView",setup(A){const h=we(),y=Je(),{t:l}=j();async function U(){(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles(),await h.fetchSettings()}return Le(()=>{U()}),(k,w)=>(v(),_("div",ge,[z("header",_e,[z("h2",he,S(e(l)("sidebar.channels")),1)]),z("div",be,[n(e(xe),{show:e(h).loading||e(h).saving,size:"large",description:e(l)("common.loading")},{default:o(()=>[e(h).loading?b("",!0):(v(),Q(Ue,{key:0}))]),_:1},8,["show","description"])])]))}})})),Ze=H((()=>{})),ea,aa=H((()=>{ke(),ke(),Ze(),E(),ea=G(He,[["__scopeId","data-v-2a2475d5"]])}));aa();export{ea as default};
|
|
1
|
+
import{n as H}from"./rolldown-runtime-M0oDzQ_3.js";import{$n as S,$t as z,An as o,At as u,Bn as D,Bt as W,Cn as Te,Jn as e,Mt as Be,On as Pe,Pt as Ie,Qt as Re,Xn as te,Yt as C,an as L,bn as Ve,en as Q,g as xe,m as g,nn as _,on as n,sn as F,t as J,tn as b,wn as De,wt as ne,xn as v,yn as Le,z as $e,zn as P}from"./ui-vendor-DNWaqYj5.js";import{c as O,l as j}from"./vue-vendor-VX6KvV1_.js";import{n as E,t as G}from"./_plugin-vue_export-helper-CtZk2OSc.js";import{A as Ne,C as we,D as We,E as Qe,S as ye,T as Fe,X as Je,Y as Oe,k as je}from"./index-DyLZQAQu.js";import{n as Ee,t as s}from"./SettingRow-B0WJ-Iqa.js";var ie,oe,re,se,qe,de=H((()=>{W(),J(),O(),ie={class:"platform-info"},oe=["innerHTML"],re={class:"platform-name"},se={key:0,class:"platform-card-body"},qe=F({__name:"PlatformCard",props:{name:{},icon:{},config:{},credentials:{},exclusive:{type:Boolean}},setup(A){const h=A,y=D(!0),{t:l}=j(),U=Re(()=>{const k=h.credentials;if(!k)return!1;const w=["token","api_key","app_id","client_id","secret","app_secret","client_secret","access_token","bot_id","account_id","enabled"];return[k,k.extra].filter(Boolean).some(M=>w.some(T=>{const q=M[T];return q!=null&&q!==""&&q!==!1}))});return(k,w)=>(v(),_("div",{class:te(["platform-card",{configured:U.value}])},[z("div",{class:"platform-card-header",onClick:w[0]||(w[0]=M=>y.value=!y.value)},[z("div",ie,[z("span",{class:"platform-icon",innerHTML:A.icon},null,8,oe),z("span",re,S(A.name),1),n(e(Ie),{type:U.value?"success":"default",size:"small",round:""},{default:o(()=>[L(S(U.value?e(l)("common.configured"):e(l)("common.notConfigured")),1)]),_:1},8,["type"])]),z("span",{class:te(["expand-icon",{expanded:y.value}])},"▾",2)]),y.value?(v(),_("div",se,[A.exclusive?(v(),Q(e(Be),{key:0,type:"warning","show-icon":!0,class:"exclusive-alert"},{default:o(()=>[L(S(e(l)("platform.exclusiveTokenWarning")),1)]),_:1})):b("",!0),De(k.$slots,"default",{},void 0,!0)])):b("",!0)],2))}})})),Ge=H((()=>{})),Ce,Ye=H((()=>{de(),de(),Ge(),E(),Ce=G(qe,[["__scopeId","data-v-e27ecbbe"]])})),ue,pe,ce,me,fe,ze,ve=H((()=>{W(),J(),O(),ye(),Qe(),Ye(),Ee(),ue={class:"settings-section"},pe={class:"weixin-qr-section"},ce={key:1,class:"weixin-qr-loading"},me={key:2,class:"weixin-qr-hint"},fe={class:"platform-actions"},ze=F({__name:"PlatformSettings",setup(A){const h=we(),y=$e(),{t:l}=j(),U=P({}),k=P({}),w=P({}),M=P({}),T=P({});function q(i){return JSON.parse(JSON.stringify(i||{}))}function $(i,a){for(const[m,t]of Object.entries(a))t&&typeof t=="object"&&!Array.isArray(t)?i[m]=$({...i[m]||{}},t):i[m]=t;return i}function p(i){return k[i]||(k[i]=q(h[i])),k[i]}function d(i){return w[i]||(w[i]=q(B(i))),w[i]}function c(i,a){k[i]=$({...p(i)},a),M[i]=!0}function f(i,a){w[i]=$({...d(i)},a),T[i]=!0}function Y(i,a){return JSON.stringify(i||{})===JSON.stringify(a||{})}function X(i){return!!M[i]&&!!k[i]&&!Y(k[i],h[i])}function K(i){return!!T[i]&&!!w[i]&&!Y(w[i],B(i))}function Se(i){return X(i)||K(i)}function r(i){return!!U[i]}async function Me(i){U[i]=!0;try{const a=X(i),m=K(i);a&&await h.saveSection(i,p(i),{restart:!m}),m&&(await je(i,d(i)),await h.fetchSettings()),k[i]=q(h[i]),w[i]=q(B(i)),M[i]=!1,T[i]=!1,y.success(l("settings.saved"))}catch(a){y.error(a?.message||l("settings.saveFailed"))}finally{U[i]=!1}}function B(i){return h.platforms[i]||{}}function Z(i){return i===!0||i==="true"}const ee=D(""),I=D(""),x=D("idle");let R=null;async function Ae(){x.value="loading",ee.value="",I.value="",ae();try{const i=await Fe();I.value=i.qrcode,ee.value=i.qrcode_url,window.open(i.qrcode_url,"_blank"),x.value="waiting",V()}catch(i){x.value="error",y.error(i.message||l("platform.qrFetching"))}}function V(){I.value&&(R=setTimeout(async()=>{try{const i=await We(I.value);i.status==="wait"?V():i.status==="scaned"?(x.value="scaned",V()):i.status==="expired"?x.value="expired":i.status==="confirmed"&&(x.value="confirmed",await Ne({account_id:i.account_id,token:i.token,base_url:i.base_url}),await h.fetchSettings(),y.success(l("settings.saved")))}catch{V()}},3e3))}function ae(){R&&(clearTimeout(R),R=null)}Ve(()=>{ae()});const le=[{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 Pe(()=>le.map(i=>({key:i.key,config:h[i.key],credentials:B(i.key)})),i=>{for(const a of i)M[a.key]||(k[a.key]=q(a.config)),T[a.key]||(w[a.key]=q(a.credentials))},{deep:!0,immediate:!0}),(i,a)=>(v(),_("section",ue,[(v(),_(C,null,Te(le,m=>n(Ce,{key:m.key,name:m.name,icon:m.icon,exclusive:m.exclusive,config:e(h)[m.key],credentials:B(m.key)},{default:o(()=>[m.key==="telegram"?(v(),_(C,{key:0},[n(s,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("telegram").token||"",loading:r("telegram"),clearable:"",size:"small",class:"input-lg",placeholder:"123456:ABC-DEF...","onUpdate:value":a[0]||(a[0]=t=>f("telegram",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("telegram").require_mention,loading:r("telegram"),"onUpdate:value":a[1]||(a[1]=t=>c("telegram",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.reactions"),hint:e(l)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:p("telegram").reactions,loading:r("telegram"),"onUpdate:value":a[2]||(a[2]=t=>c("telegram",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("telegram").free_response_chats||"",loading:r("telegram"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":a[3]||(a[3]=t=>c("telegram",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.mentionPatterns"),hint:e(l)("platform.mentionPatternsHint")},{default:o(()=>[n(e(u),{value:(p("telegram").mention_patterns||[]).join(", "),loading:r("telegram"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":a[4]||(a[4]=t=>c("telegram",{mention_patterns:t?t.split(",").map(N=>N.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="discord"?(v(),_(C,{key:1},[n(s,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("discord").token||"",loading:r("discord"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot token...","onUpdate:value":a[5]||(a[5]=t=>f("discord",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:p("discord").require_mention,loading:r("discord"),"onUpdate:value":a[6]||(a[6]=t=>c("discord",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.autoThread"),hint:e(l)("platform.autoThreadHint")},{default:o(()=>[n(e(g),{value:p("discord").auto_thread,loading:r("discord"),"onUpdate:value":a[7]||(a[7]=t=>c("discord",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.reactions"),hint:e(l)("platform.reactionsHint")},{default:o(()=>[n(e(g),{value:p("discord").reactions,loading:r("discord"),"onUpdate:value":a[8]||(a[8]=t=>c("discord",{reactions:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChannels"),hint:e(l)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").free_response_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[9]||(a[9]=t=>c("discord",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowedChannels"),hint:e(l)("platform.allowedChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").allowed_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[10]||(a[10]=t=>c("discord",{allowed_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.ignoredChannels"),hint:e(l)("platform.ignoredChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").ignored_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[11]||(a[11]=t=>c("discord",{ignored_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.noThreadChannels"),hint:e(l)("platform.noThreadChannelsHint")},{default:o(()=>[n(e(u),{value:p("discord").no_thread_channels||"",loading:r("discord"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[12]||(a[12]=t=>c("discord",{no_thread_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="slack"?(v(),_(C,{key:2},[n(s,{label:e(l)("platform.botToken"),hint:e(l)("platform.botTokenHint")},{default:o(()=>[n(e(u),{value:d("slack").token||"",loading:r("slack"),clearable:"",size:"small",class:"input-lg",placeholder:"xoxb-...","onUpdate:value":a[13]||(a[13]=t=>f("slack",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionChannel")},{default:o(()=>[n(e(g),{value:p("slack").require_mention,loading:r("slack"),"onUpdate:value":a[14]||(a[14]=t=>c("slack",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowBots"),hint:e(l)("platform.allowBotsHint")},{default:o(()=>[n(e(g),{value:p("slack").allow_bots,loading:r("slack"),"onUpdate:value":a[15]||(a[15]=t=>c("slack",{allow_bots:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChannels"),hint:e(l)("platform.freeResponseChannelsHint")},{default:o(()=>[n(e(u),{value:p("slack").free_response_channels||"",loading:r("slack"),size:"small",placeholder:"channel_id1,channel_id2","onUpdate:value":a[16]||(a[16]=t=>c("slack",{free_response_channels:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="whatsapp"?(v(),_(C,{key:3},[n(s,{label:e(l)("platform.waEnabled"),hint:e(l)("platform.waEnabledHint")},{default:o(()=>[n(e(g),{value:d("whatsapp").enabled,loading:r("whatsapp"),"onUpdate:value":a[17]||(a[17]=t=>f("whatsapp",{enabled:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("whatsapp").require_mention,loading:r("whatsapp"),"onUpdate:value":a[18]||(a[18]=t=>c("whatsapp",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("whatsapp").free_response_chats||"",loading:r("whatsapp"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":a[19]||(a[19]=t=>c("whatsapp",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.mentionPatterns"),hint:e(l)("platform.mentionPatternsHint")},{default:o(()=>[n(e(u),{value:(p("whatsapp").mention_patterns||[]).join(", "),loading:r("whatsapp"),size:"small",placeholder:"pattern1, pattern2","onUpdate:value":a[20]||(a[20]=t=>c("whatsapp",{mention_patterns:t?t.split(",").map(N=>N.trim()):[]}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="matrix"?(v(),_(C,{key:4},[n(s,{label:e(l)("platform.accessToken"),hint:e(l)("platform.accessTokenHint")},{default:o(()=>[n(e(u),{value:d("matrix").token||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"syt_...","onUpdate:value":a[21]||(a[21]=t=>f("matrix",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.homeserver"),hint:e(l)("platform.homeserverHint")},{default:o(()=>[n(e(u),{value:d("matrix").extra?.homeserver||"",loading:r("matrix"),clearable:"",size:"small",class:"input-lg",placeholder:"https://matrix.org","onUpdate:value":a[22]||(a[22]=t=>f("matrix",{extra:{...d("matrix").extra,homeserver:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionRoom")},{default:o(()=>[n(e(g),{value:p("matrix").require_mention,loading:r("matrix"),"onUpdate:value":a[23]||(a[23]=t=>c("matrix",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.autoThread"),hint:e(l)("platform.autoThreadHintRoom")},{default:o(()=>[n(e(g),{value:p("matrix").auto_thread,loading:r("matrix"),"onUpdate:value":a[24]||(a[24]=t=>c("matrix",{auto_thread:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.dmMentionThreads"),hint:e(l)("platform.dmMentionThreadsHint")},{default:o(()=>[n(e(g),{value:p("matrix").dm_mention_threads,loading:r("matrix"),"onUpdate:value":a[25]||(a[25]=t=>c("matrix",{dm_mention_threads:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseRooms"),hint:e(l)("platform.freeResponseRoomsHint")},{default:o(()=>[n(e(u),{value:p("matrix").free_response_rooms||"",loading:r("matrix"),size:"small",placeholder:"room_id1,room_id2","onUpdate:value":a[26]||(a[26]=t=>c("matrix",{free_response_rooms:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="feishu"?(v(),_(C,{key:5},[n(s,{label:e(l)("platform.appId"),hint:e(l)("platform.appIdHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.app_id||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"cli_...","onUpdate:value":a[27]||(a[27]=t=>f("feishu",{extra:{...d("feishu").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.appSecret"),hint:e(l)("platform.appSecretHint")},{default:o(()=>[n(e(u),{value:d("feishu").extra?.app_secret||"",loading:r("feishu"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":a[28]||(a[28]=t=>f("feishu",{extra:{...d("feishu").extra,app_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("feishu").require_mention,loading:r("feishu"),"onUpdate:value":a[29]||(a[29]=t=>c("feishu",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("feishu").free_response_chats||"",loading:r("feishu"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":a[30]||(a[30]=t=>c("feishu",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="dingtalk"?(v(),_(C,{key:6},[n(s,{label:e(l)("platform.clientId"),hint:e(l)("platform.clientIdHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.client_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client ID","onUpdate:value":a[31]||(a[31]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,client_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.clientSecret"),hint:e(l)("platform.clientSecretHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.client_secret||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"Client Secret","onUpdate:value":a[32]||(a[32]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.cardTemplateId"),hint:e(l)("platform.cardTemplateIdHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").extra?.card_template_id||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"AI Card Template ID","onUpdate:value":a[33]||(a[33]=t=>f("dingtalk",{extra:{...d("dingtalk").extra,card_template_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowAllUsers"),hint:e(l)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(d("dingtalk").allow_all_users),loading:r("dingtalk"),"onUpdate:value":a[34]||(a[34]=t=>f("dingtalk",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowedUsers"),hint:e(l)("platform.allowedUsersHint")},{default:o(()=>[n(e(u),{value:d("dingtalk").allowed_users||"",loading:r("dingtalk"),clearable:"",size:"small",class:"input-lg",placeholder:"user_id1,user_id2","onUpdate:value":a[35]||(a[35]=t=>f("dingtalk",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.requireMention"),hint:e(l)("platform.requireMentionGroup")},{default:o(()=>[n(e(g),{value:p("dingtalk").require_mention,loading:r("dingtalk"),"onUpdate:value":a[36]||(a[36]=t=>c("dingtalk",{require_mention:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.freeResponseChats"),hint:e(l)("platform.freeResponseChatsHint")},{default:o(()=>[n(e(u),{value:p("dingtalk").free_response_chats||"",loading:r("dingtalk"),size:"small",placeholder:"chat_id1,chat_id2","onUpdate:value":a[37]||(a[37]=t=>c("dingtalk",{free_response_chats:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="qqbot"?(v(),_(C,{key:7},[n(s,{label:e(l)("platform.qqAppId"),hint:e(l)("platform.qqAppIdHint")},{default:o(()=>[n(e(u),{value:d("qqbot").extra?.app_id||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App ID","onUpdate:value":a[38]||(a[38]=t=>f("qqbot",{extra:{...d("qqbot").extra,app_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.qqAppSecret"),hint:e(l)("platform.qqAppSecretHint")},{default:o(()=>[n(e(u),{value:d("qqbot").extra?.client_secret||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"App Secret","onUpdate:value":a[39]||(a[39]=t=>f("qqbot",{extra:{...d("qqbot").extra,client_secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowedUsers"),hint:e(l)("platform.allowedUsersHint")},{default:o(()=>[n(e(u),{value:d("qqbot").allowed_users||"",loading:r("qqbot"),clearable:"",size:"small",class:"input-lg",placeholder:"openid1,openid2","onUpdate:value":a[40]||(a[40]=t=>f("qqbot",{allowed_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.allowAllUsers"),hint:e(l)("platform.allowAllUsersHint")},{default:o(()=>[n(e(g),{value:Z(d("qqbot").allow_all_users),loading:r("qqbot"),"onUpdate:value":a[41]||(a[41]=t=>f("qqbot",{allow_all_users:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.qqMarkdown"),hint:e(l)("platform.qqMarkdownHint")},{default:o(()=>[n(e(g),{value:p("qqbot").extra?.markdown_support??!0,loading:r("qqbot"),"onUpdate:value":a[42]||(a[42]=t=>c("qqbot",{extra:{...p("qqbot").extra,markdown_support:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="weixin"?(v(),_(C,{key:8},[z("div",pe,[x.value==="idle"||x.value==="error"||x.value==="expired"||x.value==="confirmed"?(v(),Q(e(ne),{key:0,type:"primary",size:"small",onClick:Ae},{default:o(()=>[L(S(x.value==="confirmed"?e(l)("platform.qrRelogin"):e(l)("platform.qrLogin")),1)]),_:1})):b("",!0),x.value==="loading"?(v(),_("div",ce,[n(e(xe),{size:"small"}),z("span",null,S(e(l)("platform.qrFetching")),1)])):b("",!0),x.value==="waiting"||x.value==="scaned"?(v(),_("div",me,S(x.value==="scaned"?e(l)("platform.qrScanedHint"):e(l)("platform.qrScanHint")),1)):b("",!0)]),n(s,{label:e(l)("platform.weixinToken"),hint:e(l)("platform.weixinTokenHint")},{default:o(()=>[n(e(u),{value:d("weixin").token||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Token","onUpdate:value":a[43]||(a[43]=t=>f("weixin",{token:t}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.accountId"),hint:e(l)("platform.accountIdHint")},{default:o(()=>[n(e(u),{value:d("weixin").extra?.account_id||"",loading:r("weixin"),clearable:"",size:"small",class:"input-lg",placeholder:"Account ID","onUpdate:value":a[44]||(a[44]=t=>f("weixin",{extra:{...d("weixin").extra,account_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),m.key==="wecom"?(v(),_(C,{key:9},[n(s,{label:e(l)("platform.botId"),hint:e(l)("platform.botIdHint")},{default:o(()=>[n(e(u),{value:d("wecom").extra?.bot_id||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Bot ID","onUpdate:value":a[45]||(a[45]=t=>f("wecom",{extra:{...d("wecom").extra,bot_id:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"]),n(s,{label:e(l)("platform.appSecret"),hint:e(l)("platform.wecomSecretHint")},{default:o(()=>[n(e(u),{value:d("wecom").extra?.secret||"",loading:r("wecom"),clearable:"",size:"small",class:"input-lg",placeholder:"Secret","onUpdate:value":a[46]||(a[46]=t=>f("wecom",{extra:{...d("wecom").extra,secret:t}}))},null,8,["value","loading"])]),_:1},8,["label","hint"])],64)):b("",!0),z("div",fe,[n(e(ne),{type:"primary",size:"small",loading:r(m.key),disabled:!Se(m.key),onClick:t=>Me(m.key)},{default:o(()=>[L(S(e(l)("common.save")),1)]),_:1},8,["loading","disabled","onClick"])])]),_:2},1032,["name","icon","exclusive","config","credentials"])),64))]))}})})),Xe=H((()=>{})),Ue,Ke=H((()=>{ve(),ve(),Xe(),E(),Ue=G(ze,[["__scopeId","data-v-f6e465ec"]])})),ge,_e,he,be,He,ke=H((()=>{W(),J(),O(),ye(),Oe(),Ke(),ge={class:"channels-view"},_e={class:"page-header"},he={class:"header-title"},be={class:"channels-content"},He=F({__name:"ChannelsView",setup(A){const h=we(),y=Je(),{t:l}=j();async function U(){(!y.activeProfileName||y.profiles.length===0)&&await y.fetchProfiles(),await h.fetchSettings()}return Le(()=>{U()}),(k,w)=>(v(),_("div",ge,[z("header",_e,[z("h2",he,S(e(l)("sidebar.channels")),1)]),z("div",be,[n(e(xe),{show:e(h).loading||e(h).saving,size:"large",description:e(l)("common.loading")},{default:o(()=>[e(h).loading?b("",!0):(v(),Q(Ue,{key:0}))]),_:1},8,["show","description"])])]))}})})),Ze=H((()=>{})),ea,aa=H((()=>{ke(),ke(),Ze(),E(),ea=G(He,[["__scopeId","data-v-2a2475d5"]])}));aa();export{ea as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as q}from"./rolldown-runtime-M0oDzQ_3.js";import{$n as d,$t as e,An as w,At as ot,Bn as h,Bt as de,Cn as ee,Gt as Do,Ht as Tt,Jn as t,Jt as Yl,Kt as Ft,On as Q,Qn as rt,Qt as $,S as Ao,W as qe,Xn as X,Xt as Ro,Yt as G,_n as zo,an as E,bn as dt,en as j,et as No,ft as Ue,g as Uo,hn as Fe,in as qo,it as Te,jn as ut,m as Oo,nn as c,on as k,qt as Kt,sn as ce,t as ct,tn as y,w as Eo,wt as O,xn as n,yn as ue,z as Jl}from"./ui-vendor-DNWaqYj5.js";import{c as ge,f as Zl,l as ye,m as eo,p as Vo}from"./vue-vendor-VX6KvV1_.js";import{d as vt,l as Lt,n as ve,t as pe}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{n as q}from"./rolldown-runtime-M0oDzQ_3.js";import{$n as d,$t as e,An as w,At as ot,Bn as h,Bt as de,Cn as ee,Gt as Do,Ht as Tt,Jn as t,Jt as Yl,Kt as Ft,On as Q,Qn as rt,Qt as $,S as Ao,W as qe,Xn as X,Xt as Ro,Yt as G,_n as zo,an as E,bn as dt,en as j,et as No,ft as Ue,g as Uo,hn as Fe,in as qo,it as Te,jn as ut,m as Oo,nn as c,on as k,qt as Kt,sn as ce,t as ct,tn as y,w as Eo,wt as O,xn as n,yn as ue,z as Jl}from"./ui-vendor-DNWaqYj5.js";import{c as ge,f as Zl,l as ye,m as eo,p as Vo}from"./vue-vendor-VX6KvV1_.js";import{d as vt,l as Lt,n as ve,t as pe}from"./_plugin-vue_export-helper-CtZk2OSc.js";import{$ as Ho,C as Ko,F as jo,G as Go,K as Wo,L as Qo,Q as pt,R as Xo,S as Yo,W as to,X as Bt,Y as Dt,Z as ht,_ as ft,et as Jo,tt as Zo,v as mt}from"./index-DyLZQAQu.js";import{n as en,t as tn}from"./session-browser-prefs-kGpZZDQo.js";import{n as sn,t as jt}from"./clipboard-1NPxC3YL.js";import{i as so,n as an,r as ao,t as ln}from"./VirtualMessageList-D6BvQLbe.js";import{a as Gt,i as on,n as nn,o as Wt,r as Qt,s as rn,t as un}from"./OutlinePanel-CN0TVZ0B.js";import{n as dn,t as cn}from"./MessageItem-OSBjfS2l.js";import{n as vn,t as pn}from"./TerminalPanel-C50X3--t.js";import{_ as hn,a as fn,b as mn,c as _n,d as gn,f as yn,g as wn,h as kn,i as Sn,l as xn,m as Cn,n as bn,o as Mn,p as $n,r as Pn,s as In,t as Tn,u as Fn,v as Ln,y as Bn}from"./FileRenameModal-DMqVjoLN.js";var Xt,Yt,Jt,Zt,es,ts,ss,as,ls,os,ns,is,lo,rs=q((()=>{de(),ct(),ge(),Lt(),Xt={class:"folder-picker"},Yt={key:0,class:"folder-picker-loading"},Jt={key:1,class:"folder-tree"},Zt={class:"folder-name"},es=["onClick"],ts=["onClick"],ss=["onClick"],as={class:"folder-empty-text"},ls={key:0,class:"folder-empty"},os={key:2,class:"folder-selected"},ns={class:"folder-selected-label"},is={class:"folder-selected-path"},lo=ce({__name:"FolderPicker",props:{modelValue:{}},emits:["update:modelValue"],setup(V,{emit:u}){const i=V,B=u,{t:p}=ye(),x=h(!1),_=h(""),r=h([]),C=h(new Set),D=h(new Map),P=h(new Set),U=h(i.modelValue||"");Q(()=>i.modelValue,S=>{U.value=S||""});async function A(S=""){try{return await vt(`/api/hermes/workspace/folders${S?`?path=${encodeURIComponent(S)}`:""}`)}catch{return null}}ue(async()=>{x.value=!0;const S=await A();S&&(_.value=S.base,r.value=S.folders),x.value=!1});async function L(S){if(C.value.has(S.path)){C.value.delete(S.path),C.value=new Set(C.value);return}if(C.value.add(S.path),C.value=new Set(C.value),!D.value.has(S.path)){P.value.add(S.path),P.value=new Set(P.value);const R=await A(S.path);D.value.set(S.path,R?.folders||[]),D.value=new Map(D.value),P.value.delete(S.path),P.value=new Set(P.value)}}function b(S){const R=`${_.value}/${S.path}`;U.value=R,B("update:modelValue",R)}function H(){U.value=_.value,B("update:modelValue",_.value)}const K=$(()=>{const S=[];function R(I,N){for(const z of I){const M=C.value.has(z.path),J=P.value.has(z.path),v=D.value.get(z.path);S.push({folder:z,depth:N,isExpanded:M,isLoading:J,hasChildren:v?v.length>0:null}),M&&v&&v.length>0&&R(v,N+1)}}return R(r.value,0),S});return(S,R)=>(n(),c("div",Xt,[x.value?(n(),c("div",Yt,[k(t(Uo),{size:"small"})])):(n(),c("div",Jt,[e("div",{class:X(["folder-item root",{selected:U.value===_.value}]),onClick:H},[R[0]||(R[0]=e("span",{class:"folder-icon"},"📂",-1)),e("span",Zt,d(_.value||"/"),1)],2),(n(!0),c(G,null,ee(K.value,I=>(n(),c("div",{key:I.folder.path,class:X(["folder-item",{selected:U.value===`${_.value}/${I.folder.path}`}]),style:rt({paddingLeft:`${12+I.depth*16}px`})},[e("span",{class:"folder-expand",onClick:Yl(N=>L(I.folder),["stop"])},[I.isLoading?(n(),c(G,{key:0},[E("⏳")],64)):(n(),c(G,{key:1},[E(d(I.isExpanded?"▼":"▶"),1)],64))],8,es),e("span",{class:"folder-icon",onClick:N=>b(I.folder)},"📁",8,ts),e("span",{class:"folder-name",onClick:N=>b(I.folder)},d(I.folder.name),9,ss)],6))),128)),(n(!0),c(G,null,ee(K.value,I=>(n(),c(G,{key:"empty-"+I.folder.path},[I.isExpanded&&!I.isLoading&&I.hasChildren===!1?(n(),c("div",{key:0,class:"folder-item empty",style:rt({paddingLeft:`${28+I.depth*16}px`})},[e("span",as,d(t(p)("chat.folderPickerEmpty")),1)],4)):y("",!0)],64))),128)),r.value.length===0&&!x.value?(n(),c("div",ls,d(t(p)("chat.folderPickerNoFolders")),1)):y("",!0)])),U.value?(n(),c("div",os,[e("span",ns,d(t(p)("chat.folderPickerSelected")),1),e("span",is,d(U.value),1)])):y("",!0)]))}})})),Dn=q((()=>{})),oo,An=q((()=>{rs(),rs(),Dn(),ve(),oo=pe(lo,[["__scopeId","data-v-e6f0ab47"]])}));async function Rn(V,u,i){return(await vt(`/api/hermes/model-context/${encodeURIComponent(V)}/${encodeURIComponent(u)}`,{method:"PUT",body:JSON.stringify({provider:V,model:u,context_limit:i})})).data}var zn=q((()=>{Lt()})),us,ds,cs,vs,ps,hs,fs,ms,_s,gs,ys,ws,ks,Ss,xs,Cs,bs,Ms,$s,Ps,nt,Is,no,Ts=q((()=>{de(),ft(),ht(),Dt(),to(),zn(),ct(),ge(),ao(),us={class:"chat-input-area"},ds={class:"input-top-bar"},cs={class:"auto-play-speech-switch"},vs={key:1,class:"context-bar"},ps={key:0,class:"attachment-previews"},hs=["src","alt"],fs={key:1,class:"attachment-file"},ms={class:"file-name"},_s={class:"file-size"},gs=["onClick"],ys=["placeholder"],ws=["onMousedown","onMouseenter"],ks={class:"slash-command-name"},Ss={key:0,class:"slash-command-args"},xs={class:"slash-command-desc"},Cs={class:"input-actions"},bs={class:"context-edit-content"},Ms={style:{"margin-bottom":"16px",color:"#666"}},$s={style:{"margin-top":"12px","font-size":"12px",color:"#999"}},Ps={style:{display:"flex","justify-content":"flex-end",gap:"8px"}},nt="hermes_chat_input_drafts_v1",Is=256e3,no=ce({__name:"ChatInput",setup(V){const u=mt(),i=pt(),B=Bt(),{t:p}=ye(),x=Jl(),{toolTraceVisible:_,toggleToolTraceVisible:r}=so(),C=h(""),D=h(),P=h(),U=h(),A=h([]),L=h(!1),b=h(0),H=h(!1),K=$(()=>[{name:"usage",args:"",description:p("chat.slashCommands.usage")},{name:"status",args:"",description:p("chat.slashCommands.status")},{name:"abort",args:"",description:p("chat.slashCommands.abort")},{name:"queue",args:p("chat.slashCommandArgs.message"),description:p("chat.slashCommands.queue")},{name:"plan",args:p("chat.slashCommandArgs.text"),description:p("chat.slashCommands.plan")},{name:"goal",args:p("chat.slashCommandArgs.text"),description:p("chat.slashCommands.goal")},{name:"goal",args:"status",insertText:"goal status",description:p("chat.slashCommands.goalStatus")},{name:"goal",args:"pause",insertText:"goal pause",description:p("chat.slashCommands.goalPause")},{name:"goal",args:"resume",insertText:"goal resume",description:p("chat.slashCommands.goalResume")},{name:"goal",args:"done",insertText:"goal done",description:p("chat.slashCommands.goalDone")},{name:"goal",args:"clear",insertText:"goal clear",description:p("chat.slashCommands.goalClear")},{name:"subgoal",args:p("chat.slashCommandArgs.text"),description:p("chat.slashCommands.subgoal")},{name:"clear",args:"",description:p("chat.slashCommands.clear")},{name:"clear",args:"--history",insertText:"clear --history",description:p("chat.slashCommands.clearHistory")},{name:"title",args:p("chat.slashCommandArgs.title"),description:p("chat.slashCommands.title")},{name:"compress",args:"",description:p("chat.slashCommands.compress")},{name:"steer",args:p("chat.slashCommandArgs.text"),description:p("chat.slashCommands.steer")},{name:"destroy",args:"",description:p("chat.slashCommands.destroy")},{name:"reload-mcp",args:"",description:p("chat.slashCommands.reloadMcp")}]),S=h(!1),R=h(""),I=h(0),N=$(()=>u.activeSession?.source==="cli"),z=$(()=>{const l=R.value.toLowerCase();return K.value.filter(f=>f.name.includes(l)||f.insertText?.includes(l))}),M=h(null);function J(l){l.preventDefault();const f=D.value;if(!f)return;const g=f.clientHeight,se=l.clientY;function ie(W){const bt=g-(W.clientY-se);M.value=Math.max(20,Math.min(400,Math.round(bt)))}function Xe(){document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",Xe),document.body.style.cursor="",document.body.style.userSelect=""}document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",ie),document.addEventListener("mouseup",Xe)}const v=h(!1);function m(){try{const l=JSON.parse(localStorage.getItem(nt)||"{}");return l&&typeof l=="object"&&!Array.isArray(l)?l:{}}catch{return{}}}function T(){return u.activeSessionId||u.activeSession?.id||""}function te(){const l=T();C.value=l&&m()[l]||""}function we(l){const f=T();if(!f)return;const g=m();l?g[f]=l:delete g[f],Object.keys(g).length>0?localStorage.setItem(nt,JSON.stringify(g)):localStorage.removeItem(nt)}ue(()=>{te();const l=localStorage.getItem("autoPlaySpeech");l!==null&&(v.value=l==="true",u.setAutoPlaySpeech(v.value))}),Q(v,l=>{localStorage.setItem("autoPlaySpeech",String(l)),u.setAutoPlaySpeech(l)}),Q(C,l=>{we(l)}),Q(()=>u.activeSession?.id,()=>{te()});const _t=$(()=>C.value.trim()||A.value.length>0);function Oe(){Fe(()=>{P.value&&P.value.querySelector(".active")?.scrollIntoView({block:"nearest",behavior:"instant"})})}function Ee(){if(!N.value){S.value=!1;return}const l=D.value;if(!l)return;const f=l.selectionStart,g=C.value.slice(0,f);if(!g.startsWith("/")||g.includes(" ")||g.includes(`
|
|
2
2
|
`)){S.value=!1;return}R.value=g.slice(1),I.value=0,S.value=z.value.length>0}function Le(l){C.value=`/${l.insertText||l.name} `,S.value=!1,Fe(()=>{const f=D.value;if(!f)return;const g=C.value.length;f.setSelectionRange(g,g),f.focus()})}const ae=h(256e3);let ke="",Se="",he=null;const fe=h(!1),Y=h(256e3),xe=h(!1);async function me(){Y.value=ae.value,fe.value=!0}async function Ce(){if(!Y.value||Y.value<=0){x.error(p("chat.contextEditInvalid"));return}xe.value=!0;try{const l=u.activeSession?.provider||i.selectedProvider||"",f=u.activeSession?.model||i.selectedModel||"";if(!l||!f){x.error(p("chat.contextEditFailed"));return}await Rn(l,f,Y.value),ae.value=Y.value,ke=oe(),fe.value=!1,x.success(p("chat.contextEditSuccess"))}catch(l){x.error(`${p("chat.contextEditFailed")}: ${l.message||""}`)}finally{xe.value=!1}}function be(){const l=u.activeSession;return{profile:l?.profile||B.activeProfileName||void 0,provider:l?.provider||void 0,model:l?.model||void 0}}function oe(){const l=be();return`${l.profile||""}|${l.provider||""}|${l.model||""}`}async function ne(){const l=oe();if(l!==ke)return l===Se&&he||(Se=l,he=(async()=>{const f=be();try{const g=await Xo(f.profile,f.provider,f.model);if(oe()!==l)return;ae.value=g,ke=l}catch{if(oe()!==l)return;ae.value=Is,ke=l}finally{Se===l&&(he=null,Se="")}})()),he}ue(ne),Q(()=>[B.activeProfileName,i.selectedProvider,i.selectedModel,u.activeSession?.id,u.activeSession?.profile,u.activeSession?.provider,u.activeSession?.model],ne,{flush:"post"});const Z=$(()=>{const l=u.activeSession?.contextTokens;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:(u.activeSession?.inputTokens??0)+(u.activeSession?.outputTokens??0)}),re=$(()=>Math.max(0,ae.value-Z.value)),le=$(()=>Math.min(Z.value/ae.value*100,100));function _e(l){return l>=1e6?(l/1e6).toFixed(1)+"M":l>=1e3?(l/1e3).toFixed(1)+"k":String(l)}function Me(l){if(A.value.find(se=>se.name===l.name))return;const f=Date.now().toString(36)+Math.random().toString(36).slice(2,8),g=URL.createObjectURL(l);A.value.push({id:f,name:l.name,type:l.type,size:l.size,url:g,file:l})}function gt(){U.value?.click()}function Ve(l){const f=l.target;if(f.files){for(const g of f.files)Me(g);f.value=""}}function yt(l){const f=Array.from(l.clipboardData?.items||[]).filter(g=>g.type.startsWith("image/"));if(f.length){l.preventDefault();for(const g of f){const se=g.getAsFile();if(!se)continue;const ie=g.type.split("/")[1]||"png";Me(new File([se],`pasted-${Date.now()}.${ie}`,{type:g.type}))}}}function He(l){l.preventDefault()}function Ke(l){l.preventDefault(),l.dataTransfer?.types.includes("Files")&&(b.value++,L.value=!0)}function je(){b.value--,b.value<=0&&(b.value=0,L.value=!1)}function wt(l){l.preventDefault(),b.value=0,L.value=!1;const f=Array.from(l.dataTransfer?.files||[]);if(f.length){for(const g of f)Me(g);D.value?.focus()}}function Ge(){const l=C.value.trim();!l&&A.value.length===0||(u.sendMessage(l,A.value.length>0?A.value:void 0),C.value="",we(""),A.value=[],S.value=!1,D.value&&(D.value.style.height="auto"))}function kt(){H.value=!0}function $e(){requestAnimationFrame(()=>{H.value=!1,Ee()})}function St(l){return H.value||l.isComposing||l.keyCode===229}function xt(l){if(S.value&&z.value.length>0){if(l.key==="ArrowDown"){l.preventDefault(),I.value=(I.value+1)%z.value.length,Oe();return}if(l.key==="ArrowUp"){l.preventDefault(),I.value=(I.value-1+z.value.length)%z.value.length,Oe();return}if(l.key==="Enter"||l.key==="Tab"){l.preventDefault(),Le(z.value[I.value]);return}if(l.key==="Escape"){l.preventDefault(),S.value=!1;return}}l.key!=="Enter"||l.shiftKey||St(l)||(l.preventDefault(),Ge())}function Ct(l){const f=l.target;H.value||Ee(),M.value===null&&(f.style.height="auto",f.style.height=Math.min(f.scrollHeight,100)+"px")}function We(l){I.value=l}function Be(l){if(!S.value)return;const f=l.target;!f.closest(".slash-command-dropdown")&&!f.closest(".input-wrapper")&&(S.value=!1)}ue(()=>{document.addEventListener("mousedown",Be)}),dt(()=>{document.removeEventListener("mousedown",Be)});function Qe(l){const f=A.value.findIndex(g=>g.id===l);f!==-1&&(URL.revokeObjectURL(A.value[f].url),A.value.splice(f,1))}function Pe(l){return l<1024?l+" B":l<1024*1024?(l/1024).toFixed(1)+" KB":(l/(1024*1024)).toFixed(1)+" MB"}function De(l){return l.startsWith("image/")}return(l,f)=>(n(),c("div",us,[e("div",ds,[k(t(Te),{trigger:"hover"},{trigger:w(()=>[k(t(O),{quaternary:"",size:"tiny",onClick:gt,circle:""},{icon:w(()=>[...f[6]||(f[6]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)])]),_:1})]),default:w(()=>[E(" "+d(t(p)("chat.attachFiles")),1)]),_:1}),e("div",cs,[k(t(Te),{trigger:"hover"},{trigger:w(()=>[...f[7]||(f[7]=[e("div",{class:"switch-label"},[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("polygon",{points:"5 3 19 12 5 21 5 3"})])],-1)])]),default:w(()=>[E(" "+d(t(p)("chat.autoPlaySpeech")),1)]),_:1}),k(t(Oo),{size:"small",value:v.value,"onUpdate:value":f[0]||(f[0]=g=>v.value=g),round:!1},null,8,["value"])]),k(t(Te),{trigger:"hover"},{trigger:w(()=>[k(t(O),{quaternary:"",size:"tiny",class:X(["tool-trace-toggle",{active:t(_)}]),"aria-label":t(_)?t(p)("chat.hideToolCalls"):t(p)("chat.showToolCalls"),onClick:t(r)},{default:w(()=>[...f[8]||(f[8]=[e("svg",{class:"tool-trace-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M14.7 6.3a4.5 4.5 0 0 0-5.8 5.8L3.5 17.5a2.1 2.1 0 0 0 3 3l5.4-5.4a4.5 4.5 0 0 0 5.8-5.8l-3 3-3-3 3-3z"})],-1)])]),_:1},8,["class","aria-label","onClick"])]),default:w(()=>[E(" "+d(t(_)?t(p)("chat.hideToolCalls"):t(p)("chat.showToolCalls")),1)]),_:1}),Z.value>0?(n(),c("span",{key:0,class:X(["context-info",{"context-warning":le.value>80}])},[E(d(_e(Z.value))+" / ",1),k(t(Te),{trigger:"hover"},{trigger:w(()=>[e("span",{class:"context-limit-editable",onClick:me},d(_e(ae.value)),1)]),default:w(()=>[e("span",null,d(t(p)("chat.contextClickToEdit")),1)]),_:1}),E(" · "+d(t(p)("chat.contextRemaining"))+" "+d(_e(re.value)),1)],2)):y("",!0),Z.value>0?(n(),c("div",vs,[e("div",{class:X(["context-bar-fill",{"context-bar-warn":le.value>60&&le.value<=80,"context-bar-danger":le.value>80}]),style:rt({width:`${le.value}%`})},null,6)])):y("",!0)]),A.value.length>0?(n(),c("div",ps,[(n(!0),c(G,null,ee(A.value,g=>(n(),c("div",{key:g.id,class:X(["attachment-preview",{image:De(g.type)}])},[De(g.type)?(n(),c("img",{key:0,src:g.url,alt:g.name,class:"attachment-thumb"},null,8,hs)):(n(),c("div",fs,[f[9]||(f[9]=e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e("polyline",{points:"14 2 14 8 20 8"})],-1)),e("span",ms,d(g.name),1),e("span",_s,d(Pe(g.size)),1)])),e("button",{class:"attachment-remove",onClick:se=>Qe(g.id)},[...f[10]||(f[10]=[e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,gs)],2))),128))])):y("",!0),e("div",{class:X(["input-wrapper",{"drag-over":L.value}]),onDragover:He,onDragenter:Ke,onDragleave:je,onDrop:wt},[e("input",{ref_key:"fileInputRef",ref:U,type:"file",multiple:"",class:"file-input-hidden",onChange:Ve},null,544),e("div",{class:"resize-handle",onMousedown:J},null,32),ut(e("textarea",{ref_key:"textareaRef",ref:D,"onUpdate:modelValue":f[1]||(f[1]=g=>C.value=g),class:"input-textarea",style:rt(M.value?{height:M.value+"px"}:{}),placeholder:t(p)("chat.inputPlaceholder"),rows:"1",onKeydown:xt,onCompositionstart:kt,onCompositionend:$e,onInput:Ct,onPaste:yt},null,44,ys),[[Do,C.value]]),k(Tt,{name:"dropdown-fade"},{default:w(()=>[S.value&&z.value.length>0?(n(),c("div",{key:0,ref_key:"commandDropdownRef",ref:P,class:"slash-command-dropdown"},[(n(!0),c(G,null,ee(z.value,(g,se)=>(n(),c("div",{key:g.name,class:X(["slash-command-item",{active:se===I.value}]),onMousedown:Yl(ie=>Le(g),["prevent"]),onMouseenter:ie=>We(se)},[e("span",ks,"/"+d(g.name),1),g.args?(n(),c("span",Ss,d(g.args),1)):y("",!0),e("span",xs,d(g.description),1)],42,ws))),128))],512)):y("",!0)]),_:1}),e("div",Cs,[t(u).isStreaming?(n(),j(t(O),{key:0,size:"small",type:"error",disabled:t(u).isAborting,onClick:f[2]||(f[2]=g=>t(u).stopStreaming())},{default:w(()=>[E(d(t(p)("chat.stop")),1)]),_:1},8,["disabled"])):y("",!0),k(t(O),{size:"small",type:"primary",disabled:!_t.value,onClick:Ge},{icon:w(()=>[...f[11]||(f[11]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),e("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})],-1)])]),default:w(()=>[E(" "+d(t(p)("chat.send")),1)]),_:1},8,["disabled"])])],34),k(t(qe),{show:fe.value,"onUpdate:show":f[5]||(f[5]=g=>fe.value=g),title:t(p)("chat.contextEditTitle"),"mask-closable":!0,preset:"card",style:{width:"400px"}},{footer:w(()=>[e("div",Ps,[k(t(O),{onClick:f[4]||(f[4]=g=>fe.value=!1),disabled:xe.value},{default:w(()=>[E(d(t(p)("chat.contextEditCancel")),1)]),_:1},8,["disabled"]),k(t(O),{type:"primary",onClick:Ce,loading:xe.value},{default:w(()=>[E(d(t(p)("chat.contextEditSave")),1)]),_:1},8,["loading"])])]),default:w(()=>[e("div",bs,[e("p",Ms,d(t(p)("chat.contextEditDesc")),1),k(t(Eo),{value:Y.value,"onUpdate:value":f[3]||(f[3]=g=>Y.value=g),min:1e3,max:1e7,step:1e3,"show-button":!1,placeholder:t(p)("chat.contextEditPlaceholder"),style:{width:"100%"}},{suffix:w(()=>[...f[12]||(f[12]=[e("span",{style:{color:"#999"}},"tokens",-1)])]),_:1},8,["value","placeholder"]),e("div",$s,d(t(p)("chat.contextEditHint")),1)])]),_:1},8,["show","title"])]))}})})),Nn=q((()=>{})),io,Un=q((()=>{Ts(),Ts(),Nn(),ve(),io=pe(no,[["__scopeId","data-v-6ed921c3"]])}));async function qn(V={}){const u=new URLSearchParams;return V.humanOnly===!1&&u.set("humanOnly","false"),V.source&&u.set("source",V.source),V.limit!=null&&u.set("limit",String(V.limit)),(await vt(`/api/hermes/sessions/conversations${u.toString()?`?${u.toString()}`:""}`)).sessions}async function On(V,u={}){const i=new URLSearchParams;u.humanOnly===!1&&i.set("humanOnly","false"),u.source&&i.set("source",u.source);const B=i.toString()?`?${i.toString()}`:"";return vt(`/api/hermes/sessions/conversations/${encodeURIComponent(V)}/messages${B}`)}var En=q((()=>{Lt()})),Fs,Ls,Bs,Ds,As,Rs,zs,Ns,Us,qs,Os,Es,Vs,Hs,Ks,js,Gs,Ws,Qs,Xs,Ys,Js,ro,Zs=q((()=>{de(),En(),rn(),ht(),ge(),Fs={class:"conversation-monitor"},Ls={class:"conversation-monitor__sidebar"},Bs={key:0,class:"conversation-monitor__empty"},Ds={key:1,class:"conversation-monitor__empty"},As=["aria-pressed","onClick"],Rs={class:"conversation-monitor__session-title-row"},zs={class:"conversation-monitor__session-title"},Ns={key:0,class:"conversation-monitor__session-live"},Us={class:"conversation-monitor__session-meta"},qs={key:0,class:"conversation-monitor__session-preview"},Os={class:"conversation-monitor__detail"},Es={key:0,class:"conversation-monitor__detail-header"},Vs={class:"conversation-monitor__detail-title"},Hs={class:"conversation-monitor__detail-meta"},Ks=["title"],js={key:1,class:"conversation-monitor__empty conversation-monitor__empty--error"},Gs={key:2,class:"conversation-monitor__empty"},Ws={key:3,class:"conversation-monitor__empty"},Qs={key:4,class:"conversation-monitor__messages"},Xs={class:"conversation-monitor__message-meta"},Ys={class:"conversation-monitor__message-content"},Js=15e3,ro=ce({__name:"ConversationMonitorPane",props:{humanOnly:{type:Boolean}},setup(V){const u=V,{t:i}=ye(),B=pt(),p=h([]),x=h(null),_=h(null),r=h(!1),C=h(!1),D=h("");let P=null,U=0,A=0;const L=$(()=>p.value.find(N=>N.id===x.value)||null),b=$(()=>L.value?.model?B.displayModelName(L.value.model,L.value.provider):"");function H(N){return i(N==="user"?"chat.monitorRoleUser":"chat.monitorRoleAssistant")}function K(N){return i("chat.linkedSessions",{count:N})}function S(){U+=1,A+=1}async function R(N=!1){const z=++U;N||(r.value=!0,D.value="");try{const M=await qn({humanOnly:u.humanOnly});if(z!==U)return;if(p.value=M,!M.length){x.value=null,_.value=null;return}(!x.value||!M.some(J=>J.id===x.value))&&(x.value=M[0].id)}catch(M){if(z!==U||N)return;D.value=M?.message||String(M),p.value=[],x.value=null,_.value=null}finally{!N&&z===U&&(r.value=!1)}}async function I(N,z=!1){const M=++A;if(!N){_.value=null;return}const J=u.humanOnly;z||(C.value=!0,D.value="");try{const v=await On(N,{humanOnly:J});if(M!==A||N!==x.value||J!==u.humanOnly)return;_.value=v}catch(v){if(M!==A||z)return;D.value=v?.message||String(v),_.value=null}finally{!z&&M===A&&(C.value=!1)}}return Q(x,async N=>{await I(N,!1)}),Q(()=>u.humanOnly,async()=>{S(),x.value=null,_.value=null,await R(!1)}),ue(async()=>{await R(!1),P=setInterval(async()=>{await R(!0),x.value&&await I(x.value,!0)},Js)}),dt(()=>{S(),P&&clearInterval(P)}),(N,z)=>(n(),c("div",Fs,[e("aside",Ls,[r.value&&p.value.length===0?(n(),c("div",Bs,d(t(i)("common.loading")),1)):p.value.length===0?(n(),c("div",Ds,d(t(i)("chat.noSessions")),1)):y("",!0),(n(!0),c(G,null,ee(p.value,M=>(n(),c("button",{key:M.id,class:X(["conversation-monitor__session",{active:M.id===x.value}]),"aria-pressed":M.id===x.value,onClick:J=>x.value=M.id},[e("div",Rs,[e("span",zs,d(M.title||M.preview||M.id),1),M.is_active?(n(),c("span",Ns,d(t(i)("chat.recentBadge")),1)):y("",!0)]),e("div",Us,d(t(Wt)(M.source))+" · "+d(t(Gt)(M.last_active)),1),M.preview?(n(),c("div",qs,d(M.preview),1)):y("",!0)],10,As))),128))]),e("section",Os,[L.value?(n(),c("header",Es,[e("div",Vs,d(L.value.title||L.value.preview||L.value.id),1),e("div",Hs,[e("span",null,d(t(Wt)(L.value.source)),1),z[0]||(z[0]=e("span",null,"·",-1)),e("span",{title:L.value.model},d(b.value),9,Ks),z[1]||(z[1]=e("span",null,"·",-1)),e("span",null,d(K(L.value.thread_session_count)),1)])])):y("",!0),D.value?(n(),c("div",js,d(D.value),1)):C.value&&!_.value?(n(),c("div",Gs,d(t(i)("common.loading")),1)):!_.value||_.value.messages.length===0?(n(),c("div",Ws,d(t(i)("chat.noVisibleMessages")),1)):(n(),c("div",Qs,[(n(!0),c(G,null,ee(_.value.messages,M=>(n(),c("article",{key:`${M.session_id}-${M.id}`,class:X(["conversation-monitor__message",`role-${M.role}`])},[e("div",Xs,d(H(M.role))+" · "+d(t(Gt)(M.timestamp)),1),e("div",Ys,d(M.content),1)],2))),128))]))])]))}})})),Vn=q((()=>{})),uo,Hn=q((()=>{Zs(),Zs(),Vn(),ve(),uo=pe(ro,[["__scopeId","data-v-71fcd8c4"]])})),co,Kn=q((()=>{co="/assets/gif/thinking-light-DQ8oyIIA.gif"})),vo,jn=q((()=>{vo="/assets/gif/thinking-dark-D3nwXrFU.gif"})),ea,ta,sa,aa,la,oa,na,ia,ra,ua,da,ca,va,pa,ha,fa,ma,_a,ga,ya,wa,ka,Sa,xa,Ca,ba,Ma,$a,It,po,Pa=q((()=>{de(),Zo(),ge(),an(),dn(),ft(),Kn(),jn(),Ho(),ao(),ea={class:"empty-state"},ta={key:0,class:"history-loader"},sa={key:0,class:"history-loader-spinner"},aa={key:0,class:"streaming-indicator"},la=["src"],oa={key:0,class:"tool-calls-panel"},na={key:0,class:"tool-call-item compression-item"},ia={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},ra={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},ua={class:"tool-call-name"},da={key:2,class:"tool-call-spinner"},ca={key:1,class:"tool-call-item compression-item"},va={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},pa={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},ha={class:"tool-call-name"},fa={key:2,class:"tool-call-spinner"},ma={class:"tool-call-name"},_a={key:0,class:"tool-call-preview"},ga=["title"],ya={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-success-icon"},wa={key:3,class:"tool-call-spinner"},ka={key:4,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"tool-call-error-icon"},Sa={key:0,class:"queue-float-panel"},xa={class:"queue-float-header"},Ca={class:"queue-float-list"},ba={class:"queue-index"},Ma={class:"queue-text"},$a=["title","onClick"],It=new Map,po=ce({__name:"MessageList",setup(V,{expose:u}){const i=mt(),{t:B}=ye(),{isDark:p}=Jo(),{toolTraceVisible:x}=so(),_=h(null),r=h(null),C={frames:8,keepAliveMs:1200};function D(v){return v>=1e6?(v/1e6).toFixed(1)+"M":v>=1e3?(v/1e3).toFixed(1)+"K":String(v)}function P(v){return v<1?`${Math.round(v*1e3)}ms`:v<60?`${Math.round(v*10)/10}s`:`${Math.floor(v/60)}m ${Math.round(v%60)}s`}const U=$(()=>{const v=i.messages;let m=-1;for(let T=v.length-1;T>=0;T--)if(v[T].role==="user"){m=T;break}return[...v.filter((T,te)=>T.role==="tool"&&te>m)].reverse()}),A=$(()=>U.value.filter(v=>!!v.toolName)),L=$(()=>{const v=new Set(U.value.map(m=>m.id));return i.messages.filter(m=>m.role==="tool"?x.value&&!!m.toolName&&!(i.isRunActive&&v.has(m.id)):!(m.role==="assistant"&&m.isStreaming&&!m.content?.trim()&&m.reasoning?.trim()&&U.value.length===0))}),b=$(()=>{const v=i.activeSessionId;return v?i.queuedUserMessages.get(v)||[]:[]});function H(v){const m=i.activeSessionId;m&&i.removeQueuedMessage(m,v)}function K(v){const m=v.replace(/\s+/g," ").trim();return m.length>48?`${m.slice(0,48)}...`:m}function S(v=100){return _.value?.shouldAutoFollowBottom(v)??!0}function R(v){_.value?.scrollToBottom(v)}function I(v){_.value?.scrollToMessage(v)}function N(v,m){_.value?.scrollToAnchor(v,m)}function z(v){if(!v)return;const m=_.value?.captureViewportPosition()??null;m&&It.set(v,m)}function M(v){if(i.activeSessionId!==v)return;if(i.focusMessageId){r.value=null,I(i.focusMessageId);return}const m=It.get(v);if(m){r.value=null,m.wasNearBottom?R(C):_.value?.restoreViewportPosition(m);return}R(C),i.messages.length>0&&!i.isLoadingMessages&&(r.value=null)}async function J(){const v=i.activeSession;if(!v?.hasMoreBefore||v.isLoadingOlderMessages)return;const m=_.value?.captureScrollPosition()??null;await i.loadOlderMessages(v.id)&&(await Fe(),_.value?.restoreScrollPosition(m))}return Q(()=>i.activeSessionId,async(v,m)=>{z(m),v&&(r.value=v,await Fe(),M(v))},{immediate:!0}),Q(()=>[i.activeSessionId,i.messages.length],([v,m])=>{!v||r.value!==v||m===0||M(v)},{flush:"post"}),Q(()=>i.isLoadingMessages,async(v,m)=>{if(v||!m)return;const T=i.activeSessionId;if(!(!T||r.value!==T)){if(i.focusMessageId){r.value=null;return}await Fe(),i.activeSessionId===T&&(R(C),r.value=null)}},{flush:"post"}),Q(()=>i.focusMessageId,v=>{v&&I(v)}),Q(()=>i.isRunActive,v=>{v&&R({frames:3,keepAliveMs:400})}),Q(()=>i.messages[i.messages.length-1]?.content,()=>{if(r.value!==i.activeSessionId){if(i.focusMessageId){I(i.focusMessageId);return}S()&&R({frames:1,keepAliveMs:0})}}),Q(U,()=>{if(r.value!==i.activeSessionId){if(i.focusMessageId){I(i.focusMessageId);return}S()&&R({frames:1,keepAliveMs:0})}}),zo(()=>{z(i.activeSessionId)}),u({scrollToBottom:R,scrollToMessage:I,scrollToAnchor:N}),(v,m)=>(n(),j(ln,{key:t(i).activeSessionId||"chat-empty",ref_key:"listRef",ref:_,messages:L.value,onTopReach:J},{empty:w(()=>[e("div",ea,[m[0]||(m[0]=e("img",{src:"/logo.png",alt:"Hermes",class:"empty-logo"},null,-1)),e("p",null,d(t(B)("chat.emptyState")),1)])]),before:w(()=>[t(i).activeSession?.hasMoreBefore||t(i).activeSession?.isLoadingOlderMessages?(n(),c("div",ta,[t(i).activeSession?.isLoadingOlderMessages?(n(),c("span",sa)):y("",!0)])):y("",!0)]),item:w(({message:T})=>[k(cn,{message:T,highlight:t(i).focusMessageId===T.id},null,8,["message","highlight"])]),after:w(()=>[k(Tt,{name:"fade"},{default:w(()=>[t(i).isRunActive||t(i).abortState?(n(),c("div",aa,[e("img",{src:t(p)?t(vo):t(co),alt:"","aria-hidden":"true",class:"thinking-video"},null,8,la),A.value.length>0||t(i).compressionState||t(i).abortState?(n(),c("div",oa,[t(i).abortState?(n(),c("div",na,[t(i).abortState.aborting?(n(),c("svg",ia,[...m[1]||(m[1]=[e("path",{d:"M10 9v6m4-6v6M5 5h14v14H5z"},null,-1)])])):(n(),c("svg",ra,[...m[2]||(m[2]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])),e("span",ua,d(t(i).abortState.aborting?t(i).abortState.timedOut?t(i).abortState.message||"Still stopping... new messages will be queued":"Pausing... waiting for the run to stop and sync":t(i).abortState.synced?"Paused and synced":"Paused"),1),t(i).abortState.aborting?(n(),c("span",da)):y("",!0)])):y("",!0),t(i).compressionState?(n(),c("div",ca,[t(i).compressionState.compressing?(n(),c("svg",va,[...m[3]||(m[3]=[e("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])])):t(i).compressionState.compressed?(n(),c("svg",pa,[...m[4]||(m[4]=[e("path",{d:"M5 13l4 4L19 7"},null,-1)])])):y("",!0),e("span",ha,d(t(i).compressionState.compressing?`Compressing... (${t(i).compressionState.messageCount} msgs, ~${D(t(i).compressionState.beforeTokens)} tokens)`:t(i).compressionState.compressed?`Compressed ${t(i).compressionState.messageCount} msgs: ~${D(t(i).compressionState.beforeTokens)} → ~${D(t(i).compressionState.afterTokens)} tokens`:"Compression skipped"),1),t(i).compressionState.compressing?(n(),c("span",fa)):y("",!0)])):y("",!0),(n(!0),c(G,null,ee(A.value,T=>(n(),c("div",{key:T.id,class:"tool-call-item"},[m[7]||(m[7]=e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"tool-call-icon"},[e("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})],-1)),e("span",ma,d(T.toolName),1),T.toolPreview?(n(),c("span",_a,d(T.toolPreview),1)):y("",!0),T.toolDuration&&T.toolStatus!=="running"?(n(),c("span",{key:1,class:"tool-call-duration",title:v.$t("chat.executionDuration")},d(P(T.toolDuration)),9,ga)):y("",!0),T.toolStatus==="done"?(n(),c("svg",ya,[...m[5]||(m[5]=[e("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),e("path",{d:"M8 12L11 15L16 9",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):y("",!0),T.toolStatus==="running"?(n(),c("span",wa)):y("",!0),T.toolStatus==="error"?(n(),c("svg",ka,[...m[6]||(m[6]=[e("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor","fill-opacity":"0.15"},null,-1),e("path",{d:"M15 9L9 15M9 9L15 15",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)])])):y("",!0)]))),128))])):y("",!0)])):y("",!0)]),_:1}),k(Tt,{name:"queue-float"},{default:w(()=>[b.value.length>0?(n(),c("div",Sa,[e("div",xa,[m[8]||(m[8]=e("span",{class:"queue-orbit","aria-hidden":"true"},[e("span")],-1)),e("span",null,d(t(B)("chat.messageQueue")),1),e("strong",null,d(b.value.length),1)]),e("div",Ca,[(n(!0),c(G,null,ee(b.value,(T,te)=>(n(),c("div",{key:T.id,class:"queue-float-item"},[e("span",ba,d(te+1),1),e("span",Ma,d(K(T.content)),1),e("button",{type:"button",class:"queue-remove",title:t(B)("chat.removeQueuedMessage"),onClick:we=>H(T.id)},[...m[9]||(m[9]=[e("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,$a)]))),128))])])):y("",!0)]),_:1})]),_:1},8,["messages"]))}})})),Gn=q((()=>{})),ho,Wn=q((()=>{Pa(),Pa(),Gn(),ve(),ho=pe(po,[["__scopeId","data-v-8efdcd87"]])})),Ia,Ta,Fa,La,fo,Ba=q((()=>{de(),Bn(),ge(),ct(),Ln(),wn(),Cn(),yn(),Fn(),_n(),Mn(),Sn(),bn(),Ia={class:"files-panel-drawer"},Ta={class:"files-main-panel"},Fa={class:"main-toolbar"},La={class:"files-content"},fo=ce({__name:"FilesPanel",setup(V){const u=mn(),{t:i}=ye(),B=h(null),p=h(!1),x=h(!1),_=h("newFile"),r=h(null),C=h(!1);function D(L,b){B.value?.show(L,b)}function P(){_.value="newFile",r.value=null,x.value=!0}function U(){_.value="newFolder",r.value=null,x.value=!0}function A(L){_.value="rename",r.value=L,x.value=!0}return ue(()=>{u.fetchEntries("")}),(L,b)=>(n(),c("div",Ia,[C.value?(n(),c("div",{key:0,class:"sidebar-overlay",onClick:b[0]||(b[0]=H=>C.value=!1)})):y("",!0),e("div",{class:X(["files-tree-panel",{"mobile-visible":C.value}])},[k(hn)],2),e("div",Ta,[e("div",Fa,[k(t(O),{size:"small",onClick:b[1]||(b[1]=H=>C.value=!C.value),class:"sidebar-toggle"},{icon:w(()=>[...b[5]||(b[5]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e("line",{x1:"9",y1:"3",x2:"9",y2:"21"})],-1)])]),default:w(()=>[E(" "+d(t(i)("files.fileTree")),1)]),_:1}),k($n,{onShowNewFile:P,onShowNewFolder:U,onShowUpload:b[2]||(b[2]=H=>p.value=!0)})]),k(kn),e("div",La,[t(u).editingFile?(n(),j(In,{key:0})):t(u).previewFile?(n(),j(fn,{key:1})):(n(),j(gn,{key:2,onContextmenuEntry:D}))])]),k(xn,{ref_key:"contextMenuRef",ref:B,onRename:A},null,512),k(Pn,{show:p.value,"onUpdate:show":b[3]||(b[3]=H=>p.value=H)},null,8,["show"]),k(Tn,{show:x.value,"onUpdate:show":b[4]||(b[4]=H=>x.value=H),mode:_.value,entry:r.value},null,8,["show","mode","entry"])]))}})})),Qn=q((()=>{})),mo,Xn=q((()=>{Ba(),Ba(),Qn(),ve(),mo=pe(fo,[["__scopeId","data-v-efc529cd"]])})),Da,Aa,Ra,za,Na,_o,Ua=q((()=>{de(),ge(),vn(),Xn(),Da={class:"drawer-header"},Aa={class:"drawer-tabs"},Ra={class:"drawer-content"},za={class:"drawer-pane"},Na={class:"drawer-pane"},_o=ce({__name:"DrawerPanel",props:{show:{type:Boolean},activeTab:{default:"files"}},emits:["update:show"],setup(V,{emit:u}){const i=V,B=u,{t:p}=ye(),x=h(i.activeTab);Q(()=>i.activeTab,r=>{r&&(x.value=r)});function _(){B("update:show",!1)}return(r,C)=>(n(),j(Ro,{to:"body"},[V.show?(n(),c("div",{key:0,class:"drawer-overlay",onClick:_})):y("",!0),e("div",{class:X(["drawer-panel",{show:V.show}])},[e("div",Da,[e("div",Aa,[e("button",{class:X(["tab-button",{active:x.value==="files"}]),onClick:C[0]||(C[0]=D=>x.value="files")},d(t(p)("drawer.files")),3),e("button",{class:X(["tab-button",{active:x.value==="terminal"}]),onClick:C[1]||(C[1]=D=>x.value="terminal")},d(t(p)("drawer.terminal")),3)]),e("button",{class:"close-button",onClick:_},[...C[2]||(C[2]=[e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e("div",Ra,[ut(e("div",za,[k(mo)],512),[[Ft,x.value==="files"]]),ut(e("div",Na,[k(pn,{visible:x.value==="terminal"&&V.show},null,8,["visible"])],512),[[Ft,x.value==="terminal"]])])],2)]))}})})),Yn=q((()=>{})),go,Jn=q((()=>{Ua(),Ua(),Yn(),ve(),go=pe(_o,[["__scopeId","data-v-9e646a0b"]])})),qa,Oa,Ea,Va,Ha,Ka,ja,Ga,Wa,Qa,Xa,Ya,Ja,Za,el,tl,sl,al,ll,ol,nl,il,rl,ul,dl,cl,vl,pl,hl,fl,ml,_l,gl,yl,wl,kl,Sl,xl,Cl,bl,Ml,$l,Pl,Il,Tl,Fl,Ll,Bl,Dl,Al,Rl,zl,Nl,Ul,ql,Ol,El,Vl,Hl,Kl,jl,Gl,yo,Wl=q((()=>{de(),to(),ft(),ht(),Dt(),tn(),ct(),Zl(),ge(),sn(),An(),Un(),Hn(),Wn(),on(),Jn(),nn(),qa={class:"chat-panel"},Oa={class:"session-list-header"},Ea={key:0,class:"session-list-title"},Va={class:"session-list-actions"},Ha={key:0,class:"session-profile-filter"},Ka={key:1,class:"session-items"},ja={key:0,class:"session-loading"},Ga={key:1,class:"session-empty"},Wa={class:"session-group-header session-group-header--static"},Qa={class:"session-group-label"},Xa={class:"session-group-count"},Ya={class:"session-model-list"},Ja=["onClick"],Za={class:"session-model-group-label"},el={class:"session-model-group-count"},tl={class:"session-model-group-items"},sl=["title","onClick"],al={class:"session-model-item-label"},ll={class:"session-model-item-name"},ol={key:0,class:"session-model-item-id"},nl={key:0,class:"session-model-badge-preview"},il={key:1,class:"session-model-badge-disabled"},rl={key:2,class:"session-model-badge-custom"},ul={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"},dl={key:0,class:"session-model-empty"},cl={class:"session-model-custom"},vl={class:"session-model-custom-row"},pl={class:"session-model-custom-hint"},hl={class:"new-chat-form"},fl={class:"new-chat-field"},ml={class:"new-chat-label"},_l={class:"new-chat-field"},gl={class:"new-chat-label"},yl={class:"new-chat-field"},wl={class:"new-chat-label"},kl={class:"new-chat-actions"},Sl={class:"chat-main"},xl={class:"chat-header"},Cl={class:"header-left"},bl={class:"header-session-title"},Ml=["title"],$l={class:"header-actions"},Pl={class:"chat-content-wrapper"},Il={class:"chat-main-content"},Tl={key:0,class:"approval-bar"},Fl={class:"approval-content"},Ll={class:"approval-main"},Bl={class:"approval-kicker"},Dl={class:"approval-title"},Al={class:"approval-desc"},Rl={class:"approval-command"},zl={class:"approval-actions"},Nl={key:1,class:"clarify-bar"},Ul={class:"clarify-content"},ql={class:"clarify-main"},Ol={class:"clarify-kicker"},El={class:"clarify-title"},Vl={class:"clarify-desc"},Hl={key:0,class:"clarify-actions"},Kl={key:1,class:"clarify-actions clarify-actions-open"},jl={class:"clarify-input-row"},Gl={class:"drawer-button-wrapper"},yo=ce({__name:"ChatPanel",setup(V){const u=mt(),i=pt(),B=Bt(),p=en(),x=eo(),_=Jl(),{t:r}=ye(),C=h(!1),D=h("files"),P=h(!1),U=h(null),A=h("chat"),L=h(!1),b=h(new Set),H=h(!1),K=h(!1),S=h(typeof window>"u"||!window.matchMedia("(max-width: 768px)").matches);let R=null;const I=h(!1);function N(a){return x.resolve({name:"hermes.session",params:{sessionId:a}}).href}function z(a){typeof window>"u"||window.open(N(a),"_blank","noopener,noreferrer")}function M(a){U.value?.scrollToAnchor(a.messageId,a.anchorId)}async function J(a){await x.push({name:"hermes.session",params:{sessionId:a}}),R?.matches&&(S.value=!1)}function v(a){I.value=a.matches,a.matches&&S.value&&(S.value=!1)}ue(()=>{R=window.matchMedia("(max-width: 768px)"),v(R),R.addEventListener("change",v),B.profiles.length===0&&B.fetchProfiles()}),dt(()=>{R?.removeEventListener("change",v)});const m=h(!1),T=h(""),te=h(null),we=h(null),_t=$(()=>u.sessionProfileFilter),Oe=$(()=>[{label:r("chat.allProfiles"),value:"__all__"},...B.profiles.map(a=>({label:a.name,value:a.name}))]);async function Ee(a){u.sessionProfileFilter=a==="__all__"?null:a,await u.loadSessions(u.sessionProfileFilter)}function Le(a){return[...a].sort((s,o)=>(o.updatedAt||0)-(s.updatedAt||0))}const ae=$(()=>Le(u.sessions.filter(a=>p.isPinned(a.id)))),ke=$(()=>Le(u.sessions.filter(a=>!p.isPinned(a.id))));Q(()=>[u.sessionsLoaded,...u.sessions.map(a=>a.id)],a=>{const s=a.slice(1);!a[0]||s.length===0||p.pruneMissingSessions(s)},{immediate:!0});const Se=$(()=>u.activeSession?.title||r("chat.newChat")),he=$(()=>A.value==="live"?r("chat.liveSessions"):Se.value),fe=$(()=>u.activePendingApproval),Y=$(()=>fe.value),xe=$(()=>u.activePendingClarify),me=$(()=>xe.value),Ce=h("");function be(a){const s=a!==void 0?a:Ce.value.trim();u.respondToClarify(s),Ce.value=""}const oe=h(!1),ne=h("default"),Z=h(""),re=h(""),le=h(!1);function _e(a){return i.profileModelGroups.find(s=>s.profile===a)?.groups||[]}function Me(a){const s=_e(a),o=i.profileModelGroups.find(Ne=>Ne.profile===a),F=o?.default_provider||"",$t=o?.default||"",Pt=(F?s.find(Ne=>Ne.provider===F):void 0)||s.find(Ne=>Ne.models.length>0);return{provider:Pt?.provider||"",model:Pt?.models.includes($t)?$t:Pt?.models[0]||""}}const gt=$(()=>(B.profiles.length>0?B.profiles:[{name:"default"}]).map(a=>({label:a.name,value:a.name}))),Ve=$(()=>_e(ne.value)),yt=$(()=>Ve.value.map(a=>({label:a.label||a.provider,value:a.provider}))),He=$(()=>{const a=Ve.value.find(s=>s.provider===Z.value);return(a?.models||[]).map(s=>({label:i.displayModelName(s,a?.provider),value:s}))});function Ke(){const a=Me(ne.value);Z.value=a.provider,re.value=a.model}async function je(){oe.value=!0,le.value=!0;try{B.profiles.length===0&&await B.fetchProfiles(),i.modelGroups.length===0&&i.profileModelGroups.length===0&&await i.loadModels(),ne.value=B.activeProfileName||B.profiles.find(a=>a.active)?.name||B.profiles[0]?.name||"default",Ke()}finally{le.value=!1}}function wt(a){ne.value=a,Ke()}function Ge(a){Z.value=a,re.value=He.value[0]?.value||""}async function kt(){const a=u.newChat({profile:ne.value,provider:Z.value,model:re.value});await x.push({name:"hermes.session",params:{sessionId:a.id}}),oe.value=!1}function $e(a){u.respondApproval(a)}function St(a){return u.sessions.find(s=>s.id===a)?.profile||null}function xt(a,s){const o=x.resolve({name:"hermes.session",params:{sessionId:a},query:s?{profile:s}:void 0}).href;return`${window.location.origin}${window.location.pathname}${o}`}async function Ct(a){const s=a||u.activeSessionId;s&&(await jt(xt(s,St(s)))?_.success(r("common.copied")):_.error(r("common.copied")+" ✗"))}async function We(a){const s=a||u.activeSessionId;s&&(await jt(s)?_.success(r("common.copied")):_.error(r("common.copied")+" ✗"))}function Be(a){p.removePinned(a),u.deleteSession(a),_.success(r("chat.sessionDeleted"))}function Qe(){K.value||(L.value=!L.value,L.value||(b.value.clear(),H.value=!1))}function Pe(a){return`${a.profile||"default"}\0${a.id}`}function De(a){if(K.value)return;const s=Pe(a);b.value.has(s)?b.value.delete(s):b.value.add(s),b.value=new Set(b.value),b.value.size===0&&(H.value=!1)}function l(a){return b.value.has(Pe(a))}async function f(){if(b.value.size===0||K.value)return;const a=new Map(u.sessions.map(o=>[Pe(o),o])),s=Array.from(b.value).map(o=>a.get(o)).filter(o=>!!o).map(o=>({id:o.id,profile:o.profile||null}));if(s.length!==0){K.value=!0;try{const o=await jo(s);if(o.deleted>0){for(const F of s)p.removePinned(F.id);await u.loadSessions(u.sessionProfileFilter),_.success(r("chat.batchDeleteSuccess",{count:o.deleted})),o.failed>0&&_.warning(r("chat.batchDeletePartial",{failed:o.failed}))}else _.error(r("chat.batchDeleteFailed"))}catch{_.error(r("chat.batchDeleteFailed"))}finally{K.value=!1,H.value=!1,L.value=!1,b.value.clear()}}}function g(){return f(),!1}function se(){if(!K.value){b.value.clear();for(const a of u.sessions)a.id!==u.activeSessionId&&b.value.add(Pe(a));b.value=new Set(b.value)}}const ie=$(()=>b.value.size),Xe=$(()=>u.sessions.some(a=>a.id!==u.activeSessionId)),W=h(null),bt=$(()=>W.value?p.isPinned(W.value):!1),So=$(()=>W.value&&u.sessions.find(a=>a.id===W.value)||null),xo=$(()=>{const a=[{label:r(bt.value?"chat.unpin":"chat.pin"),key:"pin"},{label:r("chat.rename"),key:"rename"},{label:r("chat.setWorkspace"),key:"workspace"}];return So.value?.source==="cli"&&a.push({label:r("chat.setModel"),key:"model"}),a.push({label:r("chat.export"),key:"export",children:[{label:r("chat.exportFull"),key:"export-full",children:[{label:"JSON",key:"export-full-json"},{label:"TXT",key:"export-full-txt"}]},{label:r("chat.exportCompressed"),key:"export-compressed",children:[{label:"JSON",key:"export-compressed-json"},{label:"TXT",key:"export-compressed-txt"}]}]}),a.push({label:r("chat.openSessionInNewTab"),key:"open-link"}),a.push({label:r("chat.copySessionLink"),key:"copy-link"}),a.push({label:r("chat.copySessionId"),key:"copy-id"}),a});function At(a,s){a.preventDefault(),W.value=s,Ye.value=!0,Rt.value=a.clientX,zt.value=a.clientY}const Ye=h(!1),Rt=h(0),zt=h(0);function Nt(a){return a==="export-full-json"?{mode:"full",ext:"json"}:a==="export-full-txt"?{mode:"full",ext:"txt"}:a==="export-compressed-json"?{mode:"compressed",ext:"json"}:a==="export-compressed-txt"?{mode:"compressed",ext:"txt"}:null}async function Co(a){if(Ye.value=!1,!!W.value){if(a==="pin"){p.togglePinned(W.value);return}if(a==="copy-link")Ct(W.value);else if(a==="copy-id")We(W.value);else if(a==="open-link")z(W.value);else if(Nt(a)){const{mode:s,ext:o}=Nt(a),F=s==="compressed"?_.loading(r("chat.exportCompressing"),{duration:0}):null;try{await Qo(W.value,s,o),F?.destroy(),_.success(r("chat.exportSuccess"))}catch{F?.destroy(),_.error(r("chat.exportFailed"))}}else if(a==="workspace"){const s=u.sessions.find(o=>o.id===W.value);Ae.value=W.value,Ie.value=s?.workspace||"",Je.value=!0}else if(a==="model")await Po(W.value);else if(a==="rename"){const s=u.sessions.find(o=>o.id===W.value);te.value=W.value,T.value=s?.title||"",m.value=!0,Fe(()=>{we.value?.focus()})}}}function bo(){Ye.value=!1}async function Ut(){if(!(!te.value||!T.value.trim())){if(await Go(te.value,T.value.trim())){const a=u.sessions.find(s=>s.id===te.value);a&&(a.title=T.value.trim()),u.activeSession?.id===te.value&&(u.activeSession.title=T.value.trim()),_.success(r("chat.renamed"))}else _.error(r("chat.renameFailed"));m.value=!1}}const Je=h(!1),Ie=h(""),Ae=h(null);async function Mo(){if(Ae.value){if(await Wo(Ae.value,Ie.value||null)){const a=u.sessions.find(s=>s.id===Ae.value);a&&(a.workspace=Ie.value||null),u.activeSession?.id===Ae.value&&(u.activeSession.workspace=Ie.value||null),_.success(r("chat.workspaceSet"))}else _.error(r("chat.workspaceSetFailed"));Je.value=!1}}const Ze=h(!1),et=h(null),Re=h(""),tt=h({}),st=h(""),ze=h(""),at=h(""),lt=h(""),qt=$(()=>u.sessions.find(a=>a.id===et.value)?.profile||null),Mt=$(()=>qt.value?_e(qt.value):[]),$o=$(()=>Mt.value.map(a=>({label:a.label,value:a.provider}))),Ot=$(()=>Mt.value.map(a=>({...a,models:[...a.models,...(i.customModels[a.provider]||[]).filter(s=>!a.models.includes(s))]}))),Et=$(()=>{const a=Re.value.trim().toLowerCase();return a?Ot.value.map(s=>({...s,models:s.models.filter(o=>{const F=i.displayModelName(o,s.provider);return o.toLowerCase().includes(a)||F.toLowerCase().includes(a)})})).filter(s=>s.models.length>0||s.label.toLowerCase().includes(a)):Ot.value});async function Po(a){i.modelGroups.length===0&&i.profileModelGroups.length===0&&await i.loadModels();const s=u.sessions.find(F=>F.id===a),o=s?.profile?Me(s.profile):{provider:"",model:""};et.value=a,st.value=s?.model||o.model||"",ze.value=s?.provider||o.provider||"",lt.value=ze.value,Re.value="",at.value="",tt.value={},Ze.value=!0}function Vt(a){return!!tt.value[a]}function Io(a){tt.value[a]=!tt.value[a]}function To(a,s){return(i.customModels[s]||[]).includes(a)}function Fo(a,s){return i.displayModelName(a,s)}function Lo(a,s){return i.getModelAlias(a,s)}async function Ht(a,s){Mt.value.find(o=>o.provider===s)?.model_meta?.[a]?.disabled||!et.value||(await u.switchSessionModel(a,s,et.value)?(st.value=a,ze.value=s,Ze.value=!1,_.success(r("chat.modelSet"))):_.error(r("chat.modelSetFailed")))}async function Bo(){const a=at.value.trim(),s=lt.value;!a||!s||await Ht(a,s)}return(a,s)=>(n(),c("div",qa,[A.value==="chat"?(n(),c("div",{key:0,class:X(["session-backdrop",{active:S.value}]),onClick:s[0]||(s[0]=o=>S.value=!1)},null,2)):y("",!0),A.value==="chat"?(n(),c("aside",{key:1,class:X(["session-list",{collapsed:!S.value}])},[e("div",Oa,[S.value?(n(),c("span",Ea,d(t(r)("chat.webUiSessions")),1)):y("",!0),e("div",Va,[e("button",{class:"session-close-btn",onClick:s[1]||(s[1]=o=>S.value=!1)},[...s[26]||(s[26]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),L.value?y("",!0):(n(),j(t(O),{key:0,quaternary:"",size:"tiny",onClick:Qe,title:t(r)("chat.toggleBatchMode")},{icon:w(()=>[...s[27]||(s[27]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M9 11l3 3L22 4"}),e("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"])),L.value?(n(),j(t(O),{key:1,quaternary:"",size:"tiny",onClick:se,disabled:!Xe.value||K.value,title:t(r)("chat.selectAll")},{icon:w(()=>[...s[28]||(s[28]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M9 11l3 3L22 4"}),e("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"])):y("",!0),L.value&&ie.value>0?(n(),j(t(Ao),{key:2,show:H.value,"onUpdate:show":s[2]||(s[2]=o=>H.value=o),"positive-button-props":{loading:K.value,disabled:K.value},"negative-button-props":{disabled:K.value},onPositiveClick:g},{trigger:w(()=>[k(t(O),{quaternary:"",size:"tiny",type:"error",loading:K.value,disabled:K.value},{icon:w(()=>[...s[29]||(s[29]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("polyline",{points:"3 6 5 6 21 6"}),e("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:w(()=>[E(" "+d(t(r)("chat.confirmBatchDelete",{count:ie.value})),1)]),_:1},8,["show","positive-button-props","negative-button-props"])):y("",!0),L.value?(n(),j(t(O),{key:3,quaternary:"",size:"tiny",onClick:Qe,disabled:K.value},{icon:w(()=>[...s[30]||(s[30]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])]),_:1},8,["disabled"])):y("",!0),k(t(O),{quaternary:"",size:"tiny",circle:"",onClick:je},{icon:w(()=>[...s[31]||(s[31]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),_:1})])]),S.value?(n(),c("div",Ha,[k(t(Ue),{value:_t.value||"__all__",options:Oe.value,size:"small",loading:t(B).loading,"onUpdate:value":Ee},null,8,["value","options","loading"])])):y("",!0),S.value?(n(),c("div",Ka,[t(u).isLoadingSessions&&t(u).sessions.length===0?(n(),c("div",ja,d(t(r)("common.loading")),1)):t(u).sessions.length===0?(n(),c("div",Ga,d(t(r)("chat.noSessions")),1)):y("",!0),ae.value.length>0?(n(),c(G,{key:2},[e("div",Wa,[e("span",Qa,d(t(r)("chat.pinned")),1),e("span",Xa,d(ae.value.length),1)]),(n(!0),c(G,null,ee(ae.value,o=>(n(),j(Qt,{key:`pinned-${o.id}`,session:o,active:o.id===t(u).activeSessionId,pinned:!0,"can-delete":o.id!==t(u).activeSessionId||t(u).sessions.length>1,streaming:t(u).isSessionLive(o.id),selectable:L.value,selected:l(o),"show-profile":!0,to:N(o.id),onSelect:F=>J(o.id),onContextmenu:F=>At(F,o.id),onDelete:F=>Be(o.id),onToggleSelect:F=>De(o)},null,8,["session","active","can-delete","streaming","selectable","selected","to","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))],64)):y("",!0),(n(!0),c(G,null,ee(ke.value,o=>(n(),j(Qt,{key:o.id,session:o,active:o.id===t(u).activeSessionId,pinned:!1,"can-delete":o.id!==t(u).activeSessionId||t(u).sessions.length>1,streaming:t(u).isSessionLive(o.id),selectable:L.value,selected:l(o),"show-profile":!0,to:N(o.id),onSelect:F=>J(o.id),onContextmenu:F=>At(F,o.id),onDelete:F=>Be(o.id),onToggleSelect:F=>De(o)},null,8,["session","active","can-delete","streaming","selectable","selected","to","onSelect","onContextmenu","onDelete","onToggleSelect"]))),128))])):y("",!0)],2)):y("",!0),k(t(No),{placement:"bottom-start",trigger:"manual",x:Rt.value,y:zt.value,options:xo.value,show:Ye.value,onSelect:Co,onClickoutside:bo},null,8,["x","y","options","show"]),k(t(qe),{show:m.value,"onUpdate:show":s[4]||(s[4]=o=>m.value=o),preset:"dialog",title:t(r)("chat.renameSession"),"positive-text":t(r)("common.ok"),"negative-text":t(r)("common.cancel"),onPositiveClick:Ut},{default:w(()=>[k(t(ot),{ref_key:"renameInputRef",ref:we,value:T.value,"onUpdate:value":s[3]||(s[3]=o=>T.value=o),placeholder:t(r)("chat.enterNewTitle"),onKeydown:Kt(Ut,["enter"])},null,8,["value","placeholder"])]),_:1},8,["show","title","positive-text","negative-text"]),k(t(qe),{show:Je.value,"onUpdate:show":s[6]||(s[6]=o=>Je.value=o),preset:"dialog",title:t(r)("chat.setWorkspaceTitle"),"positive-text":t(r)("common.ok"),"negative-text":t(r)("common.cancel"),style:{width:"520px"},onPositiveClick:Mo},{default:w(()=>[k(oo,{modelValue:Ie.value,"onUpdate:modelValue":s[5]||(s[5]=o=>Ie.value=o)},null,8,["modelValue"])]),_:1},8,["show","title","positive-text","negative-text"]),k(t(qe),{show:Ze.value,"onUpdate:show":s[10]||(s[10]=o=>Ze.value=o),preset:"card",title:t(r)("chat.setModelTitle"),style:{width:"min(480px, calc(100vw - 32px))"},"mask-closable":!0},{default:w(()=>[k(t(ot),{value:Re.value,"onUpdate:value":s[7]||(s[7]=o=>Re.value=o),placeholder:t(r)("models.searchPlaceholder"),clearable:"",size:"small",class:"session-model-search"},null,8,["value","placeholder"]),e("div",Ya,[(n(!0),c(G,null,ee(Et.value,o=>(n(),c("div",{key:o.provider,class:"session-model-group"},[e("div",{class:"session-model-group-header",onClick:F=>Io(o.provider)},[(n(),c("svg",{class:X(["session-model-group-arrow",{collapsed:Vt(o.provider)}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...s[32]||(s[32]=[e("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),e("span",Za,d(o.label),1),e("span",el,d(o.models.length),1)],8,Ja),ut(e("div",tl,[(n(!0),c(G,null,ee(o.models,F=>(n(),c("div",{key:F,class:X(["session-model-item",{active:F===st.value&&o.provider===ze.value,disabled:!!o.model_meta?.[F]?.disabled}]),title:o.model_meta?.[F]?.disabled?t(r)("models.disabledTooltip"):"",onClick:$t=>Ht(F,o.provider)},[e("span",al,[e("span",ll,d(Fo(F,o.provider)),1),Lo(F,o.provider)?(n(),c("span",ol,d(t(r)("models.aliasCanonical",{model:F})),1)):y("",!0)]),o.model_meta?.[F]?.preview?(n(),c("span",nl,d(t(r)("models.previewBadge")),1)):y("",!0),o.model_meta?.[F]?.disabled?(n(),c("span",il,d(t(r)("models.disabledBadge")),1)):y("",!0),To(F,o.provider)?(n(),c("span",rl,d(t(r)("models.customBadge")),1)):y("",!0),F===st.value&&o.provider===ze.value?(n(),c("svg",ul,[...s[33]||(s[33]=[e("polyline",{points:"20 6 9 17 4 12"},null,-1)])])):y("",!0)],10,sl))),128))],512),[[Ft,!Vt(o.provider)]])]))),128)),Et.value.length===0?(n(),c("div",dl,d(Re.value?"No results":"No models"),1)):y("",!0),e("div",cl,[e("div",vl,[k(t(Ue),{value:lt.value,"onUpdate:value":s[8]||(s[8]=o=>lt.value=o),options:$o.value,size:"small",class:"session-model-custom-provider"},null,8,["value","options"]),k(t(ot),{value:at.value,"onUpdate:value":s[9]||(s[9]=o=>at.value=o),placeholder:t(r)("models.customModelPlaceholder"),size:"small",class:"session-model-custom-input",onKeydown:Kt(Bo,["enter"])},null,8,["value","placeholder"])]),e("div",pl,d(t(r)("models.customModelHint")),1)])])]),_:1},8,["show","title"]),k(t(qe),{show:oe.value,"onUpdate:show":s[13]||(s[13]=o=>oe.value=o),preset:"card",title:t(r)("chat.newChat"),style:{width:"min(440px, calc(100vw - 32px))"},"mask-closable":!0},{footer:w(()=>[e("div",kl,[k(t(O),{onClick:s[12]||(s[12]=o=>oe.value=!1)},{default:w(()=>[E(d(t(r)("common.cancel")),1)]),_:1}),k(t(O),{type:"primary",disabled:!ne.value||!Z.value||!re.value,onClick:kt},{default:w(()=>[E(d(t(r)("chat.newChat")),1)]),_:1},8,["disabled"])])]),default:w(()=>[e("div",hl,[e("label",fl,[e("span",ml,d(t(r)("sidebar.profiles")),1),k(t(Ue),{value:ne.value,options:gt.value,loading:le.value||t(B).loading,"onUpdate:value":wt},null,8,["value","options","loading"])]),e("label",_l,[e("span",gl,d(t(r)("models.provider")),1),k(t(Ue),{value:Z.value,options:yt.value,disabled:le.value,"onUpdate:value":Ge},null,8,["value","options","disabled"])]),e("label",yl,[e("span",wl,d(t(r)("models.models")),1),k(t(Ue),{value:re.value,"onUpdate:value":s[11]||(s[11]=o=>re.value=o),options:He.value,disabled:le.value||!Z.value,filterable:""},null,8,["value","options","disabled"])])])]),_:1},8,["show","title"]),e("div",Sl,[e("header",xl,[e("div",Cl,[A.value==="chat"?(n(),j(t(O),{key:0,quaternary:"",size:"small",onClick:s[14]||(s[14]=o=>S.value=!S.value),circle:""},{icon:w(()=>[...s[34]||(s[34]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"3",y:"3",width:"7",height:"7"}),e("rect",{x:"14",y:"3",width:"7",height:"7"}),e("rect",{x:"3",y:"14",width:"7",height:"7"}),e("rect",{x:"14",y:"14",width:"7",height:"7"})],-1)])]),_:1})):y("",!0),e("span",bl,d(he.value),1),t(u).activeSession?.workspace?(n(),c("span",{key:1,class:"workspace-badge",title:t(u).activeSession.workspace},"📁 "+d(t(u).activeSession.workspace.split("/").pop()||t(u).activeSession.workspace),9,Ml)):y("",!0)]),e("div",$l,[A.value==="chat"?(n(),c(G,{key:0},[k(t(Te),{trigger:"hover"},{trigger:w(()=>[k(t(O),{quaternary:"",size:"small",onClick:s[15]||(s[15]=o=>P.value=!P.value),circle:""},{icon:w(()=>[...s[35]||(s[35]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M3 12h18M3 6h18M3 18h18"})],-1)])]),_:1})]),default:w(()=>[E(" "+d(t(r)("chat.outlineTitle")),1)]),_:1}),k(t(Te),{trigger:"hover"},{trigger:w(()=>[k(t(O),{quaternary:"",size:"small",onClick:s[16]||(s[16]=o=>We()),circle:""},{icon:w(()=>[...s[36]||(s[36]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),e("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:w(()=>[E(" "+d(t(r)("chat.copySessionId")),1)]),_:1}),k(t(O),{size:"small",circle:I.value,onClick:je},{icon:w(()=>[...s[37]||(s[37]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])]),default:w(()=>[I.value?y("",!0):(n(),c(G,{key:0},[E(d(t(r)("chat.newChat")),1)],64))]),_:1},8,["circle"])],64)):y("",!0)])]),A.value==="chat"?(n(),c(G,{key:0},[e("div",Pl,[e("div",Il,[k(ho,{ref_key:"messageListRef",ref:U},null,512)]),P.value?(n(),j(un,{key:0,messages:t(u).messages,onNavigate:M},null,8,["messages"])):y("",!0)]),Y.value?(n(),c("div",Tl,[s[38]||(s[38]=e("div",{class:"approval-icon","aria-hidden":"true"},[e("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10"}),e("path",{d:"m9 12 2 2 4-4"})])],-1)),e("div",Fl,[e("div",Ll,[e("div",Bl,d(t(r)("chat.approvalKicker")),1),e("div",Dl,d(t(r)("chat.approvalTitle")),1),e("div",Al,d(Y.value.description),1),e("code",Rl,d(Y.value.command),1)]),e("div",zl,[Y.value.choices.includes("once")?(n(),j(t(O),{key:0,size:"small",type:"primary",onClick:s[17]||(s[17]=o=>$e("once"))},{default:w(()=>[E(d(t(r)("chat.approvalAllowOnce")),1)]),_:1})):y("",!0),Y.value.choices.includes("session")?(n(),j(t(O),{key:1,size:"small",secondary:"",onClick:s[18]||(s[18]=o=>$e("session"))},{default:w(()=>[E(d(t(r)("chat.approvalAllowSession")),1)]),_:1})):y("",!0),Y.value.choices.includes("always")?(n(),j(t(O),{key:2,size:"small",secondary:"",onClick:s[19]||(s[19]=o=>$e("always"))},{default:w(()=>[E(d(t(r)("chat.approvalAlways")),1)]),_:1})):y("",!0),Y.value.choices.includes("deny")?(n(),j(t(O),{key:3,size:"small",type:"error",secondary:"",onClick:s[20]||(s[20]=o=>$e("deny"))},{default:w(()=>[E(d(t(r)("chat.approvalDeny")),1)]),_:1})):y("",!0)])])])):y("",!0),me.value?(n(),c("div",Nl,[s[39]||(s[39]=qo('<div class="clarify-icon" aria-hidden="true" data-v-9ef8dd56><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-9ef8dd56><circle cx="12" cy="12" r="10" data-v-9ef8dd56></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" data-v-9ef8dd56></path><line x1="12" y1="17" x2="12.01" y2="17" data-v-9ef8dd56></line></svg></div>',1)),e("div",Ul,[e("div",ql,[e("div",Ol,d(t(r)("chat.clarifyKicker")),1),e("div",El,d(t(r)("chat.clarifyTitle")),1),e("div",Vl,d(me.value.question),1)]),me.value.choices&&me.value.choices.length?(n(),c("div",Hl,[(n(!0),c(G,null,ee(me.value.choices,o=>(n(),j(t(O),{key:o,size:"small",type:"primary",onClick:F=>be(o)},{default:w(()=>[E(d(o),1)]),_:2},1032,["onClick"]))),128)),k(t(O),{size:"small",type:"error",secondary:"",onClick:s[21]||(s[21]=o=>be(""))},{default:w(()=>[E(d(t(r)("chat.clarifyDismiss")),1)]),_:1})])):(n(),c("div",Kl,[e("div",jl,[k(t(ot),{value:Ce.value,"onUpdate:value":s[22]||(s[22]=o=>Ce.value=o),size:"small",placeholder:t(r)("chat.clarifyPlaceholder")},null,8,["value","placeholder"]),k(t(O),{size:"small",type:"primary",onClick:s[23]||(s[23]=o=>be())},{default:w(()=>[E(d(t(r)("chat.clarifySubmit")),1)]),_:1})])]))])])):y("",!0),k(io)],64)):(n(),j(uo,{key:1,"human-only":t(p).humanOnly},null,8,["human-only"]))]),e("div",Gl,[e("div",{class:"drawer-button",onClick:s[24]||(s[24]=o=>C.value=!0)},[...s[40]||(s[40]=[e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),e("line",{x1:"15",y1:"3",x2:"15",y2:"21"})],-1)])])]),k(go,{show:C.value,"onUpdate:show":s[25]||(s[25]=o=>C.value=o),"active-tab":D.value},null,8,["show","active-tab"])]))}})})),Zn=q((()=>{})),wo,ei=q((()=>{Wl(),Wl(),Zn(),ve(),wo=pe(yo,[["__scopeId","data-v-9ef8dd56"]])})),Ql,it,ko,Xl=q((()=>{de(),Zl(),ei(),ht(),ft(),Dt(),Yo(),Ql={class:"chat-view"},it="Hermes Studio",ko=ce({__name:"ChatView",setup(V){const u=pt(),i=mt(),B=Bt(),p=Ko(),x=Vo(),_=eo(),r=$(()=>{const P=x.params.sessionId;return typeof P=="string"&&P.trim()?P:null}),C=$(()=>{const P=x.query.profile;return typeof P=="string"&&P.trim()?P:null});Q($(()=>x.name!=="hermes.session"?it:i.activeSession?.title?.trim()||it),P=>{document.title=P},{immediate:!0}),dt(()=>{document.title=it});async function D(){await i.loadSessions(i.sessionProfileFilter,r.value),r.value&&i.activeSessionId!==r.value&&await _.replace({name:"hermes.chat"})}return ue(async()=>{u.loadModels(),await Promise.all([B.fetchProfiles(),p.fetchSettings()]),await D()}),Q([r,C],async([P])=>{if(i.sessionsLoaded){if(!P){await i.loadSessions(i.sessionProfileFilter);return}if(i.activeSessionId!==P){if(!i.sessions.some(U=>U.id===P)){await D();return}await i.switchSession(P)}}}),(P,U)=>(n(),c("div",Ql,[k(wo)]))}})})),ti=q((()=>{})),si,ai=q((()=>{Xl(),Xl(),ti(),ve(),si=pe(ko,[["__scopeId","data-v-fb7cebf1"]])}));ai();export{si as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as D}from"./rolldown-runtime-M0oDzQ_3.js";import{$n as d,$t as s,A as ie,An as i,At as aa,Bn as c,Bt as ta,Cn as W,E as N,Jn as n,Mt as na,O as la,Pt as k,Qt as y,W as sa,Xn as oe,Xt as ia,Yt as G,an as v,ct as oa,en as _,ft as H,g as de,nn as w,on as u,ot as da,sn as ra,t as ua,tn as M,wt as x,xn as g,yn as ca,z as ga}from"./ui-vendor-DNWaqYj5.js";import{c as va,l as fa}from"./vue-vendor-VX6KvV1_.js";import{d as S,l as pa,n as _a,t as ha}from"./_plugin-vue_export-helper-D4mtpdbl.js";import{a as ma,l as ya}from"./system-vQTkarwT.js";import{X as Aa,Y as Ca}from"./index-BHU-82RO.js";import{n as ba,t as wa}from"./TerminalPanel-CqIASgSb.js";async function xa(){return S("/api/coding-agents")}async function Sa(f){return S(`/api/coding-agents/${f}/install`,{method:"POST"})}async function Pa(f){return S(`/api/coding-agents/${f}`,{method:"DELETE"})}async function Fa(f,l,r={}){const h=new URLSearchParams;r.profile&&h.set("profile",r.profile),r.provider&&h.set("provider",r.provider);const m=h.toString();return S(`/api/coding-agents/${f}/config-files/${encodeURIComponent(l)}${m?`?${m}`:""}`)}async function ka(f,l,r,h={}){return S(`/api/coding-agents/${f}/config-files/${encodeURIComponent(l)}`,{method:"PUT",body:JSON.stringify({content:r,profile:h.profile,provider:h.provider})})}async function Ma(f,l){return S(`/api/coding-agents/${f}/launch/prepare`,{method:"POST",body:JSON.stringify(l)})}async function Ta(f,l){return S(`/api/coding-agents/${f}/launch/native`,{method:"POST",body:JSON.stringify(l)})}var $a=D((()=>{pa()})),re,ue,ce,ge,ve,fe,pe,_e,he,me,ye,Ae,Ce,be,we,xe,Se,Pe,Fe,ke,Me,Te,$e,Le,Be,Ne,Ue,Oe=D((()=>{ta(),ua(),va(),$a(),ya(),Ca(),ba(),re={class:"coding-agents-view"},ue={class:"page-header"},ce={class:"header-title"},ge={class:"coding-agents-content"},ve={class:"content-description"},fe={class:"agent-blocks"},pe={class:"agent-block-header"},_e=["src"],he={class:"agent-install-state"},me={class:"install-state-main"},ye={class:"install-state-title"},Ae={class:"install-state-value"},Ce={class:"version-text"},be={class:"config-file-section"},we={class:"config-file-title"},xe={class:"config-file-list"},Se=["onClick"],Pe={class:"inline-config-editor"},Fe={class:"config-editor-meta"},ke={class:"config-editor-path"},Me={class:"config-editor-actions"},Te={class:"drawer-header"},$e={class:"drawer-tabs"},Le={class:"tab-button active",type:"button"},Be={class:"drawer-content"},Ne={class:"drawer-pane"},Ue=ra({__name:"CodingAgentsView",setup(f){const{t:l}=fa(),r=ga(),h=Aa(),m=c(!1),O=c(""),U=c([]),z=c({"claude-code":!1,codex:!1}),V=c({"claude-code":!1,codex:!1}),T=c(!1),J=c(!1),j=c(!1),I=c(!1),q=c("claude-code"),$=c([]),E=c("scoped"),A=c(""),C=c(""),L=c("codex_responses"),X=c(null),P=c(!1),Q=c(""),Z=c(0),ze={"Claude Code":"/coding-agents/claude-code.svg",Codex:"/coding-agents/codex-openai.png"},Ve=[{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"}]},p=c({"claude-code":{selectedKey:"settings",content:"",originalContent:"",loading:!1,saving:!1},codex:{selectedKey:"config",content:"",originalContent:"",loading:!1,saving:!1}}),je=y(()=>U.value.reduce((a,t)=>(a[t.id]=t,a),{})),R=y(()=>h.activeProfileName||"default"),Ie=y(()=>$.value.map(a=>({label:a.label&&a.label!==a.provider?`${a.label} (${a.provider})`:a.provider,value:a.provider}))),ee=y(()=>$.value.find(a=>a.provider===A.value)||null),Ee=y(()=>ee.value?.models.map(a=>({label:a,value:a}))||[]),Re=y(()=>[{label:l("codingAgents.protocolOpenAiChat"),value:"chat_completions"},{label:l("codingAgents.protocolOpenAiResponses"),value:"codex_responses"},{label:l("codingAgents.protocolAnthropicMessages"),value:"anthropic_messages"}]),Ke=y(()=>[{label:l("codingAgents.launchModeGlobal"),value:"global"},{label:l("codingAgents.launchModeScoped"),value:"scoped"}]),Ge={buttonColorActive:"#111827",buttonTextColorActive:"#fff",buttonBorderColorActive:"#111827",buttonBoxShadow:"inset 0 0 0 1px var(--border-color)",buttonBoxShadowHover:"inset 0 0 0 1px #111827"},F=y(()=>E.value==="global");function b(a){return je.value[a]}function De(a){return B[a]}function ae(a){return B[a].find(t=>t.key===p.value[a].selectedKey)||B[a][0]}function Je(a){const t=p.value[a];return t.content!==t.originalContent}async function te(){m.value=!0,O.value="";try{U.value=(await xa()).tools}catch(a){O.value=a?.message||l("codingAgents.loadFailed")}finally{m.value=!1}}async function Y(a,t){const e=p.value[a];e.selectedKey=t.key,e.loading=!0;try{const o=await Fa(a,t.key);e.content=o.content,e.originalContent=o.content,e.absolutePath=o.absolutePath,e.exists=o.exists}catch(o){r.error(o?.message||l("codingAgents.configLoadFailed"))}finally{e.loading=!1}}async function qe(a){const t=p.value[a],e=ae(a);if(e){t.saving=!0;try{const o=await ka(a,e.key,t.content);t.originalContent=o.content,t.absolutePath=o.absolutePath,t.exists=o.exists,r.success(l("files.saved"))}catch(o){r.error(o?.message||l("files.saveFailed"))}finally{t.saving=!1}}}function Xe(){const a=$.value[0];A.value=a?.provider||"",C.value=a?.models[0]||"",L.value=ne(a)}function Ye(a){const t=$.value.find(e=>e.provider===a);C.value=t?.models[0]||"",L.value=ne(t)}function ne(a){const t=String(a?.provider||"").toLowerCase(),e=String(a?.base_url||"").toLowerCase();return t.includes("claude")||t==="anthropic"||e.includes("anthropic")||e.includes("/anthropic")?"anthropic_messages":t==="deepseek"||t==="lmstudio"||e.includes("deepseek")||e.includes("127.0.0.1")||e.includes("localhost")?"chat_completions":"codex_responses"}async function We(a){q.value=a,E.value="scoped",T.value=!0,X.value=null,J.value=!0;try{$.value=(await ma(R.value)).groups||[],Xe()}catch(t){r.error(t?.message||l("codingAgents.loadProvidersFailed"))}finally{J.value=!1}}function le(){if(F.value)return{mode:"global",profile:R.value};const a=ee.value;return{mode:"scoped",profile:R.value,provider:A.value,model:C.value,baseUrl:a?.base_url||"",apiKey:a?.api_key||"",apiMode:L.value}}function K(a,t,e="codingAgents.installFailed"){return a==="node_environment_missing"?l("codingAgents.nodeEnvironmentMissing"):t||l(e)}function se(a){const t=String(a?.message||""),e=t.indexOf("{");if(e<0)return null;try{const o=JSON.parse(t.slice(e));return o&&typeof o=="object"?o:null}catch{return null}}async function He(){if(!F.value&&(!A.value||!C.value)){r.error(l("codingAgents.selectProviderModel"));return}j.value=!0;try{X.value=await Ma(q.value,le()),Q.value=X.value.shellCommand,Z.value+=1,T.value=!1,P.value=!0,r.success(l("codingAgents.launchPrepared"))}catch(a){r.error(a?.message||l("codingAgents.launchPrepareFailed"))}finally{j.value=!1}}async function Qe(){if(!F.value&&(!A.value||!C.value)){r.error(l("codingAgents.selectProviderModel"));return}I.value=!0;try{await Ta(q.value,le()),T.value=!1,r.success(l("codingAgents.nativeLaunchStarted"))}catch(a){r.error(a?.message||l("codingAgents.nativeLaunchFailed"))}finally{I.value=!1}}async function Ze(a){z.value[a]=!0;try{const t=await Sa(a);U.value=t.tools,t.success?r.success(l("codingAgents.installSuccess")):r.error(K(t.code,t.message,"codingAgents.installFailed"))}catch(t){const e=se(t);r.error(K(e?.code,e?.message||t?.message,"codingAgents.installFailed"))}finally{z.value[a]=!1}}async function ea(a){V.value[a]=!0;try{const t=await Pa(a);U.value=t.tools,t.success?r.success(l("codingAgents.deleteSuccess")):r.error(K(t.code,t.message,"codingAgents.deleteFailed"))}catch(t){const e=se(t);r.error(K(e?.code,e?.message||t?.message,"codingAgents.deleteFailed"))}finally{V.value[a]=!1}}return ca(()=>{te(),Y("claude-code",B["claude-code"][0]),Y("codex",B.codex[1])}),(a,t)=>(g(),w("div",re,[s("header",ue,[s("h2",ce,d(n(l)("codingAgents.title")),1),u(n(x),{size:"small",quaternary:"",loading:m.value,onClick:te},{default:i(()=>[v(d(n(l)("codingAgents.refresh")),1)]),_:1},8,["loading"])]),s("div",ge,[O.value?(g(),_(n(na),{key:0,type:"error",class:"status-alert"},{default:i(()=>[v(d(O.value),1)]),_:1})):M("",!0),s("p",ve,d(n(l)("codingAgents.notice")),1),s("div",fe,[(g(),w(G,null,W(Ve,e=>s("section",{key:e.tool,class:"agent-block"},[s("header",pe,[s("img",{class:"agent-logo",src:ze[e.tool],alt:""},null,8,_e),s("div",null,[s("h3",null,d(e.tool),1),u(n(k),{class:"provider-tag",size:"small"},{default:i(()=>[v(d(e.provider),1)]),_:2},1024)])]),s("div",he,[s("div",me,[s("div",ye,d(n(l)("codingAgents.installStatus")),1),s("div",Ae,[m.value&&!b(e.id)?(g(),_(n(k),{key:0,size:"small"},{default:i(()=>[v(d(n(l)("codingAgents.checking")),1)]),_:1})):b(e.id)?.installed?(g(),w(G,{key:1},[u(n(k),{size:"small",type:"success"},{default:i(()=>[v(d(n(l)("codingAgents.installed")),1)]),_:1}),s("span",Ce,d(b(e.id)?.version||b(e.id)?.rawVersion),1)],64)):(g(),_(n(k),{key:2,size:"small",type:"warning"},{default:i(()=>[v(d(n(l)("codingAgents.notInstalled")),1)]),_:1}))])]),b(e.id)?.installed?(g(),_(n(x),{key:0,size:"small",type:"error",secondary:"",loading:V.value[e.id],onClick:o=>ea(e.id)},{default:i(()=>[v(d(V.value[e.id]?n(l)("codingAgents.deleting"):n(l)("codingAgents.deleteNow")),1)]),_:2},1032,["loading","onClick"])):(g(),_(n(x),{key:1,size:"small",type:"primary",secondary:"",loading:z.value[e.id],disabled:m.value&&!b(e.id),onClick:o=>Ze(e.id)},{default:i(()=>[v(d(z.value[e.id]?n(l)("codingAgents.installing"):n(l)("codingAgents.installNow")),1)]),_:2},1032,["loading","disabled","onClick"]))]),s("div",be,[s("div",we,d(n(l)("codingAgents.configFiles")),1),s("div",xe,[(g(!0),w(G,null,W(De(e.id),o=>(g(),w("button",{key:o.key,class:oe(["config-file-cell",{active:p.value[e.id].selectedKey===o.key}]),type:"button",onClick:Oa=>Y(e.id,o)},d(o.path),11,Se))),128))])]),s("div",Pe,[s("div",Fe,[s("span",ke,d(ae(e.id)?.path),1),p.value[e.id].exists===!1?(g(),_(n(k),{key:0,size:"small",type:"warning"},{default:i(()=>[v(d(n(l)("codingAgents.configFileNotCreated")),1)]),_:1})):M("",!0)]),u(n(de),{show:p.value[e.id].loading},{default:i(()=>[u(n(aa),{value:p.value[e.id].content,"onUpdate:value":o=>p.value[e.id].content=o,type:"textarea",class:"config-textarea",disabled:p.value[e.id].loading},null,8,["value","onUpdate:value","disabled"])]),_:2},1032,["show"]),s("div",Me,[u(n(ie),{justify:"end"},{default:i(()=>[u(n(x),{size:"small",type:"primary",loading:p.value[e.id].saving,disabled:p.value[e.id].loading||!Je(e.id),onClick:o=>qe(e.id)},{default:i(()=>[v(d(n(l)("files.saveFile")),1)]),_:1},8,["loading","disabled","onClick"]),u(n(x),{size:"small",type:"primary",disabled:!b(e.id)?.installed,onClick:o=>We(e.id)},{default:i(()=>[v(d(n(l)("codingAgents.launch")),1)]),_:1},8,["disabled","onClick"])]),_:2},1024)])])])),64))])]),u(n(sa),{show:T.value,"onUpdate:show":t[4]||(t[4]=e=>T.value=e),preset:"card",class:"launch-modal",style:{width:"620px",maxWidth:"calc(100vw - 32px)"},title:n(l)("codingAgents.launchTitle"),bordered:!1},{footer:i(()=>[u(n(ie),{justify:"end"},{default:i(()=>[u(n(x),{secondary:"",loading:j.value,disabled:I.value,onClick:He},{default:i(()=>[v(d(n(l)("codingAgents.builtInTerminal")),1)]),_:1},8,["loading","disabled"]),u(n(x),{type:"primary",loading:I.value,disabled:j.value,onClick:Qe},{default:i(()=>[v(d(n(l)("codingAgents.nativeTerminal")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:i(()=>[u(n(de),{show:J.value},{default:i(()=>[u(n(la),{"label-placement":"top"},{default:i(()=>[u(n(N),{label:n(l)("codingAgents.profileScope")},{default:i(()=>[u(n(k),{size:"small"},{default:i(()=>[v(d(R.value),1)]),_:1})]),_:1},8,["label"]),u(n(N),{label:n(l)("codingAgents.launchModeScope")},{default:i(()=>[u(n(da),{value:E.value,"onUpdate:value":t[0]||(t[0]=e=>E.value=e),name:"coding-agent-launch-mode","theme-overrides":Ge},{default:i(()=>[(g(!0),w(G,null,W(Ke.value,e=>(g(),_(n(oa),{key:e.value,value:e.value},{default:i(()=>[v(d(e.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"]),F.value?M("",!0):(g(),_(n(N),{key:0,label:n(l)("codingAgents.providerScope")},{default:i(()=>[u(n(H),{value:A.value,"onUpdate:value":[t[1]||(t[1]=e=>A.value=e),Ye],options:Ie.value,placeholder:n(l)("codingAgents.providerPlaceholder"),filterable:""},null,8,["value","options","placeholder"])]),_:1},8,["label"])),F.value?M("",!0):(g(),_(n(N),{key:1,label:n(l)("codingAgents.modelScope")},{default:i(()=>[u(n(H),{value:C.value,"onUpdate:value":t[2]||(t[2]=e=>C.value=e),options:Ee.value,placeholder:n(l)("codingAgents.modelPlaceholder"),filterable:""},null,8,["value","options","placeholder"])]),_:1},8,["label"])),F.value?M("",!0):(g(),_(n(N),{key:2,label:n(l)("codingAgents.protocolScope")},{default:i(()=>[u(n(H),{value:L.value,"onUpdate:value":t[3]||(t[3]=e=>L.value=e),options:Re.value},null,8,["value","options"])]),_:1},8,["label"]))]),_:1})]),_:1},8,["show"])]),_:1},8,["show","title"]),(g(),_(ia,{to:"body"},[P.value?(g(),w("div",{key:0,class:"drawer-overlay",onClick:t[5]||(t[5]=e=>P.value=!1)})):M("",!0),s("div",{class:oe(["drawer-panel",{show:P.value}])},[s("div",Te,[s("div",$e,[s("button",Le,d(n(l)("codingAgents.terminalTitle")),1)]),s("button",{class:"close-button",type:"button",onClick:t[6]||(t[6]=e=>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",Be,[s("div",Ne,[(g(),_(wa,{key:Z.value,visible:P.value,"initial-command":Q.value},null,8,["visible","initial-command"]))])])],2)]))]))}})})),La=D((()=>{})),Ba,Na=D((()=>{Oe(),Oe(),La(),_a(),Ba=ha(Ue,[["__scopeId","data-v-958745b1"]])}));Na();export{Ba as default};
|
|
1
|
+
import{n as D}from"./rolldown-runtime-M0oDzQ_3.js";import{$n as d,$t as s,A as ie,An as i,At as aa,Bn as c,Bt as ta,Cn as W,E as N,Jn as n,Mt as na,O as la,Pt as k,Qt as y,W as sa,Xn as oe,Xt as ia,Yt as G,an as v,ct as oa,en as _,ft as H,g as de,nn as w,on as u,ot as da,sn as ra,t as ua,tn as M,wt as x,xn as g,yn as ca,z as ga}from"./ui-vendor-DNWaqYj5.js";import{c as va,l as fa}from"./vue-vendor-VX6KvV1_.js";import{d as S,l as pa,n as _a,t as ha}from"./_plugin-vue_export-helper-CtZk2OSc.js";import{a as ma,l as ya}from"./system-Pg8JEuA6.js";import{X as Aa,Y as Ca}from"./index-DyLZQAQu.js";import{n as ba,t as wa}from"./TerminalPanel-C50X3--t.js";async function xa(){return S("/api/coding-agents")}async function Sa(f){return S(`/api/coding-agents/${f}/install`,{method:"POST"})}async function Pa(f){return S(`/api/coding-agents/${f}`,{method:"DELETE"})}async function Fa(f,l,r={}){const h=new URLSearchParams;r.profile&&h.set("profile",r.profile),r.provider&&h.set("provider",r.provider);const m=h.toString();return S(`/api/coding-agents/${f}/config-files/${encodeURIComponent(l)}${m?`?${m}`:""}`)}async function ka(f,l,r,h={}){return S(`/api/coding-agents/${f}/config-files/${encodeURIComponent(l)}`,{method:"PUT",body:JSON.stringify({content:r,profile:h.profile,provider:h.provider})})}async function Ma(f,l){return S(`/api/coding-agents/${f}/launch/prepare`,{method:"POST",body:JSON.stringify(l)})}async function Ta(f,l){return S(`/api/coding-agents/${f}/launch/native`,{method:"POST",body:JSON.stringify(l)})}var $a=D((()=>{pa()})),re,ue,ce,ge,ve,fe,pe,_e,he,me,ye,Ae,Ce,be,we,xe,Se,Pe,Fe,ke,Me,Te,$e,Le,Be,Ne,Ue,Oe=D((()=>{ta(),ua(),va(),$a(),ya(),Ca(),ba(),re={class:"coding-agents-view"},ue={class:"page-header"},ce={class:"header-title"},ge={class:"coding-agents-content"},ve={class:"content-description"},fe={class:"agent-blocks"},pe={class:"agent-block-header"},_e=["src"],he={class:"agent-install-state"},me={class:"install-state-main"},ye={class:"install-state-title"},Ae={class:"install-state-value"},Ce={class:"version-text"},be={class:"config-file-section"},we={class:"config-file-title"},xe={class:"config-file-list"},Se=["onClick"],Pe={class:"inline-config-editor"},Fe={class:"config-editor-meta"},ke={class:"config-editor-path"},Me={class:"config-editor-actions"},Te={class:"drawer-header"},$e={class:"drawer-tabs"},Le={class:"tab-button active",type:"button"},Be={class:"drawer-content"},Ne={class:"drawer-pane"},Ue=ra({__name:"CodingAgentsView",setup(f){const{t:l}=fa(),r=ga(),h=Aa(),m=c(!1),O=c(""),U=c([]),z=c({"claude-code":!1,codex:!1}),V=c({"claude-code":!1,codex:!1}),T=c(!1),J=c(!1),j=c(!1),I=c(!1),q=c("claude-code"),$=c([]),E=c("scoped"),A=c(""),C=c(""),L=c("codex_responses"),X=c(null),P=c(!1),Q=c(""),Z=c(0),ze={"Claude Code":"/coding-agents/claude-code.svg",Codex:"/coding-agents/codex-openai.png"},Ve=[{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"}]},p=c({"claude-code":{selectedKey:"settings",content:"",originalContent:"",loading:!1,saving:!1},codex:{selectedKey:"config",content:"",originalContent:"",loading:!1,saving:!1}}),je=y(()=>U.value.reduce((a,t)=>(a[t.id]=t,a),{})),R=y(()=>h.activeProfileName||"default"),Ie=y(()=>$.value.map(a=>({label:a.label&&a.label!==a.provider?`${a.label} (${a.provider})`:a.provider,value:a.provider}))),ee=y(()=>$.value.find(a=>a.provider===A.value)||null),Ee=y(()=>ee.value?.models.map(a=>({label:a,value:a}))||[]),Re=y(()=>[{label:l("codingAgents.protocolOpenAiChat"),value:"chat_completions"},{label:l("codingAgents.protocolOpenAiResponses"),value:"codex_responses"},{label:l("codingAgents.protocolAnthropicMessages"),value:"anthropic_messages"}]),Ke=y(()=>[{label:l("codingAgents.launchModeGlobal"),value:"global"},{label:l("codingAgents.launchModeScoped"),value:"scoped"}]),Ge={buttonColorActive:"#111827",buttonTextColorActive:"#fff",buttonBorderColorActive:"#111827",buttonBoxShadow:"inset 0 0 0 1px var(--border-color)",buttonBoxShadowHover:"inset 0 0 0 1px #111827"},F=y(()=>E.value==="global");function b(a){return je.value[a]}function De(a){return B[a]}function ae(a){return B[a].find(t=>t.key===p.value[a].selectedKey)||B[a][0]}function Je(a){const t=p.value[a];return t.content!==t.originalContent}async function te(){m.value=!0,O.value="";try{U.value=(await xa()).tools}catch(a){O.value=a?.message||l("codingAgents.loadFailed")}finally{m.value=!1}}async function Y(a,t){const e=p.value[a];e.selectedKey=t.key,e.loading=!0;try{const o=await Fa(a,t.key);e.content=o.content,e.originalContent=o.content,e.absolutePath=o.absolutePath,e.exists=o.exists}catch(o){r.error(o?.message||l("codingAgents.configLoadFailed"))}finally{e.loading=!1}}async function qe(a){const t=p.value[a],e=ae(a);if(e){t.saving=!0;try{const o=await ka(a,e.key,t.content);t.originalContent=o.content,t.absolutePath=o.absolutePath,t.exists=o.exists,r.success(l("files.saved"))}catch(o){r.error(o?.message||l("files.saveFailed"))}finally{t.saving=!1}}}function Xe(){const a=$.value[0];A.value=a?.provider||"",C.value=a?.models[0]||"",L.value=ne(a)}function Ye(a){const t=$.value.find(e=>e.provider===a);C.value=t?.models[0]||"",L.value=ne(t)}function ne(a){const t=String(a?.provider||"").toLowerCase(),e=String(a?.base_url||"").toLowerCase();return t.includes("claude")||t==="anthropic"||e.includes("anthropic")||e.includes("/anthropic")?"anthropic_messages":t==="deepseek"||t==="lmstudio"||e.includes("deepseek")||e.includes("127.0.0.1")||e.includes("localhost")?"chat_completions":"codex_responses"}async function We(a){q.value=a,E.value="scoped",T.value=!0,X.value=null,J.value=!0;try{$.value=(await ma(R.value)).groups||[],Xe()}catch(t){r.error(t?.message||l("codingAgents.loadProvidersFailed"))}finally{J.value=!1}}function le(){if(F.value)return{mode:"global",profile:R.value};const a=ee.value;return{mode:"scoped",profile:R.value,provider:A.value,model:C.value,baseUrl:a?.base_url||"",apiKey:a?.api_key||"",apiMode:L.value}}function K(a,t,e="codingAgents.installFailed"){return a==="node_environment_missing"?l("codingAgents.nodeEnvironmentMissing"):t||l(e)}function se(a){const t=String(a?.message||""),e=t.indexOf("{");if(e<0)return null;try{const o=JSON.parse(t.slice(e));return o&&typeof o=="object"?o:null}catch{return null}}async function He(){if(!F.value&&(!A.value||!C.value)){r.error(l("codingAgents.selectProviderModel"));return}j.value=!0;try{X.value=await Ma(q.value,le()),Q.value=X.value.shellCommand,Z.value+=1,T.value=!1,P.value=!0,r.success(l("codingAgents.launchPrepared"))}catch(a){r.error(a?.message||l("codingAgents.launchPrepareFailed"))}finally{j.value=!1}}async function Qe(){if(!F.value&&(!A.value||!C.value)){r.error(l("codingAgents.selectProviderModel"));return}I.value=!0;try{await Ta(q.value,le()),T.value=!1,r.success(l("codingAgents.nativeLaunchStarted"))}catch(a){r.error(a?.message||l("codingAgents.nativeLaunchFailed"))}finally{I.value=!1}}async function Ze(a){z.value[a]=!0;try{const t=await Sa(a);U.value=t.tools,t.success?r.success(l("codingAgents.installSuccess")):r.error(K(t.code,t.message,"codingAgents.installFailed"))}catch(t){const e=se(t);r.error(K(e?.code,e?.message||t?.message,"codingAgents.installFailed"))}finally{z.value[a]=!1}}async function ea(a){V.value[a]=!0;try{const t=await Pa(a);U.value=t.tools,t.success?r.success(l("codingAgents.deleteSuccess")):r.error(K(t.code,t.message,"codingAgents.deleteFailed"))}catch(t){const e=se(t);r.error(K(e?.code,e?.message||t?.message,"codingAgents.deleteFailed"))}finally{V.value[a]=!1}}return ca(()=>{te(),Y("claude-code",B["claude-code"][0]),Y("codex",B.codex[1])}),(a,t)=>(g(),w("div",re,[s("header",ue,[s("h2",ce,d(n(l)("codingAgents.title")),1),u(n(x),{size:"small",quaternary:"",loading:m.value,onClick:te},{default:i(()=>[v(d(n(l)("codingAgents.refresh")),1)]),_:1},8,["loading"])]),s("div",ge,[O.value?(g(),_(n(na),{key:0,type:"error",class:"status-alert"},{default:i(()=>[v(d(O.value),1)]),_:1})):M("",!0),s("p",ve,d(n(l)("codingAgents.notice")),1),s("div",fe,[(g(),w(G,null,W(Ve,e=>s("section",{key:e.tool,class:"agent-block"},[s("header",pe,[s("img",{class:"agent-logo",src:ze[e.tool],alt:""},null,8,_e),s("div",null,[s("h3",null,d(e.tool),1),u(n(k),{class:"provider-tag",size:"small"},{default:i(()=>[v(d(e.provider),1)]),_:2},1024)])]),s("div",he,[s("div",me,[s("div",ye,d(n(l)("codingAgents.installStatus")),1),s("div",Ae,[m.value&&!b(e.id)?(g(),_(n(k),{key:0,size:"small"},{default:i(()=>[v(d(n(l)("codingAgents.checking")),1)]),_:1})):b(e.id)?.installed?(g(),w(G,{key:1},[u(n(k),{size:"small",type:"success"},{default:i(()=>[v(d(n(l)("codingAgents.installed")),1)]),_:1}),s("span",Ce,d(b(e.id)?.version||b(e.id)?.rawVersion),1)],64)):(g(),_(n(k),{key:2,size:"small",type:"warning"},{default:i(()=>[v(d(n(l)("codingAgents.notInstalled")),1)]),_:1}))])]),b(e.id)?.installed?(g(),_(n(x),{key:0,size:"small",type:"error",secondary:"",loading:V.value[e.id],onClick:o=>ea(e.id)},{default:i(()=>[v(d(V.value[e.id]?n(l)("codingAgents.deleting"):n(l)("codingAgents.deleteNow")),1)]),_:2},1032,["loading","onClick"])):(g(),_(n(x),{key:1,size:"small",type:"primary",secondary:"",loading:z.value[e.id],disabled:m.value&&!b(e.id),onClick:o=>Ze(e.id)},{default:i(()=>[v(d(z.value[e.id]?n(l)("codingAgents.installing"):n(l)("codingAgents.installNow")),1)]),_:2},1032,["loading","disabled","onClick"]))]),s("div",be,[s("div",we,d(n(l)("codingAgents.configFiles")),1),s("div",xe,[(g(!0),w(G,null,W(De(e.id),o=>(g(),w("button",{key:o.key,class:oe(["config-file-cell",{active:p.value[e.id].selectedKey===o.key}]),type:"button",onClick:Oa=>Y(e.id,o)},d(o.path),11,Se))),128))])]),s("div",Pe,[s("div",Fe,[s("span",ke,d(ae(e.id)?.path),1),p.value[e.id].exists===!1?(g(),_(n(k),{key:0,size:"small",type:"warning"},{default:i(()=>[v(d(n(l)("codingAgents.configFileNotCreated")),1)]),_:1})):M("",!0)]),u(n(de),{show:p.value[e.id].loading},{default:i(()=>[u(n(aa),{value:p.value[e.id].content,"onUpdate:value":o=>p.value[e.id].content=o,type:"textarea",class:"config-textarea",disabled:p.value[e.id].loading},null,8,["value","onUpdate:value","disabled"])]),_:2},1032,["show"]),s("div",Me,[u(n(ie),{justify:"end"},{default:i(()=>[u(n(x),{size:"small",type:"primary",loading:p.value[e.id].saving,disabled:p.value[e.id].loading||!Je(e.id),onClick:o=>qe(e.id)},{default:i(()=>[v(d(n(l)("files.saveFile")),1)]),_:1},8,["loading","disabled","onClick"]),u(n(x),{size:"small",type:"primary",disabled:!b(e.id)?.installed,onClick:o=>We(e.id)},{default:i(()=>[v(d(n(l)("codingAgents.launch")),1)]),_:1},8,["disabled","onClick"])]),_:2},1024)])])])),64))])]),u(n(sa),{show:T.value,"onUpdate:show":t[4]||(t[4]=e=>T.value=e),preset:"card",class:"launch-modal",style:{width:"620px",maxWidth:"calc(100vw - 32px)"},title:n(l)("codingAgents.launchTitle"),bordered:!1},{footer:i(()=>[u(n(ie),{justify:"end"},{default:i(()=>[u(n(x),{secondary:"",loading:j.value,disabled:I.value,onClick:He},{default:i(()=>[v(d(n(l)("codingAgents.builtInTerminal")),1)]),_:1},8,["loading","disabled"]),u(n(x),{type:"primary",loading:I.value,disabled:j.value,onClick:Qe},{default:i(()=>[v(d(n(l)("codingAgents.nativeTerminal")),1)]),_:1},8,["loading","disabled"])]),_:1})]),default:i(()=>[u(n(de),{show:J.value},{default:i(()=>[u(n(la),{"label-placement":"top"},{default:i(()=>[u(n(N),{label:n(l)("codingAgents.profileScope")},{default:i(()=>[u(n(k),{size:"small"},{default:i(()=>[v(d(R.value),1)]),_:1})]),_:1},8,["label"]),u(n(N),{label:n(l)("codingAgents.launchModeScope")},{default:i(()=>[u(n(da),{value:E.value,"onUpdate:value":t[0]||(t[0]=e=>E.value=e),name:"coding-agent-launch-mode","theme-overrides":Ge},{default:i(()=>[(g(!0),w(G,null,W(Ke.value,e=>(g(),_(n(oa),{key:e.value,value:e.value},{default:i(()=>[v(d(e.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"]),F.value?M("",!0):(g(),_(n(N),{key:0,label:n(l)("codingAgents.providerScope")},{default:i(()=>[u(n(H),{value:A.value,"onUpdate:value":[t[1]||(t[1]=e=>A.value=e),Ye],options:Ie.value,placeholder:n(l)("codingAgents.providerPlaceholder"),filterable:""},null,8,["value","options","placeholder"])]),_:1},8,["label"])),F.value?M("",!0):(g(),_(n(N),{key:1,label:n(l)("codingAgents.modelScope")},{default:i(()=>[u(n(H),{value:C.value,"onUpdate:value":t[2]||(t[2]=e=>C.value=e),options:Ee.value,placeholder:n(l)("codingAgents.modelPlaceholder"),filterable:""},null,8,["value","options","placeholder"])]),_:1},8,["label"])),F.value?M("",!0):(g(),_(n(N),{key:2,label:n(l)("codingAgents.protocolScope")},{default:i(()=>[u(n(H),{value:L.value,"onUpdate:value":t[3]||(t[3]=e=>L.value=e),options:Re.value},null,8,["value","options"])]),_:1},8,["label"]))]),_:1})]),_:1},8,["show"])]),_:1},8,["show","title"]),(g(),_(ia,{to:"body"},[P.value?(g(),w("div",{key:0,class:"drawer-overlay",onClick:t[5]||(t[5]=e=>P.value=!1)})):M("",!0),s("div",{class:oe(["drawer-panel",{show:P.value}])},[s("div",Te,[s("div",$e,[s("button",Le,d(n(l)("codingAgents.terminalTitle")),1)]),s("button",{class:"close-button",type:"button",onClick:t[6]||(t[6]=e=>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",Be,[s("div",Ne,[(g(),_(wa,{key:Z.value,visible:P.value,"initial-command":Q.value},null,8,["visible","initial-command"]))])])],2)]))]))}})})),La=D((()=>{})),Ba,Na=D((()=>{Oe(),Oe(),La(),_a(),Ba=ha(Ue,[["__scopeId","data-v-958745b1"]])}));Na();export{Ba as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as $}from"./rolldown-runtime-M0oDzQ_3.js";import{$n as i,$t as a,An as r,Bn as k,Bt as he,Cn as j,Jn as n,M as ke,P as be,Pt as b,Qt as we,S as Ce,Yt as x,an as u,en as g,g as Pe,nn as f,on as c,sn as Te,t as $e,tn as w,wt as p,xn as l,yn as Se,z as qe}from"./ui-vendor-DNWaqYj5.js";import{c as ze,l as Ve}from"./vue-vendor-VX6KvV1_.js";import{d as m,l as Re,n as Le,t as Be}from"./_plugin-vue_export-helper-
|
|
1
|
+
import{n as $}from"./rolldown-runtime-M0oDzQ_3.js";import{$n as i,$t as a,An as r,Bn as k,Bt as he,Cn as j,Jn as n,M as ke,P as be,Pt as b,Qt as we,S as Ce,Yt as x,an as u,en as g,g as Pe,nn as f,on as c,sn as Te,t as $e,tn as w,wt as p,xn as l,yn as Se,z as qe}from"./ui-vendor-DNWaqYj5.js";import{c as ze,l as Ve}from"./vue-vendor-VX6KvV1_.js";import{d as m,l as Re,n as Le,t as Be}from"./_plugin-vue_export-helper-CtZk2OSc.js";async function je(){return m("/api/devices")}async function xe(){return m("/api/devices/scan",{method:"POST"})}async function Ie(d){return m(`/api/devices/${encodeURIComponent(d)}/request`,{method:"POST"})}async function Oe(d){return m(`/api/devices/${encodeURIComponent(d)}/approve`,{method:"POST"})}async function Ne(d){return m(`/api/devices/${encodeURIComponent(d)}/reject`,{method:"POST"})}async function Ue(d){return m(`/api/devices/${encodeURIComponent(d)}/block`,{method:"POST"})}async function Fe(d){return m(`/api/devices/${encodeURIComponent(d)}/unblock`,{method:"POST"})}async function De(d){return m(`/api/devices/${encodeURIComponent(d)}/request-history`,{method:"DELETE"})}var He=$((()=>{Re()})),I,O,N,U,F,D,H,M,E,Y,A,J,Q,W,G,K,X,Z,ee,te,ne,se,ae,ie=$((()=>{he(),$e(),ze(),He(),I={class:"devices-view"},O={class:"page-header"},N={class:"header-title"},U={class:"header-actions"},F={class:"header-meta"},D={class:"devices-content"},H={key:0,class:"empty-state"},M={class:"empty-title"},E={key:1,class:"device-grid"},Y={class:"device-card-header"},A={class:"device-title-block"},J={class:"device-name"},Q=["href"],W={class:"device-status-row"},G={class:"device-meta-list"},K={class:"device-actions"},X={key:0,class:"request-empty"},Z={key:1,class:"request-list"},ee={class:"request-name"},te={class:"request-meta"},ne={class:"request-status-row"},se={class:"request-actions"},ae=Te({__name:"DevicesView",setup(d){const{t:s}=Ve(),C=qe(),P=k(!1),T=k(!1),v=k(""),S=k(!1),_=k({scanning:!1,last_scanned_at:null,devices:[],requests:[]}),q=we(()=>[..._.value.devices].sort((e,o)=>{const t=z(e.endpoint_kind)-z(o.endpoint_kind);return t!==0?t:e.id.localeCompare(o.id)}));function z(e){return e==="web"?0:e==="desktop"?1:2}function re(e){return s(`devices.endpoint.${e}`)}function oe(e){return e==="desktop"?"success":e==="web"?"info":"default"}function V(e){return s(`devices.inboundStatus.${e}`)}function ue(e){return s(`devices.outboundStatus.${e}`)}function le(e){return e.outbound_status==="approved"?s("devices.paired"):ue(e.outbound_status)}function de(e){return e.outbound_status==="approved"?"success":e.outbound_status==="pending"?"info":e.outbound_status==="blocked"?"error":e.outbound_status==="rejected"?"warning":"default"}function ce(e){return e.outbound_status==="none"||e.outbound_status==="rejected"}function _e(e){return e.inbound_status!=="blocked"}function pe(){return _.value.requests.length>0?s("devices.requestsWithCount",{count:_.value.requests.length}):s("devices.requests")}function R(e){return e.inbound_status!=="pending"}function ve(e){return R(e)?s("devices.processed"):s("devices.unprocessed")}function fe(e){return R(e)?"success":"warning"}function me(e){return[e.os.type||e.os.platform,e.os.release,e.os.arch].filter(Boolean).join(" ")}function ye(e){if(!e)return s("devices.never");const o=new Date(e);return Number.isNaN(o.getTime())?String(e):o.toLocaleString()}function L(e){return e||s("devices.unknown")}async function ge(){P.value=!0;try{_.value=await je()}catch(e){C.error(e?.message||s("devices.loadFailed"))}finally{P.value=!1}}async function B(){T.value=!0;try{_.value=await xe()}catch(e){C.error(e?.message||s("devices.scanFailed"))}finally{T.value=!1}}async function y(e,o){v.value=e.id;try{_.value=o==="request"?await Ie(e.id):o==="approve"?await Oe(e.id):o==="reject"?await Ne(e.id):o==="block"?await Ue(e.id):o==="deleteHistory"?await De(e.id):await Fe(e.id)}catch(t){if(o==="request"&&String(t?.message||"").includes("Duplicate pairing request")){C.warning(s("devices.duplicateRequest"));return}C.error(t?.message||s("devices.updateFailed"))}finally{v.value=""}}return Se(()=>{ge()}),(e,o)=>(l(),f("div",I,[a("header",O,[a("h2",N,i(n(s)("devices.title")),1),a("div",U,[a("div",F,[a("span",null,i(n(s)("devices.count",{count:q.value.length})),1),a("span",null,i(n(s)("devices.lastScanned",{time:ye(_.value.last_scanned_at)})),1)]),c(n(p),{size:"small",onClick:o[0]||(o[0]=t=>S.value=!0)},{default:r(()=>[u(i(pe()),1)]),_:1}),c(n(p),{size:"small",type:"primary",loading:T.value||_.value.scanning,onClick:B},{default:r(()=>[u(i(n(s)("devices.refresh")),1)]),_:1},8,["loading"])])]),c(n(Pe),{show:P.value,class:"devices-spin"},{default:r(()=>[a("div",D,[q.value.length===0&&!P.value?(l(),f("div",H,[a("div",M,i(n(s)("devices.empty")),1),c(n(p),{size:"small",loading:T.value||_.value.scanning,onClick:B},{default:r(()=>[u(i(n(s)("devices.refresh")),1)]),_:1},8,["loading"])])):(l(),f("div",E,[(l(!0),f(x,null,j(q.value,t=>(l(),f("article",{key:t.id,class:"device-card"},[a("div",Y,[a("div",A,[a("div",J,i(t.computer_name||t.ip),1),a("a",{class:"device-link",href:t.url,target:"_blank",rel:"noopener noreferrer"},i(t.ip)+":"+i(t.http_port),9,Q)]),c(n(b),{size:"small",type:oe(t.endpoint_kind),round:""},{default:r(()=>[u(i(re(t.endpoint_kind)),1)]),_:2},1032,["type"])]),a("div",W,[c(n(b),{size:"small",type:de(t),round:""},{default:r(()=>[u(i(le(t)),1)]),_:2},1032,["type"]),t.inbound_status==="blocked"?(l(),g(n(b),{key:0,size:"small",type:"error",round:""},{default:r(()=>[u(i(V(t.inbound_status)),1)]),_:2},1024)):w("",!0)]),a("dl",G,[a("div",null,[a("dt",null,i(n(s)("devices.os")),1),a("dd",null,i(me(t)||n(s)("devices.unknown")),1)]),a("div",null,[a("dt",null,i(n(s)("devices.agentVersion")),1),a("dd",null,i(L(t.hermes_agent_version)),1)]),a("div",null,[a("dt",null,i(n(s)("devices.webUiVersion")),1),a("dd",null,i(L(t.hermes_web_ui_version)),1)]),a("div",null,[a("dt",null,i(n(s)("devices.responseMs")),1),a("dd",null,i(t.response_ms)+"ms",1)])]),a("div",K,[ce(t)?(l(),g(n(p),{key:0,size:"tiny",type:"primary",loading:v.value===t.id,onClick:h=>y(t,"request")},{default:r(()=>[u(i(n(s)("devices.requestPairing")),1)]),_:1},8,["loading","onClick"])):w("",!0),_e(t)?(l(),g(n(p),{key:1,size:"tiny",quaternary:"",type:"error",loading:v.value===t.id,onClick:h=>y(t,"block")},{default:r(()=>[u(i(n(s)("devices.block")),1)]),_:1},8,["loading","onClick"])):(l(),g(n(p),{key:2,size:"tiny",quaternary:"",loading:v.value===t.id,onClick:h=>y(t,"unblock")},{default:r(()=>[u(i(n(s)("devices.unblock")),1)]),_:1},8,["loading","onClick"]))])]))),128))]))])]),_:1},8,["show"]),c(n(be),{show:S.value,"onUpdate:show":o[1]||(o[1]=t=>S.value=t),width:"min(420px, 100vw)",placement:"right"},{default:r(()=>[c(n(ke),{title:n(s)("devices.requests"),closable:""},{default:r(()=>[_.value.requests.length===0?(l(),f("div",X,i(n(s)("devices.noRequests")),1)):(l(),f("div",Z,[(l(!0),f(x,null,j(_.value.requests,t=>(l(),f("article",{key:t.id,class:"request-item"},[a("div",null,[a("div",ee,i(t.computer_name||t.ip),1),a("div",te,i(t.ip)+":"+i(t.http_port),1),a("div",ne,[c(n(b),{size:"small",type:fe(t),round:""},{default:r(()=>[u(i(ve(t)),1)]),_:2},1032,["type"]),c(n(b),{size:"small",type:t.inbound_status==="blocked"?"error":t.inbound_status==="rejected"?"warning":t.inbound_status==="approved"?"success":"info",round:""},{default:r(()=>[u(i(V(t.inbound_status)),1)]),_:2},1032,["type"])])]),a("div",se,[t.inbound_status==="pending"?(l(),g(n(p),{key:0,size:"tiny",type:"success",loading:v.value===t.id,onClick:h=>y(t,"approve")},{default:r(()=>[u(i(n(s)("devices.approve")),1)]),_:1},8,["loading","onClick"])):w("",!0),t.inbound_status==="pending"?(l(),g(n(p),{key:1,size:"tiny",quaternary:"",type:"warning",loading:v.value===t.id,onClick:h=>y(t,"reject")},{default:r(()=>[u(i(n(s)("devices.reject")),1)]),_:1},8,["loading","onClick"])):w("",!0),t.inbound_status==="pending"?(l(),g(n(p),{key:2,size:"tiny",quaternary:"",type:"error",loading:v.value===t.id,onClick:h=>y(t,"block")},{default:r(()=>[u(i(n(s)("devices.block")),1)]),_:1},8,["loading","onClick"])):w("",!0),c(n(Ce),{onPositiveClick:h=>y(t,"deleteHistory")},{trigger:r(()=>[c(n(p),{size:"tiny",quaternary:"",type:"error",loading:v.value===t.id},{default:r(()=>[u(i(n(s)("devices.deleteHistory")),1)]),_:1},8,["loading"])]),default:r(()=>[u(" "+i(n(s)("devices.deleteHistoryConfirm")),1)]),_:2},1032,["onPositiveClick"])])]))),128))]))]),_:1},8,["title"])]),_:1},8,["show"])]))}})})),Me=$((()=>{})),Ee,Ye=$((()=>{ie(),ie(),Me(),Le(),Ee=Be(ae,[["__scopeId","data-v-bd674c66"]])}));Ye();export{Ee as default};
|