agmon 0.2.1 → 0.2.2

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 (152) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/fallback-build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +8 -8
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +16 -15
  14. package/.next/server/app/_not-found.segments/_full.segment.rsc +16 -15
  15. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +8 -7
  16. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  17. package/.next/server/app/api/media/route.js.nft.json +1 -1
  18. package/.next/server/app/api/reports/tokens/route.js.nft.json +1 -1
  19. package/.next/server/app/api/sessions/[id]/transcript/route.js +1 -1
  20. package/.next/server/app/api/sessions/[id]/transcript/route.js.nft.json +1 -1
  21. package/.next/server/app/api/traces/stream/route.js +1 -1
  22. package/.next/server/app/api/traces/stream/route.js.nft.json +1 -1
  23. package/.next/server/app/api/version/route.js.nft.json +1 -1
  24. package/.next/server/app/api/workspace/file-content/route.js.nft.json +1 -1
  25. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  26. package/.next/server/app/chat/page.js.nft.json +1 -1
  27. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  28. package/.next/server/app/chat.html +1 -1
  29. package/.next/server/app/chat.rsc +4 -4
  30. package/.next/server/app/chat.segments/_full.segment.rsc +4 -4
  31. package/.next/server/app/chat.segments/_tree.segment.rsc +2 -2
  32. package/.next/server/app/chat.segments/chat/__PAGE__.segment.rsc +6 -5
  33. package/.next/server/app/index.html +1 -1
  34. package/.next/server/app/index.rsc +5 -5
  35. package/.next/server/app/index.segments/__PAGE__.segment.rsc +7 -6
  36. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  37. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  38. package/.next/server/app/page.js.nft.json +1 -1
  39. package/.next/server/app/page_client-reference-manifest.js +1 -1
  40. package/.next/server/app/reports/page.js.nft.json +1 -1
  41. package/.next/server/app/reports/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/reports.html +1 -1
  43. package/.next/server/app/reports.rsc +2 -2
  44. package/.next/server/app/reports.segments/_full.segment.rsc +2 -2
  45. package/.next/server/app/reports.segments/_tree.segment.rsc +2 -2
  46. package/.next/server/app/reports.segments/reports/__PAGE__.segment.rsc +4 -3
  47. package/.next/server/app/store/page.js.nft.json +1 -1
  48. package/.next/server/app/store/page_client-reference-manifest.js +1 -1
  49. package/.next/server/app/store.html +1 -1
  50. package/.next/server/app/store.rsc +2 -2
  51. package/.next/server/app/store.segments/_full.segment.rsc +2 -2
  52. package/.next/server/app/store.segments/_tree.segment.rsc +2 -2
  53. package/.next/server/app/store.segments/store/__PAGE__.segment.rsc +4 -3
  54. package/.next/server/chunks/[root-of-the-server]__0dw97_pahi8uf._.js +3 -0
  55. package/.next/server/chunks/[root-of-the-server]__0dw97_pahi8uf._.js.map +1 -0
  56. package/.next/server/chunks/_0ao-_t4jkb46h._.js +2 -2
  57. package/.next/server/chunks/_0ao-_t4jkb46h._.js.map +1 -1
  58. package/.next/server/chunks/_1-8ipqazoyrrk._.js +1 -1
  59. package/.next/server/chunks/_1-8ipqazoyrrk._.js.map +1 -1
  60. package/.next/server/chunks/ssr/[root-of-the-server]__1jwplflwix8wi._.js +1 -1
  61. package/.next/server/chunks/ssr/[root-of-the-server]__1jwplflwix8wi._.js.map +1 -1
  62. package/.next/server/chunks/ssr/[root-of-the-server]__1kt7h7bz59mdn._.js +1 -1
  63. package/.next/server/chunks/ssr/[root-of-the-server]__1kt7h7bz59mdn._.js.map +1 -1
  64. package/.next/server/chunks/ssr/[root-of-the-server]__1otsvjy81s8my._.js +1 -1
  65. package/.next/server/chunks/ssr/[root-of-the-server]__1otsvjy81s8my._.js.map +1 -1
  66. package/.next/server/chunks/ssr/{_0--937zhi743v._.js → _0zel-n0h--cnl._.js} +1 -1
  67. package/.next/server/chunks/ssr/{node_modules_0jla9ugf1y6rb._.js → node_modules_01avo0bde3tpo._.js} +1 -1
  68. package/.next/server/chunks/ssr/{node_modules_0sjdrli5douui._.js → node_modules_01l0208e5kqic._.js} +1 -1
  69. package/.next/server/chunks/ssr/{node_modules_0lqovp8j8ld76._.js → node_modules_033x29yqle_sj._.js} +1 -1
  70. package/.next/server/chunks/ssr/{node_modules_05i69rc9pwcdx._.js → node_modules_03wbg__aslvui._.js} +1 -1
  71. package/.next/server/chunks/ssr/{node_modules_1ltys5mwtcv-n._.js → node_modules_08-bqkrz7sh0l._.js} +1 -1
  72. package/.next/server/chunks/ssr/{node_modules_09v49jhajmvl4._.js → node_modules_089w9jm7s2qa3._.js} +2 -2
  73. package/.next/server/chunks/ssr/{node_modules_0z1e37smavebg._.js → node_modules_0cy47-s63xjzh._.js} +2 -2
  74. package/.next/server/chunks/ssr/{node_modules_0dw0vozejrnml._.js → node_modules_0czh0jcnsm5e6._.js} +2 -2
  75. package/.next/server/chunks/ssr/{node_modules_0e3njj436xau-._.js → node_modules_0fv321j1nslkb._.js} +1 -1
  76. package/.next/server/chunks/ssr/{node_modules_0d2ios01ot1in._.js → node_modules_0g-wb7h-hsdwc._.js} +1 -1
  77. package/.next/server/chunks/ssr/{node_modules_1l46or7mgko0z._.js → node_modules_0oz_zzlh8exwx._.js} +1 -1
  78. package/.next/server/chunks/ssr/{node_modules_0b8zi3pbl-y9n._.js → node_modules_0so2agzqd9p8l._.js} +2 -2
  79. package/.next/server/chunks/ssr/{node_modules_1wew4nn7i1uup._.js → node_modules_0w2w61b8bh769._.js} +1 -1
  80. package/.next/server/chunks/ssr/{node_modules_07bjxeq9dfgn1._.js → node_modules_0wd6szix_zku7._.js} +2 -2
  81. package/.next/server/chunks/ssr/{node_modules_1aqaelh-8fme6._.js → node_modules_0wp7omf0xblv8._.js} +1 -1
  82. package/.next/server/chunks/ssr/{node_modules_0xh8tnq1niblb._.js → node_modules_10c51o2qv6mbi._.js} +1 -1
  83. package/.next/server/chunks/ssr/{node_modules_1d4sreyq0ubqg._.js → node_modules_19vqq7rvf-_ar._.js} +2 -2
  84. package/.next/server/chunks/ssr/{node_modules_1e_nc2eyg4djz._.js → node_modules_1hu83gui7_nj2._.js} +1 -1
  85. package/.next/server/chunks/ssr/{node_modules_1zbmc81s-4zsm._.js → node_modules_1j8hpoiygrs5e._.js} +1 -1
  86. package/.next/server/chunks/ssr/{node_modules_1pquu5wprusnc._.js → node_modules_1n4kig4mj6n4s._.js} +2 -2
  87. package/.next/server/chunks/ssr/{node_modules_1st9dwe66yx93._.js → node_modules_1s8oxeqa5_i3k._.js} +1 -1
  88. package/.next/server/chunks/ssr/{node_modules_01p9ctt-n2dxp._.js → node_modules_1xz1dstlo5ri-._.js} +1 -1
  89. package/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_0kqo9zl9cgwbo._.js → node_modules_katex_dist_katex_mjs_067omoj5szuys._.js} +1 -1
  90. package/.next/server/chunks/ssr/src_app_page_1vqfk0-j72fp6.js +1 -1
  91. package/.next/server/chunks/ssr/src_app_page_1vqfk0-j72fp6.js.map +1 -1
  92. package/.next/server/middleware-build-manifest.js +3 -3
  93. package/.next/server/pages/404.html +1 -1
  94. package/.next/server/pages/500.html +1 -1
  95. package/.next/server/preview-props.json +3 -3
  96. package/.next/server/server-reference-manifest.js +1 -1
  97. package/.next/server/server-reference-manifest.json +1 -1
  98. package/.next/static/chunks/0jo6fy2c_gmqn.js +1 -0
  99. package/.next/static/chunks/2q9cwykv6ox1t.css +1 -0
  100. package/.next/static/chunks/{3og0e9qcff393.js → 2zf44j8sjo0w0.js} +4 -4
  101. package/.next/trace +1 -1
  102. package/.next/trace-build +1 -1
  103. package/package.json +1 -1
  104. package/src/app/api/traces/stream/route.js +41 -5
  105. package/src/app/layout.js +2 -1
  106. package/src/app/page.js +17 -1
  107. package/src/components/chat/SessionChatView.js +1 -1
  108. package/src/components/factory/office-canvas.js +32 -1
  109. package/src/components/layout/BottomPanel.jsx +6 -6
  110. package/src/components/layout/LeftSidebar.jsx +62 -4
  111. package/src/components/layout/StatusBar.jsx +1 -1
  112. package/src/components/layout/TitleBar.jsx +71 -1
  113. package/src/components/layout/VSCodeWorkbench.jsx +21 -0
  114. package/src/lib/mockTraces.js +13 -11
  115. package/src/lib/parsers/codexParser.js +373 -0
  116. package/src/lib/parsers/transcriptParser.js +35 -3
  117. package/src/lib/useFactoryTraces.js +70 -5
  118. package/src/lib/watchers/antigravityWatcher.js +15 -1
  119. package/src/lib/watchers/claudeWatcher.js +64 -53
  120. package/src/lib/watchers/codexWatcher.js +482 -0
  121. package/src/lib/watchers/watcherManager.js +46 -30
  122. package/.next/server/chunks/src_lib_watchers_antigravityWatcher_0w1-atg39y__p.js +0 -3
  123. package/.next/server/chunks/src_lib_watchers_antigravityWatcher_0w1-atg39y__p.js.map +0 -1
  124. package/.next/static/chunks/17jorrh_pfel_.js +0 -1
  125. package/.next/static/chunks/25l0z48vlvdu4.css +0 -1
  126. /package/.next/server/chunks/ssr/{_0--937zhi743v._.js.map → _0zel-n0h--cnl._.js.map} +0 -0
  127. /package/.next/server/chunks/ssr/{node_modules_0jla9ugf1y6rb._.js.map → node_modules_01avo0bde3tpo._.js.map} +0 -0
  128. /package/.next/server/chunks/ssr/{node_modules_0sjdrli5douui._.js.map → node_modules_01l0208e5kqic._.js.map} +0 -0
  129. /package/.next/server/chunks/ssr/{node_modules_0lqovp8j8ld76._.js.map → node_modules_033x29yqle_sj._.js.map} +0 -0
  130. /package/.next/server/chunks/ssr/{node_modules_05i69rc9pwcdx._.js.map → node_modules_03wbg__aslvui._.js.map} +0 -0
  131. /package/.next/server/chunks/ssr/{node_modules_1ltys5mwtcv-n._.js.map → node_modules_08-bqkrz7sh0l._.js.map} +0 -0
  132. /package/.next/server/chunks/ssr/{node_modules_09v49jhajmvl4._.js.map → node_modules_089w9jm7s2qa3._.js.map} +0 -0
  133. /package/.next/server/chunks/ssr/{node_modules_0z1e37smavebg._.js.map → node_modules_0cy47-s63xjzh._.js.map} +0 -0
  134. /package/.next/server/chunks/ssr/{node_modules_0dw0vozejrnml._.js.map → node_modules_0czh0jcnsm5e6._.js.map} +0 -0
  135. /package/.next/server/chunks/ssr/{node_modules_0e3njj436xau-._.js.map → node_modules_0fv321j1nslkb._.js.map} +0 -0
  136. /package/.next/server/chunks/ssr/{node_modules_0d2ios01ot1in._.js.map → node_modules_0g-wb7h-hsdwc._.js.map} +0 -0
  137. /package/.next/server/chunks/ssr/{node_modules_0xh8tnq1niblb._.js.map → node_modules_0oz_zzlh8exwx._.js.map} +0 -0
  138. /package/.next/server/chunks/ssr/{node_modules_0b8zi3pbl-y9n._.js.map → node_modules_0so2agzqd9p8l._.js.map} +0 -0
  139. /package/.next/server/chunks/ssr/{node_modules_1wew4nn7i1uup._.js.map → node_modules_0w2w61b8bh769._.js.map} +0 -0
  140. /package/.next/server/chunks/ssr/{node_modules_07bjxeq9dfgn1._.js.map → node_modules_0wd6szix_zku7._.js.map} +0 -0
  141. /package/.next/server/chunks/ssr/{node_modules_1aqaelh-8fme6._.js.map → node_modules_0wp7omf0xblv8._.js.map} +0 -0
  142. /package/.next/server/chunks/ssr/{node_modules_1d4sreyq0ubqg._.js.map → node_modules_10c51o2qv6mbi._.js.map} +0 -0
  143. /package/.next/server/chunks/ssr/{node_modules_1l46or7mgko0z._.js.map → node_modules_19vqq7rvf-_ar._.js.map} +0 -0
  144. /package/.next/server/chunks/ssr/{node_modules_1e_nc2eyg4djz._.js.map → node_modules_1hu83gui7_nj2._.js.map} +0 -0
  145. /package/.next/server/chunks/ssr/{node_modules_1zbmc81s-4zsm._.js.map → node_modules_1j8hpoiygrs5e._.js.map} +0 -0
  146. /package/.next/server/chunks/ssr/{node_modules_1pquu5wprusnc._.js.map → node_modules_1n4kig4mj6n4s._.js.map} +0 -0
  147. /package/.next/server/chunks/ssr/{node_modules_1st9dwe66yx93._.js.map → node_modules_1s8oxeqa5_i3k._.js.map} +0 -0
  148. /package/.next/server/chunks/ssr/{node_modules_01p9ctt-n2dxp._.js.map → node_modules_1xz1dstlo5ri-._.js.map} +0 -0
  149. /package/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_0kqo9zl9cgwbo._.js.map → node_modules_katex_dist_katex_mjs_067omoj5szuys._.js.map} +0 -0
  150. /package/.next/static/{1y6Da0YgnPr2_6ncpWrbV → dGN2VKPk5TJgezxS3JvRc}/_buildManifest.js +0 -0
  151. /package/.next/static/{1y6Da0YgnPr2_6ncpWrbV → dGN2VKPk5TJgezxS3JvRc}/_clientMiddlewareManifest.js +0 -0
  152. /package/.next/static/{1y6Da0YgnPr2_6ncpWrbV → dGN2VKPk5TJgezxS3JvRc}/_ssgManifest.js +0 -0
@@ -393,7 +393,7 @@ ${c.content||"*(No message)*"}
393
393
  </footer>
394
394
  </div>
395
395
  </body>
