@seqyuan/annovibe 0.8.122 → 0.8.123
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +12 -12
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/agent/runtime/route.js +1 -1
- package/.next/server/app/api/internal/runtime/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +1 -1
- package/.next/server/app/login.segments/_full.segment.rsc +1 -1
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke/session-stream/page.js +1 -1
- package/.next/server/app/smoke/session-stream/page_client-reference-manifest.js +1 -1
- package/.next/server/app/smoke/session-stream.html +1 -1
- package/.next/server/app/smoke/session-stream.rsc +2 -2
- package/.next/server/app/smoke/session-stream.segments/_full.segment.rsc +2 -2
- package/.next/server/app/smoke/session-stream.segments/_head.segment.rsc +1 -1
- package/.next/server/app/smoke/session-stream.segments/_index.segment.rsc +1 -1
- package/.next/server/app/smoke/session-stream.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/smoke/session-stream.segments/smoke/session-stream/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/smoke/session-stream.segments/smoke/session-stream.segment.rsc +1 -1
- package/.next/server/app/smoke/session-stream.segments/smoke.segment.rsc +1 -1
- package/.next/server/app/smoke.html +1 -1
- package/.next/server/app/smoke.rsc +1 -1
- package/.next/server/app/smoke.segments/_full.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/_head.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/_index.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/smoke/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/smoke.segments/smoke.segment.rsc +1 -1
- package/.next/server/app-paths-manifest.json +12 -12
- package/.next/server/chunks/3041.js +5 -5
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/5377-70343e4bd39d4239.js +22 -0
- package/.next/static/chunks/app/{page-55978c1ddc84af8a.js → page-7816338a1e8f2d4d.js} +2 -2
- package/.next/static/chunks/app/smoke/session-stream/page-17dc06b24b9587f2.js +6 -0
- package/package.json +1 -1
- package/.next/static/chunks/5377-1dcfca9d5a1c5694.js +0 -22
- package/.next/static/chunks/app/smoke/session-stream/page-e4493b066a788be3.js +0 -6
- /package/.next/static/{ryv7dcOEsJ2E9qSarLzwD → -zDFcEPiS1rhVSLb5AN96}/_buildManifest.js +0 -0
- /package/.next/static/{ryv7dcOEsJ2E9qSarLzwD → -zDFcEPiS1rhVSLb5AN96}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-fb1763edb92ee346.js"/><script src="/_next/static/chunks/4bd1b696-e356ca5ba0218e27.js" async=""></script><script src="/_next/static/chunks/3794-123fdf632563f469.js" async=""></script><script src="/_next/static/chunks/main-app-8d81a93b58bb990f.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-fb1763edb92ee346.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[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[27123,[],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-fb1763edb92ee346.js"/><script src="/_next/static/chunks/4bd1b696-e356ca5ba0218e27.js" async=""></script><script src="/_next/static/chunks/3794-123fdf632563f469.js" async=""></script><script src="/_next/static/chunks/main-app-8d81a93b58bb990f.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-fb1763edb92ee346.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[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[27123,[],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"-zDFcEPiS1rhVSLb5AN96\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"nYzhE2dHT/7Bn+AJlmJqqb7Og4V1KkAhCtmoogXhWzQ="}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5377],{5377:(e,t,n)=>{n.d(t,{T:()=>W});var r=n(12115);function a(e){return e?.phase==="running_tools"?{kind:"running_tools",tools:(e.activeTools??[]).map(e=>({id:e.id,name:e.name}))}:e?.phase==="streaming"||e?.phase==="compacting"||e?.phase==="idle"?null:{kind:"waiting_model"}}function o(e){if("assistant"!==e.role)return e;let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>("object"!=typeof e||null===e||Array.isArray(e)||"toolCall"!==e.type?null:{type:"toolCall",toolCallId:"string"==typeof e.toolCallId?e.toolCallId:"string"==typeof e.id?e.id:"",toolName:"string"==typeof e.toolName?e.toolName:"string"==typeof e.name?e.name:"",input:"object"!=typeof e.input||null===e.input||Array.isArray(e.input)?"object"!=typeof e.arguments||null===e.arguments||Array.isArray(e.arguments)?{}:e.arguments:e.input})??e);return{...e,content:n}}var s=n(32383),l=n(28999);async function i(e,t){if(!t.length)return[];let n=await fetch("/api/images/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,images:t.map(e=>({data:e.data,mimeType:e.mimeType,name:e.name}))})}),r=await n.json().catch(()=>({}));if(!n.ok||r.error)throw Error(r.error??`Upload failed (HTTP ${n.status})`);return(r.uploaded??[]).map((e,n)=>({...e,previewUrl:t[n]?.previewUrl}))}async function u(e,t,n){let r,a=new TextDecoder,o="",s=e=>{if(e.startsWith("id: ")){r=e.slice(4);return}if(!e.startsWith("data: "))return;let n=e.slice(6);if("[DONE]"!==n)try{t(n,r)}catch{}finally{r=void 0}},l=new Promise(e=>{n?.aborted?e():n?.addEventListener("abort",()=>e(),{once:!0})});for(;;){let t=await Promise.race([e.read(),l.then(()=>({done:!0,value:void 0}))]);if(t.done)break;let n=(o+=a.decode(t.value,{stream:!0})).split("\n");for(let e of(o=n.pop()||"",n))s(e)}if(o.trim())for(let e of o.split("\n"))s(e)}var c=n(16865);let d="__annovibeStreamSessions__",p="__annovibeStreamListeners__",m="__annovibeStreamErrorCallbacks__";function f(){let e=globalThis;return e[d]||(e[d]=new Map),e[d]}function g(){let e=globalThis;return e[m]||(e[m]=new Map),e[m]}function h(e){return{sessionId:e,phase:"idle",startedAt:null,lastEventAt:null,lastHeartbeatAt:null,reconnectCount:0,lastSyncReason:null,accumulatedText:"",toolCalls:[],toolResults:[],statusText:null,streamingMessage:null,isStreaming:!1,error:null}}function y(e,t){let n;for(let r of(!(n=globalThis)[p]&&(n[p]=new Map),n[p]).get(e)??[])try{r(t)}catch{}}function w(e){e.textThrottleTimer&&(clearTimeout(e.textThrottleTimer),e.textThrottleTimer=null),e.textDirty&&(e.textDirty=!1,b(e))}function v(e,t=!1){let n=Date.now();if(e.snapshot.lastEventAt=n,!t){e.textDirty=!0,e.textThrottleTimer||(e.textThrottleTimer=setTimeout(()=>{e.textThrottleTimer=null,e.textDirty&&(e.textDirty=!1,b(e))},100));return}w(e),b(e)}function b(e,t){let n=Date.now(),r=function(e){let t=[];for(let n of e.toolCalls.values())t.push({type:"toolCall",toolCallId:n.toolCallId,toolName:n.toolName,input:n.input??{}});let n=e.accumulatedText.trim();return n&&t.push({type:"text",text:n}),t}(e),a=(t??e.snapshot.phase)==="active";e.snapshot={...e.snapshot,phase:t??e.snapshot.phase,lastEventAt:n,accumulatedText:e.accumulatedText,toolCalls:[...e.toolCalls.values()],toolResults:[...e.toolResults.values()],statusText:a?function(e){if(e.activeToolId){let t=e.toolCalls.get(e.activeToolId);if(t){let e=Math.max(0,Math.floor((Date.now()-t.startedAt)/1e3));return`Running ${t.toolName||"tool"}… (${e}s)`}}return e.accumulatedText.trim()?"Generating response…":e.toolCalls.size>0?"Finishing tool results…":null}(e):e.snapshot.statusText,streamingMessage:a&&r.length>0?{role:"assistant",content:r}:null,isStreaming:a},y(e.snapshot.sessionId,{type:"snapshot-updated",snapshot:e.snapshot})}function T(e){C(e),e.idleCheckTimer=setInterval(()=>{if("connected"!==e.connectionState)return;let t=Math.max(e.snapshot.lastEventAt??0,e.snapshot.lastHeartbeatAt??0);if(Date.now()-t>=18e4){k(e),w(e);let t="Stream idle timeout — no activity for 180s.";e.snapshot={...e.snapshot,phase:"error",isStreaming:!1,streamingMessage:null,statusText:null,error:t},C(e),y(e.snapshot.sessionId,{type:"error",snapshot:e.snapshot});let n=g().get(e.snapshot.sessionId);if(n)try{n(e.snapshot.sessionId,t)}catch{}}},1e4)}function C(e){e.idleCheckTimer&&(clearInterval(e.idleCheckTimer),e.idleCheckTimer=null)}function k(e){e.toolProgressTimer&&(clearInterval(e.toolProgressTimer),e.toolProgressTimer=null)}function I(e){let t=f(),n=t.get(e);return n||(n={snapshot:h(e),accumulatedText:"",toolCalls:new Map,toolResults:new Map,toolProgressTimer:null,activeToolId:null,textThrottleTimer:null,textDirty:!1,connectionState:"idle",idleCheckTimer:null},t.set(e,n)),n}function _(e,t){let n=g();return n.set(e,t),()=>{n.get(e)===t&&n.delete(e)}}function S(e){let t=f(),n=t.get(e);n&&(k(n),C(n),w(n)),t.delete(e)}function x(e){let t=f().get(e);t&&(t.snapshot={...t.snapshot,reconnectCount:t.snapshot.reconnectCount+1,lastSyncReason:"sse-reconnect",lastEventAt:Date.now()},v(t,!0))}let M="__annovibeSessionMessageCache__";function E(){let e=globalThis;if(!e[M]){var t;let n={entries:new Map,cleanupTimer:null};e[M]=n,(t=n).cleanupTimer||(t.cleanupTimer=setInterval(()=>{let e=Date.now();for(let[n,r]of t.entries)e-r.loadedAt>72e5&&t.entries.delete(n)},6e4))}return e[M]}function A(e){let t=E(),n=t.entries.get(e);return n?Date.now()-n.loadedAt>72e5?(t.entries.delete(e),null):(n.loadedAt=Date.now(),{...n,messages:[...n.messages],entryIds:[...n.entryIds]}):null}function $(e,t,n,r,a){let o=E(),s=o.entries.get(e);if(!s)return;let l=new Set(s.entryIds),i=[],u=[];for(let e=0;e<t.length;e++){let r=n[e];r&&!l.has(r)&&(i.push(t[e]),u.push(r))}0!==i.length&&o.entries.set(e,{...s,messages:[...i,...s.messages],entryIds:[...u,...s.entryIds],hasMore:r,loadedMessagesCount:a,loadedAt:Date.now()})}function R(e){E().entries.delete(e)}var D=n(14755);function L(e,t){switch(t.type){case"start":return{isStreaming:!0,streamingMessage:null};case"update":return{isStreaming:!0,streamingMessage:t.message};case"end":case"reset":return{isStreaming:!1,streamingMessage:null};default:return e}}function N(e,t){return new DOMException(e,t)}function P(){return"u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}-${Math.random().toString(36).slice(2,11)}`}let U=["read","bash","grep","find","ls"];function j(e,t){return e.trim()||0!==t?`text:${e}|images:${t}`:null}function O(e){return"string"==typeof e?j(e,0):Array.isArray(e)?j(e.filter(e=>!!e&&"object"==typeof e&&"text"===e.type&&"string"==typeof e.text).map(e=>e.text).join("\n"),e.filter(e=>!!e&&"object"==typeof e&&"image"===e.type).length):null}function F(e){let t=new Map;for(let n of e){let e="user"!==n.role?null:O(n.content);e&&t.set(e,(t.get(e)??0)+1)}return t}function H(e,t,n){return e.sessionId===t&&(!e.leafId||n.includes(e.leafId))}function K(e,t){let n=e.timestamp,r=t.timestamp;if("number"!=typeof n||"number"!=typeof r||n!==r||e.role!==t.role)return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function W(e){let{session:t,newSessionCwd:n,planMode:d=!1,onAgentEnd:p,onSessionCreated:m,onSessionForked:g,modelsRefreshKey:b,onBranchDataChange:M,onPlanModeState:W}=e,z=null===t&&null!==n,[J,B]=(0,r.useState)(null),[q,G]=(0,r.useState)(!z),[V,Y]=(0,r.useState)(null),[Q,X]=(0,r.useState)(null),[Z,ee]=(0,r.useState)([]),[et,en]=(0,r.useState)([]),[er,ea]=(0,r.useState)(0),[eo,es]=(0,r.useState)(!1),[el,ei]=(0,r.useState)(0),[eu,ec]=(0,r.useReducer)(L,{isStreaming:!1,streamingMessage:null}),[ed,ep]=(0,r.useState)(!1),[em,ef]=(0,r.useState)({}),[eg,eh]=(0,r.useState)([]),[ey,ew]=(0,r.useState)({}),[ev,eb]=(0,r.useState)({}),[eT,eC]=(0,r.useState)(null),[ek,eI]=(0,r.useState)("full"),[e_,eS]=(0,r.useState)([...D.SN]),[ex,eM]=(0,r.useState)("auto"),[eE,eA]=(0,r.useState)(null),[e$,eR]=(0,r.useState)(null),[eD,eL]=(0,r.useState)(null),[eN,eP]=(0,r.useState)(null),[eU,ej]=(0,r.useState)(null),[eO,eF]=(0,r.useState)(null),[eH,eK]=(0,r.useState)(!1),[eW,ez]=(0,r.useState)(null),[eJ,eB]=(0,r.useState)(null),[eq,eG]=(0,r.useState)(null),eV=(0,r.useRef)(null),eY=(0,r.useRef)(t?.id??null),eQ=(0,r.useRef)(!1),eX=(0,r.useRef)(null),eZ=(0,r.useRef)(null),e0=(0,r.useRef)(null),e1=(0,r.useRef)(!1),e3=(0,r.useRef)(null),e4=(0,r.useRef)(!1),e5=(0,r.useRef)(null),e2=(0,r.useRef)(null),e6=(0,r.useRef)(new Map),e7=(0,r.useRef)(new Map),e8=(0,r.useRef)(new Map),e9=(0,r.useRef)(null),te=(0,r.useRef)([]),tt=(0,r.useRef)(null),tn=(0,r.useRef)(0),tr=(0,r.useRef)(!1),ta=(0,r.useRef)(0),to=(0,r.useRef)(!1),ts=(0,r.useRef)(!1),tl=(0,r.useRef)(0),ti=(0,r.useRef)(null),tu=(0,r.useRef)(null);(0,r.useEffect)(()=>{e9.current=Q},[Q]);let tc=e.setNewSessionModel??eC,td=e.setToolPreset??eI,tp=e.setMemoryTools??eS,tm=eU??J?.context.model??eO??null,tf=z?eT:tm,tg=(0,r.useCallback)(()=>d?U:(0,D.tE)(ek,e_),[e_,d,ek]),th=(0,r.useCallback)(e=>e?.length?e.map((e,t)=>{let n=`Attachment ${t+1}: ${e.fileName} (${e.mimeType||"application/octet-stream"}, ${e.size} bytes)`;if(e.extractedText){let t=e.truncated?"\n[The extracted text was truncated before sending.]":"";return`${n}
|
|
2
|
+
${t}
|
|
3
|
+
${e.extractedText}`.trim()}return`${n}
|
|
4
|
+
[Text extraction unavailable: ${e.extractionError??"unsupported file type"}]`}).join("\n\n---\n\n"):"",[]),ty=(0,r.useCallback)(async e=>{let t=await fetch(`/api/agent/${encodeURIComponent(e)}/prepare`,{method:"POST"});if(!t.ok)throw Error((await t.json().catch(()=>({}))).error??`Failed to prepare session (HTTP ${t.status})`)},[]),tw=(()=>{let e={input:0,output:0,cacheRead:0,cacheWrite:0},t=0;for(let n of Z){if("assistant"!==n.role)continue;let r=n.usage;r&&(e.input+=r.input??0,e.output+=r.output??0,e.cacheRead+=r.cacheRead??0,e.cacheWrite+=r.cacheWrite??0,t+=r.cost?.total??0)}return e.input+e.output+e.cacheRead+e.cacheWrite>0?{tokens:e,cost:t}:null})(),tv=(0,r.useRef)(!1),tb=(0,r.useCallback)(async()=>{let e=eY.current;if(!e||tv.current||to.current)return;tv.current=!0,tr.current=!0;let t=0,n=A(e);t=n?n.loadedMessagesCount:50;try{for(;;)try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}?limit=100&offset=${t}`);if(!n.ok)break;let r=await n.json();if(eY.current!==e)break;let a=r.context.messages,o=r.context.entryIds??[];if(0===a.length)break;ee(e=>[...a,...e]),en(e=>{let t=[...o,...e];return te.current=t,t});let s=t+a.length;if(ei(s),ta.current=s,es(r.hasMore??!1),$(e,a,o,r.hasMore??!1,s),t=s,!r.hasMore)break;await new Promise(e=>setTimeout(e,800))}catch{break}}finally{tv.current=!1,to.current=!0,tr.current=!1}},[]),tT=(0,r.useCallback)(async(e,t=!1,n=!1,r=!1)=>{var a;let o=null;try{if(t&&G(!0),!n&&!eQ.current&&!r){let n=A(e);if(n)return ea(n.totalMessages),es(n.hasMore),ei(n.loadedMessagesCount),ee(n.messages),te.current=n.entryIds,en(n.entryIds),e9.current=n.leafId,X(n.leafId),ta.current=n.loadedMessagesCount,t&&G(!1),n.hasMore&&!to.current&&setTimeout(()=>{tb()},1500),null}let s=n?`/api/sessions/${encodeURIComponent(e)}?includeState`:`/api/sessions/${encodeURIComponent(e)}?limit=50&offset=0`,l=tu.current;if(l?.sid===e&&!t)return null;l?.controller.abort(N("Session load superseded","AbortError"));let i=new AbortController;o=i,tu.current={sid:e,controller:i};let u=setTimeout(()=>{i.abort(N("Session load timed out after 30 seconds","TimeoutError"))},3e4),c=await fetch(s,{signal:i.signal}).finally(()=>clearTimeout(u));if(eY.current&&eY.current!==e)return null;if(404===c.status)return t&&(B(null),e9.current=null,X(null),ee([]),Y(null)),null;if(!c.ok)throw Error(`HTTP ${c.status}`);let d=await c.json();n?(ea(d.totalMessages??d.context.messages.length),es(!1)):(ea(d.totalMessages??d.context.messages.length),es(d.hasMore??!1)),ei(d.context.messages.length),B(d),e9.current=d.leafId,X(d.leafId);let p=d.context.messages,m=F(p),f=new Map,g=Date.now();for(let[t,n]of e6.current)if(n.sessionId===e){if(g-n.createdAt>12e4){e6.current.delete(t);continue}if(n.confirmKey){let e=m.get(n.confirmKey)??0,r=f.get(n.confirmKey)??0;e-r>n.confirmCountAtCreate&&(e6.current.delete(t),f.set(n.confirmKey,r+1))}}e7.current=m;let h=d.context.entryIds??[],y=[...e6.current.values()].filter(t=>H(t,e,h)).map(e=>e.message),w=y.length>0?[...p,...y]:p,v=e8.current.get(e);if(v){for(let[e,t]of v)g-t>12e4&&v.delete(e);0===v.size&&e8.current.delete(e)}let b=v?.size?v:null,T=b?new Set(h):null,C=!!b&&!!T&&[...b.keys()].some(e=>!T.has(e));b&&T&&!C&&e8.current.delete(e);let k=w.length;return!n&&(ta.current>k||C)?(ea(d.totalMessages??d.context.messages.length),es(d.hasMore??!1)):(ee(e=>(function(e,t){if(e.length!==t.length)return t;let n=!1,r=t.map((t,r)=>K(e[r],t)?e[r]:(n=!0,t));return n?r:e})(e,w)),te.current=h,en(h),n?ta.current=k:ta.current=Math.max(ta.current,k),a={sessionId:e,leafId:d.leafId,messages:w,entryIds:h,totalMessages:d.totalMessages??d.context.messages.length,hasMore:!n&&(d.hasMore??!1),loadedMessagesCount:d.context.messages.length},E().entries.set(e,{...a,loadedAt:Date.now()})),ej(e=>{if(!e)return null;let t=d.context.model;return t?.provider===e.provider&&t.modelId===e.modelId?null:e}),Y(null),!d.agentState?.state?.thinkingLevel&&d.context.thinkingLevel&&"off"!==d.context.thinkingLevel&&eM(d.context.thinkingLevel),d.agentState?.state?.planMode&&W?.(d.agentState.state.planMode),d.agentState??null}catch(e){if(e instanceof DOMException&&("AbortError"===e.name||"TimeoutError"===e.name)||e instanceof Error&&/aborted without reason|AbortError|Session load (?:timed out|superseded)/i.test(e.message))return null;return Y(String(e)),null}finally{o&&tu.current?.controller===o&&(tu.current=null),t&&G(!1)}},[W,tb]),tC=(0,r.useRef)(!1),tk=(0,r.useCallback)(async()=>{if(tC.current)return;tC.current=!0;let e=eY.current;if(!e){tC.current=!1;return}try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}?limit=50&offset=${el}`);if(!t.ok)return;let n=await t.json(),r=n.context.messages,a=n.context.entryIds??[];ee(e=>[...r,...e]),en(e=>{let t=[...a,...e];return te.current=t,t}),ei(e=>e+r.length),es(n.hasMore??!1),$(e,r,a,n.hasMore??!1,el+r.length)}catch{}finally{tC.current=!1}},[el]),tI=(0,r.useCallback)(async(e,t)=>{try{let n=t?`/api/sessions/${encodeURIComponent(e)}/context?leafId=${encodeURIComponent(t)}`:`/api/sessions/${encodeURIComponent(e)}/context`,r=await fetch(n);if(!r.ok)throw Error(`HTTP ${r.status}`);let a=await r.json(),o=a.context.messages,s=a.context.entryIds??[],l=F(o),i=new Map,u=Date.now();for(let[t,n]of e6.current)if(n.sessionId===e){if(u-n.createdAt>12e4){e6.current.delete(t);continue}if(n.confirmKey){let e=l.get(n.confirmKey)??0,r=i.get(n.confirmKey)??0;e-r>n.confirmCountAtCreate&&(e6.current.delete(t),i.set(n.confirmKey,r+1))}}e7.current=l;let c=[...e6.current.values()].filter(t=>H(t,e,s)).map(e=>e.message);ee(c.length>0?[...o,...c]:o),te.current=s,en(s)}catch(e){console.error("Failed to load context:",e)}},[]),t_=(0,r.useCallback)(async e=>{try{let t=await (0,s.$)(e,{type:"get_tools"});t&&(td((0,D.ES)(t)),tp((0,D.IB)(t)))}catch(e){console.error("Failed to load tools:",e)}},[tp,td]),tS=(0,r.useCallback)((e,t={})=>{eV.current?.close(),eV.current=null;let n=`/api/agent/${encodeURIComponent(e)}/events${t.replay?"?replay=1":""}`;return!function(e){let t=I(e);if("active"===t.snapshot.phase)return v(t,!0),T(t),t.snapshot;let n=Date.now();t.snapshot={...h(e),phase:"active",startedAt:n,lastEventAt:n,isStreaming:!0,streamingMessage:{role:"assistant",content:[]}},T(t),v(t,!0),t.snapshot}(e),new Promise((r,a)=>{let o=!1,s=!1,l=null,i=e=>{if(!o){if(o=!0,clearTimeout(c),e){l?.close(),eV.current===l&&(eV.current=null),a(e);return}r()}},c=setTimeout(()=>{t.requireConnected?i(Error("Timed out waiting for event stream connection")):i()},t.timeoutMs??3e4);eV.current=l=function(e){let{url:t,onEvent:n,onStateChange:r,onFatalError:a,maxReconnectAttempts:o=1/0,reconnectBaseMs:s=1e3,reconnectMaxMs:l=3e4,autoReconnect:i=!0}=e,c="idle",d=new AbortController,p=0,m=null,f=null,g=!1,h=(e,t)=>{t&&(f=t),n(e,t)},y=e=>{c!==e&&(c=e,r?.(e))},w=()=>{null!==m&&(clearTimeout(m),m=null)},v=()=>{if(g)return;if(!i)return void y("error");if(p>=o){y("error"),a?.(Error(`Max reconnect attempts (${o}) reached`));return}let e=Math.min(l,s*2**p);p+=1,y("connecting"),m=setTimeout(()=>{m=null,b()},e)},b=async()=>{if(!g){w(),d=new AbortController,y("connecting");try{let e=await fetch(t,{signal:d.signal,headers:{Accept:"text/event-stream","Cache-Control":"no-cache",...f?{"Last-Event-ID":f}:{}}});if(!e.ok)throw Error(`HTTP ${e.status}: ${e.statusText}`);let n=e.body;if(!n)throw Error("Response has no readable body");let r=n.getReader();if(y("connected"),p=0,await u(r,h,d.signal),d.signal.aborted)try{await r.cancel()}catch{}r.releaseLock(),y("closed"),!g&&i&&v()}catch(e){if(g||e instanceof DOMException&&"AbortError"===e.name)return void y("closed");y("error"),i&&v()}}};return{get state(){return c},connect:()=>{g=!1,p=0,w(),b()},close:()=>{g=!0,w(),d.abort(),y("closed")},get abortController(){return d}}}({url:n,onEvent:t=>{try{let n=JSON.parse(t);if("connected"===n.type&&i(),eY.current!==e)return;eX.current?.(n)}catch{}},onStateChange:t=>{!function(e,t){let n=f().get(e);if(!n)return;let r=n.connectionState;n.connectionState=t,"connected"===t&&"connected"!==r&&(n.snapshot={...n.snapshot,lastEventAt:Date.now(),lastHeartbeatAt:Date.now()},T(n)),"connected"!==t&&"connected"===r&&C(n)}(e,t),"connected"===t&&(s&&(x(e),eZ.current?.(e,"sse_reconnected")),s=!0)},reconnectBaseMs:1e3,reconnectMaxMs:3e4}),l.connect()})},[]),tx=(0,r.useCallback)(async(e,t="manual")=>{if(!e||eY.current!==e)return;let n=tn.current;try{let t=await fetch(`/api/agent/${encodeURIComponent(e)}`),r=await t.json().catch(()=>({}));if(eY.current!==e||tn.current!==n)return;r.running?(eQ.current=!0,ep(!0),eB(a(r.state)),eV.current&&"closed"!==eV.current.state&&"error"!==eV.current.state||(x(e),tS(e,{replay:!0}))):(eQ.current=!1,eV.current?.close(),eV.current=null,S(e),ep(!1),eB(null),eA(null),ec({type:"end"}),R(e),await tT(e,!1,!1,!0)),r.state?.contextUsage!==void 0&&eR(r.state.contextUsage??null),r.state?.systemPrompt!==void 0&&eL(r.state.systemPrompt??null),r.state?.isCompacting!==void 0&&eK(r.state.isCompacting),r.state?.thinkingLevel!==void 0&&eM(r.state.thinkingLevel??"auto"),r.state?.planMode!==void 0&&W?.(r.state.planMode)}catch{}},[tS,tT,W]);(0,r.useEffect)(()=>{eZ.current=tx},[tx]),(0,r.useEffect)(()=>{eQ.current=ed},[ed]),eX.current=(0,r.useCallback)(e=>{let t=eY.current;switch(t&&function(e,t){let n=I(e),r=Date.now();switch(t.type){case"agent_start":if("active"===n.snapshot.phase)return v(n,!0),n.snapshot;return k(n),n.accumulatedText="",n.toolCalls.clear(),n.toolResults.clear(),n.activeToolId=null,n.snapshot={...h(e),phase:"active",startedAt:r,lastEventAt:r,isStreaming:!0,streamingMessage:{role:"assistant",content:[]}},T(n),v(n,!0),n.snapshot;case"message_update":{let e=t.message;if(!e||"assistant"!==e.role)return n.snapshot;let a=e.content;for(let e of Array.isArray(a)?a:[])"object"==typeof e&&null!==e&&"type"in e&&("text"===e.type?n.accumulatedText=e.text??"":"toolCall"===e.type&&e.toolCallId&&!n.toolCalls.has(e.toolCallId)&&n.toolCalls.set(e.toolCallId,{...e,startedAt:r}));return v(n,!1),n.snapshot}case"tool_execution_start":{let e="string"==typeof t.toolCallId?t.toolCallId:"",a="string"==typeof t.toolName?t.toolName:"tool",o=t.input??{};if(!e)return n.snapshot;let s=n.toolCalls.get(e);return n.toolCalls.set(e,{type:"toolCall",toolCallId:e,toolName:a,input:s?.input??o,startedAt:s?.startedAt??r}),n.activeToolId=e,k(n),n.activeToolId&&(n.toolProgressTimer=setInterval(()=>v(n,!0),1e3)),v(n,!0),n.snapshot}case"tool_execution_end":{let e="string"==typeof t.toolCallId?t.toolCallId:"",a="string"==typeof t.toolName?t.toolName:"tool",o="string"==typeof t.result?t.result:JSON.stringify(t.result??"");if(e){let s=n.toolCalls.get(e);s&&n.toolCalls.set(e,{...s,endedAt:r}),n.toolResults.set(e,{role:"toolResult",toolCallId:e,toolName:a,content:[{type:"text",text:o}],isError:!!t.isError,timestamp:r}),n.activeToolId===e&&(n.activeToolId=null,k(n))}return v(n,!0),n.snapshot}case"message_end":return w(n),v(n,!0),n.snapshot;case"agent_end":{if(w(n),k(n),n.activeToolId=null,!0===t.willRetry)return n.accumulatedText="",n.toolCalls.clear(),n.toolResults.clear(),n.snapshot={...n.snapshot,phase:"active",lastEventAt:r,accumulatedText:"",toolCalls:[],toolResults:[],statusText:null,streamingMessage:null,isStreaming:!0,error:null},T(n),y(e,{type:"snapshot-updated",snapshot:n.snapshot}),n.snapshot;C(n);let a="string"==typeof t.error?t.error:null;return n.snapshot={...n.snapshot,phase:a?"error":"completed",isStreaming:!1,streamingMessage:null,statusText:null,error:a},y(e,a?{type:"error",snapshot:n.snapshot}:{type:"completed",snapshot:n.snapshot}),n.snapshot}case"heartbeat":return n.snapshot={...n.snapshot,lastHeartbeatAt:r},n.snapshot;default:return n.snapshot}}(t,e),e.type){case"prompt_admitted":case"agent_start":eG(null),eQ.current=!0,ep(!0),eB({kind:"waiting_model"}),ec({type:"start"});break;case"agent_end":if(!0===e.willRetry){eQ.current=!0,ep(!0),eB({kind:"waiting_model"});break}eQ.current=!1,eV.current?.close(),eV.current=null,ep(!1),eB(null),eA(null),ec({type:"end"}),t&&(R(t),tT(t,!1,!1,!0),ti.current&&clearTimeout(ti.current),ti.current=setTimeout(()=>{eY.current!==t||eQ.current||(R(t),tT(t,!1,!1,!0))},500),fetch(`/api/agent/${encodeURIComponent(t)}`).then(e=>e.json()).then(e=>{e.state?.contextUsage!==void 0&&eR(e.state.contextUsage??null),e.state?.systemPrompt!==void 0&&eL(e.state.systemPrompt??null),e.state?.isCompacting!==void 0&&eK(e.state.isCompacting)}).catch(()=>{})),p?.();break;case"message_start":case"message_update":{if(!eQ.current)break;let t=e.message;if(t?.role==="user")break;t&&ec({type:"update",message:o(t)}),eB(null);break}case"message_end":{if(!eQ.current)break;let n=e.message,r="string"==typeof e.__entryId?e.__entryId:null;if(n&&"user"!==n.role){"assistant"===n.role&&"error"===n.stopReason&&n.errorMessage?.trim()&&eG(`Model response failed: ${n.errorMessage.trim()}`);let e=o(n);if(!(r&&te.current.includes(r))){if(t&&r){let e=e8.current.get(t)??new Map;e.set(r,Date.now()),e8.current.set(t,e)}ee(t=>t.some(t=>K(t,e))?t:[...t,e]),r&&en(e=>{if(e.includes(r))return e;let t=[...e,r];return te.current=t,t})}}ec({type:"reset"}),eB({kind:"waiting_model"});break}case"replay_gap":t&&(R(t),tT(t,!1,!1,!0));break;case"prompt_done":if(!eQ.current)break;tx(eY.current??"","prompt_done");break;case"prompt_error":{let n="string"==typeof e.error&&e.error.trim()?e.error.trim():"The model request failed before producing a response.";if(eQ.current=!1,ep(!1),eB(null),eA(null),ec({type:"end"}),eV.current?.close(),eV.current=null,t){for(let[e,n]of(S(t),e6.current))n.sessionId===t&&"prompt"===n.kind&&e6.current.delete(e);R(t),tT(t,!1,!1,!0)}eG(`Model request failed: ${n}`),p?.();break}case"tool_execution_start":{let t=e.toolCallId,n=e.toolName,r=e.args,a="bash"===n&&"string"==typeof r?.command?r.command:void 0;eB(e=>{let r=e?.kind==="running_tools"?[...e.tools]:[];return r.some(e=>e.id===t)||r.push({id:t,name:n,args:a}),{kind:"running_tools",tools:r}});break}case"tool_execution_end":{let t=e.toolCallId;eB(e=>{if(e?.kind!=="running_tools")return e;let n=e.tools.filter(e=>e.id!==t);return 0===n.length?{kind:"waiting_model"}:{kind:"running_tools",tools:n}});break}case"auto_retry_start":eG(null),eQ.current=!0,ep(!0),eB({kind:"waiting_model"}),eA({attempt:e.attempt,maxAttempts:e.maxAttempts,errorMessage:e.errorMessage});break;case"auto_retry_end":eA(null),!1===e.success&&"string"==typeof e.finalError&&e.finalError.trim()?eG(`Model response failed after retries: ${e.finalError.trim()}`):!0===e.success&&eG(null);break;case"auto_compaction_start":case"compaction_start":eK(!0),ez(null);break;case"auto_compaction_end":case"compaction_end":eK(!1),e.errorMessage?ez(e.errorMessage):!e.aborted&&eY.current&&tT(eY.current)}},[tT,p,tx]);let tM=(0,r.useCallback)(async(e,r,a,o)=>{if(!e.trim()&&!r?.length&&!a?.length||ed)return;tn.current+=1;let u=th(a),c=e.trim()?u?`${e}
|
|
5
|
+
|
|
6
|
+
Attached document text:
|
|
7
|
+
|
|
8
|
+
${u}`:e:u?`Attached document text:
|
|
9
|
+
|
|
10
|
+
${u}`:"",p=[],f=z?n:t?.cwd??J?.info?.cwd;if(r?.length&&f)try{p=await i(f,r)}catch(e){eG(e instanceof Error?e.message:String(e));return}let g=p.length?p.map(e=>{var t;return{type:"image",path:e.path,mimeType:e.mimeType,name:e.name,source:{type:"url",url:(t=e.path,`/api/files/${(0,l.HG)(t)}?type=read`),media_type:e.mimeType}}}):r?.map(e=>({type:"image",source:{type:"base64",media_type:e.mimeType,data:e.data}})),h={role:"user",content:g?.length?[...c.trim()?[{type:"text",text:c}]:[],...g]:c,timestamp:Date.now()},y=P(),w=z?null:t?.id??null;w&&R(w);let v=e9.current,b=O(h.content);e6.current.set(y,{localId:y,sessionId:w??"__new__",leafId:v,message:h,createdAt:Date.now(),kind:"prompt",confirmKey:b,confirmCountAtCreate:z?0:b?e7.current.get(b)??0:0}),ee(e=>[...e,h]),eG(null),eQ.current=!0,ep(!0),eB({kind:"waiting_model"}),ec({type:"start"}),e4.current=!0;let T=eg.find(e=>e.provider===tm?.provider&&e.id===tm?.modelId)?.input,C=!T||0===T.length||T.includes("image")?r?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType})):void 0;try{if(z&&n){eT&&eF(eT);let t=o??tg(),r=await fetch("/api/agent/new",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:n,type:"prompt",message:c,toolNames:t,planMode:d,deferPrompt:!0,...C?.length?{images:C}:{},...eT?{provider:eT.provider,modelId:eT.modelId}:{},..."auto"!==ex?{thinkingLevel:ex}:{}})}),a=await r.json().catch(()=>({}));if(!r.ok||a.error||!a.sessionId)throw Error(a.error??`HTTP ${r.status}`);let l=a.sessionId;eY.current=l;let i=e6.current.get(y);i&&(i.sessionId=l),e0.current?.(),e0.current=_(l,()=>{eY.current===l&&(ep(!1),eB(null))}),tt.current=l,await tS(l,{requireConnected:!0,timeoutMs:1e4}),await (0,s.$)(l,{type:"prompt",message:c,toolNames:t,planMode:d,...C?.length?{images:C}:{}}),m?.({id:l,path:"",cwd:n,name:void 0,created:new Date().toISOString(),modified:new Date().toISOString(),messageCount:1,firstMessage:e})}else if(t){let e=o??tg();await ty(t.id),e0.current?.(),e0.current=_(t.id,()=>{eY.current===t.id&&(ep(!1),eB(null))}),await tS(t.id,{requireConnected:!0,timeoutMs:1e4}),await (0,s.$)(t.id,{type:"prompt",message:c,toolNames:e,planMode:d,leafId:v,...tm?{provider:tm.provider,modelId:tm.modelId}:{},..."auto"!==ex?{thinkingLevel:ex}:{},...C?.length?{images:C}:{}})}}catch(t){let e=eY.current;if(e6.current.delete(y),ee(e=>e.filter(e=>e!==h)),t instanceof s.H&&(409===t.status||"SESSION_BUSY"===t.code)){eG("This session is already running in another tab. Showing that active run instead."),eQ.current=!0,ep(!0),eB({kind:"waiting_model"}),ec({type:"start"}),e&&(eV.current?.close(),eV.current=null,x(e),tS(e,{replay:!0}),eZ.current?.(e,"prompt_conflict"));return}if(console.error("Failed to send message:",t),z&&eY.current){let e=eY.current;eY.current=null,tt.current=null,fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{})}eG(t instanceof Error?t.message:String(t)),eV.current?.close(),eV.current=null,e&&S(e),eQ.current=!1,ep(!1),eB(null),ec({type:"end"})}},[z,n,eT,tg,ex,t,J?.info?.cwd,ed,tS,m,th,d,eg,tm,ty]),tE=(0,r.useCallback)(async()=>{let e=eY.current;if(e){eQ.current=!1,eG(null),ep(!1),eB(null),ec({type:"end"}),eV.current?.close(),eV.current=null,S(e),R(e);try{await (0,s.$)(e,{type:"abort"}),await tT(e,!1,!1,!0)}catch(t){console.error("Failed to abort:",t),await tT(e,!1,!1,!0)}}},[tT]),tA=(0,r.useCallback)(async e=>{let t=eY.current;if(t){eP(e);try{let{cancelled:n,newSessionId:r}=await (0,s.$)(t,{type:"fork",entryId:e})??{};!n&&r&&g?.(r)}catch(e){console.error("Fork failed:",e)}finally{eP(null)}}},[g]),t$=(0,r.useCallback)(async e=>{let t=eY.current;t&&(e8.current.delete(t),R(t),e9.current=e,X(e),await tI(t,e))},[tI]),tR=(0,r.useCallback)(async e=>{e9.current=e,X(e);let t=eY.current;t&&(e8.current.delete(t),R(t),await tI(t,e))},[tI]),tD=(0,r.useCallback)(async(e,t)=>{if(z)return void tc({provider:e,modelId:t});let n=eY.current;if(n)try{var r;eG(null);let a=await (0,s.$)(n,{type:"set_model",provider:e,modelId:t}),o={provider:a.provider,modelId:a.id};a.thinkingLevel&&(r=a.thinkingLevel,"auto"===r||"off"===r||"minimal"===r||"low"===r||"medium"===r||"high"===r||"xhigh"===r)&&eM(a.thinkingLevel),ej(o),B(e=>e?{...e,context:{...e.context,model:o}}:e)}catch(t){let e=t instanceof Error?t.message:String(t);console.error("Failed to set model:",t),eG(e)}},[z,tc]),tL=(0,r.useCallback)(async()=>{let e=eY.current;if(e&&!eH){eK(!0),ez(null);try{await (0,s.$)(e,{type:"compact"}),await tT(e,!0)}catch(e){ez(e instanceof Error?e.message:String(e))}finally{eK(!1)}}},[eH,tT]),tN=(0,r.useCallback)(async(e,t,n)=>{let r=eY.current;if(!r)return;R(r);let a=th(n),o=e.trim()?a?`${e}
|
|
11
|
+
|
|
12
|
+
Attached document text:
|
|
13
|
+
|
|
14
|
+
${a}`:e:a?`Attached document text:
|
|
15
|
+
|
|
16
|
+
${a}`:"",l=eg.find(e=>e.provider===tm?.provider&&e.id===tm?.modelId)?.input,i=!l||0===l.length||l.includes("image")?t?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType})):void 0,u={role:"user",content:`[steer] ${o}`,timestamp:Date.now()},c=P(),d=j(o,i?.length??0);e6.current.set(c,{localId:c,sessionId:r,leafId:e9.current,message:u,createdAt:Date.now(),kind:"steer",confirmKey:d,confirmCountAtCreate:d?e7.current.get(d)??0:0}),ee(e=>[...e,u]);try{await (0,s.$)(r,{type:"steer",message:o,...i?.length?{images:i}:{}})}catch(e){e6.current.delete(c),console.error("Failed to steer:",e)}},[th,eg,tm]),tP=(0,r.useCallback)(async(e,t,n)=>{let r=eY.current;if(!r)return;R(r);let a=th(n),o=e.trim()?a?`${e}
|
|
17
|
+
|
|
18
|
+
Attached document text:
|
|
19
|
+
|
|
20
|
+
${a}`:e:a?`Attached document text:
|
|
21
|
+
|
|
22
|
+
${a}`:"",l=eg.find(e=>e.provider===tm?.provider&&e.id===tm?.modelId)?.input,i=!l||0===l.length||l.includes("image")?t?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType})):void 0,u={role:"user",content:o,timestamp:Date.now()},c=P(),d=j(o,i?.length??0);e6.current.set(c,{localId:c,sessionId:r,leafId:e9.current,message:u,createdAt:Date.now(),kind:"follow_up",confirmKey:d,confirmCountAtCreate:d?e7.current.get(d)??0:0}),ee(e=>[...e,u]);try{await (0,s.$)(r,{type:"follow_up",message:o,...i?.length?{images:i}:{}})}catch(e){e6.current.delete(c),console.error("Failed to follow up:",e)}},[th,eg,tm]),tU=(0,r.useCallback)(async()=>{let e=eY.current;if(e)try{await (0,s.$)(e,{type:"abort_compaction"})}catch(e){console.error("Failed to abort compaction:",e)}},[]),tj=(0,r.useCallback)(async e=>{if(eM(e),"auto"===e)return;let t=eY.current;if(t)try{await (0,s.$)(t,{type:"set_thinking_level",level:e})}catch(e){console.error("Failed to set thinking level:",e)}},[]),tO=(0,r.useCallback)(async e=>{td(e);let t=(0,D.tE)(e,e_),n=eY.current;if(n)try{await (0,s.$)(n,{type:"set_tools",toolNames:t})}catch(e){console.error("Failed to set tools:",e)}},[e_,td]),tF=(0,r.useCallback)(async e=>{tp(e);let t=(0,D.tE)(ek,e),n=eY.current;if(n)try{await (0,s.$)(n,{type:"set_tools",toolNames:t})}catch(e){console.error("Failed to set memory tools:",e)}},[tp,ek]),tH=(0,r.useCallback)((e="smooth")=>{e5.current?.scrollIntoView({behavior:e})},[]),tK=(0,r.useCallback)(()=>{let e=e2.current,t=e3.current;if(!e||!t)return;let n=t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;e.scrollTo({top:n-16,behavior:"smooth"})},[]);return(0,r.useEffect)(()=>{if(t){var e;let n;if(eY.current=t.id,t.id===tt.current)return tt.current=null,()=>{ti.current&&clearTimeout(ti.current),ti.current=null,eV.current?.close(),eV.current=null,e0.current?.(),e0.current=null};to.current=!1,ta.current=0;let r=(e=t.id,(n=f().get(e))&&"idle"!==n.snapshot.phase?n.snapshot:null);r?.phase==="active"&&(eQ.current=!0,ep(!0),eB({kind:"waiting_model"}),ec({type:"start"})),(async()=>{let e=await tT(t.id,!0,!0,!0);eY.current===t.id&&(await t_(t.id),e?.running?(eQ.current=!0,ep(!0),eB(a(e.state)),ec({type:"start"}),tS(t.id,{replay:!0}),e0.current?.(),e0.current=_(t.id,()=>{eY.current===t.id&&eZ.current?.(t.id,"stream_watchdog")})):e&&r?.phase==="active"?(eQ.current=!1,ep(!1),eB(null),ec({type:"end"}),S(t.id)):e||r?.phase!=="active"||eZ.current?.(t.id,"mount_state_load_failed"),e?.state&&(void 0!==e.state.isCompacting&&eK(e.state.isCompacting),void 0!==e.state.contextUsage&&eR(e.state.contextUsage??null),void 0!==e.state.systemPrompt&&eL(e.state.systemPrompt??null),void 0!==e.state.thinkingLevel&&eM(e.state.thinkingLevel??"auto"),void 0!==e.state.planMode&&W?.(e.state.planMode)))})()}return()=>{tt.current&&eY.current===tt.current||(ti.current&&clearTimeout(ti.current),ti.current=null,tu.current?.controller.abort(N("Session changed","AbortError")),tu.current=null,eV.current?.close(),eV.current=null,e0.current?.(),e0.current=null)}},[tS,tT,t_,M,W,t]),(0,r.useEffect)(()=>{let e=()=>{let e=eY.current;e&&tx(e,"foreground")},t=()=>{"visible"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",e),window.addEventListener("online",e),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",e),window.removeEventListener("online",e)}},[tx]),(0,r.useEffect)(()=>{let e=eY.current;if(e)return ts.current=!1,(0,c.O)(t=>{let n=t.includes(e),r=ts.current;ts.current=n,n&&!eQ.current?(R(e),tx(e,"running_feed_start")):!n&&r&&(R(e),eQ.current?tx(e,"running_feed_stop"):tT(e,!1,!1,!0))})},[tT,tx,t?.id]),(0,r.useEffect)(()=>{let e=window.setInterval(()=>{let e=eY.current;e&&(eQ.current?tx(e,"interval"):Date.now()-tl.current>=3e4?(tl.current=Date.now(),R(e),tT(e,!1,!1,!0)):tT(e))},15e3);return()=>window.clearInterval(e)},[tT,tx]),(0,r.useEffect)(()=>{M&&M(J?.tree??[],Q,tR)},[J?.tree,Q,tR,M]),(0,r.useEffect)(()=>{Z.length>0&&!tr.current&&(e4.current?(e4.current=!1,e1.current=!0,tK()):e1.current?eQ.current||tH("smooth"):(e1.current=!0,tH("instant")))},[Z.length,ed,tH,tK]),(0,r.useEffect)(()=>{fetch("/api/models").then(e=>e.json()).then(e=>{if(ef(e.models),e.thinkingLevels&&ew(e.thinkingLevels),e.thinkingLevelMaps&&eb(e.thinkingLevelMaps),e.modelList&&(eh(e.modelList),z&&e.modelList.length>0)){let t=e.defaultModel,n=t&&e.modelList.find(e=>e.id===t.modelId&&e.provider===t.provider);tc(n?{provider:n.provider,modelId:n.id}:{provider:e.modelList[0].provider,modelId:e.modelList[0].id})}}).catch(()=>{})},[z,b,tc]),(0,r.useEffect)(()=>{if(!eW)return;let e=setTimeout(()=>ez(null),3e3);return()=>clearTimeout(e)},[eW]),{data:J,loading:q,error:V,activeLeafId:Q,messages:Z,entryIds:et,streamState:eu,agentRunning:ed,modelNames:em,modelList:eg,modelThinkingLevels:ey,modelThinkingLevelMaps:ev,newSessionModel:eT,toolPreset:ek,memoryTools:e_,thinkingLevel:ex,retryInfo:eE,contextUsage:e$,systemPrompt:eD,forkingEntryId:eN,isCompacting:eH,compactError:eW,currentModel:tm,displayModel:tf,sessionStats:tw,agentPhase:eJ,agentError:eq,isNew:z,sessionIdRef:eY,sseReaderRef:eV,messagesEndRef:e5,scrollContainerRef:e2,lastUserMsgRef:e3,pendingScrollToUserRef:e4,initialScrollDoneRef:e1,handleSend:tM,handleAbort:tE,handleFork:tA,handleNavigate:t$,handleModelChange:tD,handleCompact:tL,handleSteer:tN,handleFollowUp:tP,handleAbortCompaction:tU,handleToolPresetChange:tO,handleMemoryToolsChange:tF,handleThinkingLevelChange:tj,loadTools:t_,setActiveLeafId:X,setData:B,setMessages:ee,dispatch:ec,setAgentRunning:ep,setForkingEntryId:eP,loadMoreMessages:tk,hasMoreMessages:eo,totalMessages:er,loadedMessagesCount:el,handleAgentEventRef:eX}}},14755:(e,t,n)=>{n.d(t,{ES:()=>p,IB:()=>m,SN:()=>a,tE:()=>f,xG:()=>d});let r="subagent",a=["retain","recall","reflect"],o=[],s=["read","bash","edit","write"],l=["bash","read","edit","write","grep","find","ls"],i=[...l,"kernel_plot_run","kernel_plot_render","kernel_plot_inspect","kernel_plot_stop","kernel_plot_artifacts"],u=[...l,r];function c(e){return[...e].sort().join(",")}function d(e){switch(e){case"none":return o;case"default":return s;case"workbench":return i;case"agent":return u;default:return l}}function p(e){let t=e.filter(e=>e.active).map(e=>e.name),n=t.filter(e=>!a.includes(e)),o=c(t),d=c(n);return""===o?"none":o===c(s)?"default":o===c(l)?"full":o===c(i)?"workbench":o===c(u)?"agent":""===d?"none":d===c(s)?"default":d===c(l)?"full":d===c(i)?"workbench":d===c(u)||t.includes(r)?"agent":"default"}function m(e){return a.filter(t=>e.some(e=>e.active&&e.name===t))}function f(e,t){return[...new Set([...d(e),...t])]}},16865:(e,t,n)=>{n.d(t,{O:()=>w});let r=new Set,a=null,o=null,s=null,l=null,i=null,u=!1,c=!1;function d(e){for(let t of(a=[...new Set(e.filter(e=>"string"==typeof e))],r))try{t(a)}catch{}}async function p(){try{let e=await fetch("/api/agent/running",{cache:"no-store"});if(!e.ok)return;let t=await e.json();Array.isArray(t.runningSessionIds)&&d(t.runningSessionIds)}catch{}}function m(){s||0===r.size||(p(),s=setInterval(()=>{p()},5e3))}function f(){s&&(clearInterval(s),s=null)}function g(){if(!u){if(u=!0,window.__annovibeRunningSessionSubscribe){i=window.__annovibeRunningSessionSubscribe(d);return}if("u"<typeof SharedWorker)return void m();try{(o=new SharedWorker("/running-session-worker.js?v=1",{name:"annovibe-running-sessions-v1",type:"classic"})).port.onmessage=e=>{let t=e.data;"transport"===t.type?m():"running"===t.type&&Array.isArray(t.runningSessionIds)&&(l&&clearTimeout(l),l=null,f(),d(t.runningSessionIds.filter(e=>"string"==typeof e)))},o.onerror=()=>m(),o.port.start(),o.port.postMessage({type:"subscribe"}),l=setTimeout(()=>m(),3e3)}catch{o=null,m()}}}function h(){if(u){if(u=!1,l&&clearTimeout(l),l=null,f(),i?.(),i=null,o){try{o.port.postMessage({type:"disconnect"})}catch{}try{o.port.close()}catch{}}o=null,a=null}}function y(){r.size>0&&g()}function w(e){return r.add(e),a&&e(a),c||(c=!0,window.addEventListener("pagehide",h),window.addEventListener("pageshow",y)),g(),()=>{r.delete(e),0===r.size&&(h(),c&&(c=!1,window.removeEventListener("pagehide",h),window.removeEventListener("pageshow",y)))}}},32383:(e,t,n)=>{n.d(t,{$:()=>a,H:()=>r});class r extends Error{constructor(e,t,n){super(e),this.status=t,this.code=n,this.name="AgentCommandError"}}async function a(e,t){let n=await fetch(`/api/agent/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await n.json().catch(()=>({}));if(!n.ok||a.error)throw new r(a.error??`HTTP ${n.status}`,n.status,a.code);return a.data}}}]);
|