@seqyuan/annovibe 0.8.140 → 0.8.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +12 -12
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +1 -1
  15. package/.next/server/app/_not-found.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/.next/server/app/api/agent/runtime/route.js +1 -1
  20. package/.next/server/app/api/internal/runtime/route.js +1 -1
  21. package/.next/server/app/api/version/route.js +1 -1
  22. package/.next/server/app/index.html +1 -1
  23. package/.next/server/app/index.rsc +4 -4
  24. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  25. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  26. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  27. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  28. package/.next/server/app/login.html +1 -1
  29. package/.next/server/app/login.rsc +1 -1
  30. package/.next/server/app/login.segments/_full.segment.rsc +1 -1
  31. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  32. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  33. package/.next/server/app/page.js +3 -3
  34. package/.next/server/app/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/smoke/page_client-reference-manifest.js +1 -1
  36. package/.next/server/app/smoke/session-stream/page.js +1 -1
  37. package/.next/server/app/smoke/session-stream/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/smoke/session-stream.html +1 -1
  39. package/.next/server/app/smoke/session-stream.rsc +4 -4
  40. package/.next/server/app/smoke/session-stream.segments/_full.segment.rsc +4 -4
  41. package/.next/server/app/smoke/session-stream.segments/_tree.segment.rsc +1 -1
  42. package/.next/server/app/smoke/session-stream.segments/smoke/session-stream/__PAGE__.segment.rsc +4 -4
  43. package/.next/server/app/smoke.html +1 -1
  44. package/.next/server/app/smoke.rsc +1 -1
  45. package/.next/server/app/smoke.segments/_full.segment.rsc +1 -1
  46. package/.next/server/app/smoke.segments/_tree.segment.rsc +1 -1
  47. package/.next/server/app/smoke.segments/smoke/__PAGE__.segment.rsc +1 -1
  48. package/.next/server/app-paths-manifest.json +12 -12
  49. package/.next/server/chunks/658.js +22 -0
  50. package/.next/server/middleware-build-manifest.js +1 -1
  51. package/.next/server/pages/404.html +1 -1
  52. package/.next/server/pages/500.html +1 -1
  53. package/.next/server/preview-props.json +3 -3
  54. package/.next/server/server-reference-manifest.json +1 -1
  55. package/.next/static/chunks/3824-2ecb57e47009f9c4.js +22 -0
  56. package/.next/static/chunks/app/{page-b9bbcb2073e77894.js → page-b56ed167d2c7978b.js} +3 -3
  57. package/.next/static/chunks/app/smoke/session-stream/{page-9c9a9a2aafa69000.js → page-ce422d02fbbe900d.js} +2 -2
  58. package/package.json +1 -1
  59. package/.next/server/chunks/7734.js +0 -22
  60. package/.next/static/chunks/2257-a948751c1a3d4608.js +0 -22
  61. /package/.next/static/{YRLT_dWnNGA0kvsTREpEW → rPVMly3awjAYAgBD6W0mU}/_buildManifest.js +0 -0
  62. /package/.next/static/{YRLT_dWnNGA0kvsTREpEW → rPVMly3awjAYAgBD6W0mU}/_ssgManifest.js +0 -0
@@ -31,7 +31,7 @@ f:"static/chunks/363642f4-a09fcaca7af039e5.js"
31
31
  9:X
32
32
  a:[["children",{"s":"__PAGE__","h":512,"d":{"r":["$","$1","c",{"children":[["$","$Lb",null,{"Component":"$15","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@16","$@17"]}}],null,["$","$L18",null,{"children":["$","$19",null,{"name":"Next.MetadataOutlet","children":"$@1a"}]}]]}],"p":false,"v":null}}]]
33
33
  8:[["children",{"s":"smoke","h":512,"d":{"r":["$","$1","c",{"children":[null,["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],"p":false,"v":"$9"},"c":"$Qa"}]]
34
- 0:{"P":null,"c":["","smoke"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/9bcd6051db4f8890.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/d68ecb6695873888.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","className":"__variable_9e44ca","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","$L3",null,{"id":"theme-init","strategy":"beforeInteractive","children":"(function(){try{var t=localStorage.getItem(\"pi-theme\");if(t===\"dark\")document.documentElement.classList.add(\"dark\")}catch(e){}})();"}]}],["$","body",null,{"style":{"height":"100dvh","display":"flex","flexDirection":"column"},"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$6","errorStyles":[],"errorScripts":null,"template":["$","$L7",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"}]}]]}]]}],"p":false,"v":null},"c":"$Q8"},"h":{"r":["$","$1","h",{"children":[null,["$","$L1c",null,{"children":"$L1d"}],["$","$L1f",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$19",null,{"name":"Next.Metadata","children":"$L20"}]}],null]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"p":false,"v":null}},"m":"$undefined","G":["$22",[]],"S":true,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"YRLT_dWnNGA0kvsTREpEW"}
34
+ 0:{"P":null,"c":["","smoke"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/9bcd6051db4f8890.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/d68ecb6695873888.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","className":"__variable_9e44ca","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","$L3",null,{"id":"theme-init","strategy":"beforeInteractive","children":"(function(){try{var t=localStorage.getItem(\"pi-theme\");if(t===\"dark\")document.documentElement.classList.add(\"dark\")}catch(e){}})();"}]}],["$","body",null,{"style":{"height":"100dvh","display":"flex","flexDirection":"column"},"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$6","errorStyles":[],"errorScripts":null,"template":["$","$L7",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"}]}]]}]]}],"p":false,"v":null},"c":"$Q8"},"h":{"r":["$","$1","h",{"children":[null,["$","$L1c",null,{"children":"$L1d"}],["$","$L1f",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$19",null,{"name":"Next.Metadata","children":"$L20"}]}],null]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"p":false,"v":null}},"m":"$undefined","G":["$22",[]],"S":true,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"rPVMly3awjAYAgBD6W0mU"}
35
35
  9:C
36
36
  16:{}
37
37
  17:"$a:0:1:d:r:props:children:0:props:serverProvidedParams:params"
@@ -4,4 +4,4 @@
4
4
  :HL["/_next/static/css/d68ecb6695873888.css","style"]
5
5
  2:[["children",{"s":"__PAGE__","h":160}]]
6
6
  1:[["children",{"s":"smoke","h":96,"c":"$Q2"}]]
7
- 0:{"b":"YRLT_dWnNGA0kvsTREpEW","t":{"t":{"s":"","h":80,"c":"$Q1"}}}
7
+ 0:{"b":"rPVMly3awjAYAgBD6W0mU","t":{"t":{"s":"","h":80,"c":"$Q1"}}}
@@ -30,7 +30,7 @@ c:X
30
30
  c:C
31
31
  d:[["children",{"s":"__PAGE__","h":160,"d":{"r":["$","$1","c",{"children":[["$","$Le",null,{"Component":"$18","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@19","$@1a"]}}],null,["$","$L1b",null,{"children":["$","$1c",null,{"name":"Next.MetadataOutlet","children":"$@1d"}]}]]}],"p":"$@1e","v":null,"s":"$9"}}]]
32
32
  a:[["children",{"s":"smoke","h":96,"d":{"r":["$","$1","c",{"children":[null,["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L7",null,{}]}]]}],"p":"$@b","v":"$c","s":"$9"},"c":"$Qd"}]]
33
- 0:{"t":{"t":{"s":"","h":80,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/9bcd6051db4f8890.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/d68ecb6695873888.css","precedence":"next"}]],["$","html",null,{"lang":"en","className":"__variable_9e44ca","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","$L3",null,{"id":"theme-init","strategy":"beforeInteractive","children":"(function(){try{var t=localStorage.getItem(\"pi-theme\");if(t===\"dark\")document.documentElement.classList.add(\"dark\")}catch(e){}})();"}]}],["$","body",null,{"style":{"height":"100dvh","display":"flex","flexDirection":"column"},"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$6","errorStyles":[],"errorScripts":null,"template":["$","$L7",null,{}],"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."}]}]]}]}]],[]]}]}]]}]]}],"p":"$@8","v":null,"s":"$9"},"c":"$Qa"},"h":{"r":["$","$1","h",{"children":[null,["$","$L20",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","$L22",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$1c",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"AnnoVibe"}],["$","meta","1",{"name":"description","content":"AI-native bioinformatics workspace by Annoroad"}],["$","link","2",{"rel":"shortcut icon","href":"/icon.svg","type":"image/svg+xml"}],["$","link","3",{"rel":"icon","href":"/icon.svg","type":"image/svg+xml"}],["$","$L23","4",{}]]}]}],null]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"p":"$@24","v":null,"s":"$9"}},"a":"$@25","u":"$@26","b":"YRLT_dWnNGA0kvsTREpEW"}
33
+ 0:{"t":{"t":{"s":"","h":80,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/9bcd6051db4f8890.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/d68ecb6695873888.css","precedence":"next"}]],["$","html",null,{"lang":"en","className":"__variable_9e44ca","suppressHydrationWarning":true,"children":[["$","head",null,{"children":["$","$L3",null,{"id":"theme-init","strategy":"beforeInteractive","children":"(function(){try{var t=localStorage.getItem(\"pi-theme\");if(t===\"dark\")document.documentElement.classList.add(\"dark\")}catch(e){}})();"}]}],["$","body",null,{"style":{"height":"100dvh","display":"flex","flexDirection":"column"},"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$6","errorStyles":[],"errorScripts":null,"template":["$","$L7",null,{}],"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."}]}]]}]}]],[]]}]}]]}]]}],"p":"$@8","v":null,"s":"$9"},"c":"$Qa"},"h":{"r":["$","$1","h",{"children":[null,["$","$L20",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","$L22",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$1c",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"AnnoVibe"}],["$","meta","1",{"name":"description","content":"AI-native bioinformatics workspace by Annoroad"}],["$","link","2",{"rel":"shortcut icon","href":"/icon.svg","type":"image/svg+xml"}],["$","link","3",{"rel":"icon","href":"/icon.svg","type":"image/svg+xml"}],["$","$L23","4",{}]]}]}],null]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"p":"$@24","v":null,"s":"$9"}},"a":"$@25","u":"$@26","b":"rPVMly3awjAYAgBD6W0mU"}
34
34
  19:{}
35
35
  1a:"$d:0:1:d:r:props:children:0:props:serverProvidedParams:params"
36
36
  1d:null
@@ -28,7 +28,6 @@
28
28
  "/api/apps/[id]/[[...path]]/route": "app/api/apps/[id]/[[...path]]/route.js",
29
29
  "/api/apps/route": "app/api/apps/route.js",
30
30
  "/api/auth/all-providers/route": "app/api/auth/all-providers/route.js",
31
- "/api/auth/api-key/[provider]/route": "app/api/auth/api-key/[provider]/route.js",
32
31
  "/api/auth/login/[provider]/route": "app/api/auth/login/[provider]/route.js",
33
32
  "/api/auth/logout/[provider]/route": "app/api/auth/logout/[provider]/route.js",
34
33
  "/api/auth/providers/route": "app/api/auth/providers/route.js",
@@ -36,46 +35,47 @@
36
35
  "/api/debug-models/route": "app/api/debug-models/route.js",
37
36
  "/api/file-tree/delete/route": "app/api/file-tree/delete/route.js",
38
37
  "/api/file-tree/mkdir/route": "app/api/file-tree/mkdir/route.js",
39
- "/api/file-tree/rename/route": "app/api/file-tree/rename/route.js",
40
38
  "/api/file-tree/reveal/route": "app/api/file-tree/reveal/route.js",
41
39
  "/api/file-tree/write/route": "app/api/file-tree/write/route.js",
42
40
  "/api/file-watch/route": "app/api/file-watch/route.js",
43
- "/api/files/[...path]/route": "app/api/files/[...path]/route.js",
44
41
  "/api/im/cancel/route": "app/api/im/cancel/route.js",
45
42
  "/api/im/gateway-status/route": "app/api/im/gateway-status/route.js",
43
+ "/api/im/project/route": "app/api/im/project/route.js",
46
44
  "/api/im/projects/route": "app/api/im/projects/route.js",
47
45
  "/api/im/session-ids/route": "app/api/im/session-ids/route.js",
48
- "/api/im/project/route": "app/api/im/project/route.js",
49
46
  "/api/im/turn/route": "app/api/im/turn/route.js",
50
47
  "/api/internal/runtime/route": "app/api/internal/runtime/route.js",
51
48
  "/api/memory/dismiss/route": "app/api/memory/dismiss/route.js",
52
49
  "/api/memory/promote/route": "app/api/memory/promote/route.js",
53
50
  "/api/models-config/discover/route": "app/api/models-config/discover/route.js",
54
51
  "/api/models-config/route": "app/api/models-config/route.js",
55
- "/api/models-config/test/route": "app/api/models-config/test/route.js",
56
- "/api/models/route": "app/api/models/route.js",
52
+ "/api/file-tree/rename/route": "app/api/file-tree/rename/route.js",
53
+ "/api/files/[...path]/route": "app/api/files/[...path]/route.js",
57
54
  "/api/plot-kernels/route": "app/api/plot-kernels/route.js",
58
55
  "/api/plot-kernels/save/route": "app/api/plot-kernels/save/route.js",
59
56
  "/api/plot-kernels/status/route": "app/api/plot-kernels/status/route.js",
60
57
  "/api/plot-kernels/stop/route": "app/api/plot-kernels/stop/route.js",
61
- "/api/plugins/route": "app/api/plugins/route.js",
58
+ "/api/models/route": "app/api/models/route.js",
62
59
  "/api/project-trust/route": "app/api/project-trust/route.js",
63
60
  "/api/session-index/events/route": "app/api/session-index/events/route.js",
64
- "/api/sessions/[id]/export/route": "app/api/sessions/[id]/export/route.js",
61
+ "/api/auth/api-key/[provider]/route": "app/api/auth/api-key/[provider]/route.js",
65
62
  "/api/sessions/[id]/media/route": "app/api/sessions/[id]/media/route.js",
66
63
  "/api/sessions/[id]/route": "app/api/sessions/[id]/route.js",
64
+ "/api/sessions/[id]/shadowed/route": "app/api/sessions/[id]/shadowed/route.js",
67
65
  "/api/settings/route": "app/api/settings/route.js",
68
66
  "/api/skills/check/route": "app/api/skills/check/route.js",
69
- "/api/skills/install/route": "app/api/skills/install/route.js",
67
+ "/api/models-config/test/route": "app/api/models-config/test/route.js",
70
68
  "/api/skills/route": "app/api/skills/route.js",
71
- "/api/skills/update/route": "app/api/skills/update/route.js",
72
69
  "/api/skills/search/route": "app/api/skills/search/route.js",
70
+ "/api/skills/update/route": "app/api/skills/update/route.js",
71
+ "/api/smoke/prompt-admission/route": "app/api/smoke/prompt-admission/route.js",
73
72
  "/api/subagents/status/route": "app/api/subagents/status/route.js",
74
73
  "/api/version/route": "app/api/version/route.js",
75
- "/api/smoke/prompt-admission/route": "app/api/smoke/prompt-admission/route.js",
76
- "/api/sessions/[id]/shadowed/route": "app/api/sessions/[id]/shadowed/route.js",
74
+ "/api/sessions/[id]/export/route": "app/api/sessions/[id]/export/route.js",
77
75
  "/login/page": "app/login/page.js",
78
76
  "/page": "app/page.js",
79
77
  "/smoke/session-stream/page": "app/smoke/session-stream/page.js",
78
+ "/api/plugins/route": "app/api/plugins/route.js",
79
+ "/api/skills/install/route": "app/api/skills/install/route.js",
80
80
  "/smoke/page": "app/smoke/page.js"
81
81
  }