396
- </html>`}(f,h,k):"",[a,f,h,k]);if(!a)return null;let r=f?.id||"session",s=async()=>{let a="html"===i?q:p;await U(a)&&(o(!0),setTimeout(()=>o(!1),2e3))},t=a=>{m(b=>({...b,[a]:!b[a]}))};return(0,b.jsx)("div",{className:"fixed inset-0 z-[120] flex items-center justify-center p-3 md:p-6 bg-black/80 backdrop-blur-sm animate-in fade-in duration-150",onClick:e,children:(0,b.jsxs)("div",{className:"w-full max-w-5xl h-[85vh] max-h-[850px] flex flex-col rounded-xl bg-[#18181b] border border-[#27272a] shadow-2xl overflow-hidden text-slate-200",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-[#27272a] bg-[#121214]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"w-8 h-8 rounded-lg bg-cyan-950/60 border border-cyan-800/40 flex items-center justify-center text-cyan-400",children:(0,b.jsx)(J.f,{className:"w-4 h-4"})}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("h2",{className:"text-sm font-semibold text-white flex items-center gap-2",children:["Export Session Report",(0,b.jsx)("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded bg-[#27272a] text-slate-400 font-normal",children:r})]}),(0,b.jsx)("p",{className:"text-[11px] text-slate-400",children:"Generate clean, shareable reports for stakeholders or pull requests"})]})]}),(0,b.jsx)("button",{onClick:e,className:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-[#27272a] transition-colors cursor-pointer",title:"Close dialog (Esc)",children:(0,b.jsx)(d.X,{className:"w-4 h-4"})})]}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col md:flex-row min-h-0 overflow-hidden",children:[(0,b.jsxs)("div",{className:"w-full md:w-72 border-b md:border-b-0 md:border-r border-[#27272a] bg-[#141416] p-4 flex flex-col gap-5 overflow-y-auto shrink-0",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400 block mb-2",children:"Document Format"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>j("html"),className:`flex items-center justify-center gap-2 py-2 px-3 rounded-lg border text-xs font-medium transition-all cursor-pointer ${"html"===i?"bg-cyan-950/60 border-cyan-600/60 text-cyan-300 shadow-sm":"bg-[#1f1f23] border-[#2e2e36] text-slate-400 hover:text-slate-200 hover:bg-[#25252a]"}`,children:[(0,b.jsx)(K.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{children:"HTML (PDF)"})]}),(0,b.jsxs)("button",{type:"button",onClick:()=>j("markdown"),className:`flex items-center justify-center gap-2 py-2 px-3 rounded-lg border text-xs font-medium transition-all cursor-pointer ${"markdown"===i?"bg-cyan-950/60 border-cyan-600/60 text-cyan-300 shadow-sm":"bg-[#1f1f23] border-[#2e2e36] text-slate-400 hover:text-slate-200 hover:bg-[#25252a]"}`,children:[(0,b.jsx)(J.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{children:"Markdown"})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-slate-400 mb-2",children:[(0,b.jsx)(L.f,{className:"w-3 h-3"}),(0,b.jsx)("span",{children:"Include Content"})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("label",{className:"flex items-center justify-between p-2.5 rounded-lg bg-[#1f1f23] border border-[#2e2e36] hover:border-slate-700 transition-colors cursor-pointer text-xs",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 text-slate-200",children:[(0,b.jsx)(O,{className:"w-3.5 h-3.5 text-cyan-400 shrink-0"}),(0,b.jsx)("span",{children:"Executive Summary"})]}),(0,b.jsx)("input",{type:"checkbox",checked:k.includeExecutiveSummary,onChange:()=>t("includeExecutiveSummary"),className:"accent-cyan-500 rounded cursor-pointer w-4 h-4"})]}),(0,b.jsxs)("label",{className:"flex items-center justify-between p-2.5 rounded-lg bg-[#1f1f23] border border-[#2e2e36] hover:border-slate-700 transition-colors cursor-pointer text-xs",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 text-slate-200",children:[(0,b.jsx)(u.f,{className:"w-3.5 h-3.5 text-purple-400 shrink-0"}),(0,b.jsx)("span",{children:"Reasoning / Thinking"})]}),(0,b.jsx)("input",{type:"checkbox",checked:k.includeThinking,onChange:()=>t("includeThinking"),className:"accent-cyan-500 rounded cursor-pointer w-4 h-4"})]}),(0,b.jsxs)("label",{className:"flex items-center justify-between p-2.5 rounded-lg bg-[#1f1f23] border border-[#2e2e36] hover:border-slate-700 transition-colors cursor-pointer text-xs",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 text-slate-200",children:[(0,b.jsx)(l.f,{className:"w-3.5 h-3.5 text-amber-400 shrink-0"}),(0,b.jsx)("span",{children:"Verbose Tool Outputs"})]}),(0,b.jsx)("input",{type:"checkbox",checked:k.includeToolOutputs,onChange:()=>t("includeToolOutputs"),className:"accent-cyan-500 rounded cursor-pointer w-4 h-4"})]}),(0,b.jsxs)("label",{className:"flex items-center justify-between p-2.5 rounded-lg bg-[#1f1f23] border border-[#2e2e36] hover:border-slate-700 transition-colors cursor-pointer text-xs",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 text-slate-200",children:[(0,b.jsx)(P.f,{className:"w-3.5 h-3.5 text-emerald-400 shrink-0"}),(0,b.jsx)("span",{children:"Step Timestamps"})]}),(0,b.jsx)("input",{type:"checkbox",checked:k.includeTimestamps,onChange:()=>t("includeTimestamps"),className:"accent-cyan-500 rounded cursor-pointer w-4 h-4"})]})]})]}),(0,b.jsxs)("div",{className:"mt-auto p-3 rounded-lg bg-[#1a1a1e] border border-[#27272a] text-[11px] text-slate-400",children:[(0,b.jsx)("span",{className:"font-semibold text-slate-300 block mb-1",children:"Print to PDF Tip"}),"When opening the HTML export, press ",(0,b.jsx)("kbd",{className:"px-1 py-0.5 bg-[#27272a] rounded text-[10px] text-slate-200",children:"Cmd+P"})," or ",(0,b.jsx)("kbd",{className:"px-1 py-0.5 bg-[#27272a] rounded text-[10px] text-slate-200",children:"Ctrl+P"})," to save a clean, high-contrast PDF document."]})]}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col bg-[#0f0f11] min-w-0 overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 bg-[#141416] border-b border-[#27272a] text-xs text-slate-400",children:[(0,b.jsx)("span",{className:"font-medium",children:"Live Document Preview"}),(0,b.jsxs)("span",{className:"text-[11px] font-mono text-slate-500",children:[h.length," turns • ",i.toUpperCase()]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto p-4",children:"html"===i?(0,b.jsx)("div",{className:"w-full h-full min-h-[350px] rounded-lg border border-[#27272a] overflow-hidden bg-white shadow-inner",children:(0,b.jsx)("iframe",{title:"HTML Preview",srcDoc:q,className:"w-full h-full border-none",sandbox:"allow-same-origin"})}):(0,b.jsx)("div",{className:"w-full h-full rounded-lg border border-[#27272a] bg-[#141416] p-4 overflow-auto",children:(0,b.jsx)("pre",{className:"text-xs font-mono text-slate-300 whitespace-pre-wrap leading-relaxed select-text",children:p})})})]})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-t border-[#27272a] bg-[#121214]",children:[(0,b.jsxs)("div",{className:"text-xs text-slate-400 hidden sm:block",children:["Ready to export as ",(0,b.jsx)("span",{className:"font-mono text-cyan-400",children:"html"===i?".html":".md"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:["html"===i&&(0,b.jsxs)("button",{type:"button",onClick:()=>{let a=window.open("","_blank");a&&(a.document.write(q),a.document.close(),a.focus(),setTimeout(()=>{a.print()},300))},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-[#333338] bg-[#1f1f23] text-slate-200 hover:text-white hover:bg-[#28282e] text-xs font-medium transition-colors cursor-pointer",title:"Open browser print dialog",children:[(0,b.jsx)(I.f,{className:"w-3.5 h-3.5 text-slate-400"}),(0,b.jsx)("span",{children:"Print to PDF"})]}),(0,b.jsx)("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-[#333338] bg-[#1f1f23] text-slate-200 hover:text-white hover:bg-[#28282e] text-xs font-medium transition-colors cursor-pointer",title:"Copy formatted document to clipboard",children:n?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(H.f,{className:"w-3.5 h-3.5 text-emerald-400"}),(0,b.jsx)("span",{className:"text-emerald-400",children:"Copied!"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.f,{className:"w-3.5 h-3.5 text-slate-400"}),(0,b.jsx)("span",{children:"Copy to Clipboard"})]})}),(0,b.jsxs)("button",{type:"button",onClick:()=>{"html"===i?T(`${r}-report.html`,q,"text/html"):T(`${r}-report.md`,p,"text/markdown")},className:"flex items-center gap-1.5 px-4 py-1.5 rounded-lg bg-cyan-600 hover:bg-cyan-500 text-black font-semibold text-xs transition-colors cursor-pointer shadow-sm",children:[(0,b.jsx)(g.f,{className:"w-3.5 h-3.5"}),(0,b.jsxs)("span",{children:["Download ","html"===i?"HTML":"Markdown"]})]})]})]})]})})}let W={streaming:"Working",pending:"Queued",done:"Done",happy:"Done",sleeping:"Idle",error:"Failed",looping:"Loop Alert"},X={bash:"border-cyan-500/40 bg-cyan-950/60 text-cyan-300",docker:"border-sky-500/40 bg-sky-950/60 text-sky-300",git:"border-orange-500/40 bg-orange-950/60 text-orange-300",edit:"border-emerald-500/40 bg-emerald-950/60 text-emerald-300",read:"border-blue-500/40 bg-blue-950/60 text-blue-300",search:"border-purple-500/40 bg-purple-950/60 text-purple-300",prompt:"border-amber-500/40 bg-amber-950/60 text-amber-300",error:"border-rose-500/40 bg-rose-950/60 text-rose-300",gitnexus:"border-purple-500/40 bg-purple-950/60 text-purple-300",browser:"border-cyan-500/40 bg-cyan-950/60 text-cyan-300",agent:"border-orange-500/40 bg-orange-950/60 text-orange-300",mcp:"border-violet-500/40 bg-violet-950/60 text-violet-300"};function Y(a){return a?a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a):"0"}function Z(a){if(!a)return"0s";let b=Math.floor(a/1e3);if(b<60)return`${b}s`;let c=Math.floor(b/60);return`${c}m ${b%60}s`}a.s(["f",0,function({sessionTrace:a,isSidebar:G=!1,onClose:H,onDockToSidebar:I,onStartReplay:J,isFullscreen:K=!1,onToggleFullscreen:L}){let[M,N]=(0,c.useState)("all"),[O,P]=(0,c.useState)(!0),[Q,R]=(0,c.useState)(!1),[S,T]=(0,c.useState)(null),[U,$]=(0,c.useState)(!1),[_,aa]=(0,c.useState)(!1),ab=(0,c.useRef)(null),ac=(0,c.useRef)(null),ad=a?.traceId||a?.traces?.[0]?.traceId||a?.connectionId||"",ae=ad.replace(/^agy-|^claude-/,"")||ad,af=a?.state==="streaming"||a?.state==="busy"||a?.state==="working"||a?.state==="pending"||a?.mode==="streaming",{session:ag,turns:ah,loading:ai,error:aj,refresh:ak,exportMarkdown:al}=(0,A.f)(ad,af);(0,c.useEffect)(()=>{let a=a=>{(a.ctrlKey||a.metaKey)&&"f"===a.key.toLowerCase()&&(a.preventDefault(),$(a=>!a))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let am=(0,c.useMemo)(()=>ah.map(a=>({id:a.id,content:a.content||"",thinking:a.thinking||"",tool_calls:(a.toolCalls||[]).map(a=>({toolName:a.name,description:a.action,args:"string"==typeof a.args?a.args:JSON.stringify(a.args||{})})),output:(a.toolCalls||[]).map(a=>a.output||"").join("\n")})),[ah]);if((0,c.useEffect)(()=>{O&&("telemetry"===M&&ac.current?ac.current.scrollIntoView({behavior:"smooth"}):ab.current&&ab.current.scrollIntoView({behavior:"smooth"}))},[ah.length,M,O]),!a)return null;let an=a.color?`#${a.color.toString(16).padStart(6,"0")}`:"#38bdf8",ao=Array.isArray(a.logs)?a.logs:a.traces?.[0]?.logs||[],ap="app"===a.clientType||String(a.provider||"").toLowerCase().includes("app")||String(a.connectionId||"").toLowerCase().includes("app"),aq=a.isLooping?"Loop Alert":W[a.mode]||a.state||"Active";return(0,b.jsxs)("div",{className:"flex flex-col h-full w-full bg-[var(--bg-editor)] text-[var(--text-main)] select-none overflow-hidden",children:[G?(0,b.jsxs)("div",{className:"border-b border-[var(--border-subtle)] bg-[var(--bg-sidebar)] px-3 py-2 flex items-center justify-between gap-2 shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsxs)("div",{className:"w-6 h-6 rounded-md border flex items-center justify-center shrink-0 relative",style:{borderColor:an,backgroundColor:`${an}25`},children:[(0,b.jsx)(i.f,{className:"w-3.5 h-3.5",style:{color:an}}),af&&(0,b.jsx)("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full border border-slate-900 animate-ping",style:{backgroundColor:an}})]}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("span",{className:"font-bold text-[var(--text-bright)] text-xs truncate max-w-[130px]",children:a.account||`Desk #${(a.deskIndex??0)+1}`}),(0,b.jsxs)("span",{className:`text-[8px] font-mono px-1 py-0.2 rounded font-black tracking-wider uppercase border flex items-center gap-0.5 ${ap?"bg-purple-950/80 border-purple-700/80 text-purple-300":"bg-emerald-950/80 border-emerald-700/80 text-emerald-300"}`,children:[ap?(0,b.jsx)(m.f,{className:"w-2 h-2"}):(0,b.jsx)(l.f,{className:"w-2 h-2"}),(0,b.jsx)("span",{children:ap?"APP":"CLI"})]})]}),(0,b.jsx)("div",{className:"text-[10px] text-[var(--text-muted)] font-mono truncate",children:ag?.model||a.model||"Unavailable"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsx)("button",{onClick:()=>$(!U),className:`p-1 rounded text-xs transition-colors cursor-pointer ${U?"bg-cyan-950 border border-cyan-500/50 text-cyan-300":"text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)]"}`,title:"Search transcript (Ctrl+F)",children:(0,b.jsx)(w.f,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:()=>R(!Q),className:`p-1 rounded text-xs transition-colors cursor-pointer ${Q?"bg-cyan-950 border border-cyan-500/50 text-cyan-300":"text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)]"}`,title:"Agent Details & Specs",children:(0,b.jsx)(j.f,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:ak,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)] transition-colors cursor-pointer",title:"Refresh transcript",children:(0,b.jsx)(h.f,{className:"w-3.5 h-3.5"})}),J&&(0,b.jsx)("button",{onClick:()=>J(ae||ad),className:"p-1 rounded text-cyan-400 hover:text-cyan-200 hover:bg-[var(--bg-hover)] transition-colors cursor-pointer",title:"Time-Machine: Replay this session",children:(0,b.jsx)(x.f,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:()=>aa(!0),className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)] transition-colors cursor-pointer",title:"Export session report (HTML, PDF, Markdown)",children:(0,b.jsx)(g.f,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:()=>(0,B.f)(ae||ad),className:"p-1 rounded text-[var(--text-muted)] hover:text-cyan-300 hover:bg-[var(--bg-hover)] transition-colors cursor-pointer",title:"Open in Detached Window (VS Code style)",children:(0,b.jsx)(z.f,{className:"w-3.5 h-3.5"})})]})]}):(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-[var(--border-subtle)] bg-[var(--bg-titlebar)] rounded-t-2xl shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,b.jsxs)("div",{className:"w-9 h-9 rounded-xl border flex items-center justify-center shrink-0 shadow-inner relative",style:{borderColor:an,backgroundColor:`${an}25`},children:[(0,b.jsx)(i.f,{className:"w-5 h-5",style:{color:an}}),af&&(0,b.jsx)("span",{className:"absolute -top-1 -right-1 w-3 h-3 rounded-full border-2 border-slate-900 animate-ping",style:{backgroundColor:an}})]}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"text-sm font-bold text-[var(--text-bright)] truncate",children:a.account||"AI Agent Session"}),(0,b.jsx)("span",{className:`text-[9px] font-mono px-2 py-0.5 rounded font-black tracking-wider uppercase border flex items-center gap-1 ${ap?"bg-purple-950/80 border-purple-700/80 text-purple-300 shadow-sm shadow-purple-950":"bg-emerald-950/80 border-emerald-700/80 text-emerald-300 shadow-sm shadow-emerald-950"}`,children:ap?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(m.f,{className:"w-2.5 h-2.5"}),(0,b.jsx)("span",{children:"APP"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.f,{className:"w-2.5 h-2.5"}),(0,b.jsx)("span",{children:"CLI"})]})}),(0,b.jsx)("span",{className:`text-[10px] font-mono px-2 py-0.5 rounded border font-semibold uppercase tracking-wider ${a.isLooping?"border-rose-500/50 bg-rose-950/60 text-rose-300 animate-pulse":af?"border-cyan-500/50 bg-cyan-950/60 text-cyan-300":"border-[var(--border-subtle)] bg-[var(--bg-card)] text-[var(--text-main)]"}`,children:aq})]}),(0,b.jsxs)("div",{className:"text-[11px] text-[var(--text-muted)] font-mono truncate mt-0.5 flex items-center gap-1.5",children:[(0,b.jsx)("span",{children:a.connectionId}),(0,b.jsx)("span",{children:"•"}),(0,b.jsx)("span",{className:"text-cyan-400 uppercase",children:ag?.model||a.model||"Unavailable"}),ag?.cwd&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"•"}),(0,b.jsx)("span",{className:"text-[var(--text-muted)] truncate max-w-44",children:ag.cwd})]})]})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[Number.isFinite(ag?.tokens?.input??a?.tokens?.input)&&Number.isFinite(ag?.tokens?.output??a?.tokens?.output)&&Number.isFinite(ag?.tokens?.cached??a?.tokens?.cached)&&(ag?.model||a?.model)&&(0,b.jsx)(F.f,{compact:!0,inputTokens:ag?.tokens?.input??a.tokens.input,outputTokens:ag?.tokens?.output??a.tokens.output,cachedTokens:ag?.tokens?.cached??a.tokens.cached,model:ag?.model||a.model,className:"hidden md:inline-flex mr-1"}),(0,b.jsx)("button",{onClick:()=>$(!U),className:`p-1.5 rounded-lg border text-xs font-medium transition-colors cursor-pointer ${U?"bg-cyan-950 border-cyan-500/50 text-cyan-300 shadow-sm shadow-cyan-500/10":"border-[var(--border-subtle)] text-[var(--text-muted)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-bright)]"}`,title:"Search transcript (Ctrl+F)",children:(0,b.jsx)(w.f,{className:"w-3.5 h-3.5"})}),(0,b.jsxs)("button",{onClick:()=>R(!Q),className:`flex items-center gap-1 px-2 py-1.5 rounded-lg border text-xs font-medium transition-colors cursor-pointer ${Q?"bg-cyan-950 border-cyan-500/50 text-cyan-300":"border-[var(--border-subtle)] text-[var(--text-muted)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-bright)]"}`,title:"Agent Details & Specs",children:[(0,b.jsx)(j.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Details"}),Q?(0,b.jsx)(q.f,{className:"w-3 h-3"}):(0,b.jsx)(p.f,{className:"w-3 h-3"})]}),(0,b.jsx)("button",{onClick:ak,className:"p-1.5 rounded-lg text-[var(--text-muted)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-bright)] transition-colors cursor-pointer",title:"Refresh transcript",children:(0,b.jsx)(h.f,{className:"w-4 h-4"})}),J&&(0,b.jsxs)("button",{onClick:()=>{J(ae||ad),H?.()},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-cyan-950/80 hover:bg-cyan-900 text-cyan-300 text-xs font-semibold border border-cyan-500/40 transition-colors shadow-sm cursor-pointer",title:"Time-Machine: Replay this session",children:[(0,b.jsx)(x.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Replay"})]}),(0,b.jsxs)("button",{onClick:()=>aa(!0),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-[var(--bg-card)] hover:bg-[var(--bg-hover)] text-[var(--text-main)] text-xs font-medium border border-[var(--border-subtle)] transition-colors cursor-pointer",title:"Export session report (HTML, PDF, Markdown)",children:[(0,b.jsx)(g.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Export"})]}),I&&(0,b.jsxs)("button",{onClick:()=>I(a),className:"flex items-center gap-1 px-2 py-1.5 rounded-lg bg-[var(--bg-card)] hover:bg-[var(--accent-primary)] text-[var(--text-main)] hover:text-white text-xs font-medium border border-[var(--border-subtle)] transition-colors cursor-pointer",title:"Dock into Sidebar",children:[(0,b.jsx)(y.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Sidebar"})]}),(0,b.jsxs)("button",{onClick:()=>{(0,B.f)(ae||ad),H?.()},className:"flex items-center gap-1 px-2 py-1.5 rounded-lg bg-[var(--bg-card)] hover:bg-[var(--accent-primary)] text-[var(--text-main)] hover:text-white text-xs font-medium border border-[var(--border-subtle)] transition-colors cursor-pointer",title:"Open in Detached Window (VS Code style)",children:[(0,b.jsx)(z.f,{className:"w-3.5 h-3.5 text-cyan-400"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"New Window"})]}),L&&(0,b.jsxs)("button",{onClick:L,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-medium transition-colors cursor-pointer ${K?"bg-cyan-950 border-cyan-500/50 text-cyan-300 shadow-sm shadow-cyan-500/10 font-semibold":"border-[var(--border-subtle)] bg-[var(--bg-card)] text-[var(--text-main)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-bright)]"}`,title:K?"Exit Fullscreen":"Fullscreen",children:[K?(0,b.jsx)(f.f,{className:"w-3.5 h-3.5 text-cyan-300"}):(0,b.jsx)(e.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:K?"Exit Fullscreen":"Fullscreen"})]}),(0,b.jsx)("button",{onClick:H,className:"p-1.5 rounded-lg text-[var(--text-muted)] hover:bg-[var(--bg-hover)] hover:text-rose-400 transition-colors cursor-pointer",title:"Close window",children:(0,b.jsx)(d.X,{className:"w-4 h-4"})})]})]}),U&&(0,b.jsx)("div",{className:`py-2 border-b border-[var(--border-subtle)] bg-[var(--bg-sidebar)] flex justify-end shrink-0 ${G?"px-3":"px-5"}`,children:(0,b.jsx)(E.f,{isOpen:U,onClose:()=>$(!1),steps:am,onJumpToStep:a=>{let b=ah[a];if(b){let a=document.getElementById(`chat-turn-${b.id}`);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),a.classList.add("ring-2","ring-cyan-400","shadow-cyan-500/20","transition-all"),setTimeout(()=>{a.classList.remove("ring-2","ring-cyan-400","shadow-cyan-500/20")},2500))}}})}),a.isLooping&&(0,b.jsxs)("div",{className:`my-2 rounded-lg border border-rose-500/40 bg-rose-500/10 p-2 text-xs text-rose-300 flex items-start gap-2 animate-pulse shrink-0 ${G?"mx-3":"mx-5"}`,children:[(0,b.jsx)(n.f,{className:"w-4 h-4 text-rose-400 shrink-0 mt-0.5"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"font-bold text-rose-200",children:"Runaway Loop Alert Detected"}),(0,b.jsx)("div",{className:"text-[11px] text-rose-300/80 mt-0.5",children:"5+ repeated consecutive tool actions occurred within 60s without task progression."})]})]}),Q&&(0,b.jsxs)("div",{className:`py-2.5 border-b border-[#2b2b2b] bg-[#181818] text-xs space-y-2.5 animate-in fade-in slide-in-from-top-1 shrink-0 ${G?"px-3":"px-5"}`,children:[(0,b.jsxs)("div",{className:`grid gap-2 ${G?"grid-cols-2":"grid-cols-2 sm:grid-cols-4"}`,children:[(0,b.jsxs)("div",{className:"rounded-lg bg-[#252526] p-2 border border-[#333333]",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-500 tracking-wider",children:"Provider"}),(0,b.jsx)("p",{className:"font-semibold text-cyan-400 mt-0.5 truncate uppercase",children:a.provider||"Unavailable"})]}),(0,b.jsxs)("div",{className:"rounded-lg bg-[#252526] p-2 border border-[#333333]",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-500 tracking-wider",children:"Elapsed"}),(0,b.jsx)("p",{className:"font-semibold text-slate-200 mt-0.5",children:Number.isFinite(ag?.durationMs??a.elapsedMs)?Z(ag?.durationMs??a.elapsedMs):"Unavailable"})]}),(0,b.jsxs)("div",{className:"rounded-lg bg-[#252526] p-2 border border-[#333333]",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-500 tracking-wider",children:"Cached"}),(0,b.jsx)("p",{className:"font-semibold text-emerald-400 mt-0.5",children:Number.isFinite(ag?.tokens?.cached??a?.tokens?.cached)?`${Y(ag?.tokens?.cached??a.tokens.cached)} (${a.cachedPct??"—"}%)`:"Unavailable"})]}),(0,b.jsxs)("div",{className:"rounded-lg bg-[#252526] p-2 border border-[#333333]",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-500 tracking-wider",children:"Tools"}),(0,b.jsx)("p",{className:"font-semibold text-slate-300 mt-0.5 truncate",children:a.tools?.length?a.tools.join(", "):"None"})]})]}),Number.isFinite(ag?.tokens?.input??a?.tokens?.input)&&Number.isFinite(ag?.tokens?.output??a?.tokens?.output)&&Number.isFinite(ag?.tokens?.cached??a?.tokens?.cached)&&(ag?.model||a?.model)&&(0,b.jsx)(F.f,{inputTokens:ag?.tokens?.input??a.tokens.input,outputTokens:ag?.tokens?.output??a.tokens.output,cachedTokens:ag?.tokens?.cached??a.tokens.cached,model:ag?.model||a.model}),a.currentCommand&&(0,b.jsxs)("div",{className:"rounded-lg bg-black/70 p-2 border border-[#333333]",children:[(0,b.jsx)("div",{className:"text-[10px] uppercase font-bold text-slate-400 tracking-wider mb-1",children:"Active Command / File"}),(0,b.jsx)("div",{className:"font-mono text-[11px] text-emerald-400 truncate",children:a.currentCommand})]}),a.fallbackFrom&&(0,b.jsxs)("div",{className:"text-[11px] text-amber-400 flex items-center gap-1.5",children:[(0,b.jsx)(n.f,{className:"w-3.5 h-3.5 shrink-0"}),(0,b.jsxs)("span",{children:["Rerouted fallback from: ",(0,b.jsx)("strong",{className:"font-bold",children:a.fallbackFrom})]})]}),a.errorReason&&(0,b.jsxs)("div",{className:"text-[11px] text-rose-400 flex items-center gap-1.5",children:[(0,b.jsx)(o.f,{className:"w-3.5 h-3.5 shrink-0"}),(0,b.jsxs)("span",{children:["Failure cause: ",(0,b.jsx)("strong",{className:"font-bold",children:a.errorReason})]})]})]}),(0,b.jsxs)("div",{className:`flex items-center justify-between border-b border-[var(--border-subtle)] bg-[var(--bg-editor)] text-xs shrink-0 py-1.5 ${G?"px-3":"px-5"}`,children:[(0,b.jsx)("div",{className:"flex items-center gap-1 bg-[var(--bg-workbench)] p-0.5 rounded-lg border border-[var(--border-subtle)] overflow-x-auto max-w-full",children:[{id:"all",label:"All",icon:r.f},{id:"prompts",label:"Prompts",icon:s.f},{id:"tools",label:"Tools",icon:t.f},{id:"thinking",label:"Thinking",icon:u.f},{id:"telemetry",label:`Logs (${ao.length})`,icon:v.f}].map(a=>{let c=a.icon;return(0,b.jsxs)("button",{onClick:()=>N(a.id),className:`flex items-center gap-1 px-2 py-0.5 rounded text-[11px] font-medium transition-all whitespace-nowrap cursor-pointer ${M===a.id?"bg-[var(--bg-card)] text-[var(--accent-secondary)] shadow-sm font-semibold border border-[var(--border-card)]":"text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)]"}`,children:[(0,b.jsx)(c,{className:"w-3 h-3 shrink-0"}),(0,b.jsx)("span",{children:a.label})]},a.id)})}),(0,b.jsx)("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:(0,b.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)] cursor-pointer select-none",children:[(0,b.jsx)("input",{type:"checkbox",checked:O,onChange:a=>P(a.target.checked),className:"rounded border-[var(--border-card)] bg-[var(--bg-card)] text-[var(--accent-primary)] focus:ring-0 w-3 h-3 cursor-pointer"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Auto-scroll"})]})})]}),(0,b.jsx)("div",{className:`flex-1 overflow-y-auto space-y-2 select-text ${G?"p-3":"p-5"}`,children:"telemetry"===M?(0,b.jsxs)("div",{className:"space-y-2 font-mono text-[11px]",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between pb-1.5 mb-2 border-b border-[var(--border-subtle)] text-xs text-[var(--text-muted)]",children:[(0,b.jsx)("span",{className:"font-semibold text-[var(--text-bright)]",children:"Terminal Telemetry Stream"}),(0,b.jsxs)("span",{children:["Last ",ao.length," actions"]})]}),0===ao.length?(0,b.jsx)("div",{className:"py-12 text-center text-[var(--text-muted)] text-xs",children:"No telemetry actions recorded yet for this session."}):ao.map((a,c)=>{let d=X[a.type]||"border-slate-700 bg-slate-800/60 text-slate-300";return(0,b.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-[var(--bg-chat-code)] border border-[var(--border-subtle)] hover:border-[var(--border-card)] transition-colors",children:[(0,b.jsx)("span",{className:"text-[10px] text-[var(--text-muted)] opacity-70 whitespace-nowrap pt-0.5",children:function(a){if(!a)return"";try{let b=new Date(a);if(!isNaN(b.getTime()))return b.toLocaleTimeString([],{hour12:!1})}catch{}return String(a).slice(11,19)}(a.timestamp)}),(0,b.jsx)("span",{className:`rounded border px-1.5 py-0.2 text-[9px] font-bold uppercase tracking-wider shrink-0 ${d}`,children:a.type}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("div",{className:"text-[var(--text-bright)] font-medium truncate",children:a.summary||a.type}),a.detail&&(0,b.jsx)("div",{className:"text-[var(--text-muted)] text-[11px] truncate mt-0.5 whitespace-pre-wrap break-all",children:a.detail})]})]},c)}),(0,b.jsx)("div",{ref:ac})]}):(0,b.jsxs)(b.Fragment,{children:[ai&&0===ah.length&&(0,b.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-[var(--text-muted)] gap-2 py-12",children:[(0,b.jsx)(h.f,{className:"w-5 h-5 animate-spin text-cyan-400"}),(0,b.jsx)("span",{className:"text-xs",children:"Loading session transcript..."})]}),aj&&0===ah.length&&(0,b.jsx)("div",{className:"h-full flex flex-col items-center justify-center text-[var(--text-muted)] gap-2 py-12",children:(0,b.jsxs)("div",{className:"p-3 rounded-lg bg-rose-950/30 border border-rose-800/40 text-rose-300 text-xs text-center max-w-md",children:[(0,b.jsx)("p",{className:"font-semibold mb-1",children:"Unable to load transcript"}),(0,b.jsx)("p",{className:"text-[11px] text-rose-400",children:aj})]})}),!ai&&0===ah.length&&!aj&&(0,b.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-[var(--text-muted)] gap-2 py-12",children:[(0,b.jsx)(k.f,{className:"w-8 h-8 opacity-40"}),(0,b.jsx)("span",{className:"text-xs",children:"No conversation history found for this session."})]}),ah.map(c=>(0,b.jsx)(C.f,{turn:c,agentColor:a.color?a.color.toString(16).padStart(6,"0"):"38bdf8",filter:M,onImageClick:a=>T(a)},c.id)),(0,b.jsx)("div",{ref:ab})]})}),(0,b.jsxs)("div",{className:`border-t border-[var(--border-subtle)] bg-[var(--bg-workbench)] flex items-center justify-between text-[11px] text-[var(--text-muted)] font-mono shrink-0 py-2 ${G?"px-3":"px-5 rounded-b-2xl"}`,children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 truncate",children:[(0,b.jsxs)("span",{children:[ah.length," turns"]}),(0,b.jsx)("span",{children:"•"}),(0,b.jsx)("span",{className:"truncate",children:Z(ag?.durationMs||a?.elapsedMs)}),af&&(0,b.jsxs)("span",{className:"hidden sm:inline-flex items-center gap-1 text-cyan-400",children:[(0,b.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-ping inline-block"}),"Live"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,b.jsxs)("span",{children:["In ",Y(ag?.tokens?.input||a?.tokens?.input)]}),(0,b.jsxs)("span",{children:["Out ",Y(ag?.tokens?.output||a?.tokens?.output)]}),(ag?.tokens?.cached||a?.tokens?.cached)>0&&(0,b.jsxs)("span",{className:"text-cyan-400 hidden sm:inline",children:["Cache ",Y(ag?.tokens?.cached||a?.tokens?.cached)]})]})]}),S&&(0,b.jsx)(D.f,{image:S,onClose:()=>T(null)}),(0,b.jsx)(V,{isOpen:_,onClose:()=>aa(!1),session:ag,turns:ah})]})}],33364);let $={showcase:{agents:24,errorRatio:0,preset:"showcase",label:"All Items Showcase (24)"},cases:{agents:17,errorRatio:0,cases:!0,label:"Edge Cases & Items (17)"},showcase_skins:{agents:15,errorRatio:0,preset:"showcase_skins",label:"Skins & Outfits (15)"},showcase_props:{agents:14,errorRatio:0,preset:"showcase_props",label:"Tech Props & Gadgets (14)"},showcase_pets:{agents:12,errorRatio:0,preset:"showcase_pets",label:"Pets & Companions (12)"},showcase_auras:{agents:12,errorRatio:0,preset:"showcase_auras",label:"Particle Auras & VFX (12)"},showcase_trophies:{agents:12,errorRatio:0,preset:"showcase_trophies",label:"Trophies & Badges (12)"},storm:{agents:30,errorRatio:.15,label:"Storm (30 Agents)"},busy:{agents:8,errorRatio:0,label:"Busy (8 Agents)"},idle:{agents:2,errorRatio:0,label:"Idle (2 Agents)"},errors:{agents:10,errorRatio:.6,label:"Error States"}},_=[{account:"Claude Code · main",icon:"terminal"},{account:"Claude Code · review",icon:"rate_review"},{account:"Antigravity · agent",icon:"smart_toy"},{account:"Antigravity · dev",icon:"construction"},{account:"Cursor · workspace",icon:"edit_note"},{account:"OpenCode · build",icon:"science"},{account:"Aider",icon:"smart_toy"},{account:"Continue · dev",icon:"play_arrow"}],aa=[{provider:"claude",model:"claude-3-7-sonnet"},{provider:"gemini",model:"gemini-2.5-pro"},{provider:"openai",model:"gpt-4o"},{provider:"minimax",model:"minimax-m2"},{provider:"deepseek",model:"deepseek-v3"}],ab=["rate_limited","upstream_timeout","quota_exhausted","auth_refresh_failed"],ac=["bash","read","edit","search","web","mcp","agent","gitnexus","browser","git","docker"],ad=[{name:"01 · Sleeping (Dozing Shiba)",state:"done",ageMs:38e3,skin:"skin_0",props:["prop_100"],pet:"pet_50",aura:"none",trophy:"none"},{name:"02 · Happy (Celebration)",state:"done",ageMs:9e3,cost:1.42,skin:"skin_200",props:["prop_200"],pet:"pet_1",aura:"aura_25",trophy:"trophy_0"},{name:"03 · Pending (Drone Thinking)",state:"pending",ageMs:2500,tools:["todo"],skin:"skin_100",props:["prop_50"],pet:"pet_100",aura:"none",trophy:"none"},{name:"04 · GitNexus (Matrix Rain)",state:"streaming",ageMs:14e3,tools:["gitnexus","read"],skin:"skin_150",props:["prop_0"],pet:"pet_150",aura:"aura_0",trophy:"trophy_25"},{name:"05 · Docker (Quantum Mist)",state:"streaming",ageMs:15e3,tools:["docker","bash"],skin:"skin_50",props:["prop_50"],pet:"pet_1",aura:"aura_50",trophy:"none"},{name:"06 · Browser (Holo Emitter)",state:"streaming",ageMs:16e3,tools:["browser","web"],skin:"skin_1",props:["prop_150"],pet:"pet_100",aura:"aura_75",trophy:"trophy_50"},{name:"07 · Git+Agent (Arcade Diamond)",state:"streaming",ageMs:12e3,tools:["git","agent"],concurrent:4,skin:"skin_51",props:["prop_200"],pet:"pet_50",aura:"aura_25",trophy:"trophy_75"},{name:"08 · Rate Limited (Oscilloscope)",state:"error",ageMs:6e3,error:"rate_limited",skin:"skin_101",props:["prop_300"],pet:"pet_150",aura:"aura_75",trophy:"trophy_50"},{name:"09 · Upstream Timeout (Bonsai)",state:"error",ageMs:3e4,error:"upstream_timeout",skin:"skin_201",props:["prop_250"],pet:"pet_100",aura:"none",trophy:"none"},{name:"10 · Quota Exhausted (Server)",state:"error",ageMs:8e3,error:"quota_exhausted",skin:"skin_151",props:["prop_0"],pet:"pet_1",aura:"aura_0",trophy:"none"},{name:"11 · Auth Failed (Ninja Spark)",state:"error",ageMs:5e3,error:"auth_refresh_failed",skin:"skin_100",props:["prop_100"],pet:"pet_50",aura:"aura_75",trophy:"none"},{name:"12 · Fallback 1 (Espresso Station)",state:"streaming",ageMs:13e3,tools:["bash"],fallbackShift:3,skin:"skin_0",props:["prop_100"],pet:"pet_1",aura:"aura_50",trophy:"trophy_0"},{name:"13 · Fallback 2 (Holo + Key)",state:"streaming",ageMs:14e3,tools:["browser","mcp"],fallbackShift:2,skin:"skin_50",props:["prop_150"],pet:"pet_150",aura:"aura_25",trophy:"trophy_0"},{name:"14 · Slow Task (DualMon + Owl)",state:"streaming",ageMs:36e3,tools:["docker"],skin:"skin_152",props:["prop_50"],pet:"pet_150",aura:"aura_0",trophy:"trophy_25"},{name:"15 · Queue+Cached (Bonsai Master)",state:"streaming",ageMs:1e4,tools:["read","search"],concurrent:5,cachedBoost:!0,skin:"skin_202",props:["prop_250"],pet:"pet_50",aura:"aura_50",trophy:"trophy_50"},{name:"16 · Runaway Loop (Oscilloscope)",state:"streaming",ageMs:18e3,tools:["bash"],isLooping:!0,skin:"skin_102",props:["prop_300"],pet:"pet_1",aura:"aura_75",trophy:"trophy_75"},{name:"17 · Expensive Task (Arcade Bug)",state:"done",ageMs:2e4,cost:7.35,skin:"skin_52",props:["prop_200","prop_0"],pet:"pet_100",aura:"aura_25",trophy:"trophy_75"}],ae=[{name:"01 · CyberSuit · Server · Cat",state:"streaming",ageMs:14e3,tools:["gitnexus","read"],skin:"skin_0",props:["prop_0"],pet:"pet_1",aura:"aura_25",trophy:"trophy_0"},{name:"02 · MechaPilot · DualMon · Shiba",state:"streaming",ageMs:16e3,tools:["docker","bash"],skin:"skin_50",props:["prop_50"],pet:"pet_50",aura:"aura_50",trophy:"trophy_25"},{name:"03 · StealthNinja · Espresso · Drone",state:"happy",ageMs:9e3,cost:1.45,tools:["edit"],skin:"skin_100",props:["prop_100"],pet:"pet_100",aura:"aura_75",trophy:"trophy_50"},{name:"04 · MatrixHacker · Holo · Owl",state:"streaming",ageMs:18e3,tools:["browser","web"],skin:"skin_150",props:["prop_150"],pet:"pet_150",aura:"aura_0",trophy:"trophy_75"},{name:"05 · CelestialAstro · Arcade · Cat",state:"happy",ageMs:11e3,cost:2.1,tools:["bash"],skin:"skin_200",props:["prop_200"],pet:"pet_2",aura:"aura_25",trophy:"trophy_0"},{name:"06 · CyberSuit · Bonsai + Server",state:"pending",ageMs:2400,tools:["todo"],skin:"skin_1",props:["prop_250","prop_1"],pet:"pet_51",aura:"aura_50",trophy:"trophy_25"},{name:"07 · MechaPilot · Oscilloscope · Drone",state:"streaming",ageMs:22e3,tools:["agent","git"],skin:"skin_51",props:["prop_300"],pet:"pet_101",aura:"aura_75",trophy:"trophy_50"},{name:"08 · StealthNinja · DualMon + Espresso",state:"streaming",ageMs:15e3,tools:["read","search"],skin:"skin_101",props:["prop_51","prop_101"],pet:"pet_151",aura:"aura_0",trophy:"trophy_75"},{name:"09 · MatrixHacker · Oscilloscope (Loop)",state:"streaming",ageMs:19e3,tools:["bash"],isLooping:!0,skin:"skin_151",props:["prop_301"],pet:"pet_3",aura:"aura_25",trophy:"trophy_0"},{name:"10 · CelestialAstro · Holo · Shiba",state:"streaming",ageMs:13e3,tools:["mcp","bash"],skin:"skin_201",props:["prop_151"],pet:"pet_52",aura:"aura_50",trophy:"trophy_25"},{name:"11 · CyberSuit · Arcade · Drone",state:"streaming",ageMs:21e3,tools:["docker"],skin:"skin_2",props:["prop_201"],pet:"pet_102",aura:"aura_75",trophy:"trophy_50"},{name:"12 · MechaPilot · Bonsai · Owl (Sleep)",state:"done",ageMs:39e3,skin:"skin_52",props:["prop_251"],pet:"pet_152",aura:"aura_0",trophy:"trophy_75"},{name:"13 · StealthNinja · Server (Error)",state:"error",ageMs:6500,error:"rate_limited",skin:"skin_102",props:["prop_2"],pet:"pet_1",aura:"aura_26",trophy:"trophy_1"},{name:"14 · MatrixHacker · DualMon · Shiba",state:"streaming",ageMs:12e3,tools:["web","read"],skin:"skin_152",props:["prop_52"],pet:"pet_50",aura:"aura_51",trophy:"trophy_26"},{name:"15 · CelestialAstro · Espresso · Drone",state:"happy",ageMs:8500,cost:3.2,tools:["git"],skin:"skin_202",props:["prop_102"],pet:"pet_100",aura:"aura_76",trophy:"trophy_51"},{name:"16 · CyberSuit · Holo · Owl",state:"streaming",ageMs:17e3,tools:["bash","edit"],skin:"skin_0",props:["prop_152"],pet:"pet_150",aura:"aura_1",trophy:"trophy_76"},{name:"17 · MechaPilot · Arcade · Cat",state:"streaming",ageMs:14e3,tools:["agent","gitnexus"],skin:"skin_50",props:["prop_202"],pet:"pet_2",aura:"aura_27",trophy:"trophy_2"},{name:"18 · StealthNinja · Bonsai · Shiba",state:"pending",ageMs:2200,tools:["todo"],skin:"skin_100",props:["prop_252"],pet:"pet_51",aura:"aura_52",trophy:"trophy_27"},{name:"19 · MatrixHacker · Oscilloscope · Drone",state:"streaming",ageMs:16e3,tools:["docker","mcp"],skin:"skin_150",props:["prop_302"],pet:"pet_101",aura:"aura_77",trophy:"trophy_52"},{name:"20 · CelestialAstro · Server · Owl",state:"streaming",ageMs:25e3,tools:["read","bash"],skin:"skin_200",props:["prop_0"],pet:"pet_151",aura:"aura_2",trophy:"trophy_77"},{name:"21 · CyberSuit · DualMon + Arcade",state:"happy",ageMs:9500,cost:4.5,tools:["gitnexus"],skin:"skin_1",props:["prop_50","prop_200"],pet:"pet_1",aura:"aura_25",trophy:"trophy_0"},{name:"22 · MechaPilot · Espresso + Holo",state:"streaming",ageMs:13500,tools:["web","mcp"],skin:"skin_51",props:["prop_100","prop_150"],pet:"pet_50",aura:"aura_50",trophy:"trophy_25"},{name:"23 · StealthNinja · Oscilloscope + Server",state:"streaming",ageMs:15500,tools:["agent","bash"],skin:"skin_101",props:["prop_300","prop_1"],pet:"pet_100",aura:"aura_75",trophy:"trophy_50"},{name:"24 · MatrixHacker · Bonsai + DualMon",state:"streaming",ageMs:17500,tools:["git","edit"],skin:"skin_151",props:["prop_250","prop_51"],pet:"pet_150",aura:"aura_0",trophy:"trophy_75"}],af=[{name:"Neon Enforcer (Visor)",skin:"skin_0",state:"streaming",ageMs:12e3,tools:["bash"],props:["prop_50"]},{name:"Crimson Striker (Monocle)",skin:"skin_1",state:"streaming",ageMs:14e3,tools:["read"],props:["prop_100"]},{name:"Electric Specter (Horns)",skin:"skin_3",state:"happy",ageMs:9e3,tools:["edit"],props:["prop_200"]},{name:"Obsidian Ronin (Kabuto)",skin:"skin_7",state:"pending",ageMs:2500,tools:["todo"],props:["prop_250"]},{name:"Apex Frame (V-Fin)",skin:"skin_10",state:"streaming",ageMs:16e3,tools:["docker"],props:["prop_0"]},{name:"Heavy Colossus (Blast)",skin:"skin_11",state:"streaming",ageMs:18e3,tools:["agent"],props:["prop_150"]},{name:"Berserk EVA (Horn)",skin:"skin_12",state:"streaming",ageMs:15e3,tools:["search"],props:["prop_300"]},{name:"Shadow Shinobi (Headband)",skin:"skin_20",state:"streaming",ageMs:13e3,tools:["gitnexus"],props:["prop_250"]},{name:"Kage Oni (Demon Mask)",skin:"skin_22",state:"streaming",ageMs:15e3,tools:["search"],props:["prop_51"]},{name:"Cyber Kasa (Conical Hat)",skin:"skin_24",state:"done",ageMs:38e3,props:["prop_101"]},{name:"Root Netrunner (Hoodie)",skin:"skin_30",state:"streaming",ageMs:17e3,tools:["web"],props:["prop_0"]},{name:"Binary Coder (VR Goggles)",skin:"skin_31",state:"streaming",ageMs:19e3,tools:["bash"],isLooping:!0,props:["prop_301"]},{name:"Cablehead (Dreadlocks)",skin:"skin_37",state:"streaming",ageMs:11e3,tools:["mcp"],props:["prop_151"]},{name:"Solar Voyager (Bubble Dome)",skin:"skin_40",state:"happy",ageMs:8e3,tools:["git"],props:["prop_201"]},{name:"Nebula Drifter (Saturn Ring)",skin:"skin_43",state:"error",ageMs:6e3,error:"rate_limited",props:["prop_52"]}],ag=[{name:"Supercomputer Solo",props:["prop_0"],skin:"skin_0",state:"streaming",ageMs:12e3,tools:["docker"]},{name:"Supercomputer + DualMon",props:["prop_0","prop_50"],skin:"skin_50",state:"streaming",ageMs:15e3,tools:["bash"]},{name:"Dual Monitor Solo",props:["prop_50"],skin:"skin_100",state:"streaming",ageMs:14e3,tools:["read"]},{name:"DualMon + Espresso",props:["prop_50","prop_100"],skin:"skin_150",state:"happy",ageMs:9e3,tools:["edit"]},{name:"Espresso Station Solo",props:["prop_100"],skin:"skin_200",state:"streaming",ageMs:16e3,tools:["web"]},{name:"Espresso + Holo",props:["prop_100","prop_150"],skin:"skin_1",state:"streaming",ageMs:18e3,tools:["agent"]},{name:"Hologram Emitter Solo",props:["prop_150"],skin:"skin_51",state:"streaming",ageMs:13e3,tools:["gitnexus"]},{name:"Holo + Arcade",props:["prop_150","prop_200"],skin:"skin_101",state:"happy",ageMs:11e3,tools:["git"]},{name:"Arcade Cabinet Solo",props:["prop_200"],skin:"skin_151",state:"streaming",ageMs:17e3,tools:["bash"]},{name:"Arcade + Bonsai",props:["prop_200","prop_250"],skin:"skin_201",state:"pending",ageMs:2500,tools:["todo"]},{name:"Terrarium Bonsai Solo",props:["prop_250"],skin:"skin_2",state:"done",ageMs:38e3},{name:"Bonsai + Oscilloscope",props:["prop_250","prop_300"],skin:"skin_52",state:"streaming",ageMs:2e4,tools:["docker"]},{name:"Lab Oscilloscope Solo",props:["prop_300"],skin:"skin_102",state:"streaming",ageMs:19e3,tools:["bash"],isLooping:!0},{name:"Oscilloscope + Server",props:["prop_300","prop_0"],skin:"skin_152",state:"error",ageMs:6e3,error:"rate_limited"}],ah=[{name:"Cyber Cat (Cozy)",pet:"pet_1",skin:"skin_0",state:"streaming",ageMs:12e3,tools:["bash"]},{name:"Cyber Cat (Playful)",pet:"pet_2",skin:"skin_50",state:"happy",ageMs:9e3,tools:["edit"]},{name:"Cyber Cat (Sleeping)",pet:"pet_3",skin:"skin_100",state:"done",ageMs:38e3},{name:"Dozing Shiba (Golden)",pet:"pet_50",skin:"skin_150",state:"streaming",ageMs:14e3,tools:["read"]},{name:"Dozing Shiba (Alert)",pet:"pet_51",skin:"skin_200",state:"happy",ageMs:1e4,tools:["git"]},{name:"Dozing Shiba (Resting)",pet:"pet_52",skin:"skin_1",state:"pending",ageMs:2400,tools:["todo"]},{name:"Hover Drone (Orbital)",pet:"pet_100",skin:"skin_51",state:"streaming",ageMs:16e3,tools:["docker"]},{name:"Hover Drone (Patrol)",pet:"pet_101",skin:"skin_101",state:"streaming",ageMs:18e3,tools:["agent"]},{name:"Hover Drone (Recon)",pet:"pet_102",skin:"skin_151",state:"error",ageMs:6500,error:"quota_exhausted"},{name:"Cyber Owl (Clockwork)",pet:"pet_150",skin:"skin_201",state:"streaming",ageMs:13e3,tools:["web"]},{name:"Cyber Owl (Wisdom)",pet:"pet_151",skin:"skin_2",state:"happy",ageMs:8500,tools:["gitnexus"]},{name:"Cyber Owl (Night Watch)",pet:"pet_152",skin:"skin_52",state:"streaming",ageMs:22e3,tools:["mcp"]}],ai=[{name:"Matrix Rain (Laser Green)",aura:"aura_0",skin:"skin_150",state:"streaming",ageMs:14e3,tools:["gitnexus"]},{name:"Matrix Rain (Emerald)",aura:"aura_1",skin:"skin_151",state:"streaming",ageMs:17e3,tools:["bash"],isLooping:!0},{name:"Matrix Rain (Jade)",aura:"aura_2",skin:"skin_152",state:"happy",ageMs:9e3,tools:["read"]},{name:"Plasma Ring (Cyan Orbit)",aura:"aura_25",skin:"skin_0",state:"streaming",ageMs:13e3,tools:["web"]},{name:"Plasma Ring (Electric)",aura:"aura_26",skin:"skin_1",state:"happy",ageMs:11e3,tools:["edit"]},{name:"Plasma Ring (Cosmic)",aura:"aura_27",skin:"skin_2",state:"pending",ageMs:2500,tools:["todo"]},{name:"Quantum Mist (Nebula)",aura:"aura_50",skin:"skin_50",state:"streaming",ageMs:15e3,tools:["docker"]},{name:"Quantum Mist (Violet)",aura:"aura_51",skin:"skin_51",state:"streaming",ageMs:18e3,tools:["agent"]},{name:"Quantum Mist (Astral)",aura:"aura_52",skin:"skin_52",state:"done",ageMs:38e3},{name:"Glitch Halo (Prismatic)",aura:"aura_75",skin:"skin_100",state:"streaming",ageMs:16e3,tools:["mcp"]},{name:"Glitch Halo (Amber Shock)",aura:"aura_76",skin:"skin_101",state:"error",ageMs:6e3,error:"rate_limited"},{name:"Glitch Halo (Neon Spark)",aura:"aura_77",skin:"skin_102",state:"streaming",ageMs:2e4,tools:["git"]}],aj=[{name:"Golden Key (Master)",trophy:"trophy_0",skin:"skin_0",state:"happy",ageMs:9e3,cost:2.5,tools:["edit"]},{name:"Golden Key (Champion)",trophy:"trophy_1",skin:"skin_1",state:"streaming",ageMs:14e3,tools:["bash"]},{name:"Golden Key (Honor)",trophy:"trophy_2",skin:"skin_2",state:"pending",ageMs:2500,tools:["todo"]},{name:"Silicon Wafer (3nm)",trophy:"trophy_25",skin:"skin_50",state:"streaming",ageMs:16e3,tools:["docker"]},{name:"Silicon Wafer (Nanometer)",trophy:"trophy_26",skin:"skin_51",state:"happy",ageMs:1e4,cost:3.1,tools:["git"]},{name:"Silicon Wafer (Quantum)",trophy:"trophy_27",skin:"skin_52",state:"streaming",ageMs:19e3,tools:["read"]},{name:"Quantum Crystal (Prism)",trophy:"trophy_50",skin:"skin_100",state:"streaming",ageMs:13e3,tools:["gitnexus"]},{name:"Quantum Crystal (Facet)",trophy:"trophy_51",skin:"skin_101",state:"happy",ageMs:8500,cost:1.8,tools:["web"]},{name:"Quantum Crystal (Pillar)",trophy:"trophy_52",skin:"skin_102",state:"done",ageMs:38e3},{name:"Diamond Bug (Zero-Day)",trophy:"trophy_75",skin:"skin_150",state:"streaming",ageMs:15e3,tools:["agent"]},{name:"Diamond Bug (Flawless)",trophy:"trophy_76",skin:"skin_151",state:"streaming",ageMs:18e3,tools:["bash"],isLooping:!0},{name:"Diamond Bug (Exalted)",trophy:"trophy_77",skin:"skin_152",state:"error",ageMs:6500,error:"rate_limited"}];function ak(a){let b=a>>>0||1;return()=>(b^=b<<13,b^=b>>>17,b^=b<<5,(b>>>=0)/0x100000000)}let al=0;function am(){return!0}function an(){if(am())return;let a=Date.now();a-al<250||(al=a)}function ao(){!am()}function ap(){!am()}function aq(){!am()}function ar(){return!1}async function as(){return!1}a.s(["p",0,am,"o",0,ap,"f",0,ao,"C",0,aq,"L",0,an,"Z",0,function(){return!!am()}],67207);let at=0;function au(a="Agent Desk",b="Task completed successfully."){if(!ar())return;let c=Date.now();if(!(c-at<3e3)){at=c;try{let c=new Notification(`[DONE] Task Complete: ${a}`,{body:b,icon:"/icons/icon-192x192.png",tag:`done-${a}`});c.onclick=()=>{window.focus(),c.close()}}catch{}}}function av(a="Agent Desk",b="Runaway loop detected!"){if(!ar())return;let c=Date.now();if(!(c-at<3e3)){at=c;try{let c=new Notification(`[ALERT] AGMon Alert: ${a}`,{body:b,icon:"/icons/icon-192x192.png",tag:`alert-${a}`});c.onclick=()=>{window.focus(),c.close()}}catch{}}}a.s(["p",0,ar,"Z",0,av,"a",0,au,"i",0,as],73958),a.s(["f",0,function({mode:a="live",preset:b="cases"}={}){let[d,e]=(0,c.useState)([]),[f,g]=(0,c.useState)([]),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null),p=(0,c.useRef)(new Map),q=(0,c.useCallback)(a=>{if(!Array.isArray(a)||0===a.length)return;let b=p.current,c=!1;for(let d of a){let a=d.connectionId||d.id,e=b.get(a),f=d.state;"streaming"===f&&(c=!0),d.isLooping&&!b.get(`${a}_looping`)?(ap(),av(d.account||a,"Runaway loop detected! Repeated tool calls."),b.set(`${a}_looping`,!0)):d.isLooping||b.delete(`${a}_looping`),e&&e!==f&&("done"===f?(ao(),au(d.account||a,"All tasks finished successfully.")):"error"===f||"rate_limit"===f||"quota"===f?(ap(),av(d.account||a,`Execution failed (${d.error||f})`)):"waiting_input"===f&&aq()),b.set(a,f)}if(b.size>100){let c=new Set(a.map(a=>a.connectionId||a.id));for(let a of b.keys()){let d=a.endsWith("_looping")?a.replace("_looping",""):a;c.has(d)||b.delete(a)}}c&&an()},[]),[r,s]=(0,c.useState)(0),t=(0,c.useCallback)(()=>{k(!0),n.current&&(n.current.close(),n.current=null),s(a=>a+1),setTimeout(()=>k(!1),500)},[]);return(0,c.useEffect)(()=>{if("mock"!==a)return;let c=$[b]||$.cases,d=()=>{let a=function({count:a=null,errorRatio:b=0,seed:c=42,now:d=Date.now(),cases:e=!1,preset:f=null}={}){let g=null;"showcase"===f||"items"===f?g=ae:"showcase_skins"===f?g=af:"showcase_props"===f?g=ag:"showcase_pets"===f?g=ah:"showcase_auras"===f?g=ai:"showcase_trophies"===f?g=aj:(e||"cases"===f)&&(g=ad);let h=null!=a?a:g?g.length:8,i=ak(c),j=[];for(let a=0;a<h;a+=1){let e,f=_[a%_.length],h=Math.floor(a/_.length)+1,k=h>1?`${f.account} ${h}`:f.account,l=`mock-conn-${a}`,m=aa[a%aa.length],n=g?g[a%g.length]:null,o=n?.name||k,p=Math.floor(4e4*i()),q=i()<b,r=n?n.ageMs:p,s=d-r,t=n?"error"===n.state:q,u=!!(n?.isLooping||b>.4&&0===a),v=r/4e4;e=u?"streaming":n?n.state:t?"error":v<.25?"pending":v<.6?"streaming":"done";let w={input:Math.round(400+14e3*i()),output:Math.round(80+2900*i()),cached:Math.round(6e3*i())},x=ak(7919*c+104729*a+13),y="done"===e?0:1+Math.floor(3*x()),z=[];for(let a=0;a<y;a+=1)z.push(ac[Math.floor(x()*ac.length)]);let A=u?["bash"]:n?.tools??("error"===e?[]:z),B=[];for(let a of A)B.some(b=>b.tool===a)||B.push({tool:a,state:0===B.length?"running":"queued"});let C=n?!!n.fallbackShift:.28>x(),D=aa[(a+(n?.fallbackShift??3))%aa.length].provider,E=C&&("pending"===e||"streaming"===e)&&D!==m.provider?{from:D}:null,F=n?.concurrent??("done"===e||"error"===e?1:1+Math.floor(3*x()));n?.cachedBoost&&(w.cached=14e3);let G=[],H=s||d-2e4;if(G.push({timestamp:new Date(H).toLocaleTimeString(),type:"prompt",summary:"User Prompt",detail:`Execute pipeline for ${o} (${m.model})`}),u){for(let a=0;a<6;a++)G.push({timestamp:new Date(H+2e3+2e3*a).toLocaleTimeString(),type:"bash",summary:"run_command",detail:"npm test -- --bail (failed exit 1)"});G.push({timestamp:new Date(d).toLocaleTimeString(),type:"error",summary:"Loop Warning",detail:"Runaway loop detected: 6 consecutive identical tool failures"})}else A.forEach((a,b)=>{G.push({timestamp:new Date(H+1500+2500*b).toLocaleTimeString(),type:a,summary:a,detail:`${a} operation completed`})}),t&&G.push({timestamp:new Date(d).toLocaleTimeString(),type:"error",summary:"Error",detail:n?.error||"Upstream rate limit or timeout"});j.push({traceId:`mock-${a}-${Math.floor(1e6*i()).toString(36)}`,cli:"mock",connectionId:l,account:o,model:m.model,provider:m.provider,state:e,startedAt:s,elapsedMs:r,tokens:w,cost:n?.cost??Math.round((15e-6*w.input+6e-5*w.output)*100)/100,status:u||t?"error":"200",error:t?n?.error??ab[Math.floor(i()*ab.length)%ab.length]:u?"runaway_loop":null,clientIcon:f.icon,toolCalls:B,tools:A,activeTool:A[0]||null,currentCommand:u?"npm test -- --bail (looping)":A[0]?`${A[0]} task running...`:null,fallback:E,concurrent:F,isLooping:u,skin:n?.skin??null,aura:n?.aura??null,props:n?.props??[],pet:n?.pet??null,trophy:n?.trophy??null,theme:n?.theme??null,logs:G})}return j}({count:c.agents,cases:!!c.cases,errorRatio:c.errorRatio,preset:b});e(a),q(a),g(function(a){let b=new Map;for(let c of a)c.provider&&!b.has(c.provider)&&b.set(c.provider,{provider:c.provider,name:c.provider.charAt(0).toUpperCase()+c.provider.slice(1)});return[...b.values()]}(a)),i(!0),m(Date.now())};d();let f=setInterval(d,3e3);return()=>clearInterval(f)},[a,b,r]),(0,c.useEffect)(()=>{if("live"!==a)return;let b=!1,c=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{b||(console.warn("[SSE] Watchdog timeout, reconnecting..."),s(a=>a+1))},7e3)};try{let a=new EventSource("/api/traces/stream?source=live");n.current=a,a.onopen=()=>{b||(i(!0),c())},a.onmessage=a=>{if(!b&&a?.data)try{let b=JSON.parse(a.data);Array.isArray(b.traces)&&(e(b.traces),q(b.traces)),Array.isArray(b.providers)&&g(b.providers),m(Date.now()),c()}catch{}},a.onerror=()=>{b||i(!1)}}catch{i(!1)}return()=>{b=!0,o.current&&clearTimeout(o.current),n.current&&(n.current.close(),n.current=null)}},[a,r]),(0,c.useEffect)(()=>{if("live"!==a)return;let b=null,c=()=>{"visible"===document.visibilityState&&(b&&clearTimeout(b),b=setTimeout(()=>{let a=n.current;a&&a.readyState===EventSource.OPEN?console.log("[AgentFactory] Tab active / wake up, stream is already active."):(console.log("[AgentFactory] Tab active / wake up, reconnecting telemetry stream..."),t())},300))};return window.addEventListener("visibilitychange",c),window.addEventListener("online",c),window.addEventListener("focus",c),()=>{b&&clearTimeout(b),window.removeEventListener("visibilitychange",c),window.removeEventListener("online",c),window.removeEventListener("focus",c)}},[a,t]),{traces:d,providers:f,connected:h,live:"live"===a,isRefreshing:j,refresh:t,lastUpdated:l}}],50636)},33788,a=>{var b=a.i(72131);a.s(["f",0,function(a,c=!1){let[d,e]=(0,b.useState)(null),[f,g]=(0,b.useState)(!0),[h,i]=(0,b.useState)(null),j=(0,b.useRef)(null),k=(0,b.useRef)(!1),l=(0,b.useRef)(null),m=(0,b.useCallback)(async()=>{if(a&&!k.current){l.current&&l.current.abort(),l.current=new AbortController,k.current=!0;try{let b=await fetch(`/api/sessions/${encodeURIComponent(a)}/transcript`,{signal:l.current.signal});if(!b.ok){let a=await b.json().catch(()=>({}));throw Error(a.error||`HTTP ${b.status}`)}let c=await b.json();e(c),i(null)}catch(a){"AbortError"!==a.name&&i(a.message)}finally{k.current=!1,g(!1)}}},[a]);(0,b.useEffect)(()=>(g(!0),m(),()=>{l.current&&l.current.abort()}),[m]),(0,b.useEffect)(()=>{if(!c||!a)return;let b=()=>{"visible"===document.visibilityState&&m()};return document.addEventListener("visibilitychange",b),j.current=setInterval(()=>{"visible"===document.visibilityState&&m()},2e3),()=>{document.removeEventListener("visibilitychange",b),j.current&&clearInterval(j.current),l.current&&l.current.abort()}},[c,a,m]);let n=(0,b.useCallback)(()=>{if(!d||!d.turns)return;let b=d.session||{},c=`# Conversation Transcript: ${b.id||a}
396
+ </html>`}(f,h,k):"",[a,f,h,k]);if(!a)return null;let r=f?.id||"session",s=async()=>{let a="html"===i?q:p;await U(a)&&(o(!0),setTimeout(()=>o(!1),2e3))},t=a=>{m(b=>({...b,[a]:!b[a]}))};return(0,b.jsx)("div",{className:"fixed inset-0 z-[120] flex items-center justify-center p-3 md:p-6 bg-black/80 backdrop-blur-sm animate-in fade-in duration-150",onClick:e,children:(0,b.jsxs)("div",{className:"w-full max-w-5xl h-[85vh] max-h-[850px] flex flex-col rounded-xl bg-[#18181b] border border-[#27272a] shadow-2xl overflow-hidden text-slate-200",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-[#27272a] bg-[#121214]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"w-8 h-8 rounded-lg bg-cyan-950/60 border border-cyan-800/40 flex items-center justify-center text-cyan-400",children:(0,b.jsx)(J.f,{className:"w-4 h-4"})}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("h2",{className:"text-sm font-semibold text-white flex items-center gap-2",children:["Export Session Report",(0,b.jsx)("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded bg-[#27272a] text-slate-400 font-normal",children:r})]}),(0,b.jsx)("p",{className:"text-[11px] text-slate-400",children:"Generate clean, shareable reports for stakeholders or pull requests"})]})]}),(0,b.jsx)("button",{onClick:e,className:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-[#27272a] transition-colors cursor-pointer",title:"Close dialog (Esc)",children:(0,b.jsx)(d.X,{className:"w-4 h-4"})})]}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col md:flex-row min-h-0 overflow-hidden",children:[(0,b.jsxs)("div",{className:"w-full md:w-72 border-b md:border-b-0 md:border-r border-[#27272a] bg-[#141416] p-4 flex flex-col gap-5 overflow-y-auto shrink-0",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400 block mb-2",children:"Document Format"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>j("html"),className:`flex items-center justify-center gap-2 py-2 px-3 rounded-lg border text-xs font-medium transition-all cursor-pointer ${"html"===i?"bg-cyan-950/60 border-cyan-600/60 text-cyan-300 shadow-sm":"bg-[#1f1f23] border-[#2e2e36] text-slate-400 hover:text-slate-200 hover:bg-[#25252a]"}`,children:[(0,b.jsx)(K.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{children:"HTML (PDF)"})]}),(0,b.jsxs)("button",{type:"button",onClick:()=>j("markdown"),className:`flex items-center justify-center gap-2 py-2 px-3 rounded-lg border text-xs font-medium transition-all cursor-pointer ${"markdown"===i?"bg-cyan-950/60 border-cyan-600/60 text-cyan-300 shadow-sm":"bg-[#1f1f23] border-[#2e2e36] text-slate-400 hover:text-slate-200 hover:bg-[#25252a]"}`,children:[(0,b.jsx)(J.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{children:"Markdown"})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-slate-400 mb-2",children:[(0,b.jsx)(L.f,{className:"w-3 h-3"}),(0,b.jsx)("span",{children:"Include Content"})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsxs)("label",{className:"flex items-center justify-between p-2.5 rounded-lg bg-[#1f1f23] border border-[#2e2e36] hover:border-slate-700 transition-colors cursor-pointer text-xs",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 text-slate-200",children:[(0,b.jsx)(O,{className:"w-3.5 h-3.5 text-cyan-400 shrink-0"}),(0,b.jsx)("span",{children:"Executive Summary"})]}),(0,b.jsx)("input",{type:"checkbox",checked:k.includeExecutiveSummary,onChange:()=>t("includeExecutiveSummary"),className:"accent-cyan-500 rounded cursor-pointer w-4 h-4"})]}),(0,b.jsxs)("label",{className:"flex items-center justify-between p-2.5 rounded-lg bg-[#1f1f23] border border-[#2e2e36] hover:border-slate-700 transition-colors cursor-pointer text-xs",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 text-slate-200",children:[(0,b.jsx)(u.f,{className:"w-3.5 h-3.5 text-purple-400 shrink-0"}),(0,b.jsx)("span",{children:"Reasoning / Thinking"})]}),(0,b.jsx)("input",{type:"checkbox",checked:k.includeThinking,onChange:()=>t("includeThinking"),className:"accent-cyan-500 rounded cursor-pointer w-4 h-4"})]}),(0,b.jsxs)("label",{className:"flex items-center justify-between p-2.5 rounded-lg bg-[#1f1f23] border border-[#2e2e36] hover:border-slate-700 transition-colors cursor-pointer text-xs",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 text-slate-200",children:[(0,b.jsx)(l.f,{className:"w-3.5 h-3.5 text-amber-400 shrink-0"}),(0,b.jsx)("span",{children:"Verbose Tool Outputs"})]}),(0,b.jsx)("input",{type:"checkbox",checked:k.includeToolOutputs,onChange:()=>t("includeToolOutputs"),className:"accent-cyan-500 rounded cursor-pointer w-4 h-4"})]}),(0,b.jsxs)("label",{className:"flex items-center justify-between p-2.5 rounded-lg bg-[#1f1f23] border border-[#2e2e36] hover:border-slate-700 transition-colors cursor-pointer text-xs",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 text-slate-200",children:[(0,b.jsx)(P.f,{className:"w-3.5 h-3.5 text-emerald-400 shrink-0"}),(0,b.jsx)("span",{children:"Step Timestamps"})]}),(0,b.jsx)("input",{type:"checkbox",checked:k.includeTimestamps,onChange:()=>t("includeTimestamps"),className:"accent-cyan-500 rounded cursor-pointer w-4 h-4"})]})]})]}),(0,b.jsxs)("div",{className:"mt-auto p-3 rounded-lg bg-[#1a1a1e] border border-[#27272a] text-[11px] text-slate-400",children:[(0,b.jsx)("span",{className:"font-semibold text-slate-300 block mb-1",children:"Print to PDF Tip"}),"When opening the HTML export, press ",(0,b.jsx)("kbd",{className:"px-1 py-0.5 bg-[#27272a] rounded text-[10px] text-slate-200",children:"Cmd+P"})," or ",(0,b.jsx)("kbd",{className:"px-1 py-0.5 bg-[#27272a] rounded text-[10px] text-slate-200",children:"Ctrl+P"})," to save a clean, high-contrast PDF document."]})]}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col bg-[#0f0f11] min-w-0 overflow-hidden",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 bg-[#141416] border-b border-[#27272a] text-xs text-slate-400",children:[(0,b.jsx)("span",{className:"font-medium",children:"Live Document Preview"}),(0,b.jsxs)("span",{className:"text-[11px] font-mono text-slate-500",children:[h.length," turns • ",i.toUpperCase()]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto p-4",children:"html"===i?(0,b.jsx)("div",{className:"w-full h-full min-h-[350px] rounded-lg border border-[#27272a] overflow-hidden bg-white shadow-inner",children:(0,b.jsx)("iframe",{title:"HTML Preview",srcDoc:q,className:"w-full h-full border-none",sandbox:"allow-same-origin"})}):(0,b.jsx)("div",{className:"w-full h-full rounded-lg border border-[#27272a] bg-[#141416] p-4 overflow-auto",children:(0,b.jsx)("pre",{className:"text-xs font-mono text-slate-300 whitespace-pre-wrap leading-relaxed select-text",children:p})})})]})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-t border-[#27272a] bg-[#121214]",children:[(0,b.jsxs)("div",{className:"text-xs text-slate-400 hidden sm:block",children:["Ready to export as ",(0,b.jsx)("span",{className:"font-mono text-cyan-400",children:"html"===i?".html":".md"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:["html"===i&&(0,b.jsxs)("button",{type:"button",onClick:()=>{let a=window.open("","_blank");a&&(a.document.write(q),a.document.close(),a.focus(),setTimeout(()=>{a.print()},300))},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-[#333338] bg-[#1f1f23] text-slate-200 hover:text-white hover:bg-[#28282e] text-xs font-medium transition-colors cursor-pointer",title:"Open browser print dialog",children:[(0,b.jsx)(I.f,{className:"w-3.5 h-3.5 text-slate-400"}),(0,b.jsx)("span",{children:"Print to PDF"})]}),(0,b.jsx)("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-[#333338] bg-[#1f1f23] text-slate-200 hover:text-white hover:bg-[#28282e] text-xs font-medium transition-colors cursor-pointer",title:"Copy formatted document to clipboard",children:n?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(H.f,{className:"w-3.5 h-3.5 text-emerald-400"}),(0,b.jsx)("span",{className:"text-emerald-400",children:"Copied!"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.f,{className:"w-3.5 h-3.5 text-slate-400"}),(0,b.jsx)("span",{children:"Copy to Clipboard"})]})}),(0,b.jsxs)("button",{type:"button",onClick:()=>{"html"===i?T(`${r}-report.html`,q,"text/html"):T(`${r}-report.md`,p,"text/markdown")},className:"flex items-center gap-1.5 px-4 py-1.5 rounded-lg bg-cyan-600 hover:bg-cyan-500 text-black font-semibold text-xs transition-colors cursor-pointer shadow-sm",children:[(0,b.jsx)(g.f,{className:"w-3.5 h-3.5"}),(0,b.jsxs)("span",{children:["Download ","html"===i?"HTML":"Markdown"]})]})]})]})]})})}let W={streaming:"Working",pending:"Queued",done:"Done",happy:"Done",sleeping:"Idle",error:"Failed",looping:"Loop Alert"},X={bash:"border-cyan-500/40 bg-cyan-950/60 text-cyan-300",docker:"border-sky-500/40 bg-sky-950/60 text-sky-300",git:"border-orange-500/40 bg-orange-950/60 text-orange-300",edit:"border-emerald-500/40 bg-emerald-950/60 text-emerald-300",read:"border-blue-500/40 bg-blue-950/60 text-blue-300",search:"border-purple-500/40 bg-purple-950/60 text-purple-300",prompt:"border-amber-500/40 bg-amber-950/60 text-amber-300",error:"border-rose-500/40 bg-rose-950/60 text-rose-300",gitnexus:"border-purple-500/40 bg-purple-950/60 text-purple-300",browser:"border-cyan-500/40 bg-cyan-950/60 text-cyan-300",agent:"border-orange-500/40 bg-orange-950/60 text-orange-300",mcp:"border-violet-500/40 bg-violet-950/60 text-violet-300"};function Y(a){return a?a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a):"0"}function Z(a){if(!a)return"0s";let b=Math.floor(a/1e3);if(b<60)return`${b}s`;let c=Math.floor(b/60);return`${c}m ${b%60}s`}a.s(["f",0,function({sessionTrace:a,isSidebar:G=!1,onClose:H,onDockToSidebar:I,onStartReplay:J,isFullscreen:K=!1,onToggleFullscreen:L}){let[M,N]=(0,c.useState)("all"),[O,P]=(0,c.useState)(!0),[Q,R]=(0,c.useState)(!1),[S,T]=(0,c.useState)(null),[U,$]=(0,c.useState)(!1),[_,aa]=(0,c.useState)(!1),ab=(0,c.useRef)(null),ac=(0,c.useRef)(null),ad=a?.traceId||a?.traces?.[0]?.traceId||a?.connectionId||"",ae=ad.replace(/^agy-|^claude-|^codex-/,"")||ad,af=a?.state==="streaming"||a?.state==="busy"||a?.state==="working"||a?.state==="pending"||a?.mode==="streaming",{session:ag,turns:ah,loading:ai,error:aj,refresh:ak,exportMarkdown:al}=(0,A.f)(ad,af);(0,c.useEffect)(()=>{let a=a=>{(a.ctrlKey||a.metaKey)&&"f"===a.key.toLowerCase()&&(a.preventDefault(),$(a=>!a))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let am=(0,c.useMemo)(()=>ah.map(a=>({id:a.id,content:a.content||"",thinking:a.thinking||"",tool_calls:(a.toolCalls||[]).map(a=>({toolName:a.name,description:a.action,args:"string"==typeof a.args?a.args:JSON.stringify(a.args||{})})),output:(a.toolCalls||[]).map(a=>a.output||"").join("\n")})),[ah]);if((0,c.useEffect)(()=>{O&&("telemetry"===M&&ac.current?ac.current.scrollIntoView({behavior:"smooth"}):ab.current&&ab.current.scrollIntoView({behavior:"smooth"}))},[ah.length,M,O]),!a)return null;let an=a.color?`#${a.color.toString(16).padStart(6,"0")}`:"#38bdf8",ao=Array.isArray(a.logs)?a.logs:a.traces?.[0]?.logs||[],ap="app"===a.clientType||String(a.provider||"").toLowerCase().includes("app")||String(a.connectionId||"").toLowerCase().includes("app"),aq=a.isLooping?"Loop Alert":W[a.mode]||a.state||"Active";return(0,b.jsxs)("div",{className:"flex flex-col h-full w-full bg-[var(--bg-editor)] text-[var(--text-main)] select-none overflow-hidden",children:[G?(0,b.jsxs)("div",{className:"border-b border-[var(--border-subtle)] bg-[var(--bg-sidebar)] px-3 py-2 flex items-center justify-between gap-2 shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsxs)("div",{className:"w-6 h-6 rounded-md border flex items-center justify-center shrink-0 relative",style:{borderColor:an,backgroundColor:`${an}25`},children:[(0,b.jsx)(i.f,{className:"w-3.5 h-3.5",style:{color:an}}),af&&(0,b.jsx)("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full border border-slate-900 animate-ping",style:{backgroundColor:an}})]}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("span",{className:"font-bold text-[var(--text-bright)] text-xs truncate max-w-[130px]",children:a.account||`Desk #${(a.deskIndex??0)+1}`}),(0,b.jsxs)("span",{className:`text-[8px] font-mono px-1 py-0.2 rounded font-black tracking-wider uppercase border flex items-center gap-0.5 ${ap?"bg-purple-950/80 border-purple-700/80 text-purple-300":"bg-emerald-950/80 border-emerald-700/80 text-emerald-300"}`,children:[ap?(0,b.jsx)(m.f,{className:"w-2 h-2"}):(0,b.jsx)(l.f,{className:"w-2 h-2"}),(0,b.jsx)("span",{children:ap?"APP":"CLI"})]})]}),(0,b.jsx)("div",{className:"text-[10px] text-[var(--text-muted)] font-mono truncate",children:ag?.model||a.model||"Unavailable"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsx)("button",{onClick:()=>$(!U),className:`p-1 rounded text-xs transition-colors cursor-pointer ${U?"bg-cyan-950 border border-cyan-500/50 text-cyan-300":"text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)]"}`,title:"Search transcript (Ctrl+F)",children:(0,b.jsx)(w.f,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:()=>R(!Q),className:`p-1 rounded text-xs transition-colors cursor-pointer ${Q?"bg-cyan-950 border border-cyan-500/50 text-cyan-300":"text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)]"}`,title:"Agent Details & Specs",children:(0,b.jsx)(j.f,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:ak,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)] transition-colors cursor-pointer",title:"Refresh transcript",children:(0,b.jsx)(h.f,{className:"w-3.5 h-3.5"})}),J&&(0,b.jsx)("button",{onClick:()=>J(ae||ad),className:"p-1 rounded text-cyan-400 hover:text-cyan-200 hover:bg-[var(--bg-hover)] transition-colors cursor-pointer",title:"Time-Machine: Replay this session",children:(0,b.jsx)(x.f,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:()=>aa(!0),className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)] transition-colors cursor-pointer",title:"Export session report (HTML, PDF, Markdown)",children:(0,b.jsx)(g.f,{className:"w-3.5 h-3.5"})}),(0,b.jsx)("button",{onClick:()=>(0,B.f)(ae||ad),className:"p-1 rounded text-[var(--text-muted)] hover:text-cyan-300 hover:bg-[var(--bg-hover)] transition-colors cursor-pointer",title:"Open in Detached Window (VS Code style)",children:(0,b.jsx)(z.f,{className:"w-3.5 h-3.5"})})]})]}):(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-[var(--border-subtle)] bg-[var(--bg-titlebar)] rounded-t-2xl shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,b.jsxs)("div",{className:"w-9 h-9 rounded-xl border flex items-center justify-center shrink-0 shadow-inner relative",style:{borderColor:an,backgroundColor:`${an}25`},children:[(0,b.jsx)(i.f,{className:"w-5 h-5",style:{color:an}}),af&&(0,b.jsx)("span",{className:"absolute -top-1 -right-1 w-3 h-3 rounded-full border-2 border-slate-900 animate-ping",style:{backgroundColor:an}})]}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"text-sm font-bold text-[var(--text-bright)] truncate",children:a.account||"AI Agent Session"}),(0,b.jsx)("span",{className:`text-[9px] font-mono px-2 py-0.5 rounded font-black tracking-wider uppercase border flex items-center gap-1 ${ap?"bg-purple-950/80 border-purple-700/80 text-purple-300 shadow-sm shadow-purple-950":"bg-emerald-950/80 border-emerald-700/80 text-emerald-300 shadow-sm shadow-emerald-950"}`,children:ap?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(m.f,{className:"w-2.5 h-2.5"}),(0,b.jsx)("span",{children:"APP"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.f,{className:"w-2.5 h-2.5"}),(0,b.jsx)("span",{children:"CLI"})]})}),(0,b.jsx)("span",{className:`text-[10px] font-mono px-2 py-0.5 rounded border font-semibold uppercase tracking-wider ${a.isLooping?"border-rose-500/50 bg-rose-950/60 text-rose-300 animate-pulse":af?"border-cyan-500/50 bg-cyan-950/60 text-cyan-300":"border-[var(--border-subtle)] bg-[var(--bg-card)] text-[var(--text-main)]"}`,children:aq})]}),(0,b.jsxs)("div",{className:"text-[11px] text-[var(--text-muted)] font-mono truncate mt-0.5 flex items-center gap-1.5",children:[(0,b.jsx)("span",{children:a.connectionId}),(0,b.jsx)("span",{children:"•"}),(0,b.jsx)("span",{className:"text-cyan-400 uppercase",children:ag?.model||a.model||"Unavailable"}),ag?.cwd&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"•"}),(0,b.jsx)("span",{className:"text-[var(--text-muted)] truncate max-w-44",children:ag.cwd})]})]})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[Number.isFinite(ag?.tokens?.input??a?.tokens?.input)&&Number.isFinite(ag?.tokens?.output??a?.tokens?.output)&&Number.isFinite(ag?.tokens?.cached??a?.tokens?.cached)&&(ag?.model||a?.model)&&(0,b.jsx)(F.f,{compact:!0,inputTokens:ag?.tokens?.input??a.tokens.input,outputTokens:ag?.tokens?.output??a.tokens.output,cachedTokens:ag?.tokens?.cached??a.tokens.cached,model:ag?.model||a.model,className:"hidden md:inline-flex mr-1"}),(0,b.jsx)("button",{onClick:()=>$(!U),className:`p-1.5 rounded-lg border text-xs font-medium transition-colors cursor-pointer ${U?"bg-cyan-950 border-cyan-500/50 text-cyan-300 shadow-sm shadow-cyan-500/10":"border-[var(--border-subtle)] text-[var(--text-muted)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-bright)]"}`,title:"Search transcript (Ctrl+F)",children:(0,b.jsx)(w.f,{className:"w-3.5 h-3.5"})}),(0,b.jsxs)("button",{onClick:()=>R(!Q),className:`flex items-center gap-1 px-2 py-1.5 rounded-lg border text-xs font-medium transition-colors cursor-pointer ${Q?"bg-cyan-950 border-cyan-500/50 text-cyan-300":"border-[var(--border-subtle)] text-[var(--text-muted)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-bright)]"}`,title:"Agent Details & Specs",children:[(0,b.jsx)(j.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Details"}),Q?(0,b.jsx)(q.f,{className:"w-3 h-3"}):(0,b.jsx)(p.f,{className:"w-3 h-3"})]}),(0,b.jsx)("button",{onClick:ak,className:"p-1.5 rounded-lg text-[var(--text-muted)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-bright)] transition-colors cursor-pointer",title:"Refresh transcript",children:(0,b.jsx)(h.f,{className:"w-4 h-4"})}),J&&(0,b.jsxs)("button",{onClick:()=>{J(ae||ad),H?.()},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-cyan-950/80 hover:bg-cyan-900 text-cyan-300 text-xs font-semibold border border-cyan-500/40 transition-colors shadow-sm cursor-pointer",title:"Time-Machine: Replay this session",children:[(0,b.jsx)(x.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Replay"})]}),(0,b.jsxs)("button",{onClick:()=>aa(!0),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-[var(--bg-card)] hover:bg-[var(--bg-hover)] text-[var(--text-main)] text-xs font-medium border border-[var(--border-subtle)] transition-colors cursor-pointer",title:"Export session report (HTML, PDF, Markdown)",children:[(0,b.jsx)(g.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Export"})]}),I&&(0,b.jsxs)("button",{onClick:()=>I(a),className:"flex items-center gap-1 px-2 py-1.5 rounded-lg bg-[var(--bg-card)] hover:bg-[var(--accent-primary)] text-[var(--text-main)] hover:text-white text-xs font-medium border border-[var(--border-subtle)] transition-colors cursor-pointer",title:"Dock into Sidebar",children:[(0,b.jsx)(y.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Sidebar"})]}),(0,b.jsxs)("button",{onClick:()=>{(0,B.f)(ae||ad),H?.()},className:"flex items-center gap-1 px-2 py-1.5 rounded-lg bg-[var(--bg-card)] hover:bg-[var(--accent-primary)] text-[var(--text-main)] hover:text-white text-xs font-medium border border-[var(--border-subtle)] transition-colors cursor-pointer",title:"Open in Detached Window (VS Code style)",children:[(0,b.jsx)(z.f,{className:"w-3.5 h-3.5 text-cyan-400"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"New Window"})]}),L&&(0,b.jsxs)("button",{onClick:L,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-medium transition-colors cursor-pointer ${K?"bg-cyan-950 border-cyan-500/50 text-cyan-300 shadow-sm shadow-cyan-500/10 font-semibold":"border-[var(--border-subtle)] bg-[var(--bg-card)] text-[var(--text-main)] hover:bg-[var(--bg-hover)] hover:text-[var(--text-bright)]"}`,title:K?"Exit Fullscreen":"Fullscreen",children:[K?(0,b.jsx)(f.f,{className:"w-3.5 h-3.5 text-cyan-300"}):(0,b.jsx)(e.f,{className:"w-3.5 h-3.5"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:K?"Exit Fullscreen":"Fullscreen"})]}),(0,b.jsx)("button",{onClick:H,className:"p-1.5 rounded-lg text-[var(--text-muted)] hover:bg-[var(--bg-hover)] hover:text-rose-400 transition-colors cursor-pointer",title:"Close window",children:(0,b.jsx)(d.X,{className:"w-4 h-4"})})]})]}),U&&(0,b.jsx)("div",{className:`py-2 border-b border-[var(--border-subtle)] bg-[var(--bg-sidebar)] flex justify-end shrink-0 ${G?"px-3":"px-5"}`,children:(0,b.jsx)(E.f,{isOpen:U,onClose:()=>$(!1),steps:am,onJumpToStep:a=>{let b=ah[a];if(b){let a=document.getElementById(`chat-turn-${b.id}`);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),a.classList.add("ring-2","ring-cyan-400","shadow-cyan-500/20","transition-all"),setTimeout(()=>{a.classList.remove("ring-2","ring-cyan-400","shadow-cyan-500/20")},2500))}}})}),a.isLooping&&(0,b.jsxs)("div",{className:`my-2 rounded-lg border border-rose-500/40 bg-rose-500/10 p-2 text-xs text-rose-300 flex items-start gap-2 animate-pulse shrink-0 ${G?"mx-3":"mx-5"}`,children:[(0,b.jsx)(n.f,{className:"w-4 h-4 text-rose-400 shrink-0 mt-0.5"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"font-bold text-rose-200",children:"Runaway Loop Alert Detected"}),(0,b.jsx)("div",{className:"text-[11px] text-rose-300/80 mt-0.5",children:"5+ repeated consecutive tool actions occurred within 60s without task progression."})]})]}),Q&&(0,b.jsxs)("div",{className:`py-2.5 border-b border-[#2b2b2b] bg-[#181818] text-xs space-y-2.5 animate-in fade-in slide-in-from-top-1 shrink-0 ${G?"px-3":"px-5"}`,children:[(0,b.jsxs)("div",{className:`grid gap-2 ${G?"grid-cols-2":"grid-cols-2 sm:grid-cols-4"}`,children:[(0,b.jsxs)("div",{className:"rounded-lg bg-[#252526] p-2 border border-[#333333]",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-500 tracking-wider",children:"Provider"}),(0,b.jsx)("p",{className:"font-semibold text-cyan-400 mt-0.5 truncate uppercase",children:a.provider||"Unavailable"})]}),(0,b.jsxs)("div",{className:"rounded-lg bg-[#252526] p-2 border border-[#333333]",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-500 tracking-wider",children:"Elapsed"}),(0,b.jsx)("p",{className:"font-semibold text-slate-200 mt-0.5",children:Number.isFinite(ag?.durationMs??a.elapsedMs)?Z(ag?.durationMs??a.elapsedMs):"Unavailable"})]}),(0,b.jsxs)("div",{className:"rounded-lg bg-[#252526] p-2 border border-[#333333]",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-500 tracking-wider",children:"Cached"}),(0,b.jsx)("p",{className:"font-semibold text-emerald-400 mt-0.5",children:Number.isFinite(ag?.tokens?.cached??a?.tokens?.cached)?`${Y(ag?.tokens?.cached??a.tokens.cached)} (${a.cachedPct??"—"}%)`:"Unavailable"})]}),(0,b.jsxs)("div",{className:"rounded-lg bg-[#252526] p-2 border border-[#333333]",children:[(0,b.jsx)("span",{className:"text-[10px] uppercase font-bold text-slate-500 tracking-wider",children:"Tools"}),(0,b.jsx)("p",{className:"font-semibold text-slate-300 mt-0.5 truncate",children:a.tools?.length?a.tools.join(", "):"None"})]})]}),Number.isFinite(ag?.tokens?.input??a?.tokens?.input)&&Number.isFinite(ag?.tokens?.output??a?.tokens?.output)&&Number.isFinite(ag?.tokens?.cached??a?.tokens?.cached)&&(ag?.model||a?.model)&&(0,b.jsx)(F.f,{inputTokens:ag?.tokens?.input??a.tokens.input,outputTokens:ag?.tokens?.output??a.tokens.output,cachedTokens:ag?.tokens?.cached??a.tokens.cached,model:ag?.model||a.model}),a.currentCommand&&(0,b.jsxs)("div",{className:"rounded-lg bg-black/70 p-2 border border-[#333333]",children:[(0,b.jsx)("div",{className:"text-[10px] uppercase font-bold text-slate-400 tracking-wider mb-1",children:"Active Command / File"}),(0,b.jsx)("div",{className:"font-mono text-[11px] text-emerald-400 truncate",children:a.currentCommand})]}),a.fallbackFrom&&(0,b.jsxs)("div",{className:"text-[11px] text-amber-400 flex items-center gap-1.5",children:[(0,b.jsx)(n.f,{className:"w-3.5 h-3.5 shrink-0"}),(0,b.jsxs)("span",{children:["Rerouted fallback from: ",(0,b.jsx)("strong",{className:"font-bold",children:a.fallbackFrom})]})]}),a.errorReason&&(0,b.jsxs)("div",{className:"text-[11px] text-rose-400 flex items-center gap-1.5",children:[(0,b.jsx)(o.f,{className:"w-3.5 h-3.5 shrink-0"}),(0,b.jsxs)("span",{children:["Failure cause: ",(0,b.jsx)("strong",{className:"font-bold",children:a.errorReason})]})]})]}),(0,b.jsxs)("div",{className:`flex items-center justify-between border-b border-[var(--border-subtle)] bg-[var(--bg-editor)] text-xs shrink-0 py-1.5 ${G?"px-3":"px-5"}`,children:[(0,b.jsx)("div",{className:"flex items-center gap-1 bg-[var(--bg-workbench)] p-0.5 rounded-lg border border-[var(--border-subtle)] overflow-x-auto max-w-full",children:[{id:"all",label:"All",icon:r.f},{id:"prompts",label:"Prompts",icon:s.f},{id:"tools",label:"Tools",icon:t.f},{id:"thinking",label:"Thinking",icon:u.f},{id:"telemetry",label:`Logs (${ao.length})`,icon:v.f}].map(a=>{let c=a.icon;return(0,b.jsxs)("button",{onClick:()=>N(a.id),className:`flex items-center gap-1 px-2 py-0.5 rounded text-[11px] font-medium transition-all whitespace-nowrap cursor-pointer ${M===a.id?"bg-[var(--bg-card)] text-[var(--accent-secondary)] shadow-sm font-semibold border border-[var(--border-card)]":"text-[var(--text-muted)] hover:text-[var(--text-bright)] hover:bg-[var(--bg-hover)]"}`,children:[(0,b.jsx)(c,{className:"w-3 h-3 shrink-0"}),(0,b.jsx)("span",{children:a.label})]},a.id)})}),(0,b.jsx)("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:(0,b.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)] cursor-pointer select-none",children:[(0,b.jsx)("input",{type:"checkbox",checked:O,onChange:a=>P(a.target.checked),className:"rounded border-[var(--border-card)] bg-[var(--bg-card)] text-[var(--accent-primary)] focus:ring-0 w-3 h-3 cursor-pointer"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Auto-scroll"})]})})]}),(0,b.jsx)("div",{className:`flex-1 overflow-y-auto space-y-2 select-text ${G?"p-3":"p-5"}`,children:"telemetry"===M?(0,b.jsxs)("div",{className:"space-y-2 font-mono text-[11px]",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between pb-1.5 mb-2 border-b border-[var(--border-subtle)] text-xs text-[var(--text-muted)]",children:[(0,b.jsx)("span",{className:"font-semibold text-[var(--text-bright)]",children:"Terminal Telemetry Stream"}),(0,b.jsxs)("span",{children:["Last ",ao.length," actions"]})]}),0===ao.length?(0,b.jsx)("div",{className:"py-12 text-center text-[var(--text-muted)] text-xs",children:"No telemetry actions recorded yet for this session."}):ao.map((a,c)=>{let d=X[a.type]||"border-slate-700 bg-slate-800/60 text-slate-300";return(0,b.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-[var(--bg-chat-code)] border border-[var(--border-subtle)] hover:border-[var(--border-card)] transition-colors",children:[(0,b.jsx)("span",{className:"text-[10px] text-[var(--text-muted)] opacity-70 whitespace-nowrap pt-0.5",children:function(a){if(!a)return"";try{let b=new Date(a);if(!isNaN(b.getTime()))return b.toLocaleTimeString([],{hour12:!1})}catch{}return String(a).slice(11,19)}(a.timestamp)}),(0,b.jsx)("span",{className:`rounded border px-1.5 py-0.2 text-[9px] font-bold uppercase tracking-wider shrink-0 ${d}`,children:a.type}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("div",{className:"text-[var(--text-bright)] font-medium truncate",children:a.summary||a.type}),a.detail&&(0,b.jsx)("div",{className:"text-[var(--text-muted)] text-[11px] truncate mt-0.5 whitespace-pre-wrap break-all",children:a.detail})]})]},c)}),(0,b.jsx)("div",{ref:ac})]}):(0,b.jsxs)(b.Fragment,{children:[ai&&0===ah.length&&(0,b.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-[var(--text-muted)] gap-2 py-12",children:[(0,b.jsx)(h.f,{className:"w-5 h-5 animate-spin text-cyan-400"}),(0,b.jsx)("span",{className:"text-xs",children:"Loading session transcript..."})]}),aj&&0===ah.length&&(0,b.jsx)("div",{className:"h-full flex flex-col items-center justify-center text-[var(--text-muted)] gap-2 py-12",children:(0,b.jsxs)("div",{className:"p-3 rounded-lg bg-rose-950/30 border border-rose-800/40 text-rose-300 text-xs text-center max-w-md",children:[(0,b.jsx)("p",{className:"font-semibold mb-1",children:"Unable to load transcript"}),(0,b.jsx)("p",{className:"text-[11px] text-rose-400",children:aj})]})}),!ai&&0===ah.length&&!aj&&(0,b.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-[var(--text-muted)] gap-2 py-12",children:[(0,b.jsx)(k.f,{className:"w-8 h-8 opacity-40"}),(0,b.jsx)("span",{className:"text-xs",children:"No conversation history found for this session."})]}),ah.map(c=>(0,b.jsx)(C.f,{turn:c,agentColor:a.color?a.color.toString(16).padStart(6,"0"):"38bdf8",filter:M,onImageClick:a=>T(a)},c.id)),(0,b.jsx)("div",{ref:ab})]})}),(0,b.jsxs)("div",{className:`border-t border-[var(--border-subtle)] bg-[var(--bg-workbench)] flex items-center justify-between text-[11px] text-[var(--text-muted)] font-mono shrink-0 py-2 ${G?"px-3":"px-5 rounded-b-2xl"}`,children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 truncate",children:[(0,b.jsxs)("span",{children:[ah.length," turns"]}),(0,b.jsx)("span",{children:"•"}),(0,b.jsx)("span",{className:"truncate",children:Z(ag?.durationMs||a?.elapsedMs)}),af&&(0,b.jsxs)("span",{className:"hidden sm:inline-flex items-center gap-1 text-cyan-400",children:[(0,b.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-ping inline-block"}),"Live"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,b.jsxs)("span",{children:["In ",Y(ag?.tokens?.input||a?.tokens?.input)]}),(0,b.jsxs)("span",{children:["Out ",Y(ag?.tokens?.output||a?.tokens?.output)]}),(ag?.tokens?.cached||a?.tokens?.cached)>0&&(0,b.jsxs)("span",{className:"text-cyan-400 hidden sm:inline",children:["Cache ",Y(ag?.tokens?.cached||a?.tokens?.cached)]})]})]}),S&&(0,b.jsx)(D.f,{image:S,onClose:()=>T(null)}),(0,b.jsx)(V,{isOpen:_,onClose:()=>aa(!1),session:ag,turns:ah})]})}],33364);let $={showcase:{agents:24,errorRatio:0,preset:"showcase",label:"All Items Showcase (24)"},cases:{agents:17,errorRatio:0,cases:!0,label:"Edge Cases & Items (17)"},showcase_skins:{agents:15,errorRatio:0,preset:"showcase_skins",label:"Skins & Outfits (15)"},showcase_props:{agents:14,errorRatio:0,preset:"showcase_props",label:"Tech Props & Gadgets (14)"},showcase_pets:{agents:12,errorRatio:0,preset:"showcase_pets",label:"Pets & Companions (12)"},showcase_auras:{agents:12,errorRatio:0,preset:"showcase_auras",label:"Particle Auras & VFX (12)"},showcase_trophies:{agents:12,errorRatio:0,preset:"showcase_trophies",label:"Trophies & Badges (12)"},storm:{agents:30,errorRatio:.15,label:"Storm (30 Agents)"},busy:{agents:8,errorRatio:0,label:"Busy (8 Agents)"},idle:{agents:2,errorRatio:0,label:"Idle (2 Agents)"},errors:{agents:10,errorRatio:.6,label:"Error States"}},_=[{account:"Claude Code · main",icon:"terminal",cli:"claude",clientType:"cli"},{account:"Claude Desktop",icon:"desktop_windows",cli:"claude",clientType:"desktop"},{account:"Codex CLI · tui",icon:"terminal",cli:"codex",clientType:"cli"},{account:"Codex Desktop",icon:"desktop_windows",cli:"codex",clientType:"desktop"},{account:"Antigravity · agent",icon:"smart_toy",cli:"antigravity",clientType:"cli"},{account:"Antigravity App",icon:"smart_toy",cli:"antigravity",clientType:"app"},{account:"Cursor · workspace",icon:"edit_note",cli:"cursor",clientType:"extension"},{account:"OpenCode · build",icon:"science",cli:"opencode",clientType:"cli"}],aa=[{provider:"claude",model:"claude-3-7-sonnet"},{provider:"gemini",model:"gemini-2.5-pro"},{provider:"openai (codex)",model:"gpt-5.6-terra"},{provider:"openai",model:"gpt-4o"},{provider:"minimax",model:"minimax-m2"},{provider:"deepseek",model:"deepseek-v3"}],ab=["rate_limited","upstream_timeout","quota_exhausted","auth_refresh_failed"],ac=["bash","read","edit","search","web","mcp","agent","gitnexus","browser","git","docker"],ad=[{name:"01 · Sleeping (Dozing Shiba)",state:"done",ageMs:38e3,skin:"skin_0",props:["prop_100"],pet:"pet_50",aura:"none",trophy:"none"},{name:"02 · Happy (Celebration)",state:"done",ageMs:9e3,cost:1.42,skin:"skin_200",props:["prop_200"],pet:"pet_1",aura:"aura_25",trophy:"trophy_0"},{name:"03 · Pending (Drone Thinking)",state:"pending",ageMs:2500,tools:["todo"],skin:"skin_100",props:["prop_50"],pet:"pet_100",aura:"none",trophy:"none"},{name:"04 · GitNexus (Matrix Rain)",state:"streaming",ageMs:14e3,tools:["gitnexus","read"],skin:"skin_150",props:["prop_0"],pet:"pet_150",aura:"aura_0",trophy:"trophy_25"},{name:"05 · Docker (Quantum Mist)",state:"streaming",ageMs:15e3,tools:["docker","bash"],skin:"skin_50",props:["prop_50"],pet:"pet_1",aura:"aura_50",trophy:"none"},{name:"06 · Browser (Holo Emitter)",state:"streaming",ageMs:16e3,tools:["browser","web"],skin:"skin_1",props:["prop_150"],pet:"pet_100",aura:"aura_75",trophy:"trophy_50"},{name:"07 · Git+Agent (Arcade Diamond)",state:"streaming",ageMs:12e3,tools:["git","agent"],concurrent:4,skin:"skin_51",props:["prop_200"],pet:"pet_50",aura:"aura_25",trophy:"trophy_75"},{name:"08 · Rate Limited (Oscilloscope)",state:"error",ageMs:6e3,error:"rate_limited",skin:"skin_101",props:["prop_300"],pet:"pet_150",aura:"aura_75",trophy:"trophy_50"},{name:"09 · Upstream Timeout (Bonsai)",state:"error",ageMs:3e4,error:"upstream_timeout",skin:"skin_201",props:["prop_250"],pet:"pet_100",aura:"none",trophy:"none"},{name:"10 · Quota Exhausted (Server)",state:"error",ageMs:8e3,error:"quota_exhausted",skin:"skin_151",props:["prop_0"],pet:"pet_1",aura:"aura_0",trophy:"none"},{name:"11 · Auth Failed (Ninja Spark)",state:"error",ageMs:5e3,error:"auth_refresh_failed",skin:"skin_100",props:["prop_100"],pet:"pet_50",aura:"aura_75",trophy:"none"},{name:"12 · Fallback 1 (Espresso Station)",state:"streaming",ageMs:13e3,tools:["bash"],fallbackShift:3,skin:"skin_0",props:["prop_100"],pet:"pet_1",aura:"aura_50",trophy:"trophy_0"},{name:"13 · Fallback 2 (Holo + Key)",state:"streaming",ageMs:14e3,tools:["browser","mcp"],fallbackShift:2,skin:"skin_50",props:["prop_150"],pet:"pet_150",aura:"aura_25",trophy:"trophy_0"},{name:"14 · Slow Task (DualMon + Owl)",state:"streaming",ageMs:36e3,tools:["docker"],skin:"skin_152",props:["prop_50"],pet:"pet_150",aura:"aura_0",trophy:"trophy_25"},{name:"15 · Queue+Cached (Bonsai Master)",state:"streaming",ageMs:1e4,tools:["read","search"],concurrent:5,cachedBoost:!0,skin:"skin_202",props:["prop_250"],pet:"pet_50",aura:"aura_50",trophy:"trophy_50"},{name:"16 · Runaway Loop (Oscilloscope)",state:"streaming",ageMs:18e3,tools:["bash"],isLooping:!0,skin:"skin_102",props:["prop_300"],pet:"pet_1",aura:"aura_75",trophy:"trophy_75"},{name:"17 · Expensive Task (Arcade Bug)",state:"done",ageMs:2e4,cost:7.35,skin:"skin_52",props:["prop_200","prop_0"],pet:"pet_100",aura:"aura_25",trophy:"trophy_75"}],ae=[{name:"01 · CyberSuit · Server · Cat",state:"streaming",ageMs:14e3,tools:["gitnexus","read"],skin:"skin_0",props:["prop_0"],pet:"pet_1",aura:"aura_25",trophy:"trophy_0"},{name:"02 · MechaPilot · DualMon · Shiba",state:"streaming",ageMs:16e3,tools:["docker","bash"],skin:"skin_50",props:["prop_50"],pet:"pet_50",aura:"aura_50",trophy:"trophy_25"},{name:"03 · StealthNinja · Espresso · Drone",state:"happy",ageMs:9e3,cost:1.45,tools:["edit"],skin:"skin_100",props:["prop_100"],pet:"pet_100",aura:"aura_75",trophy:"trophy_50"},{name:"04 · MatrixHacker · Holo · Owl",state:"streaming",ageMs:18e3,tools:["browser","web"],skin:"skin_150",props:["prop_150"],pet:"pet_150",aura:"aura_0",trophy:"trophy_75"},{name:"05 · CelestialAstro · Arcade · Cat",state:"happy",ageMs:11e3,cost:2.1,tools:["bash"],skin:"skin_200",props:["prop_200"],pet:"pet_2",aura:"aura_25",trophy:"trophy_0"},{name:"06 · CyberSuit · Bonsai + Server",state:"pending",ageMs:2400,tools:["todo"],skin:"skin_1",props:["prop_250","prop_1"],pet:"pet_51",aura:"aura_50",trophy:"trophy_25"},{name:"07 · MechaPilot · Oscilloscope · Drone",state:"streaming",ageMs:22e3,tools:["agent","git"],skin:"skin_51",props:["prop_300"],pet:"pet_101",aura:"aura_75",trophy:"trophy_50"},{name:"08 · StealthNinja · DualMon + Espresso",state:"streaming",ageMs:15e3,tools:["read","search"],skin:"skin_101",props:["prop_51","prop_101"],pet:"pet_151",aura:"aura_0",trophy:"trophy_75"},{name:"09 · MatrixHacker · Oscilloscope (Loop)",state:"streaming",ageMs:19e3,tools:["bash"],isLooping:!0,skin:"skin_151",props:["prop_301"],pet:"pet_3",aura:"aura_25",trophy:"trophy_0"},{name:"10 · CelestialAstro · Holo · Shiba",state:"streaming",ageMs:13e3,tools:["mcp","bash"],skin:"skin_201",props:["prop_151"],pet:"pet_52",aura:"aura_50",trophy:"trophy_25"},{name:"11 · CyberSuit · Arcade · Drone",state:"streaming",ageMs:21e3,tools:["docker"],skin:"skin_2",props:["prop_201"],pet:"pet_102",aura:"aura_75",trophy:"trophy_50"},{name:"12 · MechaPilot · Bonsai · Owl (Sleep)",state:"done",ageMs:39e3,skin:"skin_52",props:["prop_251"],pet:"pet_152",aura:"aura_0",trophy:"trophy_75"},{name:"13 · StealthNinja · Server (Error)",state:"error",ageMs:6500,error:"rate_limited",skin:"skin_102",props:["prop_2"],pet:"pet_1",aura:"aura_26",trophy:"trophy_1"},{name:"14 · MatrixHacker · DualMon · Shiba",state:"streaming",ageMs:12e3,tools:["web","read"],skin:"skin_152",props:["prop_52"],pet:"pet_50",aura:"aura_51",trophy:"trophy_26"},{name:"15 · CelestialAstro · Espresso · Drone",state:"happy",ageMs:8500,cost:3.2,tools:["git"],skin:"skin_202",props:["prop_102"],pet:"pet_100",aura:"aura_76",trophy:"trophy_51"},{name:"16 · CyberSuit · Holo · Owl",state:"streaming",ageMs:17e3,tools:["bash","edit"],skin:"skin_0",props:["prop_152"],pet:"pet_150",aura:"aura_1",trophy:"trophy_76"},{name:"17 · MechaPilot · Arcade · Cat",state:"streaming",ageMs:14e3,tools:["agent","gitnexus"],skin:"skin_50",props:["prop_202"],pet:"pet_2",aura:"aura_27",trophy:"trophy_2"},{name:"18 · StealthNinja · Bonsai · Shiba",state:"pending",ageMs:2200,tools:["todo"],skin:"skin_100",props:["prop_252"],pet:"pet_51",aura:"aura_52",trophy:"trophy_27"},{name:"19 · MatrixHacker · Oscilloscope · Drone",state:"streaming",ageMs:16e3,tools:["docker","mcp"],skin:"skin_150",props:["prop_302"],pet:"pet_101",aura:"aura_77",trophy:"trophy_52"},{name:"20 · CelestialAstro · Server · Owl",state:"streaming",ageMs:25e3,tools:["read","bash"],skin:"skin_200",props:["prop_0"],pet:"pet_151",aura:"aura_2",trophy:"trophy_77"},{name:"21 · CyberSuit · DualMon + Arcade",state:"happy",ageMs:9500,cost:4.5,tools:["gitnexus"],skin:"skin_1",props:["prop_50","prop_200"],pet:"pet_1",aura:"aura_25",trophy:"trophy_0"},{name:"22 · MechaPilot · Espresso + Holo",state:"streaming",ageMs:13500,tools:["web","mcp"],skin:"skin_51",props:["prop_100","prop_150"],pet:"pet_50",aura:"aura_50",trophy:"trophy_25"},{name:"23 · StealthNinja · Oscilloscope + Server",state:"streaming",ageMs:15500,tools:["agent","bash"],skin:"skin_101",props:["prop_300","prop_1"],pet:"pet_100",aura:"aura_75",trophy:"trophy_50"},{name:"24 · MatrixHacker · Bonsai + DualMon",state:"streaming",ageMs:17500,tools:["git","edit"],skin:"skin_151",props:["prop_250","prop_51"],pet:"pet_150",aura:"aura_0",trophy:"trophy_75"}],af=[{name:"Neon Enforcer (Visor)",skin:"skin_0",state:"streaming",ageMs:12e3,tools:["bash"],props:["prop_50"]},{name:"Crimson Striker (Monocle)",skin:"skin_1",state:"streaming",ageMs:14e3,tools:["read"],props:["prop_100"]},{name:"Electric Specter (Horns)",skin:"skin_3",state:"happy",ageMs:9e3,tools:["edit"],props:["prop_200"]},{name:"Obsidian Ronin (Kabuto)",skin:"skin_7",state:"pending",ageMs:2500,tools:["todo"],props:["prop_250"]},{name:"Apex Frame (V-Fin)",skin:"skin_10",state:"streaming",ageMs:16e3,tools:["docker"],props:["prop_0"]},{name:"Heavy Colossus (Blast)",skin:"skin_11",state:"streaming",ageMs:18e3,tools:["agent"],props:["prop_150"]},{name:"Berserk EVA (Horn)",skin:"skin_12",state:"streaming",ageMs:15e3,tools:["search"],props:["prop_300"]},{name:"Shadow Shinobi (Headband)",skin:"skin_20",state:"streaming",ageMs:13e3,tools:["gitnexus"],props:["prop_250"]},{name:"Kage Oni (Demon Mask)",skin:"skin_22",state:"streaming",ageMs:15e3,tools:["search"],props:["prop_51"]},{name:"Cyber Kasa (Conical Hat)",skin:"skin_24",state:"done",ageMs:38e3,props:["prop_101"]},{name:"Root Netrunner (Hoodie)",skin:"skin_30",state:"streaming",ageMs:17e3,tools:["web"],props:["prop_0"]},{name:"Binary Coder (VR Goggles)",skin:"skin_31",state:"streaming",ageMs:19e3,tools:["bash"],isLooping:!0,props:["prop_301"]},{name:"Cablehead (Dreadlocks)",skin:"skin_37",state:"streaming",ageMs:11e3,tools:["mcp"],props:["prop_151"]},{name:"Solar Voyager (Bubble Dome)",skin:"skin_40",state:"happy",ageMs:8e3,tools:["git"],props:["prop_201"]},{name:"Nebula Drifter (Saturn Ring)",skin:"skin_43",state:"error",ageMs:6e3,error:"rate_limited",props:["prop_52"]}],ag=[{name:"Supercomputer Solo",props:["prop_0"],skin:"skin_0",state:"streaming",ageMs:12e3,tools:["docker"]},{name:"Supercomputer + DualMon",props:["prop_0","prop_50"],skin:"skin_50",state:"streaming",ageMs:15e3,tools:["bash"]},{name:"Dual Monitor Solo",props:["prop_50"],skin:"skin_100",state:"streaming",ageMs:14e3,tools:["read"]},{name:"DualMon + Espresso",props:["prop_50","prop_100"],skin:"skin_150",state:"happy",ageMs:9e3,tools:["edit"]},{name:"Espresso Station Solo",props:["prop_100"],skin:"skin_200",state:"streaming",ageMs:16e3,tools:["web"]},{name:"Espresso + Holo",props:["prop_100","prop_150"],skin:"skin_1",state:"streaming",ageMs:18e3,tools:["agent"]},{name:"Hologram Emitter Solo",props:["prop_150"],skin:"skin_51",state:"streaming",ageMs:13e3,tools:["gitnexus"]},{name:"Holo + Arcade",props:["prop_150","prop_200"],skin:"skin_101",state:"happy",ageMs:11e3,tools:["git"]},{name:"Arcade Cabinet Solo",props:["prop_200"],skin:"skin_151",state:"streaming",ageMs:17e3,tools:["bash"]},{name:"Arcade + Bonsai",props:["prop_200","prop_250"],skin:"skin_201",state:"pending",ageMs:2500,tools:["todo"]},{name:"Terrarium Bonsai Solo",props:["prop_250"],skin:"skin_2",state:"done",ageMs:38e3},{name:"Bonsai + Oscilloscope",props:["prop_250","prop_300"],skin:"skin_52",state:"streaming",ageMs:2e4,tools:["docker"]},{name:"Lab Oscilloscope Solo",props:["prop_300"],skin:"skin_102",state:"streaming",ageMs:19e3,tools:["bash"],isLooping:!0},{name:"Oscilloscope + Server",props:["prop_300","prop_0"],skin:"skin_152",state:"error",ageMs:6e3,error:"rate_limited"}],ah=[{name:"Cyber Cat (Cozy)",pet:"pet_1",skin:"skin_0",state:"streaming",ageMs:12e3,tools:["bash"]},{name:"Cyber Cat (Playful)",pet:"pet_2",skin:"skin_50",state:"happy",ageMs:9e3,tools:["edit"]},{name:"Cyber Cat (Sleeping)",pet:"pet_3",skin:"skin_100",state:"done",ageMs:38e3},{name:"Dozing Shiba (Golden)",pet:"pet_50",skin:"skin_150",state:"streaming",ageMs:14e3,tools:["read"]},{name:"Dozing Shiba (Alert)",pet:"pet_51",skin:"skin_200",state:"happy",ageMs:1e4,tools:["git"]},{name:"Dozing Shiba (Resting)",pet:"pet_52",skin:"skin_1",state:"pending",ageMs:2400,tools:["todo"]},{name:"Hover Drone (Orbital)",pet:"pet_100",skin:"skin_51",state:"streaming",ageMs:16e3,tools:["docker"]},{name:"Hover Drone (Patrol)",pet:"pet_101",skin:"skin_101",state:"streaming",ageMs:18e3,tools:["agent"]},{name:"Hover Drone (Recon)",pet:"pet_102",skin:"skin_151",state:"error",ageMs:6500,error:"quota_exhausted"},{name:"Cyber Owl (Clockwork)",pet:"pet_150",skin:"skin_201",state:"streaming",ageMs:13e3,tools:["web"]},{name:"Cyber Owl (Wisdom)",pet:"pet_151",skin:"skin_2",state:"happy",ageMs:8500,tools:["gitnexus"]},{name:"Cyber Owl (Night Watch)",pet:"pet_152",skin:"skin_52",state:"streaming",ageMs:22e3,tools:["mcp"]}],ai=[{name:"Matrix Rain (Laser Green)",aura:"aura_0",skin:"skin_150",state:"streaming",ageMs:14e3,tools:["gitnexus"]},{name:"Matrix Rain (Emerald)",aura:"aura_1",skin:"skin_151",state:"streaming",ageMs:17e3,tools:["bash"],isLooping:!0},{name:"Matrix Rain (Jade)",aura:"aura_2",skin:"skin_152",state:"happy",ageMs:9e3,tools:["read"]},{name:"Plasma Ring (Cyan Orbit)",aura:"aura_25",skin:"skin_0",state:"streaming",ageMs:13e3,tools:["web"]},{name:"Plasma Ring (Electric)",aura:"aura_26",skin:"skin_1",state:"happy",ageMs:11e3,tools:["edit"]},{name:"Plasma Ring (Cosmic)",aura:"aura_27",skin:"skin_2",state:"pending",ageMs:2500,tools:["todo"]},{name:"Quantum Mist (Nebula)",aura:"aura_50",skin:"skin_50",state:"streaming",ageMs:15e3,tools:["docker"]},{name:"Quantum Mist (Violet)",aura:"aura_51",skin:"skin_51",state:"streaming",ageMs:18e3,tools:["agent"]},{name:"Quantum Mist (Astral)",aura:"aura_52",skin:"skin_52",state:"done",ageMs:38e3},{name:"Glitch Halo (Prismatic)",aura:"aura_75",skin:"skin_100",state:"streaming",ageMs:16e3,tools:["mcp"]},{name:"Glitch Halo (Amber Shock)",aura:"aura_76",skin:"skin_101",state:"error",ageMs:6e3,error:"rate_limited"},{name:"Glitch Halo (Neon Spark)",aura:"aura_77",skin:"skin_102",state:"streaming",ageMs:2e4,tools:["git"]}],aj=[{name:"Golden Key (Master)",trophy:"trophy_0",skin:"skin_0",state:"happy",ageMs:9e3,cost:2.5,tools:["edit"]},{name:"Golden Key (Champion)",trophy:"trophy_1",skin:"skin_1",state:"streaming",ageMs:14e3,tools:["bash"]},{name:"Golden Key (Honor)",trophy:"trophy_2",skin:"skin_2",state:"pending",ageMs:2500,tools:["todo"]},{name:"Silicon Wafer (3nm)",trophy:"trophy_25",skin:"skin_50",state:"streaming",ageMs:16e3,tools:["docker"]},{name:"Silicon Wafer (Nanometer)",trophy:"trophy_26",skin:"skin_51",state:"happy",ageMs:1e4,cost:3.1,tools:["git"]},{name:"Silicon Wafer (Quantum)",trophy:"trophy_27",skin:"skin_52",state:"streaming",ageMs:19e3,tools:["read"]},{name:"Quantum Crystal (Prism)",trophy:"trophy_50",skin:"skin_100",state:"streaming",ageMs:13e3,tools:["gitnexus"]},{name:"Quantum Crystal (Facet)",trophy:"trophy_51",skin:"skin_101",state:"happy",ageMs:8500,cost:1.8,tools:["web"]},{name:"Quantum Crystal (Pillar)",trophy:"trophy_52",skin:"skin_102",state:"done",ageMs:38e3},{name:"Diamond Bug (Zero-Day)",trophy:"trophy_75",skin:"skin_150",state:"streaming",ageMs:15e3,tools:["agent"]},{name:"Diamond Bug (Flawless)",trophy:"trophy_76",skin:"skin_151",state:"streaming",ageMs:18e3,tools:["bash"],isLooping:!0},{name:"Diamond Bug (Exalted)",trophy:"trophy_77",skin:"skin_152",state:"error",ageMs:6500,error:"rate_limited"}];function ak(a){let b=a>>>0||1;return()=>(b^=b<<13,b^=b>>>17,b^=b<<5,(b>>>=0)/0x100000000)}let al=0;function am(){return!0}function an(){if(am())return;let a=Date.now();a-al<250||(al=a)}function ao(){!am()}function ap(){!am()}function aq(){!am()}function ar(){return!1}async function as(){return!1}a.s(["p",0,am,"o",0,ap,"f",0,ao,"C",0,aq,"L",0,an,"Z",0,function(){return!!am()}],67207);let at=0;function au(a="Agent Desk",b="Task completed successfully."){if(!ar())return;let c=Date.now();if(!(c-at<3e3)){at=c;try{let c=new Notification(`[DONE] Task Complete: ${a}`,{body:b,icon:"/icons/icon-192x192.png",tag:`done-${a}`});c.onclick=()=>{window.focus(),c.close()}}catch{}}}function av(a="Agent Desk",b="Runaway loop detected!"){if(!ar())return;let c=Date.now();if(!(c-at<3e3)){at=c;try{let c=new Notification(`[ALERT] AGMon Alert: ${a}`,{body:b,icon:"/icons/icon-192x192.png",tag:`alert-${a}`});c.onclick=()=>{window.focus(),c.close()}}catch{}}}a.s(["p",0,ar,"Z",0,av,"a",0,au,"i",0,as],73958);let aw={"1h":1,"6h":6,"24h":24,"3d":72,"7d":168,all:0};a.s(["f",0,function({mode:a="live",preset:b="cases",initialTop:d=20,initialTimeframe:e="24h"}={}){let[f,g]=(0,c.useState)(()=>d),[h,i]=(0,c.useState)(()=>e),[j,k]=(0,c.useState)(0);(0,c.useEffect)(()=>{},[f,h]);let[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)([]),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=(0,c.useRef)(null),w=(0,c.useRef)(null),x=(0,c.useRef)(new Map),y=(0,c.useCallback)(a=>{if(!Array.isArray(a)||0===a.length)return;let b=x.current,c=!1;for(let d of a){let a=d.connectionId||d.id,e=b.get(a),f=d.state;"streaming"===f&&(c=!0),d.isLooping&&!b.get(`${a}_looping`)?(ap(),av(d.account||a,"Runaway loop detected! Repeated tool calls."),b.set(`${a}_looping`,!0)):d.isLooping||b.delete(`${a}_looping`),e&&e!==f&&("done"===f?(ao(),au(d.account||a,"All tasks finished successfully.")):"error"===f||"rate_limit"===f||"quota"===f?(ap(),av(d.account||a,`Execution failed (${d.error||f})`)):"waiting_input"===f&&aq()),b.set(a,f)}if(b.size>100){let c=new Set(a.map(a=>a.connectionId||a.id));for(let a of b.keys()){let d=a.endsWith("_looping")?a.replace("_looping",""):a;c.has(d)||b.delete(a)}}c&&an()},[]),[z,A]=(0,c.useState)(0),B=(0,c.useCallback)(()=>{s(!0),v.current&&(v.current.close(),v.current=null),A(a=>a+1),setTimeout(()=>s(!1),500)},[]);return(0,c.useEffect)(()=>{if("mock"!==a)return;let c=$[b]||$.cases,d=()=>{let a=function({count:a=null,errorRatio:b=0,seed:c=42,now:d=Date.now(),cases:e=!1,preset:f=null}={}){let g=null;"showcase"===f||"items"===f?g=ae:"showcase_skins"===f?g=af:"showcase_props"===f?g=ag:"showcase_pets"===f?g=ah:"showcase_auras"===f?g=ai:"showcase_trophies"===f?g=aj:(e||"cases"===f)&&(g=ad);let h=null!=a?a:g?g.length:8,i=ak(c),j=[];for(let a=0;a<h;a+=1){let e,f=_[a%_.length],h=Math.floor(a/_.length)+1,k=h>1?`${f.account} ${h}`:f.account,l=aa[a%aa.length],m=g?g[a%g.length]:null,n=m?.name||k,o=Math.floor(4e4*i()),p=i()<b,q=m?m.ageMs:o,r=d-q,s=m?"error"===m.state:p,t=!!(m?.isLooping||b>.4&&0===a),u=q/4e4;e=t?"streaming":m?m.state:s?"error":u<.25?"pending":u<.6?"streaming":"done";let v={input:Math.round(400+14e3*i()),output:Math.round(80+2900*i()),cached:Math.round(6e3*i())},w=ak(7919*c+104729*a+13),x="done"===e?0:1+Math.floor(3*w()),y=[];for(let a=0;a<x;a+=1)y.push(ac[Math.floor(w()*ac.length)]);let z=t?["bash"]:m?.tools??("error"===e?[]:y),A=[];for(let a of z)A.some(b=>b.tool===a)||A.push({tool:a,state:0===A.length?"running":"queued"});let B=m?!!m.fallbackShift:.28>w(),C=aa[(a+(m?.fallbackShift??3))%aa.length].provider,D=B&&("pending"===e||"streaming"===e)&&C!==l.provider?{from:C}:null,E=m?.concurrent??("done"===e||"error"===e?1:1+Math.floor(3*w()));m?.cachedBoost&&(v.cached=14e3);let F=[],G=r||d-2e4;if(F.push({timestamp:new Date(G).toLocaleTimeString(),type:"prompt",summary:"User Prompt",detail:`Execute pipeline for ${n} (${l.model})`}),t){for(let a=0;a<6;a++)F.push({timestamp:new Date(G+2e3+2e3*a).toLocaleTimeString(),type:"bash",summary:"run_command",detail:"npm test -- --bail (failed exit 1)"});F.push({timestamp:new Date(d).toLocaleTimeString(),type:"error",summary:"Loop Warning",detail:"Runaway loop detected: 6 consecutive identical tool failures"})}else z.forEach((a,b)=>{F.push({timestamp:new Date(G+1500+2500*b).toLocaleTimeString(),type:a,summary:a,detail:`${a} operation completed`})}),s&&F.push({timestamp:new Date(d).toLocaleTimeString(),type:"error",summary:"Error",detail:m?.error||"Upstream rate limit or timeout"});j.push({traceId:`mock-${f.cli||"agent"}-${a}-${Math.floor(1e6*i()).toString(36)}`,cli:f.cli||"mock",clientType:f.clientType||"cli",connectionId:`${f.account} (${a})`,account:n,model:l.model,provider:l.provider,state:e,startedAt:r,elapsedMs:q,tokens:v,cost:m?.cost??Math.round((15e-6*v.input+6e-5*v.output)*100)/100,status:t||s?"error":"200",error:s?m?.error??ab[Math.floor(i()*ab.length)%ab.length]:t?"runaway_loop":null,clientIcon:f.icon,toolCalls:A,tools:z,activeTool:z[0]||null,currentCommand:t?"npm test -- --bail (looping)":z[0]?`${z[0]} task running...`:null,fallback:D,concurrent:E,isLooping:t,skin:m?.skin??null,aura:m?.aura??null,props:m?.props??[],pet:m?.pet??null,trophy:m?.trophy??null,theme:m?.theme??null,logs:F})}return j}({count:c.agents,cases:!!c.cases,errorRatio:c.errorRatio,preset:b}),d="all"===f?0:Number(f),e=d>0&&d<a.length?a.slice(0,d):a;m(e),k(a.length),y(e),o(function(a){let b=new Map;for(let c of a)c.provider&&!b.has(c.provider)&&b.set(c.provider,{provider:c.provider,name:c.provider.charAt(0).toUpperCase()+c.provider.slice(1)});return[...b.values()]}(e)),q(!0),u(Date.now())};d();let e=setInterval(d,3e3);return()=>clearInterval(e)},[a,b,f,h,z,y]),(0,c.useEffect)(()=>{if("live"!==a)return;let b=!1,c=()=>{w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{b||(console.warn("[SSE] Watchdog timeout, reconnecting..."),A(a=>a+1))},7e3)};try{let a=aw[h]??24,d="all"===f?0:Number(f),e=new EventSource(`/api/traces/stream?source=live&hours=${a}&limit=${d}`);v.current=e,e.onopen=()=>{b||(q(!0),c())},e.onmessage=a=>{if(!b&&a?.data)try{let b=JSON.parse(a.data);Array.isArray(b.traces)&&(m(b.traces),y(b.traces)),"number"==typeof b.totalCount?k(b.totalCount):Array.isArray(b.traces)&&k(b.traces.length),Array.isArray(b.providers)&&o(b.providers),u(Date.now()),c()}catch{}},e.onerror=()=>{b||q(!1)}}catch{q(!1)}return()=>{b=!0,w.current&&clearTimeout(w.current),v.current&&(v.current.close(),v.current=null)}},[a,h,f,z,y]),(0,c.useEffect)(()=>{if("live"!==a)return;let b=null,c=()=>{"visible"===document.visibilityState&&(b&&clearTimeout(b),b=setTimeout(()=>{let a=v.current;a&&a.readyState===EventSource.OPEN?console.log("[AgentFactory] Tab active / wake up, stream is already active."):(console.log("[AgentFactory] Tab active / wake up, reconnecting telemetry stream..."),B())},300))};return window.addEventListener("visibilitychange",c),window.addEventListener("online",c),window.addEventListener("focus",c),()=>{b&&clearTimeout(b),window.removeEventListener("visibilitychange",c),window.removeEventListener("online",c),window.removeEventListener("focus",c)}},[a,B]),{traces:l,totalCount:j,top:f,setTop:g,timeframe:h,setTimeframe:i,providers:n,connected:p,live:"live"===a,isRefreshing:r,refresh:B,lastUpdated:t}}],50636)},33788,a=>{var b=a.i(72131);a.s(["f",0,function(a,c=!1){let[d,e]=(0,b.useState)(null),[f,g]=(0,b.useState)(!0),[h,i]=(0,b.useState)(null),j=(0,b.useRef)(null),k=(0,b.useRef)(!1),l=(0,b.useRef)(null),m=(0,b.useCallback)(async()=>{if(a&&!k.current){l.current&&l.current.abort(),l.current=new AbortController,k.current=!0;try{let b=await fetch(`/api/sessions/${encodeURIComponent(a)}/transcript`,{signal:l.current.signal});if(!b.ok){let a=await b.json().catch(()=>({}));throw Error(a.error||`HTTP ${b.status}`)}let c=await b.json();e(c),i(null)}catch(a){"AbortError"!==a.name&&i(a.message)}finally{k.current=!1,g(!1)}}},[a]);(0,b.useEffect)(()=>(g(!0),m(),()=>{l.current&&l.current.abort()}),[m]),(0,b.useEffect)(()=>{if(!c||!a)return;let b=()=>{"visible"===document.visibilityState&&m()};return document.addEventListener("visibilitychange",b),j.current=setInterval(()=>{"visible"===document.visibilityState&&m()},2e3),()=>{document.removeEventListener("visibilitychange",b),j.current&&clearInterval(j.current),l.current&&l.current.abort()}},[c,a,m]);let n=(0,b.useCallback)(()=>{if(!d||!d.turns)return;let b=d.session||{},c=`# Conversation Transcript: ${b.id||a}
397
397
 
398
398
  `;for(let a of(c+=`- **CLI:** ${b.cli||"Unknown"}
399
399
  - **Model:** ${b.model||"Unknown"}