maestro-flow 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/learn-decompose.md +3 -3
- package/.claude/commands/learn-follow.md +5 -5
- package/.claude/commands/learn-investigate.md +3 -3
- package/.claude/commands/learn-retro.md +6 -6
- package/.claude/commands/learn-second-opinion.md +3 -3
- package/.claude/commands/maestro-analyze.md +123 -99
- package/.claude/commands/maestro-brainstorm.md +2 -2
- package/.claude/commands/maestro-execute.md +137 -97
- package/.claude/commands/maestro-fork.md +111 -0
- package/.claude/commands/maestro-init.md +6 -6
- package/.claude/commands/maestro-merge.md +77 -0
- package/.claude/commands/maestro-milestone-audit.md +72 -60
- package/.claude/commands/maestro-milestone-complete.md +67 -59
- package/.claude/commands/maestro-milestone-release.md +6 -6
- package/.claude/commands/maestro-plan.md +151 -130
- package/.claude/commands/maestro-quick.md +4 -4
- package/.claude/commands/maestro-roadmap.md +5 -5
- package/.claude/commands/maestro-spec-generate.md +5 -5
- package/.claude/commands/maestro-ui-design.md +3 -3
- package/.claude/commands/maestro-verify.md +106 -87
- package/.claude/commands/maestro.md +10 -4
- package/.claude/commands/manage-codebase-rebuild.md +4 -4
- package/.claude/commands/manage-codebase-refresh.md +1 -1
- package/.claude/commands/manage-harvest.md +5 -5
- package/.claude/commands/manage-issue-discover.md +1 -1
- package/.claude/commands/manage-issue-execute.md +6 -6
- package/.claude/commands/manage-issue.md +6 -6
- package/.claude/commands/manage-learn.md +2 -2
- package/.claude/commands/manage-memory-capture.md +4 -4
- package/.claude/commands/manage-memory.md +2 -2
- package/.claude/commands/manage-status.md +24 -24
- package/.claude/commands/quality-business-test.md +5 -5
- package/.claude/commands/quality-debug.md +4 -4
- package/.claude/commands/quality-integration-test.md +4 -4
- package/.claude/commands/quality-refactor.md +3 -3
- package/.claude/commands/quality-retrospective.md +2 -2
- package/.claude/commands/quality-review.md +4 -4
- package/.claude/commands/quality-sync.md +3 -3
- package/.claude/commands/quality-test-gen.md +4 -4
- package/.claude/commands/quality-test.md +9 -9
- package/.claude/commands/spec-add.md +2 -2
- package/.claude/commands/spec-load.md +1 -1
- package/.claude/commands/spec-setup.md +5 -5
- package/.claude/commands/wiki-connect.md +3 -3
- package/.claude/commands/wiki-digest.md +4 -4
- package/.codex/skills/maestro-analyze/SKILL.md +52 -14
- package/.codex/skills/maestro-execute/SKILL.md +27 -26
- package/.codex/skills/maestro-milestone-audit/SKILL.md +103 -209
- package/.codex/skills/maestro-milestone-complete/SKILL.md +149 -158
- package/.codex/skills/maestro-plan/SKILL.md +47 -17
- package/.codex/skills/maestro-roadmap/SKILL.md +3 -2
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +1 -1
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +2 -2
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +1 -1
- package/README.md +19 -14
- package/README.zh-CN.md +16 -12
- package/bin/maestro-mcp.js +1 -1
- package/chains/_intent-map.json +21 -9
- package/chains/_router.json +30 -77
- package/chains/brainstorm-driven.json +17 -6
- package/chains/full-lifecycle.json +22 -23
- package/chains/milestone-close.json +20 -7
- package/chains/milestone-fork-merge.json +50 -0
- package/chains/roadmap-driven.json +17 -6
- package/chains/spec-driven.json +17 -6
- package/dashboard/dist/assets/{ArtifactsPage-BmPOu8sO.js → ArtifactsPage-DZNCi6tn.js} +12 -7
- package/dashboard/dist/assets/ChatInput-Bvr-FeEq.js +49 -0
- package/dashboard/dist/assets/ChatPage-D9zTkJZo.js +22 -0
- package/dashboard/dist/assets/CollabPage-B4NAHXS2.js +1 -0
- package/dashboard/dist/assets/ExecutionPanel-CFt4LJyq.js +1 -0
- package/dashboard/dist/assets/KanbanPage-C8USth6H.js +21 -0
- package/dashboard/dist/assets/{MarkdownRenderer-BjZ43aSa.js → MarkdownRenderer-X4af_WNb.js} +1 -1
- package/dashboard/dist/assets/McpPage-BKfCVIyU.js +21 -0
- package/dashboard/dist/assets/OutputPanel-BlBQFJSW.js +1 -0
- package/dashboard/dist/assets/ProblemsPanel-De3DLvoI.js +1 -0
- package/dashboard/dist/assets/{RequirementBoardPage-B7yRL0s_.js → RequirementBoardPage-Bf1trzqs.js} +2 -2
- package/dashboard/dist/assets/{RequirementPage-D8J_-b6O.js → RequirementPage-Bllxe2XI.js} +10 -5
- package/dashboard/dist/assets/{SpecsPage-6lO8v8_C.js → SpecsPage-9lwxKT27.js} +2 -2
- package/dashboard/dist/assets/{SupervisorPage-Ds5N378a.js → SupervisorPage-SusdfHFq.js} +1 -1
- package/dashboard/dist/assets/{TeamsPage-DrkKr17T.js → TeamsPage-DsuM6OwC.js} +2 -2
- package/dashboard/dist/assets/TreeBrowser-Q12qobZs.js +6 -0
- package/dashboard/dist/assets/WorkflowPage-D_Fzdy3_.js +6 -0
- package/dashboard/dist/assets/{arrow-left-CadP5YgU.js → arrow-left-Bqtb2hle.js} +1 -1
- package/dashboard/dist/assets/{check-5xufDzS8.js → check-u6fGOwQO.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-CYbpR4ev.js → chevron-right-Csu22t58.js} +1 -1
- package/dashboard/dist/assets/{circle-Bm-5Q-Yh.js → circle-CMrkbRNg.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-BqcYuT7x.js → circle-alert-c3tH1P4z.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-yyzAFysU.js → circle-check-big-TDSeWstm.js} +1 -1
- package/dashboard/dist/assets/{circle-check-DEVzW_lm.js → circle-check-gYxxSYuH.js} +1 -1
- package/dashboard/dist/assets/{code-BBdC8Wmw.js → code-CFN2uX9V.js} +1 -1
- package/dashboard/dist/assets/{columns-3-CQ9Trztr.js → columns-3-38xIDlzy.js} +1 -1
- package/dashboard/dist/assets/{download-DayuF-sn.js → download-DC7KkKyP.js} +1 -1
- package/dashboard/dist/assets/{folder-CqXeSKeC.js → folder-CWq_lAnf.js} +1 -1
- package/dashboard/dist/assets/index-DWG-WrzT.js +231 -0
- package/dashboard/dist/assets/{index-Dru5HYy0.js → index-Do71weNR.js} +1 -1
- package/dashboard/dist/assets/index-GUNJodSR.css +1 -0
- package/dashboard/dist/assets/{list-DBOD6IUt.js → list-CgIP_2A-.js} +1 -1
- package/dashboard/dist/assets/{minus-fQI1Syn2.js → minus-DYoN5UGk.js} +1 -1
- package/dashboard/dist/assets/{pen-line-Bkbbngl5.js → pen-line-Bh_WKYHm.js} +1 -1
- package/dashboard/dist/assets/{proxy-teW12DdZ.js → proxy-BKxDAKTj.js} +1 -1
- package/dashboard/dist/assets/{search-Bq3ygFUW.js → search-SieXnOgr.js} +1 -1
- package/dashboard/dist/assets/{shallow-22ZN8sFt.js → shallow-Bme1JY57.js} +1 -1
- package/dashboard/dist/assets/{table-BEYtdWc4.js → table-llyEtj-7.js} +1 -1
- package/dashboard/dist/assets/terminal-BB3Xfuv5.js +6 -0
- package/dashboard/dist/assets/{trash-2-DMqGBgcF.js → trash-2-C8f4vFFM.js} +1 -1
- package/dashboard/dist/assets/{zap-9DVkGVtt.js → zap-4uwlzVm0.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +8 -4
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +20 -10
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/git.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js +79 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js +3 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js +43 -0
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js +43 -3
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js.map +1 -1
- package/dashboard/package.json +59 -59
- package/dist/src/cli.js +3 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/{team.d.ts → collab.d.ts} +2 -2
- package/dist/src/commands/collab.d.ts.map +1 -0
- package/dist/src/commands/{team.js → collab.js} +391 -24
- package/dist/src/commands/collab.js.map +1 -0
- package/dist/src/commands/msg.d.ts.map +1 -1
- package/dist/src/commands/msg.js +4 -3
- package/dist/src/commands/msg.js.map +1 -1
- package/dist/src/hooks/team-monitor.d.ts.map +1 -1
- package/dist/src/hooks/team-monitor.js +16 -0
- package/dist/src/hooks/team-monitor.js.map +1 -1
- package/dist/src/tools/collab-adapter.d.ts +85 -0
- package/dist/src/tools/collab-adapter.d.ts.map +1 -0
- package/dist/src/tools/collab-adapter.js +320 -0
- package/dist/src/tools/collab-adapter.js.map +1 -0
- package/dist/src/tools/namespace-guard.d.ts +2 -0
- package/dist/src/tools/namespace-guard.d.ts.map +1 -1
- package/dist/src/tools/namespace-guard.js +12 -0
- package/dist/src/tools/namespace-guard.js.map +1 -1
- package/dist/src/tools/phase-gate-evaluator.d.ts +45 -0
- package/dist/src/tools/phase-gate-evaluator.d.ts.map +1 -0
- package/dist/src/tools/phase-gate-evaluator.js +42 -0
- package/dist/src/tools/phase-gate-evaluator.js.map +1 -0
- package/dist/src/tools/team-members.d.ts +18 -0
- package/dist/src/tools/team-members.d.ts.map +1 -1
- package/dist/src/tools/team-members.js +50 -0
- package/dist/src/tools/team-members.js.map +1 -1
- package/dist/src/tools/team-tasks.d.ts +120 -0
- package/dist/src/tools/team-tasks.d.ts.map +1 -0
- package/dist/src/tools/team-tasks.js +365 -0
- package/dist/src/tools/team-tasks.js.map +1 -0
- package/dist/src/tools/transition-recorder.d.ts +3 -0
- package/dist/src/tools/transition-recorder.d.ts.map +1 -1
- package/dist/src/tools/transition-recorder.js +52 -1
- package/dist/src/tools/transition-recorder.js.map +1 -1
- package/dist/src/utils/get-version.d.ts.map +1 -1
- package/dist/src/utils/get-version.js +15 -4
- package/dist/src/utils/get-version.js.map +1 -1
- package/package.json +1 -1
- package/templates/config.json +7 -0
- package/templates/worktree-scope.json +10 -0
- package/templates/worktrees.json +27 -0
- package/workflows/analyze.md +86 -36
- package/workflows/brainstorm.md +17 -37
- package/workflows/execute.md +94 -28
- package/workflows/fork.md +309 -0
- package/workflows/init.md +10 -1
- package/workflows/issue.md +66 -7
- package/workflows/maestro-coordinate.md +23 -16
- package/workflows/maestro.md +52 -35
- package/workflows/merge.md +285 -0
- package/workflows/milestone-audit.md +89 -70
- package/workflows/milestone-complete.md +89 -156
- package/workflows/plan.md +122 -17
- package/workflows/retrospective.md +3 -3
- package/workflows/roadmap.md +11 -3
- package/workflows/spec-generate.md +9 -0
- package/workflows/status.md +76 -27
- package/workflows/ui-design.md +14 -12
- package/workflows/verify.md +44 -8
- package/.claude/commands/maestro-phase-add.md +0 -63
- package/.claude/commands/maestro-phase-transition.md +0 -75
- package/.codex/skills/maestro-phase-add/SKILL.md +0 -154
- package/.codex/skills/maestro-phase-transition/SKILL.md +0 -173
- package/chains/singles/phase-add.json +0 -31
- package/chains/singles/phase-transition.json +0 -23
- package/dashboard/dist/assets/ChatInput-CL8YDfOU.js +0 -67
- package/dashboard/dist/assets/ChatPage-CT-ozBK2.js +0 -8
- package/dashboard/dist/assets/CollabPage-C0rWMden.js +0 -1
- package/dashboard/dist/assets/KanbanPage-C6WbAlwI.js +0 -16
- package/dashboard/dist/assets/McpPage-BPIXADQi.js +0 -16
- package/dashboard/dist/assets/TreeBrowser-g_QUKemL.js +0 -11
- package/dashboard/dist/assets/WorkflowPage-X8aNkDEr.js +0 -6
- package/dashboard/dist/assets/git-branch-SqFf4Ru5.js +0 -6
- package/dashboard/dist/assets/index-D2Mtyw7I.css +0 -1
- package/dashboard/dist/assets/index-nufWop4p.js +0 -231
- package/dashboard/dist/assets/wrench-B84-zdLI.js +0 -11
- package/dist/src/commands/team.d.ts.map +0 -1
- package/dist/src/commands/team.js.map +0 -1
- package/workflows/phase-add.md +0 -252
- package/workflows/phase-transition.md +0 -399
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,a0 as L,a1 as c,a2 as w,r as d,V as z}from"./index-DWG-WrzT.js";import{A as M}from"./index-Do71weNR.js";import{m as T}from"./proxy-BKxDAKTj.js";function $(t){const a=Date.now()-new Date(t).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function D({member:t}){return e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-[var(--radius-md)] border border-border bg-bg-secondary hover:shadow-sm transition-shadow",children:[e.jsxs("div",{className:"relative flex-shrink-0 rounded-full flex items-center justify-center",style:{width:40,height:40,backgroundColor:"#6b7280"},children:[e.jsx("span",{className:"text-white text-[length:14px] font-semibold select-none",children:t.name.charAt(0).toUpperCase()}),e.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full border-2 border-bg-secondary",style:{backgroundColor:L[t.status]}})]}),e.jsxs("div",{className:"flex flex-col min-w-0 gap-0.5",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary truncate",children:t.name}),(t.currentPhase||t.currentTask)&&e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary truncate",children:[t.currentPhase,t.currentTask].filter(Boolean).join(" / ")}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:$(t.lastSeen)})]})]})}function R(){const t=c(a=>a.filteredMembers());return t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[e.jsx("span",{className:"text-text-secondary text-[length:var(--font-size-sm)]",children:"No team members found"}),e.jsxs("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:["Run ",e.jsx("code",{className:"px-1 py-0.5 bg-bg-hover rounded text-[10px]",children:"maestro team join"})," to join the team"]})]}):e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:t.map(a=>e.jsx(D,{member:a},a.uid))})}function O(t){const a=Date.now()-new Date(t).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function E({entry:t}){const a=w[t.action]??"#9ca3af";return e.jsxs("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-[length:var(--font-size-xs)]",style:{borderLeft:`3px solid ${a}`},children:[e.jsx("span",{className:"text-text-tertiary flex-shrink-0 tabular-nums w-12",children:O(t.ts)}),e.jsx("span",{className:"font-[var(--font-weight-medium)] text-text-primary flex-shrink-0",children:t.user}),e.jsxs("span",{className:"text-text-secondary truncate",children:[t.action,t.target?` → ${t.target}`:""]})]})}function _(){const t=c(s=>s.activity),a=d.useRef(null),r=t.slice(-100);return d.useEffect(()=>{const s=a.current;s&&(s.scrollTop=s.scrollHeight)},[r.length]),r.length===0?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-sm)]",children:"No activity yet"})}):e.jsx("div",{ref:a,className:"flex flex-col gap-1 overflow-y-auto h-full pr-1",children:r.map(s=>e.jsx(E,{entry:s},`${s.ts}-${s.user}-${s.action}`))})}const k={high:{label:"High",color:"#dc2626",bg:"rgba(239,68,68,0.08)",border:"rgba(239,68,68,0.2)"},medium:{label:"Medium",color:"#ca8a04",bg:"rgba(234,179,8,0.08)",border:"rgba(234,179,8,0.2)"},low:{label:"Low",color:"#16a34a",bg:"rgba(34,197,94,0.08)",border:"rgba(34,197,94,0.2)"},none:{label:"None",color:"var(--color-text-tertiary, #9ca3af)",bg:"var(--color-bg-secondary)",border:"var(--color-border)"}};function A(t){return k[t]??k.none}function I(){const t=c(i=>i.aggregated),a=c(i=>i.members);if(c(i=>i.loading)&&t.length===0)return e.jsxs("div",{className:"flex items-center justify-center h-64 text-text-secondary text-[length:var(--font-size-sm)]",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5 mr-2 text-text-secondary",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading analysis data..."]});if(t.length===0)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-3",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-quaternary",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M3 9h18"}),e.jsx("path",{d:"M9 21V9"})]}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-sm)]",children:"No activity data available for analysis"}),e.jsx("span",{className:"text-text-quaternary text-[length:var(--font-size-xs)]",children:"Activity will appear here as team members work on phases and tasks"})]});const s=t.reduce((i,m)=>i+m.count,0),o=new Set(t.flatMap(i=>i.members)).size,h=t.filter(i=>i.risk==="high").length,p=t.filter(i=>i.risk==="medium").length,x=[...t].sort((i,m)=>{const g={high:0,medium:1,low:2,none:3},v=g[i.risk]??3,u=g[m.risk]??3;return v!==u?v-u:m.count-i.count});return e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsx(N,{label:"Total Activity",value:s}),e.jsx(N,{label:"Active Members",value:o,total:a.length}),e.jsx(N,{label:"High Risk",value:h,color:h>0?"#dc2626":void 0}),e.jsx(N,{label:"Medium Risk",value:p,color:p>0?"#ca8a04":void 0})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsx("span",{children:"Risk levels:"}),["none","low","medium","high"].map(i=>{const m=A(i);return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:m.color,opacity:.7}}),e.jsx("span",{children:m.label}),e.jsxs("span",{className:"text-text-quaternary",children:["(",i==="none"?"1":i==="low"?"2":i==="medium"?"3":"4+",i==="none"?" member":" members",")"]})]},i)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-[length:var(--font-size-xs)] font-semibold text-text-secondary uppercase tracking-wider",children:"Activity Concentration"}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:x.map((i,m)=>e.jsx(q,{entry:i},`${i.phase}::${i.task}::${m}`))})]})]})}function N({label:t,value:a,total:r,color:s}){return e.jsxs("div",{className:"rounded-[var(--radius-md,6px)] border border-border bg-bg-secondary px-4 py-3",children:[e.jsx("div",{className:"text-[10px] text-text-tertiary uppercase tracking-wider mb-1",children:t}),e.jsxs("div",{className:"text-[length:var(--font-size-xl)] font-bold",style:{color:s??"var(--color-text-primary)"},children:[a,r!=null&&e.jsxs("span",{className:"text-[length:var(--font-size-sm)] font-normal text-text-quaternary",children:[" / ",r]})]})]})}function q({entry:t}){const a=A(t.risk),r=t.phase||"(no phase)",s=t.task||"(general)";return e.jsxs("div",{className:"flex items-center gap-4 rounded-[var(--radius-md,6px)] px-4 py-3 border transition-colors",style:{backgroundColor:a.bg,borderColor:a.border},children:[e.jsx("div",{className:"flex flex-col items-center gap-1 shrink-0 w-[52px]",children:e.jsx("span",{className:"text-[11px] font-semibold px-2 py-0.5 rounded-full",style:{color:a.color,backgroundColor:`${a.color}15`},children:a.label})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-medium text-text-primary truncate",children:r}),t.task&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-quaternary",children:"/"}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] text-text-secondary truncate",children:s})]})]})}),e.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-bold text-text-primary",children:t.count}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:"actions"})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[t.members.slice(0,5).map(o=>e.jsx("span",{className:"w-6 h-6 rounded-full bg-bg-secondary border border-border flex items-center justify-center text-[10px] font-medium text-text-secondary uppercase",title:o,children:o.charAt(0)},o)),t.members.length>5&&e.jsxs("span",{className:"text-[10px] text-text-tertiary",children:["+",t.members.length-5]})]})]})}const B={init:"⚡",join:"→",leave:"←",phase_change:"◆",task_update:"●",message:"✉",sync:"↻",report:"📋",discussion:"💬"},P=[{value:"all",label:"All types"},{value:"init",label:"Init"},{value:"join",label:"Join"},{value:"phase_change",label:"Phase changes"},{value:"task_update",label:"Task updates"},{value:"message",label:"Messages"},{value:"sync",label:"Sync"}];function F(t){const a=new Date(t),r=new Date,s=new Date(r);return s.setDate(s.getDate()-1),a.toDateString()===r.toDateString()?"Today":a.toDateString()===s.toDateString()?"Yesterday":a.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}function H(t){return new Date(t).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function W(t){const a=Date.now()-new Date(t).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function V(t){return new Date(t).toDateString()}function U(t){switch(t){case"init":return"Initialized collaboration";case"join":return"Joined the team";case"leave":return"Left the team";case"phase_change":return"Changed phase";case"task_update":return"Updated task";case"message":return"Sent a message";case"sync":return"Synced activity";case"report":return"Generated report";case"discussion":return"Started discussion";default:return t}}function K(t){return`${w[t]??"#9ca3af"}12`}function G(){const t=c(n=>n.filteredActivity()),a=c(n=>n.members),r=c(n=>n.memberFilter),s=c(n=>n.typeFilter),o=c(n=>n.setMemberFilter),h=c(n=>n.setTypeFilter),p=c(n=>n.fetchActivity),x=c(n=>n.loading),[i,m]=d.useState(200);d.useEffect(()=>{p(i)},[p,i]);const g=d.useMemo(()=>{const n=[];let f="";for(const y of t){const j=V(y.ts);j!==f&&(f=j,n.push({day:j,label:F(y.ts),entries:[]})),n[n.length-1].entries.push(y)}return n},[t]),v=new Set(t.map(n=>n.user)).size,u=new Set(t.map(n=>n.action)).size;return x&&t.length===0?e.jsx("div",{className:"flex items-center justify-center h-64 text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading history..."}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0 pb-4",children:[e.jsxs("select",{value:r,onChange:n=>o(n.target.value),className:"text-[length:var(--font-size-xs)] px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-text-primary outline-none focus:border-text-tertiary",children:[e.jsx("option",{value:"all",children:"All members"}),a.map(n=>e.jsx("option",{value:n.uid,children:n.name},n.uid))]}),e.jsx("select",{value:s,onChange:n=>h(n.target.value),className:"text-[length:var(--font-size-xs)] px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-text-primary outline-none focus:border-text-tertiary",children:P.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),(r!=="all"||s!=="all")&&e.jsx("button",{type:"button",onClick:()=>{o("all"),h("all")},className:"text-[11px] text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),e.jsxs("div",{className:"ml-auto flex items-center gap-4 text-[11px] text-text-quaternary",children:[e.jsxs("span",{children:[t.length," events"]}),e.jsxs("span",{children:[v," users"]}),e.jsxs("span",{children:[u," types"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-48 gap-2",children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-quaternary",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-sm)]",children:"No events match filters"})]}):e.jsx("div",{className:"flex flex-col gap-5",children:g.map(n=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3 sticky top-0 bg-bg-primary z-10 py-1",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-semibold text-text-primary",children:n.label}),e.jsx("div",{className:"flex-1 h-px bg-border"}),e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:[n.entries.length," events"]})]}),e.jsx("div",{className:"relative ml-5 pl-5 border-l-2 border-border",children:e.jsx("div",{className:"flex flex-col gap-1",children:n.entries.map((f,y)=>e.jsx(J,{entry:f},`${f.ts}-${f.user}-${f.action}-${y}`))})})]},n.day))}),t.length>=i&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx("button",{type:"button",onClick:()=>m(n=>n+200),className:"px-3 py-1.5 rounded-[var(--radius-md,6px)] text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all border border-border",children:"Load more"})})]})]})}function J({entry:t}){const a=w[t.action]??"#9ca3af",r=B[t.action]??"•",s=t.user.charAt(0).toUpperCase();return e.jsxs("div",{className:"relative flex items-start gap-3 py-2 group hover:bg-bg-secondary/50 rounded-r-[var(--radius-md,6px)] px-3 -ml-[21px] transition-colors",children:[e.jsx("div",{className:"absolute -left-[8px] top-[14px] w-[14px] h-[14px] rounded-full border-2 flex items-center justify-center",style:{borderColor:a,backgroundColor:"var(--color-bg-primary)"},children:e.jsx("span",{style:{fontSize:"7px",lineHeight:1,color:a},children:r})}),e.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[11px] font-semibold shrink-0 ml-2",style:{backgroundColor:K(t.action),color:a},children:s}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:t.user}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:U(t.action)})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[t.phase_id&&e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-bg-secondary border border-border text-text-tertiary",children:["Phase ",t.phase_id]}),t.task_id&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-bg-secondary border border-border text-text-tertiary",children:t.task_id}),t.target&&e.jsx("span",{className:"text-[10px] text-text-tertiary truncate max-w-[200px]",title:t.target,children:t.target}),t.host&&e.jsxs("span",{className:"text-[10px] text-text-quaternary flex items-center gap-1",children:[e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),e.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),e.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),t.host]})]})]}),e.jsxs("div",{className:"flex flex-col items-end shrink-0 gap-0.5",children:[e.jsx("span",{className:"text-[11px] text-text-tertiary tabular-nums",children:H(t.ts)}),e.jsx("span",{className:"text-[10px] text-text-quaternary",children:W(t.ts)})]})]})}const Y=[{label:"Overview",key:"overview",shortcut:"1"},{label:"Analysis",key:"analysis",shortcut:"2"},{label:"History",key:"history",shortcut:"3"}],C=["overview","analysis","history"],Q={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function ae(){const t=c(l=>l.members);c(l=>l.loading);const a=c(l=>l.error),r=c(l=>l.activeTab),s=c(l=>l.fetchMembers),o=c(l=>l.fetchActivity),h=c(l=>l.fetchPresence),p=c(l=>l.fetchAggregated),x=c(l=>l.fetchPreflight),i=c(l=>l.setActiveTab),m=c(l=>l.clearAll),[g,v]=d.useState(null),[u,n]=d.useState(!0),{register:f,unregister:y}=d.useContext(z),j=d.useCallback(l=>i(C[l]),[i]);return d.useEffect(()=>{f({items:Y.map(l=>({label:l.label,icon:null,shortcut:l.shortcut})),activeIndex:C.indexOf(r),onSwitch:j})},[r,f,j]),d.useEffect(()=>()=>y(),[y]),d.useEffect(()=>{function l(b){b.target instanceof HTMLInputElement||b.target instanceof HTMLTextAreaElement||(b.key==="1"?i("overview"):b.key==="2"?i("analysis"):b.key==="3"&&i("history"))}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i]),d.useEffect(()=>{let l=!1;return(async()=>{n(!0);const b=await x();l||(v(b),n(!1),b!=null&&b.exists&&(s(),o(),h(),p()))})(),()=>{l=!0,m()}},[]),u?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading..."}):g!=null&&g.exists?a&&t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-accent-red text-[length:var(--font-size-sm)]",children:"Failed to load collaboration data"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:a}),e.jsx("button",{type:"button",onClick:()=>{s(),o(),h()},className:"px-3 py-1.5 rounded-[var(--radius-md)] text-[11px] font-semibold bg-bg-secondary border border-border text-text-secondary hover:text-text-primary transition-all",children:"Retry"})]}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(M,{mode:"popLayout",children:e.jsxs(T.div,{className:"h-full flex flex-col overflow-hidden",variants:Q,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.15},children:[r==="overview"&&e.jsx(Z,{}),r==="analysis"&&e.jsx("div",{className:"p-4 h-full overflow-y-auto",children:e.jsx(I,{})}),r==="history"&&e.jsx("div",{className:"px-4 pt-4 pb-0 h-full flex flex-col overflow-visible",children:e.jsx(G,{})})]},r)})})}):e.jsx(X,{onRefresh:async()=>{const l=await x();v(l),l!=null&&l.exists&&(s(),o(),h(),p())}})}function X({onRefresh:t}){const a=c(x=>x.initCollab),[r,s]=d.useState(!1),[o,h]=d.useState(null);async function p(){s(!0),h(null);const x=await a();x.success?t():(h(x.error??"Unknown error"),s(!1))}return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"max-w-[480px] w-full px-6",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-12 h-12 rounded-[12px] bg-bg-secondary border border-border flex items-center justify-center mx-auto mb-4",children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-secondary",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}),e.jsx("h2",{className:"text-[length:var(--font-size-xl)] font-bold text-text-primary mb-2",children:"Team Collaboration"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary leading-relaxed",children:"Track team activity, detect file conflicts, and coordinate phase assignments across multiple developers."})]}),e.jsx("div",{className:"border border-border rounded-[var(--radius-md,6px)] bg-bg-secondary p-4 mb-6",children:e.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:[{label:"Member presence",desc:"Online/away/offline status"},{label:"Activity feed",desc:"Real-time team actions"},{label:"Conflict detection",desc:"Overlapping file edits"},{label:"Phase coordination",desc:"Who works on what"},{label:"Activity heatmap",desc:"Concentration analysis"},{label:"Collaboration timeline",desc:"Historical view"}].map(x=>e.jsxs("div",{className:"flex items-start gap-2 py-1",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-accent-green mt-[7px] shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-primary font-medium",children:x.label}),e.jsx("div",{className:"text-[10px] text-text-tertiary",children:x.desc})]})]},x.label))})}),e.jsxs("div",{className:"text-center",children:[e.jsx("button",{type:"button",onClick:p,disabled:r,className:"px-5 py-2.5 rounded-[var(--radius-md,6px)] text-[length:var(--font-size-sm)] font-semibold bg-text-primary text-bg-primary hover:opacity-90 transition-opacity disabled:opacity-50",children:r?"Initializing...":"Enable Team Collaboration"}),o&&e.jsx("p",{className:"text-[length:var(--font-size-xs)] text-accent-red mt-2",children:o}),e.jsx("p",{className:"text-[10px] text-text-quaternary mt-2",children:"Creates .workflow/collab/ and registers you as the team owner"})]})]})})}function Z(){const t=c(o=>o.members),a=c(o=>o.presence),r=a.filter(o=>o.status==="online").length,s=a.filter(o=>o.status==="away").length;return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-1 min-w-0 overflow-y-auto p-4",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4 text-[length:var(--font-size-xs)]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-[#22c55e]"}),e.jsxs("span",{className:"text-text-secondary",children:[r," online"]})]}),s>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-[#eab308]"}),e.jsxs("span",{className:"text-text-secondary",children:[s," away"]})]}),e.jsxs("span",{className:"text-text-quaternary",children:[t.length," members total"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx(ee,{}),e.jsx(S,{label:"Sync Activity",command:"maestro team sync",icon:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"23 4 23 10 17 10"}),e.jsx("polyline",{points:"1 20 1 14 7 14"}),e.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}),e.jsx(S,{label:"Team Status",command:"maestro team status",icon:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M22 12h-4l-3 9L9 3l-3 9H2"})})})]}),e.jsx(R,{})]}),e.jsxs("div",{className:"w-[320px] shrink-0 border-l border-border flex flex-col h-full bg-bg-primary",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border",children:e.jsx("h3",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:"Activity"})}),e.jsx("div",{className:"flex-1 overflow-hidden px-4 py-2",children:e.jsx(_,{})})]})]})}function ee(){const t=c(u=>u.addMember),[a,r]=d.useState(!1),[s,o]=d.useState(""),[h,p]=d.useState("member"),[x,i]=d.useState(!1),[m,g]=d.useState(null);async function v(u){u.preventDefault();const n=s.trim();if(!n)return;i(!0),g(null);const f=await t(n,"",h);i(!1),f.success?(o(""),p("member"),r(!1)):g(f.error??"Failed to add member")}return a?e.jsxs("form",{onSubmit:v,className:"flex items-center gap-1.5",children:[e.jsx("input",{autoFocus:!0,value:s,onChange:u=>o(u.target.value),placeholder:"Name",className:"w-[120px] px-2 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] text-text-primary placeholder:text-text-quaternary outline-none focus:border-text-tertiary"}),e.jsxs("select",{value:h,onChange:u=>p(u.target.value),className:"px-1.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] text-text-secondary outline-none",children:[e.jsx("option",{value:"member",children:"Member"}),e.jsx("option",{value:"admin",children:"Admin"}),e.jsx("option",{value:"viewer",children:"Viewer"})]}),e.jsx("button",{type:"submit",disabled:x||!s.trim(),className:"px-2.5 py-1.5 rounded-[var(--radius-md,6px)] text-[11px] font-semibold bg-text-primary text-bg-primary hover:opacity-90 transition-opacity disabled:opacity-40",children:x?"...":"Add"}),e.jsx("button",{type:"button",onClick:()=>{r(!1),g(null)},className:"px-1.5 py-1.5 text-[11px] text-text-tertiary hover:text-text-primary",children:"Cancel"}),m&&e.jsx("span",{className:"text-[10px] text-accent-red",children:m})]}):e.jsxs("button",{type:"button",onClick:()=>r(!0),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] font-medium text-text-secondary hover:text-text-primary hover:bg-bg-secondary transition-all",children:[e.jsx("span",{className:"text-text-tertiary",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"8.5",cy:"7",r:"4"}),e.jsx("line",{x1:"20",y1:"8",x2:"20",y2:"14"}),e.jsx("line",{x1:"23",y1:"11",x2:"17",y2:"11"})]})}),e.jsx("span",{children:"Add Member"})]})}function S({label:t,command:a,icon:r}){const[s,o]=d.useState(!1);return e.jsxs("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(a),o(!0),setTimeout(()=>o(!1),1500)},title:`Copy: ${a}`,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] font-medium text-text-secondary hover:text-text-primary hover:bg-bg-secondary transition-all",children:[e.jsx("span",{className:"text-text-tertiary",children:r}),e.jsx("span",{children:s?"Copied!":t})]})}export{ae as CollabPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c,k as l,j as e}from"./index-DWG-WrzT.js";function d(){const i=c(s=>s.slots),a=c(s=>s.supervisorStatus),t=l(s=>s.processes),n=Object.values(i),r=Object.values(t).filter(s=>s.status==="running");return e.jsxs("div",{className:"h-full overflow-y-auto p-[var(--spacing-2)] text-[11px]",children:[a&&e.jsxs("div",{className:"mb-[var(--spacing-2)] pb-[var(--spacing-2)] border-b border-border",children:[e.jsx("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:"Supervisor"}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary",children:[e.jsx("span",{className:["w-[6px] h-[6px] rounded-full shrink-0",a.enabled?"bg-status-completed":"bg-text-secondary/40"].join(" ")}),e.jsx("span",{children:a.enabled?"Active":"Paused"}),a.lastTickAt&&e.jsxs("span",{className:"ml-auto text-text-secondary/60",children:["Last tick: ",x(a.lastTickAt)]})]})]}),a&&a.running.length>0&&e.jsxs("div",{className:"mb-[var(--spacing-2)] pb-[var(--spacing-2)] border-b border-border",children:[e.jsxs("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:["Running (",a.running.length,")"]}),a.running.map(s=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary py-[var(--spacing-0-5)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0 bg-status-exploring animate-pulse"}),e.jsx("span",{className:"truncate",children:s.issueId}),e.jsxs("span",{className:"ml-auto",children:["Turn ",s.turnNumber,"/",s.maxTurns]})]},s.processId))]}),n.length>0&&e.jsxs("div",{className:"mb-[var(--spacing-2)] pb-[var(--spacing-2)] border-b border-border",children:[e.jsxs("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:["Execution Slots (",n.length,")"]}),n.map(s=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary py-[var(--spacing-0-5)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0 bg-status-exploring animate-pulse"}),e.jsx("span",{className:"truncate",children:s.issueId}),e.jsx("span",{className:"ml-auto",children:s.executor})]},s.processId))]}),r.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:["Active Agents (",r.length,")"]}),r.map(s=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary py-[var(--spacing-0-5)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0 bg-status-exploring animate-pulse"}),e.jsx("span",{className:"truncate",children:s.type}),e.jsx("span",{className:"ml-auto",children:s.status})]},s.id))]}),n.length===0&&r.length===0&&!a&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-xs)]",children:"No active executions."})]})}function x(i){const a=new Date(i).getTime(),t=Date.now()-a;return isNaN(t)?"":t<1e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:new Date(a).toLocaleTimeString("en-US",{hour12:!1})}export{d as ExecutionPanel};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{j as e,u as ee,a as ce,S as L,r as p,b as D,c as O,s as R,L as Pe,g as P,I as $,C as te,d as F,e as K,R as fe,P as be,O as ye,f as je,T as Ne,h as we,i as ke,k as Oe,l as $e,m as de,V as Re,n as Ie}from"./index-DWG-WrzT.js";import{u as G}from"./shallow-Bme1JY57.js";import{S as Me,P as Ke,L as Ue,a as U,T as Fe,D as He,K as We}from"./table-llyEtj-7.js";import{C as Ve}from"./circle-check-big-TDSeWstm.js";import{M as Ye,C as qe}from"./ChatInput-Bvr-FeEq.js";import{D as Ge}from"./download-DC7KkKyP.js";import"./zap-4uwlzVm0.js";import"./MarkdownRenderer-X4af_WNb.js";import"./chevron-right-Csu22t58.js";import"./terminal-BB3Xfuv5.js";import"./circle-alert-c3tH1P4z.js";function Xe({chips:t,active:a,onSelect:r}){return e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] overflow-x-auto shrink-0",children:t.map(n=>{const o=n===a;return e.jsx("button",{type:"button",onClick:()=>r(n),className:["px-[var(--spacing-3)] py-[var(--spacing-1)]","text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] whitespace-nowrap","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",o?"":"hover:text-text-primary"].join(" "),style:o?{borderRadius:"var(--style-chip-radius)",border:"var(--style-chip-border)",backgroundColor:"var(--style-chip-active-bg)",color:"var(--style-chip-active-color)"}:{borderRadius:"var(--style-chip-radius)",border:"var(--style-chip-border)",backgroundColor:"var(--color-bg-card)",color:"var(--color-text-secondary)"},children:n},n)})})}const Qe={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 Je({phase:t}){const{t:a}=ee(),r=ce(g=>g.setSelectedPhase),o=ce(g=>g.selectedPhase)===t.phase;function d(){r(o?null:t.phase)}function c(g){(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d())}const{tasks_completed:i,tasks_total:l,current_wave:x}=t.execution,h=a("kanban.wave");return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":a("kanban.phase_aria",{phase:t.phase,title:t.title,status:t.status,completed:i,total:l}),"aria-pressed":o,onClick:d,onKeyDown:c,className:["rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]",o?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":""].join(" "),style:{backgroundColor:Qe[t.status]??"var(--color-tint-pending)"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Me,{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("h4",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary leading-[var(--line-height-tight)]",children:t.title}),t.goal&&e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary leading-[var(--line-height-normal)] line-clamp-2",children:t.goal}),l>0&&e.jsx(Ke,{completed:i,total:l,color:L[t.status]}),t.status==="executing"&&x>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] text-status-executing",children:[e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-status-executing animate-pulse motion-reduce:animate-none"}),e.jsxs("span",{children:[h," ",x]})]})]})})}function Ze({issue:t,selected:a,onSelect:r}){const n=Ue[t.priority];function o(d){(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())}return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":`${t.identifier}: ${t.title}. Priority: ${U[t.priority]}`,"aria-pressed":a,onClick:r,onKeyDown:o,className:["rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]","bg-bg-card",a?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":""].join(" "),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:`#${t.state.color}`},"aria-hidden":"true"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-mono font-[var(--font-weight-medium)] text-text-tertiary",children:t.identifier})]}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:`${n}20`,color:n},children:U[t.priority]})]}),e.jsx("h4",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary leading-snug line-clamp-2",children:t.title}),e.jsxs("div",{className:"flex items-center justify-between gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"flex gap-[var(--spacing-1)] flex-wrap min-w-0",children:t.labels.slice(0,3).map(d=>e.jsx("span",{className:"text-[length:10px] px-1.5 py-0.5 rounded-full truncate max-w-[80px]",style:{backgroundColor:`#${d.color}20`,color:`#${d.color}`},title:d.name,children:d.name},d.id))}),t.assignee&&e.jsx("span",{className:"w-5 h-5 rounded-full bg-bg-hover shrink-0 flex items-center justify-center text-[length:10px] font-[var(--font-weight-semibold)] text-text-secondary",title:t.assignee.displayName,children:t.assignee.displayName.charAt(0).toUpperCase()})]})]})})}const et={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},tt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},rt=[{value:"claude-code",label:"Claude"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"},{value:"agent-sdk",label:"Agent SDK"}],at={running:{icon:"●",color:"#B89540",animate:!0},queued:{icon:"◷",color:"#5B8DB8"},completed:{icon:"✓",color:"#5A9E78"},failed:{icon:"✕",color:"#C46555"},retrying:{icon:"↻",color:"#B89540",animate:!0}};function st({issue:t,selected:a,onSelect:r,batchMode:n,isChecked:o,onToggleCheck:d}){var z;const c=et[t.type]??"#A09D97",i=tt[t.priority]??"#A09D97",[l,x]=p.useState(!1),[h,g]=p.useState(t.executor??"claude-code"),m=D(j=>j.isIssueRunning(t.id)),y=D(j=>j.openCliPanel),k=O(j=>j.updateIssue),N=(z=t.execution)==null?void 0:z.status,u=N?at[N]:null,b=p.useCallback(j=>{j.stopPropagation(),R({action:"execute:issue",issueId:t.id,executor:h})},[t.id,h]),C=p.useCallback(j=>{j.stopPropagation();const B=j.target.value;g(B),k(t.id,{executor:B})},[t.id,k]),v=p.useCallback(j=>{j.stopPropagation(),d==null||d(t.id)},[t.id,d]),s=p.useCallback(j=>{j.stopPropagation(),y(t.id)},[t.id,y]);function S(j){(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),r())}return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":`${t.title}. Type: ${t.type}. Priority: ${t.priority}`,"aria-pressed":a,onClick:r,onKeyDown:S,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:["group/card relative rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]","bg-bg-card motion-safe:animate-[card-enter_200ms_ease-out_both]",a?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":"shadow-[var(--shadow-sm)]"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[(n||l)&&e.jsx("div",{onClick:v,className:["shrink-0 w-4 h-4 rounded border-[1.5px] flex items-center justify-center text-[9px] transition-all duration-100 cursor-pointer",o?"bg-accent-blue border-accent-blue text-white scale-100":"border-border hover:border-text-secondary"].join(" "),style:o?{backgroundColor:"var(--color-accent-blue)",borderColor:"var(--color-accent-blue)"}:{},children:o&&"✓"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:`${c}20`,color:c},children:t.type}),t.path&&e.jsx("span",{className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)",border:"1px solid var(--color-border)"},children:t.path}),t.solution&&e.jsxs("span",{className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"#9178B520",color:"#9178B5"},children:[t.solution.steps.length," steps"]}),t.phase_id!=null&&e.jsxs(Pe,{to:`/workflow?phase=${t.phase_id}`,onClick:j=>j.stopPropagation(),className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full no-underline transition-colors",style:{backgroundColor:"rgba(91, 141, 184, 0.1)",color:"#5B8DB8"},title:`Go to Phase ${t.phase_id}`,children:["P-",String(t.phase_id).padStart(2,"0")]}),u&&e.jsx("span",{className:["text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)]",u.animate?"animate-pulse":""].join(" "),style:{color:u.color},title:`Execution: ${N}`,onClick:m?s:void 0,children:u.icon}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full ml-auto",style:{backgroundColor:`${i}20`,color:i},children:t.priority})]}),e.jsx("h4",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary leading-snug line-clamp-2",children:t.title}),e.jsxs("div",{className:"flex items-center justify-between",children:[(()=>{const j=P(t),B=$[j];return e.jsx("span",{className:"text-[length:10px]",style:{color:B},children:j.replace("_"," ")})})(),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[e.jsx("select",{value:h,onChange:C,onClick:j=>j.stopPropagation(),className:["text-[length:10px] bg-transparent border border-border rounded px-1 py-0.5 text-text-secondary cursor-pointer","transition-opacity",l||a?"opacity-100":"opacity-0"].join(" "),"aria-label":"Select executor",children:rt.map(j=>e.jsx("option",{value:j.value,children:j.label},j.value))}),!m&&t.status!=="resolved"&&t.status!=="closed"&&e.jsx("button",{type:"button",onClick:b,className:["w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-accent-blue hover:bg-bg-hover transition-all",l||a?"opacity-100":"opacity-0"].join(" "),"aria-label":"Execute issue",title:"Execute issue",children:e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})})}),m&&e.jsx("button",{type:"button",onClick:s,className:"w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-[#B89540] hover:bg-bg-hover transition-all","aria-label":"View execution output",title:"View execution output",children:e.jsx("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})})})]})]})]})})}const ot=[{value:"task",label:"Task",color:"#A09D97"},{value:"bug",label:"Bug",color:"#C46555"},{value:"feature",label:"Feature",color:"#5B8DB8"},{value:"improvement",label:"Improve",color:"#9178B5"}],nt=[{value:"urgent",label:"Urgent",color:"#C46555"},{value:"high",label:"High",color:"#B89540"},{value:"medium",label:"Medium",color:"#5B8DB8"},{value:"low",label:"Low",color:"#A09D97"}];function lt({columnId:t,onClose:a,onCreated:r}){const[n,o]=p.useState(""),[d,c]=p.useState("task"),[i,l]=p.useState("medium"),[x,h]=p.useState(!1),g=p.useRef(null),m=p.useRef(null),y=O(u=>u.createIssue);p.useEffect(()=>{requestAnimationFrame(()=>{var u;return(u=g.current)==null?void 0:u.focus()})},[]),p.useEffect(()=>{function u(b){m.current&&!m.current.contains(b.target)&&a()}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]);async function k(){const u=n.trim();!u||x||(h(!0),await y({title:u,description:"",type:d,priority:i}),h(!1),o(""),r==null||r(),a())}function N(u){u.key==="Enter"&&!u.shiftKey?(u.preventDefault(),k()):u.key==="Escape"&&(u.preventDefault(),a())}return e.jsxs("div",{ref:m,className:"rounded-[10px] border-2 border-dashed border-accent-blue/40 bg-bg-card px-[var(--spacing-3)] py-[var(--spacing-2-5)] space-y-[var(--spacing-2)] motion-safe:animate-[fade-in_100ms_ease-out]",children:[e.jsx("input",{ref:g,type:"text",value:n,onChange:u=>o(u.target.value),onKeyDown:N,placeholder:"Issue title...",disabled:x,className:"w-full bg-transparent text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary placeholder:text-text-tertiary outline-none"}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"flex gap-[var(--spacing-0-5)]",children:ot.map(u=>e.jsx("button",{type:"button",onClick:()=>c(u.value),className:["text-[length:10px] font-[var(--font-weight-medium)] px-[var(--spacing-1-5)] py-[1px] rounded-full transition-all duration-[var(--duration-fast)]",d===u.value?"ring-1 ring-current":"opacity-50 hover:opacity-80"].join(" "),style:{backgroundColor:`${u.color}20`,color:u.color},children:u.label},u.value))}),e.jsx("div",{className:"w-px h-3 bg-border-divider"}),e.jsx("div",{className:"flex gap-[var(--spacing-0-5)]",children:nt.map(u=>e.jsx("button",{type:"button",onClick:()=>l(u.value),className:["text-[length:10px] font-[var(--font-weight-medium)] px-[var(--spacing-1-5)] py-[1px] rounded-full transition-all duration-[var(--duration-fast)]",i===u.value?"ring-1 ring-current":"opacity-50 hover:opacity-80"].join(" "),style:{backgroundColor:`${u.color}20`,color:u.color},children:u.label},u.value))})]}),e.jsxs("div",{className:"flex items-center justify-between text-[length:10px] text-text-tertiary",children:[e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1 py-[1px] rounded bg-bg-hover font-mono text-[9px]",children:"Enter"})," create"," ",e.jsx("kbd",{className:"px-1 py-[1px] rounded bg-bg-hover font-mono text-[9px]",children:"Esc"})," cancel"]}),x&&e.jsx("span",{children:"Creating..."})]})]})}function it({columnId:t,title:a,phases:r,color:n,animationDelay:o=0,onSelectPhase:d,linearIssues:c,localIssues:i,selectedItem:l,onSelectItem:x,composingColumnId:h,onStartCompose:g,onStopCompose:m,onIssueCreated:y,batchMode:k,selectedIssueIds:N,onToggleIssueCheck:u}){const{t:b}=ee(),C=b("kanban.no_phases"),v=r.length===0&&(!i||i.length===0)&&(!c||c.length===0);return e.jsxs("section",{className:"group/col flex flex-col min-w-[var(--size-card-min-width)] flex-1 bg-bg-secondary rounded-[var(--radius-lg)] overflow-hidden motion-safe:animate-[column-enter_200ms_ease-out_both]",style:{animationDelay:`${o}ms`},"aria-label":`${a} column, ${r.length} phases`,children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:n},"aria-hidden":"true"}),e.jsx("h3",{className:"text-[length:var(--font-size-sm)] 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 rounded-full px-[var(--spacing-1-5)] tabular-nums",children:r.length+((i==null?void 0:i.length)??0)+((c==null?void 0:c.length)??0)}),e.jsx("button",{type:"button",onClick:()=>g==null?void 0:g(t),className:"ml-auto w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors opacity-0 group-hover/col:opacity-100 focus-visible:opacity-100","aria-label":"Create issue in this column",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-2)] px-[var(--spacing-2)] pb-[var(--spacing-2)] overflow-y-auto flex-1",role:"list",children:[h===t&&m&&e.jsx(lt,{columnId:t,onClose:m,onCreated:y}),v?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-secondary text-center py-[var(--spacing-6)] italic",children:C}):e.jsxs(e.Fragment,{children:[r.map(s=>e.jsx(Je,{phase:s},s.phase)),i&&i.length>0&&e.jsxs(e.Fragment,{children:[r.length>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] py-[var(--spacing-1)]",children:[e.jsx("div",{className:"flex-1 h-px bg-border-divider"}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary font-[var(--font-weight-medium)] uppercase tracking-wider",children:"Issues"}),e.jsx("div",{className:"flex-1 h-px bg-border-divider"})]}),i.map(s=>e.jsx(st,{issue:s,selected:(l==null?void 0:l.type)==="issue"&&l.issue.id===s.id,onSelect:()=>x==null?void 0:x({type:"issue",issue:s}),batchMode:k,isChecked:N==null?void 0:N.has(s.id),onToggleCheck:u},s.id))]}),c&&c.length>0&&e.jsxs(e.Fragment,{children:[(r.length>0||i&&i.length>0)&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] py-[var(--spacing-1)]",children:[e.jsx("div",{className:"flex-1 h-px bg-border-divider"}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary font-[var(--font-weight-medium)] uppercase tracking-wider",children:"Linear"}),e.jsx("div",{className:"flex-1 h-px bg-border-divider"})]}),c.map(s=>e.jsx(Ze,{issue:s,selected:(l==null?void 0:l.type)==="linearIssue"&&l.issue.id===s.id,onSelect:()=>x==null?void 0:x({type:"linearIssue",issue:s})},s.id))]})]})]})]})}const ct={backlog:L.pending,triage:"#C8863A","in-progress":L.executing,review:L.verifying,done:L.completed,deferred:"#8B8685"},dt={backlog:"columns.backlog",triage:"columns.triage","in-progress":"columns.in_progress",review:"columns.review",done:"columns.done",deferred:"columns.deferred"},xt={backlog:"backlog",unstarted:"backlog",started:"in-progress",completed:"done"},pt={open:"backlog",registered:"triage",in_progress:"in-progress",resolved:"review",closed:"done",deferred:"deferred"};function ut(t){var r;const a=new Map;for(const n of te)a.set(n.id,[]);for(const n of t){const o=pt[n.status]??"backlog";(r=a.get(o))==null||r.push(n)}return a}function ht(t){var r;const a=new Map;for(const n of te)a.set(n.id,[]);for(const n of t){const o=xt[n.state.type]??"backlog";(r=a.get(o))==null||r.push(n)}return a}function vt({linearIssues:t,localIssues:a,selectedItem:r,onSelectItem:n,composingColumnId:o,onStartCompose:d,onStopCompose:c,onIssueCreated:i,showDone:l=!0,batchMode:x,selectedIssueIds:h,onToggleIssueCheck:g}){const{t:m}=ee(),y=p.useRef(null),k=p.useCallback(b=>{const C=y.current;if(!C)return;const v=Array.from(C.querySelectorAll('[role="button"][tabindex="0"]')),s=document.activeElement,S=s?v.indexOf(s):-1;let z=-1;b.key==="ArrowDown"||b.key==="ArrowRight"?(b.preventDefault(),z=S<v.length-1?S+1:0):b.key==="ArrowUp"||b.key==="ArrowLeft"?(b.preventDefault(),z=S>0?S-1:v.length-1):b.key==="Home"?(b.preventDefault(),z=0):b.key==="End"&&(b.preventDefault(),z=v.length-1),z>=0&&v[z]&&v[z].focus()},[]);p.useEffect(()=>{const b=y.current;if(b)return b.addEventListener("keydown",k),()=>b.removeEventListener("keydown",k)},[k]);const N=p.useMemo(()=>ht(t??[]),[t]),u=p.useMemo(()=>ut(a??[]),[a]);return e.jsx("div",{ref:y,className:"flex gap-[var(--spacing-3)] h-full overflow-x-auto p-[var(--spacing-3)] scroll-smooth",children:te.filter(b=>l||b.id!=="done").map((b,C)=>e.jsx(it,{columnId:b.id,title:m(dt[b.id]),phases:[],color:ct[b.id]??L.pending,animationDelay:C*50,onSelectPhase:()=>{},linearIssues:N.get(b.id),localIssues:u.get(b.id),selectedItem:r,onSelectItem:n,composingColumnId:o,onStartCompose:d,onStopCompose:c,onIssueCreated:i,batchMode:x,selectedIssueIds:h,onToggleIssueCheck:g},b.id))})}const mt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},gt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},ft={open:"Open",registered:"Registered",in_progress:"In Progress",resolved:"Resolved",closed:"Closed",deferred:"Deferred"},T="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";function bt({localIssues:t,linearIssues:a,selectedItem:r,onSelectItem:n}){const o=((t==null?void 0:t.length)??0)>0,d=((a==null?void 0:a.length)??0)>0;return!o&&!d?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No data available"}):e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)] h-full overflow-auto p-[var(--spacing-3)]",children:[o&&e.jsxs("section",{children:[e.jsx(pe,{label:"Issues",count:t.length}),e.jsx("div",{className:"rounded-[var(--radius-lg)] overflow-hidden border border-border-divider",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-bg-secondary",children:[e.jsx("th",{className:`${T} w-[80px]`,children:"Type"}),e.jsx("th",{className:T,children:"Title"}),e.jsx("th",{className:`${T} w-[90px]`,children:"Priority"}),e.jsx("th",{className:`${T} w-[100px]`,children:"Status"})]})}),e.jsx("tbody",{children:t.map((c,i)=>{const l=mt[c.type]??"#A09D97",x=gt[c.priority]??"#A09D97",h=(r==null?void 0:r.type)==="issue"&&r.issue.id===c.id;return e.jsxs("tr",{onClick:()=>n==null?void 0:n({type:"issue",issue:c}),className:xe(i,h),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(ue,{label:c.type,color:l})}),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:c.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(ue,{label:c.priority,color:x})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary whitespace-nowrap",children:ft[c.status]??c.status})]},c.id)})})]})})]}),d&&e.jsxs("section",{children:[e.jsx(pe,{label:"Linear",count:a.length}),e.jsx("div",{className:"rounded-[var(--radius-lg)] overflow-hidden border border-border-divider",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-bg-secondary",children:[e.jsx("th",{className:`${T} w-[80px]`,children:"ID"}),e.jsx("th",{className:T,children:"Title"}),e.jsx("th",{className:`${T} w-[110px]`,children:"State"}),e.jsx("th",{className:`${T} w-[90px]`,children:"Priority"})]})}),e.jsx("tbody",{children:a.map((c,i)=>{const l=(r==null?void 0:r.type)==="linearIssue"&&r.issue.id===c.id;return e.jsxs("tr",{onClick:()=>n==null?void 0:n({type:"linearIssue",issue:c}),className:xe(i,l),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",children:c.identifier}),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:c.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary",children:c.state.name}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary",children:U[c.priority]})]},c.id)})})]})})]})]})}function xe(t,a){return["cursor-pointer transition-colors border-t border-border-divider",a?"bg-[rgba(90,130,200,0.08)]":t%2===0?"bg-bg-primary hover:bg-bg-hover":"bg-[rgba(0,0,0,0.015)] hover:bg-bg-hover"].join(" ")}function pe({label:t,count:a}){return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mb-[var(--spacing-2)]",children:[e.jsx("h3",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:t}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-secondary rounded-full px-[var(--spacing-1-5)] tabular-nums",children:a})]})}function ue({label:t,color:a}){return e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full whitespace-nowrap",style:{backgroundColor:`${a}20`,color:a},children:t})}/**
|
|
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 yt=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],jt=F("inbox",yt),Nt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},wt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"};function kt({localIssues:t,linearIssues:a,selectedItem:r,onSelectItem:n}){const o=p.useMemo(()=>(t??[]).filter(i=>i.status==="open"||i.status==="registered"||i.status==="in_progress"),[t]),d=p.useMemo(()=>(t??[]).filter(i=>i.status==="resolved"||i.status==="closed"||i.status==="deferred"),[t]),c=((t==null?void 0:t.length)??0)+((a==null?void 0:a.length)??0);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-4)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0 bg-bg-secondary",children:[e.jsx(X,{label:"Issues",value:c,sub:`${o.length} open`,color:L.pending}),e.jsx("div",{className:"w-px h-6 bg-border-divider"}),e.jsx(X,{label:"In Progress",value:(t??[]).filter(i=>i.status==="in_progress").length,sub:"active",color:L.executing}),e.jsx("div",{className:"w-px h-6 bg-border-divider"}),e.jsx(X,{label:"Resolved",value:d.length,sub:"done",color:L.completed})]}),e.jsxs("div",{className:"flex-1 grid grid-cols-[1fr_280px] overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-border-divider",children:[e.jsx(he,{icon:e.jsx(jt,{size:14,strokeWidth:2}),label:"Issue Queue",children: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:[o.length," open"]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-[var(--spacing-1)]",children:o.length===0?e.jsx(Ct,{message:"No open issues"}):o.map(i=>{const l=Nt[i.type]??"#A09D97",x=wt[i.priority]??"#A09D97",h=(r==null?void 0:r.type)==="issue"&&r.issue.id===i.id;return e.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n({type:"issue",issue:i}),className:["flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2)] w-full text-left transition-colors",h?"bg-[rgba(90,130,200,0.08)]":"hover:bg-bg-hover"].join(" "),children:[e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] px-[6px] py-[2px] rounded-full shrink-0",style:{backgroundColor:`${l}20`,color:l},children:i.type}),e.jsx("span",{className:"flex-1 text-[length:var(--font-size-xs)] text-text-primary line-clamp-1",children:i.title}),e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] px-[6px] py-[2px] rounded-full shrink-0",style:{backgroundColor:`${x}20`,color:x},children:i.priority})]},i.id)})})]}),e.jsxs("div",{className:"flex flex-col overflow-hidden",children:[e.jsx(he,{icon:e.jsx(Ve,{size:14,strokeWidth:2}),label:"Summary"}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)] flex flex-col gap-[var(--spacing-4)]",children:[((t==null?void 0:t.length)??0)>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[length:10px] text-text-tertiary uppercase tracking-wider font-[var(--font-weight-semibold)]",children:"Issues"}),e.jsxs("div",{className:"mt-[var(--spacing-2)] flex flex-col gap-[var(--spacing-1-5)]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"Open"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:o.length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"In Progress"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:(t??[]).filter(i=>i.status==="in_progress").length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"Resolved"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:d.length})]})]})]}),((a==null?void 0:a.length)??0)>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[length:10px] text-text-tertiary uppercase tracking-wider font-[var(--font-weight-semibold)]",children:"Linear"}),e.jsx("div",{className:"mt-[var(--spacing-2)]",children:e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[a.length," issues"]})})]})]})]})]})]})}function X({label:t,value:a,sub:r,color:n}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:t}),e.jsxs("div",{className:"flex items-baseline gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)]",style:{color:n},children:a}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:r})]})]})}function he({icon:t,label:a,children:r}){return 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("span",{className:"text-text-tertiary",children:t}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:a}),r]})}function Ct({message:t}){return e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary text-center py-[var(--spacing-6)] italic",children:t})}function St({issues:t,onClose:a}){const[r,n]=p.useState(new Set),[o,d]=p.useState(!1),[c,i]=p.useState(null),l=K(m=>m.importIssues);function x(){r.size===t.length?n(new Set):n(new Set(t.map(m=>m.id)))}function h(m){const y=new Set(r);y.has(m)?y.delete(m):y.add(m),n(y)}async function g(){const m=t.filter(y=>r.has(y.id));if(m.length!==0){d(!0);try{const y=await l(m);i(y)}catch(y){i({imported:0,errors:[String(y)]})}finally{d(!1)}}}return e.jsx(fe,{open:!0,onOpenChange:m=>!m&&a(),children:e.jsxs(be,{children:[e.jsx(ye,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),e.jsxs(je,{className:ke("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[600px] max-w-[95vw] max-h-[80vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden focus:outline-none"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border",children:[e.jsx(Ne,{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:"Import from Linear"}),e.jsx(we,{className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary hover:bg-bg-hover",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),c?e.jsxs("div",{className:"p-[var(--spacing-4)] space-y-[var(--spacing-3)]",children:[e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-primary",children:["Imported ",c.imported," issue(s)."]}),c.errors.length>0&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-status-blocked",children:c.errors.map((m,y)=>e.jsx("div",{children:m},y))}),e.jsx("button",{type:"button",onClick:a,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] bg-bg-secondary border-b border-border",children:e.jsxs("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:["Linear issues will be mapped: ",e.jsx("span",{className:"font-mono",children:"identifier"})," → title prefix, ",e.jsx("span",{className:"font-mono",children:"priority"})," → local priority, ",e.jsx("span",{className:"font-mono",children:"state.type"})," → local status"]})}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:t.length===0?e.jsx("div",{className:"p-[var(--spacing-4)] text-[length:var(--font-size-sm)] text-text-secondary text-center",children:"No Linear issues available"}):e.jsxs("table",{className:"w-full text-[length:var(--font-size-xs)]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-text-tertiary",children:[e.jsx("th",{className:"w-8 p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:r.size===t.length,onChange:x})}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Issue"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Status"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Priority"})]})}),e.jsx("tbody",{children:t.map(m=>e.jsxs("tr",{className:"border-b border-border-divider hover:bg-bg-hover cursor-pointer",onClick:()=>h(m.id),children:[e.jsx("td",{className:"p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:r.has(m.id),onChange:()=>h(m.id)})}),e.jsxs("td",{className:"p-[var(--spacing-2)]",children:[e.jsx("span",{className:"font-mono text-text-tertiary",children:m.identifier})," ",e.jsx("span",{className:"text-text-primary",children:m.title})]}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:m.state.name}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:U[m.priority]})]},m.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-t border-border",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[r.size," of ",t.length," selected"]}),e.jsxs("div",{className:"flex gap-[var(--spacing-2)]",children:[e.jsx("button",{type:"button",onClick:a,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] border border-border text-text-secondary text-[length:var(--font-size-sm)] hover:bg-bg-hover",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void g(),disabled:r.size===0||o,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90 disabled:opacity-50",children:o?"Importing...":`Import ${r.size} issue(s)`})]})]})]})]})]})})}function zt({teams:t,selectedTeamId:a,onClose:r}){var C;const[n,o]=p.useState(a??((C=t[0])==null?void 0:C.id)??""),[d,c]=p.useState(new Set),[i,l]=p.useState(!1),[x,h]=p.useState(null),g=O(v=>v.issues),m=O(v=>v.fetchIssues),y=K(v=>v.exportIssues),k=K(v=>v.refresh);p.useEffect(()=>{m()},[m]);function N(){d.size===g.length?c(new Set):c(new Set(g.map(v=>v.id)))}function u(v){const s=new Set(d);s.has(v)?s.delete(v):s.add(v),c(s)}async function b(){const v=g.filter(s=>d.has(s.id));if(!(v.length===0||!n)){l(!0);try{const s=await y(v,n);h(s),await k()}catch(s){h({exported:0,errors:[String(s)]})}finally{l(!1)}}}return e.jsx(fe,{open:!0,onOpenChange:v=>!v&&r(),children:e.jsxs(be,{children:[e.jsx(ye,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),e.jsxs(je,{className:ke("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[600px] max-w-[95vw] max-h-[80vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden focus:outline-none"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border",children:[e.jsx(Ne,{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:"Export to Linear"}),e.jsx(we,{className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary hover:bg-bg-hover",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),x?e.jsxs("div",{className:"p-[var(--spacing-4)] space-y-[var(--spacing-3)]",children:[e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-primary",children:["Exported ",x.exported," issue(s) to Linear."]}),x.errors.length>0&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-status-blocked",children:x.errors.map((v,s)=>e.jsx("div",{children:v},s))}),e.jsx("button",{type:"button",onClick:r,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] bg-bg-secondary border-b border-border space-y-[var(--spacing-2)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("label",{className:"text-[length:var(--font-size-xs)] text-text-secondary shrink-0",children:"Target team:"}),e.jsx("select",{value:n,onChange:v=>o(v.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] border border-border bg-bg-primary text-text-primary text-[length:var(--font-size-xs)]",children:t.map(v=>e.jsxs("option",{value:v.id,children:[v.key," — ",v.name]},v.id))})]}),e.jsxs("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:["Local issues will be created in Linear: ",e.jsx("span",{className:"font-mono",children:"title"})," → title, ",e.jsx("span",{className:"font-mono",children:"priority"})," → Linear priority, ",e.jsx("span",{className:"font-mono",children:"description"})," → description"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:g.length===0?e.jsx("div",{className:"p-[var(--spacing-4)] text-[length:var(--font-size-sm)] text-text-secondary text-center",children:"No local issues available"}):e.jsxs("table",{className:"w-full text-[length:var(--font-size-xs)]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-text-tertiary",children:[e.jsx("th",{className:"w-8 p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:d.size===g.length&&g.length>0,onChange:N})}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Title"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Status"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Priority"})]})}),e.jsx("tbody",{children:g.map(v=>e.jsxs("tr",{className:"border-b border-border-divider hover:bg-bg-hover cursor-pointer",onClick:()=>u(v.id),children:[e.jsx("td",{className:"p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:d.has(v.id),onChange:()=>u(v.id)})}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-primary",children:v.title}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:v.status}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:v.priority})]},v.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-t border-border",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[d.size," of ",g.length," selected"]}),e.jsxs("div",{className:"flex gap-[var(--spacing-2)]",children:[e.jsx("button",{type:"button",onClick:r,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] border border-border text-text-secondary text-[length:var(--font-size-sm)] hover:bg-bg-hover",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void b(),disabled:d.size===0||!n||i,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90 disabled:opacity-50",children:i?"Exporting...":`Export ${d.size} issue(s)`})]})]})]})]})]})})}/**
|
|
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 _t=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Et=F("layout-dashboard",_t);/**
|
|
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 Lt=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Dt=F("refresh-cw",Lt);/**
|
|
17
|
+
* @license lucide-react v0.577.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Bt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],At=F("upload",Bt),Tt={"claude-code":"Claude Code",codex:"Codex",gemini:"Gemini",qwen:"Qwen",opencode:"OpenCode"};function Pt(){var k,N;const t=D(u=>u.cliPanelIssueId),a=D(u=>u.closeCliPanel),r=D(u=>u.getSlotForIssue),o=O(u=>u.issues).find(u=>u.id===t),d=t?r(t):void 0,c=(d==null?void 0:d.processId)??((k=o==null?void 0:o.execution)==null?void 0:k.processId)??null,i=Oe(u=>u.processes),l=c?i[c]:void 0,x=p.useCallback(()=>{c&&R({action:"stop",processId:c})},[c]);if(!t||!o)return null;const h=(l==null?void 0:l.status)==="running"||(l==null?void 0:l.status)==="spawning",g=((N=o.execution)==null?void 0:N.status)??"idle",m=(d==null?void 0:d.executor)??o.executor??"claude-code",y=Tt[m]??"Agent";return e.jsxs("div",{className:"flex flex-col h-full border-l border-border-divider bg-bg-primary w-[480px] shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2)] border-b border-border-divider shrink-0",children:[e.jsx("h3",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary truncate flex-1",children:o.title}),e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-medium)] px-2 py-[2px] rounded-full bg-bg-hover text-text-secondary shrink-0",children:y}),e.jsx("span",{className:["text-[length:10px] font-[var(--font-weight-medium)] px-2 py-[2px] rounded-full shrink-0",g==="running"?"bg-[#B8954020] text-[#B89540]":g==="completed"?"bg-[#5A9E7820] text-[#5A9E78]":g==="failed"?"bg-[#C4655520] text-[#C46555]":"bg-bg-hover text-text-secondary"].join(" "),children:g}),h&&e.jsx("button",{type:"button",onClick:x,className:"text-[length:var(--font-size-xs)] px-2 py-1 rounded-[var(--radius-sm)] border border-[#C46555] text-[#C46555] hover:bg-[#C4655510] transition-colors shrink-0",children:"Stop"}),e.jsx("button",{type:"button",onClick:a,className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors shrink-0","aria-label":"Close panel",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:e.jsx(Ye,{processId:c})}),e.jsx(qe,{processId:c,executor:m})]})}const Ot=[{value:"claude-code",label:"Claude Code"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"}];function $t(){const t=D(c=>c.selectedIssueIds),a=D(c=>c.clearSelection),[r,n]=p.useState("claude-code"),o=t.size,d=p.useCallback(()=>{o!==0&&(R({action:"execute:batch",issueIds:Array.from(t),executor:r}),a())},[t,r,o,a]);return o===0?null:e.jsxs("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2)] rounded-full bg-bg-card border border-border shadow-[0_8px_32px_rgba(0,0,0,0.12)] backdrop-blur-sm",children:[e.jsxs("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary",children:[o," selected"]}),e.jsx("div",{className:"w-px h-5 bg-border-divider"}),e.jsx("select",{value:r,onChange:c=>n(c.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] border border-border bg-bg-primary text-text-primary text-[length:var(--font-size-xs)] cursor-pointer",children:Ot.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))}),e.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-3)] py-[var(--spacing-1)] rounded-full bg-accent-blue text-white text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] hover:opacity-90 transition-opacity",children:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]}),e.jsx("button",{type:"button",onClick:a,className:"w-6 h-6 flex items-center justify-center rounded-full text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors","aria-label":"Clear selection",children:e.jsxs("svg",{className:"w-3.5 h-3.5",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"})]})})]})}const Rt={create_issue:{bg:"rgba(91, 141, 184, 0.1)",text:"#5B8DB8"},execute_issue:{bg:"rgba(90, 158, 120, 0.1)",text:"#5A9E78"},analyze_issue:{bg:"rgba(145, 120, 181, 0.1)",text:"#9178B5"},plan_issue:{bg:"rgba(145, 120, 181, 0.1)",text:"#9178B5"},advance_phase:{bg:"rgba(184, 149, 64, 0.1)",text:"#B89540"},flag_blocker:{bg:"rgba(196, 101, 85, 0.1)",text:"#C46555"}};function It(){const t=D(l=>l.recentDecisions),[a,r]=p.useState(new Set),[n,o]=p.useState(!1),d=p.useMemo(()=>{const l=[];for(const x of t)for(const h of x.deferred){const g=`${x.id}-${h.type}-${h.target}`;a.has(g)||l.push({decisionId:x.id,action:h,timestamp:x.timestamp})}return l.slice(-5)},[t,a]),c=p.useCallback(l=>{l.action.type==="execute_issue"&&R({action:"execute:issue",issueId:l.action.target,executor:l.action.executor??"claude-code"}),r(x=>{const h=new Set(x);return h.add(`${l.decisionId}-${l.action.type}-${l.action.target}`),h})},[]),i=p.useCallback(l=>{r(x=>{const h=new Set(x);return h.add(`${l.decisionId}-${l.action.type}-${l.action.target}`),h})},[]);return d.length===0?null:e.jsxs("div",{className:"border-b border-border-divider bg-bg-secondary",children:[e.jsx("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-1-5)]",children:e.jsxs("button",{type:"button",onClick:()=>o(!n),className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] text-text-secondary hover:text-text-primary transition-colors",children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full bg-accent-blue animate-pulse"}),"Commander Recommendations (",d.length,")",e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${n?"":"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]})}),!n&&e.jsx("div",{className:"flex flex-wrap gap-[var(--spacing-2)] px-[var(--spacing-4)] pb-[var(--spacing-2)]",children:d.map(l=>{const x=Rt[l.action.type]??{bg:"var(--color-bg-secondary)",text:"var(--color-text-secondary)"};return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-md)] text-[length:var(--font-size-xs)]",style:{backgroundColor:x.bg},children:[e.jsx("span",{className:"font-[var(--font-weight-medium)]",style:{color:x.text},children:l.action.type.replace("_"," ")}),e.jsx("span",{className:"text-text-secondary truncate max-w-[200px]",title:l.action.target,children:l.action.target}),l.action.reason&&e.jsxs("span",{className:"text-text-tertiary truncate max-w-[150px]",title:l.action.reason,children:["— ",l.action.reason]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)] ml-auto",children:[l.action.type==="execute_issue"&&e.jsx("button",{type:"button",onClick:()=>c(l),className:"text-[10px] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full transition-colors",style:{backgroundColor:"rgba(90, 158, 120, 0.15)",color:"#5A9E78"},children:"Approve"}),e.jsx("button",{type:"button",onClick:()=>i(l),className:"text-[10px] text-text-tertiary hover:text-text-secondary transition-colors px-1",children:"x"})]})]},`${l.decisionId}-${l.action.type}-${l.action.target}`)})})]})}const Ce=[{value:"bug",label:"Bug",color:"#C46555"},{value:"feature",label:"Feature",color:"#5B8DB8"},{value:"improvement",label:"Improve",color:"#9178B5"},{value:"task",label:"Task",color:"#A09D97"}],Se=[{value:"urgent",label:"Urgent",color:"#C46555"},{value:"high",label:"High",color:"#B89540"},{value:"medium",label:"Medium",color:"#5B8DB8"},{value:"low",label:"Low",color:"#A09D97"}];function ve({type:t,setType:a,priority:r,setPriority:n,dark:o}){const d=o?"20":"18",c=o?"35":"28";return e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[Ce.map(i=>e.jsx("button",{type:"button",onClick:()=>a(i.value),className:"text-[10px] font-medium px-2 py-[2px] rounded-full transition-all duration-100",style:{background:`${i.color}${t===i.value?c:d}`,color:i.color,outline:t===i.value?`1.5px solid ${i.color}70`:"none"},children:i.label},i.value)),e.jsx("div",{className:"w-px h-3",style:{backgroundColor:o?"rgba(255,255,255,0.12)":"var(--color-border-divider)"}}),Se.map(i=>e.jsx("button",{type:"button",onClick:()=>n(i.value),className:"text-[10px] font-medium px-2 py-[2px] rounded-full transition-all duration-100",style:{background:`${i.color}${r===i.value?c:d}`,color:i.color,outline:r===i.value?`1.5px solid ${i.color}70`:"none"},children:i.label},i.value))]})}function Mt({open:t,columnId:a,style:r,onClose:n,onCreated:o}){const[d,c]=p.useState(""),[i,l]=p.useState(""),[x,h]=p.useState("task"),[g,m]=p.useState("medium"),[y,k]=p.useState(!1),N=p.useRef(null),u=p.useRef(null),b=O(s=>s.createIssue);p.useEffect(()=>{t&&(c(""),l(""),h("task"),m("medium"),requestAnimationFrame(()=>{var s;return(s=N.current)==null?void 0:s.focus()}))},[t]),p.useEffect(()=>{function s(S){S.key==="Escape"&&n()}return t&&window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,n]);const C=p.useCallback(async()=>{const s=d.trim();!s||y||(k(!0),await b({title:s,description:i.trim(),type:x,priority:g}),k(!1),o==null||o(),n())},[d,i,x,g,y,b,o,n]);function v(s){s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&C()}return t?r===1?e.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[13vh]",style:{backgroundColor:"rgba(0,0,0,0.75)",backdropFilter:"blur(3px)"},onClick:n,children:e.jsxs("div",{className:"w-full max-w-[540px] mx-4 rounded-[14px] overflow-hidden motion-safe:animate-[modal-enter_150ms_ease-out_both]",style:{backgroundColor:"#1D1B18",boxShadow:"0 28px 90px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.07)",borderTop:"2.5px solid var(--color-accent-orange)"},onClick:s=>s.stopPropagation(),children:[e.jsx("div",{className:"px-5 pt-5 pb-3",children:e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),C()),v(s)},placeholder:"What needs to be done?",className:"w-full bg-transparent text-[length:var(--font-size-base)] font-medium outline-none",style:{color:"rgba(255,255,255,0.88)",caretColor:"var(--color-accent-orange)"}})}),e.jsx("div",{className:"px-5 pb-4 pt-3 border-t",style:{borderColor:"rgba(255,255,255,0.07)"},children:e.jsx(ve,{type:x,setType:h,priority:g,setPriority:m,dark:!0})}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-2.5 border-t text-[10px]",style:{borderColor:"rgba(255,255,255,0.07)",color:"rgba(255,255,255,0.3)"},children:[e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"rgba(255,255,255,0.08)"},children:"↵"})," ","create · "," ",e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"rgba(255,255,255,0.08)"},children:"Esc"})," ","cancel"]}),e.jsx("span",{className:"opacity-60",children:a})]})]})}):r===2?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0,0,0,0.44)"},onClick:n,children:e.jsxs("div",{className:"w-full max-w-[540px] rounded-[var(--radius-xl)] border overflow-hidden motion-safe:animate-[modal-enter_160ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"var(--shadow-lg)"},onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:"New Issue"}),e.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full capitalize",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)"},children:a.replace("-"," ")})]}),e.jsx("button",{type:"button",onClick:n,className:"w-6 h-6 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",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:"px-5 py-4 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:["Title ",e.jsx("span",{style:{color:"var(--color-accent-red)"},children:"*"})]}),e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:v,placeholder:"Issue title...",className:"w-full px-3 py-2 rounded-[var(--radius-default)] border text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-placeholder bg-transparent outline-none transition-colors",style:{borderColor:"var(--color-border)"},onFocus:s=>{s.target.style.borderColor="var(--color-accent-blue)"},onBlur:s=>{s.target.style.borderColor="var(--color-border)"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:"Description"}),e.jsx("textarea",{ref:u,value:i,onChange:s=>l(s.target.value),onKeyDown:v,placeholder:"Optional description...",rows:3,className:"w-full px-3 py-2 rounded-[var(--radius-default)] border text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-placeholder bg-transparent outline-none resize-none transition-colors",style:{borderColor:"var(--color-border)"},onFocus:s=>{s.target.style.borderColor="var(--color-accent-blue)"},onBlur:s=>{s.target.style.borderColor="var(--color-border)"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--color-text-tertiary)"},children:"Type"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Ce.map(s=>e.jsx("button",{type:"button",onClick:()=>h(s.value),className:"text-[11px] font-medium px-3 py-1 rounded-[var(--radius-default)] transition-all",style:{background:x===s.value?`${s.color}25`:"var(--color-bg-secondary)",color:x===s.value?s.color:"var(--color-text-secondary)",outline:x===s.value?`1.5px solid ${s.color}55`:"none"},children:s.label},s.value))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--color-text-tertiary)"},children:"Priority"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Se.map(s=>e.jsx("button",{type:"button",onClick:()=>m(s.value),className:"text-[11px] font-medium px-3 py-1 rounded-[var(--radius-default)] transition-all",style:{background:g===s.value?`${s.color}25`:"var(--color-bg-secondary)",color:g===s.value?s.color:"var(--color-text-secondary)",outline:g===s.value?`1.5px solid ${s.color}55`:"none"},children:s.label},s.value))})]})]}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-t",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("span",{className:"text-[10px]",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"var(--color-bg-secondary)"},children:"⌘↵"})," ","to create"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] border transition-colors hover:bg-bg-hover",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void C(),disabled:!d.trim()||y,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] text-white font-medium transition-all disabled:opacity-40",style:{backgroundColor:"var(--color-accent-orange)"},children:y?"Creating…":"Create Issue"})]})]})]})}):e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--color-bg-primary)"},onClick:n,children:[e.jsxs("div",{className:"absolute top-5 right-6 flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void C(),disabled:!d.trim()||y,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] text-white font-medium transition-all disabled:opacity-40",style:{backgroundColor:"var(--color-accent-orange)"},children:y?"Creating…":"Create"}),e.jsx("button",{type:"button",onClick:n,className:"w-8 h-8 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsxs("svg",{width:"16",height:"16",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:"w-full max-w-[720px] px-8 motion-safe:animate-[modal-enter_180ms_ease-out_both]",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-4",style:{color:"var(--color-text-tertiary)"},children:["New Issue · ",a.replace("-"," ")]}),e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:s=>{var S;s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),(S=u.current)==null||S.focus()),v(s)},placeholder:"Untitled issue",className:"w-full bg-transparent outline-none mb-5 leading-tight",style:{fontSize:"var(--font-size-2xl)",fontWeight:700,color:"var(--color-text-primary)",caretColor:"var(--color-accent-orange)"}}),e.jsx("textarea",{ref:u,value:i,onChange:s=>l(s.target.value),onKeyDown:v,placeholder:"Add a description… (optional)",rows:7,className:"w-full bg-transparent outline-none resize-none leading-relaxed mb-8",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-secondary)",caretColor:"var(--color-accent-orange)"}}),e.jsxs("div",{className:"flex items-center gap-4 pt-4 border-t flex-wrap",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(ve,{type:x,setType:h,priority:g,setPriority:m}),e.jsxs("div",{className:"ml-auto text-[10px]",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"var(--color-bg-secondary)"},children:"⌘↵"})," ","to create"]})]})]})]}):null}const me={high:{color:"#5A9E78",bg:"#5A9E7820"},medium:{color:"#B89540",bg:"#B8954020"},low:{color:"#C46555",bg:"#C4655520"}};function Kt(t){return t>=.7?"high":t>=.4?"medium":"low"}function Ut({analysis:t}){const a=Kt(t.confidence),r=me[a]??me.low;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Root Cause"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.root_cause})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Impact"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.impact})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:"Confidence"}),e.jsxs("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full",style:{backgroundColor:r.bg,color:r.color},children:[a," (",Math.round(t.confidence*100),"%)"]})]}),t.related_files.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Related Files"}),e.jsx("ul",{className:"space-y-0.5",children:t.related_files.map((n,o)=>e.jsx("li",{className:"font-mono text-[11px] truncate",style:{color:"var(--color-text-secondary)"},children:n},o))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Suggested Approach"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.suggested_approach})]}),e.jsxs("div",{className:"text-[10px] pt-1",style:{color:"var(--color-text-tertiary)"},children:["Analyzed by ",t.analyzed_by," at ",new Date(t.analyzed_at).toLocaleString()]})]})}function Ft({solution:t}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",style:{fontSize:"var(--font-size-xs)"},children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("th",{className:"py-1 pr-2 w-6",children:"#"}),e.jsx("th",{className:"py-1 pr-2",children:"Target"}),e.jsx("th",{className:"py-1 pr-2",children:"Description"}),e.jsx("th",{className:"py-1",children:"Verification"})]})}),e.jsx("tbody",{children:t.steps.map((a,r)=>e.jsxs("tr",{className:"border-t",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx("td",{className:"py-1.5 pr-2 font-mono",style:{color:"var(--color-text-tertiary)"},children:r+1}),e.jsx("td",{className:"py-1.5 pr-2 font-mono truncate max-w-[120px]",style:{color:"var(--color-text-secondary)"},title:a.target,children:a.target??"-"}),e.jsx("td",{className:"py-1.5 pr-2",style:{color:"var(--color-text-secondary)"},children:a.description}),e.jsx("td",{className:"py-1.5",style:{color:"var(--color-text-tertiary)"},children:a.verification??"-"})]},r))})]})}),t.context&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Context"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.context})]}),t.planned_by&&e.jsxs("div",{className:"text-[10px] pt-1",style:{color:"var(--color-text-tertiary)"},children:["Planned by ",t.planned_by,t.planned_at&&` at ${new Date(t.planned_at).toLocaleString()}`]})]})}const Ht={idle:"#A09D97",queued:"#5B8DB8",running:"#B89540",completed:"#5A9E78",failed:"#C46555",retrying:"#B89540"};function Wt({execution:t}){const a=Ht[t.status]??"#A09D97",r=t.result;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a}}),e.jsx("span",{className:"text-[11px] font-medium capitalize",style:{color:"var(--color-text-primary)"},children:t.status})]}),r&&e.jsxs(e.Fragment,{children:[r.summary&&e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:r.summary}),e.jsxs("div",{className:"flex flex-wrap gap-3",style:{fontSize:"var(--font-size-xs)"},children:[r.commitHash&&e.jsxs("div",{style:{color:"var(--color-text-secondary)"},children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Commit: "}),e.jsx("span",{className:"font-mono",children:r.commitHash.slice(0,8)})]}),r.prUrl&&e.jsxs("div",{children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"PR: "}),e.jsx("a",{href:r.prUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",style:{color:"var(--color-accent-blue)"},children:r.prUrl.replace(/^https?:\/\/[^/]+/,"")})]}),r.filesChanged!=null&&e.jsxs("div",{style:{color:"var(--color-text-secondary)"},children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Files: "}),r.filesChanged]})]})]})]})}const Vt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},Yt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},qt={idle:"#A09D97",queued:"#5B8DB8",running:"#B89540",completed:"#5A9E78",failed:"#C46555",retrying:"#B89540"};function Q(){return e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",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"})]})}function _({label:t,color:a,bg:r}){return e.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full",style:{backgroundColor:r,color:a},children:t})}function w({label:t,children:a}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:t}),a]})}const Gt=[{value:"gemini",label:"Gemini"},{value:"qwen",label:"Qwen"}],Xt=[{value:"standard",label:"Standard"},{value:"deep",label:"Deep"}];function Qt({issue:t}){var r;const a=[{label:"Analyze",done:!!t.analysis},{label:"Plan",done:!!t.solution&&t.solution.steps.length>0},{label:"Execute",done:!!((r=t.execution)!=null&&r.result)}];return e.jsx("div",{className:"flex items-center gap-1 mb-2.5",children:a.map((n,o)=>e.jsxs("div",{className:"flex items-center gap-1",children:[o>0&&e.jsx("div",{className:"w-6 h-px",style:{backgroundColor:n.done||a[o-1].done?"var(--color-accent-blue)":"var(--color-border)"}}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex items-center justify-center text-[7px]",style:{backgroundColor:n.done?"var(--color-accent-blue)":"transparent",border:n.done?"none":"1.5px solid var(--color-border)",color:n.done?"white":"var(--color-text-tertiary)"},children:n.done?"✓":""}),e.jsx("span",{className:"text-[9px]",style:{color:n.done?"var(--color-text-primary)":"var(--color-text-tertiary)"},children:n.label})]})]},n.label))})}function J({issue:t}){const a=$e(),[r,n]=p.useState("gemini"),[o,d]=p.useState("standard"),c=P(t);if(c!=="open"&&c!=="analyzing"&&c!=="planned")return null;const i=h=>{R(h),a("/chat")},l=t.solution&&t.solution.steps.length>0?"Execute":t.analysis?"Continue":"Run Pipeline",x=t.analysis?t.solution?{label:"Execute",onClick:()=>i({action:"execute:issue",issueId:t.id})}:{label:"Plan",onClick:()=>i({action:"issue:plan",issueId:t.id,tool:r})}:{label:"Analyze",onClick:()=>i({action:"issue:analyze",issueId:t.id,tool:r,depth:o})};return e.jsxs("div",{children:[e.jsx(Qt,{issue:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:r,onChange:h=>n(h.target.value),className:"text-[10px] px-1.5 py-1 rounded border cursor-pointer",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-primary)",color:"var(--color-text-tertiary)"},children:Gt.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))}),e.jsx("select",{value:o,onChange:h=>d(h.target.value),className:"text-[10px] px-1.5 py-1 rounded border cursor-pointer",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-primary)",color:"var(--color-text-tertiary)"},children:Xt.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:x.onClick,className:"text-[11px] font-medium px-3.5 py-1.5 rounded-md transition-colors hover:opacity-90 border",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)",backgroundColor:"transparent"},children:x.label}),e.jsx("button",{type:"button",onClick:()=>i({action:"issue:pipeline",issueId:t.id,tool:r}),className:"text-[11px] font-medium px-3.5 py-1.5 rounded-md transition-colors hover:opacity-90",style:{backgroundColor:"var(--color-accent-blue)",color:"white"},children:l})]})]})}function Z({issue:t}){return e.jsxs(e.Fragment,{children:[t.analysis&&e.jsx(w,{label:"Analysis",children:e.jsx(Ut,{analysis:t.analysis})}),t.solution&&e.jsx(w,{label:"Solution",children:e.jsx(Ft,{solution:t.solution})}),t.execution&&t.execution.result&&e.jsx(w,{label:"Execution Result",children:e.jsx(Wt,{execution:t.execution})})]})}function Jt({issue:t,style:a,onClose:r}){var c,i;const n=Vt[t.type]??"#A09D97",o=Yt[t.priority]??"#A09D97",d=t.execution?qt[t.execution.status]??"#A09D97":"#A09D97";return p.useEffect(()=>{function l(x){x.key==="Escape"&&r()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[r]),a===1?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[60]",style:{backgroundColor:"rgba(0,0,0,0.22)"},onClick:r}),e.jsxs("div",{className:"fixed right-0 top-0 bottom-0 z-[70] w-[400px] flex flex-col overflow-hidden motion-safe:animate-[slide-in-right_180ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderLeft:"1px solid var(--color-border)",boxShadow:"var(--shadow-lg)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-5 py-3 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--color-text-tertiary)"},children:t.id.slice(0,14)}),e.jsx(_,{label:t.type,color:n,bg:`${n}20`}),e.jsx(_,{label:t.priority,color:o,bg:`${o}20`})]}),e.jsx("button",{type:"button",onClick:r,className:"w-7 h-7 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(Q,{})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[e.jsx("h2",{className:"font-bold leading-snug",style:{fontSize:"var(--font-size-lg)",color:"var(--color-text-primary)"},children:t.title}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.executor})}),t.description&&e.jsx(w,{label:"Description",children:e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.description})}),e.jsx(Z,{issue:t}),t.execution&&t.execution.status!=="idle"&&e.jsx(w,{label:"Execution",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.execution.status}),t.execution.retryCount>0&&e.jsxs("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:["(x",t.execution.retryCount,")"]})]}),t.execution.lastError&&e.jsx("div",{className:"rounded px-2.5 py-2",style:{fontSize:"var(--font-size-xs)",color:"#C46555",backgroundColor:"#C4655510",border:"1px solid #C4655530"},children:t.execution.lastError})]})}),e.jsx(w,{label:"Activity",children:e.jsxs("div",{className:"space-y-1",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:[e.jsxs("div",{children:["Created ",E(t.created_at)]}),e.jsxs("div",{children:["Updated ",E(t.updated_at)]})]})})]}),e.jsx("div",{className:"shrink-0 px-5 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx(J,{issue:t})})]})]}):a===2?e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-6",style:{backgroundColor:"rgba(0,0,0,0.52)"},onClick:r,children:e.jsxs("div",{className:"w-full max-w-[880px] rounded-[var(--radius-xl)] border overflow-hidden flex max-h-[86vh] motion-safe:animate-[modal-enter_180ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"var(--shadow-lg)"},onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden border-r",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-6 py-3.5 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--color-text-tertiary)"},children:t.id}),e.jsx("button",{type:"button",onClick:r,className:"w-7 h-7 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(Q,{})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(_,{label:t.type,color:n,bg:`${n}20`}),e.jsx(_,{label:t.priority,color:o,bg:`${o}20`}),(()=>{const l=P(t),x=$[l];return e.jsx(_,{label:l.replace("_"," "),color:x,bg:`${x}20`})})()]}),e.jsx("h2",{className:"font-bold leading-snug mb-5",style:{fontSize:"var(--font-size-xl)",color:"var(--color-text-primary)"},children:t.title}),t.description?e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.description}):e.jsx("p",{className:"italic",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-placeholder)"},children:"No description provided."}),((c=t.execution)==null?void 0:c.lastError)&&e.jsxs("div",{className:"mt-5 rounded-[var(--radius-md)] p-3",style:{backgroundColor:"#C4655510",border:"1px solid #C4655330"},children:[e.jsx("div",{className:"font-semibold mb-1",style:{fontSize:"var(--font-size-xs)",color:"#C46555"},children:"Execution Error"}),e.jsx("div",{className:"whitespace-pre-wrap",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:t.execution.lastError})]}),e.jsx("div",{className:"mt-5 space-y-5",children:e.jsx(Z,{issue:t})})]})]}),e.jsx("div",{className:"shrink-0 px-6 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx(J,{issue:t})}),e.jsxs("div",{className:"w-[270px] shrink-0 overflow-y-auto px-5 py-5 space-y-5",style:{backgroundColor:"var(--color-bg-secondary)"},children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:"Properties"}),e.jsx(w,{label:"Type",children:e.jsx(_,{label:t.type,color:n,bg:`${n}25`})}),e.jsx(w,{label:"Priority",children:e.jsx(_,{label:t.priority,color:o,bg:`${o}25`})}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.executor})}),t.execution&&t.execution.status!=="idle"&&e.jsxs(w,{label:"Execution",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d}}),e.jsxs("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:[t.execution.status,t.execution.retryCount>0&&` (x${t.execution.retryCount})`]})]}),t.execution.startedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Started ",E(t.execution.startedAt)]})]}),e.jsxs("div",{className:"pt-3 border-t space-y-3",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(w,{label:"Created",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.created_at)})}),e.jsx(w,{label:"Updated",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.updated_at)})})]})]})]})}):e.jsxs("div",{className:"fixed inset-0 z-[60] flex flex-col motion-safe:animate-[slide-up_220ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-primary)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-6 py-2.5 border-b",style:{borderColor:"var(--color-border-divider)",backgroundColor:"var(--color-bg-card)"},children:[e.jsxs("nav",{className:"flex items-center gap-1.5",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:[e.jsx("span",{children:"Kanban"}),e.jsx("span",{children:"›"}),e.jsx("span",{children:"Issues"}),e.jsx("span",{children:"›"}),e.jsx("span",{className:"font-medium truncate max-w-[360px]",style:{color:"var(--color-text-primary)"},children:t.title})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{label:t.type,color:n,bg:`${n}20`}),e.jsx(_,{label:t.priority,color:o,bg:`${o}20`}),(()=>{const l=P(t),x=$[l];return e.jsx(_,{label:l.replace("_"," "),color:x,bg:`${x}20`})})(),e.jsxs("button",{type:"button",onClick:r,className:"ml-2 flex items-center gap-1.5 px-3 py-1.5 rounded-[var(--radius-default)] border text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors",style:{borderColor:"var(--color-border)",fontSize:"var(--font-size-xs)"},children:[e.jsx(Q,{}),"Close"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"flex-1 overflow-y-auto px-12 py-10",children:e.jsxs("div",{className:"max-w-[740px] mx-auto",children:[e.jsx("div",{className:"font-mono mb-4",style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:t.id}),e.jsx("h1",{className:"font-bold leading-tight mb-6",style:{fontSize:"var(--font-size-2xl)",color:"var(--color-text-primary)"},children:t.title}),t.description?e.jsx("div",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-secondary)"},children:t.description}):e.jsx("div",{className:"italic",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-placeholder)"},children:"No description provided."}),((i=t.execution)==null?void 0:i.lastError)&&e.jsxs("div",{className:"mt-8 rounded-[var(--radius-md)] p-5",style:{backgroundColor:"#C4655510",border:"1px solid #C4655330"},children:[e.jsx("div",{className:"font-semibold mb-2",style:{fontSize:"var(--font-size-sm)",color:"#C46555"},children:"Execution Error"}),e.jsx("pre",{className:"whitespace-pre-wrap leading-relaxed",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)",fontFamily:"var(--font-mono)"},children:t.execution.lastError})]}),e.jsx("div",{className:"mt-8 space-y-6",children:e.jsx(Z,{issue:t})})]})}),e.jsx("div",{className:"shrink-0 px-12 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx("div",{className:"max-w-[740px] mx-auto",children:e.jsx(J,{issue:t})})})]}),e.jsxs("div",{className:"w-[280px] shrink-0 border-l overflow-y-auto px-6 py-8 space-y-6",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-secondary)"},children:[e.jsx(w,{label:"Type",children:e.jsx(_,{label:t.type,color:n,bg:`${n}20`})}),e.jsx(w,{label:"Priority",children:e.jsx(_,{label:t.priority,color:o,bg:`${o}20`})}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.executor})}),t.execution&&t.execution.status!=="idle"&&e.jsx(w,{label:"Execution",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.execution.status})]}),t.execution.retryCount>0&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:[t.execution.retryCount," retry attempt",t.execution.retryCount>1?"s":""]}),t.execution.startedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Started ",E(t.execution.startedAt)]}),t.execution.completedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Completed ",E(t.execution.completedAt)]})]})}),e.jsxs("div",{className:"pt-4 border-t space-y-4",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(w,{label:"Created",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.created_at)})}),e.jsx(w,{label:"Updated",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.updated_at)})})]})]})]})]})}function E(t){const a=Date.now(),r=new Date(t).getTime(),n=a-r;if(n<0)return"just now";const o=Math.floor(n/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const d=Math.floor(o/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}const Zt=["All","Open","Registered","In Progress","Resolved","Deferred"],ge=["kanban","table","center"];function pr(){const[t,a]=p.useState("kanban"),[r,n]=p.useState("All"),[o,d]=p.useState(null),[c,i]=p.useState(!1),[l,x]=p.useState(!1),[h,g]=p.useState(!1),[m,y]=p.useState(null),[k,N]=p.useState(!1),[u,b]=p.useState("backlog"),[C,v]=p.useState(null),s=de(f=>f.createModalStyle),S=de(f=>f.detailModalStyle),{register:z,unregister:j}=p.useContext(Re),{issues:B,fetchIssues:H}=O(G(f=>({issues:f.issues,fetchIssues:f.fetchIssues}))),{selectedIssueIds:re,toggleSelect:ze,cliPanelIssueId:I,supervisorStatus:er}=D(G(f=>({selectedIssueIds:f.selectedIssueIds,toggleSelect:f.toggleSelect,cliPanelIssueId:f.cliPanelIssueId,supervisorStatus:f.supervisorStatus}))),_e=re.size>0,{configured:W,board:V,teams:Y,selectedTeamId:ae,loading:se,checkStatus:oe,fetchTeams:ne,selectTeam:Ee,refresh:Le}=K(G(f=>({configured:f.configured,board:f.board,teams:f.teams,selectedTeamId:f.selectedTeamId,loading:f.loading,checkStatus:f.checkStatus,fetchTeams:f.fetchTeams,selectTeam:f.selectTeam,refresh:f.refresh})));p.useEffect(()=>{H()},[H]),p.useEffect(()=>{oe()},[oe]),p.useEffect(()=>{W&&ne()},[W,ne]);const M=p.useMemo(()=>V?V.columns.flatMap(f=>f.issues):[],[V]),De=o!==null&&!I,le=p.useCallback(f=>{a(ge[f]??"kanban")},[]);p.useEffect(()=>{z({items:[{label:"Kanban",icon:e.jsx(Ie,{size:14}),shortcut:"K"},{label:"Table",icon:e.jsx(Fe,{size:14}),shortcut:"L"},{label:"Center",icon:e.jsx(Et,{size:14}),shortcut:"C"}],activeIndex:ge.indexOf(t),onSwitch:le})},[z,t,le]),p.useEffect(()=>()=>j(),[j]),p.useEffect(()=>{function f(A){A.target instanceof HTMLInputElement||A.target instanceof HTMLTextAreaElement||A.target instanceof HTMLSelectElement||A.key==="c"&&!A.metaKey&&!A.ctrlKey&&(b("backlog"),N(!0))}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]);function q(f){if(f.type==="issue"){v(f.issue),d(null);return}const A=(o==null?void 0:o.type)===f.type&&f.type==="linearIssue"&&o.issue.id===f.issue.id;d(A?null:f)}function Be(f){b(f),N(!0)}function Ae(){d(null)}function ie(){H()}const Te=(o==null?void 0:o.type)==="linearIssue"?"Linear Issue":"Issue Detail";return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(It,{}),e.jsx("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] border-b border-border-divider shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-[var(--spacing-3)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx(Xe,{chips:[...Zt],active:r,onSelect:n}),e.jsxs("button",{type:"button",onClick:()=>g(!h),className:["flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-[length:var(--font-size-xs)] transition-colors",h?"border-accent-blue text-accent-blue bg-[var(--color-accent-blue-10,rgba(90,130,200,0.1))]":"text-text-secondary hover:text-text-primary"].join(" "),style:h?void 0:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:h?"Hide Done column":"Show Done column",children:[e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Done"]})]}),W&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] shrink-0",children:[Y.length>0&&e.jsx("select",{value:ae??"",onChange:f=>Ee(f.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-primary text-[length:var(--font-size-xs)]",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},children:Y.map(f=>e.jsxs("option",{value:f.id,children:[f.key," — ",f.name]},f.id))}),e.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary text-[length:var(--font-size-xs)] transition-colors",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Import from Linear",children:[e.jsx(Ge,{size:12}),e.jsx("span",{children:"Import"})]}),e.jsxs("button",{type:"button",onClick:()=>x(!0),className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary text-[length:var(--font-size-xs)] transition-colors",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Export to Linear",children:[e.jsx(At,{size:12}),e.jsx("span",{children:"Export"})]}),e.jsx("button",{type:"button",onClick:()=>void Le(),disabled:se,className:"flex items-center justify-center w-7 h-7 rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary transition-colors disabled:opacity-50",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Refresh Linear board",children:e.jsx(Dt,{size:12,className:se?"animate-spin":""})})]})]})}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-auto min-w-0",children:[t==="kanban"&&e.jsx(vt,{linearIssues:M,localIssues:B,selectedItem:o,onSelectItem:q,composingColumnId:m,onStartCompose:Be,onStopCompose:()=>y(null),onIssueCreated:ie,showDone:h,batchMode:_e,selectedIssueIds:re,onToggleIssueCheck:ze}),t==="table"&&e.jsx(bt,{localIssues:B,linearIssues:M,selectedItem:o,onSelectItem:q}),t==="center"&&e.jsx(kt,{localIssues:B,linearIssues:M,selectedItem:o,onSelectItem:q})]}),I&&e.jsx(Pt,{}),!I&&e.jsx(He,{open:De,onClose:Ae,title:Te,children:o&&e.jsx(We,{selectedItem:o})})]}),e.jsx($t,{}),c&&e.jsx(St,{issues:M,onClose:()=>i(!1)}),l&&e.jsx(zt,{teams:Y,selectedTeamId:ae,onClose:()=>x(!1)}),e.jsx(Mt,{open:k,columnId:u,style:s,onClose:()=>N(!1),onCreated:ie}),C&&!I&&e.jsx(Jt,{issue:C,style:S,onClose:()=>v(null)})]})}export{pr as KanbanPage};
|