maestro-flow 0.3.8 → 0.3.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.
- package/.claude/commands/learn-decompose.md +3 -3
- package/.claude/commands/learn-follow.md +5 -5
- package/.claude/commands/learn-investigate.md +3 -3
- package/.claude/commands/learn-retro.md +6 -6
- package/.claude/commands/learn-second-opinion.md +3 -3
- package/.claude/commands/maestro-analyze.md +123 -99
- package/.claude/commands/maestro-brainstorm.md +2 -2
- package/.claude/commands/maestro-execute.md +137 -97
- package/.claude/commands/maestro-fork.md +111 -0
- package/.claude/commands/maestro-init.md +6 -6
- package/.claude/commands/maestro-merge.md +77 -0
- package/.claude/commands/maestro-milestone-audit.md +72 -60
- package/.claude/commands/maestro-milestone-complete.md +67 -59
- package/.claude/commands/maestro-milestone-release.md +6 -6
- package/.claude/commands/maestro-plan.md +151 -130
- package/.claude/commands/maestro-quick.md +4 -4
- package/.claude/commands/maestro-roadmap.md +5 -5
- package/.claude/commands/maestro-spec-generate.md +5 -5
- package/.claude/commands/maestro-ui-design.md +3 -3
- package/.claude/commands/maestro-verify.md +106 -87
- package/.claude/commands/maestro.md +10 -4
- package/.claude/commands/manage-codebase-rebuild.md +4 -4
- package/.claude/commands/manage-codebase-refresh.md +1 -1
- package/.claude/commands/manage-harvest.md +5 -5
- package/.claude/commands/manage-issue-discover.md +1 -1
- package/.claude/commands/manage-issue-execute.md +6 -6
- package/.claude/commands/manage-issue.md +6 -6
- package/.claude/commands/manage-learn.md +2 -2
- package/.claude/commands/manage-memory-capture.md +4 -4
- package/.claude/commands/manage-memory.md +2 -2
- package/.claude/commands/manage-status.md +24 -24
- package/.claude/commands/quality-business-test.md +5 -5
- package/.claude/commands/quality-debug.md +4 -4
- package/.claude/commands/quality-integration-test.md +4 -4
- package/.claude/commands/quality-refactor.md +3 -3
- package/.claude/commands/quality-retrospective.md +2 -2
- package/.claude/commands/quality-review.md +4 -4
- package/.claude/commands/quality-sync.md +3 -3
- package/.claude/commands/quality-test-gen.md +4 -4
- package/.claude/commands/quality-test.md +9 -9
- package/.claude/commands/spec-add.md +2 -2
- package/.claude/commands/spec-load.md +1 -1
- package/.claude/commands/spec-setup.md +5 -5
- package/.claude/commands/wiki-connect.md +3 -3
- package/.claude/commands/wiki-digest.md +4 -4
- package/.codex/skills/maestro-analyze/SKILL.md +52 -14
- package/.codex/skills/maestro-execute/SKILL.md +27 -26
- package/.codex/skills/maestro-milestone-audit/SKILL.md +103 -209
- package/.codex/skills/maestro-milestone-complete/SKILL.md +149 -158
- package/.codex/skills/maestro-plan/SKILL.md +47 -17
- package/.codex/skills/maestro-roadmap/SKILL.md +3 -2
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +1 -1
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +2 -2
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +1 -1
- package/README.md +19 -14
- package/README.zh-CN.md +16 -12
- package/bin/maestro-mcp.js +1 -1
- package/chains/_intent-map.json +21 -9
- package/chains/_router.json +30 -77
- package/chains/brainstorm-driven.json +17 -6
- package/chains/full-lifecycle.json +22 -23
- package/chains/milestone-close.json +20 -7
- package/chains/milestone-fork-merge.json +50 -0
- package/chains/roadmap-driven.json +17 -6
- package/chains/spec-driven.json +17 -6
- package/dashboard/dist/assets/{ArtifactsPage-BmPOu8sO.js → ArtifactsPage-DZNCi6tn.js} +12 -7
- package/dashboard/dist/assets/ChatInput-Bvr-FeEq.js +49 -0
- package/dashboard/dist/assets/ChatPage-D9zTkJZo.js +22 -0
- package/dashboard/dist/assets/CollabPage-B4NAHXS2.js +1 -0
- package/dashboard/dist/assets/ExecutionPanel-CFt4LJyq.js +1 -0
- package/dashboard/dist/assets/KanbanPage-C8USth6H.js +21 -0
- package/dashboard/dist/assets/{MarkdownRenderer-BjZ43aSa.js → MarkdownRenderer-X4af_WNb.js} +1 -1
- package/dashboard/dist/assets/McpPage-BKfCVIyU.js +21 -0
- package/dashboard/dist/assets/OutputPanel-BlBQFJSW.js +1 -0
- package/dashboard/dist/assets/ProblemsPanel-De3DLvoI.js +1 -0
- package/dashboard/dist/assets/{RequirementBoardPage-B7yRL0s_.js → RequirementBoardPage-Bf1trzqs.js} +2 -2
- package/dashboard/dist/assets/{RequirementPage-D8J_-b6O.js → RequirementPage-Bllxe2XI.js} +10 -5
- package/dashboard/dist/assets/{SpecsPage-6lO8v8_C.js → SpecsPage-9lwxKT27.js} +2 -2
- package/dashboard/dist/assets/{SupervisorPage-Ds5N378a.js → SupervisorPage-SusdfHFq.js} +1 -1
- package/dashboard/dist/assets/{TeamsPage-DrkKr17T.js → TeamsPage-DsuM6OwC.js} +2 -2
- package/dashboard/dist/assets/TreeBrowser-Q12qobZs.js +6 -0
- package/dashboard/dist/assets/WorkflowPage-D_Fzdy3_.js +6 -0
- package/dashboard/dist/assets/{arrow-left-CadP5YgU.js → arrow-left-Bqtb2hle.js} +1 -1
- package/dashboard/dist/assets/{check-5xufDzS8.js → check-u6fGOwQO.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-CYbpR4ev.js → chevron-right-Csu22t58.js} +1 -1
- package/dashboard/dist/assets/{circle-Bm-5Q-Yh.js → circle-CMrkbRNg.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-BqcYuT7x.js → circle-alert-c3tH1P4z.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-yyzAFysU.js → circle-check-big-TDSeWstm.js} +1 -1
- package/dashboard/dist/assets/{circle-check-DEVzW_lm.js → circle-check-gYxxSYuH.js} +1 -1
- package/dashboard/dist/assets/{code-BBdC8Wmw.js → code-CFN2uX9V.js} +1 -1
- package/dashboard/dist/assets/{columns-3-CQ9Trztr.js → columns-3-38xIDlzy.js} +1 -1
- package/dashboard/dist/assets/{download-DayuF-sn.js → download-DC7KkKyP.js} +1 -1
- package/dashboard/dist/assets/{folder-CqXeSKeC.js → folder-CWq_lAnf.js} +1 -1
- package/dashboard/dist/assets/index-DWG-WrzT.js +231 -0
- package/dashboard/dist/assets/{index-Dru5HYy0.js → index-Do71weNR.js} +1 -1
- package/dashboard/dist/assets/index-GUNJodSR.css +1 -0
- package/dashboard/dist/assets/{list-DBOD6IUt.js → list-CgIP_2A-.js} +1 -1
- package/dashboard/dist/assets/{minus-fQI1Syn2.js → minus-DYoN5UGk.js} +1 -1
- package/dashboard/dist/assets/{pen-line-Bkbbngl5.js → pen-line-Bh_WKYHm.js} +1 -1
- package/dashboard/dist/assets/{proxy-teW12DdZ.js → proxy-BKxDAKTj.js} +1 -1
- package/dashboard/dist/assets/{search-Bq3ygFUW.js → search-SieXnOgr.js} +1 -1
- package/dashboard/dist/assets/{shallow-22ZN8sFt.js → shallow-Bme1JY57.js} +1 -1
- package/dashboard/dist/assets/{table-BEYtdWc4.js → table-llyEtj-7.js} +1 -1
- package/dashboard/dist/assets/terminal-BB3Xfuv5.js +6 -0
- package/dashboard/dist/assets/{trash-2-DMqGBgcF.js → trash-2-C8f4vFFM.js} +1 -1
- package/dashboard/dist/assets/{zap-9DVkGVtt.js → zap-4uwlzVm0.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +8 -4
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +20 -10
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/git.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js +79 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js +3 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js +43 -0
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js +43 -3
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js.map +1 -1
- package/dashboard/package.json +59 -59
- package/dist/src/cli.js +3 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/{team.d.ts → collab.d.ts} +2 -2
- package/dist/src/commands/collab.d.ts.map +1 -0
- package/dist/src/commands/{team.js → collab.js} +391 -24
- package/dist/src/commands/collab.js.map +1 -0
- package/dist/src/commands/msg.d.ts.map +1 -1
- package/dist/src/commands/msg.js +4 -3
- package/dist/src/commands/msg.js.map +1 -1
- package/dist/src/hooks/team-monitor.d.ts.map +1 -1
- package/dist/src/hooks/team-monitor.js +16 -0
- package/dist/src/hooks/team-monitor.js.map +1 -1
- package/dist/src/tools/collab-adapter.d.ts +85 -0
- package/dist/src/tools/collab-adapter.d.ts.map +1 -0
- package/dist/src/tools/collab-adapter.js +320 -0
- package/dist/src/tools/collab-adapter.js.map +1 -0
- package/dist/src/tools/namespace-guard.d.ts +2 -0
- package/dist/src/tools/namespace-guard.d.ts.map +1 -1
- package/dist/src/tools/namespace-guard.js +12 -0
- package/dist/src/tools/namespace-guard.js.map +1 -1
- package/dist/src/tools/phase-gate-evaluator.d.ts +45 -0
- package/dist/src/tools/phase-gate-evaluator.d.ts.map +1 -0
- package/dist/src/tools/phase-gate-evaluator.js +42 -0
- package/dist/src/tools/phase-gate-evaluator.js.map +1 -0
- package/dist/src/tools/team-members.d.ts +18 -0
- package/dist/src/tools/team-members.d.ts.map +1 -1
- package/dist/src/tools/team-members.js +50 -0
- package/dist/src/tools/team-members.js.map +1 -1
- package/dist/src/tools/team-tasks.d.ts +120 -0
- package/dist/src/tools/team-tasks.d.ts.map +1 -0
- package/dist/src/tools/team-tasks.js +365 -0
- package/dist/src/tools/team-tasks.js.map +1 -0
- package/dist/src/tools/transition-recorder.d.ts +3 -0
- package/dist/src/tools/transition-recorder.d.ts.map +1 -1
- package/dist/src/tools/transition-recorder.js +52 -1
- package/dist/src/tools/transition-recorder.js.map +1 -1
- package/dist/src/utils/get-version.d.ts.map +1 -1
- package/dist/src/utils/get-version.js +15 -4
- package/dist/src/utils/get-version.js.map +1 -1
- package/package.json +1 -1
- package/templates/config.json +7 -0
- package/templates/worktree-scope.json +10 -0
- package/templates/worktrees.json +27 -0
- package/workflows/analyze.md +86 -36
- package/workflows/brainstorm.md +17 -37
- package/workflows/execute.md +94 -28
- package/workflows/fork.md +309 -0
- package/workflows/init.md +10 -1
- package/workflows/issue.md +66 -7
- package/workflows/maestro-coordinate.md +23 -16
- package/workflows/maestro.md +52 -35
- package/workflows/merge.md +285 -0
- package/workflows/milestone-audit.md +89 -70
- package/workflows/milestone-complete.md +89 -156
- package/workflows/plan.md +122 -17
- package/workflows/retrospective.md +3 -3
- package/workflows/roadmap.md +11 -3
- package/workflows/spec-generate.md +9 -0
- package/workflows/status.md +76 -27
- package/workflows/ui-design.md +14 -12
- package/workflows/verify.md +44 -8
- package/.claude/commands/maestro-phase-add.md +0 -63
- package/.claude/commands/maestro-phase-transition.md +0 -75
- package/.codex/skills/maestro-phase-add/SKILL.md +0 -154
- package/.codex/skills/maestro-phase-transition/SKILL.md +0 -173
- package/chains/singles/phase-add.json +0 -31
- package/chains/singles/phase-transition.json +0 -23
- package/dashboard/dist/assets/ChatInput-CL8YDfOU.js +0 -67
- package/dashboard/dist/assets/ChatPage-CT-ozBK2.js +0 -8
- package/dashboard/dist/assets/CollabPage-C0rWMden.js +0 -1
- package/dashboard/dist/assets/KanbanPage-C6WbAlwI.js +0 -16
- package/dashboard/dist/assets/McpPage-BPIXADQi.js +0 -16
- package/dashboard/dist/assets/TreeBrowser-g_QUKemL.js +0 -11
- package/dashboard/dist/assets/WorkflowPage-X8aNkDEr.js +0 -6
- package/dashboard/dist/assets/git-branch-SqFf4Ru5.js +0 -6
- package/dashboard/dist/assets/index-D2Mtyw7I.css +0 -1
- package/dashboard/dist/assets/index-nufWop4p.js +0 -231
- package/dashboard/dist/assets/wrench-B84-zdLI.js +0 -11
- package/dist/src/commands/team.d.ts.map +0 -1
- package/dist/src/commands/team.js.map +0 -1
- package/workflows/phase-add.md +0 -252
- package/workflows/phase-transition.md +0 -399
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{d as $,o as M,
|
|
1
|
+
import{d as $,o as M,U as B,j as e,p as V,N as W,M as Q,r as h,X as _,y as X,F,V as K,n as H}from"./index-DWG-WrzT.js";import{L as q}from"./list-CgIP_2A-.js";import{S as G}from"./search-SieXnOgr.js";import{C as J}from"./chevron-right-Csu22t58.js";import{T as Y}from"./trash-2-C8f4vFFM.js";import{A as Z}from"./arrow-left-Bqtb2hle.js";import{A as ee}from"./index-Do71weNR.js";import{m as te}from"./proxy-BKxDAKTj.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const se=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],re=$("users",se),m=M((t,l)=>({sessions:[],activeSession:null,activeSessionId:null,activeView:"cards",loading:!1,error:null,statusFilter:"all",skillFilter:null,searchQuery:"",setActiveView:s=>t({activeView:s}),setStatusFilter:s=>t({statusFilter:s}),setSkillFilter:s=>t({skillFilter:s}),setSearchQuery:s=>t({searchQuery:s}),clearActiveSession:()=>t({activeSession:null,activeSessionId:null}),fetchSessions:async()=>{t({loading:!0,error:null});try{const s=await fetch(B.SESSIONS);if(!s.ok)throw new Error(`Failed: ${s.status}`);const n=await s.json();t({sessions:n,loading:!1})}catch(s){t({loading:!1,error:String(s)})}},deleteSession:async s=>{const n=l().sessions;t(i=>({sessions:i.sessions.filter(o=>o.sessionId!==s)}));try{(await fetch(B.SESSIONS+"/"+s,{method:"DELETE"})).ok||t({sessions:n})}catch{t({sessions:n})}},fetchSessionDetail:async s=>{t({loading:!0,error:null,activeSessionId:s});try{const n=await fetch(B.SESSIONS+"/"+s);if(!n.ok)throw new Error(`Failed: ${n.status}`);const i=await n.json();t({activeSession:i,loading:!1})}catch(n){t({loading:!1,error:String(n)})}},filteredSessions:()=>{const{sessions:s,statusFilter:n,skillFilter:i,searchQuery:o}=l();let d=s;if(n!=="all"&&(d=d.filter(u=>u.status===n)),i&&(d=d.filter(u=>u.skill===i)),o){const u=o.toLowerCase();d=d.filter(f=>f.title.toLowerCase().includes(u)||f.sessionId.toLowerCase().includes(u)||f.roles.some(c=>c.toLowerCase().includes(u)))}return d}})),C={active:"#B89540",completed:"#5A9E78",failed:"#C46555",archived:"#A09D97"},S={done:"#5A9E78",in_progress:"#B89540",pending:"#A09D97",skipped:"#D1CEC8"},ae={done:"#5A9E78",active:"#B89540",pending:"#A09D97",injected:"#8B6BBF"},le={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"},ie={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"},L=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function ne({status:t}){const l=C[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:`${l}18`,color:l},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:l}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:l}})]}),t.charAt(0).toUpperCase()+t.slice(1)]})}function oe({session:t,onClick:l,onDelete:s}){const n=le[t.skill]??"#A09D97",i=ie[t.skill]??"TM";return e.jsxs("button",{type:"button",onClick:l,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:n},children:i}),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(ne,{status:t.status}),s&&e.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),s(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(Y,{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(o=>e.jsx("div",{className:"w-2 h-2 rounded-full",title:`${o.name}: ${o.status}`,style:{backgroundColor:S[o.status]}},o.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(V,{size:11,strokeWidth:2}),t.taskProgress.completed,"/",t.taskProgress.total," tasks"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(W,{size:11,strokeWidth:2}),t.duration||"--"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Q,{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((o,d)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:o,style:{backgroundColor:L[d%L.length]},children:o.charAt(0).toUpperCase()},o)),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(J,{size:14,className:"text-text-placeholder group-hover:text-accent-blue transition-colors"})]})]})}const ce=["all","active","completed","failed","archived"];function de({viewMode:t}){const l=m(a=>a.sessions),s=m(a=>a.filteredSessions),n=m(a=>a.statusFilter),i=m(a=>a.skillFilter),o=m(a=>a.searchQuery),d=m(a=>a.setStatusFilter),u=m(a=>a.setSkillFilter),f=m(a=>a.setSearchQuery),c=m(a=>a.fetchSessionDetail),b=m(a=>a.deleteSession),v=s(),g=h.useMemo(()=>{const a=l.filter(j=>j.status==="active").length,y=l.filter(j=>j.status==="completed").length,w=l.reduce((j,T)=>j+T.roles.length,0);return{total:l.length,active:a,completed:y,totalRoles:w}},[l]),N=h.useMemo(()=>{const a=new Set(l.map(y=>y.skill));return Array.from(a).sort()},[l]);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:v.length}),e.jsxs("div",{className:"relative ml-2",children:[e.jsx(G,{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:o,onChange:a=>f(a.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:ce.map(a=>e.jsx("button",{type:"button",onClick:()=>d(a),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",n===a?"bg-text-primary text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:a==="all"?"All":a.charAt(0).toUpperCase()+a.slice(1)},a))}),N.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:N.map(a=>e.jsx("button",{type:"button",onClick:()=>u(i===a?null:a),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",i===a?"bg-accent-blue text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:a},a))})]})]}),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(D,{label:"Total Sessions",value:g.total,sub:`across ${N.length} skill types`}),e.jsx(D,{label:"Active",value:g.active,color:C.active,sub:"running now"}),e.jsx(D,{label:"Completed",value:g.completed,color:C.completed,sub:"finished"}),e.jsx(D,{label:"Total Roles",value:g.totalRoles,sub:`avg ${g.total?(g.totalRoles/g.total).toFixed(1):0} per session`})]}),v.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:l.length===0?"Run a team skill to see sessions here":"Try adjusting your filters"})]}),t==="cards"&&v.length>0&&e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:v.map(a=>e.jsx(oe,{session:a,onClick:()=>void c(a.sessionId),onDelete:y=>void b(y)},a.sessionId))}),t==="table"&&v.length>0&&e.jsx(xe,{sessions:v,onSelect:a=>void c(a)})]})]})}function D({label:t,value:l,color:s,sub:n}){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:s??"var(--color-text-primary)"},children:l}),e.jsx("div",{className:"text-[11px] text-text-tertiary mt-0.5",children:n})]})}const O=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function xe({sessions:t,onSelect:l}){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(s=>{const n=s.taskProgress.total?Math.round(s.taskProgress.completed/s.taskProgress.total*100):0,i=C[s.status];return e.jsxs("tr",{onClick:()=>l(s.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:s.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder",children:s.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:`${i}18`,color:i},children:s.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:`${n}%`,backgroundColor:i}})}),e.jsxs("span",{className:"text-[11px] font-semibold text-text-tertiary whitespace-nowrap min-w-[36px]",children:[s.taskProgress.completed,"/",s.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:s.roles.slice(0,5).map((o,d)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:o,style:{backgroundColor:O[d%O.length]},children:o.charAt(0).toUpperCase()},o))})}),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:s.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:"→"})})]},s.sessionId)})})]})})}function pe({session:t,open:l,onClose:s}){const n=h.useCallback(i=>{i.target===i.currentTarget&&s()},[s]);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",l?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"].join(" "),onClick:n,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",l?"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:s,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(_,{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(E,{label:"Done",value:t.pipelineStages.filter(i=>i.status==="done").length}),e.jsx(E,{label:"Active",value:t.pipelineStages.filter(i=>i.status==="in_progress").length}),e.jsx(E,{label:"Pending",value:t.pipelineStages.filter(i=>i.status==="pending").length})]}),t.pipeline.waves.length>0?t.pipeline.waves.map(i=>e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"text-[9px] font-semibold text-text-placeholder mb-1",children:["Wave ",i.number]}),e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:i.nodes.map(o=>e.jsx(R,{node:o},o.id))})]},i.number)):t.pipelineStages.map(i=>e.jsx(R,{node:i},i.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(i=>e.jsx(me,{role:i},i.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(i=>e.jsx(he,{message:i},i.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"})})]})})})}function E({label:t,value:l}){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:l}),e.jsx("div",{className:"text-[9px] font-semibold uppercase text-text-tertiary",children:t})]})}function R({node:t}){const l=S[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:l}}),e.jsx("span",{className:"font-semibold text-text-primary",children:t.name})]})}function me({role:t}){const l=ae[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:l},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:`${l}18`,color:l},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 he({message:t}){const s={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:`${s}18`,color:s},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:`${s}18`,color:s},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 ue(){const t=m(r=>r.activeSession),l=m(r=>r.activeSessionId),s=m(r=>r.loading),n=m(r=>r.clearActiveSession),[i,o]=h.useState(!1),[d,u]=h.useState(null),[f,c]=h.useState(""),[b,v]=h.useState(!1),[g,N]=h.useState([]),[a,y]=h.useState(new Set);h.useEffect(()=>{function r(x){x.key==="Escape"&&(i?o(!1):n())}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[n,i]);const w=h.useCallback(async r=>{if(l){u(r),v(!0),N(x=>x.some(p=>p.id===r.id)?x:[...x,r]);try{const x=`${B.SESSIONS}/${l}/files/${encodeURIComponent(r.path)}`,p=await fetch(x);if(!p.ok)throw new Error(`Failed: ${p.status}`);if((p.headers.get("content-type")??"").includes("json")){const U=await p.json();c(JSON.stringify(U,null,2))}else c(await p.text())}catch{c("// Failed to load file content")}v(!1)}},[l]),j=h.useCallback(r=>{N(x=>{const p=x.filter(I=>I.id!==r);return(d==null?void 0:d.id)===r&&(p.length>0?w(p[p.length-1]):(u(null),c(""))),p})},[d,w]),T=h.useCallback(r=>{y(x=>{const p=new Set(x);return p.has(r)?p.delete(r):p.add(r),p})},[]);if(s||!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 k=C[t.status],A=new Map;for(const r of t.files){const x=r.category;A.has(x)||A.set(x,[]),A.get(x).push(r)}const P={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:n,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(Z,{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:`${k}18`,color:k},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:k}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:k}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>o(!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(re,{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:`${k}18`,color:k},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((r,x)=>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:S[r.status]}}),e.jsx("span",{className:["text-[10px] flex-1 truncate",r.status==="in_progress"?"font-semibold text-text-primary":"text-text-secondary",r.status==="pending"?"opacity-50":""].join(" "),children:r.name}),e.jsx("span",{className:"text-[8px] font-semibold px-1 rounded-full",style:{background:`${S[r.status]}18`,color:S[r.status]},children:r.status==="done"?"Done":r.status==="in_progress"?"Run":"Wait"})]}),x<t.pipelineStages.length-1&&e.jsx("div",{className:"w-px h-2 bg-border-divider ml-[3.5px]"})]},r.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(A.entries()).map(([r,x])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>T(r),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(K,{size:10,className:["transition-transform",a.has(r)?"-rotate-90":""].join(" ")}),P[r]??r,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:x.length})]}),!a.has(r)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:x.map(p=>e.jsxs("button",{type:"button",onClick:()=>void w(p),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(d==null?void 0:d.id)===p.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(F,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:p.name})]},p.id))})]},r)),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:[g.length>0&&e.jsx("div",{className:"flex items-center border-b border-border bg-bg-secondary shrink-0 overflow-x-auto",children:g.map(r=>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",(d==null?void 0:d.id)===r.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 w(r),className:"truncate max-w-[140px]",children:r.name}),e.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),j(r.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(_,{size:10})})]},r.id))}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[b&&e.jsx("div",{className:"text-[12px] text-text-tertiary",children:"Loading file..."}),!b&&!d&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(F,{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"})]}),!b&&d&&e.jsx("div",{className:"font-mono text-[12px] leading-relaxed text-text-primary whitespace-pre-wrap break-words",children:f})]})]})]}),e.jsx(pe,{session:t,open:i,onClose:()=>o(!1)})]})}const fe=[{label:"Cards",icon:e.jsx(q,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Table",icon:e.jsx(H,{size:14,strokeWidth:1.8}),shortcut:"2"}],z=["cards","table"],be={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function Ce(){const t=m(c=>c.activeView),l=m(c=>c.setActiveView),s=m(c=>c.activeSessionId),n=m(c=>c.fetchSessions),i=m(c=>c.loading),o=m(c=>c.error),{register:d,unregister:u}=h.useContext(X),f=h.useCallback(c=>l(z[c]),[l]);return h.useEffect(()=>{s?u():d({items:fe.map(c=>({label:c.label,icon:c.icon,shortcut:c.shortcut})),activeIndex:z.indexOf(t),onSwitch:f})},[t,s,d,u,f]),h.useEffect(()=>()=>u(),[u]),h.useEffect(()=>{function c(b){b.target instanceof HTMLInputElement||b.target instanceof HTMLTextAreaElement||s||(b.key==="1"?l("cards"):b.key==="2"&&l("table"))}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[l,s]),h.useEffect(()=>{n()},[n]),i&&!s?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading team sessions..."}):o&&!s?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:o}),e.jsx("button",{type:"button",onClick:()=>void n(),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"})]}):s?e.jsx(ue,{}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsx(ee,{mode:"wait",children:e.jsx(te.div,{className:"flex-1 flex flex-col overflow-hidden",variants:be,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(de,{viewMode:t})},t)})})}export{Ce as TeamsPage};
|
|
6
|
+
*/const se=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],re=$("users",se),m=M((t,l)=>({sessions:[],activeSession:null,activeSessionId:null,activeView:"cards",loading:!1,error:null,statusFilter:"all",skillFilter:null,searchQuery:"",setActiveView:s=>t({activeView:s}),setStatusFilter:s=>t({statusFilter:s}),setSkillFilter:s=>t({skillFilter:s}),setSearchQuery:s=>t({searchQuery:s}),clearActiveSession:()=>t({activeSession:null,activeSessionId:null}),fetchSessions:async()=>{t({loading:!0,error:null});try{const s=await fetch(B.SESSIONS);if(!s.ok)throw new Error(`Failed: ${s.status}`);const n=await s.json();t({sessions:n,loading:!1})}catch(s){t({loading:!1,error:String(s)})}},deleteSession:async s=>{const n=l().sessions;t(i=>({sessions:i.sessions.filter(o=>o.sessionId!==s)}));try{(await fetch(B.SESSIONS+"/"+s,{method:"DELETE"})).ok||t({sessions:n})}catch{t({sessions:n})}},fetchSessionDetail:async s=>{t({loading:!0,error:null,activeSessionId:s});try{const n=await fetch(B.SESSIONS+"/"+s);if(!n.ok)throw new Error(`Failed: ${n.status}`);const i=await n.json();t({activeSession:i,loading:!1})}catch(n){t({loading:!1,error:String(n)})}},filteredSessions:()=>{const{sessions:s,statusFilter:n,skillFilter:i,searchQuery:o}=l();let d=s;if(n!=="all"&&(d=d.filter(u=>u.status===n)),i&&(d=d.filter(u=>u.skill===i)),o){const u=o.toLowerCase();d=d.filter(f=>f.title.toLowerCase().includes(u)||f.sessionId.toLowerCase().includes(u)||f.roles.some(c=>c.toLowerCase().includes(u)))}return d}})),C={active:"#B89540",completed:"#5A9E78",failed:"#C46555",archived:"#A09D97"},S={done:"#5A9E78",in_progress:"#B89540",pending:"#A09D97",skipped:"#D1CEC8"},ae={done:"#5A9E78",active:"#B89540",pending:"#A09D97",injected:"#8B6BBF"},le={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"},ie={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"},L=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function ne({status:t}){const l=C[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:`${l}18`,color:l},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:l}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:l}})]}),t.charAt(0).toUpperCase()+t.slice(1)]})}function oe({session:t,onClick:l,onDelete:s}){const n=le[t.skill]??"#A09D97",i=ie[t.skill]??"TM";return e.jsxs("button",{type:"button",onClick:l,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:n},children:i}),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(ne,{status:t.status}),s&&e.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),s(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(Y,{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(o=>e.jsx("div",{className:"w-2 h-2 rounded-full",title:`${o.name}: ${o.status}`,style:{backgroundColor:S[o.status]}},o.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(V,{size:11,strokeWidth:2}),t.taskProgress.completed,"/",t.taskProgress.total," tasks"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(W,{size:11,strokeWidth:2}),t.duration||"--"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Q,{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((o,d)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:o,style:{backgroundColor:L[d%L.length]},children:o.charAt(0).toUpperCase()},o)),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(J,{size:14,className:"text-text-placeholder group-hover:text-accent-blue transition-colors"})]})]})}const ce=["all","active","completed","failed","archived"];function de({viewMode:t}){const l=m(a=>a.sessions),s=m(a=>a.filteredSessions),n=m(a=>a.statusFilter),i=m(a=>a.skillFilter),o=m(a=>a.searchQuery),d=m(a=>a.setStatusFilter),u=m(a=>a.setSkillFilter),f=m(a=>a.setSearchQuery),c=m(a=>a.fetchSessionDetail),b=m(a=>a.deleteSession),v=s(),g=h.useMemo(()=>{const a=l.filter(j=>j.status==="active").length,y=l.filter(j=>j.status==="completed").length,w=l.reduce((j,T)=>j+T.roles.length,0);return{total:l.length,active:a,completed:y,totalRoles:w}},[l]),N=h.useMemo(()=>{const a=new Set(l.map(y=>y.skill));return Array.from(a).sort()},[l]);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:v.length}),e.jsxs("div",{className:"relative ml-2",children:[e.jsx(G,{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:o,onChange:a=>f(a.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:ce.map(a=>e.jsx("button",{type:"button",onClick:()=>d(a),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",n===a?"bg-text-primary text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:a==="all"?"All":a.charAt(0).toUpperCase()+a.slice(1)},a))}),N.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:N.map(a=>e.jsx("button",{type:"button",onClick:()=>u(i===a?null:a),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",i===a?"bg-accent-blue text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:a},a))})]})]}),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(D,{label:"Total Sessions",value:g.total,sub:`across ${N.length} skill types`}),e.jsx(D,{label:"Active",value:g.active,color:C.active,sub:"running now"}),e.jsx(D,{label:"Completed",value:g.completed,color:C.completed,sub:"finished"}),e.jsx(D,{label:"Total Roles",value:g.totalRoles,sub:`avg ${g.total?(g.totalRoles/g.total).toFixed(1):0} per session`})]}),v.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:l.length===0?"Run a team skill to see sessions here":"Try adjusting your filters"})]}),t==="cards"&&v.length>0&&e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:v.map(a=>e.jsx(oe,{session:a,onClick:()=>void c(a.sessionId),onDelete:y=>void b(y)},a.sessionId))}),t==="table"&&v.length>0&&e.jsx(xe,{sessions:v,onSelect:a=>void c(a)})]})]})}function D({label:t,value:l,color:s,sub:n}){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:s??"var(--color-text-primary)"},children:l}),e.jsx("div",{className:"text-[11px] text-text-tertiary mt-0.5",children:n})]})}const O=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function xe({sessions:t,onSelect:l}){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(s=>{const n=s.taskProgress.total?Math.round(s.taskProgress.completed/s.taskProgress.total*100):0,i=C[s.status];return e.jsxs("tr",{onClick:()=>l(s.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:s.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder",children:s.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:`${i}18`,color:i},children:s.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:`${n}%`,backgroundColor:i}})}),e.jsxs("span",{className:"text-[11px] font-semibold text-text-tertiary whitespace-nowrap min-w-[36px]",children:[s.taskProgress.completed,"/",s.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:s.roles.slice(0,5).map((o,d)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:o,style:{backgroundColor:O[d%O.length]},children:o.charAt(0).toUpperCase()},o))})}),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:s.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:"→"})})]},s.sessionId)})})]})})}function pe({session:t,open:l,onClose:s}){const n=h.useCallback(i=>{i.target===i.currentTarget&&s()},[s]);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",l?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"].join(" "),onClick:n,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",l?"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:s,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(_,{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(E,{label:"Done",value:t.pipelineStages.filter(i=>i.status==="done").length}),e.jsx(E,{label:"Active",value:t.pipelineStages.filter(i=>i.status==="in_progress").length}),e.jsx(E,{label:"Pending",value:t.pipelineStages.filter(i=>i.status==="pending").length})]}),t.pipeline.waves.length>0?t.pipeline.waves.map(i=>e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"text-[9px] font-semibold text-text-placeholder mb-1",children:["Wave ",i.number]}),e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:i.nodes.map(o=>e.jsx(R,{node:o},o.id))})]},i.number)):t.pipelineStages.map(i=>e.jsx(R,{node:i},i.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(i=>e.jsx(me,{role:i},i.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(i=>e.jsx(he,{message:i},i.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"})})]})})})}function E({label:t,value:l}){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:l}),e.jsx("div",{className:"text-[9px] font-semibold uppercase text-text-tertiary",children:t})]})}function R({node:t}){const l=S[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:l}}),e.jsx("span",{className:"font-semibold text-text-primary",children:t.name})]})}function me({role:t}){const l=ae[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:l},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:`${l}18`,color:l},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 he({message:t}){const s={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:`${s}18`,color:s},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:`${s}18`,color:s},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 ue(){const t=m(r=>r.activeSession),l=m(r=>r.activeSessionId),s=m(r=>r.loading),n=m(r=>r.clearActiveSession),[i,o]=h.useState(!1),[d,u]=h.useState(null),[f,c]=h.useState(""),[b,v]=h.useState(!1),[g,N]=h.useState([]),[a,y]=h.useState(new Set);h.useEffect(()=>{function r(x){x.key==="Escape"&&(i?o(!1):n())}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[n,i]);const w=h.useCallback(async r=>{if(l){u(r),v(!0),N(x=>x.some(p=>p.id===r.id)?x:[...x,r]);try{const x=`${B.SESSIONS}/${l}/files/${encodeURIComponent(r.path)}`,p=await fetch(x);if(!p.ok)throw new Error(`Failed: ${p.status}`);if((p.headers.get("content-type")??"").includes("json")){const U=await p.json();c(JSON.stringify(U,null,2))}else c(await p.text())}catch{c("// Failed to load file content")}v(!1)}},[l]),j=h.useCallback(r=>{N(x=>{const p=x.filter(I=>I.id!==r);return(d==null?void 0:d.id)===r&&(p.length>0?w(p[p.length-1]):(u(null),c(""))),p})},[d,w]),T=h.useCallback(r=>{y(x=>{const p=new Set(x);return p.has(r)?p.delete(r):p.add(r),p})},[]);if(s||!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 k=C[t.status],A=new Map;for(const r of t.files){const x=r.category;A.has(x)||A.set(x,[]),A.get(x).push(r)}const P={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:n,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(Z,{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:`${k}18`,color:k},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:k}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:k}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>o(!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(re,{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:`${k}18`,color:k},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((r,x)=>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:S[r.status]}}),e.jsx("span",{className:["text-[10px] flex-1 truncate",r.status==="in_progress"?"font-semibold text-text-primary":"text-text-secondary",r.status==="pending"?"opacity-50":""].join(" "),children:r.name}),e.jsx("span",{className:"text-[8px] font-semibold px-1 rounded-full",style:{background:`${S[r.status]}18`,color:S[r.status]},children:r.status==="done"?"Done":r.status==="in_progress"?"Run":"Wait"})]}),x<t.pipelineStages.length-1&&e.jsx("div",{className:"w-px h-2 bg-border-divider ml-[3.5px]"})]},r.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(A.entries()).map(([r,x])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>T(r),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(X,{size:10,className:["transition-transform",a.has(r)?"-rotate-90":""].join(" ")}),P[r]??r,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:x.length})]}),!a.has(r)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:x.map(p=>e.jsxs("button",{type:"button",onClick:()=>void w(p),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(d==null?void 0:d.id)===p.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(F,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:p.name})]},p.id))})]},r)),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:[g.length>0&&e.jsx("div",{className:"flex items-center border-b border-border bg-bg-secondary shrink-0 overflow-x-auto",children:g.map(r=>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",(d==null?void 0:d.id)===r.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 w(r),className:"truncate max-w-[140px]",children:r.name}),e.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),j(r.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(_,{size:10})})]},r.id))}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[b&&e.jsx("div",{className:"text-[12px] text-text-tertiary",children:"Loading file..."}),!b&&!d&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(F,{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"})]}),!b&&d&&e.jsx("div",{className:"font-mono text-[12px] leading-relaxed text-text-primary whitespace-pre-wrap break-words",children:f})]})]})]}),e.jsx(pe,{session:t,open:i,onClose:()=>o(!1)})]})}const fe=[{label:"Cards",icon:e.jsx(H,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Table",icon:e.jsx(q,{size:14,strokeWidth:1.8}),shortcut:"2"}],z=["cards","table"],be={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function Ce(){const t=m(c=>c.activeView),l=m(c=>c.setActiveView),s=m(c=>c.activeSessionId),n=m(c=>c.fetchSessions),i=m(c=>c.loading),o=m(c=>c.error),{register:d,unregister:u}=h.useContext(K),f=h.useCallback(c=>l(z[c]),[l]);return h.useEffect(()=>{s?u():d({items:fe.map(c=>({label:c.label,icon:c.icon,shortcut:c.shortcut})),activeIndex:z.indexOf(t),onSwitch:f})},[t,s,d,u,f]),h.useEffect(()=>()=>u(),[u]),h.useEffect(()=>{function c(b){b.target instanceof HTMLInputElement||b.target instanceof HTMLTextAreaElement||s||(b.key==="1"?l("cards"):b.key==="2"&&l("table"))}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[l,s]),h.useEffect(()=>{n()},[n]),i&&!s?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading team sessions..."}):o&&!s?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:o}),e.jsx("button",{type:"button",onClick:()=>void n(),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"})]}):s?e.jsx(ue,{}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsx(ee,{mode:"wait",children:e.jsx(te.div,{className:"flex-1 flex flex-col overflow-hidden",variants:be,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(de,{viewMode:t})},t)})})}export{Ce as TeamsPage};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{d as m,r as p,j as t,F as v}from"./index-DWG-WrzT.js";import{S as g}from"./search-SieXnOgr.js";import{F as b,a as y,D as j}from"./folder-CWq_lAnf.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const k=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],w=m("file-braces",k);function S({tree:e,selectedPath:a,onSelectFile:s,loading:r}){const[o,i]=p.useState(""),l=p.useMemo(()=>{if(!o.trim())return e;const n=o.toLowerCase();return h(e,n)},[e,o]);return r?t.jsx("div",{className:"p-[var(--spacing-3)]",children:t.jsx("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary animate-pulse",children:"Loading tree..."})}):t.jsxs("div",{className:"flex flex-col h-full bg-bg-primary",role:"tree","aria-label":"File browser",children:[t.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[14px] py-[10px] border-b border-border-divider shrink-0",children:[t.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary",children:"Files"}),t.jsx("span",{className:"text-[10px] text-text-tertiary ml-auto font-mono",children:z(l)})]}),t.jsx("div",{className:"px-[10px] py-[var(--spacing-2)] shrink-0",children:t.jsxs("div",{className:["flex items-center gap-[var(--spacing-1-5)] px-[10px] py-[5px]","bg-bg-secondary border border-border-divider rounded-[var(--radius-md)]","focus-within:border-accent-purple","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-notion)]"].join(" "),children:[t.jsx(g,{size:12,strokeWidth:2,className:"text-text-tertiary shrink-0"}),t.jsx("input",{type:"search",value:o,onChange:n=>i(n.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full bg-transparent border-none outline-none text-[11px] text-text-primary placeholder:text-text-placeholder font-[inherit]"})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto py-[var(--spacing-1)] px-0",role:"group",children:l.length===0?t.jsx("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary italic px-[var(--spacing-2)] py-[var(--spacing-1)]",children:o?"No matches":"No artifacts"}):l.map(n=>t.jsx(u,{node:n,depth:0,selectedPath:a,onSelectFile:s,defaultOpen:!o.trim()},n.path))})]})}function u({node:e,depth:a,selectedPath:s,onSelectFile:r,defaultOpen:o}){const[i,l]=p.useState(a<1||!o),n=p.useCallback(()=>{e.type==="directory"?l(c=>!c):r(e.path)},[e,r]),x=e.path===s,f=a*12+4;return t.jsxs("div",{children:[t.jsxs("button",{type:"button",onClick:n,role:"treeitem","aria-expanded":e.type==="directory"?i:void 0,"aria-selected":x,className:["flex items-center gap-[var(--spacing-1-5)] w-full text-left px-[10px] py-[4px] text-[length:var(--font-size-sm)]","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-notion)] border-none bg-transparent","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",x?"bg-bg-active":"hover:bg-bg-hover"].join(" "),style:{paddingLeft:f},title:e.path,children:[e.type==="directory"?t.jsx("svg",{className:["w-[var(--size-icon-sm)] h-[var(--size-icon-sm)] text-text-tertiary shrink-0","transition-transform duration-[var(--duration-normal)] ease-[var(--ease-notion)]",i?"rotate-90":""].join(" "),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"9 18 15 12 9 6"})}):t.jsx("span",{className:"w-[var(--size-icon-sm)] shrink-0"}),t.jsx("span",{className:"shrink-0 text-text-secondary","aria-hidden":"true",children:N(e,i)}),t.jsx("span",{className:["truncate",e.type==="directory"||x?"font-[var(--font-weight-semibold)] text-text-primary":"text-text-secondary"].join(" "),children:e.name}),e.type==="file"&&t.jsx(C,{name:e.name}),e.type==="directory"&&t.jsx(L,{node:e})]}),e.type==="directory"&&i&&e.children&&t.jsx("div",{children:e.children.map(c=>t.jsx(u,{node:c,depth:a+1,selectedPath:s,onSelectFile:r,defaultOpen:o},c.path))})]})}function N(e,a){if(e.type==="directory")return a?t.jsx(b,{size:14,strokeWidth:1.8,style:{color:"var(--color-accent-yellow)"}}):t.jsx(y,{size:14,strokeWidth:1.8,style:{color:"var(--color-accent-yellow)"}});switch(e.name.slice(e.name.lastIndexOf(".")).toLowerCase()){case".json":return t.jsx(w,{size:14,strokeWidth:1.8});case".ndjson":case".jsonl":return t.jsx(j,{size:14,strokeWidth:1.8});default:return t.jsx(v,{size:14,strokeWidth:1.8})}}function d(e){return e.type==="file"?1:e.children?e.children.reduce((a,s)=>a+d(s),0):0}function z(e){return e.reduce((a,s)=>a+d(s),0)}function C({name:e}){const a=e.slice(e.lastIndexOf(".")).toLowerCase();let s="",r="",o="";switch(a){case".json":s="JSON",r="var(--color-status-bg-executing)",o="var(--color-accent-yellow)";break;case".md":s="MD",r="var(--color-status-bg-exploring)",o="var(--color-accent-blue)";break;case".ndjson":case".jsonl":s="JSONL",r="var(--color-status-bg-verifying)",o="var(--color-accent-orange)";break;default:return null}return t.jsx("span",{className:"ml-auto text-[9px] font-[var(--font-weight-semibold)] px-[5px] py-[1px] rounded-[var(--radius-sm)] font-mono shrink-0 uppercase",style:{background:r,color:o},children:s})}function L({node:e}){if(e.name.match(/^(\d{2})-/)){const s={setup:{label:"Done",bg:"var(--color-status-bg-completed)",color:"var(--color-status-completed)"},complete:{label:"Done",bg:"var(--color-status-bg-completed)",color:"var(--color-status-completed)"}},r=e.children?d(e):0,o=r>0,i=e.name.toLowerCase();for(const[l,n]of Object.entries(s))if(i.includes(l))return t.jsx("span",{className:"ml-auto text-[9px] font-[var(--font-weight-semibold)] px-[5px] rounded-full shrink-0",style:{background:n.bg,color:n.color},children:n.label});if(o)return t.jsx("span",{className:"ml-auto text-[9px] font-[var(--font-weight-semibold)] px-[5px] rounded-full shrink-0",style:{background:"var(--color-status-bg-exploring)",color:"var(--color-accent-blue)"},children:r})}return e.children?t.jsx("span",{className:"text-text-tertiary ml-auto text-[length:var(--font-size-xs)] shrink-0",children:d(e)}):null}function h(e,a){const s=[];for(const r of e)if(r.type==="file")(r.name.toLowerCase().includes(a)||r.path.toLowerCase().includes(a))&&s.push(r);else{const o=r.children?h(r.children,a):[];o.length>0?s.push({...r,children:o}):r.name.toLowerCase().includes(a)&&s.push(r)}return s}export{w as F,S as T};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{d as H,j as e,S as h,a as j,r as v,c as X,L as W,V as J,p as Y}from"./index-DWG-WrzT.js";import{u as Z}from"./shallow-Bme1JY57.js";import{u as E,S as T,P as $,T as ee,D as te,K as se}from"./table-llyEtj-7.js";import{C as A}from"./check-u6fGOwQO.js";import{L as F}from"./list-CgIP_2A-.js";import{C as O}from"./circle-check-gYxxSYuH.js";import{C as ae}from"./circle-alert-c3tH1P4z.js";import{C as re}from"./columns-3-38xIDlzy.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ne=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ie=H("play",ne),B=[{status:"pending",label:"Pending"},{status:"exploring",label:"Exploring"},{status:"planning",label:"Planning"},{status:"executing",label:"Executing"},{status:"verifying",label:"Verifying"},{status:"completed",label:"Complete"}];function oe(t,s){return s==="completed"?t.filter(a=>a.status==="completed").length:s==="verifying"?t.filter(a=>a.status==="verifying"||a.status==="testing").length:s==="pending"?t.filter(a=>a.status==="pending"||a.status==="not_started").length:t.filter(a=>a.status===s).length}function le({phases:t,hiddenCols:s,onToggleCol:a}){return e.jsx("div",{className:"flex items-center px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border-divider bg-bg-primary shrink-0 gap-0 overflow-x-auto",children:B.map((n,i)=>{const x=oe(t,n.status),r=h[n.status],l=s==null?void 0:s.has(n.status);return e.jsxs("div",{className:"contents",children:[e.jsxs("button",{type:"button",onClick:()=>a==null?void 0:a(n.status),className:`flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3-5)] py-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] cursor-pointer transition-all rounded-full border ${l?"opacity-40 border-border bg-bg-secondary":"opacity-100 border-transparent bg-transparent hover:bg-bg-secondary"}`,title:l?`Show ${n.label} column`:`Hide ${n.label} column`,children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full shrink-0",style:{backgroundColor:r}}),e.jsx("span",{className:"text-text-tertiary",children:n.label}),e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full bg-bg-secondary text-text-tertiary font-mono",children:x})]}),i<B.length-1&&e.jsx("div",{className:"relative w-5 h-px bg-border shrink-0",children:e.jsx("div",{className:"absolute -right-px -top-[3px] border-[3px] border-transparent border-l-[4px] border-l-border"})})]},n.status)})})}const _={feat:{bg:"rgba(74,144,217,0.12)",text:"var(--color-status-exploring)"},feature:{bg:"rgba(74,144,217,0.12)",text:"var(--color-status-exploring)"},fix:{bg:"rgba(208,84,84,0.12)",text:"var(--color-status-blocked)"},refac:{bg:"rgba(139,107,191,0.12)",text:"var(--color-status-planning)"},refactor:{bg:"rgba(139,107,191,0.12)",text:"var(--color-status-planning)"},docs:{bg:"rgba(160,157,151,0.12)",text:"var(--color-status-pending)"},test:{bg:"rgba(91,141,184,0.12)",text:"var(--color-status-testing)"}},I={in_progress:{bg:"rgba(201,155,45,0.1)",text:"var(--color-status-executing)"},running:{bg:"rgba(201,155,45,0.1)",text:"var(--color-status-executing)"},pending:{bg:"rgba(160,157,151,0.1)",text:"var(--color-status-pending)"},queued:{bg:"rgba(160,157,151,0.1)",text:"var(--color-status-pending)"},completed:{bg:"rgba(61,155,111,0.1)",text:"var(--color-status-completed)"},done:{bg:"rgba(61,155,111,0.1)",text:"var(--color-status-completed)"},failed:{bg:"rgba(208,84,84,0.1)",text:"var(--color-status-blocked)"}},ce={in_progress:"Running",running:"Running",pending:"Queued",queued:"Queued",completed:"Done",done:"Done",failed:"Failed"};function R(t){return{feature:"feat",refactor:"refac"}[t]??t}function de({task:t}){const s=_[t.type]??_[R(t.type)]??_.feat,a=I[t.status]??I.pending,n=ce[t.status]??t.status;return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-2-5)] py-[var(--spacing-1-5)] rounded-[var(--radius-default)] bg-bg-card text-[length:var(--font-size-xs)] cursor-pointer transition-colors duration-[var(--duration-fast)] hover:bg-bg-hover",children:[e.jsx("span",{className:"font-mono text-[length:10px] text-text-tertiary min-w-[60px] shrink-0",children:t.id}),e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] uppercase px-[7px] py-[2px] rounded-full shrink-0",style:{backgroundColor:s.bg,color:s.text},children:R(t.type)}),e.jsx("span",{className:"flex-1 text-text-primary whitespace-nowrap overflow-hidden text-ellipsis",children:t.title}),e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-semibold)] px-[7px] py-[2px] rounded-full shrink-0",style:{backgroundColor:a.bg,color:a.text},children:n})]})}const xe={not_started:"var(--color-tint-pending)",pending:"var(--color-tint-pending)",exploring:"var(--color-tint-exploring)",planning:"var(--color-tint-planning)",executing:"var(--color-tint-executing)",verifying:"var(--color-tint-verifying)",testing:"var(--color-tint-testing)",completed:"var(--color-tint-completed)",blocked:"var(--color-tint-blocked)"};function pe({phase:t,onSelectTask:s,recommendedAdvance:a}){const n=j(g=>g.setSelectedPhase),[i,x]=v.useState(!1),{tasks:r,loading:l}=E(i?t.phase:null),{tasks_completed:p,tasks_total:o,current_wave:c}=t.execution,m=h[t.status],y=t.verification.gaps.length>0,b=t.plan.task_count>0,d=X(g=>g.issues),f=v.useMemo(()=>d.filter(g=>g.phase_id===t.phase),[d,t.phase]),u=f.filter(g=>{var k;return((k=g.execution)==null?void 0:k.status)==="running"}).length;return b?e.jsxs("div",{children:[e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>n(t.phase),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n(t.phase))},className:"rounded-[10px] px-[var(--spacing-3-5)] py-[var(--spacing-3)] cursor-pointer transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)] hover:-translate-y-0.5 hover:shadow-[0_4px_12px_rgba(0,0,0,0.06)] focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",style:{backgroundColor:xe[t.status]??"var(--color-tint-pending)"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-[var(--spacing-1-5)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)]",children:[e.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),x(!i)},className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors","aria-label":i?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${i?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}),e.jsx(T,{status:t.status,cardVariant:!0})]}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:["P-",String(t.phase).padStart(2,"0")]})]}),e.jsx("div",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary mb-[var(--spacing-0-5)]",children:t.title}),t.goal&&e.jsx("p",{className:"text-[12px] text-text-secondary leading-[var(--line-height-normal)] line-clamp-2 mb-[var(--spacing-2)]",children:t.goal}),o>0&&e.jsx($,{completed:p,total:o,color:m}),t.status==="executing"&&c>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] mt-[var(--spacing-1-5)]",style:{color:m},children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse motion-reduce:animate-none",style:{backgroundColor:m}}),"Wave ",c," active"]}),y&&e.jsxs("div",{className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"rgba(196, 101, 85, 0.1)",color:"var(--color-status-blocked)"},children:[t.verification.gaps.length," Gap",t.verification.gaps.length>1?"s":""]}),a&&e.jsxs("div",{className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"rgba(91, 141, 184, 0.1)",color:"var(--color-accent-blue)"},children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse",style:{backgroundColor:"var(--color-accent-blue)"}}),"Advance recommended"]}),u>0&&e.jsxs(W,{to:`/kanban?phase=${t.phase}`,onClick:g=>g.stopPropagation(),className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full no-underline transition-colors hover:opacity-80",style:{backgroundColor:"rgba(184, 149, 64, 0.1)",color:"#B89540"},title:`${u} issue(s) running — view in Kanban`,children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse",style:{backgroundColor:"#B89540"}}),u," running"]}),f.length>0&&u===0&&e.jsxs(W,{to:`/kanban?phase=${t.phase}`,onClick:g=>g.stopPropagation(),className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full no-underline transition-colors hover:opacity-80",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)",border:"1px solid var(--color-border)"},children:[f.length," issue",f.length>1?"s":""]})]}),i&&e.jsx("div",{className:"mt-[var(--spacing-1)] flex flex-col gap-[var(--spacing-1)]",children:l?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary px-[var(--spacing-3)] py-[var(--spacing-2)]",children:"Loading tasks..."}):r.length===0?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary px-[var(--spacing-3)] py-[var(--spacing-2)]",children:"No tasks"}):r.map(g=>e.jsx("div",{onClick:()=>s==null?void 0:s({type:"task",task:g,phaseId:t.phase}),children:e.jsx(de,{task:{id:g.id,title:g.title,type:g.type,status:g.meta.status}})},g.id))})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(t.phase),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n(t.phase))},className:"rounded-[8px] px-[var(--spacing-3)] py-[var(--spacing-2)] cursor-pointer transition-all duration-[var(--duration-normal)] hover:shadow-[0_2px_8px_rgba(0,0,0,0.04)] focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)] opacity-60 hover:opacity-80",style:{border:"1px dashed var(--color-border)",backgroundColor:"transparent"},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx(T,{status:t.status,cardVariant:!0}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-secondary",children:t.title})]}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:["P-",String(t.phase).padStart(2,"0")]})]})})}const P=4;function ge({color:t,phases:s,label:a,onSelectTask:n}){const[i,x]=v.useState(!1),r=[...s].sort((c,m)=>(m.plan.task_count||0)-(c.plan.task_count||0)),l=r.length>P,p=i||!l?r:r.slice(0,P),o=r.length-P;return e.jsxs("div",{className:"flex flex-col w-[280px] shrink-0 bg-bg-secondary rounded-[12px] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3-5)] py-[var(--spacing-2-5)]",children:[e.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:t}}),e.jsx("span",{className:"text-[12px] font-[var(--font-weight-semibold)] text-text-primary",children:a}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-card px-[var(--spacing-1-5)] rounded-full",children:s.length})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-2)] pb-[var(--spacing-2)] flex flex-col gap-[var(--spacing-2)]",children:[p.map(c=>e.jsx(pe,{phase:c,onSelectTask:n},c.phase)),l&&e.jsx("button",{type:"button",onClick:()=>x(!i),className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] text-text-tertiary hover:text-text-secondary py-[var(--spacing-1-5)] cursor-pointer transition-colors text-center",children:i?"Show less":`+${o} more`})]})]})}function ue(){var p;const t=j(o=>o.board),s=(t==null?void 0:t.phases)??[],a=s.filter(o=>o.status==="completed").length,n=s.length,i=s.reduce((o,c)=>o+c.execution.tasks_completed,0),x=s.reduce((o,c)=>o+c.execution.tasks_total,0),r=x>0?Math.round(i/x*100):0,l=((p=t==null?void 0:t.project)==null?void 0:p.current_milestone)??"";return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-5)] px-[var(--spacing-5)] py-[var(--spacing-2)] border-t border-border bg-bg-secondary text-[12px] shrink-0",children:[l&&e.jsx("span",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:l}),e.jsxs("span",{className:"text-text-secondary",children:["Phases: ",e.jsxs("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:[a,"/",n]})," complete"]}),e.jsxs("span",{className:"text-text-secondary",children:["Tasks: ",e.jsxs("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:[i,"/",x]})]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] w-36",children:[e.jsx("div",{className:"flex-1 h-1 rounded-full bg-border overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500 ease-out",style:{width:`${r}%`,backgroundColor:"var(--color-status-completed)"}})}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] text-text-secondary font-mono tabular-nums",children:[r,"%"]})]})]})}const z=[{status:"pending",label:"Pending",match:["not_started","pending"]},{status:"exploring",label:"Exploring",match:["exploring"]},{status:"planning",label:"Planning",match:["planning"]},{status:"executing",label:"Executing",match:["executing"]},{status:"verifying",label:"Verifying",match:["verifying","testing"]},{status:"completed",label:"Complete",match:["completed"]}];function me(t){const s=new Map;for(const a of z)s.set(a.status,[]);for(const a of t){const n=z.find(i=>i.match.includes(a.status));n&&s.get(n.status).push(a)}return s}function he({onSelectTask:t}){const s=j(r=>{var l;return((l=r.board)==null?void 0:l.phases)??[]}),a=v.useMemo(()=>me(s),[s]),[n,i]=v.useState(()=>new Set(["completed"])),x=v.useCallback(r=>{i(l=>{const p=new Set(l);return p.has(r)?p.delete(r):p.add(r),p})},[]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(le,{phases:s,hiddenCols:n,onToggleCol:x}),e.jsxs("div",{className:"flex gap-[var(--spacing-2-5)] flex-1 overflow-x-auto px-[var(--spacing-3)] py-[var(--spacing-3)]",children:[z.map(r=>n.has(r.status)?null:e.jsx(ge,{status:r.status,color:h[r.status],label:r.label,phases:a.get(r.status)??[],onSelectTask:t},r.status)),n.size===z.length&&e.jsx("div",{className:"flex-1 flex items-center justify-center text-text-tertiary text-[length:var(--font-size-sm)]",children:"All columns hidden — click a category tag above to show it."})]}),e.jsx(ue,{})]})}const ve=6,fe=Array.from({length:ve},(t,s)=>`Week ${s+1}`),V={pending:"var(--color-status-pending)",in_progress:"var(--color-status-executing)",completed:"var(--color-status-completed)",failed:"var(--color-status-blocked)"},be={pending:"Queued",in_progress:"Running",completed:"Done",failed:"Failed"};function ye({phaseId:t,onSelectTask:s}){const{tasks:a,loading:n}=E(t);return n?e.jsxs("div",{className:"grid items-center py-[var(--spacing-1)] border-b border-border-divider",style:{gridTemplateColumns:"180px 1fr"},children:[e.jsx("div",{className:"pl-[var(--spacing-6)] text-[length:var(--font-size-xs)] text-text-tertiary",children:"Loading..."}),e.jsx("div",{})]}):a.length===0?null:e.jsx(e.Fragment,{children:a.map(i=>e.jsxs("div",{className:"grid items-center py-[var(--spacing-1)] border-b border-border-divider bg-[rgba(0,0,0,0.02)] cursor-pointer hover:bg-bg-hover transition-colors duration-[var(--duration-fast)]",style:{gridTemplateColumns:"180px 1fr"},onClick:()=>s==null?void 0:s({type:"task",task:i,phaseId:t}),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] pl-[var(--spacing-6)] text-[length:var(--font-size-xs)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:V[i.meta.status]??"var(--color-status-pending)"}}),e.jsx("span",{className:"font-mono text-[length:10px] text-text-tertiary shrink-0",children:i.id}),e.jsx("span",{className:"text-text-secondary truncate",children:i.title}),e.jsx("span",{className:"ml-auto pr-[var(--spacing-3)] text-[length:10px] font-[var(--font-weight-medium)] shrink-0",style:{color:V[i.meta.status]??"var(--color-text-tertiary)"},children:be[i.meta.status]??i.meta.status})]}),e.jsx("div",{})]},i.id))})}function je({onSelectPhase:t,onSelectTask:s}){const a=j(d=>d.board),[n,i]=v.useState(new Set);if(!a||a.phases.length===0)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No phases to display"});const x=a.phases,r=x.length,l=x.reduce((d,f)=>d+f.execution.tasks_total,0),p=x.reduce((d,f)=>d+f.execution.tasks_completed,0),o=l>0?Math.round(p/l*100):0,c=x.find(d=>d.status==="executing"),m=c?x.indexOf(c):-1,y=m>=0&&c?(()=>{const d=m/r*100,f=1/r*100,u=c.execution.tasks_total>0?c.execution.tasks_completed/c.execution.tasks_total:0;return d+f*u})():-1;function b(d){i(f=>{const u=new Set(f);return u.has(d)?u.delete(d):u.add(d),u})}return e.jsxs("div",{className:"p-[var(--spacing-4)] h-full overflow-auto",children:[e.jsxs("div",{className:"grid border-b border-border pb-[var(--spacing-2)] mb-[var(--spacing-1)]",style:{gridTemplateColumns:"180px 1fr"},children:[e.jsx("span",{className:"text-[length:11px] font-[var(--font-weight-semibold)] text-text-tertiary uppercase tracking-[0.04em]",children:"Phase"}),e.jsx("div",{className:"flex justify-between",children:fe.map(d=>e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:d},d))})]}),x.map((d,f)=>{const u=h[d.status],g=f/r*100,k=1/r*100,N=d.execution.tasks_total>0?d.execution.tasks_completed/d.execution.tasks_total:0,K=d.status==="pending"?.5:d.status==="completed"?1:.85,L=d.plan.task_count>0,S=n.has(d.phase);return e.jsxs("div",{children:[e.jsxs("div",{className:"grid items-center py-[var(--spacing-1-5)] border-b border-border-divider cursor-pointer hover:bg-bg-hover transition-colors duration-[var(--duration-fast)]",style:{gridTemplateColumns:"180px 1fr"},onClick:()=>t(d.phase),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-[length:var(--font-size-xs)]",children:[L&&e.jsx("button",{type:"button",onClick:Q=>{Q.stopPropagation(),b(d.phase)},className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors shrink-0","aria-label":S?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${S?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}),!L&&e.jsx("span",{className:"w-4 shrink-0"}),e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:u}}),e.jsx("span",{className:"font-[var(--font-weight-medium)] text-text-primary truncate",children:d.title}),e.jsxs("span",{className:"ml-auto pr-[var(--spacing-3)] font-mono text-[length:10px] text-text-tertiary",children:[d.execution.tasks_completed,"/",d.execution.tasks_total]})]}),e.jsxs("div",{className:"relative h-7 bg-bg-secondary rounded-[var(--radius-default)] overflow-visible",children:[e.jsxs("div",{className:"absolute top-1 h-5 rounded-[var(--radius-default)] flex items-center px-[var(--spacing-2)] text-[length:10px] font-[var(--font-weight-semibold)] text-white transition-[width] duration-300 ease-[var(--ease-out)]",style:{left:`${g}%`,width:`${k}%`,backgroundColor:u,opacity:K},children:[N>0&&N<1&&e.jsx("div",{className:"absolute top-0 left-0 h-full rounded-[var(--radius-default)] opacity-30 bg-white",style:{width:`${N*100}%`}}),e.jsxs("span",{className:"relative z-[1] whitespace-nowrap",children:["P-",String(d.phase).padStart(2,"0"),N>0&&N<1?` (${Math.round(N*100)}%)`:""]})]}),y>=0&&(c==null?void 0:c.phase)===d.phase&&e.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-[var(--color-status-blocked)] z-[5] rounded-sm",style:{left:`${y}%`},children:e.jsx("span",{className:"absolute -top-[18px] -left-3 text-[length:9px] font-[var(--font-weight-semibold)] text-[var(--color-status-blocked)]",children:"Today"})})]})]}),S&&e.jsx(ye,{phaseId:d.phase,onSelectTask:s})]},d.phase)}),e.jsxs("div",{className:"mt-[var(--spacing-5)] pt-[var(--spacing-3)] border-t border-border flex items-center gap-[var(--spacing-5)]",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[e.jsx("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:"Overall:"})," ",p,"/",l," tasks complete (",o,"%)"]}),e.jsx("div",{className:"w-[200px]",children:e.jsx($,{completed:p,total:l})})]})]})}const Ne={not_started:"Pending",pending:"Pending",exploring:"Explore",planning:"Plan",executing:"Execute",verifying:"Verify",testing:"Test",completed:"Done",blocked:"Blocked"};function q(t){return t==="completed"}function G(t){return t==="executing"}function we(t){return q(t)||G(t)?1:t==="verifying"||t==="testing"||t==="planning"?.7:t==="exploring"?.5:.4}function ke({phases:t}){return e.jsx("div",{className:"flex items-center gap-0 px-[var(--spacing-6)] py-[var(--spacing-4)] border-b border-border bg-bg-primary overflow-x-auto shrink-0",children:t.map((s,a)=>{const n=h[s.status],i=q(s.status),x=G(s.status),r=we(s.status);return e.jsxs("div",{className:"contents",children:[e.jsxs("div",{className:"flex flex-col items-center gap-1 shrink-0 cursor-pointer group",children:[e.jsxs("div",{className:"relative w-[42px] h-[42px] rounded-[12px] flex items-center justify-center text-[length:var(--font-size-sm)] font-bold text-white transition-transform duration-200 group-hover:scale-110",style:{backgroundColor:n,opacity:r},children:[i?e.jsx(A,{size:18,strokeWidth:2.5}):s.phase,x&&e.jsx("span",{className:"absolute -inset-1 rounded-[14px] border-2 animate-pulse opacity-30",style:{borderColor:n}})]}),e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] max-w-[80px] text-center truncate text-text-tertiary",style:x?{color:n,fontWeight:700}:void 0,children:s.title}),e.jsx("span",{className:"text-[8px] font-[var(--font-weight-semibold)] uppercase tracking-wide px-[5px] py-px rounded-full",style:{backgroundColor:`color-mix(in srgb, ${n} 12%, transparent)`,color:n},children:Ne[s.status]})]}),a<t.length-1&&e.jsxs("div",{className:"relative w-10 h-0.5 shrink-0 mb-[22px]",children:[e.jsx("div",{className:"absolute inset-0 bg-border"}),i&&e.jsx("div",{className:"absolute top-0 left-0 h-full rounded-sm",style:{width:"100%",backgroundColor:"var(--color-status-completed)"}}),!i&&e.jsx("div",{className:"absolute -right-px -top-[3px] border-[3px] border-transparent border-l-[5px] border-l-border"})]})]},s.phase)})})}const Ce={not_started:"/maestro-analyze {N}",pending:"/maestro-analyze {N}",exploring:"/maestro-plan {N}",planning:"/maestro-execute {N}",executing:"/maestro-execute {N}",verifying:"/quality-review {N}",testing:"/quality-test {N}",completed:"/maestro-phase-transition",blocked:"/quality-debug"};function ze(t){const s=t.filter(a=>a.status!=="completed"&&a.status!=="blocked");return s.length===0?null:s.reduce((a,n)=>n.phase<a.phase?n:a,s[0])}function Se({phase:t}){const[s,a]=v.useState(!1),n=v.useRef(null);if(v.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),!t)return e.jsx("div",{className:"text-[length:var(--font-size-sm)] text-text-tertiary italic text-center py-[var(--spacing-6)]",children:"All phases complete"});const x=(Ce[t.status]??"").replace("{N}",String(t.phase)),r=h[t.status];function l(){navigator.clipboard.writeText(x).then(()=>{a(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>a(!1),2e3)})}return e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-2)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2-5)] mb-[var(--spacing-2)]",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] flex items-center justify-center text-[length:var(--font-size-base)] font-bold text-white shrink-0",style:{backgroundColor:r},children:t.phase}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-bold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"inline-block text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full mt-px",style:{backgroundColor:`${r}1a`,color:r},children:t.status.replace(/_/g," ").replace(/\b\w/g,p=>p.toUpperCase())})]})]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("code",{className:"flex-1 font-mono bg-bg-primary border border-border-divider rounded px-[var(--spacing-1-5)] py-[var(--spacing-0-5)] text-[length:var(--font-size-xs)] text-text-primary truncate",children:x}),e.jsx("button",{type:"button",onClick:l,className:"shrink-0 cursor-pointer text-text-tertiary hover:text-text-primary transition-colors text-[length:var(--font-size-xs)]",children:s?"Copied!":"Copy"})]})]})}function _e(){const t=j(a=>{var n;return((n=a.board)==null?void 0:n.phases)??[]}),s=t.find(a=>a.status==="executing")??null;return e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-r-border-divider border-b border-b-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx(ie,{size:14,strokeWidth:2,className:"text-text-tertiary"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:"Active Execution"}),s&&s.execution.current_wave>0&&e.jsxs("span",{className:"ml-auto text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full",style:{backgroundColor:"rgba(184, 149, 64, 0.12)",color:h.executing},children:["Wave ",s.execution.current_wave]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)]",children:s?e.jsx(Pe,{phase:s}):e.jsx(Se,{phase:ze(t)})})]})}function Pe({phase:t}){const{tasks_completed:s,tasks_total:a,current_wave:n}=t.execution,i=a>0?Math.round(s/a*100):0,x=h[t.status];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2-5)] mb-[var(--spacing-3)]",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] flex items-center justify-center text-[length:var(--font-size-base)] font-bold text-white",style:{backgroundColor:x},children:t.phase}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[length:var(--font-size-base)] font-bold text-text-primary",children:t.title}),t.goal&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:t.goal})]})]}),e.jsxs("div",{className:"mb-[var(--spacing-3-5)]",children:[e.jsx("div",{className:"h-1.5 bg-border rounded-full overflow-hidden mb-1",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500 ease-out",style:{width:`${i}%`,backgroundColor:"var(--color-status-completed)"}})}),e.jsxs("div",{className:"flex justify-between text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsxs("span",{children:[s," of ",a," tasks complete"]}),e.jsxs("span",{children:[i,"%"]})]})]}),n>0&&e.jsxs("div",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-secondary mb-[var(--spacing-1-5)]",children:["Wave ",n]}),t.plan.task_ids.length>0&&e.jsx("div",{className:"flex flex-col gap-1",children:t.plan.task_ids.map(r=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-2-5)] py-[var(--spacing-1-5)] rounded-[var(--radius-md)] bg-bg-primary border border-border-divider text-[length:var(--font-size-sm)]",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full shrink-0 bg-text-quaternary"}),e.jsx("span",{className:"flex-1 text-text-primary font-[var(--font-weight-medium)] truncate",children:r}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-quaternary",children:r})]},r))})]})}const Te={not_started:"Not Started",pending:"Pending",exploring:"Exploring",planning:"Planning",executing:"Executing",verifying:"Verifying",testing:"Testing",completed:"Completed",blocked:"Blocked"};function Ee(){const t=j(s=>{var a;return((a=s.board)==null?void 0:a.phases)??[]});return e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-r-border-divider border-b border-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx(F,{size:14,strokeWidth:2,className:"text-text-tertiary"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:"Phase Queue"}),e.jsxs("span",{className:"ml-auto text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full bg-border-subtle text-text-secondary",children:[t.length," phases"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)]",children:t.map(s=>{const a=h[s.status],{tasks_completed:n,tasks_total:i,current_wave:x}=s.execution,r=i>0?Math.round(n/i*100):0,l=s.status==="executing",p=s.status==="completed";let o=Te[s.status];return l&&x>0&&(o+=` -- Wave ${x}`),s.verification.gaps.length>0&&(o+=` -- ${s.verification.gaps.length} gap(s)`),e.jsxs("div",{className:["flex items-center gap-[var(--spacing-2-5)] px-[var(--spacing-2-5)] py-[var(--spacing-2)] rounded-[var(--radius-md)] cursor-pointer transition-all duration-150 mb-0.5",l?"bg-[var(--color-tint-executing)]":"hover:bg-bg-primary"].join(" "),children:[e.jsx("div",{className:"w-6 h-6 rounded-[7px] flex items-center justify-center text-[length:var(--font-size-xs)] font-bold text-white shrink-0",style:{backgroundColor:a},children:p?e.jsx(A,{size:12,strokeWidth:2.5}):s.phase}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary truncate",children:s.title}),e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",style:l?{color:a}:void 0,children:o})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsxs("div",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] font-mono text-text-tertiary",style:p?{color:a}:void 0,children:[n,"/",i]}),e.jsx("div",{className:"w-10 h-[3px] bg-border rounded-full overflow-hidden mt-0.5",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${r}%`,backgroundColor:a}})})]})]},s.phase)})})]})}function $e(){const t=j(o=>o.board),s=(t==null?void 0:t.phases)??[],a=s.reduce((o,c)=>o+c.execution.tasks_completed,0),n=s.reduce((o,c)=>o+c.execution.tasks_total,0),i=s.filter(o=>o.status==="completed").length,x=s.length,r=s.reduce((o,c)=>o+c.execution.commits.length,0),l=s.filter(o=>o.status==="verifying"||o.status==="testing"),p=s.flatMap(o=>o.verification.gaps.map(c=>({phase:o.phase,text:typeof c=="string"?c:c.description??c.id??JSON.stringify(c)})));return e.jsxs("div",{className:"flex flex-col overflow-hidden border-b border-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx(O,{size:14,strokeWidth:2,className:"text-text-tertiary"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:"Quality"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)]",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-[var(--spacing-2)] mb-[var(--spacing-3-5)]",children:[e.jsx(C,{label:"Tasks",value:a,sub:`/${n}`,detail:`${n>0?Math.round(a/n*100):0}% complete`}),e.jsx(C,{label:"Phases",value:i,sub:`/${x}`,detail:`${x>0?Math.round(i/x*100):0}% complete`}),e.jsx(C,{label:"Gaps",value:p.length,color:p.length>0?h.blocked:void 0,detail:"active"}),e.jsx(C,{label:"Commits",value:r,detail:"this milestone"})]}),l.length>0&&e.jsx("div",{className:"mb-[var(--spacing-3-5)]",children:l.map(o=>e.jsxs("div",{className:"mb-[var(--spacing-3)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-secondary mb-[var(--spacing-1-5)]",children:[e.jsx(O,{size:12,strokeWidth:2,style:{color:h[o.status]}}),"Verification (P-",String(o.phase).padStart(2,"0"),")"]}),o.verification.must_haves.map((c,m)=>{const b=o.verification.gaps.map(d=>typeof d=="string"?d:d.description??d.id??"").includes(c);return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] py-1 border-b border-border-divider text-[length:var(--font-size-sm)]",children:[b?e.jsx(ae,{size:12,strokeWidth:2.5,style:{color:h.blocked}}):e.jsx(A,{size:12,strokeWidth:2.5,style:{color:h.completed}}),e.jsx("span",{className:"flex-1 text-text-secondary",children:c}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)]",style:{color:b?h.blocked:h.completed},children:b?"Gap":"Verified"})]},m)})]},o.phase))}),s.some(o=>o.validation.test_coverage!==null)&&e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-secondary mb-[var(--spacing-1-5)]",children:"Test Coverage"}),s.filter(o=>o.validation.test_coverage!==null).map(o=>{const c=o.validation.test_coverage,m=typeof c=="number"?c:typeof c=="object"&&c!==null?c.statements??0:0,y=m>=80?h.completed:m>=60?h.executing:h.verifying;return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-[length:var(--font-size-xs)] mb-1",children:[e.jsxs("span",{className:"w-[70px] text-text-tertiary font-[var(--font-weight-medium)]",children:["P-",String(o.phase).padStart(2,"0")]}),e.jsx("div",{className:"flex-1 h-1.5 bg-border rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${m}%`,backgroundColor:y}})}),e.jsxs("span",{className:"w-9 text-right font-mono font-[var(--font-weight-semibold)] text-text-secondary",children:[m.toFixed(1),"%"]})]},o.phase)})]})]})]})}function C({label:t,value:s,sub:a,detail:n,color:i}){return e.jsxs("div",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] rounded-[10px] bg-bg-primary border border-border-divider",children:[e.jsx("div",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wide text-text-tertiary mb-1",children:t}),e.jsxs("div",{className:"text-[length:var(--font-size-xl)] font-bold text-text-primary",style:i?{color:i}:void 0,children:[s,a&&e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-tertiary",children:a})]}),e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary mt-0.5",children:n})]})}function Ae(t){const s=[];for(const a of t){const n=h[a.status],i=`P-${String(a.phase).padStart(2,"0")} ${a.title}`;a.status==="executing"&&a.execution.current_wave>0&&s.push({color:n,time:"",text:`Wave ${a.execution.current_wave} active -- ${i}`}),a.status==="verifying"&&a.verification.gaps.length>0&&s.push({color:h.blocked,time:"",text:`${a.verification.gaps.length} gap(s) -- ${i}`}),a.status==="completed"&&s.push({color:n,time:"",text:`Completed -- ${i}`})}return s.slice(0,6)}function Le(){const t=j(a=>{var n;return((n=a.board)==null?void 0:n.phases)??[]}),s=Ae(t);return s.length===0?null:e.jsxs("div",{className:"col-span-full flex items-center gap-[var(--spacing-4)] px-[var(--spacing-4)] py-[var(--spacing-2)] border-t border-border bg-bg-secondary overflow-x-auto shrink-0",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-quaternary whitespace-nowrap",children:"Activity"}),s.map((a,n)=>e.jsxs("span",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] text-text-secondary whitespace-nowrap shrink-0",children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full shrink-0",style:{backgroundColor:a.color}}),a.text,n<s.length-1&&e.jsx("span",{className:"inline-block w-px h-3.5 bg-border-divider ml-[var(--spacing-4)]"})]},n))]})}function We(){const t=j(s=>{var a;return((a=s.board)==null?void 0:a.phases)??[]});return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(ke,{phases:t}),e.jsxs("div",{className:"flex-1 grid grid-cols-[1fr_1fr_320px] grid-rows-[1fr_auto] overflow-hidden",children:[e.jsx(_e,{}),e.jsx(Ee,{}),e.jsx($e,{}),e.jsx(Le,{})]})]})}const w="text-left px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-tertiary uppercase tracking-wide",D={pending:"var(--color-status-pending)",in_progress:"var(--color-status-executing)",completed:"var(--color-status-completed)",failed:"var(--color-status-blocked)"},Oe={pending:"Queued",in_progress:"Running",completed:"Done",failed:"Failed"};function Be({phaseId:t,onSelectTask:s}){const{tasks:a,loading:n}=E(t);return n?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-[var(--spacing-6)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] text-text-tertiary",children:"Loading tasks..."})}):a.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-[var(--spacing-6)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] text-text-tertiary",children:"No tasks"})}):e.jsx(e.Fragment,{children:a.map(i=>e.jsxs("tr",{className:"bg-[rgba(0,0,0,0.03)] border-t border-border-divider cursor-pointer hover:bg-bg-hover transition-colors",onClick:()=>s==null?void 0:s({type:"task",task:i,phaseId:t}),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] pl-[var(--spacing-6)]",children:e.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{backgroundColor:D[i.meta.status]??"var(--color-status-pending)"}})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:i.id}),e.jsx("td",{colSpan:2,className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] text-text-primary",children:i.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-center hidden sm:table-cell",children:e.jsxs("span",{className:"text-[length:10px] text-text-tertiary tabular-nums",children:["W",i.meta.wave]})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-right hidden sm:table-cell",children:e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-medium)]",style:{color:D[i.meta.status]??"var(--color-text-tertiary)"},children:Oe[i.meta.status]??i.meta.status})})]},i.id))})}function Ie({onSelectTask:t}){const s=j(r=>{var l;return((l=r.board)==null?void 0:l.phases)??[]}),[a,n]=v.useState(new Set),i=v.useMemo(()=>[...s].sort((r,l)=>r.phase-l.phase),[s]);function x(r){n(l=>{const p=new Set(l);return p.has(r)?p.delete(r):p.add(r),p})}return i.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No phases available"}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-3)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0 bg-bg-secondary",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary",children:"All Phases"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-card rounded-full px-[var(--spacing-1-5)] tabular-nums",children:i.length}),e.jsx("div",{className:"ml-auto flex items-center gap-[var(--spacing-3)]",children:["executing","verifying","planning","completed"].map(r=>{const l=i.filter(p=>p.status===r||r==="verifying"&&p.status==="testing").length;return l===0?null:e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:h[r]}}),e.jsx("span",{className:"text-[length:10px] text-text-secondary tabular-nums",children:l})]},r)})})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:"sticky top-0 z-10",children:e.jsxs("tr",{className:"bg-bg-secondary border-b border-border-divider",children:[e.jsx("th",{className:`${w} w-[60px]`,children:"#"}),e.jsx("th",{className:`${w} w-[120px]`,children:"Status"}),e.jsx("th",{className:w,children:"Title"}),e.jsx("th",{className:`${w} hidden lg:table-cell`,children:"Goal"}),e.jsx("th",{className:`${w} w-[60px] text-center hidden sm:table-cell`,children:"Wave"}),e.jsx("th",{className:`${w} text-right w-[130px] hidden sm:table-cell`,children:"Progress"})]})}),e.jsx("tbody",{children:i.map((r,l)=>{const{tasks_completed:p,tasks_total:o,current_wave:c}=r.execution,m=a.has(r.phase),y=r.plan.task_count>0;return e.jsxs(v.Fragment,{children:[e.jsxs("tr",{className:["border-t border-border-divider transition-colors",l%2===0?"bg-bg-primary":"bg-[rgba(0,0,0,0.015)]"].join(" "),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] font-mono text-text-tertiary whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[y&&e.jsx("button",{type:"button",onClick:()=>x(r.phase),className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors","aria-label":m?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${m?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}),"P-",String(r.phase).padStart(2,"0")]})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(T,{status:r.status,cardVariant:!0})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary",children:r.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary hidden lg:table-cell max-w-[320px]",children:e.jsx("span",{className:"line-clamp-1",children:r.goal})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-center hidden sm:table-cell",children:r.status==="executing"&&c>0?e.jsxs("span",{className:"text-[length:10px] font-[var(--font-weight-semibold)] tabular-nums",style:{color:h.executing},children:["W",c]}):e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:"—"})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] hidden sm:table-cell",children:o>0?e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] justify-end",children:[e.jsx("div",{className:"w-[56px]",children:e.jsx($,{completed:p,total:o,color:h[r.status]})}),e.jsxs("span",{className:"text-[length:10px] text-text-tertiary tabular-nums w-[32px] text-right shrink-0",children:[p,"/",o]})]}):e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary block text-right",children:"—"})})]}),m&&e.jsx(Be,{phaseId:r.phase,onSelectTask:t})]},r.phase)})})]})})]})}const M=[{id:"init",label:"Initialize Project",command:"/maestro-init",description:"Set up project configuration and workspace",done:t=>!!(t!=null&&t.project_name&&t.project_name!=="")},{id:"roadmap",label:"Create Roadmap",command:"/maestro-roadmap",description:"Define phases and milestones for your project",done:t=>!1},{id:"plan",label:"Plan Phase 1",command:"/maestro-plan 1",description:"Create execution plan for the first phase",done:t=>!1}];function Re({project:t}){var x;const[s,a]=v.useState(null),n=((x=M.find(r=>!r.done(t)))==null?void 0:x.id)??null;function i(r){navigator.clipboard.writeText(r.command).catch(()=>{}),a(r.id),setTimeout(()=>a(l=>l===r.id?null:l),2e3)}return e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)] px-[var(--spacing-6)] py-[var(--spacing-6)] h-full overflow-y-auto",children:[e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-1)]",children:[e.jsx("h2",{className:"text-[length:var(--font-size-lg)] font-bold text-text-primary",children:"Project Setup"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-tertiary",children:"Run these commands to initialize your project"})]}),e.jsx("div",{className:"flex flex-col gap-[var(--spacing-3)]",children:M.map(r=>{const l=r.done(t),p=r.id===n,o=l?"rounded-[var(--radius-lg)] border border-border-divider bg-bg-primary p-[var(--spacing-4)] opacity-60":p?"rounded-[var(--radius-lg)] border border-border-focus bg-bg-secondary p-[var(--spacing-4)]":"rounded-[var(--radius-lg)] border border-border-divider bg-bg-primary p-[var(--spacing-4)]";return e.jsx("div",{className:o,children:e.jsxs("div",{className:"flex items-start gap-[var(--spacing-3)]",children:[e.jsx("div",{className:"flex-shrink-0 mt-[var(--spacing-0-5)]",children:l?e.jsx("span",{className:"text-[#5A9E78] text-[length:var(--font-size-base)] font-bold leading-none",children:"✓"}):e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-base)] leading-none",children:"○"})}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:r.label}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-tertiary",children:r.description}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("code",{className:"font-mono text-[length:var(--font-size-sm)] bg-bg-primary border border-border-divider rounded px-[var(--spacing-2)] py-[var(--spacing-0-5)] text-text-primary",children:r.command}),e.jsx("button",{type:"button",onClick:()=>i(r),className:"cursor-pointer text-text-tertiary hover:text-text-primary text-[length:var(--font-size-sm)] transition-colors",children:s===r.id?"Copied!":"Copy"})]})]})]})},r.id)})})]})}const U=["board","timeline","center","table"];function Qe(){const[t,s]=v.useState("board"),[a,n]=v.useState(null),{register:i,unregister:x}=v.useContext(J),{phases:r,board:l,selectedPhase:p,setSelectedPhase:o}=j(Z(u=>{var g;return{phases:((g=u.board)==null?void 0:g.phases)??[],board:u.board,selectedPhase:u.selectedPhase,setSelectedPhase:u.setSelectedPhase}})),c=v.useCallback(u=>{s(U[u]),o(null),n(null)},[o]),m=v.useCallback(u=>{n(u),o(null)},[o]),y=v.useMemo(()=>({items:[{label:"Board",icon:e.jsx(re,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Timeline",icon:e.jsx(F,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Center",icon:e.jsx(Y,{size:14,strokeWidth:2}),shortcut:"3"},{label:"Table",icon:e.jsx(ee,{size:14,strokeWidth:2}),shortcut:"4"}],activeIndex:U.indexOf(t),onSwitch:c}),[t,c]);v.useEffect(()=>{i(y)},[y,i]),v.useEffect(()=>()=>x(),[x]);const b=a??(p!==null?{type:"phase",phaseId:p}:null),d=b!==null,f=(b==null?void 0:b.type)==="task"?"Task Detail":"Phase Detail";return e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:r.length===0?e.jsx(Re,{project:l==null?void 0:l.project}):e.jsxs(e.Fragment,{children:[t==="board"&&e.jsx(he,{onSelectTask:m}),t==="timeline"&&e.jsx(je,{onSelectPhase:u=>{n(null),o(p===u?null:u)},onSelectTask:m}),t==="center"&&e.jsx(We,{}),t==="table"&&e.jsx(Ie,{onSelectTask:m})]})}),e.jsx(te,{open:d,onClose:()=>{o(null),n(null)},title:f,children:b!==null&&e.jsx(se,{selectedItem:b})})]})})}export{Qe as WorkflowPage};
|