pikiloop 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +353 -0
  3. package/README.v2.md +287 -0
  4. package/README.zh-CN.md +352 -0
  5. package/dashboard/dist/assets/AgentTab-UZPIhlkr.js +1 -0
  6. package/dashboard/dist/assets/DirBrowser-Ckcmi-Pi.js +1 -0
  7. package/dashboard/dist/assets/ExtensionsTab-KZhEDrdu.js +1 -0
  8. package/dashboard/dist/assets/IMAccessTab-Bd_IY1GQ.js +1 -0
  9. package/dashboard/dist/assets/Modal-CTeL0y7P.js +1 -0
  10. package/dashboard/dist/assets/Modals-axftHasy.js +1 -0
  11. package/dashboard/dist/assets/Select-C8tOdPhe.js +1 -0
  12. package/dashboard/dist/assets/SessionPanel-C1geSRxw.js +1 -0
  13. package/dashboard/dist/assets/SystemTab-DBDkaPiO.js +1 -0
  14. package/dashboard/dist/assets/anthropic-BAdojD7P.ico +0 -0
  15. package/dashboard/dist/assets/codex-DYadqqp0.png +0 -0
  16. package/dashboard/dist/assets/deepseek-BeYNZEk0.ico +0 -0
  17. package/dashboard/dist/assets/doubao-DloFDuFR.png +0 -0
  18. package/dashboard/dist/assets/feishu-C4OMrjCW.ico +0 -0
  19. package/dashboard/dist/assets/gemini-BYkEpiWr.svg +1 -0
  20. package/dashboard/dist/assets/hermes-BAarh-tH.png +0 -0
  21. package/dashboard/dist/assets/index-CpM4CqZJ.js +23 -0
  22. package/dashboard/dist/assets/index-DXSohzrE.js +3 -0
  23. package/dashboard/dist/assets/index-reSbuley.css +1 -0
  24. package/dashboard/dist/assets/markdown-DxQYQFeH.js +29 -0
  25. package/dashboard/dist/assets/minimax-PuEGTfrF.ico +0 -0
  26. package/dashboard/dist/assets/mlx-DhWwjtMw.png +0 -0
  27. package/dashboard/dist/assets/ollama-Bt9O-2K_.png +0 -0
  28. package/dashboard/dist/assets/openrouter-CsJ_bD5Q.ico +0 -0
  29. package/dashboard/dist/assets/playwright-BldPFZgC.ico +0 -0
  30. package/dashboard/dist/assets/qwen-xykkX0_y.png +0 -0
  31. package/dashboard/dist/assets/react-vendor-C7Sl8SE7.js +9 -0
  32. package/dashboard/dist/assets/router-DHISdpPk.js +3 -0
  33. package/dashboard/dist/assets/shared-BIP_4k4I.js +1 -0
  34. package/dashboard/dist/favicon.svg +28 -0
  35. package/dashboard/dist/index.html +17 -0
  36. package/dist/agent/acp-client.js +261 -0
  37. package/dist/agent/auto-update.js +432 -0
  38. package/dist/agent/await-resume.js +50 -0
  39. package/dist/agent/cli/auth.js +325 -0
  40. package/dist/agent/cli/catalog.js +40 -0
  41. package/dist/agent/cli/detector.js +136 -0
  42. package/dist/agent/cli/index.js +7 -0
  43. package/dist/agent/cli/registry.js +33 -0
  44. package/dist/agent/driver.js +39 -0
  45. package/dist/agent/drivers/claude-tui.js +2297 -0
  46. package/dist/agent/drivers/claude.js +2689 -0
  47. package/dist/agent/drivers/codex.js +2210 -0
  48. package/dist/agent/drivers/gemini.js +1059 -0
  49. package/dist/agent/drivers/hermes.js +795 -0
  50. package/dist/agent/goal.js +274 -0
  51. package/dist/agent/handover.js +130 -0
  52. package/dist/agent/images.js +355 -0
  53. package/dist/agent/index.js +50 -0
  54. package/dist/agent/mcp/bridge.js +791 -0
  55. package/dist/agent/mcp/extensions.js +637 -0
  56. package/dist/agent/mcp/oauth.js +353 -0
  57. package/dist/agent/mcp/registry.js +119 -0
  58. package/dist/agent/mcp/session-server.js +229 -0
  59. package/dist/agent/mcp/tools/ask-user.js +113 -0
  60. package/dist/agent/mcp/tools/await-resume.js +77 -0
  61. package/dist/agent/mcp/tools/goal.js +144 -0
  62. package/dist/agent/mcp/tools/types.js +12 -0
  63. package/dist/agent/mcp/tools/workspace.js +212 -0
  64. package/dist/agent/npm.js +31 -0
  65. package/dist/agent/session.js +1206 -0
  66. package/dist/agent/skill-installer.js +160 -0
  67. package/dist/agent/skills.js +257 -0
  68. package/dist/agent/stream.js +743 -0
  69. package/dist/agent/types.js +13 -0
  70. package/dist/agent/utils.js +687 -0
  71. package/dist/bot/bot.js +2499 -0
  72. package/dist/bot/command-ui.js +633 -0
  73. package/dist/bot/commands.js +513 -0
  74. package/dist/bot/headless-bot.js +36 -0
  75. package/dist/bot/host.js +192 -0
  76. package/dist/bot/human-loop.js +168 -0
  77. package/dist/bot/menu.js +48 -0
  78. package/dist/bot/orchestration.js +79 -0
  79. package/dist/bot/render-shared.js +309 -0
  80. package/dist/bot/session-hub.js +361 -0
  81. package/dist/bot/session-status.js +55 -0
  82. package/dist/bot/streaming.js +309 -0
  83. package/dist/browser-profile.js +579 -0
  84. package/dist/browser-supervisor.js +249 -0
  85. package/dist/catalog/cli-tools.js +421 -0
  86. package/dist/catalog/index.js +21 -0
  87. package/dist/catalog/local-models.js +94 -0
  88. package/dist/catalog/mcp-servers.js +315 -0
  89. package/dist/catalog/skill-repos.js +173 -0
  90. package/dist/channels/base.js +55 -0
  91. package/dist/channels/dingtalk/bot.js +549 -0
  92. package/dist/channels/dingtalk/channel.js +268 -0
  93. package/dist/channels/discord/bot.js +552 -0
  94. package/dist/channels/discord/channel.js +245 -0
  95. package/dist/channels/feishu/bot.js +1275 -0
  96. package/dist/channels/feishu/channel.js +911 -0
  97. package/dist/channels/feishu/markdown.js +91 -0
  98. package/dist/channels/feishu/render.js +619 -0
  99. package/dist/channels/health.js +109 -0
  100. package/dist/channels/slack/bot.js +554 -0
  101. package/dist/channels/slack/channel.js +283 -0
  102. package/dist/channels/states.js +6 -0
  103. package/dist/channels/telegram/bot.js +1310 -0
  104. package/dist/channels/telegram/channel.js +820 -0
  105. package/dist/channels/telegram/directory.js +111 -0
  106. package/dist/channels/telegram/live-preview.js +220 -0
  107. package/dist/channels/telegram/render.js +384 -0
  108. package/dist/channels/wecom/bot.js +558 -0
  109. package/dist/channels/wecom/channel.js +479 -0
  110. package/dist/channels/weixin/api.js +520 -0
  111. package/dist/channels/weixin/bot.js +1000 -0
  112. package/dist/channels/weixin/channel.js +222 -0
  113. package/dist/cli/autostart.js +262 -0
  114. package/dist/cli/channel-supervisor.js +313 -0
  115. package/dist/cli/channels.js +54 -0
  116. package/dist/cli/main.js +726 -0
  117. package/dist/cli/onboarding.js +227 -0
  118. package/dist/cli/run.js +308 -0
  119. package/dist/cli/setup-wizard.js +235 -0
  120. package/dist/core/config/runtime-config.js +201 -0
  121. package/dist/core/config/user-config.js +510 -0
  122. package/dist/core/config/validation.js +521 -0
  123. package/dist/core/constants.js +400 -0
  124. package/dist/core/git.js +145 -0
  125. package/dist/core/legacy-compat.js +60 -0
  126. package/dist/core/logging.js +101 -0
  127. package/dist/core/platform.js +59 -0
  128. package/dist/core/process-control.js +315 -0
  129. package/dist/core/secrets/index.js +42 -0
  130. package/dist/core/secrets/inline-seal.js +60 -0
  131. package/dist/core/secrets/ref.js +33 -0
  132. package/dist/core/secrets/resolver.js +65 -0
  133. package/dist/core/secrets/store.js +63 -0
  134. package/dist/core/utils.js +233 -0
  135. package/dist/core/version.js +15 -0
  136. package/dist/dashboard/platform.js +219 -0
  137. package/dist/dashboard/routes/agents.js +450 -0
  138. package/dist/dashboard/routes/cli.js +174 -0
  139. package/dist/dashboard/routes/config.js +523 -0
  140. package/dist/dashboard/routes/extensions.js +745 -0
  141. package/dist/dashboard/routes/local-models.js +290 -0
  142. package/dist/dashboard/routes/models.js +324 -0
  143. package/dist/dashboard/routes/sessions.js +838 -0
  144. package/dist/dashboard/runtime.js +410 -0
  145. package/dist/dashboard/server.js +237 -0
  146. package/dist/dashboard/session-control.js +347 -0
  147. package/dist/model/catalog.js +104 -0
  148. package/dist/model/index.js +20 -0
  149. package/dist/model/injector.js +272 -0
  150. package/dist/model/provider-models.js +112 -0
  151. package/dist/model/store.js +212 -0
  152. package/dist/model/types.js +13 -0
  153. package/dist/model/validation.js +203 -0
  154. package/package.json +82 -0
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CpM4CqZJ.js","assets/react-vendor-C7Sl8SE7.js","assets/Select-C8tOdPhe.js","assets/Modal-CTeL0y7P.js","assets/DirBrowser-Ckcmi-Pi.js","assets/markdown-DxQYQFeH.js","assets/ExtensionsTab-KZhEDrdu.js","assets/router-DHISdpPk.js","assets/AgentTab-UZPIhlkr.js","assets/shared-BIP_4k4I.js","assets/IMAccessTab-Bd_IY1GQ.js","assets/SystemTab-DBDkaPiO.js","assets/Modals-axftHasy.js"])))=>i.map(i=>d[i]);
2
+ import{c as re,r as u,j as n,a as le,b as de}from"./react-vendor-C7Sl8SE7.js";import{N as ce,u as ue,R as pe,a as R,b as ge,B as me}from"./router-DHISdpPk.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function o(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=o(a);fetch(a.href,i)}})();const he="modulepreload",fe=function(e){return"/"+e},W={},S=function(t,o,s){let a=Promise.resolve();if(o&&o.length>0){let c=function(h){return Promise.all(h.map(f=>Promise.resolve(f).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),l=r?.nonce||r?.getAttribute("nonce");a=c(o.map(h=>{if(h=fe(h),h in W)return;W[h]=!0;const f=h.endsWith(".css"),m=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const p=document.createElement("link");if(p.rel=f?"stylesheet":he,f||(p.as="script"),p.crossOrigin="",p.href=h,l&&p.setAttribute("nonce",l),document.head.appendChild(p),f)return new Promise((g,v)=>{p.addEventListener("load",g),p.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return a.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},be=15e3;function xe(e,t){if(!e)return()=>{};const o=()=>t.abort(e.reason);return e.aborted?(o(),()=>{}):(e.addEventListener("abort",o,{once:!0}),()=>e.removeEventListener("abort",o))}async function x(e,t={}){const{timeoutMs:o=be,signal:s,...a}=t,i=new AbortController,r=xe(s,i),l=setTimeout(()=>i.abort(new Error(`Request timed out after ${o}ms`)),o);try{const c=await fetch(e,{...a,signal:i.signal}),h=await c.text();if(!h)throw new Error(`Empty response (${c.status})`);try{return JSON.parse(h)}catch{throw new Error(`Invalid server response (${c.status})`)}}catch(c){throw i.signal.aborted&&!s?.aborted?new Error(`Request timed out after ${o}ms`):c instanceof Error?c:new Error(String(c??"Request failed"))}finally{clearTimeout(l),r()}}function d(e,t,o={}){return x(e,{...o,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}const y={getState:()=>x("/api/state"),getHost:()=>x("/api/host"),getAgentStatus:()=>x("/api/agent-status"),getSessions:()=>x("/api/sessions"),getSessionsPage:(e,t=0,o=6,s={})=>x(`/api/sessions/${e}?page=${t}&limit=${o}`,s),getSessionDetail:(e,t,o=8,s={})=>x(`/api/session-detail/${e}/${encodeURIComponent(t)}?limit=${o}`,s),installAgent:(e,t)=>d("/api/agent-install",{agent:e},{timeoutMs:6e5,...t}),updateRuntimeAgent:e=>d("/api/runtime-agent",e),checkAgentUpdate:(e,t)=>d("/api/agent-check-update",{agent:e},{timeoutMs:3e4,...t}),updateAgent:(e,t)=>d("/api/agent-update",{agent:e},{timeoutMs:6e5,...t}),saveConfig:e=>d("/api/config",e),validateTelegramConfig:(e,t="",o)=>d("/api/validate-telegram-token",{token:e,allowedChatIds:t},o),validateFeishuConfig:(e,t,o)=>d("/api/validate-feishu-config",{appId:e,appSecret:t},o),validateWeixinConfig:(e,t,o,s)=>d("/api/validate-weixin-config",{baseUrl:e,botToken:t,accountId:o},s),validateSlackConfig:(e,t,o)=>d("/api/validate-slack-config",{botToken:e,appToken:t},o),validateDiscordConfig:(e,t)=>d("/api/validate-discord-config",{botToken:e},t),validateDingtalkConfig:(e,t,o)=>d("/api/validate-dingtalk-config",{clientId:e,clientSecret:t},o),validateWecomConfig:(e,t,o)=>d("/api/validate-wecom-config",{botId:e,botSecret:t},o),startWeixinLogin:(e,t)=>d("/api/weixin-login/start",{baseUrl:e},t),waitWeixinLogin:(e,t,o)=>d("/api/weixin-login/wait",{sessionKey:e,baseUrl:t},o),requestPermission:e=>d("/api/open-preferences",{permission:e}),restart:()=>d("/api/restart",{}),switchWorkdir:e=>d("/api/switch-workdir",{path:e}),lsDir:(e,t,o)=>{const s=new URLSearchParams;e&&s.set("path",e),t&&s.set("files","1"),o&&s.set("hidden","1");const a=s.toString();return x(`/api/ls-dir${a?"?"+a:""}`)},gitChanges:e=>x(`/api/git-changes?path=${encodeURIComponent(e)}`),openDiff:(e,t)=>d("/api/open-diff",{filePath:e,target:t}),getBrowser:()=>x("/api/browser"),setupBrowser:e=>d("/api/browser/setup",{},{timeoutMs:12e4,...e}),getMcpCatalog:(e,t)=>{const o=new URLSearchParams;e&&o.set("workdir",e),t&&o.set("scope",t);const s=o.toString();return x(`/api/extensions/mcp/catalog${s?"?"+s:""}`)},installMcp:(e,t,o,s,a=!0)=>d("/api/extensions/mcp/install",{catalogId:e,scope:t,credentials:o,workdir:s,enable:a}),toggleMcp:(e,t,o,s)=>d("/api/extensions/mcp/toggle",{name:e,enabled:t,scope:o,workdir:s}),updateMcpExtension:(e,t,o,s)=>d("/api/extensions/mcp/update",{name:e,patch:t,scope:o,workdir:s}),removeMcp:(e,t,o,s)=>d("/api/extensions/mcp/remove",{name:e,scope:t,catalogId:o,workdir:s}),addCustomMcp:(e,t,o,s)=>d("/api/extensions/mcp/custom",{name:e,config:t,scope:o,workdir:s}),checkMcpHealth:(e,t,o=!1,s)=>d("/api/extensions/mcp/health",{id:e,config:t,noCache:o},{timeoutMs:15e3,...s}),searchMcp:e=>x(`/api/extensions/mcp/search?q=${encodeURIComponent(e)}`),startMcpOAuth:e=>d("/api/extensions/mcp/oauth/start",{catalogId:e},{timeoutMs:3e4}),revokeMcpOAuth:e=>d("/api/extensions/mcp/oauth/revoke",{catalogId:e}),getSkillsCatalog:(e,t,o)=>{const s=new URLSearchParams;return e&&s.set("workdir",e),t&&s.set("scope",t),x(`/api/extensions/skills/catalog?${s.toString()}`,{timeoutMs:5e3,...o})},installSkill:(e,t,o,s)=>d("/api/extensions/skills/install",{source:e,global:t,skill:o,workdir:s},{timeoutMs:9e4}),removeExtensionSkill:(e,t,o)=>d("/api/extensions/skills/remove",{name:e,global:t,workdir:o}),listRepoSkills:(e,t)=>x(`/api/extensions/skills/list?source=${encodeURIComponent(e)}`,{timeoutMs:15e3,...t}),searchExtensionSkills:e=>x(`/api/extensions/skills/search?q=${encodeURIComponent(e)}`),getSkills:(e,t)=>x(`/api/session-hub/skills?workdir=${encodeURIComponent(e)}`,{timeoutMs:5e3,...t}),getCliCatalog:e=>x("/api/extensions/cli/catalog",{timeoutMs:1e4,...e}),refreshCli:e=>d("/api/extensions/cli/refresh",{id:e},{timeoutMs:15e3}),startCliAuth:e=>d("/api/extensions/cli/auth/start",{id:e}),startCliInstall:e=>d("/api/extensions/cli/install",{id:e}),cancelCliAuth:e=>d("/api/extensions/cli/auth/cancel",{sessionId:e}),applyCliToken:(e,t)=>d("/api/extensions/cli/auth/token",{id:e,values:t},{timeoutMs:15e3}),logoutCli:e=>d("/api/extensions/cli/logout",{id:e},{timeoutMs:15e3}),probeLocalModels:e=>x("/api/local-models/probe",{timeoutMs:8e3,...e}),getWorkspaces:()=>x("/api/workspaces"),getWorkspaceSessions:(e,t)=>d("/api/session-hub/sessions",{workdir:e},t),getWorkspaceGit:(e,t)=>x(`/api/workspace-git?path=${encodeURIComponent(e)}`,{timeoutMs:6e3,...t}),getSessionMessages:(e,t,o,s={},a)=>d("/api/session-hub/session/messages",{workdir:e,agent:t,sessionId:o,rich:s.rich??!0,lastNTurns:s.lastNTurns,turnOffset:s.turnOffset,turnLimit:s.turnLimit},a),updateSessionStatus:(e,t,o,s,a)=>d("/api/session-hub/session/status",{workdir:e,agent:t,sessionId:o,status:s},a),updateSessionNote:(e,t,o,s,a)=>d("/api/session-hub/session/note",{workdir:e,agent:t,sessionId:o,note:s},a),deleteSession:(e,t,o,s,a)=>d("/api/session-hub/session/delete",{workdir:e,agent:t,sessionId:o,purgeNative:s},a),addWorkspace:(e,t,o)=>d("/api/workspaces",{path:e,name:t},o),removeWorkspace:(e,t)=>x("/api/workspaces",{...t,method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),openInEditor:(e,t)=>d("/api/open-in-editor",{filePath:e,target:t}),sendSessionMessage:(e,t,o,s,a={})=>{const{attachments:i=[],model:r,effort:l,previousAgent:c,previousSessionId:h,...f}=a,m=typeof c=="string"?c.trim():"",p=typeof h=="string"?h.trim():"",g={workdir:e,agent:t,sessionId:o,prompt:s,...typeof r=="string"&&r.trim()?{model:r.trim()}:{},...typeof l=="string"&&l.trim()?{effort:l.trim()}:{},...m&&p?{previousAgent:m,previousSessionId:p}:{}};if(!i.length)return d("/api/session-hub/session/send",g,{timeoutMs:3e4,...f});const v=new FormData;v.set("workdir",e),v.set("agent",t),v.set("sessionId",o),v.set("prompt",s),typeof r=="string"&&r.trim()&&v.set("model",r.trim()),typeof l=="string"&&l.trim()&&v.set("effort",l.trim()),m&&p&&(v.set("previousAgent",m),v.set("previousSessionId",p));for(const P of i)v.append("attachments",P,P.name||"image");return x("/api/session-hub/session/send",{method:"POST",body:v,timeoutMs:3e4,...f})},forkSession:(e,t,o,s,a,i={},r)=>d("/api/session-hub/session/fork",{workdir:e,agent:t,sessionId:o,atTurn:s,prompt:a,...i.model?{model:i.model}:{},...i.effort?{effort:i.effort}:{}},{timeoutMs:3e4,...r}),recallSessionMessage:(e,t)=>d("/api/session-hub/session/recall",{taskId:e},t),stopSession:(e,t,o)=>d("/api/session-hub/session/stop",{agent:e,sessionId:t},o),steerSession:(e,t)=>d("/api/session-hub/session/steer",{taskId:e},t),getSessionStreamState:(e,t,o)=>x(`/api/session-hub/session/stream-state?agent=${encodeURIComponent(e)}&sessionId=${encodeURIComponent(t)}`,{timeoutMs:5e3,...o}),interactionSelectOption:(e,t,o,s)=>d(`/api/interaction/${encodeURIComponent(e)}/select`,{value:t,requestFreeform:!!o},s),interactionSubmitText:(e,t,o)=>d(`/api/interaction/${encodeURIComponent(e)}/text`,{text:t},o),interactionSkip:(e,t)=>d(`/api/interaction/${encodeURIComponent(e)}/skip`,{},t),interactionCancel:(e,t)=>d(`/api/interaction/${encodeURIComponent(e)}/cancel`,{},t)};function we(e){return!!e?.configured&&(!e.validated||e.status==="checking")}function Q(e){return Array.isArray(e)&&e.some(t=>we(t))}const J="pikiloop-store-cache";function Z(){try{const e=sessionStorage.getItem(J);if(e)return JSON.parse(e)}catch{}return{state:null,host:null,agentStatus:null}}function L(e){try{const t=Z();sessionStorage.setItem(J,JSON.stringify({...t,...e}))}catch{}}let ve=0;function ke(){try{const e=localStorage.getItem("pikiloop-theme");if(e==="light"||e==="dark")return e}catch{}return"dark"}function Se(){try{const e=localStorage.getItem("pikiloop-locale");if(e==="en"||e==="zh-CN")return e}catch{}return"zh-CN"}const X=ke();document.documentElement.dataset.theme=X;const E=Z(),k=re()((e,t)=>({state:E.state,host:E.host,agentStatus:E.agentStatus,toasts:[],allSessions:{},theme:X,locale:Se(),toast:(o,s=!0)=>{const a=++ve;e(i=>({toasts:[...i.toasts,{id:a,message:o,ok:s}]})),setTimeout(()=>{e(i=>({toasts:i.toasts.filter(r=>r.id!==a)}))},3e3)},setTheme:o=>{document.documentElement.dataset.theme=o;try{localStorage.setItem("pikiloop-theme",o)}catch{}e({theme:o})},setLocale:o=>{try{localStorage.setItem("pikiloop-locale",o)}catch{}e({locale:o})},reload:async()=>{try{const[o,s,a]=await Promise.all([y.getState(),y.getHost().catch(()=>null),y.getAgentStatus().catch(()=>null)]);return e({state:o,...s?{host:s}:{},...a?{agentStatus:a}:{}}),L({state:o,...s?{host:s}:{},...a?{agentStatus:a}:{}}),o}catch(o){return console.error("loadState:",o),null}},refreshAgentStatus:async()=>{try{const o=await y.getAgentStatus();return e({agentStatus:o}),L({agentStatus:o}),o}catch{return null}},setAgentStatus:o=>{e({agentStatus:o}),L({agentStatus:o})},reloadUntil:async(o,s)=>{const a=s?.attempts??8,i=s?.intervalMs??250;let r=null;for(let l=0;l<a;l++){if(r=await t().reload(),r&&o(r))return r;l<a-1&&await new Promise(c=>setTimeout(c,i))}return r},loadSessions:async()=>{try{const[o,s,a]=await Promise.all([y.getState(),y.getHost(),y.getSessions()]);e({state:o,host:s,allSessions:a}),L({state:o,host:s})}catch(o){console.error("loadSessions:",o)}}}));k.getState().reload();let N=null;k.subscribe((e,t)=>{e.state!==t.state&&(N&&(clearTimeout(N),N=null),Q(e.state?.setupState?.channels||null)&&(N=setTimeout(()=>{N=null,k.getState().reload()},1500)))});const _={"tab.im":"IM 接入","tab.agent":"智能体配置","tab.permissions":"系统权限","tab.extensions":"扩展插件","tab.system":"系统信息","tab.config":"配置管理","tab.sessions":"工作台","tab.automation":"扩展插件","tab.plugins":"插件中心","tabDesc.im":"管理消息渠道接入、状态和配置。","tabDesc.agent":"设置新会话默认使用的智能体、模型和推理强度,并配置模型供应商与凭据。","tabDesc.permissions":"为截图等能力授予所需权限。","tabDesc.extensions":"管理浏览器自动化能力。","tabDesc.sessions":"查看各智能体的会话记录和运行状态。","tabDesc.system":"工作目录、主机概览与系统权限。","app.systemInfo":"系统信息","app.systemInfoHint":"通用主机信息模块,可在不同页面复用。","app.activeTasks":"活跃任务","app.sessionCount":"会话数","app.readyChannels":"已就绪","app.configuredChannels":"已配置","app.missingPermissions":"待授权","app.defaultModel":"默认模型","sidebar.switchDir":"切换目录","sidebar.restart":"重启进程","sidebar.notSet":"未设置","status.loading":"加载中","status.running":"运行中","status.connecting":"连接中","status.ready":"就绪","status.needsConfig":"需要配置","config.imAccess":"IM 接入","config.aiAgent":"智能体","config.sysPerms":"系统权限","config.general":"通用设置","config.configured":"已配置","config.configure":"配置","config.clickConfig":"去配置","config.validating":"校验中","config.validationFailed":"校验失败","config.comingSoon":"即将推出","config.notInstalled":"未安装","config.defaultAgent":"默认智能体","config.defaultBadge":"默认","config.balance":"额度状态","config.balanceUnavailable":"暂无法查询额度","config.balanceHealthy":"充足","config.balanceTight":"偏紧","config.limitReached":"已用尽","usage.used":"已用","usage.resets":"重置","usage.resetElapsed":"已重置 · 待刷新","usage.asOf":"采集于","usage.accountQuota":"账号配额","config.advantage":"优势","config.model":"模型","config.noModel":"暂无可选模型","config.thinkingMode":"推理强度","config.noReasoningMode":"-","config.instantApply":"修改后立即生效,并同步写入 ~/.pikiloop/setting.json。","config.runtimeTitle":"默认智能体","config.runtimeSubtitle":"左侧只切换当前查看的智能体;默认执行智能体请在右侧单独确认。修改会立即写入 ~/.pikiloop/setting.json,并同步当前进程。","config.setDefaultAction":"设为默认","config.settingDefault":"切换中...","config.installAction":"安装","config.installingAgent":"安装中...","config.installHint":"首次使用可直接点击上方按钮,pikiloop 会用 npm 全局安装对应 Agent。","config.agentInstalled":"Agent 安装完成","config.agentInstallFailed":"Agent 安装失败","config.hostStatus":"权限状态","config.permissionHint":"这里集中处理系统级权限,缺少授权时,相关能力会直接受限。","config.channelHint":"渠道接入成功后,外部消息会直接进入当前运行时。","config.switchDirHint":"工作目录请使用顶栏的”切换目录”按钮,这里不再提供保存配置。","config.applyFailed":"应用失败","config.loadAgentFailed":"无法加载 Agent 状态","config.agentAdvantageClaude":"Anthropic 官方编码 CLI,围绕 Claude 模型构建,长链路工具调用稳定可靠","config.agentAdvantageCodex":"OpenAI 官方终端编码代理,擅长任务规划与多步代码改造","config.agentAdvantageGemini":"Google 开源的终端 AI 代理,原生百万 token 长上下文,文档与代码搜索友好","config.agentAdvantageHermes":"pikiloop 自带,通过 ACP 协议跑任意模型,可在 OpenRouter / 第三方 Provider 间自由切换","config.authorized":"已授权","config.pendingAuth":"待授权","config.workdir":"工作目录","config.workspaceHint":"当前运行时使用的项目根目录。","config.workdirPlaceholder":"留空使用当前目录","config.save":"保存配置","config.saveFailed":"保存失败","config.saved":"配置已保存","perm.screenRecording":"屏幕录制","perm.screenRecordingReason":"允许读取屏幕内容,用于截图和界面分析。","perm.fullDiskAccess":"完全磁盘访问","perm.fullDiskAccessReason":"允许访问桌面、下载等受保护目录。","perm.fullDiskAccessManualHint":"该项无法由 macOS 直接弹出授权确认,点击后会打开对应设置页。","perm.authorize":"授权","perm.waiting":"等待授权","perm.settings":"前往设置","perm.alreadyGranted":"权限已授权","perm.promptOpened":"已拉起系统授权弹窗,请在系统提示中确认。","perm.settingsOpened":"已打开对应系统设置页。","perm.settingsOpenedManual":"macOS 不支持直接弹出该权限授权,已打开对应设置页,请手动开启。","perm.grantedNow":"权限状态已更新。","perm.requestFailed":"无法发起权限请求。","perm.pendingAfterPrompt":"暂未检测到授权结果,如未出现弹窗,请在系统设置里手动完成。","perm.pendingAfterSettings":"暂未检测到授权结果,请在系统设置完成后返回此页。","perm.stillPending":"当前仍未检测到授权状态,请确认后再刷新。","perm.guideTitle":"操作说明","perm.guidePromptIntro":"已尝试触发系统授权,请按下面步骤完成。","perm.guideSettingsIntro":"已打开对应系统设置页,请按下面步骤完成。","perm.guideAllowPrompt":"如果系统弹窗已经出现,先在弹窗里点“允许”。","perm.guideOpenPathPrefix":"打开 ","perm.guideGrantHostApp":"给当前启动 pikiloop 的宿主应用({hostApp})授权。","perm.guideGrantHostAppFallback":"给当前启动 pikiloop 的宿主应用授权,例如 Terminal、iTerm 或 Warp。","perm.guideToggleHostApp":"在应用列表里找到 {hostApp},并手动打开权限开关。","perm.guideToggleHostAppFallback":"在应用列表里找到当前启动 pikiloop 的宿主应用,并手动打开权限开关。","perm.guideMayNeedRestart":"如果 macOS 要求重启{hostApp},按提示执行。","perm.guideMayNeedRestartFallback":"如果 macOS 要求重启宿主应用,按提示执行。","perm.guideBackRefresh":"完成后返回此页,手动点击“刷新状态”。","perm.guideRefresh":"刷新状态","perm.guideClose":"稍后","perm.hostAppHint":"需要给宿主应用 {hostApp} 授权","perm.hostAppHintFallback":"需要给启动 pikiloop 的宿主应用(如 Terminal、iTerm)授权","perm.alertMissing":"尚未授权","perm.alertHostApp":"需要在系统设置中给 {hostApp} 开启对应权限,点击查看详情","perm.alertHostAppFallback":"需要在系统设置中给宿主应用开启对应权限,点击查看详情","perm.alertAction":"前往设置 →","perm.pathScreenRecording":"系统设置 > 隐私与安全性 > 屏幕与系统音频录制","perm.pathFullDiskAccess":"系统设置 > 隐私与安全性 > 完全磁盘访问","sessions.host":"主机","sessions.cpu":"CPU","sessions.memory":"内存","sessions.disk":"磁盘","sessions.battery":"电池","system.cpuLoad":"CPU 负载","sessions.runStatus":"运行状态","sessions.agentSessions":"Agent 会话","sessions.dir":"目录","sessions.agent":"Agent","sessions.runtime":"运行","sessions.usage":"用量","sessions.noAgent":"无已安装的 Agent","sessions.noSessions":"无会话","sessions.botNotRunning":"Bot 未运行。完成配置后重启即可。","sessions.loading":"加载中...","sessions.current":"当前","sessions.completed":"已完成","sessions.incomplete":"未完成","sessions.waiting":"等待中","sessions.lastIssue":"上次状态","sessions.prev":"上一页","sessions.next":"下一页","sessions.retry":"重试","hub.selectSession":"选择会话查看详情","hub.selectSessionHint":"点击左侧会话卡片打开对话面板","hub.noMessages":"暂无消息记录","hub.loadingOlderTurns":"正在加载更早的对话…","hub.loadOlderTurnsHint":"继续上滑可加载更早的对话","hub.inputPlaceholder":"输入消息…","hub.newSession":"新建会话","hub.newSessionHint":"选择工作区和 Agent,输入初始提示词开始新会话。","hub.startSession":"开始","hub.addWorkspace":"添加工作区","hub.removeWorkspace":"移除工作区","hub.extensions":"扩展插件","hub.workspacePath":"工作区路径","hub.workspaceName":"工作区名称(可选)","hub.add":"添加","hub.cancel":"取消","hub.user":"你的问题","hub.thinking":"思考","hub.toolUse":"工具调用","hub.toolResult":"工具结果","hub.turnN":"第 {n} 轮","hub.noWorkspaces":"暂无工作区,请添加","hub.allWorkspaces":"全部工作区","hub.activity":"执行","hub.imagePrompt":"生图 Prompt","hub.imagePromptShow":"展开完整 prompt","hub.imagePromptHide":"收起 prompt","hub.systemNotice":"运行时提示","hub.streamFailed":"回合未返回内容","hub.streamErrored":"回合出错","hub.turnFailed":"回合未完成","hub.turnStopped":"已停止","hub.process":"过程","hub.processNotes":"记录","hub.output":"输出","hub.subAgent":"子代理","hub.subAgentWaiting":"等待子代理首个工具调用…","hub.send":"发送","hub.sending":"发送中…","hub.recall":"撤回","hub.steer":"插队","hub.queued":"排队中","hub.running":"运行中","hub.stop":"停止","hub.stopHint":"停止当前运行的任务","hub.selectAgent":"选择 Agent","hub.selectModel":"选择模型","hub.selectEffort":"推理强度","hub.modelGroupNative":"官方","hub.modelGroupProfiles":"我的模型","hub.skills":"技能","hub.noSkills":"暂无可用技能","hub.sendHint":"发送消息到当前会话","hub.recallHint":"撤回排队中的消息","hub.steerHint":"中断当前任务,优先执行此消息","hub.queuePosition":"队列位置: {n}","hub.copy":"复制","hub.copied":"已复制","hub.copyImage":"复制图片","hub.rerun":"重跑","hub.edit":"编辑","hub.expand":"展开全部 ({chars} 字符 · {lines} 行)","hub.collapse":"收起","hub.fork":"从此分支","hub.forkPromptTitle":"基于这条消息开新分支","hub.forkPromptHint":"新分支会继承父会话的全部历史,下面的输入会成为新会话的第一条对话。","hub.forkPromptPlaceholder":"比如:换个思路,从这里开始重做…","hub.forkSubmitting":"开新分支中…","hub.forkSubmit":"创建分支","hub.forkBadge":"分支自","hub.forkBadgeAt":"第 {turn} 轮","hub.forkChildren":"分支","hub.forkUnsupported":"当前 Agent 暂不支持分支","hub.addImages":"添加图片","hub.removeImage":"删除图片","hub.previewImage":"预览图片","hub.search":"搜索…","hub.filterAll":"全部","hub.filterRunning":"运行中","hub.filterReview":"待审查","hub.showMore":"展开更多","hub.nMore":"还有 {n} 个","hub.workspace":"工作区","hub.result":"结果","hub.plan":"计划","hub.planProgress":"{done}/{total} 项任务已完成","hub.planDone":"已完成","hub.planInProgress":"进行中","hub.summary":"总结","hub.nextAction":"下一步","hub.noSummary":"暂无总结","hub.noNextAction":"暂无下一步建议","hub.continueTask":"继续当前未完成的任务","hub.status":"状态","hub.outcome":"类型","hub.statusInbox":"收件箱","hub.statusActive":"进行中","hub.statusReview":"待审查","hub.statusDone":"已完成","hub.statusParked":"暂存","hub.outcomeAnswer":"回答","hub.outcomeProposal":"方案","hub.outcomeImplementation":"实施","hub.outcomePartial":"部分完成","hub.outcomeBlocked":"受阻","hub.outcomeConversation":"对话","hub.lastUpdated":"最近更新","hub.turns":"轮次","hub.linked":"关联会话","hub.note":"备注","hub.notePlaceholder":"给这个会话留一条备注…","hub.saveNote":"保存备注","hub.savedNote":"备注已保存","hub.statusSaved":"状态已更新","hub.actions":"操作","hub.open":"打开","hub.openWorkspace":"打开工作区","hub.openProject":"打开项目","hub.openWorkspaceWith":"用 {target} 打开工作区","hub.openProjectWith":"用 {target} 打开项目","hub.openWithTarget":"用 {target} 打开","hub.openMethod":"打开方式","hub.openTargetCursor":"Cursor","hub.openTargetVsCode":"VS Code","hub.openTargetWindsurf":"Windsurf","hub.openTargetFinder":"Finder","hub.openTargetDefault":"系统默认","hub.artifacts":"产物","hub.projectFiles":"项目文件","hub.projectPath":"项目目录","hub.projectFilesHint":"这个会话还没有单独的产物目录,所以这里显示的是整个项目的文件。","hub.workspaceVsProjectHint":"工作区是这次会话的独立产物目录;项目是原始代码目录。","hub.live":"实时","hub.changes":"变更","hub.files":"文件","hub.noChanges":"暂无变更","hub.noFiles":"暂无文件","hub.modified":"修改","hub.added":"新增","hub.read":"读取","hub.deleted":"删除","hub.openDiff":"查看变更","hub.layout1":"单窗口","hub.layout2":"双窗口","hub.layout3":"三窗口","hub.layout6":"六窗口","hub.emptySlot":"点击左侧会话填充","hub.closePanel":"关闭","hub.detailPanel":"详情面板","hub.minimizePanel":"最小化","hub.restorePanel":"恢复面板","plugins.title":"插件中心","plugins.customSkills":"自定义技能","plugins.mcp":"外部工具协议","plugins.service":"对外服务","plugins.comingSoon":"敬请期待","ext.title":"浏览器自动化","ext.hint":"为 Agent 提供浏览器自动化能力。浏览器自动化默认关闭;启用后只使用 pikiloop 的独立 profile 浏览器。macOS 主浏览器基础操作建议直接使用 open、osascript、screencapture。","ext.browser":"管理型浏览器","ext.browserDesc":"浏览器模式配置会在下次会话生效。","ext.browserDescEnabled":"启用后,pikiloop 会为 Agent 注入独立 profile 的浏览器自动化工具,并复用该 profile 的登录态。","ext.browserDescDisabled":"默认关闭。关闭时不会注入 browser MCP;如需操作主浏览器,请直接使用 macOS 原生命令。","ext.browserDescCdp":"默认模式。通过 CDP 直接连接你平时使用的主浏览器,复用现有标签页与登录态。","ext.browserDescProfile":"可选模式。通过独立 Chrome profile 目录运行浏览器,适合把自动化和日常浏览隔离开。","ext.browserModeCdp":"CDP 主浏览器","ext.browserProfileMode":"专用配置文件","ext.browserModeProfile":"独立 profile","ext.enabled":"已启用","ext.disabled":"已禁用","ext.cdpReady":"CDP 已连接","ext.cdpWaiting":"等待主浏览器","ext.chromeInstalled":"Chrome 已安装","ext.profileCreated":"配置文件已创建","ext.needsSetup":"需要配置","ext.browserReady":"浏览器已就绪","ext.browserRemote":"外接 CDP","ext.browserRemoteStep":"通过 CDP 接入外部 Chrome","ext.browserRemoteStepDesc":"已设置 PIKILOOP_BROWSER_CDP_URL,pikiloop 不会在本机启动或管理浏览器。请在持有该端点的 Chrome(例如边车容器的网页 VNC)里登录所需站点。","ext.saveBrowserRemote":"保存","ext.browserOpen":"浏览器已打开","ext.setup":"配置","ext.setupBrowser":"配置浏览器自动化","ext.setupBrowserDesc":"浏览器自动化默认关闭。启用后,pikiloop 只会使用独立 profile 浏览器;主浏览器基础操作不再做额外封装。","ext.step1Title":"1. 专用配置文件目录","ext.step1Desc":"系统会为 pikiloop 创建独立的 Chrome 配置文件目录,与你日常使用的浏览器配置完全分离。","ext.step1Action":"创建配置文件","ext.step2Title":"2. 拉起浏览器并登录","ext.step2Desc":"打开这个专用浏览器后,请登录后续任务需要的账号。","ext.step2Action":"拉起浏览器","ext.browserDisabledStepTitle":"关闭时的行为","ext.browserDisabledHint":"关闭后,pikiloop 不会向 Agent 注入任何 browser MCP。macOS 主浏览器操作请直接使用 open、osascript、screencapture。","ext.browserEnableToggle":"启用浏览器自动化","ext.browserEnableToggleDesc":"启用后会为后续 Agent 会话注入受管 profile 浏览器 MCP;关闭时不会注入任何 browser MCP。","ext.cdpStepTitle":"主浏览器连接要求","ext.cdpStepDesc":"请让你的日常 Chrome 以远程调试模式暴露 CDP 地址,然后 pikiloop 会直接附着到该浏览器:","ext.useProfileToggle":"开启 use-profile 独立浏览器模式","ext.useProfileToggleDesc":"关闭时默认走 CDP 主浏览器模式;开启后改为使用当前这条独立 profile 链路,由 pikiloop 拉起浏览器并复用该 profile 的登录态。","ext.cdpModeDesc":"CDP 模式会直接复用你的主浏览器上下文,更接近日常使用,但也会共享真实标签页、Cookie 和登录态。CDP 地址:","ext.profileModeDesc":"use-profile 模式会使用 pikiloop 的独立浏览器目录,更隔离,也更适合长期复用固定登录态。","ext.pendingModeChange":"有未保存的模式变更","ext.cdpEndpoint":"CDP 地址","ext.copyPath":"复制路径","ext.step2Copied":"路径已复制","ext.step3Title":"3. 登录完成即可开始使用","ext.step3Desc":"账号登录完成后可以直接开始用。如果这个浏览器还开着,pikiloop 会在启动浏览器自动化前自动关闭它。","ext.profileDir":"配置文件目录","ext.launching":"拉起中...","ext.browserLaunched":"浏览器已打开","ext.browserLaunchFailed":"浏览器配置失败","ext.browserModeSaveFailed":"浏览器配置保存失败","ext.browserDisabledSaved":"已关闭浏览器自动化","ext.browserEnabledLaunched":"已启用浏览器自动化并打开浏览器","ext.saveBrowserDisabled":"保存为关闭状态","ext.enableAndLaunchBrowser":"启用并拉起浏览器","ext.saveCdpMode":"保存 CDP 模式","ext.saveAndLaunchBrowser":"保存并拉起浏览器","ext.cdpModeSaved":"已切换为 CDP 主浏览器模式","ext.profileModeLaunched":"已切换为独立 profile 模式并打开浏览器","ext.running":"运行中","ext.notInstalled":"未安装","ext.disable":"停用","ext.disabling":"停用中...","modal.configureTelegram":"配置 Telegram","modal.configureFeishu":"配置飞书","modal.configureWeixin":"配置微信","modal.switchWorkdir":"切换工作目录","modal.botToken":"Bot Token","modal.pasteToken":"粘贴 BotFather 发送的 Token","modal.validateSave":"验证并保存","modal.validating":"验证中...","modal.cancel":"取消","modal.save":"保存","modal.allowedIds":"Allowed Chat IDs","modal.optional":"可选","modal.commaSep":"逗号分隔","modal.appId":"App ID","modal.appSecret":"App Secret","modal.feishuPlaceholder":"飞书开放平台 App ID","modal.tgGuideTitle":"配置步骤","modal.tgGuideStep1":"1. 在 Telegram 中搜索 @BotFather 并打开对话","modal.tgGuideStep2":"2. 发送 /newbot,按提示设置显示名称和用户名","modal.tgGuideStep3":"3. 创建成功后 BotFather 会发送一段 Bot Token,复制粘贴到下方","modal.tgGuideStep4":"4.(可选)填写 Allowed Chat IDs 限制哪些聊天可以使用机器人","modal.tgGuideIdTip":"获取 Chat ID:私聊 @userinfobot 可查看你的用户 ID;群组 ID 为负数,可通过将 @RawDataBot 加入群组获取","modal.feishuGuideTitle":"配置步骤","modal.feishuGuideStep1":"1. 打开飞书开放平台 open.feishu.cn → 创建企业自建应用","modal.feishuGuideStep2":'2. 进入"凭证与基础信息",复制 App ID 和 App Secret',"modal.feishuGuideStep3":'3. 进入"应用功能" → 启用"机器人"能力',"modal.feishuGuideStep4":'4. 进入"权限管理",添加以下权限并发布版本:',"modal.feishuGuidePerms":"im:message · im:message:send_as_bot · im:resource · im:chat","modal.feishuGuideStep5":"5.(可选)添加 cardkit:card 权限可启用流式打字机效果,不添加也能正常使用","modal.feishuGuideStep6":'6. 进入"事件与回调" → 选择 WebSocket 模式(无需公网地址)',"modal.feishuGuideStep7":"7. 创建版本并发布应用,将机器人添加到群聊即可使用","modal.feishuGuideCardKitTip":"如日志中出现 CardKit 报错属于正常降级,不影响功能;如需流式效果请添加 cardkit:card 权限并重新发布","modal.weixinBaseUrl":"微信 Base URL","modal.weixinDefaultBaseUrlHint":"默认即可,除非腾讯侧给了你单独的地址。","modal.weixinGenerateQr":"生成二维码","modal.weixinGeneratingQr":"生成中...","modal.weixinWaitingScan":"等待扫码","modal.weixinScanned":"已扫码,等待确认","modal.weixinQrRefreshed":"二维码已刷新,请重新扫码","modal.weixinLoginSuccess":"微信连接成功,正在校验配置...","modal.weixinSaved":"微信配置已保存","modal.weixinScanHint":"先在这里生成二维码,用微信扫码并在手机里确认,只有校验通过后才会启用此通道。","modal.weixinQrAlt":"微信登录二维码","modal.weixinRetry":"重新生成","modal.inputWeixinBaseUrl":"请输入 Base URL","modal.networkError":"网络错误","modal.requestTimeout":"请求超时,请检查网络后重试。","modal.emptyDir":"空目录","modal.selectDir":"选择此目录","modal.manualInput":"或手动输入路径","modal.recentConv":"最近对话","modal.loadingConv":"加载对话记录...","modal.noConv":"暂无对话记录","modal.loadFailed":"加载失败","modal.createdAt":"创建时间","modal.status":"状态","modal.ended":"已结束","modal.inputToken":"请输入 Token","modal.inputAppId":"请输入 App ID","modal.selectDirFirst":"请选择目录","modal.switchedTo":"已切换到 ","modal.switchFailed":"切换失败","modal.tgSaved":"Telegram 配置已保存","modal.feishuSaved":"飞书配置已保存","modal.slackSaved":"Slack 配置已保存","modal.discordSaved":"Discord 配置已保存","modal.dingtalkSaved":"钉钉配置已保存","modal.wecomSaved":"企业微信配置已保存","modal.fieldRequired":"不能为空","modal.credentialsVerified":"凭证校验通过","modal.configureSlack":"配置 Slack","modal.slackBotToken":"Bot Token (xoxb-...)","modal.slackBotTokenPlaceholder":"xoxb-1234567890-abc...","modal.slackAppToken":"App-Level Token (xapp-...)","modal.slackAppTokenPlaceholder":"xapp-1-A...","modal.slackGuideTitle":"Slack 接入流程(无需公网 IP)","modal.slackGuideStep1":"1. 打开 api.slack.com/apps,点击 Create New App → From scratch,选择目标 Workspace","modal.slackGuideStep2":"2. 进入 Socket Mode,启用并生成 App-Level Token,勾选 connections:write 权限","modal.slackGuideStep3":"3. 进入 OAuth & Permissions,添加 Bot Token Scopes:app_mentions:read、chat:write、im:history、im:read、im:write、users:read","modal.slackGuideStep4":"4. 进入 Event Subscriptions(Socket 模式下无需公网回调),订阅 message.im、app_mention 事件","modal.slackGuideStep5":"5. Install App 到 Workspace,复制 Bot User OAuth Token (xoxb-) 与 App-Level Token (xapp-) 粘贴到下方","modal.configureDiscord":"配置 Discord","modal.discordBotToken":"Bot Token","modal.discordBotTokenPlaceholder":"MTA...","modal.discordGuideTitle":"Discord 接入流程(无需公网 IP)","modal.discordGuideStep1":"1. 打开 discord.com/developers/applications,点击 New Application 创建一个应用","modal.discordGuideStep2":'2. 进入 Bot 页面 → Add Bot,复制 Token;务必勾选 "Message Content Intent" 否则收不到消息正文',"modal.discordGuideStep3":"3. 进入 OAuth2 → URL Generator,scope 选 bot 与 applications.commands;权限至少给 Send Messages、Read Message History","modal.discordGuideStep4":"4. 用生成的 URL 邀请机器人到测试 Server","modal.discordGuideStep5":"5. 把 Bot Token 粘贴到下方,校验并保存","modal.configureDingtalk":"配置钉钉","modal.dingtalkClientId":"Client ID (AppKey)","modal.dingtalkClientIdPlaceholder":"dingxxxxxxxxxxxxxxxx","modal.dingtalkClientSecret":"Client Secret (AppSecret)","modal.dingtalkClientSecretPlaceholder":"应用密钥","modal.dingtalkGuideTitle":"钉钉接入流程(Stream 模式,无需公网 IP)","modal.dingtalkGuideStep1":"1. 打开 open-dev.dingtalk.com,创建企业内部应用或机器人应用","modal.dingtalkGuideStep2":'2. 进入"凭证与基础信息",复制 Client ID(AppKey)和 Client Secret(AppSecret)',"modal.dingtalkGuideStep3":'3. 进入"应用能力 → 机器人",开启机器人能力',"modal.dingtalkGuideStep4":'4. 进入"事件订阅" → 选择 Stream 模式(无需公网地址),订阅"机器人消息"事件',"modal.dingtalkGuideStep5":"5. 发布版本并将机器人添加到群聊;下方填入 Client ID 与 Client Secret 校验","modal.configureWeCom":"配置企业微信","modal.wecomBotId":"Bot ID (智能机器人 ID)","modal.wecomBotIdPlaceholder":"在企业微信管理后台获取","modal.wecomBotSecret":"Bot Secret (智能机器人密钥)","modal.wecomBotSecretPlaceholder":"密钥仅显示一次,妥善保存","modal.wecomGuideTitle":"企业微信智能机器人接入(WebSocket,无需公网 IP)","modal.wecomGuideStep1":'1. 登录企业微信管理后台,进入"应用管理 → 智能机器人",创建一个新机器人',"modal.wecomGuideStep2":"2. 设置机器人名称、头像,并将其加入到目标内部群组","modal.wecomGuideStep3":'3. 在"开发者接口"页面记下 Bot ID,并生成一次性的 Bot Secret(仅显示一次)',"modal.wecomGuideStep4":"4. 把 Bot ID 与 Secret 粘贴到下方保存——通道启用后会通过 WebSocket 长连接接收消息","modal.wecomGuideNote":'说明:保存时仅做格式校验,真正的鉴权发生在 WebSocket 订阅;启动后请到 dev/runtime 日志确认 "subscribed successfully"。',"modal.validationFailed":"验证失败","modal.refreshStateFailed":"保存成功,但页面状态未及时刷新,请稍后重试。","modal.cannotRead":"无法读取","modal.confirmRestart":"确认重启?","modal.restarting":"正在重启…","modal.reconnecting":"正在重新连接…","modal.restartFailed":"重启失败,请刷新页面重试","modal.restartSuccess":"重启完成","modal.restartBlockedTasks":"有 {n} 个任务正在运行,暂时无法重启。等任务结束或先停止它们再试。","modal.switching":"正在切换…","modal.workdir":"工作目录","modal.confirmRemoveWorkspace":"确定要移除此工作区吗?","modal.confirmRemoveWorkspaceHint":"移除后不会删除本地文件,你可以随时重新添加。","modal.removing":"移除中...","modal.remove":"移除","session.delete":"删除会话","session.openActions":"更多操作","session.deleteTitle":"删除会话","session.deleteHint":"删除后无法恢复,请确认。","session.deletePikiloopOnly":"仅清理 pikiloop 记录","session.deletePikiloopOnlyHint":"保留 agent CLI(Claude/Codex/Gemini)自己的会话文件,之后仍可用 agent 自身的命令继续这段对话。","session.deletePurgeNative":"同时删除 agent 原始记录","session.deletePurgeNativeHint":"连 agent CLI 的 jsonl / rollout 文件也一起删掉,彻底清除这次对话。","session.deleteRunningError":"会话还在运行中,请先停止再删除。","session.deleteFailed":"删除失败","session.deleting":"删除中..."},ye={"tab.im":"IM Access","tab.agent":"Agent Config","tab.permissions":"Permissions","tab.extensions":"Extensions","tab.system":"System","tab.config":"Configuration","tab.sessions":"Workspace","tab.automation":"Extensions","tab.plugins":"Plugins","tabDesc.im":"Manage channel connections, status, and setup.","tabDesc.agent":"Choose the default agent, model, and effort for new sessions; configure providers and credentials.","tabDesc.permissions":"Grant the macOS permissions required for screenshots.","tabDesc.extensions":"Manage browser automation.","tabDesc.sessions":"Review session history and runtime activity for each agent.","tabDesc.system":"Work directory, host overview, and system permissions.","app.systemInfo":"System Info","app.systemInfoHint":"Reusable host metrics module shared across dashboard views.","app.activeTasks":"Active Tasks","app.sessionCount":"Sessions","app.readyChannels":"Ready","app.configuredChannels":"Configured","app.missingPermissions":"Needs Access","app.defaultModel":"Default Model","sidebar.switchDir":"Switch Dir","sidebar.restart":"Restart","sidebar.notSet":"Not set","status.loading":"Loading","status.running":"Running","status.connecting":"Connecting","status.ready":"Ready","status.needsConfig":"Needs Config","config.imAccess":"IM Channels","config.aiAgent":"Agents","config.sysPerms":"System Permissions","config.general":"General","config.configured":"Configured","config.configure":"Configure","config.clickConfig":"Open setup","config.validating":"Checking","config.validationFailed":"Validation failed","config.comingSoon":"Coming Soon","config.notInstalled":"Not installed","config.defaultAgent":"Default Agent","config.defaultBadge":"Default","config.balance":"Usage status","config.balanceUnavailable":"Usage unavailable","config.balanceHealthy":"Healthy","config.balanceTight":"Low","config.limitReached":"Exhausted","usage.used":"used","usage.resets":"resets in","usage.resetElapsed":"reset · pending refresh","usage.asOf":"as of","usage.accountQuota":"Account quota","config.advantage":"Strength","config.model":"Model","config.noModel":"No selectable models","config.thinkingMode":"Reasoning level","config.noReasoningMode":"-","config.instantApply":"Changes apply immediately and are written to ~/.pikiloop/setting.json.","config.runtimeTitle":"Default Agent","config.runtimeSubtitle":"The left list only changes which agent you are inspecting. Confirm the default execution agent separately on the right. Changes are written to ~/.pikiloop/setting.json and applied to the current process immediately.","config.setDefaultAction":"Set Default","config.settingDefault":"Applying...","config.installAction":"Install","config.installingAgent":"Installing...","config.installHint":"First-time setup can install this agent directly here. pikiloop uses npm global install for this action.","config.agentInstalled":"Agent installed","config.agentInstallFailed":"Agent installation failed","config.hostStatus":"Access status","config.permissionHint":"Manage OS-level permissions here. Missing access will limit capabilities immediately.","config.channelHint":"Once connected, inbound channel messages route straight into the active runtime.","config.switchDirHint":'Use the "Switch Dir" button in the top bar for working directory changes. This page no longer saves config.',"config.applyFailed":"Failed to apply","config.loadAgentFailed":"Failed to load agent status","config.agentAdvantageClaude":"Anthropic's official coding CLI — built around Claude, durable across long tool-using sessions","config.agentAdvantageCodex":"OpenAI's terminal coding agent — strong at planning and multi-step refactors","config.agentAdvantageGemini":"Google's open-source terminal AI agent — million-token context, friendly to docs and code search","config.agentAdvantageHermes":"Bundled with pikiloop — runs on any model via ACP, swap freely between OpenRouter and third-party providers","config.authorized":"Granted","config.pendingAuth":"Needs Access","config.workdir":"Work Directory","config.workspaceHint":"Project root currently used by the live runtime.","config.workdirPlaceholder":"Leave empty for current dir","config.save":"Save Config","config.saveFailed":"Save failed","config.saved":"Config saved","perm.screenRecording":"Screen Recording","perm.screenRecordingReason":"Allows reading screen content for screenshots and UI analysis.","perm.fullDiskAccess":"Full Disk Access","perm.fullDiskAccessReason":"Allows access to protected folders such as Desktop and Downloads.","perm.fullDiskAccessManualHint":"macOS cannot show a direct consent prompt for this permission. Clicking opens the exact settings page.","perm.authorize":"Authorize","perm.waiting":"Waiting for approval","perm.settings":"Open settings","perm.alreadyGranted":"Permission already granted.","perm.promptOpened":"A system permission prompt has been triggered. Confirm it in macOS.","perm.settingsOpened":"Opened the relevant macOS settings page.","perm.settingsOpenedManual":"macOS does not provide a direct prompt for this permission. The relevant settings page has been opened.","perm.grantedNow":"Permission state updated.","perm.requestFailed":"Failed to request permission.","perm.pendingAfterPrompt":"No granted state detected yet. If no prompt appeared, complete it manually in System Settings.","perm.pendingAfterSettings":"No granted state detected yet. Finish it in System Settings and return to this page.","perm.stillPending":"Permission is still not detected. Confirm it in macOS, then refresh again.","perm.guideTitle":"What To Do","perm.guidePromptIntro":"A system permission request was attempted. Finish it with the steps below.","perm.guideSettingsIntro":"The relevant System Settings page has been opened. Finish it with the steps below.","perm.guideAllowPrompt":"If a system dialog is already visible, click Allow there first.","perm.guideOpenPathPrefix":"Open ","perm.guideGrantHostApp":"Grant access to {hostApp} (the app that started pikiloop).","perm.guideGrantHostAppFallback":"Grant access to the host app that started pikiloop, such as Terminal, iTerm, or Warp.","perm.guideToggleHostApp":"Find {hostApp} in the app list and turn the permission on manually.","perm.guideToggleHostAppFallback":"Find the host app that started pikiloop in the app list and turn the permission on manually.","perm.guideMayNeedRestart":"If macOS asks you to restart {hostApp}, do that before coming back.","perm.guideMayNeedRestartFallback":"If macOS asks you to restart the host app, do that before coming back.","perm.guideBackRefresh":'When finished, return here and click "Refresh Status" manually.',"perm.guideRefresh":"Refresh Status","perm.guideClose":"Later","perm.hostAppHint":"Grant access to {hostApp} (the host app running pikiloop)","perm.hostAppHintFallback":"Grant access to the host app running pikiloop (e.g. Terminal, iTerm)","perm.alertMissing":"not yet authorized","perm.alertHostApp":"Grant access to {hostApp} in System Settings. Click for details.","perm.alertHostAppFallback":"Grant access to the host app in System Settings. Click for details.","perm.alertAction":"Go to Settings →","perm.pathScreenRecording":"System Settings > Privacy & Security > Screen & System Audio Recording","perm.pathFullDiskAccess":"System Settings > Privacy & Security > Full Disk Access","sessions.host":"Host","sessions.cpu":"CPU","sessions.memory":"Memory","sessions.disk":"Disk","sessions.battery":"Battery","system.cpuLoad":"CPU Load","sessions.runStatus":"Runtime Status","sessions.agentSessions":"Agent Sessions","sessions.dir":"Directory","sessions.agent":"Agent","sessions.runtime":"Uptime","sessions.usage":"Tokens","sessions.noAgent":"No installed agents","sessions.noSessions":"No sessions","sessions.botNotRunning":"Bot not running. Restart after config.","sessions.loading":"Loading...","sessions.current":"Current","sessions.completed":"Completed","sessions.incomplete":"Incomplete","sessions.waiting":"Waiting","sessions.lastIssue":"Last status","sessions.prev":"Prev","sessions.next":"Next","sessions.retry":"Retry","hub.selectSession":"Select a session","hub.selectSessionHint":"Click a session card on the left to open it","hub.noMessages":"No messages yet","hub.loadingOlderTurns":"Loading earlier turns...","hub.loadOlderTurnsHint":"Scroll up to load earlier turns","hub.inputPlaceholder":"Type a message…","hub.newSession":"New Session","hub.newSessionHint":"Choose a workspace and agent, then type a prompt to start.","hub.startSession":"Start","hub.addWorkspace":"Add Workspace","hub.removeWorkspace":"Remove Workspace","hub.extensions":"Extensions","hub.workspacePath":"Workspace path","hub.workspaceName":"Workspace name (optional)","hub.add":"Add","hub.cancel":"Cancel","hub.user":"Your prompt","hub.thinking":"Thinking","hub.toolUse":"Tool call","hub.toolResult":"Tool result","hub.turnN":"Turn {n}","hub.noWorkspaces":"No workspaces yet. Add one to get started.","hub.allWorkspaces":"All Workspaces","hub.activity":"Activity","hub.imagePrompt":"Image prompt","hub.imagePromptShow":"Show full prompt","hub.imagePromptHide":"Hide prompt","hub.systemNotice":"Agent notice","hub.streamFailed":"Turn ended without a reply","hub.streamErrored":"Turn ended with an error","hub.turnFailed":"Turn did not complete","hub.turnStopped":"Stopped","hub.process":"Process","hub.processNotes":"Notes","hub.output":"Output","hub.subAgent":"Sub-agent","hub.subAgentWaiting":"Waiting for the first sub-agent tool call…","hub.send":"Send","hub.sending":"Sending…","hub.recall":"Recall","hub.steer":"Steer","hub.queued":"Queued","hub.running":"Running","hub.stop":"Stop","hub.stopHint":"Stop the running task","hub.selectAgent":"Select Agent","hub.selectModel":"Select Model","hub.selectEffort":"Effort","hub.modelGroupNative":"Native","hub.modelGroupProfiles":"My Models","hub.skills":"Skills","hub.noSkills":"No skills available","hub.sendHint":"Send message to this session","hub.recallHint":"Recall queued message","hub.steerHint":"Interrupt current task, run this next","hub.queuePosition":"Queue position: {n}","hub.copy":"Copy","hub.copied":"Copied","hub.copyImage":"Copy image","hub.rerun":"Re-run","hub.edit":"Edit","hub.expand":"Show all ({chars} chars · {lines} lines)","hub.collapse":"Collapse","hub.fork":"Fork from here","hub.forkPromptTitle":"Start a new branch from this message","hub.forkPromptHint":"The branch inherits the parent session’s full history; your input below becomes the first turn of the new session.","hub.forkPromptPlaceholder":"e.g. try a different approach starting from here…","hub.forkSubmitting":"Forking…","hub.forkSubmit":"Create branch","hub.forkBadge":"Forked from","hub.forkBadgeAt":"turn {turn}","hub.forkChildren":"Branches","hub.forkUnsupported":"This agent does not support fork","hub.addImages":"Add images","hub.removeImage":"Remove image","hub.previewImage":"Preview image","hub.search":"Search…","hub.filterAll":"All","hub.filterRunning":"Running","hub.filterReview":"Review","hub.showMore":"Show more","hub.nMore":"{n} more","hub.workspace":"Workspace","hub.result":"Result","hub.plan":"Plan","hub.planProgress":"{done} out of {total} tasks completed","hub.planDone":"Completed","hub.planInProgress":"In progress","hub.summary":"Summary","hub.nextAction":"Next action","hub.noSummary":"No summary yet","hub.noNextAction":"No suggested next step","hub.continueTask":"Continue the unfinished task","hub.status":"Status","hub.outcome":"Type","hub.statusInbox":"Inbox","hub.statusActive":"Active","hub.statusReview":"Review","hub.statusDone":"Done","hub.statusParked":"Parked","hub.outcomeAnswer":"Answer","hub.outcomeProposal":"Proposal","hub.outcomeImplementation":"Implementation","hub.outcomePartial":"Partial","hub.outcomeBlocked":"Blocked","hub.outcomeConversation":"Conversation","hub.lastUpdated":"Updated","hub.turns":"Turns","hub.linked":"Linked","hub.note":"Note","hub.notePlaceholder":"Leave a note for this session…","hub.saveNote":"Save note","hub.savedNote":"Note saved","hub.statusSaved":"Status updated","hub.actions":"Actions","hub.open":"Open","hub.openWorkspace":"Open workspace","hub.openProject":"Open project","hub.openWorkspaceWith":"Open workspace in {target}","hub.openProjectWith":"Open project in {target}","hub.openWithTarget":"Open in {target}","hub.openMethod":"Open with","hub.openTargetCursor":"Cursor","hub.openTargetVsCode":"VS Code","hub.openTargetWindsurf":"Windsurf","hub.openTargetFinder":"Finder","hub.openTargetDefault":"System default","hub.artifacts":"Artifacts","hub.projectFiles":"Project files","hub.projectPath":"Project path","hub.projectFilesHint":"This session has not created its own output folder yet, so you are seeing the full project directory here.","hub.workspaceVsProjectHint":"Workspace = this session’s dedicated output folder; project = the original code directory.","hub.live":"Live","hub.changes":"Changes","hub.files":"Files","hub.noChanges":"No changes yet","hub.noFiles":"No files","hub.modified":"Modified","hub.added":"Added","hub.read":"Read","hub.deleted":"Deleted","hub.openDiff":"View diff","hub.layout1":"Single","hub.layout2":"Dual","hub.layout3":"Triple","hub.layout6":"Six","hub.emptySlot":"Click a session to fill","hub.closePanel":"Close","hub.detailPanel":"Detail Panel","hub.minimizePanel":"Minimize","hub.restorePanel":"Restore Panel","plugins.title":"Plugin Center","plugins.customSkills":"Custom Skills","plugins.mcp":"MCP Protocol","plugins.service":"Services","plugins.comingSoon":"Coming Soon","ext.title":"Browser Automation","ext.hint":"Provide browser automation for agent sessions. Browser automation is off by default and only uses pikiloop’s dedicated profile when enabled. On macOS, use open, osascript, and screencapture directly for basic main-browser actions.","ext.browser":"Managed Browser","ext.browserDesc":"Browser mode changes take effect on the next session.","ext.browserDescEnabled":"When enabled, pikiloop injects managed-profile browser automation tools and reuses that profile’s login state.","ext.browserDescDisabled":"Disabled by default. No browser MCP server is injected; use native macOS commands directly when you need to operate the main browser.","ext.browserDescCdp":"Default mode. Attach to your everyday browser over CDP and reuse its tabs and login state.","ext.browserDescProfile":"Optional mode. Run automation in a dedicated Chrome profile so it stays isolated from your everyday browsing.","ext.browserModeCdp":"CDP Main Browser","ext.browserProfileMode":"Dedicated profile","ext.browserModeProfile":"Dedicated profile","ext.enabled":"Enabled","ext.disabled":"Disabled","ext.cdpReady":"CDP connected","ext.cdpWaiting":"Waiting for main browser","ext.chromeInstalled":"Chrome installed","ext.profileCreated":"Profile created","ext.needsSetup":"Needs setup","ext.browserReady":"Browser ready","ext.browserRemote":"Remote CDP","ext.browserRemoteStep":"Attached to external Chrome over CDP","ext.browserRemoteStepDesc":"PIKILOOP_BROWSER_CDP_URL is set, so pikiloop never launches or manages a local browser. Sign in to the sites you need from the Chrome that owns this endpoint (e.g. your sidecar container’s web VNC).","ext.saveBrowserRemote":"Save","ext.browserOpen":"Browser open","ext.setup":"Setup","ext.setupBrowser":"Setup Browser Automation","ext.setupBrowserDesc":"Browser automation is disabled by default. When enabled, pikiloop only uses the managed profile browser; main-browser actions are no longer wrapped.","ext.step1Title":"1. Dedicated profile directory","ext.step1Desc":"pikiloop will create an isolated Chrome profile directory separate from your everyday browser profile.","ext.step1Action":"Create profile","ext.step2Title":"2. Launch browser and sign in","ext.step2Desc":"Open the dedicated browser, then sign in to any accounts your tasks need.","ext.step2Action":"Launch browser","ext.browserDisabledStepTitle":"When disabled","ext.browserDisabledHint":"No browser MCP server is injected. Use open, osascript, and screencapture directly for macOS main-browser actions.","ext.browserEnableToggle":"Enable browser automation","ext.browserEnableToggleDesc":"When enabled, future agent sessions receive the managed-profile browser MCP. When disabled, no browser MCP is injected.","ext.cdpStepTitle":"Main browser requirement","ext.cdpStepDesc":"Expose a CDP endpoint from your everyday Chrome, then pikiloop will attach to it directly:","ext.useProfileToggle":"Enable use-profile dedicated browser mode","ext.useProfileToggleDesc":"When disabled, pikiloop uses CDP to connect to your main browser. When enabled, it switches to the current dedicated-profile flow and launches a separate browser that reuses that profile state.","ext.cdpModeDesc":"CDP mode reuses your main browser context directly. It is closer to your everyday browsing, but it also shares real tabs, cookies, and login state. CDP endpoint:","ext.profileModeDesc":"use-profile mode keeps automation in pikiloop’s dedicated browser directory. It is more isolated and better suited to a long-lived reusable automation profile.","ext.pendingModeChange":"Unsaved mode change","ext.cdpEndpoint":"CDP endpoint","ext.copyPath":"Copy path","ext.step2Copied":"Path copied","ext.step3Title":"3. Start using it","ext.step3Desc":"Once sign-in is complete, you can start running browser tasks. If the setup browser is still open, pikiloop will close it automatically before automation starts.","ext.profileDir":"Profile directory","ext.launching":"Launching...","ext.browserLaunched":"Browser open","ext.browserLaunchFailed":"Browser setup failed","ext.browserModeSaveFailed":"Failed to save browser settings","ext.browserDisabledSaved":"Browser automation disabled","ext.browserEnabledLaunched":"Browser automation enabled and browser opened","ext.saveBrowserDisabled":"Save disabled state","ext.enableAndLaunchBrowser":"Enable & launch browser","ext.saveCdpMode":"Save CDP mode","ext.saveAndLaunchBrowser":"Save & launch browser","ext.cdpModeSaved":"Switched to CDP main browser mode","ext.profileModeLaunched":"Switched to dedicated profile mode and opened the browser","ext.running":"Running","ext.notInstalled":"Not installed","ext.disable":"Disable","ext.disabling":"Disabling...","modal.configureTelegram":"Configure Telegram","modal.configureFeishu":"Configure Feishu","modal.configureWeixin":"Configure Weixin","modal.switchWorkdir":"Switch Work Directory","modal.botToken":"Bot Token","modal.pasteToken":"Paste token from BotFather","modal.validateSave":"Validate & Save","modal.validating":"Validating...","modal.cancel":"Cancel","modal.save":"Save","modal.allowedIds":"Allowed Chat IDs","modal.optional":"optional","modal.commaSep":"comma separated","modal.appId":"App ID","modal.appSecret":"App Secret","modal.feishuPlaceholder":"Feishu Open Platform App ID","modal.tgGuideTitle":"Setup Steps","modal.tgGuideStep1":"1. Search for @BotFather in Telegram and start a chat","modal.tgGuideStep2":"2. Send /newbot, then set a display name and username as prompted","modal.tgGuideStep3":"3. BotFather will reply with a Bot Token — copy and paste it below","modal.tgGuideStep4":"4. (Optional) Fill in Allowed Chat IDs to restrict which chats can use the bot","modal.tgGuideIdTip":"To get your Chat ID: message @userinfobot for your user ID. Group IDs are negative — add @RawDataBot to a group to find its ID.","modal.feishuGuideTitle":"Setup Steps","modal.feishuGuideStep1":"1. Go to Feishu Open Platform (open.feishu.cn) → Create an app","modal.feishuGuideStep2":'2. Go to "Credentials & Basic Info", copy the App ID and App Secret',"modal.feishuGuideStep3":'3. Go to "App Features" → Enable the "Bot" capability',"modal.feishuGuideStep4":'4. Go to "Permissions", add these scopes, then publish a version:',"modal.feishuGuidePerms":"im:message · im:message:send_as_bot · im:resource · im:chat","modal.feishuGuideStep5":"5. (Optional) Add the cardkit:card scope for streaming typewriter effect — the bot works fine without it","modal.feishuGuideStep6":'6. Go to "Events & Callbacks" → Select WebSocket mode (no public URL needed)',"modal.feishuGuideStep7":"7. Create a version and publish the app, then add the bot to a group chat","modal.feishuGuideCardKitTip":"CardKit errors in logs are normal fallback behavior and do not affect functionality. Add the cardkit:card scope and re-publish if you want streaming.","modal.weixinBaseUrl":"Weixin Base URL","modal.weixinDefaultBaseUrlHint":"Use the default unless Tencent gave you a different endpoint.","modal.weixinGenerateQr":"Generate QR","modal.weixinGeneratingQr":"Generating...","modal.weixinWaitingScan":"Waiting for scan","modal.weixinScanned":"Scanned, waiting for confirmation","modal.weixinQrRefreshed":"QR code refreshed. Please scan again.","modal.weixinLoginSuccess":"Weixin connected. Validating configuration...","modal.weixinSaved":"Weixin config saved","modal.weixinScanHint":"Generate the QR code here, scan it in Weixin, and confirm on your phone. The channel is only enabled after validation succeeds.","modal.weixinQrAlt":"Weixin login QR code","modal.weixinRetry":"Regenerate","modal.inputWeixinBaseUrl":"Please enter the base URL","modal.networkError":"Network error","modal.requestTimeout":"Request timed out. Please retry.","modal.emptyDir":"Empty directory","modal.selectDir":"Select Directory","modal.manualInput":"Or type path manually","modal.recentConv":"Recent Conversation","modal.loadingConv":"Loading conversation...","modal.noConv":"No conversation records","modal.loadFailed":"Load failed","modal.createdAt":"Created","modal.status":"Status","modal.ended":"Ended","modal.inputToken":"Please enter token","modal.inputAppId":"Please enter App ID","modal.selectDirFirst":"Please select a directory","modal.switchedTo":"Switched to ","modal.switchFailed":"Switch failed","modal.tgSaved":"Telegram config saved","modal.feishuSaved":"Feishu config saved","modal.slackSaved":"Slack config saved","modal.discordSaved":"Discord config saved","modal.dingtalkSaved":"DingTalk config saved","modal.wecomSaved":"WeChat Work config saved","modal.fieldRequired":"is required","modal.credentialsVerified":"credentials verified","modal.configureSlack":"Configure Slack","modal.slackBotToken":"Bot Token (xoxb-...)","modal.slackBotTokenPlaceholder":"xoxb-1234567890-abc...","modal.slackAppToken":"App-Level Token (xapp-...)","modal.slackAppTokenPlaceholder":"xapp-1-A...","modal.slackGuideTitle":"Slack setup (no public IP needed)","modal.slackGuideStep1":"1. Open api.slack.com/apps → Create New App → From scratch, pick the workspace","modal.slackGuideStep2":"2. Open Socket Mode, enable it, and generate an App-Level Token with the connections:write scope","modal.slackGuideStep3":"3. Open OAuth & Permissions, add Bot Token scopes: app_mentions:read, chat:write, im:history, im:read, im:write, users:read","modal.slackGuideStep4":"4. Open Event Subscriptions (no public URL needed in Socket Mode), subscribe to message.im and app_mention","modal.slackGuideStep5":"5. Install the app to the workspace, then paste the Bot User OAuth Token (xoxb-) and App-Level Token (xapp-) below","modal.configureDiscord":"Configure Discord","modal.discordBotToken":"Bot Token","modal.discordBotTokenPlaceholder":"MTA...","modal.discordGuideTitle":"Discord setup (no public IP needed)","modal.discordGuideStep1":"1. Open discord.com/developers/applications and create a New Application","modal.discordGuideStep2":'2. Go to Bot → Add Bot, copy the token; you MUST enable "Message Content Intent" or the bot cannot read messages',"modal.discordGuideStep3":"3. Go to OAuth2 → URL Generator, scope = bot + applications.commands; permissions = at least Send Messages and Read Message History","modal.discordGuideStep4":"4. Use the generated URL to invite the bot to a test server","modal.discordGuideStep5":"5. Paste the Bot Token below, validate, and save","modal.configureDingtalk":"Configure DingTalk","modal.dingtalkClientId":"Client ID (AppKey)","modal.dingtalkClientIdPlaceholder":"dingxxxxxxxxxxxxxxxx","modal.dingtalkClientSecret":"Client Secret (AppSecret)","modal.dingtalkClientSecretPlaceholder":"app secret","modal.dingtalkGuideTitle":"DingTalk setup (Stream Mode, no public IP needed)","modal.dingtalkGuideStep1":"1. Open open-dev.dingtalk.com and create an internal or chatbot app","modal.dingtalkGuideStep2":'2. Open "Credentials & Basic Info", copy Client ID (AppKey) and Client Secret (AppSecret)',"modal.dingtalkGuideStep3":'3. Open "App Features → Chatbot" and enable the chatbot capability',"modal.dingtalkGuideStep4":'4. Open "Event Subscription" → choose Stream Mode (no public URL needed), subscribe to chatbot message events',"modal.dingtalkGuideStep5":"5. Publish a version, add the bot to a group, then paste Client ID and Client Secret below","modal.configureWeCom":"Configure WeChat Work","modal.wecomBotId":"Bot ID (Smart Bot)","modal.wecomBotIdPlaceholder":"from WeCom admin console","modal.wecomBotSecret":"Bot Secret (Smart Bot)","modal.wecomBotSecretPlaceholder":"shown only once — keep it safe","modal.wecomGuideTitle":"WeChat Work Smart Bot (WebSocket, no public IP needed)","modal.wecomGuideStep1":'1. Sign in to the WeChat Work admin console → "App Management → Smart Bot", create a new bot',"modal.wecomGuideStep2":"2. Set the bot name and avatar, and add it to the target internal group(s)","modal.wecomGuideStep3":'3. On the "Developer interface" page, note the Bot ID and generate a one-time Bot Secret (shown only once)',"modal.wecomGuideStep4":"4. Paste Bot ID and Secret below — once enabled, the channel keeps a WebSocket long-connection open to receive messages","modal.wecomGuideNote":'Note: only the format is checked when saving. The real auth happens during the WebSocket subscribe — watch dev/runtime logs for "subscribed successfully" after enabling.',"modal.validationFailed":"Validation failed","modal.refreshStateFailed":"Saved, but the page state did not refresh in time. Please retry.","modal.cannotRead":"Cannot read","modal.confirmRestart":"Confirm restart?","modal.restarting":"Restarting…","modal.reconnecting":"Reconnecting…","modal.restartFailed":"Restart failed. Please refresh the page.","modal.restartSuccess":"Restart complete","modal.restartBlockedTasks":"{n} task(s) still running — can't restart yet. Wait for them to finish or stop them, then retry.","modal.switching":"Switching…","modal.workdir":"Work Directory","modal.confirmRemoveWorkspace":"Remove this workspace?","modal.confirmRemoveWorkspaceHint":"This won't delete any local files. You can re-add it anytime.","modal.removing":"Removing...","modal.remove":"Remove","session.delete":"Delete session","session.openActions":"More actions","session.deleteTitle":"Delete session","session.deleteHint":"This cannot be undone.","session.deletePikiloopOnly":"Pikiloop record only","session.deletePikiloopOnlyHint":"Keep the agent CLI's own transcript (Claude/Codex/Gemini) so you can still resume from outside pikiloop.","session.deletePurgeNative":"Also delete agent transcript","session.deletePurgeNativeHint":"Remove the underlying jsonl / rollout file too. The conversation is fully gone.","session.deleteRunningError":"Session is still running. Stop it first.","session.deleteFailed":"Delete failed","session.deleting":"Deleting..."},U={"zh-CN":e=>_[e]||e,en:e=>ye[e]||_[e]||e};function Y(e){return U[e]||U["zh-CN"]}const Ae=15e3;function Ce(e,t){if(!e)return{badgeVariant:"muted",badgeContent:t("status.loading"),dotVariant:"warn",dotPulse:!0};if(e.ready&&e.bot?.connected)return{badgeVariant:"ok",badgeContent:t("status.running"),dotVariant:"ok",dotPulse:!0};if(e.ready&&e.bot)return{badgeVariant:"warn",badgeContent:t("status.connecting"),dotVariant:"warn",dotPulse:!0};if(e.ready)return{badgeVariant:"accent",badgeContent:t("status.ready"),dotVariant:"ok",dotPulse:!1};const o=!!e.configExists&&!!e.bot&&e.bot.uptime<Ae,s=Q(e.setupState?.channels||null);return o||s?{badgeVariant:"muted",badgeContent:t("status.loading"),dotVariant:"warn",dotPulse:!0}:{badgeVariant:"warn",badgeContent:t("status.needsConfig"),dotVariant:"warn",dotPulse:!0}}const $=[{key:"sessions",labelKey:"tab.sessions",descriptionKey:"tabDesc.sessions"},{key:"im",labelKey:"tab.im",descriptionKey:"tabDesc.im"},{key:"agents",labelKey:"tab.agent",descriptionKey:"tabDesc.agent"},{key:"extensions",labelKey:"tab.extensions",descriptionKey:"tabDesc.extensions"},{key:"system",labelKey:"tab.system",descriptionKey:"tabDesc.system"}];function De(e){return $.map(t=>({key:t.key,label:e(t.labelKey)}))}function Te(e,t){const o=$.find(s=>s.key===e);return o?{title:t(o.labelKey),description:t(o.descriptionKey)}:{title:e,description:""}}function G(e){const{base:t="",variants:o}=e,s=e.defaults??{},a=(i={})=>{const r=[];t&&r.push(t);for(const l of Object.keys(o)){const c=i[l],h=c===!1||c===null||c===void 0?s[l]:String(c);if(!h)continue;const f=o[l][h];f&&r.push(f)}return i.className&&r.push(i.className),r.filter(Boolean).join(" ")};return a.variants=o,a}const fo={claude:["anthropic","openai-compatible"],codex:["openai","openai-compatible"],gemini:["google"],hermes:["anthropic","openai","openai-compatible","google"]};function bo(e){return e<1024?e+"B":e<1048576?(e/1024).toFixed(0)+"KB":e<1073741824?(e/1048576).toFixed(1)+"MB":e<1099511627776?(e/1073741824).toFixed(1)+"GB":(e/1099511627776).toFixed(1)+"TB"}function xo(e){return e?new Date(e).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}function wo(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),o=Math.floor(t/1e3);if(o<60)return"<1m";const s=Math.floor(o/60);if(s<60)return s+"m";const a=Math.floor(s/60);return a<24?a+"h":Math.floor(a/24)+"d"}function b(...e){return e.filter(Boolean).join(" ")}const Pe={label:"?",shortLabel:"?",color:"#94a3b8",bg:"rgba(148,163,184,0.1)",letter:"?",glow:"rgba(148,163,184,0.16)",border:"rgba(148,163,184,0.18)",advantageKey:""},Ie={claude:{label:"Claude Code",shortLabel:"Claude",color:"#b4c6ff",bg:"rgba(180,198,255,0.12)",letter:"C",glow:"rgba(180,198,255,0.2)",border:"rgba(180,198,255,0.2)",advantageKey:"config.agentAdvantageClaude"},codex:{label:"Codex",shortLabel:"Codex",color:"#7dd3fc",bg:"rgba(125,211,252,0.12)",letter:"O",glow:"rgba(125,211,252,0.2)",border:"rgba(125,211,252,0.2)",advantageKey:"config.agentAdvantageCodex"},gemini:{label:"Gemini CLI",shortLabel:"Gemini",color:"#c4b5fd",bg:"rgba(196,181,253,0.12)",letter:"G",glow:"rgba(196,181,253,0.2)",border:"rgba(196,181,253,0.2)",advantageKey:"config.agentAdvantageGemini"},hermes:{label:"Hermes",shortLabel:"Hermes",color:"#fbbf24",bg:"rgba(251,191,36,0.12)",letter:"H",glow:"rgba(251,191,36,0.2)",border:"rgba(251,191,36,0.2)",advantageKey:"config.agentAdvantageHermes"}};function Re(e){return Ie[e]||{...Pe,label:e,shortLabel:e}}const vo={claude:["low","medium","high","xhigh","max","ultra"],codex:["low","medium","high","xhigh"],gemini:["low","high"],hermes:["low","medium","high","xhigh"]};function ko(e,t,o){return e==="claude"&&o?"ultra":t||""}function So(e){let t=e;return t=t.replace(/-\d{8,}$/,""),t=t.replace(/-(preview|latest|exp)$/,""),t=t.replace(/^(claude-|gemini-|gpt-)/,""),t}function Ne(e){return e.running||e.runState==="running"?"running":e.awaiting?"waiting":e.runState==="incomplete"?"incomplete":"completed"}function je(e){const t=e.indexOf(":");if(t<=0)return null;const o=e.slice(0,t).trim(),s=e.slice(t+1).trim();return!o||!s?null:{agent:o,sessionId:s}}function yo(e,t){if(!t||typeof t!="object")return null;const o=typeof t.phase=="string"?t.phase.trim():"";if(o!=="queued"&&o!=="streaming"&&o!=="done")return null;const s=je(e);if(!s)return null;const a=typeof t.sessionId=="string"&&t.sessionId.trim()?t.sessionId.trim():null,i=typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:Date.now(),r=typeof t.error=="string"&&t.error.trim()?t.error.trim():null,l=a?`${s.agent}:${a}`:e;return{key:e,resolvedKey:l,phase:o,sessionId:a,updatedAt:i,incomplete:!!t.incomplete||!!r,error:r}}const Me=2e3;function Ao(e,t){if(!t)return e;if(t.phase==="done"&&(e.running||e.runState==="running")){const s=e.runUpdatedAt?Date.parse(e.runUpdatedAt):NaN;if(Number.isFinite(s)&&t.updatedAt-s<=Me)return e}const o=t.phase==="done"?t.incomplete?"incomplete":"completed":"running";return{...e,running:o==="running",runState:o,runUpdatedAt:new Date(t.updatedAt).toISOString(),runDetail:o==="running"?null:t.error||e.runDetail||null}}function Le(e){return String(e.runDetail||"").trim()||null}function Co(e,t){const o=Le(e);return!o||Ne(e)!=="incomplete"||t.streaming||t.hasLiveStream||t.streamPhase||t.queuedTaskCount>0?null:o}const Be=[/^\[Request interrupted by user(?: for tool use)?\]$/i],Ee=/\[Image:[^\]]+\]/gi,Oe=/\[Attached file:[^\]]+\]/gi,Ge=/(^|\s)@(\/[^\s@\n]+\.(?:png|jpe?g|gif|webp|svg))(?=\s|$)/gi;function j(e){return String(e||"").replace(Ee," ").replace(Oe," ").replace(Ge," ").replace(/\s+/g," ").trim()}function H(e){for(const t of String(e||"").split(`
3
+ `)){const o=j(t).replace(/^[#>*\-\s`]+/,"").trim();if(o)return o}return""}function Fe(e){const t=j(e);return!t||Be.some(o=>o.test(t))?"":t}function Do(e){return j(e.title)||Fe(e.lastQuestion)||e.sessionId}function To(e,t){const o=j(e.title);if(o&&o!==t)return o;const s=H(e.classification?.summary);if(s&&s!==t)return s;const a=H(e.lastAnswer);if(a&&a!==t)return a;const i=j(e.runDetail);return i&&!/interrupted by user/i.test(i)&&i!==t?i:""}const We=G({base:["rounded-lg border bg-[var(--surface-2)]","transition-[border-color,background,transform,box-shadow]"].join(" "),variants:{elevation:{flat:"border-[var(--edge-subtle)] shadow-none",raised:"border-[var(--edge-default)] shadow-[0_1px_0_rgba(255,255,255,0.02),0_4px_12px_rgba(2,6,23,0.06)]",modal:"border-[var(--edge-strong)] shadow-[0_24px_64px_rgba(2,6,23,0.24)]"},tone:{default:"bg-[var(--surface-2)]",inset:"bg-[var(--surface-1)]"},padding:{none:"",sm:"p-2.5",md:"p-4",lg:"p-5"},interactive:{true:"cursor-pointer hover:border-[var(--edge-strong)] hover:bg-[var(--surface-3)]",false:""}},defaults:{elevation:"flat",tone:"default",padding:"none"}}),Po=u.forwardRef(function({children:t,className:o,elevation:s,tone:a,padding:i,interactive:r,streaming:l,glow:c,...h},f){const m=s??"raised",p=i??"sm";return n.jsx("div",{ref:f,"data-streaming":l?"true":void 0,className:b(We({elevation:m,tone:a,padding:p,interactive:r?"true":void 0,className:o}),l&&"ambient-glow",c&&"card-glow"),style:{transitionDuration:"240ms"},...h,children:t})}),_e={ok:{borderColor:"var(--th-badge-ok-border)",backgroundColor:"var(--th-badge-ok-bg)",color:"var(--th-badge-ok-text)"},warn:{borderColor:"var(--th-badge-warn-border)",backgroundColor:"var(--th-badge-warn-bg)",color:"var(--th-badge-warn-text)"},err:{borderColor:"var(--th-badge-err-border)",backgroundColor:"var(--th-badge-err-bg)",color:"var(--th-badge-err-text)"},info:{borderColor:"var(--th-badge-info-border)",backgroundColor:"var(--th-badge-info-bg)",color:"var(--th-badge-info-text)"},running:{borderColor:"var(--th-badge-running-border)",backgroundColor:"var(--th-badge-running-bg)",color:"var(--th-badge-running-text)"},accent:{borderColor:"var(--th-badge-accent-border)",backgroundColor:"var(--th-badge-accent-bg)",color:"var(--th-badge-accent-text)"},muted:{borderColor:"var(--th-badge-muted-border)",backgroundColor:"var(--th-badge-muted-bg)",color:"var(--th-badge-muted-text)"}},Ue={xs:"h-[18px] px-1.5 text-[10px]",sm:"h-5 px-2 text-[11px]"},Io=u.forwardRef(function({tone:t,variant:o,size:s="sm",children:a,className:i,style:r,...l},c){const h=t??o??"muted";return n.jsx("span",{ref:c,style:{..._e[h],...r},className:b("inline-flex items-center gap-1 rounded-md border font-medium tracking-[0.01em]",Ue[s],i),...l,children:a})}),He={ok:"bg-[var(--th-ok)] shadow-[0_0_10px_var(--th-ok-glow)]",warn:"bg-[var(--th-warn)] shadow-[0_0_10px_var(--th-warn-glow)]",err:"bg-[var(--th-err)] shadow-[0_0_10px_var(--th-err-glow)]",info:"bg-[var(--th-info)] shadow-[0_0_10px_var(--th-info-glow)]",running:"bg-[var(--th-running)] shadow-[0_0_10px_var(--th-running-glow)]",idle:"bg-fg-5"};function ee({tone:e,variant:t,pulse:o,className:s}){const a=e??t??"idle";return n.jsx("span",{className:b("h-1.5 w-1.5 shrink-0 rounded-full",He[a],o&&"animate-pulse-soft",s)})}function Ro({children:e,className:t}){return n.jsx("span",{className:b("rounded-md border border-[var(--edge-subtle)] bg-[var(--surface-2)] px-1.5 py-0.5","text-[10px] font-mono text-fg-5",t),children:e})}const ze=G({base:["inline-flex items-center justify-center gap-2 whitespace-nowrap","font-medium select-none","transition-[background,color,border-color,box-shadow,transform]","focus-visible:outline-none","focus-visible:shadow-[0_0_0_3px_var(--brand-glow-a)]","disabled:pointer-events-none disabled:opacity-50"].join(" "),variants:{tone:{primary:["border border-transparent","bg-[var(--brand-accent)] text-[var(--brand-accent-fg)]","hover:opacity-90"].join(" "),secondary:["border border-[var(--edge-default)] bg-transparent text-fg-2","hover:border-[var(--edge-strong)] hover:bg-[var(--surface-3)] hover:text-fg"].join(" "),ghost:["border border-transparent bg-transparent text-fg-4","hover:bg-[var(--surface-2)] hover:text-fg-2"].join(" "),danger:["border border-[var(--edge-default)] bg-transparent text-[var(--th-err)]","hover:bg-[color-mix(in_oklab,var(--th-err)_8%,transparent)] hover:border-[color-mix(in_oklab,var(--th-err)_45%,transparent)]"].join(" ")},size:{sm:"h-7 text-[11px]",md:"h-8 text-[13px]",lg:"h-9 text-[14px]"},shape:{rect:"rounded-md",icon:"rounded-md",pill:"rounded-full"}},defaults:{tone:"secondary",size:"md",shape:"rect"}});function Ve(e,t){return t==="icon"?e==="sm"?"w-7 p-0":e==="lg"?"w-9 p-0":"w-8 p-0":e==="sm"?"px-2.5":e==="lg"?"px-4":"px-3"}const Ke={primary:"primary",secondary:"secondary",outline:"secondary",ghost:"ghost",danger:"danger"};function qe(e,t){return e==="icon"?{size:"md",shape:"icon"}:e==="default"?{size:"md",shape:t??"rect"}:{size:e??"md",shape:t??"rect"}}const O=u.forwardRef(function({tone:t,size:o,shape:s,variant:a,leading:i,trailing:r,className:l,type:c="button",children:h,...f},m){const p=t??(a?Ke[a]:"secondary"),{size:g,shape:v}=qe(o,s);return n.jsxs("button",{ref:m,type:c,className:b(ze({tone:p,size:g,shape:v,className:l}),Ve(g,v)),style:{transitionDuration:"180ms"},...f,children:[i,h,r]})}),Qe=G({base:["flex w-full text-fg outline-none","border rounded-md","transition-[border-color,box-shadow,background]","placeholder:text-fg-5","focus:shadow-[0_0_0_3px_var(--brand-glow-a)]","disabled:cursor-not-allowed disabled:bg-[var(--surface-2)] disabled:border-[var(--edge-subtle)] disabled:text-fg-5","disabled:shadow-none disabled:hover:border-[var(--edge-subtle)] disabled:placeholder:text-fg-6"].join(" "),variants:{size:{sm:"h-7 px-2 py-1 text-[12px]",md:"h-9 px-3 py-1.5 text-[13px]",lg:"h-10 px-3 py-2 text-[14px]"},tone:{default:["bg-transparent border-[var(--edge-default)]","hover:border-[var(--edge-strong)]","focus:border-[var(--edge-strong)] focus:bg-[var(--surface-2)]"].join(" "),inset:["bg-[var(--surface-2)] border-[var(--edge-default)]","hover:border-[var(--edge-strong)]","focus:border-[var(--edge-strong)] focus:bg-[var(--surface-3)]"].join(" ")}},defaults:{size:"md",tone:"default"}}),No=u.forwardRef(function({className:t,size:o,tone:s,...a},i){return n.jsx("input",{ref:i,className:b(Qe({size:o,tone:s,className:t})),style:{transitionDuration:"180ms"},...a})});function jo({children:e,htmlFor:t,className:o}){return n.jsx("label",{htmlFor:t,className:b("mb-2 block text-sm font-medium text-fg-3",o),children:e})}function Je({children:e,className:t}){return n.jsx("div",{className:b("inline-flex items-center rounded-lg border border-edge bg-panel p-1 shadow-[inset_0_1px_0_rgba(255,255,255,0.02)]",t),children:e})}function Mo({active:e,children:t,className:o,...s}){return n.jsx("button",{type:"button",className:b("inline-flex h-8 items-center justify-center rounded-md px-3 text-sm font-medium transition-colors duration-200","focus-visible:outline-none focus-visible:shadow-[0_0_0_4px_var(--th-glow-a)]",e?"bg-panel-h text-fg shadow-[0_1px_0_rgba(255,255,255,0.03)]":"text-fg-4 hover:bg-panel-alt hover:text-fg-2",o),...s,children:t})}const Ze=340;function Xe({content:e,side:t="bottom",delayMs:o=120,onShow:s,children:a,className:i,...r}){const l=u.useRef(null),c=u.useRef(null),[h,f]=u.useState(null);u.useEffect(()=>()=>{c.current!=null&&window.clearTimeout(c.current)},[]);const m=()=>{c.current!=null&&(window.clearTimeout(c.current),c.current=null),f(null)},p=()=>{c.current!=null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{c.current=null;const g=l.current?.getBoundingClientRect();g&&(f({left:Math.max(8,Math.min(g.left,window.innerWidth-Ze-8)),...t==="top"?{bottom:window.innerHeight-g.top+6}:{top:g.bottom+6}}),s?.())},o)};return n.jsxs("span",{...r,ref:l,className:b("inline-flex",i),onMouseEnter:p,onMouseLeave:m,onMouseDown:m,children:[a,h&&e!=null&&le.createPortal(n.jsx("div",{className:"pointer-events-none fixed z-[240] max-w-[340px] whitespace-pre-line rounded-lg border border-edge/40 bg-[var(--th-dropdown)] px-2.5 py-1.5 text-[11px] leading-relaxed text-fg-3 shadow-lg backdrop-blur-xl animate-in",style:{left:h.left,top:h.top,bottom:h.bottom},children:e}),document.body)]})}function Lo({children:e}){return n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-fg-5",children:e})}function Bo({className:e}){return n.jsx("div",{className:b("animate-shimmer rounded-md",e)})}function Ye({className:e}){return n.jsxs("svg",{className:b("h-3 w-3 animate-spin",e),viewBox:"0 0 16 16",fill:"none",children:[n.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.25"}),n.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function $e({items:e}){return n.jsx("div",{className:"fixed bottom-6 right-6 z-200 flex max-w-sm flex-col gap-2",children:e.map(t=>n.jsx("div",{className:b("animate-in rounded-lg border px-4 py-3 text-sm font-medium shadow-[0_20px_48px_rgba(2,6,23,0.28)] backdrop-blur-xl",t.ok?"border-emerald-500/20 bg-emerald-500/10 text-emerald-200":"border-red-500/20 bg-red-500/10 text-red-200"),children:t.message},t.id))})}const et={running:"running",ok:"ok",warn:"warn",err:"err",info:"info",idle:"idle"},tt={running:"text-[var(--th-badge-running-text)]",ok:"text-[var(--th-badge-ok-text)]",warn:"text-[var(--th-badge-warn-text)]",err:"text-[var(--th-badge-err-text)]",info:"text-[var(--th-badge-info-text)]",idle:"text-fg-4"},ot={running:"bg-[var(--th-badge-running-bg)] border-[var(--th-badge-running-border)]",ok:"bg-[var(--th-badge-ok-bg)] border-[var(--th-badge-ok-border)]",warn:"bg-[var(--th-badge-warn-bg)] border-[var(--th-badge-warn-border)]",err:"bg-[var(--th-badge-err-bg)] border-[var(--th-badge-err-border)]",info:"bg-[var(--th-badge-info-bg)] border-[var(--th-badge-info-border)]",idle:"bg-transparent border-[var(--edge-subtle)]"},Eo=u.forwardRef(function({state:t,label:o,detail:s,shape:a="pill",className:i,...r},l){return n.jsxs("span",{ref:l,className:b("inline-flex h-6 items-center gap-1.5 border px-2 text-[11px] font-medium tracking-[0.01em]",a==="pill"?"rounded-full":"rounded-md",ot[t],tt[t],i),...r,children:[n.jsx(ee,{tone:et[t],pulse:t==="running"}),n.jsx("span",{className:"truncate",children:o}),s&&n.jsx("span",{className:"font-mono text-[10px] text-fg-5 ml-0.5",children:s})]})});u.forwardRef(function({streaming:t,className:o,children:s,...a},i){return n.jsx("div",{ref:i,"data-streaming":t?"true":void 0,className:b("ambient-glow",o),...a,children:s})});const nt="--row-grid",st="260px 120px minmax(0,1fr) auto",te="lg:grid-cols-[var(--row-grid,260px_120px_minmax(0,1fr)_auto)]";function Oo({children:e,className:t,columns:o}){return n.jsx("div",{className:b("overflow-hidden rounded-lg border border-[var(--edge-subtle)] bg-[var(--surface-2)]","[&>*+*]:border-t [&>*+*]:border-[var(--edge-subtle)]",t),style:{[nt]:o??st},children:e})}const at=u.forwardRef(function({children:t,className:o,inline:s=!0,...a},i){return n.jsx("div",{ref:i,className:b("grid gap-x-5 gap-y-2 px-4 py-3 min-h-[64px]",te,"lg:items-center","transition-[background] duration-200 hover:bg-[var(--surface-3)]",s?"":"rounded-lg border border-[var(--edge-subtle)] bg-[var(--surface-2)]",o),...a,children:t})}),T=at;function it({columns:e,className:t}){return n.jsx("div",{className:b("hidden lg:grid gap-x-5 px-4 py-2",te,"lg:items-center","bg-[var(--surface-1)]",t),children:e.map((o,s)=>n.jsx("div",{className:"truncate text-[10px] font-semibold uppercase tracking-[0.16em] text-fg-5",children:o},s))})}T.Header=it;function rt({icon:e,title:t,subtitle:o,badge:s,className:a,iconWrap:i=!0}){return n.jsxs("div",{className:b("flex min-w-0 items-center gap-3",a),children:[e&&(i?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--edge-subtle)] bg-[var(--surface-1)] text-fg-3",children:e}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center",children:e})),n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"truncate text-[13.5px] font-semibold text-fg",children:t}),s]}),o&&n.jsx("div",{className:"mt-0.5 truncate text-[12px] leading-snug text-fg-5",children:o})]})]})}T.Lead=rt;function lt({label:e,children:t,className:o,mono:s}){return n.jsxs("div",{className:b("min-w-0",o),children:[e&&n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-fg-5 mb-1",children:e}),n.jsx("div",{className:b("truncate text-[13px] text-fg-3",s&&"font-mono text-[12px]"),children:t})]})}T.Field=lt;function dt({children:e,className:t}){return n.jsx("div",{className:b("flex shrink-0 items-center",t),children:e})}T.Status=dt;function ct({children:e,className:t}){return n.jsx("div",{className:b("flex shrink-0 items-center gap-2 justify-start lg:justify-end",t),children:e})}T.Action=ct;function ut({children:e,className:t}){return n.jsx("div",{className:b("col-span-full lg:col-span-full","text-[12.5px] leading-relaxed text-fg-4","pl-12","-mt-1",t),style:{gridColumn:"1 / -1"},children:e})}T.Description=ut;const pt={1:{tag:"h1",cls:"text-[26px] leading-[34px] font-semibold tracking-tight text-fg"},2:{tag:"h2",cls:"text-[18px] leading-[26px] font-semibold tracking-tight text-fg"},3:{tag:"h3",cls:"text-[15px] leading-[22px] font-semibold text-fg"},4:{tag:"h4",cls:"text-[13px] leading-[20px] font-semibold text-fg-2"}};u.forwardRef(function({level:t=2,className:o,children:s,...a},i){const{tag:r,cls:l}=pt[t];return u.createElement(r,{ref:i,className:b(l,o),...a},s)});const oe={limit_reached:"err",warning:"warn"};function F(e){const t=e.status?oe[e.status]:void 0;if(t)return t;if(e.usedPercent!=null){if(e.usedPercent>=100)return"err";if(e.usedPercent>=80)return"warn"}return"ok"}function Go(e){if(!e?.ok)return"ok";let t=e.status&&oe[e.status]||"ok";for(const o of e.windows){const s=F(o);if(s==="err")return"err";s==="warn"&&(t="warn")}return t}function gt(e){return e?.ok?e.windows.filter(t=>t.usedPercent!=null):[]}function mt(e){let t=null;for(const o of gt(e))(!t||(o.usedPercent??0)>(t.usedPercent??0))&&(t=o);return t}function Fo(e){return`${Math.round(e.usedPercent??0)}%`}function ht(e){if(e.resetAt){const t=Date.parse(e.resetAt);if(Number.isFinite(t))return Math.round((t-Date.now())/1e3)}return e.resetAfterSeconds}function z(e){if(e==null||!Number.isFinite(e)||e<0)return null;const t=Math.round(e/60);if(t<60)return`${Math.max(t,1)}m`;const o=Math.floor(t/60);if(o<24){const i=t%60;return i?`${o}h${i}m`:`${o}h`}const s=Math.floor(o/24),a=o%24;return a?`${s}d${a}h`:`${s}d`}function ft(e){const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toDateString()===new Date().toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleString([],{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}const bt="data:image/png;base64,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",xt="/assets/codex-DYadqqp0.png",wt="/assets/feishu-C4OMrjCW.ico",V="/assets/gemini-BYkEpiWr.svg",vt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient%20x1='50%25'%20y1='0%25'%20x2='50%25'%20y2='100%25'%20id='linearGradient-1'%3e%3cstop%20stop-color='%2338AEEB'%20offset='0%25'%3e%3c/stop%3e%3cstop%20stop-color='%23279AD1'%20offset='100%25'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='Artboard'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3ccircle%20id='Oval'%20fill='url(%23linearGradient-1)'%20cx='8'%20cy='8'%20r='8'%3e%3c/circle%3e%3cpath%20d='M3.17026167,7.83635602%20C5.78750201,6.74265999%207.53273882,6.02162863%208.40597211,5.67326193%20C10.8992306,4.67860423%2011.2454541,4.53439191%2011.5831299,4.52864956%20C11.6573986,4.52743168%2011.8385417,4.55776042%2011.9798438,4.67645833%20C12.1211458,4.79515625%2012.1635786,4.87206678%2012.1755371,4.93908691%20C12.1874957,5.00610705%2012.1862759,5.21456762%2012.1744385,5.3338623%20C12.0393279,6.69547283%2011.5259342,9.83829771%2011.2285121,11.3633248%20C11.1026617,12.008621%2010.8548582,12.2249854%2010.6149558,12.2461596%20C10.0935924,12.2921758%209.69769267,11.9156852%209.19272668,11.5981993%20C8.40255458,11.1013965%208.13911734,10.9180161%207.3721185,10.4332283%20C6.48571864,9.87297217%206.85080034,9.6784879%207.35595703,9.17524981%20C7.48815894,9.04355001%209.67825076,7.04590073%209.71077046,6.86250183%20C9.7391276,6.70257812%209.7494847,6.68189389%209.67664063,6.60973958%20C9.60379655,6.53758527%209.51674192,6.54658941%209.46083149,6.55876051%20C9.38158015,6.57601267%208.17521836,7.33962686%205.84174612,8.84960308%20C5.48344358,9.08558775%205.15890428,9.20056741%204.86812819,9.19454205%20C4.54757089,9.18789957%203.93094724,9.02070014%203.47255094,8.87778221%20C2.91030922,8.70248755%202.46345069,8.609808%202.50236203,8.31210343%20C2.52262946,8.15704047%202.74526267,7.998458%203.17026167,7.83635602%20Z'%20id='Path-3'%20fill='%23FFFFFF'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",kt="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20d='M42%2033c-16.569%200-30%2011.64-30%2026%200%208.084%204.283%2015.306%2011.008%2020.073L18%2095l20.832-8.102A37.33%2037.33%200%200%200%2042%2087c16.569%200%2030-11.64%2030-26S58.569%2033%2042%2033Z'%20fill='%23fff'/%3e%3cpath%20d='M85%2048c-13.807%200-25%209.402-25%2021%200%2011.598%2011.193%2021%2025%2021%202.545%200%205-.319%207.29-.91L109%2095l-4.772-12.27C109.078%2079.05%20112%2074.232%20112%2069c0-11.598-12.193-21-27-21Z'%20fill='%23fff'%20opacity='.95'/%3e%3ccircle%20cx='33'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='50'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='77'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='92'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3c/svg%3e",St="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%234A154B'/%3e%3crect%20x='50'%20y='14'%20width='28'%20height='44'%20rx='14'%20fill='%232EB67D'/%3e%3crect%20x='70'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%23ECB22E'/%3e%3crect%20x='50'%20y='70'%20width='28'%20height='44'%20rx='14'%20fill='%23E01E5A'/%3e%3crect%20x='14'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%2336C5F0'/%3e%3c/svg%3e",yt="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%235865F2'/%3e%3cpath%20fill='%23fff'%20d='M89.4%2036.9c-5.6-2.6-11.6-4.4-17.9-5.5l-.8%201.6c5.9%201%2011.2%202.6%2016.1%205-6-3-12.7-5-19.8-6-1.5-.2-2.9-.3-4.4-.4-.5%200-1%200-1.5%200s-1%200-1.5%200c-1.5%200-2.9.2-4.4.4-7.1%201-13.8%203-19.8%206%204.9-2.4%2010.2-4%2016.1-5l-.8-1.6C44.2%2032.5%2038.2%2034.3%2032.6%2036.9%2022%2053%2019%2068.7%2020.5%2084.3c8.1%206%2016%209.6%2023.7%2012%201.5-2.1%202.9-4.3%204.1-6.6-2.4-.9-4.6-2-6.8-3.3.6-.4%201.1-.9%201.7-1.3%2013.5%206.3%2028%206.3%2041.4%200%20.6.4%201.1.9%201.7%201.3-2.1%201.3-4.4%202.4-6.8%203.3%201.2%202.3%202.6%204.5%204.1%206.6%207.7-2.4%2015.6-6%2023.7-12%201.7-18.1-2.9-33.7-12.9-47.4ZM52.3%2074.8c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.6%209.1-8%209.1Zm23.5%200c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.5%209.1-8%209.1Z'/%3e%3c/svg%3e",At="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%231989FA'/%3e%3cpath%20fill='%23fff'%20d='M64.6%2026.5c-21%200-38%2017-38%2038%200%2021%2017%2038%2038%2038%206%200%2011.7-1.4%2016.7-3.9l21.3%204.6-7.6-19c4.6-5.7%207.4-12.9%207.4-20.7%200-21-17.1-37.9-37.8-37.9Zm-1.2%2053.8%205.5-13.6c-3.8.2-7.5.4-11.3.5L70.4%2049c-3.4%200-6.5.1-9.4.3l3.9-13.5h11.7l-3.8%2013.4c2.4-.1%204.6-.3%206.7-.5l-9.8%2017.6c4.6-.1%208.8-.3%2012.5-.6L63.4%2080.3Z'/%3e%3c/svg%3e",Ct="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20fill='%23fff'%20d='M32%2030h36c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H56l-14%2012%204-12h-14c-8%200-14-6-14-14V44c0-8%206-14%2014-14Z'/%3e%3cpath%20fill='%23fff'%20opacity='.55'%20d='M56%2054h32c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H80l-14%2012%204-12h-14c-8%200-14-6-14-14V68c0-8%206-14%2014-14Z'/%3e%3ccircle%20cx='44'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='60'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='72'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3ccircle%20cx='86'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3c/svg%3e",Dt="/assets/playwright-BldPFZgC.ico",Tt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M23.15%202.587L18.21.21a1.494%201.494%200%200%200-1.705.29l-9.46%208.63-4.12-3.128a.999.999%200%200%200-1.276.057L.327%207.261A1%201%200%200%200%20.326%208.74L3.899%2012%20.326%2015.26a1%201%200%200%200%20.001%201.479L1.65%2017.94a.999.999%200%200%200%201.276.057l4.12-3.128%209.46%208.63a1.492%201.492%200%200%200%201.704.29l4.942-2.377A1.5%201.5%200%200%200%2024%2020.06V3.939a1.5%201.5%200%200%200-.85-1.352zm-5.146%2014.861L10.826%2012l7.178-5.448v10.896z'%20fill='%23007ACC'/%3e%3c/svg%3e",Pt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%2319191C'/%3e%3cpath%20d='M7%205l10%207-4.5%201.5L15.5%2019l-2.2.8-3-5.5L7%2017z'%20fill='%23fff'/%3e%3c/svg%3e",It="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%230BA48A'/%3e%3cpath%20d='M8%2018l2-12h2.5l-1.2%205h4.2L10%2018H8zm3.5-3.5l3-7.5'%20fill='%23fff'%20fill-rule='evenodd'/%3e%3c/svg%3e",Rt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%234A90D9'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='12'%20rx='1.5'%20fill='%236DB3F2'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='3.5'%20rx='1.5'%20fill='%233D7ABF'/%3e%3ccircle%20cx='8.5'%20cy='6.8'%20r='.8'%20fill='%23FF5F57'/%3e%3ccircle%20cx='11'%20cy='6.8'%20r='.8'%20fill='%23FEBC2E'/%3e%3ccircle%20cx='13.5'%20cy='6.8'%20r='.8'%20fill='%2328C840'/%3e%3crect%20x='7'%20y='10.5'%20width='10'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.7'/%3e%3crect%20x='7'%20y='13'%20width='7'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.5'/%3e%3c/svg%3e",Nt="/assets/hermes-BAarh-tH.png",jt="/assets/openrouter-CsJ_bD5Q.ico",Mt="/assets/anthropic-BAdojD7P.ico",Lt="/assets/deepseek-BeYNZEk0.ico",Bt="/assets/qwen-xykkX0_y.png",Et="/assets/doubao-DloFDuFR.png",Ot="data:image/png;base64,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",Gt="/assets/minimax-PuEGTfrF.ico",Ft="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%20aria-label='OpenAI'%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.677l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v3l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e",Wt="/assets/ollama-Bt9O-2K_.png",_t="/assets/mlx-DhWwjtMw.png",Ut={claude:bt,codex:xt,gemini:V,telegram:vt,feishu:wt,weixin:kt,slack:St,discord:yt,dingtalk:At,wecom:Ct,playwright:Dt,vscode:Tt,cursor:Pt,windsurf:It,finder:Rt,hermes:Nt,openrouter:jt,anthropic:Mt,deepseek:Lt,google:V,qwen:Bt,doubao:Et,glm:Ot,minimax:Gt,openai:Ft,ollama:Wt,mlx:_t},Ht={custom:{letter:"+",color:"#94a3b8",bg:"rgba(148,163,184,0.12)"}};function zt({brand:e,size:t=18,className:o}){const s=Ut[e];if(s)return n.jsx("img",{src:s,alt:"","aria-hidden":"true",draggable:!1,className:b("shrink-0 object-contain select-none",o),style:{width:t,height:t}});const a=Ht[e];if(!a)return null;const i=a.letter.length>1;return n.jsx("span",{"aria-hidden":"true",className:b("inline-flex shrink-0 items-center justify-center rounded-md font-semibold tracking-tight select-none",o),style:{width:t,height:t,background:a.bg,color:a.color,fontSize:Math.round(t*(i?.42:.55)),lineHeight:1,letterSpacing:i?"-0.02em":"normal"},children:a.letter})}const ne={err:"var(--th-badge-err-text)",warn:"var(--th-badge-warn-text)",ok:"var(--th-fg-5)"};function Vt({percent:e,tone:t,size:o=14}){const s=Math.max(0,Math.min(100,e)),a=6,i=2*Math.PI*a,r=ne[t];return n.jsxs("svg",{width:o,height:o,viewBox:"0 0 16 16",role:"img","aria-label":`${Math.round(s)}%`,children:[n.jsx("circle",{cx:"8",cy:"8",r:a,fill:"none",stroke:r,strokeOpacity:"0.25",strokeWidth:"2.5"}),n.jsx("circle",{cx:"8",cy:"8",r:a,fill:"none",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${s/100*i} ${i}`,transform:"rotate(-90 8 8)"})]})}function Kt({usage:e,t,title:o}){if(!e?.ok||!e.windows.length)return n.jsx(n.Fragment,{children:e?.error||t("config.balanceUnavailable")});const s=e.capturedAt?ft(e.capturedAt):null;return n.jsxs("div",{className:"flex min-w-[200px] flex-col gap-1 py-0.5",children:[o&&n.jsx("div",{className:"mb-0.5 font-medium text-fg-4",children:o}),e.windows.map(a=>{const i=F(a),r=a.usedPercent,l=ht(a),c=l!=null&&l<=0?t("usage.resetElapsed"):z(l)?`↻ ${z(l)}`:"";return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"w-14 shrink-0 text-fg-4",children:a.label}),r!=null?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"h-[3px] w-12 shrink-0 overflow-hidden rounded-full bg-fg/10",children:n.jsx("span",{className:"block h-full rounded-full",style:{width:`${Math.max(2,Math.min(100,r))}%`,backgroundColor:ne[i]}})}),n.jsxs("span",{className:"font-mono text-fg-2",children:[Math.round(r),"%"]})]}):n.jsx("span",{className:"text-fg-4",children:a.status||"—"}),n.jsx("span",{className:"ml-auto pl-2 text-fg-5",children:c})]},a.label)}),s&&n.jsxs("div",{className:"mt-0.5 text-[10px] text-fg-5",children:[t("usage.asOf")," ",s]})]})}function qt({t:e}){const t=k(a=>a.agentStatus),o=k(a=>a.refreshAgentStatus),s=(t?.agents??[]).flatMap(a=>{const i=mt(a.usage);return i?[{agent:a,worst:i}]:[]});return s.length?n.jsx("div",{className:"hidden items-center gap-2 pr-1 md:flex",children:s.map(({agent:a,worst:i})=>n.jsxs(Xe,{content:n.jsx(Kt,{usage:a.usage,t:e,title:`${Re(a.agent).label} · ${e("usage.accountQuota")}`}),onShow:()=>{o()},className:"cursor-default items-center gap-1",children:[n.jsx(zt,{brand:a.agent,size:12}),n.jsx(Vt,{percent:i.usedPercent??0,tone:F(i),size:13})]},a.agent))}):null}const Qt=n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"5"}),n.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),n.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),n.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),n.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),n.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),n.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),n.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),n.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}),Jt=n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),K={sessions:"/",im:"/im",agents:"/agents",extensions:"/extensions",system:"/system"};function Zt({version:e,restartPhase:t,onRestartClick:o}){const s=k(g=>g.state),a=k(g=>g.theme),i=k(g=>g.setTheme),r=k(g=>g.locale),l=k(g=>g.setLocale),c=u.useMemo(()=>Y(r),[r]),h=De(c),f=Ce(s,c),m=t==="restarting"||t==="reconnecting",p=t==="confirm";return n.jsx("header",{className:"sticky top-0 z-40 border-b border-edge bg-[var(--th-sidebar)] backdrop-blur-[20px] [backdrop-filter:blur(20px)_saturate(1.2)]",children:n.jsxs("div",{className:"mx-auto flex min-h-13 max-w-[1180px] flex-wrap items-center gap-2.5 px-4 py-2",children:[n.jsxs("div",{className:"mr-1.5 flex items-center gap-2.5 shrink-0",children:[n.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md border border-[var(--edge-default)] bg-[var(--surface-2)] text-fg-2",children:n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",children:n.jsx("path",{d:"M13 2L3 14h8l-1 8 11-13h-8l1-7z"})})}),n.jsx("div",{className:"leading-none",children:n.jsx("div",{className:"text-[13px] font-semibold tracking-tight text-fg",children:"Pikiloop"})}),n.jsxs("span",{className:"rounded-md border border-[var(--edge-subtle)] bg-transparent px-1.5 py-0.5 text-[10px] font-mono text-fg-5",children:["v",e]})]}),n.jsx("nav",{className:"order-3 w-full md:order-none md:w-auto",children:n.jsx(Je,{className:"w-full overflow-x-auto md:w-auto",children:h.map(g=>n.jsx(ce,{to:K[g.key],end:K[g.key]==="/",className:({isActive:v})=>b("relative inline-flex h-8 items-center justify-center rounded-md px-3 text-[13px] font-medium transition-colors duration-200","focus-visible:outline-none focus-visible:shadow-[0_0_0_3px_var(--brand-glow-a)]",v?"bg-[var(--surface-2)] text-fg":"text-fg-4 hover:text-fg-2 hover:bg-[var(--surface-2)]"),children:g.label},g.key))})}),n.jsx("div",{className:"flex-1 min-w-0"}),n.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.jsx(qt,{t:c}),n.jsxs("div",{className:"hidden items-center gap-1.5 rounded-full border border-[var(--edge-subtle)] bg-transparent px-2.5 py-1 text-[11px] text-fg-3 md:flex",children:[n.jsx(ee,{tone:f.dotVariant,pulse:f.dotPulse}),n.jsx("span",{className:"font-medium",children:f.badgeContent})]}),n.jsxs(O,{variant:p?"secondary":"outline",size:"sm",onClick:o,disabled:m,title:c(m?"modal.restarting":p?"modal.confirmRestart":"sidebar.restart"),className:b(m?"pointer-events-none opacity-70":"",p?"border-amber-500/30 bg-amber-500/10 text-amber-200 hover:bg-amber-500/10 hover:text-amber-100":""),children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:m?"animate-spin":"",style:m?{animationDuration:"1s"}:void 0,children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),n.jsx("span",{className:"hidden md:inline",children:c(m?"modal.restarting":p?"modal.confirmRestart":"sidebar.restart")})]}),n.jsx(O,{variant:"ghost",size:"icon",onClick:()=>i(a==="dark"?"light":"dark"),title:a==="dark"?"Light mode":"Dark mode",children:a==="dark"?Qt:Jt}),n.jsx(O,{variant:"ghost",size:"sm",onClick:()=>l(r==="zh-CN"?"en":"zh-CN"),className:"font-mono font-semibold tracking-wider",children:r==="zh-CN"?"EN":"中"})]})]})})}const Xt=u.lazy(async()=>({default:(await S(async()=>{const{SessionWorkspace:e}=await import("./index-CpM4CqZJ.js").then(t=>t.i);return{SessionWorkspace:e}},__vite__mapDeps([0,1,2,3,4,5,6,7]))).SessionWorkspace})),Yt=u.lazy(()=>S(()=>import("./AgentTab-UZPIhlkr.js"),__vite__mapDeps([8,1,2,3,9,7]))),$t=u.lazy(async()=>({default:(await S(async()=>{const{IMAccessTab:e}=await import("./IMAccessTab-Bd_IY1GQ.js");return{IMAccessTab:e}},__vite__mapDeps([10,1,7]))).IMAccessTab})),eo=u.lazy(async()=>({default:(await S(async()=>{const{ExtensionsTab:e}=await import("./ExtensionsTab-KZhEDrdu.js");return{ExtensionsTab:e}},__vite__mapDeps([6,1,3,7]))).ExtensionsTab})),to=u.lazy(async()=>({default:(await S(async()=>{const{SystemTab:e}=await import("./SystemTab-DBDkaPiO.js");return{SystemTab:e}},__vite__mapDeps([11,1,9,7]))).SystemTab})),oo=u.lazy(async()=>({default:(await S(async()=>{const{TelegramModal:e}=await import("./Modals-axftHasy.js");return{TelegramModal:e}},__vite__mapDeps([12,1,3,4,7]))).TelegramModal})),no=u.lazy(async()=>({default:(await S(async()=>{const{FeishuModal:e}=await import("./Modals-axftHasy.js");return{FeishuModal:e}},__vite__mapDeps([12,1,3,4,7]))).FeishuModal})),so=u.lazy(async()=>({default:(await S(async()=>{const{WeixinModal:e}=await import("./Modals-axftHasy.js");return{WeixinModal:e}},__vite__mapDeps([12,1,3,4,7]))).WeixinModal})),ao=u.lazy(async()=>({default:(await S(async()=>{const{SlackModal:e}=await import("./Modals-axftHasy.js");return{SlackModal:e}},__vite__mapDeps([12,1,3,4,7]))).SlackModal})),io=u.lazy(async()=>({default:(await S(async()=>{const{DiscordModal:e}=await import("./Modals-axftHasy.js");return{DiscordModal:e}},__vite__mapDeps([12,1,3,4,7]))).DiscordModal})),ro=u.lazy(async()=>({default:(await S(async()=>{const{DingtalkModal:e}=await import("./Modals-axftHasy.js");return{DingtalkModal:e}},__vite__mapDeps([12,1,3,4,7]))).DingtalkModal})),lo=u.lazy(async()=>({default:(await S(async()=>{const{WeComModal:e}=await import("./Modals-axftHasy.js");return{WeComModal:e}},__vite__mapDeps([12,1,3,4,7]))).WeComModal})),co=u.lazy(async()=>({default:(await S(async()=>{const{WorkdirModal:e}=await import("./Modals-axftHasy.js");return{WorkdirModal:e}},__vite__mapDeps([12,1,3,4,7]))).WorkdirModal})),uo=u.lazy(async()=>({default:(await S(async()=>{const{BrowserSetupModal:e}=await import("./Modals-axftHasy.js");return{BrowserSetupModal:e}},__vite__mapDeps([12,1,3,4,7]))).BrowserSetupModal}));function po(e){return{"/":"sessions","/im":"im","/agents":"agents","/extensions":"extensions","/permissions":"system","/system":"system"}[e]||"sessions"}function B({title:e,description:t,children:o}){return n.jsx("div",{className:"h-full overflow-y-auto",children:n.jsxs("div",{className:"mx-auto max-w-[1120px] px-5 py-3",children:[n.jsx("div",{className:"mb-3 border-b border-edge pb-2",children:n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"text-lg font-semibold tracking-tight text-fg",children:e}),t&&n.jsx("div",{className:"mt-0.5 text-[13px] leading-relaxed text-fg-4",children:t})]})}),o]})})}function q(){return n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsxs("div",{className:"flex items-center gap-2 text-sm text-fg-4",children:[n.jsx(Ye,{}),"Loading..."]})})}function go(){const e=k(w=>w.state),t=k(w=>w.toasts),o=k(w=>w.locale),s=k(w=>w.toast),a=k(w=>w.reload),i=k(w=>w.refreshAgentStatus),r=ue(),l=po(r.pathname),[c,h]=u.useState(l==="sessions"),f=u.useMemo(()=>Y(o),[o]),[m,p]=u.useState(null),g=u.useCallback(()=>p(null),[]),v=e?.version||"...",[P,se]=u.useState(!1);u.useEffect(()=>{l==="sessions"&&h(!0)},[l]),u.useEffect(()=>{const w=window.setInterval(()=>{document.hidden||i()},6e4),I=()=>{document.hidden||i()};return document.addEventListener("visibilitychange",I),()=>{window.clearInterval(w),document.removeEventListener("visibilitychange",I)}},[i]),u.useEffect(()=>{e&&!P&&r.pathname!=="/"&&!e.config.weixinBotToken&&!e.config.telegramBotToken&&!e.config.feishuAppId&&!e.config.slackBotToken&&!e.config.discordBotToken&&!e.config.dingtalkClientId&&!e.config.wecomBotId&&(se(!0),setTimeout(()=>p({type:"weixin"}),400))},[e,P,r.pathname]);const[A,D]=u.useState(null),ae=u.useCallback(()=>{A==="restarting"||A==="reconnecting"||(A==="confirm"?(D("restarting"),(async()=>{try{const w=await y.restart();if(!w.ok){const M=w.activeTasks?f("modal.restartBlockedTasks").replace("{n}",String(w.activeTasks)):w.error||f("modal.restartFailed");s(M,!1),D(null);return}D("reconnecting");let I=!1;for(let M=0;M<30;M++){await new Promise(ie=>setTimeout(ie,600));try{await y.getState(),I=!0;break}catch{}}I?(await a(),s(f("modal.restartSuccess"))):s(f("modal.restartFailed"),!1)}catch{s(f("modal.restartFailed"),!1)}D(null)})()):(D("confirm"),setTimeout(()=>D(w=>w==="confirm"?null:w),3e3)))},[A,s,f,a]),C=Te(l,f);return n.jsxs("div",{className:"noise-overlay",children:[n.jsxs("div",{className:"fixed inset-0 pointer-events-none overflow-hidden",style:{contain:"strict"},children:[n.jsx("div",{className:"grid-bg absolute inset-0 opacity-50"}),n.jsx("div",{className:"absolute -top-36 right-0 h-[420px] w-[420px] rounded-full",style:{background:"radial-gradient(ellipse, var(--th-orb1), transparent 72%)",animation:"drift 24s ease-in-out infinite",willChange:"transform"}}),n.jsx("div",{className:"absolute -bottom-40 -left-20 h-[360px] w-[360px] rounded-full",style:{background:"radial-gradient(ellipse, var(--th-orb2), transparent 74%)",animation:"drift 28s ease-in-out infinite reverse",willChange:"transform"}})]}),n.jsxs("div",{className:"relative h-screen flex flex-col overflow-hidden",children:[n.jsx(Zt,{version:v,restartPhase:A,onRestartClick:ae}),n.jsxs("main",{className:"flex-1 overflow-hidden",children:[c&&n.jsx(u.Suspense,{fallback:n.jsx(q,{}),children:n.jsx("div",{className:b("h-full",l!=="sessions"&&"hidden"),"aria-hidden":l!=="sessions",children:n.jsx(Xt,{active:l==="sessions"})})}),l!=="sessions"&&n.jsx(u.Suspense,{fallback:n.jsx(q,{}),children:n.jsxs(pe,{children:[n.jsx(R,{path:"/im",element:n.jsx(B,{title:C.title,description:C.description,children:n.jsx($t,{onOpenWeixin:()=>p({type:"weixin"}),onOpenTelegram:()=>p({type:"telegram"}),onOpenFeishu:()=>p({type:"feishu"}),onOpenSlack:()=>p({type:"slack"}),onOpenDiscord:()=>p({type:"discord"}),onOpenDingtalk:()=>p({type:"dingtalk"}),onOpenWeCom:()=>p({type:"wecom"})})})}),n.jsx(R,{path:"/agents",element:n.jsx(B,{title:C.title,description:C.description,children:n.jsx(Yt,{})})}),n.jsx(R,{path:"/permissions",element:n.jsx(ge,{to:"/system",replace:!0})}),n.jsx(R,{path:"/extensions",element:n.jsx(B,{title:C.title,description:C.description,children:n.jsx(eo,{onOpenBrowserSetup:()=>p({type:"browser-setup"})})})}),n.jsx(R,{path:"/system",element:n.jsx(B,{title:C.title,description:C.description,children:n.jsx(to,{onOpenWorkdir:()=>p({type:"workdir"})})})})]})})]})]}),m&&n.jsxs(u.Suspense,{fallback:null,children:[m.type==="weixin"&&n.jsx(so,{open:!0,onClose:g}),m.type==="telegram"&&n.jsx(oo,{open:!0,onClose:g}),m.type==="feishu"&&n.jsx(no,{open:!0,onClose:g}),m.type==="slack"&&n.jsx(ao,{open:!0,onClose:g}),m.type==="discord"&&n.jsx(io,{open:!0,onClose:g}),m.type==="dingtalk"&&n.jsx(ro,{open:!0,onClose:g}),m.type==="wecom"&&n.jsx(lo,{open:!0,onClose:g}),m.type==="browser-setup"&&n.jsx(uo,{open:!0,onClose:g,onSaved:()=>a()}),m.type==="workdir"&&n.jsx(co,{open:!0,onClose:g})]}),n.jsx($e,{items:t}),(A==="restarting"||A==="reconnecting")&&n.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-[var(--th-bg)]/80 backdrop-blur-sm animate-in",children:n.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n.jsx("div",{className:"relative h-10 w-10",children:n.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin text-fg-2",style:{animationDuration:"1.2s"},children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}),n.jsx("span",{className:"text-sm font-medium text-fg-3",children:f(A==="restarting"?"modal.restarting":"modal.reconnecting")})]})})]})}de.createRoot(document.getElementById("root")).render(n.jsx(u.StrictMode,{children:n.jsx(me,{children:n.jsx(go,{})})}));export{fo as A,zt as B,Ro as C,ee as D,vo as E,Lo as F,Bo as G,bo as H,No as I,Po as J,Co as K,jo as L,Oo as R,Ye as S,Xe as T,Kt as U,S as _,y as a,F as b,b as c,Y as d,Ao as e,Do as f,Re as g,Ne as h,O as i,xo as j,wo as k,To as l,Io as m,yo as n,gt as o,Go as p,Fo as q,ko as r,So as s,we as t,k as u,T as v,mt as w,Eo as x,Je as y,Mo as z};