@yeaft/webchat-agent 1.0.351 → 1.0.352
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/connection/message-router.js +29 -1
- package/index.js +2 -0
- package/local-runtime/server/handlers/agent-sync.js +14 -0
- package/local-runtime/server/handlers/client-misc.js +21 -0
- package/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +52 -33
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +2 -2
- package/local-runtime/web/style.bundle.css +1 -1
- package/local-runtime/web/style.bundle.css.gz +0 -0
- package/package.json +1 -1
- package/yeaft/config-api.js +53 -1
- package/yeaft/config.js +54 -0
- package/yeaft/conversation/history-index-worker.js +13 -10
- package/yeaft/conversation/internal-control.js +1 -0
- package/yeaft/debug-trace.js +164 -47
- package/yeaft/engine.js +318 -28
- package/yeaft/llm/adapter.js +38 -0
- package/yeaft/llm/anthropic.js +11 -8
- package/yeaft/llm/openai-responses.js +11 -8
- package/yeaft/llm/router.js +1 -1
- package/yeaft/perf-trace.js +156 -24
- package/yeaft/session.js +7 -0
- package/yeaft/sessions/session-crud.js +19 -4
- package/yeaft/sub-agent/runner.js +4 -0
- package/yeaft/tools/agent.js +4 -0
- package/yeaft/tools/ask-user.js +1 -0
- package/yeaft/tools/bash.js +4 -0
- package/yeaft/tools/create-work-item.js +3 -0
- package/yeaft/tools/file-read.js +1 -0
- package/yeaft/tools/glob.js +1 -0
- package/yeaft/tools/grep.js +1 -0
- package/yeaft/tools/history-search.js +74 -20
- package/yeaft/tools/js-repl.js +1 -0
- package/yeaft/tools/list-agents.js +1 -0
- package/yeaft/tools/list-dir.js +1 -0
- package/yeaft/tools/list-tasks.js +1 -0
- package/yeaft/tools/read-task-log.js +1 -0
- package/yeaft/tools/route-forward.js +4 -0
- package/yeaft/tools/send-message.js +3 -0
- package/yeaft/tools/types.js +8 -0
- package/yeaft/tools/wait-agent.js +1 -0
- package/yeaft/utf8.js +44 -0
- package/yeaft/web-bridge.js +6 -0
- package/yeaft/work-center/runner.js +1 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var F=(e,t,s)=>()=>{if(s)throw s[0];try{return e&&(t=e(e=0)),t}catch(n){throw s=[n],n}};var jm=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(s){throw t=0,s}};function Kl(e,t){let s=nacl.randomBytes(24),n=JSON.stringify(e),r,i=!1;n.length>512?(r=pako.gzip(n),i=!0):r=nacl.util.decodeUTF8(n);let o=nacl.secretbox(r,s,t),a={n:nacl.util.encodeBase64(s),c:nacl.util.encodeBase64(o)};return i&&(a.z=!0),a}function zl(e,t){try{let s=nacl.util.decodeBase64(e.n),n=nacl.util.decodeBase64(e.c),r=nacl.secretbox.open(n,s,t);if(!r)return null;if(e.z){let i=pako.ungzip(r,{to:"string"});return JSON.parse(i)}else return JSON.parse(nacl.util.encodeUTF8(r))}catch{return null}}function Yl(e){return e&&typeof e=="object"&&typeof e.n=="string"&&typeof e.c=="string"}function pt(e){return nacl.util.decodeBase64(e)}var Dr=F(()=>{});function Dt(){return globalThis.localStorage||null}function Ql(){let e=$r();for(let t of Io)try{t(e)}catch{}}function Um(){try{Dt()?.removeItem(xn),Dt()?.removeItem(Tn)}catch{}}function Km(e){return String(e||"").trim()||null}function Gl(e,t){if(!Mn(t))return{};try{let s=JSON.parse(Dt()?.getItem(e)||"null");return!s||typeof s!="object"||Array.isArray(s)||s.ownerId!==t.ownerId||!s.records||typeof s.records!="object"||Array.isArray(s.records)?(Dt()?.removeItem(e),{}):s.records}catch{try{Dt()?.removeItem(e)}catch{}return{}}}function Xl(e,t,s){if(!Mn(s))return!1;try{return Dt()?.setItem(e,JSON.stringify({ownerId:s.ownerId,records:t||{}})),!0}catch{return!1}}function ft(e){let t=Km(e);if(!t)return Co(),null;if(cs!==t){cs=t,Lr+=1;for(let s of[xn,Tn])try{let n=JSON.parse(Dt()?.getItem(s)||"null");(!n||n.ownerId!==t)&&Dt()?.removeItem(s)}catch{try{Dt()?.removeItem(s)}catch{}}Ql()}return $r()}function Co(){cs=null,Lr+=1,Um(),Ql()}function $r(){return cs?{ownerId:cs,epoch:Lr}:null}function Mn(e){return!!e&&!!cs&&e.ownerId===cs&&e.epoch===Lr}function Zl(e){return{drafts:Gl(xn,e),outbox:Gl(Tn,e)}}function Ao(e,t){return Xl(xn,e,t)}function Pn(e,t){return Xl(Tn,e,t)}function Jl(e){return typeof e!="function"?()=>{}:(Io.add(e),()=>Io.delete(e))}var xn,Tn,cs,Lr,Io,Yb,xo=F(()=>{xn="yeaft-work-center-composer-drafts-v1",Tn="yeaft-work-center-message-outbox-v1",cs=null,Lr=0,Io=new Set;Yb=Object.freeze({drafts:xn,outbox:Tn})});var zm,Ym,De,gt=F(()=>{Dr();xo();({defineStore:zm}=Pinia),Ym=1800*1e3,De=zm("auth",{state:()=>({skipAuth:!1,emailVerification:!1,passwordResetEnabled:!1,totpEnabled:!1,registrationEnabled:!1,aadEnabled:!1,aadClientId:null,aadTenantId:null,ssoProviders:{github:!1,google:!1,wechat:!1,alipay:!1},linkedIdentities:[],hasPassword:!1,identitiesLoading:!1,identitiesError:null,initialized:!1,authGeneration:0,isAuthenticated:!1,token:null,sessionKey:null,userId:null,role:null,loginStep:"credentials",tempToken:null,emailHint:null,setupToken:null,totpSecret:null,qrCode:null,error:null,loading:!1,qrPanel:null,_qrPollTimer:null,_sessionRefreshTimer:null,_sessionRefreshVisibilityHandler:null}),actions:{async initialize(){if(this.initialized)return this.isAuthenticated;try{if(await this.checkAuthMode(),this.skipAuth&&this.isAuthenticated)return!0;let e=!1;return typeof window<"u"&&typeof this.consumeSsoRedirect=="function"&&(e=this.consumeSsoRedirect()),!this.isAuthenticated&&!e&&await this.restoreSession(),this.isAuthenticated}finally{this.initialized=!0}},async checkAuthMode(){try{let t=await(await fetch("/api/auth/mode")).json();this.skipAuth=t.skipAuth,this.emailVerification=t.emailVerification,this.passwordResetEnabled=!!t.passwordResetEnabled,this.totpEnabled=t.totpEnabled,this.registrationEnabled=t.registrationEnabled||!1,this.aadEnabled=t.aadEnabled||!1,this.aadClientId=t.aadClientId||null,this.aadTenantId=t.aadTenantId||null,this.ssoProviders=Object.assign({github:!1,google:!1,wechat:!1,alipay:!1},t.ssoProviders||{}),this.skipAuth&&(this.userId="skip-auth",ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated")}catch{}},async login(e,t){this.loading=!0,this.error=null;try{let n=await(await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})})).json();return n.success?n.needTotpSetup?(this.setupToken=n.setupToken,this.totpSecret=n.totpSecret,this.qrCode=n.qrCode,this.loginStep="totp-setup",!0):n.needTotpCode?(this.tempToken=n.tempToken,this.loginStep="totp",!0):n.needEmailCode?(this.tempToken=n.tempToken,this.emailHint=n.emailHint,this.loginStep="verification",!0):(this.token=n.token,this.sessionKey=n.sessionKey?pt(n.sessionKey):null,this.role=n.role||"pro",this.userId=n.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",n.token),this.startSessionRefresh(),!0):(this.error=n.error||"Login failed",!1)}catch(s){return this.error=s.message||"Network error",!1}finally{this.loading=!1}},async loginWithMicrosoft(){if(!this.aadEnabled||!this.aadClientId||!this.aadTenantId)return this.error="Microsoft login is not configured",!1;if(typeof msal>"u"||!msal.PublicClientApplication)return this.error="Microsoft authentication library not loaded",!1;this.loading=!0,this.error=null;try{let e={auth:{clientId:this.aadClientId,authority:`https://login.microsoftonline.com/${this.aadTenantId}`,redirectUri:window.location.origin+"/auth/callback"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1}},t=new msal.PublicClientApplication(e);await t.initialize();let s=await t.loginPopup({scopes:["openid","profile","email"]});if(!s||!s.idToken)return this.error="Microsoft login failed: no token received",!1;let r=await(await fetch("/api/auth/aad",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:s.idToken})})).json();return r.success?(this.token=r.token,this.sessionKey=r.sessionKey?pt(r.sessionKey):null,this.role=r.role||"pro",this.userId=r.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",r.token),this.startSessionRefresh(),!0):(this.error=r.error||"Microsoft login failed",!1)}catch(e){return e.errorCode==="user_cancelled"||e.name==="BrowserAuthError"?(this.error=null,!1):(this.error=e.message||"Microsoft login failed",!1)}finally{this.loading=!1}},async verifyTotpCode(e){this.loading=!0,this.error=null;try{let s=await(await fetch("/api/auth/verify-totp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tempToken:this.tempToken,totpCode:e})})).json();return s.success?s.needEmailCode?(this.tempToken=s.tempToken,this.emailHint=s.emailHint,this.loginStep="verification",!0):(this.token=s.token,this.sessionKey=s.sessionKey?pt(s.sessionKey):null,this.role=s.role||"pro",this.userId=s.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",this.tempToken=null,localStorage.setItem("authToken",s.token),this.startSessionRefresh(),!0):(this.error=s.error||"TOTP verification failed",!1)}catch(t){return this.error=t.message||"Network error",!1}finally{this.loading=!1}},async completeTotpSetup(e){this.loading=!0,this.error=null;try{let s=await(await fetch("/api/auth/setup-totp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({setupToken:this.setupToken,totpCode:e})})).json();return s.success?(this.setupToken=null,this.totpSecret=null,this.qrCode=null,s.needEmailCode?(this.tempToken=s.tempToken,this.emailHint=s.emailHint,this.loginStep="verification",!0):(this.token=s.token,this.sessionKey=s.sessionKey?pt(s.sessionKey):null,this.role=s.role||"pro",this.userId=s.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",s.token),this.startSessionRefresh(),!0)):(this.error=s.error||"TOTP setup failed",!1)}catch(t){return this.error=t.message||"Network error",!1}finally{this.loading=!1}},async verifyCode(e){this.loading=!0,this.error=null;try{let s=await(await fetch("/api/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tempToken:this.tempToken,code:e})})).json();return s.success?(this.token=s.token,this.sessionKey=s.sessionKey?pt(s.sessionKey):null,this.role=s.role||"pro",this.userId=s.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",this.tempToken=null,this.emailHint=null,localStorage.setItem("authToken",s.token),this.startSessionRefresh(),!0):(this.error=s.error||"Verification failed",!1)}catch(t){return this.error=t.message||"Network error",!1}finally{this.loading=!1}},async register(e,t,s,n){this.loading=!0,this.error=null;try{let i=await(await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t,email:s||void 0,invitationCode:n})})).json();return i.success?!0:(this.error=i.error||"Registration failed",!1)}catch(r){return this.error=r.message||"Network error",!1}finally{this.loading=!1}},showRegister(){this.loginStep="register",this.error=null},loginWithSso(e){window.location.href=`/api/auth/sso/${encodeURIComponent(e)}/start`},async loginWithAlipayMobile({intent:e="login"}={}){if(!await this.startSsoQr("alipay",{intent:e}))return!1;let s=this.qrPanel?.authorizeUrl;if(!s)return!1;let n=`alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent(s)}`;return this.qrPanel={...this.qrPanel,mobileDeepLink:!0},window.location.href=n,!0},async startSsoQr(e,{intent:t="login"}={}){this.cancelSsoQr(),this.error=null;try{let s=new URLSearchParams;if(t==="bind"){if(!this.isAuthenticated)return this.error="You must be logged in to bind an identity",!1;s.set("intent","bind")}let n=s.toString(),r=`/api/auth/sso/${encodeURIComponent(e)}/start-qr${n?"?"+n:""}`,i=await fetch(r),o=await i.json();return!i.ok||!o.success?(this.error=o.error||"Failed to start QR login",!1):(this.qrPanel={provider:e,intent:t,authorizeUrl:o.authorizeUrl,state:o.state,status:"pending",error:null},this._startQrPoll(),!0)}catch(s){return this.error=s.message||"Network error",!1}},_startQrPoll(){this._stopQrPollTimer();let e=async()=>{if(!this.qrPanel)return;let t=this.qrPanel.state;try{let n=await(await fetch(`/api/auth/sso/poll/${encodeURIComponent(t)}`)).json();if(!this.qrPanel||this.qrPanel.state!==t||n.status==="pending")return;if(n.status==="login"){this.token=n.token,this.sessionKey=n.sessionKey?pt(n.sessionKey):null,this.role=n.role||"pro",this.userId=n.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",n.token),this.startSessionRefresh(),this.cancelSsoQr();return}if(n.status==="bind"){this.qrPanel={...this.qrPanel,status:"bound"},this._stopQrPollTimer();return}this.qrPanel={...this.qrPanel,status:"error",error:n.error||"SSO failed"},this._stopQrPollTimer()}catch{}};this._qrPollTick=e,this._qrPollTimer=setInterval(e,2e3),typeof document<"u"&&!this._qrVisHandler&&(this._qrVisHandler=()=>{typeof document<"u"&&document.visibilityState&&document.visibilityState!=="visible"||!this.qrPanel||!this._qrPollTick||(this._qrPollTick(),this._qrPollTimer&&clearInterval(this._qrPollTimer),this._qrPollTimer=setInterval(this._qrPollTick,2e3))},document.addEventListener("visibilitychange",this._qrVisHandler),typeof window<"u"&&window.addEventListener("pageshow",this._qrVisHandler))},_stopQrPollTimer(){this._qrPollTimer&&(clearInterval(this._qrPollTimer),this._qrPollTimer=null),this._qrVisHandler&&(typeof document<"u"&&document.removeEventListener("visibilitychange",this._qrVisHandler),typeof window<"u"&&window.removeEventListener("pageshow",this._qrVisHandler),this._qrVisHandler=null),this._qrPollTick=null},cancelSsoQr(){this._stopQrPollTimer(),this.qrPanel=null},bindSso(e){if(!this.isAuthenticated){this.error="You must be logged in to bind an identity";return}let t=new URLSearchParams({intent:"bind"});window.location.href=`/api/auth/sso/${encodeURIComponent(e)}/start?${t.toString()}`},consumeSsoRedirect(){let e=window.location.hash||"",t=e.indexOf("?");if(!e.startsWith("#/sso-complete")||t<0)return!1;let s=new URLSearchParams(e.slice(t+1)),n=s.get("token"),r=s.get("sessionKey"),i=s.get("role"),o=s.get("userId");if(!n)return!1;this.token=n,this.sessionKey=r?pt(r):null,this.role=i||"pro",this.userId=o||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",n),this.startSessionRefresh();try{history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}return!0},async loadIdentities(){if(this.isAuthenticated){this.identitiesLoading=!0,this.identitiesError=null;try{let e=await fetch("/api/auth/identities"),t=await e.json();if(!e.ok||!t.success){this.identitiesError=t.error||"Failed to load identities";return}this.linkedIdentities=t.identities||[],this.hasPassword=!!t.hasPassword}catch(e){this.identitiesError=e.message||"Network error"}finally{this.identitiesLoading=!1}}},async unbindIdentity(e){if(!this.isAuthenticated)return!1;this.identitiesError=null;try{let t=await fetch(`/api/auth/identities/${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json();return!t.ok||!s.success?(this.identitiesError=s.error||"Failed to unbind",!1):(this.linkedIdentities=this.linkedIdentities.filter(n=>n.provider!==e),!0)}catch(t){return this.identitiesError=t.message||"Network error",!1}},async refreshSession(){let e=this.token,t=this.authGeneration,s=this.isAuthenticated;try{let n=await fetch("/api/user/profile",{headers:e?{Authorization:`Bearer ${e}`}:{}});if(this.handleAuthResponse(n,e,t,s)||!n.ok)return!1;let r=await n.json().catch(()=>({}));if(t!==this.authGeneration||this.token!==e)return this.isAuthenticated;let i=n.headers?.get?.("X-New-Token"),o=localStorage.getItem("authToken");return i&&this.token===e&&(!o||o===e)&&(this.token=i,localStorage.setItem("authToken",i)),r?.role&&(this.role=r.role),this.userId=r?.userId||null,ft(this.userId),!0}catch{return!1}},startSessionRefresh(){if(this.stopSessionRefresh(),!this.isAuthenticated||this.skipAuth)return;let e=()=>{typeof document<"u"&&document.visibilityState&&document.visibilityState!=="visible"||this.refreshSession()};this._sessionRefreshTimer=setInterval(e,Ym),this._sessionRefreshVisibilityHandler=e,typeof document<"u"&&document.addEventListener("visibilitychange",e),typeof window<"u"&&window.addEventListener("pageshow",e)},stopSessionRefresh(){this._sessionRefreshTimer&&(clearInterval(this._sessionRefreshTimer),this._sessionRefreshTimer=null),this._sessionRefreshVisibilityHandler&&(typeof document<"u"&&document.removeEventListener("visibilitychange",this._sessionRefreshVisibilityHandler),typeof window<"u"&&window.removeEventListener("pageshow",this._sessionRefreshVisibilityHandler),this._sessionRefreshVisibilityHandler=null)},async logout(){try{let e={"Content-Type":"application/json"};this.token&&(e.Authorization=`Bearer ${this.token}`),await fetch("/api/auth/logout",{method:"POST",headers:e})}catch{}this.clearStoredSession()},clearStoredSession(e=null){this.reset(),localStorage.removeItem("authToken"),e&&(this.error=e)},getActiveToken(){if(this.token)return this.token;let e=localStorage.getItem("authToken");return e&&(this.token=e),this.token},handleAuthResponse(e,t=null,s=this.authGeneration,n=this.isAuthenticated,r=void 0){if(!e||e.status!==401||!n||s!==this.authGeneration)return!1;let i=this.token||localStorage.getItem("authToken")||null;return t!==i?!1:(this.handleAuthFailure(r,t,s),!0)},handleAuthFailure(e="Session expired. Please log in again.",t=null,s=this.authGeneration){if(s!==this.authGeneration)return!1;let n=this.token||localStorage.getItem("authToken")||null;return t!==n||this.clearStoredSession(e),!1},async restoreSession(){let e=localStorage.getItem("authToken"),t=this.authGeneration,s=this.isAuthenticated||!!e;try{let n=await fetch("/api/user/profile",{headers:e?{Authorization:`Bearer ${e}`}:{}});if(this.handleAuthResponse(n,e,t,s))return!1;if(!n.ok)return this.error="Failed to restore session",!1;let r=await n.json();if(t!==this.authGeneration)return this.isAuthenticated;let i=n.headers?.get?.("X-New-Token"),o=this.getActiveToken();if(o!==e)return this.isAuthenticated;let a=i&&(!o||o===e)?i:o||e;return this.token=a,a&&a!==e&&localStorage.setItem("authToken",a),this.role=r?.role||"pro",this.userId=r?.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",this.startSessionRefresh(),!0}catch(n){return this.error=n.message||"Failed to restore session",!1}},setSessionKey(e){e&&(this.sessionKey=pt(e))},backToCredentials(){this.loginStep="credentials",this.tempToken=null,this.emailHint=null,this.setupToken=null,this.totpSecret=null,this.qrCode=null,this.error=null},async requestPasswordReset(e){this.error=null;try{let s=await(await fetch("/api/auth/password-reset/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})})).json();return s.success?s.resetToken||null:(this.error=s.error||"Failed to request password reset",null)}catch(t){return this.error=t.message||"Network error",null}},async verifyPasswordReset(e,t,s){this.error=null;try{let r=await(await fetch("/api/auth/password-reset/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({resetToken:e,code:t,newPassword:s})})).json();return r.success?!0:(this.error=r.error||"Failed to reset password",!1)}catch(n){return this.error=n.message||"Network error",!1}},async deleteAccount({currentPassword:e,confirm:t}={}){if(!this.isAuthenticated)return{success:!1,error:"Not authenticated"};try{let s=await fetch("/api/user/me",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:e,confirm:t})}),n=await s.json();return!s.ok||!n.success?{success:!1,error:n.error||"Failed to delete account"}:(this.clearStoredSession(),{success:!0})}catch(s){return{success:!1,error:s.message||"Network error"}}},reset(){Co(),this.authGeneration+=1,this.stopSessionRefresh(),this.isAuthenticated=!1,this.token=null,this.sessionKey=null,this.userId=null,this.role=null,this.loginStep="credentials",this.tempToken=null,this.emailHint=null,this.setupToken=null,this.totpSecret=null,this.qrCode=null,this.error=null,this.loading=!1}}})});function Le(e,t){let s=Lt?.value||"zh-CN",r=(Hs[s]||Hs["zh-CN"]||{})[e];if(r===void 0&&s!=="zh-CN"&&(r=(Hs["zh-CN"]||{})[e]),r===void 0)return e;if(t)for(let[i,o]of Object.entries(t))r=r.replace(new RegExp(`\\{${i}\\}`,"g"),o);return r}function Gm(){return Lt?.value||"zh-CN"}function Rn(e){Hs[e]&&(Lt&&(Lt.value=e),localStorage.setItem("locale",e),document.documentElement.setAttribute("lang",e))}function Qm(){let e=localStorage.getItem("locale");return e&&Hs[e]?e:(navigator.language||navigator.userLanguage||"").startsWith("en")?"en":"zh-CN"}function ec(e,t){return Hs=t,Lt=Vue.ref(Qm()),document.documentElement.setAttribute("lang",Lt.value),e.config.globalProperties.$t=Le,e.config.globalProperties.$locale=Lt,e.provide("t",Le),e.provide("locale",Lt),{t:Le,setLocale:Rn,getLocale:Gm,locale:Lt}}var Lt,Hs,$t=F(()=>{Lt=null,Hs={}});function Vr(e){if(e==null||e==="")return"claude-code";if(Xm.has(e))return e;throw new Error(`Unknown Chat runtime provider: ${e}`)}function zt(e){if(typeof e!="string"||!e)throw new Error("Chat catalog key requires conversationId");return`chat:${e}`}function Hr(e,t){if(typeof e!="string"||!e||typeof t!="string"||!t)throw new Error("Yeaft catalog key requires agentId and sessionId");return`yeaft:${e}:${t}`}function _n(e,t,s={}){let n=e.sessionCatalog.map(i=>({...i})),r=Array.isArray(e.hiddenSessionCatalog)?e.hiddenSessionCatalog.map(i=>({...i})):null;return e.sessionCatalogMutationRequests[t]={previousCatalog:n,previousHiddenCatalog:r,...s},n}function tc(e,t){let s=t?.requestId?e.sessionCatalogMutationRequests[t.requestId]:null;return s?(delete e.sessionCatalogMutationRequests[t.requestId],t.ok!==!0&&(e.sessionCatalog=s.previousCatalog,Array.isArray(s.previousHiddenCatalog)&&(e.hiddenSessionCatalog=s.previousHiddenCatalog)),!0):!1}function sc(e,t,s="recent",n=null){let r=zt(t),i=e.chatHistoryRequests[r]||{},o=Number(i.generation||0)+1,a=`chat_history_${o}_${crypto.randomUUID()}`;return e.chatHistoryRequests[r]={requestId:a,catalogKey:r,generation:o,mode:s,cursor:n,connectionGeneration:Number(e.chatHistoryConnectionGeneration||0),loading:!0,cancelled:!1,error:null},a}function To(e,t,s,n){let r=e.chatHistoryRequests[t];return r?.requestId!==s?!1:(e.chatHistoryRequests[t]={...r,loading:!1,cancelled:!0,error:n},!0)}var Xm,Mo=F(()=>{Xm=new Set(["claude-code","copilot"])});function Os(e,t,s=""){En&&(clearTimeout(En),En=null),e.sessionLoading=t,e.sessionLoadingText=s,t&&(En=setTimeout(()=>{e.sessionLoading&&(e.sessionLoading=!1,e.sessionLoadingText=""),En=null},Zm))}function St(e){Os(e,!1)}function nc(e){if(e.currentConversation){e.pendingRecovery=null;return}let t=e.lastUsedSession,s=e.lastUsedAgent;if(t&&t.sessionId&&s){let n=e.agents.find(r=>r.id===s&&r.online);n&&(e.pendingRecovery={agentId:s,agentName:n.name,sessionId:t.sessionId,workDir:t.workDir,provider:Vr(t.provider),catalogKey:t.catalogKey||null},e.recoveryDismissed=!1)}}function rc(e){if(!e.pendingRecovery)return;let{agentId:t,sessionId:s,workDir:n,provider:r}=e.pendingRecovery;e.selectAgent(t),setTimeout(()=>{e.resumeConversation(s,n,t,{provider:Vr(r)}),e.pendingRecovery=null,e.recoveryDismissed=!1},500)}function ic(e){e.recoveryDismissed=!0,e.pendingRecovery=null}function oc(e,t){let s=e.conversations.find(n=>n.id===t);s&&(e.activeConversations=[t],e.currentWorkDir=s.workDir,e.messagesMap[t]?.length>0||(s.claudeSessionId?(e.messagesMap[t]=[],Os(e,!0,Le("chat.session.loadingHistory")),e.sendWsMessage({type:"resume_conversation",agentId:s.agentId||e.currentAgent,claudeSessionId:s.claudeSessionId,workDir:s.workDir,conversationId:t})):(e.messagesMap[t]=[],e.requestChatHistory?.(t,{mode:"recent",turns:5}))),e.sendWsMessage({type:"select_conversation",conversationId:t}))}function ac(e){if(e.panels.length>0)return;let t=localStorage.getItem("panels");if(!t)return;let s;try{s=JSON.parse(t)}catch{localStorage.removeItem("panels");return}if(!Array.isArray(s)||s.length<2){localStorage.removeItem("panels");return}let n=new Set(e.conversations.map(i=>i.id)),r=s.filter(i=>i&&typeof i.id=="string").map(i=>({id:i.id,conversationId:i.conversationId&&n.has(i.conversationId)?i.conversationId:null,activeRightPanel:i.activeRightPanel||null}));if(r.length<2){localStorage.removeItem("panels");return}e.panels=r,e.activePanelId=r[0]?.id||null;for(let i of r)i.conversationId&&(e.activeConversations.includes(i.conversationId)||e.activeConversations.push(i.conversationId),e.messagesMap[i.conversationId]||(e.messagesMap[i.conversationId]=[]),e.messagesMap[i.conversationId].length||e.requestChatHistory?.(i.conversationId,{mode:"recent",turns:5}))}function ds(e){if(e.currentAgent){if(localStorage.setItem("lastUsedAgent",e.currentAgent),localStorage.setItem("lastViewedConversation",e.currentConversation||""),e.lastViewedConversation=e.currentConversation,e.currentConversation){let t=e.conversations.find(s=>s.id===e.currentConversation);if(t?.claudeSessionId&&t?.workDir){let s=Vr(t.provider),n={sessionId:t.claudeSessionId,workDir:t.workDir,agentId:t.agentId||e.currentAgent,provider:s,catalogKey:zt(t.id),version:2};localStorage.setItem("lastUsedSession",JSON.stringify(n)),localStorage.setItem("lastViewedSessionRef",JSON.stringify(n)),e.lastUsedSession=n}}e.lastUsedAgent=e.currentAgent,e.panels.length>0?localStorage.setItem("panels",JSON.stringify(e.panels)):localStorage.removeItem("panels")}}function lc(e){return e.lastUsedSession}function cc(e){localStorage.removeItem("lastUsedAgent"),localStorage.removeItem("lastUsedSession"),localStorage.removeItem("lastViewedSessionRef"),localStorage.removeItem("lastViewedConversation"),localStorage.removeItem("panels"),localStorage.removeItem("splitPanesSaved"),e.lastUsedAgent=null,e.lastUsedSession=null,e.lastViewedConversation=null}function dc(e,t,s){if(!e.currentAgent){e.historySessionsLoading=!1;return}if(!t){e.historySessions=[],e.historySessionsLoading=!1;return}let n=Date.now().toString();e._historySessionsRequestId=n,e.historySessionsLoading=!0,e.historySessions=[],e.sendWsMessage({type:"list_history_sessions",workDir:t,provider:s||"claude-code",requestId:n})}function uc(e,t){if(!e.currentAgent)return e.foldersLoading=!1,Promise.resolve();e.foldersLoading=!0,e.folders=[];let s=Date.now().toString();return e._foldersRequestId=s,new Promise(n=>{e._foldersResolve&&e._foldersResolve(),e._foldersResolve=n,e.sendWsMessage({type:"list_folders",provider:t||"claude-code",requestId:s}),setTimeout(()=>{e._foldersResolve===n&&(e._foldersResolve(),e._foldersResolve=null,e.foldersLoading=!1)},1e4)})}function pc(e,t,s){if(!t)return e.foldersLoading=!1,Promise.resolve();e.foldersLoading=!0,e.folders=[];let n=Date.now().toString();return e._foldersRequestId=n,new Promise(r=>{e._foldersResolve&&e._foldersResolve(),e._foldersResolve=r,e.sendWsMessage({type:"list_folders",agentId:t,provider:s||"claude-code",requestId:n}),setTimeout(()=>{e._foldersResolve===r&&(e._foldersResolve(),e._foldersResolve=null,e.foldersLoading=!1)},1e4)})}function fc(e,t,s){if(!t)return Promise.resolve([]);let n=`models-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return e._modelsRequestId=n,e.providerModelsLoading=!0,new Promise(r=>{e._modelsResolve&&e._modelsResolve([]),e._modelsTimeout&&clearTimeout(e._modelsTimeout),e._modelsResolve=r,e.sendWsMessage({type:"list_models",agentId:t,provider:s||"claude-code",requestId:n}),e._modelsTimeout=setTimeout(()=>{e._modelsResolve===r&&(e._modelsResolve([]),e._modelsResolve=null,e.providerModelsLoading=!1),e._modelsTimeout=null},1e4)})}function gc(e,t,s,n){if(!t){e.historySessionsLoading=!1;return}if(!s){e.historySessions=[],e.historySessionsLoading=!1;return}let r=Date.now().toString();e._historySessionsRequestId=r,e.historySessionsLoading=!0,e.historySessions=[],e.sendWsMessage({type:"list_history_sessions",agentId:t,workDir:s,provider:n||"claude-code",requestId:r})}async function mc(e,t=20){if(De().isAuthenticated){e.globalSessionsLoading=!0;try{let n=await fetch(`/api/sessions?limit=${t}`);if(n.ok){let r=await n.json();e.globalSessions=r.sessions||[]}}catch{}finally{e.globalSessionsLoading=!1}}}async function hc(e,t){if(!De().isAuthenticated)return!1;try{if((await fetch(`/api/sessions/${t}`,{method:"DELETE"})).ok)return e.globalSessions=e.globalSessions.filter(r=>r.id!==t),!0}catch{}return!1}function Po(e,t){return t.agentId?e.agents.find(s=>s.id===t.agentId):t.agentName?e.agents.find(s=>s.name===t.agentName):null}function vc(e,t){let s=Po(e,t);return s&&s.online}var Zm,En,us=F(()=>{gt();$t();Mo();Zm=3e4,En=null});function yc(e){return e?.code===1008&&String(e.reason||"").toLowerCase().includes("authentication")}function bc(e){let t=Dn;Dn=[];for(let{resolve:s,reject:n,timer:r}of t)clearTimeout(r),e?s():n(new Error("WebSocket reconnect failed"))}function wc(e,t){if(!e.ws||e.ws.readyState!==WebSocket.OPEN)return!1;if(e.currentView==="yeaft"&&eh.has(t.type)){let s=t.conversationId;if(!s||typeof s=="string"&&s.startsWith("yeaft-")||s===e.yeaftConversationId)return!1}try{if(e.serverEncryptionRequired&&e.sessionKey){let s=Kl(t,e.sessionKey);e.ws.send(JSON.stringify(s))}else e.ws.send(JSON.stringify(t));return!0}catch{return!1}}function Ln(e,t=1e4){return e.ws&&e.ws.readyState===WebSocket.OPEN?Promise.resolve():new Promise((s,n)=>{let r=setTimeout(()=>{Dn=Dn.filter(i=>i.resolve!==s),n(new Error("WebSocket reconnect timeout"))},t);Dn.push({resolve:s,reject:n,timer:r}),(!e.ws||e.ws.readyState!==WebSocket.CONNECTING)&&(e.reconnectAttempts=0,e.connect())})}function kc(e,t){try{let s=JSON.parse(t);return e.sessionKey&&Yl(s)?zl(s,e.sessionKey):s}catch{return null}}function Sc(e){let t=De(),s=location.protocol==="https:"?"wss:":"ws:";e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null);let n=t.getActiveToken?.()||t.token||null,r=t.authGeneration;if(e.ws&&e.ws.readyState===WebSocket.CONNECTING&&e._wsAuthToken===n&&e._wsAuthGeneration===r)return;clearTimeout(e._legacyYeaftSessionHydrateTimer),e._legacyYeaftSessionHydrateTimer=null,e._hasHandledAgentList=!1,e._hasHandledYeaftSessionHydrate=!1,e.yeaftSessionInventoryCompleteSupported=null,e.yeaftSessionHydrateRequestId=null,e.yeaftSessionHydrateSlices=[],e.yeaftSessionHydrateError=null,e._yeaftSessionInventorySocketQuarantined=!1,e.pendingAgentSelection=null,e.agentSwitching=!1,e.ws&&(e.ws.onopen=null,e.ws.onmessage=null,e.ws.onclose=null,e.ws.close(),e.ws=null),e.connectionState=e.reconnectAttempts>0?"reconnecting":"connecting",e.serverEncryptionRequired=!0,e.chatHistoryRequestIdSupported=null,e.chatHistoryConnectionGeneration=Number(e.chatHistoryConnectionGeneration||0)+1;for(let[l,c]of Object.entries(e.projectMutationRequests||{}))c?.resolve?.({ok:!1,requestId:l,error:{code:"connection_changed"}});e.projectMutationRequests={},e.sessionProjects=[];for(let[l,c]of Object.entries(e.chatHistoryRequests||{}))c?.loading&&(e.chatHistoryRequests[l]={...c,loading:!1,cancelled:!0,error:"connection_changed"});let i=Object.values(e.sessionCatalogMutationRequests||{});i.length>0&&(e.sessionCatalog=i[0].previousCatalog,Array.isArray(i[0].previousHiddenCatalog)&&(e.hiddenSessionCatalog=i[0].previousHiddenCatalog),e.sessionCatalogMutationRequests={}),e.sessionCatalogLoaded=!1,e.sessionCatalog=[],e.hiddenSessionCatalog=[],e.activeCatalogKey=null,e._wsAuthToken=n,e._wsAuthGeneration=r;let o=`${s}//${location.host}?type=web`;n&&(o+=`&token=${encodeURIComponent(n)}`);let a=new WebSocket(o);e.ws=a,a.onopen=()=>{if(a===e.ws){e.connectionState="connected",e.reconnectAttempts=0,e.startHeartbeat();try{a.send(JSON.stringify({type:"client_hello",plaintextOk:!0}))}catch{}bc(!0)}},a.onmessage=l=>{if(a!==e.ws)return;let c=e.parseWsMessage(l.data);c&&(c.type,e.handleMessage({...c,_wsAuthToken:n,_wsAuthGeneration:r}))},a.onclose=l=>{if(a!==e.ws){yc(l)&&t.handleAuthFailure?.(void 0,n,r);return}e.authenticated=!1,clearTimeout(e._legacyYeaftSessionHydrateTimer),e._legacyYeaftSessionHydrateTimer=null,e._hasHandledAgentList=!1,e._hasHandledYeaftSessionHydrate=!1,e.yeaftSessionInventoryCompleteSupported=null,e.yeaftSessionHydrateRequestId=null,e.yeaftSessionHydrateSlices=[],e.yeaftSessionHydrateError=null,e.pendingAgentSelection=null,e.agentSwitching=!1;let c=e.connectionState==="updating";if(e.connectionState=c?"updating":"disconnected",e.stopHeartbeat(),St(e),yc(l)){t.handleAuthFailure?.(void 0,n,r),e.reconnectAttempts=0,bc(!1);return}if(e._yeaftReconnectCatchUpPending=!0,c){e.reconnectAttempts=0,e.reconnectTimer=setTimeout(()=>{e.connect()},2e3);return}e.scheduleReconnect()},e.ws.onerror=l=>{}}function Ic(e){if(e.reconnectAttempts>=e.maxReconnectAttempts){e.connectionState="disconnected";return}let t=Math.min(1e3*Math.pow(2,e.reconnectAttempts),3e4);e.reconnectAttempts++,e.connectionState="reconnecting",e.reconnectTimer=setTimeout(()=>{e.connect()},t)}function Cc(e){e.reconnectAttempts=0,e.connect()}function Ac(e){e.stopHeartbeat(),e._lastPongAt=Date.now(),e.heartbeatTimer=setInterval(()=>{if(e.ws&&e.ws.readyState===WebSocket.OPEN){if(Date.now()-e._lastPongAt>45e3){e.ws.close(4e3,"Heartbeat timeout");return}try{e.sendWsMessage({type:"ping"})}catch{}}},25e3)}function xc(e){e.heartbeatTimer&&(clearInterval(e.heartbeatTimer),e.heartbeatTimer=null)}function Tc(e){e._visibilityHandlerInstalled||(e._visibilityHandlerInstalled=!0,document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible")if(!e.ws||e.ws.readyState!==WebSocket.OPEN)e.reconnectAttempts=0,e.connect();else try{e.sendWsMessage({type:"ping"});let t=e._lastPongAt;setTimeout(()=>{e._lastPongAt===t&&e.ws&&e.ws.close(4001,"Visibility resume timeout")},3e3)}catch{e.reconnectAttempts=0,e.connect()}}))}var Dn,eh,Ro=F(()=>{gt();Dr();us();Dn=[];eh=new Set(["sync_messages","refresh_conversation","select_conversation","cancel_execution","update_conversation_settings","ask_user_answer"])});function nh(e){return e?.type==="tool-use"}function _o(e){return e?.type==="tool-summary"}function Eo(e){return nh(e)&&!sh.has(e.toolName)}function Rc(e,t,s,n=s){let r=t==="history"&&(n?.dbMessageId||n?.id)||null;return{...r?{id:`tool_summary_${t}_${r}`,dbMessageId:n?.dbMessageId||null}:{},type:"tool-summary",count:e,omittedCount:e,source:t,isHistory:t!=="live",timestamp:s?.timestamp||s?.startTime||n?.timestamp||n?.startTime||null,sessionId:s?.sessionId??s?.groupId??null,turnId:s?.turnId||null,vpId:s?.vpId||null,speakerVpId:s?.speakerVpId||null}}function rh(e,t){return!_o(e)||!_o(t)?!1:(e.turnId||null)===(t.turnId||null)&&(e.sessionId||null)===(t.sessionId||null)&&(e.speakerVpId||e.vpId||null)===(t.speakerVpId||t.vpId||null)&&(e.source||null)===(t.source||null)}function ih(e,t){let s=(Number(e.count)||0)+(Number(t.count)||0);return e.count=s,e.omittedCount=s,!e.timestamp&&t.timestamp&&(e.timestamp=t.timestamp),Number(t.dbMessageId||0)>Number(e.dbMessageId||0)&&(e.dbMessageId=t.dbMessageId,t.id&&(e.id=t.id)),e}function Mc(e){return[e?.sessionId||"",e?.turnId||"",e?.speakerVpId||e?.vpId||""].join("")}function Pc(e,t,s,n,r=n){if(!t)return;let i=Rc(t,s,n,r),o=e[e.length-1];rh(o,i)?ih(o,i):e.push(i)}function Do(e=[]){let t=[],s=0,n=null,r=null;for(let i of e){if(Eo(i)&&i.isHistory){s+=1,n||(n=i),r=i;continue}Pc(t,s,"history",n,r),s=0,n=null,r=null,t.push(i)}return Pc(t,s,"history",n,r),t}function _c(e=[],t={}){let s=Number.isFinite(t.maxDetailed)?Math.max(1,t.maxDetailed):100;if(!Array.isArray(e)||e.length<=s)return e;let n=e.length;for(let p=e.length-1;p>=0;p-=1){let g=e[p];if(g?.type==="user"||g?.type==="system"||g?.type==="error")break;n=p}let r=e.slice(n),i=new Map;for(let p of r){if(!Eo(p)||p.isHistory)continue;let g=Mc(p);i.set(g,(i.get(g)||0)+1)}let o=new Map;for(let[p,g]of i)g>s&&o.set(p,g-s);if(o.size===0)return e;let a=new Map,l=new Map,c=new Set,d=[],u=(p,g,m)=>{a.set(p,(a.get(p)||0)+g),!l.has(p)&&m&&l.set(p,m)},f=(p,g)=>{if(c.has(p))return;let m=a.get(p)||0;m<=0||(d.push(Rc(m,"live",l.get(p)||g)),c.add(p))};for(let p of r){let g=Mc(p);if(_o(p)&&p.source==="live"&&o.has(g)){u(g,Number(p.count)||0,p);continue}if(Eo(p)&&!p.isHistory&&o.has(g)){let m=o.get(g)||0;if(m>0){o.set(g,m-1),u(g,1,p);continue}}f(g,p),d.push(p)}for(let p of a.keys())f(p,l.get(p));return e.splice(n,e.length-n,...d),e}var sh,Lo=F(()=>{sh=new Set(["TodoWrite","AskUserQuestion"])});function ke(e,t){let s=t==null?"__all__":String(t);return e?`${e}${s}`:s}function $n(e){return typeof e?.entryId=="string"&&e.entryId?`entry:${e.entryId}`:e?.role==="assistant"&&e?.turnId?`live-response:${e.turnId}:${e.speakerVpId||e.vpId||""}`:typeof e?.clientMessageId=="string"&&e.clientMessageId?`client:${e.clientMessageId}`:`message:${e?.messageId||""}`}function Vn(e,t,s){return typeof s!="string"||!s?null:`${ke(e,t)}message:${s}`}function Yt(e,t,s){return typeof s!="string"||!s?null:`${ke(e,t)}client:${s}`}var Fs=F(()=>{});function $o(e,t){return t?t===e.yeaftConversationId?!0:Object.values(e.yeaftConversationIdsByAgent||{}).includes(t):!1}function Hn(e,t,s){s&&(s.type!=="assistant"&&s.type!=="tool-use"||$o(e,t)&&(!s.vpId&&e._currentYeaftVpId&&(s.vpId=e._currentYeaftVpId),!s.turnId&&e._currentYeaftTurnId&&(s.turnId=e._currentYeaftTurnId),!s.speakerVpId&&s.vpId&&(s.speakerVpId=s.vpId)))}function ah(e){let t=[e?.timestamp,e?.createdAt,e?.ts,e?.time,e?.created_at];for(let s of t){if(typeof s=="number"&&Number.isFinite(s)&&s>0)return s;if(typeof s=="string"&&s.trim()){let n=Date.parse(s);if(Number.isFinite(n))return n;let r=Number(s);if(Number.isFinite(r)&&r>0)return r}}return Date.now()}function Or(e){let t=e?.stableKey??e?.messageId??e?.dbMessageId??e?.id;return t==null||t===""?null:String(t)}function Vo(e,t,s){if(!s||typeof s!="object")return null;if(typeof s.uiKey=="string"&&s.uiKey)return s.uiKey;let n=s.entryId||s.stableKey||s.atMessageId||s.messageId||s.dbMessageId||s.id||null;if(n!=null&&n!=="")return s.uiKey=String(n),s.uiKey;let r=`legacy:${t||"conversation"}:`,i=new Set((e?.messagesMap?.[t]||[]).map(a=>a?.uiKey).filter(a=>typeof a=="string"&&a)),o=Number(e?._messageUiKeySequence)||0;do o+=1;while(i.has(`${r}${o}`));return e&&(e._messageUiKeySequence=o),s.uiKey=`${r}${o}`,s.uiKey}function On(e,t,s){for(let n of Array.isArray(s)?s:[])Vo(e,t,n);return s}function Ho(e,t){if(!e||!t)return e;let s=e.type==="user"&&typeof e.id=="string"&&e.id===e.clientMessageId;for(let[n,r]of Object.entries(t))if(r!=null){if(n==="isStreaming"){e.isStreaming&&r===!1&&(e.isStreaming=!1);continue}if(!(n==="uiKey"&&e.uiKey)){if(n==="id"||n==="messageId"){if(s&&t.clientMessageId===e.clientMessageId&&t.messageId&&t.messageId!==e.clientMessageId)continue;(e[n]===void 0||e[n]===null||e[n]==="")&&(e[n]=r);continue}if(!(n==="turnId"&&s&&e.turnId===e.clientMessageId)){if(n==="content"&&typeof r=="string"){e.content||(e.content=r);continue}if(n==="responseKind"&&(r==="progress"||r==="result")){e.responseKind=r;continue}if(n==="attachments"&&Array.isArray(r)){(!Array.isArray(e.attachments)||e.attachments.length===0)&&(e.attachments=r);continue}(e[n]===void 0||e[n]===null||e[n]==="")&&(e[n]=r)}}}return e}function Ec(e=[],t=[]){let s=[],n=new Map,r=new Map;for(let i of[...e,...t]){if(!i)continue;let o=Or(i),a=i.type==="user"&&i.clientMessageId?String(i.clientMessageId):null;if(o&&n.has(o)){Ho(n.get(o),i);continue}if(a&&r.has(a)){let l=r.get(a);Ho(l,i),o&&!n.has(o)&&n.set(o,l);continue}s.push(i),o&&n.set(o,i),a&&r.set(a,i)}return s}function Dc(e,t,s){return!e||e!==t?!1:!s?.loaded&&!s?.loading}function Lc(e,t){return!!t&&!!e?.loaded&&!e?.loading&&Number.isFinite(e?.latestSeq)}function Oo({sessionState:e,hasCachedSessionRows:t,force:s=!1}={}){return e?.loading?!1:s?!e?.loaded:e?.loaded?!1:!t}function lh(e,t,s,n){let r=s?.id?String(s.id):null;if(!r)return!1;let o=(e.messagesMap[t]||[]).find(a=>a?.type==="assistant"&&Or(a)===r);return o?(o.id||(o.id=r),o.messageId||(o.messageId=r),s.ts&&!o.ts&&(o.ts=s.ts),s.timestamp&&!o.timestamp&&(o.timestamp=s.timestamp),s.sessionId&&!o.sessionId&&(o.sessionId=s.sessionId),s.vpId&&!o.vpId&&(o.vpId=s.vpId),s.turnId&&!o.turnId&&(o.turnId=s.turnId),s.threadId&&!o.threadId&&(o.threadId=s.threadId),o.content?typeof o.content=="string"&&(n.startsWith(o.content)?o.content=n:o.content.endsWith(n)||(o.content+=n)):o.content=n,Hn(e,t,o),!0):!1}function Fr(e,t,s){if(!t)return;let n={...s};Vo(e,t,n);let r={...n,id:s.dbMessageId||s.id||Date.now().toString()+Math.random().toString(36).substr(2,9),timestamp:ah(s)};if($o(e,t)&&!r.sessionId&&(r.sessionId=e._currentYeaftSessionId||e.yeaftActiveSessionFilter||oh),$o(e,t)){let o=e._currentYeaftAgentId||Object.entries(e.yeaftConversationIdsByAgent||{}).find(([,c])=>c===t)?.[0]||e.currentAgent||null,a=typeof r.messageId=="string"&&/^m\d+$/.test(r.messageId)?r.messageId:typeof r.id=="string"&&/^m\d+$/.test(r.id)?r.id:null,l=typeof r.clientMessageId=="string"?r.clientMessageId:null;r.stableKey||(r.stableKey=a?Vn(o,r.sessionId,a):Yt(o,r.sessionId,l)),r.uiKey||(r.uiKey=r.stableKey||null),!r.vpId&&e._currentYeaftVpId&&(r.vpId=e._currentYeaftVpId),!r.turnId&&e._currentYeaftTurnId&&(r.turnId=e._currentYeaftTurnId),Hn(e,t,r)}e.messagesMap[t]||(e.messagesMap[t]=[]),Vo(e,t,r);let i=Or(s);if(i){let o=e.messagesMap[t].find(a=>Or(a)===i);if(o)return Ho(o,r),t===e.yeaftConversationId&&e.messagesMap[t].sort((a,l)=>a.timestamp-l.timestamp),o}return e.messagesMap[t].push(r),_c(e.messagesMap[t]),t===e.yeaftConversationId&&e.messagesMap[t].sort((o,a)=>o.timestamp-a.timestamp),r}function $c(e,t,s,n={}){if(!t||!s)return;e.messagesMap[t]||(e.messagesMap[t]=[]);let r=e.messagesMap[t];if(lh(e,t,n,s))return;let i=e._currentYeaftTurnId;if(i){for(let a=r.length-1;a>=0;a--)if(r[a].turnId===i&&r[a].type==="assistant"&&r[a].isStreaming){if(Hn(e,t,r[a]),n.id&&!r[a].id&&(r[a].id=n.id),n.id&&!r[a].messageId&&(r[a].messageId=n.id),r[a].content.endsWith(s))return;r[a].content+=s;return}Fr(e,t,{...n.id?{id:n.id,messageId:n.id}:{},...n.ts?{ts:n.ts}:{},...n.timestamp?{timestamp:n.timestamp}:{},...n.sessionId?{sessionId:n.sessionId}:{},...n.vpId?{vpId:n.vpId}:{},...n.turnId?{turnId:n.turnId}:{},...n.threadId?{threadId:n.threadId}:{},type:"assistant",content:s,isStreaming:!0,status:"pending",turnStartAt:n.timestamp||Date.now()});return}let o=r[r.length-1];if(o&&o.type==="assistant"&&o.isStreaming){if(Hn(e,t,o),n.id&&!o.id&&(o.id=n.id),n.id&&!o.messageId&&(o.messageId=n.id),o.content.endsWith(s))return;o.content+=s}else Fr(e,t,{...n.id?{id:n.id,messageId:n.id}:{},...n.ts?{ts:n.ts}:{},...n.timestamp?{timestamp:n.timestamp}:{},...n.sessionId?{sessionId:n.sessionId}:{},...n.vpId?{vpId:n.vpId}:{},...n.turnId?{turnId:n.turnId}:{},...n.threadId?{threadId:n.threadId}:{},type:"assistant",content:s,isStreaming:!0,status:"pending",turnStartAt:n.timestamp||Date.now()})}function Vc(e,t,{completeLifecycle:s=!0}={}){if(!t)return;let n=e.messagesMap[t];if(!n||n.length===0)return;let r=e._currentYeaftTurnId||null;for(let i=n.length-1;i>=0;i--){let o=n[i];if(r&&o.turnId&&o.turnId!==r){if(o.type==="user")break;continue}if(o.isStreaming&&(o.isStreaming=!1,s&&o.status==="pending"&&(o.status="completed",o.turnEndAt=Date.now())),Hn(e,t,o),o.type==="user")break}}function Hc(e,t){if(!t||e.processingConversations&&e.processingConversations[t]||e.activeVpTurns&&Object.keys(e.activeVpTurns).length>0)return;let s=e.messagesMap&&e.messagesMap[t];if(!(!s||s.length===0))for(let n of s)n&&n.isStreaming&&(n.isStreaming=!1)}function Oc(e,t){let s=e.currentConversation;if(!s)return;e.messagesMap[s]||(e.messagesMap[s]=[]);let n=e.messagesMap[s],r=null;for(let i of t)if(i.type==="user"){let o=i.message?.content;if(o){let a=typeof o=="string"?o:Array.isArray(o)?o.map(l=>l.text||"").join(""):"";a&&(r=a,e.addMessage({type:"user",content:a,isHistory:!0}))}}else if(i.type==="assistant"){let o=i.message?.content;if(o&&Array.isArray(o)){for(let a of o)if(a.type==="text"&&a.text)e.addMessage({type:"assistant",content:a.text,isHistory:!0});else if(a.type==="tool_use")e.addMessage({type:"tool-use",toolName:a.name,toolInput:a.input,isHistory:!0});else if(a.type==="tool_result"){for(let l=n.length-1;l>=0;l--)if(n[l].type==="tool-use"&&!n[l].hasResult){n[l].hasResult=!0,n[l].toolResult=a.content;break}}}}if(r&&s&&!e.conversationTitles[s]){let i=r.trim().substring(0,100);e.conversationTitles[s]=i}}function ps(e){if(!Array.isArray(e))return null;let t=null;for(let s of e)typeof s?.dbMessageId=="number"&&s.dbMessageId>0&&(t===null||s.dbMessageId>t)&&(t=s.dbMessageId);return t}function Fc(e){return{id:e.id,dbMessageId:e.id,timestamp:e.created_at}}function Nc(e){return e?e.message_type==="tool_use"&&!ch.has(e.tool_name)?{...Fc(e),type:"tool-use",toolName:e.tool_name||"unknown",hasResult:!0,isHistory:!0,startTime:e.created_at||0}:Fo(e):null}function Fo(e){if(!e)return null;let t=Fc(e);if(e.message_type==="tool_use"){let n={...t,type:"tool-use",toolName:e.tool_name||"unknown",toolInput:(()=>{try{return JSON.parse(e.tool_input||e.content||"{}")}catch{return{}}})(),hasResult:!0,isHistory:!0,startTime:e.created_at||0};if(e.metadata)try{let r=JSON.parse(e.metadata);r.askRequestId&&(n.askRequestId=r.askRequestId,n.askQuestions=r.askQuestions,n.askAnswered=!!r.askAnswered,n.selectedAnswers=r.selectedAnswers||null,r.askAnswered||(n.isHistory=!1))}catch{}return n}let s=n=>{if(!n)return"";if(typeof n!="string")return String(n);if(n.startsWith("["))try{let r=JSON.parse(n);if(Array.isArray(r))return r.filter(i=>i.type==="text"&&i.text).map(i=>i.text).join("")}catch{}return n};if(e.role==="user"){let n=null;if(e.metadata)try{let r=JSON.parse(e.metadata);r&&typeof r.clientMessageId=="string"&&(n=r.clientMessageId)}catch{}return{...t,type:"user",content:typeof e.content=="string"?e.content:String(e.content||""),...n?{clientMessageId:n}:{}}}else if(e.role==="assistant"){let n=s(e.content),r=(()=>{if(!e.content||typeof e.content!="string"||!e.content.startsWith("["))return[];try{let i=JSON.parse(e.content);return Array.isArray(i)?i.filter(o=>o.type==="tool_use"&&o.name):[]}catch{return[]}})();if(!n&&r.length===0)return null;if(r.length>0){let i=[];n&&i.push({...t,type:"assistant",content:n});for(let o=0;o<r.length;o++){let a=r[o];i.push({id:e.id+"_tool_"+o,dbMessageId:e.id,timestamp:e.created_at,type:"tool-use",toolName:a.name,toolInput:a.input||{},hasResult:!0,isHistory:!0,startTime:e.created_at||0})}return i}return{...t,type:"assistant",content:n}}else if(e.role==="tool"||e.message_type==="tool_result")return{...t,type:"tool_result",tool:e.tool_name||"unknown",content:typeof e.content=="string"?e.content:String(e.content||"")};return null}var oh,ch,Fn=F(()=>{Lo();Fs();oh="grp_default";ch=new Set(["TodoWrite","AskUserQuestion"])});function fs(e,t){return e._closedAt?.[t]?Date.now()-e._closedAt[t]<3e4:!1}function Ns(e,t){Ae(e,t),e._processingWatchdogs||(e._processingWatchdogs={});let s=()=>{if(!e.processingConversations[t])return;let r=e.conversations.find(o=>o.id===t);e.sendWsMessage({type:"ping_session",conversationId:t,agentId:r?.agentId});let i=setTimeout(()=>{e.processingConversations[t]&&(e.sessionHealth||(e.sessionHealth={}),e.sessionHealth[t]={status:"agent-offline"})},1e4);e._pongTimeouts||(e._pongTimeouts={}),e._pongTimeouts[t]=i},n=setTimeout(()=>{e.processingConversations[t]&&(s(),e._processingWatchdogs[t]=setInterval(()=>{if(!e.processingConversations[t]){Ae(e,t);return}s()},3e4))},45e3);e._processingWatchdogs[t]=n}function Nr(e,t){e._yeaftWatchdogPauseReasons?.[t]?.size||e.processingConversations[t]&&e._processingWatchdogs?.[t]&&(e._pongTimeouts?.[t]&&(clearTimeout(e._pongTimeouts[t]),delete e._pongTimeouts[t]),e.sessionHealth?.[t]&&delete e.sessionHealth[t],e._yeaftWatchdogConvs?.has(t)?Bs(e,t):Ns(e,t))}function Ae(e,t){e._processingWatchdogs?.[t]&&(clearTimeout(e._processingWatchdogs[t]),clearInterval(e._processingWatchdogs[t]),delete e._processingWatchdogs[t]),e._pongTimeouts?.[t]&&(clearTimeout(e._pongTimeouts[t]),delete e._pongTimeouts[t]),e.sessionHealth?.[t]&&delete e.sessionHealth[t],e._autoRefreshed?.[t]&&delete e._autoRefreshed[t],e._yeaftWatchdogConvs?.delete(t),e._yeaftWatchdogPauseReasons&&delete e._yeaftWatchdogPauseReasons[t]}function Nn(e,t,s="phase"){if(!t||!e.processingConversations[t])return;e._yeaftWatchdogPauseReasons||(e._yeaftWatchdogPauseReasons={});let n=e._yeaftWatchdogPauseReasons[t]||new Set;n.add(s),e._yeaftWatchdogPauseReasons[t]=n,e._processingWatchdogs?.[t]&&(clearTimeout(e._processingWatchdogs[t]),clearInterval(e._processingWatchdogs[t]),delete e._processingWatchdogs[t])}function qs(e,t,s=null){if(!t)return;let n=e._yeaftWatchdogPauseReasons?.[t];n&&(s?n.delete(s):n.clear(),!n.size&&(delete e._yeaftWatchdogPauseReasons[t],e.processingConversations[t]&&Bs(e,t)))}function qc(e,t){Ae(e,t),e._processingWatchdogs||(e._processingWatchdogs={}),e._processingWatchdogs[t]=setTimeout(()=>{if(e.processingConversations[t]){let s=e.conversations.find(n=>n.id===t);e.sendWsMessage({type:"refresh_conversation",conversationId:t,agentId:s?.agentId}),e._processingWatchdogs[t]=setTimeout(()=>{if(e.processingConversations[t]){delete e.processingConversations[t];let n=e.executionStatusMap[t];n&&(n.currentTool=null),e.finishStreamingForConversation(t)}delete e._processingWatchdogs[t]},1e4)}},9e4)}function Bs(e,t){let s=e._yeaftWatchdogPauseReasons?.[t];if(Ae(e,t),e._processingWatchdogs||(e._processingWatchdogs={}),s?.size){e._yeaftWatchdogConvs||(e._yeaftWatchdogConvs=new Set),e._yeaftWatchdogPauseReasons||(e._yeaftWatchdogPauseReasons={}),e._yeaftWatchdogConvs.add(t),e._yeaftWatchdogPauseReasons[t]=new Set(s);return}e._yeaftWatchdogConvs||(e._yeaftWatchdogConvs=new Set),e._yeaftWatchdogConvs.add(t),e._processingWatchdogs[t]=setTimeout(()=>{if(e.processingConversations[t]){delete e.processingConversations[t];let n=e.executionStatusMap[t];n&&(n.currentTool=null),e.finishStreamingForConversation(t)}delete e._processingWatchdogs[t]},15e4)}var Gt=F(()=>{});function No(e,t){return t&&Array.isArray(e?._yeaftRetiredConversationIdsByAgent?.[t])?e._yeaftRetiredConversationIdsByAgent[t]:[]}function Ws(e,t,s){return!t||!s?!1:No(e,t).includes(s)}function qo(e,t){let s=e?._yeaftRetiredConversationTargetsByAgent?.[t];return s&&typeof s=="object"?s:{}}function Bc(e,t,s){if(!t||!s)return null;let n=qo(e,t),r=s,i=new Set;for(let o=0;o<8;o++){if(i.has(r))return null;i.add(r);let a=n[r];if(!a||a===r)return r===s?null:r;r=a}return null}function qn(e,t,s,n=null){if(!t||!s)return;let r=No(e,t).filter(a=>a!==s).concat(s).slice(-8);e._yeaftRetiredConversationIdsByAgent={...e._yeaftRetiredConversationIdsByAgent||{},[t]:r};let i=qo(e,t),o={};for(let a of r){let l=i[a];l&&(o[a]=l===s&&n?n:l)}n&&n!==s&&(o[s]=n),e._yeaftRetiredConversationTargetsByAgent={...e._yeaftRetiredConversationTargetsByAgent||{},[t]:o}}function Bo(e,t,s){if(!t||!s||!e?._yeaftRetiredConversationIdsByAgent)return;let n=No(e,t).filter(i=>i!==s);e._yeaftRetiredConversationIdsByAgent={...e._yeaftRetiredConversationIdsByAgent,[t]:n};let r={...qo(e,t)};delete r[s],e._yeaftRetiredConversationTargetsByAgent={...e._yeaftRetiredConversationTargetsByAgent||{},[t]:r}}var qr=F(()=>{});function ph(e,t,s){let n=e.messagesMap?.[t]||[],r=e.messagesMap?.[s]||[];e.messagesMap||(e.messagesMap={}),On(e,t,n),On(e,s,r),e.messagesMap[s]=Ec(r,n).sort((i,o)=>{let a=Number.isFinite(i?.seq)?i.seq:null,l=Number.isFinite(o?.seq)?o.seq:null;return a!==null&&l!==null&&a!==l?a-l:a!==null&&l===null?-1:a===null&&l!==null?1:(i?.timestamp||0)-(o?.timestamp||0)})}function fh(e){if(!e||typeof e!="object")return e;if(typeof structuredClone=="function")try{return structuredClone(e)}catch{}return Array.isArray(e)?e.slice():{...e}}function Br(e,t){return!!e&&Object.prototype.hasOwnProperty.call(e,t)}function js(e,t,s,{removeSource:n}){Br(e,t)&&(Br(e,s)||(e[s]=n?e[t]:fh(e[t])),n&&delete e[t])}function It(e,t,s=null){if(!t)return null;let n=e?._yeaftPendingConversationPromotions?.[t]||null;return!n?.sourceConversationId||!n.targetConversationId||s&&n.targetConversationId!==s?null:n}function Wr(e,t,s,n){return!t||!s||!n||s===n?!1:(e._yeaftPendingConversationPromotions={...e._yeaftPendingConversationPromotions||{},[t]:{sourceConversationId:s,targetConversationId:n}},!0)}function Bn(e,t,s=null){let n=It(e,t,s);if(!n)return null;let r={...e._yeaftPendingConversationPromotions||{}};return delete r[t],e._yeaftPendingConversationPromotions=r,n}function Wn(e,t,s){let n=It(e,t);return!n||!s||n.targetConversationId===s?null:(Ct(e,n.targetConversationId,s,{removeSource:!0}),qn(e,t,n.targetConversationId,s),Wr(e,t,n.sourceConversationId,s),n)}function Ct(e,t,s,{removeSource:n=!0}={}){if(!t||!s||t===s)return!1;ph(e,t,s),e.yeaftHistoryCacheState&&(e.yeaftHistoryCacheState=Object.fromEntries(Object.entries(e.yeaftHistoryCacheState).map(([c,d])=>[c,d?.conversationId===t?{...d,conversationId:s}:d]))),js(e.processingConversations,t,s,{removeSource:n}),js(e.executionStatusMap,t,s,{removeSource:n}),js(e.refreshingSessionMap,t,s,{removeSource:n}),js(e._closedAt,t,s,{removeSource:n}),js(e._autoRefreshed,t,s,{removeSource:n}),js(e.sessionHealth,t,s,{removeSource:n}),e._turnCompletedConvs?.has(t)&&(e._turnCompletedConvs.add(s),n&&e._turnCompletedConvs.delete(t));let r=!!e._yeaftWatchdogConvs?.has(t),i=e._yeaftWatchdogPauseReasons?.[t],o=!!i?.size,a=!!e._processingWatchdogs?.[t];if(o&&(e._yeaftWatchdogPauseReasons||(e._yeaftWatchdogPauseReasons={}),e._yeaftWatchdogPauseReasons[s]=new Set(i)),n&&(a||o)&&Ae(e,t),n&&e._pongTimeouts?.[t]&&(clearTimeout(e._pongTimeouts[t]),delete e._pongTimeouts[t]),n&&(a||r||o)&&!!e.processingConversations?.[s])if(e._processingWatchdogs?.[s])e._yeaftWatchdogConvs?.add(s);else{let c=Br(e.sessionHealth,s),d=e.sessionHealth?.[s],u=Br(e._autoRefreshed,s),f=e._autoRefreshed?.[s];Bs(e,s),c&&(e.sessionHealth||(e.sessionHealth={}),e.sessionHealth[s]=d),u&&(e._autoRefreshed||(e._autoRefreshed={}),e._autoRefreshed[s]=f)}return n&&e.messagesMap&&delete e.messagesMap[t],!0}var Wo=F(()=>{Fn();qr();Gt()});function jr(e,t){return!e||!t||e.type!=="user"||t.type!=="user"?!1:e.clientMessageId&&t.clientMessageId?e.clientMessageId===t.clientMessageId:e.clientMessageId||t.clientMessageId?!1:e.content===t.content}var jo=F(()=>{});function Uo(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function gh(){return Date.now()}function mh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`pt_${crypto.randomUUID()}`:`pt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`}function hh(e,t=160){return typeof e!="string"?e:e.length>t?`${e.slice(0,t)}...[truncated]`:e}function vh(e){if(!e||typeof e!="object")return e||null;let t={};for(let[s,n]of Object.entries(e))s==="text"||s==="prompt"||s==="content"||s==="data"||(t[s]=typeof n=="string"?hh(n):n);return t}function gs(){return mh()}function Ge(e,t={}){!e||!t.traceId||(Array.isArray(e._perfTraceQueue)||(e._perfTraceQueue=[]),e._perfTraceQueue.push({traceId:t.traceId,source:"web",phase:t.phase||"unknown",at:gh(),monotonicMs:Uo(),durationMs:Number.isFinite(t.durationMs)?t.durationMs:null,agentId:t.agentId||null,sessionId:t.sessionId||null,vpId:t.vpId||null,turnId:t.turnId||null,threadId:t.threadId||null,messageType:t.messageType||null,bytes:Number.isFinite(t.bytes)?t.bytes:null,ok:typeof t.ok=="boolean"?t.ok:null,detail:vh(t.detail)}),e._perfTraceQueue.length>200&&e._perfTraceQueue.splice(0,e._perfTraceQueue.length-200),yh(e))}function yh(e){!e||e._perfTraceFlushTimer||(e._perfTraceFlushTimer=setTimeout(()=>bh(e),250))}function bh(e){if(!e||!Array.isArray(e._perfTraceQueue)||e._perfTraceQueue.length===0){e&&(e._perfTraceFlushTimer=null);return}let t=e._perfTraceQueue.splice(0,e._perfTraceQueue.length);e._perfTraceFlushTimer=null,typeof e.sendWsMessage=="function"&&e.sendWsMessage({type:"perf_trace_events",events:t})}function Ur(e,t={}){if(typeof requestAnimationFrame!="function")return;let s=Uo();requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ge(e,{...t,phase:t.phase||"render.next_paint",durationMs:Uo()-s})})})}var Ko=F(()=>{});function zo(e){return typeof e=="string"&&e?e:null}function Us(e,t){return e?.yeaftSessionHistoryState?.[t]||null}function ms(e){let t=e?.yeaftActiveSessionFilter||null;if(!t)try{t=(typeof window<"u"&&window.Pinia?.useSessionsStore?.())?.activeSessionId||null}catch{}if(!t)return{agentId:e?.currentAgent||null,sessionId:null,sessionKey:""};let s=(()=>{try{let n=typeof window<"u"&&window.Pinia?.useSessionsStore?.(),r=n?.activeSessionKey?n.sessions?.[n.activeSessionKey]:null;if(r?.id===t&&r.agentId)return r.agentId}catch{}return typeof e?.resolveYeaftSessionAgentId=="function"?e.resolveYeaftSessionAgentId(t):e?.currentAgent||null})();return{agentId:s,sessionId:t,sessionKey:ke(s,t)}}function jc(e,{agentId:t,sessionId:s,mode:n="recent",preserveLoaded:r=!1,latestSeq:i=null}={}){if(!t||!s)return null;let o=ke(t,s),a=Us(e,o)||{},l=Number(a.generation||0)+1,c=`yeaft_history_${l}_${crypto.randomUUID()}`,d={...a,loaded:!!a.loaded,loading:!0,error:null,requestId:c,generation:l,mode:n,requestedAt:Date.now(),latestSeq:Number.isFinite(i)?i:a.latestSeq??null};return delete d.completionSeen,r||(d.syncingAfterSeq=null,a.loaded||(d.hasMore=!1,d.oldestSeq=null,d.serverOldestFetchedSeq=null,d.serverHasMore=!1,d.gapQueue=[],d.requestedBeforeSeqs=[],d.count=0)),e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState||{},[o]:d},jn(e),{sessionKey:o,requestId:c,generation:l,state:d}}function Yo(e,t={}){let s=t.sessionId??t.groupId??null;if(!s)return!1;let n=t.agentId||e?.yeaftSessionAgentById?.[s]||null,r=ke(n,s),i=Us(e,r),o=zo(t.requestId);if(!i)return o===null;let a=zo(i.requestId);return o?o===a:a===null}function Uc(e,t={},s={},n="chunk"){if(!Yo(e,t))return null;let r=t.sessionId??t.groupId??null,i=t.agentId||e?.yeaftSessionAgentById?.[r]||null,o=ke(i,r),a=Us(e,o)||{},l=zo(t.requestId),c=l!==null&&n==="completion",d={...a,...c?{}:s,...c?{completionSeen:!0}:{},error:null};return c?(d.loading=!0,d.requestId=l):(d.loading=!1,d.requestId=null,d.completedAt=Date.now(),delete d.completionSeen),e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState||{},[o]:d},jn(e),d}function Go(e,{agentId:t,sessionId:s,requestId:n,error:r="history_load_failed"}={}){if(!t||!s||!n)return!1;let i=ke(t,s),o=Us(e,i);return!o||o.requestId!==n||!o.loading?!1:(e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState||{},[i]:{...o,loading:!1,error:r,requestId:null,completedAt:Date.now()}},jn(e),!0)}function jn(e){let{sessionKey:t}=ms(e),s=t?Us(e,t):null;return e.yeaftLoadingMoreHistory=!!s?.loading,e.yeaftHistoryLoadError=s?.error||null,e.yeaftHasMoreHistory=!!s?.hasMore,e.yeaftOldestLoadedSeq=Number.isFinite(s?.serverOldestFetchedSeq)?s.serverOldestFetchedSeq:Number.isFinite(s?.oldestSeq)?s.oldestSeq:null,s}function Qo(e){let{sessionKey:t}=ms(e);return t?Us(e,t):null}var Wc,Xo=F(()=>{Fs();Wc=15e3});function Zo(e){return e?.sessionId??e?.groupId??null}function Kc(e){for(let t of[e?.persistedMessageId,e?.messageId,e?.id]){if(typeof t!="string")continue;let s=t.match(/^(m\d+)/);if(s)return s[1]}return null}function Kr(e){return e?.isStreaming||e?.status==="pending"?!1:Number.isFinite(e?.seq)||!!Kc(e)||e?.isHistory===!0&&!e?.clientMessageId}function ea(e){if(Number.isFinite(e?.seq))return Number(e.seq);let s=Kc(e)?.match(/^m(\d+)$/);if(s)return Number(s[1]);let n=typeof e?.id=="string"?e.id.match(/^(\d+)/):null;return n?Number(n[1]):null}function zc(e){try{return new TextEncoder().encode(JSON.stringify(e)).length}catch{return 0}}function Jo(e){if(e?.historyEntryId)return`entry:${e.historyEntryId}`;let t=ea(e);return Number.isFinite(t)?`seq:${t}`:e?.stableKey||e?.uiKey||e?.id||e?.messageId||"legacy"}function kh(e){let t=new Map;for(let s of e){if(!Kr(s))continue;let n=Jo(s),r=t.get(n)||{key:n,rows:[],seq:ea(s),bytes:0,touchedAt:0};r.rows.push(s),r.bytes+=zc(s),r.touchedAt=Math.max(r.touchedAt,Number(s?._historyCacheTouchedAt)||0),t.set(n,r)}return Array.from(t.values())}function Sh(e,t,s=new Set){let n=e.slice().sort((u,f)=>(f.seq||-1)-(u.seq||-1)),r=new Set,i=0,o=0;for(let u of e)s.has(u.key)&&(r.add(u.key),i+=u.rows.length,o+=u.bytes);for(let u of n){if(r.has(u.key))continue;if(i>=t.recentRowsFloor)break;let f=i+u.rows.length,p=o+u.bytes;if(r.size>0&&(f>t.maxRowsPerSession||p>t.maxBytesPerSession))break;r.add(u.key),i=f,o=p}let a=e.slice().sort((u,f)=>f.touchedAt-u.touchedAt||(f.seq||-1)-(u.seq||-1)),l=new Set(r),c=e.filter(u=>r.has(u.key)).reduce((u,f)=>u+f.rows.length,0),d=e.filter(u=>r.has(u.key)).reduce((u,f)=>u+f.bytes,0);for(let u of a){if(l.has(u.key))continue;let f=c+u.rows.length,p=d+u.bytes;l.size>0&&(f>t.maxRowsPerSession||p>t.maxBytesPerSession)||(l.add(u.key),c=f,d=p)}return l}function Ih(e){let t=Array.from(new Set(e.map(ea).filter(Number.isFinite))).sort((n,r)=>n-r),s=[];for(let n of t){let r=s.at(-1);r&&n<=r.endSeq+1?r.endSeq=n:s.push({startSeq:n,endSeq:n})}return s}function Ch(e){let t=e.filter(Kr);return{rowCount:t.length,byteCount:t.reduce((s,n)=>s+zc(n),0),ranges:Ih(t)}}function Ah(e,t,s){let n=new Set((t||[]).map(r=>r?.stableKey).filter(Boolean));if(n.size!==0)for(let r of e)r?.stableKey&&n.has(r.stableKey)&&(r._historyCacheTouchedAt=s)}function xh(e,{conversationId:t,agentId:s,sessionId:n,incomingRows:r,now:i,limits:o}){let a=e.messagesMap?.[t]||[],l=a.filter(S=>Zo(S)===n);Ah(l,r,i);let c=new Set((r||[]).filter(S=>S?.historyEntryId).map(Jo)),d=kh(l),u=Sh(d,o,c),f=l.filter(S=>!Kr(S)||u.has(Jo(S))),p=new Set(f);e.messagesMap[t]=a.filter(S=>Zo(S)!==n||p.has(S));let g=Ch(f),m=ke(s,n),b=e.yeaftHistoryCacheState?.[m]||null,y=JSON.stringify(b?.ranges||[])===JSON.stringify(g.ranges)?Number(b?.rangeEpoch)||0:(Number(b?.rangeEpoch)||0)+1;e.yeaftHistoryCacheState={...e.yeaftHistoryCacheState||{},[m]:{agentId:s,sessionId:n,conversationId:t,lastAccessed:i,rangeEpoch:y,...g}}}function Th(e,t){let s=e.messagesMap?.[t.conversationId]||[];e.messagesMap[t.conversationId]=s.filter(n=>Zo(n)!==t.sessionId||!Kr(n))}function Mh(e,t,s){let n={...e.yeaftHistoryCacheState||{}},r=Object.entries(n).filter(([,a])=>a?.rowCount>0),i=()=>Object.values(n).reduce((a,l)=>({rows:a.rows+(Number(l?.rowCount)||0),bytes:a.bytes+(Number(l?.byteCount)||0),sessions:a.sessions+((Number(l?.rowCount)||0)>0?1:0)}),{rows:0,bytes:0,sessions:0}),o=r.filter(([a])=>a!==t).sort((a,l)=>(Number(a[1]?.lastAccessed)||0)-(Number(l[1]?.lastAccessed)||0));for(let[a,l]of o){let c=i();if(c.sessions<=s.maxSessions&&c.rows<=s.maxRowsTotal&&c.bytes<=s.maxBytesTotal)break;Th(e,l),n[a]={...l,rowCount:0,byteCount:0,ranges:[]}}e.yeaftHistoryCacheState=n}function Yc(e,t,s,n=Date.now()){if(!t||!s)return;let r=ke(t,s),i=e.yeaftHistoryCacheState?.[r];i&&(e.yeaftHistoryCacheState={...e.yeaftHistoryCacheState||{},[r]:{...i,lastAccessed:n}})}function ta(e,{conversationId:t,agentId:s,sessionId:n,incomingRows:r=[],activeAgentId:i=null,activeSessionId:o=null,now:a=Date.now(),limits:l=wh}={}){if(!e||!t||!s||!n)return;xh(e,{conversationId:t,agentId:s,sessionId:n,incomingRows:r,now:a,limits:l});let c=i&&o?ke(i,o):null;Mh(e,c,l)}var wh,sa=F(()=>{Fs();wh=Object.freeze({maxSessions:8,maxRowsPerSession:600,maxBytesPerSession:4*1024*1024,maxRowsTotal:2400,maxBytesTotal:16*1024*1024,recentRowsFloor:100})});function At(e){return Number.isFinite(e)?Number(e):null}function Ph(e){return(Array.isArray(e)?e:[]).map(t=>({startSeq:At(t?.startSeq),endSeq:At(t?.endSeq)})).filter(t=>t.startSeq!==null&&t.endSeq!==null&&t.startSeq<=t.endSeq).sort((t,s)=>t.startSeq-s.startSeq)}function Un(e){return Number.isFinite(e)&&e>=0?Math.floor(e):0}function hs(e){let t=At(e?.beforeSeq);if(t===null)return null;if(e?.kind==="gap"){let s=At(e.stopAtSeq);return s===null?null:`gap:${Un(e.cacheEpoch)}:${s}:${t}`}return`server:${t}`}function Kn(e){let t=new Set((Array.isArray(e?.completedHistoryWorkKeys)?e.completedHistoryWorkKeys:[]).filter(s=>typeof s=="string"&&s));for(let s of Array.isArray(e?.requestedBeforeSeqs)?e.requestedBeforeSeqs:[])Number.isFinite(s)&&t.add(`server:${s}`);return t}function Rh(e,t){let s=hs(t);if(!s)return e.completedHistoryWorkKeys||[];let n=Kn(e);return n.add(s),Array.from(n).slice(-256)}function _h(e,t){if(!Number.isFinite(t))return e.requestedBeforeSeqs||[];let s=new Set((Array.isArray(e?.requestedBeforeSeqs)?e.requestedBeforeSeqs:[]).filter(Number.isFinite));return s.add(t),Array.from(s).sort((n,r)=>r-n).slice(-256)}function Eh(e,t={},s=0){let n=Ph(e),r=Un(s),i=Kn(t),o=[];for(let a=1;a<n.length;a+=1){let l=n[a-1],c=n[a];if(l.endSeq+1>=c.startSeq)continue;let d={kind:"gap",beforeSeq:c.startSeq,stopAtSeq:l.endSeq+1,cacheEpoch:r};d.workKey=hs(d),i.has(d.workKey)||o.push(d)}return o.sort((a,l)=>l.beforeSeq-a.beforeSeq)}function Gc(e,t,s){let n=Eh(e,t,s),r=At(t.serverOldestFetchedSeq??t.oldestSeq),i=n[0]||null;if(!i||r===null||i.beforeSeq<=r)return[];let o={kind:"gap",beforeSeq:i.beforeSeq,stopAtSeq:r,cacheEpoch:i.cacheEpoch};return o.workKey=hs(o),Kn(t).has(o.workKey)?[]:[o]}function Qc(e={},t=[],s=0){let n=Un(s),r=Kn(e),i=e.serverHasMore!==!1,o=At(e.serverOldestFetchedSeq??e.oldestSeq),a=e.gapTraversalInitialized===!0,l=Array.isArray(e.gapQueue)?e.gapQueue.slice():[],c=null,d=null;if(i&&o!==null){let u={kind:"server",beforeSeq:o,stopAtSeq:null,cacheEpoch:n};u.workKey=hs(u),r.has(u.workKey)?(i=!1,d="history_cursor_repeated"):c=u}return!c&&!i&&(a||(l=Gc(t,e,n),a=!0),c=l[0]||null),c?{request:c,state:{...e,serverHasMore:i,gapTraversalInitialized:a,gapQueue:l,pendingPageKind:c.kind,pendingPageBeforeSeq:c.beforeSeq,pendingGapStopAtSeq:c.stopAtSeq,pendingCacheEpoch:c.cacheEpoch,pendingHistoryWorkKey:c.workKey,hasMore:!0,paginationError:null}}:{request:null,state:{...e,serverHasMore:i,gapTraversalInitialized:a,gapQueue:l,hasMore:!1,paginationError:d}}}function Xc(e={},{mode:t,oldestSeq:s,hasMore:n,ranges:r=[],pageKind:i=null,stopAtSeq:o=null,cacheEpoch:a=0}={}){if(t==="delta")return e;let l=Un(a),c=At(s),d=At(e.pendingPageBeforeSeq),u=i||e.pendingPageKind||(t==="older"?"server":null),f=At(o??e.pendingGapStopAtSeq),p=Un(e.pendingCacheEpoch??l),g={kind:u,beforeSeq:d,stopAtSeq:f,cacheEpoch:p},m=At(e.serverOldestFetchedSeq??e.oldestSeq),b=e.serverHasMore!==!1,I=Number(e.noProgressCount)||0,y=null,S=e.requestedBeforeSeqs||[],w=e.completedHistoryWorkKeys||[],v=e.gapTraversalInitialized===!0,h=Array.isArray(e.gapQueue)?e.gapQueue.slice():[];if(t==="recent")m=c,b=!!n,I=0,S=[],w=[],v=!1,h=[];else if(d===null)c!==null&&(m=m===null?c:Math.min(m,c)),b=!!n,I=0;else{S=_h(e,d),w=Rh(e,g);let x=c!==null&&c<d;if(u==="server")x?(m=m===null?c:Math.min(m,c),b=!!n,I=0):(b=!1,I+=1,y="history_cursor_no_progress");else if(u==="gap"){let E=hs(g);h=h.filter(L=>hs(L)!==E);let V=f!==null&&c!==null&&c<=f;if(x||V||n===!1){if(I=0,!V&&n!==!1&&c!==null&&f!==null){let L={kind:"gap",beforeSeq:c,stopAtSeq:f,cacheEpoch:p};L.workKey=hs(L),Kn({completedHistoryWorkKeys:w}).has(L.workKey)||h.unshift(L)}}else I+=1,y="history_cursor_no_progress"}}t==="older"&&!b&&!v&&(h=Gc(r,{...e,serverOldestFetchedSeq:m,completedHistoryWorkKeys:w},l),v=!0);let M={...e,serverOldestFetchedSeq:m,serverHasMore:b,requestedBeforeSeqs:S,completedHistoryWorkKeys:w,gapTraversalInitialized:v,gapQueue:h,noProgressCount:I,oldestSeq:m,paginationError:y};return delete M.pendingPageKind,delete M.pendingPageBeforeSeq,delete M.pendingGapStopAtSeq,delete M.pendingCacheEpoch,delete M.pendingHistoryWorkKey,{...M,hasMore:b||h.length>0}}var na=F(()=>{});function td(e){return e.filter(t=>!(t.type==="user"&&(!t.content||!t.content.trim())))}function vs(e){let t=typeof e=="string"?e.match(/^m(\d+)$/):null,s=t?Number(t[1]):null;return Number.isFinite(s)?s:null}function Zc(e){let t=[e?.timestamp,e?.createdAt,e?.ts,e?.time,e?.created_at];for(let s of t){if(typeof s=="number"&&Number.isFinite(s)&&s>0)return s;if(typeof s=="string"&&s.trim()){let n=Date.parse(s);if(Number.isFinite(n))return n;let r=Number(s);if(Number.isFinite(r)&&r>0)return r}}return null}function Dh(e){if(!Array.isArray(e))return null;for(let t=e.length-1;t>=0;t-=1){let s=e[t];if(s?.name==="TodoWrite"&&Array.isArray(s?.input?.todos))return s.input.todos}return null}function Lh(e){return Array.isArray(e?.toolCalls)?e.toolCalls.filter(t=>t?.name!=="TodoWrite").length:Number(e?.toolSummaryCount||0)||0}function $h(e){if(!e||typeof window>"u")return null;try{let t=window.Pinia||null,s=t&&typeof t.useSessionsStore=="function"?t.useSessionsStore():null;if(!s)return null;let n=typeof t.useChatStore=="function"?t.useChatStore():null,r=typeof s.sessionById=="function"?s.sessionById(e,n?.currentAgent||null):s.sessions&&s.sessions[e];return(r&&typeof r.defaultVpId=="string"?r.defaultVpId.trim():"")||null}catch{return null}}function Vh(e,t){return e.speakerVpId||e.vpId||e.vp_id||e.authorVpId||e.authorVP||$h(t)}function zr(e){return e?.stableKey||(e&&(e.messageId||e.id)?e.messageId||e.id:null)}function Hh(e,t=null){if(!e||e.stableKey)return e;let s=zn(e),n=e.messageId||e.id||null,r=e.type==="user"&&e.clientMessageId||null;return e.stableKey=r&&n===r?Yt(t,s,r):Vn(t,s,n),Number.isFinite(e.seq)||(e.seq=vs(n)),e.uiKey||(e.uiKey=e.stableKey||null),e}function Oh(e){e.sort((t,s)=>{let n=Number.isFinite(t?.seq)?t.seq:null,r=Number.isFinite(s?.seq)?s.seq:null;return n!==null&&r!==null&&n!==r?n-r:n!==null&&r===null?-1:n===null&&r!==null?1:(t?.timestamp||0)-(s?.timestamp||0)})}function Fh(e,t){if(!e||!t||e.type!=="assistant"||t.type!=="assistant"||(e.sessionId??null)!==(t.sessionId??null))return!1;let s=e.speakerVpId||e.vpId||"",n=t.speakerVpId||t.vpId||"";if(s&&n&&s!==n)return!1;let r=e.threadId||"",i=t.threadId||"";if(r&&i&&r!==i||!(e.isStreaming||e.isHistory!==!0)||t._hasPersistedTurnId!==!0)return!1;let a=e.turnId||"",l=t.turnId||"";if(!a||!l||a!==l)return!1;let c=typeof e.content=="string"?e.content:"",d=typeof t.content=="string"?t.content:"";return!!c&&!!d&&(d.startsWith(c)||c.startsWith(d))}function ra(e,t){let s=new Map,n=new Map;e.forEach((i,o)=>{let a=zr(i);a&&s.set(a,o),i?.type==="user"&&i.clientMessageId&&n.set(i.clientMessageId,o)});let r=0;for(let i of t){let o=zr(i),a=o&&s.has(o)?s.get(o):null;if(a===null&&i?.type==="user"&&i.clientMessageId&&n.has(i.clientMessageId)&&(a=n.get(i.clientMessageId)),a===null&&i?.type==="assistant"&&(a=e.findIndex(l=>Fh(l,i))),a!==null&&a>=0){let l=zr(e[a]),c=e[a]?.uiKey||null;e[a]={...e[a],...i,...c?{uiKey:c}:{}},o&&s.set(o,a),l&&l!==o&&s.get(l)===a&&s.delete(l),i?.type==="user"&&i.clientMessageId&&n.set(i.clientMessageId,a)}else o&&s.set(o,e.length),i?.type==="user"&&i.clientMessageId&&n.set(i.clientMessageId,e.length),e.push(i),r+=1}return Oh(e),r}function zn(e){return e?e.sessionId??e.groupId??null:null}function Nh(e){return!e||e.type!=="user"||!e.clientMessageId?!1:(e.messageId||e.id||null)===e.clientMessageId}function qh(e,t,s){let n=e.some(o=>o&&(s==null||zn(o)===s));if(t.length===0&&n)return{insertedRows:0,preservedEmpty:!0};let r=t.reduce((o,a)=>Math.max(o,a?.timestamp||0),0),i=e.filter(o=>o?s!=null&&zn(o)!==s||o.isStreaming||o.type==="tool-use"&&o.toolName==="AskUserQuestion"&&(o.askAnswered||o.askPending||o.askExpired)||Nh(o)?!0:r>0&&(o.timestamp||0)>r:!1);return e.splice(0,e.length,...i),ra(e,t),{insertedRows:t.length,preservedEmpty:!1}}function Bh(e){if(typeof e!="string")return!1;let t=e.trimStart();return t.startsWith("<task-result ")||/^\[system note\] You have called \S+ with the same arguments \d+ times\./.test(t)}function Wh(e,t){let s=typeof e.yeaftConversationId=="string"?e.yeaftConversationId:"";return s.startsWith(`yeaft-local-${t}-`)||/^yeaft-local-\d/.test(s)?s:null}function jh(e,t,s,n){let r=t.agentId||s&&e.yeaftSessionAgentById?.[s]||null;if(!r||!n||e.currentView!=="yeaft")return;let i=ms(e);if(i.sessionId!==(s||null)||i.agentId&&i.agentId!==r)return;let o=e.yeaftConversationId||null;if(Ws(e,r,n)){let d=e.yeaftConversationIdsByAgent?.[r]||null;d&&d!==n&&Ct(e,n,d,{removeSource:n!==e.yeaftConversationId});return}let a=It(e,r);a&&a.targetConversationId!==n&&Wn(e,r,n);let l=It(e,r,n);if(l&&(Ct(e,l.sourceConversationId,n,{removeSource:!0}),Bn(e,r,n),e.yeaftConversationId=n),o===n||l){e.messagesMap[n]||(e.messagesMap[n]=[]),e.yeaftConversationIdsByAgent={...e.yeaftConversationIdsByAgent||{},[r]:n},e.activeConversations=[n];return}let c=Wh(e,r);c&&(Ct(e,c,n,{removeSource:!0}),e.yeaftConversationIdsByAgent={...e.yeaftConversationIdsByAgent||{},[r]:n},e.yeaftConversationId=n,e.activeConversations=[n])}function Qt(e,t){let s=e.messagesMap[t]||[];for(let n of s)n.type==="tool-use"&&!n.hasResult&&(n.hasResult=!0,n.toolName==="AskUserQuestion"&&!n.askAnswered&&!n.selectedAnswers&&(n.isHistory=!0,n.askRequestId=null))}function sd(e,t){St(e);let s=e.agents.find(r=>r.id===t.agentId);e.conversations=e.conversations.filter(r=>r.id!==t.conversationId);let n=t.provider||"claude-code";if(e.conversations.push({id:t.conversationId,agentId:t.agentId,agentName:s?.name||t.agentId,workDir:t.workDir,claudeSessionId:null,createdAt:Date.now(),processing:!1,connecting:n!=="claude-code",type:"chat",provider:n,capabilities:t.capabilities||null,disallowedTools:t.disallowedTools??null}),e.currentAgent=t.agentId,e.currentAgentInfo=s,e.panels.length>1){let r=e._pendingPaneId;if(e._pendingPaneId=null,r){let i=e.panels.find(o=>o.id===r);i&&(i.conversationId=t.conversationId)}else{let i=e.panels.find(o=>!o.conversationId);i&&(i.conversationId=t.conversationId)}e.activeConversations.includes(t.conversationId)||e.activeConversations.push(t.conversationId)}else e.activeConversations=[t.conversationId];e.currentWorkDir=t.workDir,e.messagesMap[t.conversationId]=[],e.sendWsMessage({type:"select_conversation",conversationId:t.conversationId}),e.addMessage({type:"system",content:Le("store.convCreated",{agent:s?.name||t.agentId,workDir:t.workDir})}),e.saveOpenSessions()}function nd(e,t){St(e);let s=e.agents.find(n=>n.id===t.agentId);if(e.conversations=e.conversations.filter(n=>n.id!==t.conversationId&&!(n.claudeSessionId&&n.claudeSessionId===t.claudeSessionId)),e.conversations.push({id:t.conversationId,agentId:t.agentId,agentName:s?.name||t.agentId,workDir:t.workDir,claudeSessionId:t.claudeSessionId,createdAt:Date.now(),processing:!1,connecting:(t.provider||"claude-code")!=="claude-code",type:"chat",provider:t.provider||"claude-code",capabilities:t.capabilities||null,disallowedTools:t.disallowedTools??null}),e.currentAgent=t.agentId,e.currentAgentInfo=s,e.panels.length>1){let n=e._pendingPaneId;if(e._pendingPaneId=null,n){let r=e.panels.find(i=>i.id===n);r&&(r.conversationId=t.conversationId)}else{let r=e.panels.find(i=>!i.conversationId);r&&(r.conversationId=t.conversationId)}e.activeConversations.includes(t.conversationId)||e.activeConversations.push(t.conversationId)}else e.activeConversations=[t.conversationId];if(e.currentWorkDir=t.workDir,e.messagesMap[t.conversationId]=[],e._pendingSessionTitle&&(e.conversationTitles[t.conversationId]=e._pendingSessionTitle,e._pendingSessionTitle=null),e.sendWsMessage({type:"select_conversation",conversationId:t.conversationId}),e.addMessage({type:"system",content:Le("store.convResumed",{agent:s?.name||t.agentId,sessionId:t.claudeSessionId?t.claudeSessionId.slice(0,8)+"...":""})}),t.dbMessages&&t.dbMessages.length>0){let n=td(t.dbMessages.map(o=>e.formatDbMessageForHistoryHydration(o)).flat().filter(Boolean)),r=Do(n),i=e.messagesMap[t.conversationId]||[];for(let o of r)i.push(o)}e.hasMoreMessages=!!t.hasMoreMessages,e.chatSessionState[t.conversationId]={lastSeenDbId:ps(e.messagesMap[t.conversationId]),hasMoreOlder:!!t.hasMoreMessages},e.saveOpenSessions()}function ia(e,t){e.conversations=e.conversations.filter(n=>n.id!==t.conversationId),delete e.messagesMap[t.conversationId],delete e.chatSessionState[t.conversationId],delete e.conversationTitles[t.conversationId],delete e.customConversationTitles[t.conversationId],delete e.processingConversations[t.conversationId],e._closedAt&&delete e._closedAt[t.conversationId],Ae(e,t.conversationId),delete e.executionStatusMap[t.conversationId],delete e.subagents[t.conversationId],window.dispatchEvent(new CustomEvent("conversation-deleted",{detail:{conversationId:t.conversationId}}));let s=e.activeConversations.indexOf(t.conversationId);s>=0&&(e.activeConversations.splice(s,1),e.activeConversations.length===0&&e.addMessage({type:"system",content:Le("chat.session.closed")}));for(let n of e.panels)n.conversationId===t.conversationId&&(n.conversationId=null);e.saveOpenSessions()}function rd(e,t){let s=t.conversationId;if(s){delete e.processingConversations[s],Ae(e,s),e._closedAt||(e._closedAt={}),e._closedAt[s]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(s);let n=e.executionStatusMap[s];n&&(n.currentTool=null),e.finishStreamingForConversation(s),Qt(e,s);let r=e.conversations.find(i=>i.id===s);r&&(t.claudeSessionId&&(r.claudeSessionId=t.claudeSessionId),t.workDir&&(r.workDir=t.workDir)),e.clearStatus?.conversationId===s&&e.clearStatus?.status==="clearing"&&(e.clearStatus={conversationId:s,status:"completed"},setTimeout(()=>{e.clearStatus?.conversationId===s&&e.clearStatus?.status==="completed"&&(e.clearStatus=null)},3e3)),e.saveOpenSessions()}}function id(e,t){let s=t.conversationId;if(s){delete e.processingConversations[s],Ae(e,s),e._closedAt||(e._closedAt={}),e._closedAt[s]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(s);let n=e.executionStatusMap[s];n&&(n.currentTool=null),e.finishStreamingForConversation(s),Qt(e,s);let r=e.conversations.find(i=>i.id===s);r&&(t.claudeSessionId&&(r.claudeSessionId=t.claudeSessionId),t.workDir&&(r.workDir=t.workDir)),e.saveOpenSessions()}}function od(e,t){if(t.conversationId){if(t.isProcessing&&!fs(e,t.conversationId)&&!e._turnCompletedConvs?.has(t.conversationId))e.processingConversations[t.conversationId]=!0;else if(e.processingConversations[t.conversationId]){delete e.processingConversations[t.conversationId],Ae(e,t.conversationId);let s=e.executionStatusMap[t.conversationId];s&&(s.currentTool=null),e.finishStreamingForConversation(t.conversationId)}}}function ad(e,t){let s=t.conversationId||e.currentConversation;if(s){delete e.processingConversations[s],Ae(e,s),e._closedAt||(e._closedAt={}),e._closedAt[s]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(s);let n=e.executionStatusMap[s];n&&(n.currentTool=null),e.finishStreamingForConversation(s),Qt(e,s)}}function ld(e,t){if(!!t.requestId){if(e.chatHistoryRequestIdSupported=!0,!e.isCurrentChatHistoryResponse?.(t))return!1}else{let i=`chat:${t.conversationId}`,o=e.chatHistoryRequests?.[i];if(e.chatHistoryRequestIdSupported===!0||!o?.loading)return!1;t={...t,requestId:o.requestId,catalogKey:i,mode:o.mode||t.mode,...o.mode==="delta"?{afterMessageId:o.cursor}:{}}}e.messagesMap[t.conversationId]||(e.messagesMap[t.conversationId]=[]);let n=e.messagesMap[t.conversationId],r=t.mode==="delta"||typeof t.afterMessageId=="number"&&t.afterMessageId>0;if(t.conversationId&&e.activeConversations.includes(t.conversationId)){let i=Do(td((t.messages||[]).map(a=>e.formatDbMessageForHistoryHydration(a)).flat().filter(Boolean)));if(i.length>0){let a=n.find(l=>l.dbMessageId);if(a&&i[0].dbMessageId&&i[i.length-1].dbMessageId<a.dbMessageId){let l=n.indexOf(a);e.debug,n.splice(l,0,...i)}else{e.debug;for(let l of i)if(!(l.dbMessageId&&n.some(c=>c.dbMessageId===l.dbMessageId))){if(l.dbMessageId&&(l.type==="assistant"||l.type==="user")){let c=null;if(l.type==="user"?c=n.find(d=>!d.dbMessageId&&!d.isStreaming&&jr(d,l)):c=n.find(d=>!d.dbMessageId&&!d.isStreaming&&d.type==="assistant"&&d.content===l.content),c){c.dbMessageId=l.dbMessageId,c.id=l.id,l.timestamp&&(c.timestamp=l.timestamp),l.clientMessageId&&!c.clientMessageId&&(c.clientMessageId=l.clientMessageId);continue}}n.push(l)}}}r||(e.hasMoreMessages=t.hasMore??!1),St(e);let o=e.chatSessionState[t.conversationId]?.hasMoreOlder;e.chatSessionState[t.conversationId]={lastSeenDbId:ps(e.messagesMap[t.conversationId]),hasMoreOlder:r?!!o:!!t.hasMore}}return e.finishChatHistoryRequest?.(t)&&(e.currentConversation===t.conversationId&&(e.loadingMoreMessages=!1),e.setRefreshingSession(t.conversationId,!1)),!0}function cd(e,t){let s=t.sessionId??null,n=t.agentId||s&&e.yeaftSessionAgentById?.[s]||null,r=t.conversationId||n&&e.yeaftConversationIdsByAgent?.[n]||e.yeaftConversationId;if(!r||!s||!Array.isArray(t.messages))return null;e.messagesMap[r]||(e.messagesMap[r]=[]);let i=new Set(Array.isArray(t.sourceMessageIds)?t.sourceMessageIds:[]);for(let c of e.messagesMap[r]){let d=c?.persistedMessageId||c?.messageId||c?.id||null;!t.entryId||!i.has(d)||(c.historyEntryId=t.entryId,Number.isFinite(t.indexGeneration)&&(c.historyIndexGeneration=t.indexGeneration))}let o=t.messages.map(c=>t.entryId&&i.has(c?.id)?{...c,historyEntryId:t.entryId,...Number.isFinite(t.indexGeneration)?{historyIndexGeneration:t.indexGeneration}:{}}:c),{formatted:a}=dd(o,s,"window",e.messagesMap[r],n);ra(e.messagesMap[r],a);let l=ms(e);return ta(e,{conversationId:r,agentId:n,sessionId:s,incomingRows:a,activeAgentId:l.agentId,activeSessionId:l.sessionId}),r}function Jc(e){return e?.toolId?[zn(e)??"",e.vpId||e.speakerVpId||"",e.turnId||"",e.threadId||"main",e.toolId].join("\0"):null}function ed(e,t,s){return e.toolName="AskUserQuestion",e.toolId=t.toolCallId,e.toolInput={questions:s},e.askQuestions=s,e.askRequestId=null,e.askPending=!1,e.pendingAnswers=null,e.askSubmitGeneration=null,e.hasResult=!0,e.isHistory=!0,t.status==="answered"?(e.askAnswered=!0,e.selectedAnswers=t.answers,e.askExpired=!1):(e.askAnswered=!1,e.selectedAnswers=null,e.askExpired=!0),e}function Uh(e,t){return(e||[]).find(s=>s?.type==="tool-use"&&(s.toolName==="AskUser"||s.toolName==="AskUserQuestion")&&s.toolId===t.toolCallId&&zn(s)===t.sessionId&&(s.vpId||s.speakerVpId||"")===(t.vpId||"")&&(s.turnId||"")===(t.turnId||"")&&(s.threadId||"main")===(t.threadId||"main"))||null}function dd(e,t,s,n,r=null){let i=new Set((n||[]).map(c=>zr(Hh(c,r))).filter(Boolean)),o=new Set,a=[],l=0;for(let c of e){if(!c||c._reflection||c.internal||c.systemOnly||c.systemOnlyMessage||Bh(c.content))continue;let d=c.id||c.messageId||null,u=c.clientMessageId||null,f=c.sessionId??c.groupId??t??null,p=Vn(r,f,d),g=u?Yt(r,f,u):p,m=c.historyEntryId?{historyEntryId:c.historyEntryId,...Number.isFinite(c.historyIndexGeneration)?{historyIndexGeneration:c.historyIndexGeneration}:{}}:{};if(!(p&&o.has(p))&&!(p&&s!=="recent"&&i.has(p))){if(p&&o.add(p),c.role==="user"){l+=1;let b=d||c.messageId||c.turnId||null;a.push({...d?{id:d,messageId:d}:{},...p?{stableKey:p}:{},...g?{uiKey:g}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"user",content:c.content,timestamp:Zc(c),sessionId:f,turnId:c.turnId||b,...u?{clientMessageId:u}:{},...Array.isArray(c.attachments)&&c.attachments.length>0?{attachments:c.attachments}:{},...c.quote?{quote:c.quote}:{},isStreaming:!1})}else if(c.role==="assistant"){l+=1;let b=d||c.messageId||c.turnId||null,I=Vh(c,f),y=Zc(c),S=!!c.turnId,w=c.turnId||b,v=typeof c.content=="string"?c.content:c.content||"",h=Array.isArray(c.todos)?c.todos:Dh(c.toolCalls),M=c.executionOrigin==="route_forward"?{executionOrigin:"route_forward"}:{};(typeof v!="string"||v.trim())&&a.push({...d?{id:d,messageId:d}:{},...p?{stableKey:p}:{},...g?{uiKey:g}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),...c.entryId?{entryId:c.entryId}:{},...Array.isArray(c.sourceMessageIds)?{sourceMessageIds:c.sourceMessageIds}:{},type:"assistant",content:v,timestamp:y,sessionId:f,turnId:w,_hasPersistedTurnId:S,...M,...I?{vpId:I,speakerVpId:I}:{},...c.responseKind==="progress"||c.responseKind==="result"?{responseKind:c.responseKind}:{},...c.incomplete===!0?{incomplete:!0}:{},...typeof c.stopReason=="string"&&c.stopReason?{stopReason:c.stopReason}:{},isStreaming:!1,isHistory:!0}),Array.isArray(h)&&h.length>0&&a.push({...d?{id:`${d}:todos`,messageId:`${d}:todos`}:{},...p?{stableKey:`${p}:todos`}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"tool-use",toolName:"TodoWrite",toolInput:{todos:h},timestamp:y,sessionId:f,turnId:w,...M,...I?{vpId:I,speakerVpId:I}:{},isStreaming:!1,isHistory:!0,hasResult:!0});for(let E of Array.isArray(c.images)?c.images:[])E?.assetId&&a.push({id:`${d||b||w}:image:${E.assetId}`,messageId:`${d||b||w}:image:${E.assetId}`,...p?{stableKey:`${p}:image:${E.assetId}`}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"chat-image",...E,timestamp:y,sessionId:f,turnId:w,...M,...I?{vpId:I,speakerVpId:I}:{},isStreaming:!1,isHistory:!0});for(let E of Array.isArray(c.askUserResults)?c.askUserResults:[]){if(!E?.toolCallId||E.status!=="answered"&&E.status!=="expired")continue;let V=[{question:typeof E.question=="string"?E.question:"",options:(Array.isArray(E.options)?E.options:[]).filter(_=>typeof _=="string").map(_=>({label:_,description:""})),multiSelect:!1}],L={toolCallId:E.toolCallId,sessionId:f,vpId:I||"",turnId:w||"",threadId:c.threadId||"main"},R=Uh(n,L);if(R){Object.assign(R,m),ed(R,E,V);continue}let P=ed({id:`${d||b||w}:ask:${E.toolCallId}`,messageId:`${d||b||w}:ask:${E.toolCallId}`,...p?{stableKey:`${p}:ask:${E.toolCallId}`}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"tool-use",timestamp:y,sessionId:f,turnId:w,threadId:L.threadId,...M,...I?{vpId:I,speakerVpId:I}:{},isStreaming:!1},E,V),A=Jc(P);(!A||!a.some(_=>Jc(_)===A))&&a.push(P)}let x=Lh(c);x>0&&a.push({...d?{id:`${d}:tool-summary`,messageId:`${d}:tool-summary`,persistedMessageId:d}:{},...p?{stableKey:`${p}:tool-summary`}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"tool-summary",count:x,omittedCount:x,source:"history",timestamp:y,sessionId:f,turnId:w,...M,...I?{vpId:I,speakerVpId:I}:{},isStreaming:!1,isHistory:!0})}}}return{formatted:a,acceptedHistoryMessages:l}}function ud(e,t){let s=t.sessionId!=null?t.sessionId:t.groupId,n=t.agentId||s&&e.yeaftSessionAgentById?.[s]||null;if(Ws(e,n,t.conversationId)){let R=e.yeaftConversationIdsByAgent?.[n]||null;if(!R||R===t.conversationId)return;Ct(e,t.conversationId,R,{removeSource:t.conversationId!==e.yeaftConversationId}),t={...t,conversationId:R}}if(t.requestId&&typeof e.isCurrentYeaftHistoryResponse=="function"&&!e.isCurrentYeaftHistoryResponse(t))return;let r=t.mode==="recent"||t.mode==="delta"?t.mode:"older",i=Array.isArray(t.messages)?t.messages:[];t.perfTraceId&&Ge(e,{traceId:t.perfTraceId,phase:"history.chunk_received",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,bytes:(()=>{try{return JSON.stringify(t).length}catch{return null}})(),detail:{mode:r,rawCount:i.length}});let o=t.agentId||(s&&e.yeaftSessionAgentById?e.yeaftSessionAgentById[s]:null),a=o&&e.yeaftConversationIdsByAgent?e.yeaftConversationIdsByAgent[o]:null,l=t.conversationId||a||e.yeaftConversationId;if(!l){e.yeaftLoadingMoreHistory=!1;return}jh(e,t,s,l),e.messagesMap[l]||(e.messagesMap[l]=[]);let{formatted:c,acceptedHistoryMessages:d}=dd(i,s,r,e.messagesMap[l],o);On(e,l,c);let u=0,f=!1;if(r==="recent"){let R=qh(e.messagesMap[l],c,s??null);u=R.insertedRows,f=R.preservedEmpty}else if(c.length>0)if(r==="older"){if(e.messagesMap[l].splice(0,0,...c),u=c.length,typeof e.expandYeaftMessageWindow=="function"){let R=e.yeaftActiveSessionFilter?s??null:null;e.expandYeaftMessageWindow(R,t.turns||10,o)}}else u=ra(e.messagesMap[l],c);let p=ms(e);ta(e,{conversationId:l,agentId:o,sessionId:s,incomingRows:c,activeAgentId:p.agentId,activeSessionId:p.sessionId});let g=ke(t.agentId||null,s),m=e.yeaftHistoryCacheState?.[g]||null,b=e.yeaftSessionHistoryState?.[g]||{},I=Number.isFinite(b.serverOldestFetchedSeq)?b.serverOldestFetchedSeq:Number.isFinite(b.oldestSeq)?b.oldestSeq:null,y=Number.isFinite(t.nextBeforeSeq)?t.nextBeforeSeq:Number.isFinite(t.oldestSeq)?t.oldestSeq:f?I:null,S=f&&!Number.isFinite(t.nextBeforeSeq)&&!Number.isFinite(t.oldestSeq)?b.serverHasMore??b.hasMore??!1:t.hasMore,w=r==="delta"?b:Xc(b,{mode:r,oldestSeq:y,hasMore:S,ranges:m?.ranges||[],pageKind:t.pageKind,stopAtSeq:t.gapStopAtSeq,cacheEpoch:m?.rangeEpoch??t.cacheEpoch??0}),v=typeof t.latestSeq=="number"?t.latestSeq:b.latestSeq??null,h=r==="delta"?{...b,loaded:!0,loading:!1,latestSeq:v,syncingAfterSeq:null,count:(b.count||0)+u}:{...w,loaded:!0,loading:!1,count:m?m.rowCount:r==="older"?(b.count||0)+u:f?b.count||0:d,latestSeq:f&&!Number.isFinite(t.latestSeq)?b.latestSeq??null:v,syncingAfterSeq:null};t.requestId&&typeof e.finishYeaftHistoryLoad=="function"?e.finishYeaftHistoryLoad(t,h,"chunk"):e.yeaftSessionHistoryState&&(e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState,[g]:h});let M=ms(e),x=M.sessionId===(s||null),E=!t.agentId||!M.agentId||t.agentId===M.agentId,V=x&&E,L=ke(null,M.sessionId);if(t.perfTraceId&&(Ge(e,{traceId:t.perfTraceId,phase:"history.chunk_applied",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,detail:{mode:r,formattedCount:c.length,insertedRows:u,acceptedHistoryMessages:d,preservedEmptyRecent:f}}),Ur(e,{traceId:t.perfTraceId,phase:"history.next_paint",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,detail:{mode:r,insertedRows:u}})),V)e.yeaftHasMoreHistory=h.hasMore,e.yeaftOldestLoadedSeq=Number.isFinite(h.serverOldestFetchedSeq)?h.serverOldestFetchedSeq:Number.isFinite(h.oldestSeq)?h.oldestSeq:e.yeaftOldestLoadedSeq,e.yeaftLoadingMoreHistory=!1;else if(e.yeaftLoadingMoreHistory){let R=e.yeaftSessionHistoryState?.[M.sessionKey]||e.yeaftSessionHistoryState?.[L]||null;e.yeaftLoadingMoreHistory=!!R?.loading}}var Yr=F(()=>{Gt();Wo();qr();us();jo();Fn();Lo();$t();Ko();Xo();Fs();sa();na()});function pd(e,t,s=null){if(!s)return!1;if(e.promoteYeaftHistoryOutlineRow?.(t,s))return!0;let n=t?.sessionId??t?.groupId??e._currentYeaftSessionId??null;return n?!!e.invalidateYeaftHistoryOutline?.(n,s):!1}function Kh(e){let t=e;if(typeof t=="string"){let s=t.trim();if(s.startsWith("[")&&s.endsWith("]")||s.startsWith("{")&&s.endsWith("}"))try{t=JSON.parse(s)}catch{t=e}}return Array.isArray(t)?t.map(s=>typeof s=="string"?s:!s||typeof s!="object"?"":s.type==="text"&&typeof s.text=="string"||s.type==="input_text"&&typeof s.text=="string"?s.text:"").join("").replace(/\n\n\[Uploaded files\][\s\S]*$/m,"").trim():t&&typeof t=="object"?typeof t.text=="string"?t.text.trim():typeof t.content=="string"?t.content.trim():"":typeof t=="string"?t.replace(/\n\n\[Uploaded files\][\s\S]*$/m,"").trim():""}function oa(e,t){return e.executionStatusMap[t]||(e.executionStatusMap[t]={currentTool:null,toolHistory:[],lastActivity:null}),e.executionStatusMap[t]}function fd(e,t,s,n=null){if(!t)return;let r=oa(e,t);if(r.lastActivity=Date.now(),Nr(e,t),s.type==="system"){if(s.subtype==="init"){let i=e.conversations.find(o=>o.id===t);i&&i.connecting&&(i.connecting=!1);return}s.message&&e.addMessageToConversation(t,{type:"system",content:typeof s.message=="string"?s.message:JSON.stringify(s.message,null,2)});return}if(s.type==="assistant"){let i=s.message?.content;if(!i)return;let o=e.messagesMap[t]||[];for(let a of o)a.type==="tool-use"&&!a.hasResult&&(a.hasResult=!0);for(let a of r.toolHistory)a.status==="running"&&(a.status="done");if(r.currentTool=null,typeof i=="string"){e.appendToAssistantMessageForConversation(t,i,{id:s.message?.id||s.message?.messageId||null,ts:s.ts||s.message?.ts||s.message?.time||null,sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null});return}if(!Array.isArray(i))return;if(i.length===0){e.finishStreamingForConversation(t);return}for(let a of i)a.type==="text"?e.appendToAssistantMessageForConversation(t,a.text,{id:s.message?.id||s.message?.messageId||null,ts:s.ts||s.message?.ts||s.message?.time||null,sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):a.type==="image_asset"&&a.image?e.addMessageToConversation(t,{type:"chat-image",...a.image,sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,speakerVpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):a.type==="tool_summary"?e.addMessageToConversation(t,{type:"tool-summary",count:Number(a.count||a.omittedCount||0)||0,omittedCount:Number(a.omittedCount||a.count||0)||0,source:a.source||"history",isHistory:a.source!=="live",sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):a.type==="tool_use"&&(e.finishStreamingForConversation(t,{completeLifecycle:!1}),r.currentTool={name:a.name,input:a.input,startTime:Date.now()},r.toolHistory.unshift({name:a.name,input:a.input,timestamp:Date.now(),status:"running"}),r.toolHistory.length>20&&r.toolHistory.pop(),e.addMessageToConversation(t,{type:"tool-use",toolId:a.id||a.tool_use_id||null,toolName:a.name,toolInput:a.input,startTime:Date.now(),sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}))}else if(s.type==="user"){let i=s.internal===!0||s.message?.internal===!0||s.userAuthored===!1||s.message?.userAuthored===!1,o=s.message?.content,a=Kh(o);if(typeof a=="string"&&(a.includes("<local-command-caveat>")||a.includes("<command-name>")))return;if(typeof a=="string"&&a.includes("<local-command-stdout>")){let c=a.match(/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/);if(c){e.appendToAssistantMessageForConversation(t,c[1].trim()),e.finishStreamingForConversation(t);return}}let l=[];if(s.tool_use_result)l=Array.isArray(s.tool_use_result)?s.tool_use_result:[s.tool_use_result];else if(s.message?.content){let c=s.message.content;l=(Array.isArray(c)?c:[]).filter(u=>u.type==="tool_result")}if(l.length>0){let c=e.messagesMap[t]||[];for(let d of l){if(r.toolHistory.length>0){let g=r.toolHistory.findIndex(m=>m.status==="running");g>=0&&(r.toolHistory[g].status="done")}let u=d.tool_use_id||d.toolUseId||d.tool_call_id||d.toolCallId||null,f=d.content||d,p=!1;if(u){for(let g=c.length-1;g>=0;g--)if(c[g].type==="tool-use"&&c[g].toolId===u){c[g].hasResult=!0,c[g].toolResult=d.is_update&&c[g].toolResult?`${c[g].toolResult}
|
|
1
|
+
var F=(e,t,s)=>()=>{if(s)throw s[0];try{return e&&(t=e(e=0)),t}catch(n){throw s=[n],n}};var jm=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(s){throw t=0,s}};function Kl(e,t){let s=nacl.randomBytes(24),n=JSON.stringify(e),r,i=!1;n.length>512?(r=pako.gzip(n),i=!0):r=nacl.util.decodeUTF8(n);let o=nacl.secretbox(r,s,t),a={n:nacl.util.encodeBase64(s),c:nacl.util.encodeBase64(o)};return i&&(a.z=!0),a}function zl(e,t){try{let s=nacl.util.decodeBase64(e.n),n=nacl.util.decodeBase64(e.c),r=nacl.secretbox.open(n,s,t);if(!r)return null;if(e.z){let i=pako.ungzip(r,{to:"string"});return JSON.parse(i)}else return JSON.parse(nacl.util.encodeUTF8(r))}catch{return null}}function Yl(e){return e&&typeof e=="object"&&typeof e.n=="string"&&typeof e.c=="string"}function pt(e){return nacl.util.decodeBase64(e)}var Dr=F(()=>{});function Dt(){return globalThis.localStorage||null}function Ql(){let e=$r();for(let t of Io)try{t(e)}catch{}}function Um(){try{Dt()?.removeItem(xn),Dt()?.removeItem(Tn)}catch{}}function Km(e){return String(e||"").trim()||null}function Gl(e,t){if(!Mn(t))return{};try{let s=JSON.parse(Dt()?.getItem(e)||"null");return!s||typeof s!="object"||Array.isArray(s)||s.ownerId!==t.ownerId||!s.records||typeof s.records!="object"||Array.isArray(s.records)?(Dt()?.removeItem(e),{}):s.records}catch{try{Dt()?.removeItem(e)}catch{}return{}}}function Xl(e,t,s){if(!Mn(s))return!1;try{return Dt()?.setItem(e,JSON.stringify({ownerId:s.ownerId,records:t||{}})),!0}catch{return!1}}function ft(e){let t=Km(e);if(!t)return Co(),null;if(cs!==t){cs=t,Lr+=1;for(let s of[xn,Tn])try{let n=JSON.parse(Dt()?.getItem(s)||"null");(!n||n.ownerId!==t)&&Dt()?.removeItem(s)}catch{try{Dt()?.removeItem(s)}catch{}}Ql()}return $r()}function Co(){cs=null,Lr+=1,Um(),Ql()}function $r(){return cs?{ownerId:cs,epoch:Lr}:null}function Mn(e){return!!e&&!!cs&&e.ownerId===cs&&e.epoch===Lr}function Zl(e){return{drafts:Gl(xn,e),outbox:Gl(Tn,e)}}function Ao(e,t){return Xl(xn,e,t)}function Pn(e,t){return Xl(Tn,e,t)}function Jl(e){return typeof e!="function"?()=>{}:(Io.add(e),()=>Io.delete(e))}var xn,Tn,cs,Lr,Io,Yb,xo=F(()=>{xn="yeaft-work-center-composer-drafts-v1",Tn="yeaft-work-center-message-outbox-v1",cs=null,Lr=0,Io=new Set;Yb=Object.freeze({drafts:xn,outbox:Tn})});var zm,Ym,De,gt=F(()=>{Dr();xo();({defineStore:zm}=Pinia),Ym=1800*1e3,De=zm("auth",{state:()=>({skipAuth:!1,emailVerification:!1,passwordResetEnabled:!1,totpEnabled:!1,registrationEnabled:!1,aadEnabled:!1,aadClientId:null,aadTenantId:null,ssoProviders:{github:!1,google:!1,wechat:!1,alipay:!1},linkedIdentities:[],hasPassword:!1,identitiesLoading:!1,identitiesError:null,initialized:!1,authGeneration:0,isAuthenticated:!1,token:null,sessionKey:null,userId:null,role:null,loginStep:"credentials",tempToken:null,emailHint:null,setupToken:null,totpSecret:null,qrCode:null,error:null,loading:!1,qrPanel:null,_qrPollTimer:null,_sessionRefreshTimer:null,_sessionRefreshVisibilityHandler:null}),actions:{async initialize(){if(this.initialized)return this.isAuthenticated;try{if(await this.checkAuthMode(),this.skipAuth&&this.isAuthenticated)return!0;let e=!1;return typeof window<"u"&&typeof this.consumeSsoRedirect=="function"&&(e=this.consumeSsoRedirect()),!this.isAuthenticated&&!e&&await this.restoreSession(),this.isAuthenticated}finally{this.initialized=!0}},async checkAuthMode(){try{let t=await(await fetch("/api/auth/mode")).json();this.skipAuth=t.skipAuth,this.emailVerification=t.emailVerification,this.passwordResetEnabled=!!t.passwordResetEnabled,this.totpEnabled=t.totpEnabled,this.registrationEnabled=t.registrationEnabled||!1,this.aadEnabled=t.aadEnabled||!1,this.aadClientId=t.aadClientId||null,this.aadTenantId=t.aadTenantId||null,this.ssoProviders=Object.assign({github:!1,google:!1,wechat:!1,alipay:!1},t.ssoProviders||{}),this.skipAuth&&(this.userId="skip-auth",ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated")}catch{}},async login(e,t){this.loading=!0,this.error=null;try{let n=await(await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})})).json();return n.success?n.needTotpSetup?(this.setupToken=n.setupToken,this.totpSecret=n.totpSecret,this.qrCode=n.qrCode,this.loginStep="totp-setup",!0):n.needTotpCode?(this.tempToken=n.tempToken,this.loginStep="totp",!0):n.needEmailCode?(this.tempToken=n.tempToken,this.emailHint=n.emailHint,this.loginStep="verification",!0):(this.token=n.token,this.sessionKey=n.sessionKey?pt(n.sessionKey):null,this.role=n.role||"pro",this.userId=n.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",n.token),this.startSessionRefresh(),!0):(this.error=n.error||"Login failed",!1)}catch(s){return this.error=s.message||"Network error",!1}finally{this.loading=!1}},async loginWithMicrosoft(){if(!this.aadEnabled||!this.aadClientId||!this.aadTenantId)return this.error="Microsoft login is not configured",!1;if(typeof msal>"u"||!msal.PublicClientApplication)return this.error="Microsoft authentication library not loaded",!1;this.loading=!0,this.error=null;try{let e={auth:{clientId:this.aadClientId,authority:`https://login.microsoftonline.com/${this.aadTenantId}`,redirectUri:window.location.origin+"/auth/callback"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1}},t=new msal.PublicClientApplication(e);await t.initialize();let s=await t.loginPopup({scopes:["openid","profile","email"]});if(!s||!s.idToken)return this.error="Microsoft login failed: no token received",!1;let r=await(await fetch("/api/auth/aad",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:s.idToken})})).json();return r.success?(this.token=r.token,this.sessionKey=r.sessionKey?pt(r.sessionKey):null,this.role=r.role||"pro",this.userId=r.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",r.token),this.startSessionRefresh(),!0):(this.error=r.error||"Microsoft login failed",!1)}catch(e){return e.errorCode==="user_cancelled"||e.name==="BrowserAuthError"?(this.error=null,!1):(this.error=e.message||"Microsoft login failed",!1)}finally{this.loading=!1}},async verifyTotpCode(e){this.loading=!0,this.error=null;try{let s=await(await fetch("/api/auth/verify-totp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tempToken:this.tempToken,totpCode:e})})).json();return s.success?s.needEmailCode?(this.tempToken=s.tempToken,this.emailHint=s.emailHint,this.loginStep="verification",!0):(this.token=s.token,this.sessionKey=s.sessionKey?pt(s.sessionKey):null,this.role=s.role||"pro",this.userId=s.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",this.tempToken=null,localStorage.setItem("authToken",s.token),this.startSessionRefresh(),!0):(this.error=s.error||"TOTP verification failed",!1)}catch(t){return this.error=t.message||"Network error",!1}finally{this.loading=!1}},async completeTotpSetup(e){this.loading=!0,this.error=null;try{let s=await(await fetch("/api/auth/setup-totp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({setupToken:this.setupToken,totpCode:e})})).json();return s.success?(this.setupToken=null,this.totpSecret=null,this.qrCode=null,s.needEmailCode?(this.tempToken=s.tempToken,this.emailHint=s.emailHint,this.loginStep="verification",!0):(this.token=s.token,this.sessionKey=s.sessionKey?pt(s.sessionKey):null,this.role=s.role||"pro",this.userId=s.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",s.token),this.startSessionRefresh(),!0)):(this.error=s.error||"TOTP setup failed",!1)}catch(t){return this.error=t.message||"Network error",!1}finally{this.loading=!1}},async verifyCode(e){this.loading=!0,this.error=null;try{let s=await(await fetch("/api/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tempToken:this.tempToken,code:e})})).json();return s.success?(this.token=s.token,this.sessionKey=s.sessionKey?pt(s.sessionKey):null,this.role=s.role||"pro",this.userId=s.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",this.tempToken=null,this.emailHint=null,localStorage.setItem("authToken",s.token),this.startSessionRefresh(),!0):(this.error=s.error||"Verification failed",!1)}catch(t){return this.error=t.message||"Network error",!1}finally{this.loading=!1}},async register(e,t,s,n){this.loading=!0,this.error=null;try{let i=await(await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t,email:s||void 0,invitationCode:n})})).json();return i.success?!0:(this.error=i.error||"Registration failed",!1)}catch(r){return this.error=r.message||"Network error",!1}finally{this.loading=!1}},showRegister(){this.loginStep="register",this.error=null},loginWithSso(e){window.location.href=`/api/auth/sso/${encodeURIComponent(e)}/start`},async loginWithAlipayMobile({intent:e="login"}={}){if(!await this.startSsoQr("alipay",{intent:e}))return!1;let s=this.qrPanel?.authorizeUrl;if(!s)return!1;let n=`alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent(s)}`;return this.qrPanel={...this.qrPanel,mobileDeepLink:!0},window.location.href=n,!0},async startSsoQr(e,{intent:t="login"}={}){this.cancelSsoQr(),this.error=null;try{let s=new URLSearchParams;if(t==="bind"){if(!this.isAuthenticated)return this.error="You must be logged in to bind an identity",!1;s.set("intent","bind")}let n=s.toString(),r=`/api/auth/sso/${encodeURIComponent(e)}/start-qr${n?"?"+n:""}`,i=await fetch(r),o=await i.json();return!i.ok||!o.success?(this.error=o.error||"Failed to start QR login",!1):(this.qrPanel={provider:e,intent:t,authorizeUrl:o.authorizeUrl,state:o.state,status:"pending",error:null},this._startQrPoll(),!0)}catch(s){return this.error=s.message||"Network error",!1}},_startQrPoll(){this._stopQrPollTimer();let e=async()=>{if(!this.qrPanel)return;let t=this.qrPanel.state;try{let n=await(await fetch(`/api/auth/sso/poll/${encodeURIComponent(t)}`)).json();if(!this.qrPanel||this.qrPanel.state!==t||n.status==="pending")return;if(n.status==="login"){this.token=n.token,this.sessionKey=n.sessionKey?pt(n.sessionKey):null,this.role=n.role||"pro",this.userId=n.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",n.token),this.startSessionRefresh(),this.cancelSsoQr();return}if(n.status==="bind"){this.qrPanel={...this.qrPanel,status:"bound"},this._stopQrPollTimer();return}this.qrPanel={...this.qrPanel,status:"error",error:n.error||"SSO failed"},this._stopQrPollTimer()}catch{}};this._qrPollTick=e,this._qrPollTimer=setInterval(e,2e3),typeof document<"u"&&!this._qrVisHandler&&(this._qrVisHandler=()=>{typeof document<"u"&&document.visibilityState&&document.visibilityState!=="visible"||!this.qrPanel||!this._qrPollTick||(this._qrPollTick(),this._qrPollTimer&&clearInterval(this._qrPollTimer),this._qrPollTimer=setInterval(this._qrPollTick,2e3))},document.addEventListener("visibilitychange",this._qrVisHandler),typeof window<"u"&&window.addEventListener("pageshow",this._qrVisHandler))},_stopQrPollTimer(){this._qrPollTimer&&(clearInterval(this._qrPollTimer),this._qrPollTimer=null),this._qrVisHandler&&(typeof document<"u"&&document.removeEventListener("visibilitychange",this._qrVisHandler),typeof window<"u"&&window.removeEventListener("pageshow",this._qrVisHandler),this._qrVisHandler=null),this._qrPollTick=null},cancelSsoQr(){this._stopQrPollTimer(),this.qrPanel=null},bindSso(e){if(!this.isAuthenticated){this.error="You must be logged in to bind an identity";return}let t=new URLSearchParams({intent:"bind"});window.location.href=`/api/auth/sso/${encodeURIComponent(e)}/start?${t.toString()}`},consumeSsoRedirect(){let e=window.location.hash||"",t=e.indexOf("?");if(!e.startsWith("#/sso-complete")||t<0)return!1;let s=new URLSearchParams(e.slice(t+1)),n=s.get("token"),r=s.get("sessionKey"),i=s.get("role"),o=s.get("userId");if(!n)return!1;this.token=n,this.sessionKey=r?pt(r):null,this.role=i||"pro",this.userId=o||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",n),this.startSessionRefresh();try{history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}return!0},async loadIdentities(){if(this.isAuthenticated){this.identitiesLoading=!0,this.identitiesError=null;try{let e=await fetch("/api/auth/identities"),t=await e.json();if(!e.ok||!t.success){this.identitiesError=t.error||"Failed to load identities";return}this.linkedIdentities=t.identities||[],this.hasPassword=!!t.hasPassword}catch(e){this.identitiesError=e.message||"Network error"}finally{this.identitiesLoading=!1}}},async unbindIdentity(e){if(!this.isAuthenticated)return!1;this.identitiesError=null;try{let t=await fetch(`/api/auth/identities/${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json();return!t.ok||!s.success?(this.identitiesError=s.error||"Failed to unbind",!1):(this.linkedIdentities=this.linkedIdentities.filter(n=>n.provider!==e),!0)}catch(t){return this.identitiesError=t.message||"Network error",!1}},async refreshSession(){let e=this.token,t=this.authGeneration,s=this.isAuthenticated;try{let n=await fetch("/api/user/profile",{headers:e?{Authorization:`Bearer ${e}`}:{}});if(this.handleAuthResponse(n,e,t,s)||!n.ok)return!1;let r=await n.json().catch(()=>({}));if(t!==this.authGeneration||this.token!==e)return this.isAuthenticated;let i=n.headers?.get?.("X-New-Token"),o=localStorage.getItem("authToken");return i&&this.token===e&&(!o||o===e)&&(this.token=i,localStorage.setItem("authToken",i)),r?.role&&(this.role=r.role),this.userId=r?.userId||null,ft(this.userId),!0}catch{return!1}},startSessionRefresh(){if(this.stopSessionRefresh(),!this.isAuthenticated||this.skipAuth)return;let e=()=>{typeof document<"u"&&document.visibilityState&&document.visibilityState!=="visible"||this.refreshSession()};this._sessionRefreshTimer=setInterval(e,Ym),this._sessionRefreshVisibilityHandler=e,typeof document<"u"&&document.addEventListener("visibilitychange",e),typeof window<"u"&&window.addEventListener("pageshow",e)},stopSessionRefresh(){this._sessionRefreshTimer&&(clearInterval(this._sessionRefreshTimer),this._sessionRefreshTimer=null),this._sessionRefreshVisibilityHandler&&(typeof document<"u"&&document.removeEventListener("visibilitychange",this._sessionRefreshVisibilityHandler),typeof window<"u"&&window.removeEventListener("pageshow",this._sessionRefreshVisibilityHandler),this._sessionRefreshVisibilityHandler=null)},async logout(){try{let e={"Content-Type":"application/json"};this.token&&(e.Authorization=`Bearer ${this.token}`),await fetch("/api/auth/logout",{method:"POST",headers:e})}catch{}this.clearStoredSession()},clearStoredSession(e=null){this.reset(),localStorage.removeItem("authToken"),e&&(this.error=e)},getActiveToken(){if(this.token)return this.token;let e=localStorage.getItem("authToken");return e&&(this.token=e),this.token},handleAuthResponse(e,t=null,s=this.authGeneration,n=this.isAuthenticated,r=void 0){if(!e||e.status!==401||!n||s!==this.authGeneration)return!1;let i=this.token||localStorage.getItem("authToken")||null;return t!==i?!1:(this.handleAuthFailure(r,t,s),!0)},handleAuthFailure(e="Session expired. Please log in again.",t=null,s=this.authGeneration){if(s!==this.authGeneration)return!1;let n=this.token||localStorage.getItem("authToken")||null;return t!==n||this.clearStoredSession(e),!1},async restoreSession(){let e=localStorage.getItem("authToken"),t=this.authGeneration,s=this.isAuthenticated||!!e;try{let n=await fetch("/api/user/profile",{headers:e?{Authorization:`Bearer ${e}`}:{}});if(this.handleAuthResponse(n,e,t,s))return!1;if(!n.ok)return this.error="Failed to restore session",!1;let r=await n.json();if(t!==this.authGeneration)return this.isAuthenticated;let i=n.headers?.get?.("X-New-Token"),o=this.getActiveToken();if(o!==e)return this.isAuthenticated;let a=i&&(!o||o===e)?i:o||e;return this.token=a,a&&a!==e&&localStorage.setItem("authToken",a),this.role=r?.role||"pro",this.userId=r?.userId||null,ft(this.userId),this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",this.startSessionRefresh(),!0}catch(n){return this.error=n.message||"Failed to restore session",!1}},setSessionKey(e){e&&(this.sessionKey=pt(e))},backToCredentials(){this.loginStep="credentials",this.tempToken=null,this.emailHint=null,this.setupToken=null,this.totpSecret=null,this.qrCode=null,this.error=null},async requestPasswordReset(e){this.error=null;try{let s=await(await fetch("/api/auth/password-reset/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})})).json();return s.success?s.resetToken||null:(this.error=s.error||"Failed to request password reset",null)}catch(t){return this.error=t.message||"Network error",null}},async verifyPasswordReset(e,t,s){this.error=null;try{let r=await(await fetch("/api/auth/password-reset/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({resetToken:e,code:t,newPassword:s})})).json();return r.success?!0:(this.error=r.error||"Failed to reset password",!1)}catch(n){return this.error=n.message||"Network error",!1}},async deleteAccount({currentPassword:e,confirm:t}={}){if(!this.isAuthenticated)return{success:!1,error:"Not authenticated"};try{let s=await fetch("/api/user/me",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:e,confirm:t})}),n=await s.json();return!s.ok||!n.success?{success:!1,error:n.error||"Failed to delete account"}:(this.clearStoredSession(),{success:!0})}catch(s){return{success:!1,error:s.message||"Network error"}}},reset(){Co(),this.authGeneration+=1,this.stopSessionRefresh(),this.isAuthenticated=!1,this.token=null,this.sessionKey=null,this.userId=null,this.role=null,this.loginStep="credentials",this.tempToken=null,this.emailHint=null,this.setupToken=null,this.totpSecret=null,this.qrCode=null,this.error=null,this.loading=!1}}})});function Le(e,t){let s=Lt?.value||"zh-CN",r=(Hs[s]||Hs["zh-CN"]||{})[e];if(r===void 0&&s!=="zh-CN"&&(r=(Hs["zh-CN"]||{})[e]),r===void 0)return e;if(t)for(let[i,o]of Object.entries(t))r=r.replace(new RegExp(`\\{${i}\\}`,"g"),o);return r}function Gm(){return Lt?.value||"zh-CN"}function Rn(e){Hs[e]&&(Lt&&(Lt.value=e),localStorage.setItem("locale",e),document.documentElement.setAttribute("lang",e))}function Qm(){let e=localStorage.getItem("locale");return e&&Hs[e]?e:(navigator.language||navigator.userLanguage||"").startsWith("en")?"en":"zh-CN"}function ec(e,t){return Hs=t,Lt=Vue.ref(Qm()),document.documentElement.setAttribute("lang",Lt.value),e.config.globalProperties.$t=Le,e.config.globalProperties.$locale=Lt,e.provide("t",Le),e.provide("locale",Lt),{t:Le,setLocale:Rn,getLocale:Gm,locale:Lt}}var Lt,Hs,$t=F(()=>{Lt=null,Hs={}});function Vr(e){if(e==null||e==="")return"claude-code";if(Xm.has(e))return e;throw new Error(`Unknown Chat runtime provider: ${e}`)}function zt(e){if(typeof e!="string"||!e)throw new Error("Chat catalog key requires conversationId");return`chat:${e}`}function Hr(e,t){if(typeof e!="string"||!e||typeof t!="string"||!t)throw new Error("Yeaft catalog key requires agentId and sessionId");return`yeaft:${e}:${t}`}function _n(e,t,s={}){let n=e.sessionCatalog.map(i=>({...i})),r=Array.isArray(e.hiddenSessionCatalog)?e.hiddenSessionCatalog.map(i=>({...i})):null;return e.sessionCatalogMutationRequests[t]={previousCatalog:n,previousHiddenCatalog:r,...s},n}function tc(e,t){let s=t?.requestId?e.sessionCatalogMutationRequests[t.requestId]:null;return s?(delete e.sessionCatalogMutationRequests[t.requestId],t.ok!==!0&&(e.sessionCatalog=s.previousCatalog,Array.isArray(s.previousHiddenCatalog)&&(e.hiddenSessionCatalog=s.previousHiddenCatalog)),!0):!1}function sc(e,t,s="recent",n=null){let r=zt(t),i=e.chatHistoryRequests[r]||{},o=Number(i.generation||0)+1,a=`chat_history_${o}_${crypto.randomUUID()}`;return e.chatHistoryRequests[r]={requestId:a,catalogKey:r,generation:o,mode:s,cursor:n,connectionGeneration:Number(e.chatHistoryConnectionGeneration||0),loading:!0,cancelled:!1,error:null},a}function To(e,t,s,n){let r=e.chatHistoryRequests[t];return r?.requestId!==s?!1:(e.chatHistoryRequests[t]={...r,loading:!1,cancelled:!0,error:n},!0)}var Xm,Mo=F(()=>{Xm=new Set(["claude-code","copilot"])});function Os(e,t,s=""){En&&(clearTimeout(En),En=null),e.sessionLoading=t,e.sessionLoadingText=s,t&&(En=setTimeout(()=>{e.sessionLoading&&(e.sessionLoading=!1,e.sessionLoadingText=""),En=null},Zm))}function St(e){Os(e,!1)}function nc(e){if(e.currentConversation){e.pendingRecovery=null;return}let t=e.lastUsedSession,s=e.lastUsedAgent;if(t&&t.sessionId&&s){let n=e.agents.find(r=>r.id===s&&r.online);n&&(e.pendingRecovery={agentId:s,agentName:n.name,sessionId:t.sessionId,workDir:t.workDir,provider:Vr(t.provider),catalogKey:t.catalogKey||null},e.recoveryDismissed=!1)}}function rc(e){if(!e.pendingRecovery)return;let{agentId:t,sessionId:s,workDir:n,provider:r}=e.pendingRecovery;e.selectAgent(t),setTimeout(()=>{e.resumeConversation(s,n,t,{provider:Vr(r)}),e.pendingRecovery=null,e.recoveryDismissed=!1},500)}function ic(e){e.recoveryDismissed=!0,e.pendingRecovery=null}function oc(e,t){let s=e.conversations.find(n=>n.id===t);s&&(e.activeConversations=[t],e.currentWorkDir=s.workDir,e.messagesMap[t]?.length>0||(s.claudeSessionId?(e.messagesMap[t]=[],Os(e,!0,Le("chat.session.loadingHistory")),e.sendWsMessage({type:"resume_conversation",agentId:s.agentId||e.currentAgent,claudeSessionId:s.claudeSessionId,workDir:s.workDir,conversationId:t})):(e.messagesMap[t]=[],e.requestChatHistory?.(t,{mode:"recent",turns:5}))),e.sendWsMessage({type:"select_conversation",conversationId:t}))}function ac(e){if(e.panels.length>0)return;let t=localStorage.getItem("panels");if(!t)return;let s;try{s=JSON.parse(t)}catch{localStorage.removeItem("panels");return}if(!Array.isArray(s)||s.length<2){localStorage.removeItem("panels");return}let n=new Set(e.conversations.map(i=>i.id)),r=s.filter(i=>i&&typeof i.id=="string").map(i=>({id:i.id,conversationId:i.conversationId&&n.has(i.conversationId)?i.conversationId:null,activeRightPanel:i.activeRightPanel||null}));if(r.length<2){localStorage.removeItem("panels");return}e.panels=r,e.activePanelId=r[0]?.id||null;for(let i of r)i.conversationId&&(e.activeConversations.includes(i.conversationId)||e.activeConversations.push(i.conversationId),e.messagesMap[i.conversationId]||(e.messagesMap[i.conversationId]=[]),e.messagesMap[i.conversationId].length||e.requestChatHistory?.(i.conversationId,{mode:"recent",turns:5}))}function ds(e){if(e.currentAgent){if(localStorage.setItem("lastUsedAgent",e.currentAgent),localStorage.setItem("lastViewedConversation",e.currentConversation||""),e.lastViewedConversation=e.currentConversation,e.currentConversation){let t=e.conversations.find(s=>s.id===e.currentConversation);if(t?.claudeSessionId&&t?.workDir){let s=Vr(t.provider),n={sessionId:t.claudeSessionId,workDir:t.workDir,agentId:t.agentId||e.currentAgent,provider:s,catalogKey:zt(t.id),version:2};localStorage.setItem("lastUsedSession",JSON.stringify(n)),localStorage.setItem("lastViewedSessionRef",JSON.stringify(n)),e.lastUsedSession=n}}e.lastUsedAgent=e.currentAgent,e.panels.length>0?localStorage.setItem("panels",JSON.stringify(e.panels)):localStorage.removeItem("panels")}}function lc(e){return e.lastUsedSession}function cc(e){localStorage.removeItem("lastUsedAgent"),localStorage.removeItem("lastUsedSession"),localStorage.removeItem("lastViewedSessionRef"),localStorage.removeItem("lastViewedConversation"),localStorage.removeItem("panels"),localStorage.removeItem("splitPanesSaved"),e.lastUsedAgent=null,e.lastUsedSession=null,e.lastViewedConversation=null}function dc(e,t,s){if(!e.currentAgent){e.historySessionsLoading=!1;return}if(!t){e.historySessions=[],e.historySessionsLoading=!1;return}let n=Date.now().toString();e._historySessionsRequestId=n,e.historySessionsLoading=!0,e.historySessions=[],e.sendWsMessage({type:"list_history_sessions",workDir:t,provider:s||"claude-code",requestId:n})}function uc(e,t){if(!e.currentAgent)return e.foldersLoading=!1,Promise.resolve();e.foldersLoading=!0,e.folders=[];let s=Date.now().toString();return e._foldersRequestId=s,new Promise(n=>{e._foldersResolve&&e._foldersResolve(),e._foldersResolve=n,e.sendWsMessage({type:"list_folders",provider:t||"claude-code",requestId:s}),setTimeout(()=>{e._foldersResolve===n&&(e._foldersResolve(),e._foldersResolve=null,e.foldersLoading=!1)},1e4)})}function pc(e,t,s){if(!t)return e.foldersLoading=!1,Promise.resolve();e.foldersLoading=!0,e.folders=[];let n=Date.now().toString();return e._foldersRequestId=n,new Promise(r=>{e._foldersResolve&&e._foldersResolve(),e._foldersResolve=r,e.sendWsMessage({type:"list_folders",agentId:t,provider:s||"claude-code",requestId:n}),setTimeout(()=>{e._foldersResolve===r&&(e._foldersResolve(),e._foldersResolve=null,e.foldersLoading=!1)},1e4)})}function fc(e,t,s){if(!t)return Promise.resolve([]);let n=`models-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return e._modelsRequestId=n,e.providerModelsLoading=!0,new Promise(r=>{e._modelsResolve&&e._modelsResolve([]),e._modelsTimeout&&clearTimeout(e._modelsTimeout),e._modelsResolve=r,e.sendWsMessage({type:"list_models",agentId:t,provider:s||"claude-code",requestId:n}),e._modelsTimeout=setTimeout(()=>{e._modelsResolve===r&&(e._modelsResolve([]),e._modelsResolve=null,e.providerModelsLoading=!1),e._modelsTimeout=null},1e4)})}function gc(e,t,s,n){if(!t){e.historySessionsLoading=!1;return}if(!s){e.historySessions=[],e.historySessionsLoading=!1;return}let r=Date.now().toString();e._historySessionsRequestId=r,e.historySessionsLoading=!0,e.historySessions=[],e.sendWsMessage({type:"list_history_sessions",agentId:t,workDir:s,provider:n||"claude-code",requestId:r})}async function mc(e,t=20){if(De().isAuthenticated){e.globalSessionsLoading=!0;try{let n=await fetch(`/api/sessions?limit=${t}`);if(n.ok){let r=await n.json();e.globalSessions=r.sessions||[]}}catch{}finally{e.globalSessionsLoading=!1}}}async function hc(e,t){if(!De().isAuthenticated)return!1;try{if((await fetch(`/api/sessions/${t}`,{method:"DELETE"})).ok)return e.globalSessions=e.globalSessions.filter(r=>r.id!==t),!0}catch{}return!1}function Po(e,t){return t.agentId?e.agents.find(s=>s.id===t.agentId):t.agentName?e.agents.find(s=>s.name===t.agentName):null}function vc(e,t){let s=Po(e,t);return s&&s.online}var Zm,En,us=F(()=>{gt();$t();Mo();Zm=3e4,En=null});function yc(e){return e?.code===1008&&String(e.reason||"").toLowerCase().includes("authentication")}function bc(e){let t=Dn;Dn=[];for(let{resolve:s,reject:n,timer:r}of t)clearTimeout(r),e?s():n(new Error("WebSocket reconnect failed"))}function wc(e,t){if(!e.ws||e.ws.readyState!==WebSocket.OPEN)return!1;if(e.currentView==="yeaft"&&eh.has(t.type)){let s=t.conversationId;if(!s||typeof s=="string"&&s.startsWith("yeaft-")||s===e.yeaftConversationId)return!1}try{if(e.serverEncryptionRequired&&e.sessionKey){let s=Kl(t,e.sessionKey);e.ws.send(JSON.stringify(s))}else e.ws.send(JSON.stringify(t));return!0}catch{return!1}}function Ln(e,t=1e4){return e.ws&&e.ws.readyState===WebSocket.OPEN?Promise.resolve():new Promise((s,n)=>{let r=setTimeout(()=>{Dn=Dn.filter(i=>i.resolve!==s),n(new Error("WebSocket reconnect timeout"))},t);Dn.push({resolve:s,reject:n,timer:r}),(!e.ws||e.ws.readyState!==WebSocket.CONNECTING)&&(e.reconnectAttempts=0,e.connect())})}function kc(e,t){try{let s=JSON.parse(t);return e.sessionKey&&Yl(s)?zl(s,e.sessionKey):s}catch{return null}}function Sc(e){let t=De(),s=location.protocol==="https:"?"wss:":"ws:";e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null);let n=t.getActiveToken?.()||t.token||null,r=t.authGeneration;if(e.ws&&e.ws.readyState===WebSocket.CONNECTING&&e._wsAuthToken===n&&e._wsAuthGeneration===r)return;clearTimeout(e._legacyYeaftSessionHydrateTimer),e._legacyYeaftSessionHydrateTimer=null,e._hasHandledAgentList=!1,e._hasHandledYeaftSessionHydrate=!1,e.yeaftSessionInventoryCompleteSupported=null,e.yeaftSessionHydrateRequestId=null,e.yeaftSessionHydrateSlices=[],e.yeaftSessionHydrateError=null,e._yeaftSessionInventorySocketQuarantined=!1,e.pendingAgentSelection=null,e.agentSwitching=!1,e.ws&&(e.ws.onopen=null,e.ws.onmessage=null,e.ws.onclose=null,e.ws.close(),e.ws=null),e.connectionState=e.reconnectAttempts>0?"reconnecting":"connecting",e.serverEncryptionRequired=!0,e.chatHistoryRequestIdSupported=null,e.chatHistoryConnectionGeneration=Number(e.chatHistoryConnectionGeneration||0)+1;for(let[l,c]of Object.entries(e.projectMutationRequests||{}))c?.resolve?.({ok:!1,requestId:l,error:{code:"connection_changed"}});e.projectMutationRequests={},e.sessionProjects=[];for(let[l,c]of Object.entries(e.chatHistoryRequests||{}))c?.loading&&(e.chatHistoryRequests[l]={...c,loading:!1,cancelled:!0,error:"connection_changed"});let i=Object.values(e.sessionCatalogMutationRequests||{});i.length>0&&(e.sessionCatalog=i[0].previousCatalog,Array.isArray(i[0].previousHiddenCatalog)&&(e.hiddenSessionCatalog=i[0].previousHiddenCatalog),e.sessionCatalogMutationRequests={}),e.sessionCatalogLoaded=!1,e.sessionCatalog=[],e.hiddenSessionCatalog=[],e.activeCatalogKey=null,e._wsAuthToken=n,e._wsAuthGeneration=r;let o=`${s}//${location.host}?type=web`;n&&(o+=`&token=${encodeURIComponent(n)}`);let a=new WebSocket(o);e.ws=a,a.onopen=()=>{if(a===e.ws){e.connectionState="connected",e.reconnectAttempts=0,e.startHeartbeat();try{a.send(JSON.stringify({type:"client_hello",plaintextOk:!0}))}catch{}bc(!0)}},a.onmessage=l=>{if(a!==e.ws)return;let c=e.parseWsMessage(l.data);c&&(c.type,e.handleMessage({...c,_wsAuthToken:n,_wsAuthGeneration:r}))},a.onclose=l=>{if(a!==e.ws){yc(l)&&t.handleAuthFailure?.(void 0,n,r);return}e.authenticated=!1,clearTimeout(e._legacyYeaftSessionHydrateTimer),e._legacyYeaftSessionHydrateTimer=null,e._hasHandledAgentList=!1,e._hasHandledYeaftSessionHydrate=!1,e.yeaftSessionInventoryCompleteSupported=null,e.yeaftSessionHydrateRequestId=null,e.yeaftSessionHydrateSlices=[],e.yeaftSessionHydrateError=null,e.pendingAgentSelection=null,e.agentSwitching=!1;let c=e.connectionState==="updating";if(e.connectionState=c?"updating":"disconnected",e.stopHeartbeat(),St(e),yc(l)){t.handleAuthFailure?.(void 0,n,r),e.reconnectAttempts=0,bc(!1);return}if(e._yeaftReconnectCatchUpPending=!0,c){e.reconnectAttempts=0,e.reconnectTimer=setTimeout(()=>{e.connect()},2e3);return}e.scheduleReconnect()},e.ws.onerror=l=>{}}function Ic(e){if(e.reconnectAttempts>=e.maxReconnectAttempts){e.connectionState="disconnected";return}let t=Math.min(1e3*Math.pow(2,e.reconnectAttempts),3e4);e.reconnectAttempts++,e.connectionState="reconnecting",e.reconnectTimer=setTimeout(()=>{e.connect()},t)}function Cc(e){e.reconnectAttempts=0,e.connect()}function Ac(e){e.stopHeartbeat(),e._lastPongAt=Date.now(),e.heartbeatTimer=setInterval(()=>{if(e.ws&&e.ws.readyState===WebSocket.OPEN){if(Date.now()-e._lastPongAt>45e3){e.ws.close(4e3,"Heartbeat timeout");return}try{e.sendWsMessage({type:"ping"})}catch{}}},25e3)}function xc(e){e.heartbeatTimer&&(clearInterval(e.heartbeatTimer),e.heartbeatTimer=null)}function Tc(e){e._visibilityHandlerInstalled||(e._visibilityHandlerInstalled=!0,document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible")if(!e.ws||e.ws.readyState!==WebSocket.OPEN)e.reconnectAttempts=0,e.connect();else try{e.sendWsMessage({type:"ping"});let t=e._lastPongAt;setTimeout(()=>{e._lastPongAt===t&&e.ws&&e.ws.close(4001,"Visibility resume timeout")},3e3)}catch{e.reconnectAttempts=0,e.connect()}}))}var Dn,eh,Ro=F(()=>{gt();Dr();us();Dn=[];eh=new Set(["sync_messages","refresh_conversation","select_conversation","cancel_execution","update_conversation_settings","ask_user_answer"])});function nh(e){return e?.type==="tool-use"}function _o(e){return e?.type==="tool-summary"}function Eo(e){return nh(e)&&!sh.has(e.toolName)}function Rc(e,t,s,n=s){let r=t==="history"&&(n?.dbMessageId||n?.id)||null;return{...r?{id:`tool_summary_${t}_${r}`,dbMessageId:n?.dbMessageId||null}:{},type:"tool-summary",count:e,omittedCount:e,source:t,isHistory:t!=="live",timestamp:s?.timestamp||s?.startTime||n?.timestamp||n?.startTime||null,sessionId:s?.sessionId??s?.groupId??null,turnId:s?.turnId||null,vpId:s?.vpId||null,speakerVpId:s?.speakerVpId||null}}function rh(e,t){return!_o(e)||!_o(t)?!1:(e.turnId||null)===(t.turnId||null)&&(e.sessionId||null)===(t.sessionId||null)&&(e.speakerVpId||e.vpId||null)===(t.speakerVpId||t.vpId||null)&&(e.source||null)===(t.source||null)}function ih(e,t){let s=(Number(e.count)||0)+(Number(t.count)||0);return e.count=s,e.omittedCount=s,!e.timestamp&&t.timestamp&&(e.timestamp=t.timestamp),Number(t.dbMessageId||0)>Number(e.dbMessageId||0)&&(e.dbMessageId=t.dbMessageId,t.id&&(e.id=t.id)),e}function Mc(e){return[e?.sessionId||"",e?.turnId||"",e?.speakerVpId||e?.vpId||""].join("")}function Pc(e,t,s,n,r=n){if(!t)return;let i=Rc(t,s,n,r),o=e[e.length-1];rh(o,i)?ih(o,i):e.push(i)}function Do(e=[]){let t=[],s=0,n=null,r=null;for(let i of e){if(Eo(i)&&i.isHistory){s+=1,n||(n=i),r=i;continue}Pc(t,s,"history",n,r),s=0,n=null,r=null,t.push(i)}return Pc(t,s,"history",n,r),t}function _c(e=[],t={}){let s=Number.isFinite(t.maxDetailed)?Math.max(1,t.maxDetailed):100;if(!Array.isArray(e)||e.length<=s)return e;let n=e.length;for(let p=e.length-1;p>=0;p-=1){let g=e[p];if(g?.type==="user"||g?.type==="system"||g?.type==="error")break;n=p}let r=e.slice(n),i=new Map;for(let p of r){if(!Eo(p)||p.isHistory)continue;let g=Mc(p);i.set(g,(i.get(g)||0)+1)}let o=new Map;for(let[p,g]of i)g>s&&o.set(p,g-s);if(o.size===0)return e;let a=new Map,l=new Map,c=new Set,d=[],u=(p,g,m)=>{a.set(p,(a.get(p)||0)+g),!l.has(p)&&m&&l.set(p,m)},f=(p,g)=>{if(c.has(p))return;let m=a.get(p)||0;m<=0||(d.push(Rc(m,"live",l.get(p)||g)),c.add(p))};for(let p of r){let g=Mc(p);if(_o(p)&&p.source==="live"&&o.has(g)){u(g,Number(p.count)||0,p);continue}if(Eo(p)&&!p.isHistory&&o.has(g)){let m=o.get(g)||0;if(m>0){o.set(g,m-1),u(g,1,p);continue}}f(g,p),d.push(p)}for(let p of a.keys())f(p,l.get(p));return e.splice(n,e.length-n,...d),e}var sh,Lo=F(()=>{sh=new Set(["TodoWrite","AskUserQuestion"])});function ke(e,t){let s=t==null?"__all__":String(t);return e?`${e}${s}`:s}function $n(e){return typeof e?.entryId=="string"&&e.entryId?`entry:${e.entryId}`:e?.role==="assistant"&&e?.turnId?`live-response:${e.turnId}:${e.speakerVpId||e.vpId||""}`:typeof e?.clientMessageId=="string"&&e.clientMessageId?`client:${e.clientMessageId}`:`message:${e?.messageId||""}`}function Vn(e,t,s){return typeof s!="string"||!s?null:`${ke(e,t)}message:${s}`}function Yt(e,t,s){return typeof s!="string"||!s?null:`${ke(e,t)}client:${s}`}var Fs=F(()=>{});function $o(e,t){return t?t===e.yeaftConversationId?!0:Object.values(e.yeaftConversationIdsByAgent||{}).includes(t):!1}function Hn(e,t,s){s&&(s.type!=="assistant"&&s.type!=="tool-use"||$o(e,t)&&(!s.vpId&&e._currentYeaftVpId&&(s.vpId=e._currentYeaftVpId),!s.turnId&&e._currentYeaftTurnId&&(s.turnId=e._currentYeaftTurnId),!s.speakerVpId&&s.vpId&&(s.speakerVpId=s.vpId)))}function ah(e){let t=[e?.timestamp,e?.createdAt,e?.ts,e?.time,e?.created_at];for(let s of t){if(typeof s=="number"&&Number.isFinite(s)&&s>0)return s;if(typeof s=="string"&&s.trim()){let n=Date.parse(s);if(Number.isFinite(n))return n;let r=Number(s);if(Number.isFinite(r)&&r>0)return r}}return Date.now()}function Or(e){let t=e?.stableKey??e?.messageId??e?.dbMessageId??e?.id;return t==null||t===""?null:String(t)}function Vo(e,t,s){if(!s||typeof s!="object")return null;if(typeof s.uiKey=="string"&&s.uiKey)return s.uiKey;let n=s.entryId||s.stableKey||s.atMessageId||s.messageId||s.dbMessageId||s.id||null;if(n!=null&&n!=="")return s.uiKey=String(n),s.uiKey;let r=`legacy:${t||"conversation"}:`,i=new Set((e?.messagesMap?.[t]||[]).map(a=>a?.uiKey).filter(a=>typeof a=="string"&&a)),o=Number(e?._messageUiKeySequence)||0;do o+=1;while(i.has(`${r}${o}`));return e&&(e._messageUiKeySequence=o),s.uiKey=`${r}${o}`,s.uiKey}function On(e,t,s){for(let n of Array.isArray(s)?s:[])Vo(e,t,n);return s}function Ho(e,t){if(!e||!t)return e;let s=e.type==="user"&&typeof e.id=="string"&&e.id===e.clientMessageId;for(let[n,r]of Object.entries(t))if(r!=null){if(n==="isStreaming"){e.isStreaming&&r===!1&&(e.isStreaming=!1);continue}if(!(n==="uiKey"&&e.uiKey)){if(n==="id"||n==="messageId"){if(s&&t.clientMessageId===e.clientMessageId&&t.messageId&&t.messageId!==e.clientMessageId)continue;(e[n]===void 0||e[n]===null||e[n]==="")&&(e[n]=r);continue}if(!(n==="turnId"&&s&&e.turnId===e.clientMessageId)){if(n==="content"&&typeof r=="string"){e.content||(e.content=r);continue}if(n==="responseKind"&&(r==="progress"||r==="result")){e.responseKind=r;continue}if(n==="attachments"&&Array.isArray(r)){(!Array.isArray(e.attachments)||e.attachments.length===0)&&(e.attachments=r);continue}(e[n]===void 0||e[n]===null||e[n]==="")&&(e[n]=r)}}}return e}function Ec(e=[],t=[]){let s=[],n=new Map,r=new Map;for(let i of[...e,...t]){if(!i)continue;let o=Or(i),a=i.type==="user"&&i.clientMessageId?String(i.clientMessageId):null;if(o&&n.has(o)){Ho(n.get(o),i);continue}if(a&&r.has(a)){let l=r.get(a);Ho(l,i),o&&!n.has(o)&&n.set(o,l);continue}s.push(i),o&&n.set(o,i),a&&r.set(a,i)}return s}function Dc(e,t,s){return!e||e!==t?!1:!s?.loaded&&!s?.loading}function Lc(e,t){return!!t&&!!e?.loaded&&!e?.loading&&Number.isFinite(e?.latestSeq)}function Oo({sessionState:e,hasCachedSessionRows:t,force:s=!1}={}){return e?.loading?!1:s?!e?.loaded:e?.loaded?!1:!t}function lh(e,t,s,n){let r=s?.id?String(s.id):null;if(!r)return!1;let o=(e.messagesMap[t]||[]).find(a=>a?.type==="assistant"&&Or(a)===r);return o?(o.id||(o.id=r),o.messageId||(o.messageId=r),s.ts&&!o.ts&&(o.ts=s.ts),s.timestamp&&!o.timestamp&&(o.timestamp=s.timestamp),s.sessionId&&!o.sessionId&&(o.sessionId=s.sessionId),s.vpId&&!o.vpId&&(o.vpId=s.vpId),s.turnId&&!o.turnId&&(o.turnId=s.turnId),s.threadId&&!o.threadId&&(o.threadId=s.threadId),o.content?typeof o.content=="string"&&(n.startsWith(o.content)?o.content=n:o.content.endsWith(n)||(o.content+=n)):o.content=n,Hn(e,t,o),!0):!1}function Fr(e,t,s){if(!t)return;let n={...s};Vo(e,t,n);let r={...n,id:s.dbMessageId||s.id||Date.now().toString()+Math.random().toString(36).substr(2,9),timestamp:ah(s)};if($o(e,t)&&!r.sessionId&&(r.sessionId=e._currentYeaftSessionId||e.yeaftActiveSessionFilter||oh),$o(e,t)){let o=e._currentYeaftAgentId||Object.entries(e.yeaftConversationIdsByAgent||{}).find(([,c])=>c===t)?.[0]||e.currentAgent||null,a=typeof r.messageId=="string"&&/^m\d+$/.test(r.messageId)?r.messageId:typeof r.id=="string"&&/^m\d+$/.test(r.id)?r.id:null,l=typeof r.clientMessageId=="string"?r.clientMessageId:null;r.stableKey||(r.stableKey=a?Vn(o,r.sessionId,a):Yt(o,r.sessionId,l)),r.uiKey||(r.uiKey=r.stableKey||null),!r.vpId&&e._currentYeaftVpId&&(r.vpId=e._currentYeaftVpId),!r.turnId&&e._currentYeaftTurnId&&(r.turnId=e._currentYeaftTurnId),Hn(e,t,r)}e.messagesMap[t]||(e.messagesMap[t]=[]),Vo(e,t,r);let i=Or(s);if(i){let o=e.messagesMap[t].find(a=>Or(a)===i);if(o)return Ho(o,r),t===e.yeaftConversationId&&e.messagesMap[t].sort((a,l)=>a.timestamp-l.timestamp),o}return e.messagesMap[t].push(r),_c(e.messagesMap[t]),t===e.yeaftConversationId&&e.messagesMap[t].sort((o,a)=>o.timestamp-a.timestamp),r}function $c(e,t,s,n={}){if(!t||!s)return;e.messagesMap[t]||(e.messagesMap[t]=[]);let r=e.messagesMap[t];if(lh(e,t,n,s))return;let i=e._currentYeaftTurnId;if(i){for(let a=r.length-1;a>=0;a--)if(r[a].turnId===i&&r[a].type==="assistant"&&r[a].isStreaming){if(Hn(e,t,r[a]),n.id&&!r[a].id&&(r[a].id=n.id),n.id&&!r[a].messageId&&(r[a].messageId=n.id),r[a].content.endsWith(s))return;r[a].content+=s;return}Fr(e,t,{...n.id?{id:n.id,messageId:n.id}:{},...n.ts?{ts:n.ts}:{},...n.timestamp?{timestamp:n.timestamp}:{},...n.sessionId?{sessionId:n.sessionId}:{},...n.vpId?{vpId:n.vpId}:{},...n.turnId?{turnId:n.turnId}:{},...n.threadId?{threadId:n.threadId}:{},type:"assistant",content:s,isStreaming:!0,status:"pending",turnStartAt:n.timestamp||Date.now()});return}let o=r[r.length-1];if(o&&o.type==="assistant"&&o.isStreaming){if(Hn(e,t,o),n.id&&!o.id&&(o.id=n.id),n.id&&!o.messageId&&(o.messageId=n.id),o.content.endsWith(s))return;o.content+=s}else Fr(e,t,{...n.id?{id:n.id,messageId:n.id}:{},...n.ts?{ts:n.ts}:{},...n.timestamp?{timestamp:n.timestamp}:{},...n.sessionId?{sessionId:n.sessionId}:{},...n.vpId?{vpId:n.vpId}:{},...n.turnId?{turnId:n.turnId}:{},...n.threadId?{threadId:n.threadId}:{},type:"assistant",content:s,isStreaming:!0,status:"pending",turnStartAt:n.timestamp||Date.now()})}function Vc(e,t,{completeLifecycle:s=!0}={}){if(!t)return;let n=e.messagesMap[t];if(!n||n.length===0)return;let r=e._currentYeaftTurnId||null;for(let i=n.length-1;i>=0;i--){let o=n[i];if(r&&o.turnId&&o.turnId!==r){if(o.type==="user")break;continue}if(o.isStreaming&&(o.isStreaming=!1,s&&o.status==="pending"&&(o.status="completed",o.turnEndAt=Date.now())),Hn(e,t,o),o.type==="user")break}}function Hc(e,t){if(!t||e.processingConversations&&e.processingConversations[t]||e.activeVpTurns&&Object.keys(e.activeVpTurns).length>0)return;let s=e.messagesMap&&e.messagesMap[t];if(!(!s||s.length===0))for(let n of s)n&&n.isStreaming&&(n.isStreaming=!1)}function Oc(e,t){let s=e.currentConversation;if(!s)return;e.messagesMap[s]||(e.messagesMap[s]=[]);let n=e.messagesMap[s],r=null;for(let i of t)if(i.type==="user"){let o=i.message?.content;if(o){let a=typeof o=="string"?o:Array.isArray(o)?o.map(l=>l.text||"").join(""):"";a&&(r=a,e.addMessage({type:"user",content:a,isHistory:!0}))}}else if(i.type==="assistant"){let o=i.message?.content;if(o&&Array.isArray(o)){for(let a of o)if(a.type==="text"&&a.text)e.addMessage({type:"assistant",content:a.text,isHistory:!0});else if(a.type==="tool_use")e.addMessage({type:"tool-use",toolName:a.name,toolInput:a.input,isHistory:!0});else if(a.type==="tool_result"){for(let l=n.length-1;l>=0;l--)if(n[l].type==="tool-use"&&!n[l].hasResult){n[l].hasResult=!0,n[l].toolResult=a.content;break}}}}if(r&&s&&!e.conversationTitles[s]){let i=r.trim().substring(0,100);e.conversationTitles[s]=i}}function ps(e){if(!Array.isArray(e))return null;let t=null;for(let s of e)typeof s?.dbMessageId=="number"&&s.dbMessageId>0&&(t===null||s.dbMessageId>t)&&(t=s.dbMessageId);return t}function Fc(e){return{id:e.id,dbMessageId:e.id,timestamp:e.created_at}}function Nc(e){return e?e.message_type==="tool_use"&&!ch.has(e.tool_name)?{...Fc(e),type:"tool-use",toolName:e.tool_name||"unknown",hasResult:!0,isHistory:!0,startTime:e.created_at||0}:Fo(e):null}function Fo(e){if(!e)return null;let t=Fc(e);if(e.message_type==="tool_use"){let n={...t,type:"tool-use",toolName:e.tool_name||"unknown",toolInput:(()=>{try{return JSON.parse(e.tool_input||e.content||"{}")}catch{return{}}})(),hasResult:!0,isHistory:!0,startTime:e.created_at||0};if(e.metadata)try{let r=JSON.parse(e.metadata);r.askRequestId&&(n.askRequestId=r.askRequestId,n.askQuestions=r.askQuestions,n.askAnswered=!!r.askAnswered,n.selectedAnswers=r.selectedAnswers||null,r.askAnswered||(n.isHistory=!1))}catch{}return n}let s=n=>{if(!n)return"";if(typeof n!="string")return String(n);if(n.startsWith("["))try{let r=JSON.parse(n);if(Array.isArray(r))return r.filter(i=>i.type==="text"&&i.text).map(i=>i.text).join("")}catch{}return n};if(e.role==="user"){let n=null;if(e.metadata)try{let r=JSON.parse(e.metadata);r&&typeof r.clientMessageId=="string"&&(n=r.clientMessageId)}catch{}return{...t,type:"user",content:typeof e.content=="string"?e.content:String(e.content||""),...n?{clientMessageId:n}:{}}}else if(e.role==="assistant"){let n=s(e.content),r=(()=>{if(!e.content||typeof e.content!="string"||!e.content.startsWith("["))return[];try{let i=JSON.parse(e.content);return Array.isArray(i)?i.filter(o=>o.type==="tool_use"&&o.name):[]}catch{return[]}})();if(!n&&r.length===0)return null;if(r.length>0){let i=[];n&&i.push({...t,type:"assistant",content:n});for(let o=0;o<r.length;o++){let a=r[o];i.push({id:e.id+"_tool_"+o,dbMessageId:e.id,timestamp:e.created_at,type:"tool-use",toolName:a.name,toolInput:a.input||{},hasResult:!0,isHistory:!0,startTime:e.created_at||0})}return i}return{...t,type:"assistant",content:n}}else if(e.role==="tool"||e.message_type==="tool_result")return{...t,type:"tool_result",tool:e.tool_name||"unknown",content:typeof e.content=="string"?e.content:String(e.content||"")};return null}var oh,ch,Fn=F(()=>{Lo();Fs();oh="grp_default";ch=new Set(["TodoWrite","AskUserQuestion"])});function fs(e,t){return e._closedAt?.[t]?Date.now()-e._closedAt[t]<3e4:!1}function Ns(e,t){Ae(e,t),e._processingWatchdogs||(e._processingWatchdogs={});let s=()=>{if(!e.processingConversations[t])return;let r=e.conversations.find(o=>o.id===t);e.sendWsMessage({type:"ping_session",conversationId:t,agentId:r?.agentId});let i=setTimeout(()=>{e.processingConversations[t]&&(e.sessionHealth||(e.sessionHealth={}),e.sessionHealth[t]={status:"agent-offline"})},1e4);e._pongTimeouts||(e._pongTimeouts={}),e._pongTimeouts[t]=i},n=setTimeout(()=>{e.processingConversations[t]&&(s(),e._processingWatchdogs[t]=setInterval(()=>{if(!e.processingConversations[t]){Ae(e,t);return}s()},3e4))},45e3);e._processingWatchdogs[t]=n}function Nr(e,t){e._yeaftWatchdogPauseReasons?.[t]?.size||e.processingConversations[t]&&e._processingWatchdogs?.[t]&&(e._pongTimeouts?.[t]&&(clearTimeout(e._pongTimeouts[t]),delete e._pongTimeouts[t]),e.sessionHealth?.[t]&&delete e.sessionHealth[t],e._yeaftWatchdogConvs?.has(t)?qs(e,t):Ns(e,t))}function Ae(e,t){e._processingWatchdogs?.[t]&&(clearTimeout(e._processingWatchdogs[t]),clearInterval(e._processingWatchdogs[t]),delete e._processingWatchdogs[t]),e._pongTimeouts?.[t]&&(clearTimeout(e._pongTimeouts[t]),delete e._pongTimeouts[t]),e.sessionHealth?.[t]&&delete e.sessionHealth[t],e._autoRefreshed?.[t]&&delete e._autoRefreshed[t],e._yeaftWatchdogConvs?.delete(t),e._yeaftWatchdogPauseReasons&&delete e._yeaftWatchdogPauseReasons[t]}function Nn(e,t,s="phase"){if(!t||!e.processingConversations[t])return;e._yeaftWatchdogPauseReasons||(e._yeaftWatchdogPauseReasons={});let n=e._yeaftWatchdogPauseReasons[t]||new Set;n.add(s),e._yeaftWatchdogPauseReasons[t]=n,e._processingWatchdogs?.[t]&&(clearTimeout(e._processingWatchdogs[t]),clearInterval(e._processingWatchdogs[t]),delete e._processingWatchdogs[t])}function Bs(e,t,s=null){if(!t)return;let n=e._yeaftWatchdogPauseReasons?.[t];n&&(s?n.delete(s):n.clear(),!n.size&&(delete e._yeaftWatchdogPauseReasons[t],e.processingConversations[t]&&qs(e,t)))}function Bc(e,t){Ae(e,t),e._processingWatchdogs||(e._processingWatchdogs={}),e._processingWatchdogs[t]=setTimeout(()=>{if(e.processingConversations[t]){let s=e.conversations.find(n=>n.id===t);e.sendWsMessage({type:"refresh_conversation",conversationId:t,agentId:s?.agentId}),e._processingWatchdogs[t]=setTimeout(()=>{if(e.processingConversations[t]){delete e.processingConversations[t];let n=e.executionStatusMap[t];n&&(n.currentTool=null),e.finishStreamingForConversation(t)}delete e._processingWatchdogs[t]},1e4)}},9e4)}function qs(e,t){let s=e._yeaftWatchdogPauseReasons?.[t];if(Ae(e,t),e._processingWatchdogs||(e._processingWatchdogs={}),s?.size){e._yeaftWatchdogConvs||(e._yeaftWatchdogConvs=new Set),e._yeaftWatchdogPauseReasons||(e._yeaftWatchdogPauseReasons={}),e._yeaftWatchdogConvs.add(t),e._yeaftWatchdogPauseReasons[t]=new Set(s);return}e._yeaftWatchdogConvs||(e._yeaftWatchdogConvs=new Set),e._yeaftWatchdogConvs.add(t),e._processingWatchdogs[t]=setTimeout(()=>{if(e.processingConversations[t]){delete e.processingConversations[t];let n=e.executionStatusMap[t];n&&(n.currentTool=null),e.finishStreamingForConversation(t)}delete e._processingWatchdogs[t]},15e4)}var Gt=F(()=>{});function No(e,t){return t&&Array.isArray(e?._yeaftRetiredConversationIdsByAgent?.[t])?e._yeaftRetiredConversationIdsByAgent[t]:[]}function Ws(e,t,s){return!t||!s?!1:No(e,t).includes(s)}function Bo(e,t){let s=e?._yeaftRetiredConversationTargetsByAgent?.[t];return s&&typeof s=="object"?s:{}}function qc(e,t,s){if(!t||!s)return null;let n=Bo(e,t),r=s,i=new Set;for(let o=0;o<8;o++){if(i.has(r))return null;i.add(r);let a=n[r];if(!a||a===r)return r===s?null:r;r=a}return null}function Bn(e,t,s,n=null){if(!t||!s)return;let r=No(e,t).filter(a=>a!==s).concat(s).slice(-8);e._yeaftRetiredConversationIdsByAgent={...e._yeaftRetiredConversationIdsByAgent||{},[t]:r};let i=Bo(e,t),o={};for(let a of r){let l=i[a];l&&(o[a]=l===s&&n?n:l)}n&&n!==s&&(o[s]=n),e._yeaftRetiredConversationTargetsByAgent={...e._yeaftRetiredConversationTargetsByAgent||{},[t]:o}}function qo(e,t,s){if(!t||!s||!e?._yeaftRetiredConversationIdsByAgent)return;let n=No(e,t).filter(i=>i!==s);e._yeaftRetiredConversationIdsByAgent={...e._yeaftRetiredConversationIdsByAgent,[t]:n};let r={...Bo(e,t)};delete r[s],e._yeaftRetiredConversationTargetsByAgent={...e._yeaftRetiredConversationTargetsByAgent||{},[t]:r}}var Br=F(()=>{});function ph(e,t,s){let n=e.messagesMap?.[t]||[],r=e.messagesMap?.[s]||[];e.messagesMap||(e.messagesMap={}),On(e,t,n),On(e,s,r),e.messagesMap[s]=Ec(r,n).sort((i,o)=>{let a=Number.isFinite(i?.seq)?i.seq:null,l=Number.isFinite(o?.seq)?o.seq:null;return a!==null&&l!==null&&a!==l?a-l:a!==null&&l===null?-1:a===null&&l!==null?1:(i?.timestamp||0)-(o?.timestamp||0)})}function fh(e){if(!e||typeof e!="object")return e;if(typeof structuredClone=="function")try{return structuredClone(e)}catch{}return Array.isArray(e)?e.slice():{...e}}function qr(e,t){return!!e&&Object.prototype.hasOwnProperty.call(e,t)}function js(e,t,s,{removeSource:n}){qr(e,t)&&(qr(e,s)||(e[s]=n?e[t]:fh(e[t])),n&&delete e[t])}function It(e,t,s=null){if(!t)return null;let n=e?._yeaftPendingConversationPromotions?.[t]||null;return!n?.sourceConversationId||!n.targetConversationId||s&&n.targetConversationId!==s?null:n}function Wr(e,t,s,n){return!t||!s||!n||s===n?!1:(e._yeaftPendingConversationPromotions={...e._yeaftPendingConversationPromotions||{},[t]:{sourceConversationId:s,targetConversationId:n}},!0)}function qn(e,t,s=null){let n=It(e,t,s);if(!n)return null;let r={...e._yeaftPendingConversationPromotions||{}};return delete r[t],e._yeaftPendingConversationPromotions=r,n}function Wn(e,t,s){let n=It(e,t);return!n||!s||n.targetConversationId===s?null:(Ct(e,n.targetConversationId,s,{removeSource:!0}),Bn(e,t,n.targetConversationId,s),Wr(e,t,n.sourceConversationId,s),n)}function Ct(e,t,s,{removeSource:n=!0}={}){if(!t||!s||t===s)return!1;ph(e,t,s),e.yeaftHistoryCacheState&&(e.yeaftHistoryCacheState=Object.fromEntries(Object.entries(e.yeaftHistoryCacheState).map(([c,d])=>[c,d?.conversationId===t?{...d,conversationId:s}:d]))),js(e.processingConversations,t,s,{removeSource:n}),js(e.executionStatusMap,t,s,{removeSource:n}),js(e.refreshingSessionMap,t,s,{removeSource:n}),js(e._closedAt,t,s,{removeSource:n}),js(e._autoRefreshed,t,s,{removeSource:n}),js(e.sessionHealth,t,s,{removeSource:n}),e._turnCompletedConvs?.has(t)&&(e._turnCompletedConvs.add(s),n&&e._turnCompletedConvs.delete(t));let r=!!e._yeaftWatchdogConvs?.has(t),i=e._yeaftWatchdogPauseReasons?.[t],o=!!i?.size,a=!!e._processingWatchdogs?.[t];if(o&&(e._yeaftWatchdogPauseReasons||(e._yeaftWatchdogPauseReasons={}),e._yeaftWatchdogPauseReasons[s]=new Set(i)),n&&(a||o)&&Ae(e,t),n&&e._pongTimeouts?.[t]&&(clearTimeout(e._pongTimeouts[t]),delete e._pongTimeouts[t]),n&&(a||r||o)&&!!e.processingConversations?.[s])if(e._processingWatchdogs?.[s])e._yeaftWatchdogConvs?.add(s);else{let c=qr(e.sessionHealth,s),d=e.sessionHealth?.[s],u=qr(e._autoRefreshed,s),f=e._autoRefreshed?.[s];qs(e,s),c&&(e.sessionHealth||(e.sessionHealth={}),e.sessionHealth[s]=d),u&&(e._autoRefreshed||(e._autoRefreshed={}),e._autoRefreshed[s]=f)}return n&&e.messagesMap&&delete e.messagesMap[t],!0}var Wo=F(()=>{Fn();Br();Gt()});function jr(e,t){return!e||!t||e.type!=="user"||t.type!=="user"?!1:e.clientMessageId&&t.clientMessageId?e.clientMessageId===t.clientMessageId:e.clientMessageId||t.clientMessageId?!1:e.content===t.content}var jo=F(()=>{});function Uo(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function gh(){return Date.now()}function mh(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`pt_${crypto.randomUUID()}`:`pt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`}function hh(e,t=160){return typeof e!="string"?e:e.length>t?`${e.slice(0,t)}...[truncated]`:e}function vh(e){if(!e||typeof e!="object")return e||null;let t={};for(let[s,n]of Object.entries(e))s==="text"||s==="prompt"||s==="content"||s==="data"||(t[s]=typeof n=="string"?hh(n):n);return t}function gs(){return mh()}function Ge(e,t={}){!e||!t.traceId||(Array.isArray(e._perfTraceQueue)||(e._perfTraceQueue=[]),e._perfTraceQueue.push({traceId:t.traceId,source:"web",phase:t.phase||"unknown",at:gh(),monotonicMs:Uo(),durationMs:Number.isFinite(t.durationMs)?t.durationMs:null,agentId:t.agentId||null,sessionId:t.sessionId||null,vpId:t.vpId||null,turnId:t.turnId||null,threadId:t.threadId||null,messageType:t.messageType||null,bytes:Number.isFinite(t.bytes)?t.bytes:null,ok:typeof t.ok=="boolean"?t.ok:null,detail:vh(t.detail)}),e._perfTraceQueue.length>200&&e._perfTraceQueue.splice(0,e._perfTraceQueue.length-200),yh(e))}function yh(e){!e||e._perfTraceFlushTimer||(e._perfTraceFlushTimer=setTimeout(()=>bh(e),250))}function bh(e){if(!e||!Array.isArray(e._perfTraceQueue)||e._perfTraceQueue.length===0){e&&(e._perfTraceFlushTimer=null);return}let t=e._perfTraceQueue.splice(0,e._perfTraceQueue.length);e._perfTraceFlushTimer=null,typeof e.sendWsMessage=="function"&&e.sendWsMessage({type:"perf_trace_events",events:t})}function Ur(e,t={}){if(typeof requestAnimationFrame!="function")return;let s=Uo();requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ge(e,{...t,phase:t.phase||"render.next_paint",durationMs:Uo()-s})})})}var Ko=F(()=>{});function zo(e){return typeof e=="string"&&e?e:null}function Us(e,t){return e?.yeaftSessionHistoryState?.[t]||null}function ms(e){let t=e?.yeaftActiveSessionFilter||null;if(!t)try{t=(typeof window<"u"&&window.Pinia?.useSessionsStore?.())?.activeSessionId||null}catch{}if(!t)return{agentId:e?.currentAgent||null,sessionId:null,sessionKey:""};let s=(()=>{try{let n=typeof window<"u"&&window.Pinia?.useSessionsStore?.(),r=n?.activeSessionKey?n.sessions?.[n.activeSessionKey]:null;if(r?.id===t&&r.agentId)return r.agentId}catch{}return typeof e?.resolveYeaftSessionAgentId=="function"?e.resolveYeaftSessionAgentId(t):e?.currentAgent||null})();return{agentId:s,sessionId:t,sessionKey:ke(s,t)}}function jc(e,{agentId:t,sessionId:s,mode:n="recent",preserveLoaded:r=!1,latestSeq:i=null}={}){if(!t||!s)return null;let o=ke(t,s),a=Us(e,o)||{},l=Number(a.generation||0)+1,c=`yeaft_history_${l}_${crypto.randomUUID()}`,d={...a,loaded:!!a.loaded,loading:!0,error:null,requestId:c,generation:l,mode:n,requestedAt:Date.now(),latestSeq:Number.isFinite(i)?i:a.latestSeq??null};return delete d.completionSeen,r||(d.syncingAfterSeq=null,a.loaded||(d.hasMore=!1,d.oldestSeq=null,d.serverOldestFetchedSeq=null,d.serverHasMore=!1,d.gapQueue=[],d.requestedBeforeSeqs=[],d.count=0)),e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState||{},[o]:d},jn(e),{sessionKey:o,requestId:c,generation:l,state:d}}function Yo(e,t={}){let s=t.sessionId??t.groupId??null;if(!s)return!1;let n=t.agentId||e?.yeaftSessionAgentById?.[s]||null,r=ke(n,s),i=Us(e,r),o=zo(t.requestId);if(!i)return o===null;let a=zo(i.requestId);return o?o===a:a===null}function Uc(e,t={},s={},n="chunk"){if(!Yo(e,t))return null;let r=t.sessionId??t.groupId??null,i=t.agentId||e?.yeaftSessionAgentById?.[r]||null,o=ke(i,r),a=Us(e,o)||{},l=zo(t.requestId),c=l!==null&&n==="completion",d={...a,...c?{}:s,...c?{completionSeen:!0}:{},error:null};return c?(d.loading=!0,d.requestId=l):(d.loading=!1,d.requestId=null,d.completedAt=Date.now(),delete d.completionSeen),e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState||{},[o]:d},jn(e),d}function Go(e,{agentId:t,sessionId:s,requestId:n,error:r="history_load_failed"}={}){if(!t||!s||!n)return!1;let i=ke(t,s),o=Us(e,i);return!o||o.requestId!==n||!o.loading?!1:(e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState||{},[i]:{...o,loading:!1,error:r,requestId:null,completedAt:Date.now()}},jn(e),!0)}function jn(e){let{sessionKey:t}=ms(e),s=t?Us(e,t):null;return e.yeaftLoadingMoreHistory=!!s?.loading,e.yeaftHistoryLoadError=s?.error||null,e.yeaftHasMoreHistory=!!s?.hasMore,e.yeaftOldestLoadedSeq=Number.isFinite(s?.serverOldestFetchedSeq)?s.serverOldestFetchedSeq:Number.isFinite(s?.oldestSeq)?s.oldestSeq:null,s}function Qo(e){let{sessionKey:t}=ms(e);return t?Us(e,t):null}var Wc,Xo=F(()=>{Fs();Wc=15e3});function Zo(e){return e?.sessionId??e?.groupId??null}function Kc(e){for(let t of[e?.persistedMessageId,e?.messageId,e?.id]){if(typeof t!="string")continue;let s=t.match(/^(m\d+)/);if(s)return s[1]}return null}function Kr(e){return e?.isStreaming||e?.status==="pending"?!1:Number.isFinite(e?.seq)||!!Kc(e)||e?.isHistory===!0&&!e?.clientMessageId}function ea(e){if(Number.isFinite(e?.seq))return Number(e.seq);let s=Kc(e)?.match(/^m(\d+)$/);if(s)return Number(s[1]);let n=typeof e?.id=="string"?e.id.match(/^(\d+)/):null;return n?Number(n[1]):null}function zc(e){try{return new TextEncoder().encode(JSON.stringify(e)).length}catch{return 0}}function Jo(e){if(e?.historyEntryId)return`entry:${e.historyEntryId}`;let t=ea(e);return Number.isFinite(t)?`seq:${t}`:e?.stableKey||e?.uiKey||e?.id||e?.messageId||"legacy"}function kh(e){let t=new Map;for(let s of e){if(!Kr(s))continue;let n=Jo(s),r=t.get(n)||{key:n,rows:[],seq:ea(s),bytes:0,touchedAt:0};r.rows.push(s),r.bytes+=zc(s),r.touchedAt=Math.max(r.touchedAt,Number(s?._historyCacheTouchedAt)||0),t.set(n,r)}return Array.from(t.values())}function Sh(e,t,s=new Set){let n=e.slice().sort((u,f)=>(f.seq||-1)-(u.seq||-1)),r=new Set,i=0,o=0;for(let u of e)s.has(u.key)&&(r.add(u.key),i+=u.rows.length,o+=u.bytes);for(let u of n){if(r.has(u.key))continue;if(i>=t.recentRowsFloor)break;let f=i+u.rows.length,p=o+u.bytes;if(r.size>0&&(f>t.maxRowsPerSession||p>t.maxBytesPerSession))break;r.add(u.key),i=f,o=p}let a=e.slice().sort((u,f)=>f.touchedAt-u.touchedAt||(f.seq||-1)-(u.seq||-1)),l=new Set(r),c=e.filter(u=>r.has(u.key)).reduce((u,f)=>u+f.rows.length,0),d=e.filter(u=>r.has(u.key)).reduce((u,f)=>u+f.bytes,0);for(let u of a){if(l.has(u.key))continue;let f=c+u.rows.length,p=d+u.bytes;l.size>0&&(f>t.maxRowsPerSession||p>t.maxBytesPerSession)||(l.add(u.key),c=f,d=p)}return l}function Ih(e){let t=Array.from(new Set(e.map(ea).filter(Number.isFinite))).sort((n,r)=>n-r),s=[];for(let n of t){let r=s.at(-1);r&&n<=r.endSeq+1?r.endSeq=n:s.push({startSeq:n,endSeq:n})}return s}function Ch(e){let t=e.filter(Kr);return{rowCount:t.length,byteCount:t.reduce((s,n)=>s+zc(n),0),ranges:Ih(t)}}function Ah(e,t,s){let n=new Set((t||[]).map(r=>r?.stableKey).filter(Boolean));if(n.size!==0)for(let r of e)r?.stableKey&&n.has(r.stableKey)&&(r._historyCacheTouchedAt=s)}function xh(e,{conversationId:t,agentId:s,sessionId:n,incomingRows:r,now:i,limits:o}){let a=e.messagesMap?.[t]||[],l=a.filter(S=>Zo(S)===n);Ah(l,r,i);let c=new Set((r||[]).filter(S=>S?.historyEntryId).map(Jo)),d=kh(l),u=Sh(d,o,c),f=l.filter(S=>!Kr(S)||u.has(Jo(S))),p=new Set(f);e.messagesMap[t]=a.filter(S=>Zo(S)!==n||p.has(S));let g=Ch(f),m=ke(s,n),b=e.yeaftHistoryCacheState?.[m]||null,y=JSON.stringify(b?.ranges||[])===JSON.stringify(g.ranges)?Number(b?.rangeEpoch)||0:(Number(b?.rangeEpoch)||0)+1;e.yeaftHistoryCacheState={...e.yeaftHistoryCacheState||{},[m]:{agentId:s,sessionId:n,conversationId:t,lastAccessed:i,rangeEpoch:y,...g}}}function Th(e,t){let s=e.messagesMap?.[t.conversationId]||[];e.messagesMap[t.conversationId]=s.filter(n=>Zo(n)!==t.sessionId||!Kr(n))}function Mh(e,t,s){let n={...e.yeaftHistoryCacheState||{}},r=Object.entries(n).filter(([,a])=>a?.rowCount>0),i=()=>Object.values(n).reduce((a,l)=>({rows:a.rows+(Number(l?.rowCount)||0),bytes:a.bytes+(Number(l?.byteCount)||0),sessions:a.sessions+((Number(l?.rowCount)||0)>0?1:0)}),{rows:0,bytes:0,sessions:0}),o=r.filter(([a])=>a!==t).sort((a,l)=>(Number(a[1]?.lastAccessed)||0)-(Number(l[1]?.lastAccessed)||0));for(let[a,l]of o){let c=i();if(c.sessions<=s.maxSessions&&c.rows<=s.maxRowsTotal&&c.bytes<=s.maxBytesTotal)break;Th(e,l),n[a]={...l,rowCount:0,byteCount:0,ranges:[]}}e.yeaftHistoryCacheState=n}function Yc(e,t,s,n=Date.now()){if(!t||!s)return;let r=ke(t,s),i=e.yeaftHistoryCacheState?.[r];i&&(e.yeaftHistoryCacheState={...e.yeaftHistoryCacheState||{},[r]:{...i,lastAccessed:n}})}function ta(e,{conversationId:t,agentId:s,sessionId:n,incomingRows:r=[],activeAgentId:i=null,activeSessionId:o=null,now:a=Date.now(),limits:l=wh}={}){if(!e||!t||!s||!n)return;xh(e,{conversationId:t,agentId:s,sessionId:n,incomingRows:r,now:a,limits:l});let c=i&&o?ke(i,o):null;Mh(e,c,l)}var wh,sa=F(()=>{Fs();wh=Object.freeze({maxSessions:8,maxRowsPerSession:600,maxBytesPerSession:4*1024*1024,maxRowsTotal:2400,maxBytesTotal:16*1024*1024,recentRowsFloor:100})});function At(e){return Number.isFinite(e)?Number(e):null}function Ph(e){return(Array.isArray(e)?e:[]).map(t=>({startSeq:At(t?.startSeq),endSeq:At(t?.endSeq)})).filter(t=>t.startSeq!==null&&t.endSeq!==null&&t.startSeq<=t.endSeq).sort((t,s)=>t.startSeq-s.startSeq)}function Un(e){return Number.isFinite(e)&&e>=0?Math.floor(e):0}function hs(e){let t=At(e?.beforeSeq);if(t===null)return null;if(e?.kind==="gap"){let s=At(e.stopAtSeq);return s===null?null:`gap:${Un(e.cacheEpoch)}:${s}:${t}`}return`server:${t}`}function Kn(e){let t=new Set((Array.isArray(e?.completedHistoryWorkKeys)?e.completedHistoryWorkKeys:[]).filter(s=>typeof s=="string"&&s));for(let s of Array.isArray(e?.requestedBeforeSeqs)?e.requestedBeforeSeqs:[])Number.isFinite(s)&&t.add(`server:${s}`);return t}function Rh(e,t){let s=hs(t);if(!s)return e.completedHistoryWorkKeys||[];let n=Kn(e);return n.add(s),Array.from(n).slice(-256)}function _h(e,t){if(!Number.isFinite(t))return e.requestedBeforeSeqs||[];let s=new Set((Array.isArray(e?.requestedBeforeSeqs)?e.requestedBeforeSeqs:[]).filter(Number.isFinite));return s.add(t),Array.from(s).sort((n,r)=>r-n).slice(-256)}function Eh(e,t={},s=0){let n=Ph(e),r=Un(s),i=Kn(t),o=[];for(let a=1;a<n.length;a+=1){let l=n[a-1],c=n[a];if(l.endSeq+1>=c.startSeq)continue;let d={kind:"gap",beforeSeq:c.startSeq,stopAtSeq:l.endSeq+1,cacheEpoch:r};d.workKey=hs(d),i.has(d.workKey)||o.push(d)}return o.sort((a,l)=>l.beforeSeq-a.beforeSeq)}function Gc(e,t,s){let n=Eh(e,t,s),r=At(t.serverOldestFetchedSeq??t.oldestSeq),i=n[0]||null;if(!i||r===null||i.beforeSeq<=r)return[];let o={kind:"gap",beforeSeq:i.beforeSeq,stopAtSeq:r,cacheEpoch:i.cacheEpoch};return o.workKey=hs(o),Kn(t).has(o.workKey)?[]:[o]}function Qc(e={},t=[],s=0){let n=Un(s),r=Kn(e),i=e.serverHasMore!==!1,o=At(e.serverOldestFetchedSeq??e.oldestSeq),a=e.gapTraversalInitialized===!0,l=Array.isArray(e.gapQueue)?e.gapQueue.slice():[],c=null,d=null;if(i&&o!==null){let u={kind:"server",beforeSeq:o,stopAtSeq:null,cacheEpoch:n};u.workKey=hs(u),r.has(u.workKey)?(i=!1,d="history_cursor_repeated"):c=u}return!c&&!i&&(a||(l=Gc(t,e,n),a=!0),c=l[0]||null),c?{request:c,state:{...e,serverHasMore:i,gapTraversalInitialized:a,gapQueue:l,pendingPageKind:c.kind,pendingPageBeforeSeq:c.beforeSeq,pendingGapStopAtSeq:c.stopAtSeq,pendingCacheEpoch:c.cacheEpoch,pendingHistoryWorkKey:c.workKey,hasMore:!0,paginationError:null}}:{request:null,state:{...e,serverHasMore:i,gapTraversalInitialized:a,gapQueue:l,hasMore:!1,paginationError:d}}}function Xc(e={},{mode:t,oldestSeq:s,hasMore:n,ranges:r=[],pageKind:i=null,stopAtSeq:o=null,cacheEpoch:a=0}={}){if(t==="delta")return e;let l=Un(a),c=At(s),d=At(e.pendingPageBeforeSeq),u=i||e.pendingPageKind||(t==="older"?"server":null),f=At(o??e.pendingGapStopAtSeq),p=Un(e.pendingCacheEpoch??l),g={kind:u,beforeSeq:d,stopAtSeq:f,cacheEpoch:p},m=At(e.serverOldestFetchedSeq??e.oldestSeq),b=e.serverHasMore!==!1,I=Number(e.noProgressCount)||0,y=null,S=e.requestedBeforeSeqs||[],w=e.completedHistoryWorkKeys||[],v=e.gapTraversalInitialized===!0,h=Array.isArray(e.gapQueue)?e.gapQueue.slice():[];if(t==="recent")m=c,b=!!n,I=0,S=[],w=[],v=!1,h=[];else if(d===null)c!==null&&(m=m===null?c:Math.min(m,c)),b=!!n,I=0;else{S=_h(e,d),w=Rh(e,g);let x=c!==null&&c<d;if(u==="server")x?(m=m===null?c:Math.min(m,c),b=!!n,I=0):(b=!1,I+=1,y="history_cursor_no_progress");else if(u==="gap"){let E=hs(g);h=h.filter(L=>hs(L)!==E);let V=f!==null&&c!==null&&c<=f;if(x||V||n===!1){if(I=0,!V&&n!==!1&&c!==null&&f!==null){let L={kind:"gap",beforeSeq:c,stopAtSeq:f,cacheEpoch:p};L.workKey=hs(L),Kn({completedHistoryWorkKeys:w}).has(L.workKey)||h.unshift(L)}}else I+=1,y="history_cursor_no_progress"}}t==="older"&&!b&&!v&&(h=Gc(r,{...e,serverOldestFetchedSeq:m,completedHistoryWorkKeys:w},l),v=!0);let M={...e,serverOldestFetchedSeq:m,serverHasMore:b,requestedBeforeSeqs:S,completedHistoryWorkKeys:w,gapTraversalInitialized:v,gapQueue:h,noProgressCount:I,oldestSeq:m,paginationError:y};return delete M.pendingPageKind,delete M.pendingPageBeforeSeq,delete M.pendingGapStopAtSeq,delete M.pendingCacheEpoch,delete M.pendingHistoryWorkKey,{...M,hasMore:b||h.length>0}}var na=F(()=>{});function td(e){return e.filter(t=>!(t.type==="user"&&(!t.content||!t.content.trim())))}function vs(e){let t=typeof e=="string"?e.match(/^m(\d+)$/):null,s=t?Number(t[1]):null;return Number.isFinite(s)?s:null}function Zc(e){let t=[e?.timestamp,e?.createdAt,e?.ts,e?.time,e?.created_at];for(let s of t){if(typeof s=="number"&&Number.isFinite(s)&&s>0)return s;if(typeof s=="string"&&s.trim()){let n=Date.parse(s);if(Number.isFinite(n))return n;let r=Number(s);if(Number.isFinite(r)&&r>0)return r}}return null}function Dh(e){if(!Array.isArray(e))return null;for(let t=e.length-1;t>=0;t-=1){let s=e[t];if(s?.name==="TodoWrite"&&Array.isArray(s?.input?.todos))return s.input.todos}return null}function Lh(e){return Array.isArray(e?.toolCalls)?e.toolCalls.filter(t=>t?.name!=="TodoWrite").length:Number(e?.toolSummaryCount||0)||0}function $h(e){if(!e||typeof window>"u")return null;try{let t=window.Pinia||null,s=t&&typeof t.useSessionsStore=="function"?t.useSessionsStore():null;if(!s)return null;let n=typeof t.useChatStore=="function"?t.useChatStore():null,r=typeof s.sessionById=="function"?s.sessionById(e,n?.currentAgent||null):s.sessions&&s.sessions[e];return(r&&typeof r.defaultVpId=="string"?r.defaultVpId.trim():"")||null}catch{return null}}function Vh(e,t){return e.speakerVpId||e.vpId||e.vp_id||e.authorVpId||e.authorVP||$h(t)}function zr(e){return e?.stableKey||(e&&(e.messageId||e.id)?e.messageId||e.id:null)}function Hh(e,t=null){if(!e||e.stableKey)return e;let s=zn(e),n=e.messageId||e.id||null,r=e.type==="user"&&e.clientMessageId||null;return e.stableKey=r&&n===r?Yt(t,s,r):Vn(t,s,n),Number.isFinite(e.seq)||(e.seq=vs(n)),e.uiKey||(e.uiKey=e.stableKey||null),e}function Oh(e){e.sort((t,s)=>{let n=Number.isFinite(t?.seq)?t.seq:null,r=Number.isFinite(s?.seq)?s.seq:null;return n!==null&&r!==null&&n!==r?n-r:n!==null&&r===null?-1:n===null&&r!==null?1:(t?.timestamp||0)-(s?.timestamp||0)})}function Fh(e,t){if(!e||!t||e.type!=="assistant"||t.type!=="assistant"||(e.sessionId??null)!==(t.sessionId??null))return!1;let s=e.speakerVpId||e.vpId||"",n=t.speakerVpId||t.vpId||"";if(s&&n&&s!==n)return!1;let r=e.threadId||"",i=t.threadId||"";if(r&&i&&r!==i||!(e.isStreaming||e.isHistory!==!0)||t._hasPersistedTurnId!==!0)return!1;let a=e.turnId||"",l=t.turnId||"";if(!a||!l||a!==l)return!1;let c=typeof e.content=="string"?e.content:"",d=typeof t.content=="string"?t.content:"";return!!c&&!!d&&(d.startsWith(c)||c.startsWith(d))}function ra(e,t){let s=new Map,n=new Map;e.forEach((i,o)=>{let a=zr(i);a&&s.set(a,o),i?.type==="user"&&i.clientMessageId&&n.set(i.clientMessageId,o)});let r=0;for(let i of t){let o=zr(i),a=o&&s.has(o)?s.get(o):null;if(a===null&&i?.type==="user"&&i.clientMessageId&&n.has(i.clientMessageId)&&(a=n.get(i.clientMessageId)),a===null&&i?.type==="assistant"&&(a=e.findIndex(l=>Fh(l,i))),a!==null&&a>=0){let l=zr(e[a]),c=e[a]?.uiKey||null;e[a]={...e[a],...i,...c?{uiKey:c}:{}},o&&s.set(o,a),l&&l!==o&&s.get(l)===a&&s.delete(l),i?.type==="user"&&i.clientMessageId&&n.set(i.clientMessageId,a)}else o&&s.set(o,e.length),i?.type==="user"&&i.clientMessageId&&n.set(i.clientMessageId,e.length),e.push(i),r+=1}return Oh(e),r}function zn(e){return e?e.sessionId??e.groupId??null:null}function Nh(e){return!e||e.type!=="user"||!e.clientMessageId?!1:(e.messageId||e.id||null)===e.clientMessageId}function Bh(e,t,s){let n=e.some(o=>o&&(s==null||zn(o)===s));if(t.length===0&&n)return{insertedRows:0,preservedEmpty:!0};let r=t.reduce((o,a)=>Math.max(o,a?.timestamp||0),0),i=e.filter(o=>o?s!=null&&zn(o)!==s||o.isStreaming||o.type==="tool-use"&&o.toolName==="AskUserQuestion"&&(o.askAnswered||o.askPending||o.askExpired)||Nh(o)?!0:r>0&&(o.timestamp||0)>r:!1);return e.splice(0,e.length,...i),ra(e,t),{insertedRows:t.length,preservedEmpty:!1}}function qh(e){if(typeof e!="string")return!1;let t=e.trimStart();return t.startsWith("<task-result ")||/^\[system note\] You have called \S+ with the same arguments \d+ times\./.test(t)}function Wh(e,t){let s=typeof e.yeaftConversationId=="string"?e.yeaftConversationId:"";return s.startsWith(`yeaft-local-${t}-`)||/^yeaft-local-\d/.test(s)?s:null}function jh(e,t,s,n){let r=t.agentId||s&&e.yeaftSessionAgentById?.[s]||null;if(!r||!n||e.currentView!=="yeaft")return;let i=ms(e);if(i.sessionId!==(s||null)||i.agentId&&i.agentId!==r)return;let o=e.yeaftConversationId||null;if(Ws(e,r,n)){let d=e.yeaftConversationIdsByAgent?.[r]||null;d&&d!==n&&Ct(e,n,d,{removeSource:n!==e.yeaftConversationId});return}let a=It(e,r);a&&a.targetConversationId!==n&&Wn(e,r,n);let l=It(e,r,n);if(l&&(Ct(e,l.sourceConversationId,n,{removeSource:!0}),qn(e,r,n),e.yeaftConversationId=n),o===n||l){e.messagesMap[n]||(e.messagesMap[n]=[]),e.yeaftConversationIdsByAgent={...e.yeaftConversationIdsByAgent||{},[r]:n},e.activeConversations=[n];return}let c=Wh(e,r);c&&(Ct(e,c,n,{removeSource:!0}),e.yeaftConversationIdsByAgent={...e.yeaftConversationIdsByAgent||{},[r]:n},e.yeaftConversationId=n,e.activeConversations=[n])}function Qt(e,t){let s=e.messagesMap[t]||[];for(let n of s)n.type==="tool-use"&&!n.hasResult&&(n.hasResult=!0,n.toolName==="AskUserQuestion"&&!n.askAnswered&&!n.selectedAnswers&&(n.isHistory=!0,n.askRequestId=null))}function sd(e,t){St(e);let s=e.agents.find(r=>r.id===t.agentId);e.conversations=e.conversations.filter(r=>r.id!==t.conversationId);let n=t.provider||"claude-code";if(e.conversations.push({id:t.conversationId,agentId:t.agentId,agentName:s?.name||t.agentId,workDir:t.workDir,claudeSessionId:null,createdAt:Date.now(),processing:!1,connecting:n!=="claude-code",type:"chat",provider:n,capabilities:t.capabilities||null,disallowedTools:t.disallowedTools??null}),e.currentAgent=t.agentId,e.currentAgentInfo=s,e.panels.length>1){let r=e._pendingPaneId;if(e._pendingPaneId=null,r){let i=e.panels.find(o=>o.id===r);i&&(i.conversationId=t.conversationId)}else{let i=e.panels.find(o=>!o.conversationId);i&&(i.conversationId=t.conversationId)}e.activeConversations.includes(t.conversationId)||e.activeConversations.push(t.conversationId)}else e.activeConversations=[t.conversationId];e.currentWorkDir=t.workDir,e.messagesMap[t.conversationId]=[],e.sendWsMessage({type:"select_conversation",conversationId:t.conversationId}),e.addMessage({type:"system",content:Le("store.convCreated",{agent:s?.name||t.agentId,workDir:t.workDir})}),e.saveOpenSessions()}function nd(e,t){St(e);let s=e.agents.find(n=>n.id===t.agentId);if(e.conversations=e.conversations.filter(n=>n.id!==t.conversationId&&!(n.claudeSessionId&&n.claudeSessionId===t.claudeSessionId)),e.conversations.push({id:t.conversationId,agentId:t.agentId,agentName:s?.name||t.agentId,workDir:t.workDir,claudeSessionId:t.claudeSessionId,createdAt:Date.now(),processing:!1,connecting:(t.provider||"claude-code")!=="claude-code",type:"chat",provider:t.provider||"claude-code",capabilities:t.capabilities||null,disallowedTools:t.disallowedTools??null}),e.currentAgent=t.agentId,e.currentAgentInfo=s,e.panels.length>1){let n=e._pendingPaneId;if(e._pendingPaneId=null,n){let r=e.panels.find(i=>i.id===n);r&&(r.conversationId=t.conversationId)}else{let r=e.panels.find(i=>!i.conversationId);r&&(r.conversationId=t.conversationId)}e.activeConversations.includes(t.conversationId)||e.activeConversations.push(t.conversationId)}else e.activeConversations=[t.conversationId];if(e.currentWorkDir=t.workDir,e.messagesMap[t.conversationId]=[],e._pendingSessionTitle&&(e.conversationTitles[t.conversationId]=e._pendingSessionTitle,e._pendingSessionTitle=null),e.sendWsMessage({type:"select_conversation",conversationId:t.conversationId}),e.addMessage({type:"system",content:Le("store.convResumed",{agent:s?.name||t.agentId,sessionId:t.claudeSessionId?t.claudeSessionId.slice(0,8)+"...":""})}),t.dbMessages&&t.dbMessages.length>0){let n=td(t.dbMessages.map(o=>e.formatDbMessageForHistoryHydration(o)).flat().filter(Boolean)),r=Do(n),i=e.messagesMap[t.conversationId]||[];for(let o of r)i.push(o)}e.hasMoreMessages=!!t.hasMoreMessages,e.chatSessionState[t.conversationId]={lastSeenDbId:ps(e.messagesMap[t.conversationId]),hasMoreOlder:!!t.hasMoreMessages},e.saveOpenSessions()}function ia(e,t){e.conversations=e.conversations.filter(n=>n.id!==t.conversationId),delete e.messagesMap[t.conversationId],delete e.chatSessionState[t.conversationId],delete e.conversationTitles[t.conversationId],delete e.customConversationTitles[t.conversationId],delete e.processingConversations[t.conversationId],e._closedAt&&delete e._closedAt[t.conversationId],Ae(e,t.conversationId),delete e.executionStatusMap[t.conversationId],delete e.subagents[t.conversationId],window.dispatchEvent(new CustomEvent("conversation-deleted",{detail:{conversationId:t.conversationId}}));let s=e.activeConversations.indexOf(t.conversationId);s>=0&&(e.activeConversations.splice(s,1),e.activeConversations.length===0&&e.addMessage({type:"system",content:Le("chat.session.closed")}));for(let n of e.panels)n.conversationId===t.conversationId&&(n.conversationId=null);e.saveOpenSessions()}function rd(e,t){let s=t.conversationId;if(s){delete e.processingConversations[s],Ae(e,s),e._closedAt||(e._closedAt={}),e._closedAt[s]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(s);let n=e.executionStatusMap[s];n&&(n.currentTool=null),e.finishStreamingForConversation(s),Qt(e,s);let r=e.conversations.find(i=>i.id===s);r&&(t.claudeSessionId&&(r.claudeSessionId=t.claudeSessionId),t.workDir&&(r.workDir=t.workDir)),e.clearStatus?.conversationId===s&&e.clearStatus?.status==="clearing"&&(e.clearStatus={conversationId:s,status:"completed"},setTimeout(()=>{e.clearStatus?.conversationId===s&&e.clearStatus?.status==="completed"&&(e.clearStatus=null)},3e3)),e.saveOpenSessions()}}function id(e,t){let s=t.conversationId;if(s){delete e.processingConversations[s],Ae(e,s),e._closedAt||(e._closedAt={}),e._closedAt[s]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(s);let n=e.executionStatusMap[s];n&&(n.currentTool=null),e.finishStreamingForConversation(s),Qt(e,s);let r=e.conversations.find(i=>i.id===s);r&&(t.claudeSessionId&&(r.claudeSessionId=t.claudeSessionId),t.workDir&&(r.workDir=t.workDir)),e.saveOpenSessions()}}function od(e,t){if(t.conversationId){if(t.isProcessing&&!fs(e,t.conversationId)&&!e._turnCompletedConvs?.has(t.conversationId))e.processingConversations[t.conversationId]=!0;else if(e.processingConversations[t.conversationId]){delete e.processingConversations[t.conversationId],Ae(e,t.conversationId);let s=e.executionStatusMap[t.conversationId];s&&(s.currentTool=null),e.finishStreamingForConversation(t.conversationId)}}}function ad(e,t){let s=t.conversationId||e.currentConversation;if(s){delete e.processingConversations[s],Ae(e,s),e._closedAt||(e._closedAt={}),e._closedAt[s]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(s);let n=e.executionStatusMap[s];n&&(n.currentTool=null),e.finishStreamingForConversation(s),Qt(e,s)}}function ld(e,t){if(!!t.requestId){if(e.chatHistoryRequestIdSupported=!0,!e.isCurrentChatHistoryResponse?.(t))return!1}else{let i=`chat:${t.conversationId}`,o=e.chatHistoryRequests?.[i];if(e.chatHistoryRequestIdSupported===!0||!o?.loading)return!1;t={...t,requestId:o.requestId,catalogKey:i,mode:o.mode||t.mode,...o.mode==="delta"?{afterMessageId:o.cursor}:{}}}e.messagesMap[t.conversationId]||(e.messagesMap[t.conversationId]=[]);let n=e.messagesMap[t.conversationId],r=t.mode==="delta"||typeof t.afterMessageId=="number"&&t.afterMessageId>0;if(t.conversationId&&e.activeConversations.includes(t.conversationId)){let i=Do(td((t.messages||[]).map(a=>e.formatDbMessageForHistoryHydration(a)).flat().filter(Boolean)));if(i.length>0){let a=n.find(l=>l.dbMessageId);if(a&&i[0].dbMessageId&&i[i.length-1].dbMessageId<a.dbMessageId){let l=n.indexOf(a);e.debug,n.splice(l,0,...i)}else{e.debug;for(let l of i)if(!(l.dbMessageId&&n.some(c=>c.dbMessageId===l.dbMessageId))){if(l.dbMessageId&&(l.type==="assistant"||l.type==="user")){let c=null;if(l.type==="user"?c=n.find(d=>!d.dbMessageId&&!d.isStreaming&&jr(d,l)):c=n.find(d=>!d.dbMessageId&&!d.isStreaming&&d.type==="assistant"&&d.content===l.content),c){c.dbMessageId=l.dbMessageId,c.id=l.id,l.timestamp&&(c.timestamp=l.timestamp),l.clientMessageId&&!c.clientMessageId&&(c.clientMessageId=l.clientMessageId);continue}}n.push(l)}}}r||(e.hasMoreMessages=t.hasMore??!1),St(e);let o=e.chatSessionState[t.conversationId]?.hasMoreOlder;e.chatSessionState[t.conversationId]={lastSeenDbId:ps(e.messagesMap[t.conversationId]),hasMoreOlder:r?!!o:!!t.hasMore}}return e.finishChatHistoryRequest?.(t)&&(e.currentConversation===t.conversationId&&(e.loadingMoreMessages=!1),e.setRefreshingSession(t.conversationId,!1)),!0}function cd(e,t){let s=t.sessionId??null,n=t.agentId||s&&e.yeaftSessionAgentById?.[s]||null,r=t.conversationId||n&&e.yeaftConversationIdsByAgent?.[n]||e.yeaftConversationId;if(!r||!s||!Array.isArray(t.messages))return null;e.messagesMap[r]||(e.messagesMap[r]=[]);let i=new Set(Array.isArray(t.sourceMessageIds)?t.sourceMessageIds:[]);for(let c of e.messagesMap[r]){let d=c?.persistedMessageId||c?.messageId||c?.id||null;!t.entryId||!i.has(d)||(c.historyEntryId=t.entryId,Number.isFinite(t.indexGeneration)&&(c.historyIndexGeneration=t.indexGeneration))}let o=t.messages.map(c=>t.entryId&&i.has(c?.id)?{...c,historyEntryId:t.entryId,...Number.isFinite(t.indexGeneration)?{historyIndexGeneration:t.indexGeneration}:{}}:c),{formatted:a}=dd(o,s,"window",e.messagesMap[r],n);ra(e.messagesMap[r],a);let l=ms(e);return ta(e,{conversationId:r,agentId:n,sessionId:s,incomingRows:a,activeAgentId:l.agentId,activeSessionId:l.sessionId}),r}function Jc(e){return e?.toolId?[zn(e)??"",e.vpId||e.speakerVpId||"",e.turnId||"",e.threadId||"main",e.toolId].join("\0"):null}function ed(e,t,s){return e.toolName="AskUserQuestion",e.toolId=t.toolCallId,e.toolInput={questions:s},e.askQuestions=s,e.askRequestId=null,e.askPending=!1,e.pendingAnswers=null,e.askSubmitGeneration=null,e.hasResult=!0,e.isHistory=!0,t.status==="answered"?(e.askAnswered=!0,e.selectedAnswers=t.answers,e.askExpired=!1):(e.askAnswered=!1,e.selectedAnswers=null,e.askExpired=!0),e}function Uh(e,t){return(e||[]).find(s=>s?.type==="tool-use"&&(s.toolName==="AskUser"||s.toolName==="AskUserQuestion")&&s.toolId===t.toolCallId&&zn(s)===t.sessionId&&(s.vpId||s.speakerVpId||"")===(t.vpId||"")&&(s.turnId||"")===(t.turnId||"")&&(s.threadId||"main")===(t.threadId||"main"))||null}function dd(e,t,s,n,r=null){let i=new Set((n||[]).map(c=>zr(Hh(c,r))).filter(Boolean)),o=new Set,a=[],l=0;for(let c of e){if(!c||c._reflection||c.internal||c.systemOnly||c.systemOnlyMessage||qh(c.content))continue;let d=c.id||c.messageId||null,u=c.clientMessageId||null,f=c.sessionId??c.groupId??t??null,p=Vn(r,f,d),g=u?Yt(r,f,u):p,m=c.historyEntryId?{historyEntryId:c.historyEntryId,...Number.isFinite(c.historyIndexGeneration)?{historyIndexGeneration:c.historyIndexGeneration}:{}}:{};if(!(p&&o.has(p))&&!(p&&s!=="recent"&&i.has(p))){if(p&&o.add(p),c.role==="user"){l+=1;let b=d||c.messageId||c.turnId||null;a.push({...d?{id:d,messageId:d}:{},...p?{stableKey:p}:{},...g?{uiKey:g}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"user",content:c.content,timestamp:Zc(c),sessionId:f,turnId:c.turnId||b,...u?{clientMessageId:u}:{},...Array.isArray(c.attachments)&&c.attachments.length>0?{attachments:c.attachments}:{},...c.quote?{quote:c.quote}:{},isStreaming:!1})}else if(c.role==="assistant"){l+=1;let b=d||c.messageId||c.turnId||null,I=Vh(c,f),y=Zc(c),S=!!c.turnId,w=c.turnId||b,v=typeof c.content=="string"?c.content:c.content||"",h=Array.isArray(c.todos)?c.todos:Dh(c.toolCalls),M=c.executionOrigin==="route_forward"?{executionOrigin:"route_forward"}:{};(typeof v!="string"||v.trim())&&a.push({...d?{id:d,messageId:d}:{},...p?{stableKey:p}:{},...g?{uiKey:g}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),...c.entryId?{entryId:c.entryId}:{},...Array.isArray(c.sourceMessageIds)?{sourceMessageIds:c.sourceMessageIds}:{},type:"assistant",content:v,timestamp:y,sessionId:f,turnId:w,_hasPersistedTurnId:S,...M,...I?{vpId:I,speakerVpId:I}:{},...c.responseKind==="progress"||c.responseKind==="result"?{responseKind:c.responseKind}:{},...c.incomplete===!0?{incomplete:!0}:{},...typeof c.stopReason=="string"&&c.stopReason?{stopReason:c.stopReason}:{},isStreaming:!1,isHistory:!0}),Array.isArray(h)&&h.length>0&&a.push({...d?{id:`${d}:todos`,messageId:`${d}:todos`}:{},...p?{stableKey:`${p}:todos`}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"tool-use",toolName:"TodoWrite",toolInput:{todos:h},timestamp:y,sessionId:f,turnId:w,...M,...I?{vpId:I,speakerVpId:I}:{},isStreaming:!1,isHistory:!0,hasResult:!0});for(let E of Array.isArray(c.images)?c.images:[])E?.assetId&&a.push({id:`${d||b||w}:image:${E.assetId}`,messageId:`${d||b||w}:image:${E.assetId}`,...p?{stableKey:`${p}:image:${E.assetId}`}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"chat-image",...E,timestamp:y,sessionId:f,turnId:w,...M,...I?{vpId:I,speakerVpId:I}:{},isStreaming:!1,isHistory:!0});for(let E of Array.isArray(c.askUserResults)?c.askUserResults:[]){if(!E?.toolCallId||E.status!=="answered"&&E.status!=="expired")continue;let V=[{question:typeof E.question=="string"?E.question:"",options:(Array.isArray(E.options)?E.options:[]).filter(_=>typeof _=="string").map(_=>({label:_,description:""})),multiSelect:!1}],L={toolCallId:E.toolCallId,sessionId:f,vpId:I||"",turnId:w||"",threadId:c.threadId||"main"},R=Uh(n,L);if(R){Object.assign(R,m),ed(R,E,V);continue}let P=ed({id:`${d||b||w}:ask:${E.toolCallId}`,messageId:`${d||b||w}:ask:${E.toolCallId}`,...p?{stableKey:`${p}:ask:${E.toolCallId}`}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"tool-use",timestamp:y,sessionId:f,turnId:w,threadId:L.threadId,...M,...I?{vpId:I,speakerVpId:I}:{},isStreaming:!1},E,V),A=Jc(P);(!A||!a.some(_=>Jc(_)===A))&&a.push(P)}let x=Lh(c);x>0&&a.push({...d?{id:`${d}:tool-summary`,messageId:`${d}:tool-summary`,persistedMessageId:d}:{},...p?{stableKey:`${p}:tool-summary`}:{},...m,seq:Number.isFinite(c.seq)?c.seq:vs(d),type:"tool-summary",count:x,omittedCount:x,source:"history",timestamp:y,sessionId:f,turnId:w,...M,...I?{vpId:I,speakerVpId:I}:{},isStreaming:!1,isHistory:!0})}}}return{formatted:a,acceptedHistoryMessages:l}}function ud(e,t){let s=t.sessionId!=null?t.sessionId:t.groupId,n=t.agentId||s&&e.yeaftSessionAgentById?.[s]||null;if(Ws(e,n,t.conversationId)){let R=e.yeaftConversationIdsByAgent?.[n]||null;if(!R||R===t.conversationId)return;Ct(e,t.conversationId,R,{removeSource:t.conversationId!==e.yeaftConversationId}),t={...t,conversationId:R}}if(t.requestId&&typeof e.isCurrentYeaftHistoryResponse=="function"&&!e.isCurrentYeaftHistoryResponse(t))return;let r=t.mode==="recent"||t.mode==="delta"?t.mode:"older",i=Array.isArray(t.messages)?t.messages:[];t.perfTraceId&&Ge(e,{traceId:t.perfTraceId,phase:"history.chunk_received",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,bytes:(()=>{try{return JSON.stringify(t).length}catch{return null}})(),detail:{mode:r,rawCount:i.length}});let o=t.agentId||(s&&e.yeaftSessionAgentById?e.yeaftSessionAgentById[s]:null),a=o&&e.yeaftConversationIdsByAgent?e.yeaftConversationIdsByAgent[o]:null,l=t.conversationId||a||e.yeaftConversationId;if(!l){e.yeaftLoadingMoreHistory=!1;return}jh(e,t,s,l),e.messagesMap[l]||(e.messagesMap[l]=[]);let{formatted:c,acceptedHistoryMessages:d}=dd(i,s,r,e.messagesMap[l],o);On(e,l,c);let u=0,f=!1;if(r==="recent"){let R=Bh(e.messagesMap[l],c,s??null);u=R.insertedRows,f=R.preservedEmpty}else if(c.length>0)if(r==="older"){if(e.messagesMap[l].splice(0,0,...c),u=c.length,typeof e.expandYeaftMessageWindow=="function"){let R=e.yeaftActiveSessionFilter?s??null:null;e.expandYeaftMessageWindow(R,t.turns||10,o)}}else u=ra(e.messagesMap[l],c);let p=ms(e);ta(e,{conversationId:l,agentId:o,sessionId:s,incomingRows:c,activeAgentId:p.agentId,activeSessionId:p.sessionId});let g=ke(t.agentId||null,s),m=e.yeaftHistoryCacheState?.[g]||null,b=e.yeaftSessionHistoryState?.[g]||{},I=Number.isFinite(b.serverOldestFetchedSeq)?b.serverOldestFetchedSeq:Number.isFinite(b.oldestSeq)?b.oldestSeq:null,y=Number.isFinite(t.nextBeforeSeq)?t.nextBeforeSeq:Number.isFinite(t.oldestSeq)?t.oldestSeq:f?I:null,S=f&&!Number.isFinite(t.nextBeforeSeq)&&!Number.isFinite(t.oldestSeq)?b.serverHasMore??b.hasMore??!1:t.hasMore,w=r==="delta"?b:Xc(b,{mode:r,oldestSeq:y,hasMore:S,ranges:m?.ranges||[],pageKind:t.pageKind,stopAtSeq:t.gapStopAtSeq,cacheEpoch:m?.rangeEpoch??t.cacheEpoch??0}),v=typeof t.latestSeq=="number"?t.latestSeq:b.latestSeq??null,h=r==="delta"?{...b,loaded:!0,loading:!1,latestSeq:v,syncingAfterSeq:null,count:(b.count||0)+u}:{...w,loaded:!0,loading:!1,count:m?m.rowCount:r==="older"?(b.count||0)+u:f?b.count||0:d,latestSeq:f&&!Number.isFinite(t.latestSeq)?b.latestSeq??null:v,syncingAfterSeq:null};t.requestId&&typeof e.finishYeaftHistoryLoad=="function"?e.finishYeaftHistoryLoad(t,h,"chunk"):e.yeaftSessionHistoryState&&(e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState,[g]:h});let M=ms(e),x=M.sessionId===(s||null),E=!t.agentId||!M.agentId||t.agentId===M.agentId,V=x&&E,L=ke(null,M.sessionId);if(t.perfTraceId&&(Ge(e,{traceId:t.perfTraceId,phase:"history.chunk_applied",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,detail:{mode:r,formattedCount:c.length,insertedRows:u,acceptedHistoryMessages:d,preservedEmptyRecent:f}}),Ur(e,{traceId:t.perfTraceId,phase:"history.next_paint",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,detail:{mode:r,insertedRows:u}})),V)e.yeaftHasMoreHistory=h.hasMore,e.yeaftOldestLoadedSeq=Number.isFinite(h.serverOldestFetchedSeq)?h.serverOldestFetchedSeq:Number.isFinite(h.oldestSeq)?h.oldestSeq:e.yeaftOldestLoadedSeq,e.yeaftLoadingMoreHistory=!1;else if(e.yeaftLoadingMoreHistory){let R=e.yeaftSessionHistoryState?.[M.sessionKey]||e.yeaftSessionHistoryState?.[L]||null;e.yeaftLoadingMoreHistory=!!R?.loading}}var Yr=F(()=>{Gt();Wo();Br();us();jo();Fn();Lo();$t();Ko();Xo();Fs();sa();na()});function pd(e,t,s=null){if(!s)return!1;if(e.promoteYeaftHistoryOutlineRow?.(t,s))return!0;let n=t?.sessionId??t?.groupId??e._currentYeaftSessionId??null;return n?!!e.invalidateYeaftHistoryOutline?.(n,s):!1}function Kh(e){let t=e;if(typeof t=="string"){let s=t.trim();if(s.startsWith("[")&&s.endsWith("]")||s.startsWith("{")&&s.endsWith("}"))try{t=JSON.parse(s)}catch{t=e}}return Array.isArray(t)?t.map(s=>typeof s=="string"?s:!s||typeof s!="object"?"":s.type==="text"&&typeof s.text=="string"||s.type==="input_text"&&typeof s.text=="string"?s.text:"").join("").replace(/\n\n\[Uploaded files\][\s\S]*$/m,"").trim():t&&typeof t=="object"?typeof t.text=="string"?t.text.trim():typeof t.content=="string"?t.content.trim():"":typeof t=="string"?t.replace(/\n\n\[Uploaded files\][\s\S]*$/m,"").trim():""}function oa(e,t){return e.executionStatusMap[t]||(e.executionStatusMap[t]={currentTool:null,toolHistory:[],lastActivity:null}),e.executionStatusMap[t]}function fd(e,t,s,n=null){if(!t)return;let r=oa(e,t);if(r.lastActivity=Date.now(),Nr(e,t),s.type==="system"){if(s.subtype==="init"){let i=e.conversations.find(o=>o.id===t);i&&i.connecting&&(i.connecting=!1);return}s.message&&e.addMessageToConversation(t,{type:"system",content:typeof s.message=="string"?s.message:JSON.stringify(s.message,null,2)});return}if(s.type==="assistant"){let i=s.message?.content;if(!i)return;let o=e.messagesMap[t]||[];for(let a of o)a.type==="tool-use"&&!a.hasResult&&(a.hasResult=!0);for(let a of r.toolHistory)a.status==="running"&&(a.status="done");if(r.currentTool=null,typeof i=="string"){e.appendToAssistantMessageForConversation(t,i,{id:s.message?.id||s.message?.messageId||null,ts:s.ts||s.message?.ts||s.message?.time||null,sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null});return}if(!Array.isArray(i))return;if(i.length===0){e.finishStreamingForConversation(t);return}for(let a of i)a.type==="text"?e.appendToAssistantMessageForConversation(t,a.text,{id:s.message?.id||s.message?.messageId||null,ts:s.ts||s.message?.ts||s.message?.time||null,sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):a.type==="image_asset"&&a.image?e.addMessageToConversation(t,{type:"chat-image",...a.image,sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,speakerVpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):a.type==="tool_summary"?e.addMessageToConversation(t,{type:"tool-summary",count:Number(a.count||a.omittedCount||0)||0,omittedCount:Number(a.omittedCount||a.count||0)||0,source:a.source||"history",isHistory:a.source!=="live",sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):a.type==="tool_use"&&(e.finishStreamingForConversation(t,{completeLifecycle:!1}),r.currentTool={name:a.name,input:a.input,startTime:Date.now()},r.toolHistory.unshift({name:a.name,input:a.input,timestamp:Date.now(),status:"running"}),r.toolHistory.length>20&&r.toolHistory.pop(),e.addMessageToConversation(t,{type:"tool-use",toolId:a.id||a.tool_use_id||null,toolName:a.name,toolInput:a.input,startTime:Date.now(),sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}))}else if(s.type==="user"){let i=s.internal===!0||s.message?.internal===!0||s.userAuthored===!1||s.message?.userAuthored===!1,o=s.message?.content,a=Kh(o);if(typeof a=="string"&&(a.includes("<local-command-caveat>")||a.includes("<command-name>")))return;if(typeof a=="string"&&a.includes("<local-command-stdout>")){let c=a.match(/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/);if(c){e.appendToAssistantMessageForConversation(t,c[1].trim()),e.finishStreamingForConversation(t);return}}let l=[];if(s.tool_use_result)l=Array.isArray(s.tool_use_result)?s.tool_use_result:[s.tool_use_result];else if(s.message?.content){let c=s.message.content;l=(Array.isArray(c)?c:[]).filter(u=>u.type==="tool_result")}if(l.length>0){let c=e.messagesMap[t]||[];for(let d of l){if(r.toolHistory.length>0){let g=r.toolHistory.findIndex(m=>m.status==="running");g>=0&&(r.toolHistory[g].status="done")}let u=d.tool_use_id||d.toolUseId||d.tool_call_id||d.toolCallId||null,f=d.content||d,p=!1;if(u){for(let g=c.length-1;g>=0;g--)if(c[g].type==="tool-use"&&c[g].toolId===u){c[g].hasResult=!0,c[g].toolResult=d.is_update&&c[g].toolResult?`${c[g].toolResult}
|
|
2
2
|
|
|
3
|
-
${f}`:f,p=!0;break}}if(!p){for(let g=c.length-1;g>=0;g--)if(c[g].type==="tool-use"&&!c[g].hasResult){c[g].hasResult=!0,c[g].toolResult=f;break}}}r.currentTool=null}else if(!i&&(typeof a=="string"&&a.trim()||Array.isArray(s.message?.attachments)&&s.message.attachments.length>0)){let c=s.message?.clientMessageId||s.clientMessageId||null,d={type:"user",content:a,clientMessageId:c},u=e.messagesMap[t]||[];if(u.some(p=>jr(p,d))){if(c){for(let p=u.length-1;p>=0;p--)if(u[p].type==="user"&&u[p].clientMessageId===c){s.dbMessageId&&!u[p].dbMessageId&&(u[p].dbMessageId=s.dbMessageId),s.message?.id&&!u[p].messageId&&(u[p].id=s.message.id,u[p].messageId=s.message.id),s.ts&&!u[p].ts&&(u[p].ts=s.ts),pd(e,u[p],n);break}}}else{let p=e.addMessageToConversation(t,{...s.message?.id?{id:s.message.id,messageId:s.message.id}:{},...s.ts?{ts:s.ts}:{},type:"user",content:a,...s.message?.attachments?{attachments:s.message.attachments}:{},...s.message?.quote?{quote:s.message.quote}:{},...c?{clientMessageId:c}:{}});pd(e,p,n)}}}else if(s.type==="result"){delete e.processingConversations[t],Ae(e,t);let i=e.conversations.find(d=>d.id===t);i&&i.connecting&&(i.connecting=!1);let o=e._currentYeaftSessionId||null;if(e._currentYeaftTurnId){let d=Object.entries(e.activeVpTurns||{}).find(([,u])=>(u?.turnId===e._currentYeaftTurnId||!u?.turnId&&u===e.activeVpTurns[e._currentYeaftTurnId])&&(!e._currentYeaftAgentId||!u?.agentId||u.agentId===e._currentYeaftAgentId));if(d){let[u,f]=d,{[u]:p,...g}=e.activeVpTurns;!o&&f?.sessionId&&(o=f.sessionId),e.activeVpTurns=g}}if(o&&e._currentYeaftVpId&&e.vpStatuses){let d=e._currentYeaftTurnId||null,u={...e.vpStatuses||{}},f=!1;for(let[p,g]of Object.entries(u))!g||g.vpId!==e._currentYeaftVpId||e._currentYeaftAgentId&&g.agentId&&g.agentId!==e._currentYeaftAgentId||(g.sessionId||g.groupId||null)!==o||d&&g.turnId&&g.turnId!==d||(u[p]={...g,state:"idle",turnId:null,since:Date.now()},f=!0);f&&(e.vpStatuses=u)}o&&typeof e.clearYeaftSessionProcessingIfIdle=="function"&&e.clearYeaftSessionProcessingIfIdle(o,{agentId:e._currentYeaftAgentId||null}),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(t),r.currentTool=null,Qt(e,t);let a=e.messagesMap[t]||[],l=s.result_text||"";if(typeof l=="string"&&l.trim()){let d=!1;for(let u=a.length-1;u>=0;u--){if(a[u].type==="assistant"){d=!0;break}if(a[u].type==="user")break}d||e.appendToAssistantMessageForConversation(t,l.trim())}e.finishStreamingForConversation(t),!(n&&e.promoteCompletedYeaftHistoryOutline?.(t,e._currentYeaftTurnId||null,n))&&o&&n&&e.invalidateYeaftHistoryOutline?.(o,n),e.sweepStaleStreamingForConversation(t)}}var gd=F(()=>{Gt();Yr();jo()});function ys(e){if(e==null)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Gr(e,t){if(!t)return e??null;if(Object.prototype.hasOwnProperty.call(t,"base"))return ys(t.base)??null;if(Object.prototype.hasOwnProperty.call(t,"replacement"))return ys(t.replacement)??null;let s=e&&typeof e=="object"&&!Array.isArray(e)?ys(e):{};if(t.set&&typeof t.set=="object")for(let[n,r]of Object.entries(t.set))s[n]=ys(r);if(t.body&&typeof t.body=="object"){let n=s.body&&typeof s.body=="object"&&!Array.isArray(s.body)?{...s.body}:{};for(let[i,o]of Object.entries(t.body))i==="messages"||i==="messagesFrom"||i==="messagesAppend"||i==="messagesKey"||(n[i]=ys(o));let r=t.body.messagesKey==="messages"||t.body.messagesKey==="input"?t.body.messagesKey:Array.isArray(n.messages)||Object.prototype.hasOwnProperty.call(t.body,"messages")?"messages":"input";if(Array.isArray(t.body.messages))n[r]=ys(t.body.messages)||[];else if(Array.isArray(t.body.messagesAppend)){let i=Array.isArray(n[r])?n[r]:[],o=Number.isFinite(Number(t.body.messagesFrom))?Number(t.body.messagesFrom):i.length;n[r]=i.slice(0,o).concat(ys(t.body.messagesAppend)||[])}s.body=n}return s}function md(e,t){return!t||!Object.prototype.hasOwnProperty.call(t,"rawRequestDelta")?e??null:Gr(e??null,t.rawRequestDelta)}function Yn(e){if(!e)return 0;let t=typeof e=="string"?e:String(e),s=0,n=0;for(let r of t){let i=r.codePointAt(0)||0;i>=19968&&i<=40959||i>=12352&&i<=12447||i>=12448&&i<=12543||i>=44032&&i<=55215?s+=1:n+=1}return Math.ceil(s+n/4)}function Yh(e){let t=[],s=[];if(!e)return{messageText:t,toolText:s};let n=e.content;if(typeof n=="string")e.role==="tool"?s.push(n):t.push(n);else if(Array.isArray(n))for(let r of n){if(!r||typeof r!="object")continue;let i=r.type;if(i==="text"&&typeof r.text=="string")t.push(r.text);else if(i==="tool_use"){if(s.push(String(r.name||"")),r.input!==void 0)try{s.push(JSON.stringify(r.input))}catch{}}else if(i==="tool_result"){let o=r.content;if(typeof o=="string")s.push(o);else if(Array.isArray(o)){for(let a of o)if(a)if(typeof a=="string")s.push(a);else if(typeof a=="object"&&typeof a.text=="string")s.push(a.text);else try{s.push(JSON.stringify(a))}catch{}}else if(o!==void 0)try{s.push(JSON.stringify(o))}catch{}}else try{t.push(JSON.stringify(r))}catch{}}if(Array.isArray(e.toolCalls)){for(let r of e.toolCalls)if(r&&(s.push(String(r.name||"")),r.input!==void 0))try{s.push(JSON.stringify(r.input))}catch{}}return{messageText:t,toolText:s}}function hd(e){let t=0,s=0;if(e&&Array.isArray(e.messages))for(let i of e.messages){let{messageText:o,toolText:a}=Yh(i);for(let l of o)t+=Yn(l);for(let l of a)s+=Yn(l)}let n=0,r=0;if(e&&typeof e.response=="string"&&(n+=Yn(e.response)),e&&Array.isArray(e.toolCalls)){for(let i of e.toolCalls)if(i&&(r+=Yn(String(i.name||"")),i.input!==void 0))try{r+=Yn(JSON.stringify(i.input))}catch{}}return{inputMessageTokens:t,inputToolTokens:s,outputMessageTokens:n,outputToolTokens:r,inputTotalEstimated:t+s,outputTotalEstimated:n+r}}function aa(e,t,s){let n=Math.max(0,Math.floor(Number(e)||0)),r=Math.max(0,Number(t)||0),i=Math.max(0,Number(s)||0),o=r+i;if(n===0)return{message:0,tool:0};if(o===0)return{message:n,tool:0};let a=Math.round(r/o*n),l=Math.min(n,Math.max(0,a));return{message:l,tool:n-l}}function vd(e){if(e==null||e==="")return"";let t;if(typeof e=="number")t=e;else if(typeof e=="string"){let o=Date.parse(e);if(Number.isNaN(o)){let a=Number(e);if(!Number.isFinite(a))return"";t=a}else t=o}else return"";if(!Number.isFinite(t))return"";let s=new Date(t),n=String(s.getHours()).padStart(2,"0"),r=String(s.getMinutes()).padStart(2,"0"),i=String(s.getSeconds()).padStart(2,"0");return`${n}:${r}:${i}`}var la=F(()=>{});function mt(e,t){return!e||!t?"":`${e}${t}`}function Gn(e){let t=typeof e=="string"?e:String(e||"");if(!t)return{agentId:null,sessionId:null};let s=t.indexOf("");if(s<0)return{agentId:null,sessionId:t};let n=t.slice(0,s)||null,r=t.slice(s+1)||null;return{agentId:n,sessionId:r}}function ca(e){return e?`${e}`:""}function da(e,t){return!e||!t?"":`${e}${t}`}var Qn=F(()=>{});function Gh(e,t){if(!e||!!!t?.online)return!1;let n=!e.online,r=e.online&&e.version!=null&&t.version!=null&&e.version!==t.version;return n||r}function yd(e,t){let s=e.lastViewedConversation||localStorage.getItem("lastViewedConversation");if(!s)return!1;let n=e.conversations.find(i=>i.id===s);if(!n)return!1;let r=t?.agentId||e.currentAgent;return t&&(e.currentAgent=t.agentId,e.currentAgentInfo=t.agentInfo,e.sendWsMessage({type:"select_agent",agentId:t.agentId,silent:!0})),e.activeConversations=[s],e.currentWorkDir=n.workDir,e.messagesMap[s]=[],e.sendWsMessage({type:"select_conversation",conversationId:s}),e.requestChatHistory?.(s,{mode:"recent",turns:5}),e.sendWsMessage({type:"refresh_conversation",conversationId:s}),!0}function bd(e,t){let s=Array.isArray(e.agents)?e.agents:[],n=e._hasHandledAgentList===!0,r=e.currentAgent||null,i=!!(r&&s.some(a=>a&&a.id===r&&a.online));e.agents=t.agents,e._hasHandledAgentList=!0;let o=e.currentAgent||null;if(o){let a=e._yeaftAgentSeen&&e._yeaftAgentSeen.id===o?e._yeaftAgentSeen:null,l=t.agents.find(c=>c.id===o)||null;e.currentView==="yeaft"&&Gh(a,l)&&(e._yeaftReconnectCatchUpPending=!0),l?e._yeaftAgentSeen={id:o,online:!!l.online,version:l.version!=null?l.version:null}:a?a.online&&(e._yeaftAgentSeen={id:o,online:!1,version:a.version}):e._yeaftAgentSeen={id:o,online:!1,version:null}}{let a=new Set(t.agents.map(l=>l.id));for(let l of t.agents)e.proxyPorts[l.id]=l.proxyPorts||[],l.yeaftStatus&&typeof e.cacheYeaftAgentStatus=="function"&&e.cacheYeaftAgentStatus(l.id,l.yeaftStatus);for(let l of Object.keys(e.proxyPorts))a.has(l)||delete e.proxyPorts[l]}if(e.currentAgent){let a=t.agents.find(l=>l.id===e.currentAgent);a&&(e.currentAgentInfo=a)}if(e.currentView==="yeaft"&&!e.currentAgent){let a=t.agents.find(l=>l.online);a&&(e.currentAgent=a.id,e.currentAgentInfo=a)}if(e.currentView==="yeaft"&&typeof e.loadOpenedYeaftSessionsForConnectedAgents=="function"){let a=t.agents.filter(l=>l&&l.online&&l.id).map(l=>l.id);e.loadOpenedYeaftSessionsForConnectedAgents(a)}{let a=[],l=new Set;for(let d of t.agents)for(let u of d.conversations||[])l.has(u.id)||(l.add(u.id),a.push({...u,type:u.type,agentId:d.id,agentName:d.name}),u.title&&(u.customTitle&&(e.customConversationTitles[u.id]=u.title),e.conversationTitles[u.id]||(e.conversationTitles[u.id]=u.title)));for(let d of a){d.agentOnline=!0;let u=e.conversations.find(f=>f.id===d.id);if(u)u.claudeSessionId=d.claudeSessionId||u.claudeSessionId,u.processing=d.processing,u.userId=d.userId,u.username=d.username,u.agentId=d.agentId,u.agentName=d.agentName,u.agentOnline=!0,d.type&&(u.type=d.type),d.name!==void 0&&(u.name=d.name);else{let f=e._recentlyDeletedSessions?.[d.id];if(f&&Date.now()-f<15e3)continue;e.conversations.push(d)}d.pinned&&!e.pinnedSessions.includes(d.id)&&e.pinnedSessions.push(d.id)}let c=new Set(t.agents.map(d=>d.id));e.conversations=e.conversations.filter(d=>{if(l.has(d.id)||e.activeConversations.includes(d.id))return!0;if(d.agentId&&c.has(d.agentId)){let u=e._recentlyDeletedSessions?.[d.id];return u&&Date.now()-u<15e3||(delete e.messagesMap[d.id],delete e.processingConversations[d.id],Ae(e,d.id),delete e.executionStatusMap[d.id]),!1}return d.agentId&&!c.has(d.agentId)&&(d.agentOnline=!1),!0});for(let d of a)if(d.processing&&!fs(e,d.id)&&!e._turnCompletedConvs?.has(d.id))e.processingConversations[d.id]=!0;else if(e.processingConversations[d.id]){delete e.processingConversations[d.id],Ae(e,d.id);let u=e.executionStatusMap[d.id];u&&(u.currentTool=null),e.finishStreamingForConversation(d.id)}for(let d of Object.keys(e.processingConversations))if(!l.has(d)){if(d.startsWith("yeaft-"))continue;delete e.processingConversations[d],Ae(e,d);let u=e.executionStatusMap[d];u&&(u.currentTool=null),e.finishStreamingForConversation(d)}}if(localStorage.setItem("pinned-sessions",JSON.stringify(e.pinnedSessions)),e._closedAt){let a=Date.now();for(let l of Object.keys(e._closedAt))a-e._closedAt[l]>3e4&&(delete e._closedAt[l],e._turnCompletedConvs?.delete(l))}if(e.currentAgent){let a=t.agents.find(l=>l.id===e.currentAgent&&l.online);if(a){let l=!!e._yeaftReconnectCatchUpPending,d=l||n&&!i;if(e.currentAgentInfo=a,d&&(e._offlineConversationRestoreKey=null,e.sendWsMessage({type:"select_agent",agentId:e.currentAgent,silent:!0})),e.currentView==="yeaft"&&typeof e.requestYeaftSessionBootstrap=="function"){e._yeaftReconnectCatchUpPending=!1;let u=l||!e.yeaftSessionReady||!e.yeaftModel||!e.yeaftStatus;(u||l)&&e.requestYeaftSessionBootstrap({forceSessionReady:u,catchUpHistory:l})}if(!d)return;if(e.currentConversation){let u=e.conversations.find(g=>g.id===e.currentConversation);e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation});let f=e.messagesMap[e.currentConversation]||[],p=ps(f);p!=null?e.requestChatHistory?.(e.currentConversation,{mode:"delta",afterMessageId:p}):e.requestChatHistory?.(e.currentConversation,{mode:"recent",turns:5}),e.sendWsMessage({type:"refresh_conversation",conversationId:e.currentConversation})}else e.recoveryDismissed||yd(e);return}else{let l=`${e.currentAgent||""}:${e.currentConversation||""}`;e.currentConversation&&(!n||i||e._offlineConversationRestoreKey!==l)&&(e._offlineConversationRestoreKey=l,e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation}));return}}if(!e.currentConversation&&!e.currentAgent&&!e.recoveryDismissed){let a=e.lastViewedConversation||localStorage.getItem("lastViewedConversation"),l=e.lastUsedAgent;if(a){let c=e.conversations.find(d=>d.id===a);if(c){let d=t.agents.find(u=>u.id===c.agentId&&u.online);if(d){yd(e,{agentId:c.agentId,agentInfo:d});return}}}l&&(e.agents.find(d=>d.id===l&&d.online)?e.selectAgent(l):e.checkPendingRecovery())}}function wd(e,t){let s=e.pendingAgentSelection||null;if(s){if(!(typeof t.requestId=="string"&&t.requestId?t.requestId===s.requestId:t.agentId===s.agentId))return!1;if(e.pendingAgentSelection=null,t.ok===!1)return e.agentSwitching=!1,!1}else{if(t.requestId)return!1;if(e.currentAgent&&t.agentId!==e.currentAgent)return!1}e.agentSwitching=!1;let n=e.currentAgent===t.agentId,r={id:t.agentId,name:t.agentName,workDir:t.workDir,capabilities:t.capabilities||["terminal","file_editor","background_tasks"],version:t.version||null};if(typeof e.activateYeaftAgent=="function"?e.activateYeaftAgent(t.agentId,r):(e.currentAgent=t.agentId,e.currentAgentInfo=r),Array.isArray(t.slashCommands)){let u=[...new Set(t.slashCommands)];e.slashCommandsMap[`agent:${t.agentId}`]=u}t.slashCommandDescriptions&&(e.slashCommandDescriptions={...e.slashCommandDescriptions,...t.slashCommandDescriptions});let i=t.conversations||[],o=new Set,a=i.filter(u=>o.has(u.id)?!1:(o.add(u.id),!0)).map(u=>({...u,agentId:t.agentId,agentName:t.agentName}));if(n&&e.currentConversation){let u=i.find(f=>f.id===e.currentConversation);u&&!a.find(f=>f.id===u.id)&&a.push({...u,agentId:t.agentId,agentName:t.agentName})}let l=new Set(a.map(u=>u.id)),c=e.conversations.filter(u=>!l.has(u.id));e.conversations=[...c,...a];for(let u of i)u.title&&(u.customTitle&&(e.customConversationTitles[u.id]=u.title),e.conversationTitles[u.id]||(e.conversationTitles[u.id]=u.title));let d=new Set(i.map(u=>u.id));for(let u of i)if(u.processing&&!fs(e,u.id)&&!e._turnCompletedConvs?.has(u.id))e.processingConversations[u.id]=!0;else if(e.processingConversations[u.id]){delete e.processingConversations[u.id],Ae(e,u.id);let f=e.executionStatusMap[u.id];f&&(f.currentTool=null),e.finishStreamingForConversation(u.id)}for(let u of Object.keys(e.processingConversations))if(!d.has(u)){if(u.startsWith("yeaft-"))continue;if(!c.some(p=>p.id===u)){delete e.processingConversations[u],Ae(e,u);let p=e.executionStatusMap[u];p&&(p.currentTool=null),e.finishStreamingForConversation(u)}}if(e.currentView!=="yeaft"){if(n&&e.currentConversation){let u=e.conversations.find(f=>f.id===e.currentConversation);e.currentWorkDir=u?.workDir||e.currentWorkDir||t.workDir,St(e),e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation})}else{e.activeConversations=[],e.currentWorkDir=t.workDir;let u=e.lastViewedConversation||localStorage.getItem("lastViewedConversation");u&&e.conversations.find(f=>f.id===u)&&(e.autoRestoreConversation(u),e.pendingRecovery=null)}ac(e)}return!0}var kd=F(()=>{Gt();us();Fn()});function Qh(e={}){return{providers:e.providers||[],primaryModel:e.primaryModel||null,fastModel:e.fastModel||null,language:e.language||"en"}}function Sd(){return window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore()}function ev(e,t){let s=t.agentId||null,n=Array.isArray(e.yeaftSessionHydrateSlices)?e.yeaftSessionHydrateSlices.filter(r=>r.agentId!==s):[];e.yeaftSessionHydrateSlices=[...n,{agentId:s,sessions:Array.isArray(t.sessions)?t.sessions:[]}]}function tv(e){let t=Sd(),s=null;try{s=localStorage.getItem("lastViewedYeaftSession")||null}catch{}let n=Gn(s),r=e.yeaftActiveSessionFilter||t?.activeSessionId||null;if(r){let i=t?.activeSessionKey?t.sessions?.[t.activeSessionKey]:null;return i?.id===r&&i.agentId?{sessionId:r,agentId:i.agentId}:n.sessionId===r&&n.agentId?n:{sessionId:r,agentId:null}}return n}function Id(e){let t=Sd(),s=tv(e);typeof t?.beginInventoryCommit=="function"?t.beginInventoryCommit(s.sessionId,s.agentId):typeof t?.resetInventory=="function"&&t.resetInventory();let n=Array.isArray(e.yeaftSessionHydrateSlices)?e.yeaftSessionHydrateSlices:[],r=s.agentId?[...n.filter(i=>i.agentId===s.agentId),...n.filter(i=>i.agentId!==s.agentId)]:n;r.length===0&&t?.applySnapshot?.([],null),r.forEach((i,o)=>{t?.applySnapshot?.(i.sessions||[],i.agentId||null,{deferActivation:o<r.length-1})}),e.yeaftSessionHydrateSlices=[]}function sv(e){let t=e.yeaftSessionHydrateRequestId||null;e.yeaftSessionInventoryCompleteSupported!==!1||!t||(clearTimeout(e._legacyYeaftSessionHydrateTimer),e._legacyYeaftSessionHydrateTimer=setTimeout(()=>{e.yeaftSessionHydrateRequestId===t&&(e._legacyYeaftSessionHydrateTimer=null,Id(e),e._hasHandledYeaftSessionHydrate=!0,e.yeaftSessionHydrateRequestId=null,e.yeaftSessionHydrateError=null,e._yeaftSessionInventorySocketQuarantined=!0)},Jh))}function nv(e,t={}){let s=e||{systemPrompt:"",messages:[],rawRequest:null},n={systemPrompt:s.systemPrompt||"",messages:Array.isArray(s.messages)?[...s.messages]:[],rawRequest:s.rawRequest??null};if(t?.base){let r={systemPrompt:t.systemPrompt||"",messages:Array.isArray(t.messages)?t.messages:[],rawRequest:null};return Object.prototype.hasOwnProperty.call(t,"rawRequestDelta")&&(r.rawRequest=Gr(null,t.rawRequestDelta)),r}if(typeof t?.systemPrompt=="string"&&(n.systemPrompt=t.systemPrompt),Array.isArray(t?.messages))n.messages=t.messages;else if(Array.isArray(t?.messagesAppend)){let r=Number.isFinite(Number(t.messagesFrom))?Number(t.messagesFrom):n.messages.length;n.messages=n.messages.slice(0,r).concat(t.messagesAppend)}return Object.prototype.hasOwnProperty.call(t||{},"rawRequestDelta")&&(n.rawRequest=Gr(n.rawRequest,t.rawRequestDelta)),n}function rv(e=[]){let t=new Map;return e.map(s=>{if(!s||!s.requestDelta)return s;let n=s.turnId||"__unknown__",r=t.get(n)||s.requestBase||null,i=r?.rawRequest??null,o=nv(r,s.requestDelta);return t.set(n,o),{...s,systemPrompt:typeof s.systemPrompt=="string"&&s.systemPrompt?s.systemPrompt:o.systemPrompt,messages:Array.isArray(s.messages)&&s.messages.length>0?s.messages:o.messages,rawRequest:s.rawRequest??null,rawRequestBase:i}})}function Cd(e,t){let s=De();switch(e._lastPongAt=Date.now(),t.type){case"work_center_response":{let n=t.requestId?e.workCenterPending[t.requestId]:null;if(!n)break;clearTimeout(n.timer),delete e.workCenterPending[t.requestId],t.ok?n.resolve(t.data):n.reject(new Error(t.error||"Work Center request failed"));break}case"work_center_event":e.applyWorkCenterEvent(t.agentId,t.event);break;case"auth_result":if(t.success){if(e.authenticated=!0,t.sessionKey&&(e.sessionKey=pt(t.sessionKey),s.setSessionKey(t.sessionKey)),t.acceptPlaintext===!0&&(e.serverEncryptionRequired=!1),e.yeaftSessionInventoryCompleteSupported=t.yeaftSessionInventoryComplete===!0,e.yeaftSessionHydrateSlices=[],e._hasHandledYeaftSessionHydrate=!1,e.yeaftSessionHydrateError=null,t.role&&(s.role=t.role),typeof e.requestYeaftSessionInventory=="function")e.requestYeaftSessionInventory();else{let n=e.conversations.map(r=>r.id).filter(Boolean);e.sendWsMessage({type:"get_agents",conversationIds:n.length>0?n:void 0})}e.checkPendingRecovery()}else e.addMessage({type:"error",content:t.error||Le("login.error.loginFailed")}),s.handleAuthFailure?.(void 0,t._wsAuthToken,t._wsAuthGeneration);break;case"agent_list":bd(e,t),e.workCenterOpen&&e.workCenterAgentId&&e.listWorkItems(e.workCenterAgentId).catch(()=>{});break;case"yeaft_session_hydrate":{if(e.yeaftSessionInventoryCompleteSupported===!0&&(!t.requestId||t.requestId!==e.yeaftSessionHydrateRequestId)||e.yeaftSessionInventoryCompleteSupported!==!0&&!e.yeaftSessionHydrateRequestId||t.requestId&&e.yeaftSessionHydrateRequestId&&t.requestId!==e.yeaftSessionHydrateRequestId)break;ev(e,t),e.yeaftSessionInventoryCompleteSupported!==!0&&sv(e);break}case"yeaft_session_hydrate_complete":if(e.yeaftSessionInventoryCompleteSupported===!0&&(!t.requestId||t.requestId!==e.yeaftSessionHydrateRequestId)||e.yeaftSessionHydrateRequestId&&!t.requestId||t.requestId&&e.yeaftSessionHydrateRequestId&&t.requestId!==e.yeaftSessionHydrateRequestId)break;clearTimeout(e._legacyYeaftSessionHydrateTimer),e._legacyYeaftSessionHydrateTimer=null,t.ok!==!1?Id(e):e.yeaftSessionHydrateSlices=[],e.yeaftSessionHydrateRequestId=null,e._hasHandledYeaftSessionHydrate=t.ok!==!1,e.yeaftSessionHydrateError=t.ok===!1?t.error||"session_inventory_failed":null;break;case"session_catalog_snapshot":e.applySessionCatalogSnapshot(t.catalog,t.projectsAuthoritative===!0?t.projects:null,t.hiddenCatalog);break;case"session_ui_metadata_updated":e.finishSessionCatalogMutation?.(t);break;case"session_catalog_reorder_result":e.finishSessionCatalogMutation?.(t);break;case"agent_selected":if(!wd(e,t))break;e.workCenterOpen&&e.workCenterAgentId&&e.listWorkItems(e.workCenterAgentId).catch(()=>{});break;case"conversation_created":sd(e,t);break;case"conversation_resumed":nd(e,t);break;case"conversation_selected":if(e.currentConversation===t.conversationId)return;e.activeConversations=[t.conversationId];{let n=e.conversations.find(r=>r.id===t.conversationId);n&&(e.currentWorkDir=n.workDir)}e.messagesMap[t.conversationId]=[],e.saveOpenSessions();break;case"conversation_settings_updated":{let n=e.conversations.find(i=>i.id===t.conversationId);n&&t.disallowedTools!==void 0&&(n.disallowedTools=t.disallowedTools);let r=e.conversationMcpServers[t.conversationId];if(r&&t.disallowedTools){let i=new Set(t.disallowedTools),o=e.conversationMcpServerTools[t.conversationId]||{};for(let a of r){let l=o[a.name];l&&l.length>0?a.enabled=!l.some(c=>i.has(c)):a.enabled=!i.has(`mcp__${a.name}`)}}t.needRestart&&n&&(n.needRestart=!0);break}case"sync_messages_result":ld(e,t);break;case"conversation_deleted":ia(e,t);break;case"conversation_delete_result":t.ok&&ia(e,t);break;case"turn_completed":rd(e,t);break;case"conversation_closed":id(e,t);break;case"claude_output":e.handleAssistantOutputFrame(t.conversationId,t.data);break;case"yeaft_output":case"yeaft_session_output":case"session_output":e.handleYeaftOutput(t);break;case"yeaft_asset_ready":{let n=t.conversationId||e.yeaftConversationIdsByAgent?.[t.agentId]||e.yeaftConversationId;if(!n||!t.image)break;e.messagesMap[n]||(e.messagesMap[n]=[]),e.messagesMap[n].some(i=>i?.type==="chat-image"&&i.assetId===t.image.assetId&&i.sessionId===t.sessionId&&i.turnId===t.turnId)||e.addMessageToConversation(n,{type:"chat-image",...t.image,sessionId:t.sessionId||null,vpId:t.vpId||null,speakerVpId:t.vpId||null,turnId:t.turnId||null,threadId:t.threadId||null});break}case"yeaft_history_chunk":ud(e,t);break;case"yeaft_history_outline":e.handleYeaftHistoryOutline(t);break;case"yeaft_history_search_result":e.handleYeaftHistorySearchResult(t);break;case"yeaft_history_window":{if(!e.pendingYeaftHistoryWindow?.(t))break;let n=t.error?null:cd(e,t);e.handleYeaftHistoryWindow(t,n);break}case"yeaft_tool_stats":{e._fetchYeaftToolStatsTimer&&(clearTimeout(e._fetchYeaftToolStatsTimer),e._fetchYeaftToolStatsTimer=null);let n=t?.snapshot,r=n&&typeof n=="object"&&!Array.isArray(n)?n:{};e.yeaftToolStats={snapshot:r,registered:Array.isArray(t?.registered)?t.registered:[],unused:Array.isArray(t?.unused)?t.unused:[],error:typeof t?.error=="string"?t.error:null,notice:typeof t?.notice=="string"?t.notice:null,fetchedAt:Date.now()},e.yeaftToolStatsLoading=!1;break}case"yeaft_debug_history":{let n=typeof t?.requestId=="string"?t.requestId:"",r=typeof t?.detailTurnId=="string"&&t.detailTurnId,i=r?e._yeaftDebugHistoryLatestDetailRequestId:e._yeaftDebugHistoryLatestListRequestId;if(i&&n!==i||!i&&n)break;e._fetchYeaftDebugHistoryTimer&&(clearTimeout(e._fetchYeaftDebugHistoryTimer),e._fetchYeaftDebugHistoryTimer=null),e._yeaftDebugHistoryInFlightKey=null;let o=Array.isArray(t?.turns)?t.turns:[],a=t?.search?Zh:Xh,l=r?o:o.slice(-a),c=new Set(l.map(h=>h?.turnId).filter(Boolean)),d=rv(Array.isArray(t?.loops)?t.loops:[]),u=r?d:d.filter(h=>!h?.turnId||c.has(h.turnId)),f=Array.isArray(t?.dreamEvents)?t.dreamEvents:[];e.yeaftDebugHistoryHasMore=!!t?.hasMore||!r&&o.length>l.length,!t?.detailTurnId&&Number.isFinite(t?.limit)&&t.limit>0&&(e.yeaftDebugHistoryLimit=Math.min(a,t.limit)),(!e.yeaftDebugTurnsById||typeof e.yeaftDebugTurnsById!="object")&&(e.yeaftDebugTurnsById={}),Array.isArray(e.yeaftDebugLoops)||(e.yeaftDebugLoops=[]),Array.isArray(e.yeaftDebugTurnOrder)||(e.yeaftDebugTurnOrder=[]);let p=r?{...e.yeaftDebugTurnsById}:{};for(let h of l){let M=h?.turnId;if(!M)continue;let x=p[M];if(x){let E=h?.detailsLoaded?{...x,...h}:{...h,...x};E.memoryLoaded==null&&x.memoryLoaded!=null&&(E.memoryLoaded=x.memoryLoaded),E.memoryAdjust==null&&x.memoryAdjust!=null&&(E.memoryAdjust=x.memoryAdjust),p[M]=E}else p[M]=h}e.yeaftDebugTurnsById=p;let g=h=>h?.loopInstanceId||`${h?.turnId||""}#${h?.loopNumber||0}`,m=e.yeaftDebugLoops,b=new Map;for(let h of m)h&&b.set(g(h),h);let I=new Set,y=[];for(let h of u){if(!h)continue;let M=g(h);I.add(M),y.push(b.get(M)||h)}if(r)for(let h of m)!h||I.has(g(h))||y.push(h);e.yeaftDebugLoops=y;let S=new Set,w=[],v=h=>{!h||S.has(h)||(S.add(h),w.push(h))};if(r){for(let h of e.yeaftDebugTurnOrder)v(h);for(let h of l)v(h?.turnId)}else for(let h of l)v(h?.turnId);e.yeaftDebugTurnOrder=r?w:w.slice(-a);for(let h of f){if(!h)continue;let M=null,x=h.sessionId||h.groupId;typeof h.target=="string"&&h.target.includes("/")?M=h.target:typeof x=="string"&&x?M=`group/${x}`:M="*",typeof e._appendDreamEvent=="function"&&e._appendDreamEvent(M,h),h.type==="dream_progress"&&typeof e.handleYeaftOutput=="function"&&e.handleYeaftOutput({event:h})}e.yeaftDebugHistoryLoading=!1,e.yeaftDebugHistoryError=typeof t?.error=="string"?t.error:null,e.yeaftDebugHistoryFetchedAt=Date.now();break}case"chat_image":t.conversationId&&t.fileId&&e.addMessageToConversation(t.conversationId,{type:"chat-image",fileId:t.fileId,previewToken:t.previewToken,mimeType:t.mimeType});break;case"error":{let n=t.conversationId||e.currentConversation,r=["Permission denied","Agent not found","No conversation selected","Agent is still syncing","No agent available","Agent access denied"].some(c=>t.message?.includes(c));if((t.message?.includes("Agent is still syncing")||t.message?.includes("Agent not found"))&&St(e),["No conversation selected","Agent is still syncing","No agent available"].some(c=>t.message?.includes(c))&&n&&(delete e.processingConversations[n],Ae(e,n),e.finishStreamingForConversation(n)),r&&n){let c=e.messagesMap[n];if(c&&c.length>0)for(let d=c.length-1;d>=0&&d>=c.length-5;d--){let u=c[d];if(u&&u.type==="error"&&u._sysErrBaseContent!==void 0){if(u._sysErrBaseContent===t.message&&Date.now()-(u._sysErrFirstAt||0)<=3e3){u._sysErrCount=(u._sysErrCount||1)+1,u.content=`${u._sysErrBaseContent} (\xD7${u._sysErrCount})`,u._sysErrRemoveTimer&&(clearTimeout(u._sysErrRemoveTimer),u._sysErrRemoveTimer=setTimeout(()=>{let f=e.messagesMap[n];if(f){let p=f.findIndex(g=>g.id===u.id);p>=0&&f.splice(p,1)}},5e3));return}break}}}let o=Date.now().toString()+Math.random().toString(36).substr(2,9),a={type:"error",content:t.message,transient:r,dbMessageId:r?"err_"+o:void 0};r&&(a._sysErrBaseContent=t.message,a._sysErrCount=1,a._sysErrFirstAt=Date.now()),e.addMessageToConversation(n,a);let l=null;if(r&&n){let c=e.messagesMap[n];c&&c.length>0&&(l=c[c.length-1])}if(r&&n&&l){let c=n,d="err_"+o;l._sysErrRemoveTimer=setTimeout(()=>{let u=e.messagesMap[c];if(u){let f=u.findIndex(p=>p.id===d);f>=0&&u.splice(f,1)}},5e3)}!r&&n&&(delete e.processingConversations[n],Ae(e,n),e.finishStreamingForConversation(n));break}case"history_sessions_list":if(t.requestId&&e._historySessionsRequestId&&t.requestId!==e._historySessionsRequestId)break;e.historySessions=t.sessions||[],e.historySessionsLoading=!1;break;case"folders_list":if(t.requestId&&e._foldersRequestId&&t.requestId!==e._foldersRequestId)break;e.folders=t.folders||[],e.foldersLoading=!1,e._foldersResolve&&(e._foldersResolve(),e._foldersResolve=null);break;case"models_list":if(t.requestId&&e._modelsRequestId&&t.requestId!==e._modelsRequestId)break;e.providerModels=t.models||[],e.providerModelsLoading=!1,e._modelsTimeout&&(clearTimeout(e._modelsTimeout),e._modelsTimeout=null),e._modelsResolve&&(e._modelsResolve(e.providerModels),e._modelsResolve=null);break;case"conversation_refresh":od(e,t);break;case"session_pinned":if(t.conversationId){let n=t.agentId?{agentId:t.agentId}:{};if(typeof e.setSessionPinned=="function")e.setSessionPinned(t.conversationId,!!t.pinned,n);else try{let r=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();r&&typeof r.applyPinState=="function"&&r.applyPinState(t.conversationId,!!t.pinned,t.agentId||e.yeaftSessionAgentById?.[t.conversationId]||e.currentAgent||null)}catch{}}break;case"execution_cancelled":ad(e,t);break;case"slash_commands_update":if(Array.isArray(t.slashCommands)){let n=[...new Set(t.slashCommands)];if(t.commandSet==="yeaft"){let r=t.conversationId&&t.conversationId!=="__preload__"?t.conversationId:null,i=t.agentId&&e.yeaftConversationIdsByAgent?.[t.agentId]||null,o=r||i;o&&(e.slashCommandsMap[o]=n);let a=e.yeaftConversationId||null,l=t.agentId?e.currentAgent===t.agentId&&(i===a||r===a):r===a;a&&l&&(e.slashCommandsMap[a]=n)}else t.conversationId&&(e.slashCommandsMap[t.conversationId]=n),t.agentId&&(e.slashCommandsMap[`agent:${t.agentId}`]=n)}t.slashCommandDescriptions&&(e.slashCommandDescriptions={...e.slashCommandDescriptions,...t.slashCommandDescriptions});break;case"compact_status":{let n=t.conversationId;e.compactStatus={conversationId:n,status:t.status,message:t.message},t.status==="completed"?setTimeout(()=>{e.compactStatus?.conversationId===n&&e.compactStatus?.status==="completed"&&(e.compactStatus=null)},3e3):t.status==="compacting"&&setTimeout(()=>{e.compactStatus?.conversationId===n&&e.compactStatus?.status==="compacting"&&(e.compactStatus=null)},3e4)}break;case"pong_session":{let n=t.conversationId;if(!n)break;if(e._pongTimeouts?.[n]&&(clearTimeout(e._pongTimeouts[n]),delete e._pongTimeouts[n]),t.status==="unsupported"){Ae(e,n),qc(e,n);break}if(t.status==="ok")e.sessionHealth?.[n]&&delete e.sessionHealth[n],!t.isProcessing&&e.processingConversations[n]&&(delete e.processingConversations[n],Ae(e,n),e.finishStreamingForConversation(n));else if(e.sessionHealth||(e.sessionHealth={}),e.sessionHealth[n]={status:t.status},t.status==="session-lost"||t.status==="cli-exited"){if(e._autoRefreshed||(e._autoRefreshed={}),!e._autoRefreshed[n]){e._autoRefreshed[n]=!0;let r=e.conversations.find(i=>i.id===n);e.sendWsMessage({type:"refresh_conversation",conversationId:n,agentId:r?.agentId})}delete e.processingConversations[n],Ae(e,n),e.finishStreamingForConversation(n)}break}case"ask_user_question":if(t.conversationId){let n=()=>{let r=e.messagesMap[t.conversationId]||[];for(let i=r.length-1;i>=0;i--)if(r[i].type==="tool-use"&&r[i].toolName==="AskUserQuestion"&&!r[i].askRequestId)return r[i].askRequestId=t.requestId,r[i].askQuestions=t.questions,!0;return!1};if(!n()){let r=0,i=setInterval(()=>{r++,(n()||r>=10)&&clearInterval(i)},200)}}break;case"restart_agent_ack":window.dispatchEvent(new CustomEvent("agent-restart-ack",{detail:{agentId:t.agentId}}));break;case"upgrade_agent_ack":window.dispatchEvent(new CustomEvent("agent-upgrade-ack",{detail:{agentId:t.agentId,success:t.success,error:t.error,alreadyLatest:t.alreadyLatest,version:t.version,reason:t.reason,currentNode:t.currentNode,requiredNode:t.requiredNode}}));break;case"terminal_created":case"terminal_output":case"terminal_closed":case"terminal_error":case"file_content":case"file_saved":case"directory_listing":case"git_status_result":case"git_diff_result":case"git_op_result":case"file_op_result":case"file_search_result":t.type,t.type,window.dispatchEvent(new CustomEvent("workbench-message",{detail:t}));break;case"server_updating":e.connectionState="updating";break;case"context_usage":e.contextUsage={inputTokens:t.inputTokens,maxTokens:t.maxTokens,percentage:t.percentage,conversationId:t.conversationId};break;case"mcp_servers_list":case"mcp_config_updated":t.agentId&&t.servers&&(e.mcpServers[t.agentId]=t.servers);break;case"expert_roles_list":t.roles&&(e.expertRoleDefinitions=t.roles);break;case"llm_models_discovered":t.agentId&&(e.llmModelDiscovery=e.llmModelDiscovery||{},e.llmModelDiscovery[t.agentId]=t);break;case"llm_config":case"llm_config_updated":if(t.agentId){let n=t.agentConfig||Qh(t),r=t.effectiveConfig||n;e.llmConfig[t.agentId]={providers:t.providers||r.providers||[],primaryModel:t.primaryModel||r.primaryModel||null,fastModel:t.fastModel||r.fastModel||null,language:t.language||n.language||r.language||"en",needsSetup:t.needsSetup??r.needsSetup??!1,agentConfig:n,effectiveConfig:r,requestId:t.requestId||null,statusRefreshError:t.statusRefreshError||null,error:t.error||null,loaded:!0}}break;case"models_dev_registry":if(e.modelsDevRegistry={registry:t.registry||{},fetchedAt:t.fetchedAt||Date.now(),error:t.error||null,loaded:!0},e._modelsDevPending){let n=e._modelsDevPending;e._modelsDevPending=null,n.timer&&clearTimeout(n.timer);for(let r of n.resolvers)r(e.modelsDevRegistry)}break;case"yeaft_settings":case"yeaft_settings_updated":t.agentId&&(e.yeaftSettings[t.agentId]={maxConcurrentThreads:t.maxConcurrentThreads??6,autoArchiveIdleDays:t.autoArchiveIdleDays??30,error:t.error||null,loaded:!0,at:Date.now()});break;case"search_settings":case"search_settings_updated":{let n={backend:t.backend||"tavily",tavilyKeyConfigured:!!t.tavilyKeyConfigured,tavilyKeyMasked:t.tavilyKeyMasked||null,disableHtmlFallback:!!t.disableHtmlFallback,error:t.error||null,loaded:!0,at:Date.now()};e.searchSettings=n;let r=e._searchPending,i=t.type==="search_settings"?"load":"update";r&&r[i]&&(r[i](n),delete r[i]);break}case"tavily_usage":{let n=t.error?{error:t.error}:{plan:t.plan,used:t.used,limit:t.limit,paygoUsed:t.paygoUsed,paygoLimit:t.paygoLimit};e.tavilyUsage=n,e.tavilyUsageLoading=!1;let r=e._searchPending;r&&r.usage&&(r.usage(n),delete r.usage);break}case"yeaft_mcp_list_result":case"yeaft_mcp_add_result":case"yeaft_mcp_remove_result":case"yeaft_mcp_reload_result":case"yeaft_mcp_updated":{if(Array.isArray(t.servers)&&(e.yeaftMcpServers=t.servers),t.runtime&&typeof t.runtime=="object"&&(e.yeaftMcpRuntime={connected:!!t.runtime.connected,toolCount:t.runtime.toolCount||0,perServer:Array.isArray(t.runtime.perServer)?t.runtime.perServer:[]}),e.yeaftMcpLoading=!1,e.yeaftMcpError=t.error||null,t.requestId){let n=e._mcpPending;n&&n[t.requestId]&&(n[t.requestId](t),delete n[t.requestId])}break}case"conversation_mcp_update":t.conversationId&&t.servers&&(e.conversationMcpServers[t.conversationId]=t.servers),t.conversationId&&t.serverTools&&(e.conversationMcpServerTools[t.conversationId]=t.serverTools);break;case"btw_stream":e.appendBtwDelta(t.delta);break;case"btw_done":e.btwLoading=!1,t.btwSessionId&&(e.btwSessionId=t.btwSessionId);break;case"btw_error":{let n=e.btwMessages[e.btwMessages.length-1];n&&n.role==="assistant"&&(n.content="Error: "+t.error),e.btwLoading=!1;break}case"background_task_started":case"background_task_output":break;case"subagent_started":t.conversationId&&t.subagentId&&e.addSubagent(t.conversationId,{id:t.subagentId,slug:t.slug,type:t.subagentType,description:t.description,parentToolUseId:t.parentToolUseId});break;case"subagent_message":t.conversationId&&t.subagentId&&t.message&&e.appendSubagentMessage(t.conversationId,t.subagentId,t.message);break;case"subagent_completed":t.conversationId&&t.subagentId&&e.completeSubagent(t.conversationId,t.subagentId);break}}var Xh,Zh,Jh,Ad=F(()=>{gt();Dr();$t();Gt();us();la();Qn();kd();Yr();Xh=1,Zh=5,Jh=500});function Td(){return Object.values(xd).sort((t,s)=>t.order-s.order).map(t=>({teamId:t.id,team:t,roles:Object.values(ht).filter(s=>s.group===t.id)}))}function Md(e){let t=[];for(let s of Object.values(ht)){t.push({roleId:s.id,roleName:s.name,roleTitle:s.title,actionId:null,actionName:null,searchText:`${s.name} ${s.fullName} ${s.title} ${s.titleEn}`.toLowerCase(),displayText:s.name,group:s.group});for(let n of s.actions)t.push({roleId:s.id,roleName:s.name,roleTitle:s.title,actionId:n.id,actionName:n.name,searchText:`${s.name} ${s.fullName} ${s.title} ${n.name} ${n.nameEn}`.toLowerCase(),displayText:`${s.name}\xB7${n.name}`,group:s.group})}if(e&&e.length>0){for(let s of e)if(t.push({roleId:s.id,roleName:s.name,roleTitle:s.title,actionId:null,actionName:null,searchText:`${s.name} ${s.fullName||""} ${s.title} ${s.titleEn||""}`.toLowerCase(),displayText:s.name,group:"custom"}),s.actions)for(let n of s.actions)t.push({roleId:s.id,roleName:s.name,roleTitle:s.title,actionId:n.id,actionName:n.name,searchText:`${s.name} ${s.fullName||""} ${s.title} ${n.name} ${n.nameEn||""}`.toLowerCase(),displayText:`${s.name}\xB7${n.name}`,group:"custom"})}return t}function bs(e,t){let s=ht[e.role];if(s){if(e.action){let n=s.actions.find(r=>r.id===e.action);return n?`${s.name}\xB7${n.name}`:s.name}return s.name}if(t){let n=t.find(r=>r.id===e.role);if(n){if(e.action){let r=n.actions?.find(i=>i.id===e.action);return r?`${n.name}\xB7${r.name}`:n.name}return n.name}}return e.role}function ua(e,t,s,n="zh-CN"){if(!e||e.length===0||!t||t.length===0)return null;let r=n==="zh-CN";if(!e.some(l=>!ht[l.role]&&t.some(c=>c.id===l.role)))return null;if(e.length===1){let{role:l,action:c}=e[0],d=t.find(f=>f.id===l);if(!d)return null;let u;if(c&&d.actions){let f=d.actions.find(p=>p.id===c);f?s?(u=(r?f.messageTemplate:f.messageTemplateEn)||"",u+=s):u=(r?f.defaultMessage:f.defaultMessageEn)||"":u=((r?d.messagePrefix:d.messagePrefixEn)||"")+(s||"")}else u=((r?d.messagePrefix:d.messagePrefixEn)||"")+(s||"");return{effectivePrompt:u}}let o=[];for(let{role:l,action:c}of e){let d=t.find(f=>f.id===l),u=ht[l];if(d)if(c){let f=d.actions?.find(p=>p.id===c);f&&o.push((r?f.messageTemplate:f.messageTemplateEn)||"")}else o.push((r?d.messagePrefix:d.messagePrefixEn)||"");else if(u)return null}return o.length===0?null:{effectivePrompt:o.join(`
|
|
3
|
+
${f}`:f,p=!0;break}}if(!p){for(let g=c.length-1;g>=0;g--)if(c[g].type==="tool-use"&&!c[g].hasResult){c[g].hasResult=!0,c[g].toolResult=f;break}}}r.currentTool=null}else if(!i&&(typeof a=="string"&&a.trim()||Array.isArray(s.message?.attachments)&&s.message.attachments.length>0)){let c=s.message?.clientMessageId||s.clientMessageId||null,d={type:"user",content:a,clientMessageId:c},u=e.messagesMap[t]||[];if(u.some(p=>jr(p,d))){if(c){for(let p=u.length-1;p>=0;p--)if(u[p].type==="user"&&u[p].clientMessageId===c){s.dbMessageId&&!u[p].dbMessageId&&(u[p].dbMessageId=s.dbMessageId),s.message?.id&&!u[p].messageId&&(u[p].id=s.message.id,u[p].messageId=s.message.id),s.ts&&!u[p].ts&&(u[p].ts=s.ts),pd(e,u[p],n);break}}}else{let p=e.addMessageToConversation(t,{...s.message?.id?{id:s.message.id,messageId:s.message.id}:{},...s.ts?{ts:s.ts}:{},type:"user",content:a,...s.message?.attachments?{attachments:s.message.attachments}:{},...s.message?.quote?{quote:s.message.quote}:{},...c?{clientMessageId:c}:{}});pd(e,p,n)}}}else if(s.type==="result"){delete e.processingConversations[t],Ae(e,t);let i=e.conversations.find(d=>d.id===t);i&&i.connecting&&(i.connecting=!1);let o=e._currentYeaftSessionId||null;if(e._currentYeaftTurnId){let d=Object.entries(e.activeVpTurns||{}).find(([,u])=>(u?.turnId===e._currentYeaftTurnId||!u?.turnId&&u===e.activeVpTurns[e._currentYeaftTurnId])&&(!e._currentYeaftAgentId||!u?.agentId||u.agentId===e._currentYeaftAgentId));if(d){let[u,f]=d,{[u]:p,...g}=e.activeVpTurns;!o&&f?.sessionId&&(o=f.sessionId),e.activeVpTurns=g}}if(o&&e._currentYeaftVpId&&e.vpStatuses){let d=e._currentYeaftTurnId||null,u={...e.vpStatuses||{}},f=!1;for(let[p,g]of Object.entries(u))!g||g.vpId!==e._currentYeaftVpId||e._currentYeaftAgentId&&g.agentId&&g.agentId!==e._currentYeaftAgentId||(g.sessionId||g.groupId||null)!==o||d&&g.turnId&&g.turnId!==d||(u[p]={...g,state:"idle",turnId:null,since:Date.now()},f=!0);f&&(e.vpStatuses=u)}o&&typeof e.clearYeaftSessionProcessingIfIdle=="function"&&e.clearYeaftSessionProcessingIfIdle(o,{agentId:e._currentYeaftAgentId||null}),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(t),r.currentTool=null,Qt(e,t);let a=e.messagesMap[t]||[],l=s.result_text||"";if(typeof l=="string"&&l.trim()){let d=!1;for(let u=a.length-1;u>=0;u--){if(a[u].type==="assistant"){d=!0;break}if(a[u].type==="user")break}d||e.appendToAssistantMessageForConversation(t,l.trim())}e.finishStreamingForConversation(t),!(n&&e.promoteCompletedYeaftHistoryOutline?.(t,e._currentYeaftTurnId||null,n))&&o&&n&&e.invalidateYeaftHistoryOutline?.(o,n),e.sweepStaleStreamingForConversation(t)}}var gd=F(()=>{Gt();Yr();jo()});function ys(e){if(e==null)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Gr(e,t){if(!t)return e??null;if(Object.prototype.hasOwnProperty.call(t,"base"))return ys(t.base)??null;if(Object.prototype.hasOwnProperty.call(t,"replacement"))return ys(t.replacement)??null;let s=e&&typeof e=="object"&&!Array.isArray(e)?ys(e):{};if(t.set&&typeof t.set=="object")for(let[n,r]of Object.entries(t.set))s[n]=ys(r);if(t.body&&typeof t.body=="object"){let n=s.body&&typeof s.body=="object"&&!Array.isArray(s.body)?{...s.body}:{};for(let[i,o]of Object.entries(t.body))i==="messages"||i==="messagesFrom"||i==="messagesAppend"||i==="messagesKey"||(n[i]=ys(o));let r=t.body.messagesKey==="messages"||t.body.messagesKey==="input"?t.body.messagesKey:Array.isArray(n.messages)||Object.prototype.hasOwnProperty.call(t.body,"messages")?"messages":"input";if(Array.isArray(t.body.messages))n[r]=ys(t.body.messages)||[];else if(Array.isArray(t.body.messagesAppend)){let i=Array.isArray(n[r])?n[r]:[],o=Number.isFinite(Number(t.body.messagesFrom))?Number(t.body.messagesFrom):i.length;n[r]=i.slice(0,o).concat(ys(t.body.messagesAppend)||[])}s.body=n}return s}function md(e,t){return!t||!Object.prototype.hasOwnProperty.call(t,"rawRequestDelta")?e??null:Gr(e??null,t.rawRequestDelta)}function Yn(e){if(!e)return 0;let t=typeof e=="string"?e:String(e),s=0,n=0;for(let r of t){let i=r.codePointAt(0)||0;i>=19968&&i<=40959||i>=12352&&i<=12447||i>=12448&&i<=12543||i>=44032&&i<=55215?s+=1:n+=1}return Math.ceil(s+n/4)}function Yh(e){let t=[],s=[];if(!e)return{messageText:t,toolText:s};let n=e.content;if(typeof n=="string")e.role==="tool"?s.push(n):t.push(n);else if(Array.isArray(n))for(let r of n){if(!r||typeof r!="object")continue;let i=r.type;if(i==="text"&&typeof r.text=="string")t.push(r.text);else if(i==="tool_use"){if(s.push(String(r.name||"")),r.input!==void 0)try{s.push(JSON.stringify(r.input))}catch{}}else if(i==="tool_result"){let o=r.content;if(typeof o=="string")s.push(o);else if(Array.isArray(o)){for(let a of o)if(a)if(typeof a=="string")s.push(a);else if(typeof a=="object"&&typeof a.text=="string")s.push(a.text);else try{s.push(JSON.stringify(a))}catch{}}else if(o!==void 0)try{s.push(JSON.stringify(o))}catch{}}else try{t.push(JSON.stringify(r))}catch{}}if(Array.isArray(e.toolCalls)){for(let r of e.toolCalls)if(r&&(s.push(String(r.name||"")),r.input!==void 0))try{s.push(JSON.stringify(r.input))}catch{}}return{messageText:t,toolText:s}}function hd(e){let t=0,s=0;if(e&&Array.isArray(e.messages))for(let i of e.messages){let{messageText:o,toolText:a}=Yh(i);for(let l of o)t+=Yn(l);for(let l of a)s+=Yn(l)}let n=0,r=0;if(e&&typeof e.response=="string"&&(n+=Yn(e.response)),e&&Array.isArray(e.toolCalls)){for(let i of e.toolCalls)if(i&&(r+=Yn(String(i.name||"")),i.input!==void 0))try{r+=Yn(JSON.stringify(i.input))}catch{}}return{inputMessageTokens:t,inputToolTokens:s,outputMessageTokens:n,outputToolTokens:r,inputTotalEstimated:t+s,outputTotalEstimated:n+r}}function aa(e,t,s){let n=Math.max(0,Math.floor(Number(e)||0)),r=Math.max(0,Number(t)||0),i=Math.max(0,Number(s)||0),o=r+i;if(n===0)return{message:0,tool:0};if(o===0)return{message:n,tool:0};let a=Math.round(r/o*n),l=Math.min(n,Math.max(0,a));return{message:l,tool:n-l}}function vd(e){if(e==null||e==="")return"";let t;if(typeof e=="number")t=e;else if(typeof e=="string"){let o=Date.parse(e);if(Number.isNaN(o)){let a=Number(e);if(!Number.isFinite(a))return"";t=a}else t=o}else return"";if(!Number.isFinite(t))return"";let s=new Date(t),n=String(s.getHours()).padStart(2,"0"),r=String(s.getMinutes()).padStart(2,"0"),i=String(s.getSeconds()).padStart(2,"0");return`${n}:${r}:${i}`}var la=F(()=>{});function mt(e,t){return!e||!t?"":`${e}${t}`}function Gn(e){let t=typeof e=="string"?e:String(e||"");if(!t)return{agentId:null,sessionId:null};let s=t.indexOf("");if(s<0)return{agentId:null,sessionId:t};let n=t.slice(0,s)||null,r=t.slice(s+1)||null;return{agentId:n,sessionId:r}}function ca(e){return e?`${e}`:""}function da(e,t){return!e||!t?"":`${e}${t}`}var Qn=F(()=>{});function Gh(e,t){if(!e||!!!t?.online)return!1;let n=!e.online,r=e.online&&e.version!=null&&t.version!=null&&e.version!==t.version;return n||r}function yd(e,t){let s=e.lastViewedConversation||localStorage.getItem("lastViewedConversation");if(!s)return!1;let n=e.conversations.find(i=>i.id===s);if(!n)return!1;let r=t?.agentId||e.currentAgent;return t&&(e.currentAgent=t.agentId,e.currentAgentInfo=t.agentInfo,e.sendWsMessage({type:"select_agent",agentId:t.agentId,silent:!0})),e.activeConversations=[s],e.currentWorkDir=n.workDir,e.messagesMap[s]=[],e.sendWsMessage({type:"select_conversation",conversationId:s}),e.requestChatHistory?.(s,{mode:"recent",turns:5}),e.sendWsMessage({type:"refresh_conversation",conversationId:s}),!0}function bd(e,t){let s=Array.isArray(e.agents)?e.agents:[],n=e._hasHandledAgentList===!0,r=e.currentAgent||null,i=!!(r&&s.some(a=>a&&a.id===r&&a.online));e.agents=t.agents,e._hasHandledAgentList=!0;let o=e.currentAgent||null;if(o){let a=e._yeaftAgentSeen&&e._yeaftAgentSeen.id===o?e._yeaftAgentSeen:null,l=t.agents.find(c=>c.id===o)||null;e.currentView==="yeaft"&&Gh(a,l)&&(e._yeaftReconnectCatchUpPending=!0),l?e._yeaftAgentSeen={id:o,online:!!l.online,version:l.version!=null?l.version:null}:a?a.online&&(e._yeaftAgentSeen={id:o,online:!1,version:a.version}):e._yeaftAgentSeen={id:o,online:!1,version:null}}{let a=new Set(t.agents.map(l=>l.id));for(let l of t.agents)e.proxyPorts[l.id]=l.proxyPorts||[],l.yeaftStatus&&typeof e.cacheYeaftAgentStatus=="function"&&e.cacheYeaftAgentStatus(l.id,l.yeaftStatus);for(let l of Object.keys(e.proxyPorts))a.has(l)||delete e.proxyPorts[l]}if(e.currentAgent){let a=t.agents.find(l=>l.id===e.currentAgent);a&&(e.currentAgentInfo=a)}if(e.currentView==="yeaft"&&!e.currentAgent){let a=t.agents.find(l=>l.online);a&&(e.currentAgent=a.id,e.currentAgentInfo=a)}if(e.currentView==="yeaft"&&typeof e.loadOpenedYeaftSessionsForConnectedAgents=="function"){let a=t.agents.filter(l=>l&&l.online&&l.id).map(l=>l.id);e.loadOpenedYeaftSessionsForConnectedAgents(a)}{let a=[],l=new Set;for(let d of t.agents)for(let u of d.conversations||[])l.has(u.id)||(l.add(u.id),a.push({...u,type:u.type,agentId:d.id,agentName:d.name}),u.title&&(u.customTitle&&(e.customConversationTitles[u.id]=u.title),e.conversationTitles[u.id]||(e.conversationTitles[u.id]=u.title)));for(let d of a){d.agentOnline=!0;let u=e.conversations.find(f=>f.id===d.id);if(u)u.claudeSessionId=d.claudeSessionId||u.claudeSessionId,u.processing=d.processing,u.userId=d.userId,u.username=d.username,u.agentId=d.agentId,u.agentName=d.agentName,u.agentOnline=!0,d.type&&(u.type=d.type),d.name!==void 0&&(u.name=d.name);else{let f=e._recentlyDeletedSessions?.[d.id];if(f&&Date.now()-f<15e3)continue;e.conversations.push(d)}d.pinned&&!e.pinnedSessions.includes(d.id)&&e.pinnedSessions.push(d.id)}let c=new Set(t.agents.map(d=>d.id));e.conversations=e.conversations.filter(d=>{if(l.has(d.id)||e.activeConversations.includes(d.id))return!0;if(d.agentId&&c.has(d.agentId)){let u=e._recentlyDeletedSessions?.[d.id];return u&&Date.now()-u<15e3||(delete e.messagesMap[d.id],delete e.processingConversations[d.id],Ae(e,d.id),delete e.executionStatusMap[d.id]),!1}return d.agentId&&!c.has(d.agentId)&&(d.agentOnline=!1),!0});for(let d of a)if(d.processing&&!fs(e,d.id)&&!e._turnCompletedConvs?.has(d.id))e.processingConversations[d.id]=!0;else if(e.processingConversations[d.id]){delete e.processingConversations[d.id],Ae(e,d.id);let u=e.executionStatusMap[d.id];u&&(u.currentTool=null),e.finishStreamingForConversation(d.id)}for(let d of Object.keys(e.processingConversations))if(!l.has(d)){if(d.startsWith("yeaft-"))continue;delete e.processingConversations[d],Ae(e,d);let u=e.executionStatusMap[d];u&&(u.currentTool=null),e.finishStreamingForConversation(d)}}if(localStorage.setItem("pinned-sessions",JSON.stringify(e.pinnedSessions)),e._closedAt){let a=Date.now();for(let l of Object.keys(e._closedAt))a-e._closedAt[l]>3e4&&(delete e._closedAt[l],e._turnCompletedConvs?.delete(l))}if(e.currentAgent){let a=t.agents.find(l=>l.id===e.currentAgent&&l.online);if(a){let l=!!e._yeaftReconnectCatchUpPending,d=l||n&&!i;if(e.currentAgentInfo=a,d&&(e._offlineConversationRestoreKey=null,e.sendWsMessage({type:"select_agent",agentId:e.currentAgent,silent:!0})),e.currentView==="yeaft"&&typeof e.requestYeaftSessionBootstrap=="function"){e._yeaftReconnectCatchUpPending=!1;let u=l||!e.yeaftSessionReady||!e.yeaftModel||!e.yeaftStatus;(u||l)&&e.requestYeaftSessionBootstrap({forceSessionReady:u,catchUpHistory:l})}if(!d)return;if(e.currentConversation){let u=e.conversations.find(g=>g.id===e.currentConversation);e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation});let f=e.messagesMap[e.currentConversation]||[],p=ps(f);p!=null?e.requestChatHistory?.(e.currentConversation,{mode:"delta",afterMessageId:p}):e.requestChatHistory?.(e.currentConversation,{mode:"recent",turns:5}),e.sendWsMessage({type:"refresh_conversation",conversationId:e.currentConversation})}else e.recoveryDismissed||yd(e);return}else{let l=`${e.currentAgent||""}:${e.currentConversation||""}`;e.currentConversation&&(!n||i||e._offlineConversationRestoreKey!==l)&&(e._offlineConversationRestoreKey=l,e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation}));return}}if(!e.currentConversation&&!e.currentAgent&&!e.recoveryDismissed){let a=e.lastViewedConversation||localStorage.getItem("lastViewedConversation"),l=e.lastUsedAgent;if(a){let c=e.conversations.find(d=>d.id===a);if(c){let d=t.agents.find(u=>u.id===c.agentId&&u.online);if(d){yd(e,{agentId:c.agentId,agentInfo:d});return}}}l&&(e.agents.find(d=>d.id===l&&d.online)?e.selectAgent(l):e.checkPendingRecovery())}}function wd(e,t){let s=e.pendingAgentSelection||null;if(s){if(!(typeof t.requestId=="string"&&t.requestId?t.requestId===s.requestId:t.agentId===s.agentId))return!1;if(e.pendingAgentSelection=null,t.ok===!1)return e.agentSwitching=!1,!1}else{if(t.requestId)return!1;if(e.currentAgent&&t.agentId!==e.currentAgent)return!1}e.agentSwitching=!1;let n=e.currentAgent===t.agentId,r={id:t.agentId,name:t.agentName,workDir:t.workDir,capabilities:t.capabilities||["terminal","file_editor","background_tasks"],version:t.version||null};if(typeof e.activateYeaftAgent=="function"?e.activateYeaftAgent(t.agentId,r):(e.currentAgent=t.agentId,e.currentAgentInfo=r),Array.isArray(t.slashCommands)){let u=[...new Set(t.slashCommands)];e.slashCommandsMap[`agent:${t.agentId}`]=u}t.slashCommandDescriptions&&(e.slashCommandDescriptions={...e.slashCommandDescriptions,...t.slashCommandDescriptions});let i=t.conversations||[],o=new Set,a=i.filter(u=>o.has(u.id)?!1:(o.add(u.id),!0)).map(u=>({...u,agentId:t.agentId,agentName:t.agentName}));if(n&&e.currentConversation){let u=i.find(f=>f.id===e.currentConversation);u&&!a.find(f=>f.id===u.id)&&a.push({...u,agentId:t.agentId,agentName:t.agentName})}let l=new Set(a.map(u=>u.id)),c=e.conversations.filter(u=>!l.has(u.id));e.conversations=[...c,...a];for(let u of i)u.title&&(u.customTitle&&(e.customConversationTitles[u.id]=u.title),e.conversationTitles[u.id]||(e.conversationTitles[u.id]=u.title));let d=new Set(i.map(u=>u.id));for(let u of i)if(u.processing&&!fs(e,u.id)&&!e._turnCompletedConvs?.has(u.id))e.processingConversations[u.id]=!0;else if(e.processingConversations[u.id]){delete e.processingConversations[u.id],Ae(e,u.id);let f=e.executionStatusMap[u.id];f&&(f.currentTool=null),e.finishStreamingForConversation(u.id)}for(let u of Object.keys(e.processingConversations))if(!d.has(u)){if(u.startsWith("yeaft-"))continue;if(!c.some(p=>p.id===u)){delete e.processingConversations[u],Ae(e,u);let p=e.executionStatusMap[u];p&&(p.currentTool=null),e.finishStreamingForConversation(u)}}if(e.currentView!=="yeaft"){if(n&&e.currentConversation){let u=e.conversations.find(f=>f.id===e.currentConversation);e.currentWorkDir=u?.workDir||e.currentWorkDir||t.workDir,St(e),e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation})}else{e.activeConversations=[],e.currentWorkDir=t.workDir;let u=e.lastViewedConversation||localStorage.getItem("lastViewedConversation");u&&e.conversations.find(f=>f.id===u)&&(e.autoRestoreConversation(u),e.pendingRecovery=null)}ac(e)}return!0}var kd=F(()=>{Gt();us();Fn()});function Qh(e={}){return{providers:e.providers||[],primaryModel:e.primaryModel||null,fastModel:e.fastModel||null,language:e.language||"en"}}function Sd(){return window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore()}function ev(e,t){let s=t.agentId||null,n=Array.isArray(e.yeaftSessionHydrateSlices)?e.yeaftSessionHydrateSlices.filter(r=>r.agentId!==s):[];e.yeaftSessionHydrateSlices=[...n,{agentId:s,sessions:Array.isArray(t.sessions)?t.sessions:[]}]}function tv(e){let t=Sd(),s=null;try{s=localStorage.getItem("lastViewedYeaftSession")||null}catch{}let n=Gn(s),r=e.yeaftActiveSessionFilter||t?.activeSessionId||null;if(r){let i=t?.activeSessionKey?t.sessions?.[t.activeSessionKey]:null;return i?.id===r&&i.agentId?{sessionId:r,agentId:i.agentId}:n.sessionId===r&&n.agentId?n:{sessionId:r,agentId:null}}return n}function Id(e){let t=Sd(),s=tv(e);typeof t?.beginInventoryCommit=="function"?t.beginInventoryCommit(s.sessionId,s.agentId):typeof t?.resetInventory=="function"&&t.resetInventory();let n=Array.isArray(e.yeaftSessionHydrateSlices)?e.yeaftSessionHydrateSlices:[],r=s.agentId?[...n.filter(i=>i.agentId===s.agentId),...n.filter(i=>i.agentId!==s.agentId)]:n;r.length===0&&t?.applySnapshot?.([],null),r.forEach((i,o)=>{t?.applySnapshot?.(i.sessions||[],i.agentId||null,{deferActivation:o<r.length-1})}),e.yeaftSessionHydrateSlices=[]}function sv(e){let t=e.yeaftSessionHydrateRequestId||null;e.yeaftSessionInventoryCompleteSupported!==!1||!t||(clearTimeout(e._legacyYeaftSessionHydrateTimer),e._legacyYeaftSessionHydrateTimer=setTimeout(()=>{e.yeaftSessionHydrateRequestId===t&&(e._legacyYeaftSessionHydrateTimer=null,Id(e),e._hasHandledYeaftSessionHydrate=!0,e.yeaftSessionHydrateRequestId=null,e.yeaftSessionHydrateError=null,e._yeaftSessionInventorySocketQuarantined=!0)},Jh))}function nv(e,t={}){let s=e||{systemPrompt:"",messages:[],rawRequest:null},n={systemPrompt:s.systemPrompt||"",messages:Array.isArray(s.messages)?[...s.messages]:[],rawRequest:s.rawRequest??null};if(t?.base){let r={systemPrompt:t.systemPrompt||"",messages:Array.isArray(t.messages)?t.messages:[],rawRequest:null};return Object.prototype.hasOwnProperty.call(t,"rawRequestDelta")&&(r.rawRequest=Gr(null,t.rawRequestDelta)),r}if(typeof t?.systemPrompt=="string"&&(n.systemPrompt=t.systemPrompt),Array.isArray(t?.messages))n.messages=t.messages;else if(Array.isArray(t?.messagesAppend)){let r=Number.isFinite(Number(t.messagesFrom))?Number(t.messagesFrom):n.messages.length;n.messages=n.messages.slice(0,r).concat(t.messagesAppend)}return Object.prototype.hasOwnProperty.call(t||{},"rawRequestDelta")&&(n.rawRequest=Gr(n.rawRequest,t.rawRequestDelta)),n}function rv(e=[]){let t=new Map;return e.map(s=>{if(!s||!s.requestDelta)return s;let n=s.turnId||"__unknown__",r=t.get(n)||s.requestBase||null,i=r?.rawRequest??null,o=nv(r,s.requestDelta);return t.set(n,o),{...s,systemPrompt:typeof s.systemPrompt=="string"&&s.systemPrompt?s.systemPrompt:o.systemPrompt,messages:Array.isArray(s.messages)&&s.messages.length>0?s.messages:o.messages,rawRequest:s.rawRequest??null,rawRequestBase:i}})}function Cd(e,t){let s=De();switch(e._lastPongAt=Date.now(),t.type){case"work_center_response":{let n=t.requestId?e.workCenterPending[t.requestId]:null;if(!n)break;clearTimeout(n.timer),delete e.workCenterPending[t.requestId],t.ok?n.resolve(t.data):n.reject(new Error(t.error||"Work Center request failed"));break}case"work_center_event":e.applyWorkCenterEvent(t.agentId,t.event);break;case"auth_result":if(t.success){if(e.authenticated=!0,t.sessionKey&&(e.sessionKey=pt(t.sessionKey),s.setSessionKey(t.sessionKey)),t.acceptPlaintext===!0&&(e.serverEncryptionRequired=!1),e.yeaftSessionInventoryCompleteSupported=t.yeaftSessionInventoryComplete===!0,e.yeaftSessionHydrateSlices=[],e._hasHandledYeaftSessionHydrate=!1,e.yeaftSessionHydrateError=null,t.role&&(s.role=t.role),typeof e.requestYeaftSessionInventory=="function")e.requestYeaftSessionInventory();else{let n=e.conversations.map(r=>r.id).filter(Boolean);e.sendWsMessage({type:"get_agents",conversationIds:n.length>0?n:void 0})}e.checkPendingRecovery()}else e.addMessage({type:"error",content:t.error||Le("login.error.loginFailed")}),s.handleAuthFailure?.(void 0,t._wsAuthToken,t._wsAuthGeneration);break;case"agent_list":bd(e,t),e.workCenterOpen&&e.workCenterAgentId&&e.listWorkItems(e.workCenterAgentId).catch(()=>{});break;case"yeaft_session_hydrate":{if(e.yeaftSessionInventoryCompleteSupported===!0&&(!t.requestId||t.requestId!==e.yeaftSessionHydrateRequestId)||e.yeaftSessionInventoryCompleteSupported!==!0&&!e.yeaftSessionHydrateRequestId||t.requestId&&e.yeaftSessionHydrateRequestId&&t.requestId!==e.yeaftSessionHydrateRequestId)break;ev(e,t),e.yeaftSessionInventoryCompleteSupported!==!0&&sv(e);break}case"yeaft_session_hydrate_complete":if(e.yeaftSessionInventoryCompleteSupported===!0&&(!t.requestId||t.requestId!==e.yeaftSessionHydrateRequestId)||e.yeaftSessionHydrateRequestId&&!t.requestId||t.requestId&&e.yeaftSessionHydrateRequestId&&t.requestId!==e.yeaftSessionHydrateRequestId)break;clearTimeout(e._legacyYeaftSessionHydrateTimer),e._legacyYeaftSessionHydrateTimer=null,t.ok!==!1?Id(e):e.yeaftSessionHydrateSlices=[],e.yeaftSessionHydrateRequestId=null,e._hasHandledYeaftSessionHydrate=t.ok!==!1,e.yeaftSessionHydrateError=t.ok===!1?t.error||"session_inventory_failed":null;break;case"session_catalog_snapshot":e.applySessionCatalogSnapshot(t.catalog,t.projectsAuthoritative===!0?t.projects:null,t.hiddenCatalog);break;case"session_ui_metadata_updated":e.finishSessionCatalogMutation?.(t);break;case"session_catalog_reorder_result":e.finishSessionCatalogMutation?.(t);break;case"agent_selected":if(!wd(e,t))break;e.workCenterOpen&&e.workCenterAgentId&&e.listWorkItems(e.workCenterAgentId).catch(()=>{});break;case"conversation_created":sd(e,t);break;case"conversation_resumed":nd(e,t);break;case"conversation_selected":if(e.currentConversation===t.conversationId)return;e.activeConversations=[t.conversationId];{let n=e.conversations.find(r=>r.id===t.conversationId);n&&(e.currentWorkDir=n.workDir)}e.messagesMap[t.conversationId]=[],e.saveOpenSessions();break;case"conversation_settings_updated":{let n=e.conversations.find(i=>i.id===t.conversationId);n&&t.disallowedTools!==void 0&&(n.disallowedTools=t.disallowedTools);let r=e.conversationMcpServers[t.conversationId];if(r&&t.disallowedTools){let i=new Set(t.disallowedTools),o=e.conversationMcpServerTools[t.conversationId]||{};for(let a of r){let l=o[a.name];l&&l.length>0?a.enabled=!l.some(c=>i.has(c)):a.enabled=!i.has(`mcp__${a.name}`)}}t.needRestart&&n&&(n.needRestart=!0);break}case"sync_messages_result":ld(e,t);break;case"conversation_deleted":ia(e,t);break;case"conversation_delete_result":t.ok&&ia(e,t);break;case"turn_completed":rd(e,t);break;case"conversation_closed":id(e,t);break;case"claude_output":e.handleAssistantOutputFrame(t.conversationId,t.data);break;case"yeaft_output":case"yeaft_session_output":case"session_output":e.handleYeaftOutput(t);break;case"yeaft_asset_ready":{let n=t.conversationId||e.yeaftConversationIdsByAgent?.[t.agentId]||e.yeaftConversationId;if(!n||!t.image)break;e.messagesMap[n]||(e.messagesMap[n]=[]),e.messagesMap[n].some(i=>i?.type==="chat-image"&&i.assetId===t.image.assetId&&i.sessionId===t.sessionId&&i.turnId===t.turnId)||e.addMessageToConversation(n,{type:"chat-image",...t.image,sessionId:t.sessionId||null,vpId:t.vpId||null,speakerVpId:t.vpId||null,turnId:t.turnId||null,threadId:t.threadId||null});break}case"yeaft_history_chunk":ud(e,t);break;case"yeaft_history_outline":e.handleYeaftHistoryOutline(t);break;case"yeaft_history_search_result":e.handleYeaftHistorySearchResult(t);break;case"yeaft_history_window":{if(!e.pendingYeaftHistoryWindow?.(t))break;let n=t.error?null:cd(e,t);e.handleYeaftHistoryWindow(t,n);break}case"yeaft_tool_stats":{e._fetchYeaftToolStatsTimer&&(clearTimeout(e._fetchYeaftToolStatsTimer),e._fetchYeaftToolStatsTimer=null);let n=t?.snapshot,r=n&&typeof n=="object"&&!Array.isArray(n)?n:{};e.yeaftToolStats={snapshot:r,registered:Array.isArray(t?.registered)?t.registered:[],unused:Array.isArray(t?.unused)?t.unused:[],error:typeof t?.error=="string"?t.error:null,notice:typeof t?.notice=="string"?t.notice:null,fetchedAt:Date.now()},e.yeaftToolStatsLoading=!1;break}case"yeaft_debug_history":{let n=typeof t?.requestId=="string"?t.requestId:"",r=typeof t?.detailTurnId=="string"&&t.detailTurnId,i=r?e._yeaftDebugHistoryLatestDetailRequestId:e._yeaftDebugHistoryLatestListRequestId;if(i&&n!==i||!i&&n)break;e._fetchYeaftDebugHistoryTimer&&(clearTimeout(e._fetchYeaftDebugHistoryTimer),e._fetchYeaftDebugHistoryTimer=null),e._yeaftDebugHistoryInFlightKey=null;let o=Array.isArray(t?.turns)?t.turns:[],a=t?.search?Zh:Xh,l=r?o:o.slice(-a),c=new Set(l.map(h=>h?.turnId).filter(Boolean)),d=rv(Array.isArray(t?.loops)?t.loops:[]),u=r?d:d.filter(h=>!h?.turnId||c.has(h.turnId)),f=Array.isArray(t?.dreamEvents)?t.dreamEvents:[];e.yeaftDebugHistoryHasMore=!!t?.hasMore||!r&&o.length>l.length,!t?.detailTurnId&&Number.isFinite(t?.limit)&&t.limit>0&&(e.yeaftDebugHistoryLimit=Math.min(a,t.limit)),(!e.yeaftDebugTurnsById||typeof e.yeaftDebugTurnsById!="object")&&(e.yeaftDebugTurnsById={}),Array.isArray(e.yeaftDebugLoops)||(e.yeaftDebugLoops=[]),Array.isArray(e.yeaftDebugTurnOrder)||(e.yeaftDebugTurnOrder=[]);let p=r?{...e.yeaftDebugTurnsById}:{};for(let h of l){let M=h?.turnId;if(!M)continue;let x=p[M];if(x){let E=h?.detailsLoaded?{...x,...h}:{...h,...x};E.memoryLoaded==null&&x.memoryLoaded!=null&&(E.memoryLoaded=x.memoryLoaded),E.memoryAdjust==null&&x.memoryAdjust!=null&&(E.memoryAdjust=x.memoryAdjust),p[M]=E}else p[M]=h}e.yeaftDebugTurnsById=p;let g=h=>h?.loopInstanceId||`${h?.turnId||""}#${h?.loopNumber||0}`,m=e.yeaftDebugLoops,b=new Map;for(let h of m)h&&b.set(g(h),h);let I=new Set,y=[];for(let h of u){if(!h)continue;let M=g(h);I.add(M),y.push(b.get(M)||h)}if(r)for(let h of m)!h||I.has(g(h))||y.push(h);e.yeaftDebugLoops=y;let S=new Set,w=[],v=h=>{!h||S.has(h)||(S.add(h),w.push(h))};if(r){for(let h of e.yeaftDebugTurnOrder)v(h);for(let h of l)v(h?.turnId)}else for(let h of l)v(h?.turnId);e.yeaftDebugTurnOrder=r?w:w.slice(-a);for(let h of f){if(!h)continue;let M=null,x=h.sessionId||h.groupId;typeof h.target=="string"&&h.target.includes("/")?M=h.target:typeof x=="string"&&x?M=`group/${x}`:M="*",typeof e._appendDreamEvent=="function"&&e._appendDreamEvent(M,h),h.type==="dream_progress"&&typeof e.handleYeaftOutput=="function"&&e.handleYeaftOutput({event:h})}e.yeaftDebugHistoryLoading=!1,e.yeaftDebugHistoryError=typeof t?.error=="string"?t.error:null,e.yeaftDebugHistoryFetchedAt=Date.now();break}case"chat_image":t.conversationId&&t.fileId&&e.addMessageToConversation(t.conversationId,{type:"chat-image",fileId:t.fileId,previewToken:t.previewToken,mimeType:t.mimeType});break;case"error":{let n=t.conversationId||e.currentConversation,r=["Permission denied","Agent not found","No conversation selected","Agent is still syncing","No agent available","Agent access denied"].some(c=>t.message?.includes(c));if((t.message?.includes("Agent is still syncing")||t.message?.includes("Agent not found"))&&St(e),["No conversation selected","Agent is still syncing","No agent available"].some(c=>t.message?.includes(c))&&n&&(delete e.processingConversations[n],Ae(e,n),e.finishStreamingForConversation(n)),r&&n){let c=e.messagesMap[n];if(c&&c.length>0)for(let d=c.length-1;d>=0&&d>=c.length-5;d--){let u=c[d];if(u&&u.type==="error"&&u._sysErrBaseContent!==void 0){if(u._sysErrBaseContent===t.message&&Date.now()-(u._sysErrFirstAt||0)<=3e3){u._sysErrCount=(u._sysErrCount||1)+1,u.content=`${u._sysErrBaseContent} (\xD7${u._sysErrCount})`,u._sysErrRemoveTimer&&(clearTimeout(u._sysErrRemoveTimer),u._sysErrRemoveTimer=setTimeout(()=>{let f=e.messagesMap[n];if(f){let p=f.findIndex(g=>g.id===u.id);p>=0&&f.splice(p,1)}},5e3));return}break}}}let o=Date.now().toString()+Math.random().toString(36).substr(2,9),a={type:"error",content:t.message,transient:r,dbMessageId:r?"err_"+o:void 0};r&&(a._sysErrBaseContent=t.message,a._sysErrCount=1,a._sysErrFirstAt=Date.now()),e.addMessageToConversation(n,a);let l=null;if(r&&n){let c=e.messagesMap[n];c&&c.length>0&&(l=c[c.length-1])}if(r&&n&&l){let c=n,d="err_"+o;l._sysErrRemoveTimer=setTimeout(()=>{let u=e.messagesMap[c];if(u){let f=u.findIndex(p=>p.id===d);f>=0&&u.splice(f,1)}},5e3)}!r&&n&&(delete e.processingConversations[n],Ae(e,n),e.finishStreamingForConversation(n));break}case"history_sessions_list":if(t.requestId&&e._historySessionsRequestId&&t.requestId!==e._historySessionsRequestId)break;e.historySessions=t.sessions||[],e.historySessionsLoading=!1;break;case"folders_list":if(t.requestId&&e._foldersRequestId&&t.requestId!==e._foldersRequestId)break;e.folders=t.folders||[],e.foldersLoading=!1,e._foldersResolve&&(e._foldersResolve(),e._foldersResolve=null);break;case"models_list":if(t.requestId&&e._modelsRequestId&&t.requestId!==e._modelsRequestId)break;e.providerModels=t.models||[],e.providerModelsLoading=!1,e._modelsTimeout&&(clearTimeout(e._modelsTimeout),e._modelsTimeout=null),e._modelsResolve&&(e._modelsResolve(e.providerModels),e._modelsResolve=null);break;case"conversation_refresh":od(e,t);break;case"session_pinned":if(t.conversationId){let n=t.agentId?{agentId:t.agentId}:{};if(typeof e.setSessionPinned=="function")e.setSessionPinned(t.conversationId,!!t.pinned,n);else try{let r=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();r&&typeof r.applyPinState=="function"&&r.applyPinState(t.conversationId,!!t.pinned,t.agentId||e.yeaftSessionAgentById?.[t.conversationId]||e.currentAgent||null)}catch{}}break;case"execution_cancelled":ad(e,t);break;case"slash_commands_update":if(Array.isArray(t.slashCommands)){let n=[...new Set(t.slashCommands)];if(t.commandSet==="yeaft"){let r=t.conversationId&&t.conversationId!=="__preload__"?t.conversationId:null,i=t.agentId&&e.yeaftConversationIdsByAgent?.[t.agentId]||null,o=r||i;o&&(e.slashCommandsMap[o]=n);let a=e.yeaftConversationId||null,l=t.agentId?e.currentAgent===t.agentId&&(i===a||r===a):r===a;a&&l&&(e.slashCommandsMap[a]=n)}else t.conversationId&&(e.slashCommandsMap[t.conversationId]=n),t.agentId&&(e.slashCommandsMap[`agent:${t.agentId}`]=n)}t.slashCommandDescriptions&&(e.slashCommandDescriptions={...e.slashCommandDescriptions,...t.slashCommandDescriptions});break;case"compact_status":{let n=t.conversationId;e.compactStatus={conversationId:n,status:t.status,message:t.message},t.status==="completed"?setTimeout(()=>{e.compactStatus?.conversationId===n&&e.compactStatus?.status==="completed"&&(e.compactStatus=null)},3e3):t.status==="compacting"&&setTimeout(()=>{e.compactStatus?.conversationId===n&&e.compactStatus?.status==="compacting"&&(e.compactStatus=null)},3e4)}break;case"pong_session":{let n=t.conversationId;if(!n)break;if(e._pongTimeouts?.[n]&&(clearTimeout(e._pongTimeouts[n]),delete e._pongTimeouts[n]),t.status==="unsupported"){Ae(e,n),Bc(e,n);break}if(t.status==="ok")e.sessionHealth?.[n]&&delete e.sessionHealth[n],!t.isProcessing&&e.processingConversations[n]&&(delete e.processingConversations[n],Ae(e,n),e.finishStreamingForConversation(n));else if(e.sessionHealth||(e.sessionHealth={}),e.sessionHealth[n]={status:t.status},t.status==="session-lost"||t.status==="cli-exited"){if(e._autoRefreshed||(e._autoRefreshed={}),!e._autoRefreshed[n]){e._autoRefreshed[n]=!0;let r=e.conversations.find(i=>i.id===n);e.sendWsMessage({type:"refresh_conversation",conversationId:n,agentId:r?.agentId})}delete e.processingConversations[n],Ae(e,n),e.finishStreamingForConversation(n)}break}case"ask_user_question":if(t.conversationId){let n=()=>{let r=e.messagesMap[t.conversationId]||[];for(let i=r.length-1;i>=0;i--)if(r[i].type==="tool-use"&&r[i].toolName==="AskUserQuestion"&&!r[i].askRequestId)return r[i].askRequestId=t.requestId,r[i].askQuestions=t.questions,!0;return!1};if(!n()){let r=0,i=setInterval(()=>{r++,(n()||r>=10)&&clearInterval(i)},200)}}break;case"restart_agent_ack":window.dispatchEvent(new CustomEvent("agent-restart-ack",{detail:{agentId:t.agentId}}));break;case"upgrade_agent_ack":window.dispatchEvent(new CustomEvent("agent-upgrade-ack",{detail:{agentId:t.agentId,success:t.success,error:t.error,alreadyLatest:t.alreadyLatest,version:t.version,reason:t.reason,currentNode:t.currentNode,requiredNode:t.requiredNode}}));break;case"terminal_created":case"terminal_output":case"terminal_closed":case"terminal_error":case"file_content":case"file_saved":case"directory_listing":case"git_status_result":case"git_diff_result":case"git_op_result":case"file_op_result":case"file_search_result":t.type,t.type,window.dispatchEvent(new CustomEvent("workbench-message",{detail:t}));break;case"server_updating":e.connectionState="updating";break;case"context_usage":e.contextUsage={inputTokens:t.inputTokens,maxTokens:t.maxTokens,percentage:t.percentage,conversationId:t.conversationId};break;case"mcp_servers_list":case"mcp_config_updated":t.agentId&&t.servers&&(e.mcpServers[t.agentId]=t.servers);break;case"expert_roles_list":t.roles&&(e.expertRoleDefinitions=t.roles);break;case"llm_models_discovered":t.agentId&&(e.llmModelDiscovery=e.llmModelDiscovery||{},e.llmModelDiscovery[t.agentId]=t);break;case"llm_config":case"llm_config_updated":if(t.agentId){let n=t.agentConfig||Qh(t),r=t.effectiveConfig||n;e.llmConfig[t.agentId]={providers:t.providers||r.providers||[],primaryModel:t.primaryModel||r.primaryModel||null,fastModel:t.fastModel||r.fastModel||null,language:t.language||n.language||r.language||"en",needsSetup:t.needsSetup??r.needsSetup??!1,agentConfig:n,effectiveConfig:r,requestId:t.requestId||null,statusRefreshError:t.statusRefreshError||null,error:t.error||null,loaded:!0}}break;case"models_dev_registry":if(e.modelsDevRegistry={registry:t.registry||{},fetchedAt:t.fetchedAt||Date.now(),error:t.error||null,loaded:!0},e._modelsDevPending){let n=e._modelsDevPending;e._modelsDevPending=null,n.timer&&clearTimeout(n.timer);for(let r of n.resolvers)r(e.modelsDevRegistry)}break;case"yeaft_settings":case"yeaft_settings_updated":t.agentId&&(e.yeaftSettings[t.agentId]={maxConcurrentThreads:t.maxConcurrentThreads??6,autoArchiveIdleDays:t.autoArchiveIdleDays??30,error:t.error||null,loaded:!0,at:Date.now()});break;case"telemetry_settings":case"telemetry_settings_updated":{let n={enabled:t.enabled!==!1,retentionDays:t.retentionDays??3,flushIntervalMs:t.flushIntervalMs??1e3,maxQueueSize:t.maxQueueSize??5e3,rawExchangeMaxBytes:t.rawExchangeMaxBytes??524288,traceTextMaxBytes:t.traceTextMaxBytes??262144,error:t.error||null,loaded:!0,at:Date.now()};e.telemetrySettings=n;let r=e._telemetryPending,i=t.type==="telemetry_settings"?"load":"update";r&&r[i]&&(r[i](n),delete r[i]);break}case"search_settings":case"search_settings_updated":{let n={backend:t.backend||"tavily",tavilyKeyConfigured:!!t.tavilyKeyConfigured,tavilyKeyMasked:t.tavilyKeyMasked||null,disableHtmlFallback:!!t.disableHtmlFallback,error:t.error||null,loaded:!0,at:Date.now()};e.searchSettings=n;let r=e._searchPending,i=t.type==="search_settings"?"load":"update";r&&r[i]&&(r[i](n),delete r[i]);break}case"tavily_usage":{let n=t.error?{error:t.error}:{plan:t.plan,used:t.used,limit:t.limit,paygoUsed:t.paygoUsed,paygoLimit:t.paygoLimit};e.tavilyUsage=n,e.tavilyUsageLoading=!1;let r=e._searchPending;r&&r.usage&&(r.usage(n),delete r.usage);break}case"yeaft_mcp_list_result":case"yeaft_mcp_add_result":case"yeaft_mcp_remove_result":case"yeaft_mcp_reload_result":case"yeaft_mcp_updated":{if(Array.isArray(t.servers)&&(e.yeaftMcpServers=t.servers),t.runtime&&typeof t.runtime=="object"&&(e.yeaftMcpRuntime={connected:!!t.runtime.connected,toolCount:t.runtime.toolCount||0,perServer:Array.isArray(t.runtime.perServer)?t.runtime.perServer:[]}),e.yeaftMcpLoading=!1,e.yeaftMcpError=t.error||null,t.requestId){let n=e._mcpPending;n&&n[t.requestId]&&(n[t.requestId](t),delete n[t.requestId])}break}case"conversation_mcp_update":t.conversationId&&t.servers&&(e.conversationMcpServers[t.conversationId]=t.servers),t.conversationId&&t.serverTools&&(e.conversationMcpServerTools[t.conversationId]=t.serverTools);break;case"btw_stream":e.appendBtwDelta(t.delta);break;case"btw_done":e.btwLoading=!1,t.btwSessionId&&(e.btwSessionId=t.btwSessionId);break;case"btw_error":{let n=e.btwMessages[e.btwMessages.length-1];n&&n.role==="assistant"&&(n.content="Error: "+t.error),e.btwLoading=!1;break}case"background_task_started":case"background_task_output":break;case"subagent_started":t.conversationId&&t.subagentId&&e.addSubagent(t.conversationId,{id:t.subagentId,slug:t.slug,type:t.subagentType,description:t.description,parentToolUseId:t.parentToolUseId});break;case"subagent_message":t.conversationId&&t.subagentId&&t.message&&e.appendSubagentMessage(t.conversationId,t.subagentId,t.message);break;case"subagent_completed":t.conversationId&&t.subagentId&&e.completeSubagent(t.conversationId,t.subagentId);break}}var Xh,Zh,Jh,Ad=F(()=>{gt();Dr();$t();Gt();us();la();Qn();kd();Yr();Xh=1,Zh=5,Jh=500});function Td(){return Object.values(xd).sort((t,s)=>t.order-s.order).map(t=>({teamId:t.id,team:t,roles:Object.values(ht).filter(s=>s.group===t.id)}))}function Md(e){let t=[];for(let s of Object.values(ht)){t.push({roleId:s.id,roleName:s.name,roleTitle:s.title,actionId:null,actionName:null,searchText:`${s.name} ${s.fullName} ${s.title} ${s.titleEn}`.toLowerCase(),displayText:s.name,group:s.group});for(let n of s.actions)t.push({roleId:s.id,roleName:s.name,roleTitle:s.title,actionId:n.id,actionName:n.name,searchText:`${s.name} ${s.fullName} ${s.title} ${n.name} ${n.nameEn}`.toLowerCase(),displayText:`${s.name}\xB7${n.name}`,group:s.group})}if(e&&e.length>0){for(let s of e)if(t.push({roleId:s.id,roleName:s.name,roleTitle:s.title,actionId:null,actionName:null,searchText:`${s.name} ${s.fullName||""} ${s.title} ${s.titleEn||""}`.toLowerCase(),displayText:s.name,group:"custom"}),s.actions)for(let n of s.actions)t.push({roleId:s.id,roleName:s.name,roleTitle:s.title,actionId:n.id,actionName:n.name,searchText:`${s.name} ${s.fullName||""} ${s.title} ${n.name} ${n.nameEn||""}`.toLowerCase(),displayText:`${s.name}\xB7${n.name}`,group:"custom"})}return t}function bs(e,t){let s=ht[e.role];if(s){if(e.action){let n=s.actions.find(r=>r.id===e.action);return n?`${s.name}\xB7${n.name}`:s.name}return s.name}if(t){let n=t.find(r=>r.id===e.role);if(n){if(e.action){let r=n.actions?.find(i=>i.id===e.action);return r?`${n.name}\xB7${r.name}`:n.name}return n.name}}return e.role}function ua(e,t,s,n="zh-CN"){if(!e||e.length===0||!t||t.length===0)return null;let r=n==="zh-CN";if(!e.some(l=>!ht[l.role]&&t.some(c=>c.id===l.role)))return null;if(e.length===1){let{role:l,action:c}=e[0],d=t.find(f=>f.id===l);if(!d)return null;let u;if(c&&d.actions){let f=d.actions.find(p=>p.id===c);f?s?(u=(r?f.messageTemplate:f.messageTemplateEn)||"",u+=s):u=(r?f.defaultMessage:f.defaultMessageEn)||"":u=((r?d.messagePrefix:d.messagePrefixEn)||"")+(s||"")}else u=((r?d.messagePrefix:d.messagePrefixEn)||"")+(s||"");return{effectivePrompt:u}}let o=[];for(let{role:l,action:c}of e){let d=t.find(f=>f.id===l),u=ht[l];if(d)if(c){let f=d.actions?.find(p=>p.id===c);f&&o.push((r?f.messageTemplate:f.messageTemplateEn)||"")}else o.push((r?d.messagePrefix:d.messagePrefixEn)||"");else if(u)return null}return o.length===0?null:{effectivePrompt:o.join(`
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
`)+(s||"")}}function Rd(e){return Object.values(xd).filter(t=>e||!t.adminOnly).sort((t,s)=>t.order-s.order)}var xd,ht,Pd,ws,Xn=F(()=>{xd={dev:{id:"dev",name:"\u8F6F\u4EF6\u5F00\u53D1",nameEn:"Software Dev",icon:"\u{1F5A5}\uFE0F",order:0},trading:{id:"trading",name:"\u4EA4\u6613",nameEn:"Trading",icon:"\u{1F4C8}",order:1,adminOnly:!0},writing:{id:"writing",name:"\u5199\u4F5C",nameEn:"Writing",icon:"\u270D\uFE0F",order:2,adminOnly:!0},video:{id:"video",name:"\u89C6\u9891",nameEn:"Video",icon:"\u{1F3AC}",order:3,adminOnly:!0}},ht={jobs:{id:"jobs",name:"Jobs",fullName:"Steve Jobs",title:"\u4EA7\u54C1\u7ECF\u7406",titleEn:"Product Manager",group:"dev",actions:[{id:"product-analysis",name:"\u4EA7\u54C1\u5206\u6790",nameEn:"Product Analysis"},{id:"design-review",name:"\u8BBE\u8BA1\u5BA1\u67E5",nameEn:"Design Review"},{id:"requirements",name:"\u9700\u6C42\u62C6\u89E3",nameEn:"Requirements"}]},fowler:{id:"fowler",name:"Fowler",fullName:"Martin Fowler",title:"\u8F6F\u4EF6\u67B6\u6784\u5E08",titleEn:"Software Architect",group:"dev",actions:[{id:"architecture",name:"\u67B6\u6784\u5BA1\u67E5",nameEn:"Architecture Review"},{id:"refactoring",name:"\u91CD\u6784\u5206\u6790",nameEn:"Refactoring"},{id:"code-review",name:"\u4EE3\u7801\u5BA1\u67E5",nameEn:"Code Review"}]},torvalds:{id:"torvalds",name:"Torvalds",fullName:"Linus Torvalds",title:"\u7CFB\u7EDF\u5F00\u53D1\u5DE5\u7A0B\u5E08",titleEn:"Systems Engineer",group:"dev",actions:[{id:"system-design",name:"\u7CFB\u7EDF\u8BBE\u8BA1",nameEn:"System Design"},{id:"performance",name:"\u6027\u80FD\u4F18\u5316",nameEn:"Performance"},{id:"code-style",name:"\u4EE3\u7801\u98CE\u683C",nameEn:"Code Style"},{id:"implementation",name:"\u4EE3\u7801\u5B9E\u73B0",nameEn:"Implementation"}]},beck:{id:"beck",name:"Beck",fullName:"Kent Beck",title:"\u6D4B\u8BD5\u5DE5\u7A0B\u5E08",titleEn:"Test Engineer",group:"dev",actions:[{id:"test-strategy",name:"\u6D4B\u8BD5\u7B56\u7565",nameEn:"Test Strategy"},{id:"tdd-guide",name:"TDD \u6307\u5BFC",nameEn:"TDD Guide"},{id:"quality-check",name:"\u8D28\u91CF\u8BC4\u4F30",nameEn:"Quality Check"}]},schneier:{id:"schneier",name:"Schneier",fullName:"Bruce Schneier",title:"\u5B89\u5168\u5DE5\u7A0B\u5E08",titleEn:"Security Engineer",group:"dev",actions:[{id:"security-audit",name:"\u5B89\u5168\u5BA1\u8BA1",nameEn:"Security Audit"},{id:"threat-model",name:"\u5A01\u80C1\u5EFA\u6A21",nameEn:"Threat Model"},{id:"auth-review",name:"\u8BA4\u8BC1\u5BA1\u67E5",nameEn:"Auth Review"}]},rams:{id:"rams",name:"Rams",fullName:"Dieter Rams",title:"UI/UX \u8BBE\u8BA1\u5E08",titleEn:"UI/UX Designer",group:"dev",actions:[{id:"ui-review",name:"\u754C\u9762\u5BA1\u67E5",nameEn:"UI Review"},{id:"interaction",name:"\u4EA4\u4E92\u8BBE\u8BA1",nameEn:"Interaction Design"},{id:"layout",name:"\u5E03\u5C40\u4F18\u5316",nameEn:"Layout Optimization"}]},graham:{id:"graham",name:"Graham",fullName:"Paul Graham",title:"\u6280\u672F\u5199\u4F5C / \u65B9\u6848\u8BC4\u4F30\u5E08",titleEn:"Tech Writer / Evaluator",group:"dev",actions:[{id:"writing",name:"\u6280\u672F\u5199\u4F5C",nameEn:"Tech Writing"},{id:"proposal-review",name:"\u65B9\u6848\u8BC4\u4F30",nameEn:"Proposal Review"},{id:"explain",name:"\u6982\u5FF5\u89E3\u91CA",nameEn:"Explain"}]},hightower:{id:"hightower",name:"Hightower",fullName:"Kelsey Hightower",title:"DevOps / \u8FD0\u7EF4\u5DE5\u7A0B\u5E08",titleEn:"DevOps Engineer",group:"dev",actions:[{id:"deployment",name:"\u90E8\u7F72\u5BA1\u67E5",nameEn:"Deployment Review"},{id:"cicd",name:"CI/CD \u8BC4\u4F30",nameEn:"CI/CD Review"},{id:"infra",name:"\u57FA\u7840\u8BBE\u65BD",nameEn:"Infrastructure"}]},gregg:{id:"gregg",name:"Gregg",fullName:"Brendan Gregg",title:"\u6027\u80FD\u5DE5\u7A0B\u5E08",titleEn:"Performance Engineer",group:"dev",actions:[{id:"perf-analysis",name:"\u6027\u80FD\u5206\u6790",nameEn:"Perf Analysis"},{id:"tuning",name:"\u7CFB\u7EDF\u8C03\u4F18",nameEn:"Tuning"},{id:"benchmark",name:"\u57FA\u51C6\u6D4B\u8BD5",nameEn:"Benchmark"}]},codd:{id:"codd",name:"Codd",fullName:"Edgar Codd",title:"\u6570\u636E\u5E93 / SQL \u4E13\u5BB6",titleEn:"Database / SQL Expert",group:"dev",actions:[{id:"sql-optimization",name:"SQL \u4F18\u5316",nameEn:"SQL Optimization"},{id:"schema-design",name:"Schema \u8BBE\u8BA1",nameEn:"Schema Design"},{id:"data-modeling",name:"\u6570\u636E\u5EFA\u6A21",nameEn:"Data Modeling"}]},knuth:{id:"knuth",name:"Knuth",fullName:"Donald Knuth",title:"\u7B97\u6CD5 / \u6570\u636E\u5904\u7406\u4E13\u5BB6",titleEn:"Algorithm Expert",group:"dev",actions:[{id:"algorithm-design",name:"\u7B97\u6CD5\u8BBE\u8BA1",nameEn:"Algorithm Design"},{id:"data-processing",name:"\u6570\u636E\u5904\u7406",nameEn:"Data Processing"},{id:"optimization",name:"\u4F18\u5316",nameEn:"Optimization"}]},thomas:{id:"thomas",name:"Thomas",fullName:"Dave Thomas",title:"\u6280\u672F\u6587\u6863\u5DE5\u7A0B\u5E08",titleEn:"Tech Doc Engineer",group:"dev",actions:[{id:"api-docs",name:"API \u6587\u6863",nameEn:"API Docs"},{id:"readme",name:"README",nameEn:"README"},{id:"comment-review",name:"\u6CE8\u91CA\u5BA1\u67E5",nameEn:"Comment Review"}]},soros:{id:"soros",name:"Soros",fullName:"George Soros",title:"\u5B8F\u89C2\u7B56\u7565\u5E08",titleEn:"Macro Strategist",group:"trading",actions:[{id:"macro-analysis",name:"\u5B8F\u89C2\u5206\u6790",nameEn:"Macro Analysis"},{id:"risk-assessment",name:"\u98CE\u9669\u8BC4\u4F30",nameEn:"Risk Assessment"},{id:"thesis-review",name:"\u8BBA\u70B9\u5BA1\u67E5",nameEn:"Thesis Review"}]},livermore:{id:"livermore",name:"Livermore",fullName:"Jesse Livermore",title:"\u6280\u672F\u5206\u6790\u5E08",titleEn:"Technical Analyst",group:"trading",actions:[{id:"price-action",name:"\u4EF7\u683C\u884C\u4E3A",nameEn:"Price Action"},{id:"pattern-recognition",name:"\u56FE\u5F62\u8BC6\u522B",nameEn:"Pattern Recognition"},{id:"trade-plan",name:"\u4EA4\u6613\u8BA1\u5212",nameEn:"Trade Plan"}]},dalio:{id:"dalio",name:"Dalio",fullName:"Ray Dalio",title:"\u7814\u7A76\u5458 / \u7ECF\u6D4E\u5206\u6790\u5E08",titleEn:"Research / Economist",group:"trading",actions:[{id:"economic-analysis",name:"\u7ECF\u6D4E\u5206\u6790",nameEn:"Economic Analysis"},{id:"portfolio-review",name:"\u7EC4\u5408\u5BA1\u67E5",nameEn:"Portfolio Review"},{id:"research-report",name:"\u7814\u7A76\u62A5\u544A",nameEn:"Research Report"}]},taleb:{id:"taleb",name:"Taleb",fullName:"Nassim Taleb",title:"\u98CE\u63A7\u5B98",titleEn:"Risk Manager",group:"trading",actions:[{id:"risk-audit",name:"\u98CE\u9669\u5BA1\u8BA1",nameEn:"Risk Audit"},{id:"antifragile",name:"\u53CD\u8106\u5F31\u8BC4\u4F30",nameEn:"Antifragile Assessment"},{id:"stress-test",name:"\u538B\u529B\u6D4B\u8BD5",nameEn:"Stress Test"}]},jones:{id:"jones",name:"Jones",fullName:"Paul Tudor Jones",title:"\u4EA4\u6613\u6267\u884C\u5458",titleEn:"Trade Executor",group:"trading",actions:[{id:"execution",name:"\u6267\u884C\u8BA1\u5212",nameEn:"Execution Plan"},{id:"position-sizing",name:"\u4ED3\u4F4D\u8BA1\u7B97",nameEn:"Position Sizing"},{id:"trade-review",name:"\u4EA4\u6613\u590D\u76D8",nameEn:"Trade Review"}]},simons:{id:"simons",name:"Simons",fullName:"Jim Simons",title:"\u91CF\u5316\u5206\u6790\u5E08",titleEn:"Quant Analyst",group:"trading",actions:[{id:"quant-signal",name:"\u91CF\u5316\u4FE1\u53F7",nameEn:"Quant Signal"},{id:"backtest-review",name:"\u56DE\u6D4B\u5BA1\u67E5",nameEn:"Backtest Review"},{id:"model-design",name:"\u6A21\u578B\u8BBE\u8BA1",nameEn:"Model Design"}]},jinyong:{id:"jinyong",name:"\u91D1\u5EB8",fullName:"\u91D1\u5EB8\uFF08Louis Cha\uFF09",title:"\u6B66\u4FA0\u5927\u5E08",titleEn:"Wuxia Master",group:"writing",actions:[{id:"world-building",name:"\u6B66\u4FA0\u4E16\u754C\u89C2",nameEn:"Wuxia World Building"},{id:"character-design",name:"\u4EBA\u7269\u5851\u9020",nameEn:"Character Design"},{id:"plot-design",name:"\u60C5\u8282\u7F16\u6392",nameEn:"Plot Design"}]},zhouzi:{id:"zhouzi",name:"\u8098\u5B50",fullName:"\u4F1A\u8BF4\u8BDD\u7684\u8098\u5B50",title:"\u7F51\u6587\u5929\u738B",titleEn:"Web Novel King",group:"writing",actions:[{id:"cool-factor",name:"\u723D\u611F\u8BBE\u8BA1",nameEn:"Cool Factor Design"},{id:"pacing",name:"\u8282\u594F\u628A\u63A7",nameEn:"Pacing Control"},{id:"cheat-design",name:"\u91D1\u624B\u6307\u8BBE\u8BA1",nameEn:"Cheat System Design"}]},qiongyao:{id:"qiongyao",name:"\u743C\u7476",fullName:"\u743C\u7476\uFF08Chiung Yao\uFF09",title:"\u8A00\u60C5\u5B97\u5E08",titleEn:"Romance Master",group:"writing",actions:[{id:"emotion-writing",name:"\u60C5\u611F\u63CF\u5199",nameEn:"Emotion Writing"},{id:"dialogue-design",name:"\u5BF9\u8BDD\u8BBE\u8BA1",nameEn:"Dialogue Design"},{id:"romance-arc",name:"\u8650\u604B\u67B6\u6784",nameEn:"Romance Arc"}]},luxun:{id:"luxun",name:"\u9C81\u8FC5",fullName:"\u9C81\u8FC5\uFF08Lu Xun\uFF09",title:"\u6587\u5B66\u5DE8\u5320",titleEn:"Literary Giant",group:"writing",actions:[{id:"satire",name:"\u8BBD\u523A\u5199\u4F5C",nameEn:"Satirical Writing"},{id:"character-sketch",name:"\u4EBA\u7269\u523B\u753B",nameEn:"Character Sketch"},{id:"prose-craft",name:"\u6587\u7B14\u9524\u70BC",nameEn:"Prose Craft"}]},kubrick:{id:"kubrick",name:"Kubrick",fullName:"Stanley Kubrick",title:"\u5BFC\u6F14 / \u89C6\u89C9\u603B\u76D1",titleEn:"Director / Visual Director",group:"video",actions:[{id:"narrative-pacing",name:"\u53D9\u4E8B\u8282\u594F",nameEn:"Narrative Pacing"},{id:"visual-concept",name:"\u89C6\u89C9\u6982\u5FF5",nameEn:"Visual Concept"},{id:"scene-breakdown",name:"\u573A\u666F\u62C6\u89E3",nameEn:"Scene Breakdown"}]},kaufman:{id:"kaufman",name:"Kaufman",fullName:"Charlie Kaufman",title:"\u7F16\u5267",titleEn:"Screenwriter",group:"video",actions:[{id:"script-writing",name:"\u811A\u672C\u5199\u4F5C",nameEn:"Script Writing"},{id:"character-design",name:"\u89D2\u8272\u8BBE\u8BA1",nameEn:"Character Design"},{id:"narrative-structure",name:"\u53D9\u4E8B\u7ED3\u6784",nameEn:"Narrative Structure"}]},spielberg:{id:"spielberg",name:"Spielberg",fullName:"Steven Spielberg",title:"\u5206\u955C / \u89C6\u89C9\u53D9\u4E8B\u5E08",titleEn:"Storyboard / Visual Storyteller",group:"video",actions:[{id:"storyboard",name:"\u5206\u955C\u8BBE\u8BA1",nameEn:"Storyboard"},{id:"shot-design",name:"\u955C\u5934\u65B9\u6848",nameEn:"Shot Design"},{id:"visual-storytelling",name:"\u89C6\u89C9\u53D9\u4E8B",nameEn:"Visual Storytelling"}]},schoonmaker:{id:"schoonmaker",name:"Schoonmaker",fullName:"Thelma Schoonmaker",title:"\u526A\u8F91\u5E08",titleEn:"Editor",group:"video",actions:[{id:"editing-rhythm",name:"\u526A\u8F91\u8282\u594F",nameEn:"Editing Rhythm"},{id:"sequence-design",name:"\u5E8F\u5217\u8BBE\u8BA1",nameEn:"Sequence Design"},{id:"final-cut",name:"\u6700\u7EC8\u5BA1\u7247",nameEn:"Final Cut"}]}};Pd="dev",ws=3});function lv(e,t){return!t||!e?.yeaftConversationIdsByAgent?[]:Object.entries(e.yeaftConversationIdsByAgent).filter(([,s])=>s===t).map(([s])=>s).filter(Boolean)}function _d(){return`cm_${crypto.randomUUID()}`}function Ed(e,t){if(t===e.currentAgent&&!e.pendingAgentSelection)return;let s=`agent_select_${crypto.randomUUID()}`;return e.agentSwitching=!0,e.pendingAgentSelection={agentId:t,requestId:s},e.sendWsMessage({type:"select_agent",agentId:t,requestId:s})===!1?(e.pendingAgentSelection=null,e.agentSwitching=!1,null):s}function Dd(e,t,s=null,n=null,r={}){let i=s||e.currentAgent;if(!i){e.addMessage({type:"error",content:Le("chat.agent.selectFirst")});return}Os(e,!0,Le("chat.session.creating"));let o={type:"create_conversation",agentId:i,workDir:t||e.currentAgentWorkDir};n!==null&&(o.disallowedTools=n),r&&typeof r.provider=="string"&&(o.provider=r.provider),r&&r.providerOptions&&typeof r.providerOptions=="object"&&(o.providerOptions=r.providerOptions),e.sendWsMessage(o)}function Ld(e,t,s,n=null,r=null,i=null){let o=n||e.currentAgent;if(!o){e.addMessage({type:"error",content:Le("chat.agent.selectFirst")});return}let a=null,l={};r&&typeof r=="object"&&!Array.isArray(r)?l=r:(a=r,i&&typeof i=="object"&&(l=i)),Os(e,!0,Le("chat.session.loadingHistory"));let c={type:"resume_conversation",agentId:o,claudeSessionId:t,workDir:s||e.currentAgentWorkDir};a!==null&&(c.disallowedTools=a),typeof l.provider=="string"&&(c.provider=l.provider),l.providerOptions&&typeof l.providerOptions=="object"&&(c.providerOptions=l.providerOptions),e.sendWsMessage(c)}function $d(e,t,s,{refresh:n=!1}={}){if(e.panels.length>1){let a=e.activePanelId||e.panels[0]?.id;a&&e.setPanelConversation(a,t,{refresh:n});return}if(t===e.currentConversation){n&&(e.syncChatConversationHistory?.(t),ds(e));return}let r=e.conversations.find(a=>a.id===t&&a.type!=="yeaft");if(r&&r.agentId&&r.agentId!==e.currentAgent){let a=e.agents.find(l=>l.id===r.agentId);a&&(e.currentAgent=r.agentId,e.currentAgentInfo=a,e.sendWsMessage({type:"select_agent",agentId:r.agentId,silent:!0}))}e.sendWsMessage({type:"select_conversation",conversationId:t}),e.panels.length>1?e.activeConversations.includes(t)||e.activeConversations.push(t):e.activeConversations=[t],r&&(e.currentWorkDir=r.workDir);let i=e.messagesMap[t];(!i||i.length===0)&&(e.messagesMap[t]=[],Os(e,!0,Le("chat.session.loadingHistory"))),e.syncChatConversationHistory?.(t),e.loadingMoreMessages=!1;let o=e.chatSessionState[t];e.hasMoreMessages=!!o?.hasMoreOlder,ds(e)}function pa(e,t,s){t&&e.sendWsMessage({type:"update_conversation_settings",conversationId:t,...s})}function Vd(e,t,s){let n=e.currentConversation;if(!n)return;let r=e.conversationMcpServers[n];if(r){let f=r.find(p=>p.name===t);f&&(f.enabled=s)}let i=e.conversationMcpServers[n]||[],o=e.conversationMcpServerTools[n]||{},a=[];for(let f of i)if(!f.enabled){let p=o[f.name];p&&p.length>0?a.push(...p):a.push(`mcp__${f.name}`)}let u=[...(e.conversations.find(f=>f.id===n)?.disallowedTools||[]).filter(f=>!f.startsWith("mcp__")),...a];pa(e,n,{disallowedTools:u})}function Hd(e,t,s){return t?e.sendWsMessage({type:"delete_conversation",requestId:`delete_${crypto.randomUUID()}`,conversationId:t,...s?{agentId:s}:{}}):!1}function Od(e,t,s){e._recentlyDeletedSessions||(e._recentlyDeletedSessions={}),e._recentlyDeletedSessions[t]=Date.now(),e.conversations=e.conversations.filter(i=>i.id!==t);let n=e.activeConversations.indexOf(t);n>=0&&(e.activeConversations.splice(n,1),e.activeConversations.length===0&&(localStorage.removeItem("lastViewedConversation"),e.lastViewedConversation=null));for(let i of e.panels)i.conversationId===t&&(i.conversationId=null);let r=e.pinnedSessions.indexOf(t);r>=0&&(e.pinnedSessions.splice(r,1),localStorage.setItem("pinned-sessions",JSON.stringify(e.pinnedSessions))),e.sendWsMessage({type:"delete_conversation",requestId:`delete_${crypto.randomUUID()}`,conversationId:t,...s?{agentId:s}:{}})}function Fd(e,t,s=[],n={}){let r=n.expertSelections&&n.expertSelections.length>0;if(!t.trim()&&s.length===0&&!r||!e.currentAgent||!e.currentConversation)return;let i=_d();if(e.addMessage({type:"user",content:t,clientMessageId:i,attachments:s.length>0?s:void 0,expertSelections:r?n.expertSelections:void 0}),t.trim()){let c=t.trim().substring(0,100);e.conversationTitles[e.currentConversation]=c}else if(r){let c=n.expertSelections[0],d=`@${c.role}${c.action?"\xB7"+c.action:""}`;e.conversationTitles[e.currentConversation]=d}let o=e.conversations.find(c=>c.id===e.currentConversation);o&&(o.lastMessageAt=Date.now()),e.processingConversations[e.currentConversation]||(e.processingConversations[e.currentConversation]=!0,e._closedAt?.[e.currentConversation]&&delete e._closedAt[e.currentConversation],e._turnCompletedConvs?.delete(e.currentConversation),e.getOrCreateExecutionStatus(e.currentConversation),Ns(e,e.currentConversation));let a=s.map(c=>c.fileId),l={type:"chat",conversationId:e.currentConversation,prompt:t,fileIds:a,workDir:e.currentWorkDir,clientMessageId:i};if(n.targetRole&&(l.targetRole=n.targetRole),r){l.expertSelections=n.expertSelections;let c=ua(n.expertSelections,e.customExpertRoles,t,e.language||"zh-CN");c&&(l.expertMessage=c.effectivePrompt)}e.sendWsMessage(l)||Ln(e).then(()=>{e.sendWsMessage(l)}).catch(()=>{e.addMessage({type:"system",content:Le("chat.connection.reconnectFailed")}),delete e.processingConversations[e.currentConversation],Ae(e,e.currentConversation)})}function Nd(e){if(!e.currentConversation||!e.processingConversations[e.currentConversation])return;let t=e.currentConversation;e.sendWsMessage({type:"cancel_execution",conversationId:t}),delete e.processingConversations[t],Ae(e,t),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now();let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t),Qt(e,t),e.addMessage({type:"system",content:Le("chat.execution.cancelled")})}function qd(e,t,s,n){let r=n||e.currentConversation,o=(e.messagesMap[r]||[]).find(g=>g.type==="tool-use"&&g.toolName==="AskUserQuestion"&&g.askRequestId===t),a=e.currentView==="yeaft"||!!o?.sessionId;if(a&&o?.askPending)return;let l=o?.sessionId||e.yeaftActiveSessionFilter||null,c=typeof o?.agentId=="string"&&o.agentId?o.agentId:null,d=a?lv(e,r):[],u=d.length===1?d[0]:null;if(c&&u&&c!==u)return!1;let f=a&&!c&&!u&&typeof e.agentIdForSession=="function"?e.agentIdForSession(l):null,p=e.sendWsMessage(a?{type:"yeaft_ask_user_answer",agentId:c||u||f||e.yeaftAgentId||e.currentAgent||null,conversationId:r,requestId:t,toolCallId:o?.toolId||null,answers:s,sessionId:l,vpId:o?.vpId||o?.speakerVpId||null,turnId:o?.turnId||null,threadId:o?.threadId||"main"}:{type:"ask_user_answer",conversationId:r,requestId:t,answers:s});if(o&&!a)o.askAnswered=!0,o.selectedAnswers=s;else if(o&&p!==!1){let g=++av;o.askPending=!0,o.pendingAnswers=s,o.askSubmitGeneration=g;let m=setTimeout(()=>{o.askSubmitGeneration!==g||o.askPending!==!0||(o.askPending=!1,o.pendingAnswers=null,o.askSubmitGeneration=null)},ov);typeof m?.unref=="function"&&m.unref()}p!==!1&&r&&!e.processingConversations[r]&&(e.processingConversations[r]=!0,e._closedAt?.[r]&&delete e._closedAt[r],e.getOrCreateExecutionStatus(r))}function Bd(e,t){t&&(e.activeConversations.includes(t)||e.activeConversations.length>=3||(e.activeConversations.push(t),e.messagesMap[t]||(e.messagesMap[t]=[],e.requestChatHistory?.(t,{mode:"recent",turns:5})),ds(e)))}function Wd(e,t){let s=e.activeConversations.indexOf(t);s<0||(e.activeConversations.splice(s,1),e.activeConversations.length===0&&(localStorage.removeItem("lastViewedConversation"),e.lastViewedConversation=null),ds(e))}function jd(e,t,s,n=[],r={}){let i=r.expertSelections&&r.expertSelections.length>0;if(!s.trim()&&n.length===0&&!i||!e.currentAgent||!t)return;let o=_d();if(e.addMessageToConversation(t,{type:"user",content:s,clientMessageId:o,attachments:n.length>0?n:void 0,expertSelections:i?r.expertSelections:void 0}),s.trim()){let d=s.trim().substring(0,100);e.conversationTitles[t]=d}else if(i){let d=r.expertSelections[0],u=`@${d.role}${d.action?"\xB7"+d.action:""}`;e.conversationTitles[t]=u}let a=e.conversations.find(d=>d.id===t);a&&(a.lastMessageAt=Date.now()),e.processingConversations[t]||(e.processingConversations[t]=!0,e._closedAt?.[t]&&delete e._closedAt[t],e._turnCompletedConvs?.delete(t),e.getOrCreateExecutionStatus(t),Ns(e,t));let l=n.map(d=>d.fileId),c={type:"chat",conversationId:t,prompt:s,fileIds:l,workDir:a?.workDir||e.currentWorkDir,clientMessageId:o};if(r.targetRole&&(c.targetRole=r.targetRole),i){c.expertSelections=r.expertSelections;let d=ua(r.expertSelections,e.customExpertRoles,s,e.language||"zh-CN");d&&(c.expertMessage=d.effectivePrompt)}e.sendWsMessage(c)||Ln(e).then(()=>{e.sendWsMessage(c)}).catch(()=>{e.addMessageToConversation(t,{type:"system",content:Le("chat.connection.reconnectFailed")}),delete e.processingConversations[t],Ae(e,t)})}function Ud(e,t){if(!t||!e.processingConversations[t])return;e.sendWsMessage({type:"cancel_execution",conversationId:t}),delete e.processingConversations[t],Ae(e,t),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now();let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t),Qt(e,t),e.addMessageToConversation(t,{type:"system",content:Le("chat.execution.cancelled")})}function Kd(e){e.ws&&e.ws.readyState===WebSocket.OPEN&&(typeof e.requestYeaftSessionInventory=="function"?e.requestYeaftSessionInventory():e.sendWsMessage({type:"get_agents"}))}function zd(e){!e.currentAgent||!e.currentConversation||e.sendWsMessage({type:"refresh_conversation",conversationId:e.currentConversation})}function Yd(e,t){t&&e.sendWsMessage({type:"restart_agent",agentId:t})}function Gd(e,t){t&&e.sendWsMessage({type:"upgrade_agent",agentId:t})}var ov,av,Qd=F(()=>{Gt();us();Ro();Yr();$t();Xn();ov=1e4,av=0});function dv(e=globalThis.localStorage){try{return e?.getItem(Zd)==="yeaft"?"yeaft":Xd}catch{return Xd}}function fa(e,t=globalThis.localStorage){if(e!=="chat"&&e!=="yeaft")return!1;try{return t?.setItem(Zd,e),!!t}catch{return!1}}function Jd(e=globalThis.localStorage){let t=dv(e);if(t!=="yeaft")return{currentView:t,_yeaftTransitionActive:!1,_savedActiveConversations:null,_savedChatIdentity:null,_pendingChatRestoreConversationId:null};let s=null;try{s=e?.getItem("lastViewedConversation")||null}catch{}let n=s&&!s.startsWith("yeaft-")?s:null;return{currentView:t,_yeaftTransitionActive:!0,_savedActiveConversations:null,_savedChatIdentity:null,_pendingChatRestoreConversationId:n}}function ga(e){return e._yeaftTransitionActive?!1:(e._savedActiveConversations=[...e.activeConversations],e._savedChatIdentity={agentId:e.currentAgent||null,agentInfo:e.currentAgentInfo?{...e.currentAgentInfo}:null,workDir:e.currentWorkDir||null},e._yeaftTransitionActive=!0,!0)}function eu(e){let t=ga(e);return e.activeConversations=[e.yeaftConversationId],t}function tu(e){if(!e._yeaftTransitionActive)return null;let t=e._savedChatIdentity||null;return e.activeConversations=e._savedActiveConversations||[],t&&(e.currentAgent=t.agentId,e.currentAgentInfo=t.agentInfo,e.currentWorkDir=t.workDir),e._savedActiveConversations=null,e._savedChatIdentity=null,e._yeaftTransitionActive=!1,t}var Zd,Xd,su=F(()=>{Zd="yeaft-preferred-conversation-view",Xd="chat"});function nu(e,t,s){let n={...e||{}},r={...n[t]||{}};return r[s]=(r[s]||0)+1,n[t]=r,n}function ru(e,t,s){let n={...e||{}},r={...n[t]||{}},i=(r[s]||0)-1;return i<=0?delete r[s]:r[s]=i,Object.keys(r).length===0?delete n[t]:n[t]=r,n}var iu=F(()=>{});function ma(e){return e.currentView==="yeaft"?e.yeaftConversationId||null:e.activeConversations[0]||null}var ou=F(()=>{});function au({loops:e,turnsById:t,turnOrder:s,maxLoops:n}){if(!Array.isArray(e)||e.length<=n)return{loops:e,turnsById:t,turnOrder:s};let r=e.length-n,i=e.slice(r),o=new Set;for(let c of i)c&&c.turnId&&o.add(c.turnId);for(let c of s){let d=t[c];d&&d.closedAt==null&&o.add(c)}let a={};for(let c of Object.keys(t))o.has(c)&&(a[c]=t[c]);let l=s.filter(c=>o.has(c));return{loops:i,turnsById:a,turnOrder:l}}var lu=F(()=>{});function Ee(e){let t=Number(e);return Number.isFinite(t)?t:null}function zs(e){let t=Ee(e);return Number.isInteger(t)&&t>0?t:null}function ha(e){let t=Ee(e);return Number.isInteger(t)&&t>=0?t:null}function cu(e){return fv.has(e)?1:0}function gv(e,t){if(!e)return t||null;if(!t)return e;let s=Ee(e.progressRevision),n=Ee(t.progressRevision);if(s!=null||n!=null){if(s==null)return t;if(n==null)return e;if(s!==n)return n>s?t:e}let r=cu(e.status),i=cu(t.status);if(r!==i)return i>r?t:e;let o=Ee(e.updatedAt)??Ee(e.createdAt)??0;return(Ee(t.updatedAt)??Ee(t.createdAt)??0)>o?t:e}function Ks(e){return Math.max(0,Number(e)||0)}function du(e){return typeof e?.id=="string"&&e.id.startsWith("event:")?e.id.slice(6):null}function mv(e,t){if(/^\d+$/.test(e)&&/^\d+$/.test(t)){let s=BigInt(e),n=BigInt(t);return s<n?-1:s>n?1:0}return e.localeCompare(t)}function hv(e,t){let s=Ks(e?.createdAt)-Ks(t?.createdAt);if(s)return s;let n=du(e),r=du(t);if(n!=null&&r!=null)return mv(n,r);let i=e?.role==="user"?0:1,o=t?.role==="user"?0:1;if(i!==o)return i-o;let a=Ks(e?.generation)-Ks(t?.generation);return a||Ks(e?.attempt)-Ks(t?.attempt)||String(e?.id||"").localeCompare(String(t?.id||""))}function Zn(...e){let t=new Map;for(let s of e){let n=Array.isArray(s)?s:[s];for(let r of n)r?.id&&t.set(r.id,gv(t.get(r.id),r))}return[...t.values()].sort(hv)}function rt(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:1}function Ys(e,t,s,n){return`${e}:${t}:${s}:${rt(n)}`}function va(e,t,s,n){return`${e}:${t}:${s}:${rt(n)}`}function Gs(e,t){if(!e||!t||e.id!==t.id)return!1;let s=Ee(e.revision),n=Ee(t.revision);if(s!=null&&n!=null&&s!==n)return s<n;let r=Ee(e.coordinatorRevision),i=Ee(t.coordinatorRevision);if(r!=null&&i!=null&&r!==i)return r<i;let o=Ee(e.updatedAt),a=Ee(t.updatedAt);return o!=null&&a!=null&&o<a}function uu(e,t){if(Gs(e,t))return!0;if(!e||!t||e.id!==t.id)return!1;let s=Ee(e.revision),n=Ee(t.revision);return e.currentActionId!==t.currentActionId&&s!=null&&n!=null&&s<=n}function ya(e,t){let s=zs(e?.generation),n=zs(t?.generation);if(s!=null&&n!=null&&s!==n)return n<s;let r=ha(e?.attempt),i=ha(t?.attempt);if(r!=null&&i!=null&&r!==i)return i<r;let o=Ee(e?.progressRevision),a=Ee(t?.progressRevision);return o!=null&&a!=null&&a<o}function ba(e,t){if(!e||e.id!==t?.id||Gs(t,e))return null;let s=Array.isArray(e.actions)?e.actions:[],n=Array.isArray(t.actionStats)?t.actionStats:[],r=e.currentActionId||null,i=Object.prototype.hasOwnProperty.call(t,"currentActionId")?t.currentActionId||null:r,o=typeof t.eventActionId=="string"&&n.some(g=>g?.id===t.eventActionId)?t.eventActionId:null,a=o||r!==i&&r||i;if(!a)return null;let l=s.find(g=>g?.id===a)||null,c=n.find(g=>g?.id===a)||(t.currentAction?.id===a?t.currentAction:null);if(l&&c&&ya(l,c))return null;let d=zs(l?.generation),u=zs(c?.generation),f=ha(c?.attempt),p={actionId:a,generation:u||d||1,...f==null?{}:{attempt:f}};return o||r!==i||!l||d!=null&&u!=null&&u>d||l?.status==="running"&&c?.status&&c.status!=="running"?p:null}function pu(e,t){if(!e||e.id!==t?.id||Gs(t,e))return!1;let s=Ee(t.coordinatorRevision),n=Ee(e.coordinatorRevision)??0;return s!=null&&s>n?!0:ba(e,t)!=null}function fu(e,t){if(!e||e.id!==t?.id||Gs(t,e))return e;let s={...e},n=!Array.isArray(e.actions)||!Array.isArray(t.actionStats);if(Array.isArray(e.actions)&&Array.isArray(t.actionStats)){let r=new Map(t.actionStats.map(o=>[o?.id,o])),i=!1;n=!0,s.actions=e.actions.map(o=>{let a=r.get(o?.id);if(!a)return o;if(i=!0,ya(o,a))return n=!1,o;if(Ee(a?.progressRevision)==null){let{response:u,messages:f,...p}=a;return{...o,...p}}let c=zs(o?.generation),d=zs(a?.generation);if(c!=null&&d!=null&&d>c){let{messages:u,thread:f,liveMessage:p,response:g,failure:m,messageCursor:b,messageCount:I,failureReason:y,...S}=o;return{...S,...a}}return{...o,...a}}),i||(n=!1)}for(let r of pv)!n&&vv.has(r)||Object.prototype.hasOwnProperty.call(t,r)&&(s[r]=t[r]);return s}function gu(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let s=new Map(e.map(n=>[n?.id,n]));return t.some(n=>{let r=s.get(n?.id);return r?ya(r,n):!1})}function mu(e,t){return Ee(e?.revision)===Ee(t?.revision)&&Ee(e?.coordinatorRevision)===Ee(t?.coordinatorRevision)&&Ee(e?.updatedAt)===Ee(t?.updatedAt)}function hu(e,t){return!e||!t||e.id!==t.id?!1:Gs(e,t)?!0:mu(t,e)&&gu(t.actions,e.actions)}function Qr(e,t){let s=Array.isArray(e)?e:[],n=s.find(i=>i.id===t?.id)||null,r=n&&Gs(t,n)?n:t;return n&&r===t&&mu(n,t)&&gu(n.actionStats,t.actionStats)&&(r=n),r?.id?[r,...s.filter(i=>i.id!==r.id)].sort((i,o)=>Number(o.updatedAt||0)-Number(i.updatedAt||0)):s}var pv,fv,vv,wa=F(()=>{pv=Object.freeze(["revision","planRevision","ledgerRevision","coordinatorRevision","title","goal","workItemType","planningMode","status","lifecycle","attentionState","activeActionIds","attentionActionIds","currentActionId","currentAction","executionStats","failureReason","origin","linkedSessionIds","createdAt","updatedAt"]);fv=new Set(["completed","failed","cancelled","superseded","interrupted"]);vv=new Set(["status","lifecycle","attentionState","activeActionIds","attentionActionIds","currentActionId","currentAction","executionStats","failureReason"])});function ks(e){return typeof e=="string"?e.trim():""}function vu(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e=="string"&&e.trim()){let t=Date.parse(e);if(Number.isFinite(t))return t}return null}function xt(e){let t=vu(e);if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(t))}catch{return""}}function yv(e){return Array.isArray(e)?e.slice(0,100).map(t=>({content:ks(t?.content).slice(0,2e3),status:["pending","in_progress","completed"].includes(t?.status)?t.status:"pending",...ks(t?.activeForm)?{activeForm:ks(t.activeForm).slice(0,2e3)}:{}})).filter(t=>t.content):[]}function Qe(e){if(!e||typeof e!="object")return null;let t=ks(e.content).slice(0,1e5),s=yv(e.todos);if(!t&&s.length===0)return null;let n=e.role==="assistant"?"assistant":"user",r=vu(e.timestamp);return{id:ks(e.id).slice(0,256)||null,role:n,author:ks(e.author).slice(0,256)||(n==="assistant"?"Assistant":"User"),content:t,...r?{timestamp:r}:{},...s.length>0?{todos:s}:{}}}function yu(e,t){return Qe({id:e?.messageId||e?.id||null,role:"user",author:t,content:e?.content||"",timestamp:e?.timestamp||e?.createdAt||e?.ts||e?.time||null})}function bu(e,t){let s=e?.todoMsg?.toolInput?.todos,n=Array.isArray(e?.toolMsgs)?e.toolMsgs.map(o=>ks(o?.toolName)).filter(Boolean):[],r=Number(e?.toolSummaryCount||0)||0,i=n.length>0?`Tool actions: ${n.join(", ")}`:r>0?`Tool actions: ${r}`:"";return Qe({id:e?.atMessageId||e?.messageId||e?.id||e?.turnId||null,role:"assistant",author:t,content:e?.textContent||i,timestamp:e?.timestamp||e?.createdAt||e?.speakerTimestamp||null,todos:s})}var Xt=F(()=>{});function wu(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:t?.type==="text"&&typeof t.text=="string"?t.text:"").join(""):e==null?"":String(e)}function bv(e,t){if(!e||e.type!=="assistant")return!1;let s=e.sessionId??e.groupId??null,n=e.speakerVpId||e.vpId||null;return!(t.sessionId&&s!==t.sessionId||t.vpId&&n!==t.vpId||t.turnId&&e.turnId!==t.turnId)}function ku(e,t={}){if(!Array.isArray(e)||!t.turnId)return!1;let s=e.filter(n=>bv(n,t));if(s.length===0)return!1;for(let n of s)n.responseKind="progress";if(t.reason==="end_turn"){for(let n=s.length-1;n>=0;n-=1)if(wu(s[n].content).trim()){s[n].responseKind="result";break}}return!0}function Xr(e,t){if(!e||!t)return;let s=wu(t.content);s&&(Array.isArray(e.textSegments)||(e.textSegments=[]),e.textSegments.push({key:t.messageId||t.id||`response-${e.textSegments.length}`,content:s,kind:t.responseKind==="result"?"result":"progress",explicitKind:t.responseKind==="progress"||t.responseKind==="result",isStreaming:t.isStreaming===!0}),e.textContent=e.textSegments.map(n=>n.content).join(`
|
|
6
|
+
`)+(s||"")}}function Rd(e){return Object.values(xd).filter(t=>e||!t.adminOnly).sort((t,s)=>t.order-s.order)}var xd,ht,Pd,ws,Xn=F(()=>{xd={dev:{id:"dev",name:"\u8F6F\u4EF6\u5F00\u53D1",nameEn:"Software Dev",icon:"\u{1F5A5}\uFE0F",order:0},trading:{id:"trading",name:"\u4EA4\u6613",nameEn:"Trading",icon:"\u{1F4C8}",order:1,adminOnly:!0},writing:{id:"writing",name:"\u5199\u4F5C",nameEn:"Writing",icon:"\u270D\uFE0F",order:2,adminOnly:!0},video:{id:"video",name:"\u89C6\u9891",nameEn:"Video",icon:"\u{1F3AC}",order:3,adminOnly:!0}},ht={jobs:{id:"jobs",name:"Jobs",fullName:"Steve Jobs",title:"\u4EA7\u54C1\u7ECF\u7406",titleEn:"Product Manager",group:"dev",actions:[{id:"product-analysis",name:"\u4EA7\u54C1\u5206\u6790",nameEn:"Product Analysis"},{id:"design-review",name:"\u8BBE\u8BA1\u5BA1\u67E5",nameEn:"Design Review"},{id:"requirements",name:"\u9700\u6C42\u62C6\u89E3",nameEn:"Requirements"}]},fowler:{id:"fowler",name:"Fowler",fullName:"Martin Fowler",title:"\u8F6F\u4EF6\u67B6\u6784\u5E08",titleEn:"Software Architect",group:"dev",actions:[{id:"architecture",name:"\u67B6\u6784\u5BA1\u67E5",nameEn:"Architecture Review"},{id:"refactoring",name:"\u91CD\u6784\u5206\u6790",nameEn:"Refactoring"},{id:"code-review",name:"\u4EE3\u7801\u5BA1\u67E5",nameEn:"Code Review"}]},torvalds:{id:"torvalds",name:"Torvalds",fullName:"Linus Torvalds",title:"\u7CFB\u7EDF\u5F00\u53D1\u5DE5\u7A0B\u5E08",titleEn:"Systems Engineer",group:"dev",actions:[{id:"system-design",name:"\u7CFB\u7EDF\u8BBE\u8BA1",nameEn:"System Design"},{id:"performance",name:"\u6027\u80FD\u4F18\u5316",nameEn:"Performance"},{id:"code-style",name:"\u4EE3\u7801\u98CE\u683C",nameEn:"Code Style"},{id:"implementation",name:"\u4EE3\u7801\u5B9E\u73B0",nameEn:"Implementation"}]},beck:{id:"beck",name:"Beck",fullName:"Kent Beck",title:"\u6D4B\u8BD5\u5DE5\u7A0B\u5E08",titleEn:"Test Engineer",group:"dev",actions:[{id:"test-strategy",name:"\u6D4B\u8BD5\u7B56\u7565",nameEn:"Test Strategy"},{id:"tdd-guide",name:"TDD \u6307\u5BFC",nameEn:"TDD Guide"},{id:"quality-check",name:"\u8D28\u91CF\u8BC4\u4F30",nameEn:"Quality Check"}]},schneier:{id:"schneier",name:"Schneier",fullName:"Bruce Schneier",title:"\u5B89\u5168\u5DE5\u7A0B\u5E08",titleEn:"Security Engineer",group:"dev",actions:[{id:"security-audit",name:"\u5B89\u5168\u5BA1\u8BA1",nameEn:"Security Audit"},{id:"threat-model",name:"\u5A01\u80C1\u5EFA\u6A21",nameEn:"Threat Model"},{id:"auth-review",name:"\u8BA4\u8BC1\u5BA1\u67E5",nameEn:"Auth Review"}]},rams:{id:"rams",name:"Rams",fullName:"Dieter Rams",title:"UI/UX \u8BBE\u8BA1\u5E08",titleEn:"UI/UX Designer",group:"dev",actions:[{id:"ui-review",name:"\u754C\u9762\u5BA1\u67E5",nameEn:"UI Review"},{id:"interaction",name:"\u4EA4\u4E92\u8BBE\u8BA1",nameEn:"Interaction Design"},{id:"layout",name:"\u5E03\u5C40\u4F18\u5316",nameEn:"Layout Optimization"}]},graham:{id:"graham",name:"Graham",fullName:"Paul Graham",title:"\u6280\u672F\u5199\u4F5C / \u65B9\u6848\u8BC4\u4F30\u5E08",titleEn:"Tech Writer / Evaluator",group:"dev",actions:[{id:"writing",name:"\u6280\u672F\u5199\u4F5C",nameEn:"Tech Writing"},{id:"proposal-review",name:"\u65B9\u6848\u8BC4\u4F30",nameEn:"Proposal Review"},{id:"explain",name:"\u6982\u5FF5\u89E3\u91CA",nameEn:"Explain"}]},hightower:{id:"hightower",name:"Hightower",fullName:"Kelsey Hightower",title:"DevOps / \u8FD0\u7EF4\u5DE5\u7A0B\u5E08",titleEn:"DevOps Engineer",group:"dev",actions:[{id:"deployment",name:"\u90E8\u7F72\u5BA1\u67E5",nameEn:"Deployment Review"},{id:"cicd",name:"CI/CD \u8BC4\u4F30",nameEn:"CI/CD Review"},{id:"infra",name:"\u57FA\u7840\u8BBE\u65BD",nameEn:"Infrastructure"}]},gregg:{id:"gregg",name:"Gregg",fullName:"Brendan Gregg",title:"\u6027\u80FD\u5DE5\u7A0B\u5E08",titleEn:"Performance Engineer",group:"dev",actions:[{id:"perf-analysis",name:"\u6027\u80FD\u5206\u6790",nameEn:"Perf Analysis"},{id:"tuning",name:"\u7CFB\u7EDF\u8C03\u4F18",nameEn:"Tuning"},{id:"benchmark",name:"\u57FA\u51C6\u6D4B\u8BD5",nameEn:"Benchmark"}]},codd:{id:"codd",name:"Codd",fullName:"Edgar Codd",title:"\u6570\u636E\u5E93 / SQL \u4E13\u5BB6",titleEn:"Database / SQL Expert",group:"dev",actions:[{id:"sql-optimization",name:"SQL \u4F18\u5316",nameEn:"SQL Optimization"},{id:"schema-design",name:"Schema \u8BBE\u8BA1",nameEn:"Schema Design"},{id:"data-modeling",name:"\u6570\u636E\u5EFA\u6A21",nameEn:"Data Modeling"}]},knuth:{id:"knuth",name:"Knuth",fullName:"Donald Knuth",title:"\u7B97\u6CD5 / \u6570\u636E\u5904\u7406\u4E13\u5BB6",titleEn:"Algorithm Expert",group:"dev",actions:[{id:"algorithm-design",name:"\u7B97\u6CD5\u8BBE\u8BA1",nameEn:"Algorithm Design"},{id:"data-processing",name:"\u6570\u636E\u5904\u7406",nameEn:"Data Processing"},{id:"optimization",name:"\u4F18\u5316",nameEn:"Optimization"}]},thomas:{id:"thomas",name:"Thomas",fullName:"Dave Thomas",title:"\u6280\u672F\u6587\u6863\u5DE5\u7A0B\u5E08",titleEn:"Tech Doc Engineer",group:"dev",actions:[{id:"api-docs",name:"API \u6587\u6863",nameEn:"API Docs"},{id:"readme",name:"README",nameEn:"README"},{id:"comment-review",name:"\u6CE8\u91CA\u5BA1\u67E5",nameEn:"Comment Review"}]},soros:{id:"soros",name:"Soros",fullName:"George Soros",title:"\u5B8F\u89C2\u7B56\u7565\u5E08",titleEn:"Macro Strategist",group:"trading",actions:[{id:"macro-analysis",name:"\u5B8F\u89C2\u5206\u6790",nameEn:"Macro Analysis"},{id:"risk-assessment",name:"\u98CE\u9669\u8BC4\u4F30",nameEn:"Risk Assessment"},{id:"thesis-review",name:"\u8BBA\u70B9\u5BA1\u67E5",nameEn:"Thesis Review"}]},livermore:{id:"livermore",name:"Livermore",fullName:"Jesse Livermore",title:"\u6280\u672F\u5206\u6790\u5E08",titleEn:"Technical Analyst",group:"trading",actions:[{id:"price-action",name:"\u4EF7\u683C\u884C\u4E3A",nameEn:"Price Action"},{id:"pattern-recognition",name:"\u56FE\u5F62\u8BC6\u522B",nameEn:"Pattern Recognition"},{id:"trade-plan",name:"\u4EA4\u6613\u8BA1\u5212",nameEn:"Trade Plan"}]},dalio:{id:"dalio",name:"Dalio",fullName:"Ray Dalio",title:"\u7814\u7A76\u5458 / \u7ECF\u6D4E\u5206\u6790\u5E08",titleEn:"Research / Economist",group:"trading",actions:[{id:"economic-analysis",name:"\u7ECF\u6D4E\u5206\u6790",nameEn:"Economic Analysis"},{id:"portfolio-review",name:"\u7EC4\u5408\u5BA1\u67E5",nameEn:"Portfolio Review"},{id:"research-report",name:"\u7814\u7A76\u62A5\u544A",nameEn:"Research Report"}]},taleb:{id:"taleb",name:"Taleb",fullName:"Nassim Taleb",title:"\u98CE\u63A7\u5B98",titleEn:"Risk Manager",group:"trading",actions:[{id:"risk-audit",name:"\u98CE\u9669\u5BA1\u8BA1",nameEn:"Risk Audit"},{id:"antifragile",name:"\u53CD\u8106\u5F31\u8BC4\u4F30",nameEn:"Antifragile Assessment"},{id:"stress-test",name:"\u538B\u529B\u6D4B\u8BD5",nameEn:"Stress Test"}]},jones:{id:"jones",name:"Jones",fullName:"Paul Tudor Jones",title:"\u4EA4\u6613\u6267\u884C\u5458",titleEn:"Trade Executor",group:"trading",actions:[{id:"execution",name:"\u6267\u884C\u8BA1\u5212",nameEn:"Execution Plan"},{id:"position-sizing",name:"\u4ED3\u4F4D\u8BA1\u7B97",nameEn:"Position Sizing"},{id:"trade-review",name:"\u4EA4\u6613\u590D\u76D8",nameEn:"Trade Review"}]},simons:{id:"simons",name:"Simons",fullName:"Jim Simons",title:"\u91CF\u5316\u5206\u6790\u5E08",titleEn:"Quant Analyst",group:"trading",actions:[{id:"quant-signal",name:"\u91CF\u5316\u4FE1\u53F7",nameEn:"Quant Signal"},{id:"backtest-review",name:"\u56DE\u6D4B\u5BA1\u67E5",nameEn:"Backtest Review"},{id:"model-design",name:"\u6A21\u578B\u8BBE\u8BA1",nameEn:"Model Design"}]},jinyong:{id:"jinyong",name:"\u91D1\u5EB8",fullName:"\u91D1\u5EB8\uFF08Louis Cha\uFF09",title:"\u6B66\u4FA0\u5927\u5E08",titleEn:"Wuxia Master",group:"writing",actions:[{id:"world-building",name:"\u6B66\u4FA0\u4E16\u754C\u89C2",nameEn:"Wuxia World Building"},{id:"character-design",name:"\u4EBA\u7269\u5851\u9020",nameEn:"Character Design"},{id:"plot-design",name:"\u60C5\u8282\u7F16\u6392",nameEn:"Plot Design"}]},zhouzi:{id:"zhouzi",name:"\u8098\u5B50",fullName:"\u4F1A\u8BF4\u8BDD\u7684\u8098\u5B50",title:"\u7F51\u6587\u5929\u738B",titleEn:"Web Novel King",group:"writing",actions:[{id:"cool-factor",name:"\u723D\u611F\u8BBE\u8BA1",nameEn:"Cool Factor Design"},{id:"pacing",name:"\u8282\u594F\u628A\u63A7",nameEn:"Pacing Control"},{id:"cheat-design",name:"\u91D1\u624B\u6307\u8BBE\u8BA1",nameEn:"Cheat System Design"}]},qiongyao:{id:"qiongyao",name:"\u743C\u7476",fullName:"\u743C\u7476\uFF08Chiung Yao\uFF09",title:"\u8A00\u60C5\u5B97\u5E08",titleEn:"Romance Master",group:"writing",actions:[{id:"emotion-writing",name:"\u60C5\u611F\u63CF\u5199",nameEn:"Emotion Writing"},{id:"dialogue-design",name:"\u5BF9\u8BDD\u8BBE\u8BA1",nameEn:"Dialogue Design"},{id:"romance-arc",name:"\u8650\u604B\u67B6\u6784",nameEn:"Romance Arc"}]},luxun:{id:"luxun",name:"\u9C81\u8FC5",fullName:"\u9C81\u8FC5\uFF08Lu Xun\uFF09",title:"\u6587\u5B66\u5DE8\u5320",titleEn:"Literary Giant",group:"writing",actions:[{id:"satire",name:"\u8BBD\u523A\u5199\u4F5C",nameEn:"Satirical Writing"},{id:"character-sketch",name:"\u4EBA\u7269\u523B\u753B",nameEn:"Character Sketch"},{id:"prose-craft",name:"\u6587\u7B14\u9524\u70BC",nameEn:"Prose Craft"}]},kubrick:{id:"kubrick",name:"Kubrick",fullName:"Stanley Kubrick",title:"\u5BFC\u6F14 / \u89C6\u89C9\u603B\u76D1",titleEn:"Director / Visual Director",group:"video",actions:[{id:"narrative-pacing",name:"\u53D9\u4E8B\u8282\u594F",nameEn:"Narrative Pacing"},{id:"visual-concept",name:"\u89C6\u89C9\u6982\u5FF5",nameEn:"Visual Concept"},{id:"scene-breakdown",name:"\u573A\u666F\u62C6\u89E3",nameEn:"Scene Breakdown"}]},kaufman:{id:"kaufman",name:"Kaufman",fullName:"Charlie Kaufman",title:"\u7F16\u5267",titleEn:"Screenwriter",group:"video",actions:[{id:"script-writing",name:"\u811A\u672C\u5199\u4F5C",nameEn:"Script Writing"},{id:"character-design",name:"\u89D2\u8272\u8BBE\u8BA1",nameEn:"Character Design"},{id:"narrative-structure",name:"\u53D9\u4E8B\u7ED3\u6784",nameEn:"Narrative Structure"}]},spielberg:{id:"spielberg",name:"Spielberg",fullName:"Steven Spielberg",title:"\u5206\u955C / \u89C6\u89C9\u53D9\u4E8B\u5E08",titleEn:"Storyboard / Visual Storyteller",group:"video",actions:[{id:"storyboard",name:"\u5206\u955C\u8BBE\u8BA1",nameEn:"Storyboard"},{id:"shot-design",name:"\u955C\u5934\u65B9\u6848",nameEn:"Shot Design"},{id:"visual-storytelling",name:"\u89C6\u89C9\u53D9\u4E8B",nameEn:"Visual Storytelling"}]},schoonmaker:{id:"schoonmaker",name:"Schoonmaker",fullName:"Thelma Schoonmaker",title:"\u526A\u8F91\u5E08",titleEn:"Editor",group:"video",actions:[{id:"editing-rhythm",name:"\u526A\u8F91\u8282\u594F",nameEn:"Editing Rhythm"},{id:"sequence-design",name:"\u5E8F\u5217\u8BBE\u8BA1",nameEn:"Sequence Design"},{id:"final-cut",name:"\u6700\u7EC8\u5BA1\u7247",nameEn:"Final Cut"}]}};Pd="dev",ws=3});function lv(e,t){return!t||!e?.yeaftConversationIdsByAgent?[]:Object.entries(e.yeaftConversationIdsByAgent).filter(([,s])=>s===t).map(([s])=>s).filter(Boolean)}function _d(){return`cm_${crypto.randomUUID()}`}function Ed(e,t){if(t===e.currentAgent&&!e.pendingAgentSelection)return;let s=`agent_select_${crypto.randomUUID()}`;return e.agentSwitching=!0,e.pendingAgentSelection={agentId:t,requestId:s},e.sendWsMessage({type:"select_agent",agentId:t,requestId:s})===!1?(e.pendingAgentSelection=null,e.agentSwitching=!1,null):s}function Dd(e,t,s=null,n=null,r={}){let i=s||e.currentAgent;if(!i){e.addMessage({type:"error",content:Le("chat.agent.selectFirst")});return}Os(e,!0,Le("chat.session.creating"));let o={type:"create_conversation",agentId:i,workDir:t||e.currentAgentWorkDir};n!==null&&(o.disallowedTools=n),r&&typeof r.provider=="string"&&(o.provider=r.provider),r&&r.providerOptions&&typeof r.providerOptions=="object"&&(o.providerOptions=r.providerOptions),e.sendWsMessage(o)}function Ld(e,t,s,n=null,r=null,i=null){let o=n||e.currentAgent;if(!o){e.addMessage({type:"error",content:Le("chat.agent.selectFirst")});return}let a=null,l={};r&&typeof r=="object"&&!Array.isArray(r)?l=r:(a=r,i&&typeof i=="object"&&(l=i)),Os(e,!0,Le("chat.session.loadingHistory"));let c={type:"resume_conversation",agentId:o,claudeSessionId:t,workDir:s||e.currentAgentWorkDir};a!==null&&(c.disallowedTools=a),typeof l.provider=="string"&&(c.provider=l.provider),l.providerOptions&&typeof l.providerOptions=="object"&&(c.providerOptions=l.providerOptions),e.sendWsMessage(c)}function $d(e,t,s,{refresh:n=!1}={}){if(e.panels.length>1){let a=e.activePanelId||e.panels[0]?.id;a&&e.setPanelConversation(a,t,{refresh:n});return}if(t===e.currentConversation){n&&(e.syncChatConversationHistory?.(t),ds(e));return}let r=e.conversations.find(a=>a.id===t&&a.type!=="yeaft");if(r&&r.agentId&&r.agentId!==e.currentAgent){let a=e.agents.find(l=>l.id===r.agentId);a&&(e.currentAgent=r.agentId,e.currentAgentInfo=a,e.sendWsMessage({type:"select_agent",agentId:r.agentId,silent:!0}))}e.sendWsMessage({type:"select_conversation",conversationId:t}),e.panels.length>1?e.activeConversations.includes(t)||e.activeConversations.push(t):e.activeConversations=[t],r&&(e.currentWorkDir=r.workDir);let i=e.messagesMap[t];(!i||i.length===0)&&(e.messagesMap[t]=[],Os(e,!0,Le("chat.session.loadingHistory"))),e.syncChatConversationHistory?.(t),e.loadingMoreMessages=!1;let o=e.chatSessionState[t];e.hasMoreMessages=!!o?.hasMoreOlder,ds(e)}function pa(e,t,s){t&&e.sendWsMessage({type:"update_conversation_settings",conversationId:t,...s})}function Vd(e,t,s){let n=e.currentConversation;if(!n)return;let r=e.conversationMcpServers[n];if(r){let f=r.find(p=>p.name===t);f&&(f.enabled=s)}let i=e.conversationMcpServers[n]||[],o=e.conversationMcpServerTools[n]||{},a=[];for(let f of i)if(!f.enabled){let p=o[f.name];p&&p.length>0?a.push(...p):a.push(`mcp__${f.name}`)}let u=[...(e.conversations.find(f=>f.id===n)?.disallowedTools||[]).filter(f=>!f.startsWith("mcp__")),...a];pa(e,n,{disallowedTools:u})}function Hd(e,t,s){return t?e.sendWsMessage({type:"delete_conversation",requestId:`delete_${crypto.randomUUID()}`,conversationId:t,...s?{agentId:s}:{}}):!1}function Od(e,t,s){e._recentlyDeletedSessions||(e._recentlyDeletedSessions={}),e._recentlyDeletedSessions[t]=Date.now(),e.conversations=e.conversations.filter(i=>i.id!==t);let n=e.activeConversations.indexOf(t);n>=0&&(e.activeConversations.splice(n,1),e.activeConversations.length===0&&(localStorage.removeItem("lastViewedConversation"),e.lastViewedConversation=null));for(let i of e.panels)i.conversationId===t&&(i.conversationId=null);let r=e.pinnedSessions.indexOf(t);r>=0&&(e.pinnedSessions.splice(r,1),localStorage.setItem("pinned-sessions",JSON.stringify(e.pinnedSessions))),e.sendWsMessage({type:"delete_conversation",requestId:`delete_${crypto.randomUUID()}`,conversationId:t,...s?{agentId:s}:{}})}function Fd(e,t,s=[],n={}){let r=n.expertSelections&&n.expertSelections.length>0;if(!t.trim()&&s.length===0&&!r||!e.currentAgent||!e.currentConversation)return;let i=_d();if(e.addMessage({type:"user",content:t,clientMessageId:i,attachments:s.length>0?s:void 0,expertSelections:r?n.expertSelections:void 0}),t.trim()){let c=t.trim().substring(0,100);e.conversationTitles[e.currentConversation]=c}else if(r){let c=n.expertSelections[0],d=`@${c.role}${c.action?"\xB7"+c.action:""}`;e.conversationTitles[e.currentConversation]=d}let o=e.conversations.find(c=>c.id===e.currentConversation);o&&(o.lastMessageAt=Date.now()),e.processingConversations[e.currentConversation]||(e.processingConversations[e.currentConversation]=!0,e._closedAt?.[e.currentConversation]&&delete e._closedAt[e.currentConversation],e._turnCompletedConvs?.delete(e.currentConversation),e.getOrCreateExecutionStatus(e.currentConversation),Ns(e,e.currentConversation));let a=s.map(c=>c.fileId),l={type:"chat",conversationId:e.currentConversation,prompt:t,fileIds:a,workDir:e.currentWorkDir,clientMessageId:i};if(n.targetRole&&(l.targetRole=n.targetRole),r){l.expertSelections=n.expertSelections;let c=ua(n.expertSelections,e.customExpertRoles,t,e.language||"zh-CN");c&&(l.expertMessage=c.effectivePrompt)}e.sendWsMessage(l)||Ln(e).then(()=>{e.sendWsMessage(l)}).catch(()=>{e.addMessage({type:"system",content:Le("chat.connection.reconnectFailed")}),delete e.processingConversations[e.currentConversation],Ae(e,e.currentConversation)})}function Nd(e){if(!e.currentConversation||!e.processingConversations[e.currentConversation])return;let t=e.currentConversation;e.sendWsMessage({type:"cancel_execution",conversationId:t}),delete e.processingConversations[t],Ae(e,t),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now();let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t),Qt(e,t),e.addMessage({type:"system",content:Le("chat.execution.cancelled")})}function Bd(e,t,s,n){let r=n||e.currentConversation,o=(e.messagesMap[r]||[]).find(g=>g.type==="tool-use"&&g.toolName==="AskUserQuestion"&&g.askRequestId===t),a=e.currentView==="yeaft"||!!o?.sessionId;if(a&&o?.askPending)return;let l=o?.sessionId||e.yeaftActiveSessionFilter||null,c=typeof o?.agentId=="string"&&o.agentId?o.agentId:null,d=a?lv(e,r):[],u=d.length===1?d[0]:null;if(c&&u&&c!==u)return!1;let f=a&&!c&&!u&&typeof e.agentIdForSession=="function"?e.agentIdForSession(l):null,p=e.sendWsMessage(a?{type:"yeaft_ask_user_answer",agentId:c||u||f||e.yeaftAgentId||e.currentAgent||null,conversationId:r,requestId:t,toolCallId:o?.toolId||null,answers:s,sessionId:l,vpId:o?.vpId||o?.speakerVpId||null,turnId:o?.turnId||null,threadId:o?.threadId||"main"}:{type:"ask_user_answer",conversationId:r,requestId:t,answers:s});if(o&&!a)o.askAnswered=!0,o.selectedAnswers=s;else if(o&&p!==!1){let g=++av;o.askPending=!0,o.pendingAnswers=s,o.askSubmitGeneration=g;let m=setTimeout(()=>{o.askSubmitGeneration!==g||o.askPending!==!0||(o.askPending=!1,o.pendingAnswers=null,o.askSubmitGeneration=null)},ov);typeof m?.unref=="function"&&m.unref()}p!==!1&&r&&!e.processingConversations[r]&&(e.processingConversations[r]=!0,e._closedAt?.[r]&&delete e._closedAt[r],e.getOrCreateExecutionStatus(r))}function qd(e,t){t&&(e.activeConversations.includes(t)||e.activeConversations.length>=3||(e.activeConversations.push(t),e.messagesMap[t]||(e.messagesMap[t]=[],e.requestChatHistory?.(t,{mode:"recent",turns:5})),ds(e)))}function Wd(e,t){let s=e.activeConversations.indexOf(t);s<0||(e.activeConversations.splice(s,1),e.activeConversations.length===0&&(localStorage.removeItem("lastViewedConversation"),e.lastViewedConversation=null),ds(e))}function jd(e,t,s,n=[],r={}){let i=r.expertSelections&&r.expertSelections.length>0;if(!s.trim()&&n.length===0&&!i||!e.currentAgent||!t)return;let o=_d();if(e.addMessageToConversation(t,{type:"user",content:s,clientMessageId:o,attachments:n.length>0?n:void 0,expertSelections:i?r.expertSelections:void 0}),s.trim()){let d=s.trim().substring(0,100);e.conversationTitles[t]=d}else if(i){let d=r.expertSelections[0],u=`@${d.role}${d.action?"\xB7"+d.action:""}`;e.conversationTitles[t]=u}let a=e.conversations.find(d=>d.id===t);a&&(a.lastMessageAt=Date.now()),e.processingConversations[t]||(e.processingConversations[t]=!0,e._closedAt?.[t]&&delete e._closedAt[t],e._turnCompletedConvs?.delete(t),e.getOrCreateExecutionStatus(t),Ns(e,t));let l=n.map(d=>d.fileId),c={type:"chat",conversationId:t,prompt:s,fileIds:l,workDir:a?.workDir||e.currentWorkDir,clientMessageId:o};if(r.targetRole&&(c.targetRole=r.targetRole),i){c.expertSelections=r.expertSelections;let d=ua(r.expertSelections,e.customExpertRoles,s,e.language||"zh-CN");d&&(c.expertMessage=d.effectivePrompt)}e.sendWsMessage(c)||Ln(e).then(()=>{e.sendWsMessage(c)}).catch(()=>{e.addMessageToConversation(t,{type:"system",content:Le("chat.connection.reconnectFailed")}),delete e.processingConversations[t],Ae(e,t)})}function Ud(e,t){if(!t||!e.processingConversations[t])return;e.sendWsMessage({type:"cancel_execution",conversationId:t}),delete e.processingConversations[t],Ae(e,t),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now();let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t),Qt(e,t),e.addMessageToConversation(t,{type:"system",content:Le("chat.execution.cancelled")})}function Kd(e){e.ws&&e.ws.readyState===WebSocket.OPEN&&(typeof e.requestYeaftSessionInventory=="function"?e.requestYeaftSessionInventory():e.sendWsMessage({type:"get_agents"}))}function zd(e){!e.currentAgent||!e.currentConversation||e.sendWsMessage({type:"refresh_conversation",conversationId:e.currentConversation})}function Yd(e,t){t&&e.sendWsMessage({type:"restart_agent",agentId:t})}function Gd(e,t){t&&e.sendWsMessage({type:"upgrade_agent",agentId:t})}var ov,av,Qd=F(()=>{Gt();us();Ro();Yr();$t();Xn();ov=1e4,av=0});function dv(e=globalThis.localStorage){try{return e?.getItem(Zd)==="yeaft"?"yeaft":Xd}catch{return Xd}}function fa(e,t=globalThis.localStorage){if(e!=="chat"&&e!=="yeaft")return!1;try{return t?.setItem(Zd,e),!!t}catch{return!1}}function Jd(e=globalThis.localStorage){let t=dv(e);if(t!=="yeaft")return{currentView:t,_yeaftTransitionActive:!1,_savedActiveConversations:null,_savedChatIdentity:null,_pendingChatRestoreConversationId:null};let s=null;try{s=e?.getItem("lastViewedConversation")||null}catch{}let n=s&&!s.startsWith("yeaft-")?s:null;return{currentView:t,_yeaftTransitionActive:!0,_savedActiveConversations:null,_savedChatIdentity:null,_pendingChatRestoreConversationId:n}}function ga(e){return e._yeaftTransitionActive?!1:(e._savedActiveConversations=[...e.activeConversations],e._savedChatIdentity={agentId:e.currentAgent||null,agentInfo:e.currentAgentInfo?{...e.currentAgentInfo}:null,workDir:e.currentWorkDir||null},e._yeaftTransitionActive=!0,!0)}function eu(e){let t=ga(e);return e.activeConversations=[e.yeaftConversationId],t}function tu(e){if(!e._yeaftTransitionActive)return null;let t=e._savedChatIdentity||null;return e.activeConversations=e._savedActiveConversations||[],t&&(e.currentAgent=t.agentId,e.currentAgentInfo=t.agentInfo,e.currentWorkDir=t.workDir),e._savedActiveConversations=null,e._savedChatIdentity=null,e._yeaftTransitionActive=!1,t}var Zd,Xd,su=F(()=>{Zd="yeaft-preferred-conversation-view",Xd="chat"});function nu(e,t,s){let n={...e||{}},r={...n[t]||{}};return r[s]=(r[s]||0)+1,n[t]=r,n}function ru(e,t,s){let n={...e||{}},r={...n[t]||{}},i=(r[s]||0)-1;return i<=0?delete r[s]:r[s]=i,Object.keys(r).length===0?delete n[t]:n[t]=r,n}var iu=F(()=>{});function ma(e){return e.currentView==="yeaft"?e.yeaftConversationId||null:e.activeConversations[0]||null}var ou=F(()=>{});function au({loops:e,turnsById:t,turnOrder:s,maxLoops:n}){if(!Array.isArray(e)||e.length<=n)return{loops:e,turnsById:t,turnOrder:s};let r=e.length-n,i=e.slice(r),o=new Set;for(let c of i)c&&c.turnId&&o.add(c.turnId);for(let c of s){let d=t[c];d&&d.closedAt==null&&o.add(c)}let a={};for(let c of Object.keys(t))o.has(c)&&(a[c]=t[c]);let l=s.filter(c=>o.has(c));return{loops:i,turnsById:a,turnOrder:l}}var lu=F(()=>{});function Ee(e){let t=Number(e);return Number.isFinite(t)?t:null}function zs(e){let t=Ee(e);return Number.isInteger(t)&&t>0?t:null}function ha(e){let t=Ee(e);return Number.isInteger(t)&&t>=0?t:null}function cu(e){return fv.has(e)?1:0}function gv(e,t){if(!e)return t||null;if(!t)return e;let s=Ee(e.progressRevision),n=Ee(t.progressRevision);if(s!=null||n!=null){if(s==null)return t;if(n==null)return e;if(s!==n)return n>s?t:e}let r=cu(e.status),i=cu(t.status);if(r!==i)return i>r?t:e;let o=Ee(e.updatedAt)??Ee(e.createdAt)??0;return(Ee(t.updatedAt)??Ee(t.createdAt)??0)>o?t:e}function Ks(e){return Math.max(0,Number(e)||0)}function du(e){return typeof e?.id=="string"&&e.id.startsWith("event:")?e.id.slice(6):null}function mv(e,t){if(/^\d+$/.test(e)&&/^\d+$/.test(t)){let s=BigInt(e),n=BigInt(t);return s<n?-1:s>n?1:0}return e.localeCompare(t)}function hv(e,t){let s=Ks(e?.createdAt)-Ks(t?.createdAt);if(s)return s;let n=du(e),r=du(t);if(n!=null&&r!=null)return mv(n,r);let i=e?.role==="user"?0:1,o=t?.role==="user"?0:1;if(i!==o)return i-o;let a=Ks(e?.generation)-Ks(t?.generation);return a||Ks(e?.attempt)-Ks(t?.attempt)||String(e?.id||"").localeCompare(String(t?.id||""))}function Zn(...e){let t=new Map;for(let s of e){let n=Array.isArray(s)?s:[s];for(let r of n)r?.id&&t.set(r.id,gv(t.get(r.id),r))}return[...t.values()].sort(hv)}function rt(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:1}function Ys(e,t,s,n){return`${e}:${t}:${s}:${rt(n)}`}function va(e,t,s,n){return`${e}:${t}:${s}:${rt(n)}`}function Gs(e,t){if(!e||!t||e.id!==t.id)return!1;let s=Ee(e.revision),n=Ee(t.revision);if(s!=null&&n!=null&&s!==n)return s<n;let r=Ee(e.coordinatorRevision),i=Ee(t.coordinatorRevision);if(r!=null&&i!=null&&r!==i)return r<i;let o=Ee(e.updatedAt),a=Ee(t.updatedAt);return o!=null&&a!=null&&o<a}function uu(e,t){if(Gs(e,t))return!0;if(!e||!t||e.id!==t.id)return!1;let s=Ee(e.revision),n=Ee(t.revision);return e.currentActionId!==t.currentActionId&&s!=null&&n!=null&&s<=n}function ya(e,t){let s=zs(e?.generation),n=zs(t?.generation);if(s!=null&&n!=null&&s!==n)return n<s;let r=ha(e?.attempt),i=ha(t?.attempt);if(r!=null&&i!=null&&r!==i)return i<r;let o=Ee(e?.progressRevision),a=Ee(t?.progressRevision);return o!=null&&a!=null&&a<o}function ba(e,t){if(!e||e.id!==t?.id||Gs(t,e))return null;let s=Array.isArray(e.actions)?e.actions:[],n=Array.isArray(t.actionStats)?t.actionStats:[],r=e.currentActionId||null,i=Object.prototype.hasOwnProperty.call(t,"currentActionId")?t.currentActionId||null:r,o=typeof t.eventActionId=="string"&&n.some(g=>g?.id===t.eventActionId)?t.eventActionId:null,a=o||r!==i&&r||i;if(!a)return null;let l=s.find(g=>g?.id===a)||null,c=n.find(g=>g?.id===a)||(t.currentAction?.id===a?t.currentAction:null);if(l&&c&&ya(l,c))return null;let d=zs(l?.generation),u=zs(c?.generation),f=ha(c?.attempt),p={actionId:a,generation:u||d||1,...f==null?{}:{attempt:f}};return o||r!==i||!l||d!=null&&u!=null&&u>d||l?.status==="running"&&c?.status&&c.status!=="running"?p:null}function pu(e,t){if(!e||e.id!==t?.id||Gs(t,e))return!1;let s=Ee(t.coordinatorRevision),n=Ee(e.coordinatorRevision)??0;return s!=null&&s>n?!0:ba(e,t)!=null}function fu(e,t){if(!e||e.id!==t?.id||Gs(t,e))return e;let s={...e},n=!Array.isArray(e.actions)||!Array.isArray(t.actionStats);if(Array.isArray(e.actions)&&Array.isArray(t.actionStats)){let r=new Map(t.actionStats.map(o=>[o?.id,o])),i=!1;n=!0,s.actions=e.actions.map(o=>{let a=r.get(o?.id);if(!a)return o;if(i=!0,ya(o,a))return n=!1,o;if(Ee(a?.progressRevision)==null){let{response:u,messages:f,...p}=a;return{...o,...p}}let c=zs(o?.generation),d=zs(a?.generation);if(c!=null&&d!=null&&d>c){let{messages:u,thread:f,liveMessage:p,response:g,failure:m,messageCursor:b,messageCount:I,failureReason:y,...S}=o;return{...S,...a}}return{...o,...a}}),i||(n=!1)}for(let r of pv)!n&&vv.has(r)||Object.prototype.hasOwnProperty.call(t,r)&&(s[r]=t[r]);return s}function gu(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let s=new Map(e.map(n=>[n?.id,n]));return t.some(n=>{let r=s.get(n?.id);return r?ya(r,n):!1})}function mu(e,t){return Ee(e?.revision)===Ee(t?.revision)&&Ee(e?.coordinatorRevision)===Ee(t?.coordinatorRevision)&&Ee(e?.updatedAt)===Ee(t?.updatedAt)}function hu(e,t){return!e||!t||e.id!==t.id?!1:Gs(e,t)?!0:mu(t,e)&&gu(t.actions,e.actions)}function Qr(e,t){let s=Array.isArray(e)?e:[],n=s.find(i=>i.id===t?.id)||null,r=n&&Gs(t,n)?n:t;return n&&r===t&&mu(n,t)&&gu(n.actionStats,t.actionStats)&&(r=n),r?.id?[r,...s.filter(i=>i.id!==r.id)].sort((i,o)=>Number(o.updatedAt||0)-Number(i.updatedAt||0)):s}var pv,fv,vv,wa=F(()=>{pv=Object.freeze(["revision","planRevision","ledgerRevision","coordinatorRevision","title","goal","workItemType","planningMode","status","lifecycle","attentionState","activeActionIds","attentionActionIds","currentActionId","currentAction","executionStats","failureReason","origin","linkedSessionIds","createdAt","updatedAt"]);fv=new Set(["completed","failed","cancelled","superseded","interrupted"]);vv=new Set(["status","lifecycle","attentionState","activeActionIds","attentionActionIds","currentActionId","currentAction","executionStats","failureReason"])});function ks(e){return typeof e=="string"?e.trim():""}function vu(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e=="string"&&e.trim()){let t=Date.parse(e);if(Number.isFinite(t))return t}return null}function xt(e){let t=vu(e);if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(t))}catch{return""}}function yv(e){return Array.isArray(e)?e.slice(0,100).map(t=>({content:ks(t?.content).slice(0,2e3),status:["pending","in_progress","completed"].includes(t?.status)?t.status:"pending",...ks(t?.activeForm)?{activeForm:ks(t.activeForm).slice(0,2e3)}:{}})).filter(t=>t.content):[]}function Qe(e){if(!e||typeof e!="object")return null;let t=ks(e.content).slice(0,1e5),s=yv(e.todos);if(!t&&s.length===0)return null;let n=e.role==="assistant"?"assistant":"user",r=vu(e.timestamp);return{id:ks(e.id).slice(0,256)||null,role:n,author:ks(e.author).slice(0,256)||(n==="assistant"?"Assistant":"User"),content:t,...r?{timestamp:r}:{},...s.length>0?{todos:s}:{}}}function yu(e,t){return Qe({id:e?.messageId||e?.id||null,role:"user",author:t,content:e?.content||"",timestamp:e?.timestamp||e?.createdAt||e?.ts||e?.time||null})}function bu(e,t){let s=e?.todoMsg?.toolInput?.todos,n=Array.isArray(e?.toolMsgs)?e.toolMsgs.map(o=>ks(o?.toolName)).filter(Boolean):[],r=Number(e?.toolSummaryCount||0)||0,i=n.length>0?`Tool actions: ${n.join(", ")}`:r>0?`Tool actions: ${r}`:"";return Qe({id:e?.atMessageId||e?.messageId||e?.id||e?.turnId||null,role:"assistant",author:t,content:e?.textContent||i,timestamp:e?.timestamp||e?.createdAt||e?.speakerTimestamp||null,todos:s})}var Xt=F(()=>{});function wu(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:t?.type==="text"&&typeof t.text=="string"?t.text:"").join(""):e==null?"":String(e)}function bv(e,t){if(!e||e.type!=="assistant")return!1;let s=e.sessionId??e.groupId??null,n=e.speakerVpId||e.vpId||null;return!(t.sessionId&&s!==t.sessionId||t.vpId&&n!==t.vpId||t.turnId&&e.turnId!==t.turnId)}function ku(e,t={}){if(!Array.isArray(e)||!t.turnId)return!1;let s=e.filter(n=>bv(n,t));if(s.length===0)return!1;for(let n of s)n.responseKind="progress";if(t.reason==="end_turn"){for(let n=s.length-1;n>=0;n-=1)if(wu(s[n].content).trim()){s[n].responseKind="result";break}}return!0}function Xr(e,t){if(!e||!t)return;let s=wu(t.content);s&&(Array.isArray(e.textSegments)||(e.textSegments=[]),e.textSegments.push({key:t.messageId||t.id||`response-${e.textSegments.length}`,content:s,kind:t.responseKind==="result"?"result":"progress",explicitKind:t.responseKind==="progress"||t.responseKind==="result",isStreaming:t.isStreaming===!0}),e.textContent=e.textSegments.map(n=>n.content).join(`
|
|
7
7
|
|
|
8
|
-
`))}function Zr(e){let t=Array.isArray(e?.textSegments)?e.textSegments:[];if(t.length===0)return;let s=Array.isArray(e?.messages)?e.messages:[],n=e?.isActive===!0||e?.isStreaming===!0||t.some(l=>l.isStreaming===!0)||s.some(l=>l?.isStreaming===!0||l?.status==="pending"),r=s.some(l=>l?.incomplete===!0||ka.has(l?.status)||ka.has(l?.turnEndReason)||ka.has(l?.stopReason));if(n||r){for(let l of t)l.kind="progress";return}if(t.some(l=>l.kind==="result"))return;let i=s.some(l=>l?.turnEndReason==="end_turn"),o=t.some(l=>l.explicitKind),a=t.length===1&&!o;(i||a||e.isHistory&&!o)&&(t[t.length-1].kind="result")}var ka,Jr=F(()=>{ka=new Set(["aborted","errored","error","cancelled","canceled"])});function Sa(e){return e?.type==="user"&&typeof e.content=="string"&&e.content.trim()}function Ia(e){return e?.type==="assistant"||e?.type==="thinking"||e?.type==="tool_use"||e?.type==="tool-use"||e?.type==="tool_result"||e?.type==="tool-result"}function Ca(e,t){if(!e||e.kind!=="assistant")return!0;let s=e.turnId||e.lastTurnId||"",n=t?.turnId||"";if(s&&n&&s!==n)return!0;let r=e.speakerVpId||"",i=t?.speakerVpId||t?.vpId||"";return!!(r&&i&&r!==i)}function Su(e=[]){let t=[],s=null,n=r=>{s&&(t.push({start:s.start,end:r,kind:s.kind}),s=null)};for(let r=0;r<e.length;r++){let i=e[r];if(i){if(Sa(i)||i.type==="system"||i.type==="error"){n(r),s={start:r,kind:i.type};continue}if(!Ia(i)){s||(s={start:r,kind:"other"});continue}(!s||s.kind==="assistant"&&Ca(s,i))&&(n(r),s={start:r,kind:"assistant",turnId:i.turnId||"",speakerVpId:i.speakerVpId||i.vpId||""}),s.lastTurnId=i.turnId||s.lastTurnId||"",s.speakerVpId=s.speakerVpId||i.speakerVpId||i.vpId||""}}return n(e.length),t}function Iu(e,t){return t?e&&(e.sessionId??e.groupId)===t:!0}function Aa(e=[],t=null,s=5){let n=Math.max(1,Number.isFinite(s)?Math.floor(s):5),r=[],i=[],o=null,a=c=>{o&&(i.push({start:o.start,end:c,kind:o.kind}),o=null)};for(let c of e){if(!Iu(c,t))continue;let d=r.length;if(r.push(c),Sa(c)||c.type==="system"||c.type==="error"){a(d),o={start:d,kind:c.type};continue}if(!Ia(c)){o||(o={start:d,kind:"other"});continue}(!o||o.kind==="assistant"&&Ca(o,c))&&(a(d),o={start:d,kind:"assistant",turnId:c.turnId||"",speakerVpId:c.speakerVpId||c.vpId||""}),o.lastTurnId=c.turnId||o.lastTurnId||"",o.speakerVpId=o.speakerVpId||c.speakerVpId||c.vpId||""}if(a(r.length),i.length<=n)return r;let l=i[i.length-n];return r.slice(l.start)}function Cu(e=[],t=null,s=5){let n=Math.max(1,s||5),r=0,i=null,o=()=>i?(i=null,r+=1,r>n):!1;for(let a of e)if(Iu(a,t)){if(Sa(a)||a.type==="system"||a.type==="error"){if(o())return!0;i={kind:a.type};continue}if(!Ia(a)){i||(i={kind:"other"});continue}if(!i||i.kind==="assistant"&&Ca(i,a)){if(o())return!0;i={kind:"assistant",turnId:a.turnId||"",speakerVpId:a.speakerVpId||a.vpId||""}}i.lastTurnId=a.turnId||i.lastTurnId||"",i.speakerVpId=i.speakerVpId||a.speakerVpId||a.vpId||""}return o(),r>n}function Ss(){return 5}function Jn(){return 20}var Au=F(()=>{});function kv(e,t){let s=new Set;if(!t)return s;for(let n of e?.sessionCatalog||[])n?.runtimeProvider!=="yeaft"||n?.routeRef?.sessionId!==t||n.routeRef.agentId&&s.add(n.routeRef.agentId);if(s.size===0){let n=Zt();for(let r of n?.sessionList||[])r?.id===t&&r?.agentId&&s.add(r.agentId)}return s}function Fu(e,t){let s=kv(e,t);return s.size===1?s.values().next().value:null}function ni(e,t,s){return!!s&&Fu(e,t)===s}function et(e,t,s){return!e||e.sessionId!==t?!1:s?e.agentId===s:!e.agentId}function xu(e,t,s=null){if(!t)return!1;let n=s||Se(e,t),r=mt(n,t);if(r&&e.yeaftProcessingSessions?.[r]||e.yeaftProcessingSessions?.[t]&&ni(e,t,n))return!0;for(let i of Object.values(e.activeVpTurns||{}))if(et(i,t,n))return!0;for(let i of Object.values(e.vpStatuses||{}))if(et(i,t,n)&&tr.has(i?.state))return!0;return!1}function Sv(e,t,s,n=null){let r={...e.yeaftProcessingSessions||{}};if(t){let i=ca(t);if(r=Object.fromEntries(Object.entries(r).filter(([o])=>n?o!==mt(t,n):!o.startsWith(i))),n)ni(e,n,t)&&delete r[n];else for(let o of Object.keys(r))ni(e,o,t)&&delete r[o]}else n?delete r[n]:r={};for(let i of s||[]){let o=i?.sessionId||i?.groupId||null;if(!o||!tr.has(i?.state))continue;let a=mt(t,o)||o;r[a]=!0}return r}function Qs(e,t,s){let n=da(t,s);return n&&e?.activeVpTurns?.[n]?n:e?.activeVpTurns?.[s]&&(!t||!e.activeVpTurns[s]?.agentId||e.activeVpTurns[s].agentId===t)?s:n||s||""}function Tu(e,t){if(!t){e.activeVpTurns={},e.stoppingVpTurnIds={},e.vpStatuses={},e.yeaftProcessingSessions={};return}e.activeVpTurns=Object.fromEntries(Object.entries(e.activeVpTurns||{}).filter(([,n])=>n?.agentId&&n.agentId!==t)),e.stoppingVpTurnIds=Object.fromEntries(Object.entries(e.stoppingVpTurnIds||{}).filter(([n])=>e.activeVpTurns?.[n])),e.vpStatuses=Object.fromEntries(Object.entries(e.vpStatuses||{}).filter(([,n])=>n?.agentId&&n.agentId!==t));let s=ca(t);e.yeaftProcessingSessions=Object.fromEntries(Object.entries(e.yeaftProcessingSessions||{}).filter(([n])=>!n.startsWith(s)))}function Vt(e,t){return`${e||""}:${t||""}`}function xv(e){return e?.kind==="action"&&typeof e.actionId=="string"&&Number.isInteger(Number(e.generation))&&Number(e.generation)>0?{kind:"action",actionId:e.actionId,generation:Number(e.generation)}:{kind:"coordinator"}}function Tv(e){return typeof e=="string"?e:e?.kind==="action"&&typeof e.actionId=="string"?{kind:"action",actionId:e.actionId,generation:Number.isInteger(Number(e.generation))?Number(e.generation):0}:{kind:"coordinator"}}function Mv(e={}){let t=Qe(e.quote);return{agentId:e.agentId||"",workItemId:e.workItemId||"",target:xv(e.target),text:String(e.text||""),...t?{quote:t}:{},attachments:Array.isArray(e.attachments)?e.attachments.map(s=>({fileId:s?.fileId||"",name:s?.name||"",mimeType:s?.mimeType||"",size:Math.max(0,Number(s?.size)||0)})):[],revision:Number(e.revision)||0,planRevision:Number(e.planRevision)||0,ledgerRevision:Number(e.ledgerRevision)||0,coordinatorRevision:Number(e.coordinatorRevision)||0}}function Pu(e,t,s){return{conversationId:s||null,agentId:e?.agentId||t?.agentId||null,requestId:t?.requestId||null,toolCallId:t?.toolCallId||null,sessionId:e?.sessionId||t?.sessionId||null,vpId:e?.vpId||t?.vpId||null,turnId:e?.turnId||t?.turnId||null,threadId:e?.threadId||t?.threadId||null}}function Ru(e,t){return{conversationId:t||null,agentId:e?.agentId||null,requestId:e?.askRequestId||null,toolCallId:e?.toolId||null,sessionId:e?.sessionId||e?.groupId||null,vpId:e?.vpId||e?.speakerVpId||null,turnId:e?.turnId||null,threadId:e?.threadId||null}}function Pv(e,t){return _a.every(s=>!t[s]||e[s]===t[s])}function Nu(e,t){return _a.every(s=>!e[s]||!t[s]||e[s]===t[s])}function _u(e,t,s){let n=(e||[]).filter(o=>o?.type==="tool-use"&&(o.toolName==="AskUser"||o.toolName==="AskUserQuestion")&&(!t.requestId||!o.askRequestId||o.askRequestId===t.requestId)&&(!t.toolCallId||!o.toolId||o.toolId===t.toolCallId)),r=n.filter(o=>Pv(Ru(o,s),t));if(r.length===1)return r[0];let i=n.filter(o=>Nu(Ru(o,s),t));return i.length===1?i[0]:null}function qu(e){return _a.map(t=>e[t]||"").join("\0")}function Rv(e,t,s){let n=qu(t),r={...e._yeaftAskTerminalEvents||{},[n]:{identity:t,event:s,receivedAt:Date.now()}},i=Object.keys(r);if(i.length>Mu){i.sort((o,a)=>r[o].receivedAt-r[a].receivedAt);for(let o of i.slice(0,i.length-Mu))delete r[o]}e._yeaftAskTerminalEvents=r}function Eu(e,t){let s=e._yeaftAskTerminalEvents||{},n=qu(t),r=s[n]?n:null;if(!r){let l=Object.entries(s).filter(([,c])=>Nu(c.identity||{},t));l.length===1&&(r=l[0][0])}if(!r)return null;let i=s[r],{[r]:o,...a}=s;return e._yeaftAskTerminalEvents=a,i?.event||null}function _v(e,t,s){return(e.messagesMap?.[t]||[]).some(n=>n?.type==="tool-use"&&n.sessionId===s&&n.hasResult===!1)}function xa(e,t){t.type==="ask_user_answered"?(e.askAnswered=!0,e.selectedAnswers=t.answers||{},e.askExpired=!1):(e.isHistory=!0,e.askExpired=!0,e.askAnswered=!1,e.selectedAnswers=null),e.askPending=!1,e.pendingAnswers=null,e.askSubmitGeneration=null,e.askRequestId=null}function Ev(e){if(!e||typeof e!="string")return null;let t=e.match(/^(\d+)/);if(!t)return null;let s=Number(t[1]);return Number.isFinite(s)?s:null}function Dv(e){if(!e||typeof e!="string")return null;let t=e.match(/^m(\d+)$/);if(!t)return null;let s=Number(t[1]);return Number.isFinite(s)?s:null}function er(e){return $n(e)}function Ta(e,t,s){return`${mt(e,t)}::${s||""}`}function Ma(e){return Object.fromEntries(Object.entries(e||{}).filter(([,t])=>t?.status==="running"))}function Zt(){try{return typeof window>"u"?null:window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore()||null}catch{return null}}function Du(e){let t=Zt();if(!t?.reorderSessionsGlobally)return;let s=(Array.isArray(e)?e:[]).filter(n=>n?.runtimeProvider==="yeaft").map(n=>`${n.routeRef?.agentId||""}${n.routeRef?.sessionId||""}`).filter(n=>!n.startsWith(""));t.reorderSessionsGlobally(s)}function Se(e,t,s=null){if(s)return s;if(t){let n=Zt(),r=n?.activeSessionKey?n.sessions?.[n.activeSessionKey]:null;if(r?.id===t&&r.agentId)return r.agentId;let i=n&&typeof n.sessionById=="function"?n.sessionById(t,e?.currentAgent||null):null;if(i&&i.agentId)return i.agentId;let o=e?.yeaftSessionAgentById?e.yeaftSessionAgentById[t]:null;if(o)return o}return e?.currentAgent||null}function Lv(e,t){let s=i=>String(i||"").replace(/^v/,"").split(".").slice(0,3).map(o=>Number.parseInt(o,10)),n=s(e),r=s(t);if(n.length<3||r.length<3||[...n,...r].some(i=>!Number.isFinite(i)))return!1;for(let i=0;i<3;i+=1)if(n[i]!==r[i])return n[i]>r[i];return!0}function Lu(e,t,s){if(!t||!s)return!1;let n=Array.isArray(e?.agents)?e.agents.find(o=>o?.id===t):null,r=e?.currentAgentInfo?.id===t?e.currentAgentInfo:null;return(n?.capabilities||r?.capabilities||[]).includes(s)?!0:s==="session_history_search"&&Lv(n?.version||r?.version,"1.0.166")}function Is(e,{fallbackDefault:t=!1}={}){if(e?.yeaftActiveSessionFilter)return e.yeaftActiveSessionFilter;let s=Zt();return s?.activeSessionId?s.activeSessionId:t?"grp_default":null}function si(e){let t=e.yeaftDebugSessionFilter;if(t==="__all__")return null;if(t)return t;let s=Is(e);return s||(Zt()?.sessions?.grp_default?"grp_default":null)}function Pa(e,t="session"){return[e?.vpId||e?.ownerVpId||"vp",e?.threadId||"thread",e?.turnId||t].join(":")}function Ht(e,t,s=null){return s||t&&e?.yeaftConversationIdsByAgent?.[t]||e?.yeaftConversationId||null}function vt(e,t=null,s=null){let n=t||e?.yeaftActiveSessionFilter||null,r=s||Se(e,n);return(r&&e?.yeaftConversationIdsByAgent?e.yeaftConversationIdsByAgent[r]:null)||e?.yeaftConversationId||null}function $u(e,t,s){if(e?.currentView!=="yeaft")return!1;let n=e?.yeaftActiveSessionFilter||null;if(n&&t!==n)return!1;let r=Se(e,n);return!r||!s||r===s}var wv,Ve,ei,ti,Iv,tr,Cv,Av,Mu,_a,Vu,Ra,Hu,Ou,Cs,ri=F(()=>{gt();xo();$t();Ro();Fn();gd();Ad();Qd();us();Gt();su();Wo();qr();iu();ou();lu();Mo();wa();Ko();Xt();Jr();Fs();Xo();Qn();Au();sa();na();({defineStore:wv}=Pinia),Ve=Object.freeze([]),ei=(e,t,s)=>`${e||""}::${t||""}::${s}`;ti=5,Iv=15e3,tr=new Set(["typing","thinking","retrying","streaming","tool"]),Cv=Object.freeze(["model","availableModels","refreshedAt","catalogRefreshedAt","catalogEpoch","catalogRevision","catalogDigest","refreshStartedAt","refreshReason","refreshError","refreshing"]),Av=8,Mu=64;_a=Object.freeze(["conversationId","agentId","requestId","toolCallId","sessionId","vpId","turnId","threadId"]);Vu=1e3,Ra=1,Hu=5,Ou=200,Cs=wv("chat",{state:()=>({ws:null,authenticated:!1,_hasHandledAgentList:!1,_hasHandledYeaftSessionHydrate:!1,yeaftSessionInventoryCompleteSupported:null,yeaftSessionHydrateRequestId:null,yeaftSessionHydrateSlices:[],yeaftSessionHydrateError:null,_yeaftSessionInventorySocketQuarantined:!1,sessionKey:null,serverEncryptionRequired:!0,connectionState:"disconnected",reconnectAttempts:0,maxReconnectAttempts:10,reconnectTimer:null,agents:[],currentAgent:null,currentAgentInfo:null,conversations:[],activeConversations:[],currentWorkDir:null,messagesMap:{},_messageUiKeySequence:0,chatSessionState:{},panels:[],activePanelId:null,_pendingPaneId:null,conversationTitles:{},customConversationTitles:{},processingConversations:{},yeaftProcessingSessions:{},yeaftUnreadSessionKeys:{},theme:localStorage.getItem("theme")||(typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),themeFollowSystem:!localStorage.getItem("theme"),locale:localStorage.getItem("locale")||"zh-CN",executionStatusMap:{},sessionHealth:{},historySessions:[],historySessionsLoading:!1,folders:[],foldersLoading:!1,providerModels:[],providerModelsLoading:!1,contextUsage:null,lastUsedAgent:localStorage.getItem("lastUsedAgent")||null,lastUsedSession:JSON.parse(localStorage.getItem("lastUsedSession")||"null"),lastViewedConversation:localStorage.getItem("lastViewedConversation")||null,pendingRecovery:null,recoveryDismissed:!1,sessionLoading:!1,sessionLoadingText:"",agentSwitching:!1,pendingAgentSelection:null,_pendingSessionTitle:null,workbenchExpanded:!1,workbenchMaximized:!1,sidebarCollapsed:!1,sessionSidebarOpen:!1,compactStatus:null,clearStatus:null,refreshingSession:!1,refreshingSessionMap:{},sessionHistorySyncRefreshToken:0,proxyPorts:{},hasMoreMessages:!1,loadingMoreMessages:!1,chatHistoryRequests:{},chatHistoryRequestIdSupported:null,chatHistoryConnectionGeneration:0,sessionCatalog:[],hiddenSessionCatalog:[],sessionProjects:[],sessionCatalogLoaded:!1,sessionCatalogMutationRequests:{},projectMutationRequests:{},activeCatalogKey:null,openUnifiedSessionCreate:!1,openUnifiedChatCreate:!1,pendingUnifiedSessionSettings:null,yeaftHasMoreHistory:!1,yeaftLoadingMoreHistory:!1,yeaftOldestLoadedSeq:null,yeaftHistoryLoadError:null,yeaftSessionHistoryState:{},yeaftMessageWindowState:{},yeaftHistoryCacheState:{},yeaftBootstrapMetaLoadingKey:null,yeaftHistoryPerfTraceBySession:{},yeaftHistorySearchState:{requestId:null,agentId:null,sessionId:null,query:"",senderKey:"",loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,nextCursor:null,error:null},yeaftHistoryOutlineBySession:{},_yeaftHistoryOutlineTimeouts:{},_yeaftHistorySearchTimeout:null,_yeaftHistoryWindowPendingByKey:{},_yeaftHistoryRevealLeases:{},_yeaftHistoryRevealSequence:0,_yeaftReconnectCatchUpPending:!1,_yeaftOpenedSessionsLoadedAgents:{},_yeaftAgentSeen:null,slashCommandsMap:{},slashCommandDescriptions:{},inputDrafts:{},mcpServers:{},expertRoleDefinitions:null,llmConfig:{},llmModelDiscovery:{},llmGithubDevice:null,modelsDevRegistry:{registry:{},fetchedAt:0,error:null,loaded:!1},_modelsDevPending:null,yeaftSettings:{},searchSettings:null,tavilyUsage:null,tavilyUsageLoading:!1,_perfTraceQueue:[],_perfTraceFlushTimer:null,yeaftPerfTraceByMessageId:{},yeaftPerfTraceByTurnId:{},yeaftMcpServers:[],yeaftMcpRuntime:{connected:!1,toolCount:0,perServer:[]},yeaftMcpLoading:!1,yeaftMcpError:null,btwMode:!1,btwMessages:[],btwLoading:!1,btwSessionId:null,conversationMcpServers:{},conversationMcpServerTools:{},mcpPanelOpen:!1,expertSelections:[],customExpertRoles:[],subagents:{},activeSubagentId:null,activeRightPanel:null,pinnedSessions:JSON.parse(localStorage.getItem("pinned-sessions")||"[]"),...Jd(),workCenterOpen:!1,workCenterAgentId:null,workCenterItemsByAgent:{},workCenterListPageByAgent:{},workCenterListMoreLoadingByAgent:{},_workCenterListGenerationByAgent:{},_workCenterListQueryByAgent:{},_workCenterListFiltersByAgent:{},_workCenterListMoreRequestsByAgent:{},_workCenterListEventGenerationByAgent:{},_workCenterListEventsByAgent:{},_workCenterDeletedIdsByAgent:{},workCenterDetailByAgent:{},workCenterActionMessages:{},workCenterActionMessagesLoading:{},workCenterActionMessagesError:{},workCenterActionRequests:{},workCenterActionRequestDetails:{},workCenterActionRequestsLoading:{},workCenterActionRequestsError:{},workCenterActionRequestDetailsLoading:{},workCenterActionRequestDetailsError:{},workCenterLoadedByAgent:{},workCenterLoadingByAgent:{},workCenterErrorByAgent:{},workCenterWatcherByAgent:{},workCenterSettingsByAgent:{},workCenterRuntimeByAgent:{},workCenterSettingsLoadingByAgent:{},workCenterSettingsErrorByAgent:{},_workCenterSettingsGenerationByAgent:{},_workCenterDetailRequestGenerationByAgent:{},_workCenterDetailEventRefreshByAgent:{},_workCenterActionInputGenerationByAgent:{},_workCenterActionMessageRequests:{},_workCenterActionMessageGenerationByKey:{},_workCenterActionRequestsGeneration:{},_workCenterActionRequestDetailsGeneration:{},workCenterPending:{},workCenterComposerDrafts:{},workCenterMessageOutbox:{},_workCenterBrowserFence:null,_workCenterBrowserUnsubscribe:null,workCenterCreateDraft:null,yeaftConversationId:null,yeaftConversationIdsByAgent:{},_yeaftPendingConversationPromotions:{},_yeaftRetiredConversationIdsByAgent:{},_yeaftRetiredConversationTargetsByAgent:{},yeaftSessionAgentById:{},yeaftModel:null,yeaftModelEffort:null,yeaftSessionReady:!1,yeaftStatus:null,yeaftAvailableModels:[],yeaftStatusByAgent:{},_yeaftRetiredCatalogEpochsByAgent:{},yeaftModelsRefreshing:!1,yeaftModelRefreshError:null,yeaftYeaftDir:null,yeaftActiveTasksBySession:{},yeaftStoppingTasksById:{},yeaftToolStats:null,yeaftToolStatsLoading:!1,yeaftDebugLoops:[],yeaftDebugTurnsById:{},yeaftDebugTurnOrder:[],yeaftDebugHistoryLoading:!1,yeaftDebugHistoryError:null,yeaftDebugHistoryFetchedAt:0,yeaftDebugHistoryLimit:Ra,yeaftDebugHistoryHasMore:!1,yeaftDebugSearch:"",yeaftDebugSessionFilter:null,yeaftDreamLatest:{},yeaftDreamSnapshots:{},yeaftDreamPromptLoads:{},yeaftDreamEvents:{},yeaftReflectionCards:{},yeaftSubAgentCards:{},yeaftSidebarV2Enabled:!0,yeaftActiveSessionFilter:null,_currentYeaftSessionId:null,_currentYeaftVpId:null,_currentYeaftTurnId:null,_currentYeaftThreadId:null,_yeaftAskTerminalEvents:{},activeVpTurns:{},vpStatuses:{},stoppingVpTurnIds:{},yeaftVpTyping:{},_vpCrudPending:null}),getters:{currentConversation:e=>e.activeConversations[0]||null,activeConversationId:e=>ma(e),activeSessionRoute(e){if(e.currentView==="yeaft"){let n=Is(e);return n?{runtimeProvider:"yeaft",agentId:Se(e,n),sessionId:n}:null}let t=ma(e);if(!t)return null;let s=e.conversations.find(n=>n?.id===t&&n.type!=="yeaft");return s?{runtimeProvider:s.provider==="copilot"?"copilot":"claude-code",agentId:s.agentId||e.currentAgent||null,sessionId:t}:null},messages(e){let t=this.activeConversationId,s=t&&e.messagesMap[t]||Ve;if(e.currentView==="yeaft"){let n=e.yeaftActiveSessionFilter||null,r=ke(Se(e,n),n),i=e.yeaftMessageWindowState[r]?.visibleTurns||Ss();return Aa(s,e.yeaftActiveSessionFilter||null,i)}return s},yeaftAllMessages:e=>{let t=vt(e);return t&&e.messagesMap[t]||Ve},yeaftVisibleMessages(e){let t=vt(e),s=t&&e.messagesMap[t]||Ve,n=e.yeaftActiveSessionFilter||null,r=ke(Se(e,n),n),i=e.yeaftMessageWindowState[r]?.visibleTurns||Ss();return Aa(s,e.yeaftActiveSessionFilter||null,i)},hasHiddenYeaftMessages(e){if(e.currentView!=="yeaft")return!1;let t=vt(e),s=t&&e.messagesMap[t]||Ve,n=e.yeaftActiveSessionFilter||null,r=ke(Se(e,n),n),i=e.yeaftMessageWindowState[r]?.visibleTurns||Ss();return Cu(s,e.yeaftActiveSessionFilter||null,i)},activeYeaftHistoryState(e){return Qo(e)},yeaftInitialHistoryLoading(e){let t=Qo(e);return e.currentView==="yeaft"&&!!e.yeaftActiveSessionFilter&&!!t?.loading&&!t?.loaded&&this.yeaftVisibleMessages.length===0},vpsTypingInCurrentConv(e){let t=this.activeConversationId;if(!t)return Ve;let s=(e.yeaftVpTyping||{})[t];if(!s)return Ve;let n=Object.keys(s).filter(r=>(s[r]||0)>0);return n.length===0?Ve:n},isVpTypingInCurrentConv(e){return t=>{if(!t)return!1;let s=this.activeConversationId;if(!s)return!1;let n=(e.yeaftVpTyping||{})[s];return n?(n[t]||0)>0:!1}},yeaftDreamLatestForActiveSession(e){let t=si(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamLatest?.[s]||null},yeaftDreamSnapshotForActiveSession(e){let t=si(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamSnapshots?.[s]||null},yeaftDreamPromptLoadForActiveSession(e){let t=si(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamPromptLoads?.[s]||null},yeaftDreamEventsForActiveSession(e){let t=si(e);if(!t)return[];let s=`sessions/${t}`,n=Array.isArray(e.yeaftDreamEvents?.[s])?e.yeaftDreamEvents[s]:[],r=Array.isArray(e.yeaftDreamEvents?.["*"])?e.yeaftDreamEvents["*"]:[];return r.length===0?n:n.length===0?r:[...n,...r].sort((i,o)=>(i.at||0)-(o.at||0))},yeaftDebugTurnsForActiveSession:e=>{let t=e.yeaftDebugTurnOrder||Ve,s=e.yeaftDebugTurnsById||{},n=e.yeaftDebugLoops||Ve,r=e.yeaftReflectionCards||{},i=e.yeaftDebugSessionFilter,o;i==="__all__"?o=null:i?o=i:o=null;let a={};for(let d of n)!d||!d.turnId||(a[d.turnId]||(a[d.turnId]=[]),a[d.turnId].push(d));let l={};for(let d of Object.keys(r)){let u=r[d];!u||!u.turnId||(l[u.turnId]||(l[u.turnId]=[]),l[u.turnId].push(u))}let c=[];for(let d=t.length-1;d>=0;d--){let u=t[d],f=s[u];if(!f||o&&f.sessionId&&f.sessionId!==o)continue;let p=a[u]||Ve,g=l[u]||Ve,m=p.length,b=0,I=0;for(let w of p){let v=w&&w.usage;v&&Number.isFinite(v.totalTokens)?b+=v.totalTokens:v&&(b+=(v.totalInputTokens||(v.inputTokens||0)+(v.cacheReadTokens||0)+(v.cacheWriteTokens||0))+(v.outputTokens||0)),w&&Number.isFinite(w.latencyMs)&&(I+=w.latencyMs)}let y=!f.closedAt,S={...f,loopCount:y||!f.loopCount?m:f.loopCount,totalTokens:y||!f.totalTokens?b:f.totalTokens,totalMs:y||!f.totalMs?I:f.totalMs,loops:p,reflections:g};c.push(S)}return c},yeaftDebugAvailableSessions:e=>{let t=new Set;for(let s of e.yeaftDebugTurnOrder||Ve){let n=e.yeaftDebugTurnsById[s];n&&n.sessionId&&t.add(n.sessionId)}return Array.from(t).sort()},yeaftDebugTurnTotal:e=>(e.yeaftDebugTurnOrder||Ve).length,messagesCache:e=>e.messagesMap,isMultiColumn:e=>e.activeConversations.length>1,isSplitMode:e=>e.panels.length>1,isProcessing:e=>{if(e.currentView==="yeaft"){let t=Is(e);return t?xu(e,t,Se(e,t)):!1}return e.currentConversation?!!e.processingConversations[e.currentConversation]:!1},canSend:e=>!(!e.currentAgent||!e.currentConversation),currentAgentName:e=>e.currentAgentInfo?.name||"\u9009\u62E9 Agent",currentAgentWorkDir:e=>e.currentAgentInfo?.workDir||"",effectiveWorkDir:e=>e.currentView==="yeaft"?Zt()?.activeSession?.workDir||e.yeaftYeaftDir||e.currentAgentInfo?.workDir||"":e.currentWorkDir||e.currentAgentInfo?.workDir||"",currentAgentCapabilities:e=>e.currentAgentInfo?.capabilities||["terminal","file_editor","background_tasks"],hasCapability:e=>t=>(e.currentAgentInfo?.capabilities||["terminal","file_editor","background_tasks"]).includes(t),getConversationTitle:e=>t=>e.customConversationTitles[t]||e.conversationTitles[t]||null,executionStatus:e=>e.currentConversation?e.executionStatusMap[e.currentConversation]||{currentTool:null,toolHistory:[],lastActivity:null}:{currentTool:null,toolHistory:[],lastActivity:null},isConversationProcessing:e=>t=>!!e.processingConversations[t],isConversationConnecting:e=>t=>t?!!e.conversations.find(n=>n.id===t)?.connecting:!1,isConversationCompacting:e=>t=>t?e.compactStatus?.conversationId===t&&e.compactStatus?.status==="compacting":!1,isYeaftSessionProcessing:e=>(t,s=null)=>xu(e,t,s),isSessionHistorySyncing:e=>t=>{let s=t?.sessionId||null;return s?t.runtimeProvider==="yeaft"?!!e.yeaftSessionHistoryState?.[ke(t.agentId||null,s)]?.loading:!!e.chatHistoryRequests?.[zt(s)]?.loading:!1},isYeaftSessionUnread:e=>(t,s=null)=>{if(!t)return!1;let n=Se(e,t,s);return n?!!e.yeaftUnreadSessionKeys?.[Hr(n,t)]:!1},showRecoveryBanner:e=>e.pendingRecovery&&!e.recoveryDismissed&&!e.currentConversation,currentSubagents:e=>{if(!e.currentConversation)return Ve;let t=e.subagents[e.currentConversation];return t?Object.values(t):Ve},hasRunningSubagents:e=>{if(!e.currentConversation)return!1;let t=e.subagents[e.currentConversation];return t?Object.values(t).some(s=>s.status==="running"):!1},runningSubagentCount:e=>{if(!e.currentConversation)return 0;let t=e.subagents[e.currentConversation];return t?Object.values(t).filter(s=>s.status==="running").length:0},activeSubagentMessages:e=>{if(!e.currentConversation||!e.activeSubagentId)return Ve;let t=e.subagents[e.currentConversation];if(!t)return Ve;let s=t[e.activeSubagentId];return(Array.isArray(s?.messages)?s.messages:Ve).filter(r=>r?.type==="text")},selectedTaskInfo:()=>null,currentMcpServers:e=>e.currentConversation&&e.conversationMcpServers[e.currentConversation]||Ve},actions:{activateChatView({persistPreference:e=!1}={}){let t=this._pendingChatRestoreConversationId;this._pendingChatRestoreConversationId=null;let s=t?this.conversations.find(o=>o.id===t):null,n=s?.agentId?this.agents.find(o=>o.id===s.agentId&&o.online):null;!this._savedChatIdentity&&s&&n&&(this._savedChatIdentity={agentId:n.id,agentInfo:{...n},workDir:s.workDir||n.workDir||null}),this.currentView="chat",e&&fa("chat");let r=this._savedChatIdentity||null,i=this.pendingAgentSelection&&this.pendingAgentSelection.agentId!==r?.agentId;r?.agentId&&(this.currentAgent!==r.agentId||i)&&this.selectAgent(r.agentId),tu(this),t&&s&&n&&(this.autoRestoreConversation(t),this.sendWsMessage({type:"refresh_conversation",conversationId:t}))},enterWorkCenter(e=null){if(!this.hydrateWorkCenterBrowserState())return!1;let t=this.agents.filter(n=>n?.online&&Array.isArray(n.capabilities)&&n.capabilities.includes("work_center")),s=t.some(n=>n.id===e)?e:t[0]?.id||null;if(!s)return this.workCenterOpen=!1,this.workCenterAgentId=null,!1;if(this.currentAgent!==s){this.selectAgent(s),this.currentAgent=s;let n=this.agents.find(r=>r.id===s);n&&(this.currentAgentInfo=n)}return this.workCenterAgentId=s,this.workCenterOpen=!0,this.listWorkItems(s).catch(()=>{}),!0},leaveWorkCenter(){this.workCenterOpen=!1},enterWorkCenterFromSession(e,t=""){if(!e?.id)return;let s=e.agentId||Se(this,e.id),n=String(t||e.title||e.name||"").trim();this.workCenterCreateDraft={sourceAgentId:s,requirement:n,workDir:String(e.workDir||"").trim(),origin:{sessionId:e.id,messageId:null,createdBy:"user"},linkedSessionIds:[e.id]},this.enterWorkCenter(s)},hydrateWorkCenterBrowserState(){this._workCenterBrowserUnsubscribe||(this._workCenterBrowserUnsubscribe=Jl(()=>{Mn(this._workCenterBrowserFence)||this.clearWorkCenterBrowserState()}));let e=$r();if(!e)return this._workCenterBrowserFence=null,this.workCenterComposerDrafts={},this.workCenterMessageOutbox={},!1;if(!Mn(this._workCenterBrowserFence)){let t=Zl(e);this._workCenterBrowserFence=e,this.workCenterComposerDrafts=t.drafts,this.workCenterMessageOutbox=t.outbox}return!0},clearWorkCenterBrowserState(){this._workCenterBrowserFence=null,this.workCenterComposerDrafts={},this.workCenterMessageOutbox={}},workCenterComposerKey(e,t){return Vt(e,t)},saveWorkCenterComposerDraft(e,t,s={}){let n=Vt(e,t);if(!e||!t)return;let r=Qe(s.quote),i={...this.workCenterComposerDrafts||{},[n]:{text:String(s.text||""),...r?{quote:r}:{},attachments:Array.isArray(s.attachments)?s.attachments:[],target:Tv(s.target),error:String(s.error||"")}};return Ao(i,this._workCenterBrowserFence)?(this.workCenterComposerDrafts=i,!0):!1},loadWorkCenterComposerDraft(e,t){return this.workCenterComposerDrafts?.[Vt(e,t)]||null},removeWorkCenterComposerDraft(e,t){let s=Vt(e,t),n={...this.workCenterComposerDrafts||{}};return delete n[s],Ao(n,this._workCenterBrowserFence)?(this.workCenterComposerDrafts=n,!0):!1},prepareWorkCenterMessageEnvelope(e={}){let t=Mv(e),s=Vt(t.agentId,t.workItemId),n=this.workCenterMessageOutbox?.[s]||null;if(n)return n;let r={...t,clientMessageId:globalThis.crypto?.randomUUID?.()||`${Date.now()}-${Math.random()}`,createdAt:Date.now()},i={...this.workCenterMessageOutbox||{},[s]:r};return Pn(i,this._workCenterBrowserFence)?(this.workCenterMessageOutbox=i,r):null},loadWorkCenterMessageEnvelope(e,t){return this.workCenterMessageOutbox?.[Vt(e,t)]||null},replaceWorkCenterMessageEnvelopeAttachments(e,t,s=[]){let n=Vt(e,t),r=this.workCenterMessageOutbox?.[n];if(!r)return null;let i={...r,attachments:Array.isArray(s)?s.map(a=>({fileId:a?.fileId||"",name:a?.name||"",mimeType:a?.mimeType||"",size:Math.max(0,Number(a?.size)||0)})):[]},o={...this.workCenterMessageOutbox||{},[n]:i};return Pn(o,this._workCenterBrowserFence)?(this.workCenterMessageOutbox=o,i):null},discardWorkCenterMessageEnvelope(e,t){let s=Vt(e,t),n={...this.workCenterMessageOutbox||{}};return delete n[s],Pn(n,this._workCenterBrowserFence)?(this.workCenterMessageOutbox=n,!0):!1},confirmWorkCenterMessageEnvelope(e,t,s){let n=Vt(e,t),r=this.workCenterMessageOutbox?.[n];if(!r||r.clientMessageId!==s)return!1;let i={...this.workCenterMessageOutbox||{}};return delete i[n],Pn(i,this._workCenterBrowserFence)?(this.workCenterMessageOutbox=i,this.removeWorkCenterComposerDraft(e,t),!0):!1},workCenterRequest(e,t={},s=null){let n=s||this.workCenterAgentId||this.currentAgent;if(!n)return Promise.reject(new Error("No Agent selected"));let r=`work-center-${Date.now()}-${Math.random().toString(36).slice(2)}`;return new Promise((i,o)=>{let a=setTimeout(()=>{delete this.workCenterPending[r],o(new Error("Work Center request timed out"))},3e4);this.workCenterPending[r]={resolve:i,reject:o,timer:a,agentId:n,op:e,clientMessageId:typeof t.clientMessageId=="string"?t.clientMessageId:null},this.sendWsMessage({type:"work_center_request",agentId:n,requestId:r,op:e,payload:t})})},workItemMatchesBoardQuery(e,t={}){if(!e||t.lane&&e.boardLane!==t.lane||t.vpId&&!(e.executors||[]).some(n=>n?.id===t.vpId)||t.workItemType&&e.workItemType!==t.workItemType||t.updatedFrom&&Number(e.updatedAt)<Number(t.updatedFrom)||t.updatedTo&&Number(e.updatedAt)>Number(t.updatedTo))return!1;let s=String(t.keyword||"").trim().toLowerCase();return!s||String(e.title||"").toLowerCase().includes(s)||String(e.goal||"").toLowerCase().includes(s)},applyWorkItemBoardSummary(e,t,s={}){let n=Qr(e,t),r=n.find(i=>i?.id===t?.id)||null;return!r||this.workItemMatchesBoardQuery(r,s)?n:n.filter(i=>i.id!==r.id)},async listWorkItems(e=null,t={}){let s=e||this.workCenterAgentId||this.currentAgent;if(!s)return[];let n={lane:["needs_attention","active","closed"].includes(t.lane)?t.lane:null,keyword:String(t.keyword||t.search||"").trim(),vpId:String(t.vpId||"").trim(),workItemType:String(t.workItemType||"").trim(),createdFrom:Number(t.createdFrom)||null,createdTo:Number(t.createdTo)||null,updatedFrom:Number(t.updatedFrom)||null,updatedTo:Number(t.updatedTo)||null,limit:Math.min(Math.max(Number(t.limit)||100,1),200)},r=JSON.stringify(n),i=Number(this._workCenterListGenerationByAgent[s]||0)+1,o=Number(this._workCenterListEventGenerationByAgent[s]||0);this._workCenterListGenerationByAgent={...this._workCenterListGenerationByAgent,[s]:i},this._workCenterListQueryByAgent={...this._workCenterListQueryByAgent,[s]:r},this._workCenterListFiltersByAgent={...this._workCenterListFiltersByAgent,[s]:n},this.workCenterLoadingByAgent={...this.workCenterLoadingByAgent,[s]:!0},this.workCenterErrorByAgent={...this.workCenterErrorByAgent,[s]:null};try{let a=await this.workCenterRequest("list",n,s),l=(Array.isArray(a?.items)?a.items:[]).filter(d=>!this.workItemDeleted(s,d?.id));if(this._workCenterListGenerationByAgent[s]===i&&this._workCenterListQueryByAgent[s]===r&&this.workCenterAgentId===s){let d=l,u=this._workCenterListEventsByAgent[s]||{};for(let f of Object.values(u))Number(f?.generation)<=o||f?.queryKey!==r||(d=this.applyWorkItemBoardSummary(d,f.summary,n));this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[s]:d},this.workCenterListPageByAgent={...this.workCenterListPageByAgent,[s]:{nextCursor:a?.nextCursor||null,queryKey:r}},this.workCenterWatcherByAgent={...this.workCenterWatcherByAgent,[s]:a?.watcher||null},this.workCenterLoadedByAgent={...this.workCenterLoadedByAgent,[s]:!0}}return l}catch(a){throw this._workCenterListGenerationByAgent[s]===i&&this._workCenterListQueryByAgent[s]===r&&(this.workCenterErrorByAgent={...this.workCenterErrorByAgent,[s]:a?.message||String(a)}),a}finally{this._workCenterListGenerationByAgent[s]===i&&this._workCenterListQueryByAgent[s]===r&&(this.workCenterLoadingByAgent={...this.workCenterLoadingByAgent,[s]:!1})}},async loadMoreWorkItems(e=null){let t=e||this.workCenterAgentId||this.currentAgent,s=this.workCenterListPageByAgent[t],n=this._workCenterListFiltersByAgent[t];if(!t||!s?.nextCursor||!n)return[];let r=s.queryKey,i=this._workCenterListGenerationByAgent[t],o=Number(this._workCenterListEventGenerationByAgent[t]||0),a=s.nextCursor,l=`${i}:${r}:${a}`;if(this._workCenterListMoreRequestsByAgent[t]?.key===l)return this._workCenterListMoreRequestsByAgent[t].request;this.workCenterListMoreLoadingByAgent={...this.workCenterListMoreLoadingByAgent,[t]:!0};let c=(async()=>{try{let d=await this.workCenterRequest("list",{...n,cursor:a},t),u=this.workCenterListPageByAgent[t];if(this._workCenterListGenerationByAgent[t]!==i||this._workCenterListQueryByAgent[t]!==r||u?.queryKey!==r||u?.nextCursor!==a||this.workCenterAgentId!==t)return[];let f=[...this.workCenterItemsByAgent[t]||[]];for(let g of Array.isArray(d?.items)?d.items:[]){if(this.workItemDeleted(t,g?.id))continue;let m=f.findIndex(b=>b.id===g.id);m<0?f.push(g):f[m]=Qr([f[m]],g)[0]}let p=this._workCenterListEventsByAgent[t]||{};for(let g of Object.values(p))Number(g?.generation)<=o||g?.queryKey!==r||(f=this.applyWorkItemBoardSummary(f,g.summary,n));return this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[t]:f},this.workCenterListPageByAgent={...this.workCenterListPageByAgent,[t]:{nextCursor:d?.nextCursor||null,queryKey:r}},d?.items||[]}finally{if(this._workCenterListMoreRequestsByAgent[t]?.key===l){let d={...this._workCenterListMoreRequestsByAgent};delete d[t],this._workCenterListMoreRequestsByAgent=d,this.workCenterListMoreLoadingByAgent={...this.workCenterListMoreLoadingByAgent,[t]:!1}}}})();return this._workCenterListMoreRequestsByAgent={...this._workCenterListMoreRequestsByAgent,[t]:{key:l,request:c}},c},workItemDeleted(e,t){return!!this._workCenterDeletedIdsByAgent[e]?.[t]},removeWorkItemState(e,t){this._workCenterDeletedIdsByAgent={...this._workCenterDeletedIdsByAgent,[e]:{...this._workCenterDeletedIdsByAgent[e]||{},[t]:!0}},this.beginWorkCenterDetailWrite(e),this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[e]:(this.workCenterItemsByAgent[e]||[]).filter(n=>n.id!==t)},this.workCenterDetailByAgent[e]?.id===t&&(this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[e]:null});let s=`${e}:${t}:`;for(let n of["workCenterActionMessages","workCenterActionMessagesLoading","workCenterActionMessagesError","workCenterActionRequests","workCenterActionRequestsLoading","workCenterActionRequestsError","workCenterActionRequestDetails","workCenterActionRequestDetailsLoading","workCenterActionRequestDetailsError","_workCenterActionMessageRequests","_workCenterActionMessageGenerationByKey","_workCenterActionRequestsGeneration","_workCenterActionRequestDetailsGeneration"]){let r={};for(let[i,o]of Object.entries(this[n]||{}))i.startsWith(s)||(r[i]=o);this[n]=r}},beginWorkCenterDetailWrite(e){let t=Number(this._workCenterDetailRequestGenerationByAgent[e]||0)+1;return this._workCenterDetailRequestGenerationByAgent={...this._workCenterDetailRequestGenerationByAgent,[e]:t},t},commitWorkCenterDetail(e,t,s){if(t?.id&&this.workItemDeleted(e,t.id)||s!=null&&Number(this._workCenterDetailRequestGenerationByAgent[e]||0)!==s)return!1;let n=this.workCenterDetailByAgent[e];return n?.id===t?.id&&hu(t,n)?!1:(this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[e]:t},!0)},async getWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),r=await this.workCenterRequest("get",{id:e},s);return this.commitWorkCenterDetail(s,r,n),this.workCenterDetailByAgent[s]||r},invalidateWorkItemActionMessages(e,t,s,n){if(!e||!t||!s)return null;let r=rt(n),i=Ys(e,t,s,r);this._workCenterActionMessageGenerationByKey={...this._workCenterActionMessageGenerationByKey,[i]:Number(this._workCenterActionMessageGenerationByKey[i]||0)+1};for(let a of["workCenterActionMessages","workCenterActionMessagesLoading","workCenterActionMessagesError"]){let l={...this[a]};delete l[i],this[a]=l}let o={...this._workCenterActionMessageRequests};for(let a of Object.keys(o))a.startsWith(`${i}:`)&&delete o[a];return this._workCenterActionMessageRequests=o,i},async loadWorkItemActionMessages(e,t,s,n,r=null){let i=r||this.workCenterAgentId||this.currentAgent,o=rt(s),a=Ys(i,e,t,o),l=Number(this._workCenterActionMessageGenerationByKey[a]||0),c=`${a}:${n==null?"latest":String(n)}`;if(this._workCenterActionMessageRequests[c])return this._workCenterActionMessageRequests[c];this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[a]:!0},this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[a]:null};let d=(async()=>{try{let u=await this.workCenterRequest("get_action_messages",{id:e,actionId:t,generation:o,cursor:n,limit:20},i);if(this.workItemDeleted(i,e)||rt(u?.generation)!==o||Number(this._workCenterActionMessageGenerationByKey[a]||0)!==l)return u;let f=this.workCenterActionMessages[a]?.messages||[],p=Zn(f,u?.messages||[]),g=this.workCenterActionMessages[a],m=g?.nextCursor,b=n==null?null:Number(n),I=m==null?null:Number(m),y=!g||b==null||I!=null&&b===I;return this.workCenterActionMessages={...this.workCenterActionMessages,[a]:{generation:o,messages:p,nextCursor:y?u?.nextCursor??null:m,total:Math.max(Number(u?.total)||0,Number(g?.total)||0,p.length)}},u}catch(u){throw Number(this._workCenterActionMessageGenerationByKey[a]||0)===l&&(this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[a]:u?.message||String(u)}),u}finally{if(this._workCenterActionMessageRequests[c]===d){let u={...this._workCenterActionMessageRequests};delete u[c],this._workCenterActionMessageRequests=u;let f=Object.keys(u).some(p=>p.startsWith(`${a}:`));this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[a]:f}}}})();return this._workCenterActionMessageRequests={...this._workCenterActionMessageRequests,[c]:d},d},async loadWorkItemActionRequests(e,t,s,n=null){let r=n||this.workCenterAgentId||this.currentAgent,i=rt(s),o=va(r,e,t,i),a=Number(this._workCenterActionRequestsGeneration[o]||0)+1;this._workCenterActionRequestsGeneration={...this._workCenterActionRequestsGeneration,[o]:a},this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[o]:!0},this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[o]:null};try{let l=await this.workCenterRequest("get_action_requests",{id:e,actionId:t,generation:i},r),c=!this.workItemDeleted(r,e)&&rt(l?.generation)===i&&this._workCenterActionRequestsGeneration[o]===a;return c&&(this.workCenterActionRequests={...this.workCenterActionRequests,[o]:l?.requests||[]}),c?l?.requests||[]:this.workCenterActionRequests[o]||[]}catch(l){throw this._workCenterActionRequestsGeneration[o]===a&&(this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[o]:l?.message||String(l)}),l}finally{this._workCenterActionRequestsGeneration[o]===a&&(this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[o]:!1})}},async loadWorkItemActionRequest(e,t,s,n,r,i=null){let o=i||this.workCenterAgentId||this.currentAgent,a=rt(s),c=`${va(o,e,t,a)}:${n}:${r}`,d=Number(this._workCenterActionRequestDetailsGeneration[c]||0)+1;this._workCenterActionRequestDetailsGeneration={...this._workCenterActionRequestDetailsGeneration,[c]:d},this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[c]:!0},this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[c]:null};try{let u=await this.workCenterRequest("get_action_request",{id:e,actionId:t,generation:a,runId:n,requestId:r},o),f=!this.workItemDeleted(o,e)&&rt(u?.generation)===a&&this._workCenterActionRequestDetailsGeneration[c]===d;return f&&(this.workCenterActionRequestDetails={...this.workCenterActionRequestDetails,[c]:u?.request||null}),f?u?.request||null:this.workCenterActionRequestDetails[c]||null}catch(u){throw this._workCenterActionRequestDetailsGeneration[c]===d&&(this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[c]:u?.message||String(u)}),u}finally{this._workCenterActionRequestDetailsGeneration[c]===d&&(this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[c]:!1})}},async loadWorkCenterSettings(e=null){let t=e||this.workCenterAgentId||this.currentAgent;if(!t)throw new Error("No Agent selected");let s=Number(this._workCenterSettingsGenerationByAgent[t]||0)+1;this._workCenterSettingsGenerationByAgent={...this._workCenterSettingsGenerationByAgent,[t]:s},this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!0},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:null};try{let n=await this.workCenterRequest("get_settings",{},t);return this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[t]:n?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[t]:n?.runtime||null}),n}catch(n){throw this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:n?.message||String(n)}),n}finally{this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!1})}},async refreshWorkCenterRuntime(e=null){let t=e||this.workCenterAgentId||this.currentAgent;if(!t)throw new Error("No Agent selected");let s=Number(this._workCenterSettingsGenerationByAgent[t]||0)+1;this._workCenterSettingsGenerationByAgent={...this._workCenterSettingsGenerationByAgent,[t]:s},this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!0},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:null};try{let n=await this.workCenterRequest("refresh_runtime",{},t);return this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[t]:n?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[t]:n?.runtime||null}),n}catch(n){throw this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:n?.message||String(n)}),n}finally{this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!1})}},async saveWorkCenterSettings(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent;if(!s)throw new Error("No Agent selected");let n=Number(this._workCenterSettingsGenerationByAgent[s]||0)+1;this._workCenterSettingsGenerationByAgent={...this._workCenterSettingsGenerationByAgent,[s]:n};let r=await this.workCenterRequest("update_settings",{settings:e},s);return this._workCenterSettingsGenerationByAgent[s]===n&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[s]:r?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[s]:r?.runtime||null},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[s]:null}),r},previewWorkCenterPlan(e={},t=null){let s=t||this.workCenterAgentId||this.currentAgent;return this.workCenterRequest("preview",e,s)},async createWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),r=await this.workCenterRequest("create",e,s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,r,n),r},async updateWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,r=this.beginWorkCenterDetailWrite(n),i=await this.workCenterRequest("update",{id:e,patch:t},n);return await this.listWorkItems(n,this._workCenterListFiltersByAgent[n]||{}),this.commitWorkCenterDetail(n,i,r),i},async startWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),r=await this.workCenterRequest("start",{id:e},s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,r,n),r},async cancelWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),r=await this.workCenterRequest("cancel",{id:e},s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,r,n),r},async resumeWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,r=this.beginWorkCenterDetailWrite(n),i=await this.workCenterRequest("resume",{id:e,revision:t},n);return await this.listWorkItems(n,this._workCenterListFiltersByAgent[n]||{}),this.commitWorkCenterDetail(n,i,r),i},async deleteWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,r=await this.workCenterRequest("delete",{id:e,revision:t},n);return this.removeWorkItemState(n,e),r},async postWorkItemMessage(e,t,s,n,r=[],i=null,o={},a=null){if(!this.hydrateWorkCenterBrowserState())throw new Error("Work Center browser owner is unavailable; sign in again and retry");let l=i||this.workCenterAgentId||this.currentAgent,c=this.prepareWorkCenterMessageEnvelope({agentId:l,workItemId:e,target:s,text:t,quote:a,attachments:r,revision:n,planRevision:o.planRevision,ledgerRevision:o.ledgerRevision,coordinatorRevision:o.coordinatorRevision});if(!c)throw new Error("Work Center browser owner changed; reopen Work Center and try again");let d=c.clientMessageId,u=this.workCenterDetailByAgent[l]?.id===e?this.workCenterDetailByAgent[l]:null,f=await this.workCenterRequest("post_work_item_message",{id:c.workItemId,clientMessageId:d,text:c.text,target:c.target,revision:c.revision,planRevision:c.planRevision||Number(u?.planRevision)||0,ledgerRevision:c.ledgerRevision||Number(u?.ledgerRevision)||0,coordinatorRevision:Number.isInteger(Number(c.coordinatorRevision))?Number(c.coordinatorRevision):Number(u?.coordinatorRevision)||0,...c.quote?{quote:c.quote}:{},attachments:c.attachments},l);if(c.target.kind==="coordinator"){if(!f?.accepted)throw new Error("Work Center Coordinator did not accept the message");return this.confirmWorkCenterMessageEnvelope(l,e,d),f}return await this.listWorkItems(l,this._workCenterListFiltersByAgent[l]||{}),this.confirmWorkCenterMessageEnvelope(l,e,d),f},async sendWorkItemMessage(e,t,s,n=[],r=null,i={},o=null){let a=r||this.workCenterAgentId||this.currentAgent,l=this.workCenterDetailByAgent[a]?.id===e?this.workCenterDetailByAgent[a]:null,c=await this.workCenterRequest("work_item_message",{id:e,text:t,revision:s,planRevision:Number.isInteger(Number(i.planRevision))?Number(i.planRevision):Number(l?.planRevision)||0,ledgerRevision:Number.isInteger(Number(i.ledgerRevision))?Number(i.ledgerRevision):Number(l?.ledgerRevision)||0,coordinatorRevision:Number.isInteger(Number(i.coordinatorRevision))?Number(i.coordinatorRevision):Number(l?.coordinatorRevision)||0,...Qe(o)?{quote:Qe(o)}:{},attachments:Array.isArray(n)?n:[]},a);if(!c?.accepted)throw new Error("Work Center Coordinator did not accept the message");return c},async retryWorkItemAction(e,t,s,n,r=null){let i=r||this.workCenterAgentId||this.currentAgent,o=this.beginWorkCenterDetailWrite(i),a=await this.workCenterRequest("retry_action",{id:e,actionId:t,revision:s,generation:n},i);return await this.listWorkItems(i,this._workCenterListFiltersByAgent[i]||{}),this.commitWorkCenterDetail(i,a,o),a},async sendWorkItemActionInput(e,t,s,n,r,i=[],o=null,a=null){let l=o||this.workCenterAgentId||this.currentAgent,c=Number(this._workCenterActionInputGenerationByAgent[l]||0)+1;this._workCenterActionInputGenerationByAgent={...this._workCenterActionInputGenerationByAgent,[l]:c};let d=Qe(a),u=await this.workCenterRequest("action_input",{id:e,text:t,actionId:s,revision:n,generation:r,attachments:i,...d?{quote:d}:{}},l);await this.listWorkItems(l,this._workCenterListFiltersByAgent[l]||{});let f=this.workCenterDetailByAgent[l],p=f?.actions?.find(m=>m?.id===s),g=f?.id===e&&Number(f.revision)===Number(n)&&p&&Number(p.generation)===Number(r);return this._workCenterActionInputGenerationByAgent[l]===c&&g&&!uu(u,f)?(this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[l]:u},u):f?.id===e?f:u},async guideWorkItemAction(e,t,s,n,r,i=[],o=null){let a=o||this.workCenterAgentId||this.currentAgent,l=this.beginWorkCenterDetailWrite(a),c=await this.workCenterRequest("guide",{id:e,guidance:t,actionId:s,revision:n,generation:r,attachments:i},a);return await this.listWorkItems(a,this._workCenterListFiltersByAgent[a]||{}),this.commitWorkCenterDetail(a,c,l),c},previewWorkItemAttachment(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent;return this.workCenterRequest("preview_attachment",{id:e,attachmentId:t},n)},applyWorkCenterEvent(e,t){if(!e||!t?.workItem)return;let s=t.workItem;if(t.clientMessageId){this.confirmWorkCenterMessageEnvelope(e,s.id,t.clientMessageId);let u=Object.entries(this.workCenterPending||{}).find(([,f])=>f?.agentId===e&&f.clientMessageId===t.clientMessageId);if(u){let[f,p]=u;clearTimeout(p.timer),delete this.workCenterPending[f],p.resolve(t.type==="coordinator.turn_started"?{accepted:!0,turnId:null,receipt:!0}:t.workItem)}}let n=this.workCenterItemsByAgent[e]||[];if(t.type==="work_item.deleted"){this.removeWorkItemState(e,s.id);return}if(this.workItemDeleted(e,s.id))return;let r=this._workCenterListFiltersByAgent[e]||{},i=this._workCenterListEventsByAgent[e]?.[s.id]?.summary||null,o=n.some(u=>u?.id===s.id)?n:i?[i]:[],a=Qr(o,s).find(u=>u?.id===s.id)||s,l=Number(this._workCenterListEventGenerationByAgent[e]||0)+1;this._workCenterListEventGenerationByAgent={...this._workCenterListEventGenerationByAgent,[e]:l},this._workCenterListEventsByAgent={...this._workCenterListEventsByAgent,[e]:{...this._workCenterListEventsByAgent[e]||{},[s.id]:{generation:l,queryKey:this._workCenterListQueryByAgent[e]||null,summary:a}}};let c=this.applyWorkItemBoardSummary(n,a,r);this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[e]:c};let d=this.workCenterDetailByAgent[e];if(d?.id===s.id){let u=t.type==="run.finished"&&t.actionId&&Array.isArray(s.actionStats)&&s.actionStats.some(I=>I?.id===t.actionId)?{...s,eventActionId:t.actionId}:s,f=ba(d,u),p=Number(s.coordinatorRevision),g=Number(d.coordinatorRevision)||0,m=Number.isInteger(p)&&p>g,b=pu(d,u);this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[e]:fu(d,s)},b&&this.refreshWorkItemDetailAfterActionChange(e,s,m?null:f)}},async refreshWorkItemDetailAfterActionChange(e,t,s=null){let n=s?(Array.isArray(t.actionStats)?t.actionStats:[]).find(m=>m?.id===s.actionId):(Array.isArray(t.actionStats)?t.actionStats:[]).find(m=>m?.id===t.currentActionId)||t.currentAction,r=s?.actionId||t.currentActionId||null,i=Number(s?.generation??n?.generation),o=Number.isInteger(i)&&i>0?i:null,a=Number(t.coordinatorRevision),l=!s&&Number.isInteger(a)&&a>=0?a:null,c=Number(s?.attempt),d=Number.isInteger(c)&&c>=0?c:null,u=l!=null?`${t.id}:coordinator:${l}`:`${t.id}:${r}${o==null?"":`:${o}`}${d==null?"":`:${d}`}`;if(this._workCenterDetailEventRefreshByAgent[e]?.key===u)return;let f=this.beginWorkCenterDetailWrite(e),p={key:u,generation:f};this._workCenterDetailEventRefreshByAgent={...this._workCenterDetailEventRefreshByAgent,[e]:p},s&&this.invalidateWorkItemActionMessages(e,t.id,s.actionId,s.generation);let g=r&&o!=null?this.loadWorkItemActionMessages(t.id,r,o,null,e).catch(()=>null):null;try{let m=await this.workCenterRequest("get",{id:t.id},e),b=this.workCenterDetailByAgent[e],I=b?.actions?.find(M=>M?.id===r),y=m?.actions?.find(M=>M?.id===r),S=o==null||rt(I?.generation)===o,w=o==null||rt(y?.generation)>=o,v=l==null||Number(m?.coordinatorRevision)===l,h=l!=null||S&&w&&(t.currentActionId==null?m?.currentActionId==null:b?.currentActionId===t.currentActionId&&m?.currentActionId===t.currentActionId);b?.id===t.id&&v&&h&&this.commitWorkCenterDetail(e,m,f)&&g&&await g}catch{}finally{if(this._workCenterDetailEventRefreshByAgent[e]===p){let m={...this._workCenterDetailEventRefreshByAgent};delete m[e],this._workCenterDetailEventRefreshByAgent=m}}},cacheYeaftAgentStatus(e,t,{allowBootstrapCatalog:s=!1}={}){if(!e||!t)return;let n=this.yeaftStatusByAgent[e]||{},r=Number(n.catalogRevision)||0,i=Number(t.catalogRevision)||0,o=typeof n.catalogEpoch=="string"?n.catalogEpoch:"",a=typeof t.catalogEpoch=="string"?t.catalogEpoch:"",l=Number(n.catalogRefreshedAt)||0,c=Number(t.catalogRefreshedAt)||0,d=Array.isArray(t.availableModels),u=t.type==="yeaft_status"&&d&&(i>0||c>0),f=Array.isArray(this._yeaftRetiredCatalogEpochsByAgent?.[e])?this._yeaftRetiredCatalogEpochsByAgent[e]:[],p=!!a&&f.includes(a),g=!!a&&a===o,m=i>0?g&&i===r:c>0&&c===l,b=i>0?!!a&&(a!==o||i>r):r===0&&c>l,I=i>0?!!t.catalogDigest&&!!n.catalogDigest&&t.catalogDigest===n.catalogDigest:t.catalogDigest===n.catalogDigest,y=u&&!p&&(b||m&&I),w=y||s&&r===0&&l===0&&!u&&d,v={...t};if(!w)for(let M of Cv)delete v[M];let h={...n,...v};if(w){if(y&&o&&a&&o!==a){let M=[...f.filter(x=>x!==o),o].slice(-Av);this._yeaftRetiredCatalogEpochsByAgent={...this._yeaftRetiredCatalogEpochsByAgent||{},[e]:M}}h.availableModels=t.availableModels,h.catalogRefreshedAt=y?c:null,h.catalogEpoch=y&&a||null,h.catalogRevision=y&&i||null,h.catalogDigest=y&&t.catalogDigest||null}this.yeaftStatusByAgent={...this.yeaftStatusByAgent,[e]:h},this.currentAgent===e&&this.applyCachedYeaftStatus(e)},applyCachedYeaftStatus(e=this.currentAgent){let t=e?this.yeaftStatusByAgent[e]:null;return t?(this.yeaftModel=t.model||null,this.yeaftModelEffort=t.modelEffort||null,this.yeaftAvailableModels=Array.isArray(t.availableModels)?t.availableModels:[],this.yeaftModelsRefreshing=!!t.refreshing,this.yeaftModelRefreshError=t.refreshError||null,this.yeaftYeaftDir=t.yeaftDir||null,this.yeaftStatus={skills:t.skills,mcpServers:t.mcpServers,tools:t.tools,multiVp:!!t.multiVp},!0):!1},activateYeaftAgentCatalog(e,t=this.currentAgent){let s=e?this.yeaftStatusByAgent[e]:null;return s&&this.applyCachedYeaftStatus(e),Array.isArray(s?.availableModels)?!0:(this.yeaftModel=null,this.yeaftModelEffort=null,this.yeaftAvailableModels=[],s||(this.yeaftStatus=null),this.yeaftModelsRefreshing=!!e&&!s?.refreshError,this.yeaftModelRefreshError=s?.refreshError||null,t!==e&&(this.yeaftYeaftDir=null),!1)},activateYeaftAgent(e,t=null){if(!e)return!1;let s=this.currentAgent;return this.currentAgent=e,t&&(this.currentAgentInfo=t),this.activateYeaftAgentCatalog(e,s)},resolveYeaftSessionAgentId(e){return Se(this,e)},requestYeaftSessionInventory(){if(this.yeaftSessionInventoryCompleteSupported===!1&&this.yeaftSessionHydrateRequestId)return this.yeaftSessionHydrateRequestId;if(this._yeaftSessionInventorySocketQuarantined)return this.manualReconnect(),null;clearTimeout(this._legacyYeaftSessionHydrateTimer),this._legacyYeaftSessionHydrateTimer=null;let e=`session_inventory_${crypto.randomUUID()}`;this.yeaftSessionHydrateRequestId=e,this.yeaftSessionHydrateSlices=[],this._hasHandledAgentList=!1,this._hasHandledYeaftSessionHydrate=!1,this.yeaftSessionHydrateError=null;let t=this.conversations.map(n=>n.id).filter(Boolean);return this.sendWsMessage({type:"get_agents",requestId:e,conversationIds:t.length>0?t:void 0})?(setTimeout(()=>{this.yeaftSessionHydrateRequestId===e&&(this.yeaftSessionHydrateRequestId=null,this.yeaftSessionHydrateSlices=[],this.yeaftSessionHydrateError="session_inventory_timeout",this.yeaftSessionInventoryCompleteSupported!==!0&&(this._yeaftSessionInventorySocketQuarantined=!0))},Iv),e):(this.yeaftSessionHydrateRequestId=null,this.yeaftSessionHydrateSlices=[],this.yeaftSessionHydrateError="session_inventory_send_failed",null)},beginYeaftHistoryLoad(e){let t=jc(this,e);if(!t)return null;this.sessionHistorySyncRefreshToken+=1;let{agentId:s,sessionId:n}=e||{};return setTimeout(()=>{Go(this,{agentId:s,sessionId:n,requestId:t.requestId,error:"history_load_timeout"})&&(this.sessionHistorySyncRefreshToken+=1)},Wc),t},finishYeaftHistoryLoad(e,t={},s="chunk"){let n=Uc(this,e,t,s);return n&&s!=="completion"&&(this.sessionHistorySyncRefreshToken+=1),n},isCurrentYeaftHistoryResponse(e){return Yo(this,e)},syncActiveYeaftHistoryLoad(){return jn(this)},enterYeaft(e=null,{deferBootstrap:t=!1}={}){let s=this.currentAgent;ga(this);let n=Is(this),r=!e&&n?Se(this,n):null,i=e||r||this.currentAgent||null;if(!i){let a=this.agents.find(l=>l.online);a&&(i=a.id)}if(i&&this.currentAgent!==i){this.selectAgent(i),this.currentAgent=i;let a=this.agents.find(l=>l.id===i);a&&(this.currentAgentInfo=a)}if(!this.applyCachedYeaftStatus(i)&&s&&s!==i&&(this.yeaftAvailableModels=[],this.yeaftStatus=null,this.yeaftModelsRefreshing=!0,this.yeaftModelRefreshError=null),i){let a=this.yeaftConversationIdsByAgent?.[i]||null;a||(a=`yeaft-local-${i}-${Date.now()}`,this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[i]:a}),this.yeaftConversationId=a}else this.yeaftConversationId||(this.yeaftConversationId=`yeaft-local-${Date.now()}`);this.messagesMap[this.yeaftConversationId]||(this.messagesMap[this.yeaftConversationId]=[]),eu(this),this.currentView="yeaft",fa("yeaft"),this.hasMoreMessages=!1,this.loadingMoreMessages=!1,this.yeaftHasMoreHistory=!1,this.yeaftLoadingMoreHistory=!1,this.yeaftOldestLoadedSeq=null,this._yeaftReconnectCatchUpPending=!1,this.loadOpenedYeaftSessionsForConnectedAgents(null,{force:!0}),t||this.requestYeaftSessionBootstrap({forceSessionReady:!0,catchUpHistory:!0,forceHistoryReplay:!0})},loadOpenedYeaftSessionsForConnectedAgents(e=null,{force:t=!1}={}){let s=Array.isArray(e)?e.filter(Boolean):Array.isArray(this.agents)?this.agents.filter(i=>i&&i.online&&i.id).map(i=>i.id):[],n=[...new Set(s)];(!this._yeaftOpenedSessionsLoadedAgents||typeof this._yeaftOpenedSessionsLoadedAgents!="object")&&(this._yeaftOpenedSessionsLoadedAgents={});let r=[];for(let i of n)!t&&this._yeaftOpenedSessionsLoadedAgents[i]||(this._yeaftOpenedSessionsLoadedAgents[i]=Date.now(),r.push(i),this.sessionCrudRequest("list",{},{agentId:i}).catch(o=>{delete this._yeaftOpenedSessionsLoadedAgents[i]}));return r},requestYeaftSessionBootstrap({forceSessionReady:e=!1,catchUpHistory:t=!1,forceHistoryReplay:s=!1}={}){if(!this.currentAgent)return;let n=Is(this),r=n?Se(this,n):this.currentAgent,i=ke(r,n),o=n?this.yeaftSessionHistoryState[i]:null,a=e||!this.yeaftSessionReady||!this.yeaftModel||!this.yeaftStatus,l=Number.isFinite(o?.latestSeq)?o.latestSeq:null,c=!!n&&!!this.yeaftConversationId&&Array.isArray(this.messagesMap?.[this.yeaftConversationId])&&this.messagesMap[this.yeaftConversationId].some(y=>y&&(y.sessionId??y.groupId??null)===n),d=!!n&&Oo({sessionState:o,hasCachedSessionRows:c,force:!!s}),u=!!n&&!d&&Lc(o,t);if(!a&&!d&&!u)return!1;let f=`${r}:${n||"__none__"}`,p=a&&!d&&!u;if(p&&this.yeaftBootstrapMetaLoadingKey===f)return!1;p&&(this.yeaftBootstrapMetaLoadingKey=f);let g=null;n&&d?g=this.beginYeaftHistoryLoad({agentId:r,sessionId:n,mode:"recent",preserveLoaded:!1}):n&&c&&!o?.loaded?(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[i]:{...o||{},loaded:!0,loading:!1,hasMore:!!o?.hasMore,oldestSeq:Number.isFinite(o?.oldestSeq)?o.oldestSeq:null,count:o?.count||0,latestSeq:l}},this.yeaftLoadingMoreHistory=!1):n&&u&&(g=this.beginYeaftHistoryLoad({agentId:r,sessionId:n,mode:"delta",preserveLoaded:!0,latestSeq:l}));let m={type:"yeaft_load_history",agentId:r,sessionId:n,...g?{requestId:g.requestId}:{}};u?m.afterSeq=l:m.limit=d?ti:0;let b=gs();m.perfTraceId=b;let I=u?"delta":d?"recent":"metadata";return n&&(this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[i]:b}),Ge(this,{traceId:b,phase:"history.request_send",agentId:r,sessionId:n,messageType:m.type,bytes:JSON.stringify(m).length,detail:{mode:I,limit:m.limit??null,afterSeq:m.afterSeq??null,hasCachedSessionRows:c,needSessionReady:a}}),this.sendWsMessage(m),!0},leaveYeaft(){this.activateChatView({persistPreference:!0})},fetchYeaftToolStats(){this.currentAgent&&(this.yeaftToolStatsLoading=!0,this.sendWsMessage({type:"yeaft_fetch_tool_stats",agentId:this.currentAgent}),this._fetchYeaftToolStatsTimer&&clearTimeout(this._fetchYeaftToolStatsTimer),this._fetchYeaftToolStatsTimer=setTimeout(()=>{this.yeaftToolStatsLoading&&(this.yeaftToolStatsLoading=!1,this.yeaftToolStats={...this.yeaftToolStats||{snapshot:{},registered:[],unused:[]},error:null,notice:"Tool stats are unavailable right now. Try again after the agent reconnects.",fetchedAt:Date.now()}),this._fetchYeaftToolStatsTimer=null},1e4))},loadYeaftDebugHistory({groupId:e,limit:t,dreamLimit:s,indexOnly:n=!1,detailTurnId:r=null,search:i=void 0}={}){if(!this.currentAgent)return;let o=typeof i=="string"?i.trim():(this.yeaftDebugSearch||"").trim(),a=typeof r=="string"&&r,l=o&&!a?Hu:Ra,c=Number.isFinite(t)&&t>0?t:this.yeaftDebugHistoryLimit||l,d=Math.max(1,Math.min(l,c)),u=a?"detail":"list",f=`dbg_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,p=JSON.stringify({agentId:this.currentAgent,groupId:e||null,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5,indexOnly:!!n,detailTurnId:r||null,search:a?"":o});if(this._yeaftDebugHistoryInFlightKey===p)return;this._yeaftDebugHistoryInFlightKey=p,a?this._yeaftDebugHistoryLatestDetailRequestId=f:this._yeaftDebugHistoryLatestListRequestId=f,this.yeaftDebugHistoryLimit=d,this.yeaftDebugHistoryLoading=!0,this.yeaftDebugHistoryError=null;let g={type:"yeaft_fetch_debug_history",agentId:this.currentAgent,requestId:f,requestKind:u,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5};n&&(g.indexOnly=!0),typeof r=="string"&&r?g.detailTurnId=r:o&&(g.search=o),typeof e=="string"&&e&&(g.sessionId=e),this.sendWsMessage(g),this._fetchYeaftDebugHistoryTimer&&clearTimeout(this._fetchYeaftDebugHistoryTimer),this._fetchYeaftDebugHistoryTimer=setTimeout(()=>{this.yeaftDebugHistoryLoading&&(this.yeaftDebugHistoryLoading=!1,this.yeaftDebugHistoryError="Debug history is unavailable right now. Try again after the agent reconnects."),this._yeaftDebugHistoryInFlightKey=null,this._fetchYeaftDebugHistoryTimer=null},1e4)},agentIdForSession(e){return Se(this,e)},sendYeaftSessionMessage({groupId:e,text:t,mentions:s,attachments:n,quote:r}){let i=Se(this,e);if(!e||!i)return;let o=Array.isArray(n)?n.filter(g=>g&&g.fileId):[],a=Qe(r),l=o.length>0;if(!t?.trim()&&!l)return;let c=t?.trim()?t:"(attached files)",d=`u_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,u=gs();this.yeaftPerfTraceByMessageId={...this.yeaftPerfTraceByMessageId||{},[d]:u},Ge(this,{traceId:u,phase:"send.prepare",agentId:i,sessionId:e,turnId:d,messageType:"yeaft_session_send",detail:{mentionCount:Array.isArray(s)?s.length:0,attachmentCount:o.length,quoted:!!a}});let f=vt(this,e);if(f){let g={id:d,messageId:d,clientMessageId:d,stableKey:Yt(i,e,d),uiKey:Yt(i,e,d),type:"user",content:c,sessionId:e,turnId:d,...a?{quote:a}:{}};if(o.length>0&&(g.attachments=o.map(m=>({fileId:m.fileId,name:m.name,preview:m.preview,isImage:!!m.isImage,mimeType:m.mimeType||""}))),this.addMessageToConversation(f,g),this.processingConversations[f]=!0,e){let m=mt(i,e);this.yeaftProcessingSessions={...this.yeaftProcessingSessions,...m?{[m]:!0}:{}}}this._turnCompletedConvs?.delete(f),this._closedAt?.[f]&&delete this._closedAt[f],this.getOrCreateExecutionStatus(f),Bs(this,f)}let p={type:"yeaft_session_send",agentId:i,id:d,sessionId:e,text:c,mentions:Array.isArray(s)?s:[],perfTraceId:u,...a?{quote:a}:{}};o.length>0&&(p.attachments=o.map(g=>({fileId:g.fileId,isImage:!!g.isImage}))),Ge(this,{traceId:u,phase:"send.websocket_send",agentId:i,sessionId:e,turnId:d,messageType:p.type,bytes:JSON.stringify(p).length}),this.sendWsMessage(p)},cancelYeaftTask({agentId:e=null,sessionId:t,taskId:s}){let n=typeof t=="string"?t.trim():"",r=typeof s=="string"?s.trim():"",i=Se(this,n,e);return!i||!n||!r?!1:(this.yeaftStoppingTasksById={...this.yeaftStoppingTasksById,[Ta(i,n,r)]:!0},this.sendWsMessage({type:"yeaft_task_cancel",agentId:i,sessionId:n,taskId:r,clientRequestId:`task_cancel_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}),!0)},getYeaftMessageWindowKey(e=null,t=null){let s=e||this.yeaftActiveSessionFilter||null,n=Se(this,s,t);return ke(n,s)},pruneYeaftMessageWindow(e=null,t=null){if(this.currentView!=="yeaft")return;let s=this.getYeaftMessageWindowKey(e,t);Object.values(this._yeaftHistoryRevealLeases||{}).some(r=>r?.sessionKey===s)||(this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[s]:{visibleTurns:Ss()}})},expandYeaftMessageWindow(e=null,t=Jn(),s=null){if(this.currentView!=="yeaft")return;let n=this.getYeaftMessageWindowKey(e,s),i=(this.yeaftMessageWindowState[n]?.visibleTurns||Ss())+Math.max(1,Number.isFinite(t)?Math.floor(t):Jn());this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[n]:{visibleTurns:i}}},isYeaftMessageCached(e,t,s=null,n=null){let r=e||this.yeaftActiveSessionFilter||null,i=s||vt(this,r,n);return!i||!t?!1:(this.messagesMap[i]||[]).some(o=>(!r||(o?.sessionId??o?.groupId??null)===r)&&((o?.id||o?.messageId)===t||o?.persistedMessageId===t))},revealYeaftMessage(e,t,s=null,n=null){let r=e||this.yeaftActiveSessionFilter||null,i=Se(this,r,n),o=s||vt(this,r,i);if(!o||!t)return!1;let a=(this.messagesMap[o]||[]).filter(p=>r?(p?.sessionId??p?.groupId??null)===r:!0),l=a.findIndex(p=>(p?.id||p?.messageId)===t||p?.persistedMessageId===t);if(l<0)return!1;let c=Su(a),d=c.findIndex(p=>l>=p.start&&l<p.end);if(d<0)return!1;let u=Math.max(Ss(),c.length-d),f=this.getYeaftMessageWindowKey(r,i);return this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[f]:{visibleTurns:u}},!0},getYeaftHistoryOutlineState(e=null,t=null){let s=e||this.yeaftActiveSessionFilter||null,n=Se(this,s,t),r=ke(n,s),i=this.yeaftHistoryOutlineBySession[r]||{requestId:null,agentId:n,sessionId:s,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,nextCursor:null,totalCount:null,loaded:!1,error:null},o=vt(this,s,n),a=o?this.messagesMap[o]||[]:[],l=new Map((i.results||[]).map(f=>[er(f),f])),c=0;for(let f of a){if((f?.sessionId??f?.groupId??null)!==s)continue;let p=f.messageId||f.id;if(!p)continue;let g=f.type==="user"&&!!f.clientMessageId&&p===f.clientMessageId,m=f.type==="assistant"&&f.isStreaming===!0;if(!g&&!m)continue;let b=f.type,I=f.turnId||f.threadId||p,y=f.speakerVpId||f.vpId||null,S=er({role:b,messageId:p,clientMessageId:f.clientMessageId,turnId:I,speakerVpId:y}),w=l.get(S),h=(typeof f.content=="string"?f.content:"").replace(/\s+/g," ").trim();l.set(S,{...w,agentId:n,sessionId:s,messageId:Number.isFinite(w?.seq)?w.messageId:p,...f.clientMessageId?{clientMessageId:f.clientMessageId}:{},turnId:I,role:b,speakerVpId:y||w?.speakerVpId||null,timestamp:f.timestamp||f.ts||w?.timestamp||null,snippet:h.length>180?`${h.slice(0,180).trimEnd()}\u2026`:h||w?.snippet||""}),w||(c+=1)}let d=f=>{let p=typeof f=="number"?f:Date.parse(f||"");return Number.isFinite(p)?p:0},u=Array.from(l.values()).sort((f,p)=>Number.isFinite(f.seq)&&Number.isFinite(p.seq)?f.seq-p.seq:d(f.timestamp)-d(p.timestamp));return{...i,results:u,totalCount:Number.isFinite(i.totalCount)?i.totalCount+c:i.totalCount}},promoteYeaftHistoryOutlineRow(e,t=null){let s=e?.sessionId??e?.groupId??null,n=ke(t,s),r=this.yeaftHistoryOutlineBySession[n];if(!s||!t||!r?.loaded||r.loading)return!1;let i=e?.type;if(i!=="user"&&i!=="assistant")return!1;let o=e.dbMessageId||e.messageId||e.id||null,a=Dv(o);if(!o||!Number.isFinite(a))return!1;let l=e.turnId||e.threadId||o,c=e.speakerVpId||e.vpId||null,u=(typeof e.content=="string"?e.content:"").replace(/\s+/g," ").trim(),f=er({role:i,messageId:o,clientMessageId:e.clientMessageId,turnId:l,speakerVpId:c}),p=new Map((r.results||[]).map(S=>[er(S),S])),g=p.get(f);p.set(f,{...g,agentId:t,sessionId:s,messageId:o,...e.clientMessageId?{clientMessageId:e.clientMessageId}:{},turnId:l,seq:a,role:i,speakerVpId:c,timestamp:e.timestamp||e.ts||g?.timestamp||null,snippet:u.length>180?`${u.slice(0,180).trimEnd()}\u2026`:u||g?.snippet||""});let m=50,b=Array.from(p.values()).sort((S,w)=>(S.seq||0)-(w.seq||0)),I=b.length>m,y=b.slice(-m);return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[n]:{...r,results:y,hasMore:r.hasMore||I,nextBeforeSeq:I&&Number.isFinite(y[0]?.seq)?y[0].seq:r.nextBeforeSeq,totalCount:Number.isFinite(r.totalCount)&&!g?r.totalCount+1:r.totalCount}},!0},promoteCompletedYeaftHistoryOutline(e,t=null,s=null){let n=this.messagesMap[e]||[],r=null,i=[];for(let o=n.length-1;o>=0;o--){let a=n[o];if(a?.type==="user")break;if(t&&a?.turnId&&a.turnId!==t||a?.type!=="assistant")continue;let l=typeof a.content=="string"?a.content.replace(/\s+/g," ").trim():"";r?!String(r.content||"").trim()&&l&&(r=a):r=a,l&&i.unshift(l)}return r?this.promoteYeaftHistoryOutlineRow({...r,content:i.join(" ")},s):!1},invalidateYeaftHistoryOutline(e,t=null){let s=ke(t,e),n=this.yeaftHistoryOutlineBySession[s];if(!e||!t||!n)return!1;if(n.loading)return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[s]:{...n,refreshPending:!0}},!0;this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[s]:{...n,loaded:!1,refreshPending:!1}};let r=Se(this,e);return this.currentView==="yeaft"&&this.yeaftActiveSessionFilter===e&&r===t?this.loadYeaftHistoryOutline({force:!0,targetSessionId:e,targetAgentId:t}):!0},loadYeaftHistoryOutline({append:e=!1,force:t=!1,targetSessionId:s=null,targetAgentId:n=null}={}){if(this.currentView!=="yeaft"&&!s)return!1;let r=s||this.yeaftActiveSessionFilter||null,i=n||Se(this,r);if(!r||!i)return!1;let o=ke(i,r),a=this.getYeaftHistoryOutlineState(r,i);if(!e&&a.loaded&&!t)return!0;if(e&&(!a.hasMore||!Number.isFinite(a.nextBeforeSeq))||a.loading)return!1;if(!Lu(this,i,"session_history_outline"))return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[o]:{...a,error:"unsupported",loading:!1}},!1;let l=`history_outline_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,c={...a,requestId:l,agentId:i,sessionId:r,loading:!0,requestAppend:e,refreshPending:!1,error:null};this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[o]:c};let d=this._yeaftHistoryOutlineTimeouts[o];d&&clearTimeout(d);let u=setTimeout(()=>{let g=this.yeaftHistoryOutlineBySession[o];if(g?.requestId!==l)return;let m={...this._yeaftHistoryOutlineTimeouts};delete m[o],this._yeaftHistoryOutlineTimeouts=m;let b=g.refreshPending===!0;this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[o]:{...g,requestId:null,loading:!1,requestAppend:!1,loaded:b?!1:g.loaded,refreshPending:!1,error:b?null:"timeout"}},b&&this.loadYeaftHistoryOutline({force:!0,targetSessionId:r,targetAgentId:i})},1e4);this._yeaftHistoryOutlineTimeouts={...this._yeaftHistoryOutlineTimeouts,[o]:u};let f=gs(),p={type:"yeaft_load_history_outline",agentId:i,sessionId:r,requestId:l,perfTraceId:f,limit:50,...e&&a.nextCursor?{cursor:a.nextCursor}:{},...e&&!a.nextCursor&&Number.isFinite(a.nextBeforeSeq)?{beforeSeq:a.nextBeforeSeq}:{}};return Ge(this,{traceId:f,phase:"history_outline.request_send",agentId:i,sessionId:r,messageType:p.type,bytes:JSON.stringify(p).length,detail:{append:e,limit:p.limit}}),this.sendWsMessage(p),!0},handleYeaftHistoryOutline(e){if(!e?.agentId||!e?.sessionId)return!1;let t=ke(e.agentId,e.sessionId),s=this.yeaftHistoryOutlineBySession[t];if(!s||e.requestId!==s.requestId)return!1;let n=this._yeaftHistoryOutlineTimeouts[t];n&&clearTimeout(n);let r={...this._yeaftHistoryOutlineTimeouts};delete r[t],this._yeaftHistoryOutlineTimeouts=r;let i=Array.isArray(e.results)?e.results.map(d=>({...d,agentId:e.agentId,sessionId:e.sessionId})):[],o=s.requestAppend?[...s.results||[],...i]:i,a=new Map(o.filter(d=>d?.messageId).map(d=>[er(d),d])),l=Array.from(a.values()).sort((d,u)=>(d.seq||0)-(u.seq||0)),c=s.refreshPending===!0;return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[t]:{...s,requestId:null,loading:!1,requestAppend:!1,refreshPending:!1,loaded:c?!1:!e.error,results:l,hasMore:!!e.hasMore,nextBeforeSeq:Number.isFinite(e.nextBeforeSeq)?e.nextBeforeSeq:null,nextCursor:e.nextCursor&&typeof e.nextCursor=="object"?e.nextCursor:null,totalCount:Number.isFinite(e.totalCount)?e.totalCount:s.totalCount,error:c?null:e.error||null}},c&&this.loadYeaftHistoryOutline({force:!0,targetSessionId:e.sessionId,targetAgentId:e.agentId}),!0},searchYeaftHistory(e,{append:t=!1,senderKey:s=""}={}){if(this.currentView!=="yeaft")return!1;let n=typeof e=="string"?e.trim():"",r=typeof s=="string"&&(s==="user"||s.startsWith("vp:"))?s.slice(0,103):"",i=this.yeaftActiveSessionFilter||null,o=Se(this,i);if(this._yeaftHistorySearchTimeout&&(clearTimeout(this._yeaftHistorySearchTimeout),this._yeaftHistorySearchTimeout=null),!i||!o||Array.from(n).length<1&&!r)return this.yeaftHistorySearchState={requestId:null,agentId:o,sessionId:i,query:n,senderKey:r,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,nextCursor:null,error:null},!1;let a=this.yeaftHistorySearchState||{};if(!Lu(this,o,"session_history_search"))return this.yeaftHistorySearchState={requestId:null,agentId:o,sessionId:i,query:n,senderKey:r,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,nextCursor:null,error:"unsupported"},!1;let l=`history_search_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;this.yeaftHistorySearchState={requestId:l,agentId:o,sessionId:i,query:n,senderKey:r,loading:!0,results:t&&a.query===n&&a.senderKey===r?a.results:[],hasMore:!1,nextBeforeSeq:t&&a.query===n&&a.senderKey===r?a.nextBeforeSeq:null,nextCursor:t&&a.query===n&&a.senderKey===r&&a.nextCursor||null,error:null},this._yeaftHistorySearchTimeout=setTimeout(()=>{this.yeaftHistorySearchState?.requestId===l&&(this._yeaftHistorySearchTimeout=null,this.yeaftHistorySearchState={...this.yeaftHistorySearchState,loading:!1,error:"timeout"})},1e4);let c=gs(),d={type:"yeaft_search_history",agentId:o,sessionId:i,requestId:l,perfTraceId:c,query:n,senderKey:r,limit:20,...t&&a.query===n&&a.senderKey===r&&a.nextCursor?{cursor:a.nextCursor}:{},...t&&a.query===n&&a.senderKey===r&&!a.nextCursor&&Number.isFinite(a.nextBeforeSeq)?{beforeSeq:a.nextBeforeSeq}:{}};return Ge(this,{traceId:c,phase:"history_search.request_send",agentId:o,sessionId:i,messageType:d.type,bytes:JSON.stringify(d).length,detail:{append:t,limit:d.limit,queryLength:Array.from(n).length,senderFilter:!!r}}),this.sendWsMessage(d),!0},handleYeaftHistorySearchResult(e){let t=this.yeaftHistorySearchState||{};if(!e||e.requestId!==t.requestId||e.agentId!==t.agentId||e.sessionId!==t.sessionId||e.query!==t.query||(e.senderKey||"")!==t.senderKey)return!1;this._yeaftHistorySearchTimeout&&(clearTimeout(this._yeaftHistorySearchTimeout),this._yeaftHistorySearchTimeout=null);let s=Array.isArray(e.results)?e.results.map(r=>({...r,agentId:e.agentId,sessionId:e.sessionId})):[],n=new Map((t.results||[]).map(r=>[$n(r),r]));for(let r of s)(r?.entryId||r?.messageId)&&n.set($n(r),r);return this.yeaftHistorySearchState={...t,loading:!1,results:Array.from(n.values()),hasMore:!!e.hasMore,nextBeforeSeq:Number.isFinite(e.nextBeforeSeq)?e.nextBeforeSeq:null,nextCursor:e.nextCursor&&typeof e.nextCursor=="object"?e.nextCursor:null,error:e.error||null},!0},loadYeaftHistoryWindow(e,{validateCached:t=!1}={}){let s=e?.sessionId||this.yeaftActiveSessionFilter||null,n=e?.agentId||Se(this,s),r=$n(e);if(!s||!n||!e?.entryId||!Number.isFinite(e.indexGeneration)||!Number.isFinite(e.entryStartSeq)||!e?.messageId||!Number.isFinite(e.seq))return Promise.resolve(!1);let i=vt(this,s,n);if((this.messagesMap[i]||[]).some(p=>(p?.sessionId??p?.groupId??null)===s&&p?.historyEntryId===e.entryId&&p?.historyIndexGeneration===e.indexGeneration)&&!t)return Promise.resolve(!0);let a=ke(n,`${s}:${r}:generation:${e.indexGeneration}`),l=this._yeaftHistoryWindowPendingByKey||{};if(l[a]?.promise)return l[a].promise;let c=`history_window_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,d=null,u=new Promise(p=>{d=p}),f=setTimeout(()=>{if(this._yeaftHistoryWindowPendingByKey?.[a]?.requestId!==c)return;let{[a]:g,...m}=this._yeaftHistoryWindowPendingByKey;this._yeaftHistoryWindowPendingByKey=m,d(!1)},1e4);return this._yeaftHistoryWindowPendingByKey={...l,[a]:{requestId:c,agentId:n,sessionId:s,entryId:e.entryId||null,indexGeneration:Number.isFinite(e.indexGeneration)?e.indexGeneration:null,entryStartSeq:Number.isFinite(e.entryStartSeq)?e.entryStartSeq:null,resultId:r,messageId:e.messageId,resolve:d,timeout:f,promise:u}},this.sendWsMessage({type:"yeaft_load_history_window",agentId:n,sessionId:s,requestId:c,...e.entryId?{entryId:e.entryId}:{},...Number.isFinite(e.indexGeneration)?{indexGeneration:e.indexGeneration}:{},...Number.isFinite(e.entryStartSeq)?{entryStartSeq:e.entryStartSeq}:{},anchorMessageId:e.messageId,anchorSeq:e.seq,beforeTurns:5,afterTurns:5,maxRows:200,maxBytes:512*1024}),u},beginYeaftHistoryReveal(e){let t=e?.sessionId||null,s=e?.agentId||null,n=vt(this,t,s);if(!t||!s||!n)return null;let r=ke(s,t),i=`${r}${n}`,o=++this._yeaftHistoryRevealSequence,a={key:i,token:o,sessionKey:r,agentId:s,sessionId:t,conversationId:n};return this._yeaftHistoryRevealLeases={...this._yeaftHistoryRevealLeases||{},[i]:a},a},finishYeaftHistoryReveal(e){if(!e?.key||!Number.isFinite(e.token)||this._yeaftHistoryRevealLeases?.[e.key]?.token!==e.token)return!1;let{[e.key]:s,...n}=this._yeaftHistoryRevealLeases;return this._yeaftHistoryRevealLeases=n,!0},async revealYeaftHistoryResult(e,t=null){let s=!t,n=t||this.beginYeaftHistoryReveal(e),r=e?.sessionId||null,i=e?.agentId||null,o=vt(this,r,i);if(!n||!r||!i||!o||!e?.messageId)return this.finishYeaftHistoryReveal(n),!1;if(!await this.loadYeaftHistoryWindow(e,{validateCached:!0}))return this.finishYeaftHistoryReveal(n),!1;if(this.currentView!=="yeaft"||this.yeaftActiveSessionFilter!==r||Se(this,r)!==i||vt(this,r,i)!==o)return this.finishYeaftHistoryReveal(n),!1;let l=this.revealYeaftMessage(r,e.messageId,o,i);return(!l||s)&&this.finishYeaftHistoryReveal(n),l},pendingYeaftHistoryWindow(e){let s=Object.entries(this._yeaftHistoryWindowPendingByKey||{}).find(([,i])=>i?.requestId===e?.requestId);if(!s)return null;let[n,r]=s;return e.agentId!==r.agentId||e.sessionId!==r.sessionId||e.entryId&&r.entryId&&e.entryId!==r.entryId||Number.isFinite(e.indexGeneration)&&Number.isFinite(r.indexGeneration)&&e.indexGeneration!==r.indexGeneration?null:{pendingKey:n,pending:r}},handleYeaftHistoryWindow(e,t=null){let s=this.pendingYeaftHistoryWindow(e);if(!s)return!1;let{pendingKey:n,pending:r}=s;clearTimeout(r.timeout);let{[n]:i,...o}=this._yeaftHistoryWindowPendingByKey;this._yeaftHistoryWindowPendingByKey=o;let a=!e.error&&!!t&&this.isYeaftMessageCached(r.sessionId,r.messageId,t,r.agentId);return r.resolve(!!a),!!a},createYeaftSession({displayName:e,vpIds:t,defaultVpId:s,workDir:n,agentId:r}={}){let i=Array.isArray(t)?t.slice():[],o=s&&i.includes(s)?s:i[0]||null,a=(e||"").trim(),l=(n||"").trim(),c={roster:i,defaultVpId:o};return a&&(c.name=a),l&&(c.workDir=l),this.sessionCrudRequest("create",c,{agentId:r})},handleYeaftOutput(e){if(!e)return;let t=e.agentId||this.yeaftAgentId||this.currentAgent||null,s=e.conversationId||e.event?.conversationId||null,n=Ws(this,t,s);if(e.data&&n){if(e.data.type!=="result")return;let a=Bc(this,t,s);if(!a)return;let l=e.turnId?Qs(this,t,e.turnId):"",c=!!(l&&this.activeVpTurns?.[l])||(this.messagesMap?.[a]||[]).some(d=>d?.turnId===e.turnId&&(d.isStreaming||d.status==="pending"));if(!e.turnId||!c)return;e={...e,conversationId:a}}if(e.perfTraceId&&(Ge(this,{traceId:e.perfTraceId,phase:"receive.yeaft_output",agentId:e.agentId||null,sessionId:e.sessionId||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||e.event?.type||e.type}),e.turnId&&(this.yeaftPerfTraceByTurnId={...this.yeaftPerfTraceByTurnId||{},[e.turnId]:e.perfTraceId})),e.data){let a=e.agentId||null,l=Ht(this,a,e.conversationId);if(l){let d=Pa(e,e.turnId||"session");for(let u of["retry","retrying","thinking"])qs(this,l,`${u}:${d}`);e.data?.tool_use_result&&qs(this,l,`tool:${d}`)}let c=e.turnId?Qs(this,e.agentId||null,e.turnId):"";if(c&&this.activeVpTurns?.[c]?.retryAttempt){let{retryAttempt:d,retryMax:u,retryDelayMs:f,retryReason:p,retryRecoveryMode:g,...m}=this.activeVpTurns[c];this.activeVpTurns={...this.activeVpTurns,[c]:m}}if(l){let d=e.sessionId??e.groupId??null,u=$u(this,d,a),f=a&&this.yeaftConversationIdsByAgent?this.yeaftConversationIdsByAgent[a]:null,p=It(this,a);p&&p.targetConversationId!==l?Wn(this,a,l):!p&&f&&f!==l&&!String(f).startsWith("yeaft-local-")&&(Ct(this,f,l,{removeSource:f!==this.yeaftConversationId}),qn(this,a,f,l)),Bo(this,a,l);let g=It(this,a,l),m=g?.sourceConversationId||f,b=!u&&m===this.yeaftConversationId;if(this.currentView==="yeaft"&&a&&m&&m!==l){let h=!b&&(!!g||String(m).startsWith("yeaft-local-"));Ct(this,m,l,{removeSource:h}),b?Wr(this,a,m,l):h&&Bn(this,a,l)}a&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[a]:l}),(u||!this.yeaftConversationId)&&(this.yeaftConversationId=l),u&&(this.activeConversations=[l]),this.messagesMap[l]||(this.messagesMap[l]=[]),this.currentView==="yeaft"&&(e.data?.type==="user"||e.data?.type==="text_delta")&&this.pruneYeaftMessageWindow(this.yeaftActiveSessionFilter&&e.sessionId||null);let I=this._currentYeaftAgentId,y=this._currentYeaftSessionId,S=this._currentYeaftVpId,w=this._currentYeaftTurnId,v=this._currentYeaftThreadId;a&&(this._currentYeaftAgentId=a),d!=null&&(this._currentYeaftSessionId=d),e.vpId&&(this._currentYeaftVpId=e.vpId),e.turnId&&(this._currentYeaftTurnId=e.turnId),e.threadId&&(this._currentYeaftThreadId=e.threadId);try{this.currentView==="yeaft"&&d&&(!this.yeaftActiveSessionFilter||d===this.yeaftActiveSessionFilter)&&this.pruneYeaftMessageWindow(this.yeaftActiveSessionFilter?d:null);let M=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(this.handleAssistantOutputFrame(l,e.data,a),e.perfTraceId){let A=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ge(this,{traceId:e.perfTraceId,phase:"store.apply_output",agentId:e.agentId||null,sessionId:d||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||null,durationMs:A-M}),Ur(this,{traceId:e.perfTraceId,agentId:e.agentId||null,sessionId:d||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||null})}let x=e.data,E=x?.message?.id||x?.id||null,V=Ev(E),L=Array.isArray(x?.message?.content)?x.message.content:[],R=L.some(A=>A?.type==="tool_use"),P=!!x?.tool_use_result||L.some(A=>A?.type==="tool_result");if(d){let A=!P&&!_v(this,l,d)&&(x?.type==="user"||x?.type==="assistant"&&!R)?V:null,_=ke(e.agentId||null,d),j=this.yeaftSessionHistoryState[_]||{},B=Number.isFinite(j.latestSeq)?j.latestSeq:-1;A!==null&&A>B&&(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[_]:{...j,latestSeq:A}})}}finally{this._currentYeaftAgentId=I,this._currentYeaftSessionId=y,this._currentYeaftVpId=S,this._currentYeaftTurnId=w,this._currentYeaftThreadId=v}}return}let r=e.event;if(!r)return;let i={...r,vpId:r.vpId||e.vpId||null,threadId:r.threadId||e.threadId||null,turnId:r.turnId||e.turnId||null},o=Ht(this,e.agentId||null,e.conversationId);if(o){let a=Pa(i);r.type==="tool_start"?Nn(this,o,`tool:${a}`):r.type==="tool_end"?qs(this,o,`tool:${a}`):r.type==="llm_retry"?Nn(this,o,`retry:${a}`):r.type==="vp_async_task_wait_start"?Nn(this,o,`async-wait:${a}`):r.type==="vp_async_task_wait_end"&&qs(this,o,`async-wait:${a}`)}switch(r.type){case"project_mutation_result":r.projectsAuthoritative===!0?this.finishProjectMutation(r):this.finishLegacyProjectMutation(r,e.agentId||null);break;case"ask_user_question":{let a=Ht(this,e.agentId||null,e.conversationId);if(!a||!r.requestId)break;let l=Pu(e,r,a),c=()=>{let d=this.messagesMap[a]||[],u=_u(d,l,a);if(u){if(u.askAnswered||u.askExpired)return!0;u.toolName="AskUserQuestion",r.toolCallId&&!u.toolId&&(u.toolId=r.toolCallId),u.agentId=l.agentId||u.agentId||null,u.askRequestId=r.requestId,u.askQuestions=r.questions||[],u.askCreatedAt=r.createdAt||null,u.askExpiresAt=r.expiresAt||null,r.replay&&(u.askPending=!1,u.pendingAnswers=null,u.askSubmitGeneration=null),u.isHistory=!1;let g=Eu(this,l);return g&&xa(u,g),this.messagesMap={...this.messagesMap,[a]:d.slice()},!0}if(!r.replay)return!1;let f={id:`ask-card-${r.requestId}`,type:"tool-use",toolName:"AskUserQuestion",toolId:r.toolCallId||null,toolInput:{questions:r.questions||[]},askRequestId:r.requestId,askQuestions:r.questions||[],askCreatedAt:r.createdAt||null,askExpiresAt:r.expiresAt||null,agentId:l.agentId,sessionId:l.sessionId,vpId:l.vpId,speakerVpId:l.vpId,turnId:l.turnId,threadId:l.threadId||"main",hasResult:!1,isHistory:!1,timestamp:r.createdAt||Date.now()},p=Eu(this,l);return p&&xa(f,p),d.push(f),this.messagesMap={...this.messagesMap,[a]:d.slice()},!0};if(!c()){let d=0,u=setInterval(()=>{d+=1,(c()||d>=10)&&clearInterval(u)},200)}break}case"ask_user_answered":case"ask_user_expired":{let a=Ht(this,e.agentId||null,e.conversationId);if(!a||!r.requestId)break;let l=this.messagesMap[a]||[],c=Pu(e,r,a),d=_u(l,c,a);if(!d){Rv(this,c,r);break}xa(d,r),this.messagesMap={...this.messagesMap,[a]:l.slice()};break}case"session_ready":{let a=r.conversationId,l=e.agentId||this.currentAgent;if(Ws(this,l,a))break;let c=l&&this.yeaftConversationIdsByAgent?this.yeaftConversationIdsByAgent[l]:null,d=this.yeaftConversationId?String(this.yeaftConversationId):"",u=d.startsWith("yeaft-local-")&&(!l||d.startsWith(`yeaft-local-${l}-`)||/^yeaft-local-\d/.test(d))?this.yeaftConversationId:null,f=c||u,p=r.sessionId||e.sessionId||null,g=$u(this,p,l),m=It(this,l);m&&m.targetConversationId!==a?Wn(this,l,a):!m&&c&&c!==a&&!String(c).startsWith("yeaft-local-")&&qn(this,l,c,a),Bo(this,l,a);let I=It(this,l,a)?.sourceConversationId||f,y=!g&&I===this.yeaftConversationId;if(I&&I!==a){let M=!y;Ct(this,I,a,{removeSource:M}),y?Wr(this,l,I,a):M&&Bn(this,l,a)}else this.messagesMap[a]||(this.messagesMap[a]=[]);l&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[l]:a},this.cacheYeaftAgentStatus(l,r,{allowBootstrapCatalog:g})),g&&(this.yeaftModel=r.model,this.yeaftModelEffort=r.modelEffort||null,this.yeaftSessionReady=!0,this.yeaftBootstrapMetaLoadingKey=null,l?this.applyCachedYeaftStatus(l):this.yeaftAvailableModels=r.availableModels||[]);let S=Array.isArray(r.tasks)?r.tasks:[],w={};for(let[M,x]of Object.entries(this.yeaftActiveTasksBySession||{})){let E=Object.fromEntries(Object.entries(x||{}).filter(([,L])=>L?.id&&L.status==="running"&&L.agentId&&L.agentId!==l)),V=Ma(E);Object.keys(V).length>0&&(w[M]=V)}for(let M of S){if(!M?.id||!M.sessionId||M.status!=="running")continue;let x=ke(l,M.sessionId);w[x]={...w[x]||{},[M.id]:{...M,agentId:l}}}this.yeaftActiveTasksBySession=w,g&&(r.yeaftDir&&(this.yeaftYeaftDir=r.yeaftDir),this.yeaftStatus={skills:r.skills,mcpServers:r.mcpServers,tools:r.tools,multiVp:!!r.multiVp}),(g||!this.yeaftConversationId)&&(this.yeaftConversationId=a),g&&(this.activeConversations=[a]);let v=e.agentId||this.currentAgent||null,h=v||"__current__";this._yeaftVpSubscribedAgentKey!==h&&(this._yeaftVpSubscribedAgentKey=h,this.sendWsMessage(v?{type:"yeaft_vp_subscribe",agentId:v}:{type:"yeaft_vp_subscribe"}));break}case"yeaft_status":{let a=e.agentId||this.currentAgent;a&&this.cacheYeaftAgentStatus(a,r);break}case"context_usage":break;case"turn_open":{if(!r.turnId)break;let a={turnId:r.turnId,userPrompt:r.userPrompt||"",vpId:r.vpId||e.vpId||null,sessionId:r.sessionId||e.sessionId||null,openedAt:r.at||Date.now(),closedAt:null,totalMs:0,totalTokens:0,loopCount:0,memoryLoaded:null,memoryLoadedMeta:null,memoryAdjust:null,tools:[],detailsLoaded:!0};this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:a},this.yeaftDebugTurnOrder.includes(r.turnId)||(this.yeaftDebugTurnOrder=[...this.yeaftDebugTurnOrder,r.turnId]);break}case"turn_close":{if(!r.turnId)break;let a=this.yeaftDebugTurnsById[r.turnId];if(!a)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...a,closedAt:Date.now(),totalMs:r.totalMs||0,totalTokens:r.totalTokens||0,loopCount:r.loopCount||a.loopCount||0}};break}case"memory_used":{if(!r.turnId)break;let a=this.yeaftDebugTurnsById[r.turnId];if(!a)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...a,memoryLoaded:Array.isArray(r.loaded)?r.loaded:[],memoryLoadedMeta:r.meta||null}};break}case"dream_memory_loaded":{let a=Array.isArray(r.resident)?r.resident:[];if(r.turnId){let c=this.yeaftDebugTurnsById[r.turnId];c&&(this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...c,dreamMemoryLoaded:a,dreamMemoryLoadedInto:r.loadedInto||"system_prompt.memory"}})}let l={};for(let c of a){let d=c&&typeof c.scope=="string"?c.scope:null,u=d&&/^sessions\/[^/]+$/.test(d)?d:d&&/^group\/[^/]+$/.test(d)?`sessions/${d.slice(6)}`:null;u&&(l[u]={scope:u,sourceScope:d,sessionId:u.slice(9),turnId:r.turnId||null,vpId:r.vpId||null,loadedInto:r.loadedInto||"system_prompt.memory",summary:c.summary||"",truncated:!!c.truncated,receivedAt:Date.now()})}Object.keys(l).length>0&&(this.yeaftDreamPromptLoads={...this.yeaftDreamPromptLoads,...l});break}case"memory_adjust":{if(!r.turnId)break;let a=this.yeaftDebugTurnsById[r.turnId];if(!a)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...a,memoryAdjust:{sessionKey:r.sessionKey||null,added:r.added||0,evicted:r.evicted||0,skipped:r.skipped||0,reason:r.reason||""}}};break}case"tool_exec":{if(!r.turnId)break;let a=this.yeaftDebugTurnsById[r.turnId];if(!a)break;let l=[...a.tools||[],{loopNumber:r.loopNumber||0,callId:r.callId||null,name:r.name||"?",durationMs:r.durationMs||0,isError:!!r.isError,toolOutput:r.toolOutput==null?null:String(r.toolOutput)}];this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...a,tools:l}};break}case"loop":{if(this.yeaftDebugLoops.push({turnId:r.turnId||null,loopNumber:r.loopNumber||0,model:r.model,systemPrompt:r.systemPrompt,messages:r.messages,response:r.response,toolCalls:r.toolCalls,usage:r.usage||{inputTokens:0,outputTokens:0,totalTokens:0},latencyMs:r.latencyMs,ttfbMs:r.ttfbMs,stopReason:r.stopReason,at:typeof r.at=="number"?r.at:null,rawRequest:r.rawRequest||null,rawResponse:r.rawResponse||null,sessionId:e.sessionId||null,vpId:e.vpId||r.vpId||null}),this.yeaftDebugLoops.length>Vu){let a=au({loops:this.yeaftDebugLoops,turnsById:this.yeaftDebugTurnsById,turnOrder:this.yeaftDebugTurnOrder,maxLoops:Math.max(Vu,this.yeaftDebugHistoryLimit||0)});this.yeaftDebugLoops=a.loops,this.yeaftDebugTurnsById=a.turnsById,this.yeaftDebugTurnOrder=a.turnOrder}break}case"llm_retry":{if(!e.turnId)break;let a=Qs(this,e.agentId||null,e.turnId),l=this.activeVpTurns?.[a];if(!l)break;let c=r.reason==="stream_idle_timeout"?"stream_idle_timeout":"transient_error";this.activeVpTurns={...this.activeVpTurns,[a]:{...l,retryAttempt:r.attempt||0,retryMax:r.maxRetries||0,retryDelayMs:r.delayMs||0,retryReason:c,retryRecoveryMode:r.recoveryMode||"restart"}};break}case"recall":case"consolidate":case"fallback":case"thinking_delta":break;case"reflection":{let a=Ht(this,e.agentId||null,e.conversationId)||"unknown",l=Array.isArray(r.loopRange)?r.loopRange:[0,0],c=`${a}:${r.trigger}:${l[0]}-${l[1]}`,d=this.yeaftReflectionCards[c],u=this.messagesMap[a]||[],f=d?d.anchorMsgId:u.length>0&&u[u.length-1].id||null,p=d?d.anchorOrder:u.length;this.yeaftReflectionCards={...this.yeaftReflectionCards,[c]:{key:c,conversationId:a,turnId:r.turnId||d&&d.turnId||null,loopNumber:r.loopNumber||d&&d.loopNumber||null,trigger:r.trigger,status:r.status,loopRange:l,toolCount:r.toolCount||0,content:r.content||"",durationMs:r.durationMs||0,error:r.error||null,sessionId:e.sessionId||null,anchorMsgId:f,anchorOrder:p,updatedAt:Date.now()}};break}case"model_switched":this.yeaftModel=r.model,this.yeaftModelEffort=r.modelEffort||null;break;case"yeaft_task_event":{let a=r.task;if(!a?.id||!a.sessionId)break;let l=e.agentId||Se(this,a.sessionId),c=ke(l,a.sessionId),d={...a,agentId:l},u={...this.yeaftActiveTasksBySession},f={...u[c]||{}};a.status==="running"?f[a.id]=d:delete f[a.id];let p=Ma(f);if(Object.keys(p).length>0?u[c]=p:delete u[c],this.yeaftActiveTasksBySession=u,a.status!=="running"){let{[Ta(l,a.sessionId,a.id)]:g,...m}=this.yeaftStoppingTasksById||{};this.yeaftStoppingTasksById=m}break}case"yeaft_task_cancel_result":{let a=r.taskId||r.task?.id||null,l=r.task?.sessionId||r.sessionId||e.sessionId||null,c=e.agentId||Se(this,l);if(a&&l&&r.success===!1){let{[Ta(c,l,a)]:u,...f}=this.yeaftStoppingTasksById||{};this.yeaftStoppingTasksById=f}let d=r.task;if(d?.id&&d.sessionId){let u=ke(c,d.sessionId),f={...this.yeaftActiveTasksBySession},p={...f[u]||{}};d.status==="running"?p[d.id]={...d,agentId:c}:delete p[d.id];let g=Ma(p);Object.keys(g).length>0?f[u]=g:delete f[u],this.yeaftActiveTasksBySession=f}break}case"sub_agent_event":{let a=Ht(this,e.agentId||null,e.conversationId)||"unknown",l=r.agentId;if(!l)break;let c=r.payload||{},d=`${a}:${l}`,u=this.yeaftSubAgentCards[d],f=this.messagesMap[a]||[],p=u?u.anchorMsgId:f.length>0&&f[f.length-1].id||null,g=u?u.anchorOrder:f.length,m=u?{...u}:{key:d,conversationId:a,agentId:l,agentName:c.agentName||"sub-agent",status:"running",text:"",toolCallCount:0,turns:0,error:null,expanded:!1,anchorMsgId:p,anchorOrder:g,updatedAt:Date.now(),sessionId:e.sessionId||null};switch(c.agentName&&!m.agentName&&(m.agentName=c.agentName),c.type){case"sub_agent_status":m.status=c.status||m.status,c.error&&(m.error=c.error);break;case"text_delta":break;case"tool_use":case"tool_call":m.toolCallCount=Number(m.toolCallCount||0)+1;break;case"tool_start":break;case"tool_result":case"tool_end":break;case"sub_agent_turn_end":{m.turns+=1;let b=typeof c.content=="string"?c.content.trim():"";b&&(m.text=m.text?`${m.text}
|
|
8
|
+
`))}function Zr(e){let t=Array.isArray(e?.textSegments)?e.textSegments:[];if(t.length===0)return;let s=Array.isArray(e?.messages)?e.messages:[],n=e?.isActive===!0||e?.isStreaming===!0||t.some(l=>l.isStreaming===!0)||s.some(l=>l?.isStreaming===!0||l?.status==="pending"),r=s.some(l=>l?.incomplete===!0||ka.has(l?.status)||ka.has(l?.turnEndReason)||ka.has(l?.stopReason));if(n||r){for(let l of t)l.kind="progress";return}if(t.some(l=>l.kind==="result"))return;let i=s.some(l=>l?.turnEndReason==="end_turn"),o=t.some(l=>l.explicitKind),a=t.length===1&&!o;(i||a||e.isHistory&&!o)&&(t[t.length-1].kind="result")}var ka,Jr=F(()=>{ka=new Set(["aborted","errored","error","cancelled","canceled"])});function Sa(e){return e?.type==="user"&&typeof e.content=="string"&&e.content.trim()}function Ia(e){return e?.type==="assistant"||e?.type==="thinking"||e?.type==="tool_use"||e?.type==="tool-use"||e?.type==="tool_result"||e?.type==="tool-result"}function Ca(e,t){if(!e||e.kind!=="assistant")return!0;let s=e.turnId||e.lastTurnId||"",n=t?.turnId||"";if(s&&n&&s!==n)return!0;let r=e.speakerVpId||"",i=t?.speakerVpId||t?.vpId||"";return!!(r&&i&&r!==i)}function Su(e=[]){let t=[],s=null,n=r=>{s&&(t.push({start:s.start,end:r,kind:s.kind}),s=null)};for(let r=0;r<e.length;r++){let i=e[r];if(i){if(Sa(i)||i.type==="system"||i.type==="error"){n(r),s={start:r,kind:i.type};continue}if(!Ia(i)){s||(s={start:r,kind:"other"});continue}(!s||s.kind==="assistant"&&Ca(s,i))&&(n(r),s={start:r,kind:"assistant",turnId:i.turnId||"",speakerVpId:i.speakerVpId||i.vpId||""}),s.lastTurnId=i.turnId||s.lastTurnId||"",s.speakerVpId=s.speakerVpId||i.speakerVpId||i.vpId||""}}return n(e.length),t}function Iu(e,t){return t?e&&(e.sessionId??e.groupId)===t:!0}function Aa(e=[],t=null,s=5){let n=Math.max(1,Number.isFinite(s)?Math.floor(s):5),r=[],i=[],o=null,a=c=>{o&&(i.push({start:o.start,end:c,kind:o.kind}),o=null)};for(let c of e){if(!Iu(c,t))continue;let d=r.length;if(r.push(c),Sa(c)||c.type==="system"||c.type==="error"){a(d),o={start:d,kind:c.type};continue}if(!Ia(c)){o||(o={start:d,kind:"other"});continue}(!o||o.kind==="assistant"&&Ca(o,c))&&(a(d),o={start:d,kind:"assistant",turnId:c.turnId||"",speakerVpId:c.speakerVpId||c.vpId||""}),o.lastTurnId=c.turnId||o.lastTurnId||"",o.speakerVpId=o.speakerVpId||c.speakerVpId||c.vpId||""}if(a(r.length),i.length<=n)return r;let l=i[i.length-n];return r.slice(l.start)}function Cu(e=[],t=null,s=5){let n=Math.max(1,s||5),r=0,i=null,o=()=>i?(i=null,r+=1,r>n):!1;for(let a of e)if(Iu(a,t)){if(Sa(a)||a.type==="system"||a.type==="error"){if(o())return!0;i={kind:a.type};continue}if(!Ia(a)){i||(i={kind:"other"});continue}if(!i||i.kind==="assistant"&&Ca(i,a)){if(o())return!0;i={kind:"assistant",turnId:a.turnId||"",speakerVpId:a.speakerVpId||a.vpId||""}}i.lastTurnId=a.turnId||i.lastTurnId||"",i.speakerVpId=i.speakerVpId||a.speakerVpId||a.vpId||""}return o(),r>n}function Ss(){return 5}function Jn(){return 20}var Au=F(()=>{});function kv(e,t){let s=new Set;if(!t)return s;for(let n of e?.sessionCatalog||[])n?.runtimeProvider!=="yeaft"||n?.routeRef?.sessionId!==t||n.routeRef.agentId&&s.add(n.routeRef.agentId);if(s.size===0){let n=Zt();for(let r of n?.sessionList||[])r?.id===t&&r?.agentId&&s.add(r.agentId)}return s}function Fu(e,t){let s=kv(e,t);return s.size===1?s.values().next().value:null}function ni(e,t,s){return!!s&&Fu(e,t)===s}function et(e,t,s){return!e||e.sessionId!==t?!1:s?e.agentId===s:!e.agentId}function xu(e,t,s=null){if(!t)return!1;let n=s||Se(e,t),r=mt(n,t);if(r&&e.yeaftProcessingSessions?.[r]||e.yeaftProcessingSessions?.[t]&&ni(e,t,n))return!0;for(let i of Object.values(e.activeVpTurns||{}))if(et(i,t,n))return!0;for(let i of Object.values(e.vpStatuses||{}))if(et(i,t,n)&&tr.has(i?.state))return!0;return!1}function Sv(e,t,s,n=null){let r={...e.yeaftProcessingSessions||{}};if(t){let i=ca(t);if(r=Object.fromEntries(Object.entries(r).filter(([o])=>n?o!==mt(t,n):!o.startsWith(i))),n)ni(e,n,t)&&delete r[n];else for(let o of Object.keys(r))ni(e,o,t)&&delete r[o]}else n?delete r[n]:r={};for(let i of s||[]){let o=i?.sessionId||i?.groupId||null;if(!o||!tr.has(i?.state))continue;let a=mt(t,o)||o;r[a]=!0}return r}function Qs(e,t,s){let n=da(t,s);return n&&e?.activeVpTurns?.[n]?n:e?.activeVpTurns?.[s]&&(!t||!e.activeVpTurns[s]?.agentId||e.activeVpTurns[s].agentId===t)?s:n||s||""}function Tu(e,t){if(!t){e.activeVpTurns={},e.stoppingVpTurnIds={},e.vpStatuses={},e.yeaftProcessingSessions={};return}e.activeVpTurns=Object.fromEntries(Object.entries(e.activeVpTurns||{}).filter(([,n])=>n?.agentId&&n.agentId!==t)),e.stoppingVpTurnIds=Object.fromEntries(Object.entries(e.stoppingVpTurnIds||{}).filter(([n])=>e.activeVpTurns?.[n])),e.vpStatuses=Object.fromEntries(Object.entries(e.vpStatuses||{}).filter(([,n])=>n?.agentId&&n.agentId!==t));let s=ca(t);e.yeaftProcessingSessions=Object.fromEntries(Object.entries(e.yeaftProcessingSessions||{}).filter(([n])=>!n.startsWith(s)))}function Vt(e,t){return`${e||""}:${t||""}`}function xv(e){return e?.kind==="action"&&typeof e.actionId=="string"&&Number.isInteger(Number(e.generation))&&Number(e.generation)>0?{kind:"action",actionId:e.actionId,generation:Number(e.generation)}:{kind:"coordinator"}}function Tv(e){return typeof e=="string"?e:e?.kind==="action"&&typeof e.actionId=="string"?{kind:"action",actionId:e.actionId,generation:Number.isInteger(Number(e.generation))?Number(e.generation):0}:{kind:"coordinator"}}function Mv(e={}){let t=Qe(e.quote);return{agentId:e.agentId||"",workItemId:e.workItemId||"",target:xv(e.target),text:String(e.text||""),...t?{quote:t}:{},attachments:Array.isArray(e.attachments)?e.attachments.map(s=>({fileId:s?.fileId||"",name:s?.name||"",mimeType:s?.mimeType||"",size:Math.max(0,Number(s?.size)||0)})):[],revision:Number(e.revision)||0,planRevision:Number(e.planRevision)||0,ledgerRevision:Number(e.ledgerRevision)||0,coordinatorRevision:Number(e.coordinatorRevision)||0}}function Pu(e,t,s){return{conversationId:s||null,agentId:e?.agentId||t?.agentId||null,requestId:t?.requestId||null,toolCallId:t?.toolCallId||null,sessionId:e?.sessionId||t?.sessionId||null,vpId:e?.vpId||t?.vpId||null,turnId:e?.turnId||t?.turnId||null,threadId:e?.threadId||t?.threadId||null}}function Ru(e,t){return{conversationId:t||null,agentId:e?.agentId||null,requestId:e?.askRequestId||null,toolCallId:e?.toolId||null,sessionId:e?.sessionId||e?.groupId||null,vpId:e?.vpId||e?.speakerVpId||null,turnId:e?.turnId||null,threadId:e?.threadId||null}}function Pv(e,t){return _a.every(s=>!t[s]||e[s]===t[s])}function Nu(e,t){return _a.every(s=>!e[s]||!t[s]||e[s]===t[s])}function _u(e,t,s){let n=(e||[]).filter(o=>o?.type==="tool-use"&&(o.toolName==="AskUser"||o.toolName==="AskUserQuestion")&&(!t.requestId||!o.askRequestId||o.askRequestId===t.requestId)&&(!t.toolCallId||!o.toolId||o.toolId===t.toolCallId)),r=n.filter(o=>Pv(Ru(o,s),t));if(r.length===1)return r[0];let i=n.filter(o=>Nu(Ru(o,s),t));return i.length===1?i[0]:null}function Bu(e){return _a.map(t=>e[t]||"").join("\0")}function Rv(e,t,s){let n=Bu(t),r={...e._yeaftAskTerminalEvents||{},[n]:{identity:t,event:s,receivedAt:Date.now()}},i=Object.keys(r);if(i.length>Mu){i.sort((o,a)=>r[o].receivedAt-r[a].receivedAt);for(let o of i.slice(0,i.length-Mu))delete r[o]}e._yeaftAskTerminalEvents=r}function Eu(e,t){let s=e._yeaftAskTerminalEvents||{},n=Bu(t),r=s[n]?n:null;if(!r){let l=Object.entries(s).filter(([,c])=>Nu(c.identity||{},t));l.length===1&&(r=l[0][0])}if(!r)return null;let i=s[r],{[r]:o,...a}=s;return e._yeaftAskTerminalEvents=a,i?.event||null}function _v(e,t,s){return(e.messagesMap?.[t]||[]).some(n=>n?.type==="tool-use"&&n.sessionId===s&&n.hasResult===!1)}function xa(e,t){t.type==="ask_user_answered"?(e.askAnswered=!0,e.selectedAnswers=t.answers||{},e.askExpired=!1):(e.isHistory=!0,e.askExpired=!0,e.askAnswered=!1,e.selectedAnswers=null),e.askPending=!1,e.pendingAnswers=null,e.askSubmitGeneration=null,e.askRequestId=null}function Ev(e){if(!e||typeof e!="string")return null;let t=e.match(/^(\d+)/);if(!t)return null;let s=Number(t[1]);return Number.isFinite(s)?s:null}function Dv(e){if(!e||typeof e!="string")return null;let t=e.match(/^m(\d+)$/);if(!t)return null;let s=Number(t[1]);return Number.isFinite(s)?s:null}function er(e){return $n(e)}function Ta(e,t,s){return`${mt(e,t)}::${s||""}`}function Ma(e){return Object.fromEntries(Object.entries(e||{}).filter(([,t])=>t?.status==="running"))}function Zt(){try{return typeof window>"u"?null:window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore()||null}catch{return null}}function Du(e){let t=Zt();if(!t?.reorderSessionsGlobally)return;let s=(Array.isArray(e)?e:[]).filter(n=>n?.runtimeProvider==="yeaft").map(n=>`${n.routeRef?.agentId||""}${n.routeRef?.sessionId||""}`).filter(n=>!n.startsWith(""));t.reorderSessionsGlobally(s)}function Se(e,t,s=null){if(s)return s;if(t){let n=Zt(),r=n?.activeSessionKey?n.sessions?.[n.activeSessionKey]:null;if(r?.id===t&&r.agentId)return r.agentId;let i=n&&typeof n.sessionById=="function"?n.sessionById(t,e?.currentAgent||null):null;if(i&&i.agentId)return i.agentId;let o=e?.yeaftSessionAgentById?e.yeaftSessionAgentById[t]:null;if(o)return o}return e?.currentAgent||null}function Lv(e,t){let s=i=>String(i||"").replace(/^v/,"").split(".").slice(0,3).map(o=>Number.parseInt(o,10)),n=s(e),r=s(t);if(n.length<3||r.length<3||[...n,...r].some(i=>!Number.isFinite(i)))return!1;for(let i=0;i<3;i+=1)if(n[i]!==r[i])return n[i]>r[i];return!0}function Lu(e,t,s){if(!t||!s)return!1;let n=Array.isArray(e?.agents)?e.agents.find(o=>o?.id===t):null,r=e?.currentAgentInfo?.id===t?e.currentAgentInfo:null;return(n?.capabilities||r?.capabilities||[]).includes(s)?!0:s==="session_history_search"&&Lv(n?.version||r?.version,"1.0.166")}function Is(e,{fallbackDefault:t=!1}={}){if(e?.yeaftActiveSessionFilter)return e.yeaftActiveSessionFilter;let s=Zt();return s?.activeSessionId?s.activeSessionId:t?"grp_default":null}function si(e){let t=e.yeaftDebugSessionFilter;if(t==="__all__")return null;if(t)return t;let s=Is(e);return s||(Zt()?.sessions?.grp_default?"grp_default":null)}function Pa(e,t="session"){return[e?.vpId||e?.ownerVpId||"vp",e?.threadId||"thread",e?.turnId||t].join(":")}function Ht(e,t,s=null){return s||t&&e?.yeaftConversationIdsByAgent?.[t]||e?.yeaftConversationId||null}function vt(e,t=null,s=null){let n=t||e?.yeaftActiveSessionFilter||null,r=s||Se(e,n);return(r&&e?.yeaftConversationIdsByAgent?e.yeaftConversationIdsByAgent[r]:null)||e?.yeaftConversationId||null}function $u(e,t,s){if(e?.currentView!=="yeaft")return!1;let n=e?.yeaftActiveSessionFilter||null;if(n&&t!==n)return!1;let r=Se(e,n);return!r||!s||r===s}var wv,Ve,ei,ti,Iv,tr,Cv,Av,Mu,_a,Vu,Ra,Hu,Ou,Cs,ri=F(()=>{gt();xo();$t();Ro();Fn();gd();Ad();Qd();us();Gt();su();Wo();Br();iu();ou();lu();Mo();wa();Ko();Xt();Jr();Fs();Xo();Qn();Au();sa();na();({defineStore:wv}=Pinia),Ve=Object.freeze([]),ei=(e,t,s)=>`${e||""}::${t||""}::${s}`;ti=5,Iv=15e3,tr=new Set(["typing","thinking","retrying","streaming","tool"]),Cv=Object.freeze(["model","availableModels","refreshedAt","catalogRefreshedAt","catalogEpoch","catalogRevision","catalogDigest","refreshStartedAt","refreshReason","refreshError","refreshing"]),Av=8,Mu=64;_a=Object.freeze(["conversationId","agentId","requestId","toolCallId","sessionId","vpId","turnId","threadId"]);Vu=1e3,Ra=1,Hu=5,Ou=200,Cs=wv("chat",{state:()=>({ws:null,authenticated:!1,_hasHandledAgentList:!1,_hasHandledYeaftSessionHydrate:!1,yeaftSessionInventoryCompleteSupported:null,yeaftSessionHydrateRequestId:null,yeaftSessionHydrateSlices:[],yeaftSessionHydrateError:null,_yeaftSessionInventorySocketQuarantined:!1,sessionKey:null,serverEncryptionRequired:!0,connectionState:"disconnected",reconnectAttempts:0,maxReconnectAttempts:10,reconnectTimer:null,agents:[],currentAgent:null,currentAgentInfo:null,conversations:[],activeConversations:[],currentWorkDir:null,messagesMap:{},_messageUiKeySequence:0,chatSessionState:{},panels:[],activePanelId:null,_pendingPaneId:null,conversationTitles:{},customConversationTitles:{},processingConversations:{},yeaftProcessingSessions:{},yeaftUnreadSessionKeys:{},theme:localStorage.getItem("theme")||(typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),themeFollowSystem:!localStorage.getItem("theme"),locale:localStorage.getItem("locale")||"zh-CN",executionStatusMap:{},sessionHealth:{},historySessions:[],historySessionsLoading:!1,folders:[],foldersLoading:!1,providerModels:[],providerModelsLoading:!1,contextUsage:null,lastUsedAgent:localStorage.getItem("lastUsedAgent")||null,lastUsedSession:JSON.parse(localStorage.getItem("lastUsedSession")||"null"),lastViewedConversation:localStorage.getItem("lastViewedConversation")||null,pendingRecovery:null,recoveryDismissed:!1,sessionLoading:!1,sessionLoadingText:"",agentSwitching:!1,pendingAgentSelection:null,_pendingSessionTitle:null,workbenchExpanded:!1,workbenchMaximized:!1,sidebarCollapsed:!1,sessionSidebarOpen:!1,compactStatus:null,clearStatus:null,refreshingSession:!1,refreshingSessionMap:{},sessionHistorySyncRefreshToken:0,proxyPorts:{},hasMoreMessages:!1,loadingMoreMessages:!1,chatHistoryRequests:{},chatHistoryRequestIdSupported:null,chatHistoryConnectionGeneration:0,sessionCatalog:[],hiddenSessionCatalog:[],sessionProjects:[],sessionCatalogLoaded:!1,sessionCatalogMutationRequests:{},projectMutationRequests:{},activeCatalogKey:null,openUnifiedSessionCreate:!1,openUnifiedChatCreate:!1,pendingUnifiedSessionSettings:null,yeaftHasMoreHistory:!1,yeaftLoadingMoreHistory:!1,yeaftOldestLoadedSeq:null,yeaftHistoryLoadError:null,yeaftSessionHistoryState:{},yeaftMessageWindowState:{},yeaftHistoryCacheState:{},yeaftBootstrapMetaLoadingKey:null,yeaftHistoryPerfTraceBySession:{},yeaftHistorySearchState:{requestId:null,agentId:null,sessionId:null,query:"",senderKey:"",loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,nextCursor:null,error:null},yeaftHistoryOutlineBySession:{},_yeaftHistoryOutlineTimeouts:{},_yeaftHistorySearchTimeout:null,_yeaftHistoryWindowPendingByKey:{},_yeaftHistoryRevealLeases:{},_yeaftHistoryRevealSequence:0,_yeaftReconnectCatchUpPending:!1,_yeaftOpenedSessionsLoadedAgents:{},_yeaftAgentSeen:null,slashCommandsMap:{},slashCommandDescriptions:{},inputDrafts:{},mcpServers:{},expertRoleDefinitions:null,llmConfig:{},llmModelDiscovery:{},llmGithubDevice:null,modelsDevRegistry:{registry:{},fetchedAt:0,error:null,loaded:!1},_modelsDevPending:null,yeaftSettings:{},searchSettings:null,telemetrySettings:null,tavilyUsage:null,tavilyUsageLoading:!1,_perfTraceQueue:[],_perfTraceFlushTimer:null,yeaftPerfTraceByMessageId:{},yeaftPerfTraceByTurnId:{},yeaftMcpServers:[],yeaftMcpRuntime:{connected:!1,toolCount:0,perServer:[]},yeaftMcpLoading:!1,yeaftMcpError:null,btwMode:!1,btwMessages:[],btwLoading:!1,btwSessionId:null,conversationMcpServers:{},conversationMcpServerTools:{},mcpPanelOpen:!1,expertSelections:[],customExpertRoles:[],subagents:{},activeSubagentId:null,activeRightPanel:null,pinnedSessions:JSON.parse(localStorage.getItem("pinned-sessions")||"[]"),...Jd(),workCenterOpen:!1,workCenterAgentId:null,workCenterItemsByAgent:{},workCenterListPageByAgent:{},workCenterListMoreLoadingByAgent:{},_workCenterListGenerationByAgent:{},_workCenterListQueryByAgent:{},_workCenterListFiltersByAgent:{},_workCenterListMoreRequestsByAgent:{},_workCenterListEventGenerationByAgent:{},_workCenterListEventsByAgent:{},_workCenterDeletedIdsByAgent:{},workCenterDetailByAgent:{},workCenterActionMessages:{},workCenterActionMessagesLoading:{},workCenterActionMessagesError:{},workCenterActionRequests:{},workCenterActionRequestDetails:{},workCenterActionRequestsLoading:{},workCenterActionRequestsError:{},workCenterActionRequestDetailsLoading:{},workCenterActionRequestDetailsError:{},workCenterLoadedByAgent:{},workCenterLoadingByAgent:{},workCenterErrorByAgent:{},workCenterWatcherByAgent:{},workCenterSettingsByAgent:{},workCenterRuntimeByAgent:{},workCenterSettingsLoadingByAgent:{},workCenterSettingsErrorByAgent:{},_workCenterSettingsGenerationByAgent:{},_workCenterDetailRequestGenerationByAgent:{},_workCenterDetailEventRefreshByAgent:{},_workCenterActionInputGenerationByAgent:{},_workCenterActionMessageRequests:{},_workCenterActionMessageGenerationByKey:{},_workCenterActionRequestsGeneration:{},_workCenterActionRequestDetailsGeneration:{},workCenterPending:{},workCenterComposerDrafts:{},workCenterMessageOutbox:{},_workCenterBrowserFence:null,_workCenterBrowserUnsubscribe:null,workCenterCreateDraft:null,yeaftConversationId:null,yeaftConversationIdsByAgent:{},_yeaftPendingConversationPromotions:{},_yeaftRetiredConversationIdsByAgent:{},_yeaftRetiredConversationTargetsByAgent:{},yeaftSessionAgentById:{},yeaftModel:null,yeaftModelEffort:null,yeaftSessionReady:!1,yeaftStatus:null,yeaftAvailableModels:[],yeaftStatusByAgent:{},_yeaftRetiredCatalogEpochsByAgent:{},yeaftModelsRefreshing:!1,yeaftModelRefreshError:null,yeaftYeaftDir:null,yeaftActiveTasksBySession:{},yeaftStoppingTasksById:{},yeaftToolStats:null,yeaftToolStatsLoading:!1,yeaftDebugLoops:[],yeaftDebugTurnsById:{},yeaftDebugTurnOrder:[],yeaftDebugHistoryLoading:!1,yeaftDebugHistoryError:null,yeaftDebugHistoryFetchedAt:0,yeaftDebugHistoryLimit:Ra,yeaftDebugHistoryHasMore:!1,yeaftDebugSearch:"",yeaftDebugSessionFilter:null,yeaftDreamLatest:{},yeaftDreamSnapshots:{},yeaftDreamPromptLoads:{},yeaftDreamEvents:{},yeaftReflectionCards:{},yeaftSubAgentCards:{},yeaftSidebarV2Enabled:!0,yeaftActiveSessionFilter:null,_currentYeaftSessionId:null,_currentYeaftVpId:null,_currentYeaftTurnId:null,_currentYeaftThreadId:null,_yeaftAskTerminalEvents:{},activeVpTurns:{},vpStatuses:{},stoppingVpTurnIds:{},yeaftVpTyping:{},_vpCrudPending:null}),getters:{currentConversation:e=>e.activeConversations[0]||null,activeConversationId:e=>ma(e),activeSessionRoute(e){if(e.currentView==="yeaft"){let n=Is(e);return n?{runtimeProvider:"yeaft",agentId:Se(e,n),sessionId:n}:null}let t=ma(e);if(!t)return null;let s=e.conversations.find(n=>n?.id===t&&n.type!=="yeaft");return s?{runtimeProvider:s.provider==="copilot"?"copilot":"claude-code",agentId:s.agentId||e.currentAgent||null,sessionId:t}:null},messages(e){let t=this.activeConversationId,s=t&&e.messagesMap[t]||Ve;if(e.currentView==="yeaft"){let n=e.yeaftActiveSessionFilter||null,r=ke(Se(e,n),n),i=e.yeaftMessageWindowState[r]?.visibleTurns||Ss();return Aa(s,e.yeaftActiveSessionFilter||null,i)}return s},yeaftAllMessages:e=>{let t=vt(e);return t&&e.messagesMap[t]||Ve},yeaftVisibleMessages(e){let t=vt(e),s=t&&e.messagesMap[t]||Ve,n=e.yeaftActiveSessionFilter||null,r=ke(Se(e,n),n),i=e.yeaftMessageWindowState[r]?.visibleTurns||Ss();return Aa(s,e.yeaftActiveSessionFilter||null,i)},hasHiddenYeaftMessages(e){if(e.currentView!=="yeaft")return!1;let t=vt(e),s=t&&e.messagesMap[t]||Ve,n=e.yeaftActiveSessionFilter||null,r=ke(Se(e,n),n),i=e.yeaftMessageWindowState[r]?.visibleTurns||Ss();return Cu(s,e.yeaftActiveSessionFilter||null,i)},activeYeaftHistoryState(e){return Qo(e)},yeaftInitialHistoryLoading(e){let t=Qo(e);return e.currentView==="yeaft"&&!!e.yeaftActiveSessionFilter&&!!t?.loading&&!t?.loaded&&this.yeaftVisibleMessages.length===0},vpsTypingInCurrentConv(e){let t=this.activeConversationId;if(!t)return Ve;let s=(e.yeaftVpTyping||{})[t];if(!s)return Ve;let n=Object.keys(s).filter(r=>(s[r]||0)>0);return n.length===0?Ve:n},isVpTypingInCurrentConv(e){return t=>{if(!t)return!1;let s=this.activeConversationId;if(!s)return!1;let n=(e.yeaftVpTyping||{})[s];return n?(n[t]||0)>0:!1}},yeaftDreamLatestForActiveSession(e){let t=si(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamLatest?.[s]||null},yeaftDreamSnapshotForActiveSession(e){let t=si(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamSnapshots?.[s]||null},yeaftDreamPromptLoadForActiveSession(e){let t=si(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamPromptLoads?.[s]||null},yeaftDreamEventsForActiveSession(e){let t=si(e);if(!t)return[];let s=`sessions/${t}`,n=Array.isArray(e.yeaftDreamEvents?.[s])?e.yeaftDreamEvents[s]:[],r=Array.isArray(e.yeaftDreamEvents?.["*"])?e.yeaftDreamEvents["*"]:[];return r.length===0?n:n.length===0?r:[...n,...r].sort((i,o)=>(i.at||0)-(o.at||0))},yeaftDebugTurnsForActiveSession:e=>{let t=e.yeaftDebugTurnOrder||Ve,s=e.yeaftDebugTurnsById||{},n=e.yeaftDebugLoops||Ve,r=e.yeaftReflectionCards||{},i=e.yeaftDebugSessionFilter,o;i==="__all__"?o=null:i?o=i:o=null;let a={};for(let d of n)!d||!d.turnId||(a[d.turnId]||(a[d.turnId]=[]),a[d.turnId].push(d));let l={};for(let d of Object.keys(r)){let u=r[d];!u||!u.turnId||(l[u.turnId]||(l[u.turnId]=[]),l[u.turnId].push(u))}let c=[];for(let d=t.length-1;d>=0;d--){let u=t[d],f=s[u];if(!f||o&&f.sessionId&&f.sessionId!==o)continue;let p=a[u]||Ve,g=l[u]||Ve,m=p.length,b=0,I=0;for(let w of p){let v=w&&w.usage;v&&Number.isFinite(v.totalTokens)?b+=v.totalTokens:v&&(b+=(v.totalInputTokens||(v.inputTokens||0)+(v.cacheReadTokens||0)+(v.cacheWriteTokens||0))+(v.outputTokens||0)),w&&Number.isFinite(w.latencyMs)&&(I+=w.latencyMs)}let y=!f.closedAt,S={...f,loopCount:y||!f.loopCount?m:f.loopCount,totalTokens:y||!f.totalTokens?b:f.totalTokens,totalMs:y||!f.totalMs?I:f.totalMs,loops:p,reflections:g};c.push(S)}return c},yeaftDebugAvailableSessions:e=>{let t=new Set;for(let s of e.yeaftDebugTurnOrder||Ve){let n=e.yeaftDebugTurnsById[s];n&&n.sessionId&&t.add(n.sessionId)}return Array.from(t).sort()},yeaftDebugTurnTotal:e=>(e.yeaftDebugTurnOrder||Ve).length,messagesCache:e=>e.messagesMap,isMultiColumn:e=>e.activeConversations.length>1,isSplitMode:e=>e.panels.length>1,isProcessing:e=>{if(e.currentView==="yeaft"){let t=Is(e);return t?xu(e,t,Se(e,t)):!1}return e.currentConversation?!!e.processingConversations[e.currentConversation]:!1},canSend:e=>!(!e.currentAgent||!e.currentConversation),currentAgentName:e=>e.currentAgentInfo?.name||"\u9009\u62E9 Agent",currentAgentWorkDir:e=>e.currentAgentInfo?.workDir||"",effectiveWorkDir:e=>e.currentView==="yeaft"?Zt()?.activeSession?.workDir||e.yeaftYeaftDir||e.currentAgentInfo?.workDir||"":e.currentWorkDir||e.currentAgentInfo?.workDir||"",currentAgentCapabilities:e=>e.currentAgentInfo?.capabilities||["terminal","file_editor","background_tasks"],hasCapability:e=>t=>(e.currentAgentInfo?.capabilities||["terminal","file_editor","background_tasks"]).includes(t),getConversationTitle:e=>t=>e.customConversationTitles[t]||e.conversationTitles[t]||null,executionStatus:e=>e.currentConversation?e.executionStatusMap[e.currentConversation]||{currentTool:null,toolHistory:[],lastActivity:null}:{currentTool:null,toolHistory:[],lastActivity:null},isConversationProcessing:e=>t=>!!e.processingConversations[t],isConversationConnecting:e=>t=>t?!!e.conversations.find(n=>n.id===t)?.connecting:!1,isConversationCompacting:e=>t=>t?e.compactStatus?.conversationId===t&&e.compactStatus?.status==="compacting":!1,isYeaftSessionProcessing:e=>(t,s=null)=>xu(e,t,s),isSessionHistorySyncing:e=>t=>{let s=t?.sessionId||null;return s?t.runtimeProvider==="yeaft"?!!e.yeaftSessionHistoryState?.[ke(t.agentId||null,s)]?.loading:!!e.chatHistoryRequests?.[zt(s)]?.loading:!1},isYeaftSessionUnread:e=>(t,s=null)=>{if(!t)return!1;let n=Se(e,t,s);return n?!!e.yeaftUnreadSessionKeys?.[Hr(n,t)]:!1},showRecoveryBanner:e=>e.pendingRecovery&&!e.recoveryDismissed&&!e.currentConversation,currentSubagents:e=>{if(!e.currentConversation)return Ve;let t=e.subagents[e.currentConversation];return t?Object.values(t):Ve},hasRunningSubagents:e=>{if(!e.currentConversation)return!1;let t=e.subagents[e.currentConversation];return t?Object.values(t).some(s=>s.status==="running"):!1},runningSubagentCount:e=>{if(!e.currentConversation)return 0;let t=e.subagents[e.currentConversation];return t?Object.values(t).filter(s=>s.status==="running").length:0},activeSubagentMessages:e=>{if(!e.currentConversation||!e.activeSubagentId)return Ve;let t=e.subagents[e.currentConversation];if(!t)return Ve;let s=t[e.activeSubagentId];return(Array.isArray(s?.messages)?s.messages:Ve).filter(r=>r?.type==="text")},selectedTaskInfo:()=>null,currentMcpServers:e=>e.currentConversation&&e.conversationMcpServers[e.currentConversation]||Ve},actions:{activateChatView({persistPreference:e=!1}={}){let t=this._pendingChatRestoreConversationId;this._pendingChatRestoreConversationId=null;let s=t?this.conversations.find(o=>o.id===t):null,n=s?.agentId?this.agents.find(o=>o.id===s.agentId&&o.online):null;!this._savedChatIdentity&&s&&n&&(this._savedChatIdentity={agentId:n.id,agentInfo:{...n},workDir:s.workDir||n.workDir||null}),this.currentView="chat",e&&fa("chat");let r=this._savedChatIdentity||null,i=this.pendingAgentSelection&&this.pendingAgentSelection.agentId!==r?.agentId;r?.agentId&&(this.currentAgent!==r.agentId||i)&&this.selectAgent(r.agentId),tu(this),t&&s&&n&&(this.autoRestoreConversation(t),this.sendWsMessage({type:"refresh_conversation",conversationId:t}))},enterWorkCenter(e=null){if(!this.hydrateWorkCenterBrowserState())return!1;let t=this.agents.filter(n=>n?.online&&Array.isArray(n.capabilities)&&n.capabilities.includes("work_center")),s=t.some(n=>n.id===e)?e:t[0]?.id||null;if(!s)return this.workCenterOpen=!1,this.workCenterAgentId=null,!1;if(this.currentAgent!==s){this.selectAgent(s),this.currentAgent=s;let n=this.agents.find(r=>r.id===s);n&&(this.currentAgentInfo=n)}return this.workCenterAgentId=s,this.workCenterOpen=!0,this.listWorkItems(s).catch(()=>{}),!0},leaveWorkCenter(){this.workCenterOpen=!1},enterWorkCenterFromSession(e,t=""){if(!e?.id)return;let s=e.agentId||Se(this,e.id),n=String(t||e.title||e.name||"").trim();this.workCenterCreateDraft={sourceAgentId:s,requirement:n,workDir:String(e.workDir||"").trim(),origin:{sessionId:e.id,messageId:null,createdBy:"user"},linkedSessionIds:[e.id]},this.enterWorkCenter(s)},hydrateWorkCenterBrowserState(){this._workCenterBrowserUnsubscribe||(this._workCenterBrowserUnsubscribe=Jl(()=>{Mn(this._workCenterBrowserFence)||this.clearWorkCenterBrowserState()}));let e=$r();if(!e)return this._workCenterBrowserFence=null,this.workCenterComposerDrafts={},this.workCenterMessageOutbox={},!1;if(!Mn(this._workCenterBrowserFence)){let t=Zl(e);this._workCenterBrowserFence=e,this.workCenterComposerDrafts=t.drafts,this.workCenterMessageOutbox=t.outbox}return!0},clearWorkCenterBrowserState(){this._workCenterBrowserFence=null,this.workCenterComposerDrafts={},this.workCenterMessageOutbox={}},workCenterComposerKey(e,t){return Vt(e,t)},saveWorkCenterComposerDraft(e,t,s={}){let n=Vt(e,t);if(!e||!t)return;let r=Qe(s.quote),i={...this.workCenterComposerDrafts||{},[n]:{text:String(s.text||""),...r?{quote:r}:{},attachments:Array.isArray(s.attachments)?s.attachments:[],target:Tv(s.target),error:String(s.error||"")}};return Ao(i,this._workCenterBrowserFence)?(this.workCenterComposerDrafts=i,!0):!1},loadWorkCenterComposerDraft(e,t){return this.workCenterComposerDrafts?.[Vt(e,t)]||null},removeWorkCenterComposerDraft(e,t){let s=Vt(e,t),n={...this.workCenterComposerDrafts||{}};return delete n[s],Ao(n,this._workCenterBrowserFence)?(this.workCenterComposerDrafts=n,!0):!1},prepareWorkCenterMessageEnvelope(e={}){let t=Mv(e),s=Vt(t.agentId,t.workItemId),n=this.workCenterMessageOutbox?.[s]||null;if(n)return n;let r={...t,clientMessageId:globalThis.crypto?.randomUUID?.()||`${Date.now()}-${Math.random()}`,createdAt:Date.now()},i={...this.workCenterMessageOutbox||{},[s]:r};return Pn(i,this._workCenterBrowserFence)?(this.workCenterMessageOutbox=i,r):null},loadWorkCenterMessageEnvelope(e,t){return this.workCenterMessageOutbox?.[Vt(e,t)]||null},replaceWorkCenterMessageEnvelopeAttachments(e,t,s=[]){let n=Vt(e,t),r=this.workCenterMessageOutbox?.[n];if(!r)return null;let i={...r,attachments:Array.isArray(s)?s.map(a=>({fileId:a?.fileId||"",name:a?.name||"",mimeType:a?.mimeType||"",size:Math.max(0,Number(a?.size)||0)})):[]},o={...this.workCenterMessageOutbox||{},[n]:i};return Pn(o,this._workCenterBrowserFence)?(this.workCenterMessageOutbox=o,i):null},discardWorkCenterMessageEnvelope(e,t){let s=Vt(e,t),n={...this.workCenterMessageOutbox||{}};return delete n[s],Pn(n,this._workCenterBrowserFence)?(this.workCenterMessageOutbox=n,!0):!1},confirmWorkCenterMessageEnvelope(e,t,s){let n=Vt(e,t),r=this.workCenterMessageOutbox?.[n];if(!r||r.clientMessageId!==s)return!1;let i={...this.workCenterMessageOutbox||{}};return delete i[n],Pn(i,this._workCenterBrowserFence)?(this.workCenterMessageOutbox=i,this.removeWorkCenterComposerDraft(e,t),!0):!1},workCenterRequest(e,t={},s=null){let n=s||this.workCenterAgentId||this.currentAgent;if(!n)return Promise.reject(new Error("No Agent selected"));let r=`work-center-${Date.now()}-${Math.random().toString(36).slice(2)}`;return new Promise((i,o)=>{let a=setTimeout(()=>{delete this.workCenterPending[r],o(new Error("Work Center request timed out"))},3e4);this.workCenterPending[r]={resolve:i,reject:o,timer:a,agentId:n,op:e,clientMessageId:typeof t.clientMessageId=="string"?t.clientMessageId:null},this.sendWsMessage({type:"work_center_request",agentId:n,requestId:r,op:e,payload:t})})},workItemMatchesBoardQuery(e,t={}){if(!e||t.lane&&e.boardLane!==t.lane||t.vpId&&!(e.executors||[]).some(n=>n?.id===t.vpId)||t.workItemType&&e.workItemType!==t.workItemType||t.updatedFrom&&Number(e.updatedAt)<Number(t.updatedFrom)||t.updatedTo&&Number(e.updatedAt)>Number(t.updatedTo))return!1;let s=String(t.keyword||"").trim().toLowerCase();return!s||String(e.title||"").toLowerCase().includes(s)||String(e.goal||"").toLowerCase().includes(s)},applyWorkItemBoardSummary(e,t,s={}){let n=Qr(e,t),r=n.find(i=>i?.id===t?.id)||null;return!r||this.workItemMatchesBoardQuery(r,s)?n:n.filter(i=>i.id!==r.id)},async listWorkItems(e=null,t={}){let s=e||this.workCenterAgentId||this.currentAgent;if(!s)return[];let n={lane:["needs_attention","active","closed"].includes(t.lane)?t.lane:null,keyword:String(t.keyword||t.search||"").trim(),vpId:String(t.vpId||"").trim(),workItemType:String(t.workItemType||"").trim(),createdFrom:Number(t.createdFrom)||null,createdTo:Number(t.createdTo)||null,updatedFrom:Number(t.updatedFrom)||null,updatedTo:Number(t.updatedTo)||null,limit:Math.min(Math.max(Number(t.limit)||100,1),200)},r=JSON.stringify(n),i=Number(this._workCenterListGenerationByAgent[s]||0)+1,o=Number(this._workCenterListEventGenerationByAgent[s]||0);this._workCenterListGenerationByAgent={...this._workCenterListGenerationByAgent,[s]:i},this._workCenterListQueryByAgent={...this._workCenterListQueryByAgent,[s]:r},this._workCenterListFiltersByAgent={...this._workCenterListFiltersByAgent,[s]:n},this.workCenterLoadingByAgent={...this.workCenterLoadingByAgent,[s]:!0},this.workCenterErrorByAgent={...this.workCenterErrorByAgent,[s]:null};try{let a=await this.workCenterRequest("list",n,s),l=(Array.isArray(a?.items)?a.items:[]).filter(d=>!this.workItemDeleted(s,d?.id));if(this._workCenterListGenerationByAgent[s]===i&&this._workCenterListQueryByAgent[s]===r&&this.workCenterAgentId===s){let d=l,u=this._workCenterListEventsByAgent[s]||{};for(let f of Object.values(u))Number(f?.generation)<=o||f?.queryKey!==r||(d=this.applyWorkItemBoardSummary(d,f.summary,n));this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[s]:d},this.workCenterListPageByAgent={...this.workCenterListPageByAgent,[s]:{nextCursor:a?.nextCursor||null,queryKey:r}},this.workCenterWatcherByAgent={...this.workCenterWatcherByAgent,[s]:a?.watcher||null},this.workCenterLoadedByAgent={...this.workCenterLoadedByAgent,[s]:!0}}return l}catch(a){throw this._workCenterListGenerationByAgent[s]===i&&this._workCenterListQueryByAgent[s]===r&&(this.workCenterErrorByAgent={...this.workCenterErrorByAgent,[s]:a?.message||String(a)}),a}finally{this._workCenterListGenerationByAgent[s]===i&&this._workCenterListQueryByAgent[s]===r&&(this.workCenterLoadingByAgent={...this.workCenterLoadingByAgent,[s]:!1})}},async loadMoreWorkItems(e=null){let t=e||this.workCenterAgentId||this.currentAgent,s=this.workCenterListPageByAgent[t],n=this._workCenterListFiltersByAgent[t];if(!t||!s?.nextCursor||!n)return[];let r=s.queryKey,i=this._workCenterListGenerationByAgent[t],o=Number(this._workCenterListEventGenerationByAgent[t]||0),a=s.nextCursor,l=`${i}:${r}:${a}`;if(this._workCenterListMoreRequestsByAgent[t]?.key===l)return this._workCenterListMoreRequestsByAgent[t].request;this.workCenterListMoreLoadingByAgent={...this.workCenterListMoreLoadingByAgent,[t]:!0};let c=(async()=>{try{let d=await this.workCenterRequest("list",{...n,cursor:a},t),u=this.workCenterListPageByAgent[t];if(this._workCenterListGenerationByAgent[t]!==i||this._workCenterListQueryByAgent[t]!==r||u?.queryKey!==r||u?.nextCursor!==a||this.workCenterAgentId!==t)return[];let f=[...this.workCenterItemsByAgent[t]||[]];for(let g of Array.isArray(d?.items)?d.items:[]){if(this.workItemDeleted(t,g?.id))continue;let m=f.findIndex(b=>b.id===g.id);m<0?f.push(g):f[m]=Qr([f[m]],g)[0]}let p=this._workCenterListEventsByAgent[t]||{};for(let g of Object.values(p))Number(g?.generation)<=o||g?.queryKey!==r||(f=this.applyWorkItemBoardSummary(f,g.summary,n));return this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[t]:f},this.workCenterListPageByAgent={...this.workCenterListPageByAgent,[t]:{nextCursor:d?.nextCursor||null,queryKey:r}},d?.items||[]}finally{if(this._workCenterListMoreRequestsByAgent[t]?.key===l){let d={...this._workCenterListMoreRequestsByAgent};delete d[t],this._workCenterListMoreRequestsByAgent=d,this.workCenterListMoreLoadingByAgent={...this.workCenterListMoreLoadingByAgent,[t]:!1}}}})();return this._workCenterListMoreRequestsByAgent={...this._workCenterListMoreRequestsByAgent,[t]:{key:l,request:c}},c},workItemDeleted(e,t){return!!this._workCenterDeletedIdsByAgent[e]?.[t]},removeWorkItemState(e,t){this._workCenterDeletedIdsByAgent={...this._workCenterDeletedIdsByAgent,[e]:{...this._workCenterDeletedIdsByAgent[e]||{},[t]:!0}},this.beginWorkCenterDetailWrite(e),this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[e]:(this.workCenterItemsByAgent[e]||[]).filter(n=>n.id!==t)},this.workCenterDetailByAgent[e]?.id===t&&(this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[e]:null});let s=`${e}:${t}:`;for(let n of["workCenterActionMessages","workCenterActionMessagesLoading","workCenterActionMessagesError","workCenterActionRequests","workCenterActionRequestsLoading","workCenterActionRequestsError","workCenterActionRequestDetails","workCenterActionRequestDetailsLoading","workCenterActionRequestDetailsError","_workCenterActionMessageRequests","_workCenterActionMessageGenerationByKey","_workCenterActionRequestsGeneration","_workCenterActionRequestDetailsGeneration"]){let r={};for(let[i,o]of Object.entries(this[n]||{}))i.startsWith(s)||(r[i]=o);this[n]=r}},beginWorkCenterDetailWrite(e){let t=Number(this._workCenterDetailRequestGenerationByAgent[e]||0)+1;return this._workCenterDetailRequestGenerationByAgent={...this._workCenterDetailRequestGenerationByAgent,[e]:t},t},commitWorkCenterDetail(e,t,s){if(t?.id&&this.workItemDeleted(e,t.id)||s!=null&&Number(this._workCenterDetailRequestGenerationByAgent[e]||0)!==s)return!1;let n=this.workCenterDetailByAgent[e];return n?.id===t?.id&&hu(t,n)?!1:(this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[e]:t},!0)},async getWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),r=await this.workCenterRequest("get",{id:e},s);return this.commitWorkCenterDetail(s,r,n),this.workCenterDetailByAgent[s]||r},invalidateWorkItemActionMessages(e,t,s,n){if(!e||!t||!s)return null;let r=rt(n),i=Ys(e,t,s,r);this._workCenterActionMessageGenerationByKey={...this._workCenterActionMessageGenerationByKey,[i]:Number(this._workCenterActionMessageGenerationByKey[i]||0)+1};for(let a of["workCenterActionMessages","workCenterActionMessagesLoading","workCenterActionMessagesError"]){let l={...this[a]};delete l[i],this[a]=l}let o={...this._workCenterActionMessageRequests};for(let a of Object.keys(o))a.startsWith(`${i}:`)&&delete o[a];return this._workCenterActionMessageRequests=o,i},async loadWorkItemActionMessages(e,t,s,n,r=null){let i=r||this.workCenterAgentId||this.currentAgent,o=rt(s),a=Ys(i,e,t,o),l=Number(this._workCenterActionMessageGenerationByKey[a]||0),c=`${a}:${n==null?"latest":String(n)}`;if(this._workCenterActionMessageRequests[c])return this._workCenterActionMessageRequests[c];this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[a]:!0},this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[a]:null};let d=(async()=>{try{let u=await this.workCenterRequest("get_action_messages",{id:e,actionId:t,generation:o,cursor:n,limit:20},i);if(this.workItemDeleted(i,e)||rt(u?.generation)!==o||Number(this._workCenterActionMessageGenerationByKey[a]||0)!==l)return u;let f=this.workCenterActionMessages[a]?.messages||[],p=Zn(f,u?.messages||[]),g=this.workCenterActionMessages[a],m=g?.nextCursor,b=n==null?null:Number(n),I=m==null?null:Number(m),y=!g||b==null||I!=null&&b===I;return this.workCenterActionMessages={...this.workCenterActionMessages,[a]:{generation:o,messages:p,nextCursor:y?u?.nextCursor??null:m,total:Math.max(Number(u?.total)||0,Number(g?.total)||0,p.length)}},u}catch(u){throw Number(this._workCenterActionMessageGenerationByKey[a]||0)===l&&(this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[a]:u?.message||String(u)}),u}finally{if(this._workCenterActionMessageRequests[c]===d){let u={...this._workCenterActionMessageRequests};delete u[c],this._workCenterActionMessageRequests=u;let f=Object.keys(u).some(p=>p.startsWith(`${a}:`));this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[a]:f}}}})();return this._workCenterActionMessageRequests={...this._workCenterActionMessageRequests,[c]:d},d},async loadWorkItemActionRequests(e,t,s,n=null){let r=n||this.workCenterAgentId||this.currentAgent,i=rt(s),o=va(r,e,t,i),a=Number(this._workCenterActionRequestsGeneration[o]||0)+1;this._workCenterActionRequestsGeneration={...this._workCenterActionRequestsGeneration,[o]:a},this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[o]:!0},this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[o]:null};try{let l=await this.workCenterRequest("get_action_requests",{id:e,actionId:t,generation:i},r),c=!this.workItemDeleted(r,e)&&rt(l?.generation)===i&&this._workCenterActionRequestsGeneration[o]===a;return c&&(this.workCenterActionRequests={...this.workCenterActionRequests,[o]:l?.requests||[]}),c?l?.requests||[]:this.workCenterActionRequests[o]||[]}catch(l){throw this._workCenterActionRequestsGeneration[o]===a&&(this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[o]:l?.message||String(l)}),l}finally{this._workCenterActionRequestsGeneration[o]===a&&(this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[o]:!1})}},async loadWorkItemActionRequest(e,t,s,n,r,i=null){let o=i||this.workCenterAgentId||this.currentAgent,a=rt(s),c=`${va(o,e,t,a)}:${n}:${r}`,d=Number(this._workCenterActionRequestDetailsGeneration[c]||0)+1;this._workCenterActionRequestDetailsGeneration={...this._workCenterActionRequestDetailsGeneration,[c]:d},this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[c]:!0},this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[c]:null};try{let u=await this.workCenterRequest("get_action_request",{id:e,actionId:t,generation:a,runId:n,requestId:r},o),f=!this.workItemDeleted(o,e)&&rt(u?.generation)===a&&this._workCenterActionRequestDetailsGeneration[c]===d;return f&&(this.workCenterActionRequestDetails={...this.workCenterActionRequestDetails,[c]:u?.request||null}),f?u?.request||null:this.workCenterActionRequestDetails[c]||null}catch(u){throw this._workCenterActionRequestDetailsGeneration[c]===d&&(this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[c]:u?.message||String(u)}),u}finally{this._workCenterActionRequestDetailsGeneration[c]===d&&(this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[c]:!1})}},async loadWorkCenterSettings(e=null){let t=e||this.workCenterAgentId||this.currentAgent;if(!t)throw new Error("No Agent selected");let s=Number(this._workCenterSettingsGenerationByAgent[t]||0)+1;this._workCenterSettingsGenerationByAgent={...this._workCenterSettingsGenerationByAgent,[t]:s},this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!0},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:null};try{let n=await this.workCenterRequest("get_settings",{},t);return this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[t]:n?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[t]:n?.runtime||null}),n}catch(n){throw this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:n?.message||String(n)}),n}finally{this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!1})}},async refreshWorkCenterRuntime(e=null){let t=e||this.workCenterAgentId||this.currentAgent;if(!t)throw new Error("No Agent selected");let s=Number(this._workCenterSettingsGenerationByAgent[t]||0)+1;this._workCenterSettingsGenerationByAgent={...this._workCenterSettingsGenerationByAgent,[t]:s},this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!0},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:null};try{let n=await this.workCenterRequest("refresh_runtime",{},t);return this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[t]:n?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[t]:n?.runtime||null}),n}catch(n){throw this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:n?.message||String(n)}),n}finally{this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!1})}},async saveWorkCenterSettings(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent;if(!s)throw new Error("No Agent selected");let n=Number(this._workCenterSettingsGenerationByAgent[s]||0)+1;this._workCenterSettingsGenerationByAgent={...this._workCenterSettingsGenerationByAgent,[s]:n};let r=await this.workCenterRequest("update_settings",{settings:e},s);return this._workCenterSettingsGenerationByAgent[s]===n&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[s]:r?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[s]:r?.runtime||null},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[s]:null}),r},previewWorkCenterPlan(e={},t=null){let s=t||this.workCenterAgentId||this.currentAgent;return this.workCenterRequest("preview",e,s)},async createWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),r=await this.workCenterRequest("create",e,s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,r,n),r},async updateWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,r=this.beginWorkCenterDetailWrite(n),i=await this.workCenterRequest("update",{id:e,patch:t},n);return await this.listWorkItems(n,this._workCenterListFiltersByAgent[n]||{}),this.commitWorkCenterDetail(n,i,r),i},async startWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),r=await this.workCenterRequest("start",{id:e},s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,r,n),r},async cancelWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),r=await this.workCenterRequest("cancel",{id:e},s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,r,n),r},async resumeWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,r=this.beginWorkCenterDetailWrite(n),i=await this.workCenterRequest("resume",{id:e,revision:t},n);return await this.listWorkItems(n,this._workCenterListFiltersByAgent[n]||{}),this.commitWorkCenterDetail(n,i,r),i},async deleteWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,r=await this.workCenterRequest("delete",{id:e,revision:t},n);return this.removeWorkItemState(n,e),r},async postWorkItemMessage(e,t,s,n,r=[],i=null,o={},a=null){if(!this.hydrateWorkCenterBrowserState())throw new Error("Work Center browser owner is unavailable; sign in again and retry");let l=i||this.workCenterAgentId||this.currentAgent,c=this.prepareWorkCenterMessageEnvelope({agentId:l,workItemId:e,target:s,text:t,quote:a,attachments:r,revision:n,planRevision:o.planRevision,ledgerRevision:o.ledgerRevision,coordinatorRevision:o.coordinatorRevision});if(!c)throw new Error("Work Center browser owner changed; reopen Work Center and try again");let d=c.clientMessageId,u=this.workCenterDetailByAgent[l]?.id===e?this.workCenterDetailByAgent[l]:null,f=await this.workCenterRequest("post_work_item_message",{id:c.workItemId,clientMessageId:d,text:c.text,target:c.target,revision:c.revision,planRevision:c.planRevision||Number(u?.planRevision)||0,ledgerRevision:c.ledgerRevision||Number(u?.ledgerRevision)||0,coordinatorRevision:Number.isInteger(Number(c.coordinatorRevision))?Number(c.coordinatorRevision):Number(u?.coordinatorRevision)||0,...c.quote?{quote:c.quote}:{},attachments:c.attachments},l);if(c.target.kind==="coordinator"){if(!f?.accepted)throw new Error("Work Center Coordinator did not accept the message");return this.confirmWorkCenterMessageEnvelope(l,e,d),f}return await this.listWorkItems(l,this._workCenterListFiltersByAgent[l]||{}),this.confirmWorkCenterMessageEnvelope(l,e,d),f},async sendWorkItemMessage(e,t,s,n=[],r=null,i={},o=null){let a=r||this.workCenterAgentId||this.currentAgent,l=this.workCenterDetailByAgent[a]?.id===e?this.workCenterDetailByAgent[a]:null,c=await this.workCenterRequest("work_item_message",{id:e,text:t,revision:s,planRevision:Number.isInteger(Number(i.planRevision))?Number(i.planRevision):Number(l?.planRevision)||0,ledgerRevision:Number.isInteger(Number(i.ledgerRevision))?Number(i.ledgerRevision):Number(l?.ledgerRevision)||0,coordinatorRevision:Number.isInteger(Number(i.coordinatorRevision))?Number(i.coordinatorRevision):Number(l?.coordinatorRevision)||0,...Qe(o)?{quote:Qe(o)}:{},attachments:Array.isArray(n)?n:[]},a);if(!c?.accepted)throw new Error("Work Center Coordinator did not accept the message");return c},async retryWorkItemAction(e,t,s,n,r=null){let i=r||this.workCenterAgentId||this.currentAgent,o=this.beginWorkCenterDetailWrite(i),a=await this.workCenterRequest("retry_action",{id:e,actionId:t,revision:s,generation:n},i);return await this.listWorkItems(i,this._workCenterListFiltersByAgent[i]||{}),this.commitWorkCenterDetail(i,a,o),a},async sendWorkItemActionInput(e,t,s,n,r,i=[],o=null,a=null){let l=o||this.workCenterAgentId||this.currentAgent,c=Number(this._workCenterActionInputGenerationByAgent[l]||0)+1;this._workCenterActionInputGenerationByAgent={...this._workCenterActionInputGenerationByAgent,[l]:c};let d=Qe(a),u=await this.workCenterRequest("action_input",{id:e,text:t,actionId:s,revision:n,generation:r,attachments:i,...d?{quote:d}:{}},l);await this.listWorkItems(l,this._workCenterListFiltersByAgent[l]||{});let f=this.workCenterDetailByAgent[l],p=f?.actions?.find(m=>m?.id===s),g=f?.id===e&&Number(f.revision)===Number(n)&&p&&Number(p.generation)===Number(r);return this._workCenterActionInputGenerationByAgent[l]===c&&g&&!uu(u,f)?(this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[l]:u},u):f?.id===e?f:u},async guideWorkItemAction(e,t,s,n,r,i=[],o=null){let a=o||this.workCenterAgentId||this.currentAgent,l=this.beginWorkCenterDetailWrite(a),c=await this.workCenterRequest("guide",{id:e,guidance:t,actionId:s,revision:n,generation:r,attachments:i},a);return await this.listWorkItems(a,this._workCenterListFiltersByAgent[a]||{}),this.commitWorkCenterDetail(a,c,l),c},previewWorkItemAttachment(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent;return this.workCenterRequest("preview_attachment",{id:e,attachmentId:t},n)},applyWorkCenterEvent(e,t){if(!e||!t?.workItem)return;let s=t.workItem;if(t.clientMessageId){this.confirmWorkCenterMessageEnvelope(e,s.id,t.clientMessageId);let u=Object.entries(this.workCenterPending||{}).find(([,f])=>f?.agentId===e&&f.clientMessageId===t.clientMessageId);if(u){let[f,p]=u;clearTimeout(p.timer),delete this.workCenterPending[f],p.resolve(t.type==="coordinator.turn_started"?{accepted:!0,turnId:null,receipt:!0}:t.workItem)}}let n=this.workCenterItemsByAgent[e]||[];if(t.type==="work_item.deleted"){this.removeWorkItemState(e,s.id);return}if(this.workItemDeleted(e,s.id))return;let r=this._workCenterListFiltersByAgent[e]||{},i=this._workCenterListEventsByAgent[e]?.[s.id]?.summary||null,o=n.some(u=>u?.id===s.id)?n:i?[i]:[],a=Qr(o,s).find(u=>u?.id===s.id)||s,l=Number(this._workCenterListEventGenerationByAgent[e]||0)+1;this._workCenterListEventGenerationByAgent={...this._workCenterListEventGenerationByAgent,[e]:l},this._workCenterListEventsByAgent={...this._workCenterListEventsByAgent,[e]:{...this._workCenterListEventsByAgent[e]||{},[s.id]:{generation:l,queryKey:this._workCenterListQueryByAgent[e]||null,summary:a}}};let c=this.applyWorkItemBoardSummary(n,a,r);this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[e]:c};let d=this.workCenterDetailByAgent[e];if(d?.id===s.id){let u=t.type==="run.finished"&&t.actionId&&Array.isArray(s.actionStats)&&s.actionStats.some(I=>I?.id===t.actionId)?{...s,eventActionId:t.actionId}:s,f=ba(d,u),p=Number(s.coordinatorRevision),g=Number(d.coordinatorRevision)||0,m=Number.isInteger(p)&&p>g,b=pu(d,u);this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[e]:fu(d,s)},b&&this.refreshWorkItemDetailAfterActionChange(e,s,m?null:f)}},async refreshWorkItemDetailAfterActionChange(e,t,s=null){let n=s?(Array.isArray(t.actionStats)?t.actionStats:[]).find(m=>m?.id===s.actionId):(Array.isArray(t.actionStats)?t.actionStats:[]).find(m=>m?.id===t.currentActionId)||t.currentAction,r=s?.actionId||t.currentActionId||null,i=Number(s?.generation??n?.generation),o=Number.isInteger(i)&&i>0?i:null,a=Number(t.coordinatorRevision),l=!s&&Number.isInteger(a)&&a>=0?a:null,c=Number(s?.attempt),d=Number.isInteger(c)&&c>=0?c:null,u=l!=null?`${t.id}:coordinator:${l}`:`${t.id}:${r}${o==null?"":`:${o}`}${d==null?"":`:${d}`}`;if(this._workCenterDetailEventRefreshByAgent[e]?.key===u)return;let f=this.beginWorkCenterDetailWrite(e),p={key:u,generation:f};this._workCenterDetailEventRefreshByAgent={...this._workCenterDetailEventRefreshByAgent,[e]:p},s&&this.invalidateWorkItemActionMessages(e,t.id,s.actionId,s.generation);let g=r&&o!=null?this.loadWorkItemActionMessages(t.id,r,o,null,e).catch(()=>null):null;try{let m=await this.workCenterRequest("get",{id:t.id},e),b=this.workCenterDetailByAgent[e],I=b?.actions?.find(M=>M?.id===r),y=m?.actions?.find(M=>M?.id===r),S=o==null||rt(I?.generation)===o,w=o==null||rt(y?.generation)>=o,v=l==null||Number(m?.coordinatorRevision)===l,h=l!=null||S&&w&&(t.currentActionId==null?m?.currentActionId==null:b?.currentActionId===t.currentActionId&&m?.currentActionId===t.currentActionId);b?.id===t.id&&v&&h&&this.commitWorkCenterDetail(e,m,f)&&g&&await g}catch{}finally{if(this._workCenterDetailEventRefreshByAgent[e]===p){let m={...this._workCenterDetailEventRefreshByAgent};delete m[e],this._workCenterDetailEventRefreshByAgent=m}}},cacheYeaftAgentStatus(e,t,{allowBootstrapCatalog:s=!1}={}){if(!e||!t)return;let n=this.yeaftStatusByAgent[e]||{},r=Number(n.catalogRevision)||0,i=Number(t.catalogRevision)||0,o=typeof n.catalogEpoch=="string"?n.catalogEpoch:"",a=typeof t.catalogEpoch=="string"?t.catalogEpoch:"",l=Number(n.catalogRefreshedAt)||0,c=Number(t.catalogRefreshedAt)||0,d=Array.isArray(t.availableModels),u=t.type==="yeaft_status"&&d&&(i>0||c>0),f=Array.isArray(this._yeaftRetiredCatalogEpochsByAgent?.[e])?this._yeaftRetiredCatalogEpochsByAgent[e]:[],p=!!a&&f.includes(a),g=!!a&&a===o,m=i>0?g&&i===r:c>0&&c===l,b=i>0?!!a&&(a!==o||i>r):r===0&&c>l,I=i>0?!!t.catalogDigest&&!!n.catalogDigest&&t.catalogDigest===n.catalogDigest:t.catalogDigest===n.catalogDigest,y=u&&!p&&(b||m&&I),w=y||s&&r===0&&l===0&&!u&&d,v={...t};if(!w)for(let M of Cv)delete v[M];let h={...n,...v};if(w){if(y&&o&&a&&o!==a){let M=[...f.filter(x=>x!==o),o].slice(-Av);this._yeaftRetiredCatalogEpochsByAgent={...this._yeaftRetiredCatalogEpochsByAgent||{},[e]:M}}h.availableModels=t.availableModels,h.catalogRefreshedAt=y?c:null,h.catalogEpoch=y&&a||null,h.catalogRevision=y&&i||null,h.catalogDigest=y&&t.catalogDigest||null}this.yeaftStatusByAgent={...this.yeaftStatusByAgent,[e]:h},this.currentAgent===e&&this.applyCachedYeaftStatus(e)},applyCachedYeaftStatus(e=this.currentAgent){let t=e?this.yeaftStatusByAgent[e]:null;return t?(this.yeaftModel=t.model||null,this.yeaftModelEffort=t.modelEffort||null,this.yeaftAvailableModels=Array.isArray(t.availableModels)?t.availableModels:[],this.yeaftModelsRefreshing=!!t.refreshing,this.yeaftModelRefreshError=t.refreshError||null,this.yeaftYeaftDir=t.yeaftDir||null,this.yeaftStatus={skills:t.skills,mcpServers:t.mcpServers,tools:t.tools,multiVp:!!t.multiVp},!0):!1},activateYeaftAgentCatalog(e,t=this.currentAgent){let s=e?this.yeaftStatusByAgent[e]:null;return s&&this.applyCachedYeaftStatus(e),Array.isArray(s?.availableModels)?!0:(this.yeaftModel=null,this.yeaftModelEffort=null,this.yeaftAvailableModels=[],s||(this.yeaftStatus=null),this.yeaftModelsRefreshing=!!e&&!s?.refreshError,this.yeaftModelRefreshError=s?.refreshError||null,t!==e&&(this.yeaftYeaftDir=null),!1)},activateYeaftAgent(e,t=null){if(!e)return!1;let s=this.currentAgent;return this.currentAgent=e,t&&(this.currentAgentInfo=t),this.activateYeaftAgentCatalog(e,s)},resolveYeaftSessionAgentId(e){return Se(this,e)},requestYeaftSessionInventory(){if(this.yeaftSessionInventoryCompleteSupported===!1&&this.yeaftSessionHydrateRequestId)return this.yeaftSessionHydrateRequestId;if(this._yeaftSessionInventorySocketQuarantined)return this.manualReconnect(),null;clearTimeout(this._legacyYeaftSessionHydrateTimer),this._legacyYeaftSessionHydrateTimer=null;let e=`session_inventory_${crypto.randomUUID()}`;this.yeaftSessionHydrateRequestId=e,this.yeaftSessionHydrateSlices=[],this._hasHandledAgentList=!1,this._hasHandledYeaftSessionHydrate=!1,this.yeaftSessionHydrateError=null;let t=this.conversations.map(n=>n.id).filter(Boolean);return this.sendWsMessage({type:"get_agents",requestId:e,conversationIds:t.length>0?t:void 0})?(setTimeout(()=>{this.yeaftSessionHydrateRequestId===e&&(this.yeaftSessionHydrateRequestId=null,this.yeaftSessionHydrateSlices=[],this.yeaftSessionHydrateError="session_inventory_timeout",this.yeaftSessionInventoryCompleteSupported!==!0&&(this._yeaftSessionInventorySocketQuarantined=!0))},Iv),e):(this.yeaftSessionHydrateRequestId=null,this.yeaftSessionHydrateSlices=[],this.yeaftSessionHydrateError="session_inventory_send_failed",null)},beginYeaftHistoryLoad(e){let t=jc(this,e);if(!t)return null;this.sessionHistorySyncRefreshToken+=1;let{agentId:s,sessionId:n}=e||{};return setTimeout(()=>{Go(this,{agentId:s,sessionId:n,requestId:t.requestId,error:"history_load_timeout"})&&(this.sessionHistorySyncRefreshToken+=1)},Wc),t},finishYeaftHistoryLoad(e,t={},s="chunk"){let n=Uc(this,e,t,s);return n&&s!=="completion"&&(this.sessionHistorySyncRefreshToken+=1),n},isCurrentYeaftHistoryResponse(e){return Yo(this,e)},syncActiveYeaftHistoryLoad(){return jn(this)},enterYeaft(e=null,{deferBootstrap:t=!1}={}){let s=this.currentAgent;ga(this);let n=Is(this),r=!e&&n?Se(this,n):null,i=e||r||this.currentAgent||null;if(!i){let a=this.agents.find(l=>l.online);a&&(i=a.id)}if(i&&this.currentAgent!==i){this.selectAgent(i),this.currentAgent=i;let a=this.agents.find(l=>l.id===i);a&&(this.currentAgentInfo=a)}if(!this.applyCachedYeaftStatus(i)&&s&&s!==i&&(this.yeaftAvailableModels=[],this.yeaftStatus=null,this.yeaftModelsRefreshing=!0,this.yeaftModelRefreshError=null),i){let a=this.yeaftConversationIdsByAgent?.[i]||null;a||(a=`yeaft-local-${i}-${Date.now()}`,this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[i]:a}),this.yeaftConversationId=a}else this.yeaftConversationId||(this.yeaftConversationId=`yeaft-local-${Date.now()}`);this.messagesMap[this.yeaftConversationId]||(this.messagesMap[this.yeaftConversationId]=[]),eu(this),this.currentView="yeaft",fa("yeaft"),this.hasMoreMessages=!1,this.loadingMoreMessages=!1,this.yeaftHasMoreHistory=!1,this.yeaftLoadingMoreHistory=!1,this.yeaftOldestLoadedSeq=null,this._yeaftReconnectCatchUpPending=!1,this.loadOpenedYeaftSessionsForConnectedAgents(null,{force:!0}),t||this.requestYeaftSessionBootstrap({forceSessionReady:!0,catchUpHistory:!0,forceHistoryReplay:!0})},loadOpenedYeaftSessionsForConnectedAgents(e=null,{force:t=!1}={}){let s=Array.isArray(e)?e.filter(Boolean):Array.isArray(this.agents)?this.agents.filter(i=>i&&i.online&&i.id).map(i=>i.id):[],n=[...new Set(s)];(!this._yeaftOpenedSessionsLoadedAgents||typeof this._yeaftOpenedSessionsLoadedAgents!="object")&&(this._yeaftOpenedSessionsLoadedAgents={});let r=[];for(let i of n)!t&&this._yeaftOpenedSessionsLoadedAgents[i]||(this._yeaftOpenedSessionsLoadedAgents[i]=Date.now(),r.push(i),this.sessionCrudRequest("list",{},{agentId:i}).catch(o=>{delete this._yeaftOpenedSessionsLoadedAgents[i]}));return r},requestYeaftSessionBootstrap({forceSessionReady:e=!1,catchUpHistory:t=!1,forceHistoryReplay:s=!1}={}){if(!this.currentAgent)return;let n=Is(this),r=n?Se(this,n):this.currentAgent,i=ke(r,n),o=n?this.yeaftSessionHistoryState[i]:null,a=e||!this.yeaftSessionReady||!this.yeaftModel||!this.yeaftStatus,l=Number.isFinite(o?.latestSeq)?o.latestSeq:null,c=!!n&&!!this.yeaftConversationId&&Array.isArray(this.messagesMap?.[this.yeaftConversationId])&&this.messagesMap[this.yeaftConversationId].some(y=>y&&(y.sessionId??y.groupId??null)===n),d=!!n&&Oo({sessionState:o,hasCachedSessionRows:c,force:!!s}),u=!!n&&!d&&Lc(o,t);if(!a&&!d&&!u)return!1;let f=`${r}:${n||"__none__"}`,p=a&&!d&&!u;if(p&&this.yeaftBootstrapMetaLoadingKey===f)return!1;p&&(this.yeaftBootstrapMetaLoadingKey=f);let g=null;n&&d?g=this.beginYeaftHistoryLoad({agentId:r,sessionId:n,mode:"recent",preserveLoaded:!1}):n&&c&&!o?.loaded?(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[i]:{...o||{},loaded:!0,loading:!1,hasMore:!!o?.hasMore,oldestSeq:Number.isFinite(o?.oldestSeq)?o.oldestSeq:null,count:o?.count||0,latestSeq:l}},this.yeaftLoadingMoreHistory=!1):n&&u&&(g=this.beginYeaftHistoryLoad({agentId:r,sessionId:n,mode:"delta",preserveLoaded:!0,latestSeq:l}));let m={type:"yeaft_load_history",agentId:r,sessionId:n,...g?{requestId:g.requestId}:{}};u?m.afterSeq=l:m.limit=d?ti:0;let b=gs();m.perfTraceId=b;let I=u?"delta":d?"recent":"metadata";return n&&(this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[i]:b}),Ge(this,{traceId:b,phase:"history.request_send",agentId:r,sessionId:n,messageType:m.type,bytes:JSON.stringify(m).length,detail:{mode:I,limit:m.limit??null,afterSeq:m.afterSeq??null,hasCachedSessionRows:c,needSessionReady:a}}),this.sendWsMessage(m),!0},leaveYeaft(){this.activateChatView({persistPreference:!0})},fetchYeaftToolStats(){this.currentAgent&&(this.yeaftToolStatsLoading=!0,this.sendWsMessage({type:"yeaft_fetch_tool_stats",agentId:this.currentAgent}),this._fetchYeaftToolStatsTimer&&clearTimeout(this._fetchYeaftToolStatsTimer),this._fetchYeaftToolStatsTimer=setTimeout(()=>{this.yeaftToolStatsLoading&&(this.yeaftToolStatsLoading=!1,this.yeaftToolStats={...this.yeaftToolStats||{snapshot:{},registered:[],unused:[]},error:null,notice:"Tool stats are unavailable right now. Try again after the agent reconnects.",fetchedAt:Date.now()}),this._fetchYeaftToolStatsTimer=null},1e4))},loadYeaftDebugHistory({groupId:e,limit:t,dreamLimit:s,indexOnly:n=!1,detailTurnId:r=null,search:i=void 0}={}){if(!this.currentAgent)return;let o=typeof i=="string"?i.trim():(this.yeaftDebugSearch||"").trim(),a=typeof r=="string"&&r,l=o&&!a?Hu:Ra,c=Number.isFinite(t)&&t>0?t:this.yeaftDebugHistoryLimit||l,d=Math.max(1,Math.min(l,c)),u=a?"detail":"list",f=`dbg_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,p=JSON.stringify({agentId:this.currentAgent,groupId:e||null,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5,indexOnly:!!n,detailTurnId:r||null,search:a?"":o});if(this._yeaftDebugHistoryInFlightKey===p)return;this._yeaftDebugHistoryInFlightKey=p,a?this._yeaftDebugHistoryLatestDetailRequestId=f:this._yeaftDebugHistoryLatestListRequestId=f,this.yeaftDebugHistoryLimit=d,this.yeaftDebugHistoryLoading=!0,this.yeaftDebugHistoryError=null;let g={type:"yeaft_fetch_debug_history",agentId:this.currentAgent,requestId:f,requestKind:u,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5};n&&(g.indexOnly=!0),typeof r=="string"&&r?g.detailTurnId=r:o&&(g.search=o),typeof e=="string"&&e&&(g.sessionId=e),this.sendWsMessage(g),this._fetchYeaftDebugHistoryTimer&&clearTimeout(this._fetchYeaftDebugHistoryTimer),this._fetchYeaftDebugHistoryTimer=setTimeout(()=>{this.yeaftDebugHistoryLoading&&(this.yeaftDebugHistoryLoading=!1,this.yeaftDebugHistoryError="Debug history is unavailable right now. Try again after the agent reconnects."),this._yeaftDebugHistoryInFlightKey=null,this._fetchYeaftDebugHistoryTimer=null},1e4)},agentIdForSession(e){return Se(this,e)},sendYeaftSessionMessage({groupId:e,text:t,mentions:s,attachments:n,quote:r}){let i=Se(this,e);if(!e||!i)return;let o=Array.isArray(n)?n.filter(g=>g&&g.fileId):[],a=Qe(r),l=o.length>0;if(!t?.trim()&&!l)return;let c=t?.trim()?t:"(attached files)",d=`u_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,u=gs();this.yeaftPerfTraceByMessageId={...this.yeaftPerfTraceByMessageId||{},[d]:u},Ge(this,{traceId:u,phase:"send.prepare",agentId:i,sessionId:e,turnId:d,messageType:"yeaft_session_send",detail:{mentionCount:Array.isArray(s)?s.length:0,attachmentCount:o.length,quoted:!!a}});let f=vt(this,e);if(f){let g={id:d,messageId:d,clientMessageId:d,stableKey:Yt(i,e,d),uiKey:Yt(i,e,d),type:"user",content:c,sessionId:e,turnId:d,...a?{quote:a}:{}};if(o.length>0&&(g.attachments=o.map(m=>({fileId:m.fileId,name:m.name,preview:m.preview,isImage:!!m.isImage,mimeType:m.mimeType||""}))),this.addMessageToConversation(f,g),this.processingConversations[f]=!0,e){let m=mt(i,e);this.yeaftProcessingSessions={...this.yeaftProcessingSessions,...m?{[m]:!0}:{}}}this._turnCompletedConvs?.delete(f),this._closedAt?.[f]&&delete this._closedAt[f],this.getOrCreateExecutionStatus(f),qs(this,f)}let p={type:"yeaft_session_send",agentId:i,id:d,sessionId:e,text:c,mentions:Array.isArray(s)?s:[],perfTraceId:u,...a?{quote:a}:{}};o.length>0&&(p.attachments=o.map(g=>({fileId:g.fileId,isImage:!!g.isImage}))),Ge(this,{traceId:u,phase:"send.websocket_send",agentId:i,sessionId:e,turnId:d,messageType:p.type,bytes:JSON.stringify(p).length}),this.sendWsMessage(p)},cancelYeaftTask({agentId:e=null,sessionId:t,taskId:s}){let n=typeof t=="string"?t.trim():"",r=typeof s=="string"?s.trim():"",i=Se(this,n,e);return!i||!n||!r?!1:(this.yeaftStoppingTasksById={...this.yeaftStoppingTasksById,[Ta(i,n,r)]:!0},this.sendWsMessage({type:"yeaft_task_cancel",agentId:i,sessionId:n,taskId:r,clientRequestId:`task_cancel_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}),!0)},getYeaftMessageWindowKey(e=null,t=null){let s=e||this.yeaftActiveSessionFilter||null,n=Se(this,s,t);return ke(n,s)},pruneYeaftMessageWindow(e=null,t=null){if(this.currentView!=="yeaft")return;let s=this.getYeaftMessageWindowKey(e,t);Object.values(this._yeaftHistoryRevealLeases||{}).some(r=>r?.sessionKey===s)||(this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[s]:{visibleTurns:Ss()}})},expandYeaftMessageWindow(e=null,t=Jn(),s=null){if(this.currentView!=="yeaft")return;let n=this.getYeaftMessageWindowKey(e,s),i=(this.yeaftMessageWindowState[n]?.visibleTurns||Ss())+Math.max(1,Number.isFinite(t)?Math.floor(t):Jn());this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[n]:{visibleTurns:i}}},isYeaftMessageCached(e,t,s=null,n=null){let r=e||this.yeaftActiveSessionFilter||null,i=s||vt(this,r,n);return!i||!t?!1:(this.messagesMap[i]||[]).some(o=>(!r||(o?.sessionId??o?.groupId??null)===r)&&((o?.id||o?.messageId)===t||o?.persistedMessageId===t))},revealYeaftMessage(e,t,s=null,n=null){let r=e||this.yeaftActiveSessionFilter||null,i=Se(this,r,n),o=s||vt(this,r,i);if(!o||!t)return!1;let a=(this.messagesMap[o]||[]).filter(p=>r?(p?.sessionId??p?.groupId??null)===r:!0),l=a.findIndex(p=>(p?.id||p?.messageId)===t||p?.persistedMessageId===t);if(l<0)return!1;let c=Su(a),d=c.findIndex(p=>l>=p.start&&l<p.end);if(d<0)return!1;let u=Math.max(Ss(),c.length-d),f=this.getYeaftMessageWindowKey(r,i);return this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[f]:{visibleTurns:u}},!0},getYeaftHistoryOutlineState(e=null,t=null){let s=e||this.yeaftActiveSessionFilter||null,n=Se(this,s,t),r=ke(n,s),i=this.yeaftHistoryOutlineBySession[r]||{requestId:null,agentId:n,sessionId:s,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,nextCursor:null,totalCount:null,loaded:!1,error:null},o=vt(this,s,n),a=o?this.messagesMap[o]||[]:[],l=new Map((i.results||[]).map(f=>[er(f),f])),c=0;for(let f of a){if((f?.sessionId??f?.groupId??null)!==s)continue;let p=f.messageId||f.id;if(!p)continue;let g=f.type==="user"&&!!f.clientMessageId&&p===f.clientMessageId,m=f.type==="assistant"&&f.isStreaming===!0;if(!g&&!m)continue;let b=f.type,I=f.turnId||f.threadId||p,y=f.speakerVpId||f.vpId||null,S=er({role:b,messageId:p,clientMessageId:f.clientMessageId,turnId:I,speakerVpId:y}),w=l.get(S),h=(typeof f.content=="string"?f.content:"").replace(/\s+/g," ").trim();l.set(S,{...w,agentId:n,sessionId:s,messageId:Number.isFinite(w?.seq)?w.messageId:p,...f.clientMessageId?{clientMessageId:f.clientMessageId}:{},turnId:I,role:b,speakerVpId:y||w?.speakerVpId||null,timestamp:f.timestamp||f.ts||w?.timestamp||null,snippet:h.length>180?`${h.slice(0,180).trimEnd()}\u2026`:h||w?.snippet||""}),w||(c+=1)}let d=f=>{let p=typeof f=="number"?f:Date.parse(f||"");return Number.isFinite(p)?p:0},u=Array.from(l.values()).sort((f,p)=>Number.isFinite(f.seq)&&Number.isFinite(p.seq)?f.seq-p.seq:d(f.timestamp)-d(p.timestamp));return{...i,results:u,totalCount:Number.isFinite(i.totalCount)?i.totalCount+c:i.totalCount}},promoteYeaftHistoryOutlineRow(e,t=null){let s=e?.sessionId??e?.groupId??null,n=ke(t,s),r=this.yeaftHistoryOutlineBySession[n];if(!s||!t||!r?.loaded||r.loading)return!1;let i=e?.type;if(i!=="user"&&i!=="assistant")return!1;let o=e.dbMessageId||e.messageId||e.id||null,a=Dv(o);if(!o||!Number.isFinite(a))return!1;let l=e.turnId||e.threadId||o,c=e.speakerVpId||e.vpId||null,u=(typeof e.content=="string"?e.content:"").replace(/\s+/g," ").trim(),f=er({role:i,messageId:o,clientMessageId:e.clientMessageId,turnId:l,speakerVpId:c}),p=new Map((r.results||[]).map(S=>[er(S),S])),g=p.get(f);p.set(f,{...g,agentId:t,sessionId:s,messageId:o,...e.clientMessageId?{clientMessageId:e.clientMessageId}:{},turnId:l,seq:a,role:i,speakerVpId:c,timestamp:e.timestamp||e.ts||g?.timestamp||null,snippet:u.length>180?`${u.slice(0,180).trimEnd()}\u2026`:u||g?.snippet||""});let m=50,b=Array.from(p.values()).sort((S,w)=>(S.seq||0)-(w.seq||0)),I=b.length>m,y=b.slice(-m);return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[n]:{...r,results:y,hasMore:r.hasMore||I,nextBeforeSeq:I&&Number.isFinite(y[0]?.seq)?y[0].seq:r.nextBeforeSeq,totalCount:Number.isFinite(r.totalCount)&&!g?r.totalCount+1:r.totalCount}},!0},promoteCompletedYeaftHistoryOutline(e,t=null,s=null){let n=this.messagesMap[e]||[],r=null,i=[];for(let o=n.length-1;o>=0;o--){let a=n[o];if(a?.type==="user")break;if(t&&a?.turnId&&a.turnId!==t||a?.type!=="assistant")continue;let l=typeof a.content=="string"?a.content.replace(/\s+/g," ").trim():"";r?!String(r.content||"").trim()&&l&&(r=a):r=a,l&&i.unshift(l)}return r?this.promoteYeaftHistoryOutlineRow({...r,content:i.join(" ")},s):!1},invalidateYeaftHistoryOutline(e,t=null){let s=ke(t,e),n=this.yeaftHistoryOutlineBySession[s];if(!e||!t||!n)return!1;if(n.loading)return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[s]:{...n,refreshPending:!0}},!0;this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[s]:{...n,loaded:!1,refreshPending:!1}};let r=Se(this,e);return this.currentView==="yeaft"&&this.yeaftActiveSessionFilter===e&&r===t?this.loadYeaftHistoryOutline({force:!0,targetSessionId:e,targetAgentId:t}):!0},loadYeaftHistoryOutline({append:e=!1,force:t=!1,targetSessionId:s=null,targetAgentId:n=null}={}){if(this.currentView!=="yeaft"&&!s)return!1;let r=s||this.yeaftActiveSessionFilter||null,i=n||Se(this,r);if(!r||!i)return!1;let o=ke(i,r),a=this.getYeaftHistoryOutlineState(r,i);if(!e&&a.loaded&&!t)return!0;if(e&&(!a.hasMore||!Number.isFinite(a.nextBeforeSeq))||a.loading)return!1;if(!Lu(this,i,"session_history_outline"))return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[o]:{...a,error:"unsupported",loading:!1}},!1;let l=`history_outline_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,c={...a,requestId:l,agentId:i,sessionId:r,loading:!0,requestAppend:e,refreshPending:!1,error:null};this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[o]:c};let d=this._yeaftHistoryOutlineTimeouts[o];d&&clearTimeout(d);let u=setTimeout(()=>{let g=this.yeaftHistoryOutlineBySession[o];if(g?.requestId!==l)return;let m={...this._yeaftHistoryOutlineTimeouts};delete m[o],this._yeaftHistoryOutlineTimeouts=m;let b=g.refreshPending===!0;this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[o]:{...g,requestId:null,loading:!1,requestAppend:!1,loaded:b?!1:g.loaded,refreshPending:!1,error:b?null:"timeout"}},b&&this.loadYeaftHistoryOutline({force:!0,targetSessionId:r,targetAgentId:i})},1e4);this._yeaftHistoryOutlineTimeouts={...this._yeaftHistoryOutlineTimeouts,[o]:u};let f=gs(),p={type:"yeaft_load_history_outline",agentId:i,sessionId:r,requestId:l,perfTraceId:f,limit:50,...e&&a.nextCursor?{cursor:a.nextCursor}:{},...e&&!a.nextCursor&&Number.isFinite(a.nextBeforeSeq)?{beforeSeq:a.nextBeforeSeq}:{}};return Ge(this,{traceId:f,phase:"history_outline.request_send",agentId:i,sessionId:r,messageType:p.type,bytes:JSON.stringify(p).length,detail:{append:e,limit:p.limit}}),this.sendWsMessage(p),!0},handleYeaftHistoryOutline(e){if(!e?.agentId||!e?.sessionId)return!1;let t=ke(e.agentId,e.sessionId),s=this.yeaftHistoryOutlineBySession[t];if(!s||e.requestId!==s.requestId)return!1;let n=this._yeaftHistoryOutlineTimeouts[t];n&&clearTimeout(n);let r={...this._yeaftHistoryOutlineTimeouts};delete r[t],this._yeaftHistoryOutlineTimeouts=r;let i=Array.isArray(e.results)?e.results.map(d=>({...d,agentId:e.agentId,sessionId:e.sessionId})):[],o=s.requestAppend?[...s.results||[],...i]:i,a=new Map(o.filter(d=>d?.messageId).map(d=>[er(d),d])),l=Array.from(a.values()).sort((d,u)=>(d.seq||0)-(u.seq||0)),c=s.refreshPending===!0;return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[t]:{...s,requestId:null,loading:!1,requestAppend:!1,refreshPending:!1,loaded:c?!1:!e.error,results:l,hasMore:!!e.hasMore,nextBeforeSeq:Number.isFinite(e.nextBeforeSeq)?e.nextBeforeSeq:null,nextCursor:e.nextCursor&&typeof e.nextCursor=="object"?e.nextCursor:null,totalCount:Number.isFinite(e.totalCount)?e.totalCount:s.totalCount,error:c?null:e.error||null}},c&&this.loadYeaftHistoryOutline({force:!0,targetSessionId:e.sessionId,targetAgentId:e.agentId}),!0},searchYeaftHistory(e,{append:t=!1,senderKey:s=""}={}){if(this.currentView!=="yeaft")return!1;let n=typeof e=="string"?e.trim():"",r=typeof s=="string"&&(s==="user"||s.startsWith("vp:"))?s.slice(0,103):"",i=this.yeaftActiveSessionFilter||null,o=Se(this,i);if(this._yeaftHistorySearchTimeout&&(clearTimeout(this._yeaftHistorySearchTimeout),this._yeaftHistorySearchTimeout=null),!i||!o||Array.from(n).length<1&&!r)return this.yeaftHistorySearchState={requestId:null,agentId:o,sessionId:i,query:n,senderKey:r,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,nextCursor:null,error:null},!1;let a=this.yeaftHistorySearchState||{};if(!Lu(this,o,"session_history_search"))return this.yeaftHistorySearchState={requestId:null,agentId:o,sessionId:i,query:n,senderKey:r,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,nextCursor:null,error:"unsupported"},!1;let l=`history_search_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;this.yeaftHistorySearchState={requestId:l,agentId:o,sessionId:i,query:n,senderKey:r,loading:!0,results:t&&a.query===n&&a.senderKey===r?a.results:[],hasMore:!1,nextBeforeSeq:t&&a.query===n&&a.senderKey===r?a.nextBeforeSeq:null,nextCursor:t&&a.query===n&&a.senderKey===r&&a.nextCursor||null,error:null},this._yeaftHistorySearchTimeout=setTimeout(()=>{this.yeaftHistorySearchState?.requestId===l&&(this._yeaftHistorySearchTimeout=null,this.yeaftHistorySearchState={...this.yeaftHistorySearchState,loading:!1,error:"timeout"})},1e4);let c=gs(),d={type:"yeaft_search_history",agentId:o,sessionId:i,requestId:l,perfTraceId:c,query:n,senderKey:r,limit:20,...t&&a.query===n&&a.senderKey===r&&a.nextCursor?{cursor:a.nextCursor}:{},...t&&a.query===n&&a.senderKey===r&&!a.nextCursor&&Number.isFinite(a.nextBeforeSeq)?{beforeSeq:a.nextBeforeSeq}:{}};return Ge(this,{traceId:c,phase:"history_search.request_send",agentId:o,sessionId:i,messageType:d.type,bytes:JSON.stringify(d).length,detail:{append:t,limit:d.limit,queryLength:Array.from(n).length,senderFilter:!!r}}),this.sendWsMessage(d),!0},handleYeaftHistorySearchResult(e){let t=this.yeaftHistorySearchState||{};if(!e||e.requestId!==t.requestId||e.agentId!==t.agentId||e.sessionId!==t.sessionId||e.query!==t.query||(e.senderKey||"")!==t.senderKey)return!1;this._yeaftHistorySearchTimeout&&(clearTimeout(this._yeaftHistorySearchTimeout),this._yeaftHistorySearchTimeout=null);let s=Array.isArray(e.results)?e.results.map(r=>({...r,agentId:e.agentId,sessionId:e.sessionId})):[],n=new Map((t.results||[]).map(r=>[$n(r),r]));for(let r of s)(r?.entryId||r?.messageId)&&n.set($n(r),r);return this.yeaftHistorySearchState={...t,loading:!1,results:Array.from(n.values()),hasMore:!!e.hasMore,nextBeforeSeq:Number.isFinite(e.nextBeforeSeq)?e.nextBeforeSeq:null,nextCursor:e.nextCursor&&typeof e.nextCursor=="object"?e.nextCursor:null,error:e.error||null},!0},loadYeaftHistoryWindow(e,{validateCached:t=!1}={}){let s=e?.sessionId||this.yeaftActiveSessionFilter||null,n=e?.agentId||Se(this,s),r=$n(e);if(!s||!n||!e?.entryId||!Number.isFinite(e.indexGeneration)||!Number.isFinite(e.entryStartSeq)||!e?.messageId||!Number.isFinite(e.seq))return Promise.resolve(!1);let i=vt(this,s,n);if((this.messagesMap[i]||[]).some(p=>(p?.sessionId??p?.groupId??null)===s&&p?.historyEntryId===e.entryId&&p?.historyIndexGeneration===e.indexGeneration)&&!t)return Promise.resolve(!0);let a=ke(n,`${s}:${r}:generation:${e.indexGeneration}`),l=this._yeaftHistoryWindowPendingByKey||{};if(l[a]?.promise)return l[a].promise;let c=`history_window_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,d=null,u=new Promise(p=>{d=p}),f=setTimeout(()=>{if(this._yeaftHistoryWindowPendingByKey?.[a]?.requestId!==c)return;let{[a]:g,...m}=this._yeaftHistoryWindowPendingByKey;this._yeaftHistoryWindowPendingByKey=m,d(!1)},1e4);return this._yeaftHistoryWindowPendingByKey={...l,[a]:{requestId:c,agentId:n,sessionId:s,entryId:e.entryId||null,indexGeneration:Number.isFinite(e.indexGeneration)?e.indexGeneration:null,entryStartSeq:Number.isFinite(e.entryStartSeq)?e.entryStartSeq:null,resultId:r,messageId:e.messageId,resolve:d,timeout:f,promise:u}},this.sendWsMessage({type:"yeaft_load_history_window",agentId:n,sessionId:s,requestId:c,...e.entryId?{entryId:e.entryId}:{},...Number.isFinite(e.indexGeneration)?{indexGeneration:e.indexGeneration}:{},...Number.isFinite(e.entryStartSeq)?{entryStartSeq:e.entryStartSeq}:{},anchorMessageId:e.messageId,anchorSeq:e.seq,beforeTurns:5,afterTurns:5,maxRows:200,maxBytes:512*1024}),u},beginYeaftHistoryReveal(e){let t=e?.sessionId||null,s=e?.agentId||null,n=vt(this,t,s);if(!t||!s||!n)return null;let r=ke(s,t),i=`${r}${n}`,o=++this._yeaftHistoryRevealSequence,a={key:i,token:o,sessionKey:r,agentId:s,sessionId:t,conversationId:n};return this._yeaftHistoryRevealLeases={...this._yeaftHistoryRevealLeases||{},[i]:a},a},finishYeaftHistoryReveal(e){if(!e?.key||!Number.isFinite(e.token)||this._yeaftHistoryRevealLeases?.[e.key]?.token!==e.token)return!1;let{[e.key]:s,...n}=this._yeaftHistoryRevealLeases;return this._yeaftHistoryRevealLeases=n,!0},async revealYeaftHistoryResult(e,t=null){let s=!t,n=t||this.beginYeaftHistoryReveal(e),r=e?.sessionId||null,i=e?.agentId||null,o=vt(this,r,i);if(!n||!r||!i||!o||!e?.messageId)return this.finishYeaftHistoryReveal(n),!1;if(!await this.loadYeaftHistoryWindow(e,{validateCached:!0}))return this.finishYeaftHistoryReveal(n),!1;if(this.currentView!=="yeaft"||this.yeaftActiveSessionFilter!==r||Se(this,r)!==i||vt(this,r,i)!==o)return this.finishYeaftHistoryReveal(n),!1;let l=this.revealYeaftMessage(r,e.messageId,o,i);return(!l||s)&&this.finishYeaftHistoryReveal(n),l},pendingYeaftHistoryWindow(e){let s=Object.entries(this._yeaftHistoryWindowPendingByKey||{}).find(([,i])=>i?.requestId===e?.requestId);if(!s)return null;let[n,r]=s;return e.agentId!==r.agentId||e.sessionId!==r.sessionId||e.entryId&&r.entryId&&e.entryId!==r.entryId||Number.isFinite(e.indexGeneration)&&Number.isFinite(r.indexGeneration)&&e.indexGeneration!==r.indexGeneration?null:{pendingKey:n,pending:r}},handleYeaftHistoryWindow(e,t=null){let s=this.pendingYeaftHistoryWindow(e);if(!s)return!1;let{pendingKey:n,pending:r}=s;clearTimeout(r.timeout);let{[n]:i,...o}=this._yeaftHistoryWindowPendingByKey;this._yeaftHistoryWindowPendingByKey=o;let a=!e.error&&!!t&&this.isYeaftMessageCached(r.sessionId,r.messageId,t,r.agentId);return r.resolve(!!a),!!a},createYeaftSession({displayName:e,vpIds:t,defaultVpId:s,workDir:n,agentId:r}={}){let i=Array.isArray(t)?t.slice():[],o=s&&i.includes(s)?s:i[0]||null,a=(e||"").trim(),l=(n||"").trim(),c={roster:i,defaultVpId:o};return a&&(c.name=a),l&&(c.workDir=l),this.sessionCrudRequest("create",c,{agentId:r})},handleYeaftOutput(e){if(!e)return;let t=e.agentId||this.yeaftAgentId||this.currentAgent||null,s=e.conversationId||e.event?.conversationId||null,n=Ws(this,t,s);if(e.data&&n){if(e.data.type!=="result")return;let a=qc(this,t,s);if(!a)return;let l=e.turnId?Qs(this,t,e.turnId):"",c=!!(l&&this.activeVpTurns?.[l])||(this.messagesMap?.[a]||[]).some(d=>d?.turnId===e.turnId&&(d.isStreaming||d.status==="pending"));if(!e.turnId||!c)return;e={...e,conversationId:a}}if(e.perfTraceId&&(Ge(this,{traceId:e.perfTraceId,phase:"receive.yeaft_output",agentId:e.agentId||null,sessionId:e.sessionId||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||e.event?.type||e.type}),e.turnId&&(this.yeaftPerfTraceByTurnId={...this.yeaftPerfTraceByTurnId||{},[e.turnId]:e.perfTraceId})),e.data){let a=e.agentId||null,l=Ht(this,a,e.conversationId);if(l){let d=Pa(e,e.turnId||"session");for(let u of["retry","retrying","thinking"])Bs(this,l,`${u}:${d}`);e.data?.tool_use_result&&Bs(this,l,`tool:${d}`)}let c=e.turnId?Qs(this,e.agentId||null,e.turnId):"";if(c&&this.activeVpTurns?.[c]?.retryAttempt){let{retryAttempt:d,retryMax:u,retryDelayMs:f,retryReason:p,retryRecoveryMode:g,...m}=this.activeVpTurns[c];this.activeVpTurns={...this.activeVpTurns,[c]:m}}if(l){let d=e.sessionId??e.groupId??null,u=$u(this,d,a),f=a&&this.yeaftConversationIdsByAgent?this.yeaftConversationIdsByAgent[a]:null,p=It(this,a);p&&p.targetConversationId!==l?Wn(this,a,l):!p&&f&&f!==l&&!String(f).startsWith("yeaft-local-")&&(Ct(this,f,l,{removeSource:f!==this.yeaftConversationId}),Bn(this,a,f,l)),qo(this,a,l);let g=It(this,a,l),m=g?.sourceConversationId||f,b=!u&&m===this.yeaftConversationId;if(this.currentView==="yeaft"&&a&&m&&m!==l){let h=!b&&(!!g||String(m).startsWith("yeaft-local-"));Ct(this,m,l,{removeSource:h}),b?Wr(this,a,m,l):h&&qn(this,a,l)}a&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[a]:l}),(u||!this.yeaftConversationId)&&(this.yeaftConversationId=l),u&&(this.activeConversations=[l]),this.messagesMap[l]||(this.messagesMap[l]=[]),this.currentView==="yeaft"&&(e.data?.type==="user"||e.data?.type==="text_delta")&&this.pruneYeaftMessageWindow(this.yeaftActiveSessionFilter&&e.sessionId||null);let I=this._currentYeaftAgentId,y=this._currentYeaftSessionId,S=this._currentYeaftVpId,w=this._currentYeaftTurnId,v=this._currentYeaftThreadId;a&&(this._currentYeaftAgentId=a),d!=null&&(this._currentYeaftSessionId=d),e.vpId&&(this._currentYeaftVpId=e.vpId),e.turnId&&(this._currentYeaftTurnId=e.turnId),e.threadId&&(this._currentYeaftThreadId=e.threadId);try{this.currentView==="yeaft"&&d&&(!this.yeaftActiveSessionFilter||d===this.yeaftActiveSessionFilter)&&this.pruneYeaftMessageWindow(this.yeaftActiveSessionFilter?d:null);let M=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(this.handleAssistantOutputFrame(l,e.data,a),e.perfTraceId){let A=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ge(this,{traceId:e.perfTraceId,phase:"store.apply_output",agentId:e.agentId||null,sessionId:d||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||null,durationMs:A-M}),Ur(this,{traceId:e.perfTraceId,agentId:e.agentId||null,sessionId:d||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||null})}let x=e.data,E=x?.message?.id||x?.id||null,V=Ev(E),L=Array.isArray(x?.message?.content)?x.message.content:[],R=L.some(A=>A?.type==="tool_use"),P=!!x?.tool_use_result||L.some(A=>A?.type==="tool_result");if(d){let A=!P&&!_v(this,l,d)&&(x?.type==="user"||x?.type==="assistant"&&!R)?V:null,_=ke(e.agentId||null,d),j=this.yeaftSessionHistoryState[_]||{},q=Number.isFinite(j.latestSeq)?j.latestSeq:-1;A!==null&&A>q&&(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[_]:{...j,latestSeq:A}})}}finally{this._currentYeaftAgentId=I,this._currentYeaftSessionId=y,this._currentYeaftVpId=S,this._currentYeaftTurnId=w,this._currentYeaftThreadId=v}}return}let r=e.event;if(!r)return;let i={...r,vpId:r.vpId||e.vpId||null,threadId:r.threadId||e.threadId||null,turnId:r.turnId||e.turnId||null},o=Ht(this,e.agentId||null,e.conversationId);if(o){let a=Pa(i);r.type==="tool_start"?Nn(this,o,`tool:${a}`):r.type==="tool_end"?Bs(this,o,`tool:${a}`):r.type==="llm_retry"?Nn(this,o,`retry:${a}`):r.type==="vp_async_task_wait_start"?Nn(this,o,`async-wait:${a}`):r.type==="vp_async_task_wait_end"&&Bs(this,o,`async-wait:${a}`)}switch(r.type){case"project_mutation_result":r.projectsAuthoritative===!0?this.finishProjectMutation(r):this.finishLegacyProjectMutation(r,e.agentId||null);break;case"ask_user_question":{let a=Ht(this,e.agentId||null,e.conversationId);if(!a||!r.requestId)break;let l=Pu(e,r,a),c=()=>{let d=this.messagesMap[a]||[],u=_u(d,l,a);if(u){if(u.askAnswered||u.askExpired)return!0;u.toolName="AskUserQuestion",r.toolCallId&&!u.toolId&&(u.toolId=r.toolCallId),u.agentId=l.agentId||u.agentId||null,u.askRequestId=r.requestId,u.askQuestions=r.questions||[],u.askCreatedAt=r.createdAt||null,u.askExpiresAt=r.expiresAt||null,r.replay&&(u.askPending=!1,u.pendingAnswers=null,u.askSubmitGeneration=null),u.isHistory=!1;let g=Eu(this,l);return g&&xa(u,g),this.messagesMap={...this.messagesMap,[a]:d.slice()},!0}if(!r.replay)return!1;let f={id:`ask-card-${r.requestId}`,type:"tool-use",toolName:"AskUserQuestion",toolId:r.toolCallId||null,toolInput:{questions:r.questions||[]},askRequestId:r.requestId,askQuestions:r.questions||[],askCreatedAt:r.createdAt||null,askExpiresAt:r.expiresAt||null,agentId:l.agentId,sessionId:l.sessionId,vpId:l.vpId,speakerVpId:l.vpId,turnId:l.turnId,threadId:l.threadId||"main",hasResult:!1,isHistory:!1,timestamp:r.createdAt||Date.now()},p=Eu(this,l);return p&&xa(f,p),d.push(f),this.messagesMap={...this.messagesMap,[a]:d.slice()},!0};if(!c()){let d=0,u=setInterval(()=>{d+=1,(c()||d>=10)&&clearInterval(u)},200)}break}case"ask_user_answered":case"ask_user_expired":{let a=Ht(this,e.agentId||null,e.conversationId);if(!a||!r.requestId)break;let l=this.messagesMap[a]||[],c=Pu(e,r,a),d=_u(l,c,a);if(!d){Rv(this,c,r);break}xa(d,r),this.messagesMap={...this.messagesMap,[a]:l.slice()};break}case"session_ready":{let a=r.conversationId,l=e.agentId||this.currentAgent;if(Ws(this,l,a))break;let c=l&&this.yeaftConversationIdsByAgent?this.yeaftConversationIdsByAgent[l]:null,d=this.yeaftConversationId?String(this.yeaftConversationId):"",u=d.startsWith("yeaft-local-")&&(!l||d.startsWith(`yeaft-local-${l}-`)||/^yeaft-local-\d/.test(d))?this.yeaftConversationId:null,f=c||u,p=r.sessionId||e.sessionId||null,g=$u(this,p,l),m=It(this,l);m&&m.targetConversationId!==a?Wn(this,l,a):!m&&c&&c!==a&&!String(c).startsWith("yeaft-local-")&&Bn(this,l,c,a),qo(this,l,a);let I=It(this,l,a)?.sourceConversationId||f,y=!g&&I===this.yeaftConversationId;if(I&&I!==a){let M=!y;Ct(this,I,a,{removeSource:M}),y?Wr(this,l,I,a):M&&qn(this,l,a)}else this.messagesMap[a]||(this.messagesMap[a]=[]);l&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[l]:a},this.cacheYeaftAgentStatus(l,r,{allowBootstrapCatalog:g})),g&&(this.yeaftModel=r.model,this.yeaftModelEffort=r.modelEffort||null,this.yeaftSessionReady=!0,this.yeaftBootstrapMetaLoadingKey=null,l?this.applyCachedYeaftStatus(l):this.yeaftAvailableModels=r.availableModels||[]);let S=Array.isArray(r.tasks)?r.tasks:[],w={};for(let[M,x]of Object.entries(this.yeaftActiveTasksBySession||{})){let E=Object.fromEntries(Object.entries(x||{}).filter(([,L])=>L?.id&&L.status==="running"&&L.agentId&&L.agentId!==l)),V=Ma(E);Object.keys(V).length>0&&(w[M]=V)}for(let M of S){if(!M?.id||!M.sessionId||M.status!=="running")continue;let x=ke(l,M.sessionId);w[x]={...w[x]||{},[M.id]:{...M,agentId:l}}}this.yeaftActiveTasksBySession=w,g&&(r.yeaftDir&&(this.yeaftYeaftDir=r.yeaftDir),this.yeaftStatus={skills:r.skills,mcpServers:r.mcpServers,tools:r.tools,multiVp:!!r.multiVp}),(g||!this.yeaftConversationId)&&(this.yeaftConversationId=a),g&&(this.activeConversations=[a]);let v=e.agentId||this.currentAgent||null,h=v||"__current__";this._yeaftVpSubscribedAgentKey!==h&&(this._yeaftVpSubscribedAgentKey=h,this.sendWsMessage(v?{type:"yeaft_vp_subscribe",agentId:v}:{type:"yeaft_vp_subscribe"}));break}case"yeaft_status":{let a=e.agentId||this.currentAgent;a&&this.cacheYeaftAgentStatus(a,r);break}case"context_usage":break;case"turn_open":{if(!r.turnId)break;let a={turnId:r.turnId,userPrompt:r.userPrompt||"",vpId:r.vpId||e.vpId||null,sessionId:r.sessionId||e.sessionId||null,openedAt:r.at||Date.now(),closedAt:null,totalMs:0,totalTokens:0,loopCount:0,memoryLoaded:null,memoryLoadedMeta:null,memoryAdjust:null,tools:[],detailsLoaded:!0};this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:a},this.yeaftDebugTurnOrder.includes(r.turnId)||(this.yeaftDebugTurnOrder=[...this.yeaftDebugTurnOrder,r.turnId]);break}case"turn_close":{if(!r.turnId)break;let a=this.yeaftDebugTurnsById[r.turnId];if(!a)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...a,closedAt:Date.now(),totalMs:r.totalMs||0,totalTokens:r.totalTokens||0,loopCount:r.loopCount||a.loopCount||0}};break}case"memory_used":{if(!r.turnId)break;let a=this.yeaftDebugTurnsById[r.turnId];if(!a)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...a,memoryLoaded:Array.isArray(r.loaded)?r.loaded:[],memoryLoadedMeta:r.meta||null}};break}case"dream_memory_loaded":{let a=Array.isArray(r.resident)?r.resident:[];if(r.turnId){let c=this.yeaftDebugTurnsById[r.turnId];c&&(this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...c,dreamMemoryLoaded:a,dreamMemoryLoadedInto:r.loadedInto||"system_prompt.memory"}})}let l={};for(let c of a){let d=c&&typeof c.scope=="string"?c.scope:null,u=d&&/^sessions\/[^/]+$/.test(d)?d:d&&/^group\/[^/]+$/.test(d)?`sessions/${d.slice(6)}`:null;u&&(l[u]={scope:u,sourceScope:d,sessionId:u.slice(9),turnId:r.turnId||null,vpId:r.vpId||null,loadedInto:r.loadedInto||"system_prompt.memory",summary:c.summary||"",truncated:!!c.truncated,receivedAt:Date.now()})}Object.keys(l).length>0&&(this.yeaftDreamPromptLoads={...this.yeaftDreamPromptLoads,...l});break}case"memory_adjust":{if(!r.turnId)break;let a=this.yeaftDebugTurnsById[r.turnId];if(!a)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...a,memoryAdjust:{sessionKey:r.sessionKey||null,added:r.added||0,evicted:r.evicted||0,skipped:r.skipped||0,reason:r.reason||""}}};break}case"tool_exec":{if(!r.turnId)break;let a=this.yeaftDebugTurnsById[r.turnId];if(!a)break;let l=[...a.tools||[],{loopNumber:r.loopNumber||0,callId:r.callId||null,name:r.name||"?",durationMs:r.durationMs||0,isError:!!r.isError,toolOutput:r.toolOutput==null?null:String(r.toolOutput)}];this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[r.turnId]:{...a,tools:l}};break}case"loop":{if(this.yeaftDebugLoops.push({turnId:r.turnId||null,loopNumber:r.loopNumber||0,model:r.model,systemPrompt:r.systemPrompt,messages:r.messages,response:r.response,toolCalls:r.toolCalls,usage:r.usage||{inputTokens:0,outputTokens:0,totalTokens:0},latencyMs:r.latencyMs,ttfbMs:r.ttfbMs,stopReason:r.stopReason,at:typeof r.at=="number"?r.at:null,rawRequest:r.rawRequest||null,rawResponse:r.rawResponse||null,sessionId:e.sessionId||null,vpId:e.vpId||r.vpId||null}),this.yeaftDebugLoops.length>Vu){let a=au({loops:this.yeaftDebugLoops,turnsById:this.yeaftDebugTurnsById,turnOrder:this.yeaftDebugTurnOrder,maxLoops:Math.max(Vu,this.yeaftDebugHistoryLimit||0)});this.yeaftDebugLoops=a.loops,this.yeaftDebugTurnsById=a.turnsById,this.yeaftDebugTurnOrder=a.turnOrder}break}case"llm_retry":{if(!e.turnId)break;let a=Qs(this,e.agentId||null,e.turnId),l=this.activeVpTurns?.[a];if(!l)break;let c=r.reason==="stream_idle_timeout"?"stream_idle_timeout":"transient_error";this.activeVpTurns={...this.activeVpTurns,[a]:{...l,retryAttempt:r.attempt||0,retryMax:r.maxRetries||0,retryDelayMs:r.delayMs||0,retryReason:c,retryRecoveryMode:r.recoveryMode||"restart"}};break}case"recall":case"consolidate":case"fallback":case"thinking_delta":break;case"reflection":{let a=Ht(this,e.agentId||null,e.conversationId)||"unknown",l=Array.isArray(r.loopRange)?r.loopRange:[0,0],c=`${a}:${r.trigger}:${l[0]}-${l[1]}`,d=this.yeaftReflectionCards[c],u=this.messagesMap[a]||[],f=d?d.anchorMsgId:u.length>0&&u[u.length-1].id||null,p=d?d.anchorOrder:u.length;this.yeaftReflectionCards={...this.yeaftReflectionCards,[c]:{key:c,conversationId:a,turnId:r.turnId||d&&d.turnId||null,loopNumber:r.loopNumber||d&&d.loopNumber||null,trigger:r.trigger,status:r.status,loopRange:l,toolCount:r.toolCount||0,content:r.content||"",durationMs:r.durationMs||0,error:r.error||null,sessionId:e.sessionId||null,anchorMsgId:f,anchorOrder:p,updatedAt:Date.now()}};break}case"model_switched":this.yeaftModel=r.model,this.yeaftModelEffort=r.modelEffort||null;break;case"yeaft_task_event":{let a=r.task;if(!a?.id||!a.sessionId)break;let l=e.agentId||Se(this,a.sessionId),c=ke(l,a.sessionId),d={...a,agentId:l},u={...this.yeaftActiveTasksBySession},f={...u[c]||{}};a.status==="running"?f[a.id]=d:delete f[a.id];let p=Ma(f);if(Object.keys(p).length>0?u[c]=p:delete u[c],this.yeaftActiveTasksBySession=u,a.status!=="running"){let{[Ta(l,a.sessionId,a.id)]:g,...m}=this.yeaftStoppingTasksById||{};this.yeaftStoppingTasksById=m}break}case"yeaft_task_cancel_result":{let a=r.taskId||r.task?.id||null,l=r.task?.sessionId||r.sessionId||e.sessionId||null,c=e.agentId||Se(this,l);if(a&&l&&r.success===!1){let{[Ta(c,l,a)]:u,...f}=this.yeaftStoppingTasksById||{};this.yeaftStoppingTasksById=f}let d=r.task;if(d?.id&&d.sessionId){let u=ke(c,d.sessionId),f={...this.yeaftActiveTasksBySession},p={...f[u]||{}};d.status==="running"?p[d.id]={...d,agentId:c}:delete p[d.id];let g=Ma(p);Object.keys(g).length>0?f[u]=g:delete f[u],this.yeaftActiveTasksBySession=f}break}case"sub_agent_event":{let a=Ht(this,e.agentId||null,e.conversationId)||"unknown",l=r.agentId;if(!l)break;let c=r.payload||{},d=`${a}:${l}`,u=this.yeaftSubAgentCards[d],f=this.messagesMap[a]||[],p=u?u.anchorMsgId:f.length>0&&f[f.length-1].id||null,g=u?u.anchorOrder:f.length,m=u?{...u}:{key:d,conversationId:a,agentId:l,agentName:c.agentName||"sub-agent",status:"running",text:"",toolCallCount:0,turns:0,error:null,expanded:!1,anchorMsgId:p,anchorOrder:g,updatedAt:Date.now(),sessionId:e.sessionId||null};switch(c.agentName&&!m.agentName&&(m.agentName=c.agentName),c.type){case"sub_agent_status":m.status=c.status||m.status,c.error&&(m.error=c.error);break;case"text_delta":break;case"tool_use":case"tool_call":m.toolCallCount=Number(m.toolCallCount||0)+1;break;case"tool_start":break;case"tool_result":case"tool_end":break;case"sub_agent_turn_end":{m.turns+=1;let b=typeof c.content=="string"?c.content.trim():"";b&&(m.text=m.text?`${m.text}
|
|
9
9
|
|
|
10
|
-
${b}`:b),m.status!=="failed"&&m.status!=="closed"&&(m.status=c.status||"idle");break}case"error":c.error&&(m.error=c.error.message||String(c.error));break;default:break}m.updatedAt=Date.now(),this.yeaftSubAgentCards={...this.yeaftSubAgentCards,[d]:m};break}case"history_loaded":{let a={...r,agentId:e.agentId||null,requestId:r.requestId||e.requestId||null};if(a.requestId&&!this.isCurrentYeaftHistoryResponse(a))break;let l=e.agentId||null,c=r.sessionId??null,d=ke(l,c),u=e.perfTraceId||this.yeaftHistoryPerfTraceBySession?.[d];u&&Ge(this,{traceId:u,phase:"history.loaded_event",agentId:e.agentId||null,sessionId:r.sessionId||null,messageType:r.type,detail:{mode:r.mode||"recent",count:r.count||0,hasMore:!!r.hasMore}});let f=r.mode==="delta"?"delta":"recent",p=this.yeaftSessionHistoryState[d]||{},g=Number.isFinite(r.latestSeq)?r.latestSeq:Number.isFinite(p.latestSeq)?p.latestSeq:null,m=Number.isFinite(r.nextBeforeSeq)?r.nextBeforeSeq:Number.isFinite(r.oldestSeq)?r.oldestSeq:Number.isFinite(p.serverOldestFetchedSeq)?p.serverOldestFetchedSeq:Number.isFinite(p.oldestSeq)?p.oldestSeq:null,b=f==="delta"?{...p,loaded:!0,loading:!1,latestSeq:g,syncingAfterSeq:null,count:(p.count||0)+(r.count||0)}:{...p,loaded:!0,loading:!1,hasMore:!!r.hasMore,serverHasMore:!!r.hasMore,oldestSeq:m,serverOldestFetchedSeq:m,count:typeof r.count=="number"?r.count:0,latestSeq:g,syncingAfterSeq:null},I=a.requestId?this.finishYeaftHistoryLoad(a,b,"completion"):null;I||(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[d]:b});let y=ke(l?this.currentAgent:null,this.yeaftActiveSessionFilter??null);if(d===y)f==="recent"&&(this.yeaftHasMoreHistory=b.hasMore,this.yeaftOldestLoadedSeq=b.serverOldestFetchedSeq),this.yeaftLoadingMoreHistory=!!I?.loading;else if(this.yeaftLoadingMoreHistory){let S=this.yeaftSessionHistoryState[y]||null;this.yeaftLoadingMoreHistory=!!S?.loading}}break;case"vp_snapshot":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&a.applySnapshot(r,e.agentId||null,e.requestId||null);break}case"vp_snapshot_error":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&a.failSnapshot(e.agentId||null,e.requestId||null,r.error||r.message||"VP library request failed");break}case"vp_updated":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&r.vp&&a.upsert(r.vp,r.reason,e.agentId||null);break}case"vp_removed":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&r.vpId&&a.remove(r.vpId,r.reason,e.agentId||null);break}case"vp_crud_result":{let a=this._vpCrudPending&&this._vpCrudPending.get(r.requestId);a&&(this._vpCrudPending.delete(r.requestId),a.resolve({ok:!!r.ok,op:r.op,vpId:r.vpId,vp:r.vp,error:r.error||null}));break}case"group_list_updated":case"session_list_updated":case"yeaft_session_hydrate":{let a=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore(),l=r.sessions||[];if(r.projectsAuthoritative===!0&&Array.isArray(r.projects)?this.applySessionCatalogSnapshot(this.sessionCatalog,r.projects):Array.isArray(r.projects)&&e.agentId&&this.applyLegacyProjectSnapshot(r.projects,e.agentId),r.type!=="yeaft_session_hydrate"&&this.yeaftSessionHydrateRequestId&&this.yeaftSessionInventoryCompleteSupported===!0){let p=Array.isArray(this.yeaftSessionHydrateSlices)?this.yeaftSessionHydrateSlices.filter(g=>g.agentId!==(e.agentId||null)):[];this.yeaftSessionHydrateSlices=[...p,{agentId:e.agentId||null,sessions:l}];break}let c=a&&a.activeSessionId||null,d=a?.activeSessionKey&&a.sessions?.[a.activeSessionKey]?.agentId||null;a&&(a.applySnapshot(l,e.agentId||null),this._hasHandledYeaftSessionHydrate=!0,this.yeaftSessionHydrateError=null);let u=a&&a.activeSessionId||null,f=a?.activeSessionKey&&a.sessions?.[a.activeSessionKey]?.agentId||null;if(this.currentView==="yeaft"&&u){let p=f||Se(this,u,e.agentId||null),g=ke(p,u),m=this.yeaftSessionHistoryState[g]||null;this.setActiveSessionFilter(u,{agentId:p,force:d!==p||Dc(u,c,m)})}break}case"group_roster_changed":case"session_roster_changed":{let a=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();a&&a.applyRosterChange(r,e.agentId||null);break}case"group_crud_result":case"session_crud_result":{let a=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();a&&a.applyCrudResult(r,e.agentId||null);let l=this._sessionCrudPending&&this._sessionCrudPending.get(r.requestId);if(l){this._sessionCrudPending.delete(r.requestId);let c=r.session||r.group||null,d=c&&e.agentId&&!c.agentId?{...c,agentId:e.agentId}:c,u=r.sessionId||null,f=r.sessions||null;l.resolve({ok:!!r.ok,op:r.op,session:d,sessionId:u,sessions:f,config:r.config||null,error:r.error||null})}break}case"vp_turn_start":{if(!r.turnId||!r.vpId)break;let a=da(e.agentId||null,r.turnId)||r.turnId;if(this.activeVpTurns={...this.activeVpTurns,[a]:{agentId:e.agentId||null,turnId:r.turnId,vpId:r.vpId,sessionId:r.sessionId||null,threadId:r.threadId||null,isStreaming:!0,startedAt:r.ts||Date.now()}},r.sessionId){let l=mt(e.agentId||null,r.sessionId);this.yeaftProcessingSessions={...this.yeaftProcessingSessions,...l?{[l]:!0}:{[r.sessionId]:!0}}}break}case"vp_turn_end":{if(!r.turnId)break;let a=Qs(this,e.agentId||null,r.turnId),l=r.sessionId||this.activeVpTurns?.[a]?.sessionId||null;r.reason==="end_turn"&&l&&this.markYeaftSessionUnread(l,e.agentId||null);let{[a]:c,...d}=this.activeVpTurns;this.activeVpTurns=d;let{[a]:u,...f}=this.stoppingVpTurnIds;this.stoppingVpTurnIds=f;let p=r.sessionId||c?.sessionId||null,g=e.agentId||c?.agentId||null,m=r.vpId||c?.vpId||null;if(!(p&&m?Object.values(this.activeVpTurns||{}).some(v=>v?.vpId===m&&et(v,p,g)):!1)&&p&&m){let v={...this.vpStatuses||{}},h=!1;for(let[M,x]of Object.entries(v))x?.vpId===m&&et(x,p,g)&&tr.has(x.state)&&(v[M]={...x,state:"idle",turnId:null,since:r.ts||Date.now()},h=!0);h&&(this.vpStatuses=v)}this.clearYeaftSessionProcessingIfIdle(p,{agentId:g});let y={end_turn:"completed",route_forward:"completed",aborted:"aborted",errored:"errored",error:"errored",cancelled:"cancelled",canceled:"cancelled"}[r.reason]||"completed",S=Date.now(),w=Ht(this,e.agentId||null,e.conversationId);if(w&&Array.isArray(this.messagesMap[w])){let v=this.messagesMap[w],h=ku(v,r);for(let M=0;M<v.length;M++){let x=v[M];if(!x||x.type!=="assistant")continue;let E=x.sessionId??x.groupId;r.sessionId&&E&&E!==r.sessionId||r.vpId&&x.speakerVpId&&x.speakerVpId!==r.vpId||r.turnId&&x.turnId&&x.turnId!==r.turnId||x.status&&x.status!=="pending"||(x.status=y,x.turnEndAt=S,x.turnEndReason=r.reason||null,r.detail&&(x.turnEndDetail=r.detail),Number.isFinite(r.durationMs)&&(x.turnDurationMs=r.durationMs),h=!0)}h&&(this.messagesMap={...this.messagesMap,[w]:v.slice()})}break}case"yeaft_turn_aborted":{let a=Array.isArray(r.turnIds)?r.turnIds.filter(Boolean):[];r.turnId&&a.push(r.turnId);let l=r.sessionId||null,c=r.vpId||null,d=new Set;for(let g of a){let m=Qs(this,e.agentId||null,g),b=this.activeVpTurns?.[m]||null;(!b||et(b,b.sessionId,e.agentId||null))&&d.add(m)}if(c)for(let[g,m]of Object.entries(this.activeVpTurns||{}))!m||m.vpId!==c||et(m,l,e.agentId||null)&&d.add(g);if(d.size===0)break;let u=l,f={...this.activeVpTurns||{}},p={...this.stoppingVpTurnIds||{}};for(let g of d){let m=f[g];!u&&m?.sessionId&&(u=m.sessionId),delete f[g],delete p[g]}this.activeVpTurns=f,this.stoppingVpTurnIds=p,this.clearYeaftSessionProcessingIfIdle(u||null,{agentId:e.agentId||null});break}case"yeaft_aborted":{let a=r.sessionId||e.sessionId||null;a?(this.activeVpTurns=Object.fromEntries(Object.entries(this.activeVpTurns||{}).filter(([,l])=>!et(l,a,e.agentId||null))),this.stoppingVpTurnIds=Object.fromEntries(Object.entries(this.stoppingVpTurnIds||{}).filter(([l])=>this.activeVpTurns?.[l])),this.vpStatuses=Object.fromEntries(Object.entries(this.vpStatuses||{}).filter(([,l])=>!et(l,a,e.agentId||null))),this.clearYeaftSessionProcessingIfIdle(a,{agentId:e.agentId||null,ignoreStatuses:!0})):r.all&&Tu(this,e.agentId||null);break}case"vp_typing_start":{if(!r.vpId)break;let a=Ht(this,e.agentId||null,e.conversationId);if(!a)break;this.yeaftVpTyping=nu(this.yeaftVpTyping,a,r.vpId);break}case"vp_typing_end":{if(!r.vpId)break;let a=Ht(this,e.agentId||null,e.conversationId);if(!a)break;this.yeaftVpTyping=ru(this.yeaftVpTyping,a,r.vpId);break}case"vp_status_changed":{if(!r.vpId||!r.state)break;if(o){let u=Pa(i);if(r.state==="thinking"||r.state==="retrying"||r.state==="tool")Nn(this,o,`${r.state}:${u}`);else if(r.state==="streaming"||r.state==="idle"||r.state==="error")for(let f of["thinking","retrying","tool"])qs(this,o,`${f}:${u}`)}let a=r.sessionId||null,l=e.agentId||null,c=ei(l,a,r.vpId),d={agentId:l,state:r.state,since:r.since||Date.now(),turnId:r.turnId||null,title:r.title||"",sessionId:a,vpId:r.vpId};if(this.vpStatuses={...this.vpStatuses,[c]:d},a&&tr.has(r.state)){let u=mt(l,a);this.yeaftProcessingSessions={...this.yeaftProcessingSessions,...u?{[u]:!0}:{[a]:!0}}}else a&&this.clearYeaftSessionProcessingIfIdle(a,{agentId:l});this.restoreActiveYeaftSessionFromStatuses([d],l);break}case"vp_status_snapshot":{let a=Array.isArray(r.statuses)?r.statuses:[],l=r.sessionId;if(l==null){let c={...this.vpStatuses||{}};if(e.agentId)for(let[d,u]of Object.entries(c))(!u?.agentId||u.agentId===e.agentId)&&delete c[d];else for(let d of Object.keys(c))delete c[d];for(let d of a){if(!d||!d.vpId)continue;let u=d.sessionId||d.groupId||null,f=ei(e.agentId||null,u,d.vpId);c[f]={agentId:e.agentId||null,state:d.state,since:d.since||Date.now(),turnId:d.turnId||null,title:d.title||"",sessionId:u,vpId:d.vpId}}this.vpStatuses=c}else{let c={...this.vpStatuses};for(let[d,u]of Object.entries(c))u&&u.sessionId===l&&(!e.agentId||!u.agentId||u.agentId===e.agentId)&&delete c[d];for(let d of a){if(!d||!d.vpId)continue;let u=d.sessionId||d.groupId||null,f=ei(e.agentId||null,u,d.vpId);c[f]={agentId:e.agentId||null,state:d.state,since:d.since||Date.now(),turnId:d.turnId||null,title:d.title||"",sessionId:u,vpId:d.vpId}}this.vpStatuses=c}this.yeaftProcessingSessions=Sv(this,e.agentId||null,a,l??null),this.restoreActiveYeaftSessionFromStatuses(a,e.agentId||null);break}case"yeaft_dream_snapshot":{let a=r&&r.snapshot,l=a&&typeof a.scope=="string"?a.scope:null;l&&(this.yeaftDreamSnapshots={...this.yeaftDreamSnapshots,[l]:{...a,receivedAt:Date.now()}});break}case"yeaft_dream_status":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&a.applyDreamStatus(r);break}case"yeaft_dream_result":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&a.applyDreamResult(r),r?.snapshot?.scope&&(this.yeaftDreamSnapshots={...this.yeaftDreamSnapshots,[r.snapshot.scope]:{...r.snapshot,receivedAt:Date.now()}});{let l=typeof r?.snapshot?.scope=="string"&&r.snapshot.scope?r.snapshot.scope:typeof r?.sessionId=="string"&&r.sessionId?`sessions/${r.sessionId}`:null;if(!l)break;let c=this.yeaftDreamLatest[l]||null;this.yeaftDreamLatest={...this.yeaftDreamLatest,[l]:{scope:l,phase:"result",status:r.skipped?"skipped":r.success?"success":"error",startedAt:c?.startedAt??null,finishedAt:Date.now(),mergedCount:typeof r.entriesCreated=="number"?r.entriesCreated:c?.mergedCount??null,error:r.skipped||r.success?null:r.error||"unknown",manual:typeof r?.manual=="boolean"?r.manual:c?.manual??null,durationMs:typeof r.durationMs=="number"?r.durationMs:c?.durationMs??null,llmCallCount:typeof r.llmCallCount=="number"?r.llmCallCount:c?.llmCallCount??0,inputTokens:typeof r.inputTokens=="number"?r.inputTokens:c?.inputTokens??0,outputTokens:typeof r.outputTokens=="number"?r.outputTokens:c?.outputTokens??0,totalTokens:typeof r.totalTokens=="number"?r.totalTokens:c?.totalTokens??0,metrics:r.metrics||c?.metrics||null,passBreakdown:r.passBreakdown||r.metrics?.passBreakdown||c?.passBreakdown||null,isRunning:!1}},this._appendDreamEvent(l,{type:"dream_progress",phase:"result",sessionId:r.sessionId,status:r.skipped?"skipped":r.success?"success":"error",success:!!r.success,entriesCreated:typeof r.entriesCreated=="number"?r.entriesCreated:null,trigger:r.trigger||null,error:r.skipped||r.success?null:r.error||null,skipped:!!r.skipped,skippedReason:r.skippedReason||null,durationMs:typeof r.durationMs=="number"?r.durationMs:null,llmCallCount:typeof r.llmCallCount=="number"?r.llmCallCount:0,inputTokens:typeof r.inputTokens=="number"?r.inputTokens:0,outputTokens:typeof r.outputTokens=="number"?r.outputTokens:0,totalTokens:typeof r.totalTokens=="number"?r.totalTokens:0,metrics:r.metrics||null,passBreakdown:r.passBreakdown||r.metrics?.passBreakdown||null,ts:Date.now()})}break}case"dream_progress":{let a=r?.phase||"unknown",l=null;typeof r?.target=="string"&&r.target.includes("/")?l=r.target:typeof r?.sessionId=="string"&&r.sessionId?l=`sessions/${r.sessionId}`:l="*";let c=a==="done",d=a==="error"||r?.status==="error",u=!c&&!d,f=p=>{let g=this.yeaftDreamLatest[p]||null;return{scope:p,phase:a,status:d?"error":c?"success":"running",startedAt:g?.startedAt&&u?g.startedAt:r?.ts||g?.startedAt||Date.now(),finishedAt:c||d?r?.ts||Date.now():null,mergedCount:typeof r?.mergedCount=="number"?r.mergedCount:typeof r?.targets=="number"?r.targets:g?.mergedCount??null,error:d?r?.error||"unknown":null,manual:typeof r?.manual=="boolean"?r.manual:g?.manual??!1,durationMs:typeof r?.duration=="number"?r.duration:typeof r?.durationMs=="number"?r.durationMs:g?.durationMs??null,llmCallCount:typeof r?.llmCallCount=="number"?r.llmCallCount:g?.llmCallCount??0,inputTokens:typeof r?.inputTokens=="number"?r.inputTokens:g?.inputTokens??0,outputTokens:typeof r?.outputTokens=="number"?r.outputTokens:g?.outputTokens??0,totalTokens:typeof r?.totalTokens=="number"?r.totalTokens:g?.totalTokens??0,metrics:r?.metrics||g?.metrics||null,passBreakdown:r?.passBreakdown||r?.metrics?.passBreakdown||g?.passBreakdown||null,isRunning:u}};if(l==="*"){let p={...this.yeaftDreamLatest,"*":f("*")};for(let g of Object.keys(this.yeaftDreamLatest))g!=="*"&&(p[g]=f(g));this.yeaftDreamLatest=p}else this.yeaftDreamLatest={...this.yeaftDreamLatest,[l]:f(l)};this._appendDreamEvent(l,r);break}}},_appendDreamEvent(e,t){if(!e||!t)return;let s=Date.now(),n={...t,at:s},r=Array.isArray(this.yeaftDreamEvents?.[e])?this.yeaftDreamEvents[e]:[],i=l=>[l?.type||"",l?.phase||"",(l?.sessionId??l?.groupId)||"",l?.target||"",l?.ts||l?.at||""].join("|"),o=i(n);if(r.some(l=>i(l)===o))return;let a=[...r,n];a.length>Ou&&a.splice(0,a.length-Ou),this.yeaftDreamEvents={...this.yeaftDreamEvents,[e]:a}},fetchExpertRoleDefinitions(){if(this.expertRoleDefinitions)return;let e=this.currentAgent;e&&this.sendWsMessage({type:"get_expert_roles",agentId:e})},setYeaftSidebarEnabled(e){try{typeof localStorage<"u"&&localStorage.removeItem("yeaft-sidebar-enabled")}catch{}},vpCrudRequest(e,t){(!this._vpCrudPending||typeof this._vpCrudPending.get!="function")&&(this._vpCrudPending=new Map);let s="vpc_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,8),r={create:"yeaft_vp_create",update:"yeaft_vp_update",delete:"yeaft_vp_delete",read:"yeaft_vp_read"}[e];if(!r)return Promise.resolve({ok:!1,op:e,error:{code:"bad_op",message:"unknown op: "+e}});let i={type:r,requestId:s};return e==="create"||e==="update"?i.payload=t||{}:i.vpId=t,new Promise(o=>{let a=setTimeout(()=>{this._vpCrudPending&&this._vpCrudPending.has(s)&&(this._vpCrudPending.delete(s),o({ok:!1,op:e,error:{code:"timeout",message:"vp_crud timeout"}}))},1e4);this._vpCrudPending.set(s,{resolve:l=>{clearTimeout(a),o(l)}}),this.sendWsMessage(i)})},sessionCrudRequest(e,t,s={}){(!this._sessionCrudPending||typeof this._sessionCrudPending.get!="function")&&(this._sessionCrudPending=new Map);let n="grc_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,8),i={list:"yeaft_list_sessions",create:"yeaft_create_session",rename:"yeaft_rename_session",update:"yeaft_update_session",update_config:"yeaft_update_session_config",archive:"yeaft_archive_session",delete:"yeaft_delete_session",add_member:"yeaft_session_add_member",remove_member:"yeaft_session_remove_member",set_default_vp:"yeaft_session_set_default_vp",reorder:"reorder_yeaft_sessions",scan_workdir:"yeaft_scan_workdir_sessions",restore:"yeaft_restore_session"}[e];if(!i)return Promise.resolve({ok:!1,op:e,error:{code:"bad_op",message:"unknown op: "+e}});let o={type:i,requestId:n};e==="create"?o.payload=t||{}:t&&typeof t=="object"&&Object.assign(o,t);let a=s&&s.agentId?s.agentId:null;a&&(o.agentId=a);let l=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();return l&&l.markPending(n,e),new Promise(c=>{let d=setTimeout(()=>{this._sessionCrudPending&&this._sessionCrudPending.has(n)&&(this._sessionCrudPending.delete(n),c({ok:!1,op:e,error:{code:"timeout",message:"group_crud timeout"}}))},1e4);this._sessionCrudPending.set(n,{resolve:u=>{clearTimeout(d),c(u)}}),this.sendWsMessage(o)})},markYeaftSessionUnread(e,t=null){if(!e)return!1;let s=Se(this,e,t);if(!s)return!1;let n=Hr(s,e);return this.currentView==="yeaft"&&this.yeaftActiveSessionFilter===e&&Se(this,e)===s||this.yeaftUnreadSessionKeys?.[n]?!1:(this.yeaftUnreadSessionKeys={...this.yeaftUnreadSessionKeys,[n]:!0},!0)},markYeaftSessionRead(e,t=null){if(!e)return!1;let s=Se(this,e,t);if(!s)return!1;let n=Hr(s,e);if(!this.yeaftUnreadSessionKeys?.[n])return!1;let{[n]:r,...i}=this.yeaftUnreadSessionKeys;return this.yeaftUnreadSessionKeys=i,!0},restoreActiveYeaftSessionFromStatuses(e=[],t=null){if(this.yeaftActiveSessionFilter)return null;let n=(Array.isArray(e)?e:[]).filter(o=>o&&(o.sessionId||o.groupId)&&!["idle","offline","completed","failed","aborted"].includes(o.state)).sort((o,a)=>(a.updatedAt||a.since||0)-(o.updatedAt||o.since||0)),r=n[0]?.sessionId||n[0]?.groupId||null;if(!r)return null;let i=t||n[0]?.agentId||Fu(this,r);if(!i)return null;this.setActiveSessionFilter(r,{agentId:i,force:!0});try{let o=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();o&&typeof o.setActive=="function"&&o.setActive(r,i)}catch{}return r},setActiveSessionFilter(e,t={}){let s=this.yeaftActiveSessionFilter||null,n=e||null,r=n?Se(this,n,t.agentId||null):this.currentAgent,i=!!n&&n===s&&!!r&&!!this.currentAgent&&r!==this.currentAgent,o=!!t.force||i;if(this.yeaftActiveSessionFilter=n,r&&n&&this.currentAgent!==r){this.selectAgent(r);let c=this.agents.find(d=>d.id===r);this.activateYeaftAgent(r,c||null)}else r&&n&&this.activateYeaftAgent(r);if(r&&n&&(this.markYeaftSessionRead(n,r),Yc(this,r,n)),!o&&n===s)return;let a=ke(r,n),l=this.yeaftSessionHistoryState[a]||null;if(this.pruneYeaftMessageWindow(n),r&&n){this.yeaftSessionAgentById={...this.yeaftSessionAgentById||{},[n]:r};let c=this.yeaftConversationIdsByAgent?.[r]||null;c||(c=`yeaft-local-${r}-${Date.now()}`,this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[r]:c}),this.yeaftConversationId=c,this.messagesMap[c]||(this.messagesMap[c]=[]),this.currentView==="yeaft"&&(this.activeConversations=[c])}try{let c=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();c&&typeof c.setActive=="function"&&c.setActive(n,r||null);let d=c?.activeSessionKey||null;d?localStorage.setItem("lastViewedYeaftSession",d):localStorage.removeItem("lastViewedYeaftSession")}catch{}if(this.syncActiveYeaftHistoryLoad(),!l?.loading&&r&&n){let c=Number.isFinite(l?.latestSeq)?l.latestSeq:null,d={type:"yeaft_load_history",agentId:r,sessionId:n},u=!!l?.loaded,f=Oo({sessionState:l,hasCachedSessionRows:!1,force:o});if(!f&&c!==null?d.afterSeq=c:d.limit=ti,!f&&u&&c===null){this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...l||{hasMore:!1,oldestSeq:null,count:0},loaded:!0,loading:!1,syncingAfterSeq:null}},this.syncActiveYeaftHistoryLoad();return}let p=null;if(!f&&u){if(l?.syncingAfterSeq===c)return;p=this.beginYeaftHistoryLoad({agentId:r,sessionId:n,mode:"delta",preserveLoaded:!0,latestSeq:c}),this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...this.yeaftSessionHistoryState[a],syncingAfterSeq:c}}}else p=this.beginYeaftHistoryLoad({agentId:r,sessionId:n,mode:"recent",preserveLoaded:!1,latestSeq:f?null:c});p&&(d.requestId=p.requestId),this.sendWsMessage(d)}},async switchYeaftModel(e,t=null,s=void 0){if(!e||!this.currentAgent)return;let n=t||null;if(n){let r={model:e};return s!==void 0&&(r.modelEffort=s||null),await this.sessionCrudRequest("update_config",{sessionId:n,config:r},{agentId:Se(this,n)})}return this.sendWsMessage({type:"yeaft_model_switch",model:e,modelEffort:s||null,agentId:this.currentAgent}),null},setYeaftDebugSearch(e){this.yeaftDebugSearch=typeof e=="string"?e:"",this._yeaftDebugSearchTimer&&clearTimeout(this._yeaftDebugSearchTimer),this._yeaftDebugSearchTimer=setTimeout(()=>{this._yeaftDebugSearchTimer=null,this.yeaftDebugLoops=[],this.yeaftDebugTurnsById={},this.yeaftDebugTurnOrder=[],this.loadYeaftDebugHistory({limit:this.yeaftDebugSearch.trim()?Hu:Ra,dreamLimit:5,indexOnly:!0,search:this.yeaftDebugSearch})},250)},setYeaftDebugSessionFilter(e){e==null?this.yeaftDebugSessionFilter=null:this.yeaftDebugSessionFilter=String(e)},toggleSubAgentCardExpand(e){let t=this.yeaftSubAgentCards?.[e];t&&(this.yeaftSubAgentCards={...this.yeaftSubAgentCards,[e]:{...t,expanded:!t.expanded}})},loadSearchSettings(){return this.currentAgent?new Promise(e=>{this._searchPending||(this._searchPending={}),this._searchPending.load=e,this.sendWsMessage({type:"get_search_settings",agentId:this.currentAgent})}):(this.searchSettings={backend:"tavily",tavilyKeyConfigured:!1,tavilyKeyMasked:null,disableHtmlFallback:!1,loaded:!0},Promise.resolve(this.searchSettings))},updateSearchSettings(e){return this.currentAgent?new Promise(t=>{this._searchPending||(this._searchPending={}),this._searchPending.update=t,this.sendWsMessage({type:"update_search_settings",agentId:this.currentAgent,settings:e||{}})}):Promise.resolve({error:"no agent"})},loadTavilyUsage(){return this.currentAgent?(this.tavilyUsageLoading=!0,new Promise(e=>{this._searchPending||(this._searchPending={}),this._searchPending.usage=e,this.sendWsMessage({type:"get_tavily_usage",agentId:this.currentAgent})})):Promise.resolve(null)},loadYeaftMcpServers(){if(!this.currentAgent)return this.yeaftMcpServers=[],this.yeaftMcpRuntime={connected:!1,toolCount:0,perServer:[]},Promise.resolve({servers:[],runtime:this.yeaftMcpRuntime});this.yeaftMcpLoading=!0;let e=`mcp-list-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return new Promise(t=>{this._mcpPending||(this._mcpPending={}),this._mcpPending[e]=t,this.sendWsMessage({type:"yeaft_mcp_list",agentId:this.currentAgent,requestId:e})})},addYeaftMcpServer(e){if(!this.currentAgent)return Promise.resolve({error:"no agent"});this.yeaftMcpLoading=!0;let t=`mcp-add-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return new Promise(s=>{this._mcpPending||(this._mcpPending={}),this._mcpPending[t]=s,this.sendWsMessage({type:"yeaft_mcp_add",agentId:this.currentAgent,requestId:t,server:e||{}})})},removeYeaftMcpServer(e){if(!this.currentAgent)return Promise.resolve({error:"no agent"});this.yeaftMcpLoading=!0;let t=`mcp-rem-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return new Promise(s=>{this._mcpPending||(this._mcpPending={}),this._mcpPending[t]=s,this.sendWsMessage({type:"yeaft_mcp_remove",agentId:this.currentAgent,requestId:t,name:e})})},reloadYeaftMcpServer(e){if(!this.currentAgent)return Promise.resolve({error:"no agent"});this.yeaftMcpLoading=!0;let t=`mcp-rel-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return new Promise(s=>{this._mcpPending||(this._mcpPending={}),this._mcpPending[t]=s,this.sendWsMessage({type:"yeaft_mcp_reload",agentId:this.currentAgent,requestId:t,name:e||null})})},clearYeaftMessages(){let e=this.yeaftConversationId;e&&(Ae(this,e),delete this.messagesMap[e],delete this.processingConversations[e],delete this.executionStatusMap[e],delete this.refreshingSessionMap[e],this._closedAt&&delete this._closedAt[e],this._turnCompletedConvs?.delete(e)),this.yeaftConversationId=this.currentAgent?`yeaft-local-${this.currentAgent}-${Date.now()}`:`yeaft-local-${Date.now()}`,this.currentAgent&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[this.currentAgent]:this.yeaftConversationId}),this.messagesMap[this.yeaftConversationId]=[],this.activeConversations=[this.yeaftConversationId],this.yeaftSessionReady=!1,this.yeaftModel=null,this.yeaftAvailableModels=[],this.yeaftStatus=null,this._yeaftAskTerminalEvents={},this.yeaftDebugLoops=[],this.yeaftDebugTurnsById={},this.yeaftDebugTurnOrder=[],this.yeaftDebugHistoryLoading=!1,this.yeaftDebugHistoryError=null,this.yeaftDebugHistoryFetchedAt=0,this.yeaftDebugSearch="",this.yeaftDebugSessionFilter=null,this._yeaftDebugSearchTimer&&(clearTimeout(this._yeaftDebugSearchTimer),this._yeaftDebugSearchTimer=null),this._fetchYeaftDebugHistoryTimer&&(clearTimeout(this._fetchYeaftDebugHistoryTimer),this._fetchYeaftDebugHistoryTimer=null),this._yeaftDebugHistoryInFlightKey=null,this._yeaftDebugHistoryLatestListRequestId=null,this._yeaftDebugHistoryLatestDetailRequestId=null,this.yeaftReflectionCards={},this.yeaftSubAgentCards={},this.yeaftDreamLatest={},this.yeaftDreamEvents={},this.vpStatuses={},this.currentAgent&&this.sendWsMessage({type:"yeaft_reset",agentId:this.currentAgent})},togglePaneRightPanel(e,t=null){if(t&&this.isSplitMode){let s=this.panels.find(n=>n.id===t);if(s){s.activeRightPanel=s.activeRightPanel===e?null:e;return}}this.activeRightPanel=this.activeRightPanel===e?null:e},getPaneRightPanel(e){if(e&&this.isSplitMode){let t=this.panels.find(s=>s.id===e);if(t)return t.activeRightPanel}return this.activeRightPanel},setPaneRightPanel(e,t){if(e&&this.isSplitMode){let s=this.panels.find(n=>n.id===e);if(s){s.activeRightPanel=t;return}}this.activeRightPanel=t},applySessionCatalogSnapshot(e,t=null,s=null){let n=r=>{let i=new Set;return(Array.isArray(r)?r:[]).filter(o=>!o?.catalogKey||i.has(o.catalogKey)?!1:(i.add(o.catalogKey),!0)).map(o=>({...o}))};if(this.sessionCatalog=n(e),Array.isArray(s)&&(this.hiddenSessionCatalog=n(s)),Array.isArray(t)){this.sessionProjects=t.filter(i=>i?.id).map(i=>({...i,members:Array.isArray(i.members)?i.members.filter(o=>o?.agentId&&o?.sessionId):i.agentId?(i.sessionIds||[]).map(o=>({agentId:i.agentId,sessionId:o})):[]}));let r=new Map;for(let i of this.sessionProjects)for(let o of i.members)r.set(`${o.agentId}${o.sessionId}`,i.id);this.sessionCatalog=this.sessionCatalog.map(i=>i.runtimeProvider==="yeaft"?{...i,projectId:r.get(`${i.routeRef?.agentId}${i.routeRef?.sessionId}`)||null}:i)}this.sessionCatalogLoaded=!0},mutateProject(e,t={},s=null){let n=s||t.agentId||this.currentAgent||null;if(e==="move_session"&&!n)return Promise.resolve({ok:!1,error:{code:"missing_agent"}});let r=`project_${crypto.randomUUID()}`;return new Promise(i=>{let o=setTimeout(()=>{delete this.projectMutationRequests[r],i({ok:!1,error:{code:"timeout"}})},1e4);this.projectMutationRequests[r]={connectionGeneration:Number(this.chatHistoryConnectionGeneration||0),catalogOrder:Array.isArray(t.catalogOrder)?t.catalogOrder:null,resolve:l=>{clearTimeout(o),i(l)}},this.sendWsMessage({type:"yeaft_project_mutation",...n?{agentId:n,targetAgentId:n}:{},requestId:r,op:e,...t})||(clearTimeout(o),delete this.projectMutationRequests[r],i({ok:!1,error:{code:"send_failed"}}))})},applyLegacyProjectSnapshot(e,t){if(!t||!Array.isArray(e))return;let s=this.sessionProjects.filter(r=>r.legacyAgentId!==t),n=e.filter(r=>r?.id).map(r=>({...r,id:`${t}${r.id}`,legacyProjectId:r.id,legacyAgentId:t,members:(r.sessionIds||[]).map(i=>({agentId:t,sessionId:i}))}));this.applySessionCatalogSnapshot(this.sessionCatalog,[...s,...n])},finishLegacyProjectMutation(e,t){if(!e?.requestId)return!1;let s=this.projectMutationRequests[e.requestId]||null;return!s||s.connectionGeneration!==Number(this.chatHistoryConnectionGeneration||0)?!1:(delete this.projectMutationRequests[e.requestId],e.ok&&Array.isArray(e.projects)&&t&&this.applyLegacyProjectSnapshot(e.projects,t),s.resolve(e),!0)},finishProjectMutation(e){if(!e?.requestId)return!1;let t=this.projectMutationRequests[e.requestId]||null;if(!t||t.connectionGeneration!==Number(this.chatHistoryConnectionGeneration||0))return!1;if(delete this.projectMutationRequests[e.requestId],e.ok){if(Array.isArray(t.catalogOrder)){let s=new Map(this.sessionCatalog.map(r=>[r.catalogKey,r])),n=t.catalogOrder.map((r,i)=>{let o=s.get(r?.catalogKey);return o?{...o,sortRank:i}:null}).filter(Boolean);n.length===this.sessionCatalog.length&&(this.sessionCatalog=n,Du(n))}Array.isArray(e.projects)&&this.applySessionCatalogSnapshot(this.sessionCatalog,e.projects)}return t.resolve(e),!0},toggleCatalogSessionPin(e){if(!e?.catalogKey||!e?.routeRef||Object.keys(this.sessionCatalogMutationRequests).length>0)return!1;let t=`session_ui_${crypto.randomUUID()}`,s=_n(this,t),n=!e.pinned;return e.pinned=n,this.sendWsMessage({type:"set_session_ui_metadata",requestId:t,catalogKey:e.catalogKey,routeRef:e.routeRef,pinned:n,sortRank:Number.isFinite(e.sortRank)?e.sortRank:null})?!0:(this.sessionCatalog=s,delete this.sessionCatalogMutationRequests[t],!1)},hideCatalogSession(e){if(!e?.catalogKey||!e?.routeRef||Object.keys(this.sessionCatalogMutationRequests).length>0)return!1;let t=`session_hide_${crypto.randomUUID()}`,s=_n(this,t);return this.sessionCatalog=this.sessionCatalog.filter(r=>r.catalogKey!==e.catalogKey),this.hiddenSessionCatalog=[...(this.hiddenSessionCatalog||[]).filter(r=>r.catalogKey!==e.catalogKey),{...e,hidden:!0}],this.sendWsMessage({type:"set_session_ui_metadata",requestId:t,catalogKey:e.catalogKey,routeRef:e.routeRef,hidden:!0,...Number.isFinite(e.sortRank)?{sortRank:e.sortRank}:{}})?!0:(this.sessionCatalog=s,this.hiddenSessionCatalog=Array.isArray(this.sessionCatalogMutationRequests[t]?.previousHiddenCatalog)?this.sessionCatalogMutationRequests[t].previousHiddenCatalog:[],delete this.sessionCatalogMutationRequests[t],!1)},restoreCatalogSession(e){if(!e?.catalogKey||!e?.routeRef||Object.keys(this.sessionCatalogMutationRequests).length>0)return!1;let t=`session_restore_${crypto.randomUUID()}`,s=_n(this,t);return this.hiddenSessionCatalog=(this.hiddenSessionCatalog||[]).filter(r=>r.catalogKey!==e.catalogKey),this.sessionCatalog=this.sessionCatalog.some(r=>r.catalogKey===e.catalogKey)?this.sessionCatalog:[...this.sessionCatalog,{...e,hidden:!1}],this.sendWsMessage({type:"set_session_ui_metadata",requestId:t,catalogKey:e.catalogKey,routeRef:e.routeRef,hidden:!1,...Number.isFinite(e.sortRank)?{sortRank:e.sortRank}:{}})?!0:(this.sessionCatalog=s,this.hiddenSessionCatalog=Array.isArray(this.sessionCatalogMutationRequests[t]?.previousHiddenCatalog)?this.sessionCatalogMutationRequests[t].previousHiddenCatalog:[],delete this.sessionCatalogMutationRequests[t],!1)},renameCatalogSession({row:e,title:t}={}){if(!e?.routeRef||!t)return!1;let{runtimeProvider:s,agentId:n,sessionId:r}=e.routeRef;if(s==="yeaft")this.sessionCrudRequest("rename",{sessionId:r,name:t},{agentId:n});else if(s==="claude-code"||s==="copilot")this.renameChatSession(r,t,n);else return!1;return!0},reorderCatalogSessions(e){if(!Array.isArray(e)||e.length===0||Object.keys(this.sessionCatalogMutationRequests).length>0)return!1;let t=`session_order_${crypto.randomUUID()}`,s=_n(this,t);return this.sessionCatalog=e.map((r,i)=>({...r,sortRank:i})),this.sendWsMessage({type:"reorder_session_catalog",requestId:t,sessions:this.sessionCatalog.map((r,i)=>({catalogKey:r.catalogKey,routeRef:r.routeRef,pinned:!!r.pinned,sortRank:i}))})?!0:(this.sessionCatalog=s,delete this.sessionCatalogMutationRequests[t],!1)},finishSessionCatalogMutation(e){if(!tc(this,e))return!1;if(e?.ok===!0&&e?.type==="session_ui_metadata_updated"){let s=n=>{n&&(n.pinned=e.pinned===!0,Object.prototype.hasOwnProperty.call(e,"sortRank")&&(n.sortRank=Number.isFinite(e.sortRank)?e.sortRank:null))};s(this.sessionCatalog.find(n=>n.catalogKey===e.catalogKey)),s(this.hiddenSessionCatalog.find(n=>n.catalogKey===e.catalogKey))}return e?.ok===!0&&e?.type==="session_catalog_reorder_result"&&Du(this.sessionCatalog),!0},openCatalogSession(e){if(!e?.catalogKey||!e.routeRef)return!1;let{runtimeProvider:t,agentId:s,sessionId:n}=e.routeRef;if(this.activeCatalogKey=e.catalogKey,t==="yeaft"){let r=this.isSessionHistorySyncing(e.routeRef);return this.enterYeaft(s,{deferBootstrap:!0}),this.setActiveSessionFilter(n,{agentId:s,force:!1}),r||this.reloadYeaftMessages(),!0}return t!=="claude-code"&&t!=="copilot"?!1:(this.currentView==="yeaft"&&this.leaveYeaft(),this.selectConversation(n,s,{refresh:!0}),!0)},syncChatConversationHistory(e){if(!e)return null;let t=zt(e);if(this.chatHistoryRequests[t]?.loading)return this.chatHistoryRequests[t].requestId;let s=ps(this.messagesMap[e]);return this.requestChatHistory(e,s===null?{mode:"recent",turns:5}:{mode:"delta",afterMessageId:s})},requestChatHistory(e,{mode:t="recent",turns:s=null,beforeId:n=null,afterMessageId:r=null}={}){if(!e)return null;let i=zt(e);if(this.chatHistoryRequestIdSupported!==!0&&this.chatHistoryRequests[i]?.loading)return null;let o=n??r??null,a=this.beginChatHistoryRequest(e,t,o);return this.sendWsMessage({type:"sync_messages",conversationId:e,...s!=null?{turns:s}:{},...n!=null?{beforeId:n}:{},...r!=null?{afterMessageId:r}:{},requestId:a})?(this.sessionHistorySyncRefreshToken+=1,setTimeout(()=>{To(this,i,a,"history_load_timeout")&&(this.sessionHistorySyncRefreshToken+=1)},1e4),a):(To(this,i,a,"send_failed"),this.sessionHistorySyncRefreshToken+=1,null)},beginChatHistoryRequest(e,t="recent",s=null){return sc(this,e,t,s)},isCurrentChatHistoryResponse(e){if(!e?.conversationId||!e?.requestId||!e?.catalogKey)return!1;let t=zt(e.conversationId);if(e.catalogKey!==t)return!1;let s=this.chatHistoryRequests[t];return!!s&&s.loading===!0&&s.requestId===e.requestId&&Number(s.connectionGeneration||0)===Number(this.chatHistoryConnectionGeneration||0)},finishChatHistoryRequest(e){if(!this.isCurrentChatHistoryResponse(e))return!1;let t=this.chatHistoryRequests[e.catalogKey];return this.chatHistoryRequests[e.catalogKey]={...t,loading:!1},this.sessionHistorySyncRefreshToken+=1,!0},isRefreshingSession(e){return e?!!this.refreshingSessionMap[e]:this.refreshingSession},setRefreshingSession(e,t){e&&(this.refreshingSessionMap[e]=t),this.refreshingSession=t},enterBtwMode(){this.btwMode=!0,this.btwMessages=[],this.btwLoading=!1,this.btwSessionId=null},sendBtwQuestion(e){this.currentConversation&&(this.btwMessages.push({role:"user",content:e}),this.btwMessages.push({role:"assistant",content:""}),this.btwLoading=!0,this.sendWsMessage({type:"btw_question",conversationId:this.currentConversation,question:e,btwSessionId:this.btwSessionId}))},closeBtw(){this.btwMode=!1,this.btwMessages=[],this.btwLoading=!1,this.btwSessionId=null},appendBtwDelta(e){let t=this.btwMessages[this.btwMessages.length-1];t&&t.role==="assistant"&&(t.content+=e)},addSubagent(e,t){this.subagents[e]||(this.subagents[e]={}),this.subagents[e][t.id]={id:t.id,slug:t.slug||t.id,type:t.type||"Task",description:t.description||"",parentToolUseId:t.parentToolUseId||null,status:"running",startTime:Date.now(),messages:[],toolCallCount:0},e===this.currentConversation&&this.activeRightPanel!=="subagents"&&(this.activeRightPanel="subagents")},appendSubagentMessage(e,t,s){let n=this.subagents[e];if(!n||!n[t])return;let r=n[t];if(s?.type==="tool"){r.toolCallCount=Number(r.toolCallCount||0)+1;return}s?.type==="text"&&r.messages.push(s)},completeSubagent(e,t){let s=this.subagents[e];!s||!s[t]||(s[t].status="completed")},sendWsMessage(e){return wc(this,e)},parseWsMessage(e){return kc(this,e)},connect(){Sc(this)},ensureConnected(){return Ln(this)},scheduleReconnect(){Ic(this)},manualReconnect(){Cc(this)},startHeartbeat(){Ac(this)},stopHeartbeat(){xc(this)},setupVisibilityHandler(){Tc(this)},handleMessage(e){Cd(this,e)},getOrCreateExecutionStatus(e){return oa(this,e)},handleAssistantOutputFrame(e,t,s=null){fd(this,e,t,s)},handleClaudeOutput(e,t){this.handleAssistantOutputFrame(e,t,null)},addMessageToConversation(e,t){return Fr(this,e,t)},appendToAssistantMessageForConversation(e,t,s){$c(this,e,t,s)},finishStreamingForConversation(e,t){Vc(this,e,t)},sweepStaleStreamingForConversation(e){Hc(this,e)},appendToAssistantMessage(e){this.appendToAssistantMessageForConversation(this.currentConversation,e)},finishStreaming(){this.finishStreamingForConversation(this.currentConversation)},addMessage(e){this.addMessageToConversation(this.currentConversation,e)},loadHistoryMessages(e){Oc(this,e)},formatDbMessage(e){return Fo(e)},formatDbMessageForHistoryHydration(e){return Nc(e)},selectAgent(e){return Ed(this,e)},createConversation(e,t=null,s=null,n=void 0){Dd(this,e,t,s,n)},resumeConversation(e,t,s=null,n=null,r=null){Ld(this,e,t,s,n,r)},selectConversation(e,t,s={}){$d(this,e,t,s)},updateConversationSettings(e,t){pa(this,e,t)},toggleConversationMcp(e,t){Vd(this,e,t)},deleteConversation(e,t){Od(this,e,t)},closeSession(e,t){Hd(this,e,t)},appendColumn(e){Bd(this,e)},removeColumn(e){Wd(this,e)},sendMessageToConversation(e,t,s=[],n={}){jd(this,e,t,s,n)},cancelExecutionForConversation(e){Ud(this,e)},addPanel(){if(this.panels.length>=3)return;let e=(t,s)=>({id:t,conversationId:s,activeRightPanel:null});if(this.panels.length===0){let t=localStorage.getItem("splitPanesSaved");if(t){try{let s=JSON.parse(t);if(Array.isArray(s)&&s.length>=2){let n=new Set(this.conversations.map(i=>i.id)),r=s.filter(i=>i&&typeof i.id=="string").map(i=>({...e(i.id,null),conversationId:i.conversationId&&n.has(i.conversationId)?i.conversationId:null}));if(r.length>=2){this.panels=r,this.activePanelId=r[0].id;for(let i of r)i.conversationId&&!this.activeConversations.includes(i.conversationId)&&this.activeConversations.push(i.conversationId),i.conversationId&&!this.messagesMap[i.conversationId]&&(this.messagesMap[i.conversationId]=[],this.requestChatHistory(i.conversationId,{mode:"recent",turns:5}));localStorage.removeItem("splitPanesSaved"),this.saveOpenSessions();return}}}catch{}localStorage.removeItem("splitPanesSaved")}this.panels=[e("panel-0",this.currentConversation),e("panel-1",null)],this.activePanelId="panel-0"}else{let t="panel-"+Date.now();this.panels.push(e(t,null))}this.saveOpenSessions()},removePanel(e){let t=this.panels.findIndex(s=>s.id===e);if(!(t<0)){if(this.panels.splice(t,1),this.panels.length<=1){let s=this.panels[0];s?.conversationId&&(this.activeConversations=[s.conversationId]),this.panels=[],this.activePanelId=null}else this.activePanelId===e&&(this.activePanelId=this.panels[0]?.id||null);this.saveOpenSessions()}},setPanelConversation(e,t,{refresh:s=!1}={}){let n=this.panels.find(i=>i.id===e);if(!n)return;let r=n.conversationId===t;n.conversationId=t,t&&!this.activeConversations.includes(t)&&this.activeConversations.push(t),t&&!this.messagesMap[t]?(this.messagesMap[t]=[],this.syncChatConversationHistory(t)):t&&(s||!r)&&this.syncChatConversationHistory(t),this.saveOpenSessions()},setActivePanel(e){this.activePanelId=e},splitToPanel(e){if(!e)return;let t=(s,n)=>({id:s,conversationId:n,activeRightPanel:null});if(this.panels.length===0)this.panels=[t("panel-0",this.currentConversation),t("panel-"+Date.now(),e)],this.activePanelId=this.panels[1].id;else if(this.panels.length>=3)this.panels[this.panels.length-1].conversationId=e,this.activePanelId=this.panels[this.panels.length-1].id;else{let s="panel-"+Date.now();this.panels.push(t(s,e)),this.activePanelId=s}this.activeConversations.includes(e)||this.activeConversations.push(e),this.messagesMap[e]||(this.messagesMap[e]=[],this.requestChatHistory(e,{mode:"recent",turns:5})),this.saveOpenSessions()},isInAnyPanel(e){return this.panels.some(t=>t.conversationId===e)},setSessionPinned(e,t,s={}){if(!e)return;let n=s&&s.agentId?s.agentId:null,r=n?!!Zt()?.sessionById?.(e,n)?.pinned:this.pinnedSessions.includes(e);if(t&&!r)this.pinnedSessions.unshift(e);else if(!t&&r){let i=this.pinnedSessions.indexOf(e);i>=0&&this.pinnedSessions.splice(i,1)}try{localStorage.setItem("pinned-sessions",JSON.stringify(this.pinnedSessions))}catch{}try{let i=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore(),o=Se(this,e,n);i&&typeof i.applyPinState=="function"&&i.applyPinState(e,!!t,o)}catch{}},togglePin(e,t={}){let s=t&&t.agentId?t.agentId:null,n=s?Zt()?.sessionById?.(e,s):null,r=t&&Object.prototype.hasOwnProperty.call(t,"pinned"),o=!(n?!!n.pinned:r?!!t.pinned:this.pinnedSessions.includes(e));this.setSessionPinned(e,o,{agentId:s});let a={type:o?"pin_session":"unpin_session",conversationId:e};t&&t.sessionKind==="yeaft"&&(a.sessionKind="yeaft",t.agentId&&(a.agentId=t.agentId),t.sessionName&&(a.sessionName=t.sessionName),t.workDir&&(a.workDir=t.workDir)),this.sendWsMessage(a)},isSessionPinned(e){return this.pinnedSessions.includes(e)},applyServerPinSnapshot(e,t,s){if(!Array.isArray(this.pinnedSessions))return;let n=new Set(this.pinnedSessions),r=[];for(let i of t)n.has(i)||r.push(i);if(r.length>0&&(this.pinnedSessions=[...r,...this.pinnedSessions]),e){let i=this.pinnedSessions.filter(o=>s(o)?t.has(o):!0);i.length!==this.pinnedSessions.length&&(this.pinnedSessions=i)}try{localStorage.setItem("pinned-sessions",JSON.stringify(this.pinnedSessions))}catch{}},clearYeaftSessionProcessingIfIdle(e,{agentId:t=null,ignoreStatuses:s=!1}={}){if(!e)return;let n=t||Se(this,e);if(Object.values(this.activeVpTurns||{}).some(a=>et(a,e,n))||!s&&Object.values(this.vpStatuses||{}).some(l=>et(l,e,n)&&tr.has(l?.state)))return;let i=mt(n,e),o={...this.yeaftProcessingSessions||{}};i&&delete o[i],ni(this,e,n)&&delete o[e],this.yeaftProcessingSessions=o},sendMessage(e,t=[],s={}){Fd(this,e,t,s)},cancelExecution(){Nd(this)},cancelYeaft(){if(!this.currentAgent)return;this.sendWsMessage({type:"yeaft_abort_all",agentId:this.currentAgent});let e=this.yeaftConversationIdsByAgent?.[this.currentAgent]||this.yeaftConversationId;e&&delete this.processingConversations[e],Tu(this,this.currentAgent)},cancelYeaftSession(e){let t=Se(this,e);!t||!e||(this.sendWsMessage({type:"yeaft_abort_all",agentId:t,sessionId:e}),this.activeVpTurns=Object.fromEntries(Object.entries(this.activeVpTurns||{}).filter(([,s])=>!et(s,e,t))),this.stoppingVpTurnIds=Object.fromEntries(Object.entries(this.stoppingVpTurnIds||{}).filter(([s])=>this.activeVpTurns?.[s])),this.vpStatuses=Object.fromEntries(Object.entries(this.vpStatuses||{}).filter(([,s])=>!et(s,e,t))),this.clearYeaftSessionProcessingIfIdle(e,{agentId:t,ignoreStatuses:!0}))},cancelVpTurn(e,{sessionId:t=null,vpId:s=null}={}){let n=Se(this,t);if(!n||!e)return;let r=Qs(this,n,e);this.stoppingVpTurnIds={...this.stoppingVpTurnIds,[r]:Date.now()};let i={type:"yeaft_abort_turn",agentId:n,turnId:e};t&&(i.sessionId=t),s&&(i.vpId=s),this.sendWsMessage(i)},cancelVpTurnForSession(e,t=null){if(!e)return!1;let s=t||this.yeaftActiveSessionFilter||null;if(!s)return!1;let n=Se(this,s);if(!n)return!1;let r=this.activeVpTurns||{},i=null,o=-1/0;for(let[a,l]of Object.entries(r)){if(!l||l.vpId!==e||!et(l,s,n))continue;let c=typeof l.startedAt=="number"?l.startedAt:0;c>=o&&(o=c,i=a)}if(!i){let a=this.vpStatuses?.[ei(n,s,e)]||null;a?.turnId&&!["idle","offline"].includes(a.state)&&(i=a.turnId)}if(i){let a=r[i]?.turnId||i;return this.cancelVpTurn(a,{sessionId:s,vpId:e}),!0}return this.sendWsMessage({type:"yeaft_abort_turn",agentId:n,sessionId:s,vpId:e}),!0},answerUserQuestion(e,t,s){qd(this,e,t,s)},refreshAgents(){Kd(this)},refreshConversation(){zd(this)},restartAgent(e){Yd(this,e)},upgradeAgent(e){Gd(this,e)},loadMoreMessages(){if(this.currentView==="yeaft"||this.loadingMoreMessages||!this.hasMoreMessages||!this.currentConversation)return;this.loadingMoreMessages=!0;let e=this._loadMoreGeneration=(this._loadMoreGeneration||0)+1,s=(this.messagesMap[this.currentConversation]||[]).find(i=>i.dbMessageId),n=this.currentConversation,r=s?.dbMessageId??null;this.requestChatHistory(n,{mode:"older",turns:5,beforeId:r}),setTimeout(()=>{this._loadMoreGeneration===e&&this.loadingMoreMessages&&this.currentConversation===n&&(this.loadingMoreMessages=!1)},1e4)},reloadYeaftMessages(){if(this.currentView!=="yeaft")return!1;let e=Is(this),t=Se(this,e);if(!t)return!1;let s=ke(t,e),n=this.yeaftConversationId,r=this.yeaftSessionHistoryState?.[s];if(r?.loading)return r.requestId||!1;let i=this.beginYeaftHistoryLoad({agentId:t,sessionId:e,mode:"recent",preserveLoaded:!1});if(!i)return!1;let o=gs();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[s]:o};let a={type:"yeaft_load_history",agentId:t,limit:ti,sessionId:e,requestId:i.requestId,perfTraceId:o};return Ge(this,{traceId:o,phase:"history.request_send",agentId:t,sessionId:e,messageType:a.type,bytes:JSON.stringify(a).length,detail:{mode:"manual-reload",limit:ti}}),this.sendWsMessage(a)?!0:(Go(this,{agentId:t,sessionId:e,requestId:i.requestId,error:"history_load_send_failed"})&&(this.sessionHistorySyncRefreshToken+=1),!1)},loadMoreYeaftHistory(e=Jn()){if(this.currentView!=="yeaft"||this.yeaftLoadingMoreHistory||!this.yeaftHasMoreHistory)return;let t=Is(this),s=Se(this,t);if(!s)return;let n=Math.min(50,Math.max(1,Number.isFinite(e)?Math.floor(e):Jn())),r=ke(s,t),i=this.yeaftHistoryCacheState?.[r]?.ranges||[],o=this.yeaftSessionHistoryState?.[r]||{},a=Number(this.yeaftHistoryCacheState?.[r]?.rangeEpoch)||0,l=Qc(o,i,a);if(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState||{},[r]:l.state},!l.request){this.syncActiveYeaftHistoryLoad();return}let c=this.beginYeaftHistoryLoad({agentId:s,sessionId:t,mode:"older",preserveLoaded:!0,latestSeq:this.yeaftSessionHistoryState[r]?.latestSeq??null});if(!c)return;let d=gs();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[r]:d};let u={type:"yeaft_load_more_history",agentId:s,sessionId:t,requestId:c.requestId,beforeSeq:l.request.beforeSeq,pageKind:l.request.kind,gapStopAtSeq:l.request.stopAtSeq,cacheEpoch:l.request.cacheEpoch,turns:n,perfTraceId:d};Ge(this,{traceId:d,phase:"history_more.request_send",agentId:s,sessionId:t,messageType:u.type,bytes:JSON.stringify(u).length,detail:{beforeSeq:u.beforeSeq,turns:u.turns,pageKind:l.request.kind,gapStopAtSeq:l.request.stopAtSeq}}),this.sendWsMessage(u)},checkPendingRecovery(){nc(this)},performRecovery(){rc(this)},dismissRecovery(){ic(this)},autoRestoreConversation(e){oc(this,e)},saveOpenSessions(){ds(this)},getLastSession(){return lc(this)},clearLastSession(){cc(this)},listHistorySessions(e){dc(this,e)},listFolders(){return uc(this)},listFoldersForAgent(e,t){return pc(this,e,t)},listModelsForAgent(e,t){return fc(this,e,t)},listHistorySessionsForAgent(e,t,s){gc(this,e,t,s)},async loadGlobalSessions(e=20){return mc(this,e)},async deleteGlobalSession(e){return hc(this,e)},findAgentForSession(e){return Po(this,e)},isSessionResumable(e){return vc(this,e)},_isRecentlyClosed(e){return fs(this,e)},_startProcessingWatchdog(e){Ns(this,e)},_resetProcessingWatchdog(e){Nr(this,e)},_stopProcessingWatchdog(e){Ae(this,e)},startRefreshTimeout(e){let t=e||this.currentConversation;t&&(this._refreshTimeouts||(this._refreshTimeouts={}),this._refreshTimeouts[t]&&clearTimeout(this._refreshTimeouts[t]),this._refreshTimeouts[t]=setTimeout(()=>{this.setRefreshingSession(t,!1),delete this._refreshTimeouts[t]},1e4))},toggleTheme(){this.theme=this.theme==="dark"?"light":"dark",this.themeFollowSystem=!1,localStorage.setItem("theme",this.theme),document.documentElement.setAttribute("data-theme",this.theme),document.documentElement.classList.toggle("light",this.theme==="light")},initTheme(){if(document.documentElement.setAttribute("data-theme",this.theme),document.documentElement.classList.toggle("light",this.theme==="light"),this.themeFollowSystem&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=s=>{this.themeFollowSystem&&(this.theme=s.matches?"dark":"light",document.documentElement.setAttribute("data-theme",this.theme),document.documentElement.classList.toggle("light",this.theme==="light"))};e.addEventListener?e.addEventListener("change",t):e.addListener&&e.addListener(t)}},loadModelsDevRegistry({forceRefresh:e=!1}={}){let t=this.modelsDevRegistry.loaded&&!this.modelsDevRegistry.error&&Date.now()-this.modelsDevRegistry.fetchedAt<36e5;if(!e&&t)return Promise.resolve(this.modelsDevRegistry);let s=this.currentAgent;if(!s)return Promise.resolve(this.modelsDevRegistry);if(this._modelsDevPending&&(!e||this._modelsDevPending.force))return new Promise(n=>this._modelsDevPending.resolvers.push(n));if(this._modelsDevPending){let n=this._modelsDevPending;this._modelsDevPending=null,n.timer&&clearTimeout(n.timer);for(let r of n.resolvers)r(this.modelsDevRegistry)}return new Promise(n=>{let r={resolvers:[n],force:e,timer:null};this._modelsDevPending=r;try{this.sendWsMessage({type:"get_models_dev_registry",agentId:s,forceRefresh:e})}catch{this._modelsDevPending===r&&(this._modelsDevPending=null),n(this.modelsDevRegistry);return}r.timer=setTimeout(()=>{if(this._modelsDevPending===r){this._modelsDevPending=null;for(let i of r.resolvers)i(this.modelsDevRegistry)}},2e4)})},changeLocale(e){if(this.locale=e,Rn(e),this.currentAgent)try{this.sendWsMessage({type:"update_llm_config",agentId:this.currentAgent,config:{language:e}})}catch{}},async fetchCustomExpertRoles(){let e=De();try{let t={};e.token&&(t.Authorization=`Bearer ${e.token}`);let s=await fetch("/api/expert-roles/custom",{headers:t});if(s.ok){let n=await s.json();this.customExpertRoles=n.roles||[]}}catch{}},async createCustomExpertRole(e){let t=De();try{let s={"Content-Type":"application/json"};t.token&&(s.Authorization=`Bearer ${t.token}`);let n=await fetch("/api/expert-roles/custom",{method:"POST",headers:s,body:JSON.stringify(e)});if(n.ok){let r=await n.json();return this.customExpertRoles.push(r.role),r.role}else{let r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to create custom expert role")}}catch(s){throw s}},async updateCustomExpertRole(e,t){let s=De();try{let n={"Content-Type":"application/json"};s.token&&(n.Authorization=`Bearer ${s.token}`);let r=await fetch(`/api/expert-roles/custom/${e}`,{method:"PUT",headers:n,body:JSON.stringify(t)});if(r.ok){let i=await r.json(),o=this.customExpertRoles.findIndex(a=>a.id===e);return o!==-1&&(this.customExpertRoles[o]=i.role),i.role}else{let i=await r.json().catch(()=>({}));throw new Error(i.error||"Failed to update custom expert role")}}catch(n){throw n}},async deleteCustomExpertRole(e){let t=De();try{let s={};t.token&&(s.Authorization=`Bearer ${t.token}`);let n=await fetch(`/api/expert-roles/custom/${e}`,{method:"DELETE",headers:s});if(n.ok)return this.customExpertRoles=this.customExpertRoles.filter(r=>r.id!==e),!0;{let r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to delete custom expert role")}}catch(s){throw s}},toggleWorkbench(){this.workbenchExpanded=!this.workbenchExpanded,this.workbenchExpanded||(this.workbenchMaximized=!1)},toggleSidebar(){this.sidebarCollapsed=!this.sidebarCollapsed},toggleSessionSidebar(){this.sessionSidebarOpen=!this.sessionSidebarOpen},closeSessionSidebar(){this.sessionSidebarOpen=!1},toggleWorkbenchMaximized(){this.workbenchMaximized=!this.workbenchMaximized},renameChatSession(e,t,s=null){let n=t&&t.trim()?t.trim():"";n?this.customConversationTitles[e]=n:delete this.customConversationTitles[e],this.sendWsMessage({type:"update_conversation_settings",conversationId:e,...s?{agentId:s}:{},title:n})},openFileInExplorer(e){this.currentConversation&&(this.workbenchExpanded=!0,window.dispatchEvent(new CustomEvent("open-file-in-explorer",{detail:{filePath:e,conversationId:this.currentConversation}})))},logout(){De().logout(),this.authenticated=!1,this.sessionKey=null,this.agents=[],this.currentAgent=null,this.currentAgentInfo=null,this.yeaftStatusByAgent={},this._yeaftRetiredCatalogEpochsByAgent={},this.conversations=[],this.activeConversations=[],this.messagesMap={},this.conversationTitles={},this.customConversationTitles={},this.processingConversations={},this.executionStatusMap={},this.workbenchExpanded=!1,this.subagents={},this.activeSubagentId=null,this.activeRightPanel=null,this.pinnedSessions=[],this.clearWorkCenterBrowserState(),this.ws&&this.ws.close()}}})});function Ea(e,t){!e||typeof e.handleYeaftOutput!="function"||!t||e.handleYeaftOutput({event:t})}function Hv(e){let t=String(e||""),s=2166136261;for(let n=0;n<t.length;n++)s^=t.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s>>>0}function La(e){if(!e)return Jt[0];let t=String(e).toLowerCase();return Vv[t]||Jt[Hv(t)%Jt.length]}function Ov(e){return La(e).background}function Fv(e){return La(e).foreground}function Da(){let e=typeof window<"u"&&window.Pinia&&window.Pinia.useChatStore?window.Pinia.useChatStore():null;return e&&typeof e.locale=="string"?e.locale:typeof localStorage<"u"&&localStorage.getItem("locale")||""}function Nv(e,t=""){return e?String(t||"").startsWith("zh")?e.descriptionZh||e.roleZh||e.description||e.role||"":e.description||e.role||e.descriptionZh||e.roleZh||"":""}var $v,Jt,Vv,Hk,Tt,Xs=F(()=>{({defineStore:$v}=Pinia);Jt=[{key:"rat",label:"Rat",glyph:"R",background:"var(--vp-avatar-rat-bg)",foreground:"var(--vp-avatar-rat-fg)"},{key:"ox",label:"Ox",glyph:"O",background:"var(--vp-avatar-ox-bg)",foreground:"var(--vp-avatar-ox-fg)"},{key:"tiger",label:"Tiger",glyph:"T",background:"var(--vp-avatar-tiger-bg)",foreground:"var(--vp-avatar-tiger-fg)"},{key:"rabbit",label:"Rabbit",glyph:"B",background:"var(--vp-avatar-rabbit-bg)",foreground:"var(--vp-avatar-rabbit-fg)"},{key:"dragon",label:"Dragon",glyph:"D",background:"var(--vp-avatar-dragon-bg)",foreground:"var(--vp-avatar-dragon-fg)"},{key:"snake",label:"Snake",glyph:"S",background:"var(--vp-avatar-snake-bg)",foreground:"var(--vp-avatar-snake-fg)"},{key:"horse",label:"Horse",glyph:"H",background:"var(--vp-avatar-horse-bg)",foreground:"var(--vp-avatar-horse-fg)"},{key:"goat",label:"Goat",glyph:"G",background:"var(--vp-avatar-goat-bg)",foreground:"var(--vp-avatar-goat-fg)"},{key:"monkey",label:"Monkey",glyph:"M",background:"var(--vp-avatar-monkey-bg)",foreground:"var(--vp-avatar-monkey-fg)"},{key:"rooster",label:"Rooster",glyph:"K",background:"var(--vp-avatar-rooster-bg)",foreground:"var(--vp-avatar-rooster-fg)"},{key:"dog",label:"Dog",glyph:"D",background:"var(--vp-avatar-dog-bg)",foreground:"var(--vp-avatar-dog-fg)"},{key:"pig",label:"Pig",glyph:"P",background:"var(--vp-avatar-pig-bg)",foreground:"var(--vp-avatar-pig-fg)"}],Vv=Object.freeze({steve:Jt[8],ada:Jt[3],linus:Jt[0],martin:Jt[4]}),Hk=Jt.map(e=>e.background);Tt=$v("vp",{state:()=>({vps:{},vpOrder:[],emptyLibrary:!1,lastSnapshotAt:0,snapshotStatus:"idle",snapshotAgentId:null,snapshotRequestId:null,snapshotError:"",lastVpSnapshotAgentId:null,lastChange:null,dreamStatus:{},groupDreamStatus:{}}),getters:{vpList(e){return e.vpOrder.map(t=>e.vps[t]).filter(Boolean)},vpCount(e){return e.vpOrder.length},vpById:e=>t=>e.vps[t]||null,vpLabel:e=>t=>{let s=e.vps[t];return s?Da().startsWith("zh")&&s.displayNameZh?s.displayNameZh:s.displayName||s.vpId||t:t},vpDescription:e=>t=>Nv(e.vps[t],Da()),vpInitial:e=>t=>{let s=e.vps[t],n=Da().startsWith("zh"),r=s&&(s.avatar||n&&s.displayNameZh||s.displayName||s.vpId)||t||"?";return String(r).charAt(0).toUpperCase()||"?"},vpColor:e=>t=>{let s=e.vps[t];return s&&s.color?s.color:Ov(t)},vpTextColor:()=>e=>Fv(e),vpAvatarMotif:()=>e=>La(e),dreamStatusFor:e=>t=>e.dreamStatus[t]||{status:"idle",lastRunAt:null,lastResult:null,lastError:null},groupDreamStatusFor:e=>t=>e.groupDreamStatus[t]||{status:"idle",lastRunAt:null,lastResult:null,lastError:null}},actions:{applySnapshot(e,t=null,s=null){let n=this.snapshotAgentId||null;if(n&&t&&t!==n||s&&this.snapshotRequestId&&s!==this.snapshotRequestId)return!1;let r=e&&Array.isArray(e.vps)?e.vps:[];return this._setActiveSnapshot({vps:r,emptyLibrary:!!(e&&e.emptyLibrary),agentId:t||n||null,requestId:s||this.snapshotRequestId||null,receivedAt:Date.now()}),!0},beginSnapshot(e,t){this.vps={},this.vpOrder=[],this.emptyLibrary=!1,this.lastVpSnapshotAgentId=null,this.snapshotStatus="loading",this.snapshotAgentId=e||null,this.snapshotRequestId=t||null,this.snapshotError=""},failSnapshot(e,t,s=""){return!this.snapshotRequestId||!t||t!==this.snapshotRequestId||e&&this.snapshotAgentId&&e!==this.snapshotAgentId?!1:(this.snapshotStatus="error",this.snapshotAgentId=e||this.snapshotAgentId||null,this.snapshotRequestId=t||this.snapshotRequestId||null,this.snapshotError=String(s||"VP library request failed"),!0)},_setActiveSnapshot({vps:e,emptyLibrary:t,agentId:s,requestId:n,receivedAt:r}){this.vps={},this.vpOrder=[];for(let i of e||[])this._upsertInternal(i);this.emptyLibrary=!!t,this.lastSnapshotAt=r||Date.now(),this.lastVpSnapshotAgentId=s||null,this.snapshotStatus="ready",this.snapshotAgentId=s||null,this.snapshotRequestId=n||null,this.snapshotError=""},upsert(e,t=null,s=null){return s&&this.snapshotAgentId&&s!==this.snapshotAgentId?!1:(this._upsertInternal(e),e&&e.vpId&&(this.lastChange={vpId:e.vpId,kind:"updated",reason:t||null,at:Date.now()}),!0)},remove(e,t=null,s=null){return s&&this.snapshotAgentId&&s!==this.snapshotAgentId||!e?!1:(delete this.vps[e],this.vpOrder=this.vpOrder.filter(n=>n!==e),this.lastChange={vpId:e,kind:"removed",reason:t||"file.removed",at:Date.now()},!0)},_upsertInternal(e){if(!e||!e.vpId)return;let t=!!this.vps[e.vpId];this.vps[e.vpId]={...this.vps[e.vpId]||{},...e},t||this.vpOrder.push(e.vpId),this.emptyLibrary&&(this.emptyLibrary=!1)},triggerDream(e){if(!e)return;this.dreamStatus={...this.dreamStatus,[e]:{...this.dreamStatus[e]||{},status:"running",lastError:null}};let t=window.Pinia&&window.Pinia.useChatStore?window.Pinia.useChatStore():null;t&&typeof t.sendWsMessage=="function"&&t.sendWsMessage({type:"yeaft_dream_trigger",vpId:e})},triggerGroupDream(e,t={}){if(!e)return;this.groupDreamStatus={...this.groupDreamStatus,[e]:{...this.groupDreamStatus[e]||{},status:"running",lastError:null}};let s=window.Pinia&&window.Pinia.useChatStore?window.Pinia.useChatStore():null,n=Date.now();if(Ea(s,{type:"dream_progress",phase:"start",groupId:e,manual:!0,trigger:"manual",source:"header-button",ts:n}),!s||typeof s.sendWsMessage!="function"){Ea(s,{type:"yeaft_dream_result",groupId:e,success:!1,skipped:!0,skippedReason:"chat-store-unavailable",trigger:"manual",error:null});return}let r={type:"yeaft_dream_trigger",sessionId:e},i=t&&t.agentId?t.agentId:typeof s.agentIdForSession=="function"?s.agentIdForSession(e):s.currentAgent;i&&(r.agentId=i),s.sendWsMessage(r)===!1&&Ea(s,{type:"yeaft_dream_result",groupId:e,success:!1,skipped:!0,skippedReason:"websocket-not-open",trigger:"manual",error:null})},applyDreamStatus(e){if(!e)return;let t=e.sessionId;if(t){this.groupDreamStatus={...this.groupDreamStatus,[t]:{...this.groupDreamStatus[t]||{},status:e.status==="running"?"running":e.status||"idle"}};return}if(!e.vpId)return;let s=e.vpId;this.dreamStatus={...this.dreamStatus,[s]:{...this.dreamStatus[s]||{},status:e.status==="running"?"running":e.status||"idle"}}},applyDreamResult(e){if(!e)return;let t=!!e.success,s=!!e.skipped,n={mergedCount:e.mergedCount??null,extractedCount:e.extractedCount??null,entriesCreated:typeof e.entriesCreated=="number"?e.entriesCreated:e.mergedCount??e.extractedCount??0,skipped:s,skippedReason:e.skippedReason||null,sessionsProcessed:typeof e.sessionsProcessed=="number"?e.sessionsProcessed:null,sessionsSkipped:typeof e.sessionsSkipped=="number"?e.sessionsSkipped:null,targetsApplied:typeof e.targetsApplied=="number"?e.targetsApplied:null,durationMs:typeof e.durationMs=="number"?e.durationMs:null,llmCallCount:typeof e.llmCallCount=="number"?e.llmCallCount:0,inputTokens:typeof e.inputTokens=="number"?e.inputTokens:0,outputTokens:typeof e.outputTokens=="number"?e.outputTokens:0,totalTokens:typeof e.totalTokens=="number"?e.totalTokens:0,metrics:e.metrics||null,passBreakdown:e.passBreakdown||e.metrics?.passBreakdown||null,targetErrors:Array.isArray(e.targetErrors)?e.targetErrors:[]},r=t||s?null:e.error||null,i=s?"skipped":t?"success":"error",o=e.sessionId;if(o){this.groupDreamStatus={...this.groupDreamStatus,[o]:{status:i,lastRunAt:Date.now(),lastResult:n,lastError:r}};return}if(!e.vpId)return;let a=e.vpId;this.dreamStatus={...this.dreamStatus,[a]:{status:i,lastRunAt:Date.now(),lastResult:n,lastError:r}}}}})});function $a(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e){let t=Date.parse(e);if(Number.isFinite(t))return t}return 0}function ii(e){return!e||typeof e!="object"?0:$a(e.lastMessageAt)||$a(e.updatedAt)||$a(e.createdAt)||0}function Va(e,t){let s=ii(t)-ii(e);return s!==0?s:String(e?.id||"").localeCompare(String(t?.id||""))}function Bu(e){return[...Array.isArray(e)?e:[]].sort(Va)}var oi=F(()=>{});function Wu(){try{if(typeof localStorage>"u")return{};let e=JSON.parse(localStorage.getItem(zu)||"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function qv(e){try{typeof localStorage<"u"&&localStorage.setItem(zu,JSON.stringify(e&&typeof e=="object"?e:{}))}catch{}}function ju(){try{return typeof localStorage>"u"?[]:sr(JSON.parse(localStorage.getItem(Yu)||"[]"))}catch{return[]}}function Bv(e){try{typeof localStorage<"u"&&localStorage.setItem(Yu,JSON.stringify(sr(e)))}catch{}}function Gu(e,t){return`${e||""}${t||""}`}function Ot(e){return e&&e.agentId&&e.id?Gu(e.agentId,e.id):""}function Mt(e,t){return t?e?Gu(e,t):String(t):""}function Wv(e){return typeof e=="string"?e:String(e||"")}function it(e,t,s=null){let n=Wv(t);if(!n)return"";let r=Mt(s,n),i=r?e.sessions[r]:null;if(i&&(s||i.agentId||e.inventoryIdentityMode==="legacy-bare"))return r;if(s){let c=e.sessions[n];return e.inventoryIdentityMode==="legacy-bare"&&c&&!c.agentId?n:""}let o=e.sessions[n];if(o){if(o.agentId||e.inventoryIdentityMode==="legacy-bare")return n;let c=e.activeSessionKey?e.sessions[e.activeSessionKey]:null;return c?.agentId&&c.id===n?e.activeSessionKey:""}if(e.activeSessionKey&&e.sessions[e.activeSessionKey]?.id===n)return e.activeSessionKey;let a=e.sessionOrder.filter(c=>e.sessions[c]?.id===n),l=nr();if(l?.currentAgent){let c=a.find(d=>e.sessions[d]?.agentId===l.currentAgent);if(c)return c}return a[0]||""}function Ha(e,t,s=null){return it(e,t,s)||""}function Oa(e){if(e.inventoryIdentityMode==="legacy-bare"){let t=e.activeSessionKey?e.sessions[e.activeSessionKey]:null,s=t&&!t.agentId?t:e.activeSessionId?e.sessions[e.activeSessionId]:null;e._retiredBareActiveSessionId=s&&!s.agentId&&s.id||null,e.sessionOrder=e.sessionOrder.filter(n=>e.sessions[n]?.agentId),e._retiredBareActiveSessionId&&(e.activeSessionId=null,e.activeSessionKey=null)}e.inventoryIdentityMode="agent-scoped"}function jv(e){let t=e._preferredExactSessionIdentity||null;if(!t)return!1;e._preferredExactSessionIdentity=null;let s=e.sessions[t.key]||null,n=nr(),r=s?.id===t.sessionId&&s.agentId===t.agentId,i=n?.currentView!=="yeaft"||typeof n.setActiveSessionFilter=="function";if(r&&i){if(e.activeSessionId=t.sessionId,e.activeSessionKey=t.key,n?.currentView==="yeaft")n.setActiveSessionFilter(t.sessionId,{agentId:t.agentId,force:!0});else if(n){n.yeaftActiveSessionFilter=t.sessionId,n.yeaftSessionAgentById={...n.yeaftSessionAgentById||{},[t.sessionId]:t.agentId};try{localStorage.setItem("lastViewedYeaftSession",t.key)}catch{}}return!0}if(e.activeSessionId=null,e.activeSessionKey=null,n?.yeaftActiveSessionFilter===t.sessionId&&(n.yeaftActiveSessionFilter=null),n?.yeaftSessionAgentById?.[t.sessionId]===t.agentId){let o={...n.yeaftSessionAgentById};delete o[t.sessionId],n.yeaftSessionAgentById=o}try{let o=Gn(localStorage.getItem("lastViewedYeaftSession")||"");o.agentId===t.agentId&&o.sessionId===t.sessionId&&localStorage.removeItem("lastViewedYeaftSession")}catch{}return!0}function ai(e){let t=e._retiredBareActiveSessionId||null;if(!t)return!1;let s=nr();if(e.inventoryIdentityMode==="legacy-bare"){let r=e.sessions[t];return e._retiredBareActiveSessionId=null,!r||r.agentId?!1:(e.activeSessionId=t,e.activeSessionKey=t,s?.currentView==="yeaft"&&typeof s.setActiveSessionFilter=="function"?s.setActiveSessionFilter(t,{force:!0}):s&&(s.yeaftActiveSessionFilter=t),!0)}let n=e.sessionOrder.filter(r=>{let i=e.sessions[r];return i?.agentId&&i.id===t});if(n.length===1){let r=n[0],i=e.activeSessionId===t&&e.activeSessionKey===r,o=e.sessions[r]?.agentId||null;return e.activeSessionId=t,e.activeSessionKey=r,i||(s?.currentView==="yeaft"&&typeof s.setActiveSessionFilter=="function"?(s.setActiveSessionFilter(t,{agentId:o,force:!0}),e._retiredBareActiveSessionId=t):s&&(s.yeaftActiveSessionFilter=t)),!0}e.activeSessionId=null,e.activeSessionKey=null,s?.yeaftActiveSessionFilter===t&&(s.yeaftActiveSessionFilter=null);try{let r=localStorage.getItem("lastViewedYeaftSession")||"";Gn(r).sessionId===t&&localStorage.removeItem("lastViewedYeaftSession")}catch{}return!0}function sr(e){let t=[],s=new Set;for(let n of Array.isArray(e)?e:[]){let r=typeof n=="string"?n:String(n||"");!r||s.has(r)||(s.add(r),t.push(r))}return t}function Fa(e,t){let s=sr(e),n=new Set(s),r=sr(t).filter(o=>n.has(o)),i=new Set(r);return[...r,...s.filter(o=>!i.has(o))]}function li(e,t=!1){return!e||typeof e!="object"?!!t:Object.prototype.hasOwnProperty.call(e,"pinned")?e.pinned===!0:Object.prototype.hasOwnProperty.call(e,"isPinned")?e.isPinned===!0:!!t}function Uu(e){return!e||typeof e!="object"?!1:e.running===!0||e.active===!0||e.isActive===!0||e.isRunning===!0}function Ku(e){if(!e||typeof e!="object")return 0;let t=e.latestActivityAt||e.lastActivityAt||e.lastMessageAt||e.updatedAt||0;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t){let s=Date.parse(t);return Number.isFinite(s)?s:0}return 0}function nr(){try{if(typeof window<"u"&&window.Pinia&&typeof window.Pinia.useChatStore=="function")return window.Pinia.useChatStore()}catch{}return null}var zu,Yu,Uv,Qu,Xu=F(()=>{oi();Qn();zu="yeaft-session-order-by-agent",Yu="yeaft-session-order-global";({defineStore:Uv}=Pinia);Qu=Uv("sessions",{state:()=>({sessions:{},sessionOrder:[],activeSessionId:null,activeSessionKey:null,inventoryIdentityMode:"empty",_retiredBareActiveSessionId:null,_preferredExactSessionIdentity:null,lastSnapshotAt:0,lastCrudResult:null,pending:{}}),getters:{sessionList(e){let t=e.sessionOrder.map(d=>e.sessions[d]).filter(Boolean),s=nr(),n=s&&Array.isArray(s.pinnedSessions)?new Set(s.pinnedSessions):new Set;for(let d of t)d&&d.id&&d.pinned&&n.add(d.id);let r=[],i=[];for(let d of t)d.pinned||!d.agentId&&n.has(d.id)?r.push(d):i.push(d);let o=d=>[...d].sort((u,f)=>{let p=Number.isFinite(u?.sortOrder)?u.sortOrder:Number.MAX_SAFE_INTEGER,g=Number.isFinite(f?.sortOrder)?f.sortOrder:Number.MAX_SAFE_INTEGER;return p!==g?p-g:Va(u,f)}),a=[...o(r),...o(i)],l=ju();if(l.length===0)return a;let c=new Map(l.map((d,u)=>[d,u]));return a.sort((d,u)=>{let f=c.has(Ot(d))?c.get(Ot(d)):Number.MAX_SAFE_INTEGER,p=c.has(Ot(u))?c.get(Ot(u)):Number.MAX_SAFE_INTEGER;return f!==p?f-p:0})},sessionCount(e){return e.sessionOrder.length},sessionById:e=>(t,s=null)=>{let n=it(e,t,s);return n&&e.sessions[n]||null},activeSession(e){return e.activeSessionKey&&e.sessions[e.activeSessionKey]||null},hasLoadedSnapshot(e){return e.lastSnapshotAt>0},isEmpty(e){return e.sessionOrder.length===0},activeNeedsInvite(e){let t=e.activeSessionKey?e.sessions[e.activeSessionKey]:null;return t?!t.defaultVpId&&(!Array.isArray(t.roster)||t.roster.length===0):!1}},actions:{applySnapshot(e,t=null,{deferActivation:s=!1}={}){let n=Array.isArray(e)?e:[],r=!1;if(t){Oa(this);let o={...this.sessions},a=new Set;for(let p of n){if(!p||!p.id)continue;let g=Mt(t,p.id);a.add(g),o[g]=this._normalize(p,t,li(this.sessions[g]))}for(let p of this.sessionOrder){let g=this.sessions[p];g&&g.agentId===t&&!a.has(p)&&delete o[p]}let l=this.sessionOrder.filter(p=>o[p]),c=new Set(l),d=[];for(let p of n){if(!p||!p.id)continue;let g=Mt(t,p.id);o[g]&&!c.has(g)&&d.push(g)}this.sessions=o;let u=[...l,...d],f=ju();if(f.length>0){let p=new Map(u.map(I=>[Ot(o[I]),I]).filter(([I])=>I)),g=f.map(I=>p.get(I)).filter(Boolean),m=new Set(g);u=[...g,...u.filter(I=>!m.has(I))];let b=new Map(f.map((I,y)=>[I,y]));for(let I of u){let y=Ot(o[I]);y&&b.has(y)&&(o[I]={...o[I],sortOrder:b.get(y)})}}if(t&&f.length===0){let p=Wu(),g=sr(p[t]);if(g.length>0){let m=g.map(v=>Mt(t,v)),b=new Set(m),I=Fa(u.filter(v=>o[v]?.agentId===t),m),y=this.sessionOrder.some(v=>o[v]?.agentId===t),S=0;y?u=this.sessionOrder.filter(v=>o[v]).map(v=>o[v]?.agentId===t?I[S++]:v).concat(I.slice(S)):u=u.map(v=>o[v]?.agentId===t?I[S++]:v);let w=new Map(m.map((v,h)=>[v,h]));for(let v of I)o[v]&&b.has(v)&&(o[v]={...o[v],sortOrder:w.get(v)})}}this.sessionOrder=u}else{if(this.inventoryIdentityMode==="agent-scoped")return;if(Object.values(this.sessions).some(c=>c&&c.agentId)){this.inventoryIdentityMode="agent-scoped";return}let a={},l=[];for(let c of n){if(!c||!c.id)continue;let d=Mt(null,c.id);a[d]=this._normalize(c,null,li(this.sessions[d])),l.push(d)}this.sessions=a,this.sessionOrder=l,this.inventoryIdentityMode="legacy-bare"}s||(r=jv(this)||ai(this)),this.lastSnapshotAt=Date.now();let i=nr();if(i&&t){let o={...i.yeaftSessionAgentById||{}};for(let a of n)a&&a.id&&!o[a.id]&&(o[a.id]=t);i.yeaftSessionAgentById=o}if(!s&&!r){let o=null;try{o=localStorage.getItem("lastViewedYeaftSession")||null}catch{}let l=(o?this.sessions[o]:null)?o:o?it(this,o,t):"",c=l?this.sessions[l]:null,d=c&&(!t||c.agentId===t),u=this.sessionOrder.filter(S=>this.sessions[S]&&(!t||this.sessions[S].agentId===t)&&this.sessions[S].running).sort((S,w)=>Ku(this.sessions[w])-Ku(this.sessions[S]))[0]||null,f=u?this.sessions[u]?.id:null,p=this.sessionList[0]||null,g=p?.id||null,m=g?it(this,g,p?.raw?.agentId||null):"",b=f||(d?c.id:null)||g,I=u||(d?l:"")||m||Ha(this,b,t),y=this.activeSessionKey?this.sessions[this.activeSessionKey]?.agentId:null;if(this.activeSessionId&&!it(this,this.activeSessionId,y)?(this.activeSessionId=b,this.activeSessionKey=I||null):!this.activeSessionId&&this.sessionOrder.length>0&&!this._retiredBareActiveSessionId?(this.activeSessionId=b,this.activeSessionKey=I||null):this.activeSessionId&&(this.activeSessionKey=Ha(this,this.activeSessionId,y)||this.activeSessionKey),i&&!this._retiredBareActiveSessionId){let S=this.activeSessionId||b,w=null;if((i.yeaftActiveSessionFilter&&!it(this,i.yeaftActiveSessionFilter)||!i.yeaftActiveSessionFilter&&S)&&(w=S),w){let v=Ha(this,w),h=v&&this.sessions[v]?.agentId||null;i.currentView==="yeaft"&&typeof i.setActiveSessionFilter=="function"?i.setActiveSessionFilter(w,{agentId:h,force:!0}):i.yeaftActiveSessionFilter=w,this.activeSessionKey=v||this.activeSessionKey}}}if(i&&typeof i.applyServerPinSnapshot=="function"){let o=new Set;for(let l of n){if(!l||!l.id)continue;let c=Mt(t,l.id),d=this.sessions[c];d&&d.pinned&&o.add(l.id)}let a=l=>{let c=it(this,l,t),d=c?this.sessions[c]:null;return d?d.agentId===t:!1};i.applyServerPinSnapshot(t,o,a)}},applyRosterChange(e,t=null){if(!e)return;let s=e.sessionId||e.groupId;if(!s)return;let n=t||e.agentId||null;if(n)Oa(this);else if(this.inventoryIdentityMode!=="legacy-bare")return;let r=it(this,s,n)||Mt(n,s),i=this.sessions[r];if(!i){let o=this._normalize({id:s,name:e.name||s,roster:Array.isArray(e.roster)?e.roster:[],defaultVpId:e.defaultVpId||null},n);this.sessions[r]=o,this.sessionOrder.push(r),ai(this);return}this.sessions[r]={...i,name:e.name||i.name,roster:Array.isArray(e.roster)?e.roster.slice():i.roster,defaultVpId:e.defaultVpId!=null?e.defaultVpId:i.defaultVpId,announcement:typeof e.announcement=="string"?e.announcement:i.announcement},ai(this)},applyCrudResult(e,t=null){if(!e)return;this.lastCrudResult={...e,at:Date.now()},e.requestId&&this.pending[e.requestId]&&delete this.pending[e.requestId];let s=e.session||e.group||null,n=t||e.agentId||s?.agentId||null;e.ok&&e.op==="list"&&Array.isArray(e.sessions)&&this.applySnapshot(e.sessions,n),e.ok&&(e.op==="create"||e.op==="restore")&&s&&s.id&&this.applySnapshotUpsert(s,n)&&this.setActive(s.id,n);let r=e.sessionId||e.groupId,i=this.inventoryIdentityMode==="legacy-bare",o=r&&(n||i)?it(this,r,n):"";if(e.ok&&(e.op==="archive"||e.op==="delete")&&r&&o&&(delete this.sessions[o],this.sessionOrder=this.sessionOrder.filter(a=>a!==o),(this.activeSessionKey===o||i&&this.activeSessionId===r)&&(this.activeSessionKey=this.sessionOrder[0]||null,this.activeSessionId=this.activeSessionKey&&this.sessions[this.activeSessionKey]?.id||null)),e.ok&&e.op==="update_config"&&r){let a=o?this.sessions[o]:null;a&&(this.sessions[o]={...a,config:e.config&&typeof e.config=="object"?{...e.config}:{}})}},applySnapshotUpsert(e,t=null){if(!e||!e.id)return"";let s=t||e.agentId||null;if(s)Oa(this);else if(this.inventoryIdentityMode!=="legacy-bare")return"";let n=it(this,e.id,s)||Mt(s,e.id),r=!!this.sessions[n],i=this.sessions[n]||{};return this.sessions[n]={...i,...this._normalize(e,s,li(i))},r||this.sessionOrder.push(n),ai(this),n},setActive(e,t=null){let s=it(this,e,t);e&&s&&this.sessions[s]?(this.activeSessionId=e,this.activeSessionKey=s,this._retiredBareActiveSessionId=null):(this.activeSessionId=null,this.activeSessionKey=null)},reorderSessionsForAgent(e,t){if(!e)return[];let s=this.sessionOrder.filter(l=>this.sessions[l]?.agentId===e),n=Fa(s,t.map(l=>Mt(e,l)));if(n.length===0)return[];let r=new Map(n.map((l,c)=>[l,c])),i=0;this.sessionOrder=this.sessionOrder.map(l=>this.sessions[l]?.agentId===e?n[i++]:l);for(let l of n)this.sessions[l]={...this.sessions[l],sortOrder:r.get(l)};let o=Wu(),a=n.map(l=>this.sessions[l]?.id).filter(Boolean);return o[e]=a,qv(o),a},reorderSessionsGlobally(e){let t=this.sessionOrder.map(a=>Ot(this.sessions[a])).filter(Boolean),s=Fa(t,e);if(s.length===0)return[];let n=new Map(this.sessionOrder.map(a=>[Ot(this.sessions[a]),a]).filter(([a])=>a)),r=s.map(a=>n.get(a)).filter(Boolean),i=new Set(r);this.sessionOrder=[...r,...this.sessionOrder.filter(a=>!i.has(a))];let o=new Map(s.map((a,l)=>[a,l]));for(let a of this.sessionOrder){let l=Ot(this.sessions[a]);l&&o.has(l)&&(this.sessions[a]={...this.sessions[a],sortOrder:o.get(l)})}return Bv(s),s.map(a=>{let l=n.get(a),c=l?this.sessions[l]:null;return c?{agentId:c.agentId,sessionId:c.id}:null}).filter(Boolean)},applyPinState(e,t,s=null){if(!s&&this.inventoryIdentityMode!=="legacy-bare")return;let n=it(this,e,s);!e||!n||!this.sessions[n]||(this.sessions[n]={...this.sessions[n],pinned:!!t})},markPending(e,t){e&&(this.pending[e]=t)},clearLastResult(){this.lastCrudResult=null},resetInventory(){this.sessions={},this.sessionOrder=[],this.activeSessionId=null,this.activeSessionKey=null,this.inventoryIdentityMode="empty",this._retiredBareActiveSessionId=null,this._preferredExactSessionIdentity=null,this.lastSnapshotAt=0},beginInventoryCommit(e=null,t=null){if(this.resetInventory(),e&&t){let s=Mt(t,e);this.activeSessionId=e,this.activeSessionKey=s,this._preferredExactSessionIdentity={sessionId:e,agentId:t,key:s}}else e&&(this._retiredBareActiveSessionId=e)},_normalize(e,t=null,s=!1){return{id:e.id,name:e.name||e.id,roster:Array.isArray(e.roster)?e.roster.slice():[],defaultVpId:e.defaultVpId||null,announcement:typeof e.announcement=="string"?e.announcement:"",config:e.config&&typeof e.config=="object"?{...e.config}:{},workDir:typeof e.workDir=="string"?e.workDir:"",createdAt:e.createdAt||null,updatedAt:e.updatedAt||null,lastMessageAt:e.lastMessageAt||null,running:Uu(e),active:Uu(e),runningVpCount:Number.isFinite(Number(e.runningVpCount))?Number(e.runningVpCount):0,latestActivityAt:e.latestActivityAt||e.lastActivityAt||e.lastMessageAt||null,agentId:t||e.agentId||null,pinned:li(e,s),sortOrder:Number.isFinite(e.sortOrder)?e.sortOrder:null}}}})});function ci(){try{if(window.Pinia&&typeof window.Pinia.useAuthStore=="function")return window.Pinia.useAuthStore()}catch{}return null}function Na(){try{return localStorage.getItem("authToken")||null}catch{return null}}function ep(){let e=ci();if(e)try{return e.getActiveToken?.()||e.token||Na()}catch{return e.token||Na()}return Na()}function zv(e,t){if(!e)return!1;let s=ep();if(s&&s!==t)return!1;try{localStorage.setItem("authToken",e)}catch{}let n=ci();return n&&(n.token=e),!0}function Yv(e){try{let t=typeof e=="string"?e:e?.url;return!t||typeof window>"u"||!window.location?null:new URL(t,window.location.href)}catch{return null}}function Ju(e){return!e||typeof window>"u"||!window.location?!1:e.origin===window.location.origin&&e.pathname.startsWith("/api/")}function Gv(e){if(!e)return!1;let t=e.pathname;return!!(Kv.has(t)||t.startsWith("/api/auth/sso/poll/")||/^\/api\/auth\/sso\/[^/]+\/start(?:-qr)?$/.test(t))}function Qv(e,t){return t?.headers?new Headers(t.headers):e&&typeof e=="object"&&e.headers?new Headers(e.headers):new Headers}function Xv(e){let t=e.get("Authorization");return!t||!t.startsWith("Bearer ")?null:t.slice(7)}function Zv(e,t){return{...e||{},headers:t}}function Jv(e,t,s,n){let r=ci();r&&typeof r.handleAuthResponse=="function"?r.handleAuthResponse(e,t,s,n):r&&typeof r.handleAuthFailure=="function"&&n&&r.handleAuthFailure(void 0,t,s)}function tp(){if(Zu||typeof window>"u"||!window.fetch)return;Zu=!0;let e=window.fetch.bind(window);window.fetch=async function(s,n){let r=Yv(s),i=Ju(r)&&!Gv(r),o=Ju(r)?{...n||{},credentials:"same-origin"}:n,a=null,l=i?ci():null,c=l?.authGeneration,d=!!l?.isAuthenticated;if(i){let f=Qv(s,n);a=Xv(f),a||(a=ep(),a&&(f.set("Authorization",`Bearer ${a}`),o=Zv(o,f)))}let u=await e(s,o);try{let f=u.headers&&u.headers.get&&u.headers.get("X-New-Token");f&&zv(f,a),i&&u.status===401&&Jv(u,a,c,d)}catch{}return u}}var Zu,Kv,sp=F(()=>{Zu=!1,Kv=new Set(["/api/auth/mode","/api/auth/login","/api/auth/aad","/api/auth/verify","/api/auth/verify-totp","/api/auth/setup-totp","/api/auth/register","/api/auth/password-reset/request","/api/auth/password-reset/verify"])});var np,rp=F(()=>{np={"common.loading":"\u52A0\u8F7D\u4E2D...","common.confirm":"\u786E\u5B9A","common.apply":"\u5E94\u7528","common.cancel":"\u53D6\u6D88","common.delete":"\u5220\u9664","common.copy":"\u590D\u5236","common.copied":"\u5DF2\u590D\u5236","common.close":"\u5173\u95ED","common.refresh":"\u5237\u65B0","common.open":"\u6253\u5F00","common.save":"\u4FDD\u5B58","common.search":"\u641C\u7D22","common.back":"\u8FD4\u56DE","common.noSubdirectories":"\u65E0\u5B50\u76EE\u5F55","common.drives":"\u9A71\u52A8\u5668","common.rootDir":"\u6839\u76EE\u5F55","common.comma":"\uFF0C","common.select":"\u9009\u62E9","mermaid.export":"\u5BFC\u51FA","mermaid.exportMd":"\u5BFC\u51FA MD","mermaid.exportPng":"\u5BFC\u51FA PNG","mermaid.exportJpg":"\u5BFC\u51FA JPG","chat.toolActionsOmitted":"\u5DF2\u7701\u7565 {count} \u4E2A\u5386\u53F2\u5DE5\u5177\u52A8\u4F5C","login.subtitle":"Yeaft Web Code Agent","login.username":"\u7528\u6237\u540D","login.password":"\u5BC6\u7801","login.login":"\u767B\u5F55","login.loggingIn":"\u767B\u5F55\u4E2D...","login.enterUsername":"\u8BF7\u8F93\u5165\u7528\u6237\u540D","login.enterPassword":"\u8BF7\u8F93\u5165\u5BC6\u7801","login.noAccount":"\u6CA1\u6709\u8D26\u53F7\uFF1F","login.registerWithCode":"\u6CE8\u518C\u65B0\u8D26\u53F7","login.or":"\u6216","login.usePassword":"\u4F7F\u7528\u8D26\u53F7\u5BC6\u7801\u767B\u5F55","login.useSso":"\u8FD4\u56DE\u5355\u70B9\u767B\u5F55","login.noProviders":"\u7BA1\u7406\u5458\u5C1A\u672A\u542F\u7528\u4EFB\u4F55\u7B2C\u4E09\u65B9\u767B\u5F55\u3002","login.microsoft":"\u4F7F\u7528 Microsoft \u8D26\u53F7\u767B\u5F55","login.github":"\u4F7F\u7528 GitHub \u8D26\u53F7\u767B\u5F55","login.google":"\u4F7F\u7528 Google \u8D26\u53F7\u767B\u5F55","login.wechat":"\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801\u767B\u5F55","login.alipay":"\u4F7F\u7528\u652F\u4ED8\u5B9D\u8D26\u53F7\u767B\u5F55","login.wechat.mobileUnsupported":"\u5FAE\u4FE1\u767B\u5F55\u6682\u4EC5\u652F\u6301\u7535\u8111\u7AEF\uFF0C\u8BF7\u5728\u7535\u8111\u6D4F\u89C8\u5668\u4E2D\u626B\u7801\u767B\u5F55\u3002","login.alipay.mobileWaiting":"\u6B63\u5728\u7B49\u5F85\u4F60\u5728\u652F\u4ED8\u5B9D\u4E2D\u786E\u8BA4\u2026 \u5B8C\u6210\u540E\u8FD4\u56DE\u672C\u9875\u9762\u5C06\u81EA\u52A8\u767B\u5F55\u3002","login.alipay.relaunch":"\u91CD\u65B0\u6253\u5F00\u652F\u4ED8\u5B9D","login.qr.title":"\u626B\u7801\u767B\u5F55","login.qr.titleAlipay":"\u652F\u4ED8\u5B9D\u626B\u7801\u767B\u5F55","login.qr.titleWechat":"\u5FAE\u4FE1\u626B\u7801\u767B\u5F55","login.qr.hint":"\u8BF7\u4F7F\u7528\u624B\u673A\u626B\u63CF\u4E8C\u7EF4\u7801\u5B8C\u6210\u6388\u6743","login.error.enterUsername":"\u8BF7\u8F93\u5165\u7528\u6237\u540D","login.error.enterPassword":"\u8BF7\u8F93\u5165\u5BC6\u7801","login.error.enter6Digit":"\u8BF7\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.error.enterInviteCode":"\u8BF7\u8F93\u5165\u9080\u8BF7\u7801","login.error.usernameMinLen":"\u7528\u6237\u540D\u81F3\u5C112\u4E2A\u5B57\u7B26","login.error.passwordMinLen":"\u5BC6\u7801\u81F3\u5C116\u4F4D","login.error.passwordMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","login.error.enterVerifyCode":"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801","login.error.loginFailed":"\u767B\u5F55\u5931\u8D25","login.forgot.link":"\u5FD8\u8BB0\u5BC6\u7801\uFF1F","login.forgot.title":"\u91CD\u7F6E\u5BC6\u7801","login.forgot.emailHint":"\u8F93\u5165\u8D26\u6237\u7ED1\u5B9A\u7684\u90AE\u7BB1\uFF0C\u6211\u4EEC\u5C06\u53D1\u9001 6 \u4F4D\u91CD\u7F6E\u9A8C\u8BC1\u7801\u3002","login.forgot.sendCode":"\u53D1\u9001\u91CD\u7F6E\u9A8C\u8BC1\u7801","login.forgot.sending":"\u53D1\u9001\u4E2D...","login.forgot.codeSent":"\u5982\u679C\u90AE\u7BB1\u5DF2\u6CE8\u518C\uFF0C\u91CD\u7F6E\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001\u3002\u8BF7\u5728\u4E0B\u65B9\u8F93\u5165\u9A8C\u8BC1\u7801\u4E0E\u65B0\u5BC6\u7801\u3002","login.forgot.resetBtn":"\u91CD\u7F6E\u5BC6\u7801","login.forgot.resetting":"\u91CD\u7F6E\u4E2D...","login.forgot.success":"\u5BC6\u7801\u5DF2\u91CD\u7F6E\uFF0C\u53EF\u4EE5\u4F7F\u7528\u65B0\u5BC6\u7801\u767B\u5F55\u3002","login.forgot.emailInvalid":"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1","login.register.title":"\u65B0\u7528\u6237\u6CE8\u518C","login.register.inviteCode":"\u9080\u8BF7\u7801","login.register.username":"\u7528\u6237\u540D","login.register.password":"\u5BC6\u7801\uFF08\u81F3\u5C116\u4F4D\uFF09","login.register.confirmPassword":"\u786E\u8BA4\u5BC6\u7801","login.register.email":"\u90AE\u7BB1\uFF08\u53EF\u9009\uFF09","login.register.submit":"\u6CE8\u518C","login.register.submitting":"\u6CE8\u518C\u4E2D...","login.register.back":"\u8FD4\u56DE\u767B\u5F55","login.register.success":"\u6CE8\u518C\u6210\u529F\uFF0C\u8BF7\u767B\u5F55","login.register.enterCode":"\u8BF7\u8F93\u5165\u9080\u8BF7\u7801","login.register.usernameMin":"\u7528\u6237\u540D\u81F3\u5C112\u4E2A\u5B57\u7B26","login.register.passwordMin":"\u5BC6\u7801\u81F3\u5C116\u4F4D","login.register.passwordMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","login.totp.setupTitle":"\u8BBE\u7F6E\u53CC\u56E0\u7D20\u8BA4\u8BC1","login.totp.setupHint":"\u4F7F\u7528 Microsoft Authenticator \u6216 Google Authenticator \u626B\u63CF\u4E0B\u65B9\u4E8C\u7EF4\u7801","login.totp.manualKey":"\u6216\u624B\u52A8\u8F93\u5165\u5BC6\u94A5\uFF1A","login.totp.enterCode":"\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.totp.complete":"\u5B8C\u6210\u8BBE\u7F6E","login.totp.verifying":"\u9A8C\u8BC1\u4E2D...","login.totp.verify":"\u9A8C\u8BC1","login.totp.prompt":"\u8BF7\u8F93\u5165 Authenticator \u5E94\u7528\u4E2D\u7684\u9A8C\u8BC1\u7801","login.totp.invalidCode":"\u8BF7\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.email.codeSent":"\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001\u81F3 {email}","login.email.enterCode":"\u8F93\u5165\u9A8C\u8BC1\u7801","login.email.verify":"\u9A8C\u8BC1","login.email.verifying":"\u9A8C\u8BC1\u4E2D...","login.email.enterCodeError":"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801","chat.agent.select":"\u9009\u62E9 Agent","chat.agent.manage":"\u7BA1\u7406 Agent","chat.agent.none":"\u6682\u65E0 Agent","chat.agent.restarting":"\u91CD\u542F\u4E2D","chat.agent.restart":"\u91CD\u542F","chat.agent.restartConfirm":`\u786E\u5B9A\u8981\u91CD\u542F Agent "{name}" \u5417\uFF1F
|
|
10
|
+
${b}`:b),m.status!=="failed"&&m.status!=="closed"&&(m.status=c.status||"idle");break}case"error":c.error&&(m.error=c.error.message||String(c.error));break;default:break}m.updatedAt=Date.now(),this.yeaftSubAgentCards={...this.yeaftSubAgentCards,[d]:m};break}case"history_loaded":{let a={...r,agentId:e.agentId||null,requestId:r.requestId||e.requestId||null};if(a.requestId&&!this.isCurrentYeaftHistoryResponse(a))break;let l=e.agentId||null,c=r.sessionId??null,d=ke(l,c),u=e.perfTraceId||this.yeaftHistoryPerfTraceBySession?.[d];u&&Ge(this,{traceId:u,phase:"history.loaded_event",agentId:e.agentId||null,sessionId:r.sessionId||null,messageType:r.type,detail:{mode:r.mode||"recent",count:r.count||0,hasMore:!!r.hasMore}});let f=r.mode==="delta"?"delta":"recent",p=this.yeaftSessionHistoryState[d]||{},g=Number.isFinite(r.latestSeq)?r.latestSeq:Number.isFinite(p.latestSeq)?p.latestSeq:null,m=Number.isFinite(r.nextBeforeSeq)?r.nextBeforeSeq:Number.isFinite(r.oldestSeq)?r.oldestSeq:Number.isFinite(p.serverOldestFetchedSeq)?p.serverOldestFetchedSeq:Number.isFinite(p.oldestSeq)?p.oldestSeq:null,b=f==="delta"?{...p,loaded:!0,loading:!1,latestSeq:g,syncingAfterSeq:null,count:(p.count||0)+(r.count||0)}:{...p,loaded:!0,loading:!1,hasMore:!!r.hasMore,serverHasMore:!!r.hasMore,oldestSeq:m,serverOldestFetchedSeq:m,count:typeof r.count=="number"?r.count:0,latestSeq:g,syncingAfterSeq:null},I=a.requestId?this.finishYeaftHistoryLoad(a,b,"completion"):null;I||(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[d]:b});let y=ke(l?this.currentAgent:null,this.yeaftActiveSessionFilter??null);if(d===y)f==="recent"&&(this.yeaftHasMoreHistory=b.hasMore,this.yeaftOldestLoadedSeq=b.serverOldestFetchedSeq),this.yeaftLoadingMoreHistory=!!I?.loading;else if(this.yeaftLoadingMoreHistory){let S=this.yeaftSessionHistoryState[y]||null;this.yeaftLoadingMoreHistory=!!S?.loading}}break;case"vp_snapshot":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&a.applySnapshot(r,e.agentId||null,e.requestId||null);break}case"vp_snapshot_error":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&a.failSnapshot(e.agentId||null,e.requestId||null,r.error||r.message||"VP library request failed");break}case"vp_updated":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&r.vp&&a.upsert(r.vp,r.reason,e.agentId||null);break}case"vp_removed":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&r.vpId&&a.remove(r.vpId,r.reason,e.agentId||null);break}case"vp_crud_result":{let a=this._vpCrudPending&&this._vpCrudPending.get(r.requestId);a&&(this._vpCrudPending.delete(r.requestId),a.resolve({ok:!!r.ok,op:r.op,vpId:r.vpId,vp:r.vp,error:r.error||null}));break}case"group_list_updated":case"session_list_updated":case"yeaft_session_hydrate":{let a=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore(),l=r.sessions||[];if(r.projectsAuthoritative===!0&&Array.isArray(r.projects)?this.applySessionCatalogSnapshot(this.sessionCatalog,r.projects):Array.isArray(r.projects)&&e.agentId&&this.applyLegacyProjectSnapshot(r.projects,e.agentId),r.type!=="yeaft_session_hydrate"&&this.yeaftSessionHydrateRequestId&&this.yeaftSessionInventoryCompleteSupported===!0){let p=Array.isArray(this.yeaftSessionHydrateSlices)?this.yeaftSessionHydrateSlices.filter(g=>g.agentId!==(e.agentId||null)):[];this.yeaftSessionHydrateSlices=[...p,{agentId:e.agentId||null,sessions:l}];break}let c=a&&a.activeSessionId||null,d=a?.activeSessionKey&&a.sessions?.[a.activeSessionKey]?.agentId||null;a&&(a.applySnapshot(l,e.agentId||null),this._hasHandledYeaftSessionHydrate=!0,this.yeaftSessionHydrateError=null);let u=a&&a.activeSessionId||null,f=a?.activeSessionKey&&a.sessions?.[a.activeSessionKey]?.agentId||null;if(this.currentView==="yeaft"&&u){let p=f||Se(this,u,e.agentId||null),g=ke(p,u),m=this.yeaftSessionHistoryState[g]||null;this.setActiveSessionFilter(u,{agentId:p,force:d!==p||Dc(u,c,m)})}break}case"group_roster_changed":case"session_roster_changed":{let a=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();a&&a.applyRosterChange(r,e.agentId||null);break}case"group_crud_result":case"session_crud_result":{let a=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();a&&a.applyCrudResult(r,e.agentId||null);let l=this._sessionCrudPending&&this._sessionCrudPending.get(r.requestId);if(l){this._sessionCrudPending.delete(r.requestId);let c=r.session||r.group||null,d=c&&e.agentId&&!c.agentId?{...c,agentId:e.agentId}:c,u=r.sessionId||null,f=r.sessions||null;l.resolve({ok:!!r.ok,op:r.op,session:d,sessionId:u,sessions:f,config:r.config||null,error:r.error||null})}break}case"vp_turn_start":{if(!r.turnId||!r.vpId)break;let a=da(e.agentId||null,r.turnId)||r.turnId;if(this.activeVpTurns={...this.activeVpTurns,[a]:{agentId:e.agentId||null,turnId:r.turnId,vpId:r.vpId,sessionId:r.sessionId||null,threadId:r.threadId||null,isStreaming:!0,startedAt:r.ts||Date.now()}},r.sessionId){let l=mt(e.agentId||null,r.sessionId);this.yeaftProcessingSessions={...this.yeaftProcessingSessions,...l?{[l]:!0}:{[r.sessionId]:!0}}}break}case"vp_turn_end":{if(!r.turnId)break;let a=Qs(this,e.agentId||null,r.turnId),l=r.sessionId||this.activeVpTurns?.[a]?.sessionId||null;r.reason==="end_turn"&&l&&this.markYeaftSessionUnread(l,e.agentId||null);let{[a]:c,...d}=this.activeVpTurns;this.activeVpTurns=d;let{[a]:u,...f}=this.stoppingVpTurnIds;this.stoppingVpTurnIds=f;let p=r.sessionId||c?.sessionId||null,g=e.agentId||c?.agentId||null,m=r.vpId||c?.vpId||null;if(!(p&&m?Object.values(this.activeVpTurns||{}).some(v=>v?.vpId===m&&et(v,p,g)):!1)&&p&&m){let v={...this.vpStatuses||{}},h=!1;for(let[M,x]of Object.entries(v))x?.vpId===m&&et(x,p,g)&&tr.has(x.state)&&(v[M]={...x,state:"idle",turnId:null,since:r.ts||Date.now()},h=!0);h&&(this.vpStatuses=v)}this.clearYeaftSessionProcessingIfIdle(p,{agentId:g});let y={end_turn:"completed",route_forward:"completed",aborted:"aborted",errored:"errored",error:"errored",cancelled:"cancelled",canceled:"cancelled"}[r.reason]||"completed",S=Date.now(),w=Ht(this,e.agentId||null,e.conversationId);if(w&&Array.isArray(this.messagesMap[w])){let v=this.messagesMap[w],h=ku(v,r);for(let M=0;M<v.length;M++){let x=v[M];if(!x||x.type!=="assistant")continue;let E=x.sessionId??x.groupId;r.sessionId&&E&&E!==r.sessionId||r.vpId&&x.speakerVpId&&x.speakerVpId!==r.vpId||r.turnId&&x.turnId&&x.turnId!==r.turnId||x.status&&x.status!=="pending"||(x.status=y,x.turnEndAt=S,x.turnEndReason=r.reason||null,r.detail&&(x.turnEndDetail=r.detail),Number.isFinite(r.durationMs)&&(x.turnDurationMs=r.durationMs),h=!0)}h&&(this.messagesMap={...this.messagesMap,[w]:v.slice()})}break}case"yeaft_turn_aborted":{let a=Array.isArray(r.turnIds)?r.turnIds.filter(Boolean):[];r.turnId&&a.push(r.turnId);let l=r.sessionId||null,c=r.vpId||null,d=new Set;for(let g of a){let m=Qs(this,e.agentId||null,g),b=this.activeVpTurns?.[m]||null;(!b||et(b,b.sessionId,e.agentId||null))&&d.add(m)}if(c)for(let[g,m]of Object.entries(this.activeVpTurns||{}))!m||m.vpId!==c||et(m,l,e.agentId||null)&&d.add(g);if(d.size===0)break;let u=l,f={...this.activeVpTurns||{}},p={...this.stoppingVpTurnIds||{}};for(let g of d){let m=f[g];!u&&m?.sessionId&&(u=m.sessionId),delete f[g],delete p[g]}this.activeVpTurns=f,this.stoppingVpTurnIds=p,this.clearYeaftSessionProcessingIfIdle(u||null,{agentId:e.agentId||null});break}case"yeaft_aborted":{let a=r.sessionId||e.sessionId||null;a?(this.activeVpTurns=Object.fromEntries(Object.entries(this.activeVpTurns||{}).filter(([,l])=>!et(l,a,e.agentId||null))),this.stoppingVpTurnIds=Object.fromEntries(Object.entries(this.stoppingVpTurnIds||{}).filter(([l])=>this.activeVpTurns?.[l])),this.vpStatuses=Object.fromEntries(Object.entries(this.vpStatuses||{}).filter(([,l])=>!et(l,a,e.agentId||null))),this.clearYeaftSessionProcessingIfIdle(a,{agentId:e.agentId||null,ignoreStatuses:!0})):r.all&&Tu(this,e.agentId||null);break}case"vp_typing_start":{if(!r.vpId)break;let a=Ht(this,e.agentId||null,e.conversationId);if(!a)break;this.yeaftVpTyping=nu(this.yeaftVpTyping,a,r.vpId);break}case"vp_typing_end":{if(!r.vpId)break;let a=Ht(this,e.agentId||null,e.conversationId);if(!a)break;this.yeaftVpTyping=ru(this.yeaftVpTyping,a,r.vpId);break}case"vp_status_changed":{if(!r.vpId||!r.state)break;if(o){let u=Pa(i);if(r.state==="thinking"||r.state==="retrying"||r.state==="tool")Nn(this,o,`${r.state}:${u}`);else if(r.state==="streaming"||r.state==="idle"||r.state==="error")for(let f of["thinking","retrying","tool"])Bs(this,o,`${f}:${u}`)}let a=r.sessionId||null,l=e.agentId||null,c=ei(l,a,r.vpId),d={agentId:l,state:r.state,since:r.since||Date.now(),turnId:r.turnId||null,title:r.title||"",sessionId:a,vpId:r.vpId};if(this.vpStatuses={...this.vpStatuses,[c]:d},a&&tr.has(r.state)){let u=mt(l,a);this.yeaftProcessingSessions={...this.yeaftProcessingSessions,...u?{[u]:!0}:{[a]:!0}}}else a&&this.clearYeaftSessionProcessingIfIdle(a,{agentId:l});this.restoreActiveYeaftSessionFromStatuses([d],l);break}case"vp_status_snapshot":{let a=Array.isArray(r.statuses)?r.statuses:[],l=r.sessionId;if(l==null){let c={...this.vpStatuses||{}};if(e.agentId)for(let[d,u]of Object.entries(c))(!u?.agentId||u.agentId===e.agentId)&&delete c[d];else for(let d of Object.keys(c))delete c[d];for(let d of a){if(!d||!d.vpId)continue;let u=d.sessionId||d.groupId||null,f=ei(e.agentId||null,u,d.vpId);c[f]={agentId:e.agentId||null,state:d.state,since:d.since||Date.now(),turnId:d.turnId||null,title:d.title||"",sessionId:u,vpId:d.vpId}}this.vpStatuses=c}else{let c={...this.vpStatuses};for(let[d,u]of Object.entries(c))u&&u.sessionId===l&&(!e.agentId||!u.agentId||u.agentId===e.agentId)&&delete c[d];for(let d of a){if(!d||!d.vpId)continue;let u=d.sessionId||d.groupId||null,f=ei(e.agentId||null,u,d.vpId);c[f]={agentId:e.agentId||null,state:d.state,since:d.since||Date.now(),turnId:d.turnId||null,title:d.title||"",sessionId:u,vpId:d.vpId}}this.vpStatuses=c}this.yeaftProcessingSessions=Sv(this,e.agentId||null,a,l??null),this.restoreActiveYeaftSessionFromStatuses(a,e.agentId||null);break}case"yeaft_dream_snapshot":{let a=r&&r.snapshot,l=a&&typeof a.scope=="string"?a.scope:null;l&&(this.yeaftDreamSnapshots={...this.yeaftDreamSnapshots,[l]:{...a,receivedAt:Date.now()}});break}case"yeaft_dream_status":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&a.applyDreamStatus(r);break}case"yeaft_dream_result":{let a=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();a&&a.applyDreamResult(r),r?.snapshot?.scope&&(this.yeaftDreamSnapshots={...this.yeaftDreamSnapshots,[r.snapshot.scope]:{...r.snapshot,receivedAt:Date.now()}});{let l=typeof r?.snapshot?.scope=="string"&&r.snapshot.scope?r.snapshot.scope:typeof r?.sessionId=="string"&&r.sessionId?`sessions/${r.sessionId}`:null;if(!l)break;let c=this.yeaftDreamLatest[l]||null;this.yeaftDreamLatest={...this.yeaftDreamLatest,[l]:{scope:l,phase:"result",status:r.skipped?"skipped":r.success?"success":"error",startedAt:c?.startedAt??null,finishedAt:Date.now(),mergedCount:typeof r.entriesCreated=="number"?r.entriesCreated:c?.mergedCount??null,error:r.skipped||r.success?null:r.error||"unknown",manual:typeof r?.manual=="boolean"?r.manual:c?.manual??null,durationMs:typeof r.durationMs=="number"?r.durationMs:c?.durationMs??null,llmCallCount:typeof r.llmCallCount=="number"?r.llmCallCount:c?.llmCallCount??0,inputTokens:typeof r.inputTokens=="number"?r.inputTokens:c?.inputTokens??0,outputTokens:typeof r.outputTokens=="number"?r.outputTokens:c?.outputTokens??0,totalTokens:typeof r.totalTokens=="number"?r.totalTokens:c?.totalTokens??0,metrics:r.metrics||c?.metrics||null,passBreakdown:r.passBreakdown||r.metrics?.passBreakdown||c?.passBreakdown||null,isRunning:!1}},this._appendDreamEvent(l,{type:"dream_progress",phase:"result",sessionId:r.sessionId,status:r.skipped?"skipped":r.success?"success":"error",success:!!r.success,entriesCreated:typeof r.entriesCreated=="number"?r.entriesCreated:null,trigger:r.trigger||null,error:r.skipped||r.success?null:r.error||null,skipped:!!r.skipped,skippedReason:r.skippedReason||null,durationMs:typeof r.durationMs=="number"?r.durationMs:null,llmCallCount:typeof r.llmCallCount=="number"?r.llmCallCount:0,inputTokens:typeof r.inputTokens=="number"?r.inputTokens:0,outputTokens:typeof r.outputTokens=="number"?r.outputTokens:0,totalTokens:typeof r.totalTokens=="number"?r.totalTokens:0,metrics:r.metrics||null,passBreakdown:r.passBreakdown||r.metrics?.passBreakdown||null,ts:Date.now()})}break}case"dream_progress":{let a=r?.phase||"unknown",l=null;typeof r?.target=="string"&&r.target.includes("/")?l=r.target:typeof r?.sessionId=="string"&&r.sessionId?l=`sessions/${r.sessionId}`:l="*";let c=a==="done",d=a==="error"||r?.status==="error",u=!c&&!d,f=p=>{let g=this.yeaftDreamLatest[p]||null;return{scope:p,phase:a,status:d?"error":c?"success":"running",startedAt:g?.startedAt&&u?g.startedAt:r?.ts||g?.startedAt||Date.now(),finishedAt:c||d?r?.ts||Date.now():null,mergedCount:typeof r?.mergedCount=="number"?r.mergedCount:typeof r?.targets=="number"?r.targets:g?.mergedCount??null,error:d?r?.error||"unknown":null,manual:typeof r?.manual=="boolean"?r.manual:g?.manual??!1,durationMs:typeof r?.duration=="number"?r.duration:typeof r?.durationMs=="number"?r.durationMs:g?.durationMs??null,llmCallCount:typeof r?.llmCallCount=="number"?r.llmCallCount:g?.llmCallCount??0,inputTokens:typeof r?.inputTokens=="number"?r.inputTokens:g?.inputTokens??0,outputTokens:typeof r?.outputTokens=="number"?r.outputTokens:g?.outputTokens??0,totalTokens:typeof r?.totalTokens=="number"?r.totalTokens:g?.totalTokens??0,metrics:r?.metrics||g?.metrics||null,passBreakdown:r?.passBreakdown||r?.metrics?.passBreakdown||g?.passBreakdown||null,isRunning:u}};if(l==="*"){let p={...this.yeaftDreamLatest,"*":f("*")};for(let g of Object.keys(this.yeaftDreamLatest))g!=="*"&&(p[g]=f(g));this.yeaftDreamLatest=p}else this.yeaftDreamLatest={...this.yeaftDreamLatest,[l]:f(l)};this._appendDreamEvent(l,r);break}}},_appendDreamEvent(e,t){if(!e||!t)return;let s=Date.now(),n={...t,at:s},r=Array.isArray(this.yeaftDreamEvents?.[e])?this.yeaftDreamEvents[e]:[],i=l=>[l?.type||"",l?.phase||"",(l?.sessionId??l?.groupId)||"",l?.target||"",l?.ts||l?.at||""].join("|"),o=i(n);if(r.some(l=>i(l)===o))return;let a=[...r,n];a.length>Ou&&a.splice(0,a.length-Ou),this.yeaftDreamEvents={...this.yeaftDreamEvents,[e]:a}},fetchExpertRoleDefinitions(){if(this.expertRoleDefinitions)return;let e=this.currentAgent;e&&this.sendWsMessage({type:"get_expert_roles",agentId:e})},setYeaftSidebarEnabled(e){try{typeof localStorage<"u"&&localStorage.removeItem("yeaft-sidebar-enabled")}catch{}},vpCrudRequest(e,t){(!this._vpCrudPending||typeof this._vpCrudPending.get!="function")&&(this._vpCrudPending=new Map);let s="vpc_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,8),r={create:"yeaft_vp_create",update:"yeaft_vp_update",delete:"yeaft_vp_delete",read:"yeaft_vp_read"}[e];if(!r)return Promise.resolve({ok:!1,op:e,error:{code:"bad_op",message:"unknown op: "+e}});let i={type:r,requestId:s};return e==="create"||e==="update"?i.payload=t||{}:i.vpId=t,new Promise(o=>{let a=setTimeout(()=>{this._vpCrudPending&&this._vpCrudPending.has(s)&&(this._vpCrudPending.delete(s),o({ok:!1,op:e,error:{code:"timeout",message:"vp_crud timeout"}}))},1e4);this._vpCrudPending.set(s,{resolve:l=>{clearTimeout(a),o(l)}}),this.sendWsMessage(i)})},sessionCrudRequest(e,t,s={}){(!this._sessionCrudPending||typeof this._sessionCrudPending.get!="function")&&(this._sessionCrudPending=new Map);let n="grc_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,8),i={list:"yeaft_list_sessions",create:"yeaft_create_session",rename:"yeaft_rename_session",update:"yeaft_update_session",update_config:"yeaft_update_session_config",archive:"yeaft_archive_session",delete:"yeaft_delete_session",add_member:"yeaft_session_add_member",remove_member:"yeaft_session_remove_member",set_default_vp:"yeaft_session_set_default_vp",reorder:"reorder_yeaft_sessions",scan_workdir:"yeaft_scan_workdir_sessions",restore:"yeaft_restore_session"}[e];if(!i)return Promise.resolve({ok:!1,op:e,error:{code:"bad_op",message:"unknown op: "+e}});let o={type:i,requestId:n};e==="create"?o.payload=t||{}:t&&typeof t=="object"&&Object.assign(o,t);let a=s&&s.agentId?s.agentId:null;a&&(o.agentId=a);let l=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();return l&&l.markPending(n,e),new Promise(c=>{let d=setTimeout(()=>{this._sessionCrudPending&&this._sessionCrudPending.has(n)&&(this._sessionCrudPending.delete(n),c({ok:!1,op:e,error:{code:"timeout",message:"group_crud timeout"}}))},1e4);this._sessionCrudPending.set(n,{resolve:u=>{clearTimeout(d),c(u)}}),this.sendWsMessage(o)})},markYeaftSessionUnread(e,t=null){if(!e)return!1;let s=Se(this,e,t);if(!s)return!1;let n=Hr(s,e);return this.currentView==="yeaft"&&this.yeaftActiveSessionFilter===e&&Se(this,e)===s||this.yeaftUnreadSessionKeys?.[n]?!1:(this.yeaftUnreadSessionKeys={...this.yeaftUnreadSessionKeys,[n]:!0},!0)},markYeaftSessionRead(e,t=null){if(!e)return!1;let s=Se(this,e,t);if(!s)return!1;let n=Hr(s,e);if(!this.yeaftUnreadSessionKeys?.[n])return!1;let{[n]:r,...i}=this.yeaftUnreadSessionKeys;return this.yeaftUnreadSessionKeys=i,!0},restoreActiveYeaftSessionFromStatuses(e=[],t=null){if(this.yeaftActiveSessionFilter)return null;let n=(Array.isArray(e)?e:[]).filter(o=>o&&(o.sessionId||o.groupId)&&!["idle","offline","completed","failed","aborted"].includes(o.state)).sort((o,a)=>(a.updatedAt||a.since||0)-(o.updatedAt||o.since||0)),r=n[0]?.sessionId||n[0]?.groupId||null;if(!r)return null;let i=t||n[0]?.agentId||Fu(this,r);if(!i)return null;this.setActiveSessionFilter(r,{agentId:i,force:!0});try{let o=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();o&&typeof o.setActive=="function"&&o.setActive(r,i)}catch{}return r},setActiveSessionFilter(e,t={}){let s=this.yeaftActiveSessionFilter||null,n=e||null,r=n?Se(this,n,t.agentId||null):this.currentAgent,i=!!n&&n===s&&!!r&&!!this.currentAgent&&r!==this.currentAgent,o=!!t.force||i;if(this.yeaftActiveSessionFilter=n,r&&n&&this.currentAgent!==r){this.selectAgent(r);let c=this.agents.find(d=>d.id===r);this.activateYeaftAgent(r,c||null)}else r&&n&&this.activateYeaftAgent(r);if(r&&n&&(this.markYeaftSessionRead(n,r),Yc(this,r,n)),!o&&n===s)return;let a=ke(r,n),l=this.yeaftSessionHistoryState[a]||null;if(this.pruneYeaftMessageWindow(n),r&&n){this.yeaftSessionAgentById={...this.yeaftSessionAgentById||{},[n]:r};let c=this.yeaftConversationIdsByAgent?.[r]||null;c||(c=`yeaft-local-${r}-${Date.now()}`,this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[r]:c}),this.yeaftConversationId=c,this.messagesMap[c]||(this.messagesMap[c]=[]),this.currentView==="yeaft"&&(this.activeConversations=[c])}try{let c=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();c&&typeof c.setActive=="function"&&c.setActive(n,r||null);let d=c?.activeSessionKey||null;d?localStorage.setItem("lastViewedYeaftSession",d):localStorage.removeItem("lastViewedYeaftSession")}catch{}if(this.syncActiveYeaftHistoryLoad(),!l?.loading&&r&&n){let c=Number.isFinite(l?.latestSeq)?l.latestSeq:null,d={type:"yeaft_load_history",agentId:r,sessionId:n},u=!!l?.loaded,f=Oo({sessionState:l,hasCachedSessionRows:!1,force:o});if(!f&&c!==null?d.afterSeq=c:d.limit=ti,!f&&u&&c===null){this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...l||{hasMore:!1,oldestSeq:null,count:0},loaded:!0,loading:!1,syncingAfterSeq:null}},this.syncActiveYeaftHistoryLoad();return}let p=null;if(!f&&u){if(l?.syncingAfterSeq===c)return;p=this.beginYeaftHistoryLoad({agentId:r,sessionId:n,mode:"delta",preserveLoaded:!0,latestSeq:c}),this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...this.yeaftSessionHistoryState[a],syncingAfterSeq:c}}}else p=this.beginYeaftHistoryLoad({agentId:r,sessionId:n,mode:"recent",preserveLoaded:!1,latestSeq:f?null:c});p&&(d.requestId=p.requestId),this.sendWsMessage(d)}},async switchYeaftModel(e,t=null,s=void 0){if(!e||!this.currentAgent)return;let n=t||null;if(n){let r={model:e};return s!==void 0&&(r.modelEffort=s||null),await this.sessionCrudRequest("update_config",{sessionId:n,config:r},{agentId:Se(this,n)})}return this.sendWsMessage({type:"yeaft_model_switch",model:e,modelEffort:s||null,agentId:this.currentAgent}),null},setYeaftDebugSearch(e){this.yeaftDebugSearch=typeof e=="string"?e:"",this._yeaftDebugSearchTimer&&clearTimeout(this._yeaftDebugSearchTimer),this._yeaftDebugSearchTimer=setTimeout(()=>{this._yeaftDebugSearchTimer=null,this.yeaftDebugLoops=[],this.yeaftDebugTurnsById={},this.yeaftDebugTurnOrder=[],this.loadYeaftDebugHistory({limit:this.yeaftDebugSearch.trim()?Hu:Ra,dreamLimit:5,indexOnly:!0,search:this.yeaftDebugSearch})},250)},setYeaftDebugSessionFilter(e){e==null?this.yeaftDebugSessionFilter=null:this.yeaftDebugSessionFilter=String(e)},toggleSubAgentCardExpand(e){let t=this.yeaftSubAgentCards?.[e];t&&(this.yeaftSubAgentCards={...this.yeaftSubAgentCards,[e]:{...t,expanded:!t.expanded}})},loadTelemetrySettings(){return this.currentAgent?new Promise(e=>{this._telemetryPending||(this._telemetryPending={}),this._telemetryPending.load=e,this.sendWsMessage({type:"get_telemetry_settings",agentId:this.currentAgent})}):(this.telemetrySettings={enabled:!0,retentionDays:3,flushIntervalMs:1e3,maxQueueSize:5e3,rawExchangeMaxBytes:524288,traceTextMaxBytes:262144,loaded:!0},Promise.resolve(this.telemetrySettings))},updateTelemetrySettings(e){return this.currentAgent?new Promise(t=>{this._telemetryPending||(this._telemetryPending={}),this._telemetryPending.update=t,this.sendWsMessage({type:"update_telemetry_settings",agentId:this.currentAgent,settings:e||{}})}):Promise.resolve({error:"no agent"})},loadSearchSettings(){return this.currentAgent?new Promise(e=>{this._searchPending||(this._searchPending={}),this._searchPending.load=e,this.sendWsMessage({type:"get_search_settings",agentId:this.currentAgent})}):(this.searchSettings={backend:"tavily",tavilyKeyConfigured:!1,tavilyKeyMasked:null,disableHtmlFallback:!1,loaded:!0},Promise.resolve(this.searchSettings))},updateSearchSettings(e){return this.currentAgent?new Promise(t=>{this._searchPending||(this._searchPending={}),this._searchPending.update=t,this.sendWsMessage({type:"update_search_settings",agentId:this.currentAgent,settings:e||{}})}):Promise.resolve({error:"no agent"})},loadTavilyUsage(){return this.currentAgent?(this.tavilyUsageLoading=!0,new Promise(e=>{this._searchPending||(this._searchPending={}),this._searchPending.usage=e,this.sendWsMessage({type:"get_tavily_usage",agentId:this.currentAgent})})):Promise.resolve(null)},loadYeaftMcpServers(){if(!this.currentAgent)return this.yeaftMcpServers=[],this.yeaftMcpRuntime={connected:!1,toolCount:0,perServer:[]},Promise.resolve({servers:[],runtime:this.yeaftMcpRuntime});this.yeaftMcpLoading=!0;let e=`mcp-list-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return new Promise(t=>{this._mcpPending||(this._mcpPending={}),this._mcpPending[e]=t,this.sendWsMessage({type:"yeaft_mcp_list",agentId:this.currentAgent,requestId:e})})},addYeaftMcpServer(e){if(!this.currentAgent)return Promise.resolve({error:"no agent"});this.yeaftMcpLoading=!0;let t=`mcp-add-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return new Promise(s=>{this._mcpPending||(this._mcpPending={}),this._mcpPending[t]=s,this.sendWsMessage({type:"yeaft_mcp_add",agentId:this.currentAgent,requestId:t,server:e||{}})})},removeYeaftMcpServer(e){if(!this.currentAgent)return Promise.resolve({error:"no agent"});this.yeaftMcpLoading=!0;let t=`mcp-rem-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return new Promise(s=>{this._mcpPending||(this._mcpPending={}),this._mcpPending[t]=s,this.sendWsMessage({type:"yeaft_mcp_remove",agentId:this.currentAgent,requestId:t,name:e})})},reloadYeaftMcpServer(e){if(!this.currentAgent)return Promise.resolve({error:"no agent"});this.yeaftMcpLoading=!0;let t=`mcp-rel-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return new Promise(s=>{this._mcpPending||(this._mcpPending={}),this._mcpPending[t]=s,this.sendWsMessage({type:"yeaft_mcp_reload",agentId:this.currentAgent,requestId:t,name:e||null})})},clearYeaftMessages(){let e=this.yeaftConversationId;e&&(Ae(this,e),delete this.messagesMap[e],delete this.processingConversations[e],delete this.executionStatusMap[e],delete this.refreshingSessionMap[e],this._closedAt&&delete this._closedAt[e],this._turnCompletedConvs?.delete(e)),this.yeaftConversationId=this.currentAgent?`yeaft-local-${this.currentAgent}-${Date.now()}`:`yeaft-local-${Date.now()}`,this.currentAgent&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[this.currentAgent]:this.yeaftConversationId}),this.messagesMap[this.yeaftConversationId]=[],this.activeConversations=[this.yeaftConversationId],this.yeaftSessionReady=!1,this.yeaftModel=null,this.yeaftAvailableModels=[],this.yeaftStatus=null,this._yeaftAskTerminalEvents={},this.yeaftDebugLoops=[],this.yeaftDebugTurnsById={},this.yeaftDebugTurnOrder=[],this.yeaftDebugHistoryLoading=!1,this.yeaftDebugHistoryError=null,this.yeaftDebugHistoryFetchedAt=0,this.yeaftDebugSearch="",this.yeaftDebugSessionFilter=null,this._yeaftDebugSearchTimer&&(clearTimeout(this._yeaftDebugSearchTimer),this._yeaftDebugSearchTimer=null),this._fetchYeaftDebugHistoryTimer&&(clearTimeout(this._fetchYeaftDebugHistoryTimer),this._fetchYeaftDebugHistoryTimer=null),this._yeaftDebugHistoryInFlightKey=null,this._yeaftDebugHistoryLatestListRequestId=null,this._yeaftDebugHistoryLatestDetailRequestId=null,this.yeaftReflectionCards={},this.yeaftSubAgentCards={},this.yeaftDreamLatest={},this.yeaftDreamEvents={},this.vpStatuses={},this.currentAgent&&this.sendWsMessage({type:"yeaft_reset",agentId:this.currentAgent})},togglePaneRightPanel(e,t=null){if(t&&this.isSplitMode){let s=this.panels.find(n=>n.id===t);if(s){s.activeRightPanel=s.activeRightPanel===e?null:e;return}}this.activeRightPanel=this.activeRightPanel===e?null:e},getPaneRightPanel(e){if(e&&this.isSplitMode){let t=this.panels.find(s=>s.id===e);if(t)return t.activeRightPanel}return this.activeRightPanel},setPaneRightPanel(e,t){if(e&&this.isSplitMode){let s=this.panels.find(n=>n.id===e);if(s){s.activeRightPanel=t;return}}this.activeRightPanel=t},applySessionCatalogSnapshot(e,t=null,s=null){let n=r=>{let i=new Set;return(Array.isArray(r)?r:[]).filter(o=>!o?.catalogKey||i.has(o.catalogKey)?!1:(i.add(o.catalogKey),!0)).map(o=>({...o}))};if(this.sessionCatalog=n(e),Array.isArray(s)&&(this.hiddenSessionCatalog=n(s)),Array.isArray(t)){this.sessionProjects=t.filter(i=>i?.id).map(i=>({...i,members:Array.isArray(i.members)?i.members.filter(o=>o?.agentId&&o?.sessionId):i.agentId?(i.sessionIds||[]).map(o=>({agentId:i.agentId,sessionId:o})):[]}));let r=new Map;for(let i of this.sessionProjects)for(let o of i.members)r.set(`${o.agentId}${o.sessionId}`,i.id);this.sessionCatalog=this.sessionCatalog.map(i=>i.runtimeProvider==="yeaft"?{...i,projectId:r.get(`${i.routeRef?.agentId}${i.routeRef?.sessionId}`)||null}:i)}this.sessionCatalogLoaded=!0},mutateProject(e,t={},s=null){let n=s||t.agentId||this.currentAgent||null;if(e==="move_session"&&!n)return Promise.resolve({ok:!1,error:{code:"missing_agent"}});let r=`project_${crypto.randomUUID()}`;return new Promise(i=>{let o=setTimeout(()=>{delete this.projectMutationRequests[r],i({ok:!1,error:{code:"timeout"}})},1e4);this.projectMutationRequests[r]={connectionGeneration:Number(this.chatHistoryConnectionGeneration||0),catalogOrder:Array.isArray(t.catalogOrder)?t.catalogOrder:null,resolve:l=>{clearTimeout(o),i(l)}},this.sendWsMessage({type:"yeaft_project_mutation",...n?{agentId:n,targetAgentId:n}:{},requestId:r,op:e,...t})||(clearTimeout(o),delete this.projectMutationRequests[r],i({ok:!1,error:{code:"send_failed"}}))})},applyLegacyProjectSnapshot(e,t){if(!t||!Array.isArray(e))return;let s=this.sessionProjects.filter(r=>r.legacyAgentId!==t),n=e.filter(r=>r?.id).map(r=>({...r,id:`${t}${r.id}`,legacyProjectId:r.id,legacyAgentId:t,members:(r.sessionIds||[]).map(i=>({agentId:t,sessionId:i}))}));this.applySessionCatalogSnapshot(this.sessionCatalog,[...s,...n])},finishLegacyProjectMutation(e,t){if(!e?.requestId)return!1;let s=this.projectMutationRequests[e.requestId]||null;return!s||s.connectionGeneration!==Number(this.chatHistoryConnectionGeneration||0)?!1:(delete this.projectMutationRequests[e.requestId],e.ok&&Array.isArray(e.projects)&&t&&this.applyLegacyProjectSnapshot(e.projects,t),s.resolve(e),!0)},finishProjectMutation(e){if(!e?.requestId)return!1;let t=this.projectMutationRequests[e.requestId]||null;if(!t||t.connectionGeneration!==Number(this.chatHistoryConnectionGeneration||0))return!1;if(delete this.projectMutationRequests[e.requestId],e.ok){if(Array.isArray(t.catalogOrder)){let s=new Map(this.sessionCatalog.map(r=>[r.catalogKey,r])),n=t.catalogOrder.map((r,i)=>{let o=s.get(r?.catalogKey);return o?{...o,sortRank:i}:null}).filter(Boolean);n.length===this.sessionCatalog.length&&(this.sessionCatalog=n,Du(n))}Array.isArray(e.projects)&&this.applySessionCatalogSnapshot(this.sessionCatalog,e.projects)}return t.resolve(e),!0},toggleCatalogSessionPin(e){if(!e?.catalogKey||!e?.routeRef||Object.keys(this.sessionCatalogMutationRequests).length>0)return!1;let t=`session_ui_${crypto.randomUUID()}`,s=_n(this,t),n=!e.pinned;return e.pinned=n,this.sendWsMessage({type:"set_session_ui_metadata",requestId:t,catalogKey:e.catalogKey,routeRef:e.routeRef,pinned:n,sortRank:Number.isFinite(e.sortRank)?e.sortRank:null})?!0:(this.sessionCatalog=s,delete this.sessionCatalogMutationRequests[t],!1)},hideCatalogSession(e){if(!e?.catalogKey||!e?.routeRef||Object.keys(this.sessionCatalogMutationRequests).length>0)return!1;let t=`session_hide_${crypto.randomUUID()}`,s=_n(this,t);return this.sessionCatalog=this.sessionCatalog.filter(r=>r.catalogKey!==e.catalogKey),this.hiddenSessionCatalog=[...(this.hiddenSessionCatalog||[]).filter(r=>r.catalogKey!==e.catalogKey),{...e,hidden:!0}],this.sendWsMessage({type:"set_session_ui_metadata",requestId:t,catalogKey:e.catalogKey,routeRef:e.routeRef,hidden:!0,...Number.isFinite(e.sortRank)?{sortRank:e.sortRank}:{}})?!0:(this.sessionCatalog=s,this.hiddenSessionCatalog=Array.isArray(this.sessionCatalogMutationRequests[t]?.previousHiddenCatalog)?this.sessionCatalogMutationRequests[t].previousHiddenCatalog:[],delete this.sessionCatalogMutationRequests[t],!1)},restoreCatalogSession(e){if(!e?.catalogKey||!e?.routeRef||Object.keys(this.sessionCatalogMutationRequests).length>0)return!1;let t=`session_restore_${crypto.randomUUID()}`,s=_n(this,t);return this.hiddenSessionCatalog=(this.hiddenSessionCatalog||[]).filter(r=>r.catalogKey!==e.catalogKey),this.sessionCatalog=this.sessionCatalog.some(r=>r.catalogKey===e.catalogKey)?this.sessionCatalog:[...this.sessionCatalog,{...e,hidden:!1}],this.sendWsMessage({type:"set_session_ui_metadata",requestId:t,catalogKey:e.catalogKey,routeRef:e.routeRef,hidden:!1,...Number.isFinite(e.sortRank)?{sortRank:e.sortRank}:{}})?!0:(this.sessionCatalog=s,this.hiddenSessionCatalog=Array.isArray(this.sessionCatalogMutationRequests[t]?.previousHiddenCatalog)?this.sessionCatalogMutationRequests[t].previousHiddenCatalog:[],delete this.sessionCatalogMutationRequests[t],!1)},renameCatalogSession({row:e,title:t}={}){if(!e?.routeRef||!t)return!1;let{runtimeProvider:s,agentId:n,sessionId:r}=e.routeRef;if(s==="yeaft")this.sessionCrudRequest("rename",{sessionId:r,name:t},{agentId:n});else if(s==="claude-code"||s==="copilot")this.renameChatSession(r,t,n);else return!1;return!0},reorderCatalogSessions(e){if(!Array.isArray(e)||e.length===0||Object.keys(this.sessionCatalogMutationRequests).length>0)return!1;let t=`session_order_${crypto.randomUUID()}`,s=_n(this,t);return this.sessionCatalog=e.map((r,i)=>({...r,sortRank:i})),this.sendWsMessage({type:"reorder_session_catalog",requestId:t,sessions:this.sessionCatalog.map((r,i)=>({catalogKey:r.catalogKey,routeRef:r.routeRef,pinned:!!r.pinned,sortRank:i}))})?!0:(this.sessionCatalog=s,delete this.sessionCatalogMutationRequests[t],!1)},finishSessionCatalogMutation(e){if(!tc(this,e))return!1;if(e?.ok===!0&&e?.type==="session_ui_metadata_updated"){let s=n=>{n&&(n.pinned=e.pinned===!0,Object.prototype.hasOwnProperty.call(e,"sortRank")&&(n.sortRank=Number.isFinite(e.sortRank)?e.sortRank:null))};s(this.sessionCatalog.find(n=>n.catalogKey===e.catalogKey)),s(this.hiddenSessionCatalog.find(n=>n.catalogKey===e.catalogKey))}return e?.ok===!0&&e?.type==="session_catalog_reorder_result"&&Du(this.sessionCatalog),!0},openCatalogSession(e){if(!e?.catalogKey||!e.routeRef)return!1;let{runtimeProvider:t,agentId:s,sessionId:n}=e.routeRef;if(this.activeCatalogKey=e.catalogKey,t==="yeaft"){let r=this.isSessionHistorySyncing(e.routeRef);return this.enterYeaft(s,{deferBootstrap:!0}),this.setActiveSessionFilter(n,{agentId:s,force:!1}),r||this.reloadYeaftMessages(),!0}return t!=="claude-code"&&t!=="copilot"?!1:(this.currentView==="yeaft"&&this.leaveYeaft(),this.selectConversation(n,s,{refresh:!0}),!0)},syncChatConversationHistory(e){if(!e)return null;let t=zt(e);if(this.chatHistoryRequests[t]?.loading)return this.chatHistoryRequests[t].requestId;let s=ps(this.messagesMap[e]);return this.requestChatHistory(e,s===null?{mode:"recent",turns:5}:{mode:"delta",afterMessageId:s})},requestChatHistory(e,{mode:t="recent",turns:s=null,beforeId:n=null,afterMessageId:r=null}={}){if(!e)return null;let i=zt(e);if(this.chatHistoryRequestIdSupported!==!0&&this.chatHistoryRequests[i]?.loading)return null;let o=n??r??null,a=this.beginChatHistoryRequest(e,t,o);return this.sendWsMessage({type:"sync_messages",conversationId:e,...s!=null?{turns:s}:{},...n!=null?{beforeId:n}:{},...r!=null?{afterMessageId:r}:{},requestId:a})?(this.sessionHistorySyncRefreshToken+=1,setTimeout(()=>{To(this,i,a,"history_load_timeout")&&(this.sessionHistorySyncRefreshToken+=1)},1e4),a):(To(this,i,a,"send_failed"),this.sessionHistorySyncRefreshToken+=1,null)},beginChatHistoryRequest(e,t="recent",s=null){return sc(this,e,t,s)},isCurrentChatHistoryResponse(e){if(!e?.conversationId||!e?.requestId||!e?.catalogKey)return!1;let t=zt(e.conversationId);if(e.catalogKey!==t)return!1;let s=this.chatHistoryRequests[t];return!!s&&s.loading===!0&&s.requestId===e.requestId&&Number(s.connectionGeneration||0)===Number(this.chatHistoryConnectionGeneration||0)},finishChatHistoryRequest(e){if(!this.isCurrentChatHistoryResponse(e))return!1;let t=this.chatHistoryRequests[e.catalogKey];return this.chatHistoryRequests[e.catalogKey]={...t,loading:!1},this.sessionHistorySyncRefreshToken+=1,!0},isRefreshingSession(e){return e?!!this.refreshingSessionMap[e]:this.refreshingSession},setRefreshingSession(e,t){e&&(this.refreshingSessionMap[e]=t),this.refreshingSession=t},enterBtwMode(){this.btwMode=!0,this.btwMessages=[],this.btwLoading=!1,this.btwSessionId=null},sendBtwQuestion(e){this.currentConversation&&(this.btwMessages.push({role:"user",content:e}),this.btwMessages.push({role:"assistant",content:""}),this.btwLoading=!0,this.sendWsMessage({type:"btw_question",conversationId:this.currentConversation,question:e,btwSessionId:this.btwSessionId}))},closeBtw(){this.btwMode=!1,this.btwMessages=[],this.btwLoading=!1,this.btwSessionId=null},appendBtwDelta(e){let t=this.btwMessages[this.btwMessages.length-1];t&&t.role==="assistant"&&(t.content+=e)},addSubagent(e,t){this.subagents[e]||(this.subagents[e]={}),this.subagents[e][t.id]={id:t.id,slug:t.slug||t.id,type:t.type||"Task",description:t.description||"",parentToolUseId:t.parentToolUseId||null,status:"running",startTime:Date.now(),messages:[],toolCallCount:0},e===this.currentConversation&&this.activeRightPanel!=="subagents"&&(this.activeRightPanel="subagents")},appendSubagentMessage(e,t,s){let n=this.subagents[e];if(!n||!n[t])return;let r=n[t];if(s?.type==="tool"){r.toolCallCount=Number(r.toolCallCount||0)+1;return}s?.type==="text"&&r.messages.push(s)},completeSubagent(e,t){let s=this.subagents[e];!s||!s[t]||(s[t].status="completed")},sendWsMessage(e){return wc(this,e)},parseWsMessage(e){return kc(this,e)},connect(){Sc(this)},ensureConnected(){return Ln(this)},scheduleReconnect(){Ic(this)},manualReconnect(){Cc(this)},startHeartbeat(){Ac(this)},stopHeartbeat(){xc(this)},setupVisibilityHandler(){Tc(this)},handleMessage(e){Cd(this,e)},getOrCreateExecutionStatus(e){return oa(this,e)},handleAssistantOutputFrame(e,t,s=null){fd(this,e,t,s)},handleClaudeOutput(e,t){this.handleAssistantOutputFrame(e,t,null)},addMessageToConversation(e,t){return Fr(this,e,t)},appendToAssistantMessageForConversation(e,t,s){$c(this,e,t,s)},finishStreamingForConversation(e,t){Vc(this,e,t)},sweepStaleStreamingForConversation(e){Hc(this,e)},appendToAssistantMessage(e){this.appendToAssistantMessageForConversation(this.currentConversation,e)},finishStreaming(){this.finishStreamingForConversation(this.currentConversation)},addMessage(e){this.addMessageToConversation(this.currentConversation,e)},loadHistoryMessages(e){Oc(this,e)},formatDbMessage(e){return Fo(e)},formatDbMessageForHistoryHydration(e){return Nc(e)},selectAgent(e){return Ed(this,e)},createConversation(e,t=null,s=null,n=void 0){Dd(this,e,t,s,n)},resumeConversation(e,t,s=null,n=null,r=null){Ld(this,e,t,s,n,r)},selectConversation(e,t,s={}){$d(this,e,t,s)},updateConversationSettings(e,t){pa(this,e,t)},toggleConversationMcp(e,t){Vd(this,e,t)},deleteConversation(e,t){Od(this,e,t)},closeSession(e,t){Hd(this,e,t)},appendColumn(e){qd(this,e)},removeColumn(e){Wd(this,e)},sendMessageToConversation(e,t,s=[],n={}){jd(this,e,t,s,n)},cancelExecutionForConversation(e){Ud(this,e)},addPanel(){if(this.panels.length>=3)return;let e=(t,s)=>({id:t,conversationId:s,activeRightPanel:null});if(this.panels.length===0){let t=localStorage.getItem("splitPanesSaved");if(t){try{let s=JSON.parse(t);if(Array.isArray(s)&&s.length>=2){let n=new Set(this.conversations.map(i=>i.id)),r=s.filter(i=>i&&typeof i.id=="string").map(i=>({...e(i.id,null),conversationId:i.conversationId&&n.has(i.conversationId)?i.conversationId:null}));if(r.length>=2){this.panels=r,this.activePanelId=r[0].id;for(let i of r)i.conversationId&&!this.activeConversations.includes(i.conversationId)&&this.activeConversations.push(i.conversationId),i.conversationId&&!this.messagesMap[i.conversationId]&&(this.messagesMap[i.conversationId]=[],this.requestChatHistory(i.conversationId,{mode:"recent",turns:5}));localStorage.removeItem("splitPanesSaved"),this.saveOpenSessions();return}}}catch{}localStorage.removeItem("splitPanesSaved")}this.panels=[e("panel-0",this.currentConversation),e("panel-1",null)],this.activePanelId="panel-0"}else{let t="panel-"+Date.now();this.panels.push(e(t,null))}this.saveOpenSessions()},removePanel(e){let t=this.panels.findIndex(s=>s.id===e);if(!(t<0)){if(this.panels.splice(t,1),this.panels.length<=1){let s=this.panels[0];s?.conversationId&&(this.activeConversations=[s.conversationId]),this.panels=[],this.activePanelId=null}else this.activePanelId===e&&(this.activePanelId=this.panels[0]?.id||null);this.saveOpenSessions()}},setPanelConversation(e,t,{refresh:s=!1}={}){let n=this.panels.find(i=>i.id===e);if(!n)return;let r=n.conversationId===t;n.conversationId=t,t&&!this.activeConversations.includes(t)&&this.activeConversations.push(t),t&&!this.messagesMap[t]?(this.messagesMap[t]=[],this.syncChatConversationHistory(t)):t&&(s||!r)&&this.syncChatConversationHistory(t),this.saveOpenSessions()},setActivePanel(e){this.activePanelId=e},splitToPanel(e){if(!e)return;let t=(s,n)=>({id:s,conversationId:n,activeRightPanel:null});if(this.panels.length===0)this.panels=[t("panel-0",this.currentConversation),t("panel-"+Date.now(),e)],this.activePanelId=this.panels[1].id;else if(this.panels.length>=3)this.panels[this.panels.length-1].conversationId=e,this.activePanelId=this.panels[this.panels.length-1].id;else{let s="panel-"+Date.now();this.panels.push(t(s,e)),this.activePanelId=s}this.activeConversations.includes(e)||this.activeConversations.push(e),this.messagesMap[e]||(this.messagesMap[e]=[],this.requestChatHistory(e,{mode:"recent",turns:5})),this.saveOpenSessions()},isInAnyPanel(e){return this.panels.some(t=>t.conversationId===e)},setSessionPinned(e,t,s={}){if(!e)return;let n=s&&s.agentId?s.agentId:null,r=n?!!Zt()?.sessionById?.(e,n)?.pinned:this.pinnedSessions.includes(e);if(t&&!r)this.pinnedSessions.unshift(e);else if(!t&&r){let i=this.pinnedSessions.indexOf(e);i>=0&&this.pinnedSessions.splice(i,1)}try{localStorage.setItem("pinned-sessions",JSON.stringify(this.pinnedSessions))}catch{}try{let i=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore(),o=Se(this,e,n);i&&typeof i.applyPinState=="function"&&i.applyPinState(e,!!t,o)}catch{}},togglePin(e,t={}){let s=t&&t.agentId?t.agentId:null,n=s?Zt()?.sessionById?.(e,s):null,r=t&&Object.prototype.hasOwnProperty.call(t,"pinned"),o=!(n?!!n.pinned:r?!!t.pinned:this.pinnedSessions.includes(e));this.setSessionPinned(e,o,{agentId:s});let a={type:o?"pin_session":"unpin_session",conversationId:e};t&&t.sessionKind==="yeaft"&&(a.sessionKind="yeaft",t.agentId&&(a.agentId=t.agentId),t.sessionName&&(a.sessionName=t.sessionName),t.workDir&&(a.workDir=t.workDir)),this.sendWsMessage(a)},isSessionPinned(e){return this.pinnedSessions.includes(e)},applyServerPinSnapshot(e,t,s){if(!Array.isArray(this.pinnedSessions))return;let n=new Set(this.pinnedSessions),r=[];for(let i of t)n.has(i)||r.push(i);if(r.length>0&&(this.pinnedSessions=[...r,...this.pinnedSessions]),e){let i=this.pinnedSessions.filter(o=>s(o)?t.has(o):!0);i.length!==this.pinnedSessions.length&&(this.pinnedSessions=i)}try{localStorage.setItem("pinned-sessions",JSON.stringify(this.pinnedSessions))}catch{}},clearYeaftSessionProcessingIfIdle(e,{agentId:t=null,ignoreStatuses:s=!1}={}){if(!e)return;let n=t||Se(this,e);if(Object.values(this.activeVpTurns||{}).some(a=>et(a,e,n))||!s&&Object.values(this.vpStatuses||{}).some(l=>et(l,e,n)&&tr.has(l?.state)))return;let i=mt(n,e),o={...this.yeaftProcessingSessions||{}};i&&delete o[i],ni(this,e,n)&&delete o[e],this.yeaftProcessingSessions=o},sendMessage(e,t=[],s={}){Fd(this,e,t,s)},cancelExecution(){Nd(this)},cancelYeaft(){if(!this.currentAgent)return;this.sendWsMessage({type:"yeaft_abort_all",agentId:this.currentAgent});let e=this.yeaftConversationIdsByAgent?.[this.currentAgent]||this.yeaftConversationId;e&&delete this.processingConversations[e],Tu(this,this.currentAgent)},cancelYeaftSession(e){let t=Se(this,e);!t||!e||(this.sendWsMessage({type:"yeaft_abort_all",agentId:t,sessionId:e}),this.activeVpTurns=Object.fromEntries(Object.entries(this.activeVpTurns||{}).filter(([,s])=>!et(s,e,t))),this.stoppingVpTurnIds=Object.fromEntries(Object.entries(this.stoppingVpTurnIds||{}).filter(([s])=>this.activeVpTurns?.[s])),this.vpStatuses=Object.fromEntries(Object.entries(this.vpStatuses||{}).filter(([,s])=>!et(s,e,t))),this.clearYeaftSessionProcessingIfIdle(e,{agentId:t,ignoreStatuses:!0}))},cancelVpTurn(e,{sessionId:t=null,vpId:s=null}={}){let n=Se(this,t);if(!n||!e)return;let r=Qs(this,n,e);this.stoppingVpTurnIds={...this.stoppingVpTurnIds,[r]:Date.now()};let i={type:"yeaft_abort_turn",agentId:n,turnId:e};t&&(i.sessionId=t),s&&(i.vpId=s),this.sendWsMessage(i)},cancelVpTurnForSession(e,t=null){if(!e)return!1;let s=t||this.yeaftActiveSessionFilter||null;if(!s)return!1;let n=Se(this,s);if(!n)return!1;let r=this.activeVpTurns||{},i=null,o=-1/0;for(let[a,l]of Object.entries(r)){if(!l||l.vpId!==e||!et(l,s,n))continue;let c=typeof l.startedAt=="number"?l.startedAt:0;c>=o&&(o=c,i=a)}if(!i){let a=this.vpStatuses?.[ei(n,s,e)]||null;a?.turnId&&!["idle","offline"].includes(a.state)&&(i=a.turnId)}if(i){let a=r[i]?.turnId||i;return this.cancelVpTurn(a,{sessionId:s,vpId:e}),!0}return this.sendWsMessage({type:"yeaft_abort_turn",agentId:n,sessionId:s,vpId:e}),!0},answerUserQuestion(e,t,s){Bd(this,e,t,s)},refreshAgents(){Kd(this)},refreshConversation(){zd(this)},restartAgent(e){Yd(this,e)},upgradeAgent(e){Gd(this,e)},loadMoreMessages(){if(this.currentView==="yeaft"||this.loadingMoreMessages||!this.hasMoreMessages||!this.currentConversation)return;this.loadingMoreMessages=!0;let e=this._loadMoreGeneration=(this._loadMoreGeneration||0)+1,s=(this.messagesMap[this.currentConversation]||[]).find(i=>i.dbMessageId),n=this.currentConversation,r=s?.dbMessageId??null;this.requestChatHistory(n,{mode:"older",turns:5,beforeId:r}),setTimeout(()=>{this._loadMoreGeneration===e&&this.loadingMoreMessages&&this.currentConversation===n&&(this.loadingMoreMessages=!1)},1e4)},reloadYeaftMessages(){if(this.currentView!=="yeaft")return!1;let e=Is(this),t=Se(this,e);if(!t)return!1;let s=ke(t,e),n=this.yeaftConversationId,r=this.yeaftSessionHistoryState?.[s];if(r?.loading)return r.requestId||!1;let i=this.beginYeaftHistoryLoad({agentId:t,sessionId:e,mode:"recent",preserveLoaded:!1});if(!i)return!1;let o=gs();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[s]:o};let a={type:"yeaft_load_history",agentId:t,limit:ti,sessionId:e,requestId:i.requestId,perfTraceId:o};return Ge(this,{traceId:o,phase:"history.request_send",agentId:t,sessionId:e,messageType:a.type,bytes:JSON.stringify(a).length,detail:{mode:"manual-reload",limit:ti}}),this.sendWsMessage(a)?!0:(Go(this,{agentId:t,sessionId:e,requestId:i.requestId,error:"history_load_send_failed"})&&(this.sessionHistorySyncRefreshToken+=1),!1)},loadMoreYeaftHistory(e=Jn()){if(this.currentView!=="yeaft"||this.yeaftLoadingMoreHistory||!this.yeaftHasMoreHistory)return;let t=Is(this),s=Se(this,t);if(!s)return;let n=Math.min(50,Math.max(1,Number.isFinite(e)?Math.floor(e):Jn())),r=ke(s,t),i=this.yeaftHistoryCacheState?.[r]?.ranges||[],o=this.yeaftSessionHistoryState?.[r]||{},a=Number(this.yeaftHistoryCacheState?.[r]?.rangeEpoch)||0,l=Qc(o,i,a);if(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState||{},[r]:l.state},!l.request){this.syncActiveYeaftHistoryLoad();return}let c=this.beginYeaftHistoryLoad({agentId:s,sessionId:t,mode:"older",preserveLoaded:!0,latestSeq:this.yeaftSessionHistoryState[r]?.latestSeq??null});if(!c)return;let d=gs();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[r]:d};let u={type:"yeaft_load_more_history",agentId:s,sessionId:t,requestId:c.requestId,beforeSeq:l.request.beforeSeq,pageKind:l.request.kind,gapStopAtSeq:l.request.stopAtSeq,cacheEpoch:l.request.cacheEpoch,turns:n,perfTraceId:d};Ge(this,{traceId:d,phase:"history_more.request_send",agentId:s,sessionId:t,messageType:u.type,bytes:JSON.stringify(u).length,detail:{beforeSeq:u.beforeSeq,turns:u.turns,pageKind:l.request.kind,gapStopAtSeq:l.request.stopAtSeq}}),this.sendWsMessage(u)},checkPendingRecovery(){nc(this)},performRecovery(){rc(this)},dismissRecovery(){ic(this)},autoRestoreConversation(e){oc(this,e)},saveOpenSessions(){ds(this)},getLastSession(){return lc(this)},clearLastSession(){cc(this)},listHistorySessions(e){dc(this,e)},listFolders(){return uc(this)},listFoldersForAgent(e,t){return pc(this,e,t)},listModelsForAgent(e,t){return fc(this,e,t)},listHistorySessionsForAgent(e,t,s){gc(this,e,t,s)},async loadGlobalSessions(e=20){return mc(this,e)},async deleteGlobalSession(e){return hc(this,e)},findAgentForSession(e){return Po(this,e)},isSessionResumable(e){return vc(this,e)},_isRecentlyClosed(e){return fs(this,e)},_startProcessingWatchdog(e){Ns(this,e)},_resetProcessingWatchdog(e){Nr(this,e)},_stopProcessingWatchdog(e){Ae(this,e)},startRefreshTimeout(e){let t=e||this.currentConversation;t&&(this._refreshTimeouts||(this._refreshTimeouts={}),this._refreshTimeouts[t]&&clearTimeout(this._refreshTimeouts[t]),this._refreshTimeouts[t]=setTimeout(()=>{this.setRefreshingSession(t,!1),delete this._refreshTimeouts[t]},1e4))},toggleTheme(){this.theme=this.theme==="dark"?"light":"dark",this.themeFollowSystem=!1,localStorage.setItem("theme",this.theme),document.documentElement.setAttribute("data-theme",this.theme),document.documentElement.classList.toggle("light",this.theme==="light")},initTheme(){if(document.documentElement.setAttribute("data-theme",this.theme),document.documentElement.classList.toggle("light",this.theme==="light"),this.themeFollowSystem&&typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-color-scheme: dark)"),t=s=>{this.themeFollowSystem&&(this.theme=s.matches?"dark":"light",document.documentElement.setAttribute("data-theme",this.theme),document.documentElement.classList.toggle("light",this.theme==="light"))};e.addEventListener?e.addEventListener("change",t):e.addListener&&e.addListener(t)}},loadModelsDevRegistry({forceRefresh:e=!1}={}){let t=this.modelsDevRegistry.loaded&&!this.modelsDevRegistry.error&&Date.now()-this.modelsDevRegistry.fetchedAt<36e5;if(!e&&t)return Promise.resolve(this.modelsDevRegistry);let s=this.currentAgent;if(!s)return Promise.resolve(this.modelsDevRegistry);if(this._modelsDevPending&&(!e||this._modelsDevPending.force))return new Promise(n=>this._modelsDevPending.resolvers.push(n));if(this._modelsDevPending){let n=this._modelsDevPending;this._modelsDevPending=null,n.timer&&clearTimeout(n.timer);for(let r of n.resolvers)r(this.modelsDevRegistry)}return new Promise(n=>{let r={resolvers:[n],force:e,timer:null};this._modelsDevPending=r;try{this.sendWsMessage({type:"get_models_dev_registry",agentId:s,forceRefresh:e})}catch{this._modelsDevPending===r&&(this._modelsDevPending=null),n(this.modelsDevRegistry);return}r.timer=setTimeout(()=>{if(this._modelsDevPending===r){this._modelsDevPending=null;for(let i of r.resolvers)i(this.modelsDevRegistry)}},2e4)})},changeLocale(e){if(this.locale=e,Rn(e),this.currentAgent)try{this.sendWsMessage({type:"update_llm_config",agentId:this.currentAgent,config:{language:e}})}catch{}},async fetchCustomExpertRoles(){let e=De();try{let t={};e.token&&(t.Authorization=`Bearer ${e.token}`);let s=await fetch("/api/expert-roles/custom",{headers:t});if(s.ok){let n=await s.json();this.customExpertRoles=n.roles||[]}}catch{}},async createCustomExpertRole(e){let t=De();try{let s={"Content-Type":"application/json"};t.token&&(s.Authorization=`Bearer ${t.token}`);let n=await fetch("/api/expert-roles/custom",{method:"POST",headers:s,body:JSON.stringify(e)});if(n.ok){let r=await n.json();return this.customExpertRoles.push(r.role),r.role}else{let r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to create custom expert role")}}catch(s){throw s}},async updateCustomExpertRole(e,t){let s=De();try{let n={"Content-Type":"application/json"};s.token&&(n.Authorization=`Bearer ${s.token}`);let r=await fetch(`/api/expert-roles/custom/${e}`,{method:"PUT",headers:n,body:JSON.stringify(t)});if(r.ok){let i=await r.json(),o=this.customExpertRoles.findIndex(a=>a.id===e);return o!==-1&&(this.customExpertRoles[o]=i.role),i.role}else{let i=await r.json().catch(()=>({}));throw new Error(i.error||"Failed to update custom expert role")}}catch(n){throw n}},async deleteCustomExpertRole(e){let t=De();try{let s={};t.token&&(s.Authorization=`Bearer ${t.token}`);let n=await fetch(`/api/expert-roles/custom/${e}`,{method:"DELETE",headers:s});if(n.ok)return this.customExpertRoles=this.customExpertRoles.filter(r=>r.id!==e),!0;{let r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to delete custom expert role")}}catch(s){throw s}},toggleWorkbench(){this.workbenchExpanded=!this.workbenchExpanded,this.workbenchExpanded||(this.workbenchMaximized=!1)},toggleSidebar(){this.sidebarCollapsed=!this.sidebarCollapsed},toggleSessionSidebar(){this.sessionSidebarOpen=!this.sessionSidebarOpen},closeSessionSidebar(){this.sessionSidebarOpen=!1},toggleWorkbenchMaximized(){this.workbenchMaximized=!this.workbenchMaximized},renameChatSession(e,t,s=null){let n=t&&t.trim()?t.trim():"";n?this.customConversationTitles[e]=n:delete this.customConversationTitles[e],this.sendWsMessage({type:"update_conversation_settings",conversationId:e,...s?{agentId:s}:{},title:n})},openFileInExplorer(e){this.currentConversation&&(this.workbenchExpanded=!0,window.dispatchEvent(new CustomEvent("open-file-in-explorer",{detail:{filePath:e,conversationId:this.currentConversation}})))},logout(){De().logout(),this.authenticated=!1,this.sessionKey=null,this.agents=[],this.currentAgent=null,this.currentAgentInfo=null,this.yeaftStatusByAgent={},this._yeaftRetiredCatalogEpochsByAgent={},this.conversations=[],this.activeConversations=[],this.messagesMap={},this.conversationTitles={},this.customConversationTitles={},this.processingConversations={},this.executionStatusMap={},this.workbenchExpanded=!1,this.subagents={},this.activeSubagentId=null,this.activeRightPanel=null,this.pinnedSessions=[],this.clearWorkCenterBrowserState(),this.ws&&this.ws.close()}}})});function Ea(e,t){!e||typeof e.handleYeaftOutput!="function"||!t||e.handleYeaftOutput({event:t})}function Hv(e){let t=String(e||""),s=2166136261;for(let n=0;n<t.length;n++)s^=t.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s>>>0}function La(e){if(!e)return Jt[0];let t=String(e).toLowerCase();return Vv[t]||Jt[Hv(t)%Jt.length]}function Ov(e){return La(e).background}function Fv(e){return La(e).foreground}function Da(){let e=typeof window<"u"&&window.Pinia&&window.Pinia.useChatStore?window.Pinia.useChatStore():null;return e&&typeof e.locale=="string"?e.locale:typeof localStorage<"u"&&localStorage.getItem("locale")||""}function Nv(e,t=""){return e?String(t||"").startsWith("zh")?e.descriptionZh||e.roleZh||e.description||e.role||"":e.description||e.role||e.descriptionZh||e.roleZh||"":""}var $v,Jt,Vv,Hk,Tt,Xs=F(()=>{({defineStore:$v}=Pinia);Jt=[{key:"rat",label:"Rat",glyph:"R",background:"var(--vp-avatar-rat-bg)",foreground:"var(--vp-avatar-rat-fg)"},{key:"ox",label:"Ox",glyph:"O",background:"var(--vp-avatar-ox-bg)",foreground:"var(--vp-avatar-ox-fg)"},{key:"tiger",label:"Tiger",glyph:"T",background:"var(--vp-avatar-tiger-bg)",foreground:"var(--vp-avatar-tiger-fg)"},{key:"rabbit",label:"Rabbit",glyph:"B",background:"var(--vp-avatar-rabbit-bg)",foreground:"var(--vp-avatar-rabbit-fg)"},{key:"dragon",label:"Dragon",glyph:"D",background:"var(--vp-avatar-dragon-bg)",foreground:"var(--vp-avatar-dragon-fg)"},{key:"snake",label:"Snake",glyph:"S",background:"var(--vp-avatar-snake-bg)",foreground:"var(--vp-avatar-snake-fg)"},{key:"horse",label:"Horse",glyph:"H",background:"var(--vp-avatar-horse-bg)",foreground:"var(--vp-avatar-horse-fg)"},{key:"goat",label:"Goat",glyph:"G",background:"var(--vp-avatar-goat-bg)",foreground:"var(--vp-avatar-goat-fg)"},{key:"monkey",label:"Monkey",glyph:"M",background:"var(--vp-avatar-monkey-bg)",foreground:"var(--vp-avatar-monkey-fg)"},{key:"rooster",label:"Rooster",glyph:"K",background:"var(--vp-avatar-rooster-bg)",foreground:"var(--vp-avatar-rooster-fg)"},{key:"dog",label:"Dog",glyph:"D",background:"var(--vp-avatar-dog-bg)",foreground:"var(--vp-avatar-dog-fg)"},{key:"pig",label:"Pig",glyph:"P",background:"var(--vp-avatar-pig-bg)",foreground:"var(--vp-avatar-pig-fg)"}],Vv=Object.freeze({steve:Jt[8],ada:Jt[3],linus:Jt[0],martin:Jt[4]}),Hk=Jt.map(e=>e.background);Tt=$v("vp",{state:()=>({vps:{},vpOrder:[],emptyLibrary:!1,lastSnapshotAt:0,snapshotStatus:"idle",snapshotAgentId:null,snapshotRequestId:null,snapshotError:"",lastVpSnapshotAgentId:null,lastChange:null,dreamStatus:{},groupDreamStatus:{}}),getters:{vpList(e){return e.vpOrder.map(t=>e.vps[t]).filter(Boolean)},vpCount(e){return e.vpOrder.length},vpById:e=>t=>e.vps[t]||null,vpLabel:e=>t=>{let s=e.vps[t];return s?Da().startsWith("zh")&&s.displayNameZh?s.displayNameZh:s.displayName||s.vpId||t:t},vpDescription:e=>t=>Nv(e.vps[t],Da()),vpInitial:e=>t=>{let s=e.vps[t],n=Da().startsWith("zh"),r=s&&(s.avatar||n&&s.displayNameZh||s.displayName||s.vpId)||t||"?";return String(r).charAt(0).toUpperCase()||"?"},vpColor:e=>t=>{let s=e.vps[t];return s&&s.color?s.color:Ov(t)},vpTextColor:()=>e=>Fv(e),vpAvatarMotif:()=>e=>La(e),dreamStatusFor:e=>t=>e.dreamStatus[t]||{status:"idle",lastRunAt:null,lastResult:null,lastError:null},groupDreamStatusFor:e=>t=>e.groupDreamStatus[t]||{status:"idle",lastRunAt:null,lastResult:null,lastError:null}},actions:{applySnapshot(e,t=null,s=null){let n=this.snapshotAgentId||null;if(n&&t&&t!==n||s&&this.snapshotRequestId&&s!==this.snapshotRequestId)return!1;let r=e&&Array.isArray(e.vps)?e.vps:[];return this._setActiveSnapshot({vps:r,emptyLibrary:!!(e&&e.emptyLibrary),agentId:t||n||null,requestId:s||this.snapshotRequestId||null,receivedAt:Date.now()}),!0},beginSnapshot(e,t){this.vps={},this.vpOrder=[],this.emptyLibrary=!1,this.lastVpSnapshotAgentId=null,this.snapshotStatus="loading",this.snapshotAgentId=e||null,this.snapshotRequestId=t||null,this.snapshotError=""},failSnapshot(e,t,s=""){return!this.snapshotRequestId||!t||t!==this.snapshotRequestId||e&&this.snapshotAgentId&&e!==this.snapshotAgentId?!1:(this.snapshotStatus="error",this.snapshotAgentId=e||this.snapshotAgentId||null,this.snapshotRequestId=t||this.snapshotRequestId||null,this.snapshotError=String(s||"VP library request failed"),!0)},_setActiveSnapshot({vps:e,emptyLibrary:t,agentId:s,requestId:n,receivedAt:r}){this.vps={},this.vpOrder=[];for(let i of e||[])this._upsertInternal(i);this.emptyLibrary=!!t,this.lastSnapshotAt=r||Date.now(),this.lastVpSnapshotAgentId=s||null,this.snapshotStatus="ready",this.snapshotAgentId=s||null,this.snapshotRequestId=n||null,this.snapshotError=""},upsert(e,t=null,s=null){return s&&this.snapshotAgentId&&s!==this.snapshotAgentId?!1:(this._upsertInternal(e),e&&e.vpId&&(this.lastChange={vpId:e.vpId,kind:"updated",reason:t||null,at:Date.now()}),!0)},remove(e,t=null,s=null){return s&&this.snapshotAgentId&&s!==this.snapshotAgentId||!e?!1:(delete this.vps[e],this.vpOrder=this.vpOrder.filter(n=>n!==e),this.lastChange={vpId:e,kind:"removed",reason:t||"file.removed",at:Date.now()},!0)},_upsertInternal(e){if(!e||!e.vpId)return;let t=!!this.vps[e.vpId];this.vps[e.vpId]={...this.vps[e.vpId]||{},...e},t||this.vpOrder.push(e.vpId),this.emptyLibrary&&(this.emptyLibrary=!1)},triggerDream(e){if(!e)return;this.dreamStatus={...this.dreamStatus,[e]:{...this.dreamStatus[e]||{},status:"running",lastError:null}};let t=window.Pinia&&window.Pinia.useChatStore?window.Pinia.useChatStore():null;t&&typeof t.sendWsMessage=="function"&&t.sendWsMessage({type:"yeaft_dream_trigger",vpId:e})},triggerGroupDream(e,t={}){if(!e)return;this.groupDreamStatus={...this.groupDreamStatus,[e]:{...this.groupDreamStatus[e]||{},status:"running",lastError:null}};let s=window.Pinia&&window.Pinia.useChatStore?window.Pinia.useChatStore():null,n=Date.now();if(Ea(s,{type:"dream_progress",phase:"start",groupId:e,manual:!0,trigger:"manual",source:"header-button",ts:n}),!s||typeof s.sendWsMessage!="function"){Ea(s,{type:"yeaft_dream_result",groupId:e,success:!1,skipped:!0,skippedReason:"chat-store-unavailable",trigger:"manual",error:null});return}let r={type:"yeaft_dream_trigger",sessionId:e},i=t&&t.agentId?t.agentId:typeof s.agentIdForSession=="function"?s.agentIdForSession(e):s.currentAgent;i&&(r.agentId=i),s.sendWsMessage(r)===!1&&Ea(s,{type:"yeaft_dream_result",groupId:e,success:!1,skipped:!0,skippedReason:"websocket-not-open",trigger:"manual",error:null})},applyDreamStatus(e){if(!e)return;let t=e.sessionId;if(t){this.groupDreamStatus={...this.groupDreamStatus,[t]:{...this.groupDreamStatus[t]||{},status:e.status==="running"?"running":e.status||"idle"}};return}if(!e.vpId)return;let s=e.vpId;this.dreamStatus={...this.dreamStatus,[s]:{...this.dreamStatus[s]||{},status:e.status==="running"?"running":e.status||"idle"}}},applyDreamResult(e){if(!e)return;let t=!!e.success,s=!!e.skipped,n={mergedCount:e.mergedCount??null,extractedCount:e.extractedCount??null,entriesCreated:typeof e.entriesCreated=="number"?e.entriesCreated:e.mergedCount??e.extractedCount??0,skipped:s,skippedReason:e.skippedReason||null,sessionsProcessed:typeof e.sessionsProcessed=="number"?e.sessionsProcessed:null,sessionsSkipped:typeof e.sessionsSkipped=="number"?e.sessionsSkipped:null,targetsApplied:typeof e.targetsApplied=="number"?e.targetsApplied:null,durationMs:typeof e.durationMs=="number"?e.durationMs:null,llmCallCount:typeof e.llmCallCount=="number"?e.llmCallCount:0,inputTokens:typeof e.inputTokens=="number"?e.inputTokens:0,outputTokens:typeof e.outputTokens=="number"?e.outputTokens:0,totalTokens:typeof e.totalTokens=="number"?e.totalTokens:0,metrics:e.metrics||null,passBreakdown:e.passBreakdown||e.metrics?.passBreakdown||null,targetErrors:Array.isArray(e.targetErrors)?e.targetErrors:[]},r=t||s?null:e.error||null,i=s?"skipped":t?"success":"error",o=e.sessionId;if(o){this.groupDreamStatus={...this.groupDreamStatus,[o]:{status:i,lastRunAt:Date.now(),lastResult:n,lastError:r}};return}if(!e.vpId)return;let a=e.vpId;this.dreamStatus={...this.dreamStatus,[a]:{status:i,lastRunAt:Date.now(),lastResult:n,lastError:r}}}}})});function $a(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e){let t=Date.parse(e);if(Number.isFinite(t))return t}return 0}function ii(e){return!e||typeof e!="object"?0:$a(e.lastMessageAt)||$a(e.updatedAt)||$a(e.createdAt)||0}function Va(e,t){let s=ii(t)-ii(e);return s!==0?s:String(e?.id||"").localeCompare(String(t?.id||""))}function qu(e){return[...Array.isArray(e)?e:[]].sort(Va)}var oi=F(()=>{});function Wu(){try{if(typeof localStorage>"u")return{};let e=JSON.parse(localStorage.getItem(zu)||"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function Bv(e){try{typeof localStorage<"u"&&localStorage.setItem(zu,JSON.stringify(e&&typeof e=="object"?e:{}))}catch{}}function ju(){try{return typeof localStorage>"u"?[]:sr(JSON.parse(localStorage.getItem(Yu)||"[]"))}catch{return[]}}function qv(e){try{typeof localStorage<"u"&&localStorage.setItem(Yu,JSON.stringify(sr(e)))}catch{}}function Gu(e,t){return`${e||""}${t||""}`}function Ot(e){return e&&e.agentId&&e.id?Gu(e.agentId,e.id):""}function Mt(e,t){return t?e?Gu(e,t):String(t):""}function Wv(e){return typeof e=="string"?e:String(e||"")}function it(e,t,s=null){let n=Wv(t);if(!n)return"";let r=Mt(s,n),i=r?e.sessions[r]:null;if(i&&(s||i.agentId||e.inventoryIdentityMode==="legacy-bare"))return r;if(s){let c=e.sessions[n];return e.inventoryIdentityMode==="legacy-bare"&&c&&!c.agentId?n:""}let o=e.sessions[n];if(o){if(o.agentId||e.inventoryIdentityMode==="legacy-bare")return n;let c=e.activeSessionKey?e.sessions[e.activeSessionKey]:null;return c?.agentId&&c.id===n?e.activeSessionKey:""}if(e.activeSessionKey&&e.sessions[e.activeSessionKey]?.id===n)return e.activeSessionKey;let a=e.sessionOrder.filter(c=>e.sessions[c]?.id===n),l=nr();if(l?.currentAgent){let c=a.find(d=>e.sessions[d]?.agentId===l.currentAgent);if(c)return c}return a[0]||""}function Ha(e,t,s=null){return it(e,t,s)||""}function Oa(e){if(e.inventoryIdentityMode==="legacy-bare"){let t=e.activeSessionKey?e.sessions[e.activeSessionKey]:null,s=t&&!t.agentId?t:e.activeSessionId?e.sessions[e.activeSessionId]:null;e._retiredBareActiveSessionId=s&&!s.agentId&&s.id||null,e.sessionOrder=e.sessionOrder.filter(n=>e.sessions[n]?.agentId),e._retiredBareActiveSessionId&&(e.activeSessionId=null,e.activeSessionKey=null)}e.inventoryIdentityMode="agent-scoped"}function jv(e){let t=e._preferredExactSessionIdentity||null;if(!t)return!1;e._preferredExactSessionIdentity=null;let s=e.sessions[t.key]||null,n=nr(),r=s?.id===t.sessionId&&s.agentId===t.agentId,i=n?.currentView!=="yeaft"||typeof n.setActiveSessionFilter=="function";if(r&&i){if(e.activeSessionId=t.sessionId,e.activeSessionKey=t.key,n?.currentView==="yeaft")n.setActiveSessionFilter(t.sessionId,{agentId:t.agentId,force:!0});else if(n){n.yeaftActiveSessionFilter=t.sessionId,n.yeaftSessionAgentById={...n.yeaftSessionAgentById||{},[t.sessionId]:t.agentId};try{localStorage.setItem("lastViewedYeaftSession",t.key)}catch{}}return!0}if(e.activeSessionId=null,e.activeSessionKey=null,n?.yeaftActiveSessionFilter===t.sessionId&&(n.yeaftActiveSessionFilter=null),n?.yeaftSessionAgentById?.[t.sessionId]===t.agentId){let o={...n.yeaftSessionAgentById};delete o[t.sessionId],n.yeaftSessionAgentById=o}try{let o=Gn(localStorage.getItem("lastViewedYeaftSession")||"");o.agentId===t.agentId&&o.sessionId===t.sessionId&&localStorage.removeItem("lastViewedYeaftSession")}catch{}return!0}function ai(e){let t=e._retiredBareActiveSessionId||null;if(!t)return!1;let s=nr();if(e.inventoryIdentityMode==="legacy-bare"){let r=e.sessions[t];return e._retiredBareActiveSessionId=null,!r||r.agentId?!1:(e.activeSessionId=t,e.activeSessionKey=t,s?.currentView==="yeaft"&&typeof s.setActiveSessionFilter=="function"?s.setActiveSessionFilter(t,{force:!0}):s&&(s.yeaftActiveSessionFilter=t),!0)}let n=e.sessionOrder.filter(r=>{let i=e.sessions[r];return i?.agentId&&i.id===t});if(n.length===1){let r=n[0],i=e.activeSessionId===t&&e.activeSessionKey===r,o=e.sessions[r]?.agentId||null;return e.activeSessionId=t,e.activeSessionKey=r,i||(s?.currentView==="yeaft"&&typeof s.setActiveSessionFilter=="function"?(s.setActiveSessionFilter(t,{agentId:o,force:!0}),e._retiredBareActiveSessionId=t):s&&(s.yeaftActiveSessionFilter=t)),!0}e.activeSessionId=null,e.activeSessionKey=null,s?.yeaftActiveSessionFilter===t&&(s.yeaftActiveSessionFilter=null);try{let r=localStorage.getItem("lastViewedYeaftSession")||"";Gn(r).sessionId===t&&localStorage.removeItem("lastViewedYeaftSession")}catch{}return!0}function sr(e){let t=[],s=new Set;for(let n of Array.isArray(e)?e:[]){let r=typeof n=="string"?n:String(n||"");!r||s.has(r)||(s.add(r),t.push(r))}return t}function Fa(e,t){let s=sr(e),n=new Set(s),r=sr(t).filter(o=>n.has(o)),i=new Set(r);return[...r,...s.filter(o=>!i.has(o))]}function li(e,t=!1){return!e||typeof e!="object"?!!t:Object.prototype.hasOwnProperty.call(e,"pinned")?e.pinned===!0:Object.prototype.hasOwnProperty.call(e,"isPinned")?e.isPinned===!0:!!t}function Uu(e){return!e||typeof e!="object"?!1:e.running===!0||e.active===!0||e.isActive===!0||e.isRunning===!0}function Ku(e){if(!e||typeof e!="object")return 0;let t=e.latestActivityAt||e.lastActivityAt||e.lastMessageAt||e.updatedAt||0;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t){let s=Date.parse(t);return Number.isFinite(s)?s:0}return 0}function nr(){try{if(typeof window<"u"&&window.Pinia&&typeof window.Pinia.useChatStore=="function")return window.Pinia.useChatStore()}catch{}return null}var zu,Yu,Uv,Qu,Xu=F(()=>{oi();Qn();zu="yeaft-session-order-by-agent",Yu="yeaft-session-order-global";({defineStore:Uv}=Pinia);Qu=Uv("sessions",{state:()=>({sessions:{},sessionOrder:[],activeSessionId:null,activeSessionKey:null,inventoryIdentityMode:"empty",_retiredBareActiveSessionId:null,_preferredExactSessionIdentity:null,lastSnapshotAt:0,lastCrudResult:null,pending:{}}),getters:{sessionList(e){let t=e.sessionOrder.map(d=>e.sessions[d]).filter(Boolean),s=nr(),n=s&&Array.isArray(s.pinnedSessions)?new Set(s.pinnedSessions):new Set;for(let d of t)d&&d.id&&d.pinned&&n.add(d.id);let r=[],i=[];for(let d of t)d.pinned||!d.agentId&&n.has(d.id)?r.push(d):i.push(d);let o=d=>[...d].sort((u,f)=>{let p=Number.isFinite(u?.sortOrder)?u.sortOrder:Number.MAX_SAFE_INTEGER,g=Number.isFinite(f?.sortOrder)?f.sortOrder:Number.MAX_SAFE_INTEGER;return p!==g?p-g:Va(u,f)}),a=[...o(r),...o(i)],l=ju();if(l.length===0)return a;let c=new Map(l.map((d,u)=>[d,u]));return a.sort((d,u)=>{let f=c.has(Ot(d))?c.get(Ot(d)):Number.MAX_SAFE_INTEGER,p=c.has(Ot(u))?c.get(Ot(u)):Number.MAX_SAFE_INTEGER;return f!==p?f-p:0})},sessionCount(e){return e.sessionOrder.length},sessionById:e=>(t,s=null)=>{let n=it(e,t,s);return n&&e.sessions[n]||null},activeSession(e){return e.activeSessionKey&&e.sessions[e.activeSessionKey]||null},hasLoadedSnapshot(e){return e.lastSnapshotAt>0},isEmpty(e){return e.sessionOrder.length===0},activeNeedsInvite(e){let t=e.activeSessionKey?e.sessions[e.activeSessionKey]:null;return t?!t.defaultVpId&&(!Array.isArray(t.roster)||t.roster.length===0):!1}},actions:{applySnapshot(e,t=null,{deferActivation:s=!1}={}){let n=Array.isArray(e)?e:[],r=!1;if(t){Oa(this);let o={...this.sessions},a=new Set;for(let p of n){if(!p||!p.id)continue;let g=Mt(t,p.id);a.add(g),o[g]=this._normalize(p,t,li(this.sessions[g]))}for(let p of this.sessionOrder){let g=this.sessions[p];g&&g.agentId===t&&!a.has(p)&&delete o[p]}let l=this.sessionOrder.filter(p=>o[p]),c=new Set(l),d=[];for(let p of n){if(!p||!p.id)continue;let g=Mt(t,p.id);o[g]&&!c.has(g)&&d.push(g)}this.sessions=o;let u=[...l,...d],f=ju();if(f.length>0){let p=new Map(u.map(I=>[Ot(o[I]),I]).filter(([I])=>I)),g=f.map(I=>p.get(I)).filter(Boolean),m=new Set(g);u=[...g,...u.filter(I=>!m.has(I))];let b=new Map(f.map((I,y)=>[I,y]));for(let I of u){let y=Ot(o[I]);y&&b.has(y)&&(o[I]={...o[I],sortOrder:b.get(y)})}}if(t&&f.length===0){let p=Wu(),g=sr(p[t]);if(g.length>0){let m=g.map(v=>Mt(t,v)),b=new Set(m),I=Fa(u.filter(v=>o[v]?.agentId===t),m),y=this.sessionOrder.some(v=>o[v]?.agentId===t),S=0;y?u=this.sessionOrder.filter(v=>o[v]).map(v=>o[v]?.agentId===t?I[S++]:v).concat(I.slice(S)):u=u.map(v=>o[v]?.agentId===t?I[S++]:v);let w=new Map(m.map((v,h)=>[v,h]));for(let v of I)o[v]&&b.has(v)&&(o[v]={...o[v],sortOrder:w.get(v)})}}this.sessionOrder=u}else{if(this.inventoryIdentityMode==="agent-scoped")return;if(Object.values(this.sessions).some(c=>c&&c.agentId)){this.inventoryIdentityMode="agent-scoped";return}let a={},l=[];for(let c of n){if(!c||!c.id)continue;let d=Mt(null,c.id);a[d]=this._normalize(c,null,li(this.sessions[d])),l.push(d)}this.sessions=a,this.sessionOrder=l,this.inventoryIdentityMode="legacy-bare"}s||(r=jv(this)||ai(this)),this.lastSnapshotAt=Date.now();let i=nr();if(i&&t){let o={...i.yeaftSessionAgentById||{}};for(let a of n)a&&a.id&&!o[a.id]&&(o[a.id]=t);i.yeaftSessionAgentById=o}if(!s&&!r){let o=null;try{o=localStorage.getItem("lastViewedYeaftSession")||null}catch{}let l=(o?this.sessions[o]:null)?o:o?it(this,o,t):"",c=l?this.sessions[l]:null,d=c&&(!t||c.agentId===t),u=this.sessionOrder.filter(S=>this.sessions[S]&&(!t||this.sessions[S].agentId===t)&&this.sessions[S].running).sort((S,w)=>Ku(this.sessions[w])-Ku(this.sessions[S]))[0]||null,f=u?this.sessions[u]?.id:null,p=this.sessionList[0]||null,g=p?.id||null,m=g?it(this,g,p?.raw?.agentId||null):"",b=f||(d?c.id:null)||g,I=u||(d?l:"")||m||Ha(this,b,t),y=this.activeSessionKey?this.sessions[this.activeSessionKey]?.agentId:null;if(this.activeSessionId&&!it(this,this.activeSessionId,y)?(this.activeSessionId=b,this.activeSessionKey=I||null):!this.activeSessionId&&this.sessionOrder.length>0&&!this._retiredBareActiveSessionId?(this.activeSessionId=b,this.activeSessionKey=I||null):this.activeSessionId&&(this.activeSessionKey=Ha(this,this.activeSessionId,y)||this.activeSessionKey),i&&!this._retiredBareActiveSessionId){let S=this.activeSessionId||b,w=null;if((i.yeaftActiveSessionFilter&&!it(this,i.yeaftActiveSessionFilter)||!i.yeaftActiveSessionFilter&&S)&&(w=S),w){let v=Ha(this,w),h=v&&this.sessions[v]?.agentId||null;i.currentView==="yeaft"&&typeof i.setActiveSessionFilter=="function"?i.setActiveSessionFilter(w,{agentId:h,force:!0}):i.yeaftActiveSessionFilter=w,this.activeSessionKey=v||this.activeSessionKey}}}if(i&&typeof i.applyServerPinSnapshot=="function"){let o=new Set;for(let l of n){if(!l||!l.id)continue;let c=Mt(t,l.id),d=this.sessions[c];d&&d.pinned&&o.add(l.id)}let a=l=>{let c=it(this,l,t),d=c?this.sessions[c]:null;return d?d.agentId===t:!1};i.applyServerPinSnapshot(t,o,a)}},applyRosterChange(e,t=null){if(!e)return;let s=e.sessionId||e.groupId;if(!s)return;let n=t||e.agentId||null;if(n)Oa(this);else if(this.inventoryIdentityMode!=="legacy-bare")return;let r=it(this,s,n)||Mt(n,s),i=this.sessions[r];if(!i){let o=this._normalize({id:s,name:e.name||s,roster:Array.isArray(e.roster)?e.roster:[],defaultVpId:e.defaultVpId||null},n);this.sessions[r]=o,this.sessionOrder.push(r),ai(this);return}this.sessions[r]={...i,name:e.name||i.name,roster:Array.isArray(e.roster)?e.roster.slice():i.roster,defaultVpId:e.defaultVpId!=null?e.defaultVpId:i.defaultVpId,announcement:typeof e.announcement=="string"?e.announcement:i.announcement},ai(this)},applyCrudResult(e,t=null){if(!e)return;this.lastCrudResult={...e,at:Date.now()},e.requestId&&this.pending[e.requestId]&&delete this.pending[e.requestId];let s=e.session||e.group||null,n=t||e.agentId||s?.agentId||null;e.ok&&e.op==="list"&&Array.isArray(e.sessions)&&this.applySnapshot(e.sessions,n),e.ok&&(e.op==="create"||e.op==="restore")&&s&&s.id&&this.applySnapshotUpsert(s,n)&&this.setActive(s.id,n);let r=e.sessionId||e.groupId,i=this.inventoryIdentityMode==="legacy-bare",o=r&&(n||i)?it(this,r,n):"";if(e.ok&&(e.op==="archive"||e.op==="delete")&&r&&o&&(delete this.sessions[o],this.sessionOrder=this.sessionOrder.filter(a=>a!==o),(this.activeSessionKey===o||i&&this.activeSessionId===r)&&(this.activeSessionKey=this.sessionOrder[0]||null,this.activeSessionId=this.activeSessionKey&&this.sessions[this.activeSessionKey]?.id||null)),e.ok&&e.op==="update_config"&&r){let a=o?this.sessions[o]:null;a&&(this.sessions[o]={...a,config:e.config&&typeof e.config=="object"?{...e.config}:{}})}},applySnapshotUpsert(e,t=null){if(!e||!e.id)return"";let s=t||e.agentId||null;if(s)Oa(this);else if(this.inventoryIdentityMode!=="legacy-bare")return"";let n=it(this,e.id,s)||Mt(s,e.id),r=!!this.sessions[n],i=this.sessions[n]||{};return this.sessions[n]={...i,...this._normalize(e,s,li(i))},r||this.sessionOrder.push(n),ai(this),n},setActive(e,t=null){let s=it(this,e,t);e&&s&&this.sessions[s]?(this.activeSessionId=e,this.activeSessionKey=s,this._retiredBareActiveSessionId=null):(this.activeSessionId=null,this.activeSessionKey=null)},reorderSessionsForAgent(e,t){if(!e)return[];let s=this.sessionOrder.filter(l=>this.sessions[l]?.agentId===e),n=Fa(s,t.map(l=>Mt(e,l)));if(n.length===0)return[];let r=new Map(n.map((l,c)=>[l,c])),i=0;this.sessionOrder=this.sessionOrder.map(l=>this.sessions[l]?.agentId===e?n[i++]:l);for(let l of n)this.sessions[l]={...this.sessions[l],sortOrder:r.get(l)};let o=Wu(),a=n.map(l=>this.sessions[l]?.id).filter(Boolean);return o[e]=a,Bv(o),a},reorderSessionsGlobally(e){let t=this.sessionOrder.map(a=>Ot(this.sessions[a])).filter(Boolean),s=Fa(t,e);if(s.length===0)return[];let n=new Map(this.sessionOrder.map(a=>[Ot(this.sessions[a]),a]).filter(([a])=>a)),r=s.map(a=>n.get(a)).filter(Boolean),i=new Set(r);this.sessionOrder=[...r,...this.sessionOrder.filter(a=>!i.has(a))];let o=new Map(s.map((a,l)=>[a,l]));for(let a of this.sessionOrder){let l=Ot(this.sessions[a]);l&&o.has(l)&&(this.sessions[a]={...this.sessions[a],sortOrder:o.get(l)})}return qv(s),s.map(a=>{let l=n.get(a),c=l?this.sessions[l]:null;return c?{agentId:c.agentId,sessionId:c.id}:null}).filter(Boolean)},applyPinState(e,t,s=null){if(!s&&this.inventoryIdentityMode!=="legacy-bare")return;let n=it(this,e,s);!e||!n||!this.sessions[n]||(this.sessions[n]={...this.sessions[n],pinned:!!t})},markPending(e,t){e&&(this.pending[e]=t)},clearLastResult(){this.lastCrudResult=null},resetInventory(){this.sessions={},this.sessionOrder=[],this.activeSessionId=null,this.activeSessionKey=null,this.inventoryIdentityMode="empty",this._retiredBareActiveSessionId=null,this._preferredExactSessionIdentity=null,this.lastSnapshotAt=0},beginInventoryCommit(e=null,t=null){if(this.resetInventory(),e&&t){let s=Mt(t,e);this.activeSessionId=e,this.activeSessionKey=s,this._preferredExactSessionIdentity={sessionId:e,agentId:t,key:s}}else e&&(this._retiredBareActiveSessionId=e)},_normalize(e,t=null,s=!1){return{id:e.id,name:e.name||e.id,roster:Array.isArray(e.roster)?e.roster.slice():[],defaultVpId:e.defaultVpId||null,announcement:typeof e.announcement=="string"?e.announcement:"",config:e.config&&typeof e.config=="object"?{...e.config}:{},workDir:typeof e.workDir=="string"?e.workDir:"",createdAt:e.createdAt||null,updatedAt:e.updatedAt||null,lastMessageAt:e.lastMessageAt||null,running:Uu(e),active:Uu(e),runningVpCount:Number.isFinite(Number(e.runningVpCount))?Number(e.runningVpCount):0,latestActivityAt:e.latestActivityAt||e.lastActivityAt||e.lastMessageAt||null,agentId:t||e.agentId||null,pinned:li(e,s),sortOrder:Number.isFinite(e.sortOrder)?e.sortOrder:null}}}})});function ci(){try{if(window.Pinia&&typeof window.Pinia.useAuthStore=="function")return window.Pinia.useAuthStore()}catch{}return null}function Na(){try{return localStorage.getItem("authToken")||null}catch{return null}}function ep(){let e=ci();if(e)try{return e.getActiveToken?.()||e.token||Na()}catch{return e.token||Na()}return Na()}function zv(e,t){if(!e)return!1;let s=ep();if(s&&s!==t)return!1;try{localStorage.setItem("authToken",e)}catch{}let n=ci();return n&&(n.token=e),!0}function Yv(e){try{let t=typeof e=="string"?e:e?.url;return!t||typeof window>"u"||!window.location?null:new URL(t,window.location.href)}catch{return null}}function Ju(e){return!e||typeof window>"u"||!window.location?!1:e.origin===window.location.origin&&e.pathname.startsWith("/api/")}function Gv(e){if(!e)return!1;let t=e.pathname;return!!(Kv.has(t)||t.startsWith("/api/auth/sso/poll/")||/^\/api\/auth\/sso\/[^/]+\/start(?:-qr)?$/.test(t))}function Qv(e,t){return t?.headers?new Headers(t.headers):e&&typeof e=="object"&&e.headers?new Headers(e.headers):new Headers}function Xv(e){let t=e.get("Authorization");return!t||!t.startsWith("Bearer ")?null:t.slice(7)}function Zv(e,t){return{...e||{},headers:t}}function Jv(e,t,s,n){let r=ci();r&&typeof r.handleAuthResponse=="function"?r.handleAuthResponse(e,t,s,n):r&&typeof r.handleAuthFailure=="function"&&n&&r.handleAuthFailure(void 0,t,s)}function tp(){if(Zu||typeof window>"u"||!window.fetch)return;Zu=!0;let e=window.fetch.bind(window);window.fetch=async function(s,n){let r=Yv(s),i=Ju(r)&&!Gv(r),o=Ju(r)?{...n||{},credentials:"same-origin"}:n,a=null,l=i?ci():null,c=l?.authGeneration,d=!!l?.isAuthenticated;if(i){let f=Qv(s,n);a=Xv(f),a||(a=ep(),a&&(f.set("Authorization",`Bearer ${a}`),o=Zv(o,f)))}let u=await e(s,o);try{let f=u.headers&&u.headers.get&&u.headers.get("X-New-Token");f&&zv(f,a),i&&u.status===401&&Jv(u,a,c,d)}catch{}return u}}var Zu,Kv,sp=F(()=>{Zu=!1,Kv=new Set(["/api/auth/mode","/api/auth/login","/api/auth/aad","/api/auth/verify","/api/auth/verify-totp","/api/auth/setup-totp","/api/auth/register","/api/auth/password-reset/request","/api/auth/password-reset/verify"])});var np,rp=F(()=>{np={"common.loading":"\u52A0\u8F7D\u4E2D...","common.confirm":"\u786E\u5B9A","common.apply":"\u5E94\u7528","common.cancel":"\u53D6\u6D88","common.delete":"\u5220\u9664","common.copy":"\u590D\u5236","common.copied":"\u5DF2\u590D\u5236","common.close":"\u5173\u95ED","common.refresh":"\u5237\u65B0","common.open":"\u6253\u5F00","common.save":"\u4FDD\u5B58","common.search":"\u641C\u7D22","common.back":"\u8FD4\u56DE","common.noSubdirectories":"\u65E0\u5B50\u76EE\u5F55","common.drives":"\u9A71\u52A8\u5668","common.rootDir":"\u6839\u76EE\u5F55","common.comma":"\uFF0C","common.select":"\u9009\u62E9","mermaid.export":"\u5BFC\u51FA","mermaid.exportMd":"\u5BFC\u51FA MD","mermaid.exportPng":"\u5BFC\u51FA PNG","mermaid.exportJpg":"\u5BFC\u51FA JPG","chat.toolActionsOmitted":"\u5DF2\u7701\u7565 {count} \u4E2A\u5386\u53F2\u5DE5\u5177\u52A8\u4F5C","login.subtitle":"Yeaft Web Code Agent","login.username":"\u7528\u6237\u540D","login.password":"\u5BC6\u7801","login.login":"\u767B\u5F55","login.loggingIn":"\u767B\u5F55\u4E2D...","login.enterUsername":"\u8BF7\u8F93\u5165\u7528\u6237\u540D","login.enterPassword":"\u8BF7\u8F93\u5165\u5BC6\u7801","login.noAccount":"\u6CA1\u6709\u8D26\u53F7\uFF1F","login.registerWithCode":"\u6CE8\u518C\u65B0\u8D26\u53F7","login.or":"\u6216","login.usePassword":"\u4F7F\u7528\u8D26\u53F7\u5BC6\u7801\u767B\u5F55","login.useSso":"\u8FD4\u56DE\u5355\u70B9\u767B\u5F55","login.noProviders":"\u7BA1\u7406\u5458\u5C1A\u672A\u542F\u7528\u4EFB\u4F55\u7B2C\u4E09\u65B9\u767B\u5F55\u3002","login.microsoft":"\u4F7F\u7528 Microsoft \u8D26\u53F7\u767B\u5F55","login.github":"\u4F7F\u7528 GitHub \u8D26\u53F7\u767B\u5F55","login.google":"\u4F7F\u7528 Google \u8D26\u53F7\u767B\u5F55","login.wechat":"\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801\u767B\u5F55","login.alipay":"\u4F7F\u7528\u652F\u4ED8\u5B9D\u8D26\u53F7\u767B\u5F55","login.wechat.mobileUnsupported":"\u5FAE\u4FE1\u767B\u5F55\u6682\u4EC5\u652F\u6301\u7535\u8111\u7AEF\uFF0C\u8BF7\u5728\u7535\u8111\u6D4F\u89C8\u5668\u4E2D\u626B\u7801\u767B\u5F55\u3002","login.alipay.mobileWaiting":"\u6B63\u5728\u7B49\u5F85\u4F60\u5728\u652F\u4ED8\u5B9D\u4E2D\u786E\u8BA4\u2026 \u5B8C\u6210\u540E\u8FD4\u56DE\u672C\u9875\u9762\u5C06\u81EA\u52A8\u767B\u5F55\u3002","login.alipay.relaunch":"\u91CD\u65B0\u6253\u5F00\u652F\u4ED8\u5B9D","login.qr.title":"\u626B\u7801\u767B\u5F55","login.qr.titleAlipay":"\u652F\u4ED8\u5B9D\u626B\u7801\u767B\u5F55","login.qr.titleWechat":"\u5FAE\u4FE1\u626B\u7801\u767B\u5F55","login.qr.hint":"\u8BF7\u4F7F\u7528\u624B\u673A\u626B\u63CF\u4E8C\u7EF4\u7801\u5B8C\u6210\u6388\u6743","login.error.enterUsername":"\u8BF7\u8F93\u5165\u7528\u6237\u540D","login.error.enterPassword":"\u8BF7\u8F93\u5165\u5BC6\u7801","login.error.enter6Digit":"\u8BF7\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.error.enterInviteCode":"\u8BF7\u8F93\u5165\u9080\u8BF7\u7801","login.error.usernameMinLen":"\u7528\u6237\u540D\u81F3\u5C112\u4E2A\u5B57\u7B26","login.error.passwordMinLen":"\u5BC6\u7801\u81F3\u5C116\u4F4D","login.error.passwordMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","login.error.enterVerifyCode":"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801","login.error.loginFailed":"\u767B\u5F55\u5931\u8D25","login.forgot.link":"\u5FD8\u8BB0\u5BC6\u7801\uFF1F","login.forgot.title":"\u91CD\u7F6E\u5BC6\u7801","login.forgot.emailHint":"\u8F93\u5165\u8D26\u6237\u7ED1\u5B9A\u7684\u90AE\u7BB1\uFF0C\u6211\u4EEC\u5C06\u53D1\u9001 6 \u4F4D\u91CD\u7F6E\u9A8C\u8BC1\u7801\u3002","login.forgot.sendCode":"\u53D1\u9001\u91CD\u7F6E\u9A8C\u8BC1\u7801","login.forgot.sending":"\u53D1\u9001\u4E2D...","login.forgot.codeSent":"\u5982\u679C\u90AE\u7BB1\u5DF2\u6CE8\u518C\uFF0C\u91CD\u7F6E\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001\u3002\u8BF7\u5728\u4E0B\u65B9\u8F93\u5165\u9A8C\u8BC1\u7801\u4E0E\u65B0\u5BC6\u7801\u3002","login.forgot.resetBtn":"\u91CD\u7F6E\u5BC6\u7801","login.forgot.resetting":"\u91CD\u7F6E\u4E2D...","login.forgot.success":"\u5BC6\u7801\u5DF2\u91CD\u7F6E\uFF0C\u53EF\u4EE5\u4F7F\u7528\u65B0\u5BC6\u7801\u767B\u5F55\u3002","login.forgot.emailInvalid":"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1","login.register.title":"\u65B0\u7528\u6237\u6CE8\u518C","login.register.inviteCode":"\u9080\u8BF7\u7801","login.register.username":"\u7528\u6237\u540D","login.register.password":"\u5BC6\u7801\uFF08\u81F3\u5C116\u4F4D\uFF09","login.register.confirmPassword":"\u786E\u8BA4\u5BC6\u7801","login.register.email":"\u90AE\u7BB1\uFF08\u53EF\u9009\uFF09","login.register.submit":"\u6CE8\u518C","login.register.submitting":"\u6CE8\u518C\u4E2D...","login.register.back":"\u8FD4\u56DE\u767B\u5F55","login.register.success":"\u6CE8\u518C\u6210\u529F\uFF0C\u8BF7\u767B\u5F55","login.register.enterCode":"\u8BF7\u8F93\u5165\u9080\u8BF7\u7801","login.register.usernameMin":"\u7528\u6237\u540D\u81F3\u5C112\u4E2A\u5B57\u7B26","login.register.passwordMin":"\u5BC6\u7801\u81F3\u5C116\u4F4D","login.register.passwordMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","login.totp.setupTitle":"\u8BBE\u7F6E\u53CC\u56E0\u7D20\u8BA4\u8BC1","login.totp.setupHint":"\u4F7F\u7528 Microsoft Authenticator \u6216 Google Authenticator \u626B\u63CF\u4E0B\u65B9\u4E8C\u7EF4\u7801","login.totp.manualKey":"\u6216\u624B\u52A8\u8F93\u5165\u5BC6\u94A5\uFF1A","login.totp.enterCode":"\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.totp.complete":"\u5B8C\u6210\u8BBE\u7F6E","login.totp.verifying":"\u9A8C\u8BC1\u4E2D...","login.totp.verify":"\u9A8C\u8BC1","login.totp.prompt":"\u8BF7\u8F93\u5165 Authenticator \u5E94\u7528\u4E2D\u7684\u9A8C\u8BC1\u7801","login.totp.invalidCode":"\u8BF7\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.email.codeSent":"\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001\u81F3 {email}","login.email.enterCode":"\u8F93\u5165\u9A8C\u8BC1\u7801","login.email.verify":"\u9A8C\u8BC1","login.email.verifying":"\u9A8C\u8BC1\u4E2D...","login.email.enterCodeError":"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801","chat.agent.select":"\u9009\u62E9 Agent","chat.agent.manage":"\u7BA1\u7406 Agent","chat.agent.none":"\u6682\u65E0 Agent","chat.agent.restarting":"\u91CD\u542F\u4E2D","chat.agent.restart":"\u91CD\u542F","chat.agent.restartConfirm":`\u786E\u5B9A\u8981\u91CD\u542F Agent "{name}" \u5417\uFF1F
|
|
11
11
|
\u6240\u6709\u6D3B\u8DC3\u7684\u4F1A\u8BDD\u5C06\u88AB\u4E2D\u65AD\u3002`,"chat.agent.upgrade":"\u5347\u7EA7","chat.agent.upgrading":"\u5347\u7EA7\u4E2D","chat.agent.upgradeConfirm":`\u5347\u7EA7 Agent "{name}" \u5230\u6700\u65B0\u7248\u672C\uFF1F
|
|
12
|
-
\u5347\u7EA7\u5B8C\u6210\u540E Agent \u4F1A\u81EA\u52A8\u91CD\u542F\u3002`,"chat.agent.alreadyLatest":"Agent \u5DF2\u662F\u6700\u65B0\u7248\u672C (v{version})\uFF0C\u65E0\u9700\u5347\u7EA7\u3002","chat.agent.nodeIncompatible":"Agent \u5347\u7EA7\u4E2D\u6B62\uFF1A\u76EE\u6807\u7248\u672C v{version} \u9700\u8981 Node {required}\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u8FD0\u884C\u7684\u662F Node {current}\u3002\u8BF7\u5148\u5347\u7EA7 Node.js \u518D\u91CD\u8BD5\u3002","chat.agent.online":"{count} \u4E2A Agent \u5728\u7EBF","chat.agent.selectFirst":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent","chat.agent.yeaft":"Yeaft \u5BF9\u8BDD","sidebar.toggle.chat":"\u5207\u6362\u5230 Chat","sidebar.toggle.yeaft":"\u5207\u6362\u5230 Yeaft","sidebar.surface.label":"\u4FA7\u680F\u89C6\u56FE","sidebar.surface.sessions":"\u4F1A\u8BDD","sidebar.provider.label":"\u4F1A\u8BDD Provider","sidebar.provider.claude":"Claude","sidebar.sessions.new":"\u65B0\u5EFA\u4F1A\u8BDD","sidebar.sessions.newChat":"\u65B0\u5EFA\u804A\u5929","sidebar.sessions.emptyProvider":"\u6B64 Provider \u6682\u65E0\u4F1A\u8BDD","sidebar.sessions.menu":"\u4F1A\u8BDD\u83DC\u5355","sidebar.sessions.unread":"\u672A\u8BFB","sidebar.sessions.pinned":"\u5DF2\u7F6E\u9876","sidebar.sessions.processing":"\u6B63\u5728\u56DE\u590D","sidebar.sessions.hidden":"\u5DF2\u9690\u85CF\u7684\u4F1A\u8BDD","sidebar.sessions.remove":"\u4ECE\u4FA7\u680F\u79FB\u9664","sidebar.sessions.agent":"Agent","sidebar.sessions.provider":"Provider","sidebar.projects.title":"\u9879\u76EE","sidebar.projects.menu":"\u9879\u76EE\u83DC\u5355","sidebar.projects.new":"\u65B0\u5EFA\u9879\u76EE","sidebar.projects.newSession":"\u5728{name}\u4E2D\u521B\u5EFA Session","sidebar.projects.assignFailed":"Session \u5DF2\u521B\u5EFA\uFF0C\u4F46\u65E0\u6CD5\u52A0\u5165{name}\u3002\u9519\u8BEF\uFF1A{message}","sidebar.projects.empty":"\u6682\u65E0\u9879\u76EE","sidebar.projects.noSessions":"\u5C06 Yeaft \u804A\u5929\u62D6\u5230\u8FD9\u91CC","sidebar.projects.namePrompt":"\u9879\u76EE\u540D\u79F0","sidebar.projects.renamePrompt":"\u91CD\u547D\u540D\u9879\u76EE","sidebar.projects.rename":"\u91CD\u547D\u540D\u9879\u76EE","sidebar.projects.delete":"\u5220\u9664\u9879\u76EE","sidebar.projects.deleteConfirm":"\u5220\u9664\u9879\u76EE\u201C{name}\u201D\uFF1F\u5176\u4E2D\u804A\u5929\u4F1A\u79FB\u56DE\u6700\u8FD1\u3002","sidebar.projects.remove":"\u79FB\u51FA\u9879\u76EE","sidebar.projects.moveMenu":"\u79FB\u52A8\u5230 Projects","sidebar.projects.moveBack":"\u8FD4\u56DE","sidebar.projects.moveEmpty":"\u6CA1\u6709\u5176\u4ED6 Project","sidebar.projects.moveTo":"\u79FB\u5230 {name}","sidebar.projects.instructions":"Project \u6307\u4EE4","sidebar.projects.instructionsTitle":"{name} \u6307\u4EE4","sidebar.projects.instructionsHint":"\u8FD9\u4E9B\u6307\u4EE4\u4F1A\u52A0\u5165\u6B64 Project \u5185\u6BCF\u4E2A Session \u7684 system prompt\u3002","sidebar.projects.instructionsPlaceholder":"\u8F93\u5165\u5171\u4EAB\u7684\u7F16\u7801\u89C4\u8303\u3001\u7EA6\u675F\u6216\u5DE5\u4F5C\u6D41\u8BF4\u660E\u2026","sidebar.recents.title":"\u6700\u8FD1","sidebar.recents.empty":"\u6682\u65E0\u804A\u5929","yeaft.back":"\u8FD4\u56DE","yeaft.session.people":"\u6210\u5458","yeaft.session.peopleEmpty":"\u6682\u65E0\u6210\u5458","yeaft.session.runningTasks":"\u8FD0\u884C\u4E2D\u7684\u4EFB\u52A1","yeaft.session.tasksEmpty":"\u6682\u65E0\u8FD0\u884C\u4EFB\u52A1","yeaft.session.owner":"\u8D1F\u8D23\u4EBA","yeaft.session.started":"\u5F00\u59CB\u65F6\u95F4","yeaft.breadcrumb.label":"Thread \u8FC7\u6EE4","yeaft.breadcrumb.mainStream":"\u4E3B\u6D41","yeaft.breadcrumb.backHint":"\u8FD4\u56DE\u5168\u6D41 (Esc)","yeaft.featureDetail.ariaLabel":"Task \u8BE6\u60C5","yeaft.featureDetail.replyTo":"\u56DE\u590D\u5230:","yeaft.featureDetail.forkHint":"\u8BE5 task \u6682\u65E0\u6D3B\u8DC3 thread \u2014 \u8BF7 fork \u65B0 thread \u540E\u56DE\u590D\u3002","yeaft.featureDetail.empty":"\u8BE5 task \u6682\u65E0\u6D88\u606F\u3002","yeaft.featureDetail.threadPillHint":"\u6253\u5F00 thread","yeaft.featureDetail.summary.aria":"\u4EFB\u52A1\u6458\u8981\u65F6\u95F4\u7EBF","yeaft.featureDetail.summary.title":"\u6458\u8981\u65F6\u95F4\u7EBF","yeaft.featureDetail.summary.loading":"\u6B63\u5728\u52A0\u8F7D\u6458\u8981\u5386\u53F2\u2026","yeaft.featureDetail.summary.empty":"\u6682\u65E0\u6458\u8981\u3002","yeaft.featureDetail.summary.error":"\u6458\u8981\u52A0\u8F7D\u5931\u8D25\uFF1A{error}","yeaft.featureDetail.summary.showArchived":"\u663E\u793A\u5DF2\u5F52\u6863","yeaft.featureDetail.related.aria":"\u5173\u8054\u4EFB\u52A1","yeaft.featureDetail.related.title":"\u5173\u8054\u4EFB\u52A1","yeaft.featureDetail.related.unlink":"\u53D6\u6D88\u5173\u8054","yeaft.featureDetail.members.aria":"\u4EFB\u52A1\u6210\u5458","yeaft.featureDetail.members.title":"\u6210\u5458","yeaft.featureDetail.members.abort":"\u4E2D\u6B62","yeaft.featureDetail.members.kick":"\u8E22\u51FA","yeaft.model":"\u6A21\u578B","yeaft.placeholder":"\u95EE\u6211\u4EFB\u4F55\u95EE\u9898...","yeaft.inbox":"\u6536\u4EF6\u7BB1","yeaft.inbox.tooltip":"\u4F60\u7684\u9ED8\u8BA4\u5BF9\u8BDD\u7EBF\u7A0B \u2014\u2014 \u4E0E Yeaft \u7684\u4E00\u5BF9\u4E00\u804A\u5929\u3002\u53EF\u4EE5\u4E3A\u5177\u4F53\u8BDD\u9898\u6216\u4EFB\u52A1\u521B\u5EFA\u65B0\u7EBF\u7A0B\u3002","yeaft.sidebar.activeThreads":"\u6D3B\u8DC3","yeaft.sidebar.idleThreads":"\u9759\u9ED8","yeaft.sidebar.archivedThreads":"\u5DF2\u5F52\u6863","yeaft.sidebar.tasks":"\u4EFB\u52A1","yeaft.sidebar.emptyActive":"\u6682\u65E0\u6D3B\u8DC3 thread","yeaft.sidebar.emptyIdle":"\u6682\u65E0\u9759\u9ED8 thread","yeaft.sidebar.emptyArchived":"\u6682\u65E0\u5F52\u6863 thread","yeaft.sidebar.emptyTasks":"\u65E0\u5339\u914D\u4EFB\u52A1","yeaft.sidebar.results":"\u641C\u7D22\u7ED3\u679C","yeaft.sidebar.resultsThreads":"Threads","yeaft.sidebar.kindThread":"thread","yeaft.sidebar.cancel":"\u53D6\u6D88","yeaft.sidebar.mergeInto":"\u5408\u5E76\u5230\u2026","yeaft.sidebar.mergeNoCandidates":"\u6CA1\u6709\u53EF\u5408\u5E76\u7684\u5176\u4ED6\u7EBF\u7A0B","yeaft.sidebar.mergeConfirmTitle":"\u5408\u5E76\u8FD9\u4E2A\u7EBF\u7A0B\uFF1F","yeaft.sidebar.mergeIrreversible":"\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\uFF0C\u6E90\u7EBF\u7A0B\u5C06\u88AB\u5F52\u6863\uFF0C\u5176\u6D88\u606F\u4F1A\u88AB\u79FB\u52A8\u5230\u76EE\u6807\u7EBF\u7A0B\u3002","yeaft.sidebar.mergeConfirm":"\u5408\u5E76","yeaft.settings.sidebarV2":"\u5B9E\u9A8C\u529F\u80FD\uFF1A\u4FA7\u8FB9\u680F V2","yeaft.settings.sidebarV2Hint":"Thread \u5217\u8868 + \u4EFB\u52A1\u6811\uFF08\u9884\u89C8\uFF09\u3002","yeaft.clearConfirm":"\u6E05\u7A7A\u6240\u6709\u6D88\u606F\uFF1F","yeaft.mode":"\u6A21\u5F0F","yeaft.agent":"\u667A\u80FD\u4F53","yeaft.connecting":"\u8FDE\u63A5\u4E2D...","yeaft.ready":"\u5C31\u7EEA","yeaft.tools":"\u4E2A\u5DE5\u5177","yeaft.skills":"\u4E2A\u6280\u80FD","yeaft.mcp":"\u4E2A MCP","yeaft.showSidebar":"\u663E\u793A\u4FA7\u680F","yeaft.hideSidebar":"\u9690\u85CF\u4FA7\u680F","yeaft.debug":"\u8C03\u8BD5","yeaft.debugClose":"\u5173\u95ED\u8C03\u8BD5\u9762\u677F","yeaft.debugTurns":"\u8F6E","yeaft.debugTabToolStats":"\u5DE5\u5177\u7EDF\u8BA1","yeaft.debugTabDream":"Dream","yeaft.debugTabRequestLog":"\u8BF7\u6C42\u65E5\u5FD7","yeaft.debugHistoryLoad":"\u52A0\u8F7D\u8BF7\u6C42\u5386\u53F2","yeaft.debugHistoryLoading":"\u52A0\u8F7D\u4E2D...","yeaft.debugHistoryLoaded":"\u5DF2\u52A0\u8F7D {count} \u6761","yeaft.debugSearchPlaceholder":"\u6B63\u5219\u641C\u7D22\u8BF7\u6C42\u65E5\u5FD7","yeaft.debugSearchHint":"\u9ED8\u8BA4\u663E\u793A\u5168\u5C40\u6700\u8FD1 10 \u6761\uFF1B\u641C\u7D22\u4F1A\u8DE8 Session \u5339\u914D\u8BF7\u6C42\u6458\u8981\u3002","yeaft.dreamDebug.title":"Dream \u751F\u547D\u5468\u671F","yeaft.dreamDebug.trigger":"\u89E6\u53D1","yeaft.dreamDebug.status":"\u72B6\u6001","yeaft.dreamDebug.started":"\u5F00\u59CB","yeaft.dreamDebug.finished":"\u7ED3\u675F","yeaft.dreamDebug.time":"\u65F6\u95F4","yeaft.dreamDebug.phase":"\u9636\u6BB5","yeaft.dreamDebug.call":"\u8C03\u7528","yeaft.dreamDebug.location":"\u751F\u6210\u4F4D\u7F6E","yeaft.dreamDebug.result":"\u7ED3\u679C","yeaft.dreamDebug.noLatest":"\u8FD9\u4E2A\u4F1A\u8BDD\u8FD8\u6CA1\u6709\u8BB0\u5F55\u5230 Dream \u68C0\u67E5\u3002","yeaft.dreamDebug.noEvents":"\u8FD9\u4E2A\u4F1A\u8BDD\u8FD8\u6CA1\u6709 Dream \u4E8B\u4EF6\u3002","yeaft.dreamDebug.outputTitle":"\u672C session \u5DF2\u52A0\u8F7D\u7684 Dream \u8F93\u51FA","yeaft.dreamDebug.scope":"Scope","yeaft.dreamDebug.lastDream":"\u4E0A\u6B21 Dream","yeaft.dreamDebug.messagesCovered":"\u5DF2\u8986\u76D6\u6D88\u606F\u6570","yeaft.dreamDebug.noOutput":"\u8FD9\u4E2A session \u8FD8\u6CA1\u6709\u5199\u5165 Dream \u8F93\u51FA\u3002","yeaft.dreamDebug.promptLoadTitle":"\u5DF2\u52A0\u8F7D\u8FDB system prompt \u7684 Dream \u8BB0\u5FC6","yeaft.dreamDebug.loadedInto":"\u52A0\u8F7D\u4F4D\u7F6E","yeaft.dreamDebug.vp":"VP","yeaft.dreamDebug.summaryToPrompt":"summary.md -> system prompt","yeaft.dreamDebug.itemList":"Dream \u8FD0\u884C\u548C Scope","yeaft.dreamDebug.searchPlaceholder":"\u6309\u6807\u9898\u3001ID \u6216\u6458\u8981\u641C\u7D22 Dream Session...","yeaft.dreamDebug.noSearchResults":"\u6CA1\u6709\u5339\u914D\u7684 Dream Session\u3002","yeaft.dreamDebug.noSummary":"\u6682\u65E0\u6458\u8981","yeaft.dreamDebug.segments":"\u6BB5","yeaft.dreamDebug.lastError":"\u6700\u8FD1\u9519\u8BEF","yeaft.dreamDebug.overview":"\u6982\u89C8","yeaft.dreamDebug.sessionId":"Session ID","yeaft.dreamDebug.loadedAt":"\u52A0\u8F7D\u65F6\u95F4","yeaft.dreamDebug.layers":"\u5C42\u7EA7","yeaft.dreamDebug.summaryLayer":"Resident summary","yeaft.dreamDebug.noPromptLoad":"\u8FD9\u4E2A scope \u6682\u65E0 prompt-load \u8BB0\u5F55\u3002","yeaft.dreamDebug.segmentTitle":"Segments","yeaft.dreamDebug.sourceMessages":"\u6765\u6E90\u6D88\u606F","yeaft.dreamDebug.createdAt":"\u521B\u5EFA\u65F6\u95F4","yeaft.dreamDebug.updatedAt":"\u66F4\u65B0\u65F6\u95F4","yeaft.dreamDebug.noSegments":"\u8FD9\u4E2A scope \u6682\u65E0 memory segments\u3002","yeaft.dreamDebug.requestResponse":"Request / Response","yeaft.dreamDebug.noRequestResponse":"\u8FD9\u4E2A scope \u8FD8\u6CA1\u6709\u6301\u4E45\u5316\u7684 Dream request/response \u65E5\u5FD7\u3002","yeaft.dreamDebug.empty":"\u6682\u65E0 Dream debug \u6570\u636E\u3002","yeaft.debugGroupFollowMain":"\u8DDF\u968F\u4E3B\u9762\u677F","yeaft.debugGroupAll":"\u5168\u90E8\u4F1A\u8BDD","yeaft.debugAssistantResponse":"Assistant \u56DE\u590D","yeaft.debugViewAssistantResponse":"\u67E5\u770B\u56DE\u590D","yeaft.debugToolInput":"\u8F93\u5165","yeaft.debugToolResult":"\u7ED3\u679C","yeaft.debugToolRunning":"\u6267\u884C\u4E2D","yeaft.debugToolRunningNoResult":"\u6267\u884C\u4E2D\uFF0C\u6682\u65E0\u7ED3\u679C","yeaft.debugShowDetails":"\u5C55\u5F00","yeaft.debugHideDetails":"\u6536\u8D77","yeaft.debugTurnStartedAt":"\u56DE\u5408\u5F00\u59CB\u65F6\u95F4","yeaft.debugRequestAt":"\u8BF7\u6C42\u65F6\u95F4","yeaft.debugRequestAtDerived":"\u7531\u56DE\u5408\u5F00\u59CB\u65F6\u95F4\u63A8\u7B97\uFF08\u65E7 loop\uFF09","yeaft.turn":"\u7B2C {n} \u8F6E","yeaft.systemPrompt":"\u7CFB\u7EDF\u63D0\u793A","yeaft.messagesLabel":"\u6D88\u606F","yeaft.response":"\u56DE\u590D","yeaft.toolCalls":"\u5DE5\u5177\u8C03\u7528","yeaft.functionCalls":"\u51FD\u6570\u8C03\u7528","yeaft.request":"\u8BF7\u6C42","yeaft.pending":"(\u7B49\u5F85\u4E2D)","yeaft.inputTokens":"\u8F93\u5165","yeaft.outputTokens":"\u8F93\u51FA","yeaft.duration":"\u8017\u65F6","yeaft.noDebugData":"\u6682\u65E0\u8C03\u8BD5\u6570\u636E","yeaft.showDebug":"\u663E\u793A\u8C03\u8BD5\u9762\u677F","yeaft.hideDebug":"\u9690\u85CF\u8C03\u8BD5\u9762\u677F","yeaft.reloadPage":"\u5237\u65B0\u9875\u9762","yeaft.reloadMessages":"\u91CD\u65B0\u52A0\u8F7D\u6D88\u606F","sidebar.sessions.syncing":"\u6B63\u5728\u540C\u6B65\u6700\u65B0\u6D88\u606F","yeaft.historySearch.label":"\u641C\u7D22 Session \u5386\u53F2\u6D88\u606F","yeaft.historySearch.button":"\u641C\u7D22\u6D88\u606F","yeaft.historySearch.placeholder":"\u641C\u7D22\u5F53\u524D Session \u7684\u6D88\u606F","yeaft.historySearch.searching":"\u6B63\u5728\u641C\u7D22\u2026","yeaft.historySearch.minChars":"\u81F3\u5C11\u8F93\u5165 2 \u4E2A\u5B57\u7B26","yeaft.historySearch.empty":"\u6CA1\u6709\u5339\u914D\u7684\u6D88\u606F","yeaft.historySearch.error":"\u641C\u7D22\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5","yeaft.historySearch.unsupported":"\u8BF7\u5347\u7EA7\u5F53\u524D Agent \u540E\u518D\u641C\u7D22 Session \u5386\u53F2\u6D88\u606F","yeaft.historySearch.more":"\u52A0\u8F7D\u66F4\u591A\u7ED3\u679C","yeaft.historySearch.you":"\u4F60","yeaft.historySearch.assistant":"\u52A9\u624B","yeaft.outline.label":"\u5386\u53F2\u6D88\u606F","yeaft.outline.sender":"\u53D1\u9001\u8005","yeaft.outline.allSenders":"\u5168\u90E8\u53D1\u9001\u8005","yeaft.outline.title":"\u5386\u53F2\u6D88\u606F","yeaft.outline.placeholder":"\u641C\u7D22\u5F53\u524D\u5BF9\u8BDD","yeaft.outline.searching":"\u6B63\u5728\u641C\u7D22\u2026","yeaft.outline.loading":"\u6B63\u5728\u52A0\u8F7D\u2026","yeaft.outline.older":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","yeaft.outline.moreMatches":"\u52A0\u8F7D\u66F4\u591A\u5339\u914D\u9879","yeaft.outline.minChars":"\u81F3\u5C11\u8F93\u5165 2 \u4E2A\u5B57\u7B26","yeaft.outline.empty":"\u6682\u65E0\u6D88\u606F","yeaft.outline.noMatches":"\u6CA1\u6709\u5339\u914D\u7684\u6D88\u606F","yeaft.outline.error":"\u5927\u7EB2\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5","yeaft.outline.unsupported":"\u8BF7\u5347\u7EA7\u5F53\u524D Agent \u540E\u518D\u4F7F\u7528\u5BF9\u8BDD\u5927\u7EB2","yeaft.outline.you":"\u4F60","yeaft.outline.assistant":"\u52A9\u624B","yeaft.outline.nonText":"\u975E\u6587\u672C\u56DE\u590D","yeaft.switchModel":"\u5207\u6362\u6A21\u578B","yeaft.modelMenu.title":"\u6A21\u578B\u548C LLM \u8BBE\u7F6E","yeaft.modelMenu.label":"\u6A21\u578B","yeaft.modelMenu.effort":"\u63A8\u7406\u5F3A\u5EA6","yeaft.modelMenu.effort.openaiReasoning":"\u63A8\u7406\u5F3A\u5EA6","yeaft.modelMenu.effort.anthropicBudget":"\u601D\u8003\u9884\u7B97","yeaft.modelMenu.effort.anthropicAdaptive":"\u81EA\u9002\u5E94\u601D\u8003\u5F3A\u5EA6","yeaft.modelMenu.effort.minimal":"\u6700\u5C0F","yeaft.modelMenu.effort.low":"\u4F4E","yeaft.modelMenu.effort.medium":"\u4E2D","yeaft.modelMenu.effort.high":"\u9AD8","yeaft.modelMenu.effort.xhigh":"\u8D85\u9AD8","yeaft.modelMenu.effort.max":"\u6700\u9AD8","yeaft.modelMenu.noEffort":"\u5F53\u524D\u6A21\u578B\u6CA1\u6709\u53EF\u517C\u5BB9\u6620\u5C04\u7684\u63A8\u7406\u5F3A\u5EA6\u63A7\u5236\u3002","yeaft.modelMenu.configureHint":"Provider\u3001\u5BC6\u94A5\u3001\u6A21\u578B\u5217\u8868","yeaft.settings.title":"\u8BBE\u7F6E","yeaft.settings.tabs.vp":"VP \u5E93","yeaft.settings.tabs.search":"\u641C\u7D22","search.settings.backendTitle":"\u641C\u7D22\u540E\u7AEF","search.settings.backendDesc":"\u9009\u62E9 WebSearch \u5DE5\u5177\u9ED8\u8BA4\u4F7F\u7528\u7684\u540E\u7AEF\u3002\u4E3B\u540E\u7AEF\u5931\u8D25\u65F6,\u5F15\u64CE\u4F1A\u81EA\u52A8\u964D\u7EA7\u5230 HTML \u6293\u53D6\u3002","search.settings.backend.tavily":"Tavily","search.settings.backend.tavilyHint":"\u6258\u7BA1\u641C\u7D22 API\u3002\u514D\u8D39\u989D\u5EA6 1000 \u6B21/\u6708\u3002\u63A8\u8350\u3002","search.settings.backend.playwright":"Playwright \u670D\u52A1","search.settings.backend.playwrightHint":"\u81EA\u5EFA\u7684\u6D4F\u89C8\u5668\u5F0F\u641C\u7D22/\u6293\u53D6\u670D\u52A1,\u9002\u5408 IP \u4FE1\u8A89\u5DEE\u88AB bot \u68C0\u6D4B\u7684\u73AF\u5883\u3002\u5C1A\u672A\u4E0A\u7EBF\u3002","search.settings.comingSoon":"\u5373\u5C06\u63A8\u51FA","search.settings.tavilyKeyTitle":"Tavily API key","search.settings.tavilyKeyDesc":"\u4FDD\u5B58\u5728 agent \u7684 ~/.yeaft/config.json \u4E2D\u3002\u514D\u8D39\u7533\u8BF7:","search.settings.tavilyKeyUnchanged":"\u4FDD\u6301\u4E0D\u53D8","search.settings.clearKey":"\u6E05\u9664","search.settings.usageTitle":"\u672C\u6708\u7528\u91CF","search.settings.usageRefresh":"\u5237\u65B0","search.settings.usageLoading":"\u52A0\u8F7D\u4E2D\u2026","search.settings.usagePlan":"\u8BA1\u5212","search.settings.usageUsed":"\u5DF2\u7528","search.settings.usagePaygo":"\u6309\u91CF\u4ED8\u8D39","search.settings.usageError":"\u52A0\u8F7D\u7528\u91CF\u5931\u8D25","search.settings.save":"\u4FDD\u5B58","search.settings.saving":"\u4FDD\u5B58\u4E2D\u2026","search.settings.saveSuccess":"\u5DF2\u4FDD\u5B58","search.settings.cancel":"\u91CD\u7F6E","yeaft.settings.yeaftTitle":"\u7EBF\u7A0B\u5E76\u53D1\u4E0E\u5F52\u6863","yeaft.settings.yeaftDesc":"\u8C03\u6574\u53EF\u540C\u65F6\u8FD0\u884C\u7684\u7EBF\u7A0B\u6570\u91CF\uFF0C\u4EE5\u53CA\u95F2\u7F6E\u7EBF\u7A0B\u7684\u81EA\u52A8\u5F52\u6863\u65F6\u957F\u3002","yeaft.settings.maxConcurrentLabel":"\u6700\u5927\u5E76\u53D1\u7EBF\u7A0B\u6570","yeaft.settings.maxConcurrentHint":"\u540C\u65F6\u5728\u7EBF\u7684\u7EBF\u7A0B\u603B\u6570\u4E0A\u9650\uFF08\u542B\u59CB\u7EC8\u5B58\u5728\u7684 main \u4E3B\u7EBF\u7A0B\uFF09\u3002\u8D85\u8FC7\u6B64\u4E0A\u9650\u7684\u65B0\u7EBF\u7A0B\u5C06\u88AB\u62D2\u7EDD\uFF0C\u76F4\u81F3\u5DF2\u6709\u7EBF\u7A0B\u88AB\u5F52\u6863\u6216\u7EC8\u6B62\u3002\u8303\u56F4\uFF1A1-50\u3002","yeaft.settings.archiveIdleDaysLabel":"\u95F2\u7F6E\u591A\u4E45\u540E\u81EA\u52A8\u5F52\u6863\u7EBF\u7A0B\uFF08\u5929\uFF09","yeaft.settings.archiveIdleDaysHint":"\u65E0\u6D3B\u52A8\u8D85\u8FC7\u6B64\u5929\u6570\u7684\u7EBF\u7A0B\u5C06\u88AB\u5F52\u6863\u3002\u8303\u56F4\uFF1A1-3650\u3002","yeaft.settings.yeaftSaveBtn":"\u4FDD\u5B58","yeaft.settings.yeaftSaving":"\u4FDD\u5B58\u4E2D...","yeaft.settings.yeaftSaved":"\u5DF2\u4FDD\u5B58","yeaft.settings.yeaftLoading":"\u52A0\u8F7D\u4E2D...","yeaft.settings.yeaftLoadError":"\u52A0\u8F7D Yeaft \u8BBE\u7F6E\u5931\u8D25","yeaft.settings.yeaftSaveError":"\u4FDD\u5B58 Yeaft \u8BBE\u7F6E\u5931\u8D25","yeaft.settings.rangeErrorConcurrent":"\u5FC5\u987B\u5728 1 \u5230 50 \u4E4B\u95F4","yeaft.settings.rangeErrorArchive":"\u5FC5\u987B\u5728 1 \u5230 3650 \u4E4B\u95F4","chat.session.creating":"\u6B63\u5728\u521B\u5EFA\u4F1A\u8BDD...","chat.session.loadingHistory":"\u6B63\u5728\u52A0\u8F7D\u4F1A\u8BDD\u5386\u53F2...","yeaft.historyLoad.error":"\u4F1A\u8BDD\u5386\u53F2\u6682\u65F6\u65E0\u6CD5\u52A0\u8F7D\uFF0C\u6D88\u606F\u4ECD\u5B89\u5168\u4FDD\u5B58\u5728 Agent \u4E2D\u3002","yeaft.historyLoad.retry":"\u91CD\u65B0\u52A0\u8F7D","yeaft.sessionInventory.error":"\u6682\u65F6\u65E0\u6CD5\u52A0\u8F7D Session\uFF0C\u4F1A\u8BDD\u4ECD\u5B89\u5168\u4FDD\u5B58\u5728 Agent \u4E2D\u3002","yeaft.sessionInventory.retry":"\u91CD\u65B0\u52A0\u8F7D Session","chat.session.closed":"\u4F1A\u8BDD\u5DF2\u5173\u95ED","chat.session.agentOffline":"Agent \u5DF2\u79BB\u7EBF\uFF0C\u8BE5\u4F1A\u8BDD\u5C06\u5728 Agent \u91CD\u65B0\u4E0A\u7EBF\u540E\u6062\u590D\u3002","chat.execution.cancelled":"\u6267\u884C\u5DF2\u53D6\u6D88","chat.sidebar.expand":"\u5C55\u5F00\u83DC\u5355","chat.sidebar.collapse":"\u6536\u8D77\u4FA7\u8FB9\u680F","chat.sidebar.workbench":"\u5DE5\u5177\u9762\u677F","chat.sidebar.newConv":"\u4F1A\u8BDD","chat.sidebar.recentChats":"\u6700\u8FD1\u4F1A\u8BDD","chat.sidebar.resumeConv":"\u6062\u590D\u4F1A\u8BDD","chat.sidebar.lightMode":"\u6D45\u8272\u6A21\u5F0F","chat.sidebar.darkMode":"\u6DF1\u8272\u6A21\u5F0F","chat.sidebar.settings":"\u8BBE\u7F6E","chat.sidebar.emptyHint":"\u70B9\u51FB\u4E0A\u65B9\u6309\u94AE\u521B\u5EFA\u65B0\u4F1A\u8BDD","chat.sidebar.closeConv":"\u5173\u95ED\u4F1A\u8BDD","chat.sidebar.renameConv":"\u91CD\u547D\u540D","chat.sidebar.pin":"\u7F6E\u9876","chat.sidebar.unpin":"\u53D6\u6D88\u7F6E\u9876","chat.connection.connecting":"\u8FDE\u63A5\u4E2D...","chat.connection.reconnecting":"\u91CD\u8FDE\u4E2D ({current}/{max})...","chat.connection.updating":"\u670D\u52A1\u6B63\u5728\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u5019...","chat.connection.disconnected":"\u8FDE\u63A5\u65AD\u5F00","chat.connection.reconnect":"\u91CD\u8FDE","chat.connection.reconnectFailed":"\u8FDE\u63A5\u65AD\u5F00\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8FDE\u6309\u94AE\u91CD\u8BD5\u3002","chat.time.justNow":"\u521A\u521A","chat.time.minutesAgo":"{count}\u5206\u949F\u524D","chat.time.daysAgo":"{count}\u5929\u524D","chat.time.today":"\u4ECA\u5929","chat.time.yesterday":"\u6628\u5929","chat.delete.confirm":"\u786E\u5B9A\u8981\u5173\u95ED\u8FD9\u4E2A\u4F1A\u8BDD\u5417\uFF1F\u8FD9\u5C06\u7EC8\u6B62\u5BF9\u5E94\u7684 Claude \u8FDB\u7A0B\u3002","chat.delete.enterWorkDir":"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u76EE\u5F55\u8DEF\u5F84","modal.newConv.workDir":"\u5DE5\u4F5C\u76EE\u5F55","modal.newConv.inputOrSelect":"\u8F93\u5165\u6216\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55","modal.newConv.browse":"\u6D4F\u89C8\u76EE\u5F55","modal.newConv.noWorkDirs":"\u6682\u65E0\u5DE5\u4F5C\u76EE\u5F55","modal.newConv.selectAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u5728\u7EBF\u7684 Agent","modal.newConv.create":"\u521B\u5EFA\u4F1A\u8BDD","modal.newConv.folderLabel":"\u{1F4C1} \u5DE5\u4F5C\u76EE\u5F55","modal.newConv.provider":"\u63D0\u4F9B\u65B9","modal.newConv.model":"\u6A21\u578B","provider.claudeCode":"Claude Code","provider.copilot":"Copilot","modal.resume.workDir":"\u5DE5\u4F5C\u76EE\u5F55","modal.resume.inputOrSelect":"\u8F93\u5165\u6216\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55","modal.resume.browse":"\u6D4F\u89C8\u76EE\u5F55","modal.resume.tabFolders":"\u5DE5\u4F5C\u76EE\u5F55","modal.resume.tabSessions":"\u5386\u53F2\u4F1A\u8BDD","modal.resume.noWorkDirs":"\u6682\u65E0\u5DE5\u4F5C\u76EE\u5F55","modal.resume.selectWorkDir":"\u8BF7\u5148\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55","modal.resume.noSessions":"\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u5386\u53F2\u4F1A\u8BDD","modal.resume.untitled":"\u672A\u547D\u540D\u4F1A\u8BDD","modal.resume.folderLabel":"\u{1F4C1} \u5DE5\u4F5C\u76EE\u5F55","modal.resume.sessionLabel":"\u{1F4AC} \u5386\u53F2\u4F1A\u8BDD","modal.resume.selectAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u5728\u7EBF\u7684 Agent","modal.folderPicker.title":"\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55","modal.folderPicker.parentDir":"\u4E0A\u7EA7\u76EE\u5F55","welcome.subtitle":"\u9762\u5411 Session\u3001\u5DE5\u5177\u548C VP \u534F\u4F5C\u7684 Web Code Agent","welcome.agentOnline":"{count} \u4E2A Agent \u5728\u7EBF","welcome.noAgents":"\u6682\u65E0\u5728\u7EBF Agent","welcome.noAgentsHint":"\u8BF7\u5148\u542F\u52A8 Agent \u7A0B\u5E8F\u8FDE\u63A5\u5230\u670D\u52A1\u5668","welcome.noAgent":"\u6682\u65E0\u5728\u7EBF Agent","welcome.noAgentHint":"\u8BF7\u5148\u542F\u52A8 Agent \u7A0B\u5E8F\u8FDE\u63A5\u5230\u670D\u52A1\u5668","welcome.setupAgent":"\u8BBE\u7F6E Agent","welcome.setupKicker":"Agent \u63A5\u5165","welcome.setupTitle":"\u8FDE\u63A5\u4F60\u7684\u7B2C\u4E00\u4E2A Yeaft Agent","welcome.setupDesc":"\u590D\u5236\u4E24\u6761\u547D\u4EE4\u5373\u53EF\u8FDE\u63A5\u672C\u673A Agent\u3002\u6A21\u578B\u53EF\u7528 GitHub Copilot \u81EA\u52A8\u914D\u7F6E\u3002","welcome.setupInstallTitle":"\u5B89\u88C5 CLI","welcome.setupCopilotTitle":"\u914D\u7F6E\u6A21\u578B","welcome.setupRunTitle":"\u542F\u52A8 Agent","welcome.setupSecretLoading":"\u6B63\u5728\u51C6\u5907 Agent secret...","welcome.setupSecretError":"\u65E0\u6CD5\u51C6\u5907 Agent secret\uFF0C\u8BF7\u6253\u5F00\u5B89\u5168\u8BBE\u7F6E\u91CD\u8BD5\u3002","welcome.openSecuritySettings":"\u6253\u5F00\u5B89\u5168\u8BBE\u7F6E","welcome.newConv":"\u4F1A\u8BDD","welcome.resumeHistory":"\u6062\u590D\u5386\u53F2","messages.loadingMore":"\u52A0\u8F7D\u66F4\u591A\u6D88\u606F...","messages.loadMore":"\u2191 \u70B9\u51FB\u6216\u5411\u4E0A\u6EDA\u52A8\u52A0\u8F7D\u66F4\u591A","message.loadingMore":"\u52A0\u8F7D\u66F4\u591A\u6D88\u606F...","message.loadMore":"\u2191 \u70B9\u51FB\u6216\u5411\u4E0A\u6EDA\u52A8\u52A0\u8F7D\u66F4\u591A","message.scrollToLatest":"\u2193 \u6700\u65B0","message.showResponses":"\u5C55\u5F00 {count} \u6761\u56DE\u590D","message.hideResponses":"\u6298\u53E0\u56DE\u590D","message.assistant":"\u52A9\u624B","chat.waiting.disconnected":"\u8FDE\u63A5\u5DF2\u65AD\u5F00","chat.connecting":"\u6B63\u5728\u8FDE\u63A5 provider \u4F1A\u8BDD...","chat.waiting.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","chat.waiting.agentOffline":"Agent \u5DF2\u79BB\u7EBF","chat.waiting.sessionLost":"Session \u5DF2\u4E22\u5931\uFF0C\u5DF2\u5237\u65B0\uFF0C\u7B49\u5F85\u6700\u65B0\u4FE1\u606F...","chat.waiting.cliExited":"Claude \u8FDB\u7A0B\u5DF2\u9000\u51FA\uFF0C\u5DF2\u5237\u65B0\uFF0C\u7B49\u5F85\u6700\u65B0\u4FE1\u606F...","chat.waiting.refresh":"\u5237\u65B0","chat.waiting.thinking":"AI \u6B63\u5728\u601D\u8003\u4E2D\uFF0C\u8BF7\u7A0D\u5019...","btw.hint":"esc \u9000\u51FA","btw.placeholder":"\u95EE\u4E2A\u987A\u4FBF\u7684\u95EE\u9898...","btw.close":"\u9000\u51FA BTW \u6A21\u5F0F","message.copyContent":"\u590D\u5236\u5185\u5BB9","message.copy":"\u590D\u5236\u5185\u5BB9","message.copied":"\u5DF2\u590D\u5236","message.copyCode":"\u590D\u5236\u4EE3\u7801","message.copyAll":"\u590D\u5236\u5168\u90E8","message.screenshot":"\u622A\u56FE","message.screenshotting":"\u6B63\u5728\u622A\u56FE...","message.exportMd":"\u5BFC\u51FA MD","message.askInput":"\u9700\u8981\u4F60\u7684\u8F93\u5165","message.askAnswered":"\u2713 \u5DF2\u56DE\u7B54","message.askCustom":"\u6216\u8F93\u5165\u81EA\u5B9A\u4E49\u56DE\u7B54...","message.askCustomPlaceholder":"\u6216\u8F93\u5165\u81EA\u5B9A\u4E49\u56DE\u7B54...","message.askSubmit":"\u63D0\u4EA4\u56DE\u7B54","message.askWaiting":"\u7B49\u5F85\u95EE\u9898\u52A0\u8F7D...","message.askExpired":"\u6B64\u95EE\u9898\u5DF2\u5931\u6548\uFF0C\u8BF7\u8BA9\u89D2\u8272\u91CD\u65B0\u63D0\u95EE","message.openInEditor":"\u5728\u7F16\u8F91\u5668\u4E2D\u6253\u5F00","message.resultDone":"\u5B8C\u6210","message.done":"\u5B8C\u6210","message.resultRead":"\u8BFB\u53D6 {file}","message.readFile":"\u8BFB\u53D6 {name}","message.file":"\u6587\u4EF6","message.attachImages":"{count} \u5F20\u56FE\u7247","message.imageCount":"{count} \u5F20\u56FE\u7247","message.imagePreview":"\u56FE\u7247\u9884\u89C8","message.previousImage":"\u4E0A\u4E00\u5F20\u56FE\u7247","message.nextImage":"\u4E0B\u4E00\u5F20\u56FE\u7247","message.imagePosition":"\u7B2C {current} \u5F20\uFF0C\u5171 {total} \u5F20","message.imageUnavailable":"\u56FE\u7247\u65E0\u6CD5\u52A0\u8F7D","message.attachFiles":"{count} \u4E2A\u6587\u4EF6","message.fileCount":"{count} \u4E2A\u6587\u4EF6","message.quote":"\u5F15\u7528","message.removeQuote":"\u5220\u9664\u5F15\u7528","message.replyingTo":"\u6B63\u5728\u56DE\u590D {author}","message.quotedFrom":"\u5F15\u7528\u81EA {author}","message.editAsNew":"\u7F16\u8F91","message.you":"\u4F60","input.upload":"\u4E0A\u4F20\u6587\u4EF6","input.placeholder":"\u8F93\u5165\u6D88\u606F...","input.send":"\u53D1\u9001","input.stopExecution":"\u505C\u6B62\u6267\u884C","chatInput.upload":"\u4E0A\u4F20\u6587\u4EF6","chatInput.uploading":"\u6B63\u5728\u4E0A\u4F20\u2026","chatInput.uploadFailed":"\u4E0A\u4F20\u5931\u8D25","chatInput.retryUpload":"\u91CD\u8BD5","chatInput.removeAttachment":"\u79FB\u9664\u9644\u4EF6","chatInput.placeholder":"\u8F93\u5165\u6D88\u606F...","chatInput.send":"\u53D1\u9001","chatInput.stop":"\u505C\u6B62\u6267\u884C","tools.thinking":"\u601D\u8003\u4E2D...","tools.read":"\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6","tools.write":"\u6B63\u5728\u5199\u5165\u6587\u4EF6","tools.edit":"\u6B63\u5728\u7F16\u8F91\u6587\u4EF6","tools.bash":"\u6B63\u5728\u6267\u884C\u547D\u4EE4","tools.glob":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6","tools.grep":"\u6B63\u5728\u641C\u7D22\u5185\u5BB9","tools.task":"\u6B63\u5728\u6267\u884C\u4EFB\u52A1","tools.webFetch":"\u6B63\u5728\u83B7\u53D6\u7F51\u9875","tools.webSearch":"\u6B63\u5728\u641C\u7D22\u7F51\u7EDC","tools.todoWrite":"\u6B63\u5728\u66F4\u65B0\u4EFB\u52A1","tools.executing":"\u6B63\u5728\u6267\u884C {name}","status.thinking":"\u601D\u8003\u4E2D...","status.reading":"\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6","status.writing":"\u6B63\u5728\u5199\u5165\u6587\u4EF6","status.editing":"\u6B63\u5728\u7F16\u8F91\u6587\u4EF6","status.executing":"\u6B63\u5728\u6267\u884C\u547D\u4EE4","status.searchingFiles":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6","status.searchingContent":"\u6B63\u5728\u641C\u7D22\u5185\u5BB9","status.executingTask":"\u6B63\u5728\u6267\u884C\u4EFB\u52A1","status.fetching":"\u6B63\u5728\u83B7\u53D6\u7F51\u9875","status.searching":"\u6B63\u5728\u641C\u7D22\u7F51\u7EDC","status.updatingTasks":"\u6B63\u5728\u66F4\u65B0\u4EFB\u52A1","status.executingTool":"\u6B63\u5728\u6267\u884C {name}","header.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","header.compacted":"\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210","chatHeader.newConv":"\u4F1A\u8BDD","chatHeader.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","chatHeader.compactDone":"\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210","chatHeader.compact":"\u538B\u7F29\u4E0A\u4E0B\u6587","chatHeader.resume":"\u6062\u590D\u4F1A\u8BDD","chatHeader.refresh":"\u5237\u65B0\u6D88\u606F","chatHeader.reloadPage":"\u5237\u65B0\u9875\u9762","chatHeader.clear":"\u6E05\u7A7A\u6D88\u606F","chatHeader.clearing":"\u6B63\u5728\u6E05\u7A7A\u4E0A\u4E0B\u6587...","chatHeader.clearDone":"\u4E0A\u4E0B\u6587\u5DF2\u6E05\u7A7A","chatHeader.confirmClear":"\u786E\u5B9A\u8981\u6E05\u7A7A\u5F53\u524D\u4F1A\u8BDD\u7684\u6240\u6709\u6D88\u606F\u5417\uFF1F","chatHeader.mcpConfig":"MCP \u670D\u52A1\u5668\u914D\u7F6E","chatHeader.mcpNeedRestart":"\u66F4\u6539\u5C06\u5728\u91CD\u542F\u4F1A\u8BDD\u540E\u751F\u6548\u3002","chatHeader.expertPanel":"\u5E2E\u5E2E\u56E2","chatHeader.subAgentPanel":"\u5B50\u4EE3\u7406","settings.close":"\u5173\u95ED\u8BBE\u7F6E","settings.tabs.account":"\u8D26\u53F7","settings.tabs.security":"\u5B89\u5168","settings.tabs.general":"\u901A\u7528","settings.tabs.invitations":"\u9080\u8BF7","auth.sessionExpired":"\u767B\u5F55\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002","settings.account.username":"\u7528\u6237\u540D","settings.account.role":"\u89D2\u8272","settings.account.email":"\u90AE\u7BB1","settings.account.emailNotSet":"\u672A\u8BBE\u7F6E","settings.account.profileLoadFailed":"\u8D26\u53F7\u8D44\u6599\u52A0\u8F7D\u5931\u8D25","settings.account.logout":"\u9000\u51FA\u767B\u5F55","settings.account.roleAdmin":"\u7BA1\u7406\u5458","settings.account.rolePro":"Pro","settings.account.linkedAccounts":"\u5DF2\u5173\u8054\u8D26\u6237","settings.account.linkedDesc":"\u5173\u8054\u7B2C\u4E09\u65B9\u767B\u5F55\u540E\uFF0C\u4F7F\u7528\u4EFB\u610F\u4E00\u79CD\u65B9\u5F0F\u90FD\u80FD\u767B\u5F55\u6B64\u8D26\u53F7\u3002","settings.account.bind":"\u7ED1\u5B9A","settings.account.unbind":"\u89E3\u7ED1","settings.account.linked":"\u5DF2\u7ED1\u5B9A","settings.account.providerDisabled":"\u672A\u914D\u7F6E","settings.account.cantUnbindLast":"\u4E0D\u80FD\u89E3\u7ED1\u552F\u4E00\u7684\u767B\u5F55\u65B9\u5F0F","settings.account.unbindFailed":"\u89E3\u7ED1\u5931\u8D25\uFF1A{error}","settings.account.bindFailed":"\u7ED1\u5B9A\u5931\u8D25","settings.account.ssoBoundMsg":"\u5DF2\u6210\u529F\u7ED1\u5B9A {provider}\u3002","settings.account.ssoConflictMsg":"\u8BE5 {provider} \u8D26\u53F7\u5DF2\u88AB\u5176\u4ED6\u7528\u6237\u7ED1\u5B9A\u3002","settings.account.providerMicrosoft":"Microsoft","settings.account.providerGithub":"GitHub","settings.account.providerGoogle":"Google","settings.account.providerWechat":"\u5FAE\u4FE1","settings.account.providerAlipay":"\u652F\u4ED8\u5B9D","settings.security.agentKey":"Agent \u5BC6\u94A5","settings.security.agentKeyDesc":"\u7528\u4E8E Agent \u8FDE\u63A5\u8BA4\u8BC1\u7684\u5171\u4EAB\u5BC6\u94A5","settings.security.agentSetupCommands":"Agent \u63A5\u5165\u547D\u4EE4","settings.security.agentCmdInstall":"\u5B89\u88C5 Agent","settings.security.agentCmdService":"\u8FD0\u884C Agent server","settings.security.agentCmdNeedsSecret":"\u8BF7\u5148\u751F\u6210 Agent \u5BC6\u94A5\uFF0C\u4EE5\u521B\u5EFA\u5305\u542B server \u5730\u5740\u548C\u5BC6\u94A5\u7684\u547D\u4EE4\u3002","settings.security.agentCmdLlm":"Copilot \u624B\u52A8\u515C\u5E95","settings.security.agentCmdLlmDesc":"\u5148\u8FD0\u884C\u5B89\u88C5\u547D\u4EE4\uFF1B\u5982\u679C\u672C\u673A\u5DF2\u6709 GitHub Copilot token\uFF0CYeaft \u4F1A\u81EA\u52A8\u914D\u7F6E github-copilot/gpt-5.5\u3002Copilot \u547D\u4EE4\u53EA\u4F5C\u4E3A\u515C\u5E95\u4F7F\u7528\u3002","settings.security.none":"\u65E0","settings.security.show":"\u663E\u793A","settings.security.hide":"\u9690\u85CF","settings.security.generateKey":"\u751F\u6210\u5BC6\u94A5","settings.security.resetKey":"\u91CD\u7F6E\u5BC6\u94A5","settings.security.resetting":"\u91CD\u7F6E\u4E2D...","settings.security.resetWarning":"\u91CD\u7F6E\u540E\u6240\u6709 Agent \u9700\u91CD\u65B0\u914D\u7F6E","settings.security.changePassword":"\u4FEE\u6539\u5BC6\u7801","settings.security.currentPassword":"\u5F53\u524D\u5BC6\u7801","settings.security.newPassword":"\u65B0\u5BC6\u7801\uFF08\u81F3\u5C116\u4F4D\uFF09","settings.security.confirmPassword":"\u786E\u8BA4\u65B0\u5BC6\u7801","settings.security.changeBtn":"\u4FEE\u6539\u5BC6\u7801","settings.security.changing":"\u4FEE\u6539\u4E2D...","settings.security.enterCurrentPwd":"\u8BF7\u8F93\u5165\u5F53\u524D\u5BC6\u7801","settings.security.newPwdMin":"\u65B0\u5BC6\u7801\u81F3\u5C116\u4F4D","settings.security.pwdMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","settings.security.pwdChanged":"\u5BC6\u7801\u4FEE\u6539\u6210\u529F","settings.security.setPassword":"\u8BBE\u7F6E\u5BC6\u7801","settings.security.setPasswordDesc":"\u4F60\u76EE\u524D\u901A\u8FC7 SSO \u767B\u5F55\uFF0C\u5C1A\u672A\u8BBE\u7F6E\u5BC6\u7801\u3002\u8BBE\u7F6E\u540E\u5373\u53EF\u4F7F\u7528\u7528\u6237\u540D + \u5BC6\u7801\u767B\u5F55\u3002","settings.security.setBtn":"\u8BBE\u7F6E\u5BC6\u7801","settings.security.pwdSet":"\u5BC6\u7801\u8BBE\u7F6E\u6210\u529F","settings.security.deleteAccount":"\u6CE8\u9500\u8D26\u6237","settings.security.deleteAccountDesc":"\u6C38\u4E45\u5220\u9664\u4F60\u7684\u8D26\u6237\u548C\u6240\u6709\u76F8\u5173\u6570\u636E\u3002\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","settings.security.deleteBtn":"\u6CE8\u9500\u8D26\u6237","settings.security.deleteConfirmBtn":"\u786E\u8BA4\u5220\u9664","settings.security.deleteConfirmPlaceholder":"\u8F93\u5165 DELETE \u4EE5\u786E\u8BA4","settings.security.deleteConfirmRequired":"\u8BF7\u8F93\u5165 DELETE \u4EE5\u786E\u8BA4\u6CE8\u9500\u8D26\u6237","settings.security.deleteFailed":"\u6CE8\u9500\u8D26\u6237\u5931\u8D25","settings.security.deleting":"\u6CE8\u9500\u4E2D...","settings.general.theme":"\u4E3B\u9898","settings.general.lightTheme":"\u6D45\u8272","settings.general.darkTheme":"\u6DF1\u8272","settings.general.language":"\u8BED\u8A00","settings.invite.create":"\u521B\u5EFA\u9080\u8BF7\u7801","settings.invite.normalUser":"\u666E\u901A\u7528\u6237","settings.invite.proUser":"Pro \u7528\u6237","settings.invite.createBtn":"\u521B\u5EFA\u9080\u8BF7\u7801","settings.invite.creating":"\u521B\u5EFA\u4E2D...","settings.invite.list":"\u9080\u8BF7\u7801\u5217\u8868","settings.invite.used":"\u5DF2\u4F7F\u7528","settings.invite.expired":"\u5DF2\u8FC7\u671F","settings.invite.available":"\u53EF\u7528","settings.invite.usedBy":"\u4F7F\u7528\u8005: {user}","settings.invite.expiredAt":"\u8FC7\u671F\u4E8E: {time}","settings.invite.expiresAt":"\u6709\u6548\u81F3: {time}","settings.invite.noInvites":"\u6682\u65E0\u9080\u8BF7\u7801","settings.msg.copiedClipboard":"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F","settings.msg.copyFailed":"\u590D\u5236\u5931\u8D25","settings.msg.keyReset":"\u5BC6\u94A5\u5DF2\u91CD\u7F6E","settings.msg.resetFailed":"\u91CD\u7F6E\u5931\u8D25","settings.msg.changeFailed":"\u4FEE\u6539\u5931\u8D25","settings.msg.inviteCreated":"\u9080\u8BF7\u7801\u5DF2\u521B\u5EFA","settings.msg.createFailed":"\u521B\u5EFA\u5931\u8D25","settings.msg.inviteCopied":"\u9080\u8BF7\u7801\u5DF2\u590D\u5236","settings.msg.inviteDeleted":"\u9080\u8BF7\u7801\u5DF2\u5220\u9664","settings.msg.deleteFailed":"\u5220\u9664\u5931\u8D25","settings.tabs.llm":"LLM","settings.tabs.yeaft":"Yeaft","settings.yeaft.tabs.vp":"VP \u5E93","settings.yeaft.tabs.search":"\u641C\u7D22","settings.yeaft.tabs.mcp":"MCP","settings.mcp.title":"MCP \u670D\u52A1\u5668","settings.mcp.description":"\u901A\u8FC7 Model Context Protocol \u7ED9 Yeaft \u63A5\u5165\u66F4\u591A\u5DE5\u5177\u3002\u914D\u7F6E\u5199\u5165 agent \u4E0A\u7684 ~/.yeaft/config.json\uFF0C\u5DE5\u5177\u4F1A\u4EE5 mcp__<server>__<tool> \u7684\u5F62\u5F0F\u51FA\u73B0\u5728 LLM \u5DE5\u5177\u5217\u8868\u91CC\u3002","settings.mcp.reloadAll":"\u5168\u90E8\u91CD\u8FDE","settings.mcp.reloadOne":"\u91CD\u65B0\u8FDE\u63A5\u6B64\u670D\u52A1\u5668","settings.mcp.loading":"\u5904\u7406\u4E2D\u2026","settings.mcp.connected":"\u5DF2\u8FDE\u63A5","settings.mcp.disconnected":"\u672A\u8FDE\u63A5","settings.mcp.tools":"\u4E2A\u5DE5\u5177","settings.mcp.remove":"\u79FB\u9664","settings.mcp.empty":"\u8FD8\u6CA1\u6709\u914D\u7F6E MCP \u670D\u52A1\u5668\uFF0C\u53EF\u4EE5\u5728\u4E0B\u65B9\u6DFB\u52A0\u4E00\u4E2A\u3002","settings.mcp.addServer":"\u6DFB\u52A0\u670D\u52A1\u5668","settings.mcp.addServerDesc":"\u5927\u90E8\u5206 MCP \u670D\u52A1\u5668\u662F\u672C\u5730\u547D\u4EE4 \u2014 Yeaft \u4F1A\u901A\u8FC7 stdio \u542F\u52A8\u5B83\u5E76\u81EA\u52A8\u53D1\u73B0\u53EF\u7528\u5DE5\u5177\u3002","settings.mcp.serverName":"\u540D\u79F0","settings.mcp.command":"\u547D\u4EE4","settings.mcp.args":"\u53C2\u6570","settings.mcp.argsPlaceholder":"\u4F8B\u5982\uFF1A-y @modelcontextprotocol/server-filesystem /tmp","settings.mcp.env":"\u73AF\u5883\u53D8\u91CF","settings.mcp.envPlaceholder":"\u6BCF\u884C\u4E00\u4E2A KEY=value\uFF0C# \u5F00\u5934\u7684\u884C\u4F1A\u88AB\u5FFD\u7565\u3002","settings.mcp.saving":"\u4FDD\u5B58\u4E2D\u2026","settings.mcp.add":"\u6DFB\u52A0","settings.mcp.cancel":"\u6E05\u7A7A","settings.mcp.connectFailed":"\u5DF2\u4FDD\u5B58\u4F46\u8FDE\u63A5\u5931\u8D25","settings.mcp.addSuccess":"\u670D\u52A1\u5668\u5DF2\u6DFB\u52A0","settings.mcp.removeSuccess":"\u670D\u52A1\u5668\u5DF2\u79FB\u9664","settings.mcp.reloadSuccess":"\u5DF2\u8BF7\u6C42\u91CD\u8FDE","settings.mcp.confirmRemove":'\u79FB\u9664 MCP \u670D\u52A1\u5668 "{name}"\uFF1F\u4E0B\u4E00\u4E2A LLM turn \u8D77\u5B83\u7684\u5DE5\u5177\u5C06\u4E0D\u518D\u53EF\u89C1\u3002',"settings.mcp.errors.nameRequired":"\u8BF7\u586B\u5199\u540D\u79F0","settings.mcp.errors.nameFormat":"\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u77ED\u6A2A\u7EBF\u548C\u4E0B\u5212\u7EBF","settings.mcp.errors.commandRequired":"\u8BF7\u586B\u5199\u547D\u4EE4","settings.mcp.errors.argsParse":"\u53C2\u6570\u89E3\u6790\u5931\u8D25","settings.mcp.errors.envParse":"\u73AF\u5883\u53D8\u91CF\u89E3\u6790\u5931\u8D25","yeaft.session.title":"\u4F1A\u8BDD","yeaft.session.new":"+ \u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.create.title":"\u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.create.subtitle":"\u9009\u62E9\u8FD0\u884C\u4F4D\u7F6E\u548C\u5904\u7406\u4F1A\u8BDD\u7684 Provider\u3002","yeaft.session.create.close":"\u5173\u95ED","yeaft.session.create.nameLabel":"\u540D\u79F0","yeaft.session.create.namePlaceholder":"\u4F1A\u8BDD\u540D\u79F0\uFF08\u53EF\u9009\uFF09","yeaft.session.create.workDirLabel":"\u5DE5\u4F5C\u76EE\u5F55","yeaft.session.create.agentLabel":"Agent","yeaft.session.create.vpPicker":"\u9009\u62E9 VP","yeaft.session.create.vpNone":"\u672A\u9009\u62E9 VP","yeaft.session.create.vpCount":"\u5DF2\u9009 {n} \u4E2A VP","yeaft.session.create.untitled":"\u672A\u547D\u540D\u4F1A\u8BDD","yeaft.session.create.rosterEmpty":"\u6682\u65E0\u53EF\u7528 VP \u2014 \u8BF7\u5148\u5230\u89D2\u8272\u5E93\u521B\u5EFA\u3002","yeaft.session.create.rosterLoading":"VP \u52A0\u8F7D\u4E2D\u2026","yeaft.session.create.rosterError":"\u65E0\u6CD5\u4ECE\u5F53\u524D Agent \u52A0\u8F7D VP\u3002","yeaft.session.create.rosterRetry":"\u91CD\u8BD5","yeaft.vp.domain.general":"\u901A\u7528\u4E0E\u534F\u4F5C","yeaft.vp.domain.productDesign":"\u4EA7\u54C1\u4E0E\u4F53\u9A8C\u8BBE\u8BA1","yeaft.vp.domain.softwareSystems":"\u8F6F\u4EF6\u4E0E\u7CFB\u7EDF","yeaft.vp.domain.securityReliability":"\u5B89\u5168\u4E0E\u53EF\u9760\u6027","yeaft.vp.domain.scienceAnalysis":"\u79D1\u5B66\u4E0E\u5206\u6790","yeaft.vp.domain.philosophyPsychology":"\u54F2\u5B66\u4E0E\u5FC3\u7406","yeaft.vp.domain.strategyHistory":"\u6218\u7565\u4E0E\u5386\u53F2","yeaft.vp.domain.businessManagement":"\u5546\u4E1A\u4E0E\u7BA1\u7406","yeaft.vp.domain.artsCulture":"\u827A\u672F\u4E0E\u6587\u5316","yeaft.vp.domain.other":"\u5176\u4ED6\u9886\u57DF","yeaft.vp.domain.custom":"\u81EA\u5B9A\u4E49 VP","yeaft.session.create.defaultVpHint":"\u5F53\u6CA1\u6709 @ \u63D0\u53CA\u65F6\u9ED8\u8BA4\u56DE\u7B54\u7684 VP\u3002","yeaft.session.create.folderLabel":"\u{1F4C1} \u5DE5\u4F5C\u76EE\u5F55","yeaft.session.create.sessionLabel":"\u{1F4AC} \u6B64\u76EE\u5F55\u4E0B\u7684 session","yeaft.session.create.noWorkDirs":"\u8FD8\u6CA1\u6709\u4EFB\u4F55\u4F1A\u8BDD \u2014 \u5728\u4E0A\u65B9\u9009\u62E9\u6216\u8F93\u5165\u5DE5\u4F5C\u76EE\u5F55\u5F00\u59CB\u3002","yeaft.session.create.back":"\u8FD4\u56DE","yeaft.session.create.creating":"\u521B\u5EFA\u4E2D\u2026","yeaft.session.create.submit":"\u521B\u5EFA","yeaft.onboarding.ariaLabel":"Yeaft \u4E0A\u624B\u8BF4\u660E","yeaft.onboarding.topbarTitle":"\u5F00\u59CB\u4F7F\u7528 Yeaft","yeaft.onboarding.eyebrow":"Yeaft \u4E0A\u624B\u6307\u5357","yeaft.onboarding.title":"\u5148\u8FDE\u63A5 Agent\uFF0C\u518D\u5F00\u59CB\u4F1A\u8BDD","yeaft.onboarding.subtitle":"\u5728\u8D1F\u8D23\u6267\u884C\u5DE5\u5177\u7684\u673A\u5668\u4E0A\u76F4\u63A5\u8FD0\u884C\u4E0B\u9762\u7684\u547D\u4EE4\u3002agent secret \u5982\u679C\u4E0D\u5B58\u5728\uFF0C\u4F1A\u81EA\u52A8\u4E3A\u5F53\u524D\u8D26\u53F7\u751F\u6210\u3002","yeaft.onboarding.createSession":"\u521B\u5EFA\u6216\u6062\u590D Session","yeaft.onboarding.configureLlm":"\u6253\u5F00 LLM \u8BBE\u7F6E","yeaft.onboarding.secretLoading":"\u6B63\u5728\u751F\u6210 agent secret\u2026","yeaft.onboarding.secretError":"\u52A0\u8F7D agent secret \u5931\u8D25\u3002","yeaft.onboarding.secretPending":"<\u6B63\u5728\u52A0\u8F7D-agent-secret>","yeaft.onboarding.installTitle":"\u5B89\u88C5 yeaft-agent","yeaft.onboarding.installDesc":"\u5B89\u88C5\u547D\u4EE4\u884C Agent \u5305\u3002","yeaft.onboarding.connectTitle":"\u8FDE\u63A5\u8FD9\u4E2A Agent","yeaft.onboarding.connectDesc":"\u4E0B\u9762\u7684\u547D\u4EE4\u5DF2\u7ECF\u5E26\u4E0A\u5F53\u524D server URL \u548C\u81EA\u52A8\u751F\u6210\u7684 secret\u3002","yeaft.onboarding.llmTitle":"\u4F7F\u7528 GitHub Copilot","yeaft.onboarding.llmDesc":"\u5148\u767B\u5F55 GitHub CLI\uFF0C\u7136\u540E\u628A gpt-5.5 \u8BBE\u4E3A Yeaft \u9ED8\u8BA4\u6A21\u578B\u3002","yeaft.restore.modal.empty":"\u6B64\u76EE\u5F55\u4E0B\u6CA1\u6709 yeaft session","yeaft.restore.modal.scanError":"\u626B\u63CF\u5931\u8D25: {message}","yeaft.restore.modal.restoreError":"\u6062\u590D\u5931\u8D25: {message}","settings.llm.noAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent \u4EE5\u7BA1\u7406 LLM \u914D\u7F6E\u3002","settings.llm.agentOffline":"Agent \u5F53\u524D\u79BB\u7EBF\uFF0C\u65E0\u6CD5\u52A0\u8F7D LLM \u914D\u7F6E\u3002\u8BF7\u7B49\u5F85 Agent \u4E0A\u7EBF\u540E\u91CD\u8BD5\u3002","settings.llm.loading":"\u6B63\u5728\u52A0\u8F7D\u914D\u7F6E...","settings.llm.loadError":"\u52A0\u8F7D\u914D\u7F6E\u5931\u8D25","settings.llm.configureAgent":"\u914D\u7F6E\u5F53\u524D Agent \u7684 LLM","settings.llm.configureMenu":"\u8BBE\u7F6E LLM","settings.llm.simpleCopilotTitle":"\u63A8\u8350\uFF1AGitHub Copilot","settings.llm.useGitHubCopilot":"\u4F7F\u7528 GitHub Copilot","settings.llm.refreshingModels":"\u6B63\u5728\u5237\u65B0\u6A21\u578B...","settings.llm.managedCopilotTitle":"\u6258\u7BA1\u7684 GitHub Copilot","settings.llm.managedCopilotDesc":"Base URL\u3001\u8BA4\u8BC1\u3001\u6A21\u578B\u76EE\u5F55\u548C\u6BCF\u4E2A\u6A21\u578B\u7684 API \u534F\u8BAE\u90FD\u81EA\u52A8\u7BA1\u7406\u3002Claude \u6A21\u578B\u8D70 Anthropic Messages\uFF1BGPT/o \u6A21\u578B\u8D70 OpenAI Responses\u3002","settings.llm.providersTitle":"\u670D\u52A1\u5546","settings.llm.testFailed":"\u8FDE\u63A5\u6D4B\u8BD5\u5931\u8D25","settings.llm.saveSuccess":"LLM \u8BBE\u7F6E\u5DF2\u4FDD\u5B58","settings.llm.saveFailed":"\u4FDD\u5B58 LLM \u8BBE\u7F6E\u5931\u8D25","settings.llm.presets.title":"\u5FEB\u901F\u914D\u7F6E","settings.llm.providersDesc":"\u9009\u62E9\u4E00\u4E2A\u670D\u52A1\u5546\uFF0C\u4FDD\u5B58\u540E\u5373\u53EF\u5728 Session \u4E2D\u4F7F\u7528\u3002","settings.llm.agentProviders":"\u5F53\u524D agent providers","settings.llm.agentBadge":"\u5F53\u524D agent","settings.llm.addProvider":"\u6DFB\u52A0\u670D\u52A1\u5546","settings.llm.addFromPreset":"\u4ECE\u76EE\u5F55\u6DFB\u52A0","settings.llm.preset.title":"\u670D\u52A1\u5546\u76EE\u5F55\uFF08models.dev\uFF09","settings.llm.preset.refresh":"\u5237\u65B0\u76EE\u5F55","settings.llm.preset.loading":"\u52A0\u8F7D\u76EE\u5F55\u2026","settings.llm.preset.empty":"\u76EE\u5F55\u4E3A\u7A7A\u3002","settings.llm.preset.pickProvider":"\u5728\u5DE6\u4FA7\u9009\u62E9\u4E00\u4E2A\u670D\u52A1\u5546\u4EE5\u67E5\u770B\u6A21\u578B\u3002","settings.llm.preset.filterProviders":"\u8FC7\u6EE4\u670D\u52A1\u5546\u2026","settings.llm.preset.filterModels":"\u8FC7\u6EE4\u6A21\u578B\u2026","settings.llm.preset.selectAll":"\u5168\u9009","settings.llm.preset.selectNone":"\u6E05\u7A7A","settings.llm.preset.cancel":"\u53D6\u6D88","settings.llm.preset.add":"\u6DFB\u52A0\u5230\u670D\u52A1\u5546\u5217\u8868","settings.llm.preset.fetchedAt":"\u76EE\u5F55\u5DF2\u66F4\u65B0 {minutes} \u5206\u949F","settings.llm.addModel":"\u6DFB\u52A0\u6A21\u578B","settings.llm.removeModel":"\u79FB\u9664\u6A21\u578B","settings.llm.providerName":"\u540D\u79F0","settings.llm.providerNamePlaceholder":"\u4F8B\u5982 my-proxy","settings.llm.baseUrl":"Base URL","settings.llm.baseUrlPlaceholder":"\u4F8B\u5982 http://localhost:6628/v1","settings.llm.apiKey":"API Key","settings.llm.apiKeyPlaceholder":"\u8F93\u5165 API Key","settings.llm.protocol":"\u534F\u8BAE","settings.llm.protocolOpenAI":"OpenAI \u517C\u5BB9","settings.llm.protocolOpenAIResponses":"OpenAI Responses (GPT-5)","settings.llm.protocolAnthropic":"Anthropic \u539F\u751F","settings.llm.protocolHint.anthropic":"Claude \u539F\u751F Messages API\u3002","settings.llm.protocolHint.openai":"Chat Completions /v1/chat/completions \u2014 GPT-4 \u53CA\u5927\u591A\u6570\u517C\u5BB9\u4EE3\u7406\u3002","settings.llm.protocolHint.openaiResponses":"Responses API /v1/responses \u2014 GPT-5 \u7CFB\u5217\u5FC5\u987B\u3002","settings.llm.modelCtxPlaceholder":"\u4E0A\u4E0B\u6587","settings.llm.modelMaxPlaceholder":"\u8F93\u51FA","settings.llm.models":"\u5019\u9009\u6A21\u578B ID","settings.llm.modelsPlaceholder":"\u6A21\u578B ID\uFF0C\u9017\u53F7\u6216\u6362\u884C\u5206\u9694\uFF0C\u4F8B\u5982 claude-sonnet-4-20250514, gpt-5","settings.llm.modelsHint":"\u9017\u53F7\u6216\u6362\u884C\u5206\u9694\u3002","settings.llm.removeProvider":"\u79FB\u9664","settings.llm.modelSelectionTitle":"\u6A21\u578B\u9009\u62E9","settings.llm.modelSelectionDesc":"\u9009\u62E9\u9ED8\u8BA4\u6A21\u578B\u3002","settings.llm.primaryModel":"\u4E3B\u6A21\u578B","settings.llm.primaryModelDesc":"\u7528\u4E8E\u7528\u6237\u5BF9\u8BDD","settings.llm.fastModel":"\u5FEB\u901F\u6A21\u578B","settings.llm.fastModelDesc":"\u7528\u4E8E\u5185\u90E8\u4EFB\u52A1\uFF08\u8BB0\u5FC6\u3001\u603B\u7ED3\uFF09","settings.llm.noModels":"\u6682\u65E0\u53EF\u7528\u6A21\u578B\u3002\u8BF7\u5148\u6DFB\u52A0\u670D\u52A1\u5546\u3002","settings.llm.selectModel":"\u9009\u62E9\u6A21\u578B...","settings.llm.save":"\u4FDD\u5B58\u66F4\u6539","settings.llm.saving":"\u4FDD\u5B58\u4E2D...","settings.llm.saved":"\u914D\u7F6E\u5DF2\u4FDD\u5B58","settings.llm.savedRefreshWarning":"\u914D\u7F6E\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5B9E\u65F6\u6A21\u578B\u76EE\u5F55\u5237\u65B0\u5931\u8D25\uFF1A{error}","settings.llm.unsavedChanges":"\u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539","settings.llm.confirmRemoveProvider":"\u786E\u5B9A\u79FB\u9664\u6B64\u670D\u52A1\u5546\uFF1F","settings.llm.setupTitle":"\u8FDE\u63A5\u6A21\u578B","settings.llm.setupDesc":"\u63A8\u8350\u4F7F\u7528 GitHub Copilot\uFF1B\u4E5F\u53EF\u4EE5\u6DFB\u52A0\u81EA\u5DF1\u7684 API \u670D\u52A1\u5546\u3002","settings.llm.providerSectionHint":"\u53EA\u4FDD\u7559\u8FDE\u63A5\u6A21\u578B\u5FC5\u9700\u7684\u4FE1\u606F\u3002","settings.tabs.dashboard":"\u4EEA\u8868\u677F","settings.dashboard.totalUsers":"\u603B\u7528\u6237\u6570","settings.dashboard.onlineUsers":"\u5728\u7EBF\u7528\u6237","settings.dashboard.onlineAgents":"\u5728\u7EBFAgent","settings.dashboard.totalSessions":"\u603B\u4F1A\u8BDD\u6570","settings.dashboard.todayActive":"\u4ECA\u65E5\u6D3B\u8DC3","settings.dashboard.todayMessages":"\u4ECA\u65E5\u6D88\u606F","settings.dashboard.todayUserTurns":"\u4ECA\u65E5\u7528\u6237 Turn","settings.dashboard.totalTokens":"\u603B Token","settings.dashboard.tokenAccuracy":"\u6765\u81EA\u6A21\u578B\u670D\u52A1\u5546\u8FD4\u56DE\u7684\u5B9E\u9645\u7528\u91CF\uFF1B\u4ECE\u542F\u7528\u6309\u7528\u6237 Token \u7EDF\u8BA1\u7684\u7248\u672C\u5F00\u59CB\u7D2F\u8BA1\uFF0C\u4E14\u4E0D\u5305\u542B\u5FC3\u8DF3\u3002","settings.dashboard.agentTurns":"Agent Turn","settings.dashboard.agentSessions":"Agent Session","settings.dashboard.turns":"Turn","settings.dashboard.tokens":"Token","settings.dashboard.inputTokens":"\u8F93\u5165","settings.dashboard.outputTokens":"\u8F93\u51FA","settings.dashboard.cacheTokens":"\u7F13\u5B58","settings.dashboard.today":"\u4ECA\u5929","settings.dashboard.thisWeek":"\u672C\u5468","settings.dashboard.thisMonth":"\u672C\u6708","settings.dashboard.all":"\u5168\u90E8","settings.dashboard.userUsage":"\u7528\u6237\u7528\u91CF","settings.dashboard.agentList":"Agent \u5217\u8868","settings.dashboard.onlineUserList":"\u5728\u7EBF\u7528\u6237","settings.dashboard.refresh":"\u5237\u65B0","settings.dashboard.name":"\u540D\u79F0","settings.dashboard.messages":"\u6D88\u606F\u6570","settings.dashboard.userTurns":"\u7528\u6237 Turn \u6570","settings.dashboard.sessions":"\u4F1A\u8BDD\u6570","settings.dashboard.requests":"\u8BF7\u6C42\u6570","settings.dashboard.traffic":"\u6D41\u91CF","settings.dashboard.lastLogin":"\u6700\u540E\u767B\u5F55","settings.dashboard.status":"\u72B6\u6001","settings.dashboard.latency":"\u5EF6\u8FDF","settings.dashboard.version":"\u7248\u672C","settings.dashboard.owner":"\u6240\u6709\u8005","settings.dashboard.role":"\u89D2\u8272","settings.dashboard.agent":"Agent","settings.dashboard.online":"\u5728\u7EBF","settings.dashboard.offline":"\u79BB\u7EBF","settings.dashboard.noAgents":"\u6682\u65E0\u6CE8\u518C Agent","settings.dashboard.noUserData":"\u6682\u65E0\u7528\u6237\u6570\u636E","settings.dashboard.noOnlineUsers":"\u6682\u65E0\u5728\u7EBF\u7528\u6237","settings.dashboard.loading":"\u52A0\u8F7D\u4E2D...","settings.dashboard.error":"\u6570\u636E\u52A0\u8F7D\u5931\u8D25","settings.dashboard.ago":"{time}\u524D","settings.dashboard.loadMore":"\u52A0\u8F7D\u66F4\u591A\uFF08\u5269\u4F59 {remaining} \u6761\uFF09","workbench.maximize":"\u6700\u5927\u5316\u9762\u677F","workbench.restore":"\u8FD8\u539F\u9762\u677F","workbench.collapse":"\u6536\u8D77\u9762\u677F","theme.switchToLight":"\u5207\u6362\u5230\u6D45\u8272\u4E3B\u9898","theme.switchToDark":"\u5207\u6362\u5230\u6DF1\u8272\u4E3B\u9898","theme.toLight":"\u5207\u6362\u5230\u6D45\u8272\u4E3B\u9898","theme.toDark":"\u5207\u6362\u5230\u6DF1\u8272\u4E3B\u9898","terminal.splitH":"\u6C34\u5E73\u5206\u5C4F\uFF08\u5DE6\u53F3\uFF09","terminal.splitV":"\u5782\u76F4\u5206\u5C4F\uFF08\u4E0A\u4E0B\uFF09","terminal.close":"\u5173\u95ED\u5F53\u524D\u7EC8\u7AEF","terminal.autoCreate":"\u5207\u6362\u5230 Terminal \u6807\u7B7E\u65F6\u5C06\u81EA\u52A8\u521B\u5EFA\u7EC8\u7AEF","terminal.xtermError":"xterm.js \u672A\u52A0\u8F7D\uFF0C\u8BF7\u5237\u65B0\u9875\u9762","terminal.xtermNotLoaded":"xterm.js \u672A\u52A0\u8F7D\uFF0C\u8BF7\u5237\u65B0\u9875\u9762","terminal.mountError":"\u7EC8\u7AEF\u5BB9\u5668\u6302\u8F7D\u5931\u8D25","terminal.mountFailed":"\u7EC8\u7AEF\u5BB9\u5668\u6302\u8F7D\u5931\u8D25","terminal.createError":"\u7EC8\u7AEF\u521B\u5EFA\u5931\u8D25","terminal.createFailed":"\u7EC8\u7AEF\u521B\u5EFA\u5931\u8D25","terminal.error":"\u7EC8\u7AEF\u9519\u8BEF","git.selectFolder":"\u9009\u62E9\u6587\u4EF6\u5939","git.repoPath":"\u8F93\u5165 Git \u4ED3\u5E93\u8DEF\u5F84...","git.repoPathPlaceholder":"\u8F93\u5165 Git \u4ED3\u5E93\u8DEF\u5F84...","git.workDir":"Git \u5DE5\u4F5C\u76EE\u5F55","git.loadStatus":"\u52A0\u8F7D Git \u72B6\u6001","git.loading":"\u52A0\u8F7D Git \u72B6\u6001...","git.loadingStatus":"\u52A0\u8F7D Git \u72B6\u6001...","git.clean":"\u5DE5\u4F5C\u533A\u5E72\u51C0\uFF0C\u65E0\u53D8\u66F4","git.cleanWorkDir":"\u5DE5\u4F5C\u533A\u5E72\u51C0\uFF0C\u65E0\u53D8\u66F4","git.selectAgent":"\u9009\u62E9 Agent \u540E\u52A0\u8F7D Git \u72B6\u6001","git.selectAgentFirst":"\u9009\u62E9 Agent \u540E\u52A0\u8F7D Git \u72B6\u6001","git.diffOnly":"\u53EA\u770B\u5DEE\u5F02","git.fullFile":"\u770B\u5168\u6587","git.zoomIn":"\u653E\u5927\u5B57\u4F53","git.zoomOut":"\u7F29\u5C0F\u5B57\u4F53","git.loadingDiff":"\u52A0\u8F7D Diff...","git.clickToView":"\u70B9\u51FB\u6587\u4EF6\u67E5\u770B\u5DEE\u5F02","git.clickFileToView":"\u70B9\u51FB\u6587\u4EF6\u67E5\u770B\u5DEE\u5F02","git.selectRepo":"\u9009\u62E9 Git \u4ED3\u5E93","git.noDiff":"(\u65E0\u5DEE\u5F02)","git.binaryFile":"(\u4E8C\u8FDB\u5236\u6587\u4EF6)","files.notLoaded":"\u672A\u52A0\u8F7D","files.newFile":"\u65B0\u5EFA\u6587\u4EF6","files.newFolder":"\u65B0\u5EFA\u6587\u4EF6\u5939","files.collapseAll":"\u6298\u53E0\u6240\u6709","files.openFolder":"\u6253\u5F00\u6587\u4EF6\u5939","files.deleteSelected":"\u5220\u9664\u9009\u4E2D","files.moveSelected":"\u79FB\u52A8\u9009\u4E2D","files.enterPath":"\u8F93\u5165\u8DEF\u5F84...","files.searchFiles":"\u641C\u7D22\u6587\u4EF6... (Ctrl+P)","files.noMatch":"\u65E0\u5339\u914D\u7ED3\u679C","files.searching":"\u641C\u7D22\u4E2D...","files.loadingTree":"\u52A0\u8F7D\u4E2D...","files.emptyDir":"\u7A7A\u76EE\u5F55","files.loadingFile":"\u52A0\u8F7D\u6587\u4EF6...","files.searchPlaceholder":"\u641C\u7D22...","files.replacePlaceholder":"\u66FF\u6362...","files.replace":"\u66FF\u6362","files.replaceAll":"\u5168\u90E8","files.replaceCurrent":"\u66FF\u6362\u5F53\u524D","files.replaceAllTitle":"\u5168\u90E8\u66FF\u6362","files.clickToView":"\u70B9\u51FB\u6587\u4EF6\u67E5\u770B\u5185\u5BB9","files.selectFolder":"\u9009\u62E9\u6587\u4EF6\u5939","files.enterFolderName":"\u8F93\u5165\u6587\u4EF6\u5939\u540D...","files.enterFileName":"\u8F93\u5165\u6587\u4EF6\u540D...","files.moveTarget":"\u8F93\u5165\u76EE\u6807\u76EE\u5F55\u8DEF\u5F84...","files.moveItems":"\u5C06 {count} \u4E2A\u9879\u76EE\u79FB\u52A8\u5230\u6307\u5B9A\u76EE\u5F55","files.workDir":"\u5DE5\u4F5C\u76EE\u5F55: {dir}","files.enterDirPath":"\u8F93\u5165\u76EE\u5F55\u8DEF\u5F84...","files.unsavedConfirm":'"{name}" \u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF0C\u786E\u5B9A\u5173\u95ED\uFF1F',"files.deleteConfirm":'\u786E\u5B9A\u8981\u5220\u9664 "{name}" \u5417\uFF1F',"files.deleteDirHint":"\uFF08\u5C06\u5220\u9664\u6587\u4EF6\u5939\u53CA\u5176\u6240\u6709\u5185\u5BB9\uFF09","files.deleteSelectedConfirm":"\u786E\u5B9A\u8981\u5220\u9664\u9009\u4E2D\u7684 {count} \u4E2A\u9879\u76EE\u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002","files.findPrev":"\u4E0A\u4E00\u4E2A (Shift+Enter)","files.findNext":"\u4E0B\u4E00\u4E2A (Enter)","files.caseSensitive":"\u533A\u5206\u5927\u5C0F\u5199","files.regex":"\u6B63\u5219\u8868\u8FBE\u5F0F","files.unsaved":"\u672A\u4FDD\u5B58","files.clearSelection":"\u6E05\u9664\u9009\u62E9","files.rename":"\u91CD\u547D\u540D","files.copyHere":"\u590D\u5236","files.moveTo":"\u79FB\u52A8\u5230...","files.download":"\u4E0B\u8F7D","files.enterNewName":"\u8F93\u5165\u65B0\u540D\u79F0...","files.loadingPreview":"\u52A0\u8F7D\u9884\u89C8\u4E2D...","files.preview":"\u9884\u89C8","files.edit":"\u7F16\u8F91","files.pptxNotSupported":"PPTX \u672C\u5730\u9884\u89C8\u6682\u4E0D\u652F\u6301\uFF0C\u8BF7\u5728\u8BBE\u7F6E\u4E2D\u5207\u6362\u4E3A Office Online \u6A21\u5F0F\u3002","files.officePreviewMode":"Office \u9884\u89C8\u6A21\u5F0F","files.officeOnline":"Office Online","files.localRender":"\u672C\u5730\u6E32\u67D3","proxy.port":"\u7AEF\u53E3","proxy.label":"\u6807\u7B7E","proxy.add":"\u6DFB\u52A0\u7AEF\u53E3\u6620\u5C04","proxy.addPort":"\u6DFB\u52A0\u7AEF\u53E3\u6620\u5C04","proxy.enable":"\u70B9\u51FB\u542F\u7528","proxy.clickEnable":"\u70B9\u51FB\u542F\u7528","proxy.disable":"\u70B9\u51FB\u7981\u7528","proxy.clickDisable":"\u70B9\u51FB\u7981\u7528","proxy.openNewTab":"\u5728\u65B0\u6807\u7B7E\u9875\u6253\u5F00","proxy.openInBrowser":"\u5728\u65B0\u6807\u7B7E\u9875\u6253\u5F00","proxy.noMappings":"\u6682\u65E0\u7AEF\u53E3\u6620\u5C04","proxy.noPorts":"\u6682\u65E0\u7AEF\u53E3\u6620\u5C04","proxy.hint":"\u6DFB\u52A0\u7AEF\u53E3\u540E\uFF0C\u53EF\u901A\u8FC7\u4EE3\u7406 URL \u8BBF\u95EE agent \u673A\u5668\u4E0A\u7684\u672C\u5730\u670D\u52A1","proxy.noPortsHint":"\u6DFB\u52A0\u7AEF\u53E3\u540E\uFF0C\u53EF\u901A\u8FC7\u4EE3\u7406 URL \u8BBF\u95EE agent \u673A\u5668\u4E0A\u7684\u672C\u5730\u670D\u52A1","proxy.selectAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent","store.selectAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent","store.creatingConv":"\u6B63\u5728\u521B\u5EFA\u4F1A\u8BDD...","store.loadingHistory":"\u6B63\u5728\u52A0\u8F7D\u4F1A\u8BDD\u5386\u53F2...","store.executionCancelled":"\u6267\u884C\u5DF2\u53D6\u6D88","store.loginFailed":"\u767B\u5F55\u5931\u8D25","store.convClosed":"\u4F1A\u8BDD\u5DF2\u5173\u95ED","store.convCreated":"\u65B0\u4F1A\u8BDD\u5DF2\u521B\u5EFA [{agent}]\uFF0C\u5DE5\u4F5C\u76EE\u5F55: {workDir}","store.convResumed":"\u5DF2\u6062\u590D\u4F1A\u8BDD [{agent}]: {sessionId}","roleplay.creating":"\u6B63\u5728\u521B\u5EFA \u89D2\u8272\u626E\u6F14 \u4F1A\u8BDD...","roleplay.working":"\u5DE5\u4F5C\u4E2D","roleplay.selectTeam":"\u9009\u62E9\u56E2\u961F\u6A21\u677F","roleplay.teamDev":"\u8F6F\u4EF6\u5F00\u53D1","roleplay.teamCustom":"\u81EA\u5B9A\u4E49","roleplay.editRoles":"\u7F16\u8F91\u89D2\u8272","roleplay.roleName":"\u89D2\u8272\u6807\u8BC6","roleplay.roleDisplayName":"\u663E\u793A\u540D\u79F0","roleplay.roleIcon":"\u56FE\u6807","roleplay.roleDesc":"\u89D2\u8272\u63CF\u8FF0","roleplay.rolePrompt":"\u89D2\u8272 Prompt","roleplay.removeRole":"\u79FB\u9664\u89D2\u8272","roleplay.addRole":"\u6DFB\u52A0\u89D2\u8272","roleplay.start":"\u542F\u52A8 \u89D2\u8272\u626E\u6F14","roleplay.sidebarTitle":"\u89D2\u8272\u626E\u6F14","roleplay.configTitle":"\u89D2\u8272\u626E\u6F14","roleplay.newSession":"\u65B0\u5EFA \u89D2\u8272\u626E\u6F14","roleplay.emptyHint":"\u53D1\u9001\u6D88\u606F\u5F00\u59CB\u591A\u89D2\u8272\u534F\u4F5C","roleplay.askingYou":"\u6B63\u5728\u63D0\u95EE","roleplay.language":"\u8BED\u8A00","roleplay.rolePreview":"\u89D2\u8272\u914D\u7F6E","roleplay.noAgents":"\u6CA1\u6709\u5728\u7EBF\u7684 Agent","roleplay.inputPlaceholder":"\u8F93\u5165\u6D88\u606F\u2026 \u4F7F\u7528 @ \u63D0\u53CA\u89D2\u8272","roleplay.existingSessions":"\u5DF2\u6709\u56E2\u961F","roleplay.restore":"\u6062\u590D","roleplay.restoring":"\u6B63\u5728\u6062\u590D \u89D2\u8272\u626E\u6F14 \u4F1A\u8BDD...","roleplay.createNew":"\u521B\u5EFA\u65B0\u56E2\u961F","expertPanel.title":"\u5E2E\u5E2E\u56E2","expertPanel.search":"\u641C\u7D22\u89D2\u8272\u6216 Action...","expertPanel.noResults":"\u6CA1\u6709\u5339\u914D\u7ED3\u679C","expertPanel.clearAll":"\u6E05\u7A7A","expertPanel.persona":"\u89D2\u8272\u4EBA\u8BBE","expertPanel.template":"\u6709\u8F93\u5165\u65F6 \xB7 \u6D88\u606F\u524D\u7F00","expertPanel.templateHint":"\u7528\u6237\u5199\u4E86\u6587\u5B57\u65F6\uFF1A\u6B64\u524D\u7F00 + \u7528\u6237\u6587\u5B57 = \u6700\u7EC8\u53D1\u9001\u5185\u5BB9","expertPanel.defaultMsg":"\u65E0\u8F93\u5165\u65F6 \xB7 \u5B8C\u6574 Prompt","expertPanel.defaultMsgHint":"\u7528\u6237\u4E0D\u5199\u6587\u5B57\u76F4\u63A5\u53D1\u9001\u65F6\uFF0C\u4F7F\u7528\u6B64\u5B8C\u6574 prompt","expertPanel.loading":"\u6B63\u5728\u52A0\u8F7D\u89D2\u8272\u5B9A\u4E49...","expertPanel.viewPrompt":"\u67E5\u770B\u63D0\u793A\u8BCD","expertPanel.customRoles":"\u81EA\u5B9A\u4E49\u89D2\u8272","expertPanel.addRole":"\u6DFB\u52A0\u89D2\u8272","expertPanel.editRole":"\u7F16\u8F91\u89D2\u8272","expertPanel.deleteRole":"\u5220\u9664\u89D2\u8272","expertPanel.noCustomRoles":"\u6682\u65E0\u81EA\u5B9A\u4E49\u89D2\u8272","expertPanel.createFirst":"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u81EA\u5B9A\u4E49\u89D2\u8272","expertPanel.noActions":"\u6682\u65E0 Action","expertPanel.deleteConfirm":'\u786E\u5B9A\u8981\u5220\u9664\u89D2\u8272 "{name}" \u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002',"expertPanel.deleteConfirmBtn":"\u5220\u9664","expertEditor.createTitle":"\u521B\u5EFA\u81EA\u5B9A\u4E49\u89D2\u8272","expertEditor.editTitle":"\u7F16\u8F91\u81EA\u5B9A\u4E49\u89D2\u8272","expertEditor.basicInfo":"\u57FA\u672C\u4FE1\u606F","expertEditor.roleName":"\u89D2\u8272\u540D\u79F0","expertEditor.roleNamePlaceholder":"\u5982\uFF1A\u6570\u636E\u5206\u6790\u5E08","expertEditor.roleTitle":"\u804C\u79F0","expertEditor.roleTitlePlaceholder":"\u5982\uFF1A\u9AD8\u7EA7\u6570\u636E\u5206\u6790\u5E08","expertEditor.fullName":"\u5168\u540D","expertEditor.fullNamePlaceholder":"\u53EF\u9009","expertEditor.titleEn":"\u82F1\u6587\u804C\u79F0","expertEditor.titleEnPlaceholder":"\u53EF\u9009","expertEditor.rolePrompt":"\u89D2\u8272 Prompt","expertEditor.messagePrefix":"\u6D88\u606F\u524D\u7F00\uFF08\u4E2D\u6587\uFF09","expertEditor.messagePrefixPlaceholder":"\u5982\uFF1A\u4F5C\u4E3A\u4E00\u540D\u8D44\u6DF1\u6570\u636E\u5206\u6790\u5E08\uFF0C","expertEditor.messagePrefixEn":"\u6D88\u606F\u524D\u7F00\uFF08\u82F1\u6587\uFF09","expertEditor.messagePrefixEnPlaceholder":"As a senior data analyst, ","expertEditor.actions":"Actions","expertEditor.addAction":"\u6DFB\u52A0 Action","expertEditor.removeAction":"\u79FB\u9664","expertEditor.actionName":"Action \u540D\u79F0","expertEditor.actionNamePlaceholder":"\u5982\uFF1A\u6570\u636E\u5206\u6790","expertEditor.actionNameEn":"\u82F1\u6587\u540D\u79F0","expertEditor.actionNameEnPlaceholder":"\u53EF\u9009","expertEditor.messageTemplate":"\u6709\u8F93\u5165\u65F6 \xB7 \u6D88\u606F\u524D\u7F00\uFF08\u4E2D\u6587\uFF09","expertEditor.messageTemplatePlaceholder":"\u7528\u6237\u5199\u4E86\u6587\u5B57\u65F6\uFF0C\u62FC\u5728\u7528\u6237\u6587\u5B57\u524D\u9762\u53D1\u9001","expertEditor.messageTemplateEn":"\u6709\u8F93\u5165\u65F6 \xB7 \u6D88\u606F\u524D\u7F00\uFF08\u82F1\u6587\uFF09","expertEditor.messageTemplateEnPlaceholder":"Prepended to user text when user types something","expertEditor.defaultMessage":"\u65E0\u8F93\u5165\u65F6 \xB7 \u5B8C\u6574 Prompt\uFF08\u4E2D\u6587\uFF09","expertEditor.defaultMessagePlaceholder":"\u7528\u6237\u4E0D\u5199\u6587\u5B57\u76F4\u63A5\u53D1\u9001\u65F6\uFF0C\u4F7F\u7528\u6B64\u5B8C\u6574\u5185\u5BB9","expertEditor.defaultMessageEn":"\u65E0\u8F93\u5165\u65F6 \xB7 \u5B8C\u6574 Prompt\uFF08\u82F1\u6587\uFF09","expertEditor.defaultMessageEnPlaceholder":"Used as-is when user sends without typing","expertEditor.cancel":"\u53D6\u6D88","expertEditor.save":"\u4FDD\u5B58","expertEditor.saving":"\u4FDD\u5B58\u4E2D...","subAgentPanel.title":"\u5B50\u4EE3\u7406","subAgentPanel.back":"\u8FD4\u56DE\u5217\u8868","subAgentPanel.running":"\u8FD0\u884C\u4E2D","subAgentPanel.completed":"\u5DF2\u5B8C\u6210","subAgentPanel.waitingMessages":"\u7B49\u5F85\u6D88\u606F...","subAgentPanel.toolCount":"{count} \u4E2A\u5DE5\u5177","subAgentPanel.toolSummary":"\u5DF2\u5B8C\u6210 {count} \u6B21\u5DE5\u5177\u8C03\u7528","subAgentPanel.empty":"\u6682\u65E0\u5B50\u4EE3\u7406","subAgentPanel.emptyHint":"\u5F53 Claude \u59D4\u6D3E\u4EFB\u52A1\u65F6\uFF0C\u5B50\u4EE3\u7406\u4F1A\u5728\u8FD9\u91CC\u663E\u793A","splitScreen.split":"\u5206\u5C4F","splitScreen.closePane":"\u5173\u95ED\u6B64\u9762\u677F","splitScreen.newChat":"\u65B0\u5EFA Chat","splitScreen.noSessions":"\u6682\u65E0\u4F1A\u8BDD","splitScreen.splitToPanel":"\u5728\u65B0\u9762\u677F\u4E2D\u6253\u5F00","splitScreen.selectFromSidebar":"\u4ECE\u5DE6\u4FA7\u9009\u62E9\u5BF9\u8BDD","yeaft.vp.library":"\u89D2\u8272\u5E93","yeaft.vp.createFirst":"+ \u521B\u5EFA\u4F60\u7684\u7B2C\u4E00\u4E2A\u89D2\u8272","yeaft.vp.empty.aria":"\u5C1A\u65E0\u89D2\u8272","yeaft.vp.avatar.aria":"{name} \u5934\u50CF","yeaft.vp.speaker.stateCauseAria":"\u72B6\u6001\u53D8\u66F4\uFF1A{cause}","yeaft.vp.status.thinking":"\u6B63\u5728\u601D\u8003\u2026","yeaft.vp.status.tool":"\u6B63\u5728\u4F7F\u7528 {name}","yeaft.vp.status.done":"\u5B8C\u6210 \xB7 {count} \u4E2A\u5DE5\u5177","yeaft.vp.status.aborted":"\u5DF2\u4E2D\u6B62","yeaft.vp.crud.title":"\u89D2\u8272\u5E93","yeaft.vp.crud.close":"\u5173\u95ED","yeaft.vp.crud.addNew":"+ \u65B0\u5EFA\u89D2\u8272","yeaft.vp.crud.empty":"\u8FD8\u6CA1\u6709\u89D2\u8272\u3002\u521B\u5EFA\u7B2C\u4E00\u4E2A\u89D2\u8272\u5F00\u59CB\u534F\u4F5C\u5427\u3002","yeaft.vp.crud.edit":"\u7F16\u8F91","yeaft.vp.crud.delete":"\u5220\u9664","yeaft.vp.crud.deleteConfirm":'\u5220\u9664 "{name}"\uFF1F\u4F1A\u4E00\u5E76\u5220\u9664\u78C1\u76D8\u4E0A\u7684 role.md \u6587\u4EF6\u3002',"yeaft.vp.crud.form.create":"\u521B\u5EFA\u89D2\u8272","yeaft.vp.crud.form.update":"\u7F16\u8F91\u89D2\u8272","yeaft.vp.crud.form.vpId":"\u89D2\u8272 ID","yeaft.vp.crud.form.vpId.tooltip":"\u53EA\u80FD\u7528\u5B57\u6BCD\u3001\u6570\u5B57\u3001- \u548C _\uFF0C\u4E0D\u80FD\u4EE5 _ \u5F00\u5934\uFF0C\u4E0D\u80FD\u662F\u7EAF\u6570\u5B57\uFF0C\u4E0D\u80FD\u7528\u4FDD\u7559\u540D\uFF1Aall / user / system / everyone\u3002","yeaft.vp.crud.form.displayName":"\u663E\u793A\u540D\uFF08\u82F1\u6587\uFF09","yeaft.vp.crud.form.displayNameZh":"\u663E\u793A\u540D\uFF08\u4E2D\u6587\uFF09","yeaft.vp.crud.form.description":"\u80FD\u529B\u63CF\u8FF0\uFF08\u82F1\u6587\uFF09","yeaft.vp.crud.form.descriptionZh":"\u80FD\u529B\u63CF\u8FF0\uFF08\u4E2D\u6587\uFF09","yeaft.vp.crud.form.descriptionPlaceholder":"\u4F8B\u5982\uFF1AAPI design, migration planning, and compatibility reviews","yeaft.vp.crud.form.descriptionZhPlaceholder":"\u4F8B\u5982\uFF1AAPI \u8BBE\u8BA1\u3001\u8FC1\u79FB\u89C4\u5212\u4E0E\u517C\u5BB9\u6027\u8BC4\u5BA1","yeaft.vp.crud.form.role":"\u804C\u4F4D","yeaft.vp.crud.form.rolePlaceholder":"\u4F8B\u5982\uFF1A\u4EA7\u54C1\u7ECF\u7406","yeaft.vp.crud.form.traits":"\u7279\u8D28\u6807\u7B7E","yeaft.vp.crud.form.traitsHint":"\u7528\u82F1\u6587\u9017\u53F7\u5206\u9694\u7684\u77ED\u6807\u7B7E\uFF08\u4F8B\u5982\uFF1A\u597D\u5947, \u52A1\u5B9E\uFF09\u3002","yeaft.vp.crud.form.modelHint":"\u6A21\u578B\u504F\u597D","yeaft.vp.crud.form.modelHint.none":"\u2014 \u9ED8\u8BA4 \u2014","yeaft.vp.crud.form.modelHint.primary":"\u4E3B\u6A21\u578B","yeaft.vp.crud.form.modelHint.fast":"\u5FEB\u6A21\u578B","yeaft.vp.crud.form.persona":"\u4EBA\u8BBE\uFF08Markdown\uFF09","yeaft.vp.crud.form.personaPlaceholder":"\u63CF\u8FF0\u8FD9\u4E2A\u89D2\u8272\u5982\u4F55\u601D\u8003\u3001\u8868\u8FBE\u3001\u505A\u51B3\u7B56\u2026\u2026","yeaft.vp.crud.form.submit":"\u4FDD\u5B58","yeaft.vp.crud.form.cancel":"\u53D6\u6D88","yeaft.vp.crud.form.ok":"\u683C\u5F0F\u6B63\u786E","yeaft.vp.crud.form.idLocked":"\u521B\u5EFA\u540E\u89D2\u8272 ID \u4E0D\u53EF\u4FEE\u6539\u3002","yeaft.vp.crud.saving":"\u4FDD\u5B58\u4E2D\u2026\u2026","yeaft.vp.crud.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}","yeaft.vp.crud.deleteFailed":"\u5220\u9664\u5931\u8D25\uFF1A{error}","yeaft.vp.crud.viewPrompt":"\u67E5\u770B prompt","yeaft.vp.crud.view.title":"VP \u63D0\u793A\u8BCD","yeaft.vp.crud.view.personaEmpty":"\uFF08\u672A\u5B9A\u4E49 persona \u6B63\u6587\uFF0C\u53EA\u6709\u57FA\u7840\u5143\u6570\u636E\uFF09","yeaft.vp.crud.view.back":"\u8FD4\u56DE","yeaft.vp.crud.view.editFromHere":"\u7F16\u8F91\u8BE5 VP","yeaft.vp.crud.view.removed":"\u8BE5 VP \u5DF2\u5728\u522B\u5904\u88AB\u5220\u9664\uFF0C\u8FD4\u56DE\u5217\u8868\u3002","yeaft.vp.crud.stockBadge":"\u9884\u88C5","yeaft.vp.crud.stockReadOnly":"\u9884\u88C5 VP \u968F agent \u51FA\u5382\uFF0C\u4E0D\u80FD\u7F16\u8F91\u6216\u5220\u9664\u3002","yeaft.vp.idError.empty_or_non_string":"\u89D2\u8272 ID \u4E0D\u80FD\u4E3A\u7A7A\u3002","yeaft.vp.idError.too_long":"\u89D2\u8272 ID \u592A\u957F\uFF08\u6700\u591A 40 \u5B57\u7B26\uFF09\u3002","yeaft.vp.idError.illegal_character":'\u53EA\u80FD\u4F7F\u7528\u5B57\u6BCD\u3001\u6570\u5B57\u3001"-" \u548C "_"\u3002',"yeaft.vp.idError.underscore_prefix_reserved":'\u89D2\u8272 ID \u4E0D\u80FD\u4EE5 "_" \u5F00\u5934\uFF08\u9884\u7559\u7ED9\u7CFB\u7EDF\u89D2\u8272\uFF09\u3002',"yeaft.vp.idError.pure_digits":"\u89D2\u8272 ID \u4E0D\u80FD\u662F\u7EAF\u6570\u5B57\u3002","yeaft.vp.idError.reserved":"\u89D2\u8272 ID \u4E0D\u80FD\u7528\u4FDD\u7559\u540D\uFF08all / user / system / everyone\uFF09\u3002","yeaft.vp.idError.duplicate":"\u5DF2\u7ECF\u5B58\u5728\u540C ID \u7684\u89D2\u8272\u3002","yeaft.vp.idError.not_found":"\u8BE5 VP \u4E0D\u5B58\u5728\uFF0C\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u3002","yeaft.vp.idError.stock_readonly":"\u9884\u88C5 VP \u4E0D\u80FD\u7F16\u8F91\u6216\u5220\u9664\u3002","yeaft.vp.idError.unknown":"\u53D1\u751F\u672A\u77E5\u9519\u8BEF\uFF0C\u8BF7\u91CD\u8BD5\u3002","yeaft.vp.reason.personaEdit":"\u4EBA\u8BBE\u5DF2\u66F4\u65B0","yeaft.vp.reason.traitsEdit":"\u7279\u5F81\u5DF2\u66F4\u65B0","yeaft.vp.reason.manualReload":"\u5DF2\u91CD\u65B0\u8F7D\u5165","yeaft.vp.reason.fileRemoved":"\u5DF2\u79FB\u9664","yeaft.vp.reason.toast.updated":"{name}\uFF1A{reason}","yeaft.vp.reason.toast.removed":"{name} \u5DF2\u88AB\u79FB\u9664","yeaft.message.timeAria":"\u53D1\u9001\u4E8E {time}","yeaft.user.youLabel":"\u6211","yeaft.session.sidebarTitle":"\u4F1A\u8BDD","yeaft.session.sidebarAria":"\u4F1A\u8BDD\u5217\u8868","yeaft.session.newButton":"+ \u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.newButtonAria":"\u521B\u5EFA\u65B0\u4F1A\u8BDD","yeaft.session.empty":"\u6682\u65E0\u4F1A\u8BDD\u3002","yeaft.session.membersCount":"{count} \u4F4D\u6210\u5458","yeaft.session.oneMember":"1 \u4F4D\u6210\u5458","yeaft.session.noMembers":"\u7A7A\u4F1A\u8BDD \u2014 \u8BF7\u9080\u8BF7 VP","yeaft.session.defaultBadge":"\u9ED8\u8BA4","yeaft.session.defaultName":"\u9ED8\u8BA4\u4F1A\u8BDD","yeaft.session.moreActions":"\u66F4\u591A\u64CD\u4F5C","yeaft.session.archive":"\u5F52\u6863","yeaft.session.archiveConfirm":"\u5F52\u6863\u300C{name}\u300D\uFF1F\u7A0D\u540E\u53EF\u4ECE\u78C1\u76D8\u6062\u590D\u3002","yeaft.session.archivingEllipsis":"\u5F52\u6863\u4E2D\u2026","yeaft.session.delete":"\u5220\u9664","yeaft.session.deleteConfirm":"\u5220\u9664\u300C{name}\u300D\uFF1F\u5C06\u6C38\u4E45\u5220\u9664\u8BE5\u4F1A\u8BDD\u53CA\u5176\u6240\u6709\u6570\u636E\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002","yeaft.session.deletingEllipsis":"\u5220\u9664\u4E2D\u2026","yeaft.session.rename":"\u91CD\u547D\u540D","yeaft.session.openSettings":"\u8BBE\u7F6E","yeaft.session.removeFromList":"\u79FB\u9664","yeaft.session.manageMembers":"\u7BA1\u7406\u6210\u5458","yeaft.session.memberCount.one":"1 \u4F4D\u6210\u5458","yeaft.session.memberCount.other":"{count} \u4F4D\u6210\u5458","yeaft.session.renamePrompt":"\u4E3A\u300C{name}\u300D\u8F93\u5165\u65B0\u540D\u79F0\uFF1A","yeaft.session.renamingEllipsis":"\u91CD\u547D\u540D\u4E2D\u2026","yeaft.session.editModal.renameTitle":"\u91CD\u547D\u540D\u4F1A\u8BDD","yeaft.session.editModal.renameBody":"\u4E3A\u300C{name}\u300D\u9009\u62E9\u4E00\u4E2A\u65B0\u540D\u79F0\u3002","yeaft.session.editModal.renameSubmit":"\u4FDD\u5B58","yeaft.session.editModal.archiveTitle":"\u5F52\u6863\u4F1A\u8BDD","yeaft.session.editModal.archiveBody":"\u5F52\u6863\u300C{name}\u300D\uFF1F\u7A0D\u540E\u53EF\u4ECE\u78C1\u76D8\u6062\u590D\u3002","yeaft.session.editModal.archiveSubmit":"\u5F52\u6863","yeaft.session.editModal.deleteTitle":"\u5220\u9664\u4F1A\u8BDD","yeaft.session.editModal.deleteBody":"\u5220\u9664\u300C{name}\u300D\uFF1F\u5C06\u6C38\u4E45\u5220\u9664\u8BE5\u4F1A\u8BDD\u53CA\u5176\u6240\u6709\u6570\u636E\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002","yeaft.session.editModal.deleteSubmit":"\u5220\u9664","yeaft.session.editModal.newNameLabel":"\u65B0\u540D\u79F0","yeaft.session.editModal.cancel":"\u53D6\u6D88","yeaft.session.editModal.close":"\u5173\u95ED","yeaft.session.error.invalid_name":"\u4F1A\u8BDD\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\u3002","yeaft.session.error.duplicate":"\u8BE5\u4F1A\u8BDD id \u5DF2\u5B58\u5728\u3002","yeaft.session.error.not_found":"\u672A\u627E\u5230\u8BE5\u4F1A\u8BDD\u3002","yeaft.session.error.default_not_in_roster":"\u9ED8\u8BA4 VP \u5FC5\u987B\u5728\u6210\u5458\u5217\u8868\u4E2D\u3002","yeaft.session.error.no_default_vp":"\u8BE5\u4F1A\u8BDD\u6CA1\u6709\u6210\u5458\uFF0C\u8BF7\u4ECE\u89D2\u8272\u5E93\u6DFB\u52A0 VP \u4EE5\u5F00\u59CB\u5BF9\u8BDD\u3002","yeaft.session.error.reserved":"\u6240\u9009 id \u4E2D\u5305\u542B\u4FDD\u7559\u540D\uFF08all / user / system / everyone\uFF09\u3002","yeaft.session.error.unknown":"\u4F1A\u8BDD\u64CD\u4F5C\u5931\u8D25\uFF1A{message}","yeaft.session.error.timeout":"\u4F1A\u8BDD\u64CD\u4F5C\u8D85\u65F6\uFF0C\u8BF7\u91CD\u8BD5\u3002","yeaft.session.invite.title":"\u9080\u8BF7 VP","yeaft.session.invite.body":"\u300C{name}\u300D\u5F53\u524D\u4E3A\u7A7A\uFF0C\u8BF7\u4ECE\u89D2\u8272\u5E93\u6DFB\u52A0\u4E00\u4F4D VP \u4EE5\u5F00\u59CB\u5BF9\u8BDD\u3002","yeaft.session.invite.openLibrary":"\u6253\u5F00\u89D2\u8272\u5E93","yeaft.session.invite.dismiss":"\u6682\u4E0D","yeaft.session.empty.title":"\u7A7A\u4F1A\u8BDD","yeaft.session.empty.hint":"\u300C{name}\u300D\u8FD8\u6CA1\u6709\u6210\u5458\u3002\u6DFB\u52A0\u4E00\u4F4D VP \u5373\u53EF\u5F00\u59CB\u5BF9\u8BDD\u3002","yeaft.session.empty.cta":"\u7BA1\u7406\u6210\u5458","yeaft.session.members.title":"\u7BA1\u7406\u300C{name}\u300D\u7684\u6210\u5458","yeaft.session.members.aria":"\u6210\u5458\u7BA1\u7406","yeaft.session.members.close":"\u5173\u95ED","yeaft.session.members.done":"\u5B8C\u6210","yeaft.session.members.empty":"\u6682\u65E0\u53EF\u7528 VP \u2014 \u8BF7\u5148\u5230\u89D2\u8272\u5E93\u521B\u5EFA\u3002","yeaft.session.members.loading":"VP \u52A0\u8F7D\u4E2D\u2026","yeaft.session.members.defaultHint":"\u9ED8\u8BA4 VP\uFF08@\u63D0\u53CA\u7F3A\u7701\u65F6\u7531\u8BE5 VP \u5E94\u7B54\uFF09","yeaft.session.members.memberCount":"\u5DF2\u9009 {count} \u4F4D","yeaft.session.members.actionFailed":"\u64CD\u4F5C\u5931\u8D25\uFF1A{error}","yeaft.session.members.openLibrary":"\u6253\u5F00 VP \u5E93","yeaft.session.members.openLibraryHint":"\u5728 VP \u5E93\u53EF\u521B\u5EFA\u65B0 VP \u6216\u67E5\u770B VP \u7684 prompt\u3002","yeaft.session.announcement.label":"\u4F1A\u8BDD\u516C\u544A","yeaft.session.announcement.hintEmpty":"\u6682\u65E0\u516C\u544A \u2014 \u70B9\u51FB \u270F\uFE0F \u6DFB\u52A0\u3002","yeaft.session.announcement.emptyBody":"\u672A\u8BBE\u7F6E\u4F1A\u8BDD\u516C\u544A\u3002\u53EF\u4EE5\u5728\u8FD9\u91CC\u5199\u4E00\u6BB5\u7B80\u4ECB\uFF0C\u4F1A\u8BDD\u5185\u6240\u6709 VP \u5728\u6536\u5230\u6D88\u606F\u65F6\u90FD\u4F1A\u5728 system prompt \u9876\u90E8\u770B\u5230 \u2014 \u9002\u5408\u5199\u5171\u540C\u80CC\u666F\u3001\u89C4\u5219\u3001\u6216 CLAUDE.md \u5F0F\u7684\u6307\u5F15\u3002","yeaft.session.announcement.placeholder":"\u4E3A\u8FD9\u4E2A\u4F1A\u8BDD\u91CC\u7684\u6240\u6709 VP \u5199\u4E00\u6BB5\u5171\u4EAB\u7684\u7B80\u4ECB\u2026","yeaft.session.announcement.edit":"\u7F16\u8F91\u516C\u544A","yeaft.session.announcement.editTitle":"\u7F16\u8F91\u4F1A\u8BDD\u516C\u544A","yeaft.session.announcement.saving":"\u4FDD\u5B58\u4E2D\u2026","yeaft.session.announcement.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}","yeaft.session.announcement.openSettings":"\u6253\u5F00\u4F1A\u8BDD\u8BBE\u7F6E","yeaft.session.settings.title":"{name} \u2014 \u4F1A\u8BDD\u8BBE\u7F6E","yeaft.session.settings.short":"\u4F1A\u8BDD","yeaft.session.settings.close":"\u5173\u95ED","yeaft.session.settings.nav.session":"\u4F1A\u8BDD","yeaft.session.settings.nav.members":"\u6210\u5458","yeaft.session.settings.nav.memory":"\u4F1A\u8BDD\u8BB0\u5FC6","yeaft.session.settings.announcement.heading":"\u4F1A\u8BDD\u516C\u544A","yeaft.session.settings.announcement.help":"\u6CE8\u5165\u5230\u4F1A\u8BDD\u5185\u6BCF\u4E2A VP \u7684 system prompt \u9876\u90E8 \u2014 \u7C7B\u4F3C\u56E2\u961F\u5171\u4EAB\u7684 CLAUDE.md\u3002","yeaft.session.settings.members.heading":"\u6210\u5458","yeaft.session.settings.rename.heading":"\u91CD\u547D\u540D\u4F1A\u8BDD","yeaft.session.settings.rename.label":"\u65B0\u540D\u79F0","yeaft.session.settings.rename.save":"\u4FDD\u5B58\u540D\u79F0","yeaft.session.settings.rename.saving":"\u4FDD\u5B58\u4E2D\u2026","yeaft.session.settings.memory.heading":"\u4F1A\u8BDD\u8BB0\u5FC6","yeaft.session.settings.memory.help":"\u7ACB\u5373\u8FD0\u884C dream \u6574\u7406\uFF1A\u8BFB\u53D6\u4E0A\u6B21\u4EE5\u6765\u7684\u65B0\u6D88\u606F\uFF0C\u63D0\u53D6\u8981\u70B9\u5E76\u5408\u5E76\u8FDB\u4F1A\u8BDD\u7684 summary\uFF0C\u8BA9 Resident \u5C42\u80FD\u53CD\u6620\u6700\u65B0\u7684\u5BF9\u8BDD\u3002","yeaft.session.settings.memory.runNow":"\u7ACB\u5373\u8FD0\u884C dream","yeaft.session.settings.memory.running":"\u8FD0\u884C\u4E2D\u2026","yeaft.session.settings.memory.lastSuccess":"\u4E0A\u6B21\u6210\u529F\uFF1A{time} \u2014 \u66F4\u65B0\u4E86 {count} \u4E2A\u76EE\u6807\u3002","yeaft.session.settings.memory.lastError":"\u4E0A\u6B21\u8FD0\u884C\u5931\u8D25\uFF1A{error}","yeaft.session.settings.danger.heading":"\u5220\u9664\u4F1A\u8BDD","yeaft.session.settings.danger.deleteHelp":"\u8FD9\u4F1A\u6C38\u4E45\u5220\u9664\u8BE5\u4F1A\u8BDD\uFF0C\u79FB\u9664\u78C1\u76D8\u4E0A\u7684 session.json \u548C\u5168\u90E8\u6D88\u606F\u5386\u53F2\uFF0C\u4E0D\u53EF\u6062\u590D\u3002","yeaft.session.settings.danger.deleteBtn":"\u5220\u9664\u4F1A\u8BDD","yeaft.vp.mention.placeholder":"\u6309 id \u6216\u540D\u79F0\u641C\u7D22\u89D2\u8272\u2026","yeaft.vp.mention.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u89D2\u8272","yeaft.vp.mention.count":"\u5DF2 @{count} \u4EBA","yeaft.feature.reject.missing_group_id":"\u53D1\u9001\u5931\u8D25\uFF1A\u672A\u6307\u5B9A\u4F1A\u8BDD\u3002","yeaft.feature.reject.missing_feature_id":"\u53D1\u9001\u5931\u8D25\uFF1A\u4EFB\u52A1\u4E0A\u4E0B\u6587\u4E22\u5931\u3002","yeaft.feature.reject.missing_vp_id":"\u53D1\u9001\u5931\u8D25\uFF1A\u672A\u8BBE\u7F6E\u53D1\u8A00\u8005\u3002","yeaft.feature.reject.invalid_vp_id":"\u53D1\u9001\u5931\u8D25\uFF1A\u53D1\u8A00\u8005 id \u975E\u6CD5\u3002","yeaft.feature.reject.empty_text":"\u53D1\u9001\u5931\u8D25\uFF1A\u5185\u5BB9\u4E3A\u7A7A\u3002","yeaft.feature.reject.text_too_long":"\u53D1\u9001\u5931\u8D25\uFF1A\u5185\u5BB9\u8FC7\u957F\uFF08\u4E0A\u9650 16 KiB\uFF09\u3002","yeaft.feature.reject.unknown":"\u53D1\u9001\u5931\u8D25\u3002","yeaft.feature.pill.label":"\u4EFB\u52A1","yeaft.feature.messageTime.aria":"\u53D1\u9001\u4E8E {time}","yeaft.vp.turnBlock.elapsedTitle":"\u672C\u8F6E turn \u5F00\u59CB\u81F3\u4ECA\u7684\u65F6\u95F4","yeaft.vp.turnBlock.retryingRequest":"\u54CD\u5E94\u505C\u6EDE\uFF0C\u6B63\u5728\u53D1\u8D77\u5168\u65B0\u8BF7\u6C42\uFF08{attempt}/{max}\uFF09","yeaft.vp.turnBlock.retryingContinue":"\u54CD\u5E94\u505C\u6EDE\uFF0C\u6B63\u5728\u7528\u5168\u65B0\u8BF7\u6C42\u7EED\u5199\uFF08{attempt}/{max}\uFF09","yeaft.sessionStatus.aria":"Session \u72B6\u6001","yeaft.sessionStatus.title":"Session \u72B6\u6001","yeaft.sessionStatus.announcement":"\u516C\u544A","yeaft.sessionStatus.announcementEmpty":"\u6682\u65E0\u516C\u544A","yeaft.sessionStatus.announcementAdd":"\u6DFB\u52A0\u516C\u544A","yeaft.sessionStatus.announcementEdit":"\u7F16\u8F91\u516C\u544A","yeaft.sessionStatus.vps":"VP","yeaft.sessionStatus.backgroundTasks":"\u540E\u53F0\u4EFB\u52A1","yeaft.sessionStatus.noLogPreview":"\u6682\u65E0\u65E5\u5FD7\u8F93\u51FA\u3002","yeaft.sessionStatus.task.subAgentStarted":"{name} \u5DF2\u542F\u52A8","yeaft.sessionStatus.task.subAgentStartedWithMission":"{name} \u5DF2\u542F\u52A8\uFF1A{mission}","yeaft.sessionStatus.task.subAgentStatus":"{name} \u72B6\u6001\uFF1A{status}","yeaft.sessionStatus.task.subAgentStatusUpdated":"{name} \u72B6\u6001\u5DF2\u66F4\u65B0","yeaft.sessionStatus.task.subAgentResult":"{name} \u7ED3\u679C\uFF1A{text}","yeaft.sessionStatus.task.subAgentProducedResult":"{name} \u5DF2\u4EA7\u751F\u7ED3\u679C","yeaft.sessionStatus.task.subAgentUsedTool":"{name} \u8C03\u7528\u4E86 {tool}","yeaft.sessionStatus.task.subAgentFinishedTool":"{name} \u5B8C\u6210\u4E86 {tool}","yeaft.sessionStatus.task.subAgentUsage":"{name} \u4F7F\u7528\u4E86 {tokens} tokens","yeaft.sessionStatus.task.subAgentEvent":"{name}\uFF1A{text}","yeaft.sessionStatus.task.subAgentUserPrompt":"\u4F60\uFF1A{text}","yeaft.sessionStatus.task.subAgentToolSummary":"\u5DF2\u5B8C\u6210 {count} \u6B21\u5DE5\u5177\u8C03\u7528","yeaft.sessionStatus.task.subAgentError":"{name} \u9519\u8BEF\uFF1A{error}","yeaft.sessionStatus.task.subAgentHitError":"{name} \u9047\u5230\u9519\u8BEF","yeaft.sessionStatus.task.subAgentNoReadableEvents":"\u6682\u65E0\u53EF\u8BFB\u7684 sub-agent \u6D3B\u52A8\u3002","yeaft.sessionStatus.task.promptPlaceholder":"\u7ED9\u8FD9\u4E2A sub-agent \u8FFD\u52A0\u60F3\u6CD5\u2026","yeaft.sessionStatus.task.promptSend":"\u53D1\u9001","yeaft.sessionStatus.task.promptSending":"\u53D1\u9001\u4E2D\u2026","yeaft.sessionStatus.task.promptFailed":"\u53D1\u9001\u5931\u8D25\u3002","yeaft.sessionStatus.task.title":"\u4EFB\u52A1","yeaft.sessionStatus.task.command":"\u547D\u4EE4","yeaft.sessionStatus.task.stop":"\u505C\u6B62\u4EFB\u52A1","yeaft.sessionStatus.task.stopping":"\u505C\u6B62\u4E2D\u2026","yeaft.sessionStatus.task.kind.subAgent":"sub-agent","yeaft.sessionStatus.task.kind.shell":"shell","yeaft.sessionStatus.show":"\u663E\u793A Session \u72B6\u6001","yeaft.sessionStatus.hide":"\u9690\u85CF Session \u72B6\u6001","yeaft.sessionStatus.close":"\u5173\u95ED Session \u72B6\u6001","yeaft.vpTimeline.empty":"\u672C Session \u8FD8\u6CA1\u6709 VP\u3002","yeaft.vpTimeline.resizeTitle":"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6","yeaft.vpTimeline.status.idle":"\u7A7A\u95F2","yeaft.vpTimeline.status.typing":"\u8F93\u5165\u4E2D\u2026","yeaft.vpTimeline.status.thinking":"\u601D\u8003\u4E2D\u2026","yeaft.vpTimeline.status.retrying":"\u6B63\u5728\u91CD\u8BD5\u8BF7\u6C42\u2026","yeaft.vpTimeline.status.streaming":"\u751F\u6210\u4E2D","yeaft.vpTimeline.status.tool":"\u8C03\u7528\u5DE5\u5177\u4E2D\u2026","yeaft.vpTimeline.status.error":"\u51FA\u9519","yeaft.vpTimeline.status.offline":"\u79BB\u7EBF","yeaft.vpTimeline.abort":"\u4E2D\u6B62","yeaft.vpTimeline.edit":"\u7F16\u8F91 VP","yeaft.vpTimeline.mention":"\u70B9\u51FB @ \u8BE5 VP","yeaft.vpTimeline.expand":"\u5C55\u5F00\u4EFB\u52A1\u8BE6\u60C5","yeaft.toolStats.title":"\u5DE5\u5177\u4F7F\u7528\u7EDF\u8BA1","yeaft.toolStats.refresh":"\u5237\u65B0","yeaft.toolStats.close":"\u5173\u95ED","yeaft.toolStats.tabAll":"\u5168\u90E8\u5DE5\u5177","yeaft.toolStats.tabUnused":"\u672A\u4F7F\u7528","yeaft.toolStats.loading":"\u52A0\u8F7D\u4E2D\u2026","yeaft.toolStats.notLoaded":"\u6682\u65E0\u6570\u636E \u2014 \u70B9\u51FB\u5237\u65B0\u3002","yeaft.toolStats.empty":"\uFF08\u6682\u65E0\u5DE5\u5177\u8C03\u7528\u8BB0\u5F55\uFF09","yeaft.toolStats.noneUnused":"\uFF08\u6BCF\u4E2A\u5DF2\u6CE8\u518C\u5DE5\u5177\u90FD\u81F3\u5C11\u88AB\u8C03\u7528\u8FC7\u4E00\u6B21\uFF09","yeaft.toolStats.fetchedAt":"\u83B7\u53D6\u65F6\u95F4","yeaft.toolStats.col.name":"\u5DE5\u5177","yeaft.toolStats.col.calls":"\u8C03\u7528","yeaft.toolStats.col.errors":"\u9519\u8BEF","yeaft.toolStats.col.errRate":"\u9519\u8BEF\u7387","yeaft.toolStats.col.p50":"p50","yeaft.toolStats.col.p95":"p95","yeaft.toolStats.col.avg":"\u5E73\u5747","yeaft.toolStats.col.last":"\u6700\u8FD1","yeaft.toolStats.buttonLabel":"\u5DE5\u5177\u7EDF\u8BA1","workCenter.title":"\u5DE5\u4F5C\u4E2D\u5FC3","workCenter.subtitle":"\u7531\u5F53\u524D Agent \u6301\u7EED\u63A8\u8FDB\u7684\u6301\u4E45\u5DE5\u4F5C","workCenter.agent":"Agent","workCenter.selectAgent":"\u9009\u62E9 Agent","workCenter.noOnlineAgents":"\u6CA1\u6709\u5728\u7EBF Agent","workCenter.noAvailableAgents":"\u6CA1\u6709\u517C\u5BB9\u5DE5\u4F5C\u4E2D\u5FC3\u7684\u5728\u7EBF Agent","workCenter.new":"\u65B0\u5EFA","workCenter.newWorkItem":"\u65B0\u5EFA\u5DE5\u4F5C\u9879","workCenter.workItem":"\u5DE5\u4F5C\u9879","workCenter.createFirst":"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u5DE5\u4F5C\u9879","workCenter.backToChat":"\u8FD4\u56DE\u5BF9\u8BDD","workCenter.refresh":"\u5237\u65B0","workCenter.search":"\u641C\u7D22\u5DE5\u4F5C\u9879","workCenter.filter":"\u7B5B\u9009","workCenter.filterAttention":"\u9700\u8981\u5904\u7406","workCenter.filterActive":"\u6267\u884C\u4E2D","workCenter.filterAll":"\u5168\u90E8","workCenter.filterDone":"\u5DF2\u5B8C\u6210","workCenter.attentionItems":"\u9700\u8981\u5904\u7406","workCenter.board.active":"\u8FDB\u884C\u4E2D","workCenter.board.needsAttention":"\u9700\u8981\u5904\u7406","workCenter.board.closed":"\u5DF2\u5173\u95ED","workCenter.board.emptyLane":"\u6682\u65E0\u5DE5\u4F5C\u9879","workCenter.board.lanes":"\u5DE5\u4F5C\u9879\u5206\u680F","workCenter.filterVp":"\u6309 VP \u7B5B\u9009","workCenter.filterType":"\u6309\u7C7B\u578B\u7B5B\u9009","workCenter.filterUpdated":"\u6309\u66F4\u65B0\u65F6\u95F4\u7B5B\u9009","workCenter.allVps":"\u5168\u90E8 VP","workCenter.allTypes":"\u5168\u90E8\u7C7B\u578B","workCenter.anyTime":"\u4E0D\u9650\u65F6\u95F4","workCenter.lastDay":"\u6700\u8FD1 24 \u5C0F\u65F6","workCenter.lastWeek":"\u6700\u8FD1 7 \u5929","workCenter.deleteWorkItem":"\u5220\u9664 Work Item","workCenter.deleteConfirm":"\u6C38\u4E45\u5220\u9664\u8FD9\u4E2A Work Item\u3001\u6267\u884C\u5386\u53F2\u548C\u9644\u4EF6\uFF1F","workCenter.deleteRequiresStop":"\u8BF7\u5148\u505C\u6B62\u8FD9\u4E2A Work Item \u518D\u5220\u9664","workCenter.lastMonth":"\u6700\u8FD1 30 \u5929","workCenter.assignment.planned":"\u8BA1\u5212\u5206\u914D","workCenter.created":"\u521B\u5EFA\u4E8E","workCenter.files":"\u4E2A\u6587\u4EF6","workCenter.loadMore":"\u52A0\u8F7D\u66F4\u591A","workCenter.activeItems":"\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C","workCenter.allItems":"\u5168\u90E8\u5DE5\u4F5C\u9879","workCenter.completedItems":"\u5DF2\u5B8C\u6210","workCenter.watcherActive":"Watcher \u8FD0\u884C\u4E2D","workCenter.loading":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u4F5C\u9879\u2026","workCenter.noTimestamp":"\u65E0\u65F6\u95F4\u6233","workCenter.updated":"\u66F4\u65B0\u65F6\u95F4","workCenter.emptyTitle":"\u8FD8\u6CA1\u6709\u5DE5\u4F5C\u9879","workCenter.emptyBody":"\u5F53\u5DE5\u4F5C\u9700\u8981\u8DE8\u8D8A\u4E00\u6B21\u5BF9\u8BDD\u3001\u7B49\u5F85\u6216\u89D2\u8272\u63A5\u529B\u65F6\uFF0C\u628A\u5B83\u521B\u5EFA\u4E3A\u6301\u4E45\u5DE5\u4F5C\u9879\u3002","workCenter.noAttentionTitle":"\u5F53\u524D\u6CA1\u6709\u9700\u8981\u5904\u7406\u7684\u5DE5\u4F5C\u9879","workCenter.noAttentionBody":"\u7B49\u5F85\u4F60\u56DE\u7B54\u6216\u9700\u8981\u6062\u590D\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noActiveTitle":"\u5F53\u524D\u6CA1\u6709\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C\u9879","workCenter.noActiveBody":"\u8349\u7A3F\u3001\u5C31\u7EEA\u548C\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noCompletedTitle":"\u8FD8\u6CA1\u6709\u5DF2\u5B8C\u6210\u7684\u5DE5\u4F5C\u9879","workCenter.noCompletedBody":"\u5B8C\u6210\u540E\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noMatchesTitle":"\u6CA1\u6709\u5339\u914D\u7684\u5DE5\u4F5C\u9879","workCenter.noMatchesBody":"\u5C1D\u8BD5\u8C03\u6574\u641C\u7D22\u5185\u5BB9\u6216\u7B5B\u9009\u6761\u4EF6\u3002","workCenter.selectTitle":"\u5DE5\u4F5C\u9879\u8BE6\u60C5","workCenter.detailLoading":"\u6B63\u5728\u52A0\u8F7D\u5B8C\u6574\u8BE6\u60C5\u2026","workCenter.detailLoadFailed":"\u65E0\u6CD5\u52A0\u8F7D\u5B8C\u6574\u8BE6\u60C5","workCenter.start":"\u5F00\u59CB","workCenter.retry":"\u91CD\u8BD5","workCenter.cancel":"\u53D6\u6D88","workCenter.closeWorkItem":"\u5173\u95ED\u8BE6\u60C5","workCenter.cancelWorkItem":"\u505C\u6B62\u5DE5\u4F5C\u9879","workCenter.cancelWorkItemHint":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u6240\u6709\u5C1A\u672A\u5B8C\u6210\u7684 Actions\u3002","workCenter.cancelConfirm":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u5176\u5C1A\u672A\u5B8C\u6210\u7684 Actions\uFF1F","workCenter.stopWorkItem":"\u505C\u6B62\u5DE5\u4F5C\u9879","workCenter.resumeWorkItem":"\u6062\u590D\u5DE5\u4F5C\u9879","workCenter.breadcrumbs":"Work Center \u5BFC\u822A","workCenter.actionNumber":"Action {number}","workCenter.actionBreadcrumb":"Action {number}\uFF1A{description}","workCenter.untitledAction":"\u672A\u547D\u540D Action","workCenter.workItems":"\u5DE5\u4F5C\u9879","workCenter.description":"\u9700\u6C42\u63CF\u8FF0","workCenter.goal":"\u76EE\u6807","workCenter.acceptanceCriteria":"\u9A8C\u6536\u6761\u4EF6","workCenter.noCriteria":"\u672A\u63D0\u4F9B\u9A8C\u6536\u6761\u4EF6","workCenter.failureReason":"\u5931\u8D25\u539F\u56E0","workCenter.workflow":"\u4EFB\u52A1\u6D41","workCenter.triageSummary":"Triage \u6458\u8981","workCenter.actionFlow":"Action \u6D41\u7A0B","workCenter.viewActions":"\u67E5\u770B Actions","workCenter.actionsPanel":"Actions","workCenter.closeActions":"\u5173\u95ED Actions","workCenter.actionCount":"{count} \u4E2A Action","workCenter.noActionSummary":"\u6682\u65E0\u6458\u8981","workCenter.actionProgress":"{completed} / {total} \u4E2A Action","workCenter.currentAction":"\u5F53\u524D Action","workCenter.expandActions":"\u5C55\u5F00 Action","workCenter.collapseActions":"\u6536\u8D77","workCenter.actionObjective":"\u8FD9\u6B21\u8981\u505A\u4EC0\u4E48","workCenter.actionApproach":"\u51C6\u5907\u600E\u4E48\u505A","workCenter.actionExpectedOutcome":"\u671F\u5F85\u7684\u7ED3\u679C","workCenter.dependencies":"\u4F9D\u8D56\u9879","workCenter.actionResult":"\u6700\u65B0\u7ED3\u679C","workCenter.currentProgress":"\u5F53\u524D\u8FDB\u5EA6","workCenter.actionMessages":"\u6D88\u606F","workCenter.loops":"\u4E2A Loop","workCenter.tools":"\u6B21\u5DE5\u5177\u8C03\u7528","workCenter.noActionMessages":"\u8FD8\u6CA1\u6709\u6D88\u606F\u3002","workCenter.actionDetails":"Action \u8BE6\u60C5","workCenter.selectAction":"\u9009\u62E9\u4E00\u4E2A Action","workCenter.backToWorkItems":"\u5DE5\u4F5C\u9879","workCenter.backToActions":"\u8FD4\u56DE Actions","workCenter.you":"\u4F60","workCenter.noRequestDetails":"\u8FD9\u4E2A Action \u6682\u65F6\u6CA1\u6709\u53EF\u7528\u7684\u6267\u884C\u8BB0\u5F55\u3002","workCenter.loadingRequests":"\u6B63\u5728\u52A0\u8F7D\u6267\u884C\u8BB0\u5F55\u2026","workCenter.loadingRequestDetail":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u5177\u8BC1\u636E\u2026","workCenter.requestDetailUnavailable":"\u5DE5\u5177\u8BC1\u636E\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u8BD5\u3002","workCenter.noRequestLoops":"\u8FD9\u6B21\u6267\u884C\u6CA1\u6709\u4FDD\u7559\u4E0B\u53EF\u5C55\u793A\u7684 Loop\u3002","workCenter.requestDetailTruncated":"\u6267\u884C\u5185\u5BB9\u8F83\u5927\uFF1A{summarized} \u4E2A Loop \u663E\u793A\u6458\u8981\uFF0C\u53E6\u6709 {omitted} \u4E2A\u8F83\u65E9 Loop \u672A\u663E\u793A\u3002","workCenter.loopDetailTruncated":"\u8FD9\u4E2A Loop \u5185\u5BB9\u8F83\u5927\uFF0C\u5F53\u524D\u663E\u793A\u4FDD\u7559\u4E0B\u6765\u7684\u5DE5\u5177\u8BC1\u636E\u3002","workCenter.loadEarlierMessages":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","workCenter.loadingEarlierMessages":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","workCenter.unknownModel":"\u672A\u77E5\u6A21\u578B","workCenter.loop":"Loop","workCenter.actionBrief":"\u4EFB\u52A1\u8BF4\u660E","workCenter.executionSummary":"\u6267\u884C\u6458\u8981","workCenter.toolParameters":"\u8C03\u7528\u53C2\u6570","workCenter.toolResult":"\u6267\u884C\u7ED3\u679C","workCenter.noToolCalls":"\u8FD9\u4E2A Loop \u6CA1\u6709\u5DE5\u5177\u8C03\u7528\u3002","workCenter.actionInputPlaceholder":"\u8865\u5145\u4E0A\u4E0B\u6587\u3001\u56DE\u7B54\u95EE\u9898\u6216\u8C03\u6574\u8FD9\u4E2A Action","workCenter.actionInputResumeHint":"\u4F60\u7684\u8F93\u5165\u4F1A\u5E26\u7740\u65B0\u589E\u4E0A\u4E0B\u6587\u7EE7\u7EED\u8FD9\u4E2A Action\u3002","workCenter.waitingQuestionTitle":"\u9700\u8981\u4F60\u7684\u56DE\u7B54","workCenter.actionInputRetryHint":"\u8865\u5145\u4FEE\u6B63\u8BF4\u660E\u6216\u6587\u4EF6\u540E\uFF0C\u4F7F\u7528\u65B0\u4E0A\u4E0B\u6587\u91CD\u65B0\u6267\u884C\u8FD9\u4E2A Action\u3002","workCenter.actionInputContinueHint":"\u8FD9\u91CC\u53EA\u76F4\u63A5\u5E72\u9884\u5F53\u524D Action\u3002","workCenter.actionFailedTitle":"\u8FD9\u4E2A Action \u4E3A\u4EC0\u4E48\u5931\u8D25","workCenter.failedAt":"\u5931\u8D25\u65F6\u95F4","workCenter.actionFailureRecovery":"\u5728\u5DE5\u4F5C\u9879\u8F93\u5165\u6846\u4E2D\u9009\u62E9\u6B64 Action\uFF0C\u518D\u53D1\u9001\u4FEE\u6B63\u8BF4\u660E\u3002","workCenter.sendInput":"\u53D1\u9001\u7ED9 Action","workCenter.sendingInput":"\u6B63\u5728\u53D1\u9001\u2026","workCenter.retryAction":"\u91CD\u8BD5 Action","workCenter.sendAndRetryAction":"\u53D1\u9001\u5E76\u91CD\u8BD5 Action","workCenter.coordinatorDecision.guide_actions":"\u5DF2\u66F4\u65B0 Action \u6307\u4EE4","workCenter.coordinatorDecision.replan":"\u5DF2\u66F4\u65B0\u76EE\u6807\u6216\u8BA1\u5212","workCenter.coordinatorDecision.request_human":"\u9700\u8981\u4EBA\u5DE5\u8865\u5145\u4FE1\u606F","workCenter.conversation":"\u5BF9\u8BDD","workCenter.contentPane":"\u5185\u5BB9","workCenter.workItemPanes":"\u5DE5\u4F5C\u9879\u9762\u677F","workCenter.coordinator":"\u534F\u8C03\u8005","workCenter.coordinatorTargetHint":"\u5DE5\u4F5C\u9879\u89C4\u5212\u4E0E\u534F\u8C03","workCenter.composerTarget":"\u6D88\u606F\u76EE\u6807","workCenter.targetUnavailable":"\u6240\u9009 Action \u5DF2\u4E0D\u53EF\u7528","workCenter.targetUnavailableHelp":"\u53D1\u9001\u524D\u8BF7\u9009\u62E9\u5176\u4ED6\u76EE\u6807\uFF1B\u7CFB\u7EDF\u6CA1\u6709\u91CD\u5B9A\u5411\u8FD9\u4EFD\u8349\u7A3F\u3002","workCenter.sendToCoordinatorInstead":"\u6539\u53D1\u7ED9 Coordinator","workCenter.sendToTarget":"\u53D1\u9001\u7ED9 {target}","workCenter.answerWithTarget":"\u5728\u5BF9\u8BDD\u8F93\u5165\u6846\u4E2D\u9009\u62E9\u76F8\u5173\u76EE\u6807\uFF0C\u7136\u540E\u56DE\u590D\u3002","workCenter.conversationThinking":"\u5904\u7406\u4E2D\u2026","workCenter.conversationReadOnly":"\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u5DF2\u5173\u95ED\uFF0C\u5BF9\u8BDD\u8BB0\u5F55\u4ECD\u53EF\u67E5\u770B\u3002","workCenter.conversationPlaceholder":"\u7EE7\u7EED\u8BA8\u8BBA\u8FD9\u4E2A\u5DE5\u4F5C\u9879","workCenter.sendMessage":"\u53D1\u9001\u6D88\u606F","workCenter.messageSpeakerRole":"{name} \xB7 {role}","workCenter.originalRequest":"\u539F\u59CB\u9700\u6C42","workCenter.actionMessageScopeTitle":"\u7ED9\u8FD9\u4E2A Action \u53D1\u6D88\u606F","workCenter.actionMessageScope":"\u6D88\u606F\u53EA\u53D1\u9001\u7ED9\u5F53\u524D Action\u3002","workCenter.actionConversation":"\u5BF9\u8BDD","workCenter.actionConversationWith":"Action \u6267\u884C\u8005","workCenter.actionViews":"Action \u89C6\u56FE","workCenter.actionExecutor":"\u6267\u884C\u8005","workCenter.actionExecutorPending":"\u7B49\u5F85\u5206\u914D\u6267\u884C\u8005","workCenter.actionInformation":"Action \u4FE1\u606F","workCenter.messageExecutor":"\u7ED9 {name} \u53D1\u6D88\u606F","workCenter.actionChatPlaceholder":"\u5728\u5BF9\u8BDD\u8F93\u5165\u6846\u4E2D\u7ED9 {name} \u53D1\u6D88\u606F","workCenter.statusLabel":"\u72B6\u6001","workCenter.llmRequestsLabel":"LLM \u8BF7\u6C42","workCenter.loopsLabel":"Loops","workCenter.toolsLabel":"\u5DE5\u5177","workCenter.tokensLabel":"Tokens","workCenter.workItemMessagePlaceholder":"\u8865\u5145\u6574\u4E2A Work Item \u7684\u65B9\u5411\u6216\u7EA6\u675F","workCenter.sendWorkItemMessage":"\u53D1\u9001\u7ED9 Work Item","workCenter.fromSession":"\u4ECE\u5F53\u524D Session \u521B\u5EFA\u5DE5\u4F5C\u9879","workCenter.llmRequestCount":"{count} \u6B21 LLM \u8BF7\u6C42","workCenter.loopCount":"{count} \u6B21 Loop","workCenter.toolCount":"{count} \u4E2A\u5DE5\u5177","workCenter.tokenCount":"{count} tokens","workCenter.tokenBreakdown":"\u8F93\u5165 {input} / \u8F93\u51FA {output} / \u7F13\u5B58 {cache}","workCenter.guidance":"\u7ED9\u5F53\u524D Action \u8865\u5145\u63D0\u793A","workCenter.guidanceHint":"\u8865\u5145\u7EA6\u675F\uFF0C\u6216\u8C03\u6574\u5F53\u524D Action \u7684\u6267\u884C\u65B9\u5411","workCenter.guidanceRestartHint":"\u53D1\u9001\u540E\u4F1A\u4F7F\u7528\u65B0\u63D0\u793A\u91CD\u542F\u5F53\u524D Action\u3002","workCenter.sendGuidance":"\u53D1\u9001\u63D0\u793A","workCenter.reuseMemory":"\u4F7F\u7528\u76F8\u5173 Agent memory \u548C\u6B64\u9879\u76EE\u7684\u5DF2\u5B8C\u6210\u5DE5\u4F5C","workCenter.reuseMemoryHelp":"\u5305\u62EC\u53D7 scope \u7EA6\u675F\u7684 Agent memory\uFF0C\u4EE5\u53CA canonical \u9879\u76EE\u76EE\u5F55\u76F8\u540C\u7684\u5DF2\u5B8C\u6210 Work Item \u7ED3\u6784\u5316\u6458\u8981\u548C\u8BC1\u636E\uFF1B\u4E0D\u4F1A\u590D\u7528\u539F\u59CB\u5DE5\u5177\u8F93\u51FA\u3002","workCenter.resumeAnswer":"\u56DE\u7B54\u7B49\u5F85\u4E2D\u7684\u95EE\u9898","workCenter.resumeAnswerHint":"\u63D0\u4F9B\u7EE7\u7EED\u6267\u884C\u6240\u9700\u7684\u4FE1\u606F","workCenter.answerInActionDetail":"\u5728\u5BF9\u8BDD\u8F93\u5165\u6846\u4E2D\u5C06\u76EE\u6807\u8BBE\u4E3A\u5F53\u524D Action\uFF0C\u7136\u540E\u56DE\u590D\u3002","workCenter.selectPrompt":"\u9009\u62E9\u4E00\u4E2A\u5DE5\u4F5C\u9879\uFF0C\u67E5\u770B\u5B83\u7684\u6D41\u7A0B\u3002","workCenter.createHint":"\u63CF\u8FF0\u4F60\u9700\u8981\u4EC0\u4E48\uFF0CTriage \u4F1A\u751F\u6210\u76EE\u6807\u3001\u9A8C\u6536\u6761\u4EF6\u548C Actions\u3002","workCenter.requirement":"\u9700\u6C42","workCenter.requirementHint":"\u7528\u81EA\u7136\u8BED\u8A00\u63CF\u8FF0\u95EE\u9898\u3001\u671F\u671B\u7ED3\u679C\u548C\u5FC5\u8981\u7EA6\u675F","workCenter.requirementHelp":"Triage \u4F1A\u751F\u6210\u6807\u9898\u3001\u76EE\u6807\u3001\u9A8C\u6536\u6761\u4EF6\u3001\u7C7B\u578B\u548C\u6267\u884C\u8BA1\u5212\u3002","workCenter.titleField":"\u6807\u9898","workCenter.titleHint":"\u7B80\u77ED\u3001\u660E\u786E\u5730\u63CF\u8FF0\u9884\u671F\u7ED3\u679C","workCenter.goalHint":"\u8BF4\u660E Agent \u5FC5\u987B\u4EA4\u4ED8\u7684\u6700\u7EC8\u7ED3\u679C","workCenter.criteriaHint":"\u6BCF\u884C\u4E00\u6761\u9A8C\u6536\u6761\u4EF6","workCenter.attachments":"\u9644\u4EF6","workCenter.attachmentsHelp":"\u56FE\u7247\u3001PDF \u548C\u6587\u672C\u6587\u4EF6\u4F1A\u6301\u7EED\u7ED1\u5B9A\u5230\u6B64 Work Item\uFF0C\u5E76\u63D0\u4F9B\u7ED9\u6BCF\u4E2A Action\u3002","workCenter.attachmentsUnsupported":"\u6240\u9009 Agent \u4E0D\u652F\u6301 Work Item \u9644\u4EF6\u3002","workCenter.addAttachments":"\u6DFB\u52A0\u6587\u4EF6","workCenter.attachmentsUploading":"\u4E0A\u4F20\u4E2D\u2026","workCenter.attachmentsUploadFailed":"\u9644\u4EF6\u4E0A\u4F20\u5931\u8D25","workCenter.pendingEnvelopeLocked":"\u6709\u4E00\u6761\u672A\u786E\u8BA4\u8BF7\u6C42\u5DF2\u9501\u5B9A\u5230\u539F\u59CB\u8EAB\u4EFD\u3002","workCenter.replacePendingAttachments":"\u66FF\u6362\u9644\u4EF6","workCenter.discardPendingEnvelope":"\u653E\u5F03\u5F85\u786E\u8BA4\u8BF7\u6C42","workCenter.pendingEnvelopeChanged":"\u5F85\u786E\u8BA4\u8BF7\u6C42\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u8BE5\u5DE5\u4F5C\u9879\u540E\u518D\u8BD5\u3002","workCenter.removeAttachment":"\u4ECE\u8349\u7A3F\u4E2D\u79FB\u9664","workCenter.previewAttachment":"\u6253\u5F00\u9644\u4EF6","workCenter.openAttachmentNamed":"\u6253\u5F00\u9644\u4EF6 {name}","workCenter.openingAttachment":"\u6B63\u5728\u6253\u5F00\u9644\u4EF6\u2026","workCenter.attachmentPreviewFailed":"\u65E0\u6CD5\u6253\u5F00\u9644\u4EF6\uFF0C\u8BF7\u91CD\u8BD5\u3002","workCenter.attachmentOpenBlocked":"\u6D4F\u89C8\u5668\u963B\u6B62\u4E86\u9644\u4EF6\u7A97\u53E3\uFF0C\u8BF7\u5141\u8BB8\u5F39\u51FA\u7A97\u53E3\u540E\u91CD\u8BD5\u3002","workCenter.execution":"\u6267\u884C\u65B9\u5F0F","workCenter.executionHint":"\u9009\u62E9\u5DE5\u4F5C\u9879\u5728\u54EA\u91CC\u6267\u884C\uFF0C\u4EE5\u53CA\u521B\u5EFA\u540E\u662F\u5426\u7ACB\u5373\u5F00\u59CB\u3002","workCenter.workDir":"\u5DE5\u4F5C\u76EE\u5F55","workCenter.workDirHint":"\u9009\u62E9\u4E00\u4E2A\u5DF2\u5B58\u5728\u7684\u9879\u76EE\u76EE\u5F55","workCenter.chooseFolder":"\u9009\u62E9\u6587\u4EF6\u5939","workCenter.workDirPickerHelp":"\u4ECE\u5F53\u524D Agent \u7684\u771F\u5B9E\u76EE\u5F55\u4E2D\u9009\u62E9\u5DF2\u5B58\u5728\u7684\u6587\u4EF6\u5939\u3002","workCenter.folderPickerHint":"\u9009\u62E9\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53EF\u4EE5\u8BFB\u53D6\u548C\u4FEE\u6539\u7684\u9879\u76EE\u76EE\u5F55\u3002","workCenter.folderPickerSelectionHint":"\u53CC\u51FB\u8FDB\u5165\u76EE\u5F55\uFF0C\u6216\u9009\u4E2D\u76EE\u5F55\u540E\u786E\u8BA4\u3002","workCenter.startImmediately":"\u7ACB\u5373\u5F00\u59CB","workCenter.startImmediatelyHint":"\u5173\u95ED\u540E\u5C06\u521B\u5EFA\u4E3A\u8349\u7A3F\uFF0C\u786E\u8BA4\u65E0\u8BEF\u540E\u518D\u5F00\u59CB\u3002","workCenter.creating":"\u521B\u5EFA\u4E2D\u2026","workCenter.create":"\u521B\u5EFA","workCenter.status.draft":"\u8349\u7A3F","workCenter.status.ready":"\u5F85\u6267\u884C","workCenter.status.running":"\u6267\u884C\u4E2D","workCenter.status.waiting":"\u7B49\u5F85\u4E2D","workCenter.status.needs_attention":"\u9700\u8981\u5904\u7406","workCenter.status.done":"\u5DF2\u5B8C\u6210","workCenter.status.cancelled":"\u5DF2\u53D6\u6D88","workCenter.status.completed":"\u5DF2\u5B8C\u6210","workCenter.status.failed":"\u5931\u8D25","workCenter.status.superseded":"\u5DF2\u66FF\u4EE3","workCenter.action.triage":"\u5206\u6790","workCenter.action.implement":"\u5B9E\u73B0","workCenter.action.review":"\u8BC4\u5BA1","workCenter.action.integrate":"\u96C6\u6210","workCenter.action.deliver":"\u4EA4\u4ED8","workCenter.action.test":"\u6D4B\u8BD5","workCenter.action.research":"\u7814\u7A76","workCenter.action.design":"\u8BBE\u8BA1","workCenter.action.diagnose":"\u8BCA\u65AD","workCenter.action.migrate":"\u8FC1\u79FB","workCenter.action.document":"\u6587\u6863","workCenter.action.operate":"\u8FD0\u7EF4","workCenter.action.write":"\u5199\u4F5C","workCenter.action.custom":"\u81EA\u5B9A\u4E49","workCenter.assignment.auto":"\u4F7F\u7528\u4EFB\u52A1\u6D41\u7B56\u7565","workCenter.model.inherit":"\u4F7F\u7528\u4EFB\u52A1\u6D41\u6A21\u578B","workCenter.model.defaultProvider":"\u9ED8\u8BA4 Provider","workCenter.planPreview":"\u6267\u884C\u8BA1\u5212","workCenter.planPreviewHelp":"\u6839\u636E\u5F53\u524D Agent \u7684 VP \u6C60\u548C\u6A21\u578B\u8BBE\u7F6E\u5B9E\u65F6\u89E3\u6790\u3002","workCenter.settings.title":"\u5DE5\u4F5C\u4E2D\u5FC3\u8BBE\u7F6E","workCenter.settings.subtitle":"\u914D\u7F6E Coordinator\uFF0C\u4EE5\u53CA AI \u52A8\u6001\u89C4\u5212\u4F7F\u7528\u7684 Action \u63D0\u793A\u8BCD\u3001\u6A21\u578B\u548C effort\u3002","workCenter.settings.workflow":"\u4EFB\u52A1\u6D41","workCenter.settings.workflowHelp":"Triage \u4F1A\u9488\u5BF9\u4EFB\u52A1\u52A8\u6001\u9009\u62E9 Action \u548C\u6267\u884C\u8005\u3002","workCenter.settings.aiWorkflowHelp":"Triage \u4F1A\u4E3A\u6BCF\u4E2A Work Item \u5206\u7C7B\u5E76\u751F\u6210\u7ECF\u8FC7\u6821\u9A8C\u7684 1\u20138 \u4E2A\u4EFB\u52A1\u4E13\u5C5E Action\u3002\u5185\u7F6E Action \u7B56\u7565\u53EA\u662F\u53EF\u590D\u7528\u9ED8\u8BA4\u503C\uFF1B\u9700\u8981\u65F6 triage \u53EF\u4EE5\u521B\u5EFA\u7CBE\u786E\u7684\u9886\u57DF\u7C7B\u578B\u3002","workCenter.settings.globalInstructions":"Agent \u5168\u5C40\u6307\u4EE4","workCenter.settings.globalInstructionsHint":"\u4F8B\u5982\uFF1A\u9075\u5FAA\u4ED3\u5E93\u53D1\u5E03\u6D41\u7A0B\u3001\u5FC5\u987B\u72EC\u7ACB\u8BC4\u5BA1\uFF0C\u672A\u7ECF\u660E\u786E\u6279\u51C6\u4E0D\u5F97\u521B\u5EFA\u90E8\u7F72 tag\u3002","workCenter.settings.globalInstructionsHelp":"\u4FDD\u5B58\u5728 Agent \u7EA7\uFF0C\u5E76\u51BB\u7ED3\u8FDB\u6BCF\u4E2A\u65B0 Work Item\uFF1B\u5BF9 triage \u548C\u6240\u6709\u751F\u6210\u7684 Action \u751F\u6548\uFF0C\u4F18\u5148\u7EA7\u4F4E\u4E8E Work Item \u5951\u7EA6\u53CA\u7CFB\u7EDF/\u5DE5\u5177\u5B89\u5168\u89C4\u5219\u3002\u5DF2\u6709 Work Item \u4FDD\u7559\u539F\u5FEB\u7167\u3002","workCenter.settings.actionPolicies":"\u5185\u7F6E Action \u7B56\u7565","workCenter.settings.actionPoliciesHelp":"\u8FD9\u4E9B\u662F\u53EF\u590D\u7528\u7684\u6267\u884C\u57FA\u7EBF\uFF0C\u4E0D\u662F\u56FA\u5B9A\u5DE5\u4F5C\u6D41\u3002\u672A\u77E5\u7684\u9886\u57DF Action \u7C7B\u578B\u4F1A\u4F7F\u7528\u201C\u81EA\u5B9A\u4E49\u201D\u7B56\u7565\uFF0C\u5E76\u4FDD\u7559 triage \u751F\u6210\u7684\u7C7B\u578B\u548C\u4EFB\u52A1\u76EE\u6807\u3002","workCenter.settings.dynamicInstructionHelp":"AI \u4F1A\u52A0\u5165 Work Item \u5951\u7EA6\u3001\u5168\u5C40\u6307\u4EE4\u3001\u524D\u5E8F Action \u4E0A\u4E0B\u6587\u3001memory \u548C\u4EFB\u52A1\u4E13\u5C5E\u76EE\u6807\uFF1B\u8FD9\u91CC\u5B9A\u4E49\u8BE5 Action \u7C7B\u578B\u7684\u53EF\u590D\u7528\u884C\u4E3A\u3002","workCenter.settings.models":"\u6A21\u578B","workCenter.settings.modelsHelp":"Provider \u548C\u51ED\u8BC1\u4ECD\u7531 Agent LLM \u8BBE\u7F6E\u7BA1\u7406\uFF1B\u5DE5\u4F5C\u4E2D\u5FC3\u53EA\u9009\u62E9\u53EF\u7528\u6A21\u578B\u3002","workCenter.settings.dynamicModelsHelp":"Coordinator \u4E0E\u5B9E\u9645\u6267\u884C Action \u7684\u6A21\u578B\u53EF\u4EE5\u5206\u522B\u914D\u7F6E\u3002","workCenter.settings.coordinatorModel":"Coordinator","workCenter.settings.coordinatorModelHelp":"\u7528\u4E8E Work Item \u5BF9\u8BDD\u3001\u4FEE\u6539\u76EE\u6807\u548C\u91CD\u65B0\u89C4\u5212\uFF1B\u4E0D\u4F1A\u6267\u884C\u9879\u76EE\u5DE5\u5177\u3002","workCenter.settings.allActions":"\u6240\u6709 Action \u7684\u515C\u5E95\u7B56\u7565","workCenter.settings.maxConcurrentActions":"\u6700\u5927\u5E76\u53D1 Action \u6570","workCenter.settings.maxConcurrentActionsHelp":"\u9ED8\u8BA4 3\u3002\u975E Git\u3001\u810F\u5DE5\u4F5C\u533A\u3001\u5171\u4EAB\u526F\u4F5C\u7528\u548C\u96C6\u6210 Action \u4ECD\u4F1A\u4E32\u884C\u6267\u884C\u3002","workCenter.workItemType":"\u7C7B\u578B","workCenter.typeAuto":"Auto \u2014 \u7531 LLM \u63A8\u65AD","workCenter.typeHelp":"\u53EF\u9009\u62E9\u4EFB\u52A1\u7C7B\u522B\uFF0C\u4E5F\u53EF\u8BA9 AI \u81EA\u52A8\u63A8\u65AD\uFF1B\u5177\u4F53 Actions \u59CB\u7EC8\u7531 AI \u89C4\u5212\u3002","workCenter.planning":"\u89C4\u5212\u4E2D","workCenter.aiPlan":"AI \u52A8\u6001\u89C4\u5212\u6267\u884C","workCenter.aiPlanHelp":"Triage \u4F1A\u9009\u62E9\u4EFB\u52A1\u7C7B\u578B\u3001Action\u3001\u6267\u884C\u8005\u548C\u6700\u5C0F\u53EF\u9760\u6D41\u7A0B\uFF1B\u6A21\u578B\u4E0E effort \u7531 Work Center \u8BBE\u7F6E\u63A7\u5236\u3002","workCenter.settings.manageProviders":"\u7BA1\u7406 Agent \u6A21\u578B","workCenter.settings.assignment":"VP \u9009\u62E9","workCenter.settings.assignment.auto":"\u4ECE\u5168\u90E8 VP \u81EA\u52A8\u9009\u62E9","workCenter.settings.assignment.pool":"\u5019\u9009\u6C60","workCenter.settings.assignment.fixed":"\u56FA\u5B9A VP","workCenter.settings.capability":"\u6240\u9700\u80FD\u529B","workCenter.settings.vp":"Virtual Person","workCenter.settings.poolMembers":"\u5019\u9009 VP","workCenter.settings.modelPolicy":"\u6A21\u578B\u7B56\u7565","workCenter.settings.model.inherit":"\u7EE7\u627F VP \u504F\u597D","workCenter.settings.model.primary":"Agent \u4E3B\u6A21\u578B","workCenter.settings.model.fast":"Agent \u5FEB\u6A21\u578B","workCenter.settings.model.specific":"\u6307\u5B9A\u6A21\u578B","workCenter.settings.model":"\u6A21\u578B","workCenter.settings.effort":"\u63A8\u7406\u5F3A\u5EA6","workCenter.settings.effortDefault":"\u6A21\u578B\u9ED8\u8BA4\u503C","workCenter.settings.effortHelp":"\u8986\u76D6\u6240\u9009\u6A21\u578B\u7684\u9ED8\u8BA4\u63A8\u7406\u5F3A\u5EA6\uFF0C\u5E76\u7528\u4E8E\u6240\u6709 Work Center Action\u3002","workCenter.settings.effortChooseModelHelp":"\u9009\u62E9 Agent \u4E3B\u6A21\u578B\u3001\u5FEB\u6A21\u578B\u6216\u6307\u5B9A\u6A21\u578B\u540E\u53EF\u914D\u7F6E\u63A8\u7406\u5F3A\u5EA6\uFF1B\u7EE7\u627F VP \u504F\u597D\u65F6\u4F7F\u7528\u5404 VP \u6A21\u578B\u7684\u9ED8\u8BA4\u503C\u3002","workCenter.settings.effortUnsupportedHelp":"\u6240\u9009\u6A21\u578B\u4E0D\u63D0\u4F9B\u53EF\u914D\u7F6E\u7684\u63A8\u7406\u5F3A\u5EA6\uFF0C\u56E0\u6B64\u4F7F\u7528\u6A21\u578B\u9ED8\u8BA4\u503C\u3002","workCenter.settings.saving":"\u4FDD\u5B58\u4E2D\u2026","workCenter.settings.reload":"\u91CD\u65B0\u52A0\u8F7D\u8BBE\u7F6E","workCenter.settings.conflict":"\u8BBE\u7F6E\u5DF2\u5728\u5176\u4ED6\u4F4D\u7F6E\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u540E\u518D\u4FDD\u5B58\u3002","workCenter.settings.upgradeRequired":"\u5F53\u524D Agent \u7248\u672C\u65E0\u6CD5\u4FDD\u5B58\u5DE5\u4F5C\u4E2D\u5FC3\u8BBE\u7F6E\u3002\u8FD9\u91CC\u4EE5\u53EA\u8BFB\u65B9\u5F0F\u663E\u793A\u5F53\u524D\u503C\uFF1B\u5347\u7EA7 Agent \u540E\u5373\u53EF\u7F16\u8F91\u5E76\u4FDD\u5B58\u3002","workCenter.settings.saveNotConfirmed":"Agent \u672A\u786E\u8BA4\u672C\u6B21\u63D0\u4EA4\u7684\u63D0\u793A\u8BCD\u548C\u6A21\u578B\u7B56\u7565\u3002\u8BBE\u7F6E\u7A97\u53E3\u4E0D\u4F1A\u5173\u95ED\uFF1B\u8BF7\u91CD\u65B0\u52A0\u8F7D\u6216\u5347\u7EA7 Agent \u540E\u518D\u8BD5\u3002","workCenter.settings.addWorkflow":"\u590D\u5236\u4EFB\u52A1\u6D41","workCenter.settings.removeWorkflow":"\u5220\u9664","workCenter.settings.newWorkflow":"\u4EFB\u52A1\u6D41 {index}","workCenter.settings.workflowName":"\u4EFB\u52A1\u6D41\u540D\u79F0","workCenter.settings.newStage":"\u65B0\u9636\u6BB5","workCenter.settings.addStage":"\u6DFB\u52A0\u9636\u6BB5","workCenter.settings.removeStage":"\u5220\u9664\u9636\u6BB5","workCenter.settings.moveUp":"\u4E0A\u79FB\u9636\u6BB5","workCenter.settings.moveDown":"\u4E0B\u79FB\u9636\u6BB5","workCenter.settings.stageType":"\u9636\u6BB5\u7C7B\u578B","workCenter.settings.reviewReturnStage":"\u8981\u6C42\u4FEE\u6539\u65F6\u9000\u56DE\u9636\u6BB5","workCenter.settings.instruction":"\u9636\u6BB5 Prompt","workCenter.settings.instructionHint":"\u5B9A\u4E49\u8FD9\u4E2A\u9636\u6BB5\u5177\u4F53\u8981\u505A\u4EC0\u4E48\u3002","workCenter.settings.instructionHelp":"\u8FD0\u884C\u65F6\u4F1A\u81EA\u52A8\u52A0\u5165 Work Item \u7684\u76EE\u6807\u3001\u9A8C\u6536\u6807\u51C6\u548C\u53EF\u590D\u7528\u4E0A\u4E0B\u6587\u3002","workCenter.settings.instructionReset":"\u6062\u590D\u9ED8\u8BA4\u503C"}});var ip,op=F(()=>{ip={"common.loading":"Loading...","common.confirm":"OK","common.apply":"Apply","common.cancel":"Cancel","common.delete":"Delete","common.copy":"Copy","common.copied":"Copied","common.close":"Close","common.refresh":"Refresh","common.open":"Open","common.save":"Save","common.search":"Search","common.back":"Back","common.noSubdirectories":"No subdirectories","common.drives":"Drives","common.rootDir":"Root","common.comma":", ","common.select":"Select","mermaid.export":"Export","mermaid.exportMd":"Export MD","mermaid.exportPng":"Export PNG","mermaid.exportJpg":"Export JPG","chat.toolActionsOmitted":"{count} older tool actions omitted","login.subtitle":"Yeaft Web Code Agent","login.username":"Username","login.password":"Password","login.login":"Login","login.loggingIn":"Logging in...","login.enterUsername":"Please enter your username","login.enterPassword":"Please enter your password","login.noAccount":"Don't have an account?","login.registerWithCode":"Register","login.or":"or","login.usePassword":"Sign in with username & password","login.useSso":"Back to single sign-on","login.noProviders":"No third-party sign-in providers are enabled.","login.microsoft":"Sign in with Microsoft","login.github":"Sign in with GitHub","login.google":"Sign in with Google","login.wechat":"Sign in with WeChat","login.alipay":"Sign in with Alipay","login.wechat.mobileUnsupported":"Sign in with WeChat is only available on PC. Please scan the QR code from a desktop browser.","login.alipay.mobileWaiting":"Waiting for you to confirm in the Alipay app\u2026 Once you finish, return to this page and you will be signed in automatically.","login.alipay.relaunch":"Open Alipay again","login.qr.title":"Scan to sign in","login.qr.titleAlipay":"Sign in with Alipay","login.qr.titleWechat":"Sign in with WeChat","login.qr.hint":"Scan the QR code with your phone to authorize.","login.error.enterUsername":"Please enter your username","login.error.enterPassword":"Please enter your password","login.error.enter6Digit":"Please enter a 6-digit code","login.error.enterInviteCode":"Please enter the invite code","login.error.usernameMinLen":"Username must be at least 2 characters","login.error.passwordMinLen":"Password must be at least 6 characters","login.error.passwordMismatch":"Passwords do not match","login.error.enterVerifyCode":"Please enter the verification code","login.error.loginFailed":"Login failed","login.forgot.link":"Forgot password?","login.forgot.title":"Reset your password","login.forgot.emailHint":"Enter the email address on your account. We will send a 6-digit reset code.","login.forgot.sendCode":"Send Reset Code","login.forgot.sending":"Sending...","login.forgot.codeSent":"If the email is on file, a 6-digit reset code has been sent. Enter it below along with your new password.","login.forgot.resetBtn":"Reset Password","login.forgot.resetting":"Resetting...","login.forgot.success":"Password reset. You can now sign in with your new password.","login.forgot.emailInvalid":"Please enter a valid email","login.register.title":"New User Registration","login.register.inviteCode":"Invite Code","login.register.username":"Username","login.register.password":"Password (min 6 characters)","login.register.confirmPassword":"Confirm Password","login.register.email":"Email (optional)","login.register.submit":"Register","login.register.submitting":"Registering...","login.register.back":"Back to Login","login.register.success":"Registration successful, please login","login.register.enterCode":"Please enter the invite code","login.register.usernameMin":"Username must be at least 2 characters","login.register.passwordMin":"Password must be at least 6 characters","login.register.passwordMismatch":"Passwords do not match","login.totp.setupTitle":"Set Up Two-Factor Authentication","login.totp.setupHint":"Scan the QR code below with Microsoft Authenticator or Google Authenticator","login.totp.manualKey":"Or enter the key manually:","login.totp.enterCode":"Enter 6-digit code","login.totp.complete":"Complete Setup","login.totp.verifying":"Verifying...","login.totp.verify":"Verify","login.totp.prompt":"Enter the code from your Authenticator app","login.totp.invalidCode":"Please enter a 6-digit code","login.email.codeSent":"Verification code sent to {email}","login.email.enterCode":"Enter verification code","login.email.verify":"Verify","login.email.verifying":"Verifying...","login.email.enterCodeError":"Please enter the verification code","chat.agent.select":"Select Agent","chat.agent.manage":"Manage Agents","chat.agent.none":"No Agents","chat.agent.restarting":"Restarting","chat.agent.restart":"Restart","chat.agent.restartConfirm":`Are you sure you want to restart Agent "{name}"?
|
|
12
|
+
\u5347\u7EA7\u5B8C\u6210\u540E Agent \u4F1A\u81EA\u52A8\u91CD\u542F\u3002`,"chat.agent.alreadyLatest":"Agent \u5DF2\u662F\u6700\u65B0\u7248\u672C (v{version})\uFF0C\u65E0\u9700\u5347\u7EA7\u3002","chat.agent.nodeIncompatible":"Agent \u5347\u7EA7\u4E2D\u6B62\uFF1A\u76EE\u6807\u7248\u672C v{version} \u9700\u8981 Node {required}\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u8FD0\u884C\u7684\u662F Node {current}\u3002\u8BF7\u5148\u5347\u7EA7 Node.js \u518D\u91CD\u8BD5\u3002","chat.agent.online":"{count} \u4E2A Agent \u5728\u7EBF","chat.agent.selectFirst":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent","chat.agent.yeaft":"Yeaft \u5BF9\u8BDD","sidebar.toggle.chat":"\u5207\u6362\u5230 Chat","sidebar.toggle.yeaft":"\u5207\u6362\u5230 Yeaft","sidebar.surface.label":"\u4FA7\u680F\u89C6\u56FE","sidebar.surface.sessions":"\u4F1A\u8BDD","sidebar.provider.label":"\u4F1A\u8BDD Provider","sidebar.provider.claude":"Claude","sidebar.sessions.new":"\u65B0\u5EFA\u4F1A\u8BDD","sidebar.sessions.newChat":"\u65B0\u5EFA\u804A\u5929","sidebar.sessions.emptyProvider":"\u6B64 Provider \u6682\u65E0\u4F1A\u8BDD","sidebar.sessions.menu":"\u4F1A\u8BDD\u83DC\u5355","sidebar.sessions.unread":"\u672A\u8BFB","sidebar.sessions.pinned":"\u5DF2\u7F6E\u9876","sidebar.sessions.processing":"\u6B63\u5728\u56DE\u590D","sidebar.sessions.hidden":"\u5DF2\u9690\u85CF\u7684\u4F1A\u8BDD","sidebar.sessions.remove":"\u4ECE\u4FA7\u680F\u79FB\u9664","sidebar.sessions.agent":"Agent","sidebar.sessions.provider":"Provider","sidebar.projects.title":"\u9879\u76EE","sidebar.projects.menu":"\u9879\u76EE\u83DC\u5355","sidebar.projects.new":"\u65B0\u5EFA\u9879\u76EE","sidebar.projects.newSession":"\u5728{name}\u4E2D\u521B\u5EFA Session","sidebar.projects.assignFailed":"Session \u5DF2\u521B\u5EFA\uFF0C\u4F46\u65E0\u6CD5\u52A0\u5165{name}\u3002\u9519\u8BEF\uFF1A{message}","sidebar.projects.empty":"\u6682\u65E0\u9879\u76EE","sidebar.projects.noSessions":"\u5C06 Yeaft \u804A\u5929\u62D6\u5230\u8FD9\u91CC","sidebar.projects.namePrompt":"\u9879\u76EE\u540D\u79F0","sidebar.projects.renamePrompt":"\u91CD\u547D\u540D\u9879\u76EE","sidebar.projects.rename":"\u91CD\u547D\u540D\u9879\u76EE","sidebar.projects.delete":"\u5220\u9664\u9879\u76EE","sidebar.projects.deleteConfirm":"\u5220\u9664\u9879\u76EE\u201C{name}\u201D\uFF1F\u5176\u4E2D\u804A\u5929\u4F1A\u79FB\u56DE\u6700\u8FD1\u3002","sidebar.projects.remove":"\u79FB\u51FA\u9879\u76EE","sidebar.projects.moveMenu":"\u79FB\u52A8\u5230 Projects","sidebar.projects.moveBack":"\u8FD4\u56DE","sidebar.projects.moveEmpty":"\u6CA1\u6709\u5176\u4ED6 Project","sidebar.projects.moveTo":"\u79FB\u5230 {name}","sidebar.projects.instructions":"Project \u6307\u4EE4","sidebar.projects.instructionsTitle":"{name} \u6307\u4EE4","sidebar.projects.instructionsHint":"\u8FD9\u4E9B\u6307\u4EE4\u4F1A\u52A0\u5165\u6B64 Project \u5185\u6BCF\u4E2A Session \u7684 system prompt\u3002","sidebar.projects.instructionsPlaceholder":"\u8F93\u5165\u5171\u4EAB\u7684\u7F16\u7801\u89C4\u8303\u3001\u7EA6\u675F\u6216\u5DE5\u4F5C\u6D41\u8BF4\u660E\u2026","sidebar.recents.title":"\u6700\u8FD1","sidebar.recents.empty":"\u6682\u65E0\u804A\u5929","yeaft.back":"\u8FD4\u56DE","yeaft.session.people":"\u6210\u5458","yeaft.session.peopleEmpty":"\u6682\u65E0\u6210\u5458","yeaft.session.runningTasks":"\u8FD0\u884C\u4E2D\u7684\u4EFB\u52A1","yeaft.session.tasksEmpty":"\u6682\u65E0\u8FD0\u884C\u4EFB\u52A1","yeaft.session.owner":"\u8D1F\u8D23\u4EBA","yeaft.session.started":"\u5F00\u59CB\u65F6\u95F4","yeaft.breadcrumb.label":"Thread \u8FC7\u6EE4","yeaft.breadcrumb.mainStream":"\u4E3B\u6D41","yeaft.breadcrumb.backHint":"\u8FD4\u56DE\u5168\u6D41 (Esc)","yeaft.featureDetail.ariaLabel":"Task \u8BE6\u60C5","yeaft.featureDetail.replyTo":"\u56DE\u590D\u5230:","yeaft.featureDetail.forkHint":"\u8BE5 task \u6682\u65E0\u6D3B\u8DC3 thread \u2014 \u8BF7 fork \u65B0 thread \u540E\u56DE\u590D\u3002","yeaft.featureDetail.empty":"\u8BE5 task \u6682\u65E0\u6D88\u606F\u3002","yeaft.featureDetail.threadPillHint":"\u6253\u5F00 thread","yeaft.featureDetail.summary.aria":"\u4EFB\u52A1\u6458\u8981\u65F6\u95F4\u7EBF","yeaft.featureDetail.summary.title":"\u6458\u8981\u65F6\u95F4\u7EBF","yeaft.featureDetail.summary.loading":"\u6B63\u5728\u52A0\u8F7D\u6458\u8981\u5386\u53F2\u2026","yeaft.featureDetail.summary.empty":"\u6682\u65E0\u6458\u8981\u3002","yeaft.featureDetail.summary.error":"\u6458\u8981\u52A0\u8F7D\u5931\u8D25\uFF1A{error}","yeaft.featureDetail.summary.showArchived":"\u663E\u793A\u5DF2\u5F52\u6863","yeaft.featureDetail.related.aria":"\u5173\u8054\u4EFB\u52A1","yeaft.featureDetail.related.title":"\u5173\u8054\u4EFB\u52A1","yeaft.featureDetail.related.unlink":"\u53D6\u6D88\u5173\u8054","yeaft.featureDetail.members.aria":"\u4EFB\u52A1\u6210\u5458","yeaft.featureDetail.members.title":"\u6210\u5458","yeaft.featureDetail.members.abort":"\u4E2D\u6B62","yeaft.featureDetail.members.kick":"\u8E22\u51FA","yeaft.model":"\u6A21\u578B","yeaft.placeholder":"\u95EE\u6211\u4EFB\u4F55\u95EE\u9898...","yeaft.inbox":"\u6536\u4EF6\u7BB1","yeaft.inbox.tooltip":"\u4F60\u7684\u9ED8\u8BA4\u5BF9\u8BDD\u7EBF\u7A0B \u2014\u2014 \u4E0E Yeaft \u7684\u4E00\u5BF9\u4E00\u804A\u5929\u3002\u53EF\u4EE5\u4E3A\u5177\u4F53\u8BDD\u9898\u6216\u4EFB\u52A1\u521B\u5EFA\u65B0\u7EBF\u7A0B\u3002","yeaft.sidebar.activeThreads":"\u6D3B\u8DC3","yeaft.sidebar.idleThreads":"\u9759\u9ED8","yeaft.sidebar.archivedThreads":"\u5DF2\u5F52\u6863","yeaft.sidebar.tasks":"\u4EFB\u52A1","yeaft.sidebar.emptyActive":"\u6682\u65E0\u6D3B\u8DC3 thread","yeaft.sidebar.emptyIdle":"\u6682\u65E0\u9759\u9ED8 thread","yeaft.sidebar.emptyArchived":"\u6682\u65E0\u5F52\u6863 thread","yeaft.sidebar.emptyTasks":"\u65E0\u5339\u914D\u4EFB\u52A1","yeaft.sidebar.results":"\u641C\u7D22\u7ED3\u679C","yeaft.sidebar.resultsThreads":"Threads","yeaft.sidebar.kindThread":"thread","yeaft.sidebar.cancel":"\u53D6\u6D88","yeaft.sidebar.mergeInto":"\u5408\u5E76\u5230\u2026","yeaft.sidebar.mergeNoCandidates":"\u6CA1\u6709\u53EF\u5408\u5E76\u7684\u5176\u4ED6\u7EBF\u7A0B","yeaft.sidebar.mergeConfirmTitle":"\u5408\u5E76\u8FD9\u4E2A\u7EBF\u7A0B\uFF1F","yeaft.sidebar.mergeIrreversible":"\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\uFF0C\u6E90\u7EBF\u7A0B\u5C06\u88AB\u5F52\u6863\uFF0C\u5176\u6D88\u606F\u4F1A\u88AB\u79FB\u52A8\u5230\u76EE\u6807\u7EBF\u7A0B\u3002","yeaft.sidebar.mergeConfirm":"\u5408\u5E76","yeaft.settings.sidebarV2":"\u5B9E\u9A8C\u529F\u80FD\uFF1A\u4FA7\u8FB9\u680F V2","yeaft.settings.sidebarV2Hint":"Thread \u5217\u8868 + \u4EFB\u52A1\u6811\uFF08\u9884\u89C8\uFF09\u3002","yeaft.clearConfirm":"\u6E05\u7A7A\u6240\u6709\u6D88\u606F\uFF1F","yeaft.mode":"\u6A21\u5F0F","yeaft.agent":"\u667A\u80FD\u4F53","yeaft.connecting":"\u8FDE\u63A5\u4E2D...","yeaft.ready":"\u5C31\u7EEA","yeaft.tools":"\u4E2A\u5DE5\u5177","yeaft.skills":"\u4E2A\u6280\u80FD","yeaft.mcp":"\u4E2A MCP","yeaft.showSidebar":"\u663E\u793A\u4FA7\u680F","yeaft.hideSidebar":"\u9690\u85CF\u4FA7\u680F","yeaft.debug":"\u8C03\u8BD5","yeaft.debugClose":"\u5173\u95ED\u8C03\u8BD5\u9762\u677F","yeaft.debugTurns":"\u8F6E","yeaft.debugTabToolStats":"\u5DE5\u5177\u7EDF\u8BA1","yeaft.debugTabDream":"Dream","yeaft.debugTabRequestLog":"\u8BF7\u6C42\u65E5\u5FD7","yeaft.debugHistoryLoad":"\u52A0\u8F7D\u8BF7\u6C42\u5386\u53F2","yeaft.debugHistoryLoading":"\u52A0\u8F7D\u4E2D...","yeaft.debugHistoryLoaded":"\u5DF2\u52A0\u8F7D {count} \u6761","yeaft.debugSearchPlaceholder":"\u6B63\u5219\u641C\u7D22\u8BF7\u6C42\u65E5\u5FD7","yeaft.debugSearchHint":"\u9ED8\u8BA4\u663E\u793A\u5168\u5C40\u6700\u8FD1 10 \u6761\uFF1B\u641C\u7D22\u4F1A\u8DE8 Session \u5339\u914D\u8BF7\u6C42\u6458\u8981\u3002","yeaft.dreamDebug.title":"Dream \u751F\u547D\u5468\u671F","yeaft.dreamDebug.trigger":"\u89E6\u53D1","yeaft.dreamDebug.status":"\u72B6\u6001","yeaft.dreamDebug.started":"\u5F00\u59CB","yeaft.dreamDebug.finished":"\u7ED3\u675F","yeaft.dreamDebug.time":"\u65F6\u95F4","yeaft.dreamDebug.phase":"\u9636\u6BB5","yeaft.dreamDebug.call":"\u8C03\u7528","yeaft.dreamDebug.location":"\u751F\u6210\u4F4D\u7F6E","yeaft.dreamDebug.result":"\u7ED3\u679C","yeaft.dreamDebug.noLatest":"\u8FD9\u4E2A\u4F1A\u8BDD\u8FD8\u6CA1\u6709\u8BB0\u5F55\u5230 Dream \u68C0\u67E5\u3002","yeaft.dreamDebug.noEvents":"\u8FD9\u4E2A\u4F1A\u8BDD\u8FD8\u6CA1\u6709 Dream \u4E8B\u4EF6\u3002","yeaft.dreamDebug.outputTitle":"\u672C session \u5DF2\u52A0\u8F7D\u7684 Dream \u8F93\u51FA","yeaft.dreamDebug.scope":"Scope","yeaft.dreamDebug.lastDream":"\u4E0A\u6B21 Dream","yeaft.dreamDebug.messagesCovered":"\u5DF2\u8986\u76D6\u6D88\u606F\u6570","yeaft.dreamDebug.noOutput":"\u8FD9\u4E2A session \u8FD8\u6CA1\u6709\u5199\u5165 Dream \u8F93\u51FA\u3002","yeaft.dreamDebug.promptLoadTitle":"\u5DF2\u52A0\u8F7D\u8FDB system prompt \u7684 Dream \u8BB0\u5FC6","yeaft.dreamDebug.loadedInto":"\u52A0\u8F7D\u4F4D\u7F6E","yeaft.dreamDebug.vp":"VP","yeaft.dreamDebug.summaryToPrompt":"summary.md -> system prompt","yeaft.dreamDebug.itemList":"Dream \u8FD0\u884C\u548C Scope","yeaft.dreamDebug.searchPlaceholder":"\u6309\u6807\u9898\u3001ID \u6216\u6458\u8981\u641C\u7D22 Dream Session...","yeaft.dreamDebug.noSearchResults":"\u6CA1\u6709\u5339\u914D\u7684 Dream Session\u3002","yeaft.dreamDebug.noSummary":"\u6682\u65E0\u6458\u8981","yeaft.dreamDebug.segments":"\u6BB5","yeaft.dreamDebug.lastError":"\u6700\u8FD1\u9519\u8BEF","yeaft.dreamDebug.overview":"\u6982\u89C8","yeaft.dreamDebug.sessionId":"Session ID","yeaft.dreamDebug.loadedAt":"\u52A0\u8F7D\u65F6\u95F4","yeaft.dreamDebug.layers":"\u5C42\u7EA7","yeaft.dreamDebug.summaryLayer":"Resident summary","yeaft.dreamDebug.noPromptLoad":"\u8FD9\u4E2A scope \u6682\u65E0 prompt-load \u8BB0\u5F55\u3002","yeaft.dreamDebug.segmentTitle":"Segments","yeaft.dreamDebug.sourceMessages":"\u6765\u6E90\u6D88\u606F","yeaft.dreamDebug.createdAt":"\u521B\u5EFA\u65F6\u95F4","yeaft.dreamDebug.updatedAt":"\u66F4\u65B0\u65F6\u95F4","yeaft.dreamDebug.noSegments":"\u8FD9\u4E2A scope \u6682\u65E0 memory segments\u3002","yeaft.dreamDebug.requestResponse":"Request / Response","yeaft.dreamDebug.noRequestResponse":"\u8FD9\u4E2A scope \u8FD8\u6CA1\u6709\u6301\u4E45\u5316\u7684 Dream request/response \u65E5\u5FD7\u3002","yeaft.dreamDebug.empty":"\u6682\u65E0 Dream debug \u6570\u636E\u3002","yeaft.debugGroupFollowMain":"\u8DDF\u968F\u4E3B\u9762\u677F","yeaft.debugGroupAll":"\u5168\u90E8\u4F1A\u8BDD","yeaft.debugAssistantResponse":"Assistant \u56DE\u590D","yeaft.debugViewAssistantResponse":"\u67E5\u770B\u56DE\u590D","yeaft.debugToolInput":"\u8F93\u5165","yeaft.debugToolResult":"\u7ED3\u679C","yeaft.debugToolRunning":"\u6267\u884C\u4E2D","yeaft.debugToolRunningNoResult":"\u6267\u884C\u4E2D\uFF0C\u6682\u65E0\u7ED3\u679C","yeaft.debugShowDetails":"\u5C55\u5F00","yeaft.debugHideDetails":"\u6536\u8D77","yeaft.debugTurnStartedAt":"\u56DE\u5408\u5F00\u59CB\u65F6\u95F4","yeaft.debugRequestAt":"\u8BF7\u6C42\u65F6\u95F4","yeaft.debugRequestAtDerived":"\u7531\u56DE\u5408\u5F00\u59CB\u65F6\u95F4\u63A8\u7B97\uFF08\u65E7 loop\uFF09","yeaft.turn":"\u7B2C {n} \u8F6E","yeaft.systemPrompt":"\u7CFB\u7EDF\u63D0\u793A","yeaft.messagesLabel":"\u6D88\u606F","yeaft.response":"\u56DE\u590D","yeaft.toolCalls":"\u5DE5\u5177\u8C03\u7528","yeaft.functionCalls":"\u51FD\u6570\u8C03\u7528","yeaft.request":"\u8BF7\u6C42","yeaft.pending":"(\u7B49\u5F85\u4E2D)","yeaft.inputTokens":"\u8F93\u5165","yeaft.outputTokens":"\u8F93\u51FA","yeaft.duration":"\u8017\u65F6","yeaft.noDebugData":"\u6682\u65E0\u8C03\u8BD5\u6570\u636E","yeaft.showDebug":"\u663E\u793A\u8C03\u8BD5\u9762\u677F","yeaft.hideDebug":"\u9690\u85CF\u8C03\u8BD5\u9762\u677F","yeaft.reloadPage":"\u5237\u65B0\u9875\u9762","yeaft.reloadMessages":"\u91CD\u65B0\u52A0\u8F7D\u6D88\u606F","sidebar.sessions.syncing":"\u6B63\u5728\u540C\u6B65\u6700\u65B0\u6D88\u606F","yeaft.historySearch.label":"\u641C\u7D22 Session \u5386\u53F2\u6D88\u606F","yeaft.historySearch.button":"\u641C\u7D22\u6D88\u606F","yeaft.historySearch.placeholder":"\u641C\u7D22\u5F53\u524D Session \u7684\u6D88\u606F","yeaft.historySearch.searching":"\u6B63\u5728\u641C\u7D22\u2026","yeaft.historySearch.minChars":"\u81F3\u5C11\u8F93\u5165 2 \u4E2A\u5B57\u7B26","yeaft.historySearch.empty":"\u6CA1\u6709\u5339\u914D\u7684\u6D88\u606F","yeaft.historySearch.error":"\u641C\u7D22\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5","yeaft.historySearch.unsupported":"\u8BF7\u5347\u7EA7\u5F53\u524D Agent \u540E\u518D\u641C\u7D22 Session \u5386\u53F2\u6D88\u606F","yeaft.historySearch.more":"\u52A0\u8F7D\u66F4\u591A\u7ED3\u679C","yeaft.historySearch.you":"\u4F60","yeaft.historySearch.assistant":"\u52A9\u624B","yeaft.outline.label":"\u5386\u53F2\u6D88\u606F","yeaft.outline.sender":"\u53D1\u9001\u8005","yeaft.outline.allSenders":"\u5168\u90E8\u53D1\u9001\u8005","yeaft.outline.title":"\u5386\u53F2\u6D88\u606F","yeaft.outline.placeholder":"\u641C\u7D22\u5F53\u524D\u5BF9\u8BDD","yeaft.outline.searching":"\u6B63\u5728\u641C\u7D22\u2026","yeaft.outline.loading":"\u6B63\u5728\u52A0\u8F7D\u2026","yeaft.outline.older":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","yeaft.outline.moreMatches":"\u52A0\u8F7D\u66F4\u591A\u5339\u914D\u9879","yeaft.outline.minChars":"\u81F3\u5C11\u8F93\u5165 2 \u4E2A\u5B57\u7B26","yeaft.outline.empty":"\u6682\u65E0\u6D88\u606F","yeaft.outline.noMatches":"\u6CA1\u6709\u5339\u914D\u7684\u6D88\u606F","yeaft.outline.error":"\u5927\u7EB2\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5","yeaft.outline.unsupported":"\u8BF7\u5347\u7EA7\u5F53\u524D Agent \u540E\u518D\u4F7F\u7528\u5BF9\u8BDD\u5927\u7EB2","yeaft.outline.you":"\u4F60","yeaft.outline.assistant":"\u52A9\u624B","yeaft.outline.nonText":"\u975E\u6587\u672C\u56DE\u590D","yeaft.switchModel":"\u5207\u6362\u6A21\u578B","yeaft.modelMenu.title":"\u6A21\u578B\u548C LLM \u8BBE\u7F6E","yeaft.modelMenu.label":"\u6A21\u578B","yeaft.modelMenu.effort":"\u63A8\u7406\u5F3A\u5EA6","yeaft.modelMenu.effort.openaiReasoning":"\u63A8\u7406\u5F3A\u5EA6","yeaft.modelMenu.effort.anthropicBudget":"\u601D\u8003\u9884\u7B97","yeaft.modelMenu.effort.anthropicAdaptive":"\u81EA\u9002\u5E94\u601D\u8003\u5F3A\u5EA6","yeaft.modelMenu.effort.minimal":"\u6700\u5C0F","yeaft.modelMenu.effort.low":"\u4F4E","yeaft.modelMenu.effort.medium":"\u4E2D","yeaft.modelMenu.effort.high":"\u9AD8","yeaft.modelMenu.effort.xhigh":"\u8D85\u9AD8","yeaft.modelMenu.effort.max":"\u6700\u9AD8","yeaft.modelMenu.noEffort":"\u5F53\u524D\u6A21\u578B\u6CA1\u6709\u53EF\u517C\u5BB9\u6620\u5C04\u7684\u63A8\u7406\u5F3A\u5EA6\u63A7\u5236\u3002","yeaft.modelMenu.configureHint":"Provider\u3001\u5BC6\u94A5\u3001\u6A21\u578B\u5217\u8868","yeaft.settings.title":"\u8BBE\u7F6E","yeaft.settings.tabs.vp":"VP \u5E93","yeaft.settings.tabs.search":"\u641C\u7D22","search.settings.backendTitle":"\u641C\u7D22\u540E\u7AEF","search.settings.backendDesc":"\u9009\u62E9 WebSearch \u5DE5\u5177\u9ED8\u8BA4\u4F7F\u7528\u7684\u540E\u7AEF\u3002\u4E3B\u540E\u7AEF\u5931\u8D25\u65F6,\u5F15\u64CE\u4F1A\u81EA\u52A8\u964D\u7EA7\u5230 HTML \u6293\u53D6\u3002","search.settings.backend.tavily":"Tavily","search.settings.backend.tavilyHint":"\u6258\u7BA1\u641C\u7D22 API\u3002\u514D\u8D39\u989D\u5EA6 1000 \u6B21/\u6708\u3002\u63A8\u8350\u3002","search.settings.backend.playwright":"Playwright \u670D\u52A1","search.settings.backend.playwrightHint":"\u81EA\u5EFA\u7684\u6D4F\u89C8\u5668\u5F0F\u641C\u7D22/\u6293\u53D6\u670D\u52A1,\u9002\u5408 IP \u4FE1\u8A89\u5DEE\u88AB bot \u68C0\u6D4B\u7684\u73AF\u5883\u3002\u5C1A\u672A\u4E0A\u7EBF\u3002","search.settings.comingSoon":"\u5373\u5C06\u63A8\u51FA","search.settings.tavilyKeyTitle":"Tavily API key","search.settings.tavilyKeyDesc":"\u4FDD\u5B58\u5728 agent \u7684 ~/.yeaft/config.json \u4E2D\u3002\u514D\u8D39\u7533\u8BF7:","search.settings.tavilyKeyUnchanged":"\u4FDD\u6301\u4E0D\u53D8","search.settings.clearKey":"\u6E05\u9664","search.settings.usageTitle":"\u672C\u6708\u7528\u91CF","search.settings.usageRefresh":"\u5237\u65B0","search.settings.usageLoading":"\u52A0\u8F7D\u4E2D\u2026","search.settings.usagePlan":"\u8BA1\u5212","search.settings.usageUsed":"\u5DF2\u7528","search.settings.usagePaygo":"\u6309\u91CF\u4ED8\u8D39","search.settings.usageError":"\u52A0\u8F7D\u7528\u91CF\u5931\u8D25","search.settings.save":"\u4FDD\u5B58","search.settings.saving":"\u4FDD\u5B58\u4E2D\u2026","search.settings.saveSuccess":"\u5DF2\u4FDD\u5B58","search.settings.cancel":"\u91CD\u7F6E","yeaft.settings.yeaftTitle":"\u7EBF\u7A0B\u5E76\u53D1\u4E0E\u5F52\u6863","yeaft.settings.yeaftDesc":"\u8C03\u6574\u53EF\u540C\u65F6\u8FD0\u884C\u7684\u7EBF\u7A0B\u6570\u91CF\uFF0C\u4EE5\u53CA\u95F2\u7F6E\u7EBF\u7A0B\u7684\u81EA\u52A8\u5F52\u6863\u65F6\u957F\u3002","yeaft.settings.maxConcurrentLabel":"\u6700\u5927\u5E76\u53D1\u7EBF\u7A0B\u6570","yeaft.settings.maxConcurrentHint":"\u540C\u65F6\u5728\u7EBF\u7684\u7EBF\u7A0B\u603B\u6570\u4E0A\u9650\uFF08\u542B\u59CB\u7EC8\u5B58\u5728\u7684 main \u4E3B\u7EBF\u7A0B\uFF09\u3002\u8D85\u8FC7\u6B64\u4E0A\u9650\u7684\u65B0\u7EBF\u7A0B\u5C06\u88AB\u62D2\u7EDD\uFF0C\u76F4\u81F3\u5DF2\u6709\u7EBF\u7A0B\u88AB\u5F52\u6863\u6216\u7EC8\u6B62\u3002\u8303\u56F4\uFF1A1-50\u3002","yeaft.settings.archiveIdleDaysLabel":"\u95F2\u7F6E\u591A\u4E45\u540E\u81EA\u52A8\u5F52\u6863\u7EBF\u7A0B\uFF08\u5929\uFF09","yeaft.settings.archiveIdleDaysHint":"\u65E0\u6D3B\u52A8\u8D85\u8FC7\u6B64\u5929\u6570\u7684\u7EBF\u7A0B\u5C06\u88AB\u5F52\u6863\u3002\u8303\u56F4\uFF1A1-3650\u3002","yeaft.settings.yeaftSaveBtn":"\u4FDD\u5B58","yeaft.settings.yeaftSaving":"\u4FDD\u5B58\u4E2D...","yeaft.settings.yeaftSaved":"\u5DF2\u4FDD\u5B58","yeaft.settings.yeaftLoading":"\u52A0\u8F7D\u4E2D...","yeaft.settings.yeaftLoadError":"\u52A0\u8F7D Yeaft \u8BBE\u7F6E\u5931\u8D25","yeaft.settings.yeaftSaveError":"\u4FDD\u5B58 Yeaft \u8BBE\u7F6E\u5931\u8D25","yeaft.settings.rangeErrorConcurrent":"\u5FC5\u987B\u5728 1 \u5230 50 \u4E4B\u95F4","yeaft.settings.rangeErrorArchive":"\u5FC5\u987B\u5728 1 \u5230 3650 \u4E4B\u95F4","chat.session.creating":"\u6B63\u5728\u521B\u5EFA\u4F1A\u8BDD...","chat.session.loadingHistory":"\u6B63\u5728\u52A0\u8F7D\u4F1A\u8BDD\u5386\u53F2...","yeaft.historyLoad.error":"\u4F1A\u8BDD\u5386\u53F2\u6682\u65F6\u65E0\u6CD5\u52A0\u8F7D\uFF0C\u6D88\u606F\u4ECD\u5B89\u5168\u4FDD\u5B58\u5728 Agent \u4E2D\u3002","yeaft.historyLoad.retry":"\u91CD\u65B0\u52A0\u8F7D","yeaft.sessionInventory.error":"\u6682\u65F6\u65E0\u6CD5\u52A0\u8F7D Session\uFF0C\u4F1A\u8BDD\u4ECD\u5B89\u5168\u4FDD\u5B58\u5728 Agent \u4E2D\u3002","yeaft.sessionInventory.retry":"\u91CD\u65B0\u52A0\u8F7D Session","chat.session.closed":"\u4F1A\u8BDD\u5DF2\u5173\u95ED","chat.session.agentOffline":"Agent \u5DF2\u79BB\u7EBF\uFF0C\u8BE5\u4F1A\u8BDD\u5C06\u5728 Agent \u91CD\u65B0\u4E0A\u7EBF\u540E\u6062\u590D\u3002","chat.execution.cancelled":"\u6267\u884C\u5DF2\u53D6\u6D88","chat.sidebar.expand":"\u5C55\u5F00\u83DC\u5355","chat.sidebar.collapse":"\u6536\u8D77\u4FA7\u8FB9\u680F","chat.sidebar.workbench":"\u5DE5\u5177\u9762\u677F","chat.sidebar.newConv":"\u4F1A\u8BDD","chat.sidebar.recentChats":"\u6700\u8FD1\u4F1A\u8BDD","chat.sidebar.resumeConv":"\u6062\u590D\u4F1A\u8BDD","chat.sidebar.lightMode":"\u6D45\u8272\u6A21\u5F0F","chat.sidebar.darkMode":"\u6DF1\u8272\u6A21\u5F0F","chat.sidebar.settings":"\u8BBE\u7F6E","chat.sidebar.emptyHint":"\u70B9\u51FB\u4E0A\u65B9\u6309\u94AE\u521B\u5EFA\u65B0\u4F1A\u8BDD","chat.sidebar.closeConv":"\u5173\u95ED\u4F1A\u8BDD","chat.sidebar.renameConv":"\u91CD\u547D\u540D","chat.sidebar.pin":"\u7F6E\u9876","chat.sidebar.unpin":"\u53D6\u6D88\u7F6E\u9876","chat.connection.connecting":"\u8FDE\u63A5\u4E2D...","chat.connection.reconnecting":"\u91CD\u8FDE\u4E2D ({current}/{max})...","chat.connection.updating":"\u670D\u52A1\u6B63\u5728\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u5019...","chat.connection.disconnected":"\u8FDE\u63A5\u65AD\u5F00","chat.connection.reconnect":"\u91CD\u8FDE","chat.connection.reconnectFailed":"\u8FDE\u63A5\u65AD\u5F00\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8FDE\u6309\u94AE\u91CD\u8BD5\u3002","chat.time.justNow":"\u521A\u521A","chat.time.minutesAgo":"{count}\u5206\u949F\u524D","chat.time.daysAgo":"{count}\u5929\u524D","chat.time.today":"\u4ECA\u5929","chat.time.yesterday":"\u6628\u5929","chat.delete.confirm":"\u786E\u5B9A\u8981\u5173\u95ED\u8FD9\u4E2A\u4F1A\u8BDD\u5417\uFF1F\u8FD9\u5C06\u7EC8\u6B62\u5BF9\u5E94\u7684 Claude \u8FDB\u7A0B\u3002","chat.delete.enterWorkDir":"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u76EE\u5F55\u8DEF\u5F84","modal.newConv.workDir":"\u5DE5\u4F5C\u76EE\u5F55","modal.newConv.inputOrSelect":"\u8F93\u5165\u6216\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55","modal.newConv.browse":"\u6D4F\u89C8\u76EE\u5F55","modal.newConv.noWorkDirs":"\u6682\u65E0\u5DE5\u4F5C\u76EE\u5F55","modal.newConv.selectAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u5728\u7EBF\u7684 Agent","modal.newConv.create":"\u521B\u5EFA\u4F1A\u8BDD","modal.newConv.folderLabel":"\u{1F4C1} \u5DE5\u4F5C\u76EE\u5F55","modal.newConv.provider":"\u63D0\u4F9B\u65B9","modal.newConv.model":"\u6A21\u578B","provider.claudeCode":"Claude Code","provider.copilot":"Copilot","modal.resume.workDir":"\u5DE5\u4F5C\u76EE\u5F55","modal.resume.inputOrSelect":"\u8F93\u5165\u6216\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55","modal.resume.browse":"\u6D4F\u89C8\u76EE\u5F55","modal.resume.tabFolders":"\u5DE5\u4F5C\u76EE\u5F55","modal.resume.tabSessions":"\u5386\u53F2\u4F1A\u8BDD","modal.resume.noWorkDirs":"\u6682\u65E0\u5DE5\u4F5C\u76EE\u5F55","modal.resume.selectWorkDir":"\u8BF7\u5148\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55","modal.resume.noSessions":"\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u5386\u53F2\u4F1A\u8BDD","modal.resume.untitled":"\u672A\u547D\u540D\u4F1A\u8BDD","modal.resume.folderLabel":"\u{1F4C1} \u5DE5\u4F5C\u76EE\u5F55","modal.resume.sessionLabel":"\u{1F4AC} \u5386\u53F2\u4F1A\u8BDD","modal.resume.selectAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A\u5728\u7EBF\u7684 Agent","modal.folderPicker.title":"\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55","modal.folderPicker.parentDir":"\u4E0A\u7EA7\u76EE\u5F55","welcome.subtitle":"\u9762\u5411 Session\u3001\u5DE5\u5177\u548C VP \u534F\u4F5C\u7684 Web Code Agent","welcome.agentOnline":"{count} \u4E2A Agent \u5728\u7EBF","welcome.noAgents":"\u6682\u65E0\u5728\u7EBF Agent","welcome.noAgentsHint":"\u8BF7\u5148\u542F\u52A8 Agent \u7A0B\u5E8F\u8FDE\u63A5\u5230\u670D\u52A1\u5668","welcome.noAgent":"\u6682\u65E0\u5728\u7EBF Agent","welcome.noAgentHint":"\u8BF7\u5148\u542F\u52A8 Agent \u7A0B\u5E8F\u8FDE\u63A5\u5230\u670D\u52A1\u5668","welcome.setupAgent":"\u8BBE\u7F6E Agent","welcome.setupKicker":"Agent \u63A5\u5165","welcome.setupTitle":"\u8FDE\u63A5\u4F60\u7684\u7B2C\u4E00\u4E2A Yeaft Agent","welcome.setupDesc":"\u590D\u5236\u4E24\u6761\u547D\u4EE4\u5373\u53EF\u8FDE\u63A5\u672C\u673A Agent\u3002\u6A21\u578B\u53EF\u7528 GitHub Copilot \u81EA\u52A8\u914D\u7F6E\u3002","welcome.setupInstallTitle":"\u5B89\u88C5 CLI","welcome.setupCopilotTitle":"\u914D\u7F6E\u6A21\u578B","welcome.setupRunTitle":"\u542F\u52A8 Agent","welcome.setupSecretLoading":"\u6B63\u5728\u51C6\u5907 Agent secret...","welcome.setupSecretError":"\u65E0\u6CD5\u51C6\u5907 Agent secret\uFF0C\u8BF7\u6253\u5F00\u5B89\u5168\u8BBE\u7F6E\u91CD\u8BD5\u3002","welcome.openSecuritySettings":"\u6253\u5F00\u5B89\u5168\u8BBE\u7F6E","welcome.newConv":"\u4F1A\u8BDD","welcome.resumeHistory":"\u6062\u590D\u5386\u53F2","messages.loadingMore":"\u52A0\u8F7D\u66F4\u591A\u6D88\u606F...","messages.loadMore":"\u2191 \u70B9\u51FB\u6216\u5411\u4E0A\u6EDA\u52A8\u52A0\u8F7D\u66F4\u591A","message.loadingMore":"\u52A0\u8F7D\u66F4\u591A\u6D88\u606F...","message.loadMore":"\u2191 \u70B9\u51FB\u6216\u5411\u4E0A\u6EDA\u52A8\u52A0\u8F7D\u66F4\u591A","message.scrollToLatest":"\u2193 \u6700\u65B0","message.showResponses":"\u5C55\u5F00 {count} \u6761\u56DE\u590D","message.hideResponses":"\u6298\u53E0\u56DE\u590D","message.assistant":"\u52A9\u624B","chat.waiting.disconnected":"\u8FDE\u63A5\u5DF2\u65AD\u5F00","chat.connecting":"\u6B63\u5728\u8FDE\u63A5 provider \u4F1A\u8BDD...","chat.waiting.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","chat.waiting.agentOffline":"Agent \u5DF2\u79BB\u7EBF","chat.waiting.sessionLost":"Session \u5DF2\u4E22\u5931\uFF0C\u5DF2\u5237\u65B0\uFF0C\u7B49\u5F85\u6700\u65B0\u4FE1\u606F...","chat.waiting.cliExited":"Claude \u8FDB\u7A0B\u5DF2\u9000\u51FA\uFF0C\u5DF2\u5237\u65B0\uFF0C\u7B49\u5F85\u6700\u65B0\u4FE1\u606F...","chat.waiting.refresh":"\u5237\u65B0","chat.waiting.thinking":"AI \u6B63\u5728\u601D\u8003\u4E2D\uFF0C\u8BF7\u7A0D\u5019...","btw.hint":"esc \u9000\u51FA","btw.placeholder":"\u95EE\u4E2A\u987A\u4FBF\u7684\u95EE\u9898...","btw.close":"\u9000\u51FA BTW \u6A21\u5F0F","message.copyContent":"\u590D\u5236\u5185\u5BB9","message.copy":"\u590D\u5236\u5185\u5BB9","message.copied":"\u5DF2\u590D\u5236","message.copyCode":"\u590D\u5236\u4EE3\u7801","message.copyAll":"\u590D\u5236\u5168\u90E8","message.screenshot":"\u622A\u56FE","message.screenshotting":"\u6B63\u5728\u622A\u56FE...","message.exportMd":"\u5BFC\u51FA MD","message.askInput":"\u9700\u8981\u4F60\u7684\u8F93\u5165","message.askAnswered":"\u2713 \u5DF2\u56DE\u7B54","message.askCustom":"\u6216\u8F93\u5165\u81EA\u5B9A\u4E49\u56DE\u7B54...","message.askCustomPlaceholder":"\u6216\u8F93\u5165\u81EA\u5B9A\u4E49\u56DE\u7B54...","message.askSubmit":"\u63D0\u4EA4\u56DE\u7B54","message.askWaiting":"\u7B49\u5F85\u95EE\u9898\u52A0\u8F7D...","message.askExpired":"\u6B64\u95EE\u9898\u5DF2\u5931\u6548\uFF0C\u8BF7\u8BA9\u89D2\u8272\u91CD\u65B0\u63D0\u95EE","message.openInEditor":"\u5728\u7F16\u8F91\u5668\u4E2D\u6253\u5F00","message.resultDone":"\u5B8C\u6210","message.done":"\u5B8C\u6210","message.resultRead":"\u8BFB\u53D6 {file}","message.readFile":"\u8BFB\u53D6 {name}","message.file":"\u6587\u4EF6","message.attachImages":"{count} \u5F20\u56FE\u7247","message.imageCount":"{count} \u5F20\u56FE\u7247","message.imagePreview":"\u56FE\u7247\u9884\u89C8","message.previousImage":"\u4E0A\u4E00\u5F20\u56FE\u7247","message.nextImage":"\u4E0B\u4E00\u5F20\u56FE\u7247","message.imagePosition":"\u7B2C {current} \u5F20\uFF0C\u5171 {total} \u5F20","message.imageUnavailable":"\u56FE\u7247\u65E0\u6CD5\u52A0\u8F7D","message.attachFiles":"{count} \u4E2A\u6587\u4EF6","message.fileCount":"{count} \u4E2A\u6587\u4EF6","message.quote":"\u5F15\u7528","message.removeQuote":"\u5220\u9664\u5F15\u7528","message.replyingTo":"\u6B63\u5728\u56DE\u590D {author}","message.quotedFrom":"\u5F15\u7528\u81EA {author}","message.editAsNew":"\u7F16\u8F91","message.you":"\u4F60","input.upload":"\u4E0A\u4F20\u6587\u4EF6","input.placeholder":"\u8F93\u5165\u6D88\u606F...","input.send":"\u53D1\u9001","input.stopExecution":"\u505C\u6B62\u6267\u884C","chatInput.upload":"\u4E0A\u4F20\u6587\u4EF6","chatInput.uploading":"\u6B63\u5728\u4E0A\u4F20\u2026","chatInput.uploadFailed":"\u4E0A\u4F20\u5931\u8D25","chatInput.retryUpload":"\u91CD\u8BD5","chatInput.removeAttachment":"\u79FB\u9664\u9644\u4EF6","chatInput.placeholder":"\u8F93\u5165\u6D88\u606F...","chatInput.send":"\u53D1\u9001","chatInput.stop":"\u505C\u6B62\u6267\u884C","tools.thinking":"\u601D\u8003\u4E2D...","tools.read":"\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6","tools.write":"\u6B63\u5728\u5199\u5165\u6587\u4EF6","tools.edit":"\u6B63\u5728\u7F16\u8F91\u6587\u4EF6","tools.bash":"\u6B63\u5728\u6267\u884C\u547D\u4EE4","tools.glob":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6","tools.grep":"\u6B63\u5728\u641C\u7D22\u5185\u5BB9","tools.task":"\u6B63\u5728\u6267\u884C\u4EFB\u52A1","tools.webFetch":"\u6B63\u5728\u83B7\u53D6\u7F51\u9875","tools.webSearch":"\u6B63\u5728\u641C\u7D22\u7F51\u7EDC","tools.todoWrite":"\u6B63\u5728\u66F4\u65B0\u4EFB\u52A1","tools.executing":"\u6B63\u5728\u6267\u884C {name}","status.thinking":"\u601D\u8003\u4E2D...","status.reading":"\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6","status.writing":"\u6B63\u5728\u5199\u5165\u6587\u4EF6","status.editing":"\u6B63\u5728\u7F16\u8F91\u6587\u4EF6","status.executing":"\u6B63\u5728\u6267\u884C\u547D\u4EE4","status.searchingFiles":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6","status.searchingContent":"\u6B63\u5728\u641C\u7D22\u5185\u5BB9","status.executingTask":"\u6B63\u5728\u6267\u884C\u4EFB\u52A1","status.fetching":"\u6B63\u5728\u83B7\u53D6\u7F51\u9875","status.searching":"\u6B63\u5728\u641C\u7D22\u7F51\u7EDC","status.updatingTasks":"\u6B63\u5728\u66F4\u65B0\u4EFB\u52A1","status.executingTool":"\u6B63\u5728\u6267\u884C {name}","header.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","header.compacted":"\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210","chatHeader.newConv":"\u4F1A\u8BDD","chatHeader.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","chatHeader.compactDone":"\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210","chatHeader.compact":"\u538B\u7F29\u4E0A\u4E0B\u6587","chatHeader.resume":"\u6062\u590D\u4F1A\u8BDD","chatHeader.refresh":"\u5237\u65B0\u6D88\u606F","chatHeader.reloadPage":"\u5237\u65B0\u9875\u9762","chatHeader.clear":"\u6E05\u7A7A\u6D88\u606F","chatHeader.clearing":"\u6B63\u5728\u6E05\u7A7A\u4E0A\u4E0B\u6587...","chatHeader.clearDone":"\u4E0A\u4E0B\u6587\u5DF2\u6E05\u7A7A","chatHeader.confirmClear":"\u786E\u5B9A\u8981\u6E05\u7A7A\u5F53\u524D\u4F1A\u8BDD\u7684\u6240\u6709\u6D88\u606F\u5417\uFF1F","chatHeader.mcpConfig":"MCP \u670D\u52A1\u5668\u914D\u7F6E","chatHeader.mcpNeedRestart":"\u66F4\u6539\u5C06\u5728\u91CD\u542F\u4F1A\u8BDD\u540E\u751F\u6548\u3002","chatHeader.expertPanel":"\u5E2E\u5E2E\u56E2","chatHeader.subAgentPanel":"\u5B50\u4EE3\u7406","settings.close":"\u5173\u95ED\u8BBE\u7F6E","settings.tabs.account":"\u8D26\u53F7","settings.tabs.security":"\u5B89\u5168","settings.tabs.general":"\u901A\u7528","settings.tabs.invitations":"\u9080\u8BF7","auth.sessionExpired":"\u767B\u5F55\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002","settings.account.username":"\u7528\u6237\u540D","settings.account.role":"\u89D2\u8272","settings.account.email":"\u90AE\u7BB1","settings.account.emailNotSet":"\u672A\u8BBE\u7F6E","settings.account.profileLoadFailed":"\u8D26\u53F7\u8D44\u6599\u52A0\u8F7D\u5931\u8D25","settings.account.logout":"\u9000\u51FA\u767B\u5F55","settings.account.roleAdmin":"\u7BA1\u7406\u5458","settings.account.rolePro":"Pro","settings.account.linkedAccounts":"\u5DF2\u5173\u8054\u8D26\u6237","settings.account.linkedDesc":"\u5173\u8054\u7B2C\u4E09\u65B9\u767B\u5F55\u540E\uFF0C\u4F7F\u7528\u4EFB\u610F\u4E00\u79CD\u65B9\u5F0F\u90FD\u80FD\u767B\u5F55\u6B64\u8D26\u53F7\u3002","settings.account.bind":"\u7ED1\u5B9A","settings.account.unbind":"\u89E3\u7ED1","settings.account.linked":"\u5DF2\u7ED1\u5B9A","settings.account.providerDisabled":"\u672A\u914D\u7F6E","settings.account.cantUnbindLast":"\u4E0D\u80FD\u89E3\u7ED1\u552F\u4E00\u7684\u767B\u5F55\u65B9\u5F0F","settings.account.unbindFailed":"\u89E3\u7ED1\u5931\u8D25\uFF1A{error}","settings.account.bindFailed":"\u7ED1\u5B9A\u5931\u8D25","settings.account.ssoBoundMsg":"\u5DF2\u6210\u529F\u7ED1\u5B9A {provider}\u3002","settings.account.ssoConflictMsg":"\u8BE5 {provider} \u8D26\u53F7\u5DF2\u88AB\u5176\u4ED6\u7528\u6237\u7ED1\u5B9A\u3002","settings.account.providerMicrosoft":"Microsoft","settings.account.providerGithub":"GitHub","settings.account.providerGoogle":"Google","settings.account.providerWechat":"\u5FAE\u4FE1","settings.account.providerAlipay":"\u652F\u4ED8\u5B9D","settings.security.agentKey":"Agent \u5BC6\u94A5","settings.security.agentKeyDesc":"\u7528\u4E8E Agent \u8FDE\u63A5\u8BA4\u8BC1\u7684\u5171\u4EAB\u5BC6\u94A5","settings.security.agentSetupCommands":"Agent \u63A5\u5165\u547D\u4EE4","settings.security.agentCmdInstall":"\u5B89\u88C5 Agent","settings.security.agentCmdService":"\u8FD0\u884C Agent server","settings.security.agentCmdNeedsSecret":"\u8BF7\u5148\u751F\u6210 Agent \u5BC6\u94A5\uFF0C\u4EE5\u521B\u5EFA\u5305\u542B server \u5730\u5740\u548C\u5BC6\u94A5\u7684\u547D\u4EE4\u3002","settings.security.agentCmdLlm":"Copilot \u624B\u52A8\u515C\u5E95","settings.security.agentCmdLlmDesc":"\u5148\u8FD0\u884C\u5B89\u88C5\u547D\u4EE4\uFF1B\u5982\u679C\u672C\u673A\u5DF2\u6709 GitHub Copilot token\uFF0CYeaft \u4F1A\u81EA\u52A8\u914D\u7F6E github-copilot/gpt-5.5\u3002Copilot \u547D\u4EE4\u53EA\u4F5C\u4E3A\u515C\u5E95\u4F7F\u7528\u3002","settings.security.none":"\u65E0","settings.security.show":"\u663E\u793A","settings.security.hide":"\u9690\u85CF","settings.security.generateKey":"\u751F\u6210\u5BC6\u94A5","settings.security.resetKey":"\u91CD\u7F6E\u5BC6\u94A5","settings.security.resetting":"\u91CD\u7F6E\u4E2D...","settings.security.resetWarning":"\u91CD\u7F6E\u540E\u6240\u6709 Agent \u9700\u91CD\u65B0\u914D\u7F6E","settings.security.changePassword":"\u4FEE\u6539\u5BC6\u7801","settings.security.currentPassword":"\u5F53\u524D\u5BC6\u7801","settings.security.newPassword":"\u65B0\u5BC6\u7801\uFF08\u81F3\u5C116\u4F4D\uFF09","settings.security.confirmPassword":"\u786E\u8BA4\u65B0\u5BC6\u7801","settings.security.changeBtn":"\u4FEE\u6539\u5BC6\u7801","settings.security.changing":"\u4FEE\u6539\u4E2D...","settings.security.enterCurrentPwd":"\u8BF7\u8F93\u5165\u5F53\u524D\u5BC6\u7801","settings.security.newPwdMin":"\u65B0\u5BC6\u7801\u81F3\u5C116\u4F4D","settings.security.pwdMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","settings.security.pwdChanged":"\u5BC6\u7801\u4FEE\u6539\u6210\u529F","settings.security.setPassword":"\u8BBE\u7F6E\u5BC6\u7801","settings.security.setPasswordDesc":"\u4F60\u76EE\u524D\u901A\u8FC7 SSO \u767B\u5F55\uFF0C\u5C1A\u672A\u8BBE\u7F6E\u5BC6\u7801\u3002\u8BBE\u7F6E\u540E\u5373\u53EF\u4F7F\u7528\u7528\u6237\u540D + \u5BC6\u7801\u767B\u5F55\u3002","settings.security.setBtn":"\u8BBE\u7F6E\u5BC6\u7801","settings.security.pwdSet":"\u5BC6\u7801\u8BBE\u7F6E\u6210\u529F","settings.security.deleteAccount":"\u6CE8\u9500\u8D26\u6237","settings.security.deleteAccountDesc":"\u6C38\u4E45\u5220\u9664\u4F60\u7684\u8D26\u6237\u548C\u6240\u6709\u76F8\u5173\u6570\u636E\u3002\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","settings.security.deleteBtn":"\u6CE8\u9500\u8D26\u6237","settings.security.deleteConfirmBtn":"\u786E\u8BA4\u5220\u9664","settings.security.deleteConfirmPlaceholder":"\u8F93\u5165 DELETE \u4EE5\u786E\u8BA4","settings.security.deleteConfirmRequired":"\u8BF7\u8F93\u5165 DELETE \u4EE5\u786E\u8BA4\u6CE8\u9500\u8D26\u6237","settings.security.deleteFailed":"\u6CE8\u9500\u8D26\u6237\u5931\u8D25","settings.security.deleting":"\u6CE8\u9500\u4E2D...","settings.general.theme":"\u4E3B\u9898","settings.general.lightTheme":"\u6D45\u8272","settings.general.darkTheme":"\u6DF1\u8272","settings.general.language":"\u8BED\u8A00","settings.general.telemetry":"\u6027\u80FD\u9065\u6D4B","settings.general.telemetryDesc":"\u5728\u672C\u5730\u6279\u91CF\u8BB0\u5F55\u8017\u65F6\u8BCA\u65AD\uFF1Btrace \u5185\u5BB9\u4E0D\u4F1A\u53D1\u9001\u5230\u670D\u52A1\u5668\u3002","settings.general.telemetryOn":"\u5F00\u542F","settings.general.telemetryOff":"\u5173\u95ED","settings.general.telemetryRawLimit":"Provider \u539F\u59CB\u54CD\u5E94\u4E0A\u9650\uFF08\u5B57\u8282\uFF09","settings.invite.create":"\u521B\u5EFA\u9080\u8BF7\u7801","settings.invite.normalUser":"\u666E\u901A\u7528\u6237","settings.invite.proUser":"Pro \u7528\u6237","settings.invite.createBtn":"\u521B\u5EFA\u9080\u8BF7\u7801","settings.invite.creating":"\u521B\u5EFA\u4E2D...","settings.invite.list":"\u9080\u8BF7\u7801\u5217\u8868","settings.invite.used":"\u5DF2\u4F7F\u7528","settings.invite.expired":"\u5DF2\u8FC7\u671F","settings.invite.available":"\u53EF\u7528","settings.invite.usedBy":"\u4F7F\u7528\u8005: {user}","settings.invite.expiredAt":"\u8FC7\u671F\u4E8E: {time}","settings.invite.expiresAt":"\u6709\u6548\u81F3: {time}","settings.invite.noInvites":"\u6682\u65E0\u9080\u8BF7\u7801","settings.msg.copiedClipboard":"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F","settings.msg.copyFailed":"\u590D\u5236\u5931\u8D25","settings.msg.keyReset":"\u5BC6\u94A5\u5DF2\u91CD\u7F6E","settings.msg.resetFailed":"\u91CD\u7F6E\u5931\u8D25","settings.msg.changeFailed":"\u4FEE\u6539\u5931\u8D25","settings.msg.inviteCreated":"\u9080\u8BF7\u7801\u5DF2\u521B\u5EFA","settings.msg.createFailed":"\u521B\u5EFA\u5931\u8D25","settings.msg.inviteCopied":"\u9080\u8BF7\u7801\u5DF2\u590D\u5236","settings.msg.inviteDeleted":"\u9080\u8BF7\u7801\u5DF2\u5220\u9664","settings.msg.deleteFailed":"\u5220\u9664\u5931\u8D25","settings.tabs.llm":"LLM","settings.tabs.yeaft":"Yeaft","settings.yeaft.tabs.vp":"VP \u5E93","settings.yeaft.tabs.search":"\u641C\u7D22","settings.yeaft.tabs.mcp":"MCP","settings.mcp.title":"MCP \u670D\u52A1\u5668","settings.mcp.description":"\u901A\u8FC7 Model Context Protocol \u7ED9 Yeaft \u63A5\u5165\u66F4\u591A\u5DE5\u5177\u3002\u914D\u7F6E\u5199\u5165 agent \u4E0A\u7684 ~/.yeaft/config.json\uFF0C\u5DE5\u5177\u4F1A\u4EE5 mcp__<server>__<tool> \u7684\u5F62\u5F0F\u51FA\u73B0\u5728 LLM \u5DE5\u5177\u5217\u8868\u91CC\u3002","settings.mcp.reloadAll":"\u5168\u90E8\u91CD\u8FDE","settings.mcp.reloadOne":"\u91CD\u65B0\u8FDE\u63A5\u6B64\u670D\u52A1\u5668","settings.mcp.loading":"\u5904\u7406\u4E2D\u2026","settings.mcp.connected":"\u5DF2\u8FDE\u63A5","settings.mcp.disconnected":"\u672A\u8FDE\u63A5","settings.mcp.tools":"\u4E2A\u5DE5\u5177","settings.mcp.remove":"\u79FB\u9664","settings.mcp.empty":"\u8FD8\u6CA1\u6709\u914D\u7F6E MCP \u670D\u52A1\u5668\uFF0C\u53EF\u4EE5\u5728\u4E0B\u65B9\u6DFB\u52A0\u4E00\u4E2A\u3002","settings.mcp.addServer":"\u6DFB\u52A0\u670D\u52A1\u5668","settings.mcp.addServerDesc":"\u5927\u90E8\u5206 MCP \u670D\u52A1\u5668\u662F\u672C\u5730\u547D\u4EE4 \u2014 Yeaft \u4F1A\u901A\u8FC7 stdio \u542F\u52A8\u5B83\u5E76\u81EA\u52A8\u53D1\u73B0\u53EF\u7528\u5DE5\u5177\u3002","settings.mcp.serverName":"\u540D\u79F0","settings.mcp.command":"\u547D\u4EE4","settings.mcp.args":"\u53C2\u6570","settings.mcp.argsPlaceholder":"\u4F8B\u5982\uFF1A-y @modelcontextprotocol/server-filesystem /tmp","settings.mcp.env":"\u73AF\u5883\u53D8\u91CF","settings.mcp.envPlaceholder":"\u6BCF\u884C\u4E00\u4E2A KEY=value\uFF0C# \u5F00\u5934\u7684\u884C\u4F1A\u88AB\u5FFD\u7565\u3002","settings.mcp.saving":"\u4FDD\u5B58\u4E2D\u2026","settings.mcp.add":"\u6DFB\u52A0","settings.mcp.cancel":"\u6E05\u7A7A","settings.mcp.connectFailed":"\u5DF2\u4FDD\u5B58\u4F46\u8FDE\u63A5\u5931\u8D25","settings.mcp.addSuccess":"\u670D\u52A1\u5668\u5DF2\u6DFB\u52A0","settings.mcp.removeSuccess":"\u670D\u52A1\u5668\u5DF2\u79FB\u9664","settings.mcp.reloadSuccess":"\u5DF2\u8BF7\u6C42\u91CD\u8FDE","settings.mcp.confirmRemove":'\u79FB\u9664 MCP \u670D\u52A1\u5668 "{name}"\uFF1F\u4E0B\u4E00\u4E2A LLM turn \u8D77\u5B83\u7684\u5DE5\u5177\u5C06\u4E0D\u518D\u53EF\u89C1\u3002',"settings.mcp.errors.nameRequired":"\u8BF7\u586B\u5199\u540D\u79F0","settings.mcp.errors.nameFormat":"\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u77ED\u6A2A\u7EBF\u548C\u4E0B\u5212\u7EBF","settings.mcp.errors.commandRequired":"\u8BF7\u586B\u5199\u547D\u4EE4","settings.mcp.errors.argsParse":"\u53C2\u6570\u89E3\u6790\u5931\u8D25","settings.mcp.errors.envParse":"\u73AF\u5883\u53D8\u91CF\u89E3\u6790\u5931\u8D25","yeaft.session.title":"\u4F1A\u8BDD","yeaft.session.new":"+ \u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.create.title":"\u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.create.subtitle":"\u9009\u62E9\u8FD0\u884C\u4F4D\u7F6E\u548C\u5904\u7406\u4F1A\u8BDD\u7684 Provider\u3002","yeaft.session.create.close":"\u5173\u95ED","yeaft.session.create.nameLabel":"\u540D\u79F0","yeaft.session.create.namePlaceholder":"\u4F1A\u8BDD\u540D\u79F0\uFF08\u53EF\u9009\uFF09","yeaft.session.create.workDirLabel":"\u5DE5\u4F5C\u76EE\u5F55","yeaft.session.create.agentLabel":"Agent","yeaft.session.create.vpPicker":"\u9009\u62E9 VP","yeaft.session.create.vpNone":"\u672A\u9009\u62E9 VP","yeaft.session.create.vpCount":"\u5DF2\u9009 {n} \u4E2A VP","yeaft.session.create.untitled":"\u672A\u547D\u540D\u4F1A\u8BDD","yeaft.session.create.rosterEmpty":"\u6682\u65E0\u53EF\u7528 VP \u2014 \u8BF7\u5148\u5230\u89D2\u8272\u5E93\u521B\u5EFA\u3002","yeaft.session.create.rosterLoading":"VP \u52A0\u8F7D\u4E2D\u2026","yeaft.session.create.rosterError":"\u65E0\u6CD5\u4ECE\u5F53\u524D Agent \u52A0\u8F7D VP\u3002","yeaft.session.create.rosterRetry":"\u91CD\u8BD5","yeaft.vp.domain.general":"\u901A\u7528\u4E0E\u534F\u4F5C","yeaft.vp.domain.productDesign":"\u4EA7\u54C1\u4E0E\u4F53\u9A8C\u8BBE\u8BA1","yeaft.vp.domain.softwareSystems":"\u8F6F\u4EF6\u4E0E\u7CFB\u7EDF","yeaft.vp.domain.securityReliability":"\u5B89\u5168\u4E0E\u53EF\u9760\u6027","yeaft.vp.domain.scienceAnalysis":"\u79D1\u5B66\u4E0E\u5206\u6790","yeaft.vp.domain.philosophyPsychology":"\u54F2\u5B66\u4E0E\u5FC3\u7406","yeaft.vp.domain.strategyHistory":"\u6218\u7565\u4E0E\u5386\u53F2","yeaft.vp.domain.businessManagement":"\u5546\u4E1A\u4E0E\u7BA1\u7406","yeaft.vp.domain.artsCulture":"\u827A\u672F\u4E0E\u6587\u5316","yeaft.vp.domain.other":"\u5176\u4ED6\u9886\u57DF","yeaft.vp.domain.custom":"\u81EA\u5B9A\u4E49 VP","yeaft.session.create.defaultVpHint":"\u5F53\u6CA1\u6709 @ \u63D0\u53CA\u65F6\u9ED8\u8BA4\u56DE\u7B54\u7684 VP\u3002","yeaft.session.create.folderLabel":"\u{1F4C1} \u5DE5\u4F5C\u76EE\u5F55","yeaft.session.create.sessionLabel":"\u{1F4AC} \u6B64\u76EE\u5F55\u4E0B\u7684 session","yeaft.session.create.noWorkDirs":"\u8FD8\u6CA1\u6709\u4EFB\u4F55\u4F1A\u8BDD \u2014 \u5728\u4E0A\u65B9\u9009\u62E9\u6216\u8F93\u5165\u5DE5\u4F5C\u76EE\u5F55\u5F00\u59CB\u3002","yeaft.session.create.back":"\u8FD4\u56DE","yeaft.session.create.creating":"\u521B\u5EFA\u4E2D\u2026","yeaft.session.create.submit":"\u521B\u5EFA","yeaft.onboarding.ariaLabel":"Yeaft \u4E0A\u624B\u8BF4\u660E","yeaft.onboarding.topbarTitle":"\u5F00\u59CB\u4F7F\u7528 Yeaft","yeaft.onboarding.eyebrow":"Yeaft \u4E0A\u624B\u6307\u5357","yeaft.onboarding.title":"\u5148\u8FDE\u63A5 Agent\uFF0C\u518D\u5F00\u59CB\u4F1A\u8BDD","yeaft.onboarding.subtitle":"\u5728\u8D1F\u8D23\u6267\u884C\u5DE5\u5177\u7684\u673A\u5668\u4E0A\u76F4\u63A5\u8FD0\u884C\u4E0B\u9762\u7684\u547D\u4EE4\u3002agent secret \u5982\u679C\u4E0D\u5B58\u5728\uFF0C\u4F1A\u81EA\u52A8\u4E3A\u5F53\u524D\u8D26\u53F7\u751F\u6210\u3002","yeaft.onboarding.createSession":"\u521B\u5EFA\u6216\u6062\u590D Session","yeaft.onboarding.configureLlm":"\u6253\u5F00 LLM \u8BBE\u7F6E","yeaft.onboarding.secretLoading":"\u6B63\u5728\u751F\u6210 agent secret\u2026","yeaft.onboarding.secretError":"\u52A0\u8F7D agent secret \u5931\u8D25\u3002","yeaft.onboarding.secretPending":"<\u6B63\u5728\u52A0\u8F7D-agent-secret>","yeaft.onboarding.installTitle":"\u5B89\u88C5 yeaft-agent","yeaft.onboarding.installDesc":"\u5B89\u88C5\u547D\u4EE4\u884C Agent \u5305\u3002","yeaft.onboarding.connectTitle":"\u8FDE\u63A5\u8FD9\u4E2A Agent","yeaft.onboarding.connectDesc":"\u4E0B\u9762\u7684\u547D\u4EE4\u5DF2\u7ECF\u5E26\u4E0A\u5F53\u524D server URL \u548C\u81EA\u52A8\u751F\u6210\u7684 secret\u3002","yeaft.onboarding.llmTitle":"\u4F7F\u7528 GitHub Copilot","yeaft.onboarding.llmDesc":"\u5148\u767B\u5F55 GitHub CLI\uFF0C\u7136\u540E\u628A gpt-5.5 \u8BBE\u4E3A Yeaft \u9ED8\u8BA4\u6A21\u578B\u3002","yeaft.restore.modal.empty":"\u6B64\u76EE\u5F55\u4E0B\u6CA1\u6709 yeaft session","yeaft.restore.modal.scanError":"\u626B\u63CF\u5931\u8D25: {message}","yeaft.restore.modal.restoreError":"\u6062\u590D\u5931\u8D25: {message}","settings.llm.noAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent \u4EE5\u7BA1\u7406 LLM \u914D\u7F6E\u3002","settings.llm.agentOffline":"Agent \u5F53\u524D\u79BB\u7EBF\uFF0C\u65E0\u6CD5\u52A0\u8F7D LLM \u914D\u7F6E\u3002\u8BF7\u7B49\u5F85 Agent \u4E0A\u7EBF\u540E\u91CD\u8BD5\u3002","settings.llm.loading":"\u6B63\u5728\u52A0\u8F7D\u914D\u7F6E...","settings.llm.loadError":"\u52A0\u8F7D\u914D\u7F6E\u5931\u8D25","settings.llm.configureAgent":"\u914D\u7F6E\u5F53\u524D Agent \u7684 LLM","settings.llm.configureMenu":"\u8BBE\u7F6E LLM","settings.llm.simpleCopilotTitle":"\u63A8\u8350\uFF1AGitHub Copilot","settings.llm.useGitHubCopilot":"\u4F7F\u7528 GitHub Copilot","settings.llm.refreshingModels":"\u6B63\u5728\u5237\u65B0\u6A21\u578B...","settings.llm.managedCopilotTitle":"\u6258\u7BA1\u7684 GitHub Copilot","settings.llm.managedCopilotDesc":"Base URL\u3001\u8BA4\u8BC1\u3001\u6A21\u578B\u76EE\u5F55\u548C\u6BCF\u4E2A\u6A21\u578B\u7684 API \u534F\u8BAE\u90FD\u81EA\u52A8\u7BA1\u7406\u3002Claude \u6A21\u578B\u8D70 Anthropic Messages\uFF1BGPT/o \u6A21\u578B\u8D70 OpenAI Responses\u3002","settings.llm.providersTitle":"\u670D\u52A1\u5546","settings.llm.testFailed":"\u8FDE\u63A5\u6D4B\u8BD5\u5931\u8D25","settings.llm.saveSuccess":"LLM \u8BBE\u7F6E\u5DF2\u4FDD\u5B58","settings.llm.saveFailed":"\u4FDD\u5B58 LLM \u8BBE\u7F6E\u5931\u8D25","settings.llm.presets.title":"\u5FEB\u901F\u914D\u7F6E","settings.llm.providersDesc":"\u9009\u62E9\u4E00\u4E2A\u670D\u52A1\u5546\uFF0C\u4FDD\u5B58\u540E\u5373\u53EF\u5728 Session \u4E2D\u4F7F\u7528\u3002","settings.llm.agentProviders":"\u5F53\u524D agent providers","settings.llm.agentBadge":"\u5F53\u524D agent","settings.llm.addProvider":"\u6DFB\u52A0\u670D\u52A1\u5546","settings.llm.addFromPreset":"\u4ECE\u76EE\u5F55\u6DFB\u52A0","settings.llm.preset.title":"\u670D\u52A1\u5546\u76EE\u5F55\uFF08models.dev\uFF09","settings.llm.preset.refresh":"\u5237\u65B0\u76EE\u5F55","settings.llm.preset.loading":"\u52A0\u8F7D\u76EE\u5F55\u2026","settings.llm.preset.empty":"\u76EE\u5F55\u4E3A\u7A7A\u3002","settings.llm.preset.pickProvider":"\u5728\u5DE6\u4FA7\u9009\u62E9\u4E00\u4E2A\u670D\u52A1\u5546\u4EE5\u67E5\u770B\u6A21\u578B\u3002","settings.llm.preset.filterProviders":"\u8FC7\u6EE4\u670D\u52A1\u5546\u2026","settings.llm.preset.filterModels":"\u8FC7\u6EE4\u6A21\u578B\u2026","settings.llm.preset.selectAll":"\u5168\u9009","settings.llm.preset.selectNone":"\u6E05\u7A7A","settings.llm.preset.cancel":"\u53D6\u6D88","settings.llm.preset.add":"\u6DFB\u52A0\u5230\u670D\u52A1\u5546\u5217\u8868","settings.llm.preset.fetchedAt":"\u76EE\u5F55\u5DF2\u66F4\u65B0 {minutes} \u5206\u949F","settings.llm.addModel":"\u6DFB\u52A0\u6A21\u578B","settings.llm.removeModel":"\u79FB\u9664\u6A21\u578B","settings.llm.providerName":"\u540D\u79F0","settings.llm.providerNamePlaceholder":"\u4F8B\u5982 my-proxy","settings.llm.baseUrl":"Base URL","settings.llm.baseUrlPlaceholder":"\u4F8B\u5982 http://localhost:6628/v1","settings.llm.apiKey":"API Key","settings.llm.apiKeyPlaceholder":"\u8F93\u5165 API Key","settings.llm.protocol":"\u534F\u8BAE","settings.llm.protocolOpenAI":"OpenAI \u517C\u5BB9","settings.llm.protocolOpenAIResponses":"OpenAI Responses (GPT-5)","settings.llm.protocolAnthropic":"Anthropic \u539F\u751F","settings.llm.protocolHint.anthropic":"Claude \u539F\u751F Messages API\u3002","settings.llm.protocolHint.openai":"Chat Completions /v1/chat/completions \u2014 GPT-4 \u53CA\u5927\u591A\u6570\u517C\u5BB9\u4EE3\u7406\u3002","settings.llm.protocolHint.openaiResponses":"Responses API /v1/responses \u2014 GPT-5 \u7CFB\u5217\u5FC5\u987B\u3002","settings.llm.modelCtxPlaceholder":"\u4E0A\u4E0B\u6587","settings.llm.modelMaxPlaceholder":"\u8F93\u51FA","settings.llm.models":"\u5019\u9009\u6A21\u578B ID","settings.llm.modelsPlaceholder":"\u6A21\u578B ID\uFF0C\u9017\u53F7\u6216\u6362\u884C\u5206\u9694\uFF0C\u4F8B\u5982 claude-sonnet-4-20250514, gpt-5","settings.llm.modelsHint":"\u9017\u53F7\u6216\u6362\u884C\u5206\u9694\u3002","settings.llm.removeProvider":"\u79FB\u9664","settings.llm.modelSelectionTitle":"\u6A21\u578B\u9009\u62E9","settings.llm.modelSelectionDesc":"\u9009\u62E9\u9ED8\u8BA4\u6A21\u578B\u3002","settings.llm.primaryModel":"\u4E3B\u6A21\u578B","settings.llm.primaryModelDesc":"\u7528\u4E8E\u7528\u6237\u5BF9\u8BDD","settings.llm.fastModel":"\u5FEB\u901F\u6A21\u578B","settings.llm.fastModelDesc":"\u7528\u4E8E\u5185\u90E8\u4EFB\u52A1\uFF08\u8BB0\u5FC6\u3001\u603B\u7ED3\uFF09","settings.llm.noModels":"\u6682\u65E0\u53EF\u7528\u6A21\u578B\u3002\u8BF7\u5148\u6DFB\u52A0\u670D\u52A1\u5546\u3002","settings.llm.selectModel":"\u9009\u62E9\u6A21\u578B...","settings.llm.save":"\u4FDD\u5B58\u66F4\u6539","settings.llm.saving":"\u4FDD\u5B58\u4E2D...","settings.llm.saved":"\u914D\u7F6E\u5DF2\u4FDD\u5B58","settings.llm.savedRefreshWarning":"\u914D\u7F6E\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5B9E\u65F6\u6A21\u578B\u76EE\u5F55\u5237\u65B0\u5931\u8D25\uFF1A{error}","settings.llm.unsavedChanges":"\u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539","settings.llm.confirmRemoveProvider":"\u786E\u5B9A\u79FB\u9664\u6B64\u670D\u52A1\u5546\uFF1F","settings.llm.setupTitle":"\u8FDE\u63A5\u6A21\u578B","settings.llm.setupDesc":"\u63A8\u8350\u4F7F\u7528 GitHub Copilot\uFF1B\u4E5F\u53EF\u4EE5\u6DFB\u52A0\u81EA\u5DF1\u7684 API \u670D\u52A1\u5546\u3002","settings.llm.providerSectionHint":"\u53EA\u4FDD\u7559\u8FDE\u63A5\u6A21\u578B\u5FC5\u9700\u7684\u4FE1\u606F\u3002","settings.tabs.dashboard":"\u4EEA\u8868\u677F","settings.dashboard.totalUsers":"\u603B\u7528\u6237\u6570","settings.dashboard.onlineUsers":"\u5728\u7EBF\u7528\u6237","settings.dashboard.onlineAgents":"\u5728\u7EBFAgent","settings.dashboard.totalSessions":"\u603B\u4F1A\u8BDD\u6570","settings.dashboard.todayActive":"\u4ECA\u65E5\u6D3B\u8DC3","settings.dashboard.todayMessages":"\u4ECA\u65E5\u6D88\u606F","settings.dashboard.todayUserTurns":"\u4ECA\u65E5\u7528\u6237 Turn","settings.dashboard.totalTokens":"\u603B Token","settings.dashboard.tokenAccuracy":"\u6765\u81EA\u6A21\u578B\u670D\u52A1\u5546\u8FD4\u56DE\u7684\u5B9E\u9645\u7528\u91CF\uFF1B\u4ECE\u542F\u7528\u6309\u7528\u6237 Token \u7EDF\u8BA1\u7684\u7248\u672C\u5F00\u59CB\u7D2F\u8BA1\uFF0C\u4E14\u4E0D\u5305\u542B\u5FC3\u8DF3\u3002","settings.dashboard.agentTurns":"Agent Turn","settings.dashboard.agentSessions":"Agent Session","settings.dashboard.turns":"Turn","settings.dashboard.tokens":"Token","settings.dashboard.inputTokens":"\u8F93\u5165","settings.dashboard.outputTokens":"\u8F93\u51FA","settings.dashboard.cacheTokens":"\u7F13\u5B58","settings.dashboard.today":"\u4ECA\u5929","settings.dashboard.thisWeek":"\u672C\u5468","settings.dashboard.thisMonth":"\u672C\u6708","settings.dashboard.all":"\u5168\u90E8","settings.dashboard.userUsage":"\u7528\u6237\u7528\u91CF","settings.dashboard.agentList":"Agent \u5217\u8868","settings.dashboard.onlineUserList":"\u5728\u7EBF\u7528\u6237","settings.dashboard.refresh":"\u5237\u65B0","settings.dashboard.name":"\u540D\u79F0","settings.dashboard.messages":"\u6D88\u606F\u6570","settings.dashboard.userTurns":"\u7528\u6237 Turn \u6570","settings.dashboard.sessions":"\u4F1A\u8BDD\u6570","settings.dashboard.requests":"\u8BF7\u6C42\u6570","settings.dashboard.traffic":"\u6D41\u91CF","settings.dashboard.lastLogin":"\u6700\u540E\u767B\u5F55","settings.dashboard.status":"\u72B6\u6001","settings.dashboard.latency":"\u5EF6\u8FDF","settings.dashboard.version":"\u7248\u672C","settings.dashboard.owner":"\u6240\u6709\u8005","settings.dashboard.role":"\u89D2\u8272","settings.dashboard.agent":"Agent","settings.dashboard.online":"\u5728\u7EBF","settings.dashboard.offline":"\u79BB\u7EBF","settings.dashboard.noAgents":"\u6682\u65E0\u6CE8\u518C Agent","settings.dashboard.noUserData":"\u6682\u65E0\u7528\u6237\u6570\u636E","settings.dashboard.noOnlineUsers":"\u6682\u65E0\u5728\u7EBF\u7528\u6237","settings.dashboard.loading":"\u52A0\u8F7D\u4E2D...","settings.dashboard.error":"\u6570\u636E\u52A0\u8F7D\u5931\u8D25","settings.dashboard.ago":"{time}\u524D","settings.dashboard.loadMore":"\u52A0\u8F7D\u66F4\u591A\uFF08\u5269\u4F59 {remaining} \u6761\uFF09","workbench.maximize":"\u6700\u5927\u5316\u9762\u677F","workbench.restore":"\u8FD8\u539F\u9762\u677F","workbench.collapse":"\u6536\u8D77\u9762\u677F","theme.switchToLight":"\u5207\u6362\u5230\u6D45\u8272\u4E3B\u9898","theme.switchToDark":"\u5207\u6362\u5230\u6DF1\u8272\u4E3B\u9898","theme.toLight":"\u5207\u6362\u5230\u6D45\u8272\u4E3B\u9898","theme.toDark":"\u5207\u6362\u5230\u6DF1\u8272\u4E3B\u9898","terminal.splitH":"\u6C34\u5E73\u5206\u5C4F\uFF08\u5DE6\u53F3\uFF09","terminal.splitV":"\u5782\u76F4\u5206\u5C4F\uFF08\u4E0A\u4E0B\uFF09","terminal.close":"\u5173\u95ED\u5F53\u524D\u7EC8\u7AEF","terminal.autoCreate":"\u5207\u6362\u5230 Terminal \u6807\u7B7E\u65F6\u5C06\u81EA\u52A8\u521B\u5EFA\u7EC8\u7AEF","terminal.xtermError":"xterm.js \u672A\u52A0\u8F7D\uFF0C\u8BF7\u5237\u65B0\u9875\u9762","terminal.xtermNotLoaded":"xterm.js \u672A\u52A0\u8F7D\uFF0C\u8BF7\u5237\u65B0\u9875\u9762","terminal.mountError":"\u7EC8\u7AEF\u5BB9\u5668\u6302\u8F7D\u5931\u8D25","terminal.mountFailed":"\u7EC8\u7AEF\u5BB9\u5668\u6302\u8F7D\u5931\u8D25","terminal.createError":"\u7EC8\u7AEF\u521B\u5EFA\u5931\u8D25","terminal.createFailed":"\u7EC8\u7AEF\u521B\u5EFA\u5931\u8D25","terminal.error":"\u7EC8\u7AEF\u9519\u8BEF","git.selectFolder":"\u9009\u62E9\u6587\u4EF6\u5939","git.repoPath":"\u8F93\u5165 Git \u4ED3\u5E93\u8DEF\u5F84...","git.repoPathPlaceholder":"\u8F93\u5165 Git \u4ED3\u5E93\u8DEF\u5F84...","git.workDir":"Git \u5DE5\u4F5C\u76EE\u5F55","git.loadStatus":"\u52A0\u8F7D Git \u72B6\u6001","git.loading":"\u52A0\u8F7D Git \u72B6\u6001...","git.loadingStatus":"\u52A0\u8F7D Git \u72B6\u6001...","git.clean":"\u5DE5\u4F5C\u533A\u5E72\u51C0\uFF0C\u65E0\u53D8\u66F4","git.cleanWorkDir":"\u5DE5\u4F5C\u533A\u5E72\u51C0\uFF0C\u65E0\u53D8\u66F4","git.selectAgent":"\u9009\u62E9 Agent \u540E\u52A0\u8F7D Git \u72B6\u6001","git.selectAgentFirst":"\u9009\u62E9 Agent \u540E\u52A0\u8F7D Git \u72B6\u6001","git.diffOnly":"\u53EA\u770B\u5DEE\u5F02","git.fullFile":"\u770B\u5168\u6587","git.zoomIn":"\u653E\u5927\u5B57\u4F53","git.zoomOut":"\u7F29\u5C0F\u5B57\u4F53","git.loadingDiff":"\u52A0\u8F7D Diff...","git.clickToView":"\u70B9\u51FB\u6587\u4EF6\u67E5\u770B\u5DEE\u5F02","git.clickFileToView":"\u70B9\u51FB\u6587\u4EF6\u67E5\u770B\u5DEE\u5F02","git.selectRepo":"\u9009\u62E9 Git \u4ED3\u5E93","git.noDiff":"(\u65E0\u5DEE\u5F02)","git.binaryFile":"(\u4E8C\u8FDB\u5236\u6587\u4EF6)","files.notLoaded":"\u672A\u52A0\u8F7D","files.newFile":"\u65B0\u5EFA\u6587\u4EF6","files.newFolder":"\u65B0\u5EFA\u6587\u4EF6\u5939","files.collapseAll":"\u6298\u53E0\u6240\u6709","files.openFolder":"\u6253\u5F00\u6587\u4EF6\u5939","files.deleteSelected":"\u5220\u9664\u9009\u4E2D","files.moveSelected":"\u79FB\u52A8\u9009\u4E2D","files.enterPath":"\u8F93\u5165\u8DEF\u5F84...","files.searchFiles":"\u641C\u7D22\u6587\u4EF6... (Ctrl+P)","files.noMatch":"\u65E0\u5339\u914D\u7ED3\u679C","files.searching":"\u641C\u7D22\u4E2D...","files.loadingTree":"\u52A0\u8F7D\u4E2D...","files.emptyDir":"\u7A7A\u76EE\u5F55","files.loadingFile":"\u52A0\u8F7D\u6587\u4EF6...","files.searchPlaceholder":"\u641C\u7D22...","files.replacePlaceholder":"\u66FF\u6362...","files.replace":"\u66FF\u6362","files.replaceAll":"\u5168\u90E8","files.replaceCurrent":"\u66FF\u6362\u5F53\u524D","files.replaceAllTitle":"\u5168\u90E8\u66FF\u6362","files.clickToView":"\u70B9\u51FB\u6587\u4EF6\u67E5\u770B\u5185\u5BB9","files.selectFolder":"\u9009\u62E9\u6587\u4EF6\u5939","files.enterFolderName":"\u8F93\u5165\u6587\u4EF6\u5939\u540D...","files.enterFileName":"\u8F93\u5165\u6587\u4EF6\u540D...","files.moveTarget":"\u8F93\u5165\u76EE\u6807\u76EE\u5F55\u8DEF\u5F84...","files.moveItems":"\u5C06 {count} \u4E2A\u9879\u76EE\u79FB\u52A8\u5230\u6307\u5B9A\u76EE\u5F55","files.workDir":"\u5DE5\u4F5C\u76EE\u5F55: {dir}","files.enterDirPath":"\u8F93\u5165\u76EE\u5F55\u8DEF\u5F84...","files.unsavedConfirm":'"{name}" \u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF0C\u786E\u5B9A\u5173\u95ED\uFF1F',"files.deleteConfirm":'\u786E\u5B9A\u8981\u5220\u9664 "{name}" \u5417\uFF1F',"files.deleteDirHint":"\uFF08\u5C06\u5220\u9664\u6587\u4EF6\u5939\u53CA\u5176\u6240\u6709\u5185\u5BB9\uFF09","files.deleteSelectedConfirm":"\u786E\u5B9A\u8981\u5220\u9664\u9009\u4E2D\u7684 {count} \u4E2A\u9879\u76EE\u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002","files.findPrev":"\u4E0A\u4E00\u4E2A (Shift+Enter)","files.findNext":"\u4E0B\u4E00\u4E2A (Enter)","files.caseSensitive":"\u533A\u5206\u5927\u5C0F\u5199","files.regex":"\u6B63\u5219\u8868\u8FBE\u5F0F","files.unsaved":"\u672A\u4FDD\u5B58","files.clearSelection":"\u6E05\u9664\u9009\u62E9","files.rename":"\u91CD\u547D\u540D","files.copyHere":"\u590D\u5236","files.moveTo":"\u79FB\u52A8\u5230...","files.download":"\u4E0B\u8F7D","files.enterNewName":"\u8F93\u5165\u65B0\u540D\u79F0...","files.loadingPreview":"\u52A0\u8F7D\u9884\u89C8\u4E2D...","files.preview":"\u9884\u89C8","files.edit":"\u7F16\u8F91","files.pptxNotSupported":"PPTX \u672C\u5730\u9884\u89C8\u6682\u4E0D\u652F\u6301\uFF0C\u8BF7\u5728\u8BBE\u7F6E\u4E2D\u5207\u6362\u4E3A Office Online \u6A21\u5F0F\u3002","files.officePreviewMode":"Office \u9884\u89C8\u6A21\u5F0F","files.officeOnline":"Office Online","files.localRender":"\u672C\u5730\u6E32\u67D3","proxy.port":"\u7AEF\u53E3","proxy.label":"\u6807\u7B7E","proxy.add":"\u6DFB\u52A0\u7AEF\u53E3\u6620\u5C04","proxy.addPort":"\u6DFB\u52A0\u7AEF\u53E3\u6620\u5C04","proxy.enable":"\u70B9\u51FB\u542F\u7528","proxy.clickEnable":"\u70B9\u51FB\u542F\u7528","proxy.disable":"\u70B9\u51FB\u7981\u7528","proxy.clickDisable":"\u70B9\u51FB\u7981\u7528","proxy.openNewTab":"\u5728\u65B0\u6807\u7B7E\u9875\u6253\u5F00","proxy.openInBrowser":"\u5728\u65B0\u6807\u7B7E\u9875\u6253\u5F00","proxy.noMappings":"\u6682\u65E0\u7AEF\u53E3\u6620\u5C04","proxy.noPorts":"\u6682\u65E0\u7AEF\u53E3\u6620\u5C04","proxy.hint":"\u6DFB\u52A0\u7AEF\u53E3\u540E\uFF0C\u53EF\u901A\u8FC7\u4EE3\u7406 URL \u8BBF\u95EE agent \u673A\u5668\u4E0A\u7684\u672C\u5730\u670D\u52A1","proxy.noPortsHint":"\u6DFB\u52A0\u7AEF\u53E3\u540E\uFF0C\u53EF\u901A\u8FC7\u4EE3\u7406 URL \u8BBF\u95EE agent \u673A\u5668\u4E0A\u7684\u672C\u5730\u670D\u52A1","proxy.selectAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent","store.selectAgent":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent","store.creatingConv":"\u6B63\u5728\u521B\u5EFA\u4F1A\u8BDD...","store.loadingHistory":"\u6B63\u5728\u52A0\u8F7D\u4F1A\u8BDD\u5386\u53F2...","store.executionCancelled":"\u6267\u884C\u5DF2\u53D6\u6D88","store.loginFailed":"\u767B\u5F55\u5931\u8D25","store.convClosed":"\u4F1A\u8BDD\u5DF2\u5173\u95ED","store.convCreated":"\u65B0\u4F1A\u8BDD\u5DF2\u521B\u5EFA [{agent}]\uFF0C\u5DE5\u4F5C\u76EE\u5F55: {workDir}","store.convResumed":"\u5DF2\u6062\u590D\u4F1A\u8BDD [{agent}]: {sessionId}","roleplay.creating":"\u6B63\u5728\u521B\u5EFA \u89D2\u8272\u626E\u6F14 \u4F1A\u8BDD...","roleplay.working":"\u5DE5\u4F5C\u4E2D","roleplay.selectTeam":"\u9009\u62E9\u56E2\u961F\u6A21\u677F","roleplay.teamDev":"\u8F6F\u4EF6\u5F00\u53D1","roleplay.teamCustom":"\u81EA\u5B9A\u4E49","roleplay.editRoles":"\u7F16\u8F91\u89D2\u8272","roleplay.roleName":"\u89D2\u8272\u6807\u8BC6","roleplay.roleDisplayName":"\u663E\u793A\u540D\u79F0","roleplay.roleIcon":"\u56FE\u6807","roleplay.roleDesc":"\u89D2\u8272\u63CF\u8FF0","roleplay.rolePrompt":"\u89D2\u8272 Prompt","roleplay.removeRole":"\u79FB\u9664\u89D2\u8272","roleplay.addRole":"\u6DFB\u52A0\u89D2\u8272","roleplay.start":"\u542F\u52A8 \u89D2\u8272\u626E\u6F14","roleplay.sidebarTitle":"\u89D2\u8272\u626E\u6F14","roleplay.configTitle":"\u89D2\u8272\u626E\u6F14","roleplay.newSession":"\u65B0\u5EFA \u89D2\u8272\u626E\u6F14","roleplay.emptyHint":"\u53D1\u9001\u6D88\u606F\u5F00\u59CB\u591A\u89D2\u8272\u534F\u4F5C","roleplay.askingYou":"\u6B63\u5728\u63D0\u95EE","roleplay.language":"\u8BED\u8A00","roleplay.rolePreview":"\u89D2\u8272\u914D\u7F6E","roleplay.noAgents":"\u6CA1\u6709\u5728\u7EBF\u7684 Agent","roleplay.inputPlaceholder":"\u8F93\u5165\u6D88\u606F\u2026 \u4F7F\u7528 @ \u63D0\u53CA\u89D2\u8272","roleplay.existingSessions":"\u5DF2\u6709\u56E2\u961F","roleplay.restore":"\u6062\u590D","roleplay.restoring":"\u6B63\u5728\u6062\u590D \u89D2\u8272\u626E\u6F14 \u4F1A\u8BDD...","roleplay.createNew":"\u521B\u5EFA\u65B0\u56E2\u961F","expertPanel.title":"\u5E2E\u5E2E\u56E2","expertPanel.search":"\u641C\u7D22\u89D2\u8272\u6216 Action...","expertPanel.noResults":"\u6CA1\u6709\u5339\u914D\u7ED3\u679C","expertPanel.clearAll":"\u6E05\u7A7A","expertPanel.persona":"\u89D2\u8272\u4EBA\u8BBE","expertPanel.template":"\u6709\u8F93\u5165\u65F6 \xB7 \u6D88\u606F\u524D\u7F00","expertPanel.templateHint":"\u7528\u6237\u5199\u4E86\u6587\u5B57\u65F6\uFF1A\u6B64\u524D\u7F00 + \u7528\u6237\u6587\u5B57 = \u6700\u7EC8\u53D1\u9001\u5185\u5BB9","expertPanel.defaultMsg":"\u65E0\u8F93\u5165\u65F6 \xB7 \u5B8C\u6574 Prompt","expertPanel.defaultMsgHint":"\u7528\u6237\u4E0D\u5199\u6587\u5B57\u76F4\u63A5\u53D1\u9001\u65F6\uFF0C\u4F7F\u7528\u6B64\u5B8C\u6574 prompt","expertPanel.loading":"\u6B63\u5728\u52A0\u8F7D\u89D2\u8272\u5B9A\u4E49...","expertPanel.viewPrompt":"\u67E5\u770B\u63D0\u793A\u8BCD","expertPanel.customRoles":"\u81EA\u5B9A\u4E49\u89D2\u8272","expertPanel.addRole":"\u6DFB\u52A0\u89D2\u8272","expertPanel.editRole":"\u7F16\u8F91\u89D2\u8272","expertPanel.deleteRole":"\u5220\u9664\u89D2\u8272","expertPanel.noCustomRoles":"\u6682\u65E0\u81EA\u5B9A\u4E49\u89D2\u8272","expertPanel.createFirst":"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u81EA\u5B9A\u4E49\u89D2\u8272","expertPanel.noActions":"\u6682\u65E0 Action","expertPanel.deleteConfirm":'\u786E\u5B9A\u8981\u5220\u9664\u89D2\u8272 "{name}" \u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002',"expertPanel.deleteConfirmBtn":"\u5220\u9664","expertEditor.createTitle":"\u521B\u5EFA\u81EA\u5B9A\u4E49\u89D2\u8272","expertEditor.editTitle":"\u7F16\u8F91\u81EA\u5B9A\u4E49\u89D2\u8272","expertEditor.basicInfo":"\u57FA\u672C\u4FE1\u606F","expertEditor.roleName":"\u89D2\u8272\u540D\u79F0","expertEditor.roleNamePlaceholder":"\u5982\uFF1A\u6570\u636E\u5206\u6790\u5E08","expertEditor.roleTitle":"\u804C\u79F0","expertEditor.roleTitlePlaceholder":"\u5982\uFF1A\u9AD8\u7EA7\u6570\u636E\u5206\u6790\u5E08","expertEditor.fullName":"\u5168\u540D","expertEditor.fullNamePlaceholder":"\u53EF\u9009","expertEditor.titleEn":"\u82F1\u6587\u804C\u79F0","expertEditor.titleEnPlaceholder":"\u53EF\u9009","expertEditor.rolePrompt":"\u89D2\u8272 Prompt","expertEditor.messagePrefix":"\u6D88\u606F\u524D\u7F00\uFF08\u4E2D\u6587\uFF09","expertEditor.messagePrefixPlaceholder":"\u5982\uFF1A\u4F5C\u4E3A\u4E00\u540D\u8D44\u6DF1\u6570\u636E\u5206\u6790\u5E08\uFF0C","expertEditor.messagePrefixEn":"\u6D88\u606F\u524D\u7F00\uFF08\u82F1\u6587\uFF09","expertEditor.messagePrefixEnPlaceholder":"As a senior data analyst, ","expertEditor.actions":"Actions","expertEditor.addAction":"\u6DFB\u52A0 Action","expertEditor.removeAction":"\u79FB\u9664","expertEditor.actionName":"Action \u540D\u79F0","expertEditor.actionNamePlaceholder":"\u5982\uFF1A\u6570\u636E\u5206\u6790","expertEditor.actionNameEn":"\u82F1\u6587\u540D\u79F0","expertEditor.actionNameEnPlaceholder":"\u53EF\u9009","expertEditor.messageTemplate":"\u6709\u8F93\u5165\u65F6 \xB7 \u6D88\u606F\u524D\u7F00\uFF08\u4E2D\u6587\uFF09","expertEditor.messageTemplatePlaceholder":"\u7528\u6237\u5199\u4E86\u6587\u5B57\u65F6\uFF0C\u62FC\u5728\u7528\u6237\u6587\u5B57\u524D\u9762\u53D1\u9001","expertEditor.messageTemplateEn":"\u6709\u8F93\u5165\u65F6 \xB7 \u6D88\u606F\u524D\u7F00\uFF08\u82F1\u6587\uFF09","expertEditor.messageTemplateEnPlaceholder":"Prepended to user text when user types something","expertEditor.defaultMessage":"\u65E0\u8F93\u5165\u65F6 \xB7 \u5B8C\u6574 Prompt\uFF08\u4E2D\u6587\uFF09","expertEditor.defaultMessagePlaceholder":"\u7528\u6237\u4E0D\u5199\u6587\u5B57\u76F4\u63A5\u53D1\u9001\u65F6\uFF0C\u4F7F\u7528\u6B64\u5B8C\u6574\u5185\u5BB9","expertEditor.defaultMessageEn":"\u65E0\u8F93\u5165\u65F6 \xB7 \u5B8C\u6574 Prompt\uFF08\u82F1\u6587\uFF09","expertEditor.defaultMessageEnPlaceholder":"Used as-is when user sends without typing","expertEditor.cancel":"\u53D6\u6D88","expertEditor.save":"\u4FDD\u5B58","expertEditor.saving":"\u4FDD\u5B58\u4E2D...","subAgentPanel.title":"\u5B50\u4EE3\u7406","subAgentPanel.back":"\u8FD4\u56DE\u5217\u8868","subAgentPanel.running":"\u8FD0\u884C\u4E2D","subAgentPanel.completed":"\u5DF2\u5B8C\u6210","subAgentPanel.waitingMessages":"\u7B49\u5F85\u6D88\u606F...","subAgentPanel.toolCount":"{count} \u4E2A\u5DE5\u5177","subAgentPanel.toolSummary":"\u5DF2\u5B8C\u6210 {count} \u6B21\u5DE5\u5177\u8C03\u7528","subAgentPanel.empty":"\u6682\u65E0\u5B50\u4EE3\u7406","subAgentPanel.emptyHint":"\u5F53 Claude \u59D4\u6D3E\u4EFB\u52A1\u65F6\uFF0C\u5B50\u4EE3\u7406\u4F1A\u5728\u8FD9\u91CC\u663E\u793A","splitScreen.split":"\u5206\u5C4F","splitScreen.closePane":"\u5173\u95ED\u6B64\u9762\u677F","splitScreen.newChat":"\u65B0\u5EFA Chat","splitScreen.noSessions":"\u6682\u65E0\u4F1A\u8BDD","splitScreen.splitToPanel":"\u5728\u65B0\u9762\u677F\u4E2D\u6253\u5F00","splitScreen.selectFromSidebar":"\u4ECE\u5DE6\u4FA7\u9009\u62E9\u5BF9\u8BDD","yeaft.vp.library":"\u89D2\u8272\u5E93","yeaft.vp.createFirst":"+ \u521B\u5EFA\u4F60\u7684\u7B2C\u4E00\u4E2A\u89D2\u8272","yeaft.vp.empty.aria":"\u5C1A\u65E0\u89D2\u8272","yeaft.vp.avatar.aria":"{name} \u5934\u50CF","yeaft.vp.speaker.stateCauseAria":"\u72B6\u6001\u53D8\u66F4\uFF1A{cause}","yeaft.vp.status.thinking":"\u6B63\u5728\u601D\u8003\u2026","yeaft.vp.status.tool":"\u6B63\u5728\u4F7F\u7528 {name}","yeaft.vp.status.done":"\u5B8C\u6210 \xB7 {count} \u4E2A\u5DE5\u5177","yeaft.vp.status.aborted":"\u5DF2\u4E2D\u6B62","yeaft.vp.crud.title":"\u89D2\u8272\u5E93","yeaft.vp.crud.close":"\u5173\u95ED","yeaft.vp.crud.addNew":"+ \u65B0\u5EFA\u89D2\u8272","yeaft.vp.crud.empty":"\u8FD8\u6CA1\u6709\u89D2\u8272\u3002\u521B\u5EFA\u7B2C\u4E00\u4E2A\u89D2\u8272\u5F00\u59CB\u534F\u4F5C\u5427\u3002","yeaft.vp.crud.edit":"\u7F16\u8F91","yeaft.vp.crud.delete":"\u5220\u9664","yeaft.vp.crud.deleteConfirm":'\u5220\u9664 "{name}"\uFF1F\u4F1A\u4E00\u5E76\u5220\u9664\u78C1\u76D8\u4E0A\u7684 role.md \u6587\u4EF6\u3002',"yeaft.vp.crud.form.create":"\u521B\u5EFA\u89D2\u8272","yeaft.vp.crud.form.update":"\u7F16\u8F91\u89D2\u8272","yeaft.vp.crud.form.vpId":"\u89D2\u8272 ID","yeaft.vp.crud.form.vpId.tooltip":"\u53EA\u80FD\u7528\u5B57\u6BCD\u3001\u6570\u5B57\u3001- \u548C _\uFF0C\u4E0D\u80FD\u4EE5 _ \u5F00\u5934\uFF0C\u4E0D\u80FD\u662F\u7EAF\u6570\u5B57\uFF0C\u4E0D\u80FD\u7528\u4FDD\u7559\u540D\uFF1Aall / user / system / everyone\u3002","yeaft.vp.crud.form.displayName":"\u663E\u793A\u540D\uFF08\u82F1\u6587\uFF09","yeaft.vp.crud.form.displayNameZh":"\u663E\u793A\u540D\uFF08\u4E2D\u6587\uFF09","yeaft.vp.crud.form.description":"\u80FD\u529B\u63CF\u8FF0\uFF08\u82F1\u6587\uFF09","yeaft.vp.crud.form.descriptionZh":"\u80FD\u529B\u63CF\u8FF0\uFF08\u4E2D\u6587\uFF09","yeaft.vp.crud.form.descriptionPlaceholder":"\u4F8B\u5982\uFF1AAPI design, migration planning, and compatibility reviews","yeaft.vp.crud.form.descriptionZhPlaceholder":"\u4F8B\u5982\uFF1AAPI \u8BBE\u8BA1\u3001\u8FC1\u79FB\u89C4\u5212\u4E0E\u517C\u5BB9\u6027\u8BC4\u5BA1","yeaft.vp.crud.form.role":"\u804C\u4F4D","yeaft.vp.crud.form.rolePlaceholder":"\u4F8B\u5982\uFF1A\u4EA7\u54C1\u7ECF\u7406","yeaft.vp.crud.form.traits":"\u7279\u8D28\u6807\u7B7E","yeaft.vp.crud.form.traitsHint":"\u7528\u82F1\u6587\u9017\u53F7\u5206\u9694\u7684\u77ED\u6807\u7B7E\uFF08\u4F8B\u5982\uFF1A\u597D\u5947, \u52A1\u5B9E\uFF09\u3002","yeaft.vp.crud.form.modelHint":"\u6A21\u578B\u504F\u597D","yeaft.vp.crud.form.modelHint.none":"\u2014 \u9ED8\u8BA4 \u2014","yeaft.vp.crud.form.modelHint.primary":"\u4E3B\u6A21\u578B","yeaft.vp.crud.form.modelHint.fast":"\u5FEB\u6A21\u578B","yeaft.vp.crud.form.persona":"\u4EBA\u8BBE\uFF08Markdown\uFF09","yeaft.vp.crud.form.personaPlaceholder":"\u63CF\u8FF0\u8FD9\u4E2A\u89D2\u8272\u5982\u4F55\u601D\u8003\u3001\u8868\u8FBE\u3001\u505A\u51B3\u7B56\u2026\u2026","yeaft.vp.crud.form.submit":"\u4FDD\u5B58","yeaft.vp.crud.form.cancel":"\u53D6\u6D88","yeaft.vp.crud.form.ok":"\u683C\u5F0F\u6B63\u786E","yeaft.vp.crud.form.idLocked":"\u521B\u5EFA\u540E\u89D2\u8272 ID \u4E0D\u53EF\u4FEE\u6539\u3002","yeaft.vp.crud.saving":"\u4FDD\u5B58\u4E2D\u2026\u2026","yeaft.vp.crud.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}","yeaft.vp.crud.deleteFailed":"\u5220\u9664\u5931\u8D25\uFF1A{error}","yeaft.vp.crud.viewPrompt":"\u67E5\u770B prompt","yeaft.vp.crud.view.title":"VP \u63D0\u793A\u8BCD","yeaft.vp.crud.view.personaEmpty":"\uFF08\u672A\u5B9A\u4E49 persona \u6B63\u6587\uFF0C\u53EA\u6709\u57FA\u7840\u5143\u6570\u636E\uFF09","yeaft.vp.crud.view.back":"\u8FD4\u56DE","yeaft.vp.crud.view.editFromHere":"\u7F16\u8F91\u8BE5 VP","yeaft.vp.crud.view.removed":"\u8BE5 VP \u5DF2\u5728\u522B\u5904\u88AB\u5220\u9664\uFF0C\u8FD4\u56DE\u5217\u8868\u3002","yeaft.vp.crud.stockBadge":"\u9884\u88C5","yeaft.vp.crud.stockReadOnly":"\u9884\u88C5 VP \u968F agent \u51FA\u5382\uFF0C\u4E0D\u80FD\u7F16\u8F91\u6216\u5220\u9664\u3002","yeaft.vp.idError.empty_or_non_string":"\u89D2\u8272 ID \u4E0D\u80FD\u4E3A\u7A7A\u3002","yeaft.vp.idError.too_long":"\u89D2\u8272 ID \u592A\u957F\uFF08\u6700\u591A 40 \u5B57\u7B26\uFF09\u3002","yeaft.vp.idError.illegal_character":'\u53EA\u80FD\u4F7F\u7528\u5B57\u6BCD\u3001\u6570\u5B57\u3001"-" \u548C "_"\u3002',"yeaft.vp.idError.underscore_prefix_reserved":'\u89D2\u8272 ID \u4E0D\u80FD\u4EE5 "_" \u5F00\u5934\uFF08\u9884\u7559\u7ED9\u7CFB\u7EDF\u89D2\u8272\uFF09\u3002',"yeaft.vp.idError.pure_digits":"\u89D2\u8272 ID \u4E0D\u80FD\u662F\u7EAF\u6570\u5B57\u3002","yeaft.vp.idError.reserved":"\u89D2\u8272 ID \u4E0D\u80FD\u7528\u4FDD\u7559\u540D\uFF08all / user / system / everyone\uFF09\u3002","yeaft.vp.idError.duplicate":"\u5DF2\u7ECF\u5B58\u5728\u540C ID \u7684\u89D2\u8272\u3002","yeaft.vp.idError.not_found":"\u8BE5 VP \u4E0D\u5B58\u5728\uFF0C\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u3002","yeaft.vp.idError.stock_readonly":"\u9884\u88C5 VP \u4E0D\u80FD\u7F16\u8F91\u6216\u5220\u9664\u3002","yeaft.vp.idError.unknown":"\u53D1\u751F\u672A\u77E5\u9519\u8BEF\uFF0C\u8BF7\u91CD\u8BD5\u3002","yeaft.vp.reason.personaEdit":"\u4EBA\u8BBE\u5DF2\u66F4\u65B0","yeaft.vp.reason.traitsEdit":"\u7279\u5F81\u5DF2\u66F4\u65B0","yeaft.vp.reason.manualReload":"\u5DF2\u91CD\u65B0\u8F7D\u5165","yeaft.vp.reason.fileRemoved":"\u5DF2\u79FB\u9664","yeaft.vp.reason.toast.updated":"{name}\uFF1A{reason}","yeaft.vp.reason.toast.removed":"{name} \u5DF2\u88AB\u79FB\u9664","yeaft.message.timeAria":"\u53D1\u9001\u4E8E {time}","yeaft.user.youLabel":"\u6211","yeaft.session.sidebarTitle":"\u4F1A\u8BDD","yeaft.session.sidebarAria":"\u4F1A\u8BDD\u5217\u8868","yeaft.session.newButton":"+ \u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.newButtonAria":"\u521B\u5EFA\u65B0\u4F1A\u8BDD","yeaft.session.empty":"\u6682\u65E0\u4F1A\u8BDD\u3002","yeaft.session.membersCount":"{count} \u4F4D\u6210\u5458","yeaft.session.oneMember":"1 \u4F4D\u6210\u5458","yeaft.session.noMembers":"\u7A7A\u4F1A\u8BDD \u2014 \u8BF7\u9080\u8BF7 VP","yeaft.session.defaultBadge":"\u9ED8\u8BA4","yeaft.session.defaultName":"\u9ED8\u8BA4\u4F1A\u8BDD","yeaft.session.moreActions":"\u66F4\u591A\u64CD\u4F5C","yeaft.session.archive":"\u5F52\u6863","yeaft.session.archiveConfirm":"\u5F52\u6863\u300C{name}\u300D\uFF1F\u7A0D\u540E\u53EF\u4ECE\u78C1\u76D8\u6062\u590D\u3002","yeaft.session.archivingEllipsis":"\u5F52\u6863\u4E2D\u2026","yeaft.session.delete":"\u5220\u9664","yeaft.session.deleteConfirm":"\u5220\u9664\u300C{name}\u300D\uFF1F\u5C06\u6C38\u4E45\u5220\u9664\u8BE5\u4F1A\u8BDD\u53CA\u5176\u6240\u6709\u6570\u636E\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002","yeaft.session.deletingEllipsis":"\u5220\u9664\u4E2D\u2026","yeaft.session.rename":"\u91CD\u547D\u540D","yeaft.session.openSettings":"\u8BBE\u7F6E","yeaft.session.removeFromList":"\u79FB\u9664","yeaft.session.manageMembers":"\u7BA1\u7406\u6210\u5458","yeaft.session.memberCount.one":"1 \u4F4D\u6210\u5458","yeaft.session.memberCount.other":"{count} \u4F4D\u6210\u5458","yeaft.session.renamePrompt":"\u4E3A\u300C{name}\u300D\u8F93\u5165\u65B0\u540D\u79F0\uFF1A","yeaft.session.renamingEllipsis":"\u91CD\u547D\u540D\u4E2D\u2026","yeaft.session.editModal.renameTitle":"\u91CD\u547D\u540D\u4F1A\u8BDD","yeaft.session.editModal.renameBody":"\u4E3A\u300C{name}\u300D\u9009\u62E9\u4E00\u4E2A\u65B0\u540D\u79F0\u3002","yeaft.session.editModal.renameSubmit":"\u4FDD\u5B58","yeaft.session.editModal.archiveTitle":"\u5F52\u6863\u4F1A\u8BDD","yeaft.session.editModal.archiveBody":"\u5F52\u6863\u300C{name}\u300D\uFF1F\u7A0D\u540E\u53EF\u4ECE\u78C1\u76D8\u6062\u590D\u3002","yeaft.session.editModal.archiveSubmit":"\u5F52\u6863","yeaft.session.editModal.deleteTitle":"\u5220\u9664\u4F1A\u8BDD","yeaft.session.editModal.deleteBody":"\u5220\u9664\u300C{name}\u300D\uFF1F\u5C06\u6C38\u4E45\u5220\u9664\u8BE5\u4F1A\u8BDD\u53CA\u5176\u6240\u6709\u6570\u636E\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002","yeaft.session.editModal.deleteSubmit":"\u5220\u9664","yeaft.session.editModal.newNameLabel":"\u65B0\u540D\u79F0","yeaft.session.editModal.cancel":"\u53D6\u6D88","yeaft.session.editModal.close":"\u5173\u95ED","yeaft.session.error.invalid_name":"\u4F1A\u8BDD\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\u3002","yeaft.session.error.duplicate":"\u8BE5\u4F1A\u8BDD id \u5DF2\u5B58\u5728\u3002","yeaft.session.error.not_found":"\u672A\u627E\u5230\u8BE5\u4F1A\u8BDD\u3002","yeaft.session.error.default_not_in_roster":"\u9ED8\u8BA4 VP \u5FC5\u987B\u5728\u6210\u5458\u5217\u8868\u4E2D\u3002","yeaft.session.error.no_default_vp":"\u8BE5\u4F1A\u8BDD\u6CA1\u6709\u6210\u5458\uFF0C\u8BF7\u4ECE\u89D2\u8272\u5E93\u6DFB\u52A0 VP \u4EE5\u5F00\u59CB\u5BF9\u8BDD\u3002","yeaft.session.error.reserved":"\u6240\u9009 id \u4E2D\u5305\u542B\u4FDD\u7559\u540D\uFF08all / user / system / everyone\uFF09\u3002","yeaft.session.error.unknown":"\u4F1A\u8BDD\u64CD\u4F5C\u5931\u8D25\uFF1A{message}","yeaft.session.error.timeout":"\u4F1A\u8BDD\u64CD\u4F5C\u8D85\u65F6\uFF0C\u8BF7\u91CD\u8BD5\u3002","yeaft.session.invite.title":"\u9080\u8BF7 VP","yeaft.session.invite.body":"\u300C{name}\u300D\u5F53\u524D\u4E3A\u7A7A\uFF0C\u8BF7\u4ECE\u89D2\u8272\u5E93\u6DFB\u52A0\u4E00\u4F4D VP \u4EE5\u5F00\u59CB\u5BF9\u8BDD\u3002","yeaft.session.invite.openLibrary":"\u6253\u5F00\u89D2\u8272\u5E93","yeaft.session.invite.dismiss":"\u6682\u4E0D","yeaft.session.empty.title":"\u7A7A\u4F1A\u8BDD","yeaft.session.empty.hint":"\u300C{name}\u300D\u8FD8\u6CA1\u6709\u6210\u5458\u3002\u6DFB\u52A0\u4E00\u4F4D VP \u5373\u53EF\u5F00\u59CB\u5BF9\u8BDD\u3002","yeaft.session.empty.cta":"\u7BA1\u7406\u6210\u5458","yeaft.session.members.title":"\u7BA1\u7406\u300C{name}\u300D\u7684\u6210\u5458","yeaft.session.members.aria":"\u6210\u5458\u7BA1\u7406","yeaft.session.members.close":"\u5173\u95ED","yeaft.session.members.done":"\u5B8C\u6210","yeaft.session.members.empty":"\u6682\u65E0\u53EF\u7528 VP \u2014 \u8BF7\u5148\u5230\u89D2\u8272\u5E93\u521B\u5EFA\u3002","yeaft.session.members.loading":"VP \u52A0\u8F7D\u4E2D\u2026","yeaft.session.members.defaultHint":"\u9ED8\u8BA4 VP\uFF08@\u63D0\u53CA\u7F3A\u7701\u65F6\u7531\u8BE5 VP \u5E94\u7B54\uFF09","yeaft.session.members.memberCount":"\u5DF2\u9009 {count} \u4F4D","yeaft.session.members.actionFailed":"\u64CD\u4F5C\u5931\u8D25\uFF1A{error}","yeaft.session.members.openLibrary":"\u6253\u5F00 VP \u5E93","yeaft.session.members.openLibraryHint":"\u5728 VP \u5E93\u53EF\u521B\u5EFA\u65B0 VP \u6216\u67E5\u770B VP \u7684 prompt\u3002","yeaft.session.announcement.label":"\u4F1A\u8BDD\u516C\u544A","yeaft.session.announcement.hintEmpty":"\u6682\u65E0\u516C\u544A \u2014 \u70B9\u51FB \u270F\uFE0F \u6DFB\u52A0\u3002","yeaft.session.announcement.emptyBody":"\u672A\u8BBE\u7F6E\u4F1A\u8BDD\u516C\u544A\u3002\u53EF\u4EE5\u5728\u8FD9\u91CC\u5199\u4E00\u6BB5\u7B80\u4ECB\uFF0C\u4F1A\u8BDD\u5185\u6240\u6709 VP \u5728\u6536\u5230\u6D88\u606F\u65F6\u90FD\u4F1A\u5728 system prompt \u9876\u90E8\u770B\u5230 \u2014 \u9002\u5408\u5199\u5171\u540C\u80CC\u666F\u3001\u89C4\u5219\u3001\u6216 CLAUDE.md \u5F0F\u7684\u6307\u5F15\u3002","yeaft.session.announcement.placeholder":"\u4E3A\u8FD9\u4E2A\u4F1A\u8BDD\u91CC\u7684\u6240\u6709 VP \u5199\u4E00\u6BB5\u5171\u4EAB\u7684\u7B80\u4ECB\u2026","yeaft.session.announcement.edit":"\u7F16\u8F91\u516C\u544A","yeaft.session.announcement.editTitle":"\u7F16\u8F91\u4F1A\u8BDD\u516C\u544A","yeaft.session.announcement.saving":"\u4FDD\u5B58\u4E2D\u2026","yeaft.session.announcement.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}","yeaft.session.announcement.openSettings":"\u6253\u5F00\u4F1A\u8BDD\u8BBE\u7F6E","yeaft.session.settings.title":"{name} \u2014 \u4F1A\u8BDD\u8BBE\u7F6E","yeaft.session.settings.short":"\u4F1A\u8BDD","yeaft.session.settings.close":"\u5173\u95ED","yeaft.session.settings.nav.session":"\u4F1A\u8BDD","yeaft.session.settings.nav.members":"\u6210\u5458","yeaft.session.settings.nav.memory":"\u4F1A\u8BDD\u8BB0\u5FC6","yeaft.session.settings.announcement.heading":"\u4F1A\u8BDD\u516C\u544A","yeaft.session.settings.announcement.help":"\u6CE8\u5165\u5230\u4F1A\u8BDD\u5185\u6BCF\u4E2A VP \u7684 system prompt \u9876\u90E8 \u2014 \u7C7B\u4F3C\u56E2\u961F\u5171\u4EAB\u7684 CLAUDE.md\u3002","yeaft.session.settings.members.heading":"\u6210\u5458","yeaft.session.settings.rename.heading":"\u91CD\u547D\u540D\u4F1A\u8BDD","yeaft.session.settings.rename.label":"\u65B0\u540D\u79F0","yeaft.session.settings.rename.save":"\u4FDD\u5B58\u540D\u79F0","yeaft.session.settings.rename.saving":"\u4FDD\u5B58\u4E2D\u2026","yeaft.session.settings.memory.heading":"\u4F1A\u8BDD\u8BB0\u5FC6","yeaft.session.settings.memory.help":"\u7ACB\u5373\u8FD0\u884C dream \u6574\u7406\uFF1A\u8BFB\u53D6\u4E0A\u6B21\u4EE5\u6765\u7684\u65B0\u6D88\u606F\uFF0C\u63D0\u53D6\u8981\u70B9\u5E76\u5408\u5E76\u8FDB\u4F1A\u8BDD\u7684 summary\uFF0C\u8BA9 Resident \u5C42\u80FD\u53CD\u6620\u6700\u65B0\u7684\u5BF9\u8BDD\u3002","yeaft.session.settings.memory.runNow":"\u7ACB\u5373\u8FD0\u884C dream","yeaft.session.settings.memory.running":"\u8FD0\u884C\u4E2D\u2026","yeaft.session.settings.memory.lastSuccess":"\u4E0A\u6B21\u6210\u529F\uFF1A{time} \u2014 \u66F4\u65B0\u4E86 {count} \u4E2A\u76EE\u6807\u3002","yeaft.session.settings.memory.lastError":"\u4E0A\u6B21\u8FD0\u884C\u5931\u8D25\uFF1A{error}","yeaft.session.settings.danger.heading":"\u5220\u9664\u4F1A\u8BDD","yeaft.session.settings.danger.deleteHelp":"\u8FD9\u4F1A\u6C38\u4E45\u5220\u9664\u8BE5\u4F1A\u8BDD\uFF0C\u79FB\u9664\u78C1\u76D8\u4E0A\u7684 session.json \u548C\u5168\u90E8\u6D88\u606F\u5386\u53F2\uFF0C\u4E0D\u53EF\u6062\u590D\u3002","yeaft.session.settings.danger.deleteBtn":"\u5220\u9664\u4F1A\u8BDD","yeaft.vp.mention.placeholder":"\u6309 id \u6216\u540D\u79F0\u641C\u7D22\u89D2\u8272\u2026","yeaft.vp.mention.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u89D2\u8272","yeaft.vp.mention.count":"\u5DF2 @{count} \u4EBA","yeaft.feature.reject.missing_group_id":"\u53D1\u9001\u5931\u8D25\uFF1A\u672A\u6307\u5B9A\u4F1A\u8BDD\u3002","yeaft.feature.reject.missing_feature_id":"\u53D1\u9001\u5931\u8D25\uFF1A\u4EFB\u52A1\u4E0A\u4E0B\u6587\u4E22\u5931\u3002","yeaft.feature.reject.missing_vp_id":"\u53D1\u9001\u5931\u8D25\uFF1A\u672A\u8BBE\u7F6E\u53D1\u8A00\u8005\u3002","yeaft.feature.reject.invalid_vp_id":"\u53D1\u9001\u5931\u8D25\uFF1A\u53D1\u8A00\u8005 id \u975E\u6CD5\u3002","yeaft.feature.reject.empty_text":"\u53D1\u9001\u5931\u8D25\uFF1A\u5185\u5BB9\u4E3A\u7A7A\u3002","yeaft.feature.reject.text_too_long":"\u53D1\u9001\u5931\u8D25\uFF1A\u5185\u5BB9\u8FC7\u957F\uFF08\u4E0A\u9650 16 KiB\uFF09\u3002","yeaft.feature.reject.unknown":"\u53D1\u9001\u5931\u8D25\u3002","yeaft.feature.pill.label":"\u4EFB\u52A1","yeaft.feature.messageTime.aria":"\u53D1\u9001\u4E8E {time}","yeaft.vp.turnBlock.elapsedTitle":"\u672C\u8F6E turn \u5F00\u59CB\u81F3\u4ECA\u7684\u65F6\u95F4","yeaft.vp.turnBlock.retryingRequest":"\u54CD\u5E94\u505C\u6EDE\uFF0C\u6B63\u5728\u53D1\u8D77\u5168\u65B0\u8BF7\u6C42\uFF08{attempt}/{max}\uFF09","yeaft.vp.turnBlock.retryingContinue":"\u54CD\u5E94\u505C\u6EDE\uFF0C\u6B63\u5728\u7528\u5168\u65B0\u8BF7\u6C42\u7EED\u5199\uFF08{attempt}/{max}\uFF09","yeaft.sessionStatus.aria":"Session \u72B6\u6001","yeaft.sessionStatus.title":"Session \u72B6\u6001","yeaft.sessionStatus.announcement":"\u516C\u544A","yeaft.sessionStatus.announcementEmpty":"\u6682\u65E0\u516C\u544A","yeaft.sessionStatus.announcementAdd":"\u6DFB\u52A0\u516C\u544A","yeaft.sessionStatus.announcementEdit":"\u7F16\u8F91\u516C\u544A","yeaft.sessionStatus.vps":"VP","yeaft.sessionStatus.backgroundTasks":"\u540E\u53F0\u4EFB\u52A1","yeaft.sessionStatus.noLogPreview":"\u6682\u65E0\u65E5\u5FD7\u8F93\u51FA\u3002","yeaft.sessionStatus.task.subAgentStarted":"{name} \u5DF2\u542F\u52A8","yeaft.sessionStatus.task.subAgentStartedWithMission":"{name} \u5DF2\u542F\u52A8\uFF1A{mission}","yeaft.sessionStatus.task.subAgentStatus":"{name} \u72B6\u6001\uFF1A{status}","yeaft.sessionStatus.task.subAgentStatusUpdated":"{name} \u72B6\u6001\u5DF2\u66F4\u65B0","yeaft.sessionStatus.task.subAgentResult":"{name} \u7ED3\u679C\uFF1A{text}","yeaft.sessionStatus.task.subAgentProducedResult":"{name} \u5DF2\u4EA7\u751F\u7ED3\u679C","yeaft.sessionStatus.task.subAgentUsedTool":"{name} \u8C03\u7528\u4E86 {tool}","yeaft.sessionStatus.task.subAgentFinishedTool":"{name} \u5B8C\u6210\u4E86 {tool}","yeaft.sessionStatus.task.subAgentUsage":"{name} \u4F7F\u7528\u4E86 {tokens} tokens","yeaft.sessionStatus.task.subAgentEvent":"{name}\uFF1A{text}","yeaft.sessionStatus.task.subAgentUserPrompt":"\u4F60\uFF1A{text}","yeaft.sessionStatus.task.subAgentToolSummary":"\u5DF2\u5B8C\u6210 {count} \u6B21\u5DE5\u5177\u8C03\u7528","yeaft.sessionStatus.task.subAgentError":"{name} \u9519\u8BEF\uFF1A{error}","yeaft.sessionStatus.task.subAgentHitError":"{name} \u9047\u5230\u9519\u8BEF","yeaft.sessionStatus.task.subAgentNoReadableEvents":"\u6682\u65E0\u53EF\u8BFB\u7684 sub-agent \u6D3B\u52A8\u3002","yeaft.sessionStatus.task.promptPlaceholder":"\u7ED9\u8FD9\u4E2A sub-agent \u8FFD\u52A0\u60F3\u6CD5\u2026","yeaft.sessionStatus.task.promptSend":"\u53D1\u9001","yeaft.sessionStatus.task.promptSending":"\u53D1\u9001\u4E2D\u2026","yeaft.sessionStatus.task.promptFailed":"\u53D1\u9001\u5931\u8D25\u3002","yeaft.sessionStatus.task.title":"\u4EFB\u52A1","yeaft.sessionStatus.task.command":"\u547D\u4EE4","yeaft.sessionStatus.task.stop":"\u505C\u6B62\u4EFB\u52A1","yeaft.sessionStatus.task.stopping":"\u505C\u6B62\u4E2D\u2026","yeaft.sessionStatus.task.kind.subAgent":"sub-agent","yeaft.sessionStatus.task.kind.shell":"shell","yeaft.sessionStatus.show":"\u663E\u793A Session \u72B6\u6001","yeaft.sessionStatus.hide":"\u9690\u85CF Session \u72B6\u6001","yeaft.sessionStatus.close":"\u5173\u95ED Session \u72B6\u6001","yeaft.vpTimeline.empty":"\u672C Session \u8FD8\u6CA1\u6709 VP\u3002","yeaft.vpTimeline.resizeTitle":"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6","yeaft.vpTimeline.status.idle":"\u7A7A\u95F2","yeaft.vpTimeline.status.typing":"\u8F93\u5165\u4E2D\u2026","yeaft.vpTimeline.status.thinking":"\u601D\u8003\u4E2D\u2026","yeaft.vpTimeline.status.retrying":"\u6B63\u5728\u91CD\u8BD5\u8BF7\u6C42\u2026","yeaft.vpTimeline.status.streaming":"\u751F\u6210\u4E2D","yeaft.vpTimeline.status.tool":"\u8C03\u7528\u5DE5\u5177\u4E2D\u2026","yeaft.vpTimeline.status.error":"\u51FA\u9519","yeaft.vpTimeline.status.offline":"\u79BB\u7EBF","yeaft.vpTimeline.abort":"\u4E2D\u6B62","yeaft.vpTimeline.edit":"\u7F16\u8F91 VP","yeaft.vpTimeline.mention":"\u70B9\u51FB @ \u8BE5 VP","yeaft.vpTimeline.expand":"\u5C55\u5F00\u4EFB\u52A1\u8BE6\u60C5","yeaft.toolStats.title":"\u5DE5\u5177\u4F7F\u7528\u7EDF\u8BA1","yeaft.toolStats.refresh":"\u5237\u65B0","yeaft.toolStats.close":"\u5173\u95ED","yeaft.toolStats.tabAll":"\u5168\u90E8\u5DE5\u5177","yeaft.toolStats.tabUnused":"\u672A\u4F7F\u7528","yeaft.toolStats.loading":"\u52A0\u8F7D\u4E2D\u2026","yeaft.toolStats.notLoaded":"\u6682\u65E0\u6570\u636E \u2014 \u70B9\u51FB\u5237\u65B0\u3002","yeaft.toolStats.empty":"\uFF08\u6682\u65E0\u5DE5\u5177\u8C03\u7528\u8BB0\u5F55\uFF09","yeaft.toolStats.noneUnused":"\uFF08\u6BCF\u4E2A\u5DF2\u6CE8\u518C\u5DE5\u5177\u90FD\u81F3\u5C11\u88AB\u8C03\u7528\u8FC7\u4E00\u6B21\uFF09","yeaft.toolStats.fetchedAt":"\u83B7\u53D6\u65F6\u95F4","yeaft.toolStats.col.name":"\u5DE5\u5177","yeaft.toolStats.col.calls":"\u8C03\u7528","yeaft.toolStats.col.errors":"\u9519\u8BEF","yeaft.toolStats.col.errRate":"\u9519\u8BEF\u7387","yeaft.toolStats.col.p50":"p50","yeaft.toolStats.col.p95":"p95","yeaft.toolStats.col.avg":"\u5E73\u5747","yeaft.toolStats.col.last":"\u6700\u8FD1","yeaft.toolStats.buttonLabel":"\u5DE5\u5177\u7EDF\u8BA1","workCenter.title":"\u5DE5\u4F5C\u4E2D\u5FC3","workCenter.subtitle":"\u7531\u5F53\u524D Agent \u6301\u7EED\u63A8\u8FDB\u7684\u6301\u4E45\u5DE5\u4F5C","workCenter.agent":"Agent","workCenter.selectAgent":"\u9009\u62E9 Agent","workCenter.noOnlineAgents":"\u6CA1\u6709\u5728\u7EBF Agent","workCenter.noAvailableAgents":"\u6CA1\u6709\u517C\u5BB9\u5DE5\u4F5C\u4E2D\u5FC3\u7684\u5728\u7EBF Agent","workCenter.new":"\u65B0\u5EFA","workCenter.newWorkItem":"\u65B0\u5EFA\u5DE5\u4F5C\u9879","workCenter.workItem":"\u5DE5\u4F5C\u9879","workCenter.createFirst":"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u5DE5\u4F5C\u9879","workCenter.backToChat":"\u8FD4\u56DE\u5BF9\u8BDD","workCenter.refresh":"\u5237\u65B0","workCenter.search":"\u641C\u7D22\u5DE5\u4F5C\u9879","workCenter.filter":"\u7B5B\u9009","workCenter.filterAttention":"\u9700\u8981\u5904\u7406","workCenter.filterActive":"\u6267\u884C\u4E2D","workCenter.filterAll":"\u5168\u90E8","workCenter.filterDone":"\u5DF2\u5B8C\u6210","workCenter.attentionItems":"\u9700\u8981\u5904\u7406","workCenter.board.active":"\u8FDB\u884C\u4E2D","workCenter.board.needsAttention":"\u9700\u8981\u5904\u7406","workCenter.board.closed":"\u5DF2\u5173\u95ED","workCenter.board.emptyLane":"\u6682\u65E0\u5DE5\u4F5C\u9879","workCenter.board.lanes":"\u5DE5\u4F5C\u9879\u5206\u680F","workCenter.filterVp":"\u6309 VP \u7B5B\u9009","workCenter.filterType":"\u6309\u7C7B\u578B\u7B5B\u9009","workCenter.filterUpdated":"\u6309\u66F4\u65B0\u65F6\u95F4\u7B5B\u9009","workCenter.allVps":"\u5168\u90E8 VP","workCenter.allTypes":"\u5168\u90E8\u7C7B\u578B","workCenter.anyTime":"\u4E0D\u9650\u65F6\u95F4","workCenter.lastDay":"\u6700\u8FD1 24 \u5C0F\u65F6","workCenter.lastWeek":"\u6700\u8FD1 7 \u5929","workCenter.deleteWorkItem":"\u5220\u9664 Work Item","workCenter.deleteConfirm":"\u6C38\u4E45\u5220\u9664\u8FD9\u4E2A Work Item\u3001\u6267\u884C\u5386\u53F2\u548C\u9644\u4EF6\uFF1F","workCenter.deleteRequiresStop":"\u8BF7\u5148\u505C\u6B62\u8FD9\u4E2A Work Item \u518D\u5220\u9664","workCenter.lastMonth":"\u6700\u8FD1 30 \u5929","workCenter.assignment.planned":"\u8BA1\u5212\u5206\u914D","workCenter.created":"\u521B\u5EFA\u4E8E","workCenter.files":"\u4E2A\u6587\u4EF6","workCenter.loadMore":"\u52A0\u8F7D\u66F4\u591A","workCenter.activeItems":"\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C","workCenter.allItems":"\u5168\u90E8\u5DE5\u4F5C\u9879","workCenter.completedItems":"\u5DF2\u5B8C\u6210","workCenter.watcherActive":"Watcher \u8FD0\u884C\u4E2D","workCenter.loading":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u4F5C\u9879\u2026","workCenter.noTimestamp":"\u65E0\u65F6\u95F4\u6233","workCenter.updated":"\u66F4\u65B0\u65F6\u95F4","workCenter.emptyTitle":"\u8FD8\u6CA1\u6709\u5DE5\u4F5C\u9879","workCenter.emptyBody":"\u5F53\u5DE5\u4F5C\u9700\u8981\u8DE8\u8D8A\u4E00\u6B21\u5BF9\u8BDD\u3001\u7B49\u5F85\u6216\u89D2\u8272\u63A5\u529B\u65F6\uFF0C\u628A\u5B83\u521B\u5EFA\u4E3A\u6301\u4E45\u5DE5\u4F5C\u9879\u3002","workCenter.noAttentionTitle":"\u5F53\u524D\u6CA1\u6709\u9700\u8981\u5904\u7406\u7684\u5DE5\u4F5C\u9879","workCenter.noAttentionBody":"\u7B49\u5F85\u4F60\u56DE\u7B54\u6216\u9700\u8981\u6062\u590D\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noActiveTitle":"\u5F53\u524D\u6CA1\u6709\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C\u9879","workCenter.noActiveBody":"\u8349\u7A3F\u3001\u5C31\u7EEA\u548C\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noCompletedTitle":"\u8FD8\u6CA1\u6709\u5DF2\u5B8C\u6210\u7684\u5DE5\u4F5C\u9879","workCenter.noCompletedBody":"\u5B8C\u6210\u540E\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noMatchesTitle":"\u6CA1\u6709\u5339\u914D\u7684\u5DE5\u4F5C\u9879","workCenter.noMatchesBody":"\u5C1D\u8BD5\u8C03\u6574\u641C\u7D22\u5185\u5BB9\u6216\u7B5B\u9009\u6761\u4EF6\u3002","workCenter.selectTitle":"\u5DE5\u4F5C\u9879\u8BE6\u60C5","workCenter.detailLoading":"\u6B63\u5728\u52A0\u8F7D\u5B8C\u6574\u8BE6\u60C5\u2026","workCenter.detailLoadFailed":"\u65E0\u6CD5\u52A0\u8F7D\u5B8C\u6574\u8BE6\u60C5","workCenter.start":"\u5F00\u59CB","workCenter.retry":"\u91CD\u8BD5","workCenter.cancel":"\u53D6\u6D88","workCenter.closeWorkItem":"\u5173\u95ED\u8BE6\u60C5","workCenter.cancelWorkItem":"\u505C\u6B62\u5DE5\u4F5C\u9879","workCenter.cancelWorkItemHint":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u6240\u6709\u5C1A\u672A\u5B8C\u6210\u7684 Actions\u3002","workCenter.cancelConfirm":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u5176\u5C1A\u672A\u5B8C\u6210\u7684 Actions\uFF1F","workCenter.stopWorkItem":"\u505C\u6B62\u5DE5\u4F5C\u9879","workCenter.resumeWorkItem":"\u6062\u590D\u5DE5\u4F5C\u9879","workCenter.breadcrumbs":"Work Center \u5BFC\u822A","workCenter.actionNumber":"Action {number}","workCenter.actionBreadcrumb":"Action {number}\uFF1A{description}","workCenter.untitledAction":"\u672A\u547D\u540D Action","workCenter.workItems":"\u5DE5\u4F5C\u9879","workCenter.description":"\u9700\u6C42\u63CF\u8FF0","workCenter.goal":"\u76EE\u6807","workCenter.acceptanceCriteria":"\u9A8C\u6536\u6761\u4EF6","workCenter.noCriteria":"\u672A\u63D0\u4F9B\u9A8C\u6536\u6761\u4EF6","workCenter.failureReason":"\u5931\u8D25\u539F\u56E0","workCenter.workflow":"\u4EFB\u52A1\u6D41","workCenter.triageSummary":"Triage \u6458\u8981","workCenter.actionFlow":"Action \u6D41\u7A0B","workCenter.viewActions":"\u67E5\u770B Actions","workCenter.actionsPanel":"Actions","workCenter.closeActions":"\u5173\u95ED Actions","workCenter.actionCount":"{count} \u4E2A Action","workCenter.noActionSummary":"\u6682\u65E0\u6458\u8981","workCenter.actionProgress":"{completed} / {total} \u4E2A Action","workCenter.currentAction":"\u5F53\u524D Action","workCenter.expandActions":"\u5C55\u5F00 Action","workCenter.collapseActions":"\u6536\u8D77","workCenter.actionObjective":"\u8FD9\u6B21\u8981\u505A\u4EC0\u4E48","workCenter.actionApproach":"\u51C6\u5907\u600E\u4E48\u505A","workCenter.actionExpectedOutcome":"\u671F\u5F85\u7684\u7ED3\u679C","workCenter.dependencies":"\u4F9D\u8D56\u9879","workCenter.actionResult":"\u6700\u65B0\u7ED3\u679C","workCenter.currentProgress":"\u5F53\u524D\u8FDB\u5EA6","workCenter.actionMessages":"\u6D88\u606F","workCenter.loops":"\u4E2A Loop","workCenter.tools":"\u6B21\u5DE5\u5177\u8C03\u7528","workCenter.noActionMessages":"\u8FD8\u6CA1\u6709\u6D88\u606F\u3002","workCenter.actionDetails":"Action \u8BE6\u60C5","workCenter.selectAction":"\u9009\u62E9\u4E00\u4E2A Action","workCenter.backToWorkItems":"\u5DE5\u4F5C\u9879","workCenter.backToActions":"\u8FD4\u56DE Actions","workCenter.you":"\u4F60","workCenter.noRequestDetails":"\u8FD9\u4E2A Action \u6682\u65F6\u6CA1\u6709\u53EF\u7528\u7684\u6267\u884C\u8BB0\u5F55\u3002","workCenter.loadingRequests":"\u6B63\u5728\u52A0\u8F7D\u6267\u884C\u8BB0\u5F55\u2026","workCenter.loadingRequestDetail":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u5177\u8BC1\u636E\u2026","workCenter.requestDetailUnavailable":"\u5DE5\u5177\u8BC1\u636E\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u8BD5\u3002","workCenter.noRequestLoops":"\u8FD9\u6B21\u6267\u884C\u6CA1\u6709\u4FDD\u7559\u4E0B\u53EF\u5C55\u793A\u7684 Loop\u3002","workCenter.requestDetailTruncated":"\u6267\u884C\u5185\u5BB9\u8F83\u5927\uFF1A{summarized} \u4E2A Loop \u663E\u793A\u6458\u8981\uFF0C\u53E6\u6709 {omitted} \u4E2A\u8F83\u65E9 Loop \u672A\u663E\u793A\u3002","workCenter.loopDetailTruncated":"\u8FD9\u4E2A Loop \u5185\u5BB9\u8F83\u5927\uFF0C\u5F53\u524D\u663E\u793A\u4FDD\u7559\u4E0B\u6765\u7684\u5DE5\u5177\u8BC1\u636E\u3002","workCenter.loadEarlierMessages":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","workCenter.loadingEarlierMessages":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","workCenter.unknownModel":"\u672A\u77E5\u6A21\u578B","workCenter.loop":"Loop","workCenter.actionBrief":"\u4EFB\u52A1\u8BF4\u660E","workCenter.executionSummary":"\u6267\u884C\u6458\u8981","workCenter.toolParameters":"\u8C03\u7528\u53C2\u6570","workCenter.toolResult":"\u6267\u884C\u7ED3\u679C","workCenter.noToolCalls":"\u8FD9\u4E2A Loop \u6CA1\u6709\u5DE5\u5177\u8C03\u7528\u3002","workCenter.actionInputPlaceholder":"\u8865\u5145\u4E0A\u4E0B\u6587\u3001\u56DE\u7B54\u95EE\u9898\u6216\u8C03\u6574\u8FD9\u4E2A Action","workCenter.actionInputResumeHint":"\u4F60\u7684\u8F93\u5165\u4F1A\u5E26\u7740\u65B0\u589E\u4E0A\u4E0B\u6587\u7EE7\u7EED\u8FD9\u4E2A Action\u3002","workCenter.waitingQuestionTitle":"\u9700\u8981\u4F60\u7684\u56DE\u7B54","workCenter.actionInputRetryHint":"\u8865\u5145\u4FEE\u6B63\u8BF4\u660E\u6216\u6587\u4EF6\u540E\uFF0C\u4F7F\u7528\u65B0\u4E0A\u4E0B\u6587\u91CD\u65B0\u6267\u884C\u8FD9\u4E2A Action\u3002","workCenter.actionInputContinueHint":"\u8FD9\u91CC\u53EA\u76F4\u63A5\u5E72\u9884\u5F53\u524D Action\u3002","workCenter.actionFailedTitle":"\u8FD9\u4E2A Action \u4E3A\u4EC0\u4E48\u5931\u8D25","workCenter.failedAt":"\u5931\u8D25\u65F6\u95F4","workCenter.actionFailureRecovery":"\u5728\u5DE5\u4F5C\u9879\u8F93\u5165\u6846\u4E2D\u9009\u62E9\u6B64 Action\uFF0C\u518D\u53D1\u9001\u4FEE\u6B63\u8BF4\u660E\u3002","workCenter.sendInput":"\u53D1\u9001\u7ED9 Action","workCenter.sendingInput":"\u6B63\u5728\u53D1\u9001\u2026","workCenter.retryAction":"\u91CD\u8BD5 Action","workCenter.sendAndRetryAction":"\u53D1\u9001\u5E76\u91CD\u8BD5 Action","workCenter.coordinatorDecision.guide_actions":"\u5DF2\u66F4\u65B0 Action \u6307\u4EE4","workCenter.coordinatorDecision.replan":"\u5DF2\u66F4\u65B0\u76EE\u6807\u6216\u8BA1\u5212","workCenter.coordinatorDecision.request_human":"\u9700\u8981\u4EBA\u5DE5\u8865\u5145\u4FE1\u606F","workCenter.conversation":"\u5BF9\u8BDD","workCenter.contentPane":"\u5185\u5BB9","workCenter.workItemPanes":"\u5DE5\u4F5C\u9879\u9762\u677F","workCenter.coordinator":"\u534F\u8C03\u8005","workCenter.coordinatorTargetHint":"\u5DE5\u4F5C\u9879\u89C4\u5212\u4E0E\u534F\u8C03","workCenter.composerTarget":"\u6D88\u606F\u76EE\u6807","workCenter.targetUnavailable":"\u6240\u9009 Action \u5DF2\u4E0D\u53EF\u7528","workCenter.targetUnavailableHelp":"\u53D1\u9001\u524D\u8BF7\u9009\u62E9\u5176\u4ED6\u76EE\u6807\uFF1B\u7CFB\u7EDF\u6CA1\u6709\u91CD\u5B9A\u5411\u8FD9\u4EFD\u8349\u7A3F\u3002","workCenter.sendToCoordinatorInstead":"\u6539\u53D1\u7ED9 Coordinator","workCenter.sendToTarget":"\u53D1\u9001\u7ED9 {target}","workCenter.answerWithTarget":"\u5728\u5BF9\u8BDD\u8F93\u5165\u6846\u4E2D\u9009\u62E9\u76F8\u5173\u76EE\u6807\uFF0C\u7136\u540E\u56DE\u590D\u3002","workCenter.conversationThinking":"\u5904\u7406\u4E2D\u2026","workCenter.conversationReadOnly":"\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u5DF2\u5173\u95ED\uFF0C\u5BF9\u8BDD\u8BB0\u5F55\u4ECD\u53EF\u67E5\u770B\u3002","workCenter.conversationPlaceholder":"\u7EE7\u7EED\u8BA8\u8BBA\u8FD9\u4E2A\u5DE5\u4F5C\u9879","workCenter.sendMessage":"\u53D1\u9001\u6D88\u606F","workCenter.messageSpeakerRole":"{name} \xB7 {role}","workCenter.originalRequest":"\u539F\u59CB\u9700\u6C42","workCenter.actionMessageScopeTitle":"\u7ED9\u8FD9\u4E2A Action \u53D1\u6D88\u606F","workCenter.actionMessageScope":"\u6D88\u606F\u53EA\u53D1\u9001\u7ED9\u5F53\u524D Action\u3002","workCenter.actionConversation":"\u5BF9\u8BDD","workCenter.actionConversationWith":"Action \u6267\u884C\u8005","workCenter.actionViews":"Action \u89C6\u56FE","workCenter.actionExecutor":"\u6267\u884C\u8005","workCenter.actionExecutorPending":"\u7B49\u5F85\u5206\u914D\u6267\u884C\u8005","workCenter.actionInformation":"Action \u4FE1\u606F","workCenter.messageExecutor":"\u7ED9 {name} \u53D1\u6D88\u606F","workCenter.actionChatPlaceholder":"\u5728\u5BF9\u8BDD\u8F93\u5165\u6846\u4E2D\u7ED9 {name} \u53D1\u6D88\u606F","workCenter.statusLabel":"\u72B6\u6001","workCenter.llmRequestsLabel":"LLM \u8BF7\u6C42","workCenter.loopsLabel":"Loops","workCenter.toolsLabel":"\u5DE5\u5177","workCenter.tokensLabel":"Tokens","workCenter.workItemMessagePlaceholder":"\u8865\u5145\u6574\u4E2A Work Item \u7684\u65B9\u5411\u6216\u7EA6\u675F","workCenter.sendWorkItemMessage":"\u53D1\u9001\u7ED9 Work Item","workCenter.fromSession":"\u4ECE\u5F53\u524D Session \u521B\u5EFA\u5DE5\u4F5C\u9879","workCenter.llmRequestCount":"{count} \u6B21 LLM \u8BF7\u6C42","workCenter.loopCount":"{count} \u6B21 Loop","workCenter.toolCount":"{count} \u4E2A\u5DE5\u5177","workCenter.tokenCount":"{count} tokens","workCenter.tokenBreakdown":"\u8F93\u5165 {input} / \u8F93\u51FA {output} / \u7F13\u5B58 {cache}","workCenter.guidance":"\u7ED9\u5F53\u524D Action \u8865\u5145\u63D0\u793A","workCenter.guidanceHint":"\u8865\u5145\u7EA6\u675F\uFF0C\u6216\u8C03\u6574\u5F53\u524D Action \u7684\u6267\u884C\u65B9\u5411","workCenter.guidanceRestartHint":"\u53D1\u9001\u540E\u4F1A\u4F7F\u7528\u65B0\u63D0\u793A\u91CD\u542F\u5F53\u524D Action\u3002","workCenter.sendGuidance":"\u53D1\u9001\u63D0\u793A","workCenter.reuseMemory":"\u4F7F\u7528\u76F8\u5173 Agent memory \u548C\u6B64\u9879\u76EE\u7684\u5DF2\u5B8C\u6210\u5DE5\u4F5C","workCenter.reuseMemoryHelp":"\u5305\u62EC\u53D7 scope \u7EA6\u675F\u7684 Agent memory\uFF0C\u4EE5\u53CA canonical \u9879\u76EE\u76EE\u5F55\u76F8\u540C\u7684\u5DF2\u5B8C\u6210 Work Item \u7ED3\u6784\u5316\u6458\u8981\u548C\u8BC1\u636E\uFF1B\u4E0D\u4F1A\u590D\u7528\u539F\u59CB\u5DE5\u5177\u8F93\u51FA\u3002","workCenter.resumeAnswer":"\u56DE\u7B54\u7B49\u5F85\u4E2D\u7684\u95EE\u9898","workCenter.resumeAnswerHint":"\u63D0\u4F9B\u7EE7\u7EED\u6267\u884C\u6240\u9700\u7684\u4FE1\u606F","workCenter.answerInActionDetail":"\u5728\u5BF9\u8BDD\u8F93\u5165\u6846\u4E2D\u5C06\u76EE\u6807\u8BBE\u4E3A\u5F53\u524D Action\uFF0C\u7136\u540E\u56DE\u590D\u3002","workCenter.selectPrompt":"\u9009\u62E9\u4E00\u4E2A\u5DE5\u4F5C\u9879\uFF0C\u67E5\u770B\u5B83\u7684\u6D41\u7A0B\u3002","workCenter.createHint":"\u63CF\u8FF0\u4F60\u9700\u8981\u4EC0\u4E48\uFF0CTriage \u4F1A\u751F\u6210\u76EE\u6807\u3001\u9A8C\u6536\u6761\u4EF6\u548C Actions\u3002","workCenter.requirement":"\u9700\u6C42","workCenter.requirementHint":"\u7528\u81EA\u7136\u8BED\u8A00\u63CF\u8FF0\u95EE\u9898\u3001\u671F\u671B\u7ED3\u679C\u548C\u5FC5\u8981\u7EA6\u675F","workCenter.requirementHelp":"Triage \u4F1A\u751F\u6210\u6807\u9898\u3001\u76EE\u6807\u3001\u9A8C\u6536\u6761\u4EF6\u3001\u7C7B\u578B\u548C\u6267\u884C\u8BA1\u5212\u3002","workCenter.titleField":"\u6807\u9898","workCenter.titleHint":"\u7B80\u77ED\u3001\u660E\u786E\u5730\u63CF\u8FF0\u9884\u671F\u7ED3\u679C","workCenter.goalHint":"\u8BF4\u660E Agent \u5FC5\u987B\u4EA4\u4ED8\u7684\u6700\u7EC8\u7ED3\u679C","workCenter.criteriaHint":"\u6BCF\u884C\u4E00\u6761\u9A8C\u6536\u6761\u4EF6","workCenter.attachments":"\u9644\u4EF6","workCenter.attachmentsHelp":"\u56FE\u7247\u3001PDF \u548C\u6587\u672C\u6587\u4EF6\u4F1A\u6301\u7EED\u7ED1\u5B9A\u5230\u6B64 Work Item\uFF0C\u5E76\u63D0\u4F9B\u7ED9\u6BCF\u4E2A Action\u3002","workCenter.attachmentsUnsupported":"\u6240\u9009 Agent \u4E0D\u652F\u6301 Work Item \u9644\u4EF6\u3002","workCenter.addAttachments":"\u6DFB\u52A0\u6587\u4EF6","workCenter.attachmentsUploading":"\u4E0A\u4F20\u4E2D\u2026","workCenter.attachmentsUploadFailed":"\u9644\u4EF6\u4E0A\u4F20\u5931\u8D25","workCenter.pendingEnvelopeLocked":"\u6709\u4E00\u6761\u672A\u786E\u8BA4\u8BF7\u6C42\u5DF2\u9501\u5B9A\u5230\u539F\u59CB\u8EAB\u4EFD\u3002","workCenter.replacePendingAttachments":"\u66FF\u6362\u9644\u4EF6","workCenter.discardPendingEnvelope":"\u653E\u5F03\u5F85\u786E\u8BA4\u8BF7\u6C42","workCenter.pendingEnvelopeChanged":"\u5F85\u786E\u8BA4\u8BF7\u6C42\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u8BE5\u5DE5\u4F5C\u9879\u540E\u518D\u8BD5\u3002","workCenter.removeAttachment":"\u4ECE\u8349\u7A3F\u4E2D\u79FB\u9664","workCenter.previewAttachment":"\u6253\u5F00\u9644\u4EF6","workCenter.openAttachmentNamed":"\u6253\u5F00\u9644\u4EF6 {name}","workCenter.openingAttachment":"\u6B63\u5728\u6253\u5F00\u9644\u4EF6\u2026","workCenter.attachmentPreviewFailed":"\u65E0\u6CD5\u6253\u5F00\u9644\u4EF6\uFF0C\u8BF7\u91CD\u8BD5\u3002","workCenter.attachmentOpenBlocked":"\u6D4F\u89C8\u5668\u963B\u6B62\u4E86\u9644\u4EF6\u7A97\u53E3\uFF0C\u8BF7\u5141\u8BB8\u5F39\u51FA\u7A97\u53E3\u540E\u91CD\u8BD5\u3002","workCenter.execution":"\u6267\u884C\u65B9\u5F0F","workCenter.executionHint":"\u9009\u62E9\u5DE5\u4F5C\u9879\u5728\u54EA\u91CC\u6267\u884C\uFF0C\u4EE5\u53CA\u521B\u5EFA\u540E\u662F\u5426\u7ACB\u5373\u5F00\u59CB\u3002","workCenter.workDir":"\u5DE5\u4F5C\u76EE\u5F55","workCenter.workDirHint":"\u9009\u62E9\u4E00\u4E2A\u5DF2\u5B58\u5728\u7684\u9879\u76EE\u76EE\u5F55","workCenter.chooseFolder":"\u9009\u62E9\u6587\u4EF6\u5939","workCenter.workDirPickerHelp":"\u4ECE\u5F53\u524D Agent \u7684\u771F\u5B9E\u76EE\u5F55\u4E2D\u9009\u62E9\u5DF2\u5B58\u5728\u7684\u6587\u4EF6\u5939\u3002","workCenter.folderPickerHint":"\u9009\u62E9\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53EF\u4EE5\u8BFB\u53D6\u548C\u4FEE\u6539\u7684\u9879\u76EE\u76EE\u5F55\u3002","workCenter.folderPickerSelectionHint":"\u53CC\u51FB\u8FDB\u5165\u76EE\u5F55\uFF0C\u6216\u9009\u4E2D\u76EE\u5F55\u540E\u786E\u8BA4\u3002","workCenter.startImmediately":"\u7ACB\u5373\u5F00\u59CB","workCenter.startImmediatelyHint":"\u5173\u95ED\u540E\u5C06\u521B\u5EFA\u4E3A\u8349\u7A3F\uFF0C\u786E\u8BA4\u65E0\u8BEF\u540E\u518D\u5F00\u59CB\u3002","workCenter.creating":"\u521B\u5EFA\u4E2D\u2026","workCenter.create":"\u521B\u5EFA","workCenter.status.draft":"\u8349\u7A3F","workCenter.status.ready":"\u5F85\u6267\u884C","workCenter.status.running":"\u6267\u884C\u4E2D","workCenter.status.waiting":"\u7B49\u5F85\u4E2D","workCenter.status.needs_attention":"\u9700\u8981\u5904\u7406","workCenter.status.done":"\u5DF2\u5B8C\u6210","workCenter.status.cancelled":"\u5DF2\u53D6\u6D88","workCenter.status.completed":"\u5DF2\u5B8C\u6210","workCenter.status.failed":"\u5931\u8D25","workCenter.status.superseded":"\u5DF2\u66FF\u4EE3","workCenter.action.triage":"\u5206\u6790","workCenter.action.implement":"\u5B9E\u73B0","workCenter.action.review":"\u8BC4\u5BA1","workCenter.action.integrate":"\u96C6\u6210","workCenter.action.deliver":"\u4EA4\u4ED8","workCenter.action.test":"\u6D4B\u8BD5","workCenter.action.research":"\u7814\u7A76","workCenter.action.design":"\u8BBE\u8BA1","workCenter.action.diagnose":"\u8BCA\u65AD","workCenter.action.migrate":"\u8FC1\u79FB","workCenter.action.document":"\u6587\u6863","workCenter.action.operate":"\u8FD0\u7EF4","workCenter.action.write":"\u5199\u4F5C","workCenter.action.custom":"\u81EA\u5B9A\u4E49","workCenter.assignment.auto":"\u4F7F\u7528\u4EFB\u52A1\u6D41\u7B56\u7565","workCenter.model.inherit":"\u4F7F\u7528\u4EFB\u52A1\u6D41\u6A21\u578B","workCenter.model.defaultProvider":"\u9ED8\u8BA4 Provider","workCenter.planPreview":"\u6267\u884C\u8BA1\u5212","workCenter.planPreviewHelp":"\u6839\u636E\u5F53\u524D Agent \u7684 VP \u6C60\u548C\u6A21\u578B\u8BBE\u7F6E\u5B9E\u65F6\u89E3\u6790\u3002","workCenter.settings.title":"\u5DE5\u4F5C\u4E2D\u5FC3\u8BBE\u7F6E","workCenter.settings.subtitle":"\u914D\u7F6E Coordinator\uFF0C\u4EE5\u53CA AI \u52A8\u6001\u89C4\u5212\u4F7F\u7528\u7684 Action \u63D0\u793A\u8BCD\u3001\u6A21\u578B\u548C effort\u3002","workCenter.settings.workflow":"\u4EFB\u52A1\u6D41","workCenter.settings.workflowHelp":"Triage \u4F1A\u9488\u5BF9\u4EFB\u52A1\u52A8\u6001\u9009\u62E9 Action \u548C\u6267\u884C\u8005\u3002","workCenter.settings.aiWorkflowHelp":"Triage \u4F1A\u4E3A\u6BCF\u4E2A Work Item \u5206\u7C7B\u5E76\u751F\u6210\u7ECF\u8FC7\u6821\u9A8C\u7684 1\u20138 \u4E2A\u4EFB\u52A1\u4E13\u5C5E Action\u3002\u5185\u7F6E Action \u7B56\u7565\u53EA\u662F\u53EF\u590D\u7528\u9ED8\u8BA4\u503C\uFF1B\u9700\u8981\u65F6 triage \u53EF\u4EE5\u521B\u5EFA\u7CBE\u786E\u7684\u9886\u57DF\u7C7B\u578B\u3002","workCenter.settings.globalInstructions":"Agent \u5168\u5C40\u6307\u4EE4","workCenter.settings.globalInstructionsHint":"\u4F8B\u5982\uFF1A\u9075\u5FAA\u4ED3\u5E93\u53D1\u5E03\u6D41\u7A0B\u3001\u5FC5\u987B\u72EC\u7ACB\u8BC4\u5BA1\uFF0C\u672A\u7ECF\u660E\u786E\u6279\u51C6\u4E0D\u5F97\u521B\u5EFA\u90E8\u7F72 tag\u3002","workCenter.settings.globalInstructionsHelp":"\u4FDD\u5B58\u5728 Agent \u7EA7\uFF0C\u5E76\u51BB\u7ED3\u8FDB\u6BCF\u4E2A\u65B0 Work Item\uFF1B\u5BF9 triage \u548C\u6240\u6709\u751F\u6210\u7684 Action \u751F\u6548\uFF0C\u4F18\u5148\u7EA7\u4F4E\u4E8E Work Item \u5951\u7EA6\u53CA\u7CFB\u7EDF/\u5DE5\u5177\u5B89\u5168\u89C4\u5219\u3002\u5DF2\u6709 Work Item \u4FDD\u7559\u539F\u5FEB\u7167\u3002","workCenter.settings.actionPolicies":"\u5185\u7F6E Action \u7B56\u7565","workCenter.settings.actionPoliciesHelp":"\u8FD9\u4E9B\u662F\u53EF\u590D\u7528\u7684\u6267\u884C\u57FA\u7EBF\uFF0C\u4E0D\u662F\u56FA\u5B9A\u5DE5\u4F5C\u6D41\u3002\u672A\u77E5\u7684\u9886\u57DF Action \u7C7B\u578B\u4F1A\u4F7F\u7528\u201C\u81EA\u5B9A\u4E49\u201D\u7B56\u7565\uFF0C\u5E76\u4FDD\u7559 triage \u751F\u6210\u7684\u7C7B\u578B\u548C\u4EFB\u52A1\u76EE\u6807\u3002","workCenter.settings.dynamicInstructionHelp":"AI \u4F1A\u52A0\u5165 Work Item \u5951\u7EA6\u3001\u5168\u5C40\u6307\u4EE4\u3001\u524D\u5E8F Action \u4E0A\u4E0B\u6587\u3001memory \u548C\u4EFB\u52A1\u4E13\u5C5E\u76EE\u6807\uFF1B\u8FD9\u91CC\u5B9A\u4E49\u8BE5 Action \u7C7B\u578B\u7684\u53EF\u590D\u7528\u884C\u4E3A\u3002","workCenter.settings.models":"\u6A21\u578B","workCenter.settings.modelsHelp":"Provider \u548C\u51ED\u8BC1\u4ECD\u7531 Agent LLM \u8BBE\u7F6E\u7BA1\u7406\uFF1B\u5DE5\u4F5C\u4E2D\u5FC3\u53EA\u9009\u62E9\u53EF\u7528\u6A21\u578B\u3002","workCenter.settings.dynamicModelsHelp":"Coordinator \u4E0E\u5B9E\u9645\u6267\u884C Action \u7684\u6A21\u578B\u53EF\u4EE5\u5206\u522B\u914D\u7F6E\u3002","workCenter.settings.coordinatorModel":"Coordinator","workCenter.settings.coordinatorModelHelp":"\u7528\u4E8E Work Item \u5BF9\u8BDD\u3001\u4FEE\u6539\u76EE\u6807\u548C\u91CD\u65B0\u89C4\u5212\uFF1B\u4E0D\u4F1A\u6267\u884C\u9879\u76EE\u5DE5\u5177\u3002","workCenter.settings.allActions":"\u6240\u6709 Action \u7684\u515C\u5E95\u7B56\u7565","workCenter.settings.maxConcurrentActions":"\u6700\u5927\u5E76\u53D1 Action \u6570","workCenter.settings.maxConcurrentActionsHelp":"\u9ED8\u8BA4 3\u3002\u975E Git\u3001\u810F\u5DE5\u4F5C\u533A\u3001\u5171\u4EAB\u526F\u4F5C\u7528\u548C\u96C6\u6210 Action \u4ECD\u4F1A\u4E32\u884C\u6267\u884C\u3002","workCenter.workItemType":"\u7C7B\u578B","workCenter.typeAuto":"Auto \u2014 \u7531 LLM \u63A8\u65AD","workCenter.typeHelp":"\u53EF\u9009\u62E9\u4EFB\u52A1\u7C7B\u522B\uFF0C\u4E5F\u53EF\u8BA9 AI \u81EA\u52A8\u63A8\u65AD\uFF1B\u5177\u4F53 Actions \u59CB\u7EC8\u7531 AI \u89C4\u5212\u3002","workCenter.planning":"\u89C4\u5212\u4E2D","workCenter.aiPlan":"AI \u52A8\u6001\u89C4\u5212\u6267\u884C","workCenter.aiPlanHelp":"Triage \u4F1A\u9009\u62E9\u4EFB\u52A1\u7C7B\u578B\u3001Action\u3001\u6267\u884C\u8005\u548C\u6700\u5C0F\u53EF\u9760\u6D41\u7A0B\uFF1B\u6A21\u578B\u4E0E effort \u7531 Work Center \u8BBE\u7F6E\u63A7\u5236\u3002","workCenter.settings.manageProviders":"\u7BA1\u7406 Agent \u6A21\u578B","workCenter.settings.assignment":"VP \u9009\u62E9","workCenter.settings.assignment.auto":"\u4ECE\u5168\u90E8 VP \u81EA\u52A8\u9009\u62E9","workCenter.settings.assignment.pool":"\u5019\u9009\u6C60","workCenter.settings.assignment.fixed":"\u56FA\u5B9A VP","workCenter.settings.capability":"\u6240\u9700\u80FD\u529B","workCenter.settings.vp":"Virtual Person","workCenter.settings.poolMembers":"\u5019\u9009 VP","workCenter.settings.modelPolicy":"\u6A21\u578B\u7B56\u7565","workCenter.settings.model.inherit":"\u7EE7\u627F VP \u504F\u597D","workCenter.settings.model.primary":"Agent \u4E3B\u6A21\u578B","workCenter.settings.model.fast":"Agent \u5FEB\u6A21\u578B","workCenter.settings.model.specific":"\u6307\u5B9A\u6A21\u578B","workCenter.settings.model":"\u6A21\u578B","workCenter.settings.effort":"\u63A8\u7406\u5F3A\u5EA6","workCenter.settings.effortDefault":"\u6A21\u578B\u9ED8\u8BA4\u503C","workCenter.settings.effortHelp":"\u8986\u76D6\u6240\u9009\u6A21\u578B\u7684\u9ED8\u8BA4\u63A8\u7406\u5F3A\u5EA6\uFF0C\u5E76\u7528\u4E8E\u6240\u6709 Work Center Action\u3002","workCenter.settings.effortChooseModelHelp":"\u9009\u62E9 Agent \u4E3B\u6A21\u578B\u3001\u5FEB\u6A21\u578B\u6216\u6307\u5B9A\u6A21\u578B\u540E\u53EF\u914D\u7F6E\u63A8\u7406\u5F3A\u5EA6\uFF1B\u7EE7\u627F VP \u504F\u597D\u65F6\u4F7F\u7528\u5404 VP \u6A21\u578B\u7684\u9ED8\u8BA4\u503C\u3002","workCenter.settings.effortUnsupportedHelp":"\u6240\u9009\u6A21\u578B\u4E0D\u63D0\u4F9B\u53EF\u914D\u7F6E\u7684\u63A8\u7406\u5F3A\u5EA6\uFF0C\u56E0\u6B64\u4F7F\u7528\u6A21\u578B\u9ED8\u8BA4\u503C\u3002","workCenter.settings.saving":"\u4FDD\u5B58\u4E2D\u2026","workCenter.settings.reload":"\u91CD\u65B0\u52A0\u8F7D\u8BBE\u7F6E","workCenter.settings.conflict":"\u8BBE\u7F6E\u5DF2\u5728\u5176\u4ED6\u4F4D\u7F6E\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u540E\u518D\u4FDD\u5B58\u3002","workCenter.settings.upgradeRequired":"\u5F53\u524D Agent \u7248\u672C\u65E0\u6CD5\u4FDD\u5B58\u5DE5\u4F5C\u4E2D\u5FC3\u8BBE\u7F6E\u3002\u8FD9\u91CC\u4EE5\u53EA\u8BFB\u65B9\u5F0F\u663E\u793A\u5F53\u524D\u503C\uFF1B\u5347\u7EA7 Agent \u540E\u5373\u53EF\u7F16\u8F91\u5E76\u4FDD\u5B58\u3002","workCenter.settings.saveNotConfirmed":"Agent \u672A\u786E\u8BA4\u672C\u6B21\u63D0\u4EA4\u7684\u63D0\u793A\u8BCD\u548C\u6A21\u578B\u7B56\u7565\u3002\u8BBE\u7F6E\u7A97\u53E3\u4E0D\u4F1A\u5173\u95ED\uFF1B\u8BF7\u91CD\u65B0\u52A0\u8F7D\u6216\u5347\u7EA7 Agent \u540E\u518D\u8BD5\u3002","workCenter.settings.addWorkflow":"\u590D\u5236\u4EFB\u52A1\u6D41","workCenter.settings.removeWorkflow":"\u5220\u9664","workCenter.settings.newWorkflow":"\u4EFB\u52A1\u6D41 {index}","workCenter.settings.workflowName":"\u4EFB\u52A1\u6D41\u540D\u79F0","workCenter.settings.newStage":"\u65B0\u9636\u6BB5","workCenter.settings.addStage":"\u6DFB\u52A0\u9636\u6BB5","workCenter.settings.removeStage":"\u5220\u9664\u9636\u6BB5","workCenter.settings.moveUp":"\u4E0A\u79FB\u9636\u6BB5","workCenter.settings.moveDown":"\u4E0B\u79FB\u9636\u6BB5","workCenter.settings.stageType":"\u9636\u6BB5\u7C7B\u578B","workCenter.settings.reviewReturnStage":"\u8981\u6C42\u4FEE\u6539\u65F6\u9000\u56DE\u9636\u6BB5","workCenter.settings.instruction":"\u9636\u6BB5 Prompt","workCenter.settings.instructionHint":"\u5B9A\u4E49\u8FD9\u4E2A\u9636\u6BB5\u5177\u4F53\u8981\u505A\u4EC0\u4E48\u3002","workCenter.settings.instructionHelp":"\u8FD0\u884C\u65F6\u4F1A\u81EA\u52A8\u52A0\u5165 Work Item \u7684\u76EE\u6807\u3001\u9A8C\u6536\u6807\u51C6\u548C\u53EF\u590D\u7528\u4E0A\u4E0B\u6587\u3002","workCenter.settings.instructionReset":"\u6062\u590D\u9ED8\u8BA4\u503C"}});var ip,op=F(()=>{ip={"common.loading":"Loading...","common.confirm":"OK","common.apply":"Apply","common.cancel":"Cancel","common.delete":"Delete","common.copy":"Copy","common.copied":"Copied","common.close":"Close","common.refresh":"Refresh","common.open":"Open","common.save":"Save","common.search":"Search","common.back":"Back","common.noSubdirectories":"No subdirectories","common.drives":"Drives","common.rootDir":"Root","common.comma":", ","common.select":"Select","mermaid.export":"Export","mermaid.exportMd":"Export MD","mermaid.exportPng":"Export PNG","mermaid.exportJpg":"Export JPG","chat.toolActionsOmitted":"{count} older tool actions omitted","login.subtitle":"Yeaft Web Code Agent","login.username":"Username","login.password":"Password","login.login":"Login","login.loggingIn":"Logging in...","login.enterUsername":"Please enter your username","login.enterPassword":"Please enter your password","login.noAccount":"Don't have an account?","login.registerWithCode":"Register","login.or":"or","login.usePassword":"Sign in with username & password","login.useSso":"Back to single sign-on","login.noProviders":"No third-party sign-in providers are enabled.","login.microsoft":"Sign in with Microsoft","login.github":"Sign in with GitHub","login.google":"Sign in with Google","login.wechat":"Sign in with WeChat","login.alipay":"Sign in with Alipay","login.wechat.mobileUnsupported":"Sign in with WeChat is only available on PC. Please scan the QR code from a desktop browser.","login.alipay.mobileWaiting":"Waiting for you to confirm in the Alipay app\u2026 Once you finish, return to this page and you will be signed in automatically.","login.alipay.relaunch":"Open Alipay again","login.qr.title":"Scan to sign in","login.qr.titleAlipay":"Sign in with Alipay","login.qr.titleWechat":"Sign in with WeChat","login.qr.hint":"Scan the QR code with your phone to authorize.","login.error.enterUsername":"Please enter your username","login.error.enterPassword":"Please enter your password","login.error.enter6Digit":"Please enter a 6-digit code","login.error.enterInviteCode":"Please enter the invite code","login.error.usernameMinLen":"Username must be at least 2 characters","login.error.passwordMinLen":"Password must be at least 6 characters","login.error.passwordMismatch":"Passwords do not match","login.error.enterVerifyCode":"Please enter the verification code","login.error.loginFailed":"Login failed","login.forgot.link":"Forgot password?","login.forgot.title":"Reset your password","login.forgot.emailHint":"Enter the email address on your account. We will send a 6-digit reset code.","login.forgot.sendCode":"Send Reset Code","login.forgot.sending":"Sending...","login.forgot.codeSent":"If the email is on file, a 6-digit reset code has been sent. Enter it below along with your new password.","login.forgot.resetBtn":"Reset Password","login.forgot.resetting":"Resetting...","login.forgot.success":"Password reset. You can now sign in with your new password.","login.forgot.emailInvalid":"Please enter a valid email","login.register.title":"New User Registration","login.register.inviteCode":"Invite Code","login.register.username":"Username","login.register.password":"Password (min 6 characters)","login.register.confirmPassword":"Confirm Password","login.register.email":"Email (optional)","login.register.submit":"Register","login.register.submitting":"Registering...","login.register.back":"Back to Login","login.register.success":"Registration successful, please login","login.register.enterCode":"Please enter the invite code","login.register.usernameMin":"Username must be at least 2 characters","login.register.passwordMin":"Password must be at least 6 characters","login.register.passwordMismatch":"Passwords do not match","login.totp.setupTitle":"Set Up Two-Factor Authentication","login.totp.setupHint":"Scan the QR code below with Microsoft Authenticator or Google Authenticator","login.totp.manualKey":"Or enter the key manually:","login.totp.enterCode":"Enter 6-digit code","login.totp.complete":"Complete Setup","login.totp.verifying":"Verifying...","login.totp.verify":"Verify","login.totp.prompt":"Enter the code from your Authenticator app","login.totp.invalidCode":"Please enter a 6-digit code","login.email.codeSent":"Verification code sent to {email}","login.email.enterCode":"Enter verification code","login.email.verify":"Verify","login.email.verifying":"Verifying...","login.email.enterCodeError":"Please enter the verification code","chat.agent.select":"Select Agent","chat.agent.manage":"Manage Agents","chat.agent.none":"No Agents","chat.agent.restarting":"Restarting","chat.agent.restart":"Restart","chat.agent.restartConfirm":`Are you sure you want to restart Agent "{name}"?
|
|
13
13
|
All active conversations will be interrupted.`,"chat.agent.upgrade":"Upgrade","chat.agent.upgrading":"Upgrading","chat.agent.upgradeConfirm":`Upgrade Agent "{name}" to the latest version?
|
|
14
|
-
The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is already at the latest version (v{version}), no upgrade needed.","chat.agent.nodeIncompatible":"Agent upgrade aborted: target version v{version} requires Node {required}, but this machine is running Node {current}. Please upgrade Node.js first, then retry.","chat.agent.online":"{count} Agent(s) online","chat.agent.selectFirst":"Please select an Agent first","chat.agent.yeaft":"Yeaft Chat","sidebar.toggle.chat":"Switch to Chat","sidebar.toggle.yeaft":"Switch to Yeaft","sidebar.surface.label":"Sidebar view","sidebar.surface.sessions":"Sessions","sidebar.provider.label":"Session provider","sidebar.provider.claude":"Claude","sidebar.sessions.new":"New session","sidebar.sessions.newChat":"New chat","sidebar.sessions.emptyProvider":"No sessions for this provider","sidebar.sessions.menu":"Session menu","sidebar.sessions.unread":"Unread","sidebar.sessions.pinned":"Pinned","sidebar.sessions.processing":"Reply in progress","sidebar.sessions.hidden":"Hidden sessions","sidebar.sessions.remove":"Remove from sidebar","sidebar.sessions.agent":"Agent","sidebar.sessions.provider":"Provider","sidebar.projects.title":"Projects","sidebar.projects.menu":"Project menu","sidebar.projects.new":"New project","sidebar.projects.newSession":"New Session in {name}","sidebar.projects.assignFailed":"Session created, but it could not be added to {name}. Error: {message}","sidebar.projects.empty":"No projects yet","sidebar.projects.noSessions":"Drag a Yeaft chat here","sidebar.projects.namePrompt":"Project name","sidebar.projects.renamePrompt":"Rename project","sidebar.projects.rename":"Rename project","sidebar.projects.delete":"Delete project","sidebar.projects.deleteConfirm":'Delete project "{name}"? Its chats will move to Recents.',"sidebar.projects.remove":"Remove from project","sidebar.projects.moveMenu":"Move to Projects","sidebar.projects.moveBack":"Back","sidebar.projects.moveEmpty":"No other projects","sidebar.projects.moveTo":"Move to {name}","sidebar.projects.instructions":"Project instructions","sidebar.projects.instructionsTitle":"{name} instructions","sidebar.projects.instructionsHint":"These instructions are added to the system prompt for every Session in this Project.","sidebar.projects.instructionsPlaceholder":"Add shared coding conventions, constraints, or workflow guidance...","sidebar.recents.title":"Recents","sidebar.recents.empty":"No chats found","yeaft.back":"Back","yeaft.session.people":"People","yeaft.session.peopleEmpty":"No people","yeaft.session.runningTasks":"Running tasks","yeaft.session.tasksEmpty":"No running tasks","yeaft.session.owner":"Owner","yeaft.session.started":"Started","yeaft.breadcrumb.label":"Thread filter","yeaft.breadcrumb.mainStream":"Main stream","yeaft.breadcrumb.backHint":"Return to full stream (Esc)","yeaft.featureDetail.ariaLabel":"Task detail","yeaft.featureDetail.replyTo":"Reply in:","yeaft.featureDetail.forkHint":"No active thread \u2014 fork a new one to reply.","yeaft.featureDetail.empty":"No messages for this task yet.","yeaft.featureDetail.threadPillHint":"Open thread","yeaft.featureDetail.summary.aria":"Task summary timeline","yeaft.featureDetail.summary.title":"Summary timeline","yeaft.featureDetail.summary.loading":"Loading summary history\u2026","yeaft.featureDetail.summary.empty":"No summaries yet.","yeaft.featureDetail.summary.error":"Summary history failed: {error}","yeaft.featureDetail.summary.showArchived":"Show archived","yeaft.featureDetail.related.aria":"Related tasks","yeaft.featureDetail.related.title":"Related tasks","yeaft.featureDetail.related.unlink":"Unlink","yeaft.featureDetail.members.aria":"Task members","yeaft.featureDetail.members.title":"Members","yeaft.featureDetail.members.abort":"Abort","yeaft.featureDetail.members.kick":"Kick","yeaft.model":"Model","yeaft.placeholder":"Ask anything...","yeaft.inbox":"Inbox","yeaft.inbox.tooltip":"Your default thread \u2014 one-on-one chat with Yeaft. New threads can be created for specific topics or tasks.","yeaft.sidebar.activeThreads":"Active","yeaft.sidebar.idleThreads":"Idle","yeaft.sidebar.archivedThreads":"Archived","yeaft.sidebar.tasks":"Tasks","yeaft.sidebar.emptyActive":"No active threads","yeaft.sidebar.emptyIdle":"No idle threads","yeaft.sidebar.emptyArchived":"No archived threads","yeaft.sidebar.emptyTasks":"No tasks match","yeaft.sidebar.results":"Results","yeaft.sidebar.resultsThreads":"Threads","yeaft.sidebar.kindThread":"thread","yeaft.sidebar.cancel":"Cancel","yeaft.sidebar.mergeInto":"Merge into\u2026","yeaft.sidebar.mergeNoCandidates":"No other threads to merge into","yeaft.sidebar.mergeConfirmTitle":"Merge this thread?","yeaft.sidebar.mergeIrreversible":"This cannot be undone. The source thread will be archived and its messages moved to the target.","yeaft.sidebar.mergeConfirm":"Merge","yeaft.settings.sidebarV2":"Experimental: Sidebar V2","yeaft.settings.sidebarV2Hint":"Thread list + task tree (preview).","yeaft.clearConfirm":"Clear all messages?","yeaft.mode":"Mode","yeaft.agent":"Agent","yeaft.connecting":"Connecting...","yeaft.ready":"Ready","yeaft.tools":"tools","yeaft.skills":"skills","yeaft.mcp":"MCP","yeaft.showSidebar":"Show sidebar","yeaft.hideSidebar":"Hide sidebar","yeaft.debug":"Debug","yeaft.debugClose":"Close debug panel","yeaft.debugTurns":"turns","yeaft.debugTabToolStats":"Tool Stats","yeaft.debugTabDream":"Dream","yeaft.debugTabRequestLog":"Request Log","yeaft.debugHistoryLoad":"Load request history","yeaft.debugHistoryLoading":"Loading...","yeaft.debugHistoryLoaded":"{count} loaded","yeaft.debugSearchPlaceholder":"Regex search request logs","yeaft.debugSearchHint":"Shows the latest 10 globally by default; search matches request summaries across Sessions.","yeaft.dreamDebug.title":"Dream lifecycle","yeaft.dreamDebug.trigger":"Trigger","yeaft.dreamDebug.status":"Status","yeaft.dreamDebug.started":"Started","yeaft.dreamDebug.finished":"Finished","yeaft.dreamDebug.time":"Time","yeaft.dreamDebug.phase":"Phase","yeaft.dreamDebug.call":"Call","yeaft.dreamDebug.location":"Location","yeaft.dreamDebug.result":"Result","yeaft.dreamDebug.noLatest":"No dream check has been recorded for this session yet.","yeaft.dreamDebug.noEvents":"No dream events yet for this session.","yeaft.dreamDebug.outputTitle":"Dream output loaded for this session","yeaft.dreamDebug.scope":"Scope","yeaft.dreamDebug.lastDream":"Last dream","yeaft.dreamDebug.messagesCovered":"Messages covered","yeaft.dreamDebug.noOutput":"No dream output has been written for this session yet.","yeaft.dreamDebug.promptLoadTitle":"Dream memory loaded into system prompt","yeaft.dreamDebug.loadedInto":"Loaded into","yeaft.dreamDebug.vp":"VP","yeaft.dreamDebug.summaryToPrompt":"summary.md -> system prompt","yeaft.dreamDebug.itemList":"Dream runs and scopes","yeaft.dreamDebug.searchPlaceholder":"Search Dream sessions by title, id, or summary...","yeaft.dreamDebug.noSearchResults":"No Dream sessions match this search.","yeaft.dreamDebug.noSummary":"No summary available","yeaft.dreamDebug.segments":"segments","yeaft.dreamDebug.lastError":"Last error","yeaft.dreamDebug.overview":"Overview","yeaft.dreamDebug.sessionId":"Session ID","yeaft.dreamDebug.loadedAt":"Loaded at","yeaft.dreamDebug.layers":"Layers","yeaft.dreamDebug.summaryLayer":"Resident summary","yeaft.dreamDebug.noPromptLoad":"No prompt-load record is available for this scope.","yeaft.dreamDebug.segmentTitle":"Segments","yeaft.dreamDebug.sourceMessages":"Source messages","yeaft.dreamDebug.createdAt":"Created","yeaft.dreamDebug.updatedAt":"Updated","yeaft.dreamDebug.noSegments":"No memory segments are available for this scope.","yeaft.dreamDebug.requestResponse":"Request / Response","yeaft.dreamDebug.noRequestResponse":"No Dream request/response log has been persisted for this scope yet.","yeaft.dreamDebug.empty":"No Dream debug data has been recorded yet.","yeaft.debugGroupFollowMain":"Follow main pane","yeaft.debugGroupAll":"All sessions","yeaft.debugAssistantResponse":"Assistant response","yeaft.debugViewAssistantResponse":"View response","yeaft.debugToolInput":"Input","yeaft.debugToolResult":"Result","yeaft.debugToolRunning":"running","yeaft.debugToolRunningNoResult":"Running; no result yet","yeaft.debugShowDetails":"show","yeaft.debugHideDetails":"hide","yeaft.debugTurnStartedAt":"turn started at","yeaft.debugRequestAt":"request time","yeaft.debugRequestAtDerived":"derived from turn start (legacy loop)","yeaft.turn":"Turn {n}","yeaft.systemPrompt":"System Prompt","yeaft.messagesLabel":"Messages","yeaft.response":"Response","yeaft.toolCalls":"Tool Calls","yeaft.functionCalls":"Function Calls","yeaft.request":"Request","yeaft.pending":"(pending)","yeaft.inputTokens":"Input","yeaft.outputTokens":"Output","yeaft.duration":"Duration","yeaft.noDebugData":"No debug data yet","yeaft.showDebug":"Show debug panel","yeaft.hideDebug":"Hide debug panel","yeaft.reloadPage":"Reload page","yeaft.reloadMessages":"Reload messages","sidebar.sessions.syncing":"Syncing latest messages","yeaft.historySearch.label":"Search Session history","yeaft.historySearch.button":"Search messages","yeaft.historySearch.placeholder":"Search messages in this Session","yeaft.historySearch.searching":"Searching\u2026","yeaft.historySearch.minChars":"Type at least 2 characters","yeaft.historySearch.empty":"No matching messages","yeaft.historySearch.error":"Search failed. Try again.","yeaft.historySearch.unsupported":"Upgrade this Agent to search Session history.","yeaft.historySearch.more":"Load more results","yeaft.historySearch.you":"You","yeaft.historySearch.assistant":"Assistant","yeaft.outline.label":"Message history","yeaft.outline.sender":"Sender","yeaft.outline.allSenders":"All senders","yeaft.outline.title":"Message history","yeaft.outline.placeholder":"Search this conversation","yeaft.outline.searching":"Searching\u2026","yeaft.outline.loading":"Loading\u2026","yeaft.outline.older":"Load older messages","yeaft.outline.moreMatches":"Load more matches","yeaft.outline.minChars":"Type at least 2 characters","yeaft.outline.empty":"No messages yet","yeaft.outline.noMatches":"No matching messages","yeaft.outline.error":"Could not load the outline. Try again.","yeaft.outline.unsupported":"Upgrade this Agent to use the conversation outline.","yeaft.outline.you":"You","yeaft.outline.assistant":"Assistant","yeaft.outline.nonText":"Non-text response","yeaft.switchModel":"Switch model","yeaft.modelMenu.title":"Model and LLM settings","yeaft.modelMenu.label":"Model","yeaft.modelMenu.effort":"Effort","yeaft.modelMenu.effort.openaiReasoning":"Reasoning effort","yeaft.modelMenu.effort.anthropicBudget":"Thinking budget","yeaft.modelMenu.effort.anthropicAdaptive":"Adaptive thinking effort","yeaft.modelMenu.effort.minimal":"Minimal","yeaft.modelMenu.effort.low":"Low","yeaft.modelMenu.effort.medium":"Medium","yeaft.modelMenu.effort.high":"High","yeaft.modelMenu.effort.xhigh":"X-High","yeaft.modelMenu.effort.max":"Max","yeaft.modelMenu.noEffort":"This model does not expose a compatible effort control.","yeaft.modelMenu.configureHint":"Providers, keys, model list","yeaft.settings.title":"Settings","settings.yeaft.tabs.vp":"VP Library","settings.yeaft.tabs.search":"Search","settings.yeaft.tabs.mcp":"MCP","yeaft.settings.tabs.vp":"VP Library","yeaft.settings.tabs.search":"Search","yeaft.settings.tabs.mcp":"MCP","settings.mcp.title":"MCP servers","settings.mcp.description":"Connect Model Context Protocol servers to extend Yeaft with extra tools. Servers are stored in ~/.yeaft/config.json on the agent; tools appear in the LLM's catalogue as mcp__<server>__<tool>.","settings.mcp.reloadAll":"Reload all","settings.mcp.reloadOne":"Reconnect this server","settings.mcp.loading":"Working\u2026","settings.mcp.connected":"connected","settings.mcp.disconnected":"disconnected","settings.mcp.tools":"tools","settings.mcp.remove":"Remove","settings.mcp.empty":"No MCP servers configured yet. Add one below.","settings.mcp.addServer":"Add server","settings.mcp.addServerDesc":"Most MCP servers run as a local command \u2014 Yeaft launches it via stdio and discovers its tools.","settings.mcp.serverName":"Name","settings.mcp.command":"Command","settings.mcp.args":"Arguments","settings.mcp.argsPlaceholder":"e.g. -y @modelcontextprotocol/server-filesystem /tmp","settings.mcp.env":"Environment","settings.mcp.envPlaceholder":"KEY=value per line. Lines starting with # are ignored.","settings.mcp.saving":"Saving\u2026","settings.mcp.add":"Add","settings.mcp.cancel":"Clear","settings.mcp.connectFailed":"Saved but failed to connect","settings.mcp.addSuccess":"Server added","settings.mcp.removeSuccess":"Server removed","settings.mcp.reloadSuccess":"Reload requested","settings.mcp.confirmRemove":'Remove MCP server "{name}"? Its tools will disappear from the next LLM turn.',"settings.mcp.errors.nameRequired":"Name is required","settings.mcp.errors.nameFormat":"Name must be lowercase letters, digits, dashes or underscores only","settings.mcp.errors.commandRequired":"Command is required","settings.mcp.errors.argsParse":"Could not parse arguments","settings.mcp.errors.envParse":"Could not parse environment","search.settings.backendTitle":"Search backend","search.settings.backendDesc":"Choose the primary backend for the WebSearch tool. If the primary fails, the engine automatically falls back to HTML scraping.","search.settings.backend.tavily":"Tavily","search.settings.backend.tavilyHint":"Hosted search API. Free tier: 1000 queries/month. Recommended.","search.settings.backend.playwright":"Playwright service","search.settings.backend.playwrightHint":"Self-hosted browser-based search/fetch. Best for cloud IPs that get bot-blocked. Service not yet shipped.","search.settings.comingSoon":"Coming soon","search.settings.tavilyKeyTitle":"Tavily API key","search.settings.tavilyKeyDesc":"Stored on the agent in ~/.yeaft/config.json. Get a free key at","search.settings.tavilyKeyUnchanged":"(unchanged)","search.settings.clearKey":"Clear","search.settings.usageTitle":"Usage this month","search.settings.usageRefresh":"Refresh","search.settings.usageLoading":"Loading\u2026","search.settings.usagePlan":"Plan","search.settings.usageUsed":"Used","search.settings.usagePaygo":"Pay-as-you-go","search.settings.usageError":"Failed to load usage","search.settings.save":"Save","search.settings.saving":"Saving\u2026","search.settings.saveSuccess":"Saved","search.settings.cancel":"Reset","yeaft.settings.yeaftTitle":"Thread Concurrency & Archive","yeaft.settings.yeaftDesc":"Tune how many threads can run at once and when idle threads are auto-archived.","yeaft.settings.maxConcurrentLabel":"Max concurrent threads","yeaft.settings.maxConcurrentHint":"Maximum number of live threads at once (includes the always-on main thread). New threads beyond this cap are refused until an existing thread is archived or terminated. Range: 1-50.","yeaft.settings.archiveIdleDaysLabel":"Auto-archive idle threads after (days)","yeaft.settings.archiveIdleDaysHint":"Threads with no activity for this many days will be archived. Range: 1-3650.","yeaft.settings.yeaftSaveBtn":"Save","yeaft.settings.yeaftSaving":"Saving...","yeaft.settings.yeaftSaved":"Saved","yeaft.settings.yeaftLoading":"Loading...","yeaft.settings.yeaftLoadError":"Failed to load Yeaft settings","yeaft.settings.yeaftSaveError":"Failed to save Yeaft settings","yeaft.settings.rangeErrorConcurrent":"Must be between 1 and 50","yeaft.settings.rangeErrorArchive":"Must be between 1 and 3650","chat.session.creating":"Creating conversation...","chat.session.loadingHistory":"Loading conversation history...","yeaft.historyLoad.error":"Conversation history could not be loaded. Your messages are still stored on the Agent.","yeaft.historyLoad.retry":"Retry loading","yeaft.sessionInventory.error":"Sessions could not be loaded. Your conversations are still stored on the Agent.","yeaft.sessionInventory.retry":"Retry Sessions","chat.session.closed":"Conversation closed","chat.session.agentOffline":"Agent is offline. This session will be available when the agent reconnects.","chat.execution.cancelled":"Execution cancelled","chat.sidebar.expand":"Expand menu","chat.sidebar.collapse":"Collapse sidebar","chat.sidebar.workbench":"Workbench","chat.sidebar.newConv":"Conversation","chat.sidebar.recentChats":"Recent Chats","chat.sidebar.resumeConv":"Resume Conversation","chat.sidebar.lightMode":"Light Mode","chat.sidebar.darkMode":"Dark Mode","chat.sidebar.settings":"Settings","chat.sidebar.emptyHint":"Click the button above to create a new conversation","chat.sidebar.closeConv":"Close Conversation","chat.sidebar.renameConv":"Rename","chat.sidebar.pin":"Pin to top","chat.sidebar.unpin":"Unpin","chat.connection.connecting":"Connecting...","chat.connection.reconnecting":"Reconnecting ({current}/{max})...","chat.connection.updating":"Server is updating, please wait...","chat.connection.disconnected":"Disconnected","chat.connection.reconnect":"Reconnect","chat.connection.reconnectFailed":"Connection lost. Please click reconnect to retry.","chat.time.justNow":"Just now","chat.time.minutesAgo":"{count}m ago","chat.time.daysAgo":"{count}d ago","chat.time.today":"Today","chat.time.yesterday":"Yesterday","chat.delete.confirm":"Are you sure you want to close this conversation? This will terminate the corresponding Claude process.","chat.delete.enterWorkDir":"Please enter the working directory path","modal.newConv.workDir":"Work Directory","modal.newConv.inputOrSelect":"Enter or select a work directory","modal.newConv.browse":"Browse","modal.newConv.noWorkDirs":"No work directories","modal.newConv.selectAgent":"Please select an online Agent first","modal.newConv.create":"Create Conversation","modal.newConv.folderLabel":"\u{1F4C1} Work Directories","modal.newConv.provider":"Provider","modal.newConv.model":"Model","provider.claudeCode":"Claude Code","provider.copilot":"Copilot","modal.resume.workDir":"Work Directory","modal.resume.inputOrSelect":"Enter or select a work directory","modal.resume.browse":"Browse","modal.resume.tabFolders":"Directories","modal.resume.tabSessions":"History","modal.resume.noWorkDirs":"No work directories","modal.resume.selectWorkDir":"Please select a work directory first","modal.resume.noSessions":"No history sessions in this directory","modal.resume.untitled":"Untitled Session","modal.resume.folderLabel":"\u{1F4C1} Work Directories","modal.resume.sessionLabel":"\u{1F4AC} History Sessions","modal.resume.selectAgent":"Please select an online Agent first","modal.folderPicker.title":"Select Work Directory","modal.folderPicker.parentDir":"Parent Directory","welcome.subtitle":"Web Code Agent for sessions, tools, and VP collaboration","welcome.agentOnline":"{count} Agent(s) online","welcome.noAgents":"No Agents Online","welcome.noAgentsHint":"Please start an Agent and connect it to the server","welcome.noAgent":"No Agents Online","welcome.noAgentHint":"Please start an Agent and connect it to the server","welcome.setupAgent":"Set Up Agent","welcome.setupKicker":"Agent setup","welcome.setupTitle":"Connect your first Yeaft Agent","welcome.setupDesc":"Copy two commands to connect a local Agent. GitHub Copilot can configure models automatically.","welcome.setupInstallTitle":"Install CLI","welcome.setupCopilotTitle":"Configure models","welcome.setupRunTitle":"Start Agent","welcome.setupSecretLoading":"Preparing your Agent secret...","welcome.setupSecretError":"Could not prepare the Agent secret. Open Security settings to retry.","welcome.openSecuritySettings":"Open Security Settings","welcome.newConv":"Conversation","welcome.resumeHistory":"Resume History","messages.loadingMore":"Loading more messages...","messages.loadMore":"\u2191 Click or scroll up to load more","message.loadingMore":"Loading more messages...","message.loadMore":"\u2191 Click or scroll up to load more","message.scrollToLatest":"\u2193 Latest","message.showResponses":"Show {count} response(s)","message.hideResponses":"Hide response(s)","message.assistant":"Assistant","chat.waiting.disconnected":"Connection lost","chat.connecting":"Connecting to provider session...","chat.waiting.compacting":"Compacting context...","chat.waiting.agentOffline":"Agent offline","chat.waiting.sessionLost":"Session lost, refreshed, waiting for update...","chat.waiting.cliExited":"Claude process exited, refreshed, waiting for update...","chat.waiting.refresh":"Refresh","chat.waiting.thinking":"AI is thinking, please wait...","btw.hint":"esc to exit","btw.placeholder":"Ask a side question...","btw.close":"Exit BTW mode","message.copyContent":"Copy content","message.copy":"Copy content","message.copied":"Copied","message.copyCode":"Copy code","message.copyAll":"Copy all","message.screenshot":"Screenshot","message.screenshotting":"Taking screenshot...","message.exportMd":"Export MD","message.askInput":"Your input needed","message.askAnswered":"\u2713 Answered","message.askCustom":"Or type a custom answer...","message.askCustomPlaceholder":"Or type a custom answer...","message.askSubmit":"Submit Answer","message.askWaiting":"Waiting for question...","message.askExpired":"This question has expired. Ask the role to re-ask.","message.openInEditor":"Open in editor","message.resultDone":"Done","message.done":"Done","message.resultRead":"Read {file}","message.readFile":"Read {name}","message.file":"file","message.attachImages":"{count} image(s)","message.imageCount":"{count} image(s)","message.imagePreview":"Image preview","message.previousImage":"Previous image","message.nextImage":"Next image","message.imagePosition":"Image {current} of {total}","message.imageUnavailable":"Image unavailable","message.attachFiles":"{count} file(s)","message.fileCount":"{count} file(s)","message.quote":"Quote","message.removeQuote":"Remove quote","message.replyingTo":"Replying to {author}","message.quotedFrom":"Quoted from {author}","message.editAsNew":"Edit","message.you":"You","input.upload":"Upload file","input.placeholder":"Type a message...","input.send":"Send","input.stopExecution":"Stop execution","chatInput.upload":"Upload file","chatInput.uploading":"Uploading...","chatInput.uploadFailed":"Upload failed","chatInput.retryUpload":"Retry","chatInput.removeAttachment":"Remove attachment","chatInput.placeholder":"Type a message...","chatInput.send":"Send","chatInput.stop":"Stop execution","tools.thinking":"Thinking...","tools.read":"Reading file","tools.write":"Writing file","tools.edit":"Editing file","tools.bash":"Running command","tools.glob":"Searching files","tools.grep":"Searching content","tools.task":"Running task","tools.webFetch":"Fetching web page","tools.webSearch":"Searching the web","tools.todoWrite":"Updating tasks","tools.executing":"Running {name}","status.thinking":"Thinking...","status.reading":"Reading file","status.writing":"Writing file","status.editing":"Editing file","status.executing":"Running command","status.searchingFiles":"Searching files","status.searchingContent":"Searching content","status.executingTask":"Running task","status.fetching":"Fetching web page","status.searching":"Searching the web","status.updatingTasks":"Updating tasks","status.executingTool":"Running {name}","header.compacting":"Compressing context...","header.compacted":"Context compression complete","chatHeader.newConv":"Conversation","chatHeader.compacting":"Compressing context...","chatHeader.compactDone":"Context compression complete","chatHeader.compact":"Compact context","chatHeader.resume":"Resume session","chatHeader.refresh":"Refresh messages","chatHeader.reloadPage":"Reload page","chatHeader.clear":"Clear messages","chatHeader.clearing":"Clearing context...","chatHeader.clearDone":"Context cleared","chatHeader.confirmClear":"Are you sure you want to clear all messages in this conversation?","chatHeader.mcpConfig":"MCP Servers","chatHeader.mcpNeedRestart":"Changes will take effect after restarting the session.","chatHeader.expertPanel":"Expert Panel","chatHeader.subAgentPanel":"Sub-Agents","settings.close":"Close settings","settings.tabs.account":"Account","settings.tabs.security":"Security","settings.tabs.general":"General","settings.tabs.invitations":"Invitations","auth.sessionExpired":"Session expired. Please log in again.","settings.account.username":"Username","settings.account.role":"Role","settings.account.email":"Email","settings.account.emailNotSet":"Not set","settings.account.profileLoadFailed":"Failed to load account profile","settings.account.logout":"Log Out","settings.account.roleAdmin":"Admin","settings.account.rolePro":"Pro","settings.account.linkedAccounts":"Linked Accounts","settings.account.linkedDesc":"Link external sign-in providers so you can log in with any of them.","settings.account.bind":"Link","settings.account.unbind":"Unlink","settings.account.linked":"Linked","settings.account.providerDisabled":"Not configured","settings.account.cantUnbindLast":"Cannot unlink the only login method","settings.account.unbindFailed":"Failed to unlink: {error}","settings.account.bindFailed":"Failed to link account","settings.account.ssoBoundMsg":"Successfully linked {provider}.","settings.account.ssoConflictMsg":"This {provider} account is already linked to another user.","settings.account.providerMicrosoft":"Microsoft","settings.account.providerGithub":"GitHub","settings.account.providerGoogle":"Google","settings.account.providerWechat":"WeChat","settings.account.providerAlipay":"Alipay","settings.security.agentKey":"Agent Secret","settings.security.agentKeyDesc":"Shared secret for Agent connection authentication","settings.security.agentSetupCommands":"Agent setup commands","settings.security.agentCmdInstall":"Install Agent","settings.security.agentCmdService":"Run Agent server","settings.security.agentCmdNeedsSecret":"Generate an Agent Secret first to create the server command.","settings.security.agentCmdLlm":"Manual Copilot fallback","settings.security.agentCmdLlmDesc":"Run the install command first. If an existing GitHub Copilot token is available, Yeaft configures github-copilot/gpt-5.5 automatically; use the Copilot command only as a fallback.","settings.security.none":"None","settings.security.show":"Show","settings.security.hide":"Hide","settings.security.generateKey":"Generate Secret","settings.security.resetKey":"Reset Secret","settings.security.resetting":"Resetting...","settings.security.resetWarning":"All Agents need to be reconfigured after reset","settings.security.changePassword":"Change Password","settings.security.currentPassword":"Current password","settings.security.newPassword":"New password (min 6 characters)","settings.security.confirmPassword":"Confirm new password","settings.security.changeBtn":"Change Password","settings.security.changing":"Changing...","settings.security.enterCurrentPwd":"Please enter your current password","settings.security.newPwdMin":"New password must be at least 6 characters","settings.security.pwdMismatch":"Passwords do not match","settings.security.pwdChanged":"Password changed successfully","settings.security.setPassword":"Set a Password","settings.security.setPasswordDesc":"You signed in via SSO and have no password yet. Set one so you can also log in with username + password.","settings.security.setBtn":"Set Password","settings.security.pwdSet":"Password set successfully","settings.security.deleteAccount":"Delete Account","settings.security.deleteAccountDesc":"Permanently delete your account and all associated data. This cannot be undone.","settings.security.deleteBtn":"Delete Account","settings.security.deleteConfirmBtn":"Confirm Delete","settings.security.deleteConfirmPlaceholder":"Type DELETE to confirm","settings.security.deleteConfirmRequired":"Type DELETE to confirm account removal","settings.security.deleteFailed":"Failed to delete account","settings.security.deleting":"Deleting...","settings.general.theme":"Theme","settings.general.lightTheme":"Light","settings.general.darkTheme":"Dark","settings.general.language":"Language","settings.invite.create":"Create Invite Code","settings.invite.normalUser":"Regular User","settings.invite.proUser":"Pro User","settings.invite.createBtn":"Create Invite","settings.invite.creating":"Creating...","settings.invite.list":"Invite Codes","settings.invite.used":"Used","settings.invite.expired":"Expired","settings.invite.available":"Available","settings.invite.usedBy":"Used by: {user}","settings.invite.expiredAt":"Expired at: {time}","settings.invite.expiresAt":"Expires at: {time}","settings.invite.noInvites":"No invite codes","settings.msg.copiedClipboard":"Copied to clipboard","settings.msg.copyFailed":"Copy failed","settings.msg.keyReset":"Secret has been reset","settings.msg.resetFailed":"Reset failed","settings.msg.changeFailed":"Change failed","settings.msg.inviteCreated":"Invite code created","settings.msg.createFailed":"Create failed","settings.msg.inviteCopied":"Invite code copied","settings.msg.inviteDeleted":"Invite code deleted","settings.msg.deleteFailed":"Delete failed","settings.tabs.llm":"LLM","settings.tabs.yeaft":"Yeaft","yeaft.session.title":"Sessions","yeaft.session.new":"+ New session","yeaft.session.create.title":"New session","yeaft.session.create.subtitle":"Choose where it runs and which provider should handle it.","yeaft.session.create.close":"Close","yeaft.session.create.nameLabel":"Name","yeaft.session.create.namePlaceholder":"Session name (optional)","yeaft.session.create.workDirLabel":"Work Directory","yeaft.session.create.agentLabel":"Agent","yeaft.session.create.vpPicker":"Pick VPs","yeaft.session.create.vpNone":"No VPs selected","yeaft.session.create.vpCount":"{n} VPs selected","yeaft.session.create.untitled":"Untitled session","yeaft.session.create.rosterEmpty":"No VPs available \u2014 create one from the VP Library first.","yeaft.session.create.rosterLoading":"Loading VPs\u2026","yeaft.session.create.rosterError":"VPs could not be loaded from this Agent.","yeaft.session.create.rosterRetry":"Retry","yeaft.vp.domain.general":"General & coordination","yeaft.vp.domain.productDesign":"Product & experience design","yeaft.vp.domain.softwareSystems":"Software & systems","yeaft.vp.domain.securityReliability":"Security & reliability","yeaft.vp.domain.scienceAnalysis":"Science & analysis","yeaft.vp.domain.philosophyPsychology":"Philosophy & psychology","yeaft.vp.domain.strategyHistory":"Strategy & history","yeaft.vp.domain.businessManagement":"Business & management","yeaft.vp.domain.artsCulture":"Arts & culture","yeaft.vp.domain.other":"Other specialties","yeaft.vp.domain.custom":"Custom VPs","yeaft.session.create.defaultVpHint":"The VP that answers when no one is @-mentioned.","yeaft.session.create.folderLabel":"\u{1F4C1} Work directories","yeaft.session.create.sessionLabel":"\u{1F4AC} Sessions in this directory","yeaft.session.create.noWorkDirs":"No prior sessions yet \u2014 pick or type a work directory above.","yeaft.session.create.back":"Back","yeaft.session.create.creating":"Creating\u2026","yeaft.session.create.submit":"Create","yeaft.onboarding.ariaLabel":"Yeaft getting started guide","yeaft.onboarding.topbarTitle":"Get started with Yeaft","yeaft.onboarding.eyebrow":"Yeaft setup guide","yeaft.onboarding.title":"Connect an Agent before chatting","yeaft.onboarding.subtitle":"Run these commands on the machine that should execute tools. The agent secret is generated automatically for your account if it does not exist yet.","yeaft.onboarding.createSession":"Create or restore Session","yeaft.onboarding.configureLlm":"Open LLM settings","yeaft.onboarding.secretLoading":"Generating agent secret\u2026","yeaft.onboarding.secretError":"Failed to load agent secret.","yeaft.onboarding.secretPending":"<loading-agent-secret>","yeaft.onboarding.installTitle":"Install yeaft-agent","yeaft.onboarding.installDesc":"Install the command-line Agent package.","yeaft.onboarding.connectTitle":"Connect this Agent","yeaft.onboarding.connectDesc":"The command below uses this server URL and your generated secret.","yeaft.onboarding.llmTitle":"Use GitHub Copilot","yeaft.onboarding.llmDesc":"Authenticate GitHub CLI, then select gpt-5.5 as the default Yeaft model.","yeaft.restore.modal.empty":"No yeaft sessions found in this directory","yeaft.restore.modal.scanError":"Failed to scan: {message}","yeaft.restore.modal.restoreError":"Failed to restore: {message}","settings.llm.noAgent":"Please select an Agent first to manage LLM configuration.","settings.llm.agentOffline":"Agent is currently offline. LLM configuration will load when the agent comes online.","settings.llm.loading":"Loading configuration...","settings.llm.loadError":"Failed to load configuration","settings.llm.configureAgent":"Configure this agent LLM","settings.llm.configureMenu":"LLM Settings","settings.llm.simpleCopilotTitle":"Recommended: GitHub Copilot","settings.llm.useGitHubCopilot":"Use GitHub Copilot","settings.llm.refreshingModels":"Refreshing models...","settings.llm.managedCopilotTitle":"Managed GitHub Copilot","settings.llm.managedCopilotDesc":"Base URL, authentication, model catalog, and per-model API protocol are managed automatically. Claude models use Anthropic Messages; GPT/o models use OpenAI Responses.","settings.llm.providersTitle":"Providers","settings.llm.testFailed":"Connection test failed","settings.llm.saveSuccess":"LLM settings saved","settings.llm.saveFailed":"Failed to save LLM settings","settings.llm.presets.title":"Quick setup","settings.llm.providersDesc":"Choose a provider, save it, and use it in Sessions.","settings.llm.agentProviders":"This agent providers","settings.llm.agentBadge":"This agent","settings.llm.addProvider":"Add Provider","settings.llm.addFromPreset":"Add from Catalog","settings.llm.preset.title":"Provider Catalog (models.dev)","settings.llm.preset.refresh":"Refresh catalog","settings.llm.preset.loading":"Loading catalog\u2026","settings.llm.preset.empty":"No providers available.","settings.llm.preset.pickProvider":"Pick a provider on the left to see its models.","settings.llm.preset.filterProviders":"Filter providers\u2026","settings.llm.preset.filterModels":"Filter models\u2026","settings.llm.preset.selectAll":"Select all","settings.llm.preset.selectNone":"Clear","settings.llm.preset.cancel":"Cancel","settings.llm.preset.add":"Add to providers","settings.llm.preset.fetchedAt":"Catalog updated {minutes}m ago","settings.llm.addModel":"Add Model","settings.llm.removeModel":"Remove Model","settings.llm.providerName":"Name","settings.llm.providerNamePlaceholder":"e.g. my-proxy","settings.llm.baseUrl":"Base URL","settings.llm.baseUrlPlaceholder":"e.g. http://localhost:6628/v1","settings.llm.apiKey":"API Key","settings.llm.apiKeyPlaceholder":"Enter API key","settings.llm.protocol":"Protocol","settings.llm.protocolOpenAI":"OpenAI Compatible","settings.llm.protocolOpenAIResponses":"OpenAI Responses (GPT-5)","settings.llm.protocolAnthropic":"Anthropic Native","settings.llm.protocolHint.anthropic":"Claude native Messages API.","settings.llm.protocolHint.openai":"Chat Completions /v1/chat/completions \u2014 GPT-4 and most compatible proxies.","settings.llm.protocolHint.openaiResponses":"Responses API /v1/responses \u2014 required for GPT-5 series.","settings.llm.modelCtxPlaceholder":"ctx","settings.llm.modelMaxPlaceholder":"max","settings.llm.models":"Candidate Model IDs","settings.llm.modelsPlaceholder":"Model IDs, comma or newline separated, e.g. claude-sonnet-4-20250514, gpt-5","settings.llm.modelsHint":"Comma or newline separated.","settings.llm.removeProvider":"Remove","settings.llm.modelSelectionTitle":"Model Selection","settings.llm.modelSelectionDesc":"Choose the default models.","settings.llm.primaryModel":"Primary Model","settings.llm.primaryModelDesc":"Used for user-facing conversations","settings.llm.fastModel":"Fast Model","settings.llm.fastModelDesc":"Used for internal tasks (memory, consolidation)","settings.llm.noModels":"No models available. Add a provider first.","settings.llm.selectModel":"Select a model...","settings.llm.save":"Save Changes","settings.llm.saving":"Saving...","settings.llm.saved":"Configuration saved","settings.llm.savedRefreshWarning":"Configuration was saved, but the live model catalog could not refresh: {error}","settings.llm.unsavedChanges":"You have unsaved changes","settings.llm.confirmRemoveProvider":"Remove this provider?","settings.llm.setupTitle":"Connect a model","settings.llm.setupDesc":"GitHub Copilot is recommended. You can also add your own API provider.","settings.llm.providerSectionHint":"Only the fields required to connect a model.","settings.tabs.dashboard":"Dashboard","settings.dashboard.totalUsers":"Total Users","settings.dashboard.onlineUsers":"Online Users","settings.dashboard.onlineAgents":"Online Agents","settings.dashboard.totalSessions":"Total Sessions","settings.dashboard.todayActive":"Today Active","settings.dashboard.todayMessages":"Today Messages","settings.dashboard.todayUserTurns":"Today User Turns","settings.dashboard.totalTokens":"Total Tokens","settings.dashboard.tokenAccuracy":"Provider-reported usage, accumulated from the version that enabled per-user token tracking. Heartbeats are excluded.","settings.dashboard.agentTurns":"Agent Turns","settings.dashboard.agentSessions":"Agent Sessions","settings.dashboard.turns":"Turns","settings.dashboard.tokens":"Tokens","settings.dashboard.inputTokens":"Input","settings.dashboard.outputTokens":"Output","settings.dashboard.cacheTokens":"Cache","settings.dashboard.today":"Today","settings.dashboard.thisWeek":"This Week","settings.dashboard.thisMonth":"This Month","settings.dashboard.all":"All","settings.dashboard.userUsage":"User Usage","settings.dashboard.agentList":"Agent List","settings.dashboard.onlineUserList":"Online Users","settings.dashboard.refresh":"Refresh","settings.dashboard.name":"Name","settings.dashboard.messages":"Messages","settings.dashboard.userTurns":"User Turns","settings.dashboard.sessions":"Sessions","settings.dashboard.requests":"Requests","settings.dashboard.traffic":"Traffic","settings.dashboard.lastLogin":"Last Login","settings.dashboard.status":"Status","settings.dashboard.latency":"Latency","settings.dashboard.version":"Version","settings.dashboard.owner":"Owner","settings.dashboard.role":"Role","settings.dashboard.agent":"Agent","settings.dashboard.online":"Online","settings.dashboard.offline":"Offline","settings.dashboard.noAgents":"No agents registered","settings.dashboard.noUserData":"No user data","settings.dashboard.noOnlineUsers":"No users online","settings.dashboard.loading":"Loading...","settings.dashboard.error":"Failed to load data","settings.dashboard.ago":"{time} ago","settings.dashboard.loadMore":"Load more ({remaining} remaining)","workbench.maximize":"Maximize panel","workbench.restore":"Restore panel","workbench.collapse":"Collapse panel","theme.switchToLight":"Switch to light theme","theme.switchToDark":"Switch to dark theme","theme.toLight":"Switch to light theme","theme.toDark":"Switch to dark theme","terminal.splitH":"Split horizontally (left-right)","terminal.splitV":"Split vertically (top-bottom)","terminal.close":"Close current terminal","terminal.autoCreate":"A terminal will be created when you switch to the Terminal tab","terminal.xtermError":"xterm.js not loaded, please refresh the page","terminal.xtermNotLoaded":"xterm.js not loaded, please refresh the page","terminal.mountError":"Terminal container mount failed","terminal.mountFailed":"Terminal container mount failed","terminal.createError":"Terminal creation failed","terminal.createFailed":"Terminal creation failed","terminal.error":"Terminal error","git.selectFolder":"Select folder","git.repoPath":"Enter Git repository path...","git.repoPathPlaceholder":"Enter Git repository path...","git.workDir":"Git working directory","git.loadStatus":"Load Git status","git.loading":"Loading Git status...","git.loadingStatus":"Loading Git status...","git.clean":"Working directory clean, no changes","git.cleanWorkDir":"Working directory clean, no changes","git.selectAgent":"Select an Agent to load Git status","git.selectAgentFirst":"Select an Agent to load Git status","git.diffOnly":"Diff only","git.fullFile":"Full file","git.zoomIn":"Zoom in","git.zoomOut":"Zoom out","git.loadingDiff":"Loading Diff...","git.clickToView":"Click a file to view diff","git.clickFileToView":"Click a file to view diff","git.selectRepo":"Select Git Repository","git.noDiff":"(No differences)","git.binaryFile":"(Binary file)","files.notLoaded":"Not loaded","files.newFile":"New File","files.newFolder":"New Folder","files.collapseAll":"Collapse All","files.openFolder":"Open Folder","files.deleteSelected":"Delete selected","files.moveSelected":"Move selected","files.enterPath":"Enter path...","files.searchFiles":"Search files... (Ctrl+P)","files.noMatch":"No matches found","files.searching":"Searching...","files.loadingTree":"Loading...","files.emptyDir":"Empty directory","files.loadingFile":"Loading file...","files.searchPlaceholder":"Search...","files.replacePlaceholder":"Replace...","files.replace":"Replace","files.replaceAll":"All","files.replaceCurrent":"Replace current","files.replaceAllTitle":"Replace all","files.clickToView":"Click a file to view content","files.selectFolder":"Select Folder","files.enterFolderName":"Enter folder name...","files.enterFileName":"Enter file name...","files.moveTarget":"Enter target directory path...","files.moveItems":"Move {count} item(s) to the specified directory","files.workDir":"Work directory: {dir}","files.enterDirPath":"Enter directory path...","files.unsavedConfirm":'"{name}" has unsaved changes. Close anyway?',"files.deleteConfirm":'Are you sure you want to delete "{name}"?',"files.deleteDirHint":" (this will delete the folder and all its contents)","files.deleteSelectedConfirm":"Are you sure you want to delete {count} selected item(s)? This action cannot be undone.","files.findPrev":"Previous (Shift+Enter)","files.findNext":"Next (Enter)","files.caseSensitive":"Case sensitive","files.regex":"Regular expression","files.unsaved":"Unsaved","files.clearSelection":"Clear selection","files.rename":"Rename","files.copyHere":"Copy","files.moveTo":"Move to...","files.download":"Download","files.enterNewName":"Enter new name...","files.loadingPreview":"Loading preview...","files.preview":"Preview","files.edit":"Edit","files.pptxNotSupported":"PPTX local preview is not supported. Please switch to Office Online mode in Settings.","files.officePreviewMode":"Office Preview Mode","files.officeOnline":"Office Online","files.localRender":"Local Rendering","proxy.port":"Port","proxy.label":"Label","proxy.add":"Add port mapping","proxy.addPort":"Add port mapping","proxy.enable":"Click to enable","proxy.clickEnable":"Click to enable","proxy.disable":"Click to disable","proxy.clickDisable":"Click to disable","proxy.openNewTab":"Open in new tab","proxy.openInBrowser":"Open in new tab","proxy.noMappings":"No port mappings","proxy.noPorts":"No port mappings","proxy.hint":"After adding ports, you can access local services on the agent machine through proxy URLs","proxy.noPortsHint":"After adding ports, you can access local services on the agent machine through proxy URLs","proxy.selectAgent":"Please select an Agent first","store.selectAgent":"Please select an Agent first","store.creatingConv":"Creating conversation...","store.loadingHistory":"Loading conversation history...","store.executionCancelled":"Execution cancelled","store.loginFailed":"Login failed","store.convClosed":"Conversation closed","store.convCreated":"New conversation created [{agent}], work directory: {workDir}","store.convResumed":"Conversation resumed [{agent}]: {sessionId}","roleplay.creating":"Creating Role Play session...","roleplay.working":"Working","roleplay.selectTeam":"Select team template","roleplay.teamDev":"Software Dev","roleplay.teamCustom":"Custom","roleplay.editRoles":"Edit Roles","roleplay.roleName":"Role ID","roleplay.roleDisplayName":"Display Name","roleplay.roleIcon":"Icon","roleplay.roleDesc":"Role Description","roleplay.rolePrompt":"Role Prompt","roleplay.removeRole":"Remove Role","roleplay.addRole":"Add Role","roleplay.start":"Start Role Play","roleplay.sidebarTitle":"Role Play","roleplay.configTitle":"Role Play","roleplay.newSession":"New Role Play","roleplay.emptyHint":"Send a message to start multi-role collaboration","roleplay.askingYou":"is asking you","roleplay.language":"Language","roleplay.rolePreview":"Role Configuration","roleplay.noAgents":"No online agents available","roleplay.inputPlaceholder":"Type a message\u2026 Use @ to mention a role","roleplay.existingSessions":"Existing Teams","roleplay.restore":"Restore","roleplay.restoring":"Restoring Role Play session...","roleplay.createNew":"Create New Team","expertPanel.title":"Expert Panel","expertPanel.search":"Search roles or actions...","expertPanel.noResults":"No results","expertPanel.clearAll":"Clear","expertPanel.persona":"Persona Prompt","expertPanel.template":"With Input \xB7 Prefix","expertPanel.templateHint":"When user types text: this prefix + user text = final prompt","expertPanel.defaultMsg":"No Input \xB7 Full Prompt","expertPanel.defaultMsgHint":"When user sends without typing: this full prompt is used as-is","expertPanel.loading":"Loading role definitions...","expertPanel.viewPrompt":"View prompt","expertPanel.customRoles":"Custom Roles","expertPanel.addRole":"Add role","expertPanel.editRole":"Edit role","expertPanel.deleteRole":"Delete role","expertPanel.noCustomRoles":"No custom roles yet","expertPanel.createFirst":"Create your first custom role","expertPanel.noActions":"No actions defined","expertPanel.deleteConfirm":'Delete role "{name}"? This cannot be undone.',"expertPanel.deleteConfirmBtn":"Delete","expertEditor.createTitle":"Create Custom Role","expertEditor.editTitle":"Edit Custom Role","expertEditor.basicInfo":"Basic Info","expertEditor.roleName":"Role Name","expertEditor.roleNamePlaceholder":"e.g. Data Analyst","expertEditor.roleTitle":"Title","expertEditor.roleTitlePlaceholder":"e.g. Senior Data Analyst","expertEditor.fullName":"Full Name","expertEditor.fullNamePlaceholder":"Optional","expertEditor.titleEn":"English Title","expertEditor.titleEnPlaceholder":"Optional","expertEditor.rolePrompt":"Role Prompt","expertEditor.messagePrefix":"Message Prefix (Chinese)","expertEditor.messagePrefixPlaceholder":"e.g. As a senior data analyst, ","expertEditor.messagePrefixEn":"Message Prefix (English)","expertEditor.messagePrefixEnPlaceholder":"As a senior data analyst, ","expertEditor.actions":"Actions","expertEditor.addAction":"Add Action","expertEditor.removeAction":"Remove","expertEditor.actionName":"Action Name","expertEditor.actionNamePlaceholder":"e.g. Data Analysis","expertEditor.actionNameEn":"English Name","expertEditor.actionNameEnPlaceholder":"Optional","expertEditor.messageTemplate":"With Input \xB7 Prefix (Chinese)","expertEditor.messageTemplatePlaceholder":"Prepended to user text when user types something","expertEditor.messageTemplateEn":"With Input \xB7 Prefix (English)","expertEditor.messageTemplateEnPlaceholder":"Prepended to user text when user types something","expertEditor.defaultMessage":"No Input \xB7 Full Prompt (Chinese)","expertEditor.defaultMessagePlaceholder":"Used as-is when user sends without typing","expertEditor.defaultMessageEn":"No Input \xB7 Full Prompt (English)","expertEditor.defaultMessageEnPlaceholder":"Used as-is when user sends without typing","expertEditor.cancel":"Cancel","expertEditor.save":"Save","expertEditor.saving":"Saving...","subAgentPanel.title":"Sub-Agents","subAgentPanel.back":"Back to list","subAgentPanel.running":"Running","subAgentPanel.completed":"Completed","subAgentPanel.waitingMessages":"Waiting for messages...","subAgentPanel.toolCount":"{count} tools","subAgentPanel.toolSummary":"{count} tool calls completed","subAgentPanel.empty":"No sub-agents","subAgentPanel.emptyHint":"Sub-agents will appear here when Claude delegates tasks","splitScreen.split":"Split screen","splitScreen.closePane":"Close pane","splitScreen.newChat":"New Chat","splitScreen.noSessions":"No sessions","splitScreen.splitToPanel":"Open in new panel","splitScreen.selectFromSidebar":"Select a conversation from the sidebar","yeaft.vp.library":"VP Library","yeaft.vp.createFirst":"+ Create your first role","yeaft.vp.empty.aria":"No virtual persons yet","yeaft.vp.avatar.aria":"{name} avatar","yeaft.vp.speaker.stateCauseAria":"State change: {cause}","yeaft.vp.status.thinking":"thinking\u2026","yeaft.vp.status.tool":"using {name}","yeaft.vp.status.done":"done \xB7 {count} tools","yeaft.vp.status.aborted":"aborted","yeaft.vp.crud.title":"VP Library","yeaft.vp.crud.close":"Close","yeaft.vp.crud.addNew":"+ New role","yeaft.vp.crud.empty":"No virtual persons yet. Create your first role to start collaborating.","yeaft.vp.crud.edit":"Edit","yeaft.vp.crud.delete":"Delete","yeaft.vp.crud.deleteConfirm":'Delete "{name}"? This removes the role.md file on disk.',"yeaft.vp.crud.form.create":"Create role","yeaft.vp.crud.form.update":"Edit role","yeaft.vp.crud.form.vpId":"VP id","yeaft.vp.crud.form.vpId.tooltip":'Letters / digits / - / _ only. Cannot start with "_", cannot be all digits, cannot be one of: all, user, system, everyone.',"yeaft.vp.crud.form.displayName":"Display name (English)","yeaft.vp.crud.form.displayNameZh":"Display name (Chinese)","yeaft.vp.crud.form.description":"Capability description (English)","yeaft.vp.crud.form.descriptionZh":"Capability description (Chinese)","yeaft.vp.crud.form.descriptionPlaceholder":"e.g. API design, migration planning, and compatibility reviews","yeaft.vp.crud.form.descriptionZhPlaceholder":"\u4F8B\u5982\uFF1AAPI \u8BBE\u8BA1\u3001\u8FC1\u79FB\u89C4\u5212\u4E0E\u517C\u5BB9\u6027\u8BC4\u5BA1","yeaft.vp.crud.form.role":"Role","yeaft.vp.crud.form.rolePlaceholder":"e.g. Product Manager","yeaft.vp.crud.form.traits":"Traits","yeaft.vp.crud.form.traitsHint":"Comma-separated short tags (e.g. curious, pragmatic).","yeaft.vp.crud.form.modelHint":"Model hint","yeaft.vp.crud.form.modelHint.none":"\u2014 default \u2014","yeaft.vp.crud.form.modelHint.primary":"primary","yeaft.vp.crud.form.modelHint.fast":"fast","yeaft.vp.crud.form.persona":"Persona (markdown)","yeaft.vp.crud.form.personaPlaceholder":"Describe how this role should think, speak, and decide...","yeaft.vp.crud.form.submit":"Save","yeaft.vp.crud.form.cancel":"Cancel","yeaft.vp.crud.form.ok":"Looks good","yeaft.vp.crud.form.idLocked":"VP id cannot be changed after creation.","yeaft.vp.crud.saving":"Saving\u2026","yeaft.vp.crud.saveFailed":"Save failed: {error}","yeaft.vp.crud.deleteFailed":"Delete failed: {error}","yeaft.vp.crud.viewPrompt":"View prompt","yeaft.vp.crud.view.title":"VP prompt","yeaft.vp.crud.view.personaEmpty":"(no persona body \u2014 only metadata is defined)","yeaft.vp.crud.view.back":"Back","yeaft.vp.crud.view.editFromHere":"Edit this VP","yeaft.vp.crud.view.removed":"This VP was removed elsewhere \u2014 returning to the list.","yeaft.vp.crud.stockBadge":"Stock","yeaft.vp.crud.stockReadOnly":"Stock VPs ship with the agent and cannot be edited or deleted.","yeaft.vp.idError.empty_or_non_string":"VP id is required.","yeaft.vp.idError.too_long":"VP id is too long (max 40 characters).","yeaft.vp.idError.illegal_character":'Only letters, digits, "-" and "_" are allowed.',"yeaft.vp.idError.underscore_prefix_reserved":'VP id cannot start with "_" (reserved for system roles).',"yeaft.vp.idError.pure_digits":"VP id cannot be all digits.","yeaft.vp.idError.reserved":"VP id cannot be one of the reserved names (all, user, system, everyone).","yeaft.vp.idError.duplicate":"A role with this VP id already exists.","yeaft.vp.idError.not_found":"This VP does not exist \u2014 it may have been deleted.","yeaft.vp.idError.stock_readonly":"Stock VPs cannot be edited or deleted.","yeaft.vp.idError.unknown":"An unexpected error occurred. Please try again.","yeaft.vp.reason.personaEdit":"Persona updated","yeaft.vp.reason.traitsEdit":"Traits updated","yeaft.vp.reason.manualReload":"Reloaded","yeaft.vp.reason.fileRemoved":"Removed","yeaft.vp.reason.toast.updated":"{name}: {reason}","yeaft.vp.reason.toast.removed":"{name} was removed","yeaft.message.timeAria":"Sent at {time}","yeaft.user.youLabel":"You","yeaft.session.sidebarTitle":"Sessions","yeaft.session.sidebarAria":"Sessions section","yeaft.session.newButton":"+ New session","yeaft.session.newButtonAria":"Create a new session","yeaft.session.defaultName":"Default","yeaft.session.moreActions":"More actions","yeaft.session.archivingEllipsis":"Archiving\u2026","yeaft.session.deletingEllipsis":"Deleting\u2026","yeaft.session.renamingEllipsis":"Renaming\u2026","yeaft.session.empty":"No sessions yet.","yeaft.session.membersCount":"{count} members","yeaft.session.oneMember":"1 member","yeaft.session.noMembers":"Empty \u2014 invite a VP","yeaft.session.defaultBadge":"default","yeaft.session.archive":"Archive","yeaft.session.archiveConfirm":'Archive "{name}"? You can recover it from disk later.',"yeaft.session.delete":"Delete","yeaft.session.deleteConfirm":'Delete "{name}"? This permanently removes the session and all its data \u2014 this cannot be undone.',"yeaft.session.rename":"Rename","yeaft.session.openSettings":"Settings","yeaft.session.removeFromList":"Remove","yeaft.session.manageMembers":"Manage members","yeaft.session.memberCount.one":"1 member","yeaft.session.memberCount.other":"{count} members","yeaft.session.renamePrompt":'New name for "{name}":',"yeaft.session.editModal.renameTitle":"Rename session","yeaft.session.editModal.renameBody":'Choose a new name for "{name}".',"yeaft.session.editModal.renameSubmit":"Save","yeaft.session.editModal.archiveTitle":"Archive session","yeaft.session.editModal.archiveBody":'Archive "{name}"? You can recover it from disk later.',"yeaft.session.editModal.archiveSubmit":"Archive","yeaft.session.editModal.deleteTitle":"Delete session","yeaft.session.editModal.deleteBody":'Delete "{name}"? This permanently removes the session and all its data \u2014 this cannot be undone.',"yeaft.session.editModal.deleteSubmit":"Delete","yeaft.session.editModal.newNameLabel":"New name","yeaft.session.editModal.cancel":"Cancel","yeaft.session.editModal.close":"Close","yeaft.session.error.invalid_name":"Session name cannot be empty.","yeaft.session.error.duplicate":"A session with this id already exists.","yeaft.session.error.not_found":"Session not found.","yeaft.session.error.default_not_in_roster":"The default VP must be in the roster.","yeaft.session.error.no_default_vp":"This session has no members. Add a VP from the library to start chatting.","yeaft.session.error.reserved":"One of the selected ids is reserved (all, user, system, everyone).","yeaft.session.error.unknown":"Session operation failed: {message}","yeaft.session.error.timeout":"Session operation timed out \u2014 try again.","yeaft.session.invite.title":"Invite a VP","yeaft.session.invite.body":'"{name}" has no members yet. Add a VP from your library to start chatting.',"yeaft.session.invite.openLibrary":"Open VP Library","yeaft.session.invite.dismiss":"Not now","yeaft.session.empty.title":"Empty session","yeaft.session.empty.hint":'"{name}" has no members yet. Add a VP to start chatting.',"yeaft.session.empty.cta":"Manage members","yeaft.session.members.title":'Manage members of "{name}"',"yeaft.session.members.aria":"Session members manager","yeaft.session.members.close":"Close","yeaft.session.members.done":"Done","yeaft.session.members.empty":"No VPs available \u2014 create one in the VP Library first.","yeaft.session.members.loading":"Loading VPs\u2026","yeaft.session.members.defaultHint":"Default VP (replies when no @mention is given)","yeaft.session.members.memberCount":"{count} selected","yeaft.session.members.actionFailed":"Action failed: {error}","yeaft.session.members.openLibrary":"Open VP Library","yeaft.session.members.openLibraryHint":"Create a new VP or view a VP's prompt.","yeaft.session.announcement.label":"Announcement","yeaft.session.announcement.hintEmpty":"No announcement \u2014 click \u270F\uFE0F to add one.","yeaft.session.announcement.emptyBody":"No announcement set. Add a message that every VP in this session will see at the top of its system prompt \u2014 useful for shared context, ground rules, or a CLAUDE.md-style brief.","yeaft.session.announcement.placeholder":"Write a shared briefing for all VPs in this session\u2026","yeaft.session.announcement.edit":"Edit announcement","yeaft.session.announcement.editTitle":"Edit session announcement","yeaft.session.announcement.saving":"Saving\u2026","yeaft.session.announcement.saveFailed":"Save failed: {error}","yeaft.session.announcement.openSettings":"Open session settings","yeaft.session.settings.title":"{name} \u2014 session settings","yeaft.session.settings.short":"Session","yeaft.session.settings.close":"Close","yeaft.session.settings.nav.session":"Session","yeaft.session.settings.nav.members":"Members","yeaft.session.settings.nav.memory":"Memory","yeaft.session.settings.announcement.heading":"Session announcement","yeaft.session.settings.announcement.help":"Shared at the top of every VP's system prompt while in this session. Like a CLAUDE.md for the team.","yeaft.session.settings.members.heading":"Members","yeaft.session.settings.rename.heading":"Rename session","yeaft.session.settings.rename.label":"New name","yeaft.session.settings.rename.save":"Save name","yeaft.session.settings.rename.saving":"Saving\u2026","yeaft.session.settings.memory.heading":"Session memory","yeaft.session.settings.memory.help":"Run the dream consolidation now. Reads new messages since the last run, extracts facts, and merges them into the session's summary so the Resident layer reflects the latest conversation.","yeaft.session.settings.memory.runNow":"Run dream now","yeaft.session.settings.memory.running":"Running\u2026","yeaft.session.settings.memory.lastSuccess":"Last run {time} \u2014 {count} target(s) updated.","yeaft.session.settings.memory.lastError":"Last run failed: {error}","yeaft.session.settings.danger.heading":"Delete session","yeaft.session.settings.danger.deleteHelp":"This permanently deletes the session, removing session.json and all message history on disk. It cannot be undone.","yeaft.session.settings.danger.deleteBtn":"Delete session","yeaft.vp.mention.placeholder":"Search role by id or name\u2026","yeaft.vp.mention.noMatch":"No matching role","yeaft.vp.mention.count":"{count} mentions","yeaft.feature.reject.missing_group_id":"Message send failed: session not specified.","yeaft.feature.reject.missing_feature_id":"Message send failed: task context lost.","yeaft.feature.reject.missing_vp_id":"Message send failed: speaker not set.","yeaft.feature.reject.invalid_vp_id":"Message send failed: invalid speaker id.","yeaft.feature.reject.empty_text":"Message send failed: empty message.","yeaft.feature.reject.text_too_long":"Message send failed: text too long (max 16 KiB).","yeaft.feature.reject.unknown":"Message send failed.","yeaft.feature.pill.label":"task","yeaft.feature.messageTime.aria":"Sent at {time}","yeaft.vp.turnBlock.elapsedTitle":"Time elapsed since this turn started","yeaft.vp.turnBlock.retryingRequest":"Response stalled; retrying with a fresh request ({attempt}/{max})","yeaft.vp.turnBlock.retryingContinue":"Response stalled; continuing with a fresh request ({attempt}/{max})","yeaft.sessionStatus.aria":"Session status","yeaft.sessionStatus.title":"Session status","yeaft.sessionStatus.announcement":"Announcement","yeaft.sessionStatus.announcementEmpty":"No announcement","yeaft.sessionStatus.announcementAdd":"Add announcement","yeaft.sessionStatus.announcementEdit":"Edit announcement","yeaft.sessionStatus.vps":"VPs","yeaft.sessionStatus.backgroundTasks":"Background tasks","yeaft.sessionStatus.noLogPreview":"No log output yet.","yeaft.sessionStatus.task.subAgentStarted":"{name} started","yeaft.sessionStatus.task.subAgentStartedWithMission":"{name} started: {mission}","yeaft.sessionStatus.task.subAgentStatus":"{name} is {status}","yeaft.sessionStatus.task.subAgentStatusUpdated":"{name} status updated","yeaft.sessionStatus.task.subAgentResult":"{name} result: {text}","yeaft.sessionStatus.task.subAgentProducedResult":"{name} produced a result","yeaft.sessionStatus.task.subAgentUsedTool":"{name} used {tool}","yeaft.sessionStatus.task.subAgentFinishedTool":"{name} finished {tool}","yeaft.sessionStatus.task.subAgentUsage":"{name} used {tokens} tokens","yeaft.sessionStatus.task.subAgentEvent":"{name}: {text}","yeaft.sessionStatus.task.subAgentUserPrompt":"You: {text}","yeaft.sessionStatus.task.subAgentToolSummary":"{count} tool calls completed","yeaft.sessionStatus.task.subAgentError":"{name} error: {error}","yeaft.sessionStatus.task.subAgentHitError":"{name} hit an error","yeaft.sessionStatus.task.subAgentNoReadableEvents":"No readable sub-agent activity yet.","yeaft.sessionStatus.task.promptPlaceholder":"Add guidance for this sub-agent\u2026","yeaft.sessionStatus.task.promptSend":"Send","yeaft.sessionStatus.task.promptSending":"Sending\u2026","yeaft.sessionStatus.task.promptFailed":"Failed to send prompt.","yeaft.sessionStatus.task.title":"Task","yeaft.sessionStatus.task.command":"Command","yeaft.sessionStatus.task.stop":"Stop task","yeaft.sessionStatus.task.stopping":"Stopping\u2026","yeaft.sessionStatus.task.kind.subAgent":"sub-agent","yeaft.sessionStatus.task.kind.shell":"shell","yeaft.sessionStatus.show":"Show Session status","yeaft.sessionStatus.hide":"Hide Session status","yeaft.sessionStatus.close":"Close Session status","yeaft.vpTimeline.empty":"No VPs in this Session yet.","yeaft.vpTimeline.resizeTitle":"Drag to resize","yeaft.vpTimeline.status.idle":"idle","yeaft.vpTimeline.status.typing":"typing\u2026","yeaft.vpTimeline.status.thinking":"thinking\u2026","yeaft.vpTimeline.status.retrying":"retrying request\u2026","yeaft.vpTimeline.status.streaming":"streaming","yeaft.vpTimeline.status.tool":"using tool\u2026","yeaft.vpTimeline.status.error":"error","yeaft.vpTimeline.status.offline":"offline","yeaft.vpTimeline.abort":"Abort","yeaft.vpTimeline.edit":"Edit VP","yeaft.vpTimeline.mention":"Click to @-mention this VP","yeaft.vpTimeline.expand":"Toggle task details","yeaft.toolStats.title":"Tool Usage Stats","yeaft.toolStats.refresh":"Refresh","yeaft.toolStats.close":"Close","yeaft.toolStats.tabAll":"All tools","yeaft.toolStats.tabUnused":"Unused","yeaft.toolStats.loading":"Loading\u2026","yeaft.toolStats.notLoaded":"No data yet \u2014 click refresh.","yeaft.toolStats.empty":"(no tool calls recorded yet)","yeaft.toolStats.noneUnused":"(every registered tool has been called at least once)","yeaft.toolStats.fetchedAt":"Fetched at","yeaft.toolStats.col.name":"Tool","yeaft.toolStats.col.calls":"Calls","yeaft.toolStats.col.errors":"Errors","yeaft.toolStats.col.errRate":"Err%","yeaft.toolStats.col.p50":"p50","yeaft.toolStats.col.p95":"p95","yeaft.toolStats.col.avg":"Avg","yeaft.toolStats.col.last":"Last","yeaft.toolStats.buttonLabel":"Tool Stats","workCenter.title":"Work Center","workCenter.subtitle":"Persistent work owned by this Agent","workCenter.agent":"Agent","workCenter.selectAgent":"Select Agent","workCenter.noOnlineAgents":"No online agents","workCenter.noAvailableAgents":"No compatible online Agents","workCenter.new":"New","workCenter.newWorkItem":"New work item","workCenter.workItem":"Work item","workCenter.createFirst":"Create first work item","workCenter.backToChat":"Back to chat","workCenter.refresh":"Refresh","workCenter.search":"Search work items","workCenter.filter":"Filter","workCenter.filterAttention":"Needs attention","workCenter.filterActive":"Active","workCenter.filterAll":"All","workCenter.filterDone":"Done","workCenter.attentionItems":"Needs attention","workCenter.board.active":"Active","workCenter.board.needsAttention":"Needs attention","workCenter.board.closed":"Closed","workCenter.board.emptyLane":"No work items","workCenter.board.lanes":"Work item lanes","workCenter.filterVp":"Filter by VP","workCenter.filterType":"Filter by type","workCenter.filterUpdated":"Filter by update time","workCenter.allVps":"All VPs","workCenter.allTypes":"All types","workCenter.anyTime":"Any time","workCenter.lastDay":"Last 24 hours","workCenter.lastWeek":"Last 7 days","workCenter.deleteWorkItem":"Delete Work Item","workCenter.deleteConfirm":"Permanently delete this Work Item, its execution history, and attachments?","workCenter.deleteRequiresStop":"Stop this Work Item before deleting it","workCenter.lastMonth":"Last 30 days","workCenter.assignment.planned":"Planned assignment","workCenter.created":"Created","workCenter.files":"files","workCenter.loadMore":"Load more","workCenter.activeItems":"Active work","workCenter.allItems":"All work items","workCenter.completedItems":"Completed","workCenter.watcherActive":"Watcher active","workCenter.loading":"Loading work items\u2026","workCenter.noTimestamp":"No timestamp","workCenter.updated":"Updated","workCenter.emptyTitle":"No work items yet","workCenter.emptyBody":"Create a persistent task when work must continue beyond one conversation turn.","workCenter.noAttentionTitle":"Nothing needs attention","workCenter.noAttentionBody":"Work Items waiting for you or needing recovery will appear here.","workCenter.noActiveTitle":"No active work items","workCenter.noActiveBody":"Draft, ready, and running Work Items will appear here.","workCenter.noCompletedTitle":"No completed work items","workCenter.noCompletedBody":"Completed work items will appear here.","workCenter.noMatchesTitle":"No matching work items","workCenter.noMatchesBody":"Try a different search or filter.","workCenter.selectTitle":"Work item details","workCenter.detailLoading":"Loading full details\u2026","workCenter.detailLoadFailed":"Could not load full details","workCenter.start":"Start","workCenter.retry":"Retry","workCenter.cancel":"Cancel","workCenter.closeWorkItem":"Close details","workCenter.cancelWorkItem":"Stop work item","workCenter.cancelWorkItemHint":"Stop this Work Item and all unfinished Actions.","workCenter.cancelConfirm":"Stop this work item and its unfinished Actions?","workCenter.stopWorkItem":"Stop work item","workCenter.resumeWorkItem":"Resume work item","workCenter.breadcrumbs":"Work Center navigation","workCenter.actionNumber":"Action {number}","workCenter.actionBreadcrumb":"Action {number}: {description}","workCenter.untitledAction":"Untitled Action","workCenter.workItems":"Work items","workCenter.description":"Description","workCenter.goal":"Goal","workCenter.acceptanceCriteria":"Acceptance criteria","workCenter.noCriteria":"No criteria provided","workCenter.failureReason":"Failure reason","workCenter.workflow":"Workflow","workCenter.triageSummary":"Triage summary","workCenter.actionFlow":"Action flow","workCenter.viewActions":"View Actions","workCenter.actionsPanel":"Actions","workCenter.closeActions":"Close Actions","workCenter.actionCount":"{count} Actions","workCenter.noActionSummary":"No summary yet","workCenter.actionProgress":"{completed} / {total} Actions","workCenter.currentAction":"Current Action","workCenter.expandActions":"Show Actions","workCenter.collapseActions":"Collapse","workCenter.actionObjective":"What to do","workCenter.actionApproach":"How to do it","workCenter.actionExpectedOutcome":"Expected result","workCenter.dependencies":"Dependencies","workCenter.actionResult":"Latest result","workCenter.currentProgress":"Current progress","workCenter.actionMessages":"Messages","workCenter.loops":"loops","workCenter.tools":"tools","workCenter.noActionMessages":"No messages yet.","workCenter.actionDetails":"Action details","workCenter.selectAction":"Select an Action","workCenter.backToWorkItems":"Work items","workCenter.backToActions":"Back to Actions","workCenter.you":"You","workCenter.noRequestDetails":"No execution records are available for this Action yet.","workCenter.loadingRequests":"Loading execution records\u2026","workCenter.loadingRequestDetail":"Loading tool evidence\u2026","workCenter.requestDetailUnavailable":"Tool evidence is unavailable. Try again.","workCenter.noRequestLoops":"This execution has no retained Loop details.","workCenter.requestDetailTruncated":"Large execution: {summarized} Loops are summarized and {omitted} older Loops are omitted.","workCenter.loopDetailTruncated":"Large Loop: showing retained tool evidence.","workCenter.loadEarlierMessages":"Load earlier messages","workCenter.loadingEarlierMessages":"Loading earlier messages\u2026","workCenter.unknownModel":"Unknown model","workCenter.loop":"Loop","workCenter.actionBrief":"Task brief","workCenter.executionSummary":"Execution summary","workCenter.toolParameters":"Parameters","workCenter.toolResult":"Result","workCenter.noToolCalls":"No tool calls in this Loop.","workCenter.actionInputPlaceholder":"Add context, answer a question, or redirect this Action","workCenter.actionInputResumeHint":"Your input resumes this Action with the additional context.","workCenter.waitingQuestionTitle":"Input required","workCenter.actionInputRetryHint":"Add instructions or files, then rerun this Action with the new context.","workCenter.actionInputContinueHint":"Direct intervention for this Action only.","workCenter.actionFailedTitle":"Why this Action failed","workCenter.failedAt":"Failed at","workCenter.actionFailureRecovery":"Choose this Action in the Work Item composer to send corrected instructions.","workCenter.sendInput":"Send to Action","workCenter.sendingInput":"Sending\u2026","workCenter.retryAction":"Retry Action","workCenter.sendAndRetryAction":"Send and retry Action","workCenter.coordinatorDecision.guide_actions":"Action instructions updated","workCenter.coordinatorDecision.replan":"Goal or plan updated","workCenter.coordinatorDecision.request_human":"Human input requested","workCenter.conversation":"Conversation","workCenter.contentPane":"Content","workCenter.workItemPanes":"Work item panes","workCenter.coordinator":"Coordinator","workCenter.coordinatorTargetHint":"Work Item planning and coordination","workCenter.composerTarget":"Message target","workCenter.targetUnavailable":"Selected Action is no longer available","workCenter.targetUnavailableHelp":"Choose another target before sending. This draft was not redirected.","workCenter.sendToCoordinatorInstead":"Send to Coordinator instead","workCenter.sendToTarget":"Send to {target}","workCenter.answerWithTarget":"Choose the relevant target in the Conversation composer, then reply.","workCenter.conversationThinking":"Working\u2026","workCenter.conversationReadOnly":"This work item is closed. The conversation remains available.","workCenter.conversationPlaceholder":"Message about this work item","workCenter.sendMessage":"Send message","workCenter.messageSpeakerRole":"{name} \xB7 {role}","workCenter.originalRequest":"Original request","workCenter.actionMessageScopeTitle":"Message this Action","workCenter.actionMessageScope":"Only this Action receives the message.","workCenter.actionConversation":"Conversation","workCenter.actionConversationWith":"Action executor","workCenter.actionViews":"Action views","workCenter.actionExecutor":"Executor","workCenter.actionExecutorPending":"Executor pending","workCenter.actionInformation":"Action information","workCenter.messageExecutor":"Message {name}","workCenter.actionChatPlaceholder":"Message {name} from the Conversation composer","workCenter.statusLabel":"Status","workCenter.llmRequestsLabel":"LLM requests","workCenter.loopsLabel":"Loops","workCenter.toolsLabel":"Tools","workCenter.tokensLabel":"Tokens","workCenter.workItemMessagePlaceholder":"Add direction for the whole Work Item","workCenter.sendWorkItemMessage":"Send to Work Item","workCenter.fromSession":"Create a work item from this Session","workCenter.llmRequestCount":"{count} LLM requests","workCenter.loopCount":"{count} loops","workCenter.toolCount":"{count} tools","workCenter.tokenCount":"{count} tokens","workCenter.tokenBreakdown":"{input} input / {output} output / {cache} cached","workCenter.guidance":"Add guidance to the current Action","workCenter.guidanceHint":"Clarify constraints or redirect the current Action","workCenter.guidanceRestartHint":"This restarts the current Action with the new guidance.","workCenter.sendGuidance":"Send guidance","workCenter.reuseMemory":"Use relevant Agent memory and completed work from this project","workCenter.reuseMemoryHelp":"Includes scope-bounded Agent memory plus structured summaries and evidence from completed WorkItems with the same canonical project directory. Raw tool output is not reused.","workCenter.resumeAnswer":"Answer the waiting question","workCenter.resumeAnswerHint":"Provide the information required to continue","workCenter.answerInActionDetail":"Target the current Action in the Conversation composer, then reply.","workCenter.selectPrompt":"Select a work item to inspect its workflow.","workCenter.createHint":"Describe what you need. Triage will turn it into a goal, acceptance criteria, and Actions.","workCenter.requirement":"Requirement","workCenter.requirementHint":"Describe the problem, desired outcome, and any constraints in your own words","workCenter.requirementHelp":"Triage will generate the title, goal, acceptance criteria, type, and execution plan.","workCenter.titleField":"Title","workCenter.titleHint":"A short, specific outcome","workCenter.goalHint":"Describe the result the Agent must deliver","workCenter.criteriaHint":"One criterion per line","workCenter.attachments":"Attachments","workCenter.attachmentsHelp":"Images, PDFs, and text files stay bound to this Work Item and are available to every Action.","workCenter.attachmentsUnsupported":"The selected Agent does not support Work Item attachments.","workCenter.addAttachments":"Add files","workCenter.attachmentsUploading":"Uploading\u2026","workCenter.attachmentsUploadFailed":"Attachment upload failed","workCenter.pendingEnvelopeLocked":"An unconfirmed request is locked to its original identity.","workCenter.replacePendingAttachments":"Replace attachments","workCenter.discardPendingEnvelope":"Discard pending request","workCenter.pendingEnvelopeChanged":"The pending request changed; reopen this Work Item and try again.","workCenter.removeAttachment":"Remove from draft","workCenter.previewAttachment":"Open attachment","workCenter.openAttachmentNamed":"Open attachment {name}","workCenter.openingAttachment":"Opening attachment\u2026","workCenter.attachmentPreviewFailed":"Could not open the attachment. Try again.","workCenter.attachmentOpenBlocked":"The browser blocked the attachment window. Allow pop-ups and try again.","workCenter.execution":"Execution","workCenter.executionHint":"Choose where and how this work item starts.","workCenter.workDir":"Working directory","workCenter.workDirHint":"Choose an existing project directory","workCenter.chooseFolder":"Choose folder","workCenter.workDirPickerHelp":"Select an existing folder on the chosen Agent.","workCenter.folderPickerHint":"Choose the project folder this Work Item can read and modify.","workCenter.folderPickerSelectionHint":"Double-click to open a folder, or select it and confirm.","workCenter.startImmediately":"Start immediately","workCenter.startImmediatelyHint":"Turn this off to create a draft you can review first.","workCenter.creating":"Creating\u2026","workCenter.create":"Create","workCenter.status.draft":"draft","workCenter.status.ready":"ready","workCenter.status.running":"running","workCenter.status.waiting":"waiting","workCenter.status.needs_attention":"needs attention","workCenter.status.done":"done","workCenter.status.cancelled":"cancelled","workCenter.status.completed":"completed","workCenter.status.failed":"failed","workCenter.status.superseded":"superseded","workCenter.action.triage":"Triage","workCenter.action.implement":"Implement","workCenter.action.review":"Review","workCenter.action.integrate":"Integrate","workCenter.action.deliver":"Deliver","workCenter.action.test":"Test","workCenter.action.research":"Research","workCenter.action.design":"Design","workCenter.action.diagnose":"Diagnose","workCenter.action.migrate":"Migrate","workCenter.action.document":"Document","workCenter.action.operate":"Operate","workCenter.action.write":"Write","workCenter.action.custom":"Custom","workCenter.assignment.auto":"Use workflow policy","workCenter.model.inherit":"Use workflow model","workCenter.model.defaultProvider":"default provider","workCenter.planPreview":"Execution plan","workCenter.planPreviewHelp":"Resolved from this Agent\u2019s VP pool and model settings.","workCenter.settings.title":"Work Center settings","workCenter.settings.subtitle":"Configure the Coordinator plus reusable Action prompts, models, and effort for AI-planned work.","workCenter.settings.workflow":"Workflow","workCenter.settings.workflowHelp":"Triage chooses the task-specific Actions and executors dynamically.","workCenter.settings.aiWorkflowHelp":"Triage classifies each WorkItem and creates a validated flow of 1\u20138 task-specific Actions. Built-in Action policies are reusable defaults; triage may create a precise domain type when needed.","workCenter.settings.globalInstructions":"Global Agent instructions","workCenter.settings.globalInstructionsHint":"Example: Follow the repository release policy, require independent review, and never create deployment tags without explicit approval.","workCenter.settings.globalInstructionsHelp":"Stored at Agent level and frozen into every new WorkItem. Applied to triage and every generated Action, below the WorkItem contract and system/tool safety rules. Existing WorkItems keep their original snapshot.","workCenter.settings.actionPolicies":"Built-in Action policies","workCenter.settings.actionPoliciesHelp":"These are reusable execution baselines, not a fixed workflow. Unknown domain-specific Action types use the Custom policy plus their triage-generated type and objective.","workCenter.settings.dynamicInstructionHelp":"The AI adds the WorkItem contract, global instructions, prior Action context, memory, and a task-specific objective. This prompt defines the reusable behavior for this Action type.","workCenter.settings.models":"Models","workCenter.settings.modelsHelp":"Providers and credentials stay in Agent LLM settings. Work Center only selects available models.","workCenter.settings.dynamicModelsHelp":"Choose the Coordinator model separately from the models that execute Actions.","workCenter.settings.coordinatorModel":"Coordinator","workCenter.settings.coordinatorModelHelp":"Used for Work Item conversation, goal changes, and replanning. It never executes repository tools.","workCenter.settings.allActions":"Fallback for all Actions","workCenter.settings.maxConcurrentActions":"Maximum concurrent Actions","workCenter.settings.maxConcurrentActionsHelp":"Defaults to 3. Non-Git, dirty, shared, and integration work remains serial.","workCenter.workItemType":"Type","workCenter.typeAuto":"Auto \u2014 let the LLM infer","workCenter.typeHelp":"Choose a task category, or use Auto for AI inference. AI still plans the concrete Actions.","workCenter.planning":"Planning","workCenter.aiPlan":"AI-planned execution","workCenter.aiPlanHelp":"Triage chooses the task type, Actions, executors, and the smallest reliable flow. Work Center settings control model and effort.","workCenter.settings.manageProviders":"Manage Agent models","workCenter.settings.assignment":"VP selection","workCenter.settings.assignment.auto":"Auto from all VPs","workCenter.settings.assignment.pool":"Candidate pool","workCenter.settings.assignment.fixed":"Fixed VP","workCenter.settings.capability":"Required capability","workCenter.settings.vp":"Virtual Person","workCenter.settings.poolMembers":"Candidate VPs","workCenter.settings.modelPolicy":"Model policy","workCenter.settings.model.inherit":"Inherit from VP","workCenter.settings.model.primary":"Agent primary model","workCenter.settings.model.fast":"Agent fast model","workCenter.settings.model.specific":"Specific model","workCenter.settings.model":"Model","workCenter.settings.effort":"Reasoning effort","workCenter.settings.effortDefault":"Model default","workCenter.settings.effortHelp":"Overrides the selected model\u2019s default reasoning effort for every Work Center Action.","workCenter.settings.effortChooseModelHelp":"Select the Agent primary model, fast model, or a specific model to configure effort. Inherit from VP uses each VP\u2019s model default.","workCenter.settings.effortUnsupportedHelp":"The selected model does not expose configurable effort, so its model default is used.","workCenter.settings.saving":"Saving\u2026","workCenter.settings.reload":"Reload settings","workCenter.settings.conflict":"Settings changed elsewhere. Reload before saving again.","workCenter.settings.upgradeRequired":"This Agent version cannot save Work Center settings. The current values are shown read-only; upgrade the Agent to edit and save them.","workCenter.settings.saveNotConfirmed":"The Agent did not confirm the submitted prompts and model policy. Settings were not closed; reload or upgrade the Agent before trying again.","workCenter.settings.addWorkflow":"Duplicate workflow","workCenter.settings.removeWorkflow":"Remove","workCenter.settings.newWorkflow":"Workflow {index}","workCenter.settings.workflowName":"Workflow name","workCenter.settings.newStage":"New stage","workCenter.settings.addStage":"Add stage","workCenter.settings.removeStage":"Remove stage","workCenter.settings.moveUp":"Move stage up","workCenter.settings.moveDown":"Move stage down","workCenter.settings.stageType":"Stage type","workCenter.settings.reviewReturnStage":"Return to stage when changes are requested","workCenter.settings.instruction":"Stage prompt","workCenter.settings.instructionHint":"Define what this stage must do.","workCenter.settings.instructionHelp":"The WorkItem goal, acceptance criteria, and reusable context are added automatically at run time.","workCenter.settings.instructionReset":"Restore default"}});function qa(){return typeof navigator>"u"||!navigator?"":navigator.userAgent||""}function Zs(){let e=qa();return/Android|iPhone|iPad|iPod|Windows Phone|IEMobile|BlackBerry|Opera Mini/i.test(e)}function di(){return/MicroMessenger/i.test(qa())}function ui(){return/AlipayClient/i.test(qa())}var Ba=F(()=>{});var ap,lp=F(()=>{gt();$t();Ba();ap={name:"LoginPage",template:`
|
|
14
|
+
The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is already at the latest version (v{version}), no upgrade needed.","chat.agent.nodeIncompatible":"Agent upgrade aborted: target version v{version} requires Node {required}, but this machine is running Node {current}. Please upgrade Node.js first, then retry.","chat.agent.online":"{count} Agent(s) online","chat.agent.selectFirst":"Please select an Agent first","chat.agent.yeaft":"Yeaft Chat","sidebar.toggle.chat":"Switch to Chat","sidebar.toggle.yeaft":"Switch to Yeaft","sidebar.surface.label":"Sidebar view","sidebar.surface.sessions":"Sessions","sidebar.provider.label":"Session provider","sidebar.provider.claude":"Claude","sidebar.sessions.new":"New session","sidebar.sessions.newChat":"New chat","sidebar.sessions.emptyProvider":"No sessions for this provider","sidebar.sessions.menu":"Session menu","sidebar.sessions.unread":"Unread","sidebar.sessions.pinned":"Pinned","sidebar.sessions.processing":"Reply in progress","sidebar.sessions.hidden":"Hidden sessions","sidebar.sessions.remove":"Remove from sidebar","sidebar.sessions.agent":"Agent","sidebar.sessions.provider":"Provider","sidebar.projects.title":"Projects","sidebar.projects.menu":"Project menu","sidebar.projects.new":"New project","sidebar.projects.newSession":"New Session in {name}","sidebar.projects.assignFailed":"Session created, but it could not be added to {name}. Error: {message}","sidebar.projects.empty":"No projects yet","sidebar.projects.noSessions":"Drag a Yeaft chat here","sidebar.projects.namePrompt":"Project name","sidebar.projects.renamePrompt":"Rename project","sidebar.projects.rename":"Rename project","sidebar.projects.delete":"Delete project","sidebar.projects.deleteConfirm":'Delete project "{name}"? Its chats will move to Recents.',"sidebar.projects.remove":"Remove from project","sidebar.projects.moveMenu":"Move to Projects","sidebar.projects.moveBack":"Back","sidebar.projects.moveEmpty":"No other projects","sidebar.projects.moveTo":"Move to {name}","sidebar.projects.instructions":"Project instructions","sidebar.projects.instructionsTitle":"{name} instructions","sidebar.projects.instructionsHint":"These instructions are added to the system prompt for every Session in this Project.","sidebar.projects.instructionsPlaceholder":"Add shared coding conventions, constraints, or workflow guidance...","sidebar.recents.title":"Recents","sidebar.recents.empty":"No chats found","yeaft.back":"Back","yeaft.session.people":"People","yeaft.session.peopleEmpty":"No people","yeaft.session.runningTasks":"Running tasks","yeaft.session.tasksEmpty":"No running tasks","yeaft.session.owner":"Owner","yeaft.session.started":"Started","yeaft.breadcrumb.label":"Thread filter","yeaft.breadcrumb.mainStream":"Main stream","yeaft.breadcrumb.backHint":"Return to full stream (Esc)","yeaft.featureDetail.ariaLabel":"Task detail","yeaft.featureDetail.replyTo":"Reply in:","yeaft.featureDetail.forkHint":"No active thread \u2014 fork a new one to reply.","yeaft.featureDetail.empty":"No messages for this task yet.","yeaft.featureDetail.threadPillHint":"Open thread","yeaft.featureDetail.summary.aria":"Task summary timeline","yeaft.featureDetail.summary.title":"Summary timeline","yeaft.featureDetail.summary.loading":"Loading summary history\u2026","yeaft.featureDetail.summary.empty":"No summaries yet.","yeaft.featureDetail.summary.error":"Summary history failed: {error}","yeaft.featureDetail.summary.showArchived":"Show archived","yeaft.featureDetail.related.aria":"Related tasks","yeaft.featureDetail.related.title":"Related tasks","yeaft.featureDetail.related.unlink":"Unlink","yeaft.featureDetail.members.aria":"Task members","yeaft.featureDetail.members.title":"Members","yeaft.featureDetail.members.abort":"Abort","yeaft.featureDetail.members.kick":"Kick","yeaft.model":"Model","yeaft.placeholder":"Ask anything...","yeaft.inbox":"Inbox","yeaft.inbox.tooltip":"Your default thread \u2014 one-on-one chat with Yeaft. New threads can be created for specific topics or tasks.","yeaft.sidebar.activeThreads":"Active","yeaft.sidebar.idleThreads":"Idle","yeaft.sidebar.archivedThreads":"Archived","yeaft.sidebar.tasks":"Tasks","yeaft.sidebar.emptyActive":"No active threads","yeaft.sidebar.emptyIdle":"No idle threads","yeaft.sidebar.emptyArchived":"No archived threads","yeaft.sidebar.emptyTasks":"No tasks match","yeaft.sidebar.results":"Results","yeaft.sidebar.resultsThreads":"Threads","yeaft.sidebar.kindThread":"thread","yeaft.sidebar.cancel":"Cancel","yeaft.sidebar.mergeInto":"Merge into\u2026","yeaft.sidebar.mergeNoCandidates":"No other threads to merge into","yeaft.sidebar.mergeConfirmTitle":"Merge this thread?","yeaft.sidebar.mergeIrreversible":"This cannot be undone. The source thread will be archived and its messages moved to the target.","yeaft.sidebar.mergeConfirm":"Merge","yeaft.settings.sidebarV2":"Experimental: Sidebar V2","yeaft.settings.sidebarV2Hint":"Thread list + task tree (preview).","yeaft.clearConfirm":"Clear all messages?","yeaft.mode":"Mode","yeaft.agent":"Agent","yeaft.connecting":"Connecting...","yeaft.ready":"Ready","yeaft.tools":"tools","yeaft.skills":"skills","yeaft.mcp":"MCP","yeaft.showSidebar":"Show sidebar","yeaft.hideSidebar":"Hide sidebar","yeaft.debug":"Debug","yeaft.debugClose":"Close debug panel","yeaft.debugTurns":"turns","yeaft.debugTabToolStats":"Tool Stats","yeaft.debugTabDream":"Dream","yeaft.debugTabRequestLog":"Request Log","yeaft.debugHistoryLoad":"Load request history","yeaft.debugHistoryLoading":"Loading...","yeaft.debugHistoryLoaded":"{count} loaded","yeaft.debugSearchPlaceholder":"Regex search request logs","yeaft.debugSearchHint":"Shows the latest 10 globally by default; search matches request summaries across Sessions.","yeaft.dreamDebug.title":"Dream lifecycle","yeaft.dreamDebug.trigger":"Trigger","yeaft.dreamDebug.status":"Status","yeaft.dreamDebug.started":"Started","yeaft.dreamDebug.finished":"Finished","yeaft.dreamDebug.time":"Time","yeaft.dreamDebug.phase":"Phase","yeaft.dreamDebug.call":"Call","yeaft.dreamDebug.location":"Location","yeaft.dreamDebug.result":"Result","yeaft.dreamDebug.noLatest":"No dream check has been recorded for this session yet.","yeaft.dreamDebug.noEvents":"No dream events yet for this session.","yeaft.dreamDebug.outputTitle":"Dream output loaded for this session","yeaft.dreamDebug.scope":"Scope","yeaft.dreamDebug.lastDream":"Last dream","yeaft.dreamDebug.messagesCovered":"Messages covered","yeaft.dreamDebug.noOutput":"No dream output has been written for this session yet.","yeaft.dreamDebug.promptLoadTitle":"Dream memory loaded into system prompt","yeaft.dreamDebug.loadedInto":"Loaded into","yeaft.dreamDebug.vp":"VP","yeaft.dreamDebug.summaryToPrompt":"summary.md -> system prompt","yeaft.dreamDebug.itemList":"Dream runs and scopes","yeaft.dreamDebug.searchPlaceholder":"Search Dream sessions by title, id, or summary...","yeaft.dreamDebug.noSearchResults":"No Dream sessions match this search.","yeaft.dreamDebug.noSummary":"No summary available","yeaft.dreamDebug.segments":"segments","yeaft.dreamDebug.lastError":"Last error","yeaft.dreamDebug.overview":"Overview","yeaft.dreamDebug.sessionId":"Session ID","yeaft.dreamDebug.loadedAt":"Loaded at","yeaft.dreamDebug.layers":"Layers","yeaft.dreamDebug.summaryLayer":"Resident summary","yeaft.dreamDebug.noPromptLoad":"No prompt-load record is available for this scope.","yeaft.dreamDebug.segmentTitle":"Segments","yeaft.dreamDebug.sourceMessages":"Source messages","yeaft.dreamDebug.createdAt":"Created","yeaft.dreamDebug.updatedAt":"Updated","yeaft.dreamDebug.noSegments":"No memory segments are available for this scope.","yeaft.dreamDebug.requestResponse":"Request / Response","yeaft.dreamDebug.noRequestResponse":"No Dream request/response log has been persisted for this scope yet.","yeaft.dreamDebug.empty":"No Dream debug data has been recorded yet.","yeaft.debugGroupFollowMain":"Follow main pane","yeaft.debugGroupAll":"All sessions","yeaft.debugAssistantResponse":"Assistant response","yeaft.debugViewAssistantResponse":"View response","yeaft.debugToolInput":"Input","yeaft.debugToolResult":"Result","yeaft.debugToolRunning":"running","yeaft.debugToolRunningNoResult":"Running; no result yet","yeaft.debugShowDetails":"show","yeaft.debugHideDetails":"hide","yeaft.debugTurnStartedAt":"turn started at","yeaft.debugRequestAt":"request time","yeaft.debugRequestAtDerived":"derived from turn start (legacy loop)","yeaft.turn":"Turn {n}","yeaft.systemPrompt":"System Prompt","yeaft.messagesLabel":"Messages","yeaft.response":"Response","yeaft.toolCalls":"Tool Calls","yeaft.functionCalls":"Function Calls","yeaft.request":"Request","yeaft.pending":"(pending)","yeaft.inputTokens":"Input","yeaft.outputTokens":"Output","yeaft.duration":"Duration","yeaft.noDebugData":"No debug data yet","yeaft.showDebug":"Show debug panel","yeaft.hideDebug":"Hide debug panel","yeaft.reloadPage":"Reload page","yeaft.reloadMessages":"Reload messages","sidebar.sessions.syncing":"Syncing latest messages","yeaft.historySearch.label":"Search Session history","yeaft.historySearch.button":"Search messages","yeaft.historySearch.placeholder":"Search messages in this Session","yeaft.historySearch.searching":"Searching\u2026","yeaft.historySearch.minChars":"Type at least 2 characters","yeaft.historySearch.empty":"No matching messages","yeaft.historySearch.error":"Search failed. Try again.","yeaft.historySearch.unsupported":"Upgrade this Agent to search Session history.","yeaft.historySearch.more":"Load more results","yeaft.historySearch.you":"You","yeaft.historySearch.assistant":"Assistant","yeaft.outline.label":"Message history","yeaft.outline.sender":"Sender","yeaft.outline.allSenders":"All senders","yeaft.outline.title":"Message history","yeaft.outline.placeholder":"Search this conversation","yeaft.outline.searching":"Searching\u2026","yeaft.outline.loading":"Loading\u2026","yeaft.outline.older":"Load older messages","yeaft.outline.moreMatches":"Load more matches","yeaft.outline.minChars":"Type at least 2 characters","yeaft.outline.empty":"No messages yet","yeaft.outline.noMatches":"No matching messages","yeaft.outline.error":"Could not load the outline. Try again.","yeaft.outline.unsupported":"Upgrade this Agent to use the conversation outline.","yeaft.outline.you":"You","yeaft.outline.assistant":"Assistant","yeaft.outline.nonText":"Non-text response","yeaft.switchModel":"Switch model","yeaft.modelMenu.title":"Model and LLM settings","yeaft.modelMenu.label":"Model","yeaft.modelMenu.effort":"Effort","yeaft.modelMenu.effort.openaiReasoning":"Reasoning effort","yeaft.modelMenu.effort.anthropicBudget":"Thinking budget","yeaft.modelMenu.effort.anthropicAdaptive":"Adaptive thinking effort","yeaft.modelMenu.effort.minimal":"Minimal","yeaft.modelMenu.effort.low":"Low","yeaft.modelMenu.effort.medium":"Medium","yeaft.modelMenu.effort.high":"High","yeaft.modelMenu.effort.xhigh":"X-High","yeaft.modelMenu.effort.max":"Max","yeaft.modelMenu.noEffort":"This model does not expose a compatible effort control.","yeaft.modelMenu.configureHint":"Providers, keys, model list","yeaft.settings.title":"Settings","settings.yeaft.tabs.vp":"VP Library","settings.yeaft.tabs.search":"Search","settings.yeaft.tabs.mcp":"MCP","yeaft.settings.tabs.vp":"VP Library","yeaft.settings.tabs.search":"Search","yeaft.settings.tabs.mcp":"MCP","settings.mcp.title":"MCP servers","settings.mcp.description":"Connect Model Context Protocol servers to extend Yeaft with extra tools. Servers are stored in ~/.yeaft/config.json on the agent; tools appear in the LLM's catalogue as mcp__<server>__<tool>.","settings.mcp.reloadAll":"Reload all","settings.mcp.reloadOne":"Reconnect this server","settings.mcp.loading":"Working\u2026","settings.mcp.connected":"connected","settings.mcp.disconnected":"disconnected","settings.mcp.tools":"tools","settings.mcp.remove":"Remove","settings.mcp.empty":"No MCP servers configured yet. Add one below.","settings.mcp.addServer":"Add server","settings.mcp.addServerDesc":"Most MCP servers run as a local command \u2014 Yeaft launches it via stdio and discovers its tools.","settings.mcp.serverName":"Name","settings.mcp.command":"Command","settings.mcp.args":"Arguments","settings.mcp.argsPlaceholder":"e.g. -y @modelcontextprotocol/server-filesystem /tmp","settings.mcp.env":"Environment","settings.mcp.envPlaceholder":"KEY=value per line. Lines starting with # are ignored.","settings.mcp.saving":"Saving\u2026","settings.mcp.add":"Add","settings.mcp.cancel":"Clear","settings.mcp.connectFailed":"Saved but failed to connect","settings.mcp.addSuccess":"Server added","settings.mcp.removeSuccess":"Server removed","settings.mcp.reloadSuccess":"Reload requested","settings.mcp.confirmRemove":'Remove MCP server "{name}"? Its tools will disappear from the next LLM turn.',"settings.mcp.errors.nameRequired":"Name is required","settings.mcp.errors.nameFormat":"Name must be lowercase letters, digits, dashes or underscores only","settings.mcp.errors.commandRequired":"Command is required","settings.mcp.errors.argsParse":"Could not parse arguments","settings.mcp.errors.envParse":"Could not parse environment","search.settings.backendTitle":"Search backend","search.settings.backendDesc":"Choose the primary backend for the WebSearch tool. If the primary fails, the engine automatically falls back to HTML scraping.","search.settings.backend.tavily":"Tavily","search.settings.backend.tavilyHint":"Hosted search API. Free tier: 1000 queries/month. Recommended.","search.settings.backend.playwright":"Playwright service","search.settings.backend.playwrightHint":"Self-hosted browser-based search/fetch. Best for cloud IPs that get bot-blocked. Service not yet shipped.","search.settings.comingSoon":"Coming soon","search.settings.tavilyKeyTitle":"Tavily API key","search.settings.tavilyKeyDesc":"Stored on the agent in ~/.yeaft/config.json. Get a free key at","search.settings.tavilyKeyUnchanged":"(unchanged)","search.settings.clearKey":"Clear","search.settings.usageTitle":"Usage this month","search.settings.usageRefresh":"Refresh","search.settings.usageLoading":"Loading\u2026","search.settings.usagePlan":"Plan","search.settings.usageUsed":"Used","search.settings.usagePaygo":"Pay-as-you-go","search.settings.usageError":"Failed to load usage","search.settings.save":"Save","search.settings.saving":"Saving\u2026","search.settings.saveSuccess":"Saved","search.settings.cancel":"Reset","yeaft.settings.yeaftTitle":"Thread Concurrency & Archive","yeaft.settings.yeaftDesc":"Tune how many threads can run at once and when idle threads are auto-archived.","yeaft.settings.maxConcurrentLabel":"Max concurrent threads","yeaft.settings.maxConcurrentHint":"Maximum number of live threads at once (includes the always-on main thread). New threads beyond this cap are refused until an existing thread is archived or terminated. Range: 1-50.","yeaft.settings.archiveIdleDaysLabel":"Auto-archive idle threads after (days)","yeaft.settings.archiveIdleDaysHint":"Threads with no activity for this many days will be archived. Range: 1-3650.","yeaft.settings.yeaftSaveBtn":"Save","yeaft.settings.yeaftSaving":"Saving...","yeaft.settings.yeaftSaved":"Saved","yeaft.settings.yeaftLoading":"Loading...","yeaft.settings.yeaftLoadError":"Failed to load Yeaft settings","yeaft.settings.yeaftSaveError":"Failed to save Yeaft settings","yeaft.settings.rangeErrorConcurrent":"Must be between 1 and 50","yeaft.settings.rangeErrorArchive":"Must be between 1 and 3650","chat.session.creating":"Creating conversation...","chat.session.loadingHistory":"Loading conversation history...","yeaft.historyLoad.error":"Conversation history could not be loaded. Your messages are still stored on the Agent.","yeaft.historyLoad.retry":"Retry loading","yeaft.sessionInventory.error":"Sessions could not be loaded. Your conversations are still stored on the Agent.","yeaft.sessionInventory.retry":"Retry Sessions","chat.session.closed":"Conversation closed","chat.session.agentOffline":"Agent is offline. This session will be available when the agent reconnects.","chat.execution.cancelled":"Execution cancelled","chat.sidebar.expand":"Expand menu","chat.sidebar.collapse":"Collapse sidebar","chat.sidebar.workbench":"Workbench","chat.sidebar.newConv":"Conversation","chat.sidebar.recentChats":"Recent Chats","chat.sidebar.resumeConv":"Resume Conversation","chat.sidebar.lightMode":"Light Mode","chat.sidebar.darkMode":"Dark Mode","chat.sidebar.settings":"Settings","chat.sidebar.emptyHint":"Click the button above to create a new conversation","chat.sidebar.closeConv":"Close Conversation","chat.sidebar.renameConv":"Rename","chat.sidebar.pin":"Pin to top","chat.sidebar.unpin":"Unpin","chat.connection.connecting":"Connecting...","chat.connection.reconnecting":"Reconnecting ({current}/{max})...","chat.connection.updating":"Server is updating, please wait...","chat.connection.disconnected":"Disconnected","chat.connection.reconnect":"Reconnect","chat.connection.reconnectFailed":"Connection lost. Please click reconnect to retry.","chat.time.justNow":"Just now","chat.time.minutesAgo":"{count}m ago","chat.time.daysAgo":"{count}d ago","chat.time.today":"Today","chat.time.yesterday":"Yesterday","chat.delete.confirm":"Are you sure you want to close this conversation? This will terminate the corresponding Claude process.","chat.delete.enterWorkDir":"Please enter the working directory path","modal.newConv.workDir":"Work Directory","modal.newConv.inputOrSelect":"Enter or select a work directory","modal.newConv.browse":"Browse","modal.newConv.noWorkDirs":"No work directories","modal.newConv.selectAgent":"Please select an online Agent first","modal.newConv.create":"Create Conversation","modal.newConv.folderLabel":"\u{1F4C1} Work Directories","modal.newConv.provider":"Provider","modal.newConv.model":"Model","provider.claudeCode":"Claude Code","provider.copilot":"Copilot","modal.resume.workDir":"Work Directory","modal.resume.inputOrSelect":"Enter or select a work directory","modal.resume.browse":"Browse","modal.resume.tabFolders":"Directories","modal.resume.tabSessions":"History","modal.resume.noWorkDirs":"No work directories","modal.resume.selectWorkDir":"Please select a work directory first","modal.resume.noSessions":"No history sessions in this directory","modal.resume.untitled":"Untitled Session","modal.resume.folderLabel":"\u{1F4C1} Work Directories","modal.resume.sessionLabel":"\u{1F4AC} History Sessions","modal.resume.selectAgent":"Please select an online Agent first","modal.folderPicker.title":"Select Work Directory","modal.folderPicker.parentDir":"Parent Directory","welcome.subtitle":"Web Code Agent for sessions, tools, and VP collaboration","welcome.agentOnline":"{count} Agent(s) online","welcome.noAgents":"No Agents Online","welcome.noAgentsHint":"Please start an Agent and connect it to the server","welcome.noAgent":"No Agents Online","welcome.noAgentHint":"Please start an Agent and connect it to the server","welcome.setupAgent":"Set Up Agent","welcome.setupKicker":"Agent setup","welcome.setupTitle":"Connect your first Yeaft Agent","welcome.setupDesc":"Copy two commands to connect a local Agent. GitHub Copilot can configure models automatically.","welcome.setupInstallTitle":"Install CLI","welcome.setupCopilotTitle":"Configure models","welcome.setupRunTitle":"Start Agent","welcome.setupSecretLoading":"Preparing your Agent secret...","welcome.setupSecretError":"Could not prepare the Agent secret. Open Security settings to retry.","welcome.openSecuritySettings":"Open Security Settings","welcome.newConv":"Conversation","welcome.resumeHistory":"Resume History","messages.loadingMore":"Loading more messages...","messages.loadMore":"\u2191 Click or scroll up to load more","message.loadingMore":"Loading more messages...","message.loadMore":"\u2191 Click or scroll up to load more","message.scrollToLatest":"\u2193 Latest","message.showResponses":"Show {count} response(s)","message.hideResponses":"Hide response(s)","message.assistant":"Assistant","chat.waiting.disconnected":"Connection lost","chat.connecting":"Connecting to provider session...","chat.waiting.compacting":"Compacting context...","chat.waiting.agentOffline":"Agent offline","chat.waiting.sessionLost":"Session lost, refreshed, waiting for update...","chat.waiting.cliExited":"Claude process exited, refreshed, waiting for update...","chat.waiting.refresh":"Refresh","chat.waiting.thinking":"AI is thinking, please wait...","btw.hint":"esc to exit","btw.placeholder":"Ask a side question...","btw.close":"Exit BTW mode","message.copyContent":"Copy content","message.copy":"Copy content","message.copied":"Copied","message.copyCode":"Copy code","message.copyAll":"Copy all","message.screenshot":"Screenshot","message.screenshotting":"Taking screenshot...","message.exportMd":"Export MD","message.askInput":"Your input needed","message.askAnswered":"\u2713 Answered","message.askCustom":"Or type a custom answer...","message.askCustomPlaceholder":"Or type a custom answer...","message.askSubmit":"Submit Answer","message.askWaiting":"Waiting for question...","message.askExpired":"This question has expired. Ask the role to re-ask.","message.openInEditor":"Open in editor","message.resultDone":"Done","message.done":"Done","message.resultRead":"Read {file}","message.readFile":"Read {name}","message.file":"file","message.attachImages":"{count} image(s)","message.imageCount":"{count} image(s)","message.imagePreview":"Image preview","message.previousImage":"Previous image","message.nextImage":"Next image","message.imagePosition":"Image {current} of {total}","message.imageUnavailable":"Image unavailable","message.attachFiles":"{count} file(s)","message.fileCount":"{count} file(s)","message.quote":"Quote","message.removeQuote":"Remove quote","message.replyingTo":"Replying to {author}","message.quotedFrom":"Quoted from {author}","message.editAsNew":"Edit","message.you":"You","input.upload":"Upload file","input.placeholder":"Type a message...","input.send":"Send","input.stopExecution":"Stop execution","chatInput.upload":"Upload file","chatInput.uploading":"Uploading...","chatInput.uploadFailed":"Upload failed","chatInput.retryUpload":"Retry","chatInput.removeAttachment":"Remove attachment","chatInput.placeholder":"Type a message...","chatInput.send":"Send","chatInput.stop":"Stop execution","tools.thinking":"Thinking...","tools.read":"Reading file","tools.write":"Writing file","tools.edit":"Editing file","tools.bash":"Running command","tools.glob":"Searching files","tools.grep":"Searching content","tools.task":"Running task","tools.webFetch":"Fetching web page","tools.webSearch":"Searching the web","tools.todoWrite":"Updating tasks","tools.executing":"Running {name}","status.thinking":"Thinking...","status.reading":"Reading file","status.writing":"Writing file","status.editing":"Editing file","status.executing":"Running command","status.searchingFiles":"Searching files","status.searchingContent":"Searching content","status.executingTask":"Running task","status.fetching":"Fetching web page","status.searching":"Searching the web","status.updatingTasks":"Updating tasks","status.executingTool":"Running {name}","header.compacting":"Compressing context...","header.compacted":"Context compression complete","chatHeader.newConv":"Conversation","chatHeader.compacting":"Compressing context...","chatHeader.compactDone":"Context compression complete","chatHeader.compact":"Compact context","chatHeader.resume":"Resume session","chatHeader.refresh":"Refresh messages","chatHeader.reloadPage":"Reload page","chatHeader.clear":"Clear messages","chatHeader.clearing":"Clearing context...","chatHeader.clearDone":"Context cleared","chatHeader.confirmClear":"Are you sure you want to clear all messages in this conversation?","chatHeader.mcpConfig":"MCP Servers","chatHeader.mcpNeedRestart":"Changes will take effect after restarting the session.","chatHeader.expertPanel":"Expert Panel","chatHeader.subAgentPanel":"Sub-Agents","settings.close":"Close settings","settings.tabs.account":"Account","settings.tabs.security":"Security","settings.tabs.general":"General","settings.tabs.invitations":"Invitations","auth.sessionExpired":"Session expired. Please log in again.","settings.account.username":"Username","settings.account.role":"Role","settings.account.email":"Email","settings.account.emailNotSet":"Not set","settings.account.profileLoadFailed":"Failed to load account profile","settings.account.logout":"Log Out","settings.account.roleAdmin":"Admin","settings.account.rolePro":"Pro","settings.account.linkedAccounts":"Linked Accounts","settings.account.linkedDesc":"Link external sign-in providers so you can log in with any of them.","settings.account.bind":"Link","settings.account.unbind":"Unlink","settings.account.linked":"Linked","settings.account.providerDisabled":"Not configured","settings.account.cantUnbindLast":"Cannot unlink the only login method","settings.account.unbindFailed":"Failed to unlink: {error}","settings.account.bindFailed":"Failed to link account","settings.account.ssoBoundMsg":"Successfully linked {provider}.","settings.account.ssoConflictMsg":"This {provider} account is already linked to another user.","settings.account.providerMicrosoft":"Microsoft","settings.account.providerGithub":"GitHub","settings.account.providerGoogle":"Google","settings.account.providerWechat":"WeChat","settings.account.providerAlipay":"Alipay","settings.security.agentKey":"Agent Secret","settings.security.agentKeyDesc":"Shared secret for Agent connection authentication","settings.security.agentSetupCommands":"Agent setup commands","settings.security.agentCmdInstall":"Install Agent","settings.security.agentCmdService":"Run Agent server","settings.security.agentCmdNeedsSecret":"Generate an Agent Secret first to create the server command.","settings.security.agentCmdLlm":"Manual Copilot fallback","settings.security.agentCmdLlmDesc":"Run the install command first. If an existing GitHub Copilot token is available, Yeaft configures github-copilot/gpt-5.5 automatically; use the Copilot command only as a fallback.","settings.security.none":"None","settings.security.show":"Show","settings.security.hide":"Hide","settings.security.generateKey":"Generate Secret","settings.security.resetKey":"Reset Secret","settings.security.resetting":"Resetting...","settings.security.resetWarning":"All Agents need to be reconfigured after reset","settings.security.changePassword":"Change Password","settings.security.currentPassword":"Current password","settings.security.newPassword":"New password (min 6 characters)","settings.security.confirmPassword":"Confirm new password","settings.security.changeBtn":"Change Password","settings.security.changing":"Changing...","settings.security.enterCurrentPwd":"Please enter your current password","settings.security.newPwdMin":"New password must be at least 6 characters","settings.security.pwdMismatch":"Passwords do not match","settings.security.pwdChanged":"Password changed successfully","settings.security.setPassword":"Set a Password","settings.security.setPasswordDesc":"You signed in via SSO and have no password yet. Set one so you can also log in with username + password.","settings.security.setBtn":"Set Password","settings.security.pwdSet":"Password set successfully","settings.security.deleteAccount":"Delete Account","settings.security.deleteAccountDesc":"Permanently delete your account and all associated data. This cannot be undone.","settings.security.deleteBtn":"Delete Account","settings.security.deleteConfirmBtn":"Confirm Delete","settings.security.deleteConfirmPlaceholder":"Type DELETE to confirm","settings.security.deleteConfirmRequired":"Type DELETE to confirm account removal","settings.security.deleteFailed":"Failed to delete account","settings.security.deleting":"Deleting...","settings.general.theme":"Theme","settings.general.lightTheme":"Light","settings.general.darkTheme":"Dark","settings.general.language":"Language","settings.general.telemetry":"Performance telemetry","settings.general.telemetryDesc":"Buffer local timing diagnostics without sending trace content to the server.","settings.general.telemetryOn":"On","settings.general.telemetryOff":"Off","settings.general.telemetryRawLimit":"Raw provider response limit (bytes)","settings.invite.create":"Create Invite Code","settings.invite.normalUser":"Regular User","settings.invite.proUser":"Pro User","settings.invite.createBtn":"Create Invite","settings.invite.creating":"Creating...","settings.invite.list":"Invite Codes","settings.invite.used":"Used","settings.invite.expired":"Expired","settings.invite.available":"Available","settings.invite.usedBy":"Used by: {user}","settings.invite.expiredAt":"Expired at: {time}","settings.invite.expiresAt":"Expires at: {time}","settings.invite.noInvites":"No invite codes","settings.msg.copiedClipboard":"Copied to clipboard","settings.msg.copyFailed":"Copy failed","settings.msg.keyReset":"Secret has been reset","settings.msg.resetFailed":"Reset failed","settings.msg.changeFailed":"Change failed","settings.msg.inviteCreated":"Invite code created","settings.msg.createFailed":"Create failed","settings.msg.inviteCopied":"Invite code copied","settings.msg.inviteDeleted":"Invite code deleted","settings.msg.deleteFailed":"Delete failed","settings.tabs.llm":"LLM","settings.tabs.yeaft":"Yeaft","yeaft.session.title":"Sessions","yeaft.session.new":"+ New session","yeaft.session.create.title":"New session","yeaft.session.create.subtitle":"Choose where it runs and which provider should handle it.","yeaft.session.create.close":"Close","yeaft.session.create.nameLabel":"Name","yeaft.session.create.namePlaceholder":"Session name (optional)","yeaft.session.create.workDirLabel":"Work Directory","yeaft.session.create.agentLabel":"Agent","yeaft.session.create.vpPicker":"Pick VPs","yeaft.session.create.vpNone":"No VPs selected","yeaft.session.create.vpCount":"{n} VPs selected","yeaft.session.create.untitled":"Untitled session","yeaft.session.create.rosterEmpty":"No VPs available \u2014 create one from the VP Library first.","yeaft.session.create.rosterLoading":"Loading VPs\u2026","yeaft.session.create.rosterError":"VPs could not be loaded from this Agent.","yeaft.session.create.rosterRetry":"Retry","yeaft.vp.domain.general":"General & coordination","yeaft.vp.domain.productDesign":"Product & experience design","yeaft.vp.domain.softwareSystems":"Software & systems","yeaft.vp.domain.securityReliability":"Security & reliability","yeaft.vp.domain.scienceAnalysis":"Science & analysis","yeaft.vp.domain.philosophyPsychology":"Philosophy & psychology","yeaft.vp.domain.strategyHistory":"Strategy & history","yeaft.vp.domain.businessManagement":"Business & management","yeaft.vp.domain.artsCulture":"Arts & culture","yeaft.vp.domain.other":"Other specialties","yeaft.vp.domain.custom":"Custom VPs","yeaft.session.create.defaultVpHint":"The VP that answers when no one is @-mentioned.","yeaft.session.create.folderLabel":"\u{1F4C1} Work directories","yeaft.session.create.sessionLabel":"\u{1F4AC} Sessions in this directory","yeaft.session.create.noWorkDirs":"No prior sessions yet \u2014 pick or type a work directory above.","yeaft.session.create.back":"Back","yeaft.session.create.creating":"Creating\u2026","yeaft.session.create.submit":"Create","yeaft.onboarding.ariaLabel":"Yeaft getting started guide","yeaft.onboarding.topbarTitle":"Get started with Yeaft","yeaft.onboarding.eyebrow":"Yeaft setup guide","yeaft.onboarding.title":"Connect an Agent before chatting","yeaft.onboarding.subtitle":"Run these commands on the machine that should execute tools. The agent secret is generated automatically for your account if it does not exist yet.","yeaft.onboarding.createSession":"Create or restore Session","yeaft.onboarding.configureLlm":"Open LLM settings","yeaft.onboarding.secretLoading":"Generating agent secret\u2026","yeaft.onboarding.secretError":"Failed to load agent secret.","yeaft.onboarding.secretPending":"<loading-agent-secret>","yeaft.onboarding.installTitle":"Install yeaft-agent","yeaft.onboarding.installDesc":"Install the command-line Agent package.","yeaft.onboarding.connectTitle":"Connect this Agent","yeaft.onboarding.connectDesc":"The command below uses this server URL and your generated secret.","yeaft.onboarding.llmTitle":"Use GitHub Copilot","yeaft.onboarding.llmDesc":"Authenticate GitHub CLI, then select gpt-5.5 as the default Yeaft model.","yeaft.restore.modal.empty":"No yeaft sessions found in this directory","yeaft.restore.modal.scanError":"Failed to scan: {message}","yeaft.restore.modal.restoreError":"Failed to restore: {message}","settings.llm.noAgent":"Please select an Agent first to manage LLM configuration.","settings.llm.agentOffline":"Agent is currently offline. LLM configuration will load when the agent comes online.","settings.llm.loading":"Loading configuration...","settings.llm.loadError":"Failed to load configuration","settings.llm.configureAgent":"Configure this agent LLM","settings.llm.configureMenu":"LLM Settings","settings.llm.simpleCopilotTitle":"Recommended: GitHub Copilot","settings.llm.useGitHubCopilot":"Use GitHub Copilot","settings.llm.refreshingModels":"Refreshing models...","settings.llm.managedCopilotTitle":"Managed GitHub Copilot","settings.llm.managedCopilotDesc":"Base URL, authentication, model catalog, and per-model API protocol are managed automatically. Claude models use Anthropic Messages; GPT/o models use OpenAI Responses.","settings.llm.providersTitle":"Providers","settings.llm.testFailed":"Connection test failed","settings.llm.saveSuccess":"LLM settings saved","settings.llm.saveFailed":"Failed to save LLM settings","settings.llm.presets.title":"Quick setup","settings.llm.providersDesc":"Choose a provider, save it, and use it in Sessions.","settings.llm.agentProviders":"This agent providers","settings.llm.agentBadge":"This agent","settings.llm.addProvider":"Add Provider","settings.llm.addFromPreset":"Add from Catalog","settings.llm.preset.title":"Provider Catalog (models.dev)","settings.llm.preset.refresh":"Refresh catalog","settings.llm.preset.loading":"Loading catalog\u2026","settings.llm.preset.empty":"No providers available.","settings.llm.preset.pickProvider":"Pick a provider on the left to see its models.","settings.llm.preset.filterProviders":"Filter providers\u2026","settings.llm.preset.filterModels":"Filter models\u2026","settings.llm.preset.selectAll":"Select all","settings.llm.preset.selectNone":"Clear","settings.llm.preset.cancel":"Cancel","settings.llm.preset.add":"Add to providers","settings.llm.preset.fetchedAt":"Catalog updated {minutes}m ago","settings.llm.addModel":"Add Model","settings.llm.removeModel":"Remove Model","settings.llm.providerName":"Name","settings.llm.providerNamePlaceholder":"e.g. my-proxy","settings.llm.baseUrl":"Base URL","settings.llm.baseUrlPlaceholder":"e.g. http://localhost:6628/v1","settings.llm.apiKey":"API Key","settings.llm.apiKeyPlaceholder":"Enter API key","settings.llm.protocol":"Protocol","settings.llm.protocolOpenAI":"OpenAI Compatible","settings.llm.protocolOpenAIResponses":"OpenAI Responses (GPT-5)","settings.llm.protocolAnthropic":"Anthropic Native","settings.llm.protocolHint.anthropic":"Claude native Messages API.","settings.llm.protocolHint.openai":"Chat Completions /v1/chat/completions \u2014 GPT-4 and most compatible proxies.","settings.llm.protocolHint.openaiResponses":"Responses API /v1/responses \u2014 required for GPT-5 series.","settings.llm.modelCtxPlaceholder":"ctx","settings.llm.modelMaxPlaceholder":"max","settings.llm.models":"Candidate Model IDs","settings.llm.modelsPlaceholder":"Model IDs, comma or newline separated, e.g. claude-sonnet-4-20250514, gpt-5","settings.llm.modelsHint":"Comma or newline separated.","settings.llm.removeProvider":"Remove","settings.llm.modelSelectionTitle":"Model Selection","settings.llm.modelSelectionDesc":"Choose the default models.","settings.llm.primaryModel":"Primary Model","settings.llm.primaryModelDesc":"Used for user-facing conversations","settings.llm.fastModel":"Fast Model","settings.llm.fastModelDesc":"Used for internal tasks (memory, consolidation)","settings.llm.noModels":"No models available. Add a provider first.","settings.llm.selectModel":"Select a model...","settings.llm.save":"Save Changes","settings.llm.saving":"Saving...","settings.llm.saved":"Configuration saved","settings.llm.savedRefreshWarning":"Configuration was saved, but the live model catalog could not refresh: {error}","settings.llm.unsavedChanges":"You have unsaved changes","settings.llm.confirmRemoveProvider":"Remove this provider?","settings.llm.setupTitle":"Connect a model","settings.llm.setupDesc":"GitHub Copilot is recommended. You can also add your own API provider.","settings.llm.providerSectionHint":"Only the fields required to connect a model.","settings.tabs.dashboard":"Dashboard","settings.dashboard.totalUsers":"Total Users","settings.dashboard.onlineUsers":"Online Users","settings.dashboard.onlineAgents":"Online Agents","settings.dashboard.totalSessions":"Total Sessions","settings.dashboard.todayActive":"Today Active","settings.dashboard.todayMessages":"Today Messages","settings.dashboard.todayUserTurns":"Today User Turns","settings.dashboard.totalTokens":"Total Tokens","settings.dashboard.tokenAccuracy":"Provider-reported usage, accumulated from the version that enabled per-user token tracking. Heartbeats are excluded.","settings.dashboard.agentTurns":"Agent Turns","settings.dashboard.agentSessions":"Agent Sessions","settings.dashboard.turns":"Turns","settings.dashboard.tokens":"Tokens","settings.dashboard.inputTokens":"Input","settings.dashboard.outputTokens":"Output","settings.dashboard.cacheTokens":"Cache","settings.dashboard.today":"Today","settings.dashboard.thisWeek":"This Week","settings.dashboard.thisMonth":"This Month","settings.dashboard.all":"All","settings.dashboard.userUsage":"User Usage","settings.dashboard.agentList":"Agent List","settings.dashboard.onlineUserList":"Online Users","settings.dashboard.refresh":"Refresh","settings.dashboard.name":"Name","settings.dashboard.messages":"Messages","settings.dashboard.userTurns":"User Turns","settings.dashboard.sessions":"Sessions","settings.dashboard.requests":"Requests","settings.dashboard.traffic":"Traffic","settings.dashboard.lastLogin":"Last Login","settings.dashboard.status":"Status","settings.dashboard.latency":"Latency","settings.dashboard.version":"Version","settings.dashboard.owner":"Owner","settings.dashboard.role":"Role","settings.dashboard.agent":"Agent","settings.dashboard.online":"Online","settings.dashboard.offline":"Offline","settings.dashboard.noAgents":"No agents registered","settings.dashboard.noUserData":"No user data","settings.dashboard.noOnlineUsers":"No users online","settings.dashboard.loading":"Loading...","settings.dashboard.error":"Failed to load data","settings.dashboard.ago":"{time} ago","settings.dashboard.loadMore":"Load more ({remaining} remaining)","workbench.maximize":"Maximize panel","workbench.restore":"Restore panel","workbench.collapse":"Collapse panel","theme.switchToLight":"Switch to light theme","theme.switchToDark":"Switch to dark theme","theme.toLight":"Switch to light theme","theme.toDark":"Switch to dark theme","terminal.splitH":"Split horizontally (left-right)","terminal.splitV":"Split vertically (top-bottom)","terminal.close":"Close current terminal","terminal.autoCreate":"A terminal will be created when you switch to the Terminal tab","terminal.xtermError":"xterm.js not loaded, please refresh the page","terminal.xtermNotLoaded":"xterm.js not loaded, please refresh the page","terminal.mountError":"Terminal container mount failed","terminal.mountFailed":"Terminal container mount failed","terminal.createError":"Terminal creation failed","terminal.createFailed":"Terminal creation failed","terminal.error":"Terminal error","git.selectFolder":"Select folder","git.repoPath":"Enter Git repository path...","git.repoPathPlaceholder":"Enter Git repository path...","git.workDir":"Git working directory","git.loadStatus":"Load Git status","git.loading":"Loading Git status...","git.loadingStatus":"Loading Git status...","git.clean":"Working directory clean, no changes","git.cleanWorkDir":"Working directory clean, no changes","git.selectAgent":"Select an Agent to load Git status","git.selectAgentFirst":"Select an Agent to load Git status","git.diffOnly":"Diff only","git.fullFile":"Full file","git.zoomIn":"Zoom in","git.zoomOut":"Zoom out","git.loadingDiff":"Loading Diff...","git.clickToView":"Click a file to view diff","git.clickFileToView":"Click a file to view diff","git.selectRepo":"Select Git Repository","git.noDiff":"(No differences)","git.binaryFile":"(Binary file)","files.notLoaded":"Not loaded","files.newFile":"New File","files.newFolder":"New Folder","files.collapseAll":"Collapse All","files.openFolder":"Open Folder","files.deleteSelected":"Delete selected","files.moveSelected":"Move selected","files.enterPath":"Enter path...","files.searchFiles":"Search files... (Ctrl+P)","files.noMatch":"No matches found","files.searching":"Searching...","files.loadingTree":"Loading...","files.emptyDir":"Empty directory","files.loadingFile":"Loading file...","files.searchPlaceholder":"Search...","files.replacePlaceholder":"Replace...","files.replace":"Replace","files.replaceAll":"All","files.replaceCurrent":"Replace current","files.replaceAllTitle":"Replace all","files.clickToView":"Click a file to view content","files.selectFolder":"Select Folder","files.enterFolderName":"Enter folder name...","files.enterFileName":"Enter file name...","files.moveTarget":"Enter target directory path...","files.moveItems":"Move {count} item(s) to the specified directory","files.workDir":"Work directory: {dir}","files.enterDirPath":"Enter directory path...","files.unsavedConfirm":'"{name}" has unsaved changes. Close anyway?',"files.deleteConfirm":'Are you sure you want to delete "{name}"?',"files.deleteDirHint":" (this will delete the folder and all its contents)","files.deleteSelectedConfirm":"Are you sure you want to delete {count} selected item(s)? This action cannot be undone.","files.findPrev":"Previous (Shift+Enter)","files.findNext":"Next (Enter)","files.caseSensitive":"Case sensitive","files.regex":"Regular expression","files.unsaved":"Unsaved","files.clearSelection":"Clear selection","files.rename":"Rename","files.copyHere":"Copy","files.moveTo":"Move to...","files.download":"Download","files.enterNewName":"Enter new name...","files.loadingPreview":"Loading preview...","files.preview":"Preview","files.edit":"Edit","files.pptxNotSupported":"PPTX local preview is not supported. Please switch to Office Online mode in Settings.","files.officePreviewMode":"Office Preview Mode","files.officeOnline":"Office Online","files.localRender":"Local Rendering","proxy.port":"Port","proxy.label":"Label","proxy.add":"Add port mapping","proxy.addPort":"Add port mapping","proxy.enable":"Click to enable","proxy.clickEnable":"Click to enable","proxy.disable":"Click to disable","proxy.clickDisable":"Click to disable","proxy.openNewTab":"Open in new tab","proxy.openInBrowser":"Open in new tab","proxy.noMappings":"No port mappings","proxy.noPorts":"No port mappings","proxy.hint":"After adding ports, you can access local services on the agent machine through proxy URLs","proxy.noPortsHint":"After adding ports, you can access local services on the agent machine through proxy URLs","proxy.selectAgent":"Please select an Agent first","store.selectAgent":"Please select an Agent first","store.creatingConv":"Creating conversation...","store.loadingHistory":"Loading conversation history...","store.executionCancelled":"Execution cancelled","store.loginFailed":"Login failed","store.convClosed":"Conversation closed","store.convCreated":"New conversation created [{agent}], work directory: {workDir}","store.convResumed":"Conversation resumed [{agent}]: {sessionId}","roleplay.creating":"Creating Role Play session...","roleplay.working":"Working","roleplay.selectTeam":"Select team template","roleplay.teamDev":"Software Dev","roleplay.teamCustom":"Custom","roleplay.editRoles":"Edit Roles","roleplay.roleName":"Role ID","roleplay.roleDisplayName":"Display Name","roleplay.roleIcon":"Icon","roleplay.roleDesc":"Role Description","roleplay.rolePrompt":"Role Prompt","roleplay.removeRole":"Remove Role","roleplay.addRole":"Add Role","roleplay.start":"Start Role Play","roleplay.sidebarTitle":"Role Play","roleplay.configTitle":"Role Play","roleplay.newSession":"New Role Play","roleplay.emptyHint":"Send a message to start multi-role collaboration","roleplay.askingYou":"is asking you","roleplay.language":"Language","roleplay.rolePreview":"Role Configuration","roleplay.noAgents":"No online agents available","roleplay.inputPlaceholder":"Type a message\u2026 Use @ to mention a role","roleplay.existingSessions":"Existing Teams","roleplay.restore":"Restore","roleplay.restoring":"Restoring Role Play session...","roleplay.createNew":"Create New Team","expertPanel.title":"Expert Panel","expertPanel.search":"Search roles or actions...","expertPanel.noResults":"No results","expertPanel.clearAll":"Clear","expertPanel.persona":"Persona Prompt","expertPanel.template":"With Input \xB7 Prefix","expertPanel.templateHint":"When user types text: this prefix + user text = final prompt","expertPanel.defaultMsg":"No Input \xB7 Full Prompt","expertPanel.defaultMsgHint":"When user sends without typing: this full prompt is used as-is","expertPanel.loading":"Loading role definitions...","expertPanel.viewPrompt":"View prompt","expertPanel.customRoles":"Custom Roles","expertPanel.addRole":"Add role","expertPanel.editRole":"Edit role","expertPanel.deleteRole":"Delete role","expertPanel.noCustomRoles":"No custom roles yet","expertPanel.createFirst":"Create your first custom role","expertPanel.noActions":"No actions defined","expertPanel.deleteConfirm":'Delete role "{name}"? This cannot be undone.',"expertPanel.deleteConfirmBtn":"Delete","expertEditor.createTitle":"Create Custom Role","expertEditor.editTitle":"Edit Custom Role","expertEditor.basicInfo":"Basic Info","expertEditor.roleName":"Role Name","expertEditor.roleNamePlaceholder":"e.g. Data Analyst","expertEditor.roleTitle":"Title","expertEditor.roleTitlePlaceholder":"e.g. Senior Data Analyst","expertEditor.fullName":"Full Name","expertEditor.fullNamePlaceholder":"Optional","expertEditor.titleEn":"English Title","expertEditor.titleEnPlaceholder":"Optional","expertEditor.rolePrompt":"Role Prompt","expertEditor.messagePrefix":"Message Prefix (Chinese)","expertEditor.messagePrefixPlaceholder":"e.g. As a senior data analyst, ","expertEditor.messagePrefixEn":"Message Prefix (English)","expertEditor.messagePrefixEnPlaceholder":"As a senior data analyst, ","expertEditor.actions":"Actions","expertEditor.addAction":"Add Action","expertEditor.removeAction":"Remove","expertEditor.actionName":"Action Name","expertEditor.actionNamePlaceholder":"e.g. Data Analysis","expertEditor.actionNameEn":"English Name","expertEditor.actionNameEnPlaceholder":"Optional","expertEditor.messageTemplate":"With Input \xB7 Prefix (Chinese)","expertEditor.messageTemplatePlaceholder":"Prepended to user text when user types something","expertEditor.messageTemplateEn":"With Input \xB7 Prefix (English)","expertEditor.messageTemplateEnPlaceholder":"Prepended to user text when user types something","expertEditor.defaultMessage":"No Input \xB7 Full Prompt (Chinese)","expertEditor.defaultMessagePlaceholder":"Used as-is when user sends without typing","expertEditor.defaultMessageEn":"No Input \xB7 Full Prompt (English)","expertEditor.defaultMessageEnPlaceholder":"Used as-is when user sends without typing","expertEditor.cancel":"Cancel","expertEditor.save":"Save","expertEditor.saving":"Saving...","subAgentPanel.title":"Sub-Agents","subAgentPanel.back":"Back to list","subAgentPanel.running":"Running","subAgentPanel.completed":"Completed","subAgentPanel.waitingMessages":"Waiting for messages...","subAgentPanel.toolCount":"{count} tools","subAgentPanel.toolSummary":"{count} tool calls completed","subAgentPanel.empty":"No sub-agents","subAgentPanel.emptyHint":"Sub-agents will appear here when Claude delegates tasks","splitScreen.split":"Split screen","splitScreen.closePane":"Close pane","splitScreen.newChat":"New Chat","splitScreen.noSessions":"No sessions","splitScreen.splitToPanel":"Open in new panel","splitScreen.selectFromSidebar":"Select a conversation from the sidebar","yeaft.vp.library":"VP Library","yeaft.vp.createFirst":"+ Create your first role","yeaft.vp.empty.aria":"No virtual persons yet","yeaft.vp.avatar.aria":"{name} avatar","yeaft.vp.speaker.stateCauseAria":"State change: {cause}","yeaft.vp.status.thinking":"thinking\u2026","yeaft.vp.status.tool":"using {name}","yeaft.vp.status.done":"done \xB7 {count} tools","yeaft.vp.status.aborted":"aborted","yeaft.vp.crud.title":"VP Library","yeaft.vp.crud.close":"Close","yeaft.vp.crud.addNew":"+ New role","yeaft.vp.crud.empty":"No virtual persons yet. Create your first role to start collaborating.","yeaft.vp.crud.edit":"Edit","yeaft.vp.crud.delete":"Delete","yeaft.vp.crud.deleteConfirm":'Delete "{name}"? This removes the role.md file on disk.',"yeaft.vp.crud.form.create":"Create role","yeaft.vp.crud.form.update":"Edit role","yeaft.vp.crud.form.vpId":"VP id","yeaft.vp.crud.form.vpId.tooltip":'Letters / digits / - / _ only. Cannot start with "_", cannot be all digits, cannot be one of: all, user, system, everyone.',"yeaft.vp.crud.form.displayName":"Display name (English)","yeaft.vp.crud.form.displayNameZh":"Display name (Chinese)","yeaft.vp.crud.form.description":"Capability description (English)","yeaft.vp.crud.form.descriptionZh":"Capability description (Chinese)","yeaft.vp.crud.form.descriptionPlaceholder":"e.g. API design, migration planning, and compatibility reviews","yeaft.vp.crud.form.descriptionZhPlaceholder":"\u4F8B\u5982\uFF1AAPI \u8BBE\u8BA1\u3001\u8FC1\u79FB\u89C4\u5212\u4E0E\u517C\u5BB9\u6027\u8BC4\u5BA1","yeaft.vp.crud.form.role":"Role","yeaft.vp.crud.form.rolePlaceholder":"e.g. Product Manager","yeaft.vp.crud.form.traits":"Traits","yeaft.vp.crud.form.traitsHint":"Comma-separated short tags (e.g. curious, pragmatic).","yeaft.vp.crud.form.modelHint":"Model hint","yeaft.vp.crud.form.modelHint.none":"\u2014 default \u2014","yeaft.vp.crud.form.modelHint.primary":"primary","yeaft.vp.crud.form.modelHint.fast":"fast","yeaft.vp.crud.form.persona":"Persona (markdown)","yeaft.vp.crud.form.personaPlaceholder":"Describe how this role should think, speak, and decide...","yeaft.vp.crud.form.submit":"Save","yeaft.vp.crud.form.cancel":"Cancel","yeaft.vp.crud.form.ok":"Looks good","yeaft.vp.crud.form.idLocked":"VP id cannot be changed after creation.","yeaft.vp.crud.saving":"Saving\u2026","yeaft.vp.crud.saveFailed":"Save failed: {error}","yeaft.vp.crud.deleteFailed":"Delete failed: {error}","yeaft.vp.crud.viewPrompt":"View prompt","yeaft.vp.crud.view.title":"VP prompt","yeaft.vp.crud.view.personaEmpty":"(no persona body \u2014 only metadata is defined)","yeaft.vp.crud.view.back":"Back","yeaft.vp.crud.view.editFromHere":"Edit this VP","yeaft.vp.crud.view.removed":"This VP was removed elsewhere \u2014 returning to the list.","yeaft.vp.crud.stockBadge":"Stock","yeaft.vp.crud.stockReadOnly":"Stock VPs ship with the agent and cannot be edited or deleted.","yeaft.vp.idError.empty_or_non_string":"VP id is required.","yeaft.vp.idError.too_long":"VP id is too long (max 40 characters).","yeaft.vp.idError.illegal_character":'Only letters, digits, "-" and "_" are allowed.',"yeaft.vp.idError.underscore_prefix_reserved":'VP id cannot start with "_" (reserved for system roles).',"yeaft.vp.idError.pure_digits":"VP id cannot be all digits.","yeaft.vp.idError.reserved":"VP id cannot be one of the reserved names (all, user, system, everyone).","yeaft.vp.idError.duplicate":"A role with this VP id already exists.","yeaft.vp.idError.not_found":"This VP does not exist \u2014 it may have been deleted.","yeaft.vp.idError.stock_readonly":"Stock VPs cannot be edited or deleted.","yeaft.vp.idError.unknown":"An unexpected error occurred. Please try again.","yeaft.vp.reason.personaEdit":"Persona updated","yeaft.vp.reason.traitsEdit":"Traits updated","yeaft.vp.reason.manualReload":"Reloaded","yeaft.vp.reason.fileRemoved":"Removed","yeaft.vp.reason.toast.updated":"{name}: {reason}","yeaft.vp.reason.toast.removed":"{name} was removed","yeaft.message.timeAria":"Sent at {time}","yeaft.user.youLabel":"You","yeaft.session.sidebarTitle":"Sessions","yeaft.session.sidebarAria":"Sessions section","yeaft.session.newButton":"+ New session","yeaft.session.newButtonAria":"Create a new session","yeaft.session.defaultName":"Default","yeaft.session.moreActions":"More actions","yeaft.session.archivingEllipsis":"Archiving\u2026","yeaft.session.deletingEllipsis":"Deleting\u2026","yeaft.session.renamingEllipsis":"Renaming\u2026","yeaft.session.empty":"No sessions yet.","yeaft.session.membersCount":"{count} members","yeaft.session.oneMember":"1 member","yeaft.session.noMembers":"Empty \u2014 invite a VP","yeaft.session.defaultBadge":"default","yeaft.session.archive":"Archive","yeaft.session.archiveConfirm":'Archive "{name}"? You can recover it from disk later.',"yeaft.session.delete":"Delete","yeaft.session.deleteConfirm":'Delete "{name}"? This permanently removes the session and all its data \u2014 this cannot be undone.',"yeaft.session.rename":"Rename","yeaft.session.openSettings":"Settings","yeaft.session.removeFromList":"Remove","yeaft.session.manageMembers":"Manage members","yeaft.session.memberCount.one":"1 member","yeaft.session.memberCount.other":"{count} members","yeaft.session.renamePrompt":'New name for "{name}":',"yeaft.session.editModal.renameTitle":"Rename session","yeaft.session.editModal.renameBody":'Choose a new name for "{name}".',"yeaft.session.editModal.renameSubmit":"Save","yeaft.session.editModal.archiveTitle":"Archive session","yeaft.session.editModal.archiveBody":'Archive "{name}"? You can recover it from disk later.',"yeaft.session.editModal.archiveSubmit":"Archive","yeaft.session.editModal.deleteTitle":"Delete session","yeaft.session.editModal.deleteBody":'Delete "{name}"? This permanently removes the session and all its data \u2014 this cannot be undone.',"yeaft.session.editModal.deleteSubmit":"Delete","yeaft.session.editModal.newNameLabel":"New name","yeaft.session.editModal.cancel":"Cancel","yeaft.session.editModal.close":"Close","yeaft.session.error.invalid_name":"Session name cannot be empty.","yeaft.session.error.duplicate":"A session with this id already exists.","yeaft.session.error.not_found":"Session not found.","yeaft.session.error.default_not_in_roster":"The default VP must be in the roster.","yeaft.session.error.no_default_vp":"This session has no members. Add a VP from the library to start chatting.","yeaft.session.error.reserved":"One of the selected ids is reserved (all, user, system, everyone).","yeaft.session.error.unknown":"Session operation failed: {message}","yeaft.session.error.timeout":"Session operation timed out \u2014 try again.","yeaft.session.invite.title":"Invite a VP","yeaft.session.invite.body":'"{name}" has no members yet. Add a VP from your library to start chatting.',"yeaft.session.invite.openLibrary":"Open VP Library","yeaft.session.invite.dismiss":"Not now","yeaft.session.empty.title":"Empty session","yeaft.session.empty.hint":'"{name}" has no members yet. Add a VP to start chatting.',"yeaft.session.empty.cta":"Manage members","yeaft.session.members.title":'Manage members of "{name}"',"yeaft.session.members.aria":"Session members manager","yeaft.session.members.close":"Close","yeaft.session.members.done":"Done","yeaft.session.members.empty":"No VPs available \u2014 create one in the VP Library first.","yeaft.session.members.loading":"Loading VPs\u2026","yeaft.session.members.defaultHint":"Default VP (replies when no @mention is given)","yeaft.session.members.memberCount":"{count} selected","yeaft.session.members.actionFailed":"Action failed: {error}","yeaft.session.members.openLibrary":"Open VP Library","yeaft.session.members.openLibraryHint":"Create a new VP or view a VP's prompt.","yeaft.session.announcement.label":"Announcement","yeaft.session.announcement.hintEmpty":"No announcement \u2014 click \u270F\uFE0F to add one.","yeaft.session.announcement.emptyBody":"No announcement set. Add a message that every VP in this session will see at the top of its system prompt \u2014 useful for shared context, ground rules, or a CLAUDE.md-style brief.","yeaft.session.announcement.placeholder":"Write a shared briefing for all VPs in this session\u2026","yeaft.session.announcement.edit":"Edit announcement","yeaft.session.announcement.editTitle":"Edit session announcement","yeaft.session.announcement.saving":"Saving\u2026","yeaft.session.announcement.saveFailed":"Save failed: {error}","yeaft.session.announcement.openSettings":"Open session settings","yeaft.session.settings.title":"{name} \u2014 session settings","yeaft.session.settings.short":"Session","yeaft.session.settings.close":"Close","yeaft.session.settings.nav.session":"Session","yeaft.session.settings.nav.members":"Members","yeaft.session.settings.nav.memory":"Memory","yeaft.session.settings.announcement.heading":"Session announcement","yeaft.session.settings.announcement.help":"Shared at the top of every VP's system prompt while in this session. Like a CLAUDE.md for the team.","yeaft.session.settings.members.heading":"Members","yeaft.session.settings.rename.heading":"Rename session","yeaft.session.settings.rename.label":"New name","yeaft.session.settings.rename.save":"Save name","yeaft.session.settings.rename.saving":"Saving\u2026","yeaft.session.settings.memory.heading":"Session memory","yeaft.session.settings.memory.help":"Run the dream consolidation now. Reads new messages since the last run, extracts facts, and merges them into the session's summary so the Resident layer reflects the latest conversation.","yeaft.session.settings.memory.runNow":"Run dream now","yeaft.session.settings.memory.running":"Running\u2026","yeaft.session.settings.memory.lastSuccess":"Last run {time} \u2014 {count} target(s) updated.","yeaft.session.settings.memory.lastError":"Last run failed: {error}","yeaft.session.settings.danger.heading":"Delete session","yeaft.session.settings.danger.deleteHelp":"This permanently deletes the session, removing session.json and all message history on disk. It cannot be undone.","yeaft.session.settings.danger.deleteBtn":"Delete session","yeaft.vp.mention.placeholder":"Search role by id or name\u2026","yeaft.vp.mention.noMatch":"No matching role","yeaft.vp.mention.count":"{count} mentions","yeaft.feature.reject.missing_group_id":"Message send failed: session not specified.","yeaft.feature.reject.missing_feature_id":"Message send failed: task context lost.","yeaft.feature.reject.missing_vp_id":"Message send failed: speaker not set.","yeaft.feature.reject.invalid_vp_id":"Message send failed: invalid speaker id.","yeaft.feature.reject.empty_text":"Message send failed: empty message.","yeaft.feature.reject.text_too_long":"Message send failed: text too long (max 16 KiB).","yeaft.feature.reject.unknown":"Message send failed.","yeaft.feature.pill.label":"task","yeaft.feature.messageTime.aria":"Sent at {time}","yeaft.vp.turnBlock.elapsedTitle":"Time elapsed since this turn started","yeaft.vp.turnBlock.retryingRequest":"Response stalled; retrying with a fresh request ({attempt}/{max})","yeaft.vp.turnBlock.retryingContinue":"Response stalled; continuing with a fresh request ({attempt}/{max})","yeaft.sessionStatus.aria":"Session status","yeaft.sessionStatus.title":"Session status","yeaft.sessionStatus.announcement":"Announcement","yeaft.sessionStatus.announcementEmpty":"No announcement","yeaft.sessionStatus.announcementAdd":"Add announcement","yeaft.sessionStatus.announcementEdit":"Edit announcement","yeaft.sessionStatus.vps":"VPs","yeaft.sessionStatus.backgroundTasks":"Background tasks","yeaft.sessionStatus.noLogPreview":"No log output yet.","yeaft.sessionStatus.task.subAgentStarted":"{name} started","yeaft.sessionStatus.task.subAgentStartedWithMission":"{name} started: {mission}","yeaft.sessionStatus.task.subAgentStatus":"{name} is {status}","yeaft.sessionStatus.task.subAgentStatusUpdated":"{name} status updated","yeaft.sessionStatus.task.subAgentResult":"{name} result: {text}","yeaft.sessionStatus.task.subAgentProducedResult":"{name} produced a result","yeaft.sessionStatus.task.subAgentUsedTool":"{name} used {tool}","yeaft.sessionStatus.task.subAgentFinishedTool":"{name} finished {tool}","yeaft.sessionStatus.task.subAgentUsage":"{name} used {tokens} tokens","yeaft.sessionStatus.task.subAgentEvent":"{name}: {text}","yeaft.sessionStatus.task.subAgentUserPrompt":"You: {text}","yeaft.sessionStatus.task.subAgentToolSummary":"{count} tool calls completed","yeaft.sessionStatus.task.subAgentError":"{name} error: {error}","yeaft.sessionStatus.task.subAgentHitError":"{name} hit an error","yeaft.sessionStatus.task.subAgentNoReadableEvents":"No readable sub-agent activity yet.","yeaft.sessionStatus.task.promptPlaceholder":"Add guidance for this sub-agent\u2026","yeaft.sessionStatus.task.promptSend":"Send","yeaft.sessionStatus.task.promptSending":"Sending\u2026","yeaft.sessionStatus.task.promptFailed":"Failed to send prompt.","yeaft.sessionStatus.task.title":"Task","yeaft.sessionStatus.task.command":"Command","yeaft.sessionStatus.task.stop":"Stop task","yeaft.sessionStatus.task.stopping":"Stopping\u2026","yeaft.sessionStatus.task.kind.subAgent":"sub-agent","yeaft.sessionStatus.task.kind.shell":"shell","yeaft.sessionStatus.show":"Show Session status","yeaft.sessionStatus.hide":"Hide Session status","yeaft.sessionStatus.close":"Close Session status","yeaft.vpTimeline.empty":"No VPs in this Session yet.","yeaft.vpTimeline.resizeTitle":"Drag to resize","yeaft.vpTimeline.status.idle":"idle","yeaft.vpTimeline.status.typing":"typing\u2026","yeaft.vpTimeline.status.thinking":"thinking\u2026","yeaft.vpTimeline.status.retrying":"retrying request\u2026","yeaft.vpTimeline.status.streaming":"streaming","yeaft.vpTimeline.status.tool":"using tool\u2026","yeaft.vpTimeline.status.error":"error","yeaft.vpTimeline.status.offline":"offline","yeaft.vpTimeline.abort":"Abort","yeaft.vpTimeline.edit":"Edit VP","yeaft.vpTimeline.mention":"Click to @-mention this VP","yeaft.vpTimeline.expand":"Toggle task details","yeaft.toolStats.title":"Tool Usage Stats","yeaft.toolStats.refresh":"Refresh","yeaft.toolStats.close":"Close","yeaft.toolStats.tabAll":"All tools","yeaft.toolStats.tabUnused":"Unused","yeaft.toolStats.loading":"Loading\u2026","yeaft.toolStats.notLoaded":"No data yet \u2014 click refresh.","yeaft.toolStats.empty":"(no tool calls recorded yet)","yeaft.toolStats.noneUnused":"(every registered tool has been called at least once)","yeaft.toolStats.fetchedAt":"Fetched at","yeaft.toolStats.col.name":"Tool","yeaft.toolStats.col.calls":"Calls","yeaft.toolStats.col.errors":"Errors","yeaft.toolStats.col.errRate":"Err%","yeaft.toolStats.col.p50":"p50","yeaft.toolStats.col.p95":"p95","yeaft.toolStats.col.avg":"Avg","yeaft.toolStats.col.last":"Last","yeaft.toolStats.buttonLabel":"Tool Stats","workCenter.title":"Work Center","workCenter.subtitle":"Persistent work owned by this Agent","workCenter.agent":"Agent","workCenter.selectAgent":"Select Agent","workCenter.noOnlineAgents":"No online agents","workCenter.noAvailableAgents":"No compatible online Agents","workCenter.new":"New","workCenter.newWorkItem":"New work item","workCenter.workItem":"Work item","workCenter.createFirst":"Create first work item","workCenter.backToChat":"Back to chat","workCenter.refresh":"Refresh","workCenter.search":"Search work items","workCenter.filter":"Filter","workCenter.filterAttention":"Needs attention","workCenter.filterActive":"Active","workCenter.filterAll":"All","workCenter.filterDone":"Done","workCenter.attentionItems":"Needs attention","workCenter.board.active":"Active","workCenter.board.needsAttention":"Needs attention","workCenter.board.closed":"Closed","workCenter.board.emptyLane":"No work items","workCenter.board.lanes":"Work item lanes","workCenter.filterVp":"Filter by VP","workCenter.filterType":"Filter by type","workCenter.filterUpdated":"Filter by update time","workCenter.allVps":"All VPs","workCenter.allTypes":"All types","workCenter.anyTime":"Any time","workCenter.lastDay":"Last 24 hours","workCenter.lastWeek":"Last 7 days","workCenter.deleteWorkItem":"Delete Work Item","workCenter.deleteConfirm":"Permanently delete this Work Item, its execution history, and attachments?","workCenter.deleteRequiresStop":"Stop this Work Item before deleting it","workCenter.lastMonth":"Last 30 days","workCenter.assignment.planned":"Planned assignment","workCenter.created":"Created","workCenter.files":"files","workCenter.loadMore":"Load more","workCenter.activeItems":"Active work","workCenter.allItems":"All work items","workCenter.completedItems":"Completed","workCenter.watcherActive":"Watcher active","workCenter.loading":"Loading work items\u2026","workCenter.noTimestamp":"No timestamp","workCenter.updated":"Updated","workCenter.emptyTitle":"No work items yet","workCenter.emptyBody":"Create a persistent task when work must continue beyond one conversation turn.","workCenter.noAttentionTitle":"Nothing needs attention","workCenter.noAttentionBody":"Work Items waiting for you or needing recovery will appear here.","workCenter.noActiveTitle":"No active work items","workCenter.noActiveBody":"Draft, ready, and running Work Items will appear here.","workCenter.noCompletedTitle":"No completed work items","workCenter.noCompletedBody":"Completed work items will appear here.","workCenter.noMatchesTitle":"No matching work items","workCenter.noMatchesBody":"Try a different search or filter.","workCenter.selectTitle":"Work item details","workCenter.detailLoading":"Loading full details\u2026","workCenter.detailLoadFailed":"Could not load full details","workCenter.start":"Start","workCenter.retry":"Retry","workCenter.cancel":"Cancel","workCenter.closeWorkItem":"Close details","workCenter.cancelWorkItem":"Stop work item","workCenter.cancelWorkItemHint":"Stop this Work Item and all unfinished Actions.","workCenter.cancelConfirm":"Stop this work item and its unfinished Actions?","workCenter.stopWorkItem":"Stop work item","workCenter.resumeWorkItem":"Resume work item","workCenter.breadcrumbs":"Work Center navigation","workCenter.actionNumber":"Action {number}","workCenter.actionBreadcrumb":"Action {number}: {description}","workCenter.untitledAction":"Untitled Action","workCenter.workItems":"Work items","workCenter.description":"Description","workCenter.goal":"Goal","workCenter.acceptanceCriteria":"Acceptance criteria","workCenter.noCriteria":"No criteria provided","workCenter.failureReason":"Failure reason","workCenter.workflow":"Workflow","workCenter.triageSummary":"Triage summary","workCenter.actionFlow":"Action flow","workCenter.viewActions":"View Actions","workCenter.actionsPanel":"Actions","workCenter.closeActions":"Close Actions","workCenter.actionCount":"{count} Actions","workCenter.noActionSummary":"No summary yet","workCenter.actionProgress":"{completed} / {total} Actions","workCenter.currentAction":"Current Action","workCenter.expandActions":"Show Actions","workCenter.collapseActions":"Collapse","workCenter.actionObjective":"What to do","workCenter.actionApproach":"How to do it","workCenter.actionExpectedOutcome":"Expected result","workCenter.dependencies":"Dependencies","workCenter.actionResult":"Latest result","workCenter.currentProgress":"Current progress","workCenter.actionMessages":"Messages","workCenter.loops":"loops","workCenter.tools":"tools","workCenter.noActionMessages":"No messages yet.","workCenter.actionDetails":"Action details","workCenter.selectAction":"Select an Action","workCenter.backToWorkItems":"Work items","workCenter.backToActions":"Back to Actions","workCenter.you":"You","workCenter.noRequestDetails":"No execution records are available for this Action yet.","workCenter.loadingRequests":"Loading execution records\u2026","workCenter.loadingRequestDetail":"Loading tool evidence\u2026","workCenter.requestDetailUnavailable":"Tool evidence is unavailable. Try again.","workCenter.noRequestLoops":"This execution has no retained Loop details.","workCenter.requestDetailTruncated":"Large execution: {summarized} Loops are summarized and {omitted} older Loops are omitted.","workCenter.loopDetailTruncated":"Large Loop: showing retained tool evidence.","workCenter.loadEarlierMessages":"Load earlier messages","workCenter.loadingEarlierMessages":"Loading earlier messages\u2026","workCenter.unknownModel":"Unknown model","workCenter.loop":"Loop","workCenter.actionBrief":"Task brief","workCenter.executionSummary":"Execution summary","workCenter.toolParameters":"Parameters","workCenter.toolResult":"Result","workCenter.noToolCalls":"No tool calls in this Loop.","workCenter.actionInputPlaceholder":"Add context, answer a question, or redirect this Action","workCenter.actionInputResumeHint":"Your input resumes this Action with the additional context.","workCenter.waitingQuestionTitle":"Input required","workCenter.actionInputRetryHint":"Add instructions or files, then rerun this Action with the new context.","workCenter.actionInputContinueHint":"Direct intervention for this Action only.","workCenter.actionFailedTitle":"Why this Action failed","workCenter.failedAt":"Failed at","workCenter.actionFailureRecovery":"Choose this Action in the Work Item composer to send corrected instructions.","workCenter.sendInput":"Send to Action","workCenter.sendingInput":"Sending\u2026","workCenter.retryAction":"Retry Action","workCenter.sendAndRetryAction":"Send and retry Action","workCenter.coordinatorDecision.guide_actions":"Action instructions updated","workCenter.coordinatorDecision.replan":"Goal or plan updated","workCenter.coordinatorDecision.request_human":"Human input requested","workCenter.conversation":"Conversation","workCenter.contentPane":"Content","workCenter.workItemPanes":"Work item panes","workCenter.coordinator":"Coordinator","workCenter.coordinatorTargetHint":"Work Item planning and coordination","workCenter.composerTarget":"Message target","workCenter.targetUnavailable":"Selected Action is no longer available","workCenter.targetUnavailableHelp":"Choose another target before sending. This draft was not redirected.","workCenter.sendToCoordinatorInstead":"Send to Coordinator instead","workCenter.sendToTarget":"Send to {target}","workCenter.answerWithTarget":"Choose the relevant target in the Conversation composer, then reply.","workCenter.conversationThinking":"Working\u2026","workCenter.conversationReadOnly":"This work item is closed. The conversation remains available.","workCenter.conversationPlaceholder":"Message about this work item","workCenter.sendMessage":"Send message","workCenter.messageSpeakerRole":"{name} \xB7 {role}","workCenter.originalRequest":"Original request","workCenter.actionMessageScopeTitle":"Message this Action","workCenter.actionMessageScope":"Only this Action receives the message.","workCenter.actionConversation":"Conversation","workCenter.actionConversationWith":"Action executor","workCenter.actionViews":"Action views","workCenter.actionExecutor":"Executor","workCenter.actionExecutorPending":"Executor pending","workCenter.actionInformation":"Action information","workCenter.messageExecutor":"Message {name}","workCenter.actionChatPlaceholder":"Message {name} from the Conversation composer","workCenter.statusLabel":"Status","workCenter.llmRequestsLabel":"LLM requests","workCenter.loopsLabel":"Loops","workCenter.toolsLabel":"Tools","workCenter.tokensLabel":"Tokens","workCenter.workItemMessagePlaceholder":"Add direction for the whole Work Item","workCenter.sendWorkItemMessage":"Send to Work Item","workCenter.fromSession":"Create a work item from this Session","workCenter.llmRequestCount":"{count} LLM requests","workCenter.loopCount":"{count} loops","workCenter.toolCount":"{count} tools","workCenter.tokenCount":"{count} tokens","workCenter.tokenBreakdown":"{input} input / {output} output / {cache} cached","workCenter.guidance":"Add guidance to the current Action","workCenter.guidanceHint":"Clarify constraints or redirect the current Action","workCenter.guidanceRestartHint":"This restarts the current Action with the new guidance.","workCenter.sendGuidance":"Send guidance","workCenter.reuseMemory":"Use relevant Agent memory and completed work from this project","workCenter.reuseMemoryHelp":"Includes scope-bounded Agent memory plus structured summaries and evidence from completed WorkItems with the same canonical project directory. Raw tool output is not reused.","workCenter.resumeAnswer":"Answer the waiting question","workCenter.resumeAnswerHint":"Provide the information required to continue","workCenter.answerInActionDetail":"Target the current Action in the Conversation composer, then reply.","workCenter.selectPrompt":"Select a work item to inspect its workflow.","workCenter.createHint":"Describe what you need. Triage will turn it into a goal, acceptance criteria, and Actions.","workCenter.requirement":"Requirement","workCenter.requirementHint":"Describe the problem, desired outcome, and any constraints in your own words","workCenter.requirementHelp":"Triage will generate the title, goal, acceptance criteria, type, and execution plan.","workCenter.titleField":"Title","workCenter.titleHint":"A short, specific outcome","workCenter.goalHint":"Describe the result the Agent must deliver","workCenter.criteriaHint":"One criterion per line","workCenter.attachments":"Attachments","workCenter.attachmentsHelp":"Images, PDFs, and text files stay bound to this Work Item and are available to every Action.","workCenter.attachmentsUnsupported":"The selected Agent does not support Work Item attachments.","workCenter.addAttachments":"Add files","workCenter.attachmentsUploading":"Uploading\u2026","workCenter.attachmentsUploadFailed":"Attachment upload failed","workCenter.pendingEnvelopeLocked":"An unconfirmed request is locked to its original identity.","workCenter.replacePendingAttachments":"Replace attachments","workCenter.discardPendingEnvelope":"Discard pending request","workCenter.pendingEnvelopeChanged":"The pending request changed; reopen this Work Item and try again.","workCenter.removeAttachment":"Remove from draft","workCenter.previewAttachment":"Open attachment","workCenter.openAttachmentNamed":"Open attachment {name}","workCenter.openingAttachment":"Opening attachment\u2026","workCenter.attachmentPreviewFailed":"Could not open the attachment. Try again.","workCenter.attachmentOpenBlocked":"The browser blocked the attachment window. Allow pop-ups and try again.","workCenter.execution":"Execution","workCenter.executionHint":"Choose where and how this work item starts.","workCenter.workDir":"Working directory","workCenter.workDirHint":"Choose an existing project directory","workCenter.chooseFolder":"Choose folder","workCenter.workDirPickerHelp":"Select an existing folder on the chosen Agent.","workCenter.folderPickerHint":"Choose the project folder this Work Item can read and modify.","workCenter.folderPickerSelectionHint":"Double-click to open a folder, or select it and confirm.","workCenter.startImmediately":"Start immediately","workCenter.startImmediatelyHint":"Turn this off to create a draft you can review first.","workCenter.creating":"Creating\u2026","workCenter.create":"Create","workCenter.status.draft":"draft","workCenter.status.ready":"ready","workCenter.status.running":"running","workCenter.status.waiting":"waiting","workCenter.status.needs_attention":"needs attention","workCenter.status.done":"done","workCenter.status.cancelled":"cancelled","workCenter.status.completed":"completed","workCenter.status.failed":"failed","workCenter.status.superseded":"superseded","workCenter.action.triage":"Triage","workCenter.action.implement":"Implement","workCenter.action.review":"Review","workCenter.action.integrate":"Integrate","workCenter.action.deliver":"Deliver","workCenter.action.test":"Test","workCenter.action.research":"Research","workCenter.action.design":"Design","workCenter.action.diagnose":"Diagnose","workCenter.action.migrate":"Migrate","workCenter.action.document":"Document","workCenter.action.operate":"Operate","workCenter.action.write":"Write","workCenter.action.custom":"Custom","workCenter.assignment.auto":"Use workflow policy","workCenter.model.inherit":"Use workflow model","workCenter.model.defaultProvider":"default provider","workCenter.planPreview":"Execution plan","workCenter.planPreviewHelp":"Resolved from this Agent\u2019s VP pool and model settings.","workCenter.settings.title":"Work Center settings","workCenter.settings.subtitle":"Configure the Coordinator plus reusable Action prompts, models, and effort for AI-planned work.","workCenter.settings.workflow":"Workflow","workCenter.settings.workflowHelp":"Triage chooses the task-specific Actions and executors dynamically.","workCenter.settings.aiWorkflowHelp":"Triage classifies each WorkItem and creates a validated flow of 1\u20138 task-specific Actions. Built-in Action policies are reusable defaults; triage may create a precise domain type when needed.","workCenter.settings.globalInstructions":"Global Agent instructions","workCenter.settings.globalInstructionsHint":"Example: Follow the repository release policy, require independent review, and never create deployment tags without explicit approval.","workCenter.settings.globalInstructionsHelp":"Stored at Agent level and frozen into every new WorkItem. Applied to triage and every generated Action, below the WorkItem contract and system/tool safety rules. Existing WorkItems keep their original snapshot.","workCenter.settings.actionPolicies":"Built-in Action policies","workCenter.settings.actionPoliciesHelp":"These are reusable execution baselines, not a fixed workflow. Unknown domain-specific Action types use the Custom policy plus their triage-generated type and objective.","workCenter.settings.dynamicInstructionHelp":"The AI adds the WorkItem contract, global instructions, prior Action context, memory, and a task-specific objective. This prompt defines the reusable behavior for this Action type.","workCenter.settings.models":"Models","workCenter.settings.modelsHelp":"Providers and credentials stay in Agent LLM settings. Work Center only selects available models.","workCenter.settings.dynamicModelsHelp":"Choose the Coordinator model separately from the models that execute Actions.","workCenter.settings.coordinatorModel":"Coordinator","workCenter.settings.coordinatorModelHelp":"Used for Work Item conversation, goal changes, and replanning. It never executes repository tools.","workCenter.settings.allActions":"Fallback for all Actions","workCenter.settings.maxConcurrentActions":"Maximum concurrent Actions","workCenter.settings.maxConcurrentActionsHelp":"Defaults to 3. Non-Git, dirty, shared, and integration work remains serial.","workCenter.workItemType":"Type","workCenter.typeAuto":"Auto \u2014 let the LLM infer","workCenter.typeHelp":"Choose a task category, or use Auto for AI inference. AI still plans the concrete Actions.","workCenter.planning":"Planning","workCenter.aiPlan":"AI-planned execution","workCenter.aiPlanHelp":"Triage chooses the task type, Actions, executors, and the smallest reliable flow. Work Center settings control model and effort.","workCenter.settings.manageProviders":"Manage Agent models","workCenter.settings.assignment":"VP selection","workCenter.settings.assignment.auto":"Auto from all VPs","workCenter.settings.assignment.pool":"Candidate pool","workCenter.settings.assignment.fixed":"Fixed VP","workCenter.settings.capability":"Required capability","workCenter.settings.vp":"Virtual Person","workCenter.settings.poolMembers":"Candidate VPs","workCenter.settings.modelPolicy":"Model policy","workCenter.settings.model.inherit":"Inherit from VP","workCenter.settings.model.primary":"Agent primary model","workCenter.settings.model.fast":"Agent fast model","workCenter.settings.model.specific":"Specific model","workCenter.settings.model":"Model","workCenter.settings.effort":"Reasoning effort","workCenter.settings.effortDefault":"Model default","workCenter.settings.effortHelp":"Overrides the selected model\u2019s default reasoning effort for every Work Center Action.","workCenter.settings.effortChooseModelHelp":"Select the Agent primary model, fast model, or a specific model to configure effort. Inherit from VP uses each VP\u2019s model default.","workCenter.settings.effortUnsupportedHelp":"The selected model does not expose configurable effort, so its model default is used.","workCenter.settings.saving":"Saving\u2026","workCenter.settings.reload":"Reload settings","workCenter.settings.conflict":"Settings changed elsewhere. Reload before saving again.","workCenter.settings.upgradeRequired":"This Agent version cannot save Work Center settings. The current values are shown read-only; upgrade the Agent to edit and save them.","workCenter.settings.saveNotConfirmed":"The Agent did not confirm the submitted prompts and model policy. Settings were not closed; reload or upgrade the Agent before trying again.","workCenter.settings.addWorkflow":"Duplicate workflow","workCenter.settings.removeWorkflow":"Remove","workCenter.settings.newWorkflow":"Workflow {index}","workCenter.settings.workflowName":"Workflow name","workCenter.settings.newStage":"New stage","workCenter.settings.addStage":"Add stage","workCenter.settings.removeStage":"Remove stage","workCenter.settings.moveUp":"Move stage up","workCenter.settings.moveDown":"Move stage down","workCenter.settings.stageType":"Stage type","workCenter.settings.reviewReturnStage":"Return to stage when changes are requested","workCenter.settings.instruction":"Stage prompt","workCenter.settings.instructionHint":"Define what this stage must do.","workCenter.settings.instructionHelp":"The WorkItem goal, acceptance criteria, and reusable context are added automatically at run time.","workCenter.settings.instructionReset":"Restore default"}});function Ba(){return typeof navigator>"u"||!navigator?"":navigator.userAgent||""}function Zs(){let e=Ba();return/Android|iPhone|iPad|iPod|Windows Phone|IEMobile|BlackBerry|Opera Mini/i.test(e)}function di(){return/MicroMessenger/i.test(Ba())}function ui(){return/AlipayClient/i.test(Ba())}var qa=F(()=>{});var ap,lp=F(()=>{gt();$t();qa();ap={name:"LoginPage",template:`
|
|
15
15
|
<div class="login-page">
|
|
16
16
|
<button class="login-lang-toggle" @click="toggleLang">
|
|
17
17
|
{{ currentLocale === 'zh-CN' ? 'EN' : '\u4E2D\u6587' }}
|
|
@@ -303,7 +303,7 @@ The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is al
|
|
|
303
303
|
</template>
|
|
304
304
|
</div>
|
|
305
305
|
</div>
|
|
306
|
-
`,setup(){let e=De(),t=Vue.inject("t"),s=Vue.inject("locale"),n=Vue.ref(""),r=Vue.ref(""),i=Vue.ref(""),o=Vue.ref(""),a=Vue.ref(""),l=Vue.ref(null),c=Vue.ref(null),d=Vue.ref(null),u=Vue.ref(null),f=Vue.ref(null),p=Vue.ref(null),g=Vue.ref(""),m=Vue.ref(localStorage.getItem("loginMode")==="credentials"?"credentials":"oauth");Vue.watch(m,N=>localStorage.setItem("loginMode",N));let b=Vue.ref(""),I=Vue.ref(""),y=Vue.ref(""),S=Vue.ref(""),w=Vue.ref(""),v=Vue.ref(!1),h=Vue.ref(""),M=Vue.ref(""),x=Vue.ref(""),E=Vue.ref(""),V=Vue.ref(""),L=Vue.ref(""),R=Vue.ref(!1),P=Vue.ref(!1),A=()=>{a.value="",e.error=null,h.value="email",M.value="",E.value="",V.value="",L.value="",x.value="",P.value=!1},_=()=>{h.value="",x.value="",P.value=!1},j=async()=>{if(a.value="",!M.value||!/.+@.+\..+/.test(M.value)){a.value=t("login.forgot.emailInvalid");return}R.value=!0;try{let N=await e.requestPasswordReset(M.value.trim());if(!N)return;x.value=N,h.value="verify"}finally{R.value=!1}},
|
|
306
|
+
`,setup(){let e=De(),t=Vue.inject("t"),s=Vue.inject("locale"),n=Vue.ref(""),r=Vue.ref(""),i=Vue.ref(""),o=Vue.ref(""),a=Vue.ref(""),l=Vue.ref(null),c=Vue.ref(null),d=Vue.ref(null),u=Vue.ref(null),f=Vue.ref(null),p=Vue.ref(null),g=Vue.ref(""),m=Vue.ref(localStorage.getItem("loginMode")==="credentials"?"credentials":"oauth");Vue.watch(m,N=>localStorage.setItem("loginMode",N));let b=Vue.ref(""),I=Vue.ref(""),y=Vue.ref(""),S=Vue.ref(""),w=Vue.ref(""),v=Vue.ref(!1),h=Vue.ref(""),M=Vue.ref(""),x=Vue.ref(""),E=Vue.ref(""),V=Vue.ref(""),L=Vue.ref(""),R=Vue.ref(!1),P=Vue.ref(!1),A=()=>{a.value="",e.error=null,h.value="email",M.value="",E.value="",V.value="",L.value="",x.value="",P.value=!1},_=()=>{h.value="",x.value="",P.value=!1},j=async()=>{if(a.value="",!M.value||!/.+@.+\..+/.test(M.value)){a.value=t("login.forgot.emailInvalid");return}R.value=!0;try{let N=await e.requestPasswordReset(M.value.trim());if(!N)return;x.value=N,h.value="verify"}finally{R.value=!1}},q=async()=>{if(a.value="",!E.value){a.value=t("login.error.enterVerifyCode");return}if(!V.value||V.value.length<6){a.value=t("login.error.passwordMinLen");return}if(V.value!==L.value){a.value=t("login.error.passwordMismatch");return}R.value=!0;try{await e.verifyPasswordReset(x.value,E.value,V.value)&&(P.value=!0,setTimeout(()=>{_(),m.value="credentials"},1500))}finally{R.value=!1}},z={alipay:'<svg viewBox="0 0 32 32" width="22" height="22" aria-hidden="true"><rect width="32" height="32" rx="6" fill="#1677FF"/><path fill="#fff" d="M25 18.6c-1.5-.5-3-1-4.6-1.7.4-.8.8-1.6 1.1-2.5h-2.9v-1h3.4v-.5h-3.4v-1.6h-1.4c-.3 0-.3.3-.3.3v1.3h-3.6v.5h3.6v1H11v.5h5.7c-.2.6-.4 1.2-.7 1.7-1.7-.5-3.4-.8-4.7-.8-2.2 0-3.7 1-3.8 2.5-.1 1.4.9 3 3.4 3 1.8 0 3.4-.9 4.7-2.5 2.2 1 4.2 2 6.6 2.9.3-.4.5-.8.7-1.2.2-.4.1-.9-.1-1.3zM11 19.7c-1.8 0-2.3-1.3-2.1-2 .1-.4.6-.9 1.4-1.1.4-.1 1.4-.1 2.4.2.9.2 1.8.5 2.7.8-.7 1.4-2.1 2.1-4.4 2.1z"/></svg>',microsoft:'<svg viewBox="0 0 21 21" width="20" height="20" aria-hidden="true"><rect x="1" y="1" width="9" height="9" fill="#f25022"/><rect x="1" y="11" width="9" height="9" fill="#00a4ef"/><rect x="11" y="1" width="9" height="9" fill="#7fba00"/><rect x="11" y="11" width="9" height="9" fill="#ffb900"/></svg>',github:'<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="currentColor" d="M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.5-1.4-1.3-1.7-1.3-1.7-1.1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.4 1 .1-.8.4-1.3.8-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.3.5-2.3 1.2-3.2-.1-.3-.5-1.5.1-3.2 0 0 1-.3 3.3 1.2A11.5 11.5 0 0 1 12 5.8c1 0 2 .1 3 .4 2.3-1.5 3.3-1.2 3.3-1.2.6 1.7.2 2.9.1 3.2.7.9 1.2 1.9 1.2 3.2 0 4.6-2.8 5.7-5.5 6 .4.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6A12 12 0 0 0 12 .3"/></svg>',google:'<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z"/><path fill="#FBBC05" d="M5.84 14.1A6.6 6.6 0 0 1 5.5 12c0-.73.13-1.44.34-2.1V7.07H2.18A11 11 0 0 0 1 12c0 1.77.42 3.45 1.18 4.93l3.66-2.83z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1A11 11 0 0 0 2.18 7.07l3.66 2.83C6.71 7.31 9.14 5.38 12 5.38z"/></svg>',wechat:'<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="#07C160" d="M9.5 4C5.36 4 2 6.91 2 10.5c0 2.07 1.13 3.91 2.86 5.09L4 18l2.7-1.41c.85.22 1.76.34 2.7.34h.51c-.13-.42-.21-.86-.21-1.32 0-3 2.91-5.43 6.5-5.43.32 0 .64.02.95.06C16.63 7.32 13.4 4 9.5 4zM7 8.5a1 1 0 110 2 1 1 0 010-2zm5 0a1 1 0 110 2 1 1 0 010-2zm4.21 3.66c-3.04 0-5.5 1.92-5.5 4.29 0 1.39.91 2.65 2.34 3.46l-.46 1.5 1.93-.95c.55.13 1.13.2 1.69.2 3.04 0 5.5-1.92 5.5-4.21 0-2.37-2.46-4.29-5.5-4.29zm-1.71 2.21a.75.75 0 110 1.5.75.75 0 010-1.5zm3.42 0a.75.75 0 110 1.5.75.75 0 010-1.5z"/></svg>'},se=Vue.computed(()=>["alipay","microsoft","github","google","wechat"].filter(O=>O==="microsoft"?e.aadEnabled:!!e.ssoProviders[O]).map(O=>({key:O,label:t(`login.${O}`),icon:z[O]}))),me=()=>{c.value&&c.value.focus()},ae=()=>{m.value="credentials",Vue.nextTick(()=>{l.value&&l.value.focus()})},ve=()=>{let N=e.qrPanel;if(!N||!N.authorizeUrl)return;let O=`alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent(N.authorizeUrl)}`;window.location.href=O},ge=N=>{if(a.value="",N==="microsoft"){e.loginWithMicrosoft();return}if(N==="alipay"){ui()?e.loginWithSso(N):Zs()?e.loginWithAlipayMobile():e.startSsoQr(N).then(O=>{O&&T()});return}if(N==="wechat"){if(Zs()||di()){a.value=t("login.wechat.mobileUnsupported");return}e.startSsoQr(N).then(O=>{O&&T()});return}e.loginWithSso(N)},pe=async()=>{if(!n.value){a.value=t("login.error.enterUsername");return}if(!r.value){a.value=t("login.error.enterPassword");return}a.value="",await e.login(n.value,r.value),Vue.nextTick(()=>{(e.loginStep==="totp"||e.loginStep==="totp-setup")&&u.value?u.value.focus():e.loginStep==="verification"&&d.value&&d.value.focus()})},T=()=>{if(e.qrPanel&&typeof qrcode=="function")try{let N=qrcode(0,"M");N.addData(e.qrPanel.authorizeUrl,"Byte"),N.make(),g.value=N.createDataURL(6,4)}catch{}},K=Vue.computed(()=>{let N=e.qrPanel?.provider;return t(N==="alipay"?"login.qr.titleAlipay":N==="wechat"?"login.qr.titleWechat":"login.qr.title")});Vue.watch(()=>e.qrPanel?.authorizeUrl,N=>{N?T():g.value=""});let re=async()=>{if(!o.value||o.value.length!==6){a.value=t("login.error.enter6Digit");return}a.value="",await e.verifyTotpCode(o.value)&&e.loginStep==="verification"&&(o.value="",Vue.nextTick(()=>{d.value&&d.value.focus()}))},he=async()=>{if(!o.value||o.value.length!==6){a.value=t("login.error.enter6Digit");return}a.value="",await e.completeTotpSetup(o.value)&&e.loginStep==="verification"&&(o.value="",Vue.nextTick(()=>{d.value&&d.value.focus()}))},Pe=async()=>{if(a.value="",v.value=!1,!I.value||I.value.length<2){a.value=t("login.error.usernameMinLen");return}if(!y.value||y.value.length<6){a.value=t("login.error.passwordMinLen");return}if(y.value!==S.value){a.value=t("login.error.passwordMismatch");return}await e.register(I.value,y.value,w.value||void 0,b.value)&&(v.value=!0,n.value=I.value,b.value="",I.value="",y.value="",S.value="",w.value="",setTimeout(()=>e.backToCredentials(),1500))},U=async()=>{if(!i.value){a.value=t("login.error.enterVerifyCode");return}a.value="",await e.verifyCode(i.value)};return Vue.onMounted(async()=>{await e.checkAuthMode(),se.value.length===0&&m.value==="oauth"&&(m.value="credentials"),e.loginStep==="credentials"&&m.value==="credentials"&&l.value&&l.value.focus()}),Vue.watch(()=>e.loginStep,N=>{Vue.nextTick(()=>{N==="credentials"&&m.value==="credentials"&&l.value?l.value.focus():(N==="totp"||N==="totp-setup")&&u.value?u.value.focus():N==="verification"&&d.value?d.value.focus():N==="register"&&f.value&&f.value.focus()})}),{authStore:e,currentLocale:s,toggleLang:()=>{Rn(s.value==="zh-CN"?"en":"zh-CN")},loginMode:m,switchToCredentials:ae,enabledProviders:se,handleProviderClick:ge,relaunchAlipayMobile:ve,qrCanvas:p,qrDataUrl:g,qrPanelTitle:K,username:n,password:r,verificationCode:i,totpCode:o,localError:a,usernameInput:l,passwordInput:c,codeInput:d,totpInput:u,regCodeInput:f,regInvitationCode:b,regUsername:I,regPassword:y,regPasswordConfirm:S,regEmail:w,registerSuccess:v,focusPassword:me,login:pe,verify:U,verifyTotp:re,setupTotp:he,doRegister:Pe,forgotStep:h,forgotEmail:M,forgotResetToken:x,forgotCode:E,forgotNewPassword:V,forgotConfirm:L,forgotLoading:R,forgotSuccess:P,enterForgotMode:A,exitForgotMode:_,submitForgotEmail:j,submitForgotReset:q}}}});var pi,Wa=F(()=>{pi={name:"ChatHeader",emits:["toggle-sidebar","close-pane"],props:{conversationId:{type:String,default:null},paneId:{type:String,default:null},showClosePane:{type:Boolean,default:!1}},template:`
|
|
307
307
|
<header class="chat-header">
|
|
308
308
|
<!-- Mobile sidebar toggle \u2014 hidden on desktop and in split mode -->
|
|
309
309
|
<button class="header-sidebar-toggle" v-if="!store.isSplitMode"
|
|
@@ -405,7 +405,7 @@ The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is al
|
|
|
405
405
|
</button>
|
|
406
406
|
</div>
|
|
407
407
|
</header>
|
|
408
|
-
`,setup(e){let t=Pinia.useChatStore(),s=Vue.inject("t"),n=Vue.computed(()=>e.conversationId||t.currentConversation),r=Vue.computed(()=>n.value&&t.conversations.find(T=>T.id===n.value)||null),i=Vue.computed(()=>r.value?.capabilities||null),o=Vue.computed(()=>n.value?(r.value?.provider||"claude-code")==="claude-code":!0),a=(T,K=!0)=>{let re=i.value;return re?!!re[T]:o.value?K:!1},l=Vue.computed(()=>a("compact")),c=Vue.computed(()=>a("clear")),d=Vue.computed(()=>a("expert")),u=Vue.computed(()=>a("mcp")),f=Vue.computed(()=>{if(!n.value)return"Yeaft";let T=t.getConversationTitle(n.value);if(T)return T;let re=t.conversations.find(he=>he.id===n.value)?.workDir||t.currentWorkDir;if(re){let he=re.split(/[/\\]/);return he[he.length-1]||he[he.length-2]||re}return s("chatHeader.newConv")}),p=Vue.computed(()=>{if(!n.value)return"";let K=t.conversations.find(he=>he.id===n.value)?.agentId;return K&&t.agents.find(he=>he.id===K)?.name||""}),g=Vue.computed(()=>t.clearStatus?.conversationId===n.value?!0:t.compactStatus?t.compactStatus.conversationId===n.value:!1),m=Vue.computed(()=>t.clearStatus?.conversationId===n.value?t.clearStatus.status==="clearing"?"compacting":"completed":t.compactStatus?t.compactStatus.status==="compacting"?"compacting":"completed":""),b=Vue.computed(()=>t.clearStatus?.conversationId===n.value?t.clearStatus.status==="clearing":t.compactStatus?.status==="compacting"),I=Vue.computed(()=>t.clearStatus?.conversationId===n.value?t.clearStatus.status==="clearing"?s("chatHeader.clearing"):s("chatHeader.clearDone"):t.compactStatus?t.compactStatus.status==="compacting"?t.compactStatus.message||s("chatHeader.compacting"):t.compactStatus.message||s("chatHeader.compactDone"):""),y=Vue.computed(()=>n.value&&(t.conversations.find(K=>K.id===n.value)?.workDir||t.currentWorkDir)||""),S=Vue.computed(()=>!t.contextUsage||t.contextUsage.conversationId!==n.value?null:t.contextUsage),w=Vue.computed(()=>{let T=S.value?.percentage||0;return T>=80?"context-danger":T>=50?"context-warn":"context-ok"}),v=Vue.computed(()=>{if(!S.value)return"";let T=(S.value.inputTokens/1e3).toFixed(0),K=(S.value.maxTokens/1e3).toFixed(0);return`Context: ${T}k / ${K}k`}),h=Vue.computed(()=>t.isRefreshingSession(n.value)),M=Vue.computed(()=>t.compactStatus?.status==="compacting"&&t.compactStatus?.conversationId===n.value),x=Vue.computed(()=>t.clearStatus?.status==="clearing"&&t.clearStatus?.conversationId===n.value),E=Vue.computed(()=>n.value?!t.isRefreshingSession(n.value):!1),V=()=>{if(t.isRefreshingSession(n.value)||!n.value)return;t.setRefreshingSession(n.value,!0),t.startRefreshTimeout(n.value),t.requestChatHistory(n.value,{mode:"recent",turns:5})||t.setRefreshingSession(n.value,!1)},L=()=>{M.value||t.sendMessage("/compact")},R=()=>{window.location.reload()},P=()=>{x.value||confirm(s("chatHeader.confirmClear"))&&(t.clearStatus={conversationId:n.value,status:"clearing"},t.sendMessage("/clear"))},A=Vue.computed(()=>t.getPaneRightPanel(e.paneId)),_=Vue.ref(null),j=Vue.computed(()=>{if(!t.mcpPanelOpen||!_.value)return null;let T=_.value.getBoundingClientRect();return{top:`${T.bottom+6}px`,right:`${window.innerWidth-T.right}px`}}),
|
|
408
|
+
`,setup(e){let t=Pinia.useChatStore(),s=Vue.inject("t"),n=Vue.computed(()=>e.conversationId||t.currentConversation),r=Vue.computed(()=>n.value&&t.conversations.find(T=>T.id===n.value)||null),i=Vue.computed(()=>r.value?.capabilities||null),o=Vue.computed(()=>n.value?(r.value?.provider||"claude-code")==="claude-code":!0),a=(T,K=!0)=>{let re=i.value;return re?!!re[T]:o.value?K:!1},l=Vue.computed(()=>a("compact")),c=Vue.computed(()=>a("clear")),d=Vue.computed(()=>a("expert")),u=Vue.computed(()=>a("mcp")),f=Vue.computed(()=>{if(!n.value)return"Yeaft";let T=t.getConversationTitle(n.value);if(T)return T;let re=t.conversations.find(he=>he.id===n.value)?.workDir||t.currentWorkDir;if(re){let he=re.split(/[/\\]/);return he[he.length-1]||he[he.length-2]||re}return s("chatHeader.newConv")}),p=Vue.computed(()=>{if(!n.value)return"";let K=t.conversations.find(he=>he.id===n.value)?.agentId;return K&&t.agents.find(he=>he.id===K)?.name||""}),g=Vue.computed(()=>t.clearStatus?.conversationId===n.value?!0:t.compactStatus?t.compactStatus.conversationId===n.value:!1),m=Vue.computed(()=>t.clearStatus?.conversationId===n.value?t.clearStatus.status==="clearing"?"compacting":"completed":t.compactStatus?t.compactStatus.status==="compacting"?"compacting":"completed":""),b=Vue.computed(()=>t.clearStatus?.conversationId===n.value?t.clearStatus.status==="clearing":t.compactStatus?.status==="compacting"),I=Vue.computed(()=>t.clearStatus?.conversationId===n.value?t.clearStatus.status==="clearing"?s("chatHeader.clearing"):s("chatHeader.clearDone"):t.compactStatus?t.compactStatus.status==="compacting"?t.compactStatus.message||s("chatHeader.compacting"):t.compactStatus.message||s("chatHeader.compactDone"):""),y=Vue.computed(()=>n.value&&(t.conversations.find(K=>K.id===n.value)?.workDir||t.currentWorkDir)||""),S=Vue.computed(()=>!t.contextUsage||t.contextUsage.conversationId!==n.value?null:t.contextUsage),w=Vue.computed(()=>{let T=S.value?.percentage||0;return T>=80?"context-danger":T>=50?"context-warn":"context-ok"}),v=Vue.computed(()=>{if(!S.value)return"";let T=(S.value.inputTokens/1e3).toFixed(0),K=(S.value.maxTokens/1e3).toFixed(0);return`Context: ${T}k / ${K}k`}),h=Vue.computed(()=>t.isRefreshingSession(n.value)),M=Vue.computed(()=>t.compactStatus?.status==="compacting"&&t.compactStatus?.conversationId===n.value),x=Vue.computed(()=>t.clearStatus?.status==="clearing"&&t.clearStatus?.conversationId===n.value),E=Vue.computed(()=>n.value?!t.isRefreshingSession(n.value):!1),V=()=>{if(t.isRefreshingSession(n.value)||!n.value)return;t.setRefreshingSession(n.value,!0),t.startRefreshTimeout(n.value),t.requestChatHistory(n.value,{mode:"recent",turns:5})||t.setRefreshingSession(n.value,!1)},L=()=>{M.value||t.sendMessage("/compact")},R=()=>{window.location.reload()},P=()=>{x.value||confirm(s("chatHeader.confirmClear"))&&(t.clearStatus={conversationId:n.value,status:"clearing"},t.sendMessage("/clear"))},A=Vue.computed(()=>t.getPaneRightPanel(e.paneId)),_=Vue.ref(null),j=Vue.computed(()=>{if(!t.mcpPanelOpen||!_.value)return null;let T=_.value.getBoundingClientRect();return{top:`${T.bottom+6}px`,right:`${window.innerWidth-T.right}px`}}),q=Vue.computed(()=>t.currentMcpServers.filter(T=>T.enabled).length),z=Vue.computed(()=>!!t.conversations.find(K=>K.id===n.value)?.needRestart),se=()=>{t.mcpPanelOpen=!t.mcpPanelOpen},me=()=>{t.togglePaneRightPanel("experts",e.paneId)},ae=()=>{t.togglePaneRightPanel("subagents",e.paneId)},ve=Vue.computed(()=>t.runningSubagentCount),ge=(T,K)=>{t.toggleConversationMcp(T,K)},pe=T=>{t.mcpPanelOpen&&!T.target.closest(".mcp-dropdown")&&!T.target.closest(".mcp-config-wrapper")&&(t.mcpPanelOpen=!1)};return Vue.onMounted(()=>{document.addEventListener("click",pe)}),Vue.onUnmounted(()=>{document.removeEventListener("click",pe)}),{store:t,effectiveConvId:n,effectiveRightPanel:A,isClaudeCode:o,canCompact:l,canClear:c,canExpert:d,canMcp:u,headerTitle:f,showStatusBanner:g,statusBannerClass:m,statusBannerSpinner:b,statusBannerMessage:I,contextUsage:S,contextColorClass:w,contextLabel:v,isRefreshing:h,isCompacting:M,isClearing:x,canRefresh:E,refreshSession:V,reloadPage:R,compactContext:L,clearMessages:P,mcpBtnRef:_,mcpDropdownStyle:j,mcpEnabledCount:q,currentConvNeedRestart:z,toggleMcpPanel:se,toggleMcpServer:ge,toggleExpertPanel:me,toggleSubAgentPanel:ae,runningSubagentCount:ve}}}});function rr(e=globalThis.location){let t=e?.protocol==="https:"?"wss:":"ws:",s=e?.host||"localhost";return`${t}//${s}`}function fi(){return"npm install -g @yeaft/webchat-agent"}function gi(){return"yeaft-agent llm use github-copilot --model gpt-5.5"}function ja(e=null){let t=e&&(e.username||e.displayName)||"agent",s=2166136261;for(let i=0;i<t.length;i++)s^=t.charCodeAt(i),s=s+((s<<1)+(s<<4)+(s<<7)+(s<<8)+(s<<24))>>>0;let n=s.toString(16).padStart(8,"0").slice(0,6);return`${String(t).replace(/[^A-Za-z0-9_-]/g,"-").replace(/^-+|-+$/g,"")||"agent"}-${n}`}function mi({profile:e=null,agentSecret:t="",serverWsUrl:s=rr()}={}){if(!t)return"";let n=ja(e);return`yeaft-agent install --server ${s} --secret ${t} --name ${n}`}var Ua=F(()=>{});function ey(e,t){return typeof e=="string"?e?{src:e,alt:t}:null:!e||typeof e!="object"||!e.src?null:{src:e.src,alt:e.alt||t}}function Js(e,{alt:t="Preview",closeLabel:s="Close",previousLabel:n="Previous image",nextLabel:r="Next image",positionLabel:i=(c,d)=>`${c} / ${d}`,gallery:o=null,initialIndex:a=null,trigger:l=null}={}){if(!e)return null;let c=(Array.isArray(o)?o:[e]).map(E=>ey(E,t)).filter(Boolean);c.length===0&&c.push({src:e,alt:t});let d=Number.isInteger(a)&&a>=0&&a<c.length?a:c.findIndex(E=>E.src===e);d<0&&(d=0);let u=document.createElement("div");u.className="image-preview-overlay",u.setAttribute("role","dialog"),u.setAttribute("aria-modal","true"),u.setAttribute("aria-label",t);let f=document.createElement("img");f.className="image-preview-img",f.draggable=!1;let p=document.createElement("button");p.type="button",p.className="image-preview-close",p.setAttribute("aria-label",s),p.setAttribute("title",s),p.textContent="\xD7";let g=null,m=null,b=null;c.length>1&&(g=document.createElement("button"),g.type="button",g.className="image-preview-navigation image-preview-previous",g.setAttribute("aria-label",n),g.setAttribute("title",n),g.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="m15 18-6-6 6-6"/></svg>',m=document.createElement("button"),m.type="button",m.className="image-preview-navigation image-preview-next",m.setAttribute("aria-label",r),m.setAttribute("title",r),m.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="m9 18 6-6-6-6"/></svg>',b=document.createElement("div"),b.className="image-preview-position",b.setAttribute("aria-live","polite"));let I=()=>{let E=c[d];f.src=E.src,f.alt=E.alt,u.setAttribute("aria-label",E.alt),b&&(b.textContent=typeof i=="function"?i(d+1,c.length):`${d+1} / ${c.length}`)},y=E=>{d=(d+E+c.length)%c.length,I()};I(),u.append(f),g&&m&&b&&u.append(g,m,b),u.append(p),document.body.appendChild(u),u.offsetHeight,u.classList.add("visible"),p.focus();let S=!1,w=null,v=()=>{w&&clearTimeout(w),w=null,u.isConnected&&u.remove()},h=()=>{S||(S=!0,u.classList.remove("visible"),u.addEventListener("transitionend",v,{once:!0}),w=setTimeout(v,250),document.removeEventListener("keydown",x),l?.isConnected&&typeof l.focus=="function"&&l.focus())},M=[g,m,p].filter(Boolean),x=E=>{if(E.key==="Escape"){E.preventDefault(),h();return}if(c.length>1&&(E.key==="ArrowLeft"||E.key==="ArrowRight")){E.preventDefault(),y(E.key==="ArrowLeft"?-1:1);return}if(E.key==="Tab"){E.preventDefault();let V=M.indexOf(document.activeElement),L=E.shiftKey?-1:1,R=V<0?0:(V+L+M.length)%M.length;M[R].focus()}};return p.addEventListener("click",h),g?.addEventListener("click",()=>y(-1)),m?.addEventListener("click",()=>y(1)),u.addEventListener("click",E=>{E.target===u&&h()}),document.addEventListener("keydown",x),u}var hi=F(()=>{});function ny(e){let t=[];for(let s of e)s==="\b"?t.pop():t.push(s);return t.join("")}function ry(e){let t=e.split("\r"),s=t[t.length-1]||"";return ny(s)}function fp(e){return e.replace(/\r\n/g,`
|
|
409
409
|
`).split(`
|
|
410
410
|
`).map(t=>ry(t)).join(`
|
|
411
411
|
`)}function gp(e){return e.replace(ty,"").replace(sy,"")}function iy(e){return e?e.split(";").filter(t=>t!=="").map(t=>Number(t)).filter(Number.isFinite):[0]}function cp(e,t){let s=t==="bg"&&e>=30&&e<=37||t==="bg"&&e>=90&&e<=97?e+10:e;return t==="bg"?Ga.get(s):Ya.get(s)}function dp(e,t,s){let n=Qa[0],r=1/0;for(let i of Qa){let o=(i.r-e)**2+(i.g-t)**2+(i.b-s)**2;o<r&&(n=i,r=o)}return n.code}function oy(e){if(e<0||e>255)return null;if(e<16){let s=Qa[e];return{r:s.r,g:s.g,b:s.b}}if(e>=232){let s=8+(e-232)*10;return{r:s,g:s,b:s}}let t=e-16;return{r:za[Math.floor(t/36)],g:za[Math.floor(t%36/6)],b:za[t%6]}}function up(e,t,s,n){let r=s[n+1];if(r===5){let i=s[n+2];if(Number.isFinite(i)){let o=oy(i);o&&(e[t]=cp(dp(o.r,o.g,o.b),t)||"")}return n+3}if(r===2){let i=s[n+2],o=s[n+3],a=s[n+4];return Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(a)&&(e[t]=cp(dp(i,o,a),t)||""),n+5}return n+2}function ay(e,t){let s={...e},n=t.length?t:[0];for(let r=0;r<n.length;){let i=n[r];if(i===0)s.fg="",s.bg="",s.bold=!1,s.dim=!1,s.italic=!1,s.underline=!1;else if(i===1)s.bold=!0,s.dim=!1;else if(i===2)s.dim=!0,s.bold=!1;else if(i===3)s.italic=!0;else if(i===4)s.underline=!0;else if(i===22)s.bold=!1,s.dim=!1;else if(i===23)s.italic=!1;else if(i===24)s.underline=!1;else if(i===39)s.fg="";else if(i===49)s.bg="";else if(Ya.has(i))s.fg=Ya.get(i);else if(Ga.has(i))s.bg=Ga.get(i);else if(i===38){r=up(s,"fg",n,r);continue}else if(i===48){r=up(s,"bg",n,r);continue}r+=1}return s}function ly(e){return[e.fg,e.bg,e.bold&&"terminal-bold",e.dim&&"terminal-dim",e.italic&&"terminal-italic",e.underline&&"terminal-underline"].filter(Boolean).join(" ")}function pp(e,t,s){let n=gp(t);if(!n)return;let r=ly(s),i=e[e.length-1];i&&i.className===r?i.text+=n:e.push({text:n,className:r})}function Ft(e){if(e==null)return"";let t=typeof e=="string"?e:String(e);return t?gp(fp(t)):""}function mp(e){if(e==null)return[];let t=typeof e=="string"?e:String(e);if(!t)return[];let s=fp(t),n=[],r={fg:"",bg:"",bold:!1,dim:!1,italic:!1,underline:!1},i=0;Ka.lastIndex=0;for(let o=Ka.exec(s);o;o=Ka.exec(s))pp(n,s.slice(i,o.index),r),r=ay(r,iy(o[1])),i=o.index+o[0].length;return pp(n,s.slice(i),r),n}var ty,Ka,sy,Ya,Ga,Qa,za,ir=F(()=>{ty=/[\u001b\u009b](?:[\[\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><~]|\][^\u0007]*(?:\u0007|\u001b\\)|[PX^_][\s\S]*?\u001b\\)/g,Ka=/(?:\u001b\[|\u009b)([0-9;]*)m/g,sy=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Ya=new Map([[30,"terminal-fg-black"],[31,"terminal-fg-red"],[32,"terminal-fg-green"],[33,"terminal-fg-yellow"],[34,"terminal-fg-blue"],[35,"terminal-fg-magenta"],[36,"terminal-fg-cyan"],[37,"terminal-fg-white"],[90,"terminal-fg-bright-black"],[91,"terminal-fg-bright-red"],[92,"terminal-fg-bright-green"],[93,"terminal-fg-bright-yellow"],[94,"terminal-fg-bright-blue"],[95,"terminal-fg-bright-magenta"],[96,"terminal-fg-bright-cyan"],[97,"terminal-fg-bright-white"]]),Ga=new Map([[40,"terminal-bg-black"],[41,"terminal-bg-red"],[42,"terminal-bg-green"],[43,"terminal-bg-yellow"],[44,"terminal-bg-blue"],[45,"terminal-bg-magenta"],[46,"terminal-bg-cyan"],[47,"terminal-bg-white"],[100,"terminal-bg-bright-black"],[101,"terminal-bg-bright-red"],[102,"terminal-bg-bright-green"],[103,"terminal-bg-bright-yellow"],[104,"terminal-bg-bright-blue"],[105,"terminal-bg-bright-magenta"],[106,"terminal-bg-bright-cyan"],[107,"terminal-bg-bright-white"]]),Qa=[{code:30,r:0,g:0,b:0},{code:31,r:170,g:0,b:0},{code:32,r:0,g:170,b:0},{code:33,r:170,g:85,b:0},{code:34,r:0,g:0,b:170},{code:35,r:170,g:0,b:170},{code:36,r:0,g:170,b:170},{code:37,r:170,g:170,b:170},{code:90,r:85,g:85,b:85},{code:91,r:255,g:85,b:85},{code:92,r:85,g:255,b:85},{code:93,r:255,g:255,b:85},{code:94,r:85,g:85,b:255},{code:95,r:255,g:85,b:255},{code:96,r:85,g:255,b:255},{code:97,r:255,g:255,b:255}],za=[0,95,135,175,215,255]});var en,vi=F(()=>{hi();Xn();ir();Xt();en={name:"MessageItem",props:{message:{type:Object,required:!0},sessionActions:{type:Boolean,default:!1},externalAttachmentOpen:{type:Boolean,default:!1}},emits:["quote","edit-as-new","open-attachment"],template:`
|
|
@@ -861,7 +861,7 @@ ${String(e||"").trim()}
|
|
|
861
861
|
<!-- H2.f.6: Fork-from-here button removed (single-conversation model). -->
|
|
862
862
|
</div>
|
|
863
863
|
</div>
|
|
864
|
-
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.ref(!1),r=Vue.ref(!1),i=Vue.ref(!1),o=Vue.computed(()=>e.actionsExpanded===null?i.value:!!e.actionsExpanded),a=U=>{i.value=!!U,t("update-actions-expanded",!!U)},l=Vue.ref(!1),c=Vue.ref(null),d=Vue.reactive(new Set),u=Vue.inject("t"),f=(U,
|
|
864
|
+
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.ref(!1),r=Vue.ref(!1),i=Vue.ref(!1),o=Vue.computed(()=>e.actionsExpanded===null?i.value:!!e.actionsExpanded),a=U=>{i.value=!!U,t("update-actions-expanded",!!U)},l=Vue.ref(!1),c=Vue.ref(null),d=Vue.reactive(new Set),u=Vue.inject("t"),f=(U,B)=>{s.answerUserQuestion(U,B,e.conversationId||void 0)},p=Vue.computed(()=>(Array.isArray(e.turn?.toolMsgs)?e.turn.toolMsgs:[]).filter(B=>B?.toolName==="RouteForward").map((B,N)=>({...Xa(B.toolInput||{}),key:B.toolId||`${B.startTime||0}:${N}`}))),g=Vue.computed(()=>(Array.isArray(e.turn?.toolMsgs)?e.turn.toolMsgs:[]).filter(B=>B?.toolName!=="RouteForward")),m=Vue.computed(()=>g.value.length>0||Number(e.turn.toolSummaryCount||0)>0),b=Vue.computed(()=>{let U=g.value;return U[U.length-1]}),I=Vue.computed(()=>g.value.slice(0,-1)),y=Vue.computed(()=>Math.max(0,g.value.length-1)),S=Vue.computed(()=>{let U=Number(e.turn.toolSummaryCount||0);return U?typeof u=="function"?u("chat.toolActionsOmitted",{count:U}):`${U} older tool actions omitted`:""}),w=Vue.computed(()=>{let U=e.turn?.todoMsg?.toolInput?.todos;return Array.isArray(U)?U.map(B=>kp(e.turn,B)):[]}),v=()=>{a(!o.value)},h=(U,B,N)=>{let O=e.toolStatePrefix||e.turn.id||e.turn.turnId||"assistant-turn",D=U?.toolName||"tool",Z=U?.startTime||B;return`${O}:tool:${N}:${B}:${D}:${Z}`},M=(U,B,N)=>{let O=h(U,B,N);return e.toolExpandStates&&Object.prototype.hasOwnProperty.call(e.toolExpandStates,O)?!!e.toolExpandStates[O]:null},x=(U,B,N,O)=>{t("update-tool-expanded",{key:h(U,B,N),value:!!O})};typeof marked<"u"&&marked.setOptions({highlight:function(U,B){if(typeof hljs<"u"&&B&&hljs.getLanguage(B))try{return hljs.highlight(U,{language:B}).value}catch{}return U},breaks:!0,gfm:!0});let V=U=>{let B=U;if(typeof B!="string"&&(Array.isArray(B)?B=B.map(N=>typeof N=="string"?N:N&&N.type==="text"&&N.text||"").join(""):B=String(B)),B=Ft(B),!B)return"";try{if(typeof marked<"u"){let N=marked.parse(B);return _(A(N))}}catch{}return j(B)},L=Vue.computed(()=>Array.isArray(e.turn?.textSegments)&&e.turn.textSegments.length>0?e.turn.textSegments:e.turn?.textContent?[{key:"legacy-result",content:e.turn.textContent,kind:"result",isStreaming:e.turn.isStreaming===!0}]:[]),R=Vue.computed(()=>L.value.filter(U=>U.kind!=="result")),P=Vue.computed(()=>L.value.filter(U=>U.kind==="result")),A=U=>U.replace(/<pre><code([^>]*)>([\s\S]*?)<\/code><\/pre>/g,(B,N,O)=>{let D=N.match(/class="language-(\w+)"/);return`<div class="code-block-wrapper">
|
|
865
865
|
<div class="code-block-header">
|
|
866
866
|
<span class="code-lang">${D?D[1]:""}</span>
|
|
867
867
|
<button class="code-copy-btn" onclick="window.copyCodeBlock(this)" title="Copy">
|
|
@@ -871,7 +871,7 @@ ${String(e||"").trim()}
|
|
|
871
871
|
</button>
|
|
872
872
|
</div>
|
|
873
873
|
<pre><code${N}>${O}</code></pre>
|
|
874
|
-
</div>`}),_=U=>U.replace(/<table>([\s\S]*?)<\/table>/g,
|
|
874
|
+
</div>`}),_=U=>U.replace(/<table>([\s\S]*?)<\/table>/g,B=>`<div class="table-scroll-wrapper">${B}</div>`),j=U=>{if(!U)return"";typeof U!="string"&&(U=String(U));let B=N=>{let O=document.createElement("div");return O.textContent=N,O.innerHTML};return U.replace(/```(\w*)\n([\s\S]*?)```/g,(N,O,D)=>`<div class="code-block-wrapper"><pre><code class="language-${O}">${B(D.trim())}</code></pre></div>`).replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/\n/g,"<br>")},q=async()=>{try{await navigator.clipboard.writeText(e.turn.textContent||""),n.value=!0,setTimeout(()=>{n.value=!1},2e3)}catch{}},z=async()=>{try{await navigator.clipboard.writeText(e.turn.textContent||""),r.value=!0,setTimeout(()=>{r.value=!1},2e3)}catch{}},se=()=>{let U=e.turn.textContent||"";if(!U)return;let B=new Blob([U],{type:"text/markdown;charset=utf-8"}),N=URL.createObjectURL(B),O=document.createElement("a");O.download=`response-${Date.now()}.md`,O.href=N,O.click(),URL.revokeObjectURL(N)},me=async()=>{if(!(l.value||!window.htmlToImage)){l.value=!0;try{let U=c.value;if(!U)return;let B=U.querySelector(".turn-content");if(!B)return;let N=getComputedStyle(document.body).getPropertyValue("--bg-main").trim()||"#ffffff";B.classList.add("screenshot-mode");try{let D=B.getBoundingClientRect(),Z=await window.htmlToImage.toPng(B,{backgroundColor:N,pixelRatio:3,width:D.width+64,height:D.height+64,style:{padding:"32px"},filter:ye=>!(ye.classList&&(ye.classList.contains("turn-header")||ye.classList.contains("screenshot-btn")))}),ne=document.createElement("a");ne.download=`response-${Date.now()}.png`,ne.href=Z,ne.click()}finally{B.classList.remove("screenshot-mode")}}catch{}finally{l.value=!1}}};Vue.onMounted(()=>{window.copyCodeBlock||(window.copyCodeBlock=async function(U){let N=U.closest(".code-block-wrapper").querySelector("code");if(N)try{await navigator.clipboard.writeText(N.textContent),U.innerHTML='<svg viewBox="0 0 24 24" width="14" height="14"><path fill="currentColor" d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>',setTimeout(()=>{U.innerHTML='<svg viewBox="0 0 24 24" width="14" height="14"><path fill="currentColor" d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>'},2e3)}catch{}}),Vue.nextTick(()=>{typeof hljs<"u"&&document.querySelectorAll("pre code:not([data-highlighted])").forEach(U=>{hljs.highlightElement(U),U.dataset.highlighted="true"}),ot(c.value)})}),Vue.watch(()=>e.turn.textContent,()=>{Vue.nextTick(()=>{typeof hljs<"u"&&document.querySelectorAll("pre code:not([data-highlighted])").forEach(U=>{hljs.highlightElement(U),U.dataset.highlighted="true"}),ot(c.value)})});let ae=U=>{if(U?.src)return U.src;if(!U?.fileId)return"";let B=U.previewToken||"";return`/api/preview/${U.fileId}?token=${B}`},ve=U=>{d.add(U?.assetId||U?.id)},ge=Vue.computed(()=>(Array.isArray(e.turn?.imageMsgs)?e.turn.imageMsgs:[]).map(U=>({image:U,src:ae(U),alt:U?.filename||u("message.imagePreview")})).filter(U=>U.src&&!d.has(U.image?.assetId||U.image?.id))),pe=(U,B)=>{let N=ge.value,O=N.findIndex(D=>D.image===U);O<0||Js(N[O].src,{alt:N[O].alt,closeLabel:u("common.close"),previousLabel:u("message.previousImage"),nextLabel:u("message.nextImage"),positionLabel:(D,Z)=>u("message.imagePosition",{current:D,total:Z}),gallery:N.map(({src:D,alt:Z})=>({src:D,alt:Z})),initialIndex:O,trigger:B})},T=U=>{if(U)try{typeof s.cancelVpTurn=="function"&&s.cancelVpTurn(U)}catch{}},K=()=>{let U=e.turn;return U?typeof U.timestamp=="number"&&U.timestamp>0?U.timestamp:typeof U.createdAt=="number"&&U.createdAt>0?U.createdAt:typeof U.speakerTimestamp=="number"&&U.speakerTimestamp>0?U.speakerTimestamp:null:null},re=Vue.computed(()=>xt(K())),he=Vue.computed(()=>{let U=K();if(!U)return"";try{return new Date(U).toLocaleString()}catch{return""}}),Pe=Vue.computed(()=>bu(e.turn,e.quoteAuthor||u("message.assistant")));return{onStopTurn:T,turnTime:re,turnTimeFull:he,assistantQuote:Pe,copied:n,fullCopied:r,expanded:o,screenshotting:l,turnRef:c,showToolActions:m,latestTool:b,historyTools:I,latestToolIndex:y,actionTools:g,routeMessages:p,toolSummaryLabel:S,toggleExpand:v,toolExpandedValue:M,updateToolExpanded:x,textSegments:L,progressSegments:R,resultSegments:P,renderSegment:V,copyContent:q,copyFullResponse:z,exportMarkdown:se,screenshotContent:me,onAskSubmit:f,imageSrc:ae,failedImages:d,handleImageError:ve,previewImage:pe,displayedTodos:w}}}});function Rp(e){if(!Number.isFinite(e)||e<0)return"";let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let s=Math.floor(t/60),n=t%60,r=String(n).padStart(2,"0");if(s<60)return`${s}:${r}`;let i=Math.floor(s/60),o=s%60;return`${i}:${String(o).padStart(2,"0")}:${r}`}var _p=F(()=>{});var sn,Si=F(()=>{ki();ri();Xs();_p();Xt();sn={name:"VpTurnBlock",components:{AssistantTurn:tn},props:{turn:{type:Object,required:!0},conversationId:{type:String,default:null},nowMs:{type:Number,default:0},responseCollapsible:{type:Boolean,default:!1},responseCollapsed:{type:Boolean,default:!1},responseToggleLabel:{type:String,default:""},displayNameOverride:{type:String,default:""},canStop:{type:Boolean,default:!0},interactiveSpeaker:{type:Boolean,default:!0}},emits:["toggle-response-collapse","quote"],template:`
|
|
875
875
|
<div class="vp-turn-block"
|
|
876
876
|
:class="{ 'vp-turn-block-streaming': turn.isStreaming }"
|
|
877
877
|
:data-turn-id="turn.turnId || ''"
|
|
@@ -1023,7 +1023,7 @@ ${String(e||"").trim()}
|
|
|
1023
1023
|
/>
|
|
1024
1024
|
</div>
|
|
1025
1025
|
</div>
|
|
1026
|
-
`}});function lr(e,t,s){return Math.min(Math.max(e,t),s)}function Ci(e){return e?typeof e=="string"?e.length:Array.isArray(e)?e.reduce((t,s)=>t+Ci(s),0):typeof e=="object"?Object.values(e).reduce((t,s)=>t+Ci(s),0):String(e).length:0}function Vp(e){if(!e)return 260;let t=Ci(e.content||e.text||e.message||""),s=Array.isArray(e.attachments)?e.attachments.length:0;return lr(110+Math.ceil(t/90)*18+s*120,120,1400)}function xy(e){if(!e)return 260;let t=Ci(e.text||e.content||""),s=Array.isArray(e.toolMsgs)?e.toolMsgs.length:0,n=Array.isArray(e.images)?e.images.length:0,r=Array.isArray(e.askRequests)?e.askRequests.length:0;return lr(160+Math.ceil(t/95)*18+s*56+n*140+r*96,160,1400)}function es(e){if(!e)return 260;if(e.type==="message-block"){let t=Array.isArray(e.items)?e.items:[];return t.length?t.reduce((s,n)=>s+es(n),0)+Math.max(0,t.length-1)*18:260}return e.type==="assistant-turn"?xy(e):e.message?Vp(e.message):Vp(e)}function rn(e,t=0){return String(e?.id||e?.messageId||e?.turnId||`virtual_${t}`)}function Ty(e,t,s,n){let r=rn(e,t),i=s instanceof Map?s.get(r):s?.[r];if(Number.isFinite(i)&&i>0)return i;let o=n?n(e,t):es(e);return Number.isFinite(o)&&o>0?o:260}function nl(e,t={},s={}){let n=Array.isArray(e)?e:[],r=Math.max(0,Number(s.itemGap??18)),i=s.estimateHeight||es,o=[0],a=[];for(let l=0;l<n.length;l+=1){let c=Ty(n[l],l,t,i);a.push(c),o.push(o[l]+c+(l<n.length-1?r:0))}return{offsets:o,heights:a,totalHeight:o[o.length-1]||0,itemGap:r}}function Hp(e,t){let s=0,n=Math.max(0,e.length-2),r=0;for(;s<=n;){let i=Math.floor((s+n)/2);e[i+1]<=t?(r=i+1,s=i+1):n=i-1}return r}function My(e,t,s){let n=Hp(e,t);for(;n<s&&e[n]<t;)n+=1;return lr(n,0,s)}function Op(e,t,s={}){let n=Array.isArray(e)?e:[],r=n.length;if(!r)return{start:0,end:0,visibleStart:0,visibleEnd:0,topSpacerHeight:0,bottomSpacerHeight:0,totalHeight:0,items:[]};let i=Math.max(0,Number(s.scrollTop||0)),o=Math.max(1,Number(s.viewportHeight||720)),a=Math.max(0,Number(s.overscan??1)),l=Array.isArray(t?.offsets)?t.offsets:[0],c=Number.isFinite(t?.totalHeight)?t.totalHeight:0,d=i+o,u=lr(Hp(l,i),0,r-1),f=lr(My(l,d,r),u+1,r),p=Math.max(0,u-a),g=Math.min(r,f+a);return{start:p,end:g,visibleStart:u,visibleEnd:f,topSpacerHeight:l[p]||0,bottomSpacerHeight:Math.max(0,c-(l[g]||c)),totalHeight:c,items:n.slice(p,g).map((m,b)=>{let I=p+b;return{item:m,index:I,key:rn(m,I),top:l[I]||0}})}}function Fp(e,t,s={},n={}){let r=Array.isArray(e)?e:[],i=Math.max(0,Math.min(r.length-1,Number.isFinite(t)?Math.floor(t):0));if(r.length===0)return 0;let{offsets:o,heights:a,totalHeight:l}=nl(r,s,n),c=Math.max(1,Number(n.viewportHeight||720)),d=n.align==="start"||n.align==="end"?n.align:"center",u=o[i]||0,f=a[i]||260;return d==="start"?Math.max(0,Math.min(u,l-c)):d==="end"?Math.max(0,Math.min(u+f-c,l-c)):Math.max(0,Math.min(u-(c-f)/2,l-c))}function As({scrollTop:e=0,scrollHeight:t=0,clientHeight:s=0,threshold:n=80}={}){return Math.max(0,Number(t)-Number(e)-Number(s))<=Math.max(0,Number(n))}function Np(e=0,{viewports:t=2,minPx:s=600}={}){let n=Math.max(0,Number(e)||0),r=Math.max(0,Number(t)||0);return Math.max(0,Number(s)||0,n*r)}function
|
|
1026
|
+
`}});function lr(e,t,s){return Math.min(Math.max(e,t),s)}function Ci(e){return e?typeof e=="string"?e.length:Array.isArray(e)?e.reduce((t,s)=>t+Ci(s),0):typeof e=="object"?Object.values(e).reduce((t,s)=>t+Ci(s),0):String(e).length:0}function Vp(e){if(!e)return 260;let t=Ci(e.content||e.text||e.message||""),s=Array.isArray(e.attachments)?e.attachments.length:0;return lr(110+Math.ceil(t/90)*18+s*120,120,1400)}function xy(e){if(!e)return 260;let t=Ci(e.text||e.content||""),s=Array.isArray(e.toolMsgs)?e.toolMsgs.length:0,n=Array.isArray(e.images)?e.images.length:0,r=Array.isArray(e.askRequests)?e.askRequests.length:0;return lr(160+Math.ceil(t/95)*18+s*56+n*140+r*96,160,1400)}function es(e){if(!e)return 260;if(e.type==="message-block"){let t=Array.isArray(e.items)?e.items:[];return t.length?t.reduce((s,n)=>s+es(n),0)+Math.max(0,t.length-1)*18:260}return e.type==="assistant-turn"?xy(e):e.message?Vp(e.message):Vp(e)}function rn(e,t=0){return String(e?.id||e?.messageId||e?.turnId||`virtual_${t}`)}function Ty(e,t,s,n){let r=rn(e,t),i=s instanceof Map?s.get(r):s?.[r];if(Number.isFinite(i)&&i>0)return i;let o=n?n(e,t):es(e);return Number.isFinite(o)&&o>0?o:260}function nl(e,t={},s={}){let n=Array.isArray(e)?e:[],r=Math.max(0,Number(s.itemGap??18)),i=s.estimateHeight||es,o=[0],a=[];for(let l=0;l<n.length;l+=1){let c=Ty(n[l],l,t,i);a.push(c),o.push(o[l]+c+(l<n.length-1?r:0))}return{offsets:o,heights:a,totalHeight:o[o.length-1]||0,itemGap:r}}function Hp(e,t){let s=0,n=Math.max(0,e.length-2),r=0;for(;s<=n;){let i=Math.floor((s+n)/2);e[i+1]<=t?(r=i+1,s=i+1):n=i-1}return r}function My(e,t,s){let n=Hp(e,t);for(;n<s&&e[n]<t;)n+=1;return lr(n,0,s)}function Op(e,t,s={}){let n=Array.isArray(e)?e:[],r=n.length;if(!r)return{start:0,end:0,visibleStart:0,visibleEnd:0,topSpacerHeight:0,bottomSpacerHeight:0,totalHeight:0,items:[]};let i=Math.max(0,Number(s.scrollTop||0)),o=Math.max(1,Number(s.viewportHeight||720)),a=Math.max(0,Number(s.overscan??1)),l=Array.isArray(t?.offsets)?t.offsets:[0],c=Number.isFinite(t?.totalHeight)?t.totalHeight:0,d=i+o,u=lr(Hp(l,i),0,r-1),f=lr(My(l,d,r),u+1,r),p=Math.max(0,u-a),g=Math.min(r,f+a);return{start:p,end:g,visibleStart:u,visibleEnd:f,topSpacerHeight:l[p]||0,bottomSpacerHeight:Math.max(0,c-(l[g]||c)),totalHeight:c,items:n.slice(p,g).map((m,b)=>{let I=p+b;return{item:m,index:I,key:rn(m,I),top:l[I]||0}})}}function Fp(e,t,s={},n={}){let r=Array.isArray(e)?e:[],i=Math.max(0,Math.min(r.length-1,Number.isFinite(t)?Math.floor(t):0));if(r.length===0)return 0;let{offsets:o,heights:a,totalHeight:l}=nl(r,s,n),c=Math.max(1,Number(n.viewportHeight||720)),d=n.align==="start"||n.align==="end"?n.align:"center",u=o[i]||0,f=a[i]||260;return d==="start"?Math.max(0,Math.min(u,l-c)):d==="end"?Math.max(0,Math.min(u+f-c,l-c)):Math.max(0,Math.min(u-(c-f)/2,l-c))}function As({scrollTop:e=0,scrollHeight:t=0,clientHeight:s=0,threshold:n=80}={}){return Math.max(0,Number(t)-Number(e)-Number(s))<=Math.max(0,Number(n))}function Np(e=0,{viewports:t=2,minPx:s=600}={}){let n=Math.max(0,Number(e)||0),r=Math.max(0,Number(t)||0);return Math.max(0,Number(s)||0,n*r)}function Bp({following:e=!0,atBottom:t=!1,userScroll:s=!1}={}){return(s||!!e)&&!!t}function qp({following:e=!0,atBottom:t=!1,resumeBoundaryReached:s=!1,direction:n=0}={}){let r=Number(n)||0;return r<0?!1:e?!!t:r>0&&!!s}function _y(e){return Py.has(String(e||""))}function Wp(e,t){if(!e||!t||e.button!==0)return!1;let s=t.getBoundingClientRect?.(),n=Math.max(0,Number(t.offsetWidth||0)-Number(t.clientWidth||0));return!s||n<=0?!1:Number(e.clientX)>=Number(s.right)-n&&Number(e.clientX)<=Number(s.right)&&Number(e.clientY)>=Number(s.top)&&Number(e.clientY)<=Number(s.bottom)}function jp(e,t,s=globalThis.document){if(!e||e.defaultPrevented||!t||!_y(e.key))return!1;let n=e.target;return!n||n.closest?.(Ry)?!1:n===t||n===s?.body||n===s?.documentElement}var Py,Ry,Nt,rl=F(()=>{Py=new Set(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," "]),Ry='input, textarea, select, button, a, [contenteditable], [role="button"], [role="link"]';Nt=Object.freeze({itemHeight:260,viewportHeight:720,overscan:1,itemGap:18,bottomThreshold:80,resumeBottomThreshold:2,historyPrefetchViewports:2,historyPrefetchMinPx:600})});var cr,Up,Kp=F(()=>{rl();cr=2,Up={name:"VirtualTranscript",props:{items:{type:Array,default:()=>[]},overscan:{type:Number,default:Nt.overscan},itemGap:{type:Number,default:Nt.itemGap},estimateHeight:{type:Function,default:es},initialAlign:{type:String,default:"start"}},emits:["scroll-state"],template:`
|
|
1027
1027
|
<div class="virtual-transcript" ref="rootRef">
|
|
1028
1028
|
<div
|
|
1029
1029
|
v-if="topSpacerHeight > 0"
|
|
@@ -1050,8 +1050,8 @@ ${String(e||"").trim()}
|
|
|
1050
1050
|
aria-hidden="true"
|
|
1051
1051
|
></div>
|
|
1052
1052
|
</div>
|
|
1053
|
-
`,setup(e,{emit:t,expose:s}){let n=Vue.ref(null),r=Vue.ref(null),i=e.initialAlign==="end",o=Vue.ref(i?Number.MAX_SAFE_INTEGER:0),a=Vue.ref(Nt.viewportHeight),l=Vue.reactive({}),c=new Map,d=new Map,u=new Map,f=null,p=null,g=null,m=null,b=0,I=!1,y=0,S=!0,w=null,v="start",h=null,M=Vue.computed(()=>nl(e.items,l,{itemGap:e.itemGap,estimateHeight:e.estimateHeight})),x=Vue.computed(()=>Op(e.items,M.value,{scrollTop:o.value,viewportHeight:a.value,overscan:e.overscan})),E=Vue.computed(()=>x.value.items),V=Vue.computed(()=>x.value.topSpacerHeight),L=Vue.computed(()=>x.value.bottomSpacerHeight);function R(
|
|
1054
|
-
`),()=>{c.clear(),e.items.forEach((
|
|
1053
|
+
`,setup(e,{emit:t,expose:s}){let n=Vue.ref(null),r=Vue.ref(null),i=e.initialAlign==="end",o=Vue.ref(i?Number.MAX_SAFE_INTEGER:0),a=Vue.ref(Nt.viewportHeight),l=Vue.reactive({}),c=new Map,d=new Map,u=new Map,f=null,p=null,g=null,m=null,b=0,I=!1,y=0,S=!0,w=null,v="start",h=null,M=Vue.computed(()=>nl(e.items,l,{itemGap:e.itemGap,estimateHeight:e.estimateHeight})),x=Vue.computed(()=>Op(e.items,M.value,{scrollTop:o.value,viewportHeight:a.value,overscan:e.overscan})),E=Vue.computed(()=>x.value.items),V=Vue.computed(()=>x.value.topSpacerHeight),L=Vue.computed(()=>x.value.bottomSpacerHeight);function R(B){B&&t("scroll-state",{scrollTop:B.scrollTop||0,scrollHeight:B.scrollHeight||0,clientHeight:B.clientHeight||0})}function P(){let B=r.value;B&&(a.value=Math.max(1,B.clientHeight||Nt.viewportHeight),i&&e.items.length===0||(o.value=Math.max(0,B.scrollTop||0)),R(B))}function A(){let B=r.value;return!i||e.initialAlign!=="end"||e.items.length===0||!B?!1:(se(),B.scrollTop=B.scrollHeight,i=!1,P(),!0)}function _(){A()||P()}function j(){p||(p=requestAnimationFrame(()=>{p=null,P()}))}function q(B){return B?As({scrollTop:B.scrollTop,scrollHeight:B.scrollHeight,clientHeight:B.clientHeight,threshold:Nt.bottomThreshold}):!0}function z({delta:B=0,toBottom:N=!1}={},O=y){if(O!==y||(Math.abs(B)>=cr&&(b+=B),N&&(I=!0),m))return;let D=O;m=requestAnimationFrame(()=>{if(m=null,D!==y)return;let Z=r.value;if(!Z){b=0,I=!1;return}I?Z.scrollTop=Z.scrollHeight:Math.abs(b)>=cr&&(Z.scrollTop+=b),b=0,I=!1,P()})}function se(){w=null,h=null}function me({preserveTarget:B=!1}={}){y+=1,I=!1,b=0,B||se(),m&&cancelAnimationFrame(m),m=null}function ae(B,N,O){!B||!O||(u.set(B,{index:N,el:O}),!g&&(g=requestAnimationFrame(()=>{g=null;let D=Array.from(u.entries());u.clear(),ve(D)})))}function ve(B){let N=[];for(let[ue,le]of B){let Ce=le?.el;if(!Ce)continue;let xe=Math.ceil(Ce.getBoundingClientRect?.().height||Ce.offsetHeight||0);if(!Number.isFinite(xe)||xe<=0)continue;let $e=l[ue];if($e===xe)continue;let je=c.get(ue);N.push({key:ue,nextHeight:xe,previousHeight:$e,itemIndex:Number.isFinite(je)?je:le.index})}if(!N.length)return;let O=r.value,D=S&&q(O),Z=x.value.visibleStart,ne=!!w&&N.some(ue=>ue.key===w),ye=0,Y=!1;for(let ue of N){let{key:le,nextHeight:Ce,previousHeight:xe,itemIndex:$e}=ue;if(l[le]=Ce,!O||!Number.isFinite(xe))continue;let je=Ce-xe;Math.abs(je)<cr||(Number.isFinite($e)&&$e<Z?ye+=je:D&&(Y=!0))}if(ne){me({preserveTarget:!0}),pe(w,v);return}if(Math.abs(ye)>=cr||Y){let ue={delta:ye,toBottom:Y},le=y;Y?Vue.nextTick(()=>z(ue,le)):z(ue,le)}}function ge(B,N="start"){let O=r.value,D=h||d.get(String(B));if(!O||!D)return!1;let Z=O.getBoundingClientRect?.(),ne=D.getBoundingClientRect?.();if(!Z||!ne)return!1;let ye=Number(Z.top),Y=Number(O.clientHeight||a.value),ee=Number(ne.height||0),ue=N==="center"&&ee<=Y?ye+(Y-ee)/2:N==="end"&&ee<=Y?Number(Z.bottom)-ee:ye,le=Number(ne.top)-ue;return Math.abs(le)>=cr&&(O.scrollTop+=le),P(),!0}function pe(B,N="start",O){let D=String(B);w=D,v=N,O!==void 0&&(h=O);let Z=()=>{w===D&&ge(D,v)};Vue.nextTick(Z)}function T(B){let N=!!B;N&&se(),S!==N&&(S=N,S||me())}function K(B,N,O){c.set(B,N),O&&(d.set(B,O),f&&f.observe(O),Vue.nextTick(()=>ae(B,N,O)))}function re(B,N,O){if(!B)return;let D=d.get(B);if(D&&D!==O&&f&&f.unobserve(D),!O){d.delete(B);return}K(B,N,O)}async function he(B,{align:N="center"}={}){let O=Number.isFinite(B)?Math.floor(B):-1,D=r.value;if(!D||O<0||O>=e.items.length)return!1;me({preserveTarget:!0});let Z=rn(e.items[O],O);return w=Z,v=N,h=null,D.scrollTop=Fp(e.items,O,l,{itemGap:e.itemGap,estimateHeight:e.estimateHeight,viewportHeight:D.clientHeight||a.value,align:N}),P(),await Vue.nextTick(),d.get(Z)?(pe(Z,N),!0):!1}function Pe(B,N={}){let O=c.get(String(B));return Number.isFinite(O)?he(O,N):Promise.resolve(!1)}function U(B,N,{align:O="start"}={}){let D=String(B||"");return!D||!N?!1:(w=D,v=O,h=N,ge(D,O),!0)}return s({scrollToKey:Pe,scrollToIndex:he,anchorTarget:U,clearTargetAnchor:se,cancelPendingBottomFollow:me,setBottomFollowEnabled:T}),Vue.watch(()=>e.items.map((B,N)=>rn(B,N)).join(`
|
|
1054
|
+
`),()=>{c.clear(),e.items.forEach((B,N)=>c.set(rn(B,N),N)),w&&!c.has(w)&&se(),Vue.nextTick(_)},{immediate:!0}),Vue.onMounted(()=>{if(r.value=n.value?.closest?.(".chat-container")||n.value?.parentElement||null,_(),r.value?.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j),typeof ResizeObserver<"u"){f=new ResizeObserver(B=>{for(let N of B){let O=N.target?.dataset?.virtualId,D=Number(N.target?.dataset?.virtualIndex);O&&ae(O,D,N.target)}});for(let[B,N]of d.entries()){let O=c.get(B)??Number(N.dataset?.virtualIndex||0);K(B,O,N)}}}),Vue.onBeforeUnmount(()=>{r.value?.removeEventListener("scroll",j),window.removeEventListener("resize",j),f&&f.disconnect(),p&&cancelAnimationFrame(p),g&&cancelAnimationFrame(g),m&&cancelAnimationFrame(m),u.clear(),b=0,I=!1}),{rootRef:n,visibleEntries:E,topSpacerHeight:V,bottomSpacerHeight:L,setItemRef:re}}}});function on(e){return typeof e=="string"&&e.trim()?e.trim():""}function Yp(e){return on(e?.speakerVpId)||on(e?.vpId)}function zp(e){let t=Yp(e),s=on(e?.turnId);return!t||!s?"":[t,s].join("\0")}function Gp(e){if(!Array.isArray(e)||e.length<2)return e||[];let t=[],s=[],n=()=>{if(s.length===0)return;let r=new Map;for(let i of s){let o=zp(i);r.has(o)||r.set(o,[]),r.get(o).push(i)}for(let i of r.values())t.push(...i);s=[]};for(let r of e){if(Ey.has(r?.type)&&zp(r)){s.push(r);continue}n(),t.push(r)}return n(),t}function Qp(e,t){if(!e||!t)return!1;let s=on(e.speakerVpId),n=Yp(t);if(s&&n&&s!==n)return!0;let r=on(e.turnId),i=on(t.turnId);return e.isHistory&&t.isHistory?e.messages?.length>0&&t.executionOrigin==="route_forward"&&r&&i&&r!==i:!!(r&&i&&r!==i)}var Ey,Xp=F(()=>{Ey=new Set(["assistant","chat-image","tool-result","tool-summary","tool-use","tool_result"])});function dr(e){return e?e.type!=="user"&&e.type!=="system"&&e.type!=="error":!1}function Ai(e){let t=Array.isArray(e?.items)?e.items:[];return e?.responseCollapsed?t.filter(s=>!dr(s)):t}function Dy(e){return(Array.isArray(e?.items)?e.items:[]).filter(dr)}function Zp(e){let t=Dy(e);return t.length?t[0]:null}function Ly(e){let t=e?.textContent??e?.text??e?.content??e?.message?.content??"";return typeof t=="string"?t:Array.isArray(t)?t.map(s=>typeof s=="string"?s:s&&s.type==="text"&&s.text||"").join(""):t==null?"":String(t)}function Jp(e){if(!e?.responseCollapsed)return[];let t=Zp(e);return Ly(t).replace(/```[\s\S]*?```/g," ").replace(/`([^`]+)`/g,"$1").replace(/!\[[^\]]*\]\([^)]*\)/g," ").replace(/\[[^\]]*\]\(([^)]*)\)/g,"").replace(/[#>*_~\-]+/g," ").split(/\r?\n/).map(n=>n.trim()).filter(Boolean).slice(0,2)}function ef(e,t){if(!e?.responseCollapsed||typeof t!="function")return null;let s=Ai(e),n=Zp(e)?74:0,r=s.length+(n?1:0);if(!s.length)return n;let i=s.reduce((a,l)=>a+t(l),0),o=Math.max(0,r-1)*18;return i+o+n}var tf=F(()=>{});function Bt(e,t){typeof t!="string"||!/^m\d+$/.test(t)||e.includes(t)||e.push(t)}function $y(e){if(!e)return[];let t=[];for(let s of Array.isArray(e.messages)?e.messages:[]){Bt(t,s?.id),Bt(t,s?.messageId),Bt(t,s?.persistedMessageId);for(let n of Array.isArray(s?.sourceMessageIds)?s.sourceMessageIds:[])Bt(t,n)}return Bt(t,e.message?.id),Bt(t,e.messageId),Bt(t,e.atMessageId),e.type!=="assistant-turn"&&Bt(t,e.id),t}function Vy(e){let t=[],s=n=>{typeof n=="string"&&n&&!t.includes(n)&&t.push(n)};s(e?.entryId),s(e?.message?.entryId);for(let n of Array.isArray(e?.messages)?e.messages:[])s(n?.entryId);return t}function sf(e){return!e?.closest?.(".yeaft-conversation-outline, .yeaft-conversation-outline-sender-menu, .yeaft-search-btn")}async function nf({result:e,revealWindow:t,nextTick:s,revealMessage:n,isMobile:r,closeOutline:i}){if(!e||!await t?.(e))return!1;await s?.();let a=await n?.(e);return a&&r&&i?.(),!!a}function Hy(e,t){let s=typeof t?.entryId=="string"?t.entryId:null,n=[];for(let r of[...Array.isArray(t?.sourceMessageIds)?t.sourceMessageIds:[],t?.messageId,typeof t=="string"?t:null])Bt(n,r);if(!s&&n.length===0)return null;for(let r of Array.isArray(e)?e:[]){if(!r)continue;let i=Array.isArray(r.items)?r.items:[r];for(let o of i){let a=s&&Vy(o).includes(s),l=n.some(u=>$y(o).includes(u));if(!a&&!l)continue;let c=o?.id,d=r?.id;return!c||!d?null:{blockId:d,rowId:c,collapseKey:r.responseCollapseKey||null,requiresExpansion:!!(r.responseCollapsed&&o.type==="assistant-turn")}}}return null}async function rf({blocks:e,target:t,messageId:s,collapseStates:n,scrollToBlock:r,findRow:i,anchorRow:o,flashRow:a,nextTick:l,align:c="start"}){let d=Hy(e,t||s);if(!d||typeof r!="function"||typeof i!="function")return!1;if(d.requiresExpansion){if(!d.collapseKey||!n)return!1;n[d.collapseKey]=!1,await l?.()}if(!await r(d.blockId,{align:c}))return!1;await l?.();let f=i(d.rowId);return f?(typeof o=="function"?o(d.blockId,d.rowId,f,{align:c}):f.scrollIntoView?.({block:c,inline:"nearest"}),a?.(d.rowId),!0):!1}var il=F(()=>{});var xi,ol=F(()=>{gt();Ua();vi();ki();Si();tl();Dp();$p();Ii();Kp();Xp();rl();tf();il();Xt();Jr();xi={name:"MessageList",components:{MessageItem:en,AssistantTurn:tn,VpTurnBlock:sn,VpSpeakerHeader:wi,ReflectionCard:Ep,SubAgentCard:Lp,UserTurnBlock:nn,VirtualTranscript:Up},template:`
|
|
1055
1055
|
<main class="chat-container" ref="containerRef">
|
|
1056
1056
|
<!-- Session Loading Overlay - only covers message area -->
|
|
1057
1057
|
<div class="session-loading-overlay" v-if="showSessionLoadingOverlay">
|
|
@@ -1673,7 +1673,7 @@ ${String(e||"").trim()}
|
|
|
1673
1673
|
{{ $t('message.scrollToLatest') }}
|
|
1674
1674
|
</button>
|
|
1675
1675
|
</main>
|
|
1676
|
-
`,emits:["new-conversation","resume-conversation","open-settings","quote-message","edit-message-as-new"],setup(e,{expose:t}){let s=Pinia.useChatStore(),n=De(),r=typeof window<"u"&&window.Pinia?.useVpStore?window.Pinia.useVpStore():null,i=Vue.inject("t",null),o=Vue.ref(null),a=Vue.ref(null),l=Vue.reactive({}),c=Vue.reactive({}),d=Vue.reactive({}),u=k=>String(k?.id||k?.turnId||k?.messageId||k?.atMessageId||k?.message?.id||"turn_unknown"),f=k=>{let $=u(k);return Object.prototype.hasOwnProperty.call(l,$)?!!l[$]:!1},p=(k,$)=>{l[u(k)]=!!$},g=({key:k,value:$}={})=>{k&&(c[k]=!!$)},m=k=>{let $=ef(k,es);return Number.isFinite($)?$:es(k)},b=k=>Ai(k),I=k=>{let $=Array.isArray(k?.collapsedResponsePreview)?k.collapsedResponsePreview:Jp(k);return Array.isArray($)?$:$?[String($)]:[]},y=k=>{let $=Array.isArray(k?.items)?k.items.find(te=>dr(te)):null,W=$?.speakerVpId||$?.vpId||$?.message?.speakerVpId||$?.message?.vpId||k?.vpId||"",ie=W&&r&&typeof r.vpLabel=="function"?r.vpLabel(W)||W:W||(typeof i=="function"?i("message.assistant"):"Assistant"),be=W&&r&&typeof r.vpTextColor=="function"?{color:r.vpTextColor(W)}:{},ce=$?.speakerTimestamp||$?.timestamp||$?.createdAt||$?.message?.timestamp||$?.message?.createdAt||0,Fe="",Ie="";if(ce)try{let te=new Date(ce);Number.isNaN(te.getTime())||(Fe=xt(ce),Ie=te.toLocaleString())}catch{}return{name:ie,style:be,timeText:Fe,fullTimeText:Ie}},S=k=>{let $=Array.isArray(k?.items)?k.items:[];for(let W=$.length-1;W>=0;W-=1)if(dr($[W]))return $[W];return null},w=(k,$)=>!k?.responseCollapsible||!$?!1:S(k)===$,v=k=>!!(k?.responseCollapsible&&!Ai(k).some($=>w(k,$))),h=k=>{let $=k?.responseCollapseKey;$&&(d[$]=!k.responseCollapsed)},M=k=>{let $=Number(k?.responseCount||0),W=k?.responseCollapsed?"message.showResponses":"message.hideResponses",ie=(typeof i=="function"?i(W):"")||(k?.responseCollapsed?"Show {count} response(s)":"Hide response(s)");return String(ie).replace("{count}",String($))},x=(()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}}),E=Vue.computed(()=>{if(s.currentView!=="yeaft")return null;let k=x();if(!k)return null;let $=s.yeaftActiveSessionFilter||null;return $&&typeof k.sessionById=="function"&&k.sessionById($,s.currentAgent||null)?$:k.activeSessionId&&typeof k.sessionById=="function"&&k.sessionById(k.activeSessionId,s.currentAgent||null)?k.activeSessionId:null}),V=Vue.computed(()=>{let k=s.currentView||"",$=s.currentAgent||"";if(k==="yeaft"){let W=s.yeaftActiveSessionFilter||E.value||"__all__";return[k,$,W].join("")}return[k,$,s.activeConversationId||""].join("")}),L=Vue.computed(()=>E.value!==null),R=Vue.computed(()=>s.agents.filter(k=>k.online)),P=Vue.ref(null),A=Vue.ref(null),_=Vue.ref(!1),j=Vue.ref(""),B=null,z=0,se=n.token||"",me=()=>{P.value=null,A.value=null,j.value="",B=null,z+=1},ae=fi(),ve=gi(),ge=Vue.computed(()=>mi({profile:P.value,agentSecret:A.value,serverWsUrl:rr(location)})),pe=()=>{let k={"Content-Type":"application/json"};return n.token&&(k.Authorization=`Bearer ${n.token}`),k},T=async()=>{if(R.value.length>0||s.currentConversation)return;if(A.value||B)return B;_.value=!0,j.value="";let k=++z;return B=(async()=>{let $=n.token||"",W=pe(),[ie,be]=await Promise.all([fetch("/api/user/profile",{headers:W}),fetch("/api/user/agent-secret",{headers:W})]),ce=ie.ok?await ie.json():null;if(k!==z||$!==(n.token||""))return;if(ce&&(P.value=ce),!be.ok){let te="";try{te=(await be.json())?.error||""}catch{}throw new Error(te||"Failed to load Agent secret")}let Fe=await be.json();if(k!==z||$!==(n.token||""))return;let Ie=Fe?.agentSecret||Fe?.agent_secret||null;A.value=Ie&&String(Ie).trim()?String(Ie):null})().catch($=>{k===z&&(j.value=$?.message||"Failed to load Agent secret")}).finally(()=>{k===z&&(_.value=!1,B=null)}),B},K=async k=>{if(k)try{await navigator.clipboard.writeText(k)}catch{}},re=new WeakMap,he=0,Pe=(k,$)=>{let W=k?.message&&typeof k.message=="object"?k.message:Array.isArray(k?.messages)&&k.messages[0]&&typeof k.messages[0]=="object"?k.messages[0]:$&&typeof $=="object"?$:k&&typeof k=="object"?k:null;if(!W)return`legacy_render_${++he}`;let ie=re.get(W);return ie||(ie=`legacy_render_${++he}`,re.set(W,ie)),ie},U=k=>{let $=k?.message||k||null;return k?.entryId||k?.uiKey||k?.stableKey||$?.entryId||$?.uiKey||$?.stableKey||k?.atMessageId||k?.messageId||$?.messageId||k?.id||$?.id||Pe(k,$)},q=k=>encodeURIComponent(String(k||"legacy")),N=k=>{let $=k?.message||null,W=U(k),ie=k?.id||k?.atMessageId||$?.id||$?.messageId||W,be=k?.speakerVpId||k?.vpId||$?.speakerVpId||$?.vpId||"";return{id:`message_${q(W)}`,uiKey:W,vpId:be,messageId:ie}},O=Vue.computed(()=>{let k=s.currentView==="yeaft"?Gp(s.messages):s.messages,$=[],W=null,ie=()=>{if(W){W.isActive=!!(W.turnId&&Object.values(s.activeVpTurns||{}).some(ut=>((ut?.turnId||null)===W.turnId||!ut?.turnId&&s.activeVpTurns?.[W.turnId]===ut)&&(!s.currentAgent||!ut?.agentId||ut.agentId===s.currentAgent))),Zr(W);let Ie=!!(W.textContent||W.todoMsg||W.askMsg||W.imageMsgs.length>0),te=W.toolMsgs.length>0||W.toolSummaryCount>0;(Ie||te)&&(W.showSpeakerHeader=!!W.speakerVpId,$.push(W)),W=null}},be=Ie=>{if(W){if(!W.speakerVpId){let te=Ie.speakerVpId||Ie.vpId;te&&(W.speakerVpId=te,W.speakerTimestamp=typeof Ie.timestamp=="number"&&Ie.timestamp>0?Ie.timestamp:typeof Ie.createdAt=="number"?Ie.createdAt:0,typeof Ie.lastStateChangeCause=="string"&&!W.speakerStateCause&&(W.speakerStateCause=Ie.lastStateChangeCause))}!W.turnId&&Ie.turnId&&(W.turnId=Ie.turnId)}},ce=(Ie=null)=>{let te=U(Ie);W={type:"assistant-turn",id:`response_${q(te)}`,uiKey:te,...Ie?.entryId?{entryId:Ie.entryId}:{},textContent:"",textSegments:[],isStreaming:!1,isActive:!1,isHistory:!1,todoMsg:null,toolMsgs:[],toolSummaryCount:0,imageMsgs:[],askMsg:null,messages:[],atMessageId:null,speakerVpId:null,speakerTimestamp:0,speakerStateCause:"",showSpeakerHeader:!1,turnId:null}},Fe=Ie=>{Qp(W,Ie)&&ie()};for(let Ie=0;Ie<k.length;Ie++){let te=k[Ie];if(te.type==="user"){if(!te.content||!te.content.trim())continue;ie(),$.push({type:"user",id:U(te),message:te});continue}if(te.type==="system"||te.type==="error"){ie(),$.push({type:te.type,id:U(te),message:te});continue}if(!(te.type==="tool-result"||te.type==="tool_result")){if(te.type==="tool-summary"){Fe(te),W||ce(te),be(te),te.isHistory&&(W.isHistory=!0),W.toolSummaryCount+=Number(te.count||te.omittedCount||0)||0,W.messages.push(te);continue}if(te.type==="assistant"){Fe(te),W||ce(te),Xr(W,te),te.isStreaming&&(W.isStreaming=!0),te.isHistory&&(W.isHistory=!0),te.id&&/^m\d+$/.test(te.id)&&(W.atMessageId=te.id),be(te),W.messages.push(te);continue}if(te.type==="tool-use"){Fe(te),W||ce(te),be(te);let ut=k[Ie+1],Rr=ut&&(ut.type==="tool-result"||ut.type==="tool_result"),An={...te,hasResult:Rr||te.hasResult||!1,toolResult:te.toolResult||null};te.isHistory&&(W.isHistory=!0),te.toolName==="TodoWrite"?W.todoMsg=An:te.toolName==="AskUserQuestion"?W.askMsg=An:W.toolMsgs.push(An),W.messages.push(te);continue}if(te.type==="chat-image"){Fe(te),W||ce(te),be(te),te.isHistory&&(W.isHistory=!0),W.imageMsgs.push(te),W.messages.push(te);continue}ie(),$.push({type:te.type||"unknown",id:U(te),message:te})}}return ie(),$}),D=Vue.computed(()=>{let k=[],$=null,W=()=>{$&&k.push($),$=null};return O.value.forEach(ie=>{if(!ie||ie.type==="system"||ie.type==="error"){W(),k.push(ie);return}let be=N(ie);if(ie.type==="user"||!$){W(),$={type:"message-block",id:`block_${q(be.uiKey)}`,uiKey:be.uiKey,vpId:be.vpId,messageId:be.messageId,items:[ie]};return}$.items.push(ie),!$.vpId&&be.vpId&&($.vpId=be.vpId)}),W(),k}),Z=Vue.computed(()=>{let k=s.yeaftReflectionCards||{},$=s.yeaftConversationId,W={__orphans:[]},ie=Object.values(k).filter(ce=>ce&&ce.conversationId===$).sort((ce,Fe)=>(ce.anchorOrder||0)-(Fe.anchorOrder||0)||(ce.updatedAt||0)-(Fe.updatedAt||0)),be=new Set;for(let ce of s.messages||[])ce&&ce.id&&be.add(ce.id);for(let ce of ie)ce.anchorMsgId&&be.has(ce.anchorMsgId)?(W[ce.anchorMsgId]||(W[ce.anchorMsgId]=[]),W[ce.anchorMsgId].push(ce)):W.__orphans.push(ce);return W}),ne=k=>k?k.type==="assistant-turn"?k.atMessageId||null:k.message&&k.message.id||null:null,ye=k=>{let $=ne(k);return $?(Z.value||{})[$]||[]:[]},Y=Vue.computed(()=>(Z.value||{}).__orphans||[]),ee=Vue.computed(()=>{let k=s.yeaftSubAgentCards||{},$=s.yeaftConversationId,W={__orphans:[]},ie=Object.values(k).filter(ce=>ce&&ce.conversationId===$).sort((ce,Fe)=>(ce.anchorOrder||0)-(Fe.anchorOrder||0)||(ce.updatedAt||0)-(Fe.updatedAt||0)),be=new Set;for(let ce of s.messages||[])ce&&ce.id&&be.add(ce.id);for(let ce of ie)ce.anchorMsgId&&be.has(ce.anchorMsgId)?(W[ce.anchorMsgId]||(W[ce.anchorMsgId]=[]),W[ce.anchorMsgId].push(ce)):W.__orphans.push(ce);return W}),ue=k=>{let $=ne(k);return $?(ee.value||{})[$]||[]:[]},le=Vue.computed(()=>(ee.value||{}).__orphans||[]),Ce=Vue.ref(!0),xe=Vue.ref(!1),$e=Nt.bottomThreshold,je=Nt.resumeBottomThreshold,yt=!0,bt=Vue.computed(()=>s.messages.some(k=>k.isStreaming)),rs=Vue.computed(()=>!s.activeConversationId||D.value.length>0?!1:s.currentView==="yeaft"?!!s.yeaftInitialHistoryLoading:!!s.sessionLoading),gn=Vue.computed(()=>s.currentView==="yeaft"&&!!s.yeaftLoadingMoreHistory&&s.activeYeaftHistoryState?.mode==="older"),Wt=Vue.computed(()=>s.currentView==="yeaft"?"":s.sessionLoadingText||""),Rt=Vue.computed(()=>!!s.sessionLoading&&!rs.value),_t=Vue.computed(()=>s.isProcessing&&!bt.value),Xe=Vue.ref(Date.now()),wt=null,mn=()=>{wt||(wt=setInterval(()=>{Xe.value=Date.now()},1e3))},H=()=>{wt&&(clearInterval(wt),wt=null)};Vue.watch(bt,k=>{k?(Xe.value=Date.now(),mn()):H()},{immediate:!0}),Vue.onBeforeUnmount(()=>H());let G=Vue.ref(0),de=Vue.ref(Date.now()),fe=null,we=null,Te=Vue.ref("cat"),Ze=new URLSearchParams(window.location.search).get("preview"),Ue=Vue.ref(0),Je=Vue.ref(1),qe=Vue.ref(5),Be=Vue.ref(95),We=Vue.ref("bark-both"),Ke=Vue.ref(1),ze=Vue.ref(-1),dt=null;function Rs(){if(!G.value)return;de.value=Date.now();let k=(de.value-G.value)%19e3;if(k<4e3)Ue.value=0,Je.value=1;else if(k<11500){let $=k-4e3,W;$<2500?W=$/2500*16:$<5e3?W=16+($-2500)/2500*29:W=45+($-5e3)/2500*55,Ue.value=W,Je.value=1}else k<14e3?(Ue.value=(1-(k-11500)/2500)*100,Je.value=-1):(Ue.value=0,Je.value=1);we=requestAnimationFrame(Rs)}function hn(){if(!G.value||Te.value!=="dog")return;de.value=Date.now();let k=(de.value-G.value)%18e3;if(k<2e3)qe.value=5,Be.value=95,We.value="bark-both",Ke.value=1,ze.value=-1;else if(k<5e3){let $=(k-2e3)/3e3;qe.value=5+$*25,Be.value=95,We.value="left-approach",Ke.value=1,ze.value=-1}else if(k<8e3){let $=(k-5e3)/3e3;qe.value=30,Be.value=95-$*25,We.value="right-approach",Ke.value=1,ze.value=-1}else if(k<1e4){let $=(k-8e3)/2e3;qe.value=30+$*13,Be.value=70-$*13,We.value="both-approach",Ke.value=1,ze.value=-1}else if(k<11e3)qe.value=43,Be.value=57,We.value="snap",Ke.value=1,ze.value=-1;else if(k<12500)qe.value=43,Be.value=57,We.value="stunned",Ke.value=1,ze.value=-1;else if(k<15e3){let $=(k-12500)/2500;qe.value=43-$*38,Be.value=57+$*38,We.value="retreat",Ke.value=-1,ze.value=1}else k<17e3?(qe.value=5,Be.value=95,We.value="rehang",Ke.value=-1,ze.value=1):(qe.value=5,Be.value=95,We.value="reset",Ke.value=1,ze.value=-1);dt=requestAnimationFrame(hn)}let ro=Vue.computed(()=>{let k=qe.value*1.2;return Ke.value<0?`translate(${k+13.5}, 0) scale(-1, 1)`:`translate(${k-13.5}, 0)`}),io=Vue.computed(()=>{let k=Be.value*1.2;return ze.value>0?`translate(${k-10.5}, 2)`:`translate(${k+10.5}, 2) scale(-1, 1)`}),br=Vue.computed(()=>{let k=We.value;return k==="bark-both"||k==="left-approach"||k==="right-approach"||k==="both-approach"||k==="reset"}),oo=Vue.computed(()=>{let k=qe.value*1.2,$=10;if(br.value){let be=Math.max(0,(k-3)*.12);return`M3,18 Q${(3+k)/2},${18+be} ${k},${$}`}if(We.value==="rehang")return`M${k},${$} Q${k-3},20 3,18`;let W=Ke.value<0?1:-1,ie=k+W*8;return`M${k},${$} Q${k},18 ${ie},22`}),ao=Vue.computed(()=>{let k=Be.value*1.2,$=10;if(br.value){let be=Math.max(0,(118-k)*.12);return`M118,18 Q${(118+k)/2},${18+be} ${k},${$}`}if(We.value==="rehang")return`M${k},${$} Q${k+3},20 118,18`;let W=ze.value>0?-1:1,ie=k+W*8;return`M${k},${$} Q${k},18 ${ie},22`}),lo=Vue.computed(()=>We.value==="snap"?.2:.4),co=Vue.computed(()=>We.value==="snap"?.2:.4),uo=Vue.computed(()=>qe.value*1.2),po=Vue.computed(()=>Be.value*1.2),vn=Ze==="cat"||Ze==="dog"||Ze==="animation",wr=600,yn=Vue.ref(!1),Oe=null,bn=Vue.computed(()=>vn?!0:yn.value);Vue.watch(_t,k=>{if(k)Oe&&(clearTimeout(Oe),Oe=null),yn.value=!0,G.value=Date.now(),de.value=Date.now(),Te.value="cat",Ue.value=0,Je.value=1,qe.value=5,Be.value=95,We.value="bark-both",Ke.value=1,ze.value=-1,Te.value==="cat"?we=requestAnimationFrame(Rs):dt=requestAnimationFrame(hn);else{let $=G.value?Date.now()-G.value:wr,W=Math.max(0,wr-$),ie=()=>{Oe=null,yn.value=!1,G.value=0,Ue.value=0,Je.value=1,we&&(cancelAnimationFrame(we),we=null),dt&&(cancelAnimationFrame(dt),dt=null)};W===0?ie():(Oe&&clearTimeout(Oe),Oe=setTimeout(ie,W))}},{immediate:!0}),vn&&(G.value=Date.now(),de.value=Date.now(),Ze==="dog"?Te.value="dog":Te.value="cat",Te.value==="cat"?we=requestAnimationFrame(Rs):(qe.value=5,Be.value=95,We.value="bark-both",Ke.value=1,ze.value=-1,dt=requestAnimationFrame(hn)));let fo=Vue.computed(()=>{if(!s.isProcessing)return null;if(s.connectionState!=="connected")return"disconnected";let k=s.currentConversation;if(s.compactStatus?.conversationId===k&&s.compactStatus?.status==="compacting")return"compacting";let $=s.sessionHealth?.[k];return $?$.status:G.value&&de.value-G.value>8e3?"thinking":null}),go=Vue.computed(()=>{if(!G.value)return"speed-napping";let k=(de.value-G.value)%19e3;return k>=16e3?"speed-petted":k>=14e3?"speed-tired":k>=11500?"speed-crazy":k>=9e3?"speed-turbo":k>=6500?"speed-fast":k>=4e3?"speed-normal":"speed-napping"}),mo=Vue.computed(()=>{let k=Ue.value,$=Je.value,ie={left:`calc(40px + (100% - 80px) * ${k/100})`};return $<0&&(ie.transform="scaleX(-1)"),ie});function is(){let k=s.currentConversation;if(!k)return;let $=s.conversations.find(W=>W.id===k);s.sendWsMessage({type:"refresh_conversation",conversationId:k,agentId:$?.agentId})}let os=()=>{if(!o.value)return!0;let{scrollTop:k,scrollHeight:$,clientHeight:W}=o.value;return As({scrollTop:k,scrollHeight:$,clientHeight:W,threshold:$e})},wn=(k,$=0,{allowContinuation:W=!1}={})=>{if(k>Np($)){yt=!0;return}W&&(yt=!0),!(!yt||!_s())&&(yt=!1,Ir())},kr=k=>{if(!k)return"";let W=(Array.isArray(k.items)?k.items:[])[0]||null;return[k.type||"",k.messageId||"",k.turnId||"",k.vpId||"",W?.id||"",W?.turnId||"",W?.messageId||""].join(":")},kn=()=>{let k=D.value||[];return{blockCount:k.length,firstBlockIdentity:kr(k[0])}},ho=(k,$)=>!k||!$?!1:$.blockCount>k.blockCount||$.firstBlockIdentity!==k.firstBlockIdentity,Sn=k=>{Vue.nextTick(()=>{if(!o.value)return;let $=kn();ho(k,$)&&wn(o.value.scrollTop||0,o.value.clientHeight||0,{allowContinuation:!0})})},Sr=({scrollTop:k,scrollHeight:$,clientHeight:W})=>{let ie=As({scrollTop:k,scrollHeight:$,clientHeight:W,threshold:$e});return Ce.value=ie,xe.value=!ie,ie},In=()=>{xe.value=!1,Ce.value=!0,a.value?.setBottomFollowEnabled?.(!0)},st=()=>{xe.value=!0,Ce.value=!1,a.value?.setBottomFollowEnabled?.(!1),a.value?.cancelPendingBottomFollow?.()},vo=({scrollTop:k,scrollHeight:$,clientHeight:W})=>{let ie=As({scrollTop:k||0,scrollHeight:$||0,clientHeight:W||0,threshold:$e});Ce.value=qp({following:!xe.value,atBottom:ie}),xe.value=!Ce.value,a.value?.setBottomFollowEnabled?.(Ce.value),kt||(as=Number(k||0)),wn(k||0,W||0)},yo=(k,$)=>{let W=kn();if(!o.value){k(),Sn(W);return}let ie=o.value.scrollHeight,be=o.value.scrollTop,ce=!1,Fe=null,Ie=()=>{ce||(ce=!0,Fe&&Fe(),Vue.nextTick(()=>{if(!o.value)return;let te=o.value.scrollHeight;o.value.scrollTop=te-ie+be,Sn(W)}))};$&&(Fe=Vue.watch($,te=>{te||Ie()})),k(),Vue.nextTick(()=>{(!$||!$())&&Ie()})},bo=()=>{if(s.hasHiddenYeaftMessages){s.expandYeaftMessageWindow();return}s.loadMoreYeaftHistory()},_s=()=>s.currentView==="yeaft"?s.hasHiddenYeaftMessages||s.yeaftHasMoreHistory&&!s.yeaftLoadingMoreHistory&&s.yeaftOldestLoadedSeq!=null:!!s.currentConversation&&s.hasMoreMessages&&!s.loadingMoreMessages,Ir=()=>{if(!_s())return;let k=s.currentView==="yeaft";yo(k?bo:()=>s.loadMoreMessages(),k?()=>s.yeaftLoadingMoreHistory:()=>s.loadingMoreMessages)},kt=!1,Cn=!1,nt=null,as=0,wo=250,Cr=()=>{kt=!1,nt&&(clearTimeout(nt),nt=null)},Es=()=>{Cn||(nt&&clearTimeout(nt),nt=setTimeout(Cr,wo))},Ds=k=>{kt=!0,a.value?.clearTargetAnchor?.(),as=Number(o.value?.scrollTop||0),Number(k?.deltaY)<0&&st(),Es()},Ar=k=>{Wp(k,o.value)&&(Cn=!0,kt=!0,a.value?.clearTargetAnchor?.(),as=Number(o.value?.scrollTop||0),nt&&(clearTimeout(nt),nt=null))},Ls=()=>{Cn=!1,Es()},xr=k=>{jp(k,o.value)&&((k.key==="ArrowUp"||k.key==="PageUp"||k.key==="Home")&&st(),kt=!0,a.value?.clearTargetAnchor?.(),Es())},jt=()=>{let k=Number(o.value?.scrollTop||0),$=kt?k-as:0,W=!xe.value;as=k;let ie=os(),be=As({scrollTop:k,scrollHeight:o.value?.scrollHeight||0,clientHeight:o.value?.clientHeight||0,threshold:je});Ce.value=Bp({following:W,atBottom:ie,resumeBoundaryReached:be,direction:$}),xe.value=!Ce.value,a.value?.setBottomFollowEnabled?.(Ce.value),Ce.value&&Et(),kt&&Es(),o.value&&wn(o.value.scrollTop||0,o.value.clientHeight||0)},Et=()=>{s.currentView==="yeaft"&&s.pruneYeaftMessageWindow()},$s=()=>{o.value&&(o.value.scrollTop=o.value.scrollHeight,In(),Et())},ko=()=>{In(),Vue.nextTick($s)},Tr=()=>{!xe.value&&Ce.value&&(Et(),Vue.nextTick($s))},Mr=k=>{if(!k)return"";if(Array.isArray(k.items))return k.items.map(Mr).join(",");let $=k.message||{};return[k.type||"",k.id||"",k.atMessageId||"",k.turnId||"",k.messageId||"",k.speakerVpId||"",$.id||"",$.content?String($.content).length:0,k.textContent?String(k.textContent).length:0,k.isStreaming||$.isStreaming?"streaming":"done"].join(":")},So=Vue.computed(()=>{let k=D.value||[];return[s.activeConversationId||"",E.value||"",Mr(k[k.length-1])].join("|")});Vue.watch(()=>[s.currentConversation,R.value.length,n.token],()=>{let k=n.token||"";k!==se&&(se=k,me()),T()},{immediate:!0}),Vue.watch(So,Tr),Vue.watch(bn,k=>{k&&Tr()}),Vue.watch(()=>[s.activeConversationId,E.value],()=>{for(let k of Object.keys(l))delete l[k];for(let k of Object.keys(c))delete c[k];for(let k of Object.keys(d))delete d[k];In(),Vue.nextTick($s)});let ls=Vue.ref(null),Pr=0;return t({revealMessage:async k=>k?(st(),await rf({blocks:D.value,target:k,collapseStates:d,nextTick:Vue.nextTick,scrollToBlock:(W,ie)=>(st(),a.value?.scrollToKey?.(W,ie)),findRow:W=>{let ie=o.value?.querySelectorAll?.("[data-msg-id]")||[];return Array.from(ie).find(be=>be?.dataset?.msgId===W)||null},anchorRow:(W,ie,be,ce)=>a.value?.anchorTarget?.(W,be,ce),flashRow:W=>{let ie=++Pr;ls.value=W,setTimeout(()=>{ie===Pr&&(ls.value=null)},1800)}})):!1}),Vue.onMounted(()=>{$s(),o.value&&(o.value.addEventListener("wheel",Ds,{passive:!0}),o.value.addEventListener("touchmove",Ds,{passive:!0}),o.value.addEventListener("pointerdown",Ar,{passive:!0}),o.value.addEventListener("scroll",jt)),window.addEventListener("pointerup",Ls,{passive:!0}),window.addEventListener("pointercancel",Ls,{passive:!0}),window.addEventListener("keydown",xr)}),Vue.onUnmounted(()=>{o.value&&(o.value.removeEventListener("wheel",Ds),o.value.removeEventListener("touchmove",Ds),o.value.removeEventListener("pointerdown",Ar),o.value.removeEventListener("scroll",jt)),window.removeEventListener("pointerup",Ls),window.removeEventListener("pointercancel",Ls),window.removeEventListener("keydown",xr),Cr(),fe&&(clearInterval(fe),fe=null),Oe&&(clearTimeout(Oe),Oe=null),we&&(cancelAnimationFrame(we),we=null),dt&&(cancelAnimationFrame(dt),dt=null)}),{store:s,containerRef:o,virtualTranscriptRef:a,flashMsgId:ls,hasStreamingMessage:bt,nowMs:Xe,showTypingDots:_t,showInitialMessagesLoading:rs,showYeaftOlderHistoryLoading:gn,showSessionLoadingOverlay:Rt,initialMessagesLoadingText:Wt,previewShowTypingDots:bn,isPreviewMode:vn,waitingStatus:fo,animationType:Te,catSpeed:go,catStyle:mo,dogPhase:We,spikeTransform:ro,teddyTransform:io,leashPathL:oo,leashPathR:ao,leashOpacityL:lo,leashOpacityR:co,questionLX:uo,questionRX:po,refreshSession:is,onlineAgents:R,welcomeInstallCommand:ae,welcomeLlmCommand:ve,welcomeServiceCommand:ge,welcomeSetupLoading:_,welcomeSetupError:j,copyWelcomeCommand:K,turnGroups:O,messageBlocks:D,virtualTranscriptIdentity:V,estimateMessageBlockHeight:m,visibleItemsForBlock:b,collapsedResponsePreviewLines:I,collapsedResponsePreviewSpeaker:y,responseToggleBelongsToItem:w,showBlockResponseToggle:v,toggleMessageTurnResponse:h,responseCollapseLabel:M,turnUiKey:u,assistantTurnActionsExpandedFor:f,setAssistantTurnActionsExpanded:p,toolExpandStates:c,setToolExpanded:g,cardsForRow:ye,orphanCards:Y,subAgentCardsForRow:ue,orphanSubAgentCards:le,useImStyleForUser:L,onClickLoadMore:Ir,onVirtualTranscriptScrollState:vo,isAtBottom:Ce,scrollToLatest:ko}}}});function Pi(...e){let t=[];for(let s of e)if(Array.isArray(s))for(let n of s)typeof n!="string"||!n||t.includes(n)||t.push(n);return t}function cf(e,t,s){let n=t?e?.slashCommandsMap?.[t]:null;return e?.currentView==="yeaft"?Pi(n):Pi(n,s?e?.slashCommandsMap?.[`agent:${s}`]:null,e?.slashCommandsMap?.__preload__)}function Fy(e,t={},s=new Set){if(Oy.has(e)||Object.prototype.hasOwnProperty.call(Mi,e))return"builtin";let n=e.startsWith("/")?e.slice(1):e;return n.startsWith("skill:")||n.startsWith("yeaft-skills:")||s.has(n)&&Object.prototype.hasOwnProperty.call(t||{},n)?"skill":"project"}function df(e,t={}){if(Ti[e])return Ti[e];if(Mi[e])return Mi[e];let s=e.startsWith("/")?e.slice(1):e;return t[s]?t[s]:Ny(s)}function Ny(e){return(e.includes(":")?e.split(":").pop():e).replace(/-/g," ").replace(/^\w/,s=>s.toUpperCase())}function uf(e,t={},s=[]){if(e.length===0)return[];let n=new Set(s.filter(o=>typeof o=="string").map(o=>o.startsWith("/")?o.slice(1):o)),r={};e.forEach((o,a)=>{let l=Fy(o.cmd,o.descriptions||o.dynamicDescriptions||t,n);r[l]||(r[l]=[]),r[l].push({...o,flatIndex:a})});let i=Object.keys(r).sort((o,a)=>(of[o]??99)-(of[a]??99));return i.map((o,a)=>({label:qy[o]||o,items:r[o],isLast:a===i.length-1}))}var Ti,Oy,af,Mi,lf,qy,of,pf=F(()=>{Ti={"/compact":"Compact context","/context":"Show context usage","/cost":"Show token costs","/init":"Reinitialize session","/doctor":"Check health status","/memory":"View/edit memory","/model":"View/switch model","/review":"Code review","/mcp":"MCP server status","/skills":"List available skills","/btw":"Side question (no history)","/insights":"Session insights","/pr-comments":"PR comment review","/release-notes":"Generate release notes","/security-review":"Security review"},Oy=new Set(Object.keys(Ti)),af=Object.keys(Ti),Mi={"/low":"Use low reasoning effort for this turn","/medium":"Use medium reasoning effort for this turn","/high":"Use high reasoning effort for this turn","/xhigh":"Use extra-high reasoning effort for this turn","/max":"Use maximum reasoning effort for this turn"},lf=Object.keys(Mi);qy={skill:"Skills",builtin:"Built-in",project:"Commands"},of={skill:0,project:1,builtin:2}});function Uy(e){return!(!e||typeof e!="string"||e.length<1||e.length>40||e.startsWith("_")||Wy.test(e)||By.has(e.toLowerCase()))}function Ri(e){if(!e||typeof e!="string")return{text:e||"",mentions:[]};let t=new Set;ff.lastIndex=0;let s;for(;(s=ff.exec(e))!==null;){let n=s[2];if(Uy(n)&&!t.has(n)&&(t.add(n),t.size>=jy))break}return{text:e,mentions:Array.from(t)}}var By,ff,Wy,jy,al=F(()=>{By=new Set(["all","user","system","everyone"]),ff=/(^|[\s\p{P}])@([A-Za-z0-9_-]{1,40})(?=$|[\s\p{P}])/gu,Wy=/^[0-9]+$/,jy=32});function gf(e){let t=typeof e?.vpId=="string"?e.vpId:"";return ll.has(t)?ll.get(t):e?.isStock===!0?"other":"custom"}function xs(e){let t=new Map(_i.map(s=>[s.id,[]]));for(let s of Array.isArray(e)?e:[])!s||typeof s.vpId!="string"||!s.vpId||t.get(gf(s)).push(s);return _i.map(s=>({id:s.id,labelKey:s.labelKey,vps:t.get(s.id)})).filter(s=>s.vps.length>0)}function ur(e){return xs(e).flatMap(t=>t.vps)}function mf(e){let t=new Map(_i.map(r=>[r.id,r])),s=new Map,n=[];for(let r of Array.isArray(e)?e:[]){if(!r||typeof r.vpId!="string"||!r.vpId)continue;let i=gf(r),o=n[n.length-1];if(o&&o.id===i){o.vps.push(r);continue}let a=(s.get(i)||0)+1;s.set(i,a),n.push({id:i,key:`${i}-${a}`,labelKey:t.get(i).labelKey,vps:[r]})}return n}var Ky,_i,ll,pr=F(()=>{Ky=[{id:"general",labelKey:"yeaft.vp.domain.general",vpIds:["omni"]},{id:"productDesign",labelKey:"yeaft.vp.domain.productDesign",vpIds:["steve","dieter","norman"]},{id:"softwareSystems",labelKey:"yeaft.vp.domain.softwareSystems",vpIds:["linus","martin","anders","ada","grace","ken","alan"]},{id:"securityReliability",labelKey:"yeaft.vp.domain.securityReliability",vpIds:["alice","margaret"]},{id:"scienceAnalysis",labelKey:"yeaft.vp.domain.scienceAnalysis",vpIds:["shannon","einstein"]},{id:"philosophyPsychology",labelKey:"yeaft.vp.domain.philosophyPsychology",vpIds:["kongzi","socrates","nietzsche","kahneman","jung"]},{id:"strategyHistory",labelKey:"yeaft.vp.domain.strategyHistory",vpIds:["sunzi","clausewitz","simaqian","harari"]},{id:"businessManagement",labelKey:"yeaft.vp.domain.businessManagement",vpIds:["buffett","munger","dalio","bezos","drucker"]},{id:"artsCulture",labelKey:"yeaft.vp.domain.artsCulture",vpIds:["luxun","sudongpo","borges","kubrick","miyazaki"]},{id:"other",labelKey:"yeaft.vp.domain.other",vpIds:[]},{id:"custom",labelKey:"yeaft.vp.domain.custom",vpIds:[]}],_i=Object.freeze(Ky.map(e=>Object.freeze({id:e.id,labelKey:e.labelKey,vpIds:Object.freeze([...e.vpIds])}))),ll=new Map;for(let e of _i)for(let t of e.vpIds)ll.set(t,e.id)});function cl(e,t){let s=Array.isArray(e)?e:[],n=typeof t=="string"?t.toLowerCase():"";if(!n){let c=s.filter(d=>d&&d.vpId&&d.vpId!=="user");return ur(c).slice(0,hf)}let r=[],i=[],o=[],a=new Set,l=(c,d)=>{a.has(c.vpId)||(a.add(c.vpId),d.push(c))};for(let c of s){if(!c||!c.vpId||c.vpId==="user")continue;if(String(c.vpId).toLowerCase().startsWith(n)){l(c,r);continue}let u=Array.isArray(c.aliases)?c.aliases:[],f=!1;for(let S of u){let w=String(S||"").toLowerCase();if(w&&w.startsWith(n)){f=!0;break}}if(f){l(c,i);continue}let p=String(c.displayName||"").toLowerCase(),g=String(c.displayNameZh||""),m=[c.description,c.descriptionZh,c.role,c.roleZh].map(S=>String(S||"").toLowerCase()),b=typeof t=="string"?t:"",I=p.includes(n)||b&&g.includes(b),y=n&&m.some(S=>S.includes(n));(I||y)&&l(c,o)}return[...ur(r),...ur(i),...ur(o)].slice(0,hf)}function dl(e="chat-input"){return`${e}-vp-mention-listbox`}function ul(e,t){let s=String(t||"").replace(/[^A-Za-z0-9_.:-]/g,"-");return`${e}-vp-mention-option-${s}`}function zy(e){let t=0;return mf(e).map(s=>({...s,items:s.vps.map(n=>({vp:n,flatIndex:t++}))}))}function vf(e,t){let s=Array.isArray(e)?e:[];if(!t)return s;let n=Array.isArray(t.roster)?t.roster:[];if(n.length===0)return[];let r=new Set(n);return s.filter(i=>i&&i.vpId&&r.has(i.vpId))}function yf(e,t){if(typeof e!="string"||!t)return e;let s=e.lastIndexOf("@");if(s<0)return e;let n=s+1;for(;n<e.length&&!/[\s]/.test(e[n]);)n++;return e.slice(0,s)+"@"+t+" "+e.slice(n)}var hf,bf,wf=F(()=>{pr();hf=12;bf={name:"VpMentionAutocomplete",emits:["select","hover-index"],props:{vps:{type:Array,default:()=>[]},query:{type:String,default:""},selectedIndex:{type:Number,default:0},inputId:{type:String,required:!0}},template:`
|
|
1676
|
+
`,emits:["new-conversation","resume-conversation","open-settings","quote-message","edit-message-as-new"],setup(e,{expose:t}){let s=Pinia.useChatStore(),n=De(),r=typeof window<"u"&&window.Pinia?.useVpStore?window.Pinia.useVpStore():null,i=Vue.inject("t",null),o=Vue.ref(null),a=Vue.ref(null),l=Vue.reactive({}),c=Vue.reactive({}),d=Vue.reactive({}),u=k=>String(k?.id||k?.turnId||k?.messageId||k?.atMessageId||k?.message?.id||"turn_unknown"),f=k=>{let $=u(k);return Object.prototype.hasOwnProperty.call(l,$)?!!l[$]:!1},p=(k,$)=>{l[u(k)]=!!$},g=({key:k,value:$}={})=>{k&&(c[k]=!!$)},m=k=>{let $=ef(k,es);return Number.isFinite($)?$:es(k)},b=k=>Ai(k),I=k=>{let $=Array.isArray(k?.collapsedResponsePreview)?k.collapsedResponsePreview:Jp(k);return Array.isArray($)?$:$?[String($)]:[]},y=k=>{let $=Array.isArray(k?.items)?k.items.find(te=>dr(te)):null,W=$?.speakerVpId||$?.vpId||$?.message?.speakerVpId||$?.message?.vpId||k?.vpId||"",ie=W&&r&&typeof r.vpLabel=="function"?r.vpLabel(W)||W:W||(typeof i=="function"?i("message.assistant"):"Assistant"),be=W&&r&&typeof r.vpTextColor=="function"?{color:r.vpTextColor(W)}:{},ce=$?.speakerTimestamp||$?.timestamp||$?.createdAt||$?.message?.timestamp||$?.message?.createdAt||0,Fe="",Ie="";if(ce)try{let te=new Date(ce);Number.isNaN(te.getTime())||(Fe=xt(ce),Ie=te.toLocaleString())}catch{}return{name:ie,style:be,timeText:Fe,fullTimeText:Ie}},S=k=>{let $=Array.isArray(k?.items)?k.items:[];for(let W=$.length-1;W>=0;W-=1)if(dr($[W]))return $[W];return null},w=(k,$)=>!k?.responseCollapsible||!$?!1:S(k)===$,v=k=>!!(k?.responseCollapsible&&!Ai(k).some($=>w(k,$))),h=k=>{let $=k?.responseCollapseKey;$&&(d[$]=!k.responseCollapsed)},M=k=>{let $=Number(k?.responseCount||0),W=k?.responseCollapsed?"message.showResponses":"message.hideResponses",ie=(typeof i=="function"?i(W):"")||(k?.responseCollapsed?"Show {count} response(s)":"Hide response(s)");return String(ie).replace("{count}",String($))},x=(()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}}),E=Vue.computed(()=>{if(s.currentView!=="yeaft")return null;let k=x();if(!k)return null;let $=s.yeaftActiveSessionFilter||null;return $&&typeof k.sessionById=="function"&&k.sessionById($,s.currentAgent||null)?$:k.activeSessionId&&typeof k.sessionById=="function"&&k.sessionById(k.activeSessionId,s.currentAgent||null)?k.activeSessionId:null}),V=Vue.computed(()=>{let k=s.currentView||"",$=s.currentAgent||"";if(k==="yeaft"){let W=s.yeaftActiveSessionFilter||E.value||"__all__";return[k,$,W].join("")}return[k,$,s.activeConversationId||""].join("")}),L=Vue.computed(()=>E.value!==null),R=Vue.computed(()=>s.agents.filter(k=>k.online)),P=Vue.ref(null),A=Vue.ref(null),_=Vue.ref(!1),j=Vue.ref(""),q=null,z=0,se=n.token||"",me=()=>{P.value=null,A.value=null,j.value="",q=null,z+=1},ae=fi(),ve=gi(),ge=Vue.computed(()=>mi({profile:P.value,agentSecret:A.value,serverWsUrl:rr(location)})),pe=()=>{let k={"Content-Type":"application/json"};return n.token&&(k.Authorization=`Bearer ${n.token}`),k},T=async()=>{if(R.value.length>0||s.currentConversation)return;if(A.value||q)return q;_.value=!0,j.value="";let k=++z;return q=(async()=>{let $=n.token||"",W=pe(),[ie,be]=await Promise.all([fetch("/api/user/profile",{headers:W}),fetch("/api/user/agent-secret",{headers:W})]),ce=ie.ok?await ie.json():null;if(k!==z||$!==(n.token||""))return;if(ce&&(P.value=ce),!be.ok){let te="";try{te=(await be.json())?.error||""}catch{}throw new Error(te||"Failed to load Agent secret")}let Fe=await be.json();if(k!==z||$!==(n.token||""))return;let Ie=Fe?.agentSecret||Fe?.agent_secret||null;A.value=Ie&&String(Ie).trim()?String(Ie):null})().catch($=>{k===z&&(j.value=$?.message||"Failed to load Agent secret")}).finally(()=>{k===z&&(_.value=!1,q=null)}),q},K=async k=>{if(k)try{await navigator.clipboard.writeText(k)}catch{}},re=new WeakMap,he=0,Pe=(k,$)=>{let W=k?.message&&typeof k.message=="object"?k.message:Array.isArray(k?.messages)&&k.messages[0]&&typeof k.messages[0]=="object"?k.messages[0]:$&&typeof $=="object"?$:k&&typeof k=="object"?k:null;if(!W)return`legacy_render_${++he}`;let ie=re.get(W);return ie||(ie=`legacy_render_${++he}`,re.set(W,ie)),ie},U=k=>{let $=k?.message||k||null;return k?.entryId||k?.uiKey||k?.stableKey||$?.entryId||$?.uiKey||$?.stableKey||k?.atMessageId||k?.messageId||$?.messageId||k?.id||$?.id||Pe(k,$)},B=k=>encodeURIComponent(String(k||"legacy")),N=k=>{let $=k?.message||null,W=U(k),ie=k?.id||k?.atMessageId||$?.id||$?.messageId||W,be=k?.speakerVpId||k?.vpId||$?.speakerVpId||$?.vpId||"";return{id:`message_${B(W)}`,uiKey:W,vpId:be,messageId:ie}},O=Vue.computed(()=>{let k=s.currentView==="yeaft"?Gp(s.messages):s.messages,$=[],W=null,ie=()=>{if(W){W.isActive=!!(W.turnId&&Object.values(s.activeVpTurns||{}).some(ut=>((ut?.turnId||null)===W.turnId||!ut?.turnId&&s.activeVpTurns?.[W.turnId]===ut)&&(!s.currentAgent||!ut?.agentId||ut.agentId===s.currentAgent))),Zr(W);let Ie=!!(W.textContent||W.todoMsg||W.askMsg||W.imageMsgs.length>0),te=W.toolMsgs.length>0||W.toolSummaryCount>0;(Ie||te)&&(W.showSpeakerHeader=!!W.speakerVpId,$.push(W)),W=null}},be=Ie=>{if(W){if(!W.speakerVpId){let te=Ie.speakerVpId||Ie.vpId;te&&(W.speakerVpId=te,W.speakerTimestamp=typeof Ie.timestamp=="number"&&Ie.timestamp>0?Ie.timestamp:typeof Ie.createdAt=="number"?Ie.createdAt:0,typeof Ie.lastStateChangeCause=="string"&&!W.speakerStateCause&&(W.speakerStateCause=Ie.lastStateChangeCause))}!W.turnId&&Ie.turnId&&(W.turnId=Ie.turnId)}},ce=(Ie=null)=>{let te=U(Ie);W={type:"assistant-turn",id:`response_${B(te)}`,uiKey:te,...Ie?.entryId?{entryId:Ie.entryId}:{},textContent:"",textSegments:[],isStreaming:!1,isActive:!1,isHistory:!1,todoMsg:null,toolMsgs:[],toolSummaryCount:0,imageMsgs:[],askMsg:null,messages:[],atMessageId:null,speakerVpId:null,speakerTimestamp:0,speakerStateCause:"",showSpeakerHeader:!1,turnId:null}},Fe=Ie=>{Qp(W,Ie)&&ie()};for(let Ie=0;Ie<k.length;Ie++){let te=k[Ie];if(te.type==="user"){if(!te.content||!te.content.trim())continue;ie(),$.push({type:"user",id:U(te),message:te});continue}if(te.type==="system"||te.type==="error"){ie(),$.push({type:te.type,id:U(te),message:te});continue}if(!(te.type==="tool-result"||te.type==="tool_result")){if(te.type==="tool-summary"){Fe(te),W||ce(te),be(te),te.isHistory&&(W.isHistory=!0),W.toolSummaryCount+=Number(te.count||te.omittedCount||0)||0,W.messages.push(te);continue}if(te.type==="assistant"){Fe(te),W||ce(te),Xr(W,te),te.isStreaming&&(W.isStreaming=!0),te.isHistory&&(W.isHistory=!0),te.id&&/^m\d+$/.test(te.id)&&(W.atMessageId=te.id),be(te),W.messages.push(te);continue}if(te.type==="tool-use"){Fe(te),W||ce(te),be(te);let ut=k[Ie+1],Rr=ut&&(ut.type==="tool-result"||ut.type==="tool_result"),An={...te,hasResult:Rr||te.hasResult||!1,toolResult:te.toolResult||null};te.isHistory&&(W.isHistory=!0),te.toolName==="TodoWrite"?W.todoMsg=An:te.toolName==="AskUserQuestion"?W.askMsg=An:W.toolMsgs.push(An),W.messages.push(te);continue}if(te.type==="chat-image"){Fe(te),W||ce(te),be(te),te.isHistory&&(W.isHistory=!0),W.imageMsgs.push(te),W.messages.push(te);continue}ie(),$.push({type:te.type||"unknown",id:U(te),message:te})}}return ie(),$}),D=Vue.computed(()=>{let k=[],$=null,W=()=>{$&&k.push($),$=null};return O.value.forEach(ie=>{if(!ie||ie.type==="system"||ie.type==="error"){W(),k.push(ie);return}let be=N(ie);if(ie.type==="user"||!$){W(),$={type:"message-block",id:`block_${B(be.uiKey)}`,uiKey:be.uiKey,vpId:be.vpId,messageId:be.messageId,items:[ie]};return}$.items.push(ie),!$.vpId&&be.vpId&&($.vpId=be.vpId)}),W(),k}),Z=Vue.computed(()=>{let k=s.yeaftReflectionCards||{},$=s.yeaftConversationId,W={__orphans:[]},ie=Object.values(k).filter(ce=>ce&&ce.conversationId===$).sort((ce,Fe)=>(ce.anchorOrder||0)-(Fe.anchorOrder||0)||(ce.updatedAt||0)-(Fe.updatedAt||0)),be=new Set;for(let ce of s.messages||[])ce&&ce.id&&be.add(ce.id);for(let ce of ie)ce.anchorMsgId&&be.has(ce.anchorMsgId)?(W[ce.anchorMsgId]||(W[ce.anchorMsgId]=[]),W[ce.anchorMsgId].push(ce)):W.__orphans.push(ce);return W}),ne=k=>k?k.type==="assistant-turn"?k.atMessageId||null:k.message&&k.message.id||null:null,ye=k=>{let $=ne(k);return $?(Z.value||{})[$]||[]:[]},Y=Vue.computed(()=>(Z.value||{}).__orphans||[]),ee=Vue.computed(()=>{let k=s.yeaftSubAgentCards||{},$=s.yeaftConversationId,W={__orphans:[]},ie=Object.values(k).filter(ce=>ce&&ce.conversationId===$).sort((ce,Fe)=>(ce.anchorOrder||0)-(Fe.anchorOrder||0)||(ce.updatedAt||0)-(Fe.updatedAt||0)),be=new Set;for(let ce of s.messages||[])ce&&ce.id&&be.add(ce.id);for(let ce of ie)ce.anchorMsgId&&be.has(ce.anchorMsgId)?(W[ce.anchorMsgId]||(W[ce.anchorMsgId]=[]),W[ce.anchorMsgId].push(ce)):W.__orphans.push(ce);return W}),ue=k=>{let $=ne(k);return $?(ee.value||{})[$]||[]:[]},le=Vue.computed(()=>(ee.value||{}).__orphans||[]),Ce=Vue.ref(!0),xe=Vue.ref(!1),$e=Nt.bottomThreshold,je=Nt.resumeBottomThreshold,yt=!0,bt=Vue.computed(()=>s.messages.some(k=>k.isStreaming)),rs=Vue.computed(()=>!s.activeConversationId||D.value.length>0?!1:s.currentView==="yeaft"?!!s.yeaftInitialHistoryLoading:!!s.sessionLoading),gn=Vue.computed(()=>s.currentView==="yeaft"&&!!s.yeaftLoadingMoreHistory&&s.activeYeaftHistoryState?.mode==="older"),Wt=Vue.computed(()=>s.currentView==="yeaft"?"":s.sessionLoadingText||""),Rt=Vue.computed(()=>!!s.sessionLoading&&!rs.value),_t=Vue.computed(()=>s.isProcessing&&!bt.value),Xe=Vue.ref(Date.now()),wt=null,mn=()=>{wt||(wt=setInterval(()=>{Xe.value=Date.now()},1e3))},H=()=>{wt&&(clearInterval(wt),wt=null)};Vue.watch(bt,k=>{k?(Xe.value=Date.now(),mn()):H()},{immediate:!0}),Vue.onBeforeUnmount(()=>H());let G=Vue.ref(0),de=Vue.ref(Date.now()),fe=null,we=null,Te=Vue.ref("cat"),Ze=new URLSearchParams(window.location.search).get("preview"),Ue=Vue.ref(0),Je=Vue.ref(1),Be=Vue.ref(5),qe=Vue.ref(95),We=Vue.ref("bark-both"),Ke=Vue.ref(1),ze=Vue.ref(-1),dt=null;function Rs(){if(!G.value)return;de.value=Date.now();let k=(de.value-G.value)%19e3;if(k<4e3)Ue.value=0,Je.value=1;else if(k<11500){let $=k-4e3,W;$<2500?W=$/2500*16:$<5e3?W=16+($-2500)/2500*29:W=45+($-5e3)/2500*55,Ue.value=W,Je.value=1}else k<14e3?(Ue.value=(1-(k-11500)/2500)*100,Je.value=-1):(Ue.value=0,Je.value=1);we=requestAnimationFrame(Rs)}function hn(){if(!G.value||Te.value!=="dog")return;de.value=Date.now();let k=(de.value-G.value)%18e3;if(k<2e3)Be.value=5,qe.value=95,We.value="bark-both",Ke.value=1,ze.value=-1;else if(k<5e3){let $=(k-2e3)/3e3;Be.value=5+$*25,qe.value=95,We.value="left-approach",Ke.value=1,ze.value=-1}else if(k<8e3){let $=(k-5e3)/3e3;Be.value=30,qe.value=95-$*25,We.value="right-approach",Ke.value=1,ze.value=-1}else if(k<1e4){let $=(k-8e3)/2e3;Be.value=30+$*13,qe.value=70-$*13,We.value="both-approach",Ke.value=1,ze.value=-1}else if(k<11e3)Be.value=43,qe.value=57,We.value="snap",Ke.value=1,ze.value=-1;else if(k<12500)Be.value=43,qe.value=57,We.value="stunned",Ke.value=1,ze.value=-1;else if(k<15e3){let $=(k-12500)/2500;Be.value=43-$*38,qe.value=57+$*38,We.value="retreat",Ke.value=-1,ze.value=1}else k<17e3?(Be.value=5,qe.value=95,We.value="rehang",Ke.value=-1,ze.value=1):(Be.value=5,qe.value=95,We.value="reset",Ke.value=1,ze.value=-1);dt=requestAnimationFrame(hn)}let ro=Vue.computed(()=>{let k=Be.value*1.2;return Ke.value<0?`translate(${k+13.5}, 0) scale(-1, 1)`:`translate(${k-13.5}, 0)`}),io=Vue.computed(()=>{let k=qe.value*1.2;return ze.value>0?`translate(${k-10.5}, 2)`:`translate(${k+10.5}, 2) scale(-1, 1)`}),br=Vue.computed(()=>{let k=We.value;return k==="bark-both"||k==="left-approach"||k==="right-approach"||k==="both-approach"||k==="reset"}),oo=Vue.computed(()=>{let k=Be.value*1.2,$=10;if(br.value){let be=Math.max(0,(k-3)*.12);return`M3,18 Q${(3+k)/2},${18+be} ${k},${$}`}if(We.value==="rehang")return`M${k},${$} Q${k-3},20 3,18`;let W=Ke.value<0?1:-1,ie=k+W*8;return`M${k},${$} Q${k},18 ${ie},22`}),ao=Vue.computed(()=>{let k=qe.value*1.2,$=10;if(br.value){let be=Math.max(0,(118-k)*.12);return`M118,18 Q${(118+k)/2},${18+be} ${k},${$}`}if(We.value==="rehang")return`M${k},${$} Q${k+3},20 118,18`;let W=ze.value>0?-1:1,ie=k+W*8;return`M${k},${$} Q${k},18 ${ie},22`}),lo=Vue.computed(()=>We.value==="snap"?.2:.4),co=Vue.computed(()=>We.value==="snap"?.2:.4),uo=Vue.computed(()=>Be.value*1.2),po=Vue.computed(()=>qe.value*1.2),vn=Ze==="cat"||Ze==="dog"||Ze==="animation",wr=600,yn=Vue.ref(!1),Oe=null,bn=Vue.computed(()=>vn?!0:yn.value);Vue.watch(_t,k=>{if(k)Oe&&(clearTimeout(Oe),Oe=null),yn.value=!0,G.value=Date.now(),de.value=Date.now(),Te.value="cat",Ue.value=0,Je.value=1,Be.value=5,qe.value=95,We.value="bark-both",Ke.value=1,ze.value=-1,Te.value==="cat"?we=requestAnimationFrame(Rs):dt=requestAnimationFrame(hn);else{let $=G.value?Date.now()-G.value:wr,W=Math.max(0,wr-$),ie=()=>{Oe=null,yn.value=!1,G.value=0,Ue.value=0,Je.value=1,we&&(cancelAnimationFrame(we),we=null),dt&&(cancelAnimationFrame(dt),dt=null)};W===0?ie():(Oe&&clearTimeout(Oe),Oe=setTimeout(ie,W))}},{immediate:!0}),vn&&(G.value=Date.now(),de.value=Date.now(),Ze==="dog"?Te.value="dog":Te.value="cat",Te.value==="cat"?we=requestAnimationFrame(Rs):(Be.value=5,qe.value=95,We.value="bark-both",Ke.value=1,ze.value=-1,dt=requestAnimationFrame(hn)));let fo=Vue.computed(()=>{if(!s.isProcessing)return null;if(s.connectionState!=="connected")return"disconnected";let k=s.currentConversation;if(s.compactStatus?.conversationId===k&&s.compactStatus?.status==="compacting")return"compacting";let $=s.sessionHealth?.[k];return $?$.status:G.value&&de.value-G.value>8e3?"thinking":null}),go=Vue.computed(()=>{if(!G.value)return"speed-napping";let k=(de.value-G.value)%19e3;return k>=16e3?"speed-petted":k>=14e3?"speed-tired":k>=11500?"speed-crazy":k>=9e3?"speed-turbo":k>=6500?"speed-fast":k>=4e3?"speed-normal":"speed-napping"}),mo=Vue.computed(()=>{let k=Ue.value,$=Je.value,ie={left:`calc(40px + (100% - 80px) * ${k/100})`};return $<0&&(ie.transform="scaleX(-1)"),ie});function is(){let k=s.currentConversation;if(!k)return;let $=s.conversations.find(W=>W.id===k);s.sendWsMessage({type:"refresh_conversation",conversationId:k,agentId:$?.agentId})}let os=()=>{if(!o.value)return!0;let{scrollTop:k,scrollHeight:$,clientHeight:W}=o.value;return As({scrollTop:k,scrollHeight:$,clientHeight:W,threshold:$e})},wn=(k,$=0,{allowContinuation:W=!1}={})=>{if(k>Np($)){yt=!0;return}W&&(yt=!0),!(!yt||!_s())&&(yt=!1,Ir())},kr=k=>{if(!k)return"";let W=(Array.isArray(k.items)?k.items:[])[0]||null;return[k.type||"",k.messageId||"",k.turnId||"",k.vpId||"",W?.id||"",W?.turnId||"",W?.messageId||""].join(":")},kn=()=>{let k=D.value||[];return{blockCount:k.length,firstBlockIdentity:kr(k[0])}},ho=(k,$)=>!k||!$?!1:$.blockCount>k.blockCount||$.firstBlockIdentity!==k.firstBlockIdentity,Sn=k=>{Vue.nextTick(()=>{if(!o.value)return;let $=kn();ho(k,$)&&wn(o.value.scrollTop||0,o.value.clientHeight||0,{allowContinuation:!0})})},Sr=({scrollTop:k,scrollHeight:$,clientHeight:W})=>{let ie=As({scrollTop:k,scrollHeight:$,clientHeight:W,threshold:$e});return Ce.value=ie,xe.value=!ie,ie},In=()=>{xe.value=!1,Ce.value=!0,a.value?.setBottomFollowEnabled?.(!0)},st=()=>{xe.value=!0,Ce.value=!1,a.value?.setBottomFollowEnabled?.(!1),a.value?.cancelPendingBottomFollow?.()},vo=({scrollTop:k,scrollHeight:$,clientHeight:W})=>{let ie=As({scrollTop:k||0,scrollHeight:$||0,clientHeight:W||0,threshold:$e});Ce.value=Bp({following:!xe.value,atBottom:ie}),xe.value=!Ce.value,a.value?.setBottomFollowEnabled?.(Ce.value),kt||(as=Number(k||0)),wn(k||0,W||0)},yo=(k,$)=>{let W=kn();if(!o.value){k(),Sn(W);return}let ie=o.value.scrollHeight,be=o.value.scrollTop,ce=!1,Fe=null,Ie=()=>{ce||(ce=!0,Fe&&Fe(),Vue.nextTick(()=>{if(!o.value)return;let te=o.value.scrollHeight;o.value.scrollTop=te-ie+be,Sn(W)}))};$&&(Fe=Vue.watch($,te=>{te||Ie()})),k(),Vue.nextTick(()=>{(!$||!$())&&Ie()})},bo=()=>{if(s.hasHiddenYeaftMessages){s.expandYeaftMessageWindow();return}s.loadMoreYeaftHistory()},_s=()=>s.currentView==="yeaft"?s.hasHiddenYeaftMessages||s.yeaftHasMoreHistory&&!s.yeaftLoadingMoreHistory&&s.yeaftOldestLoadedSeq!=null:!!s.currentConversation&&s.hasMoreMessages&&!s.loadingMoreMessages,Ir=()=>{if(!_s())return;let k=s.currentView==="yeaft";yo(k?bo:()=>s.loadMoreMessages(),k?()=>s.yeaftLoadingMoreHistory:()=>s.loadingMoreMessages)},kt=!1,Cn=!1,nt=null,as=0,wo=250,Cr=()=>{kt=!1,nt&&(clearTimeout(nt),nt=null)},Es=()=>{Cn||(nt&&clearTimeout(nt),nt=setTimeout(Cr,wo))},Ds=k=>{kt=!0,a.value?.clearTargetAnchor?.(),as=Number(o.value?.scrollTop||0),Number(k?.deltaY)<0&&st(),Es()},Ar=k=>{Wp(k,o.value)&&(Cn=!0,kt=!0,a.value?.clearTargetAnchor?.(),as=Number(o.value?.scrollTop||0),nt&&(clearTimeout(nt),nt=null))},Ls=()=>{Cn=!1,Es()},xr=k=>{jp(k,o.value)&&((k.key==="ArrowUp"||k.key==="PageUp"||k.key==="Home")&&st(),kt=!0,a.value?.clearTargetAnchor?.(),Es())},jt=()=>{let k=Number(o.value?.scrollTop||0),$=kt?k-as:0,W=!xe.value;as=k;let ie=os(),be=As({scrollTop:k,scrollHeight:o.value?.scrollHeight||0,clientHeight:o.value?.clientHeight||0,threshold:je});Ce.value=qp({following:W,atBottom:ie,resumeBoundaryReached:be,direction:$}),xe.value=!Ce.value,a.value?.setBottomFollowEnabled?.(Ce.value),Ce.value&&Et(),kt&&Es(),o.value&&wn(o.value.scrollTop||0,o.value.clientHeight||0)},Et=()=>{s.currentView==="yeaft"&&s.pruneYeaftMessageWindow()},$s=()=>{o.value&&(o.value.scrollTop=o.value.scrollHeight,In(),Et())},ko=()=>{In(),Vue.nextTick($s)},Tr=()=>{!xe.value&&Ce.value&&(Et(),Vue.nextTick($s))},Mr=k=>{if(!k)return"";if(Array.isArray(k.items))return k.items.map(Mr).join(",");let $=k.message||{};return[k.type||"",k.id||"",k.atMessageId||"",k.turnId||"",k.messageId||"",k.speakerVpId||"",$.id||"",$.content?String($.content).length:0,k.textContent?String(k.textContent).length:0,k.isStreaming||$.isStreaming?"streaming":"done"].join(":")},So=Vue.computed(()=>{let k=D.value||[];return[s.activeConversationId||"",E.value||"",Mr(k[k.length-1])].join("|")});Vue.watch(()=>[s.currentConversation,R.value.length,n.token],()=>{let k=n.token||"";k!==se&&(se=k,me()),T()},{immediate:!0}),Vue.watch(So,Tr),Vue.watch(bn,k=>{k&&Tr()}),Vue.watch(()=>[s.activeConversationId,E.value],()=>{for(let k of Object.keys(l))delete l[k];for(let k of Object.keys(c))delete c[k];for(let k of Object.keys(d))delete d[k];In(),Vue.nextTick($s)});let ls=Vue.ref(null),Pr=0;return t({revealMessage:async k=>k?(st(),await rf({blocks:D.value,target:k,collapseStates:d,nextTick:Vue.nextTick,scrollToBlock:(W,ie)=>(st(),a.value?.scrollToKey?.(W,ie)),findRow:W=>{let ie=o.value?.querySelectorAll?.("[data-msg-id]")||[];return Array.from(ie).find(be=>be?.dataset?.msgId===W)||null},anchorRow:(W,ie,be,ce)=>a.value?.anchorTarget?.(W,be,ce),flashRow:W=>{let ie=++Pr;ls.value=W,setTimeout(()=>{ie===Pr&&(ls.value=null)},1800)}})):!1}),Vue.onMounted(()=>{$s(),o.value&&(o.value.addEventListener("wheel",Ds,{passive:!0}),o.value.addEventListener("touchmove",Ds,{passive:!0}),o.value.addEventListener("pointerdown",Ar,{passive:!0}),o.value.addEventListener("scroll",jt)),window.addEventListener("pointerup",Ls,{passive:!0}),window.addEventListener("pointercancel",Ls,{passive:!0}),window.addEventListener("keydown",xr)}),Vue.onUnmounted(()=>{o.value&&(o.value.removeEventListener("wheel",Ds),o.value.removeEventListener("touchmove",Ds),o.value.removeEventListener("pointerdown",Ar),o.value.removeEventListener("scroll",jt)),window.removeEventListener("pointerup",Ls),window.removeEventListener("pointercancel",Ls),window.removeEventListener("keydown",xr),Cr(),fe&&(clearInterval(fe),fe=null),Oe&&(clearTimeout(Oe),Oe=null),we&&(cancelAnimationFrame(we),we=null),dt&&(cancelAnimationFrame(dt),dt=null)}),{store:s,containerRef:o,virtualTranscriptRef:a,flashMsgId:ls,hasStreamingMessage:bt,nowMs:Xe,showTypingDots:_t,showInitialMessagesLoading:rs,showYeaftOlderHistoryLoading:gn,showSessionLoadingOverlay:Rt,initialMessagesLoadingText:Wt,previewShowTypingDots:bn,isPreviewMode:vn,waitingStatus:fo,animationType:Te,catSpeed:go,catStyle:mo,dogPhase:We,spikeTransform:ro,teddyTransform:io,leashPathL:oo,leashPathR:ao,leashOpacityL:lo,leashOpacityR:co,questionLX:uo,questionRX:po,refreshSession:is,onlineAgents:R,welcomeInstallCommand:ae,welcomeLlmCommand:ve,welcomeServiceCommand:ge,welcomeSetupLoading:_,welcomeSetupError:j,copyWelcomeCommand:K,turnGroups:O,messageBlocks:D,virtualTranscriptIdentity:V,estimateMessageBlockHeight:m,visibleItemsForBlock:b,collapsedResponsePreviewLines:I,collapsedResponsePreviewSpeaker:y,responseToggleBelongsToItem:w,showBlockResponseToggle:v,toggleMessageTurnResponse:h,responseCollapseLabel:M,turnUiKey:u,assistantTurnActionsExpandedFor:f,setAssistantTurnActionsExpanded:p,toolExpandStates:c,setToolExpanded:g,cardsForRow:ye,orphanCards:Y,subAgentCardsForRow:ue,orphanSubAgentCards:le,useImStyleForUser:L,onClickLoadMore:Ir,onVirtualTranscriptScrollState:vo,isAtBottom:Ce,scrollToLatest:ko}}}});function Pi(...e){let t=[];for(let s of e)if(Array.isArray(s))for(let n of s)typeof n!="string"||!n||t.includes(n)||t.push(n);return t}function cf(e,t,s){let n=t?e?.slashCommandsMap?.[t]:null;return e?.currentView==="yeaft"?Pi(n):Pi(n,s?e?.slashCommandsMap?.[`agent:${s}`]:null,e?.slashCommandsMap?.__preload__)}function Fy(e,t={},s=new Set){if(Oy.has(e)||Object.prototype.hasOwnProperty.call(Mi,e))return"builtin";let n=e.startsWith("/")?e.slice(1):e;return n.startsWith("skill:")||n.startsWith("yeaft-skills:")||s.has(n)&&Object.prototype.hasOwnProperty.call(t||{},n)?"skill":"project"}function df(e,t={}){if(Ti[e])return Ti[e];if(Mi[e])return Mi[e];let s=e.startsWith("/")?e.slice(1):e;return t[s]?t[s]:Ny(s)}function Ny(e){return(e.includes(":")?e.split(":").pop():e).replace(/-/g," ").replace(/^\w/,s=>s.toUpperCase())}function uf(e,t={},s=[]){if(e.length===0)return[];let n=new Set(s.filter(o=>typeof o=="string").map(o=>o.startsWith("/")?o.slice(1):o)),r={};e.forEach((o,a)=>{let l=Fy(o.cmd,o.descriptions||o.dynamicDescriptions||t,n);r[l]||(r[l]=[]),r[l].push({...o,flatIndex:a})});let i=Object.keys(r).sort((o,a)=>(of[o]??99)-(of[a]??99));return i.map((o,a)=>({label:By[o]||o,items:r[o],isLast:a===i.length-1}))}var Ti,Oy,af,Mi,lf,By,of,pf=F(()=>{Ti={"/compact":"Compact context","/context":"Show context usage","/cost":"Show token costs","/init":"Reinitialize session","/doctor":"Check health status","/memory":"View/edit memory","/model":"View/switch model","/review":"Code review","/mcp":"MCP server status","/skills":"List available skills","/btw":"Side question (no history)","/insights":"Session insights","/pr-comments":"PR comment review","/release-notes":"Generate release notes","/security-review":"Security review"},Oy=new Set(Object.keys(Ti)),af=Object.keys(Ti),Mi={"/low":"Use low reasoning effort for this turn","/medium":"Use medium reasoning effort for this turn","/high":"Use high reasoning effort for this turn","/xhigh":"Use extra-high reasoning effort for this turn","/max":"Use maximum reasoning effort for this turn"},lf=Object.keys(Mi);By={skill:"Skills",builtin:"Built-in",project:"Commands"},of={skill:0,project:1,builtin:2}});function Uy(e){return!(!e||typeof e!="string"||e.length<1||e.length>40||e.startsWith("_")||Wy.test(e)||qy.has(e.toLowerCase()))}function Ri(e){if(!e||typeof e!="string")return{text:e||"",mentions:[]};let t=new Set;ff.lastIndex=0;let s;for(;(s=ff.exec(e))!==null;){let n=s[2];if(Uy(n)&&!t.has(n)&&(t.add(n),t.size>=jy))break}return{text:e,mentions:Array.from(t)}}var qy,ff,Wy,jy,al=F(()=>{qy=new Set(["all","user","system","everyone"]),ff=/(^|[\s\p{P}])@([A-Za-z0-9_-]{1,40})(?=$|[\s\p{P}])/gu,Wy=/^[0-9]+$/,jy=32});function gf(e){let t=typeof e?.vpId=="string"?e.vpId:"";return ll.has(t)?ll.get(t):e?.isStock===!0?"other":"custom"}function xs(e){let t=new Map(_i.map(s=>[s.id,[]]));for(let s of Array.isArray(e)?e:[])!s||typeof s.vpId!="string"||!s.vpId||t.get(gf(s)).push(s);return _i.map(s=>({id:s.id,labelKey:s.labelKey,vps:t.get(s.id)})).filter(s=>s.vps.length>0)}function ur(e){return xs(e).flatMap(t=>t.vps)}function mf(e){let t=new Map(_i.map(r=>[r.id,r])),s=new Map,n=[];for(let r of Array.isArray(e)?e:[]){if(!r||typeof r.vpId!="string"||!r.vpId)continue;let i=gf(r),o=n[n.length-1];if(o&&o.id===i){o.vps.push(r);continue}let a=(s.get(i)||0)+1;s.set(i,a),n.push({id:i,key:`${i}-${a}`,labelKey:t.get(i).labelKey,vps:[r]})}return n}var Ky,_i,ll,pr=F(()=>{Ky=[{id:"general",labelKey:"yeaft.vp.domain.general",vpIds:["omni"]},{id:"productDesign",labelKey:"yeaft.vp.domain.productDesign",vpIds:["steve","dieter","norman"]},{id:"softwareSystems",labelKey:"yeaft.vp.domain.softwareSystems",vpIds:["linus","martin","anders","ada","grace","ken","alan"]},{id:"securityReliability",labelKey:"yeaft.vp.domain.securityReliability",vpIds:["alice","margaret"]},{id:"scienceAnalysis",labelKey:"yeaft.vp.domain.scienceAnalysis",vpIds:["shannon","einstein"]},{id:"philosophyPsychology",labelKey:"yeaft.vp.domain.philosophyPsychology",vpIds:["kongzi","socrates","nietzsche","kahneman","jung"]},{id:"strategyHistory",labelKey:"yeaft.vp.domain.strategyHistory",vpIds:["sunzi","clausewitz","simaqian","harari"]},{id:"businessManagement",labelKey:"yeaft.vp.domain.businessManagement",vpIds:["buffett","munger","dalio","bezos","drucker"]},{id:"artsCulture",labelKey:"yeaft.vp.domain.artsCulture",vpIds:["luxun","sudongpo","borges","kubrick","miyazaki"]},{id:"other",labelKey:"yeaft.vp.domain.other",vpIds:[]},{id:"custom",labelKey:"yeaft.vp.domain.custom",vpIds:[]}],_i=Object.freeze(Ky.map(e=>Object.freeze({id:e.id,labelKey:e.labelKey,vpIds:Object.freeze([...e.vpIds])}))),ll=new Map;for(let e of _i)for(let t of e.vpIds)ll.set(t,e.id)});function cl(e,t){let s=Array.isArray(e)?e:[],n=typeof t=="string"?t.toLowerCase():"";if(!n){let c=s.filter(d=>d&&d.vpId&&d.vpId!=="user");return ur(c).slice(0,hf)}let r=[],i=[],o=[],a=new Set,l=(c,d)=>{a.has(c.vpId)||(a.add(c.vpId),d.push(c))};for(let c of s){if(!c||!c.vpId||c.vpId==="user")continue;if(String(c.vpId).toLowerCase().startsWith(n)){l(c,r);continue}let u=Array.isArray(c.aliases)?c.aliases:[],f=!1;for(let S of u){let w=String(S||"").toLowerCase();if(w&&w.startsWith(n)){f=!0;break}}if(f){l(c,i);continue}let p=String(c.displayName||"").toLowerCase(),g=String(c.displayNameZh||""),m=[c.description,c.descriptionZh,c.role,c.roleZh].map(S=>String(S||"").toLowerCase()),b=typeof t=="string"?t:"",I=p.includes(n)||b&&g.includes(b),y=n&&m.some(S=>S.includes(n));(I||y)&&l(c,o)}return[...ur(r),...ur(i),...ur(o)].slice(0,hf)}function dl(e="chat-input"){return`${e}-vp-mention-listbox`}function ul(e,t){let s=String(t||"").replace(/[^A-Za-z0-9_.:-]/g,"-");return`${e}-vp-mention-option-${s}`}function zy(e){let t=0;return mf(e).map(s=>({...s,items:s.vps.map(n=>({vp:n,flatIndex:t++}))}))}function vf(e,t){let s=Array.isArray(e)?e:[];if(!t)return s;let n=Array.isArray(t.roster)?t.roster:[];if(n.length===0)return[];let r=new Set(n);return s.filter(i=>i&&i.vpId&&r.has(i.vpId))}function yf(e,t){if(typeof e!="string"||!t)return e;let s=e.lastIndexOf("@");if(s<0)return e;let n=s+1;for(;n<e.length&&!/[\s]/.test(e[n]);)n++;return e.slice(0,s)+"@"+t+" "+e.slice(n)}var hf,bf,wf=F(()=>{pr();hf=12;bf={name:"VpMentionAutocomplete",emits:["select","hover-index"],props:{vps:{type:Array,default:()=>[]},query:{type:String,default:""},selectedIndex:{type:Number,default:0},inputId:{type:String,required:!0}},template:`
|
|
1677
1677
|
<div
|
|
1678
1678
|
class="slash-autocomplete vp-mention-autocomplete"
|
|
1679
1679
|
v-if="filteredList.length > 0"
|
|
@@ -1921,8 +1921,8 @@ ${String(e||"").trim()}
|
|
|
1921
1921
|
</template>
|
|
1922
1922
|
</MessageComposer>
|
|
1923
1923
|
</footer>
|
|
1924
|
-
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Pinia.useAuthStore(),r=Pinia.useVpStore(),i=Pinia.useSessionsStore?Pinia.useSessionsStore():null,o=Vue.ref(""),a=Vue.ref(null),l=Vue.computed(()=>a.value?.getTextarea?.()||null),d=`chat-input-${Vue.getCurrentInstance()?.uid??0}`,u=Vue.ref(null),f=Vue.ref([]),p=Vue.computed(()=>f.value.some(H=>H.uploading)),g=Vue.ref(null),m=Vue.ref(null),b=Vue.ref(null),I=Vue.computed(()=>!!e.sendFn),y=Vue.computed(()=>!s.btwMode),S=Vue.computed(()=>e.placeholderKey||"chatInput.placeholder"),w=Vue.computed(()=>e.showStop||!I.value&&s.isProcessing),v=Vue.computed({get:()=>s.expertSelections||[],set:H=>{s.expertSelections=H}}),h=Vue.ref(!1),M=Vue.ref(0),x=Vue.computed(()=>Md(s.customExpertRoles)),E=Vue.computed(()=>{let H=o.value,G=H.lastIndexOf("@");if(G===-1||!h.value)return[];let de=H.slice(G+1).toLowerCase();return x.value.filter(fe=>de?fe.searchText.includes(de):!0).filter(fe=>!v.value.some(we=>we.role===fe.roleId)).slice(0,12)}),V=H=>{if(v.value.length>=ws)return;let G={role:H.roleId,action:H.actionId};s.expertSelections=[...v.value,G];let de=o.value,fe=de.lastIndexOf("@");fe!==-1&&(o.value=de.slice(0,fe).trimEnd()),h.value=!1,Vue.nextTick(()=>l.value?.focus())},L=H=>{let G=[...v.value];G.splice(H,1),s.expertSelections=G},R=H=>bs(H,s.customExpertRoles),P=H=>H==="completed"?"\u2713":H==="in_progress"?"\u2192":"\u25CB",A=Vue.ref(!1),_=Vue.ref(0),j=()=>s.currentView==="yeaft"&&!!s.currentAgent,
|
|
1925
|
-
`||de===0?j()?(A.value=!0,_.value=0,h.value=!1):(h.value=!0,M.value=0,A.value=!1):(h.value=!1,A.value=!1)}else de===-1&&(h.value=!1,A.value=!1)},ee=H=>{o.value=H+" ",K.value=!1,Vue.nextTick(()=>{l.value?.focus()})},ue=()=>{setTimeout(()=>{K.value=!1,h.value=!1,A.value=!1},150)},le=async H=>{let G=Array.from(H.target.files||[]);G.length>0&&await rs(G),H.target.value="",Vue.nextTick(()=>{l.value?.focus()})},Ce=async H=>{let G=H.clipboardData?.items;if(!G)return;let de=[];for(let fe of G)if(fe.kind==="file"){let we=fe.getAsFile();we&&de.push(we)}de.length>0&&(H.preventDefault(),await rs(de))},xe=H=>{let G=String(H||"").toLowerCase();return G==="image/png"?".png":G==="image/jpeg"?".jpg":G==="image/gif"?".gif":G==="image/webp"?".webp":G==="image/svg+xml"?".svg":G==="text/plain"?".txt":G==="application/json"?".json":""},$e=(H,G)=>{let de=typeof H?.name=="string"?H.name.trim():"";return de||`${String(H?.type||"").startsWith("image/")?"pasted-image":"pasted-file"}-${Date.now()}-${G+1}${xe(H?.type)}`},je=1,yt=H=>{let G=Number(H);return!Number.isFinite(G)||G<=0?"":G<1024?`${G} B`:G<1024*1024?`${Math.round(G/1024)} KB`:`${(G/(1024*1024)).toFixed(G<10*1024*1024?1:0)} MB`},bt=async H=>{for(let G of H)G.uploading=!0,G.uploadError=!1;try{let G=new FormData;for(let Ue of H)G.append("files",Ue.file,Ue.uploadName);let de={},fe=n.getActiveToken?.()||n.token||null;fe&&(de.Authorization=`Bearer ${fe}`);let we=await fetch("/api/upload",{method:"POST",headers:de,body:G});if(!we.ok)throw new Error("Upload failed");let Te=await we.json(),Ze=Array.isArray(Te.files)?Te.files:[];for(let[Ue,Je]of H.entries()){let
|
|
1924
|
+
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Pinia.useAuthStore(),r=Pinia.useVpStore(),i=Pinia.useSessionsStore?Pinia.useSessionsStore():null,o=Vue.ref(""),a=Vue.ref(null),l=Vue.computed(()=>a.value?.getTextarea?.()||null),d=`chat-input-${Vue.getCurrentInstance()?.uid??0}`,u=Vue.ref(null),f=Vue.ref([]),p=Vue.computed(()=>f.value.some(H=>H.uploading)),g=Vue.ref(null),m=Vue.ref(null),b=Vue.ref(null),I=Vue.computed(()=>!!e.sendFn),y=Vue.computed(()=>!s.btwMode),S=Vue.computed(()=>e.placeholderKey||"chatInput.placeholder"),w=Vue.computed(()=>e.showStop||!I.value&&s.isProcessing),v=Vue.computed({get:()=>s.expertSelections||[],set:H=>{s.expertSelections=H}}),h=Vue.ref(!1),M=Vue.ref(0),x=Vue.computed(()=>Md(s.customExpertRoles)),E=Vue.computed(()=>{let H=o.value,G=H.lastIndexOf("@");if(G===-1||!h.value)return[];let de=H.slice(G+1).toLowerCase();return x.value.filter(fe=>de?fe.searchText.includes(de):!0).filter(fe=>!v.value.some(we=>we.role===fe.roleId)).slice(0,12)}),V=H=>{if(v.value.length>=ws)return;let G={role:H.roleId,action:H.actionId};s.expertSelections=[...v.value,G];let de=o.value,fe=de.lastIndexOf("@");fe!==-1&&(o.value=de.slice(0,fe).trimEnd()),h.value=!1,Vue.nextTick(()=>l.value?.focus())},L=H=>{let G=[...v.value];G.splice(H,1),s.expertSelections=G},R=H=>bs(H,s.customExpertRoles),P=H=>H==="completed"?"\u2713":H==="in_progress"?"\u2192":"\u25CB",A=Vue.ref(!1),_=Vue.ref(0),j=()=>s.currentView==="yeaft"&&!!s.currentAgent,q=Vue.computed(()=>{let H=o.value,G=H.lastIndexOf("@");return G<0||!A.value?"":H.slice(G+1)}),z=Vue.computed(()=>{if(!i)return r.vpList||[];let H=s.yeaftActiveSessionFilter||i.activeSessionId||null,G=typeof i.sessionById=="function"?i.sessionById(H,s.currentAgent||null):i.sessions?.[H];return vf(r.vpList,G)}),se=Vue.computed(()=>cl(z.value,q.value)),me=Vue.computed(()=>!s.btwMode&&A.value&&!h.value&&se.value.length>0),ae=dl(d),ve=Vue.computed(()=>{if(!me.value)return null;let H=se.value[_.value];return H?ul(d,H.vpId):null}),ge=H=>{!H||!H.vpId||(o.value=yf(o.value,H.vpId),A.value=!1,_.value=0,Vue.nextTick(()=>l.value?.focus()))},pe=Vue.computed(()=>e.draftKey||e.conversationId||s.currentConversation||null);pe.value&&s.inputDrafts[pe.value]&&(o.value=s.inputDrafts[pe.value]),Vue.watch(o,H=>{let G=pe.value;G&&(H?s.inputDrafts[G]=H:delete s.inputDrafts[G])}),Vue.watch(se,H=>{if(H.length===0){_.value=0;return}_.value>=H.length&&(_.value=H.length-1)}),Vue.watch(pe,(H,G)=>{G&&o.value&&(s.inputDrafts[G]=o.value),o.value=H&&s.inputDrafts[H]||""});let T=H=>{if(!H||typeof H!="string")return;let G=o.value||"",de=G.length>0&&!/\s$/.test(G),fe=G+(de?" ":"")+"@"+H+" ";o.value=fe,Vue.nextTick(()=>{let we=l.value;we&&(we.focus(),we.setSelectionRange(fe.length,fe.length),ne())})},K=Vue.ref(!1),re=Vue.ref(0),he=Vue.computed(()=>{let H=e.conversationId||s.activeConversationId||s.currentConversation,G=s.currentAgent,de=cf(s,H,G),fe=s.currentView==="yeaft"?lf:af;return Pi(fe,de).map(Te=>Te.startsWith("/")?Te:"/"+Te)}),Pe=Vue.computed(()=>{let H=o.value.trim();if(!H.startsWith("/"))return[];let G=H.toLowerCase();return he.value.filter(de=>de.toLowerCase().startsWith(G)&&de.toLowerCase()!==G).map(de=>({cmd:de,desc:df(de,s.slashCommandDescriptions)}))}),U=Vue.computed(()=>uf(Pe.value,s.slashCommandDescriptions,he.value)),B=Vue.computed(()=>Pe.value.map(H=>H.cmd)),N=Vue.computed(()=>e.conversationId||s.activeConversationId||s.currentConversation||null),O=Vue.computed(()=>s.compactStatus?.status==="compacting"&&s.compactStatus?.conversationId===N.value),D=H=>typeof H?.fileId=="string"&&H.fileId.trim().length>0,Z=Vue.computed(()=>{if(O.value)return!1;let H=!!o.value.trim(),G=f.value.length>0;if(I.value){let Ze=!p.value&&f.value.every(D);return(H||G)&&Ze}let de=v.value.length>0,fe=v.value.some(Ze=>Ze.action),we=H||G||de&&(H||fe),Te=!p.value&&f.value.every(D);return we&&s.currentAgent&&s.currentConversation&&Te}),ne=()=>a.value?.autoResize?.(),ye=()=>a.value?.resetTextareaSize?.(),Y=()=>{ne();let H=o.value.trim();H.startsWith("/")&&!H.includes(" ")?(K.value=!0,re.value=0,h.value=!1):K.value=!1;let G=o.value,de=G.lastIndexOf("@");if(de!==-1&&!K.value){let fe=de>0?G[de-1]:" ";fe===" "||fe===`
|
|
1925
|
+
`||de===0?j()?(A.value=!0,_.value=0,h.value=!1):(h.value=!0,M.value=0,A.value=!1):(h.value=!1,A.value=!1)}else de===-1&&(h.value=!1,A.value=!1)},ee=H=>{o.value=H+" ",K.value=!1,Vue.nextTick(()=>{l.value?.focus()})},ue=()=>{setTimeout(()=>{K.value=!1,h.value=!1,A.value=!1},150)},le=async H=>{let G=Array.from(H.target.files||[]);G.length>0&&await rs(G),H.target.value="",Vue.nextTick(()=>{l.value?.focus()})},Ce=async H=>{let G=H.clipboardData?.items;if(!G)return;let de=[];for(let fe of G)if(fe.kind==="file"){let we=fe.getAsFile();we&&de.push(we)}de.length>0&&(H.preventDefault(),await rs(de))},xe=H=>{let G=String(H||"").toLowerCase();return G==="image/png"?".png":G==="image/jpeg"?".jpg":G==="image/gif"?".gif":G==="image/webp"?".webp":G==="image/svg+xml"?".svg":G==="text/plain"?".txt":G==="application/json"?".json":""},$e=(H,G)=>{let de=typeof H?.name=="string"?H.name.trim():"";return de||`${String(H?.type||"").startsWith("image/")?"pasted-image":"pasted-file"}-${Date.now()}-${G+1}${xe(H?.type)}`},je=1,yt=H=>{let G=Number(H);return!Number.isFinite(G)||G<=0?"":G<1024?`${G} B`:G<1024*1024?`${Math.round(G/1024)} KB`:`${(G/(1024*1024)).toFixed(G<10*1024*1024?1:0)} MB`},bt=async H=>{for(let G of H)G.uploading=!0,G.uploadError=!1;try{let G=new FormData;for(let Ue of H)G.append("files",Ue.file,Ue.uploadName);let de={},fe=n.getActiveToken?.()||n.token||null;fe&&(de.Authorization=`Bearer ${fe}`);let we=await fetch("/api/upload",{method:"POST",headers:de,body:G});if(!we.ok)throw new Error("Upload failed");let Te=await we.json(),Ze=Array.isArray(Te.files)?Te.files:[];for(let[Ue,Je]of H.entries()){let Be=Ze[Ue],qe=typeof Be?.fileId=="string"?Be.fileId.trim():"";if(!qe)throw new Error("Upload response is incomplete");Je.fileId=qe,Je.uploading=!1,delete Je.uploadName}}catch{for(let de of H)de.fileId||(de.uploading=!1,de.uploadError=!0)}finally{Vue.nextTick(()=>l.value?.focus())}},rs=async H=>{let G=[];for(let[de,fe]of H.entries()){let we=$e(fe,de),Te=Vue.reactive({localId:`attachment-${je++}`,file:fe,name:we,size:fe.size,uploadName:we,preview:null,uploading:!1,uploadError:!1,fileId:null});fe.type.startsWith("image/")&&(Te.preview=URL.createObjectURL(fe)),f.value.push(Te),G.push(Te)}await bt(G)},gn=async H=>{!H||H.uploading||H.fileId||(H.uploadName=H.name,await bt([H]))},Wt=H=>{let G=f.value[H];G.preview&&URL.revokeObjectURL(G.preview),f.value.splice(H,1),Vue.nextTick(()=>{l.value?.focus()})},Rt=()=>{if(!Z.value)return;K.value=!1,h.value=!1,A.value=!1;let H=o.value.trim();if(e.sendFn){let fe=f.value.filter(D).map(Te=>({fileId:Te.fileId,name:Te.name,preview:Te.preview,isImage:Te.file?.type?.startsWith("image/")||!1,mimeType:Te.file?.type||""})),we=fe.length>0?fe:void 0;e.quote?e.sendFn(H,we,e.quote):e.sendFn(H,we),f.value=[],e.quote&&t("quote-consumed"),o.value="",pe.value&&delete s.inputDrafts[pe.value],ye();return}if(H==="/btw"||H.startsWith("/btw ")){let fe=H.substring(4).trim();s.enterBtwMode(),fe&&s.sendBtwQuestion(fe),o.value="",pe.value&&delete s.inputDrafts[pe.value],ye();return}if(s.btwMode){s.sendBtwQuestion(H),o.value="",pe.value&&delete s.inputDrafts[pe.value],ye();return}let G=f.value.filter(D).map(fe=>({fileId:fe.fileId,name:fe.name,preview:fe.preview,isImage:fe.file?.type?.startsWith("image/")||!1,mimeType:fe.file?.type||""}));if(s.currentView==="yeaft"&&(H||G.length>0)){let fe=Ri(H).mentions,we=s.yeaftActiveSessionFilter||i?.activeSessionId||"grp_default";s.sendYeaftSessionMessage({groupId:we,text:H,mentions:fe,attachments:G}),f.value=[],o.value="",pe.value&&delete s.inputDrafts[pe.value],ye();return}let de=[...v.value];s.sendMessage(o.value.trim(),G,{expertSelections:de}),f.value=[],o.value="",s.expertSelections=[],pe.value&&delete s.inputDrafts[pe.value],ye()},_t=H=>{if(!(H.isComposing||H.keyCode===229)){if(H.key==="Escape"&&s.btwMode){H.preventDefault(),s.closeBtw();return}if(A.value){let G=se.value;if(G.length>0){if(H.key==="ArrowDown"){H.preventDefault(),_.value=(_.value+1)%G.length;return}if(H.key==="ArrowUp"){H.preventDefault(),_.value=(_.value-1+G.length)%G.length;return}if(H.key==="Tab"||H.key==="Enter"&&!H.shiftKey){H.preventDefault(),ge(G[_.value]);return}}if(H.key==="Escape"){H.preventDefault(),A.value=!1;return}}if(h.value&&E.value.length>0){if(H.key==="ArrowDown"){H.preventDefault(),M.value=(M.value+1)%E.value.length;return}if(H.key==="ArrowUp"){H.preventDefault(),M.value=(M.value-1+E.value.length)%E.value.length;return}if(H.key==="Tab"||H.key==="Enter"&&!H.shiftKey){H.preventDefault(),V(E.value[M.value]);return}if(H.key==="Escape"){H.preventDefault(),h.value=!1;return}}if(K.value&&B.value.length>0){if(H.key==="ArrowDown"){H.preventDefault(),re.value=(re.value+1)%B.value.length;return}if(H.key==="ArrowUp"){H.preventDefault(),re.value=(re.value-1+B.value.length)%B.value.length;return}if(H.key==="Tab"||H.key==="Enter"&&!H.shiftKey){H.preventDefault(),ee(B.value[re.value]);return}if(H.key==="Escape"){H.preventDefault(),K.value=!1;return}}H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),Rt())}},Xe=()=>{e.cancelFn?e.cancelFn():s.cancelExecution()},wt=H=>{o.value=typeof H=="string"?H:"",Vue.nextTick(()=>{ne(),l.value?.focus();let G=o.value.length;l.value?.setSelectionRange(G,G)})},mn=()=>Vue.nextTick(()=>l.value?.focus());return{store:s,inputText:o,inputRef:l,messageComposerRef:a,inputAreaRef:g,fileInput:u,attachments:f,uploading:p,canSend:Z,isCompacting:O,isStopVisible:w,effectivePlaceholderKey:S,attachmentsAllowed:y,showAutocomplete:K,selectedIndex:re,filteredCommands:B,flatItems:Pe,groupedCommands:U,autocompleteRef:m,sendFn:Vue.toRef(e,"sendFn"),expertSelections:v,showExpertAutocomplete:h,expertSelectedIndex:M,expertAutocompleteFiltered:E,expertAutocompleteRef:b,selectExpertItem:V,removeExpertSelection:L,getExpertLabel:R,todoStatusSymbol:P,autoResize:ne,handleInput:Y,selectCommand:ee,onBlur:ue,handleFileSelect:le,handlePaste:Ce,formatFileSize:yt,retryAttachment:gn,removeAttachment:Wt,send:Rt,handleKeydown:_t,cancelExecution:Xe,vpStore:r,inputElementId:d,showVpAutocomplete:A,vpMentionPopupOpen:me,vpMentionPopupId:ae,vpMentionActiveOptionId:ve,vpSelectedIndex:_,vpMentionQuery:q,mentionVpCandidates:z,selectVpMention:ge,appendMention:T,replaceDraft:wt,focusInput:mn}}}});function fl(e){return new Promise((t,s)=>{if(document.querySelector(`script[src="${e}"]`))return t();let n=document.createElement("script");n.src=e,n.onload=t,n.onerror=s,document.head.appendChild(n)})}function kf(e){return e+":"+Math.random().toString(36).slice(2,8)}function fr(e){return e?e.type==="pane"?[e.terminalId]:[...fr(e.first),...fr(e.second)]:[]}function $i(e){return e?e.type==="pane"?e.terminalId:$i(e.first):null}function Li(e,t,s){return e&&(e.type==="pane"?e.terminalId===t?s:e:{...e,first:Li(e.first,t,s),second:Li(e.second,t,s)})}function ts(e,t){if(!e)return null;if(e.type==="pane")return e.terminalId===t?null:e;if(e.first?.type==="pane"&&e.first.terminalId===t)return e.second;if(e.second?.type==="pane"&&e.second.terminalId===t)return e.first;let s=ts(e.first,t),n=ts(e.second,t);return s?n?{...e,first:s,second:n}:s:n}var Sf=F(()=>{});var If,Cf=F(()=>{If={name:"PaneTree",props:{node:Object,terminals:Object,activePane:String,onActivate:Function,onClosePane:Function,setMountRef:Function},template:`
|
|
1926
1926
|
<div v-if="node.type === 'pane'"
|
|
1927
1927
|
class="terminal-pane"
|
|
1928
1928
|
:class="{ active: node.terminalId === activePane }"
|
|
@@ -1995,7 +1995,7 @@ ${String(e||"").trim()}
|
|
|
1995
1995
|
<div class="placeholder-text">{{ $t('terminal.autoCreate') }}</div>
|
|
1996
1996
|
</div>
|
|
1997
1997
|
</div>
|
|
1998
|
-
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=Vue.reactive({}),n=Vue.reactive({}),r=Vue.reactive({}),i=Vue.ref(""),o={},a=!1,l=Vue.computed(()=>{let P=e.currentConversation;return P&&n[P]||null}),c=Vue.computed(()=>{let P=e.currentConversation;return P&&r[P]||""}),d=Vue.computed(()=>!!c.value),u=(P,A)=>{if(A){let _=o[P];if(o[P]=A,_&&_!==A){let j=s[P];j?.terminal?.element&&(A.innerHTML="",A.appendChild(j.terminal.element),Vue.nextTick(()=>{try{j.fitAddon?.fit()}catch{}}))}}},f=P=>{let A=e.currentConversation;A&&(r[A]=P)};async function p(){if(a)return!0;let P=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,A=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null;if(!P||!A)try{await fl("vendor/xterm.min.js"),await fl("vendor/xterm-addon-fit.min.js"),P=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,A=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null}catch{}return!P||!A?(i.value=t("terminal.xtermNotLoaded"),!1):(a=!0,!0)}function g(){let P=document.documentElement.getAttribute("data-theme")==="dark",_=getComputedStyle(document.documentElement).getPropertyValue("--bg-main").trim()||(P?"#212121":"#ffffff");return P?{background:_,foreground:"#d4d4d4",cursor:"#a0a0a0",selectionBackground:"rgba(255,255,255,0.12)",black:"#3a3a3a",red:"#f48771",green:"#89d185",yellow:"#e5c07b",blue:"#6cb6ff",magenta:"#d670d6",cyan:"#56d4dd",white:"#cccccc",brightBlack:"#555555",brightRed:"#f48771",brightGreen:"#89d185",brightYellow:"#e5c07b",brightBlue:"#6cb6ff",brightMagenta:"#d670d6",brightCyan:"#56d4dd",brightWhite:"#e8e8e8"}:{background:_,foreground:"#383a42",cursor:"#526fff",selectionBackground:"rgba(0,0,0,0.07)",black:"#383a42",red:"#e45649",green:"#50a14f",yellow:"#c18401",blue:"#4078f2",magenta:"#a626a4",cyan:"#0184bc",white:"#a0a1a7",brightBlack:"#4f525e",brightRed:"#e45649",brightGreen:"#50a14f",brightYellow:"#c18401",brightBlue:"#4078f2",brightMagenta:"#a626a4",brightCyan:"#0184bc",brightWhite:"#fafafa"}}async function m(P){if(!P||!e.currentAgent||!await p())return null;let A=kf(P),_=Terminal.Terminal||Terminal,j=FitAddon.FitAddon||FitAddon,B=new _({cursorBlink:!0,fontSize:13,fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace, 'Symbols Nerd Font Mono', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji'",theme:g(),allowProposedApi:!0}),z=new j;return B.loadAddon(z),B.attachCustomKeyEventHandler(se=>!((se.ctrlKey||se.metaKey)&&se.key==="v"||(se.ctrlKey||se.metaKey)&&se.key==="c"&&B.hasSelection())),s[A]={created:!0,connected:!1,terminal:B,fitAddon:z},B.onData(se=>{e.sendWsMessage({type:"terminal_input",agentId:e.currentAgent,conversationId:P,terminalId:A,data:se,_clientId:e.clientId})}),A}async function b(P,A){let _=s[A];if(!_)return!1;let j=null;for(let B=0;B<10&&(await Vue.nextTick(),j=o[A],!(j||B>=2&&(await new Promise(z=>setTimeout(z,50)),j=o[A],j)));B++);return j?(_.terminal.open(j),_.fitAddon.fit(),e.sendWsMessage({type:"terminal_create",agentId:e.currentAgent,conversationId:P,terminalId:A,cols:_.terminal.cols,rows:_.terminal.rows,_clientId:e.clientId}),!0):(i.value=t("terminal.mountFailed"),_.terminal.dispose(),delete s[A],!1)}let I=!1;async function y(){let P=e.currentConversation;if(!P||!e.currentAgent||n[P]||I)return;I=!0,i.value="";let A=await m(P);if(!A){I=!1;return}n[P]=Vue.reactive({type:"pane",terminalId:A}),r[P]=A,await b(P,A)||(delete n[P],delete r[P]),I=!1}async function S(P){let A=e.currentConversation;if(!A||!r[A])return;let _=r[A],j=await m(A);if(!j)return;let B=Vue.reactive({type:"split",direction:P,ratio:.5,first:{type:"pane",terminalId:_},second:{type:"pane",terminalId:j}}),z=Li(n[A],_,B);if(n[A]=Vue.reactive(z),r[A]=j,!await b(A,j)){let me=ts(n[A],j);me&&(n[A]=Vue.reactive(me)),r[A]=_;return}await Vue.nextTick(),h(A)}function w(P){let A=e.currentConversation;if(!A)return;let _=s[P];_&&(e.sendWsMessage({type:"terminal_close",agentId:e.currentAgent,conversationId:A,terminalId:P,_clientId:e.clientId}),_.terminal?.dispose(),delete s[P],delete o[P]);let j=ts(n[A],P);j?(n[A]=Vue.reactive(j),r[A]===P&&(r[A]=$i(n[A])||""),Vue.nextTick(()=>h(A))):(delete n[A],delete r[A],Vue.nextTick(()=>y()))}function v(){let P=e.currentConversation;!P||!r[P]||w(r[P])}function h(P){if(P||(P=e.currentConversation),!P||!n[P])return;let A=fr(n[P]);for(let _ of A){let j=s[_];if(j?.fitAddon&&j.connected)try{j.fitAddon.fit(),e.sendWsMessage({type:"terminal_resize",agentId:e.currentAgent,conversationId:P,terminalId:_,cols:j.terminal.cols,rows:j.terminal.rows,_clientId:e.clientId})}catch{}}}function M(P){let A=P.detail;if(A)switch(A.type){case"terminal_created":{let _=A.terminalId||A.conversationId,j=s[_];if(j)if(A.success)j.connected=!0,i.value="";else{i.value=A.error||t("terminal.createFailed"),j.terminal?.dispose(),delete s[_];let B=A.conversationId;if(B&&n[B]){let z=ts(n[B],_);z?n[B]=Vue.reactive(z):(delete n[B],delete r[B])}}break}case"terminal_output":{let _=A.terminalId||A.conversationId,j=s[_];j?.terminal&&j.terminal.write(A.data);break}case"terminal_closed":{let _=A.terminalId||A.conversationId,j=s[_];if(j){j.terminal?.dispose(),delete s[_],delete o[_];let B=A.conversationId;if(B&&n[B]){let z=ts(n[B],_);z?(n[B]=Vue.reactive(z),r[B]===_&&(r[B]=$i(n[B])||"")):(delete n[B],delete r[B])}}break}case"terminal_error":{i.value=A.message||t("terminal.error");let _=A.terminalId;if(_&&s[_]&&!s[_].connected){s[_].terminal?.dispose(),delete s[_];let j=A.conversationId;if(j&&n[j]){let B=ts(n[j],_);B?n[j]=Vue.reactive(B):(delete n[j],delete r[j])}}break}}}let x=null;function E(){clearTimeout(x),x=setTimeout(()=>h(),100)}function V(){h()}function L(P){let{conversationId:A}=P.detail;if(A&&n[A]){let _=fr(n[A]);for(let j of _){let B=s[j];B&&(B.terminal?.dispose(),delete s[j],delete o[j])}delete n[A],delete r[A]}}Vue.onMounted(()=>{window.addEventListener("workbench-message",M),window.addEventListener("resize",E),window.addEventListener("terminal-fit-all",V),window.addEventListener("conversation-deleted",L)}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",M),window.removeEventListener("resize",E),window.removeEventListener("terminal-fit-all",V),window.removeEventListener("conversation-deleted",L),clearTimeout(x);for(let P of Object.keys(s))s[P]?.terminal?.dispose()}),Vue.watch(()=>[e.currentConversation,e.workbenchExpanded],()=>{Vue.nextTick(()=>{if(!e.currentConversation||!e.workbenchExpanded)return;let A=document.querySelector(".terminal-tab");A&&A.offsetParent!==null&&y()})},{immediate:!0}),Vue.watch(()=>e.connectionState,(P,A)=>{if(P==="connected"&&A&&A!=="connected"){for(let _ of Object.keys(s))s[_]?.terminal?.dispose(),delete s[_],delete o[_];for(let _ of Object.keys(n))delete n[_],delete r[_];Vue.nextTick(()=>y())}}),Vue.watch(()=>e.currentConversation,()=>{Vue.nextTick(()=>h())});let R=null;return Vue.onMounted(()=>{let P=()=>{let _=document.querySelector(".terminal-tab");_&&_.offsetParent!==null&&(y(),h())};R=new MutationObserver(()=>{setTimeout(P,50)});let A=document.querySelector(".workbench-tab-content");A&&R.observe(A,{attributes:!0,subtree:!0,attributeFilter:["style"]})}),Vue.onUnmounted(()=>{R&&R.disconnect()}),{store:e,terminals:s,currentTree:l,currentActivePane:c,hasActivePane:d,terminalError:i,setMountRef:u,activatePane:f,splitPane:S,closeActivePane:v,closePane:w}}}});function Vi(e){if(!e)return gr(J.default);let t=e.toLowerCase();if(gl[t])return gl[t]();let s=t.lastIndexOf(".");if(s>=0){let n=t.slice(s+1);if(Tf[n])return Tf[n]();let r=t;for(let[i,o]of Object.entries(gl))if(r===i||r.endsWith("/"+i))return o()}return gr(J.default)}function Hi(e=!1){return Yy(J.folder,e)}var J,gr,Yy,X,Tf,gl,ml=F(()=>{J={js:"#F1C40F",ts:"#3178C6",jsx:"#61DAFB",tsx:"#3178C6",py:"#3776AB",rb:"#CC342D",go:"#00ADD8",rs:"#DEA584",java:"#E76F00",cs:"#68217A",cpp:"#00599C",c:"#A8B9CC",html:"#E44D26",css:"#1572B6",scss:"#CF649A",less:"#1D365D",json:"#F1C40F",yaml:"#CB171E",xml:"#E44D26",md:"#519ABA",txt:"#8E8E8E",log:"#8E8E8E",sh:"#4EAA25",ps1:"#012456",sql:"#E38C00",svg:"#FFB13B",img:"#26A69A",git:"#F05032",docker:"#2496ED",config:"#6D8086",lock:"#8E8E8E",env:"#ECD53F",vue:"#41B883",react:"#61DAFB",angular:"#DD0031",svelte:"#FF3E00",php:"#777BB4",swift:"#FA7343",kt:"#7F52FF",lua:"#000080",r:"#276DC3",dart:"#00B4AB",liquid:"#67B6E4",folder:"#90A4AE",folderOpen:"#90A4AE",default:"#8E8E8E"},gr=e=>`<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M14 2H6C4.9 2 4 2.9 4 4v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6z" fill="${e}" opacity="0.85"/><path d="M14 2v6h6" fill="${e}" opacity="0.5"/></svg>`,Yy=(e,t)=>t?`<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" fill="${e}" opacity="0.9"/></svg>`:`<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z" fill="${e}" opacity="0.9"/></svg>`,X=(e,t)=>`<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M14 2H6C4.9 2 4 2.9 4 4v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6z" fill="${e}" opacity="0.2"/><path d="M14 2v6h6" fill="${e}" opacity="0.15"/><path d="M14 2H6C4.9 2 4 2.9 4 4v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6z" stroke="${e}" stroke-width="1.2" fill="none"/><text x="12" y="17" text-anchor="middle" font-size="7" font-weight="700" font-family="system-ui,sans-serif" fill="${e}">${t}</text></svg>`,Tf={js:()=>X(J.js,"JS"),mjs:()=>X(J.js,"JS"),cjs:()=>X(J.js,"JS"),ts:()=>X(J.ts,"TS"),mts:()=>X(J.ts,"TS"),jsx:()=>X(J.jsx,"JSX"),tsx:()=>X(J.tsx,"TSX"),html:()=>X(J.html,"</>"),htm:()=>X(J.html,"</>"),css:()=>X(J.css,"CSS"),scss:()=>X(J.scss,"SC"),sass:()=>X(J.scss,"SA"),less:()=>X(J.less,"LS"),vue:()=>X(J.vue,"V"),svelte:()=>X(J.svelte,"SV"),json:()=>X(J.json,"{ }"),yaml:()=>X(J.yaml,"YML"),yml:()=>X(J.yaml,"YML"),toml:()=>X(J.config,"TML"),xml:()=>X(J.xml,"</>"),csv:()=>X(J.config,"CSV"),md:()=>X(J.md,"MD"),markdown:()=>X(J.md,"MD"),txt:()=>gr(J.txt),log:()=>gr(J.log),pdf:()=>X("#E53935","PDF"),py:()=>X(J.py,"PY"),rb:()=>X(J.rb,"RB"),go:()=>X(J.go,"GO"),rs:()=>X(J.rs,"RS"),java:()=>X(J.java,"JA"),cs:()=>X(J.cs,"C#"),cpp:()=>X(J.cpp,"C+"),cc:()=>X(J.cpp,"C+"),c:()=>X(J.c,"C"),h:()=>X(J.c,"H"),hpp:()=>X(J.cpp,"H+"),swift:()=>X(J.swift,"SW"),kt:()=>X(J.kt,"KT"),php:()=>X(J.php,"PHP"),lua:()=>X(J.lua,"LUA"),r:()=>X(J.r,"R"),dart:()=>X(J.dart,"DA"),sh:()=>X(J.sh,">_"),bash:()=>X(J.sh,">_"),zsh:()=>X(J.sh,">_"),fish:()=>X(J.sh,">_"),ps1:()=>X(J.ps1,"PS"),bat:()=>X(J.ps1,"BAT"),cmd:()=>X(J.ps1,"CMD"),sql:()=>X(J.sql,"SQL"),db:()=>X(J.sql,"DB"),sqlite:()=>X(J.sql,"DB"),svg:()=>X(J.svg,"SVG"),png:()=>X(J.img,"PNG"),jpg:()=>X(J.img,"JPG"),jpeg:()=>X(J.img,"JPG"),gif:()=>X(J.img,"GIF"),ico:()=>X(J.img,"ICO"),webp:()=>X(J.img,"WP"),lock:()=>gr(J.lock),env:()=>X(J.env,"ENV"),ini:()=>X(J.config,"INI"),cfg:()=>X(J.config,"CFG"),conf:()=>X(J.config,"CNF"),liquid:()=>X(J.liquid,"LQ"),ejs:()=>X(J.html,"EJS"),hbs:()=>X(J.html,"HBS"),pug:()=>X(J.html,"PUG"),wasm:()=>X("#654FF0","WA"),proto:()=>X(J.config,"PB"),graphql:()=>X("#E535AB","GQL"),gql:()=>X("#E535AB","GQL")},gl={dockerfile:()=>X(J.docker,"DK"),"docker-compose.yml":()=>X(J.docker,"DC"),"docker-compose.yaml":()=>X(J.docker,"DC"),".gitignore":()=>X(J.git,"GI"),".gitattributes":()=>X(J.git,"GA"),".gitmodules":()=>X(J.git,"GM"),".env":()=>X(J.env,"ENV"),".env.local":()=>X(J.env,"ENV"),".env.development":()=>X(J.env,"ENV"),".env.production":()=>X(J.env,"ENV"),"package.json":()=>X("#CB3837","NPM"),"package-lock.json":()=>X("#CB3837","NPM"),"tsconfig.json":()=>X(J.ts,"TSC"),eslintrc:()=>X("#4B32C3","ESL"),".eslintrc.js":()=>X("#4B32C3","ESL"),".eslintrc.json":()=>X("#4B32C3","ESL"),".prettierrc":()=>X("#F7B93E","PR"),makefile:()=>X(J.config,"MK"),"cmakelists.txt":()=>X("#064F8C","CM"),"readme.md":()=>X(J.md,"RM"),license:()=>X("#F5C518","LIC"),"license.md":()=>X("#F5C518","LIC"),"cargo.toml":()=>X(J.rs,"CG"),"go.mod":()=>X(J.go,"MOD"),"go.sum":()=>X(J.go,"SUM"),gemfile:()=>X(J.rb,"GEM"),rakefile:()=>X(J.rb,"RK"),"requirements.txt":()=>X(J.py,"REQ"),pipfile:()=>X(J.py,"PIP"),csproj:()=>X(J.cs,"CSP"),".sln":()=>X(J.cs,"SLN"),slnx:()=>X(J.cs,"SLN")}});function Ts(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Gy(e,t){if(!e||!t)return Ts(e);let s=[],n=(a,l)=>{if(!a)return;let c=new RegExp(a.source,a.flags),d;for(;(d=c.exec(e))!==null;){let u=d[1]!==void 0?d[1]:d[0],f=d.index+(d[1]!==void 0?d[0].indexOf(d[1]):0);if(s.push({start:f,end:f+u.length,cls:l}),!c.global)break}},r=t.commentType||"slash";if((r==="slash"||r==="both")&&(n(ln.comment1,Me.comment),n(ln.commentBlock,Me.comment)),(r==="hash"||r==="both")&&n(ln.commentHash,Me.comment),r==="html"&&n(t.commentHtml,Me.comment),t.commentLine&&n(t.commentLine,Me.comment),t.commentBlock&&n(t.commentBlock,Me.comment),n(ln.string,Me.string),n(ln.number,Me.number),t.keywords&&n(t.keywords,Me.keyword),t.builtins&&n(t.builtins,Me.builtin),t.operators&&n(t.operators,Me.operator),t.decorators&&n(t.decorators,Me.decorator),t.macros&&n(t.macros,Me.macro),t.preprocessor&&n(t.preprocessor,Me.preprocessor),t.attributes&&n(t.attributes,Me.attribute),t.tags&&n(t.tags,Me.tag),t.properties&&n(t.properties,Me.property),t.variables&&n(t.variables,Me.variable),t.headings&&n(t.headings,Me.heading),t.bold&&n(t.bold,Me.bold),t.links&&n(t.links,Me.link),t.keys&&n(t.keys,Me.key),t.sections&&n(t.sections,Me.section),t.selectors&&n(t.selectors,Me.keyword),t.values&&n(t.values,Me.number),t.code&&n(t.code,Me.string),t.italic&&n(t.italic,Me.builtin),t.attrs&&n(t.attrs,Me.attribute),s.length===0)return Ts(e);s.sort((a,l)=>a.start-l.start||l.end-l.start-(a.end-a.start));let i="",o=0;for(let a of s)a.start<o||(a.start>o&&(i+=Ts(e.slice(o,a.start))),i+=`<span class="${a.cls}">${Ts(e.slice(a.start,a.end))}</span>`,o=a.end);return o<e.length&&(i+=Ts(e.slice(o))),i}function Qy(e){if(!e)return null;let t=e.split(".").pop()?.toLowerCase();if(!t)return null;let s=Mf[t];return typeof s=="string"&&(s=Mf[s]),s||null}function Pf(e,t){if(!e)return Ts(e||"");let s=Qy(t);return s?Gy(e,s):Ts(e)}var ln,Mf,Me,Rf=F(()=>{ln={string:/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(`(?:[^`\\]|\\.)*`)/g,number:/\b(\d+\.?\d*(?:[eE][+-]?\d+)?|0x[\da-fA-F]+|0b[01]+|0o[0-7]+)\b/g,comment1:/(\/\/.*$)/gm,commentHash:/(#.*$)/gm,commentBlock:/(\/\*.*?\*\/)/g},Mf={js:{keywords:/\b(const|let|var|function|class|extends|return|if|else|for|while|do|switch|case|break|continue|new|this|super|import|export|from|default|async|await|yield|try|catch|finally|throw|typeof|instanceof|in|of|delete|void|null|undefined|true|false|NaN|Infinity)\b/g,builtins:/\b(console|window|document|Math|JSON|Array|Object|String|Number|Boolean|Promise|Map|Set|WeakMap|WeakSet|Symbol|Proxy|Reflect|RegExp|Error|Date|parseInt|parseFloat|setTimeout|setInterval|clearTimeout|clearInterval|fetch|require|module|exports|process)\b/g,operators:/(=>|\.\.\.|\?\.|&&|\|\||===|!==|==|!=|>=|<=|>>>=|>>>|>>=|<<=|\+\+|--|[+\-*/%&|^~!<>]=?|\?|:)/g},ts:"js",jsx:"js",tsx:"js",mjs:"js",cjs:"js",vue:"js",py:{keywords:/\b(def|class|return|if|elif|else|for|while|break|continue|pass|import|from|as|with|try|except|finally|raise|yield|lambda|and|or|not|is|in|True|False|None|global|nonlocal|del|assert|async|await)\b/g,builtins:/\b(print|len|range|int|float|str|bool|list|dict|set|tuple|type|isinstance|super|property|staticmethod|classmethod|enumerate|zip|map|filter|sorted|reversed|open|input|hasattr|getattr|setattr|id|hex|oct|bin|abs|max|min|sum|all|any|iter|next)\b/g,decorators:/(@\w+)/g,commentType:"hash"},rb:{keywords:/\b(def|class|module|end|return|if|elsif|else|unless|for|while|until|do|break|next|case|when|begin|rescue|ensure|raise|yield|require|include|extend|attr_accessor|attr_reader|attr_writer|self|super|nil|true|false|and|or|not|then|puts|print)\b/g,commentType:"hash"},go:{keywords:/\b(func|package|import|var|const|type|struct|interface|map|chan|go|select|switch|case|default|if|else|for|range|break|continue|return|defer|fallthrough|nil|true|false|iota)\b/g,builtins:/\b(fmt|make|len|cap|append|copy|delete|close|panic|recover|new|error|string|int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|float32|float64|bool|byte|rune|complex64|complex128)\b/g},rs:{keywords:/\b(fn|let|mut|const|pub|mod|use|struct|enum|impl|trait|where|for|loop|while|if|else|match|return|break|continue|move|ref|self|Self|super|crate|as|in|unsafe|async|await|dyn|true|false|Some|None|Ok|Err)\b/g,builtins:/\b(String|Vec|Box|Rc|Arc|Option|Result|HashMap|HashSet|println|eprintln|format|panic|todo|unimplemented|assert|assert_eq|assert_ne|dbg|cfg|derive|macro_rules)\b/g,macros:/(\w+!)/g},java:{keywords:/\b(class|interface|extends|implements|public|private|protected|static|final|abstract|synchronized|volatile|transient|native|new|return|if|else|for|while|do|switch|case|default|break|continue|try|catch|finally|throw|throws|import|package|this|super|void|null|true|false|instanceof)\b/g,builtins:/\b(System|String|Integer|Long|Double|Float|Boolean|List|ArrayList|Map|HashMap|Set|HashSet|Optional|Stream|Object|Exception|RuntimeException|Thread|Runnable|Override|Deprecated)\b/g},cs:{keywords:/\b(class|struct|interface|enum|record|delegate|event|namespace|using|public|private|protected|internal|static|readonly|const|sealed|abstract|virtual|override|new|return|if|else|for|foreach|while|do|switch|case|default|break|continue|try|catch|finally|throw|async|await|yield|var|dynamic|is|as|in|out|ref|params|this|base|null|true|false|void|get|set|init|required|partial|where|select|from|orderby|group|join|let|into)\b/g,builtins:/\b(Console|String|Int32|Int64|Double|Boolean|List|Dictionary|HashSet|Task|IEnumerable|ILogger|IOptions|IFeatures|Exception|Guid|DateTime|TimeSpan|CancellationToken|Action|Func|Span|Memory|ReadOnlySpan)\b/g,attributes:/(\[[\w]+(?:\(.*?\))?\])/g},cpp:{keywords:/\b(class|struct|enum|union|namespace|using|template|typename|public|private|protected|static|const|constexpr|volatile|virtual|override|final|explicit|inline|extern|auto|decltype|new|delete|return|if|else|for|while|do|switch|case|default|break|continue|try|catch|throw|sizeof|alignof|typeid|static_cast|dynamic_cast|reinterpret_cast|const_cast|nullptr|true|false|void|this|operator|friend|noexcept|co_await|co_yield|co_return|concept|requires)\b/g,builtins:/\b(std|string|vector|map|unordered_map|set|array|pair|tuple|shared_ptr|unique_ptr|weak_ptr|optional|variant|any|cout|cin|endl|printf|scanf|malloc|free|sizeof|size_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t)\b/g,preprocessor:/(#\s*(?:include|define|undef|if|ifdef|ifndef|else|elif|endif|pragma|error|warning).*$)/gm},c:"cpp",h:"cpp",hpp:"cpp",html:{tags:/(<\/?[\w-]+|>|\/>)/g,attrs:/\b([\w-]+)(?==)/g,commentType:"html",commentHtml:/(<!--[\s\S]*?-->)/g},xml:"html",svg:"html",css:{selectors:/([\w.#\[\]:,>+~*-]+)\s*\{/g,properties:/\b([\w-]+)(?=\s*:)/g,values:/:\s*([^;{}]+)/g,commentType:"block"},scss:"css",less:"css",json:{keys:/("[\w.-]+")\s*:/g,commentType:"none"},yaml:{keys:/([\w.-]+)\s*:/g,commentType:"hash"},yml:"yaml",md:{headings:/^(#{1,6}\s.*)$/gm,bold:/(\*\*[^*]+\*\*|__[^_]+__)/g,italic:/(\*[^*]+\*|_[^_]+_)/g,code:/(`[^`]+`)/g,links:/(\[[^\]]+\]\([^)]+\))/g,commentType:"none"},sh:{keywords:/\b(if|then|else|elif|fi|for|while|do|done|case|esac|function|return|exit|echo|export|local|readonly|unset|set|shift|eval|exec|trap|source|alias|cd|pwd|ls|mkdir|rm|cp|mv|cat|grep|sed|awk|find|xargs|sort|uniq|wc|head|tail|tee|cut|tr|test)\b/g,variables:/(\$\{?\w+\}?|\$\(|\$\{)/g,commentType:"hash"},bash:"sh",zsh:"sh",sql:{keywords:/\b(SELECT|FROM|WHERE|AND|OR|NOT|IN|LIKE|BETWEEN|JOIN|LEFT|RIGHT|INNER|OUTER|FULL|ON|AS|GROUP|BY|ORDER|HAVING|LIMIT|OFFSET|INSERT|INTO|VALUES|UPDATE|SET|DELETE|CREATE|ALTER|DROP|TABLE|INDEX|VIEW|TRIGGER|FUNCTION|PROCEDURE|BEGIN|END|IF|ELSE|THEN|CASE|WHEN|DECLARE|EXEC|UNION|ALL|DISTINCT|TOP|EXISTS|NULL|IS|ASC|DESC|PRIMARY|KEY|FOREIGN|REFERENCES|CONSTRAINT|DEFAULT|CHECK|UNIQUE|CASCADE|TRUNCATE|COMMIT|ROLLBACK|GRANT|REVOKE)\b/gi,commentType:"both"},lua:{keywords:/\b(and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/g,builtins:/\b(print|type|tostring|tonumber|pairs|ipairs|next|select|unpack|error|pcall|xpcall|assert|require|table|string|math|io|os|coroutine|setmetatable|getmetatable|rawget|rawset)\b/g,commentLine:/(--(?!\[).*$)/gm,commentBlock:/(--\[\[[\s\S]*?\]\])/g},php:{keywords:/\b(function|class|interface|trait|extends|implements|public|private|protected|static|final|abstract|const|var|new|return|if|else|elseif|for|foreach|while|do|switch|case|default|break|continue|try|catch|finally|throw|use|namespace|require|include|require_once|include_once|echo|print|die|exit|null|true|false|array|list|match|fn|yield|from)\b/g,variables:/(\$\w+)/g},swift:{keywords:/\b(func|class|struct|enum|protocol|extension|let|var|guard|if|else|for|while|repeat|switch|case|default|break|continue|return|throw|try|catch|defer|import|typealias|associatedtype|init|deinit|subscript|operator|precedencegroup|self|Self|super|nil|true|false|is|as|in|inout|throws|rethrows|where|some|any|weak|unowned|lazy|mutating|nonmutating|override|final|required|convenience|optional|dynamic|async|await|actor|nonisolated|isolated|sending|consuming|borrowing)\b/g},kt:{keywords:/\b(fun|class|object|interface|val|var|if|else|when|for|while|do|return|break|continue|throw|try|catch|finally|import|package|as|is|in|out|by|init|constructor|companion|data|sealed|enum|abstract|open|override|private|protected|internal|public|inline|reified|suspend|coroutine|null|true|false|this|super|it|typealias|annotation|lateinit|lazy|get|set)\b/g},dart:{keywords:/\b(class|extends|implements|with|mixin|abstract|sealed|base|interface|final|const|var|late|required|dynamic|void|static|return|if|else|for|while|do|switch|case|default|break|continue|try|catch|finally|throw|rethrow|assert|new|this|super|null|true|false|is|as|in|async|await|yield|import|export|library|part|show|hide|deferred|typedef|enum|extension|on)\b/g},r:{keywords:/\b(if|else|for|while|repeat|function|return|break|next|in|TRUE|FALSE|NULL|NA|Inf|NaN|library|require|source|print|cat|paste|paste0|sprintf|stop|warning|message)\b/g,commentType:"hash"},toml:{keys:/([\w.-]+)\s*=/g,sections:/(\[[\w.]+\])/g,commentType:"hash"},proto:{keywords:/\b(syntax|package|import|option|message|enum|service|rpc|returns|repeated|optional|required|map|oneof|reserved|extensions|extend|group|default|packed|deprecated|java_package|java_outer_classname|optimize_for|cc_enable_arenas|objc_class_prefix|csharp_namespace|swift_prefix|php_class_prefix|php_namespace|ruby_package|string|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|float|double|bool|bytes)\b/g}},Me={keyword:"hl-kw",builtin:"hl-bi",string:"hl-st",number:"hl-nm",comment:"hl-cm",operator:"hl-op",decorator:"hl-dc",macro:"hl-mc",preprocessor:"hl-pp",attribute:"hl-at",tag:"hl-tg",property:"hl-pr",variable:"hl-vr",heading:"hl-hd",bold:"hl-bd",link:"hl-lk",key:"hl-ky",section:"hl-sc"}});function _f(e,t,s){let n=[],r=0,i=0;if(t!=null){let p=t.split(`
|
|
1998
|
+
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=Vue.reactive({}),n=Vue.reactive({}),r=Vue.reactive({}),i=Vue.ref(""),o={},a=!1,l=Vue.computed(()=>{let P=e.currentConversation;return P&&n[P]||null}),c=Vue.computed(()=>{let P=e.currentConversation;return P&&r[P]||""}),d=Vue.computed(()=>!!c.value),u=(P,A)=>{if(A){let _=o[P];if(o[P]=A,_&&_!==A){let j=s[P];j?.terminal?.element&&(A.innerHTML="",A.appendChild(j.terminal.element),Vue.nextTick(()=>{try{j.fitAddon?.fit()}catch{}}))}}},f=P=>{let A=e.currentConversation;A&&(r[A]=P)};async function p(){if(a)return!0;let P=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,A=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null;if(!P||!A)try{await fl("vendor/xterm.min.js"),await fl("vendor/xterm-addon-fit.min.js"),P=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,A=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null}catch{}return!P||!A?(i.value=t("terminal.xtermNotLoaded"),!1):(a=!0,!0)}function g(){let P=document.documentElement.getAttribute("data-theme")==="dark",_=getComputedStyle(document.documentElement).getPropertyValue("--bg-main").trim()||(P?"#212121":"#ffffff");return P?{background:_,foreground:"#d4d4d4",cursor:"#a0a0a0",selectionBackground:"rgba(255,255,255,0.12)",black:"#3a3a3a",red:"#f48771",green:"#89d185",yellow:"#e5c07b",blue:"#6cb6ff",magenta:"#d670d6",cyan:"#56d4dd",white:"#cccccc",brightBlack:"#555555",brightRed:"#f48771",brightGreen:"#89d185",brightYellow:"#e5c07b",brightBlue:"#6cb6ff",brightMagenta:"#d670d6",brightCyan:"#56d4dd",brightWhite:"#e8e8e8"}:{background:_,foreground:"#383a42",cursor:"#526fff",selectionBackground:"rgba(0,0,0,0.07)",black:"#383a42",red:"#e45649",green:"#50a14f",yellow:"#c18401",blue:"#4078f2",magenta:"#a626a4",cyan:"#0184bc",white:"#a0a1a7",brightBlack:"#4f525e",brightRed:"#e45649",brightGreen:"#50a14f",brightYellow:"#c18401",brightBlue:"#4078f2",brightMagenta:"#a626a4",brightCyan:"#0184bc",brightWhite:"#fafafa"}}async function m(P){if(!P||!e.currentAgent||!await p())return null;let A=kf(P),_=Terminal.Terminal||Terminal,j=FitAddon.FitAddon||FitAddon,q=new _({cursorBlink:!0,fontSize:13,fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace, 'Symbols Nerd Font Mono', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji'",theme:g(),allowProposedApi:!0}),z=new j;return q.loadAddon(z),q.attachCustomKeyEventHandler(se=>!((se.ctrlKey||se.metaKey)&&se.key==="v"||(se.ctrlKey||se.metaKey)&&se.key==="c"&&q.hasSelection())),s[A]={created:!0,connected:!1,terminal:q,fitAddon:z},q.onData(se=>{e.sendWsMessage({type:"terminal_input",agentId:e.currentAgent,conversationId:P,terminalId:A,data:se,_clientId:e.clientId})}),A}async function b(P,A){let _=s[A];if(!_)return!1;let j=null;for(let q=0;q<10&&(await Vue.nextTick(),j=o[A],!(j||q>=2&&(await new Promise(z=>setTimeout(z,50)),j=o[A],j)));q++);return j?(_.terminal.open(j),_.fitAddon.fit(),e.sendWsMessage({type:"terminal_create",agentId:e.currentAgent,conversationId:P,terminalId:A,cols:_.terminal.cols,rows:_.terminal.rows,_clientId:e.clientId}),!0):(i.value=t("terminal.mountFailed"),_.terminal.dispose(),delete s[A],!1)}let I=!1;async function y(){let P=e.currentConversation;if(!P||!e.currentAgent||n[P]||I)return;I=!0,i.value="";let A=await m(P);if(!A){I=!1;return}n[P]=Vue.reactive({type:"pane",terminalId:A}),r[P]=A,await b(P,A)||(delete n[P],delete r[P]),I=!1}async function S(P){let A=e.currentConversation;if(!A||!r[A])return;let _=r[A],j=await m(A);if(!j)return;let q=Vue.reactive({type:"split",direction:P,ratio:.5,first:{type:"pane",terminalId:_},second:{type:"pane",terminalId:j}}),z=Li(n[A],_,q);if(n[A]=Vue.reactive(z),r[A]=j,!await b(A,j)){let me=ts(n[A],j);me&&(n[A]=Vue.reactive(me)),r[A]=_;return}await Vue.nextTick(),h(A)}function w(P){let A=e.currentConversation;if(!A)return;let _=s[P];_&&(e.sendWsMessage({type:"terminal_close",agentId:e.currentAgent,conversationId:A,terminalId:P,_clientId:e.clientId}),_.terminal?.dispose(),delete s[P],delete o[P]);let j=ts(n[A],P);j?(n[A]=Vue.reactive(j),r[A]===P&&(r[A]=$i(n[A])||""),Vue.nextTick(()=>h(A))):(delete n[A],delete r[A],Vue.nextTick(()=>y()))}function v(){let P=e.currentConversation;!P||!r[P]||w(r[P])}function h(P){if(P||(P=e.currentConversation),!P||!n[P])return;let A=fr(n[P]);for(let _ of A){let j=s[_];if(j?.fitAddon&&j.connected)try{j.fitAddon.fit(),e.sendWsMessage({type:"terminal_resize",agentId:e.currentAgent,conversationId:P,terminalId:_,cols:j.terminal.cols,rows:j.terminal.rows,_clientId:e.clientId})}catch{}}}function M(P){let A=P.detail;if(A)switch(A.type){case"terminal_created":{let _=A.terminalId||A.conversationId,j=s[_];if(j)if(A.success)j.connected=!0,i.value="";else{i.value=A.error||t("terminal.createFailed"),j.terminal?.dispose(),delete s[_];let q=A.conversationId;if(q&&n[q]){let z=ts(n[q],_);z?n[q]=Vue.reactive(z):(delete n[q],delete r[q])}}break}case"terminal_output":{let _=A.terminalId||A.conversationId,j=s[_];j?.terminal&&j.terminal.write(A.data);break}case"terminal_closed":{let _=A.terminalId||A.conversationId,j=s[_];if(j){j.terminal?.dispose(),delete s[_],delete o[_];let q=A.conversationId;if(q&&n[q]){let z=ts(n[q],_);z?(n[q]=Vue.reactive(z),r[q]===_&&(r[q]=$i(n[q])||"")):(delete n[q],delete r[q])}}break}case"terminal_error":{i.value=A.message||t("terminal.error");let _=A.terminalId;if(_&&s[_]&&!s[_].connected){s[_].terminal?.dispose(),delete s[_];let j=A.conversationId;if(j&&n[j]){let q=ts(n[j],_);q?n[j]=Vue.reactive(q):(delete n[j],delete r[j])}}break}}}let x=null;function E(){clearTimeout(x),x=setTimeout(()=>h(),100)}function V(){h()}function L(P){let{conversationId:A}=P.detail;if(A&&n[A]){let _=fr(n[A]);for(let j of _){let q=s[j];q&&(q.terminal?.dispose(),delete s[j],delete o[j])}delete n[A],delete r[A]}}Vue.onMounted(()=>{window.addEventListener("workbench-message",M),window.addEventListener("resize",E),window.addEventListener("terminal-fit-all",V),window.addEventListener("conversation-deleted",L)}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",M),window.removeEventListener("resize",E),window.removeEventListener("terminal-fit-all",V),window.removeEventListener("conversation-deleted",L),clearTimeout(x);for(let P of Object.keys(s))s[P]?.terminal?.dispose()}),Vue.watch(()=>[e.currentConversation,e.workbenchExpanded],()=>{Vue.nextTick(()=>{if(!e.currentConversation||!e.workbenchExpanded)return;let A=document.querySelector(".terminal-tab");A&&A.offsetParent!==null&&y()})},{immediate:!0}),Vue.watch(()=>e.connectionState,(P,A)=>{if(P==="connected"&&A&&A!=="connected"){for(let _ of Object.keys(s))s[_]?.terminal?.dispose(),delete s[_],delete o[_];for(let _ of Object.keys(n))delete n[_],delete r[_];Vue.nextTick(()=>y())}}),Vue.watch(()=>e.currentConversation,()=>{Vue.nextTick(()=>h())});let R=null;return Vue.onMounted(()=>{let P=()=>{let _=document.querySelector(".terminal-tab");_&&_.offsetParent!==null&&(y(),h())};R=new MutationObserver(()=>{setTimeout(P,50)});let A=document.querySelector(".workbench-tab-content");A&&R.observe(A,{attributes:!0,subtree:!0,attributeFilter:["style"]})}),Vue.onUnmounted(()=>{R&&R.disconnect()}),{store:e,terminals:s,currentTree:l,currentActivePane:c,hasActivePane:d,terminalError:i,setMountRef:u,activatePane:f,splitPane:S,closeActivePane:v,closePane:w}}}});function Vi(e){if(!e)return gr(J.default);let t=e.toLowerCase();if(gl[t])return gl[t]();let s=t.lastIndexOf(".");if(s>=0){let n=t.slice(s+1);if(Tf[n])return Tf[n]();let r=t;for(let[i,o]of Object.entries(gl))if(r===i||r.endsWith("/"+i))return o()}return gr(J.default)}function Hi(e=!1){return Yy(J.folder,e)}var J,gr,Yy,X,Tf,gl,ml=F(()=>{J={js:"#F1C40F",ts:"#3178C6",jsx:"#61DAFB",tsx:"#3178C6",py:"#3776AB",rb:"#CC342D",go:"#00ADD8",rs:"#DEA584",java:"#E76F00",cs:"#68217A",cpp:"#00599C",c:"#A8B9CC",html:"#E44D26",css:"#1572B6",scss:"#CF649A",less:"#1D365D",json:"#F1C40F",yaml:"#CB171E",xml:"#E44D26",md:"#519ABA",txt:"#8E8E8E",log:"#8E8E8E",sh:"#4EAA25",ps1:"#012456",sql:"#E38C00",svg:"#FFB13B",img:"#26A69A",git:"#F05032",docker:"#2496ED",config:"#6D8086",lock:"#8E8E8E",env:"#ECD53F",vue:"#41B883",react:"#61DAFB",angular:"#DD0031",svelte:"#FF3E00",php:"#777BB4",swift:"#FA7343",kt:"#7F52FF",lua:"#000080",r:"#276DC3",dart:"#00B4AB",liquid:"#67B6E4",folder:"#90A4AE",folderOpen:"#90A4AE",default:"#8E8E8E"},gr=e=>`<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M14 2H6C4.9 2 4 2.9 4 4v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6z" fill="${e}" opacity="0.85"/><path d="M14 2v6h6" fill="${e}" opacity="0.5"/></svg>`,Yy=(e,t)=>t?`<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" fill="${e}" opacity="0.9"/></svg>`:`<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z" fill="${e}" opacity="0.9"/></svg>`,X=(e,t)=>`<svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M14 2H6C4.9 2 4 2.9 4 4v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6z" fill="${e}" opacity="0.2"/><path d="M14 2v6h6" fill="${e}" opacity="0.15"/><path d="M14 2H6C4.9 2 4 2.9 4 4v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6z" stroke="${e}" stroke-width="1.2" fill="none"/><text x="12" y="17" text-anchor="middle" font-size="7" font-weight="700" font-family="system-ui,sans-serif" fill="${e}">${t}</text></svg>`,Tf={js:()=>X(J.js,"JS"),mjs:()=>X(J.js,"JS"),cjs:()=>X(J.js,"JS"),ts:()=>X(J.ts,"TS"),mts:()=>X(J.ts,"TS"),jsx:()=>X(J.jsx,"JSX"),tsx:()=>X(J.tsx,"TSX"),html:()=>X(J.html,"</>"),htm:()=>X(J.html,"</>"),css:()=>X(J.css,"CSS"),scss:()=>X(J.scss,"SC"),sass:()=>X(J.scss,"SA"),less:()=>X(J.less,"LS"),vue:()=>X(J.vue,"V"),svelte:()=>X(J.svelte,"SV"),json:()=>X(J.json,"{ }"),yaml:()=>X(J.yaml,"YML"),yml:()=>X(J.yaml,"YML"),toml:()=>X(J.config,"TML"),xml:()=>X(J.xml,"</>"),csv:()=>X(J.config,"CSV"),md:()=>X(J.md,"MD"),markdown:()=>X(J.md,"MD"),txt:()=>gr(J.txt),log:()=>gr(J.log),pdf:()=>X("#E53935","PDF"),py:()=>X(J.py,"PY"),rb:()=>X(J.rb,"RB"),go:()=>X(J.go,"GO"),rs:()=>X(J.rs,"RS"),java:()=>X(J.java,"JA"),cs:()=>X(J.cs,"C#"),cpp:()=>X(J.cpp,"C+"),cc:()=>X(J.cpp,"C+"),c:()=>X(J.c,"C"),h:()=>X(J.c,"H"),hpp:()=>X(J.cpp,"H+"),swift:()=>X(J.swift,"SW"),kt:()=>X(J.kt,"KT"),php:()=>X(J.php,"PHP"),lua:()=>X(J.lua,"LUA"),r:()=>X(J.r,"R"),dart:()=>X(J.dart,"DA"),sh:()=>X(J.sh,">_"),bash:()=>X(J.sh,">_"),zsh:()=>X(J.sh,">_"),fish:()=>X(J.sh,">_"),ps1:()=>X(J.ps1,"PS"),bat:()=>X(J.ps1,"BAT"),cmd:()=>X(J.ps1,"CMD"),sql:()=>X(J.sql,"SQL"),db:()=>X(J.sql,"DB"),sqlite:()=>X(J.sql,"DB"),svg:()=>X(J.svg,"SVG"),png:()=>X(J.img,"PNG"),jpg:()=>X(J.img,"JPG"),jpeg:()=>X(J.img,"JPG"),gif:()=>X(J.img,"GIF"),ico:()=>X(J.img,"ICO"),webp:()=>X(J.img,"WP"),lock:()=>gr(J.lock),env:()=>X(J.env,"ENV"),ini:()=>X(J.config,"INI"),cfg:()=>X(J.config,"CFG"),conf:()=>X(J.config,"CNF"),liquid:()=>X(J.liquid,"LQ"),ejs:()=>X(J.html,"EJS"),hbs:()=>X(J.html,"HBS"),pug:()=>X(J.html,"PUG"),wasm:()=>X("#654FF0","WA"),proto:()=>X(J.config,"PB"),graphql:()=>X("#E535AB","GQL"),gql:()=>X("#E535AB","GQL")},gl={dockerfile:()=>X(J.docker,"DK"),"docker-compose.yml":()=>X(J.docker,"DC"),"docker-compose.yaml":()=>X(J.docker,"DC"),".gitignore":()=>X(J.git,"GI"),".gitattributes":()=>X(J.git,"GA"),".gitmodules":()=>X(J.git,"GM"),".env":()=>X(J.env,"ENV"),".env.local":()=>X(J.env,"ENV"),".env.development":()=>X(J.env,"ENV"),".env.production":()=>X(J.env,"ENV"),"package.json":()=>X("#CB3837","NPM"),"package-lock.json":()=>X("#CB3837","NPM"),"tsconfig.json":()=>X(J.ts,"TSC"),eslintrc:()=>X("#4B32C3","ESL"),".eslintrc.js":()=>X("#4B32C3","ESL"),".eslintrc.json":()=>X("#4B32C3","ESL"),".prettierrc":()=>X("#F7B93E","PR"),makefile:()=>X(J.config,"MK"),"cmakelists.txt":()=>X("#064F8C","CM"),"readme.md":()=>X(J.md,"RM"),license:()=>X("#F5C518","LIC"),"license.md":()=>X("#F5C518","LIC"),"cargo.toml":()=>X(J.rs,"CG"),"go.mod":()=>X(J.go,"MOD"),"go.sum":()=>X(J.go,"SUM"),gemfile:()=>X(J.rb,"GEM"),rakefile:()=>X(J.rb,"RK"),"requirements.txt":()=>X(J.py,"REQ"),pipfile:()=>X(J.py,"PIP"),csproj:()=>X(J.cs,"CSP"),".sln":()=>X(J.cs,"SLN"),slnx:()=>X(J.cs,"SLN")}});function Ts(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Gy(e,t){if(!e||!t)return Ts(e);let s=[],n=(a,l)=>{if(!a)return;let c=new RegExp(a.source,a.flags),d;for(;(d=c.exec(e))!==null;){let u=d[1]!==void 0?d[1]:d[0],f=d.index+(d[1]!==void 0?d[0].indexOf(d[1]):0);if(s.push({start:f,end:f+u.length,cls:l}),!c.global)break}},r=t.commentType||"slash";if((r==="slash"||r==="both")&&(n(ln.comment1,Me.comment),n(ln.commentBlock,Me.comment)),(r==="hash"||r==="both")&&n(ln.commentHash,Me.comment),r==="html"&&n(t.commentHtml,Me.comment),t.commentLine&&n(t.commentLine,Me.comment),t.commentBlock&&n(t.commentBlock,Me.comment),n(ln.string,Me.string),n(ln.number,Me.number),t.keywords&&n(t.keywords,Me.keyword),t.builtins&&n(t.builtins,Me.builtin),t.operators&&n(t.operators,Me.operator),t.decorators&&n(t.decorators,Me.decorator),t.macros&&n(t.macros,Me.macro),t.preprocessor&&n(t.preprocessor,Me.preprocessor),t.attributes&&n(t.attributes,Me.attribute),t.tags&&n(t.tags,Me.tag),t.properties&&n(t.properties,Me.property),t.variables&&n(t.variables,Me.variable),t.headings&&n(t.headings,Me.heading),t.bold&&n(t.bold,Me.bold),t.links&&n(t.links,Me.link),t.keys&&n(t.keys,Me.key),t.sections&&n(t.sections,Me.section),t.selectors&&n(t.selectors,Me.keyword),t.values&&n(t.values,Me.number),t.code&&n(t.code,Me.string),t.italic&&n(t.italic,Me.builtin),t.attrs&&n(t.attrs,Me.attribute),s.length===0)return Ts(e);s.sort((a,l)=>a.start-l.start||l.end-l.start-(a.end-a.start));let i="",o=0;for(let a of s)a.start<o||(a.start>o&&(i+=Ts(e.slice(o,a.start))),i+=`<span class="${a.cls}">${Ts(e.slice(a.start,a.end))}</span>`,o=a.end);return o<e.length&&(i+=Ts(e.slice(o))),i}function Qy(e){if(!e)return null;let t=e.split(".").pop()?.toLowerCase();if(!t)return null;let s=Mf[t];return typeof s=="string"&&(s=Mf[s]),s||null}function Pf(e,t){if(!e)return Ts(e||"");let s=Qy(t);return s?Gy(e,s):Ts(e)}var ln,Mf,Me,Rf=F(()=>{ln={string:/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(`(?:[^`\\]|\\.)*`)/g,number:/\b(\d+\.?\d*(?:[eE][+-]?\d+)?|0x[\da-fA-F]+|0b[01]+|0o[0-7]+)\b/g,comment1:/(\/\/.*$)/gm,commentHash:/(#.*$)/gm,commentBlock:/(\/\*.*?\*\/)/g},Mf={js:{keywords:/\b(const|let|var|function|class|extends|return|if|else|for|while|do|switch|case|break|continue|new|this|super|import|export|from|default|async|await|yield|try|catch|finally|throw|typeof|instanceof|in|of|delete|void|null|undefined|true|false|NaN|Infinity)\b/g,builtins:/\b(console|window|document|Math|JSON|Array|Object|String|Number|Boolean|Promise|Map|Set|WeakMap|WeakSet|Symbol|Proxy|Reflect|RegExp|Error|Date|parseInt|parseFloat|setTimeout|setInterval|clearTimeout|clearInterval|fetch|require|module|exports|process)\b/g,operators:/(=>|\.\.\.|\?\.|&&|\|\||===|!==|==|!=|>=|<=|>>>=|>>>|>>=|<<=|\+\+|--|[+\-*/%&|^~!<>]=?|\?|:)/g},ts:"js",jsx:"js",tsx:"js",mjs:"js",cjs:"js",vue:"js",py:{keywords:/\b(def|class|return|if|elif|else|for|while|break|continue|pass|import|from|as|with|try|except|finally|raise|yield|lambda|and|or|not|is|in|True|False|None|global|nonlocal|del|assert|async|await)\b/g,builtins:/\b(print|len|range|int|float|str|bool|list|dict|set|tuple|type|isinstance|super|property|staticmethod|classmethod|enumerate|zip|map|filter|sorted|reversed|open|input|hasattr|getattr|setattr|id|hex|oct|bin|abs|max|min|sum|all|any|iter|next)\b/g,decorators:/(@\w+)/g,commentType:"hash"},rb:{keywords:/\b(def|class|module|end|return|if|elsif|else|unless|for|while|until|do|break|next|case|when|begin|rescue|ensure|raise|yield|require|include|extend|attr_accessor|attr_reader|attr_writer|self|super|nil|true|false|and|or|not|then|puts|print)\b/g,commentType:"hash"},go:{keywords:/\b(func|package|import|var|const|type|struct|interface|map|chan|go|select|switch|case|default|if|else|for|range|break|continue|return|defer|fallthrough|nil|true|false|iota)\b/g,builtins:/\b(fmt|make|len|cap|append|copy|delete|close|panic|recover|new|error|string|int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|float32|float64|bool|byte|rune|complex64|complex128)\b/g},rs:{keywords:/\b(fn|let|mut|const|pub|mod|use|struct|enum|impl|trait|where|for|loop|while|if|else|match|return|break|continue|move|ref|self|Self|super|crate|as|in|unsafe|async|await|dyn|true|false|Some|None|Ok|Err)\b/g,builtins:/\b(String|Vec|Box|Rc|Arc|Option|Result|HashMap|HashSet|println|eprintln|format|panic|todo|unimplemented|assert|assert_eq|assert_ne|dbg|cfg|derive|macro_rules)\b/g,macros:/(\w+!)/g},java:{keywords:/\b(class|interface|extends|implements|public|private|protected|static|final|abstract|synchronized|volatile|transient|native|new|return|if|else|for|while|do|switch|case|default|break|continue|try|catch|finally|throw|throws|import|package|this|super|void|null|true|false|instanceof)\b/g,builtins:/\b(System|String|Integer|Long|Double|Float|Boolean|List|ArrayList|Map|HashMap|Set|HashSet|Optional|Stream|Object|Exception|RuntimeException|Thread|Runnable|Override|Deprecated)\b/g},cs:{keywords:/\b(class|struct|interface|enum|record|delegate|event|namespace|using|public|private|protected|internal|static|readonly|const|sealed|abstract|virtual|override|new|return|if|else|for|foreach|while|do|switch|case|default|break|continue|try|catch|finally|throw|async|await|yield|var|dynamic|is|as|in|out|ref|params|this|base|null|true|false|void|get|set|init|required|partial|where|select|from|orderby|group|join|let|into)\b/g,builtins:/\b(Console|String|Int32|Int64|Double|Boolean|List|Dictionary|HashSet|Task|IEnumerable|ILogger|IOptions|IFeatures|Exception|Guid|DateTime|TimeSpan|CancellationToken|Action|Func|Span|Memory|ReadOnlySpan)\b/g,attributes:/(\[[\w]+(?:\(.*?\))?\])/g},cpp:{keywords:/\b(class|struct|enum|union|namespace|using|template|typename|public|private|protected|static|const|constexpr|volatile|virtual|override|final|explicit|inline|extern|auto|decltype|new|delete|return|if|else|for|while|do|switch|case|default|break|continue|try|catch|throw|sizeof|alignof|typeid|static_cast|dynamic_cast|reinterpret_cast|const_cast|nullptr|true|false|void|this|operator|friend|noexcept|co_await|co_yield|co_return|concept|requires)\b/g,builtins:/\b(std|string|vector|map|unordered_map|set|array|pair|tuple|shared_ptr|unique_ptr|weak_ptr|optional|variant|any|cout|cin|endl|printf|scanf|malloc|free|sizeof|size_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t)\b/g,preprocessor:/(#\s*(?:include|define|undef|if|ifdef|ifndef|else|elif|endif|pragma|error|warning).*$)/gm},c:"cpp",h:"cpp",hpp:"cpp",html:{tags:/(<\/?[\w-]+|>|\/>)/g,attrs:/\b([\w-]+)(?==)/g,commentType:"html",commentHtml:/(<!--[\s\S]*?-->)/g},xml:"html",svg:"html",css:{selectors:/([\w.#\[\]:,>+~*-]+)\s*\{/g,properties:/\b([\w-]+)(?=\s*:)/g,values:/:\s*([^;{}]+)/g,commentType:"block"},scss:"css",less:"css",json:{keys:/("[\w.-]+")\s*:/g,commentType:"none"},yaml:{keys:/([\w.-]+)\s*:/g,commentType:"hash"},yml:"yaml",md:{headings:/^(#{1,6}\s.*)$/gm,bold:/(\*\*[^*]+\*\*|__[^_]+__)/g,italic:/(\*[^*]+\*|_[^_]+_)/g,code:/(`[^`]+`)/g,links:/(\[[^\]]+\]\([^)]+\))/g,commentType:"none"},sh:{keywords:/\b(if|then|else|elif|fi|for|while|do|done|case|esac|function|return|exit|echo|export|local|readonly|unset|set|shift|eval|exec|trap|source|alias|cd|pwd|ls|mkdir|rm|cp|mv|cat|grep|sed|awk|find|xargs|sort|uniq|wc|head|tail|tee|cut|tr|test)\b/g,variables:/(\$\{?\w+\}?|\$\(|\$\{)/g,commentType:"hash"},bash:"sh",zsh:"sh",sql:{keywords:/\b(SELECT|FROM|WHERE|AND|OR|NOT|IN|LIKE|BETWEEN|JOIN|LEFT|RIGHT|INNER|OUTER|FULL|ON|AS|GROUP|BY|ORDER|HAVING|LIMIT|OFFSET|INSERT|INTO|VALUES|UPDATE|SET|DELETE|CREATE|ALTER|DROP|TABLE|INDEX|VIEW|TRIGGER|FUNCTION|PROCEDURE|BEGIN|END|IF|ELSE|THEN|CASE|WHEN|DECLARE|EXEC|UNION|ALL|DISTINCT|TOP|EXISTS|NULL|IS|ASC|DESC|PRIMARY|KEY|FOREIGN|REFERENCES|CONSTRAINT|DEFAULT|CHECK|UNIQUE|CASCADE|TRUNCATE|COMMIT|ROLLBACK|GRANT|REVOKE)\b/gi,commentType:"both"},lua:{keywords:/\b(and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/g,builtins:/\b(print|type|tostring|tonumber|pairs|ipairs|next|select|unpack|error|pcall|xpcall|assert|require|table|string|math|io|os|coroutine|setmetatable|getmetatable|rawget|rawset)\b/g,commentLine:/(--(?!\[).*$)/gm,commentBlock:/(--\[\[[\s\S]*?\]\])/g},php:{keywords:/\b(function|class|interface|trait|extends|implements|public|private|protected|static|final|abstract|const|var|new|return|if|else|elseif|for|foreach|while|do|switch|case|default|break|continue|try|catch|finally|throw|use|namespace|require|include|require_once|include_once|echo|print|die|exit|null|true|false|array|list|match|fn|yield|from)\b/g,variables:/(\$\w+)/g},swift:{keywords:/\b(func|class|struct|enum|protocol|extension|let|var|guard|if|else|for|while|repeat|switch|case|default|break|continue|return|throw|try|catch|defer|import|typealias|associatedtype|init|deinit|subscript|operator|precedencegroup|self|Self|super|nil|true|false|is|as|in|inout|throws|rethrows|where|some|any|weak|unowned|lazy|mutating|nonmutating|override|final|required|convenience|optional|dynamic|async|await|actor|nonisolated|isolated|sending|consuming|borrowing)\b/g},kt:{keywords:/\b(fun|class|object|interface|val|var|if|else|when|for|while|do|return|break|continue|throw|try|catch|finally|import|package|as|is|in|out|by|init|constructor|companion|data|sealed|enum|abstract|open|override|private|protected|internal|public|inline|reified|suspend|coroutine|null|true|false|this|super|it|typealias|annotation|lateinit|lazy|get|set)\b/g},dart:{keywords:/\b(class|extends|implements|with|mixin|abstract|sealed|base|interface|final|const|var|late|required|dynamic|void|static|return|if|else|for|while|do|switch|case|default|break|continue|try|catch|finally|throw|rethrow|assert|new|this|super|null|true|false|is|as|in|async|await|yield|import|export|library|part|show|hide|deferred|typedef|enum|extension|on)\b/g},r:{keywords:/\b(if|else|for|while|repeat|function|return|break|next|in|TRUE|FALSE|NULL|NA|Inf|NaN|library|require|source|print|cat|paste|paste0|sprintf|stop|warning|message)\b/g,commentType:"hash"},toml:{keys:/([\w.-]+)\s*=/g,sections:/(\[[\w.]+\])/g,commentType:"hash"},proto:{keywords:/\b(syntax|package|import|option|message|enum|service|rpc|returns|repeated|optional|required|map|oneof|reserved|extensions|extend|group|default|packed|deprecated|java_package|java_outer_classname|optimize_for|cc_enable_arenas|objc_class_prefix|csharp_namespace|swift_prefix|php_class_prefix|php_namespace|ruby_package|string|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|float|double|bool|bytes)\b/g}},Me={keyword:"hl-kw",builtin:"hl-bi",string:"hl-st",number:"hl-nm",comment:"hl-cm",operator:"hl-op",decorator:"hl-dc",macro:"hl-mc",preprocessor:"hl-pp",attribute:"hl-at",tag:"hl-tg",property:"hl-pr",variable:"hl-vr",heading:"hl-hd",bold:"hl-bd",link:"hl-lk",key:"hl-ky",section:"hl-sc"}});function _f(e,t,s){let n=[],r=0,i=0;if(t!=null){let p=t.split(`
|
|
1999
1999
|
`);for(let g=0;g<p.length;g++)n.push({type:"addition",oldNum:"",oldText:"",newNum:g+1,newText:p[g]}),r++;return{lines:n,stats:{additions:r,deletions:0},content:t}}if(!e||e.trim()==="")return{lines:[{type:"context",oldNum:"",oldText:s("git.noDiff"),newNum:"",newText:s("git.noDiff")}],stats:{additions:0,deletions:0},content:""};if(e.includes("Binary files")&&e.includes("differ"))return{lines:[{type:"context",oldNum:"",oldText:s("git.binaryFile"),newNum:"",newText:s("git.binaryFile")}],stats:{additions:0,deletions:0},content:e};let o=e.split(`
|
|
2000
2000
|
`),a=0,l=0,c=!1,d=[],u=[],f=()=>{let p=Math.max(d.length,u.length);for(let g=0;g<p;g++){let m=d[g],b=u[g];m&&b?n.push({type:"modification",oldNum:m.num,oldText:m.text,newNum:b.num,newText:b.text}):m?n.push({type:"deletion",oldNum:m.num,oldText:m.text,newNum:"",newText:""}):b&&n.push({type:"addition",oldNum:"",oldText:"",newNum:b.num,newText:b.text})}d=[],u=[]};for(let p of o){if(p.startsWith("diff --git")||p.startsWith("index ")||p.startsWith("---")||p.startsWith("+++")||p.startsWith("\\"))continue;let g=p.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(g){f(),a=parseInt(g[1]),l=parseInt(g[2]),c=!0,n.push({type:"hunk",oldNum:"\xB7\xB7\xB7",oldText:p,newNum:"\xB7\xB7\xB7",newText:p});continue}if(c)if(p.startsWith("-"))u.length>0&&d.length===0&&f(),d.push({num:a++,text:p.substring(1)}),i++;else if(p.startsWith("+"))u.push({num:l++,text:p.substring(1)}),r++;else{f();let m=p.startsWith(" ")?p.substring(1):p;n.push({type:"context",oldNum:a++,oldText:m,newNum:l++,newText:m})}}return f(),{lines:n,stats:{additions:r,deletions:i},content:e}}var Ef=F(()=>{});function Df(e,t){let{effectiveGitWorkDir:s,gitOperating:n,gitOpFeedback:r,commitMessage:i}=t,o=null,a=null,l=(w,v)=>{o&&clearTimeout(o),r.value={ok:w,message:v},o=setTimeout(()=>{r.value=null},4e3)},c=(w,v)=>{e.currentAgent&&(w.value=!0,v.value="",e.sendWsMessage({type:"git_status",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:s.value,_clientId:e.clientId}))},d=(w,v={})=>{e.currentAgent&&(n.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{n.value&&(n.value=!1,l(!1,"Operation timed out"))},15e3),e.sendWsMessage({type:w,conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:s.value,_clientId:e.clientId,...v}))};return{showFeedback:l,loadGitStatus:c,gitOp:d,stageFile:w=>d("git_add",{filePath:w}),unstageFile:w=>d("git_reset",{filePath:w}),discardFile:w=>{confirm("Discard changes to "+w+"?")&&d("git_restore",{filePath:w})},stageAll:()=>d("git_add",{addAll:!0}),unstageAll:()=>d("git_reset",{resetAll:!0}),commitChanges:()=>{let w=i.value.trim();w&&d("git_commit",{commitMessage:w})},pushChanges:()=>d("git_push"),handleGitOpResult:(w,v)=>{n.value=!1,a&&(clearTimeout(a),a=null),w.success?(l(!0,w.message||w.operation+" succeeded"),w.operation==="commit"&&(i.value=""),v()):l(!1,w.error||w.operation+" failed")},cleanup:()=>{o&&clearTimeout(o),a&&clearTimeout(a)}}}var Lf=F(()=>{});function $f(e,t){let s=Vue.ref(!1),n=Vue.ref(""),r=Vue.ref([]),i=Vue.ref(!1),o=Vue.ref(""),a=g=>{i.value=!0,o.value="",e.sendWsMessage({type:"list_directory",conversationId:"_git_folder_picker",agentId:e.currentAgent,dirPath:g,workDir:t.value,_clientId:e.clientId})};return{folderPickerOpen:s,folderPickerPath:n,folderPickerEntries:r,folderPickerLoading:i,folderPickerSelected:o,openFolderPicker:()=>{s.value=!0,o.value="",i.value=!0;let g=t.value||"";n.value=g,r.value=[],e.sendWsMessage({type:"list_directory",conversationId:"_git_folder_picker",agentId:e.currentAgent,dirPath:g,workDir:t.value,_clientId:e.clientId})},folderPickerNavigateUp:()=>{if(!n.value)return;let g=n.value.includes("\\"),m=g?"\\":"/",b=n.value.replace(/[/\\]$/,"").split(/[/\\]/);if(b.pop(),b.length===0)n.value="",a("");else if(g&&b.length===1&&/^[A-Za-z]:$/.test(b[0]))n.value=b[0]+"\\",a(b[0]+"\\");else{let I=b.join(m);n.value=I,a(I)}},folderPickerSelectItem:g=>{o.value=g.name},folderPickerEnter:g=>{let m=n.value.includes("\\")||/^[A-Z]:/.test(g.name)?"\\":"/",b;n.value?b=n.value.replace(/[/\\]$/,"")+m+g.name:b=g.name+(g.name.endsWith("\\")?"":"\\"),n.value=b,a(b)},confirmFolderPicker:(g,m)=>{let b=n.value;if(b){if(o.value){let I=b.includes("\\")?"\\":"/";b=b.replace(/[/\\]$/,"")+I+o.value}g.value=b,s.value=!1,m()}},handleDirectoryListing:g=>g.conversationId!=="_git_folder_picker"?!1:(i.value=!1,r.value=(g.entries||[]).filter(m=>m.type==="directory").sort((m,b)=>m.name.localeCompare(b.name)),g.dirPath!=null&&(n.value=g.dirPath),!0)}}var Vf=F(()=>{});var Hf,Of=F(()=>{ml();Rf();Ef();Lf();Vf();Hf={name:"GitStatusTab",template:`
|
|
2001
2001
|
<div class="git-status-tab git-three-col">
|
|
@@ -2241,7 +2241,7 @@ ${String(e||"").trim()}
|
|
|
2241
2241
|
</div>
|
|
2242
2242
|
</div>
|
|
2243
2243
|
</div>
|
|
2244
|
-
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=O=>O.split(/[/\\]/).pop()||O,n=O=>{let D=O.split(/[/\\]/);return D.pop(),D.join("/")},r=O=>Vi(s(O)),i=Vue.ref(null),o=Vue.reactive({staged:!1,modified:!1,untracked:!1}),a=O=>{o[O]=!o[O]},l=Vue.ref(!1),c=Vue.ref(""),d=Vue.ref(null),u=Vue.ref([]),f=Vue.computed(()=>e.effectiveWorkDir||""),p=Vue.ref(""),g=Vue.computed(()=>p.value.trim()||f.value),m=Vue.ref(null),b=Vue.ref(!1),I=Vue.ref(!1),y=Vue.ref(""),S=Vue.ref(null),w=Vue.ref([]),v=Vue.ref(null),h=Vue.ref(!0),M=Vue.ref(!1),x=Vue.ref(""),E=Vue.ref(null),V=Vue.ref(0),L=Vue.ref(0),R=O=>O==null||O===""?"":Pf(O,m.value||""),P=Vue.ref(parseInt(localStorage.getItem("gitDiffFontSize"))||12),A=O=>{P.value=Math.max(8,Math.min(24,O)),localStorage.setItem("gitDiffFontSize",P.value.toString())},_=()=>A(P.value+1),j=()=>A(P.value-1),B=O=>{O.deltaY<0?_():O.deltaY>0&&j()},z=Vue.computed(()=>{let O=w.value;if(!O||O.length===0)return[];let D=O.length,Z=[],ne=0;for(;ne<D;){let ye=O[ne];if(ye.type==="addition"||ye.type==="deletion"||ye.type==="modification"){let Y=ye.type==="modification"?"modification":ye.type,ee=ne;for(;ne<D&&(O[ne].type===Y||O[ne].type==="modification"&&Y!=="modification");)ne++;let ue=ne-ee;Z.push({type:Y,top:ee/D*100,height:Math.max(ue/D*100,.5)})}else ne++}return Z}),se=O=>{let D=i.value;if(!D)return;let Z=O.currentTarget.getBoundingClientRect(),ne=(O.clientY-Z.top)/Z.height;D.scrollTop=ne*(D.scrollHeight-D.clientHeight)},me=Vue.computed(()=>u.value.filter(O=>O.indexStatus!==" "&&O.indexStatus!=="?")),ae=Vue.computed(()=>u.value.filter(O=>O.workTreeStatus==="M"||O.workTreeStatus==="D")),ve=Vue.computed(()=>u.value.filter(O=>O.indexStatus==="?"&&O.workTreeStatus==="?")),ge=Df(e,{effectiveGitWorkDir:g,gitOperating:M,gitOpFeedback:E,commitMessage:x}),pe=()=>ge.loadGitStatus(l,c),T=()=>{pe()},K=$f(e,g),re=O=>Hi(O),he=()=>K.confirmFolderPicker(p,pe),Pe=(O,D)=>{m.value=O.path,b.value=D,I.value=!0,y.value="",S.value=null,w.value=[],v.value=null;let Z=O.indexStatus==="?"&&O.workTreeStatus==="?";e.sendWsMessage({type:"git_diff",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:g.value,filePath:O.path,staged:D,untracked:Z,fullFile:h.value,_clientId:e.clientId})},U=()=>{if(h.value=!h.value,m.value){let O=u.value.find(D=>D.path===m.value);O&&Pe(O,b.value)}},q=O=>{let D=O.detail;if(D)switch(D.type){case"directory_listing":{if(K.handleDirectoryListing(D))return;break}case"git_status_result":{if(l.value=!1,D.error){c.value=D.error,d.value=null,u.value=[];return}if(c.value="",d.value=D.branch||"HEAD",u.value=D.files||[],V.value=D.ahead||0,L.value=D.behind||0,m.value){let Z=u.value.find(ne=>ne.path===m.value);if(Z){let ne=Z.indexStatus!==" "&&Z.indexStatus!=="?";b.value=ne}else m.value=null,S.value=null,w.value=[],v.value=null}break}case"git_diff_result":{if(I.value=!1,D.error){y.value=D.error;return}y.value="";let Z=_f(D.diff,D.newFileContent,t);v.value=Z.stats,w.value=Z.lines,S.value=Z.content;break}case"git_op_result":{ge.handleGitOpResult(D,pe);break}}};Vue.watch(()=>e.currentAgent,()=>{d.value=null,u.value=[],c.value="",m.value=null,S.value=null,e.currentAgent&&Vue.nextTick(()=>pe())}),Vue.watch(()=>e.currentConversation,()=>{e.currentAgent&&(m.value=null,S.value=null,w.value=[],v.value=null,Vue.nextTick(()=>pe()))});let N=()=>pe();return Vue.onMounted(()=>{window.addEventListener("workbench-message",q),e.currentAgent&&pe()}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",q),ge.cleanup()}),{store:e,getFileName:s,getDirName:n,getFileIconHtml:r,hlLine:R,collapsedGroups:o,toggleGroup:a,gitLoading:l,gitError:c,gitBranch:d,gitFiles:u,gitWorkDir:p,defaultWorkDir:f,changeGitWorkDir:T,stagedFiles:me,modifiedFiles:ae,untrackedFiles:ve,selectedGitFile:m,selectedStaged:b,diffLoading:I,diffError:y,diffContent:S,diffLines:w,diffStats:v,diffFullFile:h,toggleDiffMode:U,scrollMarkers:z,diffScrollContainer:i,onMarkerClick:se,fontSize:P,zoomIn:_,zoomOut:j,onWheel:B,gitOperating:M,commitMessage:x,gitOpFeedback:E,gitAhead:V,gitBehind:L,stageFile:ge.stageFile,unstageFile:ge.unstageFile,discardFile:ge.discardFile,stageAll:ge.stageAll,unstageAll:ge.unstageAll,commitChanges:ge.commitChanges,pushChanges:ge.pushChanges,selectGitFile:Pe,refresh:N,folderPickerOpen:K.folderPickerOpen,folderPickerPath:K.folderPickerPath,folderPickerEntries:K.folderPickerEntries,folderPickerLoading:K.folderPickerLoading,folderPickerSelected:K.folderPickerSelected,getFolderIcon:re,openFolderPicker:K.openFolderPicker,folderPickerNavigateUp:K.folderPickerNavigateUp,folderPickerSelectItem:K.folderPickerSelectItem,folderPickerEnter:K.folderPickerEnter,confirmFolderPicker:he}}}});function Ff(e){let t=Vue.ref(!1),s=Vue.ref(!1),n=Vue.ref(""),r=Vue.ref(""),i=Vue.ref(!1),o=Vue.ref(!1),a=Vue.ref(0),l=Vue.ref(-1),c=Vue.ref(null),d=Vue.ref(null),u=[],f=[],p=()=>{let V=e.value?.cmInstance;if(!V)return;let R=V.getWrapperElement().querySelector(".cm-find-scrollbar-annotations");R&&R.remove()},g=()=>{let V=e.value?.cmInstance;if(!V||f.length===0)return;p();let L=V.getWrapperElement();if(!L.querySelector(".CodeMirror-vscrollbar"))return;let P=V.lineCount();if(P===0)return;let A=document.createElement("div");A.className="cm-find-scrollbar-annotations";for(let _ of f){let j=_.from.line/P*100,B=document.createElement("div");B.className="cm-find-scrollbar-tick",B.style.top=j+"%",A.appendChild(B)}L.appendChild(A)},m=()=>{for(let V of u)try{V.clear()}catch{}u=[],f=[],a.value=0,l.value=-1,p()},b=V=>{let L=e.value?.cmInstance;if(!L||!f[V])return;for(let P=0;P<u.length;P++){if(!u[P])continue;let A=u[P].find();A&&(u[P].clear(),u[P]=L.markText(A.from,A.to,{className:"cm-find-highlight"}))}let R=f[V];if(u[V]){let P=u[V].find();P&&(u[V].clear(),u[V]=L.markText(P.from,P.to,{className:"cm-find-highlight cm-find-current"}))}setTimeout(()=>{L.scrollIntoView({from:R.from,to:R.to},100)},0)},I=()=>{m();let V=e.value?.cmInstance;if(!V||!n.value)return;let L=n.value;if(L.length<3)return;let R=V.getValue(),P=i.value,A=o.value,_=[];try{if(A){let j=P?"g":"gi",B=new RegExp(L,j),z;for(;(z=B.exec(R))!==null;){if(z[0].length===0){B.lastIndex++;continue}let se=V.posFromIndex(z.index),me=V.posFromIndex(z.index+z[0].length);if(_.push({from:se,to:me}),_.length>1e4)break}}else{let j=P?L:L.toLowerCase(),B=P?R:R.toLowerCase(),z=0;for(;(z=B.indexOf(j,z))!==-1;){let se=V.posFromIndex(z),me=V.posFromIndex(z+L.length);if(_.push({from:se,to:me}),z+=L.length,_.length>1e4)break}}}catch{return}f=_,a.value=_.length;for(let j of _)u.push(V.markText(j.from,j.to,{className:"cm-find-highlight"}));if(_.length>0){let j=V.getCursor(),B=0;for(let z=0;z<_.length;z++){if(CodeMirror.cmpPos(_[z].from,j)>=0){B=z;break}z===_.length-1&&(B=0)}l.value=B,b(B)}g()};return{findBarVisible:t,replaceBarVisible:s,findQuery:n,replaceQuery:r,findCaseSensitive:i,findUseRegex:o,findMatchCount:a,findMatchIndex:l,findInputRef:c,replaceInputRef:d,clearFindMarkers:m,performFind:I,onFindInput:()=>{I()},findNext:()=>{if(f.length===0)return;let V=(l.value+1)%f.length;l.value=V,b(V)},findPrev:()=>{if(f.length===0)return;let V=(l.value-1+f.length)%f.length;l.value=V,b(V)},openFindBar:(V=!1)=>{t.value=!0,s.value=V;let L=e.value?.cmInstance;if(L){let R=L.getSelection();R&&(n.value=R)}Vue.nextTick(()=>{c.value?.focus(),c.value?.select(),n.value&&I()})},closeFindBar:()=>{m(),t.value=!1,s.value=!1;let V=e.value?.cmInstance;V&&V.focus()},toggleReplaceBar:()=>{s.value=!s.value,s.value&&Vue.nextTick(()=>d.value?.focus())},replaceOne:()=>{let V=e.value?.cmInstance;if(!V||f.length===0||l.value<0)return;let L=f[l.value];V.replaceRange(r.value,L.from,L.to),I()},replaceAll:()=>{let V=e.value?.cmInstance;!V||f.length===0||(V.operation(()=>{for(let L=f.length-1;L>=0;L--)V.replaceRange(r.value,f[L].from,f[L].to)}),I())}}}var Nf=F(()=>{});function qf(e,t){let{getEffectiveWorkDir:s,treePath:n}=t,r=Vue.reactive(new Set),i=Vue.ref(-1),o=Vue.ref(!1),a=Vue.ref(null),l=null,c=null,d=Vue.ref(!1),u=Vue.ref(""),f=Vue.ref("file"),p=Vue.ref(null),g=Vue.ref(!1),m=Vue.ref(""),b=Vue.ref(null),I=Vue.reactive({visible:!1,x:0,y:0,entry:null}),y=Vue.ref(!1),S=Vue.ref(""),w=Vue.ref(null),v=null,h=Vue.reactive({dragging:null,dropTarget:null}),M=Vue.ref(!1),x=(Y,ee)=>{l&&clearTimeout(l),a.value={ok:Y,message:ee},l=setTimeout(()=>{a.value=null},4e3)},E=()=>{o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,x(!1,"Operation timed out"))},15e3)},V=Y=>{r.has(Y)?r.delete(Y):r.add(Y)},L=()=>{r.clear(),i.value=-1},R=Y=>{f.value=Y,u.value="",d.value=!0,Vue.nextTick(()=>p.value?.focus())},P=()=>{let Y=u.value.trim();if(!Y)return;d.value=!1;let ee=n.value||s();if(!ee)return;let ue=ee.includes("\\")?"\\":"/",le=ee.replace(/[/\\]$/,"")+ue+Y;E(),e.sendWsMessage({type:"create_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:le,isDirectory:f.value==="directory",workDir:s(),_clientId:e.clientId})},A=(Y,ee)=>{let ue=Y.path.split("/").pop();confirm(ee("files.deleteConfirm",{name:ue})+(Y.type==="directory"?ee("files.deleteDirHint"):""))&&(E(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[Y.path],workDir:s(),_clientId:e.clientId}))},_=Y=>{let ee=r.size;ee!==0&&confirm(Y("files.deleteSelectedConfirm",{count:ee}))&&(E(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...r],workDir:s(),_clientId:e.clientId}))},j=()=>{m.value=n.value||s()||"",g.value=!0,Vue.nextTick(()=>b.value?.focus())},B=()=>{let Y=m.value.trim();!Y||r.size===0||(g.value=!1,E(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...r],destination:Y,workDir:s(),_clientId:e.clientId}))},z=(Y,ee)=>{let Ce=Y.clientX,xe=Y.clientY;Ce+180>window.innerWidth&&(Ce=window.innerWidth-180),xe+240>window.innerHeight&&(xe=window.innerHeight-240),I.entry=ee,I.x=Ce,I.y=xe,I.visible=!0},se=()=>{I.visible=!1};return{selectedPaths:r,lastClickedIndex:i,fileOperating:o,fileOpFeedback:a,newFileDialogVisible:d,newFileName:u,newFileType:f,newFileInput:p,moveDialogVisible:g,moveDestination:m,moveDestInput:b,contextMenu:I,renameDialogVisible:y,renameNewName:S,renameInput:w,dragState:h,externalDropActive:M,showFileOpFeedback:x,toggleSelection:V,clearSelection:L,showNewFileDialog:R,confirmNewFile:P,deleteSingleFile:A,deleteSelected:_,openMoveDialog:j,confirmMove:B,showContextMenu:z,hideContextMenu:se,ctxRename:()=>{let Y=I.entry;se(),Y&&(S.value=Y.name,y.value=!0,Vue.nextTick(()=>{let ee=w.value;if(ee)if(ee.focus(),Y.type==="file"){let ue=Y.name.lastIndexOf(".");ue>0?ee.setSelectionRange(0,ue):ee.select()}else ee.select()}))},confirmRename:()=>{let Y=I.entry,ee=S.value.trim();if(!ee||!Y||ee===Y.name){y.value=!1;return}y.value=!1;let ue=Y.path.replace(/\/$/,"").split("/");ue.pop();let le=ue.join("/")||"/";E(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[Y.path],destination:le,newName:ee,workDir:s(),_clientId:e.clientId})},ctxCopy:()=>{let Y=I.entry;if(se(),!Y)return;let ee=Y.path.replace(/\/$/,"").split("/");ee.pop();let ue=ee.join("/")||"/";E(),e.sendWsMessage({type:"copy_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[Y.path],destination:ue,workDir:s(),_clientId:e.clientId})},ctxMoveTo:()=>{let Y=I.entry;se(),Y&&(r.clear(),r.add(Y.path),j())},ctxDelete:Y=>{let ee=I.entry;se(),ee&&A(ee,Y)},ctxDownload:()=>{let Y=I.entry;se(),!(!Y||Y.type!=="file")&&(v=Y.path,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:Y.path,workDir:s(),_clientId:e.clientId}))},onDragStart:(Y,ee)=>{h.dragging=ee,Y.dataTransfer.setData("text/plain",ee.path),Y.dataTransfer.effectAllowed="move"},onDragOver:(Y,ee)=>{if(!h.dragging&&Y.dataTransfer.types.includes("Files")){ee.type==="directory"&&(Y.dataTransfer.dropEffect="copy",h.dropTarget=ee.path);return}!h.dragging||ee.type!=="directory"||ee.path!==h.dragging.path&&(ee.path.startsWith(h.dragging.path+"/")||(Y.dataTransfer.dropEffect="move",h.dropTarget=ee.path))},onDragLeave:Y=>{let ee=Y.relatedTarget;ee&&Y.currentTarget.contains(ee)||(h.dropTarget=null)},onDrop:(Y,ee,ue)=>{if(h.dropTarget=null,!h.dragging&&Y.dataTransfer.files.length>0&&ee.type==="directory"){ue(Y.dataTransfer.files,ee.path);return}if(!h.dragging||ee.type!=="directory"){h.dragging=null;return}if(ee.path===h.dragging.path){h.dragging=null;return}E(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[h.dragging.path],destination:ee.path,workDir:s(),_clientId:e.clientId}),h.dragging=null},onTreeDragOver:Y=>{h.dragging||Y.dataTransfer.types.includes("Files")&&(Y.dataTransfer.dropEffect="copy",M.value=!0)},onTreeDragLeave:Y=>{let ee=Y.relatedTarget;ee&&Y.currentTarget.contains(ee)||(M.value=!1)},onTreeDrop:(Y,ee,ue)=>{if(M.value=!1,!h.dragging&&Y.dataTransfer.files.length>0){let le=n.value||ee||s();ue(Y.dataTransfer.files,le)}},handleExternalFileDrop:async(Y,ee)=>{if(!ee)return;let ue=[],le=[];for(let Ce of Y)le.push(new Promise(xe=>{let $e=new FileReader;$e.onload=()=>{let je=btoa(new Uint8Array($e.result).reduce((yt,bt)=>yt+String.fromCharCode(bt),""));ue.push({name:Ce.name,data:je}),xe()},$e.onerror=()=>xe(),$e.readAsArrayBuffer(Ce)}));await Promise.all(le),ue.length!==0&&(o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,x(!1,"Upload timed out"))},3e4),e.sendWsMessage({type:"upload_to_dir",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,files:ue,dirPath:ee,workDir:s(),_clientId:e.clientId}))},handleFileOpResult:(Y,ee,ue)=>{o.value=!1,c&&(clearTimeout(c),c=null),x(Y.success,Y.success?Y.message:Y.error||"Operation failed"),Y.success&&(ue&&ee(ue),(Y.operation==="delete"||Y.operation==="move")&&(r.clear(),i.value=-1))},getPendingDownload:()=>v,clearPendingDownload:()=>{v=null},cleanup:()=>{l&&clearTimeout(l),c&&clearTimeout(c)}}}var Bf=F(()=>{});function Wf(e,{getEffectiveWorkDir:t,normalizePath:s,selectedPaths:n,lastClickedIndex:r,openFileInTab:i,clearSelection:o}){let a=Vue.ref(""),l=Vue.ref(""),c=Vue.reactive({}),d=Vue.ref(!1),u=Vue.ref(null),f=Vue.computed(()=>{if(!l.value)return"EXPLORER";let R=l.value.replace(/[\\/]+$/,"").split(/[\\/]/);return(R[R.length-1]||l.value).toUpperCase()}),p=Vue.computed(()=>l.value?!!c[l.value]?.expanded:!1),g=()=>{if(!l.value)return;let R=c[l.value];R&&(R.expanded=!R.expanded)},m=()=>{for(let R of Object.keys(c))c[R]&&(c[R].expanded=!1)},b=()=>{d.value=!0,Vue.nextTick(()=>u.value?.focus())},I=()=>{d.value=!1,v()},y=()=>{d.value=!1},S=Vue.computed(()=>{let R=[],P=(A,_)=>{let j=c[A];if(!(!j||!j.entries))for(let B of j.entries)R.push({...B,depth:_}),B.type==="directory"&&c[B.path]?.expanded&&P(B.path,_+1)};return l.value&&c[l.value]?.expanded&&P(l.value,0),R}),w=R=>{let P=s(R);c[P]?c[P].loading=!0:c[P]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:R,workDir:t(),_clientId:e.clientId})},v=()=>{let R=a.value.trim();if(!R)return;let P=s(R);l.value=P,Object.keys(c).forEach(A=>delete c[A]),c[P]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:R,workDir:t(),_clientId:e.clientId})},h=R=>{let P=s(R),A=c[P];A?A.loaded?A.expanded=!A.expanded:(A.expanded=!0,w(R)):(c[P]={entries:[],expanded:!0,loaded:!1,loading:!1},w(R))},M=(R,P)=>{let A=S.value,_=A.findIndex(j=>j.path===R.path);if(P&&(P.shiftKey||P.ctrlKey||P.metaKey)){if(P.shiftKey&&r.value>=0&&_>=0){let j=Math.min(r.value,_),B=Math.max(r.value,_);!P.ctrlKey&&!P.metaKey&&n.clear();for(let z=j;z<=B;z++)n.add(A[z].path)}else n.has(R.path)?n.delete(R.path):n.add(R.path);r.value=_;return}n.size>0&&(n.clear(),r.value=-1),R.type==="directory"?h(R.path):i(R.path,R.name),r.value=_},x=R=>{let P=s(R.dirPath);if(R.error){c[P]&&(c[P].loading=!1);return}let A=(R.entries||[]).sort((B,z)=>B.type===z.type?B.name.localeCompare(z.name):B.type==="directory"?-1:1),_=P.replace(/\/$/,""),j=A.map(B=>({...B,path:_+"/"+B.name}));c[P]?(c[P].entries=j,c[P].loaded=!0,c[P].loading=!1):c[P]={entries:j,expanded:!0,loaded:!0,loading:!1},P===l.value&&(a.value=R.dirPath)},E=()=>{Object.keys(c).forEach(R=>delete c[R])};return{treePath:a,treeRootPath:l,treeNodes:c,flattenedTree:S,editingTreePath:d,treePathInputRef:u,rootFolderName:f,rootExpanded:p,toggleRootExpand:g,collapseAll:m,startTreePathEdit:b,confirmTreePath:I,cancelTreePathEdit:y,loadTreeDirectory:w,loadRootDirectory:v,toggleDirectory:h,onTreeItemClick:M,handleDirectoryListing:x,clearTreeNodes:E,initFileBrowser:()=>{let R=t();if(R){let P=s(R);a.value=R,l.value=P,E(),w(R)}},refresh:()=>{l.value&&w(l.value)}}}var jf=F(()=>{});function cn(e){let t=e.lastIndexOf(".");if(t<0)return"text";let s=e.substring(t).toLowerCase();return Xy.has(s)?"office":Zy.has(s)?"pdf":Jy.has(s)?"image":"text"}function Bt(e){let t=e.lastIndexOf(".");return t<0?!1:eb.has(e.substring(t).toLowerCase())}function tb(e){let t=e.split(".").pop()?.toLowerCase();return{js:"javascript",mjs:"javascript",jsx:"javascript",ts:{name:"javascript",typescript:!0},tsx:{name:"javascript",typescript:!0},json:{name:"javascript",json:!0},py:"python",html:"htmlmixed",htm:"htmlmixed",vue:"htmlmixed",xml:"xml",svg:"xml",css:"css",scss:"css",less:"css",sh:"shell",bash:"shell",zsh:"shell",c:"text/x-csrc",h:"text/x-csrc",cpp:"text/x-c++src",hpp:"text/x-c++src",cs:"text/x-csharp",java:"text/x-java",md:"markdown",markdown:"markdown"}[t]||"text/plain"}function Uf(e,{activeFile:t,editorContainer:s,fontSize:n,clearFindMarkers:r,openFindBar:i,saveFile:o}){let a=Vue.ref(""),l=Vue.reactive({}),c=()=>{},d=()=>{},u=({openQuickOpen:y,openGoToLine:S})=>{c=y,d=S},f=(y,S=0)=>{if(!s.value){S<20&&setTimeout(()=>f(y,S+1),100);return}if(!y)return;if(s.value.innerHTML="",typeof CodeMirror>"u"){let h=document.createElement("textarea");h.value=y.content||"",h.style.cssText="width:100%;height:100%;border:none;outline:none;resize:none;padding:12px;font-family:monospace;font-size:12px;background:var(--bg-main);color:var(--text-main);white-space:pre;tab-size:4;",h.spellcheck=!1,h.addEventListener("input",()=>{y.content=h.value,y.isDirty=h.value!==y.originalContent}),h.addEventListener("keydown",M=>{(M.ctrlKey||M.metaKey)&&M.key==="s"&&(M.preventDefault(),o())}),s.value.appendChild(h),a.value="";return}let v=document.documentElement.getAttribute("data-theme")==="dark"?"material-darker":"default";try{let h=CodeMirror(s.value,{value:y.content||"",mode:tb(y.name),theme:v,lineNumbers:!0,tabSize:4,indentWithTabs:!1,lineWrapping:!1,readOnly:!1,extraKeys:{"Ctrl-S":()=>o(),"Cmd-S":()=>o(),"Ctrl-P":()=>c(),"Cmd-P":()=>c(),"Ctrl-G":()=>d(),"Cmd-G":()=>d(),"Ctrl-F":()=>i(!1),"Cmd-F":()=>i(!1),"Ctrl-R":()=>i(!0),"Cmd-R":()=>i(!0),"Ctrl-H":()=>i(!0),"Cmd-H":()=>i(!0)}});h.on("change",()=>{let x=h.getValue();y.content=x,y.isDirty=x!==y.originalContent}),y.cmInstance=h,h.getWrapperElement().style.fontSize=n.value+"px";let M=e.currentConversation;M&&l[M]?.[y.path]&&h.setHistory(l[M][y.path]),Vue.nextTick(()=>{h.refresh(),setTimeout(()=>h.refresh(),200)}),a.value=""}catch(h){a.value=`Editor error: ${h.message}`}};return{debugStatus:a,undoHistoryMap:l,createEditor:f,destroyEditor:()=>{r();let y=t.value;y?.cmInstance&&(y.cmInstance.toTextArea&&y.cmInstance.toTextArea(),y.cmInstance=null),s.value&&(s.value.innerHTML="")},setKeyBindings:u,saveCurrentUndoHistory:()=>{let y=e.currentConversation;if(!y)return;let S=t.value;S?.cmInstance&&(l[y]||(l[y]={}),l[y][S.path]=S.cmInstance.getHistory())},saveAllUndoHistory:y=>{if(!y)return;let S=t.value;S?.cmInstance&&(l[y]||(l[y]={}),l[y][S.path]=S.cmInstance.getHistory())},cleanupUndoHistory:(y,S)=>{y&&l[y]&&delete l[y][S]},deleteConversationHistory:y=>{delete l[y]}}}var Xy,Zy,Jy,eb,mr=F(()=>{Xy=new Set([".docx",".xlsx",".xls",".pptx",".ppt"]),Zy=new Set([".pdf"]),Jy=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico"]),eb=new Set([".md",".markdown",".mdx"])});function Kf(e,{editorContainer:t,createEditor:s,t:n}){let r=Vue.ref(!0),i=Vue.ref(null),o=Vue.ref(null),a=Vue.computed(()=>{let p=e.value;return!!(p&&Bt(p.name))}),l=Vue.computed(()=>{let p=e.value;if(!p||!Bt(p.name)||p.content==null)return"";try{if(typeof marked<"u")return marked.parse(p.content)}catch{}return"<pre>"+(p.content||"")+"</pre>"});function c(){ot(i.value)}async function d(){await ot(i.value)}function u(){r.value=!1,Vue.nextTick(()=>{let p=e.value;p&&t.value&&s(p)})}return{mdPreviewMode:r,mdPreviewRef:i,officePreviewContainer:o,isActiveMarkdown:a,mdRenderedHtml:l,initMermaid:c,renderMermaidBlocks:d,switchToMdEdit:u,renderOfficeLocal:p=>{let g=o.value;if(!g||!p._arrayBuffer)return;g.innerHTML="";let m=("."+p.name.split(".").pop()).toLowerCase();if(m===".docx"&&window.docx)window.docx.renderAsync(p._arrayBuffer,g,null,{className:"docx-preview-content",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!0}).catch(b=>{p.previewError=b.message});else if(m===".xlsx"||m===".xls")try{let b=XLSX.read(p._arrayBuffer,{type:"array"}),I=b.SheetNames[0],y=XLSX.utils.sheet_to_html(b.Sheets[I],{editable:!1});g.innerHTML='<div class="xlsx-sheet-tabs">'+b.SheetNames.map((S,w)=>`<button class="xlsx-sheet-tab${w===0?" active":""}" data-idx="${w}">${S}</button>`).join("")+'</div><div class="xlsx-table-wrap">'+y+"</div>",g.querySelectorAll(".xlsx-sheet-tab").forEach(S=>{S.addEventListener("click",()=>{let w=parseInt(S.dataset.idx),v=b.SheetNames[w],h=XLSX.utils.sheet_to_html(b.Sheets[v],{editable:!1});g.querySelector(".xlsx-table-wrap").innerHTML=h,g.querySelectorAll(".xlsx-sheet-tab").forEach(M=>M.classList.remove("active")),S.classList.add("active")})})}catch(b){p.previewError=b.message}else(m===".pptx"||m===".ppt")&&(g.innerHTML='<div class="preview-unsupported">'+(n?n("files.pptxNotSupported"):"PowerPoint preview not supported")+"</div>")}}}var zf=F(()=>{ar();mr()});function Yf(e,{getEffectiveWorkDir:t,treePath:s,openFileInTab:n,normalizePath:r,treeRootPath:i,treeNodes:o,loadTreeDirectory:a}){let l=Vue.ref(""),c=Vue.ref([]),d=Vue.ref(!1),u=null,f=Vue.ref(!1),p=Vue.ref(""),g=Vue.ref([]),m=Vue.ref(0),b=Vue.ref(!1),I=Vue.ref(null),y=null,S=Vue.ref(!1),w=Vue.ref(""),v=Vue.ref(null),h=ae=>{!e.currentAgent||!ae.trim()||e.sendWsMessage({type:"file_search",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,query:ae.trim(),dirPath:s.value||t()||"",_clientId:e.clientId})},M=()=>{if(u&&clearTimeout(u),!l.value.trim()){c.value=[],d.value=!1;return}d.value=!0,u=setTimeout(()=>{h(l.value)},300)},x=()=>{l.value="",c.value=[],d.value=!1},E=ae=>{if(ae.type==="directory"){let ve=r(ae.fullPath);i.value=ve,s.value=ae.fullPath,Object.keys(o).forEach(ge=>delete o[ge]),a(ae.fullPath),x()}else n(ae.fullPath,ae.name),x()},V=()=>{f.value=!0,p.value="",g.value=[],m.value=0,b.value=!1,Vue.nextTick(()=>I.value?.focus())},L=()=>{f.value=!1,p.value="",g.value=[]},R=()=>{if(y&&clearTimeout(y),!p.value.trim()){g.value=[],b.value=!1;return}b.value=!0,m.value=0,y=setTimeout(()=>{h(p.value)},200)},P=()=>{g.value.length>0&&(m.value=(m.value+1)%g.value.length)},A=()=>{g.value.length>0&&(m.value=(m.value-1+g.value.length)%g.value.length)},_=ae=>{ae.type!=="directory"&&n(ae.fullPath,ae.name),L()},j=()=>{let ae=g.value[m.value];ae&&_(ae)},B=()=>{S.value=!0,w.value="",Vue.nextTick(()=>v.value?.focus())},z=()=>{S.value=!1,w.value=""};return{searchQuery:l,searchResults:c,searchLoading:d,onSearchInput:M,clearSearch:x,onSearchResultClick:E,quickOpenVisible:f,quickOpenQuery:p,quickOpenResults:g,quickOpenSelectedIndex:m,quickOpenLoading:b,quickOpenInput:I,openQuickOpen:V,closeQuickOpen:L,onQuickOpenInput:R,quickOpenSelectNext:P,quickOpenSelectPrev:A,quickOpenConfirm:j,quickOpenOpenFile:_,goToLineVisible:S,goToLineValue:w,goToLineInput:v,openGoToLine:B,closeGoToLine:z,goToLineConfirm:ae=>{let ve=parseInt(w.value);if(isNaN(ve)||ve<1)return;let ge=ae.value;if(ge?.cmInstance){let pe=ge.cmInstance,T=Math.min(ve-1,pe.lineCount()-1);pe.setCursor({line:T,ch:0}),pe.scrollIntoView({line:T,ch:0},100),pe.focus()}z()},handleFileSearchResult:ae=>{let ve=ae.results||[];f.value?ae.query&&ae.query.trim()===p.value.trim()&&(g.value=ve,b.value=!1,m.value=0):ae.query&&ae.query.trim()===l.value.trim()&&(c.value=ve,d.value=!1)}}}var Gf=F(()=>{});function Qf(e,{getEffectiveWorkDir:t,treePath:s,treeRootPath:n,treeNodes:r,normalizePath:i,loadTreeDirectory:o}){let a=Vue.ref(!1),l=Vue.ref(""),c=Vue.ref([]),d=Vue.ref(!1),u=Vue.ref(""),f=()=>{a.value=!0,u.value="",d.value=!0;let S=s.value||t()||"";l.value=S,c.value=[],e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})},p=S=>{d.value=!0,u.value="",e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})};return{folderPickerOpen:a,folderPickerPath:l,folderPickerEntries:c,folderPickerLoading:d,folderPickerSelected:u,openFolderPicker:f,folderPickerNavigateUp:()=>{if(!l.value)return;let S=l.value.includes("\\"),w=S?"\\":"/",v=l.value.replace(/[/\\]$/,"").split(/[/\\]/);if(v.pop(),v.length===0)l.value="",p("");else if(S&&v.length===1&&/^[A-Za-z]:$/.test(v[0]))l.value=v[0]+"\\",p(v[0]+"\\");else{let h=v.join(w);l.value=h,p(h)}},folderPickerSelectItem:S=>{u.value=S.name},folderPickerEnter:S=>{let w;if(!l.value)w=S.name+(S.name.endsWith("\\")?"":"\\");else{let v=l.value.includes("\\")||/^[A-Z]:/.test(S.name)?"\\":"/";w=l.value.replace(/[/\\]$/,"")+v+S.name}l.value=w,p(w)},confirmFolderPicker:()=>{let S=l.value;if(!S)return;if(u.value){let v=S.includes("\\")?"\\":"/";S=S.replace(/[/\\]$/,"")+v+u.value}s.value=S,a.value=!1;let w=i(S);n.value=w,Object.keys(r).forEach(v=>delete r[v]),r[w]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})},handleFolderPickerListing:S=>{d.value=!1,c.value=(S.entries||[]).filter(w=>w.type==="directory").sort((w,v)=>w.name.localeCompare(v.name)),S.dirPath!=null&&(l.value=S.dirPath)}}}var Xf=F(()=>{});function Zf(e,{normalizePath:t,getEffectiveWorkDir:s,editorContainer:n,createEditor:r,destroyEditor:i,clearFindMarkers:o,saveCurrentUndoHistory:a,saveAllUndoHistory:l,cleanupUndoHistory:c,deleteConversationHistory:d,debugStatus:u,mdPreviewMode:f,renderOfficeLocal:p,performFind:g,findBarVisible:m,findQuery:b,t:I}){let y=Vue.reactive({}),S=Vue.ref([]),w=Vue.ref(-1),v=Vue.ref(!1),h=Vue.ref(!1),M=Vue.computed(()=>w.value>=0&&w.value<S.value.length?S.value[w.value]:null),x=null,E=()=>{x&&clearTimeout(x),x=setTimeout(()=>{e.sendWsMessage({type:"update_file_tabs",openFiles:S.value.map(B=>({path:B.path})),activeIndex:w.value})},500)},V=B=>{B&&(l(B),S.value.length>0?y[B]={files:S.value.map(z=>({path:z.path,name:z.name,content:z.content,originalContent:z.originalContent,isDirty:z.isDirty,fileType:z.fileType})),activeIndex:w.value}:delete y[B],E())},L=B=>{if(i(),!B||!y[B]){S.value=[],w.value=-1;return}let z=y[B];S.value=z.files.map(se=>({...se,isDirty:se.isDirty||!1,originalContent:se.originalContent||se.content,cmInstance:null,fileType:se.fileType||cn(se.name||""),blobUrl:null,previewUrl:null,previewLoading:!1,localPreviewReady:!1,previewError:null})),w.value=z.activeIndex,Vue.nextTick(()=>{let se=M.value;se&&(!se.fileType||se.fileType==="text")&&n.value&&r(se)})};function R(B,z){let se=t(B),me=S.value.findIndex(ge=>ge.path===se);if(me>=0){w.value!==me&&(o(),a(),w.value=me,Vue.nextTick(()=>{let ge=S.value[me];ge&&ge.content!=null&&(!ge.fileType||ge.fileType==="text")&&r(ge)})),V(e.currentConversation);return}a();let ae=z||se.split(/[/\\]/).pop(),ve=cn(ae);S.value.push({path:se,name:ae,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:ve,blobUrl:null,previewUrl:null,previewLoading:ve!=="text",localPreviewReady:!1,previewError:null}),w.value=S.value.length-1,v.value=!0,ve==="text"&&i(),V(e.currentConversation),u.value=`Loading: ${B}`,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:B,workDir:s(),_clientId:e.clientId})}let P=B=>{B!==w.value&&(o(),a(),w.value=B,V(e.currentConversation),Vue.nextTick(()=>{let z=S.value[B];z&&(!z.fileType||z.fileType==="text"?Bt(z.name)?f.value=!0:z.content!=null&&n.value&&(r(z),m.value&&b.value&&Vue.nextTick(()=>g())):z.fileType==="office"&&z.localPreviewReady&&Vue.nextTick(()=>p(z)))}))},A=B=>{let z=S.value[B];if(z?.isDirty&&!confirm(I("files.unsavedConfirm",{name:z.name})))return;c(e.currentConversation,z.path),z.blobUrl&&URL.revokeObjectURL(z.blobUrl);let se=B===w.value;S.value.splice(B,1),S.value.length===0?(w.value=-1,i()):w.value>=S.value.length?w.value=S.value.length-1:w.value>B?w.value--:se&&w.value>=S.value.length&&(w.value=S.value.length-1),V(e.currentConversation),S.value.length>0&&se&&Vue.nextTick(()=>{let me=S.value[w.value];me&&(!me.fileType||me.fileType==="text")&&me.content!=null&&n.value&&r(me)})};function _(){let B=M.value;!B||!B.isDirty||(h.value=!0,e.sendWsMessage({type:"write_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:B.path,content:B.content,workDir:s(),_clientId:e.clientId}))}return{fileTabsMap:y,openFiles:S,activeFileIndex:w,activeFile:M,fileLoading:v,fileSaving:h,saveTabsState:V,restoreTabsState:L,openFileInTab:R,switchToTab:P,closeFileTab:A,saveFile:_,handleConversationDeleted:B=>{let{conversationId:z}=B.detail;z&&(delete y[z],d(z))}}}var Jf=F(()=>{mr()});function eg({store:e,normalizePath:t,getEffectiveWorkDir:s,openFiles:n,activeFileIndex:r,activeFile:i,fileLoading:o,fileSaving:a,saveTabsState:l,createEditor:c,openFileInTab:d,tree:u,fp:f,qo:p,ops:g,mdPreviewMode:m,renderOfficeLocal:b,editorContainer:I,debugStatus:y}){return{handleWorkbenchMessage:v=>{let h=v.detail;if(h)switch(h.type){case"directory_listing":{if(h.conversationId==="_folder_picker"){f.handleFolderPickerListing(h);return}u.handleDirectoryListing(h);break}case"file_content":{if(o.value=!1,h.error){y.value=`Error: ${h.error}`,g.clearPendingDownload();let E=t(h.filePath),V=n.value.find(L=>L.path===E);V&&(V.previewLoading=!1,V.previewError=h.error);return}let M=t(h.filePath);if(g.getPendingDownload()&&t(g.getPendingDownload())===M){g.clearPendingDownload();try{if(h.binary){let E=`${location.protocol}//${location.host}/api/preview/${h.fileId}?token=${h.previewToken}`,V=document.createElement("a");V.href=E,V.download=M.split("/").pop()||"download",document.body.appendChild(V),V.click(),document.body.removeChild(V)}else{let E=new Blob([h.content||""],{type:"application/octet-stream"}),V=URL.createObjectURL(E),L=document.createElement("a");L.href=V,L.download=M.split("/").pop()||"download",document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(V)}}catch{}return}let x=n.value.findIndex(E=>E.path===M);if(x>=0){let E=n.value[x];if(h.binary){E.previewLoading=!1;let V=`${location.protocol}//${location.host}/api/preview/${h.fileId}?token=${h.previewToken}`,L=E.fileType||cn(E.name);E.fileType=L,L==="pdf"||L==="image"?fetch(V).then(R=>R.blob()).then(R=>{E.blobUrl=URL.createObjectURL(R)}).catch(R=>{E.previewError=R.message}):L==="office"&&((localStorage.getItem("officePreviewMode")||"local")==="online"?E.previewUrl="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(V):fetch(V).then(P=>P.arrayBuffer()).then(P=>{E._arrayBuffer=P,E.localPreviewReady=!0,x===r.value&&Vue.nextTick(()=>b(E))}).catch(P=>{E.previewError=P.message})),l(e.currentConversation);return}E.content=h.content||"",E.originalContent=h.content||"",E.isDirty=!1,l(e.currentConversation),x===r.value&&(Bt(E.name)&&m.value||Vue.nextTick(()=>{setTimeout(()=>c(E),100)}))}break}case"file_saved":{if(a.value=!1,h.error)return;let M=t(h.filePath),x=n.value.find(E=>E.path===M);x&&(x.originalContent=x.content,x.isDirty=!1,l(e.currentConversation));break}case"file_search_result":{p.handleFileSearchResult(h);break}case"file_op_result":{g.handleFileOpResult(h,u.loadTreeDirectory,u.treeRootPath.value);break}case"file_tabs_restored":{if(h.openFiles?.length>0&&n.value.length===0){let M=h.activeIndex||0,x=h.openFiles.length;for(let E of h.openFiles){let V=t(E.path),L=V.split("/").pop(),R=cn(L);n.value.push({path:V,name:L,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:R,blobUrl:null,previewUrl:null,previewLoading:R!=="text",localPreviewReady:!1,previewError:null}),e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:E.path})}r.value=M>=0&&M<x?M:0}break}}},handleOpenFile:v=>{let{filePath:h}=v.detail,M=t(h);d(M,M.split("/").pop())}}}var tg=F(()=>{mr()});var sg,ng=F(()=>{ml();Nf();Bf();jf();mr();zf();Gf();Xf();Jf();tg();sg={name:"FilesTab",template:`
|
|
2244
|
+
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=O=>O.split(/[/\\]/).pop()||O,n=O=>{let D=O.split(/[/\\]/);return D.pop(),D.join("/")},r=O=>Vi(s(O)),i=Vue.ref(null),o=Vue.reactive({staged:!1,modified:!1,untracked:!1}),a=O=>{o[O]=!o[O]},l=Vue.ref(!1),c=Vue.ref(""),d=Vue.ref(null),u=Vue.ref([]),f=Vue.computed(()=>e.effectiveWorkDir||""),p=Vue.ref(""),g=Vue.computed(()=>p.value.trim()||f.value),m=Vue.ref(null),b=Vue.ref(!1),I=Vue.ref(!1),y=Vue.ref(""),S=Vue.ref(null),w=Vue.ref([]),v=Vue.ref(null),h=Vue.ref(!0),M=Vue.ref(!1),x=Vue.ref(""),E=Vue.ref(null),V=Vue.ref(0),L=Vue.ref(0),R=O=>O==null||O===""?"":Pf(O,m.value||""),P=Vue.ref(parseInt(localStorage.getItem("gitDiffFontSize"))||12),A=O=>{P.value=Math.max(8,Math.min(24,O)),localStorage.setItem("gitDiffFontSize",P.value.toString())},_=()=>A(P.value+1),j=()=>A(P.value-1),q=O=>{O.deltaY<0?_():O.deltaY>0&&j()},z=Vue.computed(()=>{let O=w.value;if(!O||O.length===0)return[];let D=O.length,Z=[],ne=0;for(;ne<D;){let ye=O[ne];if(ye.type==="addition"||ye.type==="deletion"||ye.type==="modification"){let Y=ye.type==="modification"?"modification":ye.type,ee=ne;for(;ne<D&&(O[ne].type===Y||O[ne].type==="modification"&&Y!=="modification");)ne++;let ue=ne-ee;Z.push({type:Y,top:ee/D*100,height:Math.max(ue/D*100,.5)})}else ne++}return Z}),se=O=>{let D=i.value;if(!D)return;let Z=O.currentTarget.getBoundingClientRect(),ne=(O.clientY-Z.top)/Z.height;D.scrollTop=ne*(D.scrollHeight-D.clientHeight)},me=Vue.computed(()=>u.value.filter(O=>O.indexStatus!==" "&&O.indexStatus!=="?")),ae=Vue.computed(()=>u.value.filter(O=>O.workTreeStatus==="M"||O.workTreeStatus==="D")),ve=Vue.computed(()=>u.value.filter(O=>O.indexStatus==="?"&&O.workTreeStatus==="?")),ge=Df(e,{effectiveGitWorkDir:g,gitOperating:M,gitOpFeedback:E,commitMessage:x}),pe=()=>ge.loadGitStatus(l,c),T=()=>{pe()},K=$f(e,g),re=O=>Hi(O),he=()=>K.confirmFolderPicker(p,pe),Pe=(O,D)=>{m.value=O.path,b.value=D,I.value=!0,y.value="",S.value=null,w.value=[],v.value=null;let Z=O.indexStatus==="?"&&O.workTreeStatus==="?";e.sendWsMessage({type:"git_diff",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:g.value,filePath:O.path,staged:D,untracked:Z,fullFile:h.value,_clientId:e.clientId})},U=()=>{if(h.value=!h.value,m.value){let O=u.value.find(D=>D.path===m.value);O&&Pe(O,b.value)}},B=O=>{let D=O.detail;if(D)switch(D.type){case"directory_listing":{if(K.handleDirectoryListing(D))return;break}case"git_status_result":{if(l.value=!1,D.error){c.value=D.error,d.value=null,u.value=[];return}if(c.value="",d.value=D.branch||"HEAD",u.value=D.files||[],V.value=D.ahead||0,L.value=D.behind||0,m.value){let Z=u.value.find(ne=>ne.path===m.value);if(Z){let ne=Z.indexStatus!==" "&&Z.indexStatus!=="?";b.value=ne}else m.value=null,S.value=null,w.value=[],v.value=null}break}case"git_diff_result":{if(I.value=!1,D.error){y.value=D.error;return}y.value="";let Z=_f(D.diff,D.newFileContent,t);v.value=Z.stats,w.value=Z.lines,S.value=Z.content;break}case"git_op_result":{ge.handleGitOpResult(D,pe);break}}};Vue.watch(()=>e.currentAgent,()=>{d.value=null,u.value=[],c.value="",m.value=null,S.value=null,e.currentAgent&&Vue.nextTick(()=>pe())}),Vue.watch(()=>e.currentConversation,()=>{e.currentAgent&&(m.value=null,S.value=null,w.value=[],v.value=null,Vue.nextTick(()=>pe()))});let N=()=>pe();return Vue.onMounted(()=>{window.addEventListener("workbench-message",B),e.currentAgent&&pe()}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",B),ge.cleanup()}),{store:e,getFileName:s,getDirName:n,getFileIconHtml:r,hlLine:R,collapsedGroups:o,toggleGroup:a,gitLoading:l,gitError:c,gitBranch:d,gitFiles:u,gitWorkDir:p,defaultWorkDir:f,changeGitWorkDir:T,stagedFiles:me,modifiedFiles:ae,untrackedFiles:ve,selectedGitFile:m,selectedStaged:b,diffLoading:I,diffError:y,diffContent:S,diffLines:w,diffStats:v,diffFullFile:h,toggleDiffMode:U,scrollMarkers:z,diffScrollContainer:i,onMarkerClick:se,fontSize:P,zoomIn:_,zoomOut:j,onWheel:q,gitOperating:M,commitMessage:x,gitOpFeedback:E,gitAhead:V,gitBehind:L,stageFile:ge.stageFile,unstageFile:ge.unstageFile,discardFile:ge.discardFile,stageAll:ge.stageAll,unstageAll:ge.unstageAll,commitChanges:ge.commitChanges,pushChanges:ge.pushChanges,selectGitFile:Pe,refresh:N,folderPickerOpen:K.folderPickerOpen,folderPickerPath:K.folderPickerPath,folderPickerEntries:K.folderPickerEntries,folderPickerLoading:K.folderPickerLoading,folderPickerSelected:K.folderPickerSelected,getFolderIcon:re,openFolderPicker:K.openFolderPicker,folderPickerNavigateUp:K.folderPickerNavigateUp,folderPickerSelectItem:K.folderPickerSelectItem,folderPickerEnter:K.folderPickerEnter,confirmFolderPicker:he}}}});function Ff(e){let t=Vue.ref(!1),s=Vue.ref(!1),n=Vue.ref(""),r=Vue.ref(""),i=Vue.ref(!1),o=Vue.ref(!1),a=Vue.ref(0),l=Vue.ref(-1),c=Vue.ref(null),d=Vue.ref(null),u=[],f=[],p=()=>{let V=e.value?.cmInstance;if(!V)return;let R=V.getWrapperElement().querySelector(".cm-find-scrollbar-annotations");R&&R.remove()},g=()=>{let V=e.value?.cmInstance;if(!V||f.length===0)return;p();let L=V.getWrapperElement();if(!L.querySelector(".CodeMirror-vscrollbar"))return;let P=V.lineCount();if(P===0)return;let A=document.createElement("div");A.className="cm-find-scrollbar-annotations";for(let _ of f){let j=_.from.line/P*100,q=document.createElement("div");q.className="cm-find-scrollbar-tick",q.style.top=j+"%",A.appendChild(q)}L.appendChild(A)},m=()=>{for(let V of u)try{V.clear()}catch{}u=[],f=[],a.value=0,l.value=-1,p()},b=V=>{let L=e.value?.cmInstance;if(!L||!f[V])return;for(let P=0;P<u.length;P++){if(!u[P])continue;let A=u[P].find();A&&(u[P].clear(),u[P]=L.markText(A.from,A.to,{className:"cm-find-highlight"}))}let R=f[V];if(u[V]){let P=u[V].find();P&&(u[V].clear(),u[V]=L.markText(P.from,P.to,{className:"cm-find-highlight cm-find-current"}))}setTimeout(()=>{L.scrollIntoView({from:R.from,to:R.to},100)},0)},I=()=>{m();let V=e.value?.cmInstance;if(!V||!n.value)return;let L=n.value;if(L.length<3)return;let R=V.getValue(),P=i.value,A=o.value,_=[];try{if(A){let j=P?"g":"gi",q=new RegExp(L,j),z;for(;(z=q.exec(R))!==null;){if(z[0].length===0){q.lastIndex++;continue}let se=V.posFromIndex(z.index),me=V.posFromIndex(z.index+z[0].length);if(_.push({from:se,to:me}),_.length>1e4)break}}else{let j=P?L:L.toLowerCase(),q=P?R:R.toLowerCase(),z=0;for(;(z=q.indexOf(j,z))!==-1;){let se=V.posFromIndex(z),me=V.posFromIndex(z+L.length);if(_.push({from:se,to:me}),z+=L.length,_.length>1e4)break}}}catch{return}f=_,a.value=_.length;for(let j of _)u.push(V.markText(j.from,j.to,{className:"cm-find-highlight"}));if(_.length>0){let j=V.getCursor(),q=0;for(let z=0;z<_.length;z++){if(CodeMirror.cmpPos(_[z].from,j)>=0){q=z;break}z===_.length-1&&(q=0)}l.value=q,b(q)}g()};return{findBarVisible:t,replaceBarVisible:s,findQuery:n,replaceQuery:r,findCaseSensitive:i,findUseRegex:o,findMatchCount:a,findMatchIndex:l,findInputRef:c,replaceInputRef:d,clearFindMarkers:m,performFind:I,onFindInput:()=>{I()},findNext:()=>{if(f.length===0)return;let V=(l.value+1)%f.length;l.value=V,b(V)},findPrev:()=>{if(f.length===0)return;let V=(l.value-1+f.length)%f.length;l.value=V,b(V)},openFindBar:(V=!1)=>{t.value=!0,s.value=V;let L=e.value?.cmInstance;if(L){let R=L.getSelection();R&&(n.value=R)}Vue.nextTick(()=>{c.value?.focus(),c.value?.select(),n.value&&I()})},closeFindBar:()=>{m(),t.value=!1,s.value=!1;let V=e.value?.cmInstance;V&&V.focus()},toggleReplaceBar:()=>{s.value=!s.value,s.value&&Vue.nextTick(()=>d.value?.focus())},replaceOne:()=>{let V=e.value?.cmInstance;if(!V||f.length===0||l.value<0)return;let L=f[l.value];V.replaceRange(r.value,L.from,L.to),I()},replaceAll:()=>{let V=e.value?.cmInstance;!V||f.length===0||(V.operation(()=>{for(let L=f.length-1;L>=0;L--)V.replaceRange(r.value,f[L].from,f[L].to)}),I())}}}var Nf=F(()=>{});function Bf(e,t){let{getEffectiveWorkDir:s,treePath:n}=t,r=Vue.reactive(new Set),i=Vue.ref(-1),o=Vue.ref(!1),a=Vue.ref(null),l=null,c=null,d=Vue.ref(!1),u=Vue.ref(""),f=Vue.ref("file"),p=Vue.ref(null),g=Vue.ref(!1),m=Vue.ref(""),b=Vue.ref(null),I=Vue.reactive({visible:!1,x:0,y:0,entry:null}),y=Vue.ref(!1),S=Vue.ref(""),w=Vue.ref(null),v=null,h=Vue.reactive({dragging:null,dropTarget:null}),M=Vue.ref(!1),x=(Y,ee)=>{l&&clearTimeout(l),a.value={ok:Y,message:ee},l=setTimeout(()=>{a.value=null},4e3)},E=()=>{o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,x(!1,"Operation timed out"))},15e3)},V=Y=>{r.has(Y)?r.delete(Y):r.add(Y)},L=()=>{r.clear(),i.value=-1},R=Y=>{f.value=Y,u.value="",d.value=!0,Vue.nextTick(()=>p.value?.focus())},P=()=>{let Y=u.value.trim();if(!Y)return;d.value=!1;let ee=n.value||s();if(!ee)return;let ue=ee.includes("\\")?"\\":"/",le=ee.replace(/[/\\]$/,"")+ue+Y;E(),e.sendWsMessage({type:"create_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:le,isDirectory:f.value==="directory",workDir:s(),_clientId:e.clientId})},A=(Y,ee)=>{let ue=Y.path.split("/").pop();confirm(ee("files.deleteConfirm",{name:ue})+(Y.type==="directory"?ee("files.deleteDirHint"):""))&&(E(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[Y.path],workDir:s(),_clientId:e.clientId}))},_=Y=>{let ee=r.size;ee!==0&&confirm(Y("files.deleteSelectedConfirm",{count:ee}))&&(E(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...r],workDir:s(),_clientId:e.clientId}))},j=()=>{m.value=n.value||s()||"",g.value=!0,Vue.nextTick(()=>b.value?.focus())},q=()=>{let Y=m.value.trim();!Y||r.size===0||(g.value=!1,E(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...r],destination:Y,workDir:s(),_clientId:e.clientId}))},z=(Y,ee)=>{let Ce=Y.clientX,xe=Y.clientY;Ce+180>window.innerWidth&&(Ce=window.innerWidth-180),xe+240>window.innerHeight&&(xe=window.innerHeight-240),I.entry=ee,I.x=Ce,I.y=xe,I.visible=!0},se=()=>{I.visible=!1};return{selectedPaths:r,lastClickedIndex:i,fileOperating:o,fileOpFeedback:a,newFileDialogVisible:d,newFileName:u,newFileType:f,newFileInput:p,moveDialogVisible:g,moveDestination:m,moveDestInput:b,contextMenu:I,renameDialogVisible:y,renameNewName:S,renameInput:w,dragState:h,externalDropActive:M,showFileOpFeedback:x,toggleSelection:V,clearSelection:L,showNewFileDialog:R,confirmNewFile:P,deleteSingleFile:A,deleteSelected:_,openMoveDialog:j,confirmMove:q,showContextMenu:z,hideContextMenu:se,ctxRename:()=>{let Y=I.entry;se(),Y&&(S.value=Y.name,y.value=!0,Vue.nextTick(()=>{let ee=w.value;if(ee)if(ee.focus(),Y.type==="file"){let ue=Y.name.lastIndexOf(".");ue>0?ee.setSelectionRange(0,ue):ee.select()}else ee.select()}))},confirmRename:()=>{let Y=I.entry,ee=S.value.trim();if(!ee||!Y||ee===Y.name){y.value=!1;return}y.value=!1;let ue=Y.path.replace(/\/$/,"").split("/");ue.pop();let le=ue.join("/")||"/";E(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[Y.path],destination:le,newName:ee,workDir:s(),_clientId:e.clientId})},ctxCopy:()=>{let Y=I.entry;if(se(),!Y)return;let ee=Y.path.replace(/\/$/,"").split("/");ee.pop();let ue=ee.join("/")||"/";E(),e.sendWsMessage({type:"copy_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[Y.path],destination:ue,workDir:s(),_clientId:e.clientId})},ctxMoveTo:()=>{let Y=I.entry;se(),Y&&(r.clear(),r.add(Y.path),j())},ctxDelete:Y=>{let ee=I.entry;se(),ee&&A(ee,Y)},ctxDownload:()=>{let Y=I.entry;se(),!(!Y||Y.type!=="file")&&(v=Y.path,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:Y.path,workDir:s(),_clientId:e.clientId}))},onDragStart:(Y,ee)=>{h.dragging=ee,Y.dataTransfer.setData("text/plain",ee.path),Y.dataTransfer.effectAllowed="move"},onDragOver:(Y,ee)=>{if(!h.dragging&&Y.dataTransfer.types.includes("Files")){ee.type==="directory"&&(Y.dataTransfer.dropEffect="copy",h.dropTarget=ee.path);return}!h.dragging||ee.type!=="directory"||ee.path!==h.dragging.path&&(ee.path.startsWith(h.dragging.path+"/")||(Y.dataTransfer.dropEffect="move",h.dropTarget=ee.path))},onDragLeave:Y=>{let ee=Y.relatedTarget;ee&&Y.currentTarget.contains(ee)||(h.dropTarget=null)},onDrop:(Y,ee,ue)=>{if(h.dropTarget=null,!h.dragging&&Y.dataTransfer.files.length>0&&ee.type==="directory"){ue(Y.dataTransfer.files,ee.path);return}if(!h.dragging||ee.type!=="directory"){h.dragging=null;return}if(ee.path===h.dragging.path){h.dragging=null;return}E(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[h.dragging.path],destination:ee.path,workDir:s(),_clientId:e.clientId}),h.dragging=null},onTreeDragOver:Y=>{h.dragging||Y.dataTransfer.types.includes("Files")&&(Y.dataTransfer.dropEffect="copy",M.value=!0)},onTreeDragLeave:Y=>{let ee=Y.relatedTarget;ee&&Y.currentTarget.contains(ee)||(M.value=!1)},onTreeDrop:(Y,ee,ue)=>{if(M.value=!1,!h.dragging&&Y.dataTransfer.files.length>0){let le=n.value||ee||s();ue(Y.dataTransfer.files,le)}},handleExternalFileDrop:async(Y,ee)=>{if(!ee)return;let ue=[],le=[];for(let Ce of Y)le.push(new Promise(xe=>{let $e=new FileReader;$e.onload=()=>{let je=btoa(new Uint8Array($e.result).reduce((yt,bt)=>yt+String.fromCharCode(bt),""));ue.push({name:Ce.name,data:je}),xe()},$e.onerror=()=>xe(),$e.readAsArrayBuffer(Ce)}));await Promise.all(le),ue.length!==0&&(o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,x(!1,"Upload timed out"))},3e4),e.sendWsMessage({type:"upload_to_dir",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,files:ue,dirPath:ee,workDir:s(),_clientId:e.clientId}))},handleFileOpResult:(Y,ee,ue)=>{o.value=!1,c&&(clearTimeout(c),c=null),x(Y.success,Y.success?Y.message:Y.error||"Operation failed"),Y.success&&(ue&&ee(ue),(Y.operation==="delete"||Y.operation==="move")&&(r.clear(),i.value=-1))},getPendingDownload:()=>v,clearPendingDownload:()=>{v=null},cleanup:()=>{l&&clearTimeout(l),c&&clearTimeout(c)}}}var qf=F(()=>{});function Wf(e,{getEffectiveWorkDir:t,normalizePath:s,selectedPaths:n,lastClickedIndex:r,openFileInTab:i,clearSelection:o}){let a=Vue.ref(""),l=Vue.ref(""),c=Vue.reactive({}),d=Vue.ref(!1),u=Vue.ref(null),f=Vue.computed(()=>{if(!l.value)return"EXPLORER";let R=l.value.replace(/[\\/]+$/,"").split(/[\\/]/);return(R[R.length-1]||l.value).toUpperCase()}),p=Vue.computed(()=>l.value?!!c[l.value]?.expanded:!1),g=()=>{if(!l.value)return;let R=c[l.value];R&&(R.expanded=!R.expanded)},m=()=>{for(let R of Object.keys(c))c[R]&&(c[R].expanded=!1)},b=()=>{d.value=!0,Vue.nextTick(()=>u.value?.focus())},I=()=>{d.value=!1,v()},y=()=>{d.value=!1},S=Vue.computed(()=>{let R=[],P=(A,_)=>{let j=c[A];if(!(!j||!j.entries))for(let q of j.entries)R.push({...q,depth:_}),q.type==="directory"&&c[q.path]?.expanded&&P(q.path,_+1)};return l.value&&c[l.value]?.expanded&&P(l.value,0),R}),w=R=>{let P=s(R);c[P]?c[P].loading=!0:c[P]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:R,workDir:t(),_clientId:e.clientId})},v=()=>{let R=a.value.trim();if(!R)return;let P=s(R);l.value=P,Object.keys(c).forEach(A=>delete c[A]),c[P]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:R,workDir:t(),_clientId:e.clientId})},h=R=>{let P=s(R),A=c[P];A?A.loaded?A.expanded=!A.expanded:(A.expanded=!0,w(R)):(c[P]={entries:[],expanded:!0,loaded:!1,loading:!1},w(R))},M=(R,P)=>{let A=S.value,_=A.findIndex(j=>j.path===R.path);if(P&&(P.shiftKey||P.ctrlKey||P.metaKey)){if(P.shiftKey&&r.value>=0&&_>=0){let j=Math.min(r.value,_),q=Math.max(r.value,_);!P.ctrlKey&&!P.metaKey&&n.clear();for(let z=j;z<=q;z++)n.add(A[z].path)}else n.has(R.path)?n.delete(R.path):n.add(R.path);r.value=_;return}n.size>0&&(n.clear(),r.value=-1),R.type==="directory"?h(R.path):i(R.path,R.name),r.value=_},x=R=>{let P=s(R.dirPath);if(R.error){c[P]&&(c[P].loading=!1);return}let A=(R.entries||[]).sort((q,z)=>q.type===z.type?q.name.localeCompare(z.name):q.type==="directory"?-1:1),_=P.replace(/\/$/,""),j=A.map(q=>({...q,path:_+"/"+q.name}));c[P]?(c[P].entries=j,c[P].loaded=!0,c[P].loading=!1):c[P]={entries:j,expanded:!0,loaded:!0,loading:!1},P===l.value&&(a.value=R.dirPath)},E=()=>{Object.keys(c).forEach(R=>delete c[R])};return{treePath:a,treeRootPath:l,treeNodes:c,flattenedTree:S,editingTreePath:d,treePathInputRef:u,rootFolderName:f,rootExpanded:p,toggleRootExpand:g,collapseAll:m,startTreePathEdit:b,confirmTreePath:I,cancelTreePathEdit:y,loadTreeDirectory:w,loadRootDirectory:v,toggleDirectory:h,onTreeItemClick:M,handleDirectoryListing:x,clearTreeNodes:E,initFileBrowser:()=>{let R=t();if(R){let P=s(R);a.value=R,l.value=P,E(),w(R)}},refresh:()=>{l.value&&w(l.value)}}}var jf=F(()=>{});function cn(e){let t=e.lastIndexOf(".");if(t<0)return"text";let s=e.substring(t).toLowerCase();return Xy.has(s)?"office":Zy.has(s)?"pdf":Jy.has(s)?"image":"text"}function qt(e){let t=e.lastIndexOf(".");return t<0?!1:eb.has(e.substring(t).toLowerCase())}function tb(e){let t=e.split(".").pop()?.toLowerCase();return{js:"javascript",mjs:"javascript",jsx:"javascript",ts:{name:"javascript",typescript:!0},tsx:{name:"javascript",typescript:!0},json:{name:"javascript",json:!0},py:"python",html:"htmlmixed",htm:"htmlmixed",vue:"htmlmixed",xml:"xml",svg:"xml",css:"css",scss:"css",less:"css",sh:"shell",bash:"shell",zsh:"shell",c:"text/x-csrc",h:"text/x-csrc",cpp:"text/x-c++src",hpp:"text/x-c++src",cs:"text/x-csharp",java:"text/x-java",md:"markdown",markdown:"markdown"}[t]||"text/plain"}function Uf(e,{activeFile:t,editorContainer:s,fontSize:n,clearFindMarkers:r,openFindBar:i,saveFile:o}){let a=Vue.ref(""),l=Vue.reactive({}),c=()=>{},d=()=>{},u=({openQuickOpen:y,openGoToLine:S})=>{c=y,d=S},f=(y,S=0)=>{if(!s.value){S<20&&setTimeout(()=>f(y,S+1),100);return}if(!y)return;if(s.value.innerHTML="",typeof CodeMirror>"u"){let h=document.createElement("textarea");h.value=y.content||"",h.style.cssText="width:100%;height:100%;border:none;outline:none;resize:none;padding:12px;font-family:monospace;font-size:12px;background:var(--bg-main);color:var(--text-main);white-space:pre;tab-size:4;",h.spellcheck=!1,h.addEventListener("input",()=>{y.content=h.value,y.isDirty=h.value!==y.originalContent}),h.addEventListener("keydown",M=>{(M.ctrlKey||M.metaKey)&&M.key==="s"&&(M.preventDefault(),o())}),s.value.appendChild(h),a.value="";return}let v=document.documentElement.getAttribute("data-theme")==="dark"?"material-darker":"default";try{let h=CodeMirror(s.value,{value:y.content||"",mode:tb(y.name),theme:v,lineNumbers:!0,tabSize:4,indentWithTabs:!1,lineWrapping:!1,readOnly:!1,extraKeys:{"Ctrl-S":()=>o(),"Cmd-S":()=>o(),"Ctrl-P":()=>c(),"Cmd-P":()=>c(),"Ctrl-G":()=>d(),"Cmd-G":()=>d(),"Ctrl-F":()=>i(!1),"Cmd-F":()=>i(!1),"Ctrl-R":()=>i(!0),"Cmd-R":()=>i(!0),"Ctrl-H":()=>i(!0),"Cmd-H":()=>i(!0)}});h.on("change",()=>{let x=h.getValue();y.content=x,y.isDirty=x!==y.originalContent}),y.cmInstance=h,h.getWrapperElement().style.fontSize=n.value+"px";let M=e.currentConversation;M&&l[M]?.[y.path]&&h.setHistory(l[M][y.path]),Vue.nextTick(()=>{h.refresh(),setTimeout(()=>h.refresh(),200)}),a.value=""}catch(h){a.value=`Editor error: ${h.message}`}};return{debugStatus:a,undoHistoryMap:l,createEditor:f,destroyEditor:()=>{r();let y=t.value;y?.cmInstance&&(y.cmInstance.toTextArea&&y.cmInstance.toTextArea(),y.cmInstance=null),s.value&&(s.value.innerHTML="")},setKeyBindings:u,saveCurrentUndoHistory:()=>{let y=e.currentConversation;if(!y)return;let S=t.value;S?.cmInstance&&(l[y]||(l[y]={}),l[y][S.path]=S.cmInstance.getHistory())},saveAllUndoHistory:y=>{if(!y)return;let S=t.value;S?.cmInstance&&(l[y]||(l[y]={}),l[y][S.path]=S.cmInstance.getHistory())},cleanupUndoHistory:(y,S)=>{y&&l[y]&&delete l[y][S]},deleteConversationHistory:y=>{delete l[y]}}}var Xy,Zy,Jy,eb,mr=F(()=>{Xy=new Set([".docx",".xlsx",".xls",".pptx",".ppt"]),Zy=new Set([".pdf"]),Jy=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico"]),eb=new Set([".md",".markdown",".mdx"])});function Kf(e,{editorContainer:t,createEditor:s,t:n}){let r=Vue.ref(!0),i=Vue.ref(null),o=Vue.ref(null),a=Vue.computed(()=>{let p=e.value;return!!(p&&qt(p.name))}),l=Vue.computed(()=>{let p=e.value;if(!p||!qt(p.name)||p.content==null)return"";try{if(typeof marked<"u")return marked.parse(p.content)}catch{}return"<pre>"+(p.content||"")+"</pre>"});function c(){ot(i.value)}async function d(){await ot(i.value)}function u(){r.value=!1,Vue.nextTick(()=>{let p=e.value;p&&t.value&&s(p)})}return{mdPreviewMode:r,mdPreviewRef:i,officePreviewContainer:o,isActiveMarkdown:a,mdRenderedHtml:l,initMermaid:c,renderMermaidBlocks:d,switchToMdEdit:u,renderOfficeLocal:p=>{let g=o.value;if(!g||!p._arrayBuffer)return;g.innerHTML="";let m=("."+p.name.split(".").pop()).toLowerCase();if(m===".docx"&&window.docx)window.docx.renderAsync(p._arrayBuffer,g,null,{className:"docx-preview-content",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!0}).catch(b=>{p.previewError=b.message});else if(m===".xlsx"||m===".xls")try{let b=XLSX.read(p._arrayBuffer,{type:"array"}),I=b.SheetNames[0],y=XLSX.utils.sheet_to_html(b.Sheets[I],{editable:!1});g.innerHTML='<div class="xlsx-sheet-tabs">'+b.SheetNames.map((S,w)=>`<button class="xlsx-sheet-tab${w===0?" active":""}" data-idx="${w}">${S}</button>`).join("")+'</div><div class="xlsx-table-wrap">'+y+"</div>",g.querySelectorAll(".xlsx-sheet-tab").forEach(S=>{S.addEventListener("click",()=>{let w=parseInt(S.dataset.idx),v=b.SheetNames[w],h=XLSX.utils.sheet_to_html(b.Sheets[v],{editable:!1});g.querySelector(".xlsx-table-wrap").innerHTML=h,g.querySelectorAll(".xlsx-sheet-tab").forEach(M=>M.classList.remove("active")),S.classList.add("active")})})}catch(b){p.previewError=b.message}else(m===".pptx"||m===".ppt")&&(g.innerHTML='<div class="preview-unsupported">'+(n?n("files.pptxNotSupported"):"PowerPoint preview not supported")+"</div>")}}}var zf=F(()=>{ar();mr()});function Yf(e,{getEffectiveWorkDir:t,treePath:s,openFileInTab:n,normalizePath:r,treeRootPath:i,treeNodes:o,loadTreeDirectory:a}){let l=Vue.ref(""),c=Vue.ref([]),d=Vue.ref(!1),u=null,f=Vue.ref(!1),p=Vue.ref(""),g=Vue.ref([]),m=Vue.ref(0),b=Vue.ref(!1),I=Vue.ref(null),y=null,S=Vue.ref(!1),w=Vue.ref(""),v=Vue.ref(null),h=ae=>{!e.currentAgent||!ae.trim()||e.sendWsMessage({type:"file_search",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,query:ae.trim(),dirPath:s.value||t()||"",_clientId:e.clientId})},M=()=>{if(u&&clearTimeout(u),!l.value.trim()){c.value=[],d.value=!1;return}d.value=!0,u=setTimeout(()=>{h(l.value)},300)},x=()=>{l.value="",c.value=[],d.value=!1},E=ae=>{if(ae.type==="directory"){let ve=r(ae.fullPath);i.value=ve,s.value=ae.fullPath,Object.keys(o).forEach(ge=>delete o[ge]),a(ae.fullPath),x()}else n(ae.fullPath,ae.name),x()},V=()=>{f.value=!0,p.value="",g.value=[],m.value=0,b.value=!1,Vue.nextTick(()=>I.value?.focus())},L=()=>{f.value=!1,p.value="",g.value=[]},R=()=>{if(y&&clearTimeout(y),!p.value.trim()){g.value=[],b.value=!1;return}b.value=!0,m.value=0,y=setTimeout(()=>{h(p.value)},200)},P=()=>{g.value.length>0&&(m.value=(m.value+1)%g.value.length)},A=()=>{g.value.length>0&&(m.value=(m.value-1+g.value.length)%g.value.length)},_=ae=>{ae.type!=="directory"&&n(ae.fullPath,ae.name),L()},j=()=>{let ae=g.value[m.value];ae&&_(ae)},q=()=>{S.value=!0,w.value="",Vue.nextTick(()=>v.value?.focus())},z=()=>{S.value=!1,w.value=""};return{searchQuery:l,searchResults:c,searchLoading:d,onSearchInput:M,clearSearch:x,onSearchResultClick:E,quickOpenVisible:f,quickOpenQuery:p,quickOpenResults:g,quickOpenSelectedIndex:m,quickOpenLoading:b,quickOpenInput:I,openQuickOpen:V,closeQuickOpen:L,onQuickOpenInput:R,quickOpenSelectNext:P,quickOpenSelectPrev:A,quickOpenConfirm:j,quickOpenOpenFile:_,goToLineVisible:S,goToLineValue:w,goToLineInput:v,openGoToLine:q,closeGoToLine:z,goToLineConfirm:ae=>{let ve=parseInt(w.value);if(isNaN(ve)||ve<1)return;let ge=ae.value;if(ge?.cmInstance){let pe=ge.cmInstance,T=Math.min(ve-1,pe.lineCount()-1);pe.setCursor({line:T,ch:0}),pe.scrollIntoView({line:T,ch:0},100),pe.focus()}z()},handleFileSearchResult:ae=>{let ve=ae.results||[];f.value?ae.query&&ae.query.trim()===p.value.trim()&&(g.value=ve,b.value=!1,m.value=0):ae.query&&ae.query.trim()===l.value.trim()&&(c.value=ve,d.value=!1)}}}var Gf=F(()=>{});function Qf(e,{getEffectiveWorkDir:t,treePath:s,treeRootPath:n,treeNodes:r,normalizePath:i,loadTreeDirectory:o}){let a=Vue.ref(!1),l=Vue.ref(""),c=Vue.ref([]),d=Vue.ref(!1),u=Vue.ref(""),f=()=>{a.value=!0,u.value="",d.value=!0;let S=s.value||t()||"";l.value=S,c.value=[],e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})},p=S=>{d.value=!0,u.value="",e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})};return{folderPickerOpen:a,folderPickerPath:l,folderPickerEntries:c,folderPickerLoading:d,folderPickerSelected:u,openFolderPicker:f,folderPickerNavigateUp:()=>{if(!l.value)return;let S=l.value.includes("\\"),w=S?"\\":"/",v=l.value.replace(/[/\\]$/,"").split(/[/\\]/);if(v.pop(),v.length===0)l.value="",p("");else if(S&&v.length===1&&/^[A-Za-z]:$/.test(v[0]))l.value=v[0]+"\\",p(v[0]+"\\");else{let h=v.join(w);l.value=h,p(h)}},folderPickerSelectItem:S=>{u.value=S.name},folderPickerEnter:S=>{let w;if(!l.value)w=S.name+(S.name.endsWith("\\")?"":"\\");else{let v=l.value.includes("\\")||/^[A-Z]:/.test(S.name)?"\\":"/";w=l.value.replace(/[/\\]$/,"")+v+S.name}l.value=w,p(w)},confirmFolderPicker:()=>{let S=l.value;if(!S)return;if(u.value){let v=S.includes("\\")?"\\":"/";S=S.replace(/[/\\]$/,"")+v+u.value}s.value=S,a.value=!1;let w=i(S);n.value=w,Object.keys(r).forEach(v=>delete r[v]),r[w]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})},handleFolderPickerListing:S=>{d.value=!1,c.value=(S.entries||[]).filter(w=>w.type==="directory").sort((w,v)=>w.name.localeCompare(v.name)),S.dirPath!=null&&(l.value=S.dirPath)}}}var Xf=F(()=>{});function Zf(e,{normalizePath:t,getEffectiveWorkDir:s,editorContainer:n,createEditor:r,destroyEditor:i,clearFindMarkers:o,saveCurrentUndoHistory:a,saveAllUndoHistory:l,cleanupUndoHistory:c,deleteConversationHistory:d,debugStatus:u,mdPreviewMode:f,renderOfficeLocal:p,performFind:g,findBarVisible:m,findQuery:b,t:I}){let y=Vue.reactive({}),S=Vue.ref([]),w=Vue.ref(-1),v=Vue.ref(!1),h=Vue.ref(!1),M=Vue.computed(()=>w.value>=0&&w.value<S.value.length?S.value[w.value]:null),x=null,E=()=>{x&&clearTimeout(x),x=setTimeout(()=>{e.sendWsMessage({type:"update_file_tabs",openFiles:S.value.map(q=>({path:q.path})),activeIndex:w.value})},500)},V=q=>{q&&(l(q),S.value.length>0?y[q]={files:S.value.map(z=>({path:z.path,name:z.name,content:z.content,originalContent:z.originalContent,isDirty:z.isDirty,fileType:z.fileType})),activeIndex:w.value}:delete y[q],E())},L=q=>{if(i(),!q||!y[q]){S.value=[],w.value=-1;return}let z=y[q];S.value=z.files.map(se=>({...se,isDirty:se.isDirty||!1,originalContent:se.originalContent||se.content,cmInstance:null,fileType:se.fileType||cn(se.name||""),blobUrl:null,previewUrl:null,previewLoading:!1,localPreviewReady:!1,previewError:null})),w.value=z.activeIndex,Vue.nextTick(()=>{let se=M.value;se&&(!se.fileType||se.fileType==="text")&&n.value&&r(se)})};function R(q,z){let se=t(q),me=S.value.findIndex(ge=>ge.path===se);if(me>=0){w.value!==me&&(o(),a(),w.value=me,Vue.nextTick(()=>{let ge=S.value[me];ge&&ge.content!=null&&(!ge.fileType||ge.fileType==="text")&&r(ge)})),V(e.currentConversation);return}a();let ae=z||se.split(/[/\\]/).pop(),ve=cn(ae);S.value.push({path:se,name:ae,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:ve,blobUrl:null,previewUrl:null,previewLoading:ve!=="text",localPreviewReady:!1,previewError:null}),w.value=S.value.length-1,v.value=!0,ve==="text"&&i(),V(e.currentConversation),u.value=`Loading: ${q}`,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:q,workDir:s(),_clientId:e.clientId})}let P=q=>{q!==w.value&&(o(),a(),w.value=q,V(e.currentConversation),Vue.nextTick(()=>{let z=S.value[q];z&&(!z.fileType||z.fileType==="text"?qt(z.name)?f.value=!0:z.content!=null&&n.value&&(r(z),m.value&&b.value&&Vue.nextTick(()=>g())):z.fileType==="office"&&z.localPreviewReady&&Vue.nextTick(()=>p(z)))}))},A=q=>{let z=S.value[q];if(z?.isDirty&&!confirm(I("files.unsavedConfirm",{name:z.name})))return;c(e.currentConversation,z.path),z.blobUrl&&URL.revokeObjectURL(z.blobUrl);let se=q===w.value;S.value.splice(q,1),S.value.length===0?(w.value=-1,i()):w.value>=S.value.length?w.value=S.value.length-1:w.value>q?w.value--:se&&w.value>=S.value.length&&(w.value=S.value.length-1),V(e.currentConversation),S.value.length>0&&se&&Vue.nextTick(()=>{let me=S.value[w.value];me&&(!me.fileType||me.fileType==="text")&&me.content!=null&&n.value&&r(me)})};function _(){let q=M.value;!q||!q.isDirty||(h.value=!0,e.sendWsMessage({type:"write_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:q.path,content:q.content,workDir:s(),_clientId:e.clientId}))}return{fileTabsMap:y,openFiles:S,activeFileIndex:w,activeFile:M,fileLoading:v,fileSaving:h,saveTabsState:V,restoreTabsState:L,openFileInTab:R,switchToTab:P,closeFileTab:A,saveFile:_,handleConversationDeleted:q=>{let{conversationId:z}=q.detail;z&&(delete y[z],d(z))}}}var Jf=F(()=>{mr()});function eg({store:e,normalizePath:t,getEffectiveWorkDir:s,openFiles:n,activeFileIndex:r,activeFile:i,fileLoading:o,fileSaving:a,saveTabsState:l,createEditor:c,openFileInTab:d,tree:u,fp:f,qo:p,ops:g,mdPreviewMode:m,renderOfficeLocal:b,editorContainer:I,debugStatus:y}){return{handleWorkbenchMessage:v=>{let h=v.detail;if(h)switch(h.type){case"directory_listing":{if(h.conversationId==="_folder_picker"){f.handleFolderPickerListing(h);return}u.handleDirectoryListing(h);break}case"file_content":{if(o.value=!1,h.error){y.value=`Error: ${h.error}`,g.clearPendingDownload();let E=t(h.filePath),V=n.value.find(L=>L.path===E);V&&(V.previewLoading=!1,V.previewError=h.error);return}let M=t(h.filePath);if(g.getPendingDownload()&&t(g.getPendingDownload())===M){g.clearPendingDownload();try{if(h.binary){let E=`${location.protocol}//${location.host}/api/preview/${h.fileId}?token=${h.previewToken}`,V=document.createElement("a");V.href=E,V.download=M.split("/").pop()||"download",document.body.appendChild(V),V.click(),document.body.removeChild(V)}else{let E=new Blob([h.content||""],{type:"application/octet-stream"}),V=URL.createObjectURL(E),L=document.createElement("a");L.href=V,L.download=M.split("/").pop()||"download",document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(V)}}catch{}return}let x=n.value.findIndex(E=>E.path===M);if(x>=0){let E=n.value[x];if(h.binary){E.previewLoading=!1;let V=`${location.protocol}//${location.host}/api/preview/${h.fileId}?token=${h.previewToken}`,L=E.fileType||cn(E.name);E.fileType=L,L==="pdf"||L==="image"?fetch(V).then(R=>R.blob()).then(R=>{E.blobUrl=URL.createObjectURL(R)}).catch(R=>{E.previewError=R.message}):L==="office"&&((localStorage.getItem("officePreviewMode")||"local")==="online"?E.previewUrl="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(V):fetch(V).then(P=>P.arrayBuffer()).then(P=>{E._arrayBuffer=P,E.localPreviewReady=!0,x===r.value&&Vue.nextTick(()=>b(E))}).catch(P=>{E.previewError=P.message})),l(e.currentConversation);return}E.content=h.content||"",E.originalContent=h.content||"",E.isDirty=!1,l(e.currentConversation),x===r.value&&(qt(E.name)&&m.value||Vue.nextTick(()=>{setTimeout(()=>c(E),100)}))}break}case"file_saved":{if(a.value=!1,h.error)return;let M=t(h.filePath),x=n.value.find(E=>E.path===M);x&&(x.originalContent=x.content,x.isDirty=!1,l(e.currentConversation));break}case"file_search_result":{p.handleFileSearchResult(h);break}case"file_op_result":{g.handleFileOpResult(h,u.loadTreeDirectory,u.treeRootPath.value);break}case"file_tabs_restored":{if(h.openFiles?.length>0&&n.value.length===0){let M=h.activeIndex||0,x=h.openFiles.length;for(let E of h.openFiles){let V=t(E.path),L=V.split("/").pop(),R=cn(L);n.value.push({path:V,name:L,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:R,blobUrl:null,previewUrl:null,previewLoading:R!=="text",localPreviewReady:!1,previewError:null}),e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:E.path})}r.value=M>=0&&M<x?M:0}break}}},handleOpenFile:v=>{let{filePath:h}=v.detail,M=t(h);d(M,M.split("/").pop())}}}var tg=F(()=>{mr()});var sg,ng=F(()=>{ml();Nf();qf();jf();mr();zf();Gf();Xf();Jf();tg();sg={name:"FilesTab",template:`
|
|
2245
2245
|
<div class="files-tab file-two-col" :class="{ 'mobile-editor-view': isMobile && mobileView === 'editor' }" ref="rootEl">
|
|
2246
2246
|
<!-- \u5DE6\u680F: \u5C42\u7EA7\u76EE\u5F55\u6811 -->
|
|
2247
2247
|
<div class="file-col-tree" :class="{ 'drop-active': externalDropActive }" :style="{ flex: '0 0 ' + treePanelWidth + 'px', transition: isTreeResizing ? 'none' : undefined, fontSize: fontSize + 'px' }" @wheel.ctrl.prevent="onWheel"
|
|
@@ -2668,7 +2668,7 @@ ${String(e||"").trim()}
|
|
|
2668
2668
|
</template>
|
|
2669
2669
|
</div>
|
|
2670
2670
|
</div>
|
|
2671
|
-
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=()=>e.effectiveWorkDir||"",n=T=>T?T.replace(/\\/g,"/"):"",r=T=>Vi(T),i=T=>Hi(T),o=T=>T==null?"":T<1024?T+" B":T<1024*1024?(T/1024).toFixed(1)+" KB":(T/(1024*1024)).toFixed(1)+" MB",a=Vue.ref(null),l=Vue.ref(null),c=Vue.ref(window.innerWidth<=768),d=Vue.ref("tree"),u=()=>{d.value="tree"},f=Vue.ref(parseInt(localStorage.getItem("filesFontSize"))||15),p=T=>{f.value=Math.max(8,Math.min(24,T)),localStorage.setItem("filesFontSize",f.value.toString());let K=w.activeFile.value;K?.cmInstance&&(K.cmInstance.getWrapperElement().style.fontSize=f.value+"px",K.cmInstance.refresh())},g=()=>p(f.value+1),m=()=>p(f.value-1),b=T=>{T.deltaY<0?g():m()},I=Vue.ref(parseInt(localStorage.getItem("filePanelWidth"))||220),y=Vue.ref(!1),S=T=>{T.preventDefault();let K=T.type==="touchstart";y.value=!0;let re=K?T.touches[0].clientX:T.clientX,he=I.value;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let Pe=T.target.closest(".file-two-col"),U=Pe?Pe.offsetWidth*.5:400,q=O=>{let D=K?O.touches[0].clientX:O.clientX;I.value=Math.max(120,Math.min(U,he+(D-re)))},N=()=>{y.value=!1,document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("filePanelWidth",I.value.toString()),document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",N),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",N)};document.addEventListener(K?"touchmove":"mousemove",q),document.addEventListener(K?"touchend":"mouseup",N)},w,v,h=Vue.computed(()=>w?w.activeFile.value:null),M=Vue.computed(()=>v?v.treePath.value:""),x=Ff(h),E=Uf(e,{activeFile:h,editorContainer:l,fontSize:f,clearFindMarkers:x.clearFindMarkers,openFindBar:x.openFindBar,saveFile:()=>w.saveFile()}),V=Kf(h,{editorContainer:l,createEditor:E.createEditor,t}),L=qf(e,{getEffectiveWorkDir:s,treePath:M});w=Zf(e,{normalizePath:n,getEffectiveWorkDir:s,editorContainer:l,createEditor:E.createEditor,destroyEditor:E.destroyEditor,clearFindMarkers:x.clearFindMarkers,saveCurrentUndoHistory:E.saveCurrentUndoHistory,saveAllUndoHistory:E.saveAllUndoHistory,cleanupUndoHistory:E.cleanupUndoHistory,deleteConversationHistory:E.deleteConversationHistory,debugStatus:E.debugStatus,mdPreviewMode:V.mdPreviewMode,renderOfficeLocal:V.renderOfficeLocal,performFind:x.performFind,findBarVisible:x.findBarVisible,findQuery:x.findQuery,t}),v=Wf(e,{getEffectiveWorkDir:s,normalizePath:n,selectedPaths:L.selectedPaths,lastClickedIndex:L.lastClickedIndex,openFileInTab:(...T)=>w.openFileInTab(...T),clearSelection:L.clearSelection});let R=Yf(e,{getEffectiveWorkDir:s,treePath:v.treePath,openFileInTab:(...T)=>w.openFileInTab(...T),normalizePath:n,treeRootPath:v.treeRootPath,treeNodes:v.treeNodes,loadTreeDirectory:v.loadTreeDirectory});E.setKeyBindings({openQuickOpen:R.openQuickOpen,openGoToLine:R.openGoToLine});let P=Qf(e,{getEffectiveWorkDir:s,treePath:v.treePath,treeRootPath:v.treeRootPath,treeNodes:v.treeNodes,normalizePath:n,loadTreeDirectory:v.loadTreeDirectory}),A=eg({store:e,normalizePath:n,getEffectiveWorkDir:s,openFiles:w.openFiles,activeFileIndex:w.activeFileIndex,activeFile:w.activeFile,fileLoading:w.fileLoading,fileSaving:w.fileSaving,saveTabsState:w.saveTabsState,createEditor:E.createEditor,openFileInTab:w.openFileInTab,tree:v,fp:P,qo:R,ops:L,mdPreviewMode:V.mdPreviewMode,renderOfficeLocal:V.renderOfficeLocal,editorContainer:l,debugStatus:E.debugStatus}),_=T=>L.deleteSingleFile(T,t),j=()=>L.deleteSelected(t),B=()=>L.ctxDelete(t),z=(T,K)=>L.onDrop(T,K,L.handleExternalFileDrop),se=T=>L.onTreeDrop(T,v.treeRootPath.value,L.handleExternalFileDrop),me=()=>R.goToLineConfirm(w.activeFile);Vue.watch(()=>e.currentAgent,()=>{w.saveTabsState(e.currentConversation),E.destroyEditor(),v.clearTreeNodes(),w.openFiles.value=[],w.activeFileIndex.value=-1,w.fileLoading.value=!1,e.currentAgent&&Vue.nextTick(()=>v.initFileBrowser())});let ae=e.currentConversation;Vue.watch(()=>e.currentConversation,T=>{w.saveTabsState(ae),ae=T,w.restoreTabsState(T);let K=s(),re=n(K);K&&re!==v.treeRootPath.value&&(v.treePath.value=K,v.treeRootPath.value=re,v.clearTreeNodes(),v.loadTreeDirectory(K))}),Vue.watch(()=>e.theme,T=>{let K=w.activeFile.value;K?.cmInstance&&K.cmInstance.setOption("theme",T==="dark"?"material-darker":"default")}),Vue.watch(()=>s(),T=>{if(T&&!v.treeRootPath.value){let K=n(T);v.treePath.value=T,v.treeRootPath.value=K,v.clearTreeNodes(),v.loadTreeDirectory(T)}}),Vue.watch(()=>w.activeFile.value?.content,(T,K)=>{let re=w.activeFile.value;if(re&&T!=null&&K==null&&!re.cmInstance&&(!re.fileType||re.fileType==="text")){if(Bt(re.name)&&V.mdPreviewMode.value)return;Vue.nextTick(()=>{setTimeout(()=>{re.cmInstance||E.createEditor(re)},150)})}}),Vue.watch([V.mdRenderedHtml,V.mdPreviewMode],([T,K])=>{T&&K&&Vue.nextTick(()=>{setTimeout(()=>V.renderMermaidBlocks(),50)})});let ve=T=>{!(a.value&&a.value.offsetParent!==null)&&!R.quickOpenVisible.value&&!R.goToLineVisible.value&&!x.findBarVisible.value||((T.ctrlKey||T.metaKey)&&T.key==="p"?(T.preventDefault(),R.quickOpenVisible.value?R.closeQuickOpen():R.openQuickOpen()):(T.ctrlKey||T.metaKey)&&T.key==="g"?(T.preventDefault(),R.goToLineVisible.value?R.closeGoToLine():R.openGoToLine()):(T.ctrlKey||T.metaKey)&&T.key==="f"?w.activeFile.value&&(T.preventDefault(),x.openFindBar(!1)):(T.ctrlKey||T.metaKey)&&(T.key==="r"||T.key==="h")?w.activeFile.value&&(T.preventDefault(),x.openFindBar(!0)):T.key==="Escape"&&(x.findBarVisible.value&&x.closeFindBar(),L.selectedPaths.size>0&&L.clearSelection(),R.quickOpenVisible.value&&R.closeQuickOpen(),R.goToLineVisible.value&&R.closeGoToLine()))},ge=()=>{L.hideContextMenu()},pe=()=>{c.value=window.innerWidth<=768};return Vue.watch(()=>w.activeFileIndex.value,(T,K)=>{c.value&&T>=0&&T!==K&&(d.value="editor")}),Vue.watch(()=>w.openFiles.value.length,T=>{c.value&&T===0&&(d.value="tree")}),Vue.onMounted(()=>{window.addEventListener("workbench-message",A.handleWorkbenchMessage),window.addEventListener("open-file-in-explorer",A.handleOpenFile),window.addEventListener("conversation-deleted",w.handleConversationDeleted),window.addEventListener("keydown",ve),document.addEventListener("click",ge),window.addEventListener("resize",pe),V.initMermaid(),e.currentAgent&&(v.initFileBrowser(),e.sendWsMessage({type:"restore_file_tabs"}))}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",A.handleWorkbenchMessage),window.removeEventListener("open-file-in-explorer",A.handleOpenFile),window.removeEventListener("conversation-deleted",w.handleConversationDeleted),window.removeEventListener("keydown",ve),document.removeEventListener("click",ge),window.removeEventListener("resize",pe),E.destroyEditor(),L.cleanup()}),{store:e,debugStatus:E.debugStatus,rootEl:a,isMobile:c,mobileView:d,mobileGoBack:u,fontSize:f,zoomIn:g,zoomOut:m,onWheel:b,treePath:v.treePath,treeRootPath:v.treeRootPath,treeNodes:v.treeNodes,flattenedTree:v.flattenedTree,editingTreePath:v.editingTreePath,treePathInputRef:v.treePathInputRef,rootFolderName:v.rootFolderName,rootExpanded:v.rootExpanded,toggleRootExpand:v.toggleRootExpand,collapseAll:v.collapseAll,startTreePathEdit:v.startTreePathEdit,confirmTreePath:v.confirmTreePath,cancelTreePathEdit:v.cancelTreePathEdit,treePanelWidth:I,isTreeResizing:y,startTreeResize:S,openFiles:w.openFiles,activeFileIndex:w.activeFileIndex,activeFile:w.activeFile,fileLoading:w.fileLoading,fileSaving:w.fileSaving,editorContainer:l,officePreviewContainer:V.officePreviewContainer,mdPreviewRef:V.mdPreviewRef,isActiveMarkdown:V.isActiveMarkdown,mdPreviewMode:V.mdPreviewMode,mdRenderedHtml:V.mdRenderedHtml,switchToMdEdit:V.switchToMdEdit,folderPickerOpen:P.folderPickerOpen,folderPickerPath:P.folderPickerPath,folderPickerEntries:P.folderPickerEntries,folderPickerLoading:P.folderPickerLoading,folderPickerSelected:P.folderPickerSelected,searchQuery:R.searchQuery,searchResults:R.searchResults,searchLoading:R.searchLoading,onSearchInput:R.onSearchInput,clearSearch:R.clearSearch,onSearchResultClick:R.onSearchResultClick,quickOpenVisible:R.quickOpenVisible,quickOpenQuery:R.quickOpenQuery,quickOpenResults:R.quickOpenResults,quickOpenSelectedIndex:R.quickOpenSelectedIndex,quickOpenLoading:R.quickOpenLoading,quickOpenInput:R.quickOpenInput,openQuickOpen:R.openQuickOpen,closeQuickOpen:R.closeQuickOpen,onQuickOpenInput:R.onQuickOpenInput,quickOpenSelectNext:R.quickOpenSelectNext,quickOpenSelectPrev:R.quickOpenSelectPrev,quickOpenConfirm:R.quickOpenConfirm,quickOpenOpenFile:R.quickOpenOpenFile,goToLineVisible:R.goToLineVisible,goToLineValue:R.goToLineValue,goToLineInput:R.goToLineInput,openGoToLine:R.openGoToLine,closeGoToLine:R.closeGoToLine,goToLineConfirm:me,findBarVisible:x.findBarVisible,replaceBarVisible:x.replaceBarVisible,findQuery:x.findQuery,replaceQuery:x.replaceQuery,findCaseSensitive:x.findCaseSensitive,findUseRegex:x.findUseRegex,findMatchCount:x.findMatchCount,findMatchIndex:x.findMatchIndex,findInputRef:x.findInputRef,replaceInputRef:x.replaceInputRef,onFindInput:x.onFindInput,findNext:x.findNext,findPrev:x.findPrev,openFindBar:x.openFindBar,closeFindBar:x.closeFindBar,toggleReplaceBar:x.toggleReplaceBar,replaceOne:x.replaceOne,replaceAll:x.replaceAll,selectedPaths:L.selectedPaths,fileOperating:L.fileOperating,fileOpFeedback:L.fileOpFeedback,newFileDialogVisible:L.newFileDialogVisible,newFileName:L.newFileName,newFileType:L.newFileType,newFileInput:L.newFileInput,moveDialogVisible:L.moveDialogVisible,moveDestination:L.moveDestination,moveDestInput:L.moveDestInput,toggleSelection:L.toggleSelection,clearSelection:L.clearSelection,showNewFileDialog:L.showNewFileDialog,confirmNewFile:L.confirmNewFile,deleteSingleFile:_,deleteSelected:j,openMoveDialog:L.openMoveDialog,confirmMove:L.confirmMove,contextMenu:L.contextMenu,showContextMenu:L.showContextMenu,hideContextMenu:L.hideContextMenu,ctxRename:L.ctxRename,ctxCopy:L.ctxCopy,ctxMoveTo:L.ctxMoveTo,ctxDelete:B,ctxDownload:L.ctxDownload,renameDialogVisible:L.renameDialogVisible,renameNewName:L.renameNewName,renameInput:L.renameInput,confirmRename:L.confirmRename,dragState:L.dragState,externalDropActive:L.externalDropActive,onDragStart:L.onDragStart,onDragOver:L.onDragOver,onDragLeave:L.onDragLeave,onDrop:z,onTreeDragOver:L.onTreeDragOver,onTreeDragLeave:L.onTreeDragLeave,onTreeDrop:se,loadRootDirectory:v.loadRootDirectory,onTreeItemClick:v.onTreeItemClick,openFileInTab:w.openFileInTab,switchToTab:w.switchToTab,closeFileTab:w.closeFileTab,saveFile:w.saveFile,openFolderPicker:P.openFolderPicker,folderPickerNavigateUp:P.folderPickerNavigateUp,folderPickerSelectItem:P.folderPickerSelectItem,folderPickerEnter:P.folderPickerEnter,confirmFolderPicker:P.confirmFolderPicker,getFileIcon:()=>"",getFileIconHtml:r,getFolderIcon:i,formatSize:o,refresh:v.refresh,placeholderPath:Vue.computed(()=>{let T=s();return T?t("files.workDir",{dir:T}):t("files.enterDirPath")})}}}});var Oi,hl=F(()=>{xf();Of();ng();Oi={name:"WorkbenchPanel",components:{TerminalTab:Af,GitStatusTab:Hf,FilesTab:sg},template:`
|
|
2671
|
+
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=()=>e.effectiveWorkDir||"",n=T=>T?T.replace(/\\/g,"/"):"",r=T=>Vi(T),i=T=>Hi(T),o=T=>T==null?"":T<1024?T+" B":T<1024*1024?(T/1024).toFixed(1)+" KB":(T/(1024*1024)).toFixed(1)+" MB",a=Vue.ref(null),l=Vue.ref(null),c=Vue.ref(window.innerWidth<=768),d=Vue.ref("tree"),u=()=>{d.value="tree"},f=Vue.ref(parseInt(localStorage.getItem("filesFontSize"))||15),p=T=>{f.value=Math.max(8,Math.min(24,T)),localStorage.setItem("filesFontSize",f.value.toString());let K=w.activeFile.value;K?.cmInstance&&(K.cmInstance.getWrapperElement().style.fontSize=f.value+"px",K.cmInstance.refresh())},g=()=>p(f.value+1),m=()=>p(f.value-1),b=T=>{T.deltaY<0?g():m()},I=Vue.ref(parseInt(localStorage.getItem("filePanelWidth"))||220),y=Vue.ref(!1),S=T=>{T.preventDefault();let K=T.type==="touchstart";y.value=!0;let re=K?T.touches[0].clientX:T.clientX,he=I.value;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let Pe=T.target.closest(".file-two-col"),U=Pe?Pe.offsetWidth*.5:400,B=O=>{let D=K?O.touches[0].clientX:O.clientX;I.value=Math.max(120,Math.min(U,he+(D-re)))},N=()=>{y.value=!1,document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("filePanelWidth",I.value.toString()),document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",N),document.removeEventListener("touchmove",B),document.removeEventListener("touchend",N)};document.addEventListener(K?"touchmove":"mousemove",B),document.addEventListener(K?"touchend":"mouseup",N)},w,v,h=Vue.computed(()=>w?w.activeFile.value:null),M=Vue.computed(()=>v?v.treePath.value:""),x=Ff(h),E=Uf(e,{activeFile:h,editorContainer:l,fontSize:f,clearFindMarkers:x.clearFindMarkers,openFindBar:x.openFindBar,saveFile:()=>w.saveFile()}),V=Kf(h,{editorContainer:l,createEditor:E.createEditor,t}),L=Bf(e,{getEffectiveWorkDir:s,treePath:M});w=Zf(e,{normalizePath:n,getEffectiveWorkDir:s,editorContainer:l,createEditor:E.createEditor,destroyEditor:E.destroyEditor,clearFindMarkers:x.clearFindMarkers,saveCurrentUndoHistory:E.saveCurrentUndoHistory,saveAllUndoHistory:E.saveAllUndoHistory,cleanupUndoHistory:E.cleanupUndoHistory,deleteConversationHistory:E.deleteConversationHistory,debugStatus:E.debugStatus,mdPreviewMode:V.mdPreviewMode,renderOfficeLocal:V.renderOfficeLocal,performFind:x.performFind,findBarVisible:x.findBarVisible,findQuery:x.findQuery,t}),v=Wf(e,{getEffectiveWorkDir:s,normalizePath:n,selectedPaths:L.selectedPaths,lastClickedIndex:L.lastClickedIndex,openFileInTab:(...T)=>w.openFileInTab(...T),clearSelection:L.clearSelection});let R=Yf(e,{getEffectiveWorkDir:s,treePath:v.treePath,openFileInTab:(...T)=>w.openFileInTab(...T),normalizePath:n,treeRootPath:v.treeRootPath,treeNodes:v.treeNodes,loadTreeDirectory:v.loadTreeDirectory});E.setKeyBindings({openQuickOpen:R.openQuickOpen,openGoToLine:R.openGoToLine});let P=Qf(e,{getEffectiveWorkDir:s,treePath:v.treePath,treeRootPath:v.treeRootPath,treeNodes:v.treeNodes,normalizePath:n,loadTreeDirectory:v.loadTreeDirectory}),A=eg({store:e,normalizePath:n,getEffectiveWorkDir:s,openFiles:w.openFiles,activeFileIndex:w.activeFileIndex,activeFile:w.activeFile,fileLoading:w.fileLoading,fileSaving:w.fileSaving,saveTabsState:w.saveTabsState,createEditor:E.createEditor,openFileInTab:w.openFileInTab,tree:v,fp:P,qo:R,ops:L,mdPreviewMode:V.mdPreviewMode,renderOfficeLocal:V.renderOfficeLocal,editorContainer:l,debugStatus:E.debugStatus}),_=T=>L.deleteSingleFile(T,t),j=()=>L.deleteSelected(t),q=()=>L.ctxDelete(t),z=(T,K)=>L.onDrop(T,K,L.handleExternalFileDrop),se=T=>L.onTreeDrop(T,v.treeRootPath.value,L.handleExternalFileDrop),me=()=>R.goToLineConfirm(w.activeFile);Vue.watch(()=>e.currentAgent,()=>{w.saveTabsState(e.currentConversation),E.destroyEditor(),v.clearTreeNodes(),w.openFiles.value=[],w.activeFileIndex.value=-1,w.fileLoading.value=!1,e.currentAgent&&Vue.nextTick(()=>v.initFileBrowser())});let ae=e.currentConversation;Vue.watch(()=>e.currentConversation,T=>{w.saveTabsState(ae),ae=T,w.restoreTabsState(T);let K=s(),re=n(K);K&&re!==v.treeRootPath.value&&(v.treePath.value=K,v.treeRootPath.value=re,v.clearTreeNodes(),v.loadTreeDirectory(K))}),Vue.watch(()=>e.theme,T=>{let K=w.activeFile.value;K?.cmInstance&&K.cmInstance.setOption("theme",T==="dark"?"material-darker":"default")}),Vue.watch(()=>s(),T=>{if(T&&!v.treeRootPath.value){let K=n(T);v.treePath.value=T,v.treeRootPath.value=K,v.clearTreeNodes(),v.loadTreeDirectory(T)}}),Vue.watch(()=>w.activeFile.value?.content,(T,K)=>{let re=w.activeFile.value;if(re&&T!=null&&K==null&&!re.cmInstance&&(!re.fileType||re.fileType==="text")){if(qt(re.name)&&V.mdPreviewMode.value)return;Vue.nextTick(()=>{setTimeout(()=>{re.cmInstance||E.createEditor(re)},150)})}}),Vue.watch([V.mdRenderedHtml,V.mdPreviewMode],([T,K])=>{T&&K&&Vue.nextTick(()=>{setTimeout(()=>V.renderMermaidBlocks(),50)})});let ve=T=>{!(a.value&&a.value.offsetParent!==null)&&!R.quickOpenVisible.value&&!R.goToLineVisible.value&&!x.findBarVisible.value||((T.ctrlKey||T.metaKey)&&T.key==="p"?(T.preventDefault(),R.quickOpenVisible.value?R.closeQuickOpen():R.openQuickOpen()):(T.ctrlKey||T.metaKey)&&T.key==="g"?(T.preventDefault(),R.goToLineVisible.value?R.closeGoToLine():R.openGoToLine()):(T.ctrlKey||T.metaKey)&&T.key==="f"?w.activeFile.value&&(T.preventDefault(),x.openFindBar(!1)):(T.ctrlKey||T.metaKey)&&(T.key==="r"||T.key==="h")?w.activeFile.value&&(T.preventDefault(),x.openFindBar(!0)):T.key==="Escape"&&(x.findBarVisible.value&&x.closeFindBar(),L.selectedPaths.size>0&&L.clearSelection(),R.quickOpenVisible.value&&R.closeQuickOpen(),R.goToLineVisible.value&&R.closeGoToLine()))},ge=()=>{L.hideContextMenu()},pe=()=>{c.value=window.innerWidth<=768};return Vue.watch(()=>w.activeFileIndex.value,(T,K)=>{c.value&&T>=0&&T!==K&&(d.value="editor")}),Vue.watch(()=>w.openFiles.value.length,T=>{c.value&&T===0&&(d.value="tree")}),Vue.onMounted(()=>{window.addEventListener("workbench-message",A.handleWorkbenchMessage),window.addEventListener("open-file-in-explorer",A.handleOpenFile),window.addEventListener("conversation-deleted",w.handleConversationDeleted),window.addEventListener("keydown",ve),document.addEventListener("click",ge),window.addEventListener("resize",pe),V.initMermaid(),e.currentAgent&&(v.initFileBrowser(),e.sendWsMessage({type:"restore_file_tabs"}))}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",A.handleWorkbenchMessage),window.removeEventListener("open-file-in-explorer",A.handleOpenFile),window.removeEventListener("conversation-deleted",w.handleConversationDeleted),window.removeEventListener("keydown",ve),document.removeEventListener("click",ge),window.removeEventListener("resize",pe),E.destroyEditor(),L.cleanup()}),{store:e,debugStatus:E.debugStatus,rootEl:a,isMobile:c,mobileView:d,mobileGoBack:u,fontSize:f,zoomIn:g,zoomOut:m,onWheel:b,treePath:v.treePath,treeRootPath:v.treeRootPath,treeNodes:v.treeNodes,flattenedTree:v.flattenedTree,editingTreePath:v.editingTreePath,treePathInputRef:v.treePathInputRef,rootFolderName:v.rootFolderName,rootExpanded:v.rootExpanded,toggleRootExpand:v.toggleRootExpand,collapseAll:v.collapseAll,startTreePathEdit:v.startTreePathEdit,confirmTreePath:v.confirmTreePath,cancelTreePathEdit:v.cancelTreePathEdit,treePanelWidth:I,isTreeResizing:y,startTreeResize:S,openFiles:w.openFiles,activeFileIndex:w.activeFileIndex,activeFile:w.activeFile,fileLoading:w.fileLoading,fileSaving:w.fileSaving,editorContainer:l,officePreviewContainer:V.officePreviewContainer,mdPreviewRef:V.mdPreviewRef,isActiveMarkdown:V.isActiveMarkdown,mdPreviewMode:V.mdPreviewMode,mdRenderedHtml:V.mdRenderedHtml,switchToMdEdit:V.switchToMdEdit,folderPickerOpen:P.folderPickerOpen,folderPickerPath:P.folderPickerPath,folderPickerEntries:P.folderPickerEntries,folderPickerLoading:P.folderPickerLoading,folderPickerSelected:P.folderPickerSelected,searchQuery:R.searchQuery,searchResults:R.searchResults,searchLoading:R.searchLoading,onSearchInput:R.onSearchInput,clearSearch:R.clearSearch,onSearchResultClick:R.onSearchResultClick,quickOpenVisible:R.quickOpenVisible,quickOpenQuery:R.quickOpenQuery,quickOpenResults:R.quickOpenResults,quickOpenSelectedIndex:R.quickOpenSelectedIndex,quickOpenLoading:R.quickOpenLoading,quickOpenInput:R.quickOpenInput,openQuickOpen:R.openQuickOpen,closeQuickOpen:R.closeQuickOpen,onQuickOpenInput:R.onQuickOpenInput,quickOpenSelectNext:R.quickOpenSelectNext,quickOpenSelectPrev:R.quickOpenSelectPrev,quickOpenConfirm:R.quickOpenConfirm,quickOpenOpenFile:R.quickOpenOpenFile,goToLineVisible:R.goToLineVisible,goToLineValue:R.goToLineValue,goToLineInput:R.goToLineInput,openGoToLine:R.openGoToLine,closeGoToLine:R.closeGoToLine,goToLineConfirm:me,findBarVisible:x.findBarVisible,replaceBarVisible:x.replaceBarVisible,findQuery:x.findQuery,replaceQuery:x.replaceQuery,findCaseSensitive:x.findCaseSensitive,findUseRegex:x.findUseRegex,findMatchCount:x.findMatchCount,findMatchIndex:x.findMatchIndex,findInputRef:x.findInputRef,replaceInputRef:x.replaceInputRef,onFindInput:x.onFindInput,findNext:x.findNext,findPrev:x.findPrev,openFindBar:x.openFindBar,closeFindBar:x.closeFindBar,toggleReplaceBar:x.toggleReplaceBar,replaceOne:x.replaceOne,replaceAll:x.replaceAll,selectedPaths:L.selectedPaths,fileOperating:L.fileOperating,fileOpFeedback:L.fileOpFeedback,newFileDialogVisible:L.newFileDialogVisible,newFileName:L.newFileName,newFileType:L.newFileType,newFileInput:L.newFileInput,moveDialogVisible:L.moveDialogVisible,moveDestination:L.moveDestination,moveDestInput:L.moveDestInput,toggleSelection:L.toggleSelection,clearSelection:L.clearSelection,showNewFileDialog:L.showNewFileDialog,confirmNewFile:L.confirmNewFile,deleteSingleFile:_,deleteSelected:j,openMoveDialog:L.openMoveDialog,confirmMove:L.confirmMove,contextMenu:L.contextMenu,showContextMenu:L.showContextMenu,hideContextMenu:L.hideContextMenu,ctxRename:L.ctxRename,ctxCopy:L.ctxCopy,ctxMoveTo:L.ctxMoveTo,ctxDelete:q,ctxDownload:L.ctxDownload,renameDialogVisible:L.renameDialogVisible,renameNewName:L.renameNewName,renameInput:L.renameInput,confirmRename:L.confirmRename,dragState:L.dragState,externalDropActive:L.externalDropActive,onDragStart:L.onDragStart,onDragOver:L.onDragOver,onDragLeave:L.onDragLeave,onDrop:z,onTreeDragOver:L.onTreeDragOver,onTreeDragLeave:L.onTreeDragLeave,onTreeDrop:se,loadRootDirectory:v.loadRootDirectory,onTreeItemClick:v.onTreeItemClick,openFileInTab:w.openFileInTab,switchToTab:w.switchToTab,closeFileTab:w.closeFileTab,saveFile:w.saveFile,openFolderPicker:P.openFolderPicker,folderPickerNavigateUp:P.folderPickerNavigateUp,folderPickerSelectItem:P.folderPickerSelectItem,folderPickerEnter:P.folderPickerEnter,confirmFolderPicker:P.confirmFolderPicker,getFileIcon:()=>"",getFileIconHtml:r,getFolderIcon:i,formatSize:o,refresh:v.refresh,placeholderPath:Vue.computed(()=>{let T=s();return T?t("files.workDir",{dir:T}):t("files.enterDirPath")})}}}});var Oi,hl=F(()=>{xf();Of();ng();Oi={name:"WorkbenchPanel",components:{TerminalTab:Af,GitStatusTab:Hf,FilesTab:sg},template:`
|
|
2672
2672
|
<div class="workbench-panel" :class="{ expanded: store.workbenchExpanded, maximized: store.workbenchMaximized }" :style="panelStyle">
|
|
2673
2673
|
<!-- \u5C55\u5F00\u65F6\u7684\u5B8C\u6574\u9762\u677F -->
|
|
2674
2674
|
<div class="workbench-content" v-if="store.workbenchExpanded">
|
|
@@ -3469,7 +3469,7 @@ ${String(e||"").trim()}
|
|
|
3469
3469
|
</div>
|
|
3470
3470
|
</div>
|
|
3471
3471
|
</div>
|
|
3472
|
-
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.getCurrentInstance(),r=S=>n?.proxy?.$t?.(S)??S,i=Vue.computed(()=>s.yeaftMcpServers||[]),o=Vue.computed(()=>s.yeaftMcpRuntime||{connected:!1,toolCount:0,perServer:[]}),a=Vue.computed(()=>!!s.yeaftMcpLoading),l=Vue.computed(()=>{let S=new Map((o.value.perServer||[]).map(w=>[w.name,w]));return i.value.map(w=>{let v=S.get(w.name);return{...w,ready:!!(v&&v.ready),toolCount:v?v.toolCount:0}})}),c=Vue.reactive({name:"",command:"",argsRaw:"",envRaw:""}),d=Vue.ref("");function u(){c.name="",c.command="",c.argsRaw="",c.envRaw="",d.value=""}function f(S){if(!S)return[];let w=[],v=/"([^"]*)"|'([^']*)'|(\S+)/g,h;for(;(h=v.exec(S))!==null;)w.push(h[1]??h[2]??h[3]);return w}function p(S){if(!S)return{};let w={},v=S.split(/\r?\n/);for(let h of v){let M=h.trim();if(!M||M.startsWith("#"))continue;let x=M.indexOf("=");if(x<0)continue;let E=M.slice(0,x).trim(),V=M.slice(x+1);E&&(w[E]=V)}return w}function g(){d.value="";let S=(c.name||"").trim(),w=(c.command||"").trim();if(!S)return d.value=r("settings.mcp.errors.nameRequired"),null;if(!/^[a-z0-9_-]+$/.test(S))return d.value=r("settings.mcp.errors.nameFormat"),null;if(!w)return d.value=r("settings.mcp.errors.commandRequired"),null;let v=[],h={};try{v=f(c.argsRaw)}catch{return d.value=r("settings.mcp.errors.argsParse"),null}try{h=p(c.envRaw)}catch{return d.value=r("settings.mcp.errors.envParse"),null}return{name:S,command:w,args:v,env:h}}async function m(){let S=g();if(!S)return;let w=await s.addYeaftMcpServer(S);if(w?.error){t("message",w.error,!0);return}w?.connectError?t("message",r("settings.mcp.connectFailed")+": "+w.connectError,!0):t("message",r("settings.mcp.addSuccess"),!1),u()}async function b(S){if(!S||!confirm(r("settings.mcp.confirmRemove").replace("{name}",S)))return;let w=await s.removeYeaftMcpServer(S);w?.error?t("message",w.error,!0):t("message",r("settings.mcp.removeSuccess"),!1)}async function I(S){let w=await s.reloadYeaftMcpServer(S);w?.error?t("message",w.error,!0):t("message",r("settings.mcp.reloadSuccess"),!1)}async function y(){let S=await s.reloadYeaftMcpServer(null);S?.error?t("message",S.error,!0):t("message",r("settings.mcp.reloadSuccess"),!1)}return Vue.onMounted(()=>{s.loadYeaftMcpServers()}),{servers:i,runtime:o,loading:a,serversWithStatus:l,form:c,formError:d,resetForm:u,addServer:m,removeOne:b,reloadOne:I,reloadAll:y}}}});var Fi,vl=F(()=>{gt();
|
|
3472
|
+
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.getCurrentInstance(),r=S=>n?.proxy?.$t?.(S)??S,i=Vue.computed(()=>s.yeaftMcpServers||[]),o=Vue.computed(()=>s.yeaftMcpRuntime||{connected:!1,toolCount:0,perServer:[]}),a=Vue.computed(()=>!!s.yeaftMcpLoading),l=Vue.computed(()=>{let S=new Map((o.value.perServer||[]).map(w=>[w.name,w]));return i.value.map(w=>{let v=S.get(w.name);return{...w,ready:!!(v&&v.ready),toolCount:v?v.toolCount:0}})}),c=Vue.reactive({name:"",command:"",argsRaw:"",envRaw:""}),d=Vue.ref("");function u(){c.name="",c.command="",c.argsRaw="",c.envRaw="",d.value=""}function f(S){if(!S)return[];let w=[],v=/"([^"]*)"|'([^']*)'|(\S+)/g,h;for(;(h=v.exec(S))!==null;)w.push(h[1]??h[2]??h[3]);return w}function p(S){if(!S)return{};let w={},v=S.split(/\r?\n/);for(let h of v){let M=h.trim();if(!M||M.startsWith("#"))continue;let x=M.indexOf("=");if(x<0)continue;let E=M.slice(0,x).trim(),V=M.slice(x+1);E&&(w[E]=V)}return w}function g(){d.value="";let S=(c.name||"").trim(),w=(c.command||"").trim();if(!S)return d.value=r("settings.mcp.errors.nameRequired"),null;if(!/^[a-z0-9_-]+$/.test(S))return d.value=r("settings.mcp.errors.nameFormat"),null;if(!w)return d.value=r("settings.mcp.errors.commandRequired"),null;let v=[],h={};try{v=f(c.argsRaw)}catch{return d.value=r("settings.mcp.errors.argsParse"),null}try{h=p(c.envRaw)}catch{return d.value=r("settings.mcp.errors.envParse"),null}return{name:S,command:w,args:v,env:h}}async function m(){let S=g();if(!S)return;let w=await s.addYeaftMcpServer(S);if(w?.error){t("message",w.error,!0);return}w?.connectError?t("message",r("settings.mcp.connectFailed")+": "+w.connectError,!0):t("message",r("settings.mcp.addSuccess"),!1),u()}async function b(S){if(!S||!confirm(r("settings.mcp.confirmRemove").replace("{name}",S)))return;let w=await s.removeYeaftMcpServer(S);w?.error?t("message",w.error,!0):t("message",r("settings.mcp.removeSuccess"),!1)}async function I(S){let w=await s.reloadYeaftMcpServer(S);w?.error?t("message",w.error,!0):t("message",r("settings.mcp.reloadSuccess"),!1)}async function y(){let S=await s.reloadYeaftMcpServer(null);S?.error?t("message",S.error,!0):t("message",r("settings.mcp.reloadSuccess"),!1)}return Vue.onMounted(()=>{s.loadYeaftMcpServers()}),{servers:i,runtime:o,loading:a,serversWithStatus:l,form:c,formError:d,resetForm:u,addServer:m,removeOne:b,reloadOne:I,reloadAll:y}}}});var Fi,vl=F(()=>{gt();qa();Ua();Ms();ig();dg();pg();gg();Fi={name:"SettingsPanel",components:{DashboardTab:rg,VpCrudPanel:cg,SearchSettingsTab:ug,McpTab:fg},props:{visible:Boolean,initialTab:{type:String,default:""},initialSubTab:{type:String,default:""},initialEditVpId:{type:String,default:""}},emits:["close"],template:`
|
|
3473
3473
|
<div
|
|
3474
3474
|
class="settings-overlay"
|
|
3475
3475
|
v-if="visible"
|
|
@@ -3708,6 +3708,25 @@ ${String(e||"").trim()}
|
|
|
3708
3708
|
</div>
|
|
3709
3709
|
</div>
|
|
3710
3710
|
</div>
|
|
3711
|
+
<div class="sp-row">
|
|
3712
|
+
<div class="sp-row-left">
|
|
3713
|
+
<span class="sp-label">{{ $t('settings.general.telemetry') }}</span>
|
|
3714
|
+
<span class="sp-desc">{{ $t('settings.general.telemetryDesc') }}</span>
|
|
3715
|
+
</div>
|
|
3716
|
+
<button class="sp-btn sp-btn-muted" @click="toggleTelemetry" :disabled="telemetrySaving">
|
|
3717
|
+
{{ telemetryEnabled ? $t('settings.general.telemetryOn') : $t('settings.general.telemetryOff') }}
|
|
3718
|
+
</button>
|
|
3719
|
+
</div>
|
|
3720
|
+
<div v-if="telemetrySettings" class="sp-row sp-row-stack">
|
|
3721
|
+
<div class="sp-row-left">
|
|
3722
|
+
<span class="sp-label">{{ $t('settings.general.telemetryRawLimit') }}</span>
|
|
3723
|
+
<span class="sp-desc">{{ formatBytes(telemetrySettings.rawExchangeMaxBytes) }}</span>
|
|
3724
|
+
</div>
|
|
3725
|
+
<div class="sp-actions-row">
|
|
3726
|
+
<input class="sp-input sp-input-small" type="number" min="0" max="4194304" step="65536" v-model.number="telemetryDraft.rawExchangeMaxBytes">
|
|
3727
|
+
<button class="sp-btn sp-btn-muted" @click="saveTelemetry" :disabled="telemetrySaving">{{ $t('common.save') }}</button>
|
|
3728
|
+
</div>
|
|
3729
|
+
</div>
|
|
3711
3730
|
<div class="sp-row">
|
|
3712
3731
|
<span class="sp-label">{{ $t('files.officePreviewMode') }}</span>
|
|
3713
3732
|
<div class="sp-custom-select" :class="{ open: openDropdown === 'officePreview' }" v-click-outside="() => closeDropdown('officePreview')">
|
|
@@ -3868,7 +3887,7 @@ ${String(e||"").trim()}
|
|
|
3868
3887
|
</div>
|
|
3869
3888
|
</div>
|
|
3870
3889
|
</div>
|
|
3871
|
-
`,directives:{"click-outside":{mounted(e,t){e._clickOutside=s=>{e.contains(s.target)||t.value()},document.addEventListener("click",e._clickOutside)},unmounted(e){document.removeEventListener("click",e._clickOutside)}}},data(){let e=Pinia.useChatStore();return{activeTab:"general",yeaftSubTab:"vp",profile:null,agentSecret:null,showSecret:!1,resettingSecret:!1,resetConfirm:!1,currentPassword:"",newPassword:"",confirmPassword:"",changingPassword:!1,deletePassword:"",deleteConfirm:!1,deleteConfirmText:"",deletingAccount:!1,invitations:[],inviteRole:"pro",creatingInvite:!1,message:"",isError:!1,selectedLocale:e.locale,openDropdown:null,officePreviewMode:localStorage.getItem("officePreviewMode")||"local",ssoBoundMessage:"",ssoConflictMessage:"",qrDataUrl:""}},computed:{authStore(){return De()},chatStore(){return Pinia.useChatStore()},roleLabel(){return{admin:this.$t("settings.account.roleAdmin"),pro:this.$t("settings.account.rolePro")}[this.profile?.role]||this.$t("settings.account.rolePro")},accountDisplayName(){let e=this.profile;return e?e.displayName&&e.displayName!==e.username?e.displayName:e.username||"-":"-"},visibleTabs(){let e=[{key:"general",label:this.$t("settings.tabs.general")},{key:"account",label:this.$t("settings.tabs.account")},{key:"security",label:this.$t("settings.tabs.security")}];return(this.authStore.role==="admin"||this.authStore.role==="pro")&&e.push({key:"yeaft",label:this.$t("settings.tabs.yeaft")}),this.authStore.role==="admin"&&(e.push({key:"invitations",label:this.$t("settings.tabs.invitations")}),e.push({key:"dashboard",label:this.$t("settings.tabs.dashboard")})),e},currentTabLabel(){return this.visibleTabs.find(t=>t.key===this.activeTab)?.label||""},themeOptions(){return[{value:"light",label:this.$t("settings.general.lightTheme")},{value:"dark",label:this.$t("settings.general.darkTheme")}]},yeaftSubTabs(){return[{key:"vp",label:this.$t("settings.yeaft.tabs.vp")},{key:"search",label:this.$t("settings.yeaft.tabs.search")},{key:"mcp",label:this.$t("settings.yeaft.tabs.mcp")}]},languageOptions(){return[{value:"zh-CN",label:"\u4E2D\u6587"},{value:"en",label:"English"}]},officePreviewOptions(){return[{value:"local",label:this.$t("files.localRender")},{value:"online",label:this.$t("files.officeOnline")}]},roleOptions(){return[{value:"pro",label:this.$t("settings.invite.proUser")}]},agentSecretActionLabel(){return this.agentSecret?this.$t("settings.security.resetKey"):this.$t("settings.security.generateKey")},agentName(){return ja(this.profile)},agentInstanceId(){return this.agentName},serverWsUrl(){return rr(location)},agentInstallCommand(){return fi()},agentServiceCommand(){return mi({profile:this.profile,agentSecret:this.agentSecret,serverWsUrl:this.serverWsUrl})},agentLlmCommand(){return gi()},ssoProviderRows(){let e=this.authStore,t=new Map((e.linkedIdentities||[]).map(n=>[n.provider,n]));return[{key:"alipay",label:this.$t("login.alipay"),enabled:!!e.ssoProviders.alipay},{key:"microsoft",label:this.$t("login.microsoft"),enabled:!!e.aadEnabled},{key:"github",label:this.$t("login.github"),enabled:!!e.ssoProviders.github},{key:"google",label:this.$t("login.google"),enabled:!!e.ssoProviders.google},{key:"wechat",label:this.$t("login.wechat"),enabled:!!e.ssoProviders.wechat}].filter(n=>n.enabled||t.has(n.key)).map(n=>({...n,linked:t.has(n.key),identity:t.get(n.key)||null}))},qrModalTitle(){let e=this.authStore.qrPanel?.provider;return e==="alipay"?this.$t("login.qr.titleAlipay"):e==="wechat"?this.$t("login.qr.titleWechat"):this.$t("login.qr.title")}},mounted(){if(this.visible)return this.applyInitialEntryPoint(),this.loadData()},watch:{visible(e){e?(this.applyInitialEntryPoint(),this.loadData()):this.authStore.qrPanel&&this.cancelQrBind()},activeTab(e){e==="invitations"&&this.authStore.role==="admin"&&this.loadInvitations()},"authStore.qrPanel.status"(e){if(e==="bound"){let t=this.authStore.qrPanel?.provider;this.authStore.cancelSsoQr(),this.qrDataUrl="",this.authStore.loadIdentities(),this.ssoBoundMessage=this.$t("settings.account.ssoBoundMsg",{provider:t?this.$t("login."+t):""})}},"authStore.qrPanel.authorizeUrl"(e){e&&this.authStore.qrPanel?.intent==="bind"&&this.renderQrCode()}},methods:{trackOverlayPointerDown:at,trackOverlayPointerUp:lt,clearOverlayPointerGesture:ct,onSettingsOverlayClick(e){tt(e)&&this.$emit("close")},onQrOverlayClick(e){tt(e)&&this.cancelQrBind()},changeLanguage(){this.chatStore.changeLocale(this.selectedLocale)},selectLanguage(e){this.selectedLocale=e,this.chatStore.changeLocale(e)},toggleDropdown(e){this.openDropdown=this.openDropdown===e?null:e},closeDropdown(e){this.openDropdown===e&&(this.openDropdown=null)},setTheme(e){this.chatStore.theme!==e&&this.chatStore.toggleTheme()},setOfficePreviewMode(e){this.officePreviewMode=e,localStorage.setItem("officePreviewMode",e)},applyInitialEntryPoint(){this.initialTab&&this.visibleTabs.some(e=>e.key===this.initialTab)&&(this.activeTab=this.initialTab),this.initialSubTab&&this.activeTab==="yeaft"&&(this.yeaftSubTab=this.yeaftSubTabs.some(e=>e.key===this.initialSubTab)?this.initialSubTab:"vp"),this.initialEditVpId&&this.activeTab==="yeaft"&&(this.yeaftSubTab="vp")},async loadData(){this.message="",this._consumeSsoQueryFlags();try{let e=this.getHeaders(),[t,s]=await Promise.all([fetch("/api/user/profile",{headers:e}),fetch("/api/user/agent-secret",{headers:e})]);if(t.ok)this.profile=await t.json();else{let n=await t.json().catch(()=>({}));this.showMessage(n.error||this.$t("settings.account.profileLoadFailed"),!0)}if(s.ok){let n=await s.json();this.applyAgentSecretResponse(n)}this.authStore.role==="admin"&&this.activeTab==="invitations"&&await this.loadInvitations();try{await this.authStore.loadIdentities()}catch{}}catch{}},_consumeSsoQueryFlags(){let e=window.location.hash||"",t=e.indexOf("?");if(t<0)return;let s=new URLSearchParams(e.slice(t+1)),n=s.get("ssoBound"),r=s.get("ssoError"),i=s.get("provider");if(n&&(this.ssoBoundMessage=this.$t("settings.account.ssoBoundMsg",{provider:n}),this.activeTab="account"),r==="conflict"&&(this.ssoConflictMessage=this.$t("settings.account.ssoConflictMsg",{provider:i||""}),this.activeTab="account"),n||r)try{history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}},bindSso(e){if(this.ssoBoundMessage="",this.ssoConflictMessage="",e==="alipay"&&ui()){this.authStore.bindSso(e);return}if(e==="alipay"&&Zs()){this.authStore.loginWithAlipayMobile({intent:"bind"});return}if(e==="wechat"&&(Zs()||di())){this.ssoConflictMessage=this.$t("login.wechat.mobileUnsupported");return}e==="alipay"||e==="wechat"?this.startQrBind(e):this.authStore.bindSso(e)},async startQrBind(e){if(this.qrDataUrl="",!await this.authStore.startSsoQr(e,{intent:"bind"})){this.ssoConflictMessage=this.authStore.error||this.$t("settings.account.bindFailed");return}this.renderQrCode()},cancelQrBind(){this.authStore.cancelSsoQr(),this.qrDataUrl=""},relaunchAlipayMobile(){let e=this.authStore.qrPanel;if(!e||!e.authorizeUrl)return;let t=`alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent(e.authorizeUrl)}`;window.location.href=t},renderQrCode(){let e=this.authStore.qrPanel;if(!(!e||!e.authorizeUrl)&&typeof qrcode=="function")try{let t=qrcode(0,"M");t.addData(e.authorizeUrl,"Byte"),t.make(),this.qrDataUrl=t.createDataURL(6,4)}catch{}},async unbindSso(e){this.ssoBoundMessage="",this.ssoConflictMessage="",await this.authStore.unbindIdentity(e)||(this.ssoConflictMessage=this.authStore.identitiesError||this.$t("settings.account.unbindFailed"))},canUnbind(e){let t=this.authStore.linkedIdentities||[];return t.some(n=>n.provider===e)?this.authStore.hasPassword?!0:t.length>1:!1},async loadInvitations(){try{let e=await fetch("/api/invitations",{headers:this.getHeaders()});if(e.ok){let t=await e.json();this.invitations=t.invitations.map(s=>({...s,code:s.id,expiresAt:s.expires_at,usedByUsername:s.used_by_username||null}))}}catch{}},getHeaders(){let e={"Content-Type":"application/json"},t=this.authStore.getActiveToken?.()||this.authStore.token;return t&&(e.Authorization=`Bearer ${t}`),e},applyAgentSecretResponse(e){let t=e?.agentSecret||e?.agent_secret||null;this.agentSecret=t&&String(t).trim()?String(t):null},async copySecret(){this.agentSecret&&await this.copyText(this.agentSecret)},async copyText(e){try{await navigator.clipboard.writeText(e),this.showMessage(this.$t("settings.msg.copiedClipboard"))}catch{this.showMessage(this.$t("settings.msg.copyFailed"),!0)}},async resetSecret(){if(this.agentSecret&&!this.resetConfirm){this.resetConfirm=!0;return}this.resettingSecret=!0;try{let e=await fetch("/api/user/agent-secret/reset",{method:"POST",headers:this.getHeaders()});if(e.ok){let t=await e.json();this.applyAgentSecretResponse(t),this.showSecret=!0,this.showMessage(this.$t("settings.msg.keyReset"))}else{let t=await e.json();this.showMessage(t.error||this.$t("settings.msg.resetFailed"),!0)}}catch(e){this.showMessage(this.$t("settings.msg.resetFailed")+": "+e.message,!0)}finally{this.resettingSecret=!1,this.resetConfirm=!1}},async changePassword(){let e=this.profile&&this.profile.hasPassword===!1;if(!e&&!this.currentPassword){this.showMessage(this.$t("settings.security.enterCurrentPwd"),!0);return}if(!this.newPassword||this.newPassword.length<6){this.showMessage(this.$t("settings.security.newPwdMin"),!0);return}if(this.newPassword!==this.confirmPassword){this.showMessage(this.$t("settings.security.pwdMismatch"),!0);return}this.changingPassword=!0;try{let t={newPassword:this.newPassword};e||(t.currentPassword=this.currentPassword);let s=await fetch("/api/user/profile",{method:"PUT",headers:this.getHeaders(),body:JSON.stringify(t)}),n=await s.json();if(s.ok&&n.success){this.showMessage(e?this.$t("settings.security.pwdSet"):this.$t("settings.security.pwdChanged")),this.currentPassword="",this.newPassword="",this.confirmPassword="";try{let r=await fetch("/api/user/profile",{headers:this.getHeaders()});r.ok&&(this.profile=await r.json())}catch{}}else this.showMessage(n.error||this.$t("settings.msg.changeFailed"),!0)}catch(t){this.showMessage(this.$t("settings.msg.changeFailed")+": "+t.message,!0)}finally{this.changingPassword=!1}},cancelDeleteAccount(){this.deleteConfirm=!1,this.deletePassword="",this.deleteConfirmText=""},async deleteAccount(){if(!this.deleteConfirm){this.deleteConfirm=!0;return}let e=this.profile&&this.profile.hasPassword!==!1;if(e&&!this.deletePassword){this.showMessage(this.$t("settings.security.enterCurrentPwd"),!0);return}if(!e&&this.deleteConfirmText!=="DELETE"){this.showMessage(this.$t("settings.security.deleteConfirmRequired"),!0);return}this.deletingAccount=!0;try{let t=await this.authStore.deleteAccount(e?{currentPassword:this.deletePassword}:{confirm:"DELETE"});if(!t.success){this.showMessage(t.error||this.$t("settings.security.deleteFailed"),!0);return}window.location.reload()}finally{this.deletingAccount=!1}},async createInvitation(){this.creatingInvite=!0;try{let e=await fetch("/api/invitations",{method:"POST",headers:this.getHeaders(),body:JSON.stringify({role:this.inviteRole})});if(e.ok)await this.loadInvitations(),this.showMessage(this.$t("settings.msg.inviteCreated"));else{let t=await e.json();this.showMessage(t.error||this.$t("settings.msg.createFailed"),!0)}}catch(e){this.showMessage(this.$t("settings.msg.createFailed")+": "+e.message,!0)}finally{this.creatingInvite=!1}},async copyInviteCode(e){try{await navigator.clipboard.writeText(e),this.showMessage(this.$t("settings.msg.inviteCopied"))}catch{this.showMessage(this.$t("settings.msg.copyFailed"),!0)}},async deleteInvitation(e){try{let t=await fetch(`/api/invitations/${e}`,{method:"DELETE",headers:this.getHeaders()});if(t.ok)await this.loadInvitations(),this.showMessage(this.$t("settings.msg.inviteDeleted"));else{let s=await t.json();this.showMessage(s.error||this.$t("settings.msg.deleteFailed"),!0)}}catch(t){this.showMessage(this.$t("settings.msg.deleteFailed")+": "+t.message,!0)}},inviteStatusClass(e){return e.used_by?"used":e.expiresAt<Date.now()?"expired":""},inviteStatusText(e){return e.used_by?this.$t("settings.invite.used"):e.expiresAt<Date.now()?this.$t("settings.invite.expired"):this.$t("settings.invite.available")},formatTime(e){return new Date(e).toLocaleString()},async doLogout(){await this.authStore.logout(),window.location.reload()},showMessage(e,t=!1){this.message=e,this.isError=t,setTimeout(()=>{this.message=""},3e3)},onLlmMessage(e,t){this.showMessage(e,t)},onYeaftLlmSaved(){let e=this.chatStore?.currentAgent;e&&this.chatStore.sendWsMessage({type:"yeaft_reset",agentId:e})}}}});var mg,hg=F(()=>{mg={name:"ExpertRoleEditor",template:`
|
|
3890
|
+
`,directives:{"click-outside":{mounted(e,t){e._clickOutside=s=>{e.contains(s.target)||t.value()},document.addEventListener("click",e._clickOutside)},unmounted(e){document.removeEventListener("click",e._clickOutside)}}},data(){let e=Pinia.useChatStore();return{activeTab:"general",yeaftSubTab:"vp",profile:null,agentSecret:null,showSecret:!1,resettingSecret:!1,resetConfirm:!1,currentPassword:"",newPassword:"",confirmPassword:"",changingPassword:!1,deletePassword:"",deleteConfirm:!1,deleteConfirmText:"",deletingAccount:!1,invitations:[],inviteRole:"pro",creatingInvite:!1,message:"",isError:!1,selectedLocale:e.locale,openDropdown:null,officePreviewMode:localStorage.getItem("officePreviewMode")||"local",telemetryDraft:{enabled:!0,retentionDays:3,flushIntervalMs:1e3,maxQueueSize:5e3,rawExchangeMaxBytes:524288,traceTextMaxBytes:262144},telemetrySaving:!1,ssoBoundMessage:"",ssoConflictMessage:"",qrDataUrl:""}},computed:{authStore(){return De()},chatStore(){return Pinia.useChatStore()},roleLabel(){return{admin:this.$t("settings.account.roleAdmin"),pro:this.$t("settings.account.rolePro")}[this.profile?.role]||this.$t("settings.account.rolePro")},accountDisplayName(){let e=this.profile;return e?e.displayName&&e.displayName!==e.username?e.displayName:e.username||"-":"-"},visibleTabs(){let e=[{key:"general",label:this.$t("settings.tabs.general")},{key:"account",label:this.$t("settings.tabs.account")},{key:"security",label:this.$t("settings.tabs.security")}];return(this.authStore.role==="admin"||this.authStore.role==="pro")&&e.push({key:"yeaft",label:this.$t("settings.tabs.yeaft")}),this.authStore.role==="admin"&&(e.push({key:"invitations",label:this.$t("settings.tabs.invitations")}),e.push({key:"dashboard",label:this.$t("settings.tabs.dashboard")})),e},currentTabLabel(){return this.visibleTabs.find(t=>t.key===this.activeTab)?.label||""},telemetrySettings(){return this.chatStore.telemetrySettings},telemetryEnabled(){return this.telemetryDraft.enabled!==!1},themeOptions(){return[{value:"light",label:this.$t("settings.general.lightTheme")},{value:"dark",label:this.$t("settings.general.darkTheme")}]},yeaftSubTabs(){return[{key:"vp",label:this.$t("settings.yeaft.tabs.vp")},{key:"search",label:this.$t("settings.yeaft.tabs.search")},{key:"mcp",label:this.$t("settings.yeaft.tabs.mcp")}]},languageOptions(){return[{value:"zh-CN",label:"\u4E2D\u6587"},{value:"en",label:"English"}]},officePreviewOptions(){return[{value:"local",label:this.$t("files.localRender")},{value:"online",label:this.$t("files.officeOnline")}]},roleOptions(){return[{value:"pro",label:this.$t("settings.invite.proUser")}]},agentSecretActionLabel(){return this.agentSecret?this.$t("settings.security.resetKey"):this.$t("settings.security.generateKey")},agentName(){return ja(this.profile)},agentInstanceId(){return this.agentName},serverWsUrl(){return rr(location)},agentInstallCommand(){return fi()},agentServiceCommand(){return mi({profile:this.profile,agentSecret:this.agentSecret,serverWsUrl:this.serverWsUrl})},agentLlmCommand(){return gi()},ssoProviderRows(){let e=this.authStore,t=new Map((e.linkedIdentities||[]).map(n=>[n.provider,n]));return[{key:"alipay",label:this.$t("login.alipay"),enabled:!!e.ssoProviders.alipay},{key:"microsoft",label:this.$t("login.microsoft"),enabled:!!e.aadEnabled},{key:"github",label:this.$t("login.github"),enabled:!!e.ssoProviders.github},{key:"google",label:this.$t("login.google"),enabled:!!e.ssoProviders.google},{key:"wechat",label:this.$t("login.wechat"),enabled:!!e.ssoProviders.wechat}].filter(n=>n.enabled||t.has(n.key)).map(n=>({...n,linked:t.has(n.key),identity:t.get(n.key)||null}))},qrModalTitle(){let e=this.authStore.qrPanel?.provider;return e==="alipay"?this.$t("login.qr.titleAlipay"):e==="wechat"?this.$t("login.qr.titleWechat"):this.$t("login.qr.title")}},mounted(){if(this.visible)return this.applyInitialEntryPoint(),this.loadTelemetry(),this.loadData()},watch:{visible(e){e?(this.applyInitialEntryPoint(),this.loadTelemetry(),this.loadData()):this.authStore.qrPanel&&this.cancelQrBind()},activeTab(e){e==="invitations"&&this.authStore.role==="admin"&&this.loadInvitations()},"authStore.qrPanel.status"(e){if(e==="bound"){let t=this.authStore.qrPanel?.provider;this.authStore.cancelSsoQr(),this.qrDataUrl="",this.authStore.loadIdentities(),this.ssoBoundMessage=this.$t("settings.account.ssoBoundMsg",{provider:t?this.$t("login."+t):""})}},"authStore.qrPanel.authorizeUrl"(e){e&&this.authStore.qrPanel?.intent==="bind"&&this.renderQrCode()}},methods:{trackOverlayPointerDown:at,trackOverlayPointerUp:lt,clearOverlayPointerGesture:ct,async loadTelemetry(){let e=await this.chatStore.loadTelemetrySettings();e&&!e.error&&(this.telemetryDraft={...this.telemetryDraft,...e})},async saveTelemetry(){this.telemetrySaving=!0;try{let e=await this.chatStore.updateTelemetrySettings(this.telemetryDraft);e&&!e.error&&(this.telemetryDraft={...this.telemetryDraft,...e})}finally{this.telemetrySaving=!1}},async toggleTelemetry(){this.telemetryDraft={...this.telemetryDraft,enabled:!this.telemetryEnabled},await this.saveTelemetry()},formatBytes(e){let t=Number(e);return!Number.isFinite(t)||t<1024?`${Math.max(0,t||0)} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`},onSettingsOverlayClick(e){tt(e)&&this.$emit("close")},onQrOverlayClick(e){tt(e)&&this.cancelQrBind()},changeLanguage(){this.chatStore.changeLocale(this.selectedLocale)},selectLanguage(e){this.selectedLocale=e,this.chatStore.changeLocale(e)},toggleDropdown(e){this.openDropdown=this.openDropdown===e?null:e},closeDropdown(e){this.openDropdown===e&&(this.openDropdown=null)},setTheme(e){this.chatStore.theme!==e&&this.chatStore.toggleTheme()},setOfficePreviewMode(e){this.officePreviewMode=e,localStorage.setItem("officePreviewMode",e)},applyInitialEntryPoint(){this.initialTab&&this.visibleTabs.some(e=>e.key===this.initialTab)&&(this.activeTab=this.initialTab),this.initialSubTab&&this.activeTab==="yeaft"&&(this.yeaftSubTab=this.yeaftSubTabs.some(e=>e.key===this.initialSubTab)?this.initialSubTab:"vp"),this.initialEditVpId&&this.activeTab==="yeaft"&&(this.yeaftSubTab="vp")},async loadData(){this.message="",this._consumeSsoQueryFlags();try{let e=this.getHeaders(),[t,s]=await Promise.all([fetch("/api/user/profile",{headers:e}),fetch("/api/user/agent-secret",{headers:e})]);if(t.ok)this.profile=await t.json();else{let n=await t.json().catch(()=>({}));this.showMessage(n.error||this.$t("settings.account.profileLoadFailed"),!0)}if(s.ok){let n=await s.json();this.applyAgentSecretResponse(n)}this.authStore.role==="admin"&&this.activeTab==="invitations"&&await this.loadInvitations();try{await this.authStore.loadIdentities()}catch{}}catch{}},_consumeSsoQueryFlags(){let e=window.location.hash||"",t=e.indexOf("?");if(t<0)return;let s=new URLSearchParams(e.slice(t+1)),n=s.get("ssoBound"),r=s.get("ssoError"),i=s.get("provider");if(n&&(this.ssoBoundMessage=this.$t("settings.account.ssoBoundMsg",{provider:n}),this.activeTab="account"),r==="conflict"&&(this.ssoConflictMessage=this.$t("settings.account.ssoConflictMsg",{provider:i||""}),this.activeTab="account"),n||r)try{history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}},bindSso(e){if(this.ssoBoundMessage="",this.ssoConflictMessage="",e==="alipay"&&ui()){this.authStore.bindSso(e);return}if(e==="alipay"&&Zs()){this.authStore.loginWithAlipayMobile({intent:"bind"});return}if(e==="wechat"&&(Zs()||di())){this.ssoConflictMessage=this.$t("login.wechat.mobileUnsupported");return}e==="alipay"||e==="wechat"?this.startQrBind(e):this.authStore.bindSso(e)},async startQrBind(e){if(this.qrDataUrl="",!await this.authStore.startSsoQr(e,{intent:"bind"})){this.ssoConflictMessage=this.authStore.error||this.$t("settings.account.bindFailed");return}this.renderQrCode()},cancelQrBind(){this.authStore.cancelSsoQr(),this.qrDataUrl=""},relaunchAlipayMobile(){let e=this.authStore.qrPanel;if(!e||!e.authorizeUrl)return;let t=`alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent(e.authorizeUrl)}`;window.location.href=t},renderQrCode(){let e=this.authStore.qrPanel;if(!(!e||!e.authorizeUrl)&&typeof qrcode=="function")try{let t=qrcode(0,"M");t.addData(e.authorizeUrl,"Byte"),t.make(),this.qrDataUrl=t.createDataURL(6,4)}catch{}},async unbindSso(e){this.ssoBoundMessage="",this.ssoConflictMessage="",await this.authStore.unbindIdentity(e)||(this.ssoConflictMessage=this.authStore.identitiesError||this.$t("settings.account.unbindFailed"))},canUnbind(e){let t=this.authStore.linkedIdentities||[];return t.some(n=>n.provider===e)?this.authStore.hasPassword?!0:t.length>1:!1},async loadInvitations(){try{let e=await fetch("/api/invitations",{headers:this.getHeaders()});if(e.ok){let t=await e.json();this.invitations=t.invitations.map(s=>({...s,code:s.id,expiresAt:s.expires_at,usedByUsername:s.used_by_username||null}))}}catch{}},getHeaders(){let e={"Content-Type":"application/json"},t=this.authStore.getActiveToken?.()||this.authStore.token;return t&&(e.Authorization=`Bearer ${t}`),e},applyAgentSecretResponse(e){let t=e?.agentSecret||e?.agent_secret||null;this.agentSecret=t&&String(t).trim()?String(t):null},async copySecret(){this.agentSecret&&await this.copyText(this.agentSecret)},async copyText(e){try{await navigator.clipboard.writeText(e),this.showMessage(this.$t("settings.msg.copiedClipboard"))}catch{this.showMessage(this.$t("settings.msg.copyFailed"),!0)}},async resetSecret(){if(this.agentSecret&&!this.resetConfirm){this.resetConfirm=!0;return}this.resettingSecret=!0;try{let e=await fetch("/api/user/agent-secret/reset",{method:"POST",headers:this.getHeaders()});if(e.ok){let t=await e.json();this.applyAgentSecretResponse(t),this.showSecret=!0,this.showMessage(this.$t("settings.msg.keyReset"))}else{let t=await e.json();this.showMessage(t.error||this.$t("settings.msg.resetFailed"),!0)}}catch(e){this.showMessage(this.$t("settings.msg.resetFailed")+": "+e.message,!0)}finally{this.resettingSecret=!1,this.resetConfirm=!1}},async changePassword(){let e=this.profile&&this.profile.hasPassword===!1;if(!e&&!this.currentPassword){this.showMessage(this.$t("settings.security.enterCurrentPwd"),!0);return}if(!this.newPassword||this.newPassword.length<6){this.showMessage(this.$t("settings.security.newPwdMin"),!0);return}if(this.newPassword!==this.confirmPassword){this.showMessage(this.$t("settings.security.pwdMismatch"),!0);return}this.changingPassword=!0;try{let t={newPassword:this.newPassword};e||(t.currentPassword=this.currentPassword);let s=await fetch("/api/user/profile",{method:"PUT",headers:this.getHeaders(),body:JSON.stringify(t)}),n=await s.json();if(s.ok&&n.success){this.showMessage(e?this.$t("settings.security.pwdSet"):this.$t("settings.security.pwdChanged")),this.currentPassword="",this.newPassword="",this.confirmPassword="";try{let r=await fetch("/api/user/profile",{headers:this.getHeaders()});r.ok&&(this.profile=await r.json())}catch{}}else this.showMessage(n.error||this.$t("settings.msg.changeFailed"),!0)}catch(t){this.showMessage(this.$t("settings.msg.changeFailed")+": "+t.message,!0)}finally{this.changingPassword=!1}},cancelDeleteAccount(){this.deleteConfirm=!1,this.deletePassword="",this.deleteConfirmText=""},async deleteAccount(){if(!this.deleteConfirm){this.deleteConfirm=!0;return}let e=this.profile&&this.profile.hasPassword!==!1;if(e&&!this.deletePassword){this.showMessage(this.$t("settings.security.enterCurrentPwd"),!0);return}if(!e&&this.deleteConfirmText!=="DELETE"){this.showMessage(this.$t("settings.security.deleteConfirmRequired"),!0);return}this.deletingAccount=!0;try{let t=await this.authStore.deleteAccount(e?{currentPassword:this.deletePassword}:{confirm:"DELETE"});if(!t.success){this.showMessage(t.error||this.$t("settings.security.deleteFailed"),!0);return}window.location.reload()}finally{this.deletingAccount=!1}},async createInvitation(){this.creatingInvite=!0;try{let e=await fetch("/api/invitations",{method:"POST",headers:this.getHeaders(),body:JSON.stringify({role:this.inviteRole})});if(e.ok)await this.loadInvitations(),this.showMessage(this.$t("settings.msg.inviteCreated"));else{let t=await e.json();this.showMessage(t.error||this.$t("settings.msg.createFailed"),!0)}}catch(e){this.showMessage(this.$t("settings.msg.createFailed")+": "+e.message,!0)}finally{this.creatingInvite=!1}},async copyInviteCode(e){try{await navigator.clipboard.writeText(e),this.showMessage(this.$t("settings.msg.inviteCopied"))}catch{this.showMessage(this.$t("settings.msg.copyFailed"),!0)}},async deleteInvitation(e){try{let t=await fetch(`/api/invitations/${e}`,{method:"DELETE",headers:this.getHeaders()});if(t.ok)await this.loadInvitations(),this.showMessage(this.$t("settings.msg.inviteDeleted"));else{let s=await t.json();this.showMessage(s.error||this.$t("settings.msg.deleteFailed"),!0)}}catch(t){this.showMessage(this.$t("settings.msg.deleteFailed")+": "+t.message,!0)}},inviteStatusClass(e){return e.used_by?"used":e.expiresAt<Date.now()?"expired":""},inviteStatusText(e){return e.used_by?this.$t("settings.invite.used"):e.expiresAt<Date.now()?this.$t("settings.invite.expired"):this.$t("settings.invite.available")},formatTime(e){return new Date(e).toLocaleString()},async doLogout(){await this.authStore.logout(),window.location.reload()},showMessage(e,t=!1){this.message=e,this.isError=t,setTimeout(()=>{this.message=""},3e3)},onLlmMessage(e,t){this.showMessage(e,t)},onYeaftLlmSaved(){let e=this.chatStore?.currentAgent;e&&this.chatStore.sendWsMessage({type:"yeaft_reset",agentId:e})}}}});var mg,hg=F(()=>{mg={name:"ExpertRoleEditor",template:`
|
|
3872
3891
|
<div class="expert-editor-overlay" @click.self="$emit('close')">
|
|
3873
3892
|
<div class="expert-editor-modal">
|
|
3874
3893
|
<div class="expert-editor-header">
|
|
@@ -4178,7 +4197,7 @@ ${String(e||"").trim()}
|
|
|
4178
4197
|
</div>
|
|
4179
4198
|
</div>
|
|
4180
4199
|
</div>
|
|
4181
|
-
`,props:{visible:{type:Boolean,default:!1},modelValue:{type:Array,default:()=>[]}},emits:["close","update:modelValue"],setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Pinia.useAuthStore(),r=Vue.ref(null),i=Vue.computed(()=>n.role==="admin"),o=Vue.computed(()=>(s.locale||"zh-CN")==="zh-CN"),a=Vue.ref(null),l=Vue.ref(!1),c=Vue.ref(null),d=Vue.ref(null),u={id:"custom",name:o.value?"\u81EA\u5B9A\u4E49":"Custom",nameEn:"Custom",icon:"\u2728",order:99},f=Vue.computed(()=>{if(!a.value)return null;let T=ht[a.value];return T||s.customExpertRoles.find(K=>K.id===a.value)||null}),p=Vue.computed(()=>{let T=f.value;return T?`${T.title}\xB7${T.name}`:""}),g=Vue.computed(()=>!a.value||!s.expertRoleDefinitions?null:s.expertRoleDefinitions[a.value]||null),m=Vue.computed(()=>!a.value||ht[a.value]?null:s.customExpertRoles.find(T=>T.id===a.value)||null),b=Vue.ref(new Set([Pd])),I=Vue.computed(()=>e.modelValue),y=Vue.computed(()=>Rd(i.value)),S=Vue.computed(()=>{let T=[...y.value];return T.push({id:"custom",name:o.value?"\u81EA\u5B9A\u4E49":"Custom",icon:"\u2728",order:99}),T}),w=Vue.computed(()=>b.value.has("custom")),v=Vue.computed(()=>new Set(y.value.map(T=>T.id))),h=Vue.computed(()=>Td().filter(T=>v.value.has(T.teamId)&&b.value.has(T.teamId)));Vue.watch(()=>e.visible,T=>{T&&(s.fetchExpertRoleDefinitions(),s.fetchCustomExpertRoles())});let M=T=>{a.value=T,ht[T]&&s.fetchExpertRoleDefinitions()},x=T=>{c.value=T,l.value=!0},E=()=>{s.fetchCustomExpertRoles()},V=T=>{d.value=T},L=async()=>{if(d.value){try{let T=d.value.id,K=I.value.filter(re=>re.role!==T);K.length!==I.value.length&&t("update:modelValue",K),await s.deleteCustomExpertRole(T)}catch{}d.value=null}},R=T=>{if(!(b.value.size===1&&b.value.has(T)))if(b.value=new Set([T]),T==="custom"){let K=new Set(s.customExpertRoles.map(he=>he.id)),re=I.value.filter(he=>K.has(he.role));re.length!==I.value.length&&t("update:modelValue",re)}else{let K=I.value.filter(re=>{let he=ht[re.role];return he&&he.group===T});K.length!==I.value.length&&t("update:modelValue",K)}},P=(T,K)=>I.value.some(re=>re.role===T&&re.action===(K||null)),A=T=>I.value.some(K=>K.role===T&&!K.action),_=T=>I.value.some(K=>K.role===T),j=T=>I.value.length>=ws&&!_(T),
|
|
4200
|
+
`,props:{visible:{type:Boolean,default:!1},modelValue:{type:Array,default:()=>[]}},emits:["close","update:modelValue"],setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Pinia.useAuthStore(),r=Vue.ref(null),i=Vue.computed(()=>n.role==="admin"),o=Vue.computed(()=>(s.locale||"zh-CN")==="zh-CN"),a=Vue.ref(null),l=Vue.ref(!1),c=Vue.ref(null),d=Vue.ref(null),u={id:"custom",name:o.value?"\u81EA\u5B9A\u4E49":"Custom",nameEn:"Custom",icon:"\u2728",order:99},f=Vue.computed(()=>{if(!a.value)return null;let T=ht[a.value];return T||s.customExpertRoles.find(K=>K.id===a.value)||null}),p=Vue.computed(()=>{let T=f.value;return T?`${T.title}\xB7${T.name}`:""}),g=Vue.computed(()=>!a.value||!s.expertRoleDefinitions?null:s.expertRoleDefinitions[a.value]||null),m=Vue.computed(()=>!a.value||ht[a.value]?null:s.customExpertRoles.find(T=>T.id===a.value)||null),b=Vue.ref(new Set([Pd])),I=Vue.computed(()=>e.modelValue),y=Vue.computed(()=>Rd(i.value)),S=Vue.computed(()=>{let T=[...y.value];return T.push({id:"custom",name:o.value?"\u81EA\u5B9A\u4E49":"Custom",icon:"\u2728",order:99}),T}),w=Vue.computed(()=>b.value.has("custom")),v=Vue.computed(()=>new Set(y.value.map(T=>T.id))),h=Vue.computed(()=>Td().filter(T=>v.value.has(T.teamId)&&b.value.has(T.teamId)));Vue.watch(()=>e.visible,T=>{T&&(s.fetchExpertRoleDefinitions(),s.fetchCustomExpertRoles())});let M=T=>{a.value=T,ht[T]&&s.fetchExpertRoleDefinitions()},x=T=>{c.value=T,l.value=!0},E=()=>{s.fetchCustomExpertRoles()},V=T=>{d.value=T},L=async()=>{if(d.value){try{let T=d.value.id,K=I.value.filter(re=>re.role!==T);K.length!==I.value.length&&t("update:modelValue",K),await s.deleteCustomExpertRole(T)}catch{}d.value=null}},R=T=>{if(!(b.value.size===1&&b.value.has(T)))if(b.value=new Set([T]),T==="custom"){let K=new Set(s.customExpertRoles.map(he=>he.id)),re=I.value.filter(he=>K.has(he.role));re.length!==I.value.length&&t("update:modelValue",re)}else{let K=I.value.filter(re=>{let he=ht[re.role];return he&&he.group===T});K.length!==I.value.length&&t("update:modelValue",K)}},P=(T,K)=>I.value.some(re=>re.role===T&&re.action===(K||null)),A=T=>I.value.some(K=>K.role===T&&!K.action),_=T=>I.value.some(K=>K.role===T),j=T=>I.value.length>=ws&&!_(T),q=(T,K)=>P(T,K)?!1:!!(_(T)||I.value.length>=ws),z=T=>{if(A(T.id)){t("update:modelValue",I.value.filter(K=>!(K.role===T.id&&!K.action)));return}if(_(T.id)){t("update:modelValue",[...I.value.filter(K=>K.role!==T.id),{role:T.id,action:null}]);return}I.value.length>=ws||t("update:modelValue",[...I.value,{role:T.id,action:null}])},se=(T,K)=>{if(P(T.id,K.id)){t("update:modelValue",I.value.filter(re=>!(re.role===T.id&&re.action===K.id)));return}if(_(T.id)){t("update:modelValue",[...I.value.filter(re=>re.role!==T.id),{role:T.id,action:K.id}]);return}I.value.length>=ws||t("update:modelValue",[...I.value,{role:T.id,action:K.id}])};return{store:s,roleListRef:r,enabledTeams:b,selections:I,availableTeams:y,allTeamTabs:S,filteredGroups:h,isZh:o,isCustomTabActive:w,viewingRoleId:a,viewingRoleMeta:f,viewingRoleTitle:p,viewingRoleDef:g,viewingCustomRole:m,viewRole:M,editorOpen:l,editingRole:c,openEditor:x,onEditorSaved:E,deletingRole:d,confirmDeleteRole:V,executeDelete:L,toggleTeam:R,isSelected:P,isRoleOnlySelected:A,hasRoleSelection:_,isRoleDisabled:j,isDisabled:q,toggleRoleOnly:z,toggleAction:se,toggleCustomRoleOnly:T=>{z(T)},toggleCustomAction:(T,K)=>{se(T,K)},getSelectionLabelFull:T=>{if(ht[T.role])return bs(T);let re=s.customExpertRoles.find(he=>he.id===T.role);if(!re)return T.role;if(T.action){let he=re.actions?.find(Pe=>Pe.id===T.action);return he?`${re.name}\xB7${he.name}`:re.name}return re.name},removeSelection:T=>{let K=[...I.value];K.splice(T,1),t("update:modelValue",K)},clearAll:()=>{t("update:modelValue",[])},getSelectionLabel:bs}}}});var Bi,bl=F(()=>{ar();Bi={name:"SubAgentPanel",props:{visible:{type:Boolean,default:!1}},emits:["close"],template:`
|
|
4182
4201
|
<div class="subagent-panel" :class="{ open: visible, expanded: store.activeSubagentId }" role="complementary" aria-label="Sub-Agents">
|
|
4183
4202
|
<!-- Expanded Mode: Full message thread for a subagent -->
|
|
4184
4203
|
<template v-if="store.activeSubagentId && activeAgent">
|
|
@@ -4274,7 +4293,7 @@ ${String(e||"").trim()}
|
|
|
4274
4293
|
<div class="btw-hint">{{ $t('btw.hint') }}</div>
|
|
4275
4294
|
</div>
|
|
4276
4295
|
</div>
|
|
4277
|
-
`,setup(){let e=Pinia.useChatStore(),t=Vue.ref(null),s=Vue.computed(()=>e.btwMessages.map(n=>{if(n.role!=="assistant"||!n.content)return"";try{return marked.parse(n.content)}catch{return n.content}}));return Vue.watch(()=>{let n=e.btwMessages;return n[n.length-1]?.content?.length||0},()=>{Vue.nextTick(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),Vue.watch(()=>e.btwMessages.length,()=>{Vue.nextTick(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),{store:e,messagesRef:t,renderedContents:s}}}});var bg,wl=F(()=>{Wa();vi();ki();Di();yl();bl();Jr();bg={name:"SplitPane",components:{ChatHeader:pi,MessageItem:en,AssistantTurn:tn,ChatInput:an,ExpertPanel:Ni,SubAgentPanel:
|
|
4296
|
+
`,setup(){let e=Pinia.useChatStore(),t=Vue.ref(null),s=Vue.computed(()=>e.btwMessages.map(n=>{if(n.role!=="assistant"||!n.content)return"";try{return marked.parse(n.content)}catch{return n.content}}));return Vue.watch(()=>{let n=e.btwMessages;return n[n.length-1]?.content?.length||0},()=>{Vue.nextTick(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),Vue.watch(()=>e.btwMessages.length,()=>{Vue.nextTick(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),{store:e,messagesRef:t,renderedContents:s}}}});var bg,wl=F(()=>{Wa();vi();ki();Di();yl();bl();Jr();bg={name:"SplitPane",components:{ChatHeader:pi,MessageItem:en,AssistantTurn:tn,ChatInput:an,ExpertPanel:Ni,SubAgentPanel:Bi},props:{paneId:{type:String,required:!0},paneIndex:{type:Number,default:0},paneCount:{type:Number,default:2}},template:`
|
|
4278
4297
|
<div class="split-pane" @click="setActive">
|
|
4279
4298
|
<!-- ChatHeader \u2014 always visible, with close-pane button -->
|
|
4280
4299
|
<ChatHeader
|
|
@@ -4490,7 +4509,7 @@ ${String(e||"").trim()}
|
|
|
4490
4509
|
<p class="pane-empty-text">{{ $t('splitScreen.selectFromSidebar') }}</p>
|
|
4491
4510
|
</div>
|
|
4492
4511
|
</div>
|
|
4493
|
-
`,setup(e){let t=Pinia.useChatStore(),s=Vue.ref(null),n=Vue.computed(()=>t.activePanelId===e.paneId),r=Vue.computed(()=>t.panels.find(Z=>Z.id===e.paneId)?.conversationId||null),i=Vue.computed(()=>r.value?t.messagesMap[r.value]||[]:[]),o=Vue.computed(()=>r.value?!!t.processingConversations[r.value]:!1),a=Vue.computed(()=>i.value.some(D=>D.isStreaming)),l=Vue.computed(()=>o.value&&!a.value),c=Vue.ref(0),d=Vue.ref(Date.now()),u=null,f=Vue.ref("cat"),p=new URLSearchParams(window.location.search).get("preview"),g=Vue.ref(0),m=Vue.ref(1),b=Vue.ref(5),I=Vue.ref(95),y=Vue.ref("bark-both"),S=Vue.ref(1),w=Vue.ref(-1),v=null;function h(){if(!c.value)return;d.value=Date.now();let D=(d.value-c.value)%19e3;if(D<4e3)g.value=0,m.value=1;else if(D<11500){let Z=D-4e3,ne;Z<2500?ne=Z/2500*16:Z<5e3?ne=16+(Z-2500)/2500*29:ne=45+(Z-5e3)/2500*55,g.value=ne,m.value=1}else D<14e3?(g.value=(1-(D-11500)/2500)*100,m.value=-1):(g.value=0,m.value=1);u=requestAnimationFrame(h)}function M(){if(!c.value||f.value!=="dog")return;d.value=Date.now();let D=(d.value-c.value)%18e3;if(D<2e3)b.value=5,I.value=95,y.value="bark-both",S.value=1,w.value=-1;else if(D<5e3){let Z=(D-2e3)/3e3;b.value=5+Z*25,I.value=95,y.value="left-approach",S.value=1,w.value=-1}else if(D<8e3){let Z=(D-5e3)/3e3;b.value=30,I.value=95-Z*25,y.value="right-approach",S.value=1,w.value=-1}else if(D<1e4){let Z=(D-8e3)/2e3;b.value=30+Z*13,I.value=70-Z*13,y.value="both-approach",S.value=1,w.value=-1}else if(D<11e3)b.value=43,I.value=57,y.value="snap",S.value=1,w.value=-1;else if(D<12500)b.value=43,I.value=57,y.value="stunned",S.value=1,w.value=-1;else if(D<15e3){let Z=(D-12500)/2500;b.value=43-Z*38,I.value=57+Z*38,y.value="retreat",S.value=-1,w.value=1}else D<17e3?(b.value=5,I.value=95,y.value="rehang",S.value=-1,w.value=1):(b.value=5,I.value=95,y.value="reset",S.value=1,w.value=-1);v=requestAnimationFrame(M)}let x=Vue.computed(()=>{let D=b.value*1.2;return S.value<0?`translate(${D+13.5}, 0) scale(-1, 1)`:`translate(${D-13.5}, 0)`}),E=Vue.computed(()=>{let D=I.value*1.2;return w.value>0?`translate(${D-10.5}, 2)`:`translate(${D+10.5}, 2) scale(-1, 1)`}),V=Vue.computed(()=>{let D=y.value;return D==="bark-both"||D==="left-approach"||D==="right-approach"||D==="both-approach"||D==="reset"}),L=Vue.computed(()=>{let D=b.value*1.2,Z=10;if(V.value){let Y=Math.max(0,(D-3)*.12);return`M3,18 Q${(3+D)/2},${18+Y} ${D},${Z}`}if(y.value==="rehang")return`M${D},${Z} Q${D-3},20 3,18`;let ne=S.value<0?1:-1,ye=D+ne*8;return`M${D},${Z} Q${D},18 ${ye},22`}),R=Vue.computed(()=>{let D=I.value*1.2,Z=10;if(V.value){let Y=Math.max(0,(118-D)*.12);return`M118,18 Q${(118+D)/2},${18+Y} ${D},${Z}`}if(y.value==="rehang")return`M${D},${Z} Q${D+3},20 118,18`;let ne=w.value>0?-1:1,ye=D+ne*8;return`M${D},${Z} Q${D},18 ${ye},22`}),P=Vue.computed(()=>y.value==="snap"?.2:.4),A=Vue.computed(()=>y.value==="snap"?.2:.4),_=Vue.computed(()=>b.value*1.2),j=Vue.computed(()=>I.value*1.2),B=Vue.computed(()=>p==="cat"||p==="dog"||p==="animation"?!0:l.value);Vue.watch(l,D=>{D?(c.value=Date.now(),d.value=Date.now(),f.value="cat",g.value=0,m.value=1,b.value=5,I.value=95,y.value="bark-both",S.value=1,w.value=-1,f.value==="cat"?u=requestAnimationFrame(h):v=requestAnimationFrame(M)):(c.value=0,g.value=0,m.value=1,u&&(cancelAnimationFrame(u),u=null),v&&(cancelAnimationFrame(v),v=null))},{immediate:!0}),(p==="cat"||p==="dog"||p==="animation")&&(c.value=Date.now(),d.value=Date.now(),p==="dog"?f.value="dog":f.value="cat",f.value==="cat"?u=requestAnimationFrame(h):(b.value=5,I.value=95,y.value="bark-both",S.value=1,w.value=-1,v=requestAnimationFrame(M))),Vue.onUnmounted(()=>{u&&(cancelAnimationFrame(u),u=null),v&&(cancelAnimationFrame(v),v=null)});let z=Vue.computed(()=>{if(!o.value)return null;if(t.connectionState!=="connected")return"disconnected";let D=r.value;if(t.compactStatus?.conversationId===D&&t.compactStatus?.status==="compacting")return"compacting";let Z=t.sessionHealth?.[D];return Z?Z.status:c.value&&d.value-c.value>8e3?"thinking":null}),se=Vue.computed(()=>{if(!c.value)return"speed-napping";let D=(d.value-c.value)%19e3;return D>=16e3?"speed-petted":D>=14e3?"speed-tired":D>=11500?"speed-crazy":D>=9e3?"speed-turbo":D>=6500?"speed-fast":D>=4e3?"speed-normal":"speed-napping"}),me=Vue.computed(()=>{let D=g.value,Z=m.value,ye={left:`calc(40px + (100% - 80px) * ${D/100})`};return Z<0&&(ye.transform="scaleX(-1)"),ye});function ae(){let D=r.value;if(!D)return;let Z=t.conversations.find(ne=>ne.id===D);t.sendWsMessage({type:"refresh_conversation",conversationId:D,agentId:Z?.agentId})}let ve=Vue.computed(()=>{let D=i.value,Z=[],ne=null,ye=0,Y=()=>{ne&&(ne.isActive=ne.isStreaming===!0,Zr(ne),(ne.textContent||ne.toolMsgs.length>0||ne.todoMsg||ne.askMsg)&&Z.push(ne),ne=null)},ee=()=>{ye++,ne={type:"assistant-turn",id:"turn_"+ye,textContent:"",textSegments:[],isStreaming:!1,isActive:!1,isHistory:!1,todoMsg:null,toolMsgs:[],askMsg:null,messages:[]}};for(let ue=0;ue<D.length;ue++){let le=D[ue];if(le.type==="user"){if(!le.content||!le.content.trim())continue;Y(),Z.push({type:"user",id:le.id||"u_"+ue,message:le});continue}if(le.type==="system"||le.type==="error"){Y(),Z.push({type:le.type,id:le.id||"s_"+ue,message:le});continue}if(!(le.type==="tool-result"||le.type==="tool_result")){if(le.type==="assistant"){ne||ee(),Xr(ne,le),le.isStreaming&&(ne.isStreaming=!0),le.isHistory&&(ne.isHistory=!0),ne.messages.push(le);continue}if(le.type==="tool-use"){ne||ee();let Ce=D[ue+1],xe=Ce&&(Ce.type==="tool-result"||Ce.type==="tool_result"),$e={...le,hasResult:xe||le.hasResult||!1,toolResult:le.toolResult||null};le.toolName==="TodoWrite"?ne.todoMsg=$e:le.toolName==="AskUserQuestion"?ne.askMsg=$e:ne.toolMsgs.push($e),ne.messages.push(le);continue}Y(),Z.push({type:le.type||"unknown",id:le.id||"x_"+ue,message:le})}}return Y(),Z}),ge=(D,Z)=>{if(!r.value)return;let ne=Z||[];t.sendMessageToConversation(r.value,D,ne)},pe=()=>{r.value&&t.cancelExecutionForConversation(r.value)};function T(){t.setActivePanel(e.paneId)}function K(){t.removePanel(e.paneId)}let re=Vue.computed(()=>t.getPaneRightPanel(e.paneId));function he(){t.setPaneRightPanel(e.paneId,null)}let Pe=Vue.ref(!0),U=50,q=()=>{if(!s.value)return!0;let{scrollTop:D,scrollHeight:Z,clientHeight:ne}=s.value;return Z-D-ne<=U},N=()=>{s.value&&(s.value.scrollTop=s.value.scrollHeight)},O=()=>{Pe.value=q()};return Vue.watch(()=>i.value.length,()=>{Pe.value&&Vue.nextTick(N)}),Vue.watch(()=>{let D=i.value,Z=D[D.length-1];return Z?.isStreaming?Z.content?.length:0},()=>{Pe.value&&Vue.nextTick(N)}),Vue.watch(r,()=>{s.value&&s.value.removeEventListener("scroll",O),Pe.value=!0,Vue.nextTick(()=>{s.value&&(s.value.addEventListener("scroll",O),N())})}),Vue.onMounted(()=>{s.value&&(s.value.addEventListener("scroll",O),N())}),Vue.onUnmounted(()=>{s.value&&s.value.removeEventListener("scroll",O)}),{store:t,containerRef:s,isActivePanel:n,conversationId:r,messages:i,isProcessing:o,showTypingDots:l,previewShowTypingDots:B,waitingStatus:z,animationType:f,catSpeed:se,catStyle:me,dogPhase:y,spikeTransform:x,teddyTransform:E,leashPathL:L,leashPathR:R,leashOpacityL:P,leashOpacityR:A,questionLX:_,questionRX:j,refreshSession:ae,turnGroups:ve,sendFn:ge,cancelFn:pe,setActive:T,closePane:K,paneRightPanel:re,closePanePanel:he}}}});var ab,ss,vr=F(()=>{ab=0,ss={name:"ModernSelect",props:{modelValue:{type:[String,Number],default:null},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},searchable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyText:{type:String,default:"\u2014"},ariaLabel:{type:String,default:""},menuMinWidth:{type:Number,default:0},menuClass:{type:String,default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){let s=Vue.ref(!1),n=Vue.ref(""),r=Vue.ref(null),i=Vue.ref(null),o=Vue.ref(null),a=Vue.ref(null),l=Vue.ref(-1),c=`modern-select-${++ab}`,d=`${c}-menu`,u=Vue.ref({}),f=Vue.computed(()=>e.options.find(x=>x.value===e.modelValue)||null),p=Vue.computed(()=>{if(!e.searchable||!n.value.trim())return e.options;let x=n.value.trim().toLowerCase();return e.options.filter(E=>String(E.label||"").toLowerCase().includes(x)||String(E.sublabel||"").toLowerCase().includes(x)||String(E.value||"").toLowerCase().includes(x))}),g=x=>`${c}-option-${x}`,m=Vue.computed(()=>s.value&&l.value>=0&&l.value<p.value.length?g(l.value):void 0);function b(){let x=r.value,E=i.value,V=o.value;if(!x||!E||!V)return;let L=6,R=8,P=x.getBoundingClientRect(),A=document.documentElement.clientWidth||window.innerWidth,_=document.documentElement.clientHeight||window.innerHeight,j=Math.min(Math.max(P.width,e.menuMinWidth),Math.max(0,A-R*2)),B=e.searchable?58:12,z=Math.min(V.scrollHeight+B,304),se=Math.max(0,_-P.bottom-L-R),me=Math.max(0,P.top-L-R),ae=se<z&&me>se,ve=Math.max(48,Math.min(z,ae?me:se)),ge=P.right-j,pe=Math.min(Math.max(R,ge),Math.max(R,A-R-j));u.value={top:`${ae?P.top-L-ve:P.bottom+L}px`,left:`${pe}px`,width:`${j}px`,maxHeight:`${ve}px`,"--modern-select-list-max-height":`${Math.max(36,ve-(e.searchable?58:12))}px`}}function I(){e.disabled||(s.value=!s.value,s.value&&(n.value="",l.value=p.value.findIndex(x=>x.value===e.modelValue),Vue.nextTick(()=>{b(),e.searchable&&a.value?.focus&&a.value.focus();let x=i.value?.querySelector(".modern-select-option.is-active");x?.scrollIntoView&&x.scrollIntoView({block:"nearest"})})))}function y(){s.value=!1}function S(x){!x||x.disabled||(t("update:modelValue",x.value),t("change",x.value),y())}function w(x){if(!p.value.length)return;let E=l.value;for(let V=0;V<p.value.length;V+=1)if(E=(E+x+p.value.length)%p.value.length,!p.value[E]?.disabled){l.value=E;return}}function v(x){if(!s.value){(x.key==="Enter"||x.key===" "||x.key==="ArrowDown")&&(x.preventDefault(),I());return}if(x.key==="Escape"){x.preventDefault(),y();return}if(x.key==="ArrowDown")x.preventDefault(),w(1);else if(x.key==="ArrowUp")x.preventDefault(),w(-1);else if(x.key==="Enter"){x.preventDefault();let E=p.value[l.value];E&&S(E)}}function h(x){s.value&&(r.value?.contains(x.target)||i.value?.contains(x.target)||y())}let M=()=>{s.value&&b()};return Vue.onMounted(()=>{document.addEventListener("mousedown",h),window.addEventListener("resize",M),window.addEventListener("scroll",M,!0)}),Vue.onBeforeUnmount(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}),Vue.watch(()=>e.modelValue,()=>{}),{open:s,search:n,triggerEl:r,menuEl:i,searchEl:a,activeIdx:l,selected:f,filtered:p,menuId:d,menuStyle:u,listEl:o,optionId:g,activeOptionId:m,toggle:I,close:y,pick:S,onKey:v}},template:`
|
|
4512
|
+
`,setup(e){let t=Pinia.useChatStore(),s=Vue.ref(null),n=Vue.computed(()=>t.activePanelId===e.paneId),r=Vue.computed(()=>t.panels.find(Z=>Z.id===e.paneId)?.conversationId||null),i=Vue.computed(()=>r.value?t.messagesMap[r.value]||[]:[]),o=Vue.computed(()=>r.value?!!t.processingConversations[r.value]:!1),a=Vue.computed(()=>i.value.some(D=>D.isStreaming)),l=Vue.computed(()=>o.value&&!a.value),c=Vue.ref(0),d=Vue.ref(Date.now()),u=null,f=Vue.ref("cat"),p=new URLSearchParams(window.location.search).get("preview"),g=Vue.ref(0),m=Vue.ref(1),b=Vue.ref(5),I=Vue.ref(95),y=Vue.ref("bark-both"),S=Vue.ref(1),w=Vue.ref(-1),v=null;function h(){if(!c.value)return;d.value=Date.now();let D=(d.value-c.value)%19e3;if(D<4e3)g.value=0,m.value=1;else if(D<11500){let Z=D-4e3,ne;Z<2500?ne=Z/2500*16:Z<5e3?ne=16+(Z-2500)/2500*29:ne=45+(Z-5e3)/2500*55,g.value=ne,m.value=1}else D<14e3?(g.value=(1-(D-11500)/2500)*100,m.value=-1):(g.value=0,m.value=1);u=requestAnimationFrame(h)}function M(){if(!c.value||f.value!=="dog")return;d.value=Date.now();let D=(d.value-c.value)%18e3;if(D<2e3)b.value=5,I.value=95,y.value="bark-both",S.value=1,w.value=-1;else if(D<5e3){let Z=(D-2e3)/3e3;b.value=5+Z*25,I.value=95,y.value="left-approach",S.value=1,w.value=-1}else if(D<8e3){let Z=(D-5e3)/3e3;b.value=30,I.value=95-Z*25,y.value="right-approach",S.value=1,w.value=-1}else if(D<1e4){let Z=(D-8e3)/2e3;b.value=30+Z*13,I.value=70-Z*13,y.value="both-approach",S.value=1,w.value=-1}else if(D<11e3)b.value=43,I.value=57,y.value="snap",S.value=1,w.value=-1;else if(D<12500)b.value=43,I.value=57,y.value="stunned",S.value=1,w.value=-1;else if(D<15e3){let Z=(D-12500)/2500;b.value=43-Z*38,I.value=57+Z*38,y.value="retreat",S.value=-1,w.value=1}else D<17e3?(b.value=5,I.value=95,y.value="rehang",S.value=-1,w.value=1):(b.value=5,I.value=95,y.value="reset",S.value=1,w.value=-1);v=requestAnimationFrame(M)}let x=Vue.computed(()=>{let D=b.value*1.2;return S.value<0?`translate(${D+13.5}, 0) scale(-1, 1)`:`translate(${D-13.5}, 0)`}),E=Vue.computed(()=>{let D=I.value*1.2;return w.value>0?`translate(${D-10.5}, 2)`:`translate(${D+10.5}, 2) scale(-1, 1)`}),V=Vue.computed(()=>{let D=y.value;return D==="bark-both"||D==="left-approach"||D==="right-approach"||D==="both-approach"||D==="reset"}),L=Vue.computed(()=>{let D=b.value*1.2,Z=10;if(V.value){let Y=Math.max(0,(D-3)*.12);return`M3,18 Q${(3+D)/2},${18+Y} ${D},${Z}`}if(y.value==="rehang")return`M${D},${Z} Q${D-3},20 3,18`;let ne=S.value<0?1:-1,ye=D+ne*8;return`M${D},${Z} Q${D},18 ${ye},22`}),R=Vue.computed(()=>{let D=I.value*1.2,Z=10;if(V.value){let Y=Math.max(0,(118-D)*.12);return`M118,18 Q${(118+D)/2},${18+Y} ${D},${Z}`}if(y.value==="rehang")return`M${D},${Z} Q${D+3},20 118,18`;let ne=w.value>0?-1:1,ye=D+ne*8;return`M${D},${Z} Q${D},18 ${ye},22`}),P=Vue.computed(()=>y.value==="snap"?.2:.4),A=Vue.computed(()=>y.value==="snap"?.2:.4),_=Vue.computed(()=>b.value*1.2),j=Vue.computed(()=>I.value*1.2),q=Vue.computed(()=>p==="cat"||p==="dog"||p==="animation"?!0:l.value);Vue.watch(l,D=>{D?(c.value=Date.now(),d.value=Date.now(),f.value="cat",g.value=0,m.value=1,b.value=5,I.value=95,y.value="bark-both",S.value=1,w.value=-1,f.value==="cat"?u=requestAnimationFrame(h):v=requestAnimationFrame(M)):(c.value=0,g.value=0,m.value=1,u&&(cancelAnimationFrame(u),u=null),v&&(cancelAnimationFrame(v),v=null))},{immediate:!0}),(p==="cat"||p==="dog"||p==="animation")&&(c.value=Date.now(),d.value=Date.now(),p==="dog"?f.value="dog":f.value="cat",f.value==="cat"?u=requestAnimationFrame(h):(b.value=5,I.value=95,y.value="bark-both",S.value=1,w.value=-1,v=requestAnimationFrame(M))),Vue.onUnmounted(()=>{u&&(cancelAnimationFrame(u),u=null),v&&(cancelAnimationFrame(v),v=null)});let z=Vue.computed(()=>{if(!o.value)return null;if(t.connectionState!=="connected")return"disconnected";let D=r.value;if(t.compactStatus?.conversationId===D&&t.compactStatus?.status==="compacting")return"compacting";let Z=t.sessionHealth?.[D];return Z?Z.status:c.value&&d.value-c.value>8e3?"thinking":null}),se=Vue.computed(()=>{if(!c.value)return"speed-napping";let D=(d.value-c.value)%19e3;return D>=16e3?"speed-petted":D>=14e3?"speed-tired":D>=11500?"speed-crazy":D>=9e3?"speed-turbo":D>=6500?"speed-fast":D>=4e3?"speed-normal":"speed-napping"}),me=Vue.computed(()=>{let D=g.value,Z=m.value,ye={left:`calc(40px + (100% - 80px) * ${D/100})`};return Z<0&&(ye.transform="scaleX(-1)"),ye});function ae(){let D=r.value;if(!D)return;let Z=t.conversations.find(ne=>ne.id===D);t.sendWsMessage({type:"refresh_conversation",conversationId:D,agentId:Z?.agentId})}let ve=Vue.computed(()=>{let D=i.value,Z=[],ne=null,ye=0,Y=()=>{ne&&(ne.isActive=ne.isStreaming===!0,Zr(ne),(ne.textContent||ne.toolMsgs.length>0||ne.todoMsg||ne.askMsg)&&Z.push(ne),ne=null)},ee=()=>{ye++,ne={type:"assistant-turn",id:"turn_"+ye,textContent:"",textSegments:[],isStreaming:!1,isActive:!1,isHistory:!1,todoMsg:null,toolMsgs:[],askMsg:null,messages:[]}};for(let ue=0;ue<D.length;ue++){let le=D[ue];if(le.type==="user"){if(!le.content||!le.content.trim())continue;Y(),Z.push({type:"user",id:le.id||"u_"+ue,message:le});continue}if(le.type==="system"||le.type==="error"){Y(),Z.push({type:le.type,id:le.id||"s_"+ue,message:le});continue}if(!(le.type==="tool-result"||le.type==="tool_result")){if(le.type==="assistant"){ne||ee(),Xr(ne,le),le.isStreaming&&(ne.isStreaming=!0),le.isHistory&&(ne.isHistory=!0),ne.messages.push(le);continue}if(le.type==="tool-use"){ne||ee();let Ce=D[ue+1],xe=Ce&&(Ce.type==="tool-result"||Ce.type==="tool_result"),$e={...le,hasResult:xe||le.hasResult||!1,toolResult:le.toolResult||null};le.toolName==="TodoWrite"?ne.todoMsg=$e:le.toolName==="AskUserQuestion"?ne.askMsg=$e:ne.toolMsgs.push($e),ne.messages.push(le);continue}Y(),Z.push({type:le.type||"unknown",id:le.id||"x_"+ue,message:le})}}return Y(),Z}),ge=(D,Z)=>{if(!r.value)return;let ne=Z||[];t.sendMessageToConversation(r.value,D,ne)},pe=()=>{r.value&&t.cancelExecutionForConversation(r.value)};function T(){t.setActivePanel(e.paneId)}function K(){t.removePanel(e.paneId)}let re=Vue.computed(()=>t.getPaneRightPanel(e.paneId));function he(){t.setPaneRightPanel(e.paneId,null)}let Pe=Vue.ref(!0),U=50,B=()=>{if(!s.value)return!0;let{scrollTop:D,scrollHeight:Z,clientHeight:ne}=s.value;return Z-D-ne<=U},N=()=>{s.value&&(s.value.scrollTop=s.value.scrollHeight)},O=()=>{Pe.value=B()};return Vue.watch(()=>i.value.length,()=>{Pe.value&&Vue.nextTick(N)}),Vue.watch(()=>{let D=i.value,Z=D[D.length-1];return Z?.isStreaming?Z.content?.length:0},()=>{Pe.value&&Vue.nextTick(N)}),Vue.watch(r,()=>{s.value&&s.value.removeEventListener("scroll",O),Pe.value=!0,Vue.nextTick(()=>{s.value&&(s.value.addEventListener("scroll",O),N())})}),Vue.onMounted(()=>{s.value&&(s.value.addEventListener("scroll",O),N())}),Vue.onUnmounted(()=>{s.value&&s.value.removeEventListener("scroll",O)}),{store:t,containerRef:s,isActivePanel:n,conversationId:r,messages:i,isProcessing:o,showTypingDots:l,previewShowTypingDots:q,waitingStatus:z,animationType:f,catSpeed:se,catStyle:me,dogPhase:y,spikeTransform:x,teddyTransform:E,leashPathL:L,leashPathR:R,leashOpacityL:P,leashOpacityR:A,questionLX:_,questionRX:j,refreshSession:ae,turnGroups:ve,sendFn:ge,cancelFn:pe,setActive:T,closePane:K,paneRightPanel:re,closePanePanel:he}}}});var ab,ss,vr=F(()=>{ab=0,ss={name:"ModernSelect",props:{modelValue:{type:[String,Number],default:null},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},searchable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyText:{type:String,default:"\u2014"},ariaLabel:{type:String,default:""},menuMinWidth:{type:Number,default:0},menuClass:{type:String,default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){let s=Vue.ref(!1),n=Vue.ref(""),r=Vue.ref(null),i=Vue.ref(null),o=Vue.ref(null),a=Vue.ref(null),l=Vue.ref(-1),c=`modern-select-${++ab}`,d=`${c}-menu`,u=Vue.ref({}),f=Vue.computed(()=>e.options.find(x=>x.value===e.modelValue)||null),p=Vue.computed(()=>{if(!e.searchable||!n.value.trim())return e.options;let x=n.value.trim().toLowerCase();return e.options.filter(E=>String(E.label||"").toLowerCase().includes(x)||String(E.sublabel||"").toLowerCase().includes(x)||String(E.value||"").toLowerCase().includes(x))}),g=x=>`${c}-option-${x}`,m=Vue.computed(()=>s.value&&l.value>=0&&l.value<p.value.length?g(l.value):void 0);function b(){let x=r.value,E=i.value,V=o.value;if(!x||!E||!V)return;let L=6,R=8,P=x.getBoundingClientRect(),A=document.documentElement.clientWidth||window.innerWidth,_=document.documentElement.clientHeight||window.innerHeight,j=Math.min(Math.max(P.width,e.menuMinWidth),Math.max(0,A-R*2)),q=e.searchable?58:12,z=Math.min(V.scrollHeight+q,304),se=Math.max(0,_-P.bottom-L-R),me=Math.max(0,P.top-L-R),ae=se<z&&me>se,ve=Math.max(48,Math.min(z,ae?me:se)),ge=P.right-j,pe=Math.min(Math.max(R,ge),Math.max(R,A-R-j));u.value={top:`${ae?P.top-L-ve:P.bottom+L}px`,left:`${pe}px`,width:`${j}px`,maxHeight:`${ve}px`,"--modern-select-list-max-height":`${Math.max(36,ve-(e.searchable?58:12))}px`}}function I(){e.disabled||(s.value=!s.value,s.value&&(n.value="",l.value=p.value.findIndex(x=>x.value===e.modelValue),Vue.nextTick(()=>{b(),e.searchable&&a.value?.focus&&a.value.focus();let x=i.value?.querySelector(".modern-select-option.is-active");x?.scrollIntoView&&x.scrollIntoView({block:"nearest"})})))}function y(){s.value=!1}function S(x){!x||x.disabled||(t("update:modelValue",x.value),t("change",x.value),y())}function w(x){if(!p.value.length)return;let E=l.value;for(let V=0;V<p.value.length;V+=1)if(E=(E+x+p.value.length)%p.value.length,!p.value[E]?.disabled){l.value=E;return}}function v(x){if(!s.value){(x.key==="Enter"||x.key===" "||x.key==="ArrowDown")&&(x.preventDefault(),I());return}if(x.key==="Escape"){x.preventDefault(),y();return}if(x.key==="ArrowDown")x.preventDefault(),w(1);else if(x.key==="ArrowUp")x.preventDefault(),w(-1);else if(x.key==="Enter"){x.preventDefault();let E=p.value[l.value];E&&S(E)}}function h(x){s.value&&(r.value?.contains(x.target)||i.value?.contains(x.target)||y())}let M=()=>{s.value&&b()};return Vue.onMounted(()=>{document.addEventListener("mousedown",h),window.addEventListener("resize",M),window.addEventListener("scroll",M,!0)}),Vue.onBeforeUnmount(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}),Vue.watch(()=>e.modelValue,()=>{}),{open:s,search:n,triggerEl:r,menuEl:i,searchEl:a,activeIdx:l,selected:f,filtered:p,menuId:d,menuStyle:u,listEl:o,optionId:g,activeOptionId:m,toggle:I,close:y,pick:S,onKey:v}},template:`
|
|
4494
4513
|
<div class="modern-select" :class="{ 'is-open': open, 'is-disabled': disabled }">
|
|
4495
4514
|
<button
|
|
4496
4515
|
type="button"
|
|
@@ -4564,7 +4583,7 @@ ${String(e||"").trim()}
|
|
|
4564
4583
|
</transition>
|
|
4565
4584
|
</Teleport>
|
|
4566
4585
|
</div>
|
|
4567
|
-
`}});var
|
|
4586
|
+
`}});var qi,kl=F(()=>{qi={name:"SidebarModeToggle",props:{view:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["flip"],computed:{isYeaft(){return this.view==="yeaft"},chatLabel(){return this.$t("sidebar.toggle.chat")},yeaftLabel(){return this.$t("sidebar.toggle.yeaft")},titleText(){return this.isYeaft?this.chatLabel:this.yeaftLabel}},methods:{onClick(){this.disabled||this.$emit("flip",this.isYeaft?"chat":"yeaft")},onKeydown(e){this.disabled||(e.key==="Enter"||e.key===" "?(e.preventDefault(),this.onClick()):e.key==="ArrowLeft"&&this.isYeaft?(e.preventDefault(),this.$emit("flip","chat")):e.key==="ArrowRight"&&!this.isYeaft&&(e.preventDefault(),this.$emit("flip","yeaft")))}},template:`
|
|
4568
4587
|
<button
|
|
4569
4588
|
type="button"
|
|
4570
4589
|
class="mode-toggle"
|
|
@@ -6302,7 +6321,7 @@ ${String(e||"").trim()}
|
|
|
6302
6321
|
</div>
|
|
6303
6322
|
</form>
|
|
6304
6323
|
</div>
|
|
6305
|
-
`}});function to(e){if(!e)return"-";let t=String(e);if(t.length<=25)return t;let s=t.split(/[/\\]/);return s.length<=2?t:"..."+s.slice(-2).join("/")}var Vl=F(()=>{});function Hg({isMobileView:e,showMobileSidebar:t,closeMobileSidebar:s,toggleSidebar:n}){if(e&&t){s();return}n()}var Og=F(()=>{});var Fg,Ng=F(()=>{Wa();ol();Di();hl();vl();yl();bl();yg();wl();vr();kl();Sl();Il();Cl();xl();Yi();$l();Vl();Tl();oi();gt();Og();Fg={name:"ChatPage",components:{ChatHeader:pi,MessageList:xi,ChatInput:an,WorkbenchPanel:Oi,WorkCenterPage:eo,SettingsPanel:Fi,ExpertPanel:Ni,SubAgentPanel:
|
|
6324
|
+
`}});function to(e){if(!e)return"-";let t=String(e);if(t.length<=25)return t;let s=t.split(/[/\\]/);return s.length<=2?t:"..."+s.slice(-2).join("/")}var Vl=F(()=>{});function Hg({isMobileView:e,showMobileSidebar:t,closeMobileSidebar:s,toggleSidebar:n}){if(e&&t){s();return}n()}var Og=F(()=>{});var Fg,Ng=F(()=>{Wa();ol();Di();hl();vl();yl();bl();yg();wl();vr();kl();Sl();Il();Cl();xl();Yi();$l();Vl();Tl();oi();gt();Og();Fg={name:"ChatPage",components:{ChatHeader:pi,MessageList:xi,ChatInput:an,WorkbenchPanel:Oi,WorkCenterPage:eo,SettingsPanel:Fi,ExpertPanel:Ni,SubAgentPanel:Bi,BtwOverlay:vg,SplitPane:bg,ModernSelect:ss,SidebarModeToggle:qi,SidebarAgentHeader:Wi,SidebarWorkCenter:ji,SessionSidebarShell:Ui,UnifiedSessionList:Ki,SessionCreateModal:un},template:`
|
|
6306
6325
|
<div class="chat-page" :class="{ 'show-sidebar': store.sessionSidebarOpen }">
|
|
6307
6326
|
|
|
6308
6327
|
<!-- Sidebar Overlay -->
|
|
@@ -6773,7 +6792,7 @@ ${String(e||"").trim()}
|
|
|
6773
6792
|
</div>
|
|
6774
6793
|
</div>
|
|
6775
6794
|
</div>
|
|
6776
|
-
`,data(){return{showAgentDropdown:!1,showSettingsPanel:!1,restartingAgents:{},upgradingAgents:{},showConversationModal:!1,unifiedSessionCreateOpen:!1,unifiedSessionCreateProvider:"yeaft",unifiedSessionCreateProject:null,convModalAgent:"",convModalWorkDir:"",convModalProvider:"claude-code",selectedResumeSession:null,historyLoaded:!1,windowWidth:window.innerWidth,folderPickerOpen:!1,folderPickerPath:"",folderPickerEntries:[],folderPickerLoading:!1,folderPickerSelected:"",folderPickerTarget:"",serverVersion:"",chatGroupCollapsed:!1,sidebarTab:"chat",editingChatId:null,editingChatName:"",activeSessionMenu:null}},computed:{store(){return Pinia.useChatStore()},providerOptions(){return[{value:"claude-code",label:this.$t("provider.claudeCode")},{value:"copilot",label:this.$t("provider.copilot")}]},agentOptions(){return this.store.agents.filter(e=>e.online).map(e=>({value:e.id,label:`${e.name}${e.latency?` (${e.latency}ms)`:""}`}))},canUseWorkbench(){let e=De().role;return e==="admin"||e==="pro"},selectedConvModalAgentWorkDir(){return this.convModalAgent&&this.store.agents.find(t=>t.id===this.convModalAgent)?.workDir||""},onlineAgents(){return this.store.agents.filter(e=>e.online)},onlineAgentCount(){return this.onlineAgents.length},workCenterAgents(){return this.onlineAgents.filter(e=>Array.isArray(e.capabilities)&&e.capabilities.includes("work_center"))},isMobileView(){return this.windowWidth<=768},effectiveSidebarCollapsed(){return this.isMobileView?!this.store.sessionSidebarOpen:this.store.sidebarCollapsed},normalConversations(){return this.sortByActivity(this.store.conversations.filter(e=>e.agentOnline!==!1&&!this.isConversationHidden(e)))},pinnedChatConversations(){let e=this.store.conversations.filter(t=>t.agentOnline!==!1&&!this.isConversationHidden(t)&&this.store.isSessionPinned(t.id));return this.sortByActivity(e)},unpinnedChatConversations(){return this.sortByActivity(this.store.conversations.filter(e=>e.agentOnline!==!1&&!this.isConversationHidden(e)&&!this.store.isSessionPinned(e.id)))},chatSessionCount(){return this.store.conversations.filter(e=>e.agentOnline!==!1&&!this.isConversationHidden(e)).length}},methods:{isConversationHidden(e){return e?.id?(this.store.hiddenSessionCatalog||[]).some(t=>t?.runtimeProvider===(e.provider||"claude-code")&&t?.routeRef?.sessionId===e.id&&t?.routeRef?.agentId===(e.agentId||this.store.currentAgent||null)):!1},onSidebarCollapse(){Hg({isMobileView:this.isMobileView,showMobileSidebar:this.store.sessionSidebarOpen,closeMobileSidebar:()=>this.store.closeSessionSidebar(),toggleSidebar:()=>this.store.toggleSidebar()})},onModeFlip(e){e==="yeaft"?this.store.enterYeaft():this.store.leaveYeaft()},sortByActivity(e){return Bu(e)},isCatalogSessionUnread(e){return e?.runtimeProvider!=="yeaft"?!1:this.store.isYeaftSessionUnread(e.routeRef?.sessionId,e.routeRef?.agentId)},isCatalogSessionSyncing(e){return typeof this.store.isSessionHistorySyncing=="function"?this.store.isSessionHistorySyncing(e?.routeRef):!1},onUnifiedCreate(e="yeaft"){this.unifiedSessionCreateProject=null,this.unifiedSessionCreateProvider=["yeaft","copilot","claude-code"].includes(e)?e:"yeaft",this.unifiedSessionCreateOpen=!0},onUnifiedCreateInProject({project:e}={}){e?.id&&(this.unifiedSessionCreateProject=e,this.unifiedSessionCreateProvider="yeaft",this.unifiedSessionCreateOpen=!0)},closeUnifiedSessionCreate(){this.unifiedSessionCreateOpen=!1,this.unifiedSessionCreateProject=null},async onUnifiedSessionCreated(e){let t=this.unifiedSessionCreateProject;if(this.closeUnifiedSessionCreate(),!t||!e?.id)return;let s=e.agentId||t.legacyAgentId||this.store.currentAgent||null,n=await this.store.mutateProject?.("move_session",{sessionId:e.id,projectId:t.legacyProjectId||t.id},s);if(!n?.ok){let r=n?.error?.message||n?.error?.code||"unknown";alert(this.$t("sidebar.projects.assignFailed",{name:t.name,message:r}))}},openWorkCenter(e=null){let t=this.workCenterAgents.find(s=>s.id===e)||this.workCenterAgents.find(s=>s.id===this.store.workCenterAgentId)||this.workCenterAgents[0];t&&this.store.enterWorkCenter(t.id)},onUnifiedSessionAction({action:e,row:t,title:s,sessions:n}={}){if(!t?.routeRef)return;let{runtimeProvider:r,agentId:i,sessionId:o}=t.routeRef;e==="rename"?this.store.renameCatalogSession({row:t,title:s}):e==="reorder"?this.store.reorderCatalogSessions(n):e==="pin"?this.store.toggleCatalogSessionPin(t):e==="remove"?this.store.hideCatalogSession(t):r==="yeaft"&&e==="settings"&&(this.store.pendingUnifiedSessionSettings={sessionId:o,agentId:i,section:"session"},this.store.openCatalogSession(t))},openConversationModal({preserveProvider:e=!1}={}){this.showConversationModal=!0,e||(this.convModalProvider="claude-code"),this.convModalAgent="",this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1,this._foldersRetried=!1;let t=this.store.agents.filter(r=>r.online),n=t.find(r=>r.id===this.store.currentAgent)||t[0];n&&(this.convModalAgent=n.id,this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider).then(()=>{this.showConversationModal&&this.store.folders.length===0&&!this._foldersRetried&&(this._foldersRetried=!0,setTimeout(()=>{this.showConversationModal&&this.convModalAgent&&this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider)},1500))}))},openConversationModalResume(){this.openConversationModal()},closeConversationModal(){this.showConversationModal=!1,this.convModalAgent="",this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1},onConvModalAgentChange(){this.convModalAgent&&(this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1,this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider))},onConvModalProviderChange(){this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1,this.convModalAgent&&this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider)},onConvModalWorkDirInput(){this.historyLoaded=!1,this.selectedResumeSession=null,this._workDirInputTimer&&clearTimeout(this._workDirInputTimer),this._workDirInputTimer=setTimeout(()=>{this.convModalWorkDir.trim()&&this.convModalAgent&&(this.store.listHistorySessionsForAgent(this.convModalAgent,this.convModalWorkDir.trim(),this.convModalProvider),this.historyLoaded=!0)},500)},selectConvModalFolder(e){this.convModalWorkDir=e,this.selectedResumeSession=null,this.convModalAgent&&(this.store.listHistorySessionsForAgent(this.convModalAgent,e,this.convModalProvider),this.historyLoaded=!0)},loadConvModalFolders(){this.convModalAgent&&this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider)},loadConvModalSessions(){this.convModalAgent&&this.convModalWorkDir.trim()&&(this.store.listHistorySessionsForAgent(this.convModalAgent,this.convModalWorkDir.trim(),this.convModalProvider),this.historyLoaded=!0)},toggleAgentDropdown(){this.showAgentDropdown=!this.showAgentDropdown,this.showAgentDropdown&&this.store.refreshAgents()},selectAgent(e){this.store.selectAgent(e),this.showAgentDropdown=!1},createNewConversation(){if(!this.convModalAgent)return;this.store.selectAgent(this.convModalAgent);let e=this.convModalWorkDir.trim()||this.selectedConvModalAgentWorkDir;this.store.createConversation(e,this.convModalAgent,null,this.buildConvOpts()),this.closeConversationModal()},buildConvOpts(){let e={provider:this.convModalProvider};return this.convModalProvider==="copilot"&&(e.providerOptions={allowAllTools:!0}),e},resumeSession(e){if(!this.convModalAgent)return;this.store.selectAgent(this.convModalAgent),this.store._pendingSessionTitle=e.title;let t=e.workDir||this.convModalWorkDir.trim()||this.selectedConvModalAgentWorkDir;this.store.resumeConversation(e.sessionId,t,this.convModalAgent,this.buildConvOpts()),this.closeConversationModal()},resumeSelectedSession(){if(!this.convModalAgent||!this.selectedResumeSession)return;this.store.selectAgent(this.convModalAgent),this.store._pendingSessionTitle=this.selectedResumeSession.title;let e=this.selectedResumeSession.workDir||this.convModalWorkDir.trim()||this.selectedConvModalAgentWorkDir;this.store.resumeConversation(this.selectedResumeSession.sessionId,e,this.convModalAgent,this.buildConvOpts()),this.closeConversationModal()},formatDate(e){return zi(e,this.$t.bind(this))},selectConversation(e,t){this.store.leaveWorkCenter(),this.store.selectConversation(e,t,{refresh:!0}),this.store.closeSessionSidebar()},onSessionClick(e){if(e.agentOnline===!1){this.store.addMessage({type:"system",content:this.$t("chat.session.agentOffline")});return}if(this.store.isSplitMode&&this.store.activePanelId){this.store.leaveWorkCenter(),this.store.setPanelConversation(this.store.activePanelId,e.id,{refresh:!0}),this.store.closeSessionSidebar();return}this.selectConversation(e.id,e.agentId)},hideSessionFromSidebar(e){if(!e?.id)return;let t=e.provider||"claude-code";this.store.hideCatalogSession({catalogKey:`chat:${e.id}`,runtimeProvider:t,routeRef:{runtimeProvider:t,agentId:e.agentId||this.store.currentAgent||null,sessionId:e.id},title:this.getConversationTitle(e),workDir:e.workDir||"",agentName:e.agentName||"",availability:e.agentOnline===!1?"offline":"online",pinned:this.store.isSessionPinned(e.id)})},closeSession(e,t){this.store.closeSession(e,t)},deleteConversation(e,t){confirm(this.$t("chat.delete.confirm"))&&this.store.deleteConversation(e,t)},getConversationTitle(e){let t=this.store.getConversationTitle(e.id);return t?t.length>30?t.slice(0,30)+"...":t:e.claudeSessionId?e.claudeSessionId.slice(0,8)+"...":e.id.slice(0,8)+"..."},getConversationFullTitle(e){let t=this.store.getConversationTitle(e.id);if(t&&t.length>30)return t},startChatRename(e){this.editingChatId=e.id,this.editingChatName=this.store.customConversationTitles[e.id]||this.store.conversationTitles[e.id]||"",this.$nextTick(()=>{let t=this.$refs.chatRenameInput;if(t){let s=Array.isArray(t)?t[0]:t;s.focus(),s.select()}})},commitChatRename(){if(!this.editingChatId)return;let e=this.editingChatId,t=this.editingChatName.trim();this.editingChatId=null,this.editingChatName="",this.store.renameChatSession(e,t)},cancelChatRename(){this.editingChatId=null,this.editingChatName=""},toggleSessionMenu(e){this.activeSessionMenu=this.activeSessionMenu===e?null:e},closeSessionMenu(){this.activeSessionMenu=null},getConversationTime(e){let s=this.store.executionStatusMap[e.id]?.lastActivity||e.createdAt;if(!s)return"";let n=new Date(s),r=new Date,i=r-n;return i<6e4?this.$t("chat.time.justNow"):i<36e5?this.$t("chat.time.minutesAgo",{count:Math.floor(i/6e4)}):n.toDateString()===r.toDateString()?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):n.toLocaleDateString(void 0,{month:"numeric",day:"numeric"})},providerLabel(e){return e==="copilot"?this.$t("provider.copilot"):e==="claude-code"?this.$t("provider.claudeCode"):e||""},shortenPath(e){return to(e)},formatTime(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""},getLastPathSegment(e){return yr(e)},getParentPath(e){if(!e)return"";let t=e.split(/[/\\]/);return t.length<=2?"":t.slice(0,-1).join("/")},handleResize(){this.windowWidth=window.innerWidth},restartAgent(e){let s=this.store.agents.find(n=>n.id===e)?.name||e;confirm(this.$t("chat.agent.restartConfirm",{name:s}))&&(this.restartingAgents[e]=!0,setTimeout(()=>{delete this.restartingAgents[e]},12e4),this.store.restartAgent(e))},upgradeAgent(e){let t=this.store.agents.find(n=>n.id===e),s=t?.name||e;confirm(this.$t("chat.agent.upgradeConfirm",{name:s}))&&(this.upgradingAgents[e]={since:Date.now(),oldVersion:t?.version||null},setTimeout(()=>{delete this.upgradingAgents[e]},12e4),this.store.upgradeAgent(e))},openFolderPicker(e){let t=this.convModalAgent;if(!t)return;this.folderPickerTarget=e,this.folderPickerOpen=!0,this.folderPickerSelected="",this.folderPickerLoading=!0;let s=this.convModalWorkDir,n=this.store.agents.find(o=>o.id===t),r=s||n?.workDir||"";this.folderPickerPath=r,this.folderPickerEntries=[];let i=()=>{this.store.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",agentId:t,dirPath:r,workDir:n?.workDir||""})};i(),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=setTimeout(()=>{this.folderPickerLoading&&this.folderPickerOpen&&i()},5e3)},loadFolderPickerDir(e){let t=this.convModalAgent;if(!t)return;this.folderPickerLoading=!0,this.folderPickerSelected="",this.folderPickerEntries=[];let s=this.store.agents.find(r=>r.id===t),n=()=>{this.store.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",agentId:t,dirPath:e,workDir:s?.workDir||""})};n(),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=setTimeout(()=>{this.folderPickerLoading&&this.folderPickerOpen&&n()},5e3)},folderPickerNavigateUp(){if(!this.folderPickerPath)return;let e=this.folderPickerPath.includes("\\"),t=e?"\\":"/",s=this.folderPickerPath.replace(/[/\\]$/,"").split(/[/\\]/);if(s.pop(),s.length===0)this.folderPickerPath="",this.loadFolderPickerDir("");else if(e&&s.length===1&&/^[A-Za-z]:$/.test(s[0]))this.folderPickerPath=s[0]+"\\",this.loadFolderPickerDir(s[0]+"\\");else{let n=s.join(t);this.folderPickerPath=n,this.loadFolderPickerDir(n)}},folderPickerSelectItem(e){this.folderPickerSelected=e.name},folderPickerEnter(e){let s=this.folderPickerPath.includes("\\")||/^[A-Z]:/.test(e.name)?"\\":"/",n;this.folderPickerPath?n=this.folderPickerPath.replace(/[/\\]$/,"")+s+e.name:/^[A-Z]:$/.test(e.name)?n=e.name+"\\":n="/"+e.name,this.folderPickerPath=n,this.loadFolderPickerDir(n)},confirmFolderPicker(){let e=this.folderPickerPath;if(e){if(this.folderPickerSelected){let t=e.includes("\\")?"\\":"/";e=e.replace(/[/\\]$/,"")+t+this.folderPickerSelected}this.convModalWorkDir=e,this.selectedResumeSession=null,this.convModalAgent&&(this.store.listHistorySessionsForAgent(this.convModalAgent,e,this.convModalProvider),this.historyLoaded=!0),this.folderPickerOpen=!1}},handleFolderPickerMessage(e){let t=e.detail;!t||t.type!=="directory_listing"||t.conversationId!=="_workdir_picker"||(this._folderPickerTimer&&(clearTimeout(this._folderPickerTimer),this._folderPickerTimer=null),this.folderPickerLoading=!1,this.folderPickerEntries=(t.entries||[]).filter(s=>s.type==="directory").sort((s,n)=>s.name.localeCompare(n.name)),t.dirPath!=null&&(this.folderPickerPath=t.dirPath))}},mounted(){if(this.store.openUnifiedChatCreate){let e=this.store.openUnifiedChatCreate;this.store.openUnifiedChatCreate=!1,this.convModalProvider=e==="copilot"?"copilot":"claude-code",this.openConversationModal({preserveProvider:!0})}this._clickOutsideHandler=e=>{e.target.closest(".agent-selector")||(this.showAgentDropdown=!1),!e.target.closest(".session-dots-btn")&&!e.target.closest(".session-menu")&&(this.activeSessionMenu=null)},document.addEventListener("click",this._clickOutsideHandler),window.addEventListener("resize",this.handleResize),window.addEventListener("workbench-message",this.handleFolderPickerMessage),fetch("/api/version").then(e=>e.json()).then(e=>{this.serverVersion=e.version}).catch(()=>{}),this._agentRestartAckHandler=e=>{let{agentId:t}=e.detail},window.addEventListener("agent-restart-ack",this._agentRestartAckHandler),this._agentUpgradeAckHandler=e=>{let{agentId:t,success:s,error:n,alreadyLatest:r,version:i,reason:o,currentNode:a,requiredNode:l}=e.detail;s?r&&(delete this.upgradingAgents[t],alert(this.$t("chat.agent.alreadyLatest",{version:i||""}))):(delete this.upgradingAgents[t],alert(o==="node_incompatible"?this.$t("chat.agent.nodeIncompatible",{current:a||"?",required:l||"?",version:i||""}):`Agent upgrade failed: ${n||"Unknown error"}`))},window.addEventListener("agent-upgrade-ack",this._agentUpgradeAckHandler),this._checkRestartingAgents=this.$watch(()=>this.store.agents.map(e=>e.id+":"+e.online),()=>{for(let e of Object.keys(this.restartingAgents)){let t=this.store.agents.find(s=>s.id===e);(t?.online||!t)&&delete this.restartingAgents[e]}for(let e of Object.keys(this.upgradingAgents)){let t=this.store.agents.find(r=>r.id===e),s=this.upgradingAgents[e],n=Date.now()-(s?.since||0);!t||n>12e4?delete this.upgradingAgents[e]:t.online&&(n<3e3?setTimeout(()=>{this.store.agents.find(o=>o.id===e)?.online&&delete this.upgradingAgents[e]},3e3-n):delete this.upgradingAgents[e])}})},beforeUnmount(){document.removeEventListener("click",this._clickOutsideHandler),window.removeEventListener("resize",this.handleResize),window.removeEventListener("workbench-message",this.handleFolderPickerMessage),window.removeEventListener("agent-restart-ack",this._agentRestartAckHandler),window.removeEventListener("agent-upgrade-ack",this._agentUpgradeAckHandler),this._checkRestartingAgents&&this._checkRestartingAgents(),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer)}}});function qg(e={}){let{sessions:t,activeSessionId:s,activeSessionKey:n,pinnedSessionIds:r,onlineAgentIds:i}=e,o=s||null,a=n||null,l=Object.prototype.hasOwnProperty.call(e,"activeSessionKey"),c=Array.isArray(r)?r:[],d=Array.isArray(i)?new Set(i.filter(Boolean)):null,u=new Map;c.forEach((p,g)=>{typeof p=="string"&&p&&!u.has(p)&&u.set(p,g)});let f=[];for(let p of Array.isArray(t)?t:[]){if(!p||!p.id||d&&p.agentId&&!d.has(p.agentId))continue;let g=String(p.id),m=p.agentId?`${p.agentId}${g}`:g;f.push({kind:"session",id:g,raw:p,pinned:!!p.pinned||!p.agentId&&u.has(g),active:l?m===a:g===o,processing:!!p.running||!!p.active||!!p.isRunning||!!p.isActive,_manualOrder:Number.isFinite(p.sortOrder)?p.sortOrder:Number.MAX_SAFE_INTEGER,_activityTime:ii(p)})}return f.sort((p,g)=>{if(p.pinned!==g.pinned)return p.pinned?-1:1;if(p._manualOrder!==g._manualOrder)return p._manualOrder-g._manualOrder;if(p._activityTime!==g._activityTime)return g._activityTime-p._activityTime;let m=u.has(p.id)?u.get(p.id):Number.MAX_SAFE_INTEGER,b=u.has(g.id)?u.get(g.id):Number.MAX_SAFE_INTEGER;return m!==b?m-b:p.id.localeCompare(g.id)}),f.map(({_manualOrder:p,_activityTime:g,...m})=>m)}var Bg=F(()=>{oi()});var kb,g0,Wg,jg=F(()=>{Yi();kl();Sl();Il();Cl();xl();Vl();Bg();kb=3600*1e3,g0=24*kb,Wg={name:"YeaftSidebar",components:{SessionCreateModal:un,SidebarModeToggle:Bi,SidebarAgentHeader:Wi,SidebarWorkCenter:ji,SessionSidebarShell:Ui,UnifiedSessionList:Ki},emits:["select-group","select-chat","toggle-sidebar","back","open-settings","open-group-settings"],template:`
|
|
6795
|
+
`,data(){return{showAgentDropdown:!1,showSettingsPanel:!1,restartingAgents:{},upgradingAgents:{},showConversationModal:!1,unifiedSessionCreateOpen:!1,unifiedSessionCreateProvider:"yeaft",unifiedSessionCreateProject:null,convModalAgent:"",convModalWorkDir:"",convModalProvider:"claude-code",selectedResumeSession:null,historyLoaded:!1,windowWidth:window.innerWidth,folderPickerOpen:!1,folderPickerPath:"",folderPickerEntries:[],folderPickerLoading:!1,folderPickerSelected:"",folderPickerTarget:"",serverVersion:"",chatGroupCollapsed:!1,sidebarTab:"chat",editingChatId:null,editingChatName:"",activeSessionMenu:null}},computed:{store(){return Pinia.useChatStore()},providerOptions(){return[{value:"claude-code",label:this.$t("provider.claudeCode")},{value:"copilot",label:this.$t("provider.copilot")}]},agentOptions(){return this.store.agents.filter(e=>e.online).map(e=>({value:e.id,label:`${e.name}${e.latency?` (${e.latency}ms)`:""}`}))},canUseWorkbench(){let e=De().role;return e==="admin"||e==="pro"},selectedConvModalAgentWorkDir(){return this.convModalAgent&&this.store.agents.find(t=>t.id===this.convModalAgent)?.workDir||""},onlineAgents(){return this.store.agents.filter(e=>e.online)},onlineAgentCount(){return this.onlineAgents.length},workCenterAgents(){return this.onlineAgents.filter(e=>Array.isArray(e.capabilities)&&e.capabilities.includes("work_center"))},isMobileView(){return this.windowWidth<=768},effectiveSidebarCollapsed(){return this.isMobileView?!this.store.sessionSidebarOpen:this.store.sidebarCollapsed},normalConversations(){return this.sortByActivity(this.store.conversations.filter(e=>e.agentOnline!==!1&&!this.isConversationHidden(e)))},pinnedChatConversations(){let e=this.store.conversations.filter(t=>t.agentOnline!==!1&&!this.isConversationHidden(t)&&this.store.isSessionPinned(t.id));return this.sortByActivity(e)},unpinnedChatConversations(){return this.sortByActivity(this.store.conversations.filter(e=>e.agentOnline!==!1&&!this.isConversationHidden(e)&&!this.store.isSessionPinned(e.id)))},chatSessionCount(){return this.store.conversations.filter(e=>e.agentOnline!==!1&&!this.isConversationHidden(e)).length}},methods:{isConversationHidden(e){return e?.id?(this.store.hiddenSessionCatalog||[]).some(t=>t?.runtimeProvider===(e.provider||"claude-code")&&t?.routeRef?.sessionId===e.id&&t?.routeRef?.agentId===(e.agentId||this.store.currentAgent||null)):!1},onSidebarCollapse(){Hg({isMobileView:this.isMobileView,showMobileSidebar:this.store.sessionSidebarOpen,closeMobileSidebar:()=>this.store.closeSessionSidebar(),toggleSidebar:()=>this.store.toggleSidebar()})},onModeFlip(e){e==="yeaft"?this.store.enterYeaft():this.store.leaveYeaft()},sortByActivity(e){return qu(e)},isCatalogSessionUnread(e){return e?.runtimeProvider!=="yeaft"?!1:this.store.isYeaftSessionUnread(e.routeRef?.sessionId,e.routeRef?.agentId)},isCatalogSessionSyncing(e){return typeof this.store.isSessionHistorySyncing=="function"?this.store.isSessionHistorySyncing(e?.routeRef):!1},onUnifiedCreate(e="yeaft"){this.unifiedSessionCreateProject=null,this.unifiedSessionCreateProvider=["yeaft","copilot","claude-code"].includes(e)?e:"yeaft",this.unifiedSessionCreateOpen=!0},onUnifiedCreateInProject({project:e}={}){e?.id&&(this.unifiedSessionCreateProject=e,this.unifiedSessionCreateProvider="yeaft",this.unifiedSessionCreateOpen=!0)},closeUnifiedSessionCreate(){this.unifiedSessionCreateOpen=!1,this.unifiedSessionCreateProject=null},async onUnifiedSessionCreated(e){let t=this.unifiedSessionCreateProject;if(this.closeUnifiedSessionCreate(),!t||!e?.id)return;let s=e.agentId||t.legacyAgentId||this.store.currentAgent||null,n=await this.store.mutateProject?.("move_session",{sessionId:e.id,projectId:t.legacyProjectId||t.id},s);if(!n?.ok){let r=n?.error?.message||n?.error?.code||"unknown";alert(this.$t("sidebar.projects.assignFailed",{name:t.name,message:r}))}},openWorkCenter(e=null){let t=this.workCenterAgents.find(s=>s.id===e)||this.workCenterAgents.find(s=>s.id===this.store.workCenterAgentId)||this.workCenterAgents[0];t&&this.store.enterWorkCenter(t.id)},onUnifiedSessionAction({action:e,row:t,title:s,sessions:n}={}){if(!t?.routeRef)return;let{runtimeProvider:r,agentId:i,sessionId:o}=t.routeRef;e==="rename"?this.store.renameCatalogSession({row:t,title:s}):e==="reorder"?this.store.reorderCatalogSessions(n):e==="pin"?this.store.toggleCatalogSessionPin(t):e==="remove"?this.store.hideCatalogSession(t):r==="yeaft"&&e==="settings"&&(this.store.pendingUnifiedSessionSettings={sessionId:o,agentId:i,section:"session"},this.store.openCatalogSession(t))},openConversationModal({preserveProvider:e=!1}={}){this.showConversationModal=!0,e||(this.convModalProvider="claude-code"),this.convModalAgent="",this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1,this._foldersRetried=!1;let t=this.store.agents.filter(r=>r.online),n=t.find(r=>r.id===this.store.currentAgent)||t[0];n&&(this.convModalAgent=n.id,this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider).then(()=>{this.showConversationModal&&this.store.folders.length===0&&!this._foldersRetried&&(this._foldersRetried=!0,setTimeout(()=>{this.showConversationModal&&this.convModalAgent&&this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider)},1500))}))},openConversationModalResume(){this.openConversationModal()},closeConversationModal(){this.showConversationModal=!1,this.convModalAgent="",this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1},onConvModalAgentChange(){this.convModalAgent&&(this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1,this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider))},onConvModalProviderChange(){this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1,this.convModalAgent&&this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider)},onConvModalWorkDirInput(){this.historyLoaded=!1,this.selectedResumeSession=null,this._workDirInputTimer&&clearTimeout(this._workDirInputTimer),this._workDirInputTimer=setTimeout(()=>{this.convModalWorkDir.trim()&&this.convModalAgent&&(this.store.listHistorySessionsForAgent(this.convModalAgent,this.convModalWorkDir.trim(),this.convModalProvider),this.historyLoaded=!0)},500)},selectConvModalFolder(e){this.convModalWorkDir=e,this.selectedResumeSession=null,this.convModalAgent&&(this.store.listHistorySessionsForAgent(this.convModalAgent,e,this.convModalProvider),this.historyLoaded=!0)},loadConvModalFolders(){this.convModalAgent&&this.store.listFoldersForAgent(this.convModalAgent,this.convModalProvider)},loadConvModalSessions(){this.convModalAgent&&this.convModalWorkDir.trim()&&(this.store.listHistorySessionsForAgent(this.convModalAgent,this.convModalWorkDir.trim(),this.convModalProvider),this.historyLoaded=!0)},toggleAgentDropdown(){this.showAgentDropdown=!this.showAgentDropdown,this.showAgentDropdown&&this.store.refreshAgents()},selectAgent(e){this.store.selectAgent(e),this.showAgentDropdown=!1},createNewConversation(){if(!this.convModalAgent)return;this.store.selectAgent(this.convModalAgent);let e=this.convModalWorkDir.trim()||this.selectedConvModalAgentWorkDir;this.store.createConversation(e,this.convModalAgent,null,this.buildConvOpts()),this.closeConversationModal()},buildConvOpts(){let e={provider:this.convModalProvider};return this.convModalProvider==="copilot"&&(e.providerOptions={allowAllTools:!0}),e},resumeSession(e){if(!this.convModalAgent)return;this.store.selectAgent(this.convModalAgent),this.store._pendingSessionTitle=e.title;let t=e.workDir||this.convModalWorkDir.trim()||this.selectedConvModalAgentWorkDir;this.store.resumeConversation(e.sessionId,t,this.convModalAgent,this.buildConvOpts()),this.closeConversationModal()},resumeSelectedSession(){if(!this.convModalAgent||!this.selectedResumeSession)return;this.store.selectAgent(this.convModalAgent),this.store._pendingSessionTitle=this.selectedResumeSession.title;let e=this.selectedResumeSession.workDir||this.convModalWorkDir.trim()||this.selectedConvModalAgentWorkDir;this.store.resumeConversation(this.selectedResumeSession.sessionId,e,this.convModalAgent,this.buildConvOpts()),this.closeConversationModal()},formatDate(e){return zi(e,this.$t.bind(this))},selectConversation(e,t){this.store.leaveWorkCenter(),this.store.selectConversation(e,t,{refresh:!0}),this.store.closeSessionSidebar()},onSessionClick(e){if(e.agentOnline===!1){this.store.addMessage({type:"system",content:this.$t("chat.session.agentOffline")});return}if(this.store.isSplitMode&&this.store.activePanelId){this.store.leaveWorkCenter(),this.store.setPanelConversation(this.store.activePanelId,e.id,{refresh:!0}),this.store.closeSessionSidebar();return}this.selectConversation(e.id,e.agentId)},hideSessionFromSidebar(e){if(!e?.id)return;let t=e.provider||"claude-code";this.store.hideCatalogSession({catalogKey:`chat:${e.id}`,runtimeProvider:t,routeRef:{runtimeProvider:t,agentId:e.agentId||this.store.currentAgent||null,sessionId:e.id},title:this.getConversationTitle(e),workDir:e.workDir||"",agentName:e.agentName||"",availability:e.agentOnline===!1?"offline":"online",pinned:this.store.isSessionPinned(e.id)})},closeSession(e,t){this.store.closeSession(e,t)},deleteConversation(e,t){confirm(this.$t("chat.delete.confirm"))&&this.store.deleteConversation(e,t)},getConversationTitle(e){let t=this.store.getConversationTitle(e.id);return t?t.length>30?t.slice(0,30)+"...":t:e.claudeSessionId?e.claudeSessionId.slice(0,8)+"...":e.id.slice(0,8)+"..."},getConversationFullTitle(e){let t=this.store.getConversationTitle(e.id);if(t&&t.length>30)return t},startChatRename(e){this.editingChatId=e.id,this.editingChatName=this.store.customConversationTitles[e.id]||this.store.conversationTitles[e.id]||"",this.$nextTick(()=>{let t=this.$refs.chatRenameInput;if(t){let s=Array.isArray(t)?t[0]:t;s.focus(),s.select()}})},commitChatRename(){if(!this.editingChatId)return;let e=this.editingChatId,t=this.editingChatName.trim();this.editingChatId=null,this.editingChatName="",this.store.renameChatSession(e,t)},cancelChatRename(){this.editingChatId=null,this.editingChatName=""},toggleSessionMenu(e){this.activeSessionMenu=this.activeSessionMenu===e?null:e},closeSessionMenu(){this.activeSessionMenu=null},getConversationTime(e){let s=this.store.executionStatusMap[e.id]?.lastActivity||e.createdAt;if(!s)return"";let n=new Date(s),r=new Date,i=r-n;return i<6e4?this.$t("chat.time.justNow"):i<36e5?this.$t("chat.time.minutesAgo",{count:Math.floor(i/6e4)}):n.toDateString()===r.toDateString()?n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):n.toLocaleDateString(void 0,{month:"numeric",day:"numeric"})},providerLabel(e){return e==="copilot"?this.$t("provider.copilot"):e==="claude-code"?this.$t("provider.claudeCode"):e||""},shortenPath(e){return to(e)},formatTime(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""},getLastPathSegment(e){return yr(e)},getParentPath(e){if(!e)return"";let t=e.split(/[/\\]/);return t.length<=2?"":t.slice(0,-1).join("/")},handleResize(){this.windowWidth=window.innerWidth},restartAgent(e){let s=this.store.agents.find(n=>n.id===e)?.name||e;confirm(this.$t("chat.agent.restartConfirm",{name:s}))&&(this.restartingAgents[e]=!0,setTimeout(()=>{delete this.restartingAgents[e]},12e4),this.store.restartAgent(e))},upgradeAgent(e){let t=this.store.agents.find(n=>n.id===e),s=t?.name||e;confirm(this.$t("chat.agent.upgradeConfirm",{name:s}))&&(this.upgradingAgents[e]={since:Date.now(),oldVersion:t?.version||null},setTimeout(()=>{delete this.upgradingAgents[e]},12e4),this.store.upgradeAgent(e))},openFolderPicker(e){let t=this.convModalAgent;if(!t)return;this.folderPickerTarget=e,this.folderPickerOpen=!0,this.folderPickerSelected="",this.folderPickerLoading=!0;let s=this.convModalWorkDir,n=this.store.agents.find(o=>o.id===t),r=s||n?.workDir||"";this.folderPickerPath=r,this.folderPickerEntries=[];let i=()=>{this.store.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",agentId:t,dirPath:r,workDir:n?.workDir||""})};i(),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=setTimeout(()=>{this.folderPickerLoading&&this.folderPickerOpen&&i()},5e3)},loadFolderPickerDir(e){let t=this.convModalAgent;if(!t)return;this.folderPickerLoading=!0,this.folderPickerSelected="",this.folderPickerEntries=[];let s=this.store.agents.find(r=>r.id===t),n=()=>{this.store.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",agentId:t,dirPath:e,workDir:s?.workDir||""})};n(),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=setTimeout(()=>{this.folderPickerLoading&&this.folderPickerOpen&&n()},5e3)},folderPickerNavigateUp(){if(!this.folderPickerPath)return;let e=this.folderPickerPath.includes("\\"),t=e?"\\":"/",s=this.folderPickerPath.replace(/[/\\]$/,"").split(/[/\\]/);if(s.pop(),s.length===0)this.folderPickerPath="",this.loadFolderPickerDir("");else if(e&&s.length===1&&/^[A-Za-z]:$/.test(s[0]))this.folderPickerPath=s[0]+"\\",this.loadFolderPickerDir(s[0]+"\\");else{let n=s.join(t);this.folderPickerPath=n,this.loadFolderPickerDir(n)}},folderPickerSelectItem(e){this.folderPickerSelected=e.name},folderPickerEnter(e){let s=this.folderPickerPath.includes("\\")||/^[A-Z]:/.test(e.name)?"\\":"/",n;this.folderPickerPath?n=this.folderPickerPath.replace(/[/\\]$/,"")+s+e.name:/^[A-Z]:$/.test(e.name)?n=e.name+"\\":n="/"+e.name,this.folderPickerPath=n,this.loadFolderPickerDir(n)},confirmFolderPicker(){let e=this.folderPickerPath;if(e){if(this.folderPickerSelected){let t=e.includes("\\")?"\\":"/";e=e.replace(/[/\\]$/,"")+t+this.folderPickerSelected}this.convModalWorkDir=e,this.selectedResumeSession=null,this.convModalAgent&&(this.store.listHistorySessionsForAgent(this.convModalAgent,e,this.convModalProvider),this.historyLoaded=!0),this.folderPickerOpen=!1}},handleFolderPickerMessage(e){let t=e.detail;!t||t.type!=="directory_listing"||t.conversationId!=="_workdir_picker"||(this._folderPickerTimer&&(clearTimeout(this._folderPickerTimer),this._folderPickerTimer=null),this.folderPickerLoading=!1,this.folderPickerEntries=(t.entries||[]).filter(s=>s.type==="directory").sort((s,n)=>s.name.localeCompare(n.name)),t.dirPath!=null&&(this.folderPickerPath=t.dirPath))}},mounted(){if(this.store.openUnifiedChatCreate){let e=this.store.openUnifiedChatCreate;this.store.openUnifiedChatCreate=!1,this.convModalProvider=e==="copilot"?"copilot":"claude-code",this.openConversationModal({preserveProvider:!0})}this._clickOutsideHandler=e=>{e.target.closest(".agent-selector")||(this.showAgentDropdown=!1),!e.target.closest(".session-dots-btn")&&!e.target.closest(".session-menu")&&(this.activeSessionMenu=null)},document.addEventListener("click",this._clickOutsideHandler),window.addEventListener("resize",this.handleResize),window.addEventListener("workbench-message",this.handleFolderPickerMessage),fetch("/api/version").then(e=>e.json()).then(e=>{this.serverVersion=e.version}).catch(()=>{}),this._agentRestartAckHandler=e=>{let{agentId:t}=e.detail},window.addEventListener("agent-restart-ack",this._agentRestartAckHandler),this._agentUpgradeAckHandler=e=>{let{agentId:t,success:s,error:n,alreadyLatest:r,version:i,reason:o,currentNode:a,requiredNode:l}=e.detail;s?r&&(delete this.upgradingAgents[t],alert(this.$t("chat.agent.alreadyLatest",{version:i||""}))):(delete this.upgradingAgents[t],alert(o==="node_incompatible"?this.$t("chat.agent.nodeIncompatible",{current:a||"?",required:l||"?",version:i||""}):`Agent upgrade failed: ${n||"Unknown error"}`))},window.addEventListener("agent-upgrade-ack",this._agentUpgradeAckHandler),this._checkRestartingAgents=this.$watch(()=>this.store.agents.map(e=>e.id+":"+e.online),()=>{for(let e of Object.keys(this.restartingAgents)){let t=this.store.agents.find(s=>s.id===e);(t?.online||!t)&&delete this.restartingAgents[e]}for(let e of Object.keys(this.upgradingAgents)){let t=this.store.agents.find(r=>r.id===e),s=this.upgradingAgents[e],n=Date.now()-(s?.since||0);!t||n>12e4?delete this.upgradingAgents[e]:t.online&&(n<3e3?setTimeout(()=>{this.store.agents.find(o=>o.id===e)?.online&&delete this.upgradingAgents[e]},3e3-n):delete this.upgradingAgents[e])}})},beforeUnmount(){document.removeEventListener("click",this._clickOutsideHandler),window.removeEventListener("resize",this.handleResize),window.removeEventListener("workbench-message",this.handleFolderPickerMessage),window.removeEventListener("agent-restart-ack",this._agentRestartAckHandler),window.removeEventListener("agent-upgrade-ack",this._agentUpgradeAckHandler),this._checkRestartingAgents&&this._checkRestartingAgents(),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer)}}});function Bg(e={}){let{sessions:t,activeSessionId:s,activeSessionKey:n,pinnedSessionIds:r,onlineAgentIds:i}=e,o=s||null,a=n||null,l=Object.prototype.hasOwnProperty.call(e,"activeSessionKey"),c=Array.isArray(r)?r:[],d=Array.isArray(i)?new Set(i.filter(Boolean)):null,u=new Map;c.forEach((p,g)=>{typeof p=="string"&&p&&!u.has(p)&&u.set(p,g)});let f=[];for(let p of Array.isArray(t)?t:[]){if(!p||!p.id||d&&p.agentId&&!d.has(p.agentId))continue;let g=String(p.id),m=p.agentId?`${p.agentId}${g}`:g;f.push({kind:"session",id:g,raw:p,pinned:!!p.pinned||!p.agentId&&u.has(g),active:l?m===a:g===o,processing:!!p.running||!!p.active||!!p.isRunning||!!p.isActive,_manualOrder:Number.isFinite(p.sortOrder)?p.sortOrder:Number.MAX_SAFE_INTEGER,_activityTime:ii(p)})}return f.sort((p,g)=>{if(p.pinned!==g.pinned)return p.pinned?-1:1;if(p._manualOrder!==g._manualOrder)return p._manualOrder-g._manualOrder;if(p._activityTime!==g._activityTime)return g._activityTime-p._activityTime;let m=u.has(p.id)?u.get(p.id):Number.MAX_SAFE_INTEGER,b=u.has(g.id)?u.get(g.id):Number.MAX_SAFE_INTEGER;return m!==b?m-b:p.id.localeCompare(g.id)}),f.map(({_manualOrder:p,_activityTime:g,...m})=>m)}var qg=F(()=>{oi()});var kb,g0,Wg,jg=F(()=>{Yi();kl();Sl();Il();Cl();xl();Vl();qg();kb=3600*1e3,g0=24*kb,Wg={name:"YeaftSidebar",components:{SessionCreateModal:un,SidebarModeToggle:qi,SidebarAgentHeader:Wi,SidebarWorkCenter:ji,SessionSidebarShell:Ui,UnifiedSessionList:Ki},emits:["select-group","select-chat","toggle-sidebar","back","open-settings","open-group-settings"],template:`
|
|
6777
6796
|
<SessionSidebarShell class="yeaft-sidebar" :collapsed="collapsed">
|
|
6778
6797
|
<template #collapsed>
|
|
6779
6798
|
<!-- Collapsed Icon Bar \u2014 mirrors Chat's .sidebar-collapsed-bar so the
|
|
@@ -6958,7 +6977,7 @@ ${String(e||"").trim()}
|
|
|
6958
6977
|
</button>
|
|
6959
6978
|
</div>
|
|
6960
6979
|
</SessionSidebarShell>
|
|
6961
|
-
`,props:{collapsed:{type:Boolean,default:!1}},data(){return{now:Date.now(),sessionCreateOpen:!1,sessionCreateProject:null,groupMenu:{open:!1,groupId:null},draggedSessionKey:null,dragOverSessionKey:null,serverVersion:"",restartingAgents:{},upgradingAgents:{}}},created(){try{typeof fetch=="function"&&fetch("/api/version").then(e=>e.json()).then(e=>{this.serverVersion=e&&e.version||""}).catch(()=>{})}catch{}},mounted(){if(this.chatStore?.openUnifiedSessionCreate&&(this.chatStore.openUnifiedSessionCreate=!1,this.sessionCreateOpen=!0),this.chatStore?.pendingUnifiedSessionSettings){let e=this.chatStore.pendingUnifiedSessionSettings;this.chatStore.pendingUnifiedSessionSettings=null,this.openGroupSettings({id:e.sessionId,agentId:e.agentId},e.section||"session")}this._agentUpgradeAckHandler=e=>{let{agentId:t,success:s,error:n,alreadyLatest:r,version:i,reason:o,currentNode:a,requiredNode:l}=e.detail||{};t&&(s?r&&(delete this.upgradingAgents[t],alert(this.$t("chat.agent.alreadyLatest",{version:i||""}))):(delete this.upgradingAgents[t],alert(o==="node_incompatible"?this.$t("chat.agent.nodeIncompatible",{current:a||"?",required:l||"?",version:i||""}):`Agent upgrade failed: ${n||"Unknown error"}`)))},typeof window<"u"&&window.addEventListener("agent-upgrade-ack",this._agentUpgradeAckHandler),typeof this.$watch=="function"&&(this._checkAgentTransientStates=this.$watch(()=>{let e=this.chatStore||this.store;return Array.isArray(e?.agents)?e.agents.map(t=>`${t.id}:${t.online}:${t.version||""}`):[]},()=>this.clearRecoveredAgentStatuses()))},beforeUnmount(){this._agentUpgradeAckHandler&&typeof window<"u"&&window.removeEventListener("agent-upgrade-ack",this._agentUpgradeAckHandler),this._checkAgentTransientStates&&this._checkAgentTransientStates()},computed:{store(){try{if(typeof Pinia<"u"&&Pinia.useChatStore)return Pinia.useChatStore()}catch{}return null},sessionsStore(){try{if(typeof window<"u"&&window.Pinia?.useSessionsStore)return window.Pinia.useSessionsStore()}catch{}return null},activeSessionId(){return this.chatStore?.yeaftActiveSessionFilter||this.sessionsStore?.activeSessionId||null},activeSessionKey(){let e=this.sessionsStore?.activeSessionKey||null;return(e?this.sessionsStore?.sessions?.[e]:null)?.id===this.activeSessionId?e:null},sessionList(){let e=qg({sessions:this.sessionsStore?.sessionList||[],activeSessionId:this.activeSessionId,activeSessionKey:this.activeSessionKey,pinnedSessionIds:this.chatStore?.pinnedSessions||[],onlineAgentIds:Array.isArray(this.onlineAgents)?this.onlineAgents.map(n=>n.id):void 0}),t=new Set((this.chatStore?.hiddenSessionCatalog||[]).filter(n=>n?.runtimeProvider==="yeaft").map(n=>`${n.routeRef?.agentId||""}${n.routeRef?.sessionId||""}`)),s=this.chatStore?.currentAgent||"";return e.filter(n=>!t.has(`${n.raw?.agentId||s}${n.id||""}`))},chatStore(){if(this.store)return this.store;try{if(typeof window<"u"&&window.Pinia?.useChatStore)return window.Pinia.useChatStore()}catch{}return null},onlineAgents(){let e=this.chatStore||this.store;return!e||!Array.isArray(e.agents)?[]:e.agents.filter(t=>t&&t.online)},onlineAgentCount(){return this.onlineAgents.length},workCenterAgents(){return this.onlineAgents.filter(e=>Array.isArray(e.capabilities)&&e.capabilities.includes("work_center"))},currentAgentName(){let e=this.chatStore||this.store;if(!e||!Array.isArray(e.agents))return"";let t=e.currentAgent;if(t){let n=e.agents.find(r=>r&&r.id===t);if(n&&n.name)return String(n.name);if(n&&n.id)return String(n.id)}let s=e.agents.find(n=>n&&n.online);return s?String(s.name||s.id||""):"Agent"},currentAgentOnline(){let e=this.chatStore||this.store;if(!e||!Array.isArray(e.agents))return!1;let t=e.currentAgent;if(t){let s=e.agents.find(n=>n&&n.id===t);if(s)return!!s.online}return e.agents.some(s=>s&&s.online)},agentTitleText(){let e=this.chatStore||this.store;return!e||!e.currentAgent?"":String(e.currentAgent)},canUseWorkbench(){let e=this.chatStore||this.store;if(!e||typeof e.hasCapability!="function")return!1;try{return!!(e.hasCapability("terminal")||e.hasCapability("file_editor"))}catch{return!1}}},methods:{tr(e,t){if(typeof this.$t=="function"){let s=this.$t(e);if(s&&s!==e)return s}return t},isSessionProcessing(e,t=null){let s=this.chatStore||this.store;return!s||!e?!1:typeof s.isYeaftSessionProcessing=="function"?s.isYeaftSessionProcessing(e,t):!1},isCatalogSessionUnread(e){if(e?.runtimeProvider!=="yeaft")return!1;let t=this.chatStore||this.store;return!t||typeof t.isYeaftSessionUnread!="function"?!1:t.isYeaftSessionUnread(e.routeRef?.sessionId,e.routeRef?.agentId)},isCatalogSessionSyncing(e){let t=this.chatStore||this.store;return typeof t?.isSessionHistorySyncing=="function"?t.isSessionHistorySyncing(e?.routeRef):!1},onToggleWorkbench(){let e=this.chatStore||this.store;e&&typeof e.toggleWorkbench=="function"&&e.toggleWorkbench()},onModeFlip(e){e==="chat"&&this.$emit("back")},onOpenWorkCenter(e=null){let t=this.chatStore||this.store,s=this.workCenterAgents.find(n=>n.id===e)||this.workCenterAgents.find(n=>n.id===t?.workCenterAgentId)||this.workCenterAgents[0];s&&t&&typeof t.enterWorkCenter=="function"&&t.enterWorkCenter(s.id)},onGroupCreated(e){},onOpenSessionCreate(){this.sessionCreateProject=null,this.sessionCreateOpen=!0},onUnifiedCreate(){this.onOpenSessionCreate()},onUnifiedCreateInProject({project:e}={}){e?.id&&(this.sessionCreateProject=e,this.sessionCreateOpen=!0)},closeSessionCreate(){this.sessionCreateOpen=!1,this.sessionCreateProject=null},onUnifiedSessionAction({action:e,row:t,title:s,sessions:n}={}){if(!t?.routeRef)return;let r=this.chatStore||this.store,{runtimeProvider:i,agentId:o,sessionId:a}=t.routeRef;e==="rename"?r?.renameCatalogSession?.({row:t,title:s}):e==="reorder"?r?.reorderCatalogSessions?.(n):e==="pin"?r?.toggleCatalogSessionPin?.(t):i==="yeaft"&&e==="settings"?this.openGroupSettings({id:a,agentId:o},"session"):e==="remove"&&r?.hideCatalogSession?.(t)},async onSessionCreated(e){let t=this.sessionCreateProject;if(this.closeSessionCreate(),!t||!e?.id)return;let s=this.chatStore||this.store,n=e.agentId||t.legacyAgentId||s?.currentAgent||null,r=await s?.mutateProject?.("move_session",{sessionId:e.id,projectId:t.legacyProjectId||t.id},n);if(!r?.ok){let i=r?.error?.message||r?.error?.code||"unknown";alert(this.$t("sidebar.projects.assignFailed",{name:t.name,message:i}))}},onSelectGroup(e){if(!e||!e.id)return;let t=this.chatStore||this.store;t&&typeof t.leaveWorkCenter=="function"&&t.leaveWorkCenter(),e.agentId&&this.chatStore&&this.chatStore.currentAgent!==e.agentId&&(typeof this.chatStore.selectAgent=="function"?this.chatStore.selectAgent(e.agentId):this.chatStore.currentAgent=e.agentId),this.sessionsStore&&this.sessionsStore.setActive(e.id,e.agentId||null),this.$emit("select-group",e)},sessionDragKey(e){return!e||!e.id?"":e.agentId?`${e.agentId}${e.id}`:`legacy${e.id}`},onSessionDragStart(e,t){let s=this.sessionDragKey(e);s&&(this.groupMenu={open:!1,groupId:null},this.draggedSessionKey=s,this.dragOverSessionKey=null,t?.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",s)))},onSessionDragOver(e,t){let s=this.sessionDragKey(e);!s||!this.draggedSessionKey||s===this.draggedSessionKey||(this.dragOverSessionKey=s,t?.dataTransfer&&(t.dataTransfer.dropEffect="move"))},onSessionDragLeave(e,t){let s=this.sessionDragKey(e);if(!s||this.dragOverSessionKey!==s)return;let n=t?.relatedTarget;n&&t?.currentTarget?.contains&&t.currentTarget.contains(n)||(this.dragOverSessionKey=null)},onSessionDrop(e,t){let s=this.draggedSessionKey||t?.dataTransfer?.getData?.("text/plain")||null,n=this.sessionDragKey(e);this.draggedSessionKey=null,this.dragOverSessionKey=null,!(!s||!n||s===n)&&this.reorderSessionRows(s,n)},onSessionDragEnd(){this.draggedSessionKey=null,this.dragOverSessionKey=null},reorderSessionRows(e,t){let s=this.sessionList.map(l=>this.sessionDragKey(l.raw)).filter(Boolean),n=s.indexOf(e),r=s.indexOf(t);if(n<0||r<0||n===r)return;let[i]=s.splice(n,1);s.splice(r,0,i);let o=this.sessionsStore?.reorderSessionsGlobally?.(s)||[],a=this.chatStore?.sessionCrudRequest;typeof a=="function"&&a.call(this.chatStore,"reorder",{sessions:o})},sessionAgentName(e){if(!e||!e.agentId)return"";let t=this.chatStore||this.store;if(!t||!Array.isArray(t.agents))return String(e.agentName||e.agentId||"");let s=t.agents.find(n=>n&&n.id===e.agentId);return String(s?.name||e.agentName||e.agentId||"")},groupPath(e){return to(e?.workDir)},openGroupSettings(e,t="members"){!e||!e.id||this.$emit("open-group-settings",{sessionId:e.id,agentId:e.agentId||null,section:t})},openGroupSettingsFromMenu(e,t){this.groupMenu={open:!1,groupId:null},this.openGroupSettings(e,t)},isSessionPinned(e){let t=e&&typeof e=="object"?e.id:e,s=!!(e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"pinned")),n=!!(s&&e.pinned);if(s&&e.agentId)return n;let r=this.chatStore&&this.chatStore.isSessionPinned;return n||(typeof r=="function"?!!r.call(this.chatStore,t):!1)},onTogglePin(e){if(this.groupMenu={open:!1,groupId:null},!e||!e.id)return;let t=this.chatStore&&this.chatStore.togglePin;typeof t=="function"&&t.call(this.chatStore,e.id,{sessionKind:"yeaft",agentId:e.agentId||this.store?.currentAgent||null,sessionName:e.name||e.title||e.id,workDir:e.workDir||"",pinned:!!e.pinned})},onRemoveFromList(e){if(this.groupMenu={open:!1,groupId:null},!e||!e.id)return;let t=e.agentId||this.chatStore?.currentAgent||null;if(!t||typeof this.chatStore?.hideCatalogSession!="function")return;let s=`yeaft:${t}:${e.id}`,n=this.chatStore.sessionCatalog?.find(r=>r.catalogKey===s)||{catalogKey:s,runtimeProvider:"yeaft",routeRef:{runtimeProvider:"yeaft",agentId:t,sessionId:e.id},title:e.name||e.id,workDir:e.workDir||"",agentName:this.sessionAgentName(e),availability:this.onlineAgents.some(r=>r.id===t)?"online":"offline",pinned:!!e.pinned};this.chatStore.hideCatalogSession(n)},groupDisplayName(e){return e?e.id==="grp_default"&&(e.name==="Default"||!e.name)?this.$t("yeaft.session.defaultName"):e.name||e.id||"":""},groupTime(e){let t=e&&e.createdAt?e.createdAt:null;if(!t)return"";let s=new Date(t),n=new Date,r=n-s;return r<6e4?this.$t("chat.time.justNow"):r<36e5?this.$t("chat.time.minutesAgo",{count:Math.floor(r/6e4)}):s.toDateString()===n.toDateString()?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{month:"numeric",day:"numeric"})},groupSubtitle(e){if(!e)return"";let t=Array.isArray(e.roster)?e.roster.length:0;if(t===0)return this.$t("yeaft.session.empty.title");let s=t===1?"yeaft.session.memberCount.one":"yeaft.session.memberCount.other";return this.$t(s,{count:t})},openGroupMenu(e,t){if(!e||!e.id)return;let s=this.sessionDragKey(e);if(!s)return;if(this.groupMenu.open&&this.groupMenu.groupId===s){this.groupMenu={open:!1,groupId:null};return}this.groupMenu={open:!0,groupId:s};let n=r=>{r&&r.target&&r.target.closest&&r.target.closest(".session-menu")||(this.groupMenu={open:!1,groupId:null},window.removeEventListener("click",n,!0))};setTimeout(()=>window.addEventListener("click",n,!0),0),t&&typeof t.stopPropagation=="function"&&t.stopPropagation()},restartAgent(e){let t=this.chatStore||this.store;if(!t||!Array.isArray(t.agents)||typeof t.restartAgent!="function")return;let n=t.agents.find(r=>r&&r.id===e)?.name||e;confirm(this.$t("chat.agent.restartConfirm",{name:n}))&&(this.restartingAgents[e]=!0,setTimeout(()=>{delete this.restartingAgents[e]},12e4),t.restartAgent(e))},clearRecoveredAgentStatuses(){let e=this.chatStore||this.store;if(!(!e||!Array.isArray(e.agents))){for(let t of Object.keys(this.restartingAgents)){let s=e.agents.find(n=>n&&n.id===t);(s?.online||!s)&&delete this.restartingAgents[t]}for(let t of Object.keys(this.upgradingAgents)){let s=e.agents.find(i=>i&&i.id===t),n=this.upgradingAgents[t],r=Date.now()-(n?.since||0);if(!s||r>12e4)delete this.upgradingAgents[t];else if(s.online){let i=n?.oldVersion||null,o=!!(i&&s.version&&s.version!==i),a=3e3;o||r>=a?delete this.upgradingAgents[t]:setTimeout(()=>{let l=this.chatStore||this.store;(Array.isArray(l?.agents)?l.agents.find(d=>d&&d.id===t):null)?.online&&delete this.upgradingAgents[t]},a-r)}}}},upgradeAgent(e){let t=this.chatStore||this.store;if(!t||!Array.isArray(t.agents)||typeof t.upgradeAgent!="function")return;let s=t.agents.find(r=>r&&r.id===e),n=s?.name||e;confirm(this.$t("chat.agent.upgradeConfirm",{name:n}))&&(this.upgradingAgents[e]={since:Date.now(),oldVersion:s?.version||null},setTimeout(()=>{delete this.upgradingAgents[e]},12e4),t.upgradeAgent(e))}}}});var Ug,Kg=F(()=>{Ug={name:"SessionInviteModal",emits:["open-library","dismiss"],props:{groupName:{type:String,default:""}},template:`
|
|
6980
|
+
`,props:{collapsed:{type:Boolean,default:!1}},data(){return{now:Date.now(),sessionCreateOpen:!1,sessionCreateProject:null,groupMenu:{open:!1,groupId:null},draggedSessionKey:null,dragOverSessionKey:null,serverVersion:"",restartingAgents:{},upgradingAgents:{}}},created(){try{typeof fetch=="function"&&fetch("/api/version").then(e=>e.json()).then(e=>{this.serverVersion=e&&e.version||""}).catch(()=>{})}catch{}},mounted(){if(this.chatStore?.openUnifiedSessionCreate&&(this.chatStore.openUnifiedSessionCreate=!1,this.sessionCreateOpen=!0),this.chatStore?.pendingUnifiedSessionSettings){let e=this.chatStore.pendingUnifiedSessionSettings;this.chatStore.pendingUnifiedSessionSettings=null,this.openGroupSettings({id:e.sessionId,agentId:e.agentId},e.section||"session")}this._agentUpgradeAckHandler=e=>{let{agentId:t,success:s,error:n,alreadyLatest:r,version:i,reason:o,currentNode:a,requiredNode:l}=e.detail||{};t&&(s?r&&(delete this.upgradingAgents[t],alert(this.$t("chat.agent.alreadyLatest",{version:i||""}))):(delete this.upgradingAgents[t],alert(o==="node_incompatible"?this.$t("chat.agent.nodeIncompatible",{current:a||"?",required:l||"?",version:i||""}):`Agent upgrade failed: ${n||"Unknown error"}`)))},typeof window<"u"&&window.addEventListener("agent-upgrade-ack",this._agentUpgradeAckHandler),typeof this.$watch=="function"&&(this._checkAgentTransientStates=this.$watch(()=>{let e=this.chatStore||this.store;return Array.isArray(e?.agents)?e.agents.map(t=>`${t.id}:${t.online}:${t.version||""}`):[]},()=>this.clearRecoveredAgentStatuses()))},beforeUnmount(){this._agentUpgradeAckHandler&&typeof window<"u"&&window.removeEventListener("agent-upgrade-ack",this._agentUpgradeAckHandler),this._checkAgentTransientStates&&this._checkAgentTransientStates()},computed:{store(){try{if(typeof Pinia<"u"&&Pinia.useChatStore)return Pinia.useChatStore()}catch{}return null},sessionsStore(){try{if(typeof window<"u"&&window.Pinia?.useSessionsStore)return window.Pinia.useSessionsStore()}catch{}return null},activeSessionId(){return this.chatStore?.yeaftActiveSessionFilter||this.sessionsStore?.activeSessionId||null},activeSessionKey(){let e=this.sessionsStore?.activeSessionKey||null;return(e?this.sessionsStore?.sessions?.[e]:null)?.id===this.activeSessionId?e:null},sessionList(){let e=Bg({sessions:this.sessionsStore?.sessionList||[],activeSessionId:this.activeSessionId,activeSessionKey:this.activeSessionKey,pinnedSessionIds:this.chatStore?.pinnedSessions||[],onlineAgentIds:Array.isArray(this.onlineAgents)?this.onlineAgents.map(n=>n.id):void 0}),t=new Set((this.chatStore?.hiddenSessionCatalog||[]).filter(n=>n?.runtimeProvider==="yeaft").map(n=>`${n.routeRef?.agentId||""}${n.routeRef?.sessionId||""}`)),s=this.chatStore?.currentAgent||"";return e.filter(n=>!t.has(`${n.raw?.agentId||s}${n.id||""}`))},chatStore(){if(this.store)return this.store;try{if(typeof window<"u"&&window.Pinia?.useChatStore)return window.Pinia.useChatStore()}catch{}return null},onlineAgents(){let e=this.chatStore||this.store;return!e||!Array.isArray(e.agents)?[]:e.agents.filter(t=>t&&t.online)},onlineAgentCount(){return this.onlineAgents.length},workCenterAgents(){return this.onlineAgents.filter(e=>Array.isArray(e.capabilities)&&e.capabilities.includes("work_center"))},currentAgentName(){let e=this.chatStore||this.store;if(!e||!Array.isArray(e.agents))return"";let t=e.currentAgent;if(t){let n=e.agents.find(r=>r&&r.id===t);if(n&&n.name)return String(n.name);if(n&&n.id)return String(n.id)}let s=e.agents.find(n=>n&&n.online);return s?String(s.name||s.id||""):"Agent"},currentAgentOnline(){let e=this.chatStore||this.store;if(!e||!Array.isArray(e.agents))return!1;let t=e.currentAgent;if(t){let s=e.agents.find(n=>n&&n.id===t);if(s)return!!s.online}return e.agents.some(s=>s&&s.online)},agentTitleText(){let e=this.chatStore||this.store;return!e||!e.currentAgent?"":String(e.currentAgent)},canUseWorkbench(){let e=this.chatStore||this.store;if(!e||typeof e.hasCapability!="function")return!1;try{return!!(e.hasCapability("terminal")||e.hasCapability("file_editor"))}catch{return!1}}},methods:{tr(e,t){if(typeof this.$t=="function"){let s=this.$t(e);if(s&&s!==e)return s}return t},isSessionProcessing(e,t=null){let s=this.chatStore||this.store;return!s||!e?!1:typeof s.isYeaftSessionProcessing=="function"?s.isYeaftSessionProcessing(e,t):!1},isCatalogSessionUnread(e){if(e?.runtimeProvider!=="yeaft")return!1;let t=this.chatStore||this.store;return!t||typeof t.isYeaftSessionUnread!="function"?!1:t.isYeaftSessionUnread(e.routeRef?.sessionId,e.routeRef?.agentId)},isCatalogSessionSyncing(e){let t=this.chatStore||this.store;return typeof t?.isSessionHistorySyncing=="function"?t.isSessionHistorySyncing(e?.routeRef):!1},onToggleWorkbench(){let e=this.chatStore||this.store;e&&typeof e.toggleWorkbench=="function"&&e.toggleWorkbench()},onModeFlip(e){e==="chat"&&this.$emit("back")},onOpenWorkCenter(e=null){let t=this.chatStore||this.store,s=this.workCenterAgents.find(n=>n.id===e)||this.workCenterAgents.find(n=>n.id===t?.workCenterAgentId)||this.workCenterAgents[0];s&&t&&typeof t.enterWorkCenter=="function"&&t.enterWorkCenter(s.id)},onGroupCreated(e){},onOpenSessionCreate(){this.sessionCreateProject=null,this.sessionCreateOpen=!0},onUnifiedCreate(){this.onOpenSessionCreate()},onUnifiedCreateInProject({project:e}={}){e?.id&&(this.sessionCreateProject=e,this.sessionCreateOpen=!0)},closeSessionCreate(){this.sessionCreateOpen=!1,this.sessionCreateProject=null},onUnifiedSessionAction({action:e,row:t,title:s,sessions:n}={}){if(!t?.routeRef)return;let r=this.chatStore||this.store,{runtimeProvider:i,agentId:o,sessionId:a}=t.routeRef;e==="rename"?r?.renameCatalogSession?.({row:t,title:s}):e==="reorder"?r?.reorderCatalogSessions?.(n):e==="pin"?r?.toggleCatalogSessionPin?.(t):i==="yeaft"&&e==="settings"?this.openGroupSettings({id:a,agentId:o},"session"):e==="remove"&&r?.hideCatalogSession?.(t)},async onSessionCreated(e){let t=this.sessionCreateProject;if(this.closeSessionCreate(),!t||!e?.id)return;let s=this.chatStore||this.store,n=e.agentId||t.legacyAgentId||s?.currentAgent||null,r=await s?.mutateProject?.("move_session",{sessionId:e.id,projectId:t.legacyProjectId||t.id},n);if(!r?.ok){let i=r?.error?.message||r?.error?.code||"unknown";alert(this.$t("sidebar.projects.assignFailed",{name:t.name,message:i}))}},onSelectGroup(e){if(!e||!e.id)return;let t=this.chatStore||this.store;t&&typeof t.leaveWorkCenter=="function"&&t.leaveWorkCenter(),e.agentId&&this.chatStore&&this.chatStore.currentAgent!==e.agentId&&(typeof this.chatStore.selectAgent=="function"?this.chatStore.selectAgent(e.agentId):this.chatStore.currentAgent=e.agentId),this.sessionsStore&&this.sessionsStore.setActive(e.id,e.agentId||null),this.$emit("select-group",e)},sessionDragKey(e){return!e||!e.id?"":e.agentId?`${e.agentId}${e.id}`:`legacy${e.id}`},onSessionDragStart(e,t){let s=this.sessionDragKey(e);s&&(this.groupMenu={open:!1,groupId:null},this.draggedSessionKey=s,this.dragOverSessionKey=null,t?.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",s)))},onSessionDragOver(e,t){let s=this.sessionDragKey(e);!s||!this.draggedSessionKey||s===this.draggedSessionKey||(this.dragOverSessionKey=s,t?.dataTransfer&&(t.dataTransfer.dropEffect="move"))},onSessionDragLeave(e,t){let s=this.sessionDragKey(e);if(!s||this.dragOverSessionKey!==s)return;let n=t?.relatedTarget;n&&t?.currentTarget?.contains&&t.currentTarget.contains(n)||(this.dragOverSessionKey=null)},onSessionDrop(e,t){let s=this.draggedSessionKey||t?.dataTransfer?.getData?.("text/plain")||null,n=this.sessionDragKey(e);this.draggedSessionKey=null,this.dragOverSessionKey=null,!(!s||!n||s===n)&&this.reorderSessionRows(s,n)},onSessionDragEnd(){this.draggedSessionKey=null,this.dragOverSessionKey=null},reorderSessionRows(e,t){let s=this.sessionList.map(l=>this.sessionDragKey(l.raw)).filter(Boolean),n=s.indexOf(e),r=s.indexOf(t);if(n<0||r<0||n===r)return;let[i]=s.splice(n,1);s.splice(r,0,i);let o=this.sessionsStore?.reorderSessionsGlobally?.(s)||[],a=this.chatStore?.sessionCrudRequest;typeof a=="function"&&a.call(this.chatStore,"reorder",{sessions:o})},sessionAgentName(e){if(!e||!e.agentId)return"";let t=this.chatStore||this.store;if(!t||!Array.isArray(t.agents))return String(e.agentName||e.agentId||"");let s=t.agents.find(n=>n&&n.id===e.agentId);return String(s?.name||e.agentName||e.agentId||"")},groupPath(e){return to(e?.workDir)},openGroupSettings(e,t="members"){!e||!e.id||this.$emit("open-group-settings",{sessionId:e.id,agentId:e.agentId||null,section:t})},openGroupSettingsFromMenu(e,t){this.groupMenu={open:!1,groupId:null},this.openGroupSettings(e,t)},isSessionPinned(e){let t=e&&typeof e=="object"?e.id:e,s=!!(e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"pinned")),n=!!(s&&e.pinned);if(s&&e.agentId)return n;let r=this.chatStore&&this.chatStore.isSessionPinned;return n||(typeof r=="function"?!!r.call(this.chatStore,t):!1)},onTogglePin(e){if(this.groupMenu={open:!1,groupId:null},!e||!e.id)return;let t=this.chatStore&&this.chatStore.togglePin;typeof t=="function"&&t.call(this.chatStore,e.id,{sessionKind:"yeaft",agentId:e.agentId||this.store?.currentAgent||null,sessionName:e.name||e.title||e.id,workDir:e.workDir||"",pinned:!!e.pinned})},onRemoveFromList(e){if(this.groupMenu={open:!1,groupId:null},!e||!e.id)return;let t=e.agentId||this.chatStore?.currentAgent||null;if(!t||typeof this.chatStore?.hideCatalogSession!="function")return;let s=`yeaft:${t}:${e.id}`,n=this.chatStore.sessionCatalog?.find(r=>r.catalogKey===s)||{catalogKey:s,runtimeProvider:"yeaft",routeRef:{runtimeProvider:"yeaft",agentId:t,sessionId:e.id},title:e.name||e.id,workDir:e.workDir||"",agentName:this.sessionAgentName(e),availability:this.onlineAgents.some(r=>r.id===t)?"online":"offline",pinned:!!e.pinned};this.chatStore.hideCatalogSession(n)},groupDisplayName(e){return e?e.id==="grp_default"&&(e.name==="Default"||!e.name)?this.$t("yeaft.session.defaultName"):e.name||e.id||"":""},groupTime(e){let t=e&&e.createdAt?e.createdAt:null;if(!t)return"";let s=new Date(t),n=new Date,r=n-s;return r<6e4?this.$t("chat.time.justNow"):r<36e5?this.$t("chat.time.minutesAgo",{count:Math.floor(r/6e4)}):s.toDateString()===n.toDateString()?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{month:"numeric",day:"numeric"})},groupSubtitle(e){if(!e)return"";let t=Array.isArray(e.roster)?e.roster.length:0;if(t===0)return this.$t("yeaft.session.empty.title");let s=t===1?"yeaft.session.memberCount.one":"yeaft.session.memberCount.other";return this.$t(s,{count:t})},openGroupMenu(e,t){if(!e||!e.id)return;let s=this.sessionDragKey(e);if(!s)return;if(this.groupMenu.open&&this.groupMenu.groupId===s){this.groupMenu={open:!1,groupId:null};return}this.groupMenu={open:!0,groupId:s};let n=r=>{r&&r.target&&r.target.closest&&r.target.closest(".session-menu")||(this.groupMenu={open:!1,groupId:null},window.removeEventListener("click",n,!0))};setTimeout(()=>window.addEventListener("click",n,!0),0),t&&typeof t.stopPropagation=="function"&&t.stopPropagation()},restartAgent(e){let t=this.chatStore||this.store;if(!t||!Array.isArray(t.agents)||typeof t.restartAgent!="function")return;let n=t.agents.find(r=>r&&r.id===e)?.name||e;confirm(this.$t("chat.agent.restartConfirm",{name:n}))&&(this.restartingAgents[e]=!0,setTimeout(()=>{delete this.restartingAgents[e]},12e4),t.restartAgent(e))},clearRecoveredAgentStatuses(){let e=this.chatStore||this.store;if(!(!e||!Array.isArray(e.agents))){for(let t of Object.keys(this.restartingAgents)){let s=e.agents.find(n=>n&&n.id===t);(s?.online||!s)&&delete this.restartingAgents[t]}for(let t of Object.keys(this.upgradingAgents)){let s=e.agents.find(i=>i&&i.id===t),n=this.upgradingAgents[t],r=Date.now()-(n?.since||0);if(!s||r>12e4)delete this.upgradingAgents[t];else if(s.online){let i=n?.oldVersion||null,o=!!(i&&s.version&&s.version!==i),a=3e3;o||r>=a?delete this.upgradingAgents[t]:setTimeout(()=>{let l=this.chatStore||this.store;(Array.isArray(l?.agents)?l.agents.find(d=>d&&d.id===t):null)?.online&&delete this.upgradingAgents[t]},a-r)}}}},upgradeAgent(e){let t=this.chatStore||this.store;if(!t||!Array.isArray(t.agents)||typeof t.upgradeAgent!="function")return;let s=t.agents.find(r=>r&&r.id===e),n=s?.name||e;confirm(this.$t("chat.agent.upgradeConfirm",{name:n}))&&(this.upgradingAgents[e]={since:Date.now(),oldVersion:s?.version||null},setTimeout(()=>{delete this.upgradingAgents[e]},12e4),t.upgradeAgent(e))}}}});var Ug,Kg=F(()=>{Ug={name:"SessionInviteModal",emits:["open-library","dismiss"],props:{groupName:{type:String,default:""}},template:`
|
|
6962
6981
|
<div class="group-invite-overlay" @click.self="onDismiss" role="dialog" aria-modal="true" :aria-label="$t('yeaft.session.invite.title')">
|
|
6963
6982
|
<div class="group-invite-modal">
|
|
6964
6983
|
<header class="group-invite-header">
|
|
@@ -7897,7 +7916,7 @@ ${String(e||"").trim()}
|
|
|
7897
7916
|
</div>
|
|
7898
7917
|
</section>
|
|
7899
7918
|
</aside>
|
|
7900
|
-
`,setup(e,{emit:t}){let s=window.Pinia&&window.Pinia.useVpStore?window.Pinia.useVpStore():null,n=A=>s&&typeof s.vpTextColor=="function"?s.vpTextColor(A):"var(--text-primary)",r=Vue.getCurrentInstance(),i=r&&r.appContext.config.globalProperties.$t||(A=>A),o=Vue.computed(()=>(typeof e.announcementText=="string"?e.announcementText:"").trim()),a=Vue.computed(()=>!!o.value),l=Vue.computed(()=>{let A=o.value.replace(/\s+/g," ");return A.length<=96?A:A.slice(0,95)+"\u2026"}),c=Vue.ref({}),d=new Map,u=new Map,f=A=>{let _=d.get(A);_&&(_.scrollTop=_.scrollHeight,u.set(A,!0))},p=A=>{let _=!c.value[A];c.value={...c.value,[A]:_},_&&(u.set(A,!0),Vue.nextTick(()=>f(A)))},g=(A,_)=>{_?(d.set(A,_),u.has(A)||u.set(A,!0),Vue.nextTick(()=>{u.get(A)&&f(A)})):d.delete(A)},m=A=>{let _=d.get(A);if(!_)return;let j=_.scrollHeight-_.scrollTop-_.clientHeight;u.set(A,j<8)};Vue.watch(()=>JSON.stringify((Array.isArray(e.tasks)?e.tasks:[]).map(A=>[A.id,A?.log?.preview||""])),()=>Vue.nextTick(()=>{d.forEach((A,_)=>{u.get(_)&&f(_)})}));let b=A=>{let _=A?.ownerVpId||"";return _?s&&typeof s.vpLabel=="function"?s.vpLabel(_):_:"unknown"},I=A=>{if(!A)return"";try{return new Date(A).toLocaleTimeString()}catch{return String(A)}},y=A=>{switch(A?.kind){case"sub_agent":return i("yeaft.sessionStatus.task.kind.subAgent");case"shell":return i("yeaft.sessionStatus.task.kind.shell");default:return A?.kind||""}},S=A=>{let _=A?.runtime?.command;return typeof _=="string"?_.trim():""},w=A=>{let _=[],j=A?.title||A?.id||"",
|
|
7919
|
+
`,setup(e,{emit:t}){let s=window.Pinia&&window.Pinia.useVpStore?window.Pinia.useVpStore():null,n=A=>s&&typeof s.vpTextColor=="function"?s.vpTextColor(A):"var(--text-primary)",r=Vue.getCurrentInstance(),i=r&&r.appContext.config.globalProperties.$t||(A=>A),o=Vue.computed(()=>(typeof e.announcementText=="string"?e.announcementText:"").trim()),a=Vue.computed(()=>!!o.value),l=Vue.computed(()=>{let A=o.value.replace(/\s+/g," ");return A.length<=96?A:A.slice(0,95)+"\u2026"}),c=Vue.ref({}),d=new Map,u=new Map,f=A=>{let _=d.get(A);_&&(_.scrollTop=_.scrollHeight,u.set(A,!0))},p=A=>{let _=!c.value[A];c.value={...c.value,[A]:_},_&&(u.set(A,!0),Vue.nextTick(()=>f(A)))},g=(A,_)=>{_?(d.set(A,_),u.has(A)||u.set(A,!0),Vue.nextTick(()=>{u.get(A)&&f(A)})):d.delete(A)},m=A=>{let _=d.get(A);if(!_)return;let j=_.scrollHeight-_.scrollTop-_.clientHeight;u.set(A,j<8)};Vue.watch(()=>JSON.stringify((Array.isArray(e.tasks)?e.tasks:[]).map(A=>[A.id,A?.log?.preview||""])),()=>Vue.nextTick(()=>{d.forEach((A,_)=>{u.get(_)&&f(_)})}));let b=A=>{let _=A?.ownerVpId||"";return _?s&&typeof s.vpLabel=="function"?s.vpLabel(_):_:"unknown"},I=A=>{if(!A)return"";try{return new Date(A).toLocaleTimeString()}catch{return String(A)}},y=A=>{switch(A?.kind){case"sub_agent":return i("yeaft.sessionStatus.task.kind.subAgent");case"shell":return i("yeaft.sessionStatus.task.kind.shell");default:return A?.kind||""}},S=A=>{let _=A?.runtime?.command;return typeof _=="string"?_.trim():""},w=A=>{let _=[],j=A?.title||A?.id||"",q=S(A);return j&&_.push(`${i("yeaft.sessionStatus.task.title")}: ${j}`),q&&_.push(`${i("yeaft.sessionStatus.task.command")}: ${q}`),_.join(`
|
|
7901
7920
|
`)},v=A=>`${A?.agentId||""}${A?.sessionId||""}::${A?.id||""}`,h=A=>A?.status==="running"&&(A.kind==="shell"&&!!A.runtime?.pid||A.kind==="sub_agent"&&!!A.runtime?.subAgentId),M=A=>!!(A?.id&&e.stoppingTasksById?.[v(A)]),x=A=>Db(A,i),E=A=>om(A,i),V=A=>{switch(A.status){case"idle":return i("yeaft.vpTimeline.status.idle");case"typing":return i("yeaft.vpTimeline.status.typing");case"thinking":return i("yeaft.vpTimeline.status.thinking");case"retrying":return i("yeaft.vpTimeline.status.retrying");case"streaming":return i("yeaft.vpTimeline.status.streaming");case"tool":return i("yeaft.vpTimeline.status.tool");case"error":return i("yeaft.vpTimeline.status.error");case"offline":return i("yeaft.vpTimeline.status.offline");default:return A.status}},L=new Set(["typing","thinking","retrying","streaming","tool"]);return{hasAnnouncement:a,announcementPreview:l,statusLabel:V,isActiveStatus:A=>L.has(A),threadCountTitle:A=>{let _=Array.isArray(A&&A.threads)?A.threads:[];return _.length?_.slice(0,5).map(j=>`${j.title||j.threadId||"thread"}: ${j.status||"idle"}`).join(`
|
|
7902
7921
|
`):""},vpTextColorFor:n,expandedTasks:c,toggleTaskExpanded:p,taskOwnerName:b,formatTaskTime:I,taskKindLabel:y,shellTaskCommand:S,taskSummaryTitle:w,isTaskCancellable:h,isTaskStopping:M,taskDetailLines:x,subAgentTaskStreamText:E,setTaskLogRef:g,onTaskLogScroll:m}}}});var cm,dm=F(()=>{cm={name:"YeaftSessionActions",emits:["toggle-search","reload-messages","toggle-session-status","toggle-debug","reload-page"],props:{searchOpen:{type:Boolean,default:!1},loadingMoreHistory:{type:Boolean,default:!1},sessionStatusVisible:{type:Boolean,default:!0},debugMode:{type:Boolean,default:!1},showPageReload:{type:Boolean,default:!1}},template:`
|
|
7903
7922
|
<div class="yeaft-session-actions">
|
|
@@ -8038,7 +8057,7 @@ ${String(e||"").trim()}
|
|
|
8038
8057
|
>{{ $t('yeaft.outline.moreMatches') }}</button>
|
|
8039
8058
|
</div>
|
|
8040
8059
|
</section>
|
|
8041
|
-
`,setup(e,{emit:t,expose:s}){let n=Vue.ref(null),r=Vue.ref(null),i=Vue.computed(()=>Array.from(String(e.searchState.query||"").trim()).length>0||!!e.searchState.senderKey);Vue.watch(()=>e.senderOptions.map(y=>y.key),y=>{let S=e.searchState.senderKey||"";S&&!y.includes(S)&&t("sender-invalid")},{flush:"sync"});let o=Vue.computed(()=>$b(i.value?e.searchState.results:e.outlineState.results)),a=Vue.computed(()=>{let y=o.value.findIndex(S=>fn(S)===e.activeMessageId);return y>=0?y:0}),l=Vue.computed(()=>i.value?e.searchState.loading:e.outlineState.loading),c=Vue.computed(()=>{if(i.value)return`${e.searchState.results.length}${e.searchState.hasMore?"+":""}`;let y=e.outlineState.totalCount;return Number.isFinite(y)?String(y):String(e.outlineState.results.length||"")}),d=Vue.computed(()=>{let y=i.value?e.searchState.error:e.outlineState.error;return y?y==="unsupported"?"yeaft.outline.unsupported":"yeaft.outline.error":""}),u=()=>Vue.nextTick(()=>{n.value?.focus?.(),r.value&&(r.value.scrollTop=0)}),f=()=>{let y=r.value;t("load-older",{scrollHeight:y?.scrollHeight||0,scrollTop:y?.scrollTop||0})},p=()=>{if(i.value||e.outlineState.loading||!e.outlineState.hasMore)return;let y=r.value;y&&y.scrollHeight-y.scrollTop-y.clientHeight<=40&&f()},g=y=>{t("move",fn(y)),t("preview",y)},m=y=>{let S=Math.max(0,Math.min(o.value.length-1,y)),w=o.value[S];t("move",fn(w)),w&&t("preview",w)},b=y=>{y.key==="Escape"?(y.preventDefault(),t("close")):y.key==="ArrowDown"&&o.value.length?(y.preventDefault(),m(a.value+1)):y.key==="ArrowUp"&&o.value.length?(y.preventDefault(),m(a.value-1)):y.key==="Enter"&&o.value.length&&(y.preventDefault(),t("select",o.value[a.value]||o.value[0]))};return Vue.watch([o,()=>e.activeMessageId],([y,S])=>{y.some(w=>fn(w)===S)||t("move",fn(y[0]))},{immediate:!0}),s({focus:u,restoreOlderScroll:({scrollTop:y=0}={})=>Vue.nextTick(()=>{r.value&&(r.value.scrollTop=y)})}),Vue.onMounted(u),{inputRef:n,listRef:r,isSearching:i,visibleResults:o,activeIndex:a,isLoading:l,countLabel:c,errorKey:d,focus:u,loadOlder:f,onScroll:p,onKeyDown:b,previewResult:g,formatOutlineTime:Lb,historyResultIdentity:fn}}}});function mm(e,t){if(!Array.isArray(e)||e.length===0)return[];let s=new Map;if(Array.isArray(t))for(let i of t)i&&i.vpId&&s.set(i.vpId,i);let n=new Set,r=[];for(let i of e)!i||n.has(i)||(n.add(i),r.push(s.get(i)||{vpId:i}));return r}function Ol(e,t,s=null){return!t||!e?null:typeof e.sessionById=="function"?e.sessionById(t,s||null)||null:e.sessions?.[t]||null}function Vb(e,t){if(!t)return"idle";if(t.connectionState&&t.connectionState!=="connected")return"offline";let s=t.vpStatuses&&t.vpStatuses[e];return s&&s.state?s.state:"idle"}function hm(e){let{vpList:t,vpStatuses:s,stoppingVpTurnIds:n,connectionState:r,vpLabelOf:i,vpDescriptionOf:o}=e||{},a={vpStatuses:s||{},stoppingVpTurnIds:n||{},connectionState:r||null},l=(f,p)=>{if(typeof i=="function"){let g=i(f);if(g)return g}return p&&(p.displayName||p.displayNameZh)||f},c=(f,p)=>{if(typeof o=="function"){let g=o(f);if(g)return g}return p&&(p.description||p.role||p.descriptionZh||p.roleZh)||""},d=new Set,u=[];if(Array.isArray(t))for(let f of t)!f||!f.vpId||(d.add(f.vpId),u.push(gm(f.vpId,l(f.vpId,f),c(f.vpId,f),a)));if(s)for(let f of Object.keys(s))!f||d.has(f)||(d.add(f),u.push(gm(f,l(f,null),c(f,null),a)));return u}function gm(e,t,s,n){let r=n&&n.vpStatuses&&n.vpStatuses[e];return{vpId:e,displayName:t||e,description:s||"",status:Vb(e,n),turnId:r?.turnId||null,isStopping:!!(r?.turnId&&n?.stoppingVpTurnIds?.[r.turnId]),runningThreadCount:r&&Number.isFinite(r.runningThreadCount)?r.runningThreadCount:0,threads:r&&Array.isArray(r.threads)?r.threads:[]}}var vm=F(()=>{});function bm(e){return!e||typeof e!="object"?"":typeof e.ref=="string"&&e.ref?e.ref:typeof e.provider=="string"&&e.provider&&typeof e.id=="string"&&e.id?`${e.provider}/${e.id}`:typeof e.id=="string"?e.id:""}function Fl(e,t){return!e||!t?!1:e.id===t||bm(e)===t}function wm(e,t=""){let s=e?.config?.model;return typeof s=="string"&&s.trim()?s.trim():typeof t=="string"&&t.trim()?t.trim():""}function km(e){if(!Array.isArray(e))return[];let t=[];for(let s of e){if(typeof s!="string")continue;let n=s.trim();!n||t.includes(n)||t.push(n)}return t}function Nl(e){return km(e).filter(t=>(ym[t]??-1)>=ym.medium)}function
|
|
8060
|
+
`,setup(e,{emit:t,expose:s}){let n=Vue.ref(null),r=Vue.ref(null),i=Vue.computed(()=>Array.from(String(e.searchState.query||"").trim()).length>0||!!e.searchState.senderKey);Vue.watch(()=>e.senderOptions.map(y=>y.key),y=>{let S=e.searchState.senderKey||"";S&&!y.includes(S)&&t("sender-invalid")},{flush:"sync"});let o=Vue.computed(()=>$b(i.value?e.searchState.results:e.outlineState.results)),a=Vue.computed(()=>{let y=o.value.findIndex(S=>fn(S)===e.activeMessageId);return y>=0?y:0}),l=Vue.computed(()=>i.value?e.searchState.loading:e.outlineState.loading),c=Vue.computed(()=>{if(i.value)return`${e.searchState.results.length}${e.searchState.hasMore?"+":""}`;let y=e.outlineState.totalCount;return Number.isFinite(y)?String(y):String(e.outlineState.results.length||"")}),d=Vue.computed(()=>{let y=i.value?e.searchState.error:e.outlineState.error;return y?y==="unsupported"?"yeaft.outline.unsupported":"yeaft.outline.error":""}),u=()=>Vue.nextTick(()=>{n.value?.focus?.(),r.value&&(r.value.scrollTop=0)}),f=()=>{let y=r.value;t("load-older",{scrollHeight:y?.scrollHeight||0,scrollTop:y?.scrollTop||0})},p=()=>{if(i.value||e.outlineState.loading||!e.outlineState.hasMore)return;let y=r.value;y&&y.scrollHeight-y.scrollTop-y.clientHeight<=40&&f()},g=y=>{t("move",fn(y)),t("preview",y)},m=y=>{let S=Math.max(0,Math.min(o.value.length-1,y)),w=o.value[S];t("move",fn(w)),w&&t("preview",w)},b=y=>{y.key==="Escape"?(y.preventDefault(),t("close")):y.key==="ArrowDown"&&o.value.length?(y.preventDefault(),m(a.value+1)):y.key==="ArrowUp"&&o.value.length?(y.preventDefault(),m(a.value-1)):y.key==="Enter"&&o.value.length&&(y.preventDefault(),t("select",o.value[a.value]||o.value[0]))};return Vue.watch([o,()=>e.activeMessageId],([y,S])=>{y.some(w=>fn(w)===S)||t("move",fn(y[0]))},{immediate:!0}),s({focus:u,restoreOlderScroll:({scrollTop:y=0}={})=>Vue.nextTick(()=>{r.value&&(r.value.scrollTop=y)})}),Vue.onMounted(u),{inputRef:n,listRef:r,isSearching:i,visibleResults:o,activeIndex:a,isLoading:l,countLabel:c,errorKey:d,focus:u,loadOlder:f,onScroll:p,onKeyDown:b,previewResult:g,formatOutlineTime:Lb,historyResultIdentity:fn}}}});function mm(e,t){if(!Array.isArray(e)||e.length===0)return[];let s=new Map;if(Array.isArray(t))for(let i of t)i&&i.vpId&&s.set(i.vpId,i);let n=new Set,r=[];for(let i of e)!i||n.has(i)||(n.add(i),r.push(s.get(i)||{vpId:i}));return r}function Ol(e,t,s=null){return!t||!e?null:typeof e.sessionById=="function"?e.sessionById(t,s||null)||null:e.sessions?.[t]||null}function Vb(e,t){if(!t)return"idle";if(t.connectionState&&t.connectionState!=="connected")return"offline";let s=t.vpStatuses&&t.vpStatuses[e];return s&&s.state?s.state:"idle"}function hm(e){let{vpList:t,vpStatuses:s,stoppingVpTurnIds:n,connectionState:r,vpLabelOf:i,vpDescriptionOf:o}=e||{},a={vpStatuses:s||{},stoppingVpTurnIds:n||{},connectionState:r||null},l=(f,p)=>{if(typeof i=="function"){let g=i(f);if(g)return g}return p&&(p.displayName||p.displayNameZh)||f},c=(f,p)=>{if(typeof o=="function"){let g=o(f);if(g)return g}return p&&(p.description||p.role||p.descriptionZh||p.roleZh)||""},d=new Set,u=[];if(Array.isArray(t))for(let f of t)!f||!f.vpId||(d.add(f.vpId),u.push(gm(f.vpId,l(f.vpId,f),c(f.vpId,f),a)));if(s)for(let f of Object.keys(s))!f||d.has(f)||(d.add(f),u.push(gm(f,l(f,null),c(f,null),a)));return u}function gm(e,t,s,n){let r=n&&n.vpStatuses&&n.vpStatuses[e];return{vpId:e,displayName:t||e,description:s||"",status:Vb(e,n),turnId:r?.turnId||null,isStopping:!!(r?.turnId&&n?.stoppingVpTurnIds?.[r.turnId]),runningThreadCount:r&&Number.isFinite(r.runningThreadCount)?r.runningThreadCount:0,threads:r&&Array.isArray(r.threads)?r.threads:[]}}var vm=F(()=>{});function bm(e){return!e||typeof e!="object"?"":typeof e.ref=="string"&&e.ref?e.ref:typeof e.provider=="string"&&e.provider&&typeof e.id=="string"&&e.id?`${e.provider}/${e.id}`:typeof e.id=="string"?e.id:""}function Fl(e,t){return!e||!t?!1:e.id===t||bm(e)===t}function wm(e,t=""){let s=e?.config?.model;return typeof s=="string"&&s.trim()?s.trim():typeof t=="string"&&t.trim()?t.trim():""}function km(e){if(!Array.isArray(e))return[];let t=[];for(let s of e){if(typeof s!="string")continue;let n=s.trim();!n||t.includes(n)||t.push(n)}return t}function Nl(e){return km(e).filter(t=>(ym[t]??-1)>=ym.medium)}function Bl(e){let t=km(e);return t.length?t.length===1?t[0]:t[t.length-2]:""}function Sm(e,t=""){let s=e?.config?.modelEffort;return typeof s=="string"&&s.trim()?s.trim():typeof t=="string"&&t.trim()?t.trim():""}function Im(e){let t=[];for(let s of Array.isArray(e)?e:[]){let n=bm(s);if(!n)continue;let r=s.label||s.id||n,i=Nl(s?.effortOptions);t.push({model:s,modelRef:n,label:r,efforts:i,defaultEffort:Bl(i)||null})}return t}var ym,Cm=F(()=>{ym=Object.freeze({minimal:0,low:1,medium:2,high:3,xhigh:4,max:5})});function Am({agentInventoryReady:e=!1,hasYeaftAgent:t=!1,sessionsReady:s=!1,sessionsEmpty:n=!1}={}){return!e||s&&!n?!1:t?s?n:!1:!0}var xm=F(()=>{});function Tm({activeSessionFilter:e=null,sessionsStore:t=null,topbarGroup:s=null}={}){return e||t?.activeSessionId||s?.id||null}function Mm(e={}){return e.currentAgentInfo?.online?!0:Array.isArray(e.agents)&&e.agents.some(t=>t&&t.online)}var Pm=F(()=>{});function Rm(e={}){return!e?.warning}var _m=F(()=>{});function $m(e,t){return e&&t?`${e}:${t}`:""}function Vm(e){if(e!==void 0)return e;try{return globalThis.localStorage}catch{return null}}function Hm(e){try{let t=JSON.parse(e?.getItem(ql)||"{}");return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Hb({agentId:e,sessionId:t,validKeys:s=[],storage:n}={}){let r=s.length===0||s.includes(so)?so:"",i=$m(e,t);if(!i)return r;let o=Vm(n),a=Hm(o);if(!Object.prototype.hasOwnProperty.call(a,i))return r;let l=typeof a[i]=="string"?a[i]:"";if(l===Lm)return"";if(l&&s.includes(l))return l;delete a[i];try{o?.setItem(ql,JSON.stringify(a))}catch{}return r}function Em({agentId:e,sessionId:t,senderKey:s,storage:n}={}){let r=$m(e,t);if(!r)return!1;let i=Vm(n);if(!i)return!1;let o=Hm(i);o[r]=s||Lm;try{return i.setItem(ql,JSON.stringify(o)),!0}catch{return!1}}function Dm(e){let t=e?.updatedAt||e?.endedAt||e?.createdAt,s=t?Date.parse(t):NaN;return Number.isFinite(s)?s:0}function Ob(e){return Object.values(e||{}).filter(t=>t?.status==="running").sort((t,s)=>Dm(s)-Dm(t))}var ql,Lm,so,Om,Fm=F(()=>{Di();ol();vl();jg();Kg();Yi();Yg();hl();nm();lm();dm();fm();Ll();$l();al();vm();Cm();Ms();xm();Pm();_m();il();ql="yeaft-history-sender-preferences",Lm="__all__",so="user";Om={name:"YeaftPage",components:{ChatInput:an,MessageList:xi,SettingsPanel:Fi,YeaftSidebar:Wg,SessionInviteModal:Ug,SessionCreateModal:un,SessionSettingsModal:zg,WorkbenchPanel:Oi,WorkCenterPage:eo,YeaftDebugPanel:sm,VpTimelinePane:am,YeaftSessionActions:cm,YeaftConversationOutline:pm,LlmTab:Zi},template:`
|
|
8042
8061
|
<div class="yeaft-page" ref="pageRef">
|
|
8043
8062
|
<!-- Mobile sidebar overlay -->
|
|
8044
8063
|
<div class="yeaft-sidebar-overlay" v-if="store.sessionSidebarOpen && isMobile" @click="store.closeSessionSidebar()"></div>
|
|
@@ -8456,11 +8475,11 @@ ${String(e||"").trim()}
|
|
|
8456
8475
|
@open-vp-library="openVpLibraryFromGroupSettings"
|
|
8457
8476
|
/>
|
|
8458
8477
|
</div>
|
|
8459
|
-
`,setup(){let e=Pinia.useChatStore(),t=Pinia.useAuthStore(),s=Pinia.useVpStore(),n=Vue.getCurrentInstance(),r=n&&n.appContext.config.globalProperties.$t||(C=>C),i=Vue.ref(!1),o=Vue.ref(null),a=Vue.ref(!1),l=Vue.ref(!1),c=Vue.ref(!1),d=Vue.ref(""),u=Vue.ref(""),f=Vue.ref(!1),p=Vue.ref(""),g=null,m=Vue.ref("vp"),b=Vue.ref(null),I=Vue.ref(null),y=Vue.ref(null),S=Vue.ref(null),w=Vue.ref(null),v=Vue.ref(null),h=Vue.ref(!1),M=Vue.ref(null),x=Vue.computed(()=>e.getYeaftHistoryOutlineState()),E=Vue.computed(()=>{let C=R(),Q=e.yeaftActiveSessionFilter||C?.activeSessionId||null,oe=Q?Ol(C,Q,e.currentAgent||null):null,Re=Array.isArray(oe?.roster)?oe.roster:[];return[{key:"user",label:r("yeaft.outline.you")},...Re.map(_e=>({key:`vp:${_e}`,label:s.vpLabel(_e)}))]}),V=Vue.ref(e.yeaftHistorySearchState?.query||""),L=null,R=()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}},P=()=>{let C=R();return{agentId:e.currentAgent||null,sessionId:e.yeaftActiveSessionFilter||C?.activeSessionId||null}},A=()=>Hb({...P(),validKeys:E.value.map(C=>C.key)}),_=(C="")=>{let{agentId:Q,sessionId:oe}=P();e.yeaftHistorySearchState={requestId:null,agentId:Q,sessionId:oe,query:"",senderKey:C,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null}},j=Vue.computed(()=>{let C=e.currentAgent||"agent",Q=R(),oe=e.yeaftActiveSessionFilter||Q?.activeSessionId||"session";return`yeaft:${C}:${oe}`});Vue.watch(j,()=>{y.value=null});let B=null,z=null,se=C=>{if(!C)return!1;let Q=String(C.tagName||"").toLowerCase();return Q==="textarea"||Q==="input"||C.isContentEditable===!0},me=({recoverScroll:C=!1}={})=>{let Q=S.value;if(!Q)return;if(!Xe.value){Q.style.removeProperty("--yeaft-visual-viewport-height");return}let oe=window.visualViewport,Re=Math.max(1,Math.round(oe?.height||window.innerHeight||1));Q.style.setProperty("--yeaft-visual-viewport-height",`${Re}px`),!(!C||oe&&window.innerHeight&&oe.height<window.innerHeight*.85||se(document.activeElement))&&window.scrollTo(0,0)},ae=(C={})=>{B!=null&&cancelAnimationFrame(B),B=requestAnimationFrame(()=>{B=null,me(C)})},ve=()=>{ae({recoverScroll:!0}),z&&clearTimeout(z),z=setTimeout(()=>{z=null,ae({recoverScroll:!0})},260)},ge=Vue.computed(()=>e.hasCapability("terminal")||e.hasCapability("file_editor")),pe=Vue.computed(()=>!0),T=C=>{let Q=C&&C.id?C.id:null;Q&&(e.setActiveSessionFilter(Q,{agentId:C.agentId||null}),Xe.value&&e.closeSessionSidebar())},K=C=>{},re=Vue.ref(null),he=Vue.ref(!1),Pe=320,U=Math.max(Pe,Math.round(window.innerWidth*.25)),q=localStorage.getItem("yeaft-debug-width"),N=Vue.ref(q?parseInt(q,10):U),O=Vue.computed(()=>({"--yeaft-detail-width":N.value+"px"})),D=C=>{he.value=!0;let Q=C.clientX,oe=N.value,Re=window.innerWidth*.6,_e=Ut=>{let Kt=Q-Ut.clientX,Vs=Math.min(Re,Math.max(Pe,oe+Kt));N.value=Vs},Ye=()=>{he.value=!1,document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Ye),localStorage.setItem("yeaft-debug-width",String(N.value))};document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Ye)},Z="yeaft-session-status-visible",ne=()=>{try{let C=localStorage.getItem(Z);return!(C==="0"||C==="false")}catch{return!0}},ye=Vue.ref(ne()),Y=C=>{ye.value=!!C;try{localStorage.setItem(Z,ye.value?"1":"0")}catch{}},ee=()=>Y(!ye.value),ue=()=>Y(!1),le=220,Ce=280,xe=(()=>{try{return localStorage.getItem("yeaft-vp-timeline-width")}catch{return null}})(),$e=xe?parseInt(xe,10):NaN,je=Vue.ref(Number.isFinite($e)&&$e>=le?$e:Ce),yt=Vue.computed(()=>({"--yeaft-vp-timeline-width":je.value+"px"})),bt=C=>{let Q=C.clientX,oe=je.value,Re=Math.max(le,Math.floor(window.innerWidth*.4)),_e=Ut=>{let Kt=Q-Ut.clientX,Vs=Math.min(Re,Math.max(le,oe+Kt));je.value=Vs},Ye=()=>{document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Ye);try{localStorage.setItem("yeaft-vp-timeline-width",String(je.value))}catch{}};document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Ye)},rs="(max-width: 768px)",gn="(max-width: 1024px)",Wt=typeof window.matchMedia=="function"?window.matchMedia(rs):null,Rt=typeof window.matchMedia=="function"?window.matchMedia(gn):null,_t=(C,Q)=>C?C.matches:window.innerWidth<=Q,Xe=Vue.ref(_t(Wt,768)),wt=Vue.ref(_t(Rt,1024)),mn=Vue.computed(()=>Xe.value?!e.sessionSidebarOpen:e.sidebarCollapsed),H=()=>{Xe.value=_t(Wt,768),wt.value=_t(Rt,1024)},G=()=>{H(),ve()},de=C=>{C&&(typeof C.addEventListener=="function"?C.addEventListener("change",G):typeof C.addListener=="function"&&C.addListener(G))},fe=C=>{C&&(typeof C.removeEventListener=="function"?C.removeEventListener("change",G):typeof C.removeListener=="function"&&C.removeListener(G))},we=()=>{L&&(clearTimeout(L),L=null),V.value="",_(A()),h.value=!1,M.value=null},Te=()=>{let C=A();V.value="",_(C),h.value=!0,e.loadYeaftHistoryOutline(),C&&e.searchYeaftHistory("",{senderKey:C}),Vue.nextTick(()=>v.value?.focus?.())},Ze=()=>{h.value?we():Te()},Ue=C=>{h.value&&sf(C.target)&&we()},Je=C=>{V.value=C,L&&clearTimeout(L),M.value=null,L=setTimeout(()=>{L=null,e.searchYeaftHistory(V.value,{senderKey:e.yeaftHistorySearchState.senderKey})},220)},qe=C=>{L&&clearTimeout(L),L=null,M.value=null,Em({...P(),senderKey:C}),e.searchYeaftHistory(V.value,{senderKey:C})},Be=()=>{Em({...P(),senderKey:so}),M.value=null,e.searchYeaftHistory(V.value,{senderKey:so})},We=C=>{if(!e.loadYeaftHistoryOutline({append:!0}))return;let Q=Vue.watch(()=>x.value.loading,oe=>{oe||(Q(),v.value?.restoreOlderScroll?.(C))})},Ke=()=>e.searchYeaftHistory(e.yeaftHistorySearchState.query,{append:!0,senderKey:e.yeaftHistorySearchState.senderKey}),ze=C=>{e.hasCapability("session_history_window_prefetch")&&e.loadYeaftHistoryWindow(C)},dt=C=>{let Q=e.beginYeaftHistoryReveal?.(C)||null;return nf({result:C,revealWindow:oe=>e.revealYeaftHistoryResult(oe,Q),nextTick:()=>Vue.nextTick(),revealMessage:oe=>w.value?.revealMessage?.(oe),isMobile:Xe.value,closeOutline:we}).finally(()=>e.finishYeaftHistoryReveal?.(Q))},Rs=C=>{if((C.metaKey||C.ctrlKey)&&String(C.key).toLowerCase()==="f"){C.preventDefault(),Te();return}if(C.key==="Escape"){if(h.value){we();return}if(o.value){st();return}}};Vue.onMounted(()=>{H(),window.addEventListener("resize",G),de(Wt),de(Rt),window.visualViewport?.addEventListener("resize",ve),window.visualViewport?.addEventListener("scroll",ve),document.addEventListener("click",kt),document.addEventListener("click",Ue),document.addEventListener("keydown",Rs),ae()}),Vue.onUnmounted(()=>{window.removeEventListener("resize",G),fe(Wt),fe(Rt),window.visualViewport?.removeEventListener("resize",ve),window.visualViewport?.removeEventListener("scroll",ve),document.removeEventListener("click",kt),document.removeEventListener("click",Ue),document.removeEventListener("keydown",Rs),B!=null&&cancelAnimationFrame(B),z&&clearTimeout(z),L&&clearTimeout(L)}),Vue.watch(()=>e.yeaftConversationId,C=>{C&&e.activeConversations[0]!==C&&(e.activeConversations=[C])}),Vue.watch(()=>[e.currentAgent,e.yeaftActiveSessionFilter],()=>{we(),_(A())});let hn=()=>{e.leaveYeaft()},ro=(C,Q,oe)=>{let Re=R();if(Re&&Re.activeNeedsInvite){let Kt=Re.activeSession;Kt&&jt.delete(Kt.id);return}let _e=e.yeaftActiveSessionFilter||Re&&Re.activeSessionId||"grp_default",Ye=Ri(C).mentions,Ut=Array.isArray(Q)?Q:void 0;e.sendYeaftSessionMessage({groupId:_e,text:C,mentions:Ye,attachments:Ut,quote:oe})},io=C=>{C&&(y.value=C,I.value?.focusInput?.())},br=C=>{y.value=null,I.value?.replaceDraft?.(C||"")},oo=()=>{let C=R(),Q=e.yeaftActiveSessionFilter||C?.activeSessionId||null;Q&&e.cancelYeaftSession(Q)},ao=(C="")=>{let Q=Oe.value;Q&&e.enterWorkCenterFromSession(Q,C)},lo=()=>{if(Xe.value){e.toggleSessionSidebar();return}e.toggleSidebar()},co=()=>{i.value=!i.value},uo=()=>{i.value=!1},po=()=>{e.reloadYeaftMessages()},vn=()=>{if(typeof e.requestYeaftSessionInventory=="function"){e.requestYeaftSessionInventory();return}e._hasHandledAgentList=!1,e._hasHandledYeaftSessionHydrate=!1,e.yeaftSessionHydrateError=null,e.sendWsMessage({type:"get_agents"})},wr=()=>{window.location.reload()},yn=Vue.computed(()=>{let C=R(),Q=e.yeaftActiveSessionFilter||C?.activeSessionId||null;return Q?e.isYeaftSessionProcessing(Q,e.currentAgent||null):!1}),Oe=Vue.computed(()=>{let C=R();if(!C||!C.sessions)return null;let Q=e.yeaftActiveSessionFilter||null;if(Q&&typeof C.sessionById=="function"){let oe=C.sessionById(Q,e.currentAgent||null);if(oe)return oe}if(C.activeSessionId&&typeof C.sessionById=="function"){let oe=C.sessionById(C.activeSessionId,e.currentAgent||null);if(oe)return oe}return typeof C.sessionById=="function"?C.sessionById("grp_default",e.currentAgent||null):null}),bn=()=>Tm({activeSessionFilter:e.yeaftActiveSessionFilter,sessionsStore:R(),topbarGroup:Oe.value}),fo=Vue.computed(()=>{let C=Oe.value||{},Q=typeof C.id=="string"?C.id.trim():"",oe=[C.title,C.name,C.config?.title,C.config?.name];for(let Re of oe){let _e=typeof Re=="string"?Re.trim():"";if(_e&&!(Q&&_e===Q)&&!/^(sessions?|groups?)\//i.test(_e)&&!/^session_[A-Za-z0-9_-]+$/.test(_e)&&!(C.workDir&&_e===C.workDir))return _e}return""}),go=Vue.computed(()=>{let C=Oe.value?.workDir;return typeof C=="string"?C.trim():""}),mo=Vue.computed(()=>Oe.value&&typeof Oe.value.announcement=="string"?Oe.value.announcement:""),is=Vue.computed(()=>wm(Oe.value,e.yeaftModel||"")),os=Vue.computed(()=>{let C=is.value;return C&&e.yeaftAvailableModels.find(Q=>Fl(Q,C))||null}),wn=Vue.computed(()=>os.value?.label||os.value?.id||is.value),kr=C=>Nl(C?.effortOptions),kn=Vue.computed(()=>Sm(Oe.value,e.yeaftModelEffort||"")),ho=Vue.computed(()=>{let C=Array.isArray(os.value?.effortOptions)?os.value.effortOptions.filter(Boolean):[];return C.length?C.includes(kn.value)?kn.value:ql(C):null}),Sn=Vue.computed(()=>Im(e.yeaftAvailableModels)),Sr=Vue.computed(()=>kr(os.value)),In=C=>{C==="model"&&!Sn.value.length||C==="effort"&&!Sr.value.length||(o.value=o.value===C?null:C)},st=(C=null)=>{(!C||o.value===C)&&(o.value=null)},vo=(C,Q)=>{let oe=C.currentTarget;Vue.nextTick(()=>{oe?.contains(document.activeElement)||st(Q)})},yo=(C,Q=null)=>{if(!C)return;let oe=Oe.value?.id||null;e.switchYeaftModel(C,oe,Q),st()},bo=C=>{if(!Sr.value.includes(C)||!is.value)return;let Q=Oe.value?.id||null;e.switchYeaftModel(is.value,Q,C),st()},_s=C=>!C||!Number.isFinite(C)||C<=0?"":C>=1e6?`${Math.round(C/1e5)/10}m`:C>=1e3?`${Math.round(C/1e3)}k`:String(C),Ir=C=>{let Q=_s(C?.contextWindow),oe=_s(C?.maxOutput);return Q&&oe?`${Q} \xB7 ${oe} out`:Q},kt=C=>{if(!o.value)return;C.target.closest(".yeaft-composer-choice")||st()},Cn=()=>{a.value||(m.value="vp",b.value=null),a.value=!a.value},nt=({initialTab:C="vp",editVpId:Q=null}={})=>{m.value=["vp","search","mcp"].includes(C)?C:"vp",b.value=m.value==="vp"&&Q||null,a.value=!0},as=()=>{st(),l.value=!0},wo=C=>{tt(C)&&(l.value=!1)},Cr=async()=>{if(!(u.value||f.value)){f.value=!0,p.value="";try{let C={"Content-Type":"application/json"};t.token&&(C.Authorization=`Bearer ${t.token}`);let Q=await fetch("/api/user/agent-secret",{headers:C});if(!Q.ok){let _e=r("yeaft.onboarding.secretError");try{let Ye=await Q.json();Ye?.error&&(_e=Ye.error)}catch{}throw new Error(_e)}let oe=await Q.json(),Re=oe?.agentSecret||oe?.agent_secret||"";if(u.value=String(Re||"").trim(),!u.value)throw new Error(r("yeaft.onboarding.secretError"))}catch(C){p.value=C?.message||r("yeaft.onboarding.secretError")}finally{f.value=!1}}},Es=()=>{c.value=!0},Ds=C=>{c.value=!1},Ar=async(C,Q)=>{if(Q&&!(typeof navigator>"u"||!navigator.clipboard?.writeText))try{let oe=typeof Q=="string"?Q:Q?.value||"";if(!oe)return;await navigator.clipboard.writeText(oe),d.value=C||"",g&&clearTimeout(g),g=setTimeout(()=>{d.value="",g=null},1800)}catch{}},Ls=(C,Q)=>{},xr=(C={})=>{Rm(C)&&(l.value=!1)},jt=Vue.reactive(new Set),Et=Vue.computed(()=>{let C=R();return C?C.activeSession:null}),$s=C=>{if(!C)return"";if(C.id==="grp_default"&&(C.name==="Default"||!C.name))try{let Q=typeof window<"u"?window.i18n:null;if(Q&&Q.global&&typeof Q.global.t=="function")return Q.global.t("yeaft.session.defaultName")}catch{}return C.name||C.id||""},ko=Vue.computed(()=>$s(Et.value)),Tr=Vue.computed(()=>{let C=R();if(!C||!C.activeNeedsInvite)return!1;let Q=C.activeSession;return Q?!jt.has(Q.id):!1}),Mr=Vue.computed(()=>{let C=R();return!!(C&&C.activeNeedsInvite)}),So=Vue.computed(()=>{let C=R();return e._hasHandledAgentList===!0&&e._hasHandledYeaftSessionHydrate===!0&&!!(C&&C.hasLoadedSnapshot)}),ls=Vue.computed(()=>{let C=R();return Am({agentInventoryReady:e._hasHandledAgentList===!0,hasYeaftAgent:Mm(e),sessionsReady:e._hasHandledYeaftSessionHydrate===!0&&!!(C&&C.hasLoadedSnapshot),sessionsEmpty:!!(C&&C.isEmpty)})});Vue.watch(ls,C=>{C&&Cr()},{immediate:!0});let Pr="npm install -g @yeaft/webchat-agent",Wl=Vue.computed(()=>{let Q=(typeof window<"u"&&window.location?.origin?window.location.origin:"http://localhost:3456").replace(/^http:/,"ws:").replace(/^https:/,"wss:"),oe=u.value||r("yeaft.onboarding.secretPending");return`yeaft-agent install --server ${Q} --name yeaft-agent --secret ${oe}`}),k="gh auth login && yeaft-agent llm use github-copilot --model gpt-5.5",$=()=>{let C=Et.value;C&&jt.add(C.id),jl(C?C.id:null)},W=()=>{let C=Et.value;C&&jt.add(C.id)},ie=Vue.ref(!1),be=Vue.ref(null),ce=Vue.ref(null),Fe=Vue.ref("session"),Ie=Vue.ref(""),te=(C={})=>{let Q=C&&(C.sessionId||C.groupId)||null,oe=C&&C.editVpId||"",Re=oe?"members":C&&C.section||"session";Q&&(be.value=Q,ce.value=C&&C.agentId||null,Fe.value=Re,Ie.value=oe,ie.value=!0)},ut=()=>{let C=bn();C&&te({sessionId:C,section:"session"})},Rr=()=>{ie.value=!1,be.value=null,ce.value=null,Ie.value=""},An=()=>{Rr(),nt({initialTab:"vp"})},jl=C=>{C&&te({sessionId:C,section:"members"})};Vue.watch(()=>{let C=Et.value;return C?C.id+":"+(Array.isArray(C.roster)?C.roster.length:0)+":"+(C.defaultVpId||""):""},(C,Q)=>{let oe=Et.value;oe&&C!==Q&&Array.isArray(oe.roster)&&oe.roster.length>0&&jt.delete(oe.id)}),typeof Vue.onBeforeUnmount=="function"&&Vue.onBeforeUnmount(()=>{g&&clearTimeout(g),g=null});let Nm=()=>{a.value=!1},qm=Vue.computed(()=>!a.value&&!ls.value&&ye.value),Bm=Vue.computed(()=>{let C=R(),Q=e.yeaftActiveSessionFilter||C?.activeSessionId||null;if(!Q)return[];let Re=(typeof C?.sessionById=="function"?C.sessionById(Q,e.currentAgent||null):null)?.agentId||e.currentAgent||null,_e=Re?`${Re}${Q}`:Q,Ye=e.yeaftActiveTasksBySession?.[_e]||{};return Ob(Ye)}),Wm=Vue.computed(()=>{if(!e.yeaftConversationId)return[];let Q=R(),oe=e.yeaftActiveSessionFilter||Q?.activeSessionId||null;if(!oe)return[];let Re=Ol(Q,oe,e.currentAgent||null),_e=Re&&Array.isArray(Re.roster)?Re.roster:[];if(_e.length===0)return[];let Ye=new Set(_e),Ut=mm(_e,s.vpList||[]),Kt=e.vpStatuses||{},Vs={},_r=e.currentAgent||null;for(let Ne of Object.values(Kt)){if(!Ne||!Ne.vpId)continue;let Er=Ne.sessionId??Ne.groupId;Er&&Er!==oe||_r&&Ne.agentId&&Ne.agentId!==_r||Ye.has(Ne.vpId)&&(Vs[Ne.vpId]=Ne)}let Ul={};for(let Ne of Object.values(e.activeVpTurns||{}))!Ne?.turnId||!Ne?.sessionId||Ne.sessionId!==oe||_r&&Ne.agentId&&Ne.agentId!==_r||Object.entries(e.stoppingVpTurnIds||{}).some(([Er])=>e.activeVpTurns?.[Er]===Ne)&&(Ul[Ne.turnId]=!0);return hm({vpList:Ut,vpStatuses:Vs,stoppingVpTurnIds:Ul,connectionState:e.connectionState,vpLabelOf:Ne=>s.vpLabel(Ne),vpDescriptionOf:Ne=>s.vpDescription(Ne)})});return{store:e,pageRef:S,effectiveSidebarCollapsed:mn,debugMode:i,composerMenuOpen:o,topbarGroup:Oe,topbarSessionTitle:fo,topbarFolderPath:go,topbarModel:is,topbarModelLabel:wn,topbarEffort:ho,topbarModelRows:Sn,topbarEffortOptions:Sr,selectableEffortsForModel:kr,modelOptionMatchesRef:Fl,showSettings:a,showLlmConfig:l,sessionCreateOpen:c,settingsInitialTab:m,settingsInitialEditVpId:b,chatInputRef:I,messageQuote:y,messageListRef:w,historySearchRef:v,historySearchOpen:h,historySearchActiveMessageId:M,historyOutlineState:x,historySenderOptions:E,toggleHistorySearch:Ze,closeHistorySearch:we,onHistorySearchQuery:Je,onHistorySenderChange:qe,onHistorySenderInvalid:Be,loadOlderHistoryOutline:We,loadMoreHistorySearchResults:Ke,previewHistorySearchResult:ze,selectHistorySearchResult:dt,yeaftInputDraftKey:j,openSettings:nt,isMobile:Xe,isNarrowDetail:wt,detailPanel:re,isResizingDetail:he,detailWidthStyle:O,startDetailResize:D,isProcessing:yn,goBack:hn,sendMessage:ro,setMessageQuote:io,editMessageAsNew:br,cancelYeaft:oo,openWorkItemDraft:ao,toggleSidebar:lo,toggleDebug:co,closeDebug:uo,reloadMessages:po,retryConversationInventory:vn,reloadPage:wr,toggleComposerMenu:In,closeComposerMenu:st,onComposerMenuFocusout:vo,selectModel:yo,selectEffort:bo,openLlmConfig:as,trackOverlayPointerDown:at,trackOverlayPointerUp:lt,clearOverlayPointerGesture:ct,closeLlmConfigFromOverlay:wo,openSessionCreate:Es,onSessionCreated:Ds,copyOnboardingCommand:Ar,copiedOnboardingCommand:d,onLlmConfigMessage:Ls,onLlmConfigSaved:xr,formatTokens:_s,formatModelCtx:Ir,toggleSettings:Cn,onSettingsSaved:Nm,sidebarV2Enabled:pe,onSelectGroupV2:T,onSelectChat:K,canUseWorkbench:ge,shouldShowInviteModal:Tr,inviteGroupName:ko,onInviteOpenLibrary:$,onInviteDismiss:W,isActiveGroupEmpty:Mr,conversationInventoryReady:So,showOnboardingGuide:ls,installAgentCommand:Pr,connectAgentCommand:Wl,copilotCommand:k,agentSecret:u,agentSecretLoading:f,agentSecretError:p,groupSettingsOpen:ie,groupSettingsId:be,groupSettingsAgentId:ce,groupSettingsSection:Fe,groupSettingsEditVpId:Ie,openSessionSettings:te,openAnnouncementSettings:ut,closeGroupSettings:Rr,openVpLibraryFromGroupSettings:An,openMemberEditor:jl,showVpTimeline:qm,vpTimelineRows:Wm,sessionStatusTasksForActiveSession:Bm,sessionStatusAnnouncementText:mo,sessionStatusVisible:ye,toggleSessionStatus:ee,closeSessionStatus:ue,timelineWidthStyle:yt,startTimelineResize:bt,onEditVpFromTimeline:C=>{if(!C)return;let Q=bn();Q&&te({sessionId:Q,section:"members",editVpId:C})},onMentionVpFromTimeline:C=>{if(!C)return;let Q=I.value;Q&&typeof Q.appendMention=="function"&&Q.appendMention(C)},onCancelVpFromTimeline:C=>{if(!C)return;let Q=R(),oe=e.yeaftActiveSessionFilter||Q?.activeSessionId||null;oe&&typeof e.cancelVpTurnForSession=="function"&&e.cancelVpTurnForSession(C,oe)},onCancelTaskFromTimeline:C=>!C?.id||!C.sessionId||typeof e.cancelYeaftTask!="function"?!1:e.cancelYeaftTask({agentId:C.agentId,sessionId:C.sessionId,taskId:C.id})}}}});var qb=jm(()=>{ri();gt();Xs();Xu();$t();sp();rp();op();lp();Ng();Fm();wl();el();window.Pinia={...Pinia,useChatStore:null,useAuthStore:null};var Fb={components:{LoginPage:ap,ChatPage:Fg,YeaftPage:Om},template:`
|
|
8478
|
+
`,setup(){let e=Pinia.useChatStore(),t=Pinia.useAuthStore(),s=Pinia.useVpStore(),n=Vue.getCurrentInstance(),r=n&&n.appContext.config.globalProperties.$t||(C=>C),i=Vue.ref(!1),o=Vue.ref(null),a=Vue.ref(!1),l=Vue.ref(!1),c=Vue.ref(!1),d=Vue.ref(""),u=Vue.ref(""),f=Vue.ref(!1),p=Vue.ref(""),g=null,m=Vue.ref("vp"),b=Vue.ref(null),I=Vue.ref(null),y=Vue.ref(null),S=Vue.ref(null),w=Vue.ref(null),v=Vue.ref(null),h=Vue.ref(!1),M=Vue.ref(null),x=Vue.computed(()=>e.getYeaftHistoryOutlineState()),E=Vue.computed(()=>{let C=R(),Q=e.yeaftActiveSessionFilter||C?.activeSessionId||null,oe=Q?Ol(C,Q,e.currentAgent||null):null,Re=Array.isArray(oe?.roster)?oe.roster:[];return[{key:"user",label:r("yeaft.outline.you")},...Re.map(_e=>({key:`vp:${_e}`,label:s.vpLabel(_e)}))]}),V=Vue.ref(e.yeaftHistorySearchState?.query||""),L=null,R=()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}},P=()=>{let C=R();return{agentId:e.currentAgent||null,sessionId:e.yeaftActiveSessionFilter||C?.activeSessionId||null}},A=()=>Hb({...P(),validKeys:E.value.map(C=>C.key)}),_=(C="")=>{let{agentId:Q,sessionId:oe}=P();e.yeaftHistorySearchState={requestId:null,agentId:Q,sessionId:oe,query:"",senderKey:C,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null}},j=Vue.computed(()=>{let C=e.currentAgent||"agent",Q=R(),oe=e.yeaftActiveSessionFilter||Q?.activeSessionId||"session";return`yeaft:${C}:${oe}`});Vue.watch(j,()=>{y.value=null});let q=null,z=null,se=C=>{if(!C)return!1;let Q=String(C.tagName||"").toLowerCase();return Q==="textarea"||Q==="input"||C.isContentEditable===!0},me=({recoverScroll:C=!1}={})=>{let Q=S.value;if(!Q)return;if(!Xe.value){Q.style.removeProperty("--yeaft-visual-viewport-height");return}let oe=window.visualViewport,Re=Math.max(1,Math.round(oe?.height||window.innerHeight||1));Q.style.setProperty("--yeaft-visual-viewport-height",`${Re}px`),!(!C||oe&&window.innerHeight&&oe.height<window.innerHeight*.85||se(document.activeElement))&&window.scrollTo(0,0)},ae=(C={})=>{q!=null&&cancelAnimationFrame(q),q=requestAnimationFrame(()=>{q=null,me(C)})},ve=()=>{ae({recoverScroll:!0}),z&&clearTimeout(z),z=setTimeout(()=>{z=null,ae({recoverScroll:!0})},260)},ge=Vue.computed(()=>e.hasCapability("terminal")||e.hasCapability("file_editor")),pe=Vue.computed(()=>!0),T=C=>{let Q=C&&C.id?C.id:null;Q&&(e.setActiveSessionFilter(Q,{agentId:C.agentId||null}),Xe.value&&e.closeSessionSidebar())},K=C=>{},re=Vue.ref(null),he=Vue.ref(!1),Pe=320,U=Math.max(Pe,Math.round(window.innerWidth*.25)),B=localStorage.getItem("yeaft-debug-width"),N=Vue.ref(B?parseInt(B,10):U),O=Vue.computed(()=>({"--yeaft-detail-width":N.value+"px"})),D=C=>{he.value=!0;let Q=C.clientX,oe=N.value,Re=window.innerWidth*.6,_e=Ut=>{let Kt=Q-Ut.clientX,Vs=Math.min(Re,Math.max(Pe,oe+Kt));N.value=Vs},Ye=()=>{he.value=!1,document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Ye),localStorage.setItem("yeaft-debug-width",String(N.value))};document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Ye)},Z="yeaft-session-status-visible",ne=()=>{try{let C=localStorage.getItem(Z);return!(C==="0"||C==="false")}catch{return!0}},ye=Vue.ref(ne()),Y=C=>{ye.value=!!C;try{localStorage.setItem(Z,ye.value?"1":"0")}catch{}},ee=()=>Y(!ye.value),ue=()=>Y(!1),le=220,Ce=280,xe=(()=>{try{return localStorage.getItem("yeaft-vp-timeline-width")}catch{return null}})(),$e=xe?parseInt(xe,10):NaN,je=Vue.ref(Number.isFinite($e)&&$e>=le?$e:Ce),yt=Vue.computed(()=>({"--yeaft-vp-timeline-width":je.value+"px"})),bt=C=>{let Q=C.clientX,oe=je.value,Re=Math.max(le,Math.floor(window.innerWidth*.4)),_e=Ut=>{let Kt=Q-Ut.clientX,Vs=Math.min(Re,Math.max(le,oe+Kt));je.value=Vs},Ye=()=>{document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Ye);try{localStorage.setItem("yeaft-vp-timeline-width",String(je.value))}catch{}};document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Ye)},rs="(max-width: 768px)",gn="(max-width: 1024px)",Wt=typeof window.matchMedia=="function"?window.matchMedia(rs):null,Rt=typeof window.matchMedia=="function"?window.matchMedia(gn):null,_t=(C,Q)=>C?C.matches:window.innerWidth<=Q,Xe=Vue.ref(_t(Wt,768)),wt=Vue.ref(_t(Rt,1024)),mn=Vue.computed(()=>Xe.value?!e.sessionSidebarOpen:e.sidebarCollapsed),H=()=>{Xe.value=_t(Wt,768),wt.value=_t(Rt,1024)},G=()=>{H(),ve()},de=C=>{C&&(typeof C.addEventListener=="function"?C.addEventListener("change",G):typeof C.addListener=="function"&&C.addListener(G))},fe=C=>{C&&(typeof C.removeEventListener=="function"?C.removeEventListener("change",G):typeof C.removeListener=="function"&&C.removeListener(G))},we=()=>{L&&(clearTimeout(L),L=null),V.value="",_(A()),h.value=!1,M.value=null},Te=()=>{let C=A();V.value="",_(C),h.value=!0,e.loadYeaftHistoryOutline(),C&&e.searchYeaftHistory("",{senderKey:C}),Vue.nextTick(()=>v.value?.focus?.())},Ze=()=>{h.value?we():Te()},Ue=C=>{h.value&&sf(C.target)&&we()},Je=C=>{V.value=C,L&&clearTimeout(L),M.value=null,L=setTimeout(()=>{L=null,e.searchYeaftHistory(V.value,{senderKey:e.yeaftHistorySearchState.senderKey})},220)},Be=C=>{L&&clearTimeout(L),L=null,M.value=null,Em({...P(),senderKey:C}),e.searchYeaftHistory(V.value,{senderKey:C})},qe=()=>{Em({...P(),senderKey:so}),M.value=null,e.searchYeaftHistory(V.value,{senderKey:so})},We=C=>{if(!e.loadYeaftHistoryOutline({append:!0}))return;let Q=Vue.watch(()=>x.value.loading,oe=>{oe||(Q(),v.value?.restoreOlderScroll?.(C))})},Ke=()=>e.searchYeaftHistory(e.yeaftHistorySearchState.query,{append:!0,senderKey:e.yeaftHistorySearchState.senderKey}),ze=C=>{e.hasCapability("session_history_window_prefetch")&&e.loadYeaftHistoryWindow(C)},dt=C=>{let Q=e.beginYeaftHistoryReveal?.(C)||null;return nf({result:C,revealWindow:oe=>e.revealYeaftHistoryResult(oe,Q),nextTick:()=>Vue.nextTick(),revealMessage:oe=>w.value?.revealMessage?.(oe),isMobile:Xe.value,closeOutline:we}).finally(()=>e.finishYeaftHistoryReveal?.(Q))},Rs=C=>{if((C.metaKey||C.ctrlKey)&&String(C.key).toLowerCase()==="f"){C.preventDefault(),Te();return}if(C.key==="Escape"){if(h.value){we();return}if(o.value){st();return}}};Vue.onMounted(()=>{H(),window.addEventListener("resize",G),de(Wt),de(Rt),window.visualViewport?.addEventListener("resize",ve),window.visualViewport?.addEventListener("scroll",ve),document.addEventListener("click",kt),document.addEventListener("click",Ue),document.addEventListener("keydown",Rs),ae()}),Vue.onUnmounted(()=>{window.removeEventListener("resize",G),fe(Wt),fe(Rt),window.visualViewport?.removeEventListener("resize",ve),window.visualViewport?.removeEventListener("scroll",ve),document.removeEventListener("click",kt),document.removeEventListener("click",Ue),document.removeEventListener("keydown",Rs),q!=null&&cancelAnimationFrame(q),z&&clearTimeout(z),L&&clearTimeout(L)}),Vue.watch(()=>e.yeaftConversationId,C=>{C&&e.activeConversations[0]!==C&&(e.activeConversations=[C])}),Vue.watch(()=>[e.currentAgent,e.yeaftActiveSessionFilter],()=>{we(),_(A())});let hn=()=>{e.leaveYeaft()},ro=(C,Q,oe)=>{let Re=R();if(Re&&Re.activeNeedsInvite){let Kt=Re.activeSession;Kt&&jt.delete(Kt.id);return}let _e=e.yeaftActiveSessionFilter||Re&&Re.activeSessionId||"grp_default",Ye=Ri(C).mentions,Ut=Array.isArray(Q)?Q:void 0;e.sendYeaftSessionMessage({groupId:_e,text:C,mentions:Ye,attachments:Ut,quote:oe})},io=C=>{C&&(y.value=C,I.value?.focusInput?.())},br=C=>{y.value=null,I.value?.replaceDraft?.(C||"")},oo=()=>{let C=R(),Q=e.yeaftActiveSessionFilter||C?.activeSessionId||null;Q&&e.cancelYeaftSession(Q)},ao=(C="")=>{let Q=Oe.value;Q&&e.enterWorkCenterFromSession(Q,C)},lo=()=>{if(Xe.value){e.toggleSessionSidebar();return}e.toggleSidebar()},co=()=>{i.value=!i.value},uo=()=>{i.value=!1},po=()=>{e.reloadYeaftMessages()},vn=()=>{if(typeof e.requestYeaftSessionInventory=="function"){e.requestYeaftSessionInventory();return}e._hasHandledAgentList=!1,e._hasHandledYeaftSessionHydrate=!1,e.yeaftSessionHydrateError=null,e.sendWsMessage({type:"get_agents"})},wr=()=>{window.location.reload()},yn=Vue.computed(()=>{let C=R(),Q=e.yeaftActiveSessionFilter||C?.activeSessionId||null;return Q?e.isYeaftSessionProcessing(Q,e.currentAgent||null):!1}),Oe=Vue.computed(()=>{let C=R();if(!C||!C.sessions)return null;let Q=e.yeaftActiveSessionFilter||null;if(Q&&typeof C.sessionById=="function"){let oe=C.sessionById(Q,e.currentAgent||null);if(oe)return oe}if(C.activeSessionId&&typeof C.sessionById=="function"){let oe=C.sessionById(C.activeSessionId,e.currentAgent||null);if(oe)return oe}return typeof C.sessionById=="function"?C.sessionById("grp_default",e.currentAgent||null):null}),bn=()=>Tm({activeSessionFilter:e.yeaftActiveSessionFilter,sessionsStore:R(),topbarGroup:Oe.value}),fo=Vue.computed(()=>{let C=Oe.value||{},Q=typeof C.id=="string"?C.id.trim():"",oe=[C.title,C.name,C.config?.title,C.config?.name];for(let Re of oe){let _e=typeof Re=="string"?Re.trim():"";if(_e&&!(Q&&_e===Q)&&!/^(sessions?|groups?)\//i.test(_e)&&!/^session_[A-Za-z0-9_-]+$/.test(_e)&&!(C.workDir&&_e===C.workDir))return _e}return""}),go=Vue.computed(()=>{let C=Oe.value?.workDir;return typeof C=="string"?C.trim():""}),mo=Vue.computed(()=>Oe.value&&typeof Oe.value.announcement=="string"?Oe.value.announcement:""),is=Vue.computed(()=>wm(Oe.value,e.yeaftModel||"")),os=Vue.computed(()=>{let C=is.value;return C&&e.yeaftAvailableModels.find(Q=>Fl(Q,C))||null}),wn=Vue.computed(()=>os.value?.label||os.value?.id||is.value),kr=C=>Nl(C?.effortOptions),kn=Vue.computed(()=>Sm(Oe.value,e.yeaftModelEffort||"")),ho=Vue.computed(()=>{let C=Array.isArray(os.value?.effortOptions)?os.value.effortOptions.filter(Boolean):[];return C.length?C.includes(kn.value)?kn.value:Bl(C):null}),Sn=Vue.computed(()=>Im(e.yeaftAvailableModels)),Sr=Vue.computed(()=>kr(os.value)),In=C=>{C==="model"&&!Sn.value.length||C==="effort"&&!Sr.value.length||(o.value=o.value===C?null:C)},st=(C=null)=>{(!C||o.value===C)&&(o.value=null)},vo=(C,Q)=>{let oe=C.currentTarget;Vue.nextTick(()=>{oe?.contains(document.activeElement)||st(Q)})},yo=(C,Q=null)=>{if(!C)return;let oe=Oe.value?.id||null;e.switchYeaftModel(C,oe,Q),st()},bo=C=>{if(!Sr.value.includes(C)||!is.value)return;let Q=Oe.value?.id||null;e.switchYeaftModel(is.value,Q,C),st()},_s=C=>!C||!Number.isFinite(C)||C<=0?"":C>=1e6?`${Math.round(C/1e5)/10}m`:C>=1e3?`${Math.round(C/1e3)}k`:String(C),Ir=C=>{let Q=_s(C?.contextWindow),oe=_s(C?.maxOutput);return Q&&oe?`${Q} \xB7 ${oe} out`:Q},kt=C=>{if(!o.value)return;C.target.closest(".yeaft-composer-choice")||st()},Cn=()=>{a.value||(m.value="vp",b.value=null),a.value=!a.value},nt=({initialTab:C="vp",editVpId:Q=null}={})=>{m.value=["vp","search","mcp"].includes(C)?C:"vp",b.value=m.value==="vp"&&Q||null,a.value=!0},as=()=>{st(),l.value=!0},wo=C=>{tt(C)&&(l.value=!1)},Cr=async()=>{if(!(u.value||f.value)){f.value=!0,p.value="";try{let C={"Content-Type":"application/json"};t.token&&(C.Authorization=`Bearer ${t.token}`);let Q=await fetch("/api/user/agent-secret",{headers:C});if(!Q.ok){let _e=r("yeaft.onboarding.secretError");try{let Ye=await Q.json();Ye?.error&&(_e=Ye.error)}catch{}throw new Error(_e)}let oe=await Q.json(),Re=oe?.agentSecret||oe?.agent_secret||"";if(u.value=String(Re||"").trim(),!u.value)throw new Error(r("yeaft.onboarding.secretError"))}catch(C){p.value=C?.message||r("yeaft.onboarding.secretError")}finally{f.value=!1}}},Es=()=>{c.value=!0},Ds=C=>{c.value=!1},Ar=async(C,Q)=>{if(Q&&!(typeof navigator>"u"||!navigator.clipboard?.writeText))try{let oe=typeof Q=="string"?Q:Q?.value||"";if(!oe)return;await navigator.clipboard.writeText(oe),d.value=C||"",g&&clearTimeout(g),g=setTimeout(()=>{d.value="",g=null},1800)}catch{}},Ls=(C,Q)=>{},xr=(C={})=>{Rm(C)&&(l.value=!1)},jt=Vue.reactive(new Set),Et=Vue.computed(()=>{let C=R();return C?C.activeSession:null}),$s=C=>{if(!C)return"";if(C.id==="grp_default"&&(C.name==="Default"||!C.name))try{let Q=typeof window<"u"?window.i18n:null;if(Q&&Q.global&&typeof Q.global.t=="function")return Q.global.t("yeaft.session.defaultName")}catch{}return C.name||C.id||""},ko=Vue.computed(()=>$s(Et.value)),Tr=Vue.computed(()=>{let C=R();if(!C||!C.activeNeedsInvite)return!1;let Q=C.activeSession;return Q?!jt.has(Q.id):!1}),Mr=Vue.computed(()=>{let C=R();return!!(C&&C.activeNeedsInvite)}),So=Vue.computed(()=>{let C=R();return e._hasHandledAgentList===!0&&e._hasHandledYeaftSessionHydrate===!0&&!!(C&&C.hasLoadedSnapshot)}),ls=Vue.computed(()=>{let C=R();return Am({agentInventoryReady:e._hasHandledAgentList===!0,hasYeaftAgent:Mm(e),sessionsReady:e._hasHandledYeaftSessionHydrate===!0&&!!(C&&C.hasLoadedSnapshot),sessionsEmpty:!!(C&&C.isEmpty)})});Vue.watch(ls,C=>{C&&Cr()},{immediate:!0});let Pr="npm install -g @yeaft/webchat-agent",Wl=Vue.computed(()=>{let Q=(typeof window<"u"&&window.location?.origin?window.location.origin:"http://localhost:3456").replace(/^http:/,"ws:").replace(/^https:/,"wss:"),oe=u.value||r("yeaft.onboarding.secretPending");return`yeaft-agent install --server ${Q} --name yeaft-agent --secret ${oe}`}),k="gh auth login && yeaft-agent llm use github-copilot --model gpt-5.5",$=()=>{let C=Et.value;C&&jt.add(C.id),jl(C?C.id:null)},W=()=>{let C=Et.value;C&&jt.add(C.id)},ie=Vue.ref(!1),be=Vue.ref(null),ce=Vue.ref(null),Fe=Vue.ref("session"),Ie=Vue.ref(""),te=(C={})=>{let Q=C&&(C.sessionId||C.groupId)||null,oe=C&&C.editVpId||"",Re=oe?"members":C&&C.section||"session";Q&&(be.value=Q,ce.value=C&&C.agentId||null,Fe.value=Re,Ie.value=oe,ie.value=!0)},ut=()=>{let C=bn();C&&te({sessionId:C,section:"session"})},Rr=()=>{ie.value=!1,be.value=null,ce.value=null,Ie.value=""},An=()=>{Rr(),nt({initialTab:"vp"})},jl=C=>{C&&te({sessionId:C,section:"members"})};Vue.watch(()=>{let C=Et.value;return C?C.id+":"+(Array.isArray(C.roster)?C.roster.length:0)+":"+(C.defaultVpId||""):""},(C,Q)=>{let oe=Et.value;oe&&C!==Q&&Array.isArray(oe.roster)&&oe.roster.length>0&&jt.delete(oe.id)}),typeof Vue.onBeforeUnmount=="function"&&Vue.onBeforeUnmount(()=>{g&&clearTimeout(g),g=null});let Nm=()=>{a.value=!1},Bm=Vue.computed(()=>!a.value&&!ls.value&&ye.value),qm=Vue.computed(()=>{let C=R(),Q=e.yeaftActiveSessionFilter||C?.activeSessionId||null;if(!Q)return[];let Re=(typeof C?.sessionById=="function"?C.sessionById(Q,e.currentAgent||null):null)?.agentId||e.currentAgent||null,_e=Re?`${Re}${Q}`:Q,Ye=e.yeaftActiveTasksBySession?.[_e]||{};return Ob(Ye)}),Wm=Vue.computed(()=>{if(!e.yeaftConversationId)return[];let Q=R(),oe=e.yeaftActiveSessionFilter||Q?.activeSessionId||null;if(!oe)return[];let Re=Ol(Q,oe,e.currentAgent||null),_e=Re&&Array.isArray(Re.roster)?Re.roster:[];if(_e.length===0)return[];let Ye=new Set(_e),Ut=mm(_e,s.vpList||[]),Kt=e.vpStatuses||{},Vs={},_r=e.currentAgent||null;for(let Ne of Object.values(Kt)){if(!Ne||!Ne.vpId)continue;let Er=Ne.sessionId??Ne.groupId;Er&&Er!==oe||_r&&Ne.agentId&&Ne.agentId!==_r||Ye.has(Ne.vpId)&&(Vs[Ne.vpId]=Ne)}let Ul={};for(let Ne of Object.values(e.activeVpTurns||{}))!Ne?.turnId||!Ne?.sessionId||Ne.sessionId!==oe||_r&&Ne.agentId&&Ne.agentId!==_r||Object.entries(e.stoppingVpTurnIds||{}).some(([Er])=>e.activeVpTurns?.[Er]===Ne)&&(Ul[Ne.turnId]=!0);return hm({vpList:Ut,vpStatuses:Vs,stoppingVpTurnIds:Ul,connectionState:e.connectionState,vpLabelOf:Ne=>s.vpLabel(Ne),vpDescriptionOf:Ne=>s.vpDescription(Ne)})});return{store:e,pageRef:S,effectiveSidebarCollapsed:mn,debugMode:i,composerMenuOpen:o,topbarGroup:Oe,topbarSessionTitle:fo,topbarFolderPath:go,topbarModel:is,topbarModelLabel:wn,topbarEffort:ho,topbarModelRows:Sn,topbarEffortOptions:Sr,selectableEffortsForModel:kr,modelOptionMatchesRef:Fl,showSettings:a,showLlmConfig:l,sessionCreateOpen:c,settingsInitialTab:m,settingsInitialEditVpId:b,chatInputRef:I,messageQuote:y,messageListRef:w,historySearchRef:v,historySearchOpen:h,historySearchActiveMessageId:M,historyOutlineState:x,historySenderOptions:E,toggleHistorySearch:Ze,closeHistorySearch:we,onHistorySearchQuery:Je,onHistorySenderChange:Be,onHistorySenderInvalid:qe,loadOlderHistoryOutline:We,loadMoreHistorySearchResults:Ke,previewHistorySearchResult:ze,selectHistorySearchResult:dt,yeaftInputDraftKey:j,openSettings:nt,isMobile:Xe,isNarrowDetail:wt,detailPanel:re,isResizingDetail:he,detailWidthStyle:O,startDetailResize:D,isProcessing:yn,goBack:hn,sendMessage:ro,setMessageQuote:io,editMessageAsNew:br,cancelYeaft:oo,openWorkItemDraft:ao,toggleSidebar:lo,toggleDebug:co,closeDebug:uo,reloadMessages:po,retryConversationInventory:vn,reloadPage:wr,toggleComposerMenu:In,closeComposerMenu:st,onComposerMenuFocusout:vo,selectModel:yo,selectEffort:bo,openLlmConfig:as,trackOverlayPointerDown:at,trackOverlayPointerUp:lt,clearOverlayPointerGesture:ct,closeLlmConfigFromOverlay:wo,openSessionCreate:Es,onSessionCreated:Ds,copyOnboardingCommand:Ar,copiedOnboardingCommand:d,onLlmConfigMessage:Ls,onLlmConfigSaved:xr,formatTokens:_s,formatModelCtx:Ir,toggleSettings:Cn,onSettingsSaved:Nm,sidebarV2Enabled:pe,onSelectGroupV2:T,onSelectChat:K,canUseWorkbench:ge,shouldShowInviteModal:Tr,inviteGroupName:ko,onInviteOpenLibrary:$,onInviteDismiss:W,isActiveGroupEmpty:Mr,conversationInventoryReady:So,showOnboardingGuide:ls,installAgentCommand:Pr,connectAgentCommand:Wl,copilotCommand:k,agentSecret:u,agentSecretLoading:f,agentSecretError:p,groupSettingsOpen:ie,groupSettingsId:be,groupSettingsAgentId:ce,groupSettingsSection:Fe,groupSettingsEditVpId:Ie,openSessionSettings:te,openAnnouncementSettings:ut,closeGroupSettings:Rr,openVpLibraryFromGroupSettings:An,openMemberEditor:jl,showVpTimeline:Bm,vpTimelineRows:Wm,sessionStatusTasksForActiveSession:qm,sessionStatusAnnouncementText:mo,sessionStatusVisible:ye,toggleSessionStatus:ee,closeSessionStatus:ue,timelineWidthStyle:yt,startTimelineResize:bt,onEditVpFromTimeline:C=>{if(!C)return;let Q=bn();Q&&te({sessionId:Q,section:"members",editVpId:C})},onMentionVpFromTimeline:C=>{if(!C)return;let Q=I.value;Q&&typeof Q.appendMention=="function"&&Q.appendMention(C)},onCancelVpFromTimeline:C=>{if(!C)return;let Q=R(),oe=e.yeaftActiveSessionFilter||Q?.activeSessionId||null;oe&&typeof e.cancelVpTurnForSession=="function"&&e.cancelVpTurnForSession(C,oe)},onCancelTaskFromTimeline:C=>!C?.id||!C.sessionId||typeof e.cancelYeaftTask!="function"?!1:e.cancelYeaftTask({agentId:C.agentId,sessionId:C.sessionId,taskId:C.id})}}}});var Bb=jm(()=>{ri();gt();Xs();Xu();$t();sp();rp();op();lp();Ng();Fm();wl();el();window.Pinia={...Pinia,useChatStore:null,useAuthStore:null};var Fb={components:{LoginPage:ap,ChatPage:Fg,YeaftPage:Om},template:`
|
|
8460
8479
|
<div v-if="!authStore.initialized" class="auth-bootstrap" aria-busy="true"><span class="session-loading-spinner"></span></div>
|
|
8461
8480
|
<LoginPage v-else-if="!authStore.isAuthenticated" />
|
|
8462
8481
|
<template v-else>
|
|
8463
8482
|
<YeaftPage v-if="chatStore.currentView === 'yeaft'" />
|
|
8464
8483
|
<ChatPage v-else />
|
|
8465
8484
|
</template>
|
|
8466
|
-
`,setup(){let e=Cs(),t=De();return e.initTheme(),e.setupVisibilityHandler(),Vue.onMounted(()=>{t.initialize()}),Vue.watch(()=>t.initialized&&t.isAuthenticated,s=>{s&&e.connect()},{immediate:!0}),{authStore:t,chatStore:e}}},no=Vue.createApp(Fb),Nb=Pinia.createPinia();no.use(Nb);ec(no,{"zh-CN":np,en:ip});tp();window.Pinia.useChatStore=Cs;window.Pinia.useAuthStore=De;window.Pinia.useVpStore=Tt;window.Pinia.useSessionsStore=Qu;no.component("ToolLine",bi);no.mount("#app")});export default
|
|
8485
|
+
`,setup(){let e=Cs(),t=De();return e.initTheme(),e.setupVisibilityHandler(),Vue.onMounted(()=>{t.initialize()}),Vue.watch(()=>t.initialized&&t.isAuthenticated,s=>{s&&e.connect()},{immediate:!0}),{authStore:t,chatStore:e}}},no=Vue.createApp(Fb),Nb=Pinia.createPinia();no.use(Nb);ec(no,{"zh-CN":np,en:ip});tp();window.Pinia.useChatStore=Cs;window.Pinia.useAuthStore=De;window.Pinia.useVpStore=Tt;window.Pinia.useSessionsStore=Qu;no.component("ToolLine",bi);no.mount("#app")});export default Bb();
|