maestro-flow 0.4.7 → 0.4.9

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 (136) hide show
  1. package/.claude/commands/maestro-ralph.md +548 -377
  2. package/.claude/commands/maestro.md +220 -191
  3. package/.codex/skills/maestro/SKILL.md +495 -462
  4. package/.codex/skills/maestro-ralph/SKILL.md +491 -339
  5. package/dashboard/dist/assets/{ArtifactsPage-CVh0Z2I2.js → ArtifactsPage-BLvAqQlQ.js} +1 -1
  6. package/dashboard/dist/assets/{ChatInput-CBI3qHQQ.js → ChatInput-DU9YGZKX.js} +1 -1
  7. package/dashboard/dist/assets/{ChatPage-BjJ9CYox.js → ChatPage-DYHfheXC.js} +1 -1
  8. package/dashboard/dist/assets/{CollabPage-CprGGO9y.js → CollabPage-CSlmvEa-.js} +1 -1
  9. package/dashboard/dist/assets/{ExecutionPanel-CClxD7cH.js → ExecutionPanel-RYWf0dYC.js} +1 -1
  10. package/dashboard/dist/assets/{KanbanPage-copqjdPg.js → KanbanPage-N55Iv0-X.js} +1 -1
  11. package/dashboard/dist/assets/{MaestroCoordinatePage-CioZjQ9N.js → MaestroCoordinatePage-BxwZ6yy5.js} +1 -1
  12. package/dashboard/dist/assets/{MarkdownRenderer-CtUhoxCT.js → MarkdownRenderer-ZGtOY7Ti.js} +1 -1
  13. package/dashboard/dist/assets/{McpPage-BcPPcJpr.js → McpPage-Im6s4pGR.js} +1 -1
  14. package/dashboard/dist/assets/{MeetingRoomPage-BgmAKxU-.js → MeetingRoomPage-CxHRn1xx.js} +1 -1
  15. package/dashboard/dist/assets/{OutputPanel-DgT3gMyp.js → OutputPanel-DaL8c1i5.js} +1 -1
  16. package/dashboard/dist/assets/{ProblemsPanel-BmG7rxoG.js → ProblemsPanel-BQTd5812.js} +1 -1
  17. package/dashboard/dist/assets/{RequirementBoardPage-k8YoeQ0r.js → RequirementBoardPage-22y9u1qh.js} +1 -1
  18. package/dashboard/dist/assets/{RequirementPage-Da2354px.js → RequirementPage-_mO743Xm.js} +1 -1
  19. package/dashboard/dist/assets/{RoomsPage-BtqDiYaU.js → RoomsPage-CExTbOGr.js} +1 -1
  20. package/dashboard/dist/assets/{SpecsPage-ByPVH_M3.js → SpecsPage-gr4KX51-.js} +1 -1
  21. package/dashboard/dist/assets/{TeamsPage-sFDLN30L.js → TeamsPage-BxEXLb5g.js} +1 -1
  22. package/dashboard/dist/assets/{TreeBrowser-oEx8YJXV.js → TreeBrowser-CVtPF5C9.js} +1 -1
  23. package/dashboard/dist/assets/{WorkflowPage-JrX7CVHh.js → WorkflowPage-BoN18Lhs.js} +1 -1
  24. package/dashboard/dist/assets/{arrow-left-DYvgSdIH.js → arrow-left-C5ROg97G.js} +1 -1
  25. package/dashboard/dist/assets/{check-jcgYBWVR.js → check-Bs8PM0tQ.js} +1 -1
  26. package/dashboard/dist/assets/{chevron-right-DvZ5sMOg.js → chevron-right-SmErd_1F.js} +1 -1
  27. package/dashboard/dist/assets/{circle-DYT-zoRZ.js → circle-CjpslL_D.js} +1 -1
  28. package/dashboard/dist/assets/{circle-alert-Bfbv3gt4.js → circle-alert-CuzAg2fd.js} +1 -1
  29. package/dashboard/dist/assets/{circle-check-D82WnpbI.js → circle-check-BIkDU5D5.js} +1 -1
  30. package/dashboard/dist/assets/{circle-check-big-CPVD1GKF.js → circle-check-big-CYctV8bK.js} +1 -1
  31. package/dashboard/dist/assets/{code-B3bKFGI4.js → code-DoB7rfxt.js} +1 -1
  32. package/dashboard/dist/assets/{columns-3-BeMAQCix.js → columns-3-Ch5KIyRa.js} +1 -1
  33. package/dashboard/dist/assets/{download-BCtpoWYB.js → download-DadtG2Nr.js} +1 -1
  34. package/dashboard/dist/assets/{folder-CTj6SNNu.js → folder-B8ODoZfb.js} +1 -1
  35. package/dashboard/dist/assets/{index-BxR_3IbJ.js → index-BL4h1OKY.js} +1 -1
  36. package/dashboard/dist/assets/{index-DpcPd-UG.js → index-DQIlX2w_.js} +4 -4
  37. package/dashboard/dist/assets/{index-CWBJLu42.js → index-DaFwSmVJ.js} +10 -10
  38. package/dashboard/dist/assets/{list-BMv8pIQn.js → list-CI-XIPZh.js} +1 -1
  39. package/dashboard/dist/assets/{loader-DdM4VOgF.js → loader-DpdMoQvh.js} +1 -1
  40. package/dashboard/dist/assets/{minus-D15s2E__.js → minus-BVbfXGrC.js} +1 -1
  41. package/dashboard/dist/assets/{pen-line-DO6o4xWz.js → pen-line-CR8GaHt-.js} +1 -1
  42. package/dashboard/dist/assets/{pencil-qGxg9jOe.js → pencil-I7GE0y29.js} +1 -1
  43. package/dashboard/dist/assets/{proxy-DOffTzwA.js → proxy-CcYyZZWI.js} +1 -1
  44. package/dashboard/dist/assets/{refresh-cw-C9UNdLCy.js → refresh-cw-BG9V_T4R.js} +1 -1
  45. package/dashboard/dist/assets/{rows-2-CifAA5SL.js → rows-2-DP6NjQFk.js} +1 -1
  46. package/dashboard/dist/assets/{search-pe7pU1YN.js → search-b78eLlw2.js} +1 -1
  47. package/dashboard/dist/assets/{shallow-r7YynQYA.js → shallow-CJEesgtu.js} +1 -1
  48. package/dashboard/dist/assets/{table-Bh772iIw.js → table-B_lk-a1d.js} +1 -1
  49. package/dashboard/dist/assets/{team-types-C_HqX2p2.js → team-types-Se7f9LfJ.js} +1 -1
  50. package/dashboard/dist/assets/{terminal-EpmtGBlw.js → terminal-DXx4tvzq.js} +1 -1
  51. package/dashboard/dist/assets/{trash-2-Xen46iNQ.js → trash-2-CVh9mnRj.js} +1 -1
  52. package/dashboard/dist/assets/{users-BLueDPxF.js → users-Da9zGME5.js} +1 -1
  53. package/dashboard/dist/assets/{zap-DsQCPF61.js → zap-C0zaC7gJ.js} +1 -1
  54. package/dashboard/dist/index.html +1 -1
  55. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js +4 -0
  56. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js.map +1 -1
  57. package/dashboard/dist-server/dashboard/src/server/agents/agy-adapter.d.ts +39 -0
  58. package/dashboard/dist-server/dashboard/src/server/agents/agy-adapter.js +423 -0
  59. package/dashboard/dist-server/dashboard/src/server/agents/agy-adapter.js.map +1 -0
  60. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +25 -33
  61. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
  62. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js +9 -3
  63. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js.map +1 -1
  64. package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js +5 -2
  65. package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js.map +1 -1
  66. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.d.ts +6 -0
  67. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +129 -8
  68. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  69. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js +6 -3
  70. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js.map +1 -1
  71. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js +7 -1
  72. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js.map +1 -1
  73. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.d.ts +2 -0
  74. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js +40 -15
  75. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js.map +1 -1
  76. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.d.ts +1 -0
  77. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js +59 -0
  78. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js.map +1 -0
  79. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.d.ts +1 -0
  80. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js +78 -0
  81. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js.map +1 -0
  82. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.d.ts +25 -0
  83. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js +40 -0
  84. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js.map +1 -0
  85. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.d.ts +1 -0
  86. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js +89 -0
  87. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js.map +1 -0
  88. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +19 -8
  89. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
  90. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.d.ts +6 -0
  91. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js +7 -1
  92. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js.map +1 -1
  93. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.d.ts +1 -0
  94. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js +46 -0
  95. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js.map +1 -0
  96. package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -0
  97. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  98. package/dashboard/dist-server/shared/agent-types.d.ts +7 -1
  99. package/dist/shared/agent-types.d.ts +7 -1
  100. package/dist/shared/agent-types.d.ts.map +1 -1
  101. package/dist/src/agents/cli-agent-runner.d.ts +3 -0
  102. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  103. package/dist/src/agents/cli-agent-runner.js +4 -0
  104. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  105. package/dist/src/commands/delegate.d.ts +2 -0
  106. package/dist/src/commands/delegate.d.ts.map +1 -1
  107. package/dist/src/commands/delegate.js +18 -0
  108. package/dist/src/commands/delegate.js.map +1 -1
  109. package/dist/src/commands/hooks.d.ts +64 -0
  110. package/dist/src/commands/hooks.d.ts.map +1 -1
  111. package/dist/src/commands/hooks.js +107 -0
  112. package/dist/src/commands/hooks.js.map +1 -1
  113. package/dist/src/commands/install.d.ts.map +1 -1
  114. package/dist/src/commands/install.js +17 -3
  115. package/dist/src/commands/install.js.map +1 -1
  116. package/dist/src/commands/update.d.ts.map +1 -1
  117. package/dist/src/commands/update.js +53 -0
  118. package/dist/src/commands/update.js.map +1 -1
  119. package/dist/src/config/cli-tools-config.d.ts +22 -5
  120. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  121. package/dist/src/config/cli-tools-config.js +77 -32
  122. package/dist/src/config/cli-tools-config.js.map +1 -1
  123. package/dist/src/config/cli-tools-defaults.json +2 -1
  124. package/dist/src/core/component-defs.d.ts.map +1 -1
  125. package/dist/src/core/component-defs.js +53 -0
  126. package/dist/src/core/component-defs.js.map +1 -1
  127. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  128. package/dist/src/tui/install-ui/InstallExecution.js +5 -3
  129. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  130. package/dist/src/utils/update-notices.d.ts +62 -0
  131. package/dist/src/utils/update-notices.d.ts.map +1 -0
  132. package/dist/src/utils/update-notices.js +178 -0
  133. package/dist/src/utils/update-notices.js.map +1 -0
  134. package/package.json +82 -82
  135. package/shared/agent-types.ts +237 -231
  136. package/workflows/agy-instructions.md +124 -0
@@ -1 +1 @@
1
- import{j as e,an as g,M as b,l as h,r as c,s as v,R as y,P as j,O as N,f as w,T as C,h as p,i as m,ao as u,a4 as f,ap as k}from"./index-DpcPd-UG.js";import{T as z}from"./trash-2-Xen46iNQ.js";import{U as R}from"./users-BLueDPxF.js";import{C as D}from"./chevron-right-DvZ5sMOg.js";const S={active:"#3D9B6F",paused:"#C99B2D",destroyed:"#D05454"};function L({status:t}){const a=S[t]??"#A09D97";return e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${a}18`,color:a},children:[t==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:a}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:a}})]}),t.charAt(0).toUpperCase()+t.slice(1)]})}function M({room:t,onClick:a,onDelete:i}){const o=Date.now()-new Date(t.createdAt).getTime(),r=Math.floor(o/6e4),l=r<60?`${r}m`:`${Math.floor(r/60)}h ${r%60}m`;return e.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&a()},className:"group w-full text-left bg-bg-card border border-border rounded-xl p-3.5 hover:border-accent-blue hover:shadow-[0_2px_12px_rgba(0,0,0,0.06)] transition-all duration-150 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[11px] font-bold text-white shrink-0 bg-[#4A90D9]",children:"MR"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:t.sessionId})}),e.jsx(L,{status:t.status}),i&&e.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),i(t.sessionId)},className:"w-6 h-6 rounded-md flex items-center justify-center text-text-placeholder opacity-0 group-hover:opacity-100 hover:!text-status-failed hover:bg-[rgba(196,101,85,0.1)] transition-all shrink-0",title:"Delete room",children:e.jsx(z,{size:13,strokeWidth:2})})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-tertiary",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(R,{size:11}),t.agentCount," agents"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(g,{size:11}),t.taskCount," tasks"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(b,{size:11}),t.messageCount," msgs"]}),e.jsx("span",{className:"ml-auto text-text-placeholder",children:l}),e.jsx(D,{size:14,className:"text-text-placeholder group-hover:text-text-primary transition-colors"})]})]})}const T=m("w-full px-[var(--spacing-3)] py-[var(--spacing-2)]","rounded-[var(--radius-default)] border border-border","bg-bg-secondary text-text-primary","text-[length:var(--font-size-sm)]","focus:outline-none focus:shadow-[var(--shadow-focus-ring)]","transition-shadow duration-[var(--duration-fast)]"),$="block text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-secondary mb-[var(--spacing-1)]";function I(t){return t.toLowerCase().replace(/[^a-z0-9\u4e00-\u9fff]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function P({open:t,onOpenChange:a}){const i=h(),[o,r]=c.useState("");c.useEffect(()=>{t||r("")},[t]);const l=I(o)||`room-${Date.now().toString(36)}`,n=c.useCallback(()=>{o.trim()&&(v({action:"room:create",sessionId:l}),a(!1),i(`/meeting-room/${l}`))},[o,l,a,i]);return e.jsx(y,{open:t,onOpenChange:a,children:e.jsxs(j,{children:[e.jsx(N,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(w,{className:m("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[440px] max-w-[95vw]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-6)] py-[var(--spacing-4)] border-b border-border shrink-0",children:[e.jsx(C,{className:"text-[length:var(--font-size-lg)] font-[var(--font-weight-semibold)] text-text-primary",children:"New Meeting Room"}),e.jsx(p,{className:m("w-8 h-8 flex items-center justify-center rounded-[var(--radius-sm)]","text-text-secondary hover:text-text-primary hover:bg-bg-hover","transition-colors duration-[var(--duration-fast)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]"),"aria-label":"Close",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:"p-[var(--spacing-6)] space-y-[var(--spacing-4)]",children:e.jsxs("div",{children:[e.jsx("label",{htmlFor:"room-name",className:$,children:"Room Name"}),e.jsx("input",{id:"room-name",type:"text",value:o,onChange:d=>r(d.target.value),onKeyDown:d=>{d.key==="Enter"&&n()},placeholder:"e.g. Architecture Review",className:T,autoFocus:!0}),e.jsxs("p",{className:"mt-1 text-[10px] text-text-placeholder font-mono",children:["ID: ",l]})]})}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-[var(--spacing-6)] py-[var(--spacing-4)] border-t border-border",children:[e.jsx(p,{className:m("px-3 py-1.5 rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] text-text-secondary","hover:bg-bg-hover transition-colors"),children:"Cancel"}),e.jsx("button",{type:"button",onClick:n,disabled:!o.trim(),className:m("px-4 py-1.5 rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)]","bg-accent-blue text-white","hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed","transition-opacity"),children:"Create"})]})]})]})})}function W(){const t=h(),a=u(s=>s.rooms),i=u(s=>s.loading),o=u(s=>s.fetchRooms),r=u(s=>s.deleteRoom),[l,n]=c.useState(!1);c.useEffect(()=>{o()},[o]);const d=c.useCallback(async s=>{await r(s)},[r]),x=a.filter(s=>s.status!=="destroyed");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-3 px-3 py-3 border-b border-border-divider bg-bg-secondary shrink-0",children:[e.jsx("h1",{className:"text-[length:var(--font-size-base)] font-semibold text-text-primary",children:"Meeting Rooms"}),e.jsx("span",{className:"text-[11px] text-text-tertiary bg-bg-hover px-1.5 py-0.5 rounded-full",children:x.length}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[12px] font-medium bg-accent-blue text-white hover:opacity-90 transition-opacity",children:[e.jsx(f,{size:14}),"New Room"]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[i&&x.length===0&&e.jsx("div",{className:"flex items-center justify-center h-48 text-text-tertiary text-[length:var(--font-size-sm)]",children:"Loading..."}),!i&&x.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-3 text-text-tertiary",children:[e.jsx(k,{size:40,strokeWidth:1.2,className:"opacity-30"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)]",children:"No meeting rooms yet"}),e.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[12px] font-medium bg-accent-blue text-white hover:opacity-90 transition-opacity",children:[e.jsx(f,{size:14}),"Create your first room"]})]}),x.length>0&&e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))"},children:x.map(s=>e.jsx(M,{room:s,onClick:()=>t(`/meeting-room/${s.sessionId}`),onDelete:d},s.sessionId))})]}),e.jsx(P,{open:l,onOpenChange:n})]})}export{W as RoomsPage};
1
+ import{j as e,an as g,M as b,l as h,r as c,s as v,R as y,P as j,O as N,f as w,T as C,h as p,i as m,ao as u,a4 as f,ap as k}from"./index-DQIlX2w_.js";import{T as z}from"./trash-2-CVh9mnRj.js";import{U as R}from"./users-Da9zGME5.js";import{C as D}from"./chevron-right-SmErd_1F.js";const S={active:"#3D9B6F",paused:"#C99B2D",destroyed:"#D05454"};function L({status:t}){const a=S[t]??"#A09D97";return e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${a}18`,color:a},children:[t==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:a}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:a}})]}),t.charAt(0).toUpperCase()+t.slice(1)]})}function M({room:t,onClick:a,onDelete:i}){const o=Date.now()-new Date(t.createdAt).getTime(),r=Math.floor(o/6e4),l=r<60?`${r}m`:`${Math.floor(r/60)}h ${r%60}m`;return e.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&a()},className:"group w-full text-left bg-bg-card border border-border rounded-xl p-3.5 hover:border-accent-blue hover:shadow-[0_2px_12px_rgba(0,0,0,0.06)] transition-all duration-150 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[11px] font-bold text-white shrink-0 bg-[#4A90D9]",children:"MR"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:t.sessionId})}),e.jsx(L,{status:t.status}),i&&e.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),i(t.sessionId)},className:"w-6 h-6 rounded-md flex items-center justify-center text-text-placeholder opacity-0 group-hover:opacity-100 hover:!text-status-failed hover:bg-[rgba(196,101,85,0.1)] transition-all shrink-0",title:"Delete room",children:e.jsx(z,{size:13,strokeWidth:2})})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-tertiary",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(R,{size:11}),t.agentCount," agents"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(g,{size:11}),t.taskCount," tasks"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(b,{size:11}),t.messageCount," msgs"]}),e.jsx("span",{className:"ml-auto text-text-placeholder",children:l}),e.jsx(D,{size:14,className:"text-text-placeholder group-hover:text-text-primary transition-colors"})]})]})}const T=m("w-full px-[var(--spacing-3)] py-[var(--spacing-2)]","rounded-[var(--radius-default)] border border-border","bg-bg-secondary text-text-primary","text-[length:var(--font-size-sm)]","focus:outline-none focus:shadow-[var(--shadow-focus-ring)]","transition-shadow duration-[var(--duration-fast)]"),$="block text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-secondary mb-[var(--spacing-1)]";function I(t){return t.toLowerCase().replace(/[^a-z0-9\u4e00-\u9fff]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function P({open:t,onOpenChange:a}){const i=h(),[o,r]=c.useState("");c.useEffect(()=>{t||r("")},[t]);const l=I(o)||`room-${Date.now().toString(36)}`,n=c.useCallback(()=>{o.trim()&&(v({action:"room:create",sessionId:l}),a(!1),i(`/meeting-room/${l}`))},[o,l,a,i]);return e.jsx(y,{open:t,onOpenChange:a,children:e.jsxs(j,{children:[e.jsx(N,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(w,{className:m("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[440px] max-w-[95vw]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-6)] py-[var(--spacing-4)] border-b border-border shrink-0",children:[e.jsx(C,{className:"text-[length:var(--font-size-lg)] font-[var(--font-weight-semibold)] text-text-primary",children:"New Meeting Room"}),e.jsx(p,{className:m("w-8 h-8 flex items-center justify-center rounded-[var(--radius-sm)]","text-text-secondary hover:text-text-primary hover:bg-bg-hover","transition-colors duration-[var(--duration-fast)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]"),"aria-label":"Close",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:"p-[var(--spacing-6)] space-y-[var(--spacing-4)]",children:e.jsxs("div",{children:[e.jsx("label",{htmlFor:"room-name",className:$,children:"Room Name"}),e.jsx("input",{id:"room-name",type:"text",value:o,onChange:d=>r(d.target.value),onKeyDown:d=>{d.key==="Enter"&&n()},placeholder:"e.g. Architecture Review",className:T,autoFocus:!0}),e.jsxs("p",{className:"mt-1 text-[10px] text-text-placeholder font-mono",children:["ID: ",l]})]})}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-[var(--spacing-6)] py-[var(--spacing-4)] border-t border-border",children:[e.jsx(p,{className:m("px-3 py-1.5 rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] text-text-secondary","hover:bg-bg-hover transition-colors"),children:"Cancel"}),e.jsx("button",{type:"button",onClick:n,disabled:!o.trim(),className:m("px-4 py-1.5 rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)]","bg-accent-blue text-white","hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed","transition-opacity"),children:"Create"})]})]})]})})}function W(){const t=h(),a=u(s=>s.rooms),i=u(s=>s.loading),o=u(s=>s.fetchRooms),r=u(s=>s.deleteRoom),[l,n]=c.useState(!1);c.useEffect(()=>{o()},[o]);const d=c.useCallback(async s=>{await r(s)},[r]),x=a.filter(s=>s.status!=="destroyed");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-3 px-3 py-3 border-b border-border-divider bg-bg-secondary shrink-0",children:[e.jsx("h1",{className:"text-[length:var(--font-size-base)] font-semibold text-text-primary",children:"Meeting Rooms"}),e.jsx("span",{className:"text-[11px] text-text-tertiary bg-bg-hover px-1.5 py-0.5 rounded-full",children:x.length}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[12px] font-medium bg-accent-blue text-white hover:opacity-90 transition-opacity",children:[e.jsx(f,{size:14}),"New Room"]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[i&&x.length===0&&e.jsx("div",{className:"flex items-center justify-center h-48 text-text-tertiary text-[length:var(--font-size-sm)]",children:"Loading..."}),!i&&x.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-3 text-text-tertiary",children:[e.jsx(k,{size:40,strokeWidth:1.2,className:"opacity-30"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)]",children:"No meeting rooms yet"}),e.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[12px] font-medium bg-accent-blue text-white hover:opacity-90 transition-opacity",children:[e.jsx(f,{size:14}),"Create your first room"]})]}),x.length>0&&e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))"},children:x.map(s=>e.jsx(M,{room:s,onClick:()=>t(`/meeting-room/${s.sessionId}`),onDelete:d},s.sessionId))})]}),e.jsx(P,{open:l,onOpenChange:n})]})}export{W as RoomsPage};
@@ -1,4 +1,4 @@
1
- import{d as S,o as se,a7 as F,r as p,j as e,a4 as H,a8 as ie,F as U,a9 as le,X as ce,R as de,P as xe,O as pe,f as be,T as ue,h as O,i as A,V as me}from"./index-DpcPd-UG.js";import{u as ge}from"./shallow-r7YynQYA.js";import{C as ye}from"./columns-3-BeMAQCix.js";import{L as fe}from"./list-BMv8pIQn.js";import{S as he}from"./search-pe7pU1YN.js";import{C as Y}from"./circle-DYT-zoRZ.js";import{m as z}from"./proxy-DOffTzwA.js";import{C as ve}from"./circle-alert-Bfbv3gt4.js";import{T as J}from"./trash-2-Xen46iNQ.js";import{P as X}from"./pen-line-DO6o4xWz.js";import{C as we}from"./check-jcgYBWVR.js";/**
1
+ import{d as S,o as se,a7 as F,r as p,j as e,a4 as H,a8 as ie,F as U,a9 as le,X as ce,R as de,P as xe,O as pe,f as be,T as ue,h as O,i as A,V as me}from"./index-DQIlX2w_.js";import{u as ge}from"./shallow-CJEesgtu.js";import{C as ye}from"./columns-3-Ch5KIyRa.js";import{L as fe}from"./list-CI-XIPZh.js";import{S as he}from"./search-b78eLlw2.js";import{C as Y}from"./circle-CjpslL_D.js";import{m as z}from"./proxy-CcYyZZWI.js";import{C as ve}from"./circle-alert-CuzAg2fd.js";import{T as J}from"./trash-2-CVh9mnRj.js";import{P as X}from"./pen-line-CR8GaHt-.js";import{C as we}from"./check-Bs8PM0tQ.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as c,j as e,p as se,a8 as re,M as ae,aa as g,X as M,ab as Q,ac as Y,F as R,k as U,s as ne,V as ie,n as oe}from"./index-DpcPd-UG.js";import{L as le}from"./list-BMv8pIQn.js";import{S as ce}from"./search-pe7pU1YN.js";import{C as de}from"./chevron-right-DvZ5sMOg.js";import{T as xe}from"./trash-2-Xen46iNQ.js";import{P as B,T as I,R as pe,A as q,S as me}from"./team-types-C_HqX2p2.js";import{A as J}from"./arrow-left-DYvgSdIH.js";import{U as W}from"./users-BLueDPxF.js";import{L as ue}from"./loader-DdM4VOgF.js";import{u as he,f as fe,L as H,m as T}from"./proxy-DOffTzwA.js";import{A as O}from"./index-BxR_3IbJ.js";const be=t=>!t.isLayoutDirty&&t.willUpdate(!1);function G(){const t=new Set,s=new WeakMap,r=()=>t.forEach(be);return{add:i=>{t.add(i),s.set(i,i.addEventListener("willUpdate",r))},remove:i=>{t.delete(i);const a=s.get(i);a&&(a(),s.delete(i)),r()},dirty:r}}const ge=c.createContext(null);function ye(){const t=c.useRef(!1);return he(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function ve(){const t=ye(),[s,r]=c.useState(0),i=c.useCallback(()=>{t.current&&r(s+1)},[s]);return[c.useCallback(()=>fe.postRender(i),[i]),s]}const Z=t=>t===!0,je=t=>Z(t===!0)||t==="id",Ne=({children:t,id:s,inherit:r=!0})=>{const i=c.useContext(H),a=c.useContext(ge),[f,h]=ve(),x=c.useRef(null),m=i.id||a;x.current===null&&(je(r)&&m&&(s=s?m+"-"+s:m),x.current={id:s,group:Z(r)&&i.group||G()});const u=c.useMemo(()=>({...x.current,forceRender:f}),[h]);return e.jsx(H.Provider,{value:u,children:t})},we={Coordinate:"#4A90D9",Lifecycle:"#8B6BBF",QA:"#3D9B6F",Review:"#D4832E",Testing:"#3BA0B5","Frontend Debug":"#D05454","Perf Opt":"#C99B2D","Tech Debt":"#A09D97","Plan & Execute":"#4A90D9",Brainstorm:"#8B6BBF","Roadmap Dev":"#3D9B6F",Issue:"#D05454","Iter Dev":"#D4832E","Ultra Analyze":"#C99B2D","UX Improve":"#3BA0B5","UI Design":"#8B6BBF","Arch Opt":"#4A90D9",Team:"#A09D97"},ke={Coordinate:"TC",Lifecycle:"LV",QA:"QA",Review:"RV",Testing:"TST","Frontend Debug":"FD","Perf Opt":"PO","Tech Debt":"TD","Plan & Execute":"PX",Brainstorm:"BS","Roadmap Dev":"RD",Issue:"IS","Iter Dev":"ID","Ultra Analyze":"UA","UX Improve":"UX","UI Design":"UI","Arch Opt":"AO",Team:"TM"},X=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function Se({status:t}){const s=I[t];return e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${s}18`,color:s},children:[t==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:s}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:s}})]}),t.charAt(0).toUpperCase()+t.slice(1)]})}function Ce({session:t,onClick:s,onDelete:r}){const i=we[t.skill]??"#A09D97",a=ke[t.skill]??"TM";return e.jsxs("button",{type:"button",onClick:s,className:"group w-full text-left bg-bg-card border border-border rounded-xl p-3.5 hover:border-accent-blue hover:shadow-[0_2px_12px_rgba(0,0,0,0.06)] transition-all duration-150 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[11px] font-bold text-white shrink-0",style:{backgroundColor:i},children:a}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder truncate",children:t.sessionId})]}),e.jsx(Se,{status:t.status}),r&&e.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),r(t.sessionId)},className:"w-6 h-6 rounded-md flex items-center justify-center text-text-placeholder opacity-0 group-hover:opacity-100 hover:!text-status-failed hover:bg-[rgba(196,101,85,0.1)] transition-all shrink-0",title:"Delete session",children:e.jsx(xe,{size:13,strokeWidth:2})})]}),t.description&&e.jsx("p",{className:"text-[11px] text-text-secondary leading-relaxed mb-2.5 line-clamp-2",children:t.description}),t.pipelineStages.length>0&&e.jsx("div",{className:"flex gap-1 mb-2.5",children:t.pipelineStages.map(f=>e.jsx("div",{className:"w-2 h-2 rounded-full",title:`${f.name}: ${f.status}`,style:{backgroundColor:B[f.status]}},f.id))}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-tertiary mb-2.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(se,{size:11,strokeWidth:2}),t.taskProgress.completed,"/",t.taskProgress.total," tasks"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(re,{size:11,strokeWidth:2}),t.duration||"--"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(ae,{size:11,strokeWidth:2}),t.messageCount," msgs"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 pt-2 border-t border-border-divider",children:[e.jsxs("div",{className:"flex gap-0.5",children:[t.roles.slice(0,4).map((f,h)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:f,style:{backgroundColor:X[h%X.length]},children:f.charAt(0).toUpperCase()},f)),t.roles.length>4&&e.jsxs("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-semibold text-text-tertiary bg-bg-hover",children:["+",t.roles.length-4]})]}),e.jsx("div",{className:"flex-1"}),e.jsx(de,{size:14,className:"text-text-placeholder group-hover:text-accent-blue transition-colors"})]})]})}const Ae=["all","active","completed","failed","archived"];function Le({viewMode:t}){const s=g(n=>n.sessions),r=g(n=>n.filteredSessions),i=g(n=>n.statusFilter),a=g(n=>n.skillFilter),f=g(n=>n.searchQuery),h=g(n=>n.setStatusFilter),x=g(n=>n.setSkillFilter),m=g(n=>n.setSearchQuery),u=g(n=>n.fetchSessionDetail),o=g(n=>n.deleteSession),b=r(),w=c.useMemo(()=>{const n=s.filter(C=>C.status==="active").length,p=s.filter(C=>C.status==="completed").length,j=s.reduce((C,E)=>C+E.roles.length,0);return{total:s.length,active:n,completed:p,totalRoles:j}},[s]),k=c.useMemo(()=>{const n=new Set(s.map(p=>p.skill));return Array.from(n).sort()},[s]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 border-b border-border shrink-0",children:[e.jsx("span",{className:"text-[14px] font-semibold text-text-primary",children:"Sessions"}),e.jsx("span",{className:"text-[11px] font-medium text-text-tertiary bg-bg-hover px-1.5 py-0.5 rounded-full",children:b.length}),e.jsxs("div",{className:"relative ml-2",children:[e.jsx(ce,{size:13,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-placeholder"}),e.jsx("input",{type:"text",placeholder:"Search sessions...",value:f,onChange:n=>m(n.target.value),className:"pl-7 pr-2.5 py-1 rounded-lg border border-border bg-bg-secondary text-[12px] text-text-primary placeholder:text-text-placeholder w-48 focus:outline-none focus:border-accent-blue transition-colors"})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex gap-1",children:Ae.map(n=>e.jsx("button",{type:"button",onClick:()=>h(n),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",i===n?"bg-text-primary text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:n==="all"?"All":n.charAt(0).toUpperCase()+n.slice(1)},n))}),k.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-border-divider"}),e.jsx("div",{className:"flex gap-1",children:k.map(n=>e.jsx("button",{type:"button",onClick:()=>x(a===n?null:n),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",a===n?"bg-accent-blue text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:n},n))})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3 mb-4",children:[e.jsx(F,{label:"Total Sessions",value:w.total,sub:`across ${k.length} skill types`}),e.jsx(F,{label:"Active",value:w.active,color:I.active,sub:"running now"}),e.jsx(F,{label:"Completed",value:w.completed,color:I.completed,sub:"finished"}),e.jsx(F,{label:"Total Roles",value:w.totalRoles,sub:`avg ${w.total?(w.totalRoles/w.total).toFixed(1):0} per session`})]}),b.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-text-tertiary",children:[e.jsx("span",{className:"text-[14px] font-medium mb-1",children:"No sessions found"}),e.jsx("span",{className:"text-[12px]",children:s.length===0?"Run a team skill to see sessions here":"Try adjusting your filters"})]}),t==="cards"&&b.length>0&&e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:b.map(n=>e.jsx(Ce,{session:n,onClick:()=>void u(n.sessionId),onDelete:p=>void o(p)},n.sessionId))}),t==="table"&&b.length>0&&e.jsx(De,{sessions:b,onSelect:n=>void u(n)})]})]})}function F({label:t,value:s,color:r,sub:i}){return e.jsxs("div",{className:"bg-bg-card rounded-xl border border-border px-4 py-3",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:t}),e.jsx("div",{className:"text-[22px] font-bold",style:{color:r??"var(--color-text-primary)"},children:s}),e.jsx("div",{className:"text-[11px] text-text-tertiary mt-0.5",children:i})]})}const V=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function De({sessions:t,onSelect:s}){return e.jsx("div",{className:"bg-bg-card rounded-xl border border-border overflow-hidden",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Session"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Status"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Progress"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Roles"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Duration"}),e.jsx("th",{className:"w-8 bg-bg-secondary border-b border-border sticky top-0 z-[5]"})]})}),e.jsx("tbody",{children:t.map(r=>{const i=r.taskProgress.total?Math.round(r.taskProgress.completed/r.taskProgress.total*100):0,a=I[r.status];return e.jsxs("tr",{onClick:()=>s(r.sessionId),className:"cursor-pointer hover:bg-bg-hover transition-colors group",children:[e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("div",{className:"flex items-center gap-2.5 min-w-[240px]",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:r.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder",children:r.sessionId})]})})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${a}18`,color:a},children:r.status})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-[120px]",children:[e.jsx("div",{className:"flex-1 h-[5px] bg-bg-hover rounded-full overflow-hidden min-w-[60px]",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${i}%`,backgroundColor:a}})}),e.jsxs("span",{className:"text-[11px] font-semibold text-text-tertiary whitespace-nowrap min-w-[36px]",children:[r.taskProgress.completed,"/",r.taskProgress.total]})]})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("div",{className:"flex gap-0.5",children:r.roles.slice(0,5).map((f,h)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:f,style:{backgroundColor:V[h%V.length]},children:f.charAt(0).toUpperCase()},f))})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.duration||"--"})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider text-center",children:e.jsx("span",{className:"text-[14px] text-text-placeholder group-hover:text-accent-blue transition-colors",children:"→"})})]},r.sessionId)})})]})})}function ee({session:t,open:s,onClose:r}){const i=c.useCallback(a=>{a.target===a.currentTarget&&r()},[r]);return e.jsx(e.Fragment,{children:e.jsx("div",{className:["absolute inset-0 z-40 bg-black/[.18] backdrop-blur-[2px] transition-opacity duration-200",s?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"].join(" "),onClick:i,children:e.jsxs("div",{className:["absolute top-0 left-0 right-0 z-50 bg-bg-card border-b border-border","rounded-b-[14px] shadow-[0_12px_40px_rgba(0,0,0,0.12)]","transition-transform duration-[280ms] ease-[cubic-bezier(0.34,1.56,0.64,1)]","max-h-[68vh] overflow-hidden flex flex-col",s?"translate-y-0":"-translate-y-full"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-divider shrink-0",children:[e.jsx("h3",{className:"text-[14px] font-bold text-text-primary",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:r,className:"w-[26px] h-[26px] rounded-[7px] flex items-center justify-center text-text-tertiary hover:bg-bg-hover hover:text-text-primary transition-all",children:e.jsx(M,{size:14})})]}),e.jsxs("div",{className:"grid grid-cols-3 flex-1 overflow-auto",children:[e.jsxs("div",{className:"p-3.5",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Pipeline",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.pipelineStages.length})]}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx(_,{label:"Done",value:t.pipelineStages.filter(a=>a.status==="done").length}),e.jsx(_,{label:"Active",value:t.pipelineStages.filter(a=>a.status==="in_progress").length}),e.jsx(_,{label:"Pending",value:t.pipelineStages.filter(a=>a.status==="pending").length})]}),t.pipeline.waves.length>0?e.jsx(Te,{waves:t.pipeline.waves}):e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:t.pipelineStages.map(a=>e.jsx(Be,{node:a},a.id))})]}),e.jsxs("div",{className:"p-3.5 border-l border-border-divider",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Roles",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.roleDetails.length})]}),e.jsxs("div",{className:"flex flex-col",children:[t.roleDetails.map(a=>e.jsx(Ie,{role:a},a.name)),t.roleDetails.length===0&&e.jsx("span",{className:"text-[11px] text-text-tertiary italic",children:"No roles data"})]})]}),e.jsxs("div",{className:"p-3.5 border-l border-border-divider",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Messages",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.messages.length})]}),e.jsxs("div",{className:"flex flex-col max-h-[50vh] overflow-y-auto",children:[t.messages.slice(-20).map(a=>e.jsx(Re,{message:a},a.id)),t.messages.length===0&&e.jsx("span",{className:"text-[11px] text-text-tertiary italic",children:"No messages"})]})]})]}),e.jsx("div",{className:"flex justify-center py-1.5 border-t border-border-divider cursor-pointer hover:bg-bg-hover",children:e.jsx("div",{className:"w-10 h-1 rounded-full bg-text-placeholder"})})]})})})}const N={nodeW:100,nodeH:26,rowGap:6,padX:12,padY:8,arrowLen:36};function Te({waves:t}){const s=c.useMemo(()=>{const x=[...t].sort((n,p)=>n.number-p.number),m=new Map,u=[];let o=N.padX;for(const n of x){u.push(o);let p=N.padY;for(const j of n.nodes)m.set(j.id,{x:o,y:p,wave:n.number}),p+=N.nodeH+N.rowGap;o+=N.nodeW+N.arrowLen}const b=Math.max(...x.map(n=>n.nodes.length),1),w=x.length*(N.nodeW+N.arrowLen)-N.arrowLen+N.padX*2,k=b*(N.nodeH+N.rowGap)-N.rowGap+N.padY*2;return{sorted:x,positions:m,waveXPositions:u,svgW:w,svgH:k}},[t]),{sorted:r,positions:i,waveXPositions:a,svgW:f,svgH:h}=s;return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("svg",{width:f,height:h,viewBox:`0 0 ${f} ${h}`,className:"block",children:[e.jsx("defs",{children:e.jsx("marker",{id:"dag-arrow",markerWidth:"6",markerHeight:"4",refX:"5",refY:"2",orient:"auto",children:e.jsx("path",{d:"M0,0 L6,2 L0,4",fill:"var(--color-text-placeholder)"})})}),r.map((x,m)=>{if(m===0)return null;const u=r[m-1],o=a[m-1],b=a[m],w=[];for(const k of u.nodes){const n=i.get(k.id),p=o+N.nodeW,j=n.y+N.nodeH/2;for(const C of x.nodes){const E=i.get(C.id),D=b,L=E.y+N.nodeH/2;w.push(e.jsx("line",{x1:p+2,y1:j,x2:D-2,y2:L,stroke:"var(--color-text-placeholder)",strokeWidth:"1",strokeOpacity:"0.4",markerEnd:"url(#dag-arrow)"},`${k.id}-${C.id}`))}}return e.jsx("g",{children:w},`arrows-${x.number}`)}),r.map(x=>x.nodes.map(m=>{const u=i.get(m.id),o=B[m.status];return e.jsxs("g",{children:[e.jsx("rect",{x:u.x,y:u.y,width:N.nodeW,height:N.nodeH,rx:6,fill:"var(--color-bg-hover)",stroke:o,strokeWidth:m.status==="in_progress"?1.5:.5,strokeOpacity:m.status==="in_progress"?1:.4}),e.jsx("circle",{cx:u.x+10,cy:u.y+N.nodeH/2,r:3,fill:o}),e.jsx("text",{x:u.x+18,y:u.y+N.nodeH/2,dominantBaseline:"central",fill:"var(--color-text-primary)",fontSize:"9",fontWeight:"600",fontFamily:"inherit",children:Ee(m.name,10)})]},m.id)})),r.map((x,m)=>e.jsxs("text",{x:a[m]+N.nodeW/2,y:h-1,textAnchor:"middle",fill:"var(--color-text-placeholder)",fontSize:"8",fontWeight:"600",children:["W",x.number]},`wave-label-${x.number}`))]})})}function Ee(t,s){return t.length<=s?t:t.slice(0,s-1)+"…"}function _({label:t,value:s}){return e.jsxs("div",{className:"flex-1 text-center p-1.5 bg-bg-hover rounded-lg",children:[e.jsx("div",{className:"text-[16px] font-bold text-text-primary",children:s}),e.jsx("div",{className:"text-[9px] font-semibold uppercase text-text-tertiary",children:t})]})}function Be({node:t}){const s=B[t.status];return e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg border border-border text-[10px] mb-1 hover:border-accent-blue transition-colors",children:[e.jsx("span",{className:"w-[7px] h-[7px] rounded-full",style:{backgroundColor:s}}),e.jsx("span",{className:"font-semibold text-text-primary",children:t.name})]})}function Ie({role:t}){const s=pe[t.status];return e.jsxs("div",{className:"flex items-center gap-2 py-1.5 border-b border-border-divider last:border-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[10px] font-bold text-white shrink-0",style:{backgroundColor:s},children:t.prefix||t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[12px] font-semibold text-text-primary truncate",children:t.name}),e.jsxs("div",{className:"text-[10px] text-text-tertiary",children:[t.taskCount," task",t.taskCount!==1?"s":""]})]}),e.jsxs("div",{className:"flex gap-1 shrink-0",children:[e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${s}18`,color:s},children:t.status}),t.injected&&e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full bg-[#8B6BBF18] text-[#8B6BBF]",children:"injected"})]})]})}function Re({message:t}){const r={message:"#4A90D9",state_update:"#3D9B6F",task_complete:"#5A9E78",error:"#D05454",broadcast:"#8B6BBF",shutdown:"#A09D97"}[t.type]??"#A09D97";return e.jsxs("div",{className:"flex gap-2 py-1.5 border-b border-border-divider last:border-0 text-[11px] items-start",children:[e.jsx("div",{className:"w-[22px] h-[22px] rounded-md flex items-center justify-center text-[10px] shrink-0 mt-0.5",style:{background:`${r}18`,color:r},children:t.from.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-primary",children:t.from}),e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${r}18`,color:r},children:t.type}),e.jsx("span",{className:"text-[9px] font-mono text-text-placeholder ml-auto",children:t.ts.substring(11,19)})]}),e.jsx("div",{className:"text-[11px] text-text-secondary truncate mt-0.5",children:t.summary})]})]})}function Oe(){const t=g(l=>l.activeSession),s=g(l=>l.activeSessionId),r=g(l=>l.loading),i=g(l=>l.clearActiveSession),[a,f]=c.useState(!1),[h,x]=c.useState(null),[m,u]=c.useState(""),[o,b]=c.useState(!1),[w,k]=c.useState([]),[n,p]=c.useState(new Set);c.useEffect(()=>{function l(y){y.key==="Escape"&&(a?f(!1):i())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i,a]);const j=c.useCallback(async l=>{if(s){x(l),b(!0),k(y=>y.some(v=>v.id===l.id)?y:[...y,l]);try{const y=`${Q.SESSIONS}/${s}/files/${encodeURIComponent(l.path)}`,v=await fetch(y);if(!v.ok)throw new Error(`Failed: ${v.status}`);if((v.headers.get("content-type")??"").includes("json")){const S=await v.json();u(JSON.stringify(S,null,2))}else u(await v.text())}catch{u("// Failed to load file content")}b(!1)}},[s]),C=c.useCallback(l=>{k(y=>{const v=y.filter(d=>d.id!==l);return(h==null?void 0:h.id)===l&&(v.length>0?j(v[v.length-1]):(x(null),u(""))),v})},[h,j]),E=c.useCallback(l=>{p(y=>{const v=new Set(y);return v.has(l)?v.delete(l):v.add(l),v})},[]);if(r||!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading session..."});const D=I[t.status],L=new Map;for(const l of t.files){const y=l.category;L.has(y)||L.set(y,[]),L.get(y).push(l)}const z={artifacts:"Artifacts","role-specs":"Role Specs",session:"Session",wisdom:"Wisdom","message-bus":"Message Bus"};return e.jsxs("div",{className:"-m-[var(--spacing-4)] max-sm:-m-[var(--spacing-2)] flex flex-col h-[calc(100%+var(--spacing-4)*2)] max-sm:h-[calc(100%+var(--spacing-2)*2)] overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2 border-b border-border shrink-0 bg-bg-secondary",children:[e.jsx("button",{type:"button",onClick:i,className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-all",title:"Back to sessions",children:e.jsx(J,{size:15,strokeWidth:2})}),e.jsx("span",{className:"text-[14px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${D}18`,color:D},children:[t.status==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:D}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:D}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>f(!0),className:"ml-2 px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(W,{size:12}),"Team Status"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("aside",{className:"w-[240px] border-r border-border bg-bg-secondary flex flex-col shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-primary",children:"Session Explorer"}),e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${D}18`,color:D},children:t.status})]}),e.jsxs("div",{className:"px-3 py-2 border-b border-border-divider",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2",children:"Pipeline DAG"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.pipelineStages.map((l,y)=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:B[l.status]}}),e.jsx("span",{className:["text-[10px] flex-1 truncate",l.status==="in_progress"?"font-semibold text-text-primary":"text-text-secondary",l.status==="pending"?"opacity-50":""].join(" "),children:l.name}),e.jsx("span",{className:"text-[8px] font-semibold px-1 rounded-full",style:{background:`${B[l.status]}18`,color:B[l.status]},children:l.status==="done"?"Done":l.status==="in_progress"?"Run":"Wait"})]}),y<t.pipelineStages.length-1&&e.jsx("div",{className:"w-px h-2 bg-border-divider ml-[3.5px]"})]},l.id)),t.pipelineStages.length===0&&e.jsx("span",{className:"text-[10px] text-text-tertiary italic",children:"No pipeline data"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[Array.from(L.entries()).map(([l,y])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>E(l),className:"flex items-center gap-1 px-1.5 py-1 w-full text-left text-[9px] font-semibold uppercase tracking-widest text-text-placeholder hover:text-text-primary transition-colors",children:[e.jsx(Y,{size:10,className:["transition-transform",n.has(l)?"-rotate-90":""].join(" ")}),z[l]??l,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:y.length})]}),!n.has(l)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(v=>e.jsxs("button",{type:"button",onClick:()=>void j(v),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(h==null?void 0:h.id)===v.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(R,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:v.name})]},v.id))})]},l)),t.files.length===0&&e.jsx("div",{className:"px-3 py-4 text-[11px] text-text-tertiary italic text-center",children:"No files found"})]})]}),e.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden bg-bg-primary",children:[w.length>0&&e.jsx("div",{className:"flex items-center border-b border-border bg-bg-secondary shrink-0 overflow-x-auto",children:w.map(l=>e.jsxs("div",{className:["flex items-center gap-1.5 px-3 py-1.5 text-[11px] cursor-pointer border-r border-border-divider shrink-0",(h==null?void 0:h.id)===l.id?"bg-bg-primary text-text-primary font-medium":"text-text-tertiary hover:text-text-secondary hover:bg-bg-hover"].join(" "),children:[e.jsx("button",{type:"button",onClick:()=>void j(l),className:"truncate max-w-[140px]",children:l.name}),e.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),C(l.id)},className:"w-4 h-4 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:10})})]},l.id))}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[o&&e.jsx("div",{className:"text-[12px] text-text-tertiary",children:"Loading file..."}),!o&&!h&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(R,{size:32,className:"opacity-30"}),e.jsx("span",{className:"text-[13px] font-medium",children:"Select a file to view"}),e.jsx("span",{className:"text-[11px]",children:"Choose from the sidebar or click Team Status for an overview"})]}),!o&&h&&e.jsx("div",{className:"font-mono text-[12px] leading-relaxed text-text-primary whitespace-pre-wrap break-words",children:m})]})]})]}),e.jsx(ee,{session:t,open:a,onClose:()=>f(!1)})]})}function ze(){const[t,s]=c.useState(!1);return c.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)");s(r.matches);const i=a=>s(a.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),t}const Fe={idle:"Idle",active:"Active",busy:"Busy",error:"Error",offline:"Offline"},$e=new Set(["active","busy"]);function Pe({status:t,role:s}){const r=ze(),i=q[t],a=$e.has(t);return e.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[e.jsxs(T.div,{className:"relative flex items-center justify-center w-[14px] h-[14px]",animate:a&&!r?{scale:[1,1.05,1],opacity:[1,.85,1]}:{scale:1,opacity:1},transition:r?{duration:0}:{duration:2,repeat:1/0,ease:"easeInOut"},children:[a&&!r&&e.jsx("div",{className:"absolute inset-0 rounded-full",style:{backgroundColor:`${i}20`,boxShadow:`0 0 6px ${i}30`}}),e.jsx("div",{className:a&&!r?"pulse-dot":void 0,style:{width:7,height:7,borderRadius:"50%",backgroundColor:i,animation:a&&!r?"pulse-dot 1.5s ease-in-out infinite":"none",willChange:a?"transform, opacity":"auto"}})]}),e.jsxs("div",{className:"flex items-center gap-1 overflow-hidden",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-primary",children:s}),e.jsx(O,{mode:"wait",children:e.jsx(T.span,{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full whitespace-nowrap",style:{background:`${i}18`,color:i},initial:r?!1:{opacity:0,y:6,scale:.9},animate:{opacity:1,y:0,scale:1},exit:r?void 0:{opacity:0,y:-6,scale:.9},transition:r?{duration:0}:{duration:.2,ease:"easeOut"},children:Fe[t]},t)})]})]})}function Me(t){switch(t.type){case"user_message":return{text:t.content,kind:"user"};case"assistant_message":return t.content?{text:t.content,kind:"assistant"}:null;case"thinking":return{text:t.content,kind:"system"};case"error":return{text:t.message,kind:"system"};case"tool_use":return{text:`${t.name}(${JSON.stringify(t.input).slice(0,60)})`,kind:"system"};case"file_change":return{text:`[${t.action}] ${t.path}`,kind:"system"};case"command_exec":return{text:`$ ${t.command}`,kind:"system"};case"status_change":return{text:`Status: ${t.status}`,kind:"system"};default:return null}}function _e(t){const s=new Date(t);return isNaN(s.getTime())?"":s.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function We({role:t,sessionId:s,status:r}){const[i,a]=c.useState(""),f=c.useRef(null),h=c.useRef(null),x=g(p=>p.getProcessIdForRole(s,t)),m=U(p=>x?p.entries[x]??[]:[]),u=U(p=>x?p.processStreaming[x]??!1:!1),o=c.useMemo(()=>{const p=[];for(const j of m){const C=Me(j);C&&p.push({entry:j,display:C})}return p},[m]);c.useEffect(()=>{const p=f.current;p&&(p.scrollTop=p.scrollHeight)},[o.length]);const b=c.useCallback(()=>{var j;const p=i.trim();p&&(ne({action:"team:message",sessionId:s,to:t,content:p}),a(""),(j=h.current)==null||j.focus())},[i,s,t]),w=c.useCallback(p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),b()),p.key==="Escape"&&a("")},[b]),k=q[r],n=!!x;return e.jsxs("div",{className:"flex flex-col rounded-xl border bg-bg-primary overflow-hidden",style:{borderColor:`${k}40`},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider bg-bg-secondary shrink-0",children:[e.jsx(Pe,{status:r,role:t}),e.jsx("div",{className:"flex-1"}),u&&e.jsx(ue,{size:12,className:"text-text-tertiary animate-spin"})]}),e.jsxs("div",{ref:f,className:"flex-1 overflow-y-auto p-3 min-h-[160px] max-h-[400px] flex flex-col gap-1.5",children:[!n&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[11px] italic",children:"Connecting..."}),n&&o.length===0&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[11px] italic",children:"Waiting for activity..."}),e.jsx(O,{initial:!1,children:o.map(({entry:p,display:j})=>e.jsx(T.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.15,ease:"easeOut"},className:["text-[11px] leading-relaxed px-2 py-1 rounded-md max-w-[95%]",j.kind==="user"?"self-end bg-accent-muted text-text-primary":j.kind==="assistant"?"self-start bg-bg-secondary text-text-primary":"self-start bg-bg-hover text-text-tertiary font-mono text-[10px]"].join(" "),children:e.jsxs("div",{className:"flex items-start gap-1.5",children:[e.jsx("span",{className:"text-text-placeholder text-[9px] shrink-0 mt-0.5",children:_e(p.timestamp)}),e.jsx("span",{className:"break-words whitespace-pre-wrap",children:j.text})]})},p.id))})]}),e.jsxs("div",{className:"flex items-end gap-2 px-3 py-2 border-t border-border-divider bg-bg-secondary shrink-0",children:[e.jsx("textarea",{ref:h,value:i,onChange:p=>a(p.target.value),onKeyDown:w,placeholder:`Message ${t}...`,rows:1,className:"flex-1 resize-none rounded-lg border border-border bg-bg-primary px-2.5 py-1.5 text-[11px] text-text-primary placeholder:text-text-placeholder focus:outline-none focus:border-accent-muted transition-colors","aria-label":`Send message to ${t}`}),e.jsx("button",{type:"button",onClick:b,disabled:!i.trim(),className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover disabled:opacity-30 disabled:cursor-not-allowed transition-all shrink-0",title:`Send to ${t}`,"aria-label":`Send message to ${t}`,children:e.jsx(me,{size:13,strokeWidth:2})})]})]})}const $=[{key:"initialization",label:"Init"},{key:"planning",label:"Planning"},{key:"execution",label:"Execution"},{key:"review",label:"Review"},{key:"completion",label:"Complete"}],P={initialization:"#4A90D9",planning:"#8B6BBF",execution:"#B89540",review:"#3D9B6F",completion:"#5A9E78"};function Ue(){const[t,s]=c.useState(!1);return c.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)");s(r.matches);const i=a=>s(a.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),t}function He(){const t=g(x=>x.phaseState),s=Ue(),r=(t==null?void 0:t.current)??null,i=(t==null?void 0:t.fixAttempts)??0,a=3,f=r?$.findIndex(x=>x.key===r):-1,h=s?0:.3;return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-1",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder",children:"Phase"}),r&&e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${P[r]}18`,color:P[r]},children:r})]}),e.jsx(Ne,{children:e.jsx("div",{className:"flex items-center px-4 py-2",children:$.map((x,m)=>{const u=x.key===r,o=f>m,b=P[x.key];return e.jsxs("div",{className:"flex items-center",children:[e.jsxs(T.div,{layout:!0,className:"flex flex-col items-center gap-1",transition:{duration:h,ease:"easeOut"},children:[e.jsxs(T.div,{layout:!0,className:"flex items-center justify-center rounded-full",style:{backgroundColor:o||u?b:"var(--color-bg-hover)",...u?{boxShadow:`0 0 0 2px var(--color-bg-primary), 0 0 0 4px ${b}, 0 0 12px ${b}40`}:{}},animate:{width:u?28:20,height:u?28:20},transition:{duration:h,ease:"easeOut"},children:[o&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),u&&!s&&e.jsx(T.div,{className:"rounded-full bg-white",animate:{scale:[1,1.2,1],opacity:[1,.7,1]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{width:8,height:8}}),u&&s&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-white"})]}),e.jsx("span",{className:["text-[9px] font-semibold whitespace-nowrap transition-colors",u?"text-text-primary":o?"text-text-secondary":"text-text-placeholder"].join(" "),children:x.label}),x.key==="review"&&i>0&&e.jsxs("span",{className:"text-[7px] font-bold px-1 py-px rounded-full",style:{background:"#C4655518",color:"#C46555"},children:[i,"/",a]})]}),m<$.length-1&&e.jsxs("div",{className:"relative h-[2px] mx-1 min-w-[20px] flex-1",children:[e.jsx("div",{className:"absolute inset-0 rounded-full",style:{backgroundColor:"var(--color-bg-hover)"}}),e.jsx(T.div,{className:"absolute inset-y-0 left-0 rounded-full",initial:{width:"0%"},animate:{width:o?"100%":"0%"},transition:{duration:s?0:.5,ease:"easeOut"},style:{backgroundColor:P[$[m+1].key]}})]})]},x.key)})})})]})}function Ge(){const t=g(d=>d.activeSession),s=g(d=>d.activeSessionId),r=g(d=>d.loading),i=g(d=>d.clearActiveSession),a=g(d=>d.agentStatuses),f=g(d=>d.phaseState),[h,x]=c.useState(!1),[m,u]=c.useState(!1),[o,b]=c.useState(null),[w,k]=c.useState(""),[n,p]=c.useState(!1),[j,C]=c.useState(new Set);c.useEffect(()=>{function d(S){S.target instanceof HTMLTextAreaElement||S.target instanceof HTMLInputElement||S.key==="Escape"&&(h?x(!1):m?u(!1):i())}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[i,h,m]);const E=c.useCallback(async d=>{if(s){b(d),p(!0),u(!0);try{const S=`${Q.SESSIONS}/${s}/files/${encodeURIComponent(d.path)}`,A=await fetch(S);if(!A.ok)throw new Error(`Failed: ${A.status}`);if((A.headers.get("content-type")??"").includes("json")){const te=await A.json();k(JSON.stringify(te,null,2))}else k(await A.text())}catch{k("// Failed to load file content")}p(!1)}},[s]),D=c.useCallback(d=>{C(S=>{const A=new Set(S);return A.has(d)?A.delete(d):A.add(d),A})},[]);if(r||!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading session..."});const L=I[t.status],z=new Map;for(const d of a)z.set(d.role,d.status);const l=t.roleDetails.map(d=>d.name),y=new Map;for(const d of t.files){const S=d.category;y.has(S)||y.set(S,[]),y.get(S).push(d)}const v={artifacts:"Artifacts","role-specs":"Role Specs",session:"Session",wisdom:"Wisdom","message-bus":"Message Bus"};return e.jsxs("div",{className:"-m-[var(--spacing-4)] max-sm:-m-[var(--spacing-2)] flex flex-col h-[calc(100%+var(--spacing-4)*2)] max-sm:h-[calc(100%+var(--spacing-2)*2)] overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2 border-b border-border shrink-0 bg-bg-secondary",children:[e.jsx("button",{type:"button",onClick:i,className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-all",title:"Back to sessions",children:e.jsx(J,{size:15,strokeWidth:2})}),e.jsx("span",{className:"text-[14px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),f&&e.jsx("div",{className:"hidden sm:flex items-center gap-1.5 mr-2",children:e.jsx(He,{})}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${L}18`,color:L},children:[e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:L}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:L}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>u(d=>!d),className:"ml-1 px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(R,{size:12}),"Files"]}),e.jsxs("button",{type:"button",onClick:()=>x(!0),className:"px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(W,{size:12}),"Status"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[e.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:e.jsx(O,{children:l.map(d=>e.jsx(T.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2,ease:"easeOut"},children:e.jsx(We,{role:d,sessionId:t.sessionId,status:z.get(d)??"idle"})},d))})}),l.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(W,{size:32,className:"opacity-30"}),e.jsx("span",{className:"text-[13px] font-medium",children:"No agent roles"}),e.jsx("span",{className:"text-[11px]",children:"Waiting for agents to join the session..."})]})]}),e.jsx(O,{children:m&&e.jsxs(T.aside,{initial:{width:0,opacity:0},animate:{width:260,opacity:1},exit:{width:0,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"border-l border-border bg-bg-secondary flex flex-col shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-primary flex-1",children:"Files"}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"w-5 h-5 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:11})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[Array.from(y.entries()).map(([d,S])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>D(d),className:"flex items-center gap-1 px-1.5 py-1 w-full text-left text-[9px] font-semibold uppercase tracking-widest text-text-placeholder hover:text-text-primary transition-colors",children:[e.jsx(Y,{size:10,className:["transition-transform",j.has(d)?"-rotate-90":""].join(" ")}),v[d]??d,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:S.length})]}),!j.has(d)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:S.map(A=>e.jsxs("button",{type:"button",onClick:()=>void E(A),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(o==null?void 0:o.id)===A.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(R,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:A.name})]},A.id))})]},d)),t.files.length===0&&e.jsx("div",{className:"px-3 py-4 text-[11px] text-text-tertiary italic text-center",children:"No files found"})]}),o&&e.jsxs("div",{className:"border-t border-border-divider flex flex-col max-h-[40%]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-bg-primary shrink-0",children:[e.jsx(R,{size:11,className:"text-text-placeholder"}),e.jsx("span",{className:"text-[10px] font-medium text-text-primary truncate",children:o.name}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:()=>{b(null),k("")},className:"w-4 h-4 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:9})})]}),e.jsx("div",{className:"flex-1 overflow-auto p-2",children:n?e.jsx("div",{className:"text-[10px] text-text-tertiary",children:"Loading..."}):e.jsx("pre",{className:"font-mono text-[10px] leading-relaxed text-text-secondary whitespace-pre-wrap break-words",children:w})})]})]})})]}),e.jsx(ee,{session:t,open:h,onClose:()=>x(!1)})]})}const Xe=[{label:"Cards",icon:e.jsx(oe,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Table",icon:e.jsx(le,{size:14,strokeWidth:1.8}),shortcut:"2"}],K=["cards","table"],Ve={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function it(){const t=g(o=>o.activeView),s=g(o=>o.setActiveView),r=g(o=>o.activeSessionId),i=g(o=>o.activeSession),a=g(o=>o.fetchSessions),f=g(o=>o.loading),h=g(o=>o.error),{register:x,unregister:m}=c.useContext(ie),u=c.useCallback(o=>s(K[o]),[s]);return c.useEffect(()=>{r?m():x({items:Xe.map(o=>({label:o.label,icon:o.icon,shortcut:o.shortcut})),activeIndex:K.indexOf(t),onSwitch:u})},[t,r,x,m,u]),c.useEffect(()=>()=>m(),[m]),c.useEffect(()=>{function o(b){b.target instanceof HTMLInputElement||b.target instanceof HTMLTextAreaElement||r||(b.key==="1"?s("cards"):b.key==="2"&&s("table"))}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s,r]),c.useEffect(()=>{a()},[a]),f&&!r?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading team sessions..."}):h&&!r?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-status-failed text-[length:var(--font-size-sm)]",children:"Failed to load team sessions"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:h}),e.jsx("button",{type:"button",onClick:()=>void a(),className:"px-3 py-1 rounded-[var(--radius-md)] text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},children:"Retry"})]}):r?(i==null?void 0:i.status)==="active"?e.jsx(Ge,{}):e.jsx(Oe,{}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsx(O,{mode:"wait",children:e.jsx(T.div,{className:"flex-1 flex flex-col overflow-hidden",variants:Ve,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(Le,{viewMode:t})},t)})})}export{it as TeamsPage};
1
+ import{r as c,j as e,p as se,a8 as re,M as ae,aa as g,X as M,ab as Q,ac as Y,F as R,k as U,s as ne,V as ie,n as oe}from"./index-DQIlX2w_.js";import{L as le}from"./list-CI-XIPZh.js";import{S as ce}from"./search-b78eLlw2.js";import{C as de}from"./chevron-right-SmErd_1F.js";import{T as xe}from"./trash-2-CVh9mnRj.js";import{P as B,T as I,R as pe,A as q,S as me}from"./team-types-Se7f9LfJ.js";import{A as J}from"./arrow-left-C5ROg97G.js";import{U as W}from"./users-Da9zGME5.js";import{L as ue}from"./loader-DpdMoQvh.js";import{u as he,f as fe,L as H,m as T}from"./proxy-CcYyZZWI.js";import{A as O}from"./index-BL4h1OKY.js";const be=t=>!t.isLayoutDirty&&t.willUpdate(!1);function G(){const t=new Set,s=new WeakMap,r=()=>t.forEach(be);return{add:i=>{t.add(i),s.set(i,i.addEventListener("willUpdate",r))},remove:i=>{t.delete(i);const a=s.get(i);a&&(a(),s.delete(i)),r()},dirty:r}}const ge=c.createContext(null);function ye(){const t=c.useRef(!1);return he(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function ve(){const t=ye(),[s,r]=c.useState(0),i=c.useCallback(()=>{t.current&&r(s+1)},[s]);return[c.useCallback(()=>fe.postRender(i),[i]),s]}const Z=t=>t===!0,je=t=>Z(t===!0)||t==="id",Ne=({children:t,id:s,inherit:r=!0})=>{const i=c.useContext(H),a=c.useContext(ge),[f,h]=ve(),x=c.useRef(null),m=i.id||a;x.current===null&&(je(r)&&m&&(s=s?m+"-"+s:m),x.current={id:s,group:Z(r)&&i.group||G()});const u=c.useMemo(()=>({...x.current,forceRender:f}),[h]);return e.jsx(H.Provider,{value:u,children:t})},we={Coordinate:"#4A90D9",Lifecycle:"#8B6BBF",QA:"#3D9B6F",Review:"#D4832E",Testing:"#3BA0B5","Frontend Debug":"#D05454","Perf Opt":"#C99B2D","Tech Debt":"#A09D97","Plan & Execute":"#4A90D9",Brainstorm:"#8B6BBF","Roadmap Dev":"#3D9B6F",Issue:"#D05454","Iter Dev":"#D4832E","Ultra Analyze":"#C99B2D","UX Improve":"#3BA0B5","UI Design":"#8B6BBF","Arch Opt":"#4A90D9",Team:"#A09D97"},ke={Coordinate:"TC",Lifecycle:"LV",QA:"QA",Review:"RV",Testing:"TST","Frontend Debug":"FD","Perf Opt":"PO","Tech Debt":"TD","Plan & Execute":"PX",Brainstorm:"BS","Roadmap Dev":"RD",Issue:"IS","Iter Dev":"ID","Ultra Analyze":"UA","UX Improve":"UX","UI Design":"UI","Arch Opt":"AO",Team:"TM"},X=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function Se({status:t}){const s=I[t];return e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${s}18`,color:s},children:[t==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:s}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:s}})]}),t.charAt(0).toUpperCase()+t.slice(1)]})}function Ce({session:t,onClick:s,onDelete:r}){const i=we[t.skill]??"#A09D97",a=ke[t.skill]??"TM";return e.jsxs("button",{type:"button",onClick:s,className:"group w-full text-left bg-bg-card border border-border rounded-xl p-3.5 hover:border-accent-blue hover:shadow-[0_2px_12px_rgba(0,0,0,0.06)] transition-all duration-150 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[11px] font-bold text-white shrink-0",style:{backgroundColor:i},children:a}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder truncate",children:t.sessionId})]}),e.jsx(Se,{status:t.status}),r&&e.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),r(t.sessionId)},className:"w-6 h-6 rounded-md flex items-center justify-center text-text-placeholder opacity-0 group-hover:opacity-100 hover:!text-status-failed hover:bg-[rgba(196,101,85,0.1)] transition-all shrink-0",title:"Delete session",children:e.jsx(xe,{size:13,strokeWidth:2})})]}),t.description&&e.jsx("p",{className:"text-[11px] text-text-secondary leading-relaxed mb-2.5 line-clamp-2",children:t.description}),t.pipelineStages.length>0&&e.jsx("div",{className:"flex gap-1 mb-2.5",children:t.pipelineStages.map(f=>e.jsx("div",{className:"w-2 h-2 rounded-full",title:`${f.name}: ${f.status}`,style:{backgroundColor:B[f.status]}},f.id))}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-tertiary mb-2.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(se,{size:11,strokeWidth:2}),t.taskProgress.completed,"/",t.taskProgress.total," tasks"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(re,{size:11,strokeWidth:2}),t.duration||"--"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(ae,{size:11,strokeWidth:2}),t.messageCount," msgs"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 pt-2 border-t border-border-divider",children:[e.jsxs("div",{className:"flex gap-0.5",children:[t.roles.slice(0,4).map((f,h)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:f,style:{backgroundColor:X[h%X.length]},children:f.charAt(0).toUpperCase()},f)),t.roles.length>4&&e.jsxs("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-semibold text-text-tertiary bg-bg-hover",children:["+",t.roles.length-4]})]}),e.jsx("div",{className:"flex-1"}),e.jsx(de,{size:14,className:"text-text-placeholder group-hover:text-accent-blue transition-colors"})]})]})}const Ae=["all","active","completed","failed","archived"];function Le({viewMode:t}){const s=g(n=>n.sessions),r=g(n=>n.filteredSessions),i=g(n=>n.statusFilter),a=g(n=>n.skillFilter),f=g(n=>n.searchQuery),h=g(n=>n.setStatusFilter),x=g(n=>n.setSkillFilter),m=g(n=>n.setSearchQuery),u=g(n=>n.fetchSessionDetail),o=g(n=>n.deleteSession),b=r(),w=c.useMemo(()=>{const n=s.filter(C=>C.status==="active").length,p=s.filter(C=>C.status==="completed").length,j=s.reduce((C,E)=>C+E.roles.length,0);return{total:s.length,active:n,completed:p,totalRoles:j}},[s]),k=c.useMemo(()=>{const n=new Set(s.map(p=>p.skill));return Array.from(n).sort()},[s]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 border-b border-border shrink-0",children:[e.jsx("span",{className:"text-[14px] font-semibold text-text-primary",children:"Sessions"}),e.jsx("span",{className:"text-[11px] font-medium text-text-tertiary bg-bg-hover px-1.5 py-0.5 rounded-full",children:b.length}),e.jsxs("div",{className:"relative ml-2",children:[e.jsx(ce,{size:13,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-placeholder"}),e.jsx("input",{type:"text",placeholder:"Search sessions...",value:f,onChange:n=>m(n.target.value),className:"pl-7 pr-2.5 py-1 rounded-lg border border-border bg-bg-secondary text-[12px] text-text-primary placeholder:text-text-placeholder w-48 focus:outline-none focus:border-accent-blue transition-colors"})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex gap-1",children:Ae.map(n=>e.jsx("button",{type:"button",onClick:()=>h(n),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",i===n?"bg-text-primary text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:n==="all"?"All":n.charAt(0).toUpperCase()+n.slice(1)},n))}),k.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-border-divider"}),e.jsx("div",{className:"flex gap-1",children:k.map(n=>e.jsx("button",{type:"button",onClick:()=>x(a===n?null:n),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",a===n?"bg-accent-blue text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:n},n))})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3 mb-4",children:[e.jsx(F,{label:"Total Sessions",value:w.total,sub:`across ${k.length} skill types`}),e.jsx(F,{label:"Active",value:w.active,color:I.active,sub:"running now"}),e.jsx(F,{label:"Completed",value:w.completed,color:I.completed,sub:"finished"}),e.jsx(F,{label:"Total Roles",value:w.totalRoles,sub:`avg ${w.total?(w.totalRoles/w.total).toFixed(1):0} per session`})]}),b.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-text-tertiary",children:[e.jsx("span",{className:"text-[14px] font-medium mb-1",children:"No sessions found"}),e.jsx("span",{className:"text-[12px]",children:s.length===0?"Run a team skill to see sessions here":"Try adjusting your filters"})]}),t==="cards"&&b.length>0&&e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:b.map(n=>e.jsx(Ce,{session:n,onClick:()=>void u(n.sessionId),onDelete:p=>void o(p)},n.sessionId))}),t==="table"&&b.length>0&&e.jsx(De,{sessions:b,onSelect:n=>void u(n)})]})]})}function F({label:t,value:s,color:r,sub:i}){return e.jsxs("div",{className:"bg-bg-card rounded-xl border border-border px-4 py-3",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:t}),e.jsx("div",{className:"text-[22px] font-bold",style:{color:r??"var(--color-text-primary)"},children:s}),e.jsx("div",{className:"text-[11px] text-text-tertiary mt-0.5",children:i})]})}const V=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function De({sessions:t,onSelect:s}){return e.jsx("div",{className:"bg-bg-card rounded-xl border border-border overflow-hidden",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Session"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Status"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Progress"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Roles"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Duration"}),e.jsx("th",{className:"w-8 bg-bg-secondary border-b border-border sticky top-0 z-[5]"})]})}),e.jsx("tbody",{children:t.map(r=>{const i=r.taskProgress.total?Math.round(r.taskProgress.completed/r.taskProgress.total*100):0,a=I[r.status];return e.jsxs("tr",{onClick:()=>s(r.sessionId),className:"cursor-pointer hover:bg-bg-hover transition-colors group",children:[e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("div",{className:"flex items-center gap-2.5 min-w-[240px]",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:r.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder",children:r.sessionId})]})})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${a}18`,color:a},children:r.status})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-[120px]",children:[e.jsx("div",{className:"flex-1 h-[5px] bg-bg-hover rounded-full overflow-hidden min-w-[60px]",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${i}%`,backgroundColor:a}})}),e.jsxs("span",{className:"text-[11px] font-semibold text-text-tertiary whitespace-nowrap min-w-[36px]",children:[r.taskProgress.completed,"/",r.taskProgress.total]})]})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("div",{className:"flex gap-0.5",children:r.roles.slice(0,5).map((f,h)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:f,style:{backgroundColor:V[h%V.length]},children:f.charAt(0).toUpperCase()},f))})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.duration||"--"})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider text-center",children:e.jsx("span",{className:"text-[14px] text-text-placeholder group-hover:text-accent-blue transition-colors",children:"→"})})]},r.sessionId)})})]})})}function ee({session:t,open:s,onClose:r}){const i=c.useCallback(a=>{a.target===a.currentTarget&&r()},[r]);return e.jsx(e.Fragment,{children:e.jsx("div",{className:["absolute inset-0 z-40 bg-black/[.18] backdrop-blur-[2px] transition-opacity duration-200",s?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"].join(" "),onClick:i,children:e.jsxs("div",{className:["absolute top-0 left-0 right-0 z-50 bg-bg-card border-b border-border","rounded-b-[14px] shadow-[0_12px_40px_rgba(0,0,0,0.12)]","transition-transform duration-[280ms] ease-[cubic-bezier(0.34,1.56,0.64,1)]","max-h-[68vh] overflow-hidden flex flex-col",s?"translate-y-0":"-translate-y-full"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-divider shrink-0",children:[e.jsx("h3",{className:"text-[14px] font-bold text-text-primary",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:r,className:"w-[26px] h-[26px] rounded-[7px] flex items-center justify-center text-text-tertiary hover:bg-bg-hover hover:text-text-primary transition-all",children:e.jsx(M,{size:14})})]}),e.jsxs("div",{className:"grid grid-cols-3 flex-1 overflow-auto",children:[e.jsxs("div",{className:"p-3.5",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Pipeline",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.pipelineStages.length})]}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx(_,{label:"Done",value:t.pipelineStages.filter(a=>a.status==="done").length}),e.jsx(_,{label:"Active",value:t.pipelineStages.filter(a=>a.status==="in_progress").length}),e.jsx(_,{label:"Pending",value:t.pipelineStages.filter(a=>a.status==="pending").length})]}),t.pipeline.waves.length>0?e.jsx(Te,{waves:t.pipeline.waves}):e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:t.pipelineStages.map(a=>e.jsx(Be,{node:a},a.id))})]}),e.jsxs("div",{className:"p-3.5 border-l border-border-divider",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Roles",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.roleDetails.length})]}),e.jsxs("div",{className:"flex flex-col",children:[t.roleDetails.map(a=>e.jsx(Ie,{role:a},a.name)),t.roleDetails.length===0&&e.jsx("span",{className:"text-[11px] text-text-tertiary italic",children:"No roles data"})]})]}),e.jsxs("div",{className:"p-3.5 border-l border-border-divider",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Messages",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.messages.length})]}),e.jsxs("div",{className:"flex flex-col max-h-[50vh] overflow-y-auto",children:[t.messages.slice(-20).map(a=>e.jsx(Re,{message:a},a.id)),t.messages.length===0&&e.jsx("span",{className:"text-[11px] text-text-tertiary italic",children:"No messages"})]})]})]}),e.jsx("div",{className:"flex justify-center py-1.5 border-t border-border-divider cursor-pointer hover:bg-bg-hover",children:e.jsx("div",{className:"w-10 h-1 rounded-full bg-text-placeholder"})})]})})})}const N={nodeW:100,nodeH:26,rowGap:6,padX:12,padY:8,arrowLen:36};function Te({waves:t}){const s=c.useMemo(()=>{const x=[...t].sort((n,p)=>n.number-p.number),m=new Map,u=[];let o=N.padX;for(const n of x){u.push(o);let p=N.padY;for(const j of n.nodes)m.set(j.id,{x:o,y:p,wave:n.number}),p+=N.nodeH+N.rowGap;o+=N.nodeW+N.arrowLen}const b=Math.max(...x.map(n=>n.nodes.length),1),w=x.length*(N.nodeW+N.arrowLen)-N.arrowLen+N.padX*2,k=b*(N.nodeH+N.rowGap)-N.rowGap+N.padY*2;return{sorted:x,positions:m,waveXPositions:u,svgW:w,svgH:k}},[t]),{sorted:r,positions:i,waveXPositions:a,svgW:f,svgH:h}=s;return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("svg",{width:f,height:h,viewBox:`0 0 ${f} ${h}`,className:"block",children:[e.jsx("defs",{children:e.jsx("marker",{id:"dag-arrow",markerWidth:"6",markerHeight:"4",refX:"5",refY:"2",orient:"auto",children:e.jsx("path",{d:"M0,0 L6,2 L0,4",fill:"var(--color-text-placeholder)"})})}),r.map((x,m)=>{if(m===0)return null;const u=r[m-1],o=a[m-1],b=a[m],w=[];for(const k of u.nodes){const n=i.get(k.id),p=o+N.nodeW,j=n.y+N.nodeH/2;for(const C of x.nodes){const E=i.get(C.id),D=b,L=E.y+N.nodeH/2;w.push(e.jsx("line",{x1:p+2,y1:j,x2:D-2,y2:L,stroke:"var(--color-text-placeholder)",strokeWidth:"1",strokeOpacity:"0.4",markerEnd:"url(#dag-arrow)"},`${k.id}-${C.id}`))}}return e.jsx("g",{children:w},`arrows-${x.number}`)}),r.map(x=>x.nodes.map(m=>{const u=i.get(m.id),o=B[m.status];return e.jsxs("g",{children:[e.jsx("rect",{x:u.x,y:u.y,width:N.nodeW,height:N.nodeH,rx:6,fill:"var(--color-bg-hover)",stroke:o,strokeWidth:m.status==="in_progress"?1.5:.5,strokeOpacity:m.status==="in_progress"?1:.4}),e.jsx("circle",{cx:u.x+10,cy:u.y+N.nodeH/2,r:3,fill:o}),e.jsx("text",{x:u.x+18,y:u.y+N.nodeH/2,dominantBaseline:"central",fill:"var(--color-text-primary)",fontSize:"9",fontWeight:"600",fontFamily:"inherit",children:Ee(m.name,10)})]},m.id)})),r.map((x,m)=>e.jsxs("text",{x:a[m]+N.nodeW/2,y:h-1,textAnchor:"middle",fill:"var(--color-text-placeholder)",fontSize:"8",fontWeight:"600",children:["W",x.number]},`wave-label-${x.number}`))]})})}function Ee(t,s){return t.length<=s?t:t.slice(0,s-1)+"…"}function _({label:t,value:s}){return e.jsxs("div",{className:"flex-1 text-center p-1.5 bg-bg-hover rounded-lg",children:[e.jsx("div",{className:"text-[16px] font-bold text-text-primary",children:s}),e.jsx("div",{className:"text-[9px] font-semibold uppercase text-text-tertiary",children:t})]})}function Be({node:t}){const s=B[t.status];return e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg border border-border text-[10px] mb-1 hover:border-accent-blue transition-colors",children:[e.jsx("span",{className:"w-[7px] h-[7px] rounded-full",style:{backgroundColor:s}}),e.jsx("span",{className:"font-semibold text-text-primary",children:t.name})]})}function Ie({role:t}){const s=pe[t.status];return e.jsxs("div",{className:"flex items-center gap-2 py-1.5 border-b border-border-divider last:border-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[10px] font-bold text-white shrink-0",style:{backgroundColor:s},children:t.prefix||t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[12px] font-semibold text-text-primary truncate",children:t.name}),e.jsxs("div",{className:"text-[10px] text-text-tertiary",children:[t.taskCount," task",t.taskCount!==1?"s":""]})]}),e.jsxs("div",{className:"flex gap-1 shrink-0",children:[e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${s}18`,color:s},children:t.status}),t.injected&&e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full bg-[#8B6BBF18] text-[#8B6BBF]",children:"injected"})]})]})}function Re({message:t}){const r={message:"#4A90D9",state_update:"#3D9B6F",task_complete:"#5A9E78",error:"#D05454",broadcast:"#8B6BBF",shutdown:"#A09D97"}[t.type]??"#A09D97";return e.jsxs("div",{className:"flex gap-2 py-1.5 border-b border-border-divider last:border-0 text-[11px] items-start",children:[e.jsx("div",{className:"w-[22px] h-[22px] rounded-md flex items-center justify-center text-[10px] shrink-0 mt-0.5",style:{background:`${r}18`,color:r},children:t.from.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-primary",children:t.from}),e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${r}18`,color:r},children:t.type}),e.jsx("span",{className:"text-[9px] font-mono text-text-placeholder ml-auto",children:t.ts.substring(11,19)})]}),e.jsx("div",{className:"text-[11px] text-text-secondary truncate mt-0.5",children:t.summary})]})]})}function Oe(){const t=g(l=>l.activeSession),s=g(l=>l.activeSessionId),r=g(l=>l.loading),i=g(l=>l.clearActiveSession),[a,f]=c.useState(!1),[h,x]=c.useState(null),[m,u]=c.useState(""),[o,b]=c.useState(!1),[w,k]=c.useState([]),[n,p]=c.useState(new Set);c.useEffect(()=>{function l(y){y.key==="Escape"&&(a?f(!1):i())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i,a]);const j=c.useCallback(async l=>{if(s){x(l),b(!0),k(y=>y.some(v=>v.id===l.id)?y:[...y,l]);try{const y=`${Q.SESSIONS}/${s}/files/${encodeURIComponent(l.path)}`,v=await fetch(y);if(!v.ok)throw new Error(`Failed: ${v.status}`);if((v.headers.get("content-type")??"").includes("json")){const S=await v.json();u(JSON.stringify(S,null,2))}else u(await v.text())}catch{u("// Failed to load file content")}b(!1)}},[s]),C=c.useCallback(l=>{k(y=>{const v=y.filter(d=>d.id!==l);return(h==null?void 0:h.id)===l&&(v.length>0?j(v[v.length-1]):(x(null),u(""))),v})},[h,j]),E=c.useCallback(l=>{p(y=>{const v=new Set(y);return v.has(l)?v.delete(l):v.add(l),v})},[]);if(r||!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading session..."});const D=I[t.status],L=new Map;for(const l of t.files){const y=l.category;L.has(y)||L.set(y,[]),L.get(y).push(l)}const z={artifacts:"Artifacts","role-specs":"Role Specs",session:"Session",wisdom:"Wisdom","message-bus":"Message Bus"};return e.jsxs("div",{className:"-m-[var(--spacing-4)] max-sm:-m-[var(--spacing-2)] flex flex-col h-[calc(100%+var(--spacing-4)*2)] max-sm:h-[calc(100%+var(--spacing-2)*2)] overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2 border-b border-border shrink-0 bg-bg-secondary",children:[e.jsx("button",{type:"button",onClick:i,className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-all",title:"Back to sessions",children:e.jsx(J,{size:15,strokeWidth:2})}),e.jsx("span",{className:"text-[14px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${D}18`,color:D},children:[t.status==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:D}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:D}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>f(!0),className:"ml-2 px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(W,{size:12}),"Team Status"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("aside",{className:"w-[240px] border-r border-border bg-bg-secondary flex flex-col shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-primary",children:"Session Explorer"}),e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${D}18`,color:D},children:t.status})]}),e.jsxs("div",{className:"px-3 py-2 border-b border-border-divider",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2",children:"Pipeline DAG"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.pipelineStages.map((l,y)=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:B[l.status]}}),e.jsx("span",{className:["text-[10px] flex-1 truncate",l.status==="in_progress"?"font-semibold text-text-primary":"text-text-secondary",l.status==="pending"?"opacity-50":""].join(" "),children:l.name}),e.jsx("span",{className:"text-[8px] font-semibold px-1 rounded-full",style:{background:`${B[l.status]}18`,color:B[l.status]},children:l.status==="done"?"Done":l.status==="in_progress"?"Run":"Wait"})]}),y<t.pipelineStages.length-1&&e.jsx("div",{className:"w-px h-2 bg-border-divider ml-[3.5px]"})]},l.id)),t.pipelineStages.length===0&&e.jsx("span",{className:"text-[10px] text-text-tertiary italic",children:"No pipeline data"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[Array.from(L.entries()).map(([l,y])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>E(l),className:"flex items-center gap-1 px-1.5 py-1 w-full text-left text-[9px] font-semibold uppercase tracking-widest text-text-placeholder hover:text-text-primary transition-colors",children:[e.jsx(Y,{size:10,className:["transition-transform",n.has(l)?"-rotate-90":""].join(" ")}),z[l]??l,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:y.length})]}),!n.has(l)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(v=>e.jsxs("button",{type:"button",onClick:()=>void j(v),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(h==null?void 0:h.id)===v.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(R,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:v.name})]},v.id))})]},l)),t.files.length===0&&e.jsx("div",{className:"px-3 py-4 text-[11px] text-text-tertiary italic text-center",children:"No files found"})]})]}),e.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden bg-bg-primary",children:[w.length>0&&e.jsx("div",{className:"flex items-center border-b border-border bg-bg-secondary shrink-0 overflow-x-auto",children:w.map(l=>e.jsxs("div",{className:["flex items-center gap-1.5 px-3 py-1.5 text-[11px] cursor-pointer border-r border-border-divider shrink-0",(h==null?void 0:h.id)===l.id?"bg-bg-primary text-text-primary font-medium":"text-text-tertiary hover:text-text-secondary hover:bg-bg-hover"].join(" "),children:[e.jsx("button",{type:"button",onClick:()=>void j(l),className:"truncate max-w-[140px]",children:l.name}),e.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),C(l.id)},className:"w-4 h-4 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:10})})]},l.id))}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[o&&e.jsx("div",{className:"text-[12px] text-text-tertiary",children:"Loading file..."}),!o&&!h&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(R,{size:32,className:"opacity-30"}),e.jsx("span",{className:"text-[13px] font-medium",children:"Select a file to view"}),e.jsx("span",{className:"text-[11px]",children:"Choose from the sidebar or click Team Status for an overview"})]}),!o&&h&&e.jsx("div",{className:"font-mono text-[12px] leading-relaxed text-text-primary whitespace-pre-wrap break-words",children:m})]})]})]}),e.jsx(ee,{session:t,open:a,onClose:()=>f(!1)})]})}function ze(){const[t,s]=c.useState(!1);return c.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)");s(r.matches);const i=a=>s(a.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),t}const Fe={idle:"Idle",active:"Active",busy:"Busy",error:"Error",offline:"Offline"},$e=new Set(["active","busy"]);function Pe({status:t,role:s}){const r=ze(),i=q[t],a=$e.has(t);return e.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[e.jsxs(T.div,{className:"relative flex items-center justify-center w-[14px] h-[14px]",animate:a&&!r?{scale:[1,1.05,1],opacity:[1,.85,1]}:{scale:1,opacity:1},transition:r?{duration:0}:{duration:2,repeat:1/0,ease:"easeInOut"},children:[a&&!r&&e.jsx("div",{className:"absolute inset-0 rounded-full",style:{backgroundColor:`${i}20`,boxShadow:`0 0 6px ${i}30`}}),e.jsx("div",{className:a&&!r?"pulse-dot":void 0,style:{width:7,height:7,borderRadius:"50%",backgroundColor:i,animation:a&&!r?"pulse-dot 1.5s ease-in-out infinite":"none",willChange:a?"transform, opacity":"auto"}})]}),e.jsxs("div",{className:"flex items-center gap-1 overflow-hidden",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-primary",children:s}),e.jsx(O,{mode:"wait",children:e.jsx(T.span,{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full whitespace-nowrap",style:{background:`${i}18`,color:i},initial:r?!1:{opacity:0,y:6,scale:.9},animate:{opacity:1,y:0,scale:1},exit:r?void 0:{opacity:0,y:-6,scale:.9},transition:r?{duration:0}:{duration:.2,ease:"easeOut"},children:Fe[t]},t)})]})]})}function Me(t){switch(t.type){case"user_message":return{text:t.content,kind:"user"};case"assistant_message":return t.content?{text:t.content,kind:"assistant"}:null;case"thinking":return{text:t.content,kind:"system"};case"error":return{text:t.message,kind:"system"};case"tool_use":return{text:`${t.name}(${JSON.stringify(t.input).slice(0,60)})`,kind:"system"};case"file_change":return{text:`[${t.action}] ${t.path}`,kind:"system"};case"command_exec":return{text:`$ ${t.command}`,kind:"system"};case"status_change":return{text:`Status: ${t.status}`,kind:"system"};default:return null}}function _e(t){const s=new Date(t);return isNaN(s.getTime())?"":s.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function We({role:t,sessionId:s,status:r}){const[i,a]=c.useState(""),f=c.useRef(null),h=c.useRef(null),x=g(p=>p.getProcessIdForRole(s,t)),m=U(p=>x?p.entries[x]??[]:[]),u=U(p=>x?p.processStreaming[x]??!1:!1),o=c.useMemo(()=>{const p=[];for(const j of m){const C=Me(j);C&&p.push({entry:j,display:C})}return p},[m]);c.useEffect(()=>{const p=f.current;p&&(p.scrollTop=p.scrollHeight)},[o.length]);const b=c.useCallback(()=>{var j;const p=i.trim();p&&(ne({action:"team:message",sessionId:s,to:t,content:p}),a(""),(j=h.current)==null||j.focus())},[i,s,t]),w=c.useCallback(p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),b()),p.key==="Escape"&&a("")},[b]),k=q[r],n=!!x;return e.jsxs("div",{className:"flex flex-col rounded-xl border bg-bg-primary overflow-hidden",style:{borderColor:`${k}40`},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider bg-bg-secondary shrink-0",children:[e.jsx(Pe,{status:r,role:t}),e.jsx("div",{className:"flex-1"}),u&&e.jsx(ue,{size:12,className:"text-text-tertiary animate-spin"})]}),e.jsxs("div",{ref:f,className:"flex-1 overflow-y-auto p-3 min-h-[160px] max-h-[400px] flex flex-col gap-1.5",children:[!n&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[11px] italic",children:"Connecting..."}),n&&o.length===0&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[11px] italic",children:"Waiting for activity..."}),e.jsx(O,{initial:!1,children:o.map(({entry:p,display:j})=>e.jsx(T.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.15,ease:"easeOut"},className:["text-[11px] leading-relaxed px-2 py-1 rounded-md max-w-[95%]",j.kind==="user"?"self-end bg-accent-muted text-text-primary":j.kind==="assistant"?"self-start bg-bg-secondary text-text-primary":"self-start bg-bg-hover text-text-tertiary font-mono text-[10px]"].join(" "),children:e.jsxs("div",{className:"flex items-start gap-1.5",children:[e.jsx("span",{className:"text-text-placeholder text-[9px] shrink-0 mt-0.5",children:_e(p.timestamp)}),e.jsx("span",{className:"break-words whitespace-pre-wrap",children:j.text})]})},p.id))})]}),e.jsxs("div",{className:"flex items-end gap-2 px-3 py-2 border-t border-border-divider bg-bg-secondary shrink-0",children:[e.jsx("textarea",{ref:h,value:i,onChange:p=>a(p.target.value),onKeyDown:w,placeholder:`Message ${t}...`,rows:1,className:"flex-1 resize-none rounded-lg border border-border bg-bg-primary px-2.5 py-1.5 text-[11px] text-text-primary placeholder:text-text-placeholder focus:outline-none focus:border-accent-muted transition-colors","aria-label":`Send message to ${t}`}),e.jsx("button",{type:"button",onClick:b,disabled:!i.trim(),className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover disabled:opacity-30 disabled:cursor-not-allowed transition-all shrink-0",title:`Send to ${t}`,"aria-label":`Send message to ${t}`,children:e.jsx(me,{size:13,strokeWidth:2})})]})]})}const $=[{key:"initialization",label:"Init"},{key:"planning",label:"Planning"},{key:"execution",label:"Execution"},{key:"review",label:"Review"},{key:"completion",label:"Complete"}],P={initialization:"#4A90D9",planning:"#8B6BBF",execution:"#B89540",review:"#3D9B6F",completion:"#5A9E78"};function Ue(){const[t,s]=c.useState(!1);return c.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)");s(r.matches);const i=a=>s(a.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),t}function He(){const t=g(x=>x.phaseState),s=Ue(),r=(t==null?void 0:t.current)??null,i=(t==null?void 0:t.fixAttempts)??0,a=3,f=r?$.findIndex(x=>x.key===r):-1,h=s?0:.3;return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-1",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder",children:"Phase"}),r&&e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${P[r]}18`,color:P[r]},children:r})]}),e.jsx(Ne,{children:e.jsx("div",{className:"flex items-center px-4 py-2",children:$.map((x,m)=>{const u=x.key===r,o=f>m,b=P[x.key];return e.jsxs("div",{className:"flex items-center",children:[e.jsxs(T.div,{layout:!0,className:"flex flex-col items-center gap-1",transition:{duration:h,ease:"easeOut"},children:[e.jsxs(T.div,{layout:!0,className:"flex items-center justify-center rounded-full",style:{backgroundColor:o||u?b:"var(--color-bg-hover)",...u?{boxShadow:`0 0 0 2px var(--color-bg-primary), 0 0 0 4px ${b}, 0 0 12px ${b}40`}:{}},animate:{width:u?28:20,height:u?28:20},transition:{duration:h,ease:"easeOut"},children:[o&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),u&&!s&&e.jsx(T.div,{className:"rounded-full bg-white",animate:{scale:[1,1.2,1],opacity:[1,.7,1]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{width:8,height:8}}),u&&s&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-white"})]}),e.jsx("span",{className:["text-[9px] font-semibold whitespace-nowrap transition-colors",u?"text-text-primary":o?"text-text-secondary":"text-text-placeholder"].join(" "),children:x.label}),x.key==="review"&&i>0&&e.jsxs("span",{className:"text-[7px] font-bold px-1 py-px rounded-full",style:{background:"#C4655518",color:"#C46555"},children:[i,"/",a]})]}),m<$.length-1&&e.jsxs("div",{className:"relative h-[2px] mx-1 min-w-[20px] flex-1",children:[e.jsx("div",{className:"absolute inset-0 rounded-full",style:{backgroundColor:"var(--color-bg-hover)"}}),e.jsx(T.div,{className:"absolute inset-y-0 left-0 rounded-full",initial:{width:"0%"},animate:{width:o?"100%":"0%"},transition:{duration:s?0:.5,ease:"easeOut"},style:{backgroundColor:P[$[m+1].key]}})]})]},x.key)})})})]})}function Ge(){const t=g(d=>d.activeSession),s=g(d=>d.activeSessionId),r=g(d=>d.loading),i=g(d=>d.clearActiveSession),a=g(d=>d.agentStatuses),f=g(d=>d.phaseState),[h,x]=c.useState(!1),[m,u]=c.useState(!1),[o,b]=c.useState(null),[w,k]=c.useState(""),[n,p]=c.useState(!1),[j,C]=c.useState(new Set);c.useEffect(()=>{function d(S){S.target instanceof HTMLTextAreaElement||S.target instanceof HTMLInputElement||S.key==="Escape"&&(h?x(!1):m?u(!1):i())}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[i,h,m]);const E=c.useCallback(async d=>{if(s){b(d),p(!0),u(!0);try{const S=`${Q.SESSIONS}/${s}/files/${encodeURIComponent(d.path)}`,A=await fetch(S);if(!A.ok)throw new Error(`Failed: ${A.status}`);if((A.headers.get("content-type")??"").includes("json")){const te=await A.json();k(JSON.stringify(te,null,2))}else k(await A.text())}catch{k("// Failed to load file content")}p(!1)}},[s]),D=c.useCallback(d=>{C(S=>{const A=new Set(S);return A.has(d)?A.delete(d):A.add(d),A})},[]);if(r||!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading session..."});const L=I[t.status],z=new Map;for(const d of a)z.set(d.role,d.status);const l=t.roleDetails.map(d=>d.name),y=new Map;for(const d of t.files){const S=d.category;y.has(S)||y.set(S,[]),y.get(S).push(d)}const v={artifacts:"Artifacts","role-specs":"Role Specs",session:"Session",wisdom:"Wisdom","message-bus":"Message Bus"};return e.jsxs("div",{className:"-m-[var(--spacing-4)] max-sm:-m-[var(--spacing-2)] flex flex-col h-[calc(100%+var(--spacing-4)*2)] max-sm:h-[calc(100%+var(--spacing-2)*2)] overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2 border-b border-border shrink-0 bg-bg-secondary",children:[e.jsx("button",{type:"button",onClick:i,className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-all",title:"Back to sessions",children:e.jsx(J,{size:15,strokeWidth:2})}),e.jsx("span",{className:"text-[14px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),f&&e.jsx("div",{className:"hidden sm:flex items-center gap-1.5 mr-2",children:e.jsx(He,{})}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${L}18`,color:L},children:[e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:L}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:L}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>u(d=>!d),className:"ml-1 px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(R,{size:12}),"Files"]}),e.jsxs("button",{type:"button",onClick:()=>x(!0),className:"px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(W,{size:12}),"Status"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[e.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:e.jsx(O,{children:l.map(d=>e.jsx(T.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2,ease:"easeOut"},children:e.jsx(We,{role:d,sessionId:t.sessionId,status:z.get(d)??"idle"})},d))})}),l.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(W,{size:32,className:"opacity-30"}),e.jsx("span",{className:"text-[13px] font-medium",children:"No agent roles"}),e.jsx("span",{className:"text-[11px]",children:"Waiting for agents to join the session..."})]})]}),e.jsx(O,{children:m&&e.jsxs(T.aside,{initial:{width:0,opacity:0},animate:{width:260,opacity:1},exit:{width:0,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"border-l border-border bg-bg-secondary flex flex-col shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-primary flex-1",children:"Files"}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"w-5 h-5 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:11})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[Array.from(y.entries()).map(([d,S])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>D(d),className:"flex items-center gap-1 px-1.5 py-1 w-full text-left text-[9px] font-semibold uppercase tracking-widest text-text-placeholder hover:text-text-primary transition-colors",children:[e.jsx(Y,{size:10,className:["transition-transform",j.has(d)?"-rotate-90":""].join(" ")}),v[d]??d,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:S.length})]}),!j.has(d)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:S.map(A=>e.jsxs("button",{type:"button",onClick:()=>void E(A),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(o==null?void 0:o.id)===A.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(R,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:A.name})]},A.id))})]},d)),t.files.length===0&&e.jsx("div",{className:"px-3 py-4 text-[11px] text-text-tertiary italic text-center",children:"No files found"})]}),o&&e.jsxs("div",{className:"border-t border-border-divider flex flex-col max-h-[40%]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-bg-primary shrink-0",children:[e.jsx(R,{size:11,className:"text-text-placeholder"}),e.jsx("span",{className:"text-[10px] font-medium text-text-primary truncate",children:o.name}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:()=>{b(null),k("")},className:"w-4 h-4 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:9})})]}),e.jsx("div",{className:"flex-1 overflow-auto p-2",children:n?e.jsx("div",{className:"text-[10px] text-text-tertiary",children:"Loading..."}):e.jsx("pre",{className:"font-mono text-[10px] leading-relaxed text-text-secondary whitespace-pre-wrap break-words",children:w})})]})]})})]}),e.jsx(ee,{session:t,open:h,onClose:()=>x(!1)})]})}const Xe=[{label:"Cards",icon:e.jsx(oe,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Table",icon:e.jsx(le,{size:14,strokeWidth:1.8}),shortcut:"2"}],K=["cards","table"],Ve={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function it(){const t=g(o=>o.activeView),s=g(o=>o.setActiveView),r=g(o=>o.activeSessionId),i=g(o=>o.activeSession),a=g(o=>o.fetchSessions),f=g(o=>o.loading),h=g(o=>o.error),{register:x,unregister:m}=c.useContext(ie),u=c.useCallback(o=>s(K[o]),[s]);return c.useEffect(()=>{r?m():x({items:Xe.map(o=>({label:o.label,icon:o.icon,shortcut:o.shortcut})),activeIndex:K.indexOf(t),onSwitch:u})},[t,r,x,m,u]),c.useEffect(()=>()=>m(),[m]),c.useEffect(()=>{function o(b){b.target instanceof HTMLInputElement||b.target instanceof HTMLTextAreaElement||r||(b.key==="1"?s("cards"):b.key==="2"&&s("table"))}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s,r]),c.useEffect(()=>{a()},[a]),f&&!r?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading team sessions..."}):h&&!r?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-status-failed text-[length:var(--font-size-sm)]",children:"Failed to load team sessions"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:h}),e.jsx("button",{type:"button",onClick:()=>void a(),className:"px-3 py-1 rounded-[var(--radius-md)] text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},children:"Retry"})]}):r?(i==null?void 0:i.status)==="active"?e.jsx(Ge,{}):e.jsx(Oe,{}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsx(O,{mode:"wait",children:e.jsx(T.div,{className:"flex-1 flex flex-col overflow-hidden",variants:Ve,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(Le,{viewMode:t})},t)})})}export{it as TeamsPage};
@@ -1,4 +1,4 @@
1
- import{d as m,r as p,j as t,F as v}from"./index-DpcPd-UG.js";import{S as g}from"./search-pe7pU1YN.js";import{F as b,a as y,D as j}from"./folder-CTj6SNNu.js";/**
1
+ import{d as m,r as p,j as t,F as v}from"./index-DQIlX2w_.js";import{S as g}from"./search-b78eLlw2.js";import{F as b,a as y,D as j}from"./folder-B8ODoZfb.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as q,j as e,S as v,a as y,r as m,c as H,L as W,V as X,p as J}from"./index-DpcPd-UG.js";import{u as Y}from"./shallow-r7YynQYA.js";import{c as $,S as T,P as E,b as Z,D as ee,K as te}from"./table-Bh772iIw.js";import{C as A}from"./check-jcgYBWVR.js";import{L as U}from"./list-BMv8pIQn.js";import{C as O}from"./circle-check-D82WnpbI.js";import{C as se}from"./circle-alert-Bfbv3gt4.js";import{C as ae}from"./columns-3-BeMAQCix.js";/**
1
+ import{d as q,j as e,S as v,a as y,r as m,c as H,L as W,V as X,p as J}from"./index-DQIlX2w_.js";import{u as Y}from"./shallow-CJEesgtu.js";import{c as $,S as T,P as E,b as Z,D as ee,K as te}from"./table-B_lk-a1d.js";import{C as A}from"./check-Bs8PM0tQ.js";import{L as U}from"./list-CI-XIPZh.js";import{C as O}from"./circle-check-BIkDU5D5.js";import{C as se}from"./circle-alert-CuzAg2fd.js";import{C as ae}from"./columns-3-Ch5KIyRa.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as o}from"./index-DpcPd-UG.js";/**
1
+ import{d as o}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as c}from"./index-DpcPd-UG.js";/**
1
+ import{d as c}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as o}from"./index-DpcPd-UG.js";/**
1
+ import{d as o}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as c}from"./index-DpcPd-UG.js";/**
1
+ import{d as c}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as e}from"./index-DpcPd-UG.js";/**
1
+ import{d as e}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as c}from"./index-DpcPd-UG.js";/**
1
+ import{d as c}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as c}from"./index-DpcPd-UG.js";/**
1
+ import{d as c}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as o}from"./index-DpcPd-UG.js";/**
1
+ import{d as o}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as t}from"./index-DpcPd-UG.js";/**
1
+ import{d as t}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as o}from"./index-DpcPd-UG.js";/**
1
+ import{d as o}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as a}from"./index-DpcPd-UG.js";/**
1
+ import{d as a}from"./index-DQIlX2w_.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as n,j as b}from"./index-DpcPd-UG.js";import{M as D,i as k,a as F,P as K,b as U,u as W,L as B}from"./proxy-DOffTzwA.js";function I(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function G(...e){return r=>{let t=!1;const o=e.map(f=>{const u=I(f,r);return!t&&typeof u=="function"&&(t=!0),u});if(t)return()=>{for(let f=0;f<o.length;f++){const u=o[f];typeof u=="function"?u():I(e[f],null)}}}}function T(...e){return n.useCallback(G(...e),e)}class V extends n.Component{getSnapshotBeforeUpdate(r){const t=this.props.childRef.current;if(k(t)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=t.offsetParent,f=k(o)&&o.offsetWidth||0,u=k(o)&&o.offsetHeight||0,a=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(a.height),s.width=parseFloat(a.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=f-s.width-s.left,s.bottom=u-s.height-s.top}return null}componentDidUpdate(){}render(){return this.props.children}}function X({children:e,isPresent:r,anchorX:t,anchorY:o,root:f,pop:u}){var c;const a=n.useId(),s=n.useRef(null),E=n.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:w}=n.useContext(D),l=((c=e.props)==null?void 0:c.ref)??(e==null?void 0:e.ref),y=T(s,l);return n.useInsertionEffect(()=>{const{width:p,height:d,top:x,left:g,right:$,bottom:v}=E.current;if(r||u===!1||!s.current||!p||!d)return;const L=t==="left"?`left: ${g}`:`right: ${$}`,m=o==="bottom"?`bottom: ${v}`:`top: ${x}`;s.current.dataset.motionPopId=a;const C=document.createElement("style");w&&(C.nonce=w);const R=f??document.head;return R.appendChild(C),C.sheet&&C.sheet.insertRule(`
1
+ import{r as n,j as b}from"./index-DQIlX2w_.js";import{M as D,i as k,a as F,P as K,b as U,u as W,L as B}from"./proxy-CcYyZZWI.js";function I(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function G(...e){return r=>{let t=!1;const o=e.map(f=>{const u=I(f,r);return!t&&typeof u=="function"&&(t=!0),u});if(t)return()=>{for(let f=0;f<o.length;f++){const u=o[f];typeof u=="function"?u():I(e[f],null)}}}}function T(...e){return n.useCallback(G(...e),e)}class V extends n.Component{getSnapshotBeforeUpdate(r){const t=this.props.childRef.current;if(k(t)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=t.offsetParent,f=k(o)&&o.offsetWidth||0,u=k(o)&&o.offsetHeight||0,a=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(a.height),s.width=parseFloat(a.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=f-s.width-s.left,s.bottom=u-s.height-s.top}return null}componentDidUpdate(){}render(){return this.props.children}}function X({children:e,isPresent:r,anchorX:t,anchorY:o,root:f,pop:u}){var c;const a=n.useId(),s=n.useRef(null),E=n.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:w}=n.useContext(D),l=((c=e.props)==null?void 0:c.ref)??(e==null?void 0:e.ref),y=T(s,l);return n.useInsertionEffect(()=>{const{width:p,height:d,top:x,left:g,right:$,bottom:v}=E.current;if(r||u===!1||!s.current||!p||!d)return;const L=t==="left"?`left: ${g}`:`right: ${$}`,m=o==="bottom"?`bottom: ${v}`:`top: ${x}`;s.current.dataset.motionPopId=a;const C=document.createElement("style");w&&(C.nonce=w);const R=f??document.head;return R.appendChild(C),C.sheet&&C.sheet.insertRule(`
2
2
  [data-motion-pop-id="${a}"] {
3
3
  position: absolute !important;
4
4
  width: ${p}px !important;