@yeaft/webchat-agent 1.0.263 → 1.0.265

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.
@@ -7,9 +7,9 @@ ${u}`:u,f=!0;break}}if(!f){for(let p=l.length-1;p>=0;p--)if(l[p].type==="tool-us
7
7
 
8
8
  `))}function Kn(e){let t=Array.isArray(e?.textSegments)?e.textSegments:[];if(t.length===0)return;let s=Array.isArray(e?.messages)?e.messages:[],n=e?.isActive===!0||e?.isStreaming===!0||t.some(l=>l.isStreaming===!0)||s.some(l=>l?.isStreaming===!0||l?.status==="pending"),i=s.some(l=>l?.incomplete===!0||qr.has(l?.status)||qr.has(l?.turnEndReason)||qr.has(l?.stopReason));if(n||i){for(let l of t)l.kind="progress";return}if(t.some(l=>l.kind==="result"))return;let r=s.some(l=>l?.turnEndReason==="end_turn"),o=t.some(l=>l.explicitKind),a=t.length===1&&!o;(r||a||e.isHistory&&!o)&&(t[t.length-1].kind="result")}var qr,Gn=H(()=>{qr=new Set(["aborted","errored","error","cancelled","canceled"])});function Wr(e){return e?.type==="user"&&typeof e.content=="string"&&e.content.trim()}function Ur(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 zr(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 Sc(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(Wr(r)||r.type==="system"||r.type==="error"){n(i),s={start:i,kind:r.type};continue}if(!Ur(r)){s||(s={start:i,kind:"other"});continue}(!s||s.kind==="assistant"&&zr(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 Cc(e,t){return t?e&&(e.sessionId??e.groupId)===t:!0}function jr(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(!Cc(c,t))continue;let d=i.length;if(i.push(c),Wr(c)||c.type==="system"||c.type==="error"){a(d),o={start:d,kind:c.type};continue}if(!Ur(c)){o||(o={start:d,kind:"other"});continue}(!o||o.kind==="assistant"&&zr(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 Ic(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(Cc(a,t)){if(Wr(a)||a.type==="system"||a.type==="error"){if(o())return!0;r={kind:a.type};continue}if(!Ur(a)){r||(r={kind:"other"});continue}if(!r||r.kind==="assistant"&&zr(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 Zt(){return 5}function en(){return 20}var Ac=H(()=>{});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 Mc(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 Kg(e,t){return Qr.every(s=>!t[s]||e[s]===t[s])}function Hc(e,t){return Qr.every(s=>!e[s]||!t[s]||e[s]===t[s])}function Pc(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=>Kg(Mc(o,s),t));if(i.length===1)return i[0];let r=n.filter(o=>Hc(Mc(o,s),t));return r.length===1?r[0]:null}function Nc(e){return Qr.map(t=>e[t]||"").join("\0")}function Gg(e,t,s){let n=Nc(t),i={...e._yeaftAskTerminalEvents||{},[n]:{identity:t,event:s,receivedAt:Date.now()}},r=Object.keys(i);if(r.length>xc){r.sort((o,a)=>i[o].receivedAt-i[a].receivedAt);for(let o of r.slice(0,r.length-xc))delete i[o]}e._yeaftAskTerminalEvents=i}function Dc(e,t){let s=e._yeaftAskTerminalEvents||{},n=Nc(t),i=s[n]?n:null;if(!i){let l=Object.entries(s).filter(([,c])=>Hc(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 Yg(e,t,s){return(e.messagesMap?.[t]||[]).some(n=>n?.type==="tool-use"&&n.sessionId===s&&n.hasResult===!1)}function Kr(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 Qg(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 Xg(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 tn(e){return e?.role==="assistant"&&e?.turnId?`response:${e.turnId}:${e.speakerVpId||e.vpId||""}`:e?.clientMessageId?`client:${e.clientMessageId}`:`message:${e?.messageId||""}`}function _c(e){let t=e?.updatedAt||e?.endedAt||e?.createdAt,s=t?Date.parse(t):NaN;return Number.isFinite(s)?s:0}function Gr(e,t){return`${e||""}::${t||""}`}function Ec(e){let t=Object.entries(e||{}),s=t.filter(([,i])=>i?.status==="running"),n=t.filter(([,i])=>i&&i.status!=="running"&&Oc.has(i.status)).sort((i,r)=>_c(r[1])-_c(i[1])).slice(0,Ug);return Object.fromEntries([...s,...n])}function Cs(){try{return typeof window>"u"?null:window.Pinia?.useSessionsStore?.()||window.__useSessionsStore&&window.__useSessionsStore()||null}catch{return null}}function $e(e,t,s=null){if(s)return s;if(t){let n=Cs(),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 Zg(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 Rc(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"&&Zg(n?.version||i?.version,"1.0.166")}function sn(e,{fallbackDefault:t=!1}={}){if(e?.yeaftActiveSessionFilter)return e.yeaftActiveSessionFilter;let s=Cs();return s?.activeSessionId?s.activeSessionId:t?"grp_default":null}function Zn(e){let t=e.yeaftDebugSessionFilter;if(t==="__all__")return null;if(t)return t;let s=sn(e);return s||(Cs()?.sessions?.grp_default?"grp_default":null)}function wt(e,t=null){let s=t||e?.yeaftActiveSessionFilter||null,n=$e(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=$e(e,n);return!i||!s||i===s}var Wg,Le,Yn,Qn,Ug,Oc,Xn,zg,jg,xc,Qr,$c,Yr,Vc,Fc,Jt,Jn=H(()=>{lt();bt();mr();Fn();ml();Il();Yl();Ut();jt();tc();ic();oc();lc();Br();Mr();Xt();Gn();Pr();Ac();({defineStore:Wg}=Pinia),Le=Object.freeze([]),Yn=(e,t)=>`${e||""}::${t}`,Qn=5,Ug=8,Oc=new Set(["succeeded","failed","cancelled","orphaned"]),Xn=new Set(["typing","thinking","retrying","streaming","tool"]),zg=Object.freeze(["model","availableModels","refreshedAt","catalogRefreshedAt","catalogEpoch","catalogRevision","catalogDigest","refreshStartedAt","refreshReason","refreshError","refreshing"]),jg=8,xc=64;Qr=Object.freeze(["conversationId","agentId","requestId","toolCallId","sessionId","vpId","turnId","threadId"]);$c=1e3,Yr=1,Vc=5,Fc=200,Jt=Wg("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:"",senderKey:"",loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null},yeaftHistoryOutlineBySession:{},_yeaftHistoryOutlineTimeouts:{},_yeaftHistorySearchTimeout:null,_yeaftHistoryWindowPendingByKey:{},_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")||"[]"),...Zl(),workCenterOpen:!1,workCenterAgentId:null,workCenterItemsByAgent:{},workCenterListPageByAgent:{},workCenterListMoreLoadingByAgent:{},_workCenterListGenerationByAgent:{},_workCenterListQueryByAgent:{},_workCenterListFiltersByAgent:{},_workCenterListMoreRequestsByAgent:{},_workCenterListEventGenerationByAgent:{},_workCenterListEventsByAgent:{},_workCenterDeletedIdsByAgent:{},workCenterDetailByAgent:{},workCenterActionMessages:{},workCenterActionMessagesLoading:{},workCenterActionMessagesError:{},workCenterActionRequests:{},workCenterActionRequestDetails:{},workCenterActionRequestsLoading:{},workCenterActionRequestsError:{},workCenterActionRequestDetailsLoading:{},workCenterActionRequestDetailsError:{},workCenterLoadedByAgent:{},workCenterLoadingByAgent:{},workCenterErrorByAgent:{},workCenterWatcherByAgent:{},workCenterSettingsByAgent:{},workCenterRuntimeByAgent:{},workCenterSettingsLoadingByAgent:{},workCenterSettingsErrorByAgent:{},_workCenterSettingsGenerationByAgent:{},_workCenterDetailRequestGenerationByAgent:{},_workCenterDetailEventRefreshByAgent:{},_workCenterActionInputGenerationByAgent:{},_workCenterActionMessageRequests:{},_workCenterActionMessageGenerationByKey:{},_workCenterActionRequestsGeneration:{},_workCenterActionRequestDetailsGeneration:{},workCenterPending:{},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:Yr,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=>rc(e),messages(e){let t=this.activeConversationId,s=t&&e.messagesMap[t]||Le;if(e.currentView==="yeaft"){let n=e.yeaftActiveSessionFilter||"__all__",i=e.yeaftMessageWindowState[n]?.visibleTurns||Zt();return jr(s,e.yeaftActiveSessionFilter||null,i)}return s},yeaftAllMessages:e=>{let t=wt(e);return t&&e.messagesMap[t]||Le},yeaftVisibleMessages(e){let t=wt(e),s=t&&e.messagesMap[t]||Le,n=e.yeaftActiveSessionFilter||"__all__",i=e.yeaftMessageWindowState[n]?.visibleTurns||Zt();return jr(s,e.yeaftActiveSessionFilter||null,i)},hasHiddenYeaftMessages(e){if(e.currentView!=="yeaft")return!1;let t=wt(e),s=t&&e.messagesMap[t]||Le,n=e.yeaftActiveSessionFilter||"__all__",i=e.yeaftMessageWindowState[n]?.visibleTurns||Zt();return Ic(s,e.yeaftActiveSessionFilter||null,i)},vpsTypingInCurrentConv(e){let t=this.activeConversationId;if(!t)return Le;let s=(e.yeaftVpTyping||{})[t];if(!s)return Le;let n=Object.keys(s).filter(i=>(s[i]||0)>0);return n.length===0?Le: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=Zn(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamLatest?.[s]||null},yeaftDreamSnapshotForActiveSession(e){let t=Zn(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamSnapshots?.[s]||null},yeaftDreamPromptLoadForActiveSession(e){let t=Zn(e);if(!t)return null;let s=`sessions/${t}`;return e.yeaftDreamPromptLoads?.[s]||null},yeaftDreamEventsForActiveSession(e){let t=Zn(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||Le,s=e.yeaftDebugTurnsById||{},n=e.yeaftDebugLoops||Le,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],f=s[u];if(!f||o&&f.sessionId&&f.sessionId!==o)continue;let p=a[u]||Le,g=l[u]||Le,b=p.length,h=0,A=0;for(let v of p){let m=v&&v.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)),v&&Number.isFinite(v.latencyMs)&&(A+=v.latencyMs)}let w=!f.closedAt,S={...f,loopCount:w||!f.loopCount?b:f.loopCount,totalTokens:w||!f.totalTokens?h:f.totalTokens,totalMs:w||!f.totalMs?A:f.totalMs,loops:p,reflections:g};c.push(S)}return c},yeaftDebugAvailableSessions:e=>{let t=new Set;for(let s of e.yeaftDebugTurnOrder||Le){let n=e.yeaftDebugTurnsById[s];n&&n.sessionId&&t.add(n.sessionId)}return Array.from(t).sort()},yeaftDebugTurnTotal:e=>(e.yeaftDebugTurnOrder||Le).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=sn(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&&Xn.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"?Cs()?.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&&Xn.has(s?.state))return!0;return!1},showRecoveryBanner:e=>e.pendingRecovery&&!e.recoveryDismissed&&!e.currentConversation,currentSubagents:e=>{if(!e.currentConversation)return Le;let t=e.subagents[e.currentConversation];return t?Object.values(t):Le},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 Le;let t=e.subagents[e.currentConversation];if(!t)return Le;let s=t[e.activeSubagentId];return(Array.isArray(s?.messages)?s.messages:Le).filter(i=>i?.type==="text")},selectedTaskInfo:()=>null,currentMcpServers:e=>e.currentConversation&&e.conversationMcpServers[e.currentConversation]||Le},actions:{activateChatView({persistPreference:e=!1}={}){let t=this._pendingChatRestoreConversationId;this._pendingChatRestoreConversationId=null,this.currentView="chat",e&&Fr("chat"),ec(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||$e(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)},applyWorkItemBoardSummary(e,t,s={}){let n=Un(e,t),i=n.find(r=>r?.id===t?.id)||null;return!i||this.workItemMatchesBoardQuery(i,s)?n:n.filter(r=>r.id!==i.id)},async listWorkItems(e=null,t={}){let s=e||this.workCenterAgentId||this.currentAgent;if(!s)return[];let n={lane:["needs_attention","active","closed"].includes(t.lane)?t.lane:null,keyword:String(t.keyword||t.search||"").trim(),vpId:String(t.vpId||"").trim(),workItemType:String(t.workItemType||"").trim(),createdFrom:Number(t.createdFrom)||null,createdTo:Number(t.createdTo)||null,updatedFrom:Number(t.updatedFrom)||null,updatedTo:Number(t.updatedTo)||null,limit:Math.min(Math.max(Number(t.limit)||100,1),200)},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 f of Object.values(u))Number(f?.generation)<=o||f?.queryKey!==i||(d=this.applyWorkItemBoardSummary(d,f.summary,n));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 f=[...this.workCenterItemsByAgent[t]||[]];for(let g of Array.isArray(d?.items)?d.items:[]){if(this.workItemDeleted(t,g?.id))continue;let b=f.findIndex(h=>h.id===g.id);b<0?f.push(g):f[b]=Un([f[b]],g)[0]}let p=this._workCenterListEventsByAgent[t]||{};for(let g of Object.values(p))Number(g?.generation)<=o||g?.queryKey!==i||(f=this.applyWorkItemBoardSummary(f,g.summary,n));return this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[t]:f},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","_workCenterActionMessageGenerationByKey","_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&&hc(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},invalidateWorkItemActionMessages(e,t,s,n){if(!e||!t||!s)return null;let i=et(n),r=ks(e,t,s,i);this._workCenterActionMessageGenerationByKey={...this._workCenterActionMessageGenerationByKey,[r]:Number(this._workCenterActionMessageGenerationByKey[r]||0)+1};for(let a of["workCenterActionMessages","workCenterActionMessagesLoading","workCenterActionMessagesError"]){let l={...this[a]};delete l[r],this[a]=l}let o={...this._workCenterActionMessageRequests};for(let a of Object.keys(o))a.startsWith(`${r}:`)&&delete o[a];return this._workCenterActionMessageRequests=o,r},async loadWorkItemActionMessages(e,t,s,n,i=null){let r=i||this.workCenterAgentId||this.currentAgent,o=et(s),a=ks(r,e,t,o),l=Number(this._workCenterActionMessageGenerationByKey[a]||0),c=`${a}:${n==null?"latest":String(n)}`;if(this._workCenterActionMessageRequests[c])return this._workCenterActionMessageRequests[c];this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[a]:!0},this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[a]:null};let d=(async()=>{try{let u=await this.workCenterRequest("get_action_messages",{id:e,actionId:t,generation:o,cursor:n,limit:20},r);if(this.workItemDeleted(r,e)||et(u?.generation)!==o||Number(this._workCenterActionMessageGenerationByKey[a]||0)!==l)return u;let f=this.workCenterActionMessages[a]?.messages||[],p=Zs(f,u?.messages||[]),g=this.workCenterActionMessages[a],b=g?.nextCursor,h=n==null?null:Number(n),A=b==null?null:Number(b),w=!g||h==null||A!=null&&h===A;return this.workCenterActionMessages={...this.workCenterActionMessages,[a]:{generation:o,messages:p,nextCursor:w?u?.nextCursor??null:b,total:Math.max(Number(u?.total)||0,Number(g?.total)||0,p.length)}},u}catch(u){throw Number(this._workCenterActionMessageGenerationByKey[a]||0)===l&&(this.workCenterActionMessagesError={...this.workCenterActionMessagesError,[a]:u?.message||String(u)}),u}finally{if(this._workCenterActionMessageRequests[c]===d){let u={...this._workCenterActionMessageRequests};delete u[c],this._workCenterActionMessageRequests=u;let f=Object.keys(u).some(p=>p.startsWith(`${a}:`));this.workCenterActionMessagesLoading={...this.workCenterActionMessagesLoading,[a]:f}}}})();return this._workCenterActionMessageRequests={...this._workCenterActionMessageRequests,[c]:d},d},async loadWorkItemActionRequests(e,t,s,n=null){let i=n||this.workCenterAgentId||this.currentAgent,r=et(s),o=Js(i,e,t,r),a=Number(this._workCenterActionRequestsGeneration[o]||0)+1;this._workCenterActionRequestsGeneration={...this._workCenterActionRequestsGeneration,[o]:a},this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[o]:!0},this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[o]:null};try{let l=await this.workCenterRequest("get_action_requests",{id:e,actionId:t,generation:r},i),c=!this.workItemDeleted(i,e)&&et(l?.generation)===r&&this._workCenterActionRequestsGeneration[o]===a;return c&&(this.workCenterActionRequests={...this.workCenterActionRequests,[o]:l?.requests||[]}),c?l?.requests||[]:this.workCenterActionRequests[o]||[]}catch(l){throw this._workCenterActionRequestsGeneration[o]===a&&(this.workCenterActionRequestsError={...this.workCenterActionRequestsError,[o]:l?.message||String(l)}),l}finally{this._workCenterActionRequestsGeneration[o]===a&&(this.workCenterActionRequestsLoading={...this.workCenterActionRequestsLoading,[o]:!1})}},async loadWorkItemActionRequest(e,t,s,n,i,r=null){let o=r||this.workCenterAgentId||this.currentAgent,a=et(s),c=`${Js(o,e,t,a)}:${n}:${i}`,d=Number(this._workCenterActionRequestDetailsGeneration[c]||0)+1;this._workCenterActionRequestDetailsGeneration={...this._workCenterActionRequestDetailsGeneration,[c]:d},this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[c]:!0},this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[c]:null};try{let u=await this.workCenterRequest("get_action_request",{id:e,actionId:t,generation:a,runId:n,requestId:i},o),f=!this.workItemDeleted(o,e)&&et(u?.generation)===a&&this._workCenterActionRequestDetailsGeneration[c]===d;return f&&(this.workCenterActionRequestDetails={...this.workCenterActionRequestDetails,[c]:u?.request||null}),f?u?.request||null:this.workCenterActionRequestDetails[c]||null}catch(u){throw this._workCenterActionRequestDetailsGeneration[c]===d&&(this.workCenterActionRequestDetailsError={...this.workCenterActionRequestDetailsError,[c]:u?.message||String(u)}),u}finally{this._workCenterActionRequestDetailsGeneration[c]===d&&(this.workCenterActionRequestDetailsLoading={...this.workCenterActionRequestDetailsLoading,[c]:!1})}},async loadWorkCenterSettings(e=null){let t=e||this.workCenterAgentId||this.currentAgent;if(!t)throw new Error("No Agent selected");let s=Number(this._workCenterSettingsGenerationByAgent[t]||0)+1;this._workCenterSettingsGenerationByAgent={...this._workCenterSettingsGenerationByAgent,[t]:s},this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!0},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:null};try{let n=await this.workCenterRequest("get_settings",{},t);return this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[t]:n?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[t]:n?.runtime||null}),n}catch(n){throw this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:n?.message||String(n)}),n}finally{this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!1})}},async refreshWorkCenterRuntime(e=null){let t=e||this.workCenterAgentId||this.currentAgent;if(!t)throw new Error("No Agent selected");let s=Number(this._workCenterSettingsGenerationByAgent[t]||0)+1;this._workCenterSettingsGenerationByAgent={...this._workCenterSettingsGenerationByAgent,[t]:s},this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!0},this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:null};try{let n=await this.workCenterRequest("refresh_runtime",{},t);return this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsByAgent={...this.workCenterSettingsByAgent,[t]:n?.settings||null},this.workCenterRuntimeByAgent={...this.workCenterRuntimeByAgent,[t]:n?.runtime||null}),n}catch(n){throw this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsErrorByAgent={...this.workCenterSettingsErrorByAgent,[t]:n?.message||String(n)}),n}finally{this._workCenterSettingsGenerationByAgent[t]===s&&(this.workCenterSettingsLoadingByAgent={...this.workCenterSettingsLoadingByAgent,[t]:!1})}},async saveWorkCenterSettings(e,t=null){let s=t||this.workCenterAgentId||this.currentAgent;if(!s)throw new Error("No Agent selected");let n=Number(this._workCenterSettingsGenerationByAgent[s]||0)+1;this._workCenterSettingsGenerationByAgent={...this._workCenterSettingsGenerationByAgent,[s]:n};let 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 resumeWorkItem(e,t,s=null){let n=s||this.workCenterAgentId||this.currentAgent,i=this.beginWorkCenterDetailWrite(n),r=await this.workCenterRequest("resume",{id:e,revision:t},n);return await this.listWorkItems(n,this._workCenterListFiltersByAgent[n]||{}),this.commitWorkCenterDetail(n,r,i),r},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=[],i=null,r={}){let o=i||this.workCenterAgentId||this.currentAgent,a=this.workCenterDetailByAgent[o]?.id===e?this.workCenterDetailByAgent[o]:null,l=await this.workCenterRequest("work_item_message",{id:e,text:t,revision:s,planRevision:Number.isInteger(Number(r.planRevision))?Number(r.planRevision):Number(a?.planRevision)||0,ledgerRevision:Number.isInteger(Number(r.ledgerRevision))?Number(r.ledgerRevision):Number(a?.ledgerRevision)||0,coordinatorRevision:Number.isInteger(Number(r.coordinatorRevision))?Number(r.coordinatorRevision):Number(a?.coordinatorRevision)||0,attachments:Array.isArray(n)?n:[]},o);if(!l?.accepted)throw new Error("Work Center Coordinator did not accept the message");return l},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);if(c?.accepted&&c?.routedTo==="coordinator")return c;await this.listWorkItems(a,this._workCenterListFiltersByAgent[a]||{});let d=this.workCenterDetailByAgent[a],u=d?.actions?.find(p=>p?.id===s),f=d?.id===e&&Number(d.revision)===Number(n)&&u&&Number(u.generation)===Number(i);return this._workCenterActionInputGenerationByAgent[a]===l&&f&&!uc(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._workCenterListEventsByAgent[e]?.[s.id]?.summary||null,o=n.some(u=>u?.id===s.id)?n:r?[r]:[],a=Un(o,s).find(u=>u?.id===s.id)||s,l=Number(this._workCenterListEventGenerationByAgent[e]||0)+1;this._workCenterListEventGenerationByAgent={...this._workCenterListEventGenerationByAgent,[e]:l},this._workCenterListEventsByAgent={...this._workCenterListEventsByAgent,[e]:{...this._workCenterListEventsByAgent[e]||{},[s.id]:{generation:l,queryKey:this._workCenterListQueryByAgent[e]||null,summary:a}}};let c=this.applyWorkItemBoardSummary(n,a,i);this.workCenterItemsByAgent={...this.workCenterItemsByAgent,[e]:c};let d=this.workCenterDetailByAgent[e];if(d?.id===s.id){let u=t.type==="run.finished"&&t.actionId&&Array.isArray(s.actionStats)&&s.actionStats.some(A=>A?.id===t.actionId)?{...s,eventActionId:t.actionId}:s,f=Nr(d,u),p=Number(s.coordinatorRevision),g=Number(d.coordinatorRevision)||0,b=Number.isInteger(p)&&p>g,h=pc(d,u);this.workCenterDetailByAgent={...this.workCenterDetailByAgent,[e]:fc(d,s)},h&&this.refreshWorkItemDetailAfterActionChange(e,s,b?null:f)}},async refreshWorkItemDetailAfterActionChange(e,t,s=null){let n=s?(Array.isArray(t.actionStats)?t.actionStats:[]).find(b=>b?.id===s.actionId):(Array.isArray(t.actionStats)?t.actionStats:[]).find(b=>b?.id===t.currentActionId)||t.currentAction,i=s?.actionId||t.currentActionId||null,r=Number(s?.generation??n?.generation),o=Number.isInteger(r)&&r>0?r:null,a=Number(t.coordinatorRevision),l=!s&&Number.isInteger(a)&&a>=0?a:null,c=Number(s?.attempt),d=Number.isInteger(c)&&c>=0?c:null,u=l!=null?`${t.id}:coordinator:${l}`:`${t.id}:${i}${o==null?"":`:${o}`}${d==null?"":`:${d}`}`;if(this._workCenterDetailEventRefreshByAgent[e]?.key===u)return;let f=this.beginWorkCenterDetailWrite(e),p={key:u,generation:f};this._workCenterDetailEventRefreshByAgent={...this._workCenterDetailEventRefreshByAgent,[e]:p},s&&this.invalidateWorkItemActionMessages(e,t.id,s.actionId,s.generation);let g=i&&o!=null?this.loadWorkItemActionMessages(t.id,i,o,null,e).catch(()=>null):null;try{let b=await this.workCenterRequest("get",{id:t.id},e),h=this.workCenterDetailByAgent[e],A=h?.actions?.find(E=>E?.id===i),w=b?.actions?.find(E=>E?.id===i),S=o==null||et(A?.generation)===o,v=o==null||et(w?.generation)>=o,m=l==null||Number(b?.coordinatorRevision)===l,y=l!=null||S&&v&&(t.currentActionId==null?b?.currentActionId==null:h?.currentActionId===t.currentActionId&&b?.currentActionId===t.currentActionId);h?.id===t.id&&m&&y&&this.commitWorkCenterDetail(e,b,f)&&g&&await g}catch{}finally{if(this._workCenterDetailEventRefreshByAgent[e]===p){let b={...this._workCenterDetailEventRefreshByAgent};delete b[e],this._workCenterDetailEventRefreshByAgent=b}}},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),f=Array.isArray(this._yeaftRetiredCatalogEpochsByAgent?.[e])?this._yeaftRetiredCatalogEpochsByAgent[e]:[],p=!!a&&f.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,w=u&&!p&&(h||b&&A),v=w||s&&i===0&&l===0&&!u&&d,m={...t};if(!v)for(let E of zg)delete m[E];let y={...n,...m};if(v){if(w&&o&&a&&o!==a){let E=[...f.filter($=>$!==o),o].slice(-jg);this._yeaftRetiredCatalogEpochsByAgent={...this._yeaftRetiredCatalogEpochsByAgent||{},[e]:E}}y.availableModels=t.availableModels,y.catalogRefreshedAt=w?c:null,y.catalogEpoch=w&&a||null,y.catalogRevision=w&&r||null,y.catalogDigest=w&&t.catalogDigest||null}this.yeaftStatusByAgent={...this.yeaftStatusByAgent,[e]:y},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]=[]),Jl(this),this.currentView="yeaft",Fr("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=sn(this),i=n?$e(this,n):this.currentAgent,r=Be(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&&Cr({sessionState:o,hasCachedSessionRows:c,force:!!s}),u=!!n&&!d&&Ua(o,t);if(!a&&!d&&!u)return!1;let f=`${i}:${n||"__none__"}`,p=a&&!d&&!u;if(p&&this.yeaftBootstrapMetaLoadingKey===f)return!1;p&&(this.yeaftBootstrapMetaLoadingKey=f),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?Qn:0;let b=Ys();g.perfTraceId=b;let h=u?"delta":d?"recent":"metadata";return n&&(this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[r]:b}),Ye(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?Vc:Yr,c=Number.isFinite(t)&&t>0?t:this.yeaftDebugHistoryLimit||l,d=Math.max(1,Math.min(l,c)),u=a?"detail":"list",f=`dbg_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,p=JSON.stringify({agentId:this.currentAgent,groupId:e||null,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5,indexOnly:!!n,detailTurnId:i||null,search:a?"":o});if(this._yeaftDebugHistoryInFlightKey===p)return;this._yeaftDebugHistoryInFlightKey=p,a||(this._yeaftDebugHistoryLatestListRequestId=f),this.yeaftDebugHistoryLimit=d,this.yeaftDebugHistoryLoading=!0,this.yeaftDebugHistoryError=null;let g={type:"yeaft_fetch_debug_history",agentId:this.currentAgent,requestId:f,requestKind:u,limit:d,dreamLimit:Number.isFinite(s)&&s>0?s:5};n&&(g.indexOnly=!0),typeof 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 $e(this,e)},sendYeaftSessionMessage({groupId:e,text:t,mentions:s,attachments:n,quote:i}){let r=$e(this,e);if(!e||!r)return;let o=Array.isArray(n)?n.filter(g=>g&&g.fileId):[],a=zn(i),l=o.length>0;if(!t?.trim()&&!l)return;let c=t?.trim()?t:"(attached files)",d=`u_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`,u=Ys();this.yeaftPerfTraceByMessageId={...this.yeaftPerfTraceByMessageId||{},[d]:u},Ye(this,{traceId:u,phase:"send.prepare",agentId:r,sessionId:e,turnId:d,messageType:"yeaft_session_send",detail:{mentionCount:Array.isArray(s)?s.length:0,attachmentCount:o.length,quoted:!!a}});let f=wt(this,e);if(f){let g={id:d,messageId:d,clientMessageId:d,type:"user",content:c,sessionId:e,turnId:d,...a?{quote:a}:{}};o.length>0&&(g.attachments=o.map(b=>({fileId:b.fileId,name:b.name,preview:b.preview,isImage:!!b.isImage,mimeType:b.mimeType||""}))),this.addMessageToConversation(f,g),this.processingConversations[f]=!0,e&&(this.yeaftProcessingSessions={...this.yeaftProcessingSessions,[e]:!0}),this._turnCompletedConvs?.delete(f),this._closedAt?.[f]&&delete this._closedAt[f],this.getOrCreateExecutionStatus(f),Ar(this,f)}let p={type:"yeaft_session_send",agentId:r,id:d,sessionId:e,text:c,mentions:Array.isArray(s)?s:[],perfTraceId:u,...a?{quote:a}:{}};o.length>0&&(p.attachments=o.map(g=>({fileId:g.fileId,isImage:!!g.isImage}))),Ye(this,{traceId:u,phase:"send.websocket_send",agentId:r,sessionId:e,turnId:d,messageType:p.type,bytes:JSON.stringify(p).length}),this.sendWsMessage(p)},cancelYeaftTask({sessionId:e,taskId:t}){let s=typeof e=="string"?e.trim():"",n=typeof t=="string"?t.trim():"",i=$e(this,s);return!i||!s||!n?!1:(this.yeaftStoppingTasksById={...this.yeaftStoppingTasksById,[Gr(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:Zt()}}},expandYeaftMessageWindow(e=null,t=en()){if(this.currentView!=="yeaft")return;let s=this.getYeaftMessageWindowKey(e),i=(this.yeaftMessageWindowState[s]?.visibleTurns||Zt())+Math.max(1,Number.isFinite(t)?Math.floor(t):en());this.yeaftMessageWindowState={...this.yeaftMessageWindowState,[s]:{visibleTurns:i}}},isYeaftMessageCached(e,t,s=null){let n=e||this.yeaftActiveSessionFilter||null,i=s||wt(this,n);return!i||!t?!1:(this.messagesMap[i]||[]).some(r=>(!n||(r?.sessionId??r?.groupId??null)===n)&&((r?.id||r?.messageId)===t||r?.persistedMessageId===t))},revealYeaftMessage(e,t,s=null){let n=e||this.yeaftActiveSessionFilter||null,i=s||wt(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=Sc(r),l=a.findIndex(u=>o>=u.start&&o<u.end);if(l<0)return!1;let c=Math.max(Zt(),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=$e(this,s,t),i=Be(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=wt(this,s),a=o?this.messagesMap[o]||[]:[],l=new Map((r.results||[]).map(f=>[tn(f),f])),c=0;for(let f of a){if((f?.sessionId??f?.groupId??null)!==s)continue;let p=f.messageId||f.id;if(!p)continue;let g=f.type==="user"&&!!f.clientMessageId&&p===f.clientMessageId,b=f.type==="assistant"&&f.isStreaming===!0;if(!g&&!b)continue;let h=f.type,A=f.turnId||f.threadId||p,w=f.speakerVpId||f.vpId||null,S=tn({role:h,messageId:p,clientMessageId:f.clientMessageId,turnId:A,speakerVpId:w}),v=l.get(S),y=(typeof f.content=="string"?f.content:"").replace(/\s+/g," ").trim();l.set(S,{...v,messageId:Number.isFinite(v?.seq)?v.messageId:p,...f.clientMessageId?{clientMessageId:f.clientMessageId}:{},turnId:A,role:h,speakerVpId:w||v?.speakerVpId||null,timestamp:f.timestamp||f.ts||v?.timestamp||null,snippet:y.length>180?`${y.slice(0,180).trimEnd()}\u2026`:y||v?.snippet||""}),v||(c+=1)}let d=f=>{let p=typeof f=="number"?f:Date.parse(f||"");return Number.isFinite(p)?p:0},u=Array.from(l.values()).sort((f,p)=>Number.isFinite(f.seq)&&Number.isFinite(p.seq)?f.seq-p.seq:d(f.timestamp)-d(p.timestamp));return{...r,results:u,totalCount:Number.isFinite(r.totalCount)?r.totalCount+c:r.totalCount}},promoteYeaftHistoryOutlineRow(e){let t=e?.sessionId??e?.groupId??null,s=$e(this,t),n=Be(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=Xg(o);if(!o||!Number.isFinite(a))return!1;let l=e.turnId||e.threadId||o,c=e.speakerVpId||e.vpId||null,u=(typeof e.content=="string"?e.content:"").replace(/\s+/g," ").trim(),f=tn({role:r,messageId:o,clientMessageId:e.clientMessageId,turnId:l,speakerVpId:c}),p=new Map((i.results||[]).map(S=>[tn(S),S])),g=p.get(f);p.set(f,{...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(p.values()).sort((S,v)=>(S.seq||0)-(v.seq||0)),A=h.length>b,w=h.slice(-b);return this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[n]:{...i,results:w,hasMore:i.hasMore||A,nextBeforeSeq:A&&Number.isFinite(w[0]?.seq)?w[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=$e(this,e),s=Be(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||$e(this,i);if(!i||!r)return!1;let o=Be(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(!Rc(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 f=this.yeaftHistoryOutlineBySession[o];if(f?.requestId!==l)return;let p={...this._yeaftHistoryOutlineTimeouts};delete p[o],this._yeaftHistoryOutlineTimeouts=p;let g=f.refreshPending===!0;this.yeaftHistoryOutlineBySession={...this.yeaftHistoryOutlineBySession,[o]:{...f,requestId:null,loading:!1,requestAppend:!1,loaded:g?!1:f.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=Be(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=>[tn(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,senderKey:s=""}={}){if(this.currentView!=="yeaft")return!1;let n=typeof e=="string"?e.trim():"",i=typeof s=="string"&&(s==="user"||s.startsWith("vp:"))?s.slice(0,103):"",r=this.yeaftActiveSessionFilter||null,o=$e(this,r);if(this._yeaftHistorySearchTimeout&&(clearTimeout(this._yeaftHistorySearchTimeout),this._yeaftHistorySearchTimeout=null),!r||!o||n.length<2&&!i)return this.yeaftHistorySearchState={requestId:null,agentId:o,sessionId:r,query:n,senderKey:i,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null},!1;let a=this.yeaftHistorySearchState||{};if(!Rc(this,o,"session_history_search"))return this.yeaftHistorySearchState={requestId:null,agentId:o,sessionId:r,query:n,senderKey:i,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:"unsupported"},!1;let l=`history_search_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;return this.yeaftHistorySearchState={requestId:l,agentId:o,sessionId:r,query:n,senderKey:i,loading:!0,results:t&&a.query===n&&a.senderKey===i?a.results:[],hasMore:!1,nextBeforeSeq:t&&a.query===n&&a.senderKey===i?a.nextBeforeSeq:null,error:null},this._yeaftHistorySearchTimeout=setTimeout(()=>{this.yeaftHistorySearchState?.requestId===l&&(this._yeaftHistorySearchTimeout=null,this.yeaftHistorySearchState={...this.yeaftHistorySearchState,loading:!1,error:"timeout"})},1e4),this.sendWsMessage({type:"yeaft_search_history",agentId:o,sessionId:r,requestId:l,query:n,senderKey:i,limit:20,...t&&a.query===n&&a.senderKey===i&&Number.isFinite(a.nextBeforeSeq)?{beforeSeq:a.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||(e.senderKey||"")!==t.senderKey)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=$e(this,t);if(!t||!s||!e?.messageId||!Number.isFinite(e.seq))return Promise.resolve(!1);if(this.isYeaftMessageCached(t,e.messageId))return Promise.resolve(!0);let n=Be(s,`${t}:${e.messageId}`),i=this._yeaftHistoryWindowPendingByKey||{};if(i[n]?.promise)return i[n].promise;let r=`history_window_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,o=null,a=new Promise(c=>{o=c}),l=setTimeout(()=>{if(this._yeaftHistoryWindowPendingByKey?.[n]?.requestId!==r)return;let{[n]:d,...u}=this._yeaftHistoryWindowPendingByKey;this._yeaftHistoryWindowPendingByKey=u,o(!1)},1e4);return this._yeaftHistoryWindowPendingByKey={...i,[n]:{requestId:r,agentId:s,sessionId:t,messageId:e.messageId,resolve:o,timeout:l,promise:a}},this.sendWsMessage({type:"yeaft_load_history_window",agentId:s,sessionId:t,requestId:r,anchorMessageId:e.messageId,anchorSeq:e.seq,beforeTurns:5,afterTurns:5}),a},async revealYeaftHistoryResult(e){let t=this.yeaftActiveSessionFilter||null,s=$e(this,t),n=wt(this,t);return!t||!s||!n||!e?.messageId||!await this.loadYeaftHistoryWindow(e)||this.currentView!=="yeaft"||this.yeaftActiveSessionFilter!==t||$e(this,t)!==s||wt(this,t)!==n?!1:this.revealYeaftMessage(t,e.messageId,n)},handleYeaftHistoryWindow(e,t=null){let n=Object.entries(this._yeaftHistoryWindowPendingByKey||{}).find(([,c])=>c?.requestId===e?.requestId);if(!n)return!1;let[i,r]=n;if(e.agentId!==r.agentId||e.sessionId!==r.sessionId)return!1;clearTimeout(r.timeout);let{[i]:o,...a}=this._yeaftHistoryWindowPendingByKey;this._yeaftHistoryWindowPendingByKey=a;let l=!e.error&&!!t&&this.isYeaftMessageCached(r.sessionId,r.messageId,t);return r.resolve(!!l),!!l},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&&(Ye(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){if(e.turnId&&this.activeVpTurns?.[e.turnId]?.retryAttempt){let{retryAttempt:n,retryMax:i,retryDelayMs:r,retryReason:o,retryRecoveryMode:a,...l}=this.activeVpTurns[e.turnId];this.activeVpTurns={...this.activeVpTurns,[e.turnId]:l}}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 f=this.messagesMap[o]||[],p=this.messagesMap[s]||[];this.messagesMap[s]=Sr(p,f).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 p=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(this.handleAssistantOutputFrame(s,e.data),e.perfTraceId){let v=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ye(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:v-p}),Nn(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=Qg(b),A=Array.isArray(g?.message?.content)?g.message.content:[],w=A.some(v=>v?.type==="tool_use"),S=!!g?.tool_use_result||A.some(v=>v?.type==="tool_result");if(i){let v=!S&&!Yg(this,s,i)&&(g?.type==="user"||g?.type==="assistant"&&!w)?h:null,m=Be(e.agentId||null,i),y=this.yeaftSessionHistoryState[m]||{},E=Number.isFinite(y.latestSeq)?y.latestSeq:-1;v!==null&&v>E&&(this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[m]:{...y,latestSeq:v}})}}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=Pc(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=Dc(this,n);return c&&Kr(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=Dc(this,n);return l&&Kr(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=Pc(n,i,s);if(!r){Gg(this,i,t);break}Kr(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]=Sr(h,b).sort((A,w)=>(A.timestamp||0)-(w.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:[],f={};for(let b of u)!b?.id||!b.sessionId||b.status!=="running"||(f[b.sessionId]={...f[b.sessionId]||{},[b.id]:b});this.yeaftActiveTasksBySession=f,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 p=e.agentId||this.currentAgent||null,g=p||"__current__";this._yeaftVpSubscribedAgentKey!==g&&(this._yeaftVpSubscribedAgentKey=g,this.sendWsMessage(p?{type:"yeaft_vp_subscribe",agentId:p}:{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>$c){let s=ac({loops:this.yeaftDebugLoops,turnsById:this.yeaftDebugTurnsById,turnOrder:this.yeaftDebugTurnOrder,maxLoops:Math.max($c,this.yeaftDebugHistoryLimit||0)});this.yeaftDebugLoops=s.loops,this.yeaftDebugTurnsById=s.turnsById,this.yeaftDebugTurnOrder=s.turnOrder}break}case"llm_retry":{if(!e.turnId)break;let s=this.activeVpTurns?.[e.turnId];if(!s)break;let n=t.reason==="stream_idle_timeout"?"stream_idle_timeout":"transient_error";this.activeVpTurns={...this.activeVpTurns,[e.turnId]:{...s,retryAttempt:t.attempt||0,retryMax:t.maxRetries||0,retryDelayMs:t.delayMs||0,retryReason:n,retryRecoveryMode:t.recoveryMode||"restart"}};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"||Oc.has(s.status)?i[s.id]=s:delete i[s.id];let r=Ec(i);if(Object.keys(r).length>0?n[s.sessionId]=r:delete n[s.sessionId],this.yeaftActiveTasksBySession=n,s.status!=="running"){let{[Gr(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{[Gr(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=Ec(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}
9
9
 
10
- ${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=Be(s,n),r=e.perfTraceId||this.yeaftHistoryPerfTraceBySession?.[i];r&&Ye(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=Be(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=$e(this,r,e.agentId||null),a=Be(o,r),l=this.yeaftSessionHistoryState[a]||null;this.setActiveSessionFilter(r,{agentId:o,force:Wa(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",error:"errored",cancelled:"cancelled",canceled:"cancelled"}[t.reason]||"completed",l=Date.now(),c=e.conversationId||this.yeaftConversationId;if(c&&Array.isArray(this.messagesMap[c])){let d=this.messagesMap[c],u=kc(d,t);for(let f=0;f<d.length;f++){let p=d[f];if(!p||p.type!=="assistant")continue;let g=p.sessionId??p.groupId;t.sessionId&&g&&g!==t.sessionId||t.vpId&&p.speakerVpId&&p.speakerVpId!==t.vpId||t.turnId&&p.turnId&&p.turnId!==t.turnId||p.status&&p.status!=="pending"||(p.status=a,p.turnEndAt=l,p.turnEndReason=t.reason||null,t.detail&&(p.turnEndDetail=t.detail),Number.isFinite(t.durationMs)&&(p.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=sc(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=nc(this.yeaftVpTyping,s,t.vpId);break}case"vp_status_changed":{if(!t.vpId||!t.state)break;let s=t.sessionId||null,n=Yn(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&&Xn.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=Yn(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=Yn(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>Fc&&a.splice(0,a.length-Fc),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?$e(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=Be(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},f=!!l?.loaded,p=Cr({sessionState:l,hasCachedSessionRows:!1,force:o});if(!p&&d!==null?u.afterSeq=d:u.limit=Qn,!p&&f&&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(!p&&f){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:p?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:$e(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()?Vc:Yr,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 _a(this,e)},parseWsMessage(e){return Ea(this,e)},connect(){Ra(this)},ensureConnected(){return js(this)},scheduleReconnect(){La(this)},manualReconnect(){$a(this)},startHeartbeat(){Va(this)},stopHeartbeat(){Fa(this)},setupVisibilityHandler(){Oa(this)},handleMessage(e){Cl(this,e)},getOrCreateExecutionStatus(e){return Er(this,e)},handleAssistantOutputFrame(e,t){gl(this,e,t)},handleClaudeOutput(e,t){this.handleAssistantOutputFrame(e,t)},addMessageToConversation(e,t){Vn(this,e,t)},appendToAssistantMessageForConversation(e,t,s){za(this,e,t,s)},finishStreamingForConversation(e,t){ja(this,e,t)},sweepStaleStreamingForConversation(e){Ka(this,e)},appendToAssistantMessage(e){this.appendToAssistantMessageForConversation(this.currentConversation,e)},finishStreaming(){this.finishStreamingForConversation(this.currentConversation)},addMessage(e){this.addMessageToConversation(this.currentConversation,e)},loadHistoryMessages(e){Ga(this,e)},formatDbMessage(e){return Ir(e)},formatDbMessageForHistoryHydration(e){return Qa(e)},selectAgent(e){_l(this,e)},createConversation(e,t=null,s=null,n=void 0){El(this,e,t,s,n)},resumeConversation(e,t,s=null,n=null){Rl(this,e,t,s,n)},selectConversation(e,t){Ll(this,e,t)},updateConversationSettings(e,t){Vr(this,e,t)},toggleConversationMcp(e,t){$l(this,e,t)},deleteConversation(e,t){Fl(this,e,t)},closeSession(e,t){Vl(this,e,t)},appendColumn(e){Bl(this,e)},removeColumn(e){ql(this,e)},sendMessageToConversation(e,t,s=[],n={}){Wl(this,e,t,s,n)},cancelExecutionForConversation(e){Ul(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?!!Cs()?.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=$e(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?Cs()?.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&&Xn.has(o?.state)))return;let{[e]:n,...i}=this.yeaftProcessingSessions||{};this.yeaftProcessingSessions=i},sendMessage(e,t=[],s={}){Ol(this,e,t,s)},cancelExecution(){Hl(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=$e(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=$e(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=$e(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?.[Yn(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){Nl(this,e,t,s)},refreshAgents(){zl(this)},refreshConversation(){jl(this)},restartAgent(e){Kl(this,e)},upgradeAgent(e){Gl(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=sn(this),t=$e(this,e);if(!t)return!1;let s=Be(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=Ys();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[s]:o};let a={type:"yeaft_load_history",agentId:t,limit:Qn,sessionId:e,perfTraceId:o};return Ye(this,{traceId:o,phase:"history.request_send",agentId:t,sessionId:e,messageType:a.type,bytes:JSON.stringify(a).length,detail:{mode:"manual-reload",limit:Qn}}),this.sendWsMessage(a),!0},loadMoreYeaftHistory(e=en()){if(this.currentView!=="yeaft"||this.yeaftLoadingMoreHistory||!this.yeaftHasMoreHistory||this.yeaftOldestLoadedSeq==null)return;let t=sn(this),s=$e(this,t);if(!s)return;let n=Math.min(50,Math.max(1,Number.isFinite(e)?Math.floor(e):en()));this.yeaftLoadingMoreHistory=!0;let i=Be(s,t);this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[i]:{...this.yeaftSessionHistoryState[i]||{},loading:!0}};let r=Ys();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[i]:r};let o={type:"yeaft_load_more_history",agentId:s,sessionId:t,beforeSeq:this.yeaftOldestLoadedSeq,turns:n,perfTraceId:r};Ye(this,{traceId:r,phase:"history_more.request_send",agentId:s,sessionId:t,messageType:o.type,bytes:JSON.stringify(o).length,detail:{beforeSeq:o.beforeSeq,turns:o.turns}}),this.sendWsMessage(o)},checkPendingRecovery(){ga(this)},performRecovery(){ma(this)},dismissRecovery(){ha(this)},autoRestoreConversation(e){va(this,e)},saveOpenSessions(){vs(this)},getLastSession(){return ba(this)},clearLastSession(){wa(this)},listHistorySessions(e){ka(this,e)},listFolders(){return Sa(this)},listFoldersForAgent(e,t){return Ca(this,e,t)},listModelsForAgent(e,t){return Ia(this,e,t)},listHistorySessionsForAgent(e,t,s){Aa(this,e,t,s)},async loadGlobalSessions(e=20){return xa(this,e)},async deleteGlobalSession(e){return Ta(this,e)},findAgentForSession(e){return gr(this,e)},isSessionResumable(e){return Ma(this,e)},_isRecentlyClosed(e){return zt(this,e)},_startProcessingWatchdog(e){ys(this,e)},_resetProcessingWatchdog(e){On(this,e)},_stopProcessingWatchdog(e){Se(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,Ws(e),this.currentAgent)try{this.sendWsMessage({type:"update_llm_config",agentId:this.currentAgent,config:{language:e}})}catch{}},async fetchCustomExpertRoles(){let e=xe();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=xe();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=xe();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=xe();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(){xe().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 Xr(e,t){!e||typeof e.handleYeaftOutput!="function"||!t||e.handleYeaftOutput({event:t})}function tm(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 Jr(e){if(!e)return $t[0];let t=String(e).toLowerCase();return em[t]||$t[tm(t)%$t.length]}function sm(e){return Jr(e).background}function nm(e){return Jr(e).foreground}function Zr(){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 im(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 Jg,$t,em,hy,gt,Is=H(()=>{({defineStore:Jg}=Pinia);$t=[{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)"}],em=Object.freeze({steve:$t[8],ada:$t[3],linus:$t[0],martin:$t[4]}),hy=$t.map(e=>e.background);gt=Jg("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?Zr().startsWith("zh")&&s.displayNameZh?s.displayNameZh:s.displayName||s.vpId||t:t},vpDescription:e=>t=>im(e.vps[t],Zr()),vpInitial:e=>t=>{let s=e.vps[t],n=Zr().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:sm(t)},vpTextColor:()=>e=>nm(e),vpAvatarMotif:()=>e=>Jr(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(Xr(s,{type:"dream_progress",phase:"start",groupId:e,manual:!0,trigger:"manual",source:"header-button",ts:n}),!s||typeof s.sendWsMessage!="function"){Xr(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&&Xr(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 eo(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 ei(e){return!e||typeof e!="object"?0:eo(e.lastMessageAt)||eo(e.updatedAt)||eo(e.createdAt)||0}function to(e,t){let s=ei(t)-ei(e);return s!==0?s:String(e?.id||"").localeCompare(String(t?.id||""))}function Bc(e){return[...Array.isArray(e)?e:[]].sort(to)}var ti=H(()=>{});function qc(){try{if(typeof localStorage>"u")return{};let e=JSON.parse(localStorage.getItem(jc)||"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function rm(e){try{typeof localStorage<"u"&&localStorage.setItem(jc,JSON.stringify(e&&typeof e=="object"?e:{}))}catch{}}function Wc(){try{return typeof localStorage>"u"?[]:nn(JSON.parse(localStorage.getItem(Kc)||"[]"))}catch{return[]}}function om(e){try{typeof localStorage<"u"&&localStorage.setItem(Kc,JSON.stringify(nn(e)))}catch{}}function Gc(e,t){return`${e||""}${t||""}`}function kt(e){return e&&e.agentId&&e.id?Gc(e.agentId,e.id):""}function St(e,t){return t?e?Gc(e,t):String(t):""}function am(e){return typeof e=="string"?e:String(e||"")}function tt(e,t,s=null){let n=am(t);if(!n)return"";let i=St(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=io();if(o?.currentAgent){let a=r.find(l=>e.sessions[l]?.agentId===o.currentAgent);if(a)return a}return r[0]||""}function so(e,t,s=null){return tt(e,t,s)||""}function nn(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 no(e,t){let s=nn(e),n=new Set(s),i=nn(t).filter(o=>n.has(o)),r=new Set(i);return[...i,...s.filter(o=>!r.has(o))]}function si(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 Uc(e){return!e||typeof e!="object"?!1:e.running===!0||e.active===!0||e.isActive===!0||e.isRunning===!0}function zc(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 io(){try{if(typeof window<"u"&&window.Pinia&&typeof window.Pinia.useChatStore=="function")return window.Pinia.useChatStore()}catch{}return null}var jc,Kc,lm,Yc,Qc=H(()=>{ti();jc="yeaft-session-order-by-agent",Kc="yeaft-session-order-global";({defineStore:lm}=Pinia);Yc=lm("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=io(),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,f)=>{let p=Number.isFinite(u?.sortOrder)?u.sortOrder:Number.MAX_SAFE_INTEGER,g=Number.isFinite(f?.sortOrder)?f.sortOrder:Number.MAX_SAFE_INTEGER;return p!==g?p-g:to(u,f)}),a=[...o(i),...o(r)],l=Wc();if(l.length===0)return a;let c=new Map(l.map((d,u)=>[d,u]));return a.sort((d,u)=>{let f=c.has(kt(d))?c.get(kt(d)):Number.MAX_SAFE_INTEGER,p=c.has(kt(u))?c.get(kt(u)):Number.MAX_SAFE_INTEGER;return f!==p?f-p: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 $=St(t,E.id);A.add($),h[$]=this._normalize(E,t,si(this.sessions[$]))}for(let E of this.sessionOrder){let $=this.sessions[E];$&&$.agentId===t&&!A.has(E)&&delete h[E]}let w=this.sessionOrder.filter(E=>h[E]),S=new Set(w),v=[];for(let E of s){if(!E||!E.id)continue;let $=St(t,E.id);h[$]&&!S.has($)&&v.push($)}this.sessions=h;let m=[...w,...v],y=Wc();if(y.length>0){let E=new Map(m.map(L=>[kt(h[L]),L]).filter(([L])=>L)),$=y.map(L=>E.get(L)).filter(Boolean),U=new Set($);m=[...$,...m.filter(L=>!U.has(L))];let V=new Map(y.map((L,_)=>[L,_]));for(let L of m){let _=kt(h[L]);_&&V.has(_)&&(h[L]={...h[L],sortOrder:V.get(_)})}}if(t&&y.length===0){let E=qc(),$=nn(E[t]);if($.length>0){let U=$.map(D=>St(t,D)),V=new Set(U),L=no(m.filter(D=>h[D]?.agentId===t),U),_=this.sessionOrder.some(D=>h[D]?.agentId===t),P=0;_?m=this.sessionOrder.filter(D=>h[D]).map(D=>h[D]?.agentId===t?L[P++]:D).concat(L.slice(P)):m=m.map(D=>h[D]?.agentId===t?L[P++]:D);let I=new Map(U.map((D,B)=>[D,B]));for(let D of L)h[D]&&V.has(D)&&(h[D]={...h[D],sortOrder:I.get(D)})}}this.sessionOrder=m}else{if(Object.values(this.sessions).some(S=>S&&S.agentId))return;let A={},w=[];for(let S of s){if(!S||!S.id)continue;let v=St(null,S.id);A[v]=this._normalize(S,null,si(this.sessions[v])),w.push(v)}this.sessions=A,this.sessionOrder=w}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)=>zc(this.sessions[A])-zc(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):"",f=l||(o?n:null)||d,p=a||(o?i:"")||u||so(this,f,t),g=this.activeSessionKey?this.sessions[this.activeSessionKey]?.agentId:null;this.activeSessionId&&!tt(this,this.activeSessionId,g)?(this.activeSessionId=f,this.activeSessionKey=p||null):!this.activeSessionId&&this.sessionOrder.length>0?(this.activeSessionId=f,this.activeSessionKey=p||null):this.activeSessionId&&(this.activeSessionKey=so(this,this.activeSessionId,g)||this.activeSessionKey);let b=io();if(b){if(t){let w={...b.yeaftSessionAgentById||{}};for(let S of s)S&&S.id&&!w[S.id]&&(w[S.id]=t);b.yeaftSessionAgentById=w}let h=this.activeSessionId||f,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=so(this,A)||this.activeSessionKey)}if(b&&typeof b.applyServerPinSnapshot=="function"){let h=new Set;for(let w of s){if(!w||!w.id)continue;let S=St(t,w.id),v=this.sessions[S];v&&v.pinned&&h.add(w.id)}let A=w=>{let S=tt(this,w,t),v=S?this.sessions[S]:null;return v?v.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)||St(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)||St(s,e.id),i=!!this.sessions[n],r=this.sessions[n]||{};this.sessions[n]={...r,...this._normalize(e,s,si(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=no(s,t.map(l=>St(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=qc(),a=n.map(l=>this.sessions[l]?.id).filter(Boolean);return o[e]=a,rm(o),a},reorderSessionsGlobally(e){let t=this.sessionOrder.map(a=>kt(this.sessions[a])).filter(Boolean),s=no(t,e);if(s.length===0)return[];let n=new Map(this.sessionOrder.map(a=>[kt(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=kt(this.sessions[a]);l&&o.has(l)&&(this.sessions[a]={...this.sessions[a],sortOrder:o.get(l)})}return om(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:Uc(e),active:Uc(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:si(e,s),sortOrder:Number.isFinite(e.sortOrder)?e.sortOrder:null}}}})});function ni(){try{if(window.Pinia&&typeof window.Pinia.useAuthStore=="function")return window.Pinia.useAuthStore()}catch{}return null}function ro(){try{return localStorage.getItem("authToken")||null}catch{return null}}function Jc(){let e=ni();if(e)try{return e.getActiveToken?.()||e.token||ro()}catch{return e.token||ro()}return ro()}function dm(e,t){if(!e)return!1;let s=Jc();if(s&&s!==t)return!1;try{localStorage.setItem("authToken",e)}catch{}let n=ni();return n&&(n.token=e),!0}function um(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 Zc(e){return!e||typeof window>"u"||!window.location?!1:e.origin===window.location.origin&&e.pathname.startsWith("/api/")}function pm(e){if(!e)return!1;let t=e.pathname;return!!(cm.has(t)||t.startsWith("/api/auth/sso/poll/")||/^\/api\/auth\/sso\/[^/]+\/start(?:-qr)?$/.test(t))}function fm(e,t){return t?.headers?new Headers(t.headers):e&&typeof e=="object"&&e.headers?new Headers(e.headers):new Headers}function gm(e){let t=e.get("Authorization");return!t||!t.startsWith("Bearer ")?null:t.slice(7)}function mm(e,t){return{...e||{},headers:t}}function hm(e,t,s,n){let i=ni();i&&typeof i.handleAuthResponse=="function"?i.handleAuthResponse(e,t,s,n):i&&typeof i.handleAuthFailure=="function"&&n&&i.handleAuthFailure(void 0,t,s)}function ed(){if(Xc||typeof window>"u"||!window.fetch)return;Xc=!0;let e=window.fetch.bind(window);window.fetch=async function(s,n){let i=um(s),r=Zc(i)&&!pm(i),o=Zc(i)?{...n||{},credentials:"same-origin"}:n,a=null,l=r?ni():null,c=l?.authGeneration,d=!!l?.isAuthenticated;if(r){let f=fm(s,n);a=gm(f),a||(a=Jc(),a&&(f.set("Authorization",`Bearer ${a}`),o=mm(o,f)))}let u=await e(s,o);try{let f=u.headers&&u.headers.get&&u.headers.get("X-New-Token");f&&dm(f,a),r&&u.status===401&&hm(u,a,c,d)}catch{}return u}}var Xc,cm,td=H(()=>{Xc=!1,cm=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 sd,nd=H(()=>{sd={"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","message.showProgress":"\u5C55\u5F00\u8FC7\u7A0B","message.hideProgress":"\u6536\u8D77\u8FC7\u7A0B","login.subtitle":"Yeaft Web Code Agent","login.username":"\u7528\u6237\u540D","login.password":"\u5BC6\u7801","login.login":"\u767B\u5F55","login.loggingIn":"\u767B\u5F55\u4E2D...","login.enterUsername":"\u8BF7\u8F93\u5165\u7528\u6237\u540D","login.enterPassword":"\u8BF7\u8F93\u5165\u5BC6\u7801","login.noAccount":"\u6CA1\u6709\u8D26\u53F7\uFF1F","login.registerWithCode":"\u6CE8\u518C\u65B0\u8D26\u53F7","login.or":"\u6216","login.usePassword":"\u4F7F\u7528\u8D26\u53F7\u5BC6\u7801\u767B\u5F55","login.useSso":"\u8FD4\u56DE\u5355\u70B9\u767B\u5F55","login.noProviders":"\u7BA1\u7406\u5458\u5C1A\u672A\u542F\u7528\u4EFB\u4F55\u7B2C\u4E09\u65B9\u767B\u5F55\u3002","login.microsoft":"\u4F7F\u7528 Microsoft \u8D26\u53F7\u767B\u5F55","login.github":"\u4F7F\u7528 GitHub \u8D26\u53F7\u767B\u5F55","login.google":"\u4F7F\u7528 Google \u8D26\u53F7\u767B\u5F55","login.wechat":"\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801\u767B\u5F55","login.alipay":"\u4F7F\u7528\u652F\u4ED8\u5B9D\u8D26\u53F7\u767B\u5F55","login.wechat.mobileUnsupported":"\u5FAE\u4FE1\u767B\u5F55\u6682\u4EC5\u652F\u6301\u7535\u8111\u7AEF\uFF0C\u8BF7\u5728\u7535\u8111\u6D4F\u89C8\u5668\u4E2D\u626B\u7801\u767B\u5F55\u3002","login.alipay.mobileWaiting":"\u6B63\u5728\u7B49\u5F85\u4F60\u5728\u652F\u4ED8\u5B9D\u4E2D\u786E\u8BA4\u2026 \u5B8C\u6210\u540E\u8FD4\u56DE\u672C\u9875\u9762\u5C06\u81EA\u52A8\u767B\u5F55\u3002","login.alipay.relaunch":"\u91CD\u65B0\u6253\u5F00\u652F\u4ED8\u5B9D","login.qr.title":"\u626B\u7801\u767B\u5F55","login.qr.titleAlipay":"\u652F\u4ED8\u5B9D\u626B\u7801\u767B\u5F55","login.qr.titleWechat":"\u5FAE\u4FE1\u626B\u7801\u767B\u5F55","login.qr.hint":"\u8BF7\u4F7F\u7528\u624B\u673A\u626B\u63CF\u4E8C\u7EF4\u7801\u5B8C\u6210\u6388\u6743","login.error.enterUsername":"\u8BF7\u8F93\u5165\u7528\u6237\u540D","login.error.enterPassword":"\u8BF7\u8F93\u5165\u5BC6\u7801","login.error.enter6Digit":"\u8BF7\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.error.enterInviteCode":"\u8BF7\u8F93\u5165\u9080\u8BF7\u7801","login.error.usernameMinLen":"\u7528\u6237\u540D\u81F3\u5C112\u4E2A\u5B57\u7B26","login.error.passwordMinLen":"\u5BC6\u7801\u81F3\u5C116\u4F4D","login.error.passwordMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","login.error.enterVerifyCode":"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801","login.error.loginFailed":"\u767B\u5F55\u5931\u8D25","login.forgot.link":"\u5FD8\u8BB0\u5BC6\u7801\uFF1F","login.forgot.title":"\u91CD\u7F6E\u5BC6\u7801","login.forgot.emailHint":"\u8F93\u5165\u8D26\u6237\u7ED1\u5B9A\u7684\u90AE\u7BB1\uFF0C\u6211\u4EEC\u5C06\u53D1\u9001 6 \u4F4D\u91CD\u7F6E\u9A8C\u8BC1\u7801\u3002","login.forgot.sendCode":"\u53D1\u9001\u91CD\u7F6E\u9A8C\u8BC1\u7801","login.forgot.sending":"\u53D1\u9001\u4E2D...","login.forgot.codeSent":"\u5982\u679C\u90AE\u7BB1\u5DF2\u6CE8\u518C\uFF0C\u91CD\u7F6E\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001\u3002\u8BF7\u5728\u4E0B\u65B9\u8F93\u5165\u9A8C\u8BC1\u7801\u4E0E\u65B0\u5BC6\u7801\u3002","login.forgot.resetBtn":"\u91CD\u7F6E\u5BC6\u7801","login.forgot.resetting":"\u91CD\u7F6E\u4E2D...","login.forgot.success":"\u5BC6\u7801\u5DF2\u91CD\u7F6E\uFF0C\u53EF\u4EE5\u4F7F\u7528\u65B0\u5BC6\u7801\u767B\u5F55\u3002","login.forgot.emailInvalid":"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1","login.register.title":"\u65B0\u7528\u6237\u6CE8\u518C","login.register.inviteCode":"\u9080\u8BF7\u7801","login.register.username":"\u7528\u6237\u540D","login.register.password":"\u5BC6\u7801\uFF08\u81F3\u5C116\u4F4D\uFF09","login.register.confirmPassword":"\u786E\u8BA4\u5BC6\u7801","login.register.email":"\u90AE\u7BB1\uFF08\u53EF\u9009\uFF09","login.register.submit":"\u6CE8\u518C","login.register.submitting":"\u6CE8\u518C\u4E2D...","login.register.back":"\u8FD4\u56DE\u767B\u5F55","login.register.success":"\u6CE8\u518C\u6210\u529F\uFF0C\u8BF7\u767B\u5F55","login.register.enterCode":"\u8BF7\u8F93\u5165\u9080\u8BF7\u7801","login.register.usernameMin":"\u7528\u6237\u540D\u81F3\u5C112\u4E2A\u5B57\u7B26","login.register.passwordMin":"\u5BC6\u7801\u81F3\u5C116\u4F4D","login.register.passwordMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","login.totp.setupTitle":"\u8BBE\u7F6E\u53CC\u56E0\u7D20\u8BA4\u8BC1","login.totp.setupHint":"\u4F7F\u7528 Microsoft Authenticator \u6216 Google Authenticator \u626B\u63CF\u4E0B\u65B9\u4E8C\u7EF4\u7801","login.totp.manualKey":"\u6216\u624B\u52A8\u8F93\u5165\u5BC6\u94A5\uFF1A","login.totp.enterCode":"\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.totp.complete":"\u5B8C\u6210\u8BBE\u7F6E","login.totp.verifying":"\u9A8C\u8BC1\u4E2D...","login.totp.verify":"\u9A8C\u8BC1","login.totp.prompt":"\u8BF7\u8F93\u5165 Authenticator \u5E94\u7528\u4E2D\u7684\u9A8C\u8BC1\u7801","login.totp.invalidCode":"\u8BF7\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.email.codeSent":"\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001\u81F3 {email}","login.email.enterCode":"\u8F93\u5165\u9A8C\u8BC1\u7801","login.email.verify":"\u9A8C\u8BC1","login.email.verifying":"\u9A8C\u8BC1\u4E2D...","login.email.enterCodeError":"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801","chat.agent.select":"\u9009\u62E9 Agent","chat.agent.manage":"\u7BA1\u7406 Agent","chat.agent.none":"\u6682\u65E0 Agent","chat.agent.restarting":"\u91CD\u542F\u4E2D","chat.agent.restart":"\u91CD\u542F","chat.agent.restartConfirm":`\u786E\u5B9A\u8981\u91CD\u542F Agent "{name}" \u5417\uFF1F
10
+ ${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=Be(s,n),r=e.perfTraceId||this.yeaftHistoryPerfTraceBySession?.[i];r&&Ye(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=Be(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=$e(this,r,e.agentId||null),a=Be(o,r),l=this.yeaftSessionHistoryState[a]||null;this.setActiveSessionFilter(r,{agentId:o,force:Wa(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",error:"errored",cancelled:"cancelled",canceled:"cancelled"}[t.reason]||"completed",l=Date.now(),c=e.conversationId||this.yeaftConversationId;if(c&&Array.isArray(this.messagesMap[c])){let d=this.messagesMap[c],u=kc(d,t);for(let f=0;f<d.length;f++){let p=d[f];if(!p||p.type!=="assistant")continue;let g=p.sessionId??p.groupId;t.sessionId&&g&&g!==t.sessionId||t.vpId&&p.speakerVpId&&p.speakerVpId!==t.vpId||t.turnId&&p.turnId&&p.turnId!==t.turnId||p.status&&p.status!=="pending"||(p.status=a,p.turnEndAt=l,p.turnEndReason=t.reason||null,t.detail&&(p.turnEndDetail=t.detail),Number.isFinite(t.durationMs)&&(p.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=sc(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=nc(this.yeaftVpTyping,s,t.vpId);break}case"vp_status_changed":{if(!t.vpId||!t.state)break;let s=t.sessionId||null,n=Yn(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&&Xn.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=Yn(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=Yn(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>Fc&&a.splice(0,a.length-Fc),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?$e(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=Be(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},f=!!l?.loaded,p=Cr({sessionState:l,hasCachedSessionRows:!1,force:o});if(!p&&d!==null?u.afterSeq=d:u.limit=Qn,!p&&f&&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(!p&&f){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:p?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:$e(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()?Vc:Yr,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 _a(this,e)},parseWsMessage(e){return Ea(this,e)},connect(){Ra(this)},ensureConnected(){return js(this)},scheduleReconnect(){La(this)},manualReconnect(){$a(this)},startHeartbeat(){Va(this)},stopHeartbeat(){Fa(this)},setupVisibilityHandler(){Oa(this)},handleMessage(e){Cl(this,e)},getOrCreateExecutionStatus(e){return Er(this,e)},handleAssistantOutputFrame(e,t){gl(this,e,t)},handleClaudeOutput(e,t){this.handleAssistantOutputFrame(e,t)},addMessageToConversation(e,t){Vn(this,e,t)},appendToAssistantMessageForConversation(e,t,s){za(this,e,t,s)},finishStreamingForConversation(e,t){ja(this,e,t)},sweepStaleStreamingForConversation(e){Ka(this,e)},appendToAssistantMessage(e){this.appendToAssistantMessageForConversation(this.currentConversation,e)},finishStreaming(){this.finishStreamingForConversation(this.currentConversation)},addMessage(e){this.addMessageToConversation(this.currentConversation,e)},loadHistoryMessages(e){Ga(this,e)},formatDbMessage(e){return Ir(e)},formatDbMessageForHistoryHydration(e){return Qa(e)},selectAgent(e){_l(this,e)},createConversation(e,t=null,s=null,n=void 0){El(this,e,t,s,n)},resumeConversation(e,t,s=null,n=null){Rl(this,e,t,s,n)},selectConversation(e,t){Ll(this,e,t)},updateConversationSettings(e,t){Vr(this,e,t)},toggleConversationMcp(e,t){$l(this,e,t)},deleteConversation(e,t){Fl(this,e,t)},closeSession(e,t){Vl(this,e,t)},appendColumn(e){Bl(this,e)},removeColumn(e){ql(this,e)},sendMessageToConversation(e,t,s=[],n={}){Wl(this,e,t,s,n)},cancelExecutionForConversation(e){Ul(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?!!Cs()?.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=$e(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?Cs()?.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&&Xn.has(o?.state)))return;let{[e]:n,...i}=this.yeaftProcessingSessions||{};this.yeaftProcessingSessions=i},sendMessage(e,t=[],s={}){Ol(this,e,t,s)},cancelExecution(){Hl(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=$e(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=$e(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=$e(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?.[Yn(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){Nl(this,e,t,s)},refreshAgents(){zl(this)},refreshConversation(){jl(this)},restartAgent(e){Kl(this,e)},upgradeAgent(e){Gl(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=sn(this),t=$e(this,e);if(!t)return!1;let s=Be(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=Ys();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[s]:o};let a={type:"yeaft_load_history",agentId:t,limit:Qn,sessionId:e,perfTraceId:o};return Ye(this,{traceId:o,phase:"history.request_send",agentId:t,sessionId:e,messageType:a.type,bytes:JSON.stringify(a).length,detail:{mode:"manual-reload",limit:Qn}}),this.sendWsMessage(a),!0},loadMoreYeaftHistory(e=en()){if(this.currentView!=="yeaft"||this.yeaftLoadingMoreHistory||!this.yeaftHasMoreHistory||this.yeaftOldestLoadedSeq==null)return;let t=sn(this),s=$e(this,t);if(!s)return;let n=Math.min(50,Math.max(1,Number.isFinite(e)?Math.floor(e):en()));this.yeaftLoadingMoreHistory=!0;let i=Be(s,t);this.yeaftSessionHistoryState={...this.yeaftSessionHistoryState,[i]:{...this.yeaftSessionHistoryState[i]||{},loading:!0}};let r=Ys();this.yeaftHistoryPerfTraceBySession={...this.yeaftHistoryPerfTraceBySession||{},[i]:r};let o={type:"yeaft_load_more_history",agentId:s,sessionId:t,beforeSeq:this.yeaftOldestLoadedSeq,turns:n,perfTraceId:r};Ye(this,{traceId:r,phase:"history_more.request_send",agentId:s,sessionId:t,messageType:o.type,bytes:JSON.stringify(o).length,detail:{beforeSeq:o.beforeSeq,turns:o.turns}}),this.sendWsMessage(o)},checkPendingRecovery(){ga(this)},performRecovery(){ma(this)},dismissRecovery(){ha(this)},autoRestoreConversation(e){va(this,e)},saveOpenSessions(){vs(this)},getLastSession(){return ba(this)},clearLastSession(){wa(this)},listHistorySessions(e){ka(this,e)},listFolders(){return Sa(this)},listFoldersForAgent(e,t){return Ca(this,e,t)},listModelsForAgent(e,t){return Ia(this,e,t)},listHistorySessionsForAgent(e,t,s){Aa(this,e,t,s)},async loadGlobalSessions(e=20){return xa(this,e)},async deleteGlobalSession(e){return Ta(this,e)},findAgentForSession(e){return gr(this,e)},isSessionResumable(e){return Ma(this,e)},_isRecentlyClosed(e){return zt(this,e)},_startProcessingWatchdog(e){ys(this,e)},_resetProcessingWatchdog(e){On(this,e)},_stopProcessingWatchdog(e){Se(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,Ws(e),this.currentAgent)try{this.sendWsMessage({type:"update_llm_config",agentId:this.currentAgent,config:{language:e}})}catch{}},async fetchCustomExpertRoles(){let e=xe();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=xe();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=xe();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=xe();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(){xe().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 Xr(e,t){!e||typeof e.handleYeaftOutput!="function"||!t||e.handleYeaftOutput({event:t})}function tm(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 Jr(e){if(!e)return $t[0];let t=String(e).toLowerCase();return em[t]||$t[tm(t)%$t.length]}function sm(e){return Jr(e).background}function nm(e){return Jr(e).foreground}function Zr(){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 im(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 Jg,$t,em,vy,gt,Is=H(()=>{({defineStore:Jg}=Pinia);$t=[{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)"}],em=Object.freeze({steve:$t[8],ada:$t[3],linus:$t[0],martin:$t[4]}),vy=$t.map(e=>e.background);gt=Jg("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?Zr().startsWith("zh")&&s.displayNameZh?s.displayNameZh:s.displayName||s.vpId||t:t},vpDescription:e=>t=>im(e.vps[t],Zr()),vpInitial:e=>t=>{let s=e.vps[t],n=Zr().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:sm(t)},vpTextColor:()=>e=>nm(e),vpAvatarMotif:()=>e=>Jr(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(Xr(s,{type:"dream_progress",phase:"start",groupId:e,manual:!0,trigger:"manual",source:"header-button",ts:n}),!s||typeof s.sendWsMessage!="function"){Xr(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&&Xr(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 eo(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 ei(e){return!e||typeof e!="object"?0:eo(e.lastMessageAt)||eo(e.updatedAt)||eo(e.createdAt)||0}function to(e,t){let s=ei(t)-ei(e);return s!==0?s:String(e?.id||"").localeCompare(String(t?.id||""))}function Bc(e){return[...Array.isArray(e)?e:[]].sort(to)}var ti=H(()=>{});function qc(){try{if(typeof localStorage>"u")return{};let e=JSON.parse(localStorage.getItem(jc)||"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function rm(e){try{typeof localStorage<"u"&&localStorage.setItem(jc,JSON.stringify(e&&typeof e=="object"?e:{}))}catch{}}function Wc(){try{return typeof localStorage>"u"?[]:nn(JSON.parse(localStorage.getItem(Kc)||"[]"))}catch{return[]}}function om(e){try{typeof localStorage<"u"&&localStorage.setItem(Kc,JSON.stringify(nn(e)))}catch{}}function Gc(e,t){return`${e||""}${t||""}`}function kt(e){return e&&e.agentId&&e.id?Gc(e.agentId,e.id):""}function St(e,t){return t?e?Gc(e,t):String(t):""}function am(e){return typeof e=="string"?e:String(e||"")}function tt(e,t,s=null){let n=am(t);if(!n)return"";let i=St(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=io();if(o?.currentAgent){let a=r.find(l=>e.sessions[l]?.agentId===o.currentAgent);if(a)return a}return r[0]||""}function so(e,t,s=null){return tt(e,t,s)||""}function nn(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 no(e,t){let s=nn(e),n=new Set(s),i=nn(t).filter(o=>n.has(o)),r=new Set(i);return[...i,...s.filter(o=>!r.has(o))]}function si(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 Uc(e){return!e||typeof e!="object"?!1:e.running===!0||e.active===!0||e.isActive===!0||e.isRunning===!0}function zc(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 io(){try{if(typeof window<"u"&&window.Pinia&&typeof window.Pinia.useChatStore=="function")return window.Pinia.useChatStore()}catch{}return null}var jc,Kc,lm,Yc,Qc=H(()=>{ti();jc="yeaft-session-order-by-agent",Kc="yeaft-session-order-global";({defineStore:lm}=Pinia);Yc=lm("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=io(),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,f)=>{let p=Number.isFinite(u?.sortOrder)?u.sortOrder:Number.MAX_SAFE_INTEGER,g=Number.isFinite(f?.sortOrder)?f.sortOrder:Number.MAX_SAFE_INTEGER;return p!==g?p-g:to(u,f)}),a=[...o(i),...o(r)],l=Wc();if(l.length===0)return a;let c=new Map(l.map((d,u)=>[d,u]));return a.sort((d,u)=>{let f=c.has(kt(d))?c.get(kt(d)):Number.MAX_SAFE_INTEGER,p=c.has(kt(u))?c.get(kt(u)):Number.MAX_SAFE_INTEGER;return f!==p?f-p: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 $=St(t,E.id);A.add($),h[$]=this._normalize(E,t,si(this.sessions[$]))}for(let E of this.sessionOrder){let $=this.sessions[E];$&&$.agentId===t&&!A.has(E)&&delete h[E]}let w=this.sessionOrder.filter(E=>h[E]),S=new Set(w),v=[];for(let E of s){if(!E||!E.id)continue;let $=St(t,E.id);h[$]&&!S.has($)&&v.push($)}this.sessions=h;let m=[...w,...v],y=Wc();if(y.length>0){let E=new Map(m.map(L=>[kt(h[L]),L]).filter(([L])=>L)),$=y.map(L=>E.get(L)).filter(Boolean),U=new Set($);m=[...$,...m.filter(L=>!U.has(L))];let V=new Map(y.map((L,_)=>[L,_]));for(let L of m){let _=kt(h[L]);_&&V.has(_)&&(h[L]={...h[L],sortOrder:V.get(_)})}}if(t&&y.length===0){let E=qc(),$=nn(E[t]);if($.length>0){let U=$.map(D=>St(t,D)),V=new Set(U),L=no(m.filter(D=>h[D]?.agentId===t),U),_=this.sessionOrder.some(D=>h[D]?.agentId===t),P=0;_?m=this.sessionOrder.filter(D=>h[D]).map(D=>h[D]?.agentId===t?L[P++]:D).concat(L.slice(P)):m=m.map(D=>h[D]?.agentId===t?L[P++]:D);let I=new Map(U.map((D,B)=>[D,B]));for(let D of L)h[D]&&V.has(D)&&(h[D]={...h[D],sortOrder:I.get(D)})}}this.sessionOrder=m}else{if(Object.values(this.sessions).some(S=>S&&S.agentId))return;let A={},w=[];for(let S of s){if(!S||!S.id)continue;let v=St(null,S.id);A[v]=this._normalize(S,null,si(this.sessions[v])),w.push(v)}this.sessions=A,this.sessionOrder=w}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)=>zc(this.sessions[A])-zc(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):"",f=l||(o?n:null)||d,p=a||(o?i:"")||u||so(this,f,t),g=this.activeSessionKey?this.sessions[this.activeSessionKey]?.agentId:null;this.activeSessionId&&!tt(this,this.activeSessionId,g)?(this.activeSessionId=f,this.activeSessionKey=p||null):!this.activeSessionId&&this.sessionOrder.length>0?(this.activeSessionId=f,this.activeSessionKey=p||null):this.activeSessionId&&(this.activeSessionKey=so(this,this.activeSessionId,g)||this.activeSessionKey);let b=io();if(b){if(t){let w={...b.yeaftSessionAgentById||{}};for(let S of s)S&&S.id&&!w[S.id]&&(w[S.id]=t);b.yeaftSessionAgentById=w}let h=this.activeSessionId||f,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=so(this,A)||this.activeSessionKey)}if(b&&typeof b.applyServerPinSnapshot=="function"){let h=new Set;for(let w of s){if(!w||!w.id)continue;let S=St(t,w.id),v=this.sessions[S];v&&v.pinned&&h.add(w.id)}let A=w=>{let S=tt(this,w,t),v=S?this.sessions[S]:null;return v?v.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)||St(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)||St(s,e.id),i=!!this.sessions[n],r=this.sessions[n]||{};this.sessions[n]={...r,...this._normalize(e,s,si(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=no(s,t.map(l=>St(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=qc(),a=n.map(l=>this.sessions[l]?.id).filter(Boolean);return o[e]=a,rm(o),a},reorderSessionsGlobally(e){let t=this.sessionOrder.map(a=>kt(this.sessions[a])).filter(Boolean),s=no(t,e);if(s.length===0)return[];let n=new Map(this.sessionOrder.map(a=>[kt(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=kt(this.sessions[a]);l&&o.has(l)&&(this.sessions[a]={...this.sessions[a],sortOrder:o.get(l)})}return om(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:Uc(e),active:Uc(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:si(e,s),sortOrder:Number.isFinite(e.sortOrder)?e.sortOrder:null}}}})});function ni(){try{if(window.Pinia&&typeof window.Pinia.useAuthStore=="function")return window.Pinia.useAuthStore()}catch{}return null}function ro(){try{return localStorage.getItem("authToken")||null}catch{return null}}function Jc(){let e=ni();if(e)try{return e.getActiveToken?.()||e.token||ro()}catch{return e.token||ro()}return ro()}function dm(e,t){if(!e)return!1;let s=Jc();if(s&&s!==t)return!1;try{localStorage.setItem("authToken",e)}catch{}let n=ni();return n&&(n.token=e),!0}function um(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 Zc(e){return!e||typeof window>"u"||!window.location?!1:e.origin===window.location.origin&&e.pathname.startsWith("/api/")}function pm(e){if(!e)return!1;let t=e.pathname;return!!(cm.has(t)||t.startsWith("/api/auth/sso/poll/")||/^\/api\/auth\/sso\/[^/]+\/start(?:-qr)?$/.test(t))}function fm(e,t){return t?.headers?new Headers(t.headers):e&&typeof e=="object"&&e.headers?new Headers(e.headers):new Headers}function gm(e){let t=e.get("Authorization");return!t||!t.startsWith("Bearer ")?null:t.slice(7)}function mm(e,t){return{...e||{},headers:t}}function hm(e,t,s,n){let i=ni();i&&typeof i.handleAuthResponse=="function"?i.handleAuthResponse(e,t,s,n):i&&typeof i.handleAuthFailure=="function"&&n&&i.handleAuthFailure(void 0,t,s)}function ed(){if(Xc||typeof window>"u"||!window.fetch)return;Xc=!0;let e=window.fetch.bind(window);window.fetch=async function(s,n){let i=um(s),r=Zc(i)&&!pm(i),o=Zc(i)?{...n||{},credentials:"same-origin"}:n,a=null,l=r?ni():null,c=l?.authGeneration,d=!!l?.isAuthenticated;if(r){let f=fm(s,n);a=gm(f),a||(a=Jc(),a&&(f.set("Authorization",`Bearer ${a}`),o=mm(o,f)))}let u=await e(s,o);try{let f=u.headers&&u.headers.get&&u.headers.get("X-New-Token");f&&dm(f,a),r&&u.status===401&&hm(u,a,c,d)}catch{}return u}}var Xc,cm,td=H(()=>{Xc=!1,cm=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 sd,nd=H(()=>{sd={"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","message.showProgress":"\u67E5\u770B\u8FC7\u7A0B","message.hideProgress":"\u6536\u8D77\u8FC7\u7A0B","login.subtitle":"Yeaft Web Code Agent","login.username":"\u7528\u6237\u540D","login.password":"\u5BC6\u7801","login.login":"\u767B\u5F55","login.loggingIn":"\u767B\u5F55\u4E2D...","login.enterUsername":"\u8BF7\u8F93\u5165\u7528\u6237\u540D","login.enterPassword":"\u8BF7\u8F93\u5165\u5BC6\u7801","login.noAccount":"\u6CA1\u6709\u8D26\u53F7\uFF1F","login.registerWithCode":"\u6CE8\u518C\u65B0\u8D26\u53F7","login.or":"\u6216","login.usePassword":"\u4F7F\u7528\u8D26\u53F7\u5BC6\u7801\u767B\u5F55","login.useSso":"\u8FD4\u56DE\u5355\u70B9\u767B\u5F55","login.noProviders":"\u7BA1\u7406\u5458\u5C1A\u672A\u542F\u7528\u4EFB\u4F55\u7B2C\u4E09\u65B9\u767B\u5F55\u3002","login.microsoft":"\u4F7F\u7528 Microsoft \u8D26\u53F7\u767B\u5F55","login.github":"\u4F7F\u7528 GitHub \u8D26\u53F7\u767B\u5F55","login.google":"\u4F7F\u7528 Google \u8D26\u53F7\u767B\u5F55","login.wechat":"\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801\u767B\u5F55","login.alipay":"\u4F7F\u7528\u652F\u4ED8\u5B9D\u8D26\u53F7\u767B\u5F55","login.wechat.mobileUnsupported":"\u5FAE\u4FE1\u767B\u5F55\u6682\u4EC5\u652F\u6301\u7535\u8111\u7AEF\uFF0C\u8BF7\u5728\u7535\u8111\u6D4F\u89C8\u5668\u4E2D\u626B\u7801\u767B\u5F55\u3002","login.alipay.mobileWaiting":"\u6B63\u5728\u7B49\u5F85\u4F60\u5728\u652F\u4ED8\u5B9D\u4E2D\u786E\u8BA4\u2026 \u5B8C\u6210\u540E\u8FD4\u56DE\u672C\u9875\u9762\u5C06\u81EA\u52A8\u767B\u5F55\u3002","login.alipay.relaunch":"\u91CD\u65B0\u6253\u5F00\u652F\u4ED8\u5B9D","login.qr.title":"\u626B\u7801\u767B\u5F55","login.qr.titleAlipay":"\u652F\u4ED8\u5B9D\u626B\u7801\u767B\u5F55","login.qr.titleWechat":"\u5FAE\u4FE1\u626B\u7801\u767B\u5F55","login.qr.hint":"\u8BF7\u4F7F\u7528\u624B\u673A\u626B\u63CF\u4E8C\u7EF4\u7801\u5B8C\u6210\u6388\u6743","login.error.enterUsername":"\u8BF7\u8F93\u5165\u7528\u6237\u540D","login.error.enterPassword":"\u8BF7\u8F93\u5165\u5BC6\u7801","login.error.enter6Digit":"\u8BF7\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.error.enterInviteCode":"\u8BF7\u8F93\u5165\u9080\u8BF7\u7801","login.error.usernameMinLen":"\u7528\u6237\u540D\u81F3\u5C112\u4E2A\u5B57\u7B26","login.error.passwordMinLen":"\u5BC6\u7801\u81F3\u5C116\u4F4D","login.error.passwordMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","login.error.enterVerifyCode":"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801","login.error.loginFailed":"\u767B\u5F55\u5931\u8D25","login.forgot.link":"\u5FD8\u8BB0\u5BC6\u7801\uFF1F","login.forgot.title":"\u91CD\u7F6E\u5BC6\u7801","login.forgot.emailHint":"\u8F93\u5165\u8D26\u6237\u7ED1\u5B9A\u7684\u90AE\u7BB1\uFF0C\u6211\u4EEC\u5C06\u53D1\u9001 6 \u4F4D\u91CD\u7F6E\u9A8C\u8BC1\u7801\u3002","login.forgot.sendCode":"\u53D1\u9001\u91CD\u7F6E\u9A8C\u8BC1\u7801","login.forgot.sending":"\u53D1\u9001\u4E2D...","login.forgot.codeSent":"\u5982\u679C\u90AE\u7BB1\u5DF2\u6CE8\u518C\uFF0C\u91CD\u7F6E\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001\u3002\u8BF7\u5728\u4E0B\u65B9\u8F93\u5165\u9A8C\u8BC1\u7801\u4E0E\u65B0\u5BC6\u7801\u3002","login.forgot.resetBtn":"\u91CD\u7F6E\u5BC6\u7801","login.forgot.resetting":"\u91CD\u7F6E\u4E2D...","login.forgot.success":"\u5BC6\u7801\u5DF2\u91CD\u7F6E\uFF0C\u53EF\u4EE5\u4F7F\u7528\u65B0\u5BC6\u7801\u767B\u5F55\u3002","login.forgot.emailInvalid":"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1","login.register.title":"\u65B0\u7528\u6237\u6CE8\u518C","login.register.inviteCode":"\u9080\u8BF7\u7801","login.register.username":"\u7528\u6237\u540D","login.register.password":"\u5BC6\u7801\uFF08\u81F3\u5C116\u4F4D\uFF09","login.register.confirmPassword":"\u786E\u8BA4\u5BC6\u7801","login.register.email":"\u90AE\u7BB1\uFF08\u53EF\u9009\uFF09","login.register.submit":"\u6CE8\u518C","login.register.submitting":"\u6CE8\u518C\u4E2D...","login.register.back":"\u8FD4\u56DE\u767B\u5F55","login.register.success":"\u6CE8\u518C\u6210\u529F\uFF0C\u8BF7\u767B\u5F55","login.register.enterCode":"\u8BF7\u8F93\u5165\u9080\u8BF7\u7801","login.register.usernameMin":"\u7528\u6237\u540D\u81F3\u5C112\u4E2A\u5B57\u7B26","login.register.passwordMin":"\u5BC6\u7801\u81F3\u5C116\u4F4D","login.register.passwordMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","login.totp.setupTitle":"\u8BBE\u7F6E\u53CC\u56E0\u7D20\u8BA4\u8BC1","login.totp.setupHint":"\u4F7F\u7528 Microsoft Authenticator \u6216 Google Authenticator \u626B\u63CF\u4E0B\u65B9\u4E8C\u7EF4\u7801","login.totp.manualKey":"\u6216\u624B\u52A8\u8F93\u5165\u5BC6\u94A5\uFF1A","login.totp.enterCode":"\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.totp.complete":"\u5B8C\u6210\u8BBE\u7F6E","login.totp.verifying":"\u9A8C\u8BC1\u4E2D...","login.totp.verify":"\u9A8C\u8BC1","login.totp.prompt":"\u8BF7\u8F93\u5165 Authenticator \u5E94\u7528\u4E2D\u7684\u9A8C\u8BC1\u7801","login.totp.invalidCode":"\u8BF7\u8F93\u51656\u4F4D\u9A8C\u8BC1\u7801","login.email.codeSent":"\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001\u81F3 {email}","login.email.enterCode":"\u8F93\u5165\u9A8C\u8BC1\u7801","login.email.verify":"\u9A8C\u8BC1","login.email.verifying":"\u9A8C\u8BC1\u4E2D...","login.email.enterCodeError":"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801","chat.agent.select":"\u9009\u62E9 Agent","chat.agent.manage":"\u7BA1\u7406 Agent","chat.agent.none":"\u6682\u65E0 Agent","chat.agent.restarting":"\u91CD\u542F\u4E2D","chat.agent.restart":"\u91CD\u542F","chat.agent.restartConfirm":`\u786E\u5B9A\u8981\u91CD\u542F Agent "{name}" \u5417\uFF1F
11
11
  \u6240\u6709\u6D3B\u8DC3\u7684\u4F1A\u8BDD\u5C06\u88AB\u4E2D\u65AD\u3002`,"chat.agent.upgrade":"\u5347\u7EA7","chat.agent.upgrading":"\u5347\u7EA7\u4E2D","chat.agent.upgradeConfirm":`\u5347\u7EA7 Agent "{name}" \u5230\u6700\u65B0\u7248\u672C\uFF1F
12
- \u5347\u7EA7\u5B8C\u6210\u540E Agent \u4F1A\u81EA\u52A8\u91CD\u542F\u3002`,"chat.agent.alreadyLatest":"Agent \u5DF2\u662F\u6700\u65B0\u7248\u672C (v{version})\uFF0C\u65E0\u9700\u5347\u7EA7\u3002","chat.agent.nodeIncompatible":"Agent \u5347\u7EA7\u4E2D\u6B62\uFF1A\u76EE\u6807\u7248\u672C v{version} \u9700\u8981 Node {required}\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u8FD0\u884C\u7684\u662F Node {current}\u3002\u8BF7\u5148\u5347\u7EA7 Node.js \u518D\u91CD\u8BD5\u3002","chat.agent.online":"{count} \u4E2A Agent \u5728\u7EBF","chat.agent.selectFirst":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent","chat.agent.yeaft":"Yeaft \u5BF9\u8BDD","sidebar.toggle.chat":"\u5207\u6362\u5230 Chat","sidebar.toggle.yeaft":"\u5207\u6362\u5230 Yeaft","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.sender":"\u53D1\u9001\u8005","yeaft.outline.allSenders":"\u5168\u90E8\u53D1\u9001\u8005","yeaft.outline.title":"\u5386\u53F2\u6D88\u606F","yeaft.outline.placeholder":"\u641C\u7D22\u5F53\u524D\u5BF9\u8BDD","yeaft.outline.searching":"\u6B63\u5728\u641C\u7D22\u2026","yeaft.outline.loading":"\u6B63\u5728\u52A0\u8F7D\u2026","yeaft.outline.older":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","yeaft.outline.moreMatches":"\u52A0\u8F7D\u66F4\u591A\u5339\u914D\u9879","yeaft.outline.minChars":"\u81F3\u5C11\u8F93\u5165 2 \u4E2A\u5B57\u7B26","yeaft.outline.empty":"\u6682\u65E0\u6D88\u606F","yeaft.outline.noMatches":"\u6CA1\u6709\u5339\u914D\u7684\u6D88\u606F","yeaft.outline.error":"\u5927\u7EB2\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5","yeaft.outline.unsupported":"\u8BF7\u5347\u7EA7\u5F53\u524D Agent \u540E\u518D\u4F7F\u7528\u5BF9\u8BDD\u5927\u7EB2","yeaft.outline.you":"\u4F60","yeaft.outline.assistant":"\u52A9\u624B","yeaft.outline.nonText":"\u975E\u6587\u672C\u56DE\u590D","yeaft.switchModel":"\u5207\u6362\u6A21\u578B","yeaft.modelMenu.title":"\u6A21\u578B\u548C LLM \u8BBE\u7F6E","yeaft.modelMenu.label":"\u6A21\u578B","yeaft.modelMenu.effort":"\u63A8\u7406\u5F3A\u5EA6","yeaft.modelMenu.effort.openaiReasoning":"\u63A8\u7406\u5F3A\u5EA6","yeaft.modelMenu.effort.anthropicBudget":"\u601D\u8003\u9884\u7B97","yeaft.modelMenu.effort.anthropicAdaptive":"\u81EA\u9002\u5E94\u601D\u8003\u5F3A\u5EA6","yeaft.modelMenu.effort.minimal":"\u6700\u5C0F","yeaft.modelMenu.effort.low":"\u4F4E","yeaft.modelMenu.effort.medium":"\u4E2D","yeaft.modelMenu.effort.high":"\u9AD8","yeaft.modelMenu.effort.xhigh":"\u8D85\u9AD8","yeaft.modelMenu.effort.max":"\u6700\u9AD8","yeaft.modelMenu.noEffort":"\u5F53\u524D\u6A21\u578B\u6CA1\u6709\u53EF\u517C\u5BB9\u6620\u5C04\u7684\u63A8\u7406\u5F3A\u5EA6\u63A7\u5236\u3002","yeaft.modelMenu.configureHint":"Provider\u3001\u5BC6\u94A5\u3001\u6A21\u578B\u5217\u8868","yeaft.settings.title":"\u8BBE\u7F6E","yeaft.settings.tabs.vp":"VP \u5E93","yeaft.settings.tabs.search":"\u641C\u7D22","search.settings.backendTitle":"\u641C\u7D22\u540E\u7AEF","search.settings.backendDesc":"\u9009\u62E9 WebSearch \u5DE5\u5177\u9ED8\u8BA4\u4F7F\u7528\u7684\u540E\u7AEF\u3002\u4E3B\u540E\u7AEF\u5931\u8D25\u65F6,\u5F15\u64CE\u4F1A\u81EA\u52A8\u964D\u7EA7\u5230 HTML \u6293\u53D6\u3002","search.settings.backend.tavily":"Tavily","search.settings.backend.tavilyHint":"\u6258\u7BA1\u641C\u7D22 API\u3002\u514D\u8D39\u989D\u5EA6 1000 \u6B21/\u6708\u3002\u63A8\u8350\u3002","search.settings.backend.playwright":"Playwright \u670D\u52A1","search.settings.backend.playwrightHint":"\u81EA\u5EFA\u7684\u6D4F\u89C8\u5668\u5F0F\u641C\u7D22/\u6293\u53D6\u670D\u52A1,\u9002\u5408 IP \u4FE1\u8A89\u5DEE\u88AB bot \u68C0\u6D4B\u7684\u73AF\u5883\u3002\u5C1A\u672A\u4E0A\u7EBF\u3002","search.settings.comingSoon":"\u5373\u5C06\u63A8\u51FA","search.settings.tavilyKeyTitle":"Tavily API key","search.settings.tavilyKeyDesc":"\u4FDD\u5B58\u5728 agent \u7684 ~/.yeaft/config.json \u4E2D\u3002\u514D\u8D39\u7533\u8BF7:","search.settings.tavilyKeyUnchanged":"\u4FDD\u6301\u4E0D\u53D8","search.settings.clearKey":"\u6E05\u9664","search.settings.usageTitle":"\u672C\u6708\u7528\u91CF","search.settings.usageRefresh":"\u5237\u65B0","search.settings.usageLoading":"\u52A0\u8F7D\u4E2D\u2026","search.settings.usagePlan":"\u8BA1\u5212","search.settings.usageUsed":"\u5DF2\u7528","search.settings.usagePaygo":"\u6309\u91CF\u4ED8\u8D39","search.settings.usageError":"\u52A0\u8F7D\u7528\u91CF\u5931\u8D25","search.settings.save":"\u4FDD\u5B58","search.settings.saving":"\u4FDD\u5B58\u4E2D\u2026","search.settings.saveSuccess":"\u5DF2\u4FDD\u5B58","search.settings.cancel":"\u91CD\u7F6E","yeaft.settings.yeaftTitle":"\u7EBF\u7A0B\u5E76\u53D1\u4E0E\u5F52\u6863","yeaft.settings.yeaftDesc":"\u8C03\u6574\u53EF\u540C\u65F6\u8FD0\u884C\u7684\u7EBF\u7A0B\u6570\u91CF\uFF0C\u4EE5\u53CA\u95F2\u7F6E\u7EBF\u7A0B\u7684\u81EA\u52A8\u5F52\u6863\u65F6\u957F\u3002","yeaft.settings.maxConcurrentLabel":"\u6700\u5927\u5E76\u53D1\u7EBF\u7A0B\u6570","yeaft.settings.maxConcurrentHint":"\u540C\u65F6\u5728\u7EBF\u7684\u7EBF\u7A0B\u603B\u6570\u4E0A\u9650\uFF08\u542B\u59CB\u7EC8\u5B58\u5728\u7684 main \u4E3B\u7EBF\u7A0B\uFF09\u3002\u8D85\u8FC7\u6B64\u4E0A\u9650\u7684\u65B0\u7EBF\u7A0B\u5C06\u88AB\u62D2\u7EDD\uFF0C\u76F4\u81F3\u5DF2\u6709\u7EBF\u7A0B\u88AB\u5F52\u6863\u6216\u7EC8\u6B62\u3002\u8303\u56F4\uFF1A1-50\u3002","yeaft.settings.archiveIdleDaysLabel":"\u95F2\u7F6E\u591A\u4E45\u540E\u81EA\u52A8\u5F52\u6863\u7EBF\u7A0B\uFF08\u5929\uFF09","yeaft.settings.archiveIdleDaysHint":"\u65E0\u6D3B\u52A8\u8D85\u8FC7\u6B64\u5929\u6570\u7684\u7EBF\u7A0B\u5C06\u88AB\u5F52\u6863\u3002\u8303\u56F4\uFF1A1-3650\u3002","yeaft.settings.yeaftSaveBtn":"\u4FDD\u5B58","yeaft.settings.yeaftSaving":"\u4FDD\u5B58\u4E2D...","yeaft.settings.yeaftSaved":"\u5DF2\u4FDD\u5B58","yeaft.settings.yeaftLoading":"\u52A0\u8F7D\u4E2D...","yeaft.settings.yeaftLoadError":"\u52A0\u8F7D Yeaft \u8BBE\u7F6E\u5931\u8D25","yeaft.settings.yeaftSaveError":"\u4FDD\u5B58 Yeaft \u8BBE\u7F6E\u5931\u8D25","yeaft.settings.rangeErrorConcurrent":"\u5FC5\u987B\u5728 1 \u5230 50 \u4E4B\u95F4","yeaft.settings.rangeErrorArchive":"\u5FC5\u987B\u5728 1 \u5230 3650 \u4E4B\u95F4","chat.session.creating":"\u6B63\u5728\u521B\u5EFA\u4F1A\u8BDD...","chat.session.loadingHistory":"\u6B63\u5728\u52A0\u8F7D\u4F1A\u8BDD\u5386\u53F2...","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","message.quote":"\u5F15\u7528","message.removeQuote":"\u5220\u9664\u5F15\u7528","message.replyingTo":"\u6B63\u5728\u56DE\u590D {author}","message.quotedFrom":"\u5F15\u7528\u81EA {author}","message.editAsNew":"\u7F16\u8F91","message.you":"\u4F60","input.upload":"\u4E0A\u4F20\u6587\u4EF6","input.placeholder":"\u8F93\u5165\u6D88\u606F...","input.send":"\u53D1\u9001","input.stopExecution":"\u505C\u6B62\u6267\u884C","chatInput.upload":"\u4E0A\u4F20\u6587\u4EF6","chatInput.uploading":"\u6B63\u5728\u4E0A\u4F20\u2026","chatInput.uploadFailed":"\u4E0A\u4F20\u5931\u8D25","chatInput.retryUpload":"\u91CD\u8BD5","chatInput.removeAttachment":"\u79FB\u9664\u9644\u4EF6","chatInput.placeholder":"\u8F93\u5165\u6D88\u606F...","chatInput.send":"\u53D1\u9001","chatInput.stop":"\u505C\u6B62\u6267\u884C","tools.thinking":"\u601D\u8003\u4E2D...","tools.read":"\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6","tools.write":"\u6B63\u5728\u5199\u5165\u6587\u4EF6","tools.edit":"\u6B63\u5728\u7F16\u8F91\u6587\u4EF6","tools.bash":"\u6B63\u5728\u6267\u884C\u547D\u4EE4","tools.glob":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6","tools.grep":"\u6B63\u5728\u641C\u7D22\u5185\u5BB9","tools.task":"\u6B63\u5728\u6267\u884C\u4EFB\u52A1","tools.webFetch":"\u6B63\u5728\u83B7\u53D6\u7F51\u9875","tools.webSearch":"\u6B63\u5728\u641C\u7D22\u7F51\u7EDC","tools.todoWrite":"\u6B63\u5728\u66F4\u65B0\u4EFB\u52A1","tools.executing":"\u6B63\u5728\u6267\u884C {name}","status.thinking":"\u601D\u8003\u4E2D...","status.reading":"\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6","status.writing":"\u6B63\u5728\u5199\u5165\u6587\u4EF6","status.editing":"\u6B63\u5728\u7F16\u8F91\u6587\u4EF6","status.executing":"\u6B63\u5728\u6267\u884C\u547D\u4EE4","status.searchingFiles":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6","status.searchingContent":"\u6B63\u5728\u641C\u7D22\u5185\u5BB9","status.executingTask":"\u6B63\u5728\u6267\u884C\u4EFB\u52A1","status.fetching":"\u6B63\u5728\u83B7\u53D6\u7F51\u9875","status.searching":"\u6B63\u5728\u641C\u7D22\u7F51\u7EDC","status.updatingTasks":"\u6B63\u5728\u66F4\u65B0\u4EFB\u52A1","status.executingTool":"\u6B63\u5728\u6267\u884C {name}","header.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","header.compacted":"\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210","chatHeader.newConv":"\u4F1A\u8BDD","chatHeader.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","chatHeader.compactDone":"\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210","chatHeader.compact":"\u538B\u7F29\u4E0A\u4E0B\u6587","chatHeader.resume":"\u6062\u590D\u4F1A\u8BDD","chatHeader.refresh":"\u5237\u65B0\u6D88\u606F","chatHeader.reloadPage":"\u5237\u65B0\u9875\u9762","chatHeader.clear":"\u6E05\u7A7A\u6D88\u606F","chatHeader.clearing":"\u6B63\u5728\u6E05\u7A7A\u4E0A\u4E0B\u6587...","chatHeader.clearDone":"\u4E0A\u4E0B\u6587\u5DF2\u6E05\u7A7A","chatHeader.confirmClear":"\u786E\u5B9A\u8981\u6E05\u7A7A\u5F53\u524D\u4F1A\u8BDD\u7684\u6240\u6709\u6D88\u606F\u5417\uFF1F","chatHeader.mcpConfig":"MCP \u670D\u52A1\u5668\u914D\u7F6E","chatHeader.mcpNeedRestart":"\u66F4\u6539\u5C06\u5728\u91CD\u542F\u4F1A\u8BDD\u540E\u751F\u6548\u3002","chatHeader.expertPanel":"\u5E2E\u5E2E\u56E2","chatHeader.subAgentPanel":"\u5B50\u4EE3\u7406","settings.close":"\u5173\u95ED\u8BBE\u7F6E","settings.tabs.account":"\u8D26\u53F7","settings.tabs.security":"\u5B89\u5168","settings.tabs.general":"\u901A\u7528","settings.tabs.invitations":"\u9080\u8BF7","auth.sessionExpired":"\u767B\u5F55\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002","settings.account.username":"\u7528\u6237\u540D","settings.account.role":"\u89D2\u8272","settings.account.email":"\u90AE\u7BB1","settings.account.emailNotSet":"\u672A\u8BBE\u7F6E","settings.account.profileLoadFailed":"\u8D26\u53F7\u8D44\u6599\u52A0\u8F7D\u5931\u8D25","settings.account.logout":"\u9000\u51FA\u767B\u5F55","settings.account.roleAdmin":"\u7BA1\u7406\u5458","settings.account.rolePro":"Pro","settings.account.linkedAccounts":"\u5DF2\u5173\u8054\u8D26\u6237","settings.account.linkedDesc":"\u5173\u8054\u7B2C\u4E09\u65B9\u767B\u5F55\u540E\uFF0C\u4F7F\u7528\u4EFB\u610F\u4E00\u79CD\u65B9\u5F0F\u90FD\u80FD\u767B\u5F55\u6B64\u8D26\u53F7\u3002","settings.account.bind":"\u7ED1\u5B9A","settings.account.unbind":"\u89E3\u7ED1","settings.account.linked":"\u5DF2\u7ED1\u5B9A","settings.account.providerDisabled":"\u672A\u914D\u7F6E","settings.account.cantUnbindLast":"\u4E0D\u80FD\u89E3\u7ED1\u552F\u4E00\u7684\u767B\u5F55\u65B9\u5F0F","settings.account.unbindFailed":"\u89E3\u7ED1\u5931\u8D25\uFF1A{error}","settings.account.bindFailed":"\u7ED1\u5B9A\u5931\u8D25","settings.account.ssoBoundMsg":"\u5DF2\u6210\u529F\u7ED1\u5B9A {provider}\u3002","settings.account.ssoConflictMsg":"\u8BE5 {provider} \u8D26\u53F7\u5DF2\u88AB\u5176\u4ED6\u7528\u6237\u7ED1\u5B9A\u3002","settings.account.providerMicrosoft":"Microsoft","settings.account.providerGithub":"GitHub","settings.account.providerGoogle":"Google","settings.account.providerWechat":"\u5FAE\u4FE1","settings.account.providerAlipay":"\u652F\u4ED8\u5B9D","settings.security.agentKey":"Agent \u5BC6\u94A5","settings.security.agentKeyDesc":"\u7528\u4E8E Agent \u8FDE\u63A5\u8BA4\u8BC1\u7684\u5171\u4EAB\u5BC6\u94A5","settings.security.agentSetupCommands":"Agent \u63A5\u5165\u547D\u4EE4","settings.security.agentCmdInstall":"\u5B89\u88C5 Agent","settings.security.agentCmdService":"\u8FD0\u884C Agent server","settings.security.agentCmdNeedsSecret":"\u8BF7\u5148\u751F\u6210 Agent \u5BC6\u94A5\uFF0C\u4EE5\u521B\u5EFA\u5305\u542B server \u5730\u5740\u548C\u5BC6\u94A5\u7684\u547D\u4EE4\u3002","settings.security.agentCmdLlm":"Copilot \u624B\u52A8\u515C\u5E95","settings.security.agentCmdLlmDesc":"\u5148\u8FD0\u884C\u5B89\u88C5\u547D\u4EE4\uFF1B\u5982\u679C\u672C\u673A\u5DF2\u6709 GitHub Copilot token\uFF0CYeaft \u4F1A\u81EA\u52A8\u914D\u7F6E github-copilot/gpt-5.5\u3002Copilot \u547D\u4EE4\u53EA\u4F5C\u4E3A\u515C\u5E95\u4F7F\u7528\u3002","settings.security.none":"\u65E0","settings.security.show":"\u663E\u793A","settings.security.hide":"\u9690\u85CF","settings.security.generateKey":"\u751F\u6210\u5BC6\u94A5","settings.security.resetKey":"\u91CD\u7F6E\u5BC6\u94A5","settings.security.resetting":"\u91CD\u7F6E\u4E2D...","settings.security.resetWarning":"\u91CD\u7F6E\u540E\u6240\u6709 Agent \u9700\u91CD\u65B0\u914D\u7F6E","settings.security.changePassword":"\u4FEE\u6539\u5BC6\u7801","settings.security.currentPassword":"\u5F53\u524D\u5BC6\u7801","settings.security.newPassword":"\u65B0\u5BC6\u7801\uFF08\u81F3\u5C116\u4F4D\uFF09","settings.security.confirmPassword":"\u786E\u8BA4\u65B0\u5BC6\u7801","settings.security.changeBtn":"\u4FEE\u6539\u5BC6\u7801","settings.security.changing":"\u4FEE\u6539\u4E2D...","settings.security.enterCurrentPwd":"\u8BF7\u8F93\u5165\u5F53\u524D\u5BC6\u7801","settings.security.newPwdMin":"\u65B0\u5BC6\u7801\u81F3\u5C116\u4F4D","settings.security.pwdMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","settings.security.pwdChanged":"\u5BC6\u7801\u4FEE\u6539\u6210\u529F","settings.security.setPassword":"\u8BBE\u7F6E\u5BC6\u7801","settings.security.setPasswordDesc":"\u4F60\u76EE\u524D\u901A\u8FC7 SSO \u767B\u5F55\uFF0C\u5C1A\u672A\u8BBE\u7F6E\u5BC6\u7801\u3002\u8BBE\u7F6E\u540E\u5373\u53EF\u4F7F\u7528\u7528\u6237\u540D + \u5BC6\u7801\u767B\u5F55\u3002","settings.security.setBtn":"\u8BBE\u7F6E\u5BC6\u7801","settings.security.pwdSet":"\u5BC6\u7801\u8BBE\u7F6E\u6210\u529F","settings.security.deleteAccount":"\u6CE8\u9500\u8D26\u6237","settings.security.deleteAccountDesc":"\u6C38\u4E45\u5220\u9664\u4F60\u7684\u8D26\u6237\u548C\u6240\u6709\u76F8\u5173\u6570\u636E\u3002\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","settings.security.deleteBtn":"\u6CE8\u9500\u8D26\u6237","settings.security.deleteConfirmBtn":"\u786E\u8BA4\u5220\u9664","settings.security.deleteConfirmPlaceholder":"\u8F93\u5165 DELETE \u4EE5\u786E\u8BA4","settings.security.deleteConfirmRequired":"\u8BF7\u8F93\u5165 DELETE \u4EE5\u786E\u8BA4\u6CE8\u9500\u8D26\u6237","settings.security.deleteFailed":"\u6CE8\u9500\u8D26\u6237\u5931\u8D25","settings.security.deleting":"\u6CE8\u9500\u4E2D...","settings.general.theme":"\u4E3B\u9898","settings.general.lightTheme":"\u6D45\u8272","settings.general.darkTheme":"\u6DF1\u8272","settings.general.language":"\u8BED\u8A00","settings.invite.create":"\u521B\u5EFA\u9080\u8BF7\u7801","settings.invite.normalUser":"\u666E\u901A\u7528\u6237","settings.invite.proUser":"Pro \u7528\u6237","settings.invite.createBtn":"\u521B\u5EFA\u9080\u8BF7\u7801","settings.invite.creating":"\u521B\u5EFA\u4E2D...","settings.invite.list":"\u9080\u8BF7\u7801\u5217\u8868","settings.invite.used":"\u5DF2\u4F7F\u7528","settings.invite.expired":"\u5DF2\u8FC7\u671F","settings.invite.available":"\u53EF\u7528","settings.invite.usedBy":"\u4F7F\u7528\u8005: {user}","settings.invite.expiredAt":"\u8FC7\u671F\u4E8E: {time}","settings.invite.expiresAt":"\u6709\u6548\u81F3: {time}","settings.invite.noInvites":"\u6682\u65E0\u9080\u8BF7\u7801","settings.msg.copiedClipboard":"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F","settings.msg.copyFailed":"\u590D\u5236\u5931\u8D25","settings.msg.keyReset":"\u5BC6\u94A5\u5DF2\u91CD\u7F6E","settings.msg.resetFailed":"\u91CD\u7F6E\u5931\u8D25","settings.msg.changeFailed":"\u4FEE\u6539\u5931\u8D25","settings.msg.inviteCreated":"\u9080\u8BF7\u7801\u5DF2\u521B\u5EFA","settings.msg.createFailed":"\u521B\u5EFA\u5931\u8D25","settings.msg.inviteCopied":"\u9080\u8BF7\u7801\u5DF2\u590D\u5236","settings.msg.inviteDeleted":"\u9080\u8BF7\u7801\u5DF2\u5220\u9664","settings.msg.deleteFailed":"\u5220\u9664\u5931\u8D25","settings.tabs.llm":"LLM","settings.tabs.yeaft":"Yeaft","settings.yeaft.tabs.vp":"VP \u5E93","settings.yeaft.tabs.search":"\u641C\u7D22","settings.yeaft.tabs.mcp":"MCP","settings.mcp.title":"MCP \u670D\u52A1\u5668","settings.mcp.description":"\u901A\u8FC7 Model Context Protocol \u7ED9 Yeaft \u63A5\u5165\u66F4\u591A\u5DE5\u5177\u3002\u914D\u7F6E\u5199\u5165 agent \u4E0A\u7684 ~/.yeaft/config.json\uFF0C\u5DE5\u5177\u4F1A\u4EE5 mcp__<server>__<tool> \u7684\u5F62\u5F0F\u51FA\u73B0\u5728 LLM \u5DE5\u5177\u5217\u8868\u91CC\u3002","settings.mcp.reloadAll":"\u5168\u90E8\u91CD\u8FDE","settings.mcp.reloadOne":"\u91CD\u65B0\u8FDE\u63A5\u6B64\u670D\u52A1\u5668","settings.mcp.loading":"\u5904\u7406\u4E2D\u2026","settings.mcp.connected":"\u5DF2\u8FDE\u63A5","settings.mcp.disconnected":"\u672A\u8FDE\u63A5","settings.mcp.tools":"\u4E2A\u5DE5\u5177","settings.mcp.remove":"\u79FB\u9664","settings.mcp.empty":"\u8FD8\u6CA1\u6709\u914D\u7F6E MCP \u670D\u52A1\u5668\uFF0C\u53EF\u4EE5\u5728\u4E0B\u65B9\u6DFB\u52A0\u4E00\u4E2A\u3002","settings.mcp.addServer":"\u6DFB\u52A0\u670D\u52A1\u5668","settings.mcp.addServerDesc":"\u5927\u90E8\u5206 MCP \u670D\u52A1\u5668\u662F\u672C\u5730\u547D\u4EE4 \u2014 Yeaft \u4F1A\u901A\u8FC7 stdio \u542F\u52A8\u5B83\u5E76\u81EA\u52A8\u53D1\u73B0\u53EF\u7528\u5DE5\u5177\u3002","settings.mcp.serverName":"\u540D\u79F0","settings.mcp.command":"\u547D\u4EE4","settings.mcp.args":"\u53C2\u6570","settings.mcp.argsPlaceholder":"\u4F8B\u5982\uFF1A-y @modelcontextprotocol/server-filesystem /tmp","settings.mcp.env":"\u73AF\u5883\u53D8\u91CF","settings.mcp.envPlaceholder":"\u6BCF\u884C\u4E00\u4E2A KEY=value\uFF0C# \u5F00\u5934\u7684\u884C\u4F1A\u88AB\u5FFD\u7565\u3002","settings.mcp.saving":"\u4FDD\u5B58\u4E2D\u2026","settings.mcp.add":"\u6DFB\u52A0","settings.mcp.cancel":"\u6E05\u7A7A","settings.mcp.connectFailed":"\u5DF2\u4FDD\u5B58\u4F46\u8FDE\u63A5\u5931\u8D25","settings.mcp.addSuccess":"\u670D\u52A1\u5668\u5DF2\u6DFB\u52A0","settings.mcp.removeSuccess":"\u670D\u52A1\u5668\u5DF2\u79FB\u9664","settings.mcp.reloadSuccess":"\u5DF2\u8BF7\u6C42\u91CD\u8FDE","settings.mcp.confirmRemove":'\u79FB\u9664 MCP \u670D\u52A1\u5668 "{name}"\uFF1F\u4E0B\u4E00\u4E2A LLM turn \u8D77\u5B83\u7684\u5DE5\u5177\u5C06\u4E0D\u518D\u53EF\u89C1\u3002',"settings.mcp.errors.nameRequired":"\u8BF7\u586B\u5199\u540D\u79F0","settings.mcp.errors.nameFormat":"\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u77ED\u6A2A\u7EBF\u548C\u4E0B\u5212\u7EBF","settings.mcp.errors.commandRequired":"\u8BF7\u586B\u5199\u547D\u4EE4","settings.mcp.errors.argsParse":"\u53C2\u6570\u89E3\u6790\u5931\u8D25","settings.mcp.errors.envParse":"\u73AF\u5883\u53D8\u91CF\u89E3\u6790\u5931\u8D25","yeaft.session.title":"\u4F1A\u8BDD","yeaft.session.new":"+ \u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.create.title":"\u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.create.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.vp.turnBlock.retryingRequest":"\u54CD\u5E94\u505C\u6EDE\uFF0C\u6B63\u5728\u53D1\u8D77\u5168\u65B0\u8BF7\u6C42\uFF08{attempt}/{max}\uFF09","yeaft.vp.turnBlock.retryingContinue":"\u54CD\u5E94\u505C\u6EDE\uFF0C\u6B63\u5728\u7528\u5168\u65B0\u8BF7\u6C42\u7EED\u5199\uFF08{attempt}/{max}\uFF09","yeaft.sessionStatus.aria":"Session \u72B6\u6001","yeaft.sessionStatus.title":"Session \u72B6\u6001","yeaft.sessionStatus.announcement":"\u516C\u544A","yeaft.sessionStatus.announcementEmpty":"\u6682\u65E0\u516C\u544A","yeaft.sessionStatus.announcementAdd":"\u6DFB\u52A0\u516C\u544A","yeaft.sessionStatus.announcementEdit":"\u7F16\u8F91\u516C\u544A","yeaft.sessionStatus.vps":"VP","yeaft.sessionStatus.backgroundTasks":"\u540E\u53F0\u4EFB\u52A1","yeaft.sessionStatus.noLogPreview":"\u6682\u65E0\u65E5\u5FD7\u8F93\u51FA\u3002","yeaft.sessionStatus.task.subAgentStarted":"{name} \u5DF2\u542F\u52A8","yeaft.sessionStatus.task.subAgentStartedWithMission":"{name} \u5DF2\u542F\u52A8\uFF1A{mission}","yeaft.sessionStatus.task.subAgentStatus":"{name} \u72B6\u6001\uFF1A{status}","yeaft.sessionStatus.task.subAgentStatusUpdated":"{name} \u72B6\u6001\u5DF2\u66F4\u65B0","yeaft.sessionStatus.task.subAgentResult":"{name} \u7ED3\u679C\uFF1A{text}","yeaft.sessionStatus.task.subAgentProducedResult":"{name} \u5DF2\u4EA7\u751F\u7ED3\u679C","yeaft.sessionStatus.task.subAgentUsedTool":"{name} \u8C03\u7528\u4E86 {tool}","yeaft.sessionStatus.task.subAgentFinishedTool":"{name} \u5B8C\u6210\u4E86 {tool}","yeaft.sessionStatus.task.subAgentUsage":"{name} \u4F7F\u7528\u4E86 {tokens} tokens","yeaft.sessionStatus.task.subAgentEvent":"{name}\uFF1A{text}","yeaft.sessionStatus.task.subAgentUserPrompt":"\u4F60\uFF1A{text}","yeaft.sessionStatus.task.subAgentToolSummary":"\u5DF2\u5B8C\u6210 {count} \u6B21\u5DE5\u5177\u8C03\u7528","yeaft.sessionStatus.task.subAgentError":"{name} \u9519\u8BEF\uFF1A{error}","yeaft.sessionStatus.task.subAgentHitError":"{name} \u9047\u5230\u9519\u8BEF","yeaft.sessionStatus.task.subAgentNoReadableEvents":"\u6682\u65E0\u53EF\u8BFB\u7684 sub-agent \u6D3B\u52A8\u3002","yeaft.sessionStatus.task.promptPlaceholder":"\u7ED9\u8FD9\u4E2A sub-agent \u8FFD\u52A0\u60F3\u6CD5\u2026","yeaft.sessionStatus.task.promptSend":"\u53D1\u9001","yeaft.sessionStatus.task.promptSending":"\u53D1\u9001\u4E2D\u2026","yeaft.sessionStatus.task.promptFailed":"\u53D1\u9001\u5931\u8D25\u3002","yeaft.sessionStatus.task.title":"\u4EFB\u52A1","yeaft.sessionStatus.task.command":"\u547D\u4EE4","yeaft.sessionStatus.task.stop":"\u505C\u6B62\u4EFB\u52A1","yeaft.sessionStatus.task.stopping":"\u505C\u6B62\u4E2D\u2026","yeaft.sessionStatus.task.kind.subAgent":"sub-agent","yeaft.sessionStatus.task.kind.shell":"shell","yeaft.sessionStatus.show":"\u663E\u793A Session \u72B6\u6001","yeaft.sessionStatus.hide":"\u9690\u85CF Session \u72B6\u6001","yeaft.sessionStatus.close":"\u5173\u95ED Session \u72B6\u6001","yeaft.vpTimeline.empty":"\u672C Session \u8FD8\u6CA1\u6709 VP\u3002","yeaft.vpTimeline.resizeTitle":"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6","yeaft.vpTimeline.status.idle":"\u7A7A\u95F2","yeaft.vpTimeline.status.typing":"\u8F93\u5165\u4E2D\u2026","yeaft.vpTimeline.status.thinking":"\u601D\u8003\u4E2D\u2026","yeaft.vpTimeline.status.retrying":"\u6B63\u5728\u91CD\u8BD5\u8BF7\u6C42\u2026","yeaft.vpTimeline.status.streaming":"\u751F\u6210\u4E2D","yeaft.vpTimeline.status.tool":"\u8C03\u7528\u5DE5\u5177\u4E2D\u2026","yeaft.vpTimeline.status.error":"\u51FA\u9519","yeaft.vpTimeline.status.offline":"\u79BB\u7EBF","yeaft.vpTimeline.abort":"\u4E2D\u6B62","yeaft.vpTimeline.edit":"\u7F16\u8F91 VP","yeaft.vpTimeline.mention":"\u70B9\u51FB @ \u8BE5 VP","yeaft.vpTimeline.expand":"\u5C55\u5F00\u4EFB\u52A1\u8BE6\u60C5","yeaft.toolStats.title":"\u5DE5\u5177\u4F7F\u7528\u7EDF\u8BA1","yeaft.toolStats.refresh":"\u5237\u65B0","yeaft.toolStats.close":"\u5173\u95ED","yeaft.toolStats.tabAll":"\u5168\u90E8\u5DE5\u5177","yeaft.toolStats.tabUnused":"\u672A\u4F7F\u7528","yeaft.toolStats.loading":"\u52A0\u8F7D\u4E2D\u2026","yeaft.toolStats.notLoaded":"\u6682\u65E0\u6570\u636E \u2014 \u70B9\u51FB\u5237\u65B0\u3002","yeaft.toolStats.empty":"\uFF08\u6682\u65E0\u5DE5\u5177\u8C03\u7528\u8BB0\u5F55\uFF09","yeaft.toolStats.noneUnused":"\uFF08\u6BCF\u4E2A\u5DF2\u6CE8\u518C\u5DE5\u5177\u90FD\u81F3\u5C11\u88AB\u8C03\u7528\u8FC7\u4E00\u6B21\uFF09","yeaft.toolStats.fetchedAt":"\u83B7\u53D6\u65F6\u95F4","yeaft.toolStats.col.name":"\u5DE5\u5177","yeaft.toolStats.col.calls":"\u8C03\u7528","yeaft.toolStats.col.errors":"\u9519\u8BEF","yeaft.toolStats.col.errRate":"\u9519\u8BEF\u7387","yeaft.toolStats.col.p50":"p50","yeaft.toolStats.col.p95":"p95","yeaft.toolStats.col.avg":"\u5E73\u5747","yeaft.toolStats.col.last":"\u6700\u8FD1","yeaft.toolStats.buttonLabel":"\u5DE5\u5177\u7EDF\u8BA1","workCenter.title":"\u5DE5\u4F5C\u4E2D\u5FC3","workCenter.subtitle":"\u7531\u5F53\u524D Agent \u6301\u7EED\u63A8\u8FDB\u7684\u6301\u4E45\u5DE5\u4F5C","workCenter.agent":"Agent","workCenter.noOnlineAgents":"\u6CA1\u6709\u5728\u7EBF Agent","workCenter.noAvailableAgents":"\u6CA1\u6709\u517C\u5BB9\u5DE5\u4F5C\u4E2D\u5FC3\u7684\u5728\u7EBF Agent","workCenter.new":"\u65B0\u5EFA","workCenter.newWorkItem":"\u65B0\u5EFA\u5DE5\u4F5C\u9879","workCenter.workItem":"\u5DE5\u4F5C\u9879","workCenter.createFirst":"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u5DE5\u4F5C\u9879","workCenter.backToChat":"\u8FD4\u56DE\u5BF9\u8BDD","workCenter.refresh":"\u5237\u65B0","workCenter.search":"\u641C\u7D22\u5DE5\u4F5C\u9879","workCenter.filter":"\u7B5B\u9009","workCenter.filterAttention":"\u9700\u8981\u5904\u7406","workCenter.filterActive":"\u6267\u884C\u4E2D","workCenter.filterAll":"\u5168\u90E8","workCenter.filterDone":"\u5DF2\u5B8C\u6210","workCenter.attentionItems":"\u9700\u8981\u5904\u7406","workCenter.board.active":"\u8FDB\u884C\u4E2D","workCenter.board.needsAttention":"\u9700\u8981\u5904\u7406","workCenter.board.closed":"\u5DF2\u5173\u95ED","workCenter.board.emptyLane":"\u6682\u65E0\u5DE5\u4F5C\u9879","workCenter.board.lanes":"\u5DE5\u4F5C\u9879\u5206\u680F","workCenter.filterVp":"\u6309 VP \u7B5B\u9009","workCenter.filterType":"\u6309\u7C7B\u578B\u7B5B\u9009","workCenter.filterUpdated":"\u6309\u66F4\u65B0\u65F6\u95F4\u7B5B\u9009","workCenter.allVps":"\u5168\u90E8 VP","workCenter.allTypes":"\u5168\u90E8\u7C7B\u578B","workCenter.anyTime":"\u4E0D\u9650\u65F6\u95F4","workCenter.lastDay":"\u6700\u8FD1 24 \u5C0F\u65F6","workCenter.lastWeek":"\u6700\u8FD1 7 \u5929","workCenter.deleteWorkItem":"\u5220\u9664 Work Item","workCenter.deleteConfirm":"\u6C38\u4E45\u5220\u9664\u8FD9\u4E2A Work Item\u3001\u6267\u884C\u5386\u53F2\u548C\u9644\u4EF6\uFF1F","workCenter.deleteRequiresStop":"\u8BF7\u5148\u505C\u6B62\u8FD9\u4E2A Work Item \u518D\u5220\u9664","workCenter.lastMonth":"\u6700\u8FD1 30 \u5929","workCenter.assignment.planned":"\u8BA1\u5212\u5206\u914D","workCenter.created":"\u521B\u5EFA\u4E8E","workCenter.files":"\u4E2A\u6587\u4EF6","workCenter.loadMore":"\u52A0\u8F7D\u66F4\u591A","workCenter.activeItems":"\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C","workCenter.allItems":"\u5168\u90E8\u5DE5\u4F5C\u9879","workCenter.completedItems":"\u5DF2\u5B8C\u6210","workCenter.watcherActive":"Watcher \u8FD0\u884C\u4E2D","workCenter.loading":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u4F5C\u9879\u2026","workCenter.noTimestamp":"\u65E0\u65F6\u95F4\u6233","workCenter.updated":"\u66F4\u65B0\u65F6\u95F4","workCenter.emptyTitle":"\u8FD8\u6CA1\u6709\u5DE5\u4F5C\u9879","workCenter.emptyBody":"\u5F53\u5DE5\u4F5C\u9700\u8981\u8DE8\u8D8A\u4E00\u6B21\u5BF9\u8BDD\u3001\u7B49\u5F85\u6216\u89D2\u8272\u63A5\u529B\u65F6\uFF0C\u628A\u5B83\u521B\u5EFA\u4E3A\u6301\u4E45\u5DE5\u4F5C\u9879\u3002","workCenter.noAttentionTitle":"\u5F53\u524D\u6CA1\u6709\u9700\u8981\u5904\u7406\u7684\u5DE5\u4F5C\u9879","workCenter.noAttentionBody":"\u7B49\u5F85\u4F60\u56DE\u7B54\u6216\u9700\u8981\u6062\u590D\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noActiveTitle":"\u5F53\u524D\u6CA1\u6709\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C\u9879","workCenter.noActiveBody":"\u8349\u7A3F\u3001\u5C31\u7EEA\u548C\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noCompletedTitle":"\u8FD8\u6CA1\u6709\u5DF2\u5B8C\u6210\u7684\u5DE5\u4F5C\u9879","workCenter.noCompletedBody":"\u5B8C\u6210\u540E\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noMatchesTitle":"\u6CA1\u6709\u5339\u914D\u7684\u5DE5\u4F5C\u9879","workCenter.noMatchesBody":"\u5C1D\u8BD5\u8C03\u6574\u641C\u7D22\u5185\u5BB9\u6216\u7B5B\u9009\u6761\u4EF6\u3002","workCenter.selectTitle":"\u5DE5\u4F5C\u9879\u8BE6\u60C5","workCenter.detailLoading":"\u6B63\u5728\u52A0\u8F7D\u5B8C\u6574\u8BE6\u60C5\u2026","workCenter.detailLoadFailed":"\u65E0\u6CD5\u52A0\u8F7D\u5B8C\u6574\u8BE6\u60C5","workCenter.start":"\u5F00\u59CB","workCenter.retry":"\u91CD\u8BD5","workCenter.cancel":"\u53D6\u6D88","workCenter.closeWorkItem":"\u5173\u95ED\u8BE6\u60C5","workCenter.cancelWorkItem":"\u505C\u6B62\u5DE5\u4F5C\u9879","workCenter.cancelWorkItemHint":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u6240\u6709\u5C1A\u672A\u5B8C\u6210\u7684 Actions\u3002","workCenter.cancelConfirm":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u5176\u5C1A\u672A\u5B8C\u6210\u7684 Actions\uFF1F","workCenter.stopWorkItem":"\u505C\u6B62\u5DE5\u4F5C\u9879","workCenter.resumeWorkItem":"\u6062\u590D\u5DE5\u4F5C\u9879","workCenter.breadcrumbs":"Work Center \u5BFC\u822A","workCenter.actionNumber":"Action {number}","workCenter.actionBreadcrumb":"Action {number}\uFF1A{description}","workCenter.untitledAction":"\u672A\u547D\u540D Action","workCenter.workItems":"\u5DE5\u4F5C\u9879","workCenter.description":"\u9700\u6C42\u63CF\u8FF0","workCenter.goal":"\u76EE\u6807","workCenter.acceptanceCriteria":"\u9A8C\u6536\u6761\u4EF6","workCenter.noCriteria":"\u672A\u63D0\u4F9B\u9A8C\u6536\u6761\u4EF6","workCenter.failureReason":"\u5931\u8D25\u539F\u56E0","workCenter.workflow":"\u4EFB\u52A1\u6D41","workCenter.actionFlow":"Action \u6D41\u7A0B","workCenter.actionCount":"{count} \u4E2A Action","workCenter.noActionSummary":"\u6682\u65E0\u6458\u8981","workCenter.actionProgress":"{completed} / {total} \u4E2A Action","workCenter.currentAction":"\u5F53\u524D Action","workCenter.expandActions":"\u5C55\u5F00 Action","workCenter.collapseActions":"\u6536\u8D77","workCenter.actionObjective":"\u8FD9\u6B21\u8981\u505A\u4EC0\u4E48","workCenter.actionApproach":"\u51C6\u5907\u600E\u4E48\u505A","workCenter.actionExpectedOutcome":"\u671F\u5F85\u7684\u7ED3\u679C","workCenter.dependencies":"\u4F9D\u8D56\u9879","workCenter.actionResult":"\u6700\u65B0\u7ED3\u679C","workCenter.currentProgress":"\u5F53\u524D\u8FDB\u5EA6","workCenter.actionMessages":"\u6D88\u606F","workCenter.loops":"\u4E2A Loop","workCenter.tools":"\u6B21\u5DE5\u5177\u8C03\u7528","workCenter.noActionMessages":"\u8FD8\u6CA1\u6709\u6D88\u606F\u3002","workCenter.actionDetails":"Action \u8BE6\u60C5","workCenter.selectAction":"\u9009\u62E9\u4E00\u4E2A Action \u67E5\u770B\u5B9E\u9645\u6267\u884C","workCenter.backToWorkItems":"\u5DE5\u4F5C\u9879","workCenter.backToActions":"Actions","workCenter.you":"\u4F60","workCenter.noRequestDetails":"\u8FD9\u4E2A Action \u6682\u65F6\u6CA1\u6709\u53EF\u7528\u7684\u6267\u884C\u8BB0\u5F55\u3002","workCenter.loadingRequests":"\u6B63\u5728\u52A0\u8F7D\u6267\u884C\u8BB0\u5F55\u2026","workCenter.loadingRequestDetail":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u5177\u8BC1\u636E\u2026","workCenter.requestDetailUnavailable":"\u5DE5\u5177\u8BC1\u636E\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u8BD5\u3002","workCenter.noRequestLoops":"\u8FD9\u6B21\u6267\u884C\u6CA1\u6709\u4FDD\u7559\u4E0B\u53EF\u5C55\u793A\u7684 Loop\u3002","workCenter.requestDetailTruncated":"\u6267\u884C\u5185\u5BB9\u8F83\u5927\uFF1A{summarized} \u4E2A Loop \u663E\u793A\u6458\u8981\uFF0C\u53E6\u6709 {omitted} \u4E2A\u8F83\u65E9 Loop \u672A\u663E\u793A\u3002","workCenter.loopDetailTruncated":"\u8FD9\u4E2A Loop \u5185\u5BB9\u8F83\u5927\uFF0C\u5F53\u524D\u663E\u793A\u4FDD\u7559\u4E0B\u6765\u7684\u5DE5\u5177\u8BC1\u636E\u3002","workCenter.loadEarlierMessages":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","workCenter.loadingEarlierMessages":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","workCenter.unknownModel":"\u672A\u77E5\u6A21\u578B","workCenter.loop":"Loop","workCenter.actionBrief":"\u4EFB\u52A1\u8BF4\u660E","workCenter.executionSummary":"\u6267\u884C\u6458\u8981","workCenter.toolParameters":"\u8C03\u7528\u53C2\u6570","workCenter.toolResult":"\u6267\u884C\u7ED3\u679C","workCenter.noToolCalls":"\u8FD9\u4E2A Loop \u6CA1\u6709\u5DE5\u5177\u8C03\u7528\u3002","workCenter.actionInputPlaceholder":"\u8865\u5145\u4E0A\u4E0B\u6587\u3001\u56DE\u7B54\u95EE\u9898\u6216\u8C03\u6574\u8FD9\u4E2A Action","workCenter.actionInputResumeHint":"\u4F60\u7684\u8F93\u5165\u4F1A\u5E26\u7740\u65B0\u589E\u4E0A\u4E0B\u6587\u7EE7\u7EED\u8FD9\u4E2A Action\u3002","workCenter.actionInputCoordinatorHint":"\u4F60\u7684\u56DE\u7B54\u4F1A\u53D1\u9001\u7ED9 Work Item Coordinator\uFF0C\u7531\u5B83\u51B3\u5B9A\u91CD\u8BD5\u6216\u91CD\u65B0\u89C4\u5212\u5269\u4F59 Actions\u3002","workCenter.waitingQuestionTitle":"\u9700\u8981\u4F60\u7684\u56DE\u7B54","workCenter.actionInputRetryHint":"\u8865\u5145\u4FEE\u6B63\u8BF4\u660E\u6216\u6587\u4EF6\u540E\uFF0C\u4F7F\u7528\u65B0\u4E0A\u4E0B\u6587\u91CD\u65B0\u6267\u884C\u8FD9\u4E2A Action\u3002","workCenter.actionInputContinueHint":"\u8FD9\u91CC\u53EA\u76F4\u63A5\u5E72\u9884\u5F53\u524D Action\u3002","workCenter.actionFailedTitle":"\u8FD9\u4E2A Action \u4E3A\u4EC0\u4E48\u5931\u8D25","workCenter.failedAt":"\u5931\u8D25\u65F6\u95F4","workCenter.actionFailureRecovery":"\u5728\u4E0B\u65B9\u8865\u5145\u4FEE\u6B63\u8BF4\u660E\u6216\u6587\u4EF6\u5373\u53EF\u91CD\u65B0\u6267\u884C\uFF1B\u6267\u884C\u9875\u4F1A\u5C55\u793A\u4FDD\u7559\u4E0B\u6765\u7684\u5DE5\u5177\u8BC1\u636E\u3002","workCenter.sendInput":"\u53D1\u9001\u7ED9 Action","workCenter.sendingInput":"\u6B63\u5728\u53D1\u9001\u2026","workCenter.retryAction":"\u91CD\u8BD5 Action","workCenter.sendAndRetryAction":"\u53D1\u9001\u5E76\u91CD\u8BD5 Action","workCenter.coordinatorDecision.guide_actions":"\u5DF2\u66F4\u65B0 Action \u6307\u4EE4","workCenter.coordinatorDecision.replan":"\u5DF2\u66F4\u65B0\u76EE\u6807\u6216\u8BA1\u5212","workCenter.coordinatorDecision.request_human":"\u9700\u8981\u4EBA\u5DE5\u8865\u5145\u4FE1\u606F","workCenter.conversation":"\u5BF9\u8BDD","workCenter.conversationThinking":"\u5904\u7406\u4E2D\u2026","workCenter.conversationReadOnly":"\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u5DF2\u5173\u95ED\uFF0C\u5BF9\u8BDD\u8BB0\u5F55\u4ECD\u53EF\u67E5\u770B\u3002","workCenter.conversationPlaceholder":"\u7EE7\u7EED\u8BA8\u8BBA\u8FD9\u4E2A\u5DE5\u4F5C\u9879","workCenter.sendMessage":"\u53D1\u9001\u6D88\u606F","workCenter.assistant":"Yeaft","workCenter.originalRequest":"\u539F\u59CB\u9700\u6C42","workCenter.actionMessageScopeTitle":"\u7ED9\u8FD9\u4E2A Action \u53D1\u6D88\u606F","workCenter.actionMessageScope":"\u6D88\u606F\u53EA\u53D1\u9001\u7ED9\u5F53\u524D Action\u3002","workCenter.actionConversation":"\u5BF9\u8BDD","workCenter.actionConversationWith":"Action \u6267\u884C\u8005","workCenter.actionViews":"Action \u89C6\u56FE","workCenter.actionExecutor":"\u6267\u884C\u8005","workCenter.actionExecutorPending":"\u7B49\u5F85\u5206\u914D\u6267\u884C\u8005","workCenter.actionInformation":"Action \u4FE1\u606F","workCenter.messageExecutor":"\u7ED9 {name} \u53D1\u6D88\u606F","workCenter.actionChatPlaceholder":"\u548C {name} \u8BA8\u8BBA\u8FD9\u4E2A Action","workCenter.statusLabel":"\u72B6\u6001","workCenter.llmRequestsLabel":"LLM \u8BF7\u6C42","workCenter.loopsLabel":"Loops","workCenter.toolsLabel":"\u5DE5\u5177","workCenter.tokensLabel":"Tokens","workCenter.workItemMessagePlaceholder":"\u8865\u5145\u6574\u4E2A Work Item \u7684\u65B9\u5411\u6216\u7EA6\u675F","workCenter.sendWorkItemMessage":"\u53D1\u9001\u7ED9 Work Item","workCenter.fromSession":"\u4ECE\u5F53\u524D Session \u521B\u5EFA\u5DE5\u4F5C\u9879","workCenter.llmRequestCount":"{count} \u6B21 LLM \u8BF7\u6C42","workCenter.loopCount":"{count} \u6B21 Loop","workCenter.toolCount":"{count} \u4E2A\u5DE5\u5177","workCenter.tokenCount":"{count} tokens","workCenter.tokenBreakdown":"\u8F93\u5165 {input} / \u8F93\u51FA {output} / \u7F13\u5B58 {cache}","workCenter.guidance":"\u7ED9\u5F53\u524D Action \u8865\u5145\u63D0\u793A","workCenter.guidanceHint":"\u8865\u5145\u7EA6\u675F\uFF0C\u6216\u8C03\u6574\u5F53\u524D Action \u7684\u6267\u884C\u65B9\u5411","workCenter.guidanceRestartHint":"\u53D1\u9001\u540E\u4F1A\u4F7F\u7528\u65B0\u63D0\u793A\u91CD\u542F\u5F53\u524D Action\u3002","workCenter.sendGuidance":"\u53D1\u9001\u63D0\u793A","workCenter.reuseMemory":"\u4F7F\u7528\u76F8\u5173 Agent memory \u548C\u6B64\u9879\u76EE\u7684\u5DF2\u5B8C\u6210\u5DE5\u4F5C","workCenter.reuseMemoryHelp":"\u5305\u62EC\u53D7 scope \u7EA6\u675F\u7684 Agent memory\uFF0C\u4EE5\u53CA canonical \u9879\u76EE\u76EE\u5F55\u76F8\u540C\u7684\u5DF2\u5B8C\u6210 Work Item \u7ED3\u6784\u5316\u6458\u8981\u548C\u8BC1\u636E\uFF1B\u4E0D\u4F1A\u590D\u7528\u539F\u59CB\u5DE5\u5177\u8F93\u51FA\u3002","workCenter.resumeAnswer":"\u56DE\u7B54\u7B49\u5F85\u4E2D\u7684\u95EE\u9898","workCenter.resumeAnswerHint":"\u63D0\u4F9B\u7EE7\u7EED\u6267\u884C\u6240\u9700\u7684\u4FE1\u606F","workCenter.answerInActionDetail":"\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 Coordinator\uFF0C\u4EE5\u53CA AI \u52A8\u6001\u89C4\u5212\u4F7F\u7528\u7684 Action \u63D0\u793A\u8BCD\u3001\u6A21\u578B\u548C effort\u3002","workCenter.settings.workflow":"\u4EFB\u52A1\u6D41","workCenter.settings.workflowHelp":"Triage \u4F1A\u9488\u5BF9\u4EFB\u52A1\u52A8\u6001\u9009\u62E9 Action \u548C\u6267\u884C\u8005\u3002","workCenter.settings.aiWorkflowHelp":"Triage \u4F1A\u4E3A\u6BCF\u4E2A Work Item \u5206\u7C7B\u5E76\u751F\u6210\u7ECF\u8FC7\u6821\u9A8C\u7684 1\u20138 \u4E2A\u4EFB\u52A1\u4E13\u5C5E Action\u3002\u5185\u7F6E Action \u7B56\u7565\u53EA\u662F\u53EF\u590D\u7528\u9ED8\u8BA4\u503C\uFF1B\u9700\u8981\u65F6 triage \u53EF\u4EE5\u521B\u5EFA\u7CBE\u786E\u7684\u9886\u57DF\u7C7B\u578B\u3002","workCenter.settings.globalInstructions":"Agent \u5168\u5C40\u6307\u4EE4","workCenter.settings.globalInstructionsHint":"\u4F8B\u5982\uFF1A\u9075\u5FAA\u4ED3\u5E93\u53D1\u5E03\u6D41\u7A0B\u3001\u5FC5\u987B\u72EC\u7ACB\u8BC4\u5BA1\uFF0C\u672A\u7ECF\u660E\u786E\u6279\u51C6\u4E0D\u5F97\u521B\u5EFA\u90E8\u7F72 tag\u3002","workCenter.settings.globalInstructionsHelp":"\u4FDD\u5B58\u5728 Agent \u7EA7\uFF0C\u5E76\u51BB\u7ED3\u8FDB\u6BCF\u4E2A\u65B0 Work Item\uFF1B\u5BF9 triage \u548C\u6240\u6709\u751F\u6210\u7684 Action \u751F\u6548\uFF0C\u4F18\u5148\u7EA7\u4F4E\u4E8E Work Item \u5951\u7EA6\u53CA\u7CFB\u7EDF/\u5DE5\u5177\u5B89\u5168\u89C4\u5219\u3002\u5DF2\u6709 Work Item \u4FDD\u7559\u539F\u5FEB\u7167\u3002","workCenter.settings.actionPolicies":"\u5185\u7F6E Action \u7B56\u7565","workCenter.settings.actionPoliciesHelp":"\u8FD9\u4E9B\u662F\u53EF\u590D\u7528\u7684\u6267\u884C\u57FA\u7EBF\uFF0C\u4E0D\u662F\u56FA\u5B9A\u5DE5\u4F5C\u6D41\u3002\u672A\u77E5\u7684\u9886\u57DF Action \u7C7B\u578B\u4F1A\u4F7F\u7528\u201C\u81EA\u5B9A\u4E49\u201D\u7B56\u7565\uFF0C\u5E76\u4FDD\u7559 triage \u751F\u6210\u7684\u7C7B\u578B\u548C\u4EFB\u52A1\u76EE\u6807\u3002","workCenter.settings.dynamicInstructionHelp":"AI \u4F1A\u52A0\u5165 Work Item \u5951\u7EA6\u3001\u5168\u5C40\u6307\u4EE4\u3001\u524D\u5E8F Action \u4E0A\u4E0B\u6587\u3001memory \u548C\u4EFB\u52A1\u4E13\u5C5E\u76EE\u6807\uFF1B\u8FD9\u91CC\u5B9A\u4E49\u8BE5 Action \u7C7B\u578B\u7684\u53EF\u590D\u7528\u884C\u4E3A\u3002","workCenter.settings.models":"\u6A21\u578B","workCenter.settings.modelsHelp":"Provider \u548C\u51ED\u8BC1\u4ECD\u7531 Agent LLM \u8BBE\u7F6E\u7BA1\u7406\uFF1B\u5DE5\u4F5C\u4E2D\u5FC3\u53EA\u9009\u62E9\u53EF\u7528\u6A21\u578B\u3002","workCenter.settings.dynamicModelsHelp":"Coordinator \u4E0E\u5B9E\u9645\u6267\u884C Action \u7684\u6A21\u578B\u53EF\u4EE5\u5206\u522B\u914D\u7F6E\u3002","workCenter.settings.coordinatorModel":"Coordinator","workCenter.settings.coordinatorModelHelp":"\u7528\u4E8E Work Item \u5BF9\u8BDD\u3001\u4FEE\u6539\u76EE\u6807\u548C\u91CD\u65B0\u89C4\u5212\uFF1B\u4E0D\u4F1A\u6267\u884C\u9879\u76EE\u5DE5\u5177\u3002","workCenter.settings.allActions":"\u6240\u6709 Action \u7684\u515C\u5E95\u7B56\u7565","workCenter.settings.maxConcurrentActions":"\u6700\u5927\u5E76\u53D1 Action \u6570","workCenter.settings.maxConcurrentActionsHelp":"\u9ED8\u8BA4 3\u3002\u975E Git\u3001\u810F\u5DE5\u4F5C\u533A\u3001\u5171\u4EAB\u526F\u4F5C\u7528\u548C\u96C6\u6210 Action \u4ECD\u4F1A\u4E32\u884C\u6267\u884C\u3002","workCenter.workItemType":"\u7C7B\u578B","workCenter.typeAuto":"Auto \u2014 \u7531 LLM \u63A8\u65AD","workCenter.typeHelp":"\u53EF\u9009\u62E9\u4EFB\u52A1\u7C7B\u522B\uFF0C\u4E5F\u53EF\u8BA9 AI \u81EA\u52A8\u63A8\u65AD\uFF1B\u5177\u4F53 Actions \u59CB\u7EC8\u7531 AI \u89C4\u5212\u3002","workCenter.planning":"\u89C4\u5212\u4E2D","workCenter.aiPlan":"AI \u52A8\u6001\u89C4\u5212\u6267\u884C","workCenter.aiPlanHelp":"Triage \u4F1A\u9009\u62E9\u4EFB\u52A1\u7C7B\u578B\u3001Action\u3001\u6267\u884C\u8005\u548C\u6700\u5C0F\u53EF\u9760\u6D41\u7A0B\uFF1B\u6A21\u578B\u4E0E effort \u7531 Work Center \u8BBE\u7F6E\u63A7\u5236\u3002","workCenter.settings.manageProviders":"\u7BA1\u7406 Agent \u6A21\u578B","workCenter.settings.assignment":"VP \u9009\u62E9","workCenter.settings.assignment.auto":"\u4ECE\u5168\u90E8 VP \u81EA\u52A8\u9009\u62E9","workCenter.settings.assignment.pool":"\u5019\u9009\u6C60","workCenter.settings.assignment.fixed":"\u56FA\u5B9A VP","workCenter.settings.capability":"\u6240\u9700\u80FD\u529B","workCenter.settings.vp":"Virtual Person","workCenter.settings.poolMembers":"\u5019\u9009 VP","workCenter.settings.modelPolicy":"\u6A21\u578B\u7B56\u7565","workCenter.settings.model.inherit":"\u7EE7\u627F VP \u504F\u597D","workCenter.settings.model.primary":"Agent \u4E3B\u6A21\u578B","workCenter.settings.model.fast":"Agent \u5FEB\u6A21\u578B","workCenter.settings.model.specific":"\u6307\u5B9A\u6A21\u578B","workCenter.settings.model":"\u6A21\u578B","workCenter.settings.effort":"\u63A8\u7406\u5F3A\u5EA6","workCenter.settings.effortDefault":"\u6A21\u578B\u9ED8\u8BA4\u503C","workCenter.settings.effortHelp":"\u8986\u76D6\u6240\u9009\u6A21\u578B\u7684\u9ED8\u8BA4\u63A8\u7406\u5F3A\u5EA6\uFF0C\u5E76\u7528\u4E8E\u6240\u6709 Work Center Action\u3002","workCenter.settings.effortChooseModelHelp":"\u9009\u62E9 Agent \u4E3B\u6A21\u578B\u3001\u5FEB\u6A21\u578B\u6216\u6307\u5B9A\u6A21\u578B\u540E\u53EF\u914D\u7F6E\u63A8\u7406\u5F3A\u5EA6\uFF1B\u7EE7\u627F VP \u504F\u597D\u65F6\u4F7F\u7528\u5404 VP \u6A21\u578B\u7684\u9ED8\u8BA4\u503C\u3002","workCenter.settings.effortUnsupportedHelp":"\u6240\u9009\u6A21\u578B\u4E0D\u63D0\u4F9B\u53EF\u914D\u7F6E\u7684\u63A8\u7406\u5F3A\u5EA6\uFF0C\u56E0\u6B64\u4F7F\u7528\u6A21\u578B\u9ED8\u8BA4\u503C\u3002","workCenter.settings.saving":"\u4FDD\u5B58\u4E2D\u2026","workCenter.settings.reload":"\u91CD\u65B0\u52A0\u8F7D\u8BBE\u7F6E","workCenter.settings.conflict":"\u8BBE\u7F6E\u5DF2\u5728\u5176\u4ED6\u4F4D\u7F6E\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u540E\u518D\u4FDD\u5B58\u3002","workCenter.settings.upgradeRequired":"\u5F53\u524D Agent \u7248\u672C\u65E0\u6CD5\u4FDD\u5B58\u5DE5\u4F5C\u4E2D\u5FC3\u8BBE\u7F6E\u3002\u8FD9\u91CC\u4EE5\u53EA\u8BFB\u65B9\u5F0F\u663E\u793A\u5F53\u524D\u503C\uFF1B\u5347\u7EA7 Agent \u540E\u5373\u53EF\u7F16\u8F91\u5E76\u4FDD\u5B58\u3002","workCenter.settings.saveNotConfirmed":"Agent \u672A\u786E\u8BA4\u672C\u6B21\u63D0\u4EA4\u7684\u63D0\u793A\u8BCD\u548C\u6A21\u578B\u7B56\u7565\u3002\u8BBE\u7F6E\u7A97\u53E3\u4E0D\u4F1A\u5173\u95ED\uFF1B\u8BF7\u91CD\u65B0\u52A0\u8F7D\u6216\u5347\u7EA7 Agent \u540E\u518D\u8BD5\u3002","workCenter.settings.addWorkflow":"\u590D\u5236\u4EFB\u52A1\u6D41","workCenter.settings.removeWorkflow":"\u5220\u9664","workCenter.settings.newWorkflow":"\u4EFB\u52A1\u6D41 {index}","workCenter.settings.workflowName":"\u4EFB\u52A1\u6D41\u540D\u79F0","workCenter.settings.newStage":"\u65B0\u9636\u6BB5","workCenter.settings.addStage":"\u6DFB\u52A0\u9636\u6BB5","workCenter.settings.removeStage":"\u5220\u9664\u9636\u6BB5","workCenter.settings.moveUp":"\u4E0A\u79FB\u9636\u6BB5","workCenter.settings.moveDown":"\u4E0B\u79FB\u9636\u6BB5","workCenter.settings.stageType":"\u9636\u6BB5\u7C7B\u578B","workCenter.settings.reviewReturnStage":"\u8981\u6C42\u4FEE\u6539\u65F6\u9000\u56DE\u9636\u6BB5","workCenter.settings.instruction":"\u9636\u6BB5 Prompt","workCenter.settings.instructionHint":"\u5B9A\u4E49\u8FD9\u4E2A\u9636\u6BB5\u5177\u4F53\u8981\u505A\u4EC0\u4E48\u3002","workCenter.settings.instructionHelp":"\u8FD0\u884C\u65F6\u4F1A\u81EA\u52A8\u52A0\u5165 Work Item \u7684\u76EE\u6807\u3001\u9A8C\u6536\u6807\u51C6\u548C\u53EF\u590D\u7528\u4E0A\u4E0B\u6587\u3002","workCenter.settings.instructionReset":"\u6062\u590D\u9ED8\u8BA4\u503C"}});var id,rd=H(()=>{id={"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","message.showProgress":"Expand progress","message.hideProgress":"Collapse progress","login.subtitle":"Yeaft Web Code Agent","login.username":"Username","login.password":"Password","login.login":"Login","login.loggingIn":"Logging in...","login.enterUsername":"Please enter your username","login.enterPassword":"Please enter your password","login.noAccount":"Don't have an account?","login.registerWithCode":"Register","login.or":"or","login.usePassword":"Sign in with username & password","login.useSso":"Back to single sign-on","login.noProviders":"No third-party sign-in providers are enabled.","login.microsoft":"Sign in with Microsoft","login.github":"Sign in with GitHub","login.google":"Sign in with Google","login.wechat":"Sign in with WeChat","login.alipay":"Sign in with Alipay","login.wechat.mobileUnsupported":"Sign in with WeChat is only available on PC. Please scan the QR code from a desktop browser.","login.alipay.mobileWaiting":"Waiting for you to confirm in the Alipay app\u2026 Once you finish, return to this page and you will be signed in automatically.","login.alipay.relaunch":"Open Alipay again","login.qr.title":"Scan to sign in","login.qr.titleAlipay":"Sign in with Alipay","login.qr.titleWechat":"Sign in with WeChat","login.qr.hint":"Scan the QR code with your phone to authorize.","login.error.enterUsername":"Please enter your username","login.error.enterPassword":"Please enter your password","login.error.enter6Digit":"Please enter a 6-digit code","login.error.enterInviteCode":"Please enter the invite code","login.error.usernameMinLen":"Username must be at least 2 characters","login.error.passwordMinLen":"Password must be at least 6 characters","login.error.passwordMismatch":"Passwords do not match","login.error.enterVerifyCode":"Please enter the verification code","login.error.loginFailed":"Login failed","login.forgot.link":"Forgot password?","login.forgot.title":"Reset your password","login.forgot.emailHint":"Enter the email address on your account. We will send a 6-digit reset code.","login.forgot.sendCode":"Send Reset Code","login.forgot.sending":"Sending...","login.forgot.codeSent":"If the email is on file, a 6-digit reset code has been sent. Enter it below along with your new password.","login.forgot.resetBtn":"Reset Password","login.forgot.resetting":"Resetting...","login.forgot.success":"Password reset. You can now sign in with your new password.","login.forgot.emailInvalid":"Please enter a valid email","login.register.title":"New User Registration","login.register.inviteCode":"Invite Code","login.register.username":"Username","login.register.password":"Password (min 6 characters)","login.register.confirmPassword":"Confirm Password","login.register.email":"Email (optional)","login.register.submit":"Register","login.register.submitting":"Registering...","login.register.back":"Back to Login","login.register.success":"Registration successful, please login","login.register.enterCode":"Please enter the invite code","login.register.usernameMin":"Username must be at least 2 characters","login.register.passwordMin":"Password must be at least 6 characters","login.register.passwordMismatch":"Passwords do not match","login.totp.setupTitle":"Set Up Two-Factor Authentication","login.totp.setupHint":"Scan the QR code below with Microsoft Authenticator or Google Authenticator","login.totp.manualKey":"Or enter the key manually:","login.totp.enterCode":"Enter 6-digit code","login.totp.complete":"Complete Setup","login.totp.verifying":"Verifying...","login.totp.verify":"Verify","login.totp.prompt":"Enter the code from your Authenticator app","login.totp.invalidCode":"Please enter a 6-digit code","login.email.codeSent":"Verification code sent to {email}","login.email.enterCode":"Enter verification code","login.email.verify":"Verify","login.email.verifying":"Verifying...","login.email.enterCodeError":"Please enter the verification code","chat.agent.select":"Select Agent","chat.agent.manage":"Manage Agents","chat.agent.none":"No Agents","chat.agent.restarting":"Restarting","chat.agent.restart":"Restart","chat.agent.restartConfirm":`Are you sure you want to restart Agent "{name}"?
12
+ \u5347\u7EA7\u5B8C\u6210\u540E Agent \u4F1A\u81EA\u52A8\u91CD\u542F\u3002`,"chat.agent.alreadyLatest":"Agent \u5DF2\u662F\u6700\u65B0\u7248\u672C (v{version})\uFF0C\u65E0\u9700\u5347\u7EA7\u3002","chat.agent.nodeIncompatible":"Agent \u5347\u7EA7\u4E2D\u6B62\uFF1A\u76EE\u6807\u7248\u672C v{version} \u9700\u8981 Node {required}\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u8FD0\u884C\u7684\u662F Node {current}\u3002\u8BF7\u5148\u5347\u7EA7 Node.js \u518D\u91CD\u8BD5\u3002","chat.agent.online":"{count} \u4E2A Agent \u5728\u7EBF","chat.agent.selectFirst":"\u8BF7\u5148\u9009\u62E9\u4E00\u4E2A Agent","chat.agent.yeaft":"Yeaft \u5BF9\u8BDD","sidebar.toggle.chat":"\u5207\u6362\u5230 Chat","sidebar.toggle.yeaft":"\u5207\u6362\u5230 Yeaft","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.sender":"\u53D1\u9001\u8005","yeaft.outline.allSenders":"\u5168\u90E8\u53D1\u9001\u8005","yeaft.outline.title":"\u5386\u53F2\u6D88\u606F","yeaft.outline.placeholder":"\u641C\u7D22\u5F53\u524D\u5BF9\u8BDD","yeaft.outline.searching":"\u6B63\u5728\u641C\u7D22\u2026","yeaft.outline.loading":"\u6B63\u5728\u52A0\u8F7D\u2026","yeaft.outline.older":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","yeaft.outline.moreMatches":"\u52A0\u8F7D\u66F4\u591A\u5339\u914D\u9879","yeaft.outline.minChars":"\u81F3\u5C11\u8F93\u5165 2 \u4E2A\u5B57\u7B26","yeaft.outline.empty":"\u6682\u65E0\u6D88\u606F","yeaft.outline.noMatches":"\u6CA1\u6709\u5339\u914D\u7684\u6D88\u606F","yeaft.outline.error":"\u5927\u7EB2\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5","yeaft.outline.unsupported":"\u8BF7\u5347\u7EA7\u5F53\u524D Agent \u540E\u518D\u4F7F\u7528\u5BF9\u8BDD\u5927\u7EB2","yeaft.outline.you":"\u4F60","yeaft.outline.assistant":"\u52A9\u624B","yeaft.outline.nonText":"\u975E\u6587\u672C\u56DE\u590D","yeaft.switchModel":"\u5207\u6362\u6A21\u578B","yeaft.modelMenu.title":"\u6A21\u578B\u548C LLM \u8BBE\u7F6E","yeaft.modelMenu.label":"\u6A21\u578B","yeaft.modelMenu.effort":"\u63A8\u7406\u5F3A\u5EA6","yeaft.modelMenu.effort.openaiReasoning":"\u63A8\u7406\u5F3A\u5EA6","yeaft.modelMenu.effort.anthropicBudget":"\u601D\u8003\u9884\u7B97","yeaft.modelMenu.effort.anthropicAdaptive":"\u81EA\u9002\u5E94\u601D\u8003\u5F3A\u5EA6","yeaft.modelMenu.effort.minimal":"\u6700\u5C0F","yeaft.modelMenu.effort.low":"\u4F4E","yeaft.modelMenu.effort.medium":"\u4E2D","yeaft.modelMenu.effort.high":"\u9AD8","yeaft.modelMenu.effort.xhigh":"\u8D85\u9AD8","yeaft.modelMenu.effort.max":"\u6700\u9AD8","yeaft.modelMenu.noEffort":"\u5F53\u524D\u6A21\u578B\u6CA1\u6709\u53EF\u517C\u5BB9\u6620\u5C04\u7684\u63A8\u7406\u5F3A\u5EA6\u63A7\u5236\u3002","yeaft.modelMenu.configureHint":"Provider\u3001\u5BC6\u94A5\u3001\u6A21\u578B\u5217\u8868","yeaft.settings.title":"\u8BBE\u7F6E","yeaft.settings.tabs.vp":"VP \u5E93","yeaft.settings.tabs.search":"\u641C\u7D22","search.settings.backendTitle":"\u641C\u7D22\u540E\u7AEF","search.settings.backendDesc":"\u9009\u62E9 WebSearch \u5DE5\u5177\u9ED8\u8BA4\u4F7F\u7528\u7684\u540E\u7AEF\u3002\u4E3B\u540E\u7AEF\u5931\u8D25\u65F6,\u5F15\u64CE\u4F1A\u81EA\u52A8\u964D\u7EA7\u5230 HTML \u6293\u53D6\u3002","search.settings.backend.tavily":"Tavily","search.settings.backend.tavilyHint":"\u6258\u7BA1\u641C\u7D22 API\u3002\u514D\u8D39\u989D\u5EA6 1000 \u6B21/\u6708\u3002\u63A8\u8350\u3002","search.settings.backend.playwright":"Playwright \u670D\u52A1","search.settings.backend.playwrightHint":"\u81EA\u5EFA\u7684\u6D4F\u89C8\u5668\u5F0F\u641C\u7D22/\u6293\u53D6\u670D\u52A1,\u9002\u5408 IP \u4FE1\u8A89\u5DEE\u88AB bot \u68C0\u6D4B\u7684\u73AF\u5883\u3002\u5C1A\u672A\u4E0A\u7EBF\u3002","search.settings.comingSoon":"\u5373\u5C06\u63A8\u51FA","search.settings.tavilyKeyTitle":"Tavily API key","search.settings.tavilyKeyDesc":"\u4FDD\u5B58\u5728 agent \u7684 ~/.yeaft/config.json \u4E2D\u3002\u514D\u8D39\u7533\u8BF7:","search.settings.tavilyKeyUnchanged":"\u4FDD\u6301\u4E0D\u53D8","search.settings.clearKey":"\u6E05\u9664","search.settings.usageTitle":"\u672C\u6708\u7528\u91CF","search.settings.usageRefresh":"\u5237\u65B0","search.settings.usageLoading":"\u52A0\u8F7D\u4E2D\u2026","search.settings.usagePlan":"\u8BA1\u5212","search.settings.usageUsed":"\u5DF2\u7528","search.settings.usagePaygo":"\u6309\u91CF\u4ED8\u8D39","search.settings.usageError":"\u52A0\u8F7D\u7528\u91CF\u5931\u8D25","search.settings.save":"\u4FDD\u5B58","search.settings.saving":"\u4FDD\u5B58\u4E2D\u2026","search.settings.saveSuccess":"\u5DF2\u4FDD\u5B58","search.settings.cancel":"\u91CD\u7F6E","yeaft.settings.yeaftTitle":"\u7EBF\u7A0B\u5E76\u53D1\u4E0E\u5F52\u6863","yeaft.settings.yeaftDesc":"\u8C03\u6574\u53EF\u540C\u65F6\u8FD0\u884C\u7684\u7EBF\u7A0B\u6570\u91CF\uFF0C\u4EE5\u53CA\u95F2\u7F6E\u7EBF\u7A0B\u7684\u81EA\u52A8\u5F52\u6863\u65F6\u957F\u3002","yeaft.settings.maxConcurrentLabel":"\u6700\u5927\u5E76\u53D1\u7EBF\u7A0B\u6570","yeaft.settings.maxConcurrentHint":"\u540C\u65F6\u5728\u7EBF\u7684\u7EBF\u7A0B\u603B\u6570\u4E0A\u9650\uFF08\u542B\u59CB\u7EC8\u5B58\u5728\u7684 main \u4E3B\u7EBF\u7A0B\uFF09\u3002\u8D85\u8FC7\u6B64\u4E0A\u9650\u7684\u65B0\u7EBF\u7A0B\u5C06\u88AB\u62D2\u7EDD\uFF0C\u76F4\u81F3\u5DF2\u6709\u7EBF\u7A0B\u88AB\u5F52\u6863\u6216\u7EC8\u6B62\u3002\u8303\u56F4\uFF1A1-50\u3002","yeaft.settings.archiveIdleDaysLabel":"\u95F2\u7F6E\u591A\u4E45\u540E\u81EA\u52A8\u5F52\u6863\u7EBF\u7A0B\uFF08\u5929\uFF09","yeaft.settings.archiveIdleDaysHint":"\u65E0\u6D3B\u52A8\u8D85\u8FC7\u6B64\u5929\u6570\u7684\u7EBF\u7A0B\u5C06\u88AB\u5F52\u6863\u3002\u8303\u56F4\uFF1A1-3650\u3002","yeaft.settings.yeaftSaveBtn":"\u4FDD\u5B58","yeaft.settings.yeaftSaving":"\u4FDD\u5B58\u4E2D...","yeaft.settings.yeaftSaved":"\u5DF2\u4FDD\u5B58","yeaft.settings.yeaftLoading":"\u52A0\u8F7D\u4E2D...","yeaft.settings.yeaftLoadError":"\u52A0\u8F7D Yeaft \u8BBE\u7F6E\u5931\u8D25","yeaft.settings.yeaftSaveError":"\u4FDD\u5B58 Yeaft \u8BBE\u7F6E\u5931\u8D25","yeaft.settings.rangeErrorConcurrent":"\u5FC5\u987B\u5728 1 \u5230 50 \u4E4B\u95F4","yeaft.settings.rangeErrorArchive":"\u5FC5\u987B\u5728 1 \u5230 3650 \u4E4B\u95F4","chat.session.creating":"\u6B63\u5728\u521B\u5EFA\u4F1A\u8BDD...","chat.session.loadingHistory":"\u6B63\u5728\u52A0\u8F7D\u4F1A\u8BDD\u5386\u53F2...","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","message.quote":"\u5F15\u7528","message.removeQuote":"\u5220\u9664\u5F15\u7528","message.replyingTo":"\u6B63\u5728\u56DE\u590D {author}","message.quotedFrom":"\u5F15\u7528\u81EA {author}","message.editAsNew":"\u7F16\u8F91","message.you":"\u4F60","input.upload":"\u4E0A\u4F20\u6587\u4EF6","input.placeholder":"\u8F93\u5165\u6D88\u606F...","input.send":"\u53D1\u9001","input.stopExecution":"\u505C\u6B62\u6267\u884C","chatInput.upload":"\u4E0A\u4F20\u6587\u4EF6","chatInput.uploading":"\u6B63\u5728\u4E0A\u4F20\u2026","chatInput.uploadFailed":"\u4E0A\u4F20\u5931\u8D25","chatInput.retryUpload":"\u91CD\u8BD5","chatInput.removeAttachment":"\u79FB\u9664\u9644\u4EF6","chatInput.placeholder":"\u8F93\u5165\u6D88\u606F...","chatInput.send":"\u53D1\u9001","chatInput.stop":"\u505C\u6B62\u6267\u884C","tools.thinking":"\u601D\u8003\u4E2D...","tools.read":"\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6","tools.write":"\u6B63\u5728\u5199\u5165\u6587\u4EF6","tools.edit":"\u6B63\u5728\u7F16\u8F91\u6587\u4EF6","tools.bash":"\u6B63\u5728\u6267\u884C\u547D\u4EE4","tools.glob":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6","tools.grep":"\u6B63\u5728\u641C\u7D22\u5185\u5BB9","tools.task":"\u6B63\u5728\u6267\u884C\u4EFB\u52A1","tools.webFetch":"\u6B63\u5728\u83B7\u53D6\u7F51\u9875","tools.webSearch":"\u6B63\u5728\u641C\u7D22\u7F51\u7EDC","tools.todoWrite":"\u6B63\u5728\u66F4\u65B0\u4EFB\u52A1","tools.executing":"\u6B63\u5728\u6267\u884C {name}","status.thinking":"\u601D\u8003\u4E2D...","status.reading":"\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6","status.writing":"\u6B63\u5728\u5199\u5165\u6587\u4EF6","status.editing":"\u6B63\u5728\u7F16\u8F91\u6587\u4EF6","status.executing":"\u6B63\u5728\u6267\u884C\u547D\u4EE4","status.searchingFiles":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6","status.searchingContent":"\u6B63\u5728\u641C\u7D22\u5185\u5BB9","status.executingTask":"\u6B63\u5728\u6267\u884C\u4EFB\u52A1","status.fetching":"\u6B63\u5728\u83B7\u53D6\u7F51\u9875","status.searching":"\u6B63\u5728\u641C\u7D22\u7F51\u7EDC","status.updatingTasks":"\u6B63\u5728\u66F4\u65B0\u4EFB\u52A1","status.executingTool":"\u6B63\u5728\u6267\u884C {name}","header.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","header.compacted":"\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210","chatHeader.newConv":"\u4F1A\u8BDD","chatHeader.compacting":"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587...","chatHeader.compactDone":"\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210","chatHeader.compact":"\u538B\u7F29\u4E0A\u4E0B\u6587","chatHeader.resume":"\u6062\u590D\u4F1A\u8BDD","chatHeader.refresh":"\u5237\u65B0\u6D88\u606F","chatHeader.reloadPage":"\u5237\u65B0\u9875\u9762","chatHeader.clear":"\u6E05\u7A7A\u6D88\u606F","chatHeader.clearing":"\u6B63\u5728\u6E05\u7A7A\u4E0A\u4E0B\u6587...","chatHeader.clearDone":"\u4E0A\u4E0B\u6587\u5DF2\u6E05\u7A7A","chatHeader.confirmClear":"\u786E\u5B9A\u8981\u6E05\u7A7A\u5F53\u524D\u4F1A\u8BDD\u7684\u6240\u6709\u6D88\u606F\u5417\uFF1F","chatHeader.mcpConfig":"MCP \u670D\u52A1\u5668\u914D\u7F6E","chatHeader.mcpNeedRestart":"\u66F4\u6539\u5C06\u5728\u91CD\u542F\u4F1A\u8BDD\u540E\u751F\u6548\u3002","chatHeader.expertPanel":"\u5E2E\u5E2E\u56E2","chatHeader.subAgentPanel":"\u5B50\u4EE3\u7406","settings.close":"\u5173\u95ED\u8BBE\u7F6E","settings.tabs.account":"\u8D26\u53F7","settings.tabs.security":"\u5B89\u5168","settings.tabs.general":"\u901A\u7528","settings.tabs.invitations":"\u9080\u8BF7","auth.sessionExpired":"\u767B\u5F55\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002","settings.account.username":"\u7528\u6237\u540D","settings.account.role":"\u89D2\u8272","settings.account.email":"\u90AE\u7BB1","settings.account.emailNotSet":"\u672A\u8BBE\u7F6E","settings.account.profileLoadFailed":"\u8D26\u53F7\u8D44\u6599\u52A0\u8F7D\u5931\u8D25","settings.account.logout":"\u9000\u51FA\u767B\u5F55","settings.account.roleAdmin":"\u7BA1\u7406\u5458","settings.account.rolePro":"Pro","settings.account.linkedAccounts":"\u5DF2\u5173\u8054\u8D26\u6237","settings.account.linkedDesc":"\u5173\u8054\u7B2C\u4E09\u65B9\u767B\u5F55\u540E\uFF0C\u4F7F\u7528\u4EFB\u610F\u4E00\u79CD\u65B9\u5F0F\u90FD\u80FD\u767B\u5F55\u6B64\u8D26\u53F7\u3002","settings.account.bind":"\u7ED1\u5B9A","settings.account.unbind":"\u89E3\u7ED1","settings.account.linked":"\u5DF2\u7ED1\u5B9A","settings.account.providerDisabled":"\u672A\u914D\u7F6E","settings.account.cantUnbindLast":"\u4E0D\u80FD\u89E3\u7ED1\u552F\u4E00\u7684\u767B\u5F55\u65B9\u5F0F","settings.account.unbindFailed":"\u89E3\u7ED1\u5931\u8D25\uFF1A{error}","settings.account.bindFailed":"\u7ED1\u5B9A\u5931\u8D25","settings.account.ssoBoundMsg":"\u5DF2\u6210\u529F\u7ED1\u5B9A {provider}\u3002","settings.account.ssoConflictMsg":"\u8BE5 {provider} \u8D26\u53F7\u5DF2\u88AB\u5176\u4ED6\u7528\u6237\u7ED1\u5B9A\u3002","settings.account.providerMicrosoft":"Microsoft","settings.account.providerGithub":"GitHub","settings.account.providerGoogle":"Google","settings.account.providerWechat":"\u5FAE\u4FE1","settings.account.providerAlipay":"\u652F\u4ED8\u5B9D","settings.security.agentKey":"Agent \u5BC6\u94A5","settings.security.agentKeyDesc":"\u7528\u4E8E Agent \u8FDE\u63A5\u8BA4\u8BC1\u7684\u5171\u4EAB\u5BC6\u94A5","settings.security.agentSetupCommands":"Agent \u63A5\u5165\u547D\u4EE4","settings.security.agentCmdInstall":"\u5B89\u88C5 Agent","settings.security.agentCmdService":"\u8FD0\u884C Agent server","settings.security.agentCmdNeedsSecret":"\u8BF7\u5148\u751F\u6210 Agent \u5BC6\u94A5\uFF0C\u4EE5\u521B\u5EFA\u5305\u542B server \u5730\u5740\u548C\u5BC6\u94A5\u7684\u547D\u4EE4\u3002","settings.security.agentCmdLlm":"Copilot \u624B\u52A8\u515C\u5E95","settings.security.agentCmdLlmDesc":"\u5148\u8FD0\u884C\u5B89\u88C5\u547D\u4EE4\uFF1B\u5982\u679C\u672C\u673A\u5DF2\u6709 GitHub Copilot token\uFF0CYeaft \u4F1A\u81EA\u52A8\u914D\u7F6E github-copilot/gpt-5.5\u3002Copilot \u547D\u4EE4\u53EA\u4F5C\u4E3A\u515C\u5E95\u4F7F\u7528\u3002","settings.security.none":"\u65E0","settings.security.show":"\u663E\u793A","settings.security.hide":"\u9690\u85CF","settings.security.generateKey":"\u751F\u6210\u5BC6\u94A5","settings.security.resetKey":"\u91CD\u7F6E\u5BC6\u94A5","settings.security.resetting":"\u91CD\u7F6E\u4E2D...","settings.security.resetWarning":"\u91CD\u7F6E\u540E\u6240\u6709 Agent \u9700\u91CD\u65B0\u914D\u7F6E","settings.security.changePassword":"\u4FEE\u6539\u5BC6\u7801","settings.security.currentPassword":"\u5F53\u524D\u5BC6\u7801","settings.security.newPassword":"\u65B0\u5BC6\u7801\uFF08\u81F3\u5C116\u4F4D\uFF09","settings.security.confirmPassword":"\u786E\u8BA4\u65B0\u5BC6\u7801","settings.security.changeBtn":"\u4FEE\u6539\u5BC6\u7801","settings.security.changing":"\u4FEE\u6539\u4E2D...","settings.security.enterCurrentPwd":"\u8BF7\u8F93\u5165\u5F53\u524D\u5BC6\u7801","settings.security.newPwdMin":"\u65B0\u5BC6\u7801\u81F3\u5C116\u4F4D","settings.security.pwdMismatch":"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4","settings.security.pwdChanged":"\u5BC6\u7801\u4FEE\u6539\u6210\u529F","settings.security.setPassword":"\u8BBE\u7F6E\u5BC6\u7801","settings.security.setPasswordDesc":"\u4F60\u76EE\u524D\u901A\u8FC7 SSO \u767B\u5F55\uFF0C\u5C1A\u672A\u8BBE\u7F6E\u5BC6\u7801\u3002\u8BBE\u7F6E\u540E\u5373\u53EF\u4F7F\u7528\u7528\u6237\u540D + \u5BC6\u7801\u767B\u5F55\u3002","settings.security.setBtn":"\u8BBE\u7F6E\u5BC6\u7801","settings.security.pwdSet":"\u5BC6\u7801\u8BBE\u7F6E\u6210\u529F","settings.security.deleteAccount":"\u6CE8\u9500\u8D26\u6237","settings.security.deleteAccountDesc":"\u6C38\u4E45\u5220\u9664\u4F60\u7684\u8D26\u6237\u548C\u6240\u6709\u76F8\u5173\u6570\u636E\u3002\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","settings.security.deleteBtn":"\u6CE8\u9500\u8D26\u6237","settings.security.deleteConfirmBtn":"\u786E\u8BA4\u5220\u9664","settings.security.deleteConfirmPlaceholder":"\u8F93\u5165 DELETE \u4EE5\u786E\u8BA4","settings.security.deleteConfirmRequired":"\u8BF7\u8F93\u5165 DELETE \u4EE5\u786E\u8BA4\u6CE8\u9500\u8D26\u6237","settings.security.deleteFailed":"\u6CE8\u9500\u8D26\u6237\u5931\u8D25","settings.security.deleting":"\u6CE8\u9500\u4E2D...","settings.general.theme":"\u4E3B\u9898","settings.general.lightTheme":"\u6D45\u8272","settings.general.darkTheme":"\u6DF1\u8272","settings.general.language":"\u8BED\u8A00","settings.invite.create":"\u521B\u5EFA\u9080\u8BF7\u7801","settings.invite.normalUser":"\u666E\u901A\u7528\u6237","settings.invite.proUser":"Pro \u7528\u6237","settings.invite.createBtn":"\u521B\u5EFA\u9080\u8BF7\u7801","settings.invite.creating":"\u521B\u5EFA\u4E2D...","settings.invite.list":"\u9080\u8BF7\u7801\u5217\u8868","settings.invite.used":"\u5DF2\u4F7F\u7528","settings.invite.expired":"\u5DF2\u8FC7\u671F","settings.invite.available":"\u53EF\u7528","settings.invite.usedBy":"\u4F7F\u7528\u8005: {user}","settings.invite.expiredAt":"\u8FC7\u671F\u4E8E: {time}","settings.invite.expiresAt":"\u6709\u6548\u81F3: {time}","settings.invite.noInvites":"\u6682\u65E0\u9080\u8BF7\u7801","settings.msg.copiedClipboard":"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F","settings.msg.copyFailed":"\u590D\u5236\u5931\u8D25","settings.msg.keyReset":"\u5BC6\u94A5\u5DF2\u91CD\u7F6E","settings.msg.resetFailed":"\u91CD\u7F6E\u5931\u8D25","settings.msg.changeFailed":"\u4FEE\u6539\u5931\u8D25","settings.msg.inviteCreated":"\u9080\u8BF7\u7801\u5DF2\u521B\u5EFA","settings.msg.createFailed":"\u521B\u5EFA\u5931\u8D25","settings.msg.inviteCopied":"\u9080\u8BF7\u7801\u5DF2\u590D\u5236","settings.msg.inviteDeleted":"\u9080\u8BF7\u7801\u5DF2\u5220\u9664","settings.msg.deleteFailed":"\u5220\u9664\u5931\u8D25","settings.tabs.llm":"LLM","settings.tabs.yeaft":"Yeaft","settings.yeaft.tabs.vp":"VP \u5E93","settings.yeaft.tabs.search":"\u641C\u7D22","settings.yeaft.tabs.mcp":"MCP","settings.mcp.title":"MCP \u670D\u52A1\u5668","settings.mcp.description":"\u901A\u8FC7 Model Context Protocol \u7ED9 Yeaft \u63A5\u5165\u66F4\u591A\u5DE5\u5177\u3002\u914D\u7F6E\u5199\u5165 agent \u4E0A\u7684 ~/.yeaft/config.json\uFF0C\u5DE5\u5177\u4F1A\u4EE5 mcp__<server>__<tool> \u7684\u5F62\u5F0F\u51FA\u73B0\u5728 LLM \u5DE5\u5177\u5217\u8868\u91CC\u3002","settings.mcp.reloadAll":"\u5168\u90E8\u91CD\u8FDE","settings.mcp.reloadOne":"\u91CD\u65B0\u8FDE\u63A5\u6B64\u670D\u52A1\u5668","settings.mcp.loading":"\u5904\u7406\u4E2D\u2026","settings.mcp.connected":"\u5DF2\u8FDE\u63A5","settings.mcp.disconnected":"\u672A\u8FDE\u63A5","settings.mcp.tools":"\u4E2A\u5DE5\u5177","settings.mcp.remove":"\u79FB\u9664","settings.mcp.empty":"\u8FD8\u6CA1\u6709\u914D\u7F6E MCP \u670D\u52A1\u5668\uFF0C\u53EF\u4EE5\u5728\u4E0B\u65B9\u6DFB\u52A0\u4E00\u4E2A\u3002","settings.mcp.addServer":"\u6DFB\u52A0\u670D\u52A1\u5668","settings.mcp.addServerDesc":"\u5927\u90E8\u5206 MCP \u670D\u52A1\u5668\u662F\u672C\u5730\u547D\u4EE4 \u2014 Yeaft \u4F1A\u901A\u8FC7 stdio \u542F\u52A8\u5B83\u5E76\u81EA\u52A8\u53D1\u73B0\u53EF\u7528\u5DE5\u5177\u3002","settings.mcp.serverName":"\u540D\u79F0","settings.mcp.command":"\u547D\u4EE4","settings.mcp.args":"\u53C2\u6570","settings.mcp.argsPlaceholder":"\u4F8B\u5982\uFF1A-y @modelcontextprotocol/server-filesystem /tmp","settings.mcp.env":"\u73AF\u5883\u53D8\u91CF","settings.mcp.envPlaceholder":"\u6BCF\u884C\u4E00\u4E2A KEY=value\uFF0C# \u5F00\u5934\u7684\u884C\u4F1A\u88AB\u5FFD\u7565\u3002","settings.mcp.saving":"\u4FDD\u5B58\u4E2D\u2026","settings.mcp.add":"\u6DFB\u52A0","settings.mcp.cancel":"\u6E05\u7A7A","settings.mcp.connectFailed":"\u5DF2\u4FDD\u5B58\u4F46\u8FDE\u63A5\u5931\u8D25","settings.mcp.addSuccess":"\u670D\u52A1\u5668\u5DF2\u6DFB\u52A0","settings.mcp.removeSuccess":"\u670D\u52A1\u5668\u5DF2\u79FB\u9664","settings.mcp.reloadSuccess":"\u5DF2\u8BF7\u6C42\u91CD\u8FDE","settings.mcp.confirmRemove":'\u79FB\u9664 MCP \u670D\u52A1\u5668 "{name}"\uFF1F\u4E0B\u4E00\u4E2A LLM turn \u8D77\u5B83\u7684\u5DE5\u5177\u5C06\u4E0D\u518D\u53EF\u89C1\u3002',"settings.mcp.errors.nameRequired":"\u8BF7\u586B\u5199\u540D\u79F0","settings.mcp.errors.nameFormat":"\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u77ED\u6A2A\u7EBF\u548C\u4E0B\u5212\u7EBF","settings.mcp.errors.commandRequired":"\u8BF7\u586B\u5199\u547D\u4EE4","settings.mcp.errors.argsParse":"\u53C2\u6570\u89E3\u6790\u5931\u8D25","settings.mcp.errors.envParse":"\u73AF\u5883\u53D8\u91CF\u89E3\u6790\u5931\u8D25","yeaft.session.title":"\u4F1A\u8BDD","yeaft.session.new":"+ \u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.create.title":"\u65B0\u5EFA\u4F1A\u8BDD","yeaft.session.create.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.vp.turnBlock.retryingRequest":"\u54CD\u5E94\u505C\u6EDE\uFF0C\u6B63\u5728\u53D1\u8D77\u5168\u65B0\u8BF7\u6C42\uFF08{attempt}/{max}\uFF09","yeaft.vp.turnBlock.retryingContinue":"\u54CD\u5E94\u505C\u6EDE\uFF0C\u6B63\u5728\u7528\u5168\u65B0\u8BF7\u6C42\u7EED\u5199\uFF08{attempt}/{max}\uFF09","yeaft.sessionStatus.aria":"Session \u72B6\u6001","yeaft.sessionStatus.title":"Session \u72B6\u6001","yeaft.sessionStatus.announcement":"\u516C\u544A","yeaft.sessionStatus.announcementEmpty":"\u6682\u65E0\u516C\u544A","yeaft.sessionStatus.announcementAdd":"\u6DFB\u52A0\u516C\u544A","yeaft.sessionStatus.announcementEdit":"\u7F16\u8F91\u516C\u544A","yeaft.sessionStatus.vps":"VP","yeaft.sessionStatus.backgroundTasks":"\u540E\u53F0\u4EFB\u52A1","yeaft.sessionStatus.noLogPreview":"\u6682\u65E0\u65E5\u5FD7\u8F93\u51FA\u3002","yeaft.sessionStatus.task.subAgentStarted":"{name} \u5DF2\u542F\u52A8","yeaft.sessionStatus.task.subAgentStartedWithMission":"{name} \u5DF2\u542F\u52A8\uFF1A{mission}","yeaft.sessionStatus.task.subAgentStatus":"{name} \u72B6\u6001\uFF1A{status}","yeaft.sessionStatus.task.subAgentStatusUpdated":"{name} \u72B6\u6001\u5DF2\u66F4\u65B0","yeaft.sessionStatus.task.subAgentResult":"{name} \u7ED3\u679C\uFF1A{text}","yeaft.sessionStatus.task.subAgentProducedResult":"{name} \u5DF2\u4EA7\u751F\u7ED3\u679C","yeaft.sessionStatus.task.subAgentUsedTool":"{name} \u8C03\u7528\u4E86 {tool}","yeaft.sessionStatus.task.subAgentFinishedTool":"{name} \u5B8C\u6210\u4E86 {tool}","yeaft.sessionStatus.task.subAgentUsage":"{name} \u4F7F\u7528\u4E86 {tokens} tokens","yeaft.sessionStatus.task.subAgentEvent":"{name}\uFF1A{text}","yeaft.sessionStatus.task.subAgentUserPrompt":"\u4F60\uFF1A{text}","yeaft.sessionStatus.task.subAgentToolSummary":"\u5DF2\u5B8C\u6210 {count} \u6B21\u5DE5\u5177\u8C03\u7528","yeaft.sessionStatus.task.subAgentError":"{name} \u9519\u8BEF\uFF1A{error}","yeaft.sessionStatus.task.subAgentHitError":"{name} \u9047\u5230\u9519\u8BEF","yeaft.sessionStatus.task.subAgentNoReadableEvents":"\u6682\u65E0\u53EF\u8BFB\u7684 sub-agent \u6D3B\u52A8\u3002","yeaft.sessionStatus.task.promptPlaceholder":"\u7ED9\u8FD9\u4E2A sub-agent \u8FFD\u52A0\u60F3\u6CD5\u2026","yeaft.sessionStatus.task.promptSend":"\u53D1\u9001","yeaft.sessionStatus.task.promptSending":"\u53D1\u9001\u4E2D\u2026","yeaft.sessionStatus.task.promptFailed":"\u53D1\u9001\u5931\u8D25\u3002","yeaft.sessionStatus.task.title":"\u4EFB\u52A1","yeaft.sessionStatus.task.command":"\u547D\u4EE4","yeaft.sessionStatus.task.stop":"\u505C\u6B62\u4EFB\u52A1","yeaft.sessionStatus.task.stopping":"\u505C\u6B62\u4E2D\u2026","yeaft.sessionStatus.task.kind.subAgent":"sub-agent","yeaft.sessionStatus.task.kind.shell":"shell","yeaft.sessionStatus.show":"\u663E\u793A Session \u72B6\u6001","yeaft.sessionStatus.hide":"\u9690\u85CF Session \u72B6\u6001","yeaft.sessionStatus.close":"\u5173\u95ED Session \u72B6\u6001","yeaft.vpTimeline.empty":"\u672C Session \u8FD8\u6CA1\u6709 VP\u3002","yeaft.vpTimeline.resizeTitle":"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6","yeaft.vpTimeline.status.idle":"\u7A7A\u95F2","yeaft.vpTimeline.status.typing":"\u8F93\u5165\u4E2D\u2026","yeaft.vpTimeline.status.thinking":"\u601D\u8003\u4E2D\u2026","yeaft.vpTimeline.status.retrying":"\u6B63\u5728\u91CD\u8BD5\u8BF7\u6C42\u2026","yeaft.vpTimeline.status.streaming":"\u751F\u6210\u4E2D","yeaft.vpTimeline.status.tool":"\u8C03\u7528\u5DE5\u5177\u4E2D\u2026","yeaft.vpTimeline.status.error":"\u51FA\u9519","yeaft.vpTimeline.status.offline":"\u79BB\u7EBF","yeaft.vpTimeline.abort":"\u4E2D\u6B62","yeaft.vpTimeline.edit":"\u7F16\u8F91 VP","yeaft.vpTimeline.mention":"\u70B9\u51FB @ \u8BE5 VP","yeaft.vpTimeline.expand":"\u5C55\u5F00\u4EFB\u52A1\u8BE6\u60C5","yeaft.toolStats.title":"\u5DE5\u5177\u4F7F\u7528\u7EDF\u8BA1","yeaft.toolStats.refresh":"\u5237\u65B0","yeaft.toolStats.close":"\u5173\u95ED","yeaft.toolStats.tabAll":"\u5168\u90E8\u5DE5\u5177","yeaft.toolStats.tabUnused":"\u672A\u4F7F\u7528","yeaft.toolStats.loading":"\u52A0\u8F7D\u4E2D\u2026","yeaft.toolStats.notLoaded":"\u6682\u65E0\u6570\u636E \u2014 \u70B9\u51FB\u5237\u65B0\u3002","yeaft.toolStats.empty":"\uFF08\u6682\u65E0\u5DE5\u5177\u8C03\u7528\u8BB0\u5F55\uFF09","yeaft.toolStats.noneUnused":"\uFF08\u6BCF\u4E2A\u5DF2\u6CE8\u518C\u5DE5\u5177\u90FD\u81F3\u5C11\u88AB\u8C03\u7528\u8FC7\u4E00\u6B21\uFF09","yeaft.toolStats.fetchedAt":"\u83B7\u53D6\u65F6\u95F4","yeaft.toolStats.col.name":"\u5DE5\u5177","yeaft.toolStats.col.calls":"\u8C03\u7528","yeaft.toolStats.col.errors":"\u9519\u8BEF","yeaft.toolStats.col.errRate":"\u9519\u8BEF\u7387","yeaft.toolStats.col.p50":"p50","yeaft.toolStats.col.p95":"p95","yeaft.toolStats.col.avg":"\u5E73\u5747","yeaft.toolStats.col.last":"\u6700\u8FD1","yeaft.toolStats.buttonLabel":"\u5DE5\u5177\u7EDF\u8BA1","workCenter.title":"\u5DE5\u4F5C\u4E2D\u5FC3","workCenter.subtitle":"\u7531\u5F53\u524D Agent \u6301\u7EED\u63A8\u8FDB\u7684\u6301\u4E45\u5DE5\u4F5C","workCenter.agent":"Agent","workCenter.noOnlineAgents":"\u6CA1\u6709\u5728\u7EBF Agent","workCenter.noAvailableAgents":"\u6CA1\u6709\u517C\u5BB9\u5DE5\u4F5C\u4E2D\u5FC3\u7684\u5728\u7EBF Agent","workCenter.new":"\u65B0\u5EFA","workCenter.newWorkItem":"\u65B0\u5EFA\u5DE5\u4F5C\u9879","workCenter.workItem":"\u5DE5\u4F5C\u9879","workCenter.createFirst":"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u5DE5\u4F5C\u9879","workCenter.backToChat":"\u8FD4\u56DE\u5BF9\u8BDD","workCenter.refresh":"\u5237\u65B0","workCenter.search":"\u641C\u7D22\u5DE5\u4F5C\u9879","workCenter.filter":"\u7B5B\u9009","workCenter.filterAttention":"\u9700\u8981\u5904\u7406","workCenter.filterActive":"\u6267\u884C\u4E2D","workCenter.filterAll":"\u5168\u90E8","workCenter.filterDone":"\u5DF2\u5B8C\u6210","workCenter.attentionItems":"\u9700\u8981\u5904\u7406","workCenter.board.active":"\u8FDB\u884C\u4E2D","workCenter.board.needsAttention":"\u9700\u8981\u5904\u7406","workCenter.board.closed":"\u5DF2\u5173\u95ED","workCenter.board.emptyLane":"\u6682\u65E0\u5DE5\u4F5C\u9879","workCenter.board.lanes":"\u5DE5\u4F5C\u9879\u5206\u680F","workCenter.filterVp":"\u6309 VP \u7B5B\u9009","workCenter.filterType":"\u6309\u7C7B\u578B\u7B5B\u9009","workCenter.filterUpdated":"\u6309\u66F4\u65B0\u65F6\u95F4\u7B5B\u9009","workCenter.allVps":"\u5168\u90E8 VP","workCenter.allTypes":"\u5168\u90E8\u7C7B\u578B","workCenter.anyTime":"\u4E0D\u9650\u65F6\u95F4","workCenter.lastDay":"\u6700\u8FD1 24 \u5C0F\u65F6","workCenter.lastWeek":"\u6700\u8FD1 7 \u5929","workCenter.deleteWorkItem":"\u5220\u9664 Work Item","workCenter.deleteConfirm":"\u6C38\u4E45\u5220\u9664\u8FD9\u4E2A Work Item\u3001\u6267\u884C\u5386\u53F2\u548C\u9644\u4EF6\uFF1F","workCenter.deleteRequiresStop":"\u8BF7\u5148\u505C\u6B62\u8FD9\u4E2A Work Item \u518D\u5220\u9664","workCenter.lastMonth":"\u6700\u8FD1 30 \u5929","workCenter.assignment.planned":"\u8BA1\u5212\u5206\u914D","workCenter.created":"\u521B\u5EFA\u4E8E","workCenter.files":"\u4E2A\u6587\u4EF6","workCenter.loadMore":"\u52A0\u8F7D\u66F4\u591A","workCenter.activeItems":"\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C","workCenter.allItems":"\u5168\u90E8\u5DE5\u4F5C\u9879","workCenter.completedItems":"\u5DF2\u5B8C\u6210","workCenter.watcherActive":"Watcher \u8FD0\u884C\u4E2D","workCenter.loading":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u4F5C\u9879\u2026","workCenter.noTimestamp":"\u65E0\u65F6\u95F4\u6233","workCenter.updated":"\u66F4\u65B0\u65F6\u95F4","workCenter.emptyTitle":"\u8FD8\u6CA1\u6709\u5DE5\u4F5C\u9879","workCenter.emptyBody":"\u5F53\u5DE5\u4F5C\u9700\u8981\u8DE8\u8D8A\u4E00\u6B21\u5BF9\u8BDD\u3001\u7B49\u5F85\u6216\u89D2\u8272\u63A5\u529B\u65F6\uFF0C\u628A\u5B83\u521B\u5EFA\u4E3A\u6301\u4E45\u5DE5\u4F5C\u9879\u3002","workCenter.noAttentionTitle":"\u5F53\u524D\u6CA1\u6709\u9700\u8981\u5904\u7406\u7684\u5DE5\u4F5C\u9879","workCenter.noAttentionBody":"\u7B49\u5F85\u4F60\u56DE\u7B54\u6216\u9700\u8981\u6062\u590D\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noActiveTitle":"\u5F53\u524D\u6CA1\u6709\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C\u9879","workCenter.noActiveBody":"\u8349\u7A3F\u3001\u5C31\u7EEA\u548C\u6267\u884C\u4E2D\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noCompletedTitle":"\u8FD8\u6CA1\u6709\u5DF2\u5B8C\u6210\u7684\u5DE5\u4F5C\u9879","workCenter.noCompletedBody":"\u5B8C\u6210\u540E\u7684\u5DE5\u4F5C\u9879\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002","workCenter.noMatchesTitle":"\u6CA1\u6709\u5339\u914D\u7684\u5DE5\u4F5C\u9879","workCenter.noMatchesBody":"\u5C1D\u8BD5\u8C03\u6574\u641C\u7D22\u5185\u5BB9\u6216\u7B5B\u9009\u6761\u4EF6\u3002","workCenter.selectTitle":"\u5DE5\u4F5C\u9879\u8BE6\u60C5","workCenter.detailLoading":"\u6B63\u5728\u52A0\u8F7D\u5B8C\u6574\u8BE6\u60C5\u2026","workCenter.detailLoadFailed":"\u65E0\u6CD5\u52A0\u8F7D\u5B8C\u6574\u8BE6\u60C5","workCenter.start":"\u5F00\u59CB","workCenter.retry":"\u91CD\u8BD5","workCenter.cancel":"\u53D6\u6D88","workCenter.closeWorkItem":"\u5173\u95ED\u8BE6\u60C5","workCenter.cancelWorkItem":"\u505C\u6B62\u5DE5\u4F5C\u9879","workCenter.cancelWorkItemHint":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u6240\u6709\u5C1A\u672A\u5B8C\u6210\u7684 Actions\u3002","workCenter.cancelConfirm":"\u505C\u6B62\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u53CA\u5176\u5C1A\u672A\u5B8C\u6210\u7684 Actions\uFF1F","workCenter.stopWorkItem":"\u505C\u6B62\u5DE5\u4F5C\u9879","workCenter.resumeWorkItem":"\u6062\u590D\u5DE5\u4F5C\u9879","workCenter.breadcrumbs":"Work Center \u5BFC\u822A","workCenter.actionNumber":"Action {number}","workCenter.actionBreadcrumb":"Action {number}\uFF1A{description}","workCenter.untitledAction":"\u672A\u547D\u540D Action","workCenter.workItems":"\u5DE5\u4F5C\u9879","workCenter.description":"\u9700\u6C42\u63CF\u8FF0","workCenter.goal":"\u76EE\u6807","workCenter.acceptanceCriteria":"\u9A8C\u6536\u6761\u4EF6","workCenter.noCriteria":"\u672A\u63D0\u4F9B\u9A8C\u6536\u6761\u4EF6","workCenter.failureReason":"\u5931\u8D25\u539F\u56E0","workCenter.workflow":"\u4EFB\u52A1\u6D41","workCenter.actionFlow":"Action \u6D41\u7A0B","workCenter.actionCount":"{count} \u4E2A Action","workCenter.noActionSummary":"\u6682\u65E0\u6458\u8981","workCenter.actionProgress":"{completed} / {total} \u4E2A Action","workCenter.currentAction":"\u5F53\u524D Action","workCenter.expandActions":"\u5C55\u5F00 Action","workCenter.collapseActions":"\u6536\u8D77","workCenter.actionObjective":"\u8FD9\u6B21\u8981\u505A\u4EC0\u4E48","workCenter.actionApproach":"\u51C6\u5907\u600E\u4E48\u505A","workCenter.actionExpectedOutcome":"\u671F\u5F85\u7684\u7ED3\u679C","workCenter.dependencies":"\u4F9D\u8D56\u9879","workCenter.actionResult":"\u6700\u65B0\u7ED3\u679C","workCenter.currentProgress":"\u5F53\u524D\u8FDB\u5EA6","workCenter.actionMessages":"\u6D88\u606F","workCenter.loops":"\u4E2A Loop","workCenter.tools":"\u6B21\u5DE5\u5177\u8C03\u7528","workCenter.noActionMessages":"\u8FD8\u6CA1\u6709\u6D88\u606F\u3002","workCenter.actionDetails":"Action \u8BE6\u60C5","workCenter.selectAction":"\u9009\u62E9\u4E00\u4E2A Action \u67E5\u770B\u5B9E\u9645\u6267\u884C","workCenter.backToWorkItems":"\u5DE5\u4F5C\u9879","workCenter.backToActions":"Actions","workCenter.you":"\u4F60","workCenter.noRequestDetails":"\u8FD9\u4E2A Action \u6682\u65F6\u6CA1\u6709\u53EF\u7528\u7684\u6267\u884C\u8BB0\u5F55\u3002","workCenter.loadingRequests":"\u6B63\u5728\u52A0\u8F7D\u6267\u884C\u8BB0\u5F55\u2026","workCenter.loadingRequestDetail":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u5177\u8BC1\u636E\u2026","workCenter.requestDetailUnavailable":"\u5DE5\u5177\u8BC1\u636E\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u8BD5\u3002","workCenter.noRequestLoops":"\u8FD9\u6B21\u6267\u884C\u6CA1\u6709\u4FDD\u7559\u4E0B\u53EF\u5C55\u793A\u7684 Loop\u3002","workCenter.requestDetailTruncated":"\u6267\u884C\u5185\u5BB9\u8F83\u5927\uFF1A{summarized} \u4E2A Loop \u663E\u793A\u6458\u8981\uFF0C\u53E6\u6709 {omitted} \u4E2A\u8F83\u65E9 Loop \u672A\u663E\u793A\u3002","workCenter.loopDetailTruncated":"\u8FD9\u4E2A Loop \u5185\u5BB9\u8F83\u5927\uFF0C\u5F53\u524D\u663E\u793A\u4FDD\u7559\u4E0B\u6765\u7684\u5DE5\u5177\u8BC1\u636E\u3002","workCenter.loadEarlierMessages":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","workCenter.loadingEarlierMessages":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","workCenter.unknownModel":"\u672A\u77E5\u6A21\u578B","workCenter.loop":"Loop","workCenter.actionBrief":"\u4EFB\u52A1\u8BF4\u660E","workCenter.executionSummary":"\u6267\u884C\u6458\u8981","workCenter.toolParameters":"\u8C03\u7528\u53C2\u6570","workCenter.toolResult":"\u6267\u884C\u7ED3\u679C","workCenter.noToolCalls":"\u8FD9\u4E2A Loop \u6CA1\u6709\u5DE5\u5177\u8C03\u7528\u3002","workCenter.actionInputPlaceholder":"\u8865\u5145\u4E0A\u4E0B\u6587\u3001\u56DE\u7B54\u95EE\u9898\u6216\u8C03\u6574\u8FD9\u4E2A Action","workCenter.actionInputResumeHint":"\u4F60\u7684\u8F93\u5165\u4F1A\u5E26\u7740\u65B0\u589E\u4E0A\u4E0B\u6587\u7EE7\u7EED\u8FD9\u4E2A Action\u3002","workCenter.actionInputCoordinatorHint":"\u4F60\u7684\u56DE\u7B54\u4F1A\u53D1\u9001\u7ED9 Work Item Coordinator\uFF0C\u7531\u5B83\u51B3\u5B9A\u91CD\u8BD5\u6216\u91CD\u65B0\u89C4\u5212\u5269\u4F59 Actions\u3002","workCenter.waitingQuestionTitle":"\u9700\u8981\u4F60\u7684\u56DE\u7B54","workCenter.actionInputRetryHint":"\u8865\u5145\u4FEE\u6B63\u8BF4\u660E\u6216\u6587\u4EF6\u540E\uFF0C\u4F7F\u7528\u65B0\u4E0A\u4E0B\u6587\u91CD\u65B0\u6267\u884C\u8FD9\u4E2A Action\u3002","workCenter.actionInputContinueHint":"\u8FD9\u91CC\u53EA\u76F4\u63A5\u5E72\u9884\u5F53\u524D Action\u3002","workCenter.actionFailedTitle":"\u8FD9\u4E2A Action \u4E3A\u4EC0\u4E48\u5931\u8D25","workCenter.failedAt":"\u5931\u8D25\u65F6\u95F4","workCenter.actionFailureRecovery":"\u5728\u4E0B\u65B9\u8865\u5145\u4FEE\u6B63\u8BF4\u660E\u6216\u6587\u4EF6\u5373\u53EF\u91CD\u65B0\u6267\u884C\uFF1B\u6267\u884C\u9875\u4F1A\u5C55\u793A\u4FDD\u7559\u4E0B\u6765\u7684\u5DE5\u5177\u8BC1\u636E\u3002","workCenter.sendInput":"\u53D1\u9001\u7ED9 Action","workCenter.sendingInput":"\u6B63\u5728\u53D1\u9001\u2026","workCenter.retryAction":"\u91CD\u8BD5 Action","workCenter.sendAndRetryAction":"\u53D1\u9001\u5E76\u91CD\u8BD5 Action","workCenter.coordinatorDecision.guide_actions":"\u5DF2\u66F4\u65B0 Action \u6307\u4EE4","workCenter.coordinatorDecision.replan":"\u5DF2\u66F4\u65B0\u76EE\u6807\u6216\u8BA1\u5212","workCenter.coordinatorDecision.request_human":"\u9700\u8981\u4EBA\u5DE5\u8865\u5145\u4FE1\u606F","workCenter.conversation":"\u5BF9\u8BDD","workCenter.conversationThinking":"\u5904\u7406\u4E2D\u2026","workCenter.conversationReadOnly":"\u8FD9\u4E2A\u5DE5\u4F5C\u9879\u5DF2\u5173\u95ED\uFF0C\u5BF9\u8BDD\u8BB0\u5F55\u4ECD\u53EF\u67E5\u770B\u3002","workCenter.conversationPlaceholder":"\u7EE7\u7EED\u8BA8\u8BBA\u8FD9\u4E2A\u5DE5\u4F5C\u9879","workCenter.sendMessage":"\u53D1\u9001\u6D88\u606F","workCenter.assistant":"Yeaft","workCenter.originalRequest":"\u539F\u59CB\u9700\u6C42","workCenter.actionMessageScopeTitle":"\u7ED9\u8FD9\u4E2A Action \u53D1\u6D88\u606F","workCenter.actionMessageScope":"\u6D88\u606F\u53EA\u53D1\u9001\u7ED9\u5F53\u524D Action\u3002","workCenter.actionConversation":"\u5BF9\u8BDD","workCenter.actionConversationWith":"Action \u6267\u884C\u8005","workCenter.actionViews":"Action \u89C6\u56FE","workCenter.actionExecutor":"\u6267\u884C\u8005","workCenter.actionExecutorPending":"\u7B49\u5F85\u5206\u914D\u6267\u884C\u8005","workCenter.actionInformation":"Action \u4FE1\u606F","workCenter.messageExecutor":"\u7ED9 {name} \u53D1\u6D88\u606F","workCenter.actionChatPlaceholder":"\u548C {name} \u8BA8\u8BBA\u8FD9\u4E2A Action","workCenter.statusLabel":"\u72B6\u6001","workCenter.llmRequestsLabel":"LLM \u8BF7\u6C42","workCenter.loopsLabel":"Loops","workCenter.toolsLabel":"\u5DE5\u5177","workCenter.tokensLabel":"Tokens","workCenter.workItemMessagePlaceholder":"\u8865\u5145\u6574\u4E2A Work Item \u7684\u65B9\u5411\u6216\u7EA6\u675F","workCenter.sendWorkItemMessage":"\u53D1\u9001\u7ED9 Work Item","workCenter.fromSession":"\u4ECE\u5F53\u524D Session \u521B\u5EFA\u5DE5\u4F5C\u9879","workCenter.llmRequestCount":"{count} \u6B21 LLM \u8BF7\u6C42","workCenter.loopCount":"{count} \u6B21 Loop","workCenter.toolCount":"{count} \u4E2A\u5DE5\u5177","workCenter.tokenCount":"{count} tokens","workCenter.tokenBreakdown":"\u8F93\u5165 {input} / \u8F93\u51FA {output} / \u7F13\u5B58 {cache}","workCenter.guidance":"\u7ED9\u5F53\u524D Action \u8865\u5145\u63D0\u793A","workCenter.guidanceHint":"\u8865\u5145\u7EA6\u675F\uFF0C\u6216\u8C03\u6574\u5F53\u524D Action \u7684\u6267\u884C\u65B9\u5411","workCenter.guidanceRestartHint":"\u53D1\u9001\u540E\u4F1A\u4F7F\u7528\u65B0\u63D0\u793A\u91CD\u542F\u5F53\u524D Action\u3002","workCenter.sendGuidance":"\u53D1\u9001\u63D0\u793A","workCenter.reuseMemory":"\u4F7F\u7528\u76F8\u5173 Agent memory \u548C\u6B64\u9879\u76EE\u7684\u5DF2\u5B8C\u6210\u5DE5\u4F5C","workCenter.reuseMemoryHelp":"\u5305\u62EC\u53D7 scope \u7EA6\u675F\u7684 Agent memory\uFF0C\u4EE5\u53CA canonical \u9879\u76EE\u76EE\u5F55\u76F8\u540C\u7684\u5DF2\u5B8C\u6210 Work Item \u7ED3\u6784\u5316\u6458\u8981\u548C\u8BC1\u636E\uFF1B\u4E0D\u4F1A\u590D\u7528\u539F\u59CB\u5DE5\u5177\u8F93\u51FA\u3002","workCenter.resumeAnswer":"\u56DE\u7B54\u7B49\u5F85\u4E2D\u7684\u95EE\u9898","workCenter.resumeAnswerHint":"\u63D0\u4F9B\u7EE7\u7EED\u6267\u884C\u6240\u9700\u7684\u4FE1\u606F","workCenter.answerInActionDetail":"\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 Coordinator\uFF0C\u4EE5\u53CA AI \u52A8\u6001\u89C4\u5212\u4F7F\u7528\u7684 Action \u63D0\u793A\u8BCD\u3001\u6A21\u578B\u548C effort\u3002","workCenter.settings.workflow":"\u4EFB\u52A1\u6D41","workCenter.settings.workflowHelp":"Triage \u4F1A\u9488\u5BF9\u4EFB\u52A1\u52A8\u6001\u9009\u62E9 Action \u548C\u6267\u884C\u8005\u3002","workCenter.settings.aiWorkflowHelp":"Triage \u4F1A\u4E3A\u6BCF\u4E2A Work Item \u5206\u7C7B\u5E76\u751F\u6210\u7ECF\u8FC7\u6821\u9A8C\u7684 1\u20138 \u4E2A\u4EFB\u52A1\u4E13\u5C5E Action\u3002\u5185\u7F6E Action \u7B56\u7565\u53EA\u662F\u53EF\u590D\u7528\u9ED8\u8BA4\u503C\uFF1B\u9700\u8981\u65F6 triage \u53EF\u4EE5\u521B\u5EFA\u7CBE\u786E\u7684\u9886\u57DF\u7C7B\u578B\u3002","workCenter.settings.globalInstructions":"Agent \u5168\u5C40\u6307\u4EE4","workCenter.settings.globalInstructionsHint":"\u4F8B\u5982\uFF1A\u9075\u5FAA\u4ED3\u5E93\u53D1\u5E03\u6D41\u7A0B\u3001\u5FC5\u987B\u72EC\u7ACB\u8BC4\u5BA1\uFF0C\u672A\u7ECF\u660E\u786E\u6279\u51C6\u4E0D\u5F97\u521B\u5EFA\u90E8\u7F72 tag\u3002","workCenter.settings.globalInstructionsHelp":"\u4FDD\u5B58\u5728 Agent \u7EA7\uFF0C\u5E76\u51BB\u7ED3\u8FDB\u6BCF\u4E2A\u65B0 Work Item\uFF1B\u5BF9 triage \u548C\u6240\u6709\u751F\u6210\u7684 Action \u751F\u6548\uFF0C\u4F18\u5148\u7EA7\u4F4E\u4E8E Work Item \u5951\u7EA6\u53CA\u7CFB\u7EDF/\u5DE5\u5177\u5B89\u5168\u89C4\u5219\u3002\u5DF2\u6709 Work Item \u4FDD\u7559\u539F\u5FEB\u7167\u3002","workCenter.settings.actionPolicies":"\u5185\u7F6E Action \u7B56\u7565","workCenter.settings.actionPoliciesHelp":"\u8FD9\u4E9B\u662F\u53EF\u590D\u7528\u7684\u6267\u884C\u57FA\u7EBF\uFF0C\u4E0D\u662F\u56FA\u5B9A\u5DE5\u4F5C\u6D41\u3002\u672A\u77E5\u7684\u9886\u57DF Action \u7C7B\u578B\u4F1A\u4F7F\u7528\u201C\u81EA\u5B9A\u4E49\u201D\u7B56\u7565\uFF0C\u5E76\u4FDD\u7559 triage \u751F\u6210\u7684\u7C7B\u578B\u548C\u4EFB\u52A1\u76EE\u6807\u3002","workCenter.settings.dynamicInstructionHelp":"AI \u4F1A\u52A0\u5165 Work Item \u5951\u7EA6\u3001\u5168\u5C40\u6307\u4EE4\u3001\u524D\u5E8F Action \u4E0A\u4E0B\u6587\u3001memory \u548C\u4EFB\u52A1\u4E13\u5C5E\u76EE\u6807\uFF1B\u8FD9\u91CC\u5B9A\u4E49\u8BE5 Action \u7C7B\u578B\u7684\u53EF\u590D\u7528\u884C\u4E3A\u3002","workCenter.settings.models":"\u6A21\u578B","workCenter.settings.modelsHelp":"Provider \u548C\u51ED\u8BC1\u4ECD\u7531 Agent LLM \u8BBE\u7F6E\u7BA1\u7406\uFF1B\u5DE5\u4F5C\u4E2D\u5FC3\u53EA\u9009\u62E9\u53EF\u7528\u6A21\u578B\u3002","workCenter.settings.dynamicModelsHelp":"Coordinator \u4E0E\u5B9E\u9645\u6267\u884C Action \u7684\u6A21\u578B\u53EF\u4EE5\u5206\u522B\u914D\u7F6E\u3002","workCenter.settings.coordinatorModel":"Coordinator","workCenter.settings.coordinatorModelHelp":"\u7528\u4E8E Work Item \u5BF9\u8BDD\u3001\u4FEE\u6539\u76EE\u6807\u548C\u91CD\u65B0\u89C4\u5212\uFF1B\u4E0D\u4F1A\u6267\u884C\u9879\u76EE\u5DE5\u5177\u3002","workCenter.settings.allActions":"\u6240\u6709 Action \u7684\u515C\u5E95\u7B56\u7565","workCenter.settings.maxConcurrentActions":"\u6700\u5927\u5E76\u53D1 Action \u6570","workCenter.settings.maxConcurrentActionsHelp":"\u9ED8\u8BA4 3\u3002\u975E Git\u3001\u810F\u5DE5\u4F5C\u533A\u3001\u5171\u4EAB\u526F\u4F5C\u7528\u548C\u96C6\u6210 Action \u4ECD\u4F1A\u4E32\u884C\u6267\u884C\u3002","workCenter.workItemType":"\u7C7B\u578B","workCenter.typeAuto":"Auto \u2014 \u7531 LLM \u63A8\u65AD","workCenter.typeHelp":"\u53EF\u9009\u62E9\u4EFB\u52A1\u7C7B\u522B\uFF0C\u4E5F\u53EF\u8BA9 AI \u81EA\u52A8\u63A8\u65AD\uFF1B\u5177\u4F53 Actions \u59CB\u7EC8\u7531 AI \u89C4\u5212\u3002","workCenter.planning":"\u89C4\u5212\u4E2D","workCenter.aiPlan":"AI \u52A8\u6001\u89C4\u5212\u6267\u884C","workCenter.aiPlanHelp":"Triage \u4F1A\u9009\u62E9\u4EFB\u52A1\u7C7B\u578B\u3001Action\u3001\u6267\u884C\u8005\u548C\u6700\u5C0F\u53EF\u9760\u6D41\u7A0B\uFF1B\u6A21\u578B\u4E0E effort \u7531 Work Center \u8BBE\u7F6E\u63A7\u5236\u3002","workCenter.settings.manageProviders":"\u7BA1\u7406 Agent \u6A21\u578B","workCenter.settings.assignment":"VP \u9009\u62E9","workCenter.settings.assignment.auto":"\u4ECE\u5168\u90E8 VP \u81EA\u52A8\u9009\u62E9","workCenter.settings.assignment.pool":"\u5019\u9009\u6C60","workCenter.settings.assignment.fixed":"\u56FA\u5B9A VP","workCenter.settings.capability":"\u6240\u9700\u80FD\u529B","workCenter.settings.vp":"Virtual Person","workCenter.settings.poolMembers":"\u5019\u9009 VP","workCenter.settings.modelPolicy":"\u6A21\u578B\u7B56\u7565","workCenter.settings.model.inherit":"\u7EE7\u627F VP \u504F\u597D","workCenter.settings.model.primary":"Agent \u4E3B\u6A21\u578B","workCenter.settings.model.fast":"Agent \u5FEB\u6A21\u578B","workCenter.settings.model.specific":"\u6307\u5B9A\u6A21\u578B","workCenter.settings.model":"\u6A21\u578B","workCenter.settings.effort":"\u63A8\u7406\u5F3A\u5EA6","workCenter.settings.effortDefault":"\u6A21\u578B\u9ED8\u8BA4\u503C","workCenter.settings.effortHelp":"\u8986\u76D6\u6240\u9009\u6A21\u578B\u7684\u9ED8\u8BA4\u63A8\u7406\u5F3A\u5EA6\uFF0C\u5E76\u7528\u4E8E\u6240\u6709 Work Center Action\u3002","workCenter.settings.effortChooseModelHelp":"\u9009\u62E9 Agent \u4E3B\u6A21\u578B\u3001\u5FEB\u6A21\u578B\u6216\u6307\u5B9A\u6A21\u578B\u540E\u53EF\u914D\u7F6E\u63A8\u7406\u5F3A\u5EA6\uFF1B\u7EE7\u627F VP \u504F\u597D\u65F6\u4F7F\u7528\u5404 VP \u6A21\u578B\u7684\u9ED8\u8BA4\u503C\u3002","workCenter.settings.effortUnsupportedHelp":"\u6240\u9009\u6A21\u578B\u4E0D\u63D0\u4F9B\u53EF\u914D\u7F6E\u7684\u63A8\u7406\u5F3A\u5EA6\uFF0C\u56E0\u6B64\u4F7F\u7528\u6A21\u578B\u9ED8\u8BA4\u503C\u3002","workCenter.settings.saving":"\u4FDD\u5B58\u4E2D\u2026","workCenter.settings.reload":"\u91CD\u65B0\u52A0\u8F7D\u8BBE\u7F6E","workCenter.settings.conflict":"\u8BBE\u7F6E\u5DF2\u5728\u5176\u4ED6\u4F4D\u7F6E\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u540E\u518D\u4FDD\u5B58\u3002","workCenter.settings.upgradeRequired":"\u5F53\u524D Agent \u7248\u672C\u65E0\u6CD5\u4FDD\u5B58\u5DE5\u4F5C\u4E2D\u5FC3\u8BBE\u7F6E\u3002\u8FD9\u91CC\u4EE5\u53EA\u8BFB\u65B9\u5F0F\u663E\u793A\u5F53\u524D\u503C\uFF1B\u5347\u7EA7 Agent \u540E\u5373\u53EF\u7F16\u8F91\u5E76\u4FDD\u5B58\u3002","workCenter.settings.saveNotConfirmed":"Agent \u672A\u786E\u8BA4\u672C\u6B21\u63D0\u4EA4\u7684\u63D0\u793A\u8BCD\u548C\u6A21\u578B\u7B56\u7565\u3002\u8BBE\u7F6E\u7A97\u53E3\u4E0D\u4F1A\u5173\u95ED\uFF1B\u8BF7\u91CD\u65B0\u52A0\u8F7D\u6216\u5347\u7EA7 Agent \u540E\u518D\u8BD5\u3002","workCenter.settings.addWorkflow":"\u590D\u5236\u4EFB\u52A1\u6D41","workCenter.settings.removeWorkflow":"\u5220\u9664","workCenter.settings.newWorkflow":"\u4EFB\u52A1\u6D41 {index}","workCenter.settings.workflowName":"\u4EFB\u52A1\u6D41\u540D\u79F0","workCenter.settings.newStage":"\u65B0\u9636\u6BB5","workCenter.settings.addStage":"\u6DFB\u52A0\u9636\u6BB5","workCenter.settings.removeStage":"\u5220\u9664\u9636\u6BB5","workCenter.settings.moveUp":"\u4E0A\u79FB\u9636\u6BB5","workCenter.settings.moveDown":"\u4E0B\u79FB\u9636\u6BB5","workCenter.settings.stageType":"\u9636\u6BB5\u7C7B\u578B","workCenter.settings.reviewReturnStage":"\u8981\u6C42\u4FEE\u6539\u65F6\u9000\u56DE\u9636\u6BB5","workCenter.settings.instruction":"\u9636\u6BB5 Prompt","workCenter.settings.instructionHint":"\u5B9A\u4E49\u8FD9\u4E2A\u9636\u6BB5\u5177\u4F53\u8981\u505A\u4EC0\u4E48\u3002","workCenter.settings.instructionHelp":"\u8FD0\u884C\u65F6\u4F1A\u81EA\u52A8\u52A0\u5165 Work Item \u7684\u76EE\u6807\u3001\u9A8C\u6536\u6807\u51C6\u548C\u53EF\u590D\u7528\u4E0A\u4E0B\u6587\u3002","workCenter.settings.instructionReset":"\u6062\u590D\u9ED8\u8BA4\u503C"}});var id,rd=H(()=>{id={"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","message.showProgress":"View process","message.hideProgress":"Hide process","login.subtitle":"Yeaft Web Code Agent","login.username":"Username","login.password":"Password","login.login":"Login","login.loggingIn":"Logging in...","login.enterUsername":"Please enter your username","login.enterPassword":"Please enter your password","login.noAccount":"Don't have an account?","login.registerWithCode":"Register","login.or":"or","login.usePassword":"Sign in with username & password","login.useSso":"Back to single sign-on","login.noProviders":"No third-party sign-in providers are enabled.","login.microsoft":"Sign in with Microsoft","login.github":"Sign in with GitHub","login.google":"Sign in with Google","login.wechat":"Sign in with WeChat","login.alipay":"Sign in with Alipay","login.wechat.mobileUnsupported":"Sign in with WeChat is only available on PC. Please scan the QR code from a desktop browser.","login.alipay.mobileWaiting":"Waiting for you to confirm in the Alipay app\u2026 Once you finish, return to this page and you will be signed in automatically.","login.alipay.relaunch":"Open Alipay again","login.qr.title":"Scan to sign in","login.qr.titleAlipay":"Sign in with Alipay","login.qr.titleWechat":"Sign in with WeChat","login.qr.hint":"Scan the QR code with your phone to authorize.","login.error.enterUsername":"Please enter your username","login.error.enterPassword":"Please enter your password","login.error.enter6Digit":"Please enter a 6-digit code","login.error.enterInviteCode":"Please enter the invite code","login.error.usernameMinLen":"Username must be at least 2 characters","login.error.passwordMinLen":"Password must be at least 6 characters","login.error.passwordMismatch":"Passwords do not match","login.error.enterVerifyCode":"Please enter the verification code","login.error.loginFailed":"Login failed","login.forgot.link":"Forgot password?","login.forgot.title":"Reset your password","login.forgot.emailHint":"Enter the email address on your account. We will send a 6-digit reset code.","login.forgot.sendCode":"Send Reset Code","login.forgot.sending":"Sending...","login.forgot.codeSent":"If the email is on file, a 6-digit reset code has been sent. Enter it below along with your new password.","login.forgot.resetBtn":"Reset Password","login.forgot.resetting":"Resetting...","login.forgot.success":"Password reset. You can now sign in with your new password.","login.forgot.emailInvalid":"Please enter a valid email","login.register.title":"New User Registration","login.register.inviteCode":"Invite Code","login.register.username":"Username","login.register.password":"Password (min 6 characters)","login.register.confirmPassword":"Confirm Password","login.register.email":"Email (optional)","login.register.submit":"Register","login.register.submitting":"Registering...","login.register.back":"Back to Login","login.register.success":"Registration successful, please login","login.register.enterCode":"Please enter the invite code","login.register.usernameMin":"Username must be at least 2 characters","login.register.passwordMin":"Password must be at least 6 characters","login.register.passwordMismatch":"Passwords do not match","login.totp.setupTitle":"Set Up Two-Factor Authentication","login.totp.setupHint":"Scan the QR code below with Microsoft Authenticator or Google Authenticator","login.totp.manualKey":"Or enter the key manually:","login.totp.enterCode":"Enter 6-digit code","login.totp.complete":"Complete Setup","login.totp.verifying":"Verifying...","login.totp.verify":"Verify","login.totp.prompt":"Enter the code from your Authenticator app","login.totp.invalidCode":"Please enter a 6-digit code","login.email.codeSent":"Verification code sent to {email}","login.email.enterCode":"Enter verification code","login.email.verify":"Verify","login.email.verifying":"Verifying...","login.email.enterCodeError":"Please enter the verification code","chat.agent.select":"Select Agent","chat.agent.manage":"Manage Agents","chat.agent.none":"No Agents","chat.agent.restarting":"Restarting","chat.agent.restart":"Restart","chat.agent.restartConfirm":`Are you sure you want to restart Agent "{name}"?
13
13
  All active conversations will be interrupted.`,"chat.agent.upgrade":"Upgrade","chat.agent.upgrading":"Upgrading","chat.agent.upgradeConfirm":`Upgrade Agent "{name}" to the latest version?
14
14
  The agent will restart after upgrading.`,"chat.agent.alreadyLatest":"Agent is already at the latest version (v{version}), no upgrade needed.","chat.agent.nodeIncompatible":"Agent upgrade aborted: target version v{version} requires Node {required}, but this machine is running Node {current}. Please upgrade Node.js first, then retry.","chat.agent.online":"{count} Agent(s) online","chat.agent.selectFirst":"Please select an Agent first","chat.agent.yeaft":"Yeaft Chat","sidebar.toggle.chat":"Switch to Chat","sidebar.toggle.yeaft":"Switch to Yeaft","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.sender":"Sender","yeaft.outline.allSenders":"All senders","yeaft.outline.title":"Message history","yeaft.outline.placeholder":"Search this conversation","yeaft.outline.searching":"Searching\u2026","yeaft.outline.loading":"Loading\u2026","yeaft.outline.older":"Load older messages","yeaft.outline.moreMatches":"Load more matches","yeaft.outline.minChars":"Type at least 2 characters","yeaft.outline.empty":"No messages yet","yeaft.outline.noMatches":"No matching messages","yeaft.outline.error":"Could not load the outline. Try again.","yeaft.outline.unsupported":"Upgrade this Agent to use the conversation outline.","yeaft.outline.you":"You","yeaft.outline.assistant":"Assistant","yeaft.outline.nonText":"Non-text response","yeaft.switchModel":"Switch model","yeaft.modelMenu.title":"Model and LLM settings","yeaft.modelMenu.label":"Model","yeaft.modelMenu.effort":"Effort","yeaft.modelMenu.effort.openaiReasoning":"Reasoning effort","yeaft.modelMenu.effort.anthropicBudget":"Thinking budget","yeaft.modelMenu.effort.anthropicAdaptive":"Adaptive thinking effort","yeaft.modelMenu.effort.minimal":"Minimal","yeaft.modelMenu.effort.low":"Low","yeaft.modelMenu.effort.medium":"Medium","yeaft.modelMenu.effort.high":"High","yeaft.modelMenu.effort.xhigh":"X-High","yeaft.modelMenu.effort.max":"Max","yeaft.modelMenu.noEffort":"This model does not expose a compatible effort control.","yeaft.modelMenu.configureHint":"Providers, keys, model list","yeaft.settings.title":"Settings","settings.yeaft.tabs.vp":"VP Library","settings.yeaft.tabs.search":"Search","settings.yeaft.tabs.mcp":"MCP","yeaft.settings.tabs.vp":"VP Library","yeaft.settings.tabs.search":"Search","yeaft.settings.tabs.mcp":"MCP","settings.mcp.title":"MCP servers","settings.mcp.description":"Connect Model Context Protocol servers to extend Yeaft with extra tools. Servers are stored in ~/.yeaft/config.json on the agent; tools appear in the LLM's catalogue as mcp__<server>__<tool>.","settings.mcp.reloadAll":"Reload all","settings.mcp.reloadOne":"Reconnect this server","settings.mcp.loading":"Working\u2026","settings.mcp.connected":"connected","settings.mcp.disconnected":"disconnected","settings.mcp.tools":"tools","settings.mcp.remove":"Remove","settings.mcp.empty":"No MCP servers configured yet. Add one below.","settings.mcp.addServer":"Add server","settings.mcp.addServerDesc":"Most MCP servers run as a local command \u2014 Yeaft launches it via stdio and discovers its tools.","settings.mcp.serverName":"Name","settings.mcp.command":"Command","settings.mcp.args":"Arguments","settings.mcp.argsPlaceholder":"e.g. -y @modelcontextprotocol/server-filesystem /tmp","settings.mcp.env":"Environment","settings.mcp.envPlaceholder":"KEY=value per line. Lines starting with # are ignored.","settings.mcp.saving":"Saving\u2026","settings.mcp.add":"Add","settings.mcp.cancel":"Clear","settings.mcp.connectFailed":"Saved but failed to connect","settings.mcp.addSuccess":"Server added","settings.mcp.removeSuccess":"Server removed","settings.mcp.reloadSuccess":"Reload requested","settings.mcp.confirmRemove":'Remove MCP server "{name}"? Its tools will disappear from the next LLM turn.',"settings.mcp.errors.nameRequired":"Name is required","settings.mcp.errors.nameFormat":"Name must be lowercase letters, digits, dashes or underscores only","settings.mcp.errors.commandRequired":"Command is required","settings.mcp.errors.argsParse":"Could not parse arguments","settings.mcp.errors.envParse":"Could not parse environment","search.settings.backendTitle":"Search backend","search.settings.backendDesc":"Choose the primary backend for the WebSearch tool. If the primary fails, the engine automatically falls back to HTML scraping.","search.settings.backend.tavily":"Tavily","search.settings.backend.tavilyHint":"Hosted search API. Free tier: 1000 queries/month. Recommended.","search.settings.backend.playwright":"Playwright service","search.settings.backend.playwrightHint":"Self-hosted browser-based search/fetch. Best for cloud IPs that get bot-blocked. Service not yet shipped.","search.settings.comingSoon":"Coming soon","search.settings.tavilyKeyTitle":"Tavily API key","search.settings.tavilyKeyDesc":"Stored on the agent in ~/.yeaft/config.json. Get a free key at","search.settings.tavilyKeyUnchanged":"(unchanged)","search.settings.clearKey":"Clear","search.settings.usageTitle":"Usage this month","search.settings.usageRefresh":"Refresh","search.settings.usageLoading":"Loading\u2026","search.settings.usagePlan":"Plan","search.settings.usageUsed":"Used","search.settings.usagePaygo":"Pay-as-you-go","search.settings.usageError":"Failed to load usage","search.settings.save":"Save","search.settings.saving":"Saving\u2026","search.settings.saveSuccess":"Saved","search.settings.cancel":"Reset","yeaft.settings.yeaftTitle":"Thread Concurrency & Archive","yeaft.settings.yeaftDesc":"Tune how many threads can run at once and when idle threads are auto-archived.","yeaft.settings.maxConcurrentLabel":"Max concurrent threads","yeaft.settings.maxConcurrentHint":"Maximum number of live threads at once (includes the always-on main thread). New threads beyond this cap are refused until an existing thread is archived or terminated. Range: 1-50.","yeaft.settings.archiveIdleDaysLabel":"Auto-archive idle threads after (days)","yeaft.settings.archiveIdleDaysHint":"Threads with no activity for this many days will be archived. Range: 1-3650.","yeaft.settings.yeaftSaveBtn":"Save","yeaft.settings.yeaftSaving":"Saving...","yeaft.settings.yeaftSaved":"Saved","yeaft.settings.yeaftLoading":"Loading...","yeaft.settings.yeaftLoadError":"Failed to load Yeaft settings","yeaft.settings.yeaftSaveError":"Failed to save Yeaft settings","yeaft.settings.rangeErrorConcurrent":"Must be between 1 and 50","yeaft.settings.rangeErrorArchive":"Must be between 1 and 3650","chat.session.creating":"Creating conversation...","chat.session.loadingHistory":"Loading conversation history...","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)","message.quote":"Quote","message.removeQuote":"Remove quote","message.replyingTo":"Replying to {author}","message.quotedFrom":"Quoted from {author}","message.editAsNew":"Edit","message.you":"You","input.upload":"Upload file","input.placeholder":"Type a message...","input.send":"Send","input.stopExecution":"Stop execution","chatInput.upload":"Upload file","chatInput.uploading":"Uploading...","chatInput.uploadFailed":"Upload failed","chatInput.retryUpload":"Retry","chatInput.removeAttachment":"Remove attachment","chatInput.placeholder":"Type a message...","chatInput.send":"Send","chatInput.stop":"Stop execution","tools.thinking":"Thinking...","tools.read":"Reading file","tools.write":"Writing file","tools.edit":"Editing file","tools.bash":"Running command","tools.glob":"Searching files","tools.grep":"Searching content","tools.task":"Running task","tools.webFetch":"Fetching web page","tools.webSearch":"Searching the web","tools.todoWrite":"Updating tasks","tools.executing":"Running {name}","status.thinking":"Thinking...","status.reading":"Reading file","status.writing":"Writing file","status.editing":"Editing file","status.executing":"Running command","status.searchingFiles":"Searching files","status.searchingContent":"Searching content","status.executingTask":"Running task","status.fetching":"Fetching web page","status.searching":"Searching the web","status.updatingTasks":"Updating tasks","status.executingTool":"Running {name}","header.compacting":"Compressing context...","header.compacted":"Context compression complete","chatHeader.newConv":"Conversation","chatHeader.compacting":"Compressing context...","chatHeader.compactDone":"Context compression complete","chatHeader.compact":"Compact context","chatHeader.resume":"Resume session","chatHeader.refresh":"Refresh messages","chatHeader.reloadPage":"Reload page","chatHeader.clear":"Clear messages","chatHeader.clearing":"Clearing context...","chatHeader.clearDone":"Context cleared","chatHeader.confirmClear":"Are you sure you want to clear all messages in this conversation?","chatHeader.mcpConfig":"MCP Servers","chatHeader.mcpNeedRestart":"Changes will take effect after restarting the session.","chatHeader.expertPanel":"Expert Panel","chatHeader.subAgentPanel":"Sub-Agents","settings.close":"Close settings","settings.tabs.account":"Account","settings.tabs.security":"Security","settings.tabs.general":"General","settings.tabs.invitations":"Invitations","auth.sessionExpired":"Session expired. Please log in again.","settings.account.username":"Username","settings.account.role":"Role","settings.account.email":"Email","settings.account.emailNotSet":"Not set","settings.account.profileLoadFailed":"Failed to load account profile","settings.account.logout":"Log Out","settings.account.roleAdmin":"Admin","settings.account.rolePro":"Pro","settings.account.linkedAccounts":"Linked Accounts","settings.account.linkedDesc":"Link external sign-in providers so you can log in with any of them.","settings.account.bind":"Link","settings.account.unbind":"Unlink","settings.account.linked":"Linked","settings.account.providerDisabled":"Not configured","settings.account.cantUnbindLast":"Cannot unlink the only login method","settings.account.unbindFailed":"Failed to unlink: {error}","settings.account.bindFailed":"Failed to link account","settings.account.ssoBoundMsg":"Successfully linked {provider}.","settings.account.ssoConflictMsg":"This {provider} account is already linked to another user.","settings.account.providerMicrosoft":"Microsoft","settings.account.providerGithub":"GitHub","settings.account.providerGoogle":"Google","settings.account.providerWechat":"WeChat","settings.account.providerAlipay":"Alipay","settings.security.agentKey":"Agent Secret","settings.security.agentKeyDesc":"Shared secret for Agent connection authentication","settings.security.agentSetupCommands":"Agent setup commands","settings.security.agentCmdInstall":"Install Agent","settings.security.agentCmdService":"Run Agent server","settings.security.agentCmdNeedsSecret":"Generate an Agent Secret first to create the server command.","settings.security.agentCmdLlm":"Manual Copilot fallback","settings.security.agentCmdLlmDesc":"Run the install command first. If an existing GitHub Copilot token is available, Yeaft configures github-copilot/gpt-5.5 automatically; use the Copilot command only as a fallback.","settings.security.none":"None","settings.security.show":"Show","settings.security.hide":"Hide","settings.security.generateKey":"Generate Secret","settings.security.resetKey":"Reset Secret","settings.security.resetting":"Resetting...","settings.security.resetWarning":"All Agents need to be reconfigured after reset","settings.security.changePassword":"Change Password","settings.security.currentPassword":"Current password","settings.security.newPassword":"New password (min 6 characters)","settings.security.confirmPassword":"Confirm new password","settings.security.changeBtn":"Change Password","settings.security.changing":"Changing...","settings.security.enterCurrentPwd":"Please enter your current password","settings.security.newPwdMin":"New password must be at least 6 characters","settings.security.pwdMismatch":"Passwords do not match","settings.security.pwdChanged":"Password changed successfully","settings.security.setPassword":"Set a Password","settings.security.setPasswordDesc":"You signed in via SSO and have no password yet. Set one so you can also log in with username + password.","settings.security.setBtn":"Set Password","settings.security.pwdSet":"Password set successfully","settings.security.deleteAccount":"Delete Account","settings.security.deleteAccountDesc":"Permanently delete your account and all associated data. This cannot be undone.","settings.security.deleteBtn":"Delete Account","settings.security.deleteConfirmBtn":"Confirm Delete","settings.security.deleteConfirmPlaceholder":"Type DELETE to confirm","settings.security.deleteConfirmRequired":"Type DELETE to confirm account removal","settings.security.deleteFailed":"Failed to delete account","settings.security.deleting":"Deleting...","settings.general.theme":"Theme","settings.general.lightTheme":"Light","settings.general.darkTheme":"Dark","settings.general.language":"Language","settings.invite.create":"Create Invite Code","settings.invite.normalUser":"Regular User","settings.invite.proUser":"Pro User","settings.invite.createBtn":"Create Invite","settings.invite.creating":"Creating...","settings.invite.list":"Invite Codes","settings.invite.used":"Used","settings.invite.expired":"Expired","settings.invite.available":"Available","settings.invite.usedBy":"Used by: {user}","settings.invite.expiredAt":"Expired at: {time}","settings.invite.expiresAt":"Expires at: {time}","settings.invite.noInvites":"No invite codes","settings.msg.copiedClipboard":"Copied to clipboard","settings.msg.copyFailed":"Copy failed","settings.msg.keyReset":"Secret has been reset","settings.msg.resetFailed":"Reset failed","settings.msg.changeFailed":"Change failed","settings.msg.inviteCreated":"Invite code created","settings.msg.createFailed":"Create failed","settings.msg.inviteCopied":"Invite code copied","settings.msg.inviteDeleted":"Invite code deleted","settings.msg.deleteFailed":"Delete failed","settings.tabs.llm":"LLM","settings.tabs.yeaft":"Yeaft","yeaft.session.title":"Sessions","yeaft.session.new":"+ New session","yeaft.session.create.title":"New session","yeaft.session.create.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.vp.turnBlock.retryingRequest":"Response stalled; retrying with a fresh request ({attempt}/{max})","yeaft.vp.turnBlock.retryingContinue":"Response stalled; continuing with a fresh request ({attempt}/{max})","yeaft.sessionStatus.aria":"Session status","yeaft.sessionStatus.title":"Session status","yeaft.sessionStatus.announcement":"Announcement","yeaft.sessionStatus.announcementEmpty":"No announcement","yeaft.sessionStatus.announcementAdd":"Add announcement","yeaft.sessionStatus.announcementEdit":"Edit announcement","yeaft.sessionStatus.vps":"VPs","yeaft.sessionStatus.backgroundTasks":"Background tasks","yeaft.sessionStatus.noLogPreview":"No log output yet.","yeaft.sessionStatus.task.subAgentStarted":"{name} started","yeaft.sessionStatus.task.subAgentStartedWithMission":"{name} started: {mission}","yeaft.sessionStatus.task.subAgentStatus":"{name} is {status}","yeaft.sessionStatus.task.subAgentStatusUpdated":"{name} status updated","yeaft.sessionStatus.task.subAgentResult":"{name} result: {text}","yeaft.sessionStatus.task.subAgentProducedResult":"{name} produced a result","yeaft.sessionStatus.task.subAgentUsedTool":"{name} used {tool}","yeaft.sessionStatus.task.subAgentFinishedTool":"{name} finished {tool}","yeaft.sessionStatus.task.subAgentUsage":"{name} used {tokens} tokens","yeaft.sessionStatus.task.subAgentEvent":"{name}: {text}","yeaft.sessionStatus.task.subAgentUserPrompt":"You: {text}","yeaft.sessionStatus.task.subAgentToolSummary":"{count} tool calls completed","yeaft.sessionStatus.task.subAgentError":"{name} error: {error}","yeaft.sessionStatus.task.subAgentHitError":"{name} hit an error","yeaft.sessionStatus.task.subAgentNoReadableEvents":"No readable sub-agent activity yet.","yeaft.sessionStatus.task.promptPlaceholder":"Add guidance for this sub-agent\u2026","yeaft.sessionStatus.task.promptSend":"Send","yeaft.sessionStatus.task.promptSending":"Sending\u2026","yeaft.sessionStatus.task.promptFailed":"Failed to send prompt.","yeaft.sessionStatus.task.title":"Task","yeaft.sessionStatus.task.command":"Command","yeaft.sessionStatus.task.stop":"Stop task","yeaft.sessionStatus.task.stopping":"Stopping\u2026","yeaft.sessionStatus.task.kind.subAgent":"sub-agent","yeaft.sessionStatus.task.kind.shell":"shell","yeaft.sessionStatus.show":"Show Session status","yeaft.sessionStatus.hide":"Hide Session status","yeaft.sessionStatus.close":"Close Session status","yeaft.vpTimeline.empty":"No VPs in this Session yet.","yeaft.vpTimeline.resizeTitle":"Drag to resize","yeaft.vpTimeline.status.idle":"idle","yeaft.vpTimeline.status.typing":"typing\u2026","yeaft.vpTimeline.status.thinking":"thinking\u2026","yeaft.vpTimeline.status.retrying":"retrying request\u2026","yeaft.vpTimeline.status.streaming":"streaming","yeaft.vpTimeline.status.tool":"using tool\u2026","yeaft.vpTimeline.status.error":"error","yeaft.vpTimeline.status.offline":"offline","yeaft.vpTimeline.abort":"Abort","yeaft.vpTimeline.edit":"Edit VP","yeaft.vpTimeline.mention":"Click to @-mention this VP","yeaft.vpTimeline.expand":"Toggle task details","yeaft.toolStats.title":"Tool Usage Stats","yeaft.toolStats.refresh":"Refresh","yeaft.toolStats.close":"Close","yeaft.toolStats.tabAll":"All tools","yeaft.toolStats.tabUnused":"Unused","yeaft.toolStats.loading":"Loading\u2026","yeaft.toolStats.notLoaded":"No data yet \u2014 click refresh.","yeaft.toolStats.empty":"(no tool calls recorded yet)","yeaft.toolStats.noneUnused":"(every registered tool has been called at least once)","yeaft.toolStats.fetchedAt":"Fetched at","yeaft.toolStats.col.name":"Tool","yeaft.toolStats.col.calls":"Calls","yeaft.toolStats.col.errors":"Errors","yeaft.toolStats.col.errRate":"Err%","yeaft.toolStats.col.p50":"p50","yeaft.toolStats.col.p95":"p95","yeaft.toolStats.col.avg":"Avg","yeaft.toolStats.col.last":"Last","yeaft.toolStats.buttonLabel":"Tool Stats","workCenter.title":"Work Center","workCenter.subtitle":"Persistent work owned by this Agent","workCenter.agent":"Agent","workCenter.noOnlineAgents":"No online agents","workCenter.noAvailableAgents":"No compatible online Agents","workCenter.new":"New","workCenter.newWorkItem":"New work item","workCenter.workItem":"Work item","workCenter.createFirst":"Create first work item","workCenter.backToChat":"Back to chat","workCenter.refresh":"Refresh","workCenter.search":"Search work items","workCenter.filter":"Filter","workCenter.filterAttention":"Needs attention","workCenter.filterActive":"Active","workCenter.filterAll":"All","workCenter.filterDone":"Done","workCenter.attentionItems":"Needs attention","workCenter.board.active":"Active","workCenter.board.needsAttention":"Needs attention","workCenter.board.closed":"Closed","workCenter.board.emptyLane":"No work items","workCenter.board.lanes":"Work item lanes","workCenter.filterVp":"Filter by VP","workCenter.filterType":"Filter by type","workCenter.filterUpdated":"Filter by update time","workCenter.allVps":"All VPs","workCenter.allTypes":"All types","workCenter.anyTime":"Any time","workCenter.lastDay":"Last 24 hours","workCenter.lastWeek":"Last 7 days","workCenter.deleteWorkItem":"Delete Work Item","workCenter.deleteConfirm":"Permanently delete this Work Item, its execution history, and attachments?","workCenter.deleteRequiresStop":"Stop this Work Item before deleting it","workCenter.lastMonth":"Last 30 days","workCenter.assignment.planned":"Planned assignment","workCenter.created":"Created","workCenter.files":"files","workCenter.loadMore":"Load more","workCenter.activeItems":"Active work","workCenter.allItems":"All work items","workCenter.completedItems":"Completed","workCenter.watcherActive":"Watcher active","workCenter.loading":"Loading work items\u2026","workCenter.noTimestamp":"No timestamp","workCenter.updated":"Updated","workCenter.emptyTitle":"No work items yet","workCenter.emptyBody":"Create a persistent task when work must continue beyond one conversation turn.","workCenter.noAttentionTitle":"Nothing needs attention","workCenter.noAttentionBody":"Work Items waiting for you or needing recovery will appear here.","workCenter.noActiveTitle":"No active work items","workCenter.noActiveBody":"Draft, ready, and running Work Items will appear here.","workCenter.noCompletedTitle":"No completed work items","workCenter.noCompletedBody":"Completed work items will appear here.","workCenter.noMatchesTitle":"No matching work items","workCenter.noMatchesBody":"Try a different search or filter.","workCenter.selectTitle":"Work item details","workCenter.detailLoading":"Loading full details\u2026","workCenter.detailLoadFailed":"Could not load full details","workCenter.start":"Start","workCenter.retry":"Retry","workCenter.cancel":"Cancel","workCenter.closeWorkItem":"Close details","workCenter.cancelWorkItem":"Stop work item","workCenter.cancelWorkItemHint":"Stop this Work Item and all unfinished Actions.","workCenter.cancelConfirm":"Stop this work item and its unfinished Actions?","workCenter.stopWorkItem":"Stop work item","workCenter.resumeWorkItem":"Resume work item","workCenter.breadcrumbs":"Work Center navigation","workCenter.actionNumber":"Action {number}","workCenter.actionBreadcrumb":"Action {number}: {description}","workCenter.untitledAction":"Untitled Action","workCenter.workItems":"Work items","workCenter.description":"Description","workCenter.goal":"Goal","workCenter.acceptanceCriteria":"Acceptance criteria","workCenter.noCriteria":"No criteria provided","workCenter.failureReason":"Failure reason","workCenter.workflow":"Workflow","workCenter.actionFlow":"Action flow","workCenter.actionCount":"{count} Actions","workCenter.noActionSummary":"No summary yet","workCenter.actionProgress":"{completed} / {total} Actions","workCenter.currentAction":"Current Action","workCenter.expandActions":"Show Actions","workCenter.collapseActions":"Collapse","workCenter.actionObjective":"What to do","workCenter.actionApproach":"How to do it","workCenter.actionExpectedOutcome":"Expected result","workCenter.dependencies":"Dependencies","workCenter.actionResult":"Latest result","workCenter.currentProgress":"Current progress","workCenter.actionMessages":"Messages","workCenter.loops":"loops","workCenter.tools":"tools","workCenter.noActionMessages":"No messages yet.","workCenter.actionDetails":"Action details","workCenter.selectAction":"Select an Action to inspect its execution","workCenter.backToWorkItems":"Work items","workCenter.backToActions":"Actions","workCenter.you":"You","workCenter.noRequestDetails":"No execution records are available for this Action yet.","workCenter.loadingRequests":"Loading execution records\u2026","workCenter.loadingRequestDetail":"Loading tool evidence\u2026","workCenter.requestDetailUnavailable":"Tool evidence is unavailable. Try again.","workCenter.noRequestLoops":"This execution has no retained Loop details.","workCenter.requestDetailTruncated":"Large execution: {summarized} Loops are summarized and {omitted} older Loops are omitted.","workCenter.loopDetailTruncated":"Large Loop: showing retained tool evidence.","workCenter.loadEarlierMessages":"Load earlier messages","workCenter.loadingEarlierMessages":"Loading earlier messages\u2026","workCenter.unknownModel":"Unknown model","workCenter.loop":"Loop","workCenter.actionBrief":"Task brief","workCenter.executionSummary":"Execution summary","workCenter.toolParameters":"Parameters","workCenter.toolResult":"Result","workCenter.noToolCalls":"No tool calls in this Loop.","workCenter.actionInputPlaceholder":"Add context, answer a question, or redirect this Action","workCenter.actionInputResumeHint":"Your input resumes this Action with the additional context.","workCenter.actionInputCoordinatorHint":"Your answer goes to the Work Item Coordinator, which may retry or replan the remaining Actions.","workCenter.waitingQuestionTitle":"Input required","workCenter.actionInputRetryHint":"Add instructions or files, then rerun this Action with the new context.","workCenter.actionInputContinueHint":"Direct intervention for this Action only.","workCenter.actionFailedTitle":"Why this Action failed","workCenter.failedAt":"Failed at","workCenter.actionFailureRecovery":"Add corrected instructions or files below to rerun this Action. The Execution view shows retained tool evidence.","workCenter.sendInput":"Send to Action","workCenter.sendingInput":"Sending\u2026","workCenter.retryAction":"Retry Action","workCenter.sendAndRetryAction":"Send and retry Action","workCenter.coordinatorDecision.guide_actions":"Action instructions updated","workCenter.coordinatorDecision.replan":"Goal or plan updated","workCenter.coordinatorDecision.request_human":"Human input requested","workCenter.conversation":"Conversation","workCenter.conversationThinking":"Working\u2026","workCenter.conversationReadOnly":"This work item is closed. The conversation remains available.","workCenter.conversationPlaceholder":"Message about this work item","workCenter.sendMessage":"Send message","workCenter.assistant":"Yeaft","workCenter.originalRequest":"Original request","workCenter.actionMessageScopeTitle":"Message this Action","workCenter.actionMessageScope":"Only this Action receives the message.","workCenter.actionConversation":"Conversation","workCenter.actionConversationWith":"Action executor","workCenter.actionViews":"Action views","workCenter.actionExecutor":"Executor","workCenter.actionExecutorPending":"Executor pending","workCenter.actionInformation":"Action information","workCenter.messageExecutor":"Message {name}","workCenter.actionChatPlaceholder":"Message {name} about this Action","workCenter.statusLabel":"Status","workCenter.llmRequestsLabel":"LLM requests","workCenter.loopsLabel":"Loops","workCenter.toolsLabel":"Tools","workCenter.tokensLabel":"Tokens","workCenter.workItemMessagePlaceholder":"Add direction for the whole Work Item","workCenter.sendWorkItemMessage":"Send to Work Item","workCenter.fromSession":"Create a work item from this Session","workCenter.llmRequestCount":"{count} LLM requests","workCenter.loopCount":"{count} loops","workCenter.toolCount":"{count} tools","workCenter.tokenCount":"{count} tokens","workCenter.tokenBreakdown":"{input} input / {output} output / {cache} cached","workCenter.guidance":"Add guidance to the current Action","workCenter.guidanceHint":"Clarify constraints or redirect the current Action","workCenter.guidanceRestartHint":"This restarts the current Action with the new guidance.","workCenter.sendGuidance":"Send guidance","workCenter.reuseMemory":"Use relevant Agent memory and completed work from this project","workCenter.reuseMemoryHelp":"Includes scope-bounded Agent memory plus structured summaries and evidence from completed WorkItems with the same canonical project directory. Raw tool output is not reused.","workCenter.resumeAnswer":"Answer the waiting question","workCenter.resumeAnswerHint":"Provide the information required to continue","workCenter.answerInActionDetail":"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 the Coordinator plus reusable Action prompts, models, and effort for AI-planned work.","workCenter.settings.workflow":"Workflow","workCenter.settings.workflowHelp":"Triage chooses the task-specific Actions and executors dynamically.","workCenter.settings.aiWorkflowHelp":"Triage classifies each WorkItem and creates a validated flow of 1\u20138 task-specific Actions. Built-in Action policies are reusable defaults; triage may create a precise domain type when needed.","workCenter.settings.globalInstructions":"Global Agent instructions","workCenter.settings.globalInstructionsHint":"Example: Follow the repository release policy, require independent review, and never create deployment tags without explicit approval.","workCenter.settings.globalInstructionsHelp":"Stored at Agent level and frozen into every new WorkItem. Applied to triage and every generated Action, below the WorkItem contract and system/tool safety rules. Existing WorkItems keep their original snapshot.","workCenter.settings.actionPolicies":"Built-in Action policies","workCenter.settings.actionPoliciesHelp":"These are reusable execution baselines, not a fixed workflow. Unknown domain-specific Action types use the Custom policy plus their triage-generated type and objective.","workCenter.settings.dynamicInstructionHelp":"The AI adds the WorkItem contract, global instructions, prior Action context, memory, and a task-specific objective. This prompt defines the reusable behavior for this Action type.","workCenter.settings.models":"Models","workCenter.settings.modelsHelp":"Providers and credentials stay in Agent LLM settings. Work Center only selects available models.","workCenter.settings.dynamicModelsHelp":"Choose the Coordinator model separately from the models that execute Actions.","workCenter.settings.coordinatorModel":"Coordinator","workCenter.settings.coordinatorModelHelp":"Used for Work Item conversation, goal changes, and replanning. It never executes repository tools.","workCenter.settings.allActions":"Fallback for all Actions","workCenter.settings.maxConcurrentActions":"Maximum concurrent Actions","workCenter.settings.maxConcurrentActionsHelp":"Defaults to 3. Non-Git, dirty, shared, and integration work remains serial.","workCenter.workItemType":"Type","workCenter.typeAuto":"Auto \u2014 let the LLM infer","workCenter.typeHelp":"Choose a task category, or use Auto for AI inference. AI still plans the concrete Actions.","workCenter.planning":"Planning","workCenter.aiPlan":"AI-planned execution","workCenter.aiPlanHelp":"Triage chooses the task type, Actions, executors, and the smallest reliable flow. Work Center settings control model and effort.","workCenter.settings.manageProviders":"Manage Agent models","workCenter.settings.assignment":"VP selection","workCenter.settings.assignment.auto":"Auto from all VPs","workCenter.settings.assignment.pool":"Candidate pool","workCenter.settings.assignment.fixed":"Fixed VP","workCenter.settings.capability":"Required capability","workCenter.settings.vp":"Virtual Person","workCenter.settings.poolMembers":"Candidate VPs","workCenter.settings.modelPolicy":"Model policy","workCenter.settings.model.inherit":"Inherit from VP","workCenter.settings.model.primary":"Agent primary model","workCenter.settings.model.fast":"Agent fast model","workCenter.settings.model.specific":"Specific model","workCenter.settings.model":"Model","workCenter.settings.effort":"Reasoning effort","workCenter.settings.effortDefault":"Model default","workCenter.settings.effortHelp":"Overrides the selected model\u2019s default reasoning effort for every Work Center Action.","workCenter.settings.effortChooseModelHelp":"Select the Agent primary model, fast model, or a specific model to configure effort. Inherit from VP uses each VP\u2019s model default.","workCenter.settings.effortUnsupportedHelp":"The selected model does not expose configurable effort, so its model default is used.","workCenter.settings.saving":"Saving\u2026","workCenter.settings.reload":"Reload settings","workCenter.settings.conflict":"Settings changed elsewhere. Reload before saving again.","workCenter.settings.upgradeRequired":"This Agent version cannot save Work Center settings. The current values are shown read-only; upgrade the Agent to edit and save them.","workCenter.settings.saveNotConfirmed":"The Agent did not confirm the submitted prompts and model policy. Settings were not closed; reload or upgrade the Agent before trying again.","workCenter.settings.addWorkflow":"Duplicate workflow","workCenter.settings.removeWorkflow":"Remove","workCenter.settings.newWorkflow":"Workflow {index}","workCenter.settings.workflowName":"Workflow name","workCenter.settings.newStage":"New stage","workCenter.settings.addStage":"Add stage","workCenter.settings.removeStage":"Remove stage","workCenter.settings.moveUp":"Move stage up","workCenter.settings.moveDown":"Move stage down","workCenter.settings.stageType":"Stage type","workCenter.settings.reviewReturnStage":"Return to stage when changes are requested","workCenter.settings.instruction":"Stage prompt","workCenter.settings.instructionHint":"Define what this stage must do.","workCenter.settings.instructionHelp":"The WorkItem goal, acceptance criteria, and reusable context are added automatically at run time.","workCenter.settings.instructionReset":"Restore default"}});function oo(){return typeof navigator>"u"||!navigator?"":navigator.userAgent||""}function As(){let e=oo();return/Android|iPhone|iPad|iPod|Windows Phone|IEMobile|BlackBerry|Opera Mini/i.test(e)}function ii(){return/MicroMessenger/i.test(oo())}function ri(){return/AlipayClient/i.test(oo())}var ao=H(()=>{});var od,ad=H(()=>{lt();bt();ao();od={name:"LoginPage",template:`
15
15
  <div class="login-page">
@@ -668,7 +668,7 @@ ${String(e||"").trim()}
668
668
  </button>
669
669
  </div>
670
670
  <pre><code${s}${o}>${n}</code></pre>
671
- </div>`})}function Vm(e){return e.replace(/<table>([\s\S]*?)<\/table>/g,t=>`<div class="table-scroll-wrapper">${t}</div>`)}function Fm(){if(typeof mermaid>"u")return!1;let e=document.documentElement.getAttribute("data-theme")==="dark"?"dark":"default";if(Cd===e)return!0;try{return mermaid.initialize({startOnLoad:!1,theme:e,securityLevel:"strict"}),Cd=e,!0}catch{return!1}}async function je(e){if(!e||!Fm())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=Mm(s)||s.textContent||"";if(r.trim()){n.dataset.mermaidRendered="true";try{let o=`mermaid-${Date.now()}-${Am++}`,{svg:a}=await mermaid.render(o,r),l=document.createElement("div");l.className="mermaid-rendered",l.innerHTML=a,l.dataset.mermaidSource=r,l.appendChild(Rm(l,r)),(i||n).replaceWith(l)}catch{n.dataset.mermaidRendered="false",s.dataset.mermaidError="true"}}}}function Om(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 Hm(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 mi(e){if(!e||typeof e!="string"||(e=Hm(e),!e))return"";let t=an.get(e);if(t!==void 0)return t;Lm();let s;if(typeof marked<"u")try{s=Vm($m(marked.parse(e)))}catch{}if(s||(s=Om(e)),an.size>=Nm){let n=an.keys().next().value;an.delete(n)}return an.set(e,s),s}var Sd,Cd,Am,an,Nm,ln=H(()=>{bt();Sd=!1,Cd=null,Am=0;an=new Map,Nm=2e3});var Ms,hi=H(()=>{wo();vd();ko();on();yo();kd();ln();di();Xt();Ms={name:"AssistantTurn",components:{ToolLine:fi,AskCard:hd,VpSpeakerHeader:gi},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:""},sessionActions:{type:Boolean,default:!1},quoteAuthor:{type:String,default:""}},emits:["update-actions-expanded","update-tool-expanded","toggle-response-collapse","quote"],template:`
671
+ </div>`})}function Vm(e){return e.replace(/<table>([\s\S]*?)<\/table>/g,t=>`<div class="table-scroll-wrapper">${t}</div>`)}function Fm(){if(typeof mermaid>"u")return!1;let e=document.documentElement.getAttribute("data-theme")==="dark"?"dark":"default";if(Cd===e)return!0;try{return mermaid.initialize({startOnLoad:!1,theme:e,securityLevel:"strict"}),Cd=e,!0}catch{return!1}}async function je(e){if(!e||!Fm())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=Mm(s)||s.textContent||"";if(r.trim()){n.dataset.mermaidRendered="true";try{let o=`mermaid-${Date.now()}-${Am++}`,{svg:a}=await mermaid.render(o,r),l=document.createElement("div");l.className="mermaid-rendered",l.innerHTML=a,l.dataset.mermaidSource=r,l.appendChild(Rm(l,r)),(i||n).replaceWith(l)}catch{n.dataset.mermaidRendered="false",s.dataset.mermaidError="true"}}}}function Om(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 Hm(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 mi(e){if(!e||typeof e!="string"||(e=Hm(e),!e))return"";let t=an.get(e);if(t!==void 0)return t;Lm();let s;if(typeof marked<"u")try{s=Vm($m(marked.parse(e)))}catch{}if(s||(s=Om(e)),an.size>=Nm){let n=an.keys().next().value;an.delete(n)}return an.set(e,s),s}var Sd,Cd,Am,an,Nm,ln=H(()=>{bt();Sd=!1,Cd=null,Am=0;an=new Map,Nm=2e3});var Bm,Ms,hi=H(()=>{wo();vd();ko();on();yo();kd();ln();di();Xt();Bm=0,Ms={name:"AssistantTurn",components:{ToolLine:fi,AskCard:hd,VpSpeakerHeader:gi},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:""},sessionActions:{type:Boolean,default:!1},quoteAuthor:{type:String,default:""}},emits:["update-actions-expanded","update-tool-expanded","toggle-response-collapse","quote"],template:`
672
672
  <div class="assistant-turn" ref="turnRef" :class="{ streaming: turn.isStreaming, 'has-vp-speaker': !!turn.speakerVpId }">
673
673
  <!-- 0. task-334-ui-b: VP speaker header \u2014 only when a speakerVpId is
674
674
  bound AND the upstream consecutive-collapse decided this turn
@@ -698,25 +698,16 @@ ${String(e||"").trim()}
698
698
  </svg>
699
699
  </button>
700
700
  </div>
701
- <details
701
+ <div
702
702
  v-if="progressSegments.length > 0"
703
- ref="progressGroupRef"
704
703
  class="turn-progress-group"
705
- :open="progressExpanded"
706
- @toggle="onProgressToggle"
704
+ :class="{ 'is-expanded': progressExpanded }"
707
705
  >
708
- <summary
709
- class="turn-progress-toggle"
710
- :title="progressToggleLabel"
711
- :aria-label="progressToggleLabel"
712
- :aria-expanded="String(progressExpanded)"
706
+ <div
707
+ :id="progressPanelId"
708
+ class="turn-progress-list"
709
+ :hidden="!progressExpanded"
713
710
  >
714
- <svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true">
715
- <path v-if="progressExpanded" fill="currentColor" d="M7 14l5-5 5 5z"/>
716
- <path v-else fill="currentColor" d="M7 10l5 5 5-5z"/>
717
- </svg>
718
- </summary>
719
- <div class="turn-progress-list">
720
711
  <div
721
712
  v-for="segment in progressSegments"
722
713
  :key="segment.key"
@@ -726,7 +717,16 @@ ${String(e||"").trim()}
726
717
  <span v-if="segment.isStreaming" class="cursor-blink"></span>
727
718
  </div>
728
719
  </div>
729
- </details>
720
+ <button
721
+ type="button"
722
+ class="turn-progress-toggle"
723
+ :title="progressToggleLabel"
724
+ :aria-label="progressToggleLabel"
725
+ :aria-expanded="String(progressExpanded)"
726
+ :aria-controls="progressPanelId"
727
+ @click="toggleProgress"
728
+ >{{ progressToggleLabel }}</button>
729
+ </div>
730
730
  <div
731
731
  v-for="segment in resultSegments"
732
732
  :key="segment.key"
@@ -874,7 +874,7 @@ ${String(e||"").trim()}
874
874
  <!-- H2.f.6: Fork-from-here button removed (single-conversation model). -->
875
875
  </div>
876
876
  </div>
877
- `,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=x=>{r.value=!!x,t("update-actions-expanded",!!x)},l=Vue.ref(!1),c=Vue.ref(null),d=Vue.ref(null),u=Vue.ref(e.turn?.isActive===!0||e.turn?.isStreaming===!0),f=Vue.reactive(new Set),p=Vue.inject("t"),g=(x,T)=>{s.answerUserQuestion(x,T,e.conversationId||void 0)},b=Vue.computed(()=>(Array.isArray(e.turn?.toolMsgs)?e.turn.toolMsgs:[]).filter(T=>T?.toolName==="RouteForward").map((T,q)=>({...vo(T.toolInput||{}),key:T.toolId||`${T.startTime||0}:${q}`}))),h=Vue.computed(()=>(Array.isArray(e.turn?.toolMsgs)?e.turn.toolMsgs:[]).filter(T=>T?.toolName!=="RouteForward")),A=Vue.computed(()=>h.value.length>0||Number(e.turn.toolSummaryCount||0)>0),w=Vue.computed(()=>{let x=h.value;return x[x.length-1]}),S=Vue.computed(()=>h.value.slice(0,-1)),v=Vue.computed(()=>Math.max(0,h.value.length-1)),m=Vue.computed(()=>{let x=Number(e.turn.toolSummaryCount||0);return x?typeof p=="function"?p("chat.toolActionsOmitted",{count:x}):`${x} older tool actions omitted`:""}),y=Vue.computed(()=>{let x=e.turn?.todoMsg?.toolInput?.todos;return Array.isArray(x)?x.map(T=>wd(e.turn,T)):[]}),E=()=>{a(!o.value)},$=(x,T,q)=>{let Z=e.toolStatePrefix||e.turn.id||e.turn.turnId||"assistant-turn",ae=x?.toolName||"tool",W=x?.startTime||T;return`${Z}:tool:${q}:${T}:${ae}:${W}`},U=(x,T,q)=>{let Z=$(x,T,q);return e.toolExpandStates&&Object.prototype.hasOwnProperty.call(e.toolExpandStates,Z)?!!e.toolExpandStates[Z]:null},V=(x,T,q,Z)=>{t("update-tool-expanded",{key:$(x,T,q),value:!!Z})};typeof marked<"u"&&marked.setOptions({highlight:function(x,T){if(typeof hljs<"u"&&T&&hljs.getLanguage(T))try{return hljs.highlight(x,{language:T}).value}catch{}return x},breaks:!0,gfm:!0});let _=x=>{let T=x;if(typeof T!="string"&&(Array.isArray(T)?T=T.map(q=>typeof q=="string"?q:q&&q.type==="text"&&q.text||"").join(""):T=String(T)),T=Ct(T),!T)return"";try{if(typeof marked<"u"){let q=marked.parse(T);return te(z(q))}}catch{}return me(T)},P=Vue.computed(()=>Array.isArray(e.turn?.textSegments)&&e.turn.textSegments.length>0?e.turn.textSegments:e.turn?.textContent?[{key:"legacy-result",content:e.turn.textContent,kind:"result",isStreaming:e.turn.isStreaming===!0}]:[]),I=Vue.computed(()=>P.value.filter(x=>x.kind!=="result")),D=Vue.computed(()=>P.value.filter(x=>x.kind==="result")),B=Vue.computed(()=>u.value?p("message.hideProgress"):p("message.showProgress")),O=x=>{u.value=x?.currentTarget?.open===!0};Vue.watch(()=>e.turn?.isActive===!0||e.turn?.isStreaming===!0,x=>{u.value=x,d.value&&(d.value.open=x)});let z=x=>x.replace(/<pre><code([^>]*)>([\s\S]*?)<\/code><\/pre>/g,(T,q,Z)=>{let ae=q.match(/class="language-(\w+)"/);return`<div class="code-block-wrapper">
877
+ `,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=x=>{r.value=!!x,t("update-actions-expanded",!!x)},l=Vue.ref(!1),c=Vue.ref(null),d=`turn-progress-panel-${++Bm}`,u=Vue.ref(e.turn?.isActive===!0||e.turn?.isStreaming===!0),f=Vue.reactive(new Set),p=Vue.inject("t"),g=(x,T)=>{s.answerUserQuestion(x,T,e.conversationId||void 0)},b=Vue.computed(()=>(Array.isArray(e.turn?.toolMsgs)?e.turn.toolMsgs:[]).filter(T=>T?.toolName==="RouteForward").map((T,q)=>({...vo(T.toolInput||{}),key:T.toolId||`${T.startTime||0}:${q}`}))),h=Vue.computed(()=>(Array.isArray(e.turn?.toolMsgs)?e.turn.toolMsgs:[]).filter(T=>T?.toolName!=="RouteForward")),A=Vue.computed(()=>h.value.length>0||Number(e.turn.toolSummaryCount||0)>0),w=Vue.computed(()=>{let x=h.value;return x[x.length-1]}),S=Vue.computed(()=>h.value.slice(0,-1)),v=Vue.computed(()=>Math.max(0,h.value.length-1)),m=Vue.computed(()=>{let x=Number(e.turn.toolSummaryCount||0);return x?typeof p=="function"?p("chat.toolActionsOmitted",{count:x}):`${x} older tool actions omitted`:""}),y=Vue.computed(()=>{let x=e.turn?.todoMsg?.toolInput?.todos;return Array.isArray(x)?x.map(T=>wd(e.turn,T)):[]}),E=()=>{a(!o.value)},$=(x,T,q)=>{let Z=e.toolStatePrefix||e.turn.id||e.turn.turnId||"assistant-turn",ae=x?.toolName||"tool",W=x?.startTime||T;return`${Z}:tool:${q}:${T}:${ae}:${W}`},U=(x,T,q)=>{let Z=$(x,T,q);return e.toolExpandStates&&Object.prototype.hasOwnProperty.call(e.toolExpandStates,Z)?!!e.toolExpandStates[Z]:null},V=(x,T,q,Z)=>{t("update-tool-expanded",{key:$(x,T,q),value:!!Z})};typeof marked<"u"&&marked.setOptions({highlight:function(x,T){if(typeof hljs<"u"&&T&&hljs.getLanguage(T))try{return hljs.highlight(x,{language:T}).value}catch{}return x},breaks:!0,gfm:!0});let _=x=>{let T=x;if(typeof T!="string"&&(Array.isArray(T)?T=T.map(q=>typeof q=="string"?q:q&&q.type==="text"&&q.text||"").join(""):T=String(T)),T=Ct(T),!T)return"";try{if(typeof marked<"u"){let q=marked.parse(T);return te(z(q))}}catch{}return me(T)},P=Vue.computed(()=>Array.isArray(e.turn?.textSegments)&&e.turn.textSegments.length>0?e.turn.textSegments:e.turn?.textContent?[{key:"legacy-result",content:e.turn.textContent,kind:"result",isStreaming:e.turn.isStreaming===!0}]:[]),I=Vue.computed(()=>P.value.filter(x=>x.kind!=="result")),D=Vue.computed(()=>P.value.filter(x=>x.kind==="result")),B=Vue.computed(()=>u.value?p("message.hideProgress"):p("message.showProgress")),O=()=>{u.value=!u.value};Vue.watch(()=>e.turn?.isActive===!0||e.turn?.isStreaming===!0,x=>{u.value=x});let z=x=>x.replace(/<pre><code([^>]*)>([\s\S]*?)<\/code><\/pre>/g,(T,q,Z)=>{let ae=q.match(/class="language-(\w+)"/);return`<div class="code-block-wrapper">
878
878
  <div class="code-block-header">
879
879
  <span class="code-lang">${ae?ae[1]:""}</span>
880
880
  <button class="code-copy-btn" onclick="window.copyCodeBlock(this)" title="Copy">
@@ -884,7 +884,7 @@ ${String(e||"").trim()}
884
884
  </button>
885
885
  </div>
886
886
  <pre><code${q}>${Z}</code></pre>
887
- </div>`}),te=x=>x.replace(/<table>([\s\S]*?)<\/table>/g,T=>`<div class="table-scroll-wrapper">${T}</div>`),me=x=>{if(!x)return"";typeof x!="string"&&(x=String(x));let T=q=>{let Z=document.createElement("div");return Z.textContent=q,Z.innerHTML};return x.replace(/```(\w*)\n([\s\S]*?)```/g,(q,Z,ae)=>`<div class="code-block-wrapper"><pre><code class="language-${Z}">${T(ae.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>")},pe=async()=>{try{await navigator.clipboard.writeText(e.turn.textContent||""),n.value=!0,setTimeout(()=>{n.value=!1},2e3)}catch{}},ve=async()=>{try{await navigator.clipboard.writeText(e.turn.textContent||""),i.value=!0,setTimeout(()=>{i.value=!1},2e3)}catch{}},ie=()=>{let x=e.turn.textContent||"";if(!x)return;let T=new Blob([x],{type:"text/markdown;charset=utf-8"}),q=URL.createObjectURL(T),Z=document.createElement("a");Z.download=`response-${Date.now()}.md`,Z.href=q,Z.click(),URL.revokeObjectURL(q)},ke=async()=>{if(!(l.value||!window.htmlToImage)){l.value=!0;try{let x=c.value;if(!x)return;let T=x.querySelector(".turn-content");if(!T)return;let q=getComputedStyle(document.body).getPropertyValue("--bg-main").trim()||"#ffffff";T.classList.add("screenshot-mode");try{let ae=T.getBoundingClientRect(),W=await window.htmlToImage.toPng(T,{backgroundColor:q,pixelRatio:3,width:ae.width+64,height:ae.height+64,style:{padding:"32px"},filter:de=>!(de.classList&&(de.classList.contains("turn-header")||de.classList.contains("screenshot-btn")))}),J=document.createElement("a");J.download=`response-${Date.now()}.png`,J.href=W,J.click()}finally{T.classList.remove("screenshot-mode")}}catch{}finally{l.value=!1}}};Vue.onMounted(()=>{window.copyCodeBlock||(window.copyCodeBlock=async function(x){let q=x.closest(".code-block-wrapper").querySelector("code");if(q)try{await navigator.clipboard.writeText(q.textContent),x.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(()=>{x.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(x=>{hljs.highlightElement(x),x.dataset.highlighted="true"}),je(c.value)})}),Vue.watch(()=>e.turn.textContent,()=>{Vue.nextTick(()=>{typeof hljs<"u"&&document.querySelectorAll("pre code:not([data-highlighted])").forEach(x=>{hljs.highlightElement(x),x.dataset.highlighted="true"}),je(c.value)})});let M=x=>{if(x?.src)return x.src;if(!x?.fileId)return"";let T=x.previewToken||"";return`/api/preview/${x.fileId}?token=${T}`},j=x=>{f.add(x?.assetId||x?.id)},re=(x,T)=>{let q=M(x);q&&xs(q,{alt:x?.filename||p("message.imagePreview"),closeLabel:p("common.close"),trigger:T})},ge=x=>{if(x)try{typeof s.cancelVpTurn=="function"&&s.cancelVpTurn(x)}catch{}},Ce=()=>{let x=e.turn;return x?typeof x.timestamp=="number"&&x.timestamp>0?x.timestamp:typeof x.createdAt=="number"&&x.createdAt>0?x.createdAt:typeof x.speakerTimestamp=="number"&&x.speakerTimestamp>0?x.speakerTimestamp:null:null},De=Vue.computed(()=>ft(Ce())),ee=Vue.computed(()=>{let x=Ce();if(!x)return"";try{return new Date(x).toLocaleString()}catch{return""}}),K=Vue.computed(()=>bc(e.turn,e.quoteAuthor||p("message.assistant")));return{onStopTurn:ge,turnTime:De,turnTimeFull:ee,assistantQuote:K,copied:n,fullCopied:i,expanded:o,screenshotting:l,turnRef:c,showToolActions:A,latestTool:w,historyTools:S,latestToolIndex:v,actionTools:h,routeMessages:b,toolSummaryLabel:m,toggleExpand:E,toolExpandedValue:U,updateToolExpanded:V,textSegments:P,progressSegments:I,resultSegments:D,progressGroupRef:d,progressExpanded:u,progressToggleLabel:B,onProgressToggle:O,renderSegment:_,copyContent:pe,copyFullResponse:ve,exportMarkdown:ie,screenshotContent:ke,onAskSubmit:g,imageSrc:M,failedImages:f,handleImageError:j,previewImage:re,displayedTodos:y}}}});function Md(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 Pd=H(()=>{});var Dd,_d=H(()=>{hi();Jn();Is();Pd();Xt();Dd={name:"VpTurnBlock",components:{AssistantTurn:Ms},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","quote"],template:`
887
+ </div>`}),te=x=>x.replace(/<table>([\s\S]*?)<\/table>/g,T=>`<div class="table-scroll-wrapper">${T}</div>`),me=x=>{if(!x)return"";typeof x!="string"&&(x=String(x));let T=q=>{let Z=document.createElement("div");return Z.textContent=q,Z.innerHTML};return x.replace(/```(\w*)\n([\s\S]*?)```/g,(q,Z,ae)=>`<div class="code-block-wrapper"><pre><code class="language-${Z}">${T(ae.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>")},pe=async()=>{try{await navigator.clipboard.writeText(e.turn.textContent||""),n.value=!0,setTimeout(()=>{n.value=!1},2e3)}catch{}},ve=async()=>{try{await navigator.clipboard.writeText(e.turn.textContent||""),i.value=!0,setTimeout(()=>{i.value=!1},2e3)}catch{}},ie=()=>{let x=e.turn.textContent||"";if(!x)return;let T=new Blob([x],{type:"text/markdown;charset=utf-8"}),q=URL.createObjectURL(T),Z=document.createElement("a");Z.download=`response-${Date.now()}.md`,Z.href=q,Z.click(),URL.revokeObjectURL(q)},ke=async()=>{if(!(l.value||!window.htmlToImage)){l.value=!0;try{let x=c.value;if(!x)return;let T=x.querySelector(".turn-content");if(!T)return;let q=getComputedStyle(document.body).getPropertyValue("--bg-main").trim()||"#ffffff";T.classList.add("screenshot-mode");try{let ae=T.getBoundingClientRect(),W=await window.htmlToImage.toPng(T,{backgroundColor:q,pixelRatio:3,width:ae.width+64,height:ae.height+64,style:{padding:"32px"},filter:de=>!(de.classList&&(de.classList.contains("turn-header")||de.classList.contains("screenshot-btn")))}),J=document.createElement("a");J.download=`response-${Date.now()}.png`,J.href=W,J.click()}finally{T.classList.remove("screenshot-mode")}}catch{}finally{l.value=!1}}};Vue.onMounted(()=>{window.copyCodeBlock||(window.copyCodeBlock=async function(x){let q=x.closest(".code-block-wrapper").querySelector("code");if(q)try{await navigator.clipboard.writeText(q.textContent),x.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(()=>{x.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(x=>{hljs.highlightElement(x),x.dataset.highlighted="true"}),je(c.value)})}),Vue.watch(()=>e.turn.textContent,()=>{Vue.nextTick(()=>{typeof hljs<"u"&&document.querySelectorAll("pre code:not([data-highlighted])").forEach(x=>{hljs.highlightElement(x),x.dataset.highlighted="true"}),je(c.value)})});let M=x=>{if(x?.src)return x.src;if(!x?.fileId)return"";let T=x.previewToken||"";return`/api/preview/${x.fileId}?token=${T}`},j=x=>{f.add(x?.assetId||x?.id)},re=(x,T)=>{let q=M(x);q&&xs(q,{alt:x?.filename||p("message.imagePreview"),closeLabel:p("common.close"),trigger:T})},ge=x=>{if(x)try{typeof s.cancelVpTurn=="function"&&s.cancelVpTurn(x)}catch{}},Ce=()=>{let x=e.turn;return x?typeof x.timestamp=="number"&&x.timestamp>0?x.timestamp:typeof x.createdAt=="number"&&x.createdAt>0?x.createdAt:typeof x.speakerTimestamp=="number"&&x.speakerTimestamp>0?x.speakerTimestamp:null:null},De=Vue.computed(()=>ft(Ce())),ee=Vue.computed(()=>{let x=Ce();if(!x)return"";try{return new Date(x).toLocaleString()}catch{return""}}),K=Vue.computed(()=>bc(e.turn,e.quoteAuthor||p("message.assistant")));return{onStopTurn:ge,turnTime:De,turnTimeFull:ee,assistantQuote:K,copied:n,fullCopied:i,expanded:o,screenshotting:l,turnRef:c,showToolActions:A,latestTool:w,historyTools:S,latestToolIndex:v,actionTools:h,routeMessages:b,toolSummaryLabel:m,toggleExpand:E,toolExpandedValue:U,updateToolExpanded:V,textSegments:P,progressSegments:I,resultSegments:D,progressPanelId:d,progressExpanded:u,progressToggleLabel:B,toggleProgress:O,renderSegment:_,copyContent:pe,copyFullResponse:ve,exportMarkdown:ie,screenshotContent:ke,onAskSubmit:g,imageSrc:M,failedImages:f,handleImageError:j,previewImage:re,displayedTodos:y}}}});function Md(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 Pd=H(()=>{});var Dd,_d=H(()=>{hi();Jn();Is();Pd();Xt();Dd={name:"VpTurnBlock",components:{AssistantTurn:Ms},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","quote"],template:`
888
888
  <div class="vp-turn-block"
889
889
  :class="{ 'vp-turn-block-streaming': turn.isStreaming }"
890
890
  :data-turn-id="turn.turnId || ''"
@@ -959,9 +959,9 @@ ${String(e||"").trim()}
959
959
  />
960
960
  </div>
961
961
  </div>
962
- `,setup(e){let t=Jt(),s=gt(),n=Vue.getCurrentInstance(),i=n&&n.appContext.config.globalProperties.$t||(g=>g),r=Vue.computed(()=>{let g=e.turn&&e.turn.speakerVpId;return g?s.vpLabel(g)||g:""}),o=Vue.computed(()=>{let g=e.turn&&e.turn.speakerVpId;return!g||typeof s.vpTextColor!="function"?{}:{color:s.vpTextColor(g)}}),a=()=>{let g=e.turn&&e.turn.turnId;if(g)try{typeof t.cancelVpTurn=="function"&&t.cancelVpTurn(g)}catch{}},l=Vue.computed(()=>{let g=e.turn&&e.turn.speakerVpId;return g?t.isVpTypingInCurrentConv(g):!1}),c=Vue.computed(()=>!!(e.turn&&e.turn.isStreaming&&e.turn.turnId)),d=Vue.computed(()=>ft(e.turn.speakerTimestamp)),u=Vue.computed(()=>{let g=e.turn.speakerTimestamp;if(!g)return"";let b=new Date(g);return Number.isNaN(b.getTime())?"":b.toLocaleString()}),f=Vue.computed(()=>{let g=e.turn.speakerTimestamp;if(!g||!e.nowMs)return"";let b=e.nowMs-g;return b<0?"":Md(b)}),p=Vue.computed(()=>{let g=e.turn&&e.turn.turnId,b=g?t.activeVpTurns?.[g]:null;if(!b?.retryAttempt||!b?.retryMax)return"";let h=b.retryRecoveryMode==="continue"?"yeaft.vp.turnBlock.retryingContinue":"yeaft.vp.turnBlock.retryingRequest",A=b.retryRecoveryMode==="continue"?`Response stalled; continuing with a fresh request (${b.retryAttempt}/${b.retryMax})`:`Response stalled; retrying with a fresh request (${b.retryAttempt}/${b.retryMax})`,w=i(h,{attempt:b.retryAttempt,max:b.retryMax});return w===h?A:w});return{onStopTurn:a,isTyping:l,showStop:c,displayName:r,speakerNameStyle:o,startedTimeText:d,startedTimeFullText:u,elapsedText:f,retryText:p}}}});function Bm(e){let t=[];if(typeof e!="string"||!e.trim())return t;let s=e.split(`
962
+ `,setup(e){let t=Jt(),s=gt(),n=Vue.getCurrentInstance(),i=n&&n.appContext.config.globalProperties.$t||(g=>g),r=Vue.computed(()=>{let g=e.turn&&e.turn.speakerVpId;return g?s.vpLabel(g)||g:""}),o=Vue.computed(()=>{let g=e.turn&&e.turn.speakerVpId;return!g||typeof s.vpTextColor!="function"?{}:{color:s.vpTextColor(g)}}),a=()=>{let g=e.turn&&e.turn.turnId;if(g)try{typeof t.cancelVpTurn=="function"&&t.cancelVpTurn(g)}catch{}},l=Vue.computed(()=>{let g=e.turn&&e.turn.speakerVpId;return g?t.isVpTypingInCurrentConv(g):!1}),c=Vue.computed(()=>!!(e.turn&&e.turn.isStreaming&&e.turn.turnId)),d=Vue.computed(()=>ft(e.turn.speakerTimestamp)),u=Vue.computed(()=>{let g=e.turn.speakerTimestamp;if(!g)return"";let b=new Date(g);return Number.isNaN(b.getTime())?"":b.toLocaleString()}),f=Vue.computed(()=>{let g=e.turn.speakerTimestamp;if(!g||!e.nowMs)return"";let b=e.nowMs-g;return b<0?"":Md(b)}),p=Vue.computed(()=>{let g=e.turn&&e.turn.turnId,b=g?t.activeVpTurns?.[g]:null;if(!b?.retryAttempt||!b?.retryMax)return"";let h=b.retryRecoveryMode==="continue"?"yeaft.vp.turnBlock.retryingContinue":"yeaft.vp.turnBlock.retryingRequest",A=b.retryRecoveryMode==="continue"?`Response stalled; continuing with a fresh request (${b.retryAttempt}/${b.retryMax})`:`Response stalled; retrying with a fresh request (${b.retryAttempt}/${b.retryMax})`,w=i(h,{attempt:b.retryAttempt,max:b.retryMax});return w===h?A:w});return{onStopTurn:a,isTyping:l,showStop:c,displayName:r,speakerNameStyle:o,startedTimeText:d,startedTimeFullText:u,elapsedText:f,retryText:p}}}});function qm(e){let t=[];if(typeof e!="string"||!e.trim())return t;let s=e.split(`
963
963
  `),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?`
964
- `:"")+i)}n&&t.push(n);for(let i of t)i.body=i.body.trim();return t}var Ed,Rd=H(()=>{Ed={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 Bm(e)}},methods:{toggle(e){this.expanded={...this.expanded,[e]:!this.expanded[e]}}},template:`
964
+ `:"")+i)}n&&t.push(n);for(let i of t)i.body=i.body.trim();return t}var Ed,Rd=H(()=>{Ed={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 qm(e)}},methods:{toggle(e){this.expanded={...this.expanded,[e]:!this.expanded[e]}}},template:`
965
965
  <div class="reflection-card" :class="{ 'is-pending': isPending, 'is-error': isError }">
966
966
  <div class="reflection-head">
967
967
  <span class="reflection-icon">\u21BB</span>
@@ -1032,7 +1032,7 @@ ${String(e||"").trim()}
1032
1032
  />
1033
1033
  </div>
1034
1034
  </div>
1035
- `}});function cn(e,t,s){return Math.min(Math.max(e,t),s)}function vi(e){return e?typeof e=="string"?e.length:Array.isArray(e)?e.reduce((t,s)=>t+vi(s),0):typeof e=="object"?Object.values(e).reduce((t,s)=>t+vi(s),0):String(e).length:0}function Od(e){if(!e)return 260;let t=vi(e.content||e.text||e.message||""),s=Array.isArray(e.attachments)?e.attachments.length:0;return cn(110+Math.ceil(t/90)*18+s*120,120,1400)}function qm(e){if(!e)return 260;let t=vi(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 cn(160+Math.ceil(t/95)*18+s*56+n*140+i*96,160,1400)}function Vt(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+Vt(n),0)+Math.max(0,t.length-1)*18:260}return e.type==="assistant-turn"?qm(e):e.message?Od(e.message):Od(e)}function Ps(e,t=0){return String(e?.id||e?.messageId||e?.turnId||`virtual_${t}`)}function Wm(e,t,s,n){let i=Ps(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):Vt(e);return Number.isFinite(o)&&o>0?o:260}function Co(e,t={},s={}){let n=Array.isArray(e)?e:[],i=Math.max(0,Number(s.itemGap??18)),r=s.estimateHeight||Vt,o=[0],a=[];for(let l=0;l<n.length;l+=1){let c=Wm(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 Hd(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 Um(e,t,s){let n=Hd(e,t);for(;n<s&&e[n]<t;)n+=1;return cn(n,0,s)}function Nd(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=cn(Hd(l,r),0,i-1),f=cn(Um(l,d,i),u+1,i),p=Math.max(0,u-a),g=Math.min(i,f+a);return{start:p,end:g,visibleStart:u,visibleEnd:f,topSpacerHeight:l[p]||0,bottomSpacerHeight:Math.max(0,c-(l[g]||c)),totalHeight:c,items:n.slice(p,g).map((b,h)=>{let A=p+h;return{item:b,index:A,key:Ps(b,A),top:l[A]||0}})}}function Bd(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}=Co(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,f=a[r]||260;return d==="start"?Math.max(0,Math.min(u,l-c)):d==="end"?Math.max(0,Math.min(u+f-c,l-c)):Math.max(0,Math.min(u-(c-f)/2,l-c))}function es({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 qd(e=0,{viewports:t=2,minPx:s=600}={}){let n=Math.max(0,Number(e)||0),i=Math.max(0,Number(t)||0);return Math.max(0,Number(s)||0,n*i)}function Wd({following:e=!0,atBottom:t=!1,userScroll:s=!1}={}){return(s||!!e)&&!!t}function Ud({following:e=!0,atBottom:t=!1,resumeBoundaryReached:s=!1,direction:n=0}={}){let i=Number(n)||0;return i<0?!1:e?!!t:i>0&&!!s}function Km(e){return zm.has(String(e||""))}function zd(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 jd(e,t,s=globalThis.document){if(!e||e.defaultPrevented||!t||!Km(e.key))return!1;let n=e.target;return!n||n.closest?.(jm)?!1:n===t||n===s?.body||n===s?.documentElement}var zm,jm,It,Io=H(()=>{zm=new Set(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," "]),jm='input, textarea, select, button, a, [contenteditable], [role="button"], [role="link"]';It=Object.freeze({itemHeight:260,viewportHeight:720,overscan:1,itemGap:18,bottomThreshold:80,resumeBottomThreshold:2,historyPrefetchViewports:2,historyPrefetchMinPx:600})});var dn,Kd,Gd=H(()=>{Io();dn=2,Kd={name:"VirtualTranscript",props:{items:{type:Array,default:()=>[]},overscan:{type:Number,default:It.overscan},itemGap:{type:Number,default:It.itemGap},estimateHeight:{type:Function,default:Vt},initialAlign:{type:String,default:"start"}},emits:["scroll-state"],template:`
1035
+ `}});function cn(e,t,s){return Math.min(Math.max(e,t),s)}function vi(e){return e?typeof e=="string"?e.length:Array.isArray(e)?e.reduce((t,s)=>t+vi(s),0):typeof e=="object"?Object.values(e).reduce((t,s)=>t+vi(s),0):String(e).length:0}function Od(e){if(!e)return 260;let t=vi(e.content||e.text||e.message||""),s=Array.isArray(e.attachments)?e.attachments.length:0;return cn(110+Math.ceil(t/90)*18+s*120,120,1400)}function Wm(e){if(!e)return 260;let t=vi(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 cn(160+Math.ceil(t/95)*18+s*56+n*140+i*96,160,1400)}function Vt(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+Vt(n),0)+Math.max(0,t.length-1)*18:260}return e.type==="assistant-turn"?Wm(e):e.message?Od(e.message):Od(e)}function Ps(e,t=0){return String(e?.id||e?.messageId||e?.turnId||`virtual_${t}`)}function Um(e,t,s,n){let i=Ps(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):Vt(e);return Number.isFinite(o)&&o>0?o:260}function Co(e,t={},s={}){let n=Array.isArray(e)?e:[],i=Math.max(0,Number(s.itemGap??18)),r=s.estimateHeight||Vt,o=[0],a=[];for(let l=0;l<n.length;l+=1){let c=Um(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 Hd(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 zm(e,t,s){let n=Hd(e,t);for(;n<s&&e[n]<t;)n+=1;return cn(n,0,s)}function Nd(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=cn(Hd(l,r),0,i-1),f=cn(zm(l,d,i),u+1,i),p=Math.max(0,u-a),g=Math.min(i,f+a);return{start:p,end:g,visibleStart:u,visibleEnd:f,topSpacerHeight:l[p]||0,bottomSpacerHeight:Math.max(0,c-(l[g]||c)),totalHeight:c,items:n.slice(p,g).map((b,h)=>{let A=p+h;return{item:b,index:A,key:Ps(b,A),top:l[A]||0}})}}function Bd(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}=Co(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,f=a[r]||260;return d==="start"?Math.max(0,Math.min(u,l-c)):d==="end"?Math.max(0,Math.min(u+f-c,l-c)):Math.max(0,Math.min(u-(c-f)/2,l-c))}function es({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 qd(e=0,{viewports:t=2,minPx:s=600}={}){let n=Math.max(0,Number(e)||0),i=Math.max(0,Number(t)||0);return Math.max(0,Number(s)||0,n*i)}function Wd({following:e=!0,atBottom:t=!1,userScroll:s=!1}={}){return(s||!!e)&&!!t}function Ud({following:e=!0,atBottom:t=!1,resumeBoundaryReached:s=!1,direction:n=0}={}){let i=Number(n)||0;return i<0?!1:e?!!t:i>0&&!!s}function Gm(e){return jm.has(String(e||""))}function zd(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 jd(e,t,s=globalThis.document){if(!e||e.defaultPrevented||!t||!Gm(e.key))return!1;let n=e.target;return!n||n.closest?.(Km)?!1:n===t||n===s?.body||n===s?.documentElement}var jm,Km,It,Io=H(()=>{jm=new Set(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," "]),Km='input, textarea, select, button, a, [contenteditable], [role="button"], [role="link"]';It=Object.freeze({itemHeight:260,viewportHeight:720,overscan:1,itemGap:18,bottomThreshold:80,resumeBottomThreshold:2,historyPrefetchViewports:2,historyPrefetchMinPx:600})});var dn,Kd,Gd=H(()=>{Io();dn=2,Kd={name:"VirtualTranscript",props:{items:{type:Array,default:()=>[]},overscan:{type:Number,default:It.overscan},itemGap:{type:Number,default:It.itemGap},estimateHeight:{type:Function,default:Vt},initialAlign:{type:String,default:"start"}},emits:["scroll-state"],template:`
1036
1036
  <div class="virtual-transcript" ref="rootRef">
1037
1037
  <div
1038
1038
  v-if="topSpacerHeight > 0"
@@ -1060,7 +1060,7 @@ ${String(e||"").trim()}
1060
1060
  ></div>
1061
1061
  </div>
1062
1062
  `,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(It.viewportHeight),l=Vue.reactive({}),c=new Map,d=new Map,u=new Map,f=null,p=null,g=null,b=null,h=0,A=!1,w=0,S=!0,v=null,m="start",y=null,E=Vue.computed(()=>Co(e.items,l,{itemGap:e.itemGap,estimateHeight:e.estimateHeight})),$=Vue.computed(()=>Nd(e.items,E.value,{scrollTop:o.value,viewportHeight:a.value,overscan:e.overscan})),U=Vue.computed(()=>$.value.items),V=Vue.computed(()=>$.value.topSpacerHeight),L=Vue.computed(()=>$.value.bottomSpacerHeight);function _(ee){ee&&t("scroll-state",{scrollTop:ee.scrollTop||0,scrollHeight:ee.scrollHeight||0,clientHeight:ee.clientHeight||0})}function P(){let ee=i.value;ee&&(a.value=Math.max(1,ee.clientHeight||It.viewportHeight),r&&e.items.length===0||(o.value=Math.max(0,ee.scrollTop||0)),_(ee))}function I(){let ee=i.value;return!r||e.initialAlign!=="end"||e.items.length===0||!ee?!1:(te(),ee.scrollTop=ee.scrollHeight,r=!1,P(),!0)}function D(){I()||P()}function B(){p||(p=requestAnimationFrame(()=>{p=null,P()}))}function O(ee){return ee?es({scrollTop:ee.scrollTop,scrollHeight:ee.scrollHeight,clientHeight:ee.clientHeight,threshold:It.bottomThreshold}):!0}function z({delta:ee=0,toBottom:K=!1}={},x=w){if(x!==w||(Math.abs(ee)>=dn&&(h+=ee),K&&(A=!0),b))return;let T=x;b=requestAnimationFrame(()=>{if(b=null,T!==w)return;let q=i.value;if(!q){h=0,A=!1;return}A?q.scrollTop=q.scrollHeight:Math.abs(h)>=dn&&(q.scrollTop+=h),h=0,A=!1,P()})}function te(){v=null,y=null}function me({preserveTarget:ee=!1}={}){w+=1,A=!1,h=0,ee||te(),b&&cancelAnimationFrame(b),b=null}function pe(ee,K,x){!ee||!x||(u.set(ee,{index:K,el:x}),!g&&(g=requestAnimationFrame(()=>{g=null;let T=Array.from(u.entries());u.clear(),ve(T)})))}function ve(ee){let K=[];for(let[de,oe]of ee){let Me=oe?.el;if(!Me)continue;let _e=Math.ceil(Me.getBoundingClientRect?.().height||Me.offsetHeight||0);if(!Number.isFinite(_e)||_e<=0)continue;let Ve=l[de];if(Ve===_e)continue;let qe=c.get(de);K.push({key:de,nextHeight:_e,previousHeight:Ve,itemIndex:Number.isFinite(qe)?qe:oe.index})}if(!K.length)return;let x=i.value,T=S&&O(x),q=$.value.visibleStart,Z=!!v&&K.some(de=>de.key===v),ae=0,W=!1;for(let de of K){let{key:oe,nextHeight:Me,previousHeight:_e,itemIndex:Ve}=de;if(l[oe]=Me,!x||!Number.isFinite(_e))continue;let qe=Me-_e;Math.abs(qe)<dn||(Number.isFinite(Ve)&&Ve<q?ae+=qe:T&&(W=!0))}if(Z){me({preserveTarget:!0}),ke(v,m);return}if(Math.abs(ae)>=dn||W){let de={delta:ae,toBottom:W},oe=w;W?Vue.nextTick(()=>z(de,oe)):z(de,oe)}}function ie(ee,K="start"){let x=i.value,T=y||d.get(String(ee));if(!x||!T)return!1;let q=x.getBoundingClientRect?.(),Z=T.getBoundingClientRect?.();if(!q||!Z)return!1;let ae=Number(q.top),W=Number(x.clientHeight||a.value),J=Number(Z.height||0),de=K==="center"&&J<=W?ae+(W-J)/2:K==="end"&&J<=W?Number(q.bottom)-J:ae,oe=Number(Z.top)-de;return Math.abs(oe)>=dn&&(x.scrollTop+=oe),P(),!0}function ke(ee,K="start",x){let T=String(ee);v=T,m=K,x!==void 0&&(y=x);let q=()=>{v===T&&ie(T,m)};Vue.nextTick(q)}function M(ee){let K=!!ee;K&&te(),S!==K&&(S=K,S||me())}function j(ee,K,x){c.set(ee,K),x&&(d.set(ee,x),f&&f.observe(x),Vue.nextTick(()=>pe(ee,K,x)))}function re(ee,K,x){if(!ee)return;let T=d.get(ee);if(T&&T!==x&&f&&f.unobserve(T),!x){d.delete(ee);return}j(ee,K,x)}async function ge(ee,{align:K="center"}={}){let x=Number.isFinite(ee)?Math.floor(ee):-1,T=i.value;if(!T||x<0||x>=e.items.length)return!1;me({preserveTarget:!0});let q=Ps(e.items[x],x);return v=q,m=K,y=null,T.scrollTop=Bd(e.items,x,l,{itemGap:e.itemGap,estimateHeight:e.estimateHeight,viewportHeight:T.clientHeight||a.value,align:K}),P(),await Vue.nextTick(),d.get(q)?(ke(q,K),!0):!1}function Ce(ee,K={}){let x=c.get(String(ee));return Number.isFinite(x)?ge(x,K):Promise.resolve(!1)}function De(ee,K,{align:x="start"}={}){let T=String(ee||"");return!T||!K?!1:(v=T,m=x,y=K,ie(T,x),!0)}return s({scrollToKey:Ce,scrollToIndex:ge,anchorTarget:De,clearTargetAnchor:te,cancelPendingBottomFollow:me,setBottomFollowEnabled:M}),Vue.watch(()=>e.items.map((ee,K)=>Ps(ee,K)).join(`
1063
- `),()=>{c.clear(),e.items.forEach((ee,K)=>c.set(Ps(ee,K),K)),v&&!c.has(v)&&te(),Vue.nextTick(D)},{immediate:!0}),Vue.onMounted(()=>{if(i.value=n.value?.closest?.(".chat-container")||n.value?.parentElement||null,D(),i.value?.addEventListener("scroll",B,{passive:!0}),window.addEventListener("resize",B),typeof ResizeObserver<"u"){f=new ResizeObserver(ee=>{for(let K of ee){let x=K.target?.dataset?.virtualId,T=Number(K.target?.dataset?.virtualIndex);x&&pe(x,T,K.target)}});for(let[ee,K]of d.entries()){let x=c.get(ee)??Number(K.dataset?.virtualIndex||0);j(ee,x,K)}}}),Vue.onBeforeUnmount(()=>{i.value?.removeEventListener("scroll",B),window.removeEventListener("resize",B),f&&f.disconnect(),p&&cancelAnimationFrame(p),g&&cancelAnimationFrame(g),b&&cancelAnimationFrame(b),u.clear(),h=0,A=!1}),{rootRef:n,visibleEntries:U,topSpacerHeight:V,bottomSpacerHeight:L,setItemRef:re}}}});function un(e){return typeof e=="string"&&e.trim()?e.trim():""}function Gm(e){return un(e?.speakerVpId)||un(e?.vpId)}function Yd(e,t){if(!e||!t)return!1;let s=un(e.speakerVpId),n=Gm(t);if(s&&n&&s!==n)return!0;if(e.isHistory&&t.isHistory)return!1;let i=un(e.turnId),r=un(t.turnId);return!!(i&&r&&i!==r)}var Qd=H(()=>{});function pn(e){return e?e.type!=="user"&&e.type!=="system"&&e.type!=="error":!1}function yi(e){let t=Array.isArray(e?.items)?e.items:[];return e?.responseCollapsed?t.filter(s=>!pn(s)):t}function Ym(e){return(Array.isArray(e?.items)?e.items:[]).filter(pn)}function Xd(e){let t=Ym(e);return t.length?t[0]:null}function Qm(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 Zd(e){if(!e?.responseCollapsed)return[];let t=Xd(e);return Qm(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 Jd(e,t){if(!e?.responseCollapsed||typeof t!="function")return null;let s=yi(e),n=Xd(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 eu=H(()=>{});function ts(e,t){typeof t!="string"||!/^m\d+$/.test(t)||e.includes(t)||e.push(t)}function Xm(e){if(!e)return[];let t=[];for(let s of Array.isArray(e.messages)?e.messages:[])ts(t,s?.id),ts(t,s?.messageId),ts(t,s?.persistedMessageId);return ts(t,e.message?.id),ts(t,e.messageId),ts(t,e.atMessageId),e.type!=="assistant-turn"&&ts(t,e.id),t}function tu(e){return!e?.closest?.(".yeaft-conversation-outline, .yeaft-conversation-outline-sender-menu, .yeaft-search-btn")}async function su({result:e,revealWindow: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 Zm(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(!Xm(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 nu({blocks:e,messageId:t,collapseStates:s,scrollToBlock:n,findRow:i,anchorRow:r,flashRow:o,nextTick:a,align:l="start"}){let c=Zm(e,t);if(!c||typeof n!="function"||typeof i!="function")return!1;if(c.requiresExpansion){if(!c.collapseKey||!s)return!1;s[c.collapseKey]=!1,await a?.()}if(!await n(c.blockId,{align:l}))return!1;await a?.();let u=i(c.rowId);return u?(typeof r=="function"?r(c.blockId,c.rowId,u,{align:l}):u.scrollIntoView?.({block:l,inline:"nearest"}),o?.(c.rowId),!0):!1}var Ao=H(()=>{});var bi,xo=H(()=>{lt();uo();ui();hi();_d();ko();Rd();$d();Fd();Gd();Qd();Io();eu();Ao();Xt();Gn();bi={name:"MessageList",components:{MessageItem:Ts,AssistantTurn:Ms,VpTurnBlock:Dd,VpSpeakerHeader:gi,ReflectionCard:Ed,SubAgentCard:Ld,UserTurnBlock:Vd,VirtualTranscript:Kd},template:`
1063
+ `),()=>{c.clear(),e.items.forEach((ee,K)=>c.set(Ps(ee,K),K)),v&&!c.has(v)&&te(),Vue.nextTick(D)},{immediate:!0}),Vue.onMounted(()=>{if(i.value=n.value?.closest?.(".chat-container")||n.value?.parentElement||null,D(),i.value?.addEventListener("scroll",B,{passive:!0}),window.addEventListener("resize",B),typeof ResizeObserver<"u"){f=new ResizeObserver(ee=>{for(let K of ee){let x=K.target?.dataset?.virtualId,T=Number(K.target?.dataset?.virtualIndex);x&&pe(x,T,K.target)}});for(let[ee,K]of d.entries()){let x=c.get(ee)??Number(K.dataset?.virtualIndex||0);j(ee,x,K)}}}),Vue.onBeforeUnmount(()=>{i.value?.removeEventListener("scroll",B),window.removeEventListener("resize",B),f&&f.disconnect(),p&&cancelAnimationFrame(p),g&&cancelAnimationFrame(g),b&&cancelAnimationFrame(b),u.clear(),h=0,A=!1}),{rootRef:n,visibleEntries:U,topSpacerHeight:V,bottomSpacerHeight:L,setItemRef:re}}}});function un(e){return typeof e=="string"&&e.trim()?e.trim():""}function Ym(e){return un(e?.speakerVpId)||un(e?.vpId)}function Yd(e,t){if(!e||!t)return!1;let s=un(e.speakerVpId),n=Ym(t);if(s&&n&&s!==n)return!0;if(e.isHistory&&t.isHistory)return!1;let i=un(e.turnId),r=un(t.turnId);return!!(i&&r&&i!==r)}var Qd=H(()=>{});function pn(e){return e?e.type!=="user"&&e.type!=="system"&&e.type!=="error":!1}function yi(e){let t=Array.isArray(e?.items)?e.items:[];return e?.responseCollapsed?t.filter(s=>!pn(s)):t}function Qm(e){return(Array.isArray(e?.items)?e.items:[]).filter(pn)}function Xd(e){let t=Qm(e);return t.length?t[0]:null}function Xm(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 Zd(e){if(!e?.responseCollapsed)return[];let t=Xd(e);return Xm(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 Jd(e,t){if(!e?.responseCollapsed||typeof t!="function")return null;let s=yi(e),n=Xd(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 eu=H(()=>{});function ts(e,t){typeof t!="string"||!/^m\d+$/.test(t)||e.includes(t)||e.push(t)}function Zm(e){if(!e)return[];let t=[];for(let s of Array.isArray(e.messages)?e.messages:[])ts(t,s?.id),ts(t,s?.messageId),ts(t,s?.persistedMessageId);return ts(t,e.message?.id),ts(t,e.messageId),ts(t,e.atMessageId),e.type!=="assistant-turn"&&ts(t,e.id),t}function tu(e){return!e?.closest?.(".yeaft-conversation-outline, .yeaft-conversation-outline-sender-menu, .yeaft-search-btn")}async function su({result:e,revealWindow: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 Jm(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(!Zm(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 nu({blocks:e,messageId:t,collapseStates:s,scrollToBlock:n,findRow:i,anchorRow:r,flashRow:o,nextTick:a,align:l="start"}){let c=Jm(e,t);if(!c||typeof n!="function"||typeof i!="function")return!1;if(c.requiresExpansion){if(!c.collapseKey||!s)return!1;s[c.collapseKey]=!1,await a?.()}if(!await n(c.blockId,{align:l}))return!1;await a?.();let u=i(c.rowId);return u?(typeof r=="function"?r(c.blockId,c.rowId,u,{align:l}):u.scrollIntoView?.({block:l,inline:"nearest"}),o?.(c.rowId),!0):!1}var Ao=H(()=>{});var bi,xo=H(()=>{lt();uo();ui();hi();_d();ko();Rd();$d();Fd();Gd();Qd();Io();eu();Ao();Xt();Gn();bi={name:"MessageList",components:{MessageItem:Ts,AssistantTurn:Ms,VpTurnBlock:Dd,VpSpeakerHeader:gi,ReflectionCard:Ed,SubAgentCard:Ld,UserTurnBlock:Vd,VirtualTranscript:Kd},template:`
1064
1064
  <main class="chat-container" ref="containerRef">
1065
1065
  <!-- Session Loading Overlay - only covers message area -->
1066
1066
  <div class="session-loading-overlay" v-if="showSessionLoadingOverlay">
@@ -1682,7 +1682,7 @@ ${String(e||"").trim()}
1682
1682
  {{ $t('message.scrollToLatest') }}
1683
1683
  </button>
1684
1684
  </main>
1685
- `,emits:["new-conversation","resume-conversation","open-settings","quote-message","edit-message-as-new"],setup(e,{expose:t}){let s=Pinia.useChatStore(),n=xe(),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=k=>String(k?.id||k?.turnId||k?.messageId||k?.atMessageId||k?.message?.id||"turn_unknown"),f=k=>{let F=u(k);return Object.prototype.hasOwnProperty.call(l,F)?!!l[F]:!1},p=(k,F)=>{l[u(k)]=!!F},g=({key:k,value:F}={})=>{k&&(c[k]=!!F)},b=k=>{let F=Jd(k,Vt);return Number.isFinite(F)?F:Vt(k)},h=k=>yi(k),A=k=>{let F=Array.isArray(k?.collapsedResponsePreview)?k.collapsedResponsePreview:Zd(k);return Array.isArray(F)?F:F?[String(F)]:[]},w=k=>{let F=Array.isArray(k?.items)?k.items.find(be=>pn(be)):null,N=F?.speakerVpId||F?.vpId||F?.message?.speakerVpId||F?.message?.vpId||k?.vpId||"",ue=N&&i&&typeof i.vpLabel=="function"?i.vpLabel(N)||N:N||(typeof r=="function"?r("message.assistant"):"Assistant"),we=N&&i&&typeof i.vpTextColor=="function"?{color:i.vpTextColor(N)}:{},ne=F?.speakerTimestamp||F?.timestamp||F?.createdAt||F?.message?.timestamp||F?.message?.createdAt||0,Ee="",Ne="";if(ne)try{let be=new Date(ne);Number.isNaN(be.getTime())||(Ee=ft(ne),Ne=be.toLocaleString())}catch{}return{name:ue,style:we,timeText:Ee,fullTimeText:Ne}},S=k=>{let F=Array.isArray(k?.items)?k.items:[];for(let N=F.length-1;N>=0;N-=1)if(pn(F[N]))return F[N];return null},v=(k,F)=>!k?.responseCollapsible||!F?!1:S(k)===F,m=k=>!!(k?.responseCollapsible&&!yi(k).some(F=>v(k,F))),y=k=>{let F=k?.responseCollapseKey;F&&(d[F]=!k.responseCollapsed)},E=k=>{let F=Number(k?.responseCount||0),N=k?.responseCollapsed?"message.showResponses":"message.hideResponses",ue=(typeof r=="function"?r(N):"")||(k?.responseCollapsed?"Show {count} response(s)":"Hide response(s)");return String(ue).replace("{count}",String(F))},$=(()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}}),U=Vue.computed(()=>{if(s.currentView!=="yeaft")return null;let k=$();if(!k)return null;let F=s.yeaftActiveSessionFilter||null;return F&&typeof k.sessionById=="function"&&k.sessionById(F,s.currentAgent||null)?F:k.activeSessionId&&typeof k.sessionById=="function"&&k.sessionById(k.activeSessionId,s.currentAgent||null)?k.activeSessionId:null}),V=Vue.computed(()=>[s.activeConversationId||"",s.currentView||"",s.currentAgent||"",s.currentView==="yeaft"?s.yeaftActiveSessionFilter||U.value||"__all__":""].join("")),L=Vue.computed(()=>U.value!==null),_=Vue.computed(()=>s.agents.filter(k=>k.online)),P=Vue.ref(null),I=Vue.ref(null),D=Vue.ref(!1),B=Vue.ref(""),O=null,z=0,te=n.token||"",me=()=>{P.value=null,I.value=null,B.value="",O=null,z+=1},pe=ai(),ve=li(),ie=Vue.computed(()=>ci({profile:P.value,agentSecret:I.value,serverWsUrl:rn(location)})),ke=()=>{let k={"Content-Type":"application/json"};return n.token&&(k.Authorization=`Bearer ${n.token}`),k},M=async()=>{if(_.value.length>0||s.currentConversation)return;if(I.value||O)return O;D.value=!0,B.value="";let k=++z;return O=(async()=>{let F=n.token||"",N=ke(),[ue,we]=await Promise.all([fetch("/api/user/profile",{headers:N}),fetch("/api/user/agent-secret",{headers:N})]),ne=ue.ok?await ue.json():null;if(k!==z||F!==(n.token||""))return;if(ne&&(P.value=ne),!we.ok){let be="";try{be=(await we.json())?.error||""}catch{}throw new Error(be||"Failed to load Agent secret")}let Ee=await we.json();if(k!==z||F!==(n.token||""))return;let Ne=Ee?.agentSecret||Ee?.agent_secret||null;I.value=Ne&&String(Ne).trim()?String(Ne):null})().catch(F=>{k===z&&(B.value=F?.message||"Failed to load Agent secret")}).finally(()=>{k===z&&(D.value=!1,O=null)}),O},j=async k=>{if(k)try{await navigator.clipboard.writeText(k)}catch{}},re=(k,F)=>{let N=k?.message||null,ue=k?.id||k?.atMessageId||N?.id||N?.messageId||`legacy_${F}`,we=k?.speakerVpId||k?.vpId||N?.speakerVpId||N?.vpId||"";return{id:`message_${we||"user"}_${ue}_${F}`,vpId:we,messageId:ue}},ge=Vue.computed(()=>{let k=s.messages,F=[],N=null,ue=0,we=()=>{if(N){N.isActive=!!(N.turnId&&s.activeVpTurns?.[N.turnId]),Kn(N);let be=!!(N.textContent||N.todoMsg||N.askMsg||N.imageMsgs.length>0),le=N.toolMsgs.length>0||N.toolSummaryCount>0;(be||le)&&(N.showSpeakerHeader=!!N.speakerVpId,F.push(N)),N=null}},ne=be=>{if(N){if(!N.speakerVpId){let le=be.speakerVpId||be.vpId;le&&(N.speakerVpId=le,N.speakerTimestamp=typeof be.timestamp=="number"&&be.timestamp>0?be.timestamp:typeof be.createdAt=="number"?be.createdAt:0,typeof be.lastStateChangeCause=="string"&&!N.speakerStateCause&&(N.speakerStateCause=be.lastStateChangeCause))}!N.turnId&&be.turnId&&(N.turnId=be.turnId)}},Ee=()=>{ue++,N={type:"assistant-turn",id:"turn_"+ue,textContent:"",textSegments:[],isStreaming:!1,isActive:!1,isHistory:!1,todoMsg:null,toolMsgs:[],toolSummaryCount:0,imageMsgs:[],askMsg:null,messages:[],atMessageId:null,speakerVpId:null,speakerTimestamp:0,speakerStateCause:"",showSpeakerHeader:!1,turnId:null}},Ne=be=>{Yd(N,be)&&we()};for(let be=0;be<k.length;be++){let le=k[be];if(le.type==="user"){if(!le.content||!le.content.trim())continue;we(),F.push({type:"user",id:le.id||"u_"+be,message:le});continue}if(le.type==="system"||le.type==="error"){we(),F.push({type:le.type,id:le.id||"s_"+be,message:le});continue}if(!(le.type==="tool-result"||le.type==="tool_result")){if(le.type==="tool-summary"){Ne(le),N||Ee(),ne(le),le.isHistory&&(N.isHistory=!0),N.toolSummaryCount+=Number(le.count||le.omittedCount||0)||0,N.messages.push(le);continue}if(le.type==="assistant"){Ne(le),N||Ee(),jn(N,le),le.isStreaming&&(N.isStreaming=!0),le.isHistory&&(N.isHistory=!0),le.id&&/^m\d+$/.test(le.id)&&(N.atMessageId=le.id),ne(le),N.messages.push(le);continue}if(le.type==="tool-use"){Ne(le),N||Ee(),ne(le);let _t=k[be+1],fr=_t&&(_t.type==="tool-result"||_t.type==="tool_result"),fs={...le,hasResult:fr||le.hasResult||!1,toolResult:le.toolResult||null};le.isHistory&&(N.isHistory=!0),le.toolName==="TodoWrite"?N.todoMsg=fs:le.toolName==="AskUserQuestion"?N.askMsg=fs:N.toolMsgs.push(fs),N.messages.push(le);continue}if(le.type==="chat-image"){Ne(le),N||Ee(),ne(le),le.isHistory&&(N.isHistory=!0),N.imageMsgs.push(le),N.messages.push(le);continue}we(),F.push({type:le.type||"unknown",id:le.id||"x_"+be,message:le})}}return we(),F}),Ce=Vue.computed(()=>{let k=[],F=null,N=()=>{F&&k.push(F),F=null};return ge.value.forEach((ue,we)=>{if(!ue||ue.type==="system"||ue.type==="error"){N(),k.push(ue);return}let ne=re(ue,we);if(ue.type==="user"||!F){N(),F={type:"message-block",id:`turn_${ne.messageId}_${we}`,vpId:ne.vpId,messageId:ne.messageId,items:[ue]};return}F.items.push(ue),!F.vpId&&ne.vpId&&(F.vpId=ne.vpId)}),N(),k}),De=Vue.computed(()=>{let k=s.yeaftReflectionCards||{},F=s.yeaftConversationId,N={__orphans:[]},ue=Object.values(k).filter(ne=>ne&&ne.conversationId===F).sort((ne,Ee)=>(ne.anchorOrder||0)-(Ee.anchorOrder||0)||(ne.updatedAt||0)-(Ee.updatedAt||0)),we=new Set;for(let ne of s.messages||[])ne&&ne.id&&we.add(ne.id);for(let ne of ue)ne.anchorMsgId&&we.has(ne.anchorMsgId)?(N[ne.anchorMsgId]||(N[ne.anchorMsgId]=[]),N[ne.anchorMsgId].push(ne)):N.__orphans.push(ne);return N}),ee=k=>k?k.type==="assistant-turn"?k.atMessageId||null:k.message&&k.message.id||null:null,K=k=>{let F=ee(k);return F?(De.value||{})[F]||[]:[]},x=Vue.computed(()=>(De.value||{}).__orphans||[]),T=Vue.computed(()=>{let k=s.yeaftSubAgentCards||{},F=s.yeaftConversationId,N={__orphans:[]},ue=Object.values(k).filter(ne=>ne&&ne.conversationId===F).sort((ne,Ee)=>(ne.anchorOrder||0)-(Ee.anchorOrder||0)||(ne.updatedAt||0)-(Ee.updatedAt||0)),we=new Set;for(let ne of s.messages||[])ne&&ne.id&&we.add(ne.id);for(let ne of ue)ne.anchorMsgId&&we.has(ne.anchorMsgId)?(N[ne.anchorMsgId]||(N[ne.anchorMsgId]=[]),N[ne.anchorMsgId].push(ne)):N.__orphans.push(ne);return N}),q=k=>{let F=ee(k);return F?(T.value||{})[F]||[]:[]},Z=Vue.computed(()=>(T.value||{}).__orphans||[]),ae=Vue.ref(!0),W=Vue.ref(!1),J=It.bottomThreshold,de=It.resumeBottomThreshold,oe=!0,Me=Vue.computed(()=>s.messages.some(k=>k.isStreaming)),_e=Vue.computed(()=>!s.currentConversation||Ce.value.length>0?!1:s.currentView==="yeaft"?!!s.yeaftLoadingMoreHistory:!!s.sessionLoading),Ve=Vue.computed(()=>s.sessionLoadingText||""),qe=Vue.computed(()=>!!s.sessionLoading&&!_e.value),xt=Vue.computed(()=>s.isProcessing&&!Me.value),dt=Vue.ref(Date.now()),ut=null,$s=()=>{ut||(ut=setInterval(()=>{dt.value=Date.now()},1e3))},ht=()=>{ut&&(clearInterval(ut),ut=null)};Vue.watch(Me,k=>{k?(dt.value=Date.now(),$s()):ht()},{immediate:!0}),Vue.onBeforeUnmount(()=>ht());let Fe=Vue.ref(0),We=Vue.ref(Date.now()),Ke=null,ze=null,Xe=Vue.ref("cat"),R=new URLSearchParams(window.location.search).get("preview"),Y=Vue.ref(0),fe=Vue.ref(1),se=Vue.ref(5),he=Vue.ref(95),ye=Vue.ref("bark-both"),Oe=Vue.ref(1),He=Vue.ref(-1),Ue=null;function Tt(){if(!Fe.value)return;We.value=Date.now();let k=(We.value-Fe.value)%19e3;if(k<4e3)Y.value=0,fe.value=1;else if(k<11500){let F=k-4e3,N;F<2500?N=F/2500*16:F<5e3?N=16+(F-2500)/2500*29:N=45+(F-5e3)/2500*55,Y.value=N,fe.value=1}else k<14e3?(Y.value=(1-(k-11500)/2500)*100,fe.value=-1):(Y.value=0,fe.value=1);ze=requestAnimationFrame(Tt)}function Mt(){if(!Fe.value||Xe.value!=="dog")return;We.value=Date.now();let k=(We.value-Fe.value)%18e3;if(k<2e3)se.value=5,he.value=95,ye.value="bark-both",Oe.value=1,He.value=-1;else if(k<5e3){let F=(k-2e3)/3e3;se.value=5+F*25,he.value=95,ye.value="left-approach",Oe.value=1,He.value=-1}else if(k<8e3){let F=(k-5e3)/3e3;se.value=30,he.value=95-F*25,ye.value="right-approach",Oe.value=1,He.value=-1}else if(k<1e4){let F=(k-8e3)/2e3;se.value=30+F*13,he.value=70-F*13,ye.value="both-approach",Oe.value=1,He.value=-1}else if(k<11e3)se.value=43,he.value=57,ye.value="snap",Oe.value=1,He.value=-1;else if(k<12500)se.value=43,he.value=57,ye.value="stunned",Oe.value=1,He.value=-1;else if(k<15e3){let F=(k-12500)/2500;se.value=43-F*38,he.value=57+F*38,ye.value="retreat",Oe.value=-1,He.value=1}else k<17e3?(se.value=5,he.value=95,ye.value="rehang",Oe.value=-1,He.value=1):(se.value=5,he.value=95,ye.value="reset",Oe.value=1,He.value=-1);Ue=requestAnimationFrame(Mt)}let Qi=Vue.computed(()=>{let k=se.value*1.2;return Oe.value<0?`translate(${k+13.5}, 0) scale(-1, 1)`:`translate(${k-13.5}, 0)`}),Xi=Vue.computed(()=>{let k=he.value*1.2;return He.value>0?`translate(${k-10.5}, 2)`:`translate(${k+10.5}, 2) scale(-1, 1)`}),kn=Vue.computed(()=>{let k=ye.value;return k==="bark-both"||k==="left-approach"||k==="right-approach"||k==="both-approach"||k==="reset"}),Zi=Vue.computed(()=>{let k=se.value*1.2,F=10;if(kn.value){let we=Math.max(0,(k-3)*.12);return`M3,18 Q${(3+k)/2},${18+we} ${k},${F}`}if(ye.value==="rehang")return`M${k},${F} Q${k-3},20 3,18`;let N=Oe.value<0?1:-1,ue=k+N*8;return`M${k},${F} Q${k},18 ${ue},22`}),Sn=Vue.computed(()=>{let k=he.value*1.2,F=10;if(kn.value){let we=Math.max(0,(118-k)*.12);return`M118,18 Q${(118+k)/2},${18+we} ${k},${F}`}if(ye.value==="rehang")return`M${k},${F} Q${k+3},20 118,18`;let N=He.value>0?-1:1,ue=k+N*8;return`M${k},${F} Q${k},18 ${ue},22`}),Ji=Vue.computed(()=>ye.value==="snap"?.2:.4),er=Vue.computed(()=>ye.value==="snap"?.2:.4),tr=Vue.computed(()=>se.value*1.2),sr=Vue.computed(()=>he.value*1.2),Vs=R==="cat"||R==="dog"||R==="animation",Cn=600,Fs=Vue.ref(!1),Ze=null,In=Vue.computed(()=>Vs?!0:Fs.value);Vue.watch(xt,k=>{if(k)Ze&&(clearTimeout(Ze),Ze=null),Fs.value=!0,Fe.value=Date.now(),We.value=Date.now(),Xe.value="cat",Y.value=0,fe.value=1,se.value=5,he.value=95,ye.value="bark-both",Oe.value=1,He.value=-1,Xe.value==="cat"?ze=requestAnimationFrame(Tt):Ue=requestAnimationFrame(Mt);else{let F=Fe.value?Date.now()-Fe.value:Cn,N=Math.max(0,Cn-F),ue=()=>{Ze=null,Fs.value=!1,Fe.value=0,Y.value=0,fe.value=1,ze&&(cancelAnimationFrame(ze),ze=null),Ue&&(cancelAnimationFrame(Ue),Ue=null)};N===0?ue():(Ze&&clearTimeout(Ze),Ze=setTimeout(ue,N))}},{immediate:!0}),Vs&&(Fe.value=Date.now(),We.value=Date.now(),R==="dog"?Xe.value="dog":Xe.value="cat",Xe.value==="cat"?ze=requestAnimationFrame(Tt):(se.value=5,he.value=95,ye.value="bark-both",Oe.value=1,He.value=-1,Ue=requestAnimationFrame(Mt)));let nr=Vue.computed(()=>{if(!s.isProcessing)return null;if(s.connectionState!=="connected")return"disconnected";let k=s.currentConversation;if(s.compactStatus?.conversationId===k&&s.compactStatus?.status==="compacting")return"compacting";let F=s.sessionHealth?.[k];return F?F.status:Fe.value&&We.value-Fe.value>8e3?"thinking":null}),ir=Vue.computed(()=>{if(!Fe.value)return"speed-napping";let k=(We.value-Fe.value)%19e3;return k>=16e3?"speed-petted":k>=14e3?"speed-tired":k>=11500?"speed-crazy":k>=9e3?"speed-turbo":k>=6500?"speed-fast":k>=4e3?"speed-normal":"speed-napping"}),rr=Vue.computed(()=>{let k=Y.value,F=fe.value,ue={left:`calc(40px + (100% - 80px) * ${k/100})`};return F<0&&(ue.transform="scaleX(-1)"),ue});function Je(){let k=s.currentConversation;if(!k)return;let F=s.conversations.find(N=>N.id===k);s.sendWsMessage({type:"refresh_conversation",conversationId:k,agentId:F?.agentId})}let An=()=>{if(!o.value)return!0;let{scrollTop:k,scrollHeight:F,clientHeight:N}=o.value;return es({scrollTop:k,scrollHeight:F,clientHeight:N,threshold:J})},Os=(k,F=0,{allowContinuation:N=!1}={})=>{if(k>qd(F)){oe=!0;return}N&&(oe=!0),!(!oe||!Bt())&&(oe=!1,Tn())},or=k=>{if(!k)return"";let N=(Array.isArray(k.items)?k.items:[])[0]||null;return[k.type||"",k.messageId||"",k.turnId||"",k.vpId||"",N?.id||"",N?.turnId||"",N?.messageId||""].join(":")},Ht=()=>{let k=Ce.value||[];return{blockCount:k.length,firstBlockIdentity:or(k[0])}},xn=(k,F)=>!k||!F?!1:F.blockCount>k.blockCount||F.firstBlockIdentity!==k.firstBlockIdentity,Hs=k=>{Vue.nextTick(()=>{if(!o.value)return;let F=Ht();xn(k,F)&&Os(o.value.scrollTop||0,o.value.clientHeight||0,{allowContinuation:!0})})},ar=({scrollTop:k,scrollHeight:F,clientHeight:N})=>{let ue=es({scrollTop:k,scrollHeight:F,clientHeight:N,threshold:J});return ae.value=ue,W.value=!ue,ue},Nt=()=>{W.value=!1,ae.value=!0,a.value?.setBottomFollowEnabled?.(!0)},ls=()=>{W.value=!0,ae.value=!1,a.value?.setBottomFollowEnabled?.(!1),a.value?.cancelPendingBottomFollow?.()},lr=({scrollTop:k,scrollHeight:F,clientHeight:N})=>{let ue=es({scrollTop:k||0,scrollHeight:F||0,clientHeight:N||0,threshold:J});ae.value=Wd({following:!W.value,atBottom:ue}),W.value=!ae.value,a.value?.setBottomFollowEnabled?.(ae.value),vt||(Pt=Number(k||0)),Os(k||0,N||0)},cr=(k,F)=>{let N=Ht();if(!o.value){k(),Hs(N);return}let ue=o.value.scrollHeight,we=o.value.scrollTop,ne=!1,Ee=null,Ne=()=>{ne||(ne=!0,Ee&&Ee(),Vue.nextTick(()=>{if(!o.value)return;let be=o.value.scrollHeight;o.value.scrollTop=be-ue+we,Hs(N)}))};F&&(Ee=Vue.watch(F,be=>{be||Ne()})),k(),Vue.nextTick(()=>{(!F||!F())&&Ne()})},dr=()=>{if(s.hasHiddenYeaftMessages){s.expandYeaftMessageWindow();return}s.loadMoreYeaftHistory()},Bt=()=>s.currentView==="yeaft"?s.hasHiddenYeaftMessages||s.yeaftHasMoreHistory&&!s.yeaftLoadingMoreHistory&&s.yeaftOldestLoadedSeq!=null:!!s.currentConversation&&s.hasMoreMessages&&!s.loadingMoreMessages,Tn=()=>{if(!Bt())return;let k=s.currentView==="yeaft";cr(k?dr:()=>s.loadMoreMessages(),k?()=>s.yeaftLoadingMoreHistory:()=>s.loadingMoreMessages)},vt=!1,qt=!1,rt=null,Pt=0,ur=250,Ns=()=>{vt=!1,rt&&(clearTimeout(rt),rt=null)},cs=()=>{qt||(rt&&clearTimeout(rt),rt=setTimeout(Ns,ur))},ds=k=>{vt=!0,a.value?.clearTargetAnchor?.(),Pt=Number(o.value?.scrollTop||0),Number(k?.deltaY)<0&&ls(),cs()},Mn=k=>{zd(k,o.value)&&(qt=!0,vt=!0,a.value?.clearTargetAnchor?.(),Pt=Number(o.value?.scrollTop||0),rt&&(clearTimeout(rt),rt=null))},us=()=>{qt=!1,cs()},Pn=k=>{jd(k,o.value)&&((k.key==="ArrowUp"||k.key==="PageUp"||k.key==="Home")&&ls(),vt=!0,a.value?.clearTargetAnchor?.(),cs())},Dn=()=>{let k=Number(o.value?.scrollTop||0),F=vt?k-Pt:0,N=!W.value;Pt=k;let ue=An(),we=es({scrollTop:k,scrollHeight:o.value?.scrollHeight||0,clientHeight:o.value?.clientHeight||0,threshold:de});ae.value=Ud({following:N,atBottom:ue,resumeBoundaryReached:we,direction:F}),W.value=!ae.value,a.value?.setBottomFollowEnabled?.(ae.value),ae.value&&Bs(),vt&&cs(),o.value&&Os(o.value.scrollTop||0,o.value.clientHeight||0)},Bs=()=>{s.currentView==="yeaft"&&s.pruneYeaftMessageWindow()},ps=()=>{o.value&&(o.value.scrollTop=o.value.scrollHeight,Nt(),Bs())},Wt=()=>{Nt(),Vue.nextTick(ps)},Dt=()=>{!W.value&&ae.value&&(Bs(),Vue.nextTick(ps))},_n=k=>{if(!k)return"";if(Array.isArray(k.items))return k.items.map(_n).join(",");let F=k.message||{};return[k.type||"",k.id||"",k.atMessageId||"",k.turnId||"",k.messageId||"",k.speakerVpId||"",F.id||"",F.content?String(F.content).length:0,k.textContent?String(k.textContent).length:0,k.isStreaming||F.isStreaming?"streaming":"done"].join(":")},pr=Vue.computed(()=>{let k=Ce.value||[];return[s.activeConversationId||"",U.value||"",_n(k[k.length-1])].join("|")});Vue.watch(()=>[s.currentConversation,_.value.length,n.token],()=>{let k=n.token||"";k!==te&&(te=k,me()),M()},{immediate:!0}),Vue.watch(pr,Dt),Vue.watch(In,k=>{k&&Dt()}),Vue.watch(()=>[s.activeConversationId,U.value],()=>{for(let k of Object.keys(l))delete l[k];for(let k of Object.keys(c))delete c[k];for(let k of Object.keys(d))delete d[k];Nt(),Vue.nextTick(ps)});let qs=Vue.ref(null),En=0;return t({revealMessage:async k=>k?(ls(),await nu({blocks:Ce.value,messageId:k,collapseStates:d,nextTick:Vue.nextTick,scrollToBlock:(N,ue)=>(ls(),a.value?.scrollToKey?.(N,ue)),findRow:N=>{let ue=o.value?.querySelectorAll?.("[data-msg-id]")||[];return Array.from(ue).find(we=>we?.dataset?.msgId===N)||null},anchorRow:(N,ue,we,ne)=>a.value?.anchorTarget?.(N,we,ne),flashRow:N=>{let ue=++En;qs.value=N,setTimeout(()=>{ue===En&&(qs.value=null)},1800)}})):!1}),Vue.onMounted(()=>{ps(),o.value&&(o.value.addEventListener("wheel",ds,{passive:!0}),o.value.addEventListener("touchmove",ds,{passive:!0}),o.value.addEventListener("pointerdown",Mn,{passive:!0}),o.value.addEventListener("scroll",Dn)),window.addEventListener("pointerup",us,{passive:!0}),window.addEventListener("pointercancel",us,{passive:!0}),window.addEventListener("keydown",Pn)}),Vue.onUnmounted(()=>{o.value&&(o.value.removeEventListener("wheel",ds),o.value.removeEventListener("touchmove",ds),o.value.removeEventListener("pointerdown",Mn),o.value.removeEventListener("scroll",Dn)),window.removeEventListener("pointerup",us),window.removeEventListener("pointercancel",us),window.removeEventListener("keydown",Pn),Ns(),Ke&&(clearInterval(Ke),Ke=null),Ze&&(clearTimeout(Ze),Ze=null),ze&&(cancelAnimationFrame(ze),ze=null),Ue&&(cancelAnimationFrame(Ue),Ue=null)}),{store:s,containerRef:o,virtualTranscriptRef:a,flashMsgId:qs,hasStreamingMessage:Me,nowMs:dt,showTypingDots:xt,showInitialMessagesLoading:_e,showSessionLoadingOverlay:qe,initialMessagesLoadingText:Ve,previewShowTypingDots:In,isPreviewMode:Vs,waitingStatus:nr,animationType:Xe,catSpeed:ir,catStyle:rr,dogPhase:ye,spikeTransform:Qi,teddyTransform:Xi,leashPathL:Zi,leashPathR:Sn,leashOpacityL:Ji,leashOpacityR:er,questionLX:tr,questionRX:sr,refreshSession:Je,onlineAgents:_,welcomeInstallCommand:pe,welcomeLlmCommand:ve,welcomeServiceCommand:ie,welcomeSetupLoading:D,welcomeSetupError:B,copyWelcomeCommand:j,turnGroups:ge,messageBlocks:Ce,virtualTranscriptIdentity:V,estimateMessageBlockHeight:b,visibleItemsForBlock:h,collapsedResponsePreviewLines:A,collapsedResponsePreviewSpeaker:w,responseToggleBelongsToItem:v,showBlockResponseToggle:m,toggleMessageTurnResponse:y,responseCollapseLabel:E,turnUiKey:u,assistantTurnActionsExpandedFor:f,setAssistantTurnActionsExpanded:p,toolExpandStates:c,setToolExpanded:g,cardsForRow:K,orphanCards:x,subAgentCardsForRow:q,orphanSubAgentCards:Z,useImStyleForUser:L,onClickLoadMore:Tn,onVirtualTranscriptScrollState:lr,isAtBottom:ae,scrollToLatest:Wt}}}});function Si(...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 au(e,t,s){let n=t?e?.slashCommandsMap?.[t]:null;return e?.currentView==="yeaft"?Si(n):Si(n,s?e?.slashCommandsMap?.[`agent:${s}`]:null,e?.slashCommandsMap?.__preload__)}function eh(e,t={},s=new Set){if(Jm.has(e)||Object.prototype.hasOwnProperty.call(ki,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 lu(e,t={}){if(wi[e])return wi[e];if(ki[e])return ki[e];let s=e.startsWith("/")?e.slice(1):e;return t[s]?t[s]:th(s)}function th(e){return(e.includes(":")?e.split(":").pop():e).replace(/-/g," ").replace(/^\w/,s=>s.toUpperCase())}function cu(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=eh(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)=>(iu[o]??99)-(iu[a]??99));return r.map((o,a)=>({label:sh[o]||o,items:i[o],isLast:a===r.length-1}))}var wi,Jm,ru,ki,ou,sh,iu,du=H(()=>{wi={"/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"},Jm=new Set(Object.keys(wi)),ru=Object.keys(wi),ki={"/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"},ou=Object.keys(ki);sh={skill:"Skills",builtin:"Built-in",project:"Commands"},iu={skill:0,project:1,builtin:2}});function oh(e){return!(!e||typeof e!="string"||e.length<1||e.length>40||e.startsWith("_")||ih.test(e)||nh.has(e.toLowerCase()))}function Ci(e){if(!e||typeof e!="string")return{text:e||"",mentions:[]};let t=new Set;uu.lastIndex=0;let s;for(;(s=uu.exec(e))!==null;){let n=s[2];if(oh(n)&&!t.has(n)&&(t.add(n),t.size>=rh))break}return{text:e,mentions:Array.from(t)}}var nh,uu,ih,rh,To=H(()=>{nh=new Set(["all","user","system","everyone"]),uu=/(^|[\s\p{P}])@([A-Za-z0-9_-]{1,40})(?=$|[\s\p{P}])/gu,ih=/^[0-9]+$/,rh=32});function pu(e){let t=typeof e?.vpId=="string"?e.vpId:"";return Mo.has(t)?Mo.get(t):e?.isStock===!0?"other":"custom"}function ss(e){let t=new Map(Ii.map(s=>[s.id,[]]));for(let s of Array.isArray(e)?e:[])!s||typeof s.vpId!="string"||!s.vpId||t.get(pu(s)).push(s);return Ii.map(s=>({id:s.id,labelKey:s.labelKey,vps:t.get(s.id)})).filter(s=>s.vps.length>0)}function fn(e){return ss(e).flatMap(t=>t.vps)}function fu(e){let t=new Map(Ii.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=pu(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 ah,Ii,Mo,gn=H(()=>{ah=[{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:[]}],Ii=Object.freeze(ah.map(e=>Object.freeze({id:e.id,labelKey:e.labelKey,vpIds:Object.freeze([...e.vpIds])}))),Mo=new Map;for(let e of Ii)for(let t of e.vpIds)Mo.set(t,e.id)});function Po(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 fn(c).slice(0,gu)}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:[],f=!1;for(let S of u){let v=String(S||"").toLowerCase();if(v&&v.startsWith(n)){f=!0;break}}if(f){l(c,r);continue}let p=String(c.displayName||"").toLowerCase(),g=String(c.displayNameZh||""),b=[c.description,c.descriptionZh,c.role,c.roleZh].map(S=>String(S||"").toLowerCase()),h=typeof t=="string"?t:"",A=p.includes(n)||h&&g.includes(h),w=n&&b.some(S=>S.includes(n));(A||w)&&l(c,o)}return[...fn(i),...fn(r),...fn(o)].slice(0,gu)}function Do(e="chat-input"){return`${e}-vp-mention-listbox`}function _o(e,t){let s=String(t||"").replace(/[^A-Za-z0-9_.:-]/g,"-");return`${e}-vp-mention-option-${s}`}function lh(e){let t=0;return fu(e).map(s=>({...s,items:s.vps.map(n=>({vp:n,flatIndex:t++}))}))}function mu(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 hu(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 gu,vu,yu=H(()=>{gn();gu=12;vu={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:`
1685
+ `,emits:["new-conversation","resume-conversation","open-settings","quote-message","edit-message-as-new"],setup(e,{expose:t}){let s=Pinia.useChatStore(),n=xe(),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=k=>String(k?.id||k?.turnId||k?.messageId||k?.atMessageId||k?.message?.id||"turn_unknown"),f=k=>{let F=u(k);return Object.prototype.hasOwnProperty.call(l,F)?!!l[F]:!1},p=(k,F)=>{l[u(k)]=!!F},g=({key:k,value:F}={})=>{k&&(c[k]=!!F)},b=k=>{let F=Jd(k,Vt);return Number.isFinite(F)?F:Vt(k)},h=k=>yi(k),A=k=>{let F=Array.isArray(k?.collapsedResponsePreview)?k.collapsedResponsePreview:Zd(k);return Array.isArray(F)?F:F?[String(F)]:[]},w=k=>{let F=Array.isArray(k?.items)?k.items.find(be=>pn(be)):null,N=F?.speakerVpId||F?.vpId||F?.message?.speakerVpId||F?.message?.vpId||k?.vpId||"",ue=N&&i&&typeof i.vpLabel=="function"?i.vpLabel(N)||N:N||(typeof r=="function"?r("message.assistant"):"Assistant"),we=N&&i&&typeof i.vpTextColor=="function"?{color:i.vpTextColor(N)}:{},ne=F?.speakerTimestamp||F?.timestamp||F?.createdAt||F?.message?.timestamp||F?.message?.createdAt||0,Ee="",Ne="";if(ne)try{let be=new Date(ne);Number.isNaN(be.getTime())||(Ee=ft(ne),Ne=be.toLocaleString())}catch{}return{name:ue,style:we,timeText:Ee,fullTimeText:Ne}},S=k=>{let F=Array.isArray(k?.items)?k.items:[];for(let N=F.length-1;N>=0;N-=1)if(pn(F[N]))return F[N];return null},v=(k,F)=>!k?.responseCollapsible||!F?!1:S(k)===F,m=k=>!!(k?.responseCollapsible&&!yi(k).some(F=>v(k,F))),y=k=>{let F=k?.responseCollapseKey;F&&(d[F]=!k.responseCollapsed)},E=k=>{let F=Number(k?.responseCount||0),N=k?.responseCollapsed?"message.showResponses":"message.hideResponses",ue=(typeof r=="function"?r(N):"")||(k?.responseCollapsed?"Show {count} response(s)":"Hide response(s)");return String(ue).replace("{count}",String(F))},$=(()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}}),U=Vue.computed(()=>{if(s.currentView!=="yeaft")return null;let k=$();if(!k)return null;let F=s.yeaftActiveSessionFilter||null;return F&&typeof k.sessionById=="function"&&k.sessionById(F,s.currentAgent||null)?F:k.activeSessionId&&typeof k.sessionById=="function"&&k.sessionById(k.activeSessionId,s.currentAgent||null)?k.activeSessionId:null}),V=Vue.computed(()=>[s.activeConversationId||"",s.currentView||"",s.currentAgent||"",s.currentView==="yeaft"?s.yeaftActiveSessionFilter||U.value||"__all__":""].join("")),L=Vue.computed(()=>U.value!==null),_=Vue.computed(()=>s.agents.filter(k=>k.online)),P=Vue.ref(null),I=Vue.ref(null),D=Vue.ref(!1),B=Vue.ref(""),O=null,z=0,te=n.token||"",me=()=>{P.value=null,I.value=null,B.value="",O=null,z+=1},pe=ai(),ve=li(),ie=Vue.computed(()=>ci({profile:P.value,agentSecret:I.value,serverWsUrl:rn(location)})),ke=()=>{let k={"Content-Type":"application/json"};return n.token&&(k.Authorization=`Bearer ${n.token}`),k},M=async()=>{if(_.value.length>0||s.currentConversation)return;if(I.value||O)return O;D.value=!0,B.value="";let k=++z;return O=(async()=>{let F=n.token||"",N=ke(),[ue,we]=await Promise.all([fetch("/api/user/profile",{headers:N}),fetch("/api/user/agent-secret",{headers:N})]),ne=ue.ok?await ue.json():null;if(k!==z||F!==(n.token||""))return;if(ne&&(P.value=ne),!we.ok){let be="";try{be=(await we.json())?.error||""}catch{}throw new Error(be||"Failed to load Agent secret")}let Ee=await we.json();if(k!==z||F!==(n.token||""))return;let Ne=Ee?.agentSecret||Ee?.agent_secret||null;I.value=Ne&&String(Ne).trim()?String(Ne):null})().catch(F=>{k===z&&(B.value=F?.message||"Failed to load Agent secret")}).finally(()=>{k===z&&(D.value=!1,O=null)}),O},j=async k=>{if(k)try{await navigator.clipboard.writeText(k)}catch{}},re=(k,F)=>{let N=k?.message||null,ue=k?.id||k?.atMessageId||N?.id||N?.messageId||`legacy_${F}`,we=k?.speakerVpId||k?.vpId||N?.speakerVpId||N?.vpId||"";return{id:`message_${we||"user"}_${ue}_${F}`,vpId:we,messageId:ue}},ge=Vue.computed(()=>{let k=s.messages,F=[],N=null,ue=0,we=()=>{if(N){N.isActive=!!(N.turnId&&s.activeVpTurns?.[N.turnId]),Kn(N);let be=!!(N.textContent||N.todoMsg||N.askMsg||N.imageMsgs.length>0),le=N.toolMsgs.length>0||N.toolSummaryCount>0;(be||le)&&(N.showSpeakerHeader=!!N.speakerVpId,F.push(N)),N=null}},ne=be=>{if(N){if(!N.speakerVpId){let le=be.speakerVpId||be.vpId;le&&(N.speakerVpId=le,N.speakerTimestamp=typeof be.timestamp=="number"&&be.timestamp>0?be.timestamp:typeof be.createdAt=="number"?be.createdAt:0,typeof be.lastStateChangeCause=="string"&&!N.speakerStateCause&&(N.speakerStateCause=be.lastStateChangeCause))}!N.turnId&&be.turnId&&(N.turnId=be.turnId)}},Ee=()=>{ue++,N={type:"assistant-turn",id:"turn_"+ue,textContent:"",textSegments:[],isStreaming:!1,isActive:!1,isHistory:!1,todoMsg:null,toolMsgs:[],toolSummaryCount:0,imageMsgs:[],askMsg:null,messages:[],atMessageId:null,speakerVpId:null,speakerTimestamp:0,speakerStateCause:"",showSpeakerHeader:!1,turnId:null}},Ne=be=>{Yd(N,be)&&we()};for(let be=0;be<k.length;be++){let le=k[be];if(le.type==="user"){if(!le.content||!le.content.trim())continue;we(),F.push({type:"user",id:le.id||"u_"+be,message:le});continue}if(le.type==="system"||le.type==="error"){we(),F.push({type:le.type,id:le.id||"s_"+be,message:le});continue}if(!(le.type==="tool-result"||le.type==="tool_result")){if(le.type==="tool-summary"){Ne(le),N||Ee(),ne(le),le.isHistory&&(N.isHistory=!0),N.toolSummaryCount+=Number(le.count||le.omittedCount||0)||0,N.messages.push(le);continue}if(le.type==="assistant"){Ne(le),N||Ee(),jn(N,le),le.isStreaming&&(N.isStreaming=!0),le.isHistory&&(N.isHistory=!0),le.id&&/^m\d+$/.test(le.id)&&(N.atMessageId=le.id),ne(le),N.messages.push(le);continue}if(le.type==="tool-use"){Ne(le),N||Ee(),ne(le);let _t=k[be+1],fr=_t&&(_t.type==="tool-result"||_t.type==="tool_result"),fs={...le,hasResult:fr||le.hasResult||!1,toolResult:le.toolResult||null};le.isHistory&&(N.isHistory=!0),le.toolName==="TodoWrite"?N.todoMsg=fs:le.toolName==="AskUserQuestion"?N.askMsg=fs:N.toolMsgs.push(fs),N.messages.push(le);continue}if(le.type==="chat-image"){Ne(le),N||Ee(),ne(le),le.isHistory&&(N.isHistory=!0),N.imageMsgs.push(le),N.messages.push(le);continue}we(),F.push({type:le.type||"unknown",id:le.id||"x_"+be,message:le})}}return we(),F}),Ce=Vue.computed(()=>{let k=[],F=null,N=()=>{F&&k.push(F),F=null};return ge.value.forEach((ue,we)=>{if(!ue||ue.type==="system"||ue.type==="error"){N(),k.push(ue);return}let ne=re(ue,we);if(ue.type==="user"||!F){N(),F={type:"message-block",id:`turn_${ne.messageId}_${we}`,vpId:ne.vpId,messageId:ne.messageId,items:[ue]};return}F.items.push(ue),!F.vpId&&ne.vpId&&(F.vpId=ne.vpId)}),N(),k}),De=Vue.computed(()=>{let k=s.yeaftReflectionCards||{},F=s.yeaftConversationId,N={__orphans:[]},ue=Object.values(k).filter(ne=>ne&&ne.conversationId===F).sort((ne,Ee)=>(ne.anchorOrder||0)-(Ee.anchorOrder||0)||(ne.updatedAt||0)-(Ee.updatedAt||0)),we=new Set;for(let ne of s.messages||[])ne&&ne.id&&we.add(ne.id);for(let ne of ue)ne.anchorMsgId&&we.has(ne.anchorMsgId)?(N[ne.anchorMsgId]||(N[ne.anchorMsgId]=[]),N[ne.anchorMsgId].push(ne)):N.__orphans.push(ne);return N}),ee=k=>k?k.type==="assistant-turn"?k.atMessageId||null:k.message&&k.message.id||null:null,K=k=>{let F=ee(k);return F?(De.value||{})[F]||[]:[]},x=Vue.computed(()=>(De.value||{}).__orphans||[]),T=Vue.computed(()=>{let k=s.yeaftSubAgentCards||{},F=s.yeaftConversationId,N={__orphans:[]},ue=Object.values(k).filter(ne=>ne&&ne.conversationId===F).sort((ne,Ee)=>(ne.anchorOrder||0)-(Ee.anchorOrder||0)||(ne.updatedAt||0)-(Ee.updatedAt||0)),we=new Set;for(let ne of s.messages||[])ne&&ne.id&&we.add(ne.id);for(let ne of ue)ne.anchorMsgId&&we.has(ne.anchorMsgId)?(N[ne.anchorMsgId]||(N[ne.anchorMsgId]=[]),N[ne.anchorMsgId].push(ne)):N.__orphans.push(ne);return N}),q=k=>{let F=ee(k);return F?(T.value||{})[F]||[]:[]},Z=Vue.computed(()=>(T.value||{}).__orphans||[]),ae=Vue.ref(!0),W=Vue.ref(!1),J=It.bottomThreshold,de=It.resumeBottomThreshold,oe=!0,Me=Vue.computed(()=>s.messages.some(k=>k.isStreaming)),_e=Vue.computed(()=>!s.currentConversation||Ce.value.length>0?!1:s.currentView==="yeaft"?!!s.yeaftLoadingMoreHistory:!!s.sessionLoading),Ve=Vue.computed(()=>s.sessionLoadingText||""),qe=Vue.computed(()=>!!s.sessionLoading&&!_e.value),xt=Vue.computed(()=>s.isProcessing&&!Me.value),dt=Vue.ref(Date.now()),ut=null,$s=()=>{ut||(ut=setInterval(()=>{dt.value=Date.now()},1e3))},ht=()=>{ut&&(clearInterval(ut),ut=null)};Vue.watch(Me,k=>{k?(dt.value=Date.now(),$s()):ht()},{immediate:!0}),Vue.onBeforeUnmount(()=>ht());let Fe=Vue.ref(0),We=Vue.ref(Date.now()),Ke=null,ze=null,Xe=Vue.ref("cat"),R=new URLSearchParams(window.location.search).get("preview"),Y=Vue.ref(0),fe=Vue.ref(1),se=Vue.ref(5),he=Vue.ref(95),ye=Vue.ref("bark-both"),Oe=Vue.ref(1),He=Vue.ref(-1),Ue=null;function Tt(){if(!Fe.value)return;We.value=Date.now();let k=(We.value-Fe.value)%19e3;if(k<4e3)Y.value=0,fe.value=1;else if(k<11500){let F=k-4e3,N;F<2500?N=F/2500*16:F<5e3?N=16+(F-2500)/2500*29:N=45+(F-5e3)/2500*55,Y.value=N,fe.value=1}else k<14e3?(Y.value=(1-(k-11500)/2500)*100,fe.value=-1):(Y.value=0,fe.value=1);ze=requestAnimationFrame(Tt)}function Mt(){if(!Fe.value||Xe.value!=="dog")return;We.value=Date.now();let k=(We.value-Fe.value)%18e3;if(k<2e3)se.value=5,he.value=95,ye.value="bark-both",Oe.value=1,He.value=-1;else if(k<5e3){let F=(k-2e3)/3e3;se.value=5+F*25,he.value=95,ye.value="left-approach",Oe.value=1,He.value=-1}else if(k<8e3){let F=(k-5e3)/3e3;se.value=30,he.value=95-F*25,ye.value="right-approach",Oe.value=1,He.value=-1}else if(k<1e4){let F=(k-8e3)/2e3;se.value=30+F*13,he.value=70-F*13,ye.value="both-approach",Oe.value=1,He.value=-1}else if(k<11e3)se.value=43,he.value=57,ye.value="snap",Oe.value=1,He.value=-1;else if(k<12500)se.value=43,he.value=57,ye.value="stunned",Oe.value=1,He.value=-1;else if(k<15e3){let F=(k-12500)/2500;se.value=43-F*38,he.value=57+F*38,ye.value="retreat",Oe.value=-1,He.value=1}else k<17e3?(se.value=5,he.value=95,ye.value="rehang",Oe.value=-1,He.value=1):(se.value=5,he.value=95,ye.value="reset",Oe.value=1,He.value=-1);Ue=requestAnimationFrame(Mt)}let Qi=Vue.computed(()=>{let k=se.value*1.2;return Oe.value<0?`translate(${k+13.5}, 0) scale(-1, 1)`:`translate(${k-13.5}, 0)`}),Xi=Vue.computed(()=>{let k=he.value*1.2;return He.value>0?`translate(${k-10.5}, 2)`:`translate(${k+10.5}, 2) scale(-1, 1)`}),kn=Vue.computed(()=>{let k=ye.value;return k==="bark-both"||k==="left-approach"||k==="right-approach"||k==="both-approach"||k==="reset"}),Zi=Vue.computed(()=>{let k=se.value*1.2,F=10;if(kn.value){let we=Math.max(0,(k-3)*.12);return`M3,18 Q${(3+k)/2},${18+we} ${k},${F}`}if(ye.value==="rehang")return`M${k},${F} Q${k-3},20 3,18`;let N=Oe.value<0?1:-1,ue=k+N*8;return`M${k},${F} Q${k},18 ${ue},22`}),Sn=Vue.computed(()=>{let k=he.value*1.2,F=10;if(kn.value){let we=Math.max(0,(118-k)*.12);return`M118,18 Q${(118+k)/2},${18+we} ${k},${F}`}if(ye.value==="rehang")return`M${k},${F} Q${k+3},20 118,18`;let N=He.value>0?-1:1,ue=k+N*8;return`M${k},${F} Q${k},18 ${ue},22`}),Ji=Vue.computed(()=>ye.value==="snap"?.2:.4),er=Vue.computed(()=>ye.value==="snap"?.2:.4),tr=Vue.computed(()=>se.value*1.2),sr=Vue.computed(()=>he.value*1.2),Vs=R==="cat"||R==="dog"||R==="animation",Cn=600,Fs=Vue.ref(!1),Ze=null,In=Vue.computed(()=>Vs?!0:Fs.value);Vue.watch(xt,k=>{if(k)Ze&&(clearTimeout(Ze),Ze=null),Fs.value=!0,Fe.value=Date.now(),We.value=Date.now(),Xe.value="cat",Y.value=0,fe.value=1,se.value=5,he.value=95,ye.value="bark-both",Oe.value=1,He.value=-1,Xe.value==="cat"?ze=requestAnimationFrame(Tt):Ue=requestAnimationFrame(Mt);else{let F=Fe.value?Date.now()-Fe.value:Cn,N=Math.max(0,Cn-F),ue=()=>{Ze=null,Fs.value=!1,Fe.value=0,Y.value=0,fe.value=1,ze&&(cancelAnimationFrame(ze),ze=null),Ue&&(cancelAnimationFrame(Ue),Ue=null)};N===0?ue():(Ze&&clearTimeout(Ze),Ze=setTimeout(ue,N))}},{immediate:!0}),Vs&&(Fe.value=Date.now(),We.value=Date.now(),R==="dog"?Xe.value="dog":Xe.value="cat",Xe.value==="cat"?ze=requestAnimationFrame(Tt):(se.value=5,he.value=95,ye.value="bark-both",Oe.value=1,He.value=-1,Ue=requestAnimationFrame(Mt)));let nr=Vue.computed(()=>{if(!s.isProcessing)return null;if(s.connectionState!=="connected")return"disconnected";let k=s.currentConversation;if(s.compactStatus?.conversationId===k&&s.compactStatus?.status==="compacting")return"compacting";let F=s.sessionHealth?.[k];return F?F.status:Fe.value&&We.value-Fe.value>8e3?"thinking":null}),ir=Vue.computed(()=>{if(!Fe.value)return"speed-napping";let k=(We.value-Fe.value)%19e3;return k>=16e3?"speed-petted":k>=14e3?"speed-tired":k>=11500?"speed-crazy":k>=9e3?"speed-turbo":k>=6500?"speed-fast":k>=4e3?"speed-normal":"speed-napping"}),rr=Vue.computed(()=>{let k=Y.value,F=fe.value,ue={left:`calc(40px + (100% - 80px) * ${k/100})`};return F<0&&(ue.transform="scaleX(-1)"),ue});function Je(){let k=s.currentConversation;if(!k)return;let F=s.conversations.find(N=>N.id===k);s.sendWsMessage({type:"refresh_conversation",conversationId:k,agentId:F?.agentId})}let An=()=>{if(!o.value)return!0;let{scrollTop:k,scrollHeight:F,clientHeight:N}=o.value;return es({scrollTop:k,scrollHeight:F,clientHeight:N,threshold:J})},Os=(k,F=0,{allowContinuation:N=!1}={})=>{if(k>qd(F)){oe=!0;return}N&&(oe=!0),!(!oe||!Bt())&&(oe=!1,Tn())},or=k=>{if(!k)return"";let N=(Array.isArray(k.items)?k.items:[])[0]||null;return[k.type||"",k.messageId||"",k.turnId||"",k.vpId||"",N?.id||"",N?.turnId||"",N?.messageId||""].join(":")},Ht=()=>{let k=Ce.value||[];return{blockCount:k.length,firstBlockIdentity:or(k[0])}},xn=(k,F)=>!k||!F?!1:F.blockCount>k.blockCount||F.firstBlockIdentity!==k.firstBlockIdentity,Hs=k=>{Vue.nextTick(()=>{if(!o.value)return;let F=Ht();xn(k,F)&&Os(o.value.scrollTop||0,o.value.clientHeight||0,{allowContinuation:!0})})},ar=({scrollTop:k,scrollHeight:F,clientHeight:N})=>{let ue=es({scrollTop:k,scrollHeight:F,clientHeight:N,threshold:J});return ae.value=ue,W.value=!ue,ue},Nt=()=>{W.value=!1,ae.value=!0,a.value?.setBottomFollowEnabled?.(!0)},ls=()=>{W.value=!0,ae.value=!1,a.value?.setBottomFollowEnabled?.(!1),a.value?.cancelPendingBottomFollow?.()},lr=({scrollTop:k,scrollHeight:F,clientHeight:N})=>{let ue=es({scrollTop:k||0,scrollHeight:F||0,clientHeight:N||0,threshold:J});ae.value=Wd({following:!W.value,atBottom:ue}),W.value=!ae.value,a.value?.setBottomFollowEnabled?.(ae.value),vt||(Pt=Number(k||0)),Os(k||0,N||0)},cr=(k,F)=>{let N=Ht();if(!o.value){k(),Hs(N);return}let ue=o.value.scrollHeight,we=o.value.scrollTop,ne=!1,Ee=null,Ne=()=>{ne||(ne=!0,Ee&&Ee(),Vue.nextTick(()=>{if(!o.value)return;let be=o.value.scrollHeight;o.value.scrollTop=be-ue+we,Hs(N)}))};F&&(Ee=Vue.watch(F,be=>{be||Ne()})),k(),Vue.nextTick(()=>{(!F||!F())&&Ne()})},dr=()=>{if(s.hasHiddenYeaftMessages){s.expandYeaftMessageWindow();return}s.loadMoreYeaftHistory()},Bt=()=>s.currentView==="yeaft"?s.hasHiddenYeaftMessages||s.yeaftHasMoreHistory&&!s.yeaftLoadingMoreHistory&&s.yeaftOldestLoadedSeq!=null:!!s.currentConversation&&s.hasMoreMessages&&!s.loadingMoreMessages,Tn=()=>{if(!Bt())return;let k=s.currentView==="yeaft";cr(k?dr:()=>s.loadMoreMessages(),k?()=>s.yeaftLoadingMoreHistory:()=>s.loadingMoreMessages)},vt=!1,qt=!1,rt=null,Pt=0,ur=250,Ns=()=>{vt=!1,rt&&(clearTimeout(rt),rt=null)},cs=()=>{qt||(rt&&clearTimeout(rt),rt=setTimeout(Ns,ur))},ds=k=>{vt=!0,a.value?.clearTargetAnchor?.(),Pt=Number(o.value?.scrollTop||0),Number(k?.deltaY)<0&&ls(),cs()},Mn=k=>{zd(k,o.value)&&(qt=!0,vt=!0,a.value?.clearTargetAnchor?.(),Pt=Number(o.value?.scrollTop||0),rt&&(clearTimeout(rt),rt=null))},us=()=>{qt=!1,cs()},Pn=k=>{jd(k,o.value)&&((k.key==="ArrowUp"||k.key==="PageUp"||k.key==="Home")&&ls(),vt=!0,a.value?.clearTargetAnchor?.(),cs())},Dn=()=>{let k=Number(o.value?.scrollTop||0),F=vt?k-Pt:0,N=!W.value;Pt=k;let ue=An(),we=es({scrollTop:k,scrollHeight:o.value?.scrollHeight||0,clientHeight:o.value?.clientHeight||0,threshold:de});ae.value=Ud({following:N,atBottom:ue,resumeBoundaryReached:we,direction:F}),W.value=!ae.value,a.value?.setBottomFollowEnabled?.(ae.value),ae.value&&Bs(),vt&&cs(),o.value&&Os(o.value.scrollTop||0,o.value.clientHeight||0)},Bs=()=>{s.currentView==="yeaft"&&s.pruneYeaftMessageWindow()},ps=()=>{o.value&&(o.value.scrollTop=o.value.scrollHeight,Nt(),Bs())},Wt=()=>{Nt(),Vue.nextTick(ps)},Dt=()=>{!W.value&&ae.value&&(Bs(),Vue.nextTick(ps))},_n=k=>{if(!k)return"";if(Array.isArray(k.items))return k.items.map(_n).join(",");let F=k.message||{};return[k.type||"",k.id||"",k.atMessageId||"",k.turnId||"",k.messageId||"",k.speakerVpId||"",F.id||"",F.content?String(F.content).length:0,k.textContent?String(k.textContent).length:0,k.isStreaming||F.isStreaming?"streaming":"done"].join(":")},pr=Vue.computed(()=>{let k=Ce.value||[];return[s.activeConversationId||"",U.value||"",_n(k[k.length-1])].join("|")});Vue.watch(()=>[s.currentConversation,_.value.length,n.token],()=>{let k=n.token||"";k!==te&&(te=k,me()),M()},{immediate:!0}),Vue.watch(pr,Dt),Vue.watch(In,k=>{k&&Dt()}),Vue.watch(()=>[s.activeConversationId,U.value],()=>{for(let k of Object.keys(l))delete l[k];for(let k of Object.keys(c))delete c[k];for(let k of Object.keys(d))delete d[k];Nt(),Vue.nextTick(ps)});let qs=Vue.ref(null),En=0;return t({revealMessage:async k=>k?(ls(),await nu({blocks:Ce.value,messageId:k,collapseStates:d,nextTick:Vue.nextTick,scrollToBlock:(N,ue)=>(ls(),a.value?.scrollToKey?.(N,ue)),findRow:N=>{let ue=o.value?.querySelectorAll?.("[data-msg-id]")||[];return Array.from(ue).find(we=>we?.dataset?.msgId===N)||null},anchorRow:(N,ue,we,ne)=>a.value?.anchorTarget?.(N,we,ne),flashRow:N=>{let ue=++En;qs.value=N,setTimeout(()=>{ue===En&&(qs.value=null)},1800)}})):!1}),Vue.onMounted(()=>{ps(),o.value&&(o.value.addEventListener("wheel",ds,{passive:!0}),o.value.addEventListener("touchmove",ds,{passive:!0}),o.value.addEventListener("pointerdown",Mn,{passive:!0}),o.value.addEventListener("scroll",Dn)),window.addEventListener("pointerup",us,{passive:!0}),window.addEventListener("pointercancel",us,{passive:!0}),window.addEventListener("keydown",Pn)}),Vue.onUnmounted(()=>{o.value&&(o.value.removeEventListener("wheel",ds),o.value.removeEventListener("touchmove",ds),o.value.removeEventListener("pointerdown",Mn),o.value.removeEventListener("scroll",Dn)),window.removeEventListener("pointerup",us),window.removeEventListener("pointercancel",us),window.removeEventListener("keydown",Pn),Ns(),Ke&&(clearInterval(Ke),Ke=null),Ze&&(clearTimeout(Ze),Ze=null),ze&&(cancelAnimationFrame(ze),ze=null),Ue&&(cancelAnimationFrame(Ue),Ue=null)}),{store:s,containerRef:o,virtualTranscriptRef:a,flashMsgId:qs,hasStreamingMessage:Me,nowMs:dt,showTypingDots:xt,showInitialMessagesLoading:_e,showSessionLoadingOverlay:qe,initialMessagesLoadingText:Ve,previewShowTypingDots:In,isPreviewMode:Vs,waitingStatus:nr,animationType:Xe,catSpeed:ir,catStyle:rr,dogPhase:ye,spikeTransform:Qi,teddyTransform:Xi,leashPathL:Zi,leashPathR:Sn,leashOpacityL:Ji,leashOpacityR:er,questionLX:tr,questionRX:sr,refreshSession:Je,onlineAgents:_,welcomeInstallCommand:pe,welcomeLlmCommand:ve,welcomeServiceCommand:ie,welcomeSetupLoading:D,welcomeSetupError:B,copyWelcomeCommand:j,turnGroups:ge,messageBlocks:Ce,virtualTranscriptIdentity:V,estimateMessageBlockHeight:b,visibleItemsForBlock:h,collapsedResponsePreviewLines:A,collapsedResponsePreviewSpeaker:w,responseToggleBelongsToItem:v,showBlockResponseToggle:m,toggleMessageTurnResponse:y,responseCollapseLabel:E,turnUiKey:u,assistantTurnActionsExpandedFor:f,setAssistantTurnActionsExpanded:p,toolExpandStates:c,setToolExpanded:g,cardsForRow:K,orphanCards:x,subAgentCardsForRow:q,orphanSubAgentCards:Z,useImStyleForUser:L,onClickLoadMore:Tn,onVirtualTranscriptScrollState:lr,isAtBottom:ae,scrollToLatest:Wt}}}});function Si(...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 au(e,t,s){let n=t?e?.slashCommandsMap?.[t]:null;return e?.currentView==="yeaft"?Si(n):Si(n,s?e?.slashCommandsMap?.[`agent:${s}`]:null,e?.slashCommandsMap?.__preload__)}function th(e,t={},s=new Set){if(eh.has(e)||Object.prototype.hasOwnProperty.call(ki,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 lu(e,t={}){if(wi[e])return wi[e];if(ki[e])return ki[e];let s=e.startsWith("/")?e.slice(1):e;return t[s]?t[s]:sh(s)}function sh(e){return(e.includes(":")?e.split(":").pop():e).replace(/-/g," ").replace(/^\w/,s=>s.toUpperCase())}function cu(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=th(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)=>(iu[o]??99)-(iu[a]??99));return r.map((o,a)=>({label:nh[o]||o,items:i[o],isLast:a===r.length-1}))}var wi,eh,ru,ki,ou,nh,iu,du=H(()=>{wi={"/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"},eh=new Set(Object.keys(wi)),ru=Object.keys(wi),ki={"/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"},ou=Object.keys(ki);nh={skill:"Skills",builtin:"Built-in",project:"Commands"},iu={skill:0,project:1,builtin:2}});function ah(e){return!(!e||typeof e!="string"||e.length<1||e.length>40||e.startsWith("_")||rh.test(e)||ih.has(e.toLowerCase()))}function Ci(e){if(!e||typeof e!="string")return{text:e||"",mentions:[]};let t=new Set;uu.lastIndex=0;let s;for(;(s=uu.exec(e))!==null;){let n=s[2];if(ah(n)&&!t.has(n)&&(t.add(n),t.size>=oh))break}return{text:e,mentions:Array.from(t)}}var ih,uu,rh,oh,To=H(()=>{ih=new Set(["all","user","system","everyone"]),uu=/(^|[\s\p{P}])@([A-Za-z0-9_-]{1,40})(?=$|[\s\p{P}])/gu,rh=/^[0-9]+$/,oh=32});function pu(e){let t=typeof e?.vpId=="string"?e.vpId:"";return Mo.has(t)?Mo.get(t):e?.isStock===!0?"other":"custom"}function ss(e){let t=new Map(Ii.map(s=>[s.id,[]]));for(let s of Array.isArray(e)?e:[])!s||typeof s.vpId!="string"||!s.vpId||t.get(pu(s)).push(s);return Ii.map(s=>({id:s.id,labelKey:s.labelKey,vps:t.get(s.id)})).filter(s=>s.vps.length>0)}function fn(e){return ss(e).flatMap(t=>t.vps)}function fu(e){let t=new Map(Ii.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=pu(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 lh,Ii,Mo,gn=H(()=>{lh=[{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:[]}],Ii=Object.freeze(lh.map(e=>Object.freeze({id:e.id,labelKey:e.labelKey,vpIds:Object.freeze([...e.vpIds])}))),Mo=new Map;for(let e of Ii)for(let t of e.vpIds)Mo.set(t,e.id)});function Po(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 fn(c).slice(0,gu)}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:[],f=!1;for(let S of u){let v=String(S||"").toLowerCase();if(v&&v.startsWith(n)){f=!0;break}}if(f){l(c,r);continue}let p=String(c.displayName||"").toLowerCase(),g=String(c.displayNameZh||""),b=[c.description,c.descriptionZh,c.role,c.roleZh].map(S=>String(S||"").toLowerCase()),h=typeof t=="string"?t:"",A=p.includes(n)||h&&g.includes(h),w=n&&b.some(S=>S.includes(n));(A||w)&&l(c,o)}return[...fn(i),...fn(r),...fn(o)].slice(0,gu)}function Do(e="chat-input"){return`${e}-vp-mention-listbox`}function _o(e,t){let s=String(t||"").replace(/[^A-Za-z0-9_.:-]/g,"-");return`${e}-vp-mention-option-${s}`}function ch(e){let t=0;return fu(e).map(s=>({...s,items:s.vps.map(n=>({vp:n,flatIndex:t++}))}))}function mu(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 hu(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 gu,vu,yu=H(()=>{gn();gu=12;vu={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:`
1686
1686
  <div
1687
1687
  class="slash-autocomplete vp-mention-autocomplete"
1688
1688
  v-if="filteredList.length > 0"
@@ -1719,7 +1719,7 @@ ${String(e||"").trim()}
1719
1719
  </div>
1720
1720
  </div>
1721
1721
  </div>
1722
- `,setup(e){let t=Vue.computed(()=>Po(e.vps,e.query)),s=Vue.computed(()=>lh(t.value)),n=Vue.computed(()=>Do(e.inputId)),i=u=>_o(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 Ds,Ai=H(()=>{du();Xs();To();yu();Ds={name:"ChatInput",components:{VpMentionAutocomplete:vu},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},quote:{type:Object,default:null}},emits:["remove-quote","quote-consumed"],template:`
1722
+ `,setup(e){let t=Vue.computed(()=>Po(e.vps,e.query)),s=Vue.computed(()=>ch(t.value)),n=Vue.computed(()=>Do(e.inputId)),i=u=>_o(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 Ds,Ai=H(()=>{du();Xs();To();yu();Ds={name:"ChatInput",components:{VpMentionAutocomplete:vu},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},quote:{type:Object,default:null}},emits:["remove-quote","quote-consumed"],template:`
1723
1723
  <footer class="input-area" ref="inputAreaRef">
1724
1724
  <!-- Expert chips bar (above attachments) \u2014 hidden in custom send mode and btw mode -->
1725
1725
  <div v-if="quote" class="input-quote-preview">
@@ -1965,7 +1965,7 @@ ${String(e||"").trim()}
1965
1965
  <div class="placeholder-text">{{ $t('terminal.autoCreate') }}</div>
1966
1966
  </div>
1967
1967
  </div>
1968
- `,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 P=e.currentConversation;return P&&n[P]||null}),c=Vue.computed(()=>{let P=e.currentConversation;return P&&i[P]||""}),d=Vue.computed(()=>!!c.value),u=(P,I)=>{if(I){let D=o[P];if(o[P]=I,D&&D!==I){let B=s[P];B?.terminal?.element&&(I.innerHTML="",I.appendChild(B.terminal.element),Vue.nextTick(()=>{try{B.fitAddon?.fit()}catch{}}))}}},f=P=>{let I=e.currentConversation;I&&(i[I]=P)};async function p(){if(a)return!0;let P=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,I=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null;if(!P||!I)try{await Eo("vendor/xterm.min.js"),await Eo("vendor/xterm-addon-fit.min.js"),P=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,I=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null}catch{}return!P||!I?(r.value=t("terminal.xtermNotLoaded"),!1):(a=!0,!0)}function g(){let P=document.documentElement.getAttribute("data-theme")==="dark",D=getComputedStyle(document.documentElement).getPropertyValue("--bg-main").trim()||(P?"#212121":"#ffffff");return P?{background:D,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:D,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(P){if(!P||!e.currentAgent||!await p())return null;let I=bu(P),D=Terminal.Terminal||Terminal,B=FitAddon.FitAddon||FitAddon,O=new D({cursorBlink:!0,fontSize:13,fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace, 'Symbols Nerd Font Mono', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji'",theme:g(),allowProposedApi:!0}),z=new B;return O.loadAddon(z),O.attachCustomKeyEventHandler(te=>!((te.ctrlKey||te.metaKey)&&te.key==="v"||(te.ctrlKey||te.metaKey)&&te.key==="c"&&O.hasSelection())),s[I]={created:!0,connected:!1,terminal:O,fitAddon:z},O.onData(te=>{e.sendWsMessage({type:"terminal_input",agentId:e.currentAgent,conversationId:P,terminalId:I,data:te,_clientId:e.clientId})}),I}async function h(P,I){let D=s[I];if(!D)return!1;let B=null;for(let O=0;O<10&&(await Vue.nextTick(),B=o[I],!(B||O>=2&&(await new Promise(z=>setTimeout(z,50)),B=o[I],B)));O++);return B?(D.terminal.open(B),D.fitAddon.fit(),e.sendWsMessage({type:"terminal_create",agentId:e.currentAgent,conversationId:P,terminalId:I,cols:D.terminal.cols,rows:D.terminal.rows,_clientId:e.clientId}),!0):(r.value=t("terminal.mountFailed"),D.terminal.dispose(),delete s[I],!1)}let A=!1;async function w(){let P=e.currentConversation;if(!P||!e.currentAgent||n[P]||A)return;A=!0,r.value="";let I=await b(P);if(!I){A=!1;return}n[P]=Vue.reactive({type:"pane",terminalId:I}),i[P]=I,await h(P,I)||(delete n[P],delete i[P]),A=!1}async function S(P){let I=e.currentConversation;if(!I||!i[I])return;let D=i[I],B=await b(I);if(!B)return;let O=Vue.reactive({type:"split",direction:P,ratio:.5,first:{type:"pane",terminalId:D},second:{type:"pane",terminalId:B}}),z=xi(n[I],D,O);if(n[I]=Vue.reactive(z),i[I]=B,!await h(I,B)){let me=Ft(n[I],B);me&&(n[I]=Vue.reactive(me)),i[I]=D;return}await Vue.nextTick(),y(I)}function v(P){let I=e.currentConversation;if(!I)return;let D=s[P];D&&(e.sendWsMessage({type:"terminal_close",agentId:e.currentAgent,conversationId:I,terminalId:P,_clientId:e.clientId}),D.terminal?.dispose(),delete s[P],delete o[P]);let B=Ft(n[I],P);B?(n[I]=Vue.reactive(B),i[I]===P&&(i[I]=Ti(n[I])||""),Vue.nextTick(()=>y(I))):(delete n[I],delete i[I],Vue.nextTick(()=>w()))}function m(){let P=e.currentConversation;!P||!i[P]||v(i[P])}function y(P){if(P||(P=e.currentConversation),!P||!n[P])return;let I=mn(n[P]);for(let D of I){let B=s[D];if(B?.fitAddon&&B.connected)try{B.fitAddon.fit(),e.sendWsMessage({type:"terminal_resize",agentId:e.currentAgent,conversationId:P,terminalId:D,cols:B.terminal.cols,rows:B.terminal.rows,_clientId:e.clientId})}catch{}}}function E(P){let I=P.detail;if(I)switch(I.type){case"terminal_created":{let D=I.terminalId||I.conversationId,B=s[D];if(B)if(I.success)B.connected=!0,r.value="";else{r.value=I.error||t("terminal.createFailed"),B.terminal?.dispose(),delete s[D];let O=I.conversationId;if(O&&n[O]){let z=Ft(n[O],D);z?n[O]=Vue.reactive(z):(delete n[O],delete i[O])}}break}case"terminal_output":{let D=I.terminalId||I.conversationId,B=s[D];B?.terminal&&B.terminal.write(I.data);break}case"terminal_closed":{let D=I.terminalId||I.conversationId,B=s[D];if(B){B.terminal?.dispose(),delete s[D],delete o[D];let O=I.conversationId;if(O&&n[O]){let z=Ft(n[O],D);z?(n[O]=Vue.reactive(z),i[O]===D&&(i[O]=Ti(n[O])||"")):(delete n[O],delete i[O])}}break}case"terminal_error":{r.value=I.message||t("terminal.error");let D=I.terminalId;if(D&&s[D]&&!s[D].connected){s[D].terminal?.dispose(),delete s[D];let B=I.conversationId;if(B&&n[B]){let O=Ft(n[B],D);O?n[B]=Vue.reactive(O):(delete n[B],delete i[B])}}break}}}let $=null;function U(){clearTimeout($),$=setTimeout(()=>y(),100)}function V(){y()}function L(P){let{conversationId:I}=P.detail;if(I&&n[I]){let D=mn(n[I]);for(let B of D){let O=s[B];O&&(O.terminal?.dispose(),delete s[B],delete o[B])}delete n[I],delete i[I]}}Vue.onMounted(()=>{window.addEventListener("workbench-message",E),window.addEventListener("resize",U),window.addEventListener("terminal-fit-all",V),window.addEventListener("conversation-deleted",L)}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",E),window.removeEventListener("resize",U),window.removeEventListener("terminal-fit-all",V),window.removeEventListener("conversation-deleted",L),clearTimeout($);for(let P of Object.keys(s))s[P]?.terminal?.dispose()}),Vue.watch(()=>[e.currentConversation,e.workbenchExpanded],()=>{Vue.nextTick(()=>{if(!e.currentConversation||!e.workbenchExpanded)return;let I=document.querySelector(".terminal-tab");I&&I.offsetParent!==null&&w()})},{immediate:!0}),Vue.watch(()=>e.connectionState,(P,I)=>{if(P==="connected"&&I&&I!=="connected"){for(let D of Object.keys(s))s[D]?.terminal?.dispose(),delete s[D],delete o[D];for(let D of Object.keys(n))delete n[D],delete i[D];Vue.nextTick(()=>w())}}),Vue.watch(()=>e.currentConversation,()=>{Vue.nextTick(()=>y())});let _=null;return Vue.onMounted(()=>{let P=()=>{let D=document.querySelector(".terminal-tab");D&&D.offsetParent!==null&&(w(),y())};_=new MutationObserver(()=>{setTimeout(P,50)});let I=document.querySelector(".workbench-tab-content");I&&_.observe(I,{attributes:!0,subtree:!0,attributeFilter:["style"]})}),Vue.onUnmounted(()=>{_&&_.disconnect()}),{store:e,terminals:s,currentTree:l,currentActivePane:c,hasActivePane:d,terminalError:r,setMountRef:u,activatePane:f,splitPane:S,closeActivePane:m,closePane:v}}}});function Mi(e){if(!e)return hn(X.default);let t=e.toLowerCase();if(Ro[t])return Ro[t]();let s=t.lastIndexOf(".");if(s>=0){let n=t.slice(s+1);if(Au[n])return Au[n]();let i=t;for(let[r,o]of Object.entries(Ro))if(i===r||i.endsWith("/"+r))return o()}return hn(X.default)}function Pi(e=!1){return ch(X.folder,e)}var X,hn,ch,Q,Au,Ro,Lo=H(()=>{X={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"},hn=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>`,ch=(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>`,Q=(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>`,Au={js:()=>Q(X.js,"JS"),mjs:()=>Q(X.js,"JS"),cjs:()=>Q(X.js,"JS"),ts:()=>Q(X.ts,"TS"),mts:()=>Q(X.ts,"TS"),jsx:()=>Q(X.jsx,"JSX"),tsx:()=>Q(X.tsx,"TSX"),html:()=>Q(X.html,"</>"),htm:()=>Q(X.html,"</>"),css:()=>Q(X.css,"CSS"),scss:()=>Q(X.scss,"SC"),sass:()=>Q(X.scss,"SA"),less:()=>Q(X.less,"LS"),vue:()=>Q(X.vue,"V"),svelte:()=>Q(X.svelte,"SV"),json:()=>Q(X.json,"{ }"),yaml:()=>Q(X.yaml,"YML"),yml:()=>Q(X.yaml,"YML"),toml:()=>Q(X.config,"TML"),xml:()=>Q(X.xml,"</>"),csv:()=>Q(X.config,"CSV"),md:()=>Q(X.md,"MD"),markdown:()=>Q(X.md,"MD"),txt:()=>hn(X.txt),log:()=>hn(X.log),pdf:()=>Q("#E53935","PDF"),py:()=>Q(X.py,"PY"),rb:()=>Q(X.rb,"RB"),go:()=>Q(X.go,"GO"),rs:()=>Q(X.rs,"RS"),java:()=>Q(X.java,"JA"),cs:()=>Q(X.cs,"C#"),cpp:()=>Q(X.cpp,"C+"),cc:()=>Q(X.cpp,"C+"),c:()=>Q(X.c,"C"),h:()=>Q(X.c,"H"),hpp:()=>Q(X.cpp,"H+"),swift:()=>Q(X.swift,"SW"),kt:()=>Q(X.kt,"KT"),php:()=>Q(X.php,"PHP"),lua:()=>Q(X.lua,"LUA"),r:()=>Q(X.r,"R"),dart:()=>Q(X.dart,"DA"),sh:()=>Q(X.sh,">_"),bash:()=>Q(X.sh,">_"),zsh:()=>Q(X.sh,">_"),fish:()=>Q(X.sh,">_"),ps1:()=>Q(X.ps1,"PS"),bat:()=>Q(X.ps1,"BAT"),cmd:()=>Q(X.ps1,"CMD"),sql:()=>Q(X.sql,"SQL"),db:()=>Q(X.sql,"DB"),sqlite:()=>Q(X.sql,"DB"),svg:()=>Q(X.svg,"SVG"),png:()=>Q(X.img,"PNG"),jpg:()=>Q(X.img,"JPG"),jpeg:()=>Q(X.img,"JPG"),gif:()=>Q(X.img,"GIF"),ico:()=>Q(X.img,"ICO"),webp:()=>Q(X.img,"WP"),lock:()=>hn(X.lock),env:()=>Q(X.env,"ENV"),ini:()=>Q(X.config,"INI"),cfg:()=>Q(X.config,"CFG"),conf:()=>Q(X.config,"CNF"),liquid:()=>Q(X.liquid,"LQ"),ejs:()=>Q(X.html,"EJS"),hbs:()=>Q(X.html,"HBS"),pug:()=>Q(X.html,"PUG"),wasm:()=>Q("#654FF0","WA"),proto:()=>Q(X.config,"PB"),graphql:()=>Q("#E535AB","GQL"),gql:()=>Q("#E535AB","GQL")},Ro={dockerfile:()=>Q(X.docker,"DK"),"docker-compose.yml":()=>Q(X.docker,"DC"),"docker-compose.yaml":()=>Q(X.docker,"DC"),".gitignore":()=>Q(X.git,"GI"),".gitattributes":()=>Q(X.git,"GA"),".gitmodules":()=>Q(X.git,"GM"),".env":()=>Q(X.env,"ENV"),".env.local":()=>Q(X.env,"ENV"),".env.development":()=>Q(X.env,"ENV"),".env.production":()=>Q(X.env,"ENV"),"package.json":()=>Q("#CB3837","NPM"),"package-lock.json":()=>Q("#CB3837","NPM"),"tsconfig.json":()=>Q(X.ts,"TSC"),eslintrc:()=>Q("#4B32C3","ESL"),".eslintrc.js":()=>Q("#4B32C3","ESL"),".eslintrc.json":()=>Q("#4B32C3","ESL"),".prettierrc":()=>Q("#F7B93E","PR"),makefile:()=>Q(X.config,"MK"),"cmakelists.txt":()=>Q("#064F8C","CM"),"readme.md":()=>Q(X.md,"RM"),license:()=>Q("#F5C518","LIC"),"license.md":()=>Q("#F5C518","LIC"),"cargo.toml":()=>Q(X.rs,"CG"),"go.mod":()=>Q(X.go,"MOD"),"go.sum":()=>Q(X.go,"SUM"),gemfile:()=>Q(X.rb,"GEM"),rakefile:()=>Q(X.rb,"RK"),"requirements.txt":()=>Q(X.py,"REQ"),pipfile:()=>Q(X.py,"PIP"),csproj:()=>Q(X.cs,"CSP"),".sln":()=>Q(X.cs,"SLN"),slnx:()=>Q(X.cs,"SLN")}});function ns(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function dh(e,t){if(!e||!t)return ns(e);let s=[],n=(a,l)=>{if(!a)return;let c=new RegExp(a.source,a.flags),d;for(;(d=c.exec(e))!==null;){let u=d[1]!==void 0?d[1]:d[0],f=d.index+(d[1]!==void 0?d[0].indexOf(d[1]):0);if(s.push({start:f,end:f+u.length,cls:l}),!c.global)break}},i=t.commentType||"slash";if((i==="slash"||i==="both")&&(n(_s.comment1,Ie.comment),n(_s.commentBlock,Ie.comment)),(i==="hash"||i==="both")&&n(_s.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(_s.string,Ie.string),n(_s.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 ns(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+=ns(e.slice(o,a.start))),r+=`<span class="${a.cls}">${ns(e.slice(a.start,a.end))}</span>`,o=a.end);return o<e.length&&(r+=ns(e.slice(o))),r}function uh(e){if(!e)return null;let t=e.split(".").pop()?.toLowerCase();if(!t)return null;let s=xu[t];return typeof s=="string"&&(s=xu[s]),s||null}function Tu(e,t){if(!e)return ns(e||"");let s=uh(t);return s?dh(e,s):ns(e)}var _s,xu,Ie,Mu=H(()=>{_s={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},xu={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 Pu(e,t,s){let n=[],i=0,r=0;if(t!=null){let p=t.split(`
1968
+ `,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 P=e.currentConversation;return P&&n[P]||null}),c=Vue.computed(()=>{let P=e.currentConversation;return P&&i[P]||""}),d=Vue.computed(()=>!!c.value),u=(P,I)=>{if(I){let D=o[P];if(o[P]=I,D&&D!==I){let B=s[P];B?.terminal?.element&&(I.innerHTML="",I.appendChild(B.terminal.element),Vue.nextTick(()=>{try{B.fitAddon?.fit()}catch{}}))}}},f=P=>{let I=e.currentConversation;I&&(i[I]=P)};async function p(){if(a)return!0;let P=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,I=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null;if(!P||!I)try{await Eo("vendor/xterm.min.js"),await Eo("vendor/xterm-addon-fit.min.js"),P=typeof Terminal<"u"?Terminal.Terminal||Terminal:null,I=typeof FitAddon<"u"?FitAddon.FitAddon||FitAddon:null}catch{}return!P||!I?(r.value=t("terminal.xtermNotLoaded"),!1):(a=!0,!0)}function g(){let P=document.documentElement.getAttribute("data-theme")==="dark",D=getComputedStyle(document.documentElement).getPropertyValue("--bg-main").trim()||(P?"#212121":"#ffffff");return P?{background:D,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:D,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(P){if(!P||!e.currentAgent||!await p())return null;let I=bu(P),D=Terminal.Terminal||Terminal,B=FitAddon.FitAddon||FitAddon,O=new D({cursorBlink:!0,fontSize:13,fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace, 'Symbols Nerd Font Mono', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji'",theme:g(),allowProposedApi:!0}),z=new B;return O.loadAddon(z),O.attachCustomKeyEventHandler(te=>!((te.ctrlKey||te.metaKey)&&te.key==="v"||(te.ctrlKey||te.metaKey)&&te.key==="c"&&O.hasSelection())),s[I]={created:!0,connected:!1,terminal:O,fitAddon:z},O.onData(te=>{e.sendWsMessage({type:"terminal_input",agentId:e.currentAgent,conversationId:P,terminalId:I,data:te,_clientId:e.clientId})}),I}async function h(P,I){let D=s[I];if(!D)return!1;let B=null;for(let O=0;O<10&&(await Vue.nextTick(),B=o[I],!(B||O>=2&&(await new Promise(z=>setTimeout(z,50)),B=o[I],B)));O++);return B?(D.terminal.open(B),D.fitAddon.fit(),e.sendWsMessage({type:"terminal_create",agentId:e.currentAgent,conversationId:P,terminalId:I,cols:D.terminal.cols,rows:D.terminal.rows,_clientId:e.clientId}),!0):(r.value=t("terminal.mountFailed"),D.terminal.dispose(),delete s[I],!1)}let A=!1;async function w(){let P=e.currentConversation;if(!P||!e.currentAgent||n[P]||A)return;A=!0,r.value="";let I=await b(P);if(!I){A=!1;return}n[P]=Vue.reactive({type:"pane",terminalId:I}),i[P]=I,await h(P,I)||(delete n[P],delete i[P]),A=!1}async function S(P){let I=e.currentConversation;if(!I||!i[I])return;let D=i[I],B=await b(I);if(!B)return;let O=Vue.reactive({type:"split",direction:P,ratio:.5,first:{type:"pane",terminalId:D},second:{type:"pane",terminalId:B}}),z=xi(n[I],D,O);if(n[I]=Vue.reactive(z),i[I]=B,!await h(I,B)){let me=Ft(n[I],B);me&&(n[I]=Vue.reactive(me)),i[I]=D;return}await Vue.nextTick(),y(I)}function v(P){let I=e.currentConversation;if(!I)return;let D=s[P];D&&(e.sendWsMessage({type:"terminal_close",agentId:e.currentAgent,conversationId:I,terminalId:P,_clientId:e.clientId}),D.terminal?.dispose(),delete s[P],delete o[P]);let B=Ft(n[I],P);B?(n[I]=Vue.reactive(B),i[I]===P&&(i[I]=Ti(n[I])||""),Vue.nextTick(()=>y(I))):(delete n[I],delete i[I],Vue.nextTick(()=>w()))}function m(){let P=e.currentConversation;!P||!i[P]||v(i[P])}function y(P){if(P||(P=e.currentConversation),!P||!n[P])return;let I=mn(n[P]);for(let D of I){let B=s[D];if(B?.fitAddon&&B.connected)try{B.fitAddon.fit(),e.sendWsMessage({type:"terminal_resize",agentId:e.currentAgent,conversationId:P,terminalId:D,cols:B.terminal.cols,rows:B.terminal.rows,_clientId:e.clientId})}catch{}}}function E(P){let I=P.detail;if(I)switch(I.type){case"terminal_created":{let D=I.terminalId||I.conversationId,B=s[D];if(B)if(I.success)B.connected=!0,r.value="";else{r.value=I.error||t("terminal.createFailed"),B.terminal?.dispose(),delete s[D];let O=I.conversationId;if(O&&n[O]){let z=Ft(n[O],D);z?n[O]=Vue.reactive(z):(delete n[O],delete i[O])}}break}case"terminal_output":{let D=I.terminalId||I.conversationId,B=s[D];B?.terminal&&B.terminal.write(I.data);break}case"terminal_closed":{let D=I.terminalId||I.conversationId,B=s[D];if(B){B.terminal?.dispose(),delete s[D],delete o[D];let O=I.conversationId;if(O&&n[O]){let z=Ft(n[O],D);z?(n[O]=Vue.reactive(z),i[O]===D&&(i[O]=Ti(n[O])||"")):(delete n[O],delete i[O])}}break}case"terminal_error":{r.value=I.message||t("terminal.error");let D=I.terminalId;if(D&&s[D]&&!s[D].connected){s[D].terminal?.dispose(),delete s[D];let B=I.conversationId;if(B&&n[B]){let O=Ft(n[B],D);O?n[B]=Vue.reactive(O):(delete n[B],delete i[B])}}break}}}let $=null;function U(){clearTimeout($),$=setTimeout(()=>y(),100)}function V(){y()}function L(P){let{conversationId:I}=P.detail;if(I&&n[I]){let D=mn(n[I]);for(let B of D){let O=s[B];O&&(O.terminal?.dispose(),delete s[B],delete o[B])}delete n[I],delete i[I]}}Vue.onMounted(()=>{window.addEventListener("workbench-message",E),window.addEventListener("resize",U),window.addEventListener("terminal-fit-all",V),window.addEventListener("conversation-deleted",L)}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",E),window.removeEventListener("resize",U),window.removeEventListener("terminal-fit-all",V),window.removeEventListener("conversation-deleted",L),clearTimeout($);for(let P of Object.keys(s))s[P]?.terminal?.dispose()}),Vue.watch(()=>[e.currentConversation,e.workbenchExpanded],()=>{Vue.nextTick(()=>{if(!e.currentConversation||!e.workbenchExpanded)return;let I=document.querySelector(".terminal-tab");I&&I.offsetParent!==null&&w()})},{immediate:!0}),Vue.watch(()=>e.connectionState,(P,I)=>{if(P==="connected"&&I&&I!=="connected"){for(let D of Object.keys(s))s[D]?.terminal?.dispose(),delete s[D],delete o[D];for(let D of Object.keys(n))delete n[D],delete i[D];Vue.nextTick(()=>w())}}),Vue.watch(()=>e.currentConversation,()=>{Vue.nextTick(()=>y())});let _=null;return Vue.onMounted(()=>{let P=()=>{let D=document.querySelector(".terminal-tab");D&&D.offsetParent!==null&&(w(),y())};_=new MutationObserver(()=>{setTimeout(P,50)});let I=document.querySelector(".workbench-tab-content");I&&_.observe(I,{attributes:!0,subtree:!0,attributeFilter:["style"]})}),Vue.onUnmounted(()=>{_&&_.disconnect()}),{store:e,terminals:s,currentTree:l,currentActivePane:c,hasActivePane:d,terminalError:r,setMountRef:u,activatePane:f,splitPane:S,closeActivePane:m,closePane:v}}}});function Mi(e){if(!e)return hn(X.default);let t=e.toLowerCase();if(Ro[t])return Ro[t]();let s=t.lastIndexOf(".");if(s>=0){let n=t.slice(s+1);if(Au[n])return Au[n]();let i=t;for(let[r,o]of Object.entries(Ro))if(i===r||i.endsWith("/"+r))return o()}return hn(X.default)}function Pi(e=!1){return dh(X.folder,e)}var X,hn,dh,Q,Au,Ro,Lo=H(()=>{X={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"},hn=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>`,dh=(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>`,Q=(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>`,Au={js:()=>Q(X.js,"JS"),mjs:()=>Q(X.js,"JS"),cjs:()=>Q(X.js,"JS"),ts:()=>Q(X.ts,"TS"),mts:()=>Q(X.ts,"TS"),jsx:()=>Q(X.jsx,"JSX"),tsx:()=>Q(X.tsx,"TSX"),html:()=>Q(X.html,"</>"),htm:()=>Q(X.html,"</>"),css:()=>Q(X.css,"CSS"),scss:()=>Q(X.scss,"SC"),sass:()=>Q(X.scss,"SA"),less:()=>Q(X.less,"LS"),vue:()=>Q(X.vue,"V"),svelte:()=>Q(X.svelte,"SV"),json:()=>Q(X.json,"{ }"),yaml:()=>Q(X.yaml,"YML"),yml:()=>Q(X.yaml,"YML"),toml:()=>Q(X.config,"TML"),xml:()=>Q(X.xml,"</>"),csv:()=>Q(X.config,"CSV"),md:()=>Q(X.md,"MD"),markdown:()=>Q(X.md,"MD"),txt:()=>hn(X.txt),log:()=>hn(X.log),pdf:()=>Q("#E53935","PDF"),py:()=>Q(X.py,"PY"),rb:()=>Q(X.rb,"RB"),go:()=>Q(X.go,"GO"),rs:()=>Q(X.rs,"RS"),java:()=>Q(X.java,"JA"),cs:()=>Q(X.cs,"C#"),cpp:()=>Q(X.cpp,"C+"),cc:()=>Q(X.cpp,"C+"),c:()=>Q(X.c,"C"),h:()=>Q(X.c,"H"),hpp:()=>Q(X.cpp,"H+"),swift:()=>Q(X.swift,"SW"),kt:()=>Q(X.kt,"KT"),php:()=>Q(X.php,"PHP"),lua:()=>Q(X.lua,"LUA"),r:()=>Q(X.r,"R"),dart:()=>Q(X.dart,"DA"),sh:()=>Q(X.sh,">_"),bash:()=>Q(X.sh,">_"),zsh:()=>Q(X.sh,">_"),fish:()=>Q(X.sh,">_"),ps1:()=>Q(X.ps1,"PS"),bat:()=>Q(X.ps1,"BAT"),cmd:()=>Q(X.ps1,"CMD"),sql:()=>Q(X.sql,"SQL"),db:()=>Q(X.sql,"DB"),sqlite:()=>Q(X.sql,"DB"),svg:()=>Q(X.svg,"SVG"),png:()=>Q(X.img,"PNG"),jpg:()=>Q(X.img,"JPG"),jpeg:()=>Q(X.img,"JPG"),gif:()=>Q(X.img,"GIF"),ico:()=>Q(X.img,"ICO"),webp:()=>Q(X.img,"WP"),lock:()=>hn(X.lock),env:()=>Q(X.env,"ENV"),ini:()=>Q(X.config,"INI"),cfg:()=>Q(X.config,"CFG"),conf:()=>Q(X.config,"CNF"),liquid:()=>Q(X.liquid,"LQ"),ejs:()=>Q(X.html,"EJS"),hbs:()=>Q(X.html,"HBS"),pug:()=>Q(X.html,"PUG"),wasm:()=>Q("#654FF0","WA"),proto:()=>Q(X.config,"PB"),graphql:()=>Q("#E535AB","GQL"),gql:()=>Q("#E535AB","GQL")},Ro={dockerfile:()=>Q(X.docker,"DK"),"docker-compose.yml":()=>Q(X.docker,"DC"),"docker-compose.yaml":()=>Q(X.docker,"DC"),".gitignore":()=>Q(X.git,"GI"),".gitattributes":()=>Q(X.git,"GA"),".gitmodules":()=>Q(X.git,"GM"),".env":()=>Q(X.env,"ENV"),".env.local":()=>Q(X.env,"ENV"),".env.development":()=>Q(X.env,"ENV"),".env.production":()=>Q(X.env,"ENV"),"package.json":()=>Q("#CB3837","NPM"),"package-lock.json":()=>Q("#CB3837","NPM"),"tsconfig.json":()=>Q(X.ts,"TSC"),eslintrc:()=>Q("#4B32C3","ESL"),".eslintrc.js":()=>Q("#4B32C3","ESL"),".eslintrc.json":()=>Q("#4B32C3","ESL"),".prettierrc":()=>Q("#F7B93E","PR"),makefile:()=>Q(X.config,"MK"),"cmakelists.txt":()=>Q("#064F8C","CM"),"readme.md":()=>Q(X.md,"RM"),license:()=>Q("#F5C518","LIC"),"license.md":()=>Q("#F5C518","LIC"),"cargo.toml":()=>Q(X.rs,"CG"),"go.mod":()=>Q(X.go,"MOD"),"go.sum":()=>Q(X.go,"SUM"),gemfile:()=>Q(X.rb,"GEM"),rakefile:()=>Q(X.rb,"RK"),"requirements.txt":()=>Q(X.py,"REQ"),pipfile:()=>Q(X.py,"PIP"),csproj:()=>Q(X.cs,"CSP"),".sln":()=>Q(X.cs,"SLN"),slnx:()=>Q(X.cs,"SLN")}});function ns(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function uh(e,t){if(!e||!t)return ns(e);let s=[],n=(a,l)=>{if(!a)return;let c=new RegExp(a.source,a.flags),d;for(;(d=c.exec(e))!==null;){let u=d[1]!==void 0?d[1]:d[0],f=d.index+(d[1]!==void 0?d[0].indexOf(d[1]):0);if(s.push({start:f,end:f+u.length,cls:l}),!c.global)break}},i=t.commentType||"slash";if((i==="slash"||i==="both")&&(n(_s.comment1,Ie.comment),n(_s.commentBlock,Ie.comment)),(i==="hash"||i==="both")&&n(_s.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(_s.string,Ie.string),n(_s.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 ns(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+=ns(e.slice(o,a.start))),r+=`<span class="${a.cls}">${ns(e.slice(a.start,a.end))}</span>`,o=a.end);return o<e.length&&(r+=ns(e.slice(o))),r}function ph(e){if(!e)return null;let t=e.split(".").pop()?.toLowerCase();if(!t)return null;let s=xu[t];return typeof s=="string"&&(s=xu[s]),s||null}function Tu(e,t){if(!e)return ns(e||"");let s=ph(t);return s?uh(e,s):ns(e)}var _s,xu,Ie,Mu=H(()=>{_s={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},xu={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 Pu(e,t,s){let n=[],i=0,r=0;if(t!=null){let p=t.split(`
1969
1969
  `);for(let g=0;g<p.length;g++)n.push({type:"addition",oldNum:"",oldText:"",newNum:g+1,newText:p[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(`
1970
1970
  `),a=0,l=0,c=!1,d=[],u=[],f=()=>{let p=Math.max(d.length,u.length);for(let g=0;g<p;g++){let 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 p of o){if(p.startsWith("diff --git")||p.startsWith("index ")||p.startsWith("---")||p.startsWith("+++")||p.startsWith("\\"))continue;let g=p.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(g){f(),a=parseInt(g[1]),l=parseInt(g[2]),c=!0,n.push({type:"hunk",oldNum:"\xB7\xB7\xB7",oldText:p,newNum:"\xB7\xB7\xB7",newText:p});continue}if(c)if(p.startsWith("-"))u.length>0&&d.length===0&&f(),d.push({num:a++,text:p.substring(1)}),r++;else if(p.startsWith("+"))u.push({num:l++,text:p.substring(1)}),i++;else{f();let b=p.startsWith(" ")?p.substring(1):p;n.push({type:"context",oldNum:a++,oldText:b,newNum:l++,newText:b})}}return f(),{lines:n,stats:{additions:i,deletions:r},content:e}}var Du=H(()=>{});function _u(e,t){let{effectiveGitWorkDir:s,gitOperating:n,gitOpFeedback:i,commitMessage:r}=t,o=null,a=null,l=(v,m)=>{o&&clearTimeout(o),i.value={ok:v,message:m},o=setTimeout(()=>{i.value=null},4e3)},c=(v,m)=>{e.currentAgent&&(v.value=!0,m.value="",e.sendWsMessage({type:"git_status",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:s.value,_clientId:e.clientId}))},d=(v,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:v,conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:s.value,_clientId:e.clientId,...m}))};return{showFeedback:l,loadGitStatus:c,gitOp:d,stageFile:v=>d("git_add",{filePath:v}),unstageFile:v=>d("git_reset",{filePath:v}),discardFile:v=>{confirm("Discard changes to "+v+"?")&&d("git_restore",{filePath:v})},stageAll:()=>d("git_add",{addAll:!0}),unstageAll:()=>d("git_reset",{resetAll:!0}),commitChanges:()=>{let v=r.value.trim();v&&d("git_commit",{commitMessage:v})},pushChanges:()=>d("git_push"),handleGitOpResult:(v,m)=>{n.value=!1,a&&(clearTimeout(a),a=null),v.success?(l(!0,v.message||v.operation+" succeeded"),v.operation==="commit"&&(r.value=""),m()):l(!1,v.error||v.operation+" failed")},cleanup:()=>{o&&clearTimeout(o),a&&clearTimeout(a)}}}var Eu=H(()=>{});function Ru(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 Lu=H(()=>{});var $u,Vu=H(()=>{Lo();Mu();Du();Eu();Lu();$u={name:"GitStatusTab",template:`
1971
1971
  <div class="git-status-tab git-three-col">
@@ -2211,7 +2211,7 @@ ${String(e||"").trim()}
2211
2211
  </div>
2212
2212
  </div>
2213
2213
  </div>
2214
- `,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=x=>x.split(/[/\\]/).pop()||x,n=x=>{let T=x.split(/[/\\]/);return T.pop(),T.join("/")},i=x=>Mi(s(x)),r=Vue.ref(null),o=Vue.reactive({staged:!1,modified:!1,untracked:!1}),a=x=>{o[x]=!o[x]},l=Vue.ref(!1),c=Vue.ref(""),d=Vue.ref(null),u=Vue.ref([]),f=Vue.computed(()=>e.effectiveWorkDir||""),p=Vue.ref(""),g=Vue.computed(()=>p.value.trim()||f.value),b=Vue.ref(null),h=Vue.ref(!1),A=Vue.ref(!1),w=Vue.ref(""),S=Vue.ref(null),v=Vue.ref([]),m=Vue.ref(null),y=Vue.ref(!0),E=Vue.ref(!1),$=Vue.ref(""),U=Vue.ref(null),V=Vue.ref(0),L=Vue.ref(0),_=x=>x==null||x===""?"":Tu(x,b.value||""),P=Vue.ref(parseInt(localStorage.getItem("gitDiffFontSize"))||12),I=x=>{P.value=Math.max(8,Math.min(24,x)),localStorage.setItem("gitDiffFontSize",P.value.toString())},D=()=>I(P.value+1),B=()=>I(P.value-1),O=x=>{x.deltaY<0?D():x.deltaY>0&&B()},z=Vue.computed(()=>{let x=v.value;if(!x||x.length===0)return[];let T=x.length,q=[],Z=0;for(;Z<T;){let ae=x[Z];if(ae.type==="addition"||ae.type==="deletion"||ae.type==="modification"){let W=ae.type==="modification"?"modification":ae.type,J=Z;for(;Z<T&&(x[Z].type===W||x[Z].type==="modification"&&W!=="modification");)Z++;let de=Z-J;q.push({type:W,top:J/T*100,height:Math.max(de/T*100,.5)})}else Z++}return q}),te=x=>{let T=r.value;if(!T)return;let q=x.currentTarget.getBoundingClientRect(),Z=(x.clientY-q.top)/q.height;T.scrollTop=Z*(T.scrollHeight-T.clientHeight)},me=Vue.computed(()=>u.value.filter(x=>x.indexStatus!==" "&&x.indexStatus!=="?")),pe=Vue.computed(()=>u.value.filter(x=>x.workTreeStatus==="M"||x.workTreeStatus==="D")),ve=Vue.computed(()=>u.value.filter(x=>x.indexStatus==="?"&&x.workTreeStatus==="?")),ie=_u(e,{effectiveGitWorkDir:g,gitOperating:E,gitOpFeedback:U,commitMessage:$}),ke=()=>ie.loadGitStatus(l,c),M=()=>{ke()},j=Ru(e,g),re=x=>Pi(x),ge=()=>j.confirmFolderPicker(p,ke),Ce=(x,T)=>{b.value=x.path,h.value=T,A.value=!0,w.value="",S.value=null,v.value=[],m.value=null;let q=x.indexStatus==="?"&&x.workTreeStatus==="?";e.sendWsMessage({type:"git_diff",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:g.value,filePath:x.path,staged:T,untracked:q,fullFile:y.value,_clientId:e.clientId})},De=()=>{if(y.value=!y.value,b.value){let x=u.value.find(T=>T.path===b.value);x&&Ce(x,h.value)}},ee=x=>{let T=x.detail;if(T)switch(T.type){case"directory_listing":{if(j.handleDirectoryListing(T))return;break}case"git_status_result":{if(l.value=!1,T.error){c.value=T.error,d.value=null,u.value=[];return}if(c.value="",d.value=T.branch||"HEAD",u.value=T.files||[],V.value=T.ahead||0,L.value=T.behind||0,b.value){let q=u.value.find(Z=>Z.path===b.value);if(q){let Z=q.indexStatus!==" "&&q.indexStatus!=="?";h.value=Z}else b.value=null,S.value=null,v.value=[],m.value=null}break}case"git_diff_result":{if(A.value=!1,T.error){w.value=T.error;return}w.value="";let q=Pu(T.diff,T.newFileContent,t);m.value=q.stats,v.value=q.lines,S.value=q.content;break}case"git_op_result":{ie.handleGitOpResult(T,ke);break}}};Vue.watch(()=>e.currentAgent,()=>{d.value=null,u.value=[],c.value="",b.value=null,S.value=null,e.currentAgent&&Vue.nextTick(()=>ke())}),Vue.watch(()=>e.currentConversation,()=>{e.currentAgent&&(b.value=null,S.value=null,v.value=[],m.value=null,Vue.nextTick(()=>ke()))});let K=()=>ke();return Vue.onMounted(()=>{window.addEventListener("workbench-message",ee),e.currentAgent&&ke()}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",ee),ie.cleanup()}),{store:e,getFileName:s,getDirName:n,getFileIconHtml:i,hlLine:_,collapsedGroups:o,toggleGroup:a,gitLoading:l,gitError:c,gitBranch:d,gitFiles:u,gitWorkDir:p,defaultWorkDir:f,changeGitWorkDir:M,stagedFiles:me,modifiedFiles:pe,untrackedFiles:ve,selectedGitFile:b,selectedStaged:h,diffLoading:A,diffError:w,diffContent:S,diffLines:v,diffStats:m,diffFullFile:y,toggleDiffMode:De,scrollMarkers:z,diffScrollContainer:r,onMarkerClick:te,fontSize:P,zoomIn:D,zoomOut:B,onWheel:O,gitOperating:E,commitMessage:$,gitOpFeedback:U,gitAhead:V,gitBehind:L,stageFile:ie.stageFile,unstageFile:ie.unstageFile,discardFile:ie.discardFile,stageAll:ie.stageAll,unstageAll:ie.unstageAll,commitChanges:ie.commitChanges,pushChanges:ie.pushChanges,selectGitFile:Ce,refresh:K,folderPickerOpen:j.folderPickerOpen,folderPickerPath:j.folderPickerPath,folderPickerEntries:j.folderPickerEntries,folderPickerLoading:j.folderPickerLoading,folderPickerSelected:j.folderPickerSelected,getFolderIcon:re,openFolderPicker:j.openFolderPicker,folderPickerNavigateUp:j.folderPickerNavigateUp,folderPickerSelectItem:j.folderPickerSelectItem,folderPickerEnter:j.folderPickerEnter,confirmFolderPicker:ge}}}});function Fu(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=[],f=[],p=()=>{let V=e.value?.cmInstance;if(!V)return;let _=V.getWrapperElement().querySelector(".cm-find-scrollbar-annotations");_&&_.remove()},g=()=>{let V=e.value?.cmInstance;if(!V||f.length===0)return;p();let L=V.getWrapperElement();if(!L.querySelector(".CodeMirror-vscrollbar"))return;let P=V.lineCount();if(P===0)return;let I=document.createElement("div");I.className="cm-find-scrollbar-annotations";for(let D of f){let B=D.from.line/P*100,O=document.createElement("div");O.className="cm-find-scrollbar-tick",O.style.top=B+"%",I.appendChild(O)}L.appendChild(I)},b=()=>{for(let V of u)try{V.clear()}catch{}u=[],f=[],a.value=0,l.value=-1,p()},h=V=>{let L=e.value?.cmInstance;if(!L||!f[V])return;for(let P=0;P<u.length;P++){if(!u[P])continue;let I=u[P].find();I&&(u[P].clear(),u[P]=L.markText(I.from,I.to,{className:"cm-find-highlight"}))}let _=f[V];if(u[V]){let P=u[V].find();P&&(u[V].clear(),u[V]=L.markText(P.from,P.to,{className:"cm-find-highlight cm-find-current"}))}setTimeout(()=>{L.scrollIntoView({from:_.from,to:_.to},100)},0)},A=()=>{b();let V=e.value?.cmInstance;if(!V||!n.value)return;let L=n.value;if(L.length<3)return;let _=V.getValue(),P=r.value,I=o.value,D=[];try{if(I){let B=P?"g":"gi",O=new RegExp(L,B),z;for(;(z=O.exec(_))!==null;){if(z[0].length===0){O.lastIndex++;continue}let te=V.posFromIndex(z.index),me=V.posFromIndex(z.index+z[0].length);if(D.push({from:te,to:me}),D.length>1e4)break}}else{let B=P?L:L.toLowerCase(),O=P?_:_.toLowerCase(),z=0;for(;(z=O.indexOf(B,z))!==-1;){let te=V.posFromIndex(z),me=V.posFromIndex(z+L.length);if(D.push({from:te,to:me}),z+=L.length,D.length>1e4)break}}}catch{return}f=D,a.value=D.length;for(let B of D)u.push(V.markText(B.from,B.to,{className:"cm-find-highlight"}));if(D.length>0){let B=V.getCursor(),O=0;for(let z=0;z<D.length;z++){if(CodeMirror.cmpPos(D[z].from,B)>=0){O=z;break}z===D.length-1&&(O=0)}l.value=O,h(O)}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(f.length===0)return;let V=(l.value+1)%f.length;l.value=V,h(V)},findPrev:()=>{if(f.length===0)return;let V=(l.value-1+f.length)%f.length;l.value=V,h(V)},openFindBar:(V=!1)=>{t.value=!0,s.value=V;let L=e.value?.cmInstance;if(L){let _=L.getSelection();_&&(n.value=_)}Vue.nextTick(()=>{c.value?.focus(),c.value?.select(),n.value&&A()})},closeFindBar:()=>{b(),t.value=!1,s.value=!1;let V=e.value?.cmInstance;V&&V.focus()},toggleReplaceBar:()=>{s.value=!s.value,s.value&&Vue.nextTick(()=>d.value?.focus())},replaceOne:()=>{let V=e.value?.cmInstance;if(!V||f.length===0||l.value<0)return;let L=f[l.value];V.replaceRange(i.value,L.from,L.to),A()},replaceAll:()=>{let V=e.value?.cmInstance;!V||f.length===0||(V.operation(()=>{for(let L=f.length-1;L>=0;L--)V.replaceRange(i.value,f[L].from,f[L].to)}),A())}}}var Ou=H(()=>{});function Hu(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(""),f=Vue.ref("file"),p=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}),w=Vue.ref(!1),S=Vue.ref(""),v=Vue.ref(null),m=null,y=Vue.reactive({dragging:null,dropTarget:null}),E=Vue.ref(!1),$=(W,J)=>{l&&clearTimeout(l),a.value={ok:W,message:J},l=setTimeout(()=>{a.value=null},4e3)},U=()=>{o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,$(!1,"Operation timed out"))},15e3)},V=W=>{i.has(W)?i.delete(W):i.add(W)},L=()=>{i.clear(),r.value=-1},_=W=>{f.value=W,u.value="",d.value=!0,Vue.nextTick(()=>p.value?.focus())},P=()=>{let W=u.value.trim();if(!W)return;d.value=!1;let J=n.value||s();if(!J)return;let de=J.includes("\\")?"\\":"/",oe=J.replace(/[/\\]$/,"")+de+W;U(),e.sendWsMessage({type:"create_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:oe,isDirectory:f.value==="directory",workDir:s(),_clientId:e.clientId})},I=(W,J)=>{let de=W.path.split("/").pop();confirm(J("files.deleteConfirm",{name:de})+(W.type==="directory"?J("files.deleteDirHint"):""))&&(U(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],workDir:s(),_clientId:e.clientId}))},D=W=>{let J=i.size;J!==0&&confirm(W("files.deleteSelectedConfirm",{count:J}))&&(U(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...i],workDir:s(),_clientId:e.clientId}))},B=()=>{b.value=n.value||s()||"",g.value=!0,Vue.nextTick(()=>h.value?.focus())},O=()=>{let W=b.value.trim();!W||i.size===0||(g.value=!1,U(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...i],destination:W,workDir:s(),_clientId:e.clientId}))},z=(W,J)=>{let Me=W.clientX,_e=W.clientY;Me+180>window.innerWidth&&(Me=window.innerWidth-180),_e+240>window.innerHeight&&(_e=window.innerHeight-240),A.entry=J,A.x=Me,A.y=_e,A.visible=!0},te=()=>{A.visible=!1};return{selectedPaths:i,lastClickedIndex:r,fileOperating:o,fileOpFeedback:a,newFileDialogVisible:d,newFileName:u,newFileType:f,newFileInput:p,moveDialogVisible:g,moveDestination:b,moveDestInput:h,contextMenu:A,renameDialogVisible:w,renameNewName:S,renameInput:v,dragState:y,externalDropActive:E,showFileOpFeedback:$,toggleSelection:V,clearSelection:L,showNewFileDialog:_,confirmNewFile:P,deleteSingleFile:I,deleteSelected:D,openMoveDialog:B,confirmMove:O,showContextMenu:z,hideContextMenu:te,ctxRename:()=>{let W=A.entry;te(),W&&(S.value=W.name,w.value=!0,Vue.nextTick(()=>{let J=v.value;if(J)if(J.focus(),W.type==="file"){let de=W.name.lastIndexOf(".");de>0?J.setSelectionRange(0,de):J.select()}else J.select()}))},confirmRename:()=>{let W=A.entry,J=S.value.trim();if(!J||!W||J===W.name){w.value=!1;return}w.value=!1;let de=W.path.replace(/\/$/,"").split("/");de.pop();let oe=de.join("/")||"/";U(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],destination:oe,newName:J,workDir:s(),_clientId:e.clientId})},ctxCopy:()=>{let W=A.entry;if(te(),!W)return;let J=W.path.replace(/\/$/,"").split("/");J.pop();let de=J.join("/")||"/";U(),e.sendWsMessage({type:"copy_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],destination:de,workDir:s(),_clientId:e.clientId})},ctxMoveTo:()=>{let W=A.entry;te(),W&&(i.clear(),i.add(W.path),B())},ctxDelete:W=>{let J=A.entry;te(),J&&I(J,W)},ctxDownload:()=>{let W=A.entry;te(),!(!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)=>{y.dragging=J,W.dataTransfer.setData("text/plain",J.path),W.dataTransfer.effectAllowed="move"},onDragOver:(W,J)=>{if(!y.dragging&&W.dataTransfer.types.includes("Files")){J.type==="directory"&&(W.dataTransfer.dropEffect="copy",y.dropTarget=J.path);return}!y.dragging||J.type!=="directory"||J.path!==y.dragging.path&&(J.path.startsWith(y.dragging.path+"/")||(W.dataTransfer.dropEffect="move",y.dropTarget=J.path))},onDragLeave:W=>{let J=W.relatedTarget;J&&W.currentTarget.contains(J)||(y.dropTarget=null)},onDrop:(W,J,de)=>{if(y.dropTarget=null,!y.dragging&&W.dataTransfer.files.length>0&&J.type==="directory"){de(W.dataTransfer.files,J.path);return}if(!y.dragging||J.type!=="directory"){y.dragging=null;return}if(J.path===y.dragging.path){y.dragging=null;return}U(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[y.dragging.path],destination:J.path,workDir:s(),_clientId:e.clientId}),y.dragging=null},onTreeDragOver:W=>{y.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,de)=>{if(E.value=!1,!y.dragging&&W.dataTransfer.files.length>0){let oe=n.value||J||s();de(W.dataTransfer.files,oe)}},handleExternalFileDrop:async(W,J)=>{if(!J)return;let de=[],oe=[];for(let Me of W)oe.push(new Promise(_e=>{let Ve=new FileReader;Ve.onload=()=>{let qe=btoa(new Uint8Array(Ve.result).reduce((xt,dt)=>xt+String.fromCharCode(dt),""));de.push({name:Me.name,data:qe}),_e()},Ve.onerror=()=>_e(),Ve.readAsArrayBuffer(Me)}));await Promise.all(oe),de.length!==0&&(o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,$(!1,"Upload timed out"))},3e4),e.sendWsMessage({type:"upload_to_dir",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,files:de,dirPath:J,workDir:s(),_clientId:e.clientId}))},handleFileOpResult:(W,J,de)=>{o.value=!1,c&&(clearTimeout(c),c=null),$(W.success,W.success?W.message:W.error||"Operation failed"),W.success&&(de&&J(de),(W.operation==="delete"||W.operation==="move")&&(i.clear(),r.value=-1))},getPendingDownload:()=>m,clearPendingDownload:()=>{m=null},cleanup:()=>{l&&clearTimeout(l),c&&clearTimeout(c)}}}var Nu=H(()=>{});function Bu(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),f=Vue.computed(()=>{if(!l.value)return"EXPLORER";let _=l.value.replace(/[\\/]+$/,"").split(/[\\/]/);return(_[_.length-1]||l.value).toUpperCase()}),p=Vue.computed(()=>l.value?!!c[l.value]?.expanded:!1),g=()=>{if(!l.value)return;let _=c[l.value];_&&(_.expanded=!_.expanded)},b=()=>{for(let _ of Object.keys(c))c[_]&&(c[_].expanded=!1)},h=()=>{d.value=!0,Vue.nextTick(()=>u.value?.focus())},A=()=>{d.value=!1,m()},w=()=>{d.value=!1},S=Vue.computed(()=>{let _=[],P=(I,D)=>{let B=c[I];if(!(!B||!B.entries))for(let O of B.entries)_.push({...O,depth:D}),O.type==="directory"&&c[O.path]?.expanded&&P(O.path,D+1)};return l.value&&c[l.value]?.expanded&&P(l.value,0),_}),v=_=>{let P=s(_);c[P]?c[P].loading=!0:c[P]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:_,workDir:t(),_clientId:e.clientId})},m=()=>{let _=a.value.trim();if(!_)return;let P=s(_);l.value=P,Object.keys(c).forEach(I=>delete c[I]),c[P]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:_,workDir:t(),_clientId:e.clientId})},y=_=>{let P=s(_),I=c[P];I?I.loaded?I.expanded=!I.expanded:(I.expanded=!0,v(_)):(c[P]={entries:[],expanded:!0,loaded:!1,loading:!1},v(_))},E=(_,P)=>{let I=S.value,D=I.findIndex(B=>B.path===_.path);if(P&&(P.shiftKey||P.ctrlKey||P.metaKey)){if(P.shiftKey&&i.value>=0&&D>=0){let B=Math.min(i.value,D),O=Math.max(i.value,D);!P.ctrlKey&&!P.metaKey&&n.clear();for(let z=B;z<=O;z++)n.add(I[z].path)}else n.has(_.path)?n.delete(_.path):n.add(_.path);i.value=D;return}n.size>0&&(n.clear(),i.value=-1),_.type==="directory"?y(_.path):r(_.path,_.name),i.value=D},$=_=>{let P=s(_.dirPath);if(_.error){c[P]&&(c[P].loading=!1);return}let I=(_.entries||[]).sort((O,z)=>O.type===z.type?O.name.localeCompare(z.name):O.type==="directory"?-1:1),D=P.replace(/\/$/,""),B=I.map(O=>({...O,path:D+"/"+O.name}));c[P]?(c[P].entries=B,c[P].loaded=!0,c[P].loading=!1):c[P]={entries:B,expanded:!0,loaded:!0,loading:!1},P===l.value&&(a.value=_.dirPath)},U=()=>{Object.keys(c).forEach(_=>delete c[_])};return{treePath:a,treeRootPath:l,treeNodes:c,flattenedTree:S,editingTreePath:d,treePathInputRef:u,rootFolderName:f,rootExpanded:p,toggleRootExpand:g,collapseAll:b,startTreePathEdit:h,confirmTreePath:A,cancelTreePathEdit:w,loadTreeDirectory:v,loadRootDirectory:m,toggleDirectory:y,onTreeItemClick:E,handleDirectoryListing:$,clearTreeNodes:U,initFileBrowser:()=>{let _=t();if(_){let P=s(_);a.value=_,l.value=P,U(),v(_)}},refresh:()=>{l.value&&v(l.value)}}}var qu=H(()=>{});function Es(e){let t=e.lastIndexOf(".");if(t<0)return"text";let s=e.substring(t).toLowerCase();return ph.has(s)?"office":fh.has(s)?"pdf":gh.has(s)?"image":"text"}function At(e){let t=e.lastIndexOf(".");return t<0?!1:mh.has(e.substring(t).toLowerCase())}function hh(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 Wu(e,{activeFile:t,editorContainer:s,fontSize:n,clearFindMarkers:i,openFindBar:r,saveFile:o}){let a=Vue.ref(""),l=Vue.reactive({}),c=()=>{},d=()=>{},u=({openQuickOpen:w,openGoToLine:S})=>{c=w,d=S},f=(w,S=0)=>{if(!s.value){S<20&&setTimeout(()=>f(w,S+1),100);return}if(!w)return;if(s.value.innerHTML="",typeof CodeMirror>"u"){let y=document.createElement("textarea");y.value=w.content||"",y.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;",y.spellcheck=!1,y.addEventListener("input",()=>{w.content=y.value,w.isDirty=y.value!==w.originalContent}),y.addEventListener("keydown",E=>{(E.ctrlKey||E.metaKey)&&E.key==="s"&&(E.preventDefault(),o())}),s.value.appendChild(y),a.value="";return}let m=document.documentElement.getAttribute("data-theme")==="dark"?"material-darker":"default";try{let y=CodeMirror(s.value,{value:w.content||"",mode:hh(w.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)}});y.on("change",()=>{let $=y.getValue();w.content=$,w.isDirty=$!==w.originalContent}),w.cmInstance=y,y.getWrapperElement().style.fontSize=n.value+"px";let E=e.currentConversation;E&&l[E]?.[w.path]&&y.setHistory(l[E][w.path]),Vue.nextTick(()=>{y.refresh(),setTimeout(()=>y.refresh(),200)}),a.value=""}catch(y){a.value=`Editor error: ${y.message}`}};return{debugStatus:a,undoHistoryMap:l,createEditor:f,destroyEditor:()=>{i();let w=t.value;w?.cmInstance&&(w.cmInstance.toTextArea&&w.cmInstance.toTextArea(),w.cmInstance=null),s.value&&(s.value.innerHTML="")},setKeyBindings:u,saveCurrentUndoHistory:()=>{let w=e.currentConversation;if(!w)return;let S=t.value;S?.cmInstance&&(l[w]||(l[w]={}),l[w][S.path]=S.cmInstance.getHistory())},saveAllUndoHistory:w=>{if(!w)return;let S=t.value;S?.cmInstance&&(l[w]||(l[w]={}),l[w][S.path]=S.cmInstance.getHistory())},cleanupUndoHistory:(w,S)=>{w&&l[w]&&delete l[w][S]},deleteConversationHistory:w=>{delete l[w]}}}var ph,fh,gh,mh,vn=H(()=>{ph=new Set([".docx",".xlsx",".xls",".pptx",".ppt"]),fh=new Set([".pdf"]),gh=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico"]),mh=new Set([".md",".markdown",".mdx"])});function Uu(e,{editorContainer:t,createEditor:s,t:n}){let i=Vue.ref(!0),r=Vue.ref(null),o=Vue.ref(null),a=Vue.computed(()=>{let p=e.value;return!!(p&&At(p.name))}),l=Vue.computed(()=>{let p=e.value;if(!p||!At(p.name)||p.content==null)return"";try{if(typeof marked<"u")return marked.parse(p.content)}catch{}return"<pre>"+(p.content||"")+"</pre>"});function c(){je(r.value)}async function d(){await je(r.value)}function u(){i.value=!1,Vue.nextTick(()=>{let p=e.value;p&&t.value&&s(p)})}return{mdPreviewMode:i,mdPreviewRef:r,officePreviewContainer:o,isActiveMarkdown:a,mdRenderedHtml:l,initMermaid:c,renderMermaidBlocks:d,switchToMdEdit:u,renderOfficeLocal:p=>{let g=o.value;if(!g||!p._arrayBuffer)return;g.innerHTML="";let b=("."+p.name.split(".").pop()).toLowerCase();if(b===".docx"&&window.docx)window.docx.renderAsync(p._arrayBuffer,g,null,{className:"docx-preview-content",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!0}).catch(h=>{p.previewError=h.message});else if(b===".xlsx"||b===".xls")try{let h=XLSX.read(p._arrayBuffer,{type:"array"}),A=h.SheetNames[0],w=XLSX.utils.sheet_to_html(h.Sheets[A],{editable:!1});g.innerHTML='<div class="xlsx-sheet-tabs">'+h.SheetNames.map((S,v)=>`<button class="xlsx-sheet-tab${v===0?" active":""}" data-idx="${v}">${S}</button>`).join("")+'</div><div class="xlsx-table-wrap">'+w+"</div>",g.querySelectorAll(".xlsx-sheet-tab").forEach(S=>{S.addEventListener("click",()=>{let v=parseInt(S.dataset.idx),m=h.SheetNames[v],y=XLSX.utils.sheet_to_html(h.Sheets[m],{editable:!1});g.querySelector(".xlsx-table-wrap").innerHTML=y,g.querySelectorAll(".xlsx-sheet-tab").forEach(E=>E.classList.remove("active")),S.classList.add("active")})})}catch(h){p.previewError=h.message}else(b===".pptx"||b===".ppt")&&(g.innerHTML='<div class="preview-unsupported">'+(n?n("files.pptxNotSupported"):"PowerPoint preview not supported")+"</div>")}}}var zu=H(()=>{ln();vn()});function ju(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,f=Vue.ref(!1),p=Vue.ref(""),g=Vue.ref([]),b=Vue.ref(0),h=Vue.ref(!1),A=Vue.ref(null),w=null,S=Vue.ref(!1),v=Vue.ref(""),m=Vue.ref(null),y=pe=>{!e.currentAgent||!pe.trim()||e.sendWsMessage({type:"file_search",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,query:pe.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(()=>{y(l.value)},300)},$=()=>{l.value="",c.value=[],d.value=!1},U=pe=>{if(pe.type==="directory"){let ve=i(pe.fullPath);r.value=ve,s.value=pe.fullPath,Object.keys(o).forEach(ie=>delete o[ie]),a(pe.fullPath),$()}else n(pe.fullPath,pe.name),$()},V=()=>{f.value=!0,p.value="",g.value=[],b.value=0,h.value=!1,Vue.nextTick(()=>A.value?.focus())},L=()=>{f.value=!1,p.value="",g.value=[]},_=()=>{if(w&&clearTimeout(w),!p.value.trim()){g.value=[],h.value=!1;return}h.value=!0,b.value=0,w=setTimeout(()=>{y(p.value)},200)},P=()=>{g.value.length>0&&(b.value=(b.value+1)%g.value.length)},I=()=>{g.value.length>0&&(b.value=(b.value-1+g.value.length)%g.value.length)},D=pe=>{pe.type!=="directory"&&n(pe.fullPath,pe.name),L()},B=()=>{let pe=g.value[b.value];pe&&D(pe)},O=()=>{S.value=!0,v.value="",Vue.nextTick(()=>m.value?.focus())},z=()=>{S.value=!1,v.value=""};return{searchQuery:l,searchResults:c,searchLoading:d,onSearchInput:E,clearSearch:$,onSearchResultClick:U,quickOpenVisible:f,quickOpenQuery:p,quickOpenResults:g,quickOpenSelectedIndex:b,quickOpenLoading:h,quickOpenInput:A,openQuickOpen:V,closeQuickOpen:L,onQuickOpenInput:_,quickOpenSelectNext:P,quickOpenSelectPrev:I,quickOpenConfirm:B,quickOpenOpenFile:D,goToLineVisible:S,goToLineValue:v,goToLineInput:m,openGoToLine:O,closeGoToLine:z,goToLineConfirm:pe=>{let ve=parseInt(v.value);if(isNaN(ve)||ve<1)return;let ie=pe.value;if(ie?.cmInstance){let ke=ie.cmInstance,M=Math.min(ve-1,ke.lineCount()-1);ke.setCursor({line:M,ch:0}),ke.scrollIntoView({line:M,ch:0},100),ke.focus()}z()},handleFileSearchResult:pe=>{let ve=pe.results||[];f.value?pe.query&&pe.query.trim()===p.value.trim()&&(g.value=ve,h.value=!1,b.value=0):pe.query&&pe.query.trim()===l.value.trim()&&(c.value=ve,d.value=!1)}}}var Ku=H(()=>{});function Gu(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(""),f=()=>{a.value=!0,u.value="",d.value=!0;let S=s.value||t()||"";l.value=S,c.value=[],e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})},p=S=>{d.value=!0,u.value="",e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})};return{folderPickerOpen:a,folderPickerPath:l,folderPickerEntries:c,folderPickerLoading:d,folderPickerSelected:u,openFolderPicker:f,folderPickerNavigateUp:()=>{if(!l.value)return;let S=l.value.includes("\\"),v=S?"\\":"/",m=l.value.replace(/[/\\]$/,"").split(/[/\\]/);if(m.pop(),m.length===0)l.value="",p("");else if(S&&m.length===1&&/^[A-Za-z]:$/.test(m[0]))l.value=m[0]+"\\",p(m[0]+"\\");else{let y=m.join(v);l.value=y,p(y)}},folderPickerSelectItem:S=>{u.value=S.name},folderPickerEnter:S=>{let v;if(!l.value)v=S.name+(S.name.endsWith("\\")?"":"\\");else{let m=l.value.includes("\\")||/^[A-Z]:/.test(S.name)?"\\":"/";v=l.value.replace(/[/\\]$/,"")+m+S.name}l.value=v,p(v)},confirmFolderPicker:()=>{let S=l.value;if(!S)return;if(u.value){let m=S.includes("\\")?"\\":"/";S=S.replace(/[/\\]$/,"")+m+u.value}s.value=S,a.value=!1;let v=r(S);n.value=v,Object.keys(i).forEach(m=>delete i[m]),i[v]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})},handleFolderPickerListing:S=>{d.value=!1,c.value=(S.entries||[]).filter(v=>v.type==="directory").sort((v,m)=>v.name.localeCompare(m.name)),S.dirPath!=null&&(l.value=S.dirPath)}}}var Yu=H(()=>{});function Qu(e,{normalizePath:t,getEffectiveWorkDir:s,editorContainer:n,createEditor:i,destroyEditor:r,clearFindMarkers:o,saveCurrentUndoHistory:a,saveAllUndoHistory:l,cleanupUndoHistory:c,deleteConversationHistory:d,debugStatus:u,mdPreviewMode:f,renderOfficeLocal:p,performFind:g,findBarVisible:b,findQuery:h,t:A}){let w=Vue.reactive({}),S=Vue.ref([]),v=Vue.ref(-1),m=Vue.ref(!1),y=Vue.ref(!1),E=Vue.computed(()=>v.value>=0&&v.value<S.value.length?S.value[v.value]:null),$=null,U=()=>{$&&clearTimeout($),$=setTimeout(()=>{e.sendWsMessage({type:"update_file_tabs",openFiles:S.value.map(O=>({path:O.path})),activeIndex:v.value})},500)},V=O=>{O&&(l(O),S.value.length>0?w[O]={files:S.value.map(z=>({path:z.path,name:z.name,content:z.content,originalContent:z.originalContent,isDirty:z.isDirty,fileType:z.fileType})),activeIndex:v.value}:delete w[O],U())},L=O=>{if(r(),!O||!w[O]){S.value=[],v.value=-1;return}let z=w[O];S.value=z.files.map(te=>({...te,isDirty:te.isDirty||!1,originalContent:te.originalContent||te.content,cmInstance:null,fileType:te.fileType||Es(te.name||""),blobUrl:null,previewUrl:null,previewLoading:!1,localPreviewReady:!1,previewError:null})),v.value=z.activeIndex,Vue.nextTick(()=>{let te=E.value;te&&(!te.fileType||te.fileType==="text")&&n.value&&i(te)})};function _(O,z){let te=t(O),me=S.value.findIndex(ie=>ie.path===te);if(me>=0){v.value!==me&&(o(),a(),v.value=me,Vue.nextTick(()=>{let ie=S.value[me];ie&&ie.content!=null&&(!ie.fileType||ie.fileType==="text")&&i(ie)})),V(e.currentConversation);return}a();let pe=z||te.split(/[/\\]/).pop(),ve=Es(pe);S.value.push({path:te,name:pe,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:ve,blobUrl:null,previewUrl:null,previewLoading:ve!=="text",localPreviewReady:!1,previewError:null}),v.value=S.value.length-1,m.value=!0,ve==="text"&&r(),V(e.currentConversation),u.value=`Loading: ${O}`,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:O,workDir:s(),_clientId:e.clientId})}let P=O=>{O!==v.value&&(o(),a(),v.value=O,V(e.currentConversation),Vue.nextTick(()=>{let z=S.value[O];z&&(!z.fileType||z.fileType==="text"?At(z.name)?f.value=!0:z.content!=null&&n.value&&(i(z),b.value&&h.value&&Vue.nextTick(()=>g())):z.fileType==="office"&&z.localPreviewReady&&Vue.nextTick(()=>p(z)))}))},I=O=>{let z=S.value[O];if(z?.isDirty&&!confirm(A("files.unsavedConfirm",{name:z.name})))return;c(e.currentConversation,z.path),z.blobUrl&&URL.revokeObjectURL(z.blobUrl);let te=O===v.value;S.value.splice(O,1),S.value.length===0?(v.value=-1,r()):v.value>=S.value.length?v.value=S.value.length-1:v.value>O?v.value--:te&&v.value>=S.value.length&&(v.value=S.value.length-1),V(e.currentConversation),S.value.length>0&&te&&Vue.nextTick(()=>{let me=S.value[v.value];me&&(!me.fileType||me.fileType==="text")&&me.content!=null&&n.value&&i(me)})};function D(){let O=E.value;!O||!O.isDirty||(y.value=!0,e.sendWsMessage({type:"write_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:O.path,content:O.content,workDir:s(),_clientId:e.clientId}))}return{fileTabsMap:w,openFiles:S,activeFileIndex:v,activeFile:E,fileLoading:m,fileSaving:y,saveTabsState:V,restoreTabsState:L,openFileInTab:_,switchToTab:P,closeFileTab:I,saveFile:D,handleConversationDeleted:O=>{let{conversationId:z}=O.detail;z&&(delete w[z],d(z))}}}var Xu=H(()=>{vn()});function Zu({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:f,qo:p,ops:g,mdPreviewMode:b,renderOfficeLocal:h,editorContainer:A,debugStatus:w}){return{handleWorkbenchMessage:m=>{let y=m.detail;if(y)switch(y.type){case"directory_listing":{if(y.conversationId==="_folder_picker"){f.handleFolderPickerListing(y);return}u.handleDirectoryListing(y);break}case"file_content":{if(o.value=!1,y.error){w.value=`Error: ${y.error}`,g.clearPendingDownload();let U=t(y.filePath),V=n.value.find(L=>L.path===U);V&&(V.previewLoading=!1,V.previewError=y.error);return}let E=t(y.filePath);if(g.getPendingDownload()&&t(g.getPendingDownload())===E){g.clearPendingDownload();try{if(y.binary){let U=`${location.protocol}//${location.host}/api/preview/${y.fileId}?token=${y.previewToken}`,V=document.createElement("a");V.href=U,V.download=E.split("/").pop()||"download",document.body.appendChild(V),V.click(),document.body.removeChild(V)}else{let U=new Blob([y.content||""],{type:"application/octet-stream"}),V=URL.createObjectURL(U),L=document.createElement("a");L.href=V,L.download=E.split("/").pop()||"download",document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(V)}}catch{}return}let $=n.value.findIndex(U=>U.path===E);if($>=0){let U=n.value[$];if(y.binary){U.previewLoading=!1;let V=`${location.protocol}//${location.host}/api/preview/${y.fileId}?token=${y.previewToken}`,L=U.fileType||Es(U.name);U.fileType=L,L==="pdf"||L==="image"?fetch(V).then(_=>_.blob()).then(_=>{U.blobUrl=URL.createObjectURL(_)}).catch(_=>{U.previewError=_.message}):L==="office"&&((localStorage.getItem("officePreviewMode")||"local")==="online"?U.previewUrl="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(V):fetch(V).then(P=>P.arrayBuffer()).then(P=>{U._arrayBuffer=P,U.localPreviewReady=!0,$===i.value&&Vue.nextTick(()=>h(U))}).catch(P=>{U.previewError=P.message})),l(e.currentConversation);return}U.content=y.content||"",U.originalContent=y.content||"",U.isDirty=!1,l(e.currentConversation),$===i.value&&(At(U.name)&&b.value||Vue.nextTick(()=>{setTimeout(()=>c(U),100)}))}break}case"file_saved":{if(a.value=!1,y.error)return;let E=t(y.filePath),$=n.value.find(U=>U.path===E);$&&($.originalContent=$.content,$.isDirty=!1,l(e.currentConversation));break}case"file_search_result":{p.handleFileSearchResult(y);break}case"file_op_result":{g.handleFileOpResult(y,u.loadTreeDirectory,u.treeRootPath.value);break}case"file_tabs_restored":{if(y.openFiles?.length>0&&n.value.length===0){let E=y.activeIndex||0,$=y.openFiles.length;for(let U of y.openFiles){let V=t(U.path),L=V.split("/").pop(),_=Es(L);n.value.push({path:V,name:L,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:_,blobUrl:null,previewUrl:null,previewLoading:_!=="text",localPreviewReady:!1,previewError:null}),e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:U.path})}i.value=E>=0&&E<$?E:0}break}}},handleOpenFile:m=>{let{filePath:y}=m.detail,E=t(y);d(E,E.split("/").pop())}}}var Ju=H(()=>{vn()});var ep,tp=H(()=>{Lo();Ou();Nu();qu();vn();zu();Ku();Yu();Xu();Ju();ep={name:"FilesTab",template:`
2214
+ `,setup(){let e=Pinia.useChatStore(),t=Vue.inject("t"),s=x=>x.split(/[/\\]/).pop()||x,n=x=>{let T=x.split(/[/\\]/);return T.pop(),T.join("/")},i=x=>Mi(s(x)),r=Vue.ref(null),o=Vue.reactive({staged:!1,modified:!1,untracked:!1}),a=x=>{o[x]=!o[x]},l=Vue.ref(!1),c=Vue.ref(""),d=Vue.ref(null),u=Vue.ref([]),f=Vue.computed(()=>e.effectiveWorkDir||""),p=Vue.ref(""),g=Vue.computed(()=>p.value.trim()||f.value),b=Vue.ref(null),h=Vue.ref(!1),A=Vue.ref(!1),w=Vue.ref(""),S=Vue.ref(null),v=Vue.ref([]),m=Vue.ref(null),y=Vue.ref(!0),E=Vue.ref(!1),$=Vue.ref(""),U=Vue.ref(null),V=Vue.ref(0),L=Vue.ref(0),_=x=>x==null||x===""?"":Tu(x,b.value||""),P=Vue.ref(parseInt(localStorage.getItem("gitDiffFontSize"))||12),I=x=>{P.value=Math.max(8,Math.min(24,x)),localStorage.setItem("gitDiffFontSize",P.value.toString())},D=()=>I(P.value+1),B=()=>I(P.value-1),O=x=>{x.deltaY<0?D():x.deltaY>0&&B()},z=Vue.computed(()=>{let x=v.value;if(!x||x.length===0)return[];let T=x.length,q=[],Z=0;for(;Z<T;){let ae=x[Z];if(ae.type==="addition"||ae.type==="deletion"||ae.type==="modification"){let W=ae.type==="modification"?"modification":ae.type,J=Z;for(;Z<T&&(x[Z].type===W||x[Z].type==="modification"&&W!=="modification");)Z++;let de=Z-J;q.push({type:W,top:J/T*100,height:Math.max(de/T*100,.5)})}else Z++}return q}),te=x=>{let T=r.value;if(!T)return;let q=x.currentTarget.getBoundingClientRect(),Z=(x.clientY-q.top)/q.height;T.scrollTop=Z*(T.scrollHeight-T.clientHeight)},me=Vue.computed(()=>u.value.filter(x=>x.indexStatus!==" "&&x.indexStatus!=="?")),pe=Vue.computed(()=>u.value.filter(x=>x.workTreeStatus==="M"||x.workTreeStatus==="D")),ve=Vue.computed(()=>u.value.filter(x=>x.indexStatus==="?"&&x.workTreeStatus==="?")),ie=_u(e,{effectiveGitWorkDir:g,gitOperating:E,gitOpFeedback:U,commitMessage:$}),ke=()=>ie.loadGitStatus(l,c),M=()=>{ke()},j=Ru(e,g),re=x=>Pi(x),ge=()=>j.confirmFolderPicker(p,ke),Ce=(x,T)=>{b.value=x.path,h.value=T,A.value=!0,w.value="",S.value=null,v.value=[],m.value=null;let q=x.indexStatus==="?"&&x.workTreeStatus==="?";e.sendWsMessage({type:"git_diff",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,workDir:g.value,filePath:x.path,staged:T,untracked:q,fullFile:y.value,_clientId:e.clientId})},De=()=>{if(y.value=!y.value,b.value){let x=u.value.find(T=>T.path===b.value);x&&Ce(x,h.value)}},ee=x=>{let T=x.detail;if(T)switch(T.type){case"directory_listing":{if(j.handleDirectoryListing(T))return;break}case"git_status_result":{if(l.value=!1,T.error){c.value=T.error,d.value=null,u.value=[];return}if(c.value="",d.value=T.branch||"HEAD",u.value=T.files||[],V.value=T.ahead||0,L.value=T.behind||0,b.value){let q=u.value.find(Z=>Z.path===b.value);if(q){let Z=q.indexStatus!==" "&&q.indexStatus!=="?";h.value=Z}else b.value=null,S.value=null,v.value=[],m.value=null}break}case"git_diff_result":{if(A.value=!1,T.error){w.value=T.error;return}w.value="";let q=Pu(T.diff,T.newFileContent,t);m.value=q.stats,v.value=q.lines,S.value=q.content;break}case"git_op_result":{ie.handleGitOpResult(T,ke);break}}};Vue.watch(()=>e.currentAgent,()=>{d.value=null,u.value=[],c.value="",b.value=null,S.value=null,e.currentAgent&&Vue.nextTick(()=>ke())}),Vue.watch(()=>e.currentConversation,()=>{e.currentAgent&&(b.value=null,S.value=null,v.value=[],m.value=null,Vue.nextTick(()=>ke()))});let K=()=>ke();return Vue.onMounted(()=>{window.addEventListener("workbench-message",ee),e.currentAgent&&ke()}),Vue.onUnmounted(()=>{window.removeEventListener("workbench-message",ee),ie.cleanup()}),{store:e,getFileName:s,getDirName:n,getFileIconHtml:i,hlLine:_,collapsedGroups:o,toggleGroup:a,gitLoading:l,gitError:c,gitBranch:d,gitFiles:u,gitWorkDir:p,defaultWorkDir:f,changeGitWorkDir:M,stagedFiles:me,modifiedFiles:pe,untrackedFiles:ve,selectedGitFile:b,selectedStaged:h,diffLoading:A,diffError:w,diffContent:S,diffLines:v,diffStats:m,diffFullFile:y,toggleDiffMode:De,scrollMarkers:z,diffScrollContainer:r,onMarkerClick:te,fontSize:P,zoomIn:D,zoomOut:B,onWheel:O,gitOperating:E,commitMessage:$,gitOpFeedback:U,gitAhead:V,gitBehind:L,stageFile:ie.stageFile,unstageFile:ie.unstageFile,discardFile:ie.discardFile,stageAll:ie.stageAll,unstageAll:ie.unstageAll,commitChanges:ie.commitChanges,pushChanges:ie.pushChanges,selectGitFile:Ce,refresh:K,folderPickerOpen:j.folderPickerOpen,folderPickerPath:j.folderPickerPath,folderPickerEntries:j.folderPickerEntries,folderPickerLoading:j.folderPickerLoading,folderPickerSelected:j.folderPickerSelected,getFolderIcon:re,openFolderPicker:j.openFolderPicker,folderPickerNavigateUp:j.folderPickerNavigateUp,folderPickerSelectItem:j.folderPickerSelectItem,folderPickerEnter:j.folderPickerEnter,confirmFolderPicker:ge}}}});function Fu(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=[],f=[],p=()=>{let V=e.value?.cmInstance;if(!V)return;let _=V.getWrapperElement().querySelector(".cm-find-scrollbar-annotations");_&&_.remove()},g=()=>{let V=e.value?.cmInstance;if(!V||f.length===0)return;p();let L=V.getWrapperElement();if(!L.querySelector(".CodeMirror-vscrollbar"))return;let P=V.lineCount();if(P===0)return;let I=document.createElement("div");I.className="cm-find-scrollbar-annotations";for(let D of f){let B=D.from.line/P*100,O=document.createElement("div");O.className="cm-find-scrollbar-tick",O.style.top=B+"%",I.appendChild(O)}L.appendChild(I)},b=()=>{for(let V of u)try{V.clear()}catch{}u=[],f=[],a.value=0,l.value=-1,p()},h=V=>{let L=e.value?.cmInstance;if(!L||!f[V])return;for(let P=0;P<u.length;P++){if(!u[P])continue;let I=u[P].find();I&&(u[P].clear(),u[P]=L.markText(I.from,I.to,{className:"cm-find-highlight"}))}let _=f[V];if(u[V]){let P=u[V].find();P&&(u[V].clear(),u[V]=L.markText(P.from,P.to,{className:"cm-find-highlight cm-find-current"}))}setTimeout(()=>{L.scrollIntoView({from:_.from,to:_.to},100)},0)},A=()=>{b();let V=e.value?.cmInstance;if(!V||!n.value)return;let L=n.value;if(L.length<3)return;let _=V.getValue(),P=r.value,I=o.value,D=[];try{if(I){let B=P?"g":"gi",O=new RegExp(L,B),z;for(;(z=O.exec(_))!==null;){if(z[0].length===0){O.lastIndex++;continue}let te=V.posFromIndex(z.index),me=V.posFromIndex(z.index+z[0].length);if(D.push({from:te,to:me}),D.length>1e4)break}}else{let B=P?L:L.toLowerCase(),O=P?_:_.toLowerCase(),z=0;for(;(z=O.indexOf(B,z))!==-1;){let te=V.posFromIndex(z),me=V.posFromIndex(z+L.length);if(D.push({from:te,to:me}),z+=L.length,D.length>1e4)break}}}catch{return}f=D,a.value=D.length;for(let B of D)u.push(V.markText(B.from,B.to,{className:"cm-find-highlight"}));if(D.length>0){let B=V.getCursor(),O=0;for(let z=0;z<D.length;z++){if(CodeMirror.cmpPos(D[z].from,B)>=0){O=z;break}z===D.length-1&&(O=0)}l.value=O,h(O)}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(f.length===0)return;let V=(l.value+1)%f.length;l.value=V,h(V)},findPrev:()=>{if(f.length===0)return;let V=(l.value-1+f.length)%f.length;l.value=V,h(V)},openFindBar:(V=!1)=>{t.value=!0,s.value=V;let L=e.value?.cmInstance;if(L){let _=L.getSelection();_&&(n.value=_)}Vue.nextTick(()=>{c.value?.focus(),c.value?.select(),n.value&&A()})},closeFindBar:()=>{b(),t.value=!1,s.value=!1;let V=e.value?.cmInstance;V&&V.focus()},toggleReplaceBar:()=>{s.value=!s.value,s.value&&Vue.nextTick(()=>d.value?.focus())},replaceOne:()=>{let V=e.value?.cmInstance;if(!V||f.length===0||l.value<0)return;let L=f[l.value];V.replaceRange(i.value,L.from,L.to),A()},replaceAll:()=>{let V=e.value?.cmInstance;!V||f.length===0||(V.operation(()=>{for(let L=f.length-1;L>=0;L--)V.replaceRange(i.value,f[L].from,f[L].to)}),A())}}}var Ou=H(()=>{});function Hu(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(""),f=Vue.ref("file"),p=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}),w=Vue.ref(!1),S=Vue.ref(""),v=Vue.ref(null),m=null,y=Vue.reactive({dragging:null,dropTarget:null}),E=Vue.ref(!1),$=(W,J)=>{l&&clearTimeout(l),a.value={ok:W,message:J},l=setTimeout(()=>{a.value=null},4e3)},U=()=>{o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,$(!1,"Operation timed out"))},15e3)},V=W=>{i.has(W)?i.delete(W):i.add(W)},L=()=>{i.clear(),r.value=-1},_=W=>{f.value=W,u.value="",d.value=!0,Vue.nextTick(()=>p.value?.focus())},P=()=>{let W=u.value.trim();if(!W)return;d.value=!1;let J=n.value||s();if(!J)return;let de=J.includes("\\")?"\\":"/",oe=J.replace(/[/\\]$/,"")+de+W;U(),e.sendWsMessage({type:"create_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:oe,isDirectory:f.value==="directory",workDir:s(),_clientId:e.clientId})},I=(W,J)=>{let de=W.path.split("/").pop();confirm(J("files.deleteConfirm",{name:de})+(W.type==="directory"?J("files.deleteDirHint"):""))&&(U(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],workDir:s(),_clientId:e.clientId}))},D=W=>{let J=i.size;J!==0&&confirm(W("files.deleteSelectedConfirm",{count:J}))&&(U(),e.sendWsMessage({type:"delete_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...i],workDir:s(),_clientId:e.clientId}))},B=()=>{b.value=n.value||s()||"",g.value=!0,Vue.nextTick(()=>h.value?.focus())},O=()=>{let W=b.value.trim();!W||i.size===0||(g.value=!1,U(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[...i],destination:W,workDir:s(),_clientId:e.clientId}))},z=(W,J)=>{let Me=W.clientX,_e=W.clientY;Me+180>window.innerWidth&&(Me=window.innerWidth-180),_e+240>window.innerHeight&&(_e=window.innerHeight-240),A.entry=J,A.x=Me,A.y=_e,A.visible=!0},te=()=>{A.visible=!1};return{selectedPaths:i,lastClickedIndex:r,fileOperating:o,fileOpFeedback:a,newFileDialogVisible:d,newFileName:u,newFileType:f,newFileInput:p,moveDialogVisible:g,moveDestination:b,moveDestInput:h,contextMenu:A,renameDialogVisible:w,renameNewName:S,renameInput:v,dragState:y,externalDropActive:E,showFileOpFeedback:$,toggleSelection:V,clearSelection:L,showNewFileDialog:_,confirmNewFile:P,deleteSingleFile:I,deleteSelected:D,openMoveDialog:B,confirmMove:O,showContextMenu:z,hideContextMenu:te,ctxRename:()=>{let W=A.entry;te(),W&&(S.value=W.name,w.value=!0,Vue.nextTick(()=>{let J=v.value;if(J)if(J.focus(),W.type==="file"){let de=W.name.lastIndexOf(".");de>0?J.setSelectionRange(0,de):J.select()}else J.select()}))},confirmRename:()=>{let W=A.entry,J=S.value.trim();if(!J||!W||J===W.name){w.value=!1;return}w.value=!1;let de=W.path.replace(/\/$/,"").split("/");de.pop();let oe=de.join("/")||"/";U(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],destination:oe,newName:J,workDir:s(),_clientId:e.clientId})},ctxCopy:()=>{let W=A.entry;if(te(),!W)return;let J=W.path.replace(/\/$/,"").split("/");J.pop();let de=J.join("/")||"/";U(),e.sendWsMessage({type:"copy_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[W.path],destination:de,workDir:s(),_clientId:e.clientId})},ctxMoveTo:()=>{let W=A.entry;te(),W&&(i.clear(),i.add(W.path),B())},ctxDelete:W=>{let J=A.entry;te(),J&&I(J,W)},ctxDownload:()=>{let W=A.entry;te(),!(!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)=>{y.dragging=J,W.dataTransfer.setData("text/plain",J.path),W.dataTransfer.effectAllowed="move"},onDragOver:(W,J)=>{if(!y.dragging&&W.dataTransfer.types.includes("Files")){J.type==="directory"&&(W.dataTransfer.dropEffect="copy",y.dropTarget=J.path);return}!y.dragging||J.type!=="directory"||J.path!==y.dragging.path&&(J.path.startsWith(y.dragging.path+"/")||(W.dataTransfer.dropEffect="move",y.dropTarget=J.path))},onDragLeave:W=>{let J=W.relatedTarget;J&&W.currentTarget.contains(J)||(y.dropTarget=null)},onDrop:(W,J,de)=>{if(y.dropTarget=null,!y.dragging&&W.dataTransfer.files.length>0&&J.type==="directory"){de(W.dataTransfer.files,J.path);return}if(!y.dragging||J.type!=="directory"){y.dragging=null;return}if(J.path===y.dragging.path){y.dragging=null;return}U(),e.sendWsMessage({type:"move_files",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,paths:[y.dragging.path],destination:J.path,workDir:s(),_clientId:e.clientId}),y.dragging=null},onTreeDragOver:W=>{y.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,de)=>{if(E.value=!1,!y.dragging&&W.dataTransfer.files.length>0){let oe=n.value||J||s();de(W.dataTransfer.files,oe)}},handleExternalFileDrop:async(W,J)=>{if(!J)return;let de=[],oe=[];for(let Me of W)oe.push(new Promise(_e=>{let Ve=new FileReader;Ve.onload=()=>{let qe=btoa(new Uint8Array(Ve.result).reduce((xt,dt)=>xt+String.fromCharCode(dt),""));de.push({name:Me.name,data:qe}),_e()},Ve.onerror=()=>_e(),Ve.readAsArrayBuffer(Me)}));await Promise.all(oe),de.length!==0&&(o.value=!0,c&&clearTimeout(c),c=setTimeout(()=>{o.value&&(o.value=!1,$(!1,"Upload timed out"))},3e4),e.sendWsMessage({type:"upload_to_dir",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,files:de,dirPath:J,workDir:s(),_clientId:e.clientId}))},handleFileOpResult:(W,J,de)=>{o.value=!1,c&&(clearTimeout(c),c=null),$(W.success,W.success?W.message:W.error||"Operation failed"),W.success&&(de&&J(de),(W.operation==="delete"||W.operation==="move")&&(i.clear(),r.value=-1))},getPendingDownload:()=>m,clearPendingDownload:()=>{m=null},cleanup:()=>{l&&clearTimeout(l),c&&clearTimeout(c)}}}var Nu=H(()=>{});function Bu(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),f=Vue.computed(()=>{if(!l.value)return"EXPLORER";let _=l.value.replace(/[\\/]+$/,"").split(/[\\/]/);return(_[_.length-1]||l.value).toUpperCase()}),p=Vue.computed(()=>l.value?!!c[l.value]?.expanded:!1),g=()=>{if(!l.value)return;let _=c[l.value];_&&(_.expanded=!_.expanded)},b=()=>{for(let _ of Object.keys(c))c[_]&&(c[_].expanded=!1)},h=()=>{d.value=!0,Vue.nextTick(()=>u.value?.focus())},A=()=>{d.value=!1,m()},w=()=>{d.value=!1},S=Vue.computed(()=>{let _=[],P=(I,D)=>{let B=c[I];if(!(!B||!B.entries))for(let O of B.entries)_.push({...O,depth:D}),O.type==="directory"&&c[O.path]?.expanded&&P(O.path,D+1)};return l.value&&c[l.value]?.expanded&&P(l.value,0),_}),v=_=>{let P=s(_);c[P]?c[P].loading=!0:c[P]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:_,workDir:t(),_clientId:e.clientId})},m=()=>{let _=a.value.trim();if(!_)return;let P=s(_);l.value=P,Object.keys(c).forEach(I=>delete c[I]),c[P]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:_,workDir:t(),_clientId:e.clientId})},y=_=>{let P=s(_),I=c[P];I?I.loaded?I.expanded=!I.expanded:(I.expanded=!0,v(_)):(c[P]={entries:[],expanded:!0,loaded:!1,loading:!1},v(_))},E=(_,P)=>{let I=S.value,D=I.findIndex(B=>B.path===_.path);if(P&&(P.shiftKey||P.ctrlKey||P.metaKey)){if(P.shiftKey&&i.value>=0&&D>=0){let B=Math.min(i.value,D),O=Math.max(i.value,D);!P.ctrlKey&&!P.metaKey&&n.clear();for(let z=B;z<=O;z++)n.add(I[z].path)}else n.has(_.path)?n.delete(_.path):n.add(_.path);i.value=D;return}n.size>0&&(n.clear(),i.value=-1),_.type==="directory"?y(_.path):r(_.path,_.name),i.value=D},$=_=>{let P=s(_.dirPath);if(_.error){c[P]&&(c[P].loading=!1);return}let I=(_.entries||[]).sort((O,z)=>O.type===z.type?O.name.localeCompare(z.name):O.type==="directory"?-1:1),D=P.replace(/\/$/,""),B=I.map(O=>({...O,path:D+"/"+O.name}));c[P]?(c[P].entries=B,c[P].loaded=!0,c[P].loading=!1):c[P]={entries:B,expanded:!0,loaded:!0,loading:!1},P===l.value&&(a.value=_.dirPath)},U=()=>{Object.keys(c).forEach(_=>delete c[_])};return{treePath:a,treeRootPath:l,treeNodes:c,flattenedTree:S,editingTreePath:d,treePathInputRef:u,rootFolderName:f,rootExpanded:p,toggleRootExpand:g,collapseAll:b,startTreePathEdit:h,confirmTreePath:A,cancelTreePathEdit:w,loadTreeDirectory:v,loadRootDirectory:m,toggleDirectory:y,onTreeItemClick:E,handleDirectoryListing:$,clearTreeNodes:U,initFileBrowser:()=>{let _=t();if(_){let P=s(_);a.value=_,l.value=P,U(),v(_)}},refresh:()=>{l.value&&v(l.value)}}}var qu=H(()=>{});function Es(e){let t=e.lastIndexOf(".");if(t<0)return"text";let s=e.substring(t).toLowerCase();return fh.has(s)?"office":gh.has(s)?"pdf":mh.has(s)?"image":"text"}function At(e){let t=e.lastIndexOf(".");return t<0?!1:hh.has(e.substring(t).toLowerCase())}function vh(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 Wu(e,{activeFile:t,editorContainer:s,fontSize:n,clearFindMarkers:i,openFindBar:r,saveFile:o}){let a=Vue.ref(""),l=Vue.reactive({}),c=()=>{},d=()=>{},u=({openQuickOpen:w,openGoToLine:S})=>{c=w,d=S},f=(w,S=0)=>{if(!s.value){S<20&&setTimeout(()=>f(w,S+1),100);return}if(!w)return;if(s.value.innerHTML="",typeof CodeMirror>"u"){let y=document.createElement("textarea");y.value=w.content||"",y.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;",y.spellcheck=!1,y.addEventListener("input",()=>{w.content=y.value,w.isDirty=y.value!==w.originalContent}),y.addEventListener("keydown",E=>{(E.ctrlKey||E.metaKey)&&E.key==="s"&&(E.preventDefault(),o())}),s.value.appendChild(y),a.value="";return}let m=document.documentElement.getAttribute("data-theme")==="dark"?"material-darker":"default";try{let y=CodeMirror(s.value,{value:w.content||"",mode:vh(w.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)}});y.on("change",()=>{let $=y.getValue();w.content=$,w.isDirty=$!==w.originalContent}),w.cmInstance=y,y.getWrapperElement().style.fontSize=n.value+"px";let E=e.currentConversation;E&&l[E]?.[w.path]&&y.setHistory(l[E][w.path]),Vue.nextTick(()=>{y.refresh(),setTimeout(()=>y.refresh(),200)}),a.value=""}catch(y){a.value=`Editor error: ${y.message}`}};return{debugStatus:a,undoHistoryMap:l,createEditor:f,destroyEditor:()=>{i();let w=t.value;w?.cmInstance&&(w.cmInstance.toTextArea&&w.cmInstance.toTextArea(),w.cmInstance=null),s.value&&(s.value.innerHTML="")},setKeyBindings:u,saveCurrentUndoHistory:()=>{let w=e.currentConversation;if(!w)return;let S=t.value;S?.cmInstance&&(l[w]||(l[w]={}),l[w][S.path]=S.cmInstance.getHistory())},saveAllUndoHistory:w=>{if(!w)return;let S=t.value;S?.cmInstance&&(l[w]||(l[w]={}),l[w][S.path]=S.cmInstance.getHistory())},cleanupUndoHistory:(w,S)=>{w&&l[w]&&delete l[w][S]},deleteConversationHistory:w=>{delete l[w]}}}var fh,gh,mh,hh,vn=H(()=>{fh=new Set([".docx",".xlsx",".xls",".pptx",".ppt"]),gh=new Set([".pdf"]),mh=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico"]),hh=new Set([".md",".markdown",".mdx"])});function Uu(e,{editorContainer:t,createEditor:s,t:n}){let i=Vue.ref(!0),r=Vue.ref(null),o=Vue.ref(null),a=Vue.computed(()=>{let p=e.value;return!!(p&&At(p.name))}),l=Vue.computed(()=>{let p=e.value;if(!p||!At(p.name)||p.content==null)return"";try{if(typeof marked<"u")return marked.parse(p.content)}catch{}return"<pre>"+(p.content||"")+"</pre>"});function c(){je(r.value)}async function d(){await je(r.value)}function u(){i.value=!1,Vue.nextTick(()=>{let p=e.value;p&&t.value&&s(p)})}return{mdPreviewMode:i,mdPreviewRef:r,officePreviewContainer:o,isActiveMarkdown:a,mdRenderedHtml:l,initMermaid:c,renderMermaidBlocks:d,switchToMdEdit:u,renderOfficeLocal:p=>{let g=o.value;if(!g||!p._arrayBuffer)return;g.innerHTML="";let b=("."+p.name.split(".").pop()).toLowerCase();if(b===".docx"&&window.docx)window.docx.renderAsync(p._arrayBuffer,g,null,{className:"docx-preview-content",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!0}).catch(h=>{p.previewError=h.message});else if(b===".xlsx"||b===".xls")try{let h=XLSX.read(p._arrayBuffer,{type:"array"}),A=h.SheetNames[0],w=XLSX.utils.sheet_to_html(h.Sheets[A],{editable:!1});g.innerHTML='<div class="xlsx-sheet-tabs">'+h.SheetNames.map((S,v)=>`<button class="xlsx-sheet-tab${v===0?" active":""}" data-idx="${v}">${S}</button>`).join("")+'</div><div class="xlsx-table-wrap">'+w+"</div>",g.querySelectorAll(".xlsx-sheet-tab").forEach(S=>{S.addEventListener("click",()=>{let v=parseInt(S.dataset.idx),m=h.SheetNames[v],y=XLSX.utils.sheet_to_html(h.Sheets[m],{editable:!1});g.querySelector(".xlsx-table-wrap").innerHTML=y,g.querySelectorAll(".xlsx-sheet-tab").forEach(E=>E.classList.remove("active")),S.classList.add("active")})})}catch(h){p.previewError=h.message}else(b===".pptx"||b===".ppt")&&(g.innerHTML='<div class="preview-unsupported">'+(n?n("files.pptxNotSupported"):"PowerPoint preview not supported")+"</div>")}}}var zu=H(()=>{ln();vn()});function ju(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,f=Vue.ref(!1),p=Vue.ref(""),g=Vue.ref([]),b=Vue.ref(0),h=Vue.ref(!1),A=Vue.ref(null),w=null,S=Vue.ref(!1),v=Vue.ref(""),m=Vue.ref(null),y=pe=>{!e.currentAgent||!pe.trim()||e.sendWsMessage({type:"file_search",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,query:pe.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(()=>{y(l.value)},300)},$=()=>{l.value="",c.value=[],d.value=!1},U=pe=>{if(pe.type==="directory"){let ve=i(pe.fullPath);r.value=ve,s.value=pe.fullPath,Object.keys(o).forEach(ie=>delete o[ie]),a(pe.fullPath),$()}else n(pe.fullPath,pe.name),$()},V=()=>{f.value=!0,p.value="",g.value=[],b.value=0,h.value=!1,Vue.nextTick(()=>A.value?.focus())},L=()=>{f.value=!1,p.value="",g.value=[]},_=()=>{if(w&&clearTimeout(w),!p.value.trim()){g.value=[],h.value=!1;return}h.value=!0,b.value=0,w=setTimeout(()=>{y(p.value)},200)},P=()=>{g.value.length>0&&(b.value=(b.value+1)%g.value.length)},I=()=>{g.value.length>0&&(b.value=(b.value-1+g.value.length)%g.value.length)},D=pe=>{pe.type!=="directory"&&n(pe.fullPath,pe.name),L()},B=()=>{let pe=g.value[b.value];pe&&D(pe)},O=()=>{S.value=!0,v.value="",Vue.nextTick(()=>m.value?.focus())},z=()=>{S.value=!1,v.value=""};return{searchQuery:l,searchResults:c,searchLoading:d,onSearchInput:E,clearSearch:$,onSearchResultClick:U,quickOpenVisible:f,quickOpenQuery:p,quickOpenResults:g,quickOpenSelectedIndex:b,quickOpenLoading:h,quickOpenInput:A,openQuickOpen:V,closeQuickOpen:L,onQuickOpenInput:_,quickOpenSelectNext:P,quickOpenSelectPrev:I,quickOpenConfirm:B,quickOpenOpenFile:D,goToLineVisible:S,goToLineValue:v,goToLineInput:m,openGoToLine:O,closeGoToLine:z,goToLineConfirm:pe=>{let ve=parseInt(v.value);if(isNaN(ve)||ve<1)return;let ie=pe.value;if(ie?.cmInstance){let ke=ie.cmInstance,M=Math.min(ve-1,ke.lineCount()-1);ke.setCursor({line:M,ch:0}),ke.scrollIntoView({line:M,ch:0},100),ke.focus()}z()},handleFileSearchResult:pe=>{let ve=pe.results||[];f.value?pe.query&&pe.query.trim()===p.value.trim()&&(g.value=ve,h.value=!1,b.value=0):pe.query&&pe.query.trim()===l.value.trim()&&(c.value=ve,d.value=!1)}}}var Ku=H(()=>{});function Gu(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(""),f=()=>{a.value=!0,u.value="",d.value=!0;let S=s.value||t()||"";l.value=S,c.value=[],e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})},p=S=>{d.value=!0,u.value="",e.sendWsMessage({type:"list_directory",conversationId:"_folder_picker",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})};return{folderPickerOpen:a,folderPickerPath:l,folderPickerEntries:c,folderPickerLoading:d,folderPickerSelected:u,openFolderPicker:f,folderPickerNavigateUp:()=>{if(!l.value)return;let S=l.value.includes("\\"),v=S?"\\":"/",m=l.value.replace(/[/\\]$/,"").split(/[/\\]/);if(m.pop(),m.length===0)l.value="",p("");else if(S&&m.length===1&&/^[A-Za-z]:$/.test(m[0]))l.value=m[0]+"\\",p(m[0]+"\\");else{let y=m.join(v);l.value=y,p(y)}},folderPickerSelectItem:S=>{u.value=S.name},folderPickerEnter:S=>{let v;if(!l.value)v=S.name+(S.name.endsWith("\\")?"":"\\");else{let m=l.value.includes("\\")||/^[A-Z]:/.test(S.name)?"\\":"/";v=l.value.replace(/[/\\]$/,"")+m+S.name}l.value=v,p(v)},confirmFolderPicker:()=>{let S=l.value;if(!S)return;if(u.value){let m=S.includes("\\")?"\\":"/";S=S.replace(/[/\\]$/,"")+m+u.value}s.value=S,a.value=!1;let v=r(S);n.value=v,Object.keys(i).forEach(m=>delete i[m]),i[v]={entries:[],expanded:!0,loaded:!1,loading:!0},e.sendWsMessage({type:"list_directory",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,dirPath:S,workDir:t(),_clientId:e.clientId})},handleFolderPickerListing:S=>{d.value=!1,c.value=(S.entries||[]).filter(v=>v.type==="directory").sort((v,m)=>v.name.localeCompare(m.name)),S.dirPath!=null&&(l.value=S.dirPath)}}}var Yu=H(()=>{});function Qu(e,{normalizePath:t,getEffectiveWorkDir:s,editorContainer:n,createEditor:i,destroyEditor:r,clearFindMarkers:o,saveCurrentUndoHistory:a,saveAllUndoHistory:l,cleanupUndoHistory:c,deleteConversationHistory:d,debugStatus:u,mdPreviewMode:f,renderOfficeLocal:p,performFind:g,findBarVisible:b,findQuery:h,t:A}){let w=Vue.reactive({}),S=Vue.ref([]),v=Vue.ref(-1),m=Vue.ref(!1),y=Vue.ref(!1),E=Vue.computed(()=>v.value>=0&&v.value<S.value.length?S.value[v.value]:null),$=null,U=()=>{$&&clearTimeout($),$=setTimeout(()=>{e.sendWsMessage({type:"update_file_tabs",openFiles:S.value.map(O=>({path:O.path})),activeIndex:v.value})},500)},V=O=>{O&&(l(O),S.value.length>0?w[O]={files:S.value.map(z=>({path:z.path,name:z.name,content:z.content,originalContent:z.originalContent,isDirty:z.isDirty,fileType:z.fileType})),activeIndex:v.value}:delete w[O],U())},L=O=>{if(r(),!O||!w[O]){S.value=[],v.value=-1;return}let z=w[O];S.value=z.files.map(te=>({...te,isDirty:te.isDirty||!1,originalContent:te.originalContent||te.content,cmInstance:null,fileType:te.fileType||Es(te.name||""),blobUrl:null,previewUrl:null,previewLoading:!1,localPreviewReady:!1,previewError:null})),v.value=z.activeIndex,Vue.nextTick(()=>{let te=E.value;te&&(!te.fileType||te.fileType==="text")&&n.value&&i(te)})};function _(O,z){let te=t(O),me=S.value.findIndex(ie=>ie.path===te);if(me>=0){v.value!==me&&(o(),a(),v.value=me,Vue.nextTick(()=>{let ie=S.value[me];ie&&ie.content!=null&&(!ie.fileType||ie.fileType==="text")&&i(ie)})),V(e.currentConversation);return}a();let pe=z||te.split(/[/\\]/).pop(),ve=Es(pe);S.value.push({path:te,name:pe,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:ve,blobUrl:null,previewUrl:null,previewLoading:ve!=="text",localPreviewReady:!1,previewError:null}),v.value=S.value.length-1,m.value=!0,ve==="text"&&r(),V(e.currentConversation),u.value=`Loading: ${O}`,e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:O,workDir:s(),_clientId:e.clientId})}let P=O=>{O!==v.value&&(o(),a(),v.value=O,V(e.currentConversation),Vue.nextTick(()=>{let z=S.value[O];z&&(!z.fileType||z.fileType==="text"?At(z.name)?f.value=!0:z.content!=null&&n.value&&(i(z),b.value&&h.value&&Vue.nextTick(()=>g())):z.fileType==="office"&&z.localPreviewReady&&Vue.nextTick(()=>p(z)))}))},I=O=>{let z=S.value[O];if(z?.isDirty&&!confirm(A("files.unsavedConfirm",{name:z.name})))return;c(e.currentConversation,z.path),z.blobUrl&&URL.revokeObjectURL(z.blobUrl);let te=O===v.value;S.value.splice(O,1),S.value.length===0?(v.value=-1,r()):v.value>=S.value.length?v.value=S.value.length-1:v.value>O?v.value--:te&&v.value>=S.value.length&&(v.value=S.value.length-1),V(e.currentConversation),S.value.length>0&&te&&Vue.nextTick(()=>{let me=S.value[v.value];me&&(!me.fileType||me.fileType==="text")&&me.content!=null&&n.value&&i(me)})};function D(){let O=E.value;!O||!O.isDirty||(y.value=!0,e.sendWsMessage({type:"write_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:O.path,content:O.content,workDir:s(),_clientId:e.clientId}))}return{fileTabsMap:w,openFiles:S,activeFileIndex:v,activeFile:E,fileLoading:m,fileSaving:y,saveTabsState:V,restoreTabsState:L,openFileInTab:_,switchToTab:P,closeFileTab:I,saveFile:D,handleConversationDeleted:O=>{let{conversationId:z}=O.detail;z&&(delete w[z],d(z))}}}var Xu=H(()=>{vn()});function Zu({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:f,qo:p,ops:g,mdPreviewMode:b,renderOfficeLocal:h,editorContainer:A,debugStatus:w}){return{handleWorkbenchMessage:m=>{let y=m.detail;if(y)switch(y.type){case"directory_listing":{if(y.conversationId==="_folder_picker"){f.handleFolderPickerListing(y);return}u.handleDirectoryListing(y);break}case"file_content":{if(o.value=!1,y.error){w.value=`Error: ${y.error}`,g.clearPendingDownload();let U=t(y.filePath),V=n.value.find(L=>L.path===U);V&&(V.previewLoading=!1,V.previewError=y.error);return}let E=t(y.filePath);if(g.getPendingDownload()&&t(g.getPendingDownload())===E){g.clearPendingDownload();try{if(y.binary){let U=`${location.protocol}//${location.host}/api/preview/${y.fileId}?token=${y.previewToken}`,V=document.createElement("a");V.href=U,V.download=E.split("/").pop()||"download",document.body.appendChild(V),V.click(),document.body.removeChild(V)}else{let U=new Blob([y.content||""],{type:"application/octet-stream"}),V=URL.createObjectURL(U),L=document.createElement("a");L.href=V,L.download=E.split("/").pop()||"download",document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(V)}}catch{}return}let $=n.value.findIndex(U=>U.path===E);if($>=0){let U=n.value[$];if(y.binary){U.previewLoading=!1;let V=`${location.protocol}//${location.host}/api/preview/${y.fileId}?token=${y.previewToken}`,L=U.fileType||Es(U.name);U.fileType=L,L==="pdf"||L==="image"?fetch(V).then(_=>_.blob()).then(_=>{U.blobUrl=URL.createObjectURL(_)}).catch(_=>{U.previewError=_.message}):L==="office"&&((localStorage.getItem("officePreviewMode")||"local")==="online"?U.previewUrl="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(V):fetch(V).then(P=>P.arrayBuffer()).then(P=>{U._arrayBuffer=P,U.localPreviewReady=!0,$===i.value&&Vue.nextTick(()=>h(U))}).catch(P=>{U.previewError=P.message})),l(e.currentConversation);return}U.content=y.content||"",U.originalContent=y.content||"",U.isDirty=!1,l(e.currentConversation),$===i.value&&(At(U.name)&&b.value||Vue.nextTick(()=>{setTimeout(()=>c(U),100)}))}break}case"file_saved":{if(a.value=!1,y.error)return;let E=t(y.filePath),$=n.value.find(U=>U.path===E);$&&($.originalContent=$.content,$.isDirty=!1,l(e.currentConversation));break}case"file_search_result":{p.handleFileSearchResult(y);break}case"file_op_result":{g.handleFileOpResult(y,u.loadTreeDirectory,u.treeRootPath.value);break}case"file_tabs_restored":{if(y.openFiles?.length>0&&n.value.length===0){let E=y.activeIndex||0,$=y.openFiles.length;for(let U of y.openFiles){let V=t(U.path),L=V.split("/").pop(),_=Es(L);n.value.push({path:V,name:L,content:null,originalContent:null,isDirty:!1,cmInstance:null,fileType:_,blobUrl:null,previewUrl:null,previewLoading:_!=="text",localPreviewReady:!1,previewError:null}),e.sendWsMessage({type:"read_file",conversationId:e.currentConversation||"_explorer",agentId:e.currentAgent,filePath:U.path})}i.value=E>=0&&E<$?E:0}break}}},handleOpenFile:m=>{let{filePath:y}=m.detail,E=t(y);d(E,E.split("/").pop())}}}var Ju=H(()=>{vn()});var ep,tp=H(()=>{Lo();Ou();Nu();qu();vn();zu();Ku();Yu();Xu();Ju();ep={name:"FilesTab",template:`
2215
2215
  <div class="files-tab file-two-col" :class="{ 'mobile-editor-view': isMobile && mobileView === 'editor' }" ref="rootEl">
2216
2216
  <!-- \u5DE6\u680F: \u5C42\u7EA7\u76EE\u5F55\u6811 -->
2217
2217
  <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"
@@ -2980,7 +2980,7 @@ ${String(e||"").trim()}
2980
2980
  </div>
2981
2981
  </template>
2982
2982
  </div>
2983
- `,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:mt,agentVisibleCount:mt,onlineVisibleCount:mt}},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=xe(),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=mt,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 ip(e){return!e||typeof e!="string"?{ok:!1,reason:"empty_or_non_string"}:e.length>40?{ok:!1,reason:"too_long"}:vh.test(e)?e.startsWith("_")?{ok:!1,reason:"underscore_prefix_reserved"}:yh.test(e)?{ok:!1,reason:"pure_digits"}:bh.includes(e.toLowerCase())?{ok:!1,reason:"reserved"}:{ok:!0}:{ok:!1,reason:"illegal_character"}}function rp(e){return typeof e=="string"&&kh.has(e)}function Rs(e){return wh[e]||e}var vh,yh,bh,wh,kh,op=H(()=>{vh=/^[A-Za-z0-9_-]+$/,yh=/^[0-9]+$/,bh=["all","user","system","everyone"];wh=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"}),kh=Object.freeze(new Set(["empty_or_non_string","too_long","illegal_character","underscore_prefix_reserved","pure_digits","reserved","duplicate"]))});var ap,lp=H(()=>{Is();gn();op();ap={name:"VpCrudPanel",props:{initialEditVpId:{type:String,default:""}},template:`
2983
+ `,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:mt,agentVisibleCount:mt,onlineVisibleCount:mt}},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=xe(),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=mt,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 ip(e){return!e||typeof e!="string"?{ok:!1,reason:"empty_or_non_string"}:e.length>40?{ok:!1,reason:"too_long"}:yh.test(e)?e.startsWith("_")?{ok:!1,reason:"underscore_prefix_reserved"}:bh.test(e)?{ok:!1,reason:"pure_digits"}:wh.includes(e.toLowerCase())?{ok:!1,reason:"reserved"}:{ok:!0}:{ok:!1,reason:"illegal_character"}}function rp(e){return typeof e=="string"&&Sh.has(e)}function Rs(e){return kh[e]||e}var yh,bh,wh,kh,Sh,op=H(()=>{yh=/^[A-Za-z0-9_-]+$/,bh=/^[0-9]+$/,wh=["all","user","system","everyone"];kh=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"}),Sh=Object.freeze(new Set(["empty_or_non_string","too_long","illegal_character","underscore_prefix_reserved","pure_digits","reserved","duplicate"]))});var ap,lp=H(()=>{Is();gn();op();ap={name:"VpCrudPanel",props:{initialEditVpId:{type:String,default:""}},template:`
2984
2984
  <div class="vp-crud-panel">
2985
2985
  <!-- LIST VIEW -->
2986
2986
  <div v-if="view === 'list'" class="vp-crud-body vp-crud-list">
@@ -4460,7 +4460,7 @@ ${String(e||"").trim()}
4460
4460
  <p class="pane-empty-text">{{ $t('splitScreen.selectFromSidebar') }}</p>
4461
4461
  </div>
4462
4462
  </div>
4463
- `,setup(e){let t=Pinia.useChatStore(),s=Vue.ref(null),n=Vue.computed(()=>t.activePanelId===e.paneId),i=Vue.computed(()=>t.panels.find(q=>q.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(T=>T.isStreaming)),l=Vue.computed(()=>o.value&&!a.value),c=Vue.ref(0),d=Vue.ref(Date.now()),u=null,f=Vue.ref("cat"),p=new URLSearchParams(window.location.search).get("preview"),g=Vue.ref(0),b=Vue.ref(1),h=Vue.ref(5),A=Vue.ref(95),w=Vue.ref("bark-both"),S=Vue.ref(1),v=Vue.ref(-1),m=null;function y(){if(!c.value)return;d.value=Date.now();let T=(d.value-c.value)%19e3;if(T<4e3)g.value=0,b.value=1;else if(T<11500){let q=T-4e3,Z;q<2500?Z=q/2500*16:q<5e3?Z=16+(q-2500)/2500*29:Z=45+(q-5e3)/2500*55,g.value=Z,b.value=1}else T<14e3?(g.value=(1-(T-11500)/2500)*100,b.value=-1):(g.value=0,b.value=1);u=requestAnimationFrame(y)}function E(){if(!c.value||f.value!=="dog")return;d.value=Date.now();let T=(d.value-c.value)%18e3;if(T<2e3)h.value=5,A.value=95,w.value="bark-both",S.value=1,v.value=-1;else if(T<5e3){let q=(T-2e3)/3e3;h.value=5+q*25,A.value=95,w.value="left-approach",S.value=1,v.value=-1}else if(T<8e3){let q=(T-5e3)/3e3;h.value=30,A.value=95-q*25,w.value="right-approach",S.value=1,v.value=-1}else if(T<1e4){let q=(T-8e3)/2e3;h.value=30+q*13,A.value=70-q*13,w.value="both-approach",S.value=1,v.value=-1}else if(T<11e3)h.value=43,A.value=57,w.value="snap",S.value=1,v.value=-1;else if(T<12500)h.value=43,A.value=57,w.value="stunned",S.value=1,v.value=-1;else if(T<15e3){let q=(T-12500)/2500;h.value=43-q*38,A.value=57+q*38,w.value="retreat",S.value=-1,v.value=1}else T<17e3?(h.value=5,A.value=95,w.value="rehang",S.value=-1,v.value=1):(h.value=5,A.value=95,w.value="reset",S.value=1,v.value=-1);m=requestAnimationFrame(E)}let $=Vue.computed(()=>{let T=h.value*1.2;return S.value<0?`translate(${T+13.5}, 0) scale(-1, 1)`:`translate(${T-13.5}, 0)`}),U=Vue.computed(()=>{let T=A.value*1.2;return v.value>0?`translate(${T-10.5}, 2)`:`translate(${T+10.5}, 2) scale(-1, 1)`}),V=Vue.computed(()=>{let T=w.value;return T==="bark-both"||T==="left-approach"||T==="right-approach"||T==="both-approach"||T==="reset"}),L=Vue.computed(()=>{let T=h.value*1.2,q=10;if(V.value){let W=Math.max(0,(T-3)*.12);return`M3,18 Q${(3+T)/2},${18+W} ${T},${q}`}if(w.value==="rehang")return`M${T},${q} Q${T-3},20 3,18`;let Z=S.value<0?1:-1,ae=T+Z*8;return`M${T},${q} Q${T},18 ${ae},22`}),_=Vue.computed(()=>{let T=A.value*1.2,q=10;if(V.value){let W=Math.max(0,(118-T)*.12);return`M118,18 Q${(118+T)/2},${18+W} ${T},${q}`}if(w.value==="rehang")return`M${T},${q} Q${T+3},20 118,18`;let Z=v.value>0?-1:1,ae=T+Z*8;return`M${T},${q} Q${T},18 ${ae},22`}),P=Vue.computed(()=>w.value==="snap"?.2:.4),I=Vue.computed(()=>w.value==="snap"?.2:.4),D=Vue.computed(()=>h.value*1.2),B=Vue.computed(()=>A.value*1.2),O=Vue.computed(()=>p==="cat"||p==="dog"||p==="animation"?!0:l.value);Vue.watch(l,T=>{T?(c.value=Date.now(),d.value=Date.now(),f.value="cat",g.value=0,b.value=1,h.value=5,A.value=95,w.value="bark-both",S.value=1,v.value=-1,f.value==="cat"?u=requestAnimationFrame(y):m=requestAnimationFrame(E)):(c.value=0,g.value=0,b.value=1,u&&(cancelAnimationFrame(u),u=null),m&&(cancelAnimationFrame(m),m=null))},{immediate:!0}),(p==="cat"||p==="dog"||p==="animation")&&(c.value=Date.now(),d.value=Date.now(),p==="dog"?f.value="dog":f.value="cat",f.value==="cat"?u=requestAnimationFrame(y):(h.value=5,A.value=95,w.value="bark-both",S.value=1,v.value=-1,m=requestAnimationFrame(E))),Vue.onUnmounted(()=>{u&&(cancelAnimationFrame(u),u=null),m&&(cancelAnimationFrame(m),m=null)});let z=Vue.computed(()=>{if(!o.value)return null;if(t.connectionState!=="connected")return"disconnected";let T=i.value;if(t.compactStatus?.conversationId===T&&t.compactStatus?.status==="compacting")return"compacting";let q=t.sessionHealth?.[T];return q?q.status:c.value&&d.value-c.value>8e3?"thinking":null}),te=Vue.computed(()=>{if(!c.value)return"speed-napping";let T=(d.value-c.value)%19e3;return T>=16e3?"speed-petted":T>=14e3?"speed-tired":T>=11500?"speed-crazy":T>=9e3?"speed-turbo":T>=6500?"speed-fast":T>=4e3?"speed-normal":"speed-napping"}),me=Vue.computed(()=>{let T=g.value,q=b.value,ae={left:`calc(40px + (100% - 80px) * ${T/100})`};return q<0&&(ae.transform="scaleX(-1)"),ae});function pe(){let T=i.value;if(!T)return;let q=t.conversations.find(Z=>Z.id===T);t.sendWsMessage({type:"refresh_conversation",conversationId:T,agentId:q?.agentId})}let ve=Vue.computed(()=>{let T=r.value,q=[],Z=null,ae=0,W=()=>{Z&&(Z.isActive=Z.isStreaming===!0,Kn(Z),(Z.textContent||Z.toolMsgs.length>0||Z.todoMsg||Z.askMsg)&&q.push(Z),Z=null)},J=()=>{ae++,Z={type:"assistant-turn",id:"turn_"+ae,textContent:"",textSegments:[],isStreaming:!1,isActive:!1,isHistory:!1,todoMsg:null,toolMsgs:[],askMsg:null,messages:[]}};for(let de=0;de<T.length;de++){let oe=T[de];if(oe.type==="user"){if(!oe.content||!oe.content.trim())continue;W(),q.push({type:"user",id:oe.id||"u_"+de,message:oe});continue}if(oe.type==="system"||oe.type==="error"){W(),q.push({type:oe.type,id:oe.id||"s_"+de,message:oe});continue}if(!(oe.type==="tool-result"||oe.type==="tool_result")){if(oe.type==="assistant"){Z||J(),jn(Z,oe),oe.isStreaming&&(Z.isStreaming=!0),oe.isHistory&&(Z.isHistory=!0),Z.messages.push(oe);continue}if(oe.type==="tool-use"){Z||J();let Me=T[de+1],_e=Me&&(Me.type==="tool-result"||Me.type==="tool_result"),Ve={...oe,hasResult:_e||oe.hasResult||!1,toolResult:oe.toolResult||null};oe.toolName==="TodoWrite"?Z.todoMsg=Ve:oe.toolName==="AskUserQuestion"?Z.askMsg=Ve:Z.toolMsgs.push(Ve),Z.messages.push(oe);continue}W(),q.push({type:oe.type||"unknown",id:oe.id||"x_"+de,message:oe})}}return W(),q}),ie=(T,q)=>{if(!i.value)return;let Z=q||[];t.sendMessageToConversation(i.value,T,Z)},ke=()=>{i.value&&t.cancelExecutionForConversation(i.value)};function M(){t.setActivePanel(e.paneId)}function j(){t.removePanel(e.paneId)}let re=Vue.computed(()=>t.getPaneRightPanel(e.paneId));function ge(){t.setPaneRightPanel(e.paneId,null)}let Ce=Vue.ref(!0),De=50,ee=()=>{if(!s.value)return!0;let{scrollTop:T,scrollHeight:q,clientHeight:Z}=s.value;return q-T-Z<=De},K=()=>{s.value&&(s.value.scrollTop=s.value.scrollHeight)},x=()=>{Ce.value=ee()};return Vue.watch(()=>r.value.length,()=>{Ce.value&&Vue.nextTick(K)}),Vue.watch(()=>{let T=r.value,q=T[T.length-1];return q?.isStreaming?q.content?.length:0},()=>{Ce.value&&Vue.nextTick(K)}),Vue.watch(i,()=>{s.value&&s.value.removeEventListener("scroll",x),Ce.value=!0,Vue.nextTick(()=>{s.value&&(s.value.addEventListener("scroll",x),K())})}),Vue.onMounted(()=>{s.value&&(s.value.addEventListener("scroll",x),K())}),Vue.onUnmounted(()=>{s.value&&s.value.removeEventListener("scroll",x)}),{store:t,containerRef:s,isActivePanel:n,conversationId:i,messages:r,isProcessing:o,showTypingDots:l,previewShowTypingDots:O,waitingStatus:z,animationType:f,catSpeed:te,catStyle:me,dogPhase:w,spikeTransform:$,teddyTransform:U,leashPathL:L,leashPathR:_,leashOpacityL:P,leashOpacityR:I,questionLX:D,questionRX:B,refreshSession:pe,turnGroups:ve,sendFn:ie,cancelFn:ke,setActive:M,closePane:j,paneRightPanel:re,closePanePanel:ge}}}});var Sh,Li,No=H(()=>{Sh=0,Li={name:"ModernSelect",props:{modelValue:{type:[String,Number],default:null},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},searchable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyText:{type:String,default:"\u2014"},ariaLabel:{type:String,default:""},menuMinWidth:{type:Number,default:0},menuClass:{type:String,default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){let s=Vue.ref(!1),n=Vue.ref(""),i=Vue.ref(null),r=Vue.ref(null),o=Vue.ref(null),a=Vue.ref(-1),l=`modern-select-${++Sh}`,c=`${l}-menu`,d=Vue.ref({}),u=Vue.computed(()=>e.options.find(y=>y.value===e.modelValue)||null),f=Vue.computed(()=>{if(!e.searchable||!n.value.trim())return e.options;let y=n.value.trim().toLowerCase();return e.options.filter(E=>String(E.label||"").toLowerCase().includes(y)||String(E.sublabel||"").toLowerCase().includes(y)||String(E.value||"").toLowerCase().includes(y))}),p=y=>`${l}-option-${y}`,g=Vue.computed(()=>s.value&&a.value>=0&&a.value<f.value.length?p(a.value):void 0);function b(){let y=i.value,E=r.value;if(!y||!E)return;let $=6,U=8,V=y.getBoundingClientRect(),L=document.documentElement.clientWidth||window.innerWidth,_=document.documentElement.clientHeight||window.innerHeight,P=Math.min(Math.max(V.width,e.menuMinWidth),Math.max(0,L-U*2)),I=Math.min(E.scrollHeight,304),D=Math.max(0,_-V.bottom-$-U),B=Math.max(0,V.top-$-U),O=D<I&&B>D,z=Math.max(48,Math.min(I,O?B:D)),te=V.right-P,me=Math.min(Math.max(U,te),Math.max(U,L-U-P));d.value={top:`${O?V.top-$-z:V.bottom+$}px`,left:`${me}px`,width:`${P}px`,maxHeight:`${z}px`,"--modern-select-list-max-height":`${Math.max(36,z-(e.searchable?58:12))}px`}}function h(){e.disabled||(s.value=!s.value,s.value&&(n.value="",a.value=f.value.findIndex(y=>y.value===e.modelValue),Vue.nextTick(()=>{b(),e.searchable&&o.value?.focus&&o.value.focus();let y=r.value?.querySelector(".modern-select-option.is-active");y?.scrollIntoView&&y.scrollIntoView({block:"nearest"})})))}function A(){s.value=!1}function w(y){t("update:modelValue",y.value),t("change",y.value),A()}function S(y){if(!s.value){(y.key==="Enter"||y.key===" "||y.key==="ArrowDown")&&(y.preventDefault(),h());return}if(y.key==="Escape"){y.preventDefault(),A();return}if(y.key==="ArrowDown")y.preventDefault(),a.value=Math.min(f.value.length-1,a.value+1);else if(y.key==="ArrowUp")y.preventDefault(),a.value=Math.max(0,a.value-1);else if(y.key==="Enter"){y.preventDefault();let E=f.value[a.value];E&&w(E)}}function v(y){s.value&&(i.value?.contains(y.target)||r.value?.contains(y.target)||A())}let m=()=>{s.value&&b()};return Vue.onMounted(()=>{document.addEventListener("mousedown",v),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0)}),Vue.onBeforeUnmount(()=>{document.removeEventListener("mousedown",v),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}),Vue.watch(()=>e.modelValue,()=>{}),{open:s,search:n,triggerEl:i,menuEl:r,searchEl:o,activeIdx:a,selected:u,filtered:f,menuId:c,menuStyle:d,optionId:p,activeOptionId:g,toggle:h,close:A,pick:w,onKey:S}},template:`
4463
+ `,setup(e){let t=Pinia.useChatStore(),s=Vue.ref(null),n=Vue.computed(()=>t.activePanelId===e.paneId),i=Vue.computed(()=>t.panels.find(q=>q.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(T=>T.isStreaming)),l=Vue.computed(()=>o.value&&!a.value),c=Vue.ref(0),d=Vue.ref(Date.now()),u=null,f=Vue.ref("cat"),p=new URLSearchParams(window.location.search).get("preview"),g=Vue.ref(0),b=Vue.ref(1),h=Vue.ref(5),A=Vue.ref(95),w=Vue.ref("bark-both"),S=Vue.ref(1),v=Vue.ref(-1),m=null;function y(){if(!c.value)return;d.value=Date.now();let T=(d.value-c.value)%19e3;if(T<4e3)g.value=0,b.value=1;else if(T<11500){let q=T-4e3,Z;q<2500?Z=q/2500*16:q<5e3?Z=16+(q-2500)/2500*29:Z=45+(q-5e3)/2500*55,g.value=Z,b.value=1}else T<14e3?(g.value=(1-(T-11500)/2500)*100,b.value=-1):(g.value=0,b.value=1);u=requestAnimationFrame(y)}function E(){if(!c.value||f.value!=="dog")return;d.value=Date.now();let T=(d.value-c.value)%18e3;if(T<2e3)h.value=5,A.value=95,w.value="bark-both",S.value=1,v.value=-1;else if(T<5e3){let q=(T-2e3)/3e3;h.value=5+q*25,A.value=95,w.value="left-approach",S.value=1,v.value=-1}else if(T<8e3){let q=(T-5e3)/3e3;h.value=30,A.value=95-q*25,w.value="right-approach",S.value=1,v.value=-1}else if(T<1e4){let q=(T-8e3)/2e3;h.value=30+q*13,A.value=70-q*13,w.value="both-approach",S.value=1,v.value=-1}else if(T<11e3)h.value=43,A.value=57,w.value="snap",S.value=1,v.value=-1;else if(T<12500)h.value=43,A.value=57,w.value="stunned",S.value=1,v.value=-1;else if(T<15e3){let q=(T-12500)/2500;h.value=43-q*38,A.value=57+q*38,w.value="retreat",S.value=-1,v.value=1}else T<17e3?(h.value=5,A.value=95,w.value="rehang",S.value=-1,v.value=1):(h.value=5,A.value=95,w.value="reset",S.value=1,v.value=-1);m=requestAnimationFrame(E)}let $=Vue.computed(()=>{let T=h.value*1.2;return S.value<0?`translate(${T+13.5}, 0) scale(-1, 1)`:`translate(${T-13.5}, 0)`}),U=Vue.computed(()=>{let T=A.value*1.2;return v.value>0?`translate(${T-10.5}, 2)`:`translate(${T+10.5}, 2) scale(-1, 1)`}),V=Vue.computed(()=>{let T=w.value;return T==="bark-both"||T==="left-approach"||T==="right-approach"||T==="both-approach"||T==="reset"}),L=Vue.computed(()=>{let T=h.value*1.2,q=10;if(V.value){let W=Math.max(0,(T-3)*.12);return`M3,18 Q${(3+T)/2},${18+W} ${T},${q}`}if(w.value==="rehang")return`M${T},${q} Q${T-3},20 3,18`;let Z=S.value<0?1:-1,ae=T+Z*8;return`M${T},${q} Q${T},18 ${ae},22`}),_=Vue.computed(()=>{let T=A.value*1.2,q=10;if(V.value){let W=Math.max(0,(118-T)*.12);return`M118,18 Q${(118+T)/2},${18+W} ${T},${q}`}if(w.value==="rehang")return`M${T},${q} Q${T+3},20 118,18`;let Z=v.value>0?-1:1,ae=T+Z*8;return`M${T},${q} Q${T},18 ${ae},22`}),P=Vue.computed(()=>w.value==="snap"?.2:.4),I=Vue.computed(()=>w.value==="snap"?.2:.4),D=Vue.computed(()=>h.value*1.2),B=Vue.computed(()=>A.value*1.2),O=Vue.computed(()=>p==="cat"||p==="dog"||p==="animation"?!0:l.value);Vue.watch(l,T=>{T?(c.value=Date.now(),d.value=Date.now(),f.value="cat",g.value=0,b.value=1,h.value=5,A.value=95,w.value="bark-both",S.value=1,v.value=-1,f.value==="cat"?u=requestAnimationFrame(y):m=requestAnimationFrame(E)):(c.value=0,g.value=0,b.value=1,u&&(cancelAnimationFrame(u),u=null),m&&(cancelAnimationFrame(m),m=null))},{immediate:!0}),(p==="cat"||p==="dog"||p==="animation")&&(c.value=Date.now(),d.value=Date.now(),p==="dog"?f.value="dog":f.value="cat",f.value==="cat"?u=requestAnimationFrame(y):(h.value=5,A.value=95,w.value="bark-both",S.value=1,v.value=-1,m=requestAnimationFrame(E))),Vue.onUnmounted(()=>{u&&(cancelAnimationFrame(u),u=null),m&&(cancelAnimationFrame(m),m=null)});let z=Vue.computed(()=>{if(!o.value)return null;if(t.connectionState!=="connected")return"disconnected";let T=i.value;if(t.compactStatus?.conversationId===T&&t.compactStatus?.status==="compacting")return"compacting";let q=t.sessionHealth?.[T];return q?q.status:c.value&&d.value-c.value>8e3?"thinking":null}),te=Vue.computed(()=>{if(!c.value)return"speed-napping";let T=(d.value-c.value)%19e3;return T>=16e3?"speed-petted":T>=14e3?"speed-tired":T>=11500?"speed-crazy":T>=9e3?"speed-turbo":T>=6500?"speed-fast":T>=4e3?"speed-normal":"speed-napping"}),me=Vue.computed(()=>{let T=g.value,q=b.value,ae={left:`calc(40px + (100% - 80px) * ${T/100})`};return q<0&&(ae.transform="scaleX(-1)"),ae});function pe(){let T=i.value;if(!T)return;let q=t.conversations.find(Z=>Z.id===T);t.sendWsMessage({type:"refresh_conversation",conversationId:T,agentId:q?.agentId})}let ve=Vue.computed(()=>{let T=r.value,q=[],Z=null,ae=0,W=()=>{Z&&(Z.isActive=Z.isStreaming===!0,Kn(Z),(Z.textContent||Z.toolMsgs.length>0||Z.todoMsg||Z.askMsg)&&q.push(Z),Z=null)},J=()=>{ae++,Z={type:"assistant-turn",id:"turn_"+ae,textContent:"",textSegments:[],isStreaming:!1,isActive:!1,isHistory:!1,todoMsg:null,toolMsgs:[],askMsg:null,messages:[]}};for(let de=0;de<T.length;de++){let oe=T[de];if(oe.type==="user"){if(!oe.content||!oe.content.trim())continue;W(),q.push({type:"user",id:oe.id||"u_"+de,message:oe});continue}if(oe.type==="system"||oe.type==="error"){W(),q.push({type:oe.type,id:oe.id||"s_"+de,message:oe});continue}if(!(oe.type==="tool-result"||oe.type==="tool_result")){if(oe.type==="assistant"){Z||J(),jn(Z,oe),oe.isStreaming&&(Z.isStreaming=!0),oe.isHistory&&(Z.isHistory=!0),Z.messages.push(oe);continue}if(oe.type==="tool-use"){Z||J();let Me=T[de+1],_e=Me&&(Me.type==="tool-result"||Me.type==="tool_result"),Ve={...oe,hasResult:_e||oe.hasResult||!1,toolResult:oe.toolResult||null};oe.toolName==="TodoWrite"?Z.todoMsg=Ve:oe.toolName==="AskUserQuestion"?Z.askMsg=Ve:Z.toolMsgs.push(Ve),Z.messages.push(oe);continue}W(),q.push({type:oe.type||"unknown",id:oe.id||"x_"+de,message:oe})}}return W(),q}),ie=(T,q)=>{if(!i.value)return;let Z=q||[];t.sendMessageToConversation(i.value,T,Z)},ke=()=>{i.value&&t.cancelExecutionForConversation(i.value)};function M(){t.setActivePanel(e.paneId)}function j(){t.removePanel(e.paneId)}let re=Vue.computed(()=>t.getPaneRightPanel(e.paneId));function ge(){t.setPaneRightPanel(e.paneId,null)}let Ce=Vue.ref(!0),De=50,ee=()=>{if(!s.value)return!0;let{scrollTop:T,scrollHeight:q,clientHeight:Z}=s.value;return q-T-Z<=De},K=()=>{s.value&&(s.value.scrollTop=s.value.scrollHeight)},x=()=>{Ce.value=ee()};return Vue.watch(()=>r.value.length,()=>{Ce.value&&Vue.nextTick(K)}),Vue.watch(()=>{let T=r.value,q=T[T.length-1];return q?.isStreaming?q.content?.length:0},()=>{Ce.value&&Vue.nextTick(K)}),Vue.watch(i,()=>{s.value&&s.value.removeEventListener("scroll",x),Ce.value=!0,Vue.nextTick(()=>{s.value&&(s.value.addEventListener("scroll",x),K())})}),Vue.onMounted(()=>{s.value&&(s.value.addEventListener("scroll",x),K())}),Vue.onUnmounted(()=>{s.value&&s.value.removeEventListener("scroll",x)}),{store:t,containerRef:s,isActivePanel:n,conversationId:i,messages:r,isProcessing:o,showTypingDots:l,previewShowTypingDots:O,waitingStatus:z,animationType:f,catSpeed:te,catStyle:me,dogPhase:w,spikeTransform:$,teddyTransform:U,leashPathL:L,leashPathR:_,leashOpacityL:P,leashOpacityR:I,questionLX:D,questionRX:B,refreshSession:pe,turnGroups:ve,sendFn:ie,cancelFn:ke,setActive:M,closePane:j,paneRightPanel:re,closePanePanel:ge}}}});var Ch,Li,No=H(()=>{Ch=0,Li={name:"ModernSelect",props:{modelValue:{type:[String,Number],default:null},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},searchable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyText:{type:String,default:"\u2014"},ariaLabel:{type:String,default:""},menuMinWidth:{type:Number,default:0},menuClass:{type:String,default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){let s=Vue.ref(!1),n=Vue.ref(""),i=Vue.ref(null),r=Vue.ref(null),o=Vue.ref(null),a=Vue.ref(-1),l=`modern-select-${++Ch}`,c=`${l}-menu`,d=Vue.ref({}),u=Vue.computed(()=>e.options.find(y=>y.value===e.modelValue)||null),f=Vue.computed(()=>{if(!e.searchable||!n.value.trim())return e.options;let y=n.value.trim().toLowerCase();return e.options.filter(E=>String(E.label||"").toLowerCase().includes(y)||String(E.sublabel||"").toLowerCase().includes(y)||String(E.value||"").toLowerCase().includes(y))}),p=y=>`${l}-option-${y}`,g=Vue.computed(()=>s.value&&a.value>=0&&a.value<f.value.length?p(a.value):void 0);function b(){let y=i.value,E=r.value;if(!y||!E)return;let $=6,U=8,V=y.getBoundingClientRect(),L=document.documentElement.clientWidth||window.innerWidth,_=document.documentElement.clientHeight||window.innerHeight,P=Math.min(Math.max(V.width,e.menuMinWidth),Math.max(0,L-U*2)),I=Math.min(E.scrollHeight,304),D=Math.max(0,_-V.bottom-$-U),B=Math.max(0,V.top-$-U),O=D<I&&B>D,z=Math.max(48,Math.min(I,O?B:D)),te=V.right-P,me=Math.min(Math.max(U,te),Math.max(U,L-U-P));d.value={top:`${O?V.top-$-z:V.bottom+$}px`,left:`${me}px`,width:`${P}px`,maxHeight:`${z}px`,"--modern-select-list-max-height":`${Math.max(36,z-(e.searchable?58:12))}px`}}function h(){e.disabled||(s.value=!s.value,s.value&&(n.value="",a.value=f.value.findIndex(y=>y.value===e.modelValue),Vue.nextTick(()=>{b(),e.searchable&&o.value?.focus&&o.value.focus();let y=r.value?.querySelector(".modern-select-option.is-active");y?.scrollIntoView&&y.scrollIntoView({block:"nearest"})})))}function A(){s.value=!1}function w(y){t("update:modelValue",y.value),t("change",y.value),A()}function S(y){if(!s.value){(y.key==="Enter"||y.key===" "||y.key==="ArrowDown")&&(y.preventDefault(),h());return}if(y.key==="Escape"){y.preventDefault(),A();return}if(y.key==="ArrowDown")y.preventDefault(),a.value=Math.min(f.value.length-1,a.value+1);else if(y.key==="ArrowUp")y.preventDefault(),a.value=Math.max(0,a.value-1);else if(y.key==="Enter"){y.preventDefault();let E=f.value[a.value];E&&w(E)}}function v(y){s.value&&(i.value?.contains(y.target)||r.value?.contains(y.target)||A())}let m=()=>{s.value&&b()};return Vue.onMounted(()=>{document.addEventListener("mousedown",v),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0)}),Vue.onBeforeUnmount(()=>{document.removeEventListener("mousedown",v),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}),Vue.watch(()=>e.modelValue,()=>{}),{open:s,search:n,triggerEl:i,menuEl:r,searchEl:o,activeIdx:a,selected:u,filtered:f,menuId:c,menuStyle:d,optionId:p,activeOptionId:g,toggle:h,close:A,pick:w,onKey:S}},template:`
4464
4464
  <div class="modern-select" :class="{ 'is-open': open, 'is-disabled': disabled }">
4465
4465
  <button
4466
4466
  type="button"
@@ -4799,7 +4799,7 @@ ${String(e||"").trim()}
4799
4799
  </footer>
4800
4800
  </section>
4801
4801
  <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>
4802
- `}});function Ko(e){return JSON.parse(JSON.stringify(e))}function Ch(e,t=[]){return{mode:"auto",capability:e,candidateVpIds:[],fixedVpId:null,separateFromStageTypes:t}}function Hi(e,t,s,n={}){return{id:e,name:t,type:s,instruction:"",assignmentPolicy:Ch(s,n.separateFromStageTypes),modelPolicy:{mode:"inherit",model:null,effort:null},maxAttempts:2,...n.changesRequestedStageId?{changesRequestedStageId:n.changesRequestedStageId}:{}}}function jo(){return{version:1,revision:1,defaultWorkflowId:"software-change",startImmediately:!0,maxConcurrentActions:3,defaultWorkDir:"",globalInstructions:"",modelPolicy:{mode:"inherit",model:null,effort:null},coordinatorModelPolicy:{mode:"inherit",model:null,effort:"high"},actionModelPolicies:Object.fromEntries(os.map(e=>[e,{mode:"inherit",model:null,effort:["triage","research","design","diagnose","review"].includes(e)?"high":"medium"}])),actionInstructions:Object.fromEntries(os.map(e=>[e,""])),workflows:[{version:1,id:"software-change",name:"Software change",stages:[Hi("triage","Triage","triage"),Hi("implement","Implement","implement"),Hi("review","Review","review",{separateFromStageTypes:["implement"],changesRequestedStageId:"implement"}),Hi("deliver","Deliver","deliver")]}]}}function Bi(e){return!e||typeof e!="object"||Array.isArray(e)||!e.modelPolicy||typeof e.modelPolicy!="object"||Array.isArray(e.modelPolicy)||!e.coordinatorModelPolicy||typeof e.coordinatorModelPolicy!="object"||Array.isArray(e.coordinatorModelPolicy)||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:os.every(t=>typeof e.actionInstructions[t]=="string")}function Ih(e,t){return Bi(e)&&Number.isInteger(e.revision)&&Number.isInteger(t)&&e.revision>t}function Ni(e,t={}){let s=e&&typeof e=="object"&&!Array.isArray(e)?Ko(e):{},n=Array.isArray(s.workflows)&&s.workflows.length>0?s.workflows:jo().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=>os.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{...jo(),...s,modelPolicy:{mode:"inherit",model:null,effort:null,...l||{},...s.modelPolicy||{}},coordinatorModelPolicy:{mode:"inherit",model:null,effort:"high",...s.coordinatorModelPolicy||{}},actionModelPolicies:Object.fromEntries(os.map(c=>[c,{...jo().actionModelPolicies[c],...s.actionModelPolicies?.[c]||{}}])),actionInstructions:Object.fromEntries(os.map(c=>[c,typeof a[c]=="string"?a[c]:o[c]||t[c]||""])),workflows:n}}function Ah(e){let t=e?.message||String(e);return/^Unsupported Work Center operation:\s*get_settings$/i.test(t.trim())}var os,kp,Sp=H(()=>{is();os=["triage","research","design","diagnose","implement","migrate","test","review","integrate","document","operate","deliver","write","custom"];kp={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 os},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=Ni(e,this.defaultStageInstructions),this.normalizeDraftEffort(),this.draftAgentId=this.agentId,this.settingsUnsupported=!Bi(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=Ni(s.settings,this.defaultStageInstructions),this.normalizeDraftEffort(),this.draftAgentId=e,this.conflict=!1,this.settingsUnsupported=!Bi(s.settings),this.error=this.settingsUnsupported?this.$t("workCenter.settings.upgradeRequired"):""}catch(s){if(t!==this.loadGeneration||e!==this.agentId)return;Ah(s)?(this.draft=Ni(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){Qe(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?Ko(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}),this.normalizeStageEffort({modelPolicy:this.draft.coordinatorModelPolicy});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=Ko(this.draft),s=await this.store.saveWorkCenterSettings(t,e);if(e!==this.agentId||this.draftAgentId!==e)return;if(!Ih(s.settings,t.revision)){this.settingsUnsupported=!Bi(s.settings),this.error=this.$t(this.settingsUnsupported?"workCenter.settings.upgradeRequired":"workCenter.settings.saveNotConfirmed");return}this.draft=Ni(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:`
4802
+ `}});function Ko(e){return JSON.parse(JSON.stringify(e))}function Ih(e,t=[]){return{mode:"auto",capability:e,candidateVpIds:[],fixedVpId:null,separateFromStageTypes:t}}function Hi(e,t,s,n={}){return{id:e,name:t,type:s,instruction:"",assignmentPolicy:Ih(s,n.separateFromStageTypes),modelPolicy:{mode:"inherit",model:null,effort:null},maxAttempts:2,...n.changesRequestedStageId?{changesRequestedStageId:n.changesRequestedStageId}:{}}}function jo(){return{version:1,revision:1,defaultWorkflowId:"software-change",startImmediately:!0,maxConcurrentActions:3,defaultWorkDir:"",globalInstructions:"",modelPolicy:{mode:"inherit",model:null,effort:null},coordinatorModelPolicy:{mode:"inherit",model:null,effort:"high"},actionModelPolicies:Object.fromEntries(os.map(e=>[e,{mode:"inherit",model:null,effort:["triage","research","design","diagnose","review"].includes(e)?"high":"medium"}])),actionInstructions:Object.fromEntries(os.map(e=>[e,""])),workflows:[{version:1,id:"software-change",name:"Software change",stages:[Hi("triage","Triage","triage"),Hi("implement","Implement","implement"),Hi("review","Review","review",{separateFromStageTypes:["implement"],changesRequestedStageId:"implement"}),Hi("deliver","Deliver","deliver")]}]}}function Bi(e){return!e||typeof e!="object"||Array.isArray(e)||!e.modelPolicy||typeof e.modelPolicy!="object"||Array.isArray(e.modelPolicy)||!e.coordinatorModelPolicy||typeof e.coordinatorModelPolicy!="object"||Array.isArray(e.coordinatorModelPolicy)||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:os.every(t=>typeof e.actionInstructions[t]=="string")}function Ah(e,t){return Bi(e)&&Number.isInteger(e.revision)&&Number.isInteger(t)&&e.revision>t}function Ni(e,t={}){let s=e&&typeof e=="object"&&!Array.isArray(e)?Ko(e):{},n=Array.isArray(s.workflows)&&s.workflows.length>0?s.workflows:jo().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=>os.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{...jo(),...s,modelPolicy:{mode:"inherit",model:null,effort:null,...l||{},...s.modelPolicy||{}},coordinatorModelPolicy:{mode:"inherit",model:null,effort:"high",...s.coordinatorModelPolicy||{}},actionModelPolicies:Object.fromEntries(os.map(c=>[c,{...jo().actionModelPolicies[c],...s.actionModelPolicies?.[c]||{}}])),actionInstructions:Object.fromEntries(os.map(c=>[c,typeof a[c]=="string"?a[c]:o[c]||t[c]||""])),workflows:n}}function xh(e){let t=e?.message||String(e);return/^Unsupported Work Center operation:\s*get_settings$/i.test(t.trim())}var os,kp,Sp=H(()=>{is();os=["triage","research","design","diagnose","implement","migrate","test","review","integrate","document","operate","deliver","write","custom"];kp={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 os},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=Ni(e,this.defaultStageInstructions),this.normalizeDraftEffort(),this.draftAgentId=this.agentId,this.settingsUnsupported=!Bi(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=Ni(s.settings,this.defaultStageInstructions),this.normalizeDraftEffort(),this.draftAgentId=e,this.conflict=!1,this.settingsUnsupported=!Bi(s.settings),this.error=this.settingsUnsupported?this.$t("workCenter.settings.upgradeRequired"):""}catch(s){if(t!==this.loadGeneration||e!==this.agentId)return;xh(s)?(this.draft=Ni(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){Qe(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?Ko(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}),this.normalizeStageEffort({modelPolicy:this.draft.coordinatorModelPolicy});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=Ko(this.draft),s=await this.store.saveWorkCenterSettings(t,e);if(e!==this.agentId||this.draftAgentId!==e)return;if(!Ah(s.settings,t.revision)){this.settingsUnsupported=!Bi(s.settings),this.error=this.$t(this.settingsUnsupported?"workCenter.settings.upgradeRequired":"workCenter.settings.saveNotConfirmed");return}this.draft=Ni(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:`
4803
4803
  <Teleport to="body">
4804
4804
  <div
4805
4805
  class="modal-overlay work-center-settings-overlay"
@@ -4953,7 +4953,7 @@ ${String(e||"").trim()}
4953
4953
  </section>
4954
4954
  </div>
4955
4955
  </Teleport>
4956
- `}});var Go,Cp=H(()=>{Go={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 xh(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 Ip,Ap=H(()=>{is();Ip={name:"ProviderPresetPicker",emits:["close","pick"],template:`
4956
+ `}});var Go,Cp=H(()=>{Go={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 Th(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 Ip,Ap=H(()=>{is();Ip={name:"ProviderPresetPicker",emits:["close","pick"],template:`
4957
4957
  <div
4958
4958
  class="llm-preset-modal-backdrop"
4959
4959
  @pointerdown="trackOverlayPointerDown"
@@ -5033,7 +5033,7 @@ ${String(e||"").trim()}
5033
5033
  </div>
5034
5034
  </div>
5035
5035
  </div>
5036
- `,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){Qe(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=xh(s);return n?{id:s,protocol:n}:s});this.$emit("pick",{name:this.selectedProviderId,baseUrl:e.api||"",protocol:"",models:t})}}}});var qi,Yo=H(()=>{Cp();Ap();qi={name:"LlmTab",components:{ProviderPresetPicker:Ip},props:{context:{type:String,default:"chat"}},emits:["message","saved"],template:`
5036
+ `,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){Qe(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=Th(s);return n?{id:s,protocol:n}:s});this.$emit("pick",{name:this.selectedProviderId,baseUrl:e.api||"",protocol:"",models:t})}}}});var qi,Yo=H(()=>{Cp();Ap();qi={name:"LlmTab",components:{ProviderPresetPicker:Ip},props:{context:{type:String,default:"chat"}},emits:["message","saved"],template:`
5037
5037
  <div class="llm-tab">
5038
5038
  <!-- No agent selected -->
5039
5039
  <div v-if="!effectiveAgentId" class="sp-desc">
@@ -5236,7 +5236,7 @@ ${String(e||"").trim()}
5236
5236
  </div>
5237
5237
  </div>
5238
5238
  </div>
5239
- `,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 Go[e]||Go.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 Th(){return xp+=1,`folder-picker-${Date.now()}-${xp}`}var Qo,xp,Xo,Mh,Tp,Zo=H(()=>{Qo=()=>({folderPickerOpen:!1,folderPickerPath:"",folderPickerEntries:[],folderPickerLoading:!1,folderPickerSelected:"",_folderPickerTimer:null,_folderPickerRequestId:null,_folderPickerRequestAgentId:null}),xp=0;Xo={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=Th();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))}},Mh={data(){return Qo()},methods:{...Xo},mounted(){window.addEventListener("workbench-message",this.handleFolderPickerMessage)},beforeUnmount(){window.removeEventListener("workbench-message",this.handleFolderPickerMessage),this.invalidateFolderPickerRequest()}},Tp=Mh});function as(e){let t=(Number(e?.actionRunOpenGeneration)||0)+1;return e&&(e.actionRunOpenGeneration=t),t}var Wi,Jo=H(()=>{wp();Sp();Yo();Zo();di();Br();zo();is();Wi={name:"WorkCenterPage",components:{WorkCenterActionDetail:bp,WorkCenterSettingsModal:kp,LlmTab:qi},mixins:[Tp],data(){return{selectedId:null,selectedActionId:null,narrowPane:"items",actionDetailTab:"messages",actionInputSending:!1,actionInputError:"",actionInputRequestGeneration:0,actionComposerGeneration:0,actionRunOpenGeneration:0,workItemMessage:"",workItemMessageAttachments:[],workItemMessageAttachmentsUploading:!1,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?Js(this.agentId,this.selected.id,this.selectedAction.id,this.selectedAction.generation):""},actionMessageKey(){return this.selected?.id&&this.selectedAction?.id?ks(this.agentId,this.selected.id,this.selectedAction.id,this.selectedAction.generation):""},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}`:""},coordinatorThinking(){return(this.selected?.messages||[]).some(e=>e?.role==="assistant"&&e.status==="thinking")},coordinatorReadOnly(){return["done","cancelled"].includes(this.selected?.status)},coordinatorRequestedSelectedActionInput(){return this.selected?.status!=="waiting"||this.selectedAction?.status!=="waiting"?!1:[...this.selected.messages||[]].reverse().some(e=>e?.role==="assistant"&&e.status==="completed"&&e.decision?.kind==="request_human"&&e.recovery?.actionId===this.selectedAction.id&&e.recovery?.actionGeneration===this.selectedAction.generation)},actionMessages(){let e=Array.isArray(this.selectedAction?.messages)?this.selectedAction.messages:[],t=(Array.isArray(this.selectedAction?.thread)?this.selectedAction.thread:[]).flatMap(o=>Array.isArray(o?.messages)?o.messages:[]),s=this.store.workCenterActionMessages[this.actionMessageKey]?.messages||[],n=Zs(t,s,e),i=this.selectedAction?.liveMessage,r=i&&n.some(o=>o.role==="assistant"&&o.runId!=null&&o.runId===i.runId&&(i.status==="running"?o.text===i.text:o.status!=="running"));return Zs(n,r?null:i)},actionMessagesNextCursor(){let e=this.store.workCenterActionMessages[this.actionMessageKey];return e?e.nextCursor:this.selectedAction?.messageCursor},actionMessagesLoading(){return!!this.store.workCenterActionMessagesLoading[this.actionMessageKey]},actionMessagesError(){return this.store.workCenterActionMessagesError[this.actionMessageKey]||""},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=rs(e);return[t,this.store.workCenterActionRequestDetails[`${this.actionRequestKey}:${t}`]||null]})):{}},actionRequestDetailsLoading(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=rs(e);return[t,!!this.store.workCenterActionRequestDetailsLoading[`${this.actionRequestKey}:${t}`]]})):{}},actionRequestDetailsError(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=rs(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){as(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.coordinatorRevision"(){this.$nextTick(()=>{let e=this.$el?.querySelector?.(".work-center-item-message-list");e&&(e.scrollTop=e.scrollHeight)})},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&&(as(this),this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=s}}}},beforeUnmount(){as(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){Qe(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""}},resizeWorkItemComposer(e,t=!1){if(!e)return;e.style.height="auto";let s=t?24:Math.min(e.scrollHeight,144);e.style.height=`${s}px`,e.style.overflowY=e.scrollHeight>144?"auto":"hidden"},onWorkItemMessageInput(e){this.workItemMessage=e.target.value,this.resizeWorkItemComposer(e.target,!e.target.value)},onWorkItemMessageKeydown(e){e.key!=="Enter"||e.shiftKey||e.isComposing||(e.preventDefault(),this.sendSelectedWorkItemMessage())},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.actionInputRequestGeneration+=1,this.actionGuidance="",this.actionInputError="",this.guidanceAttachments=[],this.guidanceAttachmentsUploading=!1,this.actionInputSending=!1},resetWorkItemComposer(){this.workItemComposerGeneration+=1,this.workItemMessage="",this.workItemMessageAttachments=[],this.workItemMessageAttachmentsUploading=!1,this.workItemMessageError="",this.workItemMessageSending=!1},openWorkItem(e){as(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&&(as(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=ks(this.agentId,this.selected.id,e.id,e.generation);return this.store.workCenterActionMessages[t]?null:this.store.loadWorkItemActionMessages(this.selected.id,e.id,e.generation,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.selectedAction.generation,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.selectedAction.generation,this.agentId).catch(()=>[])},loadActionRequest(e){return!this.selected?.id||!this.selectedAction?.id||!e?.id?null:this.store.loadWorkItemActionRequest(this.selected.id,this.selectedAction.id,this.selectedAction.generation,e.runId,e.id,this.agentId).catch(()=>null)},async openActionRun(e,t){let s=as(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.generation,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,n.generation,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 f of r)o.append("files",f,f.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 onWorkItemMessageAttachmentInput(e){if(!this.workItemAttachmentsSupported){e.target.value="",this.workItemMessageError=this.tr("workCenter.attachmentsUnsupported","The selected Agent does not support Work Item attachments.");return}let t=Array.from(e.target.files||[]);if(e.target.value="",t.length===0)return;let s=this.workItemComposerScope;if(!s)return;let n=Array.isArray(this.selected?.attachments)?this.selected.attachments.length:0,i=Math.max(0,10-n-this.workItemMessageAttachments.length),r=t.slice(0,i);if(r.length!==0){this.workItemMessageAttachmentsUploading=!0,this.workItemMessageError="";try{let o=new FormData;for(let f of r)o.append("files",f,f.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.workItemComposerScope!==s)return;this.workItemMessageAttachments=[...this.workItemMessageAttachments,...Array.isArray(u.files)?u.files:[]].slice(0,Math.max(0,10-n))}catch(o){this.workItemComposerScope===s&&(this.workItemMessageError=o?.message||String(o))}finally{this.workItemComposerScope===s&&(this.workItemMessageAttachmentsUploading=!1)}}},removeWorkItemMessageAttachment(e){this.workItemMessageAttachments=this.workItemMessageAttachments.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?xs(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.workItemMessageAttachments.length===0||this.workItemMessageSending||this.workItemMessageAttachmentsUploading||this.coordinatorThinking||this.coordinatorReadOnly)return;let e=this.workItemComposerScope,t=this.selected.id,s=this.selected.revision,n=this.workItemMessage.trim(),i=this.workItemMessageAttachments.map(r=>({fileId:r.fileId,name:r.name,mimeType:r.mimeType,size:r.size}));this.workItemMessageSending=!0,this.workItemMessageError="";try{await this.store.sendWorkItemMessage(t,n,s,i,this.agentId,{planRevision:this.selected.planRevision,ledgerRevision:this.selected.ledgerRevision,coordinatorRevision:this.selected.coordinatorRevision}),this.workItemComposerScope===e&&this.workItemMessage.trim()===n&&(this.workItemMessage="",this.workItemMessageAttachments=[],this.$nextTick(()=>this.resizeWorkItemComposer(this.$refs.workItemComposerInput,!0)))}catch(r){this.workItemComposerScope===e&&(this.workItemMessageError=r?.message||String(r))}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(a=>({fileId:a.fileId,name:a.name,mimeType:a.mimeType,size:a.size})),o=(Number(this.actionInputRequestGeneration)||0)+1;this.actionInputRequestGeneration=o,this.actionGuidance="",this.guidanceAttachments=[],this.actionInputSending=!0,this.actionInputError="";try{let a=await this.store.sendWorkItemActionInput(t,i,s,n,this.selectedAction.generation,r,this.agentId);if(this.selected?.id!==t||this.actionInputRequestGeneration!==o)return;let l=a?.id===t&&a?.actions?.some(d=>d?.id===s);if(this.guidanceAttachments=[],this.$nextTick(()=>{let d=this.$el?.querySelector?.(".work-center-action-input-wrapper textarea");d&&(d.style.height="24px",d.style.overflowY="hidden")}),a?.accepted&&a?.routedTo==="coordinator")return;let c=l?s:a?.currentActionId||this.selectedActionId;c!==this.selectedActionId&&(this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=c}catch(a){this.actionInputRequestGeneration===o&&(this.actionGuidance||(this.actionGuidance=i),this.guidanceAttachments.length===0&&(this.guidanceAttachments=r.map(l=>({...l}))),this.actionInputError=a?.message||String(a))}finally{this.actionInputRequestGeneration===o&&(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&&(as(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||["done","cancelled"].includes(this.selected.status))return;let e=this.tr("workCenter.cancelConfirm","Stop this work item and its unfinished Actions?");typeof confirm=="function"&&!confirm(e)||await this.store.cancelWorkItem(this.selected.id,this.agentId)},async resumeSelected(){!this.selected||this.selected.status!=="cancelled"||await this.store.resumeWorkItem(this.selected.id,this.selected.revision,this.agentId)}},template:`
5239
+ `,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 Go[e]||Go.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 Mh(){return xp+=1,`folder-picker-${Date.now()}-${xp}`}var Qo,xp,Xo,Ph,Tp,Zo=H(()=>{Qo=()=>({folderPickerOpen:!1,folderPickerPath:"",folderPickerEntries:[],folderPickerLoading:!1,folderPickerSelected:"",_folderPickerTimer:null,_folderPickerRequestId:null,_folderPickerRequestAgentId:null}),xp=0;Xo={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=Mh();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))}},Ph={data(){return Qo()},methods:{...Xo},mounted(){window.addEventListener("workbench-message",this.handleFolderPickerMessage)},beforeUnmount(){window.removeEventListener("workbench-message",this.handleFolderPickerMessage),this.invalidateFolderPickerRequest()}},Tp=Ph});function as(e){let t=(Number(e?.actionRunOpenGeneration)||0)+1;return e&&(e.actionRunOpenGeneration=t),t}var Wi,Jo=H(()=>{wp();Sp();Yo();Zo();di();Br();zo();is();Wi={name:"WorkCenterPage",components:{WorkCenterActionDetail:bp,WorkCenterSettingsModal:kp,LlmTab:qi},mixins:[Tp],data(){return{selectedId:null,selectedActionId:null,narrowPane:"items",actionDetailTab:"messages",actionInputSending:!1,actionInputError:"",actionInputRequestGeneration:0,actionComposerGeneration:0,actionRunOpenGeneration:0,workItemMessage:"",workItemMessageAttachments:[],workItemMessageAttachmentsUploading:!1,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?Js(this.agentId,this.selected.id,this.selectedAction.id,this.selectedAction.generation):""},actionMessageKey(){return this.selected?.id&&this.selectedAction?.id?ks(this.agentId,this.selected.id,this.selectedAction.id,this.selectedAction.generation):""},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}`:""},coordinatorThinking(){return(this.selected?.messages||[]).some(e=>e?.role==="assistant"&&e.status==="thinking")},coordinatorReadOnly(){return["done","cancelled"].includes(this.selected?.status)},coordinatorRequestedSelectedActionInput(){return this.selected?.status!=="waiting"||this.selectedAction?.status!=="waiting"?!1:[...this.selected.messages||[]].reverse().some(e=>e?.role==="assistant"&&e.status==="completed"&&e.decision?.kind==="request_human"&&e.recovery?.actionId===this.selectedAction.id&&e.recovery?.actionGeneration===this.selectedAction.generation)},actionMessages(){let e=Array.isArray(this.selectedAction?.messages)?this.selectedAction.messages:[],t=(Array.isArray(this.selectedAction?.thread)?this.selectedAction.thread:[]).flatMap(o=>Array.isArray(o?.messages)?o.messages:[]),s=this.store.workCenterActionMessages[this.actionMessageKey]?.messages||[],n=Zs(t,s,e),i=this.selectedAction?.liveMessage,r=i&&n.some(o=>o.role==="assistant"&&o.runId!=null&&o.runId===i.runId&&(i.status==="running"?o.text===i.text:o.status!=="running"));return Zs(n,r?null:i)},actionMessagesNextCursor(){let e=this.store.workCenterActionMessages[this.actionMessageKey];return e?e.nextCursor:this.selectedAction?.messageCursor},actionMessagesLoading(){return!!this.store.workCenterActionMessagesLoading[this.actionMessageKey]},actionMessagesError(){return this.store.workCenterActionMessagesError[this.actionMessageKey]||""},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=rs(e);return[t,this.store.workCenterActionRequestDetails[`${this.actionRequestKey}:${t}`]||null]})):{}},actionRequestDetailsLoading(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=rs(e);return[t,!!this.store.workCenterActionRequestDetailsLoading[`${this.actionRequestKey}:${t}`]]})):{}},actionRequestDetailsError(){return this.actionRequestKey?Object.fromEntries(this.actionRequests.map(e=>{let t=rs(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){as(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.coordinatorRevision"(){this.$nextTick(()=>{let e=this.$el?.querySelector?.(".work-center-item-message-list");e&&(e.scrollTop=e.scrollHeight)})},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&&(as(this),this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=s}}}},beforeUnmount(){as(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){Qe(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""}},resizeWorkItemComposer(e,t=!1){if(!e)return;e.style.height="auto";let s=t?24:Math.min(e.scrollHeight,144);e.style.height=`${s}px`,e.style.overflowY=e.scrollHeight>144?"auto":"hidden"},onWorkItemMessageInput(e){this.workItemMessage=e.target.value,this.resizeWorkItemComposer(e.target,!e.target.value)},onWorkItemMessageKeydown(e){e.key!=="Enter"||e.shiftKey||e.isComposing||(e.preventDefault(),this.sendSelectedWorkItemMessage())},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.actionInputRequestGeneration+=1,this.actionGuidance="",this.actionInputError="",this.guidanceAttachments=[],this.guidanceAttachmentsUploading=!1,this.actionInputSending=!1},resetWorkItemComposer(){this.workItemComposerGeneration+=1,this.workItemMessage="",this.workItemMessageAttachments=[],this.workItemMessageAttachmentsUploading=!1,this.workItemMessageError="",this.workItemMessageSending=!1},openWorkItem(e){as(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&&(as(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=ks(this.agentId,this.selected.id,e.id,e.generation);return this.store.workCenterActionMessages[t]?null:this.store.loadWorkItemActionMessages(this.selected.id,e.id,e.generation,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.selectedAction.generation,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.selectedAction.generation,this.agentId).catch(()=>[])},loadActionRequest(e){return!this.selected?.id||!this.selectedAction?.id||!e?.id?null:this.store.loadWorkItemActionRequest(this.selected.id,this.selectedAction.id,this.selectedAction.generation,e.runId,e.id,this.agentId).catch(()=>null)},async openActionRun(e,t){let s=as(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.generation,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,n.generation,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 f of r)o.append("files",f,f.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 onWorkItemMessageAttachmentInput(e){if(!this.workItemAttachmentsSupported){e.target.value="",this.workItemMessageError=this.tr("workCenter.attachmentsUnsupported","The selected Agent does not support Work Item attachments.");return}let t=Array.from(e.target.files||[]);if(e.target.value="",t.length===0)return;let s=this.workItemComposerScope;if(!s)return;let n=Array.isArray(this.selected?.attachments)?this.selected.attachments.length:0,i=Math.max(0,10-n-this.workItemMessageAttachments.length),r=t.slice(0,i);if(r.length!==0){this.workItemMessageAttachmentsUploading=!0,this.workItemMessageError="";try{let o=new FormData;for(let f of r)o.append("files",f,f.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.workItemComposerScope!==s)return;this.workItemMessageAttachments=[...this.workItemMessageAttachments,...Array.isArray(u.files)?u.files:[]].slice(0,Math.max(0,10-n))}catch(o){this.workItemComposerScope===s&&(this.workItemMessageError=o?.message||String(o))}finally{this.workItemComposerScope===s&&(this.workItemMessageAttachmentsUploading=!1)}}},removeWorkItemMessageAttachment(e){this.workItemMessageAttachments=this.workItemMessageAttachments.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?xs(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.workItemMessageAttachments.length===0||this.workItemMessageSending||this.workItemMessageAttachmentsUploading||this.coordinatorThinking||this.coordinatorReadOnly)return;let e=this.workItemComposerScope,t=this.selected.id,s=this.selected.revision,n=this.workItemMessage.trim(),i=this.workItemMessageAttachments.map(r=>({fileId:r.fileId,name:r.name,mimeType:r.mimeType,size:r.size}));this.workItemMessageSending=!0,this.workItemMessageError="";try{await this.store.sendWorkItemMessage(t,n,s,i,this.agentId,{planRevision:this.selected.planRevision,ledgerRevision:this.selected.ledgerRevision,coordinatorRevision:this.selected.coordinatorRevision}),this.workItemComposerScope===e&&this.workItemMessage.trim()===n&&(this.workItemMessage="",this.workItemMessageAttachments=[],this.$nextTick(()=>this.resizeWorkItemComposer(this.$refs.workItemComposerInput,!0)))}catch(r){this.workItemComposerScope===e&&(this.workItemMessageError=r?.message||String(r))}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(a=>({fileId:a.fileId,name:a.name,mimeType:a.mimeType,size:a.size})),o=(Number(this.actionInputRequestGeneration)||0)+1;this.actionInputRequestGeneration=o,this.actionGuidance="",this.guidanceAttachments=[],this.actionInputSending=!0,this.actionInputError="";try{let a=await this.store.sendWorkItemActionInput(t,i,s,n,this.selectedAction.generation,r,this.agentId);if(this.selected?.id!==t||this.actionInputRequestGeneration!==o)return;let l=a?.id===t&&a?.actions?.some(d=>d?.id===s);if(this.guidanceAttachments=[],this.$nextTick(()=>{let d=this.$el?.querySelector?.(".work-center-action-input-wrapper textarea");d&&(d.style.height="24px",d.style.overflowY="hidden")}),a?.accepted&&a?.routedTo==="coordinator")return;let c=l?s:a?.currentActionId||this.selectedActionId;c!==this.selectedActionId&&(this.resetActionComposer(),this.previewingAttachmentId=null,this.attachmentPreviewError="",this.attachmentPreviewGeneration=(Number(this.attachmentPreviewGeneration)||0)+1),this.selectedActionId=c}catch(a){this.actionInputRequestGeneration===o&&(this.actionGuidance||(this.actionGuidance=i),this.guidanceAttachments.length===0&&(this.guidanceAttachments=r.map(l=>({...l}))),this.actionInputError=a?.message||String(a))}finally{this.actionInputRequestGeneration===o&&(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&&(as(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||["done","cancelled"].includes(this.selected.status))return;let e=this.tr("workCenter.cancelConfirm","Stop this work item and its unfinished Actions?");typeof confirm=="function"&&!confirm(e)||await this.store.cancelWorkItem(this.selected.id,this.agentId)},async resumeSelected(){!this.selected||this.selected.status!=="cancelled"||await this.store.resumeWorkItem(this.selected.id,this.selected.revision,this.agentId)}},template:`
5240
5240
  <main class="work-center-main" :class="{ 'workbench-maximized': store.workbenchMaximized && store.workbenchExpanded }">
5241
5241
  <div class="work-center-shell" :class="{ 'showing-detail': narrowPane !== 'items' }">
5242
5242
  <header class="work-center-header">
@@ -6160,7 +6160,7 @@ ${String(e||"").trim()}
6160
6160
  </div>
6161
6161
  </div>
6162
6162
  </div>
6163
- `,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=xe().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(){Mp({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 Bc(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 zi(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 Ui(e)},formatTime(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""},getLastPathSegment(e){return bn(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 Ph,Ep,Rp=H(()=>{Is();Ph=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"]),Ep={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:`
6163
+ `,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=xe().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(){Mp({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 Bc(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 zi(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 Ui(e)},formatTime(e){return e?new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):""},getLastPathSegment(e){return bn(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 Dh,Ep,Rp=H(()=>{Is();Dh=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"]),Ep={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:`
6164
6164
  <span
6165
6165
  class="vp-avatar"
6166
6166
  :class="{ 'is-busy': status === 'busy', 'is-online': status === 'online', 'is-typing': typing && !status }"
@@ -6195,7 +6195,7 @@ ${String(e||"").trim()}
6195
6195
  <span class="vp-avatar-typing-dot"></span>
6196
6196
  </span>
6197
6197
  </span>
6198
- `,setup(e){let t=gt(),s=Vue.computed(()=>t.vpInitial(e.vpId)),n=Vue.computed(()=>t.vpLabel(e.vpId)),i=Vue.computed(()=>{let p=t.vpAvatarMotif;return typeof p=="function"?p(e.vpId):{key:"rat",glyph:"R",background:"linear-gradient(135deg, #174EA6 0%, #0B2F6B 100%)",foreground:"#FFFFFF"}}),r=Vue.computed(()=>{let p=t.vpColor;return typeof p=="function"?p(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 p=e.vpId;return!p||!Ph.has(p)?null:`/assets/avatars/${p}.svg`});function u(){c.value=!0}Vue.watch(()=>e.vpId,()=>{c.value=!1});let f=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:f,avatarUrl:d,motifKey:o,motifGlyph:a,onImgError:u}}}});function Dh(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-$p),a=Math.max(0,r-e.bottom-$p),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 Lp,$p,ji,sa=H(()=>{Rp();ta();gn();Zo();Lp="omni",$p=4;ji={name:"SessionCreateModal",components:{VpAvatar:Ep},emits:["close","created"],template:`
6198
+ `,setup(e){let t=gt(),s=Vue.computed(()=>t.vpInitial(e.vpId)),n=Vue.computed(()=>t.vpLabel(e.vpId)),i=Vue.computed(()=>{let p=t.vpAvatarMotif;return typeof p=="function"?p(e.vpId):{key:"rat",glyph:"R",background:"linear-gradient(135deg, #174EA6 0%, #0B2F6B 100%)",foreground:"#FFFFFF"}}),r=Vue.computed(()=>{let p=t.vpColor;return typeof p=="function"?p(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 p=e.vpId;return!p||!Dh.has(p)?null:`/assets/avatars/${p}.svg`});function u(){c.value=!0}Vue.watch(()=>e.vpId,()=>{c.value=!1});let f=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:f,avatarUrl:d,motifKey:o,motifGlyph:a,onImgError:u}}}});function _h(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-$p),a=Math.max(0,r-e.bottom-$p),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 Lp,$p,ji,sa=H(()=>{Rp();ta();gn();Zo();Lp="omni",$p=4;ji={name:"SessionCreateModal",components:{VpAvatar:Ep},emits:["close","created"],template:`
6199
6199
  <Teleport to="body">
6200
6200
  <div class="modal-overlay" @click.self="onOverlayClick" role="dialog" aria-modal="true" :aria-label="$t('yeaft.session.create.title')">
6201
6201
  <div class="modal resume-modal yeaft-session-create-modal">
@@ -6471,7 +6471,7 @@ ${String(e||"").trim()}
6471
6471
  </div>
6472
6472
  </div>
6473
6473
  </Teleport>
6474
- `,data(){return{form:{name:"",vpIds:[],defaultVpId:null,workDir:"",agentId:null},busy:!1,submitError:"",...Qo(),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 ss(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=Dh(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(Lp)?Lp: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 bn(e)},formatDate(e){return zi(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},...Xo,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()||bn(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,f=u&&u.id,p=u&&u.agentId;f&&(p&&d&&d.currentAgent!==p&&typeof d.selectAgent=="function"&&d.selectAgent(p),this.sessionsStore&&this.sessionsStore.setActive(f),d&&typeof d.setActiveSessionFilter=="function"&&d.setActiveSessionFilter(f,{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 Vp({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:ei(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,f=a.has(d.id)?a.get(d.id):Number.MAX_SAFE_INTEGER;return u!==f?u-f:c.id.localeCompare(d.id)}),l.map(({_manualOrder:c,_activityTime:d,...u})=>u)}var Fp=H(()=>{ti()});var _h,$S,Op,Hp=H(()=>{sa();Bo();qo();Wo();Uo();ea();Fp();_h=3600*1e3,$S=24*_h,Op={name:"YeaftSidebar",components:{SessionCreateModal:ji,SidebarModeToggle:$i,SidebarAgentHeader:Vi,SidebarWorkCenter:Fi,SessionSidebarShell:Oi},emits:["select-group","select-chat","toggle-sidebar","back","open-settings","open-group-settings"],template:`
6474
+ `,data(){return{form:{name:"",vpIds:[],defaultVpId:null,workDir:"",agentId:null},busy:!1,submitError:"",...Qo(),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 ss(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=_h(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(Lp)?Lp: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 bn(e)},formatDate(e){return zi(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},...Xo,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()||bn(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,f=u&&u.id,p=u&&u.agentId;f&&(p&&d&&d.currentAgent!==p&&typeof d.selectAgent=="function"&&d.selectAgent(p),this.sessionsStore&&this.sessionsStore.setActive(f),d&&typeof d.setActiveSessionFilter=="function"&&d.setActiveSessionFilter(f,{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 Vp({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:ei(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,f=a.has(d.id)?a.get(d.id):Number.MAX_SAFE_INTEGER;return u!==f?u-f:c.id.localeCompare(d.id)}),l.map(({_manualOrder:c,_activityTime:d,...u})=>u)}var Fp=H(()=>{ti()});var Eh,VS,Op,Hp=H(()=>{sa();Bo();qo();Wo();Uo();ea();Fp();Eh=3600*1e3,VS=24*Eh,Op={name:"YeaftSidebar",components:{SessionCreateModal:ji,SidebarModeToggle:$i,SidebarAgentHeader:Vi,SidebarWorkCenter:Fi,SessionSidebarShell:Oi},emits:["select-group","select-chat","toggle-sidebar","back","open-settings","open-group-settings"],template:`
6475
6475
  <SessionSidebarShell class="yeaft-sidebar" :collapsed="collapsed">
6476
6476
  <template #collapsed>
6477
6477
  <!-- Collapsed Icon Bar \u2014 mirrors Chat's .sidebar-collapsed-bar so the
@@ -6653,7 +6653,7 @@ ${String(e||"").trim()}
6653
6653
  </div>
6654
6654
  </div>
6655
6655
  </div>
6656
- `,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 na(e){return e==="members"||e==="memory"||e===Ot?e:(Eh.has(e),Ot)}var Ot,Eh,qp,Wp=H(()=>{is();gn();Ot="session",Eh=new Set(["announcement","rename","danger"]);qp={name:"SessionSettingsModal",emits:["close","open-vp-library"],props:{groupId:{type:String,required:!0},agentId:{type:String,default:null},initialSection:{type:String,default:Ot,validator:e=>[Ot,"announcement","members","rename","memory","danger"].includes(e)},initialEditVpId:{type:String,default:""}},data(){return{section:this.initialEditVpId?"members":na(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 ss(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:Ot,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===Ot&&(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=na(e))},groupId(){this.section=this.initialEditVpId?"members":na(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===Ot&&(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){Qe(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:`
6656
+ `,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 na(e){return e==="members"||e==="memory"||e===Ot?e:(Rh.has(e),Ot)}var Ot,Rh,qp,Wp=H(()=>{is();gn();Ot="session",Rh=new Set(["announcement","rename","danger"]);qp={name:"SessionSettingsModal",emits:["close","open-vp-library"],props:{groupId:{type:String,required:!0},agentId:{type:String,default:null},initialSection:{type:String,default:Ot,validator:e=>[Ot,"announcement","members","rename","memory","danger"].includes(e)},initialEditVpId:{type:String,default:""}},data(){return{section:this.initialEditVpId?"members":na(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 ss(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:Ot,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===Ot&&(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=na(e))},groupId(){this.section=this.initialEditVpId?"members":na(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===Ot&&(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){Qe(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:`
6657
6657
  <Teleport to="body">
6658
6658
  <div
6659
6659
  class="group-settings-overlay"
@@ -6867,13 +6867,13 @@ ${String(e||"").trim()}
6867
6867
  </div>
6868
6868
  </div>
6869
6869
  </Teleport>
6870
- `}});function Rh(e){let t=String(e||"").trim();return t?t.startsWith("[")&&t.endsWith("]")?Up(t.slice(1,-1)).map(s=>s.trim().replace(/^["']|["']$/g,"")).map(s=>zp(s)).filter(Boolean):Up(t).map(s=>zp(s.trim())).filter(Boolean):[]}function Up(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 zp(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 Lh(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]=Rh(o):t[r]=o.replace(/^["']|["']$/g,"")}return t}function $h(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=Lh(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:Ls(o,180)})}return s.length?s:[{id:"memory-1",scope:"",kind:"raw",tags:[],sourceMessages:[],createdAt:"",updatedAt:"",content:t,preview:Ls(t,180)}]}function Ls(e,t=160){let s=String(e||"").replace(/\s+/g," ").trim();return s.length<=t?s:`${s.slice(0,t).trim()}...`}function Vh(e){let t=String(e||"").trim();return t?(t.split(/\r?\n/).map(n=>n.trim()).find(Boolean)||"").replace(/^#+\s*/,"").replace(/^[-*]\s*/,"").trim():""}function Fh(e){return String(e||"").replace(/\s+/g," ").trim()}function jp(e,t){return t?.sessionId||String(e||"").replace(/^sessions\//,"")}function Oh(e,t,s){let n=jp(e,t);return Fh(s?.[e]||s?.[n]||t?.sessionTitle||t?.title||t?.name||Vh(t?.summaryText))||n||e}function Kp(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(`
6871
- `).includes(s)):Array.isArray(e)?e:[]}function Gp({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,f=(Array.isArray(n)?n:[]).filter(v=>v?.scope===o),p=f[f.length-1]||null,g=l?.finishedAt||l?.startedAt||a?.lastDreamAt||p?.at||a?.loadedAt||"",b=$h(a?.memoryText||""),h=jp(o,a),A=Oh(o,a,i),w=c?Ls(c.message||c.error||c.raw||"",180):"",S=Ls(w||a?.summaryText||a?.memoryText||p?.detail||"",180);return{key:o,title:A,scope:o,sessionId:h,status:d,lastAt:g,latestRun:l,snapshot:a,lastError:c,promptLoad:u,events:f,segmentCount:b.length,segments:b,summaryPreview:S,subtitle:S,hasRequestResponse:f.some(v=>v?.request||v?.response||v?.systemPrompt||v?.rawRequest||v?.rawResponse)}}).sort((o,a)=>String(a.lastAt||"").localeCompare(String(o.lastAt||"")))}var Yp=H(()=>{});var Ki,Hh,Qp,Xp=H(()=>{Yp();Lr();Ki=1,Hh=5,Qp={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:Ki,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}
6870
+ `}});function Lh(e){let t=String(e||"").trim();return t?t.startsWith("[")&&t.endsWith("]")?Up(t.slice(1,-1)).map(s=>s.trim().replace(/^["']|["']$/g,"")).map(s=>zp(s)).filter(Boolean):Up(t).map(s=>zp(s.trim())).filter(Boolean):[]}function Up(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 zp(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 $h(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]=Lh(o):t[r]=o.replace(/^["']|["']$/g,"")}return t}function Vh(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=$h(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:Ls(o,180)})}return s.length?s:[{id:"memory-1",scope:"",kind:"raw",tags:[],sourceMessages:[],createdAt:"",updatedAt:"",content:t,preview:Ls(t,180)}]}function Ls(e,t=160){let s=String(e||"").replace(/\s+/g," ").trim();return s.length<=t?s:`${s.slice(0,t).trim()}...`}function Fh(e){let t=String(e||"").trim();return t?(t.split(/\r?\n/).map(n=>n.trim()).find(Boolean)||"").replace(/^#+\s*/,"").replace(/^[-*]\s*/,"").trim():""}function Oh(e){return String(e||"").replace(/\s+/g," ").trim()}function jp(e,t){return t?.sessionId||String(e||"").replace(/^sessions\//,"")}function Hh(e,t,s){let n=jp(e,t);return Oh(s?.[e]||s?.[n]||t?.sessionTitle||t?.title||t?.name||Fh(t?.summaryText))||n||e}function Kp(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(`
6871
+ `).includes(s)):Array.isArray(e)?e:[]}function Gp({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,f=(Array.isArray(n)?n:[]).filter(v=>v?.scope===o),p=f[f.length-1]||null,g=l?.finishedAt||l?.startedAt||a?.lastDreamAt||p?.at||a?.loadedAt||"",b=Vh(a?.memoryText||""),h=jp(o,a),A=Hh(o,a,i),w=c?Ls(c.message||c.error||c.raw||"",180):"",S=Ls(w||a?.summaryText||a?.memoryText||p?.detail||"",180);return{key:o,title:A,scope:o,sessionId:h,status:d,lastAt:g,latestRun:l,snapshot:a,lastError:c,promptLoad:u,events:f,segmentCount:b.length,segments:b,summaryPreview:S,subtitle:S,hasRequestResponse:f.some(v=>v?.request||v?.response||v?.systemPrompt||v?.rawRequest||v?.rawResponse)}}).sort((o,a)=>String(a.lastAt||"").localeCompare(String(o.lastAt||"")))}var Yp=H(()=>{});var Ki,Nh,Qp,Xp=H(()=>{Yp();Lr();Ki=1,Nh=5,Qp={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:Ki,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}
6872
6872
  ... truncated`:t},dreamSnapshotSummary(){let e=this.dreamSnapshot,t=e&&typeof e.summaryText=="string"?e.summaryText.trim():"";return t&&e.summaryTruncated?`${t}
6873
6873
  ... truncated`:t},dreamSnapshotMemory(){let e=this.dreamSnapshot,t=e&&typeof e.memoryText=="string"?e.memoryText.trim():"";return t&&e.memoryTruncated?`${t}
6874
6874
  ... 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 Gp({latest:e.yeaftDreamLatest||{},snapshots:e.yeaftDreamSnapshots||{},promptLoads:e.yeaftDreamPromptLoads||{},events:s,sessionTitles:this.dreamSessionTitles})},dreamItems(){return Kp(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:Ki,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:Ki,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(`
6875
6875
  `),"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 yl(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=vl(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=Rr(n,t.inputMessageTokens,t.inputToolTokens),a=Rr(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((p,g)=>!r.has(g)&&p.callId===d):-1;u<0&&(u=i.findIndex((p,g)=>!r.has(g)&&!p.callId&&p.name===c.name));let f=u>=0?i[u]:null;u>=0&&r.add(u),a.push(this.normalizeToolDebugRow(n,c,f,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(`
6876
- `)}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 Ls(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?Hh:Ki,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:hl(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(`
6876
+ `)}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 Ls(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?Nh:Ki,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:hl(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(`
6877
6877
  `),"turn markdown")}},template:`
6878
6878
  <div class="yeaft-debug-panel">
6879
6879
  <div class="yeaft-debug-header">
@@ -7355,9 +7355,9 @@ ${String(e||"").trim()}
7355
7355
  <span v-else>{{ requestHistoryLoading ? $t('yeaft.debugHistoryLoading') : $t('yeaft.noDebugData') }}</span>
7356
7356
  </div>
7357
7357
  </div>
7358
- `}});function ef(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=Jp(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 f=Nh(u);if(f){if(f.type==="text_delta"){r=f.agentName||f.agentId||r,o+=f.text||f.content||f.delta||"";continue}if(f.type==="tool_use"||f.type==="tool_call"){a+=1;continue}if(f.type==="sub_agent_turn_end"){c();let p=Zp(f,s);p&&i.push(p);continue}if(f.type==="error"){l();let p=Zp(f,s);p&&i.push(p)}}}l();let d=qh(a,s);return d&&i.push(d),i.join(`
7359
- `)}function Wh(e,t){if(!e||e.kind!=="sub_agent")return[];let s=typeof t=="function"?t:l=>l,n=Bh(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=ef(e,t).split(`
7360
- `).filter(Boolean).filter(l=>!o.includes(l));return[...o,...a]}var Nh,Bh,Jp,qh,Zp,tf,sf=H(()=>{bo();Nh=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}},Bh=(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},Jp=e=>typeof e!="string"?"":e.trim(),qh=(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})},Zp=(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=Jp(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""};tf={name:"VpTimelinePane",components:{TerminalOutput:pi},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:`
7358
+ `}});function ef(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=Jp(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 f=Bh(u);if(f){if(f.type==="text_delta"){r=f.agentName||f.agentId||r,o+=f.text||f.content||f.delta||"";continue}if(f.type==="tool_use"||f.type==="tool_call"){a+=1;continue}if(f.type==="sub_agent_turn_end"){c();let p=Zp(f,s);p&&i.push(p);continue}if(f.type==="error"){l();let p=Zp(f,s);p&&i.push(p)}}}l();let d=Wh(a,s);return d&&i.push(d),i.join(`
7359
+ `)}function Uh(e,t){if(!e||e.kind!=="sub_agent")return[];let s=typeof t=="function"?t:l=>l,n=qh(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=ef(e,t).split(`
7360
+ `).filter(Boolean).filter(l=>!o.includes(l));return[...o,...a]}var Bh,qh,Jp,Wh,Zp,tf,sf=H(()=>{bo();Bh=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}},qh=(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},Jp=e=>typeof e!="string"?"":e.trim(),Wh=(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})},Zp=(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=Jp(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""};tf={name:"VpTimelinePane",components:{TerminalOutput:pi},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:`
7361
7361
  <aside class="yeaft-vp-timeline yeaft-session-status-pane" :aria-label="$t('yeaft.sessionStatus.aria')">
7362
7362
  <div
7363
7363
  class="yeaft-vp-timeline-resize-handle"
@@ -7570,7 +7570,7 @@ ${String(e||"").trim()}
7570
7570
  </section>
7571
7571
  </aside>
7572
7572
  `,setup(e,{emit:t}){let s=window.Pinia&&window.Pinia.useVpStore?window.Pinia.useVpStore():null,n=I=>s&&typeof s.vpTextColor=="function"?s.vpTextColor(I):"var(--text-primary)",i=Vue.getCurrentInstance(),r=i&&i.appContext.config.globalProperties.$t||(I=>I),o=Vue.computed(()=>(typeof e.announcementText=="string"?e.announcementText:"").trim()),a=Vue.computed(()=>!!o.value),l=Vue.computed(()=>{let I=o.value.replace(/\s+/g," ");return I.length<=96?I:I.slice(0,95)+"\u2026"}),c=Vue.ref({}),d=new Map,u=new Map,f=I=>{let D=d.get(I);D&&(D.scrollTop=D.scrollHeight,u.set(I,!0))},p=I=>{let D=!c.value[I];c.value={...c.value,[I]:D},D&&(u.set(I,!0),Vue.nextTick(()=>f(I)))},g=(I,D)=>{D?(d.set(I,D),u.has(I)||u.set(I,!0),Vue.nextTick(()=>{u.get(I)&&f(I)})):d.delete(I)},b=I=>{let D=d.get(I);if(!D)return;let B=D.scrollHeight-D.scrollTop-D.clientHeight;u.set(I,B<8)};Vue.watch(()=>JSON.stringify((Array.isArray(e.tasks)?e.tasks:[]).map(I=>[I.id,I?.log?.preview||""])),()=>Vue.nextTick(()=>{d.forEach((I,D)=>{u.get(D)&&f(D)})}));let h=I=>{let D=I?.ownerVpId||"";return D?s&&typeof s.vpLabel=="function"?s.vpLabel(D):D:"unknown"},A=I=>{if(!I)return"";try{return new Date(I).toLocaleTimeString()}catch{return String(I)}},w=I=>{switch(I?.kind){case"sub_agent":return r("yeaft.sessionStatus.task.kind.subAgent");case"shell":return r("yeaft.sessionStatus.task.kind.shell");default:return I?.kind||""}},S=I=>{let D=I?.runtime?.command;return typeof D=="string"?D.trim():""},v=I=>{let D=[],B=I?.title||I?.id||"",O=S(I);return B&&D.push(`${r("yeaft.sessionStatus.task.title")}: ${B}`),O&&D.push(`${r("yeaft.sessionStatus.task.command")}: ${O}`),D.join(`
7573
- `)},m=I=>`${I?.sessionId||""}::${I?.id||""}`,y=I=>I?.kind==="shell"&&I?.status==="running"&&!!I?.runtime?.pid,E=I=>!!(I?.id&&e.stoppingTasksById?.[m(I)]),$=I=>Wh(I,r),U=I=>ef(I,r),V=I=>{switch(I.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"retrying":return r("yeaft.vpTimeline.status.retrying");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 I.status}},L=new Set(["typing","thinking","retrying","streaming","tool"]);return{hasAnnouncement:a,announcementPreview:l,statusLabel:V,isActiveStatus:I=>L.has(I),threadCountTitle:I=>{let D=Array.isArray(I&&I.threads)?I.threads:[];return D.length?D.slice(0,5).map(B=>`${B.title||B.threadId||"thread"}: ${B.status||"idle"}`).join(`
7573
+ `)},m=I=>`${I?.sessionId||""}::${I?.id||""}`,y=I=>I?.kind==="shell"&&I?.status==="running"&&!!I?.runtime?.pid,E=I=>!!(I?.id&&e.stoppingTasksById?.[m(I)]),$=I=>Uh(I,r),U=I=>ef(I,r),V=I=>{switch(I.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"retrying":return r("yeaft.vpTimeline.status.retrying");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 I.status}},L=new Set(["typing","thinking","retrying","streaming","tool"]);return{hasAnnouncement:a,announcementPreview:l,statusLabel:V,isActiveStatus:I=>L.has(I),threadCountTitle:I=>{let D=Array.isArray(I&&I.threads)?I.threads:[];return D.length?D.slice(0,5).map(B=>`${B.title||B.threadId||"thread"}: ${B.status||"idle"}`).join(`
7574
7574
  `):""},vpTextColorFor:n,expandedTasks:c,toggleTaskExpanded:p,taskOwnerName:h,formatTaskTime:A,taskKindLabel:w,shellTaskCommand:S,taskSummaryTitle:v,isTaskCancellable:y,isTaskStopping:E,taskDetailLines:$,subAgentTaskStreamText:U,setTaskLogRef:g,onTaskLogScroll:b}}}});var nf,rf=H(()=>{nf={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:`
7575
7575
  <div class="yeaft-session-actions">
7576
7576
  <button
@@ -7633,7 +7633,7 @@ ${String(e||"").trim()}
7633
7633
  </svg>
7634
7634
  </button>
7635
7635
  </div>
7636
- `}});function of(e){let t=typeof e=="number"?e:Date.parse(e||"");return Number.isFinite(t)?t:null}function Uh(e){let t=of(e);return t===null?"":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}function zh(e){return(Array.isArray(e)?e:[]).map((t,s)=>({result:t,index:s,time:of(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 af,lf=H(()=>{No();af={name:"YeaftConversationOutline",components:{ModernSelect:Li},props:{outlineState:{type:Object,required:!0},searchState:{type:Object,required:!0},senderOptions:{type:Array,default:()=>[]},activeMessageId:{type:String,default:null}},emits:["query","sender","sender-invalid","select","move","preview","load-older","load-more-search","close"],computed:{senderSelectOptions(){return[{value:"",label:this.$t("yeaft.outline.allSenders")},...this.senderOptions.map(e=>({value:e.key,label:e.label}))]}},template:`
7636
+ `}});function of(e){let t=typeof e=="number"?e:Date.parse(e||"");return Number.isFinite(t)?t:null}function zh(e){let t=of(e);return t===null?"":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}function jh(e){return(Array.isArray(e)?e:[]).map((t,s)=>({result:t,index:s,time:of(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 af,lf=H(()=>{No();af={name:"YeaftConversationOutline",components:{ModernSelect:Li},props:{outlineState:{type:Object,required:!0},searchState:{type:Object,required:!0},senderOptions:{type:Array,default:()=>[]},activeMessageId:{type:String,default:null}},emits:["query","sender","sender-invalid","select","move","preview","load-older","load-more-search","close"],computed:{senderSelectOptions(){return[{value:"",label:this.$t("yeaft.outline.allSenders")},...this.senderOptions.map(e=>({value:e.key,label:e.label}))]}},template:`
7637
7637
  <section id="yeaft-conversation-outline" class="yeaft-conversation-outline" :aria-label="$t('yeaft.outline.label')">
7638
7638
  <div class="yeaft-conversation-outline-header">
7639
7639
  <div>
@@ -7709,7 +7709,7 @@ ${String(e||"").trim()}
7709
7709
  >{{ $t('yeaft.outline.moreMatches') }}</button>
7710
7710
  </div>
7711
7711
  </section>
7712
- `,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||!!e.searchState.senderKey);Vue.watch(()=>e.senderOptions.map(w=>w.key),w=>{let S=e.searchState.senderKey||"";S&&!w.includes(S)&&t("sender-invalid")},{flush:"sync"});let o=Vue.computed(()=>zh(r.value?e.searchState.results:e.outlineState.results)),a=Vue.computed(()=>{let w=o.value.findIndex(S=>S?.messageId===e.activeMessageId);return w>=0?w: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 w=e.outlineState.totalCount;return Number.isFinite(w)?String(w):String(e.outlineState.results.length||"")}),d=Vue.computed(()=>{let w=r.value?e.searchState.error:e.outlineState.error;return w?w==="unsupported"?"yeaft.outline.unsupported":"yeaft.outline.error":""}),u=()=>Vue.nextTick(()=>{n.value?.focus?.(),i.value&&(i.value.scrollTop=0)}),f=()=>{let w=i.value;t("load-older",{scrollHeight:w?.scrollHeight||0,scrollTop:w?.scrollTop||0})},p=()=>{if(r.value||e.outlineState.loading||!e.outlineState.hasMore)return;let w=i.value;w&&w.scrollHeight-w.scrollTop-w.clientHeight<=40&&f()},g=w=>{t("move",w?.messageId||null),t("preview",w)},b=w=>{let S=Math.max(0,Math.min(o.value.length-1,w)),v=o.value[S];t("move",v?.messageId||null),v&&t("preview",v)},h=w=>{w.key==="Escape"?(w.preventDefault(),t("close")):w.key==="ArrowDown"&&o.value.length?(w.preventDefault(),b(a.value+1)):w.key==="ArrowUp"&&o.value.length?(w.preventDefault(),b(a.value-1)):w.key==="Enter"&&o.value.length&&(w.preventDefault(),t("select",o.value[a.value]||o.value[0]))};return Vue.watch([o,()=>e.activeMessageId],([w,S])=>{w.some(v=>v?.messageId===S)||t("move",w[0]?.messageId||null)},{immediate:!0}),s({focus:u,restoreOlderScroll:({scrollTop:w=0}={})=>Vue.nextTick(()=>{i.value&&(i.value.scrollTop=w)})}),Vue.onMounted(u),{inputRef:n,listRef:i,isSearching:r,visibleResults:o,activeIndex:a,isLoading:l,countLabel:c,errorKey:d,focus:u,loadOlder:f,onScroll:p,onKeyDown:h,previewResult:g,formatOutlineTime:Uh}}}});function df(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 ia(e,t,s=null){return!t||!e?null:typeof e.sessionById=="function"?e.sessionById(t,s||null)||null:e.sessions?.[t]||null}function jh(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 uf(e){let{vpList:t,vpStatuses:s,stoppingVpTurnIds:n,connectionState:i,vpLabelOf:r,vpDescriptionOf:o}=e||{},a={vpStatuses:s||{},stoppingVpTurnIds:n||{},connectionState:i||null},l=(f,p)=>{if(typeof r=="function"){let g=r(f);if(g)return g}return p&&(p.displayName||p.displayNameZh)||f},c=(f,p)=>{if(typeof o=="function"){let g=o(f);if(g)return g}return p&&(p.description||p.role||p.descriptionZh||p.roleZh)||""},d=new Set,u=[];if(Array.isArray(t))for(let f of t)!f||!f.vpId||(d.add(f.vpId),u.push(cf(f.vpId,l(f.vpId,f),c(f.vpId,f),a)));if(s)for(let f of Object.keys(s))!f||d.has(f)||(d.add(f),u.push(cf(f,l(f,null),c(f,null),a)));return u}function cf(e,t,s,n){let i=n&&n.vpStatuses&&n.vpStatuses[e];return{vpId:e,displayName:t||e,description:s||"",status:jh(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 pf=H(()=>{});function Gi(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 wn(e,t){return!e||!t?!1:e.id===t||Gi(e)===t}function gf(e,t=""){let s=e?.config?.model;return typeof s=="string"&&s.trim()?s.trim():typeof t=="string"&&t.trim()?t.trim():""}function mf(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 ra(e){return mf(e).filter(t=>(ff[t]??-1)>=ff.medium)}function oa(e){let t=mf(e);return t.length?t.length===1?t[0]:t[t.length-2]:""}function hf(e,t=""){let s=e?.config?.modelEffort;return typeof s=="string"&&s.trim()?s.trim():typeof t=="string"&&t.trim()?t.trim():""}function vf(e){let t=[];for(let s of Array.isArray(e)?e:[]){let n=Gi(s);if(!n)continue;let i=s.label||s.id||n,r=ra(s?.effortOptions);t.push({model:s,modelRef:n,label:i,efforts:r,defaultEffort:oa(r)||null})}return t}var ff,yf=H(()=>{ff=Object.freeze({minimal:0,low:1,medium:2,high:3,xhigh:4,max:5})});function bf({hasYeaftAgent:e=!1,sessionsReady:t=!1,sessionsEmpty:s=!1}={}){return t&&!s?!1:e?t?s:!1:!0}var wf=H(()=>{});function kf({activeSessionFilter:e=null,sessionsStore:t=null,topbarGroup:s=null}={}){return e||t?.activeSessionId||s?.id||null}function Sf(e={}){return e.currentAgentInfo?.online?!0:Array.isArray(e.agents)&&e.agents.some(t=>t&&t.online)}var Cf=H(()=>{});function If(e={}){return!e?.warning}var Af=H(()=>{});function Mf(e,t){return e&&t?`${e}:${t}`:""}function Pf(e){if(e!==void 0)return e;try{return globalThis.localStorage}catch{return null}}function Df(e){try{let t=JSON.parse(e?.getItem(aa)||"{}");return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Kh({agentId:e,sessionId:t,validKeys:s=[],storage:n}={}){let i=Mf(e,t);if(!i)return"";let r=Pf(n),o=Df(r),a=typeof o[i]=="string"?o[i]:"";if(!a||s.includes(a))return a;delete o[i];try{r?.setItem(aa,JSON.stringify(o))}catch{}return""}function xf({agentId:e,sessionId:t,senderKey:s,storage:n}={}){let i=Mf(e,t);if(!i)return!1;let r=Pf(n);if(!r)return!1;let o=Df(r);s?o[i]=s:delete o[i];try{return r.setItem(aa,JSON.stringify(o)),!0}catch{return!1}}function Tf(e){let t=e?.updatedAt||e?.endedAt||e?.createdAt,s=t?Date.parse(t):NaN;return Number.isFinite(s)?s:0}function Gh(e){return Object.values(e||{}).filter(Boolean).sort((t,s)=>t.status==="running"&&s.status!=="running"?-1:t.status!=="running"&&s.status==="running"?1:Tf(s)-Tf(t))}var aa,_f,Ef=H(()=>{Ai();xo();Vo();Hp();Bp();sa();Wp();$o();Xp();sf();rf();lf();Yo();Jo();To();pf();yf();is();wf();Cf();Af();Ao();aa="yeaft-history-sender-preferences";_f={name:"YeaftPage",components:{ChatInput:Ds,MessageList:bi,SettingsPanel:_i,YeaftSidebar:Op,SessionInviteModal:Np,SessionCreateModal:ji,SessionSettingsModal:qp,WorkbenchPanel:Di,WorkCenterPage:Wi,YeaftDebugPanel:Qp,VpTimelinePane:tf,YeaftSessionActions:nf,YeaftConversationOutline:af,LlmTab:qi},template:`
7712
+ `,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||!!e.searchState.senderKey);Vue.watch(()=>e.senderOptions.map(w=>w.key),w=>{let S=e.searchState.senderKey||"";S&&!w.includes(S)&&t("sender-invalid")},{flush:"sync"});let o=Vue.computed(()=>jh(r.value?e.searchState.results:e.outlineState.results)),a=Vue.computed(()=>{let w=o.value.findIndex(S=>S?.messageId===e.activeMessageId);return w>=0?w: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 w=e.outlineState.totalCount;return Number.isFinite(w)?String(w):String(e.outlineState.results.length||"")}),d=Vue.computed(()=>{let w=r.value?e.searchState.error:e.outlineState.error;return w?w==="unsupported"?"yeaft.outline.unsupported":"yeaft.outline.error":""}),u=()=>Vue.nextTick(()=>{n.value?.focus?.(),i.value&&(i.value.scrollTop=0)}),f=()=>{let w=i.value;t("load-older",{scrollHeight:w?.scrollHeight||0,scrollTop:w?.scrollTop||0})},p=()=>{if(r.value||e.outlineState.loading||!e.outlineState.hasMore)return;let w=i.value;w&&w.scrollHeight-w.scrollTop-w.clientHeight<=40&&f()},g=w=>{t("move",w?.messageId||null),t("preview",w)},b=w=>{let S=Math.max(0,Math.min(o.value.length-1,w)),v=o.value[S];t("move",v?.messageId||null),v&&t("preview",v)},h=w=>{w.key==="Escape"?(w.preventDefault(),t("close")):w.key==="ArrowDown"&&o.value.length?(w.preventDefault(),b(a.value+1)):w.key==="ArrowUp"&&o.value.length?(w.preventDefault(),b(a.value-1)):w.key==="Enter"&&o.value.length&&(w.preventDefault(),t("select",o.value[a.value]||o.value[0]))};return Vue.watch([o,()=>e.activeMessageId],([w,S])=>{w.some(v=>v?.messageId===S)||t("move",w[0]?.messageId||null)},{immediate:!0}),s({focus:u,restoreOlderScroll:({scrollTop:w=0}={})=>Vue.nextTick(()=>{i.value&&(i.value.scrollTop=w)})}),Vue.onMounted(u),{inputRef:n,listRef:i,isSearching:r,visibleResults:o,activeIndex:a,isLoading:l,countLabel:c,errorKey:d,focus:u,loadOlder:f,onScroll:p,onKeyDown:h,previewResult:g,formatOutlineTime:zh}}}});function df(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 ia(e,t,s=null){return!t||!e?null:typeof e.sessionById=="function"?e.sessionById(t,s||null)||null:e.sessions?.[t]||null}function Kh(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 uf(e){let{vpList:t,vpStatuses:s,stoppingVpTurnIds:n,connectionState:i,vpLabelOf:r,vpDescriptionOf:o}=e||{},a={vpStatuses:s||{},stoppingVpTurnIds:n||{},connectionState:i||null},l=(f,p)=>{if(typeof r=="function"){let g=r(f);if(g)return g}return p&&(p.displayName||p.displayNameZh)||f},c=(f,p)=>{if(typeof o=="function"){let g=o(f);if(g)return g}return p&&(p.description||p.role||p.descriptionZh||p.roleZh)||""},d=new Set,u=[];if(Array.isArray(t))for(let f of t)!f||!f.vpId||(d.add(f.vpId),u.push(cf(f.vpId,l(f.vpId,f),c(f.vpId,f),a)));if(s)for(let f of Object.keys(s))!f||d.has(f)||(d.add(f),u.push(cf(f,l(f,null),c(f,null),a)));return u}function cf(e,t,s,n){let i=n&&n.vpStatuses&&n.vpStatuses[e];return{vpId:e,displayName:t||e,description:s||"",status:Kh(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 pf=H(()=>{});function Gi(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 wn(e,t){return!e||!t?!1:e.id===t||Gi(e)===t}function gf(e,t=""){let s=e?.config?.model;return typeof s=="string"&&s.trim()?s.trim():typeof t=="string"&&t.trim()?t.trim():""}function mf(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 ra(e){return mf(e).filter(t=>(ff[t]??-1)>=ff.medium)}function oa(e){let t=mf(e);return t.length?t.length===1?t[0]:t[t.length-2]:""}function hf(e,t=""){let s=e?.config?.modelEffort;return typeof s=="string"&&s.trim()?s.trim():typeof t=="string"&&t.trim()?t.trim():""}function vf(e){let t=[];for(let s of Array.isArray(e)?e:[]){let n=Gi(s);if(!n)continue;let i=s.label||s.id||n,r=ra(s?.effortOptions);t.push({model:s,modelRef:n,label:i,efforts:r,defaultEffort:oa(r)||null})}return t}var ff,yf=H(()=>{ff=Object.freeze({minimal:0,low:1,medium:2,high:3,xhigh:4,max:5})});function bf({hasYeaftAgent:e=!1,sessionsReady:t=!1,sessionsEmpty:s=!1}={}){return t&&!s?!1:e?t?s:!1:!0}var wf=H(()=>{});function kf({activeSessionFilter:e=null,sessionsStore:t=null,topbarGroup:s=null}={}){return e||t?.activeSessionId||s?.id||null}function Sf(e={}){return e.currentAgentInfo?.online?!0:Array.isArray(e.agents)&&e.agents.some(t=>t&&t.online)}var Cf=H(()=>{});function If(e={}){return!e?.warning}var Af=H(()=>{});function Mf(e,t){return e&&t?`${e}:${t}`:""}function Pf(e){if(e!==void 0)return e;try{return globalThis.localStorage}catch{return null}}function Df(e){try{let t=JSON.parse(e?.getItem(aa)||"{}");return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Gh({agentId:e,sessionId:t,validKeys:s=[],storage:n}={}){let i=Mf(e,t);if(!i)return"";let r=Pf(n),o=Df(r),a=typeof o[i]=="string"?o[i]:"";if(!a||s.includes(a))return a;delete o[i];try{r?.setItem(aa,JSON.stringify(o))}catch{}return""}function xf({agentId:e,sessionId:t,senderKey:s,storage:n}={}){let i=Mf(e,t);if(!i)return!1;let r=Pf(n);if(!r)return!1;let o=Df(r);s?o[i]=s:delete o[i];try{return r.setItem(aa,JSON.stringify(o)),!0}catch{return!1}}function Tf(e){let t=e?.updatedAt||e?.endedAt||e?.createdAt,s=t?Date.parse(t):NaN;return Number.isFinite(s)?s:0}function Yh(e){return Object.values(e||{}).filter(Boolean).sort((t,s)=>t.status==="running"&&s.status!=="running"?-1:t.status!=="running"&&s.status==="running"?1:Tf(s)-Tf(t))}var aa,_f,Ef=H(()=>{Ai();xo();Vo();Hp();Bp();sa();Wp();$o();Xp();sf();rf();lf();Yo();Jo();To();pf();yf();is();wf();Cf();Af();Ao();aa="yeaft-history-sender-preferences";_f={name:"YeaftPage",components:{ChatInput:Ds,MessageList:bi,SettingsPanel:_i,YeaftSidebar:Op,SessionInviteModal:Np,SessionCreateModal:ji,SessionSettingsModal:qp,WorkbenchPanel:Di,WorkCenterPage:Wi,YeaftDebugPanel:Qp,VpTimelinePane:tf,YeaftSessionActions:nf,YeaftConversationOutline:af,LlmTab:qi},template:`
7713
7713
  <div class="yeaft-page" ref="pageRef">
7714
7714
  <!-- Mobile sidebar overlay -->
7715
7715
  <div class="yeaft-sidebar-overlay" v-if="store.sessionSidebarOpen && isMobile" @click="store.closeSessionSidebar()"></div>
@@ -8072,11 +8072,11 @@ ${String(e||"").trim()}
8072
8072
  @open-vp-library="openVpLibraryFromGroupSettings"
8073
8073
  />
8074
8074
  </div>
8075
- `,setup(){let e=Pinia.useChatStore(),t=Pinia.useAuthStore(),s=Pinia.useVpStore(),n=Vue.getCurrentInstance(),i=n&&n.appContext.config.globalProperties.$t||(C=>C),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(""),f=Vue.ref(!1),p=Vue.ref(""),g=null,b=Vue.ref("vp"),h=Vue.ref(null),A=Vue.ref(null),w=Vue.ref(null),S=Vue.ref(null),v=Vue.ref(null),m=Vue.ref(null),y=Vue.ref(!1),E=Vue.ref(null),$=Vue.computed(()=>e.getYeaftHistoryOutlineState()),U=Vue.computed(()=>{let C=_(),G=e.yeaftActiveSessionFilter||C?.activeSessionId||null,ce=G?ia(C,G,e.currentAgent||null):null,Re=Array.isArray(ce?.roster)?ce.roster:[];return[{key:"user",label:i("yeaft.outline.you")},...Re.map(Pe=>({key:`vp:${Pe}`,label:s.vpLabel(Pe)}))]}),V=Vue.ref(e.yeaftHistorySearchState?.query||""),L=null,_=()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}},P=()=>{let C=_();return{agentId:e.currentAgent||null,sessionId:e.yeaftActiveSessionFilter||C?.activeSessionId||null}},I=()=>Kh({...P(),validKeys:U.value.map(C=>C.key)}),D=(C="")=>{let{agentId:G,sessionId:ce}=P();e.yeaftHistorySearchState={requestId:null,agentId:G,sessionId:ce,query:"",senderKey:C,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null}},B=Vue.computed(()=>{let C=e.currentAgent||"agent",G=_(),ce=e.yeaftActiveSessionFilter||G?.activeSessionId||"session";return`yeaft:${C}:${ce}`});Vue.watch(B,()=>{w.value=null});let O=null,z=null,te=C=>{if(!C)return!1;let G=String(C.tagName||"").toLowerCase();return G==="textarea"||G==="input"||C.isContentEditable===!0},me=({recoverScroll:C=!1}={})=>{let G=S.value;if(!G)return;if(!Ke.value){G.style.removeProperty("--yeaft-visual-viewport-height");return}let ce=window.visualViewport,Re=Math.max(1,Math.round(ce?.height||window.innerHeight||1));G.style.setProperty("--yeaft-visual-viewport-height",`${Re}px`),!(!C||ce&&window.innerHeight&&ce.height<window.innerHeight*.85||te(document.activeElement))&&window.scrollTo(0,0)},pe=(C={})=>{O!=null&&cancelAnimationFrame(O),O=requestAnimationFrame(()=>{O=null,me(C)})},ve=()=>{pe({recoverScroll:!0}),z&&clearTimeout(z),z=setTimeout(()=>{z=null,pe({recoverScroll:!0})},260)},ie=Vue.computed(()=>e.hasCapability("terminal")||e.hasCapability("file_editor")),ke=Vue.computed(()=>!0),M=C=>{let G=C&&C.id?C.id:null;G&&(e.setActiveSessionFilter(G,{agentId:C.agentId||null}),Ke.value&&e.closeSessionSidebar())},j=C=>{},re=Vue.ref(null),ge=Vue.ref(!1),Ce=320,De=Math.max(Ce,Math.round(window.innerWidth*.25)),ee=localStorage.getItem("yeaft-debug-width"),K=Vue.ref(ee?parseInt(ee,10):De),x=Vue.computed(()=>({"--yeaft-detail-width":K.value+"px"})),T=C=>{ge.value=!0;let G=C.clientX,ce=K.value,Re=window.innerWidth*.6,Pe=Et=>{let Rt=G-Et.clientX,gs=Math.min(Re,Math.max(Ce,ce+Rt));K.value=gs},Ge=()=>{ge.value=!1,document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",Ge),localStorage.setItem("yeaft-debug-width",String(K.value))};document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",Ge)},q="yeaft-session-status-visible",Z=()=>{try{let C=localStorage.getItem(q);return!(C==="0"||C==="false")}catch{return!0}},ae=Vue.ref(Z()),W=C=>{ae.value=!!C;try{localStorage.setItem(q,ae.value?"1":"0")}catch{}},J=()=>W(!ae.value),de=()=>W(!1),oe=220,Me=280,_e=(()=>{try{return localStorage.getItem("yeaft-vp-timeline-width")}catch{return null}})(),Ve=_e?parseInt(_e,10):NaN,qe=Vue.ref(Number.isFinite(Ve)&&Ve>=oe?Ve:Me),xt=Vue.computed(()=>({"--yeaft-vp-timeline-width":qe.value+"px"})),dt=C=>{let G=C.clientX,ce=qe.value,Re=Math.max(oe,Math.floor(window.innerWidth*.4)),Pe=Et=>{let Rt=G-Et.clientX,gs=Math.min(Re,Math.max(oe,ce+Rt));qe.value=gs},Ge=()=>{document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",Ge);try{localStorage.setItem("yeaft-vp-timeline-width",String(qe.value))}catch{}};document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",Ge)},ut="(max-width: 768px)",$s="(max-width: 1024px)",ht=typeof window.matchMedia=="function"?window.matchMedia(ut):null,Fe=typeof window.matchMedia=="function"?window.matchMedia($s):null,We=(C,G)=>C?C.matches:window.innerWidth<=G,Ke=Vue.ref(We(ht,768)),ze=Vue.ref(We(Fe,1024)),Xe=Vue.computed(()=>Ke.value?!e.sessionSidebarOpen:e.sidebarCollapsed),R=()=>{Ke.value=We(ht,768),ze.value=We(Fe,1024)},Y=()=>{R(),ve()},fe=C=>{C&&(typeof C.addEventListener=="function"?C.addEventListener("change",Y):typeof C.addListener=="function"&&C.addListener(Y))},se=C=>{C&&(typeof C.removeEventListener=="function"?C.removeEventListener("change",Y):typeof C.removeListener=="function"&&C.removeListener(Y))},he=()=>{L&&(clearTimeout(L),L=null),V.value="",D(I()),y.value=!1,E.value=null},ye=()=>{let C=I();V.value="",D(C),y.value=!0,e.loadYeaftHistoryOutline(),C&&e.searchYeaftHistory("",{senderKey:C}),Vue.nextTick(()=>m.value?.focus?.())},Oe=()=>{y.value?he():ye()},He=C=>{y.value&&tu(C.target)&&he()},Ue=C=>{V.value=C,L&&clearTimeout(L),E.value=null,L=setTimeout(()=>{L=null,e.searchYeaftHistory(V.value,{senderKey:e.yeaftHistorySearchState.senderKey})},220)},Tt=C=>{L&&clearTimeout(L),L=null,E.value=null,xf({...P(),senderKey:C}),e.searchYeaftHistory(V.value,{senderKey:C})},Mt=()=>{xf({...P(),senderKey:""}),E.value=null,e.searchYeaftHistory(V.value,{senderKey:""})},Qi=C=>{if(!e.loadYeaftHistoryOutline({append:!0}))return;let G=Vue.watch(()=>$.value.loading,ce=>{ce||(G(),m.value?.restoreOlderScroll?.(C))})},Xi=()=>e.searchYeaftHistory(e.yeaftHistorySearchState.query,{append:!0,senderKey:e.yeaftHistorySearchState.senderKey}),kn=C=>{e.hasCapability("session_history_window_prefetch")&&e.loadYeaftHistoryWindow(C)},Zi=C=>su({result:C,revealWindow:G=>e.revealYeaftHistoryResult(G),nextTick:()=>Vue.nextTick(),revealMessage:G=>v.value?.revealMessage?.(G),isMobile:Ke.value,closeOutline:he}),Sn=C=>{if((C.metaKey||C.ctrlKey)&&String(C.key).toLowerCase()==="f"){C.preventDefault(),ye();return}if(C.key==="Escape"){if(y.value){he();return}if(o.value){Bt();return}}};Vue.onMounted(()=>{R(),window.addEventListener("resize",Y),fe(ht),fe(Fe),window.visualViewport?.addEventListener("resize",ve),window.visualViewport?.addEventListener("scroll",ve),document.addEventListener("click",Pt),document.addEventListener("click",He),document.addEventListener("keydown",Sn),pe()}),Vue.onUnmounted(()=>{window.removeEventListener("resize",Y),se(ht),se(Fe),window.visualViewport?.removeEventListener("resize",ve),window.visualViewport?.removeEventListener("scroll",ve),document.removeEventListener("click",Pt),document.removeEventListener("click",He),document.removeEventListener("keydown",Sn),O!=null&&cancelAnimationFrame(O),z&&clearTimeout(z),L&&clearTimeout(L)}),Vue.watch(()=>e.yeaftConversationId,C=>{C&&e.activeConversations[0]!==C&&(e.activeConversations=[C])}),Vue.watch(()=>[e.currentAgent,e.yeaftActiveSessionFilter],()=>{he(),D(I())});let Ji=()=>{e.leaveYeaft()},er=(C,G,ce)=>{let Re=_();if(Re&&Re.activeNeedsInvite){let Rt=Re.activeSession;Rt&&Wt.delete(Rt.id);return}let Pe=e.yeaftActiveSessionFilter||Re&&Re.activeSessionId||"grp_default",Ge=Ci(C).mentions,Et=Array.isArray(G)?G:void 0;e.sendYeaftSessionMessage({groupId:Pe,text:C,mentions:Ge,attachments:Et,quote:ce})},tr=C=>{C&&(w.value=C,A.value?.focusInput?.())},sr=C=>{w.value=null,A.value?.replaceDraft?.(C||"")},Vs=()=>{let C=_(),G=e.yeaftActiveSessionFilter||C?.activeSessionId||null;G&&e.cancelYeaftSession(G)},Cn=(C="")=>{let G=Je.value;G&&e.enterWorkCenterFromSession(G,C)},Fs=()=>{if(Ke.value){e.toggleSessionSidebar();return}e.toggleSidebar()},Ze=()=>{r.value=!r.value},In=()=>{r.value=!1},nr=()=>{e.reloadYeaftMessages()},ir=()=>{window.location.reload()},rr=Vue.computed(()=>{let C=_(),G=e.yeaftActiveSessionFilter||C?.activeSessionId||null;return G?e.isYeaftSessionProcessing(G):!1}),Je=Vue.computed(()=>{let C=_();if(!C||!C.sessions)return null;let G=e.yeaftActiveSessionFilter||null;if(G&&typeof C.sessionById=="function"){let ce=C.sessionById(G,e.currentAgent||null);if(ce)return ce}if(C.activeSessionId&&typeof C.sessionById=="function"){let ce=C.sessionById(C.activeSessionId,e.currentAgent||null);if(ce)return ce}return typeof C.sessionById=="function"?C.sessionById("grp_default",e.currentAgent||null):null}),An=()=>kf({activeSessionFilter:e.yeaftActiveSessionFilter,sessionsStore:_(),topbarGroup:Je.value}),Os=Vue.computed(()=>{let C=Je.value||{},G=typeof C.id=="string"?C.id.trim():"",ce=[C.title,C.name,C.config?.title,C.config?.name];for(let Re of ce){let Pe=typeof Re=="string"?Re.trim():"";if(Pe&&!(G&&Pe===G)&&!/^(sessions?|groups?)\//i.test(Pe)&&!/^session_[A-Za-z0-9_-]+$/.test(Pe)&&!(C.workDir&&Pe===C.workDir))return Pe}return""}),or=Vue.computed(()=>Je.value&&typeof Je.value.announcement=="string"?Je.value.announcement:""),Ht=Vue.computed(()=>gf(Je.value,e.yeaftModel||"")),xn=Vue.computed(()=>{let C=Ht.value;return C&&e.yeaftAvailableModels.find(G=>wn(G,C))||null}),Hs=C=>ra(C?.effortOptions),ar=Vue.computed(()=>hf(Je.value,e.yeaftModelEffort||"")),Nt=Vue.computed(()=>{let C=Array.isArray(xn.value?.effortOptions)?xn.value.effortOptions.filter(Boolean):[];return C.length?C.includes(ar.value)?ar.value:oa(C):null}),ls=Vue.computed(()=>vf(e.yeaftAvailableModels)),lr=(C,G)=>wn(C,Ht.value)?G?G===Nt.value:!Hs(C).length:!1,cr=C=>!C||!wn(C.model,Ht.value)?!1:C.efforts.length?C.efforts.includes(Nt.value):!0,dr=()=>{o.value=!0},Bt=()=>{o.value=!1},Tn=C=>{C.stopPropagation(),e.yeaftAvailableModels.length&&(o.value?Bt():dr())},vt=(C,G=null)=>{if(!C)return;let ce=Je.value?.id||null;e.switchYeaftModel(C,ce,G),Bt()},qt=C=>!C||!Number.isFinite(C)||C<=0?"":C>=1e6?`${Math.round(C/1e5)/10}m`:C>=1e3?`${Math.round(C/1e3)}k`:String(C),rt=C=>{let G=qt(C?.contextWindow),ce=qt(C?.maxOutput);return G&&ce?`${G} \xB7 ${ce} out`:G},Pt=C=>{if(!o.value)return;C.target.closest(".yeaft-topbar-model, .yeaft-topbar-model-dropdown")||Bt()},ur=()=>{a.value||(b.value="vp",h.value=null),a.value=!a.value},Ns=({initialTab:C="vp",editVpId:G=null}={})=>{b.value=["vp","search","mcp"].includes(C)?C:"vp",h.value=b.value==="vp"&&G||null,a.value=!0},cs=()=>{o.value=!1,l.value=!0},ds=C=>{Qe(C)&&(l.value=!1)},Mn=async()=>{if(!(u.value||f.value)){f.value=!0,p.value="";try{let C={"Content-Type":"application/json"};t.token&&(C.Authorization=`Bearer ${t.token}`);let G=await fetch("/api/user/agent-secret",{headers:C});if(!G.ok){let Pe=i("yeaft.onboarding.secretError");try{let Ge=await G.json();Ge?.error&&(Pe=Ge.error)}catch{}throw new Error(Pe)}let ce=await G.json(),Re=ce?.agentSecret||ce?.agent_secret||"";if(u.value=String(Re||"").trim(),!u.value)throw new Error(i("yeaft.onboarding.secretError"))}catch(C){p.value=C?.message||i("yeaft.onboarding.secretError")}finally{f.value=!1}}},us=()=>{c.value=!0},Pn=C=>{c.value=!1},Dn=async(C,G)=>{if(G&&!(typeof navigator>"u"||!navigator.clipboard?.writeText))try{let ce=typeof G=="string"?G:G?.value||"";if(!ce)return;await navigator.clipboard.writeText(ce),d.value=C||"",g&&clearTimeout(g),g=setTimeout(()=>{d.value="",g=null},1800)}catch{}},Bs=(C,G)=>{},ps=(C={})=>{If(C)&&(l.value=!1)},Wt=Vue.reactive(new Set),Dt=Vue.computed(()=>{let C=_();return C?C.activeSession:null}),_n=C=>{if(!C)return"";if(C.id==="grp_default"&&(C.name==="Default"||!C.name))try{let G=typeof window<"u"?window.i18n:null;if(G&&G.global&&typeof G.global.t=="function")return G.global.t("yeaft.session.defaultName")}catch{}return C.name||C.id||""},pr=Vue.computed(()=>_n(Dt.value)),qs=Vue.computed(()=>{let C=_();if(!C||!C.activeNeedsInvite)return!1;let G=C.activeSession;return G?!Wt.has(G.id):!1}),En=Vue.computed(()=>{let C=_();return!!(C&&C.activeNeedsInvite)}),Rn=Vue.computed(()=>{let C=_();return bf({hasYeaftAgent:Sf(e),sessionsReady:!!(C&&C.hasLoadedSnapshot),sessionsEmpty:!!(C&&C.isEmpty)})});Vue.watch(Rn,C=>{C&&Mn()},{immediate:!0});let k="npm install -g @yeaft/webchat-agent",F=Vue.computed(()=>{let G=(typeof window<"u"&&window.location?.origin?window.location.origin:"http://localhost:3456").replace(/^http:/,"ws:").replace(/^https:/,"wss:"),ce=u.value||i("yeaft.onboarding.secretPending");return`yeaft-agent install --server ${G} --name yeaft-agent --secret ${ce}`}),N="gh auth login && yeaft-agent llm use github-copilot --model gpt-5.5",ue=()=>{let C=Dt.value;C&&Wt.add(C.id),la(C?C.id:null)},we=()=>{let C=Dt.value;C&&Wt.add(C.id)},ne=Vue.ref(!1),Ee=Vue.ref(null),Ne=Vue.ref(null),be=Vue.ref("session"),le=Vue.ref(""),_t=(C={})=>{let G=C&&(C.sessionId||C.groupId)||null,ce=C&&C.editVpId||"",Re=ce?"members":C&&C.section||"session";G&&(Ee.value=G,Ne.value=C&&C.agentId||null,be.value=Re,le.value=ce,ne.value=!0)},fr=()=>{let C=An();C&&_t({sessionId:C,section:"session"})},fs=()=>{ne.value=!1,Ee.value=null,Ne.value=null,le.value=""},Rf=()=>{fs(),Ns({initialTab:"vp"})},la=C=>{C&&_t({sessionId:C,section:"members"})};Vue.watch(()=>{let C=Dt.value;return C?C.id+":"+(Array.isArray(C.roster)?C.roster.length:0)+":"+(C.defaultVpId||""):""},(C,G)=>{let ce=Dt.value;ce&&C!==G&&Array.isArray(ce.roster)&&ce.roster.length>0&&Wt.delete(ce.id)}),typeof Vue.onBeforeUnmount=="function"&&Vue.onBeforeUnmount(()=>{g&&clearTimeout(g),g=null});let Lf=()=>{a.value=!1},$f=Vue.computed(()=>!a.value&&!Rn.value&&ae.value),Vf=Vue.computed(()=>{let C=_(),G=e.yeaftActiveSessionFilter||C?.activeSessionId||null;if(!G)return[];let ce=e.yeaftActiveTasksBySession?.[G]||{};return Gh(ce)}),Ff=Vue.computed(()=>{if(!e.yeaftConversationId)return[];let G=_(),ce=e.yeaftActiveSessionFilter||G?.activeSessionId||null;if(!ce)return[];let Re=ia(G,ce,e.currentAgent||null),Pe=Re&&Array.isArray(Re.roster)?Re.roster:[];if(Pe.length===0)return[];let Ge=new Set(Pe),Et=df(Pe,s.vpList||[]),Rt=e.vpStatuses||{},gs={};for(let ot of Object.values(Rt)){if(!ot||!ot.vpId)continue;let ca=ot.sessionId??ot.groupId;ca&&ca!==ce||Ge.has(ot.vpId)&&(gs[ot.vpId]=ot)}return uf({vpList:Et,vpStatuses:gs,stoppingVpTurnIds:e.stoppingVpTurnIds||{},connectionState:e.connectionState,vpLabelOf:ot=>s.vpLabel(ot),vpDescriptionOf:ot=>s.vpDescription(ot)})});return{store:e,pageRef:S,effectiveSidebarCollapsed:Xe,debugMode:r,modelDropdownOpen:o,topbarGroup:Je,topbarSessionTitle:Os,topbarModel:Ht,topbarEffort:Nt,topbarModelRows:ls,selectableEffortsForModel:Hs,isModelSelectionActive:lr,isModelRowActive:cr,modelOptionRef:Gi,modelOptionMatchesRef:wn,showSettings:a,showLlmConfig:l,sessionCreateOpen:c,settingsInitialTab:b,settingsInitialEditVpId:h,chatInputRef:A,messageQuote:w,messageListRef:v,historySearchRef:m,historySearchOpen:y,historySearchActiveMessageId:E,historyOutlineState:$,historySenderOptions:U,toggleHistorySearch:Oe,closeHistorySearch:he,onHistorySearchQuery:Ue,onHistorySenderChange:Tt,onHistorySenderInvalid:Mt,loadOlderHistoryOutline:Qi,loadMoreHistorySearchResults:Xi,previewHistorySearchResult:kn,selectHistorySearchResult:Zi,yeaftInputDraftKey:B,openSettings:Ns,isMobile:Ke,isNarrowDetail:ze,detailPanel:re,isResizingDetail:ge,detailWidthStyle:x,startDetailResize:T,isProcessing:rr,goBack:Ji,sendMessage:er,setMessageQuote:tr,editMessageAsNew:sr,cancelYeaft:Vs,openWorkItemDraft:Cn,toggleSidebar:Fs,toggleDebug:Ze,closeDebug:In,reloadMessages:nr,reloadPage:ir,toggleModelDropdown:Tn,selectModel:vt,openLlmConfig:cs,trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,closeLlmConfigFromOverlay:ds,openSessionCreate:us,onSessionCreated:Pn,copyOnboardingCommand:Dn,copiedOnboardingCommand:d,onLlmConfigMessage:Bs,onLlmConfigSaved:ps,formatTokens:qt,formatModelCtx:rt,toggleSettings:ur,onSettingsSaved:Lf,sidebarV2Enabled:ke,onSelectGroupV2:M,onSelectChat:j,canUseWorkbench:ie,shouldShowInviteModal:qs,inviteGroupName:pr,onInviteOpenLibrary:ue,onInviteDismiss:we,isActiveGroupEmpty:En,showOnboardingGuide:Rn,installAgentCommand:k,connectAgentCommand:F,copilotCommand:N,agentSecret:u,agentSecretLoading:f,agentSecretError:p,groupSettingsOpen:ne,groupSettingsId:Ee,groupSettingsAgentId:Ne,groupSettingsSection:be,groupSettingsEditVpId:le,openSessionSettings:_t,openAnnouncementSettings:fr,closeGroupSettings:fs,openVpLibraryFromGroupSettings:Rf,openMemberEditor:la,showVpTimeline:$f,vpTimelineRows:Ff,sessionStatusTasksForActiveSession:Vf,sessionStatusAnnouncementText:or,sessionStatusVisible:ae,toggleSessionStatus:J,closeSessionStatus:de,timelineWidthStyle:xt,startTimelineResize:dt,onEditVpFromTimeline:C=>{if(!C)return;let G=An();G&&_t({sessionId:G,section:"members",editVpId:C})},onMentionVpFromTimeline:C=>{if(!C)return;let G=A.value;G&&typeof G.appendMention=="function"&&G.appendMention(C)},onCancelVpFromTimeline:C=>{if(!C)return;let G=_(),ce=e.yeaftActiveSessionFilter||G?.activeSessionId||null;ce&&typeof e.cancelVpTurnForSession=="function"&&e.cancelVpTurnForSession(C,ce)},onCancelTaskFromTimeline:C=>!C?.id||!C.sessionId||typeof e.cancelYeaftTask!="function"?!1:e.cancelYeaftTask({sessionId:C.sessionId,taskId:C.id})}}}});var Xh=Of(()=>{Jn();lt();Is();Qc();bt();td();nd();rd();ad();_p();Ef();Ho();wo();window.Pinia={...Pinia,useChatStore:null,useAuthStore:null};var Yh={components:{LoginPage:od,ChatPage:Dp,YeaftPage:_f},template:`
8075
+ `,setup(){let e=Pinia.useChatStore(),t=Pinia.useAuthStore(),s=Pinia.useVpStore(),n=Vue.getCurrentInstance(),i=n&&n.appContext.config.globalProperties.$t||(C=>C),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(""),f=Vue.ref(!1),p=Vue.ref(""),g=null,b=Vue.ref("vp"),h=Vue.ref(null),A=Vue.ref(null),w=Vue.ref(null),S=Vue.ref(null),v=Vue.ref(null),m=Vue.ref(null),y=Vue.ref(!1),E=Vue.ref(null),$=Vue.computed(()=>e.getYeaftHistoryOutlineState()),U=Vue.computed(()=>{let C=_(),G=e.yeaftActiveSessionFilter||C?.activeSessionId||null,ce=G?ia(C,G,e.currentAgent||null):null,Re=Array.isArray(ce?.roster)?ce.roster:[];return[{key:"user",label:i("yeaft.outline.you")},...Re.map(Pe=>({key:`vp:${Pe}`,label:s.vpLabel(Pe)}))]}),V=Vue.ref(e.yeaftHistorySearchState?.query||""),L=null,_=()=>{try{return window.Pinia?.useSessionsStore?.()||null}catch{return null}},P=()=>{let C=_();return{agentId:e.currentAgent||null,sessionId:e.yeaftActiveSessionFilter||C?.activeSessionId||null}},I=()=>Gh({...P(),validKeys:U.value.map(C=>C.key)}),D=(C="")=>{let{agentId:G,sessionId:ce}=P();e.yeaftHistorySearchState={requestId:null,agentId:G,sessionId:ce,query:"",senderKey:C,loading:!1,results:[],hasMore:!1,nextBeforeSeq:null,error:null}},B=Vue.computed(()=>{let C=e.currentAgent||"agent",G=_(),ce=e.yeaftActiveSessionFilter||G?.activeSessionId||"session";return`yeaft:${C}:${ce}`});Vue.watch(B,()=>{w.value=null});let O=null,z=null,te=C=>{if(!C)return!1;let G=String(C.tagName||"").toLowerCase();return G==="textarea"||G==="input"||C.isContentEditable===!0},me=({recoverScroll:C=!1}={})=>{let G=S.value;if(!G)return;if(!Ke.value){G.style.removeProperty("--yeaft-visual-viewport-height");return}let ce=window.visualViewport,Re=Math.max(1,Math.round(ce?.height||window.innerHeight||1));G.style.setProperty("--yeaft-visual-viewport-height",`${Re}px`),!(!C||ce&&window.innerHeight&&ce.height<window.innerHeight*.85||te(document.activeElement))&&window.scrollTo(0,0)},pe=(C={})=>{O!=null&&cancelAnimationFrame(O),O=requestAnimationFrame(()=>{O=null,me(C)})},ve=()=>{pe({recoverScroll:!0}),z&&clearTimeout(z),z=setTimeout(()=>{z=null,pe({recoverScroll:!0})},260)},ie=Vue.computed(()=>e.hasCapability("terminal")||e.hasCapability("file_editor")),ke=Vue.computed(()=>!0),M=C=>{let G=C&&C.id?C.id:null;G&&(e.setActiveSessionFilter(G,{agentId:C.agentId||null}),Ke.value&&e.closeSessionSidebar())},j=C=>{},re=Vue.ref(null),ge=Vue.ref(!1),Ce=320,De=Math.max(Ce,Math.round(window.innerWidth*.25)),ee=localStorage.getItem("yeaft-debug-width"),K=Vue.ref(ee?parseInt(ee,10):De),x=Vue.computed(()=>({"--yeaft-detail-width":K.value+"px"})),T=C=>{ge.value=!0;let G=C.clientX,ce=K.value,Re=window.innerWidth*.6,Pe=Et=>{let Rt=G-Et.clientX,gs=Math.min(Re,Math.max(Ce,ce+Rt));K.value=gs},Ge=()=>{ge.value=!1,document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",Ge),localStorage.setItem("yeaft-debug-width",String(K.value))};document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",Ge)},q="yeaft-session-status-visible",Z=()=>{try{let C=localStorage.getItem(q);return!(C==="0"||C==="false")}catch{return!0}},ae=Vue.ref(Z()),W=C=>{ae.value=!!C;try{localStorage.setItem(q,ae.value?"1":"0")}catch{}},J=()=>W(!ae.value),de=()=>W(!1),oe=220,Me=280,_e=(()=>{try{return localStorage.getItem("yeaft-vp-timeline-width")}catch{return null}})(),Ve=_e?parseInt(_e,10):NaN,qe=Vue.ref(Number.isFinite(Ve)&&Ve>=oe?Ve:Me),xt=Vue.computed(()=>({"--yeaft-vp-timeline-width":qe.value+"px"})),dt=C=>{let G=C.clientX,ce=qe.value,Re=Math.max(oe,Math.floor(window.innerWidth*.4)),Pe=Et=>{let Rt=G-Et.clientX,gs=Math.min(Re,Math.max(oe,ce+Rt));qe.value=gs},Ge=()=>{document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",Ge);try{localStorage.setItem("yeaft-vp-timeline-width",String(qe.value))}catch{}};document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",Ge)},ut="(max-width: 768px)",$s="(max-width: 1024px)",ht=typeof window.matchMedia=="function"?window.matchMedia(ut):null,Fe=typeof window.matchMedia=="function"?window.matchMedia($s):null,We=(C,G)=>C?C.matches:window.innerWidth<=G,Ke=Vue.ref(We(ht,768)),ze=Vue.ref(We(Fe,1024)),Xe=Vue.computed(()=>Ke.value?!e.sessionSidebarOpen:e.sidebarCollapsed),R=()=>{Ke.value=We(ht,768),ze.value=We(Fe,1024)},Y=()=>{R(),ve()},fe=C=>{C&&(typeof C.addEventListener=="function"?C.addEventListener("change",Y):typeof C.addListener=="function"&&C.addListener(Y))},se=C=>{C&&(typeof C.removeEventListener=="function"?C.removeEventListener("change",Y):typeof C.removeListener=="function"&&C.removeListener(Y))},he=()=>{L&&(clearTimeout(L),L=null),V.value="",D(I()),y.value=!1,E.value=null},ye=()=>{let C=I();V.value="",D(C),y.value=!0,e.loadYeaftHistoryOutline(),C&&e.searchYeaftHistory("",{senderKey:C}),Vue.nextTick(()=>m.value?.focus?.())},Oe=()=>{y.value?he():ye()},He=C=>{y.value&&tu(C.target)&&he()},Ue=C=>{V.value=C,L&&clearTimeout(L),E.value=null,L=setTimeout(()=>{L=null,e.searchYeaftHistory(V.value,{senderKey:e.yeaftHistorySearchState.senderKey})},220)},Tt=C=>{L&&clearTimeout(L),L=null,E.value=null,xf({...P(),senderKey:C}),e.searchYeaftHistory(V.value,{senderKey:C})},Mt=()=>{xf({...P(),senderKey:""}),E.value=null,e.searchYeaftHistory(V.value,{senderKey:""})},Qi=C=>{if(!e.loadYeaftHistoryOutline({append:!0}))return;let G=Vue.watch(()=>$.value.loading,ce=>{ce||(G(),m.value?.restoreOlderScroll?.(C))})},Xi=()=>e.searchYeaftHistory(e.yeaftHistorySearchState.query,{append:!0,senderKey:e.yeaftHistorySearchState.senderKey}),kn=C=>{e.hasCapability("session_history_window_prefetch")&&e.loadYeaftHistoryWindow(C)},Zi=C=>su({result:C,revealWindow:G=>e.revealYeaftHistoryResult(G),nextTick:()=>Vue.nextTick(),revealMessage:G=>v.value?.revealMessage?.(G),isMobile:Ke.value,closeOutline:he}),Sn=C=>{if((C.metaKey||C.ctrlKey)&&String(C.key).toLowerCase()==="f"){C.preventDefault(),ye();return}if(C.key==="Escape"){if(y.value){he();return}if(o.value){Bt();return}}};Vue.onMounted(()=>{R(),window.addEventListener("resize",Y),fe(ht),fe(Fe),window.visualViewport?.addEventListener("resize",ve),window.visualViewport?.addEventListener("scroll",ve),document.addEventListener("click",Pt),document.addEventListener("click",He),document.addEventListener("keydown",Sn),pe()}),Vue.onUnmounted(()=>{window.removeEventListener("resize",Y),se(ht),se(Fe),window.visualViewport?.removeEventListener("resize",ve),window.visualViewport?.removeEventListener("scroll",ve),document.removeEventListener("click",Pt),document.removeEventListener("click",He),document.removeEventListener("keydown",Sn),O!=null&&cancelAnimationFrame(O),z&&clearTimeout(z),L&&clearTimeout(L)}),Vue.watch(()=>e.yeaftConversationId,C=>{C&&e.activeConversations[0]!==C&&(e.activeConversations=[C])}),Vue.watch(()=>[e.currentAgent,e.yeaftActiveSessionFilter],()=>{he(),D(I())});let Ji=()=>{e.leaveYeaft()},er=(C,G,ce)=>{let Re=_();if(Re&&Re.activeNeedsInvite){let Rt=Re.activeSession;Rt&&Wt.delete(Rt.id);return}let Pe=e.yeaftActiveSessionFilter||Re&&Re.activeSessionId||"grp_default",Ge=Ci(C).mentions,Et=Array.isArray(G)?G:void 0;e.sendYeaftSessionMessage({groupId:Pe,text:C,mentions:Ge,attachments:Et,quote:ce})},tr=C=>{C&&(w.value=C,A.value?.focusInput?.())},sr=C=>{w.value=null,A.value?.replaceDraft?.(C||"")},Vs=()=>{let C=_(),G=e.yeaftActiveSessionFilter||C?.activeSessionId||null;G&&e.cancelYeaftSession(G)},Cn=(C="")=>{let G=Je.value;G&&e.enterWorkCenterFromSession(G,C)},Fs=()=>{if(Ke.value){e.toggleSessionSidebar();return}e.toggleSidebar()},Ze=()=>{r.value=!r.value},In=()=>{r.value=!1},nr=()=>{e.reloadYeaftMessages()},ir=()=>{window.location.reload()},rr=Vue.computed(()=>{let C=_(),G=e.yeaftActiveSessionFilter||C?.activeSessionId||null;return G?e.isYeaftSessionProcessing(G):!1}),Je=Vue.computed(()=>{let C=_();if(!C||!C.sessions)return null;let G=e.yeaftActiveSessionFilter||null;if(G&&typeof C.sessionById=="function"){let ce=C.sessionById(G,e.currentAgent||null);if(ce)return ce}if(C.activeSessionId&&typeof C.sessionById=="function"){let ce=C.sessionById(C.activeSessionId,e.currentAgent||null);if(ce)return ce}return typeof C.sessionById=="function"?C.sessionById("grp_default",e.currentAgent||null):null}),An=()=>kf({activeSessionFilter:e.yeaftActiveSessionFilter,sessionsStore:_(),topbarGroup:Je.value}),Os=Vue.computed(()=>{let C=Je.value||{},G=typeof C.id=="string"?C.id.trim():"",ce=[C.title,C.name,C.config?.title,C.config?.name];for(let Re of ce){let Pe=typeof Re=="string"?Re.trim():"";if(Pe&&!(G&&Pe===G)&&!/^(sessions?|groups?)\//i.test(Pe)&&!/^session_[A-Za-z0-9_-]+$/.test(Pe)&&!(C.workDir&&Pe===C.workDir))return Pe}return""}),or=Vue.computed(()=>Je.value&&typeof Je.value.announcement=="string"?Je.value.announcement:""),Ht=Vue.computed(()=>gf(Je.value,e.yeaftModel||"")),xn=Vue.computed(()=>{let C=Ht.value;return C&&e.yeaftAvailableModels.find(G=>wn(G,C))||null}),Hs=C=>ra(C?.effortOptions),ar=Vue.computed(()=>hf(Je.value,e.yeaftModelEffort||"")),Nt=Vue.computed(()=>{let C=Array.isArray(xn.value?.effortOptions)?xn.value.effortOptions.filter(Boolean):[];return C.length?C.includes(ar.value)?ar.value:oa(C):null}),ls=Vue.computed(()=>vf(e.yeaftAvailableModels)),lr=(C,G)=>wn(C,Ht.value)?G?G===Nt.value:!Hs(C).length:!1,cr=C=>!C||!wn(C.model,Ht.value)?!1:C.efforts.length?C.efforts.includes(Nt.value):!0,dr=()=>{o.value=!0},Bt=()=>{o.value=!1},Tn=C=>{C.stopPropagation(),e.yeaftAvailableModels.length&&(o.value?Bt():dr())},vt=(C,G=null)=>{if(!C)return;let ce=Je.value?.id||null;e.switchYeaftModel(C,ce,G),Bt()},qt=C=>!C||!Number.isFinite(C)||C<=0?"":C>=1e6?`${Math.round(C/1e5)/10}m`:C>=1e3?`${Math.round(C/1e3)}k`:String(C),rt=C=>{let G=qt(C?.contextWindow),ce=qt(C?.maxOutput);return G&&ce?`${G} \xB7 ${ce} out`:G},Pt=C=>{if(!o.value)return;C.target.closest(".yeaft-topbar-model, .yeaft-topbar-model-dropdown")||Bt()},ur=()=>{a.value||(b.value="vp",h.value=null),a.value=!a.value},Ns=({initialTab:C="vp",editVpId:G=null}={})=>{b.value=["vp","search","mcp"].includes(C)?C:"vp",h.value=b.value==="vp"&&G||null,a.value=!0},cs=()=>{o.value=!1,l.value=!0},ds=C=>{Qe(C)&&(l.value=!1)},Mn=async()=>{if(!(u.value||f.value)){f.value=!0,p.value="";try{let C={"Content-Type":"application/json"};t.token&&(C.Authorization=`Bearer ${t.token}`);let G=await fetch("/api/user/agent-secret",{headers:C});if(!G.ok){let Pe=i("yeaft.onboarding.secretError");try{let Ge=await G.json();Ge?.error&&(Pe=Ge.error)}catch{}throw new Error(Pe)}let ce=await G.json(),Re=ce?.agentSecret||ce?.agent_secret||"";if(u.value=String(Re||"").trim(),!u.value)throw new Error(i("yeaft.onboarding.secretError"))}catch(C){p.value=C?.message||i("yeaft.onboarding.secretError")}finally{f.value=!1}}},us=()=>{c.value=!0},Pn=C=>{c.value=!1},Dn=async(C,G)=>{if(G&&!(typeof navigator>"u"||!navigator.clipboard?.writeText))try{let ce=typeof G=="string"?G:G?.value||"";if(!ce)return;await navigator.clipboard.writeText(ce),d.value=C||"",g&&clearTimeout(g),g=setTimeout(()=>{d.value="",g=null},1800)}catch{}},Bs=(C,G)=>{},ps=(C={})=>{If(C)&&(l.value=!1)},Wt=Vue.reactive(new Set),Dt=Vue.computed(()=>{let C=_();return C?C.activeSession:null}),_n=C=>{if(!C)return"";if(C.id==="grp_default"&&(C.name==="Default"||!C.name))try{let G=typeof window<"u"?window.i18n:null;if(G&&G.global&&typeof G.global.t=="function")return G.global.t("yeaft.session.defaultName")}catch{}return C.name||C.id||""},pr=Vue.computed(()=>_n(Dt.value)),qs=Vue.computed(()=>{let C=_();if(!C||!C.activeNeedsInvite)return!1;let G=C.activeSession;return G?!Wt.has(G.id):!1}),En=Vue.computed(()=>{let C=_();return!!(C&&C.activeNeedsInvite)}),Rn=Vue.computed(()=>{let C=_();return bf({hasYeaftAgent:Sf(e),sessionsReady:!!(C&&C.hasLoadedSnapshot),sessionsEmpty:!!(C&&C.isEmpty)})});Vue.watch(Rn,C=>{C&&Mn()},{immediate:!0});let k="npm install -g @yeaft/webchat-agent",F=Vue.computed(()=>{let G=(typeof window<"u"&&window.location?.origin?window.location.origin:"http://localhost:3456").replace(/^http:/,"ws:").replace(/^https:/,"wss:"),ce=u.value||i("yeaft.onboarding.secretPending");return`yeaft-agent install --server ${G} --name yeaft-agent --secret ${ce}`}),N="gh auth login && yeaft-agent llm use github-copilot --model gpt-5.5",ue=()=>{let C=Dt.value;C&&Wt.add(C.id),la(C?C.id:null)},we=()=>{let C=Dt.value;C&&Wt.add(C.id)},ne=Vue.ref(!1),Ee=Vue.ref(null),Ne=Vue.ref(null),be=Vue.ref("session"),le=Vue.ref(""),_t=(C={})=>{let G=C&&(C.sessionId||C.groupId)||null,ce=C&&C.editVpId||"",Re=ce?"members":C&&C.section||"session";G&&(Ee.value=G,Ne.value=C&&C.agentId||null,be.value=Re,le.value=ce,ne.value=!0)},fr=()=>{let C=An();C&&_t({sessionId:C,section:"session"})},fs=()=>{ne.value=!1,Ee.value=null,Ne.value=null,le.value=""},Rf=()=>{fs(),Ns({initialTab:"vp"})},la=C=>{C&&_t({sessionId:C,section:"members"})};Vue.watch(()=>{let C=Dt.value;return C?C.id+":"+(Array.isArray(C.roster)?C.roster.length:0)+":"+(C.defaultVpId||""):""},(C,G)=>{let ce=Dt.value;ce&&C!==G&&Array.isArray(ce.roster)&&ce.roster.length>0&&Wt.delete(ce.id)}),typeof Vue.onBeforeUnmount=="function"&&Vue.onBeforeUnmount(()=>{g&&clearTimeout(g),g=null});let Lf=()=>{a.value=!1},$f=Vue.computed(()=>!a.value&&!Rn.value&&ae.value),Vf=Vue.computed(()=>{let C=_(),G=e.yeaftActiveSessionFilter||C?.activeSessionId||null;if(!G)return[];let ce=e.yeaftActiveTasksBySession?.[G]||{};return Yh(ce)}),Ff=Vue.computed(()=>{if(!e.yeaftConversationId)return[];let G=_(),ce=e.yeaftActiveSessionFilter||G?.activeSessionId||null;if(!ce)return[];let Re=ia(G,ce,e.currentAgent||null),Pe=Re&&Array.isArray(Re.roster)?Re.roster:[];if(Pe.length===0)return[];let Ge=new Set(Pe),Et=df(Pe,s.vpList||[]),Rt=e.vpStatuses||{},gs={};for(let ot of Object.values(Rt)){if(!ot||!ot.vpId)continue;let ca=ot.sessionId??ot.groupId;ca&&ca!==ce||Ge.has(ot.vpId)&&(gs[ot.vpId]=ot)}return uf({vpList:Et,vpStatuses:gs,stoppingVpTurnIds:e.stoppingVpTurnIds||{},connectionState:e.connectionState,vpLabelOf:ot=>s.vpLabel(ot),vpDescriptionOf:ot=>s.vpDescription(ot)})});return{store:e,pageRef:S,effectiveSidebarCollapsed:Xe,debugMode:r,modelDropdownOpen:o,topbarGroup:Je,topbarSessionTitle:Os,topbarModel:Ht,topbarEffort:Nt,topbarModelRows:ls,selectableEffortsForModel:Hs,isModelSelectionActive:lr,isModelRowActive:cr,modelOptionRef:Gi,modelOptionMatchesRef:wn,showSettings:a,showLlmConfig:l,sessionCreateOpen:c,settingsInitialTab:b,settingsInitialEditVpId:h,chatInputRef:A,messageQuote:w,messageListRef:v,historySearchRef:m,historySearchOpen:y,historySearchActiveMessageId:E,historyOutlineState:$,historySenderOptions:U,toggleHistorySearch:Oe,closeHistorySearch:he,onHistorySearchQuery:Ue,onHistorySenderChange:Tt,onHistorySenderInvalid:Mt,loadOlderHistoryOutline:Qi,loadMoreHistorySearchResults:Xi,previewHistorySearchResult:kn,selectHistorySearchResult:Zi,yeaftInputDraftKey:B,openSettings:Ns,isMobile:Ke,isNarrowDetail:ze,detailPanel:re,isResizingDetail:ge,detailWidthStyle:x,startDetailResize:T,isProcessing:rr,goBack:Ji,sendMessage:er,setMessageQuote:tr,editMessageAsNew:sr,cancelYeaft:Vs,openWorkItemDraft:Cn,toggleSidebar:Fs,toggleDebug:Ze,closeDebug:In,reloadMessages:nr,reloadPage:ir,toggleModelDropdown:Tn,selectModel:vt,openLlmConfig:cs,trackOverlayPointerDown:st,trackOverlayPointerUp:nt,clearOverlayPointerGesture:it,closeLlmConfigFromOverlay:ds,openSessionCreate:us,onSessionCreated:Pn,copyOnboardingCommand:Dn,copiedOnboardingCommand:d,onLlmConfigMessage:Bs,onLlmConfigSaved:ps,formatTokens:qt,formatModelCtx:rt,toggleSettings:ur,onSettingsSaved:Lf,sidebarV2Enabled:ke,onSelectGroupV2:M,onSelectChat:j,canUseWorkbench:ie,shouldShowInviteModal:qs,inviteGroupName:pr,onInviteOpenLibrary:ue,onInviteDismiss:we,isActiveGroupEmpty:En,showOnboardingGuide:Rn,installAgentCommand:k,connectAgentCommand:F,copilotCommand:N,agentSecret:u,agentSecretLoading:f,agentSecretError:p,groupSettingsOpen:ne,groupSettingsId:Ee,groupSettingsAgentId:Ne,groupSettingsSection:be,groupSettingsEditVpId:le,openSessionSettings:_t,openAnnouncementSettings:fr,closeGroupSettings:fs,openVpLibraryFromGroupSettings:Rf,openMemberEditor:la,showVpTimeline:$f,vpTimelineRows:Ff,sessionStatusTasksForActiveSession:Vf,sessionStatusAnnouncementText:or,sessionStatusVisible:ae,toggleSessionStatus:J,closeSessionStatus:de,timelineWidthStyle:xt,startTimelineResize:dt,onEditVpFromTimeline:C=>{if(!C)return;let G=An();G&&_t({sessionId:G,section:"members",editVpId:C})},onMentionVpFromTimeline:C=>{if(!C)return;let G=A.value;G&&typeof G.appendMention=="function"&&G.appendMention(C)},onCancelVpFromTimeline:C=>{if(!C)return;let G=_(),ce=e.yeaftActiveSessionFilter||G?.activeSessionId||null;ce&&typeof e.cancelVpTurnForSession=="function"&&e.cancelVpTurnForSession(C,ce)},onCancelTaskFromTimeline:C=>!C?.id||!C.sessionId||typeof e.cancelYeaftTask!="function"?!1:e.cancelYeaftTask({sessionId:C.sessionId,taskId:C.id})}}}});var Zh=Of(()=>{Jn();lt();Is();Qc();bt();td();nd();rd();ad();_p();Ef();Ho();wo();window.Pinia={...Pinia,useChatStore:null,useAuthStore:null};var Qh={components:{LoginPage:od,ChatPage:Dp,YeaftPage:_f},template:`
8076
8076
  <div v-if="!authStore.initialized" class="auth-bootstrap" aria-busy="true"><span class="session-loading-spinner"></span></div>
8077
8077
  <LoginPage v-else-if="!authStore.isAuthenticated" />
8078
8078
  <template v-else>
8079
8079
  <YeaftPage v-if="chatStore.currentView === 'yeaft'" />
8080
8080
  <ChatPage v-else />
8081
8081
  </template>
8082
- `,setup(){let e=Jt(),t=xe();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}}},Yi=Vue.createApp(Yh),Qh=Pinia.createPinia();Yi.use(Qh);fa(Yi,{"zh-CN":sd,en:id});ed();window.Pinia.useChatStore=Jt;window.Pinia.useAuthStore=xe;window.Pinia.useVpStore=gt;window.Pinia.useSessionsStore=Yc;Yi.component("ToolLine",fi);Yi.mount("#app")});export default Xh();
8082
+ `,setup(){let e=Jt(),t=xe();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}}},Yi=Vue.createApp(Qh),Xh=Pinia.createPinia();Yi.use(Xh);fa(Yi,{"zh-CN":sd,en:id});ed();window.Pinia.useChatStore=Jt;window.Pinia.useAuthStore=xe;window.Pinia.useVpStore=gt;window.Pinia.useSessionsStore=Yc;Yi.component("ToolLine",fi);Yi.mount("#app")});export default Zh();