@auto-ai/agent 2.1.129 → 2.1.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/404/index.html +1 -1
- package/dist/404.html +1 -1
- package/dist/_next/static/chunks/{b76778c5811ef7a1.js → 0eeaf05fe8e92617.js} +1 -1
- package/dist/_next/static/chunks/14114800ef3e692e.js +1 -0
- package/dist/_next/static/chunks/{67ed23cd064b3759.js → 1d51ed7830318474.js} +1 -1
- package/dist/_next/static/chunks/{11e6ca4bf89238c8.js → 1ffb3acecdbda566.js} +1 -1
- package/dist/_next/static/chunks/292d0b687a419387.js +1 -0
- package/dist/_next/static/chunks/48bc54794d1c3561.js +1 -0
- package/dist/_next/static/chunks/5534f66638e5a2e8.js +1 -0
- package/dist/_next/static/chunks/{3407244006d6a98a.js → 61676890ad8fe194.js} +1 -1
- package/dist/_next/static/chunks/{f7e71ce1c236f806.js → 950875832bab2141.js} +1 -1
- package/dist/_next/static/chunks/a8e06ee8243e3389.js +1 -0
- package/dist/_next/static/chunks/d3af8988bf25a7de.js +1 -0
- package/dist/_next/static/chunks/d504c4e2ebc5319a.js +1 -0
- package/dist/index.html +2 -1
- package/dist/index.txt +4 -4
- package/dist/manage/about/index.html +2 -2
- package/dist/manage/about/index.txt +8 -8
- package/dist/manage/add-account/basic/index.html +2 -2
- package/dist/manage/add-account/basic/index.txt +11 -10
- package/dist/manage/add-account/index.html +2 -2
- package/dist/manage/add-account/index.txt +10 -11
- package/dist/manage/env/index.html +2 -2
- package/dist/manage/env/index.txt +10 -10
- package/dist/manage/general/index.html +2 -2
- package/dist/manage/general/index.txt +8 -8
- package/dist/manage/index.html +2 -1
- package/dist/manage/index.txt +4 -4
- package/dist/manage/mcp/index.html +2 -2
- package/dist/manage/mcp/index.txt +9 -11
- package/dist/manage/permissions/index.html +2 -2
- package/dist/manage/permissions/index.txt +8 -8
- package/dist/manage/skills/index.html +2 -2
- package/dist/manage/skills/index.txt +9 -11
- package/dist/manage/task/index.html +2 -2
- package/dist/manage/task/index.txt +7 -7
- package/dist/manage/teams/index.html +2 -2
- package/dist/manage/teams/index.txt +7 -7
- package/dist/manage/tools/index.html +2 -2
- package/dist/manage/tools/index.txt +9 -11
- package/dist/ws-test.html +29 -1
- package/package.json +6 -6
- package/dist/_next/static/chunks/1601f801b0efe2b7.js +0 -1
- package/dist/_next/static/chunks/6f004c225e10839e.js +0 -1
- package/dist/_next/static/chunks/848159b04d61ef38.js +0 -1
- package/dist/_next/static/chunks/9724f0d9ea70a30f.js +0 -1
- package/dist/_next/static/chunks/98f0c5604e839ba2.js +0 -1
- package/dist/_next/static/chunks/c2bed9d5fa7be4bd.js +0 -1
- package/dist/_next/static/chunks/d059ec9b9c0efd14.js +0 -1
- package/dist/_next/static/chunks/fb29f7b061918c67.js +0 -1
- package/dist/manage/agent-teams/index.html +0 -2
- package/dist/manage/agent-teams/index.txt +0 -37
- /package/dist/_next/static/{RC5OUa2awvwHdB2N2jYPR → mDIzKji-qQhRRLbZUHK6V}/_buildManifest.js +0 -0
- /package/dist/_next/static/{RC5OUa2awvwHdB2N2jYPR → mDIzKji-qQhRRLbZUHK6V}/_clientMiddlewareManifest.json +0 -0
- /package/dist/_next/static/{RC5OUa2awvwHdB2N2jYPR → mDIzKji-qQhRRLbZUHK6V}/_ssgManifest.js +0 -0
package/dist/404/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--RC5OUa2awvwHdB2N2jYPR--><html lang="zh-CN" class="sora_a6e0e515-module__NbNjtG__variable dm_sans_fa25cdfd-module__fB5nTW__variable jetbrains_mono_2b1eae20-module__XfFTLG__variable font-sans"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/app/_next/static/chunks/fa361913d47fdc14.css" data-precedence="next"/><link rel="stylesheet" href="/app/_next/static/chunks/e7bd145455a541af.css" data-precedence="next"/><link rel="stylesheet" href="/app/_next/static/chunks/5817c66b26ce8538.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/app/_next/static/chunks/76a71d344cc15a9f.js"/><script src="/app/_next/static/chunks/91adb7bdb9870c6a.js" async=""></script><script src="/app/_next/static/chunks/40268f8e3ff0314e.js" async=""></script><script src="/app/_next/static/chunks/32b4d63e10d31351.js" async=""></script><script src="/app/_next/static/chunks/66b30159915524db.js" async=""></script><script src="/app/_next/static/chunks/turbopack-030a42d60560a927.js" async=""></script><script src="/app/_next/static/chunks/e520aa06a5014225.js" async=""></script><script src="/app/_next/static/chunks/fc4be3bcf72559a0.js" async=""></script><script src="/app/_next/static/chunks/7988d5ea63356e10.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Claude Code测试平台</title><meta name="description" content="Claude Code测试平台"/><script src="/app/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><!--$--><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><!--/$--><script src="/app/_next/static/chunks/76a71d344cc15a9f.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[13354,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"AppToaster\"]\n3:I[39756,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n4:I[37457,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n5:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"OutletBoundary\"]\n7:I[11533,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"AsyncMetadataOutlet\"]\n9:I[58541,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\na:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"ViewportBoundary\"]\nc:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[68027,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n:HL[\"/app/_next/static/chunks/fa361913d47fdc14.css\",\"style\"]\n:HL[\"/app/_next/static/chunks/e7bd145455a541af.css\",\"style\"]\n:HL[\"/app/_next/static/chunks/5817c66b26ce8538.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"RC5OUa2awvwHdB2N2jYPR\",\"p\":\"/app\",\"c\":[\"\",\"_not-found\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/fa361913d47fdc14.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/e7bd145455a541af.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/5817c66b26ce8538.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/app/_next/static/chunks/e520aa06a5014225.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/app/_next/static/chunks/7988d5ea63356e10.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"className\":\"sora_a6e0e515-module__NbNjtG__variable dm_sans_fa25cdfd-module__fB5nTW__variable jetbrains_mono_2b1eae20-module__XfFTLG__variable font-sans\",\"children\":[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$L6\",[\"$\",\"$L7\",null,{\"promise\":\"$@8\"}]]}]]}],{},null,false]},null,false]},[[\"$\",\"div\",\"l\",{\"className\":\"flex min-h-[40vh] flex-1 items-center justify-center gap-2 text-sm text-zinc-500\",\"children\":[[\"$\",\"$L9\",null,{\"ref\":\"$undefined\",\"iconNode\":[[\"path\",{\"d\":\"M21 12a9 9 0 1 1-6.219-8.56\",\"key\":\"13zald\"}]],\"className\":\"lucide-loader-circle animate-spin text-muted-foreground\",\"size\":16,\"color\":\"currentColor\",\"strokeWidth\":2,\"aria-hidden\":\"true\"}],\" 加载中\"]}],[],[]],false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",\"$undefined\"],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\n"])</script><script>self.__next_f.push([1,"8:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Claude Code测试平台\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Claude Code测试平台\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$8:metadata\"\n"])</script></body></html>
|
|
1
|
+
<!DOCTYPE html><!--mDIzKji_qQhRRLbZUHK6V--><html lang="zh-CN" class="sora_a6e0e515-module__NbNjtG__variable dm_sans_fa25cdfd-module__fB5nTW__variable jetbrains_mono_2b1eae20-module__XfFTLG__variable font-sans"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/app/_next/static/chunks/fa361913d47fdc14.css" data-precedence="next"/><link rel="stylesheet" href="/app/_next/static/chunks/e7bd145455a541af.css" data-precedence="next"/><link rel="stylesheet" href="/app/_next/static/chunks/5817c66b26ce8538.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/app/_next/static/chunks/76a71d344cc15a9f.js"/><script src="/app/_next/static/chunks/91adb7bdb9870c6a.js" async=""></script><script src="/app/_next/static/chunks/40268f8e3ff0314e.js" async=""></script><script src="/app/_next/static/chunks/32b4d63e10d31351.js" async=""></script><script src="/app/_next/static/chunks/66b30159915524db.js" async=""></script><script src="/app/_next/static/chunks/turbopack-030a42d60560a927.js" async=""></script><script src="/app/_next/static/chunks/e520aa06a5014225.js" async=""></script><script src="/app/_next/static/chunks/fc4be3bcf72559a0.js" async=""></script><script src="/app/_next/static/chunks/7988d5ea63356e10.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Claude Code测试平台</title><meta name="description" content="Claude Code测试平台"/><script src="/app/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><!--$--><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><!--/$--><script src="/app/_next/static/chunks/76a71d344cc15a9f.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[13354,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"AppToaster\"]\n3:I[39756,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n4:I[37457,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n5:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"OutletBoundary\"]\n7:I[11533,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"AsyncMetadataOutlet\"]\n9:I[58541,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\na:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"ViewportBoundary\"]\nc:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[68027,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n:HL[\"/app/_next/static/chunks/fa361913d47fdc14.css\",\"style\"]\n:HL[\"/app/_next/static/chunks/e7bd145455a541af.css\",\"style\"]\n:HL[\"/app/_next/static/chunks/5817c66b26ce8538.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"mDIzKji-qQhRRLbZUHK6V\",\"p\":\"/app\",\"c\":[\"\",\"_not-found\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/fa361913d47fdc14.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/e7bd145455a541af.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/5817c66b26ce8538.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/app/_next/static/chunks/e520aa06a5014225.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/app/_next/static/chunks/7988d5ea63356e10.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"className\":\"sora_a6e0e515-module__NbNjtG__variable dm_sans_fa25cdfd-module__fB5nTW__variable jetbrains_mono_2b1eae20-module__XfFTLG__variable font-sans\",\"children\":[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$L6\",[\"$\",\"$L7\",null,{\"promise\":\"$@8\"}]]}]]}],{},null,false]},null,false]},[[\"$\",\"div\",\"l\",{\"className\":\"flex min-h-[40vh] flex-1 items-center justify-center gap-2 text-sm text-zinc-500\",\"children\":[[\"$\",\"$L9\",null,{\"ref\":\"$undefined\",\"iconNode\":[[\"path\",{\"d\":\"M21 12a9 9 0 1 1-6.219-8.56\",\"key\":\"13zald\"}]],\"className\":\"lucide-loader-circle animate-spin text-muted-foreground\",\"size\":16,\"color\":\"currentColor\",\"strokeWidth\":2,\"aria-hidden\":\"true\"}],\" 加载中\"]}],[],[]],false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",\"$undefined\"],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\n"])</script><script>self.__next_f.push([1,"8:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Claude Code测试平台\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Claude Code测试平台\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$8:metadata\"\n"])</script></body></html>
|
package/dist/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--RC5OUa2awvwHdB2N2jYPR--><html lang="zh-CN" class="sora_a6e0e515-module__NbNjtG__variable dm_sans_fa25cdfd-module__fB5nTW__variable jetbrains_mono_2b1eae20-module__XfFTLG__variable font-sans"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/app/_next/static/chunks/fa361913d47fdc14.css" data-precedence="next"/><link rel="stylesheet" href="/app/_next/static/chunks/e7bd145455a541af.css" data-precedence="next"/><link rel="stylesheet" href="/app/_next/static/chunks/5817c66b26ce8538.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/app/_next/static/chunks/76a71d344cc15a9f.js"/><script src="/app/_next/static/chunks/91adb7bdb9870c6a.js" async=""></script><script src="/app/_next/static/chunks/40268f8e3ff0314e.js" async=""></script><script src="/app/_next/static/chunks/32b4d63e10d31351.js" async=""></script><script src="/app/_next/static/chunks/66b30159915524db.js" async=""></script><script src="/app/_next/static/chunks/turbopack-030a42d60560a927.js" async=""></script><script src="/app/_next/static/chunks/e520aa06a5014225.js" async=""></script><script src="/app/_next/static/chunks/fc4be3bcf72559a0.js" async=""></script><script src="/app/_next/static/chunks/7988d5ea63356e10.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Claude Code测试平台</title><meta name="description" content="Claude Code测试平台"/><script src="/app/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><!--$--><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><!--/$--><script src="/app/_next/static/chunks/76a71d344cc15a9f.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[13354,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"AppToaster\"]\n3:I[39756,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n4:I[37457,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n5:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"OutletBoundary\"]\n7:I[11533,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"AsyncMetadataOutlet\"]\n9:I[58541,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\na:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"ViewportBoundary\"]\nc:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[68027,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n:HL[\"/app/_next/static/chunks/fa361913d47fdc14.css\",\"style\"]\n:HL[\"/app/_next/static/chunks/e7bd145455a541af.css\",\"style\"]\n:HL[\"/app/_next/static/chunks/5817c66b26ce8538.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"RC5OUa2awvwHdB2N2jYPR\",\"p\":\"/app\",\"c\":[\"\",\"_not-found\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/fa361913d47fdc14.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/e7bd145455a541af.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/5817c66b26ce8538.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/app/_next/static/chunks/e520aa06a5014225.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/app/_next/static/chunks/7988d5ea63356e10.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"className\":\"sora_a6e0e515-module__NbNjtG__variable dm_sans_fa25cdfd-module__fB5nTW__variable jetbrains_mono_2b1eae20-module__XfFTLG__variable font-sans\",\"children\":[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$L6\",[\"$\",\"$L7\",null,{\"promise\":\"$@8\"}]]}]]}],{},null,false]},null,false]},[[\"$\",\"div\",\"l\",{\"className\":\"flex min-h-[40vh] flex-1 items-center justify-center gap-2 text-sm text-zinc-500\",\"children\":[[\"$\",\"$L9\",null,{\"ref\":\"$undefined\",\"iconNode\":[[\"path\",{\"d\":\"M21 12a9 9 0 1 1-6.219-8.56\",\"key\":\"13zald\"}]],\"className\":\"lucide-loader-circle animate-spin text-muted-foreground\",\"size\":16,\"color\":\"currentColor\",\"strokeWidth\":2,\"aria-hidden\":\"true\"}],\" 加载中\"]}],[],[]],false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",\"$undefined\"],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\n"])</script><script>self.__next_f.push([1,"8:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Claude Code测试平台\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Claude Code测试平台\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$8:metadata\"\n"])</script></body></html>
|
|
1
|
+
<!DOCTYPE html><!--mDIzKji_qQhRRLbZUHK6V--><html lang="zh-CN" class="sora_a6e0e515-module__NbNjtG__variable dm_sans_fa25cdfd-module__fB5nTW__variable jetbrains_mono_2b1eae20-module__XfFTLG__variable font-sans"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/app/_next/static/chunks/fa361913d47fdc14.css" data-precedence="next"/><link rel="stylesheet" href="/app/_next/static/chunks/e7bd145455a541af.css" data-precedence="next"/><link rel="stylesheet" href="/app/_next/static/chunks/5817c66b26ce8538.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/app/_next/static/chunks/76a71d344cc15a9f.js"/><script src="/app/_next/static/chunks/91adb7bdb9870c6a.js" async=""></script><script src="/app/_next/static/chunks/40268f8e3ff0314e.js" async=""></script><script src="/app/_next/static/chunks/32b4d63e10d31351.js" async=""></script><script src="/app/_next/static/chunks/66b30159915524db.js" async=""></script><script src="/app/_next/static/chunks/turbopack-030a42d60560a927.js" async=""></script><script src="/app/_next/static/chunks/e520aa06a5014225.js" async=""></script><script src="/app/_next/static/chunks/fc4be3bcf72559a0.js" async=""></script><script src="/app/_next/static/chunks/7988d5ea63356e10.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Claude Code测试平台</title><meta name="description" content="Claude Code测试平台"/><script src="/app/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><!--$--><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><!--/$--><script src="/app/_next/static/chunks/76a71d344cc15a9f.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[13354,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"AppToaster\"]\n3:I[39756,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n4:I[37457,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n5:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"OutletBoundary\"]\n7:I[11533,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"AsyncMetadataOutlet\"]\n9:I[58541,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\na:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"ViewportBoundary\"]\nc:I[97367,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[68027,[\"/app/_next/static/chunks/e520aa06a5014225.js\",\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"/app/_next/static/chunks/7988d5ea63356e10.js\"],\"default\"]\n:HL[\"/app/_next/static/chunks/fa361913d47fdc14.css\",\"style\"]\n:HL[\"/app/_next/static/chunks/e7bd145455a541af.css\",\"style\"]\n:HL[\"/app/_next/static/chunks/5817c66b26ce8538.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"mDIzKji-qQhRRLbZUHK6V\",\"p\":\"/app\",\"c\":[\"\",\"_not-found\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/fa361913d47fdc14.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/e7bd145455a541af.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/app/_next/static/chunks/5817c66b26ce8538.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/app/_next/static/chunks/e520aa06a5014225.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/app/_next/static/chunks/fc4be3bcf72559a0.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/app/_next/static/chunks/7988d5ea63356e10.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"className\":\"sora_a6e0e515-module__NbNjtG__variable dm_sans_fa25cdfd-module__fB5nTW__variable jetbrains_mono_2b1eae20-module__XfFTLG__variable font-sans\",\"children\":[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:1:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$L6\",[\"$\",\"$L7\",null,{\"promise\":\"$@8\"}]]}]]}],{},null,false]},null,false]},[[\"$\",\"div\",\"l\",{\"className\":\"flex min-h-[40vh] flex-1 items-center justify-center gap-2 text-sm text-zinc-500\",\"children\":[[\"$\",\"$L9\",null,{\"ref\":\"$undefined\",\"iconNode\":[[\"path\",{\"d\":\"M21 12a9 9 0 1 1-6.219-8.56\",\"key\":\"13zald\"}]],\"className\":\"lucide-loader-circle animate-spin text-muted-foreground\",\"size\":16,\"color\":\"currentColor\",\"strokeWidth\":2,\"aria-hidden\":\"true\"}],\" 加载中\"]}],[],[]],false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",\"$undefined\"],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\n"])</script><script>self.__next_f.push([1,"8:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Claude Code测试平台\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Claude Code测试平台\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$8:metadata\"\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31862,e=>{"use strict";let t;e.s(["TeamsView",()=>ea],31862);var a=e.i(18050),s=e.i(71645),r=e.i(56708),l=e.i(19455),n=e.i(72064),i=e.i(53145),o=e.i(74080),d=e.i(94197),c=e.i(13354),m=e.i(24687),x=e.i(75157);let u={expand:!0,copy:!0};function p(e){let{value:t,onChange:r,minLines:l,placeholder:n,readOnly:i,className:o}=e,d=(0,s.useRef)(null),c=(0,s.useRef)(null),u=Math.max(t.split("\n").length,l),p=(0,s.useCallback)(()=>{d.current&&c.current&&(c.current.scrollTop=d.current.scrollTop)},[]);return(0,a.jsxs)("div",{className:(0,x.cn)("flex min-h-0 flex-1",o),children:[(0,a.jsx)("div",{ref:c,"aria-hidden":!0,className:"w-10 shrink-0 overflow-hidden border-r border-[var(--ds-border)] bg-[#fafafa] py-3 text-right font-mono text-xs leading-[1.5] text-[var(--ds-muted)]",children:Array.from({length:u},(e,t)=>(0,a.jsx)("div",{className:"px-2",children:t+1},t))}),(0,a.jsx)(m.Textarea,{ref:d,spellCheck:!1,readOnly:i,value:t,onChange:e=>r(e.target.value),onScroll:p,placeholder:n,className:"agent-md-editor min-h-0 flex-1 resize-none rounded-none border-0 bg-white px-4 py-3 shadow-none focus-visible:ring-0"})]})}function h(e){let{actions:t,copyDisabled:s,onCopy:r,className:l}=e;return t.copy?(0,a.jsx)("div",{className:(0,x.cn)("flex items-center gap-0.5",l),children:(0,a.jsx)(d.IconTooltipButton,{icon:"Copy",label:"复制内容",disabled:s,onClick:r})}):null}function b(e){let{show:t,expanded:s,onToggleExpand:r,className:l}=e;return t?(0,a.jsx)("div",{className:(0,x.cn)("flex items-center",l),children:(0,a.jsx)(d.IconTooltipButton,{icon:s?"Minimize2":"Maximize2",label:s?"收起编辑器":"展开编辑器",onClick:r})}):null}function f(e){let{value:t,onChange:r,minLines:l=20,className:n,placeholder:i="编辑 Markdown 内容",readOnly:d=!1,actions:m,expandTitle:f="编辑 Markdown",copySuccessMessage:v="已复制到剪贴板",copyEmptyMessage:g="暂无内容可复制"}=e,[j,N]=(0,s.useState)(!1),y=!1===m?{expand:!1,copy:!1}:{...u,...m},w=(0,s.useCallback)(()=>{if(!t.trim())return void c.appToast.error(g);("undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(t):"undefined"==typeof document?Promise.reject(Error("Clipboard unavailable")):new Promise((e,a)=>{let s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.top="-9999px",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let r=document.execCommand("copy");if(document.body.removeChild(s),r)return void e();a(Error("Clipboard copy failed"))})).then(()=>{c.appToast.success(v)},()=>{c.appToast.error("复制失败,请手动选择复制")})},[t,v,g]),C=(0,s.useCallback)(()=>{N(e=>!e)},[]);(0,s.useEffect)(()=>{if(!j)return;let e=e=>{"Escape"===e.key&&N(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[j]);let k=(0,x.cn)("relative flex min-h-[320px] flex-1 flex-col overflow-hidden rounded-lg border border-[var(--ds-border)] bg-white",n),T=!t.trim()||d,A=(0,a.jsxs)("div",{className:k,children:[(0,a.jsx)(h,{actions:y,copyDisabled:T,onCopy:w,className:"absolute right-2 top-2 z-[1]"}),(0,a.jsx)(p,{value:t,onChange:r,minLines:l,placeholder:i,readOnly:d}),(0,a.jsx)(b,{show:y.expand,expanded:!1,onToggleExpand:C,className:"absolute bottom-2 right-2 z-[1]"})]}),S=j&&"undefined"!=typeof document?(0,o.createPortal)((0,a.jsxs)("div",{className:"fixed inset-0 z-[100] flex flex-col bg-[var(--surface-2)]",role:"dialog","aria-modal":"true","aria-label":f,children:[(0,a.jsx)("header",{className:"flex shrink-0 items-center border-b border-[var(--ds-border)] px-5 py-4",children:(0,a.jsx)("h2",{className:"truncate text-lg font-semibold text-[var(--ds-text)]",children:f})}),(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col p-5",children:(0,a.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-[var(--ds-border)] bg-white",children:[(0,a.jsx)(h,{actions:y,copyDisabled:T,onCopy:w,className:"absolute right-2 top-2 z-[1]"}),(0,a.jsx)(p,{value:t,onChange:r,minLines:l,placeholder:i,readOnly:d,className:"min-h-0 flex-1"}),(0,a.jsx)(b,{show:y.expand,expanded:!0,onToggleExpand:C,className:"absolute bottom-2 right-2 z-[1]"})]})})]}),document.body):null;return(0,a.jsxs)(a.Fragment,{children:[A,S]})}var v=e.i(51419),g=e.i(87676),j=e.i(93479),N=e.i(77572),y=e.i(65934),w=e.i(61196),C=e.i(52727);let k=/^[a-zA-Z0-9_-]{1,64}$/,T=[{id:"all",label:"全部"},{id:"joined_other",label:"已加入其他团队"}];function A(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,a=String(e||"").replace(/\s+/g," ").trim();return a?a.length<=t?a:"".concat(a.slice(0,t-1),"…"):"暂无使用说明"}var S=e.i(46798),z=e.i(8279);let F={sm:"h-7 w-7 text-xs",md:"h-9 w-9 text-sm"};function E(e){let{label:t,size:s="md",className:r}=e,l=(0,z.initialsFromLabel)(t);return(0,a.jsx)(S.TooltipProvider,{delayDuration:150,children:(0,a.jsxs)(S.Tooltip,{children:[(0,a.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,a.jsx)("span",{className:(0,x.cn)("inline-flex shrink-0 cursor-default items-center justify-center rounded-full font-semibold text-white",F[s],r),style:{background:(0,z.avatarBgForLabel)(t)},"aria-label":t,children:l})}),(0,a.jsx)(S.TooltipContent,{side:"bottom",align:"center",className:"text-base",children:t})]})})}let D=[{value:"basic",label:"基本信息"}],M=[{value:"agents",label:"AGENTS"}];function B(e){let{mode:t,editAgentId:r,onClose:o,onSaved:d}=e,u=(0,y.useAppStore)(e=>e.wsUrl),p=(0,y.useAppStore)(e=>e.apiBase),h=(0,w.useStageThreadFlyoutStore)(e=>e.setFlyoutDirty),b=(0,w.useStageThreadFlyoutStore)(e=>e.requestCloseFlyout),T="edit"===t,[A,S]=(0,s.useState)(!1),[z,F]=(0,s.useState)(T),[B,I]=(0,s.useState)(null),[R,_]=(0,s.useState)("basic"),L=(0,s.useRef)(null),O=(0,i.useForm)({defaultValues:{id:"",whentouse:"",prompt:""},mode:"onChange"}),{isDirty:P}=(0,i.useFormState)({control:O.control}),H=O.watch("id"),U=T?"编辑 Agent · ".concat(null!=r?r:H):"新建Agent",G=A?T?"保存中…":"创建中…":"保存",V=(0,s.useCallback)(async()=>{let e=null==r?void 0:r.trim();if(e){F(!0),I(null);try{let t=await (0,C.getAgentDetail)(u,p,e);L.current=t.config,O.reset({id:t.id,whentouse:t.whentouse,prompt:t.prompt})}catch(t){let e=t instanceof Error?t.message:String(t);I(e),c.appToast.error("加载失败:".concat(e))}finally{F(!1)}}},[r,u,p,O]);(0,s.useEffect)(()=>{T&&V()},[T,V]),(0,s.useEffect)(()=>(h(P),()=>h(!1)),[P,h]);let q=(0,s.useCallback)(()=>{b()},[b]),K=(0,s.useCallback)(async e=>{let t=(T&&null!=r?r:e.id).trim();if(t){if(!T&&!k.test(String(t||"").trim()))return void c.appToast.error("Agent ID 仅支持字母、数字、下划线和中划线,长度 1~64");S(!0);try{T?(await (0,C.updateAgent)(u,p,{id:t,prompt:e.prompt,whentouse:e.whentouse,baseConfig:L.current}),c.appToast.success("已保存")):(await (0,C.createAgent)(u,p,{id:t,whentouse:e.whentouse,prompt:e.prompt}),c.appToast.success("已创建")),await (null==d?void 0:d()),o()}catch(t){let e=T?"保存":"创建";c.appToast.error("".concat(e,"失败:").concat(t instanceof Error?t.message:String(t)))}finally{S(!1)}}},[T,r,u,p,o,d]);return(0,a.jsx)(g.Form,{...O,children:(0,a.jsxs)("form",{className:"flex h-full min-h-0 flex-col bg-[var(--surface-2)]",onSubmit:O.handleSubmit(K),children:[(0,a.jsxs)("header",{className:"shrink-0 border-b border-[var(--ds-border)] bg-[var(--surface-2)] px-5 pb-4 pt-5",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,a.jsx)(l.Button,{type:"button",variant:"plain",size:"icon",onClick:q,disabled:A,className:"shrink-0 cursor-pointer px-2 text-[var(--ds-text)] hover:bg-transparent hover:text-[color:var(--ds-accent)] [&_svg_path]:!fill-current","aria-label":"返回",children:(0,a.jsx)(n.default,{name:"Back",size:16})}),(0,a.jsx)("h2",{className:"truncate text-lg font-semibold text-[var(--ds-text)]",children:U})]}),(0,a.jsx)(l.Button,{type:"submit",variant:"default",size:"lg",disabled:A||z||!!B,className:"shrink-0 cursor-pointer rounded-lg bg-[#111] px-5 hover:bg-[#333]",children:G})]}),(0,a.jsx)("div",{className:"mt-4 flex items-center gap-3",children:(0,a.jsx)(N.Tabs,{value:R,onValueChange:_,className:"min-w-0 flex-1",children:(0,a.jsx)(N.TabsList,{variant:"pill",className:"mx-auto w-fit",children:D.map(e=>(0,a.jsx)(N.TabsTrigger,{value:e.value,disabled:e.disabled,children:e.label},e.value))})})})]}),(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4",children:z?(0,a.jsx)("div",{className:"flex min-h-[240px] flex-1 items-center justify-center text-sm text-[var(--ds-muted)]",role:"status","aria-live":"polite",children:"加载中…"}):B?(0,a.jsxs)("div",{className:"flex min-h-[240px] flex-1 flex-col items-center justify-center gap-3 text-sm text-destructive",role:"alert",children:[(0,a.jsxs)("span",{children:["加载失败:",B]}),(0,a.jsx)(l.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>void V(),children:"重试"})]}):"basic"===R?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("section",{className:"rounded-xl border border-[var(--ds-border)] bg-white p-4",children:(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)("div",{className:"flex shrink-0 flex-col items-center gap-2",children:(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(E,{label:H.trim()||"Agent",className:"h-16 w-16 text-lg"})})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-3",children:[(0,a.jsx)(g.FormField,{control:O.control,name:"id",render:e=>{let{field:t}=e;return(0,a.jsxs)(g.FormItem,{children:[(0,a.jsx)(g.FormControl,{children:(0,a.jsx)(j.Input,{...t,readOnly:T,spellCheck:!1,placeholder:"例如 my-agent",autoComplete:"off",className:(0,x.cn)("h-10 rounded-md border-[var(--ds-border)] bg-[var(--ds-bg)] text-base",T&&"cursor-default text-[var(--ds-muted)]")})}),(0,a.jsx)(g.FormMessage,{})]})}}),(0,a.jsx)(g.FormField,{control:O.control,name:"whentouse",render:e=>{let{field:t}=e;return(0,a.jsxs)(g.FormItem,{children:[(0,a.jsx)(g.FormControl,{children:(0,a.jsx)(m.Textarea,{...t,spellCheck:!1,placeholder:"用一句话说明它的身份 + 它主要帮你做什么",className:"min-h-[88px] resize-none rounded-md border-[var(--ds-border)] bg-[var(--ds-bg)] text-base leading-relaxed"})}),(0,a.jsx)(g.FormMessage,{})]})}})]})]})}),(0,a.jsx)(v.AppTabs,{tabs:M,defaultValue:"agents",listVariant:"line",listClassName:"mt-4",className:"min-h-0 flex-1",children:(0,a.jsx)(v.AppTabsPanel,{value:"agents",className:"mt-4 flex min-h-0 flex-1 flex-col",children:(0,a.jsx)(g.FormField,{control:O.control,name:"prompt",render:e=>{let{field:t}=e;return(0,a.jsxs)(g.FormItem,{className:"flex min-h-0 flex-1 flex-col",children:[(0,a.jsx)(g.FormControl,{children:(0,a.jsx)(f,{value:t.value,onChange:t.onChange,className:"min-h-[320px]",placeholder:"编辑 Agent 提示词(agent.md)",expandTitle:"编辑 (agent.md)"})}),(0,a.jsx)(g.FormMessage,{})]})}})})})]}):(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center text-sm text-[var(--ds-muted)]",children:"敬请期待"})})]})})}var I=e.i(68499),R=e.i(55146),_=e.i(97249);function L(e){let{label:t,hint:s,icon:r,onClick:l}=e,i=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.default,{name:r,size:14,className:"shrink-0 text-[var(--ds-muted)]"}),(0,a.jsx)("span",{children:s})]}),o=(0,x.cn)("inline-flex min-h-9 w-fit max-w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-[var(--ds-border)] !bg-transparent px-3 text-base text-[var(--ds-muted)]",l&&"cursor-pointer hover:border-[color:var(--ds-border-hover)] hover:bg-[var(--ds-main-tint)]");return l?(0,a.jsx)("button",{type:"button",className:o,onClick:l,"aria-label":t,children:i}):(0,a.jsx)("div",{className:o,"aria-label":t,children:i})}let O=(0,e.i(75254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var P=e.i(57428),H=e.i(76639);let U={captain:null,members:[]};function G(e){return{id:e.id,displayName:e.displayName.trim()||e.id}}function V(e,t,a,s){for(let l of a){var r;if(l.id===t)continue;let a=s(l.id);if((null==(r=a.captain)?void 0:r.id)===e||a.members.some(t=>t.id===e))return l.id}return null}function q(e){let{member:t,subtitle:s,onRemove:r,badge:l}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--ds-border)] bg-[var(--ds-bg)] px-2.5 py-2",children:[(0,a.jsx)(E,{label:t.displayName,size:"sm"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"mb-0 truncate text-sm font-medium text-[var(--ds-text)]",children:t.displayName}),(0,a.jsx)("p",{className:"mb-0 truncate text-xs text-[var(--ds-muted)]",children:s})]}),l?(0,a.jsx)("span",{className:"shrink-0 rounded bg-[var(--green-light)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--green-dark)]",children:l}):null,r?(0,a.jsx)(d.IconTooltipButton,{icon:"Close",label:"移除agent",className:"!h-7 !w-7 shrink-0 bg-transparent text-[var(--ds-muted)] hover:bg-transparent hover:text-[color:var(--ds-accent)]",iconClassName:"!size-3.5",onClick:r}):null]})}function K(e){let{open:t,onOpenChange:r,team:i,allAgents:o,rosters:d,onConfirm:m,onAgentsRefresh:u}=e,p=(0,y.useAppStore)(e=>e.wsUrl),h=(0,y.useAppStore)(e=>e.apiBase),b=i.id,f=d.getRoster,[v,g]=(0,s.useState)(""),[N,w]=(0,s.useState)("all"),[k,S]=(0,s.useState)([]),[z,F]=(0,s.useState)(!1),D=(0,s.useMemo)(()=>G(i),[i]);(0,s.useEffect)(()=>{if(!t)return;let e=f(b);g(""),w("all"),S(e.members.filter(e=>e.id!==b).map(e=>e.id))},[t,b,f]);let M=(0,s.useMemo)(()=>k.map(e=>o.find(t=>t.id===e)).filter(e=>null!=e).map(G),[k,o]),B=(0,s.useMemo)(()=>o.filter(e=>{if(!function(e,t){let a=t.trim().toLowerCase();return!a||"".concat(e.id," ").concat(e.displayName," ").concat(e.whentouse).toLowerCase().includes(a)}(e,v))return!1;let t=e.id===b,a=V(e.id,b,o,f);return"available"===N?!t:"joined_other"===N?!!a:"recommended"!==N||!a&&!t}),[o,v,N,b,f]),I=(0,s.useCallback)((e,t)=>{e!==b&&S(a=>t?a.includes(e)?a:[...a,e]:a.filter(t=>t!==e))},[b]),R=(0,s.useCallback)(()=>{S([])},[]),_=(0,s.useCallback)(()=>{r(!1)},[r]),L=(0,s.useCallback)(()=>{(async()=>{let e=b.trim();if(!e||z)return;let t=f(b).members.map(e=>e.id),a=k.filter(e=>!t.includes(e)),s=t.filter(e=>!k.includes(e));if(0===a.length&&0===s.length)return _();F(!0);try{for(let t of s)await (0,C.removeTeamMember)(p,h,e,t);for(let t of a)await (0,C.addTeamMember)(p,h,e,t);await (null==u?void 0:u()),m({captain:D,members:M}),a.length>0&&0===s.length?c.appToast.success(1===a.length?"已添加队员 ".concat(a[0]):"已添加 ".concat(a.length," 名队员")):c.appToast.success("已更新队员"),_()}catch(e){c.appToast.error("添加队员失败:".concat(e instanceof Error?e.message:String(e)))}finally{F(!1)}})()},[b,z,f,k,p,h,u,m,D,M,_]);return(0,a.jsx)(H.Dialog,{open:t,onOpenChange:r,children:(0,a.jsxs)(H.DialogContent,{className:"max-w-[920px]","aria-labelledby":"add-team-members-title",children:[(0,a.jsxs)(H.DialogHeader,{className:"items-start gap-3",children:[(0,a.jsx)(H.DialogTitle,{id:"add-team-members-title",className:"text-lg",children:"添加队员"}),(0,a.jsx)(H.DialogClose,{"aria-label":"关闭"})]}),(0,a.jsx)(H.DialogBody,{className:"!p-0",children:(0,a.jsxs)("div",{className:"flex h-[min(68vh,520px)] min-h-0 flex-col px-[24px] md:flex-row",children:[(0,a.jsxs)("div",{className:"mr-[16px] flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden border-b border-[var(--ds-border)] md:border-b-0 md:border-r",children:[(0,a.jsxs)("div",{className:"shrink-0 space-y-3 border-b border-[var(--ds-border)] pb-4",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(O,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-[var(--ds-muted)]","aria-hidden":!0}),(0,a.jsx)(j.Input,{value:v,onChange:e=>g(e.target.value),placeholder:"搜索成员名称 / 能力 / 标签",className:"h-8 pl-8"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:T.map(e=>{let t=N===e.id;return(0,a.jsx)(l.Button,{type:"button",variant:"plain-outline",size:"sm",className:(0,x.cn)("cursor-pointer rounded-full px-3",t&&"border-[color:var(--ds-accent)] bg-[var(--green-light)] text-[var(--green-dark)] hover:bg-[var(--green-light)]"),onClick:()=>w(e.id),children:e.label},e.id)})})]}),(0,a.jsx)("ul",{className:"m-0 min-h-0 flex-1 list-none space-y-4 overflow-y-auto",role:"listbox","aria-label":"可选队员",children:B.map(e=>{let t=e.id===b,s=k.includes(e.id),r=V(e.id,b,o,f),l=function(e){let t=A(e,24);return"暂无使用说明"===t?[]:t.split(/[,,、\s]+/).filter(Boolean).slice(0,2)}(e.whentouse),i=A(e.whentouse,32);return(0,a.jsx)("li",{children:(0,a.jsxs)("label",{className:(0,x.cn)("flex cursor-pointer items-center gap-3 rounded-lg border border-solid bg-[var(--ds-bg)] px-2 py-2.5 transition-[border-color,background-color]","border-[color:var(--ds-border)]",t?"cursor-not-allowed opacity-60":"hover:border-[color:var(--ds-border-hover)] hover:bg-[var(--ds-main-tint)]",s&&!t&&"bg-[var(--green-light)]/40 border-[color:var(--ds-accent)]"),children:[(0,a.jsx)(P.Checkbox,{checked:!t&&s,disabled:t,onChange:t=>I(e.id,t.target.checked),"aria-label":"选择 ".concat(e.displayName)}),(0,a.jsx)(E,{label:e.displayName,size:"md"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"mb-0 truncate font-medium text-[var(--ds-text)]",children:[e.displayName,t?(0,a.jsx)("span",{className:"ml-1 text-xs font-normal text-[var(--ds-muted)]",children:"(当前团队)"}):null]}),(0,a.jsx)("p",{className:"mb-0 mt-0.5 truncate text-base text-[var(--ds-muted)]",children:i}),l.length>0?(0,a.jsx)("div",{className:"mt-1 flex flex-wrap gap-1",children:l.map(e=>(0,a.jsx)("span",{className:"rounded bg-[var(--surface-2)] px-1.5 py-0.5 text-[10px] text-[var(--ds-muted)]",children:e},e))}):null]}),(0,a.jsx)("div",{className:"shrink-0 text-right",children:t?(0,a.jsx)("span",{className:"text-xs text-[var(--ds-muted)]",children:"不可选"}):r?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-amber-600",children:[(0,a.jsx)(n.default,{name:"Info",size:14}),"已加入其他团队"]}):(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-[var(--green-dark)]",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-[var(--ds-accent)]"}),"可用 Agent"]})})]})},e.id)})}),(0,a.jsxs)("div",{className:"shrink-0 border-t border-[var(--ds-border)] px-4 py-2.5 text-sm text-[var(--ds-muted)]",children:["已选择 ",k.length," 名队员"]})]}),(0,a.jsx)("div",{className:"flex min-h-0 w-full shrink-0 flex-col overflow-hidden bg-[var(--ds-log-bg)] md:w-[300px]",children:(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden p-4",children:(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[(0,a.jsxs)("div",{className:"mb-2 flex shrink-0 items-center justify-between gap-2",children:[(0,a.jsxs)("span",{className:"text-sm font-medium text-[var(--ds-text)]",children:["已选成员(",M.length,")"]}),(0,a.jsx)(l.Button,{type:"button",variant:"plain",size:"sm",disabled:0===M.length,className:"h-auto cursor-pointer !px-1 text-xs text-[var(--ds-accent)] hover:bg-transparent hover:text-[var(--ds-text)] disabled:cursor-not-allowed",onClick:R,children:"清空"})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:M.length>0?(0,a.jsx)("div",{className:"space-y-4",children:M.map(e=>{let t=o.find(t=>t.id===e.id),s=t?A(t.whentouse,28):e.id;return(0,a.jsx)(q,{member:e,subtitle:s,onRemove:()=>I(e.id,!1)},e.id)})}):(0,a.jsx)("p",{className:"mb-0 text-xs text-[var(--ds-muted)]",children:"请从左侧勾选队员"})})]})})})]})}),(0,a.jsxs)("div",{className:"flex shrink-0 justify-end gap-2 border-t border-[var(--ds-border)] bg-[var(--ds-sidebar)] px-5 py-3",children:[(0,a.jsx)(l.Button,{type:"button",variant:"plain-outline",size:"lg",onClick:_,className:"cursor-pointer",children:"取消"}),(0,a.jsx)(l.Button,{type:"button",variant:"default",size:"lg",onClick:L,disabled:z,className:"cursor-pointer disabled:cursor-not-allowed",children:z?"添加中…":"确认添加"})]})]})})}function W(e){let{open:t,onOpenChange:r,title:n,description:i,candidates:o,onPick:d}=e,[c,m]=(0,s.useState)("");(0,s.useEffect)(()=>{t&&m("")},[t]);let u=(0,s.useCallback)(()=>{r(!1)},[r]),p=(0,s.useCallback)(()=>{let e=o.find(e=>e.id===c);e&&(d(e),u())},[o,c,d,u]),h=(0,s.useMemo)(()=>o.length>0?null:"暂无可选 Agent",[o.length]);return(0,a.jsx)(H.Dialog,{open:t,onOpenChange:r,children:(0,a.jsxs)(H.DialogContent,{className:"max-w-[480px]","aria-labelledby":"pick-team-member-title",children:[(0,a.jsxs)(H.DialogHeader,{className:"items-start gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)(H.DialogTitle,{id:"pick-team-member-title",children:n}),(0,a.jsx)(H.DialogDescription,{className:"mt-1",children:i})]}),(0,a.jsx)(H.DialogClose,{"aria-label":"关闭"})]}),(0,a.jsx)(H.DialogBody,{className:"max-h-[min(50vh,360px)] overflow-y-auto !px-5 !py-4",children:h?(0,a.jsx)("p",{className:"mb-0 text-center text-sm text-[var(--ds-muted)]",children:h}):(0,a.jsx)("ul",{className:"m-0 list-none space-y-1 p-0",role:"listbox",children:o.map(e=>{let t=c===e.id,s=G(e);return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":t,className:(0,x.cn)("flex w-full cursor-pointer items-center gap-3 rounded-lg border border-solid px-3 py-2.5 text-left transition-colors",t?"border-[color:var(--ds-accent)] bg-[var(--green-light)]":"border-[color:var(--ds-border)] bg-[var(--ds-bg)] hover:bg-[var(--ds-main-tint)]"),onClick:()=>m(e.id),children:[(0,a.jsx)(E,{label:s.displayName,size:"md"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"mb-0 truncate text-sm font-medium text-[var(--ds-text)]",children:s.displayName}),(0,a.jsx)("p",{className:"mb-0 mt-0.5 truncate text-xs text-[var(--ds-muted)]",children:e.id})]})]})},e.id)})})}),(0,a.jsxs)("div",{className:"flex shrink-0 justify-end gap-2 border-t border-[var(--ds-border)] bg-[var(--ds-sidebar)] px-5 py-3",children:[(0,a.jsx)(l.Button,{type:"button",variant:"plain-outline",size:"lg",onClick:u,className:"cursor-pointer",children:"取消"}),(0,a.jsx)(l.Button,{type:"button",variant:"default",size:"lg",disabled:!c,onClick:p,className:"cursor-pointer",children:"确定"})]})]})})}function Y(e){let{member:t,onRemove:s}=e;return(0,a.jsxs)("span",{className:(0,x.cn)("] relative inline-flex w-fit items-center rounded-full",s&&"pr-5"),children:[(0,a.jsx)(E,{label:t.displayName,size:"sm"}),s?(0,a.jsx)(d.IconTooltipButton,{icon:"CircleX",label:"移除 ".concat(t.displayName),tone:"muted",className:"absolute -right-3 -top-1.5 !h-4 !w-4 shrink-0",iconClassName:"!size-3.5 !text-[var(--text-secondary)]",onClick:s}):null]})}function $(e){let{members:t,onRemoveMember:r}=e,[l,n]=(0,s.useState)(!1),i=(0,s.useCallback)(e=>()=>{r(e)},[r]);return(0,a.jsxs)("div",{className:"relative shrink-0",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[(0,a.jsxs)("span",{className:"inline-flex cursor-default items-center rounded-full border border-[var(--ds-border)] bg-[var(--surface-2)] px-2.5 py-1 text-sm font-medium text-[var(--ds-muted)]","aria-label":"还有 ".concat(t.length," 名队员"),children:["+",t.length]}),l?(0,a.jsx)("div",{className:"absolute left-0 top-full z-[60] pt-1.5",children:(0,a.jsxs)("div",{className:(0,x.cn)("min-w-[200px] max-w-[min(100vw-32px,320px)]","rounded-xl border border-[var(--ds-border)] bg-[var(--ds-bg)] p-2 shadow-[var(--shadow-float)]"),role:"tooltip",children:[(0,a.jsxs)("p",{className:"mb-2 px-1 text-xs text-[var(--ds-muted)]",children:["其余队员(",t.length,")"]}),(0,a.jsx)("div",{className:"flex max-h-[240px] flex-col gap-2 overflow-y-auto",children:t.map(e=>(0,a.jsx)(Y,{member:e,onRemove:i(e.id)},e.id))})]})}):null]})}function X(e){let{leaderId:t,members:r,onAgentsRefresh:l}=e,n=(0,y.useAppStore)(e=>e.wsUrl),i=(0,y.useAppStore)(e=>e.apiBase),[o,d]=(0,s.useState)(null),m=(0,s.useCallback)(e=>{(async()=>{let a=e.trim(),s=t.trim();if(s&&a&&!o&&await (0,I.confirmAlertDialog)({title:"确定移除队员?",description:"确定移除队员「".concat(a,"」?"),confirmText:"移除",cancelText:"取消"})){d(a);try{await (0,C.removeTeamMember)(n,i,s,a),await (null==l?void 0:l()),c.appToast.success("已移除队员")}catch(e){c.appToast.error("移除队员失败:".concat(e instanceof Error?e.message:String(e)))}finally{d(null)}}})()},[t,o,n,i,l]),x=r.slice(0,8),u=r.slice(8);return(0,a.jsxs)("div",{className:"flex min-w-0 max-w-full flex-wrap items-center gap-2",children:[x.map(e=>(0,a.jsx)(Y,{member:e},e.id)),u.length>0?(0,a.jsx)($,{members:u,onRemoveMember:m}):null]})}function Z(e){let{onEdit:t,onDelete:r,deleting:l=!1}=e,[i,o]=(0,s.useState)(!1);return(0,a.jsxs)(R.DropdownMenu,{open:i,onOpenChange:o,children:[(0,a.jsx)(R.DropdownMenuTrigger,{type:"button",className:"inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0 text-[var(--ds-muted)] hover:bg-transparent hover:text-[color:var(--ds-accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ds-accent)]","aria-label":"更多",onClick:e=>{e.stopPropagation()},children:(0,a.jsx)(n.default,{name:"More",size:20})}),(0,a.jsxs)(R.DropdownMenuContent,{align:"end",side:"bottom",sideOffset:6,className:"w-[172px] min-w-[172px] rounded-[var(--ds-radius-sm)] border border-[var(--ds-border)] bg-[var(--ds-bg)] p-1.5",children:[(0,a.jsxs)(R.DropdownMenuItem,{className:"h-9 rounded-xl px-2.5 text-base text-[var(--ds-text)] hover:bg-[var(--ds-item-active)] focus:bg-[var(--ds-item-hover)]",onClick:()=>{o(!1),t()},children:[(0,a.jsx)(n.default,{name:"Edit",size:16,className:"text-[var(--ds-muted)]"}),"编辑 Agent"]}),(0,a.jsx)(R.DropdownMenuSeparator,{className:"mx-1 my-1 bg-[var(--ds-border)]"}),(0,a.jsxs)(R.DropdownMenuItem,{variant:"destructive",disabled:l,className:"h-9 rounded-xl px-2.5 text-base hover:bg-[#fff1f1] focus:bg-[#fff1f1]",onClick:()=>{o(!1),r()},children:[(0,a.jsx)(n.default,{name:"Trash2",size:16}),"删除 Agent"]})]})]})}function J(e){let{team:r,allAgents:l,rosters:n,onAgentSaved:i}=e,o=(0,y.useAppStore)(e=>e.agentId),m=(0,y.useAppStore)(e=>e.wsUrl),u=(0,y.useAppStore)(e=>e.apiBase),p=o.trim()||"qihoo",h=r.id===p,b=n.getRoster(r.id),f=A(r.whentouse),v=(0,z.initialsFromLabel)(r.id).slice(0,1),[g,j]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!1),[T,S]=(0,s.useState)(!1),F=n.getAvailableCandidates(r.id,l),E=(0,s.useCallback)(e=>{n.setCaptain(r.id,G(e))},[n,r.id]),D=(0,s.useCallback)(e=>{n.applyRoster(r.id,e)},[n,r.id]),M=(0,s.useCallback)(()=>{let e=r.id.trim();if(!e||e===p)return;let t=(0,_.buildAppNavHref)("/",{ensureAgent:!0,agent:e}),a=_.BASE_PATH.replace(/\/+$/,""),s="".concat(window.location.origin).concat(a).concat(t);window.open(s,"_blank","noopener")},[r.id,p]),R=(0,s.useCallback)(()=>{!function(e){var s;let r=e.agentId.trim();if(!r)return;let{openFlyout:l,closeFlyout:n}=w.useStageThreadFlyoutStore.getState(),i=null!=(s=e.onSaved)?s:t;l({width:w.CREATE_AGENT_FLYOUT_WIDTH,hideHeader:!0,bodyClassName:"!p-0 overflow-hidden",navigationGuard:!0,content:(0,a.jsx)(B,{mode:"edit",editAgentId:r,onClose:n,onSaved:i})})}({agentId:r.id,onSaved:i})},[r.id,i]),O=(0,s.useCallback)(async()=>{let e=r.id.trim();if(e&&await (0,I.confirmAlertDialog)({title:"确定删除 Agent?",description:"Agent「".concat(e,"」将被永久删除,此操作不可恢复。"),confirmText:"删除",cancelText:"取消"})){S(!0);try{await (0,C.deleteAgentItem)(m,u,e),c.appToast.success("已删除"),await (null==i?void 0:i())}catch(e){c.appToast.error("删除失败:".concat(e instanceof Error?e.message:String(e)))}finally{S(!1)}}},[r.id,m,u,i]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:(0,x.cn)("flex w-full flex-wrap items-center gap-4 rounded-xl border border-solid bg-[var(--ds-bg)] px-4 py-3.5 lg:flex-nowrap","border-[color:var(--ds-border)] transition-[border-color,box-shadow]","hover:shadow-[0_2px_12px_rgba(0,0,0,0.06)]"),children:[(0,a.jsxs)("div",{className:"flex min-w-[200px] flex-1 items-center gap-4",children:[(0,a.jsx)("span",{className:"inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-lg text-lg font-semibold text-white",style:{background:(0,z.avatarBgForLabel)(r.id)},"aria-hidden":!0,children:v}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 text-left",children:[(0,a.jsx)("button",{type:"button",onClick:M,disabled:h,className:(0,x.cn)("mb-0 block w-full truncate border-0 bg-transparent p-0 text-left text-base font-semibold text-[var(--ds-text)]",h?"cursor-default":"cursor-pointer hover:text-[color:var(--ds-accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ds-accent)]"),"aria-current":h?"true":void 0,"aria-label":h?"当前 Agent:".concat(r.id):"在新标签页切换到 Agent ".concat(r.id),children:r.id}),(0,a.jsx)("p",{className:"mb-0 mt-1 truncate text-sm text-[var(--ds-muted)]",children:f})]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 max-w-full flex-1 flex-col gap-1.5",children:[(0,a.jsx)("span",{className:"text-base text-[var(--ds-muted)]",children:"队员"}),(0,a.jsxs)("div",{className:"flex min-w-0 max-w-full flex-wrap items-center gap-2",children:[b.members.length>0?(0,a.jsx)(X,{leaderId:r.id,members:b.members,onAgentsRefresh:i}):(0,a.jsx)(L,{label:"队员列表",hint:"暂无队员",icon:"Team"}),(0,a.jsx)(d.IconTooltipButton,{icon:"Create",label:"添加队员",disabled:l.length<=1,className:(0,x.cn)("h-8 w-8 shrink-0 border border-dashed border-[color:var(--ds-border)] hover:border-[color:var(--ds-accent)] hover:text-[color:var(--ds-accent)]",l.length>1&&"text-[var(--ds-accent)] hover:bg-[var(--green-light)]"),iconClassName:"!size-4",onClick:()=>k(!0)})]})]}),(0,a.jsx)(Z,{onEdit:R,onDelete:()=>void O(),deleting:T})]}),(0,a.jsx)(W,{open:g,onOpenChange:j,title:"设置队长",description:"从可选 Agent 中选择一名作为队长",candidates:F,onPick:E}),(0,a.jsx)(K,{open:N,onOpenChange:k,team:r,allAgents:l,rosters:n,onConfirm:D,onAgentsRefresh:i})]})}function Q(e){let{agentsState:t}=e,{agents:r,loading:l,error:n}=t,i=function(e){let[t,a]=(0,s.useState)({});(0,s.useEffect)(()=>{a(t=>{let a={...t};for(let r of e){var s;let l=null!=(s=t[r.id])?s:U;a[r.id]={captain:l.captain,members:function(e,t){return e.agentTeamMembers.map(e=>{let a=t.find(t=>t.id===e.agentType);return{id:e.agentType,displayName:(null==a?void 0:a.displayName.trim())||e.agentType}})}(r,e)}}return a})},[e]);let r=(0,s.useCallback)(e=>{var a;return null!=(a=t[e])?a:U},[t]),l=(0,s.useCallback)((e,t)=>{a(a=>{var s;let r=(null!=(s=a[e])?s:U).members.filter(e=>e.id!==t.id);return{...a,[e]:{captain:t,members:r}}})},[]),n=(0,s.useCallback)(e=>{a(t=>{var a;let s=null!=(a=t[e])?a:U;return{...t,[e]:{...s,captain:null}}})},[]),i=(0,s.useCallback)((e,t)=>{a(a=>{var s,r;let l=null!=(r=a[e])?r:U;return(null==(s=l.captain)?void 0:s.id)===t.id||l.members.some(e=>e.id===t.id)?a:{...a,[e]:{...l,members:[...l.members,t]}}})},[]),o=(0,s.useCallback)((e,t)=>{a(a=>{var s;let r=null!=(s=a[e])?s:U;return{...a,[e]:{...r,members:r.members.filter(e=>e.id!==t)}}})},[]);return{getRoster:r,setCaptain:l,removeCaptain:n,addMember:i,removeMember:o,applyRoster:(0,s.useCallback)((e,t)=>{let s=t.captain,r=t.members.filter(e=>e.id!==(null==s?void 0:s.id));a(t=>({...t,[e]:{captain:s,members:r}}))},[]),getAvailableCandidates:(0,s.useCallback)((e,a)=>{var s;let r=null!=(s=t[e])?s:U,l=new Set([e,...r.captain?[r.captain.id]:[],...r.members.map(e=>e.id)]);return a.filter(e=>!l.has(e.id))},[t])}}(r);return(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col rounded-xl border border-[var(--ds-border)] bg-[var(--ds-bg)] shadow-[var(--shadow-sm)]",children:(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:l?(0,a.jsx)("div",{className:"flex min-h-[200px] items-center justify-center text-sm text-[var(--ds-muted)]",children:"加载中…"}):n?(0,a.jsxs)("div",{className:"flex min-h-[200px] items-center justify-center px-4 text-center text-sm text-red-600",children:["加载失败:",n]}):0===r.length?(0,a.jsx)("div",{className:"flex min-h-[200px] items-center justify-center px-4 text-center text-sm text-[var(--ds-muted)]",children:"暂无 Agent,点击右上角「新建 Agent」创建"}):(0,a.jsx)("ul",{className:"m-0 list-none space-y-4 p-0",role:"list",children:r.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)(J,{team:e,allAgents:r,rosters:i,onAgentSaved:t.loadAgents})},e.id))})})})}function ee(e){let{label:t,value:s,hint:r,icon:l}=e;return(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 flex-1 items-center gap-4 rounded-xl border border-[var(--ds-border)] bg-white px-4 py-3.5 shadow-[var(--shadow-sm)]",children:[(0,a.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-[var(--ds-border)]","aria-hidden":!0,children:(0,a.jsx)(n.default,{name:l,size:20,className:"text-[var(--ds-text)]"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-sm text-[var(--ds-muted)]",children:t}),(0,a.jsx)("span",{className:"mt-1 block text-2xl font-semibold leading-none text-[var(--ds-text)]",children:s}),(0,a.jsx)("span",{className:"mt-1 block text-xs text-[var(--ds-muted)]",children:r})]})]})}function et(e){let{agents:t,className:r}=e,l=(0,s.useMemo)(()=>{let e=t.length;return[{label:"团队总数",value:t.filter(e=>e.agentTeamMembers.length>=1).length,icon:"Teams",hint:"队员数大于 1 的 Agent 编组"},{label:"成员总数",value:e,icon:"Agent",hint:"角色、能力和工具的智能执行体"}]},[t]);return(0,a.jsx)("div",{className:(0,x.cn)("flex flex-wrap gap-3",r),children:l.map(e=>(0,a.jsx)(ee,{...e},e.label))})}function ea(){let e=function(){let e=(0,y.useAppStore)(e=>e.wsUrl),t=(0,y.useAppStore)(e=>e.apiBase),[a,r]=(0,s.useState)([]),[l,n]=(0,s.useState)(!0),[i,o]=(0,s.useState)(null),d=(0,s.useCallback)(async()=>{n(!0),o(null);try{let a=await (0,C.listAgentsForManage)(e,t);r(a)}catch(t){let e=t instanceof Error?t.message:String(t);r([]),o(e),c.appToast.error("加载失败:".concat(e))}finally{n(!1)}},[e,t]);return(0,s.useEffect)(()=>{d()},[d]),{agents:a,loading:l,error:i,loadAgents:d}}();(0,s.useEffect)(()=>(t=e.loadAgents,()=>{t=void 0}),[e.loadAgents]);let i=(0,s.useCallback)(()=>{!function(){var e;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{openFlyout:r,closeFlyout:l}=w.useStageThreadFlyoutStore.getState(),n=null!=(e=s.onSaved)?e:t;r({width:w.CREATE_AGENT_FLYOUT_WIDTH,hideHeader:!0,bodyClassName:"!p-0 overflow-hidden",navigationGuard:!0,content:(0,a.jsx)(B,{mode:"create",onClose:l,onSaved:n})})}()},[]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.ManageChromeHeaderActions,{children:(0,a.jsx)("div",{className:"flex flex-wrap items-center",children:(0,a.jsxs)(l.Button,{type:"button",variant:"default",size:"lg",onClick:i,className:"mr-[12px] cursor-pointer",children:[(0,a.jsx)(n.default,{name:"Create",size:16,className:"align-middle"}),"新建 Agent"]})})}),(0,a.jsx)(et,{agents:e.agents,className:"mb-4"}),(0,a.jsx)(Q,{agentsState:e})]})}}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31862,e=>{"use strict";let t;e.s(["TeamsView",()=>ea],31862);var a=e.i(18050),s=e.i(71645),r=e.i(56708),l=e.i(19455),n=e.i(72064),i=e.i(53145),o=e.i(74080),d=e.i(94197),c=e.i(13354),m=e.i(24687),x=e.i(75157);let u={expand:!0,copy:!0};function p(e){let{value:t,onChange:r,minLines:l,placeholder:n,readOnly:i,className:o}=e,d=(0,s.useRef)(null),c=(0,s.useRef)(null),u=Math.max(t.split("\n").length,l),p=(0,s.useCallback)(()=>{d.current&&c.current&&(c.current.scrollTop=d.current.scrollTop)},[]);return(0,a.jsxs)("div",{className:(0,x.cn)("flex min-h-0 flex-1",o),children:[(0,a.jsx)("div",{ref:c,"aria-hidden":!0,className:"w-10 shrink-0 overflow-hidden border-r border-[var(--ds-border)] bg-[#fafafa] py-3 text-right font-mono text-xs leading-[1.5] text-[var(--ds-muted)]",children:Array.from({length:u},(e,t)=>(0,a.jsx)("div",{className:"px-2",children:t+1},t))}),(0,a.jsx)(m.Textarea,{ref:d,spellCheck:!1,readOnly:i,value:t,onChange:e=>r(e.target.value),onScroll:p,placeholder:n,className:"agent-md-editor min-h-0 flex-1 resize-none rounded-none border-0 bg-white px-4 py-3 shadow-none focus-visible:ring-0"})]})}function h(e){let{actions:t,copyDisabled:s,onCopy:r,className:l}=e;return t.copy?(0,a.jsx)("div",{className:(0,x.cn)("flex items-center gap-0.5",l),children:(0,a.jsx)(d.IconTooltipButton,{icon:"Copy",label:"复制内容",disabled:s,onClick:r})}):null}function b(e){let{show:t,expanded:s,onToggleExpand:r,className:l}=e;return t?(0,a.jsx)("div",{className:(0,x.cn)("flex items-center",l),children:(0,a.jsx)(d.IconTooltipButton,{icon:s?"Minimize2":"Maximize2",label:s?"收起编辑器":"展开编辑器",onClick:r})}):null}function f(e){let{value:t,onChange:r,minLines:l=20,className:n,placeholder:i="编辑 Markdown 内容",readOnly:d=!1,actions:m,expandTitle:f="编辑 Markdown",copySuccessMessage:v="已复制到剪贴板",copyEmptyMessage:g="暂无内容可复制"}=e,[j,N]=(0,s.useState)(!1),y=!1===m?{expand:!1,copy:!1}:{...u,...m},w=(0,s.useCallback)(()=>{if(!t.trim())return void c.appToast.error(g);("undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(t):"undefined"==typeof document?Promise.reject(Error("Clipboard unavailable")):new Promise((e,a)=>{let s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.top="-9999px",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let r=document.execCommand("copy");if(document.body.removeChild(s),r)return void e();a(Error("Clipboard copy failed"))})).then(()=>{c.appToast.success(v)},()=>{c.appToast.error("复制失败,请手动选择复制")})},[t,v,g]),C=(0,s.useCallback)(()=>{N(e=>!e)},[]);(0,s.useEffect)(()=>{if(!j)return;let e=e=>{"Escape"===e.key&&N(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[j]);let k=(0,x.cn)("relative flex min-h-[320px] flex-1 flex-col overflow-hidden rounded-lg border border-[var(--ds-border)] bg-white",n),T=!t.trim()||d,A=(0,a.jsxs)("div",{className:k,children:[(0,a.jsx)(h,{actions:y,copyDisabled:T,onCopy:w,className:"absolute right-2 top-2 z-[1]"}),(0,a.jsx)(p,{value:t,onChange:r,minLines:l,placeholder:i,readOnly:d}),(0,a.jsx)(b,{show:y.expand,expanded:!1,onToggleExpand:C,className:"absolute bottom-2 right-2 z-[1]"})]}),S=j&&"undefined"!=typeof document?(0,o.createPortal)((0,a.jsxs)("div",{className:"fixed inset-0 z-[100] flex flex-col bg-[var(--surface-2)]",role:"dialog","aria-modal":"true","aria-label":f,children:[(0,a.jsx)("header",{className:"flex shrink-0 items-center border-b border-[var(--ds-border)] px-5 py-4",children:(0,a.jsx)("h2",{className:"truncate text-lg font-semibold text-[var(--ds-text)]",children:f})}),(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col p-5",children:(0,a.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-[var(--ds-border)] bg-white",children:[(0,a.jsx)(h,{actions:y,copyDisabled:T,onCopy:w,className:"absolute right-2 top-2 z-[1]"}),(0,a.jsx)(p,{value:t,onChange:r,minLines:l,placeholder:i,readOnly:d,className:"min-h-0 flex-1"}),(0,a.jsx)(b,{show:y.expand,expanded:!0,onToggleExpand:C,className:"absolute bottom-2 right-2 z-[1]"})]})})]}),document.body):null;return(0,a.jsxs)(a.Fragment,{children:[A,S]})}var v=e.i(51419),g=e.i(87676),j=e.i(93479),N=e.i(77572),y=e.i(65934),w=e.i(61196),C=e.i(52727);let k=/^[a-zA-Z0-9_-]{1,64}$/,T=[{id:"all",label:"全部"},{id:"joined_other",label:"已加入其他团队"}];function A(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,a=String(e||"").replace(/\s+/g," ").trim();return a?a.length<=t?a:"".concat(a.slice(0,t-1),"…"):"暂无使用说明"}var S=e.i(46798),z=e.i(8279);let F={sm:"h-7 w-7 text-xs",md:"h-9 w-9 text-sm"};function E(e){let{label:t,size:s="md",className:r}=e,l=(0,z.initialsFromLabel)(t);return(0,a.jsx)(S.TooltipProvider,{delayDuration:150,children:(0,a.jsxs)(S.Tooltip,{children:[(0,a.jsx)(S.TooltipTrigger,{asChild:!0,children:(0,a.jsx)("span",{className:(0,x.cn)("inline-flex shrink-0 cursor-default items-center justify-center rounded-full font-semibold text-white",F[s],r),style:{background:(0,z.avatarBgForLabel)(t)},"aria-label":t,children:l})}),(0,a.jsx)(S.TooltipContent,{side:"bottom",align:"center",className:"text-base",children:t})]})})}let D=[{value:"basic",label:"基本信息"}],M=[{value:"agents",label:"AGENTS"}];function B(e){let{mode:t,editAgentId:r,onClose:o,onSaved:d}=e,u=(0,y.useAppStore)(e=>e.wsUrl),p=(0,y.useAppStore)(e=>e.apiBase),h=(0,w.useStageThreadFlyoutStore)(e=>e.setFlyoutDirty),b=(0,w.useStageThreadFlyoutStore)(e=>e.requestCloseFlyout),T="edit"===t,[A,S]=(0,s.useState)(!1),[z,F]=(0,s.useState)(T),[B,I]=(0,s.useState)(null),[R,_]=(0,s.useState)("basic"),L=(0,s.useRef)(null),O=(0,i.useForm)({defaultValues:{id:"",whentouse:"",prompt:""},mode:"onChange"}),{isDirty:P}=(0,i.useFormState)({control:O.control}),H=O.watch("id"),U=T?"编辑 Agent · ".concat(null!=r?r:H):"新建Agent",G=A?T?"保存中…":"创建中…":"保存",V=(0,s.useCallback)(async()=>{let e=null==r?void 0:r.trim();if(e){F(!0),I(null);try{let t=await (0,C.getAgentDetail)(u,p,e);L.current=t.config,O.reset({id:t.id,whentouse:t.whentouse,prompt:t.prompt})}catch(t){let e=t instanceof Error?t.message:String(t);I(e),c.appToast.error("加载失败:".concat(e))}finally{F(!1)}}},[r,u,p,O]);(0,s.useEffect)(()=>{T&&V()},[T,V]),(0,s.useEffect)(()=>(h(P),()=>h(!1)),[P,h]);let q=(0,s.useCallback)(()=>{b()},[b]),K=(0,s.useCallback)(async e=>{let t=(T&&null!=r?r:e.id).trim();if(t){if(!T&&!k.test(String(t||"").trim()))return void c.appToast.error("Agent ID 仅支持字母、数字、下划线和中划线,长度 1~64");S(!0);try{T?(await (0,C.updateAgent)(u,p,{id:t,prompt:e.prompt,whentouse:e.whentouse,baseConfig:L.current}),c.appToast.success("已保存")):(await (0,C.createAgent)(u,p,{id:t,whentouse:e.whentouse,prompt:e.prompt}),c.appToast.success("已创建")),await (null==d?void 0:d()),o()}catch(t){let e=T?"保存":"创建";c.appToast.error("".concat(e,"失败:").concat(t instanceof Error?t.message:String(t)))}finally{S(!1)}}},[T,r,u,p,o,d]);return(0,a.jsx)(g.Form,{...O,children:(0,a.jsxs)("form",{className:"flex h-full min-h-0 flex-col bg-[var(--surface-2)]",onSubmit:O.handleSubmit(K),children:[(0,a.jsxs)("header",{className:"shrink-0 border-b border-[var(--ds-border)] bg-[var(--surface-2)] px-5 pb-4 pt-5",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,a.jsx)(l.Button,{type:"button",variant:"plain",size:"icon",onClick:q,disabled:A,className:"shrink-0 cursor-pointer px-2 text-[var(--ds-text)] hover:bg-transparent hover:text-[color:var(--ds-accent)] [&_svg_path]:!fill-current","aria-label":"返回",children:(0,a.jsx)(n.default,{name:"Back",size:16})}),(0,a.jsx)("h2",{className:"truncate text-lg font-semibold text-[var(--ds-text)]",children:U})]}),(0,a.jsx)(l.Button,{type:"submit",variant:"default",size:"lg",disabled:A||z||!!B,className:"shrink-0 cursor-pointer rounded-lg bg-[#111] px-5 hover:bg-[#333]",children:G})]}),(0,a.jsx)("div",{className:"mt-4 flex items-center gap-3",children:(0,a.jsx)(N.Tabs,{value:R,onValueChange:_,className:"min-w-0 flex-1",children:(0,a.jsx)(N.TabsList,{variant:"pill",className:"mx-auto w-fit",children:D.map(e=>(0,a.jsx)(N.TabsTrigger,{value:e.value,disabled:e.disabled,children:e.label},e.value))})})})]}),(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4",children:z?(0,a.jsx)("div",{className:"flex min-h-[240px] flex-1 items-center justify-center text-sm text-[var(--ds-muted)]",role:"status","aria-live":"polite",children:"加载中…"}):B?(0,a.jsxs)("div",{className:"flex min-h-[240px] flex-1 flex-col items-center justify-center gap-3 text-sm text-destructive",role:"alert",children:[(0,a.jsxs)("span",{children:["加载失败:",B]}),(0,a.jsx)(l.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>void V(),children:"重试"})]}):"basic"===R?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("section",{className:"rounded-xl border border-[var(--ds-border)] bg-white p-4",children:(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)("div",{className:"flex shrink-0 flex-col items-center gap-2",children:(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(E,{label:H.trim()||"Agent",className:"h-16 w-16 text-lg"})})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-3",children:[(0,a.jsx)(g.FormField,{control:O.control,name:"id",render:e=>{let{field:t}=e;return(0,a.jsxs)(g.FormItem,{children:[(0,a.jsx)(g.FormControl,{children:(0,a.jsx)(j.Input,{...t,readOnly:T,spellCheck:!1,placeholder:"例如 my-agent",autoComplete:"off",className:(0,x.cn)("h-10 rounded-md border-[var(--ds-border)] bg-[var(--ds-bg)] text-base",T&&"cursor-default text-[var(--ds-muted)]")})}),(0,a.jsx)(g.FormMessage,{})]})}}),(0,a.jsx)(g.FormField,{control:O.control,name:"whentouse",render:e=>{let{field:t}=e;return(0,a.jsxs)(g.FormItem,{children:[(0,a.jsx)(g.FormControl,{children:(0,a.jsx)(m.Textarea,{...t,spellCheck:!1,placeholder:"用一句话说明它的身份 + 它主要帮你做什么",className:"min-h-[88px] resize-none rounded-md border-[var(--ds-border)] bg-[var(--ds-bg)] text-base leading-relaxed"})}),(0,a.jsx)(g.FormMessage,{})]})}})]})]})}),(0,a.jsx)(v.AppTabs,{tabs:M,defaultValue:"agents",listVariant:"line",listClassName:"mt-4",className:"min-h-0 flex-1",children:(0,a.jsx)(v.AppTabsPanel,{value:"agents",className:"mt-4 flex min-h-0 flex-1 flex-col",children:(0,a.jsx)(g.FormField,{control:O.control,name:"prompt",render:e=>{let{field:t}=e;return(0,a.jsxs)(g.FormItem,{className:"flex min-h-0 flex-1 flex-col",children:[(0,a.jsx)(g.FormControl,{children:(0,a.jsx)(f,{value:t.value,onChange:t.onChange,className:"min-h-[320px]",placeholder:"编辑 Agent 提示词(agent.md)",expandTitle:"编辑 (agent.md)"})}),(0,a.jsx)(g.FormMessage,{})]})}})})})]}):(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center text-sm text-[var(--ds-muted)]",children:"敬请期待"})})]})})}var I=e.i(68499),R=e.i(55146),_=e.i(97249);function L(e){let{label:t,hint:s,icon:r,onClick:l}=e,i=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.default,{name:r,size:14,className:"shrink-0 text-[var(--ds-muted)]"}),(0,a.jsx)("span",{children:s})]}),o=(0,x.cn)("inline-flex min-h-9 w-fit max-w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-[var(--ds-border)] !bg-transparent px-3 text-base text-[var(--ds-muted)]",l&&"cursor-pointer hover:border-[color:var(--ds-border-hover)] hover:bg-[var(--ds-main-tint)]");return l?(0,a.jsx)("button",{type:"button",className:o,onClick:l,"aria-label":t,children:i}):(0,a.jsx)("div",{className:o,"aria-label":t,children:i})}let O=(0,e.i(75254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var P=e.i(57428),H=e.i(76639);let U={captain:null,members:[]};function G(e){return{id:e.id,displayName:e.displayName.trim()||e.id}}function V(e,t,a,s){for(let l of a){var r;if(l.id===t)continue;let a=s(l.id);if((null==(r=a.captain)?void 0:r.id)===e||a.members.some(t=>t.id===e))return l.id}return null}function q(e){let{member:t,subtitle:s,onRemove:r,badge:l}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--ds-border)] bg-[var(--ds-bg)] px-2.5 py-2",children:[(0,a.jsx)(E,{label:t.displayName,size:"sm"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"mb-0 truncate text-sm font-medium text-[var(--ds-text)]",children:t.displayName}),(0,a.jsx)("p",{className:"mb-0 truncate text-xs text-[var(--ds-muted)]",children:s})]}),l?(0,a.jsx)("span",{className:"shrink-0 rounded bg-[var(--green-light)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--green-dark)]",children:l}):null,r?(0,a.jsx)(d.IconTooltipButton,{icon:"Close",label:"移除agent",className:"!h-7 !w-7 shrink-0 bg-transparent text-[var(--ds-muted)] hover:bg-transparent hover:text-[color:var(--ds-accent)]",iconClassName:"!size-3.5",onClick:r}):null]})}function K(e){let{open:t,onOpenChange:r,team:i,allAgents:o,rosters:d,onConfirm:m,onAgentsRefresh:u}=e,p=(0,y.useAppStore)(e=>e.wsUrl),h=(0,y.useAppStore)(e=>e.apiBase),b=i.id,f=d.getRoster,[v,g]=(0,s.useState)(""),[N,w]=(0,s.useState)("all"),[k,S]=(0,s.useState)([]),[z,F]=(0,s.useState)(!1),D=(0,s.useMemo)(()=>G(i),[i]);(0,s.useEffect)(()=>{if(!t)return;let e=f(b);g(""),w("all"),S(e.members.filter(e=>e.id!==b).map(e=>e.id))},[t,b,f]);let M=(0,s.useMemo)(()=>k.map(e=>o.find(t=>t.id===e)).filter(e=>null!=e).map(G),[k,o]),B=(0,s.useMemo)(()=>o.filter(e=>{if(!function(e,t){let a=t.trim().toLowerCase();return!a||"".concat(e.id," ").concat(e.displayName," ").concat(e.whentouse).toLowerCase().includes(a)}(e,v))return!1;let t=e.id===b,a=V(e.id,b,o,f);return"available"===N?!t:"joined_other"===N?!!a:"recommended"!==N||!a&&!t}),[o,v,N,b,f]),I=(0,s.useCallback)((e,t)=>{e!==b&&S(a=>t?a.includes(e)?a:[...a,e]:a.filter(t=>t!==e))},[b]),R=(0,s.useCallback)(()=>{S([])},[]),_=(0,s.useCallback)(()=>{r(!1)},[r]),L=(0,s.useCallback)(()=>{(async()=>{let e=b.trim();if(!e||z)return;let t=f(b).members.map(e=>e.id),a=k.filter(e=>!t.includes(e)),s=t.filter(e=>!k.includes(e));if(0===a.length&&0===s.length)return _();F(!0);try{for(let t of s)await (0,C.removeTeamMember)(p,h,e,t);for(let t of a)await (0,C.addTeamMember)(p,h,e,t);await (null==u?void 0:u()),m({captain:D,members:M}),a.length>0&&0===s.length?c.appToast.success(1===a.length?"已添加队员 ".concat(a[0]):"已添加 ".concat(a.length," 名队员")):c.appToast.success("已更新队员"),_()}catch(e){c.appToast.error("添加队员失败:".concat(e instanceof Error?e.message:String(e)))}finally{F(!1)}})()},[b,z,f,k,p,h,u,m,D,M,_]);return(0,a.jsx)(H.Dialog,{open:t,onOpenChange:r,children:(0,a.jsxs)(H.DialogContent,{className:"max-w-[920px]","aria-labelledby":"add-team-members-title",children:[(0,a.jsxs)(H.DialogHeader,{className:"items-start gap-3",children:[(0,a.jsx)(H.DialogTitle,{id:"add-team-members-title",className:"text-lg",children:"添加队员"}),(0,a.jsx)(H.DialogClose,{"aria-label":"关闭"})]}),(0,a.jsx)(H.DialogBody,{className:"!p-0",children:(0,a.jsxs)("div",{className:"flex h-[min(68vh,520px)] min-h-0 flex-col px-[24px] md:flex-row",children:[(0,a.jsxs)("div",{className:"mr-[16px] flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden border-b border-[var(--ds-border)] md:border-b-0 md:border-r",children:[(0,a.jsxs)("div",{className:"shrink-0 space-y-3 border-b border-[var(--ds-border)] pb-4",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(O,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-[var(--ds-muted)]","aria-hidden":!0}),(0,a.jsx)(j.Input,{value:v,onChange:e=>g(e.target.value),placeholder:"搜索成员名称 / 能力 / 标签",className:"h-8 pl-8"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:T.map(e=>{let t=N===e.id;return(0,a.jsx)(l.Button,{type:"button",variant:"plain-outline",size:"sm",className:(0,x.cn)("cursor-pointer rounded-full px-3",t&&"border-[color:var(--ds-accent)] bg-[var(--green-light)] text-[var(--green-dark)] hover:bg-[var(--green-light)]"),onClick:()=>w(e.id),children:e.label},e.id)})})]}),(0,a.jsx)("ul",{className:"m-0 min-h-0 flex-1 list-none space-y-4 overflow-y-auto",role:"listbox","aria-label":"可选队员",children:B.map(e=>{let t=e.id===b,s=k.includes(e.id),r=V(e.id,b,o,f),l=function(e){let t=A(e,24);return"暂无使用说明"===t?[]:t.split(/[,,、\s]+/).filter(Boolean).slice(0,2)}(e.whentouse),i=A(e.whentouse,32);return(0,a.jsx)("li",{children:(0,a.jsxs)("label",{className:(0,x.cn)("flex cursor-pointer items-center gap-3 rounded-lg border border-solid bg-[var(--ds-bg)] px-2 py-2.5 transition-[border-color,background-color]","border-[color:var(--ds-border)]",t?"cursor-not-allowed opacity-60":"hover:border-[color:var(--ds-border-hover)] hover:bg-[var(--ds-main-tint)]",s&&!t&&"bg-[var(--green-light)]/40 border-[color:var(--ds-accent)]"),children:[(0,a.jsx)(P.Checkbox,{checked:!t&&s,disabled:t,onChange:t=>I(e.id,t.target.checked),"aria-label":"选择 ".concat(e.displayName)}),(0,a.jsx)(E,{label:e.displayName,size:"md"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"mb-0 truncate font-medium text-[var(--ds-text)]",children:[e.displayName,t?(0,a.jsx)("span",{className:"ml-1 text-xs font-normal text-[var(--ds-muted)]",children:"(当前团队)"}):null]}),(0,a.jsx)("p",{className:"mb-0 mt-0.5 truncate text-base text-[var(--ds-muted)]",children:i}),l.length>0?(0,a.jsx)("div",{className:"mt-1 flex flex-wrap gap-1",children:l.map(e=>(0,a.jsx)("span",{className:"rounded bg-[var(--surface-2)] px-1.5 py-0.5 text-[10px] text-[var(--ds-muted)]",children:e},e))}):null]}),(0,a.jsx)("div",{className:"shrink-0 text-right",children:t?(0,a.jsx)("span",{className:"text-xs text-[var(--ds-muted)]",children:"不可选"}):r?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-amber-600",children:[(0,a.jsx)(n.default,{name:"Info",size:14}),"已加入其他团队"]}):(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-[var(--green-dark)]",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-[var(--ds-accent)]"}),"可用 Agent"]})})]})},e.id)})}),(0,a.jsxs)("div",{className:"shrink-0 border-t border-[var(--ds-border)] px-4 py-2.5 text-sm text-[var(--ds-muted)]",children:["已选择 ",k.length," 名队员"]})]}),(0,a.jsx)("div",{className:"flex min-h-0 w-full shrink-0 flex-col overflow-hidden bg-[var(--ds-log-bg)] md:w-[300px]",children:(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden p-4",children:(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[(0,a.jsxs)("div",{className:"mb-2 flex shrink-0 items-center justify-between gap-2",children:[(0,a.jsxs)("span",{className:"text-sm font-medium text-[var(--ds-text)]",children:["已选成员(",M.length,")"]}),(0,a.jsx)(l.Button,{type:"button",variant:"plain",size:"sm",disabled:0===M.length,className:"h-auto cursor-pointer !px-1 text-xs text-[var(--ds-accent)] hover:bg-transparent hover:text-[var(--ds-text)] disabled:cursor-not-allowed",onClick:R,children:"清空"})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:M.length>0?(0,a.jsx)("div",{className:"space-y-4",children:M.map(e=>{let t=o.find(t=>t.id===e.id),s=t?A(t.whentouse,28):e.id;return(0,a.jsx)(q,{member:e,subtitle:s,onRemove:()=>I(e.id,!1)},e.id)})}):(0,a.jsx)("p",{className:"mb-0 text-xs text-[var(--ds-muted)]",children:"请从左侧勾选队员"})})]})})})]})}),(0,a.jsxs)("div",{className:"flex shrink-0 justify-end gap-2 border-t border-[var(--ds-border)] bg-[var(--ds-sidebar)] px-5 py-3",children:[(0,a.jsx)(l.Button,{type:"button",variant:"plain-outline",size:"lg",onClick:_,className:"cursor-pointer",children:"取消"}),(0,a.jsx)(l.Button,{type:"button",variant:"default",size:"lg",onClick:L,disabled:z,className:"cursor-pointer disabled:cursor-not-allowed",children:z?"添加中…":"确认添加"})]})]})})}function W(e){let{open:t,onOpenChange:r,title:n,description:i,candidates:o,onPick:d}=e,[c,m]=(0,s.useState)("");(0,s.useEffect)(()=>{t&&m("")},[t]);let u=(0,s.useCallback)(()=>{r(!1)},[r]),p=(0,s.useCallback)(()=>{let e=o.find(e=>e.id===c);e&&(d(e),u())},[o,c,d,u]),h=(0,s.useMemo)(()=>o.length>0?null:"暂无可选 Agent",[o.length]);return(0,a.jsx)(H.Dialog,{open:t,onOpenChange:r,children:(0,a.jsxs)(H.DialogContent,{className:"max-w-[480px]","aria-labelledby":"pick-team-member-title",children:[(0,a.jsxs)(H.DialogHeader,{className:"items-start gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)(H.DialogTitle,{id:"pick-team-member-title",children:n}),(0,a.jsx)(H.DialogDescription,{className:"mt-1",children:i})]}),(0,a.jsx)(H.DialogClose,{"aria-label":"关闭"})]}),(0,a.jsx)(H.DialogBody,{className:"max-h-[min(50vh,360px)] overflow-y-auto !px-5 !py-4",children:h?(0,a.jsx)("p",{className:"mb-0 text-center text-sm text-[var(--ds-muted)]",children:h}):(0,a.jsx)("ul",{className:"m-0 list-none space-y-1 p-0",role:"listbox",children:o.map(e=>{let t=c===e.id,s=G(e);return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":t,className:(0,x.cn)("flex w-full cursor-pointer items-center gap-3 rounded-lg border border-solid px-3 py-2.5 text-left transition-colors",t?"border-[color:var(--ds-accent)] bg-[var(--green-light)]":"border-[color:var(--ds-border)] bg-[var(--ds-bg)] hover:bg-[var(--ds-main-tint)]"),onClick:()=>m(e.id),children:[(0,a.jsx)(E,{label:s.displayName,size:"md"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"mb-0 truncate text-sm font-medium text-[var(--ds-text)]",children:s.displayName}),(0,a.jsx)("p",{className:"mb-0 mt-0.5 truncate text-xs text-[var(--ds-muted)]",children:e.id})]})]})},e.id)})})}),(0,a.jsxs)("div",{className:"flex shrink-0 justify-end gap-2 border-t border-[var(--ds-border)] bg-[var(--ds-sidebar)] px-5 py-3",children:[(0,a.jsx)(l.Button,{type:"button",variant:"plain-outline",size:"lg",onClick:u,className:"cursor-pointer",children:"取消"}),(0,a.jsx)(l.Button,{type:"button",variant:"default",size:"lg",disabled:!c,onClick:p,className:"cursor-pointer",children:"确定"})]})]})})}function Y(e){let{member:t,onRemove:s}=e;return(0,a.jsxs)("span",{className:(0,x.cn)("] relative inline-flex w-fit items-center rounded-full",s&&"pr-5"),children:[(0,a.jsx)(E,{label:t.displayName,size:"sm"}),s?(0,a.jsx)(d.IconTooltipButton,{icon:"CircleX",label:"移除 ".concat(t.displayName),tone:"muted",className:"absolute -right-3 -top-1.5 !h-4 !w-4 shrink-0",iconClassName:"!size-3.5 !text-[var(--text-secondary)]",onClick:s}):null]})}function $(e){let{members:t,onRemoveMember:r}=e,[l,n]=(0,s.useState)(!1),i=(0,s.useCallback)(e=>()=>{r(e)},[r]);return(0,a.jsxs)("div",{className:"relative shrink-0",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[(0,a.jsxs)("span",{className:"inline-flex cursor-default items-center rounded-full border border-[var(--ds-border)] bg-[var(--surface-2)] px-2.5 py-1 text-sm font-medium text-[var(--ds-muted)]","aria-label":"还有 ".concat(t.length," 名队员"),children:["+",t.length]}),l?(0,a.jsx)("div",{className:"absolute left-0 top-full z-[60] pt-1.5",children:(0,a.jsxs)("div",{className:(0,x.cn)("min-w-[200px] max-w-[min(100vw-32px,320px)]","rounded-xl border border-[var(--ds-border)] bg-[var(--ds-bg)] p-2 shadow-[var(--shadow-float)]"),role:"tooltip",children:[(0,a.jsxs)("p",{className:"mb-2 px-1 text-xs text-[var(--ds-muted)]",children:["其余队员(",t.length,")"]}),(0,a.jsx)("div",{className:"flex max-h-[240px] flex-col gap-2 overflow-y-auto",children:t.map(e=>(0,a.jsx)(Y,{member:e,onRemove:i(e.id)},e.id))})]})}):null]})}function X(e){let{leaderId:t,members:r,onAgentsRefresh:l}=e,n=(0,y.useAppStore)(e=>e.wsUrl),i=(0,y.useAppStore)(e=>e.apiBase),[o,d]=(0,s.useState)(null),m=(0,s.useCallback)(e=>{(async()=>{let a=e.trim(),s=t.trim();if(s&&a&&!o&&await (0,I.confirmAlertDialog)({title:"确定移除队员?",description:"确定移除队员「".concat(a,"」?"),confirmText:"移除",cancelText:"取消"})){d(a);try{await (0,C.removeTeamMember)(n,i,s,a),await (null==l?void 0:l()),c.appToast.success("已移除队员")}catch(e){c.appToast.error("移除队员失败:".concat(e instanceof Error?e.message:String(e)))}finally{d(null)}}})()},[t,o,n,i,l]),x=r.slice(0,8),u=r.slice(8);return(0,a.jsxs)("div",{className:"flex min-w-0 max-w-full flex-wrap items-center gap-2",children:[x.map(e=>(0,a.jsx)(Y,{member:e},e.id)),u.length>0?(0,a.jsx)($,{members:u,onRemoveMember:m}):null]})}function Z(e){let{onEdit:t,onDelete:r,deleting:l=!1}=e,[i,o]=(0,s.useState)(!1);return(0,a.jsxs)(R.DropdownMenu,{open:i,onOpenChange:o,children:[(0,a.jsx)(R.DropdownMenuTrigger,{type:"button",className:"inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0 text-[var(--ds-muted)] hover:bg-transparent hover:text-[color:var(--ds-accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ds-accent)]","aria-label":"更多",onClick:e=>{e.stopPropagation()},children:(0,a.jsx)(n.default,{name:"More",size:20})}),(0,a.jsxs)(R.DropdownMenuContent,{align:"end",side:"bottom",sideOffset:6,className:"w-[172px] min-w-[172px] rounded-[var(--ds-radius-sm)] border border-[var(--ds-border)] bg-[var(--ds-bg)] p-1.5",children:[(0,a.jsxs)(R.DropdownMenuItem,{className:"h-9 rounded-xl px-2.5 text-base text-[var(--ds-text)] hover:bg-[var(--ds-item-active)] focus:bg-[var(--ds-item-hover)]",onClick:()=>{o(!1),t()},children:[(0,a.jsx)(n.default,{name:"Edit",size:16,className:"text-[var(--ds-muted)]"}),"编辑 Agent"]}),(0,a.jsx)(R.DropdownMenuSeparator,{className:"mx-1 my-1 bg-[var(--ds-border)]"}),(0,a.jsxs)(R.DropdownMenuItem,{variant:"destructive",disabled:l,className:"h-9 rounded-xl px-2.5 text-base hover:bg-[#fff1f1] focus:bg-[#fff1f1]",onClick:()=>{o(!1),r()},children:[(0,a.jsx)(n.default,{name:"Trash2",size:16}),"删除 Agent"]})]})]})}function J(e){let{team:r,allAgents:l,rosters:n,onAgentSaved:i}=e,o=(0,y.useAppStore)(e=>e.agentId),m=(0,y.useAppStore)(e=>e.wsUrl),u=(0,y.useAppStore)(e=>e.apiBase),p=o.trim()||"qihoo",h=r.id===p,b=n.getRoster(r.id),f=A(r.whentouse),v=(0,z.initialsFromLabel)(r.id).slice(0,1),[g,j]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!1),[T,S]=(0,s.useState)(!1),F=n.getAvailableCandidates(r.id,l),E=(0,s.useCallback)(e=>{n.setCaptain(r.id,G(e))},[n,r.id]),D=(0,s.useCallback)(e=>{n.applyRoster(r.id,e)},[n,r.id]),M=(0,s.useCallback)(()=>{let e=r.id.trim();if(!e||e===p)return;let t=(0,_.buildAppNavHref)("/",{ensureAgent:!0,agent:e}),a=_.BASE_PATH.replace(/\/+$/,""),s="".concat(window.location.origin).concat(a).concat(t);window.open(s,"_blank","noopener")},[r.id,p]),R=(0,s.useCallback)(()=>{!function(e){var s;let r=e.agentId.trim();if(!r)return;let{openFlyout:l,closeFlyout:n}=w.useStageThreadFlyoutStore.getState(),i=null!=(s=e.onSaved)?s:t;l({width:w.CREATE_AGENT_FLYOUT_WIDTH,hideHeader:!0,bodyClassName:"!p-0 overflow-hidden",navigationGuard:!0,content:(0,a.jsx)(B,{mode:"edit",editAgentId:r,onClose:n,onSaved:i})})}({agentId:r.id,onSaved:i})},[r.id,i]),O=(0,s.useCallback)(async()=>{let e=r.id.trim();if(e&&await (0,I.confirmAlertDialog)({title:"确定删除 Agent?",description:"Agent「".concat(e,"」将被永久删除,此操作不可恢复。"),confirmText:"删除",cancelText:"取消"})){S(!0);try{await (0,C.deleteAgentItem)(m,u,e),c.appToast.success("已删除"),await (null==i?void 0:i())}catch(e){c.appToast.error("删除失败:".concat(e instanceof Error?e.message:String(e)))}finally{S(!1)}}},[r.id,m,u,i]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:(0,x.cn)("flex w-full flex-wrap items-center gap-4 rounded-xl border border-solid bg-[var(--ds-bg)] px-4 py-3 lg:flex-nowrap","border-[color:var(--ds-border)] transition-[border-color,box-shadow]","hover:shadow-[0_2px_12px_rgba(0,0,0,0.06)]"),children:[(0,a.jsxs)("div",{className:"flex min-w-[200px] flex-1 items-center gap-4",children:[(0,a.jsx)("span",{className:"inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-lg text-lg font-semibold text-white",style:{background:(0,z.avatarBgForLabel)(r.id)},"aria-hidden":!0,children:v}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 text-left",children:[(0,a.jsx)("button",{type:"button",onClick:M,disabled:h,className:(0,x.cn)("mb-0 block w-full truncate border-0 bg-transparent p-0 text-left text-base font-semibold text-[var(--ds-text)]",h?"cursor-default":"cursor-pointer hover:text-[color:var(--ds-accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ds-accent)]"),"aria-current":h?"true":void 0,"aria-label":h?"当前 Agent:".concat(r.id):"在新标签页切换到 Agent ".concat(r.id),children:r.id}),(0,a.jsx)("p",{className:"mb-0 mt-1 truncate text-sm text-[var(--ds-muted)]",children:f})]})]}),(0,a.jsx)("div",{className:"flex min-w-0 max-w-full flex-1 flex-col gap-1.5",children:(0,a.jsxs)("div",{className:"flex min-w-0 max-w-full flex-wrap items-center gap-2",children:[b.members.length>0?(0,a.jsx)(X,{leaderId:r.id,members:b.members,onAgentsRefresh:i}):(0,a.jsx)(L,{label:"队员列表",hint:"暂无队员",icon:"Team"}),(0,a.jsx)(d.IconTooltipButton,{icon:"Create",label:"添加队员",disabled:l.length<=1,className:(0,x.cn)("h-8 w-8 shrink-0 border border-dashed border-[color:var(--ds-border)] hover:border-[color:var(--ds-accent)] hover:text-[color:var(--ds-accent)]",l.length>1&&"text-[var(--ds-accent)] hover:bg-[var(--green-light)]"),iconClassName:"!size-4",onClick:()=>k(!0)})]})}),(0,a.jsx)(Z,{onEdit:R,onDelete:()=>void O(),deleting:T})]}),(0,a.jsx)(W,{open:g,onOpenChange:j,title:"设置队长",description:"从可选 Agent 中选择一名作为队长",candidates:F,onPick:E}),(0,a.jsx)(K,{open:N,onOpenChange:k,team:r,allAgents:l,rosters:n,onConfirm:D,onAgentsRefresh:i})]})}function Q(e){let{agentsState:t}=e,{agents:r,loading:l,error:n}=t,i=function(e){let[t,a]=(0,s.useState)({});(0,s.useEffect)(()=>{a(t=>{let a={...t};for(let r of e){var s;let l=null!=(s=t[r.id])?s:U;a[r.id]={captain:l.captain,members:function(e,t){return e.agentTeamMembers.map(e=>{let a=t.find(t=>t.id===e.agentType);return{id:e.agentType,displayName:(null==a?void 0:a.displayName.trim())||e.agentType}})}(r,e)}}return a})},[e]);let r=(0,s.useCallback)(e=>{var a;return null!=(a=t[e])?a:U},[t]),l=(0,s.useCallback)((e,t)=>{a(a=>{var s;let r=(null!=(s=a[e])?s:U).members.filter(e=>e.id!==t.id);return{...a,[e]:{captain:t,members:r}}})},[]),n=(0,s.useCallback)(e=>{a(t=>{var a;let s=null!=(a=t[e])?a:U;return{...t,[e]:{...s,captain:null}}})},[]),i=(0,s.useCallback)((e,t)=>{a(a=>{var s,r;let l=null!=(r=a[e])?r:U;return(null==(s=l.captain)?void 0:s.id)===t.id||l.members.some(e=>e.id===t.id)?a:{...a,[e]:{...l,members:[...l.members,t]}}})},[]),o=(0,s.useCallback)((e,t)=>{a(a=>{var s;let r=null!=(s=a[e])?s:U;return{...a,[e]:{...r,members:r.members.filter(e=>e.id!==t)}}})},[]);return{getRoster:r,setCaptain:l,removeCaptain:n,addMember:i,removeMember:o,applyRoster:(0,s.useCallback)((e,t)=>{let s=t.captain,r=t.members.filter(e=>e.id!==(null==s?void 0:s.id));a(t=>({...t,[e]:{captain:s,members:r}}))},[]),getAvailableCandidates:(0,s.useCallback)((e,a)=>{var s;let r=null!=(s=t[e])?s:U,l=new Set([e,...r.captain?[r.captain.id]:[],...r.members.map(e=>e.id)]);return a.filter(e=>!l.has(e.id))},[t])}}(r);return(0,a.jsx)("div",{className:"flex min-h-0 flex-1 flex-col rounded-xl border border-[var(--ds-border)] bg-[var(--ds-bg)] shadow-[var(--shadow-sm)]",children:(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:l?(0,a.jsx)("div",{className:"flex min-h-[200px] items-center justify-center text-sm text-[var(--ds-muted)]",children:"加载中…"}):n?(0,a.jsxs)("div",{className:"flex min-h-[200px] items-center justify-center px-4 text-center text-sm text-red-600",children:["加载失败:",n]}):0===r.length?(0,a.jsx)("div",{className:"flex min-h-[200px] items-center justify-center px-4 text-center text-sm text-[var(--ds-muted)]",children:"暂无 Agent,点击右上角「新建 Agent」创建"}):(0,a.jsx)("ul",{className:"m-0 list-none space-y-4 p-0",role:"list",children:r.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)(J,{team:e,allAgents:r,rosters:i,onAgentSaved:t.loadAgents})},e.id))})})})}function ee(e){let{label:t,value:s,hint:r,icon:l}=e;return(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 flex-1 items-center gap-4 rounded-xl border border-[var(--ds-border)] bg-white px-4 py-3.5 shadow-[var(--shadow-sm)]",children:[(0,a.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-[var(--ds-border)]","aria-hidden":!0,children:(0,a.jsx)(n.default,{name:l,size:20,className:"text-[var(--ds-text)]"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-sm text-[var(--ds-muted)]",children:t}),(0,a.jsx)("span",{className:"mt-1 block text-2xl font-semibold leading-none text-[var(--ds-text)]",children:s}),(0,a.jsx)("span",{className:"mt-1 block text-xs text-[var(--ds-muted)]",children:r})]})]})}function et(e){let{agents:t,className:r}=e,l=(0,s.useMemo)(()=>{let e=t.length;return[{label:"团队总数",value:t.filter(e=>e.agentTeamMembers.length>=1).length,icon:"Teams",hint:"队员数大于 1 的 Agent 编组"},{label:"成员总数",value:e,icon:"Agent",hint:"角色、能力和工具的智能执行体"}]},[t]);return(0,a.jsx)("div",{className:(0,x.cn)("flex flex-wrap gap-3",r),children:l.map(e=>(0,a.jsx)(ee,{...e},e.label))})}function ea(){let e=function(){let e=(0,y.useAppStore)(e=>e.wsUrl),t=(0,y.useAppStore)(e=>e.apiBase),[a,r]=(0,s.useState)([]),[l,n]=(0,s.useState)(!0),[i,o]=(0,s.useState)(null),d=(0,s.useCallback)(async()=>{n(!0),o(null);try{let a=await (0,C.listAgentsForManage)(e,t);r(a)}catch(t){let e=t instanceof Error?t.message:String(t);r([]),o(e),c.appToast.error("加载失败:".concat(e))}finally{n(!1)}},[e,t]);return(0,s.useEffect)(()=>{d()},[d]),{agents:a,loading:l,error:i,loadAgents:d}}();(0,s.useEffect)(()=>(t=e.loadAgents,()=>{t=void 0}),[e.loadAgents]);let i=(0,s.useCallback)(()=>{!function(){var e;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{openFlyout:r,closeFlyout:l}=w.useStageThreadFlyoutStore.getState(),n=null!=(e=s.onSaved)?e:t;r({width:w.CREATE_AGENT_FLYOUT_WIDTH,hideHeader:!0,bodyClassName:"!p-0 overflow-hidden",navigationGuard:!0,content:(0,a.jsx)(B,{mode:"create",onClose:l,onSaved:n})})}()},[]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.ManageChromeHeaderActions,{children:(0,a.jsx)("div",{className:"flex flex-wrap items-center",children:(0,a.jsxs)(l.Button,{type:"button",variant:"default",size:"lg",onClick:i,className:"mr-[12px] cursor-pointer",children:[(0,a.jsx)(n.default,{name:"Create",size:16,className:"align-middle"}),"新建 Agent"]})})}),(0,a.jsx)(et,{agents:e.agents,className:"mb-4"}),(0,a.jsx)(Q,{agentsState:e})]})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,t,n)=>{t.exports=e.r(76562)},85570,e=>{"use strict";e.s(["WorkspaceRuntimeContext",()=>n,"useWorkspaceRuntime",()=>r]);var t=e.i(71645);let n=(0,t.createContext)(null);function r(){let e=(0,t.useContext)(n);if(!e)throw Error("useWorkspaceRuntime must be used within WorkspaceShell");return e}},18253,e=>{"use strict";e.s(["useGuardedAppNavigation",()=>s]);var t=e.i(71645),n=e.i(18566),r=e.i(61196);function s(){let e=(0,n.useRouter)(),s=(0,r.useStageThreadFlyoutStore)(e=>e.confirmNavigateAway);return{push:(0,t.useCallback)(async t=>{await s(t)&&e.push(t)},[s,e]),router:e}}},67585,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return s}});let r=e.r(32061);function s(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw Object.defineProperty(new r.BailoutToCSRError(t),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}},9885,(e,t,n)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return r}})},52157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return l}});let r=e.r(18050),s=e.r(74080),a=e.r(63599),i=e.r(9885);function l(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=a.workAsyncStorage.getStore();if(void 0===n)return null;let l=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files;l.push(...t)}}return 0===l.length?null:(0,r.jsx)(r.Fragment,{children:l.map(e=>{let t=n.assetPrefix+"/_next/"+(0,i.encodeURIPath)(e);return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:t,rel:"stylesheet",as:"style"},e):((0,s.preload)(t,{as:"script",fetchPriority:"low"}),null)})})}},69093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return u}});let r=e.r(18050),s=e.r(71645),a=e.r(67585),i=e.r(52157);function l(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},u=function(e){let t={...o,...e},n=(0,s.lazy)(()=>t.loader().then(l)),u=t.loading;function d(e){let l=u?(0,r.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,d=o?s.Suspense:s.Fragment,c=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(d,{...o?{fallback:l}:{},children:c})}return d.displayName="LoadableComponent",d}},70703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return s}});let r=e.r(55682)._(e.r(69093));function s(e,t){var n;let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,r.default)({...a,modules:null==(n=a.loadableGenerated)?void 0:n.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},82787,87968,e=>{"use strict";e.s(["MANAGE_DEFAULT_HREF",()=>f,"getBridgeSidebarManageRoutes",()=>g,"getManageRoute",()=>m,"isManageRouteEnabled",()=>h,"isManageSideNavPath",()=>v],82787);var t=e.i(70703),n=e.i(71645),r=e.i(18050);e.s(["Spinner",()=>i],87968);var s=e.i(72064),a=e.i(75157);function i(e){let{className:t}=e;return(0,r.jsx)(s.default,{name:"Loader2",size:16,className:(0,a.cn)("animate-spin text-muted-foreground",t)})}function l(e){let{className:t}=e;return(0,r.jsxs)("div",{className:(0,a.cn)("flex min-h-[40vh] flex-1 items-center justify-center gap-2 text-sm text-zinc-500",t),children:[(0,r.jsx)(i,{})," 加载中"]})}function o(){return(0,r.jsx)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col items-center justify-center text-[var(--ds-muted)]",children:"即将上线"})}var u=e.i(97249);function d(e){return(0,t.default)(e,{loading:()=>(0,n.createElement)(l)})}let c=[{key:"mcp",slug:"mcp",label:"MCP",title:"MCP管理",description:"管理外部工具与数据源。可以导入、编辑、移除或禁用 MCP 服务。",chrome:"feature",icon:"Mcp",headerIcon:"Mcp",enabled:!0,visibleInNav:!1,visibleInBridgeSidebar:!0,Component:d(()=>e.A(72234).then(e=>({default:e.McpManageView})))},{key:"tools",slug:"tools",label:"工具",title:"工具管理",description:"管理当前 Agent 已挂载的工具列表",chrome:"feature",icon:"Tool",headerIcon:"Tool",enabled:!0,visibleInNav:!1,visibleInBridgeSidebar:!0,Component:d(()=>e.A(58332).then(e=>({default:e.ToolsManageView})))},{key:"skills",slug:"skills",label:"技能",title:"技能管理",description:"管理当前 Agent 已挂载的技能",chrome:"feature",icon:"Skill",enabled:!0,headerIcon:"Skill",visibleInNav:!1,visibleInBridgeSidebar:!0,Component:d(()=>e.A(48583).then(e=>({default:e.SkillsManageView})))},{key:"teams",slug:"teams",label:"agent / teams",title:"agent / teams 管理",description:"管理 Agent 团队与协作编排。",chrome:"feature",icon:"Teams",enabled:!0,visibleInNav:!1,headerIcon:"Agent2",visibleInBridgeSidebar:!0,Component:d(()=>e.A(2578).then(e=>({default:e.TeamsView})))},{key:"task",slug:"task",label:"定时任务",title:"定时任务",description:"管理计划执行的任务与触发记录。",chrome:"feature",icon:"Task",enabled:!0,headerIcon:"Calendar",visibleInNav:!1,visibleInBridgeSidebar:!0,Component:d(()=>e.A(94065).then(e=>({default:e.TaskView})))},{key:"add-account",slug:"add-account",label:"账户",title:"账户",description:"",chrome:"side-nav",icon:"Account",enabled:!0,visibleInNav:!0,children:[{key:"basic",slug:"basic",label:"基本信息",title:"基本信息",description:"",chrome:"side-nav",tabVariant:"pill",showTitle:!1,Component:d(()=>e.A(34116).then(e=>({default:e.AddAccountView})))}]},{key:"env",slug:"env",label:"服务商",title:"服务商",description:"管理 API 服务商以访问模型。",chrome:"side-nav",icon:"Server",enabled:!0,visibleInNav:!0,Component:d(()=>e.A(1861).then(e=>({default:e.EnvManageView})))},{key:"permissions",slug:"permissions",label:"权限",title:"权限",description:"管理平台访问权限与角色策略。",chrome:"side-nav",enabled:!1,visibleInNav:!1,Component:o},{key:"general",slug:"general",label:"通用",title:"通用",description:"平台通用配置与偏好设置。",chrome:"side-nav",enabled:!1,visibleInNav:!1,Component:o},{key:"about",slug:"about",label:"关于",title:"关于",description:"版本信息与平台说明。",chrome:"side-nav",enabled:!0,visibleInNav:!1,Component:o}].map(e=>{var t,n;let{children:r,...s}=e;return{...s,href:(0,u.buildSettingsHref)(e.slug),...r?{children:(t=e.slug,n=e.chrome,r.map(e=>{var r,s;let a="".concat(t,"/").concat(e.slug);return{...e,slug:a,href:(0,u.buildSettingsHref)(a),chrome:null!=(r=e.chrome)?r:n,enabled:null==(s=e.enabled)||s,visibleInNav:!1}}))}:{}}});function p(e){return e.Component}let f=function(){var e,t,n,r,s,a;let i=null!=(n=null!=(t=null!=(e=c.find(e=>e.enabled&&e.visibleInNav&&"side-nav"===e.chrome))?e:c.find(e=>e.enabled&&"side-nav"===e.chrome))?t:c.find(e=>"side-nav"===e.chrome))?n:c[0],l=null!=(a=null==(r=i.children)?void 0:r.find(e=>e.enabled))?a:null==(s=i.children)?void 0:s[0];if(l)return l;if(p(i))return i;let o=c.find(e=>p(e));return o||c.flatMap(e=>{var t;return null!=(t=e.children)?t:[]})[0]}().href;function m(e){return c.find(t=>t.key===e)}function g(){return c.filter(e=>e.enabled&&!0===e.visibleInBridgeSidebar&&void 0!==e.icon).map(e=>{let{key:t,label:n,href:r,icon:s,headerIcon:a}=e;return{key:t,label:n,href:r,icon:s,headerIcon:null!=a?a:s}})}function h(e){var t;return(null===(t=(0,u.getSettingsRouteByPathname)(e,function(){let e=[];for(let n of c){var t;p(n)&&e.push(n),(null==(t=n.children)?void 0:t.length)&&e.push(...n.children)}return e}()))||void 0===t?void 0:t.enabled)!==!1}function v(e){if(!e)return!1;let t=c.filter(e=>"side-nav"===e.chrome);return(0,u.isSettingsRoutePath)(e,t)}},21199,41143,e=>{"use strict";e.s(["WorkspaceShell",()=>J],21199);var t=e.i(18050),n=e.i(71645),r=e.i(18566),s=e.i(65934),a=e.i(36845),i=e.i(20090);let l={EVENT:{SESSION_META:"session.meta",SESSION_READY:"session.ready",SESSION_ERROR:"session.error",QUERY_PROGRESS:"query.progress",CONVERSATION_DELTA:"conversation.delta",RUN_LIFECYCLE:"run.lifecycle",HISTORY_REPLAY:"history.replay",TURN_TERMINAL:"turn.terminal",PERMISSION_REQUEST:"permission.request"}};e.s(["SCHEDULE_TOOL_NAME",()=>o,"buildScheduledTaskIndex",()=>f,"parseScheduleToolResult",()=>p,"partitionScheduledSegments",()=>m,"retainScheduledTriggerFlag",()=>d,"withScheduledTriggerMeta",()=>u],41143);let o="ScheduleTool";function u(e,t,n){return e&&"object"==typeof e&&(t||n)?{...e,...t?{__scheduledTrigger:!0}:{},...n?{__turnId:n}:{}}:e}function d(e,t){if(!e||"object"!=typeof e)return t;let n=e.data,r=!!n&&"object"==typeof n&&!0===n.scheduledTrigger,s=!0===e.scheduledTrigger||!0===e.__scheduledTrigger,a="string"==typeof e.turnId?e.turnId:"",i="string"==typeof e.__turnId?e.__turnId:"";return r||s||a||i?{...t,...r||s?{__scheduledTrigger:!0}:{},...a||i?{__turnId:a||i}:{}}:t}function c(e){return!!e&&"object"==typeof e&&!0===e.__scheduledTrigger}function p(e,t){if("string"==typeof e)try{let t=JSON.parse(e);if(t&&"object"==typeof t)return t}catch(e){}if(e&&"object"==typeof e)return e;if(t&&"object"==typeof t){let e=t.toolUseResult;if(e&&"object"==typeof e)return e}return null}function f(e){let t=new Map,n=new Map;for(let c of e){let e=v(c);for(let g of function(e){if(!e||"object"!=typeof e)return[];let t=e.message,n=null==t?void 0:t.content;return Array.isArray(n)?n.filter(e=>!!e&&"object"==typeof e):[]}(c)){var r,s,a,i,l,u,d,f,m,b;if("tool_use"===g.type&&g.name===o){let t="string"==typeof g.id?g.id:"";if(!t)continue;let r=(b=g.input)&&"object"==typeof b?b:{},s=function(e){if(null==e||""===e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}(r.delayMinutes);n.set(t,{toolUseId:t,id:r.id,prompt:null!=(a=r.prompt)?a:"",delayMinutes:s,createdAt:e,status:"cancel"===r.action?"cancelled":"scheduled"});continue}if("tool_result"!==g.type||"string"!=typeof g.tool_use_id)continue;let h=n.get(g.tool_use_id);if(!h)continue;let v=p(g.content,c);if(!v){n.delete(g.tool_use_id);continue}let y=v.id||h.id||"pending-".concat(g.tool_use_id),S={id:y,prompt:null!=(i=h.prompt)?i:"",fireAt:null!=(u=null!=(l=null==(r=v.scheduleClock)?void 0:r.utcIso)?l:null==(s=v.scheduleClock)?void 0:s.localDateTime)?u:"",createdAt:null!=(d=h.createdAt)?d:"",delayMinutes:null!=(f=v.delayMinutes)?f:h.delayMinutes,cron:v.cron,recurring:v.recurring,status:v.error?"failed":null!=(m=h.status)?m:"scheduled"};t.set(y,S),n.delete(g.tool_use_id)}}for(let n of e){if(!c(n)||"user"!==g(n))continue;let e=h(n);if(e){for(let r of t.values())if(r.prompt===e&&"scheduled"===r.status){r.status="fired",r.firedTurnId=function(e){if(!e||"object"!=typeof e)return"";let t=e.__turnId;return"string"==typeof t?t:""}(n);break}}}return t}function m(e,t){let n=new Map,r=new Set,s=0;for(;s<e.length;){var a;if(!c(e[s])){s+=1;continue}let i=s,l=[];for(;s<e.length&&c(e[s]);)l.push(e[s]),s+=1;let o=s-1,u=null!=(a=l.filter(e=>"user"===g(e)).map(e=>h(e)).find(e=>e.trim().length>0))?a:"",d=v(l[0]),p=l.filter(e=>"user"!==g(e)),f=function(e,t){if(e&&t.trim()){for(let n of e.values())if(n.prompt===t)return n.id}}(t,u);n.set(i,{kind:"scheduledTurn",startIndex:i,endIndex:o,dispatchedPrompt:u,triggeredAt:d,taskId:f,assistantMessages:p});for(let e=i+1;e<=o;e+=1)r.add(e)}return{scheduledStarts:n,consumed:r}}function g(e){if(!e||"object"!=typeof e)return"";let t=e.type;if("string"==typeof t)return t;let n=e.message;return"string"==typeof(null==n?void 0:n.role)?n.role:""}function h(e){if(!e||"object"!=typeof e)return"";let t=e.message,n=null==t?void 0:t.content;return"string"==typeof n?n:Array.isArray(n)?n.map(e=>e&&"object"==typeof e?"text"===e.type&&"string"==typeof e.text?e.text:"markdown"===e.type&&"string"==typeof e.content?e.content:"":"").filter(Boolean).join("\n").trim():""}function v(e){var t;if(!e||"object"!=typeof e)return"";let n=e.message,r=n&&"object"==typeof n?n.timestamp:void 0,s=null!=(t=null!=r?r:e.timestamp)?t:e.ts;return"string"==typeof s?s:""}var b=e.i(55227);function y(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.floor(t)):0}function S(e){let t=e&&"object"==typeof e?Number(e.protocolVersion):NaN;return"object"==typeof e&&null!==e&&"protocolVersion"in e&&Number.isFinite(t)&&3===t&&"string"==typeof e.type}let x=new Map;function j(e){if(!e||"object"!=typeof e)return"";if(("string"==typeof e.type?e.type:"unknown")===l.EVENT.TURN_TERMINAL){let t="string"==typeof e.resultText?e.resultText:"",n="string"==typeof e.reason?e.reason:"";return"resolved"==("resolved"===e.status?"resolved":"failed")?t:"turn.terminal failed: ".concat(n||"unknown")}try{return"```json\n".concat(JSON.stringify(e,null,2).slice(0,8e3),"\n```")}catch(t){return String(e)}}var A=e.i(87243),N=e.i(50711);async function k(e,t,n){var r;let a=String(e||"").trim();if(!a)return!1;let i=s.useAppStore.getState();if(a===(i.agentId.trim()||"qihoo"))return!1;let l=(null==n||null==(r=n.displayName)?void 0:r.trim())||a;i.startDraftSession(),i.resetAgentConfig(),i.setAgentId(a),i.setCurrentWorkspaceAgent({id:a,displayName:l});try{await t.loadSessions()}catch(e){}t.loadAgentConfig();let o=s.useAppStore.getState().sessionId.trim();return t.preferReconnect?t.reconnect():t.switchSession(o,a),!0}var I=e.i(92413),w=e.i(55146),C=e.i(72064),E=e.i(46798),T=e.i(85570),R=e.i(97249),_=e.i(75157),M=e.i(8279),P=e.i(52727),L=e.i(18253);function O(e){let{collapsed:r,onGoToSettings:a}=e,{push:i}=(0,L.useGuardedAppNavigation)(),l=(0,s.useAppStore)(e=>e.currentWorkspaceAgent),o=(0,s.useAppStore)(e=>e.agentId),u=(0,s.useAppStore)(e=>e.wsUrl),d=(0,s.useAppStore)(e=>e.apiBase),c=(0,s.useAppStore)(e=>e.setCurrentWorkspaceAgent),{switchWorkspaceAgent:p}=(0,T.useWorkspaceRuntime)(),f=o.trim()||"qihoo",m=(null==l?void 0:l.id)===f&&l.displayName.trim()||f,g=(0,M.initialsFromLabel)(m),[h,v]=(0,n.useState)(!1),[b,y]=(0,n.useState)([]),[S,x]=(0,n.useState)(!1),[j,A]=(0,n.useState)(null),N=(0,n.useRef)(null),k=(0,n.useCallback)(()=>{N.current&&(clearTimeout(N.current),N.current=null)},[]),I=(0,n.useCallback)(()=>{k(),v(!0)},[k]),w=(0,n.useCallback)(()=>{k(),N.current=setTimeout(()=>{v(!1),N.current=null},120)},[k]),O=(0,n.useCallback)(()=>{v(!1),null==a||a()},[a]),D=(0,n.useCallback)(async e=>{let t=e.id.trim();v(!1),t&&t!==f&&await p(t,e.displayName)&&i((0,R.buildAppNavHref)("/",{ensureAgent:!0,agent:t,preserveSessionId:!1}))},[f,i,p]);return(0,n.useEffect)(()=>{if(!h)return;let e=!1;return x(!0),A(null),y([]),(0,P.listAgents)(u,d).then(t=>{e||y(t)}).catch(t=>{e||A(String(t))}).finally(()=>{e||x(!1)}),()=>{e=!0}},[h,u,d]),(0,n.useEffect)(()=>{if(!b.length)return;let e=b.find(e=>e.id===f);e&&((null==l?void 0:l.id)!==e.id||l.displayName!==e.displayName)&&c(e)},[b,f,l,c]),(0,n.useEffect)(()=>()=>{N.current&&clearTimeout(N.current)},[]),(0,t.jsxs)("div",{className:(0,_.cn)("shrink-0 border-t border-solid border-[var(--ds-border)] transition",r?"flex w-full justify-center p-[1rem_.75rem]":"flex items-center gap-2 p-[1rem_.75rem]"),onClick:r?e=>e.stopPropagation():void 0,children:[(0,t.jsxs)("div",{className:(0,_.cn)("relative min-w-0",!r&&"flex-1"),onMouseEnter:I,onMouseLeave:w,children:[(0,t.jsxs)("div",{className:(0,_.cn)("flex min-w-0 cursor-pointer items-center gap-2 rounded-lg px-0.5 py-0.5",r&&"w-full justify-center"),children:[(0,t.jsx)("span",{className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold text-white",style:{background:"var(--avatar-bg)"},children:g}),r?null:(0,t.jsx)("span",{className:"min-w-0 truncate text-base text-[var(--ds-text)]",children:m})]}),h?(0,t.jsx)("div",{className:"absolute bottom-full left-0 z-50 pb-2 shadow-[var(--shadow-float)]",onMouseEnter:I,onMouseLeave:w,children:(0,t.jsx)("div",{className:(0,_.cn)("flex max-h-[300px] w-[260px] max-w-[min(100vw-24px,260px)] flex-col overflow-hidden rounded-[var(--ds-radius-sm)] border border-solid border-[var(--ds-border)] bg-[var(--ds-bg)]","shadow-[var(--shadow-float)]"),children:(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-1.5",role:"listbox","aria-label":"切换 Agent",children:S?(0,t.jsx)("div",{className:"px-2 py-3 text-sm text-[var(--ds-muted)]",children:"加载中…"}):j?(0,t.jsxs)("div",{className:"px-2 py-3 text-sm text-red-600",children:["加载失败: ",j]}):0===b.length?(0,t.jsx)("div",{className:"px-2 py-3 text-sm text-[var(--ds-muted)]",children:"暂无 agent"}):b.map(e=>{let n=e.id===f,r=(0,M.initialsFromLabel)(e.displayName);return(0,t.jsxs)("button",{type:"button",role:"option",className:"flex w-full cursor-pointer items-center gap-2 rounded-xl border-0 bg-transparent px-2 py-2 text-left text-base hover:bg-[var(--ds-item-hover)] focus-visible:outline-none","aria-selected":n,onClick:()=>D(e),children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-xs font-semibold text-white",style:{background:"var(--avatar-bg)"},children:r}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 leading-tight",children:[(0,t.jsx)("span",{className:"block truncate text-[var(--ds-text)]",children:e.displayName}),e.displayName!==e.id?(0,t.jsx)("span",{className:"block truncate text-xs text-[var(--ds-muted)]",children:e.id}):null]}),n?(0,t.jsx)("span",{className:"shrink-0","aria-label":"当前 Agent",children:(0,t.jsx)(C.default,{name:"Check",size:16,className:"text-[var(--ds-accent)]"})}):null]},e.id)})})})}):null]}),(0,t.jsx)(E.TooltipProvider,{delayDuration:150,children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-[var(--ds-muted)] hover:bg-[var(--ds-item-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ds-accent)]","aria-label":"设置",onClick:O,children:(0,t.jsx)(C.default,{name:"More",size:16,className:"shrink-0"})})}),(0,t.jsx)(E.TooltipContent,{side:"top",children:(0,t.jsx)("p",{children:"设置"})})]})})]})}var D=e.i(82787);let W="bridge-sidebar-collapsed";function z(e){let{onNewSession:a,onSelectSession:i,deleteSessionById:l}=e,{push:o,router:u}=(0,L.useGuardedAppNavigation)(),d=(0,r.usePathname)(),c=(0,s.useAppStore)(e=>e.lastSessions),p=(0,s.useAppStore)(e=>e.sessionId),f=(0,s.useAppStore)(e=>e.brand),m=(0,s.useAppStore)(e=>e.agentId),[g,h]=(0,n.useState)(!1),v=(0,n.useRef)(!1),[b,y]=(0,n.useState)(null),[S,x]=(0,n.useState)(!0),j=(0,n.useMemo)(()=>(0,D.getBridgeSidebarManageRoutes)(),[]),A=(0,n.useCallback)((e,t)=>(0,R.buildAppNavHref)(e,{ensureAgent:null==t?void 0:t.ensureAgent,agent:m,preserveSessionId:"/"===e&&!(null==t?void 0:t.clearSessionId),sessionId:null==t?void 0:t.sessionId}),[m]),N=(0,n.useCallback)(e=>{let t=(0,R.normalizeAppPathname)(d),n=(0,R.normalizeAppPathname)(e);return t===n||t.startsWith("".concat(n,"/"))},[d]),k=(0,n.useCallback)(e=>{o(A(e,{ensureAgent:!0}))},[o,A]);(0,n.useEffect)(()=>{let e,t,n=[...["env","add-account"].flatMap(e=>{var t;let n=null==(t=(0,D.getManageRoute)(e))?void 0:t.href;return n?[A(n,{ensureAgent:!0})]:[]}),...j.map(e=>A(e.href,{ensureAgent:!0}))],r=()=>{for(let e of n)try{u.prefetch(e)}catch(e){}};return"requestIdleCallback"in window?e=window.requestIdleCallback(r,{timeout:2500}):t=setTimeout(r,200),()=>{void 0!==e&&window.cancelIdleCallback(e),void 0!==t&&clearTimeout(t)}},[u,A,j]),(0,n.useEffect)(()=>{try{let e=window.localStorage.getItem(W);"true"===e&&h(!0)}catch(e){}finally{v.current=!0}},[]),(0,n.useEffect)(()=>{if(v.current)try{window.localStorage.setItem(W,String(g))}catch(e){}},[g]),(0,n.useEffect)(()=>{if(!b)return;let e=e=>{let t=e.target;!(!(t instanceof Element)||t.closest("[data-session-menu-wrap]"))&&(t.closest('[data-slot="dropdown-menu-content"]')||y(null))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[b]);let T=(0,n.useCallback)(()=>{o(A(D.MANAGE_DEFAULT_HREF,{ensureAgent:!0}))},[o,A]);return(0,t.jsx)("aside",{className:"sidebar ".concat(g?"is-collapsed h-dvh max-h-dvh min-h-0 self-start":""),"data-region":"sidebar-panels",onClick:()=>{g&&h(!1)},children:g?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col items-center gap-[10px] overflow-y-auto overscroll-contain pt-3",children:(0,t.jsxs)(E.TooltipProvider,{side:"right",children:[(0,t.jsx)("div",{className:"group relative flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center",onClick:e=>e.stopPropagation(),children:(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center transition-opacity group-hover:pointer-events-auto group-hover:opacity-100",children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"sidebar-collapsed-icon-btn",title:"展开侧边栏","aria-label":"展开侧边栏",onClick:e=>{e.preventDefault(),e.stopPropagation(),h(!1)},children:(0,t.jsx)(C.default,{name:"Layout",size:17,color:"#8f8f8f"})})}),(0,t.jsx)(E.TooltipContent,{children:(0,t.jsx)("p",{children:"展开侧边栏"})})]})})}),(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"sidebar-collapsed-icon-btn",title:"新聊天","aria-label":"新聊天",onClick:e=>{e.preventDefault(),e.stopPropagation(),a(),o(A("/",{clearSessionId:!0}))},children:(0,t.jsx)(C.default,{name:"Add",size:16,className:"text-zinc-700"})})}),(0,t.jsx)(E.TooltipContent,{children:(0,t.jsx)("p",{children:"新聊天"})})]}),j.map(e=>{let n=N(e.href);return(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"sidebar-collapsed-icon-btn ".concat(n?"bg-[var(--ds-item-active)] text-[var(--ds-accent)]":""),title:e.label,"aria-label":e.label,"aria-current":n?"page":void 0,onClick:t=>{t.preventDefault(),t.stopPropagation(),k(e.href)},children:(0,t.jsx)(C.default,{name:e.icon,size:16,className:n?"text-[var(--ds-accent)]":"text-zinc-700",strokeWidth:1.2})})}),(0,t.jsx)(E.TooltipContent,{children:(0,t.jsx)("p",{children:e.label})})]},e.key)})]})}),(0,t.jsx)("div",{className:"w-full shrink-0",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(O,{collapsed:!0,onGoToSettings:T})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"sidebar-brand",children:(0,t.jsxs)("div",{className:"sidebar-brand-title-row flex items-center justify-between",children:[(0,t.jsx)("div",{className:"logo flex min-w-0 items-center gap-2",children:(0,t.jsx)("span",{className:"truncate text-zinc-900",children:f})}),(0,t.jsx)(E.TooltipProvider,{side:"right",children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"sidebar-icon-btn",title:"收起侧边栏","aria-label":"收起侧边栏",onClick:e=>{e.preventDefault(),e.stopPropagation(),h(!0)},children:(0,t.jsx)(C.default,{name:"Layout",size:17,color:"#8f8f8f"})})}),(0,t.jsx)(E.TooltipContent,{children:(0,t.jsx)("p",{children:"收起侧边栏"})})]})})]})}),(0,t.jsx)("div",{className:"new-chat",children:(0,t.jsxs)("div",{className:"mb-4 ml-2 mr-2 mt-2 flex cursor-pointer items-center gap-2.5 rounded-2xl px-2 py-2 text-base text-zinc-700 transition-colors hover:bg-white/70",title:"开启新对话","aria-label":"开启新对话",onClick:e=>{e.preventDefault(),a(),o(A("/",{clearSessionId:!0}))},children:[(0,t.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--ds-item-active)] text-[var(--ds-accent)]","aria-hidden":!0,children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,t.jsx)("path",{d:"M12 5v14M5 12h14"})})}),(0,t.jsx)("span",{className:"min-w-0 font-medium",children:"新会话"})]})}),(0,t.jsx)("div",{className:"sidebar-drawers",children:j.map(e=>{let n=N(e.href);return(0,t.jsxs)("div",{className:"m-[.35rem_.35rem_0] flex cursor-pointer items-center rounded-[var(--ds-radius-sm)] p-[.45rem_.75rem] ".concat(n?"bg-[var(--ds-item-active)] text-[var(--ds-accent)]":"hover:bg-[var(--ds-item-active)] hover:text-zinc-900"),role:"button",tabIndex:0,"aria-current":n?"page":void 0,onClick:t=>{t.preventDefault(),t.stopPropagation(),k(e.href)},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&k(e.href)},children:[(0,t.jsx)(C.default,{name:e.icon,size:16,className:"mr-3 text-zinc-700",strokeWidth:1.2}),(0,t.jsx)("span",{className:"text-base text-zinc-900",children:e.label})]},e.key)})}),(0,t.jsx)("div",{className:"sidebar-drawers",children:(0,t.jsxs)("div",{className:"sidebar-drawer m-[.35rem_.35rem_0] mt-4",children:[(0,t.jsxs)("button",{type:"button",className:"flex w-full cursor-pointer items-center !border-none !bg-transparent p-[.45rem_.75rem] text-left text-[12px] font-[600] text-zinc-400 hover:text-zinc-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ds-accent)] focus-visible:ring-offset-2","aria-expanded":S,"aria-controls":"sessionList","aria-label":S?"收起历史会话列表":"展开历史会话列表",onClick:()=>{x(e=>!e)},children:["历史会话",S?(0,t.jsx)(C.default,{name:"ChevronDown",size:12,strokeWidth:1,className:"ml-1 shrink-0 text-[var(--ds-muted)]"}):(0,t.jsx)(C.default,{name:"ChevronRight",size:12,strokeWidth:1,className:"ml-1 shrink-0 text-[var(--ds-muted)]"})]}),S?(0,t.jsx)("div",{className:"sidebar-drawer-body sidebar-drawer-body--sessions",children:(0,t.jsx)("div",{id:"sessionList",children:c.length?(0,I.groupSessionsByMonth)(c).map(e=>(0,t.jsx)("div",{children:e.items.map(e=>{let n=e.sessionId===p.trim();return(0,t.jsxs)("div",{className:"sidebar-drawer-item session-item ".concat(n?"active":""),children:[(0,t.jsx)("button",{type:"button",className:"session-item-main",onClick:t=>{t.stopPropagation(),i(e.sessionId),o(A("/",{sessionId:e.sessionId}))},children:(0,t.jsx)("div",{className:"session-item-title",children:(0,I.sessionTitle)(e)})}),(0,t.jsx)("div",{className:"session-menu-wrap","data-session-menu-wrap":"",onClick:t=>{t.stopPropagation(),t.target===t.currentTarget&&y(t=>t===e.sessionId?null:e.sessionId)},children:(0,t.jsxs)(w.DropdownMenu,{open:b===e.sessionId,onOpenChange:e=>{e||y(null)},children:[(0,t.jsx)(w.DropdownMenuTrigger,{type:"button",className:"session-menu-btn","aria-label":"更多",onClick:t=>{t.stopPropagation(),y(t=>t===e.sessionId?null:e.sessionId)},children:"···"}),(0,t.jsxs)(w.DropdownMenuContent,{align:"end",side:"bottom",sideOffset:6,className:"w-[172px] min-w-[172px] rounded-[var(--ds-radius-sm)] border border-[var(--ds-border)] bg-[var(--ds-bg)] p-1.5",children:[(0,t.jsxs)(w.DropdownMenuItem,{className:"h-9 rounded-xl px-2.5 text-base text-[var(--ds-text)] hover:bg-[var(--ds-item-active)] focus:bg-[var(--ds-item-hover)]",onClick:()=>{navigator.clipboard.writeText(e.sessionId)},children:[(0,t.jsx)(C.default,{name:"Clipboard",size:16,className:"text-[var(--ds-muted)]"}),"复制完整 ID"]}),(0,t.jsx)(w.DropdownMenuSeparator,{className:"mx-1 my-1 bg-[var(--ds-border)]"}),(0,t.jsxs)(w.DropdownMenuItem,{variant:"destructive",className:"h-9 rounded-xl px-2.5 text-base hover:bg-[#fff1f1] focus:bg-[#fff1f1]",onClick:()=>{(async()=>{let t=e.sessionId===p.trim(),n=await l(e.sessionId);t&&n&&o(A("/",{clearSessionId:!0}))})()},children:[(0,t.jsx)(C.default,{name:"Trash2",size:16}),"删除会话"]})]})]})})]},e.sessionId)})},e.key)):(0,t.jsx)("p",{className:"sidebar-drawer-empty",children:"(暂无会话)"})})}):null]})}),(0,t.jsx)(O,{collapsed:!1,onGoToSettings:T})]})})}var B=e.i(19455),F=e.i(61196);function U(){let e=(0,F.useStageThreadFlyoutStore)(e=>e.open),r=(0,F.useStageThreadFlyoutStore)(e=>e.title),s=(0,F.useStageThreadFlyoutStore)(e=>e.content),a=(0,F.useStageThreadFlyoutStore)(e=>e.width),i=(0,F.useStageThreadFlyoutStore)(e=>e.hideHeader),l=(0,F.useStageThreadFlyoutStore)(e=>e.bodyClassName),o=(0,F.useStageThreadFlyoutStore)(e=>e.requestCloseFlyout),[u,d]=(0,n.useState)(a),[c,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&o()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[e,o]),(0,n.useEffect)(()=>{e&&d((0,F.clampStageThreadFlyoutWidth)(a))},[e,a]);let f=(0,n.useCallback)(e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),p(!0);let n=e.clientX,r=e=>{let t=n-e.clientX;d((0,F.clampStageThreadFlyoutWidth)(u+t))},s=()=>{p(!1),t.removeEventListener("pointermove",r),t.removeEventListener("pointerup",s),t.removeEventListener("pointercancel",s),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",t.addEventListener("pointermove",r),t.addEventListener("pointerup",s),t.addEventListener("pointercancel",s)},[u]);return(0,t.jsx)("aside",{className:(0,_.cn)("stage-thread-flyout",e&&"is-open",c&&"is-resizing"),"data-region":"stage-thread-flyout","aria-hidden":!e,style:{"--stage-flyout-width":"".concat(u,"px")},children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"stage-thread-flyout-resize",role:"separator","aria-orientation":"vertical","aria-valuenow":u,"aria-valuemin":F.STAGE_THREAD_FLYOUT_MIN_WIDTH,"aria-valuemax":F.STAGE_THREAD_FLYOUT_MAX_WIDTH,"aria-label":"调整面板宽度",onPointerDown:f,children:(0,t.jsx)("span",{className:"stage-thread-flyout-resize-bar","aria-hidden":!0})}),(0,t.jsxs)("div",{className:"stage-thread-flyout-inner",children:[i?null:(0,t.jsxs)("header",{className:"stage-thread-flyout-header",children:[r?(0,t.jsx)("h2",{className:"stage-thread-flyout-title",children:r}):(0,t.jsx)("span",{className:"stage-thread-flyout-title","aria-hidden":!0}),(0,t.jsx)(B.Button,{type:"button",variant:"ghost",size:"icon-sm",className:"stage-thread-flyout-close","aria-label":"关闭",onClick:()=>void o(),children:(0,t.jsx)(C.default,{name:"X",size:16})})]}),(0,t.jsx)("div",{className:(0,_.cn)("stage-thread-flyout-body",l),children:s})]})]}):null})}var V=e.i(94606);function G(){let e=(0,r.usePathname)(),t=(0,r.useRouter)(),s=(0,n.useRef)(null),a=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{if(a.current)return;let n=s.current;if(s.current=e,!n||n===e)return;let{open:r,guardRoute:i,isDirty:l,closeFlyout:o}=F.useStageThreadFlyoutStore.getState();if(r&&(0,V.isLeavingFlyoutGuardRoute)(i,n,e)){if(!(0,V.shouldConfirmFlyoutRouteChange)(i,n,e,l))return void o();a.current=!0,t.replace(n),(0,V.confirmDiscardFlyoutChanges)().then(r=>{a.current=!1,r?(o(),t.push(e),s.current=e):s.current=n})}},[e,t]),null}function q(e){let{children:n,mainClassName:r,mainRegion:s,sidebar:a}=e;return(0,t.jsxs)("div",{className:"app","data-ui-layer":"presentation","data-topology":"local-first",children:[(0,t.jsx)(z,{onNewSession:a.onNewSession,onSelectSession:a.onSelectSession,onSaveAgentConfig:a.onSaveAgentConfig,deleteSessionById:a.deleteSessionById}),(0,t.jsx)("main",{className:(0,_.cn)("main overflow-x-auto",r),"data-region":s,children:(0,t.jsx)("div",{className:"main-content",children:n})}),(0,t.jsx)(U,{}),(0,t.jsx)(G,{})]})}function H(){let e=(0,s.useAppStore)(e=>e.wsUrl),t=(0,s.useAppStore)(e=>e.apiBase),r=(0,s.useAppStore)(e=>e.agentId),i=(0,s.useAppStore)(e=>e.agentSelectionResolved),l=(0,s.useAppStore)(e=>e.setWsUrl),o=(0,s.useAppStore)(e=>e.setAgentId),{loadSessions:u,loadAgentConfig:d}=(0,A.useSession)();return(0,n.useLayoutEffect)(()=>{s.useAppStore.getState().wsUrl.trim()||l((0,a.defaultWsUrl)())},[l]),(0,n.useLayoutEffect)(()=>{(0,R.syncRuntimeAgentWithUrl)(s.useAppStore.getState().agentId,o)},[r,o]),(0,n.useEffect)(()=>{if(!e.trim())return;let t=!1;return(async()=>{let e=s.useAppStore.getState();e.setAgentSelectionResolved(!1),e.setAgentSelectionError(null);let n=(0,R.readAgentFromLocationSearch)().trim()||e.agentId.trim()||"qihoo";try{var r;let s=await (0,P.listAgents)(e.wsUrl,e.apiBase);if(t)return;if(!s.length){e.setAgentSelectionError("暂无可用 Agent"),e.setAgentSelectionResolved(!1);return}let a=null!=(r=s.find(e=>e.id===n))?r:s[0];if(!a){e.setAgentSelectionError("暂无可用 Agent"),e.setAgentSelectionResolved(!1);return}e.agentId.trim()!==a.id&&e.setAgentId(a.id),e.setCurrentWorkspaceAgent(a),(0,R.replaceRuntimeAgentInUrl)(a.id),e.setAgentSelectionResolved(!0)}catch(n){if(t)return;e.setAgentSelectionError(n instanceof Error?n.message:String(n)),e.setAgentSelectionResolved(!1)}})(),()=>{t=!0}},[e,t,r]),(0,n.useEffect)(()=>{i&&(u(),d())},[i,r,e,t,u,d]),null}function Y(){let e=(0,r.useSearchParams)(),t=(0,s.useAppStore)(e=>e.setAgentId),a=(0,s.useAppStore)(e=>e.setAgentSelectionResolved);return(0,n.useLayoutEffect)(()=>{var n;let r=null==(n=e.get("agent"))?void 0:n.trim();r&&r!==s.useAppStore.getState().agentId.trim()&&(a(!1),t(r))},[e,t,a]),null}function Q(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H,{}),(0,t.jsx)(n.Suspense,{fallback:null,children:(0,t.jsx)(Y,{})})]})}function J(e){let{children:o}=e,d=(0,r.usePathname)(),c=function(e){if(!e)return!1;let t=(0,R.normalizeAppPathname)(e);return"/manage"===t||t.startsWith("/manage/")}(d),p=(0,D.isManageSideNavPath)(d),f=(0,s.useAppStore)(e=>e.wsUrl),m=(0,s.useAppStore)(e=>e.apiBase),g=(0,s.useAppStore)(e=>e.agentId),h=(0,s.useAppStore)(e=>e.sessionId),v=(0,s.useAppStore)(e=>e.sessionViewMode),I=(0,s.useAppStore)(e=>e.setSessionId),w=(0,s.useAppStore)(e=>e.setSessionViewMode),C=(0,s.useAppStore)(e=>e.setPendingHistoryRefresh),{loadSessions:E,loadAgentConfig:_,loadSessionOverrides:M,deleteSessionById:P}=(0,A.useSession)(),L=(0,N.usePersistAgentConfig)(),{reconnect:O,switchSession:W,sendPrompt:z,sendAbort:B,sendReloadAgentConfig:F,sendPermissionResponse:U}=function(e){let t=(0,n.useRef)(null),r=(0,n.useRef)(""),o=(0,n.useRef)(0),d=(0,n.useRef)(0),c=(0,n.useRef)(0),p=(0,n.useRef)(new Map),f=(0,n.useRef)(null==e?void 0:e.onSession);f.current=null==e?void 0:e.onSession;let m=(0,s.useAppStore)(e=>e.wsUrl),g=(0,s.useAppStore)(e=>e.agentSelectionResolved),h=(0,n.useCallback)(()=>(o.current+=1,o.current),[]),v=(0,n.useCallback)(()=>{if(t.current){let e=t.current;t.current.close(),(0,i.clearActiveWebSocket)(e),t.current=null}let e=s.useAppStore.getState();e.setWsConnected(!1),e.setBridgeReady(!1),e.resetApiErrorState(),e.setAssistantGenerating(!1),p.current.clear()},[]),A=(0,n.useCallback)((e,t)=>{var n,a,i,o,c,m,g,v;let b=(null==t?void 0:t.httpReplay)===!0,y=s.useAppStore.getState(),S=(e.runId||"main").trim()||"main",N="string"==typeof e.agent_name?e.agent_name.trim():"";N&&p.current.set(S,N);let k=function(t,n){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=r&&e.data&&"object"==typeof e.data&&"string"==typeof e.data.sourceAgent?e.data.sourceAgent.trim():"",a=p.current.get(S)||"";return t||s||a||n},I=String(null!=(n=e.sessionId)?n:"").trim()||r.current.trim()||y.sessionId.trim()||"unknown",w="".concat(d.current,":").concat(I);if(e.eventId&&function(e,t){var n;let r=t||"default",s=null!=(n=x.get(r))?n:new Set;if(s.has(e))return!0;if(s.add(e),s.size>4096)for(let e of Array.from(s).slice(0,2048))s.delete(e);return x.set(r,s),!1}(e.eventId,w))return void y.appendLog("dedup","eventId=".concat(e.eventId," 已忽略"));switch(y.appendLog(b?"← replay":"←",e),e.type){case l.EVENT.SESSION_META:{let t=e.data,n=String(null!=(i=null!=(a=t.sessionId)?a:e.sessionId)?i:""),s=y.sessionId.trim();if(r.current){if(n&&n!==s)return void y.appendLog("switchSession","忽略过期 session.meta incoming=".concat(n," current=").concat(s));r.current=""}t.agent&&y.setBrandAgent(String(t.agent)),n&&(y.setSessionId(n),null==(o=f.current)||o.call(f,n));break}case l.EVENT.SESSION_READY:{y.resetApiErrorState();let t=e.data;r.current&&y.sessionId.trim()===r.current&&(r.current=""),y.markReady(),t.agent&&y.setBrandAgent(String(t.agent));break}case l.EVENT.SESSION_ERROR:{let t=e.data,n=null!=(c=t.message)?c:JSON.stringify(t);y.setAssistantGenerating(!1),y.setStatus("错误: ".concat(String(n)),"err");break}case l.EVENT.QUERY_PROGRESS:{y.resetApiErrorState();let t=String(null!=(m=e.data.phase)?m:"");"idle"===t?(y.setQueryPhase(""),y.bridgeReady&&y.setStatus("已就绪","ready")):(y.setQueryPhase(t),y.setStatus("查询阶段: ".concat(t,"…"),""));break}case l.EVENT.CONVERSATION_DELTA:{y.resetApiErrorState();let t=e.data;if(!t.action)break;if("message_added"===t.action||"message_updated"===t.action||"message_removed"===t.action||"tool_call"===t.action||"tool_result"===t.action||"message_completed"===t.action){if(!b&&r.current){let t=String(null!=(g=e.sessionId)?g:"").trim(),n=r.current.trim(),s=y.sessionId.trim();if(t&&t!==n&&t!==s){y.appendLog("switchSession","忽略切换过程中的过期 conversation.delta incoming=".concat(t," pending=").concat(n," current=").concat(s));break}}let n={eventId:e.eventId,action:t.action,index:t.index,message:u(t.message,!0===t.scheduledTrigger||!0===e.scheduledTrigger,"string"==typeof e.turnId?e.turnId:"")},s=k("",S),a=h();y.applyRunMessageDelta({...n,runId:S,sourceAgent:s,ts:"string"==typeof e.ts?e.ts:"",arrivalSeq:a})}"message_completed"===t.action&&y.setStreamBuffer("");break}case l.EVENT.RUN_LIFECYCLE:{let t=e.data,n="string"==typeof t.event&&t.event||("string"==typeof t.state?t.state:"");if("replay.start"===n||"replay.end"===n)break;y.setRunLifecycleData({event:n,message:t.message});let r=k("string"==typeof t.sourceAgent?t.sourceAgent.trim():"","system",!1),s=j(t);s.trim()&&y.appendSourceAgentMessage({key:"string"==typeof e.eventId?e.eventId:"lc-".concat(Date.now()),source:r,runId:S,correlationId:"",status:"resolved",text:s,ts:"string"==typeof e.ts?e.ts:"",arrivalSeq:h()}),"configReloaded"===n&&y.setStatus("已重新加载 agent.md / agent.json",y.bridgeReady?"ready":"");break}case l.EVENT.HISTORY_REPLAY:{let n=e.data;if(Array.isArray(n.events))for(let e=0;e<n.events.length;e+=1){let r=n.events[e];r&&"object"==typeof r&&r.type!==l.EVENT.HISTORY_REPLAY&&A(r,t)}break}case l.EVENT.TURN_TERMINAL:{y.resetApiErrorState(),y.setStreamBuffer(""),y.setAssistantGenerating(!1),y.setQueryPhase("");let t=e.data;y.setTurnTerminalData({status:t.status,resultText:t.resultText,reason:t.reason});let n=s.useAppStore.getState();"resolved"===t.status?n.setStatus("本轮结束(可继续发送)",n.bridgeReady?"ready":""):"failed"===t.status?n.setStatus("本轮失败: ".concat(null!=(v=t.reason)?v:"未知错误"),"err"):"cancelled"===t.status?n.setStatus("本轮已取消",n.bridgeReady?"ready":""):n.setStatus("本轮结束(可继续发送)",n.bridgeReady?"ready":"");let r=k("string"==typeof t.sourceAgent?t.sourceAgent.trim():"","main"===S?"main":"unknown-agent",!1),a="string"==typeof t.correlationId?t.correlationId:"",i=j({type:l.EVENT.TURN_TERMINAL,status:t.status,reason:t.reason,resultText:t.resultText});n.appendSourceAgentMessage({key:"string"==typeof e.eventId?e.eventId:"terminal-".concat(Date.now()),source:r,runId:S,correlationId:a,status:"resolved"===t.status?"resolved":"failed",text:i,ts:"string"==typeof e.ts?e.ts:"",arrivalSeq:h()});break}case l.EVENT.PERMISSION_REQUEST:{let t=e.data,n="string"==typeof t.requestId?t.requestId.trim():"";if(!n)break;y.enqueuePermissionRequest({requestId:n,toolName:"string"==typeof t.toolName?t.toolName:"tool",description:"string"==typeof t.description?t.description:"",input:null!=t.input?t.input:{},runId:S})}}},[h]),N=(0,n.useCallback)(e=>{var t,n,a,i,l;let o=s.useAppStore.getState(),u=String(null!=(t=e.type)?t:"");if("system"===u&&"api_error"===e.subtype){let t=y(e.retryAttempt),n=y(e.maxRetries),r=y(e.retryInMs),s=Date.now()+r,a=n>0&&t>=n?"failed":r>=1e4?"retrying":"loading";o.setApiErrorState({phase:a,retryAttempt:t,maxRetries:n,retryInMs:r,retryUntilTs:s}),o.appendLog("api_error",{uuid:"string"==typeof e.uuid?e.uuid:"",retryAttempt:t,maxRetries:n,retryInMs:r});return}switch(u){case"messages":if(r.current)return void o.appendLog("switchSession","忽略切换过程中的 messages 回包");o.resetApiErrorState(),o.setMessages(Array.isArray(e.messages)?e.messages:[]),o.setStreamBuffer("");break;case"queryProgress":{o.resetApiErrorState();let t=String(null!=(n=e.phase)?n:"");"idle"===t?(o.setQueryPhase(""),o.bridgeReady&&o.setStatus("已就绪","ready")):(o.setQueryPhase(t),o.setStatus("查询阶段: ".concat(t,"…"),""));break}case"streamText":{o.resetApiErrorState();let t="string"==typeof e.text?e.text:"";o.setAssistantGenerating(!1),o.setStreamBuffer(t);let n=t.length>160?"".concat(t.slice(0,160),"…"):t;o.appendLog("←",{type:"streamText",len:t.length,preview:n||"(空)"});break}case"ready":o.resetApiErrorState(),r.current&&o.sessionId.trim()===r.current&&(r.current=""),o.markReady(),e.agent&&o.setBrandAgent(String(e.agent));break;case"session":{let t=String(null!=(a=e.sessionId)?a:""),n=o.sessionId.trim();if(r.current){if(t&&t!==n)return void o.appendLog("switchSession","忽略过期 session 回包 incoming=".concat(t," current=").concat(n));r.current=""}e.agent&&o.setBrandAgent(String(e.agent)),t&&(o.setSessionId(t),null==(i=f.current)||i.call(f,t));break}case"error":o.setAssistantGenerating(!1),o.setStatus("错误: ".concat(String(null!=(l=e.message)?l:JSON.stringify(e))),"err");break;case"turnComplete":{o.resetApiErrorState(),o.setStreamBuffer(""),o.setAssistantGenerating(!1),o.setQueryPhase("");let e=s.useAppStore.getState();e.setStatus("本轮结束(可继续发送)",e.bridgeReady?"ready":"");break}case"agentConfigReloaded":{let e=s.useAppStore.getState();e.setStatus("已重新加载 agent.md / agent.json",e.bridgeReady?"ready":"")}}},[]),k=(0,n.useCallback)(async(e,t)=>{let n=e.trim();if(!n)return;let r=s.useAppStore.getState(),a=r.agentId.trim()||"qihoo";try{let{envelopes:e,messageCount:s}=await (0,b.loadSessionReplay)(r.wsUrl,r.apiBase,a,n);if(t!==c.current)return;let i={httpReplay:!0};for(let t=0;t<e.length;t+=1){let n=e[t];n&&S(n)&&A(n,i)}r.appendLog("session-replay-http",{sessionId:n,messageCount:s,envelopeCount:e.length})}catch(e){if(t!==c.current)return;r.appendLog("session-replay-http",String(e)),r.setStatus("历史回放失败: ".concat(e),"err")}},[A]),I=(0,n.useCallback)(()=>{let e,n=s.useAppStore.getState();if(!n.agentSelectionResolved||t.current&&(0,i.isWebSocketOpen)(t.current)&&n.bridgeReady)return;if(t.current){let e=t.current;try{e.close()}catch(e){}(0,i.clearActiveWebSocket)(e),t.current=null}n.markConnecting(),n.resetApiErrorState(),n.resetChat(),n.clearLog(),o.current=0,p.current.clear(),d.current+=1,x.clear();let r=n.agentId.trim()||"qihoo",l=n.sessionId.trim();l&&k(l,++c.current);let u=(0,a.buildWsUrlWithQuery)(n.wsUrl,n.sessionId,r);n.appendLog("connect",u);try{t.current=e=new WebSocket(u),(0,i.setActiveWebSocket)(e)}catch(e){n.markConnectionError("连接失败: ".concat(e)),n.appendLog("error",String(e));return}e.onopen=function(){t.current===this&&s.useAppStore.getState().markConnected()},e.onclose=function(){(null==t.current||t.current===this)&&(s.useAppStore.getState().markDisconnected(),(0,i.clearActiveWebSocket)(this),t.current===this&&(t.current=null))},e.onerror=function(){t.current===this&&(s.useAppStore.getState().markConnectionError("WebSocket 错误"),s.useAppStore.getState().appendLog("error","websocket error"))},e.onmessage=function(e){let n,r=s.useAppStore.getState();try{n=JSON.parse(e.data)}catch(t){r.appendLog("raw",e.data);return}this===t.current&&(S(n)?A(n):null!==n&&"object"==typeof n&&(r.appendLog("←",n),N(n)))}},[A,N,k]),w=(0,n.useCallback)(()=>{v(),I()},[v,I]),C=(0,n.useCallback)((e,n)=>{let a=s.useAppStore.getState(),l=String(e||"").trim(),u=String(n||a.agentId||"").trim()||"qihoo",f=t.current,m=(0,i.isWebSocketOpen)(f);if(a.resetChat(),a.clearLog(),o.current=0,a.setBridgeReady(!1),a.resetApiErrorState(),a.setStatus("正在切换 session…",""),p.current.clear(),d.current+=1,l&&m&&k(l,++c.current),r.current=l,!m)return void w();try{let e={type:"switchSession",sessionId:l,agent:u};f.send(JSON.stringify(e)),a.appendLog("→",e)}catch(e){a.appendLog("error","switchSession 发送失败: ".concat(String(e))),w()}},[w,k]);(0,n.useEffect)(()=>g?(I(),()=>{v()}):void v(),[m,g,I,v]);let E=(0,n.useCallback)(e=>{let n=t.current;(0,i.isWebSocketOpen)(n)&&(n.send(JSON.stringify(e)),s.useAppStore.getState().appendLog("→",e))},[]),T=(0,n.useCallback)(e=>{String(null!=e?e:"").trim()&&s.useAppStore.getState().setAssistantGenerating(!0),E({type:"prompt",text:e})},[E]),R=(0,n.useCallback)(()=>{E({type:"abort"})},[E]),_=(0,n.useCallback)(()=>{E({type:"reloadAgentConfig"})},[E]),M=(0,n.useCallback)(()=>{E({type:"reloadAgentPrompt"})},[E]);return{wsRef:t,disconnectIfOpen:v,connectWebSocket:I,reconnect:w,switchSession:C,sendPrompt:T,sendAbort:R,sendReloadAgentConfig:_,sendReloadAgentPrompt:M,sendPermissionResponse:(0,n.useCallback)((e,t)=>{let n=String(e||"").trim();n&&E({type:"permission.response",requestId:n,behavior:t})},[E]),sendInit:(0,n.useCallback)(e=>{E({type:"init",...e})},[E])}}({onSession:e=>{E(),M(e)}}),V=(0,n.useCallback)((e,t)=>k(e,{switchSession:W,reconnect:O,loadSessions:E,loadAgentConfig:_,preferReconnect:c},{displayName:t}),[W,O,E,_,c]),G=(0,n.useMemo)(()=>({reconnect:O,switchSession:W,switchWorkspaceAgent:V,sendPrompt:z,sendAbort:B,sendReloadAgentConfig:F,sendPermissionResponse:U}),[O,W,V,z,B,F,U]),H=p?"settings-main":c?"manage-main":"draft"===v?"is-draft-session":void 0;return(0,t.jsxs)(T.WorkspaceRuntimeContext.Provider,{value:G,children:[(0,t.jsx)(Q,{}),(0,t.jsxs)("div",{className:"ws-config-hidden","aria-hidden":!0,children:[(0,t.jsx)("input",{readOnly:!0,hidden:!0,value:f}),(0,t.jsx)("input",{readOnly:!0,hidden:!0,value:m}),(0,t.jsx)("input",{readOnly:!0,hidden:!0,value:h}),(0,t.jsx)("input",{readOnly:!0,hidden:!0,value:g})]}),(0,t.jsx)(q,{mainClassName:H,mainRegion:p?"settings-shell":c?"manage-shell":"chat-shell",sidebar:{onNewSession:()=>{I(""),w("draft"),C(!1),c?O():W("",g)},onSelectSession:e=>{I(e),w("history"),C(!1),c?O():W(e,g)},onSaveAgentConfig:()=>void L({silent:!1}),deleteSessionById:async e=>{let t=await P(e);return t&&(c?O():W("",g)),t}},children:o})]})}},41796,e=>{"use strict";e.s(["SideNavShell",()=>d]);var t=e.i(18050),n=e.i(18566),r=e.i(72064),s=e.i(65934),a=e.i(75157),i=e.i(97249),l=e.i(51419),o=e.i(18253);function u(e,t){if(!t)return!1;let n=(0,i.normalizeAppPathname)(t),r=(0,i.normalizeAppPathname)(e);return n===r||n.startsWith("".concat(r,"/"))}function d(e){var d;let{title:c,navGroups:p,tabs:f,activeTabValue:m,tabVariant:g,bottomItems:h,children:v}=e,b=(0,n.usePathname)(),{push:y}=(0,o.useGuardedAppNavigation)(),S=(0,s.useAppStore)(e=>e.agentId),x=e=>{y((0,i.buildAppNavHref)(e,{ensureAgent:!0,agent:S}))},j=!!(g&&(null==f?void 0:f.length)),A=null!=m?m:null==f||null==(d=f[0])?void 0:d.value;return(0,t.jsxs)("div",{className:"side-nav-shell",children:[(0,t.jsxs)("nav",{className:"side-nav","aria-label":null!=c?c:"导航",children:[c?(0,t.jsx)("div",{className:"side-nav-title",children:c}):null,(0,t.jsx)("div",{className:"side-nav-groups",children:p.map((e,n)=>(0,t.jsx)("div",{className:"side-nav-group",children:e.items.map(e=>{let n=u(e.href,b);return(0,t.jsxs)("button",{type:"button",className:(0,a.cn)("side-nav-item",n&&"is-active"),"aria-current":n?"page":void 0,onClick:()=>x(e.href),children:[e.icon?(0,t.jsx)("span",{className:"side-nav-item-icon","aria-hidden":!0,children:(0,t.jsx)(r.default,{name:e.icon,size:16,className:"text-zinc-700",strokeWidth:1})}):null,(0,t.jsx)("span",{className:"side-nav-item-label",children:e.label})]},e.href)})},n))}),h&&h.length>0?(0,t.jsx)("div",{className:"side-nav-bottom",children:h.map(e=>{let n=u(e.href,b);return(0,t.jsxs)("button",{type:"button",className:(0,a.cn)("side-nav-item",n&&"is-active"),"aria-current":n?"page":void 0,onClick:()=>x(e.href),children:[e.icon?(0,t.jsx)("span",{className:"side-nav-item-icon","aria-hidden":!0,children:(0,t.jsx)(r.default,{name:e.icon,size:16,className:"text-zinc-700",strokeWidth:1})}):null,(0,t.jsx)("span",{className:"side-nav-item-label",children:e.label})]},e.href)})}):null]}),(0,t.jsx)("section",{className:"side-nav-content",children:j?(0,t.jsx)(l.AppTabs,{tabs:null!=f?f:[],value:A,onChange:x,listVariant:g,listClassName:"pill"===g?"mx-auto":void 0,contentClassName:"flex min-h-0 min-w-0 flex-1 flex-col",children:v}):v})]})}}]);
|