@yeaft/webchat-agent 1.0.227 → 1.0.228
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.
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var O=(e,t,s)=>()=>{if(s)throw s[0];try{return e&&(t=e(e=0)),t}catch(n){throw s=[n],n}};var tf=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(s){throw t=0,s}};function Wo(e,t){let s=nacl.randomBytes(24),n=JSON.stringify(e),i,r=!1;n.length>512?(i=pako.gzip(n),r=!0):i=nacl.util.decodeUTF8(n);let o=nacl.secretbox(i,s,t),a={n:nacl.util.encodeBase64(s),c:nacl.util.encodeBase64(o)};return r&&(a.z=!0),a}function Uo(e,t){try{let s=nacl.util.decodeBase64(e.n),n=nacl.util.decodeBase64(e.c),i=nacl.secretbox.open(n,s,t);if(!i)return null;if(e.z){let r=pako.ungzip(i,{to:"string"});return JSON.parse(r)}else return JSON.parse(nacl.util.encodeUTF8(i))}catch{return null}}function zo(e){return e&&typeof e=="object"&&typeof e.n=="string"&&typeof e.c=="string"}function lt(e){return nacl.util.decodeBase64(e)}var Cn=O(()=>{});var sf,nf,Ae,ct=O(()=>{Cn();({defineStore:sf}=Pinia),nf=1800*1e3,Ae=sf("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,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.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?lt(n.sessionKey):null,this.role=n.role||"pro",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 i=await(await fetch("/api/auth/aad",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:s.idToken})})).json();return i.success?(this.token=i.token,this.sessionKey=i.sessionKey?lt(i.sessionKey):null,this.role=i.role||"pro",this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",i.token),this.startSessionRefresh(),!0):(this.error=i.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?lt(s.sessionKey):null,this.role=s.role||"pro",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?lt(s.sessionKey):null,this.role=s.role||"pro",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?lt(s.sessionKey):null,this.role=s.role||"pro",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 r=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 r.success?!0:(this.error=r.error||"Registration failed",!1)}catch(i){return this.error=i.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(),i=`/api/auth/sso/${encodeURIComponent(e)}/start-qr${n?"?"+n:""}`,r=await fetch(i),o=await r.json();return!r.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?lt(n.sessionKey):null,this.role=n.role||"pro",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"),i=s.get("sessionKey"),r=s.get("role");if(!n)return!1;this.token=n,this.sessionKey=i?lt(i):null,this.role=r||"pro",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 i=await n.json().catch(()=>({})),r=n.headers?.get?.("X-New-Token"),o=localStorage.getItem("authToken");return r&&this.token===e&&(!o||o===e)&&(this.token=r,localStorage.setItem("authToken",r)),i?.role&&(this.role=i.role),!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,nf),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,i=void 0){if(!e||e.status!==401||!n||s!==this.authGeneration)return!1;let r=this.token||localStorage.getItem("authToken")||null;return t!==r?!1:(this.handleAuthFailure(i,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 i=await n.json();if(t!==this.authGeneration)return this.isAuthenticated;let r=n.headers?.get?.("X-New-Token"),o=this.getActiveToken(),a=r&&(!o||o===e)?r:o||e;return this.token=a,a&&a!==e&&localStorage.setItem("authToken",a),this.role=i?.role||"pro",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=lt(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 i=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 i.success?!0:(this.error=i.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(){this.authGeneration+=1,this.stopSessionRefresh(),this.isAuthenticated=!1,this.token=null,this.sessionKey=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 xe(e,t){let s=yt?.value||"zh-CN",i=(ls[s]||ls["zh-CN"]||{})[e];if(i===void 0&&s!=="zh-CN"&&(i=(ls["zh-CN"]||{})[e]),i===void 0)return e;if(t)for(let[r,o]of Object.entries(t))i=i.replace(new RegExp(`\\{${r}\\}`,"g"),o);return i}function rf(){return yt?.value||"zh-CN"}function Os(e){ls[e]&&(yt&&(yt.value=e),localStorage.setItem("locale",e),document.documentElement.setAttribute("lang",e))}function of(){let e=localStorage.getItem("locale");return e&&ls[e]?e:(navigator.language||navigator.userLanguage||"").startsWith("en")?"en":"zh-CN"}function jo(e,t){return ls=t,yt=Vue.ref(of()),document.documentElement.setAttribute("lang",yt.value),e.config.globalProperties.$t=xe,e.config.globalProperties.$locale=yt,e.provide("t",xe),e.provide("locale",yt),{t:xe,setLocale:Os,getLocale:rf,locale:yt}}var yt,ls,bt=O(()=>{yt=null,ls={}});function cs(e,t,s=""){Hs&&(clearTimeout(Hs),Hs=null),e.sessionLoading=t,e.sessionLoadingText=s,t&&(Hs=setTimeout(()=>{e.sessionLoading&&(e.sessionLoading=!1,e.sessionLoadingText=""),Hs=null},af))}function pt(e){cs(e,!1)}function Ko(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(i=>i.id===s&&i.online);n&&(e.pendingRecovery={agentId:s,agentName:n.name,sessionId:t.sessionId,workDir:t.workDir},e.recoveryDismissed=!1)}}function Go(e){if(!e.pendingRecovery)return;let{agentId:t,sessionId:s,workDir:n}=e.pendingRecovery;e.selectAgent(t),setTimeout(()=>{e.resumeConversation(s,n,t),e.pendingRecovery=null,e.recoveryDismissed=!1},500)}function Yo(e){e.recoveryDismissed=!0,e.pendingRecovery=null}function Qo(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]=[],cs(e,!0,xe("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.sendWsMessage({type:"sync_messages",conversationId:t,turns:5}))),e.sendWsMessage({type:"select_conversation",conversationId:t}))}function Xo(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(r=>r.id)),i=s.filter(r=>r&&typeof r.id=="string").map(r=>({id:r.id,conversationId:r.conversationId&&n.has(r.conversationId)?r.conversationId:null,activeRightPanel:r.activeRightPanel||null}));if(i.length<2){localStorage.removeItem("panels");return}e.panels=i,e.activePanelId=i[0]?.id||null;for(let r of i)r.conversationId&&(e.activeConversations.includes(r.conversationId)||e.activeConversations.push(r.conversationId),e.messagesMap[r.conversationId]||(e.messagesMap[r.conversationId]=[]),e.messagesMap[r.conversationId].length||e.sendWsMessage({type:"sync_messages",conversationId:r.conversationId,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);t?.claudeSessionId&&t?.workDir&&(localStorage.setItem("lastUsedSession",JSON.stringify({sessionId:t.claudeSessionId,workDir:t.workDir,agentId:e.currentAgent})),e.lastUsedSession={sessionId:t.claudeSessionId,workDir:t.workDir,agentId:e.currentAgent})}e.lastUsedAgent=e.currentAgent,e.panels.length>0?localStorage.setItem("panels",JSON.stringify(e.panels)):localStorage.removeItem("panels")}}function Zo(e){return e.lastUsedSession}function Jo(e){localStorage.removeItem("lastUsedAgent"),localStorage.removeItem("lastUsedSession"),localStorage.removeItem("lastViewedConversation"),localStorage.removeItem("panels"),localStorage.removeItem("splitPanesSaved"),e.lastUsedAgent=null,e.lastUsedSession=null,e.lastViewedConversation=null}function ea(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 ta(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 sa(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(i=>{e._foldersResolve&&e._foldersResolve(),e._foldersResolve=i,e.sendWsMessage({type:"list_folders",agentId:t,provider:s||"claude-code",requestId:n}),setTimeout(()=>{e._foldersResolve===i&&(e._foldersResolve(),e._foldersResolve=null,e.foldersLoading=!1)},1e4)})}function na(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(i=>{e._modelsResolve&&e._modelsResolve([]),e._modelsTimeout&&clearTimeout(e._modelsTimeout),e._modelsResolve=i,e.sendWsMessage({type:"list_models",agentId:t,provider:s||"claude-code",requestId:n}),e._modelsTimeout=setTimeout(()=>{e._modelsResolve===i&&(e._modelsResolve([]),e._modelsResolve=null,e.providerModelsLoading=!1),e._modelsTimeout=null},1e4)})}function ia(e,t,s,n){if(!t){e.historySessionsLoading=!1;return}if(!s){e.historySessions=[],e.historySessionsLoading=!1;return}let i=Date.now().toString();e._historySessionsRequestId=i,e.historySessionsLoading=!0,e.historySessions=[],e.sendWsMessage({type:"list_history_sessions",agentId:t,workDir:s,provider:n||"claude-code",requestId:i})}async function ra(e,t=20){if(Ae().isAuthenticated){e.globalSessionsLoading=!0;try{let n=await fetch(`/api/sessions?limit=${t}`);if(n.ok){let i=await n.json();e.globalSessions=i.sessions||[]}}catch{}finally{e.globalSessionsLoading=!1}}}async function oa(e,t){if(!Ae().isAuthenticated)return!1;try{if((await fetch(`/api/sessions/${t}`,{method:"DELETE"})).ok)return e.globalSessions=e.globalSessions.filter(i=>i.id!==t),!0}catch{}return!1}function Xi(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 aa(e,t){let s=Xi(e,t);return s&&s.online}var af,Hs,Ot=O(()=>{ct();bt();af=3e4,Hs=null});function la(e){return e?.code===1008&&String(e.reason||"").toLowerCase().includes("authentication")}function ca(e){let t=Ns;Ns=[];for(let{resolve:s,reject:n,timer:i}of t)clearTimeout(i),e?s():n(new Error("WebSocket reconnect failed"))}function da(e,t){if(!e.ws||e.ws.readyState!==WebSocket.OPEN)return!1;if(e.currentView==="yeaft"&&cf.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=Wo(t,e.sessionKey);e.ws.send(JSON.stringify(s))}else e.ws.send(JSON.stringify(t));return!0}catch{return!1}}function Bs(e,t=1e4){return e.ws&&e.ws.readyState===WebSocket.OPEN?Promise.resolve():new Promise((s,n)=>{let i=setTimeout(()=>{Ns=Ns.filter(r=>r.resolve!==s),n(new Error("WebSocket reconnect timeout"))},t);Ns.push({resolve:s,reject:n,timer:i}),(!e.ws||e.ws.readyState!==WebSocket.CONNECTING)&&(e.reconnectAttempts=0,e.connect())})}function ua(e,t){try{let s=JSON.parse(t);return e.sessionKey&&zo(s)?Uo(s,e.sessionKey):s}catch{return null}}function pa(e){let t=Ae(),s=location.protocol==="https:"?"wss:":"ws:";e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null);let n=t.getActiveToken?.()||t.token||null,i=t.authGeneration;if(e.ws&&e.ws.readyState===WebSocket.CONNECTING&&e._wsAuthToken===n&&e._wsAuthGeneration===i)return;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._wsAuthToken=n,e._wsAuthGeneration=i;let r=`${s}//${location.host}?type=web`;n&&(r+=`&token=${encodeURIComponent(n)}`);let o=new WebSocket(r);e.ws=o,o.onopen=()=>{if(o===e.ws){e.connectionState="connected",e.reconnectAttempts=0,e.startHeartbeat();try{o.send(JSON.stringify({type:"client_hello",plaintextOk:!0}))}catch{}ca(!0)}},o.onmessage=a=>{if(o!==e.ws)return;let l=e.parseWsMessage(a.data);l&&(l.type,e.handleMessage({...l,_wsAuthToken:n,_wsAuthGeneration:i}))},o.onclose=a=>{if(o!==e.ws){la(a)&&t.handleAuthFailure?.(void 0,n,i);return}e.authenticated=!1;let l=e.connectionState==="updating";if(e.connectionState=l?"updating":"disconnected",e.stopHeartbeat(),pt(e),la(a)){t.handleAuthFailure?.(void 0,n,i),e.reconnectAttempts=0,ca(!1);return}if(e._yeaftReconnectCatchUpPending=!0,l){e.reconnectAttempts=0,e.reconnectTimer=setTimeout(()=>{e.connect()},2e3);return}e.scheduleReconnect()},e.ws.onerror=a=>{}}function fa(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 ga(e){e.reconnectAttempts=0,e.connect()}function ma(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 ha(e){e.heartbeatTimer&&(clearInterval(e.heartbeatTimer),e.heartbeatTimer=null)}function va(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 Ns,cf,Zi=O(()=>{ct();Cn();Ot();Ns=[];cf=new Set(["sync_messages","refresh_conversation","select_conversation","cancel_execution","update_conversation_settings","ask_user_answer"])});function pf(e){return e?.type==="tool-use"}function Ji(e){return e?.type==="tool-summary"}function er(e){return pf(e)&&!uf.has(e.toolName)}function wa(e,t,s,n=s){let i=t==="history"&&(n?.dbMessageId||n?.id)||null;return{...i?{id:`tool_summary_${t}_${i}`,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 ff(e,t){return!Ji(e)||!Ji(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 gf(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 ya(e){return[e?.sessionId||"",e?.turnId||"",e?.speakerVpId||e?.vpId||""].join("")}function ba(e,t,s,n,i=n){if(!t)return;let r=wa(t,s,n,i),o=e[e.length-1];ff(o,r)?gf(o,r):e.push(r)}function tr(e=[]){let t=[],s=0,n=null,i=null;for(let r of e){if(er(r)&&r.isHistory){s+=1,n||(n=r),i=r;continue}ba(t,s,"history",n,i),s=0,n=null,i=null,t.push(r)}return ba(t,s,"history",n,i),t}function ka(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 f=e.length-1;f>=0;f-=1){let g=e[f];if(g?.type==="user"||g?.type==="system"||g?.type==="error")break;n=f}let i=e.slice(n),r=new Map;for(let f of i){if(!er(f)||f.isHistory)continue;let g=ya(f);r.set(g,(r.get(g)||0)+1)}let o=new Map;for(let[f,g]of r)g>s&&o.set(f,g-s);if(o.size===0)return e;let a=new Map,l=new Map,c=new Set,d=[],u=(f,g,v)=>{a.set(f,(a.get(f)||0)+g),!l.has(f)&&v&&l.set(f,v)},p=(f,g)=>{if(c.has(f))return;let v=a.get(f)||0;v<=0||(d.push(wa(v,"live",l.get(f)||g)),c.add(f))};for(let f of i){let g=ya(f);if(Ji(f)&&f.source==="live"&&o.has(g)){u(g,Number(f.count)||0,f);continue}if(er(f)&&!f.isHistory&&o.has(g)){let v=o.get(g)||0;if(v>0){o.set(g,v-1),u(g,1,f);continue}}p(g,f),d.push(f)}for(let f of a.keys())p(f,l.get(f));return e.splice(n,e.length-n,...d),e}var uf,sr=O(()=>{uf=new Set(["TodoWrite","AskUserQuestion"])});function nr(e,t){return t?t===e.yeaftConversationId?!0:Object.values(e.yeaftConversationIdsByAgent||{}).includes(t):!1}function qs(e,t,s){s&&(s.type!=="assistant"&&s.type!=="tool-use"||nr(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 hf(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 i=Number(s);if(Number.isFinite(i)&&i>0)return i}}return Date.now()}function In(e){let t=e?.messageId??e?.dbMessageId??e?.id;return t==null||t===""?null:String(t)}function ir(e,t){if(!e||!t)return e;let s=e.type==="user"&&typeof e.id=="string"&&e.id===e.clientMessageId;for(let[n,i]of Object.entries(t))if(i!=null){if(n==="isStreaming"){e.isStreaming&&i===!1&&(e.isStreaming=!1);continue}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]=i);continue}if(!(n==="turnId"&&s&&e.turnId===e.clientMessageId)){if(n==="content"&&typeof i=="string"){e.content||(e.content=i);continue}if(n==="attachments"&&Array.isArray(i)){(!Array.isArray(e.attachments)||e.attachments.length===0)&&(e.attachments=i);continue}(e[n]===void 0||e[n]===null||e[n]==="")&&(e[n]=i)}}return e}function rr(e=[],t=[]){let s=[],n=new Map,i=new Map;for(let r of[...e,...t]){if(!r)continue;let o=In(r),a=r.type==="user"&&r.clientMessageId?String(r.clientMessageId):null;if(o&&n.has(o)){ir(n.get(o),r);continue}if(a&&i.has(a)){let l=i.get(a);ir(l,r),o&&!n.has(o)&&n.set(o,l);continue}s.push(r),o&&n.set(o,r),a&&i.set(a,r)}return s}function Sa(e,t,s){return!e||e!==t?!1:!s?.loaded&&!s?.loading}function Ca(e,t){return!!t&&!!e?.loaded&&!e?.loading&&Number.isFinite(e?.latestSeq)}function or({sessionState:e,hasCachedSessionRows:t,force:s=!1}={}){return e?.loading?!1:s?!e?.loaded:e?.loaded?!1:!t}function vf(e,t,s,n){let i=s?.id?String(s.id):null;if(!i)return!1;let o=(e.messagesMap[t]||[]).find(a=>a?.type==="assistant"&&In(a)===i);return o?(o.id||(o.id=i),o.messageId||(o.messageId=i),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,qs(e,t,o),!0):!1}function An(e,t,s){if(!t)return;let n={...s,id:s.dbMessageId||s.id||Date.now().toString()+Math.random().toString(36).substr(2,9),timestamp:hf(s)};nr(e,t)&&!n.sessionId&&(n.sessionId=e._currentYeaftSessionId||e.yeaftActiveSessionFilter||mf),nr(e,t)&&(!n.vpId&&e._currentYeaftVpId&&(n.vpId=e._currentYeaftVpId),!n.turnId&&e._currentYeaftTurnId&&(n.turnId=e._currentYeaftTurnId),qs(e,t,n)),e.messagesMap[t]||(e.messagesMap[t]=[]);let i=In(s);if(i){let r=e.messagesMap[t].find(o=>In(o)===i);if(r)return ir(r,n),t===e.yeaftConversationId&&e.messagesMap[t].sort((o,a)=>o.timestamp-a.timestamp),r}return e.messagesMap[t].push(n),ka(e.messagesMap[t]),t===e.yeaftConversationId&&e.messagesMap[t].sort((r,o)=>r.timestamp-o.timestamp),n}function Ia(e,t,s,n={}){if(!t||!s)return;e.messagesMap[t]||(e.messagesMap[t]=[]);let i=e.messagesMap[t];if(vf(e,t,n,s))return;let r=e._currentYeaftTurnId;if(r){for(let a=i.length-1;a>=0;a--)if(i[a].turnId===r&&i[a].type==="assistant"&&i[a].isStreaming){if(qs(e,t,i[a]),n.id&&!i[a].id&&(i[a].id=n.id),n.id&&!i[a].messageId&&(i[a].messageId=n.id),i[a].content.endsWith(s))return;i[a].content+=s;return}An(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=i[i.length-1];if(o&&o.type==="assistant"&&o.isStreaming){if(qs(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 An(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 Aa(e,t){if(!t)return;let s=e.messagesMap[t];if(!s||s.length===0)return;let n=e._currentYeaftTurnId||null;for(let i=s.length-1;i>=0;i--){let r=s[i];if(n&&r.turnId&&r.turnId!==n){if(r.type==="user")break;continue}if(r.isStreaming&&(r.isStreaming=!1,r.status==="pending"&&(r.status="completed",r.turnEndAt=Date.now())),qs(e,t,r),r.type==="user")break}}function xa(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 Ta(e,t){let s=e.currentConversation;if(!s)return;e.messagesMap[s]||(e.messagesMap[s]=[]);let n=e.messagesMap[s],i=null;for(let r of t)if(r.type==="user"){let o=r.message?.content;if(o){let a=typeof o=="string"?o:Array.isArray(o)?o.map(l=>l.text||"").join(""):"";a&&(i=a,e.addMessage({type:"user",content:a,isHistory:!0}))}}else if(r.type==="assistant"){let o=r.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(i&&s&&!e.conversationTitles[s]){let r=i.trim().substring(0,100);e.conversationTitles[s]=r}}function Ws(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 Ma(e){return{id:e.id,dbMessageId:e.id,timestamp:e.created_at}}function Pa(e){return e?e.message_type==="tool_use"&&!yf.has(e.tool_name)?{...Ma(e),type:"tool-use",toolName:e.tool_name||"unknown",hasResult:!0,isHistory:!0,startTime:e.created_at||0}:ar(e):null}function ar(e){if(!e)return null;let t=Ma(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 i=JSON.parse(e.metadata);i.askRequestId&&(n.askRequestId=i.askRequestId,n.askQuestions=i.askQuestions,n.askAnswered=!!i.askAnswered,n.selectedAnswers=i.selectedAnswers||null,i.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 i=JSON.parse(n);if(Array.isArray(i))return i.filter(r=>r.type==="text"&&r.text).map(r=>r.text).join("")}catch{}return n};if(e.role==="user"){let n=null;if(e.metadata)try{let i=JSON.parse(e.metadata);i&&typeof i.clientMessageId=="string"&&(n=i.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),i=(()=>{if(!e.content||typeof e.content!="string"||!e.content.startsWith("["))return[];try{let r=JSON.parse(e.content);return Array.isArray(r)?r.filter(o=>o.type==="tool_use"&&o.name):[]}catch{return[]}})();if(!n&&i.length===0)return null;if(i.length>0){let r=[];n&&r.push({...t,type:"assistant",content:n});for(let o=0;o<i.length;o++){let a=i[o];r.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 r}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 mf,yf,xn=O(()=>{sr();mf="grp_default";yf=new Set(["TodoWrite","AskUserQuestion"])});function Ht(e,t){return e._closedAt?.[t]?Date.now()-e._closedAt[t]<3e4:!1}function us(e,t){ke(e,t),e._processingWatchdogs||(e._processingWatchdogs={});let s=()=>{if(!e.processingConversations[t])return;let i=e.conversations.find(o=>o.id===t);e.sendWsMessage({type:"ping_session",conversationId:t,agentId:i?.agentId});let r=setTimeout(()=>{e.processingConversations[t]&&(e.sessionHealth||(e.sessionHealth={}),e.sessionHealth[t]={status:"agent-offline"})},1e4);e._pongTimeouts||(e._pongTimeouts={}),e._pongTimeouts[t]=r},n=setTimeout(()=>{e.processingConversations[t]&&(s(),e._processingWatchdogs[t]=setInterval(()=>{if(!e.processingConversations[t]){ke(e,t);return}s()},3e4))},45e3);e._processingWatchdogs[t]=n}function Tn(e,t){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)?lr(e,t):us(e,t))}function ke(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)}function Da(e,t){ke(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 lr(e,t){ke(e,t),e._processingWatchdogs||(e._processingWatchdogs={}),e._yeaftWatchdogConvs||(e._yeaftWatchdogConvs=new Set),e._yeaftWatchdogConvs.add(t),e._processingWatchdogs[t]=setTimeout(()=>{if(e.processingConversations[t]){delete e.processingConversations[t];let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t)}delete e._processingWatchdogs[t]},15e4)}var Nt=O(()=>{});function Mn(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 cr=O(()=>{});function dr(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function kf(){return Date.now()}function Sf(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`pt_${crypto.randomUUID()}`:`pt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`}function Cf(e,t=160){return typeof e!="string"?e:e.length>t?`${e.slice(0,t)}...[truncated]`:e}function If(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"?Cf(n):n);return t}function Us(){return Sf()}function Qe(e,t={}){!e||!t.traceId||(Array.isArray(e._perfTraceQueue)||(e._perfTraceQueue=[]),e._perfTraceQueue.push({traceId:t.traceId,source:"web",phase:t.phase||"unknown",at:kf(),monotonicMs:dr(),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:If(t.detail)}),e._perfTraceQueue.length>200&&e._perfTraceQueue.splice(0,e._perfTraceQueue.length-200),Af(e))}function Af(e){!e||e._perfTraceFlushTimer||(e._perfTraceFlushTimer=setTimeout(()=>xf(e),250))}function xf(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 Pn(e,t={}){if(typeof requestAnimationFrame!="function")return;let s=dr();requestAnimationFrame(()=>{requestAnimationFrame(()=>{Qe(e,{...t,phase:t.phase||"render.next_paint",durationMs:dr()-s})})})}var ur=O(()=>{});function qe(e,t){let s=t==null?"__all__":String(t);return e?`${e}${s}`:s}var pr=O(()=>{});function La(e){return e.filter(t=>!(t.type==="user"&&(!t.content||!t.content.trim())))}function _a(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 i=Number(s);if(Number.isFinite(i)&&i>0)return i}}return null}function Tf(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,i=typeof s.sessionById=="function"?s.sessionById(e,n?.currentAgent||null):s.sessions&&s.sessions[e];return(i&&typeof i.defaultVpId=="string"?i.defaultVpId.trim():"")||null}catch{return null}}function Mf(e,t){return e.speakerVpId||e.vpId||e.vp_id||e.authorVpId||e.authorVP||Tf(t)}function Dn(e){return e&&(e.messageId||e.id)?e.messageId||e.id:null}function Pf(e){e.sort((t,s)=>(t.timestamp||0)-(s.timestamp||0))}function Df(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 i=e.threadId||"",r=t.threadId||"";if(i&&r&&i!==r||!(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 fr(e,t){let s=new Map,n=new Map;e.forEach((r,o)=>{let a=Dn(r);a&&s.set(a,o),r?.type==="user"&&r.clientMessageId&&n.set(r.clientMessageId,o)});let i=0;for(let r of t){let o=Dn(r),a=o&&s.has(o)?s.get(o):null;if(a===null&&r?.type==="user"&&r.clientMessageId&&n.has(r.clientMessageId)&&(a=n.get(r.clientMessageId)),a===null&&r?.type==="assistant"&&(a=e.findIndex(l=>Df(l,r))),a!==null&&a>=0){let l=Dn(e[a]);e[a]={...e[a],...r},o&&s.set(o,a),l&&l!==o&&s.get(l)===a&&s.delete(l),r?.type==="user"&&r.clientMessageId&&n.set(r.clientMessageId,a)}else o&&s.set(o,e.length),r?.type==="user"&&r.clientMessageId&&n.set(r.clientMessageId,e.length),e.push(r),i+=1}return Pf(e),i}function gr(e){return e?e.sessionId??e.groupId??null:null}function _f(e){return!e||e.type!=="user"||!e.clientMessageId?!1:Dn(e)===e.clientMessageId}function Ef(e,t,s){let n=t.reduce((r,o)=>Math.max(r,o?.timestamp||0),0),i=e.filter(r=>r?s!=null&&gr(r)!==s||r.isStreaming||r.type==="tool-use"&&r.toolName==="AskUserQuestion"&&(r.askAnswered||r.askPending||r.askExpired)||_f(r)?!0:n>0&&(r.timestamp||0)>n:!1);return e.splice(0,e.length,...i),fr(e,t),t.length}function Rf(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 xt(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 $a(e,t){pt(e);let s=e.agents.find(i=>i.id===t.agentId);e.conversations=e.conversations.filter(i=>i.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 i=e._pendingPaneId;if(e._pendingPaneId=null,i){let r=e.panels.find(o=>o.id===i);r&&(r.conversationId=t.conversationId)}else{let r=e.panels.find(o=>!o.conversationId);r&&(r.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:xe("store.convCreated",{agent:s?.name||t.agentId,workDir:t.workDir})}),e.saveOpenSessions()}function Va(e,t){pt(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 i=e.panels.find(r=>r.id===n);i&&(i.conversationId=t.conversationId)}else{let i=e.panels.find(r=>!r.conversationId);i&&(i.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:xe("store.convResumed",{agent:s?.name||t.agentId,sessionId:t.claudeSessionId?t.claudeSessionId.slice(0,8)+"...":""})}),t.dbMessages&&t.dbMessages.length>0){let n=La(t.dbMessages.map(o=>e.formatDbMessageForHistoryHydration(o)).flat().filter(Boolean)),i=tr(n),r=e.messagesMap[t.conversationId]||[];for(let o of i)r.push(o)}e.hasMoreMessages=!!t.hasMoreMessages,e.chatSessionState[t.conversationId]={lastSeenDbId:Ws(e.messagesMap[t.conversationId]),hasMoreOlder:!!t.hasMoreMessages},e.saveOpenSessions()}function Fa(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],ke(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:xe("chat.session.closed")}));for(let n of e.panels)n.conversationId===t.conversationId&&(n.conversationId=null);e.saveOpenSessions()}function Oa(e,t){let s=t.conversationId;if(s){delete e.processingConversations[s],ke(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),xt(e,s);let i=e.conversations.find(r=>r.id===s);i&&(t.claudeSessionId&&(i.claudeSessionId=t.claudeSessionId),t.workDir&&(i.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 Ha(e,t){let s=t.conversationId;if(s){delete e.processingConversations[s],ke(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),xt(e,s);let i=e.conversations.find(r=>r.id===s);i&&(t.claudeSessionId&&(i.claudeSessionId=t.claudeSessionId),t.workDir&&(i.workDir=t.workDir)),e.saveOpenSessions()}}function Na(e,t){if(t.conversationId){if(t.isProcessing&&!Ht(e,t.conversationId)&&!e._turnCompletedConvs?.has(t.conversationId))e.processingConversations[t.conversationId]=!0;else if(e.processingConversations[t.conversationId]){delete e.processingConversations[t.conversationId],ke(e,t.conversationId);let s=e.executionStatusMap[t.conversationId];s&&(s.currentTool=null),e.finishStreamingForConversation(t.conversationId)}}}function Ba(e,t){let s=t.conversationId||e.currentConversation;if(s){delete e.processingConversations[s],ke(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),xt(e,s)}}function qa(e,t){e.messagesMap[t.conversationId]||(e.messagesMap[t.conversationId]=[]);let s=e.messagesMap[t.conversationId],n=typeof t.afterMessageId=="number"&&t.afterMessageId>0;if(t.conversationId&&e.activeConversations.includes(t.conversationId)){let i=tr(La((t.messages||[]).map(o=>e.formatDbMessageForHistoryHydration(o)).flat().filter(Boolean)));if(i.length>0){let o=s.find(a=>a.dbMessageId);if(o&&i[0].dbMessageId&&i[i.length-1].dbMessageId<o.dbMessageId){let a=s.indexOf(o);e.debug,s.splice(a,0,...i)}else{e.debug;for(let a of i)if(!(a.dbMessageId&&s.some(l=>l.dbMessageId===a.dbMessageId))){if(a.dbMessageId&&(a.type==="assistant"||a.type==="user")){let l=null;if(a.type==="user"?l=s.find(c=>!c.dbMessageId&&!c.isStreaming&&Mn(c,a)):l=s.find(c=>!c.dbMessageId&&!c.isStreaming&&c.type==="assistant"&&c.content===a.content),l){l.dbMessageId=a.dbMessageId,l.id=a.id,a.timestamp&&(l.timestamp=a.timestamp),a.clientMessageId&&!l.clientMessageId&&(l.clientMessageId=a.clientMessageId);continue}}s.push(a)}}}n||(e.hasMoreMessages=t.hasMore??!1),pt(e);let r=e.chatSessionState[t.conversationId]?.hasMoreOlder;e.chatSessionState[t.conversationId]={lastSeenDbId:Ws(e.messagesMap[t.conversationId]),hasMoreOlder:n?!!r:!!t.hasMore}}e.loadingMoreMessages=!1,e.setRefreshingSession(t.conversationId,!1)}function Wa(e,t){let s=t.sessionId??null,n=t.agentId||s&&e.yeaftSessionAgentById?.[s]||null,i=t.conversationId||n&&e.yeaftConversationIdsByAgent?.[n]||e.yeaftConversationId;if(!i||!s||!Array.isArray(t.messages))return null;e.messagesMap[i]||(e.messagesMap[i]=[]);let{formatted:r}=Ua(t.messages,s,"window",e.messagesMap[i]);return fr(e.messagesMap[i],r),i}function Ea(e){return e?.toolId?[gr(e)??"",e.vpId||e.speakerVpId||"",e.turnId||"",e.threadId||"main",e.toolId].join("\0"):null}function Ra(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 Lf(e,t){return(e||[]).find(s=>s?.type==="tool-use"&&(s.toolName==="AskUser"||s.toolName==="AskUserQuestion")&&s.toolId===t.toolCallId&&gr(s)===t.sessionId&&(s.vpId||s.speakerVpId||"")===(t.vpId||"")&&(s.turnId||"")===(t.turnId||"")&&(s.threadId||"main")===(t.threadId||"main"))||null}function Ua(e,t,s,n){let i=new Set((n||[]).map(l=>l&&(l.messageId||l.id)).filter(Boolean)),r=new Set,o=[],a=0;for(let l of e){if(!l||l._reflection||l.internal||l.systemOnly||l.systemOnlyMessage||Rf(l.content))continue;let c=l.id||l.messageId||null,d=l.clientMessageId||null;if(!(c&&r.has(c))&&!(c&&s!=="recent"&&i.has(c))){if(c&&r.add(c),l.role==="user"){a+=1;let u=c||l.messageId||l.turnId||null,p=l.sessionId??l.groupId??t??null;o.push({...c?{id:c,messageId:c}:{},type:"user",content:l.content,timestamp:_a(l),sessionId:p,turnId:l.turnId||u,...d?{clientMessageId:d}:{},...Array.isArray(l.attachments)&&l.attachments.length>0?{attachments:l.attachments}:{},isStreaming:!1})}else if(l.role==="assistant"){a+=1;let u=c||l.messageId||l.turnId||null,p=l.sessionId??l.groupId??t??null,f=Mf(l,p),g=_a(l),v=!!l.turnId,y=l.turnId||u,A=typeof l.content=="string"?l.content:l.content||"";(typeof A!="string"||A.trim())&&o.push({...c?{id:c,messageId:c}:{},type:"assistant",content:A,timestamp:g,sessionId:p,turnId:y,_hasPersistedTurnId:v,...f?{vpId:f,speakerVpId:f}:{},isStreaming:!1,isHistory:!0});for(let k of Array.isArray(l.images)?l.images:[])k?.assetId&&o.push({id:`${c||u||y}:image:${k.assetId}`,messageId:`${c||u||y}:image:${k.assetId}`,type:"chat-image",...k,timestamp:g,sessionId:p,turnId:y,...f?{vpId:f,speakerVpId:f}:{},isStreaming:!1,isHistory:!0});for(let k of Array.isArray(l.askUserResults)?l.askUserResults:[]){if(!k?.toolCallId||k.status!=="answered"&&k.status!=="expired")continue;let b=[{question:typeof k.question=="string"?k.question:"",options:(Array.isArray(k.options)?k.options:[]).filter(q=>typeof q=="string").map(q=>({label:q,description:""})),multiSelect:!1}],m={toolCallId:k.toolCallId,sessionId:p,vpId:f||"",turnId:y||"",threadId:l.threadId||"main"},w=Lf(n,m);if(w){Ra(w,k,b);continue}let E=Ra({id:`${c||u||y}:ask:${k.toolCallId}`,messageId:`${c||u||y}:ask:${k.toolCallId}`,type:"tool-use",timestamp:g,sessionId:p,turnId:y,threadId:m.threadId,...f?{vpId:f,speakerVpId:f}:{},isStreaming:!1},k,b),R=Ea(E);(!R||!o.some(q=>Ea(q)===R))&&o.push(E)}let x=Number(l.toolSummaryCount||l.toolCalls?.length||0)||0;x>0&&o.push({...c?{id:`${c}:tool-summary`,messageId:`${c}:tool-summary`,persistedMessageId:c}:{},type:"tool-summary",count:x,omittedCount:x,source:"history",timestamp:g,sessionId:p,turnId:y,...f?{vpId:f,speakerVpId:f}:{},isStreaming:!1,isHistory:!0})}}}return{formatted:o,acceptedHistoryMessages:a}}function za(e,t){let s=t.sessionId!=null?t.sessionId:t.groupId,n=t.mode==="recent"||t.mode==="delta"?t.mode:"older",i=Array.isArray(t.messages)?t.messages:[];t.perfTraceId&&Qe(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:n,rawCount:i.length}});let r=t.agentId||(s&&e.yeaftSessionAgentById?e.yeaftSessionAgentById[s]:null),o=r&&e.yeaftConversationIdsByAgent?e.yeaftConversationIdsByAgent[r]:null,a=t.conversationId||o||e.yeaftConversationId;if(!a){e.yeaftLoadingMoreHistory=!1;return}e.messagesMap[a]||(e.messagesMap[a]=[]);let{formatted:l,acceptedHistoryMessages:c}=Ua(i,s,n,e.messagesMap[a]),d=0;if(n==="recent")d=Ef(e.messagesMap[a],l,s??null);else if(l.length>0)if(n==="older"){if(e.messagesMap[a].splice(0,0,...l),d=l.length,typeof e.expandYeaftMessageWindow=="function"){let A=e.yeaftActiveSessionFilter?s??null:null;e.expandYeaftMessageWindow(A,t.turns||10)}}else d=fr(e.messagesMap[a],l);let u=qe(t.agentId||null,s),p=e.yeaftSessionHistoryState?.[u]||{},f=typeof t.latestSeq=="number"?t.latestSeq:p.latestSeq??null,g=n==="delta"?{...p,loaded:!0,loading:!1,latestSeq:f,syncingAfterSeq:null,count:(p.count||0)+d}:{loaded:!0,loading:!1,hasMore:!!t.hasMore,oldestSeq:typeof t.oldestSeq=="number"?t.oldestSeq:e.yeaftOldestLoadedSeq,count:n==="older"?(p.count||0)+d:c,latestSeq:f,syncingAfterSeq:null};e.yeaftSessionHistoryState&&(e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState,[u]:g});let v=e.yeaftActiveSessionFilter??null,y=qe(t.agentId?e.currentAgent:null,v);if(t.perfTraceId&&(Qe(e,{traceId:t.perfTraceId,phase:"history.chunk_applied",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,detail:{mode:n,formattedCount:l.length,insertedRows:d,acceptedHistoryMessages:c}}),Pn(e,{traceId:t.perfTraceId,phase:"history.next_paint",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,detail:{mode:n,insertedRows:d}})),u===y)e.yeaftHasMoreHistory=g.hasMore,typeof t.oldestSeq=="number"&&(e.yeaftOldestLoadedSeq=t.oldestSeq),e.yeaftLoadingMoreHistory=!1;else if(e.yeaftLoadingMoreHistory&&u!==y){let A=e.yeaftSessionHistoryState?.[y]||null;e.yeaftLoadingMoreHistory=!!A?.loading}}var _n=O(()=>{Nt();Ot();cr();xn();sr();bt();ur();pr()});function ja(e,t){if(e.promoteYeaftHistoryOutlineRow?.(t))return;let s=t?.sessionId??t?.groupId??e._currentYeaftSessionId??null;s&&e.invalidateYeaftHistoryOutline?.(s)}function $f(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 mr(e,t){return e.executionStatusMap[t]||(e.executionStatusMap[t]={currentTool:null,toolHistory:[],lastActivity:null}),e.executionStatusMap[t]}function Ka(e,t,s){if(!t)return;let n=mr(e,t);if(n.lastActivity=Date.now(),Tn(e,t),s.type==="system"){if(s.subtype==="init"){let i=e.conversations.find(r=>r.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 r=e.messagesMap[t]||[];for(let o of r)o.type==="tool-use"&&!o.hasResult&&(o.hasResult=!0);for(let o of n.toolHistory)o.status==="running"&&(o.status="done");if(n.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 o of i)o.type==="text"?e.appendToAssistantMessageForConversation(t,o.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}):o.type==="image_asset"&&o.image?e.addMessageToConversation(t,{type:"chat-image",...o.image,sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,speakerVpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):o.type==="tool_summary"?e.addMessageToConversation(t,{type:"tool-summary",count:Number(o.count||o.omittedCount||0)||0,omittedCount:Number(o.omittedCount||o.count||0)||0,source:o.source||"history",isHistory:o.source!=="live",sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):o.type==="tool_use"&&(e.finishStreamingForConversation(t),n.currentTool={name:o.name,input:o.input,startTime:Date.now()},n.toolHistory.unshift({name:o.name,input:o.input,timestamp:Date.now(),status:"running"}),n.toolHistory.length>20&&n.toolHistory.pop(),e.addMessageToConversation(t,{type:"tool-use",toolId:o.id||o.tool_use_id||null,toolName:o.name,toolInput:o.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,r=s.message?.content,o=$f(r);if(typeof o=="string"&&(o.includes("<local-command-caveat>")||o.includes("<command-name>")))return;if(typeof o=="string"&&o.includes("<local-command-stdout>")){let l=o.match(/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/);if(l){e.appendToAssistantMessageForConversation(t,l[1].trim()),e.finishStreamingForConversation(t);return}}let a=[];if(s.tool_use_result)a=Array.isArray(s.tool_use_result)?s.tool_use_result:[s.tool_use_result];else if(s.message?.content){let l=s.message.content;a=(Array.isArray(l)?l:[]).filter(d=>d.type==="tool_result")}if(a.length>0){let l=e.messagesMap[t]||[];for(let c of a){if(n.toolHistory.length>0){let f=n.toolHistory.findIndex(g=>g.status==="running");f>=0&&(n.toolHistory[f].status="done")}let d=c.tool_use_id||c.toolUseId||c.tool_call_id||c.toolCallId||null,u=c.content||c,p=!1;if(d){for(let f=l.length-1;f>=0;f--)if(l[f].type==="tool-use"&&l[f].toolId===d){l[f].hasResult=!0,l[f].toolResult=c.is_update&&l[f].toolResult?`${l[f].toolResult}
|
|
1
|
+
var O=(e,t,s)=>()=>{if(s)throw s[0];try{return e&&(t=e(e=0)),t}catch(n){throw s=[n],n}};var sf=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(s){throw t=0,s}};function Wo(e,t){let s=nacl.randomBytes(24),n=JSON.stringify(e),i,r=!1;n.length>512?(i=pako.gzip(n),r=!0):i=nacl.util.decodeUTF8(n);let o=nacl.secretbox(i,s,t),a={n:nacl.util.encodeBase64(s),c:nacl.util.encodeBase64(o)};return r&&(a.z=!0),a}function Uo(e,t){try{let s=nacl.util.decodeBase64(e.n),n=nacl.util.decodeBase64(e.c),i=nacl.secretbox.open(n,s,t);if(!i)return null;if(e.z){let r=pako.ungzip(i,{to:"string"});return JSON.parse(r)}else return JSON.parse(nacl.util.encodeUTF8(i))}catch{return null}}function zo(e){return e&&typeof e=="object"&&typeof e.n=="string"&&typeof e.c=="string"}function lt(e){return nacl.util.decodeBase64(e)}var Cn=O(()=>{});var nf,rf,Ae,ct=O(()=>{Cn();({defineStore:nf}=Pinia),rf=1800*1e3,Ae=nf("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,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.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?lt(n.sessionKey):null,this.role=n.role||"pro",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 i=await(await fetch("/api/auth/aad",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:s.idToken})})).json();return i.success?(this.token=i.token,this.sessionKey=i.sessionKey?lt(i.sessionKey):null,this.role=i.role||"pro",this.authGeneration+=1,this.isAuthenticated=!0,this.loginStep="authenticated",localStorage.setItem("authToken",i.token),this.startSessionRefresh(),!0):(this.error=i.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?lt(s.sessionKey):null,this.role=s.role||"pro",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?lt(s.sessionKey):null,this.role=s.role||"pro",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?lt(s.sessionKey):null,this.role=s.role||"pro",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 r=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 r.success?!0:(this.error=r.error||"Registration failed",!1)}catch(i){return this.error=i.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(),i=`/api/auth/sso/${encodeURIComponent(e)}/start-qr${n?"?"+n:""}`,r=await fetch(i),o=await r.json();return!r.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?lt(n.sessionKey):null,this.role=n.role||"pro",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"),i=s.get("sessionKey"),r=s.get("role");if(!n)return!1;this.token=n,this.sessionKey=i?lt(i):null,this.role=r||"pro",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 i=await n.json().catch(()=>({})),r=n.headers?.get?.("X-New-Token"),o=localStorage.getItem("authToken");return r&&this.token===e&&(!o||o===e)&&(this.token=r,localStorage.setItem("authToken",r)),i?.role&&(this.role=i.role),!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,rf),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,i=void 0){if(!e||e.status!==401||!n||s!==this.authGeneration)return!1;let r=this.token||localStorage.getItem("authToken")||null;return t!==r?!1:(this.handleAuthFailure(i,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 i=await n.json();if(t!==this.authGeneration)return this.isAuthenticated;let r=n.headers?.get?.("X-New-Token"),o=this.getActiveToken(),a=r&&(!o||o===e)?r:o||e;return this.token=a,a&&a!==e&&localStorage.setItem("authToken",a),this.role=i?.role||"pro",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=lt(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 i=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 i.success?!0:(this.error=i.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(){this.authGeneration+=1,this.stopSessionRefresh(),this.isAuthenticated=!1,this.token=null,this.sessionKey=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 xe(e,t){let s=yt?.value||"zh-CN",i=(ls[s]||ls["zh-CN"]||{})[e];if(i===void 0&&s!=="zh-CN"&&(i=(ls["zh-CN"]||{})[e]),i===void 0)return e;if(t)for(let[r,o]of Object.entries(t))i=i.replace(new RegExp(`\\{${r}\\}`,"g"),o);return i}function of(){return yt?.value||"zh-CN"}function Os(e){ls[e]&&(yt&&(yt.value=e),localStorage.setItem("locale",e),document.documentElement.setAttribute("lang",e))}function af(){let e=localStorage.getItem("locale");return e&&ls[e]?e:(navigator.language||navigator.userLanguage||"").startsWith("en")?"en":"zh-CN"}function jo(e,t){return ls=t,yt=Vue.ref(af()),document.documentElement.setAttribute("lang",yt.value),e.config.globalProperties.$t=xe,e.config.globalProperties.$locale=yt,e.provide("t",xe),e.provide("locale",yt),{t:xe,setLocale:Os,getLocale:of,locale:yt}}var yt,ls,bt=O(()=>{yt=null,ls={}});function cs(e,t,s=""){Hs&&(clearTimeout(Hs),Hs=null),e.sessionLoading=t,e.sessionLoadingText=s,t&&(Hs=setTimeout(()=>{e.sessionLoading&&(e.sessionLoading=!1,e.sessionLoadingText=""),Hs=null},lf))}function pt(e){cs(e,!1)}function Ko(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(i=>i.id===s&&i.online);n&&(e.pendingRecovery={agentId:s,agentName:n.name,sessionId:t.sessionId,workDir:t.workDir},e.recoveryDismissed=!1)}}function Go(e){if(!e.pendingRecovery)return;let{agentId:t,sessionId:s,workDir:n}=e.pendingRecovery;e.selectAgent(t),setTimeout(()=>{e.resumeConversation(s,n,t),e.pendingRecovery=null,e.recoveryDismissed=!1},500)}function Yo(e){e.recoveryDismissed=!0,e.pendingRecovery=null}function Qo(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]=[],cs(e,!0,xe("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.sendWsMessage({type:"sync_messages",conversationId:t,turns:5}))),e.sendWsMessage({type:"select_conversation",conversationId:t}))}function Xo(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(r=>r.id)),i=s.filter(r=>r&&typeof r.id=="string").map(r=>({id:r.id,conversationId:r.conversationId&&n.has(r.conversationId)?r.conversationId:null,activeRightPanel:r.activeRightPanel||null}));if(i.length<2){localStorage.removeItem("panels");return}e.panels=i,e.activePanelId=i[0]?.id||null;for(let r of i)r.conversationId&&(e.activeConversations.includes(r.conversationId)||e.activeConversations.push(r.conversationId),e.messagesMap[r.conversationId]||(e.messagesMap[r.conversationId]=[]),e.messagesMap[r.conversationId].length||e.sendWsMessage({type:"sync_messages",conversationId:r.conversationId,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);t?.claudeSessionId&&t?.workDir&&(localStorage.setItem("lastUsedSession",JSON.stringify({sessionId:t.claudeSessionId,workDir:t.workDir,agentId:e.currentAgent})),e.lastUsedSession={sessionId:t.claudeSessionId,workDir:t.workDir,agentId:e.currentAgent})}e.lastUsedAgent=e.currentAgent,e.panels.length>0?localStorage.setItem("panels",JSON.stringify(e.panels)):localStorage.removeItem("panels")}}function Zo(e){return e.lastUsedSession}function Jo(e){localStorage.removeItem("lastUsedAgent"),localStorage.removeItem("lastUsedSession"),localStorage.removeItem("lastViewedConversation"),localStorage.removeItem("panels"),localStorage.removeItem("splitPanesSaved"),e.lastUsedAgent=null,e.lastUsedSession=null,e.lastViewedConversation=null}function ea(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 ta(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 sa(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(i=>{e._foldersResolve&&e._foldersResolve(),e._foldersResolve=i,e.sendWsMessage({type:"list_folders",agentId:t,provider:s||"claude-code",requestId:n}),setTimeout(()=>{e._foldersResolve===i&&(e._foldersResolve(),e._foldersResolve=null,e.foldersLoading=!1)},1e4)})}function na(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(i=>{e._modelsResolve&&e._modelsResolve([]),e._modelsTimeout&&clearTimeout(e._modelsTimeout),e._modelsResolve=i,e.sendWsMessage({type:"list_models",agentId:t,provider:s||"claude-code",requestId:n}),e._modelsTimeout=setTimeout(()=>{e._modelsResolve===i&&(e._modelsResolve([]),e._modelsResolve=null,e.providerModelsLoading=!1),e._modelsTimeout=null},1e4)})}function ia(e,t,s,n){if(!t){e.historySessionsLoading=!1;return}if(!s){e.historySessions=[],e.historySessionsLoading=!1;return}let i=Date.now().toString();e._historySessionsRequestId=i,e.historySessionsLoading=!0,e.historySessions=[],e.sendWsMessage({type:"list_history_sessions",agentId:t,workDir:s,provider:n||"claude-code",requestId:i})}async function ra(e,t=20){if(Ae().isAuthenticated){e.globalSessionsLoading=!0;try{let n=await fetch(`/api/sessions?limit=${t}`);if(n.ok){let i=await n.json();e.globalSessions=i.sessions||[]}}catch{}finally{e.globalSessionsLoading=!1}}}async function oa(e,t){if(!Ae().isAuthenticated)return!1;try{if((await fetch(`/api/sessions/${t}`,{method:"DELETE"})).ok)return e.globalSessions=e.globalSessions.filter(i=>i.id!==t),!0}catch{}return!1}function Xi(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 aa(e,t){let s=Xi(e,t);return s&&s.online}var lf,Hs,Ot=O(()=>{ct();bt();lf=3e4,Hs=null});function la(e){return e?.code===1008&&String(e.reason||"").toLowerCase().includes("authentication")}function ca(e){let t=Ns;Ns=[];for(let{resolve:s,reject:n,timer:i}of t)clearTimeout(i),e?s():n(new Error("WebSocket reconnect failed"))}function da(e,t){if(!e.ws||e.ws.readyState!==WebSocket.OPEN)return!1;if(e.currentView==="yeaft"&&df.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=Wo(t,e.sessionKey);e.ws.send(JSON.stringify(s))}else e.ws.send(JSON.stringify(t));return!0}catch{return!1}}function Bs(e,t=1e4){return e.ws&&e.ws.readyState===WebSocket.OPEN?Promise.resolve():new Promise((s,n)=>{let i=setTimeout(()=>{Ns=Ns.filter(r=>r.resolve!==s),n(new Error("WebSocket reconnect timeout"))},t);Ns.push({resolve:s,reject:n,timer:i}),(!e.ws||e.ws.readyState!==WebSocket.CONNECTING)&&(e.reconnectAttempts=0,e.connect())})}function ua(e,t){try{let s=JSON.parse(t);return e.sessionKey&&zo(s)?Uo(s,e.sessionKey):s}catch{return null}}function pa(e){let t=Ae(),s=location.protocol==="https:"?"wss:":"ws:";e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null);let n=t.getActiveToken?.()||t.token||null,i=t.authGeneration;if(e.ws&&e.ws.readyState===WebSocket.CONNECTING&&e._wsAuthToken===n&&e._wsAuthGeneration===i)return;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._wsAuthToken=n,e._wsAuthGeneration=i;let r=`${s}//${location.host}?type=web`;n&&(r+=`&token=${encodeURIComponent(n)}`);let o=new WebSocket(r);e.ws=o,o.onopen=()=>{if(o===e.ws){e.connectionState="connected",e.reconnectAttempts=0,e.startHeartbeat();try{o.send(JSON.stringify({type:"client_hello",plaintextOk:!0}))}catch{}ca(!0)}},o.onmessage=a=>{if(o!==e.ws)return;let l=e.parseWsMessage(a.data);l&&(l.type,e.handleMessage({...l,_wsAuthToken:n,_wsAuthGeneration:i}))},o.onclose=a=>{if(o!==e.ws){la(a)&&t.handleAuthFailure?.(void 0,n,i);return}e.authenticated=!1;let l=e.connectionState==="updating";if(e.connectionState=l?"updating":"disconnected",e.stopHeartbeat(),pt(e),la(a)){t.handleAuthFailure?.(void 0,n,i),e.reconnectAttempts=0,ca(!1);return}if(e._yeaftReconnectCatchUpPending=!0,l){e.reconnectAttempts=0,e.reconnectTimer=setTimeout(()=>{e.connect()},2e3);return}e.scheduleReconnect()},e.ws.onerror=a=>{}}function fa(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 ga(e){e.reconnectAttempts=0,e.connect()}function ma(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 ha(e){e.heartbeatTimer&&(clearInterval(e.heartbeatTimer),e.heartbeatTimer=null)}function va(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 Ns,df,Zi=O(()=>{ct();Cn();Ot();Ns=[];df=new Set(["sync_messages","refresh_conversation","select_conversation","cancel_execution","update_conversation_settings","ask_user_answer"])});function ff(e){return e?.type==="tool-use"}function Ji(e){return e?.type==="tool-summary"}function er(e){return ff(e)&&!pf.has(e.toolName)}function wa(e,t,s,n=s){let i=t==="history"&&(n?.dbMessageId||n?.id)||null;return{...i?{id:`tool_summary_${t}_${i}`,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 gf(e,t){return!Ji(e)||!Ji(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 mf(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 ya(e){return[e?.sessionId||"",e?.turnId||"",e?.speakerVpId||e?.vpId||""].join("")}function ba(e,t,s,n,i=n){if(!t)return;let r=wa(t,s,n,i),o=e[e.length-1];gf(o,r)?mf(o,r):e.push(r)}function tr(e=[]){let t=[],s=0,n=null,i=null;for(let r of e){if(er(r)&&r.isHistory){s+=1,n||(n=r),i=r;continue}ba(t,s,"history",n,i),s=0,n=null,i=null,t.push(r)}return ba(t,s,"history",n,i),t}function ka(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 f=e.length-1;f>=0;f-=1){let g=e[f];if(g?.type==="user"||g?.type==="system"||g?.type==="error")break;n=f}let i=e.slice(n),r=new Map;for(let f of i){if(!er(f)||f.isHistory)continue;let g=ya(f);r.set(g,(r.get(g)||0)+1)}let o=new Map;for(let[f,g]of r)g>s&&o.set(f,g-s);if(o.size===0)return e;let a=new Map,l=new Map,c=new Set,d=[],u=(f,g,b)=>{a.set(f,(a.get(f)||0)+g),!l.has(f)&&b&&l.set(f,b)},p=(f,g)=>{if(c.has(f))return;let b=a.get(f)||0;b<=0||(d.push(wa(b,"live",l.get(f)||g)),c.add(f))};for(let f of i){let g=ya(f);if(Ji(f)&&f.source==="live"&&o.has(g)){u(g,Number(f.count)||0,f);continue}if(er(f)&&!f.isHistory&&o.has(g)){let b=o.get(g)||0;if(b>0){o.set(g,b-1),u(g,1,f);continue}}p(g,f),d.push(f)}for(let f of a.keys())p(f,l.get(f));return e.splice(n,e.length-n,...d),e}var pf,sr=O(()=>{pf=new Set(["TodoWrite","AskUserQuestion"])});function nr(e,t){return t?t===e.yeaftConversationId?!0:Object.values(e.yeaftConversationIdsByAgent||{}).includes(t):!1}function qs(e,t,s){s&&(s.type!=="assistant"&&s.type!=="tool-use"||nr(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 vf(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 i=Number(s);if(Number.isFinite(i)&&i>0)return i}}return Date.now()}function In(e){let t=e?.messageId??e?.dbMessageId??e?.id;return t==null||t===""?null:String(t)}function ir(e,t){if(!e||!t)return e;let s=e.type==="user"&&typeof e.id=="string"&&e.id===e.clientMessageId;for(let[n,i]of Object.entries(t))if(i!=null){if(n==="isStreaming"){e.isStreaming&&i===!1&&(e.isStreaming=!1);continue}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]=i);continue}if(!(n==="turnId"&&s&&e.turnId===e.clientMessageId)){if(n==="content"&&typeof i=="string"){e.content||(e.content=i);continue}if(n==="attachments"&&Array.isArray(i)){(!Array.isArray(e.attachments)||e.attachments.length===0)&&(e.attachments=i);continue}(e[n]===void 0||e[n]===null||e[n]==="")&&(e[n]=i)}}return e}function rr(e=[],t=[]){let s=[],n=new Map,i=new Map;for(let r of[...e,...t]){if(!r)continue;let o=In(r),a=r.type==="user"&&r.clientMessageId?String(r.clientMessageId):null;if(o&&n.has(o)){ir(n.get(o),r);continue}if(a&&i.has(a)){let l=i.get(a);ir(l,r),o&&!n.has(o)&&n.set(o,l);continue}s.push(r),o&&n.set(o,r),a&&i.set(a,r)}return s}function Sa(e,t,s){return!e||e!==t?!1:!s?.loaded&&!s?.loading}function Ca(e,t){return!!t&&!!e?.loaded&&!e?.loading&&Number.isFinite(e?.latestSeq)}function or({sessionState:e,hasCachedSessionRows:t,force:s=!1}={}){return e?.loading?!1:s?!e?.loaded:e?.loaded?!1:!t}function yf(e,t,s,n){let i=s?.id?String(s.id):null;if(!i)return!1;let o=(e.messagesMap[t]||[]).find(a=>a?.type==="assistant"&&In(a)===i);return o?(o.id||(o.id=i),o.messageId||(o.messageId=i),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,qs(e,t,o),!0):!1}function An(e,t,s){if(!t)return;let n={...s,id:s.dbMessageId||s.id||Date.now().toString()+Math.random().toString(36).substr(2,9),timestamp:vf(s)};nr(e,t)&&!n.sessionId&&(n.sessionId=e._currentYeaftSessionId||e.yeaftActiveSessionFilter||hf),nr(e,t)&&(!n.vpId&&e._currentYeaftVpId&&(n.vpId=e._currentYeaftVpId),!n.turnId&&e._currentYeaftTurnId&&(n.turnId=e._currentYeaftTurnId),qs(e,t,n)),e.messagesMap[t]||(e.messagesMap[t]=[]);let i=In(s);if(i){let r=e.messagesMap[t].find(o=>In(o)===i);if(r)return ir(r,n),t===e.yeaftConversationId&&e.messagesMap[t].sort((o,a)=>o.timestamp-a.timestamp),r}return e.messagesMap[t].push(n),ka(e.messagesMap[t]),t===e.yeaftConversationId&&e.messagesMap[t].sort((r,o)=>r.timestamp-o.timestamp),n}function Ia(e,t,s,n={}){if(!t||!s)return;e.messagesMap[t]||(e.messagesMap[t]=[]);let i=e.messagesMap[t];if(yf(e,t,n,s))return;let r=e._currentYeaftTurnId;if(r){for(let a=i.length-1;a>=0;a--)if(i[a].turnId===r&&i[a].type==="assistant"&&i[a].isStreaming){if(qs(e,t,i[a]),n.id&&!i[a].id&&(i[a].id=n.id),n.id&&!i[a].messageId&&(i[a].messageId=n.id),i[a].content.endsWith(s))return;i[a].content+=s;return}An(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=i[i.length-1];if(o&&o.type==="assistant"&&o.isStreaming){if(qs(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 An(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 Aa(e,t){if(!t)return;let s=e.messagesMap[t];if(!s||s.length===0)return;let n=e._currentYeaftTurnId||null;for(let i=s.length-1;i>=0;i--){let r=s[i];if(n&&r.turnId&&r.turnId!==n){if(r.type==="user")break;continue}if(r.isStreaming&&(r.isStreaming=!1,r.status==="pending"&&(r.status="completed",r.turnEndAt=Date.now())),qs(e,t,r),r.type==="user")break}}function xa(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 Ta(e,t){let s=e.currentConversation;if(!s)return;e.messagesMap[s]||(e.messagesMap[s]=[]);let n=e.messagesMap[s],i=null;for(let r of t)if(r.type==="user"){let o=r.message?.content;if(o){let a=typeof o=="string"?o:Array.isArray(o)?o.map(l=>l.text||"").join(""):"";a&&(i=a,e.addMessage({type:"user",content:a,isHistory:!0}))}}else if(r.type==="assistant"){let o=r.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(i&&s&&!e.conversationTitles[s]){let r=i.trim().substring(0,100);e.conversationTitles[s]=r}}function Ws(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 Ma(e){return{id:e.id,dbMessageId:e.id,timestamp:e.created_at}}function Pa(e){return e?e.message_type==="tool_use"&&!bf.has(e.tool_name)?{...Ma(e),type:"tool-use",toolName:e.tool_name||"unknown",hasResult:!0,isHistory:!0,startTime:e.created_at||0}:ar(e):null}function ar(e){if(!e)return null;let t=Ma(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 i=JSON.parse(e.metadata);i.askRequestId&&(n.askRequestId=i.askRequestId,n.askQuestions=i.askQuestions,n.askAnswered=!!i.askAnswered,n.selectedAnswers=i.selectedAnswers||null,i.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 i=JSON.parse(n);if(Array.isArray(i))return i.filter(r=>r.type==="text"&&r.text).map(r=>r.text).join("")}catch{}return n};if(e.role==="user"){let n=null;if(e.metadata)try{let i=JSON.parse(e.metadata);i&&typeof i.clientMessageId=="string"&&(n=i.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),i=(()=>{if(!e.content||typeof e.content!="string"||!e.content.startsWith("["))return[];try{let r=JSON.parse(e.content);return Array.isArray(r)?r.filter(o=>o.type==="tool_use"&&o.name):[]}catch{return[]}})();if(!n&&i.length===0)return null;if(i.length>0){let r=[];n&&r.push({...t,type:"assistant",content:n});for(let o=0;o<i.length;o++){let a=i[o];r.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 r}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 hf,bf,xn=O(()=>{sr();hf="grp_default";bf=new Set(["TodoWrite","AskUserQuestion"])});function Ht(e,t){return e._closedAt?.[t]?Date.now()-e._closedAt[t]<3e4:!1}function us(e,t){ke(e,t),e._processingWatchdogs||(e._processingWatchdogs={});let s=()=>{if(!e.processingConversations[t])return;let i=e.conversations.find(o=>o.id===t);e.sendWsMessage({type:"ping_session",conversationId:t,agentId:i?.agentId});let r=setTimeout(()=>{e.processingConversations[t]&&(e.sessionHealth||(e.sessionHealth={}),e.sessionHealth[t]={status:"agent-offline"})},1e4);e._pongTimeouts||(e._pongTimeouts={}),e._pongTimeouts[t]=r},n=setTimeout(()=>{e.processingConversations[t]&&(s(),e._processingWatchdogs[t]=setInterval(()=>{if(!e.processingConversations[t]){ke(e,t);return}s()},3e4))},45e3);e._processingWatchdogs[t]=n}function Tn(e,t){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)?lr(e,t):us(e,t))}function ke(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)}function Da(e,t){ke(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 lr(e,t){ke(e,t),e._processingWatchdogs||(e._processingWatchdogs={}),e._yeaftWatchdogConvs||(e._yeaftWatchdogConvs=new Set),e._yeaftWatchdogConvs.add(t),e._processingWatchdogs[t]=setTimeout(()=>{if(e.processingConversations[t]){delete e.processingConversations[t];let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t)}delete e._processingWatchdogs[t]},15e4)}var Nt=O(()=>{});function Mn(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 cr=O(()=>{});function dr(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Sf(){return Date.now()}function Cf(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`pt_${crypto.randomUUID()}`:`pt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`}function If(e,t=160){return typeof e!="string"?e:e.length>t?`${e.slice(0,t)}...[truncated]`:e}function Af(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"?If(n):n);return t}function Us(){return Cf()}function Qe(e,t={}){!e||!t.traceId||(Array.isArray(e._perfTraceQueue)||(e._perfTraceQueue=[]),e._perfTraceQueue.push({traceId:t.traceId,source:"web",phase:t.phase||"unknown",at:Sf(),monotonicMs:dr(),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:Af(t.detail)}),e._perfTraceQueue.length>200&&e._perfTraceQueue.splice(0,e._perfTraceQueue.length-200),xf(e))}function xf(e){!e||e._perfTraceFlushTimer||(e._perfTraceFlushTimer=setTimeout(()=>Tf(e),250))}function Tf(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 Pn(e,t={}){if(typeof requestAnimationFrame!="function")return;let s=dr();requestAnimationFrame(()=>{requestAnimationFrame(()=>{Qe(e,{...t,phase:t.phase||"render.next_paint",durationMs:dr()-s})})})}var ur=O(()=>{});function qe(e,t){let s=t==null?"__all__":String(t);return e?`${e}${s}`:s}var pr=O(()=>{});function La(e){return e.filter(t=>!(t.type==="user"&&(!t.content||!t.content.trim())))}function _a(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 i=Number(s);if(Number.isFinite(i)&&i>0)return i}}return null}function Mf(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,i=typeof s.sessionById=="function"?s.sessionById(e,n?.currentAgent||null):s.sessions&&s.sessions[e];return(i&&typeof i.defaultVpId=="string"?i.defaultVpId.trim():"")||null}catch{return null}}function Pf(e,t){return e.speakerVpId||e.vpId||e.vp_id||e.authorVpId||e.authorVP||Mf(t)}function Dn(e){return e&&(e.messageId||e.id)?e.messageId||e.id:null}function Df(e){e.sort((t,s)=>(t.timestamp||0)-(s.timestamp||0))}function _f(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 i=e.threadId||"",r=t.threadId||"";if(i&&r&&i!==r||!(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 fr(e,t){let s=new Map,n=new Map;e.forEach((r,o)=>{let a=Dn(r);a&&s.set(a,o),r?.type==="user"&&r.clientMessageId&&n.set(r.clientMessageId,o)});let i=0;for(let r of t){let o=Dn(r),a=o&&s.has(o)?s.get(o):null;if(a===null&&r?.type==="user"&&r.clientMessageId&&n.has(r.clientMessageId)&&(a=n.get(r.clientMessageId)),a===null&&r?.type==="assistant"&&(a=e.findIndex(l=>_f(l,r))),a!==null&&a>=0){let l=Dn(e[a]);e[a]={...e[a],...r},o&&s.set(o,a),l&&l!==o&&s.get(l)===a&&s.delete(l),r?.type==="user"&&r.clientMessageId&&n.set(r.clientMessageId,a)}else o&&s.set(o,e.length),r?.type==="user"&&r.clientMessageId&&n.set(r.clientMessageId,e.length),e.push(r),i+=1}return Df(e),i}function gr(e){return e?e.sessionId??e.groupId??null:null}function Ef(e){return!e||e.type!=="user"||!e.clientMessageId?!1:Dn(e)===e.clientMessageId}function Rf(e,t,s){let n=t.reduce((r,o)=>Math.max(r,o?.timestamp||0),0),i=e.filter(r=>r?s!=null&&gr(r)!==s||r.isStreaming||r.type==="tool-use"&&r.toolName==="AskUserQuestion"&&(r.askAnswered||r.askPending||r.askExpired)||Ef(r)?!0:n>0&&(r.timestamp||0)>n:!1);return e.splice(0,e.length,...i),fr(e,t),t.length}function Lf(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 xt(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 $a(e,t){pt(e);let s=e.agents.find(i=>i.id===t.agentId);e.conversations=e.conversations.filter(i=>i.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 i=e._pendingPaneId;if(e._pendingPaneId=null,i){let r=e.panels.find(o=>o.id===i);r&&(r.conversationId=t.conversationId)}else{let r=e.panels.find(o=>!o.conversationId);r&&(r.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:xe("store.convCreated",{agent:s?.name||t.agentId,workDir:t.workDir})}),e.saveOpenSessions()}function Va(e,t){pt(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 i=e.panels.find(r=>r.id===n);i&&(i.conversationId=t.conversationId)}else{let i=e.panels.find(r=>!r.conversationId);i&&(i.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:xe("store.convResumed",{agent:s?.name||t.agentId,sessionId:t.claudeSessionId?t.claudeSessionId.slice(0,8)+"...":""})}),t.dbMessages&&t.dbMessages.length>0){let n=La(t.dbMessages.map(o=>e.formatDbMessageForHistoryHydration(o)).flat().filter(Boolean)),i=tr(n),r=e.messagesMap[t.conversationId]||[];for(let o of i)r.push(o)}e.hasMoreMessages=!!t.hasMoreMessages,e.chatSessionState[t.conversationId]={lastSeenDbId:Ws(e.messagesMap[t.conversationId]),hasMoreOlder:!!t.hasMoreMessages},e.saveOpenSessions()}function Fa(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],ke(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:xe("chat.session.closed")}));for(let n of e.panels)n.conversationId===t.conversationId&&(n.conversationId=null);e.saveOpenSessions()}function Oa(e,t){let s=t.conversationId;if(s){delete e.processingConversations[s],ke(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),xt(e,s);let i=e.conversations.find(r=>r.id===s);i&&(t.claudeSessionId&&(i.claudeSessionId=t.claudeSessionId),t.workDir&&(i.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 Ha(e,t){let s=t.conversationId;if(s){delete e.processingConversations[s],ke(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),xt(e,s);let i=e.conversations.find(r=>r.id===s);i&&(t.claudeSessionId&&(i.claudeSessionId=t.claudeSessionId),t.workDir&&(i.workDir=t.workDir)),e.saveOpenSessions()}}function Na(e,t){if(t.conversationId){if(t.isProcessing&&!Ht(e,t.conversationId)&&!e._turnCompletedConvs?.has(t.conversationId))e.processingConversations[t.conversationId]=!0;else if(e.processingConversations[t.conversationId]){delete e.processingConversations[t.conversationId],ke(e,t.conversationId);let s=e.executionStatusMap[t.conversationId];s&&(s.currentTool=null),e.finishStreamingForConversation(t.conversationId)}}}function Ba(e,t){let s=t.conversationId||e.currentConversation;if(s){delete e.processingConversations[s],ke(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),xt(e,s)}}function qa(e,t){e.messagesMap[t.conversationId]||(e.messagesMap[t.conversationId]=[]);let s=e.messagesMap[t.conversationId],n=typeof t.afterMessageId=="number"&&t.afterMessageId>0;if(t.conversationId&&e.activeConversations.includes(t.conversationId)){let i=tr(La((t.messages||[]).map(o=>e.formatDbMessageForHistoryHydration(o)).flat().filter(Boolean)));if(i.length>0){let o=s.find(a=>a.dbMessageId);if(o&&i[0].dbMessageId&&i[i.length-1].dbMessageId<o.dbMessageId){let a=s.indexOf(o);e.debug,s.splice(a,0,...i)}else{e.debug;for(let a of i)if(!(a.dbMessageId&&s.some(l=>l.dbMessageId===a.dbMessageId))){if(a.dbMessageId&&(a.type==="assistant"||a.type==="user")){let l=null;if(a.type==="user"?l=s.find(c=>!c.dbMessageId&&!c.isStreaming&&Mn(c,a)):l=s.find(c=>!c.dbMessageId&&!c.isStreaming&&c.type==="assistant"&&c.content===a.content),l){l.dbMessageId=a.dbMessageId,l.id=a.id,a.timestamp&&(l.timestamp=a.timestamp),a.clientMessageId&&!l.clientMessageId&&(l.clientMessageId=a.clientMessageId);continue}}s.push(a)}}}n||(e.hasMoreMessages=t.hasMore??!1),pt(e);let r=e.chatSessionState[t.conversationId]?.hasMoreOlder;e.chatSessionState[t.conversationId]={lastSeenDbId:Ws(e.messagesMap[t.conversationId]),hasMoreOlder:n?!!r:!!t.hasMore}}e.loadingMoreMessages=!1,e.setRefreshingSession(t.conversationId,!1)}function Wa(e,t){let s=t.sessionId??null,n=t.agentId||s&&e.yeaftSessionAgentById?.[s]||null,i=t.conversationId||n&&e.yeaftConversationIdsByAgent?.[n]||e.yeaftConversationId;if(!i||!s||!Array.isArray(t.messages))return null;e.messagesMap[i]||(e.messagesMap[i]=[]);let{formatted:r}=Ua(t.messages,s,"window",e.messagesMap[i]);return fr(e.messagesMap[i],r),i}function Ea(e){return e?.toolId?[gr(e)??"",e.vpId||e.speakerVpId||"",e.turnId||"",e.threadId||"main",e.toolId].join("\0"):null}function Ra(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 $f(e,t){return(e||[]).find(s=>s?.type==="tool-use"&&(s.toolName==="AskUser"||s.toolName==="AskUserQuestion")&&s.toolId===t.toolCallId&&gr(s)===t.sessionId&&(s.vpId||s.speakerVpId||"")===(t.vpId||"")&&(s.turnId||"")===(t.turnId||"")&&(s.threadId||"main")===(t.threadId||"main"))||null}function Ua(e,t,s,n){let i=new Set((n||[]).map(l=>l&&(l.messageId||l.id)).filter(Boolean)),r=new Set,o=[],a=0;for(let l of e){if(!l||l._reflection||l.internal||l.systemOnly||l.systemOnlyMessage||Lf(l.content))continue;let c=l.id||l.messageId||null,d=l.clientMessageId||null;if(!(c&&r.has(c))&&!(c&&s!=="recent"&&i.has(c))){if(c&&r.add(c),l.role==="user"){a+=1;let u=c||l.messageId||l.turnId||null,p=l.sessionId??l.groupId??t??null;o.push({...c?{id:c,messageId:c}:{},type:"user",content:l.content,timestamp:_a(l),sessionId:p,turnId:l.turnId||u,...d?{clientMessageId:d}:{},...Array.isArray(l.attachments)&&l.attachments.length>0?{attachments:l.attachments}:{},isStreaming:!1})}else if(l.role==="assistant"){a+=1;let u=c||l.messageId||l.turnId||null,p=l.sessionId??l.groupId??t??null,f=Pf(l,p),g=_a(l),b=!!l.turnId,h=l.turnId||u,A=typeof l.content=="string"?l.content:l.content||"";(typeof A!="string"||A.trim())&&o.push({...c?{id:c,messageId:c}:{},type:"assistant",content:A,timestamp:g,sessionId:p,turnId:h,_hasPersistedTurnId:b,...f?{vpId:f,speakerVpId:f}:{},isStreaming:!1,isHistory:!0});for(let k of Array.isArray(l.images)?l.images:[])k?.assetId&&o.push({id:`${c||u||h}:image:${k.assetId}`,messageId:`${c||u||h}:image:${k.assetId}`,type:"chat-image",...k,timestamp:g,sessionId:p,turnId:h,...f?{vpId:f,speakerVpId:f}:{},isStreaming:!1,isHistory:!0});for(let k of Array.isArray(l.askUserResults)?l.askUserResults:[]){if(!k?.toolCallId||k.status!=="answered"&&k.status!=="expired")continue;let y=[{question:typeof k.question=="string"?k.question:"",options:(Array.isArray(k.options)?k.options:[]).filter(q=>typeof q=="string").map(q=>({label:q,description:""})),multiSelect:!1}],m={toolCallId:k.toolCallId,sessionId:p,vpId:f||"",turnId:h||"",threadId:l.threadId||"main"},w=$f(n,m);if(w){Ra(w,k,y);continue}let E=Ra({id:`${c||u||h}:ask:${k.toolCallId}`,messageId:`${c||u||h}:ask:${k.toolCallId}`,type:"tool-use",timestamp:g,sessionId:p,turnId:h,threadId:m.threadId,...f?{vpId:f,speakerVpId:f}:{},isStreaming:!1},k,y),R=Ea(E);(!R||!o.some(q=>Ea(q)===R))&&o.push(E)}let x=Number(l.toolSummaryCount||l.toolCalls?.length||0)||0;x>0&&o.push({...c?{id:`${c}:tool-summary`,messageId:`${c}:tool-summary`,persistedMessageId:c}:{},type:"tool-summary",count:x,omittedCount:x,source:"history",timestamp:g,sessionId:p,turnId:h,...f?{vpId:f,speakerVpId:f}:{},isStreaming:!1,isHistory:!0})}}}return{formatted:o,acceptedHistoryMessages:a}}function za(e,t){let s=t.sessionId!=null?t.sessionId:t.groupId,n=t.mode==="recent"||t.mode==="delta"?t.mode:"older",i=Array.isArray(t.messages)?t.messages:[];t.perfTraceId&&Qe(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:n,rawCount:i.length}});let r=t.agentId||(s&&e.yeaftSessionAgentById?e.yeaftSessionAgentById[s]:null),o=r&&e.yeaftConversationIdsByAgent?e.yeaftConversationIdsByAgent[r]:null,a=t.conversationId||o||e.yeaftConversationId;if(!a){e.yeaftLoadingMoreHistory=!1;return}e.messagesMap[a]||(e.messagesMap[a]=[]);let{formatted:l,acceptedHistoryMessages:c}=Ua(i,s,n,e.messagesMap[a]),d=0;if(n==="recent")d=Rf(e.messagesMap[a],l,s??null);else if(l.length>0)if(n==="older"){if(e.messagesMap[a].splice(0,0,...l),d=l.length,typeof e.expandYeaftMessageWindow=="function"){let A=e.yeaftActiveSessionFilter?s??null:null;e.expandYeaftMessageWindow(A,t.turns||10)}}else d=fr(e.messagesMap[a],l);let u=qe(t.agentId||null,s),p=e.yeaftSessionHistoryState?.[u]||{},f=typeof t.latestSeq=="number"?t.latestSeq:p.latestSeq??null,g=n==="delta"?{...p,loaded:!0,loading:!1,latestSeq:f,syncingAfterSeq:null,count:(p.count||0)+d}:{loaded:!0,loading:!1,hasMore:!!t.hasMore,oldestSeq:typeof t.oldestSeq=="number"?t.oldestSeq:e.yeaftOldestLoadedSeq,count:n==="older"?(p.count||0)+d:c,latestSeq:f,syncingAfterSeq:null};e.yeaftSessionHistoryState&&(e.yeaftSessionHistoryState={...e.yeaftSessionHistoryState,[u]:g});let b=e.yeaftActiveSessionFilter??null,h=qe(t.agentId?e.currentAgent:null,b);if(t.perfTraceId&&(Qe(e,{traceId:t.perfTraceId,phase:"history.chunk_applied",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,detail:{mode:n,formattedCount:l.length,insertedRows:d,acceptedHistoryMessages:c}}),Pn(e,{traceId:t.perfTraceId,phase:"history.next_paint",agentId:t.agentId||null,sessionId:s||null,messageType:t.type,detail:{mode:n,insertedRows:d}})),u===h)e.yeaftHasMoreHistory=g.hasMore,typeof t.oldestSeq=="number"&&(e.yeaftOldestLoadedSeq=t.oldestSeq),e.yeaftLoadingMoreHistory=!1;else if(e.yeaftLoadingMoreHistory&&u!==h){let A=e.yeaftSessionHistoryState?.[h]||null;e.yeaftLoadingMoreHistory=!!A?.loading}}var _n=O(()=>{Nt();Ot();cr();xn();sr();bt();ur();pr()});function ja(e,t){if(e.promoteYeaftHistoryOutlineRow?.(t))return;let s=t?.sessionId??t?.groupId??e._currentYeaftSessionId??null;s&&e.invalidateYeaftHistoryOutline?.(s)}function Vf(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 mr(e,t){return e.executionStatusMap[t]||(e.executionStatusMap[t]={currentTool:null,toolHistory:[],lastActivity:null}),e.executionStatusMap[t]}function Ka(e,t,s){if(!t)return;let n=mr(e,t);if(n.lastActivity=Date.now(),Tn(e,t),s.type==="system"){if(s.subtype==="init"){let i=e.conversations.find(r=>r.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 r=e.messagesMap[t]||[];for(let o of r)o.type==="tool-use"&&!o.hasResult&&(o.hasResult=!0);for(let o of n.toolHistory)o.status==="running"&&(o.status="done");if(n.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 o of i)o.type==="text"?e.appendToAssistantMessageForConversation(t,o.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}):o.type==="image_asset"&&o.image?e.addMessageToConversation(t,{type:"chat-image",...o.image,sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,speakerVpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):o.type==="tool_summary"?e.addMessageToConversation(t,{type:"tool-summary",count:Number(o.count||o.omittedCount||0)||0,omittedCount:Number(o.omittedCount||o.count||0)||0,source:o.source||"history",isHistory:o.source!=="live",sessionId:e._currentYeaftSessionId||null,vpId:e._currentYeaftVpId||null,turnId:e._currentYeaftTurnId||null,threadId:e._currentYeaftThreadId||null}):o.type==="tool_use"&&(e.finishStreamingForConversation(t),n.currentTool={name:o.name,input:o.input,startTime:Date.now()},n.toolHistory.unshift({name:o.name,input:o.input,timestamp:Date.now(),status:"running"}),n.toolHistory.length>20&&n.toolHistory.pop(),e.addMessageToConversation(t,{type:"tool-use",toolId:o.id||o.tool_use_id||null,toolName:o.name,toolInput:o.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,r=s.message?.content,o=Vf(r);if(typeof o=="string"&&(o.includes("<local-command-caveat>")||o.includes("<command-name>")))return;if(typeof o=="string"&&o.includes("<local-command-stdout>")){let l=o.match(/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/);if(l){e.appendToAssistantMessageForConversation(t,l[1].trim()),e.finishStreamingForConversation(t);return}}let a=[];if(s.tool_use_result)a=Array.isArray(s.tool_use_result)?s.tool_use_result:[s.tool_use_result];else if(s.message?.content){let l=s.message.content;a=(Array.isArray(l)?l:[]).filter(d=>d.type==="tool_result")}if(a.length>0){let l=e.messagesMap[t]||[];for(let c of a){if(n.toolHistory.length>0){let f=n.toolHistory.findIndex(g=>g.status==="running");f>=0&&(n.toolHistory[f].status="done")}let d=c.tool_use_id||c.toolUseId||c.tool_call_id||c.toolCallId||null,u=c.content||c,p=!1;if(d){for(let f=l.length-1;f>=0;f--)if(l[f].type==="tool-use"&&l[f].toolId===d){l[f].hasResult=!0,l[f].toolResult=c.is_update&&l[f].toolResult?`${l[f].toolResult}
|
|
2
2
|
|
|
3
|
-
${u}`:u,p=!0;break}}if(!p){for(let f=l.length-1;f>=0;f--)if(l[f].type==="tool-use"&&!l[f].hasResult){l[f].hasResult=!0,l[f].toolResult=u;break}}}n.currentTool=null}else if(!i&&(typeof o=="string"&&o.trim()||Array.isArray(s.message?.attachments)&&s.message.attachments.length>0)){let l=s.message?.clientMessageId||s.clientMessageId||null,c={type:"user",content:o,clientMessageId:l},d=e.messagesMap[t]||[];if(d.some(p=>Mn(p,c))){if(l){for(let p=d.length-1;p>=0;p--)if(d[p].type==="user"&&d[p].clientMessageId===l){s.dbMessageId&&!d[p].dbMessageId&&(d[p].dbMessageId=s.dbMessageId),s.message?.id&&!d[p].messageId&&(d[p].id=s.message.id,d[p].messageId=s.message.id),s.ts&&!d[p].ts&&(d[p].ts=s.ts),ja(e,d[p]);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:o,...s.message?.attachments?{attachments:s.message.attachments}:{},...l?{clientMessageId:l}:{}});ja(e,p)}}}else if(s.type==="result"){delete e.processingConversations[t],ke(e,t);let i=e.conversations.find(c=>c.id===t);i&&i.connecting&&(i.connecting=!1);let r=e._currentYeaftSessionId||null;if(e._currentYeaftTurnId&&e.activeVpTurns[e._currentYeaftTurnId]){let{[e._currentYeaftTurnId]:c,...d}=e.activeVpTurns;!r&&c?.sessionId&&(r=c.sessionId),e.activeVpTurns=d}if(r&&e._currentYeaftVpId&&e.vpStatuses){let c=e._currentYeaftTurnId||null,d={...e.vpStatuses||{}},u=!1;for(let[p,f]of Object.entries(d))!f||f.vpId!==e._currentYeaftVpId||(f.sessionId||f.groupId||null)!==r||c&&f.turnId&&f.turnId!==c||(d[p]={...f,state:"idle",turnId:null,since:Date.now()},u=!0);u&&(e.vpStatuses=d)}r&&typeof e.clearYeaftSessionProcessingIfIdle=="function"&&e.clearYeaftSessionProcessingIfIdle(r),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(t),n.currentTool=null,xt(e,t);let o=e.messagesMap[t]||[],a=s.result_text||"";if(typeof a=="string"&&a.trim()){let c=!1;for(let d=o.length-1;d>=0;d--){if(o[d].type==="assistant"){c=!0;break}if(o[d].type==="user")break}c||e.appendToAssistantMessageForConversation(t,a.trim())}e.finishStreamingForConversation(t),!e.promoteCompletedYeaftHistoryOutline?.(t,e._currentYeaftTurnId||null)&&r&&e.invalidateYeaftHistoryOutline?.(r),e.sweepStaleStreamingForConversation(t)}}var Ga=O(()=>{Nt();_n();cr()});function Bt(e){if(e==null)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function En(e,t){if(!t)return e??null;if(Object.prototype.hasOwnProperty.call(t,"base"))return Bt(t.base)??null;if(Object.prototype.hasOwnProperty.call(t,"replacement"))return Bt(t.replacement)??null;let s=e&&typeof e=="object"&&!Array.isArray(e)?Bt(e):{};if(t.set&&typeof t.set=="object")for(let[n,i]of Object.entries(t.set))s[n]=Bt(i);if(t.body&&typeof t.body=="object"){let n=s.body&&typeof s.body=="object"&&!Array.isArray(s.body)?{...s.body}:{};for(let[r,o]of Object.entries(t.body))r==="messages"||r==="messagesFrom"||r==="messagesAppend"||r==="messagesKey"||(n[r]=Bt(o));let i=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[i]=Bt(t.body.messages)||[];else if(Array.isArray(t.body.messagesAppend)){let r=Array.isArray(n[i])?n[i]:[],o=Number.isFinite(Number(t.body.messagesFrom))?Number(t.body.messagesFrom):r.length;n[i]=r.slice(0,o).concat(Bt(t.body.messagesAppend)||[])}s.body=n}return s}function Ya(e,t){return!t||!Object.prototype.hasOwnProperty.call(t,"rawRequestDelta")?e??null:En(e??null,t.rawRequestDelta)}function zs(e){if(!e)return 0;let t=typeof e=="string"?e:String(e),s=0,n=0;for(let i of t){let r=i.codePointAt(0)||0;r>=19968&&r<=40959||r>=12352&&r<=12447||r>=12448&&r<=12543||r>=44032&&r<=55215?s+=1:n+=1}return Math.ceil(s+n/4)}function Ff(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 i of n){if(!i||typeof i!="object")continue;let r=i.type;if(r==="text"&&typeof i.text=="string")t.push(i.text);else if(r==="tool_use"){if(s.push(String(i.name||"")),i.input!==void 0)try{s.push(JSON.stringify(i.input))}catch{}}else if(r==="tool_result"){let o=i.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(i))}catch{}}if(Array.isArray(e.toolCalls)){for(let i of e.toolCalls)if(i&&(s.push(String(i.name||"")),i.input!==void 0))try{s.push(JSON.stringify(i.input))}catch{}}return{messageText:t,toolText:s}}function Qa(e){let t=0,s=0;if(e&&Array.isArray(e.messages))for(let r of e.messages){let{messageText:o,toolText:a}=Ff(r);for(let l of o)t+=zs(l);for(let l of a)s+=zs(l)}let n=0,i=0;if(e&&typeof e.response=="string"&&(n+=zs(e.response)),e&&Array.isArray(e.toolCalls)){for(let r of e.toolCalls)if(r&&(i+=zs(String(r.name||"")),r.input!==void 0))try{i+=zs(JSON.stringify(r.input))}catch{}}return{inputMessageTokens:t,inputToolTokens:s,outputMessageTokens:n,outputToolTokens:i,inputTotalEstimated:t+s,outputTotalEstimated:n+i}}function hr(e,t,s){let n=Math.max(0,Math.floor(Number(e)||0)),i=Math.max(0,Number(t)||0),r=Math.max(0,Number(s)||0),o=i+r;if(n===0)return{message:0,tool:0};if(o===0)return{message:n,tool:0};let a=Math.round(i/o*n),l=Math.min(n,Math.max(0,a));return{message:l,tool:n-l}}function Xa(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"),i=String(s.getMinutes()).padStart(2,"0"),r=String(s.getSeconds()).padStart(2,"0");return`${n}:${i}:${r}`}var vr=O(()=>{});function Of(e,t){if(!e||!!!t?.online)return!1;let n=!e.online,i=e.online&&e.version!=null&&t.version!=null&&e.version!==t.version;return n||i}function Za(e,t){let s=e.lastViewedConversation||localStorage.getItem("lastViewedConversation");if(!s)return!1;let n=e.conversations.find(r=>r.id===s);if(!n)return!1;let i=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.sendWsMessage({type:"sync_messages",conversationId:s,turns:5}),e.sendWsMessage({type:"refresh_conversation",conversationId:s}),!0}function Ja(e,t){let s=Array.isArray(e.agents)?e.agents:[],n=e._hasHandledAgentList===!0,i=e.currentAgent||null,r=!!(i&&s.some(a=>a&&a.id===i&&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"&&Of(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(p=>p.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 p=e._recentlyDeletedSessions?.[d.id];if(p&&Date.now()-p<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],ke(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&&!Ht(e,d.id)&&!e._turnCompletedConvs?.has(d.id))e.processingConversations[d.id]=!0;else if(e.processingConversations[d.id]){delete e.processingConversations[d.id],ke(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],ke(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&&!r;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(f=>f.id===e.currentConversation);e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation});let p=e.messagesMap[e.currentConversation]||[];if(p.length>0){let f=p[p.length-1]?.id;e.sendWsMessage({type:"sync_messages",conversationId:e.currentConversation,afterMessageId:f})}else e.sendWsMessage({type:"sync_messages",conversationId:e.currentConversation,turns:5});e.sendWsMessage({type:"refresh_conversation",conversationId:e.currentConversation})}else e.recoveryDismissed||Za(e);return}else{let l=`${e.currentAgent||""}:${e.currentConversation||""}`;e.currentConversation&&(!n||r||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){Za(e,{agentId:c.agentId,agentInfo:d});return}}}l&&(e.agents.find(d=>d.id===l&&d.online)?e.selectAgent(l):e.checkPendingRecovery())}}function el(e,t){e.agentSwitching=!1;let s=e.currentAgent===t.agentId,n={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,n):(e.currentAgent=t.agentId,e.currentAgentInfo=n),Array.isArray(t.slashCommands)){let d=[...new Set(t.slashCommands)];e.slashCommandsMap[`agent:${t.agentId}`]=d}t.slashCommandDescriptions&&(e.slashCommandDescriptions={...e.slashCommandDescriptions,...t.slashCommandDescriptions});let i=t.conversations||[],r=new Set,o=i.filter(d=>r.has(d.id)?!1:(r.add(d.id),!0)).map(d=>({...d,agentId:t.agentId,agentName:t.agentName}));if(s&&e.currentConversation){let d=i.find(u=>u.id===e.currentConversation);d&&!o.find(u=>u.id===d.id)&&o.push({...d,agentId:t.agentId,agentName:t.agentName})}let a=new Set(o.map(d=>d.id)),l=e.conversations.filter(d=>!a.has(d.id));e.conversations=[...l,...o];for(let d of i)d.title&&(d.customTitle&&(e.customConversationTitles[d.id]=d.title),e.conversationTitles[d.id]||(e.conversationTitles[d.id]=d.title));let c=new Set(i.map(d=>d.id));for(let d of i)if(d.processing&&!Ht(e,d.id)&&!e._turnCompletedConvs?.has(d.id))e.processingConversations[d.id]=!0;else if(e.processingConversations[d.id]){delete e.processingConversations[d.id],ke(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(!c.has(d)){if(d.startsWith("yeaft-"))continue;if(!l.some(p=>p.id===d)){delete e.processingConversations[d],ke(e,d);let p=e.executionStatusMap[d];p&&(p.currentTool=null),e.finishStreamingForConversation(d)}}if(s&&e.currentConversation){let d=e.conversations.find(u=>u.id===e.currentConversation);e.currentWorkDir=d?.workDir||e.currentWorkDir||t.workDir,pt(e),e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation})}else{e.activeConversations=[],e.currentWorkDir=t.workDir;let d=e.lastViewedConversation||localStorage.getItem("lastViewedConversation");d&&e.conversations.find(u=>u.id===d)&&(e.autoRestoreConversation(d),e.pendingRecovery=null)}Xo(e)}var tl=O(()=>{Nt();Ot()});function Hf(e={}){return{providers:e.providers||[],primaryModel:e.primaryModel||null,fastModel:e.fastModel||null,language:e.language||"en"}}function qf(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 i={systemPrompt:t.systemPrompt||"",messages:Array.isArray(t.messages)?t.messages:[],rawRequest:null};return Object.prototype.hasOwnProperty.call(t,"rawRequestDelta")&&(i.rawRequest=En(null,t.rawRequestDelta)),i}if(typeof t?.systemPrompt=="string"&&(n.systemPrompt=t.systemPrompt),Array.isArray(t?.messages))n.messages=t.messages;else if(Array.isArray(t?.messagesAppend)){let i=Number.isFinite(Number(t.messagesFrom))?Number(t.messagesFrom):n.messages.length;n.messages=n.messages.slice(0,i).concat(t.messagesAppend)}return Object.prototype.hasOwnProperty.call(t||{},"rawRequestDelta")&&(n.rawRequest=En(n.rawRequest,t.rawRequestDelta)),n}function Wf(e=[]){let t=new Map;return e.map(s=>{if(!s||!s.requestDelta)return s;let n=s.turnId||"__unknown__",i=t.get(n)||s.requestBase||null,r=i?.rawRequest??null,o=qf(i,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:r}})}function sl(e,t){let s=Ae();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){e.authenticated=!0,t.sessionKey&&(e.sessionKey=lt(t.sessionKey),s.setSessionKey(t.sessionKey)),t.acceptPlaintext===!0&&(e.serverEncryptionRequired=!1),t.role&&(s.role=t.role);let n=e.conversations.map(i=>i.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||xe("login.error.loginFailed")}),s.handleAuthFailure?.(void 0,t._wsAuthToken,t._wsAuthGeneration);break;case"agent_list":Ja(e,t),e.workCenterOpen&&e.workCenterAgentId&&e.listWorkItems(e.workCenterAgentId).catch(()=>{});break;case"yeaft_session_hydrate":{let n=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();n&&n.applySnapshot(t.sessions||[],t.agentId||null);break}case"agent_selected":el(e,t),e.workCenterOpen&&e.workCenterAgentId&&e.listWorkItems(e.workCenterAgentId).catch(()=>{});break;case"conversation_created":$a(e,t);break;case"conversation_resumed":Va(e,t);break;case"conversation_selected":if(e.currentConversation===t.conversationId)return;e.activeConversations=[t.conversationId];{let n=e.conversations.find(i=>i.id===t.conversationId);n&&(e.currentWorkDir=n.workDir)}e.messagesMap[t.conversationId]=[],e.saveOpenSessions();break;case"conversation_settings_updated":{let n=e.conversations.find(r=>r.id===t.conversationId);n&&t.disallowedTools!==void 0&&(n.disallowedTools=t.disallowedTools);let i=e.conversationMcpServers[t.conversationId];if(i&&t.disallowedTools){let r=new Set(t.disallowedTools),o=e.conversationMcpServerTools[t.conversationId]||{};for(let a of i){let l=o[a.name];l&&l.length>0?a.enabled=!l.some(c=>r.has(c)):a.enabled=!r.has(`mcp__${a.name}`)}}t.needRestart&&n&&(n.needRestart=!0);break}case"sync_messages_result":qa(e,t);break;case"conversation_deleted":Fa(e,t);break;case"turn_completed":Oa(e,t);break;case"conversation_closed":Ha(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.yeaftConversationId;if(!n||!t.image)break;e.messagesMap[n]||(e.messagesMap[n]=[]),e.messagesMap[n].some(r=>r?.type==="chat-image"&&r.assetId===t.image.assetId&&r.sessionId===t.sessionId&&r.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":za(e,t);break;case"yeaft_history_outline":e.handleYeaftHistoryOutline(t);break;case"yeaft_history_search_result":e.handleYeaftHistorySearchResult(t);break;case"yeaft_history_window":{let n=Wa(e,t);e.handleYeaftHistoryWindow(t,n);break}case"yeaft_tool_stats":{e._fetchYeaftToolStatsTimer&&(clearTimeout(e._fetchYeaftToolStatsTimer),e._fetchYeaftToolStatsTimer=null);let n=t?.snapshot,i=n&&typeof n=="object"&&!Array.isArray(n)?n:{};e.yeaftToolStats={snapshot:i,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:"",i=typeof t?.detailTurnId=="string"&&t.detailTurnId;if(n&&!i&&n!==e._yeaftDebugHistoryLatestListRequestId)break;e._fetchYeaftDebugHistoryTimer&&(clearTimeout(e._fetchYeaftDebugHistoryTimer),e._fetchYeaftDebugHistoryTimer=null),e._yeaftDebugHistoryInFlightKey=null;let r=Array.isArray(t?.turns)?t.turns:[],o=t?.search?Bf:Nf,a=i?r:r.slice(-o),l=new Set(a.map(m=>m?.turnId).filter(Boolean)),c=Wf(Array.isArray(t?.loops)?t.loops:[]),d=i?c:c.filter(m=>!m?.turnId||l.has(m.turnId)),u=Array.isArray(t?.dreamEvents)?t.dreamEvents:[];e.yeaftDebugHistoryHasMore=!!t?.hasMore||!i&&r.length>a.length,!t?.detailTurnId&&Number.isFinite(t?.limit)&&t.limit>0&&(e.yeaftDebugHistoryLimit=Math.min(o,t.limit)),(!e.yeaftDebugTurnsById||typeof e.yeaftDebugTurnsById!="object")&&(e.yeaftDebugTurnsById={}),Array.isArray(e.yeaftDebugLoops)||(e.yeaftDebugLoops=[]),Array.isArray(e.yeaftDebugTurnOrder)||(e.yeaftDebugTurnOrder=[]);let p=i?{...e.yeaftDebugTurnsById}:{};for(let m of a){let w=m?.turnId;if(!w)continue;let E=p[w];if(E){let R=m?.detailsLoaded?{...E,...m}:{...m,...E};R.memoryLoaded==null&&E.memoryLoaded!=null&&(R.memoryLoaded=E.memoryLoaded),R.memoryAdjust==null&&E.memoryAdjust!=null&&(R.memoryAdjust=E.memoryAdjust),p[w]=R}else p[w]=m}e.yeaftDebugTurnsById=p;let f=m=>m?.loopInstanceId||`${m?.turnId||""}#${m?.loopNumber||0}`,g=e.yeaftDebugLoops,v=new Map;for(let m of g)m&&v.set(f(m),m);let y=new Set,A=[];for(let m of d){if(!m)continue;let w=f(m);y.add(w),A.push(v.get(w)||m)}if(i)for(let m of g)!m||y.has(f(m))||A.push(m);e.yeaftDebugLoops=A;let x=new Set,k=[],b=m=>{!m||x.has(m)||(x.add(m),k.push(m))};if(i){for(let m of e.yeaftDebugTurnOrder)b(m);for(let m of a)b(m?.turnId)}else for(let m of a)b(m?.turnId);e.yeaftDebugTurnOrder=i?k:k.slice(-o);for(let m of u){if(!m)continue;let w=null,E=m.sessionId||m.groupId;typeof m.target=="string"&&m.target.includes("/")?w=m.target:typeof E=="string"&&E?w=`group/${E}`:w="*",typeof e._appendDreamEvent=="function"&&e._appendDreamEvent(w,m),m.type==="dream_progress"&&typeof e.handleYeaftOutput=="function"&&e.handleYeaftOutput({event:m})}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,i=["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"))&&pt(e),["No conversation selected","Agent is still syncing","No agent available"].some(c=>t.message?.includes(c))&&n&&(delete e.processingConversations[n],ke(e,n),e.finishStreamingForConversation(n)),i&&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 p=e.messagesMap[n];if(p){let f=p.findIndex(g=>g.id===u.id);f>=0&&p.splice(f,1)}},5e3));return}break}}}let o=Date.now().toString()+Math.random().toString(36).substr(2,9),a={type:"error",content:t.message,transient:i,dbMessageId:i?"err_"+o:void 0};i&&(a._sysErrBaseContent=t.message,a._sysErrCount=1,a._sysErrFirstAt=Date.now()),e.addMessageToConversation(n,a);let l=null;if(i&&n){let c=e.messagesMap[n];c&&c.length>0&&(l=c[c.length-1])}if(i&&n&&l){let c=n,d="err_"+o;l._sysErrRemoveTimer=setTimeout(()=>{let u=e.messagesMap[c];if(u){let p=u.findIndex(f=>f.id===d);p>=0&&u.splice(p,1)}},5e3)}!i&&n&&(delete e.processingConversations[n],ke(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":Na(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 i=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();i&&typeof i.applyPinState=="function"&&i.applyPinState(t.conversationId,!!t.pinned,t.agentId||e.yeaftSessionAgentById?.[t.conversationId]||e.currentAgent||null)}catch{}}break;case"execution_cancelled":Ba(e,t);break;case"slash_commands_update":if(Array.isArray(t.slashCommands)){let n=[...new Set(t.slashCommands)];if(t.commandSet==="yeaft"){let i=t.conversationId&&t.conversationId!=="__preload__"?t.conversationId:null,r=t.agentId&&e.yeaftConversationIdsByAgent?.[t.agentId]||null,o=i||r;o&&(e.slashCommandsMap[o]=n);let a=e.yeaftConversationId||null,l=t.agentId?e.currentAgent===t.agentId&&(r===a||i===a):i===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"){ke(e,n),Da(e,n);break}if(t.status==="ok")e.sessionHealth?.[n]&&delete e.sessionHealth[n],!t.isProcessing&&e.processingConversations[n]&&(delete e.processingConversations[n],ke(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 i=e.conversations.find(r=>r.id===n);e.sendWsMessage({type:"refresh_conversation",conversationId:n,agentId:i?.agentId})}delete e.processingConversations[n],ke(e,n),e.finishStreamingForConversation(n)}break}case"ask_user_question":if(t.conversationId){let n=()=>{let i=e.messagesMap[t.conversationId]||[];for(let r=i.length-1;r>=0;r--)if(i[r].type==="tool-use"&&i[r].toolName==="AskUserQuestion"&&!i[r].askRequestId)return i[r].askRequestId=t.requestId,i[r].askQuestions=t.questions,!0;return!1};if(!n()){let i=0,r=setInterval(()=>{i++,(n()||i>=10)&&clearInterval(r)},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||Hf(t),i=t.effectiveConfig||n;e.llmConfig[t.agentId]={providers:t.providers||i.providers||[],primaryModel:t.primaryModel||i.primaryModel||null,fastModel:t.fastModel||i.fastModel||null,language:t.language||n.language||i.language||"en",needsSetup:t.needsSetup??i.needsSetup??!1,agentConfig:n,effectiveConfig:i,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 i of n.resolvers)i(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 i=e._searchPending,r=t.type==="search_settings"?"load":"update";i&&i[r]&&(i[r](n),delete i[r]);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 i=e._searchPending;i&&i.usage&&(i.usage(n),delete i.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 Nf,Bf,nl=O(()=>{ct();Cn();bt();Nt();Ot();vr();tl();_n();Nf=1,Bf=5});function rl(){return Object.values(il).sort((t,s)=>t.order-s.order).map(t=>({teamId:t.id,team:t,roles:Object.values(dt).filter(s=>s.group===t.id)}))}function ol(e){let t=[];for(let s of Object.values(dt)){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 qt(e,t){let s=dt[e.role];if(s){if(e.action){let n=s.actions.find(i=>i.id===e.action);return n?`${s.name}\xB7${n.name}`:s.name}return s.name}if(t){let n=t.find(i=>i.id===e.role);if(n){if(e.action){let i=n.actions?.find(r=>r.id===e.action);return i?`${n.name}\xB7${i.name}`:n.name}return n.name}}return e.role}function yr(e,t,s,n="zh-CN"){if(!e||e.length===0||!t||t.length===0)return null;let i=n==="zh-CN";if(!e.some(l=>!dt[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(p=>p.id===l);if(!d)return null;let u;if(c&&d.actions){let p=d.actions.find(f=>f.id===c);p?s?(u=(i?p.messageTemplate:p.messageTemplateEn)||"",u+=s):u=(i?p.defaultMessage:p.defaultMessageEn)||"":u=((i?d.messagePrefix:d.messagePrefixEn)||"")+(s||"")}else u=((i?d.messagePrefix:d.messagePrefixEn)||"")+(s||"");return{effectivePrompt:u}}let o=[];for(let{role:l,action:c}of e){let d=t.find(p=>p.id===l),u=dt[l];if(d)if(c){let p=d.actions?.find(f=>f.id===c);p&&o.push((i?p.messageTemplate:p.messageTemplateEn)||"")}else o.push((i?d.messagePrefix:d.messagePrefixEn)||"");else if(u)return null}return o.length===0?null:{effectivePrompt:o.join(`
|
|
3
|
+
${u}`:u,p=!0;break}}if(!p){for(let f=l.length-1;f>=0;f--)if(l[f].type==="tool-use"&&!l[f].hasResult){l[f].hasResult=!0,l[f].toolResult=u;break}}}n.currentTool=null}else if(!i&&(typeof o=="string"&&o.trim()||Array.isArray(s.message?.attachments)&&s.message.attachments.length>0)){let l=s.message?.clientMessageId||s.clientMessageId||null,c={type:"user",content:o,clientMessageId:l},d=e.messagesMap[t]||[];if(d.some(p=>Mn(p,c))){if(l){for(let p=d.length-1;p>=0;p--)if(d[p].type==="user"&&d[p].clientMessageId===l){s.dbMessageId&&!d[p].dbMessageId&&(d[p].dbMessageId=s.dbMessageId),s.message?.id&&!d[p].messageId&&(d[p].id=s.message.id,d[p].messageId=s.message.id),s.ts&&!d[p].ts&&(d[p].ts=s.ts),ja(e,d[p]);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:o,...s.message?.attachments?{attachments:s.message.attachments}:{},...l?{clientMessageId:l}:{}});ja(e,p)}}}else if(s.type==="result"){delete e.processingConversations[t],ke(e,t);let i=e.conversations.find(c=>c.id===t);i&&i.connecting&&(i.connecting=!1);let r=e._currentYeaftSessionId||null;if(e._currentYeaftTurnId&&e.activeVpTurns[e._currentYeaftTurnId]){let{[e._currentYeaftTurnId]:c,...d}=e.activeVpTurns;!r&&c?.sessionId&&(r=c.sessionId),e.activeVpTurns=d}if(r&&e._currentYeaftVpId&&e.vpStatuses){let c=e._currentYeaftTurnId||null,d={...e.vpStatuses||{}},u=!1;for(let[p,f]of Object.entries(d))!f||f.vpId!==e._currentYeaftVpId||(f.sessionId||f.groupId||null)!==r||c&&f.turnId&&f.turnId!==c||(d[p]={...f,state:"idle",turnId:null,since:Date.now()},u=!0);u&&(e.vpStatuses=d)}r&&typeof e.clearYeaftSessionProcessingIfIdle=="function"&&e.clearYeaftSessionProcessingIfIdle(r),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now(),e._turnCompletedConvs||(e._turnCompletedConvs=new Set),e._turnCompletedConvs.add(t),n.currentTool=null,xt(e,t);let o=e.messagesMap[t]||[],a=s.result_text||"";if(typeof a=="string"&&a.trim()){let c=!1;for(let d=o.length-1;d>=0;d--){if(o[d].type==="assistant"){c=!0;break}if(o[d].type==="user")break}c||e.appendToAssistantMessageForConversation(t,a.trim())}e.finishStreamingForConversation(t),!e.promoteCompletedYeaftHistoryOutline?.(t,e._currentYeaftTurnId||null)&&r&&e.invalidateYeaftHistoryOutline?.(r),e.sweepStaleStreamingForConversation(t)}}var Ga=O(()=>{Nt();_n();cr()});function Bt(e){if(e==null)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function En(e,t){if(!t)return e??null;if(Object.prototype.hasOwnProperty.call(t,"base"))return Bt(t.base)??null;if(Object.prototype.hasOwnProperty.call(t,"replacement"))return Bt(t.replacement)??null;let s=e&&typeof e=="object"&&!Array.isArray(e)?Bt(e):{};if(t.set&&typeof t.set=="object")for(let[n,i]of Object.entries(t.set))s[n]=Bt(i);if(t.body&&typeof t.body=="object"){let n=s.body&&typeof s.body=="object"&&!Array.isArray(s.body)?{...s.body}:{};for(let[r,o]of Object.entries(t.body))r==="messages"||r==="messagesFrom"||r==="messagesAppend"||r==="messagesKey"||(n[r]=Bt(o));let i=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[i]=Bt(t.body.messages)||[];else if(Array.isArray(t.body.messagesAppend)){let r=Array.isArray(n[i])?n[i]:[],o=Number.isFinite(Number(t.body.messagesFrom))?Number(t.body.messagesFrom):r.length;n[i]=r.slice(0,o).concat(Bt(t.body.messagesAppend)||[])}s.body=n}return s}function Ya(e,t){return!t||!Object.prototype.hasOwnProperty.call(t,"rawRequestDelta")?e??null:En(e??null,t.rawRequestDelta)}function zs(e){if(!e)return 0;let t=typeof e=="string"?e:String(e),s=0,n=0;for(let i of t){let r=i.codePointAt(0)||0;r>=19968&&r<=40959||r>=12352&&r<=12447||r>=12448&&r<=12543||r>=44032&&r<=55215?s+=1:n+=1}return Math.ceil(s+n/4)}function Of(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 i of n){if(!i||typeof i!="object")continue;let r=i.type;if(r==="text"&&typeof i.text=="string")t.push(i.text);else if(r==="tool_use"){if(s.push(String(i.name||"")),i.input!==void 0)try{s.push(JSON.stringify(i.input))}catch{}}else if(r==="tool_result"){let o=i.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(i))}catch{}}if(Array.isArray(e.toolCalls)){for(let i of e.toolCalls)if(i&&(s.push(String(i.name||"")),i.input!==void 0))try{s.push(JSON.stringify(i.input))}catch{}}return{messageText:t,toolText:s}}function Qa(e){let t=0,s=0;if(e&&Array.isArray(e.messages))for(let r of e.messages){let{messageText:o,toolText:a}=Of(r);for(let l of o)t+=zs(l);for(let l of a)s+=zs(l)}let n=0,i=0;if(e&&typeof e.response=="string"&&(n+=zs(e.response)),e&&Array.isArray(e.toolCalls)){for(let r of e.toolCalls)if(r&&(i+=zs(String(r.name||"")),r.input!==void 0))try{i+=zs(JSON.stringify(r.input))}catch{}}return{inputMessageTokens:t,inputToolTokens:s,outputMessageTokens:n,outputToolTokens:i,inputTotalEstimated:t+s,outputTotalEstimated:n+i}}function hr(e,t,s){let n=Math.max(0,Math.floor(Number(e)||0)),i=Math.max(0,Number(t)||0),r=Math.max(0,Number(s)||0),o=i+r;if(n===0)return{message:0,tool:0};if(o===0)return{message:n,tool:0};let a=Math.round(i/o*n),l=Math.min(n,Math.max(0,a));return{message:l,tool:n-l}}function Xa(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"),i=String(s.getMinutes()).padStart(2,"0"),r=String(s.getSeconds()).padStart(2,"0");return`${n}:${i}:${r}`}var vr=O(()=>{});function Hf(e,t){if(!e||!!!t?.online)return!1;let n=!e.online,i=e.online&&e.version!=null&&t.version!=null&&e.version!==t.version;return n||i}function Za(e,t){let s=e.lastViewedConversation||localStorage.getItem("lastViewedConversation");if(!s)return!1;let n=e.conversations.find(r=>r.id===s);if(!n)return!1;let i=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.sendWsMessage({type:"sync_messages",conversationId:s,turns:5}),e.sendWsMessage({type:"refresh_conversation",conversationId:s}),!0}function Ja(e,t){let s=Array.isArray(e.agents)?e.agents:[],n=e._hasHandledAgentList===!0,i=e.currentAgent||null,r=!!(i&&s.some(a=>a&&a.id===i&&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"&&Hf(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(p=>p.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 p=e._recentlyDeletedSessions?.[d.id];if(p&&Date.now()-p<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],ke(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&&!Ht(e,d.id)&&!e._turnCompletedConvs?.has(d.id))e.processingConversations[d.id]=!0;else if(e.processingConversations[d.id]){delete e.processingConversations[d.id],ke(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],ke(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&&!r;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(f=>f.id===e.currentConversation);e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation});let p=e.messagesMap[e.currentConversation]||[];if(p.length>0){let f=p[p.length-1]?.id;e.sendWsMessage({type:"sync_messages",conversationId:e.currentConversation,afterMessageId:f})}else e.sendWsMessage({type:"sync_messages",conversationId:e.currentConversation,turns:5});e.sendWsMessage({type:"refresh_conversation",conversationId:e.currentConversation})}else e.recoveryDismissed||Za(e);return}else{let l=`${e.currentAgent||""}:${e.currentConversation||""}`;e.currentConversation&&(!n||r||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){Za(e,{agentId:c.agentId,agentInfo:d});return}}}l&&(e.agents.find(d=>d.id===l&&d.online)?e.selectAgent(l):e.checkPendingRecovery())}}function el(e,t){e.agentSwitching=!1;let s=e.currentAgent===t.agentId,n={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,n):(e.currentAgent=t.agentId,e.currentAgentInfo=n),Array.isArray(t.slashCommands)){let d=[...new Set(t.slashCommands)];e.slashCommandsMap[`agent:${t.agentId}`]=d}t.slashCommandDescriptions&&(e.slashCommandDescriptions={...e.slashCommandDescriptions,...t.slashCommandDescriptions});let i=t.conversations||[],r=new Set,o=i.filter(d=>r.has(d.id)?!1:(r.add(d.id),!0)).map(d=>({...d,agentId:t.agentId,agentName:t.agentName}));if(s&&e.currentConversation){let d=i.find(u=>u.id===e.currentConversation);d&&!o.find(u=>u.id===d.id)&&o.push({...d,agentId:t.agentId,agentName:t.agentName})}let a=new Set(o.map(d=>d.id)),l=e.conversations.filter(d=>!a.has(d.id));e.conversations=[...l,...o];for(let d of i)d.title&&(d.customTitle&&(e.customConversationTitles[d.id]=d.title),e.conversationTitles[d.id]||(e.conversationTitles[d.id]=d.title));let c=new Set(i.map(d=>d.id));for(let d of i)if(d.processing&&!Ht(e,d.id)&&!e._turnCompletedConvs?.has(d.id))e.processingConversations[d.id]=!0;else if(e.processingConversations[d.id]){delete e.processingConversations[d.id],ke(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(!c.has(d)){if(d.startsWith("yeaft-"))continue;if(!l.some(p=>p.id===d)){delete e.processingConversations[d],ke(e,d);let p=e.executionStatusMap[d];p&&(p.currentTool=null),e.finishStreamingForConversation(d)}}if(s&&e.currentConversation){let d=e.conversations.find(u=>u.id===e.currentConversation);e.currentWorkDir=d?.workDir||e.currentWorkDir||t.workDir,pt(e),e.sendWsMessage({type:"select_conversation",conversationId:e.currentConversation})}else{e.activeConversations=[],e.currentWorkDir=t.workDir;let d=e.lastViewedConversation||localStorage.getItem("lastViewedConversation");d&&e.conversations.find(u=>u.id===d)&&(e.autoRestoreConversation(d),e.pendingRecovery=null)}Xo(e)}var tl=O(()=>{Nt();Ot()});function Nf(e={}){return{providers:e.providers||[],primaryModel:e.primaryModel||null,fastModel:e.fastModel||null,language:e.language||"en"}}function Wf(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 i={systemPrompt:t.systemPrompt||"",messages:Array.isArray(t.messages)?t.messages:[],rawRequest:null};return Object.prototype.hasOwnProperty.call(t,"rawRequestDelta")&&(i.rawRequest=En(null,t.rawRequestDelta)),i}if(typeof t?.systemPrompt=="string"&&(n.systemPrompt=t.systemPrompt),Array.isArray(t?.messages))n.messages=t.messages;else if(Array.isArray(t?.messagesAppend)){let i=Number.isFinite(Number(t.messagesFrom))?Number(t.messagesFrom):n.messages.length;n.messages=n.messages.slice(0,i).concat(t.messagesAppend)}return Object.prototype.hasOwnProperty.call(t||{},"rawRequestDelta")&&(n.rawRequest=En(n.rawRequest,t.rawRequestDelta)),n}function Uf(e=[]){let t=new Map;return e.map(s=>{if(!s||!s.requestDelta)return s;let n=s.turnId||"__unknown__",i=t.get(n)||s.requestBase||null,r=i?.rawRequest??null,o=Wf(i,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:r}})}function sl(e,t){let s=Ae();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){e.authenticated=!0,t.sessionKey&&(e.sessionKey=lt(t.sessionKey),s.setSessionKey(t.sessionKey)),t.acceptPlaintext===!0&&(e.serverEncryptionRequired=!1),t.role&&(s.role=t.role);let n=e.conversations.map(i=>i.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||xe("login.error.loginFailed")}),s.handleAuthFailure?.(void 0,t._wsAuthToken,t._wsAuthGeneration);break;case"agent_list":Ja(e,t),e.workCenterOpen&&e.workCenterAgentId&&e.listWorkItems(e.workCenterAgentId).catch(()=>{});break;case"yeaft_session_hydrate":{let n=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();n&&n.applySnapshot(t.sessions||[],t.agentId||null);break}case"agent_selected":el(e,t),e.workCenterOpen&&e.workCenterAgentId&&e.listWorkItems(e.workCenterAgentId).catch(()=>{});break;case"conversation_created":$a(e,t);break;case"conversation_resumed":Va(e,t);break;case"conversation_selected":if(e.currentConversation===t.conversationId)return;e.activeConversations=[t.conversationId];{let n=e.conversations.find(i=>i.id===t.conversationId);n&&(e.currentWorkDir=n.workDir)}e.messagesMap[t.conversationId]=[],e.saveOpenSessions();break;case"conversation_settings_updated":{let n=e.conversations.find(r=>r.id===t.conversationId);n&&t.disallowedTools!==void 0&&(n.disallowedTools=t.disallowedTools);let i=e.conversationMcpServers[t.conversationId];if(i&&t.disallowedTools){let r=new Set(t.disallowedTools),o=e.conversationMcpServerTools[t.conversationId]||{};for(let a of i){let l=o[a.name];l&&l.length>0?a.enabled=!l.some(c=>r.has(c)):a.enabled=!r.has(`mcp__${a.name}`)}}t.needRestart&&n&&(n.needRestart=!0);break}case"sync_messages_result":qa(e,t);break;case"conversation_deleted":Fa(e,t);break;case"turn_completed":Oa(e,t);break;case"conversation_closed":Ha(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.yeaftConversationId;if(!n||!t.image)break;e.messagesMap[n]||(e.messagesMap[n]=[]),e.messagesMap[n].some(r=>r?.type==="chat-image"&&r.assetId===t.image.assetId&&r.sessionId===t.sessionId&&r.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":za(e,t);break;case"yeaft_history_outline":e.handleYeaftHistoryOutline(t);break;case"yeaft_history_search_result":e.handleYeaftHistorySearchResult(t);break;case"yeaft_history_window":{let n=Wa(e,t);e.handleYeaftHistoryWindow(t,n);break}case"yeaft_tool_stats":{e._fetchYeaftToolStatsTimer&&(clearTimeout(e._fetchYeaftToolStatsTimer),e._fetchYeaftToolStatsTimer=null);let n=t?.snapshot,i=n&&typeof n=="object"&&!Array.isArray(n)?n:{};e.yeaftToolStats={snapshot:i,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:"",i=typeof t?.detailTurnId=="string"&&t.detailTurnId;if(n&&!i&&n!==e._yeaftDebugHistoryLatestListRequestId)break;e._fetchYeaftDebugHistoryTimer&&(clearTimeout(e._fetchYeaftDebugHistoryTimer),e._fetchYeaftDebugHistoryTimer=null),e._yeaftDebugHistoryInFlightKey=null;let r=Array.isArray(t?.turns)?t.turns:[],o=t?.search?qf:Bf,a=i?r:r.slice(-o),l=new Set(a.map(m=>m?.turnId).filter(Boolean)),c=Uf(Array.isArray(t?.loops)?t.loops:[]),d=i?c:c.filter(m=>!m?.turnId||l.has(m.turnId)),u=Array.isArray(t?.dreamEvents)?t.dreamEvents:[];e.yeaftDebugHistoryHasMore=!!t?.hasMore||!i&&r.length>a.length,!t?.detailTurnId&&Number.isFinite(t?.limit)&&t.limit>0&&(e.yeaftDebugHistoryLimit=Math.min(o,t.limit)),(!e.yeaftDebugTurnsById||typeof e.yeaftDebugTurnsById!="object")&&(e.yeaftDebugTurnsById={}),Array.isArray(e.yeaftDebugLoops)||(e.yeaftDebugLoops=[]),Array.isArray(e.yeaftDebugTurnOrder)||(e.yeaftDebugTurnOrder=[]);let p=i?{...e.yeaftDebugTurnsById}:{};for(let m of a){let w=m?.turnId;if(!w)continue;let E=p[w];if(E){let R=m?.detailsLoaded?{...E,...m}:{...m,...E};R.memoryLoaded==null&&E.memoryLoaded!=null&&(R.memoryLoaded=E.memoryLoaded),R.memoryAdjust==null&&E.memoryAdjust!=null&&(R.memoryAdjust=E.memoryAdjust),p[w]=R}else p[w]=m}e.yeaftDebugTurnsById=p;let f=m=>m?.loopInstanceId||`${m?.turnId||""}#${m?.loopNumber||0}`,g=e.yeaftDebugLoops,b=new Map;for(let m of g)m&&b.set(f(m),m);let h=new Set,A=[];for(let m of d){if(!m)continue;let w=f(m);h.add(w),A.push(b.get(w)||m)}if(i)for(let m of g)!m||h.has(f(m))||A.push(m);e.yeaftDebugLoops=A;let x=new Set,k=[],y=m=>{!m||x.has(m)||(x.add(m),k.push(m))};if(i){for(let m of e.yeaftDebugTurnOrder)y(m);for(let m of a)y(m?.turnId)}else for(let m of a)y(m?.turnId);e.yeaftDebugTurnOrder=i?k:k.slice(-o);for(let m of u){if(!m)continue;let w=null,E=m.sessionId||m.groupId;typeof m.target=="string"&&m.target.includes("/")?w=m.target:typeof E=="string"&&E?w=`group/${E}`:w="*",typeof e._appendDreamEvent=="function"&&e._appendDreamEvent(w,m),m.type==="dream_progress"&&typeof e.handleYeaftOutput=="function"&&e.handleYeaftOutput({event:m})}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,i=["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"))&&pt(e),["No conversation selected","Agent is still syncing","No agent available"].some(c=>t.message?.includes(c))&&n&&(delete e.processingConversations[n],ke(e,n),e.finishStreamingForConversation(n)),i&&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 p=e.messagesMap[n];if(p){let f=p.findIndex(g=>g.id===u.id);f>=0&&p.splice(f,1)}},5e3));return}break}}}let o=Date.now().toString()+Math.random().toString(36).substr(2,9),a={type:"error",content:t.message,transient:i,dbMessageId:i?"err_"+o:void 0};i&&(a._sysErrBaseContent=t.message,a._sysErrCount=1,a._sysErrFirstAt=Date.now()),e.addMessageToConversation(n,a);let l=null;if(i&&n){let c=e.messagesMap[n];c&&c.length>0&&(l=c[c.length-1])}if(i&&n&&l){let c=n,d="err_"+o;l._sysErrRemoveTimer=setTimeout(()=>{let u=e.messagesMap[c];if(u){let p=u.findIndex(f=>f.id===d);p>=0&&u.splice(p,1)}},5e3)}!i&&n&&(delete e.processingConversations[n],ke(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":Na(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 i=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();i&&typeof i.applyPinState=="function"&&i.applyPinState(t.conversationId,!!t.pinned,t.agentId||e.yeaftSessionAgentById?.[t.conversationId]||e.currentAgent||null)}catch{}}break;case"execution_cancelled":Ba(e,t);break;case"slash_commands_update":if(Array.isArray(t.slashCommands)){let n=[...new Set(t.slashCommands)];if(t.commandSet==="yeaft"){let i=t.conversationId&&t.conversationId!=="__preload__"?t.conversationId:null,r=t.agentId&&e.yeaftConversationIdsByAgent?.[t.agentId]||null,o=i||r;o&&(e.slashCommandsMap[o]=n);let a=e.yeaftConversationId||null,l=t.agentId?e.currentAgent===t.agentId&&(r===a||i===a):i===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"){ke(e,n),Da(e,n);break}if(t.status==="ok")e.sessionHealth?.[n]&&delete e.sessionHealth[n],!t.isProcessing&&e.processingConversations[n]&&(delete e.processingConversations[n],ke(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 i=e.conversations.find(r=>r.id===n);e.sendWsMessage({type:"refresh_conversation",conversationId:n,agentId:i?.agentId})}delete e.processingConversations[n],ke(e,n),e.finishStreamingForConversation(n)}break}case"ask_user_question":if(t.conversationId){let n=()=>{let i=e.messagesMap[t.conversationId]||[];for(let r=i.length-1;r>=0;r--)if(i[r].type==="tool-use"&&i[r].toolName==="AskUserQuestion"&&!i[r].askRequestId)return i[r].askRequestId=t.requestId,i[r].askQuestions=t.questions,!0;return!1};if(!n()){let i=0,r=setInterval(()=>{i++,(n()||i>=10)&&clearInterval(r)},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||Nf(t),i=t.effectiveConfig||n;e.llmConfig[t.agentId]={providers:t.providers||i.providers||[],primaryModel:t.primaryModel||i.primaryModel||null,fastModel:t.fastModel||i.fastModel||null,language:t.language||n.language||i.language||"en",needsSetup:t.needsSetup??i.needsSetup??!1,agentConfig:n,effectiveConfig:i,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 i of n.resolvers)i(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 i=e._searchPending,r=t.type==="search_settings"?"load":"update";i&&i[r]&&(i[r](n),delete i[r]);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 i=e._searchPending;i&&i.usage&&(i.usage(n),delete i.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 Bf,qf,nl=O(()=>{ct();Cn();bt();Nt();Ot();vr();tl();_n();Bf=1,qf=5});function rl(){return Object.values(il).sort((t,s)=>t.order-s.order).map(t=>({teamId:t.id,team:t,roles:Object.values(dt).filter(s=>s.group===t.id)}))}function ol(e){let t=[];for(let s of Object.values(dt)){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 qt(e,t){let s=dt[e.role];if(s){if(e.action){let n=s.actions.find(i=>i.id===e.action);return n?`${s.name}\xB7${n.name}`:s.name}return s.name}if(t){let n=t.find(i=>i.id===e.role);if(n){if(e.action){let i=n.actions?.find(r=>r.id===e.action);return i?`${n.name}\xB7${i.name}`:n.name}return n.name}}return e.role}function yr(e,t,s,n="zh-CN"){if(!e||e.length===0||!t||t.length===0)return null;let i=n==="zh-CN";if(!e.some(l=>!dt[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(p=>p.id===l);if(!d)return null;let u;if(c&&d.actions){let p=d.actions.find(f=>f.id===c);p?s?(u=(i?p.messageTemplate:p.messageTemplateEn)||"",u+=s):u=(i?p.defaultMessage:p.defaultMessageEn)||"":u=((i?d.messagePrefix:d.messagePrefixEn)||"")+(s||"")}else u=((i?d.messagePrefix:d.messagePrefixEn)||"")+(s||"");return{effectivePrompt:u}}let o=[];for(let{role:l,action:c}of e){let d=t.find(p=>p.id===l),u=dt[l];if(d)if(c){let p=d.actions?.find(f=>f.id===c);p&&o.push((i?p.messageTemplate:p.messageTemplateEn)||"")}else o.push((i?d.messagePrefix:d.messagePrefixEn)||"");else if(u)return null}return o.length===0?null:{effectivePrompt:o.join(`
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
`)+(s||"")}}function ll(e){return Object.values(il).filter(t=>e||!t.adminOnly).sort((t,s)=>t.order-s.order)}var il,dt,al,Wt,js=O(()=>{il={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}},dt={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"}]}};al="dev",Wt=3});function Kf(e,t){return!t||!e?.yeaftConversationIdsByAgent?[]:Object.entries(e.yeaftConversationIdsByAgent).filter(([,s])=>s===t).map(([s])=>s).filter(Boolean)}function cl(){return`cm_${crypto.randomUUID()}`}function dl(e,t){t!==e.currentAgent&&(e.agentSwitching=!0,e.sendWsMessage({type:"select_agent",agentId:t}))}function ul(e,t,s=null,n=null,i={}){let r=s||e.currentAgent;if(!r){e.addMessage({type:"error",content:xe("chat.agent.selectFirst")});return}cs(e,!0,xe("chat.session.creating"));let o={type:"create_conversation",agentId:r,workDir:t||e.currentAgentWorkDir};n!==null&&(o.disallowedTools=n),i&&typeof i.provider=="string"&&(o.provider=i.provider),i&&i.providerOptions&&typeof i.providerOptions=="object"&&(o.providerOptions=i.providerOptions),e.sendWsMessage(o)}function pl(e,t,s,n=null,i=null,r=null){let o=n||e.currentAgent;if(!o){e.addMessage({type:"error",content:xe("chat.agent.selectFirst")});return}let a=null,l={};i&&typeof i=="object"&&!Array.isArray(i)?l=i:(a=i,r&&typeof r=="object"&&(l=r)),cs(e,!0,xe("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 fl(e,t,s){if(e.panels.length>1){let a=e.activePanelId||e.panels[0]?.id;a&&e.setPanelConversation(a,t);return}if(t===e.currentConversation)return;let n=e.conversations.find(a=>a.id===t&&a.type!=="yeaft");if(n&&n.agentId&&n.agentId!==e.currentAgent){let a=e.agents.find(l=>l.id===n.agentId);a&&(e.currentAgent=n.agentId,e.currentAgentInfo=a,e.sendWsMessage({type:"select_agent",agentId:n.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],n&&(e.currentWorkDir=n.workDir);let i=e.messagesMap[t],r=Ws(i);r!==null?e.sendWsMessage({type:"sync_messages",conversationId:t,afterMessageId:r}):((!i||i.length===0)&&(e.messagesMap[t]=[],cs(e,!0,xe("chat.session.loadingHistory"))),e.sendWsMessage({type:"sync_messages",conversationId:t,turns:5})),e.loadingMoreMessages=!1;let o=e.chatSessionState[t];e.hasMoreMessages=!!o?.hasMoreOlder,ds(e)}function br(e,t,s){t&&e.sendWsMessage({type:"update_conversation_settings",conversationId:t,...s})}function gl(e,t,s){let n=e.currentConversation;if(!n)return;let i=e.conversationMcpServers[n];if(i){let p=i.find(f=>f.name===t);p&&(p.enabled=s)}let r=e.conversationMcpServers[n]||[],o=e.conversationMcpServerTools[n]||{},a=[];for(let p of r)if(!p.enabled){let f=o[p.name];f&&f.length>0?a.push(...f):a.push(`mcp__${p.name}`)}let u=[...(e.conversations.find(p=>p.id===n)?.disallowedTools||[]).filter(p=>!p.startsWith("mcp__")),...a];br(e,n,{disallowedTools:u})}function ml(e,t,s){let n=e.conversations.find(o=>o.id===t);e._recentlyDeletedSessions||(e._recentlyDeletedSessions={}),e._recentlyDeletedSessions[t]=Date.now(),e.conversations=e.conversations.filter(o=>o.id!==t),delete e.messagesMap[t],delete e.chatSessionState[t],delete e.processingConversations[t],ke(e,t),delete e.executionStatusMap[t];let i=e.activeConversations.indexOf(t);i>=0&&(e.activeConversations.splice(i,1),e.activeConversations.length===0&&(localStorage.removeItem("lastViewedConversation"),e.lastViewedConversation=null));for(let o of e.panels)o.conversationId===t&&(o.conversationId=null);let r=e.pinnedSessions.indexOf(t);r>=0&&(e.pinnedSessions.splice(r,1),localStorage.setItem("pinned-sessions",JSON.stringify(e.pinnedSessions))),s&&s!==e.currentAgent?(e.sendWsMessage({type:"select_agent",agentId:s,silent:!0}),e.sendWsMessage({type:"delete_conversation",conversationId:t}),e.sendWsMessage({type:"select_agent",agentId:e.currentAgent,silent:!0})):e.sendWsMessage({type:"delete_conversation",conversationId:t}),e.saveOpenSessions()}function hl(e,t,s){e._recentlyDeletedSessions||(e._recentlyDeletedSessions={}),e._recentlyDeletedSessions[t]=Date.now(),e.conversations=e.conversations.filter(r=>r.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 r of e.panels)r.conversationId===t&&(r.conversationId=null);let i=e.pinnedSessions.indexOf(t);i>=0&&(e.pinnedSessions.splice(i,1),localStorage.setItem("pinned-sessions",JSON.stringify(e.pinnedSessions))),s&&s!==e.currentAgent?(e.sendWsMessage({type:"select_agent",agentId:s,silent:!0}),e.sendWsMessage({type:"delete_conversation",conversationId:t}),e.sendWsMessage({type:"select_agent",agentId:e.currentAgent,silent:!0})):e.sendWsMessage({type:"delete_conversation",conversationId:t})}function vl(e,t,s=[],n={}){let i=n.expertSelections&&n.expertSelections.length>0;if(!t.trim()&&s.length===0&&!i||!e.currentAgent||!e.currentConversation)return;let r=cl();if(e.addMessage({type:"user",content:t,clientMessageId:r,attachments:s.length>0?s:void 0,expertSelections:i?n.expertSelections:void 0}),t.trim()){let c=t.trim().substring(0,100);e.conversationTitles[e.currentConversation]=c}else if(i){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),us(e,e.currentConversation));let a=s.map(c=>c.fileId),l={type:"chat",conversationId:e.currentConversation,prompt:t,fileIds:a,workDir:e.currentWorkDir,clientMessageId:r};if(n.targetRole&&(l.targetRole=n.targetRole),i){l.expertSelections=n.expertSelections;let c=yr(n.expertSelections,e.customExpertRoles,t,e.language||"zh-CN");c&&(l.expertMessage=c.effectivePrompt)}e.sendWsMessage(l)||Bs(e).then(()=>{e.sendWsMessage(l)}).catch(()=>{e.addMessage({type:"system",content:xe("chat.connection.reconnectFailed")}),delete e.processingConversations[e.currentConversation],ke(e,e.currentConversation)})}function yl(e){if(!e.currentConversation||!e.processingConversations[e.currentConversation])return;let t=e.currentConversation;e.sendWsMessage({type:"cancel_execution",conversationId:t}),delete e.processingConversations[t],ke(e,t),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now();let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t),xt(e,t),e.addMessage({type:"system",content:xe("chat.execution.cancelled")})}function bl(e,t,s,n){let i=n||e.currentConversation,o=(e.messagesMap[i]||[]).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?Kf(e,i):[],u=d.length===1?d[0]:null;if(c&&u&&c!==u)return!1;let p=a&&!c&&!u&&typeof e.agentIdForSession=="function"?e.agentIdForSession(l):null,f=e.sendWsMessage(a?{type:"yeaft_ask_user_answer",agentId:c||u||p||e.yeaftAgentId||e.currentAgent||null,conversationId:i,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:i,requestId:t,answers:s});if(o&&!a)o.askAnswered=!0,o.selectedAnswers=s;else if(o&&f!==!1){let g=++jf;o.askPending=!0,o.pendingAnswers=s,o.askSubmitGeneration=g;let v=setTimeout(()=>{o.askSubmitGeneration!==g||o.askPending!==!0||(o.askPending=!1,o.pendingAnswers=null,o.askSubmitGeneration=null)},zf);typeof v?.unref=="function"&&v.unref()}f!==!1&&i&&!e.processingConversations[i]&&(e.processingConversations[i]=!0,e._closedAt?.[i]&&delete e._closedAt[i],e.getOrCreateExecutionStatus(i))}function wl(e,t){t&&(e.activeConversations.includes(t)||e.activeConversations.length>=3||(e.activeConversations.push(t),e.messagesMap[t]||(e.messagesMap[t]=[],e.sendWsMessage({type:"sync_messages",conversationId:t,turns:5})),ds(e)))}function kl(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 Sl(e,t,s,n=[],i={}){let r=i.expertSelections&&i.expertSelections.length>0;if(!s.trim()&&n.length===0&&!r||!e.currentAgent||!t)return;let o=cl();if(e.addMessageToConversation(t,{type:"user",content:s,clientMessageId:o,attachments:n.length>0?n:void 0,expertSelections:r?i.expertSelections:void 0}),s.trim()){let d=s.trim().substring(0,100);e.conversationTitles[t]=d}else if(r){let d=i.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),us(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(i.targetRole&&(c.targetRole=i.targetRole),r){c.expertSelections=i.expertSelections;let d=yr(i.expertSelections,e.customExpertRoles,s,e.language||"zh-CN");d&&(c.expertMessage=d.effectivePrompt)}e.sendWsMessage(c)||Bs(e).then(()=>{e.sendWsMessage(c)}).catch(()=>{e.addMessageToConversation(t,{type:"system",content:xe("chat.connection.reconnectFailed")}),delete e.processingConversations[t],ke(e,t)})}function Cl(e,t){if(!t||!e.processingConversations[t])return;e.sendWsMessage({type:"cancel_execution",conversationId:t}),delete e.processingConversations[t],ke(e,t),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now();let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t),xt(e,t),e.addMessageToConversation(t,{type:"system",content:xe("chat.execution.cancelled")})}function Il(e){e.ws&&e.ws.readyState===WebSocket.OPEN&&e.sendWsMessage({type:"get_agents"})}function Al(e){!e.currentAgent||!e.currentConversation||e.sendWsMessage({type:"refresh_conversation",conversationId:e.currentConversation})}function xl(e,t){t&&e.sendWsMessage({type:"restart_agent",agentId:t})}function Tl(e,t){t&&e.sendWsMessage({type:"upgrade_agent",agentId:t})}var zf,jf,Ml=O(()=>{Nt();Ot();Zi();_n();xn();bt();js();zf=1e4,jf=0});function Yf(e=globalThis.localStorage){try{return e?.getItem(Dl)==="yeaft"?"yeaft":Pl}catch{return Pl}}function wr(e,t=globalThis.localStorage){if(e!=="chat"&&e!=="yeaft")return!1;try{return t?.setItem(Dl,e),!!t}catch{return!1}}function _l(e=globalThis.localStorage){let t=Yf(e);if(t!=="yeaft")return{currentView:t,_yeaftTransitionActive:!1,_savedActiveConversations: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,_pendingChatRestoreConversationId:n}}function El(e){let t=!e._yeaftTransitionActive;return t&&(e._savedActiveConversations=[...e.activeConversations],e._yeaftTransitionActive=!0),e.activeConversations=[e.yeaftConversationId],t}function Rl(e){e._yeaftTransitionActive&&(e.activeConversations=e._savedActiveConversations||[],e._savedActiveConversations=null,e._yeaftTransitionActive=!1)}var Dl,Pl,Ll=O(()=>{Dl="yeaft-preferred-conversation-view",Pl="chat"});function $l(e,t,s){let n={...e||{}},i={...n[t]||{}};return i[s]=(i[s]||0)+1,n[t]=i,n}function Vl(e,t,s){let n={...e||{}},i={...n[t]||{}},r=(i[s]||0)-1;return r<=0?delete i[s]:i[s]=r,Object.keys(i).length===0?delete n[t]:n[t]=i,n}var Fl=O(()=>{});function Ol(e){return e.currentView==="yeaft"?e.yeaftConversationId||null:e.activeConversations[0]||null}var Hl=O(()=>{});function Nl({loops:e,turnsById:t,turnOrder:s,maxLoops:n}){if(!Array.isArray(e)||e.length<=n)return{loops:e,turnsById:t,turnOrder:s};let i=e.length-n,r=e.slice(i),o=new Set;for(let c of r)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:r,turnsById:a,turnOrder:l}}var Bl=O(()=>{});function $e(e){let t=Number(e);return Number.isFinite(t)?t:null}function ql(e){return Zf.has(e)?1:0}function Jf(e,t){if(!e)return t||null;if(!t)return e;let s=$e(e.progressRevision),n=$e(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 i=ql(e.status),r=ql(t.status);if(i!==r)return r>i?t:e;let o=$e(e.updatedAt)??$e(e.createdAt)??0;return($e(t.updatedAt)??$e(t.createdAt)??0)>o?t:e}function Rn(...e){let t=new Map;for(let s of e){let n=Array.isArray(s)?s:[s];for(let i of n)i?.id&&t.set(i.id,Jf(t.get(i.id),i))}return[...t.values()].sort((s,n)=>Number(s.createdAt||0)-Number(n.createdAt||0)||String(s.id||"").localeCompare(String(n.id||"")))}function Ln(e,t){if(!e||!t||e.id!==t.id)return!1;let s=$e(e.revision),n=$e(t.revision);if(s!=null&&n!=null&&s!==n)return s<n;let i=$e(e.updatedAt),r=$e(t.updatedAt);return i!=null&&r!=null&&i<r}function Wl(e,t){if(Ln(e,t))return!0;if(!e||!t||e.id!==t.id)return!1;let s=$e(e.revision),n=$e(t.revision);return e.currentActionId!==t.currentActionId&&s!=null&&n!=null&&s<=n}function Ul(e,t){let s=$e(e?.progressRevision),n=$e(t?.progressRevision);return s!=null&&n!=null&&n<s}function zl(e,t){return!e||e.id!==t?.id||!t.currentActionId?!1:!Array.isArray(e.actions)||!e.actions.some(s=>s?.id===t.currentActionId)}function jl(e,t){if(!e||e.id!==t?.id||Ln(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 i=new Map(t.actionStats.map(o=>[o?.id,o])),r=!1;n=!0,s.actions=e.actions.map(o=>{let a=i.get(o?.id);if(!a)return o;if(r=!0,$e(a?.progressRevision)==null){let{response:c,messages:d,...u}=a;return{...o,...u}}return Ul(o,a)?(n=!1,o):{...o,...a}}),r||(n=!1)}for(let i of Xf)!n&&eg.has(i)||Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i]);return s}function Kl(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 i=s.get(n?.id);return i?Ul(i,n):!1})}function Gl(e,t){return $e(e?.revision)===$e(t?.revision)&&$e(e?.updatedAt)===$e(t?.updatedAt)}function Yl(e,t){return!e||!t||e.id!==t.id?!1:Ln(e,t)?!0:Gl(t,e)&&Kl(t.actions,e.actions)}function Ks(e,t){let s=Array.isArray(e)?e:[],n=s.find(r=>r.id===t?.id)||null,i=n&&Ln(t,n)?n:t;return n&&i===t&&Gl(n,t)&&Kl(n.actionStats,t.actionStats)&&(i={...t,status:n.status,currentActionId:n.currentActionId,currentAction:n.currentAction,executionStats:n.executionStats,failureReason:n.failureReason,actionStats:n.actionStats}),i?.id?[i,...s.filter(r=>r.id!==i.id)].sort((r,o)=>Number(o.updatedAt||0)-Number(r.updatedAt||0)):s}var Xf,Zf,eg,kr=O(()=>{Xf=Object.freeze(["revision","title","goal","workItemType","planningMode","status","lifecycle","attentionState","activeActionIds","attentionActionIds","currentActionId","currentAction","executionStats","failureReason","origin","linkedSessionIds","createdAt","updatedAt"]);Zf=new Set(["completed","failed","cancelled","superseded","interrupted"]);eg=new Set(["status","lifecycle","attentionState","activeActionIds","attentionActionIds","currentActionId","currentAction","executionStats","failureReason"])});function Sr(e){return e?.type==="user"&&typeof e.content=="string"&&e.content.trim()}function Cr(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 Ir(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 i=e.speakerVpId||"",r=t?.speakerVpId||t?.vpId||"";return!!(i&&r&&i!==r)}function Ql(e=[]){let t=[],s=null,n=i=>{s&&(t.push({start:s.start,end:i,kind:s.kind}),s=null)};for(let i=0;i<e.length;i++){let r=e[i];if(r){if(Sr(r)||r.type==="system"||r.type==="error"){n(i),s={start:i,kind:r.type};continue}if(!Cr(r)){s||(s={start:i,kind:"other"});continue}(!s||s.kind==="assistant"&&Ir(s,r))&&(n(i),s={start:i,kind:"assistant",turnId:r.turnId||"",speakerVpId:r.speakerVpId||r.vpId||""}),s.lastTurnId=r.turnId||s.lastTurnId||"",s.speakerVpId=s.speakerVpId||r.speakerVpId||r.vpId||""}}return n(e.length),t}function Xl(e,t){return t?e&&(e.sessionId??e.groupId)===t:!0}function Ar(e=[],t=null,s=5){let n=Math.max(1,Number.isFinite(s)?Math.floor(s):5),i=[],r=[],o=null,a=c=>{o&&(r.push({start:o.start,end:c,kind:o.kind}),o=null)};for(let c of e){if(!Xl(c,t))continue;let d=i.length;if(i.push(c),Sr(c)||c.type==="system"||c.type==="error"){a(d),o={start:d,kind:c.type};continue}if(!Cr(c)){o||(o={start:d,kind:"other"});continue}(!o||o.kind==="assistant"&&Ir(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(i.length),r.length<=n)return i;let l=r[r.length-n];return i.slice(l.start)}function Zl(e=[],t=null,s=5){let n=Math.max(1,s||5),i=0,r=null,o=()=>r?(r=null,i+=1,i>n):!1;for(let a of e)if(Xl(a,t)){if(Sr(a)||a.type==="system"||a.type==="error"){if(o())return!0;r={kind:a.type};continue}if(!Cr(a)){r||(r={kind:"other"});continue}if(!r||r.kind==="assistant"&&Ir(r,a)){if(o())return!0;r={kind:"assistant",turnId:a.turnId||"",speakerVpId:a.speakerVpId||a.vpId||""}}r.lastTurnId=a.turnId||r.lastTurnId||"",r.speakerVpId=r.speakerVpId||a.speakerVpId||a.vpId||""}return o(),i>n}function Ut(){return 5}function xr(){return 5}var Jl=O(()=>{});function tc(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 sc(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 rg(e,t){return Dr.every(s=>!t[s]||e[s]===t[s])}function fc(e,t){return Dr.every(s=>!e[s]||!t[s]||e[s]===t[s])}function nc(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)),i=n.filter(o=>rg(sc(o,s),t));if(i.length===1)return i[0];let r=n.filter(o=>fc(sc(o,s),t));return r.length===1?r[0]:null}function gc(e){return Dr.map(t=>e[t]||"").join("\0")}function og(e,t,s){let n=gc(t),i={...e._yeaftAskTerminalEvents||{},[n]:{identity:t,event:s,receivedAt:Date.now()}},r=Object.keys(i);if(r.length>ec){r.sort((o,a)=>i[o].receivedAt-i[a].receivedAt);for(let o of r.slice(0,r.length-ec))delete i[o]}e._yeaftAskTerminalEvents=i}function ic(e,t){let s=e._yeaftAskTerminalEvents||{},n=gc(t),i=s[n]?n:null;if(!i){let l=Object.entries(s).filter(([,c])=>fc(c.identity||{},t));l.length===1&&(i=l[0][0])}if(!i)return null;let r=s[i],{[i]:o,...a}=s;return e._yeaftAskTerminalEvents=a,r?.event||null}function ag(e,t,s){return(e.messagesMap?.[t]||[]).some(n=>n?.type==="tool-use"&&n.sessionId===s&&n.hasResult===!1)}function Tr(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 lg(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 cg(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 Gs(e){return e?.role==="assistant"&&e?.turnId?`response:${e.turnId}:${e.speakerVpId||e.vpId||""}`:e?.clientMessageId?`client:${e.clientMessageId}`:`message:${e?.messageId||""}`}function rc(e){let t=e?.updatedAt||e?.endedAt||e?.createdAt,s=t?Date.parse(t):NaN;return Number.isFinite(s)?s:0}function Mr(e,t){return`${e||""}::${t||""}`}function oc(e){let t=Object.entries(e||{}),s=t.filter(([,i])=>i?.status==="running"),n=t.filter(([,i])=>i&&i.status!=="running"&&pc.has(i.status)).sort((i,r)=>rc(r[1])-rc(i[1])).slice(0,sg);return Object.fromEntries([...s,...n])}function fs(){try{return typeof window>"u"?null:window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore()||null}catch{return null}}function Ee(e,t,s=null){if(s)return s;if(t){let n=fs(),i=n&&typeof n.sessionById=="function"?n.sessionById(t,e?.currentAgent||null):null;if(i&&i.agentId)return i.agentId;let r=e?.yeaftSessionAgentById?e.yeaftSessionAgentById[t]:null;if(r)return r}return e?.currentAgent||null}function dg(e,t){let s=r=>String(r||"").replace(/^v/,"").split(".").slice(0,3).map(o=>Number.parseInt(o,10)),n=s(e),i=s(t);if(n.length<3||i.length<3||[...n,...i].some(r=>!Number.isFinite(r)))return!1;for(let r=0;r<3;r+=1)if(n[r]!==i[r])return n[r]>i[r];return!0}function ac(e,t,s){if(!t||!s)return!1;let n=Array.isArray(e?.agents)?e.agents.find(o=>o?.id===t):null,i=e?.currentAgentInfo?.id===t?e.currentAgentInfo:null;return(n?.capabilities||i?.capabilities||[]).includes(s)?!0:s==="session_history_search"&&dg(n?.version||i?.version,"1.0.166")}function Ys(e,{fallbackDefault:t=!1}={}){if(e?.yeaftActiveSessionFilter)return e.yeaftActiveSessionFilter;let s=fs();return s?.activeSessionId?s.activeSessionId:t?"grp_default":null}function On(e){let t=e.yeaftDebugSessionFilter;if(t==="__all__")return null;if(t)return t;let s=Ys(e);return s||(fs()?.sessions?.grp_default?"grp_default":null)}function ps(e,t=null){let s=t||e?.yeaftActiveSessionFilter||null,n=Ee(e,s);return(n&&e?.yeaftConversationIdsByAgent?e.yeaftConversationIdsByAgent[n]:null)||e?.yeaftConversationId||null}function lc(e,t,s){if(e?.currentView!=="yeaft")return!1;let n=e?.yeaftActiveSessionFilter||null;if(n&&t!==n)return!1;let i=Ee(e,n);return!i||!s||i===s}var tg,Me,$n,Vn,sg,pc,Fn,ng,ig,ec,Dr,cc,Pr,dc,uc,zt,Hn=O(()=>{ct();bt();Zi();xn();Ga();nl();Ml();Ot();Nt();Ll();Fl();Hl();Bl();kr();ur();pr();Jl();({defineStore:tg}=Pinia),Me=Object.freeze([]),$n=(e,t)=>`${e||""}::${t}`,Vn=5,sg=8,pc=new Set(["succeeded","failed","cancelled","orphaned"]),Fn=new Set(["typing","thinking","streaming","tool"]),ng=Object.freeze(["model","availableModels","refreshedAt","catalogRefreshedAt","catalogEpoch","catalogRevision","catalogDigest","refreshStartedAt","refreshReason","refreshError","refreshing"]),ig=8,ec=64;Dr=Object.freeze(["conversationId","agentId","requestId","toolCallId","sessionId","vpId","turnId","threadId"]);cc=1e3,Pr=1,dc=5,uc=200,zt=tg("chat",{state:()=>({ws:null,authenticated:!1,sessionKey:null,serverEncryptionRequired:!0,connectionState:"disconnected",reconnectAttempts:0,maxReconnectAttempts:10,reconnectTimer:null,agents:[],currentAgent:null,currentAgentInfo:null,conversations:[],activeConversations:[],currentWorkDir:null,messagesMap:{},chatSessionState:{},panels:[],activePanelId:null,_pendingPaneId:null,conversationTitles:{},customConversationTitles:{},processingConversations:{},yeaftProcessingSessions:{},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,_pendingSessionTitle:null,workbenchExpanded:!1,workbenchMaximized:!1,sidebarCollapsed:!1,sessionSidebarOpen:!1,compactStatus:null,clearStatus:null,refreshingSession:!1,refreshingSessionMap:{},proxyPorts:{},hasMoreMessages:!1,loadingMoreMessages:!1,yeaftHasMoreHistory:!1,yeaftLoadingMoreHistory:!1,yeaftOldestLoadedSeq:null,yeaftSessionHistoryState:{},yeaftMessageWindowState:{},yeaftBootstrapMetaLoadingKey:null,yeaftHistoryPerfTraceBySession:{},yeaftHistorySearchState:{requestId:null,agentId:null,sessionId:null,query:"",loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null},yeaftHistoryOutlineBySession:{},_yeaftHistoryOutlineTimeouts:{},_yeaftHistorySearchTimeout:null,_yeaftHistoryWindowPending:null,_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")||"[]"),..._l(),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:{},_workCenterActionRequestsGeneration:{},_workCenterActionRequestDetailsGeneration:{},workCenterPending:{},workCenterCreateDraft:null,yeaftConversationId:null,yeaftConversationIdsByAgent:{},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:Pr,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=>Ol(e),messages(e){let t=this.activeConversationId,s=t&&e.messagesMap[t]||Me;if(e.currentView==="yeaft"){let n=e.yeaftActiveSessionFilter||"__all__",i=e.yeaftMessageWindowState[n]?.visibleTurns||Ut();return Ar(s,e.yeaftActiveSessionFilter||null,i)}return s},yeaftAllMessages:e=>{let t=ps(e);return t&&e.messagesMap[t]||Me},yeaftVisibleMessages(e){let t=ps(e),s=t&&e.messagesMap[t]||Me,n=e.yeaftActiveSessionFilter||"__all__",i=e.yeaftMessageWindowState[n]?.visibleTurns||Ut();return Ar(s,e.yeaftActiveSessionFilter||null,i)},hasHiddenYeaftMessages(e){if(e.currentView!=="yeaft")return!1;let t=ps(e),s=t&&e.messagesMap[t]||Me,n=e.yeaftActiveSessionFilter||"__all__",i=e.yeaftMessageWindowState[n]?.visibleTurns||Ut();return Zl(s,e.yeaftActiveSessionFilter||null,i)},vpsTypingInCurrentConv(e){let t=this.activeConversationId;if(!t)return Me;let s=(e.yeaftVpTyping||{})[t];if(!s)return Me;let n=Object.keys(s).filter(i=>(s[i]||0)>0);return n.length===0?Me: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=On(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamLatest?.[s]||null},yeaftDreamSnapshotForActiveSession(e){let t=On(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamSnapshots?.[s]||null},yeaftDreamPromptLoadForActiveSession(e){let t=On(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamPromptLoads?.[s]||null},yeaftDreamEventsForActiveSession(e){let t=On(e);if(!t)return[];let s=`sessions/${t}`,n=Array.isArray(e.yeaftDreamEvents?.[s])?e.yeaftDreamEvents[s]:[],i=Array.isArray(e.yeaftDreamEvents?.["*"])?e.yeaftDreamEvents["*"]:[];return i.length===0?n:n.length===0?i:[...n,...i].sort((r,o)=>(r.at||0)-(o.at||0))},yeaftDebugTurnsForActiveSession:e=>{let t=e.yeaftDebugTurnOrder||Me,s=e.yeaftDebugTurnsById||{},n=e.yeaftDebugLoops||Me,i=e.yeaftReflectionCards||{},r=e.yeaftDebugSessionFilter,o;r==="__all__"?o=null:r?o=r: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(i)){let u=i[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],p=s[u];if(!p||o&&p.sessionId&&p.sessionId!==o)continue;let f=a[u]||Me,g=l[u]||Me,v=f.length,y=0,A=0;for(let b of f){let m=b&&b.usage;m&&Number.isFinite(m.totalTokens)?y+=m.totalTokens:m&&(y+=(m.totalInputTokens||(m.inputTokens||0)+(m.cacheReadTokens||0)+(m.cacheWriteTokens||0))+(m.outputTokens||0)),b&&Number.isFinite(b.latencyMs)&&(A+=b.latencyMs)}let x=!p.closedAt,k={...p,loopCount:x||!p.loopCount?v:p.loopCount,totalTokens:x||!p.totalTokens?y:p.totalTokens,totalMs:x||!p.totalMs?A:p.totalMs,loops:f,reflections:g};c.push(k)}return c},yeaftDebugAvailableSessions:e=>{let t=new Set;for(let s of e.yeaftDebugTurnOrder||Me){let n=e.yeaftDebugTurnsById[s];n&&n.sessionId&&t.add(n.sessionId)}return Array.from(t).sort()},yeaftDebugTurnTotal:e=>(e.yeaftDebugTurnOrder||Me).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=Ys(e);if(!t)return!1;if(e.yeaftProcessingSessions?.[t])return!0;for(let s of Object.values(e.activeVpTurns||{}))if(s?.sessionId===t)return!0;for(let s of Object.values(e.vpStatuses||{}))if((s?.sessionId||s?.groupId||null)===t&&Fn.has(s?.state))return!0;return!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"?fs()?.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=>{if(!t)return!1;if(e.yeaftProcessingSessions?.[t])return!0;for(let s of Object.values(e.activeVpTurns||{}))if(s?.sessionId===t)return!0;for(let s of Object.values(e.vpStatuses||{}))if((s?.sessionId||s?.groupId||null)===t&&Fn.has(s?.state))return!0;return!1},showRecoveryBanner:e=>e.pendingRecovery&&!e.recoveryDismissed&&!e.currentConversation,currentSubagents:e=>{if(!e.currentConversation)return Me;let t=e.subagents[e.currentConversation];return t?Object.values(t):Me},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 Me;let t=e.subagents[e.currentConversation];if(!t)return Me;let s=t[e.activeSubagentId];return(Array.isArray(s?.messages)?s.messages:Me).filter(i=>i?.type==="text")},selectedTaskInfo:()=>null,currentMcpServers:e=>e.currentConversation&&e.conversationMcpServers[e.currentConversation]||Me},actions:{activateChatView({persistPreference:e=!1}={}){let t=this._pendingChatRestoreConversationId;this._pendingChatRestoreConversationId=null,this.currentView="chat",e&&wr("chat"),Rl(this),t&&this.conversations.some(s=>s.id===t)&&(this.autoRestoreConversation(t),this.sendWsMessage({type:"refresh_conversation",conversationId:t}))},enterWorkCenter(e=null){let t=e||this.currentAgent||this.agents.find(s=>s.online)?.id||null;if(t){if(this.currentAgent!==t){this.selectAgent(t),this.currentAgent=t;let s=this.agents.find(n=>n.id===t);s&&(this.currentAgentInfo=s)}this.workCenterAgentId=t,this.workCenterOpen=!0,this.listWorkItems(t).catch(()=>{})}},leaveWorkCenter(){this.workCenterOpen=!1},enterWorkCenterFromSession(e,t=""){if(!e?.id)return;let s=e.agentId||Ee(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)},workCenterRequest(e,t={},s=null){let n=s||this.workCenterAgentId||this.currentAgent;if(!n)return Promise.reject(new Error("No Agent selected"));let i=`work-center-${Date.now()}-${Math.random().toString(36).slice(2)}`;return new Promise((r,o)=>{let a=setTimeout(()=>{delete this.workCenterPending[i],o(new Error("Work Center request timed out"))},3e4);this.workCenterPending[i]={resolve:r,reject:o,timer:a,agentId:n,op:e},this.sendWsMessage({type:"work_center_request",agentId:n,requestId:i,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)},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)},i=JSON.stringify(n),r=Number(this._workCenterListGenerationByAgent[s]||0)+1,o=Number(this._workCenterListEventGenerationByAgent[s]||0);this._workCenterListGenerationByAgent={...this._workCenterListGenerationByAgent,[s]:r},this._workCenterListQueryByAgent={...this._workCenterListQueryByAgent,[s]:i},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]===r&&this._workCenterListQueryByAgent[s]===i&&this.workCenterAgentId===s){let d=l,u=this._workCenterListEventsByAgent[s]||{};for(let p of Object.values(u))Number(p?.generation)<=o||p?.queryKey!==i||(d=p.matches?Ks(d,p.summary):d.filter(f=>f.id!==p.summary?.id));this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[s]:d},this.workCenterListPageByAgent={...this.workCenterListPageByAgent,[s]:{nextCursor:a?.nextCursor||null,queryKey:i}},this.workCenterWatcherByAgent={...this.workCenterWatcherByAgent,[s]:a?.watcher||null},this.workCenterLoadedByAgent={...this.workCenterLoadedByAgent,[s]:!0}}return l}catch(a){throw this._workCenterListGenerationByAgent[s]===r&&this._workCenterListQueryByAgent[s]===i&&(this.workCenterErrorByAgent={...this.workCenterErrorByAgent,[s]:a?.message||String(a)}),a}finally{this._workCenterListGenerationByAgent[s]===r&&this._workCenterListQueryByAgent[s]===i&&(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 i=s.queryKey,r=this._workCenterListGenerationByAgent[t],o=Number(this._workCenterListEventGenerationByAgent[t]||0),a=s.nextCursor,l=`${r}:${i}:${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]!==r||this._workCenterListQueryByAgent[t]!==i||u?.queryKey!==i||u?.nextCursor!==a||this.workCenterAgentId!==t)return[];let p=[...this.workCenterItemsByAgent[t]||[]];for(let g of Array.isArray(d?.items)?d.items:[]){if(this.workItemDeleted(t,g?.id))continue;let v=p.findIndex(y=>y.id===g.id);v<0?p.push(g):p[v]=Ks([p[v]],g)[0]}let f=this._workCenterListEventsByAgent[t]||{};for(let g of Object.values(f))Number(g?.generation)<=o||g?.queryKey!==i||(p=g.matches?Ks(p,g.summary):p.filter(v=>v.id!==g.summary?.id));return this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[t]:p},this.workCenterListPageByAgent={...this.workCenterListPageByAgent,[t]:{nextCursor:d?.nextCursor||null,queryKey:i}},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","_workCenterActionRequestsGeneration","_workCenterActionRequestDetailsGeneration"]){let i={};for(let[r,o]of Object.entries(this[n]||{}))r.startsWith(s)||(i[r]=o);this[n]=i}},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&&Yl(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),i=await this.workCenterRequest("get",{id:e},s);return this.commitWorkCenterDetail(s,i,n),this.workCenterDetailByAgent[s]||i},async loadWorkItemActionMessages(e,t,s,n=null){let i=n||this.workCenterAgentId||this.currentAgent,r=`${i}:${e}:${t}`,o=`${r}:${s==null?"latest":String(s)}`;if(this._workCenterActionMessageRequests[o])return this._workCenterActionMessageRequests[o];this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[r]:!0},this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[r]:null};let a=(async()=>{try{let l=await this.workCenterRequest("get_action_messages",{id:e,actionId:t,cursor:s,limit:20},i);if(this.workItemDeleted(i,e))return l;let c=this.workCenterActionMessages[r]?.messages||[],d=Rn(c,l?.messages||[]),u=this.workCenterActionMessages[r],p=u?.nextCursor,f=s==null?null:Number(s),g=p==null?null:Number(p),v=!u||f==null||g!=null&&f===g;return this.workCenterActionMessages={...this.workCenterActionMessages,[r]:{messages:d,nextCursor:v?l?.nextCursor??null:p,total:Math.max(Number(l?.total)||0,Number(u?.total)||0,d.length)}},l}catch(l){throw this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[r]:l?.message||String(l)},l}finally{let l={...this._workCenterActionMessageRequests};delete l[o],this._workCenterActionMessageRequests=l;let c=Object.keys(l).some(d=>d.startsWith(`${r}:`));this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[r]:c}}})();return this._workCenterActionMessageRequests={...this._workCenterActionMessageRequests,[o]:a},a},async loadWorkItemActionRequests(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,i=`${n}:${e}:${t}`,r=Number(this._workCenterActionRequestsGeneration[i]||0)+1;this._workCenterActionRequestsGeneration={...this._workCenterActionRequestsGeneration,[i]:r},this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[i]:!0},this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[i]:null};try{let o=await this.workCenterRequest("get_action_requests",{id:e,actionId:t},n);return!this.workItemDeleted(n,e)&&this._workCenterActionRequestsGeneration[i]===r&&(this.workCenterActionRequests={...this.workCenterActionRequests,[i]:o?.requests||[]}),o?.requests||[]}catch(o){throw this._workCenterActionRequestsGeneration[i]===r&&(this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[i]:o?.message||String(o)}),o}finally{this._workCenterActionRequestsGeneration[i]===r&&(this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[i]:!1})}},async loadWorkItemActionRequest(e,t,s,n,i=null){let r=i||this.workCenterAgentId||this.currentAgent,o=`${r}:${e}:${t}:${s}:${n}`,a=Number(this._workCenterActionRequestDetailsGeneration[o]||0)+1;this._workCenterActionRequestDetailsGeneration={...this._workCenterActionRequestDetailsGeneration,[o]:a},this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[o]:!0},this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[o]:null};try{let l=await this.workCenterRequest("get_action_request",{id:e,actionId:t,runId:s,requestId:n},r);return!this.workItemDeleted(r,e)&&this._workCenterActionRequestDetailsGeneration[o]===a&&(this.workCenterActionRequestDetails={...this.workCenterActionRequestDetails,[o]:l?.request||null}),l?.request||null}catch(l){throw this._workCenterActionRequestDetailsGeneration[o]===a&&(this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[o]:l?.message||String(l)}),l}finally{this._workCenterActionRequestDetailsGeneration[o]===a&&(this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[o]:!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 i=await this.workCenterRequest("update_settings",{settings:e},s);return this._workCenterSettingsGenerationByAgent[s]===n&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[s]:i?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[s]:i?.runtime||null},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[s]:null}),i},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),i=await this.workCenterRequest("create",e,s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,i,n),i},async updateWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,i=this.beginWorkCenterDetailWrite(n),r=await this.workCenterRequest("update",{id:e,patch:t},n);return await this.listWorkItems(n,this._workCenterListFiltersByAgent[n]||{}),this.commitWorkCenterDetail(n,r,i),r},async startWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),i=await this.workCenterRequest("start",{id:e},s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,i,n),i},async cancelWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),i=await this.workCenterRequest("cancel",{id:e},s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,i,n),i},async deleteWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,i=await this.workCenterRequest("delete",{id:e,revision:t},n);return this.removeWorkItemState(n,e),i},async sendWorkItemMessage(e,t,s,n=null){let i=n||this.workCenterAgentId||this.currentAgent,r=this.beginWorkCenterDetailWrite(i),o=await this.workCenterRequest("work_item_message",{id:e,text:t,revision:s},i);return await this.listWorkItems(i,this._workCenterListFiltersByAgent[i]||{}),this.commitWorkCenterDetail(i,o,r),o},async retryWorkItemAction(e,t,s,n,i=null){let r=i||this.workCenterAgentId||this.currentAgent,o=this.beginWorkCenterDetailWrite(r),a=await this.workCenterRequest("retry_action",{id:e,actionId:t,revision:s,generation:n},r);return await this.listWorkItems(r,this._workCenterListFiltersByAgent[r]||{}),this.commitWorkCenterDetail(r,a,o),a},async sendWorkItemActionInput(e,t,s,n,i,r=[],o=null){let a=o||this.workCenterAgentId||this.currentAgent,l=Number(this._workCenterActionInputGenerationByAgent[a]||0)+1;this._workCenterActionInputGenerationByAgent={...this._workCenterActionInputGenerationByAgent,[a]:l};let c=await this.workCenterRequest("action_input",{id:e,text:t,actionId:s,revision:n,generation:i,attachments:r},a);await this.listWorkItems(a,this._workCenterListFiltersByAgent[a]||{});let d=this.workCenterDetailByAgent[a],u=d?.actions?.find(f=>f?.id===s),p=d?.id===e&&Number(d.revision)===Number(n)&&u&&Number(u.generation)===Number(i);return this._workCenterActionInputGenerationByAgent[a]===l&&p&&!Wl(c,d)?(this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[a]:c},c):d?.id===e?d:c},async guideWorkItemAction(e,t,s,n,i,r=[],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:i,attachments:r},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,n=this.workCenterItemsByAgent[e]||[];if(t.type==="work_item.deleted"){this.removeWorkItemState(e,s.id);return}if(this.workItemDeleted(e,s.id))return;let i=this._workCenterListFiltersByAgent[e]||{},r=this.workItemMatchesBoardQuery(s,i),o=Number(this._workCenterListEventGenerationByAgent[e]||0)+1;this._workCenterListEventGenerationByAgent={...this._workCenterListEventGenerationByAgent,[e]:o},this._workCenterListEventsByAgent={...this._workCenterListEventsByAgent,[e]:{...this._workCenterListEventsByAgent[e]||{},[s.id]:{generation:o,queryKey:this._workCenterListQueryByAgent[e]||null,summary:s,matches:r}}};let a=r?Ks(n,s):n.filter(c=>c.id!==s.id);this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[e]:a};let l=this.workCenterDetailByAgent[e];if(l?.id===s.id){let c=zl(l,s);this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[e]:jl(l,s)},c&&this.refreshWorkItemDetailAfterActionChange(e,s)}},async refreshWorkItemDetailAfterActionChange(e,t){let s=`${t.id}:${t.currentActionId}`;if(this._workCenterDetailEventRefreshByAgent[e]===s)return;let n=Number(this._workCenterDetailRequestGenerationByAgent[e]||0);this._workCenterDetailEventRefreshByAgent={...this._workCenterDetailEventRefreshByAgent,[e]:s};try{let i=await this.workCenterRequest("get",{id:t.id},e),r=this.workCenterDetailByAgent[e];r?.id===t.id&&r.currentActionId===t.currentActionId&&i?.currentActionId===t.currentActionId&&this.commitWorkCenterDetail(e,i,n)}catch{}finally{if(this._workCenterDetailEventRefreshByAgent[e]===s){let i={...this._workCenterDetailEventRefreshByAgent};delete i[e],this._workCenterDetailEventRefreshByAgent=i}}},cacheYeaftAgentStatus(e,t,{allowBootstrapCatalog:s=!1}={}){if(!e||!t)return;let n=this.yeaftStatusByAgent[e]||{},i=Number(n.catalogRevision)||0,r=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&&(r>0||c>0),p=Array.isArray(this._yeaftRetiredCatalogEpochsByAgent?.[e])?this._yeaftRetiredCatalogEpochsByAgent[e]:[],f=!!a&&p.includes(a),g=!!a&&a===o,v=r>0?g&&r===i:c>0&&c===l,y=r>0?!!a&&(a!==o||r>i):i===0&&c>l,A=r>0?!!t.catalogDigest&&!!n.catalogDigest&&t.catalogDigest===n.catalogDigest:t.catalogDigest===n.catalogDigest,x=u&&!f&&(y||v&&A),b=x||s&&i===0&&l===0&&!u&&d,m={...t};if(!b)for(let E of ng)delete m[E];let w={...n,...m};if(b){if(x&&o&&a&&o!==a){let E=[...p.filter(R=>R!==o),o].slice(-ig);this._yeaftRetiredCatalogEpochsByAgent={...this._yeaftRetiredCatalogEpochsByAgent||{},[e]:E}}w.availableModels=t.availableModels,w.catalogRefreshedAt=x?c:null,w.catalogEpoch=x&&a||null,w.catalogRevision=x&&r||null,w.catalogDigest=x&&t.catalogDigest||null}this.yeaftStatusByAgent={...this.yeaftStatusByAgent,[e]:w},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)},enterYeaft(e=null){let t=this.currentAgent,s=e||this.currentAgent||null;if(!s){let i=this.agents.find(r=>r.online);i&&(s=i.id)}if(s&&this.currentAgent!==s){this.selectAgent(s),this.currentAgent=s;let i=this.agents.find(r=>r.id===s);i&&(this.currentAgentInfo=i)}if(!this.applyCachedYeaftStatus(s)&&t&&t!==s&&(this.yeaftAvailableModels=[],this.yeaftStatus=null,this.yeaftModelsRefreshing=!0,this.yeaftModelRefreshError=null),s){let i=this.yeaftConversationIdsByAgent?.[s]||null;i||(i=`yeaft-local-${s}-${Date.now()}`,this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[s]:i}),this.yeaftConversationId=i}else this.yeaftConversationId||(this.yeaftConversationId=`yeaft-local-${Date.now()}`);this.messagesMap[this.yeaftConversationId]||(this.messagesMap[this.yeaftConversationId]=[]),El(this),this.currentView="yeaft",wr("yeaft"),this.hasMoreMessages=!1,this.loadingMoreMessages=!1,this.yeaftHasMoreHistory=!1,this.yeaftLoadingMoreHistory=!1,this.yeaftOldestLoadedSeq=null,this._yeaftReconnectCatchUpPending=!1,this.loadOpenedYeaftSessionsForConnectedAgents(null,{force:!0}),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(r=>r&&r.online&&r.id).map(r=>r.id):[],n=[...new Set(s)];(!this._yeaftOpenedSessionsLoadedAgents||typeof this._yeaftOpenedSessionsLoadedAgents!="object")&&(this._yeaftOpenedSessionsLoadedAgents={});let i=[];for(let r of n)!t&&this._yeaftOpenedSessionsLoadedAgents[r]||(this._yeaftOpenedSessionsLoadedAgents[r]=Date.now(),i.push(r),this.sessionCrudRequest("list",{},{agentId:r}).catch(o=>{delete this._yeaftOpenedSessionsLoadedAgents[r]}));return i},requestYeaftSessionBootstrap({forceSessionReady:e=!1,catchUpHistory:t=!1,forceHistoryReplay:s=!1}={}){if(!this.currentAgent)return;let n=Ys(this),i=n?Ee(this,n):this.currentAgent,r=qe(i,n),o=n?this.yeaftSessionHistoryState[r]: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(A=>A&&(A.sessionId??A.groupId??null)===n),d=!!n&&or({sessionState:o,hasCachedSessionRows:c,force:!!s}),u=!!n&&!d&&Ca(o,t);if(!a&&!d&&!u)return!1;let p=`${i}:${n||"__none__"}`,f=a&&!d&&!u;if(f&&this.yeaftBootstrapMetaLoadingKey===p)return!1;f&&(this.yeaftBootstrapMetaLoadingKey=p),n&&d?(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[r]:{loaded:!1,loading:!0,hasMore:!1,oldestSeq:null,count:0}},this.yeaftLoadingMoreHistory=!0):n&&c&&!o?.loaded?(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[r]:{...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&&(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[r]:{...o,loaded:!0,loading:!0,latestSeq:l}},this.yeaftLoadingMoreHistory=!0);let g={type:"yeaft_load_history",agentId:i,sessionId:n};u?g.afterSeq=l:g.limit=d?Vn:0;let v=Us();g.perfTraceId=v;let y=u?"delta":d?"recent":"metadata";return n&&(this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[r]:v}),Qe(this,{traceId:v,phase:"history.request_send",agentId:i,sessionId:n,messageType:g.type,bytes:JSON.stringify(g).length,detail:{mode:y,limit:g.limit??null,afterSeq:g.afterSeq??null,hasCachedSessionRows:c,needSessionReady:a}}),this.sendWsMessage(g),!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:i=null,search:r=void 0}={}){if(!this.currentAgent)return;let o=typeof r=="string"?r.trim():(this.yeaftDebugSearch||"").trim(),a=typeof i=="string"&&i,l=o&&!a?dc:Pr,c=Number.isFinite(t)&&t>0?t:this.yeaftDebugHistoryLimit||l,d=Math.max(1,Math.min(l,c)),u=a?"detail":"list",p=`dbg_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,f=JSON.stringify({agentId:this.currentAgent,groupId:e||null,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5,indexOnly:!!n,detailTurnId:i||null,search:a?"":o});if(this._yeaftDebugHistoryInFlightKey===f)return;this._yeaftDebugHistoryInFlightKey=f,a||(this._yeaftDebugHistoryLatestListRequestId=p),this.yeaftDebugHistoryLimit=d,this.yeaftDebugHistoryLoading=!0,this.yeaftDebugHistoryError=null;let g={type:"yeaft_fetch_debug_history",agentId:this.currentAgent,requestId:p,requestKind:u,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5};n&&(g.indexOnly=!0),typeof i=="string"&&i?g.detailTurnId=i: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 Ee(this,e)},sendYeaftSessionMessage({groupId:e,text:t,mentions:s,attachments:n}){let i=Ee(this,e);if(!e||!i)return;let r=Array.isArray(n)?n.filter(p=>p&&p.fileId):[],o=r.length>0;if(!t?.trim()&&!o)return;let a=t?.trim()?t:"(attached files)",l=`u_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,c=Us();this.yeaftPerfTraceByMessageId={...this.yeaftPerfTraceByMessageId||{},[l]:c},Qe(this,{traceId:c,phase:"send.prepare",agentId:i,sessionId:e,turnId:l,messageType:"yeaft_session_send",detail:{mentionCount:Array.isArray(s)?s.length:0,attachmentCount:r.length}});let d=ps(this,e);if(d){let p={id:l,messageId:l,clientMessageId:l,type:"user",content:a,sessionId:e,turnId:l};r.length>0&&(p.attachments=r.map(f=>({fileId:f.fileId,name:f.name,preview:f.preview,isImage:!!f.isImage,mimeType:f.mimeType||""}))),this.addMessageToConversation(d,p),this.processingConversations[d]=!0,e&&(this.yeaftProcessingSessions={...this.yeaftProcessingSessions,[e]:!0}),this._turnCompletedConvs?.delete(d),this._closedAt?.[d]&&delete this._closedAt[d],this.getOrCreateExecutionStatus(d),lr(this,d)}let u={type:"yeaft_session_send",agentId:i,id:l,sessionId:e,text:a,mentions:Array.isArray(s)?s:[],perfTraceId:c};r.length>0&&(u.attachments=r.map(p=>({fileId:p.fileId,isImage:!!p.isImage}))),Qe(this,{traceId:c,phase:"send.websocket_send",agentId:i,sessionId:e,turnId:l,messageType:u.type,bytes:JSON.stringify(u).length}),this.sendWsMessage(u)},cancelYeaftTask({sessionId:e,taskId:t}){let s=typeof e=="string"?e.trim():"",n=typeof t=="string"?t.trim():"",i=Ee(this,s);return!i||!s||!n?!1:(this.yeaftStoppingTasksById={...this.yeaftStoppingTasksById,[Mr(s,n)]:!0},this.sendWsMessage({type:"yeaft_task_cancel",agentId:i,sessionId:s,taskId:n,clientRequestId:`task_cancel_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}),!0)},getYeaftMessageWindowKey(e=null){return e||this.yeaftActiveSessionFilter||"__all__"},pruneYeaftMessageWindow(e=null){if(this.currentView!=="yeaft")return;let t=this.getYeaftMessageWindowKey(e);this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[t]:{visibleTurns:Ut()}}},expandYeaftMessageWindow(e=null,t=xr()){if(this.currentView!=="yeaft")return;let s=this.getYeaftMessageWindowKey(e),i=(this.yeaftMessageWindowState[s]?.visibleTurns||Ut())+Math.max(1,Number.isFinite(t)?Math.floor(t):xr());this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[s]:{visibleTurns:i}}},revealYeaftMessage(e,t,s=null){let n=e||this.yeaftActiveSessionFilter||null,i=s||ps(this,n);if(!i||!t)return!1;let r=(this.messagesMap[i]||[]).filter(u=>n?(u?.sessionId??u?.groupId??null)===n:!0),o=r.findIndex(u=>(u?.id||u?.messageId)===t||u?.persistedMessageId===t);if(o<0)return!1;let a=Ql(r),l=a.findIndex(u=>o>=u.start&&o<u.end);if(l<0)return!1;let c=Math.max(Ut(),a.length-l),d=this.getYeaftMessageWindowKey(n);return this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[d]:{visibleTurns:c}},!0},getYeaftHistoryOutlineState(e=null,t=null){let s=e||this.yeaftActiveSessionFilter||null,n=Ee(this,s,t),i=qe(n,s),r=this.yeaftHistoryOutlineBySession[i]||{requestId:null,agentId:n,sessionId:s,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,totalCount:null,loaded:!1,error:null},o=ps(this,s),a=o?this.messagesMap[o]||[]:[],l=new Map((r.results||[]).map(p=>[Gs(p),p])),c=0;for(let p of a){if((p?.sessionId??p?.groupId??null)!==s)continue;let f=p.messageId||p.id;if(!f)continue;let g=p.type==="user"&&!!p.clientMessageId&&f===p.clientMessageId,v=p.type==="assistant"&&p.isStreaming===!0;if(!g&&!v)continue;let y=p.type,A=p.turnId||p.threadId||f,x=p.speakerVpId||p.vpId||null,k=Gs({role:y,messageId:f,clientMessageId:p.clientMessageId,turnId:A,speakerVpId:x}),b=l.get(k),w=(typeof p.content=="string"?p.content:"").replace(/\s+/g," ").trim();l.set(k,{...b,messageId:Number.isFinite(b?.seq)?b.messageId:f,...p.clientMessageId?{clientMessageId:p.clientMessageId}:{},turnId:A,role:y,speakerVpId:x||b?.speakerVpId||null,timestamp:p.timestamp||p.ts||b?.timestamp||null,snippet:w.length>180?`${w.slice(0,180).trimEnd()}\u2026`:w||b?.snippet||""}),b||(c+=1)}let d=p=>{let f=typeof p=="number"?p:Date.parse(p||"");return Number.isFinite(f)?f:0},u=Array.from(l.values()).sort((p,f)=>Number.isFinite(p.seq)&&Number.isFinite(f.seq)?p.seq-f.seq:d(p.timestamp)-d(f.timestamp));return{...r,results:u,totalCount:Number.isFinite(r.totalCount)?r.totalCount+c:r.totalCount}},promoteYeaftHistoryOutlineRow(e){let t=e?.sessionId??e?.groupId??null,s=Ee(this,t),n=qe(s,t),i=this.yeaftHistoryOutlineBySession[n];if(!t||!s||!i?.loaded||i.loading)return!1;let r=e?.type;if(r!=="user"&&r!=="assistant")return!1;let o=e.dbMessageId||e.messageId||e.id||null,a=cg(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(),p=Gs({role:r,messageId:o,clientMessageId:e.clientMessageId,turnId:l,speakerVpId:c}),f=new Map((i.results||[]).map(k=>[Gs(k),k])),g=f.get(p);f.set(p,{...g,messageId:o,...e.clientMessageId?{clientMessageId:e.clientMessageId}:{},turnId:l,seq:a,role:r,speakerVpId:c,timestamp:e.timestamp||e.ts||g?.timestamp||null,snippet:u.length>180?`${u.slice(0,180).trimEnd()}\u2026`:u||g?.snippet||""});let v=50,y=Array.from(f.values()).sort((k,b)=>(k.seq||0)-(b.seq||0)),A=y.length>v,x=y.slice(-v);return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[n]:{...i,results:x,hasMore:i.hasMore||A,nextBeforeSeq:A&&Number.isFinite(x[0]?.seq)?x[0].seq:i.nextBeforeSeq,totalCount:Number.isFinite(i.totalCount)&&!g?i.totalCount+1:i.totalCount}},!0},promoteCompletedYeaftHistoryOutline(e,t=null){let s=this.messagesMap[e]||[],n=null,i=[];for(let r=s.length-1;r>=0;r--){let o=s[r];if(o?.type==="user")break;if(t&&o?.turnId&&o.turnId!==t||o?.type!=="assistant")continue;let a=typeof o.content=="string"?o.content.replace(/\s+/g," ").trim():"";n?!String(n.content||"").trim()&&a&&(n=o):n=o,a&&i.unshift(a)}return n?this.promoteYeaftHistoryOutlineRow({...n,content:i.join(" ")}):!1},invalidateYeaftHistoryOutline(e){let t=Ee(this,e),s=qe(t,e),n=this.yeaftHistoryOutlineBySession[s];return!e||!t||!n?!1:n.loading?(this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[s]:{...n,refreshPending:!0}},!0):(this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[s]:{...n,loaded:!1,refreshPending:!1}},this.currentView==="yeaft"&&this.yeaftActiveSessionFilter===e?this.loadYeaftHistoryOutline({force:!0}):!0)},loadYeaftHistoryOutline({append:e=!1,force:t=!1,targetSessionId:s=null,targetAgentId:n=null}={}){if(this.currentView!=="yeaft"&&!s)return!1;let i=s||this.yeaftActiveSessionFilter||null,r=n||Ee(this,i);if(!i||!r)return!1;let o=qe(r,i),a=this.getYeaftHistoryOutlineState(i,r);if(!e&&a.loaded&&!t)return!0;if(e&&(!a.hasMore||!Number.isFinite(a.nextBeforeSeq))||a.loading)return!1;if(!ac(this,r,"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:r,sessionId:i,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 p=this.yeaftHistoryOutlineBySession[o];if(p?.requestId!==l)return;let f={...this._yeaftHistoryOutlineTimeouts};delete f[o],this._yeaftHistoryOutlineTimeouts=f;let g=p.refreshPending===!0;this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[o]:{...p,requestId:null,loading:!1,requestAppend:!1,loaded:g?!1:p.loaded,refreshPending:!1,error:g?null:"timeout"}},g&&this.loadYeaftHistoryOutline({force:!0,targetSessionId:i,targetAgentId:r})},1e4);return this._yeaftHistoryOutlineTimeouts={...this._yeaftHistoryOutlineTimeouts,[o]:u},this.sendWsMessage({type:"yeaft_load_history_outline",agentId:r,sessionId:i,requestId:l,limit:50,...e&&Number.isFinite(a.nextBeforeSeq)?{beforeSeq:a.nextBeforeSeq}:{},includeTotal:!a.loaded}),!0},handleYeaftHistoryOutline(e){if(!e?.agentId||!e?.sessionId)return!1;let t=qe(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 i={...this._yeaftHistoryOutlineTimeouts};delete i[t],this._yeaftHistoryOutlineTimeouts=i;let r=Array.isArray(e.results)?e.results:[],o=s.requestAppend?[...s.results||[],...r]:r,a=new Map(o.filter(d=>d?.messageId).map(d=>[Gs(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,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}={}){if(this.currentView!=="yeaft")return!1;let s=typeof e=="string"?e.trim():"",n=this.yeaftActiveSessionFilter||null,i=Ee(this,n);if(this._yeaftHistorySearchTimeout&&(clearTimeout(this._yeaftHistorySearchTimeout),this._yeaftHistorySearchTimeout=null),!n||!i||s.length<2)return this.yeaftHistorySearchState={requestId:null,agentId:i,sessionId:n,query:s,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null},!1;let r=this.yeaftHistorySearchState||{};if(!ac(this,i,"session_history_search"))return this.yeaftHistorySearchState={requestId:null,agentId:i,sessionId:n,query:s,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:"unsupported"},!1;let o=`history_search_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;return this.yeaftHistorySearchState={requestId:o,agentId:i,sessionId:n,query:s,loading:!0,results:t&&r.query===s?r.results:[],hasMore:!1,nextBeforeSeq:t&&r.query===s?r.nextBeforeSeq:null,error:null},this._yeaftHistorySearchTimeout=setTimeout(()=>{this.yeaftHistorySearchState?.requestId===o&&(this._yeaftHistorySearchTimeout=null,this.yeaftHistorySearchState={...this.yeaftHistorySearchState,loading:!1,error:"timeout"})},1e4),this.sendWsMessage({type:"yeaft_search_history",agentId:i,sessionId:n,requestId:o,query:s,limit:20,...t&&Number.isFinite(r.nextBeforeSeq)?{beforeSeq:r.nextBeforeSeq}:{}}),!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)return!1;this._yeaftHistorySearchTimeout&&(clearTimeout(this._yeaftHistorySearchTimeout),this._yeaftHistorySearchTimeout=null);let s=Array.isArray(e.results)?e.results:[],n=new Map((t.results||[]).map(i=>[i.messageId,i]));for(let i of s)i?.messageId&&n.set(i.messageId,i);return this.yeaftHistorySearchState={...t,loading:!1,results:Array.from(n.values()),hasMore:!!e.hasMore,nextBeforeSeq:Number.isFinite(e.nextBeforeSeq)?e.nextBeforeSeq:null,error:e.error||null},!0},loadYeaftHistoryWindow(e){let t=this.yeaftActiveSessionFilter||null,s=Ee(this,t);if(!t||!s||!e?.messageId||!Number.isFinite(e.seq))return Promise.resolve(!1);if(this.revealYeaftMessage(t,e.messageId))return Promise.resolve(!0);let n=`history_window_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,i=this._yeaftHistoryWindowPending;return i&&(clearTimeout(i.timeout),i.resolve(!1),this._yeaftHistoryWindowPending=null),new Promise(r=>{let o=setTimeout(()=>{this._yeaftHistoryWindowPending?.requestId===n&&(this._yeaftHistoryWindowPending=null),r(!1)},1e4);this._yeaftHistoryWindowPending={requestId:n,agentId:s,sessionId:t,messageId:e.messageId,resolve:r,timeout:o},this.sendWsMessage({type:"yeaft_load_history_window",agentId:s,sessionId:t,requestId:n,anchorMessageId:e.messageId,anchorSeq:e.seq,beforeTurns:3,afterTurns:3})})},handleYeaftHistoryWindow(e,t=null){let s=this._yeaftHistoryWindowPending;if(!s||e?.requestId!==s.requestId||e.agentId!==s.agentId||e.sessionId!==s.sessionId)return!1;clearTimeout(s.timeout),this._yeaftHistoryWindowPending=null;let n=!e.error&&!!t&&this.revealYeaftMessage(s.sessionId,s.messageId,t);return s.resolve(!!n),!!n},createYeaftSession({displayName:e,vpIds:t,defaultVpId:s,workDir:n,agentId:i}={}){let r=Array.isArray(t)?t.slice():[],o=s&&r.includes(s)?s:r[0]||null,a=(e||"").trim(),l=(n||"").trim(),c={roster:r,defaultVpId:o};return a&&(c.name=a),l&&(c.workDir=l),this.sessionCrudRequest("create",c,{agentId:i})},handleYeaftOutput(e){if(!e)return;if(e.perfTraceId&&(Qe(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 s=e.conversationId||this.yeaftConversationId;if(s){let n=e.agentId||this.yeaftAgentId||this.currentAgent||null,i=e.sessionId??e.groupId??null,r=lc(this,i,n),o=n&&this.yeaftConversationIdsByAgent?this.yeaftConversationIdsByAgent[n]:null,a=!r&&o===this.yeaftConversationId;if(this.currentView==="yeaft"&&n&&o&&o!==s){let p=this.messagesMap[o]||[],f=this.messagesMap[s]||[];this.messagesMap[s]=rr(f,p).sort((g,v)=>(g.timestamp||0)-(v.timestamp||0)),!a&&String(o).startsWith("yeaft-local-")&&delete this.messagesMap[o]}n&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[n]:s}),(r||!this.yeaftConversationId)&&(this.yeaftConversationId=s),r&&(this.activeConversations=[s]),this.messagesMap[s]||(this.messagesMap[s]=[]),this.currentView==="yeaft"&&(e.data?.type==="user"||e.data?.type==="text_delta")&&this.pruneYeaftMessageWindow(this.yeaftActiveSessionFilter&&e.sessionId||null);let l=this._currentYeaftSessionId,c=this._currentYeaftVpId,d=this._currentYeaftTurnId,u=this._currentYeaftThreadId;i!=null&&(this._currentYeaftSessionId=i),e.vpId&&(this._currentYeaftVpId=e.vpId),e.turnId&&(this._currentYeaftTurnId=e.turnId),e.threadId&&(this._currentYeaftThreadId=e.threadId);try{this.currentView==="yeaft"&&i&&(!this.yeaftActiveSessionFilter||i===this.yeaftActiveSessionFilter)&&this.pruneYeaftMessageWindow(this.yeaftActiveSessionFilter?i:null);let f=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(this.handleAssistantOutputFrame(s,e.data),e.perfTraceId){let b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Qe(this,{traceId:e.perfTraceId,phase:"store.apply_output",agentId:e.agentId||null,sessionId:i||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||null,durationMs:b-f}),Pn(this,{traceId:e.perfTraceId,agentId:e.agentId||null,sessionId:i||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||null})}let g=e.data,v=g?.message?.id||g?.id||null,y=lg(v),A=Array.isArray(g?.message?.content)?g.message.content:[],x=A.some(b=>b?.type==="tool_use"),k=!!g?.tool_use_result||A.some(b=>b?.type==="tool_result");if(i){let b=!k&&!ag(this,s,i)&&(g?.type==="user"||g?.type==="assistant"&&!x)?y:null,m=qe(e.agentId||null,i),w=this.yeaftSessionHistoryState[m]||{},E=Number.isFinite(w.latestSeq)?w.latestSeq:-1;b!==null&&b>E&&(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[m]:{...w,latestSeq:b}})}}finally{this._currentYeaftSessionId=l,this._currentYeaftVpId=c,this._currentYeaftTurnId=d,this._currentYeaftThreadId=u}}return}let t=e.event;if(t)switch(t.type){case"ask_user_question":{let s=e.conversationId||this.yeaftConversationId;if(!s||!t.requestId)break;let n=tc(e,t,s),i=()=>{let r=this.messagesMap[s]||[],o=nc(r,n,s);if(o){if(o.askAnswered||o.askExpired)return!0;o.toolName="AskUserQuestion",t.toolCallId&&!o.toolId&&(o.toolId=t.toolCallId),o.agentId=n.agentId||o.agentId||null,o.askRequestId=t.requestId,o.askQuestions=t.questions||[],o.askCreatedAt=t.createdAt||null,o.askExpiresAt=t.expiresAt||null,t.replay&&(o.askPending=!1,o.pendingAnswers=null,o.askSubmitGeneration=null),o.isHistory=!1;let c=ic(this,n);return c&&Tr(o,c),this.messagesMap={...this.messagesMap,[s]:r.slice()},!0}if(!t.replay)return!1;let a={id:`ask-card-${t.requestId}`,type:"tool-use",toolName:"AskUserQuestion",toolId:t.toolCallId||null,toolInput:{questions:t.questions||[]},askRequestId:t.requestId,askQuestions:t.questions||[],askCreatedAt:t.createdAt||null,askExpiresAt:t.expiresAt||null,agentId:n.agentId,sessionId:n.sessionId,vpId:n.vpId,speakerVpId:n.vpId,turnId:n.turnId,threadId:n.threadId||"main",hasResult:!1,isHistory:!1,timestamp:t.createdAt||Date.now()},l=ic(this,n);return l&&Tr(a,l),r.push(a),this.messagesMap={...this.messagesMap,[s]:r.slice()},!0};if(!i()){let r=0,o=setInterval(()=>{r+=1,(i()||r>=10)&&clearInterval(o)},200)}break}case"ask_user_answered":case"ask_user_expired":{let s=e.conversationId||this.yeaftConversationId;if(!s||!t.requestId)break;let n=this.messagesMap[s]||[],i=tc(e,t,s),r=nc(n,i,s);if(!r){og(this,i,t);break}Tr(r,t),this.messagesMap={...this.messagesMap,[s]:n.slice()};break}case"session_ready":{let s=t.conversationId,n=e.agentId||this.currentAgent,i=n&&this.yeaftConversationIdsByAgent?this.yeaftConversationIdsByAgent[n]:null,r=this.yeaftConversationId?String(this.yeaftConversationId):"",o=r.startsWith("yeaft-local-")&&(!n||r.startsWith(`yeaft-local-${n}-`)||/^yeaft-local-\d/.test(r))?this.yeaftConversationId:null,a=i||o,l=t.sessionId||e.sessionId||null,c=lc(this,l,n),d=!c&&a===this.yeaftConversationId;if(a&&a!==s){let v=this.messagesMap[a]||[],y=this.messagesMap[s]||[];this.messagesMap[s]=rr(y,v).sort((A,x)=>(A.timestamp||0)-(x.timestamp||0)),!d&&a.startsWith("yeaft-local-")&&delete this.messagesMap[a],this.processingConversations[a]&&(this.processingConversations[s]=!0,d||delete this.processingConversations[a]),this.executionStatusMap[a]&&(this.executionStatusMap[s]=this.executionStatusMap[a],d||delete this.executionStatusMap[a])}else this.messagesMap[s]||(this.messagesMap[s]=[]);n&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[n]:s},this.cacheYeaftAgentStatus(n,t,{allowBootstrapCatalog:c})),c&&(this.yeaftModel=t.model,this.yeaftModelEffort=t.modelEffort||null,this.yeaftSessionReady=!0,this.yeaftBootstrapMetaLoadingKey=null,n?this.applyCachedYeaftStatus(n):this.yeaftAvailableModels=t.availableModels||[]);let u=Array.isArray(t.tasks)?t.tasks:[],p={};for(let v of u)!v?.id||!v.sessionId||v.status!=="running"||(p[v.sessionId]={...p[v.sessionId]||{},[v.id]:v});this.yeaftActiveTasksBySession=p,c&&(t.yeaftDir&&(this.yeaftYeaftDir=t.yeaftDir),this.yeaftStatus={skills:t.skills,mcpServers:t.mcpServers,tools:t.tools,multiVp:!!t.multiVp}),(c||!this.yeaftConversationId)&&(this.yeaftConversationId=s),c&&(this.activeConversations=[s]);let f=e.agentId||this.currentAgent||null,g=f||"__current__";this._yeaftVpSubscribedAgentKey!==g&&(this._yeaftVpSubscribedAgentKey=g,this.sendWsMessage(f?{type:"yeaft_vp_subscribe",agentId:f}:{type:"yeaft_vp_subscribe"}));break}case"yeaft_status":{let s=e.agentId||this.currentAgent;s&&this.cacheYeaftAgentStatus(s,t);break}case"context_usage":break;case"turn_open":{if(!t.turnId)break;let s={turnId:t.turnId,userPrompt:t.userPrompt||"",vpId:t.vpId||e.vpId||null,sessionId:t.sessionId||e.sessionId||null,openedAt:t.at||Date.now(),closedAt:null,totalMs:0,totalTokens:0,loopCount:0,memoryLoaded:null,memoryAdjust:null,tools:[],detailsLoaded:!0};this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:s},this.yeaftDebugTurnOrder.includes(t.turnId)||(this.yeaftDebugTurnOrder=[...this.yeaftDebugTurnOrder,t.turnId]);break}case"turn_close":{if(!t.turnId)break;let s=this.yeaftDebugTurnsById[t.turnId];if(!s)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...s,closedAt:Date.now(),totalMs:t.totalMs||0,totalTokens:t.totalTokens||0,loopCount:t.loopCount||s.loopCount||0}};break}case"memory_used":{if(!t.turnId)break;let s=this.yeaftDebugTurnsById[t.turnId];if(!s)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...s,memoryLoaded:Array.isArray(t.loaded)?t.loaded:[]}};break}case"dream_memory_loaded":{let s=Array.isArray(t.resident)?t.resident:[];if(t.turnId){let i=this.yeaftDebugTurnsById[t.turnId];i&&(this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...i,dreamMemoryLoaded:s,dreamMemoryLoadedInto:t.loadedInto||"system_prompt.memory"}})}let n={};for(let i of s){let r=i&&typeof i.scope=="string"?i.scope:null,o=r&&/^sessions\/[^/]+$/.test(r)?r:r&&/^group\/[^/]+$/.test(r)?`sessions/${r.slice(6)}`:null;o&&(n[o]={scope:o,sourceScope:r,sessionId:o.slice(9),turnId:t.turnId||null,vpId:t.vpId||null,loadedInto:t.loadedInto||"system_prompt.memory",summary:i.summary||"",truncated:!!i.truncated,receivedAt:Date.now()})}Object.keys(n).length>0&&(this.yeaftDreamPromptLoads={...this.yeaftDreamPromptLoads,...n});break}case"memory_adjust":{if(!t.turnId)break;let s=this.yeaftDebugTurnsById[t.turnId];if(!s)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...s,memoryAdjust:{sessionKey:t.sessionKey||null,added:t.added||0,evicted:t.evicted||0,skipped:t.skipped||0,reason:t.reason||""}}};break}case"tool_exec":{if(!t.turnId)break;let s=this.yeaftDebugTurnsById[t.turnId];if(!s)break;let n=[...s.tools||[],{loopNumber:t.loopNumber||0,callId:t.callId||null,name:t.name||"?",durationMs:t.durationMs||0,isError:!!t.isError,toolOutput:t.toolOutput==null?null:String(t.toolOutput)}];this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...s,tools:n}};break}case"loop":{if(this.yeaftDebugLoops.push({turnId:t.turnId||null,loopNumber:t.loopNumber||0,model:t.model,systemPrompt:t.systemPrompt,messages:t.messages,response:t.response,toolCalls:t.toolCalls,usage:t.usage||{inputTokens:0,outputTokens:0,totalTokens:0},latencyMs:t.latencyMs,ttfbMs:t.ttfbMs,stopReason:t.stopReason,at:typeof t.at=="number"?t.at:null,rawRequest:t.rawRequest||null,rawResponse:t.rawResponse||null,sessionId:e.sessionId||null,vpId:e.vpId||t.vpId||null}),this.yeaftDebugLoops.length>cc){let s=Nl({loops:this.yeaftDebugLoops,turnsById:this.yeaftDebugTurnsById,turnOrder:this.yeaftDebugTurnOrder,maxLoops:Math.max(cc,this.yeaftDebugHistoryLimit||0)});this.yeaftDebugLoops=s.loops,this.yeaftDebugTurnsById=s.turnsById,this.yeaftDebugTurnOrder=s.turnOrder}break}case"recall":case"consolidate":case"fallback":case"thinking_delta":break;case"reflection":{let s=e.conversationId||this.yeaftConversationId||"unknown",n=Array.isArray(t.loopRange)?t.loopRange:[0,0],i=`${s}:${t.trigger}:${n[0]}-${n[1]}`,r=this.yeaftReflectionCards[i],o=this.messagesMap[s]||[],a=r?r.anchorMsgId:o.length>0&&o[o.length-1].id||null,l=r?r.anchorOrder:o.length;this.yeaftReflectionCards={...this.yeaftReflectionCards,[i]:{key:i,conversationId:s,turnId:t.turnId||r&&r.turnId||null,loopNumber:t.loopNumber||r&&r.loopNumber||null,trigger:t.trigger,status:t.status,loopRange:n,toolCount:t.toolCount||0,content:t.content||"",durationMs:t.durationMs||0,error:t.error||null,sessionId:e.sessionId||null,anchorMsgId:a,anchorOrder:l,updatedAt:Date.now()}};break}case"model_switched":this.yeaftModel=t.model,this.yeaftModelEffort=t.modelEffort||null;break;case"yeaft_task_event":{let s=t.task;if(!s?.id||!s.sessionId)break;let n={...this.yeaftActiveTasksBySession},i={...n[s.sessionId]||{}};s.status==="running"||pc.has(s.status)?i[s.id]=s:delete i[s.id];let r=oc(i);if(Object.keys(r).length>0?n[s.sessionId]=r:delete n[s.sessionId],this.yeaftActiveTasksBySession=n,s.status!=="running"){let{[Mr(s.sessionId,s.id)]:o,...a}=this.yeaftStoppingTasksById||{};this.yeaftStoppingTasksById=a}break}case"yeaft_task_cancel_result":{let s=t.taskId||t.task?.id||null,n=t.task?.sessionId||t.sessionId||e.sessionId||null;if(s&&n&&t.success===!1){let{[Mr(n,s)]:r,...o}=this.yeaftStoppingTasksById||{};this.yeaftStoppingTasksById=o}let i=t.task;if(i?.id&&i.sessionId){let r={...this.yeaftActiveTasksBySession},o={...r[i.sessionId]||{}};o[i.id]=i;let a=oc(o);Object.keys(a).length>0?r[i.sessionId]=a:delete r[i.sessionId],this.yeaftActiveTasksBySession=r}break}case"sub_agent_event":{let s=e.conversationId||this.yeaftConversationId||"unknown",n=t.agentId;if(!n)break;let i=t.payload||{},r=`${s}:${n}`,o=this.yeaftSubAgentCards[r],a=this.messagesMap[s]||[],l=o?o.anchorMsgId:a.length>0&&a[a.length-1].id||null,c=o?o.anchorOrder:a.length,d=o?{...o}:{key:r,conversationId:s,agentId:n,agentName:i.agentName||"sub-agent",status:"running",text:"",toolCallCount:0,turns:0,error:null,expanded:!1,anchorMsgId:l,anchorOrder:c,updatedAt:Date.now(),sessionId:e.sessionId||null};switch(i.agentName&&!d.agentName&&(d.agentName=i.agentName),i.type){case"sub_agent_status":d.status=i.status||d.status,i.error&&(d.error=i.error);break;case"text_delta":break;case"tool_use":case"tool_call":d.toolCallCount=Number(d.toolCallCount||0)+1;break;case"tool_start":break;case"tool_result":case"tool_end":break;case"sub_agent_turn_end":{d.turns+=1;let u=typeof i.content=="string"?i.content.trim():"";u&&(d.text=d.text?`${d.text}
|
|
6
|
+
`)+(s||"")}}function ll(e){return Object.values(il).filter(t=>e||!t.adminOnly).sort((t,s)=>t.order-s.order)}var il,dt,al,Wt,js=O(()=>{il={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}},dt={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"}]}};al="dev",Wt=3});function Gf(e,t){return!t||!e?.yeaftConversationIdsByAgent?[]:Object.entries(e.yeaftConversationIdsByAgent).filter(([,s])=>s===t).map(([s])=>s).filter(Boolean)}function cl(){return`cm_${crypto.randomUUID()}`}function dl(e,t){t!==e.currentAgent&&(e.agentSwitching=!0,e.sendWsMessage({type:"select_agent",agentId:t}))}function ul(e,t,s=null,n=null,i={}){let r=s||e.currentAgent;if(!r){e.addMessage({type:"error",content:xe("chat.agent.selectFirst")});return}cs(e,!0,xe("chat.session.creating"));let o={type:"create_conversation",agentId:r,workDir:t||e.currentAgentWorkDir};n!==null&&(o.disallowedTools=n),i&&typeof i.provider=="string"&&(o.provider=i.provider),i&&i.providerOptions&&typeof i.providerOptions=="object"&&(o.providerOptions=i.providerOptions),e.sendWsMessage(o)}function pl(e,t,s,n=null,i=null,r=null){let o=n||e.currentAgent;if(!o){e.addMessage({type:"error",content:xe("chat.agent.selectFirst")});return}let a=null,l={};i&&typeof i=="object"&&!Array.isArray(i)?l=i:(a=i,r&&typeof r=="object"&&(l=r)),cs(e,!0,xe("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 fl(e,t,s){if(e.panels.length>1){let a=e.activePanelId||e.panels[0]?.id;a&&e.setPanelConversation(a,t);return}if(t===e.currentConversation)return;let n=e.conversations.find(a=>a.id===t&&a.type!=="yeaft");if(n&&n.agentId&&n.agentId!==e.currentAgent){let a=e.agents.find(l=>l.id===n.agentId);a&&(e.currentAgent=n.agentId,e.currentAgentInfo=a,e.sendWsMessage({type:"select_agent",agentId:n.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],n&&(e.currentWorkDir=n.workDir);let i=e.messagesMap[t],r=Ws(i);r!==null?e.sendWsMessage({type:"sync_messages",conversationId:t,afterMessageId:r}):((!i||i.length===0)&&(e.messagesMap[t]=[],cs(e,!0,xe("chat.session.loadingHistory"))),e.sendWsMessage({type:"sync_messages",conversationId:t,turns:5})),e.loadingMoreMessages=!1;let o=e.chatSessionState[t];e.hasMoreMessages=!!o?.hasMoreOlder,ds(e)}function br(e,t,s){t&&e.sendWsMessage({type:"update_conversation_settings",conversationId:t,...s})}function gl(e,t,s){let n=e.currentConversation;if(!n)return;let i=e.conversationMcpServers[n];if(i){let p=i.find(f=>f.name===t);p&&(p.enabled=s)}let r=e.conversationMcpServers[n]||[],o=e.conversationMcpServerTools[n]||{},a=[];for(let p of r)if(!p.enabled){let f=o[p.name];f&&f.length>0?a.push(...f):a.push(`mcp__${p.name}`)}let u=[...(e.conversations.find(p=>p.id===n)?.disallowedTools||[]).filter(p=>!p.startsWith("mcp__")),...a];br(e,n,{disallowedTools:u})}function ml(e,t,s){let n=e.conversations.find(o=>o.id===t);e._recentlyDeletedSessions||(e._recentlyDeletedSessions={}),e._recentlyDeletedSessions[t]=Date.now(),e.conversations=e.conversations.filter(o=>o.id!==t),delete e.messagesMap[t],delete e.chatSessionState[t],delete e.processingConversations[t],ke(e,t),delete e.executionStatusMap[t];let i=e.activeConversations.indexOf(t);i>=0&&(e.activeConversations.splice(i,1),e.activeConversations.length===0&&(localStorage.removeItem("lastViewedConversation"),e.lastViewedConversation=null));for(let o of e.panels)o.conversationId===t&&(o.conversationId=null);let r=e.pinnedSessions.indexOf(t);r>=0&&(e.pinnedSessions.splice(r,1),localStorage.setItem("pinned-sessions",JSON.stringify(e.pinnedSessions))),s&&s!==e.currentAgent?(e.sendWsMessage({type:"select_agent",agentId:s,silent:!0}),e.sendWsMessage({type:"delete_conversation",conversationId:t}),e.sendWsMessage({type:"select_agent",agentId:e.currentAgent,silent:!0})):e.sendWsMessage({type:"delete_conversation",conversationId:t}),e.saveOpenSessions()}function hl(e,t,s){e._recentlyDeletedSessions||(e._recentlyDeletedSessions={}),e._recentlyDeletedSessions[t]=Date.now(),e.conversations=e.conversations.filter(r=>r.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 r of e.panels)r.conversationId===t&&(r.conversationId=null);let i=e.pinnedSessions.indexOf(t);i>=0&&(e.pinnedSessions.splice(i,1),localStorage.setItem("pinned-sessions",JSON.stringify(e.pinnedSessions))),s&&s!==e.currentAgent?(e.sendWsMessage({type:"select_agent",agentId:s,silent:!0}),e.sendWsMessage({type:"delete_conversation",conversationId:t}),e.sendWsMessage({type:"select_agent",agentId:e.currentAgent,silent:!0})):e.sendWsMessage({type:"delete_conversation",conversationId:t})}function vl(e,t,s=[],n={}){let i=n.expertSelections&&n.expertSelections.length>0;if(!t.trim()&&s.length===0&&!i||!e.currentAgent||!e.currentConversation)return;let r=cl();if(e.addMessage({type:"user",content:t,clientMessageId:r,attachments:s.length>0?s:void 0,expertSelections:i?n.expertSelections:void 0}),t.trim()){let c=t.trim().substring(0,100);e.conversationTitles[e.currentConversation]=c}else if(i){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),us(e,e.currentConversation));let a=s.map(c=>c.fileId),l={type:"chat",conversationId:e.currentConversation,prompt:t,fileIds:a,workDir:e.currentWorkDir,clientMessageId:r};if(n.targetRole&&(l.targetRole=n.targetRole),i){l.expertSelections=n.expertSelections;let c=yr(n.expertSelections,e.customExpertRoles,t,e.language||"zh-CN");c&&(l.expertMessage=c.effectivePrompt)}e.sendWsMessage(l)||Bs(e).then(()=>{e.sendWsMessage(l)}).catch(()=>{e.addMessage({type:"system",content:xe("chat.connection.reconnectFailed")}),delete e.processingConversations[e.currentConversation],ke(e,e.currentConversation)})}function yl(e){if(!e.currentConversation||!e.processingConversations[e.currentConversation])return;let t=e.currentConversation;e.sendWsMessage({type:"cancel_execution",conversationId:t}),delete e.processingConversations[t],ke(e,t),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now();let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t),xt(e,t),e.addMessage({type:"system",content:xe("chat.execution.cancelled")})}function bl(e,t,s,n){let i=n||e.currentConversation,o=(e.messagesMap[i]||[]).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?Gf(e,i):[],u=d.length===1?d[0]:null;if(c&&u&&c!==u)return!1;let p=a&&!c&&!u&&typeof e.agentIdForSession=="function"?e.agentIdForSession(l):null,f=e.sendWsMessage(a?{type:"yeaft_ask_user_answer",agentId:c||u||p||e.yeaftAgentId||e.currentAgent||null,conversationId:i,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:i,requestId:t,answers:s});if(o&&!a)o.askAnswered=!0,o.selectedAnswers=s;else if(o&&f!==!1){let g=++Kf;o.askPending=!0,o.pendingAnswers=s,o.askSubmitGeneration=g;let b=setTimeout(()=>{o.askSubmitGeneration!==g||o.askPending!==!0||(o.askPending=!1,o.pendingAnswers=null,o.askSubmitGeneration=null)},jf);typeof b?.unref=="function"&&b.unref()}f!==!1&&i&&!e.processingConversations[i]&&(e.processingConversations[i]=!0,e._closedAt?.[i]&&delete e._closedAt[i],e.getOrCreateExecutionStatus(i))}function wl(e,t){t&&(e.activeConversations.includes(t)||e.activeConversations.length>=3||(e.activeConversations.push(t),e.messagesMap[t]||(e.messagesMap[t]=[],e.sendWsMessage({type:"sync_messages",conversationId:t,turns:5})),ds(e)))}function kl(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 Sl(e,t,s,n=[],i={}){let r=i.expertSelections&&i.expertSelections.length>0;if(!s.trim()&&n.length===0&&!r||!e.currentAgent||!t)return;let o=cl();if(e.addMessageToConversation(t,{type:"user",content:s,clientMessageId:o,attachments:n.length>0?n:void 0,expertSelections:r?i.expertSelections:void 0}),s.trim()){let d=s.trim().substring(0,100);e.conversationTitles[t]=d}else if(r){let d=i.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),us(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(i.targetRole&&(c.targetRole=i.targetRole),r){c.expertSelections=i.expertSelections;let d=yr(i.expertSelections,e.customExpertRoles,s,e.language||"zh-CN");d&&(c.expertMessage=d.effectivePrompt)}e.sendWsMessage(c)||Bs(e).then(()=>{e.sendWsMessage(c)}).catch(()=>{e.addMessageToConversation(t,{type:"system",content:xe("chat.connection.reconnectFailed")}),delete e.processingConversations[t],ke(e,t)})}function Cl(e,t){if(!t||!e.processingConversations[t])return;e.sendWsMessage({type:"cancel_execution",conversationId:t}),delete e.processingConversations[t],ke(e,t),e._closedAt||(e._closedAt={}),e._closedAt[t]=Date.now();let s=e.executionStatusMap[t];s&&(s.currentTool=null),e.finishStreamingForConversation(t),xt(e,t),e.addMessageToConversation(t,{type:"system",content:xe("chat.execution.cancelled")})}function Il(e){e.ws&&e.ws.readyState===WebSocket.OPEN&&e.sendWsMessage({type:"get_agents"})}function Al(e){!e.currentAgent||!e.currentConversation||e.sendWsMessage({type:"refresh_conversation",conversationId:e.currentConversation})}function xl(e,t){t&&e.sendWsMessage({type:"restart_agent",agentId:t})}function Tl(e,t){t&&e.sendWsMessage({type:"upgrade_agent",agentId:t})}var jf,Kf,Ml=O(()=>{Nt();Ot();Zi();_n();xn();bt();js();jf=1e4,Kf=0});function Qf(e=globalThis.localStorage){try{return e?.getItem(Dl)==="yeaft"?"yeaft":Pl}catch{return Pl}}function wr(e,t=globalThis.localStorage){if(e!=="chat"&&e!=="yeaft")return!1;try{return t?.setItem(Dl,e),!!t}catch{return!1}}function _l(e=globalThis.localStorage){let t=Qf(e);if(t!=="yeaft")return{currentView:t,_yeaftTransitionActive:!1,_savedActiveConversations: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,_pendingChatRestoreConversationId:n}}function El(e){let t=!e._yeaftTransitionActive;return t&&(e._savedActiveConversations=[...e.activeConversations],e._yeaftTransitionActive=!0),e.activeConversations=[e.yeaftConversationId],t}function Rl(e){e._yeaftTransitionActive&&(e.activeConversations=e._savedActiveConversations||[],e._savedActiveConversations=null,e._yeaftTransitionActive=!1)}var Dl,Pl,Ll=O(()=>{Dl="yeaft-preferred-conversation-view",Pl="chat"});function $l(e,t,s){let n={...e||{}},i={...n[t]||{}};return i[s]=(i[s]||0)+1,n[t]=i,n}function Vl(e,t,s){let n={...e||{}},i={...n[t]||{}},r=(i[s]||0)-1;return r<=0?delete i[s]:i[s]=r,Object.keys(i).length===0?delete n[t]:n[t]=i,n}var Fl=O(()=>{});function Ol(e){return e.currentView==="yeaft"?e.yeaftConversationId||null:e.activeConversations[0]||null}var Hl=O(()=>{});function Nl({loops:e,turnsById:t,turnOrder:s,maxLoops:n}){if(!Array.isArray(e)||e.length<=n)return{loops:e,turnsById:t,turnOrder:s};let i=e.length-n,r=e.slice(i),o=new Set;for(let c of r)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:r,turnsById:a,turnOrder:l}}var Bl=O(()=>{});function $e(e){let t=Number(e);return Number.isFinite(t)?t:null}function ql(e){return Jf.has(e)?1:0}function eg(e,t){if(!e)return t||null;if(!t)return e;let s=$e(e.progressRevision),n=$e(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 i=ql(e.status),r=ql(t.status);if(i!==r)return r>i?t:e;let o=$e(e.updatedAt)??$e(e.createdAt)??0;return($e(t.updatedAt)??$e(t.createdAt)??0)>o?t:e}function Rn(...e){let t=new Map;for(let s of e){let n=Array.isArray(s)?s:[s];for(let i of n)i?.id&&t.set(i.id,eg(t.get(i.id),i))}return[...t.values()].sort((s,n)=>Number(s.createdAt||0)-Number(n.createdAt||0)||String(s.id||"").localeCompare(String(n.id||"")))}function Ln(e,t){if(!e||!t||e.id!==t.id)return!1;let s=$e(e.revision),n=$e(t.revision);if(s!=null&&n!=null&&s!==n)return s<n;let i=$e(e.updatedAt),r=$e(t.updatedAt);return i!=null&&r!=null&&i<r}function Wl(e,t){if(Ln(e,t))return!0;if(!e||!t||e.id!==t.id)return!1;let s=$e(e.revision),n=$e(t.revision);return e.currentActionId!==t.currentActionId&&s!=null&&n!=null&&s<=n}function Ul(e,t){let s=$e(e?.progressRevision),n=$e(t?.progressRevision);return s!=null&&n!=null&&n<s}function zl(e,t){return!e||e.id!==t?.id||!t.currentActionId?!1:!Array.isArray(e.actions)||!e.actions.some(s=>s?.id===t.currentActionId)}function jl(e,t){if(!e||e.id!==t?.id||Ln(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 i=new Map(t.actionStats.map(o=>[o?.id,o])),r=!1;n=!0,s.actions=e.actions.map(o=>{let a=i.get(o?.id);if(!a)return o;if(r=!0,$e(a?.progressRevision)==null){let{response:c,messages:d,...u}=a;return{...o,...u}}return Ul(o,a)?(n=!1,o):{...o,...a}}),r||(n=!1)}for(let i of Zf)!n&&tg.has(i)||Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i]);return s}function Kl(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 i=s.get(n?.id);return i?Ul(i,n):!1})}function Gl(e,t){return $e(e?.revision)===$e(t?.revision)&&$e(e?.updatedAt)===$e(t?.updatedAt)}function Yl(e,t){return!e||!t||e.id!==t.id?!1:Ln(e,t)?!0:Gl(t,e)&&Kl(t.actions,e.actions)}function Ks(e,t){let s=Array.isArray(e)?e:[],n=s.find(r=>r.id===t?.id)||null,i=n&&Ln(t,n)?n:t;return n&&i===t&&Gl(n,t)&&Kl(n.actionStats,t.actionStats)&&(i={...t,status:n.status,currentActionId:n.currentActionId,currentAction:n.currentAction,executionStats:n.executionStats,failureReason:n.failureReason,actionStats:n.actionStats}),i?.id?[i,...s.filter(r=>r.id!==i.id)].sort((r,o)=>Number(o.updatedAt||0)-Number(r.updatedAt||0)):s}var Zf,Jf,tg,kr=O(()=>{Zf=Object.freeze(["revision","title","goal","workItemType","planningMode","status","lifecycle","attentionState","activeActionIds","attentionActionIds","currentActionId","currentAction","executionStats","failureReason","origin","linkedSessionIds","createdAt","updatedAt"]);Jf=new Set(["completed","failed","cancelled","superseded","interrupted"]);tg=new Set(["status","lifecycle","attentionState","activeActionIds","attentionActionIds","currentActionId","currentAction","executionStats","failureReason"])});function Sr(e){return e?.type==="user"&&typeof e.content=="string"&&e.content.trim()}function Cr(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 Ir(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 i=e.speakerVpId||"",r=t?.speakerVpId||t?.vpId||"";return!!(i&&r&&i!==r)}function Ql(e=[]){let t=[],s=null,n=i=>{s&&(t.push({start:s.start,end:i,kind:s.kind}),s=null)};for(let i=0;i<e.length;i++){let r=e[i];if(r){if(Sr(r)||r.type==="system"||r.type==="error"){n(i),s={start:i,kind:r.type};continue}if(!Cr(r)){s||(s={start:i,kind:"other"});continue}(!s||s.kind==="assistant"&&Ir(s,r))&&(n(i),s={start:i,kind:"assistant",turnId:r.turnId||"",speakerVpId:r.speakerVpId||r.vpId||""}),s.lastTurnId=r.turnId||s.lastTurnId||"",s.speakerVpId=s.speakerVpId||r.speakerVpId||r.vpId||""}}return n(e.length),t}function Xl(e,t){return t?e&&(e.sessionId??e.groupId)===t:!0}function Ar(e=[],t=null,s=5){let n=Math.max(1,Number.isFinite(s)?Math.floor(s):5),i=[],r=[],o=null,a=c=>{o&&(r.push({start:o.start,end:c,kind:o.kind}),o=null)};for(let c of e){if(!Xl(c,t))continue;let d=i.length;if(i.push(c),Sr(c)||c.type==="system"||c.type==="error"){a(d),o={start:d,kind:c.type};continue}if(!Cr(c)){o||(o={start:d,kind:"other"});continue}(!o||o.kind==="assistant"&&Ir(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(i.length),r.length<=n)return i;let l=r[r.length-n];return i.slice(l.start)}function Zl(e=[],t=null,s=5){let n=Math.max(1,s||5),i=0,r=null,o=()=>r?(r=null,i+=1,i>n):!1;for(let a of e)if(Xl(a,t)){if(Sr(a)||a.type==="system"||a.type==="error"){if(o())return!0;r={kind:a.type};continue}if(!Cr(a)){r||(r={kind:"other"});continue}if(!r||r.kind==="assistant"&&Ir(r,a)){if(o())return!0;r={kind:"assistant",turnId:a.turnId||"",speakerVpId:a.speakerVpId||a.vpId||""}}r.lastTurnId=a.turnId||r.lastTurnId||"",r.speakerVpId=r.speakerVpId||a.speakerVpId||a.vpId||""}return o(),i>n}function Ut(){return 5}function xr(){return 5}var Jl=O(()=>{});function tc(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 sc(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 og(e,t){return Dr.every(s=>!t[s]||e[s]===t[s])}function fc(e,t){return Dr.every(s=>!e[s]||!t[s]||e[s]===t[s])}function nc(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)),i=n.filter(o=>og(sc(o,s),t));if(i.length===1)return i[0];let r=n.filter(o=>fc(sc(o,s),t));return r.length===1?r[0]:null}function gc(e){return Dr.map(t=>e[t]||"").join("\0")}function ag(e,t,s){let n=gc(t),i={...e._yeaftAskTerminalEvents||{},[n]:{identity:t,event:s,receivedAt:Date.now()}},r=Object.keys(i);if(r.length>ec){r.sort((o,a)=>i[o].receivedAt-i[a].receivedAt);for(let o of r.slice(0,r.length-ec))delete i[o]}e._yeaftAskTerminalEvents=i}function ic(e,t){let s=e._yeaftAskTerminalEvents||{},n=gc(t),i=s[n]?n:null;if(!i){let l=Object.entries(s).filter(([,c])=>fc(c.identity||{},t));l.length===1&&(i=l[0][0])}if(!i)return null;let r=s[i],{[i]:o,...a}=s;return e._yeaftAskTerminalEvents=a,r?.event||null}function lg(e,t,s){return(e.messagesMap?.[t]||[]).some(n=>n?.type==="tool-use"&&n.sessionId===s&&n.hasResult===!1)}function Tr(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 cg(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 dg(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 Gs(e){return e?.role==="assistant"&&e?.turnId?`response:${e.turnId}:${e.speakerVpId||e.vpId||""}`:e?.clientMessageId?`client:${e.clientMessageId}`:`message:${e?.messageId||""}`}function rc(e){let t=e?.updatedAt||e?.endedAt||e?.createdAt,s=t?Date.parse(t):NaN;return Number.isFinite(s)?s:0}function Mr(e,t){return`${e||""}::${t||""}`}function oc(e){let t=Object.entries(e||{}),s=t.filter(([,i])=>i?.status==="running"),n=t.filter(([,i])=>i&&i.status!=="running"&&pc.has(i.status)).sort((i,r)=>rc(r[1])-rc(i[1])).slice(0,ng);return Object.fromEntries([...s,...n])}function fs(){try{return typeof window>"u"?null:window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore()||null}catch{return null}}function Ee(e,t,s=null){if(s)return s;if(t){let n=fs(),i=n&&typeof n.sessionById=="function"?n.sessionById(t,e?.currentAgent||null):null;if(i&&i.agentId)return i.agentId;let r=e?.yeaftSessionAgentById?e.yeaftSessionAgentById[t]:null;if(r)return r}return e?.currentAgent||null}function ug(e,t){let s=r=>String(r||"").replace(/^v/,"").split(".").slice(0,3).map(o=>Number.parseInt(o,10)),n=s(e),i=s(t);if(n.length<3||i.length<3||[...n,...i].some(r=>!Number.isFinite(r)))return!1;for(let r=0;r<3;r+=1)if(n[r]!==i[r])return n[r]>i[r];return!0}function ac(e,t,s){if(!t||!s)return!1;let n=Array.isArray(e?.agents)?e.agents.find(o=>o?.id===t):null,i=e?.currentAgentInfo?.id===t?e.currentAgentInfo:null;return(n?.capabilities||i?.capabilities||[]).includes(s)?!0:s==="session_history_search"&&ug(n?.version||i?.version,"1.0.166")}function Ys(e,{fallbackDefault:t=!1}={}){if(e?.yeaftActiveSessionFilter)return e.yeaftActiveSessionFilter;let s=fs();return s?.activeSessionId?s.activeSessionId:t?"grp_default":null}function On(e){let t=e.yeaftDebugSessionFilter;if(t==="__all__")return null;if(t)return t;let s=Ys(e);return s||(fs()?.sessions?.grp_default?"grp_default":null)}function ps(e,t=null){let s=t||e?.yeaftActiveSessionFilter||null,n=Ee(e,s);return(n&&e?.yeaftConversationIdsByAgent?e.yeaftConversationIdsByAgent[n]:null)||e?.yeaftConversationId||null}function lc(e,t,s){if(e?.currentView!=="yeaft")return!1;let n=e?.yeaftActiveSessionFilter||null;if(n&&t!==n)return!1;let i=Ee(e,n);return!i||!s||i===s}var sg,Me,$n,Vn,ng,pc,Fn,ig,rg,ec,Dr,cc,Pr,dc,uc,zt,Hn=O(()=>{ct();bt();Zi();xn();Ga();nl();Ml();Ot();Nt();Ll();Fl();Hl();Bl();kr();ur();pr();Jl();({defineStore:sg}=Pinia),Me=Object.freeze([]),$n=(e,t)=>`${e||""}::${t}`,Vn=5,ng=8,pc=new Set(["succeeded","failed","cancelled","orphaned"]),Fn=new Set(["typing","thinking","streaming","tool"]),ig=Object.freeze(["model","availableModels","refreshedAt","catalogRefreshedAt","catalogEpoch","catalogRevision","catalogDigest","refreshStartedAt","refreshReason","refreshError","refreshing"]),rg=8,ec=64;Dr=Object.freeze(["conversationId","agentId","requestId","toolCallId","sessionId","vpId","turnId","threadId"]);cc=1e3,Pr=1,dc=5,uc=200,zt=sg("chat",{state:()=>({ws:null,authenticated:!1,sessionKey:null,serverEncryptionRequired:!0,connectionState:"disconnected",reconnectAttempts:0,maxReconnectAttempts:10,reconnectTimer:null,agents:[],currentAgent:null,currentAgentInfo:null,conversations:[],activeConversations:[],currentWorkDir:null,messagesMap:{},chatSessionState:{},panels:[],activePanelId:null,_pendingPaneId:null,conversationTitles:{},customConversationTitles:{},processingConversations:{},yeaftProcessingSessions:{},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,_pendingSessionTitle:null,workbenchExpanded:!1,workbenchMaximized:!1,sidebarCollapsed:!1,sessionSidebarOpen:!1,compactStatus:null,clearStatus:null,refreshingSession:!1,refreshingSessionMap:{},proxyPorts:{},hasMoreMessages:!1,loadingMoreMessages:!1,yeaftHasMoreHistory:!1,yeaftLoadingMoreHistory:!1,yeaftOldestLoadedSeq:null,yeaftSessionHistoryState:{},yeaftMessageWindowState:{},yeaftBootstrapMetaLoadingKey:null,yeaftHistoryPerfTraceBySession:{},yeaftHistorySearchState:{requestId:null,agentId:null,sessionId:null,query:"",loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null},yeaftHistoryOutlineBySession:{},_yeaftHistoryOutlineTimeouts:{},_yeaftHistorySearchTimeout:null,_yeaftHistoryWindowPending:null,_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")||"[]"),..._l(),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:{},_workCenterActionRequestsGeneration:{},_workCenterActionRequestDetailsGeneration:{},workCenterPending:{},workCenterCreateDraft:null,yeaftConversationId:null,yeaftConversationIdsByAgent:{},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:Pr,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=>Ol(e),messages(e){let t=this.activeConversationId,s=t&&e.messagesMap[t]||Me;if(e.currentView==="yeaft"){let n=e.yeaftActiveSessionFilter||"__all__",i=e.yeaftMessageWindowState[n]?.visibleTurns||Ut();return Ar(s,e.yeaftActiveSessionFilter||null,i)}return s},yeaftAllMessages:e=>{let t=ps(e);return t&&e.messagesMap[t]||Me},yeaftVisibleMessages(e){let t=ps(e),s=t&&e.messagesMap[t]||Me,n=e.yeaftActiveSessionFilter||"__all__",i=e.yeaftMessageWindowState[n]?.visibleTurns||Ut();return Ar(s,e.yeaftActiveSessionFilter||null,i)},hasHiddenYeaftMessages(e){if(e.currentView!=="yeaft")return!1;let t=ps(e),s=t&&e.messagesMap[t]||Me,n=e.yeaftActiveSessionFilter||"__all__",i=e.yeaftMessageWindowState[n]?.visibleTurns||Ut();return Zl(s,e.yeaftActiveSessionFilter||null,i)},vpsTypingInCurrentConv(e){let t=this.activeConversationId;if(!t)return Me;let s=(e.yeaftVpTyping||{})[t];if(!s)return Me;let n=Object.keys(s).filter(i=>(s[i]||0)>0);return n.length===0?Me: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=On(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamLatest?.[s]||null},yeaftDreamSnapshotForActiveSession(e){let t=On(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamSnapshots?.[s]||null},yeaftDreamPromptLoadForActiveSession(e){let t=On(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamPromptLoads?.[s]||null},yeaftDreamEventsForActiveSession(e){let t=On(e);if(!t)return[];let s=`sessions/${t}`,n=Array.isArray(e.yeaftDreamEvents?.[s])?e.yeaftDreamEvents[s]:[],i=Array.isArray(e.yeaftDreamEvents?.["*"])?e.yeaftDreamEvents["*"]:[];return i.length===0?n:n.length===0?i:[...n,...i].sort((r,o)=>(r.at||0)-(o.at||0))},yeaftDebugTurnsForActiveSession:e=>{let t=e.yeaftDebugTurnOrder||Me,s=e.yeaftDebugTurnsById||{},n=e.yeaftDebugLoops||Me,i=e.yeaftReflectionCards||{},r=e.yeaftDebugSessionFilter,o;r==="__all__"?o=null:r?o=r: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(i)){let u=i[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],p=s[u];if(!p||o&&p.sessionId&&p.sessionId!==o)continue;let f=a[u]||Me,g=l[u]||Me,b=f.length,h=0,A=0;for(let y of f){let m=y&&y.usage;m&&Number.isFinite(m.totalTokens)?h+=m.totalTokens:m&&(h+=(m.totalInputTokens||(m.inputTokens||0)+(m.cacheReadTokens||0)+(m.cacheWriteTokens||0))+(m.outputTokens||0)),y&&Number.isFinite(y.latencyMs)&&(A+=y.latencyMs)}let x=!p.closedAt,k={...p,loopCount:x||!p.loopCount?b:p.loopCount,totalTokens:x||!p.totalTokens?h:p.totalTokens,totalMs:x||!p.totalMs?A:p.totalMs,loops:f,reflections:g};c.push(k)}return c},yeaftDebugAvailableSessions:e=>{let t=new Set;for(let s of e.yeaftDebugTurnOrder||Me){let n=e.yeaftDebugTurnsById[s];n&&n.sessionId&&t.add(n.sessionId)}return Array.from(t).sort()},yeaftDebugTurnTotal:e=>(e.yeaftDebugTurnOrder||Me).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=Ys(e);if(!t)return!1;if(e.yeaftProcessingSessions?.[t])return!0;for(let s of Object.values(e.activeVpTurns||{}))if(s?.sessionId===t)return!0;for(let s of Object.values(e.vpStatuses||{}))if((s?.sessionId||s?.groupId||null)===t&&Fn.has(s?.state))return!0;return!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"?fs()?.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=>{if(!t)return!1;if(e.yeaftProcessingSessions?.[t])return!0;for(let s of Object.values(e.activeVpTurns||{}))if(s?.sessionId===t)return!0;for(let s of Object.values(e.vpStatuses||{}))if((s?.sessionId||s?.groupId||null)===t&&Fn.has(s?.state))return!0;return!1},showRecoveryBanner:e=>e.pendingRecovery&&!e.recoveryDismissed&&!e.currentConversation,currentSubagents:e=>{if(!e.currentConversation)return Me;let t=e.subagents[e.currentConversation];return t?Object.values(t):Me},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 Me;let t=e.subagents[e.currentConversation];if(!t)return Me;let s=t[e.activeSubagentId];return(Array.isArray(s?.messages)?s.messages:Me).filter(i=>i?.type==="text")},selectedTaskInfo:()=>null,currentMcpServers:e=>e.currentConversation&&e.conversationMcpServers[e.currentConversation]||Me},actions:{activateChatView({persistPreference:e=!1}={}){let t=this._pendingChatRestoreConversationId;this._pendingChatRestoreConversationId=null,this.currentView="chat",e&&wr("chat"),Rl(this),t&&this.conversations.some(s=>s.id===t)&&(this.autoRestoreConversation(t),this.sendWsMessage({type:"refresh_conversation",conversationId:t}))},enterWorkCenter(e=null){let t=e||this.currentAgent||this.agents.find(s=>s.online)?.id||null;if(t){if(this.currentAgent!==t){this.selectAgent(t),this.currentAgent=t;let s=this.agents.find(n=>n.id===t);s&&(this.currentAgentInfo=s)}this.workCenterAgentId=t,this.workCenterOpen=!0,this.listWorkItems(t).catch(()=>{})}},leaveWorkCenter(){this.workCenterOpen=!1},enterWorkCenterFromSession(e,t=""){if(!e?.id)return;let s=e.agentId||Ee(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)},workCenterRequest(e,t={},s=null){let n=s||this.workCenterAgentId||this.currentAgent;if(!n)return Promise.reject(new Error("No Agent selected"));let i=`work-center-${Date.now()}-${Math.random().toString(36).slice(2)}`;return new Promise((r,o)=>{let a=setTimeout(()=>{delete this.workCenterPending[i],o(new Error("Work Center request timed out"))},3e4);this.workCenterPending[i]={resolve:r,reject:o,timer:a,agentId:n,op:e},this.sendWsMessage({type:"work_center_request",agentId:n,requestId:i,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)},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)},i=JSON.stringify(n),r=Number(this._workCenterListGenerationByAgent[s]||0)+1,o=Number(this._workCenterListEventGenerationByAgent[s]||0);this._workCenterListGenerationByAgent={...this._workCenterListGenerationByAgent,[s]:r},this._workCenterListQueryByAgent={...this._workCenterListQueryByAgent,[s]:i},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]===r&&this._workCenterListQueryByAgent[s]===i&&this.workCenterAgentId===s){let d=l,u=this._workCenterListEventsByAgent[s]||{};for(let p of Object.values(u))Number(p?.generation)<=o||p?.queryKey!==i||(d=p.matches?Ks(d,p.summary):d.filter(f=>f.id!==p.summary?.id));this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[s]:d},this.workCenterListPageByAgent={...this.workCenterListPageByAgent,[s]:{nextCursor:a?.nextCursor||null,queryKey:i}},this.workCenterWatcherByAgent={...this.workCenterWatcherByAgent,[s]:a?.watcher||null},this.workCenterLoadedByAgent={...this.workCenterLoadedByAgent,[s]:!0}}return l}catch(a){throw this._workCenterListGenerationByAgent[s]===r&&this._workCenterListQueryByAgent[s]===i&&(this.workCenterErrorByAgent={...this.workCenterErrorByAgent,[s]:a?.message||String(a)}),a}finally{this._workCenterListGenerationByAgent[s]===r&&this._workCenterListQueryByAgent[s]===i&&(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 i=s.queryKey,r=this._workCenterListGenerationByAgent[t],o=Number(this._workCenterListEventGenerationByAgent[t]||0),a=s.nextCursor,l=`${r}:${i}:${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]!==r||this._workCenterListQueryByAgent[t]!==i||u?.queryKey!==i||u?.nextCursor!==a||this.workCenterAgentId!==t)return[];let p=[...this.workCenterItemsByAgent[t]||[]];for(let g of Array.isArray(d?.items)?d.items:[]){if(this.workItemDeleted(t,g?.id))continue;let b=p.findIndex(h=>h.id===g.id);b<0?p.push(g):p[b]=Ks([p[b]],g)[0]}let f=this._workCenterListEventsByAgent[t]||{};for(let g of Object.values(f))Number(g?.generation)<=o||g?.queryKey!==i||(p=g.matches?Ks(p,g.summary):p.filter(b=>b.id!==g.summary?.id));return this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[t]:p},this.workCenterListPageByAgent={...this.workCenterListPageByAgent,[t]:{nextCursor:d?.nextCursor||null,queryKey:i}},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","_workCenterActionRequestsGeneration","_workCenterActionRequestDetailsGeneration"]){let i={};for(let[r,o]of Object.entries(this[n]||{}))r.startsWith(s)||(i[r]=o);this[n]=i}},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&&Yl(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),i=await this.workCenterRequest("get",{id:e},s);return this.commitWorkCenterDetail(s,i,n),this.workCenterDetailByAgent[s]||i},async loadWorkItemActionMessages(e,t,s,n=null){let i=n||this.workCenterAgentId||this.currentAgent,r=`${i}:${e}:${t}`,o=`${r}:${s==null?"latest":String(s)}`;if(this._workCenterActionMessageRequests[o])return this._workCenterActionMessageRequests[o];this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[r]:!0},this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[r]:null};let a=(async()=>{try{let l=await this.workCenterRequest("get_action_messages",{id:e,actionId:t,cursor:s,limit:20},i);if(this.workItemDeleted(i,e))return l;let c=this.workCenterActionMessages[r]?.messages||[],d=Rn(c,l?.messages||[]),u=this.workCenterActionMessages[r],p=u?.nextCursor,f=s==null?null:Number(s),g=p==null?null:Number(p),b=!u||f==null||g!=null&&f===g;return this.workCenterActionMessages={...this.workCenterActionMessages,[r]:{messages:d,nextCursor:b?l?.nextCursor??null:p,total:Math.max(Number(l?.total)||0,Number(u?.total)||0,d.length)}},l}catch(l){throw this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[r]:l?.message||String(l)},l}finally{let l={...this._workCenterActionMessageRequests};delete l[o],this._workCenterActionMessageRequests=l;let c=Object.keys(l).some(d=>d.startsWith(`${r}:`));this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[r]:c}}})();return this._workCenterActionMessageRequests={...this._workCenterActionMessageRequests,[o]:a},a},async loadWorkItemActionRequests(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,i=`${n}:${e}:${t}`,r=Number(this._workCenterActionRequestsGeneration[i]||0)+1;this._workCenterActionRequestsGeneration={...this._workCenterActionRequestsGeneration,[i]:r},this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[i]:!0},this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[i]:null};try{let o=await this.workCenterRequest("get_action_requests",{id:e,actionId:t},n);return!this.workItemDeleted(n,e)&&this._workCenterActionRequestsGeneration[i]===r&&(this.workCenterActionRequests={...this.workCenterActionRequests,[i]:o?.requests||[]}),o?.requests||[]}catch(o){throw this._workCenterActionRequestsGeneration[i]===r&&(this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[i]:o?.message||String(o)}),o}finally{this._workCenterActionRequestsGeneration[i]===r&&(this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[i]:!1})}},async loadWorkItemActionRequest(e,t,s,n,i=null){let r=i||this.workCenterAgentId||this.currentAgent,o=`${r}:${e}:${t}:${s}:${n}`,a=Number(this._workCenterActionRequestDetailsGeneration[o]||0)+1;this._workCenterActionRequestDetailsGeneration={...this._workCenterActionRequestDetailsGeneration,[o]:a},this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[o]:!0},this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[o]:null};try{let l=await this.workCenterRequest("get_action_request",{id:e,actionId:t,runId:s,requestId:n},r);return!this.workItemDeleted(r,e)&&this._workCenterActionRequestDetailsGeneration[o]===a&&(this.workCenterActionRequestDetails={...this.workCenterActionRequestDetails,[o]:l?.request||null}),l?.request||null}catch(l){throw this._workCenterActionRequestDetailsGeneration[o]===a&&(this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[o]:l?.message||String(l)}),l}finally{this._workCenterActionRequestDetailsGeneration[o]===a&&(this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[o]:!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 i=await this.workCenterRequest("update_settings",{settings:e},s);return this._workCenterSettingsGenerationByAgent[s]===n&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[s]:i?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[s]:i?.runtime||null},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[s]:null}),i},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),i=await this.workCenterRequest("create",e,s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,i,n),i},async updateWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,i=this.beginWorkCenterDetailWrite(n),r=await this.workCenterRequest("update",{id:e,patch:t},n);return await this.listWorkItems(n,this._workCenterListFiltersByAgent[n]||{}),this.commitWorkCenterDetail(n,r,i),r},async startWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),i=await this.workCenterRequest("start",{id:e},s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,i,n),i},async cancelWorkItem(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent,n=this.beginWorkCenterDetailWrite(s),i=await this.workCenterRequest("cancel",{id:e},s);return await this.listWorkItems(s,this._workCenterListFiltersByAgent[s]||{}),this.commitWorkCenterDetail(s,i,n),i},async deleteWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,i=await this.workCenterRequest("delete",{id:e,revision:t},n);return this.removeWorkItemState(n,e),i},async sendWorkItemMessage(e,t,s,n=null){let i=n||this.workCenterAgentId||this.currentAgent,r=this.beginWorkCenterDetailWrite(i),o=await this.workCenterRequest("work_item_message",{id:e,text:t,revision:s},i);return await this.listWorkItems(i,this._workCenterListFiltersByAgent[i]||{}),this.commitWorkCenterDetail(i,o,r),o},async retryWorkItemAction(e,t,s,n,i=null){let r=i||this.workCenterAgentId||this.currentAgent,o=this.beginWorkCenterDetailWrite(r),a=await this.workCenterRequest("retry_action",{id:e,actionId:t,revision:s,generation:n},r);return await this.listWorkItems(r,this._workCenterListFiltersByAgent[r]||{}),this.commitWorkCenterDetail(r,a,o),a},async sendWorkItemActionInput(e,t,s,n,i,r=[],o=null){let a=o||this.workCenterAgentId||this.currentAgent,l=Number(this._workCenterActionInputGenerationByAgent[a]||0)+1;this._workCenterActionInputGenerationByAgent={...this._workCenterActionInputGenerationByAgent,[a]:l};let c=await this.workCenterRequest("action_input",{id:e,text:t,actionId:s,revision:n,generation:i,attachments:r},a);await this.listWorkItems(a,this._workCenterListFiltersByAgent[a]||{});let d=this.workCenterDetailByAgent[a],u=d?.actions?.find(f=>f?.id===s),p=d?.id===e&&Number(d.revision)===Number(n)&&u&&Number(u.generation)===Number(i);return this._workCenterActionInputGenerationByAgent[a]===l&&p&&!Wl(c,d)?(this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[a]:c},c):d?.id===e?d:c},async guideWorkItemAction(e,t,s,n,i,r=[],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:i,attachments:r},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,n=this.workCenterItemsByAgent[e]||[];if(t.type==="work_item.deleted"){this.removeWorkItemState(e,s.id);return}if(this.workItemDeleted(e,s.id))return;let i=this._workCenterListFiltersByAgent[e]||{},r=this.workItemMatchesBoardQuery(s,i),o=Number(this._workCenterListEventGenerationByAgent[e]||0)+1;this._workCenterListEventGenerationByAgent={...this._workCenterListEventGenerationByAgent,[e]:o},this._workCenterListEventsByAgent={...this._workCenterListEventsByAgent,[e]:{...this._workCenterListEventsByAgent[e]||{},[s.id]:{generation:o,queryKey:this._workCenterListQueryByAgent[e]||null,summary:s,matches:r}}};let a=r?Ks(n,s):n.filter(c=>c.id!==s.id);this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[e]:a};let l=this.workCenterDetailByAgent[e];if(l?.id===s.id){let c=zl(l,s);this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[e]:jl(l,s)},c&&this.refreshWorkItemDetailAfterActionChange(e,s)}},async refreshWorkItemDetailAfterActionChange(e,t){let s=`${t.id}:${t.currentActionId}`;if(this._workCenterDetailEventRefreshByAgent[e]===s)return;let n=Number(this._workCenterDetailRequestGenerationByAgent[e]||0);this._workCenterDetailEventRefreshByAgent={...this._workCenterDetailEventRefreshByAgent,[e]:s};try{let i=await this.workCenterRequest("get",{id:t.id},e),r=this.workCenterDetailByAgent[e];r?.id===t.id&&r.currentActionId===t.currentActionId&&i?.currentActionId===t.currentActionId&&this.commitWorkCenterDetail(e,i,n)}catch{}finally{if(this._workCenterDetailEventRefreshByAgent[e]===s){let i={...this._workCenterDetailEventRefreshByAgent};delete i[e],this._workCenterDetailEventRefreshByAgent=i}}},cacheYeaftAgentStatus(e,t,{allowBootstrapCatalog:s=!1}={}){if(!e||!t)return;let n=this.yeaftStatusByAgent[e]||{},i=Number(n.catalogRevision)||0,r=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&&(r>0||c>0),p=Array.isArray(this._yeaftRetiredCatalogEpochsByAgent?.[e])?this._yeaftRetiredCatalogEpochsByAgent[e]:[],f=!!a&&p.includes(a),g=!!a&&a===o,b=r>0?g&&r===i:c>0&&c===l,h=r>0?!!a&&(a!==o||r>i):i===0&&c>l,A=r>0?!!t.catalogDigest&&!!n.catalogDigest&&t.catalogDigest===n.catalogDigest:t.catalogDigest===n.catalogDigest,x=u&&!f&&(h||b&&A),y=x||s&&i===0&&l===0&&!u&&d,m={...t};if(!y)for(let E of ig)delete m[E];let w={...n,...m};if(y){if(x&&o&&a&&o!==a){let E=[...p.filter(R=>R!==o),o].slice(-rg);this._yeaftRetiredCatalogEpochsByAgent={...this._yeaftRetiredCatalogEpochsByAgent||{},[e]:E}}w.availableModels=t.availableModels,w.catalogRefreshedAt=x?c:null,w.catalogEpoch=x&&a||null,w.catalogRevision=x&&r||null,w.catalogDigest=x&&t.catalogDigest||null}this.yeaftStatusByAgent={...this.yeaftStatusByAgent,[e]:w},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)},enterYeaft(e=null){let t=this.currentAgent,s=e||this.currentAgent||null;if(!s){let i=this.agents.find(r=>r.online);i&&(s=i.id)}if(s&&this.currentAgent!==s){this.selectAgent(s),this.currentAgent=s;let i=this.agents.find(r=>r.id===s);i&&(this.currentAgentInfo=i)}if(!this.applyCachedYeaftStatus(s)&&t&&t!==s&&(this.yeaftAvailableModels=[],this.yeaftStatus=null,this.yeaftModelsRefreshing=!0,this.yeaftModelRefreshError=null),s){let i=this.yeaftConversationIdsByAgent?.[s]||null;i||(i=`yeaft-local-${s}-${Date.now()}`,this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[s]:i}),this.yeaftConversationId=i}else this.yeaftConversationId||(this.yeaftConversationId=`yeaft-local-${Date.now()}`);this.messagesMap[this.yeaftConversationId]||(this.messagesMap[this.yeaftConversationId]=[]),El(this),this.currentView="yeaft",wr("yeaft"),this.hasMoreMessages=!1,this.loadingMoreMessages=!1,this.yeaftHasMoreHistory=!1,this.yeaftLoadingMoreHistory=!1,this.yeaftOldestLoadedSeq=null,this._yeaftReconnectCatchUpPending=!1,this.loadOpenedYeaftSessionsForConnectedAgents(null,{force:!0}),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(r=>r&&r.online&&r.id).map(r=>r.id):[],n=[...new Set(s)];(!this._yeaftOpenedSessionsLoadedAgents||typeof this._yeaftOpenedSessionsLoadedAgents!="object")&&(this._yeaftOpenedSessionsLoadedAgents={});let i=[];for(let r of n)!t&&this._yeaftOpenedSessionsLoadedAgents[r]||(this._yeaftOpenedSessionsLoadedAgents[r]=Date.now(),i.push(r),this.sessionCrudRequest("list",{},{agentId:r}).catch(o=>{delete this._yeaftOpenedSessionsLoadedAgents[r]}));return i},requestYeaftSessionBootstrap({forceSessionReady:e=!1,catchUpHistory:t=!1,forceHistoryReplay:s=!1}={}){if(!this.currentAgent)return;let n=Ys(this),i=n?Ee(this,n):this.currentAgent,r=qe(i,n),o=n?this.yeaftSessionHistoryState[r]: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(A=>A&&(A.sessionId??A.groupId??null)===n),d=!!n&&or({sessionState:o,hasCachedSessionRows:c,force:!!s}),u=!!n&&!d&&Ca(o,t);if(!a&&!d&&!u)return!1;let p=`${i}:${n||"__none__"}`,f=a&&!d&&!u;if(f&&this.yeaftBootstrapMetaLoadingKey===p)return!1;f&&(this.yeaftBootstrapMetaLoadingKey=p),n&&d?(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[r]:{loaded:!1,loading:!0,hasMore:!1,oldestSeq:null,count:0}},this.yeaftLoadingMoreHistory=!0):n&&c&&!o?.loaded?(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[r]:{...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&&(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[r]:{...o,loaded:!0,loading:!0,latestSeq:l}},this.yeaftLoadingMoreHistory=!0);let g={type:"yeaft_load_history",agentId:i,sessionId:n};u?g.afterSeq=l:g.limit=d?Vn:0;let b=Us();g.perfTraceId=b;let h=u?"delta":d?"recent":"metadata";return n&&(this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[r]:b}),Qe(this,{traceId:b,phase:"history.request_send",agentId:i,sessionId:n,messageType:g.type,bytes:JSON.stringify(g).length,detail:{mode:h,limit:g.limit??null,afterSeq:g.afterSeq??null,hasCachedSessionRows:c,needSessionReady:a}}),this.sendWsMessage(g),!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:i=null,search:r=void 0}={}){if(!this.currentAgent)return;let o=typeof r=="string"?r.trim():(this.yeaftDebugSearch||"").trim(),a=typeof i=="string"&&i,l=o&&!a?dc:Pr,c=Number.isFinite(t)&&t>0?t:this.yeaftDebugHistoryLimit||l,d=Math.max(1,Math.min(l,c)),u=a?"detail":"list",p=`dbg_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,f=JSON.stringify({agentId:this.currentAgent,groupId:e||null,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5,indexOnly:!!n,detailTurnId:i||null,search:a?"":o});if(this._yeaftDebugHistoryInFlightKey===f)return;this._yeaftDebugHistoryInFlightKey=f,a||(this._yeaftDebugHistoryLatestListRequestId=p),this.yeaftDebugHistoryLimit=d,this.yeaftDebugHistoryLoading=!0,this.yeaftDebugHistoryError=null;let g={type:"yeaft_fetch_debug_history",agentId:this.currentAgent,requestId:p,requestKind:u,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5};n&&(g.indexOnly=!0),typeof i=="string"&&i?g.detailTurnId=i: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 Ee(this,e)},sendYeaftSessionMessage({groupId:e,text:t,mentions:s,attachments:n}){let i=Ee(this,e);if(!e||!i)return;let r=Array.isArray(n)?n.filter(p=>p&&p.fileId):[],o=r.length>0;if(!t?.trim()&&!o)return;let a=t?.trim()?t:"(attached files)",l=`u_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,c=Us();this.yeaftPerfTraceByMessageId={...this.yeaftPerfTraceByMessageId||{},[l]:c},Qe(this,{traceId:c,phase:"send.prepare",agentId:i,sessionId:e,turnId:l,messageType:"yeaft_session_send",detail:{mentionCount:Array.isArray(s)?s.length:0,attachmentCount:r.length}});let d=ps(this,e);if(d){let p={id:l,messageId:l,clientMessageId:l,type:"user",content:a,sessionId:e,turnId:l};r.length>0&&(p.attachments=r.map(f=>({fileId:f.fileId,name:f.name,preview:f.preview,isImage:!!f.isImage,mimeType:f.mimeType||""}))),this.addMessageToConversation(d,p),this.processingConversations[d]=!0,e&&(this.yeaftProcessingSessions={...this.yeaftProcessingSessions,[e]:!0}),this._turnCompletedConvs?.delete(d),this._closedAt?.[d]&&delete this._closedAt[d],this.getOrCreateExecutionStatus(d),lr(this,d)}let u={type:"yeaft_session_send",agentId:i,id:l,sessionId:e,text:a,mentions:Array.isArray(s)?s:[],perfTraceId:c};r.length>0&&(u.attachments=r.map(p=>({fileId:p.fileId,isImage:!!p.isImage}))),Qe(this,{traceId:c,phase:"send.websocket_send",agentId:i,sessionId:e,turnId:l,messageType:u.type,bytes:JSON.stringify(u).length}),this.sendWsMessage(u)},cancelYeaftTask({sessionId:e,taskId:t}){let s=typeof e=="string"?e.trim():"",n=typeof t=="string"?t.trim():"",i=Ee(this,s);return!i||!s||!n?!1:(this.yeaftStoppingTasksById={...this.yeaftStoppingTasksById,[Mr(s,n)]:!0},this.sendWsMessage({type:"yeaft_task_cancel",agentId:i,sessionId:s,taskId:n,clientRequestId:`task_cancel_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}),!0)},getYeaftMessageWindowKey(e=null){return e||this.yeaftActiveSessionFilter||"__all__"},pruneYeaftMessageWindow(e=null){if(this.currentView!=="yeaft")return;let t=this.getYeaftMessageWindowKey(e);this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[t]:{visibleTurns:Ut()}}},expandYeaftMessageWindow(e=null,t=xr()){if(this.currentView!=="yeaft")return;let s=this.getYeaftMessageWindowKey(e),i=(this.yeaftMessageWindowState[s]?.visibleTurns||Ut())+Math.max(1,Number.isFinite(t)?Math.floor(t):xr());this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[s]:{visibleTurns:i}}},revealYeaftMessage(e,t,s=null){let n=e||this.yeaftActiveSessionFilter||null,i=s||ps(this,n);if(!i||!t)return!1;let r=(this.messagesMap[i]||[]).filter(u=>n?(u?.sessionId??u?.groupId??null)===n:!0),o=r.findIndex(u=>(u?.id||u?.messageId)===t||u?.persistedMessageId===t);if(o<0)return!1;let a=Ql(r),l=a.findIndex(u=>o>=u.start&&o<u.end);if(l<0)return!1;let c=Math.max(Ut(),a.length-l),d=this.getYeaftMessageWindowKey(n);return this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[d]:{visibleTurns:c}},!0},getYeaftHistoryOutlineState(e=null,t=null){let s=e||this.yeaftActiveSessionFilter||null,n=Ee(this,s,t),i=qe(n,s),r=this.yeaftHistoryOutlineBySession[i]||{requestId:null,agentId:n,sessionId:s,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,totalCount:null,loaded:!1,error:null},o=ps(this,s),a=o?this.messagesMap[o]||[]:[],l=new Map((r.results||[]).map(p=>[Gs(p),p])),c=0;for(let p of a){if((p?.sessionId??p?.groupId??null)!==s)continue;let f=p.messageId||p.id;if(!f)continue;let g=p.type==="user"&&!!p.clientMessageId&&f===p.clientMessageId,b=p.type==="assistant"&&p.isStreaming===!0;if(!g&&!b)continue;let h=p.type,A=p.turnId||p.threadId||f,x=p.speakerVpId||p.vpId||null,k=Gs({role:h,messageId:f,clientMessageId:p.clientMessageId,turnId:A,speakerVpId:x}),y=l.get(k),w=(typeof p.content=="string"?p.content:"").replace(/\s+/g," ").trim();l.set(k,{...y,messageId:Number.isFinite(y?.seq)?y.messageId:f,...p.clientMessageId?{clientMessageId:p.clientMessageId}:{},turnId:A,role:h,speakerVpId:x||y?.speakerVpId||null,timestamp:p.timestamp||p.ts||y?.timestamp||null,snippet:w.length>180?`${w.slice(0,180).trimEnd()}\u2026`:w||y?.snippet||""}),y||(c+=1)}let d=p=>{let f=typeof p=="number"?p:Date.parse(p||"");return Number.isFinite(f)?f:0},u=Array.from(l.values()).sort((p,f)=>Number.isFinite(p.seq)&&Number.isFinite(f.seq)?p.seq-f.seq:d(p.timestamp)-d(f.timestamp));return{...r,results:u,totalCount:Number.isFinite(r.totalCount)?r.totalCount+c:r.totalCount}},promoteYeaftHistoryOutlineRow(e){let t=e?.sessionId??e?.groupId??null,s=Ee(this,t),n=qe(s,t),i=this.yeaftHistoryOutlineBySession[n];if(!t||!s||!i?.loaded||i.loading)return!1;let r=e?.type;if(r!=="user"&&r!=="assistant")return!1;let o=e.dbMessageId||e.messageId||e.id||null,a=dg(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(),p=Gs({role:r,messageId:o,clientMessageId:e.clientMessageId,turnId:l,speakerVpId:c}),f=new Map((i.results||[]).map(k=>[Gs(k),k])),g=f.get(p);f.set(p,{...g,messageId:o,...e.clientMessageId?{clientMessageId:e.clientMessageId}:{},turnId:l,seq:a,role:r,speakerVpId:c,timestamp:e.timestamp||e.ts||g?.timestamp||null,snippet:u.length>180?`${u.slice(0,180).trimEnd()}\u2026`:u||g?.snippet||""});let b=50,h=Array.from(f.values()).sort((k,y)=>(k.seq||0)-(y.seq||0)),A=h.length>b,x=h.slice(-b);return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[n]:{...i,results:x,hasMore:i.hasMore||A,nextBeforeSeq:A&&Number.isFinite(x[0]?.seq)?x[0].seq:i.nextBeforeSeq,totalCount:Number.isFinite(i.totalCount)&&!g?i.totalCount+1:i.totalCount}},!0},promoteCompletedYeaftHistoryOutline(e,t=null){let s=this.messagesMap[e]||[],n=null,i=[];for(let r=s.length-1;r>=0;r--){let o=s[r];if(o?.type==="user")break;if(t&&o?.turnId&&o.turnId!==t||o?.type!=="assistant")continue;let a=typeof o.content=="string"?o.content.replace(/\s+/g," ").trim():"";n?!String(n.content||"").trim()&&a&&(n=o):n=o,a&&i.unshift(a)}return n?this.promoteYeaftHistoryOutlineRow({...n,content:i.join(" ")}):!1},invalidateYeaftHistoryOutline(e){let t=Ee(this,e),s=qe(t,e),n=this.yeaftHistoryOutlineBySession[s];return!e||!t||!n?!1:n.loading?(this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[s]:{...n,refreshPending:!0}},!0):(this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[s]:{...n,loaded:!1,refreshPending:!1}},this.currentView==="yeaft"&&this.yeaftActiveSessionFilter===e?this.loadYeaftHistoryOutline({force:!0}):!0)},loadYeaftHistoryOutline({append:e=!1,force:t=!1,targetSessionId:s=null,targetAgentId:n=null}={}){if(this.currentView!=="yeaft"&&!s)return!1;let i=s||this.yeaftActiveSessionFilter||null,r=n||Ee(this,i);if(!i||!r)return!1;let o=qe(r,i),a=this.getYeaftHistoryOutlineState(i,r);if(!e&&a.loaded&&!t)return!0;if(e&&(!a.hasMore||!Number.isFinite(a.nextBeforeSeq))||a.loading)return!1;if(!ac(this,r,"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:r,sessionId:i,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 p=this.yeaftHistoryOutlineBySession[o];if(p?.requestId!==l)return;let f={...this._yeaftHistoryOutlineTimeouts};delete f[o],this._yeaftHistoryOutlineTimeouts=f;let g=p.refreshPending===!0;this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[o]:{...p,requestId:null,loading:!1,requestAppend:!1,loaded:g?!1:p.loaded,refreshPending:!1,error:g?null:"timeout"}},g&&this.loadYeaftHistoryOutline({force:!0,targetSessionId:i,targetAgentId:r})},1e4);return this._yeaftHistoryOutlineTimeouts={...this._yeaftHistoryOutlineTimeouts,[o]:u},this.sendWsMessage({type:"yeaft_load_history_outline",agentId:r,sessionId:i,requestId:l,limit:50,...e&&Number.isFinite(a.nextBeforeSeq)?{beforeSeq:a.nextBeforeSeq}:{},includeTotal:!a.loaded}),!0},handleYeaftHistoryOutline(e){if(!e?.agentId||!e?.sessionId)return!1;let t=qe(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 i={...this._yeaftHistoryOutlineTimeouts};delete i[t],this._yeaftHistoryOutlineTimeouts=i;let r=Array.isArray(e.results)?e.results:[],o=s.requestAppend?[...s.results||[],...r]:r,a=new Map(o.filter(d=>d?.messageId).map(d=>[Gs(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,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}={}){if(this.currentView!=="yeaft")return!1;let s=typeof e=="string"?e.trim():"",n=this.yeaftActiveSessionFilter||null,i=Ee(this,n);if(this._yeaftHistorySearchTimeout&&(clearTimeout(this._yeaftHistorySearchTimeout),this._yeaftHistorySearchTimeout=null),!n||!i||s.length<2)return this.yeaftHistorySearchState={requestId:null,agentId:i,sessionId:n,query:s,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null},!1;let r=this.yeaftHistorySearchState||{};if(!ac(this,i,"session_history_search"))return this.yeaftHistorySearchState={requestId:null,agentId:i,sessionId:n,query:s,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:"unsupported"},!1;let o=`history_search_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;return this.yeaftHistorySearchState={requestId:o,agentId:i,sessionId:n,query:s,loading:!0,results:t&&r.query===s?r.results:[],hasMore:!1,nextBeforeSeq:t&&r.query===s?r.nextBeforeSeq:null,error:null},this._yeaftHistorySearchTimeout=setTimeout(()=>{this.yeaftHistorySearchState?.requestId===o&&(this._yeaftHistorySearchTimeout=null,this.yeaftHistorySearchState={...this.yeaftHistorySearchState,loading:!1,error:"timeout"})},1e4),this.sendWsMessage({type:"yeaft_search_history",agentId:i,sessionId:n,requestId:o,query:s,limit:20,...t&&Number.isFinite(r.nextBeforeSeq)?{beforeSeq:r.nextBeforeSeq}:{}}),!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)return!1;this._yeaftHistorySearchTimeout&&(clearTimeout(this._yeaftHistorySearchTimeout),this._yeaftHistorySearchTimeout=null);let s=Array.isArray(e.results)?e.results:[],n=new Map((t.results||[]).map(i=>[i.messageId,i]));for(let i of s)i?.messageId&&n.set(i.messageId,i);return this.yeaftHistorySearchState={...t,loading:!1,results:Array.from(n.values()),hasMore:!!e.hasMore,nextBeforeSeq:Number.isFinite(e.nextBeforeSeq)?e.nextBeforeSeq:null,error:e.error||null},!0},loadYeaftHistoryWindow(e){let t=this.yeaftActiveSessionFilter||null,s=Ee(this,t);if(!t||!s||!e?.messageId||!Number.isFinite(e.seq))return Promise.resolve(!1);if(this.revealYeaftMessage(t,e.messageId))return Promise.resolve(!0);let n=`history_window_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,i=this._yeaftHistoryWindowPending;return i&&(clearTimeout(i.timeout),i.resolve(!1),this._yeaftHistoryWindowPending=null),new Promise(r=>{let o=setTimeout(()=>{this._yeaftHistoryWindowPending?.requestId===n&&(this._yeaftHistoryWindowPending=null),r(!1)},1e4);this._yeaftHistoryWindowPending={requestId:n,agentId:s,sessionId:t,messageId:e.messageId,resolve:r,timeout:o},this.sendWsMessage({type:"yeaft_load_history_window",agentId:s,sessionId:t,requestId:n,anchorMessageId:e.messageId,anchorSeq:e.seq,beforeTurns:3,afterTurns:3})})},handleYeaftHistoryWindow(e,t=null){let s=this._yeaftHistoryWindowPending;if(!s||e?.requestId!==s.requestId||e.agentId!==s.agentId||e.sessionId!==s.sessionId)return!1;clearTimeout(s.timeout),this._yeaftHistoryWindowPending=null;let n=!e.error&&!!t&&this.revealYeaftMessage(s.sessionId,s.messageId,t);return s.resolve(!!n),!!n},createYeaftSession({displayName:e,vpIds:t,defaultVpId:s,workDir:n,agentId:i}={}){let r=Array.isArray(t)?t.slice():[],o=s&&r.includes(s)?s:r[0]||null,a=(e||"").trim(),l=(n||"").trim(),c={roster:r,defaultVpId:o};return a&&(c.name=a),l&&(c.workDir=l),this.sessionCrudRequest("create",c,{agentId:i})},handleYeaftOutput(e){if(!e)return;if(e.perfTraceId&&(Qe(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 s=e.conversationId||this.yeaftConversationId;if(s){let n=e.agentId||this.yeaftAgentId||this.currentAgent||null,i=e.sessionId??e.groupId??null,r=lc(this,i,n),o=n&&this.yeaftConversationIdsByAgent?this.yeaftConversationIdsByAgent[n]:null,a=!r&&o===this.yeaftConversationId;if(this.currentView==="yeaft"&&n&&o&&o!==s){let p=this.messagesMap[o]||[],f=this.messagesMap[s]||[];this.messagesMap[s]=rr(f,p).sort((g,b)=>(g.timestamp||0)-(b.timestamp||0)),!a&&String(o).startsWith("yeaft-local-")&&delete this.messagesMap[o]}n&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[n]:s}),(r||!this.yeaftConversationId)&&(this.yeaftConversationId=s),r&&(this.activeConversations=[s]),this.messagesMap[s]||(this.messagesMap[s]=[]),this.currentView==="yeaft"&&(e.data?.type==="user"||e.data?.type==="text_delta")&&this.pruneYeaftMessageWindow(this.yeaftActiveSessionFilter&&e.sessionId||null);let l=this._currentYeaftSessionId,c=this._currentYeaftVpId,d=this._currentYeaftTurnId,u=this._currentYeaftThreadId;i!=null&&(this._currentYeaftSessionId=i),e.vpId&&(this._currentYeaftVpId=e.vpId),e.turnId&&(this._currentYeaftTurnId=e.turnId),e.threadId&&(this._currentYeaftThreadId=e.threadId);try{this.currentView==="yeaft"&&i&&(!this.yeaftActiveSessionFilter||i===this.yeaftActiveSessionFilter)&&this.pruneYeaftMessageWindow(this.yeaftActiveSessionFilter?i:null);let f=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(this.handleAssistantOutputFrame(s,e.data),e.perfTraceId){let y=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Qe(this,{traceId:e.perfTraceId,phase:"store.apply_output",agentId:e.agentId||null,sessionId:i||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||null,durationMs:y-f}),Pn(this,{traceId:e.perfTraceId,agentId:e.agentId||null,sessionId:i||null,vpId:e.vpId||null,turnId:e.turnId||null,threadId:e.threadId||null,messageType:e.data?.type||null})}let g=e.data,b=g?.message?.id||g?.id||null,h=cg(b),A=Array.isArray(g?.message?.content)?g.message.content:[],x=A.some(y=>y?.type==="tool_use"),k=!!g?.tool_use_result||A.some(y=>y?.type==="tool_result");if(i){let y=!k&&!lg(this,s,i)&&(g?.type==="user"||g?.type==="assistant"&&!x)?h:null,m=qe(e.agentId||null,i),w=this.yeaftSessionHistoryState[m]||{},E=Number.isFinite(w.latestSeq)?w.latestSeq:-1;y!==null&&y>E&&(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[m]:{...w,latestSeq:y}})}}finally{this._currentYeaftSessionId=l,this._currentYeaftVpId=c,this._currentYeaftTurnId=d,this._currentYeaftThreadId=u}}return}let t=e.event;if(t)switch(t.type){case"ask_user_question":{let s=e.conversationId||this.yeaftConversationId;if(!s||!t.requestId)break;let n=tc(e,t,s),i=()=>{let r=this.messagesMap[s]||[],o=nc(r,n,s);if(o){if(o.askAnswered||o.askExpired)return!0;o.toolName="AskUserQuestion",t.toolCallId&&!o.toolId&&(o.toolId=t.toolCallId),o.agentId=n.agentId||o.agentId||null,o.askRequestId=t.requestId,o.askQuestions=t.questions||[],o.askCreatedAt=t.createdAt||null,o.askExpiresAt=t.expiresAt||null,t.replay&&(o.askPending=!1,o.pendingAnswers=null,o.askSubmitGeneration=null),o.isHistory=!1;let c=ic(this,n);return c&&Tr(o,c),this.messagesMap={...this.messagesMap,[s]:r.slice()},!0}if(!t.replay)return!1;let a={id:`ask-card-${t.requestId}`,type:"tool-use",toolName:"AskUserQuestion",toolId:t.toolCallId||null,toolInput:{questions:t.questions||[]},askRequestId:t.requestId,askQuestions:t.questions||[],askCreatedAt:t.createdAt||null,askExpiresAt:t.expiresAt||null,agentId:n.agentId,sessionId:n.sessionId,vpId:n.vpId,speakerVpId:n.vpId,turnId:n.turnId,threadId:n.threadId||"main",hasResult:!1,isHistory:!1,timestamp:t.createdAt||Date.now()},l=ic(this,n);return l&&Tr(a,l),r.push(a),this.messagesMap={...this.messagesMap,[s]:r.slice()},!0};if(!i()){let r=0,o=setInterval(()=>{r+=1,(i()||r>=10)&&clearInterval(o)},200)}break}case"ask_user_answered":case"ask_user_expired":{let s=e.conversationId||this.yeaftConversationId;if(!s||!t.requestId)break;let n=this.messagesMap[s]||[],i=tc(e,t,s),r=nc(n,i,s);if(!r){ag(this,i,t);break}Tr(r,t),this.messagesMap={...this.messagesMap,[s]:n.slice()};break}case"session_ready":{let s=t.conversationId,n=e.agentId||this.currentAgent,i=n&&this.yeaftConversationIdsByAgent?this.yeaftConversationIdsByAgent[n]:null,r=this.yeaftConversationId?String(this.yeaftConversationId):"",o=r.startsWith("yeaft-local-")&&(!n||r.startsWith(`yeaft-local-${n}-`)||/^yeaft-local-\d/.test(r))?this.yeaftConversationId:null,a=i||o,l=t.sessionId||e.sessionId||null,c=lc(this,l,n),d=!c&&a===this.yeaftConversationId;if(a&&a!==s){let b=this.messagesMap[a]||[],h=this.messagesMap[s]||[];this.messagesMap[s]=rr(h,b).sort((A,x)=>(A.timestamp||0)-(x.timestamp||0)),!d&&a.startsWith("yeaft-local-")&&delete this.messagesMap[a],this.processingConversations[a]&&(this.processingConversations[s]=!0,d||delete this.processingConversations[a]),this.executionStatusMap[a]&&(this.executionStatusMap[s]=this.executionStatusMap[a],d||delete this.executionStatusMap[a])}else this.messagesMap[s]||(this.messagesMap[s]=[]);n&&(this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[n]:s},this.cacheYeaftAgentStatus(n,t,{allowBootstrapCatalog:c})),c&&(this.yeaftModel=t.model,this.yeaftModelEffort=t.modelEffort||null,this.yeaftSessionReady=!0,this.yeaftBootstrapMetaLoadingKey=null,n?this.applyCachedYeaftStatus(n):this.yeaftAvailableModels=t.availableModels||[]);let u=Array.isArray(t.tasks)?t.tasks:[],p={};for(let b of u)!b?.id||!b.sessionId||b.status!=="running"||(p[b.sessionId]={...p[b.sessionId]||{},[b.id]:b});this.yeaftActiveTasksBySession=p,c&&(t.yeaftDir&&(this.yeaftYeaftDir=t.yeaftDir),this.yeaftStatus={skills:t.skills,mcpServers:t.mcpServers,tools:t.tools,multiVp:!!t.multiVp}),(c||!this.yeaftConversationId)&&(this.yeaftConversationId=s),c&&(this.activeConversations=[s]);let f=e.agentId||this.currentAgent||null,g=f||"__current__";this._yeaftVpSubscribedAgentKey!==g&&(this._yeaftVpSubscribedAgentKey=g,this.sendWsMessage(f?{type:"yeaft_vp_subscribe",agentId:f}:{type:"yeaft_vp_subscribe"}));break}case"yeaft_status":{let s=e.agentId||this.currentAgent;s&&this.cacheYeaftAgentStatus(s,t);break}case"context_usage":break;case"turn_open":{if(!t.turnId)break;let s={turnId:t.turnId,userPrompt:t.userPrompt||"",vpId:t.vpId||e.vpId||null,sessionId:t.sessionId||e.sessionId||null,openedAt:t.at||Date.now(),closedAt:null,totalMs:0,totalTokens:0,loopCount:0,memoryLoaded:null,memoryAdjust:null,tools:[],detailsLoaded:!0};this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:s},this.yeaftDebugTurnOrder.includes(t.turnId)||(this.yeaftDebugTurnOrder=[...this.yeaftDebugTurnOrder,t.turnId]);break}case"turn_close":{if(!t.turnId)break;let s=this.yeaftDebugTurnsById[t.turnId];if(!s)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...s,closedAt:Date.now(),totalMs:t.totalMs||0,totalTokens:t.totalTokens||0,loopCount:t.loopCount||s.loopCount||0}};break}case"memory_used":{if(!t.turnId)break;let s=this.yeaftDebugTurnsById[t.turnId];if(!s)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...s,memoryLoaded:Array.isArray(t.loaded)?t.loaded:[]}};break}case"dream_memory_loaded":{let s=Array.isArray(t.resident)?t.resident:[];if(t.turnId){let i=this.yeaftDebugTurnsById[t.turnId];i&&(this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...i,dreamMemoryLoaded:s,dreamMemoryLoadedInto:t.loadedInto||"system_prompt.memory"}})}let n={};for(let i of s){let r=i&&typeof i.scope=="string"?i.scope:null,o=r&&/^sessions\/[^/]+$/.test(r)?r:r&&/^group\/[^/]+$/.test(r)?`sessions/${r.slice(6)}`:null;o&&(n[o]={scope:o,sourceScope:r,sessionId:o.slice(9),turnId:t.turnId||null,vpId:t.vpId||null,loadedInto:t.loadedInto||"system_prompt.memory",summary:i.summary||"",truncated:!!i.truncated,receivedAt:Date.now()})}Object.keys(n).length>0&&(this.yeaftDreamPromptLoads={...this.yeaftDreamPromptLoads,...n});break}case"memory_adjust":{if(!t.turnId)break;let s=this.yeaftDebugTurnsById[t.turnId];if(!s)break;this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...s,memoryAdjust:{sessionKey:t.sessionKey||null,added:t.added||0,evicted:t.evicted||0,skipped:t.skipped||0,reason:t.reason||""}}};break}case"tool_exec":{if(!t.turnId)break;let s=this.yeaftDebugTurnsById[t.turnId];if(!s)break;let n=[...s.tools||[],{loopNumber:t.loopNumber||0,callId:t.callId||null,name:t.name||"?",durationMs:t.durationMs||0,isError:!!t.isError,toolOutput:t.toolOutput==null?null:String(t.toolOutput)}];this.yeaftDebugTurnsById={...this.yeaftDebugTurnsById,[t.turnId]:{...s,tools:n}};break}case"loop":{if(this.yeaftDebugLoops.push({turnId:t.turnId||null,loopNumber:t.loopNumber||0,model:t.model,systemPrompt:t.systemPrompt,messages:t.messages,response:t.response,toolCalls:t.toolCalls,usage:t.usage||{inputTokens:0,outputTokens:0,totalTokens:0},latencyMs:t.latencyMs,ttfbMs:t.ttfbMs,stopReason:t.stopReason,at:typeof t.at=="number"?t.at:null,rawRequest:t.rawRequest||null,rawResponse:t.rawResponse||null,sessionId:e.sessionId||null,vpId:e.vpId||t.vpId||null}),this.yeaftDebugLoops.length>cc){let s=Nl({loops:this.yeaftDebugLoops,turnsById:this.yeaftDebugTurnsById,turnOrder:this.yeaftDebugTurnOrder,maxLoops:Math.max(cc,this.yeaftDebugHistoryLimit||0)});this.yeaftDebugLoops=s.loops,this.yeaftDebugTurnsById=s.turnsById,this.yeaftDebugTurnOrder=s.turnOrder}break}case"recall":case"consolidate":case"fallback":case"thinking_delta":break;case"reflection":{let s=e.conversationId||this.yeaftConversationId||"unknown",n=Array.isArray(t.loopRange)?t.loopRange:[0,0],i=`${s}:${t.trigger}:${n[0]}-${n[1]}`,r=this.yeaftReflectionCards[i],o=this.messagesMap[s]||[],a=r?r.anchorMsgId:o.length>0&&o[o.length-1].id||null,l=r?r.anchorOrder:o.length;this.yeaftReflectionCards={...this.yeaftReflectionCards,[i]:{key:i,conversationId:s,turnId:t.turnId||r&&r.turnId||null,loopNumber:t.loopNumber||r&&r.loopNumber||null,trigger:t.trigger,status:t.status,loopRange:n,toolCount:t.toolCount||0,content:t.content||"",durationMs:t.durationMs||0,error:t.error||null,sessionId:e.sessionId||null,anchorMsgId:a,anchorOrder:l,updatedAt:Date.now()}};break}case"model_switched":this.yeaftModel=t.model,this.yeaftModelEffort=t.modelEffort||null;break;case"yeaft_task_event":{let s=t.task;if(!s?.id||!s.sessionId)break;let n={...this.yeaftActiveTasksBySession},i={...n[s.sessionId]||{}};s.status==="running"||pc.has(s.status)?i[s.id]=s:delete i[s.id];let r=oc(i);if(Object.keys(r).length>0?n[s.sessionId]=r:delete n[s.sessionId],this.yeaftActiveTasksBySession=n,s.status!=="running"){let{[Mr(s.sessionId,s.id)]:o,...a}=this.yeaftStoppingTasksById||{};this.yeaftStoppingTasksById=a}break}case"yeaft_task_cancel_result":{let s=t.taskId||t.task?.id||null,n=t.task?.sessionId||t.sessionId||e.sessionId||null;if(s&&n&&t.success===!1){let{[Mr(n,s)]:r,...o}=this.yeaftStoppingTasksById||{};this.yeaftStoppingTasksById=o}let i=t.task;if(i?.id&&i.sessionId){let r={...this.yeaftActiveTasksBySession},o={...r[i.sessionId]||{}};o[i.id]=i;let a=oc(o);Object.keys(a).length>0?r[i.sessionId]=a:delete r[i.sessionId],this.yeaftActiveTasksBySession=r}break}case"sub_agent_event":{let s=e.conversationId||this.yeaftConversationId||"unknown",n=t.agentId;if(!n)break;let i=t.payload||{},r=`${s}:${n}`,o=this.yeaftSubAgentCards[r],a=this.messagesMap[s]||[],l=o?o.anchorMsgId:a.length>0&&a[a.length-1].id||null,c=o?o.anchorOrder:a.length,d=o?{...o}:{key:r,conversationId:s,agentId:n,agentName:i.agentName||"sub-agent",status:"running",text:"",toolCallCount:0,turns:0,error:null,expanded:!1,anchorMsgId:l,anchorOrder:c,updatedAt:Date.now(),sessionId:e.sessionId||null};switch(i.agentName&&!d.agentName&&(d.agentName=i.agentName),i.type){case"sub_agent_status":d.status=i.status||d.status,i.error&&(d.error=i.error);break;case"text_delta":break;case"tool_use":case"tool_call":d.toolCallCount=Number(d.toolCallCount||0)+1;break;case"tool_start":break;case"tool_result":case"tool_end":break;case"sub_agent_turn_end":{d.turns+=1;let u=typeof i.content=="string"?i.content.trim():"";u&&(d.text=d.text?`${d.text}
|
|
7
7
|
|
|
8
|
-
${u}`:u),d.status!=="failed"&&d.status!=="closed"&&(d.status=i.status||"idle");break}case"error":i.error&&(d.error=i.error.message||String(i.error));break;default:break}d.updatedAt=Date.now(),this.yeaftSubAgentCards={...this.yeaftSubAgentCards,[r]:d};break}case"history_loaded":{let s=e.agentId||null,n=t.sessionId??null,i=qe(s,n),r=e.perfTraceId||this.yeaftHistoryPerfTraceBySession?.[i];r&&Qe(this,{traceId:r,phase:"history.loaded_event",agentId:e.agentId||null,sessionId:t.sessionId||null,messageType:t.type,detail:{mode:t.mode||"recent",count:t.count||0,hasMore:!!t.hasMore}});let o=t.mode==="delta"?"delta":"recent",a=this.yeaftSessionHistoryState[i]||{},l=Number.isFinite(t.latestSeq)?t.latestSeq:Number.isFinite(a.latestSeq)?a.latestSeq:null,c=o==="delta"?{...a,loaded:!0,loading:!1,latestSeq:l,syncingAfterSeq:null,count:(a.count||0)+(t.count||0)}:{loaded:!0,loading:!1,hasMore:!!t.hasMore,oldestSeq:typeof t.oldestSeq=="number"?t.oldestSeq:null,count:typeof t.count=="number"?t.count:0,latestSeq:l,syncingAfterSeq:null};this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[i]:c};let d=qe(s?this.currentAgent:null,this.yeaftActiveSessionFilter??null);if(i===d)o==="recent"&&(this.yeaftHasMoreHistory=c.hasMore,this.yeaftOldestLoadedSeq=c.oldestSeq),this.yeaftLoadingMoreHistory=!1;else if(this.yeaftLoadingMoreHistory){let u=this.yeaftSessionHistoryState[d]||null;this.yeaftLoadingMoreHistory=!!u?.loading}}break;case"vp_snapshot":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&s.applySnapshot(t,e.agentId||null);break}case"vp_updated":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&t.vp&&s.upsert(t.vp,t.reason);break}case"vp_removed":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&t.vpId&&s.remove(t.vpId,t.reason);break}case"vp_crud_result":{let s=this._vpCrudPending&&this._vpCrudPending.get(t.requestId);s&&(this._vpCrudPending.delete(t.requestId),s.resolve({ok:!!t.ok,op:t.op,vpId:t.vpId,vp:t.vp,error:t.error||null}));break}case"group_list_updated":case"session_list_updated":case"yeaft_session_hydrate":{let s=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore(),n=s&&s.activeSessionId||null,i=t.sessions||[];s&&s.applySnapshot(i,e.agentId||null);let r=s&&s.activeSessionId||null;if(this.currentView==="yeaft"&&r){let o=Ee(this,r,e.agentId||null),a=qe(o,r),l=this.yeaftSessionHistoryState[a]||null;this.setActiveSessionFilter(r,{agentId:o,force:Sa(r,n,l)})}break}case"group_roster_changed":case"session_roster_changed":{let s=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();s&&s.applyRosterChange(t);break}case"group_crud_result":case"session_crud_result":{let s=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();s&&s.applyCrudResult(t,e.agentId||null);let n=this._sessionCrudPending&&this._sessionCrudPending.get(t.requestId);if(n){this._sessionCrudPending.delete(t.requestId);let i=t.session||t.group||null,r=i&&e.agentId&&!i.agentId?{...i,agentId:e.agentId}:i,o=t.sessionId||null,a=t.sessions||null;n.resolve({ok:!!t.ok,op:t.op,session:r,sessionId:o,sessions:a,config:t.config||null,error:t.error||null})}break}case"vp_turn_start":{if(!t.turnId||!t.vpId)break;this.activeVpTurns={...this.activeVpTurns,[t.turnId]:{vpId:t.vpId,sessionId:t.sessionId||null,threadId:t.threadId||null,isStreaming:!0,startedAt:t.ts||Date.now()}},t.sessionId&&(this.yeaftProcessingSessions={...this.yeaftProcessingSessions,[t.sessionId]:!0});break}case"vp_turn_end":{if(!t.turnId)break;let{[t.turnId]:s,...n}=this.activeVpTurns;this.activeVpTurns=n;let{[t.turnId]:i,...r}=this.stoppingVpTurnIds;this.stoppingVpTurnIds=r,this.clearYeaftSessionProcessingIfIdle(t.sessionId||s?.sessionId||null);let a={end_turn:"completed",route_forward:"completed",aborted:"aborted",errored:"errored"}[t.reason]||"completed",l=Date.now(),c=this.yeaftConversationId;if(c&&Array.isArray(this.messagesMap[c])){let d=this.messagesMap[c],u=!1;for(let p=0;p<d.length;p++){let f=d[p];if(!f||f.type!=="assistant")continue;let g=f.sessionId??f.groupId;t.sessionId&&g&&g!==t.sessionId||t.vpId&&f.speakerVpId&&f.speakerVpId!==t.vpId||t.turnId&&f.turnId&&f.turnId!==t.turnId||f.status&&f.status!=="pending"||(f.status=a,f.turnEndAt=l,f.turnEndReason=t.reason||null,t.detail&&(f.turnEndDetail=t.detail),Number.isFinite(t.durationMs)&&(f.turnDurationMs=t.durationMs),u=!0)}u&&(this.messagesMap={...this.messagesMap,[c]:d.slice()})}break}case"yeaft_turn_aborted":{let s=Array.isArray(t.turnIds)?t.turnIds.filter(Boolean):[];t.turnId&&s.push(t.turnId);let n=t.sessionId||null,i=t.vpId||null,r=new Set(s);if(i)for(let[c,d]of Object.entries(this.activeVpTurns||{}))!d||d.vpId!==i||n&&d.sessionId!==n||r.add(c);if(r.size===0)break;let o=n,a={...this.activeVpTurns||{}},l={...this.stoppingVpTurnIds||{}};for(let c of r){let d=a[c];!o&&d?.sessionId&&(o=d.sessionId),delete a[c],delete l[c]}this.activeVpTurns=a,this.stoppingVpTurnIds=l,this.clearYeaftSessionProcessingIfIdle(o||null);break}case"yeaft_aborted":{let s=t.sessionId||e.sessionId||null;s?(this.activeVpTurns=Object.fromEntries(Object.entries(this.activeVpTurns||{}).filter(([,n])=>n?.sessionId!==s)),this.stoppingVpTurnIds=Object.fromEntries(Object.entries(this.stoppingVpTurnIds||{}).filter(([n])=>this.activeVpTurns?.[n])),this.clearYeaftSessionProcessingIfIdle(s)):t.all&&(this.activeVpTurns={},this.stoppingVpTurnIds={},this.yeaftProcessingSessions={});break}case"vp_typing_start":{if(!t.vpId)break;let s=e.conversationId||this.yeaftConversationId;if(!s)break;this.yeaftVpTyping=$l(this.yeaftVpTyping,s,t.vpId);break}case"vp_typing_end":{if(!t.vpId)break;let s=e.conversationId||this.yeaftConversationId;if(!s)break;this.yeaftVpTyping=Vl(this.yeaftVpTyping,s,t.vpId);break}case"vp_status_changed":{if(!t.vpId||!t.state)break;let s=t.sessionId||null,n=$n(s,t.vpId),i={state:t.state,since:t.since||Date.now(),turnId:t.turnId||null,title:t.title||"",sessionId:s,vpId:t.vpId};this.vpStatuses={...this.vpStatuses,[n]:i},s&&Fn.has(t.state)?this.yeaftProcessingSessions={...this.yeaftProcessingSessions,[s]:!0}:s&&this.clearYeaftSessionProcessingIfIdle(s),this.restoreActiveYeaftSessionFromStatuses([i]);break}case"vp_status_snapshot":{let s=Array.isArray(t.statuses)?t.statuses:[],n=t.sessionId;if(n==null){let i={};for(let r of s){if(!r||!r.vpId)continue;let o=r.sessionId||r.groupId||null,a=$n(o,r.vpId);i[a]={state:r.state,since:r.since||Date.now(),turnId:r.turnId||null,title:r.title||"",sessionId:o,vpId:r.vpId}}this.vpStatuses=i}else{let i={...this.vpStatuses};for(let[r,o]of Object.entries(i))o&&o.sessionId===n&&delete i[r];for(let r of s){if(!r||!r.vpId)continue;let o=r.sessionId||r.groupId||null,a=$n(o,r.vpId);i[a]={state:r.state,since:r.since||Date.now(),turnId:r.turnId||null,title:r.title||"",sessionId:o,vpId:r.vpId}}this.vpStatuses=i}this.restoreActiveYeaftSessionFromStatuses(s);break}case"yeaft_dream_snapshot":{let s=t&&t.snapshot,n=s&&typeof s.scope=="string"?s.scope:null;n&&(this.yeaftDreamSnapshots={...this.yeaftDreamSnapshots,[n]:{...s,receivedAt:Date.now()}});break}case"yeaft_dream_status":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&s.applyDreamStatus(t);break}case"yeaft_dream_result":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&s.applyDreamResult(t),t?.snapshot?.scope&&(this.yeaftDreamSnapshots={...this.yeaftDreamSnapshots,[t.snapshot.scope]:{...t.snapshot,receivedAt:Date.now()}});{let n=typeof t?.snapshot?.scope=="string"&&t.snapshot.scope?t.snapshot.scope:typeof t?.sessionId=="string"&&t.sessionId?`sessions/${t.sessionId}`:null;if(!n)break;let i=this.yeaftDreamLatest[n]||null;this.yeaftDreamLatest={...this.yeaftDreamLatest,[n]:{scope:n,phase:"result",status:t.skipped?"skipped":t.success?"success":"error",startedAt:i?.startedAt??null,finishedAt:Date.now(),mergedCount:typeof t.entriesCreated=="number"?t.entriesCreated:i?.mergedCount??null,error:t.skipped||t.success?null:t.error||"unknown",manual:typeof t?.manual=="boolean"?t.manual:i?.manual??null,durationMs:typeof t.durationMs=="number"?t.durationMs:i?.durationMs??null,llmCallCount:typeof t.llmCallCount=="number"?t.llmCallCount:i?.llmCallCount??0,inputTokens:typeof t.inputTokens=="number"?t.inputTokens:i?.inputTokens??0,outputTokens:typeof t.outputTokens=="number"?t.outputTokens:i?.outputTokens??0,totalTokens:typeof t.totalTokens=="number"?t.totalTokens:i?.totalTokens??0,metrics:t.metrics||i?.metrics||null,passBreakdown:t.passBreakdown||t.metrics?.passBreakdown||i?.passBreakdown||null,isRunning:!1}},this._appendDreamEvent(n,{type:"dream_progress",phase:"result",sessionId:t.sessionId,status:t.skipped?"skipped":t.success?"success":"error",success:!!t.success,entriesCreated:typeof t.entriesCreated=="number"?t.entriesCreated:null,trigger:t.trigger||null,error:t.skipped||t.success?null:t.error||null,skipped:!!t.skipped,skippedReason:t.skippedReason||null,durationMs:typeof t.durationMs=="number"?t.durationMs:null,llmCallCount:typeof t.llmCallCount=="number"?t.llmCallCount:0,inputTokens:typeof t.inputTokens=="number"?t.inputTokens:0,outputTokens:typeof t.outputTokens=="number"?t.outputTokens:0,totalTokens:typeof t.totalTokens=="number"?t.totalTokens:0,metrics:t.metrics||null,passBreakdown:t.passBreakdown||t.metrics?.passBreakdown||null,ts:Date.now()})}break}case"dream_progress":{let s=t?.phase||"unknown",n=null;typeof t?.target=="string"&&t.target.includes("/")?n=t.target:typeof t?.sessionId=="string"&&t.sessionId?n=`sessions/${t.sessionId}`:n="*";let i=s==="done",r=s==="error"||t?.status==="error",o=!i&&!r,a=l=>{let c=this.yeaftDreamLatest[l]||null;return{scope:l,phase:s,status:r?"error":i?"success":"running",startedAt:c?.startedAt&&o?c.startedAt:t?.ts||c?.startedAt||Date.now(),finishedAt:i||r?t?.ts||Date.now():null,mergedCount:typeof t?.mergedCount=="number"?t.mergedCount:typeof t?.targets=="number"?t.targets:c?.mergedCount??null,error:r?t?.error||"unknown":null,manual:typeof t?.manual=="boolean"?t.manual:c?.manual??!1,durationMs:typeof t?.duration=="number"?t.duration:typeof t?.durationMs=="number"?t.durationMs:c?.durationMs??null,llmCallCount:typeof t?.llmCallCount=="number"?t.llmCallCount:c?.llmCallCount??0,inputTokens:typeof t?.inputTokens=="number"?t.inputTokens:c?.inputTokens??0,outputTokens:typeof t?.outputTokens=="number"?t.outputTokens:c?.outputTokens??0,totalTokens:typeof t?.totalTokens=="number"?t.totalTokens:c?.totalTokens??0,metrics:t?.metrics||c?.metrics||null,passBreakdown:t?.passBreakdown||t?.metrics?.passBreakdown||c?.passBreakdown||null,isRunning:o}};if(n==="*"){let l={...this.yeaftDreamLatest,"*":a("*")};for(let c of Object.keys(this.yeaftDreamLatest))c!=="*"&&(l[c]=a(c));this.yeaftDreamLatest=l}else this.yeaftDreamLatest={...this.yeaftDreamLatest,[n]:a(n)};this._appendDreamEvent(n,t);break}}},_appendDreamEvent(e,t){if(!e||!t)return;let s=Date.now(),n={...t,at:s},i=Array.isArray(this.yeaftDreamEvents?.[e])?this.yeaftDreamEvents[e]:[],r=l=>[l?.type||"",l?.phase||"",(l?.sessionId??l?.groupId)||"",l?.target||"",l?.ts||l?.at||""].join("|"),o=r(n);if(i.some(l=>r(l)===o))return;let a=[...i,n];a.length>uc&&a.splice(0,a.length-uc),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),i={create:"yeaft_vp_create",update:"yeaft_vp_update",delete:"yeaft_vp_delete",read:"yeaft_vp_read"}[e];if(!i)return Promise.resolve({ok:!1,op:e,error:{code:"bad_op",message:"unknown op: "+e}});let r={type:i,requestId:s};return e==="create"||e==="update"?r.payload=t||{}:r.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(r)})},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),r={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(!r)return Promise.resolve({ok:!1,op:e,error:{code:"bad_op",message:"unknown op: "+e}});let o={type:r,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)})},restoreActiveYeaftSessionFromStatuses(e=[]){if(this.yeaftActiveSessionFilter)return null;let s=(Array.isArray(e)?e:[]).filter(i=>i&&(i.sessionId||i.groupId)&&!["idle","offline","completed","failed","aborted"].includes(i.state)).sort((i,r)=>(r.updatedAt||r.since||0)-(i.updatedAt||i.since||0)),n=s[0]?.sessionId||s[0]?.groupId||null;if(!n)return null;this.setActiveSessionFilter(n,{force:!0});try{let i=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();i&&typeof i.setActive=="function"&&i.setActive(n)}catch{}return n},setActiveSessionFilter(e,t={}){let s=this.yeaftActiveSessionFilter||null,n=e||null,i=n?Ee(this,n,t.agentId||null):this.currentAgent,r=!!n&&n===s&&!!i&&!!this.currentAgent&&i!==this.currentAgent,o=!!t.force||r;this.yeaftActiveSessionFilter=n;try{n?localStorage.setItem("lastViewedYeaftSession",n):localStorage.removeItem("lastViewedYeaftSession")}catch{}if(i&&n&&this.currentAgent!==i){this.selectAgent(i);let c=this.agents.find(d=>d.id===i);this.activateYeaftAgent(i,c||null)}else i&&n&&this.activateYeaftAgent(i);if(!o&&n===s)return;let a=qe(i,n),l=this.yeaftSessionHistoryState[a]||null;if(this.yeaftHasMoreHistory=!!l?.hasMore,this.yeaftLoadingMoreHistory=!!l?.loading,this.yeaftOldestLoadedSeq=typeof l?.oldestSeq=="number"?l.oldestSeq:null,this.pruneYeaftMessageWindow(n),!l?.loading&&i&&n){this.yeaftSessionAgentById={...this.yeaftSessionAgentById||{},[n]:i};let c=this.yeaftConversationIdsByAgent?.[i]||null;c||(c=`yeaft-local-${i}-${Date.now()}`,this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[i]:c}),this.yeaftConversationId=c,this.messagesMap[c]||(this.messagesMap[c]=[]),this.currentView==="yeaft"&&(this.activeConversations=[c]);let d=Number.isFinite(l?.latestSeq)?l.latestSeq:null,u={type:"yeaft_load_history",agentId:i,sessionId:n},p=!!l?.loaded,f=or({sessionState:l,hasCachedSessionRows:!1,force:o});if(!f&&d!==null?u.afterSeq=d:u.limit=Vn,!f&&p&&d===null){this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...l||{hasMore:!1,oldestSeq:null,count:0},loaded:!0,loading:!1,syncingAfterSeq:null}},this.yeaftLoadingMoreHistory=!1;return}if(!f&&p){if(l?.syncingAfterSeq===d)return;this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...l||{hasMore:!1,oldestSeq:null,count:0},loaded:!0,loading:!1,syncingAfterSeq:d,latestSeq:d}},this.yeaftLoadingMoreHistory=!1}else this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...l||{hasMore:!1,oldestSeq:null,count:0},loaded:!1,loading:!0,syncingAfterSeq:null,latestSeq:f?null:d}},this.yeaftLoadingMoreHistory=!0;this.sendWsMessage(u)}},async switchYeaftModel(e,t=null,s=void 0){if(!e||!this.currentAgent)return;let n=t||null;if(n){let i={model:e};return s!==void 0&&(i.modelEffort=s||null),await this.sessionCrudRequest("update_config",{sessionId:n,config:i},{agentId:Ee(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()?dc:Pr,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&&(delete this.messagesMap[e],delete this.processingConversations[e],delete this.executionStatusMap[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.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},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 i=n[t];if(s?.type==="tool"){i.toolCallCount=Number(i.toolCallCount||0)+1;return}s?.type==="text"&&i.messages.push(s)},completeSubagent(e,t){let s=this.subagents[e];!s||!s[t]||(s[t].status="completed")},sendWsMessage(e){return da(this,e)},parseWsMessage(e){return ua(this,e)},connect(){pa(this)},ensureConnected(){return Bs(this)},scheduleReconnect(){fa(this)},manualReconnect(){ga(this)},startHeartbeat(){ma(this)},stopHeartbeat(){ha(this)},setupVisibilityHandler(){va(this)},handleMessage(e){sl(this,e)},getOrCreateExecutionStatus(e){return mr(this,e)},handleAssistantOutputFrame(e,t){Ka(this,e,t)},handleClaudeOutput(e,t){this.handleAssistantOutputFrame(e,t)},addMessageToConversation(e,t){An(this,e,t)},appendToAssistantMessageForConversation(e,t,s){Ia(this,e,t,s)},finishStreamingForConversation(e){Aa(this,e)},sweepStaleStreamingForConversation(e){xa(this,e)},appendToAssistantMessage(e){this.appendToAssistantMessageForConversation(this.currentConversation,e)},finishStreaming(){this.finishStreamingForConversation(this.currentConversation)},addMessage(e){this.addMessageToConversation(this.currentConversation,e)},loadHistoryMessages(e){Ta(this,e)},formatDbMessage(e){return ar(e)},formatDbMessageForHistoryHydration(e){return Pa(e)},selectAgent(e){dl(this,e)},createConversation(e,t=null,s=null,n=void 0){ul(this,e,t,s,n)},resumeConversation(e,t,s=null,n=null){pl(this,e,t,s,n)},selectConversation(e,t){fl(this,e,t)},updateConversationSettings(e,t){br(this,e,t)},toggleConversationMcp(e,t){gl(this,e,t)},deleteConversation(e,t){hl(this,e,t)},closeSession(e,t){ml(this,e,t)},appendColumn(e){wl(this,e)},removeColumn(e){kl(this,e)},sendMessageToConversation(e,t,s=[],n={}){Sl(this,e,t,s,n)},cancelExecutionForConversation(e){Cl(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(r=>r.id)),i=s.filter(r=>r&&typeof r.id=="string").map(r=>({...e(r.id,null),conversationId:r.conversationId&&n.has(r.conversationId)?r.conversationId:null}));if(i.length>=2){this.panels=i,this.activePanelId=i[0].id;for(let r of i)r.conversationId&&!this.activeConversations.includes(r.conversationId)&&this.activeConversations.push(r.conversationId),r.conversationId&&!this.messagesMap[r.conversationId]&&(this.messagesMap[r.conversationId]=[],this.sendWsMessage({type:"sync_messages",conversationId:r.conversationId,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){let s=this.panels.find(n=>n.id===e);s&&(s.conversationId=t,t&&!this.activeConversations.includes(t)&&this.activeConversations.push(t),t&&!this.messagesMap[t]&&(this.messagesMap[t]=[],this.sendWsMessage({type:"sync_messages",conversationId:t,turns:5})),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.sendWsMessage({type:"sync_messages",conversationId:e,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,i=n?!!fs()?.sessionById?.(e,n)?.pinned:this.pinnedSessions.includes(e);if(t&&!i)this.pinnedSessions.unshift(e);else if(!t&&i){let r=this.pinnedSessions.indexOf(e);r>=0&&this.pinnedSessions.splice(r,1)}try{localStorage.setItem("pinned-sessions",JSON.stringify(this.pinnedSessions))}catch{}try{let r=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore(),o=Ee(this,e,n);r&&typeof r.applyPinState=="function"&&r.applyPinState(e,!!t,o)}catch{}},togglePin(e,t={}){let s=t&&t.agentId?t.agentId:null,n=s?fs()?.sessionById?.(e,s):null,i=t&&Object.prototype.hasOwnProperty.call(t,"pinned"),o=!(n?!!n.pinned:i?!!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),i=[];for(let r of t)n.has(r)||i.push(r);if(i.length>0&&(this.pinnedSessions=[...i,...this.pinnedSessions]),e){let r=this.pinnedSessions.filter(o=>s(o)?t.has(o):!0);r.length!==this.pinnedSessions.length&&(this.pinnedSessions=r)}try{localStorage.setItem("pinned-sessions",JSON.stringify(this.pinnedSessions))}catch{}},clearYeaftSessionProcessingIfIdle(e,{ignoreStatuses:t=!1}={}){if(!e||Object.values(this.activeVpTurns||{}).some(r=>r?.sessionId===e)||!t&&Object.values(this.vpStatuses||{}).some(o=>(o?.sessionId||o?.groupId||null)===e&&Fn.has(o?.state)))return;let{[e]:n,...i}=this.yeaftProcessingSessions||{};this.yeaftProcessingSessions=i},sendMessage(e,t=[],s={}){vl(this,e,t,s)},cancelExecution(){yl(this)},cancelYeaft(){this.currentAgent&&(this.sendWsMessage({type:"yeaft_abort_all",agentId:this.currentAgent}),this.yeaftConversationId&&delete this.processingConversations[this.yeaftConversationId],this.activeVpTurns={},this.stoppingVpTurnIds={},this.yeaftProcessingSessions={})},cancelYeaftSession(e){let t=Ee(this,e);!t||!e||(this.sendWsMessage({type:"yeaft_abort_all",agentId:t,sessionId:e}),this.activeVpTurns=Object.fromEntries(Object.entries(this.activeVpTurns||{}).filter(([,s])=>s?.sessionId!==e)),this.stoppingVpTurnIds=Object.fromEntries(Object.entries(this.stoppingVpTurnIds||{}).filter(([s])=>this.activeVpTurns?.[s])),this.clearYeaftSessionProcessingIfIdle(e))},cancelVpTurn(e,{sessionId:t=null,vpId:s=null}={}){let n=Ee(this,t);if(!n||!e)return;this.stoppingVpTurnIds={...this.stoppingVpTurnIds,[e]: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=Ee(this,s);if(!n)return!1;let i=this.activeVpTurns||{},r=null,o=-1/0;for(let[a,l]of Object.entries(i)){if(!l||l.vpId!==e||s&&l.sessionId&&l.sessionId!==s)continue;let c=typeof l.startedAt=="number"?l.startedAt:0;c>=o&&(o=c,r=a)}if(!r){let a=this.vpStatuses?.[$n(s,e)]||null;a?.turnId&&!["idle","offline"].includes(a.state)&&(r=a.turnId)}return r?(this.cancelVpTurn(r,{sessionId:s,vpId:e}),!0):(this.sendWsMessage({type:"yeaft_abort_turn",agentId:n,sessionId:s,vpId:e}),!0)},answerUserQuestion(e,t,s){bl(this,e,t,s)},refreshAgents(){Il(this)},refreshConversation(){Al(this)},restartAgent(e){xl(this,e)},upgradeAgent(e){Tl(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;this.sendWsMessage({type:"sync_messages",conversationId:n,turns:5,...s?{beforeId:s.dbMessageId}:{}}),setTimeout(()=>{this._loadMoreGeneration===e&&this.loadingMoreMessages&&this.currentConversation===n&&(this.loadingMoreMessages=!1)},1e4)},reloadYeaftMessages(){if(this.currentView!=="yeaft")return!1;let e=Ys(this),t=Ee(this,e);if(!t)return!1;let s=qe(t,e),n=this.yeaftConversationId,{[s]:i,...r}=this.yeaftSessionHistoryState||{};this.yeaftSessionHistoryState={...r,[s]:{loaded:!1,loading:!0,hasMore:!1,oldestSeq:null,latestSeq:null,count:0}},this.yeaftHasMoreHistory=!1,this.yeaftOldestLoadedSeq=null,this.yeaftLoadingMoreHistory=!0;let o=Us();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[s]:o};let a={type:"yeaft_load_history",agentId:t,limit:Vn,sessionId:e,perfTraceId:o};return Qe(this,{traceId:o,phase:"history.request_send",agentId:t,sessionId:e,messageType:a.type,bytes:JSON.stringify(a).length,detail:{mode:"manual-reload",limit:Vn}}),this.sendWsMessage(a),!0},loadMoreYeaftHistory(){if(this.currentView!=="yeaft"||this.yeaftLoadingMoreHistory||!this.yeaftHasMoreHistory||this.yeaftOldestLoadedSeq==null)return;let e=Ys(this),t=Ee(this,e);if(!t)return;this.yeaftLoadingMoreHistory=!0;let s=qe(t,e);this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[s]:{...this.yeaftSessionHistoryState[s]||{},loading:!0}};let n=Us();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[s]:n};let i={type:"yeaft_load_more_history",agentId:t,sessionId:e,beforeSeq:this.yeaftOldestLoadedSeq,turns:10,perfTraceId:n};Qe(this,{traceId:n,phase:"history_more.request_send",agentId:t,sessionId:e,messageType:i.type,bytes:JSON.stringify(i).length,detail:{beforeSeq:i.beforeSeq,turns:i.turns}}),this.sendWsMessage(i)},checkPendingRecovery(){Ko(this)},performRecovery(){Go(this)},dismissRecovery(){Yo(this)},autoRestoreConversation(e){Qo(this,e)},saveOpenSessions(){ds(this)},getLastSession(){return Zo(this)},clearLastSession(){Jo(this)},listHistorySessions(e){ea(this,e)},listFolders(){return ta(this)},listFoldersForAgent(e,t){return sa(this,e,t)},listModelsForAgent(e,t){return na(this,e,t)},listHistorySessionsForAgent(e,t,s){ia(this,e,t,s)},async loadGlobalSessions(e=20){return ra(this,e)},async deleteGlobalSession(e){return oa(this,e)},findAgentForSession(e){return Xi(this,e)},isSessionResumable(e){return aa(this,e)},_isRecentlyClosed(e){return Ht(this,e)},_startProcessingWatchdog(e){us(this,e)},_resetProcessingWatchdog(e){Tn(this,e)},_stopProcessingWatchdog(e){ke(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 i of n.resolvers)i(this.modelsDevRegistry)}return new Promise(n=>{let i={resolvers:[n],force:e,timer:null};this._modelsDevPending=i;try{this.sendWsMessage({type:"get_models_dev_registry",agentId:s,forceRefresh:e})}catch{this._modelsDevPending===i&&(this._modelsDevPending=null),n(this.modelsDevRegistry);return}i.timer=setTimeout(()=>{if(this._modelsDevPending===i){this._modelsDevPending=null;for(let r of i.resolvers)r(this.modelsDevRegistry)}},2e4)})},changeLocale(e){if(this.locale=e,Os(e),this.currentAgent)try{this.sendWsMessage({type:"update_llm_config",agentId:this.currentAgent,config:{language:e}})}catch{}},async fetchCustomExpertRoles(){let e=Ae();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=Ae();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 i=await n.json();return this.customExpertRoles.push(i.role),i.role}else{let i=await n.json().catch(()=>({}));throw new Error(i.error||"Failed to create custom expert role")}}catch(s){throw s}},async updateCustomExpertRole(e,t){let s=Ae();try{let n={"Content-Type":"application/json"};s.token&&(n.Authorization=`Bearer ${s.token}`);let i=await fetch(`/api/expert-roles/custom/${e}`,{method:"PUT",headers:n,body:JSON.stringify(t)});if(i.ok){let r=await i.json(),o=this.customExpertRoles.findIndex(a=>a.id===e);return o!==-1&&(this.customExpertRoles[o]=r.role),r.role}else{let r=await i.json().catch(()=>({}));throw new Error(r.error||"Failed to update custom expert role")}}catch(n){throw n}},async deleteCustomExpertRole(e){let t=Ae();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(i=>i.id!==e),!0;{let i=await n.json().catch(()=>({}));throw new Error(i.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){t&&t.trim()?(this.customConversationTitles[e]=t.trim(),this.sendWsMessage({type:"update_conversation_settings",conversationId:e,title:t.trim()})):(delete this.customConversationTitles[e],this.sendWsMessage({type:"update_conversation_settings",conversationId:e,title:""}))},openFileInExplorer(e){this.currentConversation&&(this.workbenchExpanded=!0,window.dispatchEvent(new CustomEvent("open-file-in-explorer",{detail:{filePath:e,conversationId:this.currentConversation}})))},logout(){Ae().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.ws&&this.ws.close()}}})});function _r(e,t){!e||typeof e.handleYeaftOutput!="function"||!t||e.handleYeaftOutput({event:t})}function fg(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 Rr(e){if(!e)return Tt[0];let t=String(e).toLowerCase();return pg[t]||Tt[fg(t)%Tt.length]}function gg(e){return Rr(e).background}function mg(e){return Rr(e).foreground}function Er(){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 hg(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 ug,Tt,pg,kv,ft,gs=O(()=>{({defineStore:ug}=Pinia);Tt=[{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)"}],pg=Object.freeze({steve:Tt[8],ada:Tt[3],linus:Tt[0],martin:Tt[4]}),kv=Tt.map(e=>e.background);ft=ug("vp",{state:()=>({vps:{},vpOrder:[],emptyLibrary:!1,lastSnapshotAt:0,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?Er().startsWith("zh")&&s.displayNameZh?s.displayNameZh:s.displayName||s.vpId||t:t},vpDescription:e=>t=>hg(e.vps[t],Er()),vpInitial:e=>t=>{let s=e.vps[t],n=Er().startsWith("zh"),i=s&&(s.avatar||n&&s.displayNameZh||s.displayName||s.vpId)||t||"?";return String(i).charAt(0).toUpperCase()||"?"},vpColor:e=>t=>{let s=e.vps[t];return s&&s.color?s.color:gg(t)},vpTextColor:()=>e=>mg(e),vpAvatarMotif:()=>e=>Rr(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){this.vps={},this.vpOrder=[];let s=e&&Array.isArray(e.vps)?e.vps:[];for(let n of s)this._upsertInternal(n);this.emptyLibrary=!!(e&&e.emptyLibrary),this.lastSnapshotAt=Date.now(),this.lastVpSnapshotAgentId=t||null},upsert(e,t=null){this._upsertInternal(e),e&&e.vpId&&(this.lastChange={vpId:e.vpId,kind:"updated",reason:t||null,at:Date.now()})},remove(e,t=null){e&&(delete this.vps[e],this.vpOrder=this.vpOrder.filter(s=>s!==e),this.lastChange={vpId:e,kind:"removed",reason:t||"file.removed",at:Date.now()})},_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(_r(s,{type:"dream_progress",phase:"start",groupId:e,manual:!0,trigger:"manual",source:"header-button",ts:n}),!s||typeof s.sendWsMessage!="function"){_r(s,{type:"yeaft_dream_result",groupId:e,success:!1,skipped:!0,skippedReason:"chat-store-unavailable",trigger:"manual",error:null});return}let i={type:"yeaft_dream_trigger",sessionId:e},r=t&&t.agentId?t.agentId:typeof s.agentIdForSession=="function"?s.agentIdForSession(e):s.currentAgent;r&&(i.agentId=r),s.sendWsMessage(i)===!1&&_r(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:[]},i=t||s?null:e.error||null,r=s?"skipped":t?"success":"error",o=e.sessionId;if(o){this.groupDreamStatus={...this.groupDreamStatus,[o]:{status:r,lastRunAt:Date.now(),lastResult:n,lastError:i}};return}if(!e.vpId)return;let a=e.vpId;this.dreamStatus={...this.dreamStatus,[a]:{status:r,lastRunAt:Date.now(),lastResult:n,lastError:i}}}}})});function Lr(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 Nn(e){return!e||typeof e!="object"?0:Lr(e.lastMessageAt)||Lr(e.updatedAt)||Lr(e.createdAt)||0}function $r(e,t){let s=Nn(t)-Nn(e);return s!==0?s:String(e?.id||"").localeCompare(String(t?.id||""))}function mc(e){return[...Array.isArray(e)?e:[]].sort($r)}var Bn=O(()=>{});function hc(){try{if(typeof localStorage>"u")return{};let e=JSON.parse(localStorage.getItem(wc)||"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function vg(e){try{typeof localStorage<"u"&&localStorage.setItem(wc,JSON.stringify(e&&typeof e=="object"?e:{}))}catch{}}function vc(){try{return typeof localStorage>"u"?[]:Qs(JSON.parse(localStorage.getItem(kc)||"[]"))}catch{return[]}}function yg(e){try{typeof localStorage<"u"&&localStorage.setItem(kc,JSON.stringify(Qs(e)))}catch{}}function Sc(e,t){return`${e||""}${t||""}`}function wt(e){return e&&e.agentId&&e.id?Sc(e.agentId,e.id):""}function kt(e,t){return t?e?Sc(e,t):String(t):""}function bg(e){return typeof e=="string"?e:String(e||"")}function tt(e,t,s=null){let n=bg(t);if(!n)return"";let i=kt(s,n);if(i&&e.sessions[i])return i;if(e.sessions[n])return n;if(e.activeSessionKey&&e.sessions[e.activeSessionKey]?.id===n)return e.activeSessionKey;let r=e.sessionOrder.filter(a=>e.sessions[a]?.id===n);if(s){let a=r.find(l=>e.sessions[l]?.agentId===s);if(a)return a}let o=Or();if(o?.currentAgent){let a=r.find(l=>e.sessions[l]?.agentId===o.currentAgent);if(a)return a}return r[0]||""}function Vr(e,t,s=null){return tt(e,t,s)||""}function Qs(e){let t=[],s=new Set;for(let n of Array.isArray(e)?e:[]){let i=typeof n=="string"?n:String(n||"");!i||s.has(i)||(s.add(i),t.push(i))}return t}function Fr(e,t){let s=Qs(e),n=new Set(s),i=Qs(t).filter(o=>n.has(o)),r=new Set(i);return[...i,...s.filter(o=>!r.has(o))]}function qn(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 yc(e){return!e||typeof e!="object"?!1:e.running===!0||e.active===!0||e.isActive===!0||e.isRunning===!0}function bc(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 Or(){try{if(typeof window<"u"&&window.Pinia&&typeof window.Pinia.useChatStore=="function")return window.Pinia.useChatStore()}catch{}return null}var wc,kc,wg,Cc,Ic=O(()=>{Bn();wc="yeaft-session-order-by-agent",kc="yeaft-session-order-global";({defineStore:wg}=Pinia);Cc=wg("sessions",{state:()=>({sessions:{},sessionOrder:[],activeSessionId:null,activeSessionKey:null,lastSnapshotAt:0,lastCrudResult:null,pending:{}}),getters:{sessionList(e){let t=e.sessionOrder.map(d=>e.sessions[d]).filter(Boolean),s=Or(),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 i=[],r=[];for(let d of t)d.pinned||!d.agentId&&n.has(d.id)?i.push(d):r.push(d);let o=d=>[...d].sort((u,p)=>{let f=Number.isFinite(u?.sortOrder)?u.sortOrder:Number.MAX_SAFE_INTEGER,g=Number.isFinite(p?.sortOrder)?p.sortOrder:Number.MAX_SAFE_INTEGER;return f!==g?f-g:$r(u,p)}),a=[...o(i),...o(r)],l=vc();if(l.length===0)return a;let c=new Map(l.map((d,u)=>[d,u]));return a.sort((d,u)=>{let p=c.has(wt(d))?c.get(wt(d)):Number.MAX_SAFE_INTEGER,f=c.has(wt(u))?c.get(wt(u)):Number.MAX_SAFE_INTEGER;return p!==f?p-f:0})},sessionCount(e){return e.sessionOrder.length},sessionById:e=>(t,s=null)=>{let n=tt(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){let s=Array.isArray(e)?e:[];if(t){let y={...this.sessions},A=new Set;for(let E of s){if(!E||!E.id)continue;let R=kt(t,E.id);A.add(R),y[R]=this._normalize(E,t,qn(this.sessions[R]))}for(let E of this.sessionOrder){let R=this.sessions[E];R&&R.agentId===t&&!A.has(E)&&delete y[E]}let x=this.sessionOrder.filter(E=>y[E]),k=new Set(x),b=[];for(let E of s){if(!E||!E.id)continue;let R=kt(t,E.id);y[R]&&!k.has(R)&&b.push(R)}this.sessions=y;let m=[...x,...b],w=vc();if(w.length>0){let E=new Map(m.map(P=>[wt(y[P]),P]).filter(([P])=>P)),R=w.map(P=>E.get(P)).filter(Boolean),q=new Set(R);m=[...R,...m.filter(P=>!q.has(P))];let $=new Map(w.map((P,D)=>[P,D]));for(let P of m){let D=wt(y[P]);D&&$.has(D)&&(y[P]={...y[P],sortOrder:$.get(D)})}}if(t&&w.length===0){let E=hc(),R=Qs(E[t]);if(R.length>0){let q=R.map(T=>kt(t,T)),$=new Set(q),P=Fr(m.filter(T=>y[T]?.agentId===t),q),D=this.sessionOrder.some(T=>y[T]?.agentId===t),M=0;D?m=this.sessionOrder.filter(T=>y[T]).map(T=>y[T]?.agentId===t?P[M++]:T).concat(P.slice(M)):m=m.map(T=>y[T]?.agentId===t?P[M++]:T);let C=new Map(q.map((T,N)=>[T,N]));for(let T of P)y[T]&&$.has(T)&&(y[T]={...y[T],sortOrder:C.get(T)})}}this.sessionOrder=m}else{if(Object.values(this.sessions).some(k=>k&&k.agentId))return;let A={},x=[];for(let k of s){if(!k||!k.id)continue;let b=kt(null,k.id);A[b]=this._normalize(k,null,qn(this.sessions[b])),x.push(b)}this.sessions=A,this.sessionOrder=x}this.lastSnapshotAt=Date.now();let n=null;try{n=localStorage.getItem("lastViewedYeaftSession")||null}catch{}let i=n?tt(this,n,t):"",r=i?this.sessions[i]:null,o=r&&(!t||r.agentId===t),a=this.sessionOrder.filter(y=>this.sessions[y]&&(!t||this.sessions[y].agentId===t)&&this.sessions[y].running).sort((y,A)=>bc(this.sessions[A])-bc(this.sessions[y]))[0]||null,l=a?this.sessions[a]?.id:null,c=this.sessionList[0]||null,d=c?.id||null,u=d?tt(this,d,c?.raw?.agentId||null):"",p=l||(o?n:null)||d,f=a||(o?i:"")||u||Vr(this,p,t),g=this.activeSessionKey?this.sessions[this.activeSessionKey]?.agentId:null;this.activeSessionId&&!tt(this,this.activeSessionId,g)?(this.activeSessionId=p,this.activeSessionKey=f||null):!this.activeSessionId&&this.sessionOrder.length>0?(this.activeSessionId=p,this.activeSessionKey=f||null):this.activeSessionId&&(this.activeSessionKey=Vr(this,this.activeSessionId,g)||this.activeSessionKey);let v=Or();if(v){if(t){let x={...v.yeaftSessionAgentById||{}};for(let k of s)k&&k.id&&!x[k.id]&&(x[k.id]=t);v.yeaftSessionAgentById=x}let y=this.activeSessionId||p,A=null;(v.yeaftActiveSessionFilter&&!tt(this,v.yeaftActiveSessionFilter)||!v.yeaftActiveSessionFilter&&y)&&(A=y),A&&(v.currentView==="yeaft"&&typeof v.setActiveSessionFilter=="function"?v.setActiveSessionFilter(A,{force:!0}):v.yeaftActiveSessionFilter=A,this.activeSessionKey=Vr(this,A)||this.activeSessionKey)}if(v&&typeof v.applyServerPinSnapshot=="function"){let y=new Set;for(let x of s){if(!x||!x.id)continue;let k=kt(t,x.id),b=this.sessions[k];b&&b.pinned&&y.add(x.id)}let A=x=>{let k=tt(this,x,t),b=k?this.sessions[k]:null;return b?b.agentId===t:!1};v.applyServerPinSnapshot(t,y,A)}},applyRosterChange(e){if(!e)return;let t=e.sessionId||e.groupId;if(!t)return;let s=e.agentId||null,n=tt(this,t,s)||kt(s,t),i=this.sessions[n];if(!i){let r=this._normalize({id:t,name:e.name||t,roster:Array.isArray(e.roster)?e.roster:[],defaultVpId:e.defaultVpId||null},s);this.sessions[n]=r,this.sessionOrder.push(n);return}this.sessions[n]={...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}},applyCrudResult(e,t=null){if(!e)return;this.lastCrudResult={...e,at:Date.now()},e.requestId&&this.pending[e.requestId]&&delete this.pending[e.requestId],e.ok&&e.op==="list"&&Array.isArray(e.sessions)&&this.applySnapshot(e.sessions,t);let s=e.session||e.group||null;e.ok&&e.op==="create"&&s&&s.id&&(this.applySnapshotUpsert(s,t),this.setActive(s.id,t));let n=e.sessionId||e.groupId,i=n?tt(this,n,t):"";if(e.ok&&(e.op==="archive"||e.op==="delete")&&n&&(i&&delete this.sessions[i],this.sessionOrder=this.sessionOrder.filter(r=>r!==i),(this.activeSessionKey===i||this.activeSessionId===n)&&(this.activeSessionKey=this.sessionOrder[0]||null,this.activeSessionId=this.activeSessionKey&&this.sessions[this.activeSessionKey]?.id||null)),e.ok&&e.op==="update_config"&&n){let r=i?this.sessions[i]:null;r&&(this.sessions[i]={...r,config:e.config&&typeof e.config=="object"?{...e.config}:{}})}},applySnapshotUpsert(e,t=null){if(!e||!e.id)return;let s=t||e.agentId||null,n=tt(this,e.id,s)||kt(s,e.id),i=!!this.sessions[n],r=this.sessions[n]||{};this.sessions[n]={...r,...this._normalize(e,s,qn(r))},i||this.sessionOrder.push(n)},setActive(e,t=null){let s=tt(this,e,t);e&&s&&this.sessions[s]?(this.activeSessionId=e,this.activeSessionKey=s):(this.activeSessionId=null,this.activeSessionKey=null)},reorderSessionsForAgent(e,t){if(!e)return[];let s=this.sessionOrder.filter(l=>this.sessions[l]?.agentId===e),n=Fr(s,t.map(l=>kt(e,l)));if(n.length===0)return[];let i=new Map(n.map((l,c)=>[l,c])),r=0;this.sessionOrder=this.sessionOrder.map(l=>this.sessions[l]?.agentId===e?n[r++]:l);for(let l of n)this.sessions[l]={...this.sessions[l],sortOrder:i.get(l)};let o=hc(),a=n.map(l=>this.sessions[l]?.id).filter(Boolean);return o[e]=a,vg(o),a},reorderSessionsGlobally(e){let t=this.sessionOrder.map(a=>wt(this.sessions[a])).filter(Boolean),s=Fr(t,e);if(s.length===0)return[];let n=new Map(this.sessionOrder.map(a=>[wt(this.sessions[a]),a]).filter(([a])=>a)),i=s.map(a=>n.get(a)).filter(Boolean),r=new Set(i);this.sessionOrder=[...i,...this.sessionOrder.filter(a=>!r.has(a))];let o=new Map(s.map((a,l)=>[a,l]));for(let a of this.sessionOrder){let l=wt(this.sessions[a]);l&&o.has(l)&&(this.sessions[a]={...this.sessions[a],sortOrder:o.get(l)})}return yg(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){let n=tt(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},_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:yc(e),active:yc(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:qn(e,s),sortOrder:Number.isFinite(e.sortOrder)?e.sortOrder:null}}}})});function Wn(){try{if(window.Pinia&&typeof window.Pinia.useAuthStore=="function")return window.Pinia.useAuthStore()}catch{}return null}function Hr(){try{return localStorage.getItem("authToken")||null}catch{return null}}function Tc(){let e=Wn();if(e)try{return e.getActiveToken?.()||e.token||Hr()}catch{return e.token||Hr()}return Hr()}function Sg(e,t){if(!e)return!1;let s=Tc();if(s&&s!==t)return!1;try{localStorage.setItem("authToken",e)}catch{}let n=Wn();return n&&(n.token=e),!0}function Cg(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 xc(e){return!e||typeof window>"u"||!window.location?!1:e.origin===window.location.origin&&e.pathname.startsWith("/api/")}function Ig(e){if(!e)return!1;let t=e.pathname;return!!(kg.has(t)||t.startsWith("/api/auth/sso/poll/")||/^\/api\/auth\/sso\/[^/]+\/start(?:-qr)?$/.test(t))}function Ag(e,t){return t?.headers?new Headers(t.headers):e&&typeof e=="object"&&e.headers?new Headers(e.headers):new Headers}function xg(e){let t=e.get("Authorization");return!t||!t.startsWith("Bearer ")?null:t.slice(7)}function Tg(e,t){return{...e||{},headers:t}}function Mg(e,t,s,n){let i=Wn();i&&typeof i.handleAuthResponse=="function"?i.handleAuthResponse(e,t,s,n):i&&typeof i.handleAuthFailure=="function"&&n&&i.handleAuthFailure(void 0,t,s)}function Mc(){if(Ac||typeof window>"u"||!window.fetch)return;Ac=!0;let e=window.fetch.bind(window);window.fetch=async function(s,n){let i=Cg(s),r=xc(i)&&!Ig(i),o=xc(i)?{...n||{},credentials:"same-origin"}:n,a=null,l=r?Wn():null,c=l?.authGeneration,d=!!l?.isAuthenticated;if(r){let p=Ag(s,n);a=xg(p),a||(a=Tc(),a&&(p.set("Authorization",`Bearer ${a}`),o=Tg(o,p)))}let u=await e(s,o);try{let p=u.headers&&u.headers.get&&u.headers.get("X-New-Token");p&&Sg(p,a),r&&u.status===401&&Mg(u,a,c,d)}catch{}return u}}var Ac,kg,Pc=O(()=>{Ac=!1,kg=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 Dc,_c=O(()=>{Dc={"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
|
|
8
|
+
${u}`:u),d.status!=="failed"&&d.status!=="closed"&&(d.status=i.status||"idle");break}case"error":i.error&&(d.error=i.error.message||String(i.error));break;default:break}d.updatedAt=Date.now(),this.yeaftSubAgentCards={...this.yeaftSubAgentCards,[r]:d};break}case"history_loaded":{let s=e.agentId||null,n=t.sessionId??null,i=qe(s,n),r=e.perfTraceId||this.yeaftHistoryPerfTraceBySession?.[i];r&&Qe(this,{traceId:r,phase:"history.loaded_event",agentId:e.agentId||null,sessionId:t.sessionId||null,messageType:t.type,detail:{mode:t.mode||"recent",count:t.count||0,hasMore:!!t.hasMore}});let o=t.mode==="delta"?"delta":"recent",a=this.yeaftSessionHistoryState[i]||{},l=Number.isFinite(t.latestSeq)?t.latestSeq:Number.isFinite(a.latestSeq)?a.latestSeq:null,c=o==="delta"?{...a,loaded:!0,loading:!1,latestSeq:l,syncingAfterSeq:null,count:(a.count||0)+(t.count||0)}:{loaded:!0,loading:!1,hasMore:!!t.hasMore,oldestSeq:typeof t.oldestSeq=="number"?t.oldestSeq:null,count:typeof t.count=="number"?t.count:0,latestSeq:l,syncingAfterSeq:null};this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[i]:c};let d=qe(s?this.currentAgent:null,this.yeaftActiveSessionFilter??null);if(i===d)o==="recent"&&(this.yeaftHasMoreHistory=c.hasMore,this.yeaftOldestLoadedSeq=c.oldestSeq),this.yeaftLoadingMoreHistory=!1;else if(this.yeaftLoadingMoreHistory){let u=this.yeaftSessionHistoryState[d]||null;this.yeaftLoadingMoreHistory=!!u?.loading}}break;case"vp_snapshot":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&s.applySnapshot(t,e.agentId||null);break}case"vp_updated":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&t.vp&&s.upsert(t.vp,t.reason);break}case"vp_removed":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&t.vpId&&s.remove(t.vpId,t.reason);break}case"vp_crud_result":{let s=this._vpCrudPending&&this._vpCrudPending.get(t.requestId);s&&(this._vpCrudPending.delete(t.requestId),s.resolve({ok:!!t.ok,op:t.op,vpId:t.vpId,vp:t.vp,error:t.error||null}));break}case"group_list_updated":case"session_list_updated":case"yeaft_session_hydrate":{let s=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore(),n=s&&s.activeSessionId||null,i=t.sessions||[];s&&s.applySnapshot(i,e.agentId||null);let r=s&&s.activeSessionId||null;if(this.currentView==="yeaft"&&r){let o=Ee(this,r,e.agentId||null),a=qe(o,r),l=this.yeaftSessionHistoryState[a]||null;this.setActiveSessionFilter(r,{agentId:o,force:Sa(r,n,l)})}break}case"group_roster_changed":case"session_roster_changed":{let s=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();s&&s.applyRosterChange(t);break}case"group_crud_result":case"session_crud_result":{let s=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();s&&s.applyCrudResult(t,e.agentId||null);let n=this._sessionCrudPending&&this._sessionCrudPending.get(t.requestId);if(n){this._sessionCrudPending.delete(t.requestId);let i=t.session||t.group||null,r=i&&e.agentId&&!i.agentId?{...i,agentId:e.agentId}:i,o=t.sessionId||null,a=t.sessions||null;n.resolve({ok:!!t.ok,op:t.op,session:r,sessionId:o,sessions:a,config:t.config||null,error:t.error||null})}break}case"vp_turn_start":{if(!t.turnId||!t.vpId)break;this.activeVpTurns={...this.activeVpTurns,[t.turnId]:{vpId:t.vpId,sessionId:t.sessionId||null,threadId:t.threadId||null,isStreaming:!0,startedAt:t.ts||Date.now()}},t.sessionId&&(this.yeaftProcessingSessions={...this.yeaftProcessingSessions,[t.sessionId]:!0});break}case"vp_turn_end":{if(!t.turnId)break;let{[t.turnId]:s,...n}=this.activeVpTurns;this.activeVpTurns=n;let{[t.turnId]:i,...r}=this.stoppingVpTurnIds;this.stoppingVpTurnIds=r,this.clearYeaftSessionProcessingIfIdle(t.sessionId||s?.sessionId||null);let a={end_turn:"completed",route_forward:"completed",aborted:"aborted",errored:"errored"}[t.reason]||"completed",l=Date.now(),c=this.yeaftConversationId;if(c&&Array.isArray(this.messagesMap[c])){let d=this.messagesMap[c],u=!1;for(let p=0;p<d.length;p++){let f=d[p];if(!f||f.type!=="assistant")continue;let g=f.sessionId??f.groupId;t.sessionId&&g&&g!==t.sessionId||t.vpId&&f.speakerVpId&&f.speakerVpId!==t.vpId||t.turnId&&f.turnId&&f.turnId!==t.turnId||f.status&&f.status!=="pending"||(f.status=a,f.turnEndAt=l,f.turnEndReason=t.reason||null,t.detail&&(f.turnEndDetail=t.detail),Number.isFinite(t.durationMs)&&(f.turnDurationMs=t.durationMs),u=!0)}u&&(this.messagesMap={...this.messagesMap,[c]:d.slice()})}break}case"yeaft_turn_aborted":{let s=Array.isArray(t.turnIds)?t.turnIds.filter(Boolean):[];t.turnId&&s.push(t.turnId);let n=t.sessionId||null,i=t.vpId||null,r=new Set(s);if(i)for(let[c,d]of Object.entries(this.activeVpTurns||{}))!d||d.vpId!==i||n&&d.sessionId!==n||r.add(c);if(r.size===0)break;let o=n,a={...this.activeVpTurns||{}},l={...this.stoppingVpTurnIds||{}};for(let c of r){let d=a[c];!o&&d?.sessionId&&(o=d.sessionId),delete a[c],delete l[c]}this.activeVpTurns=a,this.stoppingVpTurnIds=l,this.clearYeaftSessionProcessingIfIdle(o||null);break}case"yeaft_aborted":{let s=t.sessionId||e.sessionId||null;s?(this.activeVpTurns=Object.fromEntries(Object.entries(this.activeVpTurns||{}).filter(([,n])=>n?.sessionId!==s)),this.stoppingVpTurnIds=Object.fromEntries(Object.entries(this.stoppingVpTurnIds||{}).filter(([n])=>this.activeVpTurns?.[n])),this.clearYeaftSessionProcessingIfIdle(s)):t.all&&(this.activeVpTurns={},this.stoppingVpTurnIds={},this.yeaftProcessingSessions={});break}case"vp_typing_start":{if(!t.vpId)break;let s=e.conversationId||this.yeaftConversationId;if(!s)break;this.yeaftVpTyping=$l(this.yeaftVpTyping,s,t.vpId);break}case"vp_typing_end":{if(!t.vpId)break;let s=e.conversationId||this.yeaftConversationId;if(!s)break;this.yeaftVpTyping=Vl(this.yeaftVpTyping,s,t.vpId);break}case"vp_status_changed":{if(!t.vpId||!t.state)break;let s=t.sessionId||null,n=$n(s,t.vpId),i={state:t.state,since:t.since||Date.now(),turnId:t.turnId||null,title:t.title||"",sessionId:s,vpId:t.vpId};this.vpStatuses={...this.vpStatuses,[n]:i},s&&Fn.has(t.state)?this.yeaftProcessingSessions={...this.yeaftProcessingSessions,[s]:!0}:s&&this.clearYeaftSessionProcessingIfIdle(s),this.restoreActiveYeaftSessionFromStatuses([i]);break}case"vp_status_snapshot":{let s=Array.isArray(t.statuses)?t.statuses:[],n=t.sessionId;if(n==null){let i={};for(let r of s){if(!r||!r.vpId)continue;let o=r.sessionId||r.groupId||null,a=$n(o,r.vpId);i[a]={state:r.state,since:r.since||Date.now(),turnId:r.turnId||null,title:r.title||"",sessionId:o,vpId:r.vpId}}this.vpStatuses=i}else{let i={...this.vpStatuses};for(let[r,o]of Object.entries(i))o&&o.sessionId===n&&delete i[r];for(let r of s){if(!r||!r.vpId)continue;let o=r.sessionId||r.groupId||null,a=$n(o,r.vpId);i[a]={state:r.state,since:r.since||Date.now(),turnId:r.turnId||null,title:r.title||"",sessionId:o,vpId:r.vpId}}this.vpStatuses=i}this.restoreActiveYeaftSessionFromStatuses(s);break}case"yeaft_dream_snapshot":{let s=t&&t.snapshot,n=s&&typeof s.scope=="string"?s.scope:null;n&&(this.yeaftDreamSnapshots={...this.yeaftDreamSnapshots,[n]:{...s,receivedAt:Date.now()}});break}case"yeaft_dream_status":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&s.applyDreamStatus(t);break}case"yeaft_dream_result":{let s=window.Pinia?.useVpStore?.()||window.__useVpStore&&window.__useVpStore();s&&s.applyDreamResult(t),t?.snapshot?.scope&&(this.yeaftDreamSnapshots={...this.yeaftDreamSnapshots,[t.snapshot.scope]:{...t.snapshot,receivedAt:Date.now()}});{let n=typeof t?.snapshot?.scope=="string"&&t.snapshot.scope?t.snapshot.scope:typeof t?.sessionId=="string"&&t.sessionId?`sessions/${t.sessionId}`:null;if(!n)break;let i=this.yeaftDreamLatest[n]||null;this.yeaftDreamLatest={...this.yeaftDreamLatest,[n]:{scope:n,phase:"result",status:t.skipped?"skipped":t.success?"success":"error",startedAt:i?.startedAt??null,finishedAt:Date.now(),mergedCount:typeof t.entriesCreated=="number"?t.entriesCreated:i?.mergedCount??null,error:t.skipped||t.success?null:t.error||"unknown",manual:typeof t?.manual=="boolean"?t.manual:i?.manual??null,durationMs:typeof t.durationMs=="number"?t.durationMs:i?.durationMs??null,llmCallCount:typeof t.llmCallCount=="number"?t.llmCallCount:i?.llmCallCount??0,inputTokens:typeof t.inputTokens=="number"?t.inputTokens:i?.inputTokens??0,outputTokens:typeof t.outputTokens=="number"?t.outputTokens:i?.outputTokens??0,totalTokens:typeof t.totalTokens=="number"?t.totalTokens:i?.totalTokens??0,metrics:t.metrics||i?.metrics||null,passBreakdown:t.passBreakdown||t.metrics?.passBreakdown||i?.passBreakdown||null,isRunning:!1}},this._appendDreamEvent(n,{type:"dream_progress",phase:"result",sessionId:t.sessionId,status:t.skipped?"skipped":t.success?"success":"error",success:!!t.success,entriesCreated:typeof t.entriesCreated=="number"?t.entriesCreated:null,trigger:t.trigger||null,error:t.skipped||t.success?null:t.error||null,skipped:!!t.skipped,skippedReason:t.skippedReason||null,durationMs:typeof t.durationMs=="number"?t.durationMs:null,llmCallCount:typeof t.llmCallCount=="number"?t.llmCallCount:0,inputTokens:typeof t.inputTokens=="number"?t.inputTokens:0,outputTokens:typeof t.outputTokens=="number"?t.outputTokens:0,totalTokens:typeof t.totalTokens=="number"?t.totalTokens:0,metrics:t.metrics||null,passBreakdown:t.passBreakdown||t.metrics?.passBreakdown||null,ts:Date.now()})}break}case"dream_progress":{let s=t?.phase||"unknown",n=null;typeof t?.target=="string"&&t.target.includes("/")?n=t.target:typeof t?.sessionId=="string"&&t.sessionId?n=`sessions/${t.sessionId}`:n="*";let i=s==="done",r=s==="error"||t?.status==="error",o=!i&&!r,a=l=>{let c=this.yeaftDreamLatest[l]||null;return{scope:l,phase:s,status:r?"error":i?"success":"running",startedAt:c?.startedAt&&o?c.startedAt:t?.ts||c?.startedAt||Date.now(),finishedAt:i||r?t?.ts||Date.now():null,mergedCount:typeof t?.mergedCount=="number"?t.mergedCount:typeof t?.targets=="number"?t.targets:c?.mergedCount??null,error:r?t?.error||"unknown":null,manual:typeof t?.manual=="boolean"?t.manual:c?.manual??!1,durationMs:typeof t?.duration=="number"?t.duration:typeof t?.durationMs=="number"?t.durationMs:c?.durationMs??null,llmCallCount:typeof t?.llmCallCount=="number"?t.llmCallCount:c?.llmCallCount??0,inputTokens:typeof t?.inputTokens=="number"?t.inputTokens:c?.inputTokens??0,outputTokens:typeof t?.outputTokens=="number"?t.outputTokens:c?.outputTokens??0,totalTokens:typeof t?.totalTokens=="number"?t.totalTokens:c?.totalTokens??0,metrics:t?.metrics||c?.metrics||null,passBreakdown:t?.passBreakdown||t?.metrics?.passBreakdown||c?.passBreakdown||null,isRunning:o}};if(n==="*"){let l={...this.yeaftDreamLatest,"*":a("*")};for(let c of Object.keys(this.yeaftDreamLatest))c!=="*"&&(l[c]=a(c));this.yeaftDreamLatest=l}else this.yeaftDreamLatest={...this.yeaftDreamLatest,[n]:a(n)};this._appendDreamEvent(n,t);break}}},_appendDreamEvent(e,t){if(!e||!t)return;let s=Date.now(),n={...t,at:s},i=Array.isArray(this.yeaftDreamEvents?.[e])?this.yeaftDreamEvents[e]:[],r=l=>[l?.type||"",l?.phase||"",(l?.sessionId??l?.groupId)||"",l?.target||"",l?.ts||l?.at||""].join("|"),o=r(n);if(i.some(l=>r(l)===o))return;let a=[...i,n];a.length>uc&&a.splice(0,a.length-uc),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),i={create:"yeaft_vp_create",update:"yeaft_vp_update",delete:"yeaft_vp_delete",read:"yeaft_vp_read"}[e];if(!i)return Promise.resolve({ok:!1,op:e,error:{code:"bad_op",message:"unknown op: "+e}});let r={type:i,requestId:s};return e==="create"||e==="update"?r.payload=t||{}:r.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(r)})},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),r={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(!r)return Promise.resolve({ok:!1,op:e,error:{code:"bad_op",message:"unknown op: "+e}});let o={type:r,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)})},restoreActiveYeaftSessionFromStatuses(e=[]){if(this.yeaftActiveSessionFilter)return null;let s=(Array.isArray(e)?e:[]).filter(i=>i&&(i.sessionId||i.groupId)&&!["idle","offline","completed","failed","aborted"].includes(i.state)).sort((i,r)=>(r.updatedAt||r.since||0)-(i.updatedAt||i.since||0)),n=s[0]?.sessionId||s[0]?.groupId||null;if(!n)return null;this.setActiveSessionFilter(n,{force:!0});try{let i=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore();i&&typeof i.setActive=="function"&&i.setActive(n)}catch{}return n},setActiveSessionFilter(e,t={}){let s=this.yeaftActiveSessionFilter||null,n=e||null,i=n?Ee(this,n,t.agentId||null):this.currentAgent,r=!!n&&n===s&&!!i&&!!this.currentAgent&&i!==this.currentAgent,o=!!t.force||r;this.yeaftActiveSessionFilter=n;try{n?localStorage.setItem("lastViewedYeaftSession",n):localStorage.removeItem("lastViewedYeaftSession")}catch{}if(i&&n&&this.currentAgent!==i){this.selectAgent(i);let c=this.agents.find(d=>d.id===i);this.activateYeaftAgent(i,c||null)}else i&&n&&this.activateYeaftAgent(i);if(!o&&n===s)return;let a=qe(i,n),l=this.yeaftSessionHistoryState[a]||null;if(this.yeaftHasMoreHistory=!!l?.hasMore,this.yeaftLoadingMoreHistory=!!l?.loading,this.yeaftOldestLoadedSeq=typeof l?.oldestSeq=="number"?l.oldestSeq:null,this.pruneYeaftMessageWindow(n),!l?.loading&&i&&n){this.yeaftSessionAgentById={...this.yeaftSessionAgentById||{},[n]:i};let c=this.yeaftConversationIdsByAgent?.[i]||null;c||(c=`yeaft-local-${i}-${Date.now()}`,this.yeaftConversationIdsByAgent={...this.yeaftConversationIdsByAgent||{},[i]:c}),this.yeaftConversationId=c,this.messagesMap[c]||(this.messagesMap[c]=[]),this.currentView==="yeaft"&&(this.activeConversations=[c]);let d=Number.isFinite(l?.latestSeq)?l.latestSeq:null,u={type:"yeaft_load_history",agentId:i,sessionId:n},p=!!l?.loaded,f=or({sessionState:l,hasCachedSessionRows:!1,force:o});if(!f&&d!==null?u.afterSeq=d:u.limit=Vn,!f&&p&&d===null){this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...l||{hasMore:!1,oldestSeq:null,count:0},loaded:!0,loading:!1,syncingAfterSeq:null}},this.yeaftLoadingMoreHistory=!1;return}if(!f&&p){if(l?.syncingAfterSeq===d)return;this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...l||{hasMore:!1,oldestSeq:null,count:0},loaded:!0,loading:!1,syncingAfterSeq:d,latestSeq:d}},this.yeaftLoadingMoreHistory=!1}else this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[a]:{...l||{hasMore:!1,oldestSeq:null,count:0},loaded:!1,loading:!0,syncingAfterSeq:null,latestSeq:f?null:d}},this.yeaftLoadingMoreHistory=!0;this.sendWsMessage(u)}},async switchYeaftModel(e,t=null,s=void 0){if(!e||!this.currentAgent)return;let n=t||null;if(n){let i={model:e};return s!==void 0&&(i.modelEffort=s||null),await this.sessionCrudRequest("update_config",{sessionId:n,config:i},{agentId:Ee(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()?dc:Pr,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&&(delete this.messagesMap[e],delete this.processingConversations[e],delete this.executionStatusMap[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.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},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 i=n[t];if(s?.type==="tool"){i.toolCallCount=Number(i.toolCallCount||0)+1;return}s?.type==="text"&&i.messages.push(s)},completeSubagent(e,t){let s=this.subagents[e];!s||!s[t]||(s[t].status="completed")},sendWsMessage(e){return da(this,e)},parseWsMessage(e){return ua(this,e)},connect(){pa(this)},ensureConnected(){return Bs(this)},scheduleReconnect(){fa(this)},manualReconnect(){ga(this)},startHeartbeat(){ma(this)},stopHeartbeat(){ha(this)},setupVisibilityHandler(){va(this)},handleMessage(e){sl(this,e)},getOrCreateExecutionStatus(e){return mr(this,e)},handleAssistantOutputFrame(e,t){Ka(this,e,t)},handleClaudeOutput(e,t){this.handleAssistantOutputFrame(e,t)},addMessageToConversation(e,t){An(this,e,t)},appendToAssistantMessageForConversation(e,t,s){Ia(this,e,t,s)},finishStreamingForConversation(e){Aa(this,e)},sweepStaleStreamingForConversation(e){xa(this,e)},appendToAssistantMessage(e){this.appendToAssistantMessageForConversation(this.currentConversation,e)},finishStreaming(){this.finishStreamingForConversation(this.currentConversation)},addMessage(e){this.addMessageToConversation(this.currentConversation,e)},loadHistoryMessages(e){Ta(this,e)},formatDbMessage(e){return ar(e)},formatDbMessageForHistoryHydration(e){return Pa(e)},selectAgent(e){dl(this,e)},createConversation(e,t=null,s=null,n=void 0){ul(this,e,t,s,n)},resumeConversation(e,t,s=null,n=null){pl(this,e,t,s,n)},selectConversation(e,t){fl(this,e,t)},updateConversationSettings(e,t){br(this,e,t)},toggleConversationMcp(e,t){gl(this,e,t)},deleteConversation(e,t){hl(this,e,t)},closeSession(e,t){ml(this,e,t)},appendColumn(e){wl(this,e)},removeColumn(e){kl(this,e)},sendMessageToConversation(e,t,s=[],n={}){Sl(this,e,t,s,n)},cancelExecutionForConversation(e){Cl(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(r=>r.id)),i=s.filter(r=>r&&typeof r.id=="string").map(r=>({...e(r.id,null),conversationId:r.conversationId&&n.has(r.conversationId)?r.conversationId:null}));if(i.length>=2){this.panels=i,this.activePanelId=i[0].id;for(let r of i)r.conversationId&&!this.activeConversations.includes(r.conversationId)&&this.activeConversations.push(r.conversationId),r.conversationId&&!this.messagesMap[r.conversationId]&&(this.messagesMap[r.conversationId]=[],this.sendWsMessage({type:"sync_messages",conversationId:r.conversationId,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){let s=this.panels.find(n=>n.id===e);s&&(s.conversationId=t,t&&!this.activeConversations.includes(t)&&this.activeConversations.push(t),t&&!this.messagesMap[t]&&(this.messagesMap[t]=[],this.sendWsMessage({type:"sync_messages",conversationId:t,turns:5})),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.sendWsMessage({type:"sync_messages",conversationId:e,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,i=n?!!fs()?.sessionById?.(e,n)?.pinned:this.pinnedSessions.includes(e);if(t&&!i)this.pinnedSessions.unshift(e);else if(!t&&i){let r=this.pinnedSessions.indexOf(e);r>=0&&this.pinnedSessions.splice(r,1)}try{localStorage.setItem("pinned-sessions",JSON.stringify(this.pinnedSessions))}catch{}try{let r=window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore(),o=Ee(this,e,n);r&&typeof r.applyPinState=="function"&&r.applyPinState(e,!!t,o)}catch{}},togglePin(e,t={}){let s=t&&t.agentId?t.agentId:null,n=s?fs()?.sessionById?.(e,s):null,i=t&&Object.prototype.hasOwnProperty.call(t,"pinned"),o=!(n?!!n.pinned:i?!!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),i=[];for(let r of t)n.has(r)||i.push(r);if(i.length>0&&(this.pinnedSessions=[...i,...this.pinnedSessions]),e){let r=this.pinnedSessions.filter(o=>s(o)?t.has(o):!0);r.length!==this.pinnedSessions.length&&(this.pinnedSessions=r)}try{localStorage.setItem("pinned-sessions",JSON.stringify(this.pinnedSessions))}catch{}},clearYeaftSessionProcessingIfIdle(e,{ignoreStatuses:t=!1}={}){if(!e||Object.values(this.activeVpTurns||{}).some(r=>r?.sessionId===e)||!t&&Object.values(this.vpStatuses||{}).some(o=>(o?.sessionId||o?.groupId||null)===e&&Fn.has(o?.state)))return;let{[e]:n,...i}=this.yeaftProcessingSessions||{};this.yeaftProcessingSessions=i},sendMessage(e,t=[],s={}){vl(this,e,t,s)},cancelExecution(){yl(this)},cancelYeaft(){this.currentAgent&&(this.sendWsMessage({type:"yeaft_abort_all",agentId:this.currentAgent}),this.yeaftConversationId&&delete this.processingConversations[this.yeaftConversationId],this.activeVpTurns={},this.stoppingVpTurnIds={},this.yeaftProcessingSessions={})},cancelYeaftSession(e){let t=Ee(this,e);!t||!e||(this.sendWsMessage({type:"yeaft_abort_all",agentId:t,sessionId:e}),this.activeVpTurns=Object.fromEntries(Object.entries(this.activeVpTurns||{}).filter(([,s])=>s?.sessionId!==e)),this.stoppingVpTurnIds=Object.fromEntries(Object.entries(this.stoppingVpTurnIds||{}).filter(([s])=>this.activeVpTurns?.[s])),this.clearYeaftSessionProcessingIfIdle(e))},cancelVpTurn(e,{sessionId:t=null,vpId:s=null}={}){let n=Ee(this,t);if(!n||!e)return;this.stoppingVpTurnIds={...this.stoppingVpTurnIds,[e]: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=Ee(this,s);if(!n)return!1;let i=this.activeVpTurns||{},r=null,o=-1/0;for(let[a,l]of Object.entries(i)){if(!l||l.vpId!==e||s&&l.sessionId&&l.sessionId!==s)continue;let c=typeof l.startedAt=="number"?l.startedAt:0;c>=o&&(o=c,r=a)}if(!r){let a=this.vpStatuses?.[$n(s,e)]||null;a?.turnId&&!["idle","offline"].includes(a.state)&&(r=a.turnId)}return r?(this.cancelVpTurn(r,{sessionId:s,vpId:e}),!0):(this.sendWsMessage({type:"yeaft_abort_turn",agentId:n,sessionId:s,vpId:e}),!0)},answerUserQuestion(e,t,s){bl(this,e,t,s)},refreshAgents(){Il(this)},refreshConversation(){Al(this)},restartAgent(e){xl(this,e)},upgradeAgent(e){Tl(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;this.sendWsMessage({type:"sync_messages",conversationId:n,turns:5,...s?{beforeId:s.dbMessageId}:{}}),setTimeout(()=>{this._loadMoreGeneration===e&&this.loadingMoreMessages&&this.currentConversation===n&&(this.loadingMoreMessages=!1)},1e4)},reloadYeaftMessages(){if(this.currentView!=="yeaft")return!1;let e=Ys(this),t=Ee(this,e);if(!t)return!1;let s=qe(t,e),n=this.yeaftConversationId,{[s]:i,...r}=this.yeaftSessionHistoryState||{};this.yeaftSessionHistoryState={...r,[s]:{loaded:!1,loading:!0,hasMore:!1,oldestSeq:null,latestSeq:null,count:0}},this.yeaftHasMoreHistory=!1,this.yeaftOldestLoadedSeq=null,this.yeaftLoadingMoreHistory=!0;let o=Us();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[s]:o};let a={type:"yeaft_load_history",agentId:t,limit:Vn,sessionId:e,perfTraceId:o};return Qe(this,{traceId:o,phase:"history.request_send",agentId:t,sessionId:e,messageType:a.type,bytes:JSON.stringify(a).length,detail:{mode:"manual-reload",limit:Vn}}),this.sendWsMessage(a),!0},loadMoreYeaftHistory(){if(this.currentView!=="yeaft"||this.yeaftLoadingMoreHistory||!this.yeaftHasMoreHistory||this.yeaftOldestLoadedSeq==null)return;let e=Ys(this),t=Ee(this,e);if(!t)return;this.yeaftLoadingMoreHistory=!0;let s=qe(t,e);this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[s]:{...this.yeaftSessionHistoryState[s]||{},loading:!0}};let n=Us();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[s]:n};let i={type:"yeaft_load_more_history",agentId:t,sessionId:e,beforeSeq:this.yeaftOldestLoadedSeq,turns:10,perfTraceId:n};Qe(this,{traceId:n,phase:"history_more.request_send",agentId:t,sessionId:e,messageType:i.type,bytes:JSON.stringify(i).length,detail:{beforeSeq:i.beforeSeq,turns:i.turns}}),this.sendWsMessage(i)},checkPendingRecovery(){Ko(this)},performRecovery(){Go(this)},dismissRecovery(){Yo(this)},autoRestoreConversation(e){Qo(this,e)},saveOpenSessions(){ds(this)},getLastSession(){return Zo(this)},clearLastSession(){Jo(this)},listHistorySessions(e){ea(this,e)},listFolders(){return ta(this)},listFoldersForAgent(e,t){return sa(this,e,t)},listModelsForAgent(e,t){return na(this,e,t)},listHistorySessionsForAgent(e,t,s){ia(this,e,t,s)},async loadGlobalSessions(e=20){return ra(this,e)},async deleteGlobalSession(e){return oa(this,e)},findAgentForSession(e){return Xi(this,e)},isSessionResumable(e){return aa(this,e)},_isRecentlyClosed(e){return Ht(this,e)},_startProcessingWatchdog(e){us(this,e)},_resetProcessingWatchdog(e){Tn(this,e)},_stopProcessingWatchdog(e){ke(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 i of n.resolvers)i(this.modelsDevRegistry)}return new Promise(n=>{let i={resolvers:[n],force:e,timer:null};this._modelsDevPending=i;try{this.sendWsMessage({type:"get_models_dev_registry",agentId:s,forceRefresh:e})}catch{this._modelsDevPending===i&&(this._modelsDevPending=null),n(this.modelsDevRegistry);return}i.timer=setTimeout(()=>{if(this._modelsDevPending===i){this._modelsDevPending=null;for(let r of i.resolvers)r(this.modelsDevRegistry)}},2e4)})},changeLocale(e){if(this.locale=e,Os(e),this.currentAgent)try{this.sendWsMessage({type:"update_llm_config",agentId:this.currentAgent,config:{language:e}})}catch{}},async fetchCustomExpertRoles(){let e=Ae();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=Ae();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 i=await n.json();return this.customExpertRoles.push(i.role),i.role}else{let i=await n.json().catch(()=>({}));throw new Error(i.error||"Failed to create custom expert role")}}catch(s){throw s}},async updateCustomExpertRole(e,t){let s=Ae();try{let n={"Content-Type":"application/json"};s.token&&(n.Authorization=`Bearer ${s.token}`);let i=await fetch(`/api/expert-roles/custom/${e}`,{method:"PUT",headers:n,body:JSON.stringify(t)});if(i.ok){let r=await i.json(),o=this.customExpertRoles.findIndex(a=>a.id===e);return o!==-1&&(this.customExpertRoles[o]=r.role),r.role}else{let r=await i.json().catch(()=>({}));throw new Error(r.error||"Failed to update custom expert role")}}catch(n){throw n}},async deleteCustomExpertRole(e){let t=Ae();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(i=>i.id!==e),!0;{let i=await n.json().catch(()=>({}));throw new Error(i.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){t&&t.trim()?(this.customConversationTitles[e]=t.trim(),this.sendWsMessage({type:"update_conversation_settings",conversationId:e,title:t.trim()})):(delete this.customConversationTitles[e],this.sendWsMessage({type:"update_conversation_settings",conversationId:e,title:""}))},openFileInExplorer(e){this.currentConversation&&(this.workbenchExpanded=!0,window.dispatchEvent(new CustomEvent("open-file-in-explorer",{detail:{filePath:e,conversationId:this.currentConversation}})))},logout(){Ae().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.ws&&this.ws.close()}}})});function _r(e,t){!e||typeof e.handleYeaftOutput!="function"||!t||e.handleYeaftOutput({event:t})}function gg(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 Rr(e){if(!e)return Tt[0];let t=String(e).toLowerCase();return fg[t]||Tt[gg(t)%Tt.length]}function mg(e){return Rr(e).background}function hg(e){return Rr(e).foreground}function Er(){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 vg(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 pg,Tt,fg,Cv,ft,gs=O(()=>{({defineStore:pg}=Pinia);Tt=[{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)"}],fg=Object.freeze({steve:Tt[8],ada:Tt[3],linus:Tt[0],martin:Tt[4]}),Cv=Tt.map(e=>e.background);ft=pg("vp",{state:()=>({vps:{},vpOrder:[],emptyLibrary:!1,lastSnapshotAt:0,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?Er().startsWith("zh")&&s.displayNameZh?s.displayNameZh:s.displayName||s.vpId||t:t},vpDescription:e=>t=>vg(e.vps[t],Er()),vpInitial:e=>t=>{let s=e.vps[t],n=Er().startsWith("zh"),i=s&&(s.avatar||n&&s.displayNameZh||s.displayName||s.vpId)||t||"?";return String(i).charAt(0).toUpperCase()||"?"},vpColor:e=>t=>{let s=e.vps[t];return s&&s.color?s.color:mg(t)},vpTextColor:()=>e=>hg(e),vpAvatarMotif:()=>e=>Rr(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){this.vps={},this.vpOrder=[];let s=e&&Array.isArray(e.vps)?e.vps:[];for(let n of s)this._upsertInternal(n);this.emptyLibrary=!!(e&&e.emptyLibrary),this.lastSnapshotAt=Date.now(),this.lastVpSnapshotAgentId=t||null},upsert(e,t=null){this._upsertInternal(e),e&&e.vpId&&(this.lastChange={vpId:e.vpId,kind:"updated",reason:t||null,at:Date.now()})},remove(e,t=null){e&&(delete this.vps[e],this.vpOrder=this.vpOrder.filter(s=>s!==e),this.lastChange={vpId:e,kind:"removed",reason:t||"file.removed",at:Date.now()})},_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(_r(s,{type:"dream_progress",phase:"start",groupId:e,manual:!0,trigger:"manual",source:"header-button",ts:n}),!s||typeof s.sendWsMessage!="function"){_r(s,{type:"yeaft_dream_result",groupId:e,success:!1,skipped:!0,skippedReason:"chat-store-unavailable",trigger:"manual",error:null});return}let i={type:"yeaft_dream_trigger",sessionId:e},r=t&&t.agentId?t.agentId:typeof s.agentIdForSession=="function"?s.agentIdForSession(e):s.currentAgent;r&&(i.agentId=r),s.sendWsMessage(i)===!1&&_r(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:[]},i=t||s?null:e.error||null,r=s?"skipped":t?"success":"error",o=e.sessionId;if(o){this.groupDreamStatus={...this.groupDreamStatus,[o]:{status:r,lastRunAt:Date.now(),lastResult:n,lastError:i}};return}if(!e.vpId)return;let a=e.vpId;this.dreamStatus={...this.dreamStatus,[a]:{status:r,lastRunAt:Date.now(),lastResult:n,lastError:i}}}}})});function Lr(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 Nn(e){return!e||typeof e!="object"?0:Lr(e.lastMessageAt)||Lr(e.updatedAt)||Lr(e.createdAt)||0}function $r(e,t){let s=Nn(t)-Nn(e);return s!==0?s:String(e?.id||"").localeCompare(String(t?.id||""))}function mc(e){return[...Array.isArray(e)?e:[]].sort($r)}var Bn=O(()=>{});function hc(){try{if(typeof localStorage>"u")return{};let e=JSON.parse(localStorage.getItem(wc)||"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function yg(e){try{typeof localStorage<"u"&&localStorage.setItem(wc,JSON.stringify(e&&typeof e=="object"?e:{}))}catch{}}function vc(){try{return typeof localStorage>"u"?[]:Qs(JSON.parse(localStorage.getItem(kc)||"[]"))}catch{return[]}}function bg(e){try{typeof localStorage<"u"&&localStorage.setItem(kc,JSON.stringify(Qs(e)))}catch{}}function Sc(e,t){return`${e||""}${t||""}`}function wt(e){return e&&e.agentId&&e.id?Sc(e.agentId,e.id):""}function kt(e,t){return t?e?Sc(e,t):String(t):""}function wg(e){return typeof e=="string"?e:String(e||"")}function tt(e,t,s=null){let n=wg(t);if(!n)return"";let i=kt(s,n);if(i&&e.sessions[i])return i;if(e.sessions[n])return n;if(e.activeSessionKey&&e.sessions[e.activeSessionKey]?.id===n)return e.activeSessionKey;let r=e.sessionOrder.filter(a=>e.sessions[a]?.id===n);if(s){let a=r.find(l=>e.sessions[l]?.agentId===s);if(a)return a}let o=Or();if(o?.currentAgent){let a=r.find(l=>e.sessions[l]?.agentId===o.currentAgent);if(a)return a}return r[0]||""}function Vr(e,t,s=null){return tt(e,t,s)||""}function Qs(e){let t=[],s=new Set;for(let n of Array.isArray(e)?e:[]){let i=typeof n=="string"?n:String(n||"");!i||s.has(i)||(s.add(i),t.push(i))}return t}function Fr(e,t){let s=Qs(e),n=new Set(s),i=Qs(t).filter(o=>n.has(o)),r=new Set(i);return[...i,...s.filter(o=>!r.has(o))]}function qn(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 yc(e){return!e||typeof e!="object"?!1:e.running===!0||e.active===!0||e.isActive===!0||e.isRunning===!0}function bc(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 Or(){try{if(typeof window<"u"&&window.Pinia&&typeof window.Pinia.useChatStore=="function")return window.Pinia.useChatStore()}catch{}return null}var wc,kc,kg,Cc,Ic=O(()=>{Bn();wc="yeaft-session-order-by-agent",kc="yeaft-session-order-global";({defineStore:kg}=Pinia);Cc=kg("sessions",{state:()=>({sessions:{},sessionOrder:[],activeSessionId:null,activeSessionKey:null,lastSnapshotAt:0,lastCrudResult:null,pending:{}}),getters:{sessionList(e){let t=e.sessionOrder.map(d=>e.sessions[d]).filter(Boolean),s=Or(),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 i=[],r=[];for(let d of t)d.pinned||!d.agentId&&n.has(d.id)?i.push(d):r.push(d);let o=d=>[...d].sort((u,p)=>{let f=Number.isFinite(u?.sortOrder)?u.sortOrder:Number.MAX_SAFE_INTEGER,g=Number.isFinite(p?.sortOrder)?p.sortOrder:Number.MAX_SAFE_INTEGER;return f!==g?f-g:$r(u,p)}),a=[...o(i),...o(r)],l=vc();if(l.length===0)return a;let c=new Map(l.map((d,u)=>[d,u]));return a.sort((d,u)=>{let p=c.has(wt(d))?c.get(wt(d)):Number.MAX_SAFE_INTEGER,f=c.has(wt(u))?c.get(wt(u)):Number.MAX_SAFE_INTEGER;return p!==f?p-f:0})},sessionCount(e){return e.sessionOrder.length},sessionById:e=>(t,s=null)=>{let n=tt(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){let s=Array.isArray(e)?e:[];if(t){let h={...this.sessions},A=new Set;for(let E of s){if(!E||!E.id)continue;let R=kt(t,E.id);A.add(R),h[R]=this._normalize(E,t,qn(this.sessions[R]))}for(let E of this.sessionOrder){let R=this.sessions[E];R&&R.agentId===t&&!A.has(E)&&delete h[E]}let x=this.sessionOrder.filter(E=>h[E]),k=new Set(x),y=[];for(let E of s){if(!E||!E.id)continue;let R=kt(t,E.id);h[R]&&!k.has(R)&&y.push(R)}this.sessions=h;let m=[...x,...y],w=vc();if(w.length>0){let E=new Map(m.map(P=>[wt(h[P]),P]).filter(([P])=>P)),R=w.map(P=>E.get(P)).filter(Boolean),q=new Set(R);m=[...R,...m.filter(P=>!q.has(P))];let $=new Map(w.map((P,D)=>[P,D]));for(let P of m){let D=wt(h[P]);D&&$.has(D)&&(h[P]={...h[P],sortOrder:$.get(D)})}}if(t&&w.length===0){let E=hc(),R=Qs(E[t]);if(R.length>0){let q=R.map(T=>kt(t,T)),$=new Set(q),P=Fr(m.filter(T=>h[T]?.agentId===t),q),D=this.sessionOrder.some(T=>h[T]?.agentId===t),M=0;D?m=this.sessionOrder.filter(T=>h[T]).map(T=>h[T]?.agentId===t?P[M++]:T).concat(P.slice(M)):m=m.map(T=>h[T]?.agentId===t?P[M++]:T);let C=new Map(q.map((T,N)=>[T,N]));for(let T of P)h[T]&&$.has(T)&&(h[T]={...h[T],sortOrder:C.get(T)})}}this.sessionOrder=m}else{if(Object.values(this.sessions).some(k=>k&&k.agentId))return;let A={},x=[];for(let k of s){if(!k||!k.id)continue;let y=kt(null,k.id);A[y]=this._normalize(k,null,qn(this.sessions[y])),x.push(y)}this.sessions=A,this.sessionOrder=x}this.lastSnapshotAt=Date.now();let n=null;try{n=localStorage.getItem("lastViewedYeaftSession")||null}catch{}let i=n?tt(this,n,t):"",r=i?this.sessions[i]:null,o=r&&(!t||r.agentId===t),a=this.sessionOrder.filter(h=>this.sessions[h]&&(!t||this.sessions[h].agentId===t)&&this.sessions[h].running).sort((h,A)=>bc(this.sessions[A])-bc(this.sessions[h]))[0]||null,l=a?this.sessions[a]?.id:null,c=this.sessionList[0]||null,d=c?.id||null,u=d?tt(this,d,c?.raw?.agentId||null):"",p=l||(o?n:null)||d,f=a||(o?i:"")||u||Vr(this,p,t),g=this.activeSessionKey?this.sessions[this.activeSessionKey]?.agentId:null;this.activeSessionId&&!tt(this,this.activeSessionId,g)?(this.activeSessionId=p,this.activeSessionKey=f||null):!this.activeSessionId&&this.sessionOrder.length>0?(this.activeSessionId=p,this.activeSessionKey=f||null):this.activeSessionId&&(this.activeSessionKey=Vr(this,this.activeSessionId,g)||this.activeSessionKey);let b=Or();if(b){if(t){let x={...b.yeaftSessionAgentById||{}};for(let k of s)k&&k.id&&!x[k.id]&&(x[k.id]=t);b.yeaftSessionAgentById=x}let h=this.activeSessionId||p,A=null;(b.yeaftActiveSessionFilter&&!tt(this,b.yeaftActiveSessionFilter)||!b.yeaftActiveSessionFilter&&h)&&(A=h),A&&(b.currentView==="yeaft"&&typeof b.setActiveSessionFilter=="function"?b.setActiveSessionFilter(A,{force:!0}):b.yeaftActiveSessionFilter=A,this.activeSessionKey=Vr(this,A)||this.activeSessionKey)}if(b&&typeof b.applyServerPinSnapshot=="function"){let h=new Set;for(let x of s){if(!x||!x.id)continue;let k=kt(t,x.id),y=this.sessions[k];y&&y.pinned&&h.add(x.id)}let A=x=>{let k=tt(this,x,t),y=k?this.sessions[k]:null;return y?y.agentId===t:!1};b.applyServerPinSnapshot(t,h,A)}},applyRosterChange(e){if(!e)return;let t=e.sessionId||e.groupId;if(!t)return;let s=e.agentId||null,n=tt(this,t,s)||kt(s,t),i=this.sessions[n];if(!i){let r=this._normalize({id:t,name:e.name||t,roster:Array.isArray(e.roster)?e.roster:[],defaultVpId:e.defaultVpId||null},s);this.sessions[n]=r,this.sessionOrder.push(n);return}this.sessions[n]={...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}},applyCrudResult(e,t=null){if(!e)return;this.lastCrudResult={...e,at:Date.now()},e.requestId&&this.pending[e.requestId]&&delete this.pending[e.requestId],e.ok&&e.op==="list"&&Array.isArray(e.sessions)&&this.applySnapshot(e.sessions,t);let s=e.session||e.group||null;e.ok&&e.op==="create"&&s&&s.id&&(this.applySnapshotUpsert(s,t),this.setActive(s.id,t));let n=e.sessionId||e.groupId,i=n?tt(this,n,t):"";if(e.ok&&(e.op==="archive"||e.op==="delete")&&n&&(i&&delete this.sessions[i],this.sessionOrder=this.sessionOrder.filter(r=>r!==i),(this.activeSessionKey===i||this.activeSessionId===n)&&(this.activeSessionKey=this.sessionOrder[0]||null,this.activeSessionId=this.activeSessionKey&&this.sessions[this.activeSessionKey]?.id||null)),e.ok&&e.op==="update_config"&&n){let r=i?this.sessions[i]:null;r&&(this.sessions[i]={...r,config:e.config&&typeof e.config=="object"?{...e.config}:{}})}},applySnapshotUpsert(e,t=null){if(!e||!e.id)return;let s=t||e.agentId||null,n=tt(this,e.id,s)||kt(s,e.id),i=!!this.sessions[n],r=this.sessions[n]||{};this.sessions[n]={...r,...this._normalize(e,s,qn(r))},i||this.sessionOrder.push(n)},setActive(e,t=null){let s=tt(this,e,t);e&&s&&this.sessions[s]?(this.activeSessionId=e,this.activeSessionKey=s):(this.activeSessionId=null,this.activeSessionKey=null)},reorderSessionsForAgent(e,t){if(!e)return[];let s=this.sessionOrder.filter(l=>this.sessions[l]?.agentId===e),n=Fr(s,t.map(l=>kt(e,l)));if(n.length===0)return[];let i=new Map(n.map((l,c)=>[l,c])),r=0;this.sessionOrder=this.sessionOrder.map(l=>this.sessions[l]?.agentId===e?n[r++]:l);for(let l of n)this.sessions[l]={...this.sessions[l],sortOrder:i.get(l)};let o=hc(),a=n.map(l=>this.sessions[l]?.id).filter(Boolean);return o[e]=a,yg(o),a},reorderSessionsGlobally(e){let t=this.sessionOrder.map(a=>wt(this.sessions[a])).filter(Boolean),s=Fr(t,e);if(s.length===0)return[];let n=new Map(this.sessionOrder.map(a=>[wt(this.sessions[a]),a]).filter(([a])=>a)),i=s.map(a=>n.get(a)).filter(Boolean),r=new Set(i);this.sessionOrder=[...i,...this.sessionOrder.filter(a=>!r.has(a))];let o=new Map(s.map((a,l)=>[a,l]));for(let a of this.sessionOrder){let l=wt(this.sessions[a]);l&&o.has(l)&&(this.sessions[a]={...this.sessions[a],sortOrder:o.get(l)})}return bg(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){let n=tt(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},_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:yc(e),active:yc(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:qn(e,s),sortOrder:Number.isFinite(e.sortOrder)?e.sortOrder:null}}}})});function Wn(){try{if(window.Pinia&&typeof window.Pinia.useAuthStore=="function")return window.Pinia.useAuthStore()}catch{}return null}function Hr(){try{return localStorage.getItem("authToken")||null}catch{return null}}function Tc(){let e=Wn();if(e)try{return e.getActiveToken?.()||e.token||Hr()}catch{return e.token||Hr()}return Hr()}function Cg(e,t){if(!e)return!1;let s=Tc();if(s&&s!==t)return!1;try{localStorage.setItem("authToken",e)}catch{}let n=Wn();return n&&(n.token=e),!0}function Ig(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 xc(e){return!e||typeof window>"u"||!window.location?!1:e.origin===window.location.origin&&e.pathname.startsWith("/api/")}function Ag(e){if(!e)return!1;let t=e.pathname;return!!(Sg.has(t)||t.startsWith("/api/auth/sso/poll/")||/^\/api\/auth\/sso\/[^/]+\/start(?:-qr)?$/.test(t))}function xg(e,t){return t?.headers?new Headers(t.headers):e&&typeof e=="object"&&e.headers?new Headers(e.headers):new Headers}function Tg(e){let t=e.get("Authorization");return!t||!t.startsWith("Bearer ")?null:t.slice(7)}function Mg(e,t){return{...e||{},headers:t}}function Pg(e,t,s,n){let i=Wn();i&&typeof i.handleAuthResponse=="function"?i.handleAuthResponse(e,t,s,n):i&&typeof i.handleAuthFailure=="function"&&n&&i.handleAuthFailure(void 0,t,s)}function Mc(){if(Ac||typeof window>"u"||!window.fetch)return;Ac=!0;let e=window.fetch.bind(window);window.fetch=async function(s,n){let i=Ig(s),r=xc(i)&&!Ag(i),o=xc(i)?{...n||{},credentials:"same-origin"}:n,a=null,l=r?Wn():null,c=l?.authGeneration,d=!!l?.isAuthenticated;if(r){let p=xg(s,n);a=Tg(p),a||(a=Tc(),a&&(p.set("Authorization",`Bearer ${a}`),o=Mg(o,p)))}let u=await e(s,o);try{let p=u.headers&&u.headers.get&&u.headers.get("X-New-Token");p&&Cg(p,a),r&&u.status===401&&Pg(u,a,c,d)}catch{}return u}}var Ac,Sg,Pc=O(()=>{Ac=!1,Sg=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 Dc,_c=O(()=>{Dc={"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
|
|
9
9
|
\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
|
|
10
|
-
\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","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","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":"\u5BF9\u8BDD\u5927\u7EB2","yeaft.outline.title":"\u5927\u7EB2","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...","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.imageUnavailable":"\u56FE\u7247\u65E0\u6CD5\u52A0\u8F7D","message.attachFiles":"{count} \u4E2A\u6587\u4EF6","message.fileCount":"{count} \u4E2A\u6587\u4EF6","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.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.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.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.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.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.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":"\u53D6\u6D88\u5DE5\u4F5C\u9879","workCenter.cancelWorkItemHint":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u6240\u6709\u5C1A\u672A\u5B8C\u6210\u7684 Actions\u3002\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002","workCenter.cancelConfirm":"\u53D6\u6D88\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u5E76\u505C\u6B62\u5176\u5C1A\u672A\u5B8C\u6210\u7684 Actions\uFF1F","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.actionCount":"{count} \u4E2A Action","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.generation":"\u6267\u884C\u7248\u672C","workCenter.currentExecution":"\u5F53\u524D\u6267\u884C","workCenter.previousExecution":"\u5386\u53F2\u6267\u884C","workCenter.attempt":"\u7B2C","workCenter.loops":"\u4E2A Loop","workCenter.tools":"\u6B21\u5DE5\u5177\u8C03\u7528","workCenter.noActionMessages":"\u8FD8\u6CA1\u6709\u6267\u884C\u6D88\u606F\u3002","workCenter.actionDetails":"Action \u8BE6\u60C5","workCenter.selectAction":"\u9009\u62E9\u4E00\u4E2A Action \u67E5\u770B\u5B9E\u9645\u6267\u884C","workCenter.backToWorkItems":"\u5DE5\u4F5C\u9879","workCenter.backToActions":"Actions","workCenter.you":"\u4F60","workCenter.aiResponse":"AI \u54CD\u5E94","workCenter.requestDetails":"\u8BF7\u6C42\u8BE6\u60C5","workCenter.noRequestDetails":"\u8FD9\u4E2A Action \u6682\u65F6\u6CA1\u6709\u53EF\u7528\u7684\u8BF7\u6C42\u8BE6\u60C5\u3002","workCenter.loadingRequests":"\u6B63\u5728\u52A0\u8F7D\u8BF7\u6C42\u2026","workCenter.loadingRequestDetail":"\u6B63\u5728\u52A0\u8F7D\u8BF7\u6C42\u8BE6\u60C5\u2026","workCenter.requestDetailUnavailable":"\u8BF7\u6C42\u8BE6\u60C5\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u8BD5\u3002","workCenter.noRequestLoops":"\u8FD9\u4E2A\u8BF7\u6C42\u6CA1\u6709\u4FDD\u7559\u4E0B\u53EF\u5C55\u793A\u7684 Loop \u8BE6\u60C5\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.systemPrompt":"\u7CFB\u7EDF\u63D0\u793A\u8BCD","workCenter.requestMessages":"\u8BF7\u6C42\u6D88\u606F","workCenter.toolCalls":"\u5DE5\u5177\u8C03\u7528","workCenter.rawRequest":"\u539F\u59CB\u8BF7\u6C42","workCenter.rawResponse":"\u539F\u59CB\u54CD\u5E94","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.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":"\u65B0\u8F93\u5165\u4F1A\u8FFD\u52A0\u5230\u5F53\u524D Action\uFF0C\u5E76\u5728\u4E0B\u4E00\u4E2A\u5B89\u5168\u7684\u6267\u884C Loop \u4E2D\u5E94\u7528\u3002","workCenter.actionFailedTitle":"\u8FD9\u4E2A Action \u4E3A\u4EC0\u4E48\u5931\u8D25","workCenter.failedAt":"\u5931\u8D25\u65F6\u95F4","workCenter.actionFailureRecovery":"\u5728\u4E0B\u65B9\u8865\u5145\u4FEE\u6B63\u8BF4\u660E\u6216\u6587\u4EF6\u5373\u53EF\u91CD\u65B0\u6267\u884C\u3002\u8BF7\u6C42\u8BE6\u60C5\u4E2D\u53EF\u4EE5\u67E5\u770B\u5177\u4F53\u6A21\u578B\u548C Loop \u8F68\u8FF9\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.workItemMessages":"Work Item \u6D88\u606F","workCenter.workItemMessageScope":"\u5728\u4E0B\u4E00\u4E2A\u5B89\u5168\u8FB9\u754C\u5E94\u7528\u5230\u6240\u6709\u672A\u5B8C\u6210 Action\u3002","workCenter.actionMessageScopeTitle":"\u7ED9\u8FD9\u4E2A Action \u53D1\u6D88\u606F","workCenter.actionMessageScope":"\u6D88\u606F\u53EA\u53D1\u9001\u7ED9\u5F53\u524D Action\u3002","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":"\u6253\u5F00\u5F53\u524D Action\uFF0C\u5728\u4E0B\u65B9\u8F93\u5165\u6846\u4E2D\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.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 AI \u52A8\u6001\u89C4\u5212\u4F7F\u7528\u7684\u53EF\u590D\u7528 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":"\u8FD9\u91CC\u7684\u6A21\u578B\u548C effort \u7B56\u7565\u7528\u4E8E triage \u4EE5\u53CA AI \u751F\u6210\u7684\u6240\u6709 Action\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 Ec,Rc=O(()=>{Ec={"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}"?
|
|
10
|
+
\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","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","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.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...","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.imageUnavailable":"\u56FE\u7247\u65E0\u6CD5\u52A0\u8F7D","message.attachFiles":"{count} \u4E2A\u6587\u4EF6","message.fileCount":"{count} \u4E2A\u6587\u4EF6","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.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.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.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.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.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.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":"\u53D6\u6D88\u5DE5\u4F5C\u9879","workCenter.cancelWorkItemHint":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u6240\u6709\u5C1A\u672A\u5B8C\u6210\u7684 Actions\u3002\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002","workCenter.cancelConfirm":"\u53D6\u6D88\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u5E76\u505C\u6B62\u5176\u5C1A\u672A\u5B8C\u6210\u7684 Actions\uFF1F","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.actionCount":"{count} \u4E2A Action","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.generation":"\u6267\u884C\u7248\u672C","workCenter.currentExecution":"\u5F53\u524D\u6267\u884C","workCenter.previousExecution":"\u5386\u53F2\u6267\u884C","workCenter.attempt":"\u7B2C","workCenter.loops":"\u4E2A Loop","workCenter.tools":"\u6B21\u5DE5\u5177\u8C03\u7528","workCenter.noActionMessages":"\u8FD8\u6CA1\u6709\u6267\u884C\u6D88\u606F\u3002","workCenter.actionDetails":"Action \u8BE6\u60C5","workCenter.selectAction":"\u9009\u62E9\u4E00\u4E2A Action \u67E5\u770B\u5B9E\u9645\u6267\u884C","workCenter.backToWorkItems":"\u5DE5\u4F5C\u9879","workCenter.backToActions":"Actions","workCenter.you":"\u4F60","workCenter.aiResponse":"AI \u54CD\u5E94","workCenter.requestDetails":"\u8BF7\u6C42\u8BE6\u60C5","workCenter.noRequestDetails":"\u8FD9\u4E2A Action \u6682\u65F6\u6CA1\u6709\u53EF\u7528\u7684\u8BF7\u6C42\u8BE6\u60C5\u3002","workCenter.loadingRequests":"\u6B63\u5728\u52A0\u8F7D\u8BF7\u6C42\u2026","workCenter.loadingRequestDetail":"\u6B63\u5728\u52A0\u8F7D\u8BF7\u6C42\u8BE6\u60C5\u2026","workCenter.requestDetailUnavailable":"\u8BF7\u6C42\u8BE6\u60C5\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u8BD5\u3002","workCenter.noRequestLoops":"\u8FD9\u4E2A\u8BF7\u6C42\u6CA1\u6709\u4FDD\u7559\u4E0B\u53EF\u5C55\u793A\u7684 Loop \u8BE6\u60C5\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.systemPrompt":"\u7CFB\u7EDF\u63D0\u793A\u8BCD","workCenter.requestMessages":"\u8BF7\u6C42\u6D88\u606F","workCenter.toolCalls":"\u5DE5\u5177\u8C03\u7528","workCenter.rawRequest":"\u539F\u59CB\u8BF7\u6C42","workCenter.rawResponse":"\u539F\u59CB\u54CD\u5E94","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.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":"\u65B0\u8F93\u5165\u4F1A\u8FFD\u52A0\u5230\u5F53\u524D Action\uFF0C\u5E76\u5728\u4E0B\u4E00\u4E2A\u5B89\u5168\u7684\u6267\u884C Loop \u4E2D\u5E94\u7528\u3002","workCenter.actionFailedTitle":"\u8FD9\u4E2A Action \u4E3A\u4EC0\u4E48\u5931\u8D25","workCenter.failedAt":"\u5931\u8D25\u65F6\u95F4","workCenter.actionFailureRecovery":"\u5728\u4E0B\u65B9\u8865\u5145\u4FEE\u6B63\u8BF4\u660E\u6216\u6587\u4EF6\u5373\u53EF\u91CD\u65B0\u6267\u884C\u3002\u8BF7\u6C42\u8BE6\u60C5\u4E2D\u53EF\u4EE5\u67E5\u770B\u5177\u4F53\u6A21\u578B\u548C Loop \u8F68\u8FF9\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.workItemMessages":"Work Item \u6D88\u606F","workCenter.workItemMessageScope":"\u5728\u4E0B\u4E00\u4E2A\u5B89\u5168\u8FB9\u754C\u5E94\u7528\u5230\u6240\u6709\u672A\u5B8C\u6210 Action\u3002","workCenter.actionMessageScopeTitle":"\u7ED9\u8FD9\u4E2A Action \u53D1\u6D88\u606F","workCenter.actionMessageScope":"\u6D88\u606F\u53EA\u53D1\u9001\u7ED9\u5F53\u524D Action\u3002","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":"\u6253\u5F00\u5F53\u524D Action\uFF0C\u5728\u4E0B\u65B9\u8F93\u5165\u6846\u4E2D\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.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 AI \u52A8\u6001\u89C4\u5212\u4F7F\u7528\u7684\u53EF\u590D\u7528 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":"\u8FD9\u91CC\u7684\u6A21\u578B\u548C effort \u7B56\u7565\u7528\u4E8E triage \u4EE5\u53CA AI \u751F\u6210\u7684\u6240\u6709 Action\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 Ec,Rc=O(()=>{Ec={"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}"?
|
|
11
11
|
All active conversations will be interrupted.`,"chat.agent.upgrade":"Upgrade","chat.agent.upgrading":"Upgrading","chat.agent.upgradeConfirm":`Upgrade Agent "{name}" to the latest version?
|
|
12
|
-
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","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","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":"Conversation outline","yeaft.outline.title":"Outline","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...","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.imageUnavailable":"Image unavailable","message.attachFiles":"{count} file(s)","message.fileCount":"{count} file(s)","input.upload":"Upload file","input.placeholder":"Type a message...","input.send":"Send","input.stopExecution":"Stop execution","chatInput.upload":"Upload file","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.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.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.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.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.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":"Cancel work item","workCenter.cancelWorkItemHint":"Stop this Work Item and all unfinished Actions. This cannot be undone.","workCenter.cancelConfirm":"Cancel this work item and stop its unfinished Actions?","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.actionCount":"{count} Actions","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.generation":"Generation","workCenter.currentExecution":"Current execution","workCenter.previousExecution":"Previous execution","workCenter.attempt":"Attempt","workCenter.loops":"loops","workCenter.tools":"tools","workCenter.noActionMessages":"No execution messages yet.","workCenter.actionDetails":"Action details","workCenter.selectAction":"Select an Action to inspect its execution","workCenter.backToWorkItems":"Work items","workCenter.backToActions":"Actions","workCenter.you":"You","workCenter.aiResponse":"AI response","workCenter.requestDetails":"Request details","workCenter.noRequestDetails":"No request details are available for this Action yet.","workCenter.loadingRequests":"Loading requests\u2026","workCenter.loadingRequestDetail":"Loading request detail\u2026","workCenter.requestDetailUnavailable":"Request detail is unavailable. Try again.","workCenter.noRequestLoops":"This request has no retained loop details.","workCenter.loadEarlierMessages":"Load earlier messages","workCenter.loadingEarlierMessages":"Loading earlier messages\u2026","workCenter.unknownModel":"Unknown model","workCenter.loop":"Loop","workCenter.systemPrompt":"System prompt","workCenter.requestMessages":"Request messages","workCenter.toolCalls":"Tool calls","workCenter.rawRequest":"Raw request","workCenter.rawResponse":"Raw response","workCenter.actionInputPlaceholder":"Add context, answer a question, or redirect this Action","workCenter.actionInputResumeHint":"Your input resumes this Action with the additional context.","workCenter.actionInputRetryHint":"Add instructions or files, then rerun this Action with the new context.","workCenter.actionInputContinueHint":"New input joins this Action and is applied at the next safe execution loop.","workCenter.actionFailedTitle":"Why this Action failed","workCenter.failedAt":"Failed at","workCenter.actionFailureRecovery":"Add corrected instructions or files below to rerun this Action. Request details contain the exact model and loop trace.","workCenter.sendInput":"Send to Action","workCenter.sendingInput":"Sending\u2026","workCenter.retryAction":"Retry Action","workCenter.sendAndRetryAction":"Send and retry Action","workCenter.workItemMessages":"Work Item messages","workCenter.workItemMessageScope":"Applies to every unfinished Action at its next safe boundary.","workCenter.actionMessageScopeTitle":"Message this Action","workCenter.actionMessageScope":"Only this Action receives the message.","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":"Open the current Action and respond in the input below.","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.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 reusable Action prompts, model, 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":"This model and effort policy applies to triage and every AI-generated Action.","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 Nr(){return typeof navigator>"u"||!navigator?"":navigator.userAgent||""}function ms(){let e=Nr();return/Android|iPhone|iPad|iPod|Windows Phone|IEMobile|BlackBerry|Opera Mini/i.test(e)}function Un(){return/MicroMessenger/i.test(Nr())}function zn(){return/AlipayClient/i.test(Nr())}var Br=O(()=>{});var Lc,$c=O(()=>{ct();bt();Br();Lc={name:"LoginPage",template:`
|
|
12
|
+
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","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","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.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...","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.imageUnavailable":"Image unavailable","message.attachFiles":"{count} file(s)","message.fileCount":"{count} file(s)","input.upload":"Upload file","input.placeholder":"Type a message...","input.send":"Send","input.stopExecution":"Stop execution","chatInput.upload":"Upload file","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.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.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.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.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.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":"Cancel work item","workCenter.cancelWorkItemHint":"Stop this Work Item and all unfinished Actions. This cannot be undone.","workCenter.cancelConfirm":"Cancel this work item and stop its unfinished Actions?","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.actionCount":"{count} Actions","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.generation":"Generation","workCenter.currentExecution":"Current execution","workCenter.previousExecution":"Previous execution","workCenter.attempt":"Attempt","workCenter.loops":"loops","workCenter.tools":"tools","workCenter.noActionMessages":"No execution messages yet.","workCenter.actionDetails":"Action details","workCenter.selectAction":"Select an Action to inspect its execution","workCenter.backToWorkItems":"Work items","workCenter.backToActions":"Actions","workCenter.you":"You","workCenter.aiResponse":"AI response","workCenter.requestDetails":"Request details","workCenter.noRequestDetails":"No request details are available for this Action yet.","workCenter.loadingRequests":"Loading requests\u2026","workCenter.loadingRequestDetail":"Loading request detail\u2026","workCenter.requestDetailUnavailable":"Request detail is unavailable. Try again.","workCenter.noRequestLoops":"This request has no retained loop details.","workCenter.loadEarlierMessages":"Load earlier messages","workCenter.loadingEarlierMessages":"Loading earlier messages\u2026","workCenter.unknownModel":"Unknown model","workCenter.loop":"Loop","workCenter.systemPrompt":"System prompt","workCenter.requestMessages":"Request messages","workCenter.toolCalls":"Tool calls","workCenter.rawRequest":"Raw request","workCenter.rawResponse":"Raw response","workCenter.actionInputPlaceholder":"Add context, answer a question, or redirect this Action","workCenter.actionInputResumeHint":"Your input resumes this Action with the additional context.","workCenter.actionInputRetryHint":"Add instructions or files, then rerun this Action with the new context.","workCenter.actionInputContinueHint":"New input joins this Action and is applied at the next safe execution loop.","workCenter.actionFailedTitle":"Why this Action failed","workCenter.failedAt":"Failed at","workCenter.actionFailureRecovery":"Add corrected instructions or files below to rerun this Action. Request details contain the exact model and loop trace.","workCenter.sendInput":"Send to Action","workCenter.sendingInput":"Sending\u2026","workCenter.retryAction":"Retry Action","workCenter.sendAndRetryAction":"Send and retry Action","workCenter.workItemMessages":"Work Item messages","workCenter.workItemMessageScope":"Applies to every unfinished Action at its next safe boundary.","workCenter.actionMessageScopeTitle":"Message this Action","workCenter.actionMessageScope":"Only this Action receives the message.","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":"Open the current Action and respond in the input below.","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.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 reusable Action prompts, model, 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":"This model and effort policy applies to triage and every AI-generated Action.","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 Nr(){return typeof navigator>"u"||!navigator?"":navigator.userAgent||""}function ms(){let e=Nr();return/Android|iPhone|iPad|iPod|Windows Phone|IEMobile|BlackBerry|Opera Mini/i.test(e)}function Un(){return/MicroMessenger/i.test(Nr())}function zn(){return/AlipayClient/i.test(Nr())}var Br=O(()=>{});var Lc,$c=O(()=>{ct();bt();Br();Lc={name:"LoginPage",template:`
|
|
13
13
|
<div class="login-page">
|
|
14
14
|
<button class="login-lang-toggle" @click="toggleLang">
|
|
15
15
|
{{ currentLocale === 'zh-CN' ? 'EN' : '\u4E2D\u6587' }}
|
|
@@ -301,7 +301,7 @@ The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is al
|
|
|
301
301
|
</template>
|
|
302
302
|
</div>
|
|
303
303
|
</div>
|
|
304
|
-
`,setup(){let e=Ae(),t=Vue.inject("t"),s=Vue.inject("locale"),n=Vue.ref(""),i=Vue.ref(""),r=Vue.ref(""),o=Vue.ref(""),a=Vue.ref(""),l=Vue.ref(null),c=Vue.ref(null),d=Vue.ref(null),u=Vue.ref(null),p=Vue.ref(null),f=Vue.ref(null),g=Vue.ref(""),
|
|
304
|
+
`,setup(){let e=Ae(),t=Vue.inject("t"),s=Vue.inject("locale"),n=Vue.ref(""),i=Vue.ref(""),r=Vue.ref(""),o=Vue.ref(""),a=Vue.ref(""),l=Vue.ref(null),c=Vue.ref(null),d=Vue.ref(null),u=Vue.ref(null),p=Vue.ref(null),f=Vue.ref(null),g=Vue.ref(""),b=Vue.ref(localStorage.getItem("loginMode")==="credentials"?"credentials":"oauth");Vue.watch(b,te=>localStorage.setItem("loginMode",te));let h=Vue.ref(""),A=Vue.ref(""),x=Vue.ref(""),k=Vue.ref(""),y=Vue.ref(""),m=Vue.ref(!1),w=Vue.ref(""),E=Vue.ref(""),R=Vue.ref(""),q=Vue.ref(""),$=Vue.ref(""),P=Vue.ref(""),D=Vue.ref(!1),M=Vue.ref(!1),C=()=>{a.value="",e.error=null,w.value="email",E.value="",q.value="",$.value="",P.value="",R.value="",M.value=!1},T=()=>{w.value="",R.value="",M.value=!1},N=async()=>{if(a.value="",!E.value||!/.+@.+\..+/.test(E.value)){a.value=t("login.forgot.emailInvalid");return}D.value=!0;try{let te=await e.requestPasswordReset(E.value.trim());if(!te)return;R.value=te,w.value="verify"}finally{D.value=!1}},H=async()=>{if(a.value="",!q.value){a.value=t("login.error.enterVerifyCode");return}if(!$.value||$.value.length<6){a.value=t("login.error.passwordMinLen");return}if($.value!==P.value){a.value=t("login.error.passwordMismatch");return}D.value=!0;try{await e.verifyPasswordReset(R.value,q.value,$.value)&&(M.value=!0,setTimeout(()=>{T(),b.value="credentials"},1500))}finally{D.value=!1}},U={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>'},ie=Vue.computed(()=>["alipay","microsoft","github","google","wechat"].filter(Q=>Q==="microsoft"?e.aadEnabled:!!e.ssoProviders[Q]).map(Q=>({key:Q,label:t(`login.${Q}`),icon:U[Q]}))),Y=()=>{c.value&&c.value.focus()},G=()=>{b.value="credentials",Vue.nextTick(()=>{l.value&&l.value.focus()})},ee=()=>{let te=e.qrPanel;if(!te||!te.authorizeUrl)return;let Q=`alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent(te.authorizeUrl)}`;window.location.href=Q},re=te=>{if(a.value="",te==="microsoft"){e.loginWithMicrosoft();return}if(te==="alipay"){zn()?e.loginWithSso(te):ms()?e.loginWithAlipayMobile():e.startSsoQr(te).then(Q=>{Q&&v()});return}if(te==="wechat"){if(ms()||Un()){a.value=t("login.wechat.mobileUnsupported");return}e.startSsoQr(te).then(Q=>{Q&&v()});return}e.loginWithSso(te)},ge=async()=>{if(!n.value){a.value=t("login.error.enterUsername");return}if(!i.value){a.value=t("login.error.enterPassword");return}a.value="",await e.login(n.value,i.value),Vue.nextTick(()=>{(e.loginStep==="totp"||e.loginStep==="totp-setup")&&u.value?u.value.focus():e.loginStep==="verification"&&d.value&&d.value.focus()})},v=()=>{if(e.qrPanel&&typeof qrcode=="function")try{let te=qrcode(0,"M");te.addData(e.qrPanel.authorizeUrl,"Byte"),te.make(),g.value=te.createDataURL(6,4)}catch{}},_=Vue.computed(()=>{let te=e.qrPanel?.provider;return t(te==="alipay"?"login.qr.titleAlipay":te==="wechat"?"login.qr.titleWechat":"login.qr.title")});Vue.watch(()=>e.qrPanel?.authorizeUrl,te=>{te?v():g.value=""});let X=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()}))},ne=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()}))},me=async()=>{if(a.value="",m.value=!1,!A.value||A.value.length<2){a.value=t("login.error.usernameMinLen");return}if(!x.value||x.value.length<6){a.value=t("login.error.passwordMinLen");return}if(x.value!==k.value){a.value=t("login.error.passwordMismatch");return}await e.register(A.value,x.value,y.value||void 0,h.value)&&(m.value=!0,n.value=A.value,h.value="",A.value="",x.value="",k.value="",y.value="",setTimeout(()=>e.backToCredentials(),1500))},Se=async()=>{if(!r.value){a.value=t("login.error.enterVerifyCode");return}a.value="",await e.verifyCode(r.value)};return Vue.onMounted(async()=>{await e.checkAuthMode(),ie.value.length===0&&b.value==="oauth"&&(b.value="credentials"),e.loginStep==="credentials"&&b.value==="credentials"&&l.value&&l.value.focus()}),Vue.watch(()=>e.loginStep,te=>{Vue.nextTick(()=>{te==="credentials"&&b.value==="credentials"&&l.value?l.value.focus():(te==="totp"||te==="totp-setup")&&u.value?u.value.focus():te==="verification"&&d.value?d.value.focus():te==="register"&&p.value&&p.value.focus()})}),{authStore:e,currentLocale:s,toggleLang:()=>{Os(s.value==="zh-CN"?"en":"zh-CN")},loginMode:b,switchToCredentials:G,enabledProviders:ie,handleProviderClick:re,relaunchAlipayMobile:ee,qrCanvas:f,qrDataUrl:g,qrPanelTitle:_,username:n,password:i,verificationCode:r,totpCode:o,localError:a,usernameInput:l,passwordInput:c,codeInput:d,totpInput:u,regCodeInput:p,regInvitationCode:h,regUsername:A,regPassword:x,regPasswordConfirm:k,regEmail:y,registerSuccess:m,focusPassword:Y,login:ge,verify:Se,verifyTotp:X,setupTotp:ne,doRegister:me,forgotStep:w,forgotEmail:E,forgotResetToken:R,forgotCode:q,forgotNewPassword:$,forgotConfirm:P,forgotLoading:D,forgotSuccess:M,enterForgotMode:C,exitForgotMode:T,submitForgotEmail:N,submitForgotReset:H}}}});var jn,qr=O(()=>{jn={name:"ChatHeader",emits:["toggle-sidebar","close-pane"],props:{conversationId:{type:String,default:null},paneId:{type:String,default:null},showClosePane:{type:Boolean,default:!1}},template:`
|
|
305
305
|
<header class="chat-header">
|
|
306
306
|
<!-- Mobile sidebar toggle \u2014 hidden on desktop and in split mode -->
|
|
307
307
|
<button class="header-sidebar-toggle" v-if="!store.isSplitMode"
|
|
@@ -403,10 +403,10 @@ The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is al
|
|
|
403
403
|
</button>
|
|
404
404
|
</div>
|
|
405
405
|
</header>
|
|
406
|
-
`,setup(e){let t=Pinia.useChatStore(),s=Vue.inject("t"),n=Vue.computed(()=>e.conversationId||t.currentConversation),i=Vue.computed(()=>n.value&&t.conversations.find(
|
|
406
|
+
`,setup(e){let t=Pinia.useChatStore(),s=Vue.inject("t"),n=Vue.computed(()=>e.conversationId||t.currentConversation),i=Vue.computed(()=>n.value&&t.conversations.find(v=>v.id===n.value)||null),r=Vue.computed(()=>i.value?.capabilities||null),o=Vue.computed(()=>n.value?(i.value?.provider||"claude-code")==="claude-code":!0),a=(v,_=!0)=>{let X=r.value;return X?!!X[v]:o.value?_:!1},l=Vue.computed(()=>a("compact")),c=Vue.computed(()=>a("clear")),d=Vue.computed(()=>a("expert")),u=Vue.computed(()=>a("mcp")),p=Vue.computed(()=>{if(!n.value)return"Yeaft";let v=t.getConversationTitle(n.value);if(v)return v;let X=t.conversations.find(ne=>ne.id===n.value)?.workDir||t.currentWorkDir;if(X){let ne=X.split(/[/\\]/);return ne[ne.length-1]||ne[ne.length-2]||X}return s("chatHeader.newConv")}),f=Vue.computed(()=>{if(!n.value)return"";let _=t.conversations.find(ne=>ne.id===n.value)?.agentId;return _&&t.agents.find(ne=>ne.id===_)?.name||""}),g=Vue.computed(()=>t.clearStatus?.conversationId===n.value?!0:t.compactStatus?t.compactStatus.conversationId===n.value:!1),b=Vue.computed(()=>t.clearStatus?.conversationId===n.value?t.clearStatus.status==="clearing"?"compacting":"completed":t.compactStatus?t.compactStatus.status==="compacting"?"compacting":"completed":""),h=Vue.computed(()=>t.clearStatus?.conversationId===n.value?t.clearStatus.status==="clearing":t.compactStatus?.status==="compacting"),A=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"):""),x=Vue.computed(()=>n.value&&(t.conversations.find(_=>_.id===n.value)?.workDir||t.currentWorkDir)||""),k=Vue.computed(()=>!t.contextUsage||t.contextUsage.conversationId!==n.value?null:t.contextUsage),y=Vue.computed(()=>{let v=k.value?.percentage||0;return v>=80?"context-danger":v>=50?"context-warn":"context-ok"}),m=Vue.computed(()=>{if(!k.value)return"";let v=(k.value.inputTokens/1e3).toFixed(0),_=(k.value.maxTokens/1e3).toFixed(0);return`Context: ${v}k / ${_}k`}),w=Vue.computed(()=>t.isRefreshingSession(n.value)),E=Vue.computed(()=>t.compactStatus?.status==="compacting"&&t.compactStatus?.conversationId===n.value),R=Vue.computed(()=>t.clearStatus?.status==="clearing"&&t.clearStatus?.conversationId===n.value),q=Vue.computed(()=>n.value?!t.isRefreshingSession(n.value):!1),$=()=>{t.isRefreshingSession(n.value)||!n.value||(t.setRefreshingSession(n.value,!0),t.startRefreshTimeout(n.value),t.processingConversations[n.value]||(t.messagesMap[n.value]=[]),t.sendWsMessage({type:"sync_messages",conversationId:n.value,turns:5}))},P=()=>{E.value||t.sendMessage("/compact")},D=()=>{window.location.reload()},M=()=>{R.value||confirm(s("chatHeader.confirmClear"))&&(t.clearStatus={conversationId:n.value,status:"clearing"},t.sendMessage("/clear"))},C=Vue.computed(()=>t.getPaneRightPanel(e.paneId)),T=Vue.ref(null),N=Vue.computed(()=>{if(!t.mcpPanelOpen||!T.value)return null;let v=T.value.getBoundingClientRect();return{top:`${v.bottom+6}px`,right:`${window.innerWidth-v.right}px`}}),H=Vue.computed(()=>t.currentMcpServers.filter(v=>v.enabled).length),U=Vue.computed(()=>!!t.conversations.find(_=>_.id===n.value)?.needRestart),ie=()=>{t.mcpPanelOpen=!t.mcpPanelOpen},Y=()=>{t.togglePaneRightPanel("experts",e.paneId)},G=()=>{t.togglePaneRightPanel("subagents",e.paneId)},ee=Vue.computed(()=>t.runningSubagentCount),re=(v,_)=>{t.toggleConversationMcp(v,_)},ge=v=>{t.mcpPanelOpen&&!v.target.closest(".mcp-dropdown")&&!v.target.closest(".mcp-config-wrapper")&&(t.mcpPanelOpen=!1)};return Vue.onMounted(()=>{document.addEventListener("click",ge)}),Vue.onUnmounted(()=>{document.removeEventListener("click",ge)}),{store:t,effectiveConvId:n,effectiveRightPanel:C,isClaudeCode:o,canCompact:l,canClear:c,canExpert:d,canMcp:u,headerTitle:p,showStatusBanner:g,statusBannerClass:b,statusBannerSpinner:h,statusBannerMessage:A,contextUsage:k,contextColorClass:y,contextLabel:m,isRefreshing:w,isCompacting:E,isClearing:R,canRefresh:q,refreshSession:$,reloadPage:D,compactContext:P,clearMessages:M,mcpBtnRef:T,mcpDropdownStyle:N,mcpEnabledCount:H,currentConvNeedRestart:U,toggleMcpPanel:ie,toggleMcpServer:re,toggleExpertPanel:Y,toggleSubAgentPanel:G,runningSubagentCount:ee}}}});function Xs(e=globalThis.location){let t=e?.protocol==="https:"?"wss:":"ws:",s=e?.host||"localhost";return`${t}//${s}`}function Kn(){return"npm install -g @yeaft/webchat-agent"}function Gn(){return"yeaft-agent llm use github-copilot --model gpt-5.5"}function Wr(e=null){let t=e&&(e.username||e.displayName)||"agent",s=2166136261;for(let r=0;r<t.length;r++)s^=t.charCodeAt(r),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 Yn({profile:e=null,agentSecret:t="",serverWsUrl:s=Xs()}={}){if(!t)return"";let n=Wr(e);return`yeaft-agent install --server ${s} --secret ${t} --name ${n}`}var Ur=O(()=>{});function hs(e,{alt:t="Preview",closeLabel:s="Close",trigger:n=null}={}){if(!e)return;let i=document.createElement("div");i.className="image-preview-overlay",i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-label",t);let r=document.createElement("img");r.className="image-preview-img",r.src=e,r.alt=t;let o=document.createElement("button");o.type="button",o.className="image-preview-close",o.setAttribute("aria-label",s),o.textContent="\xD7",i.append(r,o),document.body.appendChild(i),i.offsetHeight,i.classList.add("visible"),o.focus();let a=!1,l=()=>i.remove(),c=()=>{a||(a=!0,i.classList.remove("visible"),i.addEventListener("transitionend",l,{once:!0}),setTimeout(l,250),document.removeEventListener("keydown",d),n?.isConnected&&typeof n.focus=="function"&&n.focus())},d=u=>{u.key==="Escape"&&c(),u.key==="Tab"&&(u.preventDefault(),o.focus())};o.addEventListener("click",c),i.addEventListener("click",u=>{u.target===i&&c()}),document.addEventListener("keydown",d)}var Qn=O(()=>{});function Eg(e){let t=[];for(let s of e)s==="\b"?t.pop():t.push(s);return t.join("")}function Rg(e){let t=e.split("\r"),s=t[t.length-1]||"";return Eg(s)}function Nc(e){return e.replace(/\r\n/g,`
|
|
407
407
|
`).split(`
|
|
408
|
-
`).map(t=>
|
|
409
|
-
`)}function Bc(e){return e.replace(
|
|
408
|
+
`).map(t=>Rg(t)).join(`
|
|
409
|
+
`)}function Bc(e){return e.replace(Dg,"").replace(_g,"")}function Lg(e){return e?e.split(";").filter(t=>t!=="").map(t=>Number(t)).filter(Number.isFinite):[0]}function Vc(e,t){let s=t==="bg"&&e>=30&&e<=37||t==="bg"&&e>=90&&e<=97?e+10:e;return t==="bg"?Gr.get(s):Kr.get(s)}function Fc(e,t,s){let n=Yr[0],i=1/0;for(let r of Yr){let o=(r.r-e)**2+(r.g-t)**2+(r.b-s)**2;o<i&&(n=r,i=o)}return n.code}function $g(e){if(e<0||e>255)return null;if(e<16){let s=Yr[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:jr[Math.floor(t/36)],g:jr[Math.floor(t%36/6)],b:jr[t%6]}}function Oc(e,t,s,n){let i=s[n+1];if(i===5){let r=s[n+2];if(Number.isFinite(r)){let o=$g(r);o&&(e[t]=Vc(Fc(o.r,o.g,o.b),t)||"")}return n+3}if(i===2){let r=s[n+2],o=s[n+3],a=s[n+4];return Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(a)&&(e[t]=Vc(Fc(r,o,a),t)||""),n+5}return n+2}function Vg(e,t){let s={...e},n=t.length?t:[0];for(let i=0;i<n.length;){let r=n[i];if(r===0)s.fg="",s.bg="",s.bold=!1,s.dim=!1,s.italic=!1,s.underline=!1;else if(r===1)s.bold=!0,s.dim=!1;else if(r===2)s.dim=!0,s.bold=!1;else if(r===3)s.italic=!0;else if(r===4)s.underline=!0;else if(r===22)s.bold=!1,s.dim=!1;else if(r===23)s.italic=!1;else if(r===24)s.underline=!1;else if(r===39)s.fg="";else if(r===49)s.bg="";else if(Kr.has(r))s.fg=Kr.get(r);else if(Gr.has(r))s.bg=Gr.get(r);else if(r===38){i=Oc(s,"fg",n,i);continue}else if(r===48){i=Oc(s,"bg",n,i);continue}i+=1}return s}function Fg(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 Hc(e,t,s){let n=Bc(t);if(!n)return;let i=Fg(s),r=e[e.length-1];r&&r.className===i?r.text+=n:e.push({text:n,className:i})}function St(e){if(e==null)return"";let t=typeof e=="string"?e:String(e);return t?Bc(Nc(t)):""}function qc(e){if(e==null)return[];let t=typeof e=="string"?e:String(e);if(!t)return[];let s=Nc(t),n=[],i={fg:"",bg:"",bold:!1,dim:!1,italic:!1,underline:!1},r=0;zr.lastIndex=0;for(let o=zr.exec(s);o;o=zr.exec(s))Hc(n,s.slice(r,o.index),i),i=Vg(i,Lg(o[1])),r=o.index+o[0].length;return Hc(n,s.slice(r),i),n}var Dg,zr,_g,Kr,Gr,Yr,jr,Zs=O(()=>{Dg=/[\u001b\u009b](?:[\[\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><~]|\][^\u0007]*(?:\u0007|\u001b\\)|[PX^_][\s\S]*?\u001b\\)/g,zr=/(?:\u001b\[|\u009b)([0-9;]*)m/g,_g=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Kr=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"]]),Gr=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"]]),Yr=[{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}],jr=[0,95,135,175,215,255]});var vs,Xn=O(()=>{Qn();js();Zs();vs={name:"MessageItem",props:{message:{type:Object,required:!0}},template:`
|
|
410
410
|
<div :class="messageClass">
|
|
411
411
|
<!-- User message -->
|
|
412
412
|
<template v-if="message.type === 'user'">
|
|
@@ -465,7 +465,7 @@ The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is al
|
|
|
465
465
|
{{ displayContent }}
|
|
466
466
|
</template>
|
|
467
467
|
</div>
|
|
468
|
-
`,setup(e){let t=Pinia.useChatStore(),s=Vue.ref(!1),n=Vue.inject("t"),i=Vue.computed(()=>["message",e.message.type]),r=()=>{let g=e.message;return typeof g.timestamp=="number"&&g.timestamp>0?g.timestamp:typeof g.createdAt=="number"&&g.createdAt>0?g.createdAt:null},o=Vue.computed(()=>{let g=r();if(!g)return"";try{return new Date(g).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return""}}),a=Vue.computed(()=>{let g=r();if(!g)return"";try{return new Date(g).toLocaleString()}catch{return""}}),l=Vue.computed(()=>St(e.message.content||""));return{messageClass:i,messageTime:o,messageTimeFull:a,displayContent:l,showAttachments:s,toggleAttachments:()=>{s.value=!s.value},previewAttachment:(g,
|
|
468
|
+
`,setup(e){let t=Pinia.useChatStore(),s=Vue.ref(!1),n=Vue.inject("t"),i=Vue.computed(()=>["message",e.message.type]),r=()=>{let g=e.message;return typeof g.timestamp=="number"&&g.timestamp>0?g.timestamp:typeof g.createdAt=="number"&&g.createdAt>0?g.createdAt:null},o=Vue.computed(()=>{let g=r();if(!g)return"";try{return new Date(g).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return""}}),a=Vue.computed(()=>{let g=r();if(!g)return"";try{return new Date(g).toLocaleString()}catch{return""}}),l=Vue.computed(()=>St(e.message.content||""));return{messageClass:i,messageTime:o,messageTimeFull:a,displayContent:l,showAttachments:s,toggleAttachments:()=>{s.value=!s.value},previewAttachment:(g,b)=>{g?.preview&&hs(g.preview,{alt:g.name||n("message.imagePreview"),closeLabel:n("common.close"),trigger:b})},t:n,formatExpertLabel:g=>qt(g,t.customExpertRoles),getAttachmentsText:g=>{if(!g||g.length===0)return"";let b=g.filter(x=>x.isImage).length,h=g.length-b,A=[];return b>0&&A.push(n("message.imageCount",{count:b})),h>0&&A.push(n("message.fileCount",{count:h})),A.join(n("common.comma"))},getFileIcon:g=>g?g.startsWith("image/")?"\u{1F5BC}\uFE0F":g.startsWith("video/")?"\u{1F3AC}":g.startsWith("audio/")?"\u{1F3B5}":g.includes("pdf")?"\u{1F4D5}":g.includes("word")||g.includes("document")?"\u{1F4DD}":g.includes("sheet")||g.includes("excel")?"\u{1F4CA}":g.includes("presentation")||g.includes("powerpoint")?"\u{1F4FD}\uFE0F":g.includes("zip")||g.includes("compressed")||g.includes("archive")?"\u{1F4E6}":g.includes("text")||g.includes("json")||g.includes("xml")?"\u{1F4C3}":"\u{1F4C4}":"\u{1F4C4}"}}}});function Qr(e){let t=e&&typeof e.to=="string"&&e.to.trim()?e.to.trim():"?",s=t==="all"?"@all":`@${t}`,n=typeof e?.text=="string"?e.text.trim():"",i=typeof e?.reason=="string"?e.reason.trim():"";return{to:t,target:s,text:n,reason:i}}function Wc(e,t=s=>s){let s=Qr(e);return s.text?`Route ${s.target}: ${t(s.text,70)}`:`Route ${s.target}`}var Xr=O(()=>{});var Zn,Zr=O(()=>{Zs();Zn={name:"TerminalOutput",props:{content:{default:""}},template:`
|
|
469
469
|
<pre class="terminal-output"><code><template v-for="(token, index) in tokens" :key="index"><span v-if="token.className" :class="token.className">{{ token.text }}</span><template v-else>{{ token.text }}</template></template></code></pre>
|
|
470
470
|
`,setup(e){return{tokens:Vue.computed(()=>qc(e.content))}}}});var Jn,Jr=O(()=>{Xr();Zs();Zr();Jn={name:"ToolLine",components:{TerminalOutput:Zn},props:{toolName:{type:String,required:!0},toolInput:{type:Object,default:null},toolResult:{default:null},hasResult:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},startTime:{type:Number,default:0},expanded:{type:Boolean,default:null}},emits:["update:expanded"],template:`
|
|
471
471
|
<div>
|
|
@@ -504,9 +504,9 @@ The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is al
|
|
|
504
504
|
</div>
|
|
505
505
|
`,setup(e,{emit:t}){let s=Vue.ref(e.toolName==="Edit"),n=Vue.computed(()=>e.expanded===null?s.value:!!e.expanded),i=m=>{s.value=!!m,t("update:expanded",!!m)},r=Vue.computed(()=>{if(!e.startTime)return"";let m=new Date(e.startTime),w=m.getHours().toString().padStart(2,"0"),E=m.getMinutes().toString().padStart(2,"0"),R=m.getSeconds().toString().padStart(2,"0");return`${w}:${E}:${R}`}),o=Vue.computed(()=>e.toolName==="Edit"),a=Vue.computed(()=>{let m=e.toolInput;return m&&m.old_string!==void 0&&m.new_string!==void 0}),l=Vue.computed(()=>{let m=e.toolInput;return m?e.toolName==="Edit"?a.value:e.toolName==="Bash"?!!(m.command?.length>60||e.hasResult):e.toolName==="Read"?!!m.file_path:e.toolName==="Write"?!!m.content:Object.keys(m).length>0:!1}),c=m=>{if(!m)return"";if(typeof m=="string")return m;if(Array.isArray(m))return m.map(w=>typeof w=="string"?w:w?.type==="text"?w.text:"").filter(Boolean).join(`
|
|
506
506
|
`);if(m?.type==="text"&&m?.text)return m.text;if(m?.content){if(typeof m.content=="string")return m.content;if(Array.isArray(m.content))return m.content.map(w=>typeof w=="string"?w:w?.type==="text"?w.text:"").filter(Boolean).join(`
|
|
507
|
-
`)}return""},d=Vue.computed(()=>e.toolName!=="Bash"?"":c(e.toolResult)),u=Vue.computed(()=>e.toolName!=="__SubagentResult"?"":St(e.toolInput?.result||e.toolInput?.summary||
|
|
507
|
+
`)}return""},d=Vue.computed(()=>e.toolName!=="Bash"?"":c(e.toolResult)),u=Vue.computed(()=>e.toolName!=="__SubagentResult"?"":St(e.toolInput?.result||e.toolInput?.summary||y(e.toolInput))),p=Vue.computed(()=>e.toolName!=="__CompactSummary"?"":St(e.toolInput?.summary||y(e.toolInput))),f=()=>{l.value&&i(!n.value)},g=(m,w=80)=>{if(!m||m.length<=w)return m||"";let E=Math.ceil(w*.6),R=w-E-3;return m.slice(0,E)+"..."+m.slice(-R)},b=m=>({Read:"\u{1F4D6}",Edit:"\u270F\uFE0F",Write:"\u{1F4DD}",Bash:"\u26A1",Glob:"\u{1F50D}",Grep:"\u{1F50E}",Task:"\u{1F4CB}",WebFetch:"\u{1F310}",WebSearch:"\u{1F50D}",TodoWrite:"\u2705",RouteForward:"@",__SubagentResult:"\u{1F916}",__CompactSummary:"\u{1F4DA}"})[m]||"\u2699\uFE0F",h=m=>St(m).replace(/\s+/g," ").trim(),A=(m,w)=>{if(!w)return m;if(m==="Read"&&w.file_path){let E=`Read ${w.file_path}`;if(w.offset||w.limit){let R=(w.offset||0)+1,q=w.limit?R+w.limit-1:"\u221E";E+=`:${R}-${q}`}return E}if(m==="Edit"&&w.file_path)return`Edit ${w.file_path}`;if(m==="Write"&&w.file_path)return`Write ${w.file_path}`;if(m==="Bash"&&w.command){let E=w.command;return g(E,80)}if(m==="Glob"&&w.pattern)return`Glob ${w.pattern}`+(w.path?` in ${w.path}`:"");if(m==="Grep"&&w.pattern){let E=`Grep "${w.pattern}"`;return w.path&&(E+=` in ${w.path}`),w.glob&&(E+=` (${w.glob})`),E}if(m==="Task"){let E=w.subagent_type||"agent",R=w.description||g(w.prompt||"",40);return`Task [${E}]: ${R}`}if(m==="WebFetch"&&w.url)try{let E=new URL(w.url);return`Fetch ${E.hostname}${E.pathname.length>20?g(E.pathname,20):E.pathname}`}catch{return`Fetch ${w.url.slice(0,50)}`}if(m==="WebSearch"&&w.query)return`Search "${w.query}"`;if(m==="TodoWrite"&&w.todos)return`Todo: ${w.todos.filter(R=>R.status==="completed").length}/${w.todos.length} done`;if(m==="RouteForward")return Wc(w,g);if(m==="__SubagentResult"){let E=h(w.summary||w.status||"completed");return`Sub-agent: ${g(E,80)}`}return m==="__CompactSummary"?`Context summarized (${St(w.summary||"").length} chars)`:m},x=m=>{let w=document.createElement("div");return w.textContent=m,w.innerHTML},k=m=>{if(!m||m.old_string===void 0||m.new_string===void 0)return"";let w='<div class="diff-compact">';return m.old_string.split(`
|
|
508
508
|
`).forEach(E=>{w+=`<div class="diff-line del">- ${x(E)}</div>`}),m.new_string.split(`
|
|
509
|
-
`).forEach(E=>{w+=`<div class="diff-line add">+ ${x(E)}</div>`}),w+="</div>",w},
|
|
509
|
+
`).forEach(E=>{w+=`<div class="diff-line add">+ ${x(E)}</div>`}),w+="</div>",w},y=m=>{try{return JSON.stringify(m,null,2)}catch{return String(m)}};return{isExpanded:n,isEditTool:o,hasDiff:a,hasExpandableContent:l,bashOutput:d,syntheticResultOutput:u,compactSummaryOutput:p,formattedTime:r,toggle:f,getToolIcon:b,getToolOneLine:A,renderDiff:k,formatInput:y}}}});var Uc,zc=O(()=>{Uc={name:"AskCard",props:{askMsg:{type:Object,required:!0},compact:{type:Boolean,default:!1}},emits:["submit"],template:`
|
|
510
510
|
<div class="ask-card-wrapper">
|
|
511
511
|
<!-- Collapsed summary after submission; history later confirms the answer. -->
|
|
512
512
|
<div v-if="isAnswered" class="ask-summary">
|
|
@@ -589,7 +589,7 @@ The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is al
|
|
|
589
589
|
</div>
|
|
590
590
|
</div>
|
|
591
591
|
</div>
|
|
592
|
-
`,setup(e,{emit:t}){let s=Vue.reactive({}),n=Vue.reactive({}),i=Vue.computed(()=>{let f=e.askMsg;return f&&(!!f.askAnswered||!!f.selectedAnswers||!!f.askPending)}),r=Vue.computed(()=>{let f=e.askMsg;return f?!!f.askExpired||!f.askRequestId&&!f.askAnswered&&!f.selectedAnswers&&!!f.isHistory:!1}),o=Vue.computed(()=>{let f=e.askMsg;return f?.askQuestions||f?.toolInput?.questions||[]}),a=(f,g)=>{let
|
|
592
|
+
`,setup(e,{emit:t}){let s=Vue.reactive({}),n=Vue.reactive({}),i=Vue.computed(()=>{let f=e.askMsg;return f&&(!!f.askAnswered||!!f.selectedAnswers||!!f.askPending)}),r=Vue.computed(()=>{let f=e.askMsg;return f?!!f.askExpired||!f.askRequestId&&!f.askAnswered&&!f.selectedAnswers&&!!f.isHistory:!1}),o=Vue.computed(()=>{let f=e.askMsg;return f?.askQuestions||f?.toolInput?.questions||[]}),a=(f,g)=>{let b=s[f];return Array.isArray(b)?b.includes(g):b===g},l=(f,g)=>{if(!i.value)if(n[f.question]="",f.multiSelect){let b=s[f.question]||[],h=Array.isArray(b)?[...b]:[],A=h.indexOf(g.label);A>=0?h.splice(A,1):h.push(g.label),s[f.question]=h}else s[f.question]=g.label},c=(f,g)=>{n[f]=g,g&&delete s[f]},d=Vue.computed(()=>{let f=o.value;return!f||f.length===0?!1:f.some(g=>{let b=s[g.question];return n[g.question]?!0:Array.isArray(b)?b.length>0:!!b})}),u=()=>{if(i.value||e.askMsg.askPending||!d.value)return;let f=o.value,g={};for(let h of f){let A=n[h.question];if(A)g[h.question]=A;else{let x=s[h.question];Array.isArray(x)&&x.length>0?g[h.question]=x.join(", "):x&&(g[h.question]=x)}}let b=e.askMsg.askRequestId;b&&t("submit",b,g)},p=Vue.computed(()=>{let f=e.askMsg?.selectedAnswers||e.askMsg?.pendingAnswers;return f?Object.values(f).filter(b=>b&&b!=="-").join(", "):""});return{isAnswered:i,isExpired:r,questions:o,isOptionSelected:a,selectOption:l,setCustomAnswer:c,customAnswers:n,hasAnySelection:d,submitAnswers:u,summaryText:p}}}});var jc,Kc=O(()=>{gs();jc={name:"VpBadge",props:{vpId:{type:String,required:!0},size:{type:Number,default:20},showSubtitle:{type:Boolean,default:!1},status:{type:String,default:null},typing:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},template:`
|
|
593
593
|
<span class="vp-badge" :class="{ compact }">
|
|
594
594
|
<span class="vp-badge-text">
|
|
595
595
|
<span class="vp-badge-name" :style="nameStyle">{{ displayName }}</span>
|
|
@@ -626,10 +626,10 @@ The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is al
|
|
|
626
626
|
:title="$t ? $t('yeaft.vp.speaker.stop') : 'Stop'"
|
|
627
627
|
><svg viewBox="0 0 24 24" width="14" height="14"><rect x="6" y="6" width="12" height="12" rx="2" fill="currentColor"/></svg></button>
|
|
628
628
|
</div>
|
|
629
|
-
`,setup(e){let t=zt(),s=Vue.computed(()=>t.isVpTypingInCurrentConv(e.vpId)),n=Vue.computed(()=>{if(!e.timestamp)return"";try{return new Date(e.timestamp).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return""}}),i=Vue.computed(()=>{if(!e.timestamp)return"";try{return new Date(e.timestamp).toLocaleString()}catch{return""}});return{isTyping:s,timestampText:n,timestampFullText:i}}}});function Gc(e,t){let s=t?.status||"pending",n=!!e&&e.isStreaming!==!0,r=s==="in_progress"&&n?"stopped":s;return{...t,rawStatus:s,displayStatus:r,displayText:r==="in_progress"?t?.activeForm||t?.content||"":t?.content||""}}var Yc=O(()=>{});function to(e,t){return`${String(e||"mermaid-diagram").replace(/[^a-z0-9_-]+/gi,"-").replace(/^-+|-+$/g,"")||"mermaid-diagram"}.${t}`}function
|
|
629
|
+
`,setup(e){let t=zt(),s=Vue.computed(()=>t.isVpTypingInCurrentConv(e.vpId)),n=Vue.computed(()=>{if(!e.timestamp)return"";try{return new Date(e.timestamp).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return""}}),i=Vue.computed(()=>{if(!e.timestamp)return"";try{return new Date(e.timestamp).toLocaleString()}catch{return""}});return{isTyping:s,timestampText:n,timestampFullText:i}}}});function Gc(e,t){let s=t?.status||"pending",n=!!e&&e.isStreaming!==!0,r=s==="in_progress"&&n?"stopped":s;return{...t,rawStatus:s,displayStatus:r,displayText:r==="in_progress"?t?.activeForm||t?.content||"":t?.content||""}}var Yc=O(()=>{});function to(e,t){return`${String(e||"mermaid-diagram").replace(/[^a-z0-9_-]+/gi,"-").replace(/^-+|-+$/g,"")||"mermaid-diagram"}.${t}`}function Hg(e){if(typeof document>"u")return String(e||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'");let t=document.createElement("textarea");return t.innerHTML=String(e||""),t.value}function Ng(e,t){return e!=="mermaid"?"":` data-mermaid-source="${encodeURIComponent(Hg(t))}"`}function Bg(e){let t=e?.dataset?.mermaidSource;if(!t)return"";try{return decodeURIComponent(t)}catch{return""}}function Jc(e,t){let s=document.createElement("a");s.href=e,s.download=t,document.body.appendChild(s),s.click(),s.remove()}function ed(e,t){let s=URL.createObjectURL(e);Jc(s,t),setTimeout(()=>URL.revokeObjectURL(s),0)}function qg(e){let t=o=>{let a=Number.parseFloat(String(o||"").replace("px",""));return Number.isFinite(a)&&a>0?a:null},s=t(e.getAttribute("width")),n=t(e.getAttribute("height"));if(s&&n)return{width:s,height:n};let i=e.getAttribute("viewBox");if(i){let o=i.trim().split(/\s+/).map(Number.parseFloat);if(o.length===4&&o.every(a=>Number.isFinite(a))&&o[2]>0&&o[3]>0)return{width:o[2],height:o[3]}}let r=e.getBoundingClientRect?.();return r?.width&&r?.height?{width:r.width,height:r.height}:{width:1200,height:800}}function td(e,t){return typeof getComputedStyle>"u"||typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Wg(e,t,s){e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("width",String(t)),e.setAttribute("height",String(s)),e.getAttribute("viewBox")||e.setAttribute("viewBox",`0 0 ${t} ${s}`)}async function Ug(e,t,s,n){if(!window.htmlToImage)return!1;let i=to("mermaid-diagram",t==="jpg"?"jpg":"png"),r={backgroundColor:td("--bg-main","white"),height:n,pixelRatio:Math.max(1,Math.min(3,window.devicePixelRatio||1)),style:{margin:"0"},width:s},o=t==="jpg"?await window.htmlToImage.toJpeg(e,{...r,quality:.92}):await window.htmlToImage.toPng(e,r);return Jc(o,i),!0}async function Zc(e,t){let s=e.querySelector("svg");if(!s)throw new Error("No Mermaid SVG found");let{width:n,height:i}=qg(s);try{if(await Ug(s,t,n,i))return}catch{}let r=s.cloneNode(!0);Wg(r,n,i);let o=new XMLSerializer().serializeToString(r),a=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a);try{let c=new Image,d=new Promise((h,A)=>{c.onload=h,c.onerror=()=>A(new Error("Failed to load Mermaid SVG for export"))});c.src=l,await d;let u=Math.max(1,Math.min(3,window.devicePixelRatio||1)),p=document.createElement("canvas");p.width=Math.ceil(n*u),p.height=Math.ceil(i*u);let f=p.getContext("2d");if(!f)throw new Error("Canvas is not available");f.scale(u,u),t==="jpg"&&(f.fillStyle=td("--bg-main","white"),f.fillRect(0,0,n,i)),f.drawImage(c,0,0,n,i);let g=t==="jpg"?"image/jpeg":"image/png",b=await new Promise((h,A)=>{p.toBlob(x=>x?h(x):A(new Error("Failed to export Mermaid image")),g,.92)});ed(b,to("mermaid-diagram",t==="jpg"?"jpg":"png"))}finally{URL.revokeObjectURL(l)}}function zg(e){let t=`\`\`\`mermaid
|
|
630
630
|
${String(e||"").trim()}
|
|
631
631
|
\`\`\`
|
|
632
|
-
`;ed(new Blob([t],{type:"text/markdown;charset=utf-8"}),to("mermaid-diagram","md"))}function
|
|
632
|
+
`;ed(new Blob([t],{type:"text/markdown;charset=utf-8"}),to("mermaid-diagram","md"))}function jg(e,t){let s=document.createElement("div");s.className="mermaid-export-controls",s.setAttribute("aria-label",xe("mermaid.export"));let n=[{label:xe("mermaid.exportMd"),action:()=>zg(t)},{label:xe("mermaid.exportPng"),action:()=>Zc(e,"png")},{label:xe("mermaid.exportJpg"),action:()=>Zc(e,"jpg")}];for(let i of n){let r=document.createElement("button");r.type="button",r.className="mermaid-export-btn",r.textContent=i.label,r.title=i.label,r.addEventListener("click",async o=>{o.preventDefault(),o.stopPropagation();try{await i.action()}catch{}}),s.appendChild(r)}return s}function Kg(){Qc||typeof marked>"u"||(marked.setOptions({highlight:(e,t)=>{if(typeof hljs<"u"&&t&&hljs.getLanguage(t))try{return hljs.highlight(e,{language:t}).value}catch{}return e},breaks:!0,gfm:!0}),Qc=!0)}function Gg(e){return e.replace(/<pre><code([^>]*)>([\s\S]*?)<\/code><\/pre>/g,(t,s,n)=>{let i=s.match(/class="language-(\w+)"/),r=i?i[1]:"",o=Ng(r,n);return`<div class="code-block-wrapper">
|
|
633
633
|
<div class="code-block-header">
|
|
634
634
|
<span class="code-lang">${r}</span>
|
|
635
635
|
<button class="code-copy-btn" onclick="window.copyCodeBlock(this)" title="Copy">
|
|
@@ -639,7 +639,7 @@ ${String(e||"").trim()}
|
|
|
639
639
|
</button>
|
|
640
640
|
</div>
|
|
641
641
|
<pre><code${s}${o}>${n}</code></pre>
|
|
642
|
-
</div>`})}function
|
|
642
|
+
</div>`})}function Yg(e){return e.replace(/<table>([\s\S]*?)<\/table>/g,t=>`<div class="table-scroll-wrapper">${t}</div>`)}function Qg(){if(typeof mermaid>"u")return!1;let e=document.documentElement.getAttribute("data-theme")==="dark"?"dark":"default";if(Xc===e)return!0;try{return mermaid.initialize({startOnLoad:!1,theme:e,securityLevel:"strict"}),Xc=e,!0}catch{return!1}}async function Xe(e){if(!e||!Qg())return;let t=e.querySelectorAll("pre code.language-mermaid:not([data-mermaid-error])");for(let s of t){let n=s.closest("pre");if(!n||n.dataset.mermaidRendered==="true")continue;let i=n.closest(".code-block-wrapper"),r=Bg(s)||s.textContent||"";if(r.trim()){n.dataset.mermaidRendered="true";try{let o=`mermaid-${Date.now()}-${Og++}`,{svg:a}=await mermaid.render(o,r),l=document.createElement("div");l.className="mermaid-rendered",l.innerHTML=a,l.dataset.mermaidSource=r,l.appendChild(jg(l,r)),(i||n).replaceWith(l)}catch{n.dataset.mermaidRendered="false",s.dataset.mermaidError="true"}}}}function Xg(e){if(!e||typeof e!="string")return"";let t=s=>{let n=document.createElement("div");return n.textContent=s,n.innerHTML};return e.replace(/```(\w*)\n([\s\S]*?)```/g,(s,n,i)=>{let r=i.trim(),o=n==="mermaid"?` data-mermaid-source="${encodeURIComponent(r)}"`:"";return`<div class="code-block-wrapper"><pre><code class="language-${n}"${o}>${t(r)}</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>")}function Zg(e){if(!e||typeof e!="string")return"";let t=e;return t=t.replace(/---\s*ROUTE\s*---[\s\S]*?---\s*(?:END[_ \-]?ROUTE|ENDROUTE|END)\s*:?\s*---/gi,"").trim(),t=t.replace(/---\s*TASKS\s*---[\s\S]*?---\s*(?:END[_ \-]?TASKS|ENDTASKS|END)\s*:?\s*---/gi,"").trim(),t=t.replace(/---\s*ROUTE\s*---[\s\S]*?(?=\n[ \t]*\n+(?:---(?!\s*ROUTE)|<(?:kanban|recent-routes|task-context)\b)|$)/gi,"").trim(),t=t.replace(/---\s*TASKS\s*---[\s\S]*?(?=\n[ \t]*\n+(?:---(?!\s*TASKS)|<(?:kanban|recent-routes|task-context)\b)|$)/gi,"").trim(),t}function ti(e){if(!e||typeof e!="string"||(e=Zg(e),!e))return"";let t=Js.get(e);if(t!==void 0)return t;Kg();let s;if(typeof marked<"u")try{s=Yg(Gg(marked.parse(e)))}catch{}if(s||(s=Xg(e)),Js.size>=Jg){let n=Js.keys().next().value;Js.delete(n)}return Js.set(e,s),s}var Qc,Xc,Og,Js,Jg,en=O(()=>{bt();Qc=!1,Xc=null,Og=0;Js=new Map,Jg=2e3});var ys,si=O(()=>{Jr();zc();eo();Zs();Xr();Yc();en();Qn();ys={name:"AssistantTurn",components:{ToolLine:Jn,AskCard:Uc,VpSpeakerHeader:ei},props:{turn:{type:Object,required:!0},conversationId:{type:String,default:null},hideSpeakerHeader:{type:Boolean,default:!1},actionsExpanded:{type:Boolean,default:null},toolExpandStates:{type:Object,default:null},toolStatePrefix:{type:String,default:""},responseCollapsible:{type:Boolean,default:!1},responseCollapsed:{type:Boolean,default:!1},responseToggleLabel:{type:String,default:""}},emits:["update-actions-expanded","update-tool-expanded","toggle-response-collapse"],template:`
|
|
643
643
|
<div class="assistant-turn" ref="turnRef" :class="{ streaming: turn.isStreaming, 'has-vp-speaker': !!turn.speakerVpId }">
|
|
644
644
|
<!-- 0. task-334-ui-b: VP speaker header \u2014 only when a speakerVpId is
|
|
645
645
|
bound AND the upstream consecutive-collapse decided this turn
|
|
@@ -806,7 +806,7 @@ ${String(e||"").trim()}
|
|
|
806
806
|
<!-- H2.f.6: Fork-from-here button removed (single-conversation model). -->
|
|
807
807
|
</div>
|
|
808
808
|
</div>
|
|
809
|
-
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.ref(!1),i=Vue.ref(!1),r=Vue.ref(!1),o=Vue.computed(()=>e.actionsExpanded===null?r.value:!!e.actionsExpanded),a=
|
|
809
|
+
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.ref(!1),i=Vue.ref(!1),r=Vue.ref(!1),o=Vue.computed(()=>e.actionsExpanded===null?r.value:!!e.actionsExpanded),a=v=>{r.value=!!v,t("update-actions-expanded",!!v)},l=Vue.ref(!1),c=Vue.ref(null),d=Vue.reactive(new Set),u=Vue.inject("t"),p=(v,_)=>{s.answerUserQuestion(v,_,e.conversationId||void 0)},f=Vue.computed(()=>(Array.isArray(e.turn?.toolMsgs)?e.turn.toolMsgs:[]).filter(_=>_?.toolName==="RouteForward").map((_,X)=>({...Qr(_.toolInput||{}),key:_.toolId||`${_.startTime||0}:${X}`}))),g=Vue.computed(()=>(Array.isArray(e.turn?.toolMsgs)?e.turn.toolMsgs:[]).filter(_=>_?.toolName!=="RouteForward")),b=Vue.computed(()=>g.value.length>0||Number(e.turn.toolSummaryCount||0)>0),h=Vue.computed(()=>{let v=g.value;return v[v.length-1]}),A=Vue.computed(()=>g.value.slice(0,-1)),x=Vue.computed(()=>Math.max(0,g.value.length-1)),k=Vue.computed(()=>{let v=Number(e.turn.toolSummaryCount||0);return v?typeof u=="function"?u("chat.toolActionsOmitted",{count:v}):`${v} older tool actions omitted`:""}),y=Vue.computed(()=>{let v=e.turn?.todoMsg?.toolInput?.todos;return Array.isArray(v)?v.map(_=>Gc(e.turn,_)):[]}),m=()=>{a(!o.value)},w=(v,_,X)=>{let ne=e.toolStatePrefix||e.turn.id||e.turn.turnId||"assistant-turn",me=v?.toolName||"tool",Se=v?.startTime||_;return`${ne}:tool:${X}:${_}:${me}:${Se}`},E=(v,_,X)=>{let ne=w(v,_,X);return e.toolExpandStates&&Object.prototype.hasOwnProperty.call(e.toolExpandStates,ne)?!!e.toolExpandStates[ne]:null},R=(v,_,X,ne)=>{t("update-tool-expanded",{key:w(v,_,X),value:!!ne})};typeof marked<"u"&&marked.setOptions({highlight:function(v,_){if(typeof hljs<"u"&&_&&hljs.getLanguage(_))try{return hljs.highlight(v,{language:_}).value}catch{}return v},breaks:!0,gfm:!0});let $=Vue.computed(()=>{if(!e.turn.textContent)return"";let v=e.turn.textContent;if(typeof v!="string"&&(Array.isArray(v)?v=v.map(_=>typeof _=="string"?_:_&&_.type==="text"&&_.text||"").join(""):v=String(v)),v=St(v),!v)return"";try{if(typeof marked<"u"){let _=marked.parse(v);return D(P(_))}}catch{}return M(v)}),P=v=>v.replace(/<pre><code([^>]*)>([\s\S]*?)<\/code><\/pre>/g,(_,X,ne)=>{let me=X.match(/class="language-(\w+)"/);return`<div class="code-block-wrapper">
|
|
810
810
|
<div class="code-block-header">
|
|
811
811
|
<span class="code-lang">${me?me[1]:""}</span>
|
|
812
812
|
<button class="code-copy-btn" onclick="window.copyCodeBlock(this)" title="Copy">
|
|
@@ -816,7 +816,7 @@ ${String(e||"").trim()}
|
|
|
816
816
|
</button>
|
|
817
817
|
</div>
|
|
818
818
|
<pre><code${X}>${ne}</code></pre>
|
|
819
|
-
</div>`}),D=
|
|
819
|
+
</div>`}),D=v=>v.replace(/<table>([\s\S]*?)<\/table>/g,_=>`<div class="table-scroll-wrapper">${_}</div>`),M=v=>{if(!v)return"";typeof v!="string"&&(v=String(v));let _=X=>{let ne=document.createElement("div");return ne.textContent=X,ne.innerHTML};return v.replace(/```(\w*)\n([\s\S]*?)```/g,(X,ne,me)=>`<div class="code-block-wrapper"><pre><code class="language-${ne}">${_(me.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>")},C=async()=>{try{await navigator.clipboard.writeText(e.turn.textContent||""),n.value=!0,setTimeout(()=>{n.value=!1},2e3)}catch{}},T=async()=>{try{await navigator.clipboard.writeText(e.turn.textContent||""),i.value=!0,setTimeout(()=>{i.value=!1},2e3)}catch{}},N=()=>{let v=e.turn.textContent||"";if(!v)return;let _=new Blob([v],{type:"text/markdown;charset=utf-8"}),X=URL.createObjectURL(_),ne=document.createElement("a");ne.download=`response-${Date.now()}.md`,ne.href=X,ne.click(),URL.revokeObjectURL(X)},H=async()=>{if(!(l.value||!window.htmlToImage)){l.value=!0;try{let v=c.value;if(!v)return;let _=v.querySelector(".turn-content");if(!_)return;let X=getComputedStyle(document.body).getPropertyValue("--bg-main").trim()||"#ffffff";_.classList.add("screenshot-mode");try{let me=_.getBoundingClientRect(),Se=await window.htmlToImage.toPng(_,{backgroundColor:X,pixelRatio:3,width:me.width+64,height:me.height+64,style:{padding:"32px"},filter:te=>!(te.classList&&(te.classList.contains("turn-header")||te.classList.contains("screenshot-btn")))}),Ce=document.createElement("a");Ce.download=`response-${Date.now()}.png`,Ce.href=Se,Ce.click()}finally{_.classList.remove("screenshot-mode")}}catch{}finally{l.value=!1}}};Vue.onMounted(()=>{window.copyCodeBlock||(window.copyCodeBlock=async function(v){let X=v.closest(".code-block-wrapper").querySelector("code");if(X)try{await navigator.clipboard.writeText(X.textContent),v.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(()=>{v.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(v=>{hljs.highlightElement(v),v.dataset.highlighted="true"}),Xe(c.value)})}),Vue.watch(()=>e.turn.textContent,()=>{Vue.nextTick(()=>{typeof hljs<"u"&&document.querySelectorAll("pre code:not([data-highlighted])").forEach(v=>{hljs.highlightElement(v),v.dataset.highlighted="true"}),Xe(c.value)})});let U=v=>{if(v?.src)return v.src;if(!v?.fileId)return"";let _=v.previewToken||"";return`/api/preview/${v.fileId}?token=${_}`},ie=v=>{d.add(v?.assetId||v?.id)},Y=(v,_)=>{let X=U(v);X&&hs(X,{alt:v?.filename||u("message.imagePreview"),closeLabel:u("common.close"),trigger:_})},G=v=>{if(v)try{typeof s.cancelVpTurn=="function"&&s.cancelVpTurn(v)}catch{}},ee=()=>{let v=e.turn;return v?typeof v.timestamp=="number"&&v.timestamp>0?v.timestamp:typeof v.createdAt=="number"&&v.createdAt>0?v.createdAt:typeof v.speakerTimestamp=="number"&&v.speakerTimestamp>0?v.speakerTimestamp:null:null},re=Vue.computed(()=>{let v=ee();if(!v)return"";try{return new Date(v).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}catch{return""}}),ge=Vue.computed(()=>{let v=ee();if(!v)return"";try{return new Date(v).toLocaleString()}catch{return""}});return{onStopTurn:G,turnTime:re,turnTimeFull:ge,copied:n,fullCopied:i,expanded:o,screenshotting:l,turnRef:c,showToolActions:b,latestTool:h,historyTools:A,latestToolIndex:x,actionTools:g,routeMessages:f,toolSummaryLabel:k,toggleExpand:m,toolExpandedValue:E,updateToolExpanded:R,renderedContent:$,copyContent:C,copyFullResponse:T,exportMarkdown:N,screenshotContent:H,onAskSubmit:p,imageSrc:U,failedImages:d,handleImageError:ie,previewImage:Y,displayedTodos:y}}}});function sd(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,i=String(n).padStart(2,"0");if(s<60)return`${s}:${i}`;let r=Math.floor(s/60),o=s%60;return`${r}:${String(o).padStart(2,"0")}:${i}`}var nd=O(()=>{});var id,rd=O(()=>{si();Hn();gs();nd();id={name:"VpTurnBlock",components:{AssistantTurn:ys},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:""}},emits:["toggle-response-collapse"],template:`
|
|
820
820
|
<div class="vp-turn-block"
|
|
821
821
|
:class="{ 'vp-turn-block-streaming': turn.isStreaming }"
|
|
822
822
|
:data-turn-id="turn.turnId || ''"
|
|
@@ -880,9 +880,9 @@ ${String(e||"").trim()}
|
|
|
880
880
|
/>
|
|
881
881
|
</div>
|
|
882
882
|
</div>
|
|
883
|
-
`,setup(e){let t=zt(),s=ft(),n=Vue.computed(()=>{let u=e.turn&&e.turn.speakerVpId;return u?s.vpLabel(u)||u:""}),i=Vue.computed(()=>{let u=e.turn&&e.turn.speakerVpId;return!u||typeof s.vpTextColor!="function"?{}:{color:s.vpTextColor(u)}}),r=()=>{let u=e.turn&&e.turn.turnId;if(u)try{typeof t.cancelVpTurn=="function"&&t.cancelVpTurn(u)}catch{}},o=Vue.computed(()=>{let u=e.turn&&e.turn.speakerVpId;return u?t.isVpTypingInCurrentConv(u):!1}),a=Vue.computed(()=>!!(e.turn&&e.turn.isStreaming&&e.turn.turnId)),l=Vue.computed(()=>{let u=e.turn.speakerTimestamp;if(!u)return"";let p=new Date(u);return Number.isNaN(p.getTime())?"":p.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),c=Vue.computed(()=>{let u=e.turn.speakerTimestamp;if(!u)return"";let p=new Date(u);return Number.isNaN(p.getTime())?"":p.toLocaleString()}),d=Vue.computed(()=>{let u=e.turn.speakerTimestamp;if(!u||!e.nowMs)return"";let p=e.nowMs-u;return p<0?"":sd(p)});return{onStopTurn:r,isTyping:o,showStop:a,displayName:n,speakerNameStyle:i,startedTimeText:l,startedTimeFullText:c,elapsedText:d}}}});function
|
|
883
|
+
`,setup(e){let t=zt(),s=ft(),n=Vue.computed(()=>{let u=e.turn&&e.turn.speakerVpId;return u?s.vpLabel(u)||u:""}),i=Vue.computed(()=>{let u=e.turn&&e.turn.speakerVpId;return!u||typeof s.vpTextColor!="function"?{}:{color:s.vpTextColor(u)}}),r=()=>{let u=e.turn&&e.turn.turnId;if(u)try{typeof t.cancelVpTurn=="function"&&t.cancelVpTurn(u)}catch{}},o=Vue.computed(()=>{let u=e.turn&&e.turn.speakerVpId;return u?t.isVpTypingInCurrentConv(u):!1}),a=Vue.computed(()=>!!(e.turn&&e.turn.isStreaming&&e.turn.turnId)),l=Vue.computed(()=>{let u=e.turn.speakerTimestamp;if(!u)return"";let p=new Date(u);return Number.isNaN(p.getTime())?"":p.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),c=Vue.computed(()=>{let u=e.turn.speakerTimestamp;if(!u)return"";let p=new Date(u);return Number.isNaN(p.getTime())?"":p.toLocaleString()}),d=Vue.computed(()=>{let u=e.turn.speakerTimestamp;if(!u||!e.nowMs)return"";let p=e.nowMs-u;return p<0?"":sd(p)});return{onStopTurn:r,isTyping:o,showStop:a,displayName:n,speakerNameStyle:i,startedTimeText:l,startedTimeFullText:c,elapsedText:d}}}});function em(e){let t=[];if(typeof e!="string"||!e.trim())return t;let s=e.split(`
|
|
884
884
|
`),n=null;for(let i of s){let r=/^##\s+(.+?)\s*$/.exec(i);r?(n&&t.push(n),n={title:r[1],body:""}):n&&(n.body+=(n.body?`
|
|
885
|
-
`:"")+i)}n&&t.push(n);for(let i of t)i.body=i.body.trim();return t}var od,ad=O(()=>{od={name:"ReflectionCard",props:{card:{type:Object,required:!0}},data(){return{expanded:{"What was attempted":!1,"Key findings":!1,"Direction check":!0,"Suggested next direction":!1,"Tool execution log":!1}}},computed:{isPending(){return this.card&&this.card.status==="pending"},isError(){return this.card&&this.card.status==="error"},triggerLabel(){return this.card.trigger==="t1"?"In-turn reflection":"End-of-turn reflection"},sections(){let e=this.card&&this.card.content||"";return
|
|
885
|
+
`:"")+i)}n&&t.push(n);for(let i of t)i.body=i.body.trim();return t}var od,ad=O(()=>{od={name:"ReflectionCard",props:{card:{type:Object,required:!0}},data(){return{expanded:{"What was attempted":!1,"Key findings":!1,"Direction check":!0,"Suggested next direction":!1,"Tool execution log":!1}}},computed:{isPending(){return this.card&&this.card.status==="pending"},isError(){return this.card&&this.card.status==="error"},triggerLabel(){return this.card.trigger==="t1"?"In-turn reflection":"End-of-turn reflection"},sections(){let e=this.card&&this.card.content||"";return em(e)}},methods:{toggle(e){this.expanded={...this.expanded,[e]:!this.expanded[e]}}},template:`
|
|
886
886
|
<div class="reflection-card" :class="{ 'is-pending': isPending, 'is-error': isError }">
|
|
887
887
|
<div class="reflection-head">
|
|
888
888
|
<span class="reflection-icon">\u21BB</span>
|
|
@@ -948,7 +948,7 @@ ${String(e||"").trim()}
|
|
|
948
948
|
<MessageItem :message="message" />
|
|
949
949
|
</div>
|
|
950
950
|
</div>
|
|
951
|
-
`}});function tn(e,t,s){return Math.min(Math.max(e,t),s)}function ni(e){return e?typeof e=="string"?e.length:Array.isArray(e)?e.reduce((t,s)=>t+ni(s),0):typeof e=="object"?Object.values(e).reduce((t,s)=>t+ni(s),0):String(e).length:0}function pd(e){if(!e)return 260;let t=ni(e.content||e.text||e.message||""),s=Array.isArray(e.attachments)?e.attachments.length:0;return tn(110+Math.ceil(t/90)*18+s*120,120,1400)}function
|
|
951
|
+
`}});function tn(e,t,s){return Math.min(Math.max(e,t),s)}function ni(e){return e?typeof e=="string"?e.length:Array.isArray(e)?e.reduce((t,s)=>t+ni(s),0):typeof e=="object"?Object.values(e).reduce((t,s)=>t+ni(s),0):String(e).length:0}function pd(e){if(!e)return 260;let t=ni(e.content||e.text||e.message||""),s=Array.isArray(e.attachments)?e.attachments.length:0;return tn(110+Math.ceil(t/90)*18+s*120,120,1400)}function tm(e){if(!e)return 260;let t=ni(e.text||e.content||""),s=Array.isArray(e.toolMsgs)?e.toolMsgs.length:0,n=Array.isArray(e.images)?e.images.length:0,i=Array.isArray(e.askRequests)?e.askRequests.length:0;return tn(160+Math.ceil(t/95)*18+s*56+n*140+i*96,160,1400)}function Mt(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+Mt(n),0)+Math.max(0,t.length-1)*18:260}return e.type==="assistant-turn"?tm(e):e.message?pd(e.message):pd(e)}function bs(e,t=0){return String(e?.id||e?.messageId||e?.turnId||`virtual_${t}`)}function sm(e,t,s,n){let i=bs(e,t),r=s instanceof Map?s.get(i):s?.[i];if(Number.isFinite(r)&&r>0)return r;let o=n?n(e,t):Mt(e);return Number.isFinite(o)&&o>0?o:260}function so(e,t={},s={}){let n=Array.isArray(e)?e:[],i=Math.max(0,Number(s.itemGap??18)),r=s.estimateHeight||Mt,o=[0],a=[];for(let l=0;l<n.length;l+=1){let c=sm(n[l],l,t,r);a.push(c),o.push(o[l]+c+(l<n.length-1?i:0))}return{offsets:o,heights:a,totalHeight:o[o.length-1]||0,itemGap:i}}function fd(e,t){let s=0,n=Math.max(0,e.length-2),i=0;for(;s<=n;){let r=Math.floor((s+n)/2);e[r+1]<=t?(i=r+1,s=r+1):n=r-1}return i}function nm(e,t,s){let n=fd(e,t);for(;n<s&&e[n]<t;)n+=1;return tn(n,0,s)}function gd(e,t,s={}){let n=Array.isArray(e)?e:[],i=n.length;if(!i)return{start:0,end:0,visibleStart:0,visibleEnd:0,topSpacerHeight:0,bottomSpacerHeight:0,totalHeight:0,items:[]};let r=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=r+o,u=tn(fd(l,r),0,i-1),p=tn(nm(l,d,i),u+1,i),f=Math.max(0,u-a),g=Math.min(i,p+a);return{start:f,end:g,visibleStart:u,visibleEnd:p,topSpacerHeight:l[f]||0,bottomSpacerHeight:Math.max(0,c-(l[g]||c)),totalHeight:c,items:n.slice(f,g).map((b,h)=>{let A=f+h;return{item:b,index:A,key:bs(b,A),top:l[A]||0}})}}function md(e,t,s={},n={}){let i=Array.isArray(e)?e:[],r=Math.max(0,Math.min(i.length-1,Number.isFinite(t)?Math.floor(t):0));if(i.length===0)return 0;let{offsets:o,heights:a,totalHeight:l}=so(i,s,n),c=Math.max(1,Number(n.viewportHeight||720)),d=n.align==="start"||n.align==="end"?n.align:"center",u=o[r]||0,p=a[r]||260;return d==="start"?Math.max(0,Math.min(u,l-c)):d==="end"?Math.max(0,Math.min(u+p-c,l-c)):Math.max(0,Math.min(u-(c-p)/2,l-c))}function ws({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 no({following:e=!0,atBottom:t=!1,userScroll:s=!1}={}){return(s||!!e)&&!!t}function om(e){return im.has(String(e||""))}function hd(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 vd(e,t,s=globalThis.document){if(!e||e.defaultPrevented||!t||!om(e.key))return!1;let n=e.target;return!n||n.closest?.(rm)?!1:n===t||n===s?.body||n===s?.documentElement}var im,rm,Pt,io=O(()=>{im=new Set(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," "]),rm='input, textarea, select, button, a, [contenteditable], [role="button"], [role="link"]';Pt=Object.freeze({itemHeight:260,viewportHeight:720,overscan:1,itemGap:18,bottomThreshold:80})});var ii,yd,bd=O(()=>{io();ii=2,yd={name:"VirtualTranscript",props:{items:{type:Array,default:()=>[]},overscan:{type:Number,default:Pt.overscan},itemGap:{type:Number,default:Pt.itemGap},estimateHeight:{type:Function,default:Mt},initialAlign:{type:String,default:"start"}},emits:["scroll-state"],template:`
|
|
952
952
|
<div class="virtual-transcript" ref="rootRef">
|
|
953
953
|
<div
|
|
954
954
|
v-if="topSpacerHeight > 0"
|
|
@@ -975,8 +975,8 @@ ${String(e||"").trim()}
|
|
|
975
975
|
aria-hidden="true"
|
|
976
976
|
></div>
|
|
977
977
|
</div>
|
|
978
|
-
`,setup(e,{emit:t,expose:s}){let n=Vue.ref(null),i=Vue.ref(null),r=e.initialAlign==="end",o=Vue.ref(r?Number.MAX_SAFE_INTEGER:0),a=Vue.ref(Pt.viewportHeight),l=Vue.reactive({}),c=new Map,d=new Map,u=new Map,p=null,f=null,g=null,
|
|
979
|
-
`),()=>{c.clear(),e.items.forEach((Y,G)=>c.set(bs(Y,G),G)),Vue.nextTick($)},{immediate:!0}),Vue.onMounted(()=>{if(i.value=n.value?.closest?.(".chat-container")||n.value?.parentElement||null,$(),i.value?.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",P),typeof ResizeObserver<"u"){p=new ResizeObserver(Y=>{for(let G of Y){let ee=G.target?.dataset?.virtualId,re=Number(G.target?.dataset?.virtualIndex);ee&&C(ee,re,G.target)}});for(let[Y,G]of d.entries()){let ee=c.get(Y)??Number(G.dataset?.virtualIndex||0);N(Y,ee,G)}}}),Vue.onBeforeUnmount(()=>{i.value?.removeEventListener("scroll",P),window.removeEventListener("resize",P),p&&p.disconnect(),f&&cancelAnimationFrame(f),g&&cancelAnimationFrame(g),
|
|
978
|
+
`,setup(e,{emit:t,expose:s}){let n=Vue.ref(null),i=Vue.ref(null),r=e.initialAlign==="end",o=Vue.ref(r?Number.MAX_SAFE_INTEGER:0),a=Vue.ref(Pt.viewportHeight),l=Vue.reactive({}),c=new Map,d=new Map,u=new Map,p=null,f=null,g=null,b=null,h=0,A=!1,x=Vue.computed(()=>so(e.items,l,{itemGap:e.itemGap,estimateHeight:e.estimateHeight})),k=Vue.computed(()=>gd(e.items,x.value,{scrollTop:o.value,viewportHeight:a.value,overscan:e.overscan})),y=Vue.computed(()=>k.value.items),m=Vue.computed(()=>k.value.topSpacerHeight),w=Vue.computed(()=>k.value.bottomSpacerHeight);function E(Y){Y&&t("scroll-state",{scrollTop:Y.scrollTop||0,scrollHeight:Y.scrollHeight||0,clientHeight:Y.clientHeight||0})}function R(){let Y=i.value;Y&&(a.value=Math.max(1,Y.clientHeight||Pt.viewportHeight),r&&e.items.length===0||(o.value=Math.max(0,Y.scrollTop||0)),E(Y))}function q(){let Y=i.value;return!r||e.initialAlign!=="end"||e.items.length===0||!Y?!1:(Y.scrollTop=Y.scrollHeight,r=!1,R(),!0)}function $(){q()||R()}function P(){f||(f=requestAnimationFrame(()=>{f=null,R()}))}function D(Y){return Y?ws({scrollTop:Y.scrollTop,scrollHeight:Y.scrollHeight,clientHeight:Y.clientHeight,threshold:Pt.bottomThreshold}):!0}function M({delta:Y=0,toBottom:G=!1}={}){Math.abs(Y)>=ii&&(h+=Y),G&&(A=!0),!b&&(b=requestAnimationFrame(()=>{b=null;let ee=i.value;if(!ee){h=0,A=!1;return}A?ee.scrollTop=ee.scrollHeight:Math.abs(h)>=ii&&(ee.scrollTop+=h),h=0,A=!1,R()}))}function C(Y,G,ee){!Y||!ee||(u.set(Y,{index:G,el:ee}),!g&&(g=requestAnimationFrame(()=>{g=null;let re=Array.from(u.entries());u.clear(),T(re)})))}function T(Y){let G=[];for(let[me,Se]of Y){let Ce=Se?.el;if(!Ce)continue;let te=Math.ceil(Ce.getBoundingClientRect?.().height||Ce.offsetHeight||0);if(!Number.isFinite(te)||te<=0)continue;let Q=l[me];if(Q===te)continue;let F=c.get(me);G.push({key:me,nextHeight:te,previousHeight:Q,itemIndex:Number.isFinite(F)?F:Se.index})}if(!G.length)return;let ee=i.value,re=D(ee),ge=k.value.visibleStart,v=0,_=!1;for(let me of G){let{key:Se,nextHeight:Ce,previousHeight:te,itemIndex:Q}=me;if(l[Se]=Ce,!ee||!Number.isFinite(te))continue;let F=Ce-te;Math.abs(F)<ii||(Number.isFinite(Q)&&Q<ge?v+=F:re&&(_=!0))}if(!(Math.abs(v)>=ii)&&!_)return;let ne={delta:v,toBottom:_};_?Vue.nextTick(()=>M(ne)):M(ne)}function N(Y,G,ee){c.set(Y,G),ee&&(d.set(Y,ee),p&&p.observe(ee),Vue.nextTick(()=>C(Y,G,ee)))}function H(Y,G,ee){if(!Y)return;let re=d.get(Y);if(re&&re!==ee&&p&&p.unobserve(re),!ee){d.delete(Y);return}N(Y,G,ee)}async function U(Y,{align:G="center"}={}){let ee=Number.isFinite(Y)?Math.floor(Y):-1,re=i.value;if(!re||ee<0||ee>=e.items.length)return!1;let ge=bs(e.items[ee],ee);re.scrollTop=md(e.items,ee,l,{itemGap:e.itemGap,estimateHeight:e.estimateHeight,viewportHeight:re.clientHeight||a.value,align:G}),R(),await Vue.nextTick();let v=d.get(ge);return v?.scrollIntoView&&v.scrollIntoView({block:G,inline:"nearest"}),R(),!0}function ie(Y,G={}){let ee=c.get(String(Y));return Number.isFinite(ee)?U(ee,G):Promise.resolve(!1)}return s({scrollToKey:ie,scrollToIndex:U}),Vue.watch(()=>e.items.map((Y,G)=>bs(Y,G)).join(`
|
|
979
|
+
`),()=>{c.clear(),e.items.forEach((Y,G)=>c.set(bs(Y,G),G)),Vue.nextTick($)},{immediate:!0}),Vue.onMounted(()=>{if(i.value=n.value?.closest?.(".chat-container")||n.value?.parentElement||null,$(),i.value?.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",P),typeof ResizeObserver<"u"){p=new ResizeObserver(Y=>{for(let G of Y){let ee=G.target?.dataset?.virtualId,re=Number(G.target?.dataset?.virtualIndex);ee&&C(ee,re,G.target)}});for(let[Y,G]of d.entries()){let ee=c.get(Y)??Number(G.dataset?.virtualIndex||0);N(Y,ee,G)}}}),Vue.onBeforeUnmount(()=>{i.value?.removeEventListener("scroll",P),window.removeEventListener("resize",P),p&&p.disconnect(),f&&cancelAnimationFrame(f),g&&cancelAnimationFrame(g),b&&cancelAnimationFrame(b),u.clear(),h=0,A=!1}),{rootRef:n,visibleEntries:y,topSpacerHeight:m,bottomSpacerHeight:w,setItemRef:H}}}});function sn(e){return typeof e=="string"&&e.trim()?e.trim():""}function am(e){return sn(e?.speakerVpId)||sn(e?.vpId)}function wd(e,t){if(!e||!t)return!1;let s=sn(e.speakerVpId),n=am(t);if(s&&n&&s!==n)return!0;if(e.isHistory&&t.isHistory)return!1;let i=sn(e.turnId),r=sn(t.turnId);return!!(i&&r&&i!==r)}var kd=O(()=>{});function nn(e){return e?e.type!=="user"&&e.type!=="system"&&e.type!=="error":!1}function ri(e){let t=Array.isArray(e?.items)?e.items:[];return e?.responseCollapsed?t.filter(s=>!nn(s)):t}function lm(e){return(Array.isArray(e?.items)?e.items:[]).filter(nn)}function Sd(e){let t=lm(e);return t.length?t[0]:null}function cm(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 Cd(e){if(!e?.responseCollapsed)return[];let t=Sd(e);return cm(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 Id(e,t){if(!e?.responseCollapsed||typeof t!="function")return null;let s=ri(e),n=Sd(e)?74:0,i=s.length+(n?1:0);if(!s.length)return n;let r=s.reduce((a,l)=>a+t(l),0),o=Math.max(0,i-1)*18;return r+o+n}var Ad=O(()=>{});function jt(e,t){typeof t!="string"||!/^m\d+$/.test(t)||e.includes(t)||e.push(t)}function dm(e){if(!e)return[];let t=[];for(let s of Array.isArray(e.messages)?e.messages:[])jt(t,s?.id),jt(t,s?.messageId),jt(t,s?.persistedMessageId);return jt(t,e.message?.id),jt(t,e.messageId),jt(t,e.atMessageId),e.type!=="assistant-turn"&&jt(t,e.id),t}async function xd({result:e,loadWindow:t,nextTick:s,revealMessage:n,isMobile:i,closeOutline:r}){if(!e||!await t?.(e))return!1;await s?.();let a=await n?.(e.messageId);return a&&i&&r?.(),!!a}function um(e,t){if(!t)return null;for(let s of Array.isArray(e)?e:[]){if(!s)continue;let n=Array.isArray(s.items)?s.items:[s];for(let i of n){if(!dm(i).includes(t))continue;let r=i?.id,o=s?.id;return!r||!o?null:{blockId:o,rowId:r,collapseKey:s.responseCollapseKey||null,requiresExpansion:!!(s.responseCollapsed&&i.type==="assistant-turn")}}}return null}async function Td({blocks:e,messageId:t,collapseStates:s,scrollToBlock:n,findRow:i,flashRow:r,nextTick:o}){let a=um(e,t);if(!a||typeof n!="function"||typeof i!="function")return!1;if(a.requiresExpansion){if(!a.collapseKey||!s)return!1;s[a.collapseKey]=!1,await o?.()}if(!await n(a.blockId))return!1;await o?.();let c=i(a.rowId);return c?(c.scrollIntoView?.({block:"center",inline:"nearest"}),r?.(a.rowId),!0):!1}var ro=O(()=>{});var oi,oo=O(()=>{ct();Ur();Xn();si();rd();eo();ad();cd();ud();bd();kd();io();Ad();ro();oi={name:"MessageList",components:{MessageItem:vs,AssistantTurn:ys,VpTurnBlock:id,VpSpeakerHeader:ei,ReflectionCard:od,SubAgentCard:ld,UserTurnBlock:dd,VirtualTranscript:yd},template:`
|
|
980
980
|
<main class="chat-container" ref="containerRef">
|
|
981
981
|
<!-- Session Loading Overlay - only covers message area -->
|
|
982
982
|
<div class="session-loading-overlay" v-if="showSessionLoadingOverlay">
|
|
@@ -1588,7 +1588,7 @@ ${String(e||"").trim()}
|
|
|
1588
1588
|
{{ $t('message.scrollToLatest') }}
|
|
1589
1589
|
</button>
|
|
1590
1590
|
</main>
|
|
1591
|
-
`,emits:["new-conversation","resume-conversation","open-settings"],setup(e,{expose:t}){let s=Pinia.useChatStore(),n=Ae(),i=typeof window<"u"&&window.Pinia?.useVpStore?window.Pinia.useVpStore():null,r=Vue.inject("t",null),o=Vue.ref(null),a=Vue.ref(null),l=Vue.reactive({}),c=Vue.reactive({}),d=Vue.reactive({}),u=S=>String(S?.id||S?.turnId||S?.messageId||S?.atMessageId||S?.message?.id||"turn_unknown"),p=S=>{let L=u(S);return Object.prototype.hasOwnProperty.call(l,L)?!!l[L]:!1},f=(S,L)=>{l[u(S)]=!!L},g=({key:S,value:L}={})=>{S&&(c[S]=!!L)},v=S=>{let L=Id(S,Mt);return Number.isFinite(L)?L:Mt(S)},y=S=>ri(S),A=S=>{let L=Array.isArray(S?.collapsedResponsePreview)?S.collapsedResponsePreview:Cd(S);return Array.isArray(L)?L:L?[String(L)]:[]},x=S=>{let L=Array.isArray(S?.items)?S.items.find(ye=>nn(ye)):null,B=L?.speakerVpId||L?.vpId||L?.message?.speakerVpId||L?.message?.vpId||S?.vpId||"",ue=B&&i&&typeof i.vpLabel=="function"?i.vpLabel(B)||B:B||(typeof r=="function"?r("message.assistant"):"Assistant"),be=B&&i&&typeof i.vpTextColor=="function"?{color:i.vpTextColor(B)}:{},ae=L?.speakerTimestamp||L?.timestamp||L?.createdAt||L?.message?.timestamp||L?.message?.createdAt||0,De="",Ue="";if(ae)try{let ye=new Date(ae);Number.isNaN(ye.getTime())||(De=ye.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),Ue=ye.toLocaleString())}catch{}return{name:ue,style:be,timeText:De,fullTimeText:Ue}},k=S=>{let L=Array.isArray(S?.items)?S.items:[];for(let B=L.length-1;B>=0;B-=1)if(nn(L[B]))return L[B];return null},b=(S,L)=>!S?.responseCollapsible||!L?!1:k(S)===L,m=S=>!!(S?.responseCollapsible&&!ri(S).some(L=>b(S,L))),w=S=>{let L=S?.responseCollapseKey;L&&(d[L]=!S.responseCollapsed)},E=S=>{let L=Number(S?.responseCount||0),B=S?.responseCollapsed?"message.showResponses":"message.hideResponses",ue=(typeof r=="function"?r(B):"")||(S?.responseCollapsed?"Show {count} response(s)":"Hide response(s)");return String(ue).replace("{count}",String(L))},R=(()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}}),q=Vue.computed(()=>{if(s.currentView!=="yeaft")return null;let S=R();if(!S)return null;let L=s.yeaftActiveSessionFilter||null;return L&&typeof S.sessionById=="function"&&S.sessionById(L,s.currentAgent||null)?L:S.activeSessionId&&typeof S.sessionById=="function"&&S.sessionById(S.activeSessionId,s.currentAgent||null)?S.activeSessionId:null}),$=Vue.computed(()=>[s.activeConversationId||"",s.currentView||"",s.currentAgent||"",s.currentView==="yeaft"?s.yeaftActiveSessionFilter||q.value||"__all__":""].join("")),P=Vue.computed(()=>q.value!==null),D=Vue.computed(()=>s.agents.filter(S=>S.online)),M=Vue.ref(null),C=Vue.ref(null),T=Vue.ref(!1),N=Vue.ref(""),H=null,U=0,ie=n.token||"",Y=()=>{M.value=null,C.value=null,N.value="",H=null,U+=1},G=Kn(),ee=Gn(),re=Vue.computed(()=>Yn({profile:M.value,agentSecret:C.value,serverWsUrl:Xs(location)})),ge=()=>{let S={"Content-Type":"application/json"};return n.token&&(S.Authorization=`Bearer ${n.token}`),S},h=async()=>{if(D.value.length>0||s.currentConversation)return;if(C.value||H)return H;T.value=!0,N.value="";let S=++U;return H=(async()=>{let L=n.token||"",B=ge(),[ue,be]=await Promise.all([fetch("/api/user/profile",{headers:B}),fetch("/api/user/agent-secret",{headers:B})]),ae=ue.ok?await ue.json():null;if(S!==U||L!==(n.token||""))return;if(ae&&(M.value=ae),!be.ok){let ye="";try{ye=(await be.json())?.error||""}catch{}throw new Error(ye||"Failed to load Agent secret")}let De=await be.json();if(S!==U||L!==(n.token||""))return;let Ue=De?.agentSecret||De?.agent_secret||null;C.value=Ue&&String(Ue).trim()?String(Ue):null})().catch(L=>{S===U&&(N.value=L?.message||"Failed to load Agent secret")}).finally(()=>{S===U&&(T.value=!1,H=null)}),H},_=async S=>{if(S)try{await navigator.clipboard.writeText(S)}catch{}},X=(S,L)=>{let B=S?.message||null,ue=S?.id||S?.atMessageId||B?.id||B?.messageId||`legacy_${L}`,be=S?.speakerVpId||S?.vpId||B?.speakerVpId||B?.vpId||"";return{id:`message_${be||"user"}_${ue}_${L}`,vpId:be,messageId:ue}},ne=Vue.computed(()=>{let S=s.messages,L=[],B=null,ue=0,be=()=>{if(B){let ye=!!(B.textContent||B.todoMsg||B.askMsg||B.imageMsgs.length>0),de=B.toolMsgs.length>0||B.toolSummaryCount>0;(ye||de)&&(B.showSpeakerHeader=!!B.speakerVpId,L.push(B)),B=null}},ae=ye=>{if(B){if(!B.speakerVpId){let de=ye.speakerVpId||ye.vpId;de&&(B.speakerVpId=de,B.speakerTimestamp=typeof ye.timestamp=="number"&&ye.timestamp>0?ye.timestamp:typeof ye.createdAt=="number"?ye.createdAt:0,typeof ye.lastStateChangeCause=="string"&&!B.speakerStateCause&&(B.speakerStateCause=ye.lastStateChangeCause))}!B.turnId&&ye.turnId&&(B.turnId=ye.turnId)}},De=()=>{ue++,B={type:"assistant-turn",id:"turn_"+ue,textContent:"",isStreaming:!1,isHistory:!1,todoMsg:null,toolMsgs:[],toolSummaryCount:0,imageMsgs:[],askMsg:null,messages:[],atMessageId:null,speakerVpId:null,speakerTimestamp:0,speakerStateCause:"",showSpeakerHeader:!1,turnId:null}},Ue=ye=>{wd(B,ye)&&be()};for(let ye=0;ye<S.length;ye++){let de=S[ye];if(de.type==="user"){if(!de.content||!de.content.trim())continue;be(),L.push({type:"user",id:de.id||"u_"+ye,message:de});continue}if(de.type==="system"||de.type==="error"){be(),L.push({type:de.type,id:de.id||"s_"+ye,message:de});continue}if(!(de.type==="tool-result"||de.type==="tool_result")){if(de.type==="tool-summary"){Ue(de),B||De(),ae(de),de.isHistory&&(B.isHistory=!0),B.toolSummaryCount+=Number(de.count||de.omittedCount||0)||0,B.messages.push(de);continue}if(de.type==="assistant"){Ue(de),B||De(),de.content&&(B.textContent+=de.content),de.isStreaming&&(B.isStreaming=!0),de.isHistory&&(B.isHistory=!0),de.id&&/^m\d+$/.test(de.id)&&(B.atMessageId=de.id),ae(de),B.messages.push(de);continue}if(de.type==="tool-use"){Ue(de),B||De(),ae(de);let kn=S[ye+1],Bo=kn&&(kn.type==="tool-result"||kn.type==="tool_result"),Sn={...de,hasResult:Bo||de.hasResult||!1,toolResult:de.toolResult||null};de.isHistory&&(B.isHistory=!0),de.toolName==="TodoWrite"?B.todoMsg=Sn:de.toolName==="AskUserQuestion"?B.askMsg=Sn:B.toolMsgs.push(Sn),B.messages.push(de);continue}if(de.type==="chat-image"){Ue(de),B||De(),ae(de),de.isHistory&&(B.isHistory=!0),B.imageMsgs.push(de),B.messages.push(de);continue}be(),L.push({type:de.type||"unknown",id:de.id||"x_"+ye,message:de})}}return be(),L}),me=Vue.computed(()=>{let S=[],L=null,B=()=>{L&&S.push(L),L=null};return ne.value.forEach((ue,be)=>{if(!ue||ue.type==="system"||ue.type==="error"){B(),S.push(ue);return}let ae=X(ue,be);if(ue.type==="user"||!L){B(),L={type:"message-block",id:`turn_${ae.messageId}_${be}`,vpId:ae.vpId,messageId:ae.messageId,items:[ue]};return}L.items.push(ue),!L.vpId&&ae.vpId&&(L.vpId=ae.vpId)}),B(),S}),Se=Vue.computed(()=>{let S=s.yeaftReflectionCards||{},L=s.yeaftConversationId,B={__orphans:[]},ue=Object.values(S).filter(ae=>ae&&ae.conversationId===L).sort((ae,De)=>(ae.anchorOrder||0)-(De.anchorOrder||0)||(ae.updatedAt||0)-(De.updatedAt||0)),be=new Set;for(let ae of s.messages||[])ae&&ae.id&&be.add(ae.id);for(let ae of ue)ae.anchorMsgId&&be.has(ae.anchorMsgId)?(B[ae.anchorMsgId]||(B[ae.anchorMsgId]=[]),B[ae.anchorMsgId].push(ae)):B.__orphans.push(ae);return B}),Ce=S=>S?S.type==="assistant-turn"?S.atMessageId||null:S.message&&S.message.id||null:null,te=S=>{let L=Ce(S);return L?(Se.value||{})[L]||[]:[]},Q=Vue.computed(()=>(Se.value||{}).__orphans||[]),F=Vue.computed(()=>{let S=s.yeaftSubAgentCards||{},L=s.yeaftConversationId,B={__orphans:[]},ue=Object.values(S).filter(ae=>ae&&ae.conversationId===L).sort((ae,De)=>(ae.anchorOrder||0)-(De.anchorOrder||0)||(ae.updatedAt||0)-(De.updatedAt||0)),be=new Set;for(let ae of s.messages||[])ae&&ae.id&&be.add(ae.id);for(let ae of ue)ae.anchorMsgId&&be.has(ae.anchorMsgId)?(B[ae.anchorMsgId]||(B[ae.anchorMsgId]=[]),B[ae.anchorMsgId].push(ae)):B.__orphans.push(ae);return B}),se=S=>{let L=Ce(S);return L?(F.value||{})[L]||[]:[]},oe=Vue.computed(()=>(F.value||{}).__orphans||[]),we=Vue.ref(!0),W=Vue.ref(!1),J=Pt.bottomThreshold,he=100,fe=!0,Re=Vue.computed(()=>s.messages.some(S=>S.isStreaming)),Ve=Vue.computed(()=>!s.currentConversation||me.value.length>0?!1:s.currentView==="yeaft"?!!s.yeaftLoadingMoreHistory:!!s.sessionLoading),He=Vue.computed(()=>s.sessionLoadingText||""),V=Vue.computed(()=>!!s.sessionLoading&&!Ve.value),Z=Vue.computed(()=>s.isProcessing&&!Re.value),pe=Vue.ref(Date.now()),ce=null,ve=()=>{ce||(ce=setInterval(()=>{pe.value=Date.now()},1e3))},Pe=()=>{ce&&(clearInterval(ce),ce=null)};Vue.watch(Re,S=>{S?(pe.value=Date.now(),ve()):Pe()},{immediate:!0}),Vue.onBeforeUnmount(()=>Pe());let Te=Vue.ref(0),Ne=Vue.ref(Date.now()),Fe=null,Je=null,ut=Vue.ref("cat"),Et=new URLSearchParams(window.location.search).get("preview"),mt=Vue.ref(0),ht=Vue.ref(1),We=Vue.ref(5),Be=Vue.ref(95),Le=Vue.ref("bark-both"),ze=Vue.ref(1),je=Vue.ref(-1),rt=null;function Ts(){if(!Te.value)return;Ne.value=Date.now();let S=(Ne.value-Te.value)%19e3;if(S<4e3)mt.value=0,ht.value=1;else if(S<11500){let L=S-4e3,B;L<2500?B=L/2500*16:L<5e3?B=16+(L-2500)/2500*29:B=45+(L-5e3)/2500*55,mt.value=B,ht.value=1}else S<14e3?(mt.value=(1-(S-11500)/2500)*100,ht.value=-1):(mt.value=0,ht.value=1);Je=requestAnimationFrame(Ts)}function Ms(){if(!Te.value||ut.value!=="dog")return;Ne.value=Date.now();let S=(Ne.value-Te.value)%18e3;if(S<2e3)We.value=5,Be.value=95,Le.value="bark-both",ze.value=1,je.value=-1;else if(S<5e3){let L=(S-2e3)/3e3;We.value=5+L*25,Be.value=95,Le.value="left-approach",ze.value=1,je.value=-1}else if(S<8e3){let L=(S-5e3)/3e3;We.value=30,Be.value=95-L*25,Le.value="right-approach",ze.value=1,je.value=-1}else if(S<1e4){let L=(S-8e3)/2e3;We.value=30+L*13,Be.value=70-L*13,Le.value="both-approach",ze.value=1,je.value=-1}else if(S<11e3)We.value=43,Be.value=57,Le.value="snap",ze.value=1,je.value=-1;else if(S<12500)We.value=43,Be.value=57,Le.value="stunned",ze.value=1,je.value=-1;else if(S<15e3){let L=(S-12500)/2500;We.value=43-L*38,Be.value=57+L*38,Le.value="retreat",ze.value=-1,je.value=1}else S<17e3?(We.value=5,Be.value=95,Le.value="rehang",ze.value=-1,je.value=1):(We.value=5,Be.value=95,Le.value="reset",ze.value=1,je.value=-1);rt=requestAnimationFrame(Ms)}let Vi=Vue.computed(()=>{let S=We.value*1.2;return ze.value<0?`translate(${S+13.5}, 0) scale(-1, 1)`:`translate(${S-13.5}, 0)`}),Fi=Vue.computed(()=>{let S=Be.value*1.2;return je.value>0?`translate(${S-10.5}, 2)`:`translate(${S+10.5}, 2) scale(-1, 1)`}),fn=Vue.computed(()=>{let S=Le.value;return S==="bark-both"||S==="left-approach"||S==="right-approach"||S==="both-approach"||S==="reset"}),Ke=Vue.computed(()=>{let S=We.value*1.2,L=10;if(fn.value){let be=Math.max(0,(S-3)*.12);return`M3,18 Q${(3+S)/2},${18+be} ${S},${L}`}if(Le.value==="rehang")return`M${S},${L} Q${S-3},20 3,18`;let B=ze.value<0?1:-1,ue=S+B*8;return`M${S},${L} Q${S},18 ${ue},22`}),Oi=Vue.computed(()=>{let S=Be.value*1.2,L=10;if(fn.value){let be=Math.max(0,(118-S)*.12);return`M118,18 Q${(118+S)/2},${18+be} ${S},${L}`}if(Le.value==="rehang")return`M${S},${L} Q${S+3},20 118,18`;let B=je.value>0?-1:1,ue=S+B*8;return`M${S},${L} Q${S},18 ${ue},22`}),et=Vue.computed(()=>Le.value==="snap"?.2:.4),gn=Vue.computed(()=>Le.value==="snap"?.2:.4),Hi=Vue.computed(()=>We.value*1.2),Ni=Vue.computed(()=>Be.value*1.2),It=Et==="cat"||Et==="dog"||Et==="animation",Ps=600,Jt=Vue.ref(!1),Ge=null,es=Vue.computed(()=>It?!0:Jt.value);Vue.watch(Z,S=>{if(S)Ge&&(clearTimeout(Ge),Ge=null),Jt.value=!0,Te.value=Date.now(),Ne.value=Date.now(),ut.value="cat",mt.value=0,ht.value=1,We.value=5,Be.value=95,Le.value="bark-both",ze.value=1,je.value=-1,ut.value==="cat"?Je=requestAnimationFrame(Ts):rt=requestAnimationFrame(Ms);else{let L=Te.value?Date.now()-Te.value:Ps,B=Math.max(0,Ps-L),ue=()=>{Ge=null,Jt.value=!1,Te.value=0,mt.value=0,ht.value=1,Je&&(cancelAnimationFrame(Je),Je=null),rt&&(cancelAnimationFrame(rt),rt=null)};B===0?ue():(Ge&&clearTimeout(Ge),Ge=setTimeout(ue,B))}},{immediate:!0}),It&&(Te.value=Date.now(),Ne.value=Date.now(),Et==="dog"?ut.value="dog":ut.value="cat",ut.value==="cat"?Je=requestAnimationFrame(Ts):(We.value=5,Be.value=95,Le.value="bark-both",ze.value=1,je.value=-1,rt=requestAnimationFrame(Ms)));let Bi=Vue.computed(()=>{if(!s.isProcessing)return null;if(s.connectionState!=="connected")return"disconnected";let S=s.currentConversation;if(s.compactStatus?.conversationId===S&&s.compactStatus?.status==="compacting")return"compacting";let L=s.sessionHealth?.[S];return L?L.status:Te.value&&Ne.value-Te.value>8e3?"thinking":null}),qi=Vue.computed(()=>{if(!Te.value)return"speed-napping";let S=(Ne.value-Te.value)%19e3;return S>=16e3?"speed-petted":S>=14e3?"speed-tired":S>=11500?"speed-crazy":S>=9e3?"speed-turbo":S>=6500?"speed-fast":S>=4e3?"speed-normal":"speed-napping"}),Wi=Vue.computed(()=>{let S=mt.value,L=ht.value,ue={left:`calc(40px + (100% - 80px) * ${S/100})`};return L<0&&(ue.transform="scaleX(-1)"),ue});function Ui(){let S=s.currentConversation;if(!S)return;let L=s.conversations.find(B=>B.id===S);s.sendWsMessage({type:"refresh_conversation",conversationId:S,agentId:L?.agentId})}let ts=()=>{if(!o.value)return!0;let{scrollTop:S,scrollHeight:L,clientHeight:B}=o.value;return ws({scrollTop:S,scrollHeight:L,clientHeight:B,threshold:J})},Ds=(S,{allowContinuation:L=!1}={})=>{if(S>he){fe=!0;return}L&&(fe=!0),!(!fe||!mn())&&(fe=!1,hn())},zi=S=>{if(!S)return"";let B=(Array.isArray(S.items)?S.items:[])[0]||null;return[S.type||"",S.messageId||"",S.turnId||"",S.vpId||"",B?.id||"",B?.turnId||"",B?.messageId||""].join(":")},ss=()=>{let S=me.value||[];return{blockCount:S.length,firstBlockIdentity:zi(S[0])}},ji=(S,L)=>!S||!L?!1:L.blockCount>S.blockCount||L.firstBlockIdentity!==S.firstBlockIdentity,_s=S=>{Vue.nextTick(()=>{if(!o.value)return;let L=ss();ji(S,L)&&Ds(o.value.scrollTop||0,{allowContinuation:!0})})},No=({scrollTop:S,scrollHeight:L,clientHeight:B})=>{let ue=ws({scrollTop:S,scrollHeight:L,clientHeight:B,threshold:J});return we.value=ue,W.value=!ue,ue},Rt=()=>{W.value=!1,we.value=!0},Ki=({scrollTop:S,scrollHeight:L,clientHeight:B})=>{let ue=ws({scrollTop:S||0,scrollHeight:L||0,clientHeight:B||0,threshold:J});we.value=no({following:!W.value,atBottom:ue}),W.value=!we.value,Ds(S||0)},Gi=(S,L)=>{let B=ss();if(!o.value){S(),_s(B);return}let ue=o.value.scrollHeight,be=o.value.scrollTop,ae=!1,De=null,Ue=()=>{ae||(ae=!0,De&&De(),Vue.nextTick(()=>{if(!o.value)return;let ye=o.value.scrollHeight;o.value.scrollTop=ye-ue+be,_s(B)}))};L&&(De=Vue.watch(L,ye=>{ye||Ue()})),S(),Vue.nextTick(()=>{(!L||!L())&&Ue()})},Yi=()=>{if(s.hasHiddenYeaftMessages){s.expandYeaftMessageWindow();return}s.loadMoreYeaftHistory()},mn=()=>s.currentView==="yeaft"?s.hasHiddenYeaftMessages||s.yeaftHasMoreHistory&&!s.yeaftLoadingMoreHistory&&s.yeaftOldestLoadedSeq!=null:!!s.currentConversation&&s.hasMoreMessages&&!s.loadingMoreMessages,hn=()=>{if(!mn())return;let S=s.currentView==="yeaft";Gi(S?Yi:()=>s.loadMoreMessages(),S?()=>s.yeaftLoadingMoreHistory:()=>s.loadingMoreMessages)},Lt=!1,Es=!1,ot=null,$t=250,At=()=>{Lt=!1,ot&&(clearTimeout(ot),ot=null)},Rs=()=>{Es||(ot&&clearTimeout(ot),ot=setTimeout(At,$t))},Vt=()=>{Lt=!0,Rs()},vn=S=>{hd(S,o.value)&&(Es=!0,Lt=!0,ot&&(clearTimeout(ot),ot=null))},ns=()=>{Es=!1,Rs()},is=S=>{vd(S,o.value)&&Vt()},yn=()=>{we.value=no({following:!W.value,atBottom:ts(),userScroll:Lt}),W.value=!we.value,we.value&&Ls(),Lt&&Rs(),o.value&&Ds(o.value.scrollTop||0)},Ls=()=>{s.currentView==="yeaft"&&s.pruneYeaftMessageWindow()},rs=()=>{o.value&&(o.value.scrollTop=o.value.scrollHeight,Rt(),Ls())},Qi=()=>{Rt(),Vue.nextTick(rs)},bn=()=>{!W.value&&we.value&&(Ls(),Vue.nextTick(rs))},os=S=>{if(!S)return"";if(Array.isArray(S.items))return S.items.map(os).join(",");let L=S.message||{};return[S.type||"",S.id||"",S.atMessageId||"",S.turnId||"",S.messageId||"",S.speakerVpId||"",L.id||"",L.content?String(L.content).length:0,S.textContent?String(S.textContent).length:0,S.isStreaming||L.isStreaming?"streaming":"done"].join(":")},$s=Vue.computed(()=>{let S=me.value||[];return[s.activeConversationId||"",q.value||"",S.length,os(S[S.length-1])].join("|")});Vue.watch(()=>[s.currentConversation,D.value.length,n.token],()=>{let S=n.token||"";S!==ie&&(ie=S,Y()),h()},{immediate:!0}),Vue.watch($s,bn),Vue.watch(es,S=>{S&&bn()}),Vue.watch(()=>[s.activeConversationId,q.value],()=>{for(let S of Object.keys(l))delete l[S];for(let S of Object.keys(c))delete c[S];for(let S of Object.keys(d))delete d[S];Rt(),Vue.nextTick(rs)});let Ft=Vue.ref(null),Vs=0;return t({revealMessage:async S=>S?await Td({blocks:me.value,messageId:S,collapseStates:d,nextTick:Vue.nextTick,scrollToBlock:B=>(Rt(),W.value=!0,we.value=!1,a.value?.scrollToKey?.(B,{align:"center"})),findRow:B=>{let ue=o.value?.querySelectorAll?.("[data-msg-id]")||[];return Array.from(ue).find(be=>be?.dataset?.msgId===B)||null},flashRow:B=>{let ue=++Vs;Ft.value=B,setTimeout(()=>{ue===Vs&&(Ft.value=null)},1800)}}):!1}),Vue.onMounted(()=>{rs(),o.value&&(o.value.addEventListener("wheel",Vt,{passive:!0}),o.value.addEventListener("touchmove",Vt,{passive:!0}),o.value.addEventListener("pointerdown",vn,{passive:!0}),o.value.addEventListener("scroll",yn)),window.addEventListener("pointerup",ns,{passive:!0}),window.addEventListener("pointercancel",ns,{passive:!0}),window.addEventListener("keydown",is)}),Vue.onUnmounted(()=>{o.value&&(o.value.removeEventListener("wheel",Vt),o.value.removeEventListener("touchmove",Vt),o.value.removeEventListener("pointerdown",vn),o.value.removeEventListener("scroll",yn)),window.removeEventListener("pointerup",ns),window.removeEventListener("pointercancel",ns),window.removeEventListener("keydown",is),At(),Fe&&(clearInterval(Fe),Fe=null),Ge&&(clearTimeout(Ge),Ge=null),Je&&(cancelAnimationFrame(Je),Je=null),rt&&(cancelAnimationFrame(rt),rt=null)}),{store:s,containerRef:o,virtualTranscriptRef:a,flashMsgId:Ft,hasStreamingMessage:Re,nowMs:pe,showTypingDots:Z,showInitialMessagesLoading:Ve,showSessionLoadingOverlay:V,initialMessagesLoadingText:He,previewShowTypingDots:es,isPreviewMode:It,waitingStatus:Bi,animationType:ut,catSpeed:qi,catStyle:Wi,dogPhase:Le,spikeTransform:Vi,teddyTransform:Fi,leashPathL:Ke,leashPathR:Oi,leashOpacityL:et,leashOpacityR:gn,questionLX:Hi,questionRX:Ni,refreshSession:Ui,onlineAgents:D,welcomeInstallCommand:G,welcomeLlmCommand:ee,welcomeServiceCommand:re,welcomeSetupLoading:T,welcomeSetupError:N,copyWelcomeCommand:_,turnGroups:ne,messageBlocks:me,virtualTranscriptIdentity:$,estimateMessageBlockHeight:v,visibleItemsForBlock:y,collapsedResponsePreviewLines:A,collapsedResponsePreviewSpeaker:x,responseToggleBelongsToItem:b,showBlockResponseToggle:m,toggleMessageTurnResponse:w,responseCollapseLabel:E,turnUiKey:u,assistantTurnActionsExpandedFor:p,setAssistantTurnActionsExpanded:f,toolExpandStates:c,setToolExpanded:g,cardsForRow:te,orphanCards:Q,subAgentCardsForRow:se,orphanSubAgentCards:oe,useImStyleForUser:P,onClickLoadMore:hn,onVirtualTranscriptScrollState:Ki,isAtBottom:we,scrollToLatest:Qi}}}});function ci(...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 _d(e,t,s){let n=t?e?.slashCommandsMap?.[t]:null;return e?.currentView==="yeaft"?ci(n):ci(n,s?e?.slashCommandsMap?.[`agent:${s}`]:null,e?.slashCommandsMap?.__preload__)}function pm(e,t={},s=new Set){if(um.has(e)||Object.prototype.hasOwnProperty.call(li,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 Ed(e,t={}){if(ai[e])return ai[e];if(li[e])return li[e];let s=e.startsWith("/")?e.slice(1):e;return t[s]?t[s]:fm(s)}function fm(e){return(e.includes(":")?e.split(":").pop():e).replace(/-/g," ").replace(/^\w/,s=>s.toUpperCase())}function Rd(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)),i={};e.forEach((o,a)=>{let l=pm(o.cmd,o.descriptions||o.dynamicDescriptions||t,n);i[l]||(i[l]=[]),i[l].push({...o,flatIndex:a})});let r=Object.keys(i).sort((o,a)=>(Md[o]??99)-(Md[a]??99));return r.map((o,a)=>({label:gm[o]||o,items:i[o],isLast:a===r.length-1}))}var ai,um,Pd,li,Dd,gm,Md,Ld=O(()=>{ai={"/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"},um=new Set(Object.keys(ai)),Pd=Object.keys(ai),li={"/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"},Dd=Object.keys(li);gm={skill:"Skills",builtin:"Built-in",project:"Commands"},Md={skill:0,project:1,builtin:2}});function ym(e){return!(!e||typeof e!="string"||e.length<1||e.length>40||e.startsWith("_")||hm.test(e)||mm.has(e.toLowerCase()))}function di(e){if(!e||typeof e!="string")return{text:e||"",mentions:[]};let t=new Set;$d.lastIndex=0;let s;for(;(s=$d.exec(e))!==null;){let n=s[2];if(ym(n)&&!t.has(n)&&(t.add(n),t.size>=vm))break}return{text:e,mentions:Array.from(t)}}var mm,$d,hm,vm,ao=O(()=>{mm=new Set(["all","user","system","everyone"]),$d=/(^|[\s\p{P}])@([A-Za-z0-9_-]{1,40})(?=$|[\s\p{P}])/gu,hm=/^[0-9]+$/,vm=32});function Vd(e){let t=typeof e?.vpId=="string"?e.vpId:"";return lo.has(t)?lo.get(t):e?.isStock===!0?"other":"custom"}function Kt(e){let t=new Map(ui.map(s=>[s.id,[]]));for(let s of Array.isArray(e)?e:[])!s||typeof s.vpId!="string"||!s.vpId||t.get(Vd(s)).push(s);return ui.map(s=>({id:s.id,labelKey:s.labelKey,vps:t.get(s.id)})).filter(s=>s.vps.length>0)}function rn(e){return Kt(e).flatMap(t=>t.vps)}function Fd(e){let t=new Map(ui.map(i=>[i.id,i])),s=new Map,n=[];for(let i of Array.isArray(e)?e:[]){if(!i||typeof i.vpId!="string"||!i.vpId)continue;let r=Vd(i),o=n[n.length-1];if(o&&o.id===r){o.vps.push(i);continue}let a=(s.get(r)||0)+1;s.set(r,a),n.push({id:r,key:`${r}-${a}`,labelKey:t.get(r).labelKey,vps:[i]})}return n}var bm,ui,lo,on=O(()=>{bm=[{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:[]}],ui=Object.freeze(bm.map(e=>Object.freeze({id:e.id,labelKey:e.labelKey,vpIds:Object.freeze([...e.vpIds])}))),lo=new Map;for(let e of ui)for(let t of e.vpIds)lo.set(t,e.id)});function co(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 rn(c).slice(0,Od)}let i=[],r=[],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,i);continue}let u=Array.isArray(c.aliases)?c.aliases:[],p=!1;for(let k of u){let b=String(k||"").toLowerCase();if(b&&b.startsWith(n)){p=!0;break}}if(p){l(c,r);continue}let f=String(c.displayName||"").toLowerCase(),g=String(c.displayNameZh||""),v=[c.description,c.descriptionZh,c.role,c.roleZh].map(k=>String(k||"").toLowerCase()),y=typeof t=="string"?t:"",A=f.includes(n)||y&&g.includes(y),x=n&&v.some(k=>k.includes(n));(A||x)&&l(c,o)}return[...rn(i),...rn(r),...rn(o)].slice(0,Od)}function uo(e="chat-input"){return`${e}-vp-mention-listbox`}function po(e,t){let s=String(t||"").replace(/[^A-Za-z0-9_.:-]/g,"-");return`${e}-vp-mention-option-${s}`}function wm(e){let t=0;return Fd(e).map(s=>({...s,items:s.vps.map(n=>({vp:n,flatIndex:t++}))}))}function Hd(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 i=new Set(n);return s.filter(r=>r&&r.vpId&&i.has(r.vpId))}function Nd(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 Od,Bd,qd=O(()=>{on();Od=12;Bd={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:`
|
|
1591
|
+
`,emits:["new-conversation","resume-conversation","open-settings"],setup(e,{expose:t}){let s=Pinia.useChatStore(),n=Ae(),i=typeof window<"u"&&window.Pinia?.useVpStore?window.Pinia.useVpStore():null,r=Vue.inject("t",null),o=Vue.ref(null),a=Vue.ref(null),l=Vue.reactive({}),c=Vue.reactive({}),d=Vue.reactive({}),u=S=>String(S?.id||S?.turnId||S?.messageId||S?.atMessageId||S?.message?.id||"turn_unknown"),p=S=>{let L=u(S);return Object.prototype.hasOwnProperty.call(l,L)?!!l[L]:!1},f=(S,L)=>{l[u(S)]=!!L},g=({key:S,value:L}={})=>{S&&(c[S]=!!L)},b=S=>{let L=Id(S,Mt);return Number.isFinite(L)?L:Mt(S)},h=S=>ri(S),A=S=>{let L=Array.isArray(S?.collapsedResponsePreview)?S.collapsedResponsePreview:Cd(S);return Array.isArray(L)?L:L?[String(L)]:[]},x=S=>{let L=Array.isArray(S?.items)?S.items.find(ye=>nn(ye)):null,B=L?.speakerVpId||L?.vpId||L?.message?.speakerVpId||L?.message?.vpId||S?.vpId||"",ue=B&&i&&typeof i.vpLabel=="function"?i.vpLabel(B)||B:B||(typeof r=="function"?r("message.assistant"):"Assistant"),be=B&&i&&typeof i.vpTextColor=="function"?{color:i.vpTextColor(B)}:{},ae=L?.speakerTimestamp||L?.timestamp||L?.createdAt||L?.message?.timestamp||L?.message?.createdAt||0,De="",Ue="";if(ae)try{let ye=new Date(ae);Number.isNaN(ye.getTime())||(De=ye.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),Ue=ye.toLocaleString())}catch{}return{name:ue,style:be,timeText:De,fullTimeText:Ue}},k=S=>{let L=Array.isArray(S?.items)?S.items:[];for(let B=L.length-1;B>=0;B-=1)if(nn(L[B]))return L[B];return null},y=(S,L)=>!S?.responseCollapsible||!L?!1:k(S)===L,m=S=>!!(S?.responseCollapsible&&!ri(S).some(L=>y(S,L))),w=S=>{let L=S?.responseCollapseKey;L&&(d[L]=!S.responseCollapsed)},E=S=>{let L=Number(S?.responseCount||0),B=S?.responseCollapsed?"message.showResponses":"message.hideResponses",ue=(typeof r=="function"?r(B):"")||(S?.responseCollapsed?"Show {count} response(s)":"Hide response(s)");return String(ue).replace("{count}",String(L))},R=(()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}}),q=Vue.computed(()=>{if(s.currentView!=="yeaft")return null;let S=R();if(!S)return null;let L=s.yeaftActiveSessionFilter||null;return L&&typeof S.sessionById=="function"&&S.sessionById(L,s.currentAgent||null)?L:S.activeSessionId&&typeof S.sessionById=="function"&&S.sessionById(S.activeSessionId,s.currentAgent||null)?S.activeSessionId:null}),$=Vue.computed(()=>[s.activeConversationId||"",s.currentView||"",s.currentAgent||"",s.currentView==="yeaft"?s.yeaftActiveSessionFilter||q.value||"__all__":""].join("")),P=Vue.computed(()=>q.value!==null),D=Vue.computed(()=>s.agents.filter(S=>S.online)),M=Vue.ref(null),C=Vue.ref(null),T=Vue.ref(!1),N=Vue.ref(""),H=null,U=0,ie=n.token||"",Y=()=>{M.value=null,C.value=null,N.value="",H=null,U+=1},G=Kn(),ee=Gn(),re=Vue.computed(()=>Yn({profile:M.value,agentSecret:C.value,serverWsUrl:Xs(location)})),ge=()=>{let S={"Content-Type":"application/json"};return n.token&&(S.Authorization=`Bearer ${n.token}`),S},v=async()=>{if(D.value.length>0||s.currentConversation)return;if(C.value||H)return H;T.value=!0,N.value="";let S=++U;return H=(async()=>{let L=n.token||"",B=ge(),[ue,be]=await Promise.all([fetch("/api/user/profile",{headers:B}),fetch("/api/user/agent-secret",{headers:B})]),ae=ue.ok?await ue.json():null;if(S!==U||L!==(n.token||""))return;if(ae&&(M.value=ae),!be.ok){let ye="";try{ye=(await be.json())?.error||""}catch{}throw new Error(ye||"Failed to load Agent secret")}let De=await be.json();if(S!==U||L!==(n.token||""))return;let Ue=De?.agentSecret||De?.agent_secret||null;C.value=Ue&&String(Ue).trim()?String(Ue):null})().catch(L=>{S===U&&(N.value=L?.message||"Failed to load Agent secret")}).finally(()=>{S===U&&(T.value=!1,H=null)}),H},_=async S=>{if(S)try{await navigator.clipboard.writeText(S)}catch{}},X=(S,L)=>{let B=S?.message||null,ue=S?.id||S?.atMessageId||B?.id||B?.messageId||`legacy_${L}`,be=S?.speakerVpId||S?.vpId||B?.speakerVpId||B?.vpId||"";return{id:`message_${be||"user"}_${ue}_${L}`,vpId:be,messageId:ue}},ne=Vue.computed(()=>{let S=s.messages,L=[],B=null,ue=0,be=()=>{if(B){let ye=!!(B.textContent||B.todoMsg||B.askMsg||B.imageMsgs.length>0),de=B.toolMsgs.length>0||B.toolSummaryCount>0;(ye||de)&&(B.showSpeakerHeader=!!B.speakerVpId,L.push(B)),B=null}},ae=ye=>{if(B){if(!B.speakerVpId){let de=ye.speakerVpId||ye.vpId;de&&(B.speakerVpId=de,B.speakerTimestamp=typeof ye.timestamp=="number"&&ye.timestamp>0?ye.timestamp:typeof ye.createdAt=="number"?ye.createdAt:0,typeof ye.lastStateChangeCause=="string"&&!B.speakerStateCause&&(B.speakerStateCause=ye.lastStateChangeCause))}!B.turnId&&ye.turnId&&(B.turnId=ye.turnId)}},De=()=>{ue++,B={type:"assistant-turn",id:"turn_"+ue,textContent:"",isStreaming:!1,isHistory:!1,todoMsg:null,toolMsgs:[],toolSummaryCount:0,imageMsgs:[],askMsg:null,messages:[],atMessageId:null,speakerVpId:null,speakerTimestamp:0,speakerStateCause:"",showSpeakerHeader:!1,turnId:null}},Ue=ye=>{wd(B,ye)&&be()};for(let ye=0;ye<S.length;ye++){let de=S[ye];if(de.type==="user"){if(!de.content||!de.content.trim())continue;be(),L.push({type:"user",id:de.id||"u_"+ye,message:de});continue}if(de.type==="system"||de.type==="error"){be(),L.push({type:de.type,id:de.id||"s_"+ye,message:de});continue}if(!(de.type==="tool-result"||de.type==="tool_result")){if(de.type==="tool-summary"){Ue(de),B||De(),ae(de),de.isHistory&&(B.isHistory=!0),B.toolSummaryCount+=Number(de.count||de.omittedCount||0)||0,B.messages.push(de);continue}if(de.type==="assistant"){Ue(de),B||De(),de.content&&(B.textContent+=de.content),de.isStreaming&&(B.isStreaming=!0),de.isHistory&&(B.isHistory=!0),de.id&&/^m\d+$/.test(de.id)&&(B.atMessageId=de.id),ae(de),B.messages.push(de);continue}if(de.type==="tool-use"){Ue(de),B||De(),ae(de);let kn=S[ye+1],Bo=kn&&(kn.type==="tool-result"||kn.type==="tool_result"),Sn={...de,hasResult:Bo||de.hasResult||!1,toolResult:de.toolResult||null};de.isHistory&&(B.isHistory=!0),de.toolName==="TodoWrite"?B.todoMsg=Sn:de.toolName==="AskUserQuestion"?B.askMsg=Sn:B.toolMsgs.push(Sn),B.messages.push(de);continue}if(de.type==="chat-image"){Ue(de),B||De(),ae(de),de.isHistory&&(B.isHistory=!0),B.imageMsgs.push(de),B.messages.push(de);continue}be(),L.push({type:de.type||"unknown",id:de.id||"x_"+ye,message:de})}}return be(),L}),me=Vue.computed(()=>{let S=[],L=null,B=()=>{L&&S.push(L),L=null};return ne.value.forEach((ue,be)=>{if(!ue||ue.type==="system"||ue.type==="error"){B(),S.push(ue);return}let ae=X(ue,be);if(ue.type==="user"||!L){B(),L={type:"message-block",id:`turn_${ae.messageId}_${be}`,vpId:ae.vpId,messageId:ae.messageId,items:[ue]};return}L.items.push(ue),!L.vpId&&ae.vpId&&(L.vpId=ae.vpId)}),B(),S}),Se=Vue.computed(()=>{let S=s.yeaftReflectionCards||{},L=s.yeaftConversationId,B={__orphans:[]},ue=Object.values(S).filter(ae=>ae&&ae.conversationId===L).sort((ae,De)=>(ae.anchorOrder||0)-(De.anchorOrder||0)||(ae.updatedAt||0)-(De.updatedAt||0)),be=new Set;for(let ae of s.messages||[])ae&&ae.id&&be.add(ae.id);for(let ae of ue)ae.anchorMsgId&&be.has(ae.anchorMsgId)?(B[ae.anchorMsgId]||(B[ae.anchorMsgId]=[]),B[ae.anchorMsgId].push(ae)):B.__orphans.push(ae);return B}),Ce=S=>S?S.type==="assistant-turn"?S.atMessageId||null:S.message&&S.message.id||null:null,te=S=>{let L=Ce(S);return L?(Se.value||{})[L]||[]:[]},Q=Vue.computed(()=>(Se.value||{}).__orphans||[]),F=Vue.computed(()=>{let S=s.yeaftSubAgentCards||{},L=s.yeaftConversationId,B={__orphans:[]},ue=Object.values(S).filter(ae=>ae&&ae.conversationId===L).sort((ae,De)=>(ae.anchorOrder||0)-(De.anchorOrder||0)||(ae.updatedAt||0)-(De.updatedAt||0)),be=new Set;for(let ae of s.messages||[])ae&&ae.id&&be.add(ae.id);for(let ae of ue)ae.anchorMsgId&&be.has(ae.anchorMsgId)?(B[ae.anchorMsgId]||(B[ae.anchorMsgId]=[]),B[ae.anchorMsgId].push(ae)):B.__orphans.push(ae);return B}),se=S=>{let L=Ce(S);return L?(F.value||{})[L]||[]:[]},oe=Vue.computed(()=>(F.value||{}).__orphans||[]),we=Vue.ref(!0),W=Vue.ref(!1),J=Pt.bottomThreshold,he=100,fe=!0,Re=Vue.computed(()=>s.messages.some(S=>S.isStreaming)),Ve=Vue.computed(()=>!s.currentConversation||me.value.length>0?!1:s.currentView==="yeaft"?!!s.yeaftLoadingMoreHistory:!!s.sessionLoading),He=Vue.computed(()=>s.sessionLoadingText||""),V=Vue.computed(()=>!!s.sessionLoading&&!Ve.value),Z=Vue.computed(()=>s.isProcessing&&!Re.value),pe=Vue.ref(Date.now()),ce=null,ve=()=>{ce||(ce=setInterval(()=>{pe.value=Date.now()},1e3))},Pe=()=>{ce&&(clearInterval(ce),ce=null)};Vue.watch(Re,S=>{S?(pe.value=Date.now(),ve()):Pe()},{immediate:!0}),Vue.onBeforeUnmount(()=>Pe());let Te=Vue.ref(0),Ne=Vue.ref(Date.now()),Fe=null,Je=null,ut=Vue.ref("cat"),Et=new URLSearchParams(window.location.search).get("preview"),mt=Vue.ref(0),ht=Vue.ref(1),We=Vue.ref(5),Be=Vue.ref(95),Le=Vue.ref("bark-both"),ze=Vue.ref(1),je=Vue.ref(-1),rt=null;function Ts(){if(!Te.value)return;Ne.value=Date.now();let S=(Ne.value-Te.value)%19e3;if(S<4e3)mt.value=0,ht.value=1;else if(S<11500){let L=S-4e3,B;L<2500?B=L/2500*16:L<5e3?B=16+(L-2500)/2500*29:B=45+(L-5e3)/2500*55,mt.value=B,ht.value=1}else S<14e3?(mt.value=(1-(S-11500)/2500)*100,ht.value=-1):(mt.value=0,ht.value=1);Je=requestAnimationFrame(Ts)}function Ms(){if(!Te.value||ut.value!=="dog")return;Ne.value=Date.now();let S=(Ne.value-Te.value)%18e3;if(S<2e3)We.value=5,Be.value=95,Le.value="bark-both",ze.value=1,je.value=-1;else if(S<5e3){let L=(S-2e3)/3e3;We.value=5+L*25,Be.value=95,Le.value="left-approach",ze.value=1,je.value=-1}else if(S<8e3){let L=(S-5e3)/3e3;We.value=30,Be.value=95-L*25,Le.value="right-approach",ze.value=1,je.value=-1}else if(S<1e4){let L=(S-8e3)/2e3;We.value=30+L*13,Be.value=70-L*13,Le.value="both-approach",ze.value=1,je.value=-1}else if(S<11e3)We.value=43,Be.value=57,Le.value="snap",ze.value=1,je.value=-1;else if(S<12500)We.value=43,Be.value=57,Le.value="stunned",ze.value=1,je.value=-1;else if(S<15e3){let L=(S-12500)/2500;We.value=43-L*38,Be.value=57+L*38,Le.value="retreat",ze.value=-1,je.value=1}else S<17e3?(We.value=5,Be.value=95,Le.value="rehang",ze.value=-1,je.value=1):(We.value=5,Be.value=95,Le.value="reset",ze.value=1,je.value=-1);rt=requestAnimationFrame(Ms)}let Vi=Vue.computed(()=>{let S=We.value*1.2;return ze.value<0?`translate(${S+13.5}, 0) scale(-1, 1)`:`translate(${S-13.5}, 0)`}),Fi=Vue.computed(()=>{let S=Be.value*1.2;return je.value>0?`translate(${S-10.5}, 2)`:`translate(${S+10.5}, 2) scale(-1, 1)`}),fn=Vue.computed(()=>{let S=Le.value;return S==="bark-both"||S==="left-approach"||S==="right-approach"||S==="both-approach"||S==="reset"}),Ke=Vue.computed(()=>{let S=We.value*1.2,L=10;if(fn.value){let be=Math.max(0,(S-3)*.12);return`M3,18 Q${(3+S)/2},${18+be} ${S},${L}`}if(Le.value==="rehang")return`M${S},${L} Q${S-3},20 3,18`;let B=ze.value<0?1:-1,ue=S+B*8;return`M${S},${L} Q${S},18 ${ue},22`}),Oi=Vue.computed(()=>{let S=Be.value*1.2,L=10;if(fn.value){let be=Math.max(0,(118-S)*.12);return`M118,18 Q${(118+S)/2},${18+be} ${S},${L}`}if(Le.value==="rehang")return`M${S},${L} Q${S+3},20 118,18`;let B=je.value>0?-1:1,ue=S+B*8;return`M${S},${L} Q${S},18 ${ue},22`}),et=Vue.computed(()=>Le.value==="snap"?.2:.4),gn=Vue.computed(()=>Le.value==="snap"?.2:.4),Hi=Vue.computed(()=>We.value*1.2),Ni=Vue.computed(()=>Be.value*1.2),It=Et==="cat"||Et==="dog"||Et==="animation",Ps=600,Jt=Vue.ref(!1),Ge=null,es=Vue.computed(()=>It?!0:Jt.value);Vue.watch(Z,S=>{if(S)Ge&&(clearTimeout(Ge),Ge=null),Jt.value=!0,Te.value=Date.now(),Ne.value=Date.now(),ut.value="cat",mt.value=0,ht.value=1,We.value=5,Be.value=95,Le.value="bark-both",ze.value=1,je.value=-1,ut.value==="cat"?Je=requestAnimationFrame(Ts):rt=requestAnimationFrame(Ms);else{let L=Te.value?Date.now()-Te.value:Ps,B=Math.max(0,Ps-L),ue=()=>{Ge=null,Jt.value=!1,Te.value=0,mt.value=0,ht.value=1,Je&&(cancelAnimationFrame(Je),Je=null),rt&&(cancelAnimationFrame(rt),rt=null)};B===0?ue():(Ge&&clearTimeout(Ge),Ge=setTimeout(ue,B))}},{immediate:!0}),It&&(Te.value=Date.now(),Ne.value=Date.now(),Et==="dog"?ut.value="dog":ut.value="cat",ut.value==="cat"?Je=requestAnimationFrame(Ts):(We.value=5,Be.value=95,Le.value="bark-both",ze.value=1,je.value=-1,rt=requestAnimationFrame(Ms)));let Bi=Vue.computed(()=>{if(!s.isProcessing)return null;if(s.connectionState!=="connected")return"disconnected";let S=s.currentConversation;if(s.compactStatus?.conversationId===S&&s.compactStatus?.status==="compacting")return"compacting";let L=s.sessionHealth?.[S];return L?L.status:Te.value&&Ne.value-Te.value>8e3?"thinking":null}),qi=Vue.computed(()=>{if(!Te.value)return"speed-napping";let S=(Ne.value-Te.value)%19e3;return S>=16e3?"speed-petted":S>=14e3?"speed-tired":S>=11500?"speed-crazy":S>=9e3?"speed-turbo":S>=6500?"speed-fast":S>=4e3?"speed-normal":"speed-napping"}),Wi=Vue.computed(()=>{let S=mt.value,L=ht.value,ue={left:`calc(40px + (100% - 80px) * ${S/100})`};return L<0&&(ue.transform="scaleX(-1)"),ue});function Ui(){let S=s.currentConversation;if(!S)return;let L=s.conversations.find(B=>B.id===S);s.sendWsMessage({type:"refresh_conversation",conversationId:S,agentId:L?.agentId})}let ts=()=>{if(!o.value)return!0;let{scrollTop:S,scrollHeight:L,clientHeight:B}=o.value;return ws({scrollTop:S,scrollHeight:L,clientHeight:B,threshold:J})},Ds=(S,{allowContinuation:L=!1}={})=>{if(S>he){fe=!0;return}L&&(fe=!0),!(!fe||!mn())&&(fe=!1,hn())},zi=S=>{if(!S)return"";let B=(Array.isArray(S.items)?S.items:[])[0]||null;return[S.type||"",S.messageId||"",S.turnId||"",S.vpId||"",B?.id||"",B?.turnId||"",B?.messageId||""].join(":")},ss=()=>{let S=me.value||[];return{blockCount:S.length,firstBlockIdentity:zi(S[0])}},ji=(S,L)=>!S||!L?!1:L.blockCount>S.blockCount||L.firstBlockIdentity!==S.firstBlockIdentity,_s=S=>{Vue.nextTick(()=>{if(!o.value)return;let L=ss();ji(S,L)&&Ds(o.value.scrollTop||0,{allowContinuation:!0})})},No=({scrollTop:S,scrollHeight:L,clientHeight:B})=>{let ue=ws({scrollTop:S,scrollHeight:L,clientHeight:B,threshold:J});return we.value=ue,W.value=!ue,ue},Rt=()=>{W.value=!1,we.value=!0},Ki=({scrollTop:S,scrollHeight:L,clientHeight:B})=>{let ue=ws({scrollTop:S||0,scrollHeight:L||0,clientHeight:B||0,threshold:J});we.value=no({following:!W.value,atBottom:ue}),W.value=!we.value,Ds(S||0)},Gi=(S,L)=>{let B=ss();if(!o.value){S(),_s(B);return}let ue=o.value.scrollHeight,be=o.value.scrollTop,ae=!1,De=null,Ue=()=>{ae||(ae=!0,De&&De(),Vue.nextTick(()=>{if(!o.value)return;let ye=o.value.scrollHeight;o.value.scrollTop=ye-ue+be,_s(B)}))};L&&(De=Vue.watch(L,ye=>{ye||Ue()})),S(),Vue.nextTick(()=>{(!L||!L())&&Ue()})},Yi=()=>{if(s.hasHiddenYeaftMessages){s.expandYeaftMessageWindow();return}s.loadMoreYeaftHistory()},mn=()=>s.currentView==="yeaft"?s.hasHiddenYeaftMessages||s.yeaftHasMoreHistory&&!s.yeaftLoadingMoreHistory&&s.yeaftOldestLoadedSeq!=null:!!s.currentConversation&&s.hasMoreMessages&&!s.loadingMoreMessages,hn=()=>{if(!mn())return;let S=s.currentView==="yeaft";Gi(S?Yi:()=>s.loadMoreMessages(),S?()=>s.yeaftLoadingMoreHistory:()=>s.loadingMoreMessages)},Lt=!1,Es=!1,ot=null,$t=250,At=()=>{Lt=!1,ot&&(clearTimeout(ot),ot=null)},Rs=()=>{Es||(ot&&clearTimeout(ot),ot=setTimeout(At,$t))},Vt=()=>{Lt=!0,Rs()},vn=S=>{hd(S,o.value)&&(Es=!0,Lt=!0,ot&&(clearTimeout(ot),ot=null))},ns=()=>{Es=!1,Rs()},is=S=>{vd(S,o.value)&&Vt()},yn=()=>{we.value=no({following:!W.value,atBottom:ts(),userScroll:Lt}),W.value=!we.value,we.value&&Ls(),Lt&&Rs(),o.value&&Ds(o.value.scrollTop||0)},Ls=()=>{s.currentView==="yeaft"&&s.pruneYeaftMessageWindow()},rs=()=>{o.value&&(o.value.scrollTop=o.value.scrollHeight,Rt(),Ls())},Qi=()=>{Rt(),Vue.nextTick(rs)},bn=()=>{!W.value&&we.value&&(Ls(),Vue.nextTick(rs))},os=S=>{if(!S)return"";if(Array.isArray(S.items))return S.items.map(os).join(",");let L=S.message||{};return[S.type||"",S.id||"",S.atMessageId||"",S.turnId||"",S.messageId||"",S.speakerVpId||"",L.id||"",L.content?String(L.content).length:0,S.textContent?String(S.textContent).length:0,S.isStreaming||L.isStreaming?"streaming":"done"].join(":")},$s=Vue.computed(()=>{let S=me.value||[];return[s.activeConversationId||"",q.value||"",S.length,os(S[S.length-1])].join("|")});Vue.watch(()=>[s.currentConversation,D.value.length,n.token],()=>{let S=n.token||"";S!==ie&&(ie=S,Y()),v()},{immediate:!0}),Vue.watch($s,bn),Vue.watch(es,S=>{S&&bn()}),Vue.watch(()=>[s.activeConversationId,q.value],()=>{for(let S of Object.keys(l))delete l[S];for(let S of Object.keys(c))delete c[S];for(let S of Object.keys(d))delete d[S];Rt(),Vue.nextTick(rs)});let Ft=Vue.ref(null),Vs=0;return t({revealMessage:async S=>S?await Td({blocks:me.value,messageId:S,collapseStates:d,nextTick:Vue.nextTick,scrollToBlock:B=>(Rt(),W.value=!0,we.value=!1,a.value?.scrollToKey?.(B,{align:"center"})),findRow:B=>{let ue=o.value?.querySelectorAll?.("[data-msg-id]")||[];return Array.from(ue).find(be=>be?.dataset?.msgId===B)||null},flashRow:B=>{let ue=++Vs;Ft.value=B,setTimeout(()=>{ue===Vs&&(Ft.value=null)},1800)}}):!1}),Vue.onMounted(()=>{rs(),o.value&&(o.value.addEventListener("wheel",Vt,{passive:!0}),o.value.addEventListener("touchmove",Vt,{passive:!0}),o.value.addEventListener("pointerdown",vn,{passive:!0}),o.value.addEventListener("scroll",yn)),window.addEventListener("pointerup",ns,{passive:!0}),window.addEventListener("pointercancel",ns,{passive:!0}),window.addEventListener("keydown",is)}),Vue.onUnmounted(()=>{o.value&&(o.value.removeEventListener("wheel",Vt),o.value.removeEventListener("touchmove",Vt),o.value.removeEventListener("pointerdown",vn),o.value.removeEventListener("scroll",yn)),window.removeEventListener("pointerup",ns),window.removeEventListener("pointercancel",ns),window.removeEventListener("keydown",is),At(),Fe&&(clearInterval(Fe),Fe=null),Ge&&(clearTimeout(Ge),Ge=null),Je&&(cancelAnimationFrame(Je),Je=null),rt&&(cancelAnimationFrame(rt),rt=null)}),{store:s,containerRef:o,virtualTranscriptRef:a,flashMsgId:Ft,hasStreamingMessage:Re,nowMs:pe,showTypingDots:Z,showInitialMessagesLoading:Ve,showSessionLoadingOverlay:V,initialMessagesLoadingText:He,previewShowTypingDots:es,isPreviewMode:It,waitingStatus:Bi,animationType:ut,catSpeed:qi,catStyle:Wi,dogPhase:Le,spikeTransform:Vi,teddyTransform:Fi,leashPathL:Ke,leashPathR:Oi,leashOpacityL:et,leashOpacityR:gn,questionLX:Hi,questionRX:Ni,refreshSession:Ui,onlineAgents:D,welcomeInstallCommand:G,welcomeLlmCommand:ee,welcomeServiceCommand:re,welcomeSetupLoading:T,welcomeSetupError:N,copyWelcomeCommand:_,turnGroups:ne,messageBlocks:me,virtualTranscriptIdentity:$,estimateMessageBlockHeight:b,visibleItemsForBlock:h,collapsedResponsePreviewLines:A,collapsedResponsePreviewSpeaker:x,responseToggleBelongsToItem:y,showBlockResponseToggle:m,toggleMessageTurnResponse:w,responseCollapseLabel:E,turnUiKey:u,assistantTurnActionsExpandedFor:p,setAssistantTurnActionsExpanded:f,toolExpandStates:c,setToolExpanded:g,cardsForRow:te,orphanCards:Q,subAgentCardsForRow:se,orphanSubAgentCards:oe,useImStyleForUser:P,onClickLoadMore:hn,onVirtualTranscriptScrollState:Ki,isAtBottom:we,scrollToLatest:Qi}}}});function ci(...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 _d(e,t,s){let n=t?e?.slashCommandsMap?.[t]:null;return e?.currentView==="yeaft"?ci(n):ci(n,s?e?.slashCommandsMap?.[`agent:${s}`]:null,e?.slashCommandsMap?.__preload__)}function fm(e,t={},s=new Set){if(pm.has(e)||Object.prototype.hasOwnProperty.call(li,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 Ed(e,t={}){if(ai[e])return ai[e];if(li[e])return li[e];let s=e.startsWith("/")?e.slice(1):e;return t[s]?t[s]:gm(s)}function gm(e){return(e.includes(":")?e.split(":").pop():e).replace(/-/g," ").replace(/^\w/,s=>s.toUpperCase())}function Rd(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)),i={};e.forEach((o,a)=>{let l=fm(o.cmd,o.descriptions||o.dynamicDescriptions||t,n);i[l]||(i[l]=[]),i[l].push({...o,flatIndex:a})});let r=Object.keys(i).sort((o,a)=>(Md[o]??99)-(Md[a]??99));return r.map((o,a)=>({label:mm[o]||o,items:i[o],isLast:a===r.length-1}))}var ai,pm,Pd,li,Dd,mm,Md,Ld=O(()=>{ai={"/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"},pm=new Set(Object.keys(ai)),Pd=Object.keys(ai),li={"/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"},Dd=Object.keys(li);mm={skill:"Skills",builtin:"Built-in",project:"Commands"},Md={skill:0,project:1,builtin:2}});function bm(e){return!(!e||typeof e!="string"||e.length<1||e.length>40||e.startsWith("_")||vm.test(e)||hm.has(e.toLowerCase()))}function di(e){if(!e||typeof e!="string")return{text:e||"",mentions:[]};let t=new Set;$d.lastIndex=0;let s;for(;(s=$d.exec(e))!==null;){let n=s[2];if(bm(n)&&!t.has(n)&&(t.add(n),t.size>=ym))break}return{text:e,mentions:Array.from(t)}}var hm,$d,vm,ym,ao=O(()=>{hm=new Set(["all","user","system","everyone"]),$d=/(^|[\s\p{P}])@([A-Za-z0-9_-]{1,40})(?=$|[\s\p{P}])/gu,vm=/^[0-9]+$/,ym=32});function Vd(e){let t=typeof e?.vpId=="string"?e.vpId:"";return lo.has(t)?lo.get(t):e?.isStock===!0?"other":"custom"}function Kt(e){let t=new Map(ui.map(s=>[s.id,[]]));for(let s of Array.isArray(e)?e:[])!s||typeof s.vpId!="string"||!s.vpId||t.get(Vd(s)).push(s);return ui.map(s=>({id:s.id,labelKey:s.labelKey,vps:t.get(s.id)})).filter(s=>s.vps.length>0)}function rn(e){return Kt(e).flatMap(t=>t.vps)}function Fd(e){let t=new Map(ui.map(i=>[i.id,i])),s=new Map,n=[];for(let i of Array.isArray(e)?e:[]){if(!i||typeof i.vpId!="string"||!i.vpId)continue;let r=Vd(i),o=n[n.length-1];if(o&&o.id===r){o.vps.push(i);continue}let a=(s.get(r)||0)+1;s.set(r,a),n.push({id:r,key:`${r}-${a}`,labelKey:t.get(r).labelKey,vps:[i]})}return n}var wm,ui,lo,on=O(()=>{wm=[{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:[]}],ui=Object.freeze(wm.map(e=>Object.freeze({id:e.id,labelKey:e.labelKey,vpIds:Object.freeze([...e.vpIds])}))),lo=new Map;for(let e of ui)for(let t of e.vpIds)lo.set(t,e.id)});function co(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 rn(c).slice(0,Od)}let i=[],r=[],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,i);continue}let u=Array.isArray(c.aliases)?c.aliases:[],p=!1;for(let k of u){let y=String(k||"").toLowerCase();if(y&&y.startsWith(n)){p=!0;break}}if(p){l(c,r);continue}let f=String(c.displayName||"").toLowerCase(),g=String(c.displayNameZh||""),b=[c.description,c.descriptionZh,c.role,c.roleZh].map(k=>String(k||"").toLowerCase()),h=typeof t=="string"?t:"",A=f.includes(n)||h&&g.includes(h),x=n&&b.some(k=>k.includes(n));(A||x)&&l(c,o)}return[...rn(i),...rn(r),...rn(o)].slice(0,Od)}function uo(e="chat-input"){return`${e}-vp-mention-listbox`}function po(e,t){let s=String(t||"").replace(/[^A-Za-z0-9_.:-]/g,"-");return`${e}-vp-mention-option-${s}`}function km(e){let t=0;return Fd(e).map(s=>({...s,items:s.vps.map(n=>({vp:n,flatIndex:t++}))}))}function Hd(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 i=new Set(n);return s.filter(r=>r&&r.vpId&&i.has(r.vpId))}function Nd(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 Od,Bd,qd=O(()=>{on();Od=12;Bd={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:`
|
|
1592
1592
|
<div
|
|
1593
1593
|
class="slash-autocomplete vp-mention-autocomplete"
|
|
1594
1594
|
v-if="filteredList.length > 0"
|
|
@@ -1625,7 +1625,7 @@ ${String(e||"").trim()}
|
|
|
1625
1625
|
</div>
|
|
1626
1626
|
</div>
|
|
1627
1627
|
</div>
|
|
1628
|
-
`,setup(e){let t=Vue.computed(()=>co(e.vps,e.query)),s=Vue.computed(()=>
|
|
1628
|
+
`,setup(e){let t=Vue.computed(()=>co(e.vps,e.query)),s=Vue.computed(()=>km(t.value)),n=Vue.computed(()=>uo(e.inputId)),i=u=>po(e.inputId,u),r=u=>`${n.value}-domain-${u}`,o=typeof window<"u"&&window.Pinia&&window.Pinia.useChatStore?window.Pinia.useChatStore():null,a=typeof window<"u"&&window.Pinia&&window.Pinia.useVpStore?window.Pinia.useVpStore():null;function l(u){return u?(o&&typeof o.locale=="string"?o.locale:typeof localStorage<"u"&&localStorage.getItem("locale")||"").startsWith("zh")&&u.displayNameZh?u.displayNameZh:u.displayName||u.vpId||"":""}function c(u){return u?a&&typeof a.vpDescription=="function"?a.vpDescription(u.vpId):(o&&typeof o.locale=="string"?o.locale:"").startsWith("zh")?u.descriptionZh||u.roleZh||u.description||u.role||"":u.description||u.role||u.descriptionZh||u.roleZh||"":""}function d(u){return a&&typeof a.vpTextColor=="function"?a.vpTextColor(u):"var(--text-primary)"}return{filteredList:t,domainSections:s,listboxId:n,optionId:i,domainLabelId:r,displayNameFor:l,descriptionFor:c,vpTextColorFor:d}}}});var ks,pi=O(()=>{Ld();js();ao();qd();ks={name:"ChatInput",components:{VpMentionAutocomplete:Bd},props:{sendFn:{type:Function,default:null},cancelFn:{type:Function,default:null},placeholderKey:{type:String,default:""},showStop:{type:Boolean,default:!1},conversationId:{type:String,default:null},draftKey:{type:String,default:null},workItemFn:{type:Function,default:null}},template:`
|
|
1629
1629
|
<footer class="input-area" ref="inputAreaRef">
|
|
1630
1630
|
<!-- Expert chips bar (above attachments) \u2014 hidden in custom send mode and btw mode -->
|
|
1631
1631
|
<div class="expert-chips-bar" v-if="!sendFn && !store.btwMode && expertSelections.length > 0">
|
|
@@ -1752,8 +1752,8 @@ ${String(e||"").trim()}
|
|
|
1752
1752
|
</button>
|
|
1753
1753
|
</div>
|
|
1754
1754
|
</footer>
|
|
1755
|
-
`,setup(e){let t=Pinia.useChatStore(),s=Pinia.useAuthStore(),n=Pinia.useVpStore(),i=Pinia.useSessionsStore?Pinia.useSessionsStore():null,r=Vue.ref(""),o=Vue.ref(null),l=`chat-input-${Vue.getCurrentInstance()?.uid??0}`,c=Vue.ref(null),d=Vue.ref([]),u=Vue.ref(!1),p=Vue.ref(null),f=Vue.ref(null),g=Vue.ref(null),
|
|
1756
|
-
`||pe===0?M()?(P.value=!0,D.value=0,
|
|
1755
|
+
`,setup(e){let t=Pinia.useChatStore(),s=Pinia.useAuthStore(),n=Pinia.useVpStore(),i=Pinia.useSessionsStore?Pinia.useSessionsStore():null,r=Vue.ref(""),o=Vue.ref(null),l=`chat-input-${Vue.getCurrentInstance()?.uid??0}`,c=Vue.ref(null),d=Vue.ref([]),u=Vue.ref(!1),p=Vue.ref(null),f=Vue.ref(null),g=Vue.ref(null),b=Vue.computed(()=>!!e.sendFn),h=Vue.computed(()=>!t.btwMode),A=Vue.computed(()=>e.placeholderKey||"chatInput.placeholder"),x=Vue.computed(()=>e.showStop||!b.value&&t.isProcessing),k=Vue.computed({get:()=>t.expertSelections||[],set:V=>{t.expertSelections=V}}),y=Vue.ref(!1),m=Vue.ref(0),w=Vue.computed(()=>ol(t.customExpertRoles)),E=Vue.computed(()=>{let V=r.value,Z=V.lastIndexOf("@");if(Z===-1||!y.value)return[];let pe=V.slice(Z+1).toLowerCase();return w.value.filter(ce=>pe?ce.searchText.includes(pe):!0).filter(ce=>!k.value.some(ve=>ve.role===ce.roleId)).slice(0,12)}),R=V=>{if(k.value.length>=Wt)return;let Z={role:V.roleId,action:V.actionId};t.expertSelections=[...k.value,Z];let pe=r.value,ce=pe.lastIndexOf("@");ce!==-1&&(r.value=pe.slice(0,ce).trimEnd()),y.value=!1,Vue.nextTick(()=>o.value?.focus())},q=V=>{let Z=[...k.value];Z.splice(V,1),t.expertSelections=Z},$=V=>qt(V,t.customExpertRoles),P=Vue.ref(!1),D=Vue.ref(0),M=()=>t.currentView==="yeaft"&&!!t.currentAgent,C=Vue.computed(()=>{let V=r.value,Z=V.lastIndexOf("@");return Z<0||!P.value?"":V.slice(Z+1)}),T=Vue.computed(()=>{if(!i)return n.vpList||[];let V=t.yeaftActiveSessionFilter||i.activeSessionId||null,Z=typeof i.sessionById=="function"?i.sessionById(V,t.currentAgent||null):i.sessions?.[V];return Hd(n.vpList,Z)}),N=Vue.computed(()=>co(T.value,C.value)),H=Vue.computed(()=>!t.btwMode&&P.value&&!y.value&&N.value.length>0),U=uo(l),ie=Vue.computed(()=>{if(!H.value)return null;let V=N.value[D.value];return V?po(l,V.vpId):null}),Y=V=>{!V||!V.vpId||(r.value=Nd(r.value,V.vpId),P.value=!1,D.value=0,Vue.nextTick(()=>o.value?.focus()))},G=Vue.computed(()=>e.draftKey||e.conversationId||t.currentConversation||null);G.value&&t.inputDrafts[G.value]&&(r.value=t.inputDrafts[G.value]),Vue.watch(r,V=>{let Z=G.value;Z&&(V?t.inputDrafts[Z]=V:delete t.inputDrafts[Z])}),Vue.watch(N,V=>{if(V.length===0){D.value=0;return}D.value>=V.length&&(D.value=V.length-1)}),Vue.watch(G,(V,Z)=>{Z&&r.value&&(t.inputDrafts[Z]=r.value),r.value=V&&t.inputDrafts[V]||""});let ee=V=>{if(!V||typeof V!="string")return;let Z=r.value||"",pe=Z.length>0&&!/\s$/.test(Z),ce=Z+(pe?" ":"")+"@"+V+" ";r.value=ce,Vue.nextTick(()=>{let ve=o.value;ve&&(ve.focus(),ve.setSelectionRange(ce.length,ce.length),te())})},re=Vue.ref(!1),ge=Vue.ref(0),v=Vue.computed(()=>{let V=e.conversationId||t.activeConversationId||t.currentConversation,Z=t.currentAgent,pe=_d(t,V,Z),ce=t.currentView==="yeaft"?Dd:Pd;return ci(ce,pe).map(Pe=>Pe.startsWith("/")?Pe:"/"+Pe)}),_=Vue.computed(()=>{let V=r.value.trim();if(!V.startsWith("/"))return[];let Z=V.toLowerCase();return v.value.filter(pe=>pe.toLowerCase().startsWith(Z)&&pe.toLowerCase()!==Z).map(pe=>({cmd:pe,desc:Ed(pe,t.slashCommandDescriptions)}))}),X=Vue.computed(()=>Rd(_.value,t.slashCommandDescriptions,v.value)),ne=Vue.computed(()=>_.value.map(V=>V.cmd)),me=Vue.computed(()=>e.conversationId||t.activeConversationId||t.currentConversation||null),Se=Vue.computed(()=>t.compactStatus?.status==="compacting"&&t.compactStatus?.conversationId===me.value),Ce=Vue.computed(()=>{if(Se.value)return!1;let V=!!r.value.trim(),Z=d.value.length>0;if(b.value){let Te=!u.value&&d.value.every(Ne=>Ne.fileId);return(V||Z)&&Te}let pe=k.value.length>0,ce=k.value.some(Te=>Te.action),ve=V||Z||pe&&(V||ce),Pe=!u.value&&d.value.every(Te=>Te.fileId);return ve&&t.currentAgent&&t.currentConversation&&Pe}),te=()=>{let V=o.value;V&&(V.style.height="auto",V.style.height=Math.min(V.scrollHeight,120)+"px")},Q=()=>{te();let V=r.value.trim();V.startsWith("/")&&!V.includes(" ")?(re.value=!0,ge.value=0,y.value=!1):re.value=!1;let Z=r.value,pe=Z.lastIndexOf("@");if(pe!==-1&&!re.value){let ce=pe>0?Z[pe-1]:" ";ce===" "||ce===`
|
|
1756
|
+
`||pe===0?M()?(P.value=!0,D.value=0,y.value=!1):(y.value=!0,m.value=0,P.value=!1):(y.value=!1,P.value=!1)}else pe===-1&&(y.value=!1,P.value=!1)},F=V=>{r.value=V+" ",re.value=!1,Vue.nextTick(()=>{o.value?.focus()})},se=()=>{setTimeout(()=>{re.value=!1,y.value=!1,P.value=!1},150)},oe=async V=>{let Z=Array.from(V.target.files||[]);Z.length>0&&await he(Z),V.target.value="",Vue.nextTick(()=>{o.value?.focus()})},we=async V=>{let Z=V.clipboardData?.items;if(!Z)return;let pe=[];for(let ce of Z)if(ce.kind==="file"){let ve=ce.getAsFile();ve&&pe.push(ve)}pe.length>0&&(V.preventDefault(),await he(pe))},W=V=>{let Z=String(V||"").toLowerCase();return Z==="image/png"?".png":Z==="image/jpeg"?".jpg":Z==="image/gif"?".gif":Z==="image/webp"?".webp":Z==="image/svg+xml"?".svg":Z==="text/plain"?".txt":Z==="application/json"?".json":""},J=(V,Z)=>{let pe=typeof V?.name=="string"?V.name.trim():"";return pe||`${String(V?.type||"").startsWith("image/")?"pasted-image":"pasted-file"}-${Date.now()}-${Z+1}${W(V?.type)}`},he=async V=>{let Z=[];for(let[pe,ce]of V.entries()){let ve=J(ce,pe),Pe={file:ce,name:ve,uploadName:ve,preview:null,uploading:!0,fileId:null};ce.type.startsWith("image/")&&(Pe.preview=URL.createObjectURL(ce)),d.value.push(Pe),Z.push(Pe)}u.value=!0;try{let pe=new FormData;for(let Fe of Z)pe.append("files",Fe.file,Fe.uploadName);let ce={},ve=s.getActiveToken?.()||s.token||null;ve&&(ce.Authorization=`Bearer ${ve}`);let Pe=await fetch("/api/upload",{method:"POST",headers:ce,body:pe});if(!Pe.ok)throw new Error("Upload failed");let Te=await Pe.json(),Ne=0;for(let Fe of Z)Fe.uploading&&!Fe.fileId&&Ne<Te.files.length&&(Fe.fileId=Te.files[Ne].fileId,Fe.uploading=!1,delete Fe.uploadName,Ne++)}catch{let ce=d.value.filter(ve=>!ve.fileId);for(let ve of ce)ve.preview&&URL.revokeObjectURL(ve.preview);d.value=d.value.filter(ve=>ve.fileId)}finally{u.value=!1,Vue.nextTick(()=>{o.value?.focus()})}},fe=V=>{let Z=d.value[V];Z.preview&&URL.revokeObjectURL(Z.preview),d.value.splice(V,1),Vue.nextTick(()=>{o.value?.focus()})},Re=()=>{if(!Ce.value)return;re.value=!1,y.value=!1,P.value=!1;let V=r.value.trim();if(e.sendFn){let ce=d.value.filter(ve=>ve.fileId).map(ve=>({fileId:ve.fileId,name:ve.name,preview:ve.preview,isImage:ve.file?.type?.startsWith("image/")||!1,mimeType:ve.file?.type||""}));e.sendFn(V,ce.length>0?ce:void 0),d.value=[],r.value="",G.value&&delete t.inputDrafts[G.value],o.value&&(o.value.style.height="auto");return}if(V==="/btw"||V.startsWith("/btw ")){let ce=V.substring(4).trim();t.enterBtwMode(),ce&&t.sendBtwQuestion(ce),r.value="",G.value&&delete t.inputDrafts[G.value],o.value&&(o.value.style.height="auto");return}if(t.btwMode){t.sendBtwQuestion(V),r.value="",G.value&&delete t.inputDrafts[G.value],o.value&&(o.value.style.height="auto");return}let Z=d.value.filter(ce=>ce.fileId).map(ce=>({fileId:ce.fileId,name:ce.name,preview:ce.preview,isImage:ce.file?.type?.startsWith("image/")||!1,mimeType:ce.file?.type||""}));if(t.currentView==="yeaft"&&(V||Z.length>0)){let ce=di(V).mentions,ve=t.yeaftActiveSessionFilter||i?.activeSessionId||"grp_default";t.sendYeaftSessionMessage({groupId:ve,text:V,mentions:ce,attachments:Z}),d.value=[],r.value="",G.value&&delete t.inputDrafts[G.value],o.value&&(o.value.style.height="auto");return}let pe=[...k.value];t.sendMessage(r.value.trim(),Z,{expertSelections:pe}),d.value=[],r.value="",t.expertSelections=[],G.value&&delete t.inputDrafts[G.value],o.value&&(o.value.style.height="auto")},Ve=V=>{if(!(V.isComposing||V.keyCode===229)){if(V.key==="Escape"&&t.btwMode){V.preventDefault(),t.closeBtw();return}if(P.value){let Z=N.value;if(Z.length>0){if(V.key==="ArrowDown"){V.preventDefault(),D.value=(D.value+1)%Z.length;return}if(V.key==="ArrowUp"){V.preventDefault(),D.value=(D.value-1+Z.length)%Z.length;return}if(V.key==="Tab"||V.key==="Enter"&&!V.shiftKey){V.preventDefault(),Y(Z[D.value]);return}}if(V.key==="Escape"){V.preventDefault(),P.value=!1;return}}if(y.value&&E.value.length>0){if(V.key==="ArrowDown"){V.preventDefault(),m.value=(m.value+1)%E.value.length;return}if(V.key==="ArrowUp"){V.preventDefault(),m.value=(m.value-1+E.value.length)%E.value.length;return}if(V.key==="Tab"||V.key==="Enter"&&!V.shiftKey){V.preventDefault(),R(E.value[m.value]);return}if(V.key==="Escape"){V.preventDefault(),y.value=!1;return}}if(re.value&&ne.value.length>0){if(V.key==="ArrowDown"){V.preventDefault(),ge.value=(ge.value+1)%ne.value.length;return}if(V.key==="ArrowUp"){V.preventDefault(),ge.value=(ge.value-1+ne.value.length)%ne.value.length;return}if(V.key==="Tab"||V.key==="Enter"&&!V.shiftKey){V.preventDefault(),F(ne.value[ge.value]);return}if(V.key==="Escape"){V.preventDefault(),re.value=!1;return}}V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),Re())}},He=()=>{e.cancelFn?e.cancelFn():t.cancelExecution()};return{store:t,inputText:r,inputRef:o,inputAreaRef:p,fileInput:c,attachments:d,uploading:u,canSend:Ce,isCompacting:Se,isStopVisible:x,effectivePlaceholderKey:A,attachmentsAllowed:h,showAutocomplete:re,selectedIndex:ge,filteredCommands:ne,flatItems:_,groupedCommands:X,autocompleteRef:f,sendFn:Vue.toRef(e,"sendFn"),expertSelections:k,showExpertAutocomplete:y,expertSelectedIndex:m,expertAutocompleteFiltered:E,expertAutocompleteRef:g,selectExpertItem:R,removeExpertSelection:q,getExpertLabel:$,autoResize:te,handleInput:Q,selectCommand:F,onBlur:se,handleFileSelect:oe,handlePaste:we,removeAttachment:fe,send:Re,handleKeydown:Ve,cancelExecution:He,vpStore:n,inputElementId:l,showVpAutocomplete:P,vpMentionPopupOpen:H,vpMentionPopupId:U,vpMentionActiveOptionId:ie,vpSelectedIndex:D,vpMentionQuery:C,mentionVpCandidates:T,selectVpMention:Y,appendMention:ee}}}});function fo(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 Wd(e){return e+":"+Math.random().toString(36).slice(2,8)}function an(e){return e?e.type==="pane"?[e.terminalId]:[...an(e.first),...an(e.second)]:[]}function gi(e){return e?e.type==="pane"?e.terminalId:gi(e.first):null}function fi(e,t,s){return e&&(e.type==="pane"?e.terminalId===t?s:e:{...e,first:fi(e.first,t,s),second:fi(e.second,t,s)})}function Dt(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=Dt(e.first,t),n=Dt(e.second,t);return s?n?{...e,first:s,second:n}:s:n}var Ud=O(()=>{});var zd,jd=O(()=>{zd={name:"PaneTree",props:{node:Object,terminals:Object,activePane:String,onActivate:Function,onClosePane:Function,setMountRef:Function},template:`
|
|
1757
1757
|
<div v-if="node.type === 'pane'"
|
|
1758
1758
|
class="terminal-pane"
|
|
1759
1759
|
:class="{ active: node.terminalId === activePane }"
|
|
@@ -1792,7 +1792,7 @@ ${String(e||"").trim()}
|
|
|
1792
1792
|
/>
|
|
1793
1793
|
</div>
|
|
1794
1794
|
</div>
|
|
1795
|
-
`,setup(e){let t=Vue.computed(()=>e.node.type!=="split"?{}:{flexBasis:(e.node.ratio*100).toFixed(2)+"%",flexGrow:0,flexShrink:0}),s=Vue.computed(()=>e.node.type!=="split"?{}:{flexBasis:((1-e.node.ratio)*100).toFixed(2)+"%",flexGrow:0,flexShrink:0});return{firstStyle:t,secondStyle:s,startDrag:(i,r)=>{let o=i.target.closest(".terminal-split");if(!o)return;let a=i.type==="touchstart",l=r.direction==="horizontal",c=l?a?i.touches[0].clientX:i.clientX:a?i.touches[0].clientY:i.clientY,d=o.getBoundingClientRect(),u=l?d.width:d.height,p=r.ratio;document.body.style.cursor=l?"col-resize":"row-resize",document.body.style.userSelect="none";let f=
|
|
1795
|
+
`,setup(e){let t=Vue.computed(()=>e.node.type!=="split"?{}:{flexBasis:(e.node.ratio*100).toFixed(2)+"%",flexGrow:0,flexShrink:0}),s=Vue.computed(()=>e.node.type!=="split"?{}:{flexBasis:((1-e.node.ratio)*100).toFixed(2)+"%",flexGrow:0,flexShrink:0});return{firstStyle:t,secondStyle:s,startDrag:(i,r)=>{let o=i.target.closest(".terminal-split");if(!o)return;let a=i.type==="touchstart",l=r.direction==="horizontal",c=l?a?i.touches[0].clientX:i.clientX:a?i.touches[0].clientY:i.clientY,d=o.getBoundingClientRect(),u=l?d.width:d.height,p=r.ratio;document.body.style.cursor=l?"col-resize":"row-resize",document.body.style.userSelect="none";let f=b=>{let A=(l?a?b.touches[0].clientX:b.clientX:a?b.touches[0].clientY:b.clientY)-c,x=Math.max(.1,Math.min(.9,p+A/u));r.ratio=x},g=()=>{document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",f),document.removeEventListener("touchend",g),window.dispatchEvent(new CustomEvent("terminal-fit-all"))};document.addEventListener(a?"touchmove":"mousemove",f),document.addEventListener(a?"touchend":"mouseup",g)}}}}});var Kd,Gd=O(()=>{Ud();jd();Kd={name:"TerminalTab",components:{PaneTree:zd},template:`
|
|
1796
1796
|
<div class="terminal-tab">
|
|
1797
1797
|
<div class="terminal-toolbar">
|
|
1798
1798
|
<button class="wb-btn" @click="splitPane('horizontal')" :disabled="!hasActivePane" :title="$t('terminal.splitH')">
|
|
@@ -1826,9 +1826,9 @@ ${String(e||"").trim()}
|
|
|
1826
1826
|
<div class="placeholder-text">{{ $t('terminal.autoCreate') }}</div>
|
|
1827
1827
|
</div>
|
|
1828
1828
|
</div>
|
|
1829
|
-
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=Vue.reactive({}),n=Vue.reactive({}),i=Vue.reactive({}),r=Vue.ref(""),o={},a=!1,l=Vue.computed(()=>{let M=e.currentConversation;return M&&n[M]||null}),c=Vue.computed(()=>{let M=e.currentConversation;return M&&i[M]||""}),d=Vue.computed(()=>!!c.value),u=(M,C)=>{if(C){let T=o[M];if(o[M]=C,T&&T!==C){let N=s[M];N?.terminal?.element&&(C.innerHTML="",C.appendChild(N.terminal.element),Vue.nextTick(()=>{try{N.fitAddon?.fit()}catch{}}))}}},p=M=>{let C=e.currentConversation;C&&(i[C]=M)};async function f(){if(a)return!0;let M=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,C=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null;if(!M||!C)try{await fo("vendor/xterm.min.js"),await fo("vendor/xterm-addon-fit.min.js"),M=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,C=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null}catch{}return!M||!C?(r.value=t("terminal.xtermNotLoaded"),!1):(a=!0,!0)}function g(){let M=document.documentElement.getAttribute("data-theme")==="dark",T=getComputedStyle(document.documentElement).getPropertyValue("--bg-main").trim()||(M?"#212121":"#ffffff");return M?{background:T,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:T,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 v(M){if(!M||!e.currentAgent||!await f())return null;let C=Wd(M),T=Terminal.Terminal||Terminal,N=FitAddon.FitAddon||FitAddon,H=new T({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}),U=new N;return H.loadAddon(U),H.attachCustomKeyEventHandler(ie=>!((ie.ctrlKey||ie.metaKey)&&ie.key==="v"||(ie.ctrlKey||ie.metaKey)&&ie.key==="c"&&H.hasSelection())),s[C]={created:!0,connected:!1,terminal:H,fitAddon:U},H.onData(ie=>{e.sendWsMessage({type:"terminal_input",agentId:e.currentAgent,conversationId:M,terminalId:C,data:ie,_clientId:e.clientId})}),C}async function y(M,C){let T=s[C];if(!T)return!1;let N=null;for(let H=0;H<10&&(await Vue.nextTick(),N=o[C],!(N||H>=2&&(await new Promise(U=>setTimeout(U,50)),N=o[C],N)));H++);return N?(T.terminal.open(N),T.fitAddon.fit(),e.sendWsMessage({type:"terminal_create",agentId:e.currentAgent,conversationId:M,terminalId:C,cols:T.terminal.cols,rows:T.terminal.rows,_clientId:e.clientId}),!0):(r.value=t("terminal.mountFailed"),T.terminal.dispose(),delete s[C],!1)}let A=!1;async function x(){let M=e.currentConversation;if(!M||!e.currentAgent||n[M]||A)return;A=!0,r.value="";let C=await v(M);if(!C){A=!1;return}n[M]=Vue.reactive({type:"pane",terminalId:C}),i[M]=C,await y(M,C)||(delete n[M],delete i[M]),A=!1}async function k(M){let C=e.currentConversation;if(!C||!i[C])return;let T=i[C],N=await v(C);if(!N)return;let H=Vue.reactive({type:"split",direction:M,ratio:.5,first:{type:"pane",terminalId:T},second:{type:"pane",terminalId:N}}),U=fi(n[C],T,H);if(n[C]=Vue.reactive(U),i[C]=N,!await y(C,N)){let Y=Dt(n[C],N);Y&&(n[C]=Vue.reactive(Y)),i[C]=T;return}await Vue.nextTick(),w(C)}function b(M){let C=e.currentConversation;if(!C)return;let T=s[M];T&&(e.sendWsMessage({type:"terminal_close",agentId:e.currentAgent,conversationId:C,terminalId:M,_clientId:e.clientId}),T.terminal?.dispose(),delete s[M],delete o[M]);let N=Dt(n[C],M);N?(n[C]=Vue.reactive(N),i[C]===M&&(i[C]=gi(n[C])||""),Vue.nextTick(()=>w(C))):(delete n[C],delete i[C],Vue.nextTick(()=>x()))}function m(){let M=e.currentConversation;!M||!i[M]||b(i[M])}function w(M){if(M||(M=e.currentConversation),!M||!n[M])return;let C=an(n[M]);for(let T of C){let N=s[T];if(N?.fitAddon&&N.connected)try{N.fitAddon.fit(),e.sendWsMessage({type:"terminal_resize",agentId:e.currentAgent,conversationId:M,terminalId:T,cols:N.terminal.cols,rows:N.terminal.rows,_clientId:e.clientId})}catch{}}}function E(M){let C=M.detail;if(C)switch(C.type){case"terminal_created":{let T=C.terminalId||C.conversationId,N=s[T];if(N)if(C.success)N.connected=!0,r.value="";else{r.value=C.error||t("terminal.createFailed"),N.terminal?.dispose(),delete s[T];let H=C.conversationId;if(H&&n[H]){let U=Dt(n[H],T);U?n[H]=Vue.reactive(U):(delete n[H],delete i[H])}}break}case"terminal_output":{let T=C.terminalId||C.conversationId,N=s[T];N?.terminal&&N.terminal.write(C.data);break}case"terminal_closed":{let T=C.terminalId||C.conversationId,N=s[T];if(N){N.terminal?.dispose(),delete s[T],delete o[T];let H=C.conversationId;if(H&&n[H]){let U=Dt(n[H],T);U?(n[H]=Vue.reactive(U),i[H]===T&&(i[H]=gi(n[H])||"")):(delete n[H],delete i[H])}}break}case"terminal_error":{r.value=C.message||t("terminal.error");let T=C.terminalId;if(T&&s[T]&&!s[T].connected){s[T].terminal?.dispose(),delete s[T];let N=C.conversationId;if(N&&n[N]){let H=Dt(n[N],T);H?n[N]=Vue.reactive(H):(delete n[N],delete i[N])}}break}}}let R=null;function q(){clearTimeout(R),R=setTimeout(()=>w(),100)}function $(){w()}function P(M){let{conversationId:C}=M.detail;if(C&&n[C]){let T=an(n[C]);for(let N of T){let H=s[N];H&&(H.terminal?.dispose(),delete s[N],delete o[N])}delete n[C],delete i[C]}}Vue.onMounted(()=>{window.addEventListener("workbench-message",E),window.addEventListener("resize",q),window.addEventListener("terminal-fit-all",$),window.addEventListener("conversation-deleted",P)}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",E),window.removeEventListener("resize",q),window.removeEventListener("terminal-fit-all",$),window.removeEventListener("conversation-deleted",P),clearTimeout(R);for(let M of Object.keys(s))s[M]?.terminal?.dispose()}),Vue.watch(()=>[e.currentConversation,e.workbenchExpanded],()=>{Vue.nextTick(()=>{if(!e.currentConversation||!e.workbenchExpanded)return;let C=document.querySelector(".terminal-tab");C&&C.offsetParent!==null&&x()})},{immediate:!0}),Vue.watch(()=>e.connectionState,(M,C)=>{if(M==="connected"&&C&&C!=="connected"){for(let T of Object.keys(s))s[T]?.terminal?.dispose(),delete s[T],delete o[T];for(let T of Object.keys(n))delete n[T],delete i[T];Vue.nextTick(()=>x())}}),Vue.watch(()=>e.currentConversation,()=>{Vue.nextTick(()=>w())});let D=null;return Vue.onMounted(()=>{let M=()=>{let T=document.querySelector(".terminal-tab");T&&T.offsetParent!==null&&(x(),w())};D=new MutationObserver(()=>{setTimeout(M,50)});let C=document.querySelector(".workbench-tab-content");C&&D.observe(C,{attributes:!0,subtree:!0,attributeFilter:["style"]})}),Vue.onUnmounted(()=>{D&&D.disconnect()}),{store:e,terminals:s,currentTree:l,currentActivePane:c,hasActivePane:d,terminalError:r,setMountRef:u,activatePane:p,splitPane:k,closeActivePane:m,closePane:b}}}});function mi(e){if(!e)return ln(K.default);let t=e.toLowerCase();if(go[t])return go[t]();let s=t.lastIndexOf(".");if(s>=0){let n=t.slice(s+1);if(Yd[n])return Yd[n]();let i=t;for(let[r,o]of Object.entries(go))if(i===r||i.endsWith("/"+r))return o()}return ln(K.default)}function hi(e=!1){return km(K.folder,e)}var K,ln,km,z,Yd,go,mo=O(()=>{K={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"},ln=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>`,km=(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>`,z=(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>`,Yd={js:()=>z(K.js,"JS"),mjs:()=>z(K.js,"JS"),cjs:()=>z(K.js,"JS"),ts:()=>z(K.ts,"TS"),mts:()=>z(K.ts,"TS"),jsx:()=>z(K.jsx,"JSX"),tsx:()=>z(K.tsx,"TSX"),html:()=>z(K.html,"</>"),htm:()=>z(K.html,"</>"),css:()=>z(K.css,"CSS"),scss:()=>z(K.scss,"SC"),sass:()=>z(K.scss,"SA"),less:()=>z(K.less,"LS"),vue:()=>z(K.vue,"V"),svelte:()=>z(K.svelte,"SV"),json:()=>z(K.json,"{ }"),yaml:()=>z(K.yaml,"YML"),yml:()=>z(K.yaml,"YML"),toml:()=>z(K.config,"TML"),xml:()=>z(K.xml,"</>"),csv:()=>z(K.config,"CSV"),md:()=>z(K.md,"MD"),markdown:()=>z(K.md,"MD"),txt:()=>ln(K.txt),log:()=>ln(K.log),pdf:()=>z("#E53935","PDF"),py:()=>z(K.py,"PY"),rb:()=>z(K.rb,"RB"),go:()=>z(K.go,"GO"),rs:()=>z(K.rs,"RS"),java:()=>z(K.java,"JA"),cs:()=>z(K.cs,"C#"),cpp:()=>z(K.cpp,"C+"),cc:()=>z(K.cpp,"C+"),c:()=>z(K.c,"C"),h:()=>z(K.c,"H"),hpp:()=>z(K.cpp,"H+"),swift:()=>z(K.swift,"SW"),kt:()=>z(K.kt,"KT"),php:()=>z(K.php,"PHP"),lua:()=>z(K.lua,"LUA"),r:()=>z(K.r,"R"),dart:()=>z(K.dart,"DA"),sh:()=>z(K.sh,">_"),bash:()=>z(K.sh,">_"),zsh:()=>z(K.sh,">_"),fish:()=>z(K.sh,">_"),ps1:()=>z(K.ps1,"PS"),bat:()=>z(K.ps1,"BAT"),cmd:()=>z(K.ps1,"CMD"),sql:()=>z(K.sql,"SQL"),db:()=>z(K.sql,"DB"),sqlite:()=>z(K.sql,"DB"),svg:()=>z(K.svg,"SVG"),png:()=>z(K.img,"PNG"),jpg:()=>z(K.img,"JPG"),jpeg:()=>z(K.img,"JPG"),gif:()=>z(K.img,"GIF"),ico:()=>z(K.img,"ICO"),webp:()=>z(K.img,"WP"),lock:()=>ln(K.lock),env:()=>z(K.env,"ENV"),ini:()=>z(K.config,"INI"),cfg:()=>z(K.config,"CFG"),conf:()=>z(K.config,"CNF"),liquid:()=>z(K.liquid,"LQ"),ejs:()=>z(K.html,"EJS"),hbs:()=>z(K.html,"HBS"),pug:()=>z(K.html,"PUG"),wasm:()=>z("#654FF0","WA"),proto:()=>z(K.config,"PB"),graphql:()=>z("#E535AB","GQL"),gql:()=>z("#E535AB","GQL")},go={dockerfile:()=>z(K.docker,"DK"),"docker-compose.yml":()=>z(K.docker,"DC"),"docker-compose.yaml":()=>z(K.docker,"DC"),".gitignore":()=>z(K.git,"GI"),".gitattributes":()=>z(K.git,"GA"),".gitmodules":()=>z(K.git,"GM"),".env":()=>z(K.env,"ENV"),".env.local":()=>z(K.env,"ENV"),".env.development":()=>z(K.env,"ENV"),".env.production":()=>z(K.env,"ENV"),"package.json":()=>z("#CB3837","NPM"),"package-lock.json":()=>z("#CB3837","NPM"),"tsconfig.json":()=>z(K.ts,"TSC"),eslintrc:()=>z("#4B32C3","ESL"),".eslintrc.js":()=>z("#4B32C3","ESL"),".eslintrc.json":()=>z("#4B32C3","ESL"),".prettierrc":()=>z("#F7B93E","PR"),makefile:()=>z(K.config,"MK"),"cmakelists.txt":()=>z("#064F8C","CM"),"readme.md":()=>z(K.md,"RM"),license:()=>z("#F5C518","LIC"),"license.md":()=>z("#F5C518","LIC"),"cargo.toml":()=>z(K.rs,"CG"),"go.mod":()=>z(K.go,"MOD"),"go.sum":()=>z(K.go,"SUM"),gemfile:()=>z(K.rb,"GEM"),rakefile:()=>z(K.rb,"RK"),"requirements.txt":()=>z(K.py,"REQ"),pipfile:()=>z(K.py,"PIP"),csproj:()=>z(K.cs,"CSP"),".sln":()=>z(K.cs,"SLN"),slnx:()=>z(K.cs,"SLN")}});function Gt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Sm(e,t){if(!e||!t)return Gt(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],p=d.index+(d[1]!==void 0?d[0].indexOf(d[1]):0);if(s.push({start:p,end:p+u.length,cls:l}),!c.global)break}},i=t.commentType||"slash";if((i==="slash"||i==="both")&&(n(Ss.comment1,Ie.comment),n(Ss.commentBlock,Ie.comment)),(i==="hash"||i==="both")&&n(Ss.commentHash,Ie.comment),i==="html"&&n(t.commentHtml,Ie.comment),t.commentLine&&n(t.commentLine,Ie.comment),t.commentBlock&&n(t.commentBlock,Ie.comment),n(Ss.string,Ie.string),n(Ss.number,Ie.number),t.keywords&&n(t.keywords,Ie.keyword),t.builtins&&n(t.builtins,Ie.builtin),t.operators&&n(t.operators,Ie.operator),t.decorators&&n(t.decorators,Ie.decorator),t.macros&&n(t.macros,Ie.macro),t.preprocessor&&n(t.preprocessor,Ie.preprocessor),t.attributes&&n(t.attributes,Ie.attribute),t.tags&&n(t.tags,Ie.tag),t.properties&&n(t.properties,Ie.property),t.variables&&n(t.variables,Ie.variable),t.headings&&n(t.headings,Ie.heading),t.bold&&n(t.bold,Ie.bold),t.links&&n(t.links,Ie.link),t.keys&&n(t.keys,Ie.key),t.sections&&n(t.sections,Ie.section),t.selectors&&n(t.selectors,Ie.keyword),t.values&&n(t.values,Ie.number),t.code&&n(t.code,Ie.string),t.italic&&n(t.italic,Ie.builtin),t.attrs&&n(t.attrs,Ie.attribute),s.length===0)return Gt(e);s.sort((a,l)=>a.start-l.start||l.end-l.start-(a.end-a.start));let r="",o=0;for(let a of s)a.start<o||(a.start>o&&(r+=Gt(e.slice(o,a.start))),r+=`<span class="${a.cls}">${Gt(e.slice(a.start,a.end))}</span>`,o=a.end);return o<e.length&&(r+=Gt(e.slice(o))),r}function Cm(e){if(!e)return null;let t=e.split(".").pop()?.toLowerCase();if(!t)return null;let s=Qd[t];return typeof s=="string"&&(s=Qd[s]),s||null}function Xd(e,t){if(!e)return Gt(e||"");let s=Cm(t);return s?Sm(e,s):Gt(e)}var Ss,Qd,Ie,Zd=O(()=>{Ss={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},Qd={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}},Ie={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 Jd(e,t,s){let n=[],i=0,r=0;if(t!=null){let f=t.split(`
|
|
1829
|
+
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=Vue.reactive({}),n=Vue.reactive({}),i=Vue.reactive({}),r=Vue.ref(""),o={},a=!1,l=Vue.computed(()=>{let M=e.currentConversation;return M&&n[M]||null}),c=Vue.computed(()=>{let M=e.currentConversation;return M&&i[M]||""}),d=Vue.computed(()=>!!c.value),u=(M,C)=>{if(C){let T=o[M];if(o[M]=C,T&&T!==C){let N=s[M];N?.terminal?.element&&(C.innerHTML="",C.appendChild(N.terminal.element),Vue.nextTick(()=>{try{N.fitAddon?.fit()}catch{}}))}}},p=M=>{let C=e.currentConversation;C&&(i[C]=M)};async function f(){if(a)return!0;let M=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,C=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null;if(!M||!C)try{await fo("vendor/xterm.min.js"),await fo("vendor/xterm-addon-fit.min.js"),M=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,C=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null}catch{}return!M||!C?(r.value=t("terminal.xtermNotLoaded"),!1):(a=!0,!0)}function g(){let M=document.documentElement.getAttribute("data-theme")==="dark",T=getComputedStyle(document.documentElement).getPropertyValue("--bg-main").trim()||(M?"#212121":"#ffffff");return M?{background:T,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:T,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 b(M){if(!M||!e.currentAgent||!await f())return null;let C=Wd(M),T=Terminal.Terminal||Terminal,N=FitAddon.FitAddon||FitAddon,H=new T({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}),U=new N;return H.loadAddon(U),H.attachCustomKeyEventHandler(ie=>!((ie.ctrlKey||ie.metaKey)&&ie.key==="v"||(ie.ctrlKey||ie.metaKey)&&ie.key==="c"&&H.hasSelection())),s[C]={created:!0,connected:!1,terminal:H,fitAddon:U},H.onData(ie=>{e.sendWsMessage({type:"terminal_input",agentId:e.currentAgent,conversationId:M,terminalId:C,data:ie,_clientId:e.clientId})}),C}async function h(M,C){let T=s[C];if(!T)return!1;let N=null;for(let H=0;H<10&&(await Vue.nextTick(),N=o[C],!(N||H>=2&&(await new Promise(U=>setTimeout(U,50)),N=o[C],N)));H++);return N?(T.terminal.open(N),T.fitAddon.fit(),e.sendWsMessage({type:"terminal_create",agentId:e.currentAgent,conversationId:M,terminalId:C,cols:T.terminal.cols,rows:T.terminal.rows,_clientId:e.clientId}),!0):(r.value=t("terminal.mountFailed"),T.terminal.dispose(),delete s[C],!1)}let A=!1;async function x(){let M=e.currentConversation;if(!M||!e.currentAgent||n[M]||A)return;A=!0,r.value="";let C=await b(M);if(!C){A=!1;return}n[M]=Vue.reactive({type:"pane",terminalId:C}),i[M]=C,await h(M,C)||(delete n[M],delete i[M]),A=!1}async function k(M){let C=e.currentConversation;if(!C||!i[C])return;let T=i[C],N=await b(C);if(!N)return;let H=Vue.reactive({type:"split",direction:M,ratio:.5,first:{type:"pane",terminalId:T},second:{type:"pane",terminalId:N}}),U=fi(n[C],T,H);if(n[C]=Vue.reactive(U),i[C]=N,!await h(C,N)){let Y=Dt(n[C],N);Y&&(n[C]=Vue.reactive(Y)),i[C]=T;return}await Vue.nextTick(),w(C)}function y(M){let C=e.currentConversation;if(!C)return;let T=s[M];T&&(e.sendWsMessage({type:"terminal_close",agentId:e.currentAgent,conversationId:C,terminalId:M,_clientId:e.clientId}),T.terminal?.dispose(),delete s[M],delete o[M]);let N=Dt(n[C],M);N?(n[C]=Vue.reactive(N),i[C]===M&&(i[C]=gi(n[C])||""),Vue.nextTick(()=>w(C))):(delete n[C],delete i[C],Vue.nextTick(()=>x()))}function m(){let M=e.currentConversation;!M||!i[M]||y(i[M])}function w(M){if(M||(M=e.currentConversation),!M||!n[M])return;let C=an(n[M]);for(let T of C){let N=s[T];if(N?.fitAddon&&N.connected)try{N.fitAddon.fit(),e.sendWsMessage({type:"terminal_resize",agentId:e.currentAgent,conversationId:M,terminalId:T,cols:N.terminal.cols,rows:N.terminal.rows,_clientId:e.clientId})}catch{}}}function E(M){let C=M.detail;if(C)switch(C.type){case"terminal_created":{let T=C.terminalId||C.conversationId,N=s[T];if(N)if(C.success)N.connected=!0,r.value="";else{r.value=C.error||t("terminal.createFailed"),N.terminal?.dispose(),delete s[T];let H=C.conversationId;if(H&&n[H]){let U=Dt(n[H],T);U?n[H]=Vue.reactive(U):(delete n[H],delete i[H])}}break}case"terminal_output":{let T=C.terminalId||C.conversationId,N=s[T];N?.terminal&&N.terminal.write(C.data);break}case"terminal_closed":{let T=C.terminalId||C.conversationId,N=s[T];if(N){N.terminal?.dispose(),delete s[T],delete o[T];let H=C.conversationId;if(H&&n[H]){let U=Dt(n[H],T);U?(n[H]=Vue.reactive(U),i[H]===T&&(i[H]=gi(n[H])||"")):(delete n[H],delete i[H])}}break}case"terminal_error":{r.value=C.message||t("terminal.error");let T=C.terminalId;if(T&&s[T]&&!s[T].connected){s[T].terminal?.dispose(),delete s[T];let N=C.conversationId;if(N&&n[N]){let H=Dt(n[N],T);H?n[N]=Vue.reactive(H):(delete n[N],delete i[N])}}break}}}let R=null;function q(){clearTimeout(R),R=setTimeout(()=>w(),100)}function $(){w()}function P(M){let{conversationId:C}=M.detail;if(C&&n[C]){let T=an(n[C]);for(let N of T){let H=s[N];H&&(H.terminal?.dispose(),delete s[N],delete o[N])}delete n[C],delete i[C]}}Vue.onMounted(()=>{window.addEventListener("workbench-message",E),window.addEventListener("resize",q),window.addEventListener("terminal-fit-all",$),window.addEventListener("conversation-deleted",P)}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",E),window.removeEventListener("resize",q),window.removeEventListener("terminal-fit-all",$),window.removeEventListener("conversation-deleted",P),clearTimeout(R);for(let M of Object.keys(s))s[M]?.terminal?.dispose()}),Vue.watch(()=>[e.currentConversation,e.workbenchExpanded],()=>{Vue.nextTick(()=>{if(!e.currentConversation||!e.workbenchExpanded)return;let C=document.querySelector(".terminal-tab");C&&C.offsetParent!==null&&x()})},{immediate:!0}),Vue.watch(()=>e.connectionState,(M,C)=>{if(M==="connected"&&C&&C!=="connected"){for(let T of Object.keys(s))s[T]?.terminal?.dispose(),delete s[T],delete o[T];for(let T of Object.keys(n))delete n[T],delete i[T];Vue.nextTick(()=>x())}}),Vue.watch(()=>e.currentConversation,()=>{Vue.nextTick(()=>w())});let D=null;return Vue.onMounted(()=>{let M=()=>{let T=document.querySelector(".terminal-tab");T&&T.offsetParent!==null&&(x(),w())};D=new MutationObserver(()=>{setTimeout(M,50)});let C=document.querySelector(".workbench-tab-content");C&&D.observe(C,{attributes:!0,subtree:!0,attributeFilter:["style"]})}),Vue.onUnmounted(()=>{D&&D.disconnect()}),{store:e,terminals:s,currentTree:l,currentActivePane:c,hasActivePane:d,terminalError:r,setMountRef:u,activatePane:p,splitPane:k,closeActivePane:m,closePane:y}}}});function mi(e){if(!e)return ln(K.default);let t=e.toLowerCase();if(go[t])return go[t]();let s=t.lastIndexOf(".");if(s>=0){let n=t.slice(s+1);if(Yd[n])return Yd[n]();let i=t;for(let[r,o]of Object.entries(go))if(i===r||i.endsWith("/"+r))return o()}return ln(K.default)}function hi(e=!1){return Sm(K.folder,e)}var K,ln,Sm,z,Yd,go,mo=O(()=>{K={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"},ln=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>`,Sm=(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>`,z=(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>`,Yd={js:()=>z(K.js,"JS"),mjs:()=>z(K.js,"JS"),cjs:()=>z(K.js,"JS"),ts:()=>z(K.ts,"TS"),mts:()=>z(K.ts,"TS"),jsx:()=>z(K.jsx,"JSX"),tsx:()=>z(K.tsx,"TSX"),html:()=>z(K.html,"</>"),htm:()=>z(K.html,"</>"),css:()=>z(K.css,"CSS"),scss:()=>z(K.scss,"SC"),sass:()=>z(K.scss,"SA"),less:()=>z(K.less,"LS"),vue:()=>z(K.vue,"V"),svelte:()=>z(K.svelte,"SV"),json:()=>z(K.json,"{ }"),yaml:()=>z(K.yaml,"YML"),yml:()=>z(K.yaml,"YML"),toml:()=>z(K.config,"TML"),xml:()=>z(K.xml,"</>"),csv:()=>z(K.config,"CSV"),md:()=>z(K.md,"MD"),markdown:()=>z(K.md,"MD"),txt:()=>ln(K.txt),log:()=>ln(K.log),pdf:()=>z("#E53935","PDF"),py:()=>z(K.py,"PY"),rb:()=>z(K.rb,"RB"),go:()=>z(K.go,"GO"),rs:()=>z(K.rs,"RS"),java:()=>z(K.java,"JA"),cs:()=>z(K.cs,"C#"),cpp:()=>z(K.cpp,"C+"),cc:()=>z(K.cpp,"C+"),c:()=>z(K.c,"C"),h:()=>z(K.c,"H"),hpp:()=>z(K.cpp,"H+"),swift:()=>z(K.swift,"SW"),kt:()=>z(K.kt,"KT"),php:()=>z(K.php,"PHP"),lua:()=>z(K.lua,"LUA"),r:()=>z(K.r,"R"),dart:()=>z(K.dart,"DA"),sh:()=>z(K.sh,">_"),bash:()=>z(K.sh,">_"),zsh:()=>z(K.sh,">_"),fish:()=>z(K.sh,">_"),ps1:()=>z(K.ps1,"PS"),bat:()=>z(K.ps1,"BAT"),cmd:()=>z(K.ps1,"CMD"),sql:()=>z(K.sql,"SQL"),db:()=>z(K.sql,"DB"),sqlite:()=>z(K.sql,"DB"),svg:()=>z(K.svg,"SVG"),png:()=>z(K.img,"PNG"),jpg:()=>z(K.img,"JPG"),jpeg:()=>z(K.img,"JPG"),gif:()=>z(K.img,"GIF"),ico:()=>z(K.img,"ICO"),webp:()=>z(K.img,"WP"),lock:()=>ln(K.lock),env:()=>z(K.env,"ENV"),ini:()=>z(K.config,"INI"),cfg:()=>z(K.config,"CFG"),conf:()=>z(K.config,"CNF"),liquid:()=>z(K.liquid,"LQ"),ejs:()=>z(K.html,"EJS"),hbs:()=>z(K.html,"HBS"),pug:()=>z(K.html,"PUG"),wasm:()=>z("#654FF0","WA"),proto:()=>z(K.config,"PB"),graphql:()=>z("#E535AB","GQL"),gql:()=>z("#E535AB","GQL")},go={dockerfile:()=>z(K.docker,"DK"),"docker-compose.yml":()=>z(K.docker,"DC"),"docker-compose.yaml":()=>z(K.docker,"DC"),".gitignore":()=>z(K.git,"GI"),".gitattributes":()=>z(K.git,"GA"),".gitmodules":()=>z(K.git,"GM"),".env":()=>z(K.env,"ENV"),".env.local":()=>z(K.env,"ENV"),".env.development":()=>z(K.env,"ENV"),".env.production":()=>z(K.env,"ENV"),"package.json":()=>z("#CB3837","NPM"),"package-lock.json":()=>z("#CB3837","NPM"),"tsconfig.json":()=>z(K.ts,"TSC"),eslintrc:()=>z("#4B32C3","ESL"),".eslintrc.js":()=>z("#4B32C3","ESL"),".eslintrc.json":()=>z("#4B32C3","ESL"),".prettierrc":()=>z("#F7B93E","PR"),makefile:()=>z(K.config,"MK"),"cmakelists.txt":()=>z("#064F8C","CM"),"readme.md":()=>z(K.md,"RM"),license:()=>z("#F5C518","LIC"),"license.md":()=>z("#F5C518","LIC"),"cargo.toml":()=>z(K.rs,"CG"),"go.mod":()=>z(K.go,"MOD"),"go.sum":()=>z(K.go,"SUM"),gemfile:()=>z(K.rb,"GEM"),rakefile:()=>z(K.rb,"RK"),"requirements.txt":()=>z(K.py,"REQ"),pipfile:()=>z(K.py,"PIP"),csproj:()=>z(K.cs,"CSP"),".sln":()=>z(K.cs,"SLN"),slnx:()=>z(K.cs,"SLN")}});function Gt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Cm(e,t){if(!e||!t)return Gt(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],p=d.index+(d[1]!==void 0?d[0].indexOf(d[1]):0);if(s.push({start:p,end:p+u.length,cls:l}),!c.global)break}},i=t.commentType||"slash";if((i==="slash"||i==="both")&&(n(Ss.comment1,Ie.comment),n(Ss.commentBlock,Ie.comment)),(i==="hash"||i==="both")&&n(Ss.commentHash,Ie.comment),i==="html"&&n(t.commentHtml,Ie.comment),t.commentLine&&n(t.commentLine,Ie.comment),t.commentBlock&&n(t.commentBlock,Ie.comment),n(Ss.string,Ie.string),n(Ss.number,Ie.number),t.keywords&&n(t.keywords,Ie.keyword),t.builtins&&n(t.builtins,Ie.builtin),t.operators&&n(t.operators,Ie.operator),t.decorators&&n(t.decorators,Ie.decorator),t.macros&&n(t.macros,Ie.macro),t.preprocessor&&n(t.preprocessor,Ie.preprocessor),t.attributes&&n(t.attributes,Ie.attribute),t.tags&&n(t.tags,Ie.tag),t.properties&&n(t.properties,Ie.property),t.variables&&n(t.variables,Ie.variable),t.headings&&n(t.headings,Ie.heading),t.bold&&n(t.bold,Ie.bold),t.links&&n(t.links,Ie.link),t.keys&&n(t.keys,Ie.key),t.sections&&n(t.sections,Ie.section),t.selectors&&n(t.selectors,Ie.keyword),t.values&&n(t.values,Ie.number),t.code&&n(t.code,Ie.string),t.italic&&n(t.italic,Ie.builtin),t.attrs&&n(t.attrs,Ie.attribute),s.length===0)return Gt(e);s.sort((a,l)=>a.start-l.start||l.end-l.start-(a.end-a.start));let r="",o=0;for(let a of s)a.start<o||(a.start>o&&(r+=Gt(e.slice(o,a.start))),r+=`<span class="${a.cls}">${Gt(e.slice(a.start,a.end))}</span>`,o=a.end);return o<e.length&&(r+=Gt(e.slice(o))),r}function Im(e){if(!e)return null;let t=e.split(".").pop()?.toLowerCase();if(!t)return null;let s=Qd[t];return typeof s=="string"&&(s=Qd[s]),s||null}function Xd(e,t){if(!e)return Gt(e||"");let s=Im(t);return s?Cm(e,s):Gt(e)}var Ss,Qd,Ie,Zd=O(()=>{Ss={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},Qd={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}},Ie={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 Jd(e,t,s){let n=[],i=0,r=0;if(t!=null){let f=t.split(`
|
|
1830
1830
|
`);for(let g=0;g<f.length;g++)n.push({type:"addition",oldNum:"",oldText:"",newNum:g+1,newText:f[g]}),i++;return{lines:n,stats:{additions:i,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(`
|
|
1831
|
-
`),a=0,l=0,c=!1,d=[],u=[],p=()=>{let f=Math.max(d.length,u.length);for(let g=0;g<f;g++){let
|
|
1831
|
+
`),a=0,l=0,c=!1,d=[],u=[],p=()=>{let f=Math.max(d.length,u.length);for(let g=0;g<f;g++){let b=d[g],h=u[g];b&&h?n.push({type:"modification",oldNum:b.num,oldText:b.text,newNum:h.num,newText:h.text}):b?n.push({type:"deletion",oldNum:b.num,oldText:b.text,newNum:"",newText:""}):h&&n.push({type:"addition",oldNum:"",oldText:"",newNum:h.num,newText:h.text})}d=[],u=[]};for(let f of o){if(f.startsWith("diff --git")||f.startsWith("index ")||f.startsWith("---")||f.startsWith("+++")||f.startsWith("\\"))continue;let g=f.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(g){p(),a=parseInt(g[1]),l=parseInt(g[2]),c=!0,n.push({type:"hunk",oldNum:"\xB7\xB7\xB7",oldText:f,newNum:"\xB7\xB7\xB7",newText:f});continue}if(c)if(f.startsWith("-"))u.length>0&&d.length===0&&p(),d.push({num:a++,text:f.substring(1)}),r++;else if(f.startsWith("+"))u.push({num:l++,text:f.substring(1)}),i++;else{p();let b=f.startsWith(" ")?f.substring(1):f;n.push({type:"context",oldNum:a++,oldText:b,newNum:l++,newText:b})}}return p(),{lines:n,stats:{additions:i,deletions:r},content:e}}var eu=O(()=>{});function tu(e,t){let{effectiveGitWorkDir:s,gitOperating:n,gitOpFeedback:i,commitMessage:r}=t,o=null,a=null,l=(y,m)=>{o&&clearTimeout(o),i.value={ok:y,message:m},o=setTimeout(()=>{i.value=null},4e3)},c=(y,m)=>{e.currentAgent&&(y.value=!0,m.value="",e.sendWsMessage({type:"git_status",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:s.value,_clientId:e.clientId}))},d=(y,m={})=>{e.currentAgent&&(n.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{n.value&&(n.value=!1,l(!1,"Operation timed out"))},15e3),e.sendWsMessage({type:y,conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:s.value,_clientId:e.clientId,...m}))};return{showFeedback:l,loadGitStatus:c,gitOp:d,stageFile:y=>d("git_add",{filePath:y}),unstageFile:y=>d("git_reset",{filePath:y}),discardFile:y=>{confirm("Discard changes to "+y+"?")&&d("git_restore",{filePath:y})},stageAll:()=>d("git_add",{addAll:!0}),unstageAll:()=>d("git_reset",{resetAll:!0}),commitChanges:()=>{let y=r.value.trim();y&&d("git_commit",{commitMessage:y})},pushChanges:()=>d("git_push"),handleGitOpResult:(y,m)=>{n.value=!1,a&&(clearTimeout(a),a=null),y.success?(l(!0,y.message||y.operation+" succeeded"),y.operation==="commit"&&(r.value=""),m()):l(!1,y.error||y.operation+" failed")},cleanup:()=>{o&&clearTimeout(o),a&&clearTimeout(a)}}}var su=O(()=>{});function nu(e,t){let s=Vue.ref(!1),n=Vue.ref(""),i=Vue.ref([]),r=Vue.ref(!1),o=Vue.ref(""),a=g=>{r.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:i,folderPickerLoading:r,folderPickerSelected:o,openFolderPicker:()=>{s.value=!0,o.value="",r.value=!0;let g=t.value||"";n.value=g,i.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("\\"),b=g?"\\":"/",h=n.value.replace(/[/\\]$/,"").split(/[/\\]/);if(h.pop(),h.length===0)n.value="",a("");else if(g&&h.length===1&&/^[A-Za-z]:$/.test(h[0]))n.value=h[0]+"\\",a(h[0]+"\\");else{let A=h.join(b);n.value=A,a(A)}},folderPickerSelectItem:g=>{o.value=g.name},folderPickerEnter:g=>{let b=n.value.includes("\\")||/^[A-Z]:/.test(g.name)?"\\":"/",h;n.value?h=n.value.replace(/[/\\]$/,"")+b+g.name:h=g.name+(g.name.endsWith("\\")?"":"\\"),n.value=h,a(h)},confirmFolderPicker:(g,b)=>{let h=n.value;if(h){if(o.value){let A=h.includes("\\")?"\\":"/";h=h.replace(/[/\\]$/,"")+A+o.value}g.value=h,s.value=!1,b()}},handleDirectoryListing:g=>g.conversationId!=="_git_folder_picker"?!1:(r.value=!1,i.value=(g.entries||[]).filter(b=>b.type==="directory").sort((b,h)=>b.name.localeCompare(h.name)),g.dirPath!=null&&(n.value=g.dirPath),!0)}}var iu=O(()=>{});var ru,ou=O(()=>{mo();Zd();eu();su();iu();ru={name:"GitStatusTab",template:`
|
|
1832
1832
|
<div class="git-status-tab git-three-col">
|
|
1833
1833
|
<!-- \u5DE6\u680F: \u6587\u4EF6\u5217\u8868 -->
|
|
1834
1834
|
<div class="git-col-files">
|
|
@@ -2072,7 +2072,7 @@ ${String(e||"").trim()}
|
|
|
2072
2072
|
</div>
|
|
2073
2073
|
</div>
|
|
2074
2074
|
</div>
|
|
2075
|
-
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=Q=>Q.split(/[/\\]/).pop()||Q,n=Q=>{let F=Q.split(/[/\\]/);return F.pop(),F.join("/")},i=Q=>mi(s(Q)),r=Vue.ref(null),o=Vue.reactive({staged:!1,modified:!1,untracked:!1}),a=Q=>{o[Q]=!o[Q]},l=Vue.ref(!1),c=Vue.ref(""),d=Vue.ref(null),u=Vue.ref([]),p=Vue.computed(()=>e.effectiveWorkDir||""),f=Vue.ref(""),g=Vue.computed(()=>f.value.trim()||p.value),v=Vue.ref(null),y=Vue.ref(!1),A=Vue.ref(!1),x=Vue.ref(""),k=Vue.ref(null),b=Vue.ref([]),m=Vue.ref(null),w=Vue.ref(!0),E=Vue.ref(!1),R=Vue.ref(""),q=Vue.ref(null),$=Vue.ref(0),P=Vue.ref(0),D=Q=>Q==null||Q===""?"":Xd(Q,v.value||""),M=Vue.ref(parseInt(localStorage.getItem("gitDiffFontSize"))||12),C=Q=>{M.value=Math.max(8,Math.min(24,Q)),localStorage.setItem("gitDiffFontSize",M.value.toString())},T=()=>C(M.value+1),N=()=>C(M.value-1),H=Q=>{Q.deltaY<0?T():Q.deltaY>0&&N()},U=Vue.computed(()=>{let Q=b.value;if(!Q||Q.length===0)return[];let F=Q.length,se=[],oe=0;for(;oe<F;){let we=Q[oe];if(we.type==="addition"||we.type==="deletion"||we.type==="modification"){let W=we.type==="modification"?"modification":we.type,J=oe;for(;oe<F&&(Q[oe].type===W||Q[oe].type==="modification"&&W!=="modification");)oe++;let he=oe-J;se.push({type:W,top:J/F*100,height:Math.max(he/F*100,.5)})}else oe++}return se}),ie=Q=>{let F=r.value;if(!F)return;let se=Q.currentTarget.getBoundingClientRect(),oe=(Q.clientY-se.top)/se.height;F.scrollTop=oe*(F.scrollHeight-F.clientHeight)},Y=Vue.computed(()=>u.value.filter(Q=>Q.indexStatus!==" "&&Q.indexStatus!=="?")),G=Vue.computed(()=>u.value.filter(Q=>Q.workTreeStatus==="M"||Q.workTreeStatus==="D")),ee=Vue.computed(()=>u.value.filter(Q=>Q.indexStatus==="?"&&Q.workTreeStatus==="?")),re=tu(e,{effectiveGitWorkDir:g,gitOperating:E,gitOpFeedback:q,commitMessage:R}),ge=()=>re.loadGitStatus(l,c),h=()=>{ge()},_=nu(e,g),X=Q=>hi(Q),ne=()=>_.confirmFolderPicker(f,ge),me=(Q,F)=>{v.value=Q.path,y.value=F,A.value=!0,x.value="",k.value=null,b.value=[],m.value=null;let se=Q.indexStatus==="?"&&Q.workTreeStatus==="?";e.sendWsMessage({type:"git_diff",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:g.value,filePath:Q.path,staged:F,untracked:se,fullFile:w.value,_clientId:e.clientId})},Se=()=>{if(w.value=!w.value,v.value){let Q=u.value.find(F=>F.path===v.value);Q&&me(Q,y.value)}},Ce=Q=>{let F=Q.detail;if(F)switch(F.type){case"directory_listing":{if(_.handleDirectoryListing(F))return;break}case"git_status_result":{if(l.value=!1,F.error){c.value=F.error,d.value=null,u.value=[];return}if(c.value="",d.value=F.branch||"HEAD",u.value=F.files||[],$.value=F.ahead||0,P.value=F.behind||0,v.value){let se=u.value.find(oe=>oe.path===v.value);if(se){let oe=se.indexStatus!==" "&&se.indexStatus!=="?";y.value=oe}else v.value=null,k.value=null,b.value=[],m.value=null}break}case"git_diff_result":{if(A.value=!1,F.error){x.value=F.error;return}x.value="";let se=Jd(F.diff,F.newFileContent,t);m.value=se.stats,b.value=se.lines,k.value=se.content;break}case"git_op_result":{re.handleGitOpResult(F,ge);break}}};Vue.watch(()=>e.currentAgent,()=>{d.value=null,u.value=[],c.value="",v.value=null,k.value=null,e.currentAgent&&Vue.nextTick(()=>ge())}),Vue.watch(()=>e.currentConversation,()=>{e.currentAgent&&(v.value=null,k.value=null,b.value=[],m.value=null,Vue.nextTick(()=>ge()))});let te=()=>ge();return Vue.onMounted(()=>{window.addEventListener("workbench-message",Ce),e.currentAgent&&ge()}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",Ce),re.cleanup()}),{store:e,getFileName:s,getDirName:n,getFileIconHtml:i,hlLine:D,collapsedGroups:o,toggleGroup:a,gitLoading:l,gitError:c,gitBranch:d,gitFiles:u,gitWorkDir:f,defaultWorkDir:p,changeGitWorkDir:h,stagedFiles:Y,modifiedFiles:G,untrackedFiles:ee,selectedGitFile:v,selectedStaged:y,diffLoading:A,diffError:x,diffContent:k,diffLines:b,diffStats:m,diffFullFile:w,toggleDiffMode:Se,scrollMarkers:U,diffScrollContainer:r,onMarkerClick:ie,fontSize:M,zoomIn:T,zoomOut:N,onWheel:H,gitOperating:E,commitMessage:R,gitOpFeedback:q,gitAhead:$,gitBehind:P,stageFile:re.stageFile,unstageFile:re.unstageFile,discardFile:re.discardFile,stageAll:re.stageAll,unstageAll:re.unstageAll,commitChanges:re.commitChanges,pushChanges:re.pushChanges,selectGitFile:me,refresh:te,folderPickerOpen:_.folderPickerOpen,folderPickerPath:_.folderPickerPath,folderPickerEntries:_.folderPickerEntries,folderPickerLoading:_.folderPickerLoading,folderPickerSelected:_.folderPickerSelected,getFolderIcon:X,openFolderPicker:_.openFolderPicker,folderPickerNavigateUp:_.folderPickerNavigateUp,folderPickerSelectItem:_.folderPickerSelectItem,folderPickerEnter:_.folderPickerEnter,confirmFolderPicker:ne}}}});function au(e){let t=Vue.ref(!1),s=Vue.ref(!1),n=Vue.ref(""),i=Vue.ref(""),r=Vue.ref(!1),o=Vue.ref(!1),a=Vue.ref(0),l=Vue.ref(-1),c=Vue.ref(null),d=Vue.ref(null),u=[],p=[],f=()=>{let $=e.value?.cmInstance;if(!$)return;let D=$.getWrapperElement().querySelector(".cm-find-scrollbar-annotations");D&&D.remove()},g=()=>{let $=e.value?.cmInstance;if(!$||p.length===0)return;f();let P=$.getWrapperElement();if(!P.querySelector(".CodeMirror-vscrollbar"))return;let M=$.lineCount();if(M===0)return;let C=document.createElement("div");C.className="cm-find-scrollbar-annotations";for(let T of p){let N=T.from.line/M*100,H=document.createElement("div");H.className="cm-find-scrollbar-tick",H.style.top=N+"%",C.appendChild(H)}P.appendChild(C)},v=()=>{for(let $ of u)try{$.clear()}catch{}u=[],p=[],a.value=0,l.value=-1,f()},y=$=>{let P=e.value?.cmInstance;if(!P||!p[$])return;for(let M=0;M<u.length;M++){if(!u[M])continue;let C=u[M].find();C&&(u[M].clear(),u[M]=P.markText(C.from,C.to,{className:"cm-find-highlight"}))}let D=p[$];if(u[$]){let M=u[$].find();M&&(u[$].clear(),u[$]=P.markText(M.from,M.to,{className:"cm-find-highlight cm-find-current"}))}setTimeout(()=>{P.scrollIntoView({from:D.from,to:D.to},100)},0)},A=()=>{v();let $=e.value?.cmInstance;if(!$||!n.value)return;let P=n.value;if(P.length<3)return;let D=$.getValue(),M=r.value,C=o.value,T=[];try{if(C){let N=M?"g":"gi",H=new RegExp(P,N),U;for(;(U=H.exec(D))!==null;){if(U[0].length===0){H.lastIndex++;continue}let ie=$.posFromIndex(U.index),Y=$.posFromIndex(U.index+U[0].length);if(T.push({from:ie,to:Y}),T.length>1e4)break}}else{let N=M?P:P.toLowerCase(),H=M?D:D.toLowerCase(),U=0;for(;(U=H.indexOf(N,U))!==-1;){let ie=$.posFromIndex(U),Y=$.posFromIndex(U+P.length);if(T.push({from:ie,to:Y}),U+=P.length,T.length>1e4)break}}}catch{return}p=T,a.value=T.length;for(let N of T)u.push($.markText(N.from,N.to,{className:"cm-find-highlight"}));if(T.length>0){let N=$.getCursor(),H=0;for(let U=0;U<T.length;U++){if(CodeMirror.cmpPos(T[U].from,N)>=0){H=U;break}U===T.length-1&&(H=0)}l.value=H,y(H)}g()};return{findBarVisible:t,replaceBarVisible:s,findQuery:n,replaceQuery:i,findCaseSensitive:r,findUseRegex:o,findMatchCount:a,findMatchIndex:l,findInputRef:c,replaceInputRef:d,clearFindMarkers:v,performFind:A,onFindInput:()=>{A()},findNext:()=>{if(p.length===0)return;let $=(l.value+1)%p.length;l.value=$,y($)},findPrev:()=>{if(p.length===0)return;let $=(l.value-1+p.length)%p.length;l.value=$,y($)},openFindBar:($=!1)=>{t.value=!0,s.value=$;let P=e.value?.cmInstance;if(P){let D=P.getSelection();D&&(n.value=D)}Vue.nextTick(()=>{c.value?.focus(),c.value?.select(),n.value&&A()})},closeFindBar:()=>{v(),t.value=!1,s.value=!1;let $=e.value?.cmInstance;$&&$.focus()},toggleReplaceBar:()=>{s.value=!s.value,s.value&&Vue.nextTick(()=>d.value?.focus())},replaceOne:()=>{let $=e.value?.cmInstance;if(!$||p.length===0||l.value<0)return;let P=p[l.value];$.replaceRange(i.value,P.from,P.to),A()},replaceAll:()=>{let $=e.value?.cmInstance;!$||p.length===0||($.operation(()=>{for(let P=p.length-1;P>=0;P--)$.replaceRange(i.value,p[P].from,p[P].to)}),A())}}}var lu=O(()=>{});function cu(e,t){let{getEffectiveWorkDir:s,treePath:n}=t,i=Vue.reactive(new Set),r=Vue.ref(-1),o=Vue.ref(!1),a=Vue.ref(null),l=null,c=null,d=Vue.ref(!1),u=Vue.ref(""),p=Vue.ref("file"),f=Vue.ref(null),g=Vue.ref(!1),v=Vue.ref(""),y=Vue.ref(null),A=Vue.reactive({visible:!1,x:0,y:0,entry:null}),x=Vue.ref(!1),k=Vue.ref(""),b=Vue.ref(null),m=null,w=Vue.reactive({dragging:null,dropTarget:null}),E=Vue.ref(!1),R=(W,J)=>{l&&clearTimeout(l),a.value={ok:W,message:J},l=setTimeout(()=>{a.value=null},4e3)},q=()=>{o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,R(!1,"Operation timed out"))},15e3)},$=W=>{i.has(W)?i.delete(W):i.add(W)},P=()=>{i.clear(),r.value=-1},D=W=>{p.value=W,u.value="",d.value=!0,Vue.nextTick(()=>f.value?.focus())},M=()=>{let W=u.value.trim();if(!W)return;d.value=!1;let J=n.value||s();if(!J)return;let he=J.includes("\\")?"\\":"/",fe=J.replace(/[/\\]$/,"")+he+W;q(),e.sendWsMessage({type:"create_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:fe,isDirectory:p.value==="directory",workDir:s(),_clientId:e.clientId})},C=(W,J)=>{let he=W.path.split("/").pop();confirm(J("files.deleteConfirm",{name:he})+(W.type==="directory"?J("files.deleteDirHint"):""))&&(q(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],workDir:s(),_clientId:e.clientId}))},T=W=>{let J=i.size;J!==0&&confirm(W("files.deleteSelectedConfirm",{count:J}))&&(q(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...i],workDir:s(),_clientId:e.clientId}))},N=()=>{v.value=n.value||s()||"",g.value=!0,Vue.nextTick(()=>y.value?.focus())},H=()=>{let W=v.value.trim();!W||i.size===0||(g.value=!1,q(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...i],destination:W,workDir:s(),_clientId:e.clientId}))},U=(W,J)=>{let Re=W.clientX,Ve=W.clientY;Re+180>window.innerWidth&&(Re=window.innerWidth-180),Ve+240>window.innerHeight&&(Ve=window.innerHeight-240),A.entry=J,A.x=Re,A.y=Ve,A.visible=!0},ie=()=>{A.visible=!1};return{selectedPaths:i,lastClickedIndex:r,fileOperating:o,fileOpFeedback:a,newFileDialogVisible:d,newFileName:u,newFileType:p,newFileInput:f,moveDialogVisible:g,moveDestination:v,moveDestInput:y,contextMenu:A,renameDialogVisible:x,renameNewName:k,renameInput:b,dragState:w,externalDropActive:E,showFileOpFeedback:R,toggleSelection:$,clearSelection:P,showNewFileDialog:D,confirmNewFile:M,deleteSingleFile:C,deleteSelected:T,openMoveDialog:N,confirmMove:H,showContextMenu:U,hideContextMenu:ie,ctxRename:()=>{let W=A.entry;ie(),W&&(k.value=W.name,x.value=!0,Vue.nextTick(()=>{let J=b.value;if(J)if(J.focus(),W.type==="file"){let he=W.name.lastIndexOf(".");he>0?J.setSelectionRange(0,he):J.select()}else J.select()}))},confirmRename:()=>{let W=A.entry,J=k.value.trim();if(!J||!W||J===W.name){x.value=!1;return}x.value=!1;let he=W.path.replace(/\/$/,"").split("/");he.pop();let fe=he.join("/")||"/";q(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],destination:fe,newName:J,workDir:s(),_clientId:e.clientId})},ctxCopy:()=>{let W=A.entry;if(ie(),!W)return;let J=W.path.replace(/\/$/,"").split("/");J.pop();let he=J.join("/")||"/";q(),e.sendWsMessage({type:"copy_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],destination:he,workDir:s(),_clientId:e.clientId})},ctxMoveTo:()=>{let W=A.entry;ie(),W&&(i.clear(),i.add(W.path),N())},ctxDelete:W=>{let J=A.entry;ie(),J&&C(J,W)},ctxDownload:()=>{let W=A.entry;ie(),!(!W||W.type!=="file")&&(m=W.path,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:W.path,workDir:s(),_clientId:e.clientId}))},onDragStart:(W,J)=>{w.dragging=J,W.dataTransfer.setData("text/plain",J.path),W.dataTransfer.effectAllowed="move"},onDragOver:(W,J)=>{if(!w.dragging&&W.dataTransfer.types.includes("Files")){J.type==="directory"&&(W.dataTransfer.dropEffect="copy",w.dropTarget=J.path);return}!w.dragging||J.type!=="directory"||J.path!==w.dragging.path&&(J.path.startsWith(w.dragging.path+"/")||(W.dataTransfer.dropEffect="move",w.dropTarget=J.path))},onDragLeave:W=>{let J=W.relatedTarget;J&&W.currentTarget.contains(J)||(w.dropTarget=null)},onDrop:(W,J,he)=>{if(w.dropTarget=null,!w.dragging&&W.dataTransfer.files.length>0&&J.type==="directory"){he(W.dataTransfer.files,J.path);return}if(!w.dragging||J.type!=="directory"){w.dragging=null;return}if(J.path===w.dragging.path){w.dragging=null;return}q(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[w.dragging.path],destination:J.path,workDir:s(),_clientId:e.clientId}),w.dragging=null},onTreeDragOver:W=>{w.dragging||W.dataTransfer.types.includes("Files")&&(W.dataTransfer.dropEffect="copy",E.value=!0)},onTreeDragLeave:W=>{let J=W.relatedTarget;J&&W.currentTarget.contains(J)||(E.value=!1)},onTreeDrop:(W,J,he)=>{if(E.value=!1,!w.dragging&&W.dataTransfer.files.length>0){let fe=n.value||J||s();he(W.dataTransfer.files,fe)}},handleExternalFileDrop:async(W,J)=>{if(!J)return;let he=[],fe=[];for(let Re of W)fe.push(new Promise(Ve=>{let He=new FileReader;He.onload=()=>{let V=btoa(new Uint8Array(He.result).reduce((Z,pe)=>Z+String.fromCharCode(pe),""));he.push({name:Re.name,data:V}),Ve()},He.onerror=()=>Ve(),He.readAsArrayBuffer(Re)}));await Promise.all(fe),he.length!==0&&(o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,R(!1,"Upload timed out"))},3e4),e.sendWsMessage({type:"upload_to_dir",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,files:he,dirPath:J,workDir:s(),_clientId:e.clientId}))},handleFileOpResult:(W,J,he)=>{o.value=!1,c&&(clearTimeout(c),c=null),R(W.success,W.success?W.message:W.error||"Operation failed"),W.success&&(he&&J(he),(W.operation==="delete"||W.operation==="move")&&(i.clear(),r.value=-1))},getPendingDownload:()=>m,clearPendingDownload:()=>{m=null},cleanup:()=>{l&&clearTimeout(l),c&&clearTimeout(c)}}}var du=O(()=>{});function uu(e,{getEffectiveWorkDir:t,normalizePath:s,selectedPaths:n,lastClickedIndex:i,openFileInTab:r,clearSelection:o}){let a=Vue.ref(""),l=Vue.ref(""),c=Vue.reactive({}),d=Vue.ref(!1),u=Vue.ref(null),p=Vue.computed(()=>{if(!l.value)return"EXPLORER";let D=l.value.replace(/[\\/]+$/,"").split(/[\\/]/);return(D[D.length-1]||l.value).toUpperCase()}),f=Vue.computed(()=>l.value?!!c[l.value]?.expanded:!1),g=()=>{if(!l.value)return;let D=c[l.value];D&&(D.expanded=!D.expanded)},v=()=>{for(let D of Object.keys(c))c[D]&&(c[D].expanded=!1)},y=()=>{d.value=!0,Vue.nextTick(()=>u.value?.focus())},A=()=>{d.value=!1,m()},x=()=>{d.value=!1},k=Vue.computed(()=>{let D=[],M=(C,T)=>{let N=c[C];if(!(!N||!N.entries))for(let H of N.entries)D.push({...H,depth:T}),H.type==="directory"&&c[H.path]?.expanded&&M(H.path,T+1)};return l.value&&c[l.value]?.expanded&&M(l.value,0),D}),b=D=>{let M=s(D);c[M]?c[M].loading=!0:c[M]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:D,workDir:t(),_clientId:e.clientId})},m=()=>{let D=a.value.trim();if(!D)return;let M=s(D);l.value=M,Object.keys(c).forEach(C=>delete c[C]),c[M]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:D,workDir:t(),_clientId:e.clientId})},w=D=>{let M=s(D),C=c[M];C?C.loaded?C.expanded=!C.expanded:(C.expanded=!0,b(D)):(c[M]={entries:[],expanded:!0,loaded:!1,loading:!1},b(D))},E=(D,M)=>{let C=k.value,T=C.findIndex(N=>N.path===D.path);if(M&&(M.shiftKey||M.ctrlKey||M.metaKey)){if(M.shiftKey&&i.value>=0&&T>=0){let N=Math.min(i.value,T),H=Math.max(i.value,T);!M.ctrlKey&&!M.metaKey&&n.clear();for(let U=N;U<=H;U++)n.add(C[U].path)}else n.has(D.path)?n.delete(D.path):n.add(D.path);i.value=T;return}n.size>0&&(n.clear(),i.value=-1),D.type==="directory"?w(D.path):r(D.path,D.name),i.value=T},R=D=>{let M=s(D.dirPath);if(D.error){c[M]&&(c[M].loading=!1);return}let C=(D.entries||[]).sort((H,U)=>H.type===U.type?H.name.localeCompare(U.name):H.type==="directory"?-1:1),T=M.replace(/\/$/,""),N=C.map(H=>({...H,path:T+"/"+H.name}));c[M]?(c[M].entries=N,c[M].loaded=!0,c[M].loading=!1):c[M]={entries:N,expanded:!0,loaded:!0,loading:!1},M===l.value&&(a.value=D.dirPath)},q=()=>{Object.keys(c).forEach(D=>delete c[D])};return{treePath:a,treeRootPath:l,treeNodes:c,flattenedTree:k,editingTreePath:d,treePathInputRef:u,rootFolderName:p,rootExpanded:f,toggleRootExpand:g,collapseAll:v,startTreePathEdit:y,confirmTreePath:A,cancelTreePathEdit:x,loadTreeDirectory:b,loadRootDirectory:m,toggleDirectory:w,onTreeItemClick:E,handleDirectoryListing:R,clearTreeNodes:q,initFileBrowser:()=>{let D=t();if(D){let M=s(D);a.value=D,l.value=M,q(),b(D)}},refresh:()=>{l.value&&b(l.value)}}}var pu=O(()=>{});function Cs(e){let t=e.lastIndexOf(".");if(t<0)return"text";let s=e.substring(t).toLowerCase();return Im.has(s)?"office":Am.has(s)?"pdf":xm.has(s)?"image":"text"}function Ct(e){let t=e.lastIndexOf(".");return t<0?!1:Tm.has(e.substring(t).toLowerCase())}function Mm(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 fu(e,{activeFile:t,editorContainer:s,fontSize:n,clearFindMarkers:i,openFindBar:r,saveFile:o}){let a=Vue.ref(""),l=Vue.reactive({}),c=()=>{},d=()=>{},u=({openQuickOpen:x,openGoToLine:k})=>{c=x,d=k},p=(x,k=0)=>{if(!s.value){k<20&&setTimeout(()=>p(x,k+1),100);return}if(!x)return;if(s.value.innerHTML="",typeof CodeMirror>"u"){let w=document.createElement("textarea");w.value=x.content||"",w.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;",w.spellcheck=!1,w.addEventListener("input",()=>{x.content=w.value,x.isDirty=w.value!==x.originalContent}),w.addEventListener("keydown",E=>{(E.ctrlKey||E.metaKey)&&E.key==="s"&&(E.preventDefault(),o())}),s.value.appendChild(w),a.value="";return}let m=document.documentElement.getAttribute("data-theme")==="dark"?"material-darker":"default";try{let w=CodeMirror(s.value,{value:x.content||"",mode:Mm(x.name),theme:m,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":()=>r(!1),"Cmd-F":()=>r(!1),"Ctrl-R":()=>r(!0),"Cmd-R":()=>r(!0),"Ctrl-H":()=>r(!0),"Cmd-H":()=>r(!0)}});w.on("change",()=>{let R=w.getValue();x.content=R,x.isDirty=R!==x.originalContent}),x.cmInstance=w,w.getWrapperElement().style.fontSize=n.value+"px";let E=e.currentConversation;E&&l[E]?.[x.path]&&w.setHistory(l[E][x.path]),Vue.nextTick(()=>{w.refresh(),setTimeout(()=>w.refresh(),200)}),a.value=""}catch(w){a.value=`Editor error: ${w.message}`}};return{debugStatus:a,undoHistoryMap:l,createEditor:p,destroyEditor:()=>{i();let x=t.value;x?.cmInstance&&(x.cmInstance.toTextArea&&x.cmInstance.toTextArea(),x.cmInstance=null),s.value&&(s.value.innerHTML="")},setKeyBindings:u,saveCurrentUndoHistory:()=>{let x=e.currentConversation;if(!x)return;let k=t.value;k?.cmInstance&&(l[x]||(l[x]={}),l[x][k.path]=k.cmInstance.getHistory())},saveAllUndoHistory:x=>{if(!x)return;let k=t.value;k?.cmInstance&&(l[x]||(l[x]={}),l[x][k.path]=k.cmInstance.getHistory())},cleanupUndoHistory:(x,k)=>{x&&l[x]&&delete l[x][k]},deleteConversationHistory:x=>{delete l[x]}}}var Im,Am,xm,Tm,cn=O(()=>{Im=new Set([".docx",".xlsx",".xls",".pptx",".ppt"]),Am=new Set([".pdf"]),xm=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico"]),Tm=new Set([".md",".markdown",".mdx"])});function gu(e,{editorContainer:t,createEditor:s,t:n}){let i=Vue.ref(!0),r=Vue.ref(null),o=Vue.ref(null),a=Vue.computed(()=>{let f=e.value;return!!(f&&Ct(f.name))}),l=Vue.computed(()=>{let f=e.value;if(!f||!Ct(f.name)||f.content==null)return"";try{if(typeof marked<"u")return marked.parse(f.content)}catch{}return"<pre>"+(f.content||"")+"</pre>"});function c(){Xe(r.value)}async function d(){await Xe(r.value)}function u(){i.value=!1,Vue.nextTick(()=>{let f=e.value;f&&t.value&&s(f)})}return{mdPreviewMode:i,mdPreviewRef:r,officePreviewContainer:o,isActiveMarkdown:a,mdRenderedHtml:l,initMermaid:c,renderMermaidBlocks:d,switchToMdEdit:u,renderOfficeLocal:f=>{let g=o.value;if(!g||!f._arrayBuffer)return;g.innerHTML="";let v=("."+f.name.split(".").pop()).toLowerCase();if(v===".docx"&&window.docx)window.docx.renderAsync(f._arrayBuffer,g,null,{className:"docx-preview-content",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!0}).catch(y=>{f.previewError=y.message});else if(v===".xlsx"||v===".xls")try{let y=XLSX.read(f._arrayBuffer,{type:"array"}),A=y.SheetNames[0],x=XLSX.utils.sheet_to_html(y.Sheets[A],{editable:!1});g.innerHTML='<div class="xlsx-sheet-tabs">'+y.SheetNames.map((k,b)=>`<button class="xlsx-sheet-tab${b===0?" active":""}" data-idx="${b}">${k}</button>`).join("")+'</div><div class="xlsx-table-wrap">'+x+"</div>",g.querySelectorAll(".xlsx-sheet-tab").forEach(k=>{k.addEventListener("click",()=>{let b=parseInt(k.dataset.idx),m=y.SheetNames[b],w=XLSX.utils.sheet_to_html(y.Sheets[m],{editable:!1});g.querySelector(".xlsx-table-wrap").innerHTML=w,g.querySelectorAll(".xlsx-sheet-tab").forEach(E=>E.classList.remove("active")),k.classList.add("active")})})}catch(y){f.previewError=y.message}else(v===".pptx"||v===".ppt")&&(g.innerHTML='<div class="preview-unsupported">'+(n?n("files.pptxNotSupported"):"PowerPoint preview not supported")+"</div>")}}}var mu=O(()=>{en();cn()});function hu(e,{getEffectiveWorkDir:t,treePath:s,openFileInTab:n,normalizePath:i,treeRootPath:r,treeNodes:o,loadTreeDirectory:a}){let l=Vue.ref(""),c=Vue.ref([]),d=Vue.ref(!1),u=null,p=Vue.ref(!1),f=Vue.ref(""),g=Vue.ref([]),v=Vue.ref(0),y=Vue.ref(!1),A=Vue.ref(null),x=null,k=Vue.ref(!1),b=Vue.ref(""),m=Vue.ref(null),w=G=>{!e.currentAgent||!G.trim()||e.sendWsMessage({type:"file_search",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,query:G.trim(),dirPath:s.value||t()||"",_clientId:e.clientId})},E=()=>{if(u&&clearTimeout(u),!l.value.trim()){c.value=[],d.value=!1;return}d.value=!0,u=setTimeout(()=>{w(l.value)},300)},R=()=>{l.value="",c.value=[],d.value=!1},q=G=>{if(G.type==="directory"){let ee=i(G.fullPath);r.value=ee,s.value=G.fullPath,Object.keys(o).forEach(re=>delete o[re]),a(G.fullPath),R()}else n(G.fullPath,G.name),R()},$=()=>{p.value=!0,f.value="",g.value=[],v.value=0,y.value=!1,Vue.nextTick(()=>A.value?.focus())},P=()=>{p.value=!1,f.value="",g.value=[]},D=()=>{if(x&&clearTimeout(x),!f.value.trim()){g.value=[],y.value=!1;return}y.value=!0,v.value=0,x=setTimeout(()=>{w(f.value)},200)},M=()=>{g.value.length>0&&(v.value=(v.value+1)%g.value.length)},C=()=>{g.value.length>0&&(v.value=(v.value-1+g.value.length)%g.value.length)},T=G=>{G.type!=="directory"&&n(G.fullPath,G.name),P()},N=()=>{let G=g.value[v.value];G&&T(G)},H=()=>{k.value=!0,b.value="",Vue.nextTick(()=>m.value?.focus())},U=()=>{k.value=!1,b.value=""};return{searchQuery:l,searchResults:c,searchLoading:d,onSearchInput:E,clearSearch:R,onSearchResultClick:q,quickOpenVisible:p,quickOpenQuery:f,quickOpenResults:g,quickOpenSelectedIndex:v,quickOpenLoading:y,quickOpenInput:A,openQuickOpen:$,closeQuickOpen:P,onQuickOpenInput:D,quickOpenSelectNext:M,quickOpenSelectPrev:C,quickOpenConfirm:N,quickOpenOpenFile:T,goToLineVisible:k,goToLineValue:b,goToLineInput:m,openGoToLine:H,closeGoToLine:U,goToLineConfirm:G=>{let ee=parseInt(b.value);if(isNaN(ee)||ee<1)return;let re=G.value;if(re?.cmInstance){let ge=re.cmInstance,h=Math.min(ee-1,ge.lineCount()-1);ge.setCursor({line:h,ch:0}),ge.scrollIntoView({line:h,ch:0},100),ge.focus()}U()},handleFileSearchResult:G=>{let ee=G.results||[];p.value?G.query&&G.query.trim()===f.value.trim()&&(g.value=ee,y.value=!1,v.value=0):G.query&&G.query.trim()===l.value.trim()&&(c.value=ee,d.value=!1)}}}var vu=O(()=>{});function yu(e,{getEffectiveWorkDir:t,treePath:s,treeRootPath:n,treeNodes:i,normalizePath:r,loadTreeDirectory:o}){let a=Vue.ref(!1),l=Vue.ref(""),c=Vue.ref([]),d=Vue.ref(!1),u=Vue.ref(""),p=()=>{a.value=!0,u.value="",d.value=!0;let k=s.value||t()||"";l.value=k,c.value=[],e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:k,workDir:t(),_clientId:e.clientId})},f=k=>{d.value=!0,u.value="",e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:k,workDir:t(),_clientId:e.clientId})};return{folderPickerOpen:a,folderPickerPath:l,folderPickerEntries:c,folderPickerLoading:d,folderPickerSelected:u,openFolderPicker:p,folderPickerNavigateUp:()=>{if(!l.value)return;let k=l.value.includes("\\"),b=k?"\\":"/",m=l.value.replace(/[/\\]$/,"").split(/[/\\]/);if(m.pop(),m.length===0)l.value="",f("");else if(k&&m.length===1&&/^[A-Za-z]:$/.test(m[0]))l.value=m[0]+"\\",f(m[0]+"\\");else{let w=m.join(b);l.value=w,f(w)}},folderPickerSelectItem:k=>{u.value=k.name},folderPickerEnter:k=>{let b;if(!l.value)b=k.name+(k.name.endsWith("\\")?"":"\\");else{let m=l.value.includes("\\")||/^[A-Z]:/.test(k.name)?"\\":"/";b=l.value.replace(/[/\\]$/,"")+m+k.name}l.value=b,f(b)},confirmFolderPicker:()=>{let k=l.value;if(!k)return;if(u.value){let m=k.includes("\\")?"\\":"/";k=k.replace(/[/\\]$/,"")+m+u.value}s.value=k,a.value=!1;let b=r(k);n.value=b,Object.keys(i).forEach(m=>delete i[m]),i[b]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:k,workDir:t(),_clientId:e.clientId})},handleFolderPickerListing:k=>{d.value=!1,c.value=(k.entries||[]).filter(b=>b.type==="directory").sort((b,m)=>b.name.localeCompare(m.name)),k.dirPath!=null&&(l.value=k.dirPath)}}}var bu=O(()=>{});function wu(e,{normalizePath:t,getEffectiveWorkDir:s,editorContainer:n,createEditor:i,destroyEditor:r,clearFindMarkers:o,saveCurrentUndoHistory:a,saveAllUndoHistory:l,cleanupUndoHistory:c,deleteConversationHistory:d,debugStatus:u,mdPreviewMode:p,renderOfficeLocal:f,performFind:g,findBarVisible:v,findQuery:y,t:A}){let x=Vue.reactive({}),k=Vue.ref([]),b=Vue.ref(-1),m=Vue.ref(!1),w=Vue.ref(!1),E=Vue.computed(()=>b.value>=0&&b.value<k.value.length?k.value[b.value]:null),R=null,q=()=>{R&&clearTimeout(R),R=setTimeout(()=>{e.sendWsMessage({type:"update_file_tabs",openFiles:k.value.map(H=>({path:H.path})),activeIndex:b.value})},500)},$=H=>{H&&(l(H),k.value.length>0?x[H]={files:k.value.map(U=>({path:U.path,name:U.name,content:U.content,originalContent:U.originalContent,isDirty:U.isDirty,fileType:U.fileType})),activeIndex:b.value}:delete x[H],q())},P=H=>{if(r(),!H||!x[H]){k.value=[],b.value=-1;return}let U=x[H];k.value=U.files.map(ie=>({...ie,isDirty:ie.isDirty||!1,originalContent:ie.originalContent||ie.content,cmInstance:null,fileType:ie.fileType||Cs(ie.name||""),blobUrl:null,previewUrl:null,previewLoading:!1,localPreviewReady:!1,previewError:null})),b.value=U.activeIndex,Vue.nextTick(()=>{let ie=E.value;ie&&(!ie.fileType||ie.fileType==="text")&&n.value&&i(ie)})};function D(H,U){let ie=t(H),Y=k.value.findIndex(re=>re.path===ie);if(Y>=0){b.value!==Y&&(o(),a(),b.value=Y,Vue.nextTick(()=>{let re=k.value[Y];re&&re.content!=null&&(!re.fileType||re.fileType==="text")&&i(re)})),$(e.currentConversation);return}a();let G=U||ie.split(/[/\\]/).pop(),ee=Cs(G);k.value.push({path:ie,name:G,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:ee,blobUrl:null,previewUrl:null,previewLoading:ee!=="text",localPreviewReady:!1,previewError:null}),b.value=k.value.length-1,m.value=!0,ee==="text"&&r(),$(e.currentConversation),u.value=`Loading: ${H}`,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:H,workDir:s(),_clientId:e.clientId})}let M=H=>{H!==b.value&&(o(),a(),b.value=H,$(e.currentConversation),Vue.nextTick(()=>{let U=k.value[H];U&&(!U.fileType||U.fileType==="text"?Ct(U.name)?p.value=!0:U.content!=null&&n.value&&(i(U),v.value&&y.value&&Vue.nextTick(()=>g())):U.fileType==="office"&&U.localPreviewReady&&Vue.nextTick(()=>f(U)))}))},C=H=>{let U=k.value[H];if(U?.isDirty&&!confirm(A("files.unsavedConfirm",{name:U.name})))return;c(e.currentConversation,U.path),U.blobUrl&&URL.revokeObjectURL(U.blobUrl);let ie=H===b.value;k.value.splice(H,1),k.value.length===0?(b.value=-1,r()):b.value>=k.value.length?b.value=k.value.length-1:b.value>H?b.value--:ie&&b.value>=k.value.length&&(b.value=k.value.length-1),$(e.currentConversation),k.value.length>0&&ie&&Vue.nextTick(()=>{let Y=k.value[b.value];Y&&(!Y.fileType||Y.fileType==="text")&&Y.content!=null&&n.value&&i(Y)})};function T(){let H=E.value;!H||!H.isDirty||(w.value=!0,e.sendWsMessage({type:"write_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:H.path,content:H.content,workDir:s(),_clientId:e.clientId}))}return{fileTabsMap:x,openFiles:k,activeFileIndex:b,activeFile:E,fileLoading:m,fileSaving:w,saveTabsState:$,restoreTabsState:P,openFileInTab:D,switchToTab:M,closeFileTab:C,saveFile:T,handleConversationDeleted:H=>{let{conversationId:U}=H.detail;U&&(delete x[U],d(U))}}}var ku=O(()=>{cn()});function Su({store:e,normalizePath:t,getEffectiveWorkDir:s,openFiles:n,activeFileIndex:i,activeFile:r,fileLoading:o,fileSaving:a,saveTabsState:l,createEditor:c,openFileInTab:d,tree:u,fp:p,qo:f,ops:g,mdPreviewMode:v,renderOfficeLocal:y,editorContainer:A,debugStatus:x}){return{handleWorkbenchMessage:m=>{let w=m.detail;if(w)switch(w.type){case"directory_listing":{if(w.conversationId==="_folder_picker"){p.handleFolderPickerListing(w);return}u.handleDirectoryListing(w);break}case"file_content":{if(o.value=!1,w.error){x.value=`Error: ${w.error}`,g.clearPendingDownload();let q=t(w.filePath),$=n.value.find(P=>P.path===q);$&&($.previewLoading=!1,$.previewError=w.error);return}let E=t(w.filePath);if(g.getPendingDownload()&&t(g.getPendingDownload())===E){g.clearPendingDownload();try{if(w.binary){let q=`${location.protocol}//${location.host}/api/preview/${w.fileId}?token=${w.previewToken}`,$=document.createElement("a");$.href=q,$.download=E.split("/").pop()||"download",document.body.appendChild($),$.click(),document.body.removeChild($)}else{let q=new Blob([w.content||""],{type:"application/octet-stream"}),$=URL.createObjectURL(q),P=document.createElement("a");P.href=$,P.download=E.split("/").pop()||"download",document.body.appendChild(P),P.click(),document.body.removeChild(P),URL.revokeObjectURL($)}}catch{}return}let R=n.value.findIndex(q=>q.path===E);if(R>=0){let q=n.value[R];if(w.binary){q.previewLoading=!1;let $=`${location.protocol}//${location.host}/api/preview/${w.fileId}?token=${w.previewToken}`,P=q.fileType||Cs(q.name);q.fileType=P,P==="pdf"||P==="image"?fetch($).then(D=>D.blob()).then(D=>{q.blobUrl=URL.createObjectURL(D)}).catch(D=>{q.previewError=D.message}):P==="office"&&((localStorage.getItem("officePreviewMode")||"local")==="online"?q.previewUrl="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent($):fetch($).then(M=>M.arrayBuffer()).then(M=>{q._arrayBuffer=M,q.localPreviewReady=!0,R===i.value&&Vue.nextTick(()=>y(q))}).catch(M=>{q.previewError=M.message})),l(e.currentConversation);return}q.content=w.content||"",q.originalContent=w.content||"",q.isDirty=!1,l(e.currentConversation),R===i.value&&(Ct(q.name)&&v.value||Vue.nextTick(()=>{setTimeout(()=>c(q),100)}))}break}case"file_saved":{if(a.value=!1,w.error)return;let E=t(w.filePath),R=n.value.find(q=>q.path===E);R&&(R.originalContent=R.content,R.isDirty=!1,l(e.currentConversation));break}case"file_search_result":{f.handleFileSearchResult(w);break}case"file_op_result":{g.handleFileOpResult(w,u.loadTreeDirectory,u.treeRootPath.value);break}case"file_tabs_restored":{if(w.openFiles?.length>0&&n.value.length===0){let E=w.activeIndex||0,R=w.openFiles.length;for(let q of w.openFiles){let $=t(q.path),P=$.split("/").pop(),D=Cs(P);n.value.push({path:$,name:P,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:D,blobUrl:null,previewUrl:null,previewLoading:D!=="text",localPreviewReady:!1,previewError:null}),e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:q.path})}i.value=E>=0&&E<R?E:0}break}}},handleOpenFile:m=>{let{filePath:w}=m.detail,E=t(w);d(E,E.split("/").pop())}}}var Cu=O(()=>{cn()});var Iu,Au=O(()=>{mo();lu();du();pu();cn();mu();vu();bu();ku();Cu();Iu={name:"FilesTab",template:`
|
|
2075
|
+
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=Q=>Q.split(/[/\\]/).pop()||Q,n=Q=>{let F=Q.split(/[/\\]/);return F.pop(),F.join("/")},i=Q=>mi(s(Q)),r=Vue.ref(null),o=Vue.reactive({staged:!1,modified:!1,untracked:!1}),a=Q=>{o[Q]=!o[Q]},l=Vue.ref(!1),c=Vue.ref(""),d=Vue.ref(null),u=Vue.ref([]),p=Vue.computed(()=>e.effectiveWorkDir||""),f=Vue.ref(""),g=Vue.computed(()=>f.value.trim()||p.value),b=Vue.ref(null),h=Vue.ref(!1),A=Vue.ref(!1),x=Vue.ref(""),k=Vue.ref(null),y=Vue.ref([]),m=Vue.ref(null),w=Vue.ref(!0),E=Vue.ref(!1),R=Vue.ref(""),q=Vue.ref(null),$=Vue.ref(0),P=Vue.ref(0),D=Q=>Q==null||Q===""?"":Xd(Q,b.value||""),M=Vue.ref(parseInt(localStorage.getItem("gitDiffFontSize"))||12),C=Q=>{M.value=Math.max(8,Math.min(24,Q)),localStorage.setItem("gitDiffFontSize",M.value.toString())},T=()=>C(M.value+1),N=()=>C(M.value-1),H=Q=>{Q.deltaY<0?T():Q.deltaY>0&&N()},U=Vue.computed(()=>{let Q=y.value;if(!Q||Q.length===0)return[];let F=Q.length,se=[],oe=0;for(;oe<F;){let we=Q[oe];if(we.type==="addition"||we.type==="deletion"||we.type==="modification"){let W=we.type==="modification"?"modification":we.type,J=oe;for(;oe<F&&(Q[oe].type===W||Q[oe].type==="modification"&&W!=="modification");)oe++;let he=oe-J;se.push({type:W,top:J/F*100,height:Math.max(he/F*100,.5)})}else oe++}return se}),ie=Q=>{let F=r.value;if(!F)return;let se=Q.currentTarget.getBoundingClientRect(),oe=(Q.clientY-se.top)/se.height;F.scrollTop=oe*(F.scrollHeight-F.clientHeight)},Y=Vue.computed(()=>u.value.filter(Q=>Q.indexStatus!==" "&&Q.indexStatus!=="?")),G=Vue.computed(()=>u.value.filter(Q=>Q.workTreeStatus==="M"||Q.workTreeStatus==="D")),ee=Vue.computed(()=>u.value.filter(Q=>Q.indexStatus==="?"&&Q.workTreeStatus==="?")),re=tu(e,{effectiveGitWorkDir:g,gitOperating:E,gitOpFeedback:q,commitMessage:R}),ge=()=>re.loadGitStatus(l,c),v=()=>{ge()},_=nu(e,g),X=Q=>hi(Q),ne=()=>_.confirmFolderPicker(f,ge),me=(Q,F)=>{b.value=Q.path,h.value=F,A.value=!0,x.value="",k.value=null,y.value=[],m.value=null;let se=Q.indexStatus==="?"&&Q.workTreeStatus==="?";e.sendWsMessage({type:"git_diff",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:g.value,filePath:Q.path,staged:F,untracked:se,fullFile:w.value,_clientId:e.clientId})},Se=()=>{if(w.value=!w.value,b.value){let Q=u.value.find(F=>F.path===b.value);Q&&me(Q,h.value)}},Ce=Q=>{let F=Q.detail;if(F)switch(F.type){case"directory_listing":{if(_.handleDirectoryListing(F))return;break}case"git_status_result":{if(l.value=!1,F.error){c.value=F.error,d.value=null,u.value=[];return}if(c.value="",d.value=F.branch||"HEAD",u.value=F.files||[],$.value=F.ahead||0,P.value=F.behind||0,b.value){let se=u.value.find(oe=>oe.path===b.value);if(se){let oe=se.indexStatus!==" "&&se.indexStatus!=="?";h.value=oe}else b.value=null,k.value=null,y.value=[],m.value=null}break}case"git_diff_result":{if(A.value=!1,F.error){x.value=F.error;return}x.value="";let se=Jd(F.diff,F.newFileContent,t);m.value=se.stats,y.value=se.lines,k.value=se.content;break}case"git_op_result":{re.handleGitOpResult(F,ge);break}}};Vue.watch(()=>e.currentAgent,()=>{d.value=null,u.value=[],c.value="",b.value=null,k.value=null,e.currentAgent&&Vue.nextTick(()=>ge())}),Vue.watch(()=>e.currentConversation,()=>{e.currentAgent&&(b.value=null,k.value=null,y.value=[],m.value=null,Vue.nextTick(()=>ge()))});let te=()=>ge();return Vue.onMounted(()=>{window.addEventListener("workbench-message",Ce),e.currentAgent&&ge()}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",Ce),re.cleanup()}),{store:e,getFileName:s,getDirName:n,getFileIconHtml:i,hlLine:D,collapsedGroups:o,toggleGroup:a,gitLoading:l,gitError:c,gitBranch:d,gitFiles:u,gitWorkDir:f,defaultWorkDir:p,changeGitWorkDir:v,stagedFiles:Y,modifiedFiles:G,untrackedFiles:ee,selectedGitFile:b,selectedStaged:h,diffLoading:A,diffError:x,diffContent:k,diffLines:y,diffStats:m,diffFullFile:w,toggleDiffMode:Se,scrollMarkers:U,diffScrollContainer:r,onMarkerClick:ie,fontSize:M,zoomIn:T,zoomOut:N,onWheel:H,gitOperating:E,commitMessage:R,gitOpFeedback:q,gitAhead:$,gitBehind:P,stageFile:re.stageFile,unstageFile:re.unstageFile,discardFile:re.discardFile,stageAll:re.stageAll,unstageAll:re.unstageAll,commitChanges:re.commitChanges,pushChanges:re.pushChanges,selectGitFile:me,refresh:te,folderPickerOpen:_.folderPickerOpen,folderPickerPath:_.folderPickerPath,folderPickerEntries:_.folderPickerEntries,folderPickerLoading:_.folderPickerLoading,folderPickerSelected:_.folderPickerSelected,getFolderIcon:X,openFolderPicker:_.openFolderPicker,folderPickerNavigateUp:_.folderPickerNavigateUp,folderPickerSelectItem:_.folderPickerSelectItem,folderPickerEnter:_.folderPickerEnter,confirmFolderPicker:ne}}}});function au(e){let t=Vue.ref(!1),s=Vue.ref(!1),n=Vue.ref(""),i=Vue.ref(""),r=Vue.ref(!1),o=Vue.ref(!1),a=Vue.ref(0),l=Vue.ref(-1),c=Vue.ref(null),d=Vue.ref(null),u=[],p=[],f=()=>{let $=e.value?.cmInstance;if(!$)return;let D=$.getWrapperElement().querySelector(".cm-find-scrollbar-annotations");D&&D.remove()},g=()=>{let $=e.value?.cmInstance;if(!$||p.length===0)return;f();let P=$.getWrapperElement();if(!P.querySelector(".CodeMirror-vscrollbar"))return;let M=$.lineCount();if(M===0)return;let C=document.createElement("div");C.className="cm-find-scrollbar-annotations";for(let T of p){let N=T.from.line/M*100,H=document.createElement("div");H.className="cm-find-scrollbar-tick",H.style.top=N+"%",C.appendChild(H)}P.appendChild(C)},b=()=>{for(let $ of u)try{$.clear()}catch{}u=[],p=[],a.value=0,l.value=-1,f()},h=$=>{let P=e.value?.cmInstance;if(!P||!p[$])return;for(let M=0;M<u.length;M++){if(!u[M])continue;let C=u[M].find();C&&(u[M].clear(),u[M]=P.markText(C.from,C.to,{className:"cm-find-highlight"}))}let D=p[$];if(u[$]){let M=u[$].find();M&&(u[$].clear(),u[$]=P.markText(M.from,M.to,{className:"cm-find-highlight cm-find-current"}))}setTimeout(()=>{P.scrollIntoView({from:D.from,to:D.to},100)},0)},A=()=>{b();let $=e.value?.cmInstance;if(!$||!n.value)return;let P=n.value;if(P.length<3)return;let D=$.getValue(),M=r.value,C=o.value,T=[];try{if(C){let N=M?"g":"gi",H=new RegExp(P,N),U;for(;(U=H.exec(D))!==null;){if(U[0].length===0){H.lastIndex++;continue}let ie=$.posFromIndex(U.index),Y=$.posFromIndex(U.index+U[0].length);if(T.push({from:ie,to:Y}),T.length>1e4)break}}else{let N=M?P:P.toLowerCase(),H=M?D:D.toLowerCase(),U=0;for(;(U=H.indexOf(N,U))!==-1;){let ie=$.posFromIndex(U),Y=$.posFromIndex(U+P.length);if(T.push({from:ie,to:Y}),U+=P.length,T.length>1e4)break}}}catch{return}p=T,a.value=T.length;for(let N of T)u.push($.markText(N.from,N.to,{className:"cm-find-highlight"}));if(T.length>0){let N=$.getCursor(),H=0;for(let U=0;U<T.length;U++){if(CodeMirror.cmpPos(T[U].from,N)>=0){H=U;break}U===T.length-1&&(H=0)}l.value=H,h(H)}g()};return{findBarVisible:t,replaceBarVisible:s,findQuery:n,replaceQuery:i,findCaseSensitive:r,findUseRegex:o,findMatchCount:a,findMatchIndex:l,findInputRef:c,replaceInputRef:d,clearFindMarkers:b,performFind:A,onFindInput:()=>{A()},findNext:()=>{if(p.length===0)return;let $=(l.value+1)%p.length;l.value=$,h($)},findPrev:()=>{if(p.length===0)return;let $=(l.value-1+p.length)%p.length;l.value=$,h($)},openFindBar:($=!1)=>{t.value=!0,s.value=$;let P=e.value?.cmInstance;if(P){let D=P.getSelection();D&&(n.value=D)}Vue.nextTick(()=>{c.value?.focus(),c.value?.select(),n.value&&A()})},closeFindBar:()=>{b(),t.value=!1,s.value=!1;let $=e.value?.cmInstance;$&&$.focus()},toggleReplaceBar:()=>{s.value=!s.value,s.value&&Vue.nextTick(()=>d.value?.focus())},replaceOne:()=>{let $=e.value?.cmInstance;if(!$||p.length===0||l.value<0)return;let P=p[l.value];$.replaceRange(i.value,P.from,P.to),A()},replaceAll:()=>{let $=e.value?.cmInstance;!$||p.length===0||($.operation(()=>{for(let P=p.length-1;P>=0;P--)$.replaceRange(i.value,p[P].from,p[P].to)}),A())}}}var lu=O(()=>{});function cu(e,t){let{getEffectiveWorkDir:s,treePath:n}=t,i=Vue.reactive(new Set),r=Vue.ref(-1),o=Vue.ref(!1),a=Vue.ref(null),l=null,c=null,d=Vue.ref(!1),u=Vue.ref(""),p=Vue.ref("file"),f=Vue.ref(null),g=Vue.ref(!1),b=Vue.ref(""),h=Vue.ref(null),A=Vue.reactive({visible:!1,x:0,y:0,entry:null}),x=Vue.ref(!1),k=Vue.ref(""),y=Vue.ref(null),m=null,w=Vue.reactive({dragging:null,dropTarget:null}),E=Vue.ref(!1),R=(W,J)=>{l&&clearTimeout(l),a.value={ok:W,message:J},l=setTimeout(()=>{a.value=null},4e3)},q=()=>{o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,R(!1,"Operation timed out"))},15e3)},$=W=>{i.has(W)?i.delete(W):i.add(W)},P=()=>{i.clear(),r.value=-1},D=W=>{p.value=W,u.value="",d.value=!0,Vue.nextTick(()=>f.value?.focus())},M=()=>{let W=u.value.trim();if(!W)return;d.value=!1;let J=n.value||s();if(!J)return;let he=J.includes("\\")?"\\":"/",fe=J.replace(/[/\\]$/,"")+he+W;q(),e.sendWsMessage({type:"create_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:fe,isDirectory:p.value==="directory",workDir:s(),_clientId:e.clientId})},C=(W,J)=>{let he=W.path.split("/").pop();confirm(J("files.deleteConfirm",{name:he})+(W.type==="directory"?J("files.deleteDirHint"):""))&&(q(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],workDir:s(),_clientId:e.clientId}))},T=W=>{let J=i.size;J!==0&&confirm(W("files.deleteSelectedConfirm",{count:J}))&&(q(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...i],workDir:s(),_clientId:e.clientId}))},N=()=>{b.value=n.value||s()||"",g.value=!0,Vue.nextTick(()=>h.value?.focus())},H=()=>{let W=b.value.trim();!W||i.size===0||(g.value=!1,q(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...i],destination:W,workDir:s(),_clientId:e.clientId}))},U=(W,J)=>{let Re=W.clientX,Ve=W.clientY;Re+180>window.innerWidth&&(Re=window.innerWidth-180),Ve+240>window.innerHeight&&(Ve=window.innerHeight-240),A.entry=J,A.x=Re,A.y=Ve,A.visible=!0},ie=()=>{A.visible=!1};return{selectedPaths:i,lastClickedIndex:r,fileOperating:o,fileOpFeedback:a,newFileDialogVisible:d,newFileName:u,newFileType:p,newFileInput:f,moveDialogVisible:g,moveDestination:b,moveDestInput:h,contextMenu:A,renameDialogVisible:x,renameNewName:k,renameInput:y,dragState:w,externalDropActive:E,showFileOpFeedback:R,toggleSelection:$,clearSelection:P,showNewFileDialog:D,confirmNewFile:M,deleteSingleFile:C,deleteSelected:T,openMoveDialog:N,confirmMove:H,showContextMenu:U,hideContextMenu:ie,ctxRename:()=>{let W=A.entry;ie(),W&&(k.value=W.name,x.value=!0,Vue.nextTick(()=>{let J=y.value;if(J)if(J.focus(),W.type==="file"){let he=W.name.lastIndexOf(".");he>0?J.setSelectionRange(0,he):J.select()}else J.select()}))},confirmRename:()=>{let W=A.entry,J=k.value.trim();if(!J||!W||J===W.name){x.value=!1;return}x.value=!1;let he=W.path.replace(/\/$/,"").split("/");he.pop();let fe=he.join("/")||"/";q(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],destination:fe,newName:J,workDir:s(),_clientId:e.clientId})},ctxCopy:()=>{let W=A.entry;if(ie(),!W)return;let J=W.path.replace(/\/$/,"").split("/");J.pop();let he=J.join("/")||"/";q(),e.sendWsMessage({type:"copy_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],destination:he,workDir:s(),_clientId:e.clientId})},ctxMoveTo:()=>{let W=A.entry;ie(),W&&(i.clear(),i.add(W.path),N())},ctxDelete:W=>{let J=A.entry;ie(),J&&C(J,W)},ctxDownload:()=>{let W=A.entry;ie(),!(!W||W.type!=="file")&&(m=W.path,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:W.path,workDir:s(),_clientId:e.clientId}))},onDragStart:(W,J)=>{w.dragging=J,W.dataTransfer.setData("text/plain",J.path),W.dataTransfer.effectAllowed="move"},onDragOver:(W,J)=>{if(!w.dragging&&W.dataTransfer.types.includes("Files")){J.type==="directory"&&(W.dataTransfer.dropEffect="copy",w.dropTarget=J.path);return}!w.dragging||J.type!=="directory"||J.path!==w.dragging.path&&(J.path.startsWith(w.dragging.path+"/")||(W.dataTransfer.dropEffect="move",w.dropTarget=J.path))},onDragLeave:W=>{let J=W.relatedTarget;J&&W.currentTarget.contains(J)||(w.dropTarget=null)},onDrop:(W,J,he)=>{if(w.dropTarget=null,!w.dragging&&W.dataTransfer.files.length>0&&J.type==="directory"){he(W.dataTransfer.files,J.path);return}if(!w.dragging||J.type!=="directory"){w.dragging=null;return}if(J.path===w.dragging.path){w.dragging=null;return}q(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[w.dragging.path],destination:J.path,workDir:s(),_clientId:e.clientId}),w.dragging=null},onTreeDragOver:W=>{w.dragging||W.dataTransfer.types.includes("Files")&&(W.dataTransfer.dropEffect="copy",E.value=!0)},onTreeDragLeave:W=>{let J=W.relatedTarget;J&&W.currentTarget.contains(J)||(E.value=!1)},onTreeDrop:(W,J,he)=>{if(E.value=!1,!w.dragging&&W.dataTransfer.files.length>0){let fe=n.value||J||s();he(W.dataTransfer.files,fe)}},handleExternalFileDrop:async(W,J)=>{if(!J)return;let he=[],fe=[];for(let Re of W)fe.push(new Promise(Ve=>{let He=new FileReader;He.onload=()=>{let V=btoa(new Uint8Array(He.result).reduce((Z,pe)=>Z+String.fromCharCode(pe),""));he.push({name:Re.name,data:V}),Ve()},He.onerror=()=>Ve(),He.readAsArrayBuffer(Re)}));await Promise.all(fe),he.length!==0&&(o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,R(!1,"Upload timed out"))},3e4),e.sendWsMessage({type:"upload_to_dir",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,files:he,dirPath:J,workDir:s(),_clientId:e.clientId}))},handleFileOpResult:(W,J,he)=>{o.value=!1,c&&(clearTimeout(c),c=null),R(W.success,W.success?W.message:W.error||"Operation failed"),W.success&&(he&&J(he),(W.operation==="delete"||W.operation==="move")&&(i.clear(),r.value=-1))},getPendingDownload:()=>m,clearPendingDownload:()=>{m=null},cleanup:()=>{l&&clearTimeout(l),c&&clearTimeout(c)}}}var du=O(()=>{});function uu(e,{getEffectiveWorkDir:t,normalizePath:s,selectedPaths:n,lastClickedIndex:i,openFileInTab:r,clearSelection:o}){let a=Vue.ref(""),l=Vue.ref(""),c=Vue.reactive({}),d=Vue.ref(!1),u=Vue.ref(null),p=Vue.computed(()=>{if(!l.value)return"EXPLORER";let D=l.value.replace(/[\\/]+$/,"").split(/[\\/]/);return(D[D.length-1]||l.value).toUpperCase()}),f=Vue.computed(()=>l.value?!!c[l.value]?.expanded:!1),g=()=>{if(!l.value)return;let D=c[l.value];D&&(D.expanded=!D.expanded)},b=()=>{for(let D of Object.keys(c))c[D]&&(c[D].expanded=!1)},h=()=>{d.value=!0,Vue.nextTick(()=>u.value?.focus())},A=()=>{d.value=!1,m()},x=()=>{d.value=!1},k=Vue.computed(()=>{let D=[],M=(C,T)=>{let N=c[C];if(!(!N||!N.entries))for(let H of N.entries)D.push({...H,depth:T}),H.type==="directory"&&c[H.path]?.expanded&&M(H.path,T+1)};return l.value&&c[l.value]?.expanded&&M(l.value,0),D}),y=D=>{let M=s(D);c[M]?c[M].loading=!0:c[M]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:D,workDir:t(),_clientId:e.clientId})},m=()=>{let D=a.value.trim();if(!D)return;let M=s(D);l.value=M,Object.keys(c).forEach(C=>delete c[C]),c[M]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:D,workDir:t(),_clientId:e.clientId})},w=D=>{let M=s(D),C=c[M];C?C.loaded?C.expanded=!C.expanded:(C.expanded=!0,y(D)):(c[M]={entries:[],expanded:!0,loaded:!1,loading:!1},y(D))},E=(D,M)=>{let C=k.value,T=C.findIndex(N=>N.path===D.path);if(M&&(M.shiftKey||M.ctrlKey||M.metaKey)){if(M.shiftKey&&i.value>=0&&T>=0){let N=Math.min(i.value,T),H=Math.max(i.value,T);!M.ctrlKey&&!M.metaKey&&n.clear();for(let U=N;U<=H;U++)n.add(C[U].path)}else n.has(D.path)?n.delete(D.path):n.add(D.path);i.value=T;return}n.size>0&&(n.clear(),i.value=-1),D.type==="directory"?w(D.path):r(D.path,D.name),i.value=T},R=D=>{let M=s(D.dirPath);if(D.error){c[M]&&(c[M].loading=!1);return}let C=(D.entries||[]).sort((H,U)=>H.type===U.type?H.name.localeCompare(U.name):H.type==="directory"?-1:1),T=M.replace(/\/$/,""),N=C.map(H=>({...H,path:T+"/"+H.name}));c[M]?(c[M].entries=N,c[M].loaded=!0,c[M].loading=!1):c[M]={entries:N,expanded:!0,loaded:!0,loading:!1},M===l.value&&(a.value=D.dirPath)},q=()=>{Object.keys(c).forEach(D=>delete c[D])};return{treePath:a,treeRootPath:l,treeNodes:c,flattenedTree:k,editingTreePath:d,treePathInputRef:u,rootFolderName:p,rootExpanded:f,toggleRootExpand:g,collapseAll:b,startTreePathEdit:h,confirmTreePath:A,cancelTreePathEdit:x,loadTreeDirectory:y,loadRootDirectory:m,toggleDirectory:w,onTreeItemClick:E,handleDirectoryListing:R,clearTreeNodes:q,initFileBrowser:()=>{let D=t();if(D){let M=s(D);a.value=D,l.value=M,q(),y(D)}},refresh:()=>{l.value&&y(l.value)}}}var pu=O(()=>{});function Cs(e){let t=e.lastIndexOf(".");if(t<0)return"text";let s=e.substring(t).toLowerCase();return Am.has(s)?"office":xm.has(s)?"pdf":Tm.has(s)?"image":"text"}function Ct(e){let t=e.lastIndexOf(".");return t<0?!1:Mm.has(e.substring(t).toLowerCase())}function Pm(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 fu(e,{activeFile:t,editorContainer:s,fontSize:n,clearFindMarkers:i,openFindBar:r,saveFile:o}){let a=Vue.ref(""),l=Vue.reactive({}),c=()=>{},d=()=>{},u=({openQuickOpen:x,openGoToLine:k})=>{c=x,d=k},p=(x,k=0)=>{if(!s.value){k<20&&setTimeout(()=>p(x,k+1),100);return}if(!x)return;if(s.value.innerHTML="",typeof CodeMirror>"u"){let w=document.createElement("textarea");w.value=x.content||"",w.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;",w.spellcheck=!1,w.addEventListener("input",()=>{x.content=w.value,x.isDirty=w.value!==x.originalContent}),w.addEventListener("keydown",E=>{(E.ctrlKey||E.metaKey)&&E.key==="s"&&(E.preventDefault(),o())}),s.value.appendChild(w),a.value="";return}let m=document.documentElement.getAttribute("data-theme")==="dark"?"material-darker":"default";try{let w=CodeMirror(s.value,{value:x.content||"",mode:Pm(x.name),theme:m,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":()=>r(!1),"Cmd-F":()=>r(!1),"Ctrl-R":()=>r(!0),"Cmd-R":()=>r(!0),"Ctrl-H":()=>r(!0),"Cmd-H":()=>r(!0)}});w.on("change",()=>{let R=w.getValue();x.content=R,x.isDirty=R!==x.originalContent}),x.cmInstance=w,w.getWrapperElement().style.fontSize=n.value+"px";let E=e.currentConversation;E&&l[E]?.[x.path]&&w.setHistory(l[E][x.path]),Vue.nextTick(()=>{w.refresh(),setTimeout(()=>w.refresh(),200)}),a.value=""}catch(w){a.value=`Editor error: ${w.message}`}};return{debugStatus:a,undoHistoryMap:l,createEditor:p,destroyEditor:()=>{i();let x=t.value;x?.cmInstance&&(x.cmInstance.toTextArea&&x.cmInstance.toTextArea(),x.cmInstance=null),s.value&&(s.value.innerHTML="")},setKeyBindings:u,saveCurrentUndoHistory:()=>{let x=e.currentConversation;if(!x)return;let k=t.value;k?.cmInstance&&(l[x]||(l[x]={}),l[x][k.path]=k.cmInstance.getHistory())},saveAllUndoHistory:x=>{if(!x)return;let k=t.value;k?.cmInstance&&(l[x]||(l[x]={}),l[x][k.path]=k.cmInstance.getHistory())},cleanupUndoHistory:(x,k)=>{x&&l[x]&&delete l[x][k]},deleteConversationHistory:x=>{delete l[x]}}}var Am,xm,Tm,Mm,cn=O(()=>{Am=new Set([".docx",".xlsx",".xls",".pptx",".ppt"]),xm=new Set([".pdf"]),Tm=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico"]),Mm=new Set([".md",".markdown",".mdx"])});function gu(e,{editorContainer:t,createEditor:s,t:n}){let i=Vue.ref(!0),r=Vue.ref(null),o=Vue.ref(null),a=Vue.computed(()=>{let f=e.value;return!!(f&&Ct(f.name))}),l=Vue.computed(()=>{let f=e.value;if(!f||!Ct(f.name)||f.content==null)return"";try{if(typeof marked<"u")return marked.parse(f.content)}catch{}return"<pre>"+(f.content||"")+"</pre>"});function c(){Xe(r.value)}async function d(){await Xe(r.value)}function u(){i.value=!1,Vue.nextTick(()=>{let f=e.value;f&&t.value&&s(f)})}return{mdPreviewMode:i,mdPreviewRef:r,officePreviewContainer:o,isActiveMarkdown:a,mdRenderedHtml:l,initMermaid:c,renderMermaidBlocks:d,switchToMdEdit:u,renderOfficeLocal:f=>{let g=o.value;if(!g||!f._arrayBuffer)return;g.innerHTML="";let b=("."+f.name.split(".").pop()).toLowerCase();if(b===".docx"&&window.docx)window.docx.renderAsync(f._arrayBuffer,g,null,{className:"docx-preview-content",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!0}).catch(h=>{f.previewError=h.message});else if(b===".xlsx"||b===".xls")try{let h=XLSX.read(f._arrayBuffer,{type:"array"}),A=h.SheetNames[0],x=XLSX.utils.sheet_to_html(h.Sheets[A],{editable:!1});g.innerHTML='<div class="xlsx-sheet-tabs">'+h.SheetNames.map((k,y)=>`<button class="xlsx-sheet-tab${y===0?" active":""}" data-idx="${y}">${k}</button>`).join("")+'</div><div class="xlsx-table-wrap">'+x+"</div>",g.querySelectorAll(".xlsx-sheet-tab").forEach(k=>{k.addEventListener("click",()=>{let y=parseInt(k.dataset.idx),m=h.SheetNames[y],w=XLSX.utils.sheet_to_html(h.Sheets[m],{editable:!1});g.querySelector(".xlsx-table-wrap").innerHTML=w,g.querySelectorAll(".xlsx-sheet-tab").forEach(E=>E.classList.remove("active")),k.classList.add("active")})})}catch(h){f.previewError=h.message}else(b===".pptx"||b===".ppt")&&(g.innerHTML='<div class="preview-unsupported">'+(n?n("files.pptxNotSupported"):"PowerPoint preview not supported")+"</div>")}}}var mu=O(()=>{en();cn()});function hu(e,{getEffectiveWorkDir:t,treePath:s,openFileInTab:n,normalizePath:i,treeRootPath:r,treeNodes:o,loadTreeDirectory:a}){let l=Vue.ref(""),c=Vue.ref([]),d=Vue.ref(!1),u=null,p=Vue.ref(!1),f=Vue.ref(""),g=Vue.ref([]),b=Vue.ref(0),h=Vue.ref(!1),A=Vue.ref(null),x=null,k=Vue.ref(!1),y=Vue.ref(""),m=Vue.ref(null),w=G=>{!e.currentAgent||!G.trim()||e.sendWsMessage({type:"file_search",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,query:G.trim(),dirPath:s.value||t()||"",_clientId:e.clientId})},E=()=>{if(u&&clearTimeout(u),!l.value.trim()){c.value=[],d.value=!1;return}d.value=!0,u=setTimeout(()=>{w(l.value)},300)},R=()=>{l.value="",c.value=[],d.value=!1},q=G=>{if(G.type==="directory"){let ee=i(G.fullPath);r.value=ee,s.value=G.fullPath,Object.keys(o).forEach(re=>delete o[re]),a(G.fullPath),R()}else n(G.fullPath,G.name),R()},$=()=>{p.value=!0,f.value="",g.value=[],b.value=0,h.value=!1,Vue.nextTick(()=>A.value?.focus())},P=()=>{p.value=!1,f.value="",g.value=[]},D=()=>{if(x&&clearTimeout(x),!f.value.trim()){g.value=[],h.value=!1;return}h.value=!0,b.value=0,x=setTimeout(()=>{w(f.value)},200)},M=()=>{g.value.length>0&&(b.value=(b.value+1)%g.value.length)},C=()=>{g.value.length>0&&(b.value=(b.value-1+g.value.length)%g.value.length)},T=G=>{G.type!=="directory"&&n(G.fullPath,G.name),P()},N=()=>{let G=g.value[b.value];G&&T(G)},H=()=>{k.value=!0,y.value="",Vue.nextTick(()=>m.value?.focus())},U=()=>{k.value=!1,y.value=""};return{searchQuery:l,searchResults:c,searchLoading:d,onSearchInput:E,clearSearch:R,onSearchResultClick:q,quickOpenVisible:p,quickOpenQuery:f,quickOpenResults:g,quickOpenSelectedIndex:b,quickOpenLoading:h,quickOpenInput:A,openQuickOpen:$,closeQuickOpen:P,onQuickOpenInput:D,quickOpenSelectNext:M,quickOpenSelectPrev:C,quickOpenConfirm:N,quickOpenOpenFile:T,goToLineVisible:k,goToLineValue:y,goToLineInput:m,openGoToLine:H,closeGoToLine:U,goToLineConfirm:G=>{let ee=parseInt(y.value);if(isNaN(ee)||ee<1)return;let re=G.value;if(re?.cmInstance){let ge=re.cmInstance,v=Math.min(ee-1,ge.lineCount()-1);ge.setCursor({line:v,ch:0}),ge.scrollIntoView({line:v,ch:0},100),ge.focus()}U()},handleFileSearchResult:G=>{let ee=G.results||[];p.value?G.query&&G.query.trim()===f.value.trim()&&(g.value=ee,h.value=!1,b.value=0):G.query&&G.query.trim()===l.value.trim()&&(c.value=ee,d.value=!1)}}}var vu=O(()=>{});function yu(e,{getEffectiveWorkDir:t,treePath:s,treeRootPath:n,treeNodes:i,normalizePath:r,loadTreeDirectory:o}){let a=Vue.ref(!1),l=Vue.ref(""),c=Vue.ref([]),d=Vue.ref(!1),u=Vue.ref(""),p=()=>{a.value=!0,u.value="",d.value=!0;let k=s.value||t()||"";l.value=k,c.value=[],e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:k,workDir:t(),_clientId:e.clientId})},f=k=>{d.value=!0,u.value="",e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:k,workDir:t(),_clientId:e.clientId})};return{folderPickerOpen:a,folderPickerPath:l,folderPickerEntries:c,folderPickerLoading:d,folderPickerSelected:u,openFolderPicker:p,folderPickerNavigateUp:()=>{if(!l.value)return;let k=l.value.includes("\\"),y=k?"\\":"/",m=l.value.replace(/[/\\]$/,"").split(/[/\\]/);if(m.pop(),m.length===0)l.value="",f("");else if(k&&m.length===1&&/^[A-Za-z]:$/.test(m[0]))l.value=m[0]+"\\",f(m[0]+"\\");else{let w=m.join(y);l.value=w,f(w)}},folderPickerSelectItem:k=>{u.value=k.name},folderPickerEnter:k=>{let y;if(!l.value)y=k.name+(k.name.endsWith("\\")?"":"\\");else{let m=l.value.includes("\\")||/^[A-Z]:/.test(k.name)?"\\":"/";y=l.value.replace(/[/\\]$/,"")+m+k.name}l.value=y,f(y)},confirmFolderPicker:()=>{let k=l.value;if(!k)return;if(u.value){let m=k.includes("\\")?"\\":"/";k=k.replace(/[/\\]$/,"")+m+u.value}s.value=k,a.value=!1;let y=r(k);n.value=y,Object.keys(i).forEach(m=>delete i[m]),i[y]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:k,workDir:t(),_clientId:e.clientId})},handleFolderPickerListing:k=>{d.value=!1,c.value=(k.entries||[]).filter(y=>y.type==="directory").sort((y,m)=>y.name.localeCompare(m.name)),k.dirPath!=null&&(l.value=k.dirPath)}}}var bu=O(()=>{});function wu(e,{normalizePath:t,getEffectiveWorkDir:s,editorContainer:n,createEditor:i,destroyEditor:r,clearFindMarkers:o,saveCurrentUndoHistory:a,saveAllUndoHistory:l,cleanupUndoHistory:c,deleteConversationHistory:d,debugStatus:u,mdPreviewMode:p,renderOfficeLocal:f,performFind:g,findBarVisible:b,findQuery:h,t:A}){let x=Vue.reactive({}),k=Vue.ref([]),y=Vue.ref(-1),m=Vue.ref(!1),w=Vue.ref(!1),E=Vue.computed(()=>y.value>=0&&y.value<k.value.length?k.value[y.value]:null),R=null,q=()=>{R&&clearTimeout(R),R=setTimeout(()=>{e.sendWsMessage({type:"update_file_tabs",openFiles:k.value.map(H=>({path:H.path})),activeIndex:y.value})},500)},$=H=>{H&&(l(H),k.value.length>0?x[H]={files:k.value.map(U=>({path:U.path,name:U.name,content:U.content,originalContent:U.originalContent,isDirty:U.isDirty,fileType:U.fileType})),activeIndex:y.value}:delete x[H],q())},P=H=>{if(r(),!H||!x[H]){k.value=[],y.value=-1;return}let U=x[H];k.value=U.files.map(ie=>({...ie,isDirty:ie.isDirty||!1,originalContent:ie.originalContent||ie.content,cmInstance:null,fileType:ie.fileType||Cs(ie.name||""),blobUrl:null,previewUrl:null,previewLoading:!1,localPreviewReady:!1,previewError:null})),y.value=U.activeIndex,Vue.nextTick(()=>{let ie=E.value;ie&&(!ie.fileType||ie.fileType==="text")&&n.value&&i(ie)})};function D(H,U){let ie=t(H),Y=k.value.findIndex(re=>re.path===ie);if(Y>=0){y.value!==Y&&(o(),a(),y.value=Y,Vue.nextTick(()=>{let re=k.value[Y];re&&re.content!=null&&(!re.fileType||re.fileType==="text")&&i(re)})),$(e.currentConversation);return}a();let G=U||ie.split(/[/\\]/).pop(),ee=Cs(G);k.value.push({path:ie,name:G,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:ee,blobUrl:null,previewUrl:null,previewLoading:ee!=="text",localPreviewReady:!1,previewError:null}),y.value=k.value.length-1,m.value=!0,ee==="text"&&r(),$(e.currentConversation),u.value=`Loading: ${H}`,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:H,workDir:s(),_clientId:e.clientId})}let M=H=>{H!==y.value&&(o(),a(),y.value=H,$(e.currentConversation),Vue.nextTick(()=>{let U=k.value[H];U&&(!U.fileType||U.fileType==="text"?Ct(U.name)?p.value=!0:U.content!=null&&n.value&&(i(U),b.value&&h.value&&Vue.nextTick(()=>g())):U.fileType==="office"&&U.localPreviewReady&&Vue.nextTick(()=>f(U)))}))},C=H=>{let U=k.value[H];if(U?.isDirty&&!confirm(A("files.unsavedConfirm",{name:U.name})))return;c(e.currentConversation,U.path),U.blobUrl&&URL.revokeObjectURL(U.blobUrl);let ie=H===y.value;k.value.splice(H,1),k.value.length===0?(y.value=-1,r()):y.value>=k.value.length?y.value=k.value.length-1:y.value>H?y.value--:ie&&y.value>=k.value.length&&(y.value=k.value.length-1),$(e.currentConversation),k.value.length>0&&ie&&Vue.nextTick(()=>{let Y=k.value[y.value];Y&&(!Y.fileType||Y.fileType==="text")&&Y.content!=null&&n.value&&i(Y)})};function T(){let H=E.value;!H||!H.isDirty||(w.value=!0,e.sendWsMessage({type:"write_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:H.path,content:H.content,workDir:s(),_clientId:e.clientId}))}return{fileTabsMap:x,openFiles:k,activeFileIndex:y,activeFile:E,fileLoading:m,fileSaving:w,saveTabsState:$,restoreTabsState:P,openFileInTab:D,switchToTab:M,closeFileTab:C,saveFile:T,handleConversationDeleted:H=>{let{conversationId:U}=H.detail;U&&(delete x[U],d(U))}}}var ku=O(()=>{cn()});function Su({store:e,normalizePath:t,getEffectiveWorkDir:s,openFiles:n,activeFileIndex:i,activeFile:r,fileLoading:o,fileSaving:a,saveTabsState:l,createEditor:c,openFileInTab:d,tree:u,fp:p,qo:f,ops:g,mdPreviewMode:b,renderOfficeLocal:h,editorContainer:A,debugStatus:x}){return{handleWorkbenchMessage:m=>{let w=m.detail;if(w)switch(w.type){case"directory_listing":{if(w.conversationId==="_folder_picker"){p.handleFolderPickerListing(w);return}u.handleDirectoryListing(w);break}case"file_content":{if(o.value=!1,w.error){x.value=`Error: ${w.error}`,g.clearPendingDownload();let q=t(w.filePath),$=n.value.find(P=>P.path===q);$&&($.previewLoading=!1,$.previewError=w.error);return}let E=t(w.filePath);if(g.getPendingDownload()&&t(g.getPendingDownload())===E){g.clearPendingDownload();try{if(w.binary){let q=`${location.protocol}//${location.host}/api/preview/${w.fileId}?token=${w.previewToken}`,$=document.createElement("a");$.href=q,$.download=E.split("/").pop()||"download",document.body.appendChild($),$.click(),document.body.removeChild($)}else{let q=new Blob([w.content||""],{type:"application/octet-stream"}),$=URL.createObjectURL(q),P=document.createElement("a");P.href=$,P.download=E.split("/").pop()||"download",document.body.appendChild(P),P.click(),document.body.removeChild(P),URL.revokeObjectURL($)}}catch{}return}let R=n.value.findIndex(q=>q.path===E);if(R>=0){let q=n.value[R];if(w.binary){q.previewLoading=!1;let $=`${location.protocol}//${location.host}/api/preview/${w.fileId}?token=${w.previewToken}`,P=q.fileType||Cs(q.name);q.fileType=P,P==="pdf"||P==="image"?fetch($).then(D=>D.blob()).then(D=>{q.blobUrl=URL.createObjectURL(D)}).catch(D=>{q.previewError=D.message}):P==="office"&&((localStorage.getItem("officePreviewMode")||"local")==="online"?q.previewUrl="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent($):fetch($).then(M=>M.arrayBuffer()).then(M=>{q._arrayBuffer=M,q.localPreviewReady=!0,R===i.value&&Vue.nextTick(()=>h(q))}).catch(M=>{q.previewError=M.message})),l(e.currentConversation);return}q.content=w.content||"",q.originalContent=w.content||"",q.isDirty=!1,l(e.currentConversation),R===i.value&&(Ct(q.name)&&b.value||Vue.nextTick(()=>{setTimeout(()=>c(q),100)}))}break}case"file_saved":{if(a.value=!1,w.error)return;let E=t(w.filePath),R=n.value.find(q=>q.path===E);R&&(R.originalContent=R.content,R.isDirty=!1,l(e.currentConversation));break}case"file_search_result":{f.handleFileSearchResult(w);break}case"file_op_result":{g.handleFileOpResult(w,u.loadTreeDirectory,u.treeRootPath.value);break}case"file_tabs_restored":{if(w.openFiles?.length>0&&n.value.length===0){let E=w.activeIndex||0,R=w.openFiles.length;for(let q of w.openFiles){let $=t(q.path),P=$.split("/").pop(),D=Cs(P);n.value.push({path:$,name:P,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:D,blobUrl:null,previewUrl:null,previewLoading:D!=="text",localPreviewReady:!1,previewError:null}),e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:q.path})}i.value=E>=0&&E<R?E:0}break}}},handleOpenFile:m=>{let{filePath:w}=m.detail,E=t(w);d(E,E.split("/").pop())}}}var Cu=O(()=>{cn()});var Iu,Au=O(()=>{mo();lu();du();pu();cn();mu();vu();bu();ku();Cu();Iu={name:"FilesTab",template:`
|
|
2076
2076
|
<div class="files-tab file-two-col" :class="{ 'mobile-editor-view': isMobile && mobileView === 'editor' }" ref="rootEl">
|
|
2077
2077
|
<!-- \u5DE6\u680F: \u5C42\u7EA7\u76EE\u5F55\u6811 -->
|
|
2078
2078
|
<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"
|
|
@@ -2499,7 +2499,7 @@ ${String(e||"").trim()}
|
|
|
2499
2499
|
</template>
|
|
2500
2500
|
</div>
|
|
2501
2501
|
</div>
|
|
2502
|
-
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=()=>e.effectiveWorkDir||"",n=h=>h?h.replace(/\\/g,"/"):"",i=h=>mi(h),r=h=>hi(h),o=h=>h==null?"":h<1024?h+" B":h<1024*1024?(h/1024).toFixed(1)+" KB":(h/(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"},p=Vue.ref(parseInt(localStorage.getItem("filesFontSize"))||15),f=h=>{p.value=Math.max(8,Math.min(24,h)),localStorage.setItem("filesFontSize",p.value.toString());let _=b.activeFile.value;_?.cmInstance&&(_.cmInstance.getWrapperElement().style.fontSize=p.value+"px",_.cmInstance.refresh())},g=()=>f(p.value+1),v=()=>f(p.value-1),y=h=>{h.deltaY<0?g():v()},A=Vue.ref(parseInt(localStorage.getItem("filePanelWidth"))||220),x=Vue.ref(!1),k=h=>{h.preventDefault();let _=h.type==="touchstart";x.value=!0;let X=_?h.touches[0].clientX:h.clientX,ne=A.value;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let me=h.target.closest(".file-two-col"),Se=me?me.offsetWidth*.5:400,Ce=Q=>{let F=_?Q.touches[0].clientX:Q.clientX;A.value=Math.max(120,Math.min(Se,ne+(F-X)))},te=()=>{x.value=!1,document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("filePanelWidth",A.value.toString()),document.removeEventListener("mousemove",Ce),document.removeEventListener("mouseup",te),document.removeEventListener("touchmove",Ce),document.removeEventListener("touchend",te)};document.addEventListener(_?"touchmove":"mousemove",Ce),document.addEventListener(_?"touchend":"mouseup",te)},b,m,w=Vue.computed(()=>b?b.activeFile.value:null),E=Vue.computed(()=>m?m.treePath.value:""),R=au(w),q=fu(e,{activeFile:w,editorContainer:l,fontSize:p,clearFindMarkers:R.clearFindMarkers,openFindBar:R.openFindBar,saveFile:()=>b.saveFile()}),$=gu(w,{editorContainer:l,createEditor:q.createEditor,t}),P=cu(e,{getEffectiveWorkDir:s,treePath:E});b=wu(e,{normalizePath:n,getEffectiveWorkDir:s,editorContainer:l,createEditor:q.createEditor,destroyEditor:q.destroyEditor,clearFindMarkers:R.clearFindMarkers,saveCurrentUndoHistory:q.saveCurrentUndoHistory,saveAllUndoHistory:q.saveAllUndoHistory,cleanupUndoHistory:q.cleanupUndoHistory,deleteConversationHistory:q.deleteConversationHistory,debugStatus:q.debugStatus,mdPreviewMode:$.mdPreviewMode,renderOfficeLocal:$.renderOfficeLocal,performFind:R.performFind,findBarVisible:R.findBarVisible,findQuery:R.findQuery,t}),m=uu(e,{getEffectiveWorkDir:s,normalizePath:n,selectedPaths:P.selectedPaths,lastClickedIndex:P.lastClickedIndex,openFileInTab:(...h)=>b.openFileInTab(...h),clearSelection:P.clearSelection});let D=hu(e,{getEffectiveWorkDir:s,treePath:m.treePath,openFileInTab:(...h)=>b.openFileInTab(...h),normalizePath:n,treeRootPath:m.treeRootPath,treeNodes:m.treeNodes,loadTreeDirectory:m.loadTreeDirectory});q.setKeyBindings({openQuickOpen:D.openQuickOpen,openGoToLine:D.openGoToLine});let M=yu(e,{getEffectiveWorkDir:s,treePath:m.treePath,treeRootPath:m.treeRootPath,treeNodes:m.treeNodes,normalizePath:n,loadTreeDirectory:m.loadTreeDirectory}),C=Su({store:e,normalizePath:n,getEffectiveWorkDir:s,openFiles:b.openFiles,activeFileIndex:b.activeFileIndex,activeFile:b.activeFile,fileLoading:b.fileLoading,fileSaving:b.fileSaving,saveTabsState:b.saveTabsState,createEditor:q.createEditor,openFileInTab:b.openFileInTab,tree:m,fp:M,qo:D,ops:P,mdPreviewMode:$.mdPreviewMode,renderOfficeLocal:$.renderOfficeLocal,editorContainer:l,debugStatus:q.debugStatus}),T=h=>P.deleteSingleFile(h,t),N=()=>P.deleteSelected(t),H=()=>P.ctxDelete(t),U=(h,_)=>P.onDrop(h,_,P.handleExternalFileDrop),ie=h=>P.onTreeDrop(h,m.treeRootPath.value,P.handleExternalFileDrop),Y=()=>D.goToLineConfirm(b.activeFile);Vue.watch(()=>e.currentAgent,()=>{b.saveTabsState(e.currentConversation),q.destroyEditor(),m.clearTreeNodes(),b.openFiles.value=[],b.activeFileIndex.value=-1,b.fileLoading.value=!1,e.currentAgent&&Vue.nextTick(()=>m.initFileBrowser())});let G=e.currentConversation;Vue.watch(()=>e.currentConversation,h=>{b.saveTabsState(G),G=h,b.restoreTabsState(h);let _=s(),X=n(_);_&&X!==m.treeRootPath.value&&(m.treePath.value=_,m.treeRootPath.value=X,m.clearTreeNodes(),m.loadTreeDirectory(_))}),Vue.watch(()=>e.theme,h=>{let _=b.activeFile.value;_?.cmInstance&&_.cmInstance.setOption("theme",h==="dark"?"material-darker":"default")}),Vue.watch(()=>s(),h=>{if(h&&!m.treeRootPath.value){let _=n(h);m.treePath.value=h,m.treeRootPath.value=_,m.clearTreeNodes(),m.loadTreeDirectory(h)}}),Vue.watch(()=>b.activeFile.value?.content,(h,_)=>{let X=b.activeFile.value;if(X&&h!=null&&_==null&&!X.cmInstance&&(!X.fileType||X.fileType==="text")){if(Ct(X.name)&&$.mdPreviewMode.value)return;Vue.nextTick(()=>{setTimeout(()=>{X.cmInstance||q.createEditor(X)},150)})}}),Vue.watch([$.mdRenderedHtml,$.mdPreviewMode],([h,_])=>{h&&_&&Vue.nextTick(()=>{setTimeout(()=>$.renderMermaidBlocks(),50)})});let ee=h=>{!(a.value&&a.value.offsetParent!==null)&&!D.quickOpenVisible.value&&!D.goToLineVisible.value&&!R.findBarVisible.value||((h.ctrlKey||h.metaKey)&&h.key==="p"?(h.preventDefault(),D.quickOpenVisible.value?D.closeQuickOpen():D.openQuickOpen()):(h.ctrlKey||h.metaKey)&&h.key==="g"?(h.preventDefault(),D.goToLineVisible.value?D.closeGoToLine():D.openGoToLine()):(h.ctrlKey||h.metaKey)&&h.key==="f"?b.activeFile.value&&(h.preventDefault(),R.openFindBar(!1)):(h.ctrlKey||h.metaKey)&&(h.key==="r"||h.key==="h")?b.activeFile.value&&(h.preventDefault(),R.openFindBar(!0)):h.key==="Escape"&&(R.findBarVisible.value&&R.closeFindBar(),P.selectedPaths.size>0&&P.clearSelection(),D.quickOpenVisible.value&&D.closeQuickOpen(),D.goToLineVisible.value&&D.closeGoToLine()))},re=()=>{P.hideContextMenu()},ge=()=>{c.value=window.innerWidth<=768};return Vue.watch(()=>b.activeFileIndex.value,(h,_)=>{c.value&&h>=0&&h!==_&&(d.value="editor")}),Vue.watch(()=>b.openFiles.value.length,h=>{c.value&&h===0&&(d.value="tree")}),Vue.onMounted(()=>{window.addEventListener("workbench-message",C.handleWorkbenchMessage),window.addEventListener("open-file-in-explorer",C.handleOpenFile),window.addEventListener("conversation-deleted",b.handleConversationDeleted),window.addEventListener("keydown",ee),document.addEventListener("click",re),window.addEventListener("resize",ge),$.initMermaid(),e.currentAgent&&(m.initFileBrowser(),e.sendWsMessage({type:"restore_file_tabs"}))}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",C.handleWorkbenchMessage),window.removeEventListener("open-file-in-explorer",C.handleOpenFile),window.removeEventListener("conversation-deleted",b.handleConversationDeleted),window.removeEventListener("keydown",ee),document.removeEventListener("click",re),window.removeEventListener("resize",ge),q.destroyEditor(),P.cleanup()}),{store:e,debugStatus:q.debugStatus,rootEl:a,isMobile:c,mobileView:d,mobileGoBack:u,fontSize:p,zoomIn:g,zoomOut:v,onWheel:y,treePath:m.treePath,treeRootPath:m.treeRootPath,treeNodes:m.treeNodes,flattenedTree:m.flattenedTree,editingTreePath:m.editingTreePath,treePathInputRef:m.treePathInputRef,rootFolderName:m.rootFolderName,rootExpanded:m.rootExpanded,toggleRootExpand:m.toggleRootExpand,collapseAll:m.collapseAll,startTreePathEdit:m.startTreePathEdit,confirmTreePath:m.confirmTreePath,cancelTreePathEdit:m.cancelTreePathEdit,treePanelWidth:A,isTreeResizing:x,startTreeResize:k,openFiles:b.openFiles,activeFileIndex:b.activeFileIndex,activeFile:b.activeFile,fileLoading:b.fileLoading,fileSaving:b.fileSaving,editorContainer:l,officePreviewContainer:$.officePreviewContainer,mdPreviewRef:$.mdPreviewRef,isActiveMarkdown:$.isActiveMarkdown,mdPreviewMode:$.mdPreviewMode,mdRenderedHtml:$.mdRenderedHtml,switchToMdEdit:$.switchToMdEdit,folderPickerOpen:M.folderPickerOpen,folderPickerPath:M.folderPickerPath,folderPickerEntries:M.folderPickerEntries,folderPickerLoading:M.folderPickerLoading,folderPickerSelected:M.folderPickerSelected,searchQuery:D.searchQuery,searchResults:D.searchResults,searchLoading:D.searchLoading,onSearchInput:D.onSearchInput,clearSearch:D.clearSearch,onSearchResultClick:D.onSearchResultClick,quickOpenVisible:D.quickOpenVisible,quickOpenQuery:D.quickOpenQuery,quickOpenResults:D.quickOpenResults,quickOpenSelectedIndex:D.quickOpenSelectedIndex,quickOpenLoading:D.quickOpenLoading,quickOpenInput:D.quickOpenInput,openQuickOpen:D.openQuickOpen,closeQuickOpen:D.closeQuickOpen,onQuickOpenInput:D.onQuickOpenInput,quickOpenSelectNext:D.quickOpenSelectNext,quickOpenSelectPrev:D.quickOpenSelectPrev,quickOpenConfirm:D.quickOpenConfirm,quickOpenOpenFile:D.quickOpenOpenFile,goToLineVisible:D.goToLineVisible,goToLineValue:D.goToLineValue,goToLineInput:D.goToLineInput,openGoToLine:D.openGoToLine,closeGoToLine:D.closeGoToLine,goToLineConfirm:Y,findBarVisible:R.findBarVisible,replaceBarVisible:R.replaceBarVisible,findQuery:R.findQuery,replaceQuery:R.replaceQuery,findCaseSensitive:R.findCaseSensitive,findUseRegex:R.findUseRegex,findMatchCount:R.findMatchCount,findMatchIndex:R.findMatchIndex,findInputRef:R.findInputRef,replaceInputRef:R.replaceInputRef,onFindInput:R.onFindInput,findNext:R.findNext,findPrev:R.findPrev,openFindBar:R.openFindBar,closeFindBar:R.closeFindBar,toggleReplaceBar:R.toggleReplaceBar,replaceOne:R.replaceOne,replaceAll:R.replaceAll,selectedPaths:P.selectedPaths,fileOperating:P.fileOperating,fileOpFeedback:P.fileOpFeedback,newFileDialogVisible:P.newFileDialogVisible,newFileName:P.newFileName,newFileType:P.newFileType,newFileInput:P.newFileInput,moveDialogVisible:P.moveDialogVisible,moveDestination:P.moveDestination,moveDestInput:P.moveDestInput,toggleSelection:P.toggleSelection,clearSelection:P.clearSelection,showNewFileDialog:P.showNewFileDialog,confirmNewFile:P.confirmNewFile,deleteSingleFile:T,deleteSelected:N,openMoveDialog:P.openMoveDialog,confirmMove:P.confirmMove,contextMenu:P.contextMenu,showContextMenu:P.showContextMenu,hideContextMenu:P.hideContextMenu,ctxRename:P.ctxRename,ctxCopy:P.ctxCopy,ctxMoveTo:P.ctxMoveTo,ctxDelete:H,ctxDownload:P.ctxDownload,renameDialogVisible:P.renameDialogVisible,renameNewName:P.renameNewName,renameInput:P.renameInput,confirmRename:P.confirmRename,dragState:P.dragState,externalDropActive:P.externalDropActive,onDragStart:P.onDragStart,onDragOver:P.onDragOver,onDragLeave:P.onDragLeave,onDrop:U,onTreeDragOver:P.onTreeDragOver,onTreeDragLeave:P.onTreeDragLeave,onTreeDrop:ie,loadRootDirectory:m.loadRootDirectory,onTreeItemClick:m.onTreeItemClick,openFileInTab:b.openFileInTab,switchToTab:b.switchToTab,closeFileTab:b.closeFileTab,saveFile:b.saveFile,openFolderPicker:M.openFolderPicker,folderPickerNavigateUp:M.folderPickerNavigateUp,folderPickerSelectItem:M.folderPickerSelectItem,folderPickerEnter:M.folderPickerEnter,confirmFolderPicker:M.confirmFolderPicker,getFileIcon:()=>"",getFileIconHtml:i,getFolderIcon:r,formatSize:o,refresh:m.refresh,placeholderPath:Vue.computed(()=>{let h=s();return h?t("files.workDir",{dir:h}):t("files.enterDirPath")})}}}});var vi,ho=O(()=>{Gd();ou();Au();vi={name:"WorkbenchPanel",components:{TerminalTab:Kd,GitStatusTab:ru,FilesTab:Iu},template:`
|
|
2502
|
+
`,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=()=>e.effectiveWorkDir||"",n=v=>v?v.replace(/\\/g,"/"):"",i=v=>mi(v),r=v=>hi(v),o=v=>v==null?"":v<1024?v+" B":v<1024*1024?(v/1024).toFixed(1)+" KB":(v/(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"},p=Vue.ref(parseInt(localStorage.getItem("filesFontSize"))||15),f=v=>{p.value=Math.max(8,Math.min(24,v)),localStorage.setItem("filesFontSize",p.value.toString());let _=y.activeFile.value;_?.cmInstance&&(_.cmInstance.getWrapperElement().style.fontSize=p.value+"px",_.cmInstance.refresh())},g=()=>f(p.value+1),b=()=>f(p.value-1),h=v=>{v.deltaY<0?g():b()},A=Vue.ref(parseInt(localStorage.getItem("filePanelWidth"))||220),x=Vue.ref(!1),k=v=>{v.preventDefault();let _=v.type==="touchstart";x.value=!0;let X=_?v.touches[0].clientX:v.clientX,ne=A.value;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let me=v.target.closest(".file-two-col"),Se=me?me.offsetWidth*.5:400,Ce=Q=>{let F=_?Q.touches[0].clientX:Q.clientX;A.value=Math.max(120,Math.min(Se,ne+(F-X)))},te=()=>{x.value=!1,document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("filePanelWidth",A.value.toString()),document.removeEventListener("mousemove",Ce),document.removeEventListener("mouseup",te),document.removeEventListener("touchmove",Ce),document.removeEventListener("touchend",te)};document.addEventListener(_?"touchmove":"mousemove",Ce),document.addEventListener(_?"touchend":"mouseup",te)},y,m,w=Vue.computed(()=>y?y.activeFile.value:null),E=Vue.computed(()=>m?m.treePath.value:""),R=au(w),q=fu(e,{activeFile:w,editorContainer:l,fontSize:p,clearFindMarkers:R.clearFindMarkers,openFindBar:R.openFindBar,saveFile:()=>y.saveFile()}),$=gu(w,{editorContainer:l,createEditor:q.createEditor,t}),P=cu(e,{getEffectiveWorkDir:s,treePath:E});y=wu(e,{normalizePath:n,getEffectiveWorkDir:s,editorContainer:l,createEditor:q.createEditor,destroyEditor:q.destroyEditor,clearFindMarkers:R.clearFindMarkers,saveCurrentUndoHistory:q.saveCurrentUndoHistory,saveAllUndoHistory:q.saveAllUndoHistory,cleanupUndoHistory:q.cleanupUndoHistory,deleteConversationHistory:q.deleteConversationHistory,debugStatus:q.debugStatus,mdPreviewMode:$.mdPreviewMode,renderOfficeLocal:$.renderOfficeLocal,performFind:R.performFind,findBarVisible:R.findBarVisible,findQuery:R.findQuery,t}),m=uu(e,{getEffectiveWorkDir:s,normalizePath:n,selectedPaths:P.selectedPaths,lastClickedIndex:P.lastClickedIndex,openFileInTab:(...v)=>y.openFileInTab(...v),clearSelection:P.clearSelection});let D=hu(e,{getEffectiveWorkDir:s,treePath:m.treePath,openFileInTab:(...v)=>y.openFileInTab(...v),normalizePath:n,treeRootPath:m.treeRootPath,treeNodes:m.treeNodes,loadTreeDirectory:m.loadTreeDirectory});q.setKeyBindings({openQuickOpen:D.openQuickOpen,openGoToLine:D.openGoToLine});let M=yu(e,{getEffectiveWorkDir:s,treePath:m.treePath,treeRootPath:m.treeRootPath,treeNodes:m.treeNodes,normalizePath:n,loadTreeDirectory:m.loadTreeDirectory}),C=Su({store:e,normalizePath:n,getEffectiveWorkDir:s,openFiles:y.openFiles,activeFileIndex:y.activeFileIndex,activeFile:y.activeFile,fileLoading:y.fileLoading,fileSaving:y.fileSaving,saveTabsState:y.saveTabsState,createEditor:q.createEditor,openFileInTab:y.openFileInTab,tree:m,fp:M,qo:D,ops:P,mdPreviewMode:$.mdPreviewMode,renderOfficeLocal:$.renderOfficeLocal,editorContainer:l,debugStatus:q.debugStatus}),T=v=>P.deleteSingleFile(v,t),N=()=>P.deleteSelected(t),H=()=>P.ctxDelete(t),U=(v,_)=>P.onDrop(v,_,P.handleExternalFileDrop),ie=v=>P.onTreeDrop(v,m.treeRootPath.value,P.handleExternalFileDrop),Y=()=>D.goToLineConfirm(y.activeFile);Vue.watch(()=>e.currentAgent,()=>{y.saveTabsState(e.currentConversation),q.destroyEditor(),m.clearTreeNodes(),y.openFiles.value=[],y.activeFileIndex.value=-1,y.fileLoading.value=!1,e.currentAgent&&Vue.nextTick(()=>m.initFileBrowser())});let G=e.currentConversation;Vue.watch(()=>e.currentConversation,v=>{y.saveTabsState(G),G=v,y.restoreTabsState(v);let _=s(),X=n(_);_&&X!==m.treeRootPath.value&&(m.treePath.value=_,m.treeRootPath.value=X,m.clearTreeNodes(),m.loadTreeDirectory(_))}),Vue.watch(()=>e.theme,v=>{let _=y.activeFile.value;_?.cmInstance&&_.cmInstance.setOption("theme",v==="dark"?"material-darker":"default")}),Vue.watch(()=>s(),v=>{if(v&&!m.treeRootPath.value){let _=n(v);m.treePath.value=v,m.treeRootPath.value=_,m.clearTreeNodes(),m.loadTreeDirectory(v)}}),Vue.watch(()=>y.activeFile.value?.content,(v,_)=>{let X=y.activeFile.value;if(X&&v!=null&&_==null&&!X.cmInstance&&(!X.fileType||X.fileType==="text")){if(Ct(X.name)&&$.mdPreviewMode.value)return;Vue.nextTick(()=>{setTimeout(()=>{X.cmInstance||q.createEditor(X)},150)})}}),Vue.watch([$.mdRenderedHtml,$.mdPreviewMode],([v,_])=>{v&&_&&Vue.nextTick(()=>{setTimeout(()=>$.renderMermaidBlocks(),50)})});let ee=v=>{!(a.value&&a.value.offsetParent!==null)&&!D.quickOpenVisible.value&&!D.goToLineVisible.value&&!R.findBarVisible.value||((v.ctrlKey||v.metaKey)&&v.key==="p"?(v.preventDefault(),D.quickOpenVisible.value?D.closeQuickOpen():D.openQuickOpen()):(v.ctrlKey||v.metaKey)&&v.key==="g"?(v.preventDefault(),D.goToLineVisible.value?D.closeGoToLine():D.openGoToLine()):(v.ctrlKey||v.metaKey)&&v.key==="f"?y.activeFile.value&&(v.preventDefault(),R.openFindBar(!1)):(v.ctrlKey||v.metaKey)&&(v.key==="r"||v.key==="h")?y.activeFile.value&&(v.preventDefault(),R.openFindBar(!0)):v.key==="Escape"&&(R.findBarVisible.value&&R.closeFindBar(),P.selectedPaths.size>0&&P.clearSelection(),D.quickOpenVisible.value&&D.closeQuickOpen(),D.goToLineVisible.value&&D.closeGoToLine()))},re=()=>{P.hideContextMenu()},ge=()=>{c.value=window.innerWidth<=768};return Vue.watch(()=>y.activeFileIndex.value,(v,_)=>{c.value&&v>=0&&v!==_&&(d.value="editor")}),Vue.watch(()=>y.openFiles.value.length,v=>{c.value&&v===0&&(d.value="tree")}),Vue.onMounted(()=>{window.addEventListener("workbench-message",C.handleWorkbenchMessage),window.addEventListener("open-file-in-explorer",C.handleOpenFile),window.addEventListener("conversation-deleted",y.handleConversationDeleted),window.addEventListener("keydown",ee),document.addEventListener("click",re),window.addEventListener("resize",ge),$.initMermaid(),e.currentAgent&&(m.initFileBrowser(),e.sendWsMessage({type:"restore_file_tabs"}))}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",C.handleWorkbenchMessage),window.removeEventListener("open-file-in-explorer",C.handleOpenFile),window.removeEventListener("conversation-deleted",y.handleConversationDeleted),window.removeEventListener("keydown",ee),document.removeEventListener("click",re),window.removeEventListener("resize",ge),q.destroyEditor(),P.cleanup()}),{store:e,debugStatus:q.debugStatus,rootEl:a,isMobile:c,mobileView:d,mobileGoBack:u,fontSize:p,zoomIn:g,zoomOut:b,onWheel:h,treePath:m.treePath,treeRootPath:m.treeRootPath,treeNodes:m.treeNodes,flattenedTree:m.flattenedTree,editingTreePath:m.editingTreePath,treePathInputRef:m.treePathInputRef,rootFolderName:m.rootFolderName,rootExpanded:m.rootExpanded,toggleRootExpand:m.toggleRootExpand,collapseAll:m.collapseAll,startTreePathEdit:m.startTreePathEdit,confirmTreePath:m.confirmTreePath,cancelTreePathEdit:m.cancelTreePathEdit,treePanelWidth:A,isTreeResizing:x,startTreeResize:k,openFiles:y.openFiles,activeFileIndex:y.activeFileIndex,activeFile:y.activeFile,fileLoading:y.fileLoading,fileSaving:y.fileSaving,editorContainer:l,officePreviewContainer:$.officePreviewContainer,mdPreviewRef:$.mdPreviewRef,isActiveMarkdown:$.isActiveMarkdown,mdPreviewMode:$.mdPreviewMode,mdRenderedHtml:$.mdRenderedHtml,switchToMdEdit:$.switchToMdEdit,folderPickerOpen:M.folderPickerOpen,folderPickerPath:M.folderPickerPath,folderPickerEntries:M.folderPickerEntries,folderPickerLoading:M.folderPickerLoading,folderPickerSelected:M.folderPickerSelected,searchQuery:D.searchQuery,searchResults:D.searchResults,searchLoading:D.searchLoading,onSearchInput:D.onSearchInput,clearSearch:D.clearSearch,onSearchResultClick:D.onSearchResultClick,quickOpenVisible:D.quickOpenVisible,quickOpenQuery:D.quickOpenQuery,quickOpenResults:D.quickOpenResults,quickOpenSelectedIndex:D.quickOpenSelectedIndex,quickOpenLoading:D.quickOpenLoading,quickOpenInput:D.quickOpenInput,openQuickOpen:D.openQuickOpen,closeQuickOpen:D.closeQuickOpen,onQuickOpenInput:D.onQuickOpenInput,quickOpenSelectNext:D.quickOpenSelectNext,quickOpenSelectPrev:D.quickOpenSelectPrev,quickOpenConfirm:D.quickOpenConfirm,quickOpenOpenFile:D.quickOpenOpenFile,goToLineVisible:D.goToLineVisible,goToLineValue:D.goToLineValue,goToLineInput:D.goToLineInput,openGoToLine:D.openGoToLine,closeGoToLine:D.closeGoToLine,goToLineConfirm:Y,findBarVisible:R.findBarVisible,replaceBarVisible:R.replaceBarVisible,findQuery:R.findQuery,replaceQuery:R.replaceQuery,findCaseSensitive:R.findCaseSensitive,findUseRegex:R.findUseRegex,findMatchCount:R.findMatchCount,findMatchIndex:R.findMatchIndex,findInputRef:R.findInputRef,replaceInputRef:R.replaceInputRef,onFindInput:R.onFindInput,findNext:R.findNext,findPrev:R.findPrev,openFindBar:R.openFindBar,closeFindBar:R.closeFindBar,toggleReplaceBar:R.toggleReplaceBar,replaceOne:R.replaceOne,replaceAll:R.replaceAll,selectedPaths:P.selectedPaths,fileOperating:P.fileOperating,fileOpFeedback:P.fileOpFeedback,newFileDialogVisible:P.newFileDialogVisible,newFileName:P.newFileName,newFileType:P.newFileType,newFileInput:P.newFileInput,moveDialogVisible:P.moveDialogVisible,moveDestination:P.moveDestination,moveDestInput:P.moveDestInput,toggleSelection:P.toggleSelection,clearSelection:P.clearSelection,showNewFileDialog:P.showNewFileDialog,confirmNewFile:P.confirmNewFile,deleteSingleFile:T,deleteSelected:N,openMoveDialog:P.openMoveDialog,confirmMove:P.confirmMove,contextMenu:P.contextMenu,showContextMenu:P.showContextMenu,hideContextMenu:P.hideContextMenu,ctxRename:P.ctxRename,ctxCopy:P.ctxCopy,ctxMoveTo:P.ctxMoveTo,ctxDelete:H,ctxDownload:P.ctxDownload,renameDialogVisible:P.renameDialogVisible,renameNewName:P.renameNewName,renameInput:P.renameInput,confirmRename:P.confirmRename,dragState:P.dragState,externalDropActive:P.externalDropActive,onDragStart:P.onDragStart,onDragOver:P.onDragOver,onDragLeave:P.onDragLeave,onDrop:U,onTreeDragOver:P.onTreeDragOver,onTreeDragLeave:P.onTreeDragLeave,onTreeDrop:ie,loadRootDirectory:m.loadRootDirectory,onTreeItemClick:m.onTreeItemClick,openFileInTab:y.openFileInTab,switchToTab:y.switchToTab,closeFileTab:y.closeFileTab,saveFile:y.saveFile,openFolderPicker:M.openFolderPicker,folderPickerNavigateUp:M.folderPickerNavigateUp,folderPickerSelectItem:M.folderPickerSelectItem,folderPickerEnter:M.folderPickerEnter,confirmFolderPicker:M.confirmFolderPicker,getFileIcon:()=>"",getFileIconHtml:i,getFolderIcon:r,formatSize:o,refresh:m.refresh,placeholderPath:Vue.computed(()=>{let v=s();return v?t("files.workDir",{dir:v}):t("files.enterDirPath")})}}}});var vi,ho=O(()=>{Gd();ou();Au();vi={name:"WorkbenchPanel",components:{TerminalTab:Kd,GitStatusTab:ru,FilesTab:Iu},template:`
|
|
2503
2503
|
<div class="workbench-panel" :class="{ expanded: store.workbenchExpanded, maximized: store.workbenchMaximized }" :style="panelStyle">
|
|
2504
2504
|
<!-- \u5C55\u5F00\u65F6\u7684\u5B8C\u6574\u9762\u677F -->
|
|
2505
2505
|
<div class="workbench-content" v-if="store.workbenchExpanded">
|
|
@@ -2553,7 +2553,7 @@ ${String(e||"").trim()}
|
|
|
2553
2553
|
<!-- \u62D6\u62FD\u8C03\u6574\u5BBD\u5EA6\u624B\u67C4 -->
|
|
2554
2554
|
<div class="resize-handle" @mousedown="startResize" @touchstart.prevent="startResize" v-if="store.workbenchExpanded"></div>
|
|
2555
2555
|
</div>
|
|
2556
|
-
`,setup(){let e=Pinia.useChatStore(),t=Vue.computed(()=>e.hasCapability("terminal")),s=Vue.computed(()=>e.hasCapability("file_editor")),n=Vue.computed(()=>!1),i=Vue.reactive({}),r=()=>s.value?"files":t.value?"terminal":"files",o=Vue.computed(()=>{let
|
|
2556
|
+
`,setup(){let e=Pinia.useChatStore(),t=Vue.computed(()=>e.hasCapability("terminal")),s=Vue.computed(()=>e.hasCapability("file_editor")),n=Vue.computed(()=>!1),i=Vue.reactive({}),r=()=>s.value?"files":t.value?"terminal":"files",o=Vue.computed(()=>{let b=e.currentConversation,h=b&&i[b]||"files";return h==="terminal"&&!t.value||(h==="git"||h==="files"||h==="explorer")&&!s.value?r():h==="explorer"?"git":h}),a=b=>{let h=e.currentConversation;h&&(i[h]=b)},l=Vue.ref(0),c=Vue.ref(!1),d=Vue.ref(!1),u=Vue.computed(()=>{if(!e.workbenchExpanded)return{};if(e.workbenchMaximized)return{};if(window.innerWidth<=768)return{};if(!d.value)return c.value?{transition:"none"}:{};let b={width:l.value+"px"};return c.value&&(b.transition="none"),b}),p=b=>{b.preventDefault();let h=b.type==="touchstart",A=h?b.touches[0].clientX:b.clientX;if(c.value=!0,!d.value){let m=b.target.closest(".workbench-panel");m&&(l.value=m.offsetWidth),d.value=!0}let x=l.value;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let k=m=>{let E=(h?m.touches[0].clientX:m.clientX)-A,R=Math.max(900,window.innerWidth-100);l.value=Math.max(280,Math.min(R,x+E))},y=()=>{c.value=!1,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",y),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",y)};document.addEventListener(h?"touchmove":"mousemove",k),document.addEventListener(h?"touchend":"mouseup",y)},f=()=>{let b=e.currentConversation;b&&s.value&&(i[b]="files")},g=b=>{let{conversationId:h}=b.detail;h&&delete i[h]};return Vue.onMounted(()=>{window.addEventListener("open-file-in-explorer",f),window.addEventListener("conversation-deleted",g)}),Vue.onUnmounted(()=>{window.removeEventListener("open-file-in-explorer",f),window.removeEventListener("conversation-deleted",g)}),{store:e,activeTab:o,setTab:a,hasTerminal:t,hasExplorer:s,hasTasks:n,panelStyle:u,startResize:p}}}});function st(e){let t=e?.currentTarget;t&&dn.set(t,{startedOnOverlay:e.target===t,endedOnOverlay:!1})}function nt(e){let t=e?.currentTarget,s=t&&dn.get(t);s&&(s.endedOnOverlay=e.target===t)}function it(e){let t=e?.currentTarget;t&&dn.delete(t)}function Ze(e){let t=e?.currentTarget;if(!t)return!1;let s=dn.get(t),n=e.target===t&&s?.startedOnOverlay===!0&&s.endedOnOverlay===!0;return dn.delete(t),n}var dn,Yt=O(()=>{dn=new WeakMap});var gt,xu,Tu=O(()=>{ct();gt=20,xu={name:"DashboardTab",template:`
|
|
2557
2557
|
<div class="db-container">
|
|
2558
2558
|
<!-- Loading state -->
|
|
2559
2559
|
<div v-if="loading && !loaded" class="db-loading">{{ $t('settings.dashboard.loading') }}</div>
|
|
@@ -2841,7 +2841,7 @@ ${String(e||"").trim()}
|
|
|
2841
2841
|
</div>
|
|
2842
2842
|
</template>
|
|
2843
2843
|
</div>
|
|
2844
|
-
`,data(){return{loading:!1,loaded:!1,error:!1,overview:{totalUsers:0,todayActiveUsers:0,onlineAgents:0,todayMessages:0,totalTokens:0,agentMetrics:null},statsPeriod:"all",userStats:[],agents:[],onlineUsers:[],userSort:{field:null,order:"asc"},agentSort:{field:null,order:"asc"},onlineSort:{field:null,order:"asc"},userVisibleCount:gt,agentVisibleCount:gt,onlineVisibleCount:gt}},mounted(){this.fetchAll()},computed:{periods(){return[{value:"today",label:this.$t("settings.dashboard.today")},{value:"week",label:this.$t("settings.dashboard.thisWeek")},{value:"month",label:this.$t("settings.dashboard.thisMonth")},{value:"all",label:this.$t("settings.dashboard.all")}]},sortedUserStats(){return this.userSort.field?this.sortArray(this.userStats,this.userSort.field,this.userSort.order,"user"):this.userStats},pagedUserStats(){return this.sortedUserStats.slice(0,this.userVisibleCount)},agentMetricTotals(){return this.normalizeMetrics(this.overview.agentMetrics||{})},sortedAgents(){return this.agentSort.field?this.sortArray(this.agents,this.agentSort.field,this.agentSort.order,"agent"):this.agents},pagedAgents(){return this.sortedAgents.slice(0,this.agentVisibleCount)},sortedOnlineUsers(){return this.onlineSort.field?this.sortArray(this.onlineUsers,this.onlineSort.field,this.onlineSort.order,"online"):this.onlineUsers},pagedOnlineUsers(){return this.sortedOnlineUsers.slice(0,this.onlineVisibleCount)}},methods:{getHeaders(){let e=Ae(),t={"Content-Type":"application/json"};return e.token&&(t.Authorization=`Bearer ${e.token}`),t},toggleSort(e,t){let s=e+"Sort";this[s].field===t?this[s].order=this[s].order==="asc"?"desc":"asc":(this[s].field=t,this[s].order="asc")},sortArray(e,t,s,n){let i=[...e];return i.sort((r,o)=>{let a,l;if(n==="user"&&t==="traffic"?(a=(r.bytesSent||0)+(r.bytesReceived||0),l=(o.bytesSent||0)+(o.bytesReceived||0)):n==="agent"&&t==="online"?(a=r.online?1:0,l=o.online?1:0):n==="agent"&&(t==="totalTokens"||t==="totalTurns")?(a=r.metrics?.[t]||0,l=o.metrics?.[t]||0):(a=r[t],l=o[t]),a==null&&l==null)return 0;if(a==null)return 1;if(l==null)return-1;let c;return typeof a=="string"?c=a.localeCompare(l,void 0,{sensitivity:"base"}):typeof a=="boolean"?c=a===l?0:a?-1:1:c=a-l,s==="desc"?-c:c}),i},async fetchAll(){this.loading=!0,this.error=!1;try{let e=this.getHeaders(),[t,s,n,i]=await Promise.all([fetch("/api/admin/dashboard",{headers:e}),fetch(`/api/admin/user-stats?period=${this.statsPeriod}`,{headers:e}),fetch("/api/admin/agents",{headers:e}),fetch("/api/admin/online-users",{headers:e})]);if(!t.ok||!s.ok||!n.ok||!i.ok){this.error=!0;return}let[r,o,a,l]=await Promise.all([t.json(),s.json(),n.json(),i.json()]);this.overview={totalUsers:r.totalUsers??0,todayActiveUsers:r.todayActiveUsers??0,onlineAgents:r.onlineAgents??0,todayMessages:r.todayMessages??0,totalTokens:r.totalTokens??0,agentMetrics:this.normalizeMetrics(r.agentMetrics||{})},this.userStats=Array.isArray(o)?o:[],this.agents=Array.isArray(a)?a.map(c=>({...c,metrics:this.normalizeMetrics(c.metrics||{})})):[],this.onlineUsers=Array.isArray(l)?l:[],this.loaded=!0}catch{this.error=!0}finally{this.loading=!1}},async refreshAll(){await this.fetchAll()},async switchPeriod(e){e!==this.statsPeriod&&(this.statsPeriod=e,this.userVisibleCount=gt,await this.fetchUserStats())},async fetchUserStats(){try{let e=this.getHeaders(),t=await fetch(`/api/admin/user-stats?period=${this.statsPeriod}`,{headers:e});if(!t.ok)return;let s=await t.json();this.userStats=Array.isArray(s)?s:[]}catch{}},latencyClass(e){return e<100?"db-latency-good":e<=500?"db-latency-warn":"db-latency-bad"},normalizeMetrics(e={}){let t=l=>{let c=Number(l);return Number.isFinite(c)&&c>0?c:0},s=t(e.chatTurns),n=t(e.yeaftTurns),i=t(e.inputTokens),r=t(e.outputTokens),o=t(e.cacheReadTokens),a=t(e.cacheWriteTokens);return{chatTurns:s,yeaftTurns:n,totalTurns:t(e.totalTurns)||s+n,sessionsCreated:t(e.sessionsCreated),inputTokens:i,outputTokens:r,cacheReadTokens:o,cacheWriteTokens:a,totalTokens:t(e.totalTokens)||i+r+o+a,lastUpdatedAt:e.lastUpdatedAt||null}},agentTokenTitle(e){let t=this.normalizeMetrics(e?.metrics||{});return this.tokenTitle(t)},userTokenTitle(e){return this.tokenTitle(e||{})},tokenTitle(e){return[`${this.$t("settings.dashboard.inputTokens")}: ${this.formatNumber(Number(e.inputTokens)||0)}`,`${this.$t("settings.dashboard.outputTokens")}: ${this.formatNumber(Number(e.outputTokens)||0)}`,`${this.$t("settings.dashboard.cacheTokens")}: ${this.formatNumber((Number(e.cacheReadTokens)||0)+(Number(e.cacheWriteTokens)||0))}`].join(" \xB7 ")},formatNumber(e){return e==null?"0":e.toLocaleString()},formatCompactNumber(e){let t=Number(e)||0;return t<1e3?this.formatNumber(t):t<1e6?`${(t/1e3).toFixed(t<1e4?1:0)}K`:t<1e9?`${(t/1e6).toFixed(t<1e7?1:0)}M`:`${(t/1e9).toFixed(1)}B`},formatBytes(e){if(!e||e===0)return"0 B";let t=["B","KB","MB","GB"],s=0,n=e;for(;n>=1024&&s<t.length-1;)n/=1024,s++;return`${n<10&&s>0?n.toFixed(1):Math.round(n)} ${t[s]}`},formatRelativeTime(e){if(!e)return"\u2014";let s=Date.now()-new Date(e).getTime();if(s<0)return"\u2014";let n=Math.floor(s/1e3);if(n<60)return this.$t("settings.dashboard.ago",{time:`${n}s`});let i=Math.floor(n/60);if(i<60)return this.$t("settings.dashboard.ago",{time:`${i}m`});let r=Math.floor(i/60);if(r<24)return this.$t("settings.dashboard.ago",{time:`${r}h`});let o=Math.floor(r/24);return this.$t("settings.dashboard.ago",{time:`${o}d`})}}}});function Mu(e){return!e||typeof e!="string"?{ok:!1,reason:"empty_or_non_string"}:e.length>40?{ok:!1,reason:"too_long"}:
|
|
2844
|
+
`,data(){return{loading:!1,loaded:!1,error:!1,overview:{totalUsers:0,todayActiveUsers:0,onlineAgents:0,todayMessages:0,totalTokens:0,agentMetrics:null},statsPeriod:"all",userStats:[],agents:[],onlineUsers:[],userSort:{field:null,order:"asc"},agentSort:{field:null,order:"asc"},onlineSort:{field:null,order:"asc"},userVisibleCount:gt,agentVisibleCount:gt,onlineVisibleCount:gt}},mounted(){this.fetchAll()},computed:{periods(){return[{value:"today",label:this.$t("settings.dashboard.today")},{value:"week",label:this.$t("settings.dashboard.thisWeek")},{value:"month",label:this.$t("settings.dashboard.thisMonth")},{value:"all",label:this.$t("settings.dashboard.all")}]},sortedUserStats(){return this.userSort.field?this.sortArray(this.userStats,this.userSort.field,this.userSort.order,"user"):this.userStats},pagedUserStats(){return this.sortedUserStats.slice(0,this.userVisibleCount)},agentMetricTotals(){return this.normalizeMetrics(this.overview.agentMetrics||{})},sortedAgents(){return this.agentSort.field?this.sortArray(this.agents,this.agentSort.field,this.agentSort.order,"agent"):this.agents},pagedAgents(){return this.sortedAgents.slice(0,this.agentVisibleCount)},sortedOnlineUsers(){return this.onlineSort.field?this.sortArray(this.onlineUsers,this.onlineSort.field,this.onlineSort.order,"online"):this.onlineUsers},pagedOnlineUsers(){return this.sortedOnlineUsers.slice(0,this.onlineVisibleCount)}},methods:{getHeaders(){let e=Ae(),t={"Content-Type":"application/json"};return e.token&&(t.Authorization=`Bearer ${e.token}`),t},toggleSort(e,t){let s=e+"Sort";this[s].field===t?this[s].order=this[s].order==="asc"?"desc":"asc":(this[s].field=t,this[s].order="asc")},sortArray(e,t,s,n){let i=[...e];return i.sort((r,o)=>{let a,l;if(n==="user"&&t==="traffic"?(a=(r.bytesSent||0)+(r.bytesReceived||0),l=(o.bytesSent||0)+(o.bytesReceived||0)):n==="agent"&&t==="online"?(a=r.online?1:0,l=o.online?1:0):n==="agent"&&(t==="totalTokens"||t==="totalTurns")?(a=r.metrics?.[t]||0,l=o.metrics?.[t]||0):(a=r[t],l=o[t]),a==null&&l==null)return 0;if(a==null)return 1;if(l==null)return-1;let c;return typeof a=="string"?c=a.localeCompare(l,void 0,{sensitivity:"base"}):typeof a=="boolean"?c=a===l?0:a?-1:1:c=a-l,s==="desc"?-c:c}),i},async fetchAll(){this.loading=!0,this.error=!1;try{let e=this.getHeaders(),[t,s,n,i]=await Promise.all([fetch("/api/admin/dashboard",{headers:e}),fetch(`/api/admin/user-stats?period=${this.statsPeriod}`,{headers:e}),fetch("/api/admin/agents",{headers:e}),fetch("/api/admin/online-users",{headers:e})]);if(!t.ok||!s.ok||!n.ok||!i.ok){this.error=!0;return}let[r,o,a,l]=await Promise.all([t.json(),s.json(),n.json(),i.json()]);this.overview={totalUsers:r.totalUsers??0,todayActiveUsers:r.todayActiveUsers??0,onlineAgents:r.onlineAgents??0,todayMessages:r.todayMessages??0,totalTokens:r.totalTokens??0,agentMetrics:this.normalizeMetrics(r.agentMetrics||{})},this.userStats=Array.isArray(o)?o:[],this.agents=Array.isArray(a)?a.map(c=>({...c,metrics:this.normalizeMetrics(c.metrics||{})})):[],this.onlineUsers=Array.isArray(l)?l:[],this.loaded=!0}catch{this.error=!0}finally{this.loading=!1}},async refreshAll(){await this.fetchAll()},async switchPeriod(e){e!==this.statsPeriod&&(this.statsPeriod=e,this.userVisibleCount=gt,await this.fetchUserStats())},async fetchUserStats(){try{let e=this.getHeaders(),t=await fetch(`/api/admin/user-stats?period=${this.statsPeriod}`,{headers:e});if(!t.ok)return;let s=await t.json();this.userStats=Array.isArray(s)?s:[]}catch{}},latencyClass(e){return e<100?"db-latency-good":e<=500?"db-latency-warn":"db-latency-bad"},normalizeMetrics(e={}){let t=l=>{let c=Number(l);return Number.isFinite(c)&&c>0?c:0},s=t(e.chatTurns),n=t(e.yeaftTurns),i=t(e.inputTokens),r=t(e.outputTokens),o=t(e.cacheReadTokens),a=t(e.cacheWriteTokens);return{chatTurns:s,yeaftTurns:n,totalTurns:t(e.totalTurns)||s+n,sessionsCreated:t(e.sessionsCreated),inputTokens:i,outputTokens:r,cacheReadTokens:o,cacheWriteTokens:a,totalTokens:t(e.totalTokens)||i+r+o+a,lastUpdatedAt:e.lastUpdatedAt||null}},agentTokenTitle(e){let t=this.normalizeMetrics(e?.metrics||{});return this.tokenTitle(t)},userTokenTitle(e){return this.tokenTitle(e||{})},tokenTitle(e){return[`${this.$t("settings.dashboard.inputTokens")}: ${this.formatNumber(Number(e.inputTokens)||0)}`,`${this.$t("settings.dashboard.outputTokens")}: ${this.formatNumber(Number(e.outputTokens)||0)}`,`${this.$t("settings.dashboard.cacheTokens")}: ${this.formatNumber((Number(e.cacheReadTokens)||0)+(Number(e.cacheWriteTokens)||0))}`].join(" \xB7 ")},formatNumber(e){return e==null?"0":e.toLocaleString()},formatCompactNumber(e){let t=Number(e)||0;return t<1e3?this.formatNumber(t):t<1e6?`${(t/1e3).toFixed(t<1e4?1:0)}K`:t<1e9?`${(t/1e6).toFixed(t<1e7?1:0)}M`:`${(t/1e9).toFixed(1)}B`},formatBytes(e){if(!e||e===0)return"0 B";let t=["B","KB","MB","GB"],s=0,n=e;for(;n>=1024&&s<t.length-1;)n/=1024,s++;return`${n<10&&s>0?n.toFixed(1):Math.round(n)} ${t[s]}`},formatRelativeTime(e){if(!e)return"\u2014";let s=Date.now()-new Date(e).getTime();if(s<0)return"\u2014";let n=Math.floor(s/1e3);if(n<60)return this.$t("settings.dashboard.ago",{time:`${n}s`});let i=Math.floor(n/60);if(i<60)return this.$t("settings.dashboard.ago",{time:`${i}m`});let r=Math.floor(i/60);if(r<24)return this.$t("settings.dashboard.ago",{time:`${r}h`});let o=Math.floor(r/24);return this.$t("settings.dashboard.ago",{time:`${o}d`})}}}});function Mu(e){return!e||typeof e!="string"?{ok:!1,reason:"empty_or_non_string"}:e.length>40?{ok:!1,reason:"too_long"}:Dm.test(e)?e.startsWith("_")?{ok:!1,reason:"underscore_prefix_reserved"}:_m.test(e)?{ok:!1,reason:"pure_digits"}:Em.includes(e.toLowerCase())?{ok:!1,reason:"reserved"}:{ok:!0}:{ok:!1,reason:"illegal_character"}}function Pu(e){return typeof e=="string"&&Lm.has(e)}function Is(e){return Rm[e]||e}var Dm,_m,Em,Rm,Lm,Du=O(()=>{Dm=/^[A-Za-z0-9_-]+$/,_m=/^[0-9]+$/,Em=["all","user","system","everyone"];Rm=Object.freeze({empty_or_non_string:"yeaft.vp.idError.empty_or_non_string",too_long:"yeaft.vp.idError.too_long",illegal_character:"yeaft.vp.idError.illegal_character",underscore_prefix_reserved:"yeaft.vp.idError.underscore_prefix_reserved",pure_digits:"yeaft.vp.idError.pure_digits",reserved:"yeaft.vp.idError.reserved",duplicate:"yeaft.vp.idError.duplicate",not_found:"yeaft.vp.idError.not_found",stock_readonly:"yeaft.vp.idError.stock_readonly",unknown:"yeaft.vp.idError.unknown"}),Lm=Object.freeze(new Set(["empty_or_non_string","too_long","illegal_character","underscore_prefix_reserved","pure_digits","reserved","duplicate"]))});var _u,Eu=O(()=>{gs();on();Du();_u={name:"VpCrudPanel",props:{initialEditVpId:{type:String,default:""}},template:`
|
|
2845
2845
|
<div class="vp-crud-panel">
|
|
2846
2846
|
<!-- LIST VIEW -->
|
|
2847
2847
|
<div v-if="view === 'list'" class="vp-crud-body vp-crud-list">
|
|
@@ -3197,7 +3197,7 @@ ${String(e||"").trim()}
|
|
|
3197
3197
|
</button>
|
|
3198
3198
|
</div>
|
|
3199
3199
|
</div>
|
|
3200
|
-
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.getCurrentInstance(),i=m=>n?.proxy?.$t?.(m)??m,r=Vue.computed(()=>s.searchSettings),o=Vue.computed(()=>s.tavilyUsage),a=Vue.computed(()=>s.tavilyUsageLoading),l=Vue.reactive({backend:"tavily",key:""}),c=Vue.ref(!1),d=Vue.ref(!1);function u(){let m=r.value;l.backend=m?.backend||"tavily",l.key="",c.value=!1}Vue.watch(r,u,{immediate:!0});let p=Vue.computed(()=>c.value?l.key:""),f=Vue.computed(()=>{let m=r.value;return m?!!((m.backend||"tavily")!==l.backend||c.value):c.value});function g(m){c.value=!0,l.key=m.target.value}function
|
|
3200
|
+
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.getCurrentInstance(),i=m=>n?.proxy?.$t?.(m)??m,r=Vue.computed(()=>s.searchSettings),o=Vue.computed(()=>s.tavilyUsage),a=Vue.computed(()=>s.tavilyUsageLoading),l=Vue.reactive({backend:"tavily",key:""}),c=Vue.ref(!1),d=Vue.ref(!1);function u(){let m=r.value;l.backend=m?.backend||"tavily",l.key="",c.value=!1}Vue.watch(r,u,{immediate:!0});let p=Vue.computed(()=>c.value?l.key:""),f=Vue.computed(()=>{let m=r.value;return m?!!((m.backend||"tavily")!==l.backend||c.value):c.value});function g(m){c.value=!0,l.key=m.target.value}function b(){!c.value&&r.value?.tavilyKeyConfigured&&(c.value=!0,l.key="")}function h(){c.value=!0,l.key=""}function A(){u()}async function x(){if(!(d.value||!f.value)){d.value=!0;try{let m={backend:l.backend};c.value&&(m.tavilyApiKey=l.key.trim());let w=await s.updateSearchSettings(m);w?.error?t("message",w.error,!0):(t("message",i("search.settings.saveSuccess"),!1),c.value&&await s.loadTavilyUsage())}catch(m){t("message",m.message||String(m),!0)}finally{d.value=!1}}}async function k(){await s.loadTavilyUsage()}function y(m,w){return w?Math.min(100,Math.round(m/w*100)):0}return Vue.onMounted(async()=>{await s.loadSearchSettings(),s.searchSettings?.tavilyKeyConfigured&&s.loadTavilyUsage()}),{settings:r,usage:o,usageLoading:a,form:l,keyDirty:c,keyDisplay:p,saving:d,dirty:f,onKeyInput:g,onKeyFocus:b,clearKey:h,reset:A,save:x,refreshUsage:k,pct:y}}}});var $u,Vu=O(()=>{$u={name:"McpTab",emits:["message"],template:`
|
|
3201
3201
|
<div class="mcp-settings-tab">
|
|
3202
3202
|
<div class="settings-section">
|
|
3203
3203
|
<h3 class="settings-section-title">
|
|
@@ -3300,7 +3300,7 @@ ${String(e||"").trim()}
|
|
|
3300
3300
|
</div>
|
|
3301
3301
|
</div>
|
|
3302
3302
|
</div>
|
|
3303
|
-
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.getCurrentInstance(),i=k=>n?.proxy?.$t?.(k)??k,r=Vue.computed(()=>s.yeaftMcpServers||[]),o=Vue.computed(()=>s.yeaftMcpRuntime||{connected:!1,toolCount:0,perServer:[]}),a=Vue.computed(()=>!!s.yeaftMcpLoading),l=Vue.computed(()=>{let k=new Map((o.value.perServer||[]).map(
|
|
3303
|
+
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.getCurrentInstance(),i=k=>n?.proxy?.$t?.(k)??k,r=Vue.computed(()=>s.yeaftMcpServers||[]),o=Vue.computed(()=>s.yeaftMcpRuntime||{connected:!1,toolCount:0,perServer:[]}),a=Vue.computed(()=>!!s.yeaftMcpLoading),l=Vue.computed(()=>{let k=new Map((o.value.perServer||[]).map(y=>[y.name,y]));return r.value.map(y=>{let m=k.get(y.name);return{...y,ready:!!(m&&m.ready),toolCount:m?m.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 p(k){if(!k)return[];let y=[],m=/"([^"]*)"|'([^']*)'|(\S+)/g,w;for(;(w=m.exec(k))!==null;)y.push(w[1]??w[2]??w[3]);return y}function f(k){if(!k)return{};let y={},m=k.split(/\r?\n/);for(let w of m){let E=w.trim();if(!E||E.startsWith("#"))continue;let R=E.indexOf("=");if(R<0)continue;let q=E.slice(0,R).trim(),$=E.slice(R+1);q&&(y[q]=$)}return y}function g(){d.value="";let k=(c.name||"").trim(),y=(c.command||"").trim();if(!k)return d.value=i("settings.mcp.errors.nameRequired"),null;if(!/^[a-z0-9_-]+$/.test(k))return d.value=i("settings.mcp.errors.nameFormat"),null;if(!y)return d.value=i("settings.mcp.errors.commandRequired"),null;let m=[],w={};try{m=p(c.argsRaw)}catch{return d.value=i("settings.mcp.errors.argsParse"),null}try{w=f(c.envRaw)}catch{return d.value=i("settings.mcp.errors.envParse"),null}return{name:k,command:y,args:m,env:w}}async function b(){let k=g();if(!k)return;let y=await s.addYeaftMcpServer(k);if(y?.error){t("message",y.error,!0);return}y?.connectError?t("message",i("settings.mcp.connectFailed")+": "+y.connectError,!0):t("message",i("settings.mcp.addSuccess"),!1),u()}async function h(k){if(!k||!confirm(i("settings.mcp.confirmRemove").replace("{name}",k)))return;let y=await s.removeYeaftMcpServer(k);y?.error?t("message",y.error,!0):t("message",i("settings.mcp.removeSuccess"),!1)}async function A(k){let y=await s.reloadYeaftMcpServer(k);y?.error?t("message",y.error,!0):t("message",i("settings.mcp.reloadSuccess"),!1)}async function x(){let k=await s.reloadYeaftMcpServer(null);k?.error?t("message",k.error,!0):t("message",i("settings.mcp.reloadSuccess"),!1)}return Vue.onMounted(()=>{s.loadYeaftMcpServers()}),{servers:r,runtime:o,loading:a,serversWithStatus:l,form:c,formError:d,resetForm:u,addServer:b,removeOne:h,reloadOne:A,reloadAll:x}}}});var yi,vo=O(()=>{ct();Br();Ur();Yt();Tu();Eu();Lu();Vu();yi={name:"SettingsPanel",components:{DashboardTab:xu,VpCrudPanel:_u,SearchSettingsTab:Ru,McpTab:$u},props:{visible:Boolean,initialTab:{type:String,default:""},initialSubTab:{type:String,default:""},initialEditVpId:{type:String,default:""}},emits:["close"],template:`
|
|
3304
3304
|
<div
|
|
3305
3305
|
class="settings-overlay"
|
|
3306
3306
|
v-if="visible"
|
|
@@ -4009,7 +4009,7 @@ ${String(e||"").trim()}
|
|
|
4009
4009
|
</div>
|
|
4010
4010
|
</div>
|
|
4011
4011
|
</div>
|
|
4012
|
-
`,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(),i=Vue.ref(null),r=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},p=Vue.computed(()=>{if(!a.value)return null;let
|
|
4012
|
+
`,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(),i=Vue.ref(null),r=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},p=Vue.computed(()=>{if(!a.value)return null;let v=dt[a.value];return v||s.customExpertRoles.find(_=>_.id===a.value)||null}),f=Vue.computed(()=>{let v=p.value;return v?`${v.title}\xB7${v.name}`:""}),g=Vue.computed(()=>!a.value||!s.expertRoleDefinitions?null:s.expertRoleDefinitions[a.value]||null),b=Vue.computed(()=>!a.value||dt[a.value]?null:s.customExpertRoles.find(v=>v.id===a.value)||null),h=Vue.ref(new Set([al])),A=Vue.computed(()=>e.modelValue),x=Vue.computed(()=>ll(r.value)),k=Vue.computed(()=>{let v=[...x.value];return v.push({id:"custom",name:o.value?"\u81EA\u5B9A\u4E49":"Custom",icon:"\u2728",order:99}),v}),y=Vue.computed(()=>h.value.has("custom")),m=Vue.computed(()=>new Set(x.value.map(v=>v.id))),w=Vue.computed(()=>rl().filter(v=>m.value.has(v.teamId)&&h.value.has(v.teamId)));Vue.watch(()=>e.visible,v=>{v&&(s.fetchExpertRoleDefinitions(),s.fetchCustomExpertRoles())});let E=v=>{a.value=v,dt[v]&&s.fetchExpertRoleDefinitions()},R=v=>{c.value=v,l.value=!0},q=()=>{s.fetchCustomExpertRoles()},$=v=>{d.value=v},P=async()=>{if(d.value){try{let v=d.value.id,_=A.value.filter(X=>X.role!==v);_.length!==A.value.length&&t("update:modelValue",_),await s.deleteCustomExpertRole(v)}catch{}d.value=null}},D=v=>{if(!(h.value.size===1&&h.value.has(v)))if(h.value=new Set([v]),v==="custom"){let _=new Set(s.customExpertRoles.map(ne=>ne.id)),X=A.value.filter(ne=>_.has(ne.role));X.length!==A.value.length&&t("update:modelValue",X)}else{let _=A.value.filter(X=>{let ne=dt[X.role];return ne&&ne.group===v});_.length!==A.value.length&&t("update:modelValue",_)}},M=(v,_)=>A.value.some(X=>X.role===v&&X.action===(_||null)),C=v=>A.value.some(_=>_.role===v&&!_.action),T=v=>A.value.some(_=>_.role===v),N=v=>A.value.length>=Wt&&!T(v),H=(v,_)=>M(v,_)?!1:!!(T(v)||A.value.length>=Wt),U=v=>{if(C(v.id)){t("update:modelValue",A.value.filter(_=>!(_.role===v.id&&!_.action)));return}if(T(v.id)){t("update:modelValue",[...A.value.filter(_=>_.role!==v.id),{role:v.id,action:null}]);return}A.value.length>=Wt||t("update:modelValue",[...A.value,{role:v.id,action:null}])},ie=(v,_)=>{if(M(v.id,_.id)){t("update:modelValue",A.value.filter(X=>!(X.role===v.id&&X.action===_.id)));return}if(T(v.id)){t("update:modelValue",[...A.value.filter(X=>X.role!==v.id),{role:v.id,action:_.id}]);return}A.value.length>=Wt||t("update:modelValue",[...A.value,{role:v.id,action:_.id}])};return{store:s,roleListRef:i,enabledTeams:h,selections:A,availableTeams:x,allTeamTabs:k,filteredGroups:w,isZh:o,isCustomTabActive:y,viewingRoleId:a,viewingRoleMeta:p,viewingRoleTitle:f,viewingRoleDef:g,viewingCustomRole:b,viewRole:E,editorOpen:l,editingRole:c,openEditor:R,onEditorSaved:q,deletingRole:d,confirmDeleteRole:$,executeDelete:P,toggleTeam:D,isSelected:M,isRoleOnlySelected:C,hasRoleSelection:T,isRoleDisabled:N,isDisabled:H,toggleRoleOnly:U,toggleAction:ie,toggleCustomRoleOnly:v=>{U(v)},toggleCustomAction:(v,_)=>{ie(v,_)},getSelectionLabelFull:v=>{if(dt[v.role])return qt(v);let X=s.customExpertRoles.find(ne=>ne.id===v.role);if(!X)return v.role;if(v.action){let ne=X.actions?.find(me=>me.id===v.action);return ne?`${X.name}\xB7${ne.name}`:X.name}return X.name},removeSelection:v=>{let _=[...A.value];_.splice(v,1),t("update:modelValue",_)},clearAll:()=>{t("update:modelValue",[])},getSelectionLabel:qt}}}});var wi,bo=O(()=>{en();wi={name:"SubAgentPanel",props:{visible:{type:Boolean,default:!1}},emits:["close"],template:`
|
|
4013
4013
|
<div class="subagent-panel" :class="{ open: visible, expanded: store.activeSubagentId }" role="complementary" aria-label="Sub-Agents">
|
|
4014
4014
|
<!-- Expanded Mode: Full message thread for a subagent -->
|
|
4015
4015
|
<template v-if="store.activeSubagentId && activeAgent">
|
|
@@ -4083,7 +4083,7 @@ ${String(e||"").trim()}
|
|
|
4083
4083
|
</div>
|
|
4084
4084
|
</template>
|
|
4085
4085
|
</div>
|
|
4086
|
-
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.ref(null),i=
|
|
4086
|
+
`,setup(e,{emit:t}){let s=Pinia.useChatStore(),n=Vue.ref(null),i=h=>{h.key==="Escape"&&e.visible&&(s.activeSubagentId?s.activeSubagentId=null:t("close"))};Vue.onMounted(()=>{document.addEventListener("keydown",i),Vue.nextTick(()=>Xe(n.value))}),Vue.onUnmounted(()=>document.removeEventListener("keydown",i));let r=Vue.computed(()=>s.currentSubagents),o=Vue.computed(()=>[...r.value].sort((h,A)=>h.status==="running"&&A.status!=="running"?-1:h.status!=="running"&&A.status==="running"?1:(A.startTime||0)-(h.startTime||0))),a=Vue.computed(()=>s.activeSubagentId&&r.value.find(h=>h.id===s.activeSubagentId)||null),l=Vue.computed(()=>s.activeSubagentMessages),c=h=>{s.activeSubagentId=h},d=()=>{s.activeSubagentId=null},u=h=>{if(!h.messages||h.messages.length===0)return null;for(let A=h.messages.length-1;A>=0;A--)if(h.messages[A].type==="text")return h.messages[A];return null},p=(h,A)=>{if(!h)return"";let x=h.replace(/[#*_`~\[\]()>|\\]/g,"").replace(/\n+/g," ").trim();return x.length>A?x.substring(0,A)+"...":x},f=h=>h?ti(h):"",g=Vue.computed(()=>l.value.map(h=>`${h.type||""}:${h.content||""}`).join("\0")),b=()=>{Vue.nextTick(()=>{let h=n.value;h&&(Xe(h),h.scrollTop=h.scrollHeight)})};return Vue.watch(()=>[s.activeSubagentId,l.value.length,g.value],b),{store:s,allSubagents:r,sortedSubagents:o,activeAgent:a,activeMessages:l,expandAgent:c,closeExpanded:d,getLastMessage:u,truncate:p,renderMd:f,messagesRef:n}}}});var Hu,Nu=O(()=>{Hu={name:"BtwOverlay",template:`
|
|
4087
4087
|
<div v-if="store.btwMode" class="btw-float" role="log" aria-live="polite" aria-label="Side question conversation">
|
|
4088
4088
|
<div class="btw-card">
|
|
4089
4089
|
<div class="btw-header">
|
|
@@ -4321,7 +4321,7 @@ ${String(e||"").trim()}
|
|
|
4321
4321
|
<p class="pane-empty-text">{{ $t('splitScreen.selectFromSidebar') }}</p>
|
|
4322
4322
|
</div>
|
|
4323
4323
|
</div>
|
|
4324
|
-
`,setup(e){let t=Pinia.useChatStore(),s=Vue.ref(null),n=Vue.computed(()=>t.activePanelId===e.paneId),i=Vue.computed(()=>t.panels.find(se=>se.id===e.paneId)?.conversationId||null),r=Vue.computed(()=>i.value?t.messagesMap[i.value]||[]:[]),o=Vue.computed(()=>i.value?!!t.processingConversations[i.value]:!1),a=Vue.computed(()=>r.value.some(F=>F.isStreaming)),l=Vue.computed(()=>o.value&&!a.value),c=Vue.ref(0),d=Vue.ref(Date.now()),u=null,p=Vue.ref("cat"),f=new URLSearchParams(window.location.search).get("preview"),g=Vue.ref(0),
|
|
4324
|
+
`,setup(e){let t=Pinia.useChatStore(),s=Vue.ref(null),n=Vue.computed(()=>t.activePanelId===e.paneId),i=Vue.computed(()=>t.panels.find(se=>se.id===e.paneId)?.conversationId||null),r=Vue.computed(()=>i.value?t.messagesMap[i.value]||[]:[]),o=Vue.computed(()=>i.value?!!t.processingConversations[i.value]:!1),a=Vue.computed(()=>r.value.some(F=>F.isStreaming)),l=Vue.computed(()=>o.value&&!a.value),c=Vue.ref(0),d=Vue.ref(Date.now()),u=null,p=Vue.ref("cat"),f=new URLSearchParams(window.location.search).get("preview"),g=Vue.ref(0),b=Vue.ref(1),h=Vue.ref(5),A=Vue.ref(95),x=Vue.ref("bark-both"),k=Vue.ref(1),y=Vue.ref(-1),m=null;function w(){if(!c.value)return;d.value=Date.now();let F=(d.value-c.value)%19e3;if(F<4e3)g.value=0,b.value=1;else if(F<11500){let se=F-4e3,oe;se<2500?oe=se/2500*16:se<5e3?oe=16+(se-2500)/2500*29:oe=45+(se-5e3)/2500*55,g.value=oe,b.value=1}else F<14e3?(g.value=(1-(F-11500)/2500)*100,b.value=-1):(g.value=0,b.value=1);u=requestAnimationFrame(w)}function E(){if(!c.value||p.value!=="dog")return;d.value=Date.now();let F=(d.value-c.value)%18e3;if(F<2e3)h.value=5,A.value=95,x.value="bark-both",k.value=1,y.value=-1;else if(F<5e3){let se=(F-2e3)/3e3;h.value=5+se*25,A.value=95,x.value="left-approach",k.value=1,y.value=-1}else if(F<8e3){let se=(F-5e3)/3e3;h.value=30,A.value=95-se*25,x.value="right-approach",k.value=1,y.value=-1}else if(F<1e4){let se=(F-8e3)/2e3;h.value=30+se*13,A.value=70-se*13,x.value="both-approach",k.value=1,y.value=-1}else if(F<11e3)h.value=43,A.value=57,x.value="snap",k.value=1,y.value=-1;else if(F<12500)h.value=43,A.value=57,x.value="stunned",k.value=1,y.value=-1;else if(F<15e3){let se=(F-12500)/2500;h.value=43-se*38,A.value=57+se*38,x.value="retreat",k.value=-1,y.value=1}else F<17e3?(h.value=5,A.value=95,x.value="rehang",k.value=-1,y.value=1):(h.value=5,A.value=95,x.value="reset",k.value=1,y.value=-1);m=requestAnimationFrame(E)}let R=Vue.computed(()=>{let F=h.value*1.2;return k.value<0?`translate(${F+13.5}, 0) scale(-1, 1)`:`translate(${F-13.5}, 0)`}),q=Vue.computed(()=>{let F=A.value*1.2;return y.value>0?`translate(${F-10.5}, 2)`:`translate(${F+10.5}, 2) scale(-1, 1)`}),$=Vue.computed(()=>{let F=x.value;return F==="bark-both"||F==="left-approach"||F==="right-approach"||F==="both-approach"||F==="reset"}),P=Vue.computed(()=>{let F=h.value*1.2,se=10;if($.value){let W=Math.max(0,(F-3)*.12);return`M3,18 Q${(3+F)/2},${18+W} ${F},${se}`}if(x.value==="rehang")return`M${F},${se} Q${F-3},20 3,18`;let oe=k.value<0?1:-1,we=F+oe*8;return`M${F},${se} Q${F},18 ${we},22`}),D=Vue.computed(()=>{let F=A.value*1.2,se=10;if($.value){let W=Math.max(0,(118-F)*.12);return`M118,18 Q${(118+F)/2},${18+W} ${F},${se}`}if(x.value==="rehang")return`M${F},${se} Q${F+3},20 118,18`;let oe=y.value>0?-1:1,we=F+oe*8;return`M${F},${se} Q${F},18 ${we},22`}),M=Vue.computed(()=>x.value==="snap"?.2:.4),C=Vue.computed(()=>x.value==="snap"?.2:.4),T=Vue.computed(()=>h.value*1.2),N=Vue.computed(()=>A.value*1.2),H=Vue.computed(()=>f==="cat"||f==="dog"||f==="animation"?!0:l.value);Vue.watch(l,F=>{F?(c.value=Date.now(),d.value=Date.now(),p.value="cat",g.value=0,b.value=1,h.value=5,A.value=95,x.value="bark-both",k.value=1,y.value=-1,p.value==="cat"?u=requestAnimationFrame(w):m=requestAnimationFrame(E)):(c.value=0,g.value=0,b.value=1,u&&(cancelAnimationFrame(u),u=null),m&&(cancelAnimationFrame(m),m=null))},{immediate:!0}),(f==="cat"||f==="dog"||f==="animation")&&(c.value=Date.now(),d.value=Date.now(),f==="dog"?p.value="dog":p.value="cat",p.value==="cat"?u=requestAnimationFrame(w):(h.value=5,A.value=95,x.value="bark-both",k.value=1,y.value=-1,m=requestAnimationFrame(E))),Vue.onUnmounted(()=>{u&&(cancelAnimationFrame(u),u=null),m&&(cancelAnimationFrame(m),m=null)});let U=Vue.computed(()=>{if(!o.value)return null;if(t.connectionState!=="connected")return"disconnected";let F=i.value;if(t.compactStatus?.conversationId===F&&t.compactStatus?.status==="compacting")return"compacting";let se=t.sessionHealth?.[F];return se?se.status:c.value&&d.value-c.value>8e3?"thinking":null}),ie=Vue.computed(()=>{if(!c.value)return"speed-napping";let F=(d.value-c.value)%19e3;return F>=16e3?"speed-petted":F>=14e3?"speed-tired":F>=11500?"speed-crazy":F>=9e3?"speed-turbo":F>=6500?"speed-fast":F>=4e3?"speed-normal":"speed-napping"}),Y=Vue.computed(()=>{let F=g.value,se=b.value,we={left:`calc(40px + (100% - 80px) * ${F/100})`};return se<0&&(we.transform="scaleX(-1)"),we});function G(){let F=i.value;if(!F)return;let se=t.conversations.find(oe=>oe.id===F);t.sendWsMessage({type:"refresh_conversation",conversationId:F,agentId:se?.agentId})}let ee=Vue.computed(()=>{let F=r.value,se=[],oe=null,we=0,W=()=>{oe&&((oe.textContent||oe.toolMsgs.length>0||oe.todoMsg||oe.askMsg)&&se.push(oe),oe=null)},J=()=>{we++,oe={type:"assistant-turn",id:"turn_"+we,textContent:"",isStreaming:!1,todoMsg:null,toolMsgs:[],askMsg:null,messages:[]}};for(let he=0;he<F.length;he++){let fe=F[he];if(fe.type==="user"){if(!fe.content||!fe.content.trim())continue;W(),se.push({type:"user",id:fe.id||"u_"+he,message:fe});continue}if(fe.type==="system"||fe.type==="error"){W(),se.push({type:fe.type,id:fe.id||"s_"+he,message:fe});continue}if(!(fe.type==="tool-result"||fe.type==="tool_result")){if(fe.type==="assistant"){oe||J(),fe.content&&(oe.textContent+=fe.content),fe.isStreaming&&(oe.isStreaming=!0),oe.messages.push(fe);continue}if(fe.type==="tool-use"){oe||J();let Re=F[he+1],Ve=Re&&(Re.type==="tool-result"||Re.type==="tool_result"),He={...fe,hasResult:Ve||fe.hasResult||!1,toolResult:fe.toolResult||null};fe.toolName==="TodoWrite"?oe.todoMsg=He:fe.toolName==="AskUserQuestion"?oe.askMsg=He:oe.toolMsgs.push(He),oe.messages.push(fe);continue}W(),se.push({type:fe.type||"unknown",id:fe.id||"x_"+he,message:fe})}}return W(),se}),re=(F,se)=>{if(!i.value)return;let oe=se||[];t.sendMessageToConversation(i.value,F,oe)},ge=()=>{i.value&&t.cancelExecutionForConversation(i.value)};function v(){t.setActivePanel(e.paneId)}function _(){t.removePanel(e.paneId)}let X=Vue.computed(()=>t.getPaneRightPanel(e.paneId));function ne(){t.setPaneRightPanel(e.paneId,null)}let me=Vue.ref(!0),Se=50,Ce=()=>{if(!s.value)return!0;let{scrollTop:F,scrollHeight:se,clientHeight:oe}=s.value;return se-F-oe<=Se},te=()=>{s.value&&(s.value.scrollTop=s.value.scrollHeight)},Q=()=>{me.value=Ce()};return Vue.watch(()=>r.value.length,()=>{me.value&&Vue.nextTick(te)}),Vue.watch(()=>{let F=r.value,se=F[F.length-1];return se?.isStreaming?se.content?.length:0},()=>{me.value&&Vue.nextTick(te)}),Vue.watch(i,()=>{s.value&&s.value.removeEventListener("scroll",Q),me.value=!0,Vue.nextTick(()=>{s.value&&(s.value.addEventListener("scroll",Q),te())})}),Vue.onMounted(()=>{s.value&&(s.value.addEventListener("scroll",Q),te())}),Vue.onUnmounted(()=>{s.value&&s.value.removeEventListener("scroll",Q)}),{store:t,containerRef:s,isActivePanel:n,conversationId:i,messages:r,isProcessing:o,showTypingDots:l,previewShowTypingDots:H,waitingStatus:U,animationType:p,catSpeed:ie,catStyle:Y,dogPhase:x,spikeTransform:R,teddyTransform:q,leashPathL:P,leashPathR:D,leashOpacityL:M,leashOpacityR:C,questionLX:T,questionRX:N,refreshSession:G,turnGroups:ee,sendFn:re,cancelFn:ge,setActive:v,closePane:_,paneRightPanel:X,closePanePanel:ne}}}});var As,qu,$m,Vm,Fm,Om,Wu,Uu=O(()=>{({ref:As,computed:qu,watch:$m,onMounted:Vm,onBeforeUnmount:Fm,nextTick:Om}=Vue),Wu={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"}},emits:["update:modelValue","change"],setup(e,{emit:t}){let s=As(!1),n=As(""),i=As(null),r=As(null),o=As(null),a=As(-1),l=qu(()=>e.options.find(b=>b.value===e.modelValue)||null),c=qu(()=>{if(!e.searchable||!n.value.trim())return e.options;let b=n.value.trim().toLowerCase();return e.options.filter(h=>String(h.label||"").toLowerCase().includes(b)||String(h.sublabel||"").toLowerCase().includes(b)||String(h.value||"").toLowerCase().includes(b))});function d(){e.disabled||(s.value=!s.value,s.value&&(n.value="",a.value=c.value.findIndex(b=>b.value===e.modelValue),Om(()=>{if(e.searchable&&o.value&&o.value.focus&&o.value.focus(),r.value){let b=r.value.querySelector(".modern-select-option.is-active");b&&b.scrollIntoView&&b.scrollIntoView({block:"nearest"})}})))}function u(){s.value=!1}function p(b){t("update:modelValue",b.value),t("change",b.value),u()}function f(b){if(!s.value){(b.key==="Enter"||b.key===" "||b.key==="ArrowDown")&&(b.preventDefault(),d());return}if(b.key==="Escape"){b.preventDefault(),u();return}if(b.key==="ArrowDown")b.preventDefault(),a.value=Math.min(c.value.length-1,a.value+1);else if(b.key==="ArrowUp")b.preventDefault(),a.value=Math.max(0,a.value-1);else if(b.key==="Enter"){b.preventDefault();let h=c.value[a.value];h&&p(h)}}function g(b){s.value&&(i.value&&i.value.contains(b.target)||r.value&&r.value.contains(b.target)||u())}return Vm(()=>document.addEventListener("mousedown",g)),Fm(()=>document.removeEventListener("mousedown",g)),$m(()=>e.modelValue,()=>{}),{open:s,search:n,triggerEl:i,menuEl:r,searchEl:o,activeIdx:a,selected:l,filtered:c,toggle:d,close:u,pick:p,onKey:f}},template:`
|
|
4325
4325
|
<div class="modern-select" :class="{ 'is-open': open, 'is-disabled': disabled }">
|
|
4326
4326
|
<button
|
|
4327
4327
|
type="button"
|
|
@@ -4624,7 +4624,7 @@ ${String(e||"").trim()}
|
|
|
4624
4624
|
</footer>
|
|
4625
4625
|
</section>
|
|
4626
4626
|
<section v-else class="work-center-action-detail-pane work-center-detail-empty"><strong>{{ tr('workCenter.selectAction', 'Select an Action to inspect its execution') }}</strong></section>
|
|
4627
|
-
`}});function To(e){return JSON.parse(JSON.stringify(e))}function Om(e,t=[]){return{mode:"auto",capability:e,candidateVpIds:[],fixedVpId:null,separateFromStageTypes:t}}function Ai(e,t,s,n={}){return{id:e,name:t,type:s,instruction:"",assignmentPolicy:Om(s,n.separateFromStageTypes),modelPolicy:{mode:"inherit",model:null,effort:null},maxAttempts:2,...n.changesRequestedStageId?{changesRequestedStageId:n.changesRequestedStageId}:{}}}function xo(){return{version:1,revision:1,defaultWorkflowId:"software-change",startImmediately:!0,maxConcurrentActions:3,defaultWorkDir:"",globalInstructions:"",modelPolicy:{mode:"inherit",model:null,effort:null},actionModelPolicies:Object.fromEntries(Xt.map(e=>[e,{mode:"inherit",model:null,effort:["triage","research","design","diagnose","review"].includes(e)?"high":"medium"}])),actionInstructions:Object.fromEntries(Xt.map(e=>[e,""])),workflows:[{version:1,id:"software-change",name:"Software change",stages:[Ai("triage","Triage","triage"),Ai("implement","Implement","implement"),Ai("review","Review","review",{separateFromStageTypes:["implement"],changesRequestedStageId:"implement"}),Ai("deliver","Deliver","deliver")]}]}}function Ti(e){return!e||typeof e!="object"||Array.isArray(e)||!e.modelPolicy||typeof e.modelPolicy!="object"||Array.isArray(e.modelPolicy)||typeof e.globalInstructions!="string"||!e.actionInstructions||typeof e.actionInstructions!="object"||Array.isArray(e.actionInstructions)||!e.actionModelPolicies||typeof e.actionModelPolicies!="object"||Array.isArray(e.actionModelPolicies)?!1:Xt.every(t=>typeof e.actionInstructions[t]=="string")}function Hm(e,t){return Ti(e)&&Number.isInteger(e.revision)&&Number.isInteger(t)&&e.revision>t}function xi(e,t={}){let s=e&&typeof e=="object"&&!Array.isArray(e)?To(e):{},n=Array.isArray(s.workflows)&&s.workflows.length>0?s.workflows:xo().workflows,i=n.find(c=>c?.id===s.defaultWorkflowId)||n[0]||null,r=Array.isArray(i?.stages)?i.stages:[],o=Object.fromEntries(r.filter(c=>Xt.includes(c?.type)&&typeof c.instruction=="string").map(c=>[c.type,c.instruction])),a=s.actionInstructions&&typeof s.actionInstructions=="object"&&!Array.isArray(s.actionInstructions)?s.actionInstructions:{},l=r.find(c=>c?.type==="triage")?.modelPolicy||r[0]?.modelPolicy;return{...xo(),...s,modelPolicy:{mode:"inherit",model:null,effort:null,...l||{},...s.modelPolicy||{}},actionModelPolicies:Object.fromEntries(Xt.map(c=>[c,{...xo().actionModelPolicies[c],...s.actionModelPolicies?.[c]||{}}])),actionInstructions:Object.fromEntries(Xt.map(c=>[c,typeof a[c]=="string"?a[c]:o[c]||t[c]||""])),workflows:n}}function Nm(e){let t=e?.message||String(e);return/^Unsupported Work Center operation:\s*get_settings$/i.test(t.trim())}var Xt,Gu,Yu=O(()=>{Yt();Xt=["triage","research","design","diagnose","implement","migrate","test","review","integrate","document","operate","deliver","write","custom"];Gu={name:"WorkCenterSettingsModal",emits:["close","saved","open-agent-models"],props:{agentId:{type:String,required:!0}},data(){return{section:"workflow",draft:null,loading:!0,saving:!1,error:"",conflict:!1,settingsUnsupported:!1,draftAgentId:null,loadGeneration:0}},computed:{store(){return Pinia.useChatStore()},runtime(){return this.store.workCenterRuntimeByAgent[this.agentId]||{}},vps(){return Array.isArray(this.runtime.vps)?this.runtime.vps:[]},models(){return Array.isArray(this.runtime.models)?this.runtime.models:[]},workflows(){return Array.isArray(this.draft?.workflows)?this.draft.workflows:[]},actionTypes(){return Xt},defaultWorkflow(){return this.workflows.find(e=>e.id===this.draft?.defaultWorkflowId)||this.workflows[0]||null},defaultStageInstructions(){return this.runtime.defaultStageInstructions||{}},sections(){return[{id:"workflow",label:this.$t("workCenter.settings.workflow")},{id:"models",label:this.$t("workCenter.settings.models")}]}},watch:{runtime:{deep:!0,handler(){this.normalizeDraftEffort()}}},async mounted(){window.addEventListener("keydown",this.onKeydown);let e=this.store.workCenterSettingsByAgent[this.agentId];e&&(this.draft=xi(e,this.defaultStageInstructions),this.normalizeDraftEffort(),this.draftAgentId=this.agentId,this.settingsUnsupported=!Ti(e),this.settingsUnsupported&&(this.error=this.$t("workCenter.settings.upgradeRequired")),this.loading=!1),await this.load()},beforeUnmount(){window.removeEventListener("keydown",this.onKeydown)},methods:{trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,async load(){let e=this.agentId,t=++this.loadGeneration;this.loading=!0,this.error=this.settingsUnsupported&&this.draft?this.$t("workCenter.settings.upgradeRequired"):"";try{let s=await this.store.loadWorkCenterSettings(e);if(t!==this.loadGeneration||e!==this.agentId)return;this.draft=xi(s.settings,this.defaultStageInstructions),this.normalizeDraftEffort(),this.draftAgentId=e,this.conflict=!1,this.settingsUnsupported=!Ti(s.settings),this.error=this.settingsUnsupported?this.$t("workCenter.settings.upgradeRequired"):""}catch(s){if(t!==this.loadGeneration||e!==this.agentId)return;Nm(s)?(this.draft=xi(null,this.defaultStageInstructions),this.draftAgentId=e,this.settingsUnsupported=!0,this.error=this.$t("workCenter.settings.upgradeRequired")):this.error=s?.message||String(s)}finally{t===this.loadGeneration&&e===this.agentId&&(this.loading=!1)}},onKeydown(e){e.key==="Escape"&&!this.saving&&this.$emit("close")},onOverlayClick(e){Ze(e)&&this.close()},close(){this.saving||this.$emit("close")},vpLabel(e){return this.$i18n?.locale==="zh-CN"&&e.nameZh?e.nameZh:e.name||e.id},setAssignmentMode(e,t){e.assignmentPolicy.mode=t,t==="fixed"&&!e.assignmentPolicy.fixedVpId&&(e.assignmentPolicy.fixedVpId=this.vps[0]?.id||null),t==="pool"&&e.assignmentPolicy.candidateVpIds.length===0&&this.vps[0]&&(e.assignmentPolicy.candidateVpIds=[this.vps[0].id])},addWorkflow(){let e=this.workflows.length+1,t=this.defaultWorkflow||this.workflows[0],s=t?To(t):{version:1,stages:[]};s.id=`workflow-${Date.now()}`,s.name=this.$t("workCenter.settings.newWorkflow",{index:e}),this.draft.workflows.push(s),this.draft.defaultWorkflowId=s.id},removeWorkflow(){this.workflows.length<=1||!this.defaultWorkflow||(this.draft.workflows=this.workflows.filter(e=>e.id!==this.defaultWorkflow.id),this.draft.defaultWorkflowId=this.draft.workflows[0].id)},addStage(){if(!this.defaultWorkflow)return;let e=`stage-${Date.now()}`;this.defaultWorkflow.stages.push({id:e,name:this.$t("workCenter.settings.newStage"),type:"custom",instruction:this.defaultStageInstructions.custom||"",assignmentPolicy:{mode:"auto",capability:"custom",candidateVpIds:[],fixedVpId:null,separateFromStageTypes:[]},modelPolicy:{mode:"inherit",model:null,effort:null},maxAttempts:2})},moveStage(e,t){let s=this.defaultWorkflow?.stages,n=e+t;if(!s||n<0||n>=s.length)return;let[i]=s.splice(e,1);s.splice(n,0,i)},reviewReturnCandidates(e){let t=this.defaultWorkflow?.stages||[],s=t.findIndex(n=>n.id===e.id);return s<=0?[]:t.slice(0,s).filter(n=>n.type!=="review"&&n.type!=="deliver")},canRemoveStage(e){let t=this.defaultWorkflow?.stages;if(!t||t.length<=1)return!1;let s=t[e],n=t.filter((i,r)=>r!==e);return n.every((i,r)=>i.type!=="review"||i.changesRequestedStageId!==s.id?!0:n.slice(0,r).some(o=>o.type!=="review"&&o.type!=="deliver"))},removeStage(e){let t=this.defaultWorkflow?.stages;if(!t||!this.canRemoveStage(e))return!1;let[s]=t.splice(e,1);for(let[n,i]of t.entries()){if(i.type!=="review"||i.changesRequestedStageId!==s.id)continue;let r=t.slice(0,n).filter(o=>o.type!=="review"&&o.type!=="deliver");i.changesRequestedStageId=r.at(-1).id}return!0},toggleCandidate(e,t,s){let n=new Set(e.assignmentPolicy.candidateVpIds||[]);s?n.add(t):n.delete(t),e.assignmentPolicy.candidateVpIds=[...n]},defaultInstructionForStage(e){return this.defaultStageInstructions[e.type]||this.defaultStageInstructions.custom||""},resetStageInstruction(e){e.instruction=this.defaultInstructionForStage(e)},setStageType(e,t){let s=this.defaultInstructionForStage(e),n=!e.instruction||e.instruction===s;e.type=t,n&&this.resetStageInstruction(e)},modelRefForStage(e){return e.modelPolicy.mode==="specific"?e.modelPolicy.model:e.modelPolicy.mode==="primary"?this.runtime.primaryModel||null:e.modelPolicy.mode==="fast"&&this.runtime.fastModel||null},modelForStage(e){let t=this.modelRefForStage(e);return t&&this.models.find(s=>(s.ref||s.id)===t)||null},effortOptionsForStage(e){let t=this.modelForStage(e);return t?Array.isArray(t.effortOptions)?t.effortOptions:[]:e.modelPolicy.mode==="inherit"?[...new Set(this.models.flatMap(s=>Array.isArray(s.effortOptions)?s.effortOptions:[]))]:[]},effortHelpKeyForStage(e){return this.modelRefForStage(e)?this.effortOptionsForStage(e).length===0?"workCenter.settings.effortUnsupportedHelp":"workCenter.settings.effortHelp":"workCenter.settings.effortChooseModelHelp"},normalizeStageEffort(e){let t=this.effortOptionsForStage(e);!e.modelPolicy.effort||t.includes(e.modelPolicy.effort)||(e.modelPolicy.effort=null)},normalizeDraftEffort(){if(!(!this.draft?.modelPolicy||!Array.isArray(this.runtime?.models))){this.normalizeStageEffort({modelPolicy:this.draft.modelPolicy});for(let e of Object.values(this.draft.actionModelPolicies||{}))this.normalizeStageEffort({modelPolicy:e})}},setModelMode(e,t){e.modelPolicy.mode=t,t==="specific"&&!e.modelPolicy.model&&(e.modelPolicy.model=this.models[0]?.ref||this.models[0]?.id||null),this.normalizeStageEffort(e)},setStageModel(e,t){e.modelPolicy.model=t||null,this.normalizeStageEffort(e)},async save(){if(!this.draft||this.saving||this.settingsUnsupported)return;let e=this.agentId;if(this.draftAgentId!==e){this.conflict=!0,this.error=this.$t("workCenter.settings.conflict");return}this.saving=!0,this.error="",this.conflict=!1;try{this.normalizeDraftEffort();let t=To(this.draft),s=await this.store.saveWorkCenterSettings(t,e);if(e!==this.agentId||this.draftAgentId!==e)return;if(!Hm(s.settings,t.revision)){this.settingsUnsupported=!Ti(s.settings),this.error=this.$t(this.settingsUnsupported?"workCenter.settings.upgradeRequired":"workCenter.settings.saveNotConfirmed");return}this.draft=xi(s.settings,this.defaultStageInstructions),this.$emit("saved",s.settings),this.$emit("close")}catch(t){if(e!==this.agentId)return;let s=t?.message||String(t);this.conflict=/changed elsewhere|reload before saving/i.test(s),this.error=this.conflict?this.$t("workCenter.settings.conflict"):s}finally{e===this.agentId&&(this.saving=!1)}}},template:`
|
|
4627
|
+
`}});function To(e){return JSON.parse(JSON.stringify(e))}function Hm(e,t=[]){return{mode:"auto",capability:e,candidateVpIds:[],fixedVpId:null,separateFromStageTypes:t}}function Ai(e,t,s,n={}){return{id:e,name:t,type:s,instruction:"",assignmentPolicy:Hm(s,n.separateFromStageTypes),modelPolicy:{mode:"inherit",model:null,effort:null},maxAttempts:2,...n.changesRequestedStageId?{changesRequestedStageId:n.changesRequestedStageId}:{}}}function xo(){return{version:1,revision:1,defaultWorkflowId:"software-change",startImmediately:!0,maxConcurrentActions:3,defaultWorkDir:"",globalInstructions:"",modelPolicy:{mode:"inherit",model:null,effort:null},actionModelPolicies:Object.fromEntries(Xt.map(e=>[e,{mode:"inherit",model:null,effort:["triage","research","design","diagnose","review"].includes(e)?"high":"medium"}])),actionInstructions:Object.fromEntries(Xt.map(e=>[e,""])),workflows:[{version:1,id:"software-change",name:"Software change",stages:[Ai("triage","Triage","triage"),Ai("implement","Implement","implement"),Ai("review","Review","review",{separateFromStageTypes:["implement"],changesRequestedStageId:"implement"}),Ai("deliver","Deliver","deliver")]}]}}function Ti(e){return!e||typeof e!="object"||Array.isArray(e)||!e.modelPolicy||typeof e.modelPolicy!="object"||Array.isArray(e.modelPolicy)||typeof e.globalInstructions!="string"||!e.actionInstructions||typeof e.actionInstructions!="object"||Array.isArray(e.actionInstructions)||!e.actionModelPolicies||typeof e.actionModelPolicies!="object"||Array.isArray(e.actionModelPolicies)?!1:Xt.every(t=>typeof e.actionInstructions[t]=="string")}function Nm(e,t){return Ti(e)&&Number.isInteger(e.revision)&&Number.isInteger(t)&&e.revision>t}function xi(e,t={}){let s=e&&typeof e=="object"&&!Array.isArray(e)?To(e):{},n=Array.isArray(s.workflows)&&s.workflows.length>0?s.workflows:xo().workflows,i=n.find(c=>c?.id===s.defaultWorkflowId)||n[0]||null,r=Array.isArray(i?.stages)?i.stages:[],o=Object.fromEntries(r.filter(c=>Xt.includes(c?.type)&&typeof c.instruction=="string").map(c=>[c.type,c.instruction])),a=s.actionInstructions&&typeof s.actionInstructions=="object"&&!Array.isArray(s.actionInstructions)?s.actionInstructions:{},l=r.find(c=>c?.type==="triage")?.modelPolicy||r[0]?.modelPolicy;return{...xo(),...s,modelPolicy:{mode:"inherit",model:null,effort:null,...l||{},...s.modelPolicy||{}},actionModelPolicies:Object.fromEntries(Xt.map(c=>[c,{...xo().actionModelPolicies[c],...s.actionModelPolicies?.[c]||{}}])),actionInstructions:Object.fromEntries(Xt.map(c=>[c,typeof a[c]=="string"?a[c]:o[c]||t[c]||""])),workflows:n}}function Bm(e){let t=e?.message||String(e);return/^Unsupported Work Center operation:\s*get_settings$/i.test(t.trim())}var Xt,Gu,Yu=O(()=>{Yt();Xt=["triage","research","design","diagnose","implement","migrate","test","review","integrate","document","operate","deliver","write","custom"];Gu={name:"WorkCenterSettingsModal",emits:["close","saved","open-agent-models"],props:{agentId:{type:String,required:!0}},data(){return{section:"workflow",draft:null,loading:!0,saving:!1,error:"",conflict:!1,settingsUnsupported:!1,draftAgentId:null,loadGeneration:0}},computed:{store(){return Pinia.useChatStore()},runtime(){return this.store.workCenterRuntimeByAgent[this.agentId]||{}},vps(){return Array.isArray(this.runtime.vps)?this.runtime.vps:[]},models(){return Array.isArray(this.runtime.models)?this.runtime.models:[]},workflows(){return Array.isArray(this.draft?.workflows)?this.draft.workflows:[]},actionTypes(){return Xt},defaultWorkflow(){return this.workflows.find(e=>e.id===this.draft?.defaultWorkflowId)||this.workflows[0]||null},defaultStageInstructions(){return this.runtime.defaultStageInstructions||{}},sections(){return[{id:"workflow",label:this.$t("workCenter.settings.workflow")},{id:"models",label:this.$t("workCenter.settings.models")}]}},watch:{runtime:{deep:!0,handler(){this.normalizeDraftEffort()}}},async mounted(){window.addEventListener("keydown",this.onKeydown);let e=this.store.workCenterSettingsByAgent[this.agentId];e&&(this.draft=xi(e,this.defaultStageInstructions),this.normalizeDraftEffort(),this.draftAgentId=this.agentId,this.settingsUnsupported=!Ti(e),this.settingsUnsupported&&(this.error=this.$t("workCenter.settings.upgradeRequired")),this.loading=!1),await this.load()},beforeUnmount(){window.removeEventListener("keydown",this.onKeydown)},methods:{trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,async load(){let e=this.agentId,t=++this.loadGeneration;this.loading=!0,this.error=this.settingsUnsupported&&this.draft?this.$t("workCenter.settings.upgradeRequired"):"";try{let s=await this.store.loadWorkCenterSettings(e);if(t!==this.loadGeneration||e!==this.agentId)return;this.draft=xi(s.settings,this.defaultStageInstructions),this.normalizeDraftEffort(),this.draftAgentId=e,this.conflict=!1,this.settingsUnsupported=!Ti(s.settings),this.error=this.settingsUnsupported?this.$t("workCenter.settings.upgradeRequired"):""}catch(s){if(t!==this.loadGeneration||e!==this.agentId)return;Bm(s)?(this.draft=xi(null,this.defaultStageInstructions),this.draftAgentId=e,this.settingsUnsupported=!0,this.error=this.$t("workCenter.settings.upgradeRequired")):this.error=s?.message||String(s)}finally{t===this.loadGeneration&&e===this.agentId&&(this.loading=!1)}},onKeydown(e){e.key==="Escape"&&!this.saving&&this.$emit("close")},onOverlayClick(e){Ze(e)&&this.close()},close(){this.saving||this.$emit("close")},vpLabel(e){return this.$i18n?.locale==="zh-CN"&&e.nameZh?e.nameZh:e.name||e.id},setAssignmentMode(e,t){e.assignmentPolicy.mode=t,t==="fixed"&&!e.assignmentPolicy.fixedVpId&&(e.assignmentPolicy.fixedVpId=this.vps[0]?.id||null),t==="pool"&&e.assignmentPolicy.candidateVpIds.length===0&&this.vps[0]&&(e.assignmentPolicy.candidateVpIds=[this.vps[0].id])},addWorkflow(){let e=this.workflows.length+1,t=this.defaultWorkflow||this.workflows[0],s=t?To(t):{version:1,stages:[]};s.id=`workflow-${Date.now()}`,s.name=this.$t("workCenter.settings.newWorkflow",{index:e}),this.draft.workflows.push(s),this.draft.defaultWorkflowId=s.id},removeWorkflow(){this.workflows.length<=1||!this.defaultWorkflow||(this.draft.workflows=this.workflows.filter(e=>e.id!==this.defaultWorkflow.id),this.draft.defaultWorkflowId=this.draft.workflows[0].id)},addStage(){if(!this.defaultWorkflow)return;let e=`stage-${Date.now()}`;this.defaultWorkflow.stages.push({id:e,name:this.$t("workCenter.settings.newStage"),type:"custom",instruction:this.defaultStageInstructions.custom||"",assignmentPolicy:{mode:"auto",capability:"custom",candidateVpIds:[],fixedVpId:null,separateFromStageTypes:[]},modelPolicy:{mode:"inherit",model:null,effort:null},maxAttempts:2})},moveStage(e,t){let s=this.defaultWorkflow?.stages,n=e+t;if(!s||n<0||n>=s.length)return;let[i]=s.splice(e,1);s.splice(n,0,i)},reviewReturnCandidates(e){let t=this.defaultWorkflow?.stages||[],s=t.findIndex(n=>n.id===e.id);return s<=0?[]:t.slice(0,s).filter(n=>n.type!=="review"&&n.type!=="deliver")},canRemoveStage(e){let t=this.defaultWorkflow?.stages;if(!t||t.length<=1)return!1;let s=t[e],n=t.filter((i,r)=>r!==e);return n.every((i,r)=>i.type!=="review"||i.changesRequestedStageId!==s.id?!0:n.slice(0,r).some(o=>o.type!=="review"&&o.type!=="deliver"))},removeStage(e){let t=this.defaultWorkflow?.stages;if(!t||!this.canRemoveStage(e))return!1;let[s]=t.splice(e,1);for(let[n,i]of t.entries()){if(i.type!=="review"||i.changesRequestedStageId!==s.id)continue;let r=t.slice(0,n).filter(o=>o.type!=="review"&&o.type!=="deliver");i.changesRequestedStageId=r.at(-1).id}return!0},toggleCandidate(e,t,s){let n=new Set(e.assignmentPolicy.candidateVpIds||[]);s?n.add(t):n.delete(t),e.assignmentPolicy.candidateVpIds=[...n]},defaultInstructionForStage(e){return this.defaultStageInstructions[e.type]||this.defaultStageInstructions.custom||""},resetStageInstruction(e){e.instruction=this.defaultInstructionForStage(e)},setStageType(e,t){let s=this.defaultInstructionForStage(e),n=!e.instruction||e.instruction===s;e.type=t,n&&this.resetStageInstruction(e)},modelRefForStage(e){return e.modelPolicy.mode==="specific"?e.modelPolicy.model:e.modelPolicy.mode==="primary"?this.runtime.primaryModel||null:e.modelPolicy.mode==="fast"&&this.runtime.fastModel||null},modelForStage(e){let t=this.modelRefForStage(e);return t&&this.models.find(s=>(s.ref||s.id)===t)||null},effortOptionsForStage(e){let t=this.modelForStage(e);return t?Array.isArray(t.effortOptions)?t.effortOptions:[]:e.modelPolicy.mode==="inherit"?[...new Set(this.models.flatMap(s=>Array.isArray(s.effortOptions)?s.effortOptions:[]))]:[]},effortHelpKeyForStage(e){return this.modelRefForStage(e)?this.effortOptionsForStage(e).length===0?"workCenter.settings.effortUnsupportedHelp":"workCenter.settings.effortHelp":"workCenter.settings.effortChooseModelHelp"},normalizeStageEffort(e){let t=this.effortOptionsForStage(e);!e.modelPolicy.effort||t.includes(e.modelPolicy.effort)||(e.modelPolicy.effort=null)},normalizeDraftEffort(){if(!(!this.draft?.modelPolicy||!Array.isArray(this.runtime?.models))){this.normalizeStageEffort({modelPolicy:this.draft.modelPolicy});for(let e of Object.values(this.draft.actionModelPolicies||{}))this.normalizeStageEffort({modelPolicy:e})}},setModelMode(e,t){e.modelPolicy.mode=t,t==="specific"&&!e.modelPolicy.model&&(e.modelPolicy.model=this.models[0]?.ref||this.models[0]?.id||null),this.normalizeStageEffort(e)},setStageModel(e,t){e.modelPolicy.model=t||null,this.normalizeStageEffort(e)},async save(){if(!this.draft||this.saving||this.settingsUnsupported)return;let e=this.agentId;if(this.draftAgentId!==e){this.conflict=!0,this.error=this.$t("workCenter.settings.conflict");return}this.saving=!0,this.error="",this.conflict=!1;try{this.normalizeDraftEffort();let t=To(this.draft),s=await this.store.saveWorkCenterSettings(t,e);if(e!==this.agentId||this.draftAgentId!==e)return;if(!Nm(s.settings,t.revision)){this.settingsUnsupported=!Ti(s.settings),this.error=this.$t(this.settingsUnsupported?"workCenter.settings.upgradeRequired":"workCenter.settings.saveNotConfirmed");return}this.draft=xi(s.settings,this.defaultStageInstructions),this.$emit("saved",s.settings),this.$emit("close")}catch(t){if(e!==this.agentId)return;let s=t?.message||String(t);this.conflict=/changed elsewhere|reload before saving/i.test(s),this.error=this.conflict?this.$t("workCenter.settings.conflict"):s}finally{e===this.agentId&&(this.saving=!1)}}},template:`
|
|
4628
4628
|
<Teleport to="body">
|
|
4629
4629
|
<div
|
|
4630
4630
|
class="modal-overlay work-center-settings-overlay"
|
|
@@ -4755,7 +4755,7 @@ ${String(e||"").trim()}
|
|
|
4755
4755
|
</section>
|
|
4756
4756
|
</div>
|
|
4757
4757
|
</Teleport>
|
|
4758
|
-
`}});var Mo,Qu=O(()=>{Mo={anthropic:["claude-opus-4-8","claude-opus-4.8","claude-sonnet-4-20250514","claude-opus-4-20250514","claude-haiku-3-20250414"],openai:["gpt-5","gpt-4.1","gpt-4.1-mini","o3","o4-mini"],"openai-responses":["gpt-5","gpt-5-mini","gpt-5-nano","gpt-5-pro"]}});function
|
|
4758
|
+
`}});var Mo,Qu=O(()=>{Mo={anthropic:["claude-opus-4-8","claude-opus-4.8","claude-sonnet-4-20250514","claude-opus-4-20250514","claude-haiku-3-20250414"],openai:["gpt-5","gpt-4.1","gpt-4.1-mini","o3","o4-mini"],"openai-responses":["gpt-5","gpt-5-mini","gpt-5-nano","gpt-5-pro"]}});function qm(e){if(typeof e!="string"||!e)return null;let t=e.toLowerCase();return t.startsWith("claude")||t.includes("/claude")||t.includes(".claude")?"anthropic":/^(gpt-|o1|o3|o4|chatgpt-|codex-|omni-)/.test(t)?"openai-responses":null}var Xu,Zu=O(()=>{Yt();Xu={name:"ProviderPresetPicker",emits:["close","pick"],template:`
|
|
4759
4759
|
<div
|
|
4760
4760
|
class="llm-preset-modal-backdrop"
|
|
4761
4761
|
@pointerdown="trackOverlayPointerDown"
|
|
@@ -4835,7 +4835,7 @@ ${String(e||"").trim()}
|
|
|
4835
4835
|
</div>
|
|
4836
4836
|
</div>
|
|
4837
4837
|
</div>
|
|
4838
|
-
`,data(){return{loading:!1,error:null,registry:{},fetchedAt:0,providerFilter:"",modelFilter:"",selectedProviderId:null,selectedModels:new Set}},computed:{chatStore(){return Pinia.useChatStore()},providerIds(){return Object.keys(this.registry).sort()},filteredProviderIds(){let e=this.providerFilter.trim().toLowerCase();return e?this.providerIds.filter(t=>t.toLowerCase().includes(e)||(this.providerName(t)||"").toLowerCase().includes(e)):this.providerIds},selectedProviderModels(){let e=this.registry[this.selectedProviderId];return!e||typeof e.models!="object"?[]:Object.keys(e.models).sort()},filteredModelIds(){let e=this.modelFilter.trim().toLowerCase(),t=this.selectedProviderModels;return e?t.filter(s=>s.toLowerCase().includes(e)):t},fetchedAtLabel(){if(!this.fetchedAt)return null;let e=Math.max(0,Math.floor((Date.now()-this.fetchedAt)/6e4));return this.$t("settings.llm.preset.fetchedAt",{minutes:e})}},async mounted(){await this.load(!1)},methods:{trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,onOverlayClick(e){Ze(e)&&this.$emit("close")},async load(e){this.loading=!0,this.error=null;try{let t=await this.chatStore.loadModelsDevRegistry({forceRefresh:e});this.registry=t?.registry||{},this.fetchedAt=t?.fetchedAt||0,t?.error&&(this.error=t.error)}catch(t){this.error=t?.message||String(t)}finally{this.loading=!1}},refresh(){this.load(!0)},providerName(e){return this.registry[e]?.name||e},providerModelCount(e){let t=this.registry[e]?.models;return t&&typeof t=="object"?Object.keys(t).length:0},selectProvider(e){this.selectedProviderId!==e&&(this.selectedProviderId=e,this.selectedModels=new Set,this.modelFilter="")},toggleModel(e){let t=new Set(this.selectedModels);t.has(e)?t.delete(e):t.add(e),this.selectedModels=t},selectAll(){this.selectedModels=new Set(this.filteredModelIds)},selectNone(){this.selectedModels=new Set},confirm(){if(!this.selectedProviderId||this.selectedModels.size===0)return;let e=this.registry[this.selectedProviderId]||{},t=Array.from(this.selectedModels).map(s=>{let n=
|
|
4838
|
+
`,data(){return{loading:!1,error:null,registry:{},fetchedAt:0,providerFilter:"",modelFilter:"",selectedProviderId:null,selectedModels:new Set}},computed:{chatStore(){return Pinia.useChatStore()},providerIds(){return Object.keys(this.registry).sort()},filteredProviderIds(){let e=this.providerFilter.trim().toLowerCase();return e?this.providerIds.filter(t=>t.toLowerCase().includes(e)||(this.providerName(t)||"").toLowerCase().includes(e)):this.providerIds},selectedProviderModels(){let e=this.registry[this.selectedProviderId];return!e||typeof e.models!="object"?[]:Object.keys(e.models).sort()},filteredModelIds(){let e=this.modelFilter.trim().toLowerCase(),t=this.selectedProviderModels;return e?t.filter(s=>s.toLowerCase().includes(e)):t},fetchedAtLabel(){if(!this.fetchedAt)return null;let e=Math.max(0,Math.floor((Date.now()-this.fetchedAt)/6e4));return this.$t("settings.llm.preset.fetchedAt",{minutes:e})}},async mounted(){await this.load(!1)},methods:{trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,onOverlayClick(e){Ze(e)&&this.$emit("close")},async load(e){this.loading=!0,this.error=null;try{let t=await this.chatStore.loadModelsDevRegistry({forceRefresh:e});this.registry=t?.registry||{},this.fetchedAt=t?.fetchedAt||0,t?.error&&(this.error=t.error)}catch(t){this.error=t?.message||String(t)}finally{this.loading=!1}},refresh(){this.load(!0)},providerName(e){return this.registry[e]?.name||e},providerModelCount(e){let t=this.registry[e]?.models;return t&&typeof t=="object"?Object.keys(t).length:0},selectProvider(e){this.selectedProviderId!==e&&(this.selectedProviderId=e,this.selectedModels=new Set,this.modelFilter="")},toggleModel(e){let t=new Set(this.selectedModels);t.has(e)?t.delete(e):t.add(e),this.selectedModels=t},selectAll(){this.selectedModels=new Set(this.filteredModelIds)},selectNone(){this.selectedModels=new Set},confirm(){if(!this.selectedProviderId||this.selectedModels.size===0)return;let e=this.registry[this.selectedProviderId]||{},t=Array.from(this.selectedModels).map(s=>{let n=qm(s);return n?{id:s,protocol:n}:s});this.$emit("pick",{name:this.selectedProviderId,baseUrl:e.api||"",protocol:"",models:t})}}}});var Mi,Po=O(()=>{Qu();Zu();Mi={name:"LlmTab",components:{ProviderPresetPicker:Xu},props:{context:{type:String,default:"chat"}},emits:["message","saved"],template:`
|
|
4839
4839
|
<div class="llm-tab">
|
|
4840
4840
|
<!-- No agent selected -->
|
|
4841
4841
|
<div v-if="!effectiveAgentId" class="sp-desc">
|
|
@@ -5038,7 +5038,7 @@ ${String(e||"").trim()}
|
|
|
5038
5038
|
</div>
|
|
5039
5039
|
</div>
|
|
5040
5040
|
</div>
|
|
5041
|
-
`,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(){return{loading:!1,loadError:null,localProviders:[],providerModelsText:[],localPrimaryModel:null,localFastModel:null,isDirty:!1,saving:!1,openDropdown:null,showApiKey:{},showPresetPicker:!1,discoveringModels:!1,modelDiscoveryWarning:null,modelDiscoveryError:null,saveRefreshWarning:null}},computed:{chatStore(){return Pinia.useChatStore()},effectiveAgentId(){return this.chatStore.currentAgent},agentOnline(){let e=this.effectiveAgentId;if(!e)return!1;if(this.context==="yeaft")return!0;let t=this.chatStore.agents.find(s=>s.id===e);return t?t.online:!1},currentConfig(){let e=this.effectiveAgentId;return e&&this.chatStore.llmConfig[e]||null},editableProviders(){return this.localProviders},allModelRefs(){let e=this.localProviders,t=[];for(let s of e){if(!s.name)continue;let n=this.parseModelsFromProvider(s);for(let i of n)t.push(`${s.name}/${i}`)}return t}},watch:{effectiveAgentId:{handler(e,t){e!==t&&(this.cancelPendingDiscovery(),this.cancelPendingSave(),this._loadTimeout&&(clearTimeout(this._loadTimeout),this._loadTimeout=null),this.loading=!1,this.loadError=null,this.localProviders=[],this.providerModelsText=[],this.localPrimaryModel=null,this.localFastModel=null,this.isDirty=!1,this.modelDiscoveryWarning=null,this.modelDiscoveryError=null,this.saveRefreshWarning=null),e&&this.requestConfig()},immediate:!0},agentOnline(e){e&&!this.currentConfig&&this.effectiveAgentId&&this.requestConfig()},currentConfig:{handler(e){e&&e.loaded&&this.loadFromConfig(e)},deep:!0}},methods:{async copyText(e){try{await navigator.clipboard.writeText(e),this.$emit("message",this.$t("settings.msg.copiedClipboard"),!1)}catch{this.$emit("message",this.$t("settings.msg.copyFailed"),!0)}},async useGitHubCopilotPreset(){let e=this.effectiveAgentId;if(!e||!this.agentOnline)return;this.cancelPendingDiscovery(),this.discoveringModels=!0,this.modelDiscoveryWarning=null,this.modelDiscoveryError=null;let t=`llm-discovery-${Date.now()}-${Math.random().toString(36).slice(2)}`;this._pendingDiscovery={agentId:e,requestId:t},this.chatStore.sendWsMessage({type:"discover_llm_models",agentId:e,requestId:t,providerType:"github-copilot"});let s=await this.waitForModelDiscovery(e,t);if(!(this._pendingDiscovery?.agentId!==e||this._pendingDiscovery?.requestId!==t||this.effectiveAgentId!==e)){if(this._pendingDiscovery=null,this.discoveringModels=!1,s.error){this.modelDiscoveryError=s.error;return}this.applyDiscoveredProvider(s),this.modelDiscoveryWarning=s.warning||null}},waitForModelDiscovery(e,t){return new Promise(s=>{let n=Date.now(),i=r=>{this._discoveryTimer&&clearInterval(this._discoveryTimer),this._discoveryTimer=null,this._resolvePendingDiscovery=null,s(r)};this._resolvePendingDiscovery=i,this._discoveryTimer=setInterval(()=>{let r=this.chatStore.llmModelDiscovery?.[e];if(r?.requestId===t){i(r);return}Date.now()-n>1e4&&i({error:"Timed out while refreshing provider models."})},100)})},cancelPendingDiscovery(){let e=this._resolvePendingDiscovery;this._discoveryTimer&&clearInterval(this._discoveryTimer),this._discoveryTimer=null,this._resolvePendingDiscovery=null,this._pendingDiscovery=null,this.discoveringModels=!1,e&&e({cancelled:!0})},cancelPendingSave(){this._saveTimeout&&(clearTimeout(this._saveTimeout),this._saveTimeout=null),this._saveUnwatch&&(this._saveUnwatch(),this._saveUnwatch=null),this._pendingSave=null,this.saving=!1},applyDiscoveredProvider(e){let t={name:e.provider?.name||"github-copilot",credentialProvider:e.provider?.credentialProvider||"github-copilot",managed:e.provider?.managed||"github-copilot",models:Array.isArray(e.providerModels)&&e.providerModels.length?e.providerModels:e.models||[]},s=[...this.localProviders],n=s.findIndex(o=>o?.name===t.name);n>=0?s[n]=t:s.push(t),this.localProviders=s,this.refreshProviderModelsText();let i=new Set(this.parseModelsFromProvider(t).map(o=>`${t.name}/${o}`)),r=i.values().next().value||null;r&&!i.has(this.localPrimaryModel)&&(this.localPrimaryModel=r),r&&this.localFastModel?.startsWith(`${t.name}/`)&&!i.has(this.localFastModel)&&(this.localFastModel=r),this.markDirty()},requestConfig(){let e=this.effectiveAgentId;if(e){if(!this.agentOnline){this.loading=!1,this.loadError=null;return}this.loading=!0,this.loadError=null,this.chatStore.sendWsMessage({type:"get_llm_config",agentId:e}),this._loadTimeout=setTimeout(()=>{this.loading&&(this.loading=!1,this.loadError="Timeout")},5e3)}},loadFromConfig(e){if(this._loadTimeout&&(clearTimeout(this._loadTimeout),this._loadTimeout=null),this.loading=!1,e.error){this.loadError=e.error;return}this.loadError=null,this.localProviders=(e.agentConfig?.providers||e.providers||[]).map(t=>this.cloneProvider(t)),this.refreshProviderModelsText(),this.localPrimaryModel=e.agentConfig?.primaryModel||e.primaryModel||null,this.localFastModel=e.agentConfig?.fastModel||e.fastModel||null,this.isDirty=!1,this.showApiKey={}},cloneProvider(e){return{type:e.type||"api-key",scope:"agent",name:e.originalName||e.name||"",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",githubToken:e.githubToken||"",protocol:e.protocol||"openai-responses",credentialProvider:e.credentialProvider||null,models:Array.isArray(e.models)?e.models.map(t=>t&&typeof t=="object"?{...t}:t):[]}},refreshProviderModelsText(){this.providerModelsText=this.editableProviders.map(e=>(e.models||[]).map(t=>this._modelId(t)).join(", "))},parseModelsFromProvider(e){return this.isManagedProvider(e)&&(!Array.isArray(e.models)||e.models.length===0)?this.fallbackCopilotModels():Array.isArray(e.models)?e.models.map(t=>this._modelId(t)).filter(t=>t):[]},_modelId(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.id=="string"?e.id:""},isManagedProvider(e){return e?.managed==="github-copilot"||e?.credentialProvider==="github-copilot"||e?.name==="github-copilot"},fallbackCopilotModels(){return["gpt-5.5","gpt-5.4","gpt-5.4-mini","gpt-5-mini","gpt-5.3-codex","gpt-5.2-codex","gpt-4.1","gpt-4o","gpt-4o-mini","claude-opus-4.8","claude-opus-4.7","claude-opus-4.6","claude-sonnet-4.6","claude-sonnet-4.5","claude-haiku-4.5","gemini-2.5-pro"]},addProvider(){this.editableProviders.push({name:"",baseUrl:"",apiKey:"",protocol:"openai",credentialProvider:null,models:[]}),this.providerModelsText.push(""),this.markDirty()},onPresetPick(e){if(this.showPresetPicker=!1,!e||!e.name)return;let t=new Set(this.editableProviders.map(r=>(r.name||"").trim())),s=e.name,n=2;for(;t.has(s);)s=`${e.name}-${n++}`;let i=Array.isArray(e.models)?e.models.filter(Boolean):[];this.editableProviders.push({name:s,baseUrl:e.baseUrl||"",apiKey:"",protocol:e.protocol||"openai",credentialProvider:null,models:i}),this.providerModelsText.push(i.join(", ")),this.markDirty()},removeProvider(e){this.editableProviders.splice(e,1),this.providerModelsText.splice(e,1);let t={};for(let s=0;s<this.editableProviders.length;s++)s<e?t[s]=this.showApiKey[s]:t[s]=this.showApiKey[s+1];this.showApiKey=t,this.markDirty()},onModelsTextChange(e,t){let s=t.target.value;this.providerModelsText[e]=s;let n=Array.isArray(this.editableProviders[e].models)?this.editableProviders[e].models:[],i=new Map;for(let r of n){let o=this._modelId(r);o&&i.set(o,r)}this.editableProviders[e].models=s.split(/[\n,]+/).map(r=>r.trim()).filter(r=>r).map(r=>i.has(r)?i.get(r):r),this.markDirty()},setProtocol(e,t){let s=this.editableProviders[e].protocol;if(this.editableProviders[e].protocol=t,this.markDirty(),(this.editableProviders[e].models||[]).filter(i=>i).length===0&&t!==s){let i=this._getModelPresets(t);i.length>0&&(this.editableProviders[e].models=[...i],this.providerModelsText[e]=i.join(", "))}},protocolLabel(e){return e==="anthropic"?this.$t("settings.llm.protocolAnthropic"):e==="openai-responses"?this.$t("settings.llm.protocolOpenAIResponses"):this.$t("settings.llm.protocolOpenAI")},protocolHint(e){return e==="anthropic"?this.$t("settings.llm.protocolHint.anthropic"):e==="openai-responses"?this.$t("settings.llm.protocolHint.openaiResponses"):this.$t("settings.llm.protocolHint.openai")},_getModelPresets(e){return Mo[e]||Mo.openai},toggleApiKeyVisibility(e){this.showApiKey={...this.showApiKey,[e]:!this.showApiKey[e]}},toggleDropdown(e){this.openDropdown=this.openDropdown===e?null:e},closeDropdown(e){this.openDropdown===e&&(this.openDropdown=null)},markDirty(){this.isDirty=!0},saveConfig(){let e=this.effectiveAgentId;if(!e||this.saving)return;this.saving=!0,this.saveRefreshWarning=null;let s={providers:this.editableProviders.filter(i=>i.name&&(this.isManagedProvider(i)||i.baseUrl)).map(i=>{if(this.isManagedProvider(i))return{name:i.name.trim()||"github-copilot",credentialProvider:"github-copilot",managed:i.managed||"github-copilot",models:(i.models||[]).filter(o=>this._modelId(o))};let r={type:i.type||"api-key",name:i.name.trim(),baseUrl:i.baseUrl.trim(),apiKey:i.apiKey||"",githubToken:i.githubToken||"",models:(i.models||[]).filter(o=>this._modelId(o))};return i.protocol&&i.protocol!=="openai"&&(r.protocol=i.protocol),i.credentialProvider&&(r.credentialProvider=i.credentialProvider,r.apiKey=""),r}),primaryModel:this.localPrimaryModel||null};this.context!=="yeaft"&&(s.fastModel=this.localFastModel||null);let n=`llm-save-${Date.now()}-${Math.random().toString(36).slice(2)}`;this.cancelPendingSave(),this.saving=!0,this._pendingSave={agentId:e,requestId:n},this.chatStore.sendWsMessage({type:"update_llm_config",agentId:e,requestId:n,config:s}),this._saveTimeout=setTimeout(()=>{this._pendingSave?.agentId!==e||this._pendingSave?.requestId!==n||(this.cancelPendingSave(),this.$emit("message",this.$t("settings.llm.saveFailed"),!0))},1e4),this._saveUnwatch=this.$watch("currentConfig",i=>{if(!(!i?.loaded||i.requestId!==n||this.effectiveAgentId!==e||this._pendingSave?.agentId!==e||this._pendingSave?.requestId!==n)){if(this.cancelPendingSave(),i.error){this.$emit("message",i.error,!0);return}this.isDirty=!1,this.saveRefreshWarning=i.statusRefreshError?this.$t("settings.llm.savedRefreshWarning",{error:i.statusRefreshError}):null,this.$emit("message",this.saveRefreshWarning||this.$t("settings.llm.saved"),!!i.statusRefreshError),this.$emit("saved",{warning:this.saveRefreshWarning})}},{deep:!0})}},beforeUnmount(){this._loadTimeout&&clearTimeout(this._loadTimeout),this.cancelPendingDiscovery(),this.cancelPendingSave()}}});function qm(){return Ju+=1,`folder-picker-${Date.now()}-${Ju}`}var Do,Ju,_o,Wm,ep,Eo=O(()=>{Do=()=>({folderPickerOpen:!1,folderPickerPath:"",folderPickerEntries:[],folderPickerLoading:!1,folderPickerSelected:"",_folderPickerTimer:null,_folderPickerRequestId:null,_folderPickerRequestAgentId:null}),Ju=0;_o={openFolderPicker(){if(!this.folderPickerAgentId||!this.chat||typeof this.chat.sendWsMessage!="function")return;this.folderPickerOpen=!0,this.folderPickerSelected="",this.folderPickerLoading=!0;let t=typeof this.folderPickerInitialDir=="function"?this.folderPickerInitialDir()||"":this.defaultWorkDir||"";this.folderPickerPath=t,this.folderPickerEntries=[],this.requestFolderPickerDir(t)},invalidateFolderPickerRequest(){this._folderPickerRequestId=null,this._folderPickerRequestAgentId=null,this._folderPickerTimer&&(clearTimeout(this._folderPickerTimer),this._folderPickerTimer=null)},closeFolderPicker(){this.folderPickerOpen=!1,this.invalidateFolderPickerRequest()},requestFolderPickerDir(e){let t=this.folderPickerAgentId;if(!t||!this.chat||typeof this.chat.sendWsMessage!="function")return;let s=qm();this._folderPickerRequestId=s,this._folderPickerRequestAgentId=t,this.chat.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",requestId:s,agentId:t,dirPath:e,workDir:this.defaultWorkDir||""}),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=setTimeout(()=>{this.folderPickerLoading&&this.folderPickerOpen&&this._folderPickerRequestId===s&&this.folderPickerAgentId===t&&this.requestFolderPickerDir(e)},5e3)},loadFolderPickerDir(e){this.folderPickerLoading=!0,this.folderPickerSelected="",this.folderPickerEntries=[],this.requestFolderPickerDir(e)},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(this.folderPickerPath);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:n=/^[A-Z]:$/.test(e.name)?e.name+"\\":"/"+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}typeof this.folderPickerSetWorkDir=="function"&&this.folderPickerSetWorkDir(e),this.closeFolderPicker()}},handleFolderPickerMessage(e){let t=e.detail;!t||t.type!=="directory_listing"||t.conversationId!=="_workdir_picker"||!this.folderPickerOpen||!this._folderPickerRequestId||t.requestId!==this._folderPickerRequestId||this.folderPickerAgentId!==this._folderPickerRequestAgentId||(this._folderPickerTimer&&(clearTimeout(this._folderPickerTimer),this._folderPickerTimer=null),this._folderPickerRequestId=null,this._folderPickerRequestAgentId=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))}},Wm={data(){return Do()},methods:{..._o},mounted(){window.addEventListener("workbench-message",this.handleFolderPickerMessage)},beforeUnmount(){window.removeEventListener("workbench-message",this.handleFolderPickerMessage),this.invalidateFolderPickerRequest()}},ep=Wm});function Zt(e){let t=(Number(e?.actionRunOpenGeneration)||0)+1;return e&&(e.actionRunOpenGeneration=t),t}var Pi,Ro=O(()=>{Ku();Yu();Po();Eo();Qn();kr();Ao();Yt();Pi={name:"WorkCenterPage",components:{WorkCenterActionDetail:ju,WorkCenterSettingsModal:Gu,LlmTab:Mi},mixins:[ep],data(){return{selectedId:null,selectedActionId:null,narrowPane:"items",actionDetailTab:"messages",actionInputSending:!1,actionInputError:"",actionComposerGeneration:0,actionRunOpenGeneration:0,workItemMessage:"",workItemMessageSending:!1,workItemMessageError:"",workItemComposerGeneration:0,detailLoading:!1,detailError:"",createOpen:!1,settingsOpen:!1,saving:!1,createGeneration:0,llmConfigOpen:!1,search:"",boardVpId:"",boardWorkItemType:"",boardUpdatedRange:"week",mobileBoardLane:"active",deletingWorkItemIds:{},deleteWorkItemError:"",boardQueryTimer:null,actionGuidance:"",expandedActions:{},actionsExpanded:!1,workDirTouched:!1,startTouched:!1,createAttachments:[],guidanceAttachments:[],attachmentsUploading:!1,guidanceAttachmentsUploading:!1,previewingAttachmentId:null,attachmentPreviewError:"",attachmentPreviewGeneration:0,form:{requirement:"",workDir:"",reuseMemory:!0,start:!0}}},computed:{store(){return Pinia.useChatStore()},chat(){return this.store},agentId(){return this.store.workCenterAgentId||this.store.currentAgent},agents(){return this.store.agents||[]},onlineAgents(){return this.agents.filter(e=>e?.online&&Array.isArray(e.capabilities)&&e.capabilities.includes("work_center"))},watcher(){return this.store.workCenterWatcherByAgent[this.agentId]||null},boardNextCursor(){return this.store.workCenterListPageByAgent[this.agentId]?.nextCursor||null},boardLoadingMore(){return!!this.store.workCenterListMoreLoadingByAgent[this.agentId]},settings(){return this.store.workCenterSettingsByAgent[this.agentId]||null},runtime(){return this.store.workCenterRuntimeByAgent[this.agentId]||null},workItemTypes(){return Array.isArray(this.runtime?.workItemTypes)?this.runtime.workItemTypes:[]},workItemAttachmentsSupported(){return this.runtime?.workItemAttachments===!0},createDefaultWorkDir(){return this.settings?.defaultWorkDir||this.runtime?.defaultWorkDir||""},createDefaultStart(){return this.settings?.startImmediately!==!1},folderPickerAgentId(){return this.agentId||""},defaultWorkDir(){return this.createDefaultWorkDir},items(){return this.store.workCenterItemsByAgent[this.agentId]||[]},loading(){return!!this.store.workCenterLoadingByAgent[this.agentId]},loaded(){return!!this.store.workCenterLoadedByAgent[this.agentId]},error(){return this.store.workCenterErrorByAgent[this.agentId]||null},detail(){return this.store.workCenterDetailByAgent[this.agentId]||null},selected(){return this.detail?.id===this.selectedId?this.detail:this.items.find(e=>e.id===this.selectedId)||null},selectedAction(){return(Array.isArray(this.selected?.actions)?this.selected.actions:[]).find(t=>t.id===this.selectedActionId)||null},actionRequestKey(){return this.selected?.id&&this.selectedAction?.id?`${this.agentId}:${this.selected.id}:${this.selectedAction.id}`:""},actionComposerScope(){return this.selected?.id&&this.selectedAction?.id?`${this.agentId}:${this.selected.id}:${this.selectedAction.id}:${this.actionComposerGeneration}`:""},workItemComposerScope(){return this.selected?.id?`${this.agentId}:${this.selected.id}:${this.workItemComposerGeneration}`:""},actionMessages(){let e=Array.isArray(this.selectedAction?.messages)?this.selectedAction.messages:[],t=this.store.workCenterActionMessages[this.actionRequestKey]?.messages||[];return Rn(t,e,this.selectedAction?.liveMessage)},actionMessagesNextCursor(){let e=this.store.workCenterActionMessages[this.actionRequestKey];return e?e.nextCursor:this.selectedAction?.messageCursor},actionMessagesLoading(){return!!this.store.workCenterActionMessagesLoading[this.actionRequestKey]},actionMessagesError(){return this.store.workCenterActionMessagesError[this.actionRequestKey]||""},orderedActions(){let e=Array.isArray(this.selected?.actions)?this.selected.actions:[],t={running:0,waiting:1,failed:2,ready:3,completed:4,done:4,superseded:5,cancelled:6};return e.map((s,n)=>({action:s,index:n})).sort((s,n)=>{let i=t[s.action?.status]??7,r=t[n.action?.status]??7;if(i!==r)return i-r;let o=Number(s.action?.sequence),a=Number(n.action?.sequence);return Number.isFinite(o)&&Number.isFinite(a)&&o!==a?o-a:s.index-n.index}).map(s=>s.action)},actionRequests(){return this.store.workCenterActionRequests[this.actionRequestKey]||[]},actionRequestDetails(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=Qt(e);return[t,this.store.workCenterActionRequestDetails[`${this.actionRequestKey}:${t}`]||null]})):{}},actionRequestDetailsLoading(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=Qt(e);return[t,!!this.store.workCenterActionRequestDetailsLoading[`${this.actionRequestKey}:${t}`]]})):{}},actionRequestDetailsError(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=Qt(e);return[t,this.store.workCenterActionRequestDetailsError[`${this.actionRequestKey}:${t}`]||""]})):{}},actionRequestsLoading(){return!!this.store.workCenterActionRequestsLoading[this.actionRequestKey]},actionRequestsError(){return this.store.workCenterActionRequestsError[this.actionRequestKey]||""},boardLanes(){return[{id:"active",title:this.tr("workCenter.board.active","Active")},{id:"needs_attention",title:this.tr("workCenter.board.needsAttention","Needs attention")},{id:"closed",title:this.tr("workCenter.board.closed","Closed")}].map(e=>({...e,items:this.items.filter(t=>t.boardLane===e.id)}))},boardExecutorOptions(){let e=new Map;for(let t of this.items)for(let s of Array.isArray(t.executors)?t.executors:[])s?.id&&e.set(s.id,s.name||s.id);return[...e.entries()].map(([t,s])=>({id:t,name:s}))},boardTypeOptions(){return[...new Set(this.items.map(e=>e.workItemType).filter(Boolean))].sort()},emptyState(){return{title:this.search.trim()?this.tr("workCenter.noMatchesTitle","No matching work items"):this.tr("workCenter.emptyTitle","No work items yet"),body:this.search.trim()?this.tr("workCenter.noMatchesBody","Try a different search or filter."):this.tr("workCenter.emptyBody","Create a persistent task when work must continue beyond one conversation turn."),canCreate:!this.search.trim()}}},watch:{agentId:{immediate:!0,handler(e,t){Zt(this),this.createGeneration=(Number(this.createGeneration)||0)+1,this.saving=!1,this.selectedId=null,this.selectedActionId=null,this.resetActionComposer?.(),this.resetWorkItemComposer?.(),this.narrowPane="items",this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1,t&&e!==t&&(this.closeFolderPicker(),this.resetCreateExecutionContext(e)),e&&((typeof this.boardFilters=="function"?this.store.listWorkItems(e,this.boardFilters()):this.store.listWorkItems(e)).catch(()=>{}),this.store.loadWorkCenterSettings(e).catch(()=>{}))}},createDefaultWorkDir(){this.applyCreateDefaults()},createDefaultStart(){this.applyCreateDefaults()},search(){this.scheduleBoardQuery()},boardVpId(){this.scheduleBoardQuery()},boardWorkItemType(){this.scheduleBoardQuery()},boardUpdatedRange(){this.scheduleBoardQuery()},detail:{deep:!0,handler(e){if(!e||e.id!==this.selectedId)return;let t=Array.isArray(e.actions)?e.actions:[];if(!t.some(s=>s.id===this.selectedActionId)){let s=e.currentActionId||t[0]?.id||null;s!==this.selectedActionId&&(Zt(this),this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=s}}}},beforeUnmount(){Zt(this),this.boardQueryTimer&&clearTimeout(this.boardQueryTimer)},mounted(){let e=this.store.workCenterCreateDraft;e&&(this.form={requirement:e.requirement||e.goal||e.title||"",workDir:e.workDir||"",reuseMemory:!0,start:this.settings?.startImmediately!==!1},this.createOpen=!0,this.workDirTouched=!!String(e.workDir||"").trim(),this.startTouched=!1,this.applyCreateDefaults())},methods:{trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,closeLlmConfigFromOverlay(e){Ze(e)&&(this.llmConfigOpen=!1)},tr(e,t){let s=this.$t?this.$t(e):e;return s&&s!==e?s:t},agentName(e){return this.agents.find(s=>s.id===e)?.name||e||this.tr("workCenter.agent","Agent")},statusLabel(e){return this.tr(`workCenter.status.${e}`,String(e||"").replace("_"," "))},actionLabel(e){return this.tr(`workCenter.action.${e}`,e||"\u2014")},actionSequence(e){let t=Number(e?.sequence);if(Number.isFinite(t)&&t>0)return t;let n=(Array.isArray(this.selected?.actions)?this.selected.actions:[]).findIndex(i=>i?.id===e?.id);return n>=0?n+1:1},actionBreadcrumbDescription(e){return String(e?.brief?.objective||e?.objective||this.actionContentSummary(e)||"").trim().replace(/\s+/g," ")||this.tr("workCenter.untitledAction","Untitled Action")},itemActionProgress(e){let t=Math.max(0,Number(e?.actionCount)||0),s=Math.min(t,Math.max(0,Number(e?.completedActionCount)||0));return this.$t("workCenter.actionProgress",{completed:s,total:t})},time(e){if(!e)return"";try{return new Date(Number(e)).toLocaleString()}catch{return""}},boardFilters(){let e=Date.now(),t=this.boardUpdatedRange==="day"?e-1440*60*1e3:this.boardUpdatedRange==="week"?e-10080*60*1e3:this.boardUpdatedRange==="month"?e-720*60*60*1e3:null;return{keyword:this.search.trim(),vpId:this.boardVpId,workItemType:this.boardWorkItemType,updatedFrom:t,limit:200}},scheduleBoardQuery(){this.boardQueryTimer&&clearTimeout(this.boardQueryTimer),this.boardQueryTimer=setTimeout(()=>{this.boardQueryTimer=null,this.agentId&&this.refresh()},180)},refresh(){return this.store.listWorkItems(this.agentId,this.boardFilters()).catch(()=>{})},loadMoreBoardItems(){return this.store.loadMoreWorkItems(this.agentId).catch(()=>{})},boardAction(e){return e.attentionAction||e.activeAction||e.currentAction||null},boardActionCountLabel(e){let t=e.actionCounts||{},s=[];for(let n of["running","failed","waiting","ready"])Number(t[n])>0&&s.push(`${t[n]} ${this.statusLabel(n)}`);return s.join(" \xB7 ")||this.itemActionProgress(e)},boardExecutorLabel(e){let t=Array.isArray(e.executors)?e.executors:[];if(t.length>0)return t.map(n=>n.name||n.id).join(", ");let s=this.boardAction(e);return s?.assignedVp?.name||s?.assignedVp?.id||this.tr("workCenter.assignment.planned","Planned assignment")},resetActionComposer(){this.actionComposerGeneration+=1,this.actionGuidance="",this.actionInputError="",this.guidanceAttachments=[],this.guidanceAttachmentsUploading=!1,this.actionInputSending=!1},resetWorkItemComposer(){this.workItemComposerGeneration+=1,this.workItemMessage="",this.workItemMessageError="",this.workItemMessageSending=!1},openWorkItem(e){Zt(this),this.selectedId=e,this.selectedActionId=null,this.narrowPane="actions",this.resetActionComposer(),this.resetWorkItemComposer(),this.expandedActions={},this.actionsExpanded=!1,this.detailError="",this.detailLoading=!1,this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1},async selectItem(e){this.openWorkItem(e.id),this.detailLoading=!0;try{let t=await this.store.getWorkItem(e.id,this.agentId);this.selectedId===e.id&&(this.selectedActionId=t?.currentActionId||t?.actions?.[0]?.id||null)}catch(t){this.selectedId===e.id&&(this.detailError=t?.message||String(t))}finally{this.selectedId===e.id&&(this.detailLoading=!1)}},selectAction(e){this.selectedActionId!==e.id&&(Zt(this),this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=e.id,this.narrowPane="action",this.loadLatestActionMessages(e)},loadLatestActionMessages(e=this.selectedAction){if(!this.selected?.id||!e?.id||Array.isArray(e.messages))return null;let t=`${this.agentId}:${this.selected.id}:${e.id}`;return this.store.workCenterActionMessages[t]?null:this.store.loadWorkItemActionMessages(this.selected.id,e.id,null,this.agentId).catch(()=>null)},showItemsPane(){this.narrowPane="items"},showActionsPane(){this.narrowPane="actions"},loadEarlierActionMessages(){return!this.selected?.id||!this.selectedAction?.id||this.actionMessagesNextCursor==null?null:this.store.loadWorkItemActionMessages(this.selected.id,this.selectedAction.id,this.actionMessagesNextCursor,this.agentId).catch(()=>null)},async refreshActionRequests(){return!this.selected?.id||!this.selectedAction?.id?[]:this.store.loadWorkItemActionRequests(this.selected.id,this.selectedAction.id,this.agentId).catch(()=>[])},loadActionRequest(e){return!this.selected?.id||!this.selectedAction?.id||!e?.id?null:this.store.loadWorkItemActionRequest(this.selected.id,this.selectedAction.id,e.runId,e.id,this.agentId).catch(()=>null)},async openActionRun(e,t){let s=Zt(this),n={agentId:this.agentId,workItemId:this.selected?.id,actionId:this.selectedAction?.id,generation:this.selectedAction?.generation,runId:e?.id},i=()=>this.actionRunOpenGeneration===s&&this.agentId===n.agentId&&this.selected?.id===n.workItemId&&this.selectedAction?.id===n.actionId&&this.selectedAction?.generation===n.generation;if(!n.workItemId||!n.actionId||!n.runId)return t?.(null);let r=await this.store.loadWorkItemActionRequests(n.workItemId,n.actionId,n.agentId).catch(()=>[]);if(!i())return t?.(null);let o=r.find(l=>l.runId===n.runId)||null;return!o||!await this.store.loadWorkItemActionRequest(n.workItemId,n.actionId,o.runId,o.id,n.agentId).catch(()=>null)||!i()?t?.(null):t?.(o)},actionHasDetail(e){return!!e?.brief||Array.isArray(e?.messages)&&e.messages.length>0||!!String(e?.response||"").trim()||!!String(e?.failureReason||"").trim()},actionExpanded(e){return!!this.expandedActions[e?.id]},toggleAction(e){this.actionHasDetail(e)&&(this.expandedActions={...this.expandedActions,[e.id]:!this.expandedActions[e.id]})},actionResponseText(e){return String(e?.response||"").trim()},actionExecutor(e){return e?.assignedVp?.name||e?.assignedVp?.id||e?.requiredRole||e?.assignmentPolicy?.fixedVpId||e?.assignmentPolicy?.capability||this.tr("workCenter.assignment.auto","Auto")},actionContentSummary(e){return String(e?.contentSummary||e?.response||e?.brief?.objective||"").trim()},executionStats(e){return e?.executionStats||{}},formatCount(e){return new Intl.NumberFormat().format(Math.max(0,Number(e)||0))},formatTokens(e){let t=Math.max(0,Number(e)||0);return t>=1e6?`${(t/1e6).toFixed(1)}m`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)},resetCreateExecutionContext(e){let t=this.workDirTouched||this.startTouched,s=this.store.workCenterCreateDraft;s&&(this.store.workCenterCreateDraft={sourceAgentId:e||null,requirement:s.requirement||s.goal||s.title||"",workDir:"",origin:null,linkedSessionIds:[]}),this.form.workDir="",this.form.start=!0,this.workDirTouched=!1,this.startTouched=!1,t&&(this.createOpen=!1),this.applyCreateDefaults()},applyCreateDefaults(){this.createOpen&&(!this.workDirTouched&&!this.form.workDir.trim()&&(this.form.workDir=this.createDefaultWorkDir),this.startTouched||(this.form.start=this.createDefaultStart))},folderPickerInitialDir(){return this.form.workDir.trim()||this.createDefaultWorkDir},folderPickerSetWorkDir(e){this.form.workDir=e,this.workDirTouched=!0},onCreateWorkDirInput(){this.workDirTouched=!0},onCreateStartInput(){this.startTouched=!0},async onCreateAttachmentInput(e){if(!this.workItemAttachmentsSupported)throw e.target.value="",new Error(this.tr("workCenter.attachmentsUnsupported","The selected Agent does not support Work Item attachments."));let t=Array.from(e.target.files||[]);if(e.target.value="",t.length===0)return;let s=Math.max(0,10-this.createAttachments.length),n=t.slice(0,s);if(n.length!==0){this.attachmentsUploading=!0;try{let i=new FormData;for(let d of n)i.append("files",d,d.name||"attachment");let r=Pinia.useAuthStore(),o=r.getActiveToken?.()||r.token||null,a=o?{Authorization:`Bearer ${o}`}:{},l=await fetch("/api/upload",{method:"POST",headers:a,body:i});if(!l.ok)throw new Error(this.tr("workCenter.attachmentsUploadFailed","Attachment upload failed"));let c=await l.json();this.createAttachments=[...this.createAttachments,...Array.isArray(c.files)?c.files:[]].slice(0,10)}finally{this.attachmentsUploading=!1}}},removeCreateAttachment(e){this.createAttachments=this.createAttachments.filter((t,s)=>s!==e)},async onGuidanceAttachmentInput(e){if(!this.workItemAttachmentsSupported)throw e.target.value="",new Error(this.tr("workCenter.attachmentsUnsupported","The selected Agent does not support Work Item attachments."));let t=Array.from(e.target.files||[]);if(e.target.value="",t.length===0)return;let s=this.actionComposerScope;if(!s)return;let n=Array.isArray(this.selected?.attachments)?this.selected.attachments.length:0,i=Math.max(0,10-n-this.guidanceAttachments.length),r=t.slice(0,i);if(r.length!==0){this.guidanceAttachmentsUploading=!0,this.actionInputError="";try{let o=new FormData;for(let p of r)o.append("files",p,p.name||"attachment");let a=Pinia.useAuthStore(),l=a.getActiveToken?.()||a.token||null,c=l?{Authorization:`Bearer ${l}`}:{},d=await fetch("/api/upload",{method:"POST",headers:c,body:o});if(!d.ok)throw new Error(this.tr("workCenter.attachmentsUploadFailed","Attachment upload failed"));let u=await d.json();if(this.actionComposerScope!==s)return;this.guidanceAttachments=[...this.guidanceAttachments,...Array.isArray(u.files)?u.files:[]].slice(0,Math.max(0,10-n))}catch(o){this.actionComposerScope===s&&(this.actionInputError=o?.message||String(o))}finally{this.actionComposerScope===s&&(this.guidanceAttachmentsUploading=!1)}}},removeGuidanceAttachment(e){this.guidanceAttachments=this.guidanceAttachments.filter((t,s)=>s!==e)},async previewAttachment(e,t=null){if(!this.selected?.id||!e?.id||this.previewingAttachmentId)return;let s=this.agentId,n=this.selected.id,i=this.selectedActionId||"",r=`${s}:${n}:${i}`,o=(Number(this.attachmentPreviewGeneration)||0)+1;this.attachmentPreviewGeneration=o;let a=()=>this.attachmentPreviewGeneration===o&&`${this.agentId}:${this.selected?.id||""}:${this.selectedActionId||""}`===r,l=e.isImage?null:window.open("","_blank");if(!e.isImage&&!l){this.attachmentPreviewError=this.tr("workCenter.attachmentOpenBlocked","The browser blocked the attachment window. Allow pop-ups and try again.");return}l&&(l.opener=null),this.previewingAttachmentId=e.id,this.attachmentPreviewError="";try{let c=await this.store.previewWorkItemAttachment(n,e.id,s);if(!a()){l?.close();return}c?.preview&&c.attachment?.isImage?hs(c.preview,{alt:e.name||this.tr("workCenter.previewAttachment","Open attachment"),closeLabel:this.tr("common.close","Close"),trigger:t}):c?.preview&&l?l.location.replace(c.preview):l?.close()}catch(c){l?.close(),a()&&(this.attachmentPreviewError=c?.message||this.tr("workCenter.attachmentPreviewFailed","Could not open the attachment. Try again."))}finally{a()&&(this.previewingAttachmentId=null)}},formatAttachmentSize(e){let t=Math.max(0,Number(e)||0);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`},openCreate(){this.createOpen=!0,this.workDirTouched=!1,this.startTouched=!1,this.applyCreateDefaults()},closeCreate(){this.saving||(this.closeFolderPicker(),this.createOpen=!1,this.store.workCenterCreateDraft=null)},onLlmConfigSaved(){let e=this.agentId;if(e)return this.store.refreshWorkCenterRuntime(e).catch(()=>{})},async submitCreate(){let e=String(this.form.requirement||this.form.goal||this.form.title||"").trim();if(!e||!this.form.workDir.trim())return;let t=this.agentId,s=(Number(this.createGeneration)||0)+1;this.createGeneration=s,this.saving=!0;try{let n=this.store.workCenterCreateDraft,i=n?.sourceAgentId===t,r=await this.store.createWorkItem({requirement:e,title:e,goal:e,acceptanceCriteria:[],workItemType:"auto",workDir:this.form.workDir.trim(),origin:i&&n.origin||null,linkedSessionIds:i?n.linkedSessionIds||[]:[],attachments:this.workItemAttachmentsSupported?(this.createAttachments||[]).map(o=>({fileId:o.fileId,name:o.name,mimeType:o.mimeType,size:o.size})):[],reuseMemory:this.form.reuseMemory,start:this.form.start},t);if(this.agentId!==t||this.createGeneration!==s)return;this.openWorkItem(r.id),this.selectedActionId=r.currentActionId||r.actions?.[0]?.id||null,this.form={requirement:"",workDir:"",reuseMemory:!0,start:this.settings?.startImmediately!==!1},this.store.workCenterCreateDraft=null,this.createAttachments=[],this.workDirTouched=!1,this.startTouched=!1,this.createOpen=!1}finally{this.agentId===t&&this.createGeneration===s&&(this.saving=!1)}},async startSelected(){this.selected&&await this.store.startWorkItem(this.selected.id,this.agentId)},async sendSelectedWorkItemMessage(){if(!this.selected||!this.workItemMessage.trim()||this.workItemMessageSending)return;let e=this.workItemComposerScope,t=this.selected.id,s=this.selected.revision,n=this.workItemMessage.trim();this.workItemMessageSending=!0,this.workItemMessageError="";try{await this.store.sendWorkItemMessage(t,n,s,this.agentId),this.workItemComposerScope===e&&this.workItemMessage.trim()===n&&(this.workItemMessage="")}catch(i){this.workItemComposerScope===e&&(this.workItemMessageError=i?.message||String(i))}finally{this.workItemComposerScope===e&&(this.workItemMessageSending=!1)}},async retrySelectedAction(){if(!this.selected||this.selectedAction?.status!=="failed"||this.actionInputSending)return;let e=this.actionComposerScope;this.actionInputSending=!0,this.actionInputError="";try{await this.store.retryWorkItemAction(this.selected.id,this.selectedAction.id,this.selected.revision,this.selectedAction.generation,this.agentId)}catch(t){this.actionComposerScope===e&&(this.actionInputError=t?.message||String(t))}finally{this.actionComposerScope===e&&(this.actionInputSending=!1)}},async guideSelectedAction(){if(!this.selected||!this.selectedAction||!this.actionGuidance.trim()&&this.guidanceAttachments.length===0||!["ready","running","waiting","failed"].includes(this.selectedAction.status))return;let e=this.actionComposerScope,t=this.selected.id,s=this.selectedAction.id,n=this.selected.revision,i=this.actionGuidance.trim(),r=this.guidanceAttachments.map(o=>({fileId:o.fileId,name:o.name,mimeType:o.mimeType,size:o.size}));this.actionInputSending=!0,this.actionInputError="";try{let o=await this.store.sendWorkItemActionInput(t,i,s,n,this.selectedAction.generation,r,this.agentId);if(this.actionComposerScope!==e)return;this.actionGuidance="",this.guidanceAttachments=[];let l=o?.actions?.some(c=>c?.id===s)?s:o?.currentActionId||this.selectedActionId;l!==this.selectedActionId&&(this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=l}catch(o){this.actionComposerScope===e&&(this.actionInputError=o?.message||String(o))}finally{this.actionComposerScope===e&&(this.actionInputSending=!1)}},workItemCanDelete(e){return["done","cancelled","draft","needs_attention"].includes(e?.status)},workItemDeleting(e){return!!this.deletingWorkItemIds[e?.id]},async deleteWorkItem(e){if(!e||this.workItemDeleting(e))return;let t=this.tr("workCenter.deleteConfirm","Permanently delete this Work Item, its execution history, and attachments?");if(!(typeof confirm=="function"&&!confirm(t))){this.deleteWorkItemError="",this.deletingWorkItemIds={...this.deletingWorkItemIds,[e.id]:!0};try{let s=await this.store.deleteWorkItem(e.id,e.revision,this.agentId);s?.cleanupWarning&&(this.deleteWorkItemError=s.cleanupWarning),this.selectedId===e.id&&(Zt(this),this.selectedId=null,this.selectedActionId=null,this.narrowPane="items",this.resetActionComposer(),this.resetWorkItemComposer())}catch(s){this.deleteWorkItemError=s?.message||String(s)}finally{let s={...this.deletingWorkItemIds};delete s[e.id],this.deletingWorkItemIds=s}}},async cancelSelected(){if(!this.selected)return;let e=this.tr("workCenter.cancelConfirm","Cancel this work item and stop its unfinished Actions?");typeof confirm=="function"&&!confirm(e)||await this.store.cancelWorkItem(this.selected.id,this.agentId)}},template:`
|
|
5041
|
+
`,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(){return{loading:!1,loadError:null,localProviders:[],providerModelsText:[],localPrimaryModel:null,localFastModel:null,isDirty:!1,saving:!1,openDropdown:null,showApiKey:{},showPresetPicker:!1,discoveringModels:!1,modelDiscoveryWarning:null,modelDiscoveryError:null,saveRefreshWarning:null}},computed:{chatStore(){return Pinia.useChatStore()},effectiveAgentId(){return this.chatStore.currentAgent},agentOnline(){let e=this.effectiveAgentId;if(!e)return!1;if(this.context==="yeaft")return!0;let t=this.chatStore.agents.find(s=>s.id===e);return t?t.online:!1},currentConfig(){let e=this.effectiveAgentId;return e&&this.chatStore.llmConfig[e]||null},editableProviders(){return this.localProviders},allModelRefs(){let e=this.localProviders,t=[];for(let s of e){if(!s.name)continue;let n=this.parseModelsFromProvider(s);for(let i of n)t.push(`${s.name}/${i}`)}return t}},watch:{effectiveAgentId:{handler(e,t){e!==t&&(this.cancelPendingDiscovery(),this.cancelPendingSave(),this._loadTimeout&&(clearTimeout(this._loadTimeout),this._loadTimeout=null),this.loading=!1,this.loadError=null,this.localProviders=[],this.providerModelsText=[],this.localPrimaryModel=null,this.localFastModel=null,this.isDirty=!1,this.modelDiscoveryWarning=null,this.modelDiscoveryError=null,this.saveRefreshWarning=null),e&&this.requestConfig()},immediate:!0},agentOnline(e){e&&!this.currentConfig&&this.effectiveAgentId&&this.requestConfig()},currentConfig:{handler(e){e&&e.loaded&&this.loadFromConfig(e)},deep:!0}},methods:{async copyText(e){try{await navigator.clipboard.writeText(e),this.$emit("message",this.$t("settings.msg.copiedClipboard"),!1)}catch{this.$emit("message",this.$t("settings.msg.copyFailed"),!0)}},async useGitHubCopilotPreset(){let e=this.effectiveAgentId;if(!e||!this.agentOnline)return;this.cancelPendingDiscovery(),this.discoveringModels=!0,this.modelDiscoveryWarning=null,this.modelDiscoveryError=null;let t=`llm-discovery-${Date.now()}-${Math.random().toString(36).slice(2)}`;this._pendingDiscovery={agentId:e,requestId:t},this.chatStore.sendWsMessage({type:"discover_llm_models",agentId:e,requestId:t,providerType:"github-copilot"});let s=await this.waitForModelDiscovery(e,t);if(!(this._pendingDiscovery?.agentId!==e||this._pendingDiscovery?.requestId!==t||this.effectiveAgentId!==e)){if(this._pendingDiscovery=null,this.discoveringModels=!1,s.error){this.modelDiscoveryError=s.error;return}this.applyDiscoveredProvider(s),this.modelDiscoveryWarning=s.warning||null}},waitForModelDiscovery(e,t){return new Promise(s=>{let n=Date.now(),i=r=>{this._discoveryTimer&&clearInterval(this._discoveryTimer),this._discoveryTimer=null,this._resolvePendingDiscovery=null,s(r)};this._resolvePendingDiscovery=i,this._discoveryTimer=setInterval(()=>{let r=this.chatStore.llmModelDiscovery?.[e];if(r?.requestId===t){i(r);return}Date.now()-n>1e4&&i({error:"Timed out while refreshing provider models."})},100)})},cancelPendingDiscovery(){let e=this._resolvePendingDiscovery;this._discoveryTimer&&clearInterval(this._discoveryTimer),this._discoveryTimer=null,this._resolvePendingDiscovery=null,this._pendingDiscovery=null,this.discoveringModels=!1,e&&e({cancelled:!0})},cancelPendingSave(){this._saveTimeout&&(clearTimeout(this._saveTimeout),this._saveTimeout=null),this._saveUnwatch&&(this._saveUnwatch(),this._saveUnwatch=null),this._pendingSave=null,this.saving=!1},applyDiscoveredProvider(e){let t={name:e.provider?.name||"github-copilot",credentialProvider:e.provider?.credentialProvider||"github-copilot",managed:e.provider?.managed||"github-copilot",models:Array.isArray(e.providerModels)&&e.providerModels.length?e.providerModels:e.models||[]},s=[...this.localProviders],n=s.findIndex(o=>o?.name===t.name);n>=0?s[n]=t:s.push(t),this.localProviders=s,this.refreshProviderModelsText();let i=new Set(this.parseModelsFromProvider(t).map(o=>`${t.name}/${o}`)),r=i.values().next().value||null;r&&!i.has(this.localPrimaryModel)&&(this.localPrimaryModel=r),r&&this.localFastModel?.startsWith(`${t.name}/`)&&!i.has(this.localFastModel)&&(this.localFastModel=r),this.markDirty()},requestConfig(){let e=this.effectiveAgentId;if(e){if(!this.agentOnline){this.loading=!1,this.loadError=null;return}this.loading=!0,this.loadError=null,this.chatStore.sendWsMessage({type:"get_llm_config",agentId:e}),this._loadTimeout=setTimeout(()=>{this.loading&&(this.loading=!1,this.loadError="Timeout")},5e3)}},loadFromConfig(e){if(this._loadTimeout&&(clearTimeout(this._loadTimeout),this._loadTimeout=null),this.loading=!1,e.error){this.loadError=e.error;return}this.loadError=null,this.localProviders=(e.agentConfig?.providers||e.providers||[]).map(t=>this.cloneProvider(t)),this.refreshProviderModelsText(),this.localPrimaryModel=e.agentConfig?.primaryModel||e.primaryModel||null,this.localFastModel=e.agentConfig?.fastModel||e.fastModel||null,this.isDirty=!1,this.showApiKey={}},cloneProvider(e){return{type:e.type||"api-key",scope:"agent",name:e.originalName||e.name||"",baseUrl:e.baseUrl||"",apiKey:e.apiKey||"",githubToken:e.githubToken||"",protocol:e.protocol||"openai-responses",credentialProvider:e.credentialProvider||null,models:Array.isArray(e.models)?e.models.map(t=>t&&typeof t=="object"?{...t}:t):[]}},refreshProviderModelsText(){this.providerModelsText=this.editableProviders.map(e=>(e.models||[]).map(t=>this._modelId(t)).join(", "))},parseModelsFromProvider(e){return this.isManagedProvider(e)&&(!Array.isArray(e.models)||e.models.length===0)?this.fallbackCopilotModels():Array.isArray(e.models)?e.models.map(t=>this._modelId(t)).filter(t=>t):[]},_modelId(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.id=="string"?e.id:""},isManagedProvider(e){return e?.managed==="github-copilot"||e?.credentialProvider==="github-copilot"||e?.name==="github-copilot"},fallbackCopilotModels(){return["gpt-5.5","gpt-5.4","gpt-5.4-mini","gpt-5-mini","gpt-5.3-codex","gpt-5.2-codex","gpt-4.1","gpt-4o","gpt-4o-mini","claude-opus-4.8","claude-opus-4.7","claude-opus-4.6","claude-sonnet-4.6","claude-sonnet-4.5","claude-haiku-4.5","gemini-2.5-pro"]},addProvider(){this.editableProviders.push({name:"",baseUrl:"",apiKey:"",protocol:"openai",credentialProvider:null,models:[]}),this.providerModelsText.push(""),this.markDirty()},onPresetPick(e){if(this.showPresetPicker=!1,!e||!e.name)return;let t=new Set(this.editableProviders.map(r=>(r.name||"").trim())),s=e.name,n=2;for(;t.has(s);)s=`${e.name}-${n++}`;let i=Array.isArray(e.models)?e.models.filter(Boolean):[];this.editableProviders.push({name:s,baseUrl:e.baseUrl||"",apiKey:"",protocol:e.protocol||"openai",credentialProvider:null,models:i}),this.providerModelsText.push(i.join(", ")),this.markDirty()},removeProvider(e){this.editableProviders.splice(e,1),this.providerModelsText.splice(e,1);let t={};for(let s=0;s<this.editableProviders.length;s++)s<e?t[s]=this.showApiKey[s]:t[s]=this.showApiKey[s+1];this.showApiKey=t,this.markDirty()},onModelsTextChange(e,t){let s=t.target.value;this.providerModelsText[e]=s;let n=Array.isArray(this.editableProviders[e].models)?this.editableProviders[e].models:[],i=new Map;for(let r of n){let o=this._modelId(r);o&&i.set(o,r)}this.editableProviders[e].models=s.split(/[\n,]+/).map(r=>r.trim()).filter(r=>r).map(r=>i.has(r)?i.get(r):r),this.markDirty()},setProtocol(e,t){let s=this.editableProviders[e].protocol;if(this.editableProviders[e].protocol=t,this.markDirty(),(this.editableProviders[e].models||[]).filter(i=>i).length===0&&t!==s){let i=this._getModelPresets(t);i.length>0&&(this.editableProviders[e].models=[...i],this.providerModelsText[e]=i.join(", "))}},protocolLabel(e){return e==="anthropic"?this.$t("settings.llm.protocolAnthropic"):e==="openai-responses"?this.$t("settings.llm.protocolOpenAIResponses"):this.$t("settings.llm.protocolOpenAI")},protocolHint(e){return e==="anthropic"?this.$t("settings.llm.protocolHint.anthropic"):e==="openai-responses"?this.$t("settings.llm.protocolHint.openaiResponses"):this.$t("settings.llm.protocolHint.openai")},_getModelPresets(e){return Mo[e]||Mo.openai},toggleApiKeyVisibility(e){this.showApiKey={...this.showApiKey,[e]:!this.showApiKey[e]}},toggleDropdown(e){this.openDropdown=this.openDropdown===e?null:e},closeDropdown(e){this.openDropdown===e&&(this.openDropdown=null)},markDirty(){this.isDirty=!0},saveConfig(){let e=this.effectiveAgentId;if(!e||this.saving)return;this.saving=!0,this.saveRefreshWarning=null;let s={providers:this.editableProviders.filter(i=>i.name&&(this.isManagedProvider(i)||i.baseUrl)).map(i=>{if(this.isManagedProvider(i))return{name:i.name.trim()||"github-copilot",credentialProvider:"github-copilot",managed:i.managed||"github-copilot",models:(i.models||[]).filter(o=>this._modelId(o))};let r={type:i.type||"api-key",name:i.name.trim(),baseUrl:i.baseUrl.trim(),apiKey:i.apiKey||"",githubToken:i.githubToken||"",models:(i.models||[]).filter(o=>this._modelId(o))};return i.protocol&&i.protocol!=="openai"&&(r.protocol=i.protocol),i.credentialProvider&&(r.credentialProvider=i.credentialProvider,r.apiKey=""),r}),primaryModel:this.localPrimaryModel||null};this.context!=="yeaft"&&(s.fastModel=this.localFastModel||null);let n=`llm-save-${Date.now()}-${Math.random().toString(36).slice(2)}`;this.cancelPendingSave(),this.saving=!0,this._pendingSave={agentId:e,requestId:n},this.chatStore.sendWsMessage({type:"update_llm_config",agentId:e,requestId:n,config:s}),this._saveTimeout=setTimeout(()=>{this._pendingSave?.agentId!==e||this._pendingSave?.requestId!==n||(this.cancelPendingSave(),this.$emit("message",this.$t("settings.llm.saveFailed"),!0))},1e4),this._saveUnwatch=this.$watch("currentConfig",i=>{if(!(!i?.loaded||i.requestId!==n||this.effectiveAgentId!==e||this._pendingSave?.agentId!==e||this._pendingSave?.requestId!==n)){if(this.cancelPendingSave(),i.error){this.$emit("message",i.error,!0);return}this.isDirty=!1,this.saveRefreshWarning=i.statusRefreshError?this.$t("settings.llm.savedRefreshWarning",{error:i.statusRefreshError}):null,this.$emit("message",this.saveRefreshWarning||this.$t("settings.llm.saved"),!!i.statusRefreshError),this.$emit("saved",{warning:this.saveRefreshWarning})}},{deep:!0})}},beforeUnmount(){this._loadTimeout&&clearTimeout(this._loadTimeout),this.cancelPendingDiscovery(),this.cancelPendingSave()}}});function Wm(){return Ju+=1,`folder-picker-${Date.now()}-${Ju}`}var Do,Ju,_o,Um,ep,Eo=O(()=>{Do=()=>({folderPickerOpen:!1,folderPickerPath:"",folderPickerEntries:[],folderPickerLoading:!1,folderPickerSelected:"",_folderPickerTimer:null,_folderPickerRequestId:null,_folderPickerRequestAgentId:null}),Ju=0;_o={openFolderPicker(){if(!this.folderPickerAgentId||!this.chat||typeof this.chat.sendWsMessage!="function")return;this.folderPickerOpen=!0,this.folderPickerSelected="",this.folderPickerLoading=!0;let t=typeof this.folderPickerInitialDir=="function"?this.folderPickerInitialDir()||"":this.defaultWorkDir||"";this.folderPickerPath=t,this.folderPickerEntries=[],this.requestFolderPickerDir(t)},invalidateFolderPickerRequest(){this._folderPickerRequestId=null,this._folderPickerRequestAgentId=null,this._folderPickerTimer&&(clearTimeout(this._folderPickerTimer),this._folderPickerTimer=null)},closeFolderPicker(){this.folderPickerOpen=!1,this.invalidateFolderPickerRequest()},requestFolderPickerDir(e){let t=this.folderPickerAgentId;if(!t||!this.chat||typeof this.chat.sendWsMessage!="function")return;let s=Wm();this._folderPickerRequestId=s,this._folderPickerRequestAgentId=t,this.chat.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",requestId:s,agentId:t,dirPath:e,workDir:this.defaultWorkDir||""}),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=setTimeout(()=>{this.folderPickerLoading&&this.folderPickerOpen&&this._folderPickerRequestId===s&&this.folderPickerAgentId===t&&this.requestFolderPickerDir(e)},5e3)},loadFolderPickerDir(e){this.folderPickerLoading=!0,this.folderPickerSelected="",this.folderPickerEntries=[],this.requestFolderPickerDir(e)},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(this.folderPickerPath);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:n=/^[A-Z]:$/.test(e.name)?e.name+"\\":"/"+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}typeof this.folderPickerSetWorkDir=="function"&&this.folderPickerSetWorkDir(e),this.closeFolderPicker()}},handleFolderPickerMessage(e){let t=e.detail;!t||t.type!=="directory_listing"||t.conversationId!=="_workdir_picker"||!this.folderPickerOpen||!this._folderPickerRequestId||t.requestId!==this._folderPickerRequestId||this.folderPickerAgentId!==this._folderPickerRequestAgentId||(this._folderPickerTimer&&(clearTimeout(this._folderPickerTimer),this._folderPickerTimer=null),this._folderPickerRequestId=null,this._folderPickerRequestAgentId=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))}},Um={data(){return Do()},methods:{..._o},mounted(){window.addEventListener("workbench-message",this.handleFolderPickerMessage)},beforeUnmount(){window.removeEventListener("workbench-message",this.handleFolderPickerMessage),this.invalidateFolderPickerRequest()}},ep=Um});function Zt(e){let t=(Number(e?.actionRunOpenGeneration)||0)+1;return e&&(e.actionRunOpenGeneration=t),t}var Pi,Ro=O(()=>{Ku();Yu();Po();Eo();Qn();kr();Ao();Yt();Pi={name:"WorkCenterPage",components:{WorkCenterActionDetail:ju,WorkCenterSettingsModal:Gu,LlmTab:Mi},mixins:[ep],data(){return{selectedId:null,selectedActionId:null,narrowPane:"items",actionDetailTab:"messages",actionInputSending:!1,actionInputError:"",actionComposerGeneration:0,actionRunOpenGeneration:0,workItemMessage:"",workItemMessageSending:!1,workItemMessageError:"",workItemComposerGeneration:0,detailLoading:!1,detailError:"",createOpen:!1,settingsOpen:!1,saving:!1,createGeneration:0,llmConfigOpen:!1,search:"",boardVpId:"",boardWorkItemType:"",boardUpdatedRange:"week",mobileBoardLane:"active",deletingWorkItemIds:{},deleteWorkItemError:"",boardQueryTimer:null,actionGuidance:"",expandedActions:{},actionsExpanded:!1,workDirTouched:!1,startTouched:!1,createAttachments:[],guidanceAttachments:[],attachmentsUploading:!1,guidanceAttachmentsUploading:!1,previewingAttachmentId:null,attachmentPreviewError:"",attachmentPreviewGeneration:0,form:{requirement:"",workDir:"",reuseMemory:!0,start:!0}}},computed:{store(){return Pinia.useChatStore()},chat(){return this.store},agentId(){return this.store.workCenterAgentId||this.store.currentAgent},agents(){return this.store.agents||[]},onlineAgents(){return this.agents.filter(e=>e?.online&&Array.isArray(e.capabilities)&&e.capabilities.includes("work_center"))},watcher(){return this.store.workCenterWatcherByAgent[this.agentId]||null},boardNextCursor(){return this.store.workCenterListPageByAgent[this.agentId]?.nextCursor||null},boardLoadingMore(){return!!this.store.workCenterListMoreLoadingByAgent[this.agentId]},settings(){return this.store.workCenterSettingsByAgent[this.agentId]||null},runtime(){return this.store.workCenterRuntimeByAgent[this.agentId]||null},workItemTypes(){return Array.isArray(this.runtime?.workItemTypes)?this.runtime.workItemTypes:[]},workItemAttachmentsSupported(){return this.runtime?.workItemAttachments===!0},createDefaultWorkDir(){return this.settings?.defaultWorkDir||this.runtime?.defaultWorkDir||""},createDefaultStart(){return this.settings?.startImmediately!==!1},folderPickerAgentId(){return this.agentId||""},defaultWorkDir(){return this.createDefaultWorkDir},items(){return this.store.workCenterItemsByAgent[this.agentId]||[]},loading(){return!!this.store.workCenterLoadingByAgent[this.agentId]},loaded(){return!!this.store.workCenterLoadedByAgent[this.agentId]},error(){return this.store.workCenterErrorByAgent[this.agentId]||null},detail(){return this.store.workCenterDetailByAgent[this.agentId]||null},selected(){return this.detail?.id===this.selectedId?this.detail:this.items.find(e=>e.id===this.selectedId)||null},selectedAction(){return(Array.isArray(this.selected?.actions)?this.selected.actions:[]).find(t=>t.id===this.selectedActionId)||null},actionRequestKey(){return this.selected?.id&&this.selectedAction?.id?`${this.agentId}:${this.selected.id}:${this.selectedAction.id}`:""},actionComposerScope(){return this.selected?.id&&this.selectedAction?.id?`${this.agentId}:${this.selected.id}:${this.selectedAction.id}:${this.actionComposerGeneration}`:""},workItemComposerScope(){return this.selected?.id?`${this.agentId}:${this.selected.id}:${this.workItemComposerGeneration}`:""},actionMessages(){let e=Array.isArray(this.selectedAction?.messages)?this.selectedAction.messages:[],t=this.store.workCenterActionMessages[this.actionRequestKey]?.messages||[];return Rn(t,e,this.selectedAction?.liveMessage)},actionMessagesNextCursor(){let e=this.store.workCenterActionMessages[this.actionRequestKey];return e?e.nextCursor:this.selectedAction?.messageCursor},actionMessagesLoading(){return!!this.store.workCenterActionMessagesLoading[this.actionRequestKey]},actionMessagesError(){return this.store.workCenterActionMessagesError[this.actionRequestKey]||""},orderedActions(){let e=Array.isArray(this.selected?.actions)?this.selected.actions:[],t={running:0,waiting:1,failed:2,ready:3,completed:4,done:4,superseded:5,cancelled:6};return e.map((s,n)=>({action:s,index:n})).sort((s,n)=>{let i=t[s.action?.status]??7,r=t[n.action?.status]??7;if(i!==r)return i-r;let o=Number(s.action?.sequence),a=Number(n.action?.sequence);return Number.isFinite(o)&&Number.isFinite(a)&&o!==a?o-a:s.index-n.index}).map(s=>s.action)},actionRequests(){return this.store.workCenterActionRequests[this.actionRequestKey]||[]},actionRequestDetails(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=Qt(e);return[t,this.store.workCenterActionRequestDetails[`${this.actionRequestKey}:${t}`]||null]})):{}},actionRequestDetailsLoading(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=Qt(e);return[t,!!this.store.workCenterActionRequestDetailsLoading[`${this.actionRequestKey}:${t}`]]})):{}},actionRequestDetailsError(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=Qt(e);return[t,this.store.workCenterActionRequestDetailsError[`${this.actionRequestKey}:${t}`]||""]})):{}},actionRequestsLoading(){return!!this.store.workCenterActionRequestsLoading[this.actionRequestKey]},actionRequestsError(){return this.store.workCenterActionRequestsError[this.actionRequestKey]||""},boardLanes(){return[{id:"active",title:this.tr("workCenter.board.active","Active")},{id:"needs_attention",title:this.tr("workCenter.board.needsAttention","Needs attention")},{id:"closed",title:this.tr("workCenter.board.closed","Closed")}].map(e=>({...e,items:this.items.filter(t=>t.boardLane===e.id)}))},boardExecutorOptions(){let e=new Map;for(let t of this.items)for(let s of Array.isArray(t.executors)?t.executors:[])s?.id&&e.set(s.id,s.name||s.id);return[...e.entries()].map(([t,s])=>({id:t,name:s}))},boardTypeOptions(){return[...new Set(this.items.map(e=>e.workItemType).filter(Boolean))].sort()},emptyState(){return{title:this.search.trim()?this.tr("workCenter.noMatchesTitle","No matching work items"):this.tr("workCenter.emptyTitle","No work items yet"),body:this.search.trim()?this.tr("workCenter.noMatchesBody","Try a different search or filter."):this.tr("workCenter.emptyBody","Create a persistent task when work must continue beyond one conversation turn."),canCreate:!this.search.trim()}}},watch:{agentId:{immediate:!0,handler(e,t){Zt(this),this.createGeneration=(Number(this.createGeneration)||0)+1,this.saving=!1,this.selectedId=null,this.selectedActionId=null,this.resetActionComposer?.(),this.resetWorkItemComposer?.(),this.narrowPane="items",this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1,t&&e!==t&&(this.closeFolderPicker(),this.resetCreateExecutionContext(e)),e&&((typeof this.boardFilters=="function"?this.store.listWorkItems(e,this.boardFilters()):this.store.listWorkItems(e)).catch(()=>{}),this.store.loadWorkCenterSettings(e).catch(()=>{}))}},createDefaultWorkDir(){this.applyCreateDefaults()},createDefaultStart(){this.applyCreateDefaults()},search(){this.scheduleBoardQuery()},boardVpId(){this.scheduleBoardQuery()},boardWorkItemType(){this.scheduleBoardQuery()},boardUpdatedRange(){this.scheduleBoardQuery()},detail:{deep:!0,handler(e){if(!e||e.id!==this.selectedId)return;let t=Array.isArray(e.actions)?e.actions:[];if(!t.some(s=>s.id===this.selectedActionId)){let s=e.currentActionId||t[0]?.id||null;s!==this.selectedActionId&&(Zt(this),this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=s}}}},beforeUnmount(){Zt(this),this.boardQueryTimer&&clearTimeout(this.boardQueryTimer)},mounted(){let e=this.store.workCenterCreateDraft;e&&(this.form={requirement:e.requirement||e.goal||e.title||"",workDir:e.workDir||"",reuseMemory:!0,start:this.settings?.startImmediately!==!1},this.createOpen=!0,this.workDirTouched=!!String(e.workDir||"").trim(),this.startTouched=!1,this.applyCreateDefaults())},methods:{trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,closeLlmConfigFromOverlay(e){Ze(e)&&(this.llmConfigOpen=!1)},tr(e,t){let s=this.$t?this.$t(e):e;return s&&s!==e?s:t},agentName(e){return this.agents.find(s=>s.id===e)?.name||e||this.tr("workCenter.agent","Agent")},statusLabel(e){return this.tr(`workCenter.status.${e}`,String(e||"").replace("_"," "))},actionLabel(e){return this.tr(`workCenter.action.${e}`,e||"\u2014")},actionSequence(e){let t=Number(e?.sequence);if(Number.isFinite(t)&&t>0)return t;let n=(Array.isArray(this.selected?.actions)?this.selected.actions:[]).findIndex(i=>i?.id===e?.id);return n>=0?n+1:1},actionBreadcrumbDescription(e){return String(e?.brief?.objective||e?.objective||this.actionContentSummary(e)||"").trim().replace(/\s+/g," ")||this.tr("workCenter.untitledAction","Untitled Action")},itemActionProgress(e){let t=Math.max(0,Number(e?.actionCount)||0),s=Math.min(t,Math.max(0,Number(e?.completedActionCount)||0));return this.$t("workCenter.actionProgress",{completed:s,total:t})},time(e){if(!e)return"";try{return new Date(Number(e)).toLocaleString()}catch{return""}},boardFilters(){let e=Date.now(),t=this.boardUpdatedRange==="day"?e-1440*60*1e3:this.boardUpdatedRange==="week"?e-10080*60*1e3:this.boardUpdatedRange==="month"?e-720*60*60*1e3:null;return{keyword:this.search.trim(),vpId:this.boardVpId,workItemType:this.boardWorkItemType,updatedFrom:t,limit:200}},scheduleBoardQuery(){this.boardQueryTimer&&clearTimeout(this.boardQueryTimer),this.boardQueryTimer=setTimeout(()=>{this.boardQueryTimer=null,this.agentId&&this.refresh()},180)},refresh(){return this.store.listWorkItems(this.agentId,this.boardFilters()).catch(()=>{})},loadMoreBoardItems(){return this.store.loadMoreWorkItems(this.agentId).catch(()=>{})},boardAction(e){return e.attentionAction||e.activeAction||e.currentAction||null},boardActionCountLabel(e){let t=e.actionCounts||{},s=[];for(let n of["running","failed","waiting","ready"])Number(t[n])>0&&s.push(`${t[n]} ${this.statusLabel(n)}`);return s.join(" \xB7 ")||this.itemActionProgress(e)},boardExecutorLabel(e){let t=Array.isArray(e.executors)?e.executors:[];if(t.length>0)return t.map(n=>n.name||n.id).join(", ");let s=this.boardAction(e);return s?.assignedVp?.name||s?.assignedVp?.id||this.tr("workCenter.assignment.planned","Planned assignment")},resetActionComposer(){this.actionComposerGeneration+=1,this.actionGuidance="",this.actionInputError="",this.guidanceAttachments=[],this.guidanceAttachmentsUploading=!1,this.actionInputSending=!1},resetWorkItemComposer(){this.workItemComposerGeneration+=1,this.workItemMessage="",this.workItemMessageError="",this.workItemMessageSending=!1},openWorkItem(e){Zt(this),this.selectedId=e,this.selectedActionId=null,this.narrowPane="actions",this.resetActionComposer(),this.resetWorkItemComposer(),this.expandedActions={},this.actionsExpanded=!1,this.detailError="",this.detailLoading=!1,this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1},async selectItem(e){this.openWorkItem(e.id),this.detailLoading=!0;try{let t=await this.store.getWorkItem(e.id,this.agentId);this.selectedId===e.id&&(this.selectedActionId=t?.currentActionId||t?.actions?.[0]?.id||null)}catch(t){this.selectedId===e.id&&(this.detailError=t?.message||String(t))}finally{this.selectedId===e.id&&(this.detailLoading=!1)}},selectAction(e){this.selectedActionId!==e.id&&(Zt(this),this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=e.id,this.narrowPane="action",this.loadLatestActionMessages(e)},loadLatestActionMessages(e=this.selectedAction){if(!this.selected?.id||!e?.id||Array.isArray(e.messages))return null;let t=`${this.agentId}:${this.selected.id}:${e.id}`;return this.store.workCenterActionMessages[t]?null:this.store.loadWorkItemActionMessages(this.selected.id,e.id,null,this.agentId).catch(()=>null)},showItemsPane(){this.narrowPane="items"},showActionsPane(){this.narrowPane="actions"},loadEarlierActionMessages(){return!this.selected?.id||!this.selectedAction?.id||this.actionMessagesNextCursor==null?null:this.store.loadWorkItemActionMessages(this.selected.id,this.selectedAction.id,this.actionMessagesNextCursor,this.agentId).catch(()=>null)},async refreshActionRequests(){return!this.selected?.id||!this.selectedAction?.id?[]:this.store.loadWorkItemActionRequests(this.selected.id,this.selectedAction.id,this.agentId).catch(()=>[])},loadActionRequest(e){return!this.selected?.id||!this.selectedAction?.id||!e?.id?null:this.store.loadWorkItemActionRequest(this.selected.id,this.selectedAction.id,e.runId,e.id,this.agentId).catch(()=>null)},async openActionRun(e,t){let s=Zt(this),n={agentId:this.agentId,workItemId:this.selected?.id,actionId:this.selectedAction?.id,generation:this.selectedAction?.generation,runId:e?.id},i=()=>this.actionRunOpenGeneration===s&&this.agentId===n.agentId&&this.selected?.id===n.workItemId&&this.selectedAction?.id===n.actionId&&this.selectedAction?.generation===n.generation;if(!n.workItemId||!n.actionId||!n.runId)return t?.(null);let r=await this.store.loadWorkItemActionRequests(n.workItemId,n.actionId,n.agentId).catch(()=>[]);if(!i())return t?.(null);let o=r.find(l=>l.runId===n.runId)||null;return!o||!await this.store.loadWorkItemActionRequest(n.workItemId,n.actionId,o.runId,o.id,n.agentId).catch(()=>null)||!i()?t?.(null):t?.(o)},actionHasDetail(e){return!!e?.brief||Array.isArray(e?.messages)&&e.messages.length>0||!!String(e?.response||"").trim()||!!String(e?.failureReason||"").trim()},actionExpanded(e){return!!this.expandedActions[e?.id]},toggleAction(e){this.actionHasDetail(e)&&(this.expandedActions={...this.expandedActions,[e.id]:!this.expandedActions[e.id]})},actionResponseText(e){return String(e?.response||"").trim()},actionExecutor(e){return e?.assignedVp?.name||e?.assignedVp?.id||e?.requiredRole||e?.assignmentPolicy?.fixedVpId||e?.assignmentPolicy?.capability||this.tr("workCenter.assignment.auto","Auto")},actionContentSummary(e){return String(e?.contentSummary||e?.response||e?.brief?.objective||"").trim()},executionStats(e){return e?.executionStats||{}},formatCount(e){return new Intl.NumberFormat().format(Math.max(0,Number(e)||0))},formatTokens(e){let t=Math.max(0,Number(e)||0);return t>=1e6?`${(t/1e6).toFixed(1)}m`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)},resetCreateExecutionContext(e){let t=this.workDirTouched||this.startTouched,s=this.store.workCenterCreateDraft;s&&(this.store.workCenterCreateDraft={sourceAgentId:e||null,requirement:s.requirement||s.goal||s.title||"",workDir:"",origin:null,linkedSessionIds:[]}),this.form.workDir="",this.form.start=!0,this.workDirTouched=!1,this.startTouched=!1,t&&(this.createOpen=!1),this.applyCreateDefaults()},applyCreateDefaults(){this.createOpen&&(!this.workDirTouched&&!this.form.workDir.trim()&&(this.form.workDir=this.createDefaultWorkDir),this.startTouched||(this.form.start=this.createDefaultStart))},folderPickerInitialDir(){return this.form.workDir.trim()||this.createDefaultWorkDir},folderPickerSetWorkDir(e){this.form.workDir=e,this.workDirTouched=!0},onCreateWorkDirInput(){this.workDirTouched=!0},onCreateStartInput(){this.startTouched=!0},async onCreateAttachmentInput(e){if(!this.workItemAttachmentsSupported)throw e.target.value="",new Error(this.tr("workCenter.attachmentsUnsupported","The selected Agent does not support Work Item attachments."));let t=Array.from(e.target.files||[]);if(e.target.value="",t.length===0)return;let s=Math.max(0,10-this.createAttachments.length),n=t.slice(0,s);if(n.length!==0){this.attachmentsUploading=!0;try{let i=new FormData;for(let d of n)i.append("files",d,d.name||"attachment");let r=Pinia.useAuthStore(),o=r.getActiveToken?.()||r.token||null,a=o?{Authorization:`Bearer ${o}`}:{},l=await fetch("/api/upload",{method:"POST",headers:a,body:i});if(!l.ok)throw new Error(this.tr("workCenter.attachmentsUploadFailed","Attachment upload failed"));let c=await l.json();this.createAttachments=[...this.createAttachments,...Array.isArray(c.files)?c.files:[]].slice(0,10)}finally{this.attachmentsUploading=!1}}},removeCreateAttachment(e){this.createAttachments=this.createAttachments.filter((t,s)=>s!==e)},async onGuidanceAttachmentInput(e){if(!this.workItemAttachmentsSupported)throw e.target.value="",new Error(this.tr("workCenter.attachmentsUnsupported","The selected Agent does not support Work Item attachments."));let t=Array.from(e.target.files||[]);if(e.target.value="",t.length===0)return;let s=this.actionComposerScope;if(!s)return;let n=Array.isArray(this.selected?.attachments)?this.selected.attachments.length:0,i=Math.max(0,10-n-this.guidanceAttachments.length),r=t.slice(0,i);if(r.length!==0){this.guidanceAttachmentsUploading=!0,this.actionInputError="";try{let o=new FormData;for(let p of r)o.append("files",p,p.name||"attachment");let a=Pinia.useAuthStore(),l=a.getActiveToken?.()||a.token||null,c=l?{Authorization:`Bearer ${l}`}:{},d=await fetch("/api/upload",{method:"POST",headers:c,body:o});if(!d.ok)throw new Error(this.tr("workCenter.attachmentsUploadFailed","Attachment upload failed"));let u=await d.json();if(this.actionComposerScope!==s)return;this.guidanceAttachments=[...this.guidanceAttachments,...Array.isArray(u.files)?u.files:[]].slice(0,Math.max(0,10-n))}catch(o){this.actionComposerScope===s&&(this.actionInputError=o?.message||String(o))}finally{this.actionComposerScope===s&&(this.guidanceAttachmentsUploading=!1)}}},removeGuidanceAttachment(e){this.guidanceAttachments=this.guidanceAttachments.filter((t,s)=>s!==e)},async previewAttachment(e,t=null){if(!this.selected?.id||!e?.id||this.previewingAttachmentId)return;let s=this.agentId,n=this.selected.id,i=this.selectedActionId||"",r=`${s}:${n}:${i}`,o=(Number(this.attachmentPreviewGeneration)||0)+1;this.attachmentPreviewGeneration=o;let a=()=>this.attachmentPreviewGeneration===o&&`${this.agentId}:${this.selected?.id||""}:${this.selectedActionId||""}`===r,l=e.isImage?null:window.open("","_blank");if(!e.isImage&&!l){this.attachmentPreviewError=this.tr("workCenter.attachmentOpenBlocked","The browser blocked the attachment window. Allow pop-ups and try again.");return}l&&(l.opener=null),this.previewingAttachmentId=e.id,this.attachmentPreviewError="";try{let c=await this.store.previewWorkItemAttachment(n,e.id,s);if(!a()){l?.close();return}c?.preview&&c.attachment?.isImage?hs(c.preview,{alt:e.name||this.tr("workCenter.previewAttachment","Open attachment"),closeLabel:this.tr("common.close","Close"),trigger:t}):c?.preview&&l?l.location.replace(c.preview):l?.close()}catch(c){l?.close(),a()&&(this.attachmentPreviewError=c?.message||this.tr("workCenter.attachmentPreviewFailed","Could not open the attachment. Try again."))}finally{a()&&(this.previewingAttachmentId=null)}},formatAttachmentSize(e){let t=Math.max(0,Number(e)||0);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`},openCreate(){this.createOpen=!0,this.workDirTouched=!1,this.startTouched=!1,this.applyCreateDefaults()},closeCreate(){this.saving||(this.closeFolderPicker(),this.createOpen=!1,this.store.workCenterCreateDraft=null)},onLlmConfigSaved(){let e=this.agentId;if(e)return this.store.refreshWorkCenterRuntime(e).catch(()=>{})},async submitCreate(){let e=String(this.form.requirement||this.form.goal||this.form.title||"").trim();if(!e||!this.form.workDir.trim())return;let t=this.agentId,s=(Number(this.createGeneration)||0)+1;this.createGeneration=s,this.saving=!0;try{let n=this.store.workCenterCreateDraft,i=n?.sourceAgentId===t,r=await this.store.createWorkItem({requirement:e,title:e,goal:e,acceptanceCriteria:[],workItemType:"auto",workDir:this.form.workDir.trim(),origin:i&&n.origin||null,linkedSessionIds:i?n.linkedSessionIds||[]:[],attachments:this.workItemAttachmentsSupported?(this.createAttachments||[]).map(o=>({fileId:o.fileId,name:o.name,mimeType:o.mimeType,size:o.size})):[],reuseMemory:this.form.reuseMemory,start:this.form.start},t);if(this.agentId!==t||this.createGeneration!==s)return;this.openWorkItem(r.id),this.selectedActionId=r.currentActionId||r.actions?.[0]?.id||null,this.form={requirement:"",workDir:"",reuseMemory:!0,start:this.settings?.startImmediately!==!1},this.store.workCenterCreateDraft=null,this.createAttachments=[],this.workDirTouched=!1,this.startTouched=!1,this.createOpen=!1}finally{this.agentId===t&&this.createGeneration===s&&(this.saving=!1)}},async startSelected(){this.selected&&await this.store.startWorkItem(this.selected.id,this.agentId)},async sendSelectedWorkItemMessage(){if(!this.selected||!this.workItemMessage.trim()||this.workItemMessageSending)return;let e=this.workItemComposerScope,t=this.selected.id,s=this.selected.revision,n=this.workItemMessage.trim();this.workItemMessageSending=!0,this.workItemMessageError="";try{await this.store.sendWorkItemMessage(t,n,s,this.agentId),this.workItemComposerScope===e&&this.workItemMessage.trim()===n&&(this.workItemMessage="")}catch(i){this.workItemComposerScope===e&&(this.workItemMessageError=i?.message||String(i))}finally{this.workItemComposerScope===e&&(this.workItemMessageSending=!1)}},async retrySelectedAction(){if(!this.selected||this.selectedAction?.status!=="failed"||this.actionInputSending)return;let e=this.actionComposerScope;this.actionInputSending=!0,this.actionInputError="";try{await this.store.retryWorkItemAction(this.selected.id,this.selectedAction.id,this.selected.revision,this.selectedAction.generation,this.agentId)}catch(t){this.actionComposerScope===e&&(this.actionInputError=t?.message||String(t))}finally{this.actionComposerScope===e&&(this.actionInputSending=!1)}},async guideSelectedAction(){if(!this.selected||!this.selectedAction||!this.actionGuidance.trim()&&this.guidanceAttachments.length===0||!["ready","running","waiting","failed"].includes(this.selectedAction.status))return;let e=this.actionComposerScope,t=this.selected.id,s=this.selectedAction.id,n=this.selected.revision,i=this.actionGuidance.trim(),r=this.guidanceAttachments.map(o=>({fileId:o.fileId,name:o.name,mimeType:o.mimeType,size:o.size}));this.actionInputSending=!0,this.actionInputError="";try{let o=await this.store.sendWorkItemActionInput(t,i,s,n,this.selectedAction.generation,r,this.agentId);if(this.actionComposerScope!==e)return;this.actionGuidance="",this.guidanceAttachments=[];let l=o?.actions?.some(c=>c?.id===s)?s:o?.currentActionId||this.selectedActionId;l!==this.selectedActionId&&(this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=l}catch(o){this.actionComposerScope===e&&(this.actionInputError=o?.message||String(o))}finally{this.actionComposerScope===e&&(this.actionInputSending=!1)}},workItemCanDelete(e){return["done","cancelled","draft","needs_attention"].includes(e?.status)},workItemDeleting(e){return!!this.deletingWorkItemIds[e?.id]},async deleteWorkItem(e){if(!e||this.workItemDeleting(e))return;let t=this.tr("workCenter.deleteConfirm","Permanently delete this Work Item, its execution history, and attachments?");if(!(typeof confirm=="function"&&!confirm(t))){this.deleteWorkItemError="",this.deletingWorkItemIds={...this.deletingWorkItemIds,[e.id]:!0};try{let s=await this.store.deleteWorkItem(e.id,e.revision,this.agentId);s?.cleanupWarning&&(this.deleteWorkItemError=s.cleanupWarning),this.selectedId===e.id&&(Zt(this),this.selectedId=null,this.selectedActionId=null,this.narrowPane="items",this.resetActionComposer(),this.resetWorkItemComposer())}catch(s){this.deleteWorkItemError=s?.message||String(s)}finally{let s={...this.deletingWorkItemIds};delete s[e.id],this.deletingWorkItemIds=s}}},async cancelSelected(){if(!this.selected)return;let e=this.tr("workCenter.cancelConfirm","Cancel this work item and stop its unfinished Actions?");typeof confirm=="function"&&!confirm(e)||await this.store.cancelWorkItem(this.selected.id,this.agentId)}},template:`
|
|
5042
5042
|
<main class="work-center-main" :class="{ 'workbench-maximized': store.workbenchMaximized && store.workbenchExpanded }">
|
|
5043
5043
|
<div class="work-center-shell">
|
|
5044
5044
|
<header class="work-center-header">
|
|
@@ -5933,7 +5933,7 @@ ${String(e||"").trim()}
|
|
|
5933
5933
|
</div>
|
|
5934
5934
|
</div>
|
|
5935
5935
|
</div>
|
|
5936
|
-
`,data(){return{showAgentDropdown:!1,showSettingsPanel:!1,restartingAgents:{},upgradingAgents:{},showConversationModal:!1,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=Ae().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},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))},pinnedChatConversations(){let e=this.store.conversations.filter(t=>t.agentOnline!==!1&&this.store.isSessionPinned(t.id));return this.sortByActivity(e)},unpinnedChatConversations(){return this.sortByActivity(this.store.conversations.filter(e=>e.agentOnline!==!1&&!this.store.isSessionPinned(e.id)))},chatSessionCount(){return this.store.conversations.filter(e=>e.agentOnline!==!1).length}},methods:{onSidebarCollapse(){tp({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 mc(e)},openConversationModal(){this.showConversationModal=!0,this.convModalAgent="",this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1,this._foldersRetried=!1;let e=this.store.agents.filter(n=>n.online),s=e.find(n=>n.id===this.store.currentAgent)||e[0];s&&(this.convModalAgent=s.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 _i(e,this.$t.bind(this))},selectConversation(e,t){this.store.leaveWorkCenter(),this.store.selectConversation(e,t),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),this.store.closeSessionSidebar();return}this.selectConversation(e.id,e.agentId)},splitToPanel(e){this.store.splitToPanel(e)},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),i=new Date,r=i-n;return r<6e4?this.$t("chat.time.justNow"):r<36e5?this.$t("chat.time.minutesAgo",{count:Math.floor(r/6e4)}):n.toDateString()===i.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 Di(e)},formatTime(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""},getLastPathSegment(e){return un(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),i=s||n?.workDir||"";this.folderPickerPath=i,this.folderPickerEntries=[];let r=()=>{this.store.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",agentId:t,dirPath:i,workDir:n?.workDir||""})};r(),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=setTimeout(()=>{this.folderPickerLoading&&this.folderPickerOpen&&r()},5e3)},loadFolderPickerDir(e){let t=this.convModalAgent;if(!t)return;this.folderPickerLoading=!0,this.folderPickerSelected="",this.folderPickerEntries=[];let s=this.store.agents.find(i=>i.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(){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:i,version:r,reason:o,currentNode:a,requiredNode:l}=e.detail;s?i&&(delete this.upgradingAgents[t],alert(this.$t("chat.agent.alreadyLatest",{version:r||""}))):(delete this.upgradingAgents[t],alert(o==="node_incompatible"?this.$t("chat.agent.nodeIncompatible",{current:a||"?",required:l||"?",version:r||""}):`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(i=>i.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)}}});var Um,rp,op=O(()=>{gs();Um=new Set(["ada","alan","alice","dieter","grace","ken","linus","margaret","martin","anders","norman","shannon","steve","kongzi","socrates","nietzsche","kahneman","jung","sunzi","clausewitz","simaqian","harari","buffett","munger","dalio","bezos","drucker","luxun","sudongpo","borges","einstein","kubrick","miyazaki"]),rp={name:"VpAvatar",props:{vpId:{type:String,required:!0},size:{type:Number,default:20},status:{type:String,default:null},typing:{type:Boolean,default:!1},ariaLabel:{type:String,default:""}},template:`
|
|
5936
|
+
`,data(){return{showAgentDropdown:!1,showSettingsPanel:!1,restartingAgents:{},upgradingAgents:{},showConversationModal:!1,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=Ae().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},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))},pinnedChatConversations(){let e=this.store.conversations.filter(t=>t.agentOnline!==!1&&this.store.isSessionPinned(t.id));return this.sortByActivity(e)},unpinnedChatConversations(){return this.sortByActivity(this.store.conversations.filter(e=>e.agentOnline!==!1&&!this.store.isSessionPinned(e.id)))},chatSessionCount(){return this.store.conversations.filter(e=>e.agentOnline!==!1).length}},methods:{onSidebarCollapse(){tp({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 mc(e)},openConversationModal(){this.showConversationModal=!0,this.convModalAgent="",this.convModalWorkDir="",this.selectedResumeSession=null,this.historyLoaded=!1,this._foldersRetried=!1;let e=this.store.agents.filter(n=>n.online),s=e.find(n=>n.id===this.store.currentAgent)||e[0];s&&(this.convModalAgent=s.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 _i(e,this.$t.bind(this))},selectConversation(e,t){this.store.leaveWorkCenter(),this.store.selectConversation(e,t),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),this.store.closeSessionSidebar();return}this.selectConversation(e.id,e.agentId)},splitToPanel(e){this.store.splitToPanel(e)},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),i=new Date,r=i-n;return r<6e4?this.$t("chat.time.justNow"):r<36e5?this.$t("chat.time.minutesAgo",{count:Math.floor(r/6e4)}):n.toDateString()===i.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 Di(e)},formatTime(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""},getLastPathSegment(e){return un(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),i=s||n?.workDir||"";this.folderPickerPath=i,this.folderPickerEntries=[];let r=()=>{this.store.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",agentId:t,dirPath:i,workDir:n?.workDir||""})};r(),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=setTimeout(()=>{this.folderPickerLoading&&this.folderPickerOpen&&r()},5e3)},loadFolderPickerDir(e){let t=this.convModalAgent;if(!t)return;this.folderPickerLoading=!0,this.folderPickerSelected="",this.folderPickerEntries=[];let s=this.store.agents.find(i=>i.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(){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:i,version:r,reason:o,currentNode:a,requiredNode:l}=e.detail;s?i&&(delete this.upgradingAgents[t],alert(this.$t("chat.agent.alreadyLatest",{version:r||""}))):(delete this.upgradingAgents[t],alert(o==="node_incompatible"?this.$t("chat.agent.nodeIncompatible",{current:a||"?",required:l||"?",version:r||""}):`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(i=>i.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)}}});var zm,rp,op=O(()=>{gs();zm=new Set(["ada","alan","alice","dieter","grace","ken","linus","margaret","martin","anders","norman","shannon","steve","kongzi","socrates","nietzsche","kahneman","jung","sunzi","clausewitz","simaqian","harari","buffett","munger","dalio","bezos","drucker","luxun","sudongpo","borges","einstein","kubrick","miyazaki"]),rp={name:"VpAvatar",props:{vpId:{type:String,required:!0},size:{type:Number,default:20},status:{type:String,default:null},typing:{type:Boolean,default:!1},ariaLabel:{type:String,default:""}},template:`
|
|
5937
5937
|
<span
|
|
5938
5938
|
class="vp-avatar"
|
|
5939
5939
|
:class="{ 'is-busy': status === 'busy', 'is-online': status === 'online', 'is-typing': typing && !status }"
|
|
@@ -5968,7 +5968,7 @@ ${String(e||"").trim()}
|
|
|
5968
5968
|
<span class="vp-avatar-typing-dot"></span>
|
|
5969
5969
|
</span>
|
|
5970
5970
|
</span>
|
|
5971
|
-
`,setup(e){let t=ft(),s=Vue.computed(()=>t.vpInitial(e.vpId)),n=Vue.computed(()=>t.vpLabel(e.vpId)),i=Vue.computed(()=>{let f=t.vpAvatarMotif;return typeof f=="function"?f(e.vpId):{key:"rat",glyph:"R",background:"linear-gradient(135deg, #174EA6 0%, #0B2F6B 100%)",foreground:"#FFFFFF"}}),r=Vue.computed(()=>{let f=t.vpColor;return typeof f=="function"?f(e.vpId):i.value.background}),o=Vue.computed(()=>i.value.key),a=Vue.computed(()=>i.value.glyph),l=Vue.computed(()=>i.value.foreground),c=Vue.ref(!1),d=Vue.computed(()=>{if(c.value)return null;let f=e.vpId;return!f||!
|
|
5971
|
+
`,setup(e){let t=ft(),s=Vue.computed(()=>t.vpInitial(e.vpId)),n=Vue.computed(()=>t.vpLabel(e.vpId)),i=Vue.computed(()=>{let f=t.vpAvatarMotif;return typeof f=="function"?f(e.vpId):{key:"rat",glyph:"R",background:"linear-gradient(135deg, #174EA6 0%, #0B2F6B 100%)",foreground:"#FFFFFF"}}),r=Vue.computed(()=>{let f=t.vpColor;return typeof f=="function"?f(e.vpId):i.value.background}),o=Vue.computed(()=>i.value.key),a=Vue.computed(()=>i.value.glyph),l=Vue.computed(()=>i.value.foreground),c=Vue.ref(!1),d=Vue.computed(()=>{if(c.value)return null;let f=e.vpId;return!f||!zm.has(f)?null:`/assets/avatars/${f}.svg`});function u(){c.value=!0}Vue.watch(()=>e.vpId,()=>{c.value=!1});let p=Vue.computed(()=>({width:e.size+"px",height:e.size+"px",background:r.value,color:l.value,fontSize:Math.max(13,Math.round(e.size*.58))+"px"}));return{initial:s,displayName:n,avatarStyle:p,avatarUrl:d,motifKey:o,motifGlyph:a,onImgError:u}}}});function jm(e,t,s,n=0){let i=Math.max(t.top,s.top),r=Math.min(t.bottom,s.bottom),o=Math.max(0,e.top-i-lp),a=Math.max(0,r-e.bottom-lp),l=Math.max(0,Number(n)||0),c="down";return(a<l&&o>=l||a<l&&o>a)&&(c="up"),{placement:c,availableHeight:Math.floor(c==="up"?o:a)}}var ap,lp,Ei,Vo=O(()=>{op();$o();on();Eo();ap="omni",lp=4;Ei={name:"SessionCreateModal",components:{VpAvatar:rp},emits:["close","created"],template:`
|
|
5972
5972
|
<Teleport to="body">
|
|
5973
5973
|
<div class="modal-overlay" @click.self="onOverlayClick" role="dialog" aria-modal="true" :aria-label="$t('yeaft.session.create.title')">
|
|
5974
5974
|
<div class="modal resume-modal yeaft-session-create-modal">
|
|
@@ -6244,7 +6244,7 @@ ${String(e||"").trim()}
|
|
|
6244
6244
|
</div>
|
|
6245
6245
|
</div>
|
|
6246
6246
|
</Teleport>
|
|
6247
|
-
`,data(){return{form:{name:"",vpIds:[],defaultVpId:null,workDir:"",agentId:null},busy:!1,submitError:"",...Do(),vpPickerTouched:!1,vpRosterOpen:!1,vpRosterPlacement:"down",vpRosterAvailableHeight:null,scannedSessions:[],restoreScanning:!1,restoring:null,restoreError:""}},computed:{chat(){try{if(typeof window<"u"&&window.Pinia?.useChatStore)return window.Pinia.useChatStore()}catch{}return null},vpStore(){try{if(typeof window<"u"&&window.Pinia?.useVpStore)return window.Pinia.useVpStore()}catch{}return null},sessionsStore(){try{if(typeof window<"u"&&window.Pinia?.useSessionsStore)return window.Pinia.useSessionsStore()}catch{}return null},vpList(){return this.vpStore?.vpList||[]},vpDomainSections(){return Kt(this.vpList)},vpListSignature(){return(this.vpList||[]).map(e=>e&&e.vpId).filter(Boolean).join(",")},vpLibraryEmpty(){let e=this.vpStore;return e?e.emptyLibrary===!0?!0:!!(e.lastSnapshotAt&&e.lastSnapshotAt>0&&(e.vpOrder?.length||0)===0):!1},agentOptions(){let e=this.chat;return!e||!Array.isArray(e.agents)?[]:e.agents.map(t=>({id:t.id,name:t.name,online:!!t.online,workDir:t.workDir||""}))},agentSignature(){return this.agentOptions.map(e=>`${e.id}:${e.online?1:0}`).join(",")},folderPickerAgentId(){return this.form.agentId||this.chat?.currentAgent||""},defaultWorkDir(){return this.agentOptions.find(t=>t.id===this.form.agentId)?.workDir||this.chat?.currentAgentInfo?.workDir||""},workDirPlaceholder(){return this.defaultWorkDir||this.$t("modal.newConv.inputOrSelect")},allSessions(){return this.sessionsStore?.sessionList||[]},agentSessions(){let e=this.form.agentId||null;return e?this.allSessions.filter(t=>{let s=t&&t.agentId;return!s||s===e}):this.allSessions},folderAggregates(){let e=new Map;for(let t of this.agentSessions){let s=t&&typeof t.workDir=="string"?t.workDir.trim():"";if(!s)continue;let n=e.get(s)||{path:s,count:0};n.count+=1,e.set(s,n)}return Array.from(e.values()).sort((t,s)=>t.path.localeCompare(s.path))},sessionsInDir(){let e=new Set((this.sessionsStore?.sessionList||[]).map(s=>s&&s.id).filter(Boolean));return(Array.isArray(this.scannedSessions)?this.scannedSessions:[]).filter(s=>s&&s.id).map(s=>({...s,inSidebar:e.has(s.id)}))},canSubmit(){if(this.form.vpIds.length===0||!this.form.agentId)return!1;let e=this.agentOptions.find(t=>t.id===this.form.agentId);return!!(e&&e.online)},vpRosterSummary(){let e=this.form.vpIds||[];return e.length===0?this.$t("yeaft.session.create.vpNone"):e.length<=3?e.map(t=>this.vpLabelFor(t)).join(this.$t("common.comma")):this.$t("yeaft.session.create.vpCount",{n:e.length})},vpRosterPopupStyle(){return Number.isFinite(this.vpRosterAvailableHeight)?{"--vp-roster-available-height":`${this.vpRosterAvailableHeight}px`}:{}}},mounted(){window.addEventListener("keydown",this.onEsc),window.addEventListener("resize",this.scheduleVpRosterLayout),window.visualViewport?.addEventListener("resize",this.scheduleVpRosterLayout),window.visualViewport?.addEventListener("scroll",this.scheduleVpRosterLayout),window.addEventListener("workbench-message",this.handleFolderPickerMessage),document.addEventListener("click",this.handleOutsideRosterClick,!0),this.seedAgentDefault(),this.subscribeVpsFor(this.form.agentId),this.applyDefaultSelection()},watch:{vpListSignature(){this.applyDefaultSelection(),this.scheduleVpRosterLayout()},agentSignature(){this.seedAgentDefault(),this.scheduleVpRosterLayout()},"form.agentId"(e,t){e!==t&&(this.subscribeVpsFor(e),this.form.vpIds=[],this.form.defaultVpId=null,this.vpPickerTouched=!1,this.applyDefaultSelection(),this.scannedSessions=[],this.restoreError="",(this.form.workDir||"").trim()&&this.loadRestoreCandidates())},"form.workDir"(e,t){e===t||(this.restoreError="",this.scannedSessions=[],!(e||"").trim())||this.loadRestoreCandidates()}},beforeUnmount(){window.removeEventListener("keydown",this.onEsc),window.removeEventListener("resize",this.scheduleVpRosterLayout),window.visualViewport?.removeEventListener("resize",this.scheduleVpRosterLayout),window.visualViewport?.removeEventListener("scroll",this.scheduleVpRosterLayout),window.removeEventListener("workbench-message",this.handleFolderPickerMessage),document.removeEventListener("click",this.handleOutsideRosterClick,!0),this._vpRosterLayoutFrame&&cancelAnimationFrame(this._vpRosterLayoutFrame),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer)},methods:{toggleVpRoster(){if(this.vpRosterOpen){this.closeVpRoster();return}this.vpRosterPlacement="down",this.vpRosterAvailableHeight=null,this.vpRosterOpen=!0,this.$nextTick(this.scheduleVpRosterLayout)},closeVpRoster(){this.vpRosterOpen=!1,this.vpRosterAvailableHeight=null},scheduleVpRosterLayout(){!this.vpRosterOpen||this._vpRosterLayoutFrame||(this._vpRosterLayoutFrame=requestAnimationFrame(()=>{this._vpRosterLayoutFrame=null,this.updateVpRosterLayout()}))},updateVpRosterLayout(){if(!this.vpRosterOpen)return;let e=this.$refs.vpRosterTrigger,t=this.$refs.vpRosterPopup,s=e?.closest?.(".resume-modal");if(!e||!t||!s)return;let n=t.style.maxHeight;t.style.maxHeight="none";let i=t.scrollHeight;t.style.maxHeight=n;let r=window.visualViewport,o=r?r.offsetTop:0,a=r?r.height:window.innerHeight,l={top:o,bottom:o+a},c=s.getBoundingClientRect(),d=zm(e.getBoundingClientRect(),c,l,i);this.vpRosterPlacement=d.placement,this.vpRosterAvailableHeight=d.availableHeight},seedAgentDefault(){try{let e=this.agentOptions;if(!Array.isArray(e)||e.length===0||e.find(r=>r.id===this.form.agentId&&r.online))return;let s=this.chat,n=s&&s.currentAgent||null,i=e.find(r=>r.id===n&&r.online)||e.find(r=>r.online)||null;i&&(this.form.agentId=i.id)}catch{}},subscribeVpsFor(e){let t=this.chat;if(!t||typeof t.sendWsMessage!="function")return;let s=e||t.currentAgent||null;if(!s)return;let n=this.vpStore;n&&n.lastSnapshotAt>0&&n.lastVpSnapshotAgentId===s||t.sendWsMessage({type:"yeaft_vp_subscribe",agentId:s})},async loadRestoreCandidates(){if(this.restoreScanning)return;let e=(this.form.workDir||"").trim();if(!e){this.scannedSessions=[];return}let t=this.chat;if(!t||typeof t.sessionCrudRequest!="function"){this.restoreError=this.$t("yeaft.restore.modal.scanError",{message:"store unavailable"});return}let s=this.form.agentId||null;if(!s){this.scannedSessions=[],this.restoreError=this.$t("yeaft.restore.modal.scanError",{message:"no agent selected"});return}this.restoreScanning=!0,this.restoreError="";try{let n=await t.sessionCrudRequest("scan_workdir",{workDir:e},{agentId:s});if(n&&n.ok){let i=Array.isArray(n.sessions)?n.sessions:Array.isArray(n.groups)?n.groups:[];this.scannedSessions=i}else{this.scannedSessions=[];let i=n?.error?.message||n?.error?.code||"unknown";this.restoreError=this.$t("yeaft.restore.modal.scanError",{message:i})}}catch(n){this.scannedSessions=[],this.restoreError=this.$t("yeaft.restore.modal.scanError",{message:n?.message||String(n)})}finally{this.restoreScanning=!1}},async onRestoreClick(e){if(!e||!e.id||this.restoring)return;let t=this.chat;if(!t||typeof t.sessionCrudRequest!="function"){this.restoreError=this.$t("yeaft.restore.modal.restoreError",{message:"store unavailable"});return}let s=this.form.agentId||null;if(!s){this.restoreError=this.$t("yeaft.restore.modal.restoreError",{message:"no agent selected"});return}this.restoring=e.id,this.restoreError="";try{let n=await t.sessionCrudRequest("restore",{sessionId:e.id,workDir:(this.form.workDir||"").trim()},{agentId:s});if(n&&n.ok){let r=n.session||n.group||e,o=r&&r.agentId;o&&t.currentAgent!==o&&typeof t.selectAgent=="function"&&t.selectAgent(o),this.sessionsStore&&this.sessionsStore.setActive(r.id||e.id),typeof t.setActiveSessionFilter=="function"&&t.setActiveSessionFilter(r.id||e.id,{force:!0}),this.$emit("created",r),this.$emit("close");return}let i=n?.error?.message||n?.error?.code||"unknown";this.restoreError=this.$t("yeaft.restore.modal.restoreError",{message:i})}catch(n){this.restoreError=this.$t("yeaft.restore.modal.restoreError",{message:n?.message||String(n)})}finally{this.restoring=null}},applyDefaultSelection(){if(this.vpPickerTouched)return;let e=this.vpList||[];if(e.length===0)return;let t=e.map(o=>o&&o.vpId).filter(Boolean);if(t.length===0)return;let s=Array.isArray(this.form.vpIds)?this.form.vpIds:[],n=s.filter(o=>t.includes(o)),i=this.form.defaultVpId&&n.includes(this.form.defaultVpId);if(n.length>0&&i){n.length!==s.length&&(this.form.vpIds=n);return}let r=t.includes(ap)?ap:n[0]||t[0];this.form.vpIds=[r],this.form.defaultVpId=r},toggleVp(e,t){this.vpPickerTouched=!0,t?(this.form.vpIds.includes(e)||this.form.vpIds.push(e),this.form.defaultVpId||(this.form.defaultVpId=e)):(this.form.vpIds=this.form.vpIds.filter(s=>s!==e),this.form.defaultVpId&&!this.form.vpIds.includes(this.form.defaultVpId)&&(this.form.defaultVpId=this.form.vpIds[0]||null))},vpLabelFor(e){let t=this.vpStore?.vpLabel;return typeof t=="function"?t(e):e},vpDescriptionFor(e){let t=this.vpStore?.vpDescription;return typeof t=="function"?t(e):""},vpTextColorFor(e){let t=this.vpStore?.vpTextColor;return typeof t=="function"?t(e):"var(--text-primary)"},selectFolder(e){this.form.workDir=e},selectSession(e){!e||!e.id||(e.inSidebar?this.resumeExisting(e):this.onRestoreClick(e))},resumeExisting(e){if(!e||!e.id)return;let t=this.chat;e.agentId&&t&&t.currentAgent!==e.agentId&&typeof t.selectAgent=="function"&&t.selectAgent(e.agentId),this.sessionsStore&&this.sessionsStore.setActive(e.id),t&&typeof t.setActiveSessionFilter=="function"&&t.setActiveSessionFilter(e.id,{force:!0}),this.$emit("close")},handleOutsideRosterClick(e){if(!this.vpRosterOpen)return;let t=this.$refs.vpRosterRoot;t&&(t.contains(e.target)||this.closeVpRoster())},getLastPathSegment(e){return un(e)},formatDate(e){return _i(e,this.$t.bind(this))},onEsc(e){if(e.key==="Escape"&&!this.folderPickerOpen){if(this.vpRosterOpen){this.closeVpRoster();return}this.busy||this.requestClose()}},onOverlayClick(){this.busy||this.requestClose()},requestClose(){this.$emit("close")},folderPickerInitialDir(){return this.form.workDir||this.defaultWorkDir||""},folderPickerSetWorkDir(e){this.form.workDir=e},..._o,async onSubmit(){if(!(this.busy||!this.canSubmit)){this.submitError="",this.busy=!0;try{if(!this.chat||typeof this.chat.createYeaftSession!="function"){this.submitError=this.$t("yeaft.session.error.unknown",{message:"store unavailable"});return}let e=new Set((this.vpList||[]).map(d=>d&&d.vpId).filter(Boolean)),t=this.form.vpIds.filter(d=>e.has(d));if(t.length===0){this.submitError=this.$t("yeaft.session.error.unknown",{message:"no valid VP selected"});return}let s=this.form.defaultVpId&&t.includes(this.form.defaultVpId)?this.form.defaultVpId:t[0],i=this.form.name.trim()||un(this.form.workDir.trim())||this.$t("yeaft.session.create.untitled"),r=await this.chat.createYeaftSession({displayName:i,vpIds:t,defaultVpId:s,workDir:this.form.workDir.trim(),agentId:this.form.agentId||null});if(r&&r.ok){let d=this.chat,u=r.session||r.group||null,p=u&&u.id,f=u&&u.agentId;p&&(f&&d&&d.currentAgent!==f&&typeof d.selectAgent=="function"&&d.selectAgent(f),this.sessionsStore&&this.sessionsStore.setActive(p),d&&typeof d.setActiveSessionFilter=="function"&&d.setActiveSessionFilter(p,{force:!0})),this.$emit("created",u),this.$emit("close");return}let o=r?.error?.code||"unknown",a=r?.error?.message||"",l=`yeaft.session.error.${o}`,c=this.$t(l,{message:a});this.submitError=c===l?this.$t("yeaft.session.error.unknown",{message:a}):c}catch(e){this.submitError=this.$t("yeaft.session.error.unknown",{message:e?.message||String(e)})}finally{this.busy=!1}}}}}});function cp({sessions:e,activeSessionId:t,pinnedSessionIds:s,onlineAgentIds:n}={}){let i=t||null,r=Array.isArray(s)?s:[],o=Array.isArray(n)?new Set(n.filter(Boolean)):null,a=new Map;r.forEach((c,d)=>{typeof c=="string"&&c&&!a.has(c)&&a.set(c,d)});let l=[];for(let c of Array.isArray(e)?e:[]){if(!c||!c.id||o&&c.agentId&&!o.has(c.agentId))continue;let d=String(c.id);l.push({kind:"session",id:d,raw:c,pinned:!!c.pinned||!c.agentId&&a.has(d),active:d===i,processing:!!c.running||!!c.active||!!c.isRunning||!!c.isActive,_manualOrder:Number.isFinite(c.sortOrder)?c.sortOrder:Number.MAX_SAFE_INTEGER,_activityTime:Nn(c)})}return l.sort((c,d)=>{if(c.pinned!==d.pinned)return c.pinned?-1:1;if(c._manualOrder!==d._manualOrder)return c._manualOrder-d._manualOrder;if(c._activityTime!==d._activityTime)return d._activityTime-c._activityTime;let u=a.has(c.id)?a.get(c.id):Number.MAX_SAFE_INTEGER,p=a.has(d.id)?a.get(d.id):Number.MAX_SAFE_INTEGER;return u!==p?u-p:c.id.localeCompare(d.id)}),l.map(({_manualOrder:c,_activityTime:d,...u})=>u)}var dp=O(()=>{Bn()});var jm,Rk,up,pp=O(()=>{Vo();ko();So();Co();Io();Lo();dp();jm=3600*1e3,Rk=24*jm,up={name:"YeaftSidebar",components:{SessionCreateModal:Ei,SidebarModeToggle:ki,SidebarAgentHeader:Si,SidebarWorkCenter:Ci,SessionSidebarShell:Ii},emits:["select-group","select-chat","toggle-sidebar","back","open-settings","open-group-settings"],template:`
|
|
6247
|
+
`,data(){return{form:{name:"",vpIds:[],defaultVpId:null,workDir:"",agentId:null},busy:!1,submitError:"",...Do(),vpPickerTouched:!1,vpRosterOpen:!1,vpRosterPlacement:"down",vpRosterAvailableHeight:null,scannedSessions:[],restoreScanning:!1,restoring:null,restoreError:""}},computed:{chat(){try{if(typeof window<"u"&&window.Pinia?.useChatStore)return window.Pinia.useChatStore()}catch{}return null},vpStore(){try{if(typeof window<"u"&&window.Pinia?.useVpStore)return window.Pinia.useVpStore()}catch{}return null},sessionsStore(){try{if(typeof window<"u"&&window.Pinia?.useSessionsStore)return window.Pinia.useSessionsStore()}catch{}return null},vpList(){return this.vpStore?.vpList||[]},vpDomainSections(){return Kt(this.vpList)},vpListSignature(){return(this.vpList||[]).map(e=>e&&e.vpId).filter(Boolean).join(",")},vpLibraryEmpty(){let e=this.vpStore;return e?e.emptyLibrary===!0?!0:!!(e.lastSnapshotAt&&e.lastSnapshotAt>0&&(e.vpOrder?.length||0)===0):!1},agentOptions(){let e=this.chat;return!e||!Array.isArray(e.agents)?[]:e.agents.map(t=>({id:t.id,name:t.name,online:!!t.online,workDir:t.workDir||""}))},agentSignature(){return this.agentOptions.map(e=>`${e.id}:${e.online?1:0}`).join(",")},folderPickerAgentId(){return this.form.agentId||this.chat?.currentAgent||""},defaultWorkDir(){return this.agentOptions.find(t=>t.id===this.form.agentId)?.workDir||this.chat?.currentAgentInfo?.workDir||""},workDirPlaceholder(){return this.defaultWorkDir||this.$t("modal.newConv.inputOrSelect")},allSessions(){return this.sessionsStore?.sessionList||[]},agentSessions(){let e=this.form.agentId||null;return e?this.allSessions.filter(t=>{let s=t&&t.agentId;return!s||s===e}):this.allSessions},folderAggregates(){let e=new Map;for(let t of this.agentSessions){let s=t&&typeof t.workDir=="string"?t.workDir.trim():"";if(!s)continue;let n=e.get(s)||{path:s,count:0};n.count+=1,e.set(s,n)}return Array.from(e.values()).sort((t,s)=>t.path.localeCompare(s.path))},sessionsInDir(){let e=new Set((this.sessionsStore?.sessionList||[]).map(s=>s&&s.id).filter(Boolean));return(Array.isArray(this.scannedSessions)?this.scannedSessions:[]).filter(s=>s&&s.id).map(s=>({...s,inSidebar:e.has(s.id)}))},canSubmit(){if(this.form.vpIds.length===0||!this.form.agentId)return!1;let e=this.agentOptions.find(t=>t.id===this.form.agentId);return!!(e&&e.online)},vpRosterSummary(){let e=this.form.vpIds||[];return e.length===0?this.$t("yeaft.session.create.vpNone"):e.length<=3?e.map(t=>this.vpLabelFor(t)).join(this.$t("common.comma")):this.$t("yeaft.session.create.vpCount",{n:e.length})},vpRosterPopupStyle(){return Number.isFinite(this.vpRosterAvailableHeight)?{"--vp-roster-available-height":`${this.vpRosterAvailableHeight}px`}:{}}},mounted(){window.addEventListener("keydown",this.onEsc),window.addEventListener("resize",this.scheduleVpRosterLayout),window.visualViewport?.addEventListener("resize",this.scheduleVpRosterLayout),window.visualViewport?.addEventListener("scroll",this.scheduleVpRosterLayout),window.addEventListener("workbench-message",this.handleFolderPickerMessage),document.addEventListener("click",this.handleOutsideRosterClick,!0),this.seedAgentDefault(),this.subscribeVpsFor(this.form.agentId),this.applyDefaultSelection()},watch:{vpListSignature(){this.applyDefaultSelection(),this.scheduleVpRosterLayout()},agentSignature(){this.seedAgentDefault(),this.scheduleVpRosterLayout()},"form.agentId"(e,t){e!==t&&(this.subscribeVpsFor(e),this.form.vpIds=[],this.form.defaultVpId=null,this.vpPickerTouched=!1,this.applyDefaultSelection(),this.scannedSessions=[],this.restoreError="",(this.form.workDir||"").trim()&&this.loadRestoreCandidates())},"form.workDir"(e,t){e===t||(this.restoreError="",this.scannedSessions=[],!(e||"").trim())||this.loadRestoreCandidates()}},beforeUnmount(){window.removeEventListener("keydown",this.onEsc),window.removeEventListener("resize",this.scheduleVpRosterLayout),window.visualViewport?.removeEventListener("resize",this.scheduleVpRosterLayout),window.visualViewport?.removeEventListener("scroll",this.scheduleVpRosterLayout),window.removeEventListener("workbench-message",this.handleFolderPickerMessage),document.removeEventListener("click",this.handleOutsideRosterClick,!0),this._vpRosterLayoutFrame&&cancelAnimationFrame(this._vpRosterLayoutFrame),this._folderPickerTimer&&clearTimeout(this._folderPickerTimer)},methods:{toggleVpRoster(){if(this.vpRosterOpen){this.closeVpRoster();return}this.vpRosterPlacement="down",this.vpRosterAvailableHeight=null,this.vpRosterOpen=!0,this.$nextTick(this.scheduleVpRosterLayout)},closeVpRoster(){this.vpRosterOpen=!1,this.vpRosterAvailableHeight=null},scheduleVpRosterLayout(){!this.vpRosterOpen||this._vpRosterLayoutFrame||(this._vpRosterLayoutFrame=requestAnimationFrame(()=>{this._vpRosterLayoutFrame=null,this.updateVpRosterLayout()}))},updateVpRosterLayout(){if(!this.vpRosterOpen)return;let e=this.$refs.vpRosterTrigger,t=this.$refs.vpRosterPopup,s=e?.closest?.(".resume-modal");if(!e||!t||!s)return;let n=t.style.maxHeight;t.style.maxHeight="none";let i=t.scrollHeight;t.style.maxHeight=n;let r=window.visualViewport,o=r?r.offsetTop:0,a=r?r.height:window.innerHeight,l={top:o,bottom:o+a},c=s.getBoundingClientRect(),d=jm(e.getBoundingClientRect(),c,l,i);this.vpRosterPlacement=d.placement,this.vpRosterAvailableHeight=d.availableHeight},seedAgentDefault(){try{let e=this.agentOptions;if(!Array.isArray(e)||e.length===0||e.find(r=>r.id===this.form.agentId&&r.online))return;let s=this.chat,n=s&&s.currentAgent||null,i=e.find(r=>r.id===n&&r.online)||e.find(r=>r.online)||null;i&&(this.form.agentId=i.id)}catch{}},subscribeVpsFor(e){let t=this.chat;if(!t||typeof t.sendWsMessage!="function")return;let s=e||t.currentAgent||null;if(!s)return;let n=this.vpStore;n&&n.lastSnapshotAt>0&&n.lastVpSnapshotAgentId===s||t.sendWsMessage({type:"yeaft_vp_subscribe",agentId:s})},async loadRestoreCandidates(){if(this.restoreScanning)return;let e=(this.form.workDir||"").trim();if(!e){this.scannedSessions=[];return}let t=this.chat;if(!t||typeof t.sessionCrudRequest!="function"){this.restoreError=this.$t("yeaft.restore.modal.scanError",{message:"store unavailable"});return}let s=this.form.agentId||null;if(!s){this.scannedSessions=[],this.restoreError=this.$t("yeaft.restore.modal.scanError",{message:"no agent selected"});return}this.restoreScanning=!0,this.restoreError="";try{let n=await t.sessionCrudRequest("scan_workdir",{workDir:e},{agentId:s});if(n&&n.ok){let i=Array.isArray(n.sessions)?n.sessions:Array.isArray(n.groups)?n.groups:[];this.scannedSessions=i}else{this.scannedSessions=[];let i=n?.error?.message||n?.error?.code||"unknown";this.restoreError=this.$t("yeaft.restore.modal.scanError",{message:i})}}catch(n){this.scannedSessions=[],this.restoreError=this.$t("yeaft.restore.modal.scanError",{message:n?.message||String(n)})}finally{this.restoreScanning=!1}},async onRestoreClick(e){if(!e||!e.id||this.restoring)return;let t=this.chat;if(!t||typeof t.sessionCrudRequest!="function"){this.restoreError=this.$t("yeaft.restore.modal.restoreError",{message:"store unavailable"});return}let s=this.form.agentId||null;if(!s){this.restoreError=this.$t("yeaft.restore.modal.restoreError",{message:"no agent selected"});return}this.restoring=e.id,this.restoreError="";try{let n=await t.sessionCrudRequest("restore",{sessionId:e.id,workDir:(this.form.workDir||"").trim()},{agentId:s});if(n&&n.ok){let r=n.session||n.group||e,o=r&&r.agentId;o&&t.currentAgent!==o&&typeof t.selectAgent=="function"&&t.selectAgent(o),this.sessionsStore&&this.sessionsStore.setActive(r.id||e.id),typeof t.setActiveSessionFilter=="function"&&t.setActiveSessionFilter(r.id||e.id,{force:!0}),this.$emit("created",r),this.$emit("close");return}let i=n?.error?.message||n?.error?.code||"unknown";this.restoreError=this.$t("yeaft.restore.modal.restoreError",{message:i})}catch(n){this.restoreError=this.$t("yeaft.restore.modal.restoreError",{message:n?.message||String(n)})}finally{this.restoring=null}},applyDefaultSelection(){if(this.vpPickerTouched)return;let e=this.vpList||[];if(e.length===0)return;let t=e.map(o=>o&&o.vpId).filter(Boolean);if(t.length===0)return;let s=Array.isArray(this.form.vpIds)?this.form.vpIds:[],n=s.filter(o=>t.includes(o)),i=this.form.defaultVpId&&n.includes(this.form.defaultVpId);if(n.length>0&&i){n.length!==s.length&&(this.form.vpIds=n);return}let r=t.includes(ap)?ap:n[0]||t[0];this.form.vpIds=[r],this.form.defaultVpId=r},toggleVp(e,t){this.vpPickerTouched=!0,t?(this.form.vpIds.includes(e)||this.form.vpIds.push(e),this.form.defaultVpId||(this.form.defaultVpId=e)):(this.form.vpIds=this.form.vpIds.filter(s=>s!==e),this.form.defaultVpId&&!this.form.vpIds.includes(this.form.defaultVpId)&&(this.form.defaultVpId=this.form.vpIds[0]||null))},vpLabelFor(e){let t=this.vpStore?.vpLabel;return typeof t=="function"?t(e):e},vpDescriptionFor(e){let t=this.vpStore?.vpDescription;return typeof t=="function"?t(e):""},vpTextColorFor(e){let t=this.vpStore?.vpTextColor;return typeof t=="function"?t(e):"var(--text-primary)"},selectFolder(e){this.form.workDir=e},selectSession(e){!e||!e.id||(e.inSidebar?this.resumeExisting(e):this.onRestoreClick(e))},resumeExisting(e){if(!e||!e.id)return;let t=this.chat;e.agentId&&t&&t.currentAgent!==e.agentId&&typeof t.selectAgent=="function"&&t.selectAgent(e.agentId),this.sessionsStore&&this.sessionsStore.setActive(e.id),t&&typeof t.setActiveSessionFilter=="function"&&t.setActiveSessionFilter(e.id,{force:!0}),this.$emit("close")},handleOutsideRosterClick(e){if(!this.vpRosterOpen)return;let t=this.$refs.vpRosterRoot;t&&(t.contains(e.target)||this.closeVpRoster())},getLastPathSegment(e){return un(e)},formatDate(e){return _i(e,this.$t.bind(this))},onEsc(e){if(e.key==="Escape"&&!this.folderPickerOpen){if(this.vpRosterOpen){this.closeVpRoster();return}this.busy||this.requestClose()}},onOverlayClick(){this.busy||this.requestClose()},requestClose(){this.$emit("close")},folderPickerInitialDir(){return this.form.workDir||this.defaultWorkDir||""},folderPickerSetWorkDir(e){this.form.workDir=e},..._o,async onSubmit(){if(!(this.busy||!this.canSubmit)){this.submitError="",this.busy=!0;try{if(!this.chat||typeof this.chat.createYeaftSession!="function"){this.submitError=this.$t("yeaft.session.error.unknown",{message:"store unavailable"});return}let e=new Set((this.vpList||[]).map(d=>d&&d.vpId).filter(Boolean)),t=this.form.vpIds.filter(d=>e.has(d));if(t.length===0){this.submitError=this.$t("yeaft.session.error.unknown",{message:"no valid VP selected"});return}let s=this.form.defaultVpId&&t.includes(this.form.defaultVpId)?this.form.defaultVpId:t[0],i=this.form.name.trim()||un(this.form.workDir.trim())||this.$t("yeaft.session.create.untitled"),r=await this.chat.createYeaftSession({displayName:i,vpIds:t,defaultVpId:s,workDir:this.form.workDir.trim(),agentId:this.form.agentId||null});if(r&&r.ok){let d=this.chat,u=r.session||r.group||null,p=u&&u.id,f=u&&u.agentId;p&&(f&&d&&d.currentAgent!==f&&typeof d.selectAgent=="function"&&d.selectAgent(f),this.sessionsStore&&this.sessionsStore.setActive(p),d&&typeof d.setActiveSessionFilter=="function"&&d.setActiveSessionFilter(p,{force:!0})),this.$emit("created",u),this.$emit("close");return}let o=r?.error?.code||"unknown",a=r?.error?.message||"",l=`yeaft.session.error.${o}`,c=this.$t(l,{message:a});this.submitError=c===l?this.$t("yeaft.session.error.unknown",{message:a}):c}catch(e){this.submitError=this.$t("yeaft.session.error.unknown",{message:e?.message||String(e)})}finally{this.busy=!1}}}}}});function cp({sessions:e,activeSessionId:t,pinnedSessionIds:s,onlineAgentIds:n}={}){let i=t||null,r=Array.isArray(s)?s:[],o=Array.isArray(n)?new Set(n.filter(Boolean)):null,a=new Map;r.forEach((c,d)=>{typeof c=="string"&&c&&!a.has(c)&&a.set(c,d)});let l=[];for(let c of Array.isArray(e)?e:[]){if(!c||!c.id||o&&c.agentId&&!o.has(c.agentId))continue;let d=String(c.id);l.push({kind:"session",id:d,raw:c,pinned:!!c.pinned||!c.agentId&&a.has(d),active:d===i,processing:!!c.running||!!c.active||!!c.isRunning||!!c.isActive,_manualOrder:Number.isFinite(c.sortOrder)?c.sortOrder:Number.MAX_SAFE_INTEGER,_activityTime:Nn(c)})}return l.sort((c,d)=>{if(c.pinned!==d.pinned)return c.pinned?-1:1;if(c._manualOrder!==d._manualOrder)return c._manualOrder-d._manualOrder;if(c._activityTime!==d._activityTime)return d._activityTime-c._activityTime;let u=a.has(c.id)?a.get(c.id):Number.MAX_SAFE_INTEGER,p=a.has(d.id)?a.get(d.id):Number.MAX_SAFE_INTEGER;return u!==p?u-p:c.id.localeCompare(d.id)}),l.map(({_manualOrder:c,_activityTime:d,...u})=>u)}var dp=O(()=>{Bn()});var Km,$k,up,pp=O(()=>{Vo();ko();So();Co();Io();Lo();dp();Km=3600*1e3,$k=24*Km,up={name:"YeaftSidebar",components:{SessionCreateModal:Ei,SidebarModeToggle:ki,SidebarAgentHeader:Si,SidebarWorkCenter:Ci,SessionSidebarShell:Ii},emits:["select-group","select-chat","toggle-sidebar","back","open-settings","open-group-settings"],template:`
|
|
6248
6248
|
<SessionSidebarShell class="yeaft-sidebar" :collapsed="collapsed">
|
|
6249
6249
|
<template #collapsed>
|
|
6250
6250
|
<!-- Collapsed Icon Bar \u2014 mirrors Chat's .sidebar-collapsed-bar so the
|
|
@@ -6426,7 +6426,7 @@ ${String(e||"").trim()}
|
|
|
6426
6426
|
</div>
|
|
6427
6427
|
</div>
|
|
6428
6428
|
</div>
|
|
6429
|
-
`,mounted(){window.addEventListener("keydown",this.onEsc)},beforeUnmount(){window.removeEventListener("keydown",this.onEsc)},methods:{onEsc(e){e.key==="Escape"&&this.onDismiss()},onOpen(){this.$emit("open-library")},onDismiss(){this.$emit("dismiss")}}}});function Fo(e){return e==="members"||e==="memory"||e===_t?e:(
|
|
6429
|
+
`,mounted(){window.addEventListener("keydown",this.onEsc)},beforeUnmount(){window.removeEventListener("keydown",this.onEsc)},methods:{onEsc(e){e.key==="Escape"&&this.onDismiss()},onOpen(){this.$emit("open-library")},onDismiss(){this.$emit("dismiss")}}}});function Fo(e){return e==="members"||e==="memory"||e===_t?e:(Gm.has(e),_t)}var _t,Gm,mp,hp=O(()=>{Yt();on();_t="session",Gm=new Set(["announcement","rename","danger"]);mp={name:"SessionSettingsModal",emits:["close","open-vp-library"],props:{groupId:{type:String,required:!0},agentId:{type:String,default:null},initialSection:{type:String,default:_t,validator:e=>[_t,"announcement","members","rename","memory","danger"].includes(e)},initialEditVpId:{type:String,default:""}},data(){return{section:this.initialEditVpId?"members":Fo(this.initialSection),announcementDraft:"",announcementBusy:!1,announcementError:"",renameDraft:"",renameBusy:!1,renameError:"",membersBusy:!1,membersError:"",highlightedVpId:this.initialEditVpId||"",deleteConfirmText:"",deleteBusy:!1,deleteError:""}},computed:{chat(){try{return window.Pinia?.useChatStore?.()||null}catch{return null}},vpStore(){try{return window.Pinia?.useVpStore?.()||null}catch{return null}},sessionsStore(){try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}},group(){let e=this.sessionsStore,t=this.agentId||this.chat?.currentAgent||null;return e&&typeof e.sessionById=="function"?e.sessionById(this.groupId,t):null},targetAgentId(){return this.agentId||this.group?.agentId||this.chat?.currentAgent||null},groupDisplayName(){let e=this.group;return e?e.id==="grp_default"&&(e.name==="Default"||!e.name)?this.$t("yeaft.session.defaultName")||e.name||e.id:e.name||e.id:""},announcement(){return this.group&&typeof this.group.announcement=="string"?this.group.announcement:""},roster(){return this.group&&Array.isArray(this.group.roster)?this.group.roster:[]},defaultVpId(){return this.group&&this.group.defaultVpId||null},vpList(){return this.vpStore?.vpList||[]},vpDomainSections(){return Kt(this.vpList)},vpLibraryEmpty(){let e=this.vpStore;return e?e.emptyLibrary===!0?!0:!!(e.lastSnapshotAt&&e.lastSnapshotAt>0&&(e.vpOrder?.length||0)===0):!1},deleteConfirmReady(){return this.deleteConfirmText.trim()===this.groupDisplayName},sections(){return[{id:_t,label:this.$t("yeaft.session.settings.nav.session")},{id:"members",label:this.$t("yeaft.session.settings.nav.members")},{id:"memory",label:this.$t("yeaft.session.settings.nav.memory")}]},groupDreamStatus(){let e=this.vpStore;return e?e.groupDreamStatusFor(this.groupId):{status:"idle",lastRunAt:null,lastResult:null,lastError:null}},dreamRunning(){return this.groupDreamStatus.status==="running"}},watch:{section(e){e===_t&&(this.announcementDraft=this.announcement,this.renameDraft=this.groupDisplayName),this.announcementError="",this.renameError="",this.membersError="",this.deleteError="",this.deleteConfirmText=""},initialEditVpId(e){this.highlightedVpId=e||"",e&&(this.section="members")},initialSection(e){this.initialEditVpId||(this.section=Fo(e))},groupId(){this.section=this.initialEditVpId?"members":Fo(this.initialSection),this.highlightedVpId=this.initialEditVpId||"",this.announcementDraft=this.announcement,this.renameDraft=this.groupDisplayName,this.deleteConfirmText="",this.announcementError="",this.renameError="",this.membersError="",this.deleteError=""},group(e,t){t&&!e&&!this.deleteBusy&&this.requestClose()}},mounted(){window.addEventListener("keydown",this.onEsc);try{if(this.vpStore&&this.vpStore.lastSnapshotAt===0){let e=this.chat;e&&typeof e.sendWsMessage=="function"&&e.sendWsMessage({type:"yeaft_vp_subscribe"})}}catch{}this.section===_t&&(this.announcementDraft=this.announcement,this.renameDraft=this.groupDisplayName)},beforeUnmount(){window.removeEventListener("keydown",this.onEsc)},methods:{trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,onEsc(e){e.key==="Escape"&&(this.announcementBusy||this.renameBusy||this.membersBusy||this.deleteBusy||this.requestClose())},onOverlayClick(e){Ze(e)&&(this.announcementBusy||this.renameBusy||this.membersBusy||this.deleteBusy||this.requestClose())},requestClose(){this.$emit("close")},selectSection(e){e!==this.section&&(this.section=e)},async saveAnnouncement(){if(!(this.announcementBusy||!this.chat)){this.announcementBusy=!0,this.announcementError="";try{let e=await this.chat.sessionCrudRequest("update",{sessionId:this.groupId,patch:{announcement:this.announcementDraft}},{agentId:this.targetAgentId});if(!e||!e.ok){let t=e&&e.error&&e.error.code||"unknown",s=e&&e.error&&e.error.message||t;this.announcementError=this.$t("yeaft.session.announcement.saveFailed",{error:s})}}finally{this.announcementBusy=!1}}},async saveRename(){let e=(this.renameDraft||"").trim();if(!(!e||this.renameBusy||!this.chat)){this.renameBusy=!0,this.renameError="";try{let t=await this.chat.sessionCrudRequest("rename",{sessionId:this.groupId,name:e},{agentId:this.targetAgentId});if(!t||!t.ok){let s=t&&t.error&&t.error.code||"unknown",n=t&&t.error&&t.error.message||s;this.renameError=this.$t("yeaft.session.error.unknown",{message:n})}}finally{this.renameBusy=!1}}},isMember(e){return this.roster.includes(e)},vpLabelFor(e){let t=this.vpStore?.vpLabel;return typeof t=="function"?t(e):e},vpDescriptionFor(e){let t=this.vpStore?.vpDescription;return typeof t=="function"?t(e):""},vpTextColorFor(e){let t=this.vpStore?.vpTextColor;return typeof t=="function"?t(e):"var(--vp-avatar-rat-fg)"},async toggleMember(e,t){if(!(this.membersBusy||!this.chat)){this.membersBusy=!0,this.membersError="";try{let s=t?"add_member":"remove_member",n=await this.chat.sessionCrudRequest(s,{sessionId:this.groupId,vpId:e},{agentId:this.targetAgentId});if(!n||!n.ok){let i=n&&n.error&&n.error.code||"unknown",r=n&&n.error&&n.error.message||i;this.membersError=this.$t("yeaft.session.members.actionFailed",{error:r})}else if(s==="add_member"&&!this.defaultVpId){let i=await this.chat.sessionCrudRequest("set_default_vp",{sessionId:this.groupId,vpId:e},{agentId:this.targetAgentId});if(i&&!i.ok){let r=i.error&&i.error.code||"unknown",o=i.error&&i.error.message||r;this.membersError=this.$t("yeaft.session.members.actionFailed",{error:o})}}}finally{this.membersBusy=!1}}},async setDefault(e){if(!(this.membersBusy||!this.chat||this.defaultVpId===e)){this.membersBusy=!0,this.membersError="";try{let t=await this.chat.sessionCrudRequest("set_default_vp",{sessionId:this.groupId,vpId:e},{agentId:this.targetAgentId});if(!t||!t.ok){let s=t&&t.error&&t.error.code||"unknown",n=t&&t.error&&t.error.message||s;this.membersError=this.$t("yeaft.session.members.actionFailed",{error:n})}}finally{this.membersBusy=!1}}},runDream(){!this.vpStore||this.dreamRunning||this.vpStore.triggerGroupDream(this.groupId,{agentId:this.targetAgentId})},formatDreamTimestamp(e){if(!e)return"";try{return new Date(e).toLocaleString()}catch{return""}},async confirmDelete(){if(!(!this.deleteConfirmReady||this.deleteBusy||!this.chat)){this.deleteBusy=!0,this.deleteError="";try{let e=await this.chat.sessionCrudRequest("delete",{sessionId:this.groupId},{agentId:this.targetAgentId});if(!e||!e.ok){let t=e&&e.error&&e.error.code||"unknown",s=e&&e.error&&e.error.message||t;this.deleteError=this.$t("yeaft.session.error.unknown",{message:s});return}this.requestClose()}finally{this.deleteBusy=!1}}}},template:`
|
|
6430
6430
|
<Teleport to="body">
|
|
6431
6431
|
<div
|
|
6432
6432
|
class="group-settings-overlay"
|
|
@@ -6640,13 +6640,13 @@ ${String(e||"").trim()}
|
|
|
6640
6640
|
</div>
|
|
6641
6641
|
</div>
|
|
6642
6642
|
</Teleport>
|
|
6643
|
-
`}});function
|
|
6644
|
-
`).includes(s)):Array.isArray(e)?e:[]}function kp({latest:e={},snapshots:t={},promptLoads:s={},events:n=[],sessionTitles:i={}}={}){let r=new Set([...Object.keys(e||{}),...Object.keys(t||{}),...Object.keys(s||{})]);for(let o of Array.isArray(n)?n:[])o?.scope&&r.add(o.scope);return Array.from(r).map(o=>{let a=t?.[o]||null,l=e?.[o]||null,c=a?.lastError||l?.error||null,d=l?.status||(c?"error":a?.hasOutput?"completed":"never-ran"),u=s?.[o]||null,p=(Array.isArray(n)?n:[]).filter(
|
|
6643
|
+
`}});function Ym(e){let t=String(e||"").trim();return t?t.startsWith("[")&&t.endsWith("]")?vp(t.slice(1,-1)).map(s=>s.trim().replace(/^["']|["']$/g,"")).map(s=>yp(s)).filter(Boolean):vp(t).map(s=>yp(s.trim())).filter(Boolean):[]}function vp(e){let t=[],s="",n=0,i="",r=!1;for(let o of String(e||"")){if(r){s+=o,r=!1;continue}if(o==="\\"&&i){s+=o,r=!0;continue}if(i){s+=o,o===i&&(i="");continue}if(o==='"'||o==="'"){i=o,s+=o;continue}if((o==="{"||o==="[")&&(n+=1),(o==="}"||o==="]")&&n>0&&(n-=1),o===","&&n===0){s.trim()&&t.push(s.trim()),s="";continue}s+=o}return s.trim()&&t.push(s.trim()),t}function yp(e){let t=String(e||"").trim();if(!t||t==="[object Object]")return"";if(t.startsWith("{")&&t.endsWith("}"))try{let s=JSON.parse(t);return String(s.id||s.messageId||s.uuid||"").trim()}catch{return""}return t}function Qm(e){let t={},s=String(e||"").split(/\r?\n/);for(let n of s){let i=n.match(/^([A-Za-z][A-Za-z0-9_-]*):\s*(.*)$/);if(!i)continue;let r=i[1],o=i[2].trim();r==="tags"||r==="sourceMessages"?t[r]=Ym(o):t[r]=o.replace(/^["']|["']$/g,"")}return t}function Xm(e){let t=String(e||"").trim();if(!t)return[];let s=[],n=/(?:^|\n)---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*?)(?=\n---\s*\n|$)/g;for(let i of t.matchAll(n)){let r=i[1].trim(),o=i[2].trim(),a=Qm(r);s.push({id:a.id||`segment-${s.length+1}`,scope:a.scope||"",kind:a.kind||"memory",tags:Array.isArray(a.tags)?a.tags:[],sourceMessages:Array.isArray(a.sourceMessages)?a.sourceMessages:[],createdAt:a.createdAt||"",updatedAt:a.updatedAt||"",content:o,preview:xs(o,180)})}return s.length?s:[{id:"memory-1",scope:"",kind:"raw",tags:[],sourceMessages:[],createdAt:"",updatedAt:"",content:t,preview:xs(t,180)}]}function xs(e,t=160){let s=String(e||"").replace(/\s+/g," ").trim();return s.length<=t?s:`${s.slice(0,t).trim()}...`}function Zm(e){let t=String(e||"").trim();return t?(t.split(/\r?\n/).map(n=>n.trim()).find(Boolean)||"").replace(/^#+\s*/,"").replace(/^[-*]\s*/,"").trim():""}function Jm(e){return String(e||"").replace(/\s+/g," ").trim()}function bp(e,t){return t?.sessionId||String(e||"").replace(/^sessions\//,"")}function eh(e,t,s){let n=bp(e,t);return Jm(s?.[e]||s?.[n]||t?.sessionTitle||t?.title||t?.name||Zm(t?.summaryText))||n||e}function wp(e,t){let s=String(t||"").trim().toLowerCase();return s?(Array.isArray(e)?e:[]).filter(n=>[n.title,n.scope,n.sessionId,n.status,n.summaryPreview,n.snapshot?.summaryText].map(r=>String(r||"").toLowerCase()).join(`
|
|
6644
|
+
`).includes(s)):Array.isArray(e)?e:[]}function kp({latest:e={},snapshots:t={},promptLoads:s={},events:n=[],sessionTitles:i={}}={}){let r=new Set([...Object.keys(e||{}),...Object.keys(t||{}),...Object.keys(s||{})]);for(let o of Array.isArray(n)?n:[])o?.scope&&r.add(o.scope);return Array.from(r).map(o=>{let a=t?.[o]||null,l=e?.[o]||null,c=a?.lastError||l?.error||null,d=l?.status||(c?"error":a?.hasOutput?"completed":"never-ran"),u=s?.[o]||null,p=(Array.isArray(n)?n:[]).filter(y=>y?.scope===o),f=p[p.length-1]||null,g=l?.finishedAt||l?.startedAt||a?.lastDreamAt||f?.at||a?.loadedAt||"",b=Xm(a?.memoryText||""),h=bp(o,a),A=eh(o,a,i),x=c?xs(c.message||c.error||c.raw||"",180):"",k=xs(x||a?.summaryText||a?.memoryText||f?.detail||"",180);return{key:o,title:A,scope:o,sessionId:h,status:d,lastAt:g,latestRun:l,snapshot:a,lastError:c,promptLoad:u,events:p,segmentCount:b.length,segments:b,summaryPreview:k,subtitle:k,hasRequestResponse:p.some(y=>y?.request||y?.response||y?.systemPrompt||y?.rawRequest||y?.rawResponse)}}).sort((o,a)=>String(a.lastAt||"").localeCompare(String(o.lastAt||"")))}var Sp=O(()=>{});var Ri,th,Cp,Ip=O(()=>{Sp();vr();Ri=1,th=5,Cp={name:"YeaftDebugPanel",emits:["close"],data(){return{expandedTurns:{},expandedLoops:{},expandedSections:{},expandedToolDetails:{},copiedFlash:null,copiedFlashAt:0,_expandSnapshot:null,dreamExpanded:!1,expandedDreamEvents:{},expandedDreamSegments:{},activeDreamItemKey:null,dreamItemSearch:"",activeTab:"requests"}},watch:{searchQuery(e,t){let s=!!(t&&t.trim()),n=!!(e&&e.trim());if(!s&&n){this._expandSnapshot={turns:{...this.expandedTurns},loops:{...this.expandedLoops}};let i={},r={};for(let o of this.turns)i[o.turnId]=!0,o.loops&&o.loops.length>0&&(r[`${o.turnId}#${o.loops[0].loopNumber}`]=!0);this.expandedTurns=i,this.expandedLoops=r}else if(s&&!n&&this._expandSnapshot)this.expandedTurns=this._expandSnapshot.turns,this.expandedLoops=this._expandSnapshot.loops,this._expandSnapshot=null;else if(n){let i={...this.expandedTurns};for(let r of this.turns)i[r.turnId]===void 0&&(i[r.turnId]=!0);this.expandedTurns=i}},"store.currentAgent"(e,t){e&&e!==t&&this.store&&typeof this.store.loadYeaftDebugHistory=="function"&&this.store.loadYeaftDebugHistory({limit:Ri,dreamLimit:5,indexOnly:!0})}},computed:{store(){return window.Pinia?.useChatStore?.()||null},sessionsStore(){return window.Pinia?.useSessionsStore?.()||null},turns(){return(this.store&&this.store.yeaftDebugTurnsForActiveSession||[]).map(t=>this.decorateTurnTokenBreakdowns(t))},searchQuery:{get(){return this.store&&this.store.yeaftDebugSearch||""},set(e){this.store&&this.store.setYeaftDebugSearch(e)}},sessionFilter:{get(){if(!this.store)return"";let e=this.store.yeaftDebugSessionFilter;return e??""},set(e){this.store&&(e?this.store.setYeaftDebugSessionFilter(e):this.store.setYeaftDebugSessionFilter(null))}},availableSessions(){return this.store&&this.store.yeaftDebugAvailableSessions||[]},turnTotal(){return this.store&&this.store.yeaftDebugTurnTotal||0},showingMatchedHint(){return this.turnTotal>this.turns.length},requestHistoryLoading(){return!!this.store?.yeaftDebugHistoryLoading},requestHistoryError(){return this.store?.yeaftDebugHistoryError||""},toolStats(){return this.store?.yeaftToolStats||null},toolStatsLoading(){return!!this.store?.yeaftToolStatsLoading},rankedToolRows(){let e=this.toolStats?.snapshot||{},t=Object.entries(e).map(([i,r])=>({name:i,...r})),s=new Set(t.map(i=>i.name)),n=Array.isArray(this.toolStats?.registered)?this.toolStats.registered:[];for(let i of n)typeof i!="string"||!i||s.has(i)||(t.push({name:i,callCount:0,errorCount:0,errorRate:0,avgMs:0,p50Ms:0,p95Ms:0,lastCalledAt:null,lastError:null}),s.add(i));return t.sort((i,r)=>{let o=(r.callCount||0)-(i.callCount||0);return o!==0?o:i.name.localeCompare(r.name)}),t},unusedToolRows(){return Array.isArray(this.toolStats?.unused)?this.toolStats.unused:[]},toolStatsFetchedAtLabel(){let e=this.toolStats?.fetchedAt;if(!e)return"";try{return new Date(e).toLocaleTimeString()}catch{return""}},dreamLatest(){return this.store&&this.store.yeaftDreamLatestForActiveSession||null},dreamLatestLabel(){let e=this.dreamLatest;if(!e)return"";if(e.status==="running")return`running \xB7 ${e.phase||"..."}`;if(e.status==="error")return`error \xB7 ${e.error||"unknown"}`;if(e.status==="skipped")return"skipped";let t=["done"];typeof e.mergedCount=="number"&&t.push(`merged ${e.mergedCount}`);let s=this.formatDreamMetrics(e);return s&&t.push(s),t.join(" \xB7 ")},dreamLatestKindLabel(){let e=this.dreamLatest;return e?e.manual?"manual":"auto":""},dreamSnapshot(){return this.store&&this.store.yeaftDreamSnapshotForActiveSession||null},dreamPromptLoad(){return this.store&&this.store.yeaftDreamPromptLoadForActiveSession||null},dreamPromptLoadSummary(){let e=this.dreamPromptLoad,t=e&&typeof e.summary=="string"?e.summary.trim():"";return t&&e.truncated?`${t}
|
|
6645
6645
|
... truncated`:t},dreamSnapshotSummary(){let e=this.dreamSnapshot,t=e&&typeof e.summaryText=="string"?e.summaryText.trim():"";return t&&e.summaryTruncated?`${t}
|
|
6646
6646
|
... truncated`:t},dreamSnapshotMemory(){let e=this.dreamSnapshot,t=e&&typeof e.memoryText=="string"?e.memoryText.trim():"";return t&&e.memoryTruncated?`${t}
|
|
6647
6647
|
... truncated`:t},dreamEvents(){let e=this.store&&this.store.yeaftDreamEventsForActiveSession||[];return Array.isArray(e)?e:[]},dreamEventCount(){return this.dreamEvents.length},dreamSessionTitles(){let e={},t=(i,r)=>{let o=String(r||"").trim();i&&o&&(e[i]=o)},s=this.sessionsStore?.sessions||{};for(let i of Object.values(s))!i||!i.id||(t(i.id,i.name||i.title),t(`sessions/${i.id}`,i.name||i.title));let n=this.store?.yeaftActiveSessionFilter;return n&&t(n,this.store?.yeaftActiveSessionName||this.store?.currentSessionTitle),e},allDreamItems(){let e=this.store||{},t=e.yeaftDreamEvents||{},s=Object.values(t).flatMap(n=>Array.isArray(n)?n:[]);return kp({latest:e.yeaftDreamLatest||{},snapshots:e.yeaftDreamSnapshots||{},promptLoads:e.yeaftDreamPromptLoads||{},events:s,sessionTitles:this.dreamSessionTitles})},dreamItems(){return wp(this.allDreamItems,this.dreamItemSearch)},activeDreamItem(){return this.activeDreamItemKey&&this.dreamItems.find(e=>e.key===this.activeDreamItemKey)||null},activeDreamRequestEvents(){let e=this.activeDreamItem;return e?e.events.filter(t=>t&&(t.request||t.response||t.rawRequest||t.rawResponse||t.systemPrompt||this.dreamLoopUserContent(t))):[]}},mounted(){this.store&&typeof this.store.loadYeaftDebugHistory=="function"&&this.store.loadYeaftDebugHistory({limit:Ri,dreamLimit:5,indexOnly:!0})},methods:{debugSessionId(e){return this.formatDebugSessionId(e&&(e.sessionId||e.groupId)||"")},debugDreamSessionId(e){return this.formatDebugSessionId(e&&(e.sessionId||e.groupId)||"")},formatDebugSessionId(e){let t=String(e||"");return t.startsWith("grp_")?t.slice(4):t},toggleTurn(e){let t=!this.expandedTurns[e];this.expandedTurns={...this.expandedTurns,[e]:t},t&&this.ensureRequestDetailLoaded(e)},debugLoopsForTurn(e){return(Array.isArray(this.store?.yeaftDebugLoops)?this.store.yeaftDebugLoops:[]).filter(s=>s&&s.turnId===e)},debugTurnNeedsDetailLoad(e){if(!e||!e.turnId)return!1;if(!e.detailsLoaded)return!0;let t=this.debugLoopsForTurn(e.turnId),s=Math.max(0,Number(e.loopCount||0)),n=new Set;for(let r of t){let o=Number(r?.loopNumber||0);Number.isFinite(o)&&o>0&&n.add(o)}if((n.size>0?Math.max(...n):0)>n.size||s>t.length)return!0;for(let r=1;r<=s;r++)if(!n.has(r))return!0;return!1},ensureRequestDetailLoaded(e){let t=this.store?.yeaftDebugTurnsById?.[e];!t||!this.store||typeof this.store.loadYeaftDebugHistory!="function"||this.debugTurnNeedsDetailLoad(t)&&this.store.loadYeaftDebugHistory({limit:Ri,dreamLimit:0,detailTurnId:e,groupId:t.sessionId||null})},toggleDream(){this.dreamExpanded=!this.dreamExpanded},dreamEventDetail(e){if(!e)return"";let t=e.phase||"unknown",s=[],n=!0;if(t==="start")s.push(e.manual?"manual trigger":"auto trigger");else if(t==="load-diff")this.debugDreamSessionId(e)&&s.push(`session ${this.debugDreamSessionId(e)}`);else if(t==="triage")typeof e.segments=="number"&&s.push(`${e.segments} segs`),typeof e.actions=="number"&&s.push(`${e.actions} actions`),e.status&&s.push(e.status);else if(t==="merge")typeof e.targets=="number"&&s.push(`${e.targets} targets`);else if(t==="apply")e.target&&s.push(e.target),e.status&&s.push(e.status),typeof e.mergedCount=="number"&&s.push(`merged ${e.mergedCount}`);else if(t==="done"){let i=typeof e.sessions=="number"?e.sessions:e.groups;typeof i=="number"&&s.push(`${i} sessions`),typeof e.targets=="number"&&s.push(`${e.targets} targets`),typeof e.duration=="number"&&s.push(this.formatMs(e.duration))}else t==="result"?(s.push(e.success?"success":"error"),typeof e.entriesCreated=="number"&&s.push(`entries ${e.entriesCreated}`),this.formatDreamMetrics(e)&&s.push(this.formatDreamMetrics(e)),!e.success&&e.error&&s.push(e.error),e.skipped&&s.push(`skipped: ${e.skippedReason||"unknown"}`)):n=!1;if(!n||s.length===0){let i=new Set(["type","phase","sessionId","groupId","target","ts","at"]);for(let[r,o]of Object.entries(e))i.has(r)||o!=null&&typeof o!="object"&&s.push(`${r}=${o}`)}return e.error&&!s.includes(e.error)&&s.unshift(`error: ${e.error}`),s.join(" \xB7 ")},dreamEventStatus(e){return e?e.status==="skipped"||e.skipped?"skipped":e.status==="error"||e.phase==="error"?"error":e.status==="done"||e.status==="success"||e.phase==="done"?"success":e.phase==="result"?e.success?"success":"error":"running":"running"},dreamEventTrigger(e){return e?e.trigger?e.trigger:e.source?e.source:e.manual===!0?"manual":e.manual===!1?"auto":"-":"-"},dreamEventCall(e){if(!e)return"-";let t=e.phase||"unknown",s=e.status||"";return t==="start"?"scheduler -> runDream":t==="load-diff"?"runDream -> loadSessionDiff":t==="triage"?s?`triageSessionSegments \xB7 ${s}`:"triageSessionSegments":t==="merge"?"mergeByTarget":t==="apply"?s?`applyMergedTarget \xB7 ${s}`:"applyMergedTarget":t==="done"?"runDream completed":t==="result"?"web-bridge -> yeaft_dream_result":t},dreamEventLocation(e){return e?e.target?e.target:e.scope?e.scope:this.debugDreamSessionId(e)?`session/${this.debugDreamSessionId(e)}`:e.vpId?`vp/${e.vpId}`:"-":"-"},dreamEventResult(e){if(!e)return"-";let t=[];return e.skipped&&t.push(`skipped: ${e.skippedReason||"unknown"}`),e.reason&&t.push(`reason: ${e.reason}`),typeof e.entriesCreated=="number"&&t.push(`entries ${e.entriesCreated}`),typeof e.targetsApplied=="number"&&t.push(`applied ${e.targetsApplied}`),typeof e.sessionsProcessed=="number"&&t.push(`sessions ${e.sessionsProcessed}`),typeof e.sessionsSkipped=="number"&&t.push(`skipped sessions ${e.sessionsSkipped}`),typeof e.segments=="number"&&t.push(`segments ${e.segments}`),typeof e.actions=="number"&&t.push(`actions ${e.actions}`),typeof e.targets=="number"&&t.push(`targets ${e.targets}`),typeof e.duration=="number"&&t.push(this.formatMs(e.duration)),this.formatDreamMetrics(e)&&t.push(this.formatDreamMetrics(e)),Array.isArray(e.targetErrors)&&e.targetErrors.length>0&&t.push(`errors ${e.targetErrors.length}: ${this.truncate(e.targetErrors.map(s=>s.target?`${s.target}: ${s.error}`:s.error).join("; "),160)}`),e.error&&t.push(`error: ${e.error}`),t.length>0?t.join(" \xB7 "):this.dreamEventDetail(e)},dreamEventKind(e){if(!e)return"progress";let t=e.type;return t==="loop"?"loop":t==="turn_close"||t==="dream_turn_close"?"turn_close":t==="dream_run"&&e.phase==="result"?"result":"progress"},isDreamEventExpandable(e){let t=this.dreamEventKind(e);return t==="loop"?!!(e&&(e.systemPrompt||e.response||Array.isArray(e.messages)&&e.messages.length>0)):t==="turn_close"||t==="result"?!!(e&&(e.metrics||e.passBreakdown||e.resultSummary)):t==="progress"?!!(e&&(e.memoryMdPreview||e.summaryMdPreview)):!1},dreamEventKey(e){return e?`${e.at||0}:${e.turnId||""}:${e.phase||e.type||""}`:""},toggleDreamEvent(e){let t=this.dreamEventKey(e);if(!t)return;let s=new Set(this.dreamEvents.map(i=>this.dreamEventKey(i))),n={};for(let[i,r]of Object.entries(this.expandedDreamEvents))s.has(i)&&(n[i]=r);n[t]=!n[t],this.expandedDreamEvents=n},isDreamEventExpanded(e){return!!this.expandedDreamEvents[this.dreamEventKey(e)]},dreamLoopUserContent(e){let t=Array.isArray(e?.messages)?e.messages:[];for(let s of t)if(s&&s.role==="user"){if(typeof s.content=="string")return s.content;if(s.content!=null)return JSON.stringify(s.content,null,2)}return""},formatPassBreakdown(e){if(!e||typeof e!="object")return"";let t=[];for(let[s,n]of Object.entries(e)){if(!n)continue;let i=[s+":"];n.llmCallCount&&i.push(`${n.llmCallCount} call`),n.totalTokens&&i.push(`${this.formatTokens(n.totalTokens)} tok`),n.durationMs&&i.push(this.formatMs(n.durationMs)),t.push(i.join(" "))}return t.join(" \xB7 ")},copyDreamEventAsMarkdown(e){if(!e)return;let t=this.dreamEventKind(e),s=[`# Dream event \xB7 ${t} \xB7 ${e.phase||e.type||"?"}`];if(s.push(`- at: ${this.formatTimestamp(e.at)}`),e.turnId&&s.push(`- turnId: ${e.turnId}`),this.debugDreamSessionId(e)&&s.push(`- sessionId: ${this.debugDreamSessionId(e)}`),e.target&&s.push(`- target: ${e.target}`),t==="loop"){s.push(`- pass: ${e.pass||"-"}`),s.push(`- model: ${e.model||"-"}`),s.push(`- latency: ${this.formatMs(e.latencyMs)}`);let n=e.usage||{};s.push(`- tokens: ${this.formatUsageBreakdown(n)}`),s.push("","## System prompt","```",e.systemPrompt||"","```"),s.push("","## User message","```",this.dreamLoopUserContent(e),"```"),s.push("","## Response","```",e.response||"","```")}else if(t==="turn_close"){s.push(`- loopCount: ${e.loopCount??e.metrics?.llmCallCount??0}`),s.push(`- totalTokens: ${e.totalTokens??e.metrics?.totalTokens??0}`),s.push(`- totalMs: ${e.totalMs??e.metrics?.durationMs??0}`);let n=e.passBreakdown||e.metrics?.passBreakdown;n&&s.push("","## Pass breakdown","```json",JSON.stringify(n,null,2),"```")}else t==="result"?(s.push(`- status: ${e.status||"-"}`),e.error&&s.push(`- error: ${e.error}`),e.resultSummary&&s.push("","## Result summary","```json",JSON.stringify(e.resultSummary,null,2),"```"),e.metrics&&s.push("","## Metrics","```json",JSON.stringify(e.metrics,null,2),"```")):(e.memoryMdPreview&&s.push("","## memory.md (preview)","```",e.memoryMdPreview,"```"),e.summaryMdPreview&&s.push("","## summary.md (preview)","```",e.summaryMdPreview,"```"),!e.memoryMdPreview&&!e.summaryMdPreview&&s.push("","## Raw","```json",JSON.stringify(e,null,2),"```"));this.copyText(s.join(`
|
|
6648
6648
|
`),"dream event")},toggleLoop(e,t){let s=`${e}#${t}`;this.expandedLoops={...this.expandedLoops,[s]:!this.expandedLoops[s]}},toggleSection(e,t){let s=`${e}#${t}`;this.expandedSections={...this.expandedSections,[s]:!this.expandedSections[s]}},isLoopExpanded(e,t){return!!this.expandedLoops[`${e}#${t}`]},isSectionExpanded(e,t){return!!this.expandedSections[`${e}#${t}`]},formatMs(e){return e==null?"-":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`},formatTokens(e){let t=Number(e)||0;return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)},usageTotalInputTokens(e){let t=e||{};return Number.isFinite(Number(t.totalInputTokens))?Number(t.totalInputTokens):(Number(t.inputTokens)||0)+(Number(t.cacheReadTokens)||0)+(Number(t.cacheWriteTokens)||0)},usageTotalTokens(e){let t=e||{};return Number.isFinite(Number(t.totalTokens))?Number(t.totalTokens):this.usageTotalInputTokens(t)+(Number(t.outputTokens)||0)},formatUsageBreakdown(e){let t=e||{},s=Number(t.cacheReadTokens)||0,n=Number(t.cacheWriteTokens)||0,i=this.usageTotalInputTokens(t),r=Number(t.outputTokens)||0,o=this.usageTotalTokens(t),a=`${i} in / ${r} out / ${o} total`;return(s||n)&&(i===(Number(t.inputTokens)||0)?a+=` (input includes cache read ${s}, cache write ${n})`:a+=` (fresh ${Number(t.inputTokens)||0}, cache read ${s}, cache write ${n})`),a},formatDreamMetrics(e){if(!e)return"";let t=[];return typeof e.durationMs=="number"&&t.push(this.formatMs(e.durationMs)),typeof e.llmCallCount=="number"&&t.push(`${e.llmCallCount} LLM calls`),typeof e.totalTokens=="number"&&t.push(`${this.formatTokens(e.totalTokens)} tok`),t.join(" \xB7 ")},formatTimestamp(e){if(!e)return"";try{return new Date(e).toLocaleTimeString()}catch{return""}},formatClock(e){return Xa(e)},loopClockTime(e,t){if(t&&typeof t.at=="number")return this.formatClock(t.at);if(!e||typeof e.openedAt!="number")return"";let s=e.loops||[],n=0;for(let i of s)if(i){if(i===t||i.loopNumber===t.loopNumber)break;Number.isFinite(i.latencyMs)&&(n+=i.latencyMs)}return Number.isFinite(t.latencyMs)&&(n+=t.latencyMs),this.formatClock(e.openedAt+n)},loopTokenBreakdown(e){if(!e)return{inputMessage:0,inputTool:0,outputMessage:0,outputTool:0,inputTotal:0,outputTotal:0,total:0};let t=Qa(e),s=e.usage||{},n=Math.max(0,this.usageTotalInputTokens(s)),i=Math.max(0,Number(s.outputTokens)||0),r=Math.max(0,this.usageTotalTokens(s)||n+i),o=hr(n,t.inputMessageTokens,t.inputToolTokens),a=hr(i,t.outputMessageTokens,t.outputToolTokens);return{inputMessage:o.message,inputTool:o.tool,outputMessage:a.message,outputTool:a.tool,inputTotal:n,outputTotal:i,total:r}},decorateTurnTokenBreakdowns(e){if(!e)return e;let t={inputMessage:0,inputTool:0,outputMessage:0,outputTool:0,inputTotal:0,outputTotal:0,total:0},s=(e&&e.loops||[]).map(o=>{let a=this.loopTokenBreakdown(o);return t.inputMessage+=a.inputMessage,t.inputTool+=a.inputTool,t.outputMessage+=a.outputMessage,t.outputTool+=a.outputTool,t.inputTotal+=a.inputTotal,t.outputTotal+=a.outputTotal,t.total+=a.total,{...o,tokenBreakdown:a}});s.length===0&&(t.inputTotal=Math.max(0,Number(e.summaryInputTokens)||0),t.outputTotal=Math.max(0,Number(e.summaryOutputTokens)||0),t.total=t.inputTotal+t.outputTotal);let n=s.reduce((o,a)=>(Number(a?.tokenBreakdown?.total)||0)>(Number(o?.tokenBreakdown?.total)||0)?a:o,null),i={...t,messageTotal:t.inputMessage+t.outputMessage,toolTotal:t.inputTool+t.outputTool},r=Math.max(Number(e.totalTokens)||0,i.total||0);if(r>i.total){let o=r-i.total;i.total=r,i.inputTotal+=o,i.inputMessage+=o,i.messageTotal+=o}return{...e,loops:s,tokenBreakdown:i,maxLoopTokenBreakdown:n?.tokenBreakdown||null,maxLoopTokenTotal:Number(n?.tokenBreakdown?.total)||0,maxLoopNumber:n?.loopNumber||null}},turnTotalTokens(e){return Math.max(Number(e?.totalTokens)||0,Number(e?.tokenBreakdown?.total)||0)},loopBreakdownMessageTokens(e){return(Number(e?.inputMessage)||0)+(Number(e?.outputMessage)||0)},loopBreakdownToolTokens(e){return(Number(e?.inputTool)||0)+(Number(e?.outputTool)||0)},loopMessageTokens(e){return this.loopBreakdownMessageTokens(e?.tokenBreakdown||{})},loopToolTokens(e){return this.loopBreakdownToolTokens(e?.tokenBreakdown||{})},tokenPct(e,t){let s=Number(e)||0,n=Number(t)||0;return n<=0||s<=0?"0%":`${Math.round(s/n*100)}%`},tokenBreakdownTitle(e){let t=e||{},s=(Number(t.inputMessage)||0)+(Number(t.outputMessage)||0),n=(Number(t.inputTool)||0)+(Number(t.outputTool)||0),i=Math.max(Number(t.total)||0,s+n);return`estimated token split: message ${s} (${this.tokenPct(s,i)}), tool ${n} (${this.tokenPct(n,i)}); input ${Number(t.inputTotal)||0}, output ${Number(t.outputTotal)||0}, total ${i}`},truncate(e,t){let s=String(e||"");return s.length<=t?s:s.slice(0,t)+"\u2026"},toolsForLoop(e,t){let s=typeof t=="object"?t:(e?.loops||[]).find(l=>l&&l.loopNumber===t)||{loopNumber:t},n=s?.loopNumber||0,i=(e&&e.tools||[]).filter(l=>l&&l.loopNumber===n),r=new Set,o=Array.isArray(s?.toolCalls)?s.toolCalls:[],a=[];for(let l=0;l<o.length;l++){let c=o[l]||{},d=c.id||c.callId||c.tool_call_id||null,u=d?i.findIndex((f,g)=>!r.has(g)&&f.callId===d):-1;u<0&&(u=i.findIndex((f,g)=>!r.has(g)&&!f.callId&&f.name===c.name));let p=u>=0?i[u]:null;u>=0&&r.add(u),a.push(this.normalizeToolDebugRow(n,c,p,l))}for(let l=0;l<i.length;l++)r.has(l)||a.push(this.normalizeToolDebugRow(n,null,i[l],a.length));return a},normalizeToolDebugRow(e,t,s,n){let i=!!s,r=t&&Object.prototype.hasOwnProperty.call(t,"input")?t.input:void 0,o=t&&(t.id||t.callId||t.tool_call_id)||s?.callId||null,a=t&&t.name||s?.name||"?";return{loopNumber:e,index:n,callId:o,name:a,input:r,rawCall:t||null,rawResult:s||null,hasResult:i,isRunning:!i,isError:!!s?.isError,durationMs:s?.durationMs||0,toolOutput:s?.toolOutput==null?null:String(s.toolOutput)}},toolDetailKey(e,t,s,n=0){return`${e}#${t}#${s?.callId||s?.name||"tool"}#${n}`},isToolDetailExpanded(e,t,s,n){return!!this.expandedToolDetails[this.toolDetailKey(e,t,s,n)]},toggleToolDetail(e,t,s,n){let i=this.toolDetailKey(e,t,s,n);this.expandedToolDetails={...this.expandedToolDetails,[i]:!this.expandedToolDetails[i]}},toolStatusClass(e){return e?.isRunning?"running":e?.isError?"err":"ok"},toolStatusLabel(e){return e?.isRunning?this.$t?this.$t("yeaft.debugToolRunning"):"running":e?.isError?"\u2717":"\u2713"},toolInputText(e){return e?e.input!==void 0?JSON.stringify(e.input??null,null,2):e.rawCall?JSON.stringify(e.rawCall,null,2):JSON.stringify(e.rawResult||e,null,2):""},toolOutputText(e){return e?e.isRunning?this.$t?this.$t("yeaft.debugToolRunningNoResult"):"Running; no result yet":e.toolOutput!=null?e.toolOutput:e.rawResult?JSON.stringify(e.rawResult,null,2):"":""},reflectionsForLoop(e,t){return(e&&e.reflections||[]).filter(n=>n&&(n.loopNumber===t||n.loopNumber==null&&t===e.loopCount))},loopMetaSummary(e){let t=(e.toolCalls||[]).length;return t>0?`tools\xD7${t}`:"end_turn"},assistantResponseForLoop(e){if(!e)return"";if(e.response)return typeof e.response=="string"?e.response:JSON.stringify(e.response,null,2);let t=Array.isArray(e.messages)?e.messages:[];for(let s=t.length-1;s>=0;s--){let n=t[s];if(!(!n||n.role!=="assistant")){if(typeof n.content=="string")return n.content;if(Array.isArray(n.content)){let i=n.content.map(r=>r?typeof r=="string"?r:typeof r.text=="string"?r.text:"":"").filter(Boolean);if(i.length>0)return i.join(`
|
|
6649
|
-
`)}if(n.content!=null)return JSON.stringify(n.content,null,2)}}return""},showAssistantResponse(e,t){let s=`${e}#${t}`,n=`${e}#asst-${t}`;this.expandedLoops={...this.expandedLoops,[s]:!0},this.expandedSections={...this.expandedSections,[n]:!0}},setActiveDreamItem(e){this.activeDreamItemKey=this.activeDreamItemKey===e?null:e||null},isDreamSegmentExpanded(e){return!!this.expandedDreamSegments[e?.id]},toggleDreamSegment(e){e?.id&&(this.expandedDreamSegments={...this.expandedDreamSegments,[e.id]:!this.expandedDreamSegments[e.id]})},dreamPreview(e,t=180){return xs(e,t)},formatDebugValue(e){return e==null?"":typeof e=="string"?e:JSON.stringify(e,null,2)},setActiveTab(e){this.activeTab=e==="toolStats"||e==="dream"?e:"requests",this.activeTab==="toolStats"&&!this.toolStats&&!this.toolStatsLoading&&this.refreshToolStats(),this.activeTab==="requests"&&this.turns.length===0&&!this.requestHistoryLoading&&this.loadRequestHistory()},loadRequestHistory(){if(!this.store||typeof this.store.loadYeaftDebugHistory!="function")return;let e=String(this.searchQuery||"").trim();this.store.loadYeaftDebugHistory({limit:e?
|
|
6649
|
+
`)}if(n.content!=null)return JSON.stringify(n.content,null,2)}}return""},showAssistantResponse(e,t){let s=`${e}#${t}`,n=`${e}#asst-${t}`;this.expandedLoops={...this.expandedLoops,[s]:!0},this.expandedSections={...this.expandedSections,[n]:!0}},setActiveDreamItem(e){this.activeDreamItemKey=this.activeDreamItemKey===e?null:e||null},isDreamSegmentExpanded(e){return!!this.expandedDreamSegments[e?.id]},toggleDreamSegment(e){e?.id&&(this.expandedDreamSegments={...this.expandedDreamSegments,[e.id]:!this.expandedDreamSegments[e.id]})},dreamPreview(e,t=180){return xs(e,t)},formatDebugValue(e){return e==null?"":typeof e=="string"?e:JSON.stringify(e,null,2)},setActiveTab(e){this.activeTab=e==="toolStats"||e==="dream"?e:"requests",this.activeTab==="toolStats"&&!this.toolStats&&!this.toolStatsLoading&&this.refreshToolStats(),this.activeTab==="requests"&&this.turns.length===0&&!this.requestHistoryLoading&&this.loadRequestHistory()},loadRequestHistory(){if(!this.store||typeof this.store.loadYeaftDebugHistory!="function")return;let e=String(this.searchQuery||"").trim();this.store.loadYeaftDebugHistory({limit:e?th:Ri,dreamLimit:5,indexOnly:!0,search:e})},refreshToolStats(){this.store&&typeof this.store.fetchYeaftToolStats=="function"&&this.store.fetchYeaftToolStats()},formatPct(e){return!Number.isFinite(e)||e===0?"0%":`${(e*100).toFixed(1)}%`},formatLastCalled(e){if(typeof e!="string"||!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let s=Date.now()-t;return s<6e4?"just now":s<36e5?`${Math.floor(s/6e4)}m ago`:s<864e5?`${Math.floor(s/36e5)}h ago`:`${Math.floor(s/864e5)}d ago`},copyText(e,t){let s=e==null?"":typeof e=="string"?e:JSON.stringify(e,null,2);try{if(navigator&&navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(s);else{let n=document.createElement("textarea");n.value=s,n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n),n.select();try{document.execCommand("copy")}catch{}document.body.removeChild(n)}this.copiedFlash=t||"copied",this.copiedFlashAt=Date.now(),setTimeout(()=>{Date.now()-this.copiedFlashAt>=1400&&(this.copiedFlash=null)},1500)}catch{}},copyToolInput(e,t){if(t&&(t.input!==void 0||t.rawCall||t.rawResult)){this.copyText(this.toolInputText(t),"tool input");return}for(let s of e.loops||[])for(let n of s.toolCalls||[])if(n&&n.id===t.callId){this.copyText(JSON.stringify(n.input??null,null,2),"tool input");return}this.copyText(JSON.stringify(t,null,2),"tool record")},copyRawRequest(e){this.copyText(this.rawRequestForLoop(e),"raw request")},rawRequestForLoop(e){return e?.rawRequest!=null?e.rawRequest:Ya(e?.rawRequestBase??e?.requestBase?.rawRequest??null,e?.requestDelta||null)},copyToolOutput(e,t){if(t&&(t.isRunning||t.rawResult||t.toolOutput!=null)){this.copyText(this.toolOutputText(t),"tool output");return}if(t&&t.toolOutput!=null){this.copyText(t.toolOutput,"tool output");return}for(let s of e.loops||[])for(let n of s.messages||[])if(n&&n.role==="tool"&&n.toolCallId===t.callId){this.copyText(typeof n.content=="string"?n.content:JSON.stringify(n.content,null,2),"tool output");return}this.copyText("(tool output not in snapshot)","tool output")},copyTurnAsMarkdown(e){let t=[];if(t.push(`# Turn ${e.turnId}`),t.push(""),t.push(`- VP: ${e.vpId||"-"}`),t.push(`- Session: ${this.debugSessionId(e)||"-"}`),t.push(`- Loops: ${e.loopCount||e.loops&&e.loops.length||0}`),t.push(`- Total: ${this.formatMs(e.totalMs)} / ${this.formatTokens(e.totalTokens)} tok`),t.push(""),t.push("## User prompt"),t.push(""),t.push("```"),t.push(e.userPrompt||""),t.push("```"),t.push(""),e.memoryLoaded&&e.memoryLoaded.length>0){t.push(`## Memory loaded (${e.memoryLoaded.length})`);for(let n of e.memoryLoaded)t.push(`- ${n.id||"?"} score=${n.score==null?"-":n.score.toFixed(3)} kind=${n.kind||"-"}`);t.push("")}if(e.memoryAdjust){let n=e.memoryAdjust;t.push(`## Memory adjust (reason: ${n.reason||"-"})`),t.push(`- added: ${n.added||0}`),t.push(`- evicted: ${n.evicted||0}`),t.push(`- skipped: ${n.skipped||0}`),t.push("")}let s=e.loops||[];for(let n of s){t.push(`## Loop ${n.loopNumber} ${n.model}`);let i=n.usage||{};t.push(`- in/out/total: ${this.formatUsageBreakdown(i)}`),t.push(`- latency: ${this.formatMs(n.latencyMs)} ttfb: ${this.formatMs(n.ttfbMs)}`),t.push(`- stopReason: ${n.stopReason||"-"}`);let r=this.toolsForLoop(e,n.loopNumber);if(r.length>0){t.push(""),t.push(`### Tools (${r.length})`);for(let a of r){let l=a.isRunning?"running":a.isError?"ERROR":"ok";t.push(`- ${a.name} ${l} ${a.isRunning?"-":this.formatMs(a.durationMs)}`)}}let o=this.assistantResponseForLoop(n);o&&(t.push(""),t.push("### Assistant text"),t.push("```"),t.push(o),t.push("```")),t.push("")}this.copyText(t.join(`
|
|
6650
6650
|
`),"turn markdown")}},template:`
|
|
6651
6651
|
<div class="yeaft-debug-panel">
|
|
6652
6652
|
<div class="yeaft-debug-header">
|
|
@@ -7128,9 +7128,9 @@ ${String(e||"").trim()}
|
|
|
7128
7128
|
<span v-else>{{ requestHistoryLoading ? $t('yeaft.debugHistoryLoading') : $t('yeaft.noDebugData') }}</span>
|
|
7129
7129
|
</div>
|
|
7130
7130
|
</div>
|
|
7131
|
-
`}});function Tp(e,t){if(!e||e.kind!=="sub_agent")return"";let s=typeof t=="function"?t:u=>u,n=typeof e.log?.preview=="string"?e.log.preview:"",i=[],r="",o="",a=0,l=()=>{let u=xp(o);u&&i.push(s("yeaft.sessionStatus.task.subAgentEvent",{name:r||s("yeaft.sessionStatus.task.kind.subAgent"),text:u})),r="",o=""},c=()=>{r="",o=""};for(let u of n.split(/\r?\n/)){let p=
|
|
7132
|
-
`)}function
|
|
7133
|
-
`).filter(Boolean).filter(l=>!o.includes(l));return[...o,...a]}var
|
|
7131
|
+
`}});function Tp(e,t){if(!e||e.kind!=="sub_agent")return"";let s=typeof t=="function"?t:u=>u,n=typeof e.log?.preview=="string"?e.log.preview:"",i=[],r="",o="",a=0,l=()=>{let u=xp(o);u&&i.push(s("yeaft.sessionStatus.task.subAgentEvent",{name:r||s("yeaft.sessionStatus.task.kind.subAgent"),text:u})),r="",o=""},c=()=>{r="",o=""};for(let u of n.split(/\r?\n/)){let p=sh(u);if(p){if(p.type==="text_delta"){r=p.agentName||p.agentId||r,o+=p.text||p.content||p.delta||"";continue}if(p.type==="tool_use"||p.type==="tool_call"){a+=1;continue}if(p.type==="sub_agent_turn_end"){c();let f=Ap(p,s);f&&i.push(f);continue}if(p.type==="error"){l();let f=Ap(p,s);f&&i.push(f)}}}l();let d=ih(a,s);return d&&i.push(d),i.join(`
|
|
7132
|
+
`)}function rh(e,t){if(!e||e.kind!=="sub_agent")return[];let s=typeof t=="function"?t:l=>l,n=nh(e.result?.summary),i=s("yeaft.sessionStatus.task.kind.subAgent"),r=e.agentName||e.agentId||i,o=n?[s("yeaft.sessionStatus.task.subAgentResult",{name:r,text:n})]:[],a=Tp(e,t).split(`
|
|
7133
|
+
`).filter(Boolean).filter(l=>!o.includes(l));return[...o,...a]}var sh,nh,xp,ih,Ap,Mp,Pp=O(()=>{Zr();sh=e=>{if(typeof e!="string")return null;let t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;try{return JSON.parse(t)}catch{return null}},nh=(e,t=360)=>{if(typeof e!="string")return"";let s=e.trim().replace(/\s+/g," ");return s.length>t?s.slice(0,t-1)+"\u2026":s},xp=e=>typeof e!="string"?"":e.trim(),ih=(e,t)=>{let s=Number(e||0);return!Number.isFinite(s)||s<=0?"":(typeof t=="function"?t:i=>i)("yeaft.sessionStatus.task.subAgentToolSummary",{count:s})},Ap=(e,t)=>{if(!e||typeof e!="object")return"";let s=typeof t=="function"?t:i=>i,n=e.agentName||e.agentId||s("yeaft.sessionStatus.task.kind.subAgent");if(e.type==="sub_agent_turn_end"){let i=xp(e.content||e.text);return i?s("yeaft.sessionStatus.task.subAgentResult",{name:n,text:i}):""}if(e.type==="error"){let i=e.error&&(e.error.message||e.error);return i?s("yeaft.sessionStatus.task.subAgentError",{name:n,error:i}):s("yeaft.sessionStatus.task.subAgentHitError",{name:n})}return""};Mp={name:"VpTimelinePane",components:{TerminalOutput:Zn},emits:["mention-vp","edit-vp","start-resize","cancel-vp-turn","edit-announcement","cancel-task","close"],props:{rows:{type:Array,required:!0},tasks:{type:Array,default:()=>[]},announcementText:{type:String,default:""},stoppingTasksById:{type:Object,default:()=>({})}},template:`
|
|
7134
7134
|
<aside class="yeaft-vp-timeline yeaft-session-status-pane" :aria-label="$t('yeaft.sessionStatus.aria')">
|
|
7135
7135
|
<div
|
|
7136
7136
|
class="yeaft-vp-timeline-resize-handle"
|
|
@@ -7342,9 +7342,9 @@ ${String(e||"").trim()}
|
|
|
7342
7342
|
</div>
|
|
7343
7343
|
</section>
|
|
7344
7344
|
</aside>
|
|
7345
|
-
`,setup(e,{emit:t}){let s=window.Pinia&&window.Pinia.useVpStore?window.Pinia.useVpStore():null,n=C=>s&&typeof s.vpTextColor=="function"?s.vpTextColor(C):"var(--text-primary)",i=Vue.getCurrentInstance(),r=i&&i.appContext.config.globalProperties.$t||(C=>C),o=Vue.computed(()=>(typeof e.announcementText=="string"?e.announcementText:"").trim()),a=Vue.computed(()=>!!o.value),l=Vue.computed(()=>{let C=o.value.replace(/\s+/g," ");return C.length<=96?C:C.slice(0,95)+"\u2026"}),c=Vue.ref({}),d=new Map,u=new Map,p=C=>{let T=d.get(C);T&&(T.scrollTop=T.scrollHeight,u.set(C,!0))},f=C=>{let T=!c.value[C];c.value={...c.value,[C]:T},T&&(u.set(C,!0),Vue.nextTick(()=>p(C)))},g=(C,T)=>{T?(d.set(C,T),u.has(C)||u.set(C,!0),Vue.nextTick(()=>{u.get(C)&&p(C)})):d.delete(C)},
|
|
7346
|
-
`)},m=C=>`${C?.sessionId||""}::${C?.id||""}`,w=C=>C?.kind==="shell"&&C?.status==="running"&&!!C?.runtime?.pid,E=C=>!!(C?.id&&e.stoppingTasksById?.[m(C)]),R=C=>
|
|
7347
|
-
`):""},vpTextColorFor:n,expandedTasks:c,toggleTaskExpanded:f,taskOwnerName:
|
|
7345
|
+
`,setup(e,{emit:t}){let s=window.Pinia&&window.Pinia.useVpStore?window.Pinia.useVpStore():null,n=C=>s&&typeof s.vpTextColor=="function"?s.vpTextColor(C):"var(--text-primary)",i=Vue.getCurrentInstance(),r=i&&i.appContext.config.globalProperties.$t||(C=>C),o=Vue.computed(()=>(typeof e.announcementText=="string"?e.announcementText:"").trim()),a=Vue.computed(()=>!!o.value),l=Vue.computed(()=>{let C=o.value.replace(/\s+/g," ");return C.length<=96?C:C.slice(0,95)+"\u2026"}),c=Vue.ref({}),d=new Map,u=new Map,p=C=>{let T=d.get(C);T&&(T.scrollTop=T.scrollHeight,u.set(C,!0))},f=C=>{let T=!c.value[C];c.value={...c.value,[C]:T},T&&(u.set(C,!0),Vue.nextTick(()=>p(C)))},g=(C,T)=>{T?(d.set(C,T),u.has(C)||u.set(C,!0),Vue.nextTick(()=>{u.get(C)&&p(C)})):d.delete(C)},b=C=>{let T=d.get(C);if(!T)return;let N=T.scrollHeight-T.scrollTop-T.clientHeight;u.set(C,N<8)};Vue.watch(()=>JSON.stringify((Array.isArray(e.tasks)?e.tasks:[]).map(C=>[C.id,C?.log?.preview||""])),()=>Vue.nextTick(()=>{d.forEach((C,T)=>{u.get(T)&&p(T)})}));let h=C=>{let T=C?.ownerVpId||"";return T?s&&typeof s.vpLabel=="function"?s.vpLabel(T):T:"unknown"},A=C=>{if(!C)return"";try{return new Date(C).toLocaleTimeString()}catch{return String(C)}},x=C=>{switch(C?.kind){case"sub_agent":return r("yeaft.sessionStatus.task.kind.subAgent");case"shell":return r("yeaft.sessionStatus.task.kind.shell");default:return C?.kind||""}},k=C=>{let T=C?.runtime?.command;return typeof T=="string"?T.trim():""},y=C=>{let T=[],N=C?.title||C?.id||"",H=k(C);return N&&T.push(`${r("yeaft.sessionStatus.task.title")}: ${N}`),H&&T.push(`${r("yeaft.sessionStatus.task.command")}: ${H}`),T.join(`
|
|
7346
|
+
`)},m=C=>`${C?.sessionId||""}::${C?.id||""}`,w=C=>C?.kind==="shell"&&C?.status==="running"&&!!C?.runtime?.pid,E=C=>!!(C?.id&&e.stoppingTasksById?.[m(C)]),R=C=>rh(C,r),q=C=>Tp(C,r),$=C=>{switch(C.status){case"idle":return r("yeaft.vpTimeline.status.idle");case"typing":return r("yeaft.vpTimeline.status.typing");case"thinking":return r("yeaft.vpTimeline.status.thinking");case"streaming":return r("yeaft.vpTimeline.status.streaming");case"tool":return r("yeaft.vpTimeline.status.tool");case"error":return r("yeaft.vpTimeline.status.error");case"offline":return r("yeaft.vpTimeline.status.offline");default:return C.status}},P=new Set(["typing","thinking","streaming","tool"]);return{hasAnnouncement:a,announcementPreview:l,statusLabel:$,isActiveStatus:C=>P.has(C),threadCountTitle:C=>{let T=Array.isArray(C&&C.threads)?C.threads:[];return T.length?T.slice(0,5).map(N=>`${N.title||N.threadId||"thread"}: ${N.status||"idle"}`).join(`
|
|
7347
|
+
`):""},vpTextColorFor:n,expandedTasks:c,toggleTaskExpanded:f,taskOwnerName:h,formatTaskTime:A,taskKindLabel:x,shellTaskCommand:k,taskSummaryTitle:y,isTaskCancellable:w,isTaskStopping:E,taskDetailLines:R,subAgentTaskStreamText:q,setTaskLogRef:g,onTaskLogScroll:b}}}});var Dp,_p=O(()=>{Dp={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:`
|
|
7348
7348
|
<div class="yeaft-session-actions">
|
|
7349
7349
|
<button
|
|
7350
7350
|
ref="searchButtonRef"
|
|
@@ -7406,7 +7406,7 @@ ${String(e||"").trim()}
|
|
|
7406
7406
|
</svg>
|
|
7407
7407
|
</button>
|
|
7408
7408
|
</div>
|
|
7409
|
-
`}});function
|
|
7409
|
+
`}});function Ep(e){let t=typeof e=="number"?e:Date.parse(e||"");return Number.isFinite(t)?t:null}function oh(e){let t=Ep(e);return t===null?"":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}function ah(e){return(Array.isArray(e)?e:[]).map((t,s)=>({result:t,index:s,time:Ep(t?.timestamp),seq:Number.isFinite(t?.seq)?t.seq:null,messageId:String(t?.messageId||"")})).sort((t,s)=>t.time!==null&&s.time===null?-1:t.time===null&&s.time!==null?1:t.time!==null&&t.time!==s.time?s.time-t.time:t.seq!==null&&s.seq===null?-1:t.seq===null&&s.seq!==null?1:t.seq!==null&&t.seq!==s.seq?s.seq-t.seq:s.messageId.localeCompare(t.messageId)||t.index-s.index).map(({result:t})=>t)}var Rp,Lp=O(()=>{Rp={name:"YeaftConversationOutline",props:{outlineState:{type:Object,required:!0},searchState:{type:Object,required:!0},activeMessageId:{type:String,default:null}},emits:["query","select","move","load-older","load-more-search","close"],template:`
|
|
7410
7410
|
<section id="yeaft-conversation-outline" class="yeaft-conversation-outline" :aria-label="$t('yeaft.outline.label')">
|
|
7411
7411
|
<div class="yeaft-conversation-outline-header">
|
|
7412
7412
|
<div>
|
|
@@ -7434,13 +7434,6 @@ ${String(e||"").trim()}
|
|
|
7434
7434
|
role="listbox"
|
|
7435
7435
|
@scroll="onScroll"
|
|
7436
7436
|
>
|
|
7437
|
-
<button
|
|
7438
|
-
v-if="!isSearching && outlineState.hasMore"
|
|
7439
|
-
type="button"
|
|
7440
|
-
class="yeaft-conversation-outline-more"
|
|
7441
|
-
:disabled="outlineState.loading"
|
|
7442
|
-
@click="loadOlder"
|
|
7443
|
-
>{{ outlineState.loading ? $t('yeaft.outline.loading') : $t('yeaft.outline.older') }}</button>
|
|
7444
7437
|
<div v-if="errorKey" class="yeaft-conversation-outline-empty is-error">{{ $t(errorKey) }}</div>
|
|
7445
7438
|
<div v-else-if="searchState.query.length === 1" class="yeaft-conversation-outline-empty">{{ $t('yeaft.outline.minChars') }}</div>
|
|
7446
7439
|
<div v-else-if="!visibleResults.length && !isLoading" class="yeaft-conversation-outline-empty">{{ $t(isSearching ? 'yeaft.outline.noMatches' : 'yeaft.outline.empty') }}</div>
|
|
@@ -7452,7 +7445,7 @@ ${String(e||"").trim()}
|
|
|
7452
7445
|
:class="{ active: index === activeIndex }"
|
|
7453
7446
|
role="option"
|
|
7454
7447
|
:aria-selected="index === activeIndex ? 'true' : 'false'"
|
|
7455
|
-
@mouseenter="$emit('move',
|
|
7448
|
+
@mouseenter="$emit('move', result.messageId)"
|
|
7456
7449
|
@click="$emit('select', result)"
|
|
7457
7450
|
>
|
|
7458
7451
|
<span class="yeaft-conversation-outline-meta">
|
|
@@ -7461,6 +7454,13 @@ ${String(e||"").trim()}
|
|
|
7461
7454
|
</span>
|
|
7462
7455
|
<span class="yeaft-conversation-outline-snippet">{{ result.snippet || $t('yeaft.outline.nonText') }}</span>
|
|
7463
7456
|
</button>
|
|
7457
|
+
<button
|
|
7458
|
+
v-if="!isSearching && outlineState.hasMore"
|
|
7459
|
+
type="button"
|
|
7460
|
+
class="yeaft-conversation-outline-more"
|
|
7461
|
+
:disabled="outlineState.loading"
|
|
7462
|
+
@click="loadOlder"
|
|
7463
|
+
>{{ outlineState.loading ? $t('yeaft.outline.loading') : $t('yeaft.outline.older') }}</button>
|
|
7464
7464
|
<button
|
|
7465
7465
|
v-if="isSearching && searchState.hasMore"
|
|
7466
7466
|
type="button"
|
|
@@ -7470,7 +7470,7 @@ ${String(e||"").trim()}
|
|
|
7470
7470
|
>{{ $t('yeaft.outline.moreMatches') }}</button>
|
|
7471
7471
|
</div>
|
|
7472
7472
|
</section>
|
|
7473
|
-
`,setup(e,{emit:t,expose:s}){let n=Vue.ref(null),i=Vue.ref(null),r=Vue.computed(()=>String(e.searchState.query||"").trim().length>=2),o=Vue.computed(()=>r.value?e.searchState.results:e.outlineState.results),a=Vue.computed(()=>r.value?e.searchState.loading:e.outlineState.loading),
|
|
7473
|
+
`,setup(e,{emit:t,expose:s}){let n=Vue.ref(null),i=Vue.ref(null),r=Vue.computed(()=>String(e.searchState.query||"").trim().length>=2),o=Vue.computed(()=>ah(r.value?e.searchState.results:e.outlineState.results)),a=Vue.computed(()=>{let h=o.value.findIndex(A=>A?.messageId===e.activeMessageId);return h>=0?h:0}),l=Vue.computed(()=>r.value?e.searchState.loading:e.outlineState.loading),c=Vue.computed(()=>{if(r.value)return`${e.searchState.results.length}${e.searchState.hasMore?"+":""}`;let h=e.outlineState.totalCount;return Number.isFinite(h)?String(h):String(e.outlineState.results.length||"")}),d=Vue.computed(()=>{let h=r.value?e.searchState.error:e.outlineState.error;return h?h==="unsupported"?"yeaft.outline.unsupported":"yeaft.outline.error":""}),u=()=>Vue.nextTick(()=>{n.value?.focus?.(),i.value&&(i.value.scrollTop=0)}),p=()=>{let h=i.value;t("load-older",{scrollHeight:h?.scrollHeight||0,scrollTop:h?.scrollTop||0})},f=()=>{if(r.value||e.outlineState.loading||!e.outlineState.hasMore)return;let h=i.value;h&&h.scrollHeight-h.scrollTop-h.clientHeight<=40&&p()},g=h=>{if(h.key==="Escape")h.preventDefault(),t("close");else if(h.key==="ArrowDown"&&o.value.length){h.preventDefault();let A=Math.min(o.value.length-1,a.value+1);t("move",o.value[A]?.messageId||null)}else if(h.key==="ArrowUp"&&o.value.length){h.preventDefault();let A=Math.max(0,a.value-1);t("move",o.value[A]?.messageId||null)}else h.key==="Enter"&&o.value.length&&(h.preventDefault(),t("select",o.value[a.value]||o.value[0]))};return Vue.watch([o,()=>e.activeMessageId],([h,A])=>{h.some(x=>x?.messageId===A)||t("move",h[0]?.messageId||null)},{immediate:!0}),s({focus:u,restoreOlderScroll:({scrollTop:h=0}={})=>Vue.nextTick(()=>{i.value&&(i.value.scrollTop=h)})}),Vue.onMounted(u),{inputRef:n,listRef:i,isSearching:r,visibleResults:o,activeIndex:a,isLoading:l,countLabel:c,errorKey:d,focus:u,loadOlder:p,onScroll:f,onKeyDown:g,formatOutlineTime:oh}}}});function Vp(e,t){if(!Array.isArray(e)||e.length===0)return[];let s=new Map;if(Array.isArray(t))for(let r of t)r&&r.vpId&&s.set(r.vpId,r);let n=new Set,i=[];for(let r of e)!r||n.has(r)||(n.add(r),i.push(s.get(r)||{vpId:r}));return i}function Fp(e,t,s=null){return!t||!e?null:typeof e.sessionById=="function"?e.sessionById(t,s||null)||null:e.sessions?.[t]||null}function lh(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 Op(e){let{vpList:t,vpStatuses:s,stoppingVpTurnIds:n,connectionState:i,vpLabelOf:r,vpDescriptionOf:o}=e||{},a={vpStatuses:s||{},stoppingVpTurnIds:n||{},connectionState:i||null},l=(p,f)=>{if(typeof r=="function"){let g=r(p);if(g)return g}return f&&(f.displayName||f.displayNameZh)||p},c=(p,f)=>{if(typeof o=="function"){let g=o(p);if(g)return g}return f&&(f.description||f.role||f.descriptionZh||f.roleZh)||""},d=new Set,u=[];if(Array.isArray(t))for(let p of t)!p||!p.vpId||(d.add(p.vpId),u.push($p(p.vpId,l(p.vpId,p),c(p.vpId,p),a)));if(s)for(let p of Object.keys(s))!p||d.has(p)||(d.add(p),u.push($p(p,l(p,null),c(p,null),a)));return u}function $p(e,t,s,n){let i=n&&n.vpStatuses&&n.vpStatuses[e];return{vpId:e,displayName:t||e,description:s||"",status:lh(e,n),turnId:i?.turnId||null,isStopping:!!(i?.turnId&&n?.stoppingVpTurnIds?.[i.turnId]),runningThreadCount:i&&Number.isFinite(i.runningThreadCount)?i.runningThreadCount:0,threads:i&&Array.isArray(i.threads)?i.threads:[]}}var Hp=O(()=>{});function Li(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 pn(e,t){return!e||!t?!1:e.id===t||Li(e)===t}function Bp(e,t=""){let s=e?.config?.model;return typeof s=="string"&&s.trim()?s.trim():typeof t=="string"&&t.trim()?t.trim():""}function qp(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 Oo(e){return qp(e).filter(t=>(Np[t]??-1)>=Np.medium)}function Ho(e){let t=qp(e);return t.length?t.length===1?t[0]:t[t.length-2]:""}function Wp(e,t=""){let s=e?.config?.modelEffort;return typeof s=="string"&&s.trim()?s.trim():typeof t=="string"&&t.trim()?t.trim():""}function Up(e){let t=[];for(let s of Array.isArray(e)?e:[]){let n=Li(s);if(!n)continue;let i=s.label||s.id||n,r=Oo(s?.effortOptions);t.push({model:s,modelRef:n,label:i,efforts:r,defaultEffort:Ho(r)||null})}return t}var Np,zp=O(()=>{Np=Object.freeze({minimal:0,low:1,medium:2,high:3,xhigh:4,max:5})});function jp({hasYeaftAgent:e=!1,sessionsReady:t=!1,sessionsEmpty:s=!1}={}){return t&&!s?!1:e?t?s:!1:!0}var Kp=O(()=>{});function Gp({activeSessionFilter:e=null,sessionsStore:t=null,topbarGroup:s=null}={}){return e||t?.activeSessionId||s?.id||null}function Yp(e={}){return e.currentAgentInfo?.online?!0:Array.isArray(e.agents)&&e.agents.some(t=>t&&t.online)}var Qp=O(()=>{});function Xp(e={}){return!e?.warning}var Zp=O(()=>{});function Jp(e){let t=e?.updatedAt||e?.endedAt||e?.createdAt,s=t?Date.parse(t):NaN;return Number.isFinite(s)?s:0}function ch(e){return Object.values(e||{}).filter(Boolean).sort((t,s)=>t.status==="running"&&s.status!=="running"?-1:t.status!=="running"&&s.status==="running"?1:Jp(s)-Jp(t))}var ef,tf=O(()=>{pi();oo();vo();pp();gp();Vo();hp();ho();Ip();Pp();_p();Lp();Po();Ro();ao();Hp();zp();Yt();Kp();Qp();Zp();ro();ef={name:"YeaftPage",components:{ChatInput:ks,MessageList:oi,SettingsPanel:yi,YeaftSidebar:up,SessionInviteModal:fp,SessionCreateModal:Ei,SessionSettingsModal:mp,WorkbenchPanel:vi,WorkCenterPage:Pi,YeaftDebugPanel:Cp,VpTimelinePane:Mp,YeaftSessionActions:Dp,YeaftConversationOutline:Rp,LlmTab:Mi},template:`
|
|
7474
7474
|
<div class="yeaft-page" ref="pageRef">
|
|
7475
7475
|
<!-- Mobile sidebar overlay -->
|
|
7476
7476
|
<div class="yeaft-sidebar-overlay" v-if="store.sessionSidebarOpen && isMobile" @click="store.closeSessionSidebar()"></div>
|
|
@@ -7594,9 +7594,9 @@ ${String(e||"").trim()}
|
|
|
7594
7594
|
ref="historySearchRef"
|
|
7595
7595
|
:outline-state="historyOutlineState"
|
|
7596
7596
|
:search-state="store.yeaftHistorySearchState"
|
|
7597
|
-
:active-
|
|
7597
|
+
:active-message-id="historySearchActiveMessageId"
|
|
7598
7598
|
@query="onHistorySearchQuery"
|
|
7599
|
-
@move="
|
|
7599
|
+
@move="historySearchActiveMessageId = $event"
|
|
7600
7600
|
@select="selectHistorySearchResult"
|
|
7601
7601
|
@load-older="loadOlderHistoryOutline"
|
|
7602
7602
|
@load-more-search="loadMoreHistorySearchResults"
|
|
@@ -7821,11 +7821,11 @@ ${String(e||"").trim()}
|
|
|
7821
7821
|
@open-vp-library="openVpLibraryFromGroupSettings"
|
|
7822
7822
|
/>
|
|
7823
7823
|
</div>
|
|
7824
|
-
`,setup(){let e=Pinia.useChatStore(),t=Pinia.useAuthStore(),s=Pinia.useVpStore(),n=Vue.getCurrentInstance(),i=n&&n.appContext.config.globalProperties.$t||(I=>I),r=Vue.ref(!1),o=Vue.ref(!1),a=Vue.ref(!1),l=Vue.ref(!1),c=Vue.ref(!1),d=Vue.ref(""),u=Vue.ref(""),p=Vue.ref(!1),f=Vue.ref(""),g=null,v=Vue.ref("vp"),y=Vue.ref(null),A=Vue.ref(null),x=Vue.ref(null),k=Vue.ref(null),b=Vue.ref(null),m=Vue.ref(!1),w=Vue.ref(0),E=Vue.computed(()=>e.getYeaftHistoryOutlineState()),R=null,q=Vue.computed(()=>{let I=e.currentAgent||"agent",j=Ke(),le=e.yeaftActiveSessionFilter||j?.activeSessionId||"session";return`yeaft:${I}:${le}`}),$=null,P=null,D=I=>{if(!I)return!1;let j=String(I.tagName||"").toLowerCase();return j==="textarea"||j==="input"||I.isContentEditable===!0},M=({recoverScroll:I=!1}={})=>{let j=x.value;if(!j)return;if(!Z.value){j.style.removeProperty("--yeaft-visual-viewport-height");return}let le=window.visualViewport,Oe=Math.max(1,Math.round(le?.height||window.innerHeight||1));j.style.setProperty("--yeaft-visual-viewport-height",`${Oe}px`),!(!I||le&&window.innerHeight&&le.height<window.innerHeight*.85||D(document.activeElement))&&window.scrollTo(0,0)},C=(I={})=>{$!=null&&cancelAnimationFrame($),$=requestAnimationFrame(()=>{$=null,M(I)})},T=()=>{C({recoverScroll:!0}),P&&clearTimeout(P),P=setTimeout(()=>{P=null,C({recoverScroll:!0})},260)},N=Vue.computed(()=>e.hasCapability("terminal")||e.hasCapability("file_editor")),H=Vue.computed(()=>!0),U=I=>{let j=I&&I.id?I.id:null;j&&(e.setActiveSessionFilter(j,{agentId:I.agentId||null}),Z.value&&e.closeSessionSidebar())},ie=I=>{},Y=Vue.ref(null),G=Vue.ref(!1),ee=320,re=Math.max(ee,Math.round(window.innerWidth*.25)),ge=localStorage.getItem("yeaft-debug-width"),h=Vue.ref(ge?parseInt(ge,10):re),_=Vue.computed(()=>({"--yeaft-detail-width":h.value+"px"})),X=I=>{G.value=!0;let j=I.clientX,le=h.value,Oe=window.innerWidth*.6,_e=vt=>{let Fs=j-vt.clientX,as=Math.min(Oe,Math.max(ee,le+Fs));h.value=as},Ye=()=>{G.value=!1,document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Ye),localStorage.setItem("yeaft-debug-width",String(h.value))};document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Ye)},ne="yeaft-session-status-visible",me=()=>{try{let I=localStorage.getItem(ne);return!(I==="0"||I==="false")}catch{return!0}},Se=Vue.ref(me()),Ce=I=>{Se.value=!!I;try{localStorage.setItem(ne,Se.value?"1":"0")}catch{}},te=()=>Ce(!Se.value),Q=()=>Ce(!1),F=220,se=280,oe=(()=>{try{return localStorage.getItem("yeaft-vp-timeline-width")}catch{return null}})(),we=oe?parseInt(oe,10):NaN,W=Vue.ref(Number.isFinite(we)&&we>=F?we:se),J=Vue.computed(()=>({"--yeaft-vp-timeline-width":W.value+"px"})),he=I=>{let j=I.clientX,le=W.value,Oe=Math.max(F,Math.floor(window.innerWidth*.4)),_e=vt=>{let Fs=j-vt.clientX,as=Math.min(Oe,Math.max(F,le+Fs));W.value=as},Ye=()=>{document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Ye);try{localStorage.setItem("yeaft-vp-timeline-width",String(W.value))}catch{}};document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Ye)},fe="(max-width: 768px)",Re="(max-width: 1024px)",Ve=typeof window.matchMedia=="function"?window.matchMedia(fe):null,He=typeof window.matchMedia=="function"?window.matchMedia(Re):null,V=(I,j)=>I?I.matches:window.innerWidth<=j,Z=Vue.ref(V(Ve,768)),pe=Vue.ref(V(He,1024)),ce=Vue.computed(()=>Z.value?!e.sessionSidebarOpen:e.sidebarCollapsed),ve=()=>{Z.value=V(Ve,768),pe.value=V(He,1024)},Pe=()=>{ve(),T()},Te=I=>{I&&(typeof I.addEventListener=="function"?I.addEventListener("change",Pe):typeof I.addListener=="function"&&I.addListener(Pe))},Ne=I=>{I&&(typeof I.removeEventListener=="function"?I.removeEventListener("change",Pe):typeof I.removeListener=="function"&&I.removeListener(Pe))},Fe=()=>{R&&(clearTimeout(R),R=null),e.searchYeaftHistory(""),m.value=!1,w.value=0},Je=()=>{m.value=!0,e.loadYeaftHistoryOutline(),Vue.nextTick(()=>b.value?.focus?.())},ut=()=>{m.value?Fe():Je()},Et=I=>{R&&clearTimeout(R),w.value=0,R=setTimeout(()=>e.searchYeaftHistory(I),220)},mt=I=>{if(!e.loadYeaftHistoryOutline({append:!0}))return;let j=Vue.watch(()=>E.value.loading,le=>{le||(j(),b.value?.restoreOlderScroll?.(I))})},ht=()=>e.searchYeaftHistory(e.yeaftHistorySearchState.query,{append:!0}),We=I=>xd({result:I,loadWindow:j=>e.loadYeaftHistoryWindow(j),nextTick:()=>Vue.nextTick(),revealMessage:j=>k.value?.revealMessage?.(j),isMobile:Z.value,closeOutline:Fe}),Be=I=>{if((I.metaKey||I.ctrlKey)&&String(I.key).toLowerCase()==="f"){I.preventDefault(),Je();return}if(I.key==="Escape"){if(m.value){Fe();return}if(o.value){ts();return}}};Vue.onMounted(()=>{ve(),window.addEventListener("resize",Pe),Te(Ve),Te(He),window.visualViewport?.addEventListener("resize",T),window.visualViewport?.addEventListener("scroll",T),document.addEventListener("click",_s),document.addEventListener("keydown",Be),C()}),Vue.onUnmounted(()=>{window.removeEventListener("resize",Pe),Ne(Ve),Ne(He),window.visualViewport?.removeEventListener("resize",T),window.visualViewport?.removeEventListener("scroll",T),document.removeEventListener("click",_s),document.removeEventListener("keydown",Be),$!=null&&cancelAnimationFrame($),P&&clearTimeout(P),R&&clearTimeout(R)}),Vue.watch(()=>e.yeaftConversationId,I=>{I&&e.activeConversations[0]!==I&&(e.activeConversations=[I])}),Vue.watch(()=>[e.currentAgent,e.yeaftActiveSessionFilter],()=>{Fe(),e.yeaftHistorySearchState={requestId:null,agentId:null,sessionId:null,query:"",loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null}});let Le=()=>{e.leaveYeaft()},ze=(I,j)=>{let le=Ke();if(le&&le.activeNeedsInvite){let vt=le.activeSession;vt&&$t.delete(vt.id);return}let Oe=e.yeaftActiveSessionFilter||le&&le.activeSessionId||"grp_default",_e=di(I).mentions,Ye=Array.isArray(j)?j:void 0;e.sendYeaftSessionMessage({groupId:Oe,text:I,mentions:_e,attachments:Ye})},je=()=>{let I=Ke(),j=e.yeaftActiveSessionFilter||I?.activeSessionId||null;j&&e.cancelYeaftSession(j)},rt=(I="")=>{let j=et.value;j&&e.enterWorkCenterFromSession(j,I)},Ts=()=>{if(Z.value){e.toggleSessionSidebar();return}e.toggleSidebar()},Ms=()=>{r.value=!r.value},Vi=()=>{r.value=!1},Fi=()=>{e.reloadYeaftMessages()},fn=()=>{window.location.reload()},Ke=()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}},Oi=Vue.computed(()=>{let I=Ke(),j=e.yeaftActiveSessionFilter||I?.activeSessionId||null;return j?e.isYeaftSessionProcessing(j):!1}),et=Vue.computed(()=>{let I=Ke();if(!I||!I.sessions)return null;let j=e.yeaftActiveSessionFilter||null;if(j&&typeof I.sessionById=="function"){let le=I.sessionById(j,e.currentAgent||null);if(le)return le}if(I.activeSessionId&&typeof I.sessionById=="function"){let le=I.sessionById(I.activeSessionId,e.currentAgent||null);if(le)return le}return typeof I.sessionById=="function"?I.sessionById("grp_default",e.currentAgent||null):null}),gn=()=>Kp({activeSessionFilter:e.yeaftActiveSessionFilter,sessionsStore:Ke(),topbarGroup:et.value}),Hi=Vue.computed(()=>{let I=et.value||{},j=typeof I.id=="string"?I.id.trim():"",le=[I.title,I.name,I.config?.title,I.config?.name];for(let Oe of le){let _e=typeof Oe=="string"?Oe.trim():"";if(_e&&!(j&&_e===j)&&!/^(sessions?|groups?)\//i.test(_e)&&!/^session_[A-Za-z0-9_-]+$/.test(_e)&&!(I.workDir&&_e===I.workDir))return _e}return""}),Ni=Vue.computed(()=>et.value&&typeof et.value.announcement=="string"?et.value.announcement:""),It=Vue.computed(()=>Np(et.value,e.yeaftModel||"")),Ps=Vue.computed(()=>{let I=It.value;return I&&e.yeaftAvailableModels.find(j=>pn(j,I))||null}),Jt=I=>Oo(I?.effortOptions),Ge=Vue.computed(()=>qp(et.value,e.yeaftModelEffort||"")),es=Vue.computed(()=>{let I=Array.isArray(Ps.value?.effortOptions)?Ps.value.effortOptions.filter(Boolean):[];return I.length?I.includes(Ge.value)?Ge.value:Ho(I):null}),Bi=Vue.computed(()=>Wp(e.yeaftAvailableModels)),qi=(I,j)=>pn(I,It.value)?j?j===es.value:!Jt(I).length:!1,Wi=I=>!I||!pn(I.model,It.value)?!1:I.efforts.length?I.efforts.includes(es.value):!0,Ui=()=>{o.value=!0},ts=()=>{o.value=!1},Ds=I=>{I.stopPropagation(),e.yeaftAvailableModels.length&&(o.value?ts():Ui())},zi=(I,j=null)=>{if(!I)return;let le=et.value?.id||null;e.switchYeaftModel(I,le,j),ts()},ss=I=>!I||!Number.isFinite(I)||I<=0?"":I>=1e6?`${Math.round(I/1e5)/10}m`:I>=1e3?`${Math.round(I/1e3)}k`:String(I),ji=I=>{let j=ss(I?.contextWindow),le=ss(I?.maxOutput);return j&&le?`${j} \xB7 ${le} out`:j},_s=I=>{if(!o.value)return;I.target.closest(".yeaft-topbar-model, .yeaft-topbar-model-dropdown")||ts()},No=()=>{a.value||(v.value="vp",y.value=null),a.value=!a.value},Rt=({initialTab:I="vp",editVpId:j=null}={})=>{v.value=["vp","search","mcp"].includes(I)?I:"vp",y.value=v.value==="vp"&&j||null,a.value=!0},Ki=()=>{o.value=!1,l.value=!0},Gi=I=>{Ze(I)&&(l.value=!1)},Yi=async()=>{if(!(u.value||p.value)){p.value=!0,f.value="";try{let I={"Content-Type":"application/json"};t.token&&(I.Authorization=`Bearer ${t.token}`);let j=await fetch("/api/user/agent-secret",{headers:I});if(!j.ok){let _e=i("yeaft.onboarding.secretError");try{let Ye=await j.json();Ye?.error&&(_e=Ye.error)}catch{}throw new Error(_e)}let le=await j.json(),Oe=le?.agentSecret||le?.agent_secret||"";if(u.value=String(Oe||"").trim(),!u.value)throw new Error(i("yeaft.onboarding.secretError"))}catch(I){f.value=I?.message||i("yeaft.onboarding.secretError")}finally{p.value=!1}}},mn=()=>{c.value=!0},hn=I=>{c.value=!1},Lt=async(I,j)=>{if(j&&!(typeof navigator>"u"||!navigator.clipboard?.writeText))try{let le=typeof j=="string"?j:j?.value||"";if(!le)return;await navigator.clipboard.writeText(le),d.value=I||"",g&&clearTimeout(g),g=setTimeout(()=>{d.value="",g=null},1800)}catch{}},Es=(I,j)=>{},ot=(I={})=>{Qp(I)&&(l.value=!1)},$t=Vue.reactive(new Set),At=Vue.computed(()=>{let I=Ke();return I?I.activeSession:null}),Rs=I=>{if(!I)return"";if(I.id==="grp_default"&&(I.name==="Default"||!I.name))try{let j=typeof window<"u"?window.i18n:null;if(j&&j.global&&typeof j.global.t=="function")return j.global.t("yeaft.session.defaultName")}catch{}return I.name||I.id||""},Vt=Vue.computed(()=>Rs(At.value)),vn=Vue.computed(()=>{let I=Ke();if(!I||!I.activeNeedsInvite)return!1;let j=I.activeSession;return j?!$t.has(j.id):!1}),ns=Vue.computed(()=>{let I=Ke();return!!(I&&I.activeNeedsInvite)}),is=Vue.computed(()=>{let I=Ke();return zp({hasYeaftAgent:Gp(e),sessionsReady:!!(I&&I.hasLoadedSnapshot),sessionsEmpty:!!(I&&I.isEmpty)})});Vue.watch(is,I=>{I&&Yi()},{immediate:!0});let yn="npm install -g @yeaft/webchat-agent",Ls=Vue.computed(()=>{let j=(typeof window<"u"&&window.location?.origin?window.location.origin:"http://localhost:3456").replace(/^http:/,"ws:").replace(/^https:/,"wss:"),le=u.value||i("yeaft.onboarding.secretPending");return`yeaft-agent install --server ${j} --name yeaft-agent --secret ${le}`}),rs="gh auth login && yeaft-agent llm use github-copilot --model gpt-5.5",Qi=()=>{let I=At.value;I&&$t.add(I.id),be(I?I.id:null)},bn=()=>{let I=At.value;I&&$t.add(I.id)},os=Vue.ref(!1),$s=Vue.ref(null),Ft=Vue.ref(null),Vs=Vue.ref("session"),wn=Vue.ref(""),S=(I={})=>{let j=I&&(I.sessionId||I.groupId)||null,le=I&&I.editVpId||"",Oe=le?"members":I&&I.section||"session";j&&($s.value=j,Ft.value=I&&I.agentId||null,Vs.value=Oe,wn.value=le,os.value=!0)},L=()=>{let I=gn();I&&S({sessionId:I,section:"session"})},B=()=>{os.value=!1,$s.value=null,Ft.value=null,wn.value=""},ue=()=>{B(),Rt({initialTab:"vp"})},be=I=>{I&&S({sessionId:I,section:"members"})};Vue.watch(()=>{let I=At.value;return I?I.id+":"+(Array.isArray(I.roster)?I.roster.length:0)+":"+(I.defaultVpId||""):""},(I,j)=>{let le=At.value;le&&I!==j&&Array.isArray(le.roster)&&le.roster.length>0&&$t.delete(le.id)}),typeof Vue.onBeforeUnmount=="function"&&Vue.onBeforeUnmount(()=>{g&&clearTimeout(g),g=null});let ae=()=>{a.value=!1},De=Vue.computed(()=>!a.value&&!is.value&&Se.value),Ue=Vue.computed(()=>{let I=Ke(),j=e.yeaftActiveSessionFilter||I?.activeSessionId||null;if(!j)return[];let le=e.yeaftActiveTasksBySession?.[j]||{};return ah(le)}),ye=Vue.computed(()=>{if(!e.yeaftConversationId)return[];let j=Ke(),le=e.yeaftActiveSessionFilter||j?.activeSessionId||null;if(!le)return[];let Oe=Vp(j,le,e.currentAgent||null),_e=Oe&&Array.isArray(Oe.roster)?Oe.roster:[];if(_e.length===0)return[];let Ye=new Set(_e),vt=$p(_e,s.vpList||[]),Fs=e.vpStatuses||{},as={};for(let at of Object.values(Fs)){if(!at||!at.vpId)continue;let qo=at.sessionId??at.groupId;qo&&qo!==le||Ye.has(at.vpId)&&(as[at.vpId]=at)}return Fp({vpList:vt,vpStatuses:as,stoppingVpTurnIds:e.stoppingVpTurnIds||{},connectionState:e.connectionState,vpLabelOf:at=>s.vpLabel(at),vpDescriptionOf:at=>s.vpDescription(at)})});return{store:e,pageRef:x,effectiveSidebarCollapsed:ce,debugMode:r,modelDropdownOpen:o,topbarGroup:et,topbarSessionTitle:Hi,topbarModel:It,topbarEffort:es,topbarModelRows:Bi,selectableEffortsForModel:Jt,isModelSelectionActive:qi,isModelRowActive:Wi,modelOptionRef:Li,modelOptionMatchesRef:pn,showSettings:a,showLlmConfig:l,sessionCreateOpen:c,settingsInitialTab:v,settingsInitialEditVpId:y,chatInputRef:A,messageListRef:k,historySearchRef:b,historySearchOpen:m,historySearchActiveIndex:w,historyOutlineState:E,toggleHistorySearch:ut,closeHistorySearch:Fe,onHistorySearchQuery:Et,loadOlderHistoryOutline:mt,loadMoreHistorySearchResults:ht,selectHistorySearchResult:We,yeaftInputDraftKey:q,openSettings:Rt,isMobile:Z,isNarrowDetail:pe,detailPanel:Y,isResizingDetail:G,detailWidthStyle:_,startDetailResize:X,isProcessing:Oi,goBack:Le,sendMessage:ze,cancelYeaft:je,openWorkItemDraft:rt,toggleSidebar:Ts,toggleDebug:Ms,closeDebug:Vi,reloadMessages:Fi,reloadPage:fn,toggleModelDropdown:Ds,selectModel:zi,openLlmConfig:Ki,trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,closeLlmConfigFromOverlay:Gi,openSessionCreate:mn,onSessionCreated:hn,copyOnboardingCommand:Lt,copiedOnboardingCommand:d,onLlmConfigMessage:Es,onLlmConfigSaved:ot,formatTokens:ss,formatModelCtx:ji,toggleSettings:No,onSettingsSaved:ae,sidebarV2Enabled:H,onSelectGroupV2:U,onSelectChat:ie,canUseWorkbench:N,shouldShowInviteModal:vn,inviteGroupName:Vt,onInviteOpenLibrary:Qi,onInviteDismiss:bn,isActiveGroupEmpty:ns,showOnboardingGuide:is,installAgentCommand:yn,connectAgentCommand:Ls,copilotCommand:rs,agentSecret:u,agentSecretLoading:p,agentSecretError:f,groupSettingsOpen:os,groupSettingsId:$s,groupSettingsAgentId:Ft,groupSettingsSection:Vs,groupSettingsEditVpId:wn,openSessionSettings:S,openAnnouncementSettings:L,closeGroupSettings:B,openVpLibraryFromGroupSettings:ue,openMemberEditor:be,showVpTimeline:De,vpTimelineRows:ye,sessionStatusTasksForActiveSession:Ue,sessionStatusAnnouncementText:Ni,sessionStatusVisible:Se,toggleSessionStatus:te,closeSessionStatus:Q,timelineWidthStyle:J,startTimelineResize:he,onEditVpFromTimeline:I=>{if(!I)return;let j=gn();j&&S({sessionId:j,section:"members",editVpId:I})},onMentionVpFromTimeline:I=>{if(!I)return;let j=A.value;j&&typeof j.appendMention=="function"&&j.appendMention(I)},onCancelVpFromTimeline:I=>{if(!I)return;let j=Ke(),le=e.yeaftActiveSessionFilter||j?.activeSessionId||null;le&&typeof e.cancelVpTurnForSession=="function"&&e.cancelVpTurnForSession(I,le)},onCancelTaskFromTimeline:I=>!I?.id||!I.sessionId||typeof e.cancelYeaftTask!="function"?!1:e.cancelYeaftTask({sessionId:I.sessionId,taskId:I.id})}}}});var dh=tf(()=>{Hn();ct();gs();Ic();bt();Pc();_c();Rc();$c();ip();ef();wo();Jr();window.Pinia={...Pinia,useChatStore:null,useAuthStore:null};var lh={components:{LoginPage:Lc,ChatPage:np,YeaftPage:Jp},template:`
|
|
7824
|
+
`,setup(){let e=Pinia.useChatStore(),t=Pinia.useAuthStore(),s=Pinia.useVpStore(),n=Vue.getCurrentInstance(),i=n&&n.appContext.config.globalProperties.$t||(I=>I),r=Vue.ref(!1),o=Vue.ref(!1),a=Vue.ref(!1),l=Vue.ref(!1),c=Vue.ref(!1),d=Vue.ref(""),u=Vue.ref(""),p=Vue.ref(!1),f=Vue.ref(""),g=null,b=Vue.ref("vp"),h=Vue.ref(null),A=Vue.ref(null),x=Vue.ref(null),k=Vue.ref(null),y=Vue.ref(null),m=Vue.ref(!1),w=Vue.ref(null),E=Vue.computed(()=>e.getYeaftHistoryOutlineState()),R=null,q=Vue.computed(()=>{let I=e.currentAgent||"agent",j=Ke(),le=e.yeaftActiveSessionFilter||j?.activeSessionId||"session";return`yeaft:${I}:${le}`}),$=null,P=null,D=I=>{if(!I)return!1;let j=String(I.tagName||"").toLowerCase();return j==="textarea"||j==="input"||I.isContentEditable===!0},M=({recoverScroll:I=!1}={})=>{let j=x.value;if(!j)return;if(!Z.value){j.style.removeProperty("--yeaft-visual-viewport-height");return}let le=window.visualViewport,Oe=Math.max(1,Math.round(le?.height||window.innerHeight||1));j.style.setProperty("--yeaft-visual-viewport-height",`${Oe}px`),!(!I||le&&window.innerHeight&&le.height<window.innerHeight*.85||D(document.activeElement))&&window.scrollTo(0,0)},C=(I={})=>{$!=null&&cancelAnimationFrame($),$=requestAnimationFrame(()=>{$=null,M(I)})},T=()=>{C({recoverScroll:!0}),P&&clearTimeout(P),P=setTimeout(()=>{P=null,C({recoverScroll:!0})},260)},N=Vue.computed(()=>e.hasCapability("terminal")||e.hasCapability("file_editor")),H=Vue.computed(()=>!0),U=I=>{let j=I&&I.id?I.id:null;j&&(e.setActiveSessionFilter(j,{agentId:I.agentId||null}),Z.value&&e.closeSessionSidebar())},ie=I=>{},Y=Vue.ref(null),G=Vue.ref(!1),ee=320,re=Math.max(ee,Math.round(window.innerWidth*.25)),ge=localStorage.getItem("yeaft-debug-width"),v=Vue.ref(ge?parseInt(ge,10):re),_=Vue.computed(()=>({"--yeaft-detail-width":v.value+"px"})),X=I=>{G.value=!0;let j=I.clientX,le=v.value,Oe=window.innerWidth*.6,_e=vt=>{let Fs=j-vt.clientX,as=Math.min(Oe,Math.max(ee,le+Fs));v.value=as},Ye=()=>{G.value=!1,document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Ye),localStorage.setItem("yeaft-debug-width",String(v.value))};document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Ye)},ne="yeaft-session-status-visible",me=()=>{try{let I=localStorage.getItem(ne);return!(I==="0"||I==="false")}catch{return!0}},Se=Vue.ref(me()),Ce=I=>{Se.value=!!I;try{localStorage.setItem(ne,Se.value?"1":"0")}catch{}},te=()=>Ce(!Se.value),Q=()=>Ce(!1),F=220,se=280,oe=(()=>{try{return localStorage.getItem("yeaft-vp-timeline-width")}catch{return null}})(),we=oe?parseInt(oe,10):NaN,W=Vue.ref(Number.isFinite(we)&&we>=F?we:se),J=Vue.computed(()=>({"--yeaft-vp-timeline-width":W.value+"px"})),he=I=>{let j=I.clientX,le=W.value,Oe=Math.max(F,Math.floor(window.innerWidth*.4)),_e=vt=>{let Fs=j-vt.clientX,as=Math.min(Oe,Math.max(F,le+Fs));W.value=as},Ye=()=>{document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Ye);try{localStorage.setItem("yeaft-vp-timeline-width",String(W.value))}catch{}};document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Ye)},fe="(max-width: 768px)",Re="(max-width: 1024px)",Ve=typeof window.matchMedia=="function"?window.matchMedia(fe):null,He=typeof window.matchMedia=="function"?window.matchMedia(Re):null,V=(I,j)=>I?I.matches:window.innerWidth<=j,Z=Vue.ref(V(Ve,768)),pe=Vue.ref(V(He,1024)),ce=Vue.computed(()=>Z.value?!e.sessionSidebarOpen:e.sidebarCollapsed),ve=()=>{Z.value=V(Ve,768),pe.value=V(He,1024)},Pe=()=>{ve(),T()},Te=I=>{I&&(typeof I.addEventListener=="function"?I.addEventListener("change",Pe):typeof I.addListener=="function"&&I.addListener(Pe))},Ne=I=>{I&&(typeof I.removeEventListener=="function"?I.removeEventListener("change",Pe):typeof I.removeListener=="function"&&I.removeListener(Pe))},Fe=()=>{R&&(clearTimeout(R),R=null),e.searchYeaftHistory(""),m.value=!1,w.value=null},Je=()=>{m.value=!0,e.loadYeaftHistoryOutline(),Vue.nextTick(()=>y.value?.focus?.())},ut=()=>{m.value?Fe():Je()},Et=I=>{R&&clearTimeout(R),w.value=null,R=setTimeout(()=>e.searchYeaftHistory(I),220)},mt=I=>{if(!e.loadYeaftHistoryOutline({append:!0}))return;let j=Vue.watch(()=>E.value.loading,le=>{le||(j(),y.value?.restoreOlderScroll?.(I))})},ht=()=>e.searchYeaftHistory(e.yeaftHistorySearchState.query,{append:!0}),We=I=>xd({result:I,loadWindow:j=>e.loadYeaftHistoryWindow(j),nextTick:()=>Vue.nextTick(),revealMessage:j=>k.value?.revealMessage?.(j),isMobile:Z.value,closeOutline:Fe}),Be=I=>{if((I.metaKey||I.ctrlKey)&&String(I.key).toLowerCase()==="f"){I.preventDefault(),Je();return}if(I.key==="Escape"){if(m.value){Fe();return}if(o.value){ts();return}}};Vue.onMounted(()=>{ve(),window.addEventListener("resize",Pe),Te(Ve),Te(He),window.visualViewport?.addEventListener("resize",T),window.visualViewport?.addEventListener("scroll",T),document.addEventListener("click",_s),document.addEventListener("keydown",Be),C()}),Vue.onUnmounted(()=>{window.removeEventListener("resize",Pe),Ne(Ve),Ne(He),window.visualViewport?.removeEventListener("resize",T),window.visualViewport?.removeEventListener("scroll",T),document.removeEventListener("click",_s),document.removeEventListener("keydown",Be),$!=null&&cancelAnimationFrame($),P&&clearTimeout(P),R&&clearTimeout(R)}),Vue.watch(()=>e.yeaftConversationId,I=>{I&&e.activeConversations[0]!==I&&(e.activeConversations=[I])}),Vue.watch(()=>[e.currentAgent,e.yeaftActiveSessionFilter],()=>{Fe(),e.yeaftHistorySearchState={requestId:null,agentId:null,sessionId:null,query:"",loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null}});let Le=()=>{e.leaveYeaft()},ze=(I,j)=>{let le=Ke();if(le&&le.activeNeedsInvite){let vt=le.activeSession;vt&&$t.delete(vt.id);return}let Oe=e.yeaftActiveSessionFilter||le&&le.activeSessionId||"grp_default",_e=di(I).mentions,Ye=Array.isArray(j)?j:void 0;e.sendYeaftSessionMessage({groupId:Oe,text:I,mentions:_e,attachments:Ye})},je=()=>{let I=Ke(),j=e.yeaftActiveSessionFilter||I?.activeSessionId||null;j&&e.cancelYeaftSession(j)},rt=(I="")=>{let j=et.value;j&&e.enterWorkCenterFromSession(j,I)},Ts=()=>{if(Z.value){e.toggleSessionSidebar();return}e.toggleSidebar()},Ms=()=>{r.value=!r.value},Vi=()=>{r.value=!1},Fi=()=>{e.reloadYeaftMessages()},fn=()=>{window.location.reload()},Ke=()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}},Oi=Vue.computed(()=>{let I=Ke(),j=e.yeaftActiveSessionFilter||I?.activeSessionId||null;return j?e.isYeaftSessionProcessing(j):!1}),et=Vue.computed(()=>{let I=Ke();if(!I||!I.sessions)return null;let j=e.yeaftActiveSessionFilter||null;if(j&&typeof I.sessionById=="function"){let le=I.sessionById(j,e.currentAgent||null);if(le)return le}if(I.activeSessionId&&typeof I.sessionById=="function"){let le=I.sessionById(I.activeSessionId,e.currentAgent||null);if(le)return le}return typeof I.sessionById=="function"?I.sessionById("grp_default",e.currentAgent||null):null}),gn=()=>Gp({activeSessionFilter:e.yeaftActiveSessionFilter,sessionsStore:Ke(),topbarGroup:et.value}),Hi=Vue.computed(()=>{let I=et.value||{},j=typeof I.id=="string"?I.id.trim():"",le=[I.title,I.name,I.config?.title,I.config?.name];for(let Oe of le){let _e=typeof Oe=="string"?Oe.trim():"";if(_e&&!(j&&_e===j)&&!/^(sessions?|groups?)\//i.test(_e)&&!/^session_[A-Za-z0-9_-]+$/.test(_e)&&!(I.workDir&&_e===I.workDir))return _e}return""}),Ni=Vue.computed(()=>et.value&&typeof et.value.announcement=="string"?et.value.announcement:""),It=Vue.computed(()=>Bp(et.value,e.yeaftModel||"")),Ps=Vue.computed(()=>{let I=It.value;return I&&e.yeaftAvailableModels.find(j=>pn(j,I))||null}),Jt=I=>Oo(I?.effortOptions),Ge=Vue.computed(()=>Wp(et.value,e.yeaftModelEffort||"")),es=Vue.computed(()=>{let I=Array.isArray(Ps.value?.effortOptions)?Ps.value.effortOptions.filter(Boolean):[];return I.length?I.includes(Ge.value)?Ge.value:Ho(I):null}),Bi=Vue.computed(()=>Up(e.yeaftAvailableModels)),qi=(I,j)=>pn(I,It.value)?j?j===es.value:!Jt(I).length:!1,Wi=I=>!I||!pn(I.model,It.value)?!1:I.efforts.length?I.efforts.includes(es.value):!0,Ui=()=>{o.value=!0},ts=()=>{o.value=!1},Ds=I=>{I.stopPropagation(),e.yeaftAvailableModels.length&&(o.value?ts():Ui())},zi=(I,j=null)=>{if(!I)return;let le=et.value?.id||null;e.switchYeaftModel(I,le,j),ts()},ss=I=>!I||!Number.isFinite(I)||I<=0?"":I>=1e6?`${Math.round(I/1e5)/10}m`:I>=1e3?`${Math.round(I/1e3)}k`:String(I),ji=I=>{let j=ss(I?.contextWindow),le=ss(I?.maxOutput);return j&&le?`${j} \xB7 ${le} out`:j},_s=I=>{if(!o.value)return;I.target.closest(".yeaft-topbar-model, .yeaft-topbar-model-dropdown")||ts()},No=()=>{a.value||(b.value="vp",h.value=null),a.value=!a.value},Rt=({initialTab:I="vp",editVpId:j=null}={})=>{b.value=["vp","search","mcp"].includes(I)?I:"vp",h.value=b.value==="vp"&&j||null,a.value=!0},Ki=()=>{o.value=!1,l.value=!0},Gi=I=>{Ze(I)&&(l.value=!1)},Yi=async()=>{if(!(u.value||p.value)){p.value=!0,f.value="";try{let I={"Content-Type":"application/json"};t.token&&(I.Authorization=`Bearer ${t.token}`);let j=await fetch("/api/user/agent-secret",{headers:I});if(!j.ok){let _e=i("yeaft.onboarding.secretError");try{let Ye=await j.json();Ye?.error&&(_e=Ye.error)}catch{}throw new Error(_e)}let le=await j.json(),Oe=le?.agentSecret||le?.agent_secret||"";if(u.value=String(Oe||"").trim(),!u.value)throw new Error(i("yeaft.onboarding.secretError"))}catch(I){f.value=I?.message||i("yeaft.onboarding.secretError")}finally{p.value=!1}}},mn=()=>{c.value=!0},hn=I=>{c.value=!1},Lt=async(I,j)=>{if(j&&!(typeof navigator>"u"||!navigator.clipboard?.writeText))try{let le=typeof j=="string"?j:j?.value||"";if(!le)return;await navigator.clipboard.writeText(le),d.value=I||"",g&&clearTimeout(g),g=setTimeout(()=>{d.value="",g=null},1800)}catch{}},Es=(I,j)=>{},ot=(I={})=>{Xp(I)&&(l.value=!1)},$t=Vue.reactive(new Set),At=Vue.computed(()=>{let I=Ke();return I?I.activeSession:null}),Rs=I=>{if(!I)return"";if(I.id==="grp_default"&&(I.name==="Default"||!I.name))try{let j=typeof window<"u"?window.i18n:null;if(j&&j.global&&typeof j.global.t=="function")return j.global.t("yeaft.session.defaultName")}catch{}return I.name||I.id||""},Vt=Vue.computed(()=>Rs(At.value)),vn=Vue.computed(()=>{let I=Ke();if(!I||!I.activeNeedsInvite)return!1;let j=I.activeSession;return j?!$t.has(j.id):!1}),ns=Vue.computed(()=>{let I=Ke();return!!(I&&I.activeNeedsInvite)}),is=Vue.computed(()=>{let I=Ke();return jp({hasYeaftAgent:Yp(e),sessionsReady:!!(I&&I.hasLoadedSnapshot),sessionsEmpty:!!(I&&I.isEmpty)})});Vue.watch(is,I=>{I&&Yi()},{immediate:!0});let yn="npm install -g @yeaft/webchat-agent",Ls=Vue.computed(()=>{let j=(typeof window<"u"&&window.location?.origin?window.location.origin:"http://localhost:3456").replace(/^http:/,"ws:").replace(/^https:/,"wss:"),le=u.value||i("yeaft.onboarding.secretPending");return`yeaft-agent install --server ${j} --name yeaft-agent --secret ${le}`}),rs="gh auth login && yeaft-agent llm use github-copilot --model gpt-5.5",Qi=()=>{let I=At.value;I&&$t.add(I.id),be(I?I.id:null)},bn=()=>{let I=At.value;I&&$t.add(I.id)},os=Vue.ref(!1),$s=Vue.ref(null),Ft=Vue.ref(null),Vs=Vue.ref("session"),wn=Vue.ref(""),S=(I={})=>{let j=I&&(I.sessionId||I.groupId)||null,le=I&&I.editVpId||"",Oe=le?"members":I&&I.section||"session";j&&($s.value=j,Ft.value=I&&I.agentId||null,Vs.value=Oe,wn.value=le,os.value=!0)},L=()=>{let I=gn();I&&S({sessionId:I,section:"session"})},B=()=>{os.value=!1,$s.value=null,Ft.value=null,wn.value=""},ue=()=>{B(),Rt({initialTab:"vp"})},be=I=>{I&&S({sessionId:I,section:"members"})};Vue.watch(()=>{let I=At.value;return I?I.id+":"+(Array.isArray(I.roster)?I.roster.length:0)+":"+(I.defaultVpId||""):""},(I,j)=>{let le=At.value;le&&I!==j&&Array.isArray(le.roster)&&le.roster.length>0&&$t.delete(le.id)}),typeof Vue.onBeforeUnmount=="function"&&Vue.onBeforeUnmount(()=>{g&&clearTimeout(g),g=null});let ae=()=>{a.value=!1},De=Vue.computed(()=>!a.value&&!is.value&&Se.value),Ue=Vue.computed(()=>{let I=Ke(),j=e.yeaftActiveSessionFilter||I?.activeSessionId||null;if(!j)return[];let le=e.yeaftActiveTasksBySession?.[j]||{};return ch(le)}),ye=Vue.computed(()=>{if(!e.yeaftConversationId)return[];let j=Ke(),le=e.yeaftActiveSessionFilter||j?.activeSessionId||null;if(!le)return[];let Oe=Fp(j,le,e.currentAgent||null),_e=Oe&&Array.isArray(Oe.roster)?Oe.roster:[];if(_e.length===0)return[];let Ye=new Set(_e),vt=Vp(_e,s.vpList||[]),Fs=e.vpStatuses||{},as={};for(let at of Object.values(Fs)){if(!at||!at.vpId)continue;let qo=at.sessionId??at.groupId;qo&&qo!==le||Ye.has(at.vpId)&&(as[at.vpId]=at)}return Op({vpList:vt,vpStatuses:as,stoppingVpTurnIds:e.stoppingVpTurnIds||{},connectionState:e.connectionState,vpLabelOf:at=>s.vpLabel(at),vpDescriptionOf:at=>s.vpDescription(at)})});return{store:e,pageRef:x,effectiveSidebarCollapsed:ce,debugMode:r,modelDropdownOpen:o,topbarGroup:et,topbarSessionTitle:Hi,topbarModel:It,topbarEffort:es,topbarModelRows:Bi,selectableEffortsForModel:Jt,isModelSelectionActive:qi,isModelRowActive:Wi,modelOptionRef:Li,modelOptionMatchesRef:pn,showSettings:a,showLlmConfig:l,sessionCreateOpen:c,settingsInitialTab:b,settingsInitialEditVpId:h,chatInputRef:A,messageListRef:k,historySearchRef:y,historySearchOpen:m,historySearchActiveMessageId:w,historyOutlineState:E,toggleHistorySearch:ut,closeHistorySearch:Fe,onHistorySearchQuery:Et,loadOlderHistoryOutline:mt,loadMoreHistorySearchResults:ht,selectHistorySearchResult:We,yeaftInputDraftKey:q,openSettings:Rt,isMobile:Z,isNarrowDetail:pe,detailPanel:Y,isResizingDetail:G,detailWidthStyle:_,startDetailResize:X,isProcessing:Oi,goBack:Le,sendMessage:ze,cancelYeaft:je,openWorkItemDraft:rt,toggleSidebar:Ts,toggleDebug:Ms,closeDebug:Vi,reloadMessages:Fi,reloadPage:fn,toggleModelDropdown:Ds,selectModel:zi,openLlmConfig:Ki,trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,closeLlmConfigFromOverlay:Gi,openSessionCreate:mn,onSessionCreated:hn,copyOnboardingCommand:Lt,copiedOnboardingCommand:d,onLlmConfigMessage:Es,onLlmConfigSaved:ot,formatTokens:ss,formatModelCtx:ji,toggleSettings:No,onSettingsSaved:ae,sidebarV2Enabled:H,onSelectGroupV2:U,onSelectChat:ie,canUseWorkbench:N,shouldShowInviteModal:vn,inviteGroupName:Vt,onInviteOpenLibrary:Qi,onInviteDismiss:bn,isActiveGroupEmpty:ns,showOnboardingGuide:is,installAgentCommand:yn,connectAgentCommand:Ls,copilotCommand:rs,agentSecret:u,agentSecretLoading:p,agentSecretError:f,groupSettingsOpen:os,groupSettingsId:$s,groupSettingsAgentId:Ft,groupSettingsSection:Vs,groupSettingsEditVpId:wn,openSessionSettings:S,openAnnouncementSettings:L,closeGroupSettings:B,openVpLibraryFromGroupSettings:ue,openMemberEditor:be,showVpTimeline:De,vpTimelineRows:ye,sessionStatusTasksForActiveSession:Ue,sessionStatusAnnouncementText:Ni,sessionStatusVisible:Se,toggleSessionStatus:te,closeSessionStatus:Q,timelineWidthStyle:J,startTimelineResize:he,onEditVpFromTimeline:I=>{if(!I)return;let j=gn();j&&S({sessionId:j,section:"members",editVpId:I})},onMentionVpFromTimeline:I=>{if(!I)return;let j=A.value;j&&typeof j.appendMention=="function"&&j.appendMention(I)},onCancelVpFromTimeline:I=>{if(!I)return;let j=Ke(),le=e.yeaftActiveSessionFilter||j?.activeSessionId||null;le&&typeof e.cancelVpTurnForSession=="function"&&e.cancelVpTurnForSession(I,le)},onCancelTaskFromTimeline:I=>!I?.id||!I.sessionId||typeof e.cancelYeaftTask!="function"?!1:e.cancelYeaftTask({sessionId:I.sessionId,taskId:I.id})}}}});var ph=sf(()=>{Hn();ct();gs();Ic();bt();Pc();_c();Rc();$c();ip();tf();wo();Jr();window.Pinia={...Pinia,useChatStore:null,useAuthStore:null};var dh={components:{LoginPage:Lc,ChatPage:np,YeaftPage:ef},template:`
|
|
7825
7825
|
<div v-if="!authStore.initialized" class="auth-bootstrap" aria-busy="true"><span class="session-loading-spinner"></span></div>
|
|
7826
7826
|
<LoginPage v-else-if="!authStore.isAuthenticated" />
|
|
7827
7827
|
<template v-else>
|
|
7828
7828
|
<YeaftPage v-if="chatStore.currentView === 'yeaft'" />
|
|
7829
7829
|
<ChatPage v-else />
|
|
7830
7830
|
</template>
|
|
7831
|
-
`,setup(){let e=zt(),t=Ae();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}}},$i=Vue.createApp(
|
|
7831
|
+
`,setup(){let e=zt(),t=Ae();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}}},$i=Vue.createApp(dh),uh=Pinia.createPinia();$i.use(uh);jo($i,{"zh-CN":Dc,en:Ec});Mc();window.Pinia.useChatStore=zt;window.Pinia.useAuthStore=Ae;window.Pinia.useVpStore=ft;window.Pinia.useSessionsStore=Cc;$i.component("ToolLine",Jn);$i.mount("#app")});export default ph();
|