maestro-flow 0.3.7 → 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 +303 -0
- 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 -96
- package/.claude/commands/maestro-fork.md +111 -0
- package/.claude/commands/maestro-init.md +6 -6
- package/.claude/commands/maestro-learn.md +74 -298
- 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 +23 -17
- package/.claude/commands/manage-memory-capture.md +15 -17
- package/.claude/commands/manage-memory.md +3 -3
- 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 +7 -7
- 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 +8 -3
- package/.claude/commands/spec-setup.md +5 -5
- package/.claude/commands/wiki-connect.md +3 -3
- package/.claude/commands/wiki-digest.md +30 -5
- 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 +115 -227
- package/README.zh-CN.md +169 -187
- 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-A9yzYtpj.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-CCXHaut3.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-CEOvppGn.js → RequirementBoardPage-Bf1trzqs.js} +2 -2
- package/dashboard/dist/assets/{RequirementPage-DpnbTEqY.js → RequirementPage-Bllxe2XI.js} +10 -5
- package/dashboard/dist/assets/{SpecsPage-CYqOfFkB.js → SpecsPage-9lwxKT27.js} +2 -2
- package/dashboard/dist/assets/{SupervisorPage-B2sZwkq8.js → SupervisorPage-SusdfHFq.js} +1 -1
- package/dashboard/dist/assets/{TeamsPage-CkZdCAVZ.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-6fktHyjN.js → arrow-left-Bqtb2hle.js} +1 -1
- package/dashboard/dist/assets/{check-Cbxq2l1-.js → check-u6fGOwQO.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-Yts3bi8p.js → chevron-right-Csu22t58.js} +1 -1
- package/dashboard/dist/assets/{circle-4Ci4Xolf.js → circle-CMrkbRNg.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-B25g9BTL.js → circle-alert-c3tH1P4z.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-DzO2BlL7.js → circle-check-big-TDSeWstm.js} +1 -1
- package/dashboard/dist/assets/{circle-check-BA5_XqeV.js → circle-check-gYxxSYuH.js} +1 -1
- package/dashboard/dist/assets/{code-zxwuybO8.js → code-CFN2uX9V.js} +1 -1
- package/dashboard/dist/assets/{columns-3-DV4oeCfU.js → columns-3-38xIDlzy.js} +1 -1
- package/dashboard/dist/assets/{download-CXCyQw8M.js → download-DC7KkKyP.js} +1 -1
- package/dashboard/dist/assets/{folder-Bvjj8Vn9.js → folder-CWq_lAnf.js} +1 -1
- package/dashboard/dist/assets/index-DWG-WrzT.js +231 -0
- package/dashboard/dist/assets/{index-BvScJmJM.js → index-Do71weNR.js} +1 -1
- package/dashboard/dist/assets/index-GUNJodSR.css +1 -0
- package/dashboard/dist/assets/{list-Dj4i9N75.js → list-CgIP_2A-.js} +1 -1
- package/dashboard/dist/assets/{minus-DwlFabsT.js → minus-DYoN5UGk.js} +1 -1
- package/dashboard/dist/assets/{pen-line-D7UzECt6.js → pen-line-Bh_WKYHm.js} +1 -1
- package/dashboard/dist/assets/{proxy-B9XRqHD9.js → proxy-BKxDAKTj.js} +1 -1
- package/dashboard/dist/assets/{search-BQbBTIYl.js → search-SieXnOgr.js} +1 -1
- package/dashboard/dist/assets/{shallow-Clb1Lyd_.js → shallow-Bme1JY57.js} +1 -1
- package/dashboard/dist/assets/{table-BqxCXid2.js → table-llyEtj-7.js} +1 -1
- package/dashboard/dist/assets/terminal-BB3Xfuv5.js +6 -0
- package/dashboard/dist/assets/{trash-2-6rN9B-EQ.js → trash-2-C8f4vFFM.js} +1 -1
- package/dashboard/dist/assets/{zap-DxUhG-gk.js → zap-4uwlzVm0.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js +5 -4
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js.map +1 -1
- 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/agents/tools/issue-mcp-server.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js +3 -4
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js +4 -4
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js +4 -3
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js +20 -7
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js +4 -4
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/index.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/index.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/issues.js +14 -14
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/linear.js +7 -5
- package/dashboard/dist-server/dashboard/src/server/routes/linear.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 +186 -25
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.d.ts +6 -0
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js +24 -2
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js +4 -7
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.test.js +5 -5
- package/dashboard/dist-server/dashboard/src/shared/constants.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js +4 -4
- package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js.map +1 -1
- package/dashboard/dist-server/src/commands/delegate.js +7 -1
- package/dashboard/dist-server/src/commands/delegate.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/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +7 -1
- package/dist/src/commands/delegate.js.map +1 -1
- 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/delegate-usage.md +39 -41
- package/workflows/execute.md +247 -61
- package/workflows/fork.md +309 -0
- package/workflows/init.md +11 -2
- package/workflows/issue.md +66 -7
- package/workflows/maestro-coordinate.codex.md +1 -1
- package/workflows/maestro-coordinate.md +24 -17
- package/workflows/maestro.md +54 -37
- package/workflows/memory.md +2 -1
- package/workflows/merge.md +285 -0
- package/workflows/milestone-audit.md +89 -70
- package/workflows/milestone-complete.md +89 -156
- package/workflows/plan.md +131 -19
- package/workflows/retrospective.md +5 -5
- package/workflows/roadmap.md +12 -4
- 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/learn-retro-decision.md +0 -198
- package/.claude/commands/learn-retro-git.md +0 -160
- 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-PuCvZZ3y.js +0 -67
- package/dashboard/dist/assets/ChatPage-v19GURYH.js +0 -8
- package/dashboard/dist/assets/CollabPage-I5k_mCbG.js +0 -1
- package/dashboard/dist/assets/KanbanPage-PDDBv5-9.js +0 -16
- package/dashboard/dist/assets/McpPage-CiqXpCHg.js +0 -16
- package/dashboard/dist/assets/TreeBrowser-0VIMWclo.js +0 -11
- package/dashboard/dist/assets/WorkflowPage-Csm23wUS.js +0 -6
- package/dashboard/dist/assets/git-branch-DL8p9kVC.js +0 -6
- package/dashboard/dist/assets/index-11DuhKhc.js +0 -231
- package/dashboard/dist/assets/index-D2Mtyw7I.css +0 -1
- package/dashboard/dist/assets/wrench-BScEJFqC.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,16 +0,0 @@
|
|
|
1
|
-
import{d as re,o as ge,D as E,j as e,r as y,X as ve,G as q,w as se,R as ye,P as je,O as Ne,f as we,T as Ce,h as ke,i as B,V as Me,n as Le}from"./index-11DuhKhc.js";import{L as Oe}from"./list-Dj4i9N75.js";import{T as oe,W as De}from"./wrench-BScEJFqC.js";import{S as ae}from"./search-BQbBTIYl.js";import{T as Se}from"./trash-2-6rN9B-EQ.js";import{C as Ee}from"./chevron-right-Yts3bi8p.js";import{F as Ae,a as Ie,D as We}from"./folder-Bvjj8Vn9.js";import{D as Te}from"./download-CXCyQw8M.js";import{m as M}from"./proxy-B9XRqHD9.js";import{P as Pe}from"./pen-line-D7UzECt6.js";import{A as Be}from"./index-BvScJmJM.js";import{C as Re}from"./check-Cbxq2l1-.js";import{C as _e}from"./code-zxwuybO8.js";import{M as Fe}from"./minus-DwlFabsT.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 Ge=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ze=re("chevron-left",Ge);/**
|
|
7
|
-
* @license lucide-react v0.577.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Ve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],K=re("globe",Ve);/**
|
|
12
|
-
* @license lucide-react v0.577.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const $e=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Je=re("package",$e);function Ye(t,o,r){return t==="project"&&r?`project:${o}@${r}`:`${t}:${o}`}function He(t){const o=[],r=t.globalServers??{},n=t.projects??{},a=t.enterpriseServers??{},i=t.codex;for(const[d,m]of Object.entries(r))o.push(Y(d,m,"global"));for(const[d,m]of Object.entries(n)){const b=m.mcpServers??{},l=m.disabledMcpServers??[];for(const[x,p]of Object.entries(b))o.push({...Y(x,p,"project",d),enabled:!l.includes(x)})}for(const[d,m]of Object.entries(a))o.push({...Y(d,m,"enterprise"),enabled:!0});if(i!=null&&i.servers)for(const[d,m]of Object.entries(i.servers)){const b=o.find(l=>l.name===d&&l.scope==="global");b?b.cli.codex=!0:o.push({...Y(d,m,"codex"),cli:{claude:!1,codex:!0}})}return o}function Y(t,o,r,n){const a=typeof o.url=="string";return{id:Ye(r,t,n),name:t,scope:r,projectPath:n,enabled:o.enabled!==!1,transport:a?"http":"stdio",command:typeof o.command=="string"?o.command:void 0,args:Array.isArray(o.args)?o.args:void 0,url:a?o.url:void 0,env:typeof o.env=="object"&&o.env!==null?o.env:void 0,cli:{claude:r!=="codex",codex:r==="codex"},raw:o}}const f=ge((t,o)=>({servers:[],templates:[],categories:[],loading:!1,error:null,activeView:"list",scopeFilter:"all",search:"",selectedServer:null,templateSearch:"",templateCategory:null,editingServer:null,setActiveView:r=>t({activeView:r}),setScopeFilter:r=>t({scopeFilter:r}),setSearch:r=>t({search:r}),setSelectedServer:r=>t({selectedServer:r}),setTemplateSearch:r=>t({templateSearch:r}),setTemplateCategory:r=>t({templateCategory:r}),setEditingServer:r=>t({editingServer:r}),fetchConfig:async()=>{t({loading:!0,error:null});try{const r=await fetch(E.CONFIG);if(!r.ok)throw new Error(`Failed: ${r.status}`);const n=await r.json();t({servers:He(n),loading:!1})}catch(r){t({loading:!1,error:String(r)})}},fetchTemplates:async()=>{try{const[r,n]=await Promise.all([fetch(E.TEMPLATES),fetch(E.TEMPLATES_CATEGORIES)]);if(!r.ok||!n.ok)return;const a=await r.json(),i=await n.json();t({templates:a.templates??[],categories:i.categories??[]})}catch{}},toggleServer:async(r,n,a)=>{t(i=>({servers:i.servers.map(d=>d.name===n?{...d,enabled:a}:d)}));try{await fetch(E.TOGGLE,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:r,serverName:n,enable:a})})}catch{o().fetchConfig()}},removeServer:async(r,n)=>{const a=o().servers;t(i=>({servers:i.servers.filter(d=>d.name!==n)}));try{(await fetch(E.REMOVE_SERVER,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:r,serverName:n})})).ok||t({servers:a})}catch{t({servers:a})}},addGlobalServer:async(r,n)=>{try{await fetch(E.ADD_GLOBAL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverName:r,serverConfig:n})}),o().fetchConfig()}catch{}},removeGlobalServer:async r=>{const n=o().servers;t(a=>({servers:a.servers.filter(i=>i.name!==r)}));try{(await fetch(E.REMOVE_GLOBAL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverName:r})})).ok||t({servers:n})}catch{t({servers:n})}},updateServer:async(r,n)=>{try{await fetch(E.UPDATE_SERVER,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:r.scope,serverName:r.name,serverConfig:n,projectPath:r.projectPath})}),t({editingServer:null}),o().fetchConfig()}catch{}},installTemplate:async(r,n,a)=>{try{await fetch(E.TEMPLATES_INSTALL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateName:r,projectPath:n,scope:a})}),o().fetchConfig()}catch{}},filteredServers:()=>{const{servers:r,scopeFilter:n,search:a}=o();let i=r;if(n!=="all"&&(i=i.filter(d=>d.scope===n)),a){const d=a.toLowerCase();i=i.filter(m=>{var b,l;return m.name.toLowerCase().includes(d)||(((b=m.command)==null?void 0:b.toLowerCase().includes(d))??!1)||(((l=m.url)==null?void 0:l.toLowerCase().includes(d))??!1)})}return i},filteredTemplates:()=>{const{templates:r,templateSearch:n,templateCategory:a}=o();let i=r;if(a&&(i=i.filter(d=>d.category===a)),n){const d=n.toLowerCase();i=i.filter(m=>{var b;return m.name.toLowerCase().includes(d)||(((b=m.description)==null?void 0:b.toLowerCase().includes(d))??!1)})}return i},projectGroups:()=>{const{servers:r}=o(),n=new Map;for(const i of r){const d=i.projectPath??null,m=n.get(d)??[];m.push(i),n.set(d,m)}const a=[];for(const[i,d]of n)a.push({projectPath:i,servers:d});return a},selectedEntry:()=>{const{servers:r,selectedServer:n}=o();return n?r.find(a=>a.id===n)??null:null}}));function G({size:t=14,className:o,style:r}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:o,style:r,children:e.jsx("path",{d:"M17.304 3.541l-5.15 16.918H9.29l5.15-16.918zm-9.757 10.3l-2.1 3.613H2.131l3.256-5.576zm2.74-7.354L6.41 13.49l-2.037-3.5L8.052 3.54z"})})}function V({size:t=14,className:o,style:r}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:o,style:r,children:e.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.14-.08 4.779-2.759a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.07.07 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.677l5.815 3.354-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.124 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.41-.676zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zM8.307 12.863l-2.02-1.164a.08.08 0 0 1-.038-.057V6.074a4.5 4.5 0 0 1 7.375-3.453l-.14.08-4.779 2.758a.795.795 0 0 0-.393.681zm1.097-2.361l2.602-1.506 2.607 1.506v3.012l-2.602 1.506-2.607-1.506z"})})}const ne={global:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue, #5B8DB8)"},project:{bg:"rgba(145,120,181,0.12)",text:"var(--color-status-planning, #9178B5)"},enterprise:{bg:"rgba(200,134,58,0.12)",text:"var(--color-status-verifying, #C8863A)"},codex:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed, #5A9E78)"}},le={stdio:{bg:"rgba(91,141,184,0.08)",text:"var(--color-accent-blue, #5B8DB8)"},http:{bg:"rgba(145,120,181,0.08)",text:"var(--color-status-planning, #9178B5)"}};function Ue({server:t,onClose:o}){var x;const r=f(p=>p.removeServer),n=f(p=>p.removeGlobalServer),a=f(p=>p.setEditingServer),i=y.useMemo(()=>t.env?Object.entries(t.env):[],[t.env]),d=y.useMemo(()=>JSON.stringify(t.raw,null,2),[t.raw]),m=ne[t.scope]??ne.global,b=le[t.transport]??le.stdio;function l(){t.scope==="global"?n(t.name):r(t.projectPath??"",t.name),o()}return e.jsxs(M.aside,{initial:{width:0,opacity:0},animate:{width:380,opacity:1},exit:{width:0,opacity:0},transition:{type:"spring",stiffness:400,damping:30},className:"shrink-0 border-l border-border bg-bg-card overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-[10px] px-[18px] py-[14px] border-b border-border-divider shrink-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-[var(--radius-lg)] shrink-0 flex items-center justify-center",style:{background:b.bg,color:b.text},children:t.transport==="stdio"?e.jsx(oe,{size:18,strokeWidth:1.8}):e.jsx(K,{size:18,strokeWidth:1.8})}),e.jsx("span",{className:"text-[15px] font-bold text-text-primary flex-1 min-w-0 truncate",children:t.name}),e.jsx("button",{type:"button",onClick:o,"aria-label":"Close detail panel",className:"flex items-center justify-center w-7 h-7 rounded-[var(--radius-md)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(ve,{size:14,strokeWidth:2})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[18px] py-[16px]",style:{width:380},children:[e.jsxs(_,{label:"Info",children:[e.jsx(H,{label:"Scope",children:e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:m.bg,color:m.text},children:t.scope})}),e.jsx(H,{label:"Transport",children:e.jsx("span",{className:"text-[9px] font-semibold px-[7px] py-[2px] rounded-[4px] uppercase",style:{background:b.bg,color:b.text},children:t.transport})}),e.jsx(H,{label:"Status",children:e.jsxs("span",{className:"text-[12px] font-semibold flex items-center gap-[4px]",style:{color:t.enabled?"var(--color-status-completed, #5A9E78)":"var(--color-text-tertiary)"},children:[e.jsx("span",{className:"w-[7px] h-[7px] rounded-full inline-block",style:{background:t.enabled?"var(--color-status-completed, #5A9E78)":"var(--color-text-tertiary)"}}),t.enabled?"Enabled":"Disabled"]})}),t.projectPath&&e.jsx(H,{label:"Source",children:e.jsx("span",{className:"font-mono text-[11px] text-text-primary break-all",children:t.projectPath})})]}),e.jsxs(_,{label:"CLI Presence",children:[e.jsx(ie,{icon:e.jsx(G,{size:12}),label:"Claude Code",present:t.cli.claude,tintBg:"rgba(200,134,58,0.08)",tintColor:"var(--color-status-verifying, #C8863A)"}),e.jsx(ie,{icon:e.jsx(V,{size:12}),label:"Codex CLI",present:t.cli.codex,tintBg:"rgba(90,158,120,0.08)",tintColor:"var(--color-status-completed, #5A9E78)"})]}),e.jsx(_,{label:"Command",children:e.jsx("div",{className:"bg-bg-secondary border border-border-divider rounded-[var(--radius-lg)] px-3 py-[10px] font-mono text-[11px] text-text-primary leading-[1.7] whitespace-pre-wrap break-all",children:t.command?`${t.command}${(x=t.args)!=null&&x.length?" "+t.args.join(" "):""}`:t.url??"(no command)"})}),i.length>0&&e.jsx(_,{label:"Environment",children:e.jsx("div",{className:"bg-bg-secondary border border-border-divider rounded-[var(--radius-lg)] overflow-hidden",children:e.jsx("table",{className:"w-full border-collapse",children:e.jsx("tbody",{children:i.map(([p,s])=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-2 py-1 text-[11px] font-mono font-medium whitespace-nowrap border-b border-border-divider",style:{color:"var(--color-accent-blue, #5B8DB8)"},children:p}),e.jsx("td",{className:"px-2 py-1 text-[11px] font-mono text-text-secondary break-all border-b border-border-divider",children:s})]},p))})})})}),e.jsx(_,{label:"Raw Config",children:e.jsx("div",{className:"rounded-[var(--radius-lg)] px-3 py-[10px] font-mono text-[11px] leading-[1.7] whitespace-pre-wrap break-all",style:{background:"var(--color-code-bg, #2C2723)",color:"var(--color-code-text, #D9D0C4)",border:"1px solid var(--color-code-border, #3D3731)"},children:d})})]}),e.jsxs("div",{className:"flex gap-[6px] px-[18px] py-3 border-t border-border-divider shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>a(t),className:"flex-1 flex items-center justify-center gap-[4px] px-[10px] py-[5px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-text-secondary hover:border-text-tertiary hover:text-text-primary transition-all",children:[e.jsx(Pe,{size:11,strokeWidth:2}),"Edit"]}),e.jsxs("button",{type:"button",onClick:l,className:"flex-1 flex items-center justify-center gap-[4px] px-[10px] py-[5px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-status-failed hover:border-status-failed hover:bg-red-50 transition-all",children:[e.jsx(Se,{size:11,strokeWidth:2}),"Remove"]})]})]})}function _({label:t,children:o}){return e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.05em] text-text-tertiary mb-[6px]",children:t}),o]})}function H({label:t,children:o}){return e.jsxs("div",{className:"flex items-center gap-2 py-[3px]",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-secondary min-w-[70px] shrink-0",children:t}),o]})}function ie({icon:t,label:o,present:r,tintBg:n,tintColor:a}){return e.jsxs("div",{className:"flex items-center gap-[10px] px-[10px] py-2 rounded-[var(--radius-md)] mb-1",style:{background:r?n:void 0},children:[e.jsx("div",{className:"w-6 h-[18px] rounded-[4px] flex items-center justify-center",style:{background:n,color:a},children:t}),e.jsx("span",{className:"text-[12px] font-semibold text-text-primary flex-1",children:o}),e.jsx("span",{className:"text-[10px] font-semibold",style:{color:r?"var(--color-status-completed, #5A9E78)":"var(--color-text-tertiary)"},children:r?"Installed":"Not found"})]})}const te=["write_file","edit_file","read_file","read_many_files","team_msg","core_memory"],u=ge((t,o)=>({open:!1,step:"mode",mode:"global",projectPath:"",detection:null,selectedComponents:new Set,backup:!0,mcpEnabled:!0,enabledTools:new Set(te),detecting:!1,installing:!1,result:null,error:null,manifests:[],setOpen:r=>{t(r?{open:r,step:"mode",result:null,error:null,detection:null}:{open:r})},setStep:r=>t({step:r}),setMode:r=>t({mode:r}),setProjectPath:r=>t({projectPath:r}),toggleComponent:r=>t(n=>{const a=new Set(n.selectedComponents);return a.has(r)?a.delete(r):a.add(r),{selectedComponents:a}}),selectAllComponents:()=>t(r=>{if(!r.detection)return{};const n=r.detection.components.filter(a=>a.available).map(a=>a.id);return r.selectedComponents.has("mcp")&&n.push("mcp"),{selectedComponents:new Set(n)}}),setBackup:r=>t({backup:r}),setMcpEnabled:r=>t({mcpEnabled:r}),toggleTool:r=>t(n=>{const a=new Set(n.enabledTools);return a.has(r)?a.delete(r):a.add(r),{enabledTools:a}}),detect:async()=>{const{mode:r,projectPath:n}=o();t({detecting:!0,error:null});try{const a=await fetch(q.DETECT,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:r,projectPath:r==="project"?n:void 0})}),i=await a.json();if(!a.ok)throw new Error(i.error??`HTTP ${a.status}`);const d=i,m=d.components.filter(b=>b.available).map(b=>b.id);m.push("mcp"),t({detecting:!1,detection:d,selectedComponents:new Set(m),step:"configure"})}catch(a){t({detecting:!1,error:String(a)})}},install:async()=>{const{mode:r,projectPath:n,selectedComponents:a,backup:i,mcpEnabled:d,enabledTools:m}=o();t({installing:!0,error:null,step:"progress"});try{const l=await(await fetch(q.EXECUTE,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:r,projectPath:r==="project"?n:void 0,components:Array.from(a),backup:i,mcpConfig:d&&a.has("mcp")?{enabled:!0,enabledTools:Array.from(m)}:void 0})})).json();t({installing:!1,result:l})}catch(b){t({installing:!1,result:{success:!1,filesInstalled:0,dirsCreated:0,manifestPath:"",disabledItemsRestored:0,mcpRegistered:!1,components:[],error:String(b)}})}},fetchManifests:async()=>{try{const r=await fetch(q.MANIFESTS);if(!r.ok)return;const n=await r.json();t({manifests:n.manifests??[]})}catch{}},reset:()=>t({step:"mode",mode:"global",projectPath:"",detection:null,selectedComponents:new Set,backup:!0,mcpEnabled:!0,enabledTools:new Set(te),detecting:!1,installing:!1,result:null,error:null})}));function Xe(t){const o=t.includes("/")?"/":t.includes("\\")?"\\":"/",r=t.endsWith(o)?t.slice(0,-1):t,n=r.lastIndexOf(o);return n>=0?r.slice(n+1):r}const Ke=[{id:"all",label:"All"},{id:"global",label:"Global",color:"var(--color-accent-blue, #5B8DB8)"},{id:"project",label:"Project",color:"var(--color-status-planning, #9178B5)"},{id:"enterprise",label:"Enterprise",color:"var(--color-status-verifying, #C8863A)"}],ce={global:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue, #5B8DB8)"},project:{bg:"rgba(145,120,181,0.12)",text:"var(--color-status-planning, #9178B5)"},enterprise:{bg:"rgba(200,134,58,0.12)",text:"var(--color-status-verifying, #C8863A)"},codex:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed, #5A9E78)"}};function qe(){const t=f(c=>c.servers),o=f(c=>c.scopeFilter),r=f(c=>c.search),n=y.useMemo(()=>{let c=t;if(o!=="all"&&(c=c.filter(C=>C.scope===o)),r){const C=r.toLowerCase();c=c.filter(z=>{var O,T;return z.name.toLowerCase().includes(C)||(((O=z.command)==null?void 0:O.toLowerCase().includes(C))??!1)||(((T=z.url)==null?void 0:T.toLowerCase().includes(C))??!1)})}return c},[t,o,r]),a=f(c=>c.selectedServer),i=f(c=>c.setScopeFilter),d=f(c=>c.setSearch),m=f(c=>c.setSelectedServer),b=f(c=>c.toggleServer),l=f(c=>c.removeServer),x=f(c=>c.removeGlobalServer),p=f(c=>c.setEditingServer),s=u(c=>c.setOpen),h=t.filter(c=>c.enabled).length,w=t.filter(c=>c.scope==="global").length,k=t.filter(c=>c.scope==="project").length,S=t.filter(c=>c.scope==="enterprise").length,A=t.filter(c=>c.transport==="stdio").length,L=t.filter(c=>c.transport==="http").length,$={all:t.length,global:w,project:k,enterprise:S},W=a?t.find(c=>c.id===a)??null:null;function g(c){b(c.projectPath??"",c.name,!c.enabled)}function j(c){c.scope==="global"?x(c.name):l(c.projectPath??"",c.name)}function N(c){p(c)}return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-5 px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[e.jsx(U,{color:"var(--color-status-completed, #5A9E78)",value:h,label:"Active"}),e.jsx(U,{color:"var(--color-accent-blue, #5B8DB8)",value:w,label:"Global"}),e.jsx(U,{color:"var(--color-status-planning, #9178B5)",value:k,label:"Project"}),e.jsx(U,{color:"var(--color-status-verifying, #C8863A)",value:S,label:"Enterprise"})]}),e.jsxs("div",{className:"flex items-center gap-[10px] px-5 py-2 border-b border-border-divider shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-[6px] px-3 py-[6px] rounded-[var(--radius-lg)] bg-bg-card border border-border w-[260px] focus-within:border-[var(--color-status-planning,#9178B5)] transition-colors",children:[e.jsx(ae,{size:13,strokeWidth:2,className:"text-text-tertiary shrink-0"}),e.jsx("input",{type:"text",placeholder:"Search servers...",value:r,onChange:c=>d(c.target.value),className:"border-none bg-transparent outline-none text-[12px] text-text-primary w-full placeholder:text-text-tertiary"})]}),e.jsx("div",{className:"flex gap-[6px]",children:Ke.map(c=>{const C=o===c.id;return e.jsxs("button",{type:"button",onClick:()=>i(c.id),className:["flex items-center gap-1 px-[10px] py-1 rounded-full border text-[10px] font-semibold whitespace-nowrap transition-all cursor-pointer",C?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border hover:border-text-tertiary hover:text-text-secondary"].join(" "),children:[c.color&&!C&&e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:c.color}}),c.label,e.jsx("span",{className:"font-mono text-[9px] opacity-60",children:$[c.id]})]},c.id)})}),e.jsx("div",{className:"w-px h-[18px] bg-border-divider"}),e.jsx("div",{className:"flex gap-[6px]",children:["stdio","http"].map(c=>e.jsxs("button",{type:"button",className:"flex items-center gap-1 px-[10px] py-1 rounded-full border border-border bg-bg-card text-[10px] font-semibold text-text-tertiary hover:border-text-tertiary hover:text-text-secondary transition-all cursor-pointer whitespace-nowrap",children:[c.toUpperCase(),e.jsx("span",{className:"font-mono text-[9px] opacity-60",children:c==="stdio"?A:L})]},c))}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:()=>s(!0),className:"flex items-center gap-[6px] px-[14px] py-[6px] rounded-[var(--radius-lg)] border border-border bg-bg-card text-[11px] font-semibold text-text-secondary cursor-pointer transition-all hover:border-text-tertiary hover:text-text-primary whitespace-nowrap",children:[e.jsx(Te,{size:13,strokeWidth:2}),"Install Wizard"]}),e.jsxs("button",{type:"button",className:"flex items-center gap-[6px] px-[14px] py-[6px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[11px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md whitespace-nowrap",children:[e.jsx(se,{size:13,strokeWidth:2}),"Add Server"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsx("div",{className:"flex-1 overflow-y-auto min-w-0",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap w-[36px]"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap",children:"Name"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap",children:"Command / URL"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap",children:"Scope"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap",children:"CLI"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap w-[50px]",children:"On"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap w-[140px]"})]})}),e.jsx("tbody",{children:(()=>{if(!(o==="all"||o==="project"))return n.map(v=>e.jsx(Q,{server:v,selected:a===v.id,onSelect:()=>m(a===v.id?null:v.id),onToggle:()=>g(v),onEdit:()=>N(v),onRemove:()=>j(v)},v.id));const C=n.filter(v=>v.scope==="project"),z=n.filter(v=>v.scope!=="project"),O=new Map;for(const v of C){const R=v.projectPath??"",J=O.get(R)??[];J.push(v),O.set(R,J)}const T=[];for(const v of z)T.push(e.jsx(Q,{server:v,selected:a===v.id,onSelect:()=>m(a===v.id?null:v.id),onToggle:()=>g(v),onEdit:()=>N(v),onRemove:()=>j(v)},v.id));for(const[v,R]of O){const J=Xe(v);T.push(e.jsx(Qe,{folderName:J,fullPath:v,count:R.length},`group:${v}`));for(const P of R)T.push(e.jsx(Q,{server:P,selected:a===P.id,onSelect:()=>m(a===P.id?null:P.id),onToggle:()=>g(P),onEdit:()=>N(P),onRemove:()=>j(P)},P.id))}return T.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"text-center py-8 text-text-tertiary text-[length:var(--font-size-sm)]",children:"No servers found"})}):T})()})]})}),e.jsx(Be,{children:W&&e.jsx(Ue,{server:W,onClose:()=>m(null)})})]})]})}function U({color:t,value:o,label:r}){return e.jsxs("div",{className:"flex items-center gap-[6px]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:t}}),e.jsx("span",{className:"text-[16px] font-extrabold text-text-primary font-mono",children:o}),e.jsx("span",{className:"text-[10px] font-semibold text-text-tertiary uppercase tracking-[0.04em]",children:r})]})}function Qe({folderName:t,fullPath:o,count:r}){return e.jsx("tr",{className:"group-header-row",children:e.jsx("td",{colSpan:7,className:"px-[14px] py-[6px] bg-[rgba(145,120,181,0.04)] border-b border-border-divider",children:e.jsxs("div",{className:"flex items-center gap-[8px]",children:[e.jsx(Ae,{size:13,strokeWidth:1.8,style:{color:"var(--color-status-planning, #9178B5)",opacity:.7}}),e.jsx("span",{className:"text-[11px] font-bold text-text-secondary",title:o,children:t}),e.jsx("span",{className:"text-[9px] font-mono text-text-tertiary opacity-60",children:r})]})})})}function Q({server:t,selected:o,onSelect:r,onToggle:n,onEdit:a,onRemove:i}){var x;const d=ce[t.scope]??ce.global,m=t.command?`${t.command}${(x=t.args)!=null&&x.length?" "+t.args.join(" "):""}`:t.url??"",b=!t.cli.claude&&t.cli.codex,l=t.cli.claude&&!t.cli.codex;return e.jsxs("tr",{onClick:r,className:["cursor-pointer transition-colors group",o?"[&>td]:bg-[rgba(145,120,181,0.07)]":"hover:[&>td]:bg-bg-hover"].join(" "),children:[e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsx("div",{className:"w-7 h-7 rounded-[var(--radius-md)] shrink-0 flex items-center justify-center",style:{background:t.transport==="stdio"?"rgba(91,141,184,0.08)":"rgba(145,120,181,0.08)",color:t.transport==="stdio"?"var(--color-accent-blue, #5B8DB8)":"var(--color-status-planning, #9178B5)"},children:t.transport==="stdio"?e.jsx(oe,{size:14,strokeWidth:1.8}):e.jsx(K,{size:14,strokeWidth:1.8})})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:t.name})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary max-w-[280px] whitespace-nowrap overflow-hidden text-ellipsis block",children:m})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle whitespace-nowrap",children:e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:d.bg,color:d.text},children:t.scope})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsxs("div",{className:"flex gap-[3px]",children:[e.jsx("span",{className:["w-5 h-4 rounded-[3px] flex items-center justify-center",t.cli.claude?"":"opacity-25"].join(" "),style:{background:"rgba(200,134,58,0.08)",color:"var(--color-status-verifying, #C8863A)"},title:"Claude Code",children:e.jsx(G,{size:11})}),e.jsx("span",{className:["w-5 h-4 rounded-[3px] flex items-center justify-center",t.cli.codex?"":"opacity-25"].join(" "),style:{background:"rgba(90,158,120,0.08)",color:"var(--color-status-completed, #5A9E78)"},title:"Codex CLI",children:e.jsx(V,{size:11})})]})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle text-center",children:e.jsxs("label",{className:"relative inline-block w-8 h-[18px] cursor-pointer",onClick:p=>p.stopPropagation(),children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:n,disabled:t.scope==="enterprise",className:"sr-only peer"}),e.jsx("div",{className:["w-8 h-[18px] rounded-full transition-colors duration-200",t.scope==="enterprise"?"opacity-50 cursor-default":""].join(" "),style:{background:t.enabled?"var(--color-status-completed, #5A9E78)":"var(--color-border, #E8E5DE)"},children:e.jsx("div",{className:"absolute top-[2px] left-[2px] w-[14px] h-[14px] rounded-full bg-white shadow-sm transition-transform duration-200",style:{transform:t.enabled?"translateX(14px)":"translateX(0)"}})})]})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsxs("div",{className:"flex gap-1 items-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:p=>p.stopPropagation(),children:[(l||b)&&e.jsx("button",{type:"button",className:"flex items-center gap-[3px] px-2 py-1 rounded-[5px] border border-border bg-bg-card text-text-tertiary hover:border-[var(--color-accent-blue,#5B8DB8)] hover:text-[var(--color-accent-blue,#5B8DB8)] hover:bg-[rgba(91,141,184,0.04)] transition-all whitespace-nowrap",title:l?"Copy to Codex":"Copy to Claude",children:l?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{size:10,strokeWidth:2.5}),e.jsx("span",{className:"w-[14px] h-[11px] rounded-[2px] flex items-center justify-center",style:{background:"rgba(90,158,120,0.08)",color:"var(--color-status-completed, #5A9E78)"},children:e.jsx(V,{size:9})})]}):e.jsxs(e.Fragment,{children:[e.jsx(ze,{size:10,strokeWidth:2.5}),e.jsx("span",{className:"w-[14px] h-[11px] rounded-[2px] flex items-center justify-center",style:{background:"rgba(200,134,58,0.08)",color:"var(--color-status-verifying, #C8863A)"},children:e.jsx(G,{size:9})})]})}),e.jsx("button",{type:"button",onClick:a,className:"flex items-center gap-1 px-[10px] py-[5px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-text-secondary hover:border-text-tertiary hover:text-text-primary transition-all",children:e.jsx(Pe,{size:11,strokeWidth:2})}),t.scope!=="enterprise"&&e.jsx("button",{type:"button",onClick:i,className:"flex items-center gap-1 px-[10px] py-[5px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-status-failed hover:border-status-failed hover:bg-red-50 transition-all",children:e.jsx(Se,{size:11,strokeWidth:2})})]})})]})}function Ze(t){const o=t.includes("/")?"/":t.includes("\\")?"\\":"/",r=t.endsWith(o)?t.slice(0,-1):t,n=r.lastIndexOf(o);return n>=0?r.slice(n+1):r}const et={global:{label:"Global Servers",color:"var(--color-accent-blue, #5B8DB8)"},project:{label:"Project Servers",color:"var(--color-status-planning, #9178B5)"},enterprise:{label:"Enterprise Managed",color:"var(--color-status-verifying, #C8863A)"},codex:{label:"Codex Servers",color:"var(--color-status-completed, #5A9E78)"}},de={global:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue, #5B8DB8)"},project:{bg:"rgba(145,120,181,0.12)",text:"var(--color-status-planning, #9178B5)"},enterprise:{bg:"rgba(200,134,58,0.12)",text:"var(--color-status-verifying, #C8863A)"},codex:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed, #5A9E78)"}},xe={stdio:{bg:"rgba(91,141,184,0.08)",text:"var(--color-accent-blue, #5B8DB8)"},http:{bg:"rgba(145,120,181,0.08)",text:"var(--color-status-planning, #9178B5)"}};function tt(){const t=f(l=>l.servers),o=f(l=>l.scopeFilter),r=f(l=>l.search),n=f(l=>l.selectedServer),a=f(l=>l.setSelectedServer),i=f(l=>l.toggleServer),d=y.useMemo(()=>{let l=t;if(o!=="all"&&(l=l.filter(x=>x.scope===o)),r){const x=r.toLowerCase();l=l.filter(p=>{var s,h;return p.name.toLowerCase().includes(x)||(((s=p.command)==null?void 0:s.toLowerCase().includes(x))??!1)||(((h=p.url)==null?void 0:h.toLowerCase().includes(x))??!1)})}return l},[t,o,r]),m=y.useMemo(()=>{const l=new Map;for(const p of d){const s=l.get(p.scope)??[];s.push(p),l.set(p.scope,s)}const x=[];for(const p of["global","project","enterprise","codex"]){const s=l.get(p);if(s&&s.length>0){const h=et[p]??{label:p,color:"var(--color-text-tertiary)"},w={scope:p,label:h.label,color:h.color,servers:s};if(p==="project"){const k=new Map;for(const S of s){const A=S.projectPath??"__unknown__",L=k.get(A)??[];L.push(S),k.set(A,L)}w.projectSubGroups=[];for(const[S,A]of k)w.projectSubGroups.push({projectPath:S,folderName:Ze(S),servers:A})}x.push(w)}}return x},[d]);function b(l){i(l.projectPath??"",l.name,!l.enabled)}return d.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No servers found"}):e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:m.map((l,x)=>e.jsxs(M.div,{className:"mb-5",initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:x*.06},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-[10px] pb-[6px] border-b border-border-divider",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:l.color}}),e.jsx("span",{className:"text-[12px] font-bold text-text-primary",children:l.label}),e.jsxs("span",{className:"text-[10px] text-text-tertiary font-mono",children:[l.servers.length," server",l.servers.length!==1?"s":""]})]}),l.projectSubGroups?e.jsx("div",{className:"flex flex-col gap-[14px]",children:l.projectSubGroups.map(p=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-[8px] mb-[8px]",children:[e.jsx(Ae,{size:13,strokeWidth:1.8,style:{color:"var(--color-status-planning, #9178B5)",opacity:.7}}),e.jsx("span",{className:"text-[11px] font-bold text-text-secondary",title:p.projectPath,children:p.folderName}),e.jsx("span",{className:"text-[9px] font-mono text-text-tertiary opacity-60",children:p.servers.length})]}),e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-[10px]",children:p.servers.map((s,h)=>e.jsx(pe,{server:s,selected:n===s.id,isEnterprise:!1,delay:h*.04,onSelect:()=>a(n===s.id?null:s.id),onToggle:()=>b(s)},s.id))})]},p.projectPath))}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-[10px]",children:l.servers.map((p,s)=>e.jsx(pe,{server:p,selected:n===p.id,isEnterprise:l.scope==="enterprise",delay:s*.04,onSelect:()=>a(n===p.id?null:p.id),onToggle:()=>b(p)},p.id))})]},l.scope))})}function pe({server:t,selected:o,isEnterprise:r,delay:n,onSelect:a,onToggle:i}){var s;const d=de[t.scope]??de.global,m=xe[t.transport]??xe.stdio,b=t.command?`${t.command}${(s=t.args)!=null&&s.length?" "+t.args.join(" "):""}`:t.url??"",l=t.env?Object.keys(t.env):[],x=!t.cli.claude&&t.cli.codex,p=t.cli.claude&&!t.cli.codex;return e.jsxs(M.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,delay:n},onClick:a,className:["bg-bg-card border rounded-[10px] p-[14px] cursor-pointer transition-all duration-200 flex flex-col gap-2",o?"border-[var(--color-status-planning,#9178B5)] shadow-[0_0_0_2px_rgba(145,120,181,0.2)]":"border-border hover:border-text-tertiary hover:shadow-md hover:-translate-y-[2px]"].join(" "),style:r?{borderColor:"rgba(200,134,58,0.3)",background:"rgba(200,134,58,0.04)"}:void 0,children:[e.jsxs("div",{className:"flex items-center gap-[10px]",children:[e.jsx("div",{className:"w-9 h-9 rounded-[var(--radius-lg)] shrink-0 flex items-center justify-center",style:{background:t.transport==="stdio"?"rgba(91,141,184,0.08)":"rgba(145,120,181,0.08)",color:t.transport==="stdio"?"var(--color-accent-blue, #5B8DB8)":"var(--color-status-planning, #9178B5)"},children:t.transport==="stdio"?e.jsx(oe,{size:18,strokeWidth:1.8}):e.jsx(K,{size:18,strokeWidth:1.8})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-bold text-text-primary truncate",children:t.name}),e.jsxs("div",{className:"flex gap-[5px] mt-[3px]",children:[e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:d.bg,color:d.text},children:t.scope}),e.jsx("span",{className:"text-[9px] font-semibold px-[7px] py-[2px] rounded-[4px] uppercase",style:{background:m.bg,color:m.text},children:t.transport})]})]}),e.jsxs("label",{className:"relative inline-block w-8 h-[18px] shrink-0 cursor-pointer",onClick:h=>h.stopPropagation(),children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:i,disabled:r,className:"sr-only"}),e.jsx("div",{className:["w-8 h-[18px] rounded-full transition-colors duration-200 relative",r?"opacity-50 cursor-default":""].join(" "),style:{background:t.enabled?"var(--color-status-completed, #5A9E78)":"var(--color-border, #E8E5DE)"},children:e.jsx("div",{className:"absolute top-[2px] left-[2px] w-[14px] h-[14px] rounded-full bg-white shadow-sm transition-transform duration-200",style:{transform:t.enabled?"translateX(14px)":"translateX(0)"}})})]})]}),b&&e.jsx("div",{className:"font-mono text-[10px] text-text-secondary bg-bg-secondary rounded-[var(--radius-md)] px-[10px] py-[6px] whitespace-nowrap overflow-hidden text-ellipsis",style:r?{background:"rgba(200,134,58,0.08)"}:void 0,children:r?"managed (read-only)":b}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"flex gap-1 flex-wrap flex-1 min-w-0",children:l.map(h=>e.jsx("span",{className:"text-[9px] font-mono px-[6px] py-[2px] rounded-[4px]",style:{background:"rgba(91,141,184,0.08)",color:"var(--color-accent-blue, #5B8DB8)"},children:h},h))}),e.jsxs("div",{className:"flex gap-[3px] shrink-0 items-center",children:[(p||x)&&e.jsx("button",{type:"button",onClick:h=>h.stopPropagation(),className:"flex items-center gap-[3px] px-[7px] py-[3px] rounded-[4px] border border-border bg-bg-card text-text-tertiary transition-all hover:border-[var(--color-accent-blue,#5B8DB8)] hover:text-[var(--color-accent-blue,#5B8DB8)] hover:bg-[rgba(91,141,184,0.04)]",title:p?"Copy to Codex":"Copy to Claude",children:p?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{size:9,strokeWidth:2.5}),e.jsx(V,{size:11,style:{color:"var(--color-status-completed, #5A9E78)"}})]}):e.jsxs(e.Fragment,{children:[e.jsx(ze,{size:9,strokeWidth:2.5}),e.jsx(G,{size:11,style:{color:"var(--color-status-verifying, #C8863A)"}})]})}),e.jsxs("div",{className:"flex gap-[3px]",children:[e.jsx("span",{className:["w-5 h-4 rounded-[3px] flex items-center justify-center",t.cli.claude?"":"opacity-25"].join(" "),style:{background:"rgba(200,134,58,0.08)",color:"var(--color-status-verifying, #C8863A)"},title:"Claude Code",children:e.jsx(G,{size:11})}),e.jsx("span",{className:["w-5 h-4 rounded-[3px] flex items-center justify-center",t.cli.codex?"":"opacity-25"].join(" "),style:{background:"rgba(90,158,120,0.08)",color:"var(--color-status-completed, #5A9E78)"},title:"Codex CLI",children:e.jsx(V,{size:11})})]})]})]})]})}const me={database:{icon:e.jsx(We,{size:18,strokeWidth:1.8}),bg:"rgba(91,141,184,0.08)",color:"var(--color-accent-blue, #5B8DB8)"},search:{icon:e.jsx(ae,{size:18,strokeWidth:1.8}),bg:"rgba(145,120,181,0.08)",color:"var(--color-status-planning, #9178B5)"},code:{icon:e.jsx(_e,{size:18,strokeWidth:1.8}),bg:"rgba(90,158,120,0.08)",color:"var(--color-status-completed, #5A9E78)"},filesystem:{icon:e.jsx(Ie,{size:18,strokeWidth:1.8}),bg:"rgba(184,149,64,0.08)",color:"var(--color-status-idle, #B89540)"},api:{icon:e.jsx(K,{size:18,strokeWidth:1.8}),bg:"rgba(200,134,58,0.08)",color:"var(--color-status-verifying, #C8863A)"},utility:{icon:e.jsx(De,{size:18,strokeWidth:1.8}),bg:"rgba(160,157,151,0.08)",color:"var(--color-text-tertiary, #A09D97)"}},rt={database:{bg:"rgba(91,141,184,0.12)",color:"var(--color-accent-blue, #5B8DB8)"},sql:{bg:"rgba(90,158,120,0.12)",color:"var(--color-status-completed, #5A9E78)"},search:{bg:"rgba(145,120,181,0.12)",color:"var(--color-status-planning, #9178B5)"},code:{bg:"rgba(90,158,120,0.12)",color:"var(--color-status-completed, #5A9E78)"},tools:{bg:"rgba(90,158,120,0.12)",color:"var(--color-status-completed, #5A9E78)"},filesystem:{bg:"rgba(184,149,64,0.12)",color:"var(--color-status-idle, #B89540)"},files:{bg:"rgba(184,149,64,0.12)",color:"var(--color-status-idle, #B89540)"},api:{bg:"rgba(200,134,58,0.12)",color:"var(--color-status-verifying, #C8863A)"},web:{bg:"rgba(200,134,58,0.12)",color:"var(--color-status-verifying, #C8863A)"},docs:{bg:"rgba(145,120,181,0.12)",color:"var(--color-status-planning, #9178B5)"},research:{bg:"rgba(200,134,58,0.12)",color:"var(--color-status-verifying, #C8863A)"}},st={database:"var(--color-accent-blue, #5B8DB8)",search:"var(--color-status-planning, #9178B5)",code:"var(--color-status-completed, #5A9E78)",filesystem:"var(--color-status-idle, #B89540)",api:"var(--color-status-verifying, #C8863A)",utility:"var(--color-text-tertiary, #A09D97)"};function ot(){const t=f(s=>s.templates),o=f(s=>s.categories),r=f(s=>s.servers),n=f(s=>s.templateSearch),a=f(s=>s.templateCategory),i=y.useMemo(()=>{let s=t;if(a&&(s=s.filter(h=>h.category===a)),n){const h=n.toLowerCase();s=s.filter(w=>{var k;return w.name.toLowerCase().includes(h)||(((k=w.description)==null?void 0:k.toLowerCase().includes(h))??!1)})}return s},[t,n,a]),d=f(s=>s.setTemplateSearch),m=f(s=>s.setTemplateCategory),b=f(s=>s.installTemplate),l=y.useMemo(()=>new Set(r.map(s=>s.name.toLowerCase())),[r]),x=y.useMemo(()=>{const s={};for(const h of t)h.category&&(s[h.category]=(s[h.category]??0)+1);return s},[t]),p=y.useMemo(()=>t.filter(s=>l.has(s.name.toLowerCase())).length,[t,l]);return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-5 px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[e.jsx(Z,{color:"var(--color-status-planning, #9178B5)",value:t.length,label:"Templates"}),e.jsx(Z,{color:"var(--color-accent-blue, #5B8DB8)",value:o.length,label:"Categories"}),e.jsx(Z,{color:"var(--color-status-completed, #5A9E78)",value:p,label:"Installed"})]}),e.jsxs("div",{className:"flex items-center gap-[10px] px-5 py-2 border-b border-border-divider shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-[6px] px-3 py-[6px] rounded-[var(--radius-lg)] bg-bg-card border border-border w-[260px] focus-within:border-[var(--color-status-planning,#9178B5)] transition-colors",children:[e.jsx(ae,{size:13,strokeWidth:2,className:"text-text-tertiary shrink-0"}),e.jsx("input",{type:"text",placeholder:"Search templates...",value:n,onChange:s=>d(s.target.value),className:"border-none bg-transparent outline-none text-[12px] text-text-primary w-full placeholder:text-text-tertiary"})]}),e.jsxs("div",{className:"flex gap-[6px]",children:[e.jsxs("button",{type:"button",onClick:()=>m(null),className:["flex items-center gap-1 px-[10px] py-1 rounded-full border text-[10px] font-semibold whitespace-nowrap transition-all cursor-pointer",a===null?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border hover:border-text-tertiary hover:text-text-secondary"].join(" "),children:["All",e.jsx("span",{className:"font-mono text-[9px] opacity-60",children:t.length})]}),o.map(s=>{const h=a===s,w=st[s.toLowerCase()];return e.jsxs("button",{type:"button",onClick:()=>m(h?null:s),className:["flex items-center gap-1 px-[10px] py-1 rounded-full border text-[10px] font-semibold whitespace-nowrap transition-all cursor-pointer",h?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border hover:border-text-tertiary hover:text-text-secondary"].join(" "),children:[w&&!h&&e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:w}}),s,e.jsx("span",{className:"font-mono text-[9px] opacity-60",children:x[s]??0})]},s)})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",className:"flex items-center gap-[6px] px-[14px] py-[6px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[11px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md whitespace-nowrap",children:[e.jsx(se,{size:13,strokeWidth:2}),"New Template"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:i.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No templates found"}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(300px,1fr))] gap-3",children:i.map((s,h)=>e.jsx(at,{template:s,installed:l.has(s.name.toLowerCase()),delay:h*.04,onInstall:()=>void b(s.name)},s.id))})})]})}function Z({color:t,value:o,label:r}){return e.jsxs("div",{className:"flex items-center gap-[6px]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:t}}),e.jsx("span",{className:"text-[16px] font-extrabold text-text-primary font-mono",children:o}),e.jsx("span",{className:"text-[10px] font-semibold text-text-tertiary uppercase tracking-[0.04em]",children:r})]})}function at({template:t,installed:o,delay:r,onInstall:n}){var m,b;const a=((m=t.category)==null?void 0:m.toLowerCase())??"",i=me[a]??me.utility,d=t.serverConfig.command?`${t.serverConfig.command}${(b=t.serverConfig.args)!=null&&b.length?" "+t.serverConfig.args.join(" "):""}`:"";return e.jsxs(M.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,delay:r},className:"bg-bg-card border border-border rounded-[10px] p-[14px] transition-all duration-200 cursor-pointer flex flex-col gap-[10px] hover:border-text-tertiary hover:shadow-md hover:-translate-y-[2px]",children:[e.jsxs("div",{className:"flex items-start gap-[10px]",children:[e.jsx("div",{className:"w-9 h-9 rounded-[var(--radius-lg)] shrink-0 flex items-center justify-center",style:{background:i.bg,color:i.color},children:i.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-bold text-text-primary",children:t.name}),t.description&&e.jsx("div",{className:"text-[11px] text-text-secondary leading-[1.5] mt-[2px] line-clamp-2",children:t.description})]})]}),d&&e.jsx("div",{className:"font-mono text-[10px] text-text-secondary bg-bg-secondary rounded-[var(--radius-md)] px-[10px] py-[6px] whitespace-nowrap overflow-hidden text-ellipsis",children:d}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex gap-1 flex-wrap",children:(t.tags??[]).map(l=>{const x=rt[l.toLowerCase()]??{bg:"rgba(160,157,151,0.12)",color:"var(--color-text-tertiary)"};return e.jsx("span",{className:"text-[9px] font-semibold px-[6px] py-[2px] rounded-[4px] uppercase tracking-[0.03em]",style:{background:x.bg,color:x.color},children:l},l)})}),o?e.jsxs("span",{className:"flex items-center gap-1 px-[10px] py-1 rounded-[var(--radius-md)] border text-[10px] font-semibold whitespace-nowrap",style:{borderColor:"var(--color-status-completed, #5A9E78)",color:"var(--color-status-completed, #5A9E78)",background:"rgba(90,158,120,0.06)"},children:[e.jsx(Re,{size:10,strokeWidth:2.5}),"Installed"]}):e.jsxs("button",{type:"button",onClick:l=>{l.stopPropagation(),n()},className:"flex items-center gap-1 px-[10px] py-1 rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-text-secondary transition-all hover:border-[var(--color-status-completed,#5A9E78)] hover:text-[var(--color-status-completed,#5A9E78)] hover:bg-[rgba(90,158,120,0.04)] whitespace-nowrap cursor-pointer",children:[e.jsx(Te,{size:10,strokeWidth:2.5}),"Install"]})]})]})}const be={global:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue, #5B8DB8)"},project:{bg:"rgba(145,120,181,0.12)",text:"var(--color-status-planning, #9178B5)"},enterprise:{bg:"rgba(200,134,58,0.12)",text:"var(--color-status-verifying, #C8863A)"},codex:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed, #5A9E78)"}};function nt(){const t=f(n=>n.editingServer),o=f(n=>n.setEditingServer),r=f(n=>n.updateServer);return t?e.jsx(ye,{open:!!t,onOpenChange:n=>{n||o(null)},children:e.jsxs(je,{children:[e.jsx(Ne,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(we,{className:B("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[560px] max-w-[95vw] max-h-[85vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ce,{className:"text-[14px] font-semibold text-text-primary",children:"Edit Server"}),e.jsx(it,{scope:t.scope})]}),e.jsx(ke,{className:B("w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)]","text-text-tertiary hover:text-text-primary hover:bg-bg-hover","transition-colors"),"aria-label":"Close",children:e.jsx(ve,{size:14,strokeWidth:2})})]}),e.jsx(lt,{server:t,onSave:n=>void r(t,n),onCancel:()=>o(null)})]})]})}):null}function lt({server:t,onSave:o,onCancel:r}){var W;const n=t.transport==="stdio",a=t.scope==="enterprise",[i,d]=y.useState(t.command??""),[m,b]=y.useState(((W=t.args)==null?void 0:W.join(" "))??""),[l,x]=y.useState(t.url??""),[p,s]=y.useState(()=>t.env?Object.entries(t.env).map(([g,j])=>({key:g,value:j})):[]),[h,w]=y.useState(!1),k=y.useMemo(()=>()=>{const g={...t.raw};if(n){g.command=i;const N=m.trim().split(/\s+/).filter(Boolean);N.length>0?g.args=N:delete g.args,delete g.url}else g.url=l,delete g.command,delete g.args;delete g.env;const j={};for(const N of p)N.key.trim()&&(j[N.key.trim()]=N.value);return Object.keys(j).length>0&&(g.env=j),delete g.enabled,g},[t.raw,n,i,m,l,p]);function S(){w(!0),o(k())}function A(){s(g=>[...g,{key:"",value:""}])}function L(g){s(j=>j.filter((N,c)=>c!==g))}function $(g,j,N){s(c=>c.map((C,z)=>z===g?{...C,[j]:N}:C))}return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:[e.jsx(D,{label:"Server Name",children:e.jsx("input",{type:"text",value:t.name,readOnly:!0,className:"w-full px-3 py-2 rounded-[var(--radius-md)] border border-border bg-bg-secondary text-[12px] text-text-tertiary font-mono cursor-not-allowed"})}),e.jsx(D,{label:"Transport",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:n?"rgba(91,141,184,0.08)":"rgba(145,120,181,0.08)",color:n?"var(--color-accent-blue, #5B8DB8)":"var(--color-status-planning, #9178B5)"},children:t.transport})})}),a&&e.jsx("div",{className:"mb-4 px-3 py-2 rounded-[var(--radius-md)] border border-[var(--color-status-verifying,#C8863A)] bg-[rgba(200,134,58,0.06)] text-[11px] text-[var(--color-status-verifying,#C8863A)]",children:"Enterprise-managed servers cannot be edited from the dashboard."}),n&&e.jsx(D,{label:"Command",children:e.jsx("input",{type:"text",value:i,onChange:g=>d(g.target.value),disabled:a,placeholder:"e.g. npx",className:F})}),n&&e.jsx(D,{label:"Arguments",children:e.jsx("input",{type:"text",value:m,onChange:g=>b(g.target.value),disabled:a,placeholder:"space-separated arguments",className:F})}),!n&&e.jsx(D,{label:"URL",children:e.jsx("input",{type:"text",value:l,onChange:g=>x(g.target.value),disabled:a,placeholder:"https://...",className:F})}),e.jsx(D,{label:"Environment Variables",children:e.jsxs("div",{className:"space-y-2",children:[p.map((g,j)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:g.key,onChange:N=>$(j,"key",N.target.value),disabled:a,placeholder:"KEY",className:B(F,"w-[160px] shrink-0 font-mono text-[11px]")}),e.jsx("input",{type:"text",value:g.value,onChange:N=>$(j,"value",N.target.value),disabled:a,placeholder:"value",className:B(F,"flex-1 font-mono text-[11px]")}),!a&&e.jsx("button",{type:"button",onClick:()=>L(j),className:"shrink-0 w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-status-failed hover:bg-red-50 transition-colors",children:e.jsx(Fe,{size:12,strokeWidth:2})})]},j)),!a&&e.jsxs("button",{type:"button",onClick:A,className:"flex items-center gap-1 px-2 py-1 text-[10px] font-semibold text-text-tertiary hover:text-text-primary transition-colors",children:[e.jsx(se,{size:11,strokeWidth:2}),"Add variable"]})]})})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border shrink-0",children:[e.jsx("button",{type:"button",onClick:r,className:"px-4 py-[6px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-colors",children:"Cancel"}),e.jsx("button",{type:"button",onClick:S,disabled:h||a,className:B("px-4 py-[6px] rounded-[var(--radius-md)] border-none bg-text-primary text-white text-[11px] font-semibold transition-all","hover:-translate-y-px hover:shadow-md",(h||a)&&"opacity-50 cursor-not-allowed hover:translate-y-0 hover:shadow-none"),children:h?"Saving...":"Save Changes"})]})]})}const F=B("w-full px-3 py-2 rounded-[var(--radius-md)] border border-border bg-bg-card","text-[12px] text-text-primary outline-none","focus:border-[var(--color-status-planning,#9178B5)] transition-colors","placeholder:text-text-tertiary","disabled:opacity-50 disabled:cursor-not-allowed");function D({label:t,children:o}){return e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.05em] text-text-tertiary mb-[6px]",children:t}),o]})}function it({scope:t}){const o=be[t]??be.global;return e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:o.bg,color:o.text},children:t})}const ue=[{id:"mode",label:"Mode"},{id:"configure",label:"Configure"},{id:"review",label:"Review"},{id:"progress",label:"Install"}];function ct({current:t}){const o=ue.findIndex(r=>r.id===t);return e.jsx("div",{className:"flex items-center gap-1 px-1",children:ue.map((r,n)=>{const a=n<o,i=n===o;return e.jsxs("div",{className:"flex items-center gap-1",children:[n>0&&e.jsx("div",{className:"w-8 h-px",style:{background:a?"var(--color-status-completed, #5A9E78)":"var(--color-border, #E8E5DE)"}}),e.jsxs("div",{className:"flex items-center gap-[6px]",children:[e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[9px] font-bold font-mono",style:{background:a?"var(--color-status-completed, #5A9E78)":i?"var(--color-text-primary, #1A1917)":"var(--color-bg-card, #F8F7F5)",color:a||i?"#fff":"var(--color-text-tertiary)",border:!a&&!i?"1px solid var(--color-border, #E8E5DE)":"none"},children:a?e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}):n+1}),e.jsx("span",{className:"text-[11px] font-semibold whitespace-nowrap",style:{color:i?"var(--color-text-primary)":"var(--color-text-tertiary)"},children:r.label})]})]},r.id)})})}function dt(){const t=u(x=>x.mode),o=u(x=>x.setMode),r=u(x=>x.projectPath),n=u(x=>x.setProjectPath),a=u(x=>x.detecting),i=u(x=>x.error),d=u(x=>x.detect),m=u(x=>x.manifests),b=u(x=>x.fetchManifests);y.useEffect(()=>{b()},[b]);const l=t==="global"||t==="project"&&r.trim().length>0;return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[520px] mx-auto py-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[14px] font-semibold text-text-primary mb-1",children:"Installation Mode"}),e.jsx("p",{className:"text-[12px] text-text-tertiary",children:"Choose where to install maestro commands, agents, and workflows."})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(he,{selected:t==="global",onClick:()=>o("global"),title:"Global",description:"Install to home directory (~/.claude/, ~/.maestro/). Available across all projects.",recommended:!0}),e.jsx(he,{selected:t==="project",onClick:()=>o("project"),title:"Project",description:"Install to a specific project directory. Commands are project-scoped."})]}),t==="project"&&e.jsxs("div",{className:"flex flex-col gap-[6px]",children:[e.jsx("label",{className:"text-[11px] font-semibold text-text-secondary uppercase tracking-[0.04em]",children:"Project Path"}),e.jsx("input",{type:"text",value:r,onChange:x=>n(x.target.value),placeholder:"/path/to/your/project",className:"w-full px-3 py-2 rounded-[var(--radius-md)] border border-border bg-bg-card text-[12px] text-text-primary placeholder:text-text-tertiary focus:outline-none focus:border-[var(--color-status-planning,#9178B5)] transition-colors"})]}),m.length>0&&e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-[rgba(184,149,64,0.04)] px-4 py-3",children:[e.jsx("p",{className:"text-[11px] font-semibold text-[var(--color-status-executing,#B89540)] mb-1",children:"Existing installations found"}),e.jsx("div",{className:"flex flex-col gap-1",children:m.slice(0,3).map(x=>e.jsxs("p",{className:"text-[10px] text-text-tertiary font-mono",children:[x.scope," — v",x.version," — ",new Date(x.installedAt).toLocaleDateString()]},x.id))})]}),i&&e.jsx("div",{className:"rounded-[var(--radius-md)] border border-[rgba(196,101,85,0.3)] bg-[rgba(196,101,85,0.04)] px-4 py-3",children:e.jsx("p",{className:"text-[11px] text-status-failed",children:i})}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx("button",{type:"button",disabled:!l||a,onClick:()=>void d(),className:"flex items-center gap-[6px] px-5 py-[8px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md disabled:opacity-40 disabled:cursor-default disabled:transform-none",children:a?e.jsxs(e.Fragment,{children:[e.jsx(xt,{}),"Scanning..."]}):"Next"})})]})}function he({selected:t,onClick:o,title:r,description:n,recommended:a}){return e.jsxs("button",{type:"button",onClick:o,className:"flex items-start gap-3 p-4 rounded-[var(--radius-lg)] border text-left transition-all cursor-pointer w-full",style:{borderColor:t?"var(--color-text-primary, #1A1917)":"var(--color-border, #E8E5DE)",background:t?"rgba(26,25,23,0.02)":"var(--color-bg-card, #F8F7F5)"},children:[e.jsx("div",{className:"w-[18px] h-[18px] rounded-full border-2 flex items-center justify-center shrink-0 mt-[1px]",style:{borderColor:t?"var(--color-text-primary, #1A1917)":"var(--color-border, #E8E5DE)"},children:t&&e.jsx("div",{className:"w-[10px] h-[10px] rounded-full",style:{background:"var(--color-text-primary, #1A1917)"}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-text-primary",children:r}),a&&e.jsx("span",{className:"text-[8px] font-bold px-[6px] py-[1px] rounded-full bg-[rgba(90,158,120,0.1)] text-[var(--color-status-completed,#5A9E78)] uppercase tracking-wider",children:"Recommended"})]}),e.jsx("p",{className:"text-[11px] text-text-tertiary mt-[2px] leading-[1.4]",children:n})]})]})}function xt(){return e.jsxs("svg",{className:"animate-spin w-[14px] h-[14px]",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.3"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}function pt(){const t=u(s=>s.detection),o=u(s=>s.selectedComponents),r=u(s=>s.toggleComponent),n=u(s=>s.selectAllComponents),a=u(s=>s.backup),i=u(s=>s.setBackup),d=u(s=>s.mcpEnabled),m=u(s=>s.setMcpEnabled),b=u(s=>s.enabledTools),l=u(s=>s.toggleTool),x=u(s=>s.setStep);if(!t)return null;const p=t.components.filter(s=>s.available).every(s=>o.has(s.id));return e.jsxs("div",{className:"flex flex-col gap-5 max-w-[560px] mx-auto py-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-text-primary",children:"Components"}),e.jsx("button",{type:"button",onClick:n,className:"text-[10px] font-semibold text-text-tertiary hover:text-text-primary transition-colors cursor-pointer",children:p?"All selected":"Select all"})]}),e.jsxs("div",{className:"flex flex-col gap-[6px]",children:[t.components.map(s=>e.jsxs("label",{className:"flex items-center gap-3 px-3 py-[10px] rounded-[var(--radius-md)] border border-border bg-bg-card cursor-pointer hover:bg-bg-hover transition-colors",style:{opacity:s.available?1:.4,pointerEvents:s.available?"auto":"none"},children:[e.jsx("input",{type:"checkbox",checked:o.has(s.id),onChange:()=>r(s.id),disabled:!s.available,className:"w-[14px] h-[14px] accent-[var(--color-text-primary,#1A1917)] cursor-pointer"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:s.label}),e.jsxs("span",{className:"text-[10px] text-text-tertiary ml-2 font-mono",children:[s.fileCount," files"]})]}),e.jsx("span",{className:"text-[9px] text-text-tertiary font-mono max-w-[200px] truncate",title:s.targetDir,children:s.targetDir.replace(/\\/g,"/").replace(/^.*\/\./,"~/.")})]},s.id)),e.jsxs("label",{className:"flex items-center gap-3 px-3 py-[10px] rounded-[var(--radius-md)] border border-border bg-bg-card cursor-pointer hover:bg-bg-hover transition-colors",children:[e.jsx("input",{type:"checkbox",checked:o.has("mcp"),onChange:()=>r("mcp"),className:"w-[14px] h-[14px] accent-[var(--color-text-primary,#1A1917)] cursor-pointer"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:"MCP Server"}),e.jsx("span",{className:"text-[10px] text-text-tertiary ml-2",children:"Register maestro-tools MCP"})]})]})]})]}),t.existingManifest&&e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-[rgba(184,149,64,0.3)] bg-[rgba(184,149,64,0.04)] px-4 py-3",children:[e.jsxs("p",{className:"text-[11px] font-semibold text-[var(--color-status-executing,#B89540)] mb-2",children:["Existing installation (v",t.existingManifest.version,") will be overwritten"]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:a,onChange:s=>i(s.target.checked),className:"w-[14px] h-[14px] accent-[var(--color-status-executing,#B89540)] cursor-pointer"}),e.jsx("span",{className:"text-[11px] text-text-secondary",children:"Create backup before installing"})]})]}),o.has("mcp")&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-text-primary",children:"MCP Tools"}),e.jsxs("label",{className:"flex items-center gap-[6px] cursor-pointer ml-auto",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:s=>m(s.target.checked),className:"w-[13px] h-[13px] accent-[var(--color-text-primary,#1A1917)] cursor-pointer"}),e.jsx("span",{className:"text-[10px] text-text-secondary font-semibold",children:"Enable MCP"})]})]}),d&&e.jsx("div",{className:"flex flex-wrap gap-[6px]",children:te.map(s=>e.jsx("button",{type:"button",onClick:()=>l(s),className:"px-[10px] py-[5px] rounded-full border text-[10px] font-mono font-semibold transition-all cursor-pointer",style:{borderColor:b.has(s)?"var(--color-text-primary)":"var(--color-border)",background:b.has(s)?"var(--color-text-primary)":"var(--color-bg-card)",color:b.has(s)?"#fff":"var(--color-text-tertiary)"},children:s},s))})]}),t.disabledItems.length>0&&e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-bg-card px-4 py-3",children:[e.jsxs("p",{className:"text-[11px] font-semibold text-text-secondary mb-1",children:[t.disabledItems.length," disabled item(s) will be preserved"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.disabledItems.map(s=>e.jsxs("span",{className:"text-[9px] font-mono text-text-tertiary px-[6px] py-[2px] rounded bg-bg-secondary",children:[s.name," (",s.type,")"]},s.relativePath))})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsx("button",{type:"button",onClick:()=>x("mode"),className:"px-4 py-[7px] rounded-[var(--radius-lg)] border border-border bg-bg-card text-[12px] font-semibold text-text-secondary hover:text-text-primary hover:border-text-tertiary transition-all cursor-pointer",children:"Back"}),e.jsx("button",{type:"button",onClick:()=>x("review"),disabled:o.size===0,className:"px-5 py-[8px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md disabled:opacity-40 disabled:cursor-default disabled:transform-none",children:"Review"})]})]})}function mt(){const t=u(s=>s.mode),o=u(s=>s.projectPath),r=u(s=>s.detection),n=u(s=>s.selectedComponents),a=u(s=>s.backup),i=u(s=>s.mcpEnabled),d=u(s=>s.enabledTools),m=u(s=>s.setStep),b=u(s=>s.install);if(!r)return null;const l=r.components.filter(s=>s.available&&n.has(s.id)),x=l.reduce((s,h)=>s+h.fileCount,0),p=n.has("mcp");return e.jsxs("div",{className:"flex flex-col gap-5 max-w-[560px] mx-auto py-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[14px] font-semibold text-text-primary mb-1",children:"Review Installation"}),e.jsx("p",{className:"text-[12px] text-text-tertiary",children:"Confirm the following will be installed."})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(X,{label:"Mode",value:t}),e.jsx(X,{label:"Components",value:String(l.length+(p?1:0))}),e.jsx(X,{label:"Files",value:String(x)}),e.jsx(X,{label:"Backup",value:a&&r.existingManifest?"Yes":"No"})]}),t==="project"&&o&&e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:"font-semibold text-text-secondary",children:"Project:"}),e.jsx("span",{className:"font-mono text-text-tertiary",children:o})]}),e.jsx("div",{className:"rounded-[var(--radius-md)] 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 text-[9px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-3 py-[6px] bg-bg-secondary border-b border-border",children:"Component"}),e.jsx("th",{className:"text-left text-[9px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-3 py-[6px] bg-bg-secondary border-b border-border",children:"Target"}),e.jsx("th",{className:"text-right text-[9px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-3 py-[6px] bg-bg-secondary border-b border-border w-[60px]",children:"Files"})]})}),e.jsxs("tbody",{children:[l.map(s=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[11px] font-semibold text-text-primary",children:s.label}),e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[10px] font-mono text-text-tertiary max-w-[250px] truncate",title:s.targetDir,children:s.targetDir.replace(/\\/g,"/").replace(/^.*\/\./,"~/.")}),e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[11px] font-mono text-text-secondary text-right",children:s.fileCount})]},s.id)),p&&e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[11px] font-semibold text-text-primary",children:"MCP Server"}),e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[10px] font-mono text-text-tertiary",children:t==="project"?".mcp.json":"~/.claude.json"}),e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[11px] font-mono text-text-secondary text-right",children:"—"})]})]})]})}),p&&i&&e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-bg-card px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-semibold text-text-secondary uppercase tracking-[0.04em] mb-1",children:"MCP Tools"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:Array.from(d).map(s=>e.jsx("span",{className:"text-[9px] font-mono font-semibold px-[7px] py-[2px] rounded-full bg-[rgba(90,158,120,0.08)] text-[var(--color-status-completed,#5A9E78)]",children:s},s))})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsx("button",{type:"button",onClick:()=>m("configure"),className:"px-4 py-[7px] rounded-[var(--radius-lg)] border border-border bg-bg-card text-[12px] font-semibold text-text-secondary hover:text-text-primary hover:border-text-tertiary transition-all cursor-pointer",children:"Back"}),e.jsx("button",{type:"button",onClick:()=>void b(),className:"px-5 py-[8px] rounded-[var(--radius-lg)] border-none bg-[var(--color-status-completed,#5A9E78)] text-white text-[12px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md",children:"Install"})]})]})}function X({label:t,value:o}){return e.jsxs("div",{className:"flex-1 rounded-[var(--radius-md)] border border-border bg-bg-card px-3 py-2 text-center",children:[e.jsx("div",{className:"text-[14px] font-extrabold text-text-primary font-mono capitalize",children:o}),e.jsx("div",{className:"text-[9px] font-semibold text-text-tertiary uppercase tracking-[0.04em]",children:t})]})}function bt(){const t=u(a=>a.installing),o=u(a=>a.result),r=u(a=>a.setOpen),n=u(a=>a.reset);return t?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-16",children:[e.jsxs("svg",{className:"animate-spin w-8 h-8 text-text-primary",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2.5",opacity:"0.15"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})]}),e.jsx("p",{className:"text-[13px] font-semibold text-text-primary",children:"Installing..."}),e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"Copying files and registering configuration"})]}):o?o.success?e.jsxs("div",{className:"flex flex-col items-center gap-5 py-10 max-w-[440px] mx-auto",children:[e.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center",style:{background:"rgba(90,158,120,0.1)"},children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-status-completed, #5A9E78)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-[14px] font-semibold text-text-primary mb-1",children:"Installation Complete"}),e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"All components installed successfully."})]}),e.jsxs("div",{className:"w-full rounded-[var(--radius-md)] border border-border bg-bg-card overflow-hidden",children:[e.jsx(I,{label:"Files installed",value:String(o.filesInstalled)}),e.jsx(I,{label:"Directories created",value:String(o.dirsCreated)}),e.jsx(I,{label:"Components",value:o.components.join(", ")}),o.disabledItemsRestored>0&&e.jsx(I,{label:"Disabled items restored",value:String(o.disabledItemsRestored)}),e.jsx(I,{label:"MCP registered",value:o.mcpRegistered?"Yes":"No"}),e.jsx(I,{label:"Manifest",value:o.manifestPath.replace(/\\/g,"/").split("/").slice(-1)[0],last:!0})]}),e.jsx("button",{type:"button",onClick:()=>r(!1),className:"px-5 py-[8px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md",children:"Done"})]}):e.jsxs("div",{className:"flex flex-col items-center gap-5 py-10 max-w-[440px] mx-auto",children:[e.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center",style:{background:"rgba(196,101,85,0.1)"},children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-status-failed, #C46555)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-[14px] font-semibold text-text-primary mb-1",children:"Installation Failed"}),e.jsx("p",{className:"text-[11px] text-status-failed",children:o.error})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{type:"button",onClick:n,className:"px-4 py-[7px] rounded-[var(--radius-lg)] border border-border bg-bg-card text-[12px] font-semibold text-text-secondary hover:text-text-primary transition-all cursor-pointer",children:"Try Again"}),e.jsx("button",{type:"button",onClick:()=>r(!1),className:"px-4 py-[7px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer transition-all",children:"Close"})]})]}):null}function I({label:t,value:o,last:r}){return e.jsxs("div",{className:"flex items-center justify-between px-4 py-[8px]",style:{borderBottom:r?"none":"1px solid var(--color-border-divider)"},children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-tertiary uppercase tracking-[0.04em]",children:t}),e.jsx("span",{className:"text-[11px] font-mono text-text-primary",children:o})]})}function ut(){const t=u(a=>a.open),o=u(a=>a.setOpen),r=u(a=>a.step),n=u(a=>a.installing);return e.jsx(ye,{open:t,onOpenChange:a=>{!a&&n||o(a)},children:e.jsxs(je,{children:[e.jsx(Ne,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(we,{className:B("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[640px] max-w-[95vw] max-h-[85vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(Ce,{className:"text-[14px] font-semibold text-text-primary",children:"Install Wizard"}),e.jsx(ct,{current:r})]}),!n&&e.jsx(ke,{className:B("w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)]","text-text-tertiary hover:text-text-primary hover:bg-bg-hover","transition-colors"),"aria-label":"Close",children:e.jsxs("svg",{className:"w-[14px] h-[14px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5",children:[r==="mode"&&e.jsx(dt,{}),r==="configure"&&e.jsx(pt,{}),r==="review"&&e.jsx(mt,{}),r==="progress"&&e.jsx(bt,{})]})]})]})})}const ht=[{label:"List",icon:e.jsx(Oe,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Cards",icon:e.jsx(Le,{size:14,strokeWidth:1.8}),shortcut:"2"},{label:"Templates",icon:e.jsx(Je,{size:14,strokeWidth:1.8}),shortcut:"3"}],fe=["list","cards","templates"],ee={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function Bt(){const t=f(l=>l.activeView),o=f(l=>l.setActiveView),r=f(l=>l.fetchConfig),n=f(l=>l.fetchTemplates),a=f(l=>l.loading),i=f(l=>l.error),{register:d,unregister:m}=y.useContext(Me),b=y.useCallback(l=>o(fe[l]),[o]);return y.useEffect(()=>{d({items:ht.map(l=>({label:l.label,icon:l.icon,shortcut:l.shortcut})),activeIndex:fe.indexOf(t),onSwitch:b})},[t,d,b]),y.useEffect(()=>()=>m(),[m]),y.useEffect(()=>{function l(x){x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement||(x.key==="1"?o("list"):x.key==="2"?o("cards"):x.key==="3"&&o("templates"))}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[o]),y.useEffect(()=>{r(),n()},[r,n]),a?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading MCP configuration..."}):i?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 MCP config"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:i}),e.jsx("button",{type:"button",onClick:()=>void r(),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"})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(ut,{}),e.jsx(nt,{}),e.jsxs(Be,{mode:"wait",children:[t==="list"&&e.jsx(M.div,{className:"flex-1 flex flex-col overflow-hidden",variants:ee,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(qe,{})},"list"),t==="cards"&&e.jsx(M.div,{className:"flex-1 flex flex-col overflow-hidden",variants:ee,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(tt,{})},"cards"),t==="templates"&&e.jsx(M.div,{className:"flex-1 flex flex-col overflow-hidden",variants:ee,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(ot,{})},"templates")]})]})}export{Bt as McpPage};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{d as h,r as d,j as t,F as v}from"./index-11DuhKhc.js";import{S as g}from"./search-BQbBTIYl.js";import{F as y,a as b,D as j}from"./folder-Bvjj8Vn9.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=h("file-braces",k);/**
|
|
7
|
-
* @license lucide-react v0.577.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const N=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],T=h("folder-tree",N);function W({tree:e,selectedPath:s,onSelectFile:a,loading:r}){const[o,i]=d.useState(""),l=d.useMemo(()=>{if(!o.trim())return e;const n=o.toLowerCase();return f(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:C(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:s,onSelectFile:a,defaultOpen:!o.trim()},n.path))})]})}function u({node:e,depth:s,selectedPath:a,onSelectFile:r,defaultOpen:o}){const[i,l]=d.useState(s<1||!o),n=d.useCallback(()=>{e.type==="directory"?l(c=>!c):r(e.path)},[e,r]),x=e.path===a,m=s*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:m},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:z(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(L,{name:e.name}),e.type==="directory"&&t.jsx(M,{node:e})]}),e.type==="directory"&&i&&e.children&&t.jsx("div",{children:e.children.map(c=>t.jsx(u,{node:c,depth:s+1,selectedPath:a,onSelectFile:r,defaultOpen:o},c.path))})]})}function z(e,s){if(e.type==="directory")return s?t.jsx(y,{size:14,strokeWidth:1.8,style:{color:"var(--color-accent-yellow)"}}):t.jsx(b,{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 p(e){return e.type==="file"?1:e.children?e.children.reduce((s,a)=>s+p(a),0):0}function C(e){return e.reduce((s,a)=>s+p(a),0)}function L({name:e}){const s=e.slice(e.lastIndexOf(".")).toLowerCase();let a="",r="",o="";switch(s){case".json":a="JSON",r="var(--color-status-bg-executing)",o="var(--color-accent-yellow)";break;case".md":a="MD",r="var(--color-status-bg-exploring)",o="var(--color-accent-blue)";break;case".ndjson":case".jsonl":a="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:a})}function M({node:e}){if(e.name.match(/^(\d{2})-/)){const a={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?p(e):0,o=r>0,i=e.name.toLowerCase();for(const[l,n]of Object.entries(a))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:p(e)}):null}function f(e,s){const a=[];for(const r of e)if(r.type==="file")(r.name.toLowerCase().includes(s)||r.path.toLowerCase().includes(s))&&a.push(r);else{const o=r.children?f(r.children,s):[];o.length>0?a.push({...r,children:o}):r.name.toLowerCase().includes(s)&&a.push(r)}return a}export{w as F,W as T,T as a};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{d as K,j as e,S as m,a as w,r as f,c as H,L as _,V as J,b as X,p as Y}from"./index-11DuhKhc.js";import{u as Z}from"./shallow-Clb1Lyd_.js";import{u as T,S as I,P as E,T as ee,D as te,K as se}from"./table-BqxCXid2.js";import{C as $}from"./check-Cbxq2l1-.js";import{L as U}from"./list-Dj4i9N75.js";import{C as L}from"./circle-check-BA5_XqeV.js";import{C as ae}from"./circle-alert-B25g9BTL.js";import{C as re}from"./columns-3-DV4oeCfU.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=K("play",ne),W=[{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 le(t,s){return s==="completed"?t.filter(a=>a.status==="completed").length:s==="verifying"?t.filter(a=>a.status==="verifying"||a.status==="testing").length:t.filter(a=>a.status===s).length}function oe({phases:t}){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:W.map((s,a)=>{const r=le(t,s.status),n=m[s.status];return e.jsxs("div",{className:"contents",children:[e.jsxs("div",{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)] text-text-tertiary",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full shrink-0",style:{backgroundColor:n}}),s.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:r})]}),a<W.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"})})]},s.status)})})}const S={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)"}},O={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 B(t){return{feature:"feat",refactor:"refac"}[t]??t}function de({task:t}){const s=S[t.type]??S[B(t.type)]??S.feat,a=O[t.status]??O.pending,r=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:B(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:r})]})}const xe={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 r=w(g=>g.setSelectedPhase),[n,x]=f.useState(!1),{tasks:i,loading:d}=T(n?t.phase:null),{tasks_completed:p,tasks_total:l,current_wave:c}=t.execution,u=m[t.status],j=t.verification.gaps.length>0,y=t.plan.task_count>0,o=H(g=>g.issues),h=f.useMemo(()=>o.filter(g=>g.phase_id===t.phase),[o,t.phase]),b=h.filter(g=>{var v;return((v=g.execution)==null?void 0:v.status)==="running"}).length;return e.jsxs("div",{children:[e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>r(t.phase),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),r(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:[y&&e.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),x(!n)},className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors","aria-label":n?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${n?"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(I,{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}),l>0&&e.jsx(E,{completed:p,total:l,color:u}),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:u},children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse motion-reduce:animate-none",style:{backgroundColor:u}}),"Wave ",c," active"]}),j&&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"]}),b>0&&e.jsxs(_,{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:`${b} issue(s) running — view in Kanban`,children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse",style:{backgroundColor:"#B89540"}}),b," running"]}),h.length>0&&b===0&&e.jsxs(_,{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:[h.length," issue",h.length>1?"s":""]})]}),n&&e.jsx("div",{className:"mt-[var(--spacing-1)] flex flex-col gap-[var(--spacing-1)]",children:d?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary px-[var(--spacing-3)] py-[var(--spacing-2)]",children:"Loading tasks..."}):i.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"}):i.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))})]})}function ge({color:t,phases:s,label:a,onSelectTask:r}){return e.jsxs("div",{className:"flex flex-col min-w-[220px] flex-1 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.jsx("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-2)] pb-[var(--spacing-2)] flex flex-col gap-[var(--spacing-2)]",children:s.map(n=>e.jsx(pe,{phase:n,onSelectTask:r},n.phase))})]})}function ue(){var p;const t=w(l=>l.board),s=(t==null?void 0:t.phases)??[],a=s.filter(l=>l.status==="completed").length,r=s.length,n=s.reduce((l,c)=>l+c.execution.tasks_completed,0),x=s.reduce((l,c)=>l+c.execution.tasks_total,0),i=x>0?Math.round(n/x*100):0,d=((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:[d&&e.jsx("span",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:d}),e.jsxs("span",{className:"text-text-secondary",children:["Phases: ",e.jsxs("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:[a,"/",r]})," complete"]}),e.jsxs("span",{className:"text-text-secondary",children:["Tasks: ",e.jsxs("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:[n,"/",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:`${i}%`,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:[i,"%"]})]})]})}const P=[{status:"pending",label:"Pending",match:["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 P)s.set(a.status,[]);for(const a of t){const r=P.find(n=>n.match.includes(a.status));r&&s.get(r.status).push(a)}return s}function ve({onSelectTask:t}){const s=w(r=>{var n;return((n=r.board)==null?void 0:n.phases)??[]}),a=f.useMemo(()=>me(s),[s]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(oe,{phases:s}),e.jsx("div",{className:"flex gap-[var(--spacing-2-5)] flex-1 overflow-x-auto px-[var(--spacing-3)] py-[var(--spacing-3)]",children:P.map(r=>e.jsx(ge,{status:r.status,color:m[r.status],label:r.label,phases:a.get(r.status)??[],onSelectTask:t},r.status))}),e.jsx(ue,{})]})}const he=6,fe=Array.from({length:he},(t,s)=>`Week ${s+1}`),R={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 je({phaseId:t,onSelectTask:s}){const{tasks:a,loading:r}=T(t);return r?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(n=>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:n,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:R[n.meta.status]??"var(--color-status-pending)"}}),e.jsx("span",{className:"font-mono text-[length:10px] text-text-tertiary shrink-0",children:n.id}),e.jsx("span",{className:"text-text-secondary truncate",children:n.title}),e.jsx("span",{className:"ml-auto pr-[var(--spacing-3)] text-[length:10px] font-[var(--font-weight-medium)] shrink-0",style:{color:R[n.meta.status]??"var(--color-text-tertiary)"},children:be[n.meta.status]??n.meta.status})]}),e.jsx("div",{})]},n.id))})}function ye({onSelectPhase:t,onSelectTask:s}){const a=w(o=>o.board),[r,n]=f.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,i=x.length,d=x.reduce((o,h)=>o+h.execution.tasks_total,0),p=x.reduce((o,h)=>o+h.execution.tasks_completed,0),l=d>0?Math.round(p/d*100):0,c=x.find(o=>o.status==="executing"),u=c?x.indexOf(c):-1,j=u>=0&&c?(()=>{const o=u/i*100,h=1/i*100,b=c.execution.tasks_total>0?c.execution.tasks_completed/c.execution.tasks_total:0;return o+h*b})():-1;function y(o){n(h=>{const b=new Set(h);return b.has(o)?b.delete(o):b.add(o),b})}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(o=>e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:o},o))})]}),x.map((o,h)=>{const b=m[o.status],g=h/i*100,v=1/i*100,N=o.execution.tasks_total>0?o.execution.tasks_completed/o.execution.tasks_total:0,G=o.status==="pending"?.5:o.status==="completed"?1:.85,A=o.plan.task_count>0,z=r.has(o.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(o.phase),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-[length:var(--font-size-xs)]",children:[A&&e.jsx("button",{type:"button",onClick:Q=>{Q.stopPropagation(),y(o.phase)},className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors shrink-0","aria-label":z?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${z?"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"})})}),!A&&e.jsx("span",{className:"w-4 shrink-0"}),e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:b}}),e.jsx("span",{className:"font-[var(--font-weight-medium)] text-text-primary truncate",children:o.title}),e.jsxs("span",{className:"ml-auto pr-[var(--spacing-3)] font-mono text-[length:10px] text-text-tertiary",children:[o.execution.tasks_completed,"/",o.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:`${v}%`,backgroundColor:b,opacity:G},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(o.phase).padStart(2,"0"),N>0&&N<1?` (${Math.round(N*100)}%)`:""]})]}),j>=0&&(c==null?void 0:c.phase)===o.phase&&e.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-[var(--color-status-blocked)] z-[5] rounded-sm",style:{left:`${j}%`},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"})})]})]}),z&&e.jsx(je,{phaseId:o.phase,onSelectTask:s})]},o.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,"/",d," tasks complete (",l,"%)"]}),e.jsx("div",{className:"w-[200px]",children:e.jsx(E,{completed:p,total:d})})]})]})}const Ne={pending:"Pending",exploring:"Explore",planning:"Plan",executing:"Execute",verifying:"Verify",testing:"Test",completed:"Done",blocked:"Blocked"};function F(t){return t==="completed"}function q(t){return t==="executing"}function we(t){return F(t)||q(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 r=m[s.status],n=F(s.status),x=q(s.status),i=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:r,opacity:i},children:[n?e.jsx($,{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:r}})]}),e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] max-w-[80px] text-center truncate text-text-tertiary",style:x?{color:r,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, ${r} 12%, transparent)`,color:r},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"}),n&&e.jsx("div",{className:"absolute top-0 left-0 h-full rounded-sm",style:{width:"100%",backgroundColor:"var(--color-status-completed)"}}),!n&&e.jsx("div",{className:"absolute -right-px -top-[3px] border-[3px] border-transparent border-l-[5px] border-l-border"})]})]},s.phase)})})}const Ce={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,r)=>r.phase<a.phase?r:a,s[0])}function Se({phase:t}){const[s,a]=f.useState(!1),r=f.useRef(null);if(f.useEffect(()=>()=>{r.current&&clearTimeout(r.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)),i=m[t.status];function d(){navigator.clipboard.writeText(x).then(()=>{a(!0),r.current&&clearTimeout(r.current),r.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:i},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:`${i}1a`,color:i},children:t.status})]})]}),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:d,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=w(a=>{var r;return((r=a.board)==null?void 0:r.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:m.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:r}=t.execution,n=a>0?Math.round(s/a*100):0,x=m[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:`${n}%`,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:[n,"%"]})]})]}),r>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 ",r]}),t.plan.task_ids.length>0&&e.jsx("div",{className:"flex flex-col gap-1",children:t.plan.task_ids.map(i=>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:i}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-quaternary",children:i})]},i))})]})}const Te={pending:"Pending",exploring:"Exploring",planning:"Planning",executing:"Executing",verifying:"Verifying",testing:"Testing",completed:"Completed",blocked:"Blocked"};function Ee(){const t=w(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(U,{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=m[s.status],{tasks_completed:r,tasks_total:n,current_wave:x}=s.execution,i=n>0?Math.round(r/n*100):0,d=s.status==="executing",p=s.status==="completed";let l=Te[s.status];return d&&x>0&&(l+=` -- Wave ${x}`),s.verification.gaps.length>0&&(l+=` -- ${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",d?"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($,{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:d?{color:a}:void 0,children:l})]}),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:[r,"/",n]}),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:`${i}%`,backgroundColor:a}})})]})]},s.phase)})})]})}function $e(){const t=w(l=>l.board),s=(t==null?void 0:t.phases)??[],a=s.reduce((l,c)=>l+c.execution.tasks_completed,0),r=s.reduce((l,c)=>l+c.execution.tasks_total,0),n=s.filter(l=>l.status==="completed").length,x=s.length,i=s.reduce((l,c)=>l+c.execution.commits.length,0),d=s.filter(l=>l.status==="verifying"||l.status==="testing"),p=s.flatMap(l=>l.verification.gaps.map(c=>({phase:l.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(L,{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:`/${r}`,detail:`${r>0?Math.round(a/r*100):0}% complete`}),e.jsx(C,{label:"Phases",value:n,sub:`/${x}`,detail:`${x>0?Math.round(n/x*100):0}% complete`}),e.jsx(C,{label:"Gaps",value:p.length,color:p.length>0?m.blocked:void 0,detail:"active"}),e.jsx(C,{label:"Commits",value:i,detail:"this milestone"})]}),d.length>0&&e.jsx("div",{className:"mb-[var(--spacing-3-5)]",children:d.map(l=>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(L,{size:12,strokeWidth:2,style:{color:m[l.status]}}),"Verification (P-",String(l.phase).padStart(2,"0"),")"]}),l.verification.must_haves.map((c,u)=>{const y=l.verification.gaps.map(o=>typeof o=="string"?o:o.description??o.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:[y?e.jsx(ae,{size:12,strokeWidth:2.5,style:{color:m.blocked}}):e.jsx($,{size:12,strokeWidth:2.5,style:{color:m.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:y?m.blocked:m.completed},children:y?"Gap":"Verified"})]},u)})]},l.phase))}),s.some(l=>l.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(l=>l.validation.test_coverage!==null).map(l=>{const c=l.validation.test_coverage,u=typeof c=="number"?c:typeof c=="object"&&c!==null?c.statements??0:0,j=u>=80?m.completed:u>=60?m.executing:m.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(l.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:`${u}%`,backgroundColor:j}})}),e.jsxs("span",{className:"w-9 text-right font-mono font-[var(--font-weight-semibold)] text-text-secondary",children:[u.toFixed(1),"%"]})]},l.phase)})]})]})]})}function C({label:t,value:s,sub:a,detail:r,color:n}){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:n?{color:n}: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:r})]})}function Ae(t){const s=[];for(const a of t){const r=m[a.status],n=`P-${String(a.phase).padStart(2,"0")} ${a.title}`;a.status==="executing"&&a.execution.current_wave>0&&s.push({color:r,time:"",text:`Wave ${a.execution.current_wave} active -- ${n}`}),a.status==="verifying"&&a.verification.gaps.length>0&&s.push({color:m.blocked,time:"",text:`${a.verification.gaps.length} gap(s) -- ${n}`}),a.status==="completed"&&s.push({color:r,time:"",text:`Completed -- ${n}`})}return s.slice(0,6)}function Le(){const t=w(a=>{var r;return((r=a.board)==null?void 0:r.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,r)=>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,r<s.length-1&&e.jsx("span",{className:"inline-block w-px h-3.5 bg-border-divider ml-[var(--spacing-4)]"})]},r))]})}function We(){const t=w(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 k="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",M={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:r}=T(t);return r?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(n=>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:n,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:M[n.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:n.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:n.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",n.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:M[n.meta.status]??"var(--color-text-tertiary)"},children:Oe[n.meta.status]??n.meta.status})})]},n.id))})}function Re({onSelectTask:t}){const s=w(i=>{var d;return((d=i.board)==null?void 0:d.phases)??[]}),[a,r]=f.useState(new Set),n=f.useMemo(()=>[...s].sort((i,d)=>i.phase-d.phase),[s]);function x(i){r(d=>{const p=new Set(d);return p.has(i)?p.delete(i):p.add(i),p})}return n.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:n.length}),e.jsx("div",{className:"ml-auto flex items-center gap-[var(--spacing-3)]",children:["executing","verifying","planning","completed"].map(i=>{const d=n.filter(p=>p.status===i||i==="verifying"&&p.status==="testing").length;return d===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:m[i]}}),e.jsx("span",{className:"text-[length:10px] text-text-secondary tabular-nums",children:d})]},i)})})]}),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:`${k} w-[60px]`,children:"#"}),e.jsx("th",{className:`${k} w-[120px]`,children:"Status"}),e.jsx("th",{className:k,children:"Title"}),e.jsx("th",{className:`${k} hidden lg:table-cell`,children:"Goal"}),e.jsx("th",{className:`${k} w-[60px] text-center hidden sm:table-cell`,children:"Wave"}),e.jsx("th",{className:`${k} text-right w-[130px] hidden sm:table-cell`,children:"Progress"})]})}),e.jsx("tbody",{children:n.map((i,d)=>{const{tasks_completed:p,tasks_total:l,current_wave:c}=i.execution,u=a.has(i.phase),j=i.plan.task_count>0;return e.jsxs(f.Fragment,{children:[e.jsxs("tr",{className:["border-t border-border-divider transition-colors",d%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:[j&&e.jsx("button",{type:"button",onClick:()=>x(i.phase),className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors","aria-label":u?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${u?"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(i.phase).padStart(2,"0")]})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(I,{status:i.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:i.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:i.goal})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-center hidden sm:table-cell",children:i.status==="executing"&&c>0?e.jsxs("span",{className:"text-[length:10px] font-[var(--font-weight-semibold)] tabular-nums",style:{color:m.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:l>0?e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] justify-end",children:[e.jsx("div",{className:"w-[56px]",children:e.jsx(E,{completed:p,total:l,color:m[i.status]})}),e.jsxs("span",{className:"text-[length:10px] text-text-tertiary tabular-nums w-[32px] text-right shrink-0",children:[p,"/",l]})]}):e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary block text-right",children:"—"})})]}),u&&e.jsx(Be,{phaseId:i.phase,onSelectTask:t})]},i.phase)})})]})})]})}const D=[{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 Me({project:t}){var x;const[s,a]=f.useState(null),r=((x=D.find(i=>!i.done(t)))==null?void 0:x.id)??null;function n(i){navigator.clipboard.writeText(i.command).catch(()=>{}),a(i.id),setTimeout(()=>a(d=>d===i.id?null:d),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:D.map(i=>{const d=i.done(t),p=i.id===r,l=d?"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:l,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:d?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:i.label}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-tertiary",children:i.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:i.command}),e.jsx("button",{type:"button",onClick:()=>n(i),className:"cursor-pointer text-text-tertiary hover:text-text-primary text-[length:var(--font-size-sm)] transition-colors",children:s===i.id?"Copied!":"Copy"})]})]})]})},i.id)})})]})}const V=["board","timeline","center","table"];function Ke(){const[t,s]=f.useState("board"),[a,r]=f.useState(null),{register:n,unregister:x}=f.useContext(J),i=X(v=>v.recentDecisions),d=f.useMemo(()=>i.flatMap(v=>v.actions.filter(N=>N.type==="advance_phase")).slice(-3),[i]),{phases:p,board:l,selectedPhase:c,setSelectedPhase:u}=w(Z(v=>{var N;return{phases:((N=v.board)==null?void 0:N.phases)??[],board:v.board,selectedPhase:v.selectedPhase,setSelectedPhase:v.setSelectedPhase}})),j=f.useCallback(v=>{s(V[v]),u(null),r(null)},[u]),y=f.useCallback(v=>{r(v),u(null)},[u]),o=f.useMemo(()=>({items:[{label:"Board",icon:e.jsx(re,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Timeline",icon:e.jsx(U,{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:V.indexOf(t),onSwitch:j}),[t,j]);f.useEffect(()=>{n(o)},[o,n]),f.useEffect(()=>()=>x(),[x]);const h=a??(c!==null?{type:"phase",phaseId:c}:null),b=h!==null,g=(h==null?void 0:h.type)==="task"?"Task Detail":"Phase Detail";return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-end px-[var(--spacing-4)] py-[var(--spacing-1)] border-b border-border-divider bg-bg-secondary text-[length:var(--font-size-xs)]",children:[d.length>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mr-auto",children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full bg-accent-blue animate-pulse"}),e.jsxs("span",{className:"text-text-secondary",children:["Commander recommends advancing: ",d.map(v=>v.target).join(", ")]})]}),e.jsx(_,{to:"/supervisor",className:"text-text-secondary hover:text-text-primary transition-colors font-[var(--font-weight-medium)]",children:"Supervisor →"})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:p.length===0?e.jsx(Me,{project:l==null?void 0:l.project}):e.jsxs(e.Fragment,{children:[t==="board"&&e.jsx(ve,{onSelectTask:y}),t==="timeline"&&e.jsx(ye,{onSelectPhase:v=>{r(null),u(c===v?null:v)},onSelectTask:y}),t==="center"&&e.jsx(We,{}),t==="table"&&e.jsx(Re,{onSelectTask:y})]})}),e.jsx(te,{open:b,onClose:()=>{u(null),r(null)},title:g,children:h!==null&&e.jsx(se,{selectedItem:h})})]})]})}export{Ke as WorkflowPage};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{d as c}from"./index-11DuhKhc.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 e=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],i=c("git-branch",e);export{i as G};
|