@@ -0,0 +1,22 @@
1
+ "use strict";exports.id=658,exports.ids=[658],exports.modules={10658:(a,b,c)=>{c.d(b,{T:()=>X});var d=c(67484);function e(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}let f={isStreaming:!1,streamingMessage:null};function g(){return{role:"assistant",content:[],model:"",provider:"",timestamp:Date.now()}}function h(a,b,c){if(!Number.isInteger(b)||void 0===b||b<0)return a;let d=a.streamingMessage??g(),e=[...d.content],f=c(e[b]);return f?(e[b]=f,{isStreaming:!0,streamingMessage:{...d,content:e}}):a}function i(a){if(a.id||a.toolName)return{...a.id?{id:a.id}:{},...a.toolName?{toolName:a.toolName}:{}};let b=a.partial,c=a.contentIndex;if(!b||!Array.isArray(b.content)||void 0===c)return{};let d=b.content[c];return d&&"toolCall"===d.type?{..."string"==typeof d.id?{id:d.id}:"string"==typeof d.toolCallId?{id:d.toolCallId}:{},..."string"==typeof d.name?{toolName:d.name}:"string"==typeof d.toolName?{toolName:d.toolName}:{}}:{}}function j(a,b){switch(b.type){case"start":return{isStreaming:!0,streamingMessage:null};case"snapshot":return"assistant"===b.message.role?{isStreaming:!0,streamingMessage:b.message}:a;case"delta":var c=b.event;switch(c.type){case"start":return{isStreaming:!0,streamingMessage:a.streamingMessage??g()};case"text_start":return h(a,c.contentIndex,a=>a?.type==="text"?a:{type:"text",text:""});case"text_delta":return h(a,c.contentIndex,a=>({type:"text",text:(a?.type==="text"?a.text:"")+(c.delta??"")}));case"text_end":return h(a,c.contentIndex,a=>({type:"text",text:c.content??(a?.type==="text"?a.text:"")}));case"thinking_start":return h(a,c.contentIndex,a=>a?.type==="thinking"?a:{type:"thinking",thinking:""});case"thinking_delta":return h(a,c.contentIndex,a=>({type:"thinking",thinking:(a?.type==="thinking"?a.thinking:"")+(c.delta??"")}));case"thinking_end":return h(a,c.contentIndex,a=>({type:"thinking",thinking:c.content??(a?.type==="thinking"?a.thinking:"")}));case"toolcall_start":return h(a,c.contentIndex,a=>{let b=i(c);return a?.type==="toolCall"?{...a,...b.id?{toolCallId:b.id}:{},...b.toolName?{toolName:b.toolName}:{},rawInput:a.rawInput??""}:{type:"toolCall",toolCallId:b.id??"",toolName:b.toolName??"tool",input:{},rawInput:""}});case"toolcall_delta":return h(a,c.contentIndex,a=>{let b=i(c),d=a?.type==="toolCall"?a:{type:"toolCall",toolCallId:b.id??"",toolName:b.toolName??"tool",input:{}};return{...d,...b.id?{toolCallId:b.id}:{},...b.toolName?{toolName:b.toolName}:{},rawInput:(d.rawInput??"")+(c.delta??"")}});case"toolcall_end":return h(a,c.contentIndex,()=>({type:"toolCall",toolCallId:c.toolCall?.id??"",toolName:c.toolCall?.name??"tool",input:c.toolCall?.arguments??{}}));default:return a}case"end":case"reset":return f;default:return a}}function k(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function l(a){if("assistant"!==a.role)return null;let b=a.timestamp;return"number"!=typeof b?null:`assistant:${b}`}class m extends Error{constructor(a,b,c){super(a),this.status=b,this.code=c,this.name="AgentCommandError"}}async function n(a,b){let c=await fetch(`/api/agent/${encodeURIComponent(a)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),d=await c.json().catch(()=>({}));if(!c.ok||d.error)throw new m(d.error??`HTTP ${c.status}`,c.status,d.code);return d.data}var o=c(31343);async function p(a,b){if(!b.length)return[];let c=await fetch("/api/images/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:a,images:b.map(a=>({data:a.data,mimeType:a.mimeType,name:a.name}))})}),d=await c.json().catch(()=>({}));if(!c.ok||d.error)throw Error(d.error??`Upload failed (HTTP ${c.status})`);return(d.uploaded??[]).map((a,c)=>({...a,previewUrl:b[c]?.previewUrl}))}async function q(a,b,c){let d,e=new TextDecoder,f="",g=a=>{if(a.startsWith("id: ")){d=a.slice(4);return}if(!a.startsWith("data: "))return;let c=a.slice(6);if("[DONE]"!==c)try{b(c,d)}catch{}finally{d=void 0}},h=new Promise(a=>{c?.aborted?a():c?.addEventListener("abort",()=>a(),{once:!0})});for(;;){let b=await Promise.race([a.read(),h.then(()=>({done:!0,value:void 0}))]);if(b.done)break;let c=(f+=e.decode(b.value,{stream:!0})).split("\n");for(let a of(f=c.pop()||"",c))g(a)}if(f.trim())for(let a of f.split("\n"))g(a)}c(81537);let r="__annovibeStreamSessions__",s="__annovibeStreamListeners__",t="__annovibeStreamErrorCallbacks__";function u(){let a=globalThis;return a[r]||(a[r]=new Map),a[r]}function v(){let a=globalThis;return a[t]||(a[t]=new Map),a[t]}function w(a){return{sessionId:a,phase:"idle",startedAt:null,lastEventAt:null,lastHeartbeatAt:null,reconnectCount:0,lastSyncReason:null,accumulatedText:"",toolCalls:[],toolResults:[],statusText:null,streamingMessage:null,isStreaming:!1,error:null}}function x(a,b){let c;for(let d of(!(c=globalThis)[s]&&(c[s]=new Map),c[s]).get(a)??[])try{d(b)}catch{}}function y(a){a.textThrottleTimer&&(clearTimeout(a.textThrottleTimer),a.textThrottleTimer=null),a.textDirty&&(a.textDirty=!1,A(a))}function z(a,b=!1){let c=Date.now();if(a.snapshot.lastEventAt=c,!b){a.textDirty=!0,a.textThrottleTimer||(a.textThrottleTimer=setTimeout(()=>{a.textThrottleTimer=null,a.textDirty&&(a.textDirty=!1,A(a))},100));return}y(a),A(a)}function A(a,b){let c=Date.now(),d=function(a){let b=[];for(let c of a.toolCalls.values())b.push({type:"toolCall",toolCallId:c.toolCallId,toolName:c.toolName,input:c.input??{}});let c=a.accumulatedText.trim();return c&&b.push({type:"text",text:c}),b}(a),e=(b??a.snapshot.phase)==="active";a.snapshot={...a.snapshot,phase:b??a.snapshot.phase,lastEventAt:c,accumulatedText:a.accumulatedText,toolCalls:[...a.toolCalls.values()],toolResults:[...a.toolResults.values()],statusText:e?function(a){if(a.activeToolId){let b=a.toolCalls.get(a.activeToolId);if(b){let a=Math.max(0,Math.floor((Date.now()-b.startedAt)/1e3));return`Running ${b.toolName||"tool"}… (${a}s)`}}return a.accumulatedText.trim()?"Generating response…":a.toolCalls.size>0?"Finishing tool results…":null}(a):a.snapshot.statusText,streamingMessage:e&&d.length>0?{role:"assistant",content:d}:null,isStreaming:e},x(a.snapshot.sessionId,{type:"snapshot-updated",snapshot:a.snapshot})}function B(a){C(a),a.idleCheckTimer=setInterval(()=>{if("connected"!==a.connectionState)return;let b=Math.max(a.snapshot.lastEventAt??0,a.snapshot.lastHeartbeatAt??0);if(Date.now()-b>=18e4){D(a),y(a);let b="Stream idle timeout — no activity for 180s.";a.snapshot={...a.snapshot,phase:"error",isStreaming:!1,streamingMessage:null,statusText:null,error:b},C(a),x(a.snapshot.sessionId,{type:"error",snapshot:a.snapshot});let c=v().get(a.snapshot.sessionId);if(c)try{c(a.snapshot.sessionId,b)}catch{}}},1e4)}function C(a){a.idleCheckTimer&&(clearInterval(a.idleCheckTimer),a.idleCheckTimer=null)}function D(a){a.toolProgressTimer&&(clearInterval(a.toolProgressTimer),a.toolProgressTimer=null)}function E(a){let b=u(),c=b.get(a);return c||(c={snapshot:w(a),accumulatedText:"",toolCalls:new Map,toolResults:new Map,toolProgressTimer:null,activeToolId:null,textThrottleTimer:null,textDirty:!1,connectionState:"idle",idleCheckTimer:null},b.set(a,c)),c}function F(a,b){let c=v();return c.set(a,b),()=>{c.get(a)===b&&c.delete(a)}}function G(a){let b=u(),c=b.get(a);c&&(D(c),C(c),y(c)),b.delete(a)}function H(a){let b=u().get(a);b&&(b.snapshot={...b.snapshot,reconnectCount:b.snapshot.reconnectCount+1,lastSyncReason:"sse-reconnect",lastEventAt:Date.now()},z(b,!0))}let I="__annovibeSessionMessageCache__";function J(){let a=globalThis;if(!a[I]){var b;let c={entries:new Map,cleanupTimer:null};a[I]=c,(b=c).cleanupTimer||(b.cleanupTimer=setInterval(()=>{let a=Date.now();for(let[c,d]of b.entries)a-d.loadedAt>72e5&&b.entries.delete(c)},6e4))}return a[I]}function K(a){let b=J(),c=b.entries.get(a);return c?Date.now()-c.loadedAt>72e5?(b.entries.delete(a),null):(c.loadedAt=Date.now(),{...c,messages:[...c.messages],entryIds:[...c.entryIds]}):null}function L(a,b,c,d,e){let f=J(),g=f.entries.get(a);if(!g)return;let h=new Set(g.entryIds),i=[],j=[];for(let a=0;a<b.length;a++){let d=c[a];d&&!h.has(d)&&(i.push(b[a]),j.push(d))}0!==i.length&&f.entries.set(a,{...g,messages:[...i,...g.messages],entryIds:[...j,...g.entryIds],hasMore:d,loadedMessagesCount:e,loadedAt:Date.now()})}function M(a){J().entries.delete(a)}var N=c(29947);function O(a){return{steering:a?.steering??[],followUp:a?.followUp??[]}}let P=[500,1500,3e3];function Q(a,b){return new DOMException(a,b)}function R(){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)}`}function S(a,b){return a.trim()||0!==b?`text:${a}|images:${b}`:null}function T(a){return"string"==typeof a?S(a,0):Array.isArray(a)?S(a.filter(a=>!!a&&"object"==typeof a&&"text"===a.type&&"string"==typeof a.text).map(a=>a.text).join("\n"),a.filter(a=>!!a&&"object"==typeof a&&"image"===a.type).length):null}function U(a){let b=new Map;for(let c of a){let a="user"!==c.role?null:T(c.content);a&&b.set(a,(b.get(a)??0)+1)}return b}function V(a,b,c){return a.sessionId===b&&(!a.leafId||c.includes(a.leafId))}function W(a,b){let c=a.timestamp,d=b.timestamp;if("number"!=typeof c||"number"!=typeof d||c!==d||a.role!==b.role)return!1;try{return JSON.stringify(a)===JSON.stringify(b)}catch{return!1}}function X(a){let{session:b,newSessionCwd:c,onAgentEnd:g,onSessionCreated:h,onSessionForked:i,modelsRefreshKey:r,onBranchDataChange:s,chatInputRef:t}=a,v=null===b&&null!==c,[A,I]=(0,d.useState)(null),[X,Y]=(0,d.useState)(!v),[Z,$]=(0,d.useState)(null),[_,aa]=(0,d.useState)(null),[ab,ac]=(0,d.useState)([]),[ad,ae]=(0,d.useState)([]),[af,ag]=(0,d.useState)(0),[ah,ai]=(0,d.useState)(!1),[aj,ak]=(0,d.useState)(0),[al,am]=(0,d.useReducer)(j,f),[an,ao]=(0,d.useState)(!1),[ap,aq]=(0,d.useState)({}),[ar,as]=(0,d.useState)([]),[at,au]=(0,d.useState)({}),[av,aw]=(0,d.useState)({}),[ax,ay]=(0,d.useState)(null),[az,aA]=(0,d.useState)("full"),[aB,aC]=(0,d.useState)([...N.SN]),[aD,aE]=(0,d.useState)([]),[aF,aG]=(0,d.useState)("auto"),[aH,aI]=(0,d.useState)(null),[aJ,aK]=(0,d.useState)(null),[aL,aM]=(0,d.useState)(null),[aN,aO]=(0,d.useState)(null),[aP,aQ]=(0,d.useState)(null),[aR,aS]=(0,d.useState)(null),[aT,aU]=(0,d.useState)(!1),[aV,aW]=(0,d.useState)(null),[aX,aY]=(0,d.useState)(null),[aZ,a$]=(0,d.useState)(null),[a_,a0]=(0,d.useState)({steering:[],followUp:[]}),[a1,a2]=(0,d.useState)(null),a3=(0,d.useRef)(null),a4=(0,d.useRef)(b?.id??null),{statuses:a5,widgets:a6,dialog:a7,notices:a8,applyFromState:a9,handleEvent:ba,respond:bb,dismissNotice:bc}=function({chatInputRef:a,sessionIdRef:b,onError:c,noticeTtlMs:e=8e3}){let[f,g]=(0,d.useState)([]),[h,i]=(0,d.useState)([]),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)([]),o=(0,d.useRef)(new Set),p=(0,d.useCallback)(()=>{for(let a of o.current)clearTimeout(a);o.current.clear()},[]),q=(0,d.useCallback)((a,b)=>{let c={id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,message:a,type:b};m(a=>[...a,c].slice(-4));let d=setTimeout(()=>{o.current.delete(d),m(a=>a.filter(a=>a.id!==c.id))},e);o.current.add(d)},[e]),r=(0,d.useCallback)(a=>{a&&(Array.isArray(a.extensionStatuses)&&g(a.extensionStatuses),Array.isArray(a.extensionWidgets)&&i(a.extensionWidgets))},[]),s=(0,d.useCallback)(b=>{if("extension_error"===b.type)return q("string"==typeof b.error?b.error:"Extension command failed","error"),!0;if("extension_ui_request"!==b.type)return!1;let c="string"==typeof b.method?b.method:"";if("select"===c||"confirm"===c||"input"===c||"editor"===c)return k({id:String(b.id??""),method:c,title:"string"==typeof b.title?b.title:"",...Array.isArray(b.options)?{options:b.options}:{},..."string"==typeof b.message?{message:b.message}:{},..."string"==typeof b.placeholder?{placeholder:b.placeholder}:{},..."string"==typeof b.prefill?{prefill:b.prefill}:{}}),!0;if("notify"===c){let a="warning"===b.notifyType||"error"===b.notifyType?b.notifyType:"info";return q(String(b.message??""),a),!0}if("setStatus"===c){let a=String(b.statusKey??"");if(!a)return!0;let c="string"==typeof b.statusText?b.statusText:null;return g(b=>{let d=b.filter(b=>b.key!==a);return c?[...d,{key:a,text:c}]:d}),!0}if("setWidget"===c){let a=String(b.widgetKey??"");if(!a)return!0;let c=Array.isArray(b.widgetLines)?b.widgetLines.filter(a=>"string"==typeof a):null;return i(d=>{let e=d.filter(b=>b.key!==a);return c&&c.length>0?[...e,{key:a,lines:c,placement:"string"==typeof b.widgetPlacement?b.widgetPlacement:"aboveEditor"}]:e}),!0}return"dismiss"===c?k(a=>a?.id===b.id?null:a):"set_editor_text"===c&&"string"==typeof b.text?a?.current?.setText?.(b.text):"setTitle"===c&&"string"==typeof b.title&&(document.title=b.title),!0},[a,q]),t=(0,d.useCallback)(async(a,d)=>{let e=b.current;if(k(b=>b?.id===a?null:b),e)try{await n(e,{type:"extension_ui_response",id:a,...d})}catch(a){c(a instanceof Error?a.message:String(a))}},[c,b]);return{statuses:f,widgets:h,dialog:j,notices:l,applyFromState:r,handleEvent:s,respond:t,dismissNotice:(0,d.useCallback)(a=>{m(b=>b.filter(b=>b.id!==a))},[]),reset:(0,d.useCallback)(()=>{p(),g([]),i([]),k(null),m([])},[p])}}({chatInputRef:t,sessionIdRef:a4,onError:a2}),bd=(0,d.useRef)(!1),{live:be,running:bf,isRunning:bg,begin:bh,finish:bi,handleEvent:bj}=function({onRunningChange:a,onDone:b,flushMs:c=60}={}){let[e,f]=(0,d.useState)(null),[g,h]=(0,d.useState)(!1),i=(0,d.useRef)(!1),j=(0,d.useRef)(""),k=(0,d.useRef)(null),l=(0,d.useCallback)(()=>{k.current&&(clearTimeout(k.current),k.current=null)},[]),m=(0,d.useCallback)(b=>{l(),j.current="",i.current=!0,h(!0),f({command:b,output:""}),a?.(!0,b)},[l,a]),n=(0,d.useCallback)(()=>{l(),j.current="",i.current=!1,h(!1),f(null),a?.(!1)},[l,a]);return{live:e,running:g,isRunning:(0,d.useCallback)(()=>i.current,[]),begin:m,finish:n,handleEvent:(0,d.useCallback)(d=>{if("bash_execution_start"===d.type){let b=String(d.command??"");return l(),j.current="",i.current=!0,h(!0),f({command:b,output:""}),a?.(!0,b),!0}if("bash_execution_update"===d.type){let a="string"==typeof d.chunk?d.chunk:"";return!a||(j.current+=a,k.current||(k.current=setTimeout(()=>{k.current=null;let a=j.current;j.current="",a&&f(b=>b?{...b,output:b.output+a}:b)},c)),!0)}return"bash_done"===d.type&&(l(),j.current="",i.current=!1,h(!1),f(null),a?.(!1),b?.(),!0)},[l,c,b,a])}}({onRunningChange:(a,b)=>{bd.current=a,ao(a),a$(a?{kind:"running_tools",tools:[{id:"bash",name:"bash",args:b}]}:null)}}),bk=(0,d.useRef)(null),bl=(0,d.useRef)(null),bm=(0,d.useRef)(null),bn=(0,d.useRef)(!1),bo=(0,d.useRef)(null),bp=(0,d.useRef)(!1),bq=(0,d.useRef)(null),br=(0,d.useRef)(null),bs=(0,d.useRef)(new Map),bt=(0,d.useRef)(new Map),bu=(0,d.useRef)(new Map),bv=(0,d.useRef)(new Map),bw=(0,d.useRef)(null),bx=(0,d.useRef)([]),by=(0,d.useRef)(null),bz=(0,d.useRef)(0),bA=(0,d.useRef)(!1),bB=(0,d.useRef)(0),bC=(0,d.useRef)(!1);(0,d.useRef)(!1),(0,d.useRef)(0);let bD=(0,d.useRef)(null),bE=(0,d.useRef)(null),bF=(0,d.useRef)(0);(0,d.useRef)(!1);let bG=a.setNewSessionModel??ay,bH=a.setToolPreset??aA,bI=a.setMemoryTools??aC,bJ=aP??A?.context.model??aR??null,bK=v?ax:bJ,bL=(0,d.useCallback)(()=>(0,N.tE)(az,aB),[aB,az]),bM=(0,d.useCallback)(a=>a?.length?a.map((a,b)=>{let c=`Attachment ${b+1}: ${a.fileName} (${a.mimeType||"application/octet-stream"}, ${a.size} bytes)`;if(a.extractedText){let b=a.truncated?"\n[The extracted text was truncated before sending.]":"";return`${c}
2
+ ${b}
3
+ ${a.extractedText}`.trim()}return`${c}
4
+ [Text extraction unavailable: ${a.extractionError??"unsupported file type"}]`}).join("\n\n---\n\n"):"",[]),bN=(0,d.useCallback)(async a=>{let b=await fetch(`/api/agent/${encodeURIComponent(a)}/prepare`,{method:"POST"});if(!b.ok)throw Error((await b.json().catch(()=>({}))).error??`Failed to prepare session (HTTP ${b.status})`)},[]),bO=(()=>{let a={input:0,output:0,cacheRead:0,cacheWrite:0};for(let b of ab){if("assistant"!==b.role)continue;let c=b.usage;c&&(a.input+=c.input??0,a.output+=c.output??0,a.cacheRead+=c.cacheRead??0,a.cacheWrite+=c.cacheWrite??0)}return a.input+a.output+a.cacheRead+a.cacheWrite>0?{tokens:a}:null})(),bP=(0,d.useRef)(!1),bQ=(0,d.useCallback)(async()=>{let a=a4.current;if(!a||bP.current||bC.current)return;bP.current=!0,bA.current=!0;let b=0,c=K(a);b=c?c.loadedMessagesCount:50;try{for(;;)try{let c=await fetch(`/api/sessions/${encodeURIComponent(a)}?limit=100&offset=${b}&deferThinking=1&deferMedia=1`);if(!c.ok)break;let d=await c.json();if(a4.current!==a)break;let e=d.context.messages,f=d.context.entryIds??[];if(0===e.length)break;ac(a=>[...e,...a]),ae(a=>{let b=[...f,...a];return bx.current=b,b});let g=b+e.length;if(ak(g),bB.current=g,ai(d.hasMore??!1),L(a,e,f,d.hasMore??!1,g),b=g,!d.hasMore)break;await new Promise(a=>setTimeout(a,800))}catch{break}}finally{bP.current=!1,bC.current=!0,bA.current=!1}},[]),bR=(0,d.useCallback)(async(a,b=!1,c=!1,d=!1)=>{var e;let f=null;try{if(b&&Y(!0),!c&&!bd.current&&!d){let c=K(a);if(c)return ag(c.totalMessages),ai(c.hasMore),ak(c.loadedMessagesCount),ac(c.messages),bx.current=c.entryIds,ae(c.entryIds),bw.current=c.leafId,aa(c.leafId),bB.current=c.loadedMessagesCount,b&&Y(!1),c.hasMore&&!bC.current&&setTimeout(()=>{bQ()},1500),null}let g=c?`/api/sessions/${encodeURIComponent(a)}?includeState&deferThinking=1&deferMedia=1`:`/api/sessions/${encodeURIComponent(a)}?limit=50&offset=0&deferThinking=1&deferMedia=1`,h=bE.current;if(h?.sid===a&&!b)return null;h?.controller.abort(Q("Session load superseded","AbortError"));let i=new AbortController;f=i,bE.current={sid:a,controller:i};let j=setTimeout(()=>{i.abort(Q("Session load timed out after 30 seconds","TimeoutError"))},3e4),k=await fetch(g,{signal:i.signal}).finally(()=>clearTimeout(j));if(a4.current&&a4.current!==a)return null;if(404===k.status)return b&&(I(null),bw.current=null,aa(null),ac([]),$(null)),null;if(!k.ok)throw Error(`HTTP ${k.status}`);let m=await k.json();c?(ag(m.totalMessages??m.context.messages.length),ai(!1)):(ag(m.totalMessages??m.context.messages.length),ai(m.hasMore??!1)),ak(m.context.messages.length),I(m),bw.current=m.leafId,aa(m.leafId);let n=m.context.messages,o=U(n),p=new Map,q=Date.now();for(let[b,c]of bs.current)if(c.sessionId===a){if(q-c.createdAt>12e4){bs.current.delete(b);continue}if(c.confirmKey){let a=o.get(c.confirmKey)??0,d=p.get(c.confirmKey)??0;a-d>c.confirmCountAtCreate&&(bs.current.delete(b),p.set(c.confirmKey,d+1))}}bt.current=o;let r=m.context.entryIds??[],s=[...bs.current.values()].filter(b=>V(b,a,r)).map(a=>a.message),t=s.length>0?[...n,...s]:n,u=function(a,b,c){if(0===b.size)return a;let d=!1,e=a.map(a=>{let e=l(a);if(!e)return a;let f=b.get(e);return f?c-f.observedAt>5e3||function(a,b){let c=a.timestamp,d=b.timestamp;if("number"!=typeof c||"number"!=typeof d||c!==d||a.role!==b.role)return!1;try{return JSON.stringify(a)===JSON.stringify(b)}catch{return!1}}(f.message,a)?(b.delete(e),a):(d=!0,f.message):a});return d?e:a}(t,bv.current,Date.now()),v=bu.current.get(a);if(v){for(let[a,b]of v)q-b>12e4&&v.delete(a);0===v.size&&bu.current.delete(a)}let w=v?.size?v:null,x=w?new Set(r):null,y=!!w&&!!x&&[...w.keys()].some(a=>!x.has(a));w&&x&&!y&&bu.current.delete(a);let z=u.length;return!c&&(bB.current>z||y)?(ag(m.totalMessages??m.context.messages.length),ai(m.hasMore??!1)):(ac(a=>(function(a,b){if(a.length!==b.length)return b;let c=!1,d=b.map((b,d)=>W(a[d],b)?a[d]:(c=!0,b));return c?d:a})(a,u)),bx.current=r,ae(r),c?bB.current=z:bB.current=Math.max(bB.current,z),e={sessionId:a,leafId:m.leafId,messages:u,entryIds:r,totalMessages:m.totalMessages??m.context.messages.length,hasMore:!c&&(m.hasMore??!1),loadedMessagesCount:m.context.messages.length},J().entries.set(a,{...e,loadedAt:Date.now()})),aQ(a=>{if(!a)return null;let b=m.context.model;return b?.provider===a.provider&&b.modelId===a.modelId?null:a}),$(null),!m.agentState?.state?.thinkingLevel&&m.context.thinkingLevel&&"off"!==m.context.thinkingLevel&&aG(m.context.thinkingLevel),m.agentState??null}catch(a){if(a instanceof DOMException&&("AbortError"===a.name||"TimeoutError"===a.name)||a instanceof Error&&/aborted without reason|AbortError|Session load (?:timed out|superseded)/i.test(a.message))return null;return $(String(a)),null}finally{f&&bE.current?.controller===f&&(bE.current=null),b&&Y(!1)}},[bQ]),bS=(0,d.useRef)(!1),bT=(0,d.useCallback)(async()=>{if(bS.current)return;bS.current=!0;let a=a4.current;if(!a){bS.current=!1;return}try{let b=await fetch(`/api/sessions/${encodeURIComponent(a)}?limit=50&offset=${aj}&deferThinking=1&deferMedia=1`);if(!b.ok)return;let c=await b.json(),d=c.context.messages,e=c.context.entryIds??[];ac(a=>[...d,...a]),ae(a=>{let b=[...e,...a];return bx.current=b,b}),ak(a=>a+d.length),ai(c.hasMore??!1),L(a,d,e,c.hasMore??!1,aj+d.length)}catch{}finally{bS.current=!1}},[aj]),bU=(0,d.useCallback)(async a=>{let b=a4.current;if(!b)return[];let c=bw.current,d=c?`?leafId=${encodeURIComponent(c)}`:"";try{let c=await fetch(`/api/sessions/${encodeURIComponent(b)}/shadowed${d}`);if(!c.ok)return[];let e=await c.json(),f=e.groups?.find(b=>b.compactionEntryId===a);return f?.messages??[]}catch{return[]}},[]),bV=(0,d.useCallback)(async(a,b)=>{try{let c=b?`/api/sessions/${encodeURIComponent(a)}/context?leafId=${encodeURIComponent(b)}&deferThinking=1&deferMedia=1`:`/api/sessions/${encodeURIComponent(a)}/context?deferThinking=1&deferMedia=1`,d=await fetch(c);if(!d.ok)throw Error(`HTTP ${d.status}`);let e=await d.json(),f=e.context.messages,g=e.context.entryIds??[],h=U(f),i=new Map,j=Date.now();for(let[b,c]of bs.current)if(c.sessionId===a){if(j-c.createdAt>12e4){bs.current.delete(b);continue}if(c.confirmKey){let a=h.get(c.confirmKey)??0,d=i.get(c.confirmKey)??0;a-d>c.confirmCountAtCreate&&(bs.current.delete(b),i.set(c.confirmKey,d+1))}}bt.current=h;let k=[...bs.current.values()].filter(b=>V(b,a,g)).map(a=>a.message);ac(k.length>0?[...f,...k]:f),bx.current=g,ae(g)}catch(a){console.error("Failed to load context:",a)}},[]),bW=(0,d.useCallback)(async a=>{try{let b=await n(a,{type:"get_tools"});b&&(bH((0,N.ES)(b)),bI((0,N.IB)(b)))}catch(a){console.error("Failed to load tools:",a)}},[bI,bH]),bX=(0,d.useCallback)(async a=>{try{let b=await n(a,{type:"get_commands"});aE(Array.isArray(b?.commands)?b.commands:[])}catch{aE([])}},[]),bY=(0,d.useCallback)((a,b={})=>{a3.current?.close(),a3.current=null;let c=`/api/agent/${encodeURIComponent(a)}/events${b.replay?"?replay=1":""}`;return!function(a){let b=E(a);if("active"===b.snapshot.phase)return z(b,!0),B(b),b.snapshot;let c=Date.now();b.snapshot={...w(a),phase:"active",startedAt:c,lastEventAt:c,isStreaming:!0,streamingMessage:{role:"assistant",content:[]}},B(b),z(b,!0),b.snapshot}(a),new Promise((d,e)=>{let f=!1,g=!1,h=null,i=a=>{if(!f){if(f=!0,clearTimeout(j),a){h?.close(),a3.current===h&&(a3.current=null),e(a);return}d()}},j=setTimeout(()=>{b.requireConnected?i(Error("Timed out waiting for event stream connection")):i()},b.timeoutMs??3e4);a3.current=h=function(a){let{url:b,onEvent:c,onStateChange:d,onFatalError:e,maxReconnectAttempts:f=1/0,reconnectBaseMs:g=1e3,reconnectMaxMs:h=3e4,autoReconnect:i=!0}=a,j="idle",k=new AbortController,l=0,m=null,n=null,o=!1,p=(a,b)=>{b&&(n=b),c(a,b)},r=a=>{j!==a&&(j=a,d?.(a))},s=()=>{null!==m&&(clearTimeout(m),m=null)},t=()=>{if(o)return;if(!i)return void r("error");if(l>=f){r("error"),e?.(Error(`Max reconnect attempts (${f}) reached`));return}let a=Math.min(h,g*2**l);l+=1,r("connecting"),m=setTimeout(()=>{m=null,u()},a)},u=async()=>{if(!o){s(),k=new AbortController,r("connecting");try{let a=await fetch(b,{signal:k.signal,headers:{Accept:"text/event-stream","Cache-Control":"no-cache",...n?{"Last-Event-ID":n}:{}}});if(!a.ok)throw Error(`HTTP ${a.status}: ${a.statusText}`);let c=a.body;if(!c)throw Error("Response has no readable body");let d=c.getReader();if(r("connected"),l=0,await q(d,p,k.signal),k.signal.aborted)try{await d.cancel()}catch{}d.releaseLock(),r("closed"),!o&&i&&t()}catch(a){if(o||a instanceof DOMException&&"AbortError"===a.name)return void r("closed");r("error"),i&&t()}}};return{get state(){return j},connect:()=>{o=!1,l=0,s(),u()},close:()=>{o=!0,s(),k.abort(),r("closed")},get abortController(){return k}}}({url:c,onEvent:b=>{try{let c=JSON.parse(b);if("connected"===c.type&&i(),a4.current!==a)return;bk.current?.(c)}catch{}},onStateChange:b=>{!function(a,b){let c=u().get(a);if(!c)return;let d=c.connectionState;c.connectionState=b,"connected"===b&&"connected"!==d&&(c.snapshot={...c.snapshot,lastEventAt:Date.now(),lastHeartbeatAt:Date.now()},B(c)),"connected"!==b&&"connected"===d&&C(c)}(a,b),"connected"===b&&(g&&(H(a),bl.current?.(a,"sse_reconnected")),g=!0)},reconnectBaseMs:1e3,reconnectMaxMs:3e4}),h.connect()})},[]),bZ=(0,d.useCallback)(async(a,b="manual")=>{if(!a||a4.current!==a)return;let c=bz.current;try{let b=await fetch(`/api/agent/${encodeURIComponent(a)}`),e=await b.json().catch(()=>({}));if(a4.current!==a||bz.current!==c)return;if(e.running){var d;bd.current=!0,ao(!0),a$((d=e.state,d?.phase==="running_tools"?{kind:"running_tools",tools:(d.activeTools??[]).map(a=>({id:a.id,name:a.name}))}:d?.phase==="streaming"||d?.phase==="compacting"||d?.phase==="idle"?null:{kind:"waiting_model"})),a3.current&&"closed"!==a3.current.state&&"error"!==a3.current.state||(H(a),bY(a,{replay:!0}))}else bd.current=!1,a3.current?.close(),a3.current=null,G(a),ao(!1),a$(null),aI(null),am({type:"end"}),M(a),await bR(a,!1,!1,!0);e.state?.contextUsage!==void 0&&aK(e.state.contextUsage??null),e.state?.systemPrompt!==void 0&&aM(e.state.systemPrompt??null),e.state?.isCompacting!==void 0&&aU(e.state.isCompacting),e.state?.thinkingLevel!==void 0&&aG(e.state.thinkingLevel??"auto"),e.state?.queuedMessages!==void 0&&a0(O(e.state.queuedMessages)),a9(e.state),e.state?.isBashRunning&&bh("")}catch{}},[bY,bR,a9,bh]);bk.current=(0,d.useCallback)(a=>{let b=a4.current;switch(b&&function(a,b){let c=E(a),d=Date.now();switch(b.type){case"agent_start":if("active"===c.snapshot.phase)return z(c,!0),c.snapshot;return D(c),c.accumulatedText="",c.toolCalls.clear(),c.toolResults.clear(),c.activeToolId=null,c.snapshot={...w(a),phase:"active",startedAt:d,lastEventAt:d,isStreaming:!0,streamingMessage:{role:"assistant",content:[]}},B(c),z(c,!0),c.snapshot;case"message_update":{let a=b.message;if(a?.role==="assistant"){let b=a.content;for(let a of Array.isArray(b)?b:[])"object"==typeof a&&null!==a&&"type"in a&&("text"===a.type?c.accumulatedText=a.text??"":"toolCall"===a.type&&a.toolCallId&&!c.toolCalls.has(a.toolCallId)&&c.toolCalls.set(a.toolCallId,{...a,startedAt:d}))}else{let a=b.assistantMessageEvent;a?.type==="text_delta"?c.accumulatedText+=a.delta??"":a?.type==="text_end"?c.accumulatedText=a.content??c.accumulatedText:(a?.type==="toolcall_start"||a?.type==="toolcall_delta")&&a.id&&!c.toolCalls.has(a.id)&&c.toolCalls.set(a.id,{type:"toolCall",toolCallId:a.id,toolName:a.toolName??"tool",input:{},startedAt:d})}return z(c,!1),c.snapshot}case"tool_execution_start":{let a="string"==typeof b.toolCallId?b.toolCallId:"",e="string"==typeof b.toolName?b.toolName:"tool",f=b.input??{};if(!a)return c.snapshot;let g=c.toolCalls.get(a);return c.toolCalls.set(a,{type:"toolCall",toolCallId:a,toolName:e,input:g&&Object.keys(g.input).length>0?g.input:f,startedAt:g?.startedAt??d}),c.activeToolId=a,D(c),c.activeToolId&&(c.toolProgressTimer=setInterval(()=>z(c,!0),1e3)),z(c,!0),c.snapshot}case"tool_execution_end":{let a="string"==typeof b.toolCallId?b.toolCallId:"",e="string"==typeof b.toolName?b.toolName:"tool",f="string"==typeof b.result?b.result:JSON.stringify(b.result??"");if(a){let g=c.toolCalls.get(a);g&&c.toolCalls.set(a,{...g,endedAt:d}),c.toolResults.set(a,{role:"toolResult",toolCallId:a,toolName:e,content:[{type:"text",text:f}],isError:!!b.isError,timestamp:d}),c.activeToolId===a&&(c.activeToolId=null,D(c))}return z(c,!0),c.snapshot}case"message_end":return y(c),z(c,!0),c.snapshot;case"agent_end":{if(y(c),D(c),c.activeToolId=null,!0===b.willRetry)return c.accumulatedText="",c.toolCalls.clear(),c.toolResults.clear(),c.snapshot={...c.snapshot,phase:"active",lastEventAt:d,accumulatedText:"",toolCalls:[],toolResults:[],statusText:null,streamingMessage:null,isStreaming:!0,error:null},B(c),x(a,{type:"snapshot-updated",snapshot:c.snapshot}),c.snapshot;C(c);let e="string"==typeof b.error?b.error:null;return c.snapshot={...c.snapshot,phase:e?"error":"completed",isStreaming:!1,streamingMessage:null,statusText:null,error:e},x(a,e?{type:"error",snapshot:c.snapshot}:{type:"completed",snapshot:c.snapshot}),c.snapshot}case"heartbeat":return c.snapshot={...c.snapshot,lastHeartbeatAt:d},c.snapshot;default:return c.snapshot}}(b,a),"heartbeat"!==a.type&&(bF.current=Date.now()),a.type){case"prompt_admitted":case"agent_start":a2(null),bd.current=!0,ao(!0),a$({kind:"waiting_model"}),am({type:"start"});break;case"agent_end":if(!0===a.willRetry){bd.current=!0,ao(!0),a$({kind:"waiting_model"});break}if(bd.current=!1,ao(!1),a$(null),aI(null),am({type:"end"}),b){bD.current&&clearTimeout(bD.current);let a=bz.current,c=0,d=async()=>{if(a4.current!==b||bd.current||bz.current!==a)return;M(b),await bR(b,!1,!1,!0);let e=P[c++];void 0===e||a4.current!==b||bd.current||bz.current!==a||(bD.current=setTimeout(()=>{bD.current=null,d()},e))};d(),fetch(`/api/agent/${encodeURIComponent(b)}`).then(a=>a.json()).then(a=>{a.state?.contextUsage!==void 0&&aK(a.state.contextUsage??null),a.state?.systemPrompt!==void 0&&aM(a.state.systemPrompt??null),a.state?.isCompacting!==void 0&&aU(a.state.isCompacting)}).catch(()=>{})}g?.();break;case"agent_settled":a$(null),aI(null),bd.current&&(bd.current=!1,ao(!1),am({type:"end"}));break;case"message_start":case"message_update":{let b=a.message;if(b?.role==="user")break;bd.current||(bd.current=!0,ao(!0),a$({kind:"waiting_model"}));let c=a.assistantMessageEvent;b?.role==="assistant"?am({type:"snapshot",message:e(b)}):c&&am({type:"delta",event:c}),a$(null);break}case"message_end":{let c=a.message,d="string"==typeof a.__entryId?a.__entryId:null,f=bd.current;if(c&&"user"!==c.role){"assistant"===c.role&&"error"===c.stopReason&&c.errorMessage?.trim()&&a2(`Model response failed: ${c.errorMessage.trim()}`);let a=e(c),f=l(a);if(f&&bv.current.set(f,{observedAt:Date.now(),message:a}),!(d&&bx.current.includes(d))){if(b&&d){let a=bu.current.get(b)??new Map;a.set(d,Date.now()),bu.current.set(b,a)}ac(b=>b.some(b=>W(b,a))?b:[...b,a]),d&&ae(a=>{if(a.includes(d))return a;let b=[...a,d];return bx.current=b,b})}}f&&(am({type:"reset"}),a$({kind:"waiting_model"}));break}case"replay_gap":b&&(M(b),bR(b,!1,!1,!0));break;case"prompt_done":if(!bd.current)break;bZ(a4.current??"","prompt_done");break;case"prompt_error":{let c="string"==typeof a.error&&a.error.trim()?a.error.trim():"The model request failed before producing a response.";if(bd.current=!1,ao(!1),a$(null),aI(null),am({type:"end"}),a3.current?.close(),a3.current=null,b){for(let[a,c]of(G(b),bs.current))c.sessionId===b&&"prompt"===c.kind&&bs.current.delete(a);M(b),bR(b,!1,!1,!0)}a2(`Model request failed: ${c}`),g?.();break}case"tool_execution_start":{let b=a.toolCallId,c=a.toolName,d=a.args,e="bash"===c&&"string"==typeof d?.command?d.command:void 0;a$(a=>{let d=a?.kind==="running_tools"?[...a.tools]:[];return d.some(a=>a.id===b)||d.push({id:b,name:c,args:e}),{kind:"running_tools",tools:d}});break}case"tool_execution_update":{let b=a.toolCallId,c=a.toolName,d=function(a){if(!k(a))return null;let b=a.content;if(!Array.isArray(b))return null;let c=b.filter(a=>k(a)&&"text"===a.type&&"string"==typeof a.text).map(a=>a.text).join("\n").split(/\r?\n/),d="";for(let a=c.length-1;a>=0&&!(d=c[a].trim());a-=1);if(!d)return null;let e=d.replace(/\s+/g," ");return e.length<=500?e:`...${e.slice(-497)}`}(a.partialResult);if(!b)break;a$(a=>{let e=a?.kind==="running_tools"?[...a.tools]:[],f=e.find(a=>a.id===b),g={id:b,name:c||f?.name||"tool",args:f?.args,progress:d??f?.progress};return{kind:"running_tools",tools:[...e.filter(a=>a.id!==b),g]}});break}case"tool_execution_end":{let b=a.toolCallId;a$(a=>{if(a?.kind!=="running_tools")return a;let c=a.tools.filter(a=>a.id!==b);return 0===c.length?{kind:"waiting_model"}:{kind:"running_tools",tools:c}});break}case"extension_ui_request":case"extension_error":ba(a);break;case"bash_execution_start":case"bash_execution_update":bj(a);break;case"bash_done":{bj(a);let b=a4.current;b&&(M(b),bR(b,!1,!1,!0));break}case"queue_update":a0(O({steering:Array.isArray(a.steering)?a.steering:[],followUp:Array.isArray(a.followUp)?a.followUp:[]}));break;case"auto_retry_start":a2(null),bd.current=!0,ao(!0),a$({kind:"waiting_model"}),aI({attempt:a.attempt,maxAttempts:a.maxAttempts,errorMessage:a.errorMessage});break;case"auto_retry_end":aI(null),!1===a.success&&"string"==typeof a.finalError&&a.finalError.trim()?a2(`Model response failed after retries: ${a.finalError.trim()}`):!0===a.success&&a2(null);break;case"auto_compaction_start":case"compaction_start":aU(!0),aW(null);break;case"auto_compaction_end":case"compaction_end":aU(!1),a.errorMessage?aW(a.errorMessage):!a.aborted&&a4.current&&bR(a4.current)}},[bR,g,bZ,ba,bj]);let b$=(0,d.useCallback)(async(a,d,e,f)=>{if(!a.trim()&&!d?.length&&!e?.length||an)return;bz.current+=1;let g=bM(e),i=a.trim()?g?`${a}
5
+
6
+ Attached document text:
7
+
8
+ ${g}`:a:g?`Attached document text:
9
+
10
+ ${g}`:"",j=[],k=v?c:b?.cwd??A?.info?.cwd;if(d?.length&&k)try{j=await p(k,d)}catch(a){a2(a instanceof Error?a.message:String(a));return}let l=j.length?j.map(a=>{var b;return{type:"image",path:a.path,mimeType:a.mimeType,name:a.name,source:{type:"url",url:(b=a.path,`/api/files/${(0,o.HG)(b)}?type=read`),media_type:a.mimeType}}}):d?.map(a=>({type:"image",source:{type:"base64",media_type:a.mimeType,data:a.data}})),q={role:"user",content:l?.length?[...i.trim()?[{type:"text",text:i}]:[],...l]:i,timestamp:Date.now()},r=R(),s=v?null:b?.id??null;s&&M(s);let u=bw.current,w=T(q.content);bs.current.set(r,{localId:r,sessionId:s??"__new__",leafId:u,message:q,createdAt:Date.now(),kind:"prompt",confirmKey:w,confirmCountAtCreate:v?0:w?bt.current.get(w)??0:0}),ac(a=>[...a,q]),a2(null),bd.current=!0,ao(!0),a$({kind:"waiting_model"}),am({type:"start"}),bp.current=!0;let x=ar.find(a=>a.provider===bJ?.provider&&a.id===bJ?.modelId)?.input,y=!x||0===x.length||x.includes("image")?d?.map(a=>({type:"image",data:a.data,mimeType:a.mimeType})):void 0;try{if(v&&c){ax&&aS(ax);let b=f??bL(),d=await fetch("/api/agent/new",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:c,type:"prompt",message:i,toolNames:b,deferPrompt:!0,...y?.length?{images:y}:{},...ax?{provider:ax.provider,modelId:ax.modelId}:{},..."auto"!==aF?{thinkingLevel:aF}:{}})}),e=await d.json().catch(()=>({}));if(!d.ok||e.error||!e.sessionId)throw Error(e.error??`HTTP ${d.status}`);let g=e.sessionId;a4.current=g;let j=bs.current.get(r);j&&(j.sessionId=g),bm.current?.(),bm.current=F(g,()=>{a4.current===g&&(ao(!1),a$(null))}),by.current=g,await bY(g,{requireConnected:!0,timeoutMs:1e4}),await n(g,{type:"prompt",message:i,toolNames:b,...y?.length?{images:y}:{}}),h?.({id:g,path:"",cwd:c,name:void 0,created:new Date().toISOString(),modified:new Date().toISOString(),messageCount:1,firstMessage:a})}else if(b){let a=f??bL();await bN(b.id),bm.current?.(),bm.current=F(b.id,()=>{a4.current===b.id&&(ao(!1),a$(null))}),await bY(b.id,{requireConnected:!0,timeoutMs:1e4}),await n(b.id,{type:"prompt",message:i,toolNames:a,leafId:u,...bJ?{provider:bJ.provider,modelId:bJ.modelId}:{},..."auto"!==aF?{thinkingLevel:aF}:{},...y?.length?{images:y}:{}})}}catch(c){let b=a4.current;if(bs.current.delete(r),ac(a=>a.filter(a=>a!==q)),c instanceof m&&(409===c.status||"SESSION_BUSY"===c.code)){a2("This session is already running in another tab. Showing that active run instead."),bd.current=!0,ao(!0),a$({kind:"waiting_model"}),am({type:"start"}),b&&(a3.current?.close(),a3.current=null,H(b),bY(b,{replay:!0}),bl.current?.(b,"prompt_conflict"));return}if(console.error("Failed to send message:",c),v&&a4.current){let a=a4.current;a4.current=null,by.current=null,fetch(`/api/sessions/${encodeURIComponent(a)}`,{method:"DELETE"}).catch(()=>{})}t?.current&&a.trim()&&t.current.insertIfEmpty(a),t?.current&&d?.length&&t.current.addBase64Images?.(d.map(({data:a,mimeType:b})=>({data:a,mimeType:b}))),a2(c instanceof Error?c.message:String(c)),a3.current?.close(),a3.current=null,b&&G(b),bd.current=!1,ao(!1),a$(null),am({type:"end"})}},[v,c,ax,bL,aF,b,A?.info?.cwd,an,bY,h,bM,ar,bJ,bN,t]),b_=(0,d.useCallback)(async()=>{let a=a4.current;if(!a)return;let b=bg();bd.current=!1,bi(),a2(null),ao(!1),a$(null),am({type:"end"}),a3.current?.close(),a3.current=null,G(a),M(a);try{await n(a,{type:b?"abort_bash":"abort"}),await bR(a,!1,!1,!0)}catch(b){console.error("Failed to abort:",b),await bR(a,!1,!1,!0)}finally{b&&bi()}},[bi,bg,bR]),b0=(0,d.useCallback)(async(a,b)=>{let c=a4.current,d=a.trim();if(c&&d){a2(null),bh(d);try{await n(c,{type:"bash",command:d,excludeFromContext:b})}catch(a){a2(a instanceof Error?a.message:String(a))}finally{bi(),M(c),await bR(c,!1,!1,!0)}}},[bh,bi,bR]),b1=(0,d.useCallback)(async a=>{let b=a4.current;if(b){aO(a);try{let{cancelled:c,newSessionId:d}=await n(b,{type:"fork",entryId:a})??{};!c&&d&&i?.(d)}catch(a){console.error("Fork failed:",a)}finally{aO(null)}}},[i]),b2=(0,d.useCallback)(async a=>{let d=a4.current,e=A?.info?.cwd??b?.cwd??c??null;if(!d||!e)return{ok:!1,error:"No active session to fork"};if(bd.current)return{ok:!1,error:"Agent is still running"};try{let b=bL(),c=await fetch("/api/agent/new",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,type:"prompt",parentSessionId:d,deferPrompt:!0,toolNames:b,...bJ?{provider:bJ.provider,modelId:bJ.modelId}:{},..."auto"!==aF?{thinkingLevel:aF}:{}})}),f=await c.json().catch(()=>({}));if(!c.ok||f.error||!f.sessionId)return{ok:!1,error:f.error??`HTTP ${c.status}`};let g=f.sessionId;try{await n(g,{type:"append_message",message:a,customType:"fork_handoff",display:!0})}catch{}return h?.({id:g,path:"",cwd:e,created:new Date().toISOString(),modified:new Date().toISOString(),messageCount:1,firstMessage:a.slice(0,120),parentSessionId:d}),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}},[A?.info?.cwd,b?.cwd,c,bJ,aF,bL,h]),b3=(0,d.useCallback)(async a=>{let b=a4.current;b&&(bu.current.delete(b),M(b),bw.current=a,aa(a),await bV(b,a))},[bV]);(0,d.useCallback)(async a=>{bw.current=a,aa(a);let b=a4.current;b&&(bu.current.delete(b),M(b),await bV(b,a))},[bV]);let b4=(0,d.useCallback)(async(a,b)=>{if(v)return void bG({provider:a,modelId:b});let c=a4.current;if(c)try{var d;a2(null);let e=await n(c,{type:"set_model",provider:a,modelId:b}),f={provider:e.provider,modelId:e.id};e.thinkingLevel&&(d=e.thinkingLevel,"auto"===d||"off"===d||"minimal"===d||"low"===d||"medium"===d||"high"===d||"xhigh"===d)&&aG(e.thinkingLevel),aQ(f),I(a=>a?{...a,context:{...a.context,model:f}}:a)}catch(b){let a=b instanceof Error?b.message:String(b);console.error("Failed to set model:",b),a2(a)}},[v,bG]),b5=(0,d.useCallback)(async()=>{let a=a4.current;if(a&&!aT){aU(!0),aW(null),aY(null);try{let b=await n(a,{type:"compact"});b?.reducedBy!=null&&aY(`Compacted ~${b.tokensBefore??"?"} → ~${b.tokensAfter??"?"} tokens (−${b.reducedBy})`),await bR(a,!0)}catch(a){aW(a instanceof Error?a.message:String(a))}finally{aU(!1)}}},[aT,bR]),b6=(0,d.useCallback)(async(a,b,c)=>{let d=a4.current;if(!d)return;M(d);let e=bM(c),f=a.trim()?e?`${a}
11
+
12
+ Attached document text:
13
+
14
+ ${e}`:a:e?`Attached document text:
15
+
16
+ ${e}`:"",g=ar.find(a=>a.provider===bJ?.provider&&a.id===bJ?.modelId)?.input,h=!g||0===g.length||g.includes("image")?b?.map(a=>({type:"image",data:a.data,mimeType:a.mimeType})):void 0,i={role:"user",content:`[steer] ${f}`,timestamp:Date.now()},j=R(),k=S(f,h?.length??0);bs.current.set(j,{localId:j,sessionId:d,leafId:bw.current,message:i,createdAt:Date.now(),kind:"steer",confirmKey:k,confirmCountAtCreate:k?bt.current.get(k)??0:0}),ac(a=>[...a,i]);try{await n(d,{type:"steer",message:f,...h?.length?{images:h}:{}})}catch(a){bs.current.delete(j),console.error("Failed to steer:",a)}},[bM,ar,bJ]),b7=(0,d.useCallback)(async(a,b,c)=>{let d=a4.current;if(!d)return;M(d);let e=bM(c),f=a.trim()?e?`${a}
17
+
18
+ Attached document text:
19
+
20
+ ${e}`:a:e?`Attached document text:
21
+
22
+ ${e}`:"",g=ar.find(a=>a.provider===bJ?.provider&&a.id===bJ?.modelId)?.input,h=!g||0===g.length||g.includes("image")?b?.map(a=>({type:"image",data:a.data,mimeType:a.mimeType})):void 0,i={role:"user",content:f,timestamp:Date.now()},j=R(),k=S(f,h?.length??0);bs.current.set(j,{localId:j,sessionId:d,leafId:bw.current,message:i,createdAt:Date.now(),kind:"follow_up",confirmKey:k,confirmCountAtCreate:k?bt.current.get(k)??0:0}),ac(a=>[...a,i]);try{await n(d,{type:"follow_up",message:f,...h?.length?{images:h}:{}})}catch(a){bs.current.delete(j),console.error("Failed to follow up:",a)}},[bM,ar,bJ]),b8=(0,d.useCallback)(async()=>{let a=a4.current;if(a)try{await n(a,{type:"abort_compaction"})}catch(a){console.error("Failed to abort compaction:",a)}},[]),b9=(0,d.useCallback)(async a=>{if(aG(a),"auto"===a)return;let b=a4.current;if(b)try{await n(b,{type:"set_thinking_level",level:a})}catch(a){console.error("Failed to set thinking level:",a)}},[]),ca=(0,d.useCallback)(async a=>{bH(a);let b=(0,N.tE)(a,aB),c=a4.current;if(c)try{await n(c,{type:"set_tools",toolNames:b})}catch(a){console.error("Failed to set tools:",a)}},[aB,bH]),cb=(0,d.useCallback)(async a=>{bI(a);let b=(0,N.tE)(az,a),c=a4.current;if(c)try{await n(c,{type:"set_tools",toolNames:b})}catch(a){console.error("Failed to set memory tools:",a)}},[bI,az]);(0,d.useCallback)((a="smooth")=>{bq.current?.scrollIntoView({behavior:a})},[]),(0,d.useCallback)(()=>{let a=br.current,b=bo.current;if(!a||!b)return;let c=b.getBoundingClientRect().top-a.getBoundingClientRect().top+a.scrollTop;a.scrollTo({top:c-16,behavior:"smooth"})},[]);let cc=(0,d.useCallback)(async()=>{let a=a4.current;if(a)try{await n(a,{type:"clear_queue"}),a0({steering:[],followUp:[]})}catch(a){a2(a instanceof Error?a.message:String(a))}},[]);return{data:A,loading:X,error:Z,activeLeafId:_,messages:ab,entryIds:ad,streamState:al,agentRunning:an,modelNames:ap,modelList:ar,modelThinkingLevels:at,modelThinkingLevelMaps:av,newSessionModel:ax,toolPreset:az,memoryTools:aB,thinkingLevel:aF,retryInfo:aH,queuedMessages:a_,extensionStatuses:a5,extensionWidgets:a6,extensionDialog:a7,extensionNotices:a8,bashLive:be,bashRunning:bf,contextUsage:aJ,systemPrompt:aL,forkingEntryId:aN,isCompacting:aT,compactError:aV,compactInfo:aX,currentModel:bJ,displayModel:bK,sessionStats:bO,agentPhase:aZ,agentError:a1,isNew:v,sessionIdRef:a4,sseReaderRef:a3,messagesEndRef:bq,scrollContainerRef:br,lastUserMsgRef:bo,pendingScrollToUserRef:bp,initialScrollDoneRef:bn,handleSend:b$,handleAbort:b_,handleFork:b1,handleNavigate:b3,handleModelChange:b4,handleCompact:b5,handleSteer:b6,handleFollowUp:b7,handleAbortCompaction:b8,handleToolPresetChange:ca,handleMemoryToolsChange:cb,handleThinkingLevelChange:b9,handleClearQueue:cc,handleBash:b0,respondToExtensionUi:bb,dismissExtensionNotice:bc,loadTools:bW,loadSlashCommands:bX,slashCommands:aD,setActiveLeafId:aa,setData:I,setMessages:ac,dispatch:am,setAgentRunning:ao,setForkingEntryId:aO,forkToNewSession:b2,loadMoreMessages:bT,hasMoreMessages:ah,totalMessages:af,loadedMessagesCount:aj,loadShadowedMessages:bU,handleAgentEventRef:bk}}},29947:(a,b,c)=>{c.d(b,{ES:()=>l,IB:()=>m,SN:()=>e,tE:()=>n});let d="subagent",e=["retain","recall","reflect"],f=[],g=["read","bash","edit","write"],h=["bash","read","edit","write","grep","find","ls"],i=[...h,"kernel_plot_run","kernel_plot_render","kernel_plot_inspect","kernel_plot_stop","kernel_plot_artifacts"],j=[...h,d];function k(a){return[...a].sort().join(",")}function l(a){let b=a.filter(a=>a.active).map(a=>a.name),c=b.filter(a=>!e.includes(a)),f=k(b),l=k(c);return""===f?"none":f===k(g)?"default":f===k(h)?"full":f===k(i)?"workbench":f===k(j)?"agent":""===l?"none":l===k(g)?"default":l===k(h)?"full":l===k(i)?"workbench":l===k(j)||b.includes(d)?"agent":"default"}function m(a){return e.filter(b=>a.some(a=>a.active&&a.name===b))}function n(a,b){return[...new Set([...function(a){switch(a){case"none":return f;case"default":return g;case"workbench":return i;case"agent":return j;default:return h}}(a),...b])]}},81537:(a,b,c)=>{c.d(b,{O:()=>k});let d=new Set,e=null,f=null,g=null,h=null,i=null,j=!1;function k(a){return d.add(a),e&&a(e),()=>{if(d.delete(a),0===d.size&&j){if(j=!1,h&&clearTimeout(h),h=null,g&&(clearInterval(g),g=null),i?.(),i=null,f){try{f.port.postMessage({type:"disconnect"})}catch{}try{f.port.close()}catch{}}f=null,e=null}}}}};
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/YRLT_dWnNGA0kvsTREpEW/_buildManifest.js","static/YRLT_dWnNGA0kvsTREpEW/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-36fa69ae1e15e7ce.js","static/chunks/4bd1b696-8cd12253b448cc13.js","static/chunks/3794-fba3f76785a3c234.js","static/chunks/main-app-a8a207cb34d209aa.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/rPVMly3awjAYAgBD6W0mU/_buildManifest.js","static/rPVMly3awjAYAgBD6W0mU/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-36fa69ae1e15e7ce.js","static/chunks/4bd1b696-8cd12253b448cc13.js","static/chunks/3794-fba3f76785a3c234.js","static/chunks/main-app-a8a207cb34d209aa.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en" class="__variable_9e44ca"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/7deddc85b7ffd1dc-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/ec14413c594b3356-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/9bcd6051db4f8890.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/d68ecb6695873888.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-36fa69ae1e15e7ce.js"/><script src="/_next/static/chunks/4bd1b696-8cd12253b448cc13.js" async=""></script><script src="/_next/static/chunks/3794-fba3f76785a3c234.js" async=""></script><script src="/_next/static/chunks/main-app-a8a207cb34d209aa.js" async=""></script><script src="/_next/static/chunks/app/layout-31265427e43f6876.js" async=""></script><script src="/_next/static/chunks/app/error-6309e3e4cdf79d40.js" async=""></script><script src="/_next/static/chunks/app/global-error-7595c826cec2c048.js" async=""></script><meta name="robots" content="noindex"/><title>AnnoVibe</title><meta name="description" content="AI-native bioinformatics workspace by Annoroad"/><link rel="shortcut icon" href="/icon.svg" type="image/svg+xml"/><link rel="icon" href="/icon.svg" type="image/svg+xml"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><script>(self.__next_s=self.__next_s||[]).push([0,{"children":"(function(){try{var t=localStorage.getItem(\"pi-theme\");if(t===\"dark\")document.documentElement.classList.add(\"dark\")}catch(e){}})();","id":"theme-init"}])</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body style="height:100dvh;display:flex;flex-direction:column"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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="/_next/static/chunks/webpack-36fa69ae1e15e7ce.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:\"static/chunks/app/layout-31265427e43f6876.js\"\n3:I[42593,[\"7177\",\"$2\"],\"\"]\n4:I[57121,[],\"\"]\n5:\"static/chunks/app/error-6309e3e4cdf79d40.js\"\n6:I[87460,[\"8039\",\"$5\"],\"default\"]\n7:I[74581,[],\"\"]\nb:I[90484,[],\"OutletBoundary\"]\nc:\"$Sreact.suspense\"\ne:\"ViewportBoundary\"\nf:I[90484,[],\"$e\"]\n11:\"MetadataBoundary\"\n12:I[90484,[],\"$11\"]\n14:\"static/chunks/app/global-error-7595c826cec2c048.js\"\n15:I[54690,[\"4219\",\"$14\"],\"default\"]\n:HL[\"/_next/static/media/7deddc85b7ffd1dc-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/ec14413c594b3356-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/9bcd6051db4f8890.css\",\"style\"]\n:HL[\"/_next/static/css/d68ecb6695873888.css\",\"style\"]\n9:X\na:[[\"children\",{\"s\":\"__PAGE__\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"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.\"}]}]]}]}]],null,[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$c\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@d\"}]}]]}],\"p\":false,\"v\":null}}]]\n8:[[\"children\",{\"s\":\"_not-found\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$9\"},\"c\":\"$Qa\"}]]\n0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9bcd6051db4f8890.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/d68ecb6695873888.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_9e44ca\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"$L3\",null,{\"id\":\"theme-init\",\"strategy\":\"beforeInteractive\",\"children\":\"(function(){try{var t=localStorage.getItem(\\\"pi-theme\\\");if(t===\\\"dark\\\")document.documentElement.classList.add(\\\"dark\\\")}catch(e){}})();\"}]}],[\"$\",\"body\",null,{\"style\":{\"height\":\"100dvh\",\"display\":\"flex\",\"flexDirection\":\"column\"},\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$6\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],\"p\":false,\"v\":null},\"c\":\"$Q8\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$Lf\",null,{\"children\":\"$L10\"}],[\"$\",\"$L12\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$c\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L13\"}]}],null]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$15\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"YRLT_dWnNGA0kvsTREpEW\"}\n9:C\n10:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n16:I[86869,[],\"IconMark\"]\nd:null\n13:[[\"$\",\"title\",\"0\",{\"children\":\"AnnoVibe\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"AI-native bioinformatics workspace by Annoroad\"}],[\"$\",\"link\",\"2\",{\"rel\":\"shortcut icon\",\"href\":\"/icon.svg\",\"type\":\"image/svg+xml\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/icon.svg\",\"type\":\"image/svg+xml\"}],[\"$\",\"$L16\",\"4\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en" class="__variable_9e44ca"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/7deddc85b7ffd1dc-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/ec14413c594b3356-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/9bcd6051db4f8890.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/d68ecb6695873888.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-36fa69ae1e15e7ce.js"/><script src="/_next/static/chunks/4bd1b696-8cd12253b448cc13.js" async=""></script><script src="/_next/static/chunks/3794-fba3f76785a3c234.js" async=""></script><script src="/_next/static/chunks/main-app-a8a207cb34d209aa.js" async=""></script><script src="/_next/static/chunks/app/layout-31265427e43f6876.js" async=""></script><script src="/_next/static/chunks/app/error-6309e3e4cdf79d40.js" async=""></script><script src="/_next/static/chunks/app/global-error-7595c826cec2c048.js" async=""></script><meta name="robots" content="noindex"/><title>AnnoVibe</title><meta name="description" content="AI-native bioinformatics workspace by Annoroad"/><link rel="shortcut icon" href="/icon.svg" type="image/svg+xml"/><link rel="icon" href="/icon.svg" type="image/svg+xml"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><script>(self.__next_s=self.__next_s||[]).push([0,{"children":"(function(){try{var t=localStorage.getItem(\"pi-theme\");if(t===\"dark\")document.documentElement.classList.add(\"dark\")}catch(e){}})();","id":"theme-init"}])</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body style="height:100dvh;display:flex;flex-direction:column"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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="/_next/static/chunks/webpack-36fa69ae1e15e7ce.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:\"static/chunks/app/layout-31265427e43f6876.js\"\n3:I[42593,[\"7177\",\"$2\"],\"\"]\n4:I[57121,[],\"\"]\n5:\"static/chunks/app/error-6309e3e4cdf79d40.js\"\n6:I[87460,[\"8039\",\"$5\"],\"default\"]\n7:I[74581,[],\"\"]\nb:I[90484,[],\"OutletBoundary\"]\nc:\"$Sreact.suspense\"\ne:\"ViewportBoundary\"\nf:I[90484,[],\"$e\"]\n11:\"MetadataBoundary\"\n12:I[90484,[],\"$11\"]\n14:\"static/chunks/app/global-error-7595c826cec2c048.js\"\n15:I[54690,[\"4219\",\"$14\"],\"default\"]\n:HL[\"/_next/static/media/7deddc85b7ffd1dc-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/ec14413c594b3356-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/9bcd6051db4f8890.css\",\"style\"]\n:HL[\"/_next/static/css/d68ecb6695873888.css\",\"style\"]\n9:X\na:[[\"children\",{\"s\":\"__PAGE__\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"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.\"}]}]]}]}]],null,[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$c\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@d\"}]}]]}],\"p\":false,\"v\":null}}]]\n8:[[\"children\",{\"s\":\"_not-found\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$9\"},\"c\":\"$Qa\"}]]\n0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9bcd6051db4f8890.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/d68ecb6695873888.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_9e44ca\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"$L3\",null,{\"id\":\"theme-init\",\"strategy\":\"beforeInteractive\",\"children\":\"(function(){try{var t=localStorage.getItem(\\\"pi-theme\\\");if(t===\\\"dark\\\")document.documentElement.classList.add(\\\"dark\\\")}catch(e){}})();\"}]}],[\"$\",\"body\",null,{\"style\":{\"height\":\"100dvh\",\"display\":\"flex\",\"flexDirection\":\"column\"},\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$6\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}],\"p\":false,\"v\":null},\"c\":\"$Q8\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$Lf\",null,{\"children\":\"$L10\"}],[\"$\",\"$L12\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$c\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L13\"}]}],null]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$15\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"rPVMly3awjAYAgBD6W0mU\"}\n9:C\n10:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n16:I[86869,[],\"IconMark\"]\nd:null\n13:[[\"$\",\"title\",\"0\",{\"children\":\"AnnoVibe\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"AI-native bioinformatics workspace by Annoroad\"}],[\"$\",\"link\",\"2\",{\"rel\":\"shortcut icon\",\"href\":\"/icon.svg\",\"type\":\"image/svg+xml\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/icon.svg\",\"type\":\"image/svg+xml\"}],[\"$\",\"$L16\",\"4\",{}]]\n"])</script></body></html>
@@ -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-36fa69ae1e15e7ce.js"/><script src="/_next/static/chunks/4bd1b696-8cd12253b448cc13.js" async=""></script><script src="/_next/static/chunks/3794-fba3f76785a3c234.js" async=""></script><script src="/_next/static/chunks/main-app-a8a207cb34d209aa.js" async=""></script><script src="/_next/static/chunks/app/error-6309e3e4cdf79d40.js" async=""></script><script src="/_next/static/chunks/app/global-error-7595c826cec2c048.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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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-36fa69ae1e15e7ce.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:\"static/chunks/app/error-6309e3e4cdf79d40.js\"\n4:I[87460,[\"8039\",\"$3\"],\"default\"]\n5:I[74581,[],\"\"]\n9:I[90484,[],\"OutletBoundary\"]\na:\"$Sreact.suspense\"\nc:\"ViewportBoundary\"\nd:I[90484,[],\"$c\"]\nf:\"MetadataBoundary\"\n10:I[90484,[],\"$f\"]\n12:\"static/chunks/app/global-error-7595c826cec2c048.js\"\n13:I[54690,[\"4219\",\"$12\"],\"default\"]\n6:X\n8:[[\"children\",{\"s\":\"__PAGE__\",\"h\":528,\"d\":{\"r\":[\"$\",\"$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,[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@b\"}]}]]}],\"p\":false,\"v\":null}}]]\n7:[[\"children\",{\"s\":\"_global-error\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$6\"},\"c\":\"$Q8\"}]]\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$4\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$6\"},\"c\":\"$Q7\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Ld\",null,{\"children\":\"$Le\"}],[\"$\",\"$L10\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L11\"}]}],null]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$13\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"YRLT_dWnNGA0kvsTREpEW\"}\n6:C\ne:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nb:null\n11:[]\n"])</script></body></html>
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-36fa69ae1e15e7ce.js"/><script src="/_next/static/chunks/4bd1b696-8cd12253b448cc13.js" async=""></script><script src="/_next/static/chunks/3794-fba3f76785a3c234.js" async=""></script><script src="/_next/static/chunks/main-app-a8a207cb34d209aa.js" async=""></script><script src="/_next/static/chunks/app/error-6309e3e4cdf79d40.js" async=""></script><script src="/_next/static/chunks/app/global-error-7595c826cec2c048.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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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-36fa69ae1e15e7ce.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:\"static/chunks/app/error-6309e3e4cdf79d40.js\"\n4:I[87460,[\"8039\",\"$3\"],\"default\"]\n5:I[74581,[],\"\"]\n9:I[90484,[],\"OutletBoundary\"]\na:\"$Sreact.suspense\"\nc:\"ViewportBoundary\"\nd:I[90484,[],\"$c\"]\nf:\"MetadataBoundary\"\n10:I[90484,[],\"$f\"]\n12:\"static/chunks/app/global-error-7595c826cec2c048.js\"\n13:I[54690,[\"4219\",\"$12\"],\"default\"]\n6:X\n8:[[\"children\",{\"s\":\"__PAGE__\",\"h\":528,\"d\":{\"r\":[\"$\",\"$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,[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@b\"}]}]]}],\"p\":false,\"v\":null}}]]\n7:[[\"children\",{\"s\":\"_global-error\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$6\"},\"c\":\"$Q8\"}]]\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$4\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$6\"},\"c\":\"$Q7\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Ld\",null,{\"children\":\"$Le\"}],[\"$\",\"$L10\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L11\"}]}],null]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$13\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"rPVMly3awjAYAgBD6W0mU\"}\n6:C\ne:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nb:null\n11:[]\n"])</script></body></html>
@@ -1,5 +1,5 @@
1
1
  {
2
- "previewModeId": "8d55678e90da8e2a76e553304acb67dc",
3
- "previewModeSigningKey": "5b08834a88ae30d4d20074b54b4c783541505b6f5fe61d608d1c0e02d807caaa",
4
- "previewModeEncryptionKey": "bf2b6602b5cc7992295a58724d745007dc3d0535956a238d980eace5cbeebed1"
2
+ "previewModeId": "6b3585a6b2aea07766440a277857f643",
3
+ "previewModeSigningKey": "ac2092a92d550ab174a02c7af4c0c58f22149f8530dc6d16c0695549b8256266",
4
+ "previewModeEncryptionKey": "f4c38779122b75d73d1ea10cc47c472ee6133406538664def50e5eb643e03ffc"
5
5
  }
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"l61PLiex9pMyQYSHUK5fQ1RSX3rVvjr2xgxPqBAivVY="}
1
+ {"node":{},"edge":{},"encryptionKey":"5nFMzULZOxFYA5AKW+rWtNeGvxQSnsSSaKa6lfA/lqE="}
@@ -0,0 +1,22 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3824],{14755:(e,t,n)=>{n.d(t,{ES:()=>d,IB:()=>p,SN:()=>a,tE:()=>f});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){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 p(e){return a.filter(t=>e.some(e=>e.active&&e.name===t))}function f(e,t){return[...new Set([...function(e){switch(e){case"none":return o;case"default":return s;case"workbench":return i;case"agent":return u;default:return l}}(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 f(){s||0===r.size||(p(),s=setInterval(()=>{p()},5e3))}function m(){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 f();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?f():"running"===t.type&&Array.isArray(t.runningSessionIds)&&(l&&clearTimeout(l),l=null,m(),d(t.runningSessionIds.filter(e=>"string"==typeof e)))},o.onerror=()=>f(),o.port.start(),o.port.postMessage({type:"subscribe"}),l=setTimeout(()=>f(),3e3)}catch{o=null,f()}}}function h(){if(u){if(u=!1,l&&clearTimeout(l),l=null,m(),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)))}}},63824:(e,t,n)=>{n.d(t,{T:()=>Q});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}}let s={isStreaming:!1,streamingMessage:null};function l(){return{role:"assistant",content:[],model:"",provider:"",timestamp:Date.now()}}function i(e,t,n){if(!Number.isInteger(t)||void 0===t||t<0)return e;let r=e.streamingMessage??l(),a=[...r.content],o=n(a[t]);return o?(a[t]=o,{isStreaming:!0,streamingMessage:{...r,content:a}}):e}function u(e){if(e.id||e.toolName)return{...e.id?{id:e.id}:{},...e.toolName?{toolName:e.toolName}:{}};let t=e.partial,n=e.contentIndex;if(!t||!Array.isArray(t.content)||void 0===n)return{};let r=t.content[n];return r&&"toolCall"===r.type?{..."string"==typeof r.id?{id:r.id}:"string"==typeof r.toolCallId?{id:r.toolCallId}:{},..."string"==typeof r.name?{toolName:r.name}:"string"==typeof r.toolName?{toolName:r.toolName}:{}}:{}}function c(e,t){switch(t.type){case"start":return{isStreaming:!0,streamingMessage:null};case"snapshot":return"assistant"===t.message.role?{isStreaming:!0,streamingMessage:t.message}:e;case"delta":var n=t.event;switch(n.type){case"start":return{isStreaming:!0,streamingMessage:e.streamingMessage??l()};case"text_start":return i(e,n.contentIndex,e=>e?.type==="text"?e:{type:"text",text:""});case"text_delta":return i(e,n.contentIndex,e=>({type:"text",text:(e?.type==="text"?e.text:"")+(n.delta??"")}));case"text_end":return i(e,n.contentIndex,e=>({type:"text",text:n.content??(e?.type==="text"?e.text:"")}));case"thinking_start":return i(e,n.contentIndex,e=>e?.type==="thinking"?e:{type:"thinking",thinking:""});case"thinking_delta":return i(e,n.contentIndex,e=>({type:"thinking",thinking:(e?.type==="thinking"?e.thinking:"")+(n.delta??"")}));case"thinking_end":return i(e,n.contentIndex,e=>({type:"thinking",thinking:n.content??(e?.type==="thinking"?e.thinking:"")}));case"toolcall_start":return i(e,n.contentIndex,e=>{let t=u(n);return e?.type==="toolCall"?{...e,...t.id?{toolCallId:t.id}:{},...t.toolName?{toolName:t.toolName}:{},rawInput:e.rawInput??""}:{type:"toolCall",toolCallId:t.id??"",toolName:t.toolName??"tool",input:{},rawInput:""}});case"toolcall_delta":return i(e,n.contentIndex,e=>{let t=u(n),r=e?.type==="toolCall"?e:{type:"toolCall",toolCallId:t.id??"",toolName:t.toolName??"tool",input:{}};return{...r,...t.id?{toolCallId:t.id}:{},...t.toolName?{toolName:t.toolName}:{},rawInput:(r.rawInput??"")+(n.delta??"")}});case"toolcall_end":return i(e,n.contentIndex,()=>({type:"toolCall",toolCallId:n.toolCall?.id??"",toolName:n.toolCall?.name??"tool",input:n.toolCall?.arguments??{}}));default:return e}case"end":case"reset":return s;default:return e}}function d(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function p(e){if("assistant"!==e.role)return null;let t=e.timestamp;return"number"!=typeof t?null:`assistant:${t}`}class f extends Error{constructor(e,t,n){super(e),this.status=t,this.code=n,this.name="AgentCommandError"}}async function m(e,t){let n=await fetch(`/api/agent/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await n.json().catch(()=>({}));if(!n.ok||r.error)throw new f(r.error??`HTTP ${n.status}`,n.status,r.code);return r.data}var g=n(28999);async function h(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 y(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 w=n(16865);let k="__annovibeStreamSessions__",v="__annovibeStreamListeners__",b="__annovibeStreamErrorCallbacks__";function C(){let e=globalThis;return e[k]||(e[k]=new Map),e[k]}function x(){let e=globalThis;return e[b]||(e[b]=new Map),e[b]}function _(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 I(e,t){let n;for(let r of(!(n=globalThis)[v]&&(n[v]=new Map),n[v]).get(e)??[])try{r(t)}catch{}}function T(e){e.textThrottleTimer&&(clearTimeout(e.textThrottleTimer),e.textThrottleTimer=null),e.textDirty&&(e.textDirty=!1,M(e))}function S(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,M(e))},100));return}T(e),M(e)}function M(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},I(e.snapshot.sessionId,{type:"snapshot-updated",snapshot:e.snapshot})}function E(e){A(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){R(e),T(e);let t="Stream idle timeout — no activity for 180s.";e.snapshot={...e.snapshot,phase:"error",isStreaming:!1,streamingMessage:null,statusText:null,error:t},A(e),I(e.snapshot.sessionId,{type:"error",snapshot:e.snapshot});let n=x().get(e.snapshot.sessionId);if(n)try{n(e.snapshot.sessionId,t)}catch{}}},1e4)}function A(e){e.idleCheckTimer&&(clearInterval(e.idleCheckTimer),e.idleCheckTimer=null)}function R(e){e.toolProgressTimer&&(clearInterval(e.toolProgressTimer),e.toolProgressTimer=null)}function $(e){let t=C(),n=t.get(e);return n||(n={snapshot:_(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 N(e,t){let n=x();return n.set(e,t),()=>{n.get(e)===t&&n.delete(e)}}function D(e){let t=C(),n=t.get(e);n&&(R(n),A(n),T(n)),t.delete(e)}function L(e){let t=C().get(e);t&&(t.snapshot={...t.snapshot,reconnectCount:t.snapshot.reconnectCount+1,lastSyncReason:"sse-reconnect",lastEventAt:Date.now()},S(t,!0))}let U="__annovibeSessionMessageCache__";function P(){let e=globalThis;if(!e[U]){var t;let n={entries:new Map,cleanupTimer:null};e[U]=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[U]}function j(e){let t=P(),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 O(e,t,n,r,a){let o=P(),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 F(e){P().entries.delete(e)}var q=n(14755);function H(e){return{steering:e?.steering??[],followUp:e?.followUp??[]}}let B=[500,1500,3e3];function W(e,t){return new DOMException(e,t)}function J(){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)}`}function K(e,t){return e.trim()||0!==t?`text:${e}|images:${t}`:null}function z(e){return"string"==typeof e?K(e,0):Array.isArray(e)?K(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 G(e){let t=new Map;for(let n of e){let e="user"!==n.role?null:z(n.content);e&&t.set(e,(t.get(e)??0)+1)}return t}function V(e,t,n){return e.sessionId===t&&(!e.leafId||n.includes(e.leafId))}function Y(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 Q(e){let{session:t,newSessionCwd:n,onAgentEnd:l,onSessionCreated:i,onSessionForked:u,modelsRefreshKey:k,onBranchDataChange:v,chatInputRef:b}=e,x=null===t&&null!==n,[M,U]=(0,r.useState)(null),[Q,X]=(0,r.useState)(!x),[Z,ee]=(0,r.useState)(null),[et,en]=(0,r.useState)(null),[er,ea]=(0,r.useState)([]),[eo,es]=(0,r.useState)([]),[el,ei]=(0,r.useState)(0),[eu,ec]=(0,r.useState)(!1),[ed,ep]=(0,r.useState)(0),[ef,em]=(0,r.useReducer)(c,s),[eg,eh]=(0,r.useState)(!1),[ey,ew]=(0,r.useState)({}),[ek,ev]=(0,r.useState)([]),[eb,eC]=(0,r.useState)({}),[ex,e_]=(0,r.useState)({}),[eI,eT]=(0,r.useState)(null),[eS,eM]=(0,r.useState)("full"),[eE,eA]=(0,r.useState)([...q.SN]),[eR,e$]=(0,r.useState)([]),[eN,eD]=(0,r.useState)("auto"),[eL,eU]=(0,r.useState)(null),[eP,ej]=(0,r.useState)(null),[eO,eF]=(0,r.useState)(null),[eq,eH]=(0,r.useState)(null),[eB,eW]=(0,r.useState)(null),[eJ,eK]=(0,r.useState)(null),[ez,eG]=(0,r.useState)(!1),[eV,eY]=(0,r.useState)(null),[eQ,eX]=(0,r.useState)(null),[eZ,e0]=(0,r.useState)(null),[e1,e3]=(0,r.useState)({steering:[],followUp:[]}),[e4,e5]=(0,r.useState)(null),e6=(0,r.useRef)(null),e2=(0,r.useRef)(t?.id??null),{statuses:e8,widgets:e7,dialog:e9,notices:te,applyFromState:tt,handleEvent:tn,respond:tr,dismissNotice:ta}=function({chatInputRef:e,sessionIdRef:t,onError:n,noticeTtlMs:a=8e3}){let[o,s]=(0,r.useState)([]),[l,i]=(0,r.useState)([]),[u,c]=(0,r.useState)(null),[d,p]=(0,r.useState)([]),f=(0,r.useRef)(new Set),g=(0,r.useCallback)(()=>{for(let e of f.current)clearTimeout(e);f.current.clear()},[]);(0,r.useEffect)(()=>g,[g]);let h=(0,r.useCallback)((e,t)=>{let n={id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,message:e,type:t};p(e=>[...e,n].slice(-4));let r=setTimeout(()=>{f.current.delete(r),p(e=>e.filter(e=>e.id!==n.id))},a);f.current.add(r)},[a]),y=(0,r.useCallback)(e=>{e&&(Array.isArray(e.extensionStatuses)&&s(e.extensionStatuses),Array.isArray(e.extensionWidgets)&&i(e.extensionWidgets))},[]),w=(0,r.useCallback)(t=>{if("extension_error"===t.type)return h("string"==typeof t.error?t.error:"Extension command failed","error"),!0;if("extension_ui_request"!==t.type)return!1;let n="string"==typeof t.method?t.method:"";if("select"===n||"confirm"===n||"input"===n||"editor"===n)return c({id:String(t.id??""),method:n,title:"string"==typeof t.title?t.title:"",...Array.isArray(t.options)?{options:t.options}:{},..."string"==typeof t.message?{message:t.message}:{},..."string"==typeof t.placeholder?{placeholder:t.placeholder}:{},..."string"==typeof t.prefill?{prefill:t.prefill}:{}}),!0;if("notify"===n){let e="warning"===t.notifyType||"error"===t.notifyType?t.notifyType:"info";return h(String(t.message??""),e),!0}if("setStatus"===n){let e=String(t.statusKey??"");if(!e)return!0;let n="string"==typeof t.statusText?t.statusText:null;return s(t=>{let r=t.filter(t=>t.key!==e);return n?[...r,{key:e,text:n}]:r}),!0}if("setWidget"===n){let e=String(t.widgetKey??"");if(!e)return!0;let n=Array.isArray(t.widgetLines)?t.widgetLines.filter(e=>"string"==typeof e):null;return i(r=>{let a=r.filter(t=>t.key!==e);return n&&n.length>0?[...a,{key:e,lines:n,placement:"string"==typeof t.widgetPlacement?t.widgetPlacement:"aboveEditor"}]:a}),!0}return"dismiss"===n?c(e=>e?.id===t.id?null:e):"set_editor_text"===n&&"string"==typeof t.text?e?.current?.setText?.(t.text):"setTitle"===n&&"string"==typeof t.title&&(document.title=t.title),!0},[e,h]),k=(0,r.useCallback)(async(e,r)=>{let a=t.current;if(c(t=>t?.id===e?null:t),a)try{await m(a,{type:"extension_ui_response",id:e,...r})}catch(e){n(e instanceof Error?e.message:String(e))}},[n,t]);return{statuses:o,widgets:l,dialog:u,notices:d,applyFromState:y,handleEvent:w,respond:k,dismissNotice:(0,r.useCallback)(e=>{p(t=>t.filter(t=>t.id!==e))},[]),reset:(0,r.useCallback)(()=>{g(),s([]),i([]),c(null),p([])},[g])}}({chatInputRef:b,sessionIdRef:e2,onError:e5}),to=(0,r.useRef)(!1),{live:ts,running:tl,isRunning:ti,begin:tu,finish:tc,handleEvent:td}=function({onRunningChange:e,onDone:t,flushMs:n=60}={}){let[a,o]=(0,r.useState)(null),[s,l]=(0,r.useState)(!1),i=(0,r.useRef)(!1),u=(0,r.useRef)(""),c=(0,r.useRef)(null),d=(0,r.useCallback)(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]);(0,r.useEffect)(()=>d,[d]);let p=(0,r.useCallback)(t=>{d(),u.current="",i.current=!0,l(!0),o({command:t,output:""}),e?.(!0,t)},[d,e]),f=(0,r.useCallback)(()=>{d(),u.current="",i.current=!1,l(!1),o(null),e?.(!1)},[d,e]);return{live:a,running:s,isRunning:(0,r.useCallback)(()=>i.current,[]),begin:p,finish:f,handleEvent:(0,r.useCallback)(r=>{if("bash_execution_start"===r.type){let t=String(r.command??"");return d(),u.current="",i.current=!0,l(!0),o({command:t,output:""}),e?.(!0,t),!0}if("bash_execution_update"===r.type){let e="string"==typeof r.chunk?r.chunk:"";return!e||(u.current+=e,c.current||(c.current=setTimeout(()=>{c.current=null;let e=u.current;u.current="",e&&o(t=>t?{...t,output:t.output+e}:t)},n)),!0)}return"bash_done"===r.type&&(d(),u.current="",i.current=!1,l(!1),o(null),e?.(!1),t?.(),!0)},[d,n,t,e])}}({onRunningChange:(e,t)=>{to.current=e,eh(e),e0(e?{kind:"running_tools",tools:[{id:"bash",name:"bash",args:t}]}:null)}}),tp=(0,r.useRef)(null),tf=(0,r.useRef)(null),tm=(0,r.useRef)(null),tg=(0,r.useRef)(!1),th=(0,r.useRef)(null),ty=(0,r.useRef)(!1),tw=(0,r.useRef)(null),tk=(0,r.useRef)(null),tv=(0,r.useRef)(new Map),tb=(0,r.useRef)(new Map),tC=(0,r.useRef)(new Map),tx=(0,r.useRef)(new Map),t_=(0,r.useRef)(null),tI=(0,r.useRef)([]),tT=(0,r.useRef)(null),tS=(0,r.useRef)(0),tM=(0,r.useRef)(!1),tE=(0,r.useRef)(0),tA=(0,r.useRef)(!1),tR=(0,r.useRef)(!1),t$=(0,r.useRef)(0),tN=(0,r.useRef)(null),tD=(0,r.useRef)(null),tL=(0,r.useRef)(0),tU=(0,r.useRef)(!1);(0,r.useEffect)(()=>{t_.current=et},[et]),(0,r.useEffect)(()=>{tU.current=ef.isStreaming},[ef.isStreaming]),(0,r.useEffect)(()=>{tx.current.clear()},[t?.id]);let tP=e.setNewSessionModel??eT,tj=e.setToolPreset??eM,tO=e.setMemoryTools??eA,tF=eB??M?.context.model??eJ??null,tq=x?eI:tF,tH=(0,r.useCallback)(()=>(0,q.tE)(eS,eE),[eE,eS]),tB=(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"):"",[]),tW=(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})`)},[]),tJ=(()=>{let e={input:0,output:0,cacheRead:0,cacheWrite:0};for(let t of er){if("assistant"!==t.role)continue;let n=t.usage;n&&(e.input+=n.input??0,e.output+=n.output??0,e.cacheRead+=n.cacheRead??0,e.cacheWrite+=n.cacheWrite??0)}return e.input+e.output+e.cacheRead+e.cacheWrite>0?{tokens:e}:null})(),tK=(0,r.useRef)(!1),tz=(0,r.useCallback)(async()=>{let e=e2.current;if(!e||tK.current||tA.current)return;tK.current=!0,tM.current=!0;let t=0,n=j(e);t=n?n.loadedMessagesCount:50;try{for(;;)try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}?limit=100&offset=${t}&deferThinking=1&deferMedia=1`);if(!n.ok)break;let r=await n.json();if(e2.current!==e)break;let a=r.context.messages,o=r.context.entryIds??[];if(0===a.length)break;ea(e=>[...a,...e]),es(e=>{let t=[...o,...e];return tI.current=t,t});let s=t+a.length;if(ep(s),tE.current=s,ec(r.hasMore??!1),O(e,a,o,r.hasMore??!1,s),t=s,!r.hasMore)break;await new Promise(e=>setTimeout(e,800))}catch{break}}finally{tK.current=!1,tA.current=!0,tM.current=!1}},[]),tG=(0,r.useCallback)(async(e,t=!1,n=!1,r=!1)=>{var a;let o=null;try{if(t&&X(!0),!n&&!to.current&&!r){let n=j(e);if(n)return ei(n.totalMessages),ec(n.hasMore),ep(n.loadedMessagesCount),ea(n.messages),tI.current=n.entryIds,es(n.entryIds),t_.current=n.leafId,en(n.leafId),tE.current=n.loadedMessagesCount,t&&X(!1),n.hasMore&&!tA.current&&setTimeout(()=>{tz()},1500),null}let s=n?`/api/sessions/${encodeURIComponent(e)}?includeState&deferThinking=1&deferMedia=1`:`/api/sessions/${encodeURIComponent(e)}?limit=50&offset=0&deferThinking=1&deferMedia=1`,l=tD.current;if(l?.sid===e&&!t)return null;l?.controller.abort(W("Session load superseded","AbortError"));let i=new AbortController;o=i,tD.current={sid:e,controller:i};let u=setTimeout(()=>{i.abort(W("Session load timed out after 30 seconds","TimeoutError"))},3e4),c=await fetch(s,{signal:i.signal}).finally(()=>clearTimeout(u));if(e2.current&&e2.current!==e)return null;if(404===c.status)return t&&(U(null),t_.current=null,en(null),ea([]),ee(null)),null;if(!c.ok)throw Error(`HTTP ${c.status}`);let d=await c.json();n?(ei(d.totalMessages??d.context.messages.length),ec(!1)):(ei(d.totalMessages??d.context.messages.length),ec(d.hasMore??!1)),ep(d.context.messages.length),U(d),t_.current=d.leafId,en(d.leafId);let f=d.context.messages,m=G(f),g=new Map,h=Date.now();for(let[t,n]of tv.current)if(n.sessionId===e){if(h-n.createdAt>12e4){tv.current.delete(t);continue}if(n.confirmKey){let e=m.get(n.confirmKey)??0,r=g.get(n.confirmKey)??0;e-r>n.confirmCountAtCreate&&(tv.current.delete(t),g.set(n.confirmKey,r+1))}}tb.current=m;let y=d.context.entryIds??[],w=[...tv.current.values()].filter(t=>V(t,e,y)).map(e=>e.message),k=w.length>0?[...f,...w]:f,v=function(e,t,n){if(0===t.size)return e;let r=!1,a=e.map(e=>{let a=p(e);if(!a)return e;let o=t.get(a);return o?n-o.observedAt>5e3||function(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}}(o.message,e)?(t.delete(a),e):(r=!0,o.message):e});return r?a:e}(k,tx.current,Date.now()),b=tC.current.get(e);if(b){for(let[e,t]of b)h-t>12e4&&b.delete(e);0===b.size&&tC.current.delete(e)}let C=b?.size?b:null,x=C?new Set(y):null,_=!!C&&!!x&&[...C.keys()].some(e=>!x.has(e));C&&x&&!_&&tC.current.delete(e);let I=v.length;return!n&&(tE.current>I||_)?(ei(d.totalMessages??d.context.messages.length),ec(d.hasMore??!1)):(ea(e=>(function(e,t){if(e.length!==t.length)return t;let n=!1,r=t.map((t,r)=>Y(e[r],t)?e[r]:(n=!0,t));return n?r:e})(e,v)),tI.current=y,es(y),n?tE.current=I:tE.current=Math.max(tE.current,I),a={sessionId:e,leafId:d.leafId,messages:v,entryIds:y,totalMessages:d.totalMessages??d.context.messages.length,hasMore:!n&&(d.hasMore??!1),loadedMessagesCount:d.context.messages.length},P().entries.set(e,{...a,loadedAt:Date.now()})),eW(e=>{if(!e)return null;let t=d.context.model;return t?.provider===e.provider&&t.modelId===e.modelId?null:e}),ee(null),!d.agentState?.state?.thinkingLevel&&d.context.thinkingLevel&&"off"!==d.context.thinkingLevel&&eD(d.context.thinkingLevel),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 ee(String(e)),null}finally{o&&tD.current?.controller===o&&(tD.current=null),t&&X(!1)}},[tz]),tV=(0,r.useRef)(!1),tY=(0,r.useCallback)(async()=>{if(tV.current)return;tV.current=!0;let e=e2.current;if(!e){tV.current=!1;return}try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}?limit=50&offset=${ed}&deferThinking=1&deferMedia=1`);if(!t.ok)return;let n=await t.json(),r=n.context.messages,a=n.context.entryIds??[];ea(e=>[...r,...e]),es(e=>{let t=[...a,...e];return tI.current=t,t}),ep(e=>e+r.length),ec(n.hasMore??!1),O(e,r,a,n.hasMore??!1,ed+r.length)}catch{}finally{tV.current=!1}},[ed]),tQ=(0,r.useCallback)(async e=>{let t=e2.current;if(!t)return[];let n=t_.current,r=n?`?leafId=${encodeURIComponent(n)}`:"";try{let n=await fetch(`/api/sessions/${encodeURIComponent(t)}/shadowed${r}`);if(!n.ok)return[];let a=await n.json(),o=a.groups?.find(t=>t.compactionEntryId===e);return o?.messages??[]}catch{return[]}},[]),tX=(0,r.useCallback)(async(e,t)=>{try{let n=t?`/api/sessions/${encodeURIComponent(e)}/context?leafId=${encodeURIComponent(t)}&deferThinking=1&deferMedia=1`:`/api/sessions/${encodeURIComponent(e)}/context?deferThinking=1&deferMedia=1`,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=G(o),i=new Map,u=Date.now();for(let[t,n]of tv.current)if(n.sessionId===e){if(u-n.createdAt>12e4){tv.current.delete(t);continue}if(n.confirmKey){let e=l.get(n.confirmKey)??0,r=i.get(n.confirmKey)??0;e-r>n.confirmCountAtCreate&&(tv.current.delete(t),i.set(n.confirmKey,r+1))}}tb.current=l;let c=[...tv.current.values()].filter(t=>V(t,e,s)).map(e=>e.message);ea(c.length>0?[...o,...c]:o),tI.current=s,es(s)}catch(e){console.error("Failed to load context:",e)}},[]),tZ=(0,r.useCallback)(async e=>{try{let t=await m(e,{type:"get_tools"});t&&(tj((0,q.ES)(t)),tO((0,q.IB)(t)))}catch(e){console.error("Failed to load tools:",e)}},[tO,tj]),t0=(0,r.useCallback)(async e=>{try{let t=await m(e,{type:"get_commands"});e$(Array.isArray(t?.commands)?t.commands:[])}catch{e$([])}},[]),t1=(0,r.useCallback)((e,t={})=>{e6.current?.close(),e6.current=null;let n=`/api/agent/${encodeURIComponent(e)}/events${t.replay?"?replay=1":""}`;return!function(e){let t=$(e);if("active"===t.snapshot.phase)return S(t,!0),E(t),t.snapshot;let n=Date.now();t.snapshot={..._(e),phase:"active",startedAt:n,lastEventAt:n,isStreaming:!0,streamingMessage:{role:"assistant",content:[]}},E(t),S(t,!0),t.snapshot}(e),new Promise((r,a)=>{let o=!1,s=!1,l=null,i=e=>{if(!o){if(o=!0,clearTimeout(u),e){l?.close(),e6.current===l&&(e6.current=null),a(e);return}r()}},u=setTimeout(()=>{t.requireConnected?i(Error("Timed out waiting for event stream connection")):i()},t.timeoutMs??3e4);e6.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,u="idle",c=new AbortController,d=0,p=null,f=null,m=!1,g=(e,t)=>{t&&(f=t),n(e,t)},h=e=>{u!==e&&(u=e,r?.(e))},w=()=>{null!==p&&(clearTimeout(p),p=null)},k=()=>{if(m)return;if(!i)return void h("error");if(d>=o){h("error"),a?.(Error(`Max reconnect attempts (${o}) reached`));return}let e=Math.min(l,s*2**d);d+=1,h("connecting"),p=setTimeout(()=>{p=null,v()},e)},v=async()=>{if(!m){w(),c=new AbortController,h("connecting");try{let e=await fetch(t,{signal:c.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(h("connected"),d=0,await y(r,g,c.signal),c.signal.aborted)try{await r.cancel()}catch{}r.releaseLock(),h("closed"),!m&&i&&k()}catch(e){if(m||e instanceof DOMException&&"AbortError"===e.name)return void h("closed");h("error"),i&&k()}}};return{get state(){return u},connect:()=>{m=!1,d=0,w(),v()},close:()=>{m=!0,w(),c.abort(),h("closed")},get abortController(){return c}}}({url:n,onEvent:t=>{try{let n=JSON.parse(t);if("connected"===n.type&&i(),e2.current!==e)return;tp.current?.(n)}catch{}},onStateChange:t=>{!function(e,t){let n=C().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()},E(n)),"connected"!==t&&"connected"===r&&A(n)}(e,t),"connected"===t&&(s&&(L(e),tf.current?.(e,"sse_reconnected")),s=!0)},reconnectBaseMs:1e3,reconnectMaxMs:3e4}),l.connect()})},[]),t3=(0,r.useCallback)(async(e,t="manual")=>{if(!e||e2.current!==e)return;let n=tS.current;try{let t=await fetch(`/api/agent/${encodeURIComponent(e)}`),r=await t.json().catch(()=>({}));if(e2.current!==e||tS.current!==n)return;r.running?(to.current=!0,eh(!0),e0(a(r.state)),e6.current&&"closed"!==e6.current.state&&"error"!==e6.current.state||(L(e),t1(e,{replay:!0}))):(to.current=!1,e6.current?.close(),e6.current=null,D(e),eh(!1),e0(null),eU(null),em({type:"end"}),F(e),await tG(e,!1,!1,!0)),r.state?.contextUsage!==void 0&&ej(r.state.contextUsage??null),r.state?.systemPrompt!==void 0&&eF(r.state.systemPrompt??null),r.state?.isCompacting!==void 0&&eG(r.state.isCompacting),r.state?.thinkingLevel!==void 0&&eD(r.state.thinkingLevel??"auto"),r.state?.queuedMessages!==void 0&&e3(H(r.state.queuedMessages)),tt(r.state),r.state?.isBashRunning&&tu("")}catch{}},[t1,tG,tt,tu]);(0,r.useEffect)(()=>{tf.current=t3},[t3]),(0,r.useEffect)(()=>{to.current=eg},[eg]),tp.current=(0,r.useCallback)(e=>{let t=e2.current;switch(t&&function(e,t){let n=$(e),r=Date.now();switch(t.type){case"agent_start":if("active"===n.snapshot.phase)return S(n,!0),n.snapshot;return R(n),n.accumulatedText="",n.toolCalls.clear(),n.toolResults.clear(),n.activeToolId=null,n.snapshot={..._(e),phase:"active",startedAt:r,lastEventAt:r,isStreaming:!0,streamingMessage:{role:"assistant",content:[]}},E(n),S(n,!0),n.snapshot;case"message_update":{let e=t.message;if(e?.role==="assistant"){let t=e.content;for(let e of Array.isArray(t)?t:[])"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}))}else{let e=t.assistantMessageEvent;e?.type==="text_delta"?n.accumulatedText+=e.delta??"":e?.type==="text_end"?n.accumulatedText=e.content??n.accumulatedText:(e?.type==="toolcall_start"||e?.type==="toolcall_delta")&&e.id&&!n.toolCalls.has(e.id)&&n.toolCalls.set(e.id,{type:"toolCall",toolCallId:e.id,toolName:e.toolName??"tool",input:{},startedAt:r})}return S(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&&Object.keys(s.input).length>0?s.input:o,startedAt:s?.startedAt??r}),n.activeToolId=e,R(n),n.activeToolId&&(n.toolProgressTimer=setInterval(()=>S(n,!0),1e3)),S(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,R(n))}return S(n,!0),n.snapshot}case"message_end":return T(n),S(n,!0),n.snapshot;case"agent_end":{if(T(n),R(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},E(n),I(e,{type:"snapshot-updated",snapshot:n.snapshot}),n.snapshot;A(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},I(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),"heartbeat"!==e.type&&(tL.current=Date.now()),e.type){case"prompt_admitted":case"agent_start":e5(null),to.current=!0,eh(!0),e0({kind:"waiting_model"}),em({type:"start"});break;case"agent_end":if(!0===e.willRetry){to.current=!0,eh(!0),e0({kind:"waiting_model"});break}if(to.current=!1,eh(!1),e0(null),eU(null),em({type:"end"}),t){tN.current&&clearTimeout(tN.current);let e=tS.current,n=0,r=async()=>{if(e2.current!==t||to.current||tS.current!==e)return;F(t),await tG(t,!1,!1,!0);let a=B[n++];void 0===a||e2.current!==t||to.current||tS.current!==e||(tN.current=setTimeout(()=>{tN.current=null,r()},a))};r(),fetch(`/api/agent/${encodeURIComponent(t)}`).then(e=>e.json()).then(e=>{e.state?.contextUsage!==void 0&&ej(e.state.contextUsage??null),e.state?.systemPrompt!==void 0&&eF(e.state.systemPrompt??null),e.state?.isCompacting!==void 0&&eG(e.state.isCompacting)}).catch(()=>{})}l?.();break;case"agent_settled":e0(null),eU(null),to.current&&(to.current=!1,eh(!1),em({type:"end"}));break;case"message_start":case"message_update":{let t=e.message;if(t?.role==="user")break;to.current||(to.current=!0,eh(!0),e0({kind:"waiting_model"}));let n=e.assistantMessageEvent;t?.role==="assistant"?em({type:"snapshot",message:o(t)}):n&&em({type:"delta",event:n}),e0(null);break}case"message_end":{let n=e.message,r="string"==typeof e.__entryId?e.__entryId:null,a=to.current;if(n&&"user"!==n.role){"assistant"===n.role&&"error"===n.stopReason&&n.errorMessage?.trim()&&e5(`Model response failed: ${n.errorMessage.trim()}`);let e=o(n),a=p(e);if(a&&tx.current.set(a,{observedAt:Date.now(),message:e}),!(r&&tI.current.includes(r))){if(t&&r){let e=tC.current.get(t)??new Map;e.set(r,Date.now()),tC.current.set(t,e)}ea(t=>t.some(t=>Y(t,e))?t:[...t,e]),r&&es(e=>{if(e.includes(r))return e;let t=[...e,r];return tI.current=t,t})}}a&&(em({type:"reset"}),e0({kind:"waiting_model"}));break}case"replay_gap":t&&(F(t),tG(t,!1,!1,!0));break;case"prompt_done":if(!to.current)break;t3(e2.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(to.current=!1,eh(!1),e0(null),eU(null),em({type:"end"}),e6.current?.close(),e6.current=null,t){for(let[e,n]of(D(t),tv.current))n.sessionId===t&&"prompt"===n.kind&&tv.current.delete(e);F(t),tG(t,!1,!1,!0)}e5(`Model request failed: ${n}`),l?.();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;e0(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_update":{let t=e.toolCallId,n=e.toolName,r=function(e){if(!d(e))return null;let t=e.content;if(!Array.isArray(t))return null;let n=t.filter(e=>d(e)&&"text"===e.type&&"string"==typeof e.text).map(e=>e.text).join("\n").split(/\r?\n/),r="";for(let e=n.length-1;e>=0&&!(r=n[e].trim());e-=1);if(!r)return null;let a=r.replace(/\s+/g," ");return a.length<=500?a:`...${a.slice(-497)}`}(e.partialResult);if(!t)break;e0(e=>{let a=e?.kind==="running_tools"?[...e.tools]:[],o=a.find(e=>e.id===t),s={id:t,name:n||o?.name||"tool",args:o?.args,progress:r??o?.progress};return{kind:"running_tools",tools:[...a.filter(e=>e.id!==t),s]}});break}case"tool_execution_end":{let t=e.toolCallId;e0(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"extension_ui_request":case"extension_error":tn(e);break;case"bash_execution_start":case"bash_execution_update":td(e);break;case"bash_done":{td(e);let t=e2.current;t&&(F(t),tG(t,!1,!1,!0));break}case"queue_update":e3(H({steering:Array.isArray(e.steering)?e.steering:[],followUp:Array.isArray(e.followUp)?e.followUp:[]}));break;case"auto_retry_start":e5(null),to.current=!0,eh(!0),e0({kind:"waiting_model"}),eU({attempt:e.attempt,maxAttempts:e.maxAttempts,errorMessage:e.errorMessage});break;case"auto_retry_end":eU(null),!1===e.success&&"string"==typeof e.finalError&&e.finalError.trim()?e5(`Model response failed after retries: ${e.finalError.trim()}`):!0===e.success&&e5(null);break;case"auto_compaction_start":case"compaction_start":eG(!0),eY(null);break;case"auto_compaction_end":case"compaction_end":eG(!1),e.errorMessage?eY(e.errorMessage):!e.aborted&&e2.current&&tG(e2.current)}},[tG,l,t3,tn,td]);let t4=(0,r.useCallback)(async(e,r,a,o)=>{if(!e.trim()&&!r?.length&&!a?.length||eg)return;tS.current+=1;let s=tB(a),l=e.trim()?s?`${e}
5
+
6
+ Attached document text:
7
+
8
+ ${s}`:e:s?`Attached document text:
9
+
10
+ ${s}`:"",u=[],c=x?n:t?.cwd??M?.info?.cwd;if(r?.length&&c)try{u=await h(c,r)}catch(e){e5(e instanceof Error?e.message:String(e));return}let d=u.length?u.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,g.HG)(t)}?type=read`),media_type:e.mimeType}}}):r?.map(e=>({type:"image",source:{type:"base64",media_type:e.mimeType,data:e.data}})),p={role:"user",content:d?.length?[...l.trim()?[{type:"text",text:l}]:[],...d]:l,timestamp:Date.now()},y=J(),w=x?null:t?.id??null;w&&F(w);let k=t_.current,v=z(p.content);tv.current.set(y,{localId:y,sessionId:w??"__new__",leafId:k,message:p,createdAt:Date.now(),kind:"prompt",confirmKey:v,confirmCountAtCreate:x?0:v?tb.current.get(v)??0:0}),ea(e=>[...e,p]),e5(null),to.current=!0,eh(!0),e0({kind:"waiting_model"}),em({type:"start"}),ty.current=!0;let C=ek.find(e=>e.provider===tF?.provider&&e.id===tF?.modelId)?.input,_=!C||0===C.length||C.includes("image")?r?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType})):void 0;try{if(x&&n){eI&&eK(eI);let t=o??tH(),r=await fetch("/api/agent/new",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:n,type:"prompt",message:l,toolNames:t,deferPrompt:!0,..._?.length?{images:_}:{},...eI?{provider:eI.provider,modelId:eI.modelId}:{},..."auto"!==eN?{thinkingLevel:eN}:{}})}),a=await r.json().catch(()=>({}));if(!r.ok||a.error||!a.sessionId)throw Error(a.error??`HTTP ${r.status}`);let s=a.sessionId;e2.current=s;let u=tv.current.get(y);u&&(u.sessionId=s),tm.current?.(),tm.current=N(s,()=>{e2.current===s&&(eh(!1),e0(null))}),tT.current=s,await t1(s,{requireConnected:!0,timeoutMs:1e4}),await m(s,{type:"prompt",message:l,toolNames:t,..._?.length?{images:_}:{}}),i?.({id:s,path:"",cwd:n,name:void 0,created:new Date().toISOString(),modified:new Date().toISOString(),messageCount:1,firstMessage:e})}else if(t){let e=o??tH();await tW(t.id),tm.current?.(),tm.current=N(t.id,()=>{e2.current===t.id&&(eh(!1),e0(null))}),await t1(t.id,{requireConnected:!0,timeoutMs:1e4}),await m(t.id,{type:"prompt",message:l,toolNames:e,leafId:k,...tF?{provider:tF.provider,modelId:tF.modelId}:{},..."auto"!==eN?{thinkingLevel:eN}:{},..._?.length?{images:_}:{}})}}catch(n){let t=e2.current;if(tv.current.delete(y),ea(e=>e.filter(e=>e!==p)),n instanceof f&&(409===n.status||"SESSION_BUSY"===n.code)){e5("This session is already running in another tab. Showing that active run instead."),to.current=!0,eh(!0),e0({kind:"waiting_model"}),em({type:"start"}),t&&(e6.current?.close(),e6.current=null,L(t),t1(t,{replay:!0}),tf.current?.(t,"prompt_conflict"));return}if(console.error("Failed to send message:",n),x&&e2.current){let e=e2.current;e2.current=null,tT.current=null,fetch(`/api/sessions/${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{})}b?.current&&e.trim()&&b.current.insertIfEmpty(e),b?.current&&r?.length&&b.current.addBase64Images?.(r.map(({data:e,mimeType:t})=>({data:e,mimeType:t}))),e5(n instanceof Error?n.message:String(n)),e6.current?.close(),e6.current=null,t&&D(t),to.current=!1,eh(!1),e0(null),em({type:"end"})}},[x,n,eI,tH,eN,t,M?.info?.cwd,eg,t1,i,tB,ek,tF,tW,b]),t5=(0,r.useCallback)(async()=>{let e=e2.current;if(!e)return;let t=ti();to.current=!1,tc(),e5(null),eh(!1),e0(null),em({type:"end"}),e6.current?.close(),e6.current=null,D(e),F(e);try{await m(e,{type:t?"abort_bash":"abort"}),await tG(e,!1,!1,!0)}catch(t){console.error("Failed to abort:",t),await tG(e,!1,!1,!0)}finally{t&&tc()}},[tc,ti,tG]),t6=(0,r.useCallback)(async(e,t)=>{let n=e2.current,r=e.trim();if(n&&r){e5(null),tu(r);try{await m(n,{type:"bash",command:r,excludeFromContext:t})}catch(e){e5(e instanceof Error?e.message:String(e))}finally{tc(),F(n),await tG(n,!1,!1,!0)}}},[tu,tc,tG]),t2=(0,r.useCallback)(async e=>{let t=e2.current;if(t){eH(e);try{let{cancelled:n,newSessionId:r}=await m(t,{type:"fork",entryId:e})??{};!n&&r&&u?.(r)}catch(e){console.error("Fork failed:",e)}finally{eH(null)}}},[u]),t8=(0,r.useCallback)(async e=>{let r=e2.current,a=M?.info?.cwd??t?.cwd??n??null;if(!r||!a)return{ok:!1,error:"No active session to fork"};if(to.current)return{ok:!1,error:"Agent is still running"};try{let t=tH(),n=await fetch("/api/agent/new",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:a,type:"prompt",parentSessionId:r,deferPrompt:!0,toolNames:t,...tF?{provider:tF.provider,modelId:tF.modelId}:{},..."auto"!==eN?{thinkingLevel:eN}:{}})}),o=await n.json().catch(()=>({}));if(!n.ok||o.error||!o.sessionId)return{ok:!1,error:o.error??`HTTP ${n.status}`};let s=o.sessionId;try{await m(s,{type:"append_message",message:e,customType:"fork_handoff",display:!0})}catch{}return i?.({id:s,path:"",cwd:a,created:new Date().toISOString(),modified:new Date().toISOString(),messageCount:1,firstMessage:e.slice(0,120),parentSessionId:r}),{ok:!0}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}},[M?.info?.cwd,t?.cwd,n,tF,eN,tH,i]),t7=(0,r.useCallback)(async e=>{let t=e2.current;t&&(tC.current.delete(t),F(t),t_.current=e,en(e),await tX(t,e))},[tX]),t9=(0,r.useCallback)(async e=>{t_.current=e,en(e);let t=e2.current;t&&(tC.current.delete(t),F(t),await tX(t,e))},[tX]),ne=(0,r.useCallback)(async(e,t)=>{if(x)return void tP({provider:e,modelId:t});let n=e2.current;if(n)try{var r;e5(null);let a=await m(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)&&eD(a.thinkingLevel),eW(o),U(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),e5(e)}},[x,tP]),nt=(0,r.useCallback)(async()=>{let e=e2.current;if(e&&!ez){eG(!0),eY(null),eX(null);try{let t=await m(e,{type:"compact"});t?.reducedBy!=null&&eX(`Compacted ~${t.tokensBefore??"?"} → ~${t.tokensAfter??"?"} tokens (−${t.reducedBy})`),await tG(e,!0)}catch(e){eY(e instanceof Error?e.message:String(e))}finally{eG(!1)}}},[ez,tG]),nn=(0,r.useCallback)(async(e,t,n)=>{let r=e2.current;if(!r)return;F(r);let a=tB(n),o=e.trim()?a?`${e}
11
+
12
+ Attached document text:
13
+
14
+ ${a}`:e:a?`Attached document text:
15
+
16
+ ${a}`:"",s=ek.find(e=>e.provider===tF?.provider&&e.id===tF?.modelId)?.input,l=!s||0===s.length||s.includes("image")?t?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType})):void 0,i={role:"user",content:`[steer] ${o}`,timestamp:Date.now()},u=J(),c=K(o,l?.length??0);tv.current.set(u,{localId:u,sessionId:r,leafId:t_.current,message:i,createdAt:Date.now(),kind:"steer",confirmKey:c,confirmCountAtCreate:c?tb.current.get(c)??0:0}),ea(e=>[...e,i]);try{await m(r,{type:"steer",message:o,...l?.length?{images:l}:{}})}catch(e){tv.current.delete(u),console.error("Failed to steer:",e)}},[tB,ek,tF]),nr=(0,r.useCallback)(async(e,t,n)=>{let r=e2.current;if(!r)return;F(r);let a=tB(n),o=e.trim()?a?`${e}
17
+
18
+ Attached document text:
19
+
20
+ ${a}`:e:a?`Attached document text:
21
+
22
+ ${a}`:"",s=ek.find(e=>e.provider===tF?.provider&&e.id===tF?.modelId)?.input,l=!s||0===s.length||s.includes("image")?t?.map(e=>({type:"image",data:e.data,mimeType:e.mimeType})):void 0,i={role:"user",content:o,timestamp:Date.now()},u=J(),c=K(o,l?.length??0);tv.current.set(u,{localId:u,sessionId:r,leafId:t_.current,message:i,createdAt:Date.now(),kind:"follow_up",confirmKey:c,confirmCountAtCreate:c?tb.current.get(c)??0:0}),ea(e=>[...e,i]);try{await m(r,{type:"follow_up",message:o,...l?.length?{images:l}:{}})}catch(e){tv.current.delete(u),console.error("Failed to follow up:",e)}},[tB,ek,tF]),na=(0,r.useCallback)(async()=>{let e=e2.current;if(e)try{await m(e,{type:"abort_compaction"})}catch(e){console.error("Failed to abort compaction:",e)}},[]),no=(0,r.useCallback)(async e=>{if(eD(e),"auto"===e)return;let t=e2.current;if(t)try{await m(t,{type:"set_thinking_level",level:e})}catch(e){console.error("Failed to set thinking level:",e)}},[]),ns=(0,r.useCallback)(async e=>{tj(e);let t=(0,q.tE)(e,eE),n=e2.current;if(n)try{await m(n,{type:"set_tools",toolNames:t})}catch(e){console.error("Failed to set tools:",e)}},[eE,tj]),nl=(0,r.useCallback)(async e=>{tO(e);let t=(0,q.tE)(eS,e),n=e2.current;if(n)try{await m(n,{type:"set_tools",toolNames:t})}catch(e){console.error("Failed to set memory tools:",e)}},[tO,eS]),ni=(0,r.useCallback)((e="smooth")=>{tw.current?.scrollIntoView({behavior:e})},[]),nu=(0,r.useCallback)(()=>{let e=tk.current,t=th.current;if(!e||!t)return;let n=t.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;e.scrollTo({top:n-16,behavior:"smooth"})},[]);(0,r.useEffect)(()=>{if(t){var e;let n;if(e2.current=t.id,t.id===tT.current)return tT.current=null,()=>{tN.current&&clearTimeout(tN.current),tN.current=null,e6.current?.close(),e6.current=null,tm.current?.(),tm.current=null};tA.current=!1,tE.current=0;let r=(e=t.id,(n=C().get(e))&&"idle"!==n.snapshot.phase?n.snapshot:null);r?.phase==="active"&&(to.current=!0,eh(!0),e0({kind:"waiting_model"}),em({type:"start"})),(async()=>{let e=await tG(t.id,!0,!0,!0);e2.current===t.id&&(await tZ(t.id),t0(t.id),e?.running?(to.current=!0,eh(!0),e0(a(e.state)),em({type:"start"}),t1(t.id,{replay:!0}),tm.current?.(),tm.current=N(t.id,()=>{e2.current===t.id&&tf.current?.(t.id,"stream_watchdog")})):e&&r?.phase==="active"?(to.current=!1,eh(!1),e0(null),em({type:"end"}),D(t.id)):e||r?.phase!=="active"||tf.current?.(t.id,"mount_state_load_failed"),e?.state&&(void 0!==e.state.isCompacting&&eG(e.state.isCompacting),void 0!==e.state.contextUsage&&ej(e.state.contextUsage??null),void 0!==e.state.systemPrompt&&eF(e.state.systemPrompt??null),void 0!==e.state.queuedMessages&&e3(H(e.state.queuedMessages)),tt(e.state),e.state.isBashRunning&&tu(""),void 0!==e.state.thinkingLevel&&eD(e.state.thinkingLevel??"auto")),e&&!to.current&&e.state?.contextUsage===void 0&&tf.current?.(t.id,"mount_context_usage"))})()}return()=>{tT.current&&e2.current===tT.current||(tN.current&&clearTimeout(tN.current),tN.current=null,tD.current?.controller.abort(W("Session changed","AbortError")),tD.current=null,e6.current?.close(),e6.current=null,tm.current?.(),tm.current=null)}},[t1,tG,tZ,t0,v,t,tt,tu]),(0,r.useEffect)(()=>{let e=()=>{let e=e2.current;e&&t3(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)}},[t3]),(0,r.useEffect)(()=>{let e=e2.current;if(e)return tR.current=!1,(0,w.O)(t=>{let n=t.includes(e),r=tR.current;tR.current=n,n&&!to.current?(F(e),t3(e,"running_feed_start")):!n&&r&&(F(e),to.current?t3(e,"running_feed_stop"):tG(e,!1,!1,!0))})},[tG,t3,t?.id]),(0,r.useEffect)(()=>{let e=window.setInterval(()=>{let e=e2.current;e&&(to.current?(t3(e,"interval"),tU.current&&Date.now()-tL.current>25e3&&(tL.current=Date.now(),F(e),tG(e,!1,!1,!0))):Date.now()-t$.current>=3e4?(t$.current=Date.now(),F(e),tG(e,!1,!1,!0)):tG(e))},15e3);return()=>window.clearInterval(e)},[tG,t3]),(0,r.useEffect)(()=>{v&&v(M?.tree??[],et,t9)},[M?.tree,et,t9,v]),(0,r.useEffect)(()=>{er.length>0&&!tM.current&&(ty.current?(ty.current=!1,tg.current=!0,nu()):tg.current?to.current||ni("smooth"):(tg.current=!0,ni("instant")))},[er.length,eg,ni,nu]),(0,r.useEffect)(()=>{fetch("/api/models").then(e=>e.json()).then(e=>{if(ew(e.models),e.thinkingLevels&&eC(e.thinkingLevels),e.thinkingLevelMaps&&e_(e.thinkingLevelMaps),e.modelList&&(ev(e.modelList),x&&e.modelList.length>0)){let t=e.defaultModel,n=t&&e.modelList.find(e=>e.id===t.modelId&&e.provider===t.provider);tP(n?{provider:n.provider,modelId:n.id}:{provider:e.modelList[0].provider,modelId:e.modelList[0].id})}}).catch(()=>{})},[x,k,tP]),(0,r.useEffect)(()=>{if(!eV)return;let e=setTimeout(()=>eY(null),3e3);return()=>clearTimeout(e)},[eV]),(0,r.useEffect)(()=>{if(!eQ)return;let e=setTimeout(()=>eX(null),6e3);return()=>clearTimeout(e)},[eQ]);let nc=(0,r.useCallback)(async()=>{let e=e2.current;if(e)try{await m(e,{type:"clear_queue"}),e3({steering:[],followUp:[]})}catch(e){e5(e instanceof Error?e.message:String(e))}},[]);return{data:M,loading:Q,error:Z,activeLeafId:et,messages:er,entryIds:eo,streamState:ef,agentRunning:eg,modelNames:ey,modelList:ek,modelThinkingLevels:eb,modelThinkingLevelMaps:ex,newSessionModel:eI,toolPreset:eS,memoryTools:eE,thinkingLevel:eN,retryInfo:eL,queuedMessages:e1,extensionStatuses:e8,extensionWidgets:e7,extensionDialog:e9,extensionNotices:te,bashLive:ts,bashRunning:tl,contextUsage:eP,systemPrompt:eO,forkingEntryId:eq,isCompacting:ez,compactError:eV,compactInfo:eQ,currentModel:tF,displayModel:tq,sessionStats:tJ,agentPhase:eZ,agentError:e4,isNew:x,sessionIdRef:e2,sseReaderRef:e6,messagesEndRef:tw,scrollContainerRef:tk,lastUserMsgRef:th,pendingScrollToUserRef:ty,initialScrollDoneRef:tg,handleSend:t4,handleAbort:t5,handleFork:t2,handleNavigate:t7,handleModelChange:ne,handleCompact:nt,handleSteer:nn,handleFollowUp:nr,handleAbortCompaction:na,handleToolPresetChange:ns,handleMemoryToolsChange:nl,handleThinkingLevelChange:no,handleClearQueue:nc,handleBash:t6,respondToExtensionUi:tr,dismissExtensionNotice:ta,loadTools:tZ,loadSlashCommands:t0,slashCommands:eR,setActiveLeafId:en,setData:U,setMessages:ea,dispatch:em,setAgentRunning:eh,setForkingEntryId:eH,forkToNewSession:t8,loadMoreMessages:tY,hasMoreMessages:eu,totalMessages:el,loadedMessagesCount:ed,loadShadowedMessages:tQ,handleAgentEventRef:tp}}}}]);