maestro-flow 0.4.2 → 0.4.4
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/maestro-analyze.md +1 -1
- package/.claude/commands/maestro-brainstorm.md +1 -1
- package/.claude/commands/maestro-collab.md +1 -1
- package/.claude/commands/maestro-execute.md +10 -1
- package/.claude/commands/maestro-guard.md +101 -0
- package/.claude/commands/maestro-impeccable.md +1 -1
- package/.claude/commands/maestro-plan.md +15 -2
- package/.claude/commands/maestro-ralph-execute.md +9 -2
- package/.claude/commands/maestro-ralph.md +8 -1
- package/.claude/commands/maestro-verify.md +15 -1
- package/.claude/commands/quality-auto-test.md +1 -1
- package/.claude/commands/quality-debug.md +1 -1
- package/.claude/commands/quality-refactor.md +1 -1
- package/.claude/commands/quality-retrospective.md +1 -1
- package/.claude/commands/quality-review.md +15 -1
- package/.claude/commands/quality-test.md +1 -1
- package/.claude/commands/security-audit.md +154 -0
- package/.claude/skills/maestro-help/index/catalog.json +2 -0
- package/.codex/skills/maestro-analyze/SKILL.md +18 -1
- package/.codex/skills/maestro-brainstorm/SKILL.md +17 -4
- package/.codex/skills/maestro-collab/SKILL.md +7 -1
- package/.codex/skills/maestro-execute/SKILL.md +365 -348
- package/.codex/skills/maestro-guard/SKILL.md +97 -0
- package/.codex/skills/maestro-impeccable/SKILL.md +1 -1
- package/.codex/skills/maestro-plan/SKILL.md +66 -7
- package/.codex/skills/maestro-ralph/SKILL.md +1 -1
- package/.codex/skills/maestro-verify/SKILL.md +18 -1
- package/.codex/skills/quality-auto-test/SKILL.md +13 -3
- package/.codex/skills/quality-debug/SKILL.md +362 -346
- package/.codex/skills/quality-refactor/SKILL.md +1 -1
- package/.codex/skills/quality-retrospective/SKILL.md +292 -292
- package/.codex/skills/quality-review/SKILL.md +374 -365
- package/.codex/skills/quality-test/SKILL.md +1 -1
- package/.codex/skills/security-audit/SKILL.md +154 -0
- package/bin/maestro-hook-runner.js +21 -1
- package/dashboard/dist/assets/{ArtifactsPage-iJZtYsmR.js → ArtifactsPage-CVh0Z2I2.js} +3 -3
- package/dashboard/dist/assets/{ChatInput-DNnDLdQF.js → ChatInput-CBI3qHQQ.js} +2 -2
- package/dashboard/dist/assets/ChatPage-BjJ9CYox.js +22 -0
- package/dashboard/dist/assets/CollabPage-CprGGO9y.js +1 -0
- package/dashboard/dist/assets/{ExecutionPanel-BKV3GZ7Q.js → ExecutionPanel-CClxD7cH.js} +1 -1
- package/dashboard/dist/assets/KanbanPage-copqjdPg.js +16 -0
- package/dashboard/dist/assets/MaestroCoordinatePage-CioZjQ9N.js +4 -0
- package/dashboard/dist/assets/{MarkdownRenderer-cYFfe1uX.js → MarkdownRenderer-CtUhoxCT.js} +1 -1
- package/dashboard/dist/assets/McpPage-BcPPcJpr.js +21 -0
- package/dashboard/dist/assets/{MeetingRoomPage-wnvT7wlB.js → MeetingRoomPage-BgmAKxU-.js} +1 -1
- package/dashboard/dist/assets/{OutputPanel-DDL90Idy.js → OutputPanel-DgT3gMyp.js} +1 -1
- package/dashboard/dist/assets/{ProblemsPanel-zFN9IIs0.js → ProblemsPanel-BmG7rxoG.js} +1 -1
- package/dashboard/dist/assets/{RequirementBoardPage-DOPJoT0I.js → RequirementBoardPage-k8YoeQ0r.js} +1 -1
- package/dashboard/dist/assets/{RequirementPage-CEVquRgM.js → RequirementPage-Da2354px.js} +1 -1
- package/dashboard/dist/assets/{RoomsPage-D5USEWDh.js → RoomsPage-BtqDiYaU.js} +1 -1
- package/dashboard/dist/assets/SpecsPage-ByPVH_M3.js +36 -0
- package/dashboard/dist/assets/{TeamsPage-DlcEmr_Q.js → TeamsPage-sFDLN30L.js} +1 -1
- package/dashboard/dist/assets/{TreeBrowser-Y48Wz-QY.js → TreeBrowser-oEx8YJXV.js} +1 -1
- package/dashboard/dist/assets/WorkflowPage-JrX7CVHh.js +6 -0
- package/dashboard/dist/assets/{arrow-left-NCUOENvg.js → arrow-left-DYvgSdIH.js} +1 -1
- package/dashboard/dist/assets/{check-o7nfGNHf.js → check-jcgYBWVR.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-BXySK2fn.js → chevron-right-DvZ5sMOg.js} +1 -1
- package/dashboard/dist/assets/{circle-cooAwnAR.js → circle-DYT-zoRZ.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-DcSBokh4.js → circle-alert-Bfbv3gt4.js} +1 -1
- package/dashboard/dist/assets/{circle-check-Cd-jce4j.js → circle-check-D82WnpbI.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-BN7Mdp4i.js → circle-check-big-CPVD1GKF.js} +1 -1
- package/dashboard/dist/assets/{code-BQa9oL1n.js → code-B3bKFGI4.js} +1 -1
- package/dashboard/dist/assets/{columns-3-BzgxelGx.js → columns-3-BeMAQCix.js} +1 -1
- package/dashboard/dist/assets/{download-swRJnate.js → download-BCtpoWYB.js} +1 -1
- package/dashboard/dist/assets/en-2h6fD0j8.js +1 -0
- package/dashboard/dist/assets/{folder-DbGbLNFN.js → folder-CTj6SNNu.js} +1 -1
- package/dashboard/dist/assets/index-6-yE5Yl9.css +1 -0
- package/dashboard/dist/assets/{index-DIoMBMbv.js → index-BxR_3IbJ.js} +1 -1
- package/dashboard/dist/assets/{index-DLBN_7fb.js → index-CWBJLu42.js} +1 -1
- package/dashboard/dist/assets/index-DpcPd-UG.js +236 -0
- package/dashboard/dist/assets/{list-BTRAIvDq.js → list-BMv8pIQn.js} +1 -1
- package/dashboard/dist/assets/{loader-NHtB6Mdn.js → loader-DdM4VOgF.js} +1 -1
- package/dashboard/dist/assets/{minus-BjMxRTET.js → minus-D15s2E__.js} +1 -1
- package/dashboard/dist/assets/{pen-line-C4_O16H0.js → pen-line-DO6o4xWz.js} +1 -1
- package/dashboard/dist/assets/{pencil-DTmKhyDY.js → pencil-qGxg9jOe.js} +1 -1
- package/dashboard/dist/assets/{proxy-Dtx5p6IO.js → proxy-DOffTzwA.js} +1 -1
- package/dashboard/dist/assets/refresh-cw-C9UNdLCy.js +6 -0
- package/dashboard/dist/assets/{rows-2-GR1dZtRu.js → rows-2-CifAA5SL.js} +1 -1
- package/dashboard/dist/assets/{search-DVtgy2W7.js → search-pe7pU1YN.js} +1 -1
- package/dashboard/dist/assets/{shallow-BOmvDNsv.js → shallow-r7YynQYA.js} +1 -1
- package/dashboard/dist/assets/table-Bh772iIw.js +6 -0
- package/dashboard/dist/assets/{team-types-BPeOvVdA.js → team-types-C_HqX2p2.js} +1 -1
- package/dashboard/dist/assets/{terminal-CzogW4cl.js → terminal-EpmtGBlw.js} +1 -1
- package/dashboard/dist/assets/{trash-2-52LATVfW.js → trash-2-Xen46iNQ.js} +1 -1
- package/dashboard/dist/assets/{users-DLFE2voE.js → users-BLueDPxF.js} +1 -1
- package/dashboard/dist/assets/{zap-DhiYlgyZ.js → zap-DsQCPF61.js} +1 -1
- package/dashboard/dist/assets/zh-CN-r3AvxxOL.js +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/routes/settings.js +70 -1
- package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
- package/dashboard/dist-server/src/coordinator/output-parser.js +27 -0
- package/dashboard/dist-server/src/coordinator/output-parser.js.map +1 -1
- package/dashboard/dist-server/src/types/index.d.ts +48 -6
- package/dist/src/commands/coordinate.d.ts.map +1 -1
- package/dist/src/commands/coordinate.js +4 -0
- package/dist/src/commands/coordinate.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +239 -8
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +466 -0
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/config/index.d.ts +5 -1
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/index.js +42 -0
- package/dist/src/config/index.js.map +1 -1
- package/dist/src/coordinator/output-parser.d.ts.map +1 -1
- package/dist/src/coordinator/output-parser.js +27 -0
- package/dist/src/coordinator/output-parser.js.map +1 -1
- package/dist/src/hooks/delegate-monitor.d.ts +1 -0
- package/dist/src/hooks/delegate-monitor.d.ts.map +1 -1
- package/dist/src/hooks/delegate-monitor.js +1 -1
- package/dist/src/hooks/delegate-monitor.js.map +1 -1
- package/dist/src/hooks/guards/workflow-guard.d.ts +15 -0
- package/dist/src/hooks/guards/workflow-guard.d.ts.map +1 -1
- package/dist/src/hooks/guards/workflow-guard.js +61 -1
- package/dist/src/hooks/guards/workflow-guard.js.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.js +63 -4
- package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
- package/dist/src/hooks/plugins/decision-log-plugin.d.ts +19 -0
- package/dist/src/hooks/plugins/decision-log-plugin.d.ts.map +1 -0
- package/dist/src/hooks/plugins/decision-log-plugin.js +28 -0
- package/dist/src/hooks/plugins/decision-log-plugin.js.map +1 -0
- package/dist/src/hooks/plugins/index.d.ts +2 -0
- package/dist/src/hooks/plugins/index.d.ts.map +1 -1
- package/dist/src/hooks/plugins/index.js +1 -0
- package/dist/src/hooks/plugins/index.js.map +1 -1
- package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts +13 -0
- package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts.map +1 -0
- package/dist/src/hooks/plugins/spec-analytics-plugin.js +92 -0
- package/dist/src/hooks/plugins/spec-analytics-plugin.js.map +1 -0
- package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
- package/dist/src/hooks/plugins/spec-injection-plugin.js +57 -4
- package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
- package/dist/src/hooks/session-context.d.ts +1 -0
- package/dist/src/hooks/session-context.d.ts.map +1 -1
- package/dist/src/hooks/session-context.js +1 -1
- package/dist/src/hooks/session-context.js.map +1 -1
- package/dist/src/hooks/skill-context.d.ts +1 -0
- package/dist/src/hooks/skill-context.d.ts.map +1 -1
- package/dist/src/hooks/skill-context.js +1 -1
- package/dist/src/hooks/skill-context.js.map +1 -1
- package/dist/src/hooks/spec-analytics.d.ts +128 -0
- package/dist/src/hooks/spec-analytics.d.ts.map +1 -0
- package/dist/src/hooks/spec-analytics.js +311 -0
- package/dist/src/hooks/spec-analytics.js.map +1 -0
- package/dist/src/hooks/spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/spec-injector.js +129 -5
- package/dist/src/hooks/spec-injector.js.map +1 -1
- package/dist/src/tools/spec-loader.d.ts +20 -0
- package/dist/src/tools/spec-loader.d.ts.map +1 -1
- package/dist/src/tools/spec-loader.js +58 -7
- package/dist/src/tools/spec-loader.js.map +1 -1
- package/dist/src/tui/config-ui/ConfigHub.d.ts +1 -1
- package/dist/src/tui/config-ui/ConfigHub.d.ts.map +1 -1
- package/dist/src/tui/config-ui/ConfigHub.js +16 -10
- package/dist/src/tui/config-ui/ConfigHub.js.map +1 -1
- package/dist/src/tui/config-ui/ConfigSourcesView.d.ts.map +1 -1
- package/dist/src/tui/config-ui/ConfigSourcesView.js +3 -2
- package/dist/src/tui/config-ui/ConfigSourcesView.js.map +1 -1
- package/dist/src/tui/config-ui/HooksPanel.d.ts.map +1 -1
- package/dist/src/tui/config-ui/HooksPanel.js +15 -19
- package/dist/src/tui/config-ui/HooksPanel.js.map +1 -1
- package/dist/src/tui/config-ui/SkillConfigDashboard.d.ts.map +1 -1
- package/dist/src/tui/config-ui/SkillConfigDashboard.js +5 -9
- package/dist/src/tui/config-ui/SkillConfigDashboard.js.map +1 -1
- package/dist/src/tui/config-ui/SkillParamEditor.d.ts.map +1 -1
- package/dist/src/tui/config-ui/SkillParamEditor.js +1 -3
- package/dist/src/tui/config-ui/SkillParamEditor.js.map +1 -1
- package/dist/src/tui/config-ui/SkillsList.d.ts.map +1 -1
- package/dist/src/tui/config-ui/SkillsList.js +7 -9
- package/dist/src/tui/config-ui/SkillsList.js.map +1 -1
- package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts +6 -0
- package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts.map +1 -0
- package/dist/src/tui/config-ui/SpecAnalyticsPanel.js +164 -0
- package/dist/src/tui/config-ui/SpecAnalyticsPanel.js.map +1 -0
- package/dist/src/tui/config-ui/SpecPanel.d.ts.map +1 -1
- package/dist/src/tui/config-ui/SpecPanel.js +918 -20
- package/dist/src/tui/config-ui/SpecPanel.js.map +1 -1
- package/dist/src/tui/config-ui/index.d.ts +3 -1
- package/dist/src/tui/config-ui/index.d.ts.map +1 -1
- package/dist/src/tui/config-ui/index.js +4 -0
- package/dist/src/tui/config-ui/index.js.map +1 -1
- package/dist/src/tui/install-ui/BackupConfig.d.ts.map +1 -1
- package/dist/src/tui/install-ui/BackupConfig.js +3 -2
- package/dist/src/tui/install-ui/BackupConfig.js.map +1 -1
- package/dist/src/tui/install-ui/BlueprintPreview.d.ts.map +1 -1
- package/dist/src/tui/install-ui/BlueprintPreview.js +7 -6
- package/dist/src/tui/install-ui/BlueprintPreview.js.map +1 -1
- package/dist/src/tui/install-ui/ComponentGrid.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ComponentGrid.js +3 -2
- package/dist/src/tui/install-ui/ComponentGrid.js.map +1 -1
- package/dist/src/tui/install-ui/ConfigPanel.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ConfigPanel.js +4 -3
- package/dist/src/tui/install-ui/ConfigPanel.js.map +1 -1
- package/dist/src/tui/install-ui/CyberItem.d.ts.map +1 -1
- package/dist/src/tui/install-ui/CyberItem.js +7 -6
- package/dist/src/tui/install-ui/CyberItem.js.map +1 -1
- package/dist/src/tui/install-ui/CyberdeckBlueprint.d.ts.map +1 -1
- package/dist/src/tui/install-ui/CyberdeckBlueprint.js +2 -1
- package/dist/src/tui/install-ui/CyberdeckBlueprint.js.map +1 -1
- package/dist/src/tui/install-ui/ExecutionView.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ExecutionView.js +3 -2
- package/dist/src/tui/install-ui/ExecutionView.js.map +1 -1
- package/dist/src/tui/install-ui/GradientHeader.d.ts.map +1 -1
- package/dist/src/tui/install-ui/GradientHeader.js +2 -1
- package/dist/src/tui/install-ui/GradientHeader.js.map +1 -1
- package/dist/src/tui/install-ui/HooksConfig.d.ts.map +1 -1
- package/dist/src/tui/install-ui/HooksConfig.js +8 -8
- package/dist/src/tui/install-ui/HooksConfig.js.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.js +4 -3
- package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.js +3 -2
- package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.js +3 -2
- package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.js +9 -8
- package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.js +3 -2
- package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
- package/dist/src/tui/install-ui/McpConfig.d.ts.map +1 -1
- package/dist/src/tui/install-ui/McpConfig.js +4 -3
- package/dist/src/tui/install-ui/McpConfig.js.map +1 -1
- package/dist/src/tui/install-ui/ResultDashboard.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ResultDashboard.js +3 -2
- package/dist/src/tui/install-ui/ResultDashboard.js.map +1 -1
- package/dist/src/tui/install-ui/ReviewPanel.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ReviewPanel.js +2 -1
- package/dist/src/tui/install-ui/ReviewPanel.js.map +1 -1
- package/dist/src/tui/install-ui/StatuslineConfig.d.ts.map +1 -1
- package/dist/src/tui/install-ui/StatuslineConfig.js +3 -2
- package/dist/src/tui/install-ui/StatuslineConfig.js.map +1 -1
- package/dist/src/tui/install-ui/StepSelector.d.ts.map +1 -1
- package/dist/src/tui/install-ui/StepSelector.js +11 -10
- package/dist/src/tui/install-ui/StepSelector.js.map +1 -1
- package/dist/src/tui/overlay-ui/OverlayList.d.ts.map +1 -1
- package/dist/src/tui/overlay-ui/OverlayList.js +8 -12
- package/dist/src/tui/overlay-ui/OverlayList.js.map +1 -1
- package/dist/src/tui/shared/components.d.ts +56 -0
- package/dist/src/tui/shared/components.d.ts.map +1 -0
- package/dist/src/tui/shared/components.js +55 -0
- package/dist/src/tui/shared/components.js.map +1 -0
- package/dist/src/tui/shared/helpers.d.ts +24 -0
- package/dist/src/tui/shared/helpers.d.ts.map +1 -0
- package/dist/src/tui/shared/helpers.js +49 -0
- package/dist/src/tui/shared/helpers.js.map +1 -0
- package/dist/src/tui/shared/index.d.ts +4 -0
- package/dist/src/tui/shared/index.d.ts.map +1 -0
- package/dist/src/tui/shared/index.js +7 -0
- package/dist/src/tui/shared/index.js.map +1 -0
- package/dist/src/tui/shared/tokens.d.ts +79 -0
- package/dist/src/tui/shared/tokens.d.ts.map +1 -0
- package/dist/src/tui/shared/tokens.js +81 -0
- package/dist/src/tui/shared/tokens.js.map +1 -0
- package/dist/src/tui/tools-ui/CommandReference.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/CommandReference.js +2 -4
- package/dist/src/tui/tools-ui/CommandReference.js.map +1 -1
- package/dist/src/tui/tools-ui/ConfigSources.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ConfigSources.js +3 -2
- package/dist/src/tui/tools-ui/ConfigSources.js.map +1 -1
- package/dist/src/tui/tools-ui/RegisterSettings.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/RegisterSettings.js +2 -1
- package/dist/src/tui/tools-ui/RegisterSettings.js.map +1 -1
- package/dist/src/tui/tools-ui/RoleMappings.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/RoleMappings.js +3 -5
- package/dist/src/tui/tools-ui/RoleMappings.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.js +3 -5
- package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.js +3 -5
- package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
- package/dist/src/tui/uninstall-ui/UninstallFlow.d.ts.map +1 -1
- package/dist/src/tui/uninstall-ui/UninstallFlow.js +8 -7
- package/dist/src/tui/uninstall-ui/UninstallFlow.js.map +1 -1
- package/dist/src/types/index.d.ts +48 -6
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/workflows/debug.md +73 -0
- package/workflows/execute.md +27 -0
- package/workflows/plan.md +11 -0
- package/workflows/review.md +33 -1
- package/workflows/tdd.md +257 -0
- package/workflows/verify.md +57 -0
- package/dashboard/dist/assets/ChatPage-BjBibfE4.js +0 -22
- package/dashboard/dist/assets/CollabPage-8lUMUol_.js +0 -1
- package/dashboard/dist/assets/KanbanPage-diY3QmGd.js +0 -21
- package/dashboard/dist/assets/McpPage-COjuIf7U.js +0 -21
- package/dashboard/dist/assets/SpecsPage-BOwBin_o.js +0 -36
- package/dashboard/dist/assets/SupervisorPage-5iRyMU5T.js +0 -6
- package/dashboard/dist/assets/WorkflowPage-CmQaRVgL.js +0 -6
- package/dashboard/dist/assets/en-C_BD3UCD.js +0 -1
- package/dashboard/dist/assets/index-BEUaOz_b.css +0 -1
- package/dashboard/dist/assets/index-uIqUCT8y.js +0 -236
- package/dashboard/dist/assets/table-DCzuJAFh.js +0 -6
- package/dashboard/dist/assets/zh-CN-DvQKfow3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,
|
|
1
|
+
import{j as e,an as g,M as b,l as h,r as c,s as v,R as y,P as j,O as N,f as w,T as C,h as p,i as m,ao as u,a4 as f,ap as k}from"./index-DpcPd-UG.js";import{T as z}from"./trash-2-Xen46iNQ.js";import{U as R}from"./users-BLueDPxF.js";import{C as D}from"./chevron-right-DvZ5sMOg.js";const S={active:"#3D9B6F",paused:"#C99B2D",destroyed:"#D05454"};function L({status:t}){const a=S[t]??"#A09D97";return e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${a}18`,color:a},children:[t==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:a}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:a}})]}),t.charAt(0).toUpperCase()+t.slice(1)]})}function M({room:t,onClick:a,onDelete:i}){const o=Date.now()-new Date(t.createdAt).getTime(),r=Math.floor(o/6e4),l=r<60?`${r}m`:`${Math.floor(r/60)}h ${r%60}m`;return e.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&a()},className:"group w-full text-left bg-bg-card border border-border rounded-xl p-3.5 hover:border-accent-blue hover:shadow-[0_2px_12px_rgba(0,0,0,0.06)] transition-all duration-150 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[11px] font-bold text-white shrink-0 bg-[#4A90D9]",children:"MR"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:t.sessionId})}),e.jsx(L,{status:t.status}),i&&e.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),i(t.sessionId)},className:"w-6 h-6 rounded-md flex items-center justify-center text-text-placeholder opacity-0 group-hover:opacity-100 hover:!text-status-failed hover:bg-[rgba(196,101,85,0.1)] transition-all shrink-0",title:"Delete room",children:e.jsx(z,{size:13,strokeWidth:2})})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-tertiary",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(R,{size:11}),t.agentCount," agents"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(g,{size:11}),t.taskCount," tasks"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(b,{size:11}),t.messageCount," msgs"]}),e.jsx("span",{className:"ml-auto text-text-placeholder",children:l}),e.jsx(D,{size:14,className:"text-text-placeholder group-hover:text-text-primary transition-colors"})]})]})}const T=m("w-full px-[var(--spacing-3)] py-[var(--spacing-2)]","rounded-[var(--radius-default)] border border-border","bg-bg-secondary text-text-primary","text-[length:var(--font-size-sm)]","focus:outline-none focus:shadow-[var(--shadow-focus-ring)]","transition-shadow duration-[var(--duration-fast)]"),$="block text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-secondary mb-[var(--spacing-1)]";function I(t){return t.toLowerCase().replace(/[^a-z0-9\u4e00-\u9fff]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function P({open:t,onOpenChange:a}){const i=h(),[o,r]=c.useState("");c.useEffect(()=>{t||r("")},[t]);const l=I(o)||`room-${Date.now().toString(36)}`,n=c.useCallback(()=>{o.trim()&&(v({action:"room:create",sessionId:l}),a(!1),i(`/meeting-room/${l}`))},[o,l,a,i]);return e.jsx(y,{open:t,onOpenChange:a,children:e.jsxs(j,{children:[e.jsx(N,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(w,{className:m("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[440px] max-w-[95vw]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-6)] py-[var(--spacing-4)] border-b border-border shrink-0",children:[e.jsx(C,{className:"text-[length:var(--font-size-lg)] font-[var(--font-weight-semibold)] text-text-primary",children:"New Meeting Room"}),e.jsx(p,{className:m("w-8 h-8 flex items-center justify-center rounded-[var(--radius-sm)]","text-text-secondary hover:text-text-primary hover:bg-bg-hover","transition-colors duration-[var(--duration-fast)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]"),"aria-label":"Close",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:"p-[var(--spacing-6)] space-y-[var(--spacing-4)]",children:e.jsxs("div",{children:[e.jsx("label",{htmlFor:"room-name",className:$,children:"Room Name"}),e.jsx("input",{id:"room-name",type:"text",value:o,onChange:d=>r(d.target.value),onKeyDown:d=>{d.key==="Enter"&&n()},placeholder:"e.g. Architecture Review",className:T,autoFocus:!0}),e.jsxs("p",{className:"mt-1 text-[10px] text-text-placeholder font-mono",children:["ID: ",l]})]})}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-[var(--spacing-6)] py-[var(--spacing-4)] border-t border-border",children:[e.jsx(p,{className:m("px-3 py-1.5 rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] text-text-secondary","hover:bg-bg-hover transition-colors"),children:"Cancel"}),e.jsx("button",{type:"button",onClick:n,disabled:!o.trim(),className:m("px-4 py-1.5 rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)]","bg-accent-blue text-white","hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed","transition-opacity"),children:"Create"})]})]})]})})}function W(){const t=h(),a=u(s=>s.rooms),i=u(s=>s.loading),o=u(s=>s.fetchRooms),r=u(s=>s.deleteRoom),[l,n]=c.useState(!1);c.useEffect(()=>{o()},[o]);const d=c.useCallback(async s=>{await r(s)},[r]),x=a.filter(s=>s.status!=="destroyed");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-3 px-3 py-3 border-b border-border-divider bg-bg-secondary shrink-0",children:[e.jsx("h1",{className:"text-[length:var(--font-size-base)] font-semibold text-text-primary",children:"Meeting Rooms"}),e.jsx("span",{className:"text-[11px] text-text-tertiary bg-bg-hover px-1.5 py-0.5 rounded-full",children:x.length}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[12px] font-medium bg-accent-blue text-white hover:opacity-90 transition-opacity",children:[e.jsx(f,{size:14}),"New Room"]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[i&&x.length===0&&e.jsx("div",{className:"flex items-center justify-center h-48 text-text-tertiary text-[length:var(--font-size-sm)]",children:"Loading..."}),!i&&x.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-3 text-text-tertiary",children:[e.jsx(k,{size:40,strokeWidth:1.2,className:"opacity-30"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)]",children:"No meeting rooms yet"}),e.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[12px] font-medium bg-accent-blue text-white hover:opacity-90 transition-opacity",children:[e.jsx(f,{size:14}),"Create your first room"]})]}),x.length>0&&e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))"},children:x.map(s=>e.jsx(M,{room:s,onClick:()=>t(`/meeting-room/${s.sessionId}`),onDelete:d},s.sessionId))})]}),e.jsx(P,{open:l,onOpenChange:n})]})}export{W as RoomsPage};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{d as S,o as se,a7 as F,r as p,j as e,a4 as H,a8 as ie,F as U,a9 as le,X as ce,R as de,P as xe,O as pe,f as be,T as ue,h as O,i as A,V as me}from"./index-DpcPd-UG.js";import{u as ge}from"./shallow-r7YynQYA.js";import{C as ye}from"./columns-3-BeMAQCix.js";import{L as fe}from"./list-BMv8pIQn.js";import{S as he}from"./search-pe7pU1YN.js";import{C as Y}from"./circle-DYT-zoRZ.js";import{m as z}from"./proxy-DOffTzwA.js";import{C as ve}from"./circle-alert-Bfbv3gt4.js";import{T as J}from"./trash-2-Xen46iNQ.js";import{P as X}from"./pen-line-DO6o4xWz.js";import{C as we}from"./check-jcgYBWVR.js";/**
|
|
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 je=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Q=S("arrow-down",je);/**
|
|
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 ke=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],Ne=S("compass",ke);/**
|
|
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 Ce=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ee=S("eye-off",Ce);/**
|
|
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 Be=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ae=S("eye",Be);/**
|
|
22
|
+
* @license lucide-react v0.577.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const Se=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],De=S("settings",Se);/**
|
|
27
|
+
* @license lucide-react v0.577.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const Te=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],R=S("shield",Te);/**
|
|
32
|
+
* @license lucide-react v0.577.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const Fe=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Z=S("tag",Fe),y=se((r,c)=>({entries:[],files:[],loading:!1,error:null,activeView:"kanban",typeFilter:"all",categoryFilter:"all",keywordFilter:"all",search:"",selectedEntry:null,hiddenColumns:new Set,setActiveView:o=>r({activeView:o}),setTypeFilter:o=>r({typeFilter:o}),setCategoryFilter:o=>r({categoryFilter:o}),setKeywordFilter:o=>r({keywordFilter:o}),setSearch:o=>r({search:o}),setSelectedEntry:o=>r({selectedEntry:o}),toggleColumn:o=>r(n=>{const s=new Set(n.hiddenColumns);return s.has(o)?s.delete(o):s.add(o),{hiddenColumns:s}}),fetchEntries:async()=>{r({loading:!0,error:null});try{const o=await fetch(F.SPECS);if(!o.ok)throw new Error(`Failed: ${o.status}`);const n=await o.json();r({entries:n.entries??[],loading:!1})}catch(o){r({loading:!1,error:String(o)})}},fetchFiles:async()=>{try{const o=await fetch(F.SPECS_FILES);if(!o.ok)return;const n=await o.json();r({files:n.files??[]})}catch{}},addEntry:async(o,n,s)=>{r({error:null});try{const d=await fetch(F.SPECS,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:o,content:n,file:s})});if(!d.ok){const g=await d.json().catch(()=>({error:`HTTP ${d.status}`}));throw new Error(g.error)}return c().fetchEntries(),null}catch(d){return r({error:String(d)}),null}},deleteEntry:async o=>{r({error:null});const n=c().entries;r(s=>({entries:s.entries.filter(d=>d.id!==o)}));try{(await fetch(`${F.SPECS}/${o}`,{method:"DELETE"})).ok||r({entries:n})}catch{r({entries:n})}},filteredEntries:()=>{const{entries:o,typeFilter:n,categoryFilter:s,keywordFilter:d,search:g}=c();let f=o;if(n!=="all"&&(f=f.filter(u=>u.type===n)),s!=="all"&&(f=f.filter(u=>u.category===s)),d!=="all"&&(f=f.filter(u=>u.keywords.includes(d))),g){const u=g.toLowerCase();f=f.filter(h=>h.title.toLowerCase().includes(u)||h.content.toLowerCase().includes(u)||h.id.toLowerCase().includes(u)||h.keywords.some(v=>v.toLowerCase().includes(u)))}return f},entriesByType:()=>{const o=c().filteredEntries(),n={bug:[],pattern:[],decision:[],rule:[],debug:[],test:[],review:[],validation:[],general:[],learning:[],coding:[],arch:[],quality:[]};for(const s of o)(n[s.type]??n.general).push(s);return n},typeCounts:()=>{const{entries:o}=c(),n={all:o.length,bug:0,pattern:0,decision:0,rule:0,debug:0,test:0,review:0,validation:0,general:0};for(const s of o)n[s.type]=(n[s.type]??0)+1;return n},allCategories:()=>{const{entries:o}=c(),n=new Set;for(const s of o)s.category&&n.add(s.category);return Array.from(n).sort()},allKeywords:()=>{const{entries:o}=c(),n=new Set;for(const s of o)for(const d of s.keywords)n.add(d);return Array.from(n).sort()}})),_e={general:{label:"General",icon:e.jsx(Y,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-pending)",color:"#A09D97"},planning:{label:"Planning",icon:e.jsx(Ne,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-planning)",color:"#9178B5"},execution:{label:"Execution",icon:e.jsx(De,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-exploring)",color:"#5B8DB8"},debug:{label:"Debug",icon:e.jsx(ve,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-blocked)",color:"#C46555"},test:{label:"Test",icon:e.jsx(R,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-completed)",color:"#5A9E78"},review:{label:"Review",icon:e.jsx(le,{size:14,strokeWidth:1.8}),tintBg:"rgba(219,176,108,0.12)",color:"#C4A055"},validation:{label:"Validation",icon:e.jsx(R,{size:14,strokeWidth:1.8}),tintBg:"rgba(90,158,120,0.10)",color:"#3D8B5F"}},Le=["general","planning","execution","debug","test","review","validation"],ze={label:"",icon:e.jsx(Y,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-pending)",color:"#A09D97"};function I(r){return _e[r]??{...ze,label:r.charAt(0).toUpperCase()+r.slice(1)}}const Me={coding:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},arch:{bg:"var(--color-tint-planning)",text:"#9178B5"},quality:{bg:"var(--color-tint-completed)",text:"#5A9E78"},debug:{bg:"rgba(196,101,85,0.10)",text:"#B85B4A"},test:{bg:"rgba(90,158,120,0.10)",text:"#3D8B5F"},review:{bg:"rgba(219,176,108,0.12)",text:"#C4A055"},learning:{bg:"var(--color-tint-blocked)",text:"#C46555"},bug:{bg:"var(--color-tint-blocked)",text:"#C46555"},pattern:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},decision:{bg:"var(--color-tint-planning)",text:"#9178B5"},rule:{bg:"var(--color-tint-completed)",text:"#5A9E78"},validation:{bg:"rgba(91,141,184,0.10)",text:"#4A7DA8"},general:{bg:"var(--color-tint-pending)",text:"#A09D97"}},We={bg:"var(--color-tint-pending)",text:"#A09D97"};function qe(r){if(!r)return"--";const c=new Date(r);if(isNaN(c.getTime()))return"--";const n=Date.now()-c.getTime(),s=Math.floor(n/6e4);if(s<1)return"now";if(s<60)return`${s}m ago`;const d=Math.floor(s/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function $e({onAddEntry:r}){const c=y(a=>a.entries),o=y(a=>a.typeFilter),n=y(a=>a.keywordFilter),s=y(a=>a.search),d=y(a=>a.selectedEntry),g=y(a=>a.setSelectedEntry),f=y(a=>a.setKeywordFilter),u=y(a=>a.hiddenColumns),h=y(a=>a.toggleColumn),v=p.useMemo(()=>{const a=new Set;for(const x of c)x.category&&a.add(x.category);const i=[];for(const x of Le)a.has(x)&&(i.push(x),a.delete(x));for(const x of Array.from(a).sort())i.push(x);return i},[c]),N=p.useMemo(()=>{const a=new Set;for(const i of c)for(const x of i.keywords)a.add(x);return Array.from(a).sort()},[c]),w=p.useMemo(()=>{let a=c;if(o!=="all"&&(a=a.filter(i=>i.type===o)),n!=="all"&&(a=a.filter(i=>i.keywords.includes(n))),s){const i=s.toLowerCase();a=a.filter(x=>x.title.toLowerCase().includes(i)||x.content.toLowerCase().includes(i)||x.id.toLowerCase().includes(i)||x.keywords.some(C=>C.toLowerCase().includes(i)))}return a},[c,o,n,s]),m=p.useMemo(()=>{const a={};for(const i of v)a[i]=[];for(const i of w){const x=i.category||"general";a[x]||(a[x]=[]),a[x].push(i)}return a},[w,v]),k=p.useMemo(()=>{const a={};for(const i of c){const x=i.category||"general";a[x]=(a[x]??0)+1}return a},[c]),B=p.useMemo(()=>v.filter(a=>!u.has(a)),[v,u]);return e.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-[6px] px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[v.map(a=>{const i=I(a),x=!u.has(a),C=k[a]??0;return e.jsxs("button",{type:"button",onClick:()=>h(a),className:["text-[11px] font-medium px-[10px] py-[4px] rounded-full border cursor-pointer transition-all","flex items-center gap-[5px]",x?"bg-bg-card text-text-primary border-border hover:shadow-sm":"bg-bg-secondary text-text-quaternary border-border-divider opacity-60"].join(" "),style:x?{borderColor:i.color,boxShadow:`0 0 0 1px ${i.color}22`}:void 0,children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0 transition-opacity",style:{background:i.color,opacity:x?1:.35}}),i.label,e.jsx("span",{className:"text-[10px] font-mono opacity-60",children:C})]},a)}),N.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-[18px] bg-border-divider mx-1"}),e.jsx(Z,{size:11,strokeWidth:2,className:"text-text-quaternary shrink-0"}),N.map(a=>{const i=n===a;return e.jsx("button",{type:"button",onClick:()=>f(i?"all":a),className:["text-[10px] font-medium px-2 py-[2px] rounded-[4px] border cursor-pointer transition-all",i?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border-divider hover:border-text-tertiary hover:text-text-primary"].join(" "),children:a},a)})]})]}),e.jsxs("div",{className:"flex gap-3 flex-1 overflow-x-auto p-3",children:[B.map((a,i)=>{const x=I(a),C=m[a]??[];return e.jsxs("div",{className:"flex flex-col min-w-[260px] flex-1 bg-bg-secondary rounded-[12px] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[14px] py-3 border-b border-black/[0.04]",children:[e.jsx("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center shrink-0",style:{background:x.tintBg,color:x.color},children:x.icon}),e.jsx("span",{className:"text-[13px] font-bold text-text-primary",children:x.label}),e.jsx("span",{className:"text-[10px] text-text-tertiary bg-bg-card px-[6px] rounded-full font-mono",children:C.length}),e.jsx("button",{type:"button",onClick:r,className:"ml-auto w-6 h-6 rounded-[6px] border border-dashed border-border bg-transparent cursor-pointer flex items-center justify-center text-text-quaternary hover:border-text-tertiary hover:text-text-primary hover:bg-bg-card transition-all",children:e.jsx(H,{size:12,strokeWidth:2})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-2 flex flex-col gap-2",children:[C.map((E,D)=>e.jsx(Ve,{entry:E,selected:d===E.id,onClick:()=>g(E.id),index:i*100+D},E.id)),C.length===0&&e.jsx("div",{className:"flex items-center justify-center py-8 text-[11px] text-text-quaternary",children:"No entries"})]})]},a)}),B.length===0&&e.jsx("div",{className:"flex items-center justify-center flex-1 text-[13px] text-text-tertiary",children:"All columns hidden — click a category tag above to show it."})]})]})}function Ve({entry:r,selected:c,onClick:o,index:n}){const s=Me[r.type]??We;return e.jsxs(z.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,delay:Math.min(n*.03,.3)},onClick:o,className:["bg-bg-card rounded-[10px] px-[14px] py-3 border cursor-pointer","transition-all duration-[180ms]","hover:-translate-y-[2px] hover:shadow-[0_4px_16px_rgba(0,0,0,0.06)] hover:border-border",c?"border-[#9178B5] shadow-[0_0_0_2px_rgba(145,120,181,0.2)]":"border-border-divider"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[6px] mb-2",children:[e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase font-mono tracking-[0.04em]",style:{background:s.bg,color:s.text},children:r.type}),e.jsx("span",{className:"text-[10px] font-mono text-text-quaternary ml-auto",children:r.id})]}),e.jsx("div",{className:"text-[13px] text-text-primary font-medium leading-[1.5] mb-2 line-clamp-3",children:r.content||r.title}),r.keywords.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[r.keywords.slice(0,4).map(d=>e.jsx("span",{className:"text-[9px] px-[5px] py-[1px] rounded-[3px] bg-bg-secondary text-text-tertiary font-mono",children:d},d)),r.keywords.length>4&&e.jsxs("span",{className:"text-[9px] text-text-quaternary font-mono",children:["+",r.keywords.length-4]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[10px] text-text-quaternary font-mono flex items-center gap-[3px]",children:[e.jsx(ie,{size:10,strokeWidth:2}),qe(r.timestamp)]}),r.file&&e.jsxs("span",{className:"text-[10px] text-text-tertiary flex items-center gap-[3px] ml-auto",children:[e.jsx(U,{size:10,strokeWidth:2}),r.file.split("/").pop()]})]})]})}const Pe={coding:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},arch:{bg:"var(--color-tint-planning)",text:"#9178B5"},quality:{bg:"var(--color-tint-completed)",text:"#5A9E78"},debug:{bg:"rgba(196,101,85,0.10)",text:"#B85B4A"},test:{bg:"rgba(90,158,120,0.10)",text:"#3D8B5F"},review:{bg:"rgba(219,176,108,0.12)",text:"#C4A055"},learning:{bg:"var(--color-tint-blocked)",text:"#C46555"},bug:{bg:"var(--color-tint-blocked)",text:"#C46555"},pattern:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},decision:{bg:"var(--color-tint-planning)",text:"#9178B5"},rule:{bg:"var(--color-tint-completed)",text:"#5A9E78"},validation:{bg:"rgba(91,141,184,0.10)",text:"#4A7DA8"},general:{bg:"var(--color-tint-pending)",text:"#A09D97"}},Oe={bg:"var(--color-tint-pending)",text:"#A09D97"},Re={coding:"#5B8DB8",arch:"#9178B5",quality:"#5A9E78",debug:"#B85B4A",test:"#3D8B5F",review:"#C4A055",learning:"#C46555",bug:"#C46555",pattern:"#5B8DB8",decision:"#9178B5",rule:"#5A9E78",validation:"#4A7DA8",general:"#A09D97"},ee={coding:"#5B8DB8",arch:"#9178B5",quality:"#5A9E78",learning:"#A09D97",debug:"#C46555",test:"#5A9E78",review:"#C4A055"},Ie=[{value:"all",label:"All"},{value:"bug",label:"Bug"},{value:"pattern",label:"Pattern"},{value:"decision",label:"Decision"},{value:"rule",label:"Rule"},{value:"debug",label:"Debug"},{value:"test",label:"Test"},{value:"review",label:"Review"},{value:"validation",label:"Validation"},{value:"general",label:"General"}],K=[{key:"id",label:"ID",width:60},{key:"type",label:"Type",width:80},{key:"category",label:"Category",width:100},{key:"content",label:"Content",alwaysVisible:!0},{key:"keywords",label:"Keywords",width:180},{key:"file",label:"File",width:140},{key:"added",label:"Added",width:90},{key:"actions",label:"",width:80,alwaysVisible:!0}];function Ke(r){if(!r)return"--";const c=new Date(r);if(isNaN(c.getTime()))return"--";const n=Date.now()-c.getTime(),s=Math.floor(n/6e4);if(s<1)return"now";if(s<60)return`${s}m ago`;const d=Math.floor(s/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function Ge(){const r=y(t=>t.entries),c=y(t=>t.typeFilter),o=y(t=>t.setTypeFilter),n=y(t=>t.categoryFilter),s=y(t=>t.setCategoryFilter),d=y(t=>t.keywordFilter),g=y(t=>t.setKeywordFilter),f=y(t=>t.search),u=y(t=>t.selectedEntry),h=y(t=>t.setSelectedEntry),v=y(t=>t.deleteEntry),N=y(t=>t.addEntry),[w,m]=p.useState("timestamp"),[k,B]=p.useState("desc"),[a,i]=p.useState(!1),[x,C]=p.useState("bug"),[E,D]=p.useState(""),[L,te]=p.useState(new Set),re=p.useCallback(t=>{te(l=>{const b=new Set(l);return b.has(t)?b.delete(t):b.add(t),b})},[]),T=p.useMemo(()=>K.filter(t=>t.alwaysVisible||!L.has(t.key)),[L]),M=p.useMemo(()=>{const t=new Set;for(const l of r)l.category&&t.add(l.category);return Array.from(t).sort()},[r]),W=p.useMemo(()=>{const t=new Set;for(const l of r)for(const b of l.keywords)t.add(b);return Array.from(t).sort()},[r]),oe=p.useMemo(()=>{const t={all:r.length,bug:0,pattern:0,decision:0,rule:0,general:0};for(const l of r)t[l.type]=(t[l.type]??0)+1;return t},[r]),ae=p.useMemo(()=>{const t={};for(const l of r){const b=l.category||"general";t[b]=(t[b]??0)+1}return t},[r]),q=p.useMemo(()=>{let t=r;if(c!=="all"&&(t=t.filter(l=>l.type===c)),n!=="all"&&(t=t.filter(l=>l.category===n)),d!=="all"&&(t=t.filter(l=>l.keywords.includes(d))),f){const l=f.toLowerCase();t=t.filter(b=>b.title.toLowerCase().includes(l)||b.content.toLowerCase().includes(l)||b.id.toLowerCase().includes(l)||b.keywords.some(j=>j.toLowerCase().includes(l)))}return t},[r,c,n,d,f]),$=p.useMemo(()=>{const t=[...q];return t.sort((l,b)=>{let j=0;return w==="timestamp"?j=new Date(l.timestamp).getTime()-new Date(b.timestamp).getTime():w==="id"?j=l.id.localeCompare(b.id):w==="type"?j=l.type.localeCompare(b.type):w==="category"&&(j=(l.category||"").localeCompare(b.category||"")),k==="desc"?-j:j}),t},[q,w,k]),V=p.useCallback(t=>{m(l=>l===t?(B(b=>b==="desc"?"asc":"desc"),l):(B("desc"),t))},[]),P=p.useCallback(async()=>{E.trim()&&(await N(x,E.trim(),"learnings.md"),D(""),i(!1))},[x,E,N]),ne=p.useCallback((t,l)=>{t.stopPropagation(),v(l)},[v]);return e.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-quaternary uppercase tracking-[0.06em]",children:"Type"}),Ie.map(t=>{const l=c===t.value;return e.jsxs("button",{type:"button",onClick:()=>o(t.value),className:["text-[11px] font-medium px-3 py-1 rounded-full border cursor-pointer transition-all","flex items-center gap-[5px]",l?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:[t.value!=="all"&&e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:l?"var(--color-text-inverse)":Re[t.value]}}),t.label,e.jsx("span",{className:"text-[10px] font-mono opacity-70",children:oe[t.value]??0})]},t.value)}),M.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-[18px] bg-border-divider mx-1"}),e.jsx("span",{className:"text-[10px] font-semibold text-text-quaternary uppercase tracking-[0.06em]",children:"Category"}),e.jsx("button",{type:"button",onClick:()=>s("all"),className:["text-[11px] font-medium px-2 py-[3px] rounded-full border cursor-pointer transition-all",n==="all"?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:"All"}),M.map(t=>{const l=n===t,b=ee[t]??"#A09D97";return e.jsxs("button",{type:"button",onClick:()=>s(l?"all":t),className:["text-[11px] font-medium px-[10px] py-[3px] rounded-full border cursor-pointer transition-all","flex items-center gap-[5px]",l?"border-transparent text-white":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),style:l?{background:b}:void 0,children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:l?"var(--color-text-inverse)":b}}),t.charAt(0).toUpperCase()+t.slice(1),e.jsx("span",{className:"text-[10px] font-mono opacity-70",children:ae[t]??0})]},t)})]}),W.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-[18px] bg-border-divider mx-1"}),e.jsx("span",{className:"text-[10px] font-semibold text-text-quaternary uppercase tracking-[0.06em]",children:e.jsx(Z,{size:10,strokeWidth:2,className:"inline-block mr-[2px] align-middle"})}),W.map(t=>{const l=d===t;return e.jsx("button",{type:"button",onClick:()=>g(l?"all":t),className:["text-[10px] font-medium px-2 py-[2px] rounded-[4px] border cursor-pointer transition-all",l?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border-divider hover:border-text-tertiary hover:text-text-primary"].join(" "),children:t},t)})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex items-center gap-1",children:K.filter(t=>!t.alwaysVisible).map(t=>{const l=L.has(t.key);return e.jsxs("button",{type:"button",onClick:()=>re(t.key),className:["text-[10px] font-medium px-[6px] py-[3px] rounded-[4px] border cursor-pointer transition-all","flex items-center gap-[3px]",l?"bg-bg-secondary text-text-quaternary border-border-divider opacity-50":"bg-bg-card text-text-tertiary border-border hover:text-text-primary"].join(" "),title:`${l?"Show":"Hide"} ${t.label} column`,children:[l?e.jsx(Ee,{size:9,strokeWidth:2}):e.jsx(Ae,{size:9,strokeWidth:2}),t.label]},t.key)})}),e.jsx("div",{className:"w-px h-[18px] bg-border-divider"}),e.jsxs("button",{type:"button",onClick:()=>V("timestamp"),className:"text-[11px] font-medium px-[10px] py-1 rounded-[6px] border border-border bg-bg-card text-text-tertiary cursor-pointer font-sans transition-all hover:border-text-tertiary hover:text-text-primary flex items-center gap-1",children:[e.jsx(Q,{size:12,strokeWidth:2,className:k==="asc"?"rotate-180 transition-transform":"transition-transform"}),k==="desc"?"Newest":"Oldest"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{children:T.map(t=>{const b={id:"id",type:"type",category:"category",added:"timestamp"}[t.key];return e.jsx(He,{width:t.width,active:b?w===b:!1,onClick:b?()=>V(b):void 0,children:t.label},t.key)})})}),e.jsxs("tbody",{children:[a&&e.jsx("tr",{children:T.map(t=>{const l="var(--color-tint-planning)",b="rgba(145,120,181,0.3)";return t.key==="id"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsx("span",{className:"font-mono text-[11px] font-semibold",style:{color:"var(--color-status-planning)"},children:"NEW"})},t.key):t.key==="type"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsxs("select",{value:x,onChange:j=>C(j.target.value),className:"px-2 py-1 rounded-[6px] border border-border bg-bg-card text-[11px] text-text-primary font-sans outline-none cursor-pointer",children:[e.jsx("option",{value:"bug",children:"bug"}),e.jsx("option",{value:"pattern",children:"pattern"}),e.jsx("option",{value:"decision",children:"decision"}),e.jsx("option",{value:"rule",children:"rule"}),e.jsx("option",{value:"debug",children:"debug"}),e.jsx("option",{value:"test",children:"test"}),e.jsx("option",{value:"review",children:"review"}),e.jsx("option",{value:"validation",children:"validation"}),e.jsx("option",{value:"general",children:"general"})]})},t.key):t.key==="content"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsx("input",{type:"text",value:E,onChange:j=>D(j.target.value),placeholder:"Describe the entry...",autoFocus:!0,onKeyDown:j=>{j.key==="Enter"&&P(),j.key==="Escape"&&i(!1)},className:"w-full px-[10px] py-[6px] rounded-[6px] border border-border bg-bg-card text-[13px] text-text-primary font-sans outline-none focus:border-[#9178B5] transition-colors"})},t.key):t.key==="actions"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",onClick:()=>void P(),className:"px-3 py-[5px] rounded-[6px] border-none bg-text-primary text-white text-[11px] font-semibold cursor-pointer font-sans hover:bg-[#1A1816] transition-all",children:"Save"}),e.jsx("button",{type:"button",onClick:()=>i(!1),className:"px-3 py-[5px] rounded-[6px] border-none bg-bg-secondary text-text-secondary text-[11px] font-semibold cursor-pointer font-sans hover:bg-bg-tertiary transition-all",children:"Cancel"})]})},t.key):e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top font-mono text-[11px] text-text-tertiary",style:{background:l,borderBottomColor:b},children:"—"},t.key)})}),$.map((t,l)=>e.jsx(Ue,{entry:t,selected:u===t.id,onClick:()=>h(t.id),onDelete:ne,index:l,visibleColumns:T},t.id)),$.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:T.length,className:"text-center py-12 text-[13px] text-text-tertiary",children:"No entries found"})})]})]})})]})}function He({children:r,width:c,active:o,onClick:n}){return e.jsxs("th",{style:{width:c?`${c}px`:void 0},onClick:n,className:["sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.06em] px-3 py-2","bg-bg-secondary border-b border-border select-none whitespace-nowrap",n?"cursor-pointer":"",o?"text-text-primary":"text-text-tertiary hover:text-text-primary"].join(" "),children:[r,o&&e.jsx(Q,{size:10,strokeWidth:2,className:"inline-block align-middle ml-[3px]"})]})}function Ue({entry:r,selected:c,onClick:o,onDelete:n,index:s,visibleColumns:d}){const g=Pe[r.type]??Oe,f=ee[r.category]??"#A09D97",u={id:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.id}),type:e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase font-mono tracking-[0.04em] whitespace-nowrap inline-block",style:{background:g.bg,color:g.text},children:r.type}),category:e.jsx("span",{className:"text-[10px] font-semibold px-[7px] py-[2px] rounded-[4px] uppercase font-mono tracking-[0.04em] whitespace-nowrap inline-block",style:{background:`${f}15`,color:f},children:r.category||"general"}),content:e.jsx("span",{className:"text-[13px] text-text-primary font-medium leading-[1.5] max-w-[500px] block",children:r.content||r.title}),keywords:e.jsxs("div",{className:"flex flex-wrap gap-[3px]",children:[r.keywords.slice(0,3).map(h=>e.jsx("span",{className:"text-[9px] px-[5px] py-[1px] rounded-[3px] bg-bg-secondary text-text-tertiary font-mono whitespace-nowrap",children:h},h)),r.keywords.length>3&&e.jsxs("span",{className:"text-[9px] text-text-quaternary font-mono",children:["+",r.keywords.length-3]})]}),file:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.file?r.file.split("/").pop():""}),added:e.jsx("span",{className:"font-mono text-[11px] text-text-quaternary whitespace-nowrap",children:Ke(r.timestamp)}),actions:e.jsxs("div",{className:"flex gap-[2px] whitespace-nowrap",children:[e.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),o()},className:"w-7 h-7 rounded-[6px] border-none bg-transparent cursor-pointer text-text-quaternary flex items-center justify-center transition-all opacity-0 group-hover:opacity-100 hover:bg-bg-hover hover:text-text-primary",children:e.jsx(X,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",onClick:h=>n(h,r.id),className:"w-7 h-7 rounded-[6px] border-none bg-transparent cursor-pointer text-text-quaternary flex items-center justify-center transition-all opacity-0 group-hover:opacity-100 hover:bg-[rgba(196,101,85,0.08)] hover:text-[#C46555]",children:e.jsx(J,{size:14,strokeWidth:1.8})})]})};return e.jsx(z.tr,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15,delay:Math.min(s*.02,.3)},onClick:o,className:["cursor-pointer transition-colors group",c?"[&>td]:bg-tint-planning":"hover:[&>td]:bg-bg-hover"].join(" "),children:d.map(h=>e.jsx("td",{className:"px-3 py-[10px] border-b border-border-divider align-top",children:u[h.key]},h.key))})}const Ye={coding:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},arch:{bg:"var(--color-tint-planning)",text:"#9178B5"},quality:{bg:"var(--color-tint-completed)",text:"#5A9E78"},debug:{bg:"rgba(196,101,85,0.10)",text:"#B85B4A"},test:{bg:"rgba(90,158,120,0.10)",text:"#3D8B5F"},review:{bg:"rgba(219,176,108,0.12)",text:"#C4A055"},learning:{bg:"var(--color-tint-blocked)",text:"#C46555"},bug:{bg:"var(--color-tint-blocked)",text:"#C46555"},pattern:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},decision:{bg:"var(--color-tint-planning)",text:"#9178B5"},rule:{bg:"var(--color-tint-completed)",text:"#5A9E78"},validation:{bg:"rgba(91,141,184,0.10)",text:"#4A7DA8"},general:{bg:"var(--color-tint-pending)",text:"#A09D97"}},Je={bg:"var(--color-tint-pending)",text:"#A09D97"};function Xe(r){if(!r)return"--";const c=new Date(r);if(isNaN(c.getTime()))return"--";const n=Date.now()-c.getTime(),s=Math.floor(n/6e4);if(s<1)return"now";if(s<60)return`${s}m ago`;const d=Math.floor(s/60);if(d<24)return`${d}h ago`;const g=Math.floor(d/24);return g<7?`${g}d ago`:c.toLocaleDateString()}function Qe({entry:r,onClose:c}){const o=y(g=>g.deleteEntry),n=p.useMemo(()=>Ye[r.type]??Je,[r.type]),s=p.useMemo(()=>r.file?r.file.split("/").pop():"",[r.file]);function d(){o(r.id),c()}return e.jsxs(z.aside,{initial:{width:0,opacity:0},animate:{width:380,opacity:1},exit:{width:0,opacity:0},transition:{type:"spring",stiffness:400,damping:30},className:"shrink-0 border-l border-border bg-bg-primary overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-divider shrink-0 min-h-[48px]",children:[e.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:"Entry Detail"}),e.jsx("button",{type:"button",onClick:c,"aria-label":"Close detail panel",className:"w-7 h-7 rounded-[8px] border-none bg-transparent cursor-pointer text-text-tertiary flex items-center justify-center hover:bg-bg-hover hover:text-text-primary transition-colors",children:e.jsx(ce,{size:14,strokeWidth:2})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4",style:{width:380},children:[e.jsx("span",{className:"inline-flex items-center gap-[5px] text-[10px] font-bold px-[10px] py-[3px] rounded-[6px] mb-3 uppercase tracking-[0.04em]",style:{background:n.bg,color:n.text},children:r.type}),e.jsx("div",{className:"text-[16px] font-bold text-text-primary leading-[1.5] mb-4",children:r.title||r.content}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-4",children:[e.jsx(_,{label:"ID",value:r.id,mono:!0}),e.jsx(_,{label:"Added",value:Xe(r.timestamp),mono:!0}),e.jsx(_,{label:"File",value:s||"--",mono:!0}),e.jsx(_,{label:"Type",value:r.type})]}),r.content&&r.title&&r.content!==r.title&&e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.06em] text-text-quaternary mb-[6px]",children:"Description"}),e.jsx("div",{className:"text-[13px] text-text-secondary leading-[1.6] whitespace-pre-wrap",children:r.content})]}),e.jsxs("div",{className:"flex gap-2 pt-3 border-t border-border-divider",children:[e.jsxs("button",{type:"button",className:"flex-1 py-2 rounded-[8px] border border-text-primary bg-text-primary text-[12px] font-semibold text-white cursor-pointer font-sans flex items-center justify-center gap-[6px] hover:bg-[#1A1816] transition-all",children:[e.jsx(X,{size:13,strokeWidth:2}),"Edit"]}),e.jsxs("button",{type:"button",onClick:d,className:"flex-1 py-2 rounded-[8px] border border-border bg-bg-card text-[12px] font-semibold text-text-secondary cursor-pointer font-sans flex items-center justify-center gap-[6px] hover:border-[#C46555] hover:text-[#C46555] hover:bg-[rgba(196,101,85,0.08)] transition-all",children:[e.jsx(J,{size:13,strokeWidth:2}),"Delete"]})]})]})]})}function _({label:r,value:c,mono:o}){return e.jsxs("div",{className:"px-3 py-2 bg-bg-secondary rounded-[8px]",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.04em] text-text-quaternary mb-[2px]",children:r}),e.jsx("div",{className:["text-[13px] font-semibold text-text-primary",o?"font-mono text-[12px]":""].join(" "),children:c})]})}const Ze=[{value:"bug",label:"Bug",activeBg:"var(--color-tint-blocked)",activeText:"#C46555",activeBorder:"#C46555"},{value:"pattern",label:"Pattern",activeBg:"var(--color-tint-exploring)",activeText:"#5B8DB8",activeBorder:"#5B8DB8"},{value:"decision",label:"Decision",activeBg:"var(--color-tint-planning)",activeText:"#9178B5",activeBorder:"#9178B5"},{value:"rule",label:"Rule",activeBg:"var(--color-tint-completed)",activeText:"#5A9E78",activeBorder:"#5A9E78"},{value:"debug",label:"Debug",activeBg:"rgba(196,101,85,0.10)",activeText:"#B85B4A",activeBorder:"#B85B4A"},{value:"test",label:"Test",activeBg:"rgba(90,158,120,0.10)",activeText:"#3D8B5F",activeBorder:"#3D8B5F"},{value:"review",label:"Review",activeBg:"rgba(219,176,108,0.12)",activeText:"#C4A055",activeBorder:"#C4A055"},{value:"validation",label:"Validation",activeBg:"rgba(91,141,184,0.10)",activeText:"#4A7DA8",activeBorder:"#4A7DA8"}];function et({open:r,onOpenChange:c}){const o=y(m=>m.addEntry),n=y(m=>m.files),[s,d]=p.useState("bug"),[g,f]=p.useState(""),[u,h]=p.useState(""),[v,N]=p.useState(!1);p.useEffect(()=>{r||(d("bug"),f(""),h(""))},[r]),p.useEffect(()=>{n.length>0&&!u&&h(n[0].path)},[n,u]);const w=p.useCallback(async()=>{g.trim()&&(N(!0),await o(s,g.trim(),u),N(!1),c(!1))},[s,g,u,o,c]);return e.jsx(de,{open:r,onOpenChange:c,children:e.jsxs(xe,{children:[e.jsx(pe,{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(be,{className:A("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[480px] max-w-[95vw] max-h-[80vh]","rounded-[16px] border border-border bg-bg-card shadow-lg","flex flex-col overflow-hidden","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-divider shrink-0",children:[e.jsx(ue,{className:"text-[16px] font-bold text-text-primary",children:"New Spec Entry"}),e.jsx(O,{className:A("w-7 h-7 flex items-center justify-center rounded-[8px]","text-text-tertiary hover:text-text-primary hover:bg-bg-hover","transition-colors border-none bg-transparent cursor-pointer"),"aria-label":"Close",children:e.jsxs("svg",{className:"w-[14px] h-[14px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-[11px] font-semibold text-text-tertiary uppercase tracking-[0.04em] mb-[6px]",children:"Type"}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Ze.map(m=>{const k=s===m.value;return e.jsx("button",{type:"button",onClick:()=>d(m.value),className:A("py-[10px] rounded-[10px] border-[1.5px] bg-bg-card cursor-pointer","text-center text-[11px] font-semibold font-sans transition-all"),style:k?{borderColor:m.activeBorder,color:m.activeText,background:m.activeBg,fontWeight:700}:{borderColor:"var(--color-border, #E8E5DE)",color:"var(--color-text-tertiary, #A09D97)"},children:m.label},m.value)})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-[11px] font-semibold text-text-tertiary uppercase tracking-[0.04em] mb-[6px]",children:"Content"}),e.jsx("textarea",{value:g,onChange:m=>f(m.target.value),placeholder:"Describe the bug, pattern, decision, or rule...",rows:5,className:A("w-full min-h-[120px] px-[14px] py-[10px] rounded-[8px]","border border-border bg-bg-primary text-[13px] text-text-primary","font-sans leading-[1.6] resize-y outline-none","focus:border-[#9178B5] transition-colors","placeholder:text-text-quaternary")}),e.jsx("div",{className:"text-[11px] text-text-quaternary mt-1",children:"Supports markdown. Will be timestamped automatically."})]}),n.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-[11px] font-semibold text-text-tertiary uppercase tracking-[0.04em] mb-[6px]",children:"Target File"}),e.jsx("select",{value:u,onChange:m=>h(m.target.value),className:A("w-full px-3 py-2 rounded-[8px] border border-border","bg-bg-primary text-[12px] text-text-primary font-sans","outline-none cursor-pointer","focus:border-[#9178B5] transition-colors"),children:n.map(m=>e.jsxs("option",{value:m.path,children:[m.name," (",m.category,")"]},m.path))})]}),u&&e.jsxs("div",{className:"bg-bg-primary rounded-[10px] px-4 py-[14px] border border-border-divider",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.06em] text-text-quaternary mb-2",children:"Will write to"}),e.jsxs("div",{className:"flex items-center gap-[6px] px-[10px] py-[6px] rounded-[6px] bg-bg-card border border-border-divider text-[11px] font-mono text-text-secondary",children:[e.jsx(U,{size:12,strokeWidth:1.8,className:"text-text-tertiary"}),e.jsx("span",{className:"text-text-primary font-semibold",children:u})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-4 border-t border-border-divider shrink-0",children:[e.jsx(O,{className:A("px-4 py-2 rounded-[8px] border border-border bg-bg-card","text-[12px] font-semibold text-text-secondary cursor-pointer font-sans","hover:border-text-tertiary hover:text-text-primary transition-all"),children:"Cancel"}),e.jsxs("button",{type:"button",disabled:!g.trim()||v,onClick:()=>void w(),className:A("flex items-center gap-[6px] px-[14px] py-2 rounded-[8px] border-none","bg-text-primary text-white text-[12px] font-semibold cursor-pointer font-sans","hover:bg-[#1A1816] hover:-translate-y-px hover:shadow-md transition-all","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-none"),children:[e.jsx(we,{size:14,strokeWidth:2}),v?"Adding...":"Add Entry"]})]})]})]})})}const tt=[{label:"Kanban",icon:e.jsx(ye,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Table",icon:e.jsx(fe,{size:14,strokeWidth:1.8}),shortcut:"2"}],G=["kanban","table"];function bt(){const{activeView:r,setActiveView:c,fetchEntries:o,fetchFiles:n,entries:s,search:d,setSearch:g,selectedEntry:f,setSelectedEntry:u,loading:h,error:v}=y(ge(i=>({activeView:i.activeView,setActiveView:i.setActiveView,fetchEntries:i.fetchEntries,fetchFiles:i.fetchFiles,entries:i.entries,search:i.search,setSearch:i.setSearch,selectedEntry:i.selectedEntry,setSelectedEntry:i.setSelectedEntry,loading:i.loading,error:i.error}))),[N,w]=p.useState(!1),{register:m,unregister:k}=p.useContext(me),B=p.useCallback(i=>c(G[i]),[c]);p.useEffect(()=>{m({items:tt.map(i=>({label:i.label,icon:i.icon,shortcut:i.shortcut})),activeIndex:G.indexOf(r),onSwitch:B})},[r,m,B]),p.useEffect(()=>()=>k(),[k]),p.useEffect(()=>{function i(x){x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement||(x.key==="1"?c("kanban"):x.key==="2"&&c("table"))}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[c]),p.useEffect(()=>{o(),n()},[o,n]);const a=f?s.find(i=>i.id===f)??null:null;return h&&s.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading specs..."}):v&&s.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-status-failed text-[length:var(--font-size-sm)]",children:"Failed to load specs"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:v}),e.jsx("button",{type:"button",onClick:()=>void o(),className:"px-3 py-1 rounded-[var(--radius-md)] border border-border bg-bg-card text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all",children:"Retry"})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[10px] px-5 py-[10px] border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"text-[16px] font-bold text-text-primary",children:"Specs"}),e.jsxs("span",{className:"text-[11px] text-text-tertiary font-mono tabular-nums",children:[s.length," entries"]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-[6px] px-3 py-[5px] rounded-[8px] bg-bg-card w-[240px] focus-within:border-[#9178B5] transition-colors",style:{border:"var(--style-btn-secondary-border)"},children:[e.jsx(he,{size:13,strokeWidth:2,className:"text-text-quaternary shrink-0"}),e.jsx("input",{type:"text",placeholder:"Search specs...",value:d,onChange:i=>g(i.target.value),className:"border-none bg-transparent outline-none text-[12px] text-text-primary font-sans w-full placeholder:text-text-quaternary"})]}),e.jsxs("button",{type:"button",onClick:()=>w(!0),className:"flex items-center gap-[6px] px-[14px] py-[6px] rounded-[8px] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer font-sans hover:bg-[#1A1816] hover:[transform:var(--style-card-hover-transform)] hover:[box-shadow:var(--style-card-hover-shadow)] transition-all",children:[e.jsx(H,{size:14,strokeWidth:2}),"New Entry"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[r==="kanban"&&e.jsx("div",{className:"flex-1 flex flex-col overflow-hidden motion-safe:animate-[view-fade-in_250ms_ease-out_both]",children:e.jsx($e,{onAddEntry:()=>w(!0)})}),r==="table"&&e.jsx("div",{className:"flex-1 flex flex-col overflow-hidden motion-safe:animate-[view-fade-in_250ms_ease-out_both]",children:e.jsx(Ge,{})})]}),a&&e.jsx(Qe,{entry:a,onClose:()=>u(null)})]}),e.jsx(et,{open:N,onOpenChange:w})]})}export{bt as SpecsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as e,p as se,a8 as re,M as ae,aa as g,X as M,ab as Q,ac as Y,F as R,k as U,s as ne,V as ie,n as oe}from"./index-uIqUCT8y.js";import{L as le}from"./list-BTRAIvDq.js";import{S as ce}from"./search-DVtgy2W7.js";import{C as de}from"./chevron-right-BXySK2fn.js";import{T as xe}from"./trash-2-52LATVfW.js";import{P as B,T as I,R as pe,A as q,S as me}from"./team-types-BPeOvVdA.js";import{A as J}from"./arrow-left-NCUOENvg.js";import{U as W}from"./users-DLFE2voE.js";import{L as ue}from"./loader-NHtB6Mdn.js";import{u as he,f as fe,L as H,m as T}from"./proxy-Dtx5p6IO.js";import{A as O}from"./index-DIoMBMbv.js";const be=t=>!t.isLayoutDirty&&t.willUpdate(!1);function G(){const t=new Set,s=new WeakMap,r=()=>t.forEach(be);return{add:i=>{t.add(i),s.set(i,i.addEventListener("willUpdate",r))},remove:i=>{t.delete(i);const a=s.get(i);a&&(a(),s.delete(i)),r()},dirty:r}}const ge=c.createContext(null);function ye(){const t=c.useRef(!1);return he(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function ve(){const t=ye(),[s,r]=c.useState(0),i=c.useCallback(()=>{t.current&&r(s+1)},[s]);return[c.useCallback(()=>fe.postRender(i),[i]),s]}const Z=t=>t===!0,je=t=>Z(t===!0)||t==="id",Ne=({children:t,id:s,inherit:r=!0})=>{const i=c.useContext(H),a=c.useContext(ge),[f,h]=ve(),x=c.useRef(null),m=i.id||a;x.current===null&&(je(r)&&m&&(s=s?m+"-"+s:m),x.current={id:s,group:Z(r)&&i.group||G()});const u=c.useMemo(()=>({...x.current,forceRender:f}),[h]);return e.jsx(H.Provider,{value:u,children:t})},we={Coordinate:"#4A90D9",Lifecycle:"#8B6BBF",QA:"#3D9B6F",Review:"#D4832E",Testing:"#3BA0B5","Frontend Debug":"#D05454","Perf Opt":"#C99B2D","Tech Debt":"#A09D97","Plan & Execute":"#4A90D9",Brainstorm:"#8B6BBF","Roadmap Dev":"#3D9B6F",Issue:"#D05454","Iter Dev":"#D4832E","Ultra Analyze":"#C99B2D","UX Improve":"#3BA0B5","UI Design":"#8B6BBF","Arch Opt":"#4A90D9",Team:"#A09D97"},ke={Coordinate:"TC",Lifecycle:"LV",QA:"QA",Review:"RV",Testing:"TST","Frontend Debug":"FD","Perf Opt":"PO","Tech Debt":"TD","Plan & Execute":"PX",Brainstorm:"BS","Roadmap Dev":"RD",Issue:"IS","Iter Dev":"ID","Ultra Analyze":"UA","UX Improve":"UX","UI Design":"UI","Arch Opt":"AO",Team:"TM"},X=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function Se({status:t}){const s=I[t];return e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${s}18`,color:s},children:[t==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:s}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:s}})]}),t.charAt(0).toUpperCase()+t.slice(1)]})}function Ce({session:t,onClick:s,onDelete:r}){const i=we[t.skill]??"#A09D97",a=ke[t.skill]??"TM";return e.jsxs("button",{type:"button",onClick:s,className:"group w-full text-left bg-bg-card border border-border rounded-xl p-3.5 hover:border-accent-blue hover:shadow-[0_2px_12px_rgba(0,0,0,0.06)] transition-all duration-150 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[11px] font-bold text-white shrink-0",style:{backgroundColor:i},children:a}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder truncate",children:t.sessionId})]}),e.jsx(Se,{status:t.status}),r&&e.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),r(t.sessionId)},className:"w-6 h-6 rounded-md flex items-center justify-center text-text-placeholder opacity-0 group-hover:opacity-100 hover:!text-status-failed hover:bg-[rgba(196,101,85,0.1)] transition-all shrink-0",title:"Delete session",children:e.jsx(xe,{size:13,strokeWidth:2})})]}),t.description&&e.jsx("p",{className:"text-[11px] text-text-secondary leading-relaxed mb-2.5 line-clamp-2",children:t.description}),t.pipelineStages.length>0&&e.jsx("div",{className:"flex gap-1 mb-2.5",children:t.pipelineStages.map(f=>e.jsx("div",{className:"w-2 h-2 rounded-full",title:`${f.name}: ${f.status}`,style:{backgroundColor:B[f.status]}},f.id))}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-tertiary mb-2.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(se,{size:11,strokeWidth:2}),t.taskProgress.completed,"/",t.taskProgress.total," tasks"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(re,{size:11,strokeWidth:2}),t.duration||"--"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(ae,{size:11,strokeWidth:2}),t.messageCount," msgs"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 pt-2 border-t border-border-divider",children:[e.jsxs("div",{className:"flex gap-0.5",children:[t.roles.slice(0,4).map((f,h)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:f,style:{backgroundColor:X[h%X.length]},children:f.charAt(0).toUpperCase()},f)),t.roles.length>4&&e.jsxs("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-semibold text-text-tertiary bg-bg-hover",children:["+",t.roles.length-4]})]}),e.jsx("div",{className:"flex-1"}),e.jsx(de,{size:14,className:"text-text-placeholder group-hover:text-accent-blue transition-colors"})]})]})}const Ae=["all","active","completed","failed","archived"];function Le({viewMode:t}){const s=g(n=>n.sessions),r=g(n=>n.filteredSessions),i=g(n=>n.statusFilter),a=g(n=>n.skillFilter),f=g(n=>n.searchQuery),h=g(n=>n.setStatusFilter),x=g(n=>n.setSkillFilter),m=g(n=>n.setSearchQuery),u=g(n=>n.fetchSessionDetail),o=g(n=>n.deleteSession),b=r(),w=c.useMemo(()=>{const n=s.filter(C=>C.status==="active").length,p=s.filter(C=>C.status==="completed").length,j=s.reduce((C,E)=>C+E.roles.length,0);return{total:s.length,active:n,completed:p,totalRoles:j}},[s]),k=c.useMemo(()=>{const n=new Set(s.map(p=>p.skill));return Array.from(n).sort()},[s]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 border-b border-border shrink-0",children:[e.jsx("span",{className:"text-[14px] font-semibold text-text-primary",children:"Sessions"}),e.jsx("span",{className:"text-[11px] font-medium text-text-tertiary bg-bg-hover px-1.5 py-0.5 rounded-full",children:b.length}),e.jsxs("div",{className:"relative ml-2",children:[e.jsx(ce,{size:13,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-placeholder"}),e.jsx("input",{type:"text",placeholder:"Search sessions...",value:f,onChange:n=>m(n.target.value),className:"pl-7 pr-2.5 py-1 rounded-lg border border-border bg-bg-secondary text-[12px] text-text-primary placeholder:text-text-placeholder w-48 focus:outline-none focus:border-accent-blue transition-colors"})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex gap-1",children:Ae.map(n=>e.jsx("button",{type:"button",onClick:()=>h(n),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",i===n?"bg-text-primary text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:n==="all"?"All":n.charAt(0).toUpperCase()+n.slice(1)},n))}),k.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-border-divider"}),e.jsx("div",{className:"flex gap-1",children:k.map(n=>e.jsx("button",{type:"button",onClick:()=>x(a===n?null:n),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",a===n?"bg-accent-blue text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:n},n))})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3 mb-4",children:[e.jsx(F,{label:"Total Sessions",value:w.total,sub:`across ${k.length} skill types`}),e.jsx(F,{label:"Active",value:w.active,color:I.active,sub:"running now"}),e.jsx(F,{label:"Completed",value:w.completed,color:I.completed,sub:"finished"}),e.jsx(F,{label:"Total Roles",value:w.totalRoles,sub:`avg ${w.total?(w.totalRoles/w.total).toFixed(1):0} per session`})]}),b.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-text-tertiary",children:[e.jsx("span",{className:"text-[14px] font-medium mb-1",children:"No sessions found"}),e.jsx("span",{className:"text-[12px]",children:s.length===0?"Run a team skill to see sessions here":"Try adjusting your filters"})]}),t==="cards"&&b.length>0&&e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:b.map(n=>e.jsx(Ce,{session:n,onClick:()=>void u(n.sessionId),onDelete:p=>void o(p)},n.sessionId))}),t==="table"&&b.length>0&&e.jsx(De,{sessions:b,onSelect:n=>void u(n)})]})]})}function F({label:t,value:s,color:r,sub:i}){return e.jsxs("div",{className:"bg-bg-card rounded-xl border border-border px-4 py-3",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:t}),e.jsx("div",{className:"text-[22px] font-bold",style:{color:r??"var(--color-text-primary)"},children:s}),e.jsx("div",{className:"text-[11px] text-text-tertiary mt-0.5",children:i})]})}const V=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function De({sessions:t,onSelect:s}){return e.jsx("div",{className:"bg-bg-card rounded-xl border border-border overflow-hidden",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Session"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Status"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Progress"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Roles"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Duration"}),e.jsx("th",{className:"w-8 bg-bg-secondary border-b border-border sticky top-0 z-[5]"})]})}),e.jsx("tbody",{children:t.map(r=>{const i=r.taskProgress.total?Math.round(r.taskProgress.completed/r.taskProgress.total*100):0,a=I[r.status];return e.jsxs("tr",{onClick:()=>s(r.sessionId),className:"cursor-pointer hover:bg-bg-hover transition-colors group",children:[e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("div",{className:"flex items-center gap-2.5 min-w-[240px]",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:r.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder",children:r.sessionId})]})})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${a}18`,color:a},children:r.status})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-[120px]",children:[e.jsx("div",{className:"flex-1 h-[5px] bg-bg-hover rounded-full overflow-hidden min-w-[60px]",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${i}%`,backgroundColor:a}})}),e.jsxs("span",{className:"text-[11px] font-semibold text-text-tertiary whitespace-nowrap min-w-[36px]",children:[r.taskProgress.completed,"/",r.taskProgress.total]})]})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("div",{className:"flex gap-0.5",children:r.roles.slice(0,5).map((f,h)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:f,style:{backgroundColor:V[h%V.length]},children:f.charAt(0).toUpperCase()},f))})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.duration||"--"})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider text-center",children:e.jsx("span",{className:"text-[14px] text-text-placeholder group-hover:text-accent-blue transition-colors",children:"→"})})]},r.sessionId)})})]})})}function ee({session:t,open:s,onClose:r}){const i=c.useCallback(a=>{a.target===a.currentTarget&&r()},[r]);return e.jsx(e.Fragment,{children:e.jsx("div",{className:["absolute inset-0 z-40 bg-black/[.18] backdrop-blur-[2px] transition-opacity duration-200",s?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"].join(" "),onClick:i,children:e.jsxs("div",{className:["absolute top-0 left-0 right-0 z-50 bg-bg-card border-b border-border","rounded-b-[14px] shadow-[0_12px_40px_rgba(0,0,0,0.12)]","transition-transform duration-[280ms] ease-[cubic-bezier(0.34,1.56,0.64,1)]","max-h-[68vh] overflow-hidden flex flex-col",s?"translate-y-0":"-translate-y-full"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-divider shrink-0",children:[e.jsx("h3",{className:"text-[14px] font-bold text-text-primary",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:r,className:"w-[26px] h-[26px] rounded-[7px] flex items-center justify-center text-text-tertiary hover:bg-bg-hover hover:text-text-primary transition-all",children:e.jsx(M,{size:14})})]}),e.jsxs("div",{className:"grid grid-cols-3 flex-1 overflow-auto",children:[e.jsxs("div",{className:"p-3.5",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Pipeline",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.pipelineStages.length})]}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx(_,{label:"Done",value:t.pipelineStages.filter(a=>a.status==="done").length}),e.jsx(_,{label:"Active",value:t.pipelineStages.filter(a=>a.status==="in_progress").length}),e.jsx(_,{label:"Pending",value:t.pipelineStages.filter(a=>a.status==="pending").length})]}),t.pipeline.waves.length>0?e.jsx(Te,{waves:t.pipeline.waves}):e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:t.pipelineStages.map(a=>e.jsx(Be,{node:a},a.id))})]}),e.jsxs("div",{className:"p-3.5 border-l border-border-divider",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Roles",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.roleDetails.length})]}),e.jsxs("div",{className:"flex flex-col",children:[t.roleDetails.map(a=>e.jsx(Ie,{role:a},a.name)),t.roleDetails.length===0&&e.jsx("span",{className:"text-[11px] text-text-tertiary italic",children:"No roles data"})]})]}),e.jsxs("div",{className:"p-3.5 border-l border-border-divider",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Messages",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.messages.length})]}),e.jsxs("div",{className:"flex flex-col max-h-[50vh] overflow-y-auto",children:[t.messages.slice(-20).map(a=>e.jsx(Re,{message:a},a.id)),t.messages.length===0&&e.jsx("span",{className:"text-[11px] text-text-tertiary italic",children:"No messages"})]})]})]}),e.jsx("div",{className:"flex justify-center py-1.5 border-t border-border-divider cursor-pointer hover:bg-bg-hover",children:e.jsx("div",{className:"w-10 h-1 rounded-full bg-text-placeholder"})})]})})})}const N={nodeW:100,nodeH:26,rowGap:6,padX:12,padY:8,arrowLen:36};function Te({waves:t}){const s=c.useMemo(()=>{const x=[...t].sort((n,p)=>n.number-p.number),m=new Map,u=[];let o=N.padX;for(const n of x){u.push(o);let p=N.padY;for(const j of n.nodes)m.set(j.id,{x:o,y:p,wave:n.number}),p+=N.nodeH+N.rowGap;o+=N.nodeW+N.arrowLen}const b=Math.max(...x.map(n=>n.nodes.length),1),w=x.length*(N.nodeW+N.arrowLen)-N.arrowLen+N.padX*2,k=b*(N.nodeH+N.rowGap)-N.rowGap+N.padY*2;return{sorted:x,positions:m,waveXPositions:u,svgW:w,svgH:k}},[t]),{sorted:r,positions:i,waveXPositions:a,svgW:f,svgH:h}=s;return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("svg",{width:f,height:h,viewBox:`0 0 ${f} ${h}`,className:"block",children:[e.jsx("defs",{children:e.jsx("marker",{id:"dag-arrow",markerWidth:"6",markerHeight:"4",refX:"5",refY:"2",orient:"auto",children:e.jsx("path",{d:"M0,0 L6,2 L0,4",fill:"var(--color-text-placeholder)"})})}),r.map((x,m)=>{if(m===0)return null;const u=r[m-1],o=a[m-1],b=a[m],w=[];for(const k of u.nodes){const n=i.get(k.id),p=o+N.nodeW,j=n.y+N.nodeH/2;for(const C of x.nodes){const E=i.get(C.id),D=b,L=E.y+N.nodeH/2;w.push(e.jsx("line",{x1:p+2,y1:j,x2:D-2,y2:L,stroke:"var(--color-text-placeholder)",strokeWidth:"1",strokeOpacity:"0.4",markerEnd:"url(#dag-arrow)"},`${k.id}-${C.id}`))}}return e.jsx("g",{children:w},`arrows-${x.number}`)}),r.map(x=>x.nodes.map(m=>{const u=i.get(m.id),o=B[m.status];return e.jsxs("g",{children:[e.jsx("rect",{x:u.x,y:u.y,width:N.nodeW,height:N.nodeH,rx:6,fill:"var(--color-bg-hover)",stroke:o,strokeWidth:m.status==="in_progress"?1.5:.5,strokeOpacity:m.status==="in_progress"?1:.4}),e.jsx("circle",{cx:u.x+10,cy:u.y+N.nodeH/2,r:3,fill:o}),e.jsx("text",{x:u.x+18,y:u.y+N.nodeH/2,dominantBaseline:"central",fill:"var(--color-text-primary)",fontSize:"9",fontWeight:"600",fontFamily:"inherit",children:Ee(m.name,10)})]},m.id)})),r.map((x,m)=>e.jsxs("text",{x:a[m]+N.nodeW/2,y:h-1,textAnchor:"middle",fill:"var(--color-text-placeholder)",fontSize:"8",fontWeight:"600",children:["W",x.number]},`wave-label-${x.number}`))]})})}function Ee(t,s){return t.length<=s?t:t.slice(0,s-1)+"…"}function _({label:t,value:s}){return e.jsxs("div",{className:"flex-1 text-center p-1.5 bg-bg-hover rounded-lg",children:[e.jsx("div",{className:"text-[16px] font-bold text-text-primary",children:s}),e.jsx("div",{className:"text-[9px] font-semibold uppercase text-text-tertiary",children:t})]})}function Be({node:t}){const s=B[t.status];return e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg border border-border text-[10px] mb-1 hover:border-accent-blue transition-colors",children:[e.jsx("span",{className:"w-[7px] h-[7px] rounded-full",style:{backgroundColor:s}}),e.jsx("span",{className:"font-semibold text-text-primary",children:t.name})]})}function Ie({role:t}){const s=pe[t.status];return e.jsxs("div",{className:"flex items-center gap-2 py-1.5 border-b border-border-divider last:border-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[10px] font-bold text-white shrink-0",style:{backgroundColor:s},children:t.prefix||t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[12px] font-semibold text-text-primary truncate",children:t.name}),e.jsxs("div",{className:"text-[10px] text-text-tertiary",children:[t.taskCount," task",t.taskCount!==1?"s":""]})]}),e.jsxs("div",{className:"flex gap-1 shrink-0",children:[e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${s}18`,color:s},children:t.status}),t.injected&&e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full bg-[#8B6BBF18] text-[#8B6BBF]",children:"injected"})]})]})}function Re({message:t}){const r={message:"#4A90D9",state_update:"#3D9B6F",task_complete:"#5A9E78",error:"#D05454",broadcast:"#8B6BBF",shutdown:"#A09D97"}[t.type]??"#A09D97";return e.jsxs("div",{className:"flex gap-2 py-1.5 border-b border-border-divider last:border-0 text-[11px] items-start",children:[e.jsx("div",{className:"w-[22px] h-[22px] rounded-md flex items-center justify-center text-[10px] shrink-0 mt-0.5",style:{background:`${r}18`,color:r},children:t.from.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-primary",children:t.from}),e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${r}18`,color:r},children:t.type}),e.jsx("span",{className:"text-[9px] font-mono text-text-placeholder ml-auto",children:t.ts.substring(11,19)})]}),e.jsx("div",{className:"text-[11px] text-text-secondary truncate mt-0.5",children:t.summary})]})]})}function Oe(){const t=g(l=>l.activeSession),s=g(l=>l.activeSessionId),r=g(l=>l.loading),i=g(l=>l.clearActiveSession),[a,f]=c.useState(!1),[h,x]=c.useState(null),[m,u]=c.useState(""),[o,b]=c.useState(!1),[w,k]=c.useState([]),[n,p]=c.useState(new Set);c.useEffect(()=>{function l(y){y.key==="Escape"&&(a?f(!1):i())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i,a]);const j=c.useCallback(async l=>{if(s){x(l),b(!0),k(y=>y.some(v=>v.id===l.id)?y:[...y,l]);try{const y=`${Q.SESSIONS}/${s}/files/${encodeURIComponent(l.path)}`,v=await fetch(y);if(!v.ok)throw new Error(`Failed: ${v.status}`);if((v.headers.get("content-type")??"").includes("json")){const S=await v.json();u(JSON.stringify(S,null,2))}else u(await v.text())}catch{u("// Failed to load file content")}b(!1)}},[s]),C=c.useCallback(l=>{k(y=>{const v=y.filter(d=>d.id!==l);return(h==null?void 0:h.id)===l&&(v.length>0?j(v[v.length-1]):(x(null),u(""))),v})},[h,j]),E=c.useCallback(l=>{p(y=>{const v=new Set(y);return v.has(l)?v.delete(l):v.add(l),v})},[]);if(r||!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading session..."});const D=I[t.status],L=new Map;for(const l of t.files){const y=l.category;L.has(y)||L.set(y,[]),L.get(y).push(l)}const z={artifacts:"Artifacts","role-specs":"Role Specs",session:"Session",wisdom:"Wisdom","message-bus":"Message Bus"};return e.jsxs("div",{className:"-m-[var(--spacing-4)] max-sm:-m-[var(--spacing-2)] flex flex-col h-[calc(100%+var(--spacing-4)*2)] max-sm:h-[calc(100%+var(--spacing-2)*2)] overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2 border-b border-border shrink-0 bg-bg-secondary",children:[e.jsx("button",{type:"button",onClick:i,className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-all",title:"Back to sessions",children:e.jsx(J,{size:15,strokeWidth:2})}),e.jsx("span",{className:"text-[14px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${D}18`,color:D},children:[t.status==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:D}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:D}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>f(!0),className:"ml-2 px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(W,{size:12}),"Team Status"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("aside",{className:"w-[240px] border-r border-border bg-bg-secondary flex flex-col shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-primary",children:"Session Explorer"}),e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${D}18`,color:D},children:t.status})]}),e.jsxs("div",{className:"px-3 py-2 border-b border-border-divider",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2",children:"Pipeline DAG"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.pipelineStages.map((l,y)=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:B[l.status]}}),e.jsx("span",{className:["text-[10px] flex-1 truncate",l.status==="in_progress"?"font-semibold text-text-primary":"text-text-secondary",l.status==="pending"?"opacity-50":""].join(" "),children:l.name}),e.jsx("span",{className:"text-[8px] font-semibold px-1 rounded-full",style:{background:`${B[l.status]}18`,color:B[l.status]},children:l.status==="done"?"Done":l.status==="in_progress"?"Run":"Wait"})]}),y<t.pipelineStages.length-1&&e.jsx("div",{className:"w-px h-2 bg-border-divider ml-[3.5px]"})]},l.id)),t.pipelineStages.length===0&&e.jsx("span",{className:"text-[10px] text-text-tertiary italic",children:"No pipeline data"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[Array.from(L.entries()).map(([l,y])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>E(l),className:"flex items-center gap-1 px-1.5 py-1 w-full text-left text-[9px] font-semibold uppercase tracking-widest text-text-placeholder hover:text-text-primary transition-colors",children:[e.jsx(Y,{size:10,className:["transition-transform",n.has(l)?"-rotate-90":""].join(" ")}),z[l]??l,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:y.length})]}),!n.has(l)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(v=>e.jsxs("button",{type:"button",onClick:()=>void j(v),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(h==null?void 0:h.id)===v.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(R,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:v.name})]},v.id))})]},l)),t.files.length===0&&e.jsx("div",{className:"px-3 py-4 text-[11px] text-text-tertiary italic text-center",children:"No files found"})]})]}),e.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden bg-bg-primary",children:[w.length>0&&e.jsx("div",{className:"flex items-center border-b border-border bg-bg-secondary shrink-0 overflow-x-auto",children:w.map(l=>e.jsxs("div",{className:["flex items-center gap-1.5 px-3 py-1.5 text-[11px] cursor-pointer border-r border-border-divider shrink-0",(h==null?void 0:h.id)===l.id?"bg-bg-primary text-text-primary font-medium":"text-text-tertiary hover:text-text-secondary hover:bg-bg-hover"].join(" "),children:[e.jsx("button",{type:"button",onClick:()=>void j(l),className:"truncate max-w-[140px]",children:l.name}),e.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),C(l.id)},className:"w-4 h-4 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:10})})]},l.id))}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[o&&e.jsx("div",{className:"text-[12px] text-text-tertiary",children:"Loading file..."}),!o&&!h&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(R,{size:32,className:"opacity-30"}),e.jsx("span",{className:"text-[13px] font-medium",children:"Select a file to view"}),e.jsx("span",{className:"text-[11px]",children:"Choose from the sidebar or click Team Status for an overview"})]}),!o&&h&&e.jsx("div",{className:"font-mono text-[12px] leading-relaxed text-text-primary whitespace-pre-wrap break-words",children:m})]})]})]}),e.jsx(ee,{session:t,open:a,onClose:()=>f(!1)})]})}function ze(){const[t,s]=c.useState(!1);return c.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)");s(r.matches);const i=a=>s(a.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),t}const Fe={idle:"Idle",active:"Active",busy:"Busy",error:"Error",offline:"Offline"},$e=new Set(["active","busy"]);function Pe({status:t,role:s}){const r=ze(),i=q[t],a=$e.has(t);return e.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[e.jsxs(T.div,{className:"relative flex items-center justify-center w-[14px] h-[14px]",animate:a&&!r?{scale:[1,1.05,1],opacity:[1,.85,1]}:{scale:1,opacity:1},transition:r?{duration:0}:{duration:2,repeat:1/0,ease:"easeInOut"},children:[a&&!r&&e.jsx("div",{className:"absolute inset-0 rounded-full",style:{backgroundColor:`${i}20`,boxShadow:`0 0 6px ${i}30`}}),e.jsx("div",{className:a&&!r?"pulse-dot":void 0,style:{width:7,height:7,borderRadius:"50%",backgroundColor:i,animation:a&&!r?"pulse-dot 1.5s ease-in-out infinite":"none",willChange:a?"transform, opacity":"auto"}})]}),e.jsxs("div",{className:"flex items-center gap-1 overflow-hidden",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-primary",children:s}),e.jsx(O,{mode:"wait",children:e.jsx(T.span,{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full whitespace-nowrap",style:{background:`${i}18`,color:i},initial:r?!1:{opacity:0,y:6,scale:.9},animate:{opacity:1,y:0,scale:1},exit:r?void 0:{opacity:0,y:-6,scale:.9},transition:r?{duration:0}:{duration:.2,ease:"easeOut"},children:Fe[t]},t)})]})]})}function Me(t){switch(t.type){case"user_message":return{text:t.content,kind:"user"};case"assistant_message":return t.content?{text:t.content,kind:"assistant"}:null;case"thinking":return{text:t.content,kind:"system"};case"error":return{text:t.message,kind:"system"};case"tool_use":return{text:`${t.name}(${JSON.stringify(t.input).slice(0,60)})`,kind:"system"};case"file_change":return{text:`[${t.action}] ${t.path}`,kind:"system"};case"command_exec":return{text:`$ ${t.command}`,kind:"system"};case"status_change":return{text:`Status: ${t.status}`,kind:"system"};default:return null}}function _e(t){const s=new Date(t);return isNaN(s.getTime())?"":s.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function We({role:t,sessionId:s,status:r}){const[i,a]=c.useState(""),f=c.useRef(null),h=c.useRef(null),x=g(p=>p.getProcessIdForRole(s,t)),m=U(p=>x?p.entries[x]??[]:[]),u=U(p=>x?p.processStreaming[x]??!1:!1),o=c.useMemo(()=>{const p=[];for(const j of m){const C=Me(j);C&&p.push({entry:j,display:C})}return p},[m]);c.useEffect(()=>{const p=f.current;p&&(p.scrollTop=p.scrollHeight)},[o.length]);const b=c.useCallback(()=>{var j;const p=i.trim();p&&(ne({action:"team:message",sessionId:s,to:t,content:p}),a(""),(j=h.current)==null||j.focus())},[i,s,t]),w=c.useCallback(p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),b()),p.key==="Escape"&&a("")},[b]),k=q[r],n=!!x;return e.jsxs("div",{className:"flex flex-col rounded-xl border bg-bg-primary overflow-hidden",style:{borderColor:`${k}40`},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider bg-bg-secondary shrink-0",children:[e.jsx(Pe,{status:r,role:t}),e.jsx("div",{className:"flex-1"}),u&&e.jsx(ue,{size:12,className:"text-text-tertiary animate-spin"})]}),e.jsxs("div",{ref:f,className:"flex-1 overflow-y-auto p-3 min-h-[160px] max-h-[400px] flex flex-col gap-1.5",children:[!n&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[11px] italic",children:"Connecting..."}),n&&o.length===0&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[11px] italic",children:"Waiting for activity..."}),e.jsx(O,{initial:!1,children:o.map(({entry:p,display:j})=>e.jsx(T.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.15,ease:"easeOut"},className:["text-[11px] leading-relaxed px-2 py-1 rounded-md max-w-[95%]",j.kind==="user"?"self-end bg-accent-muted text-text-primary":j.kind==="assistant"?"self-start bg-bg-secondary text-text-primary":"self-start bg-bg-hover text-text-tertiary font-mono text-[10px]"].join(" "),children:e.jsxs("div",{className:"flex items-start gap-1.5",children:[e.jsx("span",{className:"text-text-placeholder text-[9px] shrink-0 mt-0.5",children:_e(p.timestamp)}),e.jsx("span",{className:"break-words whitespace-pre-wrap",children:j.text})]})},p.id))})]}),e.jsxs("div",{className:"flex items-end gap-2 px-3 py-2 border-t border-border-divider bg-bg-secondary shrink-0",children:[e.jsx("textarea",{ref:h,value:i,onChange:p=>a(p.target.value),onKeyDown:w,placeholder:`Message ${t}...`,rows:1,className:"flex-1 resize-none rounded-lg border border-border bg-bg-primary px-2.5 py-1.5 text-[11px] text-text-primary placeholder:text-text-placeholder focus:outline-none focus:border-accent-muted transition-colors","aria-label":`Send message to ${t}`}),e.jsx("button",{type:"button",onClick:b,disabled:!i.trim(),className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover disabled:opacity-30 disabled:cursor-not-allowed transition-all shrink-0",title:`Send to ${t}`,"aria-label":`Send message to ${t}`,children:e.jsx(me,{size:13,strokeWidth:2})})]})]})}const $=[{key:"initialization",label:"Init"},{key:"planning",label:"Planning"},{key:"execution",label:"Execution"},{key:"review",label:"Review"},{key:"completion",label:"Complete"}],P={initialization:"#4A90D9",planning:"#8B6BBF",execution:"#B89540",review:"#3D9B6F",completion:"#5A9E78"};function Ue(){const[t,s]=c.useState(!1);return c.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)");s(r.matches);const i=a=>s(a.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),t}function He(){const t=g(x=>x.phaseState),s=Ue(),r=(t==null?void 0:t.current)??null,i=(t==null?void 0:t.fixAttempts)??0,a=3,f=r?$.findIndex(x=>x.key===r):-1,h=s?0:.3;return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-1",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder",children:"Phase"}),r&&e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${P[r]}18`,color:P[r]},children:r})]}),e.jsx(Ne,{children:e.jsx("div",{className:"flex items-center px-4 py-2",children:$.map((x,m)=>{const u=x.key===r,o=f>m,b=P[x.key];return e.jsxs("div",{className:"flex items-center",children:[e.jsxs(T.div,{layout:!0,className:"flex flex-col items-center gap-1",transition:{duration:h,ease:"easeOut"},children:[e.jsxs(T.div,{layout:!0,className:"flex items-center justify-center rounded-full",style:{backgroundColor:o||u?b:"var(--color-bg-hover)",...u?{boxShadow:`0 0 0 2px var(--color-bg-primary), 0 0 0 4px ${b}, 0 0 12px ${b}40`}:{}},animate:{width:u?28:20,height:u?28:20},transition:{duration:h,ease:"easeOut"},children:[o&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),u&&!s&&e.jsx(T.div,{className:"rounded-full bg-white",animate:{scale:[1,1.2,1],opacity:[1,.7,1]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{width:8,height:8}}),u&&s&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-white"})]}),e.jsx("span",{className:["text-[9px] font-semibold whitespace-nowrap transition-colors",u?"text-text-primary":o?"text-text-secondary":"text-text-placeholder"].join(" "),children:x.label}),x.key==="review"&&i>0&&e.jsxs("span",{className:"text-[7px] font-bold px-1 py-px rounded-full",style:{background:"#C4655518",color:"#C46555"},children:[i,"/",a]})]}),m<$.length-1&&e.jsxs("div",{className:"relative h-[2px] mx-1 min-w-[20px] flex-1",children:[e.jsx("div",{className:"absolute inset-0 rounded-full",style:{backgroundColor:"var(--color-bg-hover)"}}),e.jsx(T.div,{className:"absolute inset-y-0 left-0 rounded-full",initial:{width:"0%"},animate:{width:o?"100%":"0%"},transition:{duration:s?0:.5,ease:"easeOut"},style:{backgroundColor:P[$[m+1].key]}})]})]},x.key)})})})]})}function Ge(){const t=g(d=>d.activeSession),s=g(d=>d.activeSessionId),r=g(d=>d.loading),i=g(d=>d.clearActiveSession),a=g(d=>d.agentStatuses),f=g(d=>d.phaseState),[h,x]=c.useState(!1),[m,u]=c.useState(!1),[o,b]=c.useState(null),[w,k]=c.useState(""),[n,p]=c.useState(!1),[j,C]=c.useState(new Set);c.useEffect(()=>{function d(S){S.target instanceof HTMLTextAreaElement||S.target instanceof HTMLInputElement||S.key==="Escape"&&(h?x(!1):m?u(!1):i())}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[i,h,m]);const E=c.useCallback(async d=>{if(s){b(d),p(!0),u(!0);try{const S=`${Q.SESSIONS}/${s}/files/${encodeURIComponent(d.path)}`,A=await fetch(S);if(!A.ok)throw new Error(`Failed: ${A.status}`);if((A.headers.get("content-type")??"").includes("json")){const te=await A.json();k(JSON.stringify(te,null,2))}else k(await A.text())}catch{k("// Failed to load file content")}p(!1)}},[s]),D=c.useCallback(d=>{C(S=>{const A=new Set(S);return A.has(d)?A.delete(d):A.add(d),A})},[]);if(r||!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading session..."});const L=I[t.status],z=new Map;for(const d of a)z.set(d.role,d.status);const l=t.roleDetails.map(d=>d.name),y=new Map;for(const d of t.files){const S=d.category;y.has(S)||y.set(S,[]),y.get(S).push(d)}const v={artifacts:"Artifacts","role-specs":"Role Specs",session:"Session",wisdom:"Wisdom","message-bus":"Message Bus"};return e.jsxs("div",{className:"-m-[var(--spacing-4)] max-sm:-m-[var(--spacing-2)] flex flex-col h-[calc(100%+var(--spacing-4)*2)] max-sm:h-[calc(100%+var(--spacing-2)*2)] overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2 border-b border-border shrink-0 bg-bg-secondary",children:[e.jsx("button",{type:"button",onClick:i,className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-all",title:"Back to sessions",children:e.jsx(J,{size:15,strokeWidth:2})}),e.jsx("span",{className:"text-[14px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),f&&e.jsx("div",{className:"hidden sm:flex items-center gap-1.5 mr-2",children:e.jsx(He,{})}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${L}18`,color:L},children:[e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:L}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:L}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>u(d=>!d),className:"ml-1 px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(R,{size:12}),"Files"]}),e.jsxs("button",{type:"button",onClick:()=>x(!0),className:"px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(W,{size:12}),"Status"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[e.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:e.jsx(O,{children:l.map(d=>e.jsx(T.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2,ease:"easeOut"},children:e.jsx(We,{role:d,sessionId:t.sessionId,status:z.get(d)??"idle"})},d))})}),l.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(W,{size:32,className:"opacity-30"}),e.jsx("span",{className:"text-[13px] font-medium",children:"No agent roles"}),e.jsx("span",{className:"text-[11px]",children:"Waiting for agents to join the session..."})]})]}),e.jsx(O,{children:m&&e.jsxs(T.aside,{initial:{width:0,opacity:0},animate:{width:260,opacity:1},exit:{width:0,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"border-l border-border bg-bg-secondary flex flex-col shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-primary flex-1",children:"Files"}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"w-5 h-5 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:11})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[Array.from(y.entries()).map(([d,S])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>D(d),className:"flex items-center gap-1 px-1.5 py-1 w-full text-left text-[9px] font-semibold uppercase tracking-widest text-text-placeholder hover:text-text-primary transition-colors",children:[e.jsx(Y,{size:10,className:["transition-transform",j.has(d)?"-rotate-90":""].join(" ")}),v[d]??d,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:S.length})]}),!j.has(d)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:S.map(A=>e.jsxs("button",{type:"button",onClick:()=>void E(A),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(o==null?void 0:o.id)===A.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(R,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:A.name})]},A.id))})]},d)),t.files.length===0&&e.jsx("div",{className:"px-3 py-4 text-[11px] text-text-tertiary italic text-center",children:"No files found"})]}),o&&e.jsxs("div",{className:"border-t border-border-divider flex flex-col max-h-[40%]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-bg-primary shrink-0",children:[e.jsx(R,{size:11,className:"text-text-placeholder"}),e.jsx("span",{className:"text-[10px] font-medium text-text-primary truncate",children:o.name}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:()=>{b(null),k("")},className:"w-4 h-4 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:9})})]}),e.jsx("div",{className:"flex-1 overflow-auto p-2",children:n?e.jsx("div",{className:"text-[10px] text-text-tertiary",children:"Loading..."}):e.jsx("pre",{className:"font-mono text-[10px] leading-relaxed text-text-secondary whitespace-pre-wrap break-words",children:w})})]})]})})]}),e.jsx(ee,{session:t,open:h,onClose:()=>x(!1)})]})}const Xe=[{label:"Cards",icon:e.jsx(oe,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Table",icon:e.jsx(le,{size:14,strokeWidth:1.8}),shortcut:"2"}],K=["cards","table"],Ve={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function it(){const t=g(o=>o.activeView),s=g(o=>o.setActiveView),r=g(o=>o.activeSessionId),i=g(o=>o.activeSession),a=g(o=>o.fetchSessions),f=g(o=>o.loading),h=g(o=>o.error),{register:x,unregister:m}=c.useContext(ie),u=c.useCallback(o=>s(K[o]),[s]);return c.useEffect(()=>{r?m():x({items:Xe.map(o=>({label:o.label,icon:o.icon,shortcut:o.shortcut})),activeIndex:K.indexOf(t),onSwitch:u})},[t,r,x,m,u]),c.useEffect(()=>()=>m(),[m]),c.useEffect(()=>{function o(b){b.target instanceof HTMLInputElement||b.target instanceof HTMLTextAreaElement||r||(b.key==="1"?s("cards"):b.key==="2"&&s("table"))}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s,r]),c.useEffect(()=>{a()},[a]),f&&!r?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading team sessions..."}):h&&!r?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-status-failed text-[length:var(--font-size-sm)]",children:"Failed to load team sessions"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:h}),e.jsx("button",{type:"button",onClick:()=>void a(),className:"px-3 py-1 rounded-[var(--radius-md)] text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},children:"Retry"})]}):r?(i==null?void 0:i.status)==="active"?e.jsx(Ge,{}):e.jsx(Oe,{}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsx(O,{mode:"wait",children:e.jsx(T.div,{className:"flex-1 flex flex-col overflow-hidden",variants:Ve,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(Le,{viewMode:t})},t)})})}export{it as TeamsPage};
|
|
1
|
+
import{r as c,j as e,p as se,a8 as re,M as ae,aa as g,X as M,ab as Q,ac as Y,F as R,k as U,s as ne,V as ie,n as oe}from"./index-DpcPd-UG.js";import{L as le}from"./list-BMv8pIQn.js";import{S as ce}from"./search-pe7pU1YN.js";import{C as de}from"./chevron-right-DvZ5sMOg.js";import{T as xe}from"./trash-2-Xen46iNQ.js";import{P as B,T as I,R as pe,A as q,S as me}from"./team-types-C_HqX2p2.js";import{A as J}from"./arrow-left-DYvgSdIH.js";import{U as W}from"./users-BLueDPxF.js";import{L as ue}from"./loader-DdM4VOgF.js";import{u as he,f as fe,L as H,m as T}from"./proxy-DOffTzwA.js";import{A as O}from"./index-BxR_3IbJ.js";const be=t=>!t.isLayoutDirty&&t.willUpdate(!1);function G(){const t=new Set,s=new WeakMap,r=()=>t.forEach(be);return{add:i=>{t.add(i),s.set(i,i.addEventListener("willUpdate",r))},remove:i=>{t.delete(i);const a=s.get(i);a&&(a(),s.delete(i)),r()},dirty:r}}const ge=c.createContext(null);function ye(){const t=c.useRef(!1);return he(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function ve(){const t=ye(),[s,r]=c.useState(0),i=c.useCallback(()=>{t.current&&r(s+1)},[s]);return[c.useCallback(()=>fe.postRender(i),[i]),s]}const Z=t=>t===!0,je=t=>Z(t===!0)||t==="id",Ne=({children:t,id:s,inherit:r=!0})=>{const i=c.useContext(H),a=c.useContext(ge),[f,h]=ve(),x=c.useRef(null),m=i.id||a;x.current===null&&(je(r)&&m&&(s=s?m+"-"+s:m),x.current={id:s,group:Z(r)&&i.group||G()});const u=c.useMemo(()=>({...x.current,forceRender:f}),[h]);return e.jsx(H.Provider,{value:u,children:t})},we={Coordinate:"#4A90D9",Lifecycle:"#8B6BBF",QA:"#3D9B6F",Review:"#D4832E",Testing:"#3BA0B5","Frontend Debug":"#D05454","Perf Opt":"#C99B2D","Tech Debt":"#A09D97","Plan & Execute":"#4A90D9",Brainstorm:"#8B6BBF","Roadmap Dev":"#3D9B6F",Issue:"#D05454","Iter Dev":"#D4832E","Ultra Analyze":"#C99B2D","UX Improve":"#3BA0B5","UI Design":"#8B6BBF","Arch Opt":"#4A90D9",Team:"#A09D97"},ke={Coordinate:"TC",Lifecycle:"LV",QA:"QA",Review:"RV",Testing:"TST","Frontend Debug":"FD","Perf Opt":"PO","Tech Debt":"TD","Plan & Execute":"PX",Brainstorm:"BS","Roadmap Dev":"RD",Issue:"IS","Iter Dev":"ID","Ultra Analyze":"UA","UX Improve":"UX","UI Design":"UI","Arch Opt":"AO",Team:"TM"},X=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function Se({status:t}){const s=I[t];return e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${s}18`,color:s},children:[t==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:s}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:s}})]}),t.charAt(0).toUpperCase()+t.slice(1)]})}function Ce({session:t,onClick:s,onDelete:r}){const i=we[t.skill]??"#A09D97",a=ke[t.skill]??"TM";return e.jsxs("button",{type:"button",onClick:s,className:"group w-full text-left bg-bg-card border border-border rounded-xl p-3.5 hover:border-accent-blue hover:shadow-[0_2px_12px_rgba(0,0,0,0.06)] transition-all duration-150 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[11px] font-bold text-white shrink-0",style:{backgroundColor:i},children:a}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder truncate",children:t.sessionId})]}),e.jsx(Se,{status:t.status}),r&&e.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),r(t.sessionId)},className:"w-6 h-6 rounded-md flex items-center justify-center text-text-placeholder opacity-0 group-hover:opacity-100 hover:!text-status-failed hover:bg-[rgba(196,101,85,0.1)] transition-all shrink-0",title:"Delete session",children:e.jsx(xe,{size:13,strokeWidth:2})})]}),t.description&&e.jsx("p",{className:"text-[11px] text-text-secondary leading-relaxed mb-2.5 line-clamp-2",children:t.description}),t.pipelineStages.length>0&&e.jsx("div",{className:"flex gap-1 mb-2.5",children:t.pipelineStages.map(f=>e.jsx("div",{className:"w-2 h-2 rounded-full",title:`${f.name}: ${f.status}`,style:{backgroundColor:B[f.status]}},f.id))}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-tertiary mb-2.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(se,{size:11,strokeWidth:2}),t.taskProgress.completed,"/",t.taskProgress.total," tasks"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(re,{size:11,strokeWidth:2}),t.duration||"--"]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(ae,{size:11,strokeWidth:2}),t.messageCount," msgs"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 pt-2 border-t border-border-divider",children:[e.jsxs("div",{className:"flex gap-0.5",children:[t.roles.slice(0,4).map((f,h)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:f,style:{backgroundColor:X[h%X.length]},children:f.charAt(0).toUpperCase()},f)),t.roles.length>4&&e.jsxs("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-semibold text-text-tertiary bg-bg-hover",children:["+",t.roles.length-4]})]}),e.jsx("div",{className:"flex-1"}),e.jsx(de,{size:14,className:"text-text-placeholder group-hover:text-accent-blue transition-colors"})]})]})}const Ae=["all","active","completed","failed","archived"];function Le({viewMode:t}){const s=g(n=>n.sessions),r=g(n=>n.filteredSessions),i=g(n=>n.statusFilter),a=g(n=>n.skillFilter),f=g(n=>n.searchQuery),h=g(n=>n.setStatusFilter),x=g(n=>n.setSkillFilter),m=g(n=>n.setSearchQuery),u=g(n=>n.fetchSessionDetail),o=g(n=>n.deleteSession),b=r(),w=c.useMemo(()=>{const n=s.filter(C=>C.status==="active").length,p=s.filter(C=>C.status==="completed").length,j=s.reduce((C,E)=>C+E.roles.length,0);return{total:s.length,active:n,completed:p,totalRoles:j}},[s]),k=c.useMemo(()=>{const n=new Set(s.map(p=>p.skill));return Array.from(n).sort()},[s]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 border-b border-border shrink-0",children:[e.jsx("span",{className:"text-[14px] font-semibold text-text-primary",children:"Sessions"}),e.jsx("span",{className:"text-[11px] font-medium text-text-tertiary bg-bg-hover px-1.5 py-0.5 rounded-full",children:b.length}),e.jsxs("div",{className:"relative ml-2",children:[e.jsx(ce,{size:13,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-placeholder"}),e.jsx("input",{type:"text",placeholder:"Search sessions...",value:f,onChange:n=>m(n.target.value),className:"pl-7 pr-2.5 py-1 rounded-lg border border-border bg-bg-secondary text-[12px] text-text-primary placeholder:text-text-placeholder w-48 focus:outline-none focus:border-accent-blue transition-colors"})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex gap-1",children:Ae.map(n=>e.jsx("button",{type:"button",onClick:()=>h(n),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",i===n?"bg-text-primary text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:n==="all"?"All":n.charAt(0).toUpperCase()+n.slice(1)},n))}),k.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-border-divider"}),e.jsx("div",{className:"flex gap-1",children:k.map(n=>e.jsx("button",{type:"button",onClick:()=>x(a===n?null:n),className:["px-2 py-0.5 rounded-full text-[10px] font-semibold transition-all",a===n?"bg-accent-blue text-white":"text-text-tertiary hover:text-text-primary hover:bg-bg-hover"].join(" "),children:n},n))})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3 mb-4",children:[e.jsx(F,{label:"Total Sessions",value:w.total,sub:`across ${k.length} skill types`}),e.jsx(F,{label:"Active",value:w.active,color:I.active,sub:"running now"}),e.jsx(F,{label:"Completed",value:w.completed,color:I.completed,sub:"finished"}),e.jsx(F,{label:"Total Roles",value:w.totalRoles,sub:`avg ${w.total?(w.totalRoles/w.total).toFixed(1):0} per session`})]}),b.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-text-tertiary",children:[e.jsx("span",{className:"text-[14px] font-medium mb-1",children:"No sessions found"}),e.jsx("span",{className:"text-[12px]",children:s.length===0?"Run a team skill to see sessions here":"Try adjusting your filters"})]}),t==="cards"&&b.length>0&&e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:b.map(n=>e.jsx(Ce,{session:n,onClick:()=>void u(n.sessionId),onDelete:p=>void o(p)},n.sessionId))}),t==="table"&&b.length>0&&e.jsx(De,{sessions:b,onSelect:n=>void u(n)})]})]})}function F({label:t,value:s,color:r,sub:i}){return e.jsxs("div",{className:"bg-bg-card rounded-xl border border-border px-4 py-3",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:t}),e.jsx("div",{className:"text-[22px] font-bold",style:{color:r??"var(--color-text-primary)"},children:s}),e.jsx("div",{className:"text-[11px] text-text-tertiary mt-0.5",children:i})]})}const V=["#4A90D9","#8B6BBF","#C99B2D","#D05454","#3D9B6F","#D4832E","#3BA0B5"];function De({sessions:t,onSelect:s}){return e.jsx("div",{className:"bg-bg-card rounded-xl border border-border overflow-hidden",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Session"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Status"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Progress"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Roles"}),e.jsx("th",{className:"text-left px-3.5 py-2.5 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary bg-bg-secondary border-b border-border sticky top-0 z-[5]",children:"Duration"}),e.jsx("th",{className:"w-8 bg-bg-secondary border-b border-border sticky top-0 z-[5]"})]})}),e.jsx("tbody",{children:t.map(r=>{const i=r.taskProgress.total?Math.round(r.taskProgress.completed/r.taskProgress.total*100):0,a=I[r.status];return e.jsxs("tr",{onClick:()=>s(r.sessionId),className:"cursor-pointer hover:bg-bg-hover transition-colors group",children:[e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("div",{className:"flex items-center gap-2.5 min-w-[240px]",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-semibold text-text-primary truncate",children:r.title}),e.jsx("div",{className:"text-[10px] font-mono text-text-placeholder",children:r.sessionId})]})})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${a}18`,color:a},children:r.status})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-[120px]",children:[e.jsx("div",{className:"flex-1 h-[5px] bg-bg-hover rounded-full overflow-hidden min-w-[60px]",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${i}%`,backgroundColor:a}})}),e.jsxs("span",{className:"text-[11px] font-semibold text-text-tertiary whitespace-nowrap min-w-[36px]",children:[r.taskProgress.completed,"/",r.taskProgress.total]})]})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("div",{className:"flex gap-0.5",children:r.roles.slice(0,5).map((f,h)=>e.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center text-[8px] font-bold text-white",title:f,style:{backgroundColor:V[h%V.length]},children:f.charAt(0).toUpperCase()},f))})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider",children:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.duration||"--"})}),e.jsx("td",{className:"px-3.5 py-2.5 border-b border-border-divider text-center",children:e.jsx("span",{className:"text-[14px] text-text-placeholder group-hover:text-accent-blue transition-colors",children:"→"})})]},r.sessionId)})})]})})}function ee({session:t,open:s,onClose:r}){const i=c.useCallback(a=>{a.target===a.currentTarget&&r()},[r]);return e.jsx(e.Fragment,{children:e.jsx("div",{className:["absolute inset-0 z-40 bg-black/[.18] backdrop-blur-[2px] transition-opacity duration-200",s?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"].join(" "),onClick:i,children:e.jsxs("div",{className:["absolute top-0 left-0 right-0 z-50 bg-bg-card border-b border-border","rounded-b-[14px] shadow-[0_12px_40px_rgba(0,0,0,0.12)]","transition-transform duration-[280ms] ease-[cubic-bezier(0.34,1.56,0.64,1)]","max-h-[68vh] overflow-hidden flex flex-col",s?"translate-y-0":"-translate-y-full"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-divider shrink-0",children:[e.jsx("h3",{className:"text-[14px] font-bold text-text-primary",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:r,className:"w-[26px] h-[26px] rounded-[7px] flex items-center justify-center text-text-tertiary hover:bg-bg-hover hover:text-text-primary transition-all",children:e.jsx(M,{size:14})})]}),e.jsxs("div",{className:"grid grid-cols-3 flex-1 overflow-auto",children:[e.jsxs("div",{className:"p-3.5",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Pipeline",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.pipelineStages.length})]}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsx(_,{label:"Done",value:t.pipelineStages.filter(a=>a.status==="done").length}),e.jsx(_,{label:"Active",value:t.pipelineStages.filter(a=>a.status==="in_progress").length}),e.jsx(_,{label:"Pending",value:t.pipelineStages.filter(a=>a.status==="pending").length})]}),t.pipeline.waves.length>0?e.jsx(Te,{waves:t.pipeline.waves}):e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:t.pipelineStages.map(a=>e.jsx(Be,{node:a},a.id))})]}),e.jsxs("div",{className:"p-3.5 border-l border-border-divider",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Roles",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.roleDetails.length})]}),e.jsxs("div",{className:"flex flex-col",children:[t.roleDetails.map(a=>e.jsx(Ie,{role:a},a.name)),t.roleDetails.length===0&&e.jsx("span",{className:"text-[11px] text-text-tertiary italic",children:"No roles data"})]})]}),e.jsxs("div",{className:"p-3.5 border-l border-border-divider",children:[e.jsxs("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2.5 flex items-center gap-1.5",children:["Messages",e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary",children:t.messages.length})]}),e.jsxs("div",{className:"flex flex-col max-h-[50vh] overflow-y-auto",children:[t.messages.slice(-20).map(a=>e.jsx(Re,{message:a},a.id)),t.messages.length===0&&e.jsx("span",{className:"text-[11px] text-text-tertiary italic",children:"No messages"})]})]})]}),e.jsx("div",{className:"flex justify-center py-1.5 border-t border-border-divider cursor-pointer hover:bg-bg-hover",children:e.jsx("div",{className:"w-10 h-1 rounded-full bg-text-placeholder"})})]})})})}const N={nodeW:100,nodeH:26,rowGap:6,padX:12,padY:8,arrowLen:36};function Te({waves:t}){const s=c.useMemo(()=>{const x=[...t].sort((n,p)=>n.number-p.number),m=new Map,u=[];let o=N.padX;for(const n of x){u.push(o);let p=N.padY;for(const j of n.nodes)m.set(j.id,{x:o,y:p,wave:n.number}),p+=N.nodeH+N.rowGap;o+=N.nodeW+N.arrowLen}const b=Math.max(...x.map(n=>n.nodes.length),1),w=x.length*(N.nodeW+N.arrowLen)-N.arrowLen+N.padX*2,k=b*(N.nodeH+N.rowGap)-N.rowGap+N.padY*2;return{sorted:x,positions:m,waveXPositions:u,svgW:w,svgH:k}},[t]),{sorted:r,positions:i,waveXPositions:a,svgW:f,svgH:h}=s;return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("svg",{width:f,height:h,viewBox:`0 0 ${f} ${h}`,className:"block",children:[e.jsx("defs",{children:e.jsx("marker",{id:"dag-arrow",markerWidth:"6",markerHeight:"4",refX:"5",refY:"2",orient:"auto",children:e.jsx("path",{d:"M0,0 L6,2 L0,4",fill:"var(--color-text-placeholder)"})})}),r.map((x,m)=>{if(m===0)return null;const u=r[m-1],o=a[m-1],b=a[m],w=[];for(const k of u.nodes){const n=i.get(k.id),p=o+N.nodeW,j=n.y+N.nodeH/2;for(const C of x.nodes){const E=i.get(C.id),D=b,L=E.y+N.nodeH/2;w.push(e.jsx("line",{x1:p+2,y1:j,x2:D-2,y2:L,stroke:"var(--color-text-placeholder)",strokeWidth:"1",strokeOpacity:"0.4",markerEnd:"url(#dag-arrow)"},`${k.id}-${C.id}`))}}return e.jsx("g",{children:w},`arrows-${x.number}`)}),r.map(x=>x.nodes.map(m=>{const u=i.get(m.id),o=B[m.status];return e.jsxs("g",{children:[e.jsx("rect",{x:u.x,y:u.y,width:N.nodeW,height:N.nodeH,rx:6,fill:"var(--color-bg-hover)",stroke:o,strokeWidth:m.status==="in_progress"?1.5:.5,strokeOpacity:m.status==="in_progress"?1:.4}),e.jsx("circle",{cx:u.x+10,cy:u.y+N.nodeH/2,r:3,fill:o}),e.jsx("text",{x:u.x+18,y:u.y+N.nodeH/2,dominantBaseline:"central",fill:"var(--color-text-primary)",fontSize:"9",fontWeight:"600",fontFamily:"inherit",children:Ee(m.name,10)})]},m.id)})),r.map((x,m)=>e.jsxs("text",{x:a[m]+N.nodeW/2,y:h-1,textAnchor:"middle",fill:"var(--color-text-placeholder)",fontSize:"8",fontWeight:"600",children:["W",x.number]},`wave-label-${x.number}`))]})})}function Ee(t,s){return t.length<=s?t:t.slice(0,s-1)+"…"}function _({label:t,value:s}){return e.jsxs("div",{className:"flex-1 text-center p-1.5 bg-bg-hover rounded-lg",children:[e.jsx("div",{className:"text-[16px] font-bold text-text-primary",children:s}),e.jsx("div",{className:"text-[9px] font-semibold uppercase text-text-tertiary",children:t})]})}function Be({node:t}){const s=B[t.status];return e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg border border-border text-[10px] mb-1 hover:border-accent-blue transition-colors",children:[e.jsx("span",{className:"w-[7px] h-[7px] rounded-full",style:{backgroundColor:s}}),e.jsx("span",{className:"font-semibold text-text-primary",children:t.name})]})}function Ie({role:t}){const s=pe[t.status];return e.jsxs("div",{className:"flex items-center gap-2 py-1.5 border-b border-border-divider last:border-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-[10px] font-bold text-white shrink-0",style:{backgroundColor:s},children:t.prefix||t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[12px] font-semibold text-text-primary truncate",children:t.name}),e.jsxs("div",{className:"text-[10px] text-text-tertiary",children:[t.taskCount," task",t.taskCount!==1?"s":""]})]}),e.jsxs("div",{className:"flex gap-1 shrink-0",children:[e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${s}18`,color:s},children:t.status}),t.injected&&e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full bg-[#8B6BBF18] text-[#8B6BBF]",children:"injected"})]})]})}function Re({message:t}){const r={message:"#4A90D9",state_update:"#3D9B6F",task_complete:"#5A9E78",error:"#D05454",broadcast:"#8B6BBF",shutdown:"#A09D97"}[t.type]??"#A09D97";return e.jsxs("div",{className:"flex gap-2 py-1.5 border-b border-border-divider last:border-0 text-[11px] items-start",children:[e.jsx("div",{className:"w-[22px] h-[22px] rounded-md flex items-center justify-center text-[10px] shrink-0 mt-0.5",style:{background:`${r}18`,color:r},children:t.from.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-primary",children:t.from}),e.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${r}18`,color:r},children:t.type}),e.jsx("span",{className:"text-[9px] font-mono text-text-placeholder ml-auto",children:t.ts.substring(11,19)})]}),e.jsx("div",{className:"text-[11px] text-text-secondary truncate mt-0.5",children:t.summary})]})]})}function Oe(){const t=g(l=>l.activeSession),s=g(l=>l.activeSessionId),r=g(l=>l.loading),i=g(l=>l.clearActiveSession),[a,f]=c.useState(!1),[h,x]=c.useState(null),[m,u]=c.useState(""),[o,b]=c.useState(!1),[w,k]=c.useState([]),[n,p]=c.useState(new Set);c.useEffect(()=>{function l(y){y.key==="Escape"&&(a?f(!1):i())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i,a]);const j=c.useCallback(async l=>{if(s){x(l),b(!0),k(y=>y.some(v=>v.id===l.id)?y:[...y,l]);try{const y=`${Q.SESSIONS}/${s}/files/${encodeURIComponent(l.path)}`,v=await fetch(y);if(!v.ok)throw new Error(`Failed: ${v.status}`);if((v.headers.get("content-type")??"").includes("json")){const S=await v.json();u(JSON.stringify(S,null,2))}else u(await v.text())}catch{u("// Failed to load file content")}b(!1)}},[s]),C=c.useCallback(l=>{k(y=>{const v=y.filter(d=>d.id!==l);return(h==null?void 0:h.id)===l&&(v.length>0?j(v[v.length-1]):(x(null),u(""))),v})},[h,j]),E=c.useCallback(l=>{p(y=>{const v=new Set(y);return v.has(l)?v.delete(l):v.add(l),v})},[]);if(r||!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading session..."});const D=I[t.status],L=new Map;for(const l of t.files){const y=l.category;L.has(y)||L.set(y,[]),L.get(y).push(l)}const z={artifacts:"Artifacts","role-specs":"Role Specs",session:"Session",wisdom:"Wisdom","message-bus":"Message Bus"};return e.jsxs("div",{className:"-m-[var(--spacing-4)] max-sm:-m-[var(--spacing-2)] flex flex-col h-[calc(100%+var(--spacing-4)*2)] max-sm:h-[calc(100%+var(--spacing-2)*2)] overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2 border-b border-border shrink-0 bg-bg-secondary",children:[e.jsx("button",{type:"button",onClick:i,className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-all",title:"Back to sessions",children:e.jsx(J,{size:15,strokeWidth:2})}),e.jsx("span",{className:"text-[14px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${D}18`,color:D},children:[t.status==="active"&&e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:D}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:D}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>f(!0),className:"ml-2 px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(W,{size:12}),"Team Status"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("aside",{className:"w-[240px] border-r border-border bg-bg-secondary flex flex-col shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-primary",children:"Session Explorer"}),e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${D}18`,color:D},children:t.status})]}),e.jsxs("div",{className:"px-3 py-2 border-b border-border-divider",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-2",children:"Pipeline DAG"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.pipelineStages.map((l,y)=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:B[l.status]}}),e.jsx("span",{className:["text-[10px] flex-1 truncate",l.status==="in_progress"?"font-semibold text-text-primary":"text-text-secondary",l.status==="pending"?"opacity-50":""].join(" "),children:l.name}),e.jsx("span",{className:"text-[8px] font-semibold px-1 rounded-full",style:{background:`${B[l.status]}18`,color:B[l.status]},children:l.status==="done"?"Done":l.status==="in_progress"?"Run":"Wait"})]}),y<t.pipelineStages.length-1&&e.jsx("div",{className:"w-px h-2 bg-border-divider ml-[3.5px]"})]},l.id)),t.pipelineStages.length===0&&e.jsx("span",{className:"text-[10px] text-text-tertiary italic",children:"No pipeline data"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[Array.from(L.entries()).map(([l,y])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>E(l),className:"flex items-center gap-1 px-1.5 py-1 w-full text-left text-[9px] font-semibold uppercase tracking-widest text-text-placeholder hover:text-text-primary transition-colors",children:[e.jsx(Y,{size:10,className:["transition-transform",n.has(l)?"-rotate-90":""].join(" ")}),z[l]??l,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:y.length})]}),!n.has(l)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(v=>e.jsxs("button",{type:"button",onClick:()=>void j(v),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(h==null?void 0:h.id)===v.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(R,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:v.name})]},v.id))})]},l)),t.files.length===0&&e.jsx("div",{className:"px-3 py-4 text-[11px] text-text-tertiary italic text-center",children:"No files found"})]})]}),e.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden bg-bg-primary",children:[w.length>0&&e.jsx("div",{className:"flex items-center border-b border-border bg-bg-secondary shrink-0 overflow-x-auto",children:w.map(l=>e.jsxs("div",{className:["flex items-center gap-1.5 px-3 py-1.5 text-[11px] cursor-pointer border-r border-border-divider shrink-0",(h==null?void 0:h.id)===l.id?"bg-bg-primary text-text-primary font-medium":"text-text-tertiary hover:text-text-secondary hover:bg-bg-hover"].join(" "),children:[e.jsx("button",{type:"button",onClick:()=>void j(l),className:"truncate max-w-[140px]",children:l.name}),e.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),C(l.id)},className:"w-4 h-4 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:10})})]},l.id))}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[o&&e.jsx("div",{className:"text-[12px] text-text-tertiary",children:"Loading file..."}),!o&&!h&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(R,{size:32,className:"opacity-30"}),e.jsx("span",{className:"text-[13px] font-medium",children:"Select a file to view"}),e.jsx("span",{className:"text-[11px]",children:"Choose from the sidebar or click Team Status for an overview"})]}),!o&&h&&e.jsx("div",{className:"font-mono text-[12px] leading-relaxed text-text-primary whitespace-pre-wrap break-words",children:m})]})]})]}),e.jsx(ee,{session:t,open:a,onClose:()=>f(!1)})]})}function ze(){const[t,s]=c.useState(!1);return c.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)");s(r.matches);const i=a=>s(a.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),t}const Fe={idle:"Idle",active:"Active",busy:"Busy",error:"Error",offline:"Offline"},$e=new Set(["active","busy"]);function Pe({status:t,role:s}){const r=ze(),i=q[t],a=$e.has(t);return e.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[e.jsxs(T.div,{className:"relative flex items-center justify-center w-[14px] h-[14px]",animate:a&&!r?{scale:[1,1.05,1],opacity:[1,.85,1]}:{scale:1,opacity:1},transition:r?{duration:0}:{duration:2,repeat:1/0,ease:"easeInOut"},children:[a&&!r&&e.jsx("div",{className:"absolute inset-0 rounded-full",style:{backgroundColor:`${i}20`,boxShadow:`0 0 6px ${i}30`}}),e.jsx("div",{className:a&&!r?"pulse-dot":void 0,style:{width:7,height:7,borderRadius:"50%",backgroundColor:i,animation:a&&!r?"pulse-dot 1.5s ease-in-out infinite":"none",willChange:a?"transform, opacity":"auto"}})]}),e.jsxs("div",{className:"flex items-center gap-1 overflow-hidden",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-primary",children:s}),e.jsx(O,{mode:"wait",children:e.jsx(T.span,{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-full whitespace-nowrap",style:{background:`${i}18`,color:i},initial:r?!1:{opacity:0,y:6,scale:.9},animate:{opacity:1,y:0,scale:1},exit:r?void 0:{opacity:0,y:-6,scale:.9},transition:r?{duration:0}:{duration:.2,ease:"easeOut"},children:Fe[t]},t)})]})]})}function Me(t){switch(t.type){case"user_message":return{text:t.content,kind:"user"};case"assistant_message":return t.content?{text:t.content,kind:"assistant"}:null;case"thinking":return{text:t.content,kind:"system"};case"error":return{text:t.message,kind:"system"};case"tool_use":return{text:`${t.name}(${JSON.stringify(t.input).slice(0,60)})`,kind:"system"};case"file_change":return{text:`[${t.action}] ${t.path}`,kind:"system"};case"command_exec":return{text:`$ ${t.command}`,kind:"system"};case"status_change":return{text:`Status: ${t.status}`,kind:"system"};default:return null}}function _e(t){const s=new Date(t);return isNaN(s.getTime())?"":s.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function We({role:t,sessionId:s,status:r}){const[i,a]=c.useState(""),f=c.useRef(null),h=c.useRef(null),x=g(p=>p.getProcessIdForRole(s,t)),m=U(p=>x?p.entries[x]??[]:[]),u=U(p=>x?p.processStreaming[x]??!1:!1),o=c.useMemo(()=>{const p=[];for(const j of m){const C=Me(j);C&&p.push({entry:j,display:C})}return p},[m]);c.useEffect(()=>{const p=f.current;p&&(p.scrollTop=p.scrollHeight)},[o.length]);const b=c.useCallback(()=>{var j;const p=i.trim();p&&(ne({action:"team:message",sessionId:s,to:t,content:p}),a(""),(j=h.current)==null||j.focus())},[i,s,t]),w=c.useCallback(p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),b()),p.key==="Escape"&&a("")},[b]),k=q[r],n=!!x;return e.jsxs("div",{className:"flex flex-col rounded-xl border bg-bg-primary overflow-hidden",style:{borderColor:`${k}40`},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider bg-bg-secondary shrink-0",children:[e.jsx(Pe,{status:r,role:t}),e.jsx("div",{className:"flex-1"}),u&&e.jsx(ue,{size:12,className:"text-text-tertiary animate-spin"})]}),e.jsxs("div",{ref:f,className:"flex-1 overflow-y-auto p-3 min-h-[160px] max-h-[400px] flex flex-col gap-1.5",children:[!n&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[11px] italic",children:"Connecting..."}),n&&o.length===0&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[11px] italic",children:"Waiting for activity..."}),e.jsx(O,{initial:!1,children:o.map(({entry:p,display:j})=>e.jsx(T.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.15,ease:"easeOut"},className:["text-[11px] leading-relaxed px-2 py-1 rounded-md max-w-[95%]",j.kind==="user"?"self-end bg-accent-muted text-text-primary":j.kind==="assistant"?"self-start bg-bg-secondary text-text-primary":"self-start bg-bg-hover text-text-tertiary font-mono text-[10px]"].join(" "),children:e.jsxs("div",{className:"flex items-start gap-1.5",children:[e.jsx("span",{className:"text-text-placeholder text-[9px] shrink-0 mt-0.5",children:_e(p.timestamp)}),e.jsx("span",{className:"break-words whitespace-pre-wrap",children:j.text})]})},p.id))})]}),e.jsxs("div",{className:"flex items-end gap-2 px-3 py-2 border-t border-border-divider bg-bg-secondary shrink-0",children:[e.jsx("textarea",{ref:h,value:i,onChange:p=>a(p.target.value),onKeyDown:w,placeholder:`Message ${t}...`,rows:1,className:"flex-1 resize-none rounded-lg border border-border bg-bg-primary px-2.5 py-1.5 text-[11px] text-text-primary placeholder:text-text-placeholder focus:outline-none focus:border-accent-muted transition-colors","aria-label":`Send message to ${t}`}),e.jsx("button",{type:"button",onClick:b,disabled:!i.trim(),className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover disabled:opacity-30 disabled:cursor-not-allowed transition-all shrink-0",title:`Send to ${t}`,"aria-label":`Send message to ${t}`,children:e.jsx(me,{size:13,strokeWidth:2})})]})]})}const $=[{key:"initialization",label:"Init"},{key:"planning",label:"Planning"},{key:"execution",label:"Execution"},{key:"review",label:"Review"},{key:"completion",label:"Complete"}],P={initialization:"#4A90D9",planning:"#8B6BBF",execution:"#B89540",review:"#3D9B6F",completion:"#5A9E78"};function Ue(){const[t,s]=c.useState(!1);return c.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)");s(r.matches);const i=a=>s(a.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[]),t}function He(){const t=g(x=>x.phaseState),s=Ue(),r=(t==null?void 0:t.current)??null,i=(t==null?void 0:t.fixAttempts)??0,a=3,f=r?$.findIndex(x=>x.key===r):-1,h=s?0:.3;return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-1",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder",children:"Phase"}),r&&e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:`${P[r]}18`,color:P[r]},children:r})]}),e.jsx(Ne,{children:e.jsx("div",{className:"flex items-center px-4 py-2",children:$.map((x,m)=>{const u=x.key===r,o=f>m,b=P[x.key];return e.jsxs("div",{className:"flex items-center",children:[e.jsxs(T.div,{layout:!0,className:"flex flex-col items-center gap-1",transition:{duration:h,ease:"easeOut"},children:[e.jsxs(T.div,{layout:!0,className:"flex items-center justify-center rounded-full",style:{backgroundColor:o||u?b:"var(--color-bg-hover)",...u?{boxShadow:`0 0 0 2px var(--color-bg-primary), 0 0 0 4px ${b}, 0 0 12px ${b}40`}:{}},animate:{width:u?28:20,height:u?28:20},transition:{duration:h,ease:"easeOut"},children:[o&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),u&&!s&&e.jsx(T.div,{className:"rounded-full bg-white",animate:{scale:[1,1.2,1],opacity:[1,.7,1]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{width:8,height:8}}),u&&s&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-white"})]}),e.jsx("span",{className:["text-[9px] font-semibold whitespace-nowrap transition-colors",u?"text-text-primary":o?"text-text-secondary":"text-text-placeholder"].join(" "),children:x.label}),x.key==="review"&&i>0&&e.jsxs("span",{className:"text-[7px] font-bold px-1 py-px rounded-full",style:{background:"#C4655518",color:"#C46555"},children:[i,"/",a]})]}),m<$.length-1&&e.jsxs("div",{className:"relative h-[2px] mx-1 min-w-[20px] flex-1",children:[e.jsx("div",{className:"absolute inset-0 rounded-full",style:{backgroundColor:"var(--color-bg-hover)"}}),e.jsx(T.div,{className:"absolute inset-y-0 left-0 rounded-full",initial:{width:"0%"},animate:{width:o?"100%":"0%"},transition:{duration:s?0:.5,ease:"easeOut"},style:{backgroundColor:P[$[m+1].key]}})]})]},x.key)})})})]})}function Ge(){const t=g(d=>d.activeSession),s=g(d=>d.activeSessionId),r=g(d=>d.loading),i=g(d=>d.clearActiveSession),a=g(d=>d.agentStatuses),f=g(d=>d.phaseState),[h,x]=c.useState(!1),[m,u]=c.useState(!1),[o,b]=c.useState(null),[w,k]=c.useState(""),[n,p]=c.useState(!1),[j,C]=c.useState(new Set);c.useEffect(()=>{function d(S){S.target instanceof HTMLTextAreaElement||S.target instanceof HTMLInputElement||S.key==="Escape"&&(h?x(!1):m?u(!1):i())}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[i,h,m]);const E=c.useCallback(async d=>{if(s){b(d),p(!0),u(!0);try{const S=`${Q.SESSIONS}/${s}/files/${encodeURIComponent(d.path)}`,A=await fetch(S);if(!A.ok)throw new Error(`Failed: ${A.status}`);if((A.headers.get("content-type")??"").includes("json")){const te=await A.json();k(JSON.stringify(te,null,2))}else k(await A.text())}catch{k("// Failed to load file content")}p(!1)}},[s]),D=c.useCallback(d=>{C(S=>{const A=new Set(S);return A.has(d)?A.delete(d):A.add(d),A})},[]);if(r||!t)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading session..."});const L=I[t.status],z=new Map;for(const d of a)z.set(d.role,d.status);const l=t.roleDetails.map(d=>d.name),y=new Map;for(const d of t.files){const S=d.category;y.has(S)||y.set(S,[]),y.get(S).push(d)}const v={artifacts:"Artifacts","role-specs":"Role Specs",session:"Session",wisdom:"Wisdom","message-bus":"Message Bus"};return e.jsxs("div",{className:"-m-[var(--spacing-4)] max-sm:-m-[var(--spacing-2)] flex flex-col h-[calc(100%+var(--spacing-4)*2)] max-sm:h-[calc(100%+var(--spacing-2)*2)] overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2 border-b border-border shrink-0 bg-bg-secondary",children:[e.jsx("button",{type:"button",onClick:i,className:"w-7 h-7 rounded-lg flex items-center justify-center text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-all",title:"Back to sessions",children:e.jsx(J,{size:15,strokeWidth:2})}),e.jsx("span",{className:"text-[14px] font-semibold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary",children:t.sessionId}),e.jsx("div",{className:"flex-1"}),f&&e.jsx("div",{className:"hidden sm:flex items-center gap-1.5 mr-2",children:e.jsx(He,{})}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-semibold",style:{background:`${L}18`,color:L},children:[e.jsxs("span",{className:"relative flex w-1.5 h-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:L}}),e.jsx("span",{className:"relative inline-flex rounded-full w-1.5 h-1.5",style:{backgroundColor:L}})]}),t.status]}),e.jsx("span",{className:"text-[11px] font-mono text-text-tertiary",children:t.duration}),e.jsxs("button",{type:"button",onClick:()=>u(d=>!d),className:"ml-1 px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(R,{size:12}),"Files"]}),e.jsxs("button",{type:"button",onClick:()=>x(!0),className:"px-2.5 py-1 rounded-lg bg-bg-hover text-[11px] font-semibold text-text-secondary hover:text-text-primary hover:bg-bg-active transition-all flex items-center gap-1.5",children:[e.jsx(W,{size:12}),"Status"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[e.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:e.jsx(O,{children:l.map(d=>e.jsx(T.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2,ease:"easeOut"},children:e.jsx(We,{role:d,sessionId:t.sessionId,status:z.get(d)??"idle"})},d))})}),l.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary gap-2",children:[e.jsx(W,{size:32,className:"opacity-30"}),e.jsx("span",{className:"text-[13px] font-medium",children:"No agent roles"}),e.jsx("span",{className:"text-[11px]",children:"Waiting for agents to join the session..."})]})]}),e.jsx(O,{children:m&&e.jsxs(T.aside,{initial:{width:0,opacity:0},animate:{width:260,opacity:1},exit:{width:0,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"border-l border-border bg-bg-secondary flex flex-col shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-primary flex-1",children:"Files"}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"w-5 h-5 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:11})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[Array.from(y.entries()).map(([d,S])=>e.jsxs("div",{className:"px-1.5 py-1",children:[e.jsxs("button",{type:"button",onClick:()=>D(d),className:"flex items-center gap-1 px-1.5 py-1 w-full text-left text-[9px] font-semibold uppercase tracking-widest text-text-placeholder hover:text-text-primary transition-colors",children:[e.jsx(Y,{size:10,className:["transition-transform",j.has(d)?"-rotate-90":""].join(" ")}),v[d]??d,e.jsx("span",{className:"ml-auto text-[9px] bg-bg-hover px-1 rounded-full text-text-tertiary",children:S.length})]}),!j.has(d)&&e.jsx("div",{className:"flex flex-col gap-0.5",children:S.map(A=>e.jsxs("button",{type:"button",onClick:()=>void E(A),className:["flex items-center gap-1.5 px-2 py-1 rounded-md text-left text-[11px] w-full transition-all",(o==null?void 0:o.id)===A.id?"bg-bg-active text-text-primary font-medium":"text-text-secondary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:[e.jsx(R,{size:11,className:"text-text-placeholder shrink-0"}),e.jsx("span",{className:"truncate",children:A.name})]},A.id))})]},d)),t.files.length===0&&e.jsx("div",{className:"px-3 py-4 text-[11px] text-text-tertiary italic text-center",children:"No files found"})]}),o&&e.jsxs("div",{className:"border-t border-border-divider flex flex-col max-h-[40%]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-bg-primary shrink-0",children:[e.jsx(R,{size:11,className:"text-text-placeholder"}),e.jsx("span",{className:"text-[10px] font-medium text-text-primary truncate",children:o.name}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:()=>{b(null),k("")},className:"w-4 h-4 rounded flex items-center justify-center text-text-placeholder hover:text-text-primary hover:bg-bg-hover transition-all",children:e.jsx(M,{size:9})})]}),e.jsx("div",{className:"flex-1 overflow-auto p-2",children:n?e.jsx("div",{className:"text-[10px] text-text-tertiary",children:"Loading..."}):e.jsx("pre",{className:"font-mono text-[10px] leading-relaxed text-text-secondary whitespace-pre-wrap break-words",children:w})})]})]})})]}),e.jsx(ee,{session:t,open:h,onClose:()=>x(!1)})]})}const Xe=[{label:"Cards",icon:e.jsx(oe,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Table",icon:e.jsx(le,{size:14,strokeWidth:1.8}),shortcut:"2"}],K=["cards","table"],Ve={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function it(){const t=g(o=>o.activeView),s=g(o=>o.setActiveView),r=g(o=>o.activeSessionId),i=g(o=>o.activeSession),a=g(o=>o.fetchSessions),f=g(o=>o.loading),h=g(o=>o.error),{register:x,unregister:m}=c.useContext(ie),u=c.useCallback(o=>s(K[o]),[s]);return c.useEffect(()=>{r?m():x({items:Xe.map(o=>({label:o.label,icon:o.icon,shortcut:o.shortcut})),activeIndex:K.indexOf(t),onSwitch:u})},[t,r,x,m,u]),c.useEffect(()=>()=>m(),[m]),c.useEffect(()=>{function o(b){b.target instanceof HTMLInputElement||b.target instanceof HTMLTextAreaElement||r||(b.key==="1"?s("cards"):b.key==="2"&&s("table"))}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s,r]),c.useEffect(()=>{a()},[a]),f&&!r?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading team sessions..."}):h&&!r?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-status-failed text-[length:var(--font-size-sm)]",children:"Failed to load team sessions"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:h}),e.jsx("button",{type:"button",onClick:()=>void a(),className:"px-3 py-1 rounded-[var(--radius-md)] text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},children:"Retry"})]}):r?(i==null?void 0:i.status)==="active"?e.jsx(Ge,{}):e.jsx(Oe,{}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsx(O,{mode:"wait",children:e.jsx(T.div,{className:"flex-1 flex flex-col overflow-hidden",variants:Ve,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(Le,{viewMode:t})},t)})})}export{it as TeamsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as m,r as p,j as t,F as v}from"./index-
|
|
1
|
+
import{d as m,r as p,j as t,F as v}from"./index-DpcPd-UG.js";import{S as g}from"./search-pe7pU1YN.js";import{F as b,a as y,D as j}from"./folder-CTj6SNNu.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|