titan-agent 6.5.2 → 7.0.0
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/README.md +180 -53
- package/assets/agent-skills/NOTICE-ECC.md +39 -0
- package/assets/agent-skills/agent-introspection-debugging/SKILL.md +153 -0
- package/assets/agent-skills/continuous-agent-loop/SKILL.md +45 -0
- package/assets/agent-skills/continuous-learning/SKILL.md +131 -0
- package/assets/agent-skills/continuous-learning/config.json +18 -0
- package/assets/agent-skills/continuous-learning/evaluate-session.sh +69 -0
- package/assets/agent-skills/production-audit/SKILL.md +206 -0
- package/assets/agent-skills/recursive-decision-ledger/SKILL.md +79 -0
- package/assets/agent-skills/scientific-thinking-literature-review/SKILL.md +192 -0
- package/assets/agent-skills/scientific-thinking-scholar-evaluation/SKILL.md +160 -0
- package/assets/agent-skills/verification-loop/SKILL.md +126 -0
- package/dist/agent/agent.js +67 -26
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/agentLoop.js +6 -2
- package/dist/agent/agentLoop.js.map +1 -1
- package/dist/agent/autoModeClassifier.js +26 -2
- package/dist/agent/autoModeClassifier.js.map +1 -1
- package/dist/agent/goalDriver.js +2 -0
- package/dist/agent/goalDriver.js.map +1 -1
- package/dist/agent/goalSpec.js +229 -0
- package/dist/agent/goalSpec.js.map +1 -0
- package/dist/agent/heartbeat.js +130 -0
- package/dist/agent/heartbeat.js.map +1 -0
- package/dist/agent/missionDecompose.js +38 -0
- package/dist/agent/missionDecompose.js.map +1 -0
- package/dist/agent/muscleMemory.js +291 -0
- package/dist/agent/muscleMemory.js.map +1 -0
- package/dist/agent/observationWriter.js +56 -0
- package/dist/agent/observationWriter.js.map +1 -0
- package/dist/agent/promptSectionCaps.js +6 -0
- package/dist/agent/promptSectionCaps.js.map +1 -1
- package/dist/agent/reminders.js +101 -0
- package/dist/agent/reminders.js.map +1 -0
- package/dist/agent/systemWidgets.js +41 -0
- package/dist/agent/systemWidgets.js.map +1 -0
- package/dist/agent/toolRunner.js +24 -0
- package/dist/agent/toolRunner.js.map +1 -1
- package/dist/agent/toolSearch.js +3 -0
- package/dist/agent/toolSearch.js.map +1 -1
- package/dist/channels/messenger.js +39 -0
- package/dist/channels/messenger.js.map +1 -1
- package/dist/config/config.js +7 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/schema.js +18 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/eval/harness.js +13 -3
- package/dist/eval/harness.js.map +1 -1
- package/dist/gateway/onboarding.js +91 -0
- package/dist/gateway/onboarding.js.map +1 -0
- package/dist/gateway/routes/skills.js +2 -1
- package/dist/gateway/routes/skills.js.map +1 -1
- package/dist/gateway/routes/studioRouter.js +88 -0
- package/dist/gateway/routes/studioRouter.js.map +1 -0
- package/dist/gateway/routes/watchRouter.js +4 -4
- package/dist/gateway/routes/watchRouter.js.map +1 -1
- package/dist/gateway/server.js +251 -43
- package/dist/gateway/server.js.map +1 -1
- package/dist/memory/taxonomy.js +117 -0
- package/dist/memory/taxonomy.js.map +1 -0
- package/dist/providers/modelCapabilities.js +13 -0
- package/dist/providers/modelCapabilities.js.map +1 -1
- package/dist/providers/ollama.js +8 -2
- package/dist/providers/ollama.js.map +1 -1
- package/dist/providers/openai.js +1 -1
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/openai_compat.js +38 -2
- package/dist/providers/openai_compat.js.map +1 -1
- package/dist/providers/router.js +14 -0
- package/dist/providers/router.js.map +1 -1
- package/dist/recipes/runner.js +8 -1
- package/dist/recipes/runner.js.map +1 -1
- package/dist/recipes/store.js +2 -1
- package/dist/recipes/store.js.map +1 -1
- package/dist/skills/builtin/codebase_explore.js +214 -0
- package/dist/skills/builtin/codebase_explore.js.map +1 -0
- package/dist/skills/builtin/config_audit.js +160 -0
- package/dist/skills/builtin/config_audit.js.map +1 -0
- package/dist/skills/builtin/delegate_agent.js +107 -0
- package/dist/skills/builtin/delegate_agent.js.map +1 -0
- package/dist/skills/builtin/memory_map.js +38 -0
- package/dist/skills/builtin/memory_map.js.map +1 -0
- package/dist/skills/builtin/reminders.js +67 -0
- package/dist/skills/builtin/reminders.js.map +1 -0
- package/dist/skills/builtin/spec.js +139 -0
- package/dist/skills/builtin/spec.js.map +1 -0
- package/dist/skills/builtin/widget_gallery.js +12 -5
- package/dist/skills/builtin/widget_gallery.js.map +1 -1
- package/dist/skills/frontmatterLoader.js +7 -1
- package/dist/skills/frontmatterLoader.js.map +1 -1
- package/dist/skills/registry.js +12 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/substrate/traceBus.js.map +1 -1
- package/dist/telemetry/traceStore.js +127 -0
- package/dist/telemetry/traceStore.js.map +1 -0
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/contrast.js +69 -0
- package/dist/utils/contrast.js.map +1 -0
- package/dist/watch/sessionContext.js +14 -0
- package/dist/watch/sessionContext.js.map +1 -0
- package/dist/watch/sessionTrace.js +51 -0
- package/dist/watch/sessionTrace.js.map +1 -0
- package/dist/watch/studioBuffer.js +53 -0
- package/dist/watch/studioBuffer.js.map +1 -0
- package/package.json +4 -3
- package/ui/dist/assets/AboutYouMemory-CZKEOd_O.js +11 -0
- package/ui/dist/assets/AuditPanel-Bu71N5Er.js +1 -0
- package/ui/dist/assets/{AutonomyPanel-CmaXJV8d.js → AutonomyPanel-DB-39dX4.js} +2 -2
- package/ui/dist/assets/{AutopilotPanel-CbohPtXW.js → AutopilotPanel-Cj8oKxWv.js} +1 -1
- package/ui/dist/assets/{AutoresearchPanel-DCwiQ2v2.js → AutoresearchPanel-3s8pjm6Z.js} +2 -2
- package/ui/dist/assets/BackupPanel-EUQJMJE7.js +1 -0
- package/ui/dist/assets/{BrowserPanel-D6UaSxap.js → BrowserPanel-Beo4F5Ar.js} +2 -2
- package/ui/dist/assets/Button-MdXmb4_n.js +1 -0
- package/ui/dist/assets/CPActivity-B1Se9VVc.js +1 -0
- package/ui/dist/assets/CPAgentDetail-BYji6tT8.js +1 -0
- package/ui/dist/assets/CPAgents-BSUKucTe.js +1 -0
- package/ui/dist/assets/CPApprovals-B4v0em6e.js +1 -0
- package/ui/dist/assets/CPCosts-9ikh61Kv.js +1 -0
- package/ui/dist/assets/CPDashboard-sOok2T5v.js +1 -0
- package/ui/dist/assets/{CPFiles-BO73EZwJ.js → CPFiles-DB2nY5JE.js} +1 -1
- package/ui/dist/assets/CPGoals-8Z1yOY8e.js +1 -0
- package/ui/dist/assets/CPInbox-Cq6-UY8F.js +11 -0
- package/ui/dist/assets/CPIssueDetail-NAGfmJg8.js +1 -0
- package/ui/dist/assets/CPIssues-BzX6Rckx.js +1 -0
- package/ui/dist/assets/CPLayout-BcRM6QSg.js +2 -0
- package/ui/dist/assets/CPOrg-B7DQ4UQP.js +1 -0
- package/ui/dist/assets/CPRuns-D-cpPw_M.js +1 -0
- package/ui/dist/assets/{CPSocial-Qw5rKy_4.js → CPSocial-DshtmcK0.js} +3 -3
- package/ui/dist/assets/CPVoice-DfXRnQVU.js +1 -0
- package/ui/dist/assets/{ChannelsPanel-DS21E-Iz.js → ChannelsPanel-BnaTOeyf.js} +1 -1
- package/ui/dist/assets/CheckpointsPanel-C62naE4U.js +1 -0
- package/ui/dist/assets/CommandPostHub-B_L1CAss.js +24 -0
- package/ui/dist/assets/ConfirmDialog-VErHWAbo.js +1 -0
- package/ui/dist/assets/CronPanel-BwMrrZ5d.js +1 -0
- package/ui/dist/assets/{DataTable-PnhPeDBG.js → DataTable-BCqSUuN7.js} +1 -1
- package/ui/dist/assets/{DreamPanel-DIrtlk2K.js → DreamPanel-BNAcCLBB.js} +2 -2
- package/ui/dist/assets/EmptyState-D9kQf1PX.js +1 -0
- package/ui/dist/assets/{EvalHarnessPanel-uYb_ZEQG.js → EvalHarnessPanel-BaMLdBNm.js} +2 -2
- package/ui/dist/assets/EvalPanel-CW-SSjtg.js +1 -0
- package/ui/dist/assets/{FileViewer-CVO3TRs3.js → FileViewer-BL00nsd7.js} +1 -1
- package/ui/dist/assets/FilesPanel-CeC6YUSd.js +16 -0
- package/ui/dist/assets/FleetPanel-EyWF7l3W.js +1 -0
- package/ui/dist/assets/{HomelabPanel-BZvN4LPM.js → HomelabPanel-BRfKRYe7.js} +2 -2
- package/ui/dist/assets/InfraView-Jmqhg_Yc.js +2 -0
- package/ui/dist/assets/{InlineEditableField-mBzpbcLB.js → InlineEditableField-DgMrLDj1.js} +1 -1
- package/ui/dist/assets/Input-CBTwa_Iw.js +1 -0
- package/ui/dist/assets/IntegrationsPanel-DQL-7Ec6.js +1 -0
- package/ui/dist/assets/IntelligenceView-DxD78qfP.js +2 -0
- package/ui/dist/assets/LearningPanel-C_JzSbJU.js +1 -0
- package/ui/dist/assets/LiveStudio-Db5yeaWo.js +7 -0
- package/ui/dist/assets/{LogsPanel-DbP3Mwnr.js → LogsPanel-CpinKwaZ.js} +1 -1
- package/ui/dist/assets/McpPanel-D-MqN_f-.js +1 -0
- package/ui/dist/assets/MemoryGraphPanel-BnD5jRqf.js +1 -0
- package/ui/dist/assets/MemoryTaxonomyPanel-BBI202dd.js +6 -0
- package/ui/dist/assets/MemoryWikiPanel-Dn3XZHL0.js +6 -0
- package/ui/dist/assets/{MeshPanel-Bf-4brXL.js → MeshPanel-C-mRJpr0.js} +1 -1
- package/ui/dist/assets/{MissionCanvas-CJyhnauG.js → MissionCanvas-CbZW83Ch.js} +1 -1
- package/ui/dist/assets/{MissionChat-C2Nto3zM.js → MissionChat-Bs75jPAD.js} +1 -1
- package/ui/dist/assets/{MissionLibrary-RXyBHsLL.js → MissionLibrary-BxQ6SxPe.js} +1 -1
- package/ui/dist/assets/MissionStart-CBuBPasl.js +1 -0
- package/ui/dist/assets/Modal-ybPGvlQs.js +9 -0
- package/ui/dist/assets/{NvidiaPanel-4DlcQlyl.js → NvidiaPanel-DdG13OX4.js} +1 -1
- package/ui/dist/assets/OrganismPanel-xZWUJKyr.js +1 -0
- package/ui/dist/assets/OverviewPanel-B45ZYhJV.js +1 -0
- package/ui/dist/assets/{PageHeader-bnc85wQN.js → PageHeader-DdrbS1aq.js} +1 -1
- package/ui/dist/assets/PersonaProfilesPanel-CKER-EU5.js +8 -0
- package/ui/dist/assets/{PersonasPanel-dR8VppcD.js → PersonasPanel-CMMQ3nh3.js} +1 -1
- package/ui/dist/assets/{PhoneDeskPanel-CdVOY7H9.js → PhoneDeskPanel-Bw_Y-cVE.js} +2 -2
- package/ui/dist/assets/RecipesPanel-DzMcxpJJ.js +1 -0
- package/ui/dist/assets/SecurityPanel-BCq3Fzbr.js +1 -0
- package/ui/dist/assets/SelfImprovePanel-YE3hT8jK.js +1 -0
- package/ui/dist/assets/SelfProposalsPanel-DXuqBM6p.js +1 -0
- package/ui/dist/assets/SessionsPanel-DORz5goR.js +1 -0
- package/ui/dist/assets/SessionsTab-qYHDOuC8.js +1 -0
- package/ui/dist/assets/SettingsPanel-BbwPu1i7.js +1 -0
- package/ui/dist/assets/SettingsView-zgqkDDBJ.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-Cax7YTqW.js → SkeletonLoader-r6OGXaU9.js} +1 -1
- package/ui/dist/assets/SkillsPanel-BjEOBMRo.js +11 -0
- package/ui/dist/assets/{SomaView-eG3wI4S1.js → SomaView-DLzApZVW.js} +2 -2
- package/ui/dist/assets/{StatCard-Djr487DV.js → StatCard-DLq8aBps.js} +1 -1
- package/ui/dist/assets/{StatusBadge-JpCoA33_.js → StatusBadge-BqlvIbdj.js} +1 -1
- package/ui/dist/assets/{Tabs-DJHu-roP.js → Tabs-DdUThlp1.js} +1 -1
- package/ui/dist/assets/TeamsPanel-uIIKoU7I.js +1 -0
- package/ui/dist/assets/{TelemetryPanel-D4PXsd-X.js → TelemetryPanel-dVr3yQQr.js} +1 -1
- package/ui/dist/assets/TitanCanvas-xHAJqwG2.js +945 -0
- package/ui/dist/assets/ToolsView-CG1mZdiy.js +2 -0
- package/ui/dist/assets/{Tooltip-B1LhTXJ8.js → Tooltip-C2tXJcrN.js} +1 -1
- package/ui/dist/assets/TraceViewer-BIMD_Osr.js +1 -0
- package/ui/dist/assets/TracesPanel-nMUiyMj5.js +1 -0
- package/ui/dist/assets/TrainingPanel-CT5R4HWm.js +1 -0
- package/ui/dist/assets/{VoiceOverlay-B_ss7Zg_.js → VoiceOverlay-Br4QnCtw.js} +3 -3
- package/ui/dist/assets/VramPanel-CdnJYytg.js +1 -0
- package/ui/dist/assets/WatchView-TNU6Ns1Q.js +13 -0
- package/ui/dist/assets/WorkTab-wTlX_UKP.js +1 -0
- package/ui/dist/assets/WorkflowBuilderPanel-CDpVt5ux.js +6 -0
- package/ui/dist/assets/WorkflowsPanel-zsFqsLdn.js +11 -0
- package/ui/dist/assets/{archive-gZFnGd5A.js → archive-Bh689DNg.js} +1 -1
- package/ui/dist/assets/{arrow-left-qA0Qer2h.js → arrow-left-WkVYLm80.js} +1 -1
- package/ui/dist/assets/{book-open-DIxdPqmD.js → book-open-ohEXgUsS.js} +1 -1
- package/ui/dist/assets/{bot-CvIF1uHi.js → bot-DvEcyQcD.js} +1 -1
- package/ui/dist/assets/{chart-column-BQiM-Td4.js → chart-column-w3goFd5f.js} +1 -1
- package/ui/dist/assets/{check-DgyDEFtq.js → check-CuRYh4Zh.js} +1 -1
- package/ui/dist/assets/{chevron-right-CQ1NTOtd.js → chevron-right-DbLSHmff.js} +1 -1
- package/ui/dist/assets/{circle-check-big-CAFcaPPH.js → circle-check-big-Bkba568b.js} +1 -1
- package/ui/dist/assets/{circle-stop-C-8xGv0n.js → circle-stop-Bx2ohEg8.js} +1 -1
- package/ui/dist/assets/{clipboard-list-9DdqBj1F.js → clipboard-list-Dj9tORnu.js} +1 -1
- package/ui/dist/assets/{clock-CF9BCIpL.js → clock-JyQAYy6X.js} +1 -1
- package/ui/dist/assets/{dollar-sign-LDRZBae6.js → dollar-sign-XxwPAA2a.js} +1 -1
- package/ui/dist/assets/{download-BBNXvBO0.js → download-D1izVEOL.js} +1 -1
- package/ui/dist/assets/{external-link-D_ji4Bec.js → external-link-DZ_rZsIt.js} +1 -1
- package/ui/dist/assets/{file-text-DrdTDEYp.js → file-text-Cfawu8Bs.js} +1 -1
- package/ui/dist/assets/{flask-conical-BGn5PgFX.js → flask-conical-Ql8QxhgY.js} +1 -1
- package/ui/dist/assets/{folder-BeZZUGnK.js → folder-DAdIw-Pb.js} +1 -1
- package/ui/dist/assets/{funnel-CAJgGO5M.js → funnel-FycfZcXo.js} +1 -1
- package/ui/dist/assets/{git-branch-BcXabeOs.js → git-branch-C2qrhGGu.js} +1 -1
- package/ui/dist/assets/index-Cml2x9pA.js +507 -0
- package/ui/dist/assets/index-yWybhcfI.css +1 -0
- package/ui/dist/assets/{layers-DxYDmPA_.js → layers-yzjtGlHB.js} +1 -1
- package/ui/dist/assets/{legacy-dHWI7k8P.js → legacy-D21WSMF1.js} +1 -1
- package/ui/dist/assets/{lightbulb-B0Du4SM4.js → lightbulb-BZJNK69S.js} +1 -1
- package/ui/dist/assets/{link-CUpaumqr.js → link-CnFkBkaY.js} +1 -1
- package/ui/dist/assets/{list-todo-CDDhmPQB.js → list-todo-BlgfQHup.js} +1 -1
- package/ui/dist/assets/{message-square-D5VWlv-Q.js → message-square-CRsG9u6_.js} +1 -1
- package/ui/dist/assets/{mic-Ddcc6Ann.js → mic-B32RHc7Y.js} +1 -1
- package/ui/dist/assets/{missions-2zox16Tc.js → missions-1iw8Z2_0.js} +1 -1
- package/ui/dist/assets/{network-DaJ7ugwX.js → network-C9RXQGrV.js} +1 -1
- package/ui/dist/assets/{pause-BukaK6rs.js → pause-BT1Bc2q3.js} +1 -1
- package/ui/dist/assets/{pencil-D_YwQBeg.js → pencil-BK5IU6o0.js} +1 -1
- package/ui/dist/assets/{play-BjdwtYMk.js → play-Cl1nC_gc.js} +1 -1
- package/ui/dist/assets/{plug-yISDdeW2.js → plug-DvcpOalj.js} +1 -1
- package/ui/dist/assets/{plus-BSjTdepW.js → plus-Dpo1qfrl.js} +1 -1
- package/ui/dist/assets/{radio-B7kX_yWE.js → radio-C5c9IyqX.js} +1 -1
- package/ui/dist/assets/{refresh-cw-CwDpzXUn.js → refresh-cw-C-iZkzuS.js} +1 -1
- package/ui/dist/assets/{rotate-ccw-7SQDTI0_.js → rotate-ccw-qzrB3SNw.js} +1 -1
- package/ui/dist/assets/{save-CjTPAQM0.js → save-DwR9wQVu.js} +1 -1
- package/ui/dist/assets/{search-BP7VlNxX.js → search-D10l0m3-.js} +1 -1
- package/ui/dist/assets/{send-C2XDuRPf.js → send-DtXGsaFW.js} +1 -1
- package/ui/dist/assets/{server-BE8W-AT4.js → server-BzisF3LL.js} +1 -1
- package/ui/dist/assets/settings-Dbwd1_-c.js +6 -0
- package/ui/dist/assets/{shield-check-s7la2J2K.js → shield-check-CXlDJyAW.js} +1 -1
- package/ui/dist/assets/square-BBC-JKzY.js +11 -0
- package/ui/dist/assets/{terminal-B8IK4WsO.js → terminal-DaBIlWEM.js} +1 -1
- package/ui/dist/assets/{test-tube-Xfn9DJeg.js → test-tube-CDATRD5t.js} +1 -1
- package/ui/dist/assets/{toggle-right-CHpzOIlj.js → toggle-right-DTmrC5RD.js} +1 -1
- package/ui/dist/assets/{trash-2-B1C85ePK.js → trash-2-CTeyjxD_.js} +1 -1
- package/ui/dist/assets/{trending-up-DDGHQZY1.js → trending-up-CXPRjRV4.js} +1 -1
- package/ui/dist/assets/{trophy-D0LhJSPA.js → trophy-DbVdXRtU.js} +1 -1
- package/ui/dist/assets/{volume-2-DMaE91b5.js → volume-2-DYDBmm3M.js} +1 -1
- package/ui/dist/assets/{wifi-off-DR9h8HGA.js → wifi-off-BBuIGbiP.js} +1 -1
- package/ui/dist/assets/zoom-out-D47_pRAO.js +16 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/AuditPanel-BaftX5MP.js +0 -1
- package/ui/dist/assets/BackupPanel-DAy9G7Wt.js +0 -1
- package/ui/dist/assets/CPActivity-BYDsUoMn.js +0 -1
- package/ui/dist/assets/CPAgentDetail-Bb9-GAJY.js +0 -1
- package/ui/dist/assets/CPAgents-BTZuGnki.js +0 -1
- package/ui/dist/assets/CPApprovals-BME2ARkO.js +0 -1
- package/ui/dist/assets/CPCosts-mOXwWq0i.js +0 -1
- package/ui/dist/assets/CPDashboard-CTlKGXXQ.js +0 -1
- package/ui/dist/assets/CPGoals-BNWhNP14.js +0 -1
- package/ui/dist/assets/CPInbox-ybe4r8LW.js +0 -16
- package/ui/dist/assets/CPIssueDetail-DaMMGbjw.js +0 -1
- package/ui/dist/assets/CPIssues-BgpQOISw.js +0 -1
- package/ui/dist/assets/CPLayout-bgErauTx.js +0 -2
- package/ui/dist/assets/CPOrg-C8l5SIWJ.js +0 -8
- package/ui/dist/assets/CPRuns-DB8S7loF.js +0 -1
- package/ui/dist/assets/CPVoice-DfwHPewA.js +0 -1
- package/ui/dist/assets/CheckpointsPanel-9-l_8GdG.js +0 -1
- package/ui/dist/assets/CommandPostHub-z55Yrhj1.js +0 -24
- package/ui/dist/assets/CronPanel-kEZK3gpx.js +0 -1
- package/ui/dist/assets/EmptyState-CfvU7SdB.js +0 -1
- package/ui/dist/assets/EvalPanel-CDG-njyj.js +0 -1
- package/ui/dist/assets/FilesPanel-CaLPog2e.js +0 -16
- package/ui/dist/assets/FleetPanel-BtlaV6pH.js +0 -1
- package/ui/dist/assets/InfraView-C0zEuFrR.js +0 -2
- package/ui/dist/assets/Input-CbrMbLgn.js +0 -1
- package/ui/dist/assets/IntegrationsPanel-B4TyR6jC.js +0 -1
- package/ui/dist/assets/IntelligenceView-DZ4HxYZ3.js +0 -2
- package/ui/dist/assets/LearningPanel-B4RIm_iQ.js +0 -1
- package/ui/dist/assets/McpPanel-BmNUFozc.js +0 -1
- package/ui/dist/assets/MemoryGraphPanel-JPurHV0L.js +0 -16
- package/ui/dist/assets/MemoryWikiPanel-DdvCAZHa.js +0 -6
- package/ui/dist/assets/MissionStart-wUkcEP0T.js +0 -1
- package/ui/dist/assets/Modal-BmS7C6FN.js +0 -1
- package/ui/dist/assets/OrganismPanel-C2LYDPrn.js +0 -1
- package/ui/dist/assets/OverviewPanel-DK8uuq4D.js +0 -1
- package/ui/dist/assets/PersonaProfilesPanel-DGtokXUu.js +0 -8
- package/ui/dist/assets/RecipesPanel-D3Zs2wxr.js +0 -1
- package/ui/dist/assets/SecurityPanel-BMERf796.js +0 -1
- package/ui/dist/assets/SelfImprovePanel-BxqWHXCU.js +0 -1
- package/ui/dist/assets/SelfProposalsPanel-CuC94vdx.js +0 -2
- package/ui/dist/assets/SessionsPanel-CQ8qvzp7.js +0 -1
- package/ui/dist/assets/SessionsTab-B3eHV3jf.js +0 -1
- package/ui/dist/assets/SettingsPanel-Cumls7N2.js +0 -1
- package/ui/dist/assets/SettingsView-BtA67pol.js +0 -2
- package/ui/dist/assets/SkillsPanel-CA415CT8.js +0 -11
- package/ui/dist/assets/TeamsPanel-C_Vu6vnY.js +0 -1
- package/ui/dist/assets/TitanCanvas-TuYZSZO7.js +0 -1117
- package/ui/dist/assets/ToolsView-BvTN6vFn.js +0 -2
- package/ui/dist/assets/TraceViewer-Bh8Jo3Dr.js +0 -1
- package/ui/dist/assets/TrainingPanel-Dmbd1rJ-.js +0 -1
- package/ui/dist/assets/VramPanel-CPICbZ2s.js +0 -1
- package/ui/dist/assets/WatchView-BCgLVfiV.js +0 -13
- package/ui/dist/assets/WorkTab-iptofXO9.js +0 -1
- package/ui/dist/assets/WorkflowsPanel-3RYkFHyf.js +0 -11
- package/ui/dist/assets/chevron-up-UyfdjRp6.js +0 -6
- package/ui/dist/assets/index-CUgepw5Q.js +0 -337
- package/ui/dist/assets/index-Dm6zcSTS.css +0 -1
- package/ui/dist/assets/proxy-CWET5FFX.js +0 -9
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,a2 as F,j as e,a3 as I,a4 as $}from"./index-CUgepw5Q.js";import{B as u}from"./Input-CbrMbLgn.js";import{S as w}from"./StatusBadge-JpCoA33_.js";import{P as A}from"./PageHeader-bnc85wQN.js";import{E as L}from"./EmptyState-CfvU7SdB.js";import{M as W}from"./Modal-BmS7C6FN.js";import{S as M}from"./SkeletonLoader-Cax7YTqW.js";import{P as G}from"./plus-BSjTdepW.js";import{D as H}from"./dollar-sign-LDRZBae6.js";import{T as R}from"./trash-2-B1C85ePK.js";import"./clsx-B-dksMZM.js";import"./chevron-right-CQ1NTOtd.js";import"./proxy-CWET5FFX.js";function q(r){const l=r.limitUsd>0?r.currentSpend/r.limitUsd*100:0;return l>=100?"exceeded":l>=r.warningThresholdPercent?"warning":"healthy"}function ae(){const[r,l]=s.useState([]),[c,C]=s.useState(!0),[n,m]=s.useState(null),[S,a]=s.useState(!1),[k,g]=s.useState(!1),[o,p]=s.useState(""),[i,P]=s.useState("global"),[h,b]=s.useState(""),[j,B]=s.useState("monthly"),[f,v]=s.useState("10"),[y,z]=s.useState("80"),[N,T]=s.useState("warn"),d=s.useCallback(async()=>{try{const t=await F();l(t),m(null)}catch(t){m(t instanceof Error?t.message:"Failed to load budgets")}C(!1)},[]);s.useEffect(()=>{d()},[d]);const D=async()=>{if(o.trim()){g(!0);try{await $({name:o.trim(),scope:{type:i,targetId:h||void 0},period:j,limitUsd:parseFloat(f)||10,warningThresholdPercent:parseInt(y)||80,action:N,enabled:!0}),a(!1),p(""),b(""),v("10"),await d()}catch{}g(!1)}},E=async t=>{try{await I(t),await d()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(A,{title:"Costs & Budgets",breadcrumbs:[{label:"Command Post"},{label:"Costs"}],actions:e.jsx(u,{size:"sm",icon:e.jsx(G,{size:14}),onClick:()=>a(!0),children:"Create Budget"})}),c&&e.jsx(M,{variant:"row",count:4}),n&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:n}),!c&&!n&&r.length===0&&e.jsx(L,{icon:e.jsx(H,{size:32}),title:"No budgets",description:"Create budget policies to control agent spending.",action:{label:"Create Budget",onClick:()=>a(!0)}}),!c&&!n&&r.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:r.map(t=>{const U=t.limitUsd>0?t.currentSpend/t.limitUsd*100:0,x=q(t);return e.jsxs("div",{className:"flex items-center gap-4 px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:t.name}),e.jsx(w,{status:x,size:"sm"}),!t.enabled&&e.jsx(w,{status:"disabled",size:"sm"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[e.jsxs("span",{className:"capitalize",children:[t.scope.type,t.scope.targetId?`: ${t.scope.targetId}`:""]}),e.jsx("span",{className:"capitalize",children:t.period}),e.jsxs("span",{children:["Action: ",t.action]})]})]}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsxs("div",{className:"text-sm font-medium text-text",children:["$",t.currentSpend.toFixed(2)," / $",t.limitUsd.toFixed(2)]}),e.jsx("div",{className:"w-24 h-1.5 bg-bg-tertiary rounded-full overflow-hidden mt-1",children:e.jsx("div",{className:`h-full rounded-full transition-all ${x==="exceeded"?"bg-error":x==="warning"?"bg-warning":"bg-success"}`,style:{width:`${Math.min(100,U)}%`}})})]}),e.jsx("button",{onClick:()=>E(t.id),className:"p-1.5 rounded-md text-text-muted hover:text-error hover:bg-error/10 transition-colors flex-shrink-0",title:"Delete budget",children:e.jsx(R,{size:14})})]},t.id)})}),e.jsx(W,{open:S,onClose:()=>a(!1),title:"Create Budget Policy",footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",size:"sm",onClick:()=>a(!1),children:"Cancel"}),e.jsx(u,{size:"sm",onClick:D,loading:k,disabled:!o.trim(),children:"Create"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Name"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:"Budget name...",value:o,onChange:t=>p(t.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Scope"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:i,onChange:t=>P(t.target.value),children:[e.jsx("option",{value:"global",children:"Global"}),e.jsx("option",{value:"agent",children:"Agent"}),e.jsx("option",{value:"goal",children:"Goal"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Period"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:j,onChange:t=>B(t.target.value),children:[e.jsx("option",{value:"daily",children:"Daily"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]})]})]}),i!=="global"&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Target ID"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:`${i} ID...`,value:h,onChange:t=>b(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Limit (USD)"}),e.jsx("input",{type:"number",className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:f,onChange:t=>v(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Warning %"}),e.jsx("input",{type:"number",className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:y,onChange:t=>z(t.target.value)})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Action on Threshold"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:N,onChange:t=>T(t.target.value),children:[e.jsx("option",{value:"warn",children:"Warn"}),e.jsx("option",{value:"pause",children:"Pause"}),e.jsx("option",{value:"stop",children:"Stop"})]})]})]})})]})}export{ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as g,j as t,w as ae,x as re,y as ie,z as ne,U as oe,T as ce,A as q,D as X}from"./index-CUgepw5Q.js";import"./Input-CbrMbLgn.js";import{S as de}from"./StatusBadge-JpCoA33_.js";import{P as J}from"./PageHeader-bnc85wQN.js";import{S as xe}from"./SkeletonLoader-Cax7YTqW.js";import{R as me}from"./refresh-cw-CwDpzXUn.js";import{L as K}from"./list-todo-CDDhmPQB.js";import{D as fe}from"./dollar-sign-LDRZBae6.js";import"./clsx-B-dksMZM.js";import"./chevron-right-CQ1NTOtd.js";const Q={idle:"textSecondary",active:"success",paused:"warning",error:"error",stopped:"borderLight"},he={ceo:"C",manager:"M",engineer:"E",researcher:"R",general:"G"};function ge({agents:x,activity:m}){const v=g.useRef(null),R=g.useRef(x),p=g.useRef(m);return R.current=x,p.current=m,g.useEffect(()=>{const b=v.current;if(!b)return;const e=b.getContext("2d");if(!e)return;const w=window.devicePixelRatio||1;let L,$=0;const A=()=>{const i=document.documentElement,c=getComputedStyle(i),s=(u,j,l)=>{const k=u?c.getPropertyValue(u).trim():"";return k||c.getPropertyValue(j).trim()||l};return{bg:s("--theme-bg-base","--color-bg","#09090b"),bgTertiary:s("--theme-bg-grain","--color-bg-tertiary","#27272a"),border:s("--theme-metal-dark","--color-border","#3f3f46"),borderLight:s("--theme-metal","--color-border-light","#52525b"),textMuted:s("--theme-ink-soft","--color-text-muted","#71717a"),textSecondary:s("--theme-paper-fg","--color-text-secondary","#a1a1aa"),accent:s("--theme-accent","--color-accent","#6366f1"),accentLight:s(null,"--color-accent-light","#a5b4fc"),success:s(null,"--color-success","#22c55e"),warning:s(null,"--color-warning","#f59e0b"),error:s(null,"--color-error","#ef4444")}},M=()=>{const i=b.clientWidth,c=b.clientHeight;b.width=i*w,b.height=c*w,e.setTransform(w,0,0,w,0,0)};M(),window.addEventListener("resize",M);const I=()=>{$++;const i=$/15,c=b.clientWidth,s=b.clientHeight,u=R.current,j=p.current,l=A();e.fillStyle=l.bg,e.fillRect(0,0,c,s),e.strokeStyle="#141418",e.lineWidth=.5;for(let a=0;a<c;a+=24)e.beginPath(),e.moveTo(a,s*.72),e.lineTo(a,s),e.stroke();for(let a=s*.72;a<s;a+=24)e.beginPath(),e.moveTo(0,a),e.lineTo(c,a),e.stroke();if(u.length===0){e.fillStyle=l.bgTertiary,e.font="12px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("No agents registered",c/2,s/2-10),e.font="10px -apple-system, BlinkMacSystemFont, sans-serif",e.fillStyle=l.border,e.fillText("Spawn agents to see them here",c/2,s/2+10),e.textAlign="start",L=requestAnimationFrame(I);return}const k=Math.min(u.length,8),D=Math.min(120,(c-20)/k),ee=(c-D*k)/2+D/2;for(let a=0;a<k;a++){const P=u[a],r=ee+a*D,n=s*.55,f=P.status==="active"?"active":P.status,z=l[Q[f]||Q.idle],o=Math.sin(i*.8+a*1.5)*1.5,F=j.some(d=>d.agentId===P.id&&Date.now()-new Date(d.timestamp).getTime()<3e4),E=Math.min(70,D-10),T=10,B=r-E/2,S=n+16;e.fillStyle=l.border,e.fillRect(B,S,E,T),e.fillStyle=l.borderLight,e.fillRect(B+1,S+1,E-2,T-2),e.fillStyle=l.border,e.fillRect(B+3,S+T,3,14),e.fillRect(B+E-6,S+T,3,14);const H=26,O=18,V=r-H/2,U=S-O;e.fillStyle=l.bgTertiary,e.fillRect(V,U,H,O);const Y=f==="error"?l.error:f==="active"?l.success:l.accent;if(e.fillStyle=Y+"30",e.fillRect(V+2,U+2,H-4,O-4),f==="active"||F){e.fillStyle=Y+"60";const d=2+Math.floor(i%3);for(let h=0;h<d;h++){const C=6+Math.sin(i*2+h+a)*5;e.fillRect(V+3,U+3+h*4,C,1.5)}}e.fillStyle=l.border,e.fillRect(r-2,S-1,4,3),e.fillStyle="#1e1e22",e.fillRect(r-10,n+10+o,20,8),e.fillRect(r-11,n-2+o,3,20),e.fillStyle=l.border,e.fillRect(r-7,n+o,14,12);const y=f==="active"&&F?Math.sin(i*1.5+a)*1.5:0;e.fillStyle=l.borderLight,e.fillRect(r-6,n-10+o+y,12,10);const G=Math.sin(i*.3+a*2)>.95?1:2;if(e.fillStyle=z,f==="stopped"?(e.fillRect(r-4,n-7+o+y,2,1),e.fillRect(r-3,n-6+o+y,2,1),e.fillRect(r+1,n-7+o+y,2,1),e.fillRect(r+2,n-6+o+y,2,1)):(e.fillRect(r-4,n-7+o+y,2,G),e.fillRect(r+2,n-7+o+y,2,G)),e.fillStyle=l.borderLight,e.fillRect(r-1,n-14+o+y,2,4),e.fillStyle=z,e.beginPath(),e.arc(r,n-15+o+y,2,0,Math.PI*2),e.fill(),f==="active"&&(e.globalAlpha=.3+Math.sin(i*3+a)*.2,e.beginPath(),e.arc(r,n-15+o+y,5,0,Math.PI*2),e.fill(),e.globalAlpha=1),f==="active"&&F){const d=Math.sin(i*6+a)*2,h=Math.sin(i*6+a+Math.PI)*2;e.fillStyle=l.border,e.fillRect(r-11,n+3+o+d,4,3),e.fillRect(r+7,n+3+o+h,4,3)}else e.fillStyle=l.border,e.fillRect(r-10,n+5+o,3,6),e.fillRect(r+7,n+5+o,3,6);if(f==="active"&&F){for(let d=0;d<2;d++){const h=i*1.5+d*Math.PI+a,C=14+Math.sin(i+d)*4,se=r+Math.cos(h)*C,le=n-3+Math.sin(h)*C*.4+o;e.globalAlpha=.25+Math.sin(i*2+d)*.15,e.fillStyle=z,e.beginPath(),e.arc(se,le,1,0,Math.PI*2),e.fill()}e.globalAlpha=1}if(f==="error"){for(let d=0;d<3;d++){const h=r+Math.sin(i*4+d*2)*12,C=n-5+Math.cos(i*3+d)*8+o;e.globalAlpha=.4+Math.sin(i+d)*.3,e.fillStyle=l.error,e.fillRect(h-1,C-1,2,2)}e.globalAlpha=1}e.fillStyle=f==="stopped"?l.border:l.textMuted,e.font="9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center";const _=Math.max(44,E+14);let N=P.name;if(e.measureText(N).width>_){for(;N.length>1&&e.measureText(N+"…").width>_;)N=N.slice(0,-1);N=N.trimEnd()+"…"}e.fillText(N,r,S+T+24);const te=he[P.role]||"G";e.fillStyle=z+"60",e.font="bold 7px -apple-system, BlinkMacSystemFont, sans-serif",e.fillText(te,r,S+T+33),e.textAlign="start"}if(e.fillStyle=l.bgTertiary,e.font="bold 9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("COMMAND POST",c/2,s-6),e.textAlign="start",j.length>0){const a=j[j.length-1];if(Date.now()-new Date(a.timestamp).getTime()<6e4){e.fillStyle=l.accent+"40",e.fillRect(0,0,c,16),e.fillStyle=l.accentLight,e.font="8px -apple-system, BlinkMacSystemFont, sans-serif";const r=a.message.length>60?a.message.slice(0,57)+"...":a.message;e.textAlign="center",e.fillText(r,c/2,11),e.textAlign="start"}}L=requestAnimationFrame(I)};return I(),()=>{cancelAnimationFrame(L),window.removeEventListener("resize",M)}},[]),t.jsx("canvas",{ref:v,className:"w-full rounded-xl border border-border",style:{height:220,imageRendering:"pixelated"}})}function Z(x){const m=Math.floor((Date.now()-new Date(x).getTime())/1e3);return m<60?`${m}s`:m<3600?`${Math.floor(m/60)}m`:m<86400?`${Math.floor(m/3600)}h`:`${Math.floor(m/86400)}d`}function W({icon:x,label:m,value:v,sub:R,color:p}){return t.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(x,{size:14,className:p}),t.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:m})]}),t.jsx("div",{className:"text-2xl font-bold text-text",children:v}),R&&t.jsx("div",{className:"text-[11px] text-text-muted mt-1",children:R})]})}function Ae(){var c;const[x,m]=g.useState(null),[v,R]=g.useState([]),[p,b]=g.useState([]),[e,w]=g.useState(0),[L,$]=g.useState(!0),A=g.useCallback(async()=>{try{const[s,u,j,l]=await Promise.all([ae(),re(20),ie(),ne("pending")]);m(s),R(u),b(j),w(l.length)}catch{}$(!1)},[]);if(g.useEffect(()=>{A();const s=setInterval(A,15e3);return()=>clearInterval(s)},[A]),L)return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}]}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:t.jsx(xe,{variant:"metric",count:4})})]});if(!x)return t.jsx("div",{className:"text-center py-12 text-text-muted",children:"Failed to load dashboard"});const M=x.budgetUtilization??0,I=p.filter(s=>s.status==="in_progress").length,i=p.filter(s=>s.status==="blocked").length;return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}],actions:t.jsx("button",{onClick:A,className:"p-1.5 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:t.jsx(me,{size:16})})}),t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[t.jsx(W,{icon:oe,label:"Agents Enabled",value:x.totalAgents,sub:`${x.activeAgents} running, ${Math.max(0,x.totalAgents-x.activeAgents)} paused`,color:"text-info"}),t.jsx(W,{icon:K,label:"Tasks In Progress",value:I,sub:`${p.length} open, ${i} blocked`,color:"text-warning"}),t.jsx(W,{icon:fe,label:"Budget Used",value:`${Math.round(M)}%`,sub:M>=80?"Nearing limit":"Healthy",color:M>=80?"text-error":"text-success"}),t.jsx(W,{icon:ce,label:"Goals",value:((c=x.goalTree)==null?void 0:c.length)??0,sub:"in hierarchy",color:"text-purple"})]}),x.agents.length>0&&t.jsx(ge,{agents:x.agents,activity:v}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(q,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Activity"})]}),t.jsx(X,{to:"/command-post/activity",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:v.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No activity yet"}):[...v].reverse().slice(0,15).map((s,u)=>t.jsxs("div",{className:"flex items-start gap-2 px-4 py-2",children:[t.jsx(q,{size:12,className:"text-text-muted mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1",children:s.message}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.timestamp)})]},`${s.timestamp}-${u}`))})]}),t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(K,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Issues"})]}),t.jsx(X,{to:"/command-post/issues",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:p.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No issues yet"}):p.slice(0,10).map(s=>t.jsxs(X,{to:`/command-post/issues/${s.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[t.jsx(de,{status:s.status,variant:"dot",size:"sm"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1 truncate",children:s.title}),s.assigneeAgentId&&t.jsx("span",{className:"text-[10px] text-text-muted",children:s.assigneeAgentId}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.updatedAt)})]},s.id))})]})]})]})}export{Ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,Q as D,j as e,T as N,V as $,X as M,b as y}from"./index-CUgepw5Q.js";import{B as j}from"./Input-CbrMbLgn.js";import{S as T}from"./StatusBadge-JpCoA33_.js";import{P as O}from"./PageHeader-bnc85wQN.js";import{E as A}from"./EmptyState-CfvU7SdB.js";import{M as F}from"./Modal-BmS7C6FN.js";import{S as L}from"./SkeletonLoader-Cax7YTqW.js";import{P as B}from"./plus-BSjTdepW.js";import{C as I}from"./chevron-right-CQ1NTOtd.js";import{T as U}from"./trash-2-B1C85ePK.js";import"./clsx-B-dksMZM.js";import"./proxy-CWET5FFX.js";function _(t){const a=Math.floor((Date.now()-new Date(t).getTime())/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`}const H=["pending","in_progress","completed","blocked"];function J({node:t,onClose:a,onRefresh:l}){const[d,c]=i.useState(!1),[x,m]=i.useState(!1),r=t.goal,g=async()=>{c(!0);try{await y(`/api/goals/${r.id}`,{method:"DELETE"}),l(),a()}catch{}c(!1)},o=async n=>{m(!0);try{await y(`/api/goals/${r.id}`,{method:"PATCH",body:JSON.stringify({status:n})}),l()}catch{}m(!1)};return e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-text",children:r.title}),r.description&&e.jsx("p",{className:"text-sm text-text-secondary mt-1",children:r.description})]}),e.jsx("button",{onClick:a,className:"p-1 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:e.jsx(M,{size:16})})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 text-xs",children:[e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Status: "}),e.jsx(T,{status:r.status,size:"sm"})]}),r.progress>0&&e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Progress: "}),e.jsxs("span",{className:"text-text font-medium",children:[Math.round(r.progress),"%"]})]}),t.children.length>0&&e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Sub-goals: "}),e.jsxs("span",{className:"text-text font-medium",children:[t.children.filter(n=>n.goal.status==="completed"||n.goal.status==="done").length,"/",t.children.length," done"]})]}),e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Updated: "}),e.jsxs("span",{className:"text-text font-medium",children:[_(r.updatedAt||r.createdAt||new Date().toISOString())," ago"]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-2",children:"Change Status"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:H.map(n=>e.jsx("button",{disabled:x||r.status===n,onClick:()=>o(n),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${r.status===n?"bg-accent/20 text-accent border border-accent/30":"bg-bg-tertiary text-text-secondary hover:bg-bg-tertiary/80 border border-border"} disabled:opacity-50`,children:n.replace("_"," ")},n))})]}),e.jsx("div",{className:"pt-2 border-t border-border flex justify-end",children:e.jsxs("button",{onClick:g,disabled:d,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-error hover:bg-error/10 transition-colors disabled:opacity-50",children:[e.jsx(U,{size:12}),d?"Deleting...":"Delete Goal"]})})]})}function z({node:t,expanded:a,toggleExpand:l,selectedId:d,onSelect:c}){const x=t.children.length>0,m=a.has(t.goal.id),r=d===t.goal.id,g=t.children.filter(o=>o.goal.status==="completed"||o.goal.status==="done").length;return e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-2 py-2 px-3 rounded-lg transition-colors cursor-pointer group ${r?"bg-accent/10 border-l-2 border-accent":"hover:bg-bg-tertiary/50"}`,style:{paddingLeft:`${t.depth*24+12}px`},onClick:()=>c(t),children:[x?e.jsx("button",{onClick:o=>{o.stopPropagation(),l(t.goal.id)},className:"p-0.5 rounded hover:bg-bg-tertiary transition-colors",children:m?e.jsx($,{size:14,className:"text-text-muted"}):e.jsx(I,{size:14,className:"text-text-muted"})}):e.jsx("span",{className:"w-[18px] flex-shrink-0"}),e.jsx(N,{size:14,className:r?"text-accent":"text-text-muted"}),e.jsx("span",{className:"text-sm text-text flex-1 truncate",children:t.goal.title}),e.jsx(T,{status:t.goal.status,size:"sm"}),x&&e.jsxs("span",{className:"text-[10px] text-text-muted",children:[g,"/",t.children.length]}),t.goal.progress>0&&e.jsx("div",{className:"w-16 h-1.5 bg-bg-tertiary rounded-full overflow-hidden flex-shrink-0",children:e.jsx("div",{className:"h-full bg-accent rounded-full transition-all",style:{width:`${Math.min(100,t.goal.progress)}%`}})})]}),x&&m&&e.jsx("div",{children:t.children.map(o=>e.jsx(z,{node:o,expanded:a,toggleExpand:l,selectedId:d,onSelect:c},o.goal.id))})]})}function E(t,a){for(const l of t){if(l.goal.id===a)return l;const d=E(l.children,a);if(d)return d}return null}function ae(){const[t,a]=i.useState([]),[l,d]=i.useState(!0),[c,x]=i.useState(null),[m,r]=i.useState(new Set),[g,o]=i.useState(null),[n,u]=i.useState(!1),[p,v]=i.useState(""),[P,S]=i.useState(!1),b=i.useCallback(async()=>{try{const s=await D();a(s),r(new Set(s.map(h=>h.goal.id))),x(null)}catch(s){x(s instanceof Error?s.message:"Failed to load goals")}d(!1)},[]);i.useEffect(()=>{b()},[b]);const C=s=>{r(h=>{const f=new Set(h);return f.has(s)?f.delete(s):f.add(s),f})},G=s=>{o(h=>h===s.goal.id?null:s.goal.id),s.children.length>0&&!m.has(s.goal.id)&&C(s.goal.id)},w=async()=>{if(p.trim()){S(!0);try{await y("/api/command-post/goals",{method:"POST",body:JSON.stringify({title:p.trim()})}),u(!1),v(""),await b()}catch{}S(!1)}},k=g?E(t,g):null;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(O,{title:"Goals",breadcrumbs:[{label:"Command Post"},{label:"Goals"}],actions:e.jsx(j,{size:"sm",icon:e.jsx(B,{size:14}),onClick:()=>u(!0),children:"Create Goal"})}),l&&e.jsx(L,{variant:"row",count:5}),c&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:c}),!l&&!c&&t.length===0&&e.jsx(A,{icon:e.jsx(N,{size:32}),title:"No goals",description:"Create your first goal to start organizing agent work.",action:{label:"Create Goal",onClick:()=>u(!0)}}),!l&&!c&&t.length>0&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-border bg-bg-secondary overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-text-muted",children:[t.length," top-level goal",t.length!==1?"s":""]}),e.jsx("span",{className:"text-[10px] text-text-muted",children:"Click a goal to view details"})]}),e.jsx("div",{className:"divide-y divide-border",children:t.map(s=>e.jsx(z,{node:s,expanded:m,toggleExpand:C,selectedId:g,onSelect:G},s.goal.id))})]}),e.jsx("div",{className:"lg:col-span-1",children:k?e.jsx(J,{node:k,onClose:()=>o(null),onRefresh:b}):e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-8 text-center",children:[e.jsx(N,{size:24,className:"text-text-muted mx-auto mb-2"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Select a goal to view details"})]})})]}),e.jsx(F,{open:n,onClose:()=>u(!1),title:"Create Goal",footer:e.jsxs(e.Fragment,{children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:()=>u(!1),children:"Cancel"}),e.jsx(j,{size:"sm",onClick:w,loading:P,disabled:!p.trim(),children:"Create"})]}),children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Goal Title"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:"Enter goal title...",value:p,onChange:s=>v(s.target.value),onKeyDown:s=>s.key==="Enter"&&w(),autoFocus:!0})]})})]})}export{ae as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as A,r as d,J as P,j as e,bj as Y,bL as G,u as Q,z as Z,Y as ee,$ as te,y as se,l as re,K as I,X as E,V as ae,D as B,bM as ne,O as ie,P as oe,bN as le,b as de}from"./index-CUgepw5Q.js";import{B as m}from"./Input-CbrMbLgn.js";import{P as ce}from"./PageHeader-bnc85wQN.js";import{E as xe}from"./EmptyState-CfvU7SdB.js";import{T as ue}from"./Tabs-DJHu-roP.js";import{S as pe}from"./SkeletonLoader-Cax7YTqW.js";import{e as he}from"./approvalHeadline-DB9SgR-9.js";import{M as U}from"./message-square-D5VWlv-Q.js";import{B as q}from"./bot-CvIF1uHi.js";import{C}from"./clock-CF9BCIpL.js";import{S as me}from"./send-C2XDuRPf.js";import{S as ge}from"./shield-check-s7la2J2K.js";import{C as D}from"./check-DgyDEFtq.js";import{F as fe}from"./funnel-CAJgGO5M.js";import{C as be}from"./chevron-up-UyfdjRp6.js";import{R as ve}from"./rotate-ccw-7SQDTI0_.js";import"./clsx-B-dksMZM.js";import"./chevron-right-CQ1NTOtd.js";/**
|
|
2
|
-
* @license lucide-react v0.513.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=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],ye=A("inbox",je);/**
|
|
7
|
-
* @license lucide-react v0.513.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=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],we=A("square-check-big",ke);/**
|
|
12
|
-
* @license lucide-react v0.513.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 Ne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Se=A("square",Ne);function ze(o){return new Date(o).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Ce({approval:o,onReply:l}){const[u,y]=d.useState(""),[f,j]=d.useState(!1),{toast:x}=P(),k=o.thread||[],p=async()=>{if(u.trim()){j(!0);try{await G(o.id,"user",u.trim()),y(""),l==null||l(),x("success","Reply sent")}catch{x("error","Failed to send reply")}j(!1)}};return e.jsxs("div",{className:"space-y-3 mt-3",children:[k.length===0&&e.jsxs("div",{className:"text-xs text-text-muted italic flex items-center gap-1",children:[e.jsx(U,{size:12}),"No replies yet. Start the conversation below."]}),k.map(r=>e.jsxs("div",{className:`flex gap-2 ${r.authorUser?"flex-row":"flex-row-reverse"}`,children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0 ${r.authorUser?"bg-accent/20 text-accent":"bg-warning/20 text-warning"}`,children:r.authorUser?e.jsx(Y,{size:12}):e.jsx(q,{size:12})}),e.jsxs("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-xs ${r.authorUser?"bg-bg-tertiary text-text":"bg-warning/10 text-text border border-warning/20"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"font-semibold",children:r.authorUser||r.authorAgentId||"Agent"}),e.jsx(C,{size:10,className:"text-text-muted"}),e.jsx("span",{className:"text-text-muted",children:ze(r.createdAt)})]}),e.jsx("div",{className:"whitespace-pre-wrap",children:r.body})]})]},r.id)),e.jsxs("div",{className:"flex items-end gap-2 pt-2",children:[e.jsx("textarea",{value:u,onChange:r=>y(r.target.value),placeholder:"Reply to this agent...",className:"flex-1 min-h-[60px] rounded-lg border border-border bg-bg px-3 py-2 text-xs text-text outline-none focus:border-accent resize-none",onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),p())}}),e.jsx("button",{onClick:p,disabled:f||!u.trim(),className:"h-8 w-8 rounded-lg bg-accent text-white flex items-center justify-center disabled:opacity-40 hover:bg-accent/90 transition-colors",children:e.jsx(me,{size:14})})]})]})}function Ae(o){const l=Math.floor((Date.now()-new Date(o).getTime())/1e3);return l<60?`${l}s`:l<3600?`${Math.floor(l/60)}m`:l<86400?`${Math.floor(l/3600)}h`:`${Math.floor(l/86400)}d`}function $e(o){return!!o.snoozedUntil&&new Date(o.snoozedUntil)>new Date}function Xe(){const[o,l]=d.useState([]),[u,y]=d.useState(!0),[f,j]=d.useState(null),[x,k]=d.useState("all"),[p,r]=d.useState(null),[F,M]=d.useState(null),[w,S]=d.useState(new Set),[N,L]=d.useState("all"),{toast:c}=P(),V=Q(),h=d.useCallback(async()=>{try{const[t,n,a,b]=await Promise.all([Z("pending"),ee(void 0,50),te(),se({status:"blocked"})]),i=[];t.forEach(s=>{const v=he(s),g=s.type==="custom"&&s.payload.kind==="driver_blocked",T=s.type==="custom"&&s.payload.kind==="self_mod_pr";i.push({id:`approval-${s.id}`,kind:"approval",icon:ge,iconColor:g?"text-error":T?"text-warning":"text-accent",urgency:g||T?"high":"medium",message:`${v.kindLabel}: ${v.headline}`,timestamp:s.createdAt,data:s})}),n.filter(s=>s.status==="failed"||s.status==="error").forEach(s=>i.push({id:`run-${s.id}`,kind:"failed_run",icon:re,iconColor:"text-error",urgency:"high",message:`Run failed: ${s.agentId} — ${s.error??"unknown error"}`,timestamp:s.finishedAt??s.startedAt,data:s})),a.filter(s=>s.status==="error").forEach(s=>i.push({id:`agent-${s.id}`,kind:"error_agent",icon:I,iconColor:"text-error",urgency:"high",message:`Agent error: ${s.name}`,timestamp:s.lastHeartbeat,data:s})),b.forEach(s=>i.push({id:`issue-${s.id}`,kind:"blocked_issue",icon:I,iconColor:"text-warning",urgency:"medium",message:`Blocked: ${s.identifier} — ${s.title}`,timestamp:s.updatedAt,data:s})),i.sort((s,v)=>{const g={high:0,medium:1,low:2};return g[s.urgency]!==g[v.urgency]?g[s.urgency]-g[v.urgency]:new Date(v.timestamp).getTime()-new Date(s.timestamp).getTime()}),l(i),j(null)}catch(t){j(t instanceof Error?t.message:"Failed to load inbox")}y(!1)},[]);d.useEffect(()=>{h()},[h]);const H=async t=>{r(t.id);try{await ie(t.id,"user"),await h();const n=t.type==="goal_proposal"||t.type==="soma_proposal",a=t.type==="custom"&&t.payload.kind==="driver_blocked";c("success",n?"Work approved — TITAN is starting…":a?"Unblocked — TITAN is resuming…":"Approved"),(n||a)&&V("/command-post",{state:{tab:"Work"}})}catch{c("error","Approval failed")}r(null)},O=async t=>{r(t.id);try{await oe(t.id,"user"),await h(),c("success","Rejected")}catch{c("error","Reject failed")}r(null)},K=async(t,n)=>{r(t.id);try{const a=new Date(Date.now()+n*6e4).toISOString();await le(t.id,a),await h(),c("success",`Snoozed for ${n}m`)}catch{c("error","Snooze failed")}r(null)},W=async t=>{r(t.id);try{const n=await de(`/api/command-post/runs/${t.id}/retry`,{method:"POST"});if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);await h(),c("success","Retry queued — TITAN will try again")}catch{c("error","Retry failed")}r(null)},X=t=>{S(n=>{const a=new Set(n);return a.has(t)?a.delete(t):a.add(t),a})},$=async t=>{const n=Array.from(w).map(a=>{var b;return(b=o.find(i=>i.id===a))==null?void 0:b.data}).filter(a=>(a==null?void 0:a.id)!==void 0).map(a=>a.id);if(n.length!==0){r("batch");try{await ne(n,t,"user"),S(new Set),await h(),c("success",`${t==="approve"?"Approved":"Rejected"} ${n.length} item(s)`)}catch{c("error","Batch action failed")}r(null)}},z=o.filter(t=>x==="all"?!0:x==="approvals"?t.kind==="approval":x==="failed_runs"?t.kind==="failed_run":x==="errors"?t.kind==="error_agent"||t.kind==="blocked_issue":!0).filter(t=>N==="all"?!0:t.kind==="approval"?t.data.requestedBy===N:t.kind==="failed_run"?t.data.agentId===N:!0),_=o.filter(t=>t.kind==="approval"),J=[{id:"all",label:"All",count:o.length},{id:"approvals",label:"Approvals",count:_.length},{id:"failed_runs",label:"Failed Runs",count:o.filter(t=>t.kind==="failed_run").length},{id:"errors",label:"Errors",count:o.filter(t=>t.kind==="error_agent"||t.kind==="blocked_issue").length}],R=Array.from(new Set(_.map(t=>t.data.requestedBy))).filter(Boolean);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(ce,{title:"Inbox",breadcrumbs:[{label:"Command Post"},{label:"Inbox"}]}),w.size>0&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-accent/10 border border-accent/20",children:[e.jsxs("span",{className:"text-xs font-medium text-accent",children:[w.size," selected"]}),e.jsx("div",{className:"flex-1"}),e.jsx(m,{size:"sm",variant:"ghost",onClick:()=>$("approve"),loading:p==="batch",icon:e.jsx(D,{size:14}),children:"Approve All"}),e.jsx(m,{size:"sm",variant:"ghost",onClick:()=>$("reject"),loading:p==="batch",icon:e.jsx(E,{size:14}),children:"Reject All"}),e.jsx("button",{onClick:()=>S(new Set),className:"text-xs text-text-muted hover:text-text px-2",children:"Clear"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ue,{tabs:J,activeTab:x,onChange:k}),e.jsx("div",{className:"flex-1"}),x==="approvals"&&R.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(fe,{size:12,className:"text-text-muted"}),e.jsxs("select",{value:N,onChange:t=>L(t.target.value),className:"text-xs bg-bg border border-border rounded px-2 py-1 outline-none focus:border-accent",children:[e.jsx("option",{value:"all",children:"All agents"}),R.map(t=>e.jsx("option",{value:t,children:t},t))]})]})]}),u&&e.jsx(pe,{variant:"row",count:5}),f&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:f}),!u&&!f&&z.length===0&&e.jsx(xe,{icon:e.jsx(ye,{size:32}),title:"Inbox empty",description:"No pending items require your attention."}),!u&&!f&&z.length>0&&e.jsx("div",{className:"space-y-2",children:z.map(t=>{const n=t.icon,a=F===t.id,b=w.has(t.id),i=t.kind==="approval"?t.data:null;return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-colors ${t.urgency==="high"?"border-error/30 bg-error/5":t.urgency==="medium"?"border-warning/20 bg-warning/[0.03]":"border-border bg-bg-secondary"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[t.kind==="approval"&&e.jsx("button",{onClick:()=>X(t.id),className:"text-text-muted hover:text-accent transition-colors",children:b?e.jsx(we,{size:16,className:"text-accent"}):e.jsx(Se,{size:16})}),e.jsx(n,{size:16,className:t.iconColor}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-text font-medium truncate",children:t.message}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-text-muted mt-0.5",children:[i&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(q,{size:10}),i.requestedBy]}),i.thread&&i.thread.length>0&&e.jsxs("span",{className:"flex items-center gap-1 text-accent",children:[e.jsx(U,{size:10}),i.thread.length]}),$e(i)&&e.jsxs("span",{className:"flex items-center gap-1 text-warning",children:[e.jsx(C,{size:10}),"Snoozed"]})]}),e.jsx("span",{children:Ae(t.timestamp)})]})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[t.kind==="approval"&&e.jsxs(e.Fragment,{children:[e.jsx(m,{size:"sm",variant:"ghost",onClick:()=>H(t.data),loading:p===t.data.id,icon:e.jsx(D,{size:14}),children:"Approve"}),e.jsx(m,{size:"sm",variant:"ghost",onClick:()=>O(t.data),loading:p===t.data.id,icon:e.jsx(E,{size:14}),children:"Reject"}),e.jsxs("div",{className:"relative group",children:[e.jsx(m,{size:"sm",variant:"ghost",icon:e.jsx(C,{size:14}),children:"Snooze"}),e.jsx("div",{className:"absolute right-0 top-full mt-1 hidden group-hover:flex flex-col gap-1 bg-bg border border-border rounded-lg p-1 shadow-lg z-10",children:[15,60,240,1440].map(s=>e.jsx("button",{onClick:()=>K(t.data,s),className:"text-xs text-left px-2 py-1 rounded hover:bg-bg-tertiary whitespace-nowrap",children:s<60?`${s}m`:s<1440?`${s/60}h`:`${s/1440}d`},s))})]}),e.jsx("button",{onClick:()=>M(a?null:t.id),className:"p-1.5 rounded hover:bg-bg-tertiary text-text-muted",children:a?e.jsx(be,{size:14}):e.jsx(ae,{size:14})})]}),t.kind==="failed_run"&&e.jsx(m,{size:"sm",variant:"ghost",onClick:()=>W(t.data),loading:p===t.data.id,icon:e.jsx(ve,{size:14}),children:"Retry"}),t.kind==="blocked_issue"&&e.jsx(B,{to:`/command-post/issues/${t.data.id}`,children:e.jsx(m,{size:"sm",variant:"ghost",children:"View"})}),t.kind==="error_agent"&&e.jsx(B,{to:`/command-post/agents/${t.data.id}`,children:e.jsx(m,{size:"sm",variant:"ghost",children:"View"})})]})]}),a&&i&&e.jsxs("div",{className:"px-4 pb-4 border-t border-border/50",children:[i.payload&&!!i.payload.shadowVerdict&&e.jsxs("div",{className:"mt-3 p-2 rounded-lg bg-bg-tertiary/50 text-xs",children:[e.jsx("div",{className:"font-medium text-text-muted mb-1",children:"Shadow Rehearsal"}),e.jsx("div",{className:"text-text-secondary",children:(()=>{const s=i.payload.shadowVerdict;return s?e.jsxs("div",{className:"space-y-1",children:[s.estimatedCostUsd?e.jsxs("div",{children:["Cost: $",Number(s.estimatedCostUsd).toFixed(2)]}):null,s.reversibilityScore!==void 0?e.jsxs("div",{children:["Reversibility: ",Number(s.reversibilityScore).toFixed(2)]}):null,s.breakRisks&&Array.isArray(s.breakRisks)&&s.breakRisks.length>0?e.jsxs("div",{className:"text-error",children:["Risks: ",s.breakRisks.join(", ")]}):null]}):null})()})]}),e.jsx(Ce,{approval:i,onReply:h})]})]},t.id)})})]})}export{Xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as D,u as $,r,bJ as B,b as S,bK as M,j as e,D as L,bb as C}from"./index-CUgepw5Q.js";import{B as c}from"./Input-CbrMbLgn.js";import{S as O}from"./StatusBadge-JpCoA33_.js";import{P as h}from"./PageHeader-bnc85wQN.js";import{S as U}from"./SkeletonLoader-Cax7YTqW.js";import{A as K}from"./arrow-left-qA0Qer2h.js";import{M as R}from"./message-square-D5VWlv-Q.js";import{S as _}from"./send-C2XDuRPf.js";import"./clsx-B-dksMZM.js";import"./chevron-right-CQ1NTOtd.js";function b(a){const i=Math.floor((Date.now()-new Date(a).getTime())/1e3);return i<60?`${i}s`:i<3600?`${Math.floor(i/60)}m`:i<86400?`${Math.floor(i/3600)}h`:`${Math.floor(i/86400)}d`}const F={critical:"text-error",high:"text-warning",medium:"text-accent",low:"text-text-muted"},J=["backlog","todo","in_progress","in_review","done","blocked","cancelled"];function te(){const{id:a}=D(),i=$(),[s,o]=r.useState(null),[l,k]=r.useState([]),[I,P]=r.useState(!0),[g,f]=r.useState(null),[A,x]=r.useState(!1),[m,u]=r.useState(""),[n,j]=r.useState(""),[E,y]=r.useState(!1),[v,T]=r.useState(""),p=r.useCallback(async()=>{if(a){try{const t=await B(a);o(t),u(t.title);try{const d=await S(`/api/command-post/issues/${a}/comments`);d.ok&&k(await d.json())}catch{}f(null)}catch(t){f(t instanceof Error?t.message:"Failed to load issue")}P(!1)}},[a]);r.useEffect(()=>{p()},[p]),r.useEffect(()=>{s!=null&&s.id&&M(s.id).then(t=>T(t.ancestry)).catch(()=>{})},[s==null?void 0:s.id]);const z=async t=>{if(!(!a||!s))try{const d=await C(a,{status:t});o(d)}catch{}},N=async()=>{if(!(!a||!s||!m.trim()))try{const t=await C(a,{title:m.trim()});o(t),x(!1)}catch{}},w=async()=>{if(!(!a||!n.trim())){y(!0);try{await S(`/api/command-post/issues/${a}/comments`,{method:"POST",body:JSON.stringify({body:n.trim()})}),j(""),await p()}catch{}y(!1)}};return I?e.jsxs("div",{className:"space-y-6",children:[e.jsx(h,{title:"Issue",breadcrumbs:[{label:"Command Post"},{label:"Issues",href:"/command-post/issues"},{label:"..."}]}),e.jsx(U,{variant:"card",count:1})]}):g||!s?e.jsxs("div",{className:"space-y-6",children:[e.jsx(h,{title:"Issue",breadcrumbs:[{label:"Command Post"},{label:"Issues",href:"/command-post/issues"},{label:"Error"}]}),e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-error text-sm mb-4",children:g??"Issue not found"}),e.jsx(c,{variant:"secondary",size:"sm",onClick:()=>i("/command-post/issues"),children:"Back to Issues"})]})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(h,{title:s.identifier,breadcrumbs:[{label:"Command Post"},{label:"Issues",href:"/command-post/issues"},{label:s.identifier}],actions:e.jsxs(L,{to:"/command-post/issues",className:"flex items-center gap-1 text-xs text-text-muted hover:text-text",children:[e.jsx(K,{size:14})," Back"]})}),v&&e.jsx("div",{className:"bg-bg-tertiary/30 border border-border rounded-lg px-4 py-3 mb-4",children:e.jsx("pre",{className:"text-xs text-text-secondary whitespace-pre-wrap font-mono leading-relaxed",children:v})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-4",children:[A?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{className:"flex-1 rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-base font-semibold text-text focus:outline-none focus:border-accent",value:m,onChange:t=>u(t.target.value),onKeyDown:t=>t.key==="Enter"&&N(),autoFocus:!0}),e.jsx(c,{size:"sm",onClick:N,children:"Save"}),e.jsx(c,{size:"sm",variant:"ghost",onClick:()=>{x(!1),u(s.title)},children:"Cancel"})]}):e.jsx("h2",{className:"text-lg font-semibold text-text cursor-pointer hover:text-accent transition-colors",onClick:()=>x(!0),title:"Click to edit",children:s.title}),s.description&&e.jsx("p",{className:"mt-3 text-sm text-text-secondary whitespace-pre-wrap",children:s.description})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:J.map(t=>e.jsx("button",{onClick:()=>z(t),disabled:s.status===t,className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors border ${s.status===t?"border-accent bg-accent/10 text-accent":"border-border bg-bg-tertiary text-text-muted hover:text-text hover:border-border-light"}`,children:t.replace(/_/g," ")},t))}),e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[e.jsx(R,{size:14,className:"text-accent"}),e.jsx("h3",{className:"text-sm font-semibold text-text",children:"Comments"}),e.jsxs("span",{className:"text-xs text-text-muted",children:["(",l.length,")"]})]}),l.length===0?e.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No comments yet"}):e.jsx("div",{className:"divide-y divide-border max-h-96 overflow-y-auto",children:l.map(t=>e.jsxs("div",{className:"px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-xs font-medium text-text",children:t.authorAgentId??t.authorUser??"Unknown"}),e.jsxs("span",{className:"text-[10px] text-text-muted",children:[b(t.createdAt)," ago"]})]}),e.jsx("p",{className:"text-sm text-text-secondary whitespace-pre-wrap",children:t.body})]},t.id))}),e.jsxs("div",{className:"border-t border-border px-4 py-3 flex items-center gap-2",children:[e.jsx("input",{className:"flex-1 rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:"Add a comment...",value:n,onChange:t=>j(t.target.value),onKeyDown:t=>t.key==="Enter"&&!t.shiftKey&&w()}),e.jsx(c,{size:"sm",onClick:w,loading:E,disabled:!n.trim(),icon:e.jsx(_,{size:14}),children:"Send"})]})]})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Status"}),e.jsx("div",{className:"mt-1",children:e.jsx(O,{status:s.status})})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Priority"}),e.jsx("div",{className:`mt-1 text-sm font-medium capitalize ${F[s.priority]??"text-text"}`,children:s.priority})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Assignee"}),e.jsx("div",{className:"mt-1 text-sm text-text-secondary",children:s.assigneeAgentId??"Unassigned"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Identifier"}),e.jsx("div",{className:"mt-1 text-sm text-text font-mono",children:s.identifier})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Created"}),e.jsxs("div",{className:"mt-1 text-sm text-text-secondary",children:[b(s.createdAt)," ago"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Updated"}),e.jsxs("div",{className:"mt-1 text-sm text-text-secondary",children:[b(s.updatedAt)," ago"]})]})]})})]})]})}export{te as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,y as k,j as e,D as T,F as P}from"./index-CUgepw5Q.js";import{B as u}from"./Input-CbrMbLgn.js";import{S as D}from"./StatusBadge-JpCoA33_.js";import{P as z}from"./PageHeader-bnc85wQN.js";import{E}from"./EmptyState-CfvU7SdB.js";import{T as L}from"./Tabs-DJHu-roP.js";import{M}from"./Modal-BmS7C6FN.js";import{S as $}from"./SkeletonLoader-Cax7YTqW.js";import{P as A}from"./plus-BSjTdepW.js";import{L as B}from"./list-todo-CDDhmPQB.js";import"./clsx-B-dksMZM.js";import"./chevron-right-CQ1NTOtd.js";import"./proxy-CWET5FFX.js";function R(a){const r=Math.floor((Date.now()-new Date(a).getTime())/1e3);return r<60?`${r}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}const _={critical:"text-error",high:"text-warning",medium:"text-accent",low:"text-text-muted"},F=[{id:"all",label:"All"},{id:"backlog",label:"Backlog"},{id:"todo",label:"Todo"},{id:"in_progress",label:"In Progress"},{id:"in_review",label:"In Review"},{id:"done",label:"Done"},{id:"blocked",label:"Blocked"}];function ee(){const[a,r]=s.useState([]),[c,w]=s.useState(!0),[l,m]=s.useState(null),[o,y]=s.useState("all"),[v,i]=s.useState(!1),[n,h]=s.useState(""),[p,b]=s.useState("medium"),[f,g]=s.useState(""),[C,j]=s.useState(!1),d=s.useCallback(async()=>{try{const t=await k();r(t),m(null)}catch(t){m(t instanceof Error?t.message:"Failed to load issues")}w(!1)},[]);s.useEffect(()=>{d()},[d]);const N=async()=>{if(n.trim()){j(!0);try{await P({title:n,description:f,priority:p}),i(!1),h(""),g(""),b("medium"),await d()}catch{}j(!1)}},x=o==="all"?a:a.filter(t=>t.status===o),S=F.map(t=>({...t,count:t.id==="all"?a.length:a.filter(I=>I.status===t.id).length}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx(z,{title:"Issues",breadcrumbs:[{label:"Command Post"},{label:"Issues"}],actions:e.jsx(u,{size:"sm",icon:e.jsx(A,{size:14}),onClick:()=>i(!0),children:"New Issue"})}),e.jsx(L,{tabs:S,activeTab:o,onChange:y}),c&&e.jsx($,{variant:"row",count:6}),l&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:l}),!c&&!l&&x.length===0&&e.jsx(E,{icon:e.jsx(B,{size:32}),title:"No issues",description:o==="all"?"Create your first issue to get started.":`No ${o.replace(/_/g," ")} issues.`,action:{label:"New Issue",onClick:()=>i(!0)}}),!c&&!l&&x.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:x.map(t=>e.jsxs(T,{to:`/command-post/issues/${t.id}`,className:"flex items-center gap-3 px-4 py-3 hover:bg-bg-tertiary/50 transition-colors",children:[e.jsx(D,{status:t.status,variant:"dot",size:"sm"}),e.jsx("span",{className:"text-sm text-text flex-1 truncate",children:t.title}),e.jsx("span",{className:`text-xs font-medium uppercase ${_[t.priority]??"text-text-muted"}`,children:t.priority}),t.assigneeAgentId&&e.jsx("span",{className:"text-xs text-text-muted truncate max-w-[100px]",children:t.assigneeAgentId}),e.jsx("span",{className:"text-xs text-text-muted font-mono",children:t.identifier}),e.jsx("span",{className:"text-xs text-text-muted flex-shrink-0",children:R(t.updatedAt)})]},t.id))}),e.jsx(M,{open:v,onClose:()=>i(!1),title:"New Issue",footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",size:"sm",onClick:()=>i(!1),children:"Cancel"}),e.jsx(u,{size:"sm",onClick:N,loading:C,disabled:!n.trim(),children:"Create"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Title"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:"Issue title...",value:n,onChange:t=>h(t.target.value),autoFocus:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Priority"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:p,onChange:t=>b(t.target.value),children:[e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"critical",children:"Critical"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Description"}),e.jsx("textarea",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent min-h-[80px] resize-y",placeholder:"Describe the issue...",value:f,onChange:t=>g(t.target.value)})]})]})})]})}export{ee as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CommandPostHub-z55Yrhj1.js","assets/index-CUgepw5Q.js","assets/index-Dm6zcSTS.css","assets/Input-CbrMbLgn.js","assets/clsx-B-dksMZM.js","assets/Modal-BmS7C6FN.js","assets/proxy-CWET5FFX.js","assets/InlineEditableField-mBzpbcLB.js","assets/check-DgyDEFtq.js","assets/pencil-D_YwQBeg.js","assets/Tooltip-B1LhTXJ8.js","assets/approvalHeadline-DB9SgR-9.js","assets/chevron-right-CQ1NTOtd.js","assets/bot-CvIF1uHi.js","assets/pause-BukaK6rs.js","assets/dollar-sign-LDRZBae6.js","assets/git-branch-BcXabeOs.js","assets/chart-column-BQiM-Td4.js","assets/clock-CF9BCIpL.js","assets/message-square-D5VWlv-Q.js","assets/file-text-DrdTDEYp.js","assets/terminal-B8IK4WsO.js","assets/refresh-cw-CwDpzXUn.js","assets/circle-stop-C-8xGv0n.js","assets/send-C2XDuRPf.js","assets/plus-BSjTdepW.js","assets/trash-2-B1C85ePK.js","assets/CPIssues-BgpQOISw.js","assets/StatusBadge-JpCoA33_.js","assets/PageHeader-bnc85wQN.js","assets/EmptyState-CfvU7SdB.js","assets/Tabs-DJHu-roP.js","assets/SkeletonLoader-Cax7YTqW.js","assets/list-todo-CDDhmPQB.js","assets/CPIssueDetail-DaMMGbjw.js","assets/arrow-left-qA0Qer2h.js","assets/CPAgents-BTZuGnki.js","assets/CPAgentDetail-Bb9-GAJY.js","assets/circle-check-big-CAFcaPPH.js","assets/save-CjTPAQM0.js","assets/CPApprovals-BME2ARkO.js","assets/shield-check-s7la2J2K.js","assets/CPActivity-BYDsUoMn.js","assets/CPGoals-BNWhNP14.js","assets/CPRuns-DB8S7loF.js","assets/play-BjdwtYMk.js","assets/CPCosts-mOXwWq0i.js","assets/CPOrg-C8l5SIWJ.js","assets/network-DaJ7ugwX.js","assets/CPFiles-BO73EZwJ.js","assets/folder-BeZZUGnK.js","assets/flask-conical-BGn5PgFX.js","assets/search-BP7VlNxX.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as t,r as s,q as _,v as e,N as l,_ as o}from"./index-CUgepw5Q.js";const a=s.lazy(()=>o(()=>import("./CommandPostHub-z55Yrhj1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]))),i=s.lazy(()=>o(()=>import("./CPIssues-BgpQOISw.js"),__vite__mapDeps([27,1,2,3,4,28,29,12,30,31,5,6,32,25,33]))),r=s.lazy(()=>o(()=>import("./CPIssueDetail-DaMMGbjw.js"),__vite__mapDeps([34,1,2,3,4,28,29,12,32,35,19,24]))),n=s.lazy(()=>o(()=>import("./CPAgents-BTZuGnki.js"),__vite__mapDeps([36,1,2,3,4,28,29,12,30,32]))),x=s.lazy(()=>o(()=>import("./CPAgentDetail-Bb9-GAJY.js"),__vite__mapDeps([37,1,2,3,4,28,29,12,30,31,32,35,38,15,18,39]))),m=s.lazy(()=>o(()=>import("./CPApprovals-BME2ARkO.js"),__vite__mapDeps([40,1,2,3,4,28,29,12,30,31,32,11,41,8]))),j=s.lazy(()=>o(()=>import("./CPActivity-BYDsUoMn.js"),__vite__mapDeps([42,1,2,3,4,29,12,30,31,32,41,15,13]))),p=s.lazy(()=>o(()=>import("./CPGoals-BNWhNP14.js"),__vite__mapDeps([43,1,2,3,4,28,29,12,30,5,6,32,25,26]))),u=s.lazy(()=>o(()=>import("./CPRuns-DB8S7loF.js"),__vite__mapDeps([44,1,2,3,4,28,29,12,30,32,45]))),c=s.lazy(()=>o(()=>import("./CPCosts-mOXwWq0i.js"),__vite__mapDeps([46,1,2,3,4,28,29,12,30,5,6,32,25,15,26]))),d=s.lazy(()=>o(()=>import("./CPOrg-C8l5SIWJ.js"),__vite__mapDeps([47,1,2,3,4,28,29,12,30,32,48,26]))),P=s.lazy(()=>o(()=>import("./CPFiles-BO73EZwJ.js"),__vite__mapDeps([49,1,2,29,12,50,51,52,22,20])));function E(){return t.jsx("div",{className:"flex items-center justify-center h-full text-sm",style:{color:"#c4b49a"},children:"Loading..."})}function h(){return t.jsx("div",{className:"h-full overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(s.Suspense,{fallback:t.jsx(E,{}),children:t.jsxs(_,{children:[t.jsx(e,{index:!0,element:t.jsx(a,{})}),t.jsx(e,{path:"dashboard",element:t.jsx(a,{})}),t.jsx(e,{path:"issues",element:t.jsx(i,{})}),t.jsx(e,{path:"issues/:id",element:t.jsx(r,{})}),t.jsx(e,{path:"agents",element:t.jsx(n,{})}),t.jsx(e,{path:"agents/:id",element:t.jsx(x,{})}),t.jsx(e,{path:"approvals",element:t.jsx(m,{})}),t.jsx(e,{path:"activity",element:t.jsx(j,{})}),t.jsx(e,{path:"goals",element:t.jsx(p,{})}),t.jsx(e,{path:"runs",element:t.jsx(u,{})}),t.jsx(e,{path:"costs",element:t.jsx(c,{})}),t.jsx(e,{path:"org",element:t.jsx(d,{})}),t.jsx(e,{path:"files",element:t.jsx(P,{})}),t.jsx(e,{path:"*",element:t.jsx(l,{to:"/command-post",replace:!0})})]})})})})}export{h as CPLayout,h as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{r as i,a0 as u,a1 as b,j as e}from"./index-CUgepw5Q.js";import"./Input-CbrMbLgn.js";import{S as j}from"./StatusBadge-JpCoA33_.js";import{P as f}from"./PageHeader-bnc85wQN.js";import{E as v}from"./EmptyState-CfvU7SdB.js";import{S as y}from"./SkeletonLoader-Cax7YTqW.js";import{N}from"./network-DaJ7ugwX.js";import{T as C}from"./trash-2-B1C85ePK.js";import"./clsx-B-dksMZM.js";import"./chevron-right-CQ1NTOtd.js";function w(t){const s=t.split("/");return s[s.length-1]}function x({node:t,depth:s,onDelete:o}){const l=t.role==="Company";return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-start gap-3 py-2",style:{paddingLeft:`${s*32+16}px`},children:[s>0&&e.jsx("div",{className:"flex items-center gap-0 -ml-5",children:e.jsx("div",{className:"w-4 border-t border-border-light"})}),e.jsxs("div",{className:`border rounded-lg p-3 flex-1 max-w-sm transition-colors group ${l?"bg-accent/5 border-accent/20 hover:border-accent/40":"bg-bg-secondary border-border hover:border-border-light"}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-text",children:t.name}),e.jsx(j,{status:t.status,size:"sm"})]}),l&&o&&e.jsx("button",{onClick:a=>{a.stopPropagation(),o(t.id,t.name)},className:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-error/20 text-text-muted hover:text-error transition-all",title:`Delete ${t.name}`,children:e.jsx(C,{size:14})})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[l&&e.jsx("span",{className:"text-accent text-[9px] font-medium uppercase tracking-wider",children:"Company"}),!l&&e.jsx("span",{className:"capitalize",children:t.role}),t.title&&e.jsx("span",{children:t.title}),t.model&&e.jsx("span",{children:w(t.model)})]}),l&&t.reports.length>0&&e.jsxs("div",{className:"text-[10px] text-text-muted mt-1",children:[t.reports.length," agent",t.reports.length!==1?"s":""]})]})]}),t.reports.length>0&&e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute border-l border-border-light",style:{left:`${(s+1)*32+16}px`,top:0,height:"100%"}}),t.reports.map(a=>e.jsx(x,{node:a,depth:s+1,onDelete:o},a.id))]})]})}function A(){const[t,s]=i.useState([]),[o,l]=i.useState(!0),[a,c]=i.useState(null),[p,m]=i.useState(null),n=i.useCallback(async()=>{try{const r=await u();s(r),c(null)}catch(r){c(r instanceof Error?r.message:"Failed to load org chart")}l(!1)},[]);i.useEffect(()=>{n()},[n]);const g=i.useCallback(async(r,h)=>{if(confirm(`Delete company "${h}"?
|
|
2
|
-
|
|
3
|
-
This will:
|
|
4
|
-
• Stop the heartbeat runner
|
|
5
|
-
• Archive all agents
|
|
6
|
-
• Archive all goals and issues
|
|
7
|
-
|
|
8
|
-
This cannot be undone.`)){m(r);try{await b(r),await n()}catch(d){alert(`Failed to delete: ${d instanceof Error?d.message:"Unknown error"}`)}m(null)}},[n]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(f,{title:"Organization Chart",breadcrumbs:[{label:"Command Post"},{label:"Org Chart"}]}),o&&e.jsx(y,{variant:"row",count:5}),a&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:a}),!o&&!a&&t.length===0&&e.jsx(v,{icon:e.jsx(N,{size:32}),title:"No org structure",description:"Register agents or create companies to see the org chart."}),!o&&!a&&t.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4 overflow-x-auto",children:[t.map(r=>e.jsx(x,{node:r,depth:0,onDelete:g},r.id)),p&&e.jsx("div",{className:"text-xs text-text-muted text-center py-2 animate-pulse",children:"Deleting..."})]})]})}export{A as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,Y as h,$ as f,j as e}from"./index-CUgepw5Q.js";import"./Input-CbrMbLgn.js";import{S as j}from"./StatusBadge-JpCoA33_.js";import{P as g}from"./PageHeader-bnc85wQN.js";import{E as y}from"./EmptyState-CfvU7SdB.js";import{S as b}from"./SkeletonLoader-Cax7YTqW.js";import{P as N}from"./play-BjdwtYMk.js";import"./clsx-B-dksMZM.js";import"./chevron-right-CQ1NTOtd.js";function v(s){const r=Math.floor((Date.now()-new Date(s).getTime())/1e3);return r<60?`${r}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}function S(s){return s?s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}m`:"-"}function D(){const[s,r]=a.useState([]),[x,m]=a.useState([]),[n,d]=a.useState(!0),[o,i]=a.useState(null),[l,u]=a.useState(""),c=a.useCallback(async()=>{try{const[t,p]=await Promise.all([h(l||void 0,100),f()]);r(t),m(p),i(null)}catch(t){i(t instanceof Error?t.message:"Failed to load runs")}d(!1)},[l]);return a.useEffect(()=>{d(!0),c()},[c]),e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{title:"Runs",breadcrumbs:[{label:"Command Post"},{label:"Runs"}],actions:e.jsxs("select",{className:"rounded-lg border border-border bg-bg-tertiary px-3 py-1.5 text-xs text-text focus:outline-none focus:border-accent",value:l,onChange:t=>u(t.target.value),children:[e.jsx("option",{value:"",children:"All agents"}),x.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]})}),n&&e.jsx(b,{variant:"row",count:8}),o&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:o}),!n&&!o&&s.length===0&&e.jsx(y,{icon:e.jsx(N,{size:32}),title:"No runs",description:"Agent runs will appear here as they execute."}),!n&&!o&&s.length>0&&e.jsx("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-left",children:[e.jsx("th",{className:"px-4 py-2.5 text-text-muted font-medium",children:"Agent"}),e.jsx("th",{className:"px-4 py-2.5 text-text-muted font-medium",children:"Source"}),e.jsx("th",{className:"px-4 py-2.5 text-text-muted font-medium",children:"Status"}),e.jsx("th",{className:"px-4 py-2.5 text-text-muted font-medium",children:"Duration"}),e.jsx("th",{className:"px-4 py-2.5 text-text-muted font-medium",children:"Tools"}),e.jsx("th",{className:"px-4 py-2.5 text-text-muted font-medium",children:"Started"})]})}),e.jsx("tbody",{className:"divide-y divide-border",children:s.map(t=>e.jsxs("tr",{className:"hover:bg-bg-tertiary/50 transition-colors",children:[e.jsx("td",{className:"px-4 py-2.5 text-text font-medium",children:t.agentId}),e.jsx("td",{className:"px-4 py-2.5 text-text-secondary capitalize",children:t.source}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx(j,{status:t.status,size:"sm"})}),e.jsx("td",{className:"px-4 py-2.5 text-text-secondary font-mono",children:S(t.durationMs)}),e.jsx("td",{className:"px-4 py-2.5 text-text-muted",children:t.toolsUsed.length>0?e.jsxs("span",{title:t.toolsUsed.join(", "),children:[t.toolsUsed.length," tool",t.toolsUsed.length!==1?"s":""]}):"-"}),e.jsxs("td",{className:"px-4 py-2.5 text-text-muted",children:[v(t.startedAt)," ago"]})]},t.id))})]})})})]})}export{D as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as t,b as N}from"./index-CUgepw5Q.js";import"./Input-CbrMbLgn.js";import{P as k}from"./PageHeader-bnc85wQN.js";import{C as S}from"./circle-stop-C-8xGv0n.js";import{M as C}from"./mic-Ddcc6Ann.js";import{V as b}from"./volume-2-DMaE91b5.js";import{S as T}from"./send-C2XDuRPf.js";import"./clsx-B-dksMZM.js";import"./chevron-right-CQ1NTOtd.js";async function R(o,l){const c=await N(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!c.ok)throw new Error(`HTTP ${c.status}`);return c.json()}function I(){const[o,l]=i.useState(""),[c,u]=i.useState([]),[h,d]=i.useState(!1),[p,j]=i.useState(!0),m=i.useRef(null),a=i.useRef(null);i.useEffect(()=>{const e=window.SpeechRecognition||window.webkitSpeechRecognition;if(e){const s=new e;s.lang="en-US",s.continuous=!1,s.interimResults=!1,s.onresult=r=>{var n,g;const x=((g=(n=r.results[0])==null?void 0:n[0])==null?void 0:g.transcript)||"";l(x),d(!1)},s.onerror=()=>d(!1),s.onend=()=>d(!1),m.current=s}},[]);const f=async()=>{const e=o.trim();if(!e)return;const s={id:`e-${Date.now()}`,question:e,loading:!0,at:new Date().toISOString()};u(r=>[s,...r].slice(0,20)),l("");try{const r=await R("/api/voice/ask",{question:e,voice:"default",speak:p});u(x=>x.map(n=>n.id===s.id?{...n,loading:!1,answer:r.answer,activeDrivers:r.activeDrivers,ttsUrl:r.ttsUrl}:n)),r.ttsUrl&&p&&a.current&&(a.current.src=r.ttsUrl,a.current.play().catch(()=>{}))}catch(r){u(x=>x.map(n=>n.id===s.id?{...n,loading:!1,error:r.message}:n))}},v=()=>{const e=m.current;if(!e){alert("Speech recognition not supported in this browser. Use Chrome.");return}try{e.start(),d(!0)}catch{}},w=()=>{const e=m.current;e&&e.stop(),d(!1)},y=!!(window.SpeechRecognition||window.webkitSpeechRecognition);return t.jsxs("div",{className:"space-y-4 flex flex-col h-[calc(100vh-180px)]",children:[t.jsx(k,{title:"Voice Ask",breadcrumbs:[{label:"Command Post"},{label:"Voice"}]}),t.jsx("audio",{ref:a}),t.jsxs("div",{className:"flex items-center gap-2 bg-bg-secondary border border-border rounded-xl px-3 py-2",children:[y&&(h?t.jsx("button",{onClick:w,className:"p-2 rounded bg-error/20 text-error hover:bg-error/30",title:"Stop listening",children:t.jsx(S,{size:18})}):t.jsx("button",{onClick:v,className:"p-2 rounded hover:bg-bg-tertiary text-text-muted",title:"Voice input (Chrome only)",children:t.jsx(C,{size:18})})),t.jsx("input",{value:o,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),f())},placeholder:h?"Listening…":'Ask TITAN — "What are you working on?" or give it instructions',className:"flex-1 bg-transparent text-sm outline-none"}),t.jsx("button",{onClick:()=>j(e=>!e),className:`p-2 rounded hover:bg-bg-tertiary ${p?"text-accent":"text-text-muted"}`,title:`TTS ${p?"ON":"OFF"}`,children:t.jsx(b,{size:16})}),t.jsxs("button",{onClick:f,disabled:!o.trim(),className:"px-3 py-1.5 rounded bg-accent/20 border border-accent/40 text-accent text-sm hover:bg-accent/30 disabled:opacity-50 flex items-center gap-1",children:[t.jsx(T,{size:14})," Ask"]})]}),t.jsxs("div",{className:"flex-1 overflow-auto space-y-3",children:[c.length===0&&t.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:'Ask a question to start. TITAN has driver-aware chat, so "what are you doing?" gets a real answer.'}),c.map(e=>t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-xs text-text-muted mt-1 flex-shrink-0 w-10",children:"You"}),t.jsx("div",{className:"text-sm text-text",children:e.question})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-xs text-accent mt-1 flex-shrink-0 w-10",children:"TITAN"}),t.jsxs("div",{className:"text-sm text-text-secondary flex-1",children:[e.loading&&t.jsx("span",{className:"text-text-muted",children:"thinking…"}),e.error&&t.jsxs("span",{className:"text-error",children:["error: ",e.error]}),e.answer&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"whitespace-pre-wrap",children:e.answer}),t.jsxs("div",{className:"text-[11px] text-text-muted flex items-center gap-2",children:[t.jsxs("span",{children:["drivers: ",e.activeDrivers??"?"]}),e.ttsUrl&&t.jsxs("button",{onClick:()=>{a.current&&(a.current.src=e.ttsUrl,a.current.play().catch(()=>{}))},className:"text-accent hover:underline flex items-center gap-0.5",children:[t.jsx(b,{size:10})," play"]})]})]})]})]})]},e.id))]})]})}export{I as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,bE as l,j as e,bF as d}from"./index-CUgepw5Q.js";import{P as m}from"./PageHeader-bnc85wQN.js";import{R as h}from"./refresh-cw-CwDpzXUn.js";import{S as x}from"./save-CjTPAQM0.js";import{T as p}from"./trash-2-B1C85ePK.js";import"./chevron-right-CQ1NTOtd.js";function k(){const[c,n]=a.useState([]),[i,r]=a.useState(!0),t=a.useCallback(async()=>{r(!0);try{const s=await l();n(s.checkpoints||[])}catch{}r(!1)},[]);a.useEffect(()=>{t()},[t]);const o=async s=>{if(confirm("Delete this checkpoint?"))try{await d(s),await t()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(m,{title:"Checkpoints",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"Checkpoints"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:t,disabled:i,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(h,{className:`w-4 h-4 ${i?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:c.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(x,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm text-[#e4e4e7]",children:[s.sessionId.slice(0,16),"..."]}),e.jsx("div",{className:"text-xs text-[#52525b]",children:new Date(s.createdAt).toLocaleString()})]})]}),e.jsx("button",{onClick:()=>o(s.sessionId),className:"p-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] hover:bg-[#3f3f46] hover:text-red-400",children:e.jsx(p,{className:"w-3.5 h-3.5"})})]},s.sessionId))})]})}export{k as default};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkTab-iptofXO9.js","assets/index-CUgepw5Q.js","assets/index-Dm6zcSTS.css","assets/proxy-CWET5FFX.js","assets/external-link-D_ji4Bec.js","assets/rotate-ccw-7SQDTI0_.js","assets/plus-BSjTdepW.js","assets/play-BjdwtYMk.js","assets/trash-2-B1C85ePK.js","assets/pause-BukaK6rs.js","assets/SessionsTab-B3eHV3jf.js","assets/CPInbox-ybe4r8LW.js","assets/Input-CbrMbLgn.js","assets/clsx-B-dksMZM.js","assets/PageHeader-bnc85wQN.js","assets/chevron-right-CQ1NTOtd.js","assets/EmptyState-CfvU7SdB.js","assets/Tabs-DJHu-roP.js","assets/SkeletonLoader-Cax7YTqW.js","assets/approvalHeadline-DB9SgR-9.js","assets/message-square-D5VWlv-Q.js","assets/bot-CvIF1uHi.js","assets/clock-CF9BCIpL.js","assets/send-C2XDuRPf.js","assets/shield-check-s7la2J2K.js","assets/check-DgyDEFtq.js","assets/funnel-CAJgGO5M.js","assets/chevron-up-UyfdjRp6.js","assets/CPFiles-BO73EZwJ.js","assets/folder-BeZZUGnK.js","assets/flask-conical-BGn5PgFX.js","assets/search-BP7VlNxX.js","assets/refresh-cw-CwDpzXUn.js","assets/file-text-DrdTDEYp.js","assets/TraceViewer-Bh8Jo3Dr.js","assets/trending-up-DDGHQZY1.js","assets/git-branch-BcXabeOs.js","assets/chart-column-BQiM-Td4.js","assets/arrow-left-qA0Qer2h.js","assets/CPSocial-Qw5rKy_4.js","assets/lightbulb-B0Du4SM4.js","assets/CPDashboard-CTlKGXXQ.js","assets/StatusBadge-JpCoA33_.js","assets/list-todo-CDDhmPQB.js","assets/dollar-sign-LDRZBae6.js","assets/CPGoals-BNWhNP14.js","assets/Modal-BmS7C6FN.js","assets/CPAgents-BTZuGnki.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as O,r as s,j as e,aM as ie,k as E,l as L,A as I,K as G,Y as te,b7 as ce,W as se,w as de,T as xe,h as ae,U as ue,s as me,_ as A,b as W,a0 as pe,b8 as he,z as be,y as ge,a3 as je,b9 as ve,ba as fe,a1 as ye,O as Ne,P as we,F as Ce,bb as $,bc as ke,bd as Se,be as ze,a4 as Te,bf as Ae,bg as De}from"./index-CUgepw5Q.js";import{B as Q}from"./Input-CbrMbLgn.js";import{M as _}from"./Modal-BmS7C6FN.js";import{I as D}from"./InlineEditableField-mBzpbcLB.js";import{H as Pe}from"./Tooltip-B1LhTXJ8.js";import{e as _e}from"./approvalHeadline-DB9SgR-9.js";import{C as Y}from"./chevron-right-CQ1NTOtd.js";import{B as $e}from"./bot-CvIF1uHi.js";import{P as Ie}from"./pause-BukaK6rs.js";import{D as K}from"./dollar-sign-LDRZBae6.js";import{G as re}from"./git-branch-BcXabeOs.js";import{C as ne}from"./chart-column-BQiM-Td4.js";import{C as le}from"./clock-CF9BCIpL.js";import{M as H}from"./message-square-D5VWlv-Q.js";import{F as Me}from"./file-text-DrdTDEYp.js";import{T as Ee}from"./terminal-B8IK4WsO.js";import{R as Le}from"./refresh-cw-CwDpzXUn.js";import{C as Re}from"./circle-stop-C-8xGv0n.js";import{S as Fe}from"./send-C2XDuRPf.js";import{P as B}from"./plus-BSjTdepW.js";import{T as J}from"./trash-2-B1C85ePK.js";import"./clsx-B-dksMZM.js";import"./proxy-CWET5FFX.js";import"./check-DgyDEFtq.js";import"./pencil-D_YwQBeg.js";/**
|
|
3
|
-
* @license lucide-react v0.513.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const Oe=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],R=O("briefcase",Oe);/**
|
|
8
|
-
* @license lucide-react v0.513.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const Be=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],X=O("building-2",Be);/**
|
|
13
|
-
* @license lucide-react v0.513.0 - ISC
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the ISC license.
|
|
16
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const Ue=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Ve=O("mail",Ue);/**
|
|
18
|
-
* @license lucide-react v0.513.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/const We=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],oe=O("scale",We);function Z({open:t,title:x,message:l,confirmLabel:b="Confirm",cancelLabel:i="Cancel",variant:v="danger",onConfirm:m,onCancel:c}){const[g,p]=s.useState(!1),a=async()=>{p(!0);try{await m()}finally{p(!1)}};return e.jsx(_,{open:t,onClose:()=>!g&&c(),title:x,size:"sm",footer:e.jsxs(e.Fragment,{children:[e.jsx(Q,{variant:"ghost",size:"sm",onClick:c,disabled:g,children:i}),e.jsx(Q,{variant:v==="danger"?"danger":"primary",size:"sm",onClick:a,loading:g,children:b})]}),children:e.jsx("div",{className:"text-sm text-text-secondary leading-relaxed",children:l})})}function He(t){switch(t){case"active":return e.jsx(I,{size:12,className:"text-success animate-pulse"});case"paused":return e.jsx(Ie,{size:12,className:"text-warning"});case"error":return e.jsx(G,{size:12,className:"text-error"});default:return e.jsx($e,{size:12,className:"text-text-muted"})}}function qe(t){switch(t){case"active":return"border-success/30 bg-success/5";case"paused":return"border-warning/30 bg-warning/5";case"error":return"border-error/30 bg-error/5";default:return"border-border bg-bg-secondary"}}function Ge({agents:t,runs:x,collapsed:l=!1,onToggle:b,onAgentClick:i}){const[v,m]=s.useState(null);return l?e.jsxs("div",{className:"w-10 border-l border-border bg-bg-secondary flex flex-col items-center py-3 gap-3 shrink-0",children:[e.jsx("button",{onClick:b,className:"p-1.5 rounded hover:bg-bg-tertiary text-text-muted",children:e.jsx(ie,{size:14})}),t.map(c=>e.jsxs("button",{className:"relative",title:c.name,onClick:()=>i==null?void 0:i(c),children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-bold ${c.status==="error"?"bg-error/20 text-error":c.status==="active"?"bg-success/20 text-success":"bg-bg-tertiary text-text-muted"}`,children:c.name.charAt(0).toUpperCase()}),c.status==="active"&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-success animate-pulse"})]},c.id))]}):e.jsxs("div",{className:"w-64 border-l border-border bg-bg-secondary flex flex-col h-full shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[e.jsx("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Agents"}),e.jsx("button",{onClick:b,className:"p-1 rounded hover:bg-bg-tertiary text-text-muted",children:e.jsx(Y,{size:14})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-2",children:[t.length===0&&e.jsx("div",{className:"text-center py-4 text-xs text-text-muted",children:"No agents registered"}),t.map(c=>{var f;const g=v===c.id,p=x.filter(j=>j.agentId===c.id),a=p[0],d=p.filter(j=>j.status==="failed"||j.status==="error").length;return e.jsxs("div",{className:`rounded-lg border p-2 cursor-pointer transition-colors ${qe(c.status)}`,onClick:j=>{j.target.closest(".expand-toggle")?m(g?null:c.id):i==null||i(c)},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center text-[10px] font-bold ${c.status==="error"?"bg-error/20 text-error":c.status==="active"?"bg-success/20 text-success":"bg-bg-tertiary text-text-muted"}`,children:c.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-medium truncate",children:c.name}),e.jsxs("div",{className:"text-[10px] text-text-muted flex items-center gap-1",children:[He(c.status),e.jsx("span",{className:"capitalize",children:c.status}),c.model&&e.jsxs("span",{className:"truncate",children:["· ",c.model.split("/").pop()]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[c.status==="active"&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-success animate-pulse"}),e.jsx("button",{className:"expand-toggle p-0.5 rounded hover:bg-bg-tertiary text-text-muted",onClick:j=>{j.stopPropagation(),m(g?null:c.id)},children:e.jsx(Y,{size:12,className:`transition-transform ${g?"rotate-90":""}`})})]})]}),g&&e.jsxs("div",{className:"mt-2 space-y-2 border-t border-border/50 pt-2",children:[e.jsxs("div",{className:"text-[10px] text-text-muted space-y-0.5",children:[e.jsxs("div",{children:["Role: ",c.role||"general"]}),e.jsxs("div",{children:["Tasks: ",c.totalTasksCompleted??0," completed"]}),c.totalCostUsd!==void 0&&e.jsxs("div",{children:["Cost: $",c.totalCostUsd.toFixed(2)]}),d>0&&e.jsxs("div",{className:"text-error",children:[d," failed run",d===1?"":"s"]})]}),a&&e.jsxs("div",{className:"text-[10px] bg-bg rounded p-1.5 border border-border",children:[e.jsxs("div",{className:"font-medium text-text-secondary flex items-center gap-1",children:[a.status==="succeeded"?e.jsx(E,{size:10,className:"text-success"}):a.status==="failed"||a.status==="error"?e.jsx(L,{size:10,className:"text-error"}):e.jsx(I,{size:10,className:"text-cyan animate-pulse"}),"Latest run"]}),e.jsxs("div",{className:a.status==="failed"||a.status==="error"?"text-error":"text-success",children:[a.status," · ",((f=a.toolsUsed)==null?void 0:f.length)??0," tools"]}),a.error&&e.jsx("div",{className:"text-error truncate mt-0.5",children:a.error})]})]})]},c.id)})]})]})}function ee(t){const x={active:"bg-success/10 text-success border-success/20",idle:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",paused:"bg-warning/10 text-warning border-warning/20",error:"bg-error/10 text-error border-error/20",stopped:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"};return x[t]||x.idle}function V(t){const x=Math.floor((Date.now()-new Date(t).getTime())/1e3);return x<60?`${x}s`:x<3600?`${Math.floor(x/60)}m`:x<86400?`${Math.floor(x/3600)}h`:`${Math.floor(x/86400)}d`}function Ke({agent:t,onClose:x}){const[l,b]=s.useState([]),[i,v]=s.useState([]),[m,c]=s.useState(!0),[g,p]=s.useState(null),a=s.useCallback(async()=>{try{const[o,u]=await Promise.all([te(t.id,10),ce(20,void 0)]);b(o),v(u.traces||[])}catch{}c(!1)},[t.id]);s.useEffect(()=>{a();const o=setInterval(a,1e4);return()=>clearInterval(o)},[a]);const d=l[0],f=l.filter(o=>o.status==="failed"||o.status==="error"),j=l.reduce((o,u)=>o+u.toolsUsed.length,0);return e.jsx(_,{open:!0,onClose:x,size:"lg",title:t.name,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center text-lg font-bold border ${ee(t.status)}`,children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-text",children:t.name}),e.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full border capitalize ${ee(t.status)}`,children:t.status})]}),e.jsxs("div",{className:"text-[11px] text-text-muted mt-0.5",children:[t.title||t.role," · ",t.model.split("/").pop()," · heartbeat ",V(t.lastHeartbeat)," ago"]})]})]}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:[{icon:E,label:"Tasks",value:t.totalTasksCompleted,color:"text-success"},{icon:K,label:"Cost",value:`$${t.totalCostUsd.toFixed(2)}`,color:"text-warning"},{icon:se,label:"Tools",value:j,color:"text-accent"},{icon:L,label:"Failed",value:f.length,color:f.length>0?"text-error":"text-text-muted"}].map(o=>e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-lg p-2.5 text-center",children:[e.jsx(o.icon,{size:14,className:`mx-auto mb-1 ${o.color}`}),e.jsx("div",{className:"text-sm font-bold text-text",children:o.value}),e.jsx("div",{className:"text-[9px] text-text-muted uppercase tracking-wider",children:o.label})]},o.label))}),t.status==="active"&&d&&d.status==="running"&&e.jsxs("div",{className:"bg-success/5 border border-success/20 rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-success mb-1",children:[e.jsx(I,{size:12,className:"animate-pulse"}),e.jsx("span",{className:"font-medium",children:"Currently working"})]}),e.jsxs("div",{className:"text-[11px] text-text-secondary",children:["Run started ",V(d.startedAt)," ago · ",d.toolsUsed.length," tools used so far"]})]}),t.status==="error"&&(d==null?void 0:d.error)&&e.jsxs("div",{className:"bg-error/5 border border-error/20 rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-error mb-1",children:[e.jsx(G,{size:12}),e.jsx("span",{className:"font-medium",children:"Last error"})]}),e.jsx("div",{className:"text-[11px] text-text-secondary font-mono",children:d.error})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[e.jsx(re,{size:12,className:"text-accent"}),"Recent Runs"]}),e.jsxs("span",{className:"text-[10px] text-text-muted",children:[l.length," total"]})]}),m?e.jsx("div",{className:"space-y-1.5",children:[1,2,3].map(o=>e.jsx("div",{className:"h-10 rounded-lg bg-bg-secondary animate-pulse"},o))}):l.length===0?e.jsx("div",{className:"text-center py-4 text-[11px] text-text-muted",children:"No runs recorded yet"}):e.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto pr-1",children:l.map(o=>e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-2 rounded-lg bg-bg-secondary border border-border",children:[o.status==="succeeded"?e.jsx(E,{size:12,className:"text-success shrink-0"}):o.status==="failed"||o.status==="error"?e.jsx(L,{size:12,className:"text-error shrink-0"}):e.jsx(Je,{size:12,className:"text-cyan animate-spin shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-[11px] text-text-secondary truncate",children:[o.source," · ",o.toolsUsed.length," tools"]}),e.jsxs("div",{className:"text-[10px] text-text-muted",children:[o.durationMs?`${o.durationMs}ms`:"..."," · ",V(o.startedAt)," ago"]})]}),o.error&&e.jsx("span",{className:"text-[10px] text-error truncate max-w-[120px]",title:o.error,children:o.error})]},o.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[e.jsx(ne,{size:12,className:"text-accent"}),"Recent Traces"]}),e.jsxs("span",{className:"text-[10px] text-text-muted",children:[i.length," loaded"]})]}),i.length===0?e.jsx("div",{className:"text-center py-4 text-[11px] text-text-muted",children:"No traces available"}):e.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto pr-1",children:i.slice(0,10).map(o=>e.jsxs("button",{onClick:()=>p(o),className:"w-full text-left px-2.5 py-2 rounded-lg bg-bg-secondary border border-border hover:bg-bg-secondary/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[o.status==="running"?e.jsx(I,{size:12,className:"text-cyan animate-pulse shrink-0"}):o.status==="completed"?e.jsx(E,{size:12,className:"text-success shrink-0"}):e.jsx(L,{size:12,className:"text-error shrink-0"}),e.jsx("span",{className:"text-[11px] text-text-secondary truncate flex-1",children:o.message}),e.jsx("span",{className:"text-[10px] text-text-muted shrink-0",children:o.totalMs?`${o.totalMs}ms`:"..."})]}),e.jsxs("div",{className:"flex gap-2 mt-0.5 text-[10px] text-text-muted ml-5",children:[e.jsxs("span",{children:[o.toolCalls.length," tools"]}),e.jsxs("span",{children:[o.rounds," rounds"]}),o.error&&e.jsx("span",{className:"text-error truncate",children:o.error})]})]},o.traceId))})]}),g&&e.jsx(Ze,{trace:g,onClose:()=>p(null)})]})})}function Je({size:t,className:x}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",className:`animate-spin ${x||""}`,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",fill:"none",strokeDasharray:"31.4 31.4",opacity:"0.3"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",fill:"none"})]})}function Ze({trace:t,onClose:x}){return e.jsx(_,{open:!0,onClose:x,size:"md",title:`Trace ${t.traceId.slice(0,8)}`,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"text-xs text-text-secondary truncate",children:t.message}),e.jsxs("div",{className:"flex gap-3 text-[10px] text-text-muted",children:[e.jsx("span",{className:t.status==="completed"?"text-success":t.status==="failed"?"text-error":"text-cyan",children:t.status}),e.jsxs("span",{children:[t.totalMs,"ms"]}),e.jsxs("span",{children:[t.rounds," rounds"]}),t.model&&e.jsx("span",{children:t.model.split("/").pop()})]}),t.spans.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-muted mb-1",children:"Spans"}),e.jsx("div",{className:"space-y-1",children:t.spans.map((l,b)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx(le,{size:10,className:"text-text-muted shrink-0"}),e.jsx("span",{className:"text-text-secondary font-mono",children:l.name}),e.jsxs("span",{className:"text-text-muted",children:[l.durationMs,"ms"]})]},b))})]}),t.toolCalls.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-muted mb-1",children:"Tool Calls"}),e.jsx("div",{className:"space-y-1",children:t.toolCalls.map((l,b)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx(se,{size:10,className:l.success?"text-success":"text-error"}),e.jsx("span",{className:"text-text-secondary font-mono",children:l.tool}),e.jsxs("span",{className:"text-text-muted",children:[l.durationMs,"ms"]}),e.jsxs("span",{className:"text-text-muted",children:["round ",l.round]})]},b))})]}),t.error&&e.jsxs("div",{className:"bg-error/5 border border-error/20 rounded-lg p-2.5",children:[e.jsx("div",{className:"text-[10px] text-error uppercase tracking-wider mb-1",children:"Error"}),e.jsx("div",{className:"text-[11px] text-text-secondary font-mono",children:t.error})]})]})})}function T({label:t}){return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-accent/30 border-t-accent rounded-full animate-spin"}),e.jsxs("span",{className:"text-sm text-text-muted",children:["Loading ",t,"…"]})]})})}function F(t){const x=Math.floor((Date.now()-new Date(t).getTime())/1e3);return x<60?`${x}s`:x<3600?`${Math.floor(x/60)}m`:x<86400?`${Math.floor(x/3600)}h`:`${Math.floor(x/86400)}d`}function q({status:t}){const x={active:"bg-success/10 text-success",idle:"bg-warning/10 text-warning",running:"bg-cyan/10 text-cyan",paused:"bg-info/10 text-info",error:"bg-error/10 text-error",stopped:"bg-bg-tertiary text-text-muted",pending:"bg-warning/10 text-warning",approved:"bg-success/10 text-success",rejected:"bg-error/10 text-error",succeeded:"bg-success/10 text-success",failed:"bg-error/10 text-error",backlog:"bg-bg-tertiary text-text-muted",todo:"bg-info/10 text-info",in_progress:"bg-cyan/10 text-cyan",in_review:"bg-purple/10 text-purple-light",done:"bg-success/10 text-success",blocked:"bg-error/10 text-error",cancelled:"bg-bg-tertiary text-text-muted",critical:"bg-error/10 text-error",high:"bg-warning/10 text-warning",medium:"bg-warning/10 text-warning",low:"bg-bg-tertiary text-text-muted"},l=t||"unknown";return e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium ${x[l]||"bg-bg-tertiary text-text-muted"}`,children:l.replace("_"," ")})}function P({icon:t,title:x,count:l,action:b,help:i}){return e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t,{size:14,className:"text-accent-light"}),e.jsx("h2",{className:"text-sm font-semibold text-text",children:x}),l!==void 0&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-accent/10 text-accent-light",children:l}),i&&e.jsx(Pe,{title:i.title,description:i.description})]}),b]})}function Qe({agents:t}){const[x,l]=s.useState([]),[b,i]=s.useState([]),[v,m]=s.useState(!1),[c,g]=s.useState(""),[p,a]=s.useState(""),[d,f]=s.useState(null),j=s.useCallback(()=>{pe().then(l).catch(()=>{}),he().then(n=>i(n)).catch(()=>{})},[]);s.useEffect(()=>{j()},[j]);const o=async()=>{c.trim()&&(await ve({name:c.trim(),mission:p.trim()||void 0}),g(""),a(""),m(!1),j())},u=async(n,h,N)=>{try{await fe(n,{[h]:N}),j()}catch(z){alert(`Save failed: ${z.message}`)}},r=async()=>{d&&(await ye(d.id),f(null),j())},y=async(n,h,N)=>{try{await Ae(n,{[h]:N||void 0}),j()}catch(z){alert(`Save failed: ${z.message}`)}},C=["ceo","manager","engineer","researcher","general"];function S(n,h=0){var z;const N=((z=t.find(w=>w.id===n.id))==null?void 0:z.reportsTo)||"";return n.model&&n.model.split("/").pop(),e.jsxs("div",{className:h>0?"ml-6 border-l border-border pl-4":"",children:[e.jsxs("div",{className:"bg-bg-tertiary/30 border border-border rounded-xl p-3.5 mb-2 max-w-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[e.jsx("span",{className:"text-[14px] font-semibold text-text min-w-0",children:e.jsx(D,{value:n.name,onSave:w=>y(n.id,"name",w),placeholder:"Agent name"})}),e.jsx(q,{status:n.status})]}),e.jsxs("div",{className:"grid grid-cols-[72px_1fr] gap-x-3 gap-y-1.5 text-[11px]",children:[e.jsx("span",{className:"text-text-muted",children:"Title"}),e.jsx("span",{className:"text-text-secondary min-w-0",children:e.jsx(D,{value:n.title||"",onSave:w=>y(n.id,"title",w),placeholder:"Add a title",emptyLabel:"—"})}),e.jsx("span",{className:"text-text-muted",children:"Role"}),e.jsx("select",{value:n.role,onChange:w=>y(n.id,"role",w.target.value),className:"bg-bg-tertiary border border-border rounded px-1.5 py-0.5 text-[11px] text-text-secondary capitalize focus:outline-none focus:border-accent/30 justify-self-start",children:C.map(w=>e.jsx("option",{value:w,children:w},w))}),e.jsx("span",{className:"text-text-muted",children:"Reports to"}),e.jsxs("select",{value:N,onChange:w=>y(n.id,"reportsTo",w.target.value),className:"bg-bg-tertiary border border-border rounded px-1.5 py-0.5 text-[11px] text-text-secondary focus:outline-none focus:border-accent/30 justify-self-start",children:[e.jsx("option",{value:"",children:"— nobody"}),t.filter(w=>w.id!==n.id).map(w=>e.jsx("option",{value:w.id,children:w.name},w.id))]}),e.jsx("span",{className:"text-text-muted",children:"Model"}),e.jsx("span",{className:"text-text-secondary min-w-0",children:e.jsx(D,{value:n.model||"",onSave:w=>y(n.id,"model",w),placeholder:"e.g. ollama/qwen3.5:cloud",emptyLabel:"—"})})]})]}),n.reports.map(w=>S(w,h+1))]},n.id)}return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[e.jsx(P,{icon:X,title:"Organization Chart",count:t.length}),e.jsx("div",{className:"p-4",children:x.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(X,{size:24,className:"mx-auto mb-2 text-text/10"}),e.jsx("p",{className:"text-[12px] text-text-muted",children:"No agents in org chart yet"}),e.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:'Spawn agents from the Agents tab, then set "Reports to" on each to build the hierarchy.'})]}):x.map(n=>S(n))})]}),e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[e.jsx(P,{icon:R,title:"Companies",count:b.length,action:e.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-1 px-2.5 py-1 text-[10px] bg-accent text-text rounded-lg hover:bg-accent-hover",children:[e.jsx(B,{size:10})," New"]})}),v&&e.jsxs("div",{className:"p-4 border-b border-border bg-bg-secondary/30 space-y-2",children:[e.jsx("input",{value:c,onChange:n=>g(n.target.value),placeholder:"Company name...",className:"w-full bg-bg-tertiary border border-border rounded-lg px-3 py-2 text-[13px] text-text placeholder-white/20 focus:outline-none focus:border-accent/30",onKeyDown:n=>n.key==="Enter"&&o()}),e.jsx("input",{value:p,onChange:n=>a(n.target.value),placeholder:"Mission (optional)...",className:"w-full bg-bg-tertiary border border-border rounded-lg px-3 py-2 text-[12px] text-text-secondary placeholder-white/15 focus:outline-none focus:border-accent/30"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:o,className:"px-3 py-1.5 text-[11px] bg-accent text-text rounded-lg",children:"Create"}),e.jsx("button",{onClick:()=>m(!1),className:"px-3 py-1.5 text-[11px] text-text-muted",children:"Cancel"})]})]}),e.jsx("div",{className:"divide-y divide-border/30",children:b.length===0?e.jsx("div",{className:"py-6 text-center text-[12px] text-text-muted",children:'No companies yet — click "+ New" to create one.'}):b.map(n=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 hover:bg-bg-secondary/30 transition-colors",children:[e.jsx(R,{size:14,className:"text-accent-light flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsx("div",{className:"text-[13px] text-text font-medium",children:e.jsx(D,{value:n.name,onSave:h=>u(n.id,"name",h),placeholder:"Company name"})}),e.jsx("div",{className:"text-[10px] text-text-muted",children:e.jsx(D,{value:n.mission||"",onSave:h=>u(n.id,"mission",h),placeholder:"Add a mission",emptyLabel:"(no mission — click to add)"})})]}),e.jsx(q,{status:n.status||"active"}),e.jsx("button",{onClick:()=>f({id:n.id,name:n.name}),className:"p-1 rounded text-text-muted hover:text-error hover:bg-error/10 transition-colors",title:"Delete company",children:e.jsx(J,{size:12})})]},n.id))})]}),e.jsx(Z,{open:!!d,title:`Delete company "${(d==null?void 0:d.name)||""}"?`,message:"This removes the company record. Agents and goals linked to it stay; they just lose the company association. This can't be undone.",confirmLabel:"Delete",onConfirm:r,onCancel:()=>f(null)})]})}function Ye({agents:t}){const[x,l]=s.useState([]),[b,i]=s.useState(""),[v,m]=s.useState(!1),[c,g]=s.useState(""),[p,a]=s.useState("medium"),[d,f]=s.useState(null),[j,o]=s.useState(null),u=s.useCallback(()=>{ge(b?{status:b}:void 0).then(l).catch(()=>{})},[b]);s.useEffect(()=>{u()},[u]);const r=async()=>{c.trim()&&(await Ce({title:c,priority:p}),g(""),m(!1),u())},y=async(h,N)=>{await $(h,{status:N}),u()},C=async(h,N)=>{await $(h,{assigneeAgentId:N||void 0}),u()},S=async()=>{j&&(await Se(j),o(null),d===j&&f(null),u())},n=["backlog","todo","in_progress","in_review","done","blocked"];return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("button",{onClick:()=>i(""),className:`px-2.5 py-1 text-[10px] rounded-lg transition-colors ${b?"bg-bg-tertiary text-text-muted hover:text-text-secondary":"bg-accent text-text"}`,children:"All"}),n.map(h=>e.jsx("button",{onClick:()=>i(h),className:`px-2.5 py-1 text-[10px] rounded-lg transition-colors ${b===h?"bg-accent text-text":"bg-bg-tertiary text-text-muted hover:text-text-secondary"}`,children:h.replace("_"," ")},h))]}),e.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-1 px-3 py-1.5 text-[11px] bg-accent text-text rounded-lg hover:bg-accent-hover",children:[e.jsx(B,{size:12})," New Issue"]})]}),v&&e.jsxs("div",{className:"bg-bg-tertiary/30 border border-border rounded-xl p-4 space-y-3",children:[e.jsx("input",{value:c,onChange:h=>g(h.target.value),placeholder:"Issue title...",className:"w-full bg-bg-tertiary border border-border rounded-lg px-3 py-2 text-[13px] text-text placeholder-white/20 focus:outline-none focus:border-accent/30",onKeyDown:h=>h.key==="Enter"&&r()}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:p,onChange:h=>a(h.target.value),className:"bg-bg-tertiary border border-border rounded-lg px-2 py-1.5 text-[11px] text-text-secondary focus:outline-none",children:[e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"critical",children:"Critical"})]}),e.jsx("button",{onClick:r,className:"px-3 py-1.5 text-[11px] bg-accent text-text rounded-lg",children:"Create"}),e.jsx("button",{onClick:()=>m(!1),className:"px-3 py-1.5 text-[11px] text-text-muted hover:text-text-secondary",children:"Cancel"})]})]}),e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[e.jsx(P,{icon:R,title:"Issues",count:x.length}),e.jsx("div",{className:"divide-y divide-border/30",children:x.length===0?e.jsx("div",{className:"py-8 text-center text-[12px] text-text-muted",children:'No issues found — click "+ New Issue" to create one.'}):x.map(h=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 hover:bg-bg-secondary/30 transition-colors",children:[e.jsx("span",{className:"text-[10px] text-text-muted font-mono w-14",children:h.identifier}),e.jsx(q,{status:h.priority||"medium"}),e.jsx("button",{onClick:()=>f(h.id),className:"text-[12px] text-text-secondary flex-1 truncate text-left hover:text-text transition-colors",title:"Open details",children:h.title}),e.jsxs("select",{value:h.assigneeAgentId||"",onChange:N=>C(h.id,N.target.value),onClick:N=>N.stopPropagation(),className:"bg-bg-tertiary border border-border rounded px-1.5 py-0.5 text-[10px] text-text-secondary focus:outline-none max-w-[120px]",title:"Assignee",children:[e.jsx("option",{value:"",children:"unassigned"}),t.map(N=>e.jsx("option",{value:N.id,children:N.name},N.id))]}),e.jsxs("select",{value:h.status,onChange:N=>y(h.id,N.target.value),onClick:N=>N.stopPropagation(),className:"bg-bg-tertiary border border-border rounded px-1.5 py-0.5 text-[10px] text-text-secondary focus:outline-none",children:[n.map(N=>e.jsx("option",{value:N,children:N.replace("_"," ")},N)),e.jsx("option",{value:"cancelled",children:"cancelled"})]}),e.jsx("button",{onClick:()=>o(h.id),className:"p-1 rounded text-text-muted hover:text-error hover:bg-error/10 transition-colors",title:"Delete issue",children:e.jsx(J,{size:12})})]},h.id))})]}),d&&e.jsx(Xe,{issueId:d,agents:t,onClose:()=>{f(null),u()},onRequestDelete:()=>o(d)}),e.jsx(Z,{open:!!j,title:"Delete this issue?",message:"This can't be undone. The issue and all its comments will be removed.",confirmLabel:"Delete",onConfirm:S,onCancel:()=>o(null)})]})}function Xe({issueId:t,agents:x,onClose:l,onRequestDelete:b}){var u;const[i,v]=s.useState(null),[m,c]=s.useState(""),[g,p]=s.useState(!1),a=s.useCallback(async()=>{try{const r=await ke(t);v(r)}catch{}},[t]);s.useEffect(()=>{a()},[a]);const d=async(r,y)=>{await $(t,{[r]:y}),a()},f=async r=>{await $(t,{priority:r}),a()},j=async r=>{await $(t,{assigneeAgentId:r||void 0}),a()},o=async()=>{if(m.trim()){p(!0);try{await De(t,m.trim(),{user:"board"}),c(""),a()}finally{p(!1)}}};return e.jsx(_,{open:!0,onClose:l,size:"lg",title:i?`${i.identifier}`:"Loading…",children:i?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-muted/70 mb-1",children:"Title"}),e.jsx("div",{className:"text-[14px] text-text",children:e.jsx(D,{value:i.title,onSave:r=>d("title",r),placeholder:"Issue title"})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-muted/70 mb-1",children:"Description"}),e.jsx("div",{className:"text-[12px] text-text-secondary whitespace-pre-wrap",children:e.jsx(D,{value:i.description||"",onSave:r=>d("description",r),placeholder:"Add a description…",multiline:!0,emptyLabel:"(none — click to add)"})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 text-[11px]",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-text-muted/70 uppercase tracking-wider text-[10px] mb-1",children:"Priority"}),e.jsxs("select",{value:i.priority||"medium",onChange:r=>f(r.target.value),className:"bg-bg-tertiary border border-border rounded px-2 py-1 text-text focus:outline-none w-full",children:[e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"critical",children:"Critical"})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-text-muted/70 uppercase tracking-wider text-[10px] mb-1",children:"Assignee"}),e.jsxs("select",{value:i.assigneeAgentId||"",onChange:r=>j(r.target.value),className:"bg-bg-tertiary border border-border rounded px-2 py-1 text-text focus:outline-none w-full",children:[e.jsx("option",{value:"",children:"unassigned"}),x.map(r=>e.jsx("option",{value:r.id,children:r.name},r.id))]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-text-muted/70 uppercase tracking-wider text-[10px] mb-1",children:"Status"}),e.jsx("div",{className:"text-text capitalize",children:i.status.replace(/_/g," ")})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-wider text-text-muted/70 mb-2",children:["Comments (",((u=i.comments)==null?void 0:u.length)||0,")"]}),e.jsx("div",{className:"space-y-2 max-h-[240px] overflow-y-auto pr-1",children:(i.comments||[]).length===0?e.jsx("div",{className:"text-[11px] text-text-muted italic",children:"No comments yet."}):i.comments.map(r=>e.jsxs("div",{className:"bg-bg-secondary/30 border border-border/50 rounded-lg px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-text-muted/70 mb-1",children:[e.jsx("span",{className:"text-text-secondary",children:r.authorAgentId||r.authorUser||"unknown"}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[F(r.createdAt)," ago"]})]}),e.jsx("div",{className:"text-[12px] text-text whitespace-pre-wrap",children:r.body})]},r.id))}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{value:m,onChange:r=>c(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),o())},placeholder:"Add a comment — Enter to post",disabled:g,className:"flex-1 bg-bg-tertiary border border-border rounded px-3 py-1.5 text-[12px] text-text placeholder-white/20 focus:outline-none focus:border-accent/30"}),e.jsx("button",{onClick:o,disabled:g||!m.trim(),className:"px-3 py-1.5 text-[11px] bg-accent text-text rounded hover:bg-accent-hover disabled:opacity-50",children:"Post"})]})]}),e.jsxs("div",{className:"flex justify-between items-center pt-2 border-t border-border",children:[e.jsxs("span",{className:"text-[10px] text-text-muted",children:["Created ",F(i.createdAt)," ago"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:b,className:"px-3 py-1.5 text-[11px] text-error hover:bg-error/10 rounded",children:"Delete issue"}),e.jsx("button",{onClick:l,className:"px-3 py-1.5 text-[11px] text-text-secondary hover:text-text bg-bg-tertiary rounded",children:"Close"})]})]})]}):e.jsx("div",{className:"py-8 text-center text-[12px] text-text-muted",children:"Loading…"})})}function et({budgets:t,onRefresh:x}){const[l,b]=s.useState(null),[i,v]=s.useState(!1),[m,c]=s.useState(null),g=async()=>{m&&(await je(m.id),c(null),x())};return e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[e.jsx(P,{icon:K,title:"Budget Policies",count:t.length,action:e.jsxs("button",{onClick:()=>v(!0),className:"flex items-center gap-1 px-2.5 py-1 text-[10px] bg-accent text-text rounded-lg hover:bg-accent-hover",children:[e.jsx(B,{size:10})," New Budget"]})}),e.jsx("div",{className:"p-4 space-y-3",children:t.length===0?e.jsx("div",{className:"text-center py-6 text-[12px] text-text-muted",children:'No budget policies yet — click "+ New Budget" to set spending limits per agent, goal, or globally.'}):t.map(p=>{const a=p.limitUsd>0?Math.min(100,p.currentSpend/p.limitUsd*100):0,d=a>=100?"bg-error":a>=80?"bg-warning":"bg-success";return e.jsxs("div",{className:"bg-bg-tertiary/30 border border-border rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-[12px] font-medium text-text",children:p.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-text-muted capitalize",children:p.scope.type}),e.jsx("span",{className:"text-[10px] text-text-muted",children:p.period}),e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${p.enabled?"text-success bg-success/10":"text-text-muted bg-bg-tertiary"}`,children:p.enabled?"on":"off"}),e.jsx("button",{onClick:()=>b(p),className:"text-[10px] text-text-muted hover:text-text-secondary px-1",title:"Edit budget",children:"Edit"}),e.jsx("button",{onClick:()=>c(p),className:"p-1 rounded text-text-muted hover:text-error hover:bg-error/10 transition-colors",title:"Delete budget",children:e.jsx(J,{size:12})})]})]}),e.jsx("div",{className:"h-1.5 bg-bg-tertiary rounded-full overflow-hidden mb-1.5",children:e.jsx("div",{className:`h-full ${d} rounded-full transition-all`,style:{width:`${a}%`}})}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted",children:[e.jsxs("span",{children:["$",p.currentSpend.toFixed(2)," spent"]}),e.jsxs("span",{children:["$",p.limitUsd.toFixed(2)," limit · action: ",p.action]})]})]},p.id)})}),(i||l)&&e.jsx(tt,{existing:l,onClose:()=>{v(!1),b(null)},onSaved:()=>{v(!1),b(null),x()}}),e.jsx(Z,{open:!!m,title:`Delete budget "${(m==null?void 0:m.name)||""}"?`,message:"The policy and its spend history are removed. Agents/goals it covered will no longer be budget-enforced unless another policy applies.",confirmLabel:"Delete",onConfirm:g,onCancel:()=>c(null)})]})}function tt({existing:t,onClose:x,onSaved:l}){var z,w;const b=!!t,[i,v]=s.useState((t==null?void 0:t.name)||""),[m,c]=s.useState((t==null?void 0:t.scope.type)||"global"),[g,p]=s.useState((t==null?void 0:t.scope.targetId)||""),[a,d]=s.useState((t==null?void 0:t.period)||"daily"),[f,j]=s.useState(((z=t==null?void 0:t.limitUsd)==null?void 0:z.toString())||"10"),[o,u]=s.useState(((w=t==null?void 0:t.warningThresholdPercent)==null?void 0:w.toString())||"80"),[r,y]=s.useState((t==null?void 0:t.action)||"warn"),[C,S]=s.useState((t==null?void 0:t.enabled)??!0),[n,h]=s.useState(!1),N=async()=>{if(i.trim()){h(!0);try{const k={name:i.trim(),scope:{type:m,targetId:m==="global"?void 0:g||void 0},period:a,limitUsd:Number(f)||0,warningThresholdPercent:Number(o)||80,action:r,enabled:C};b&&t?await ze(t.id,k):await Te(k),l()}catch(k){alert(`Save failed: ${k.message}`)}finally{h(!1)}}};return e.jsx(_,{open:!0,onClose:x,size:"md",title:b?"Edit Budget Policy":"New Budget Policy",footer:e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:x,className:"px-3 py-1.5 text-[11px] text-text-secondary hover:text-text",children:"Cancel"}),e.jsx("button",{onClick:N,disabled:n||!i.trim(),className:"px-3 py-1.5 text-[11px] bg-accent text-text rounded hover:bg-accent-hover disabled:opacity-50",children:n?"Saving…":b?"Save changes":"Create budget"})]}),children:e.jsxs("div",{className:"space-y-3 text-[12px]",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Name"}),e.jsx("input",{value:i,onChange:k=>v(k.target.value),placeholder:"e.g. Daily global cap",className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none focus:border-accent/40"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Scope"}),e.jsxs("select",{value:m,onChange:k=>c(k.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[e.jsx("option",{value:"global",children:"Global (all agents)"}),e.jsx("option",{value:"agent",children:"Per-agent"}),e.jsx("option",{value:"goal",children:"Per-goal"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Target ID"}),e.jsx("input",{value:g,onChange:k=>p(k.target.value),placeholder:m==="global"?"n/a":m==="agent"?"agent-id":"goal-id",disabled:m==="global",className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none disabled:opacity-40"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Period"}),e.jsxs("select",{value:a,onChange:k=>d(k.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[e.jsx("option",{value:"daily",children:"Daily"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Limit (USD)"}),e.jsx("input",{type:"number",step:"0.01",value:f,onChange:k=>j(k.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none focus:border-accent/40"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Warn at %"}),e.jsx("input",{type:"number",min:"1",max:"100",value:o,onChange:k=>u(k.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none focus:border-accent/40"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Action at limit"}),e.jsxs("select",{value:r,onChange:k=>y(k.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[e.jsx("option",{value:"warn",children:"Warn only"}),e.jsx("option",{value:"pause",children:"Pause agent"}),e.jsx("option",{value:"stop",children:"Stop agent"})]})]}),e.jsx("div",{className:"flex items-end gap-2",children:e.jsxs("label",{className:"flex items-center gap-2 text-text-secondary cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:C,onChange:k=>S(k.target.checked),className:"accent-accent"}),e.jsx("span",{children:"Enabled"})]})})]})]})})}function st({dashboard:t}){const[x,l]=s.useState([]),[b,i]=s.useState(""),[v,m]=s.useState(!1),[c,g]=s.useState(""),[p,a]=s.useState(),d=s.useRef(null),f=s.useRef(null),j=s.useCallback(()=>{var y;const u=t,r=u.agents.map(C=>`${C.name} (${C.status}, ${C.role}, cost=$${C.totalCostUsd.toFixed(2)})`).join("; ")||"none";return`[COMMAND POST] ${u.totalAgents} agents (${u.activeAgents} active), ${u.activeCheckouts} locked tasks, budget ${Math.round(u.budgetUtilization??0)}% used, ${((y=u.goalTree)==null?void 0:y.length)??0} goals. Agents: ${r}. You manage this agent organization. Be concise.
|
|
23
|
-
|
|
24
|
-
`},[t]),o=s.useCallback(async()=>{const u=b.trim();if(!u||v)return;i(""),l(S=>[...S,{role:"user",content:u}]),m(!0),g("");const r=new AbortController;d.current=r;let y="",C=p;try{await me(j()+u,p,S=>{S.type==="token"&&(y+=S.data,g(y)),S.type==="done"&&S.sessionId&&(C=S.sessionId)},r.signal),C&&a(C),y&&l(S=>[...S,{role:"assistant",content:y}])}catch(S){S.name!=="AbortError"&&l(n=>[...n,{role:"assistant",content:`Error: ${S.message}`}])}finally{m(!1),g(""),d.current=null}},[b,v,p,j]);return s.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[x,c]),e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden flex flex-col",style:{height:400},children:[e.jsx(P,{icon:H,title:"Console",action:v?e.jsxs("button",{onClick:()=>{var u;return(u=d.current)==null?void 0:u.abort()},className:"text-[10px] text-error flex items-center gap-1",children:[e.jsx(Re,{size:12}),"Stop"]}):void 0}),e.jsxs("div",{ref:f,className:"flex-1 overflow-y-auto px-4 py-3 space-y-2",children:[x.length===0&&!v&&e.jsxs("div",{className:"text-center py-6",children:[e.jsx("p",{className:"text-[11px] text-text-muted mb-3",children:"Manage your organization through natural language"}),e.jsx("div",{className:"flex flex-wrap justify-center gap-1.5",children:["Status report","Create issue: Research competitors","Spawn a research agent","Set $50/day budget"].map(u=>e.jsx("button",{onClick:()=>i(u),className:"text-[10px] text-text-muted hover:text-text-muted px-2.5 py-1 rounded-full border border-border hover:border-border-light",children:u},u))})]}),x.map((u,r)=>e.jsx("div",{className:`flex ${u.role==="user"?"justify-end":"justify-start"}`,children:e.jsx("div",{className:`max-w-[85%] px-3 py-2 rounded-xl text-[12px] leading-relaxed whitespace-pre-wrap ${u.role==="user"?"bg-accent/80 text-text rounded-br-sm":"bg-bg-tertiary text-text-secondary border border-border rounded-bl-sm"}`,children:u.content})},r)),v&&c&&e.jsx("div",{className:"flex justify-start",children:e.jsxs("div",{className:"max-w-[85%] px-3 py-2 rounded-xl rounded-bl-sm bg-bg-tertiary text-text-secondary border border-border text-[12px] whitespace-pre-wrap",children:[c,e.jsx("span",{className:"inline-block w-1 h-3.5 bg-accent-light ml-0.5 animate-pulse"})]})}),v&&!c&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"px-3 py-2 rounded-xl bg-bg-tertiary border border-border",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-muted/20 animate-bounce"}),e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-muted/20 animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-muted/20 animate-bounce",style:{animationDelay:"300ms"}})]})})})]}),e.jsx("div",{className:"px-3 py-2 border-t border-border",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{value:b,onChange:u=>i(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),o())},placeholder:"Tell Command Post what to do...",className:"flex-1 bg-bg-tertiary border border-border rounded-lg px-3 py-2 text-[12px] text-text placeholder-white/20 focus:outline-none focus:border-accent/30"}),e.jsx("button",{onClick:o,disabled:!b.trim()||v,className:"p-2 rounded-lg bg-accent text-text hover:bg-accent-hover disabled:opacity-30",children:e.jsx(Fe,{size:14})})]})})]})}function at({onClose:t,onCreated:x}){const[l,b]=s.useState(""),[i,v]=s.useState([{role:"pragmatist",model:""},{role:"skeptic",model:""}]),[m,c]=s.useState(2),[g,p]=s.useState("judge"),[a,d]=s.useState(!1),f=()=>{i.length>=5||v([...i,{role:`participant-${i.length+1}`,model:""}])},j=r=>{i.length<=2||v(i.filter((y,C)=>C!==r))},o=(r,y)=>{v(i.map((C,S)=>S===r?{...C,...y}:C))},u=async()=>{if(!(!l.trim()||i.length<2)){d(!0);try{const r=await W("/api/command-post/debates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:l.trim(),participants:i.map(y=>({role:y.role.trim()||"participant",model:y.model.trim()||void 0})),rounds:m,resolution:g})});if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);x()}catch(r){alert(`Debate failed: ${r.message}`)}finally{d(!1)}}};return e.jsx(_,{open:!0,onClose:t,title:"Start a new debate",size:"lg",footer:e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:t,className:"px-3 py-1.5 text-[11px] text-text-secondary hover:text-text",children:"Cancel"}),e.jsx("button",{onClick:u,disabled:a||!l.trim()||i.length<2,className:"px-3 py-1.5 text-[11px] bg-accent text-text rounded hover:bg-accent-hover disabled:opacity-50",children:a?"Running debate…":"Run debate"})]}),children:e.jsxs("div",{className:"space-y-3 text-[12px]",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Question"}),e.jsx("textarea",{value:l,onChange:r=>b(r.target.value),placeholder:"e.g. Should we cache the Ollama probe results for 7 days or 30 days?",rows:2,className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none focus:border-accent/40 resize-none"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:["Participants (",i.length,"/5)"]}),e.jsx("button",{onClick:f,disabled:i.length>=5,className:"text-[10px] text-accent-light/70 hover:text-accent-light disabled:opacity-40",children:"+ Add participant"})]}),e.jsx("div",{className:"space-y-2",children:i.map((r,y)=>e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("input",{value:r.role,onChange:C=>o(y,{role:C.target.value}),placeholder:"role (e.g. pragmatist)",className:"flex-1 bg-bg-tertiary border border-border rounded px-2 py-1 text-text focus:outline-none"}),e.jsx("input",{value:r.model,onChange:C=>o(y,{model:C.target.value}),placeholder:"model (optional — defaults to agent.model)",className:"flex-1 bg-bg-tertiary border border-border rounded px-2 py-1 text-text-secondary focus:outline-none"}),e.jsx("button",{onClick:()=>j(y),disabled:i.length<=2,className:"text-text-muted hover:text-error disabled:opacity-20 px-1",title:"Remove",children:"×"})]},y))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Rounds"}),e.jsx("select",{value:m,onChange:r=>c(Number(r.target.value)),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[1,2,3,4].map(r=>e.jsxs("option",{value:r,children:[r," round",r===1?"":"s"]},r))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Resolution"}),e.jsxs("select",{value:g,onChange:r=>p(r.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[e.jsx("option",{value:"judge",children:"Judge (LLM picks winner)"}),e.jsx("option",{value:"synthesize",children:"Synthesize (LLM merges)"}),e.jsx("option",{value:"vote",children:"Vote (word-overlap consensus)"})]})]})]}),e.jsx("div",{className:"text-[10px] text-text-muted/70 italic",children:"Runs live — 1-3 minutes depending on model + rounds. Transcript saves automatically."})]})})}function rt(){const[t,x]=s.useState([]),[l,b]=s.useState("pending"),[i,v]=s.useState(!1),m=s.useCallback(async()=>{v(!0);try{const a=await be(l==="all"?void 0:l);x(a)}catch{}v(!1)},[l]);s.useEffect(()=>{m()},[m]);const c=async a=>{try{await Ne(a,"board")}catch{}m()},g=async a=>{try{await we(a,"board")}catch{}m()},p=t.filter(a=>l==="all"?!0:a.status===l);return e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[e.jsx(P,{icon:ae,title:"Approvals",count:p.length,help:{title:"Approvals",description:"Human-in-the-loop decisions for hiring agents, budget overrides, goal proposals, and self-modification requests."},action:e.jsx("div",{className:"flex items-center gap-2",children:["pending","approved","rejected","all"].map(a=>e.jsx("button",{onClick:()=>b(a),className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${l===a?"bg-accent text-text":"bg-bg-tertiary text-text-muted hover:text-text"}`,children:a},a))})}),e.jsx("div",{className:"divide-y divide-border/30",children:i?e.jsx("div",{className:"py-8 text-center text-[12px] text-text-muted",children:"Loading..."}):p.length===0?e.jsxs("div",{className:"py-8 text-center text-[12px] text-text-muted",children:["No ",l," approvals."]}):p.map(a=>{var d;return e.jsxs("div",{className:"px-4 py-3 hover:bg-bg-tertiary/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-[12px] text-text flex-1 truncate pr-2",children:a.type.replace(/_/g," ")}),e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full ${a.status==="pending"?"bg-warning/10 text-warning":a.status==="approved"?"bg-success/10 text-success":"bg-error/10 text-error"}`,children:a.status})]}),e.jsx("div",{className:"text-[10px] text-text-muted mb-2 truncate",children:(d=_e(a))==null?void 0:d.headline}),a.status==="pending"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>c(a.id),className:"px-2 py-0.5 text-[10px] bg-success text-text rounded hover:bg-success/80",children:"Approve"}),e.jsx("button",{onClick:()=>g(a.id),className:"px-2 py-0.5 text-[10px] bg-error text-text rounded hover:bg-error/80",children:"Reject"})]}),a.decidedBy&&e.jsxs("div",{className:"text-[10px] text-text-muted mt-1",children:["By ",a.decidedBy," ",a.decidedAt?F(a.decidedAt)+" ago":""]})]},a.id)})})]})}function nt(){const[t,x]=s.useState([]),[l,b]=s.useState(null),[i,v]=s.useState(!1),[m,c]=s.useState(!1),g=s.useCallback(async()=>{v(!0);try{const a=await W("/api/command-post/debates");if(a.ok){const d=await a.json();x((d==null?void 0:d.items)||[])}}catch{}v(!1)},[]);s.useEffect(()=>{g()},[g]);const p=async a=>{try{const d=await W(`/api/command-post/debates/${a}`);if(d.ok){const f=await d.json();b(f)}}catch{}};if(l){const a=new Map;for(const d of l.turns){const f=a.get(d.round)||[];f.push(d),a.set(d.round,f)}return e.jsxs("div",{className:"space-y-3",children:[e.jsx("button",{onClick:()=>b(null),className:"text-[11px] text-text-muted hover:text-text-secondary",children:"← Back to debates"}),e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl p-4",children:[e.jsx("div",{className:"text-[13px] font-semibold text-text mb-1",children:l.question}),e.jsxs("div",{className:"text-[10px] text-text-muted/70",children:[l.resolution," • ",l.rounds," round",l.rounds===1?"":"s"," • ",(l.durationMs/1e3).toFixed(1),"s"]}),l.winner&&e.jsxs("div",{className:"mt-3 p-3 bg-success/[0.06] border border-success/30 rounded-lg",children:[e.jsxs("div",{className:"text-[11px] text-success/80/80 uppercase tracking-wider",children:["Winner: ",l.winner.role]}),e.jsx("div",{className:"text-[12px] text-text mt-1",children:l.winner.content}),l.winner.justification&&e.jsx("div",{className:"text-[10px] text-text-muted italic mt-2",children:l.winner.justification})]})]}),[...a.entries()].sort((d,f)=>d[0]-f[0]).map(([d,f])=>e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-border/50 text-[11px] font-medium text-text-secondary uppercase tracking-wider",children:["Round ",d]}),e.jsx("div",{className:"divide-y divide-border/30",children:f.map((j,o)=>e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("div",{className:"text-[11px] font-semibold text-accent-light/80 mb-1",children:j.role}),e.jsx("div",{className:"text-[11px] text-text-secondary whitespace-pre-wrap",children:j.content}),e.jsxs("div",{className:"text-[9px] text-text-muted mt-1",children:[j.model.split("/").pop()," • ",j.durationMs,"ms"]})]},o))})]},d))]})}return e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[e.jsx(P,{icon:oe,title:"Debates",count:t.length,help:{title:"Debates",description:"Pit two or more agents against each other to explore different sides of a decision. Useful for risk assessment and trade-off analysis."},action:e.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-1 px-2.5 py-1 text-[10px] bg-accent text-text rounded-lg hover:bg-accent-hover",children:[e.jsx(B,{size:10})," New Debate"]})}),m&&e.jsx(at,{onClose:()=>c(!1),onCreated:()=>{c(!1),g()}}),e.jsx("div",{className:"divide-y divide-border/30",children:i?e.jsx("div",{className:"py-8 text-center text-[12px] text-text-muted",children:"Loading..."}):t.length===0?e.jsxs("div",{className:"py-8 text-center text-[12px] text-text-muted",children:["No debates yet. Call the ",e.jsx("code",{className:"text-accent-light/70",children:"agent_debate"})," tool to start one."]}):t.map(a=>e.jsxs("button",{onClick:()=>p(a.id),className:"w-full text-left px-4 py-3 hover:bg-bg-tertiary/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("div",{className:"text-[12px] text-text flex-1 truncate pr-2",children:a.question}),e.jsxs("span",{className:"text-[10px] text-text-muted whitespace-nowrap",children:[F(a.startedAt)," ago"]})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[e.jsx("span",{children:a.resolution}),e.jsxs("span",{children:[a.rounds," round",a.rounds===1?"":"s"]}),e.jsxs("span",{children:[(a.durationMs/1e3).toFixed(1),"s"]}),a.winnerRole&&e.jsxs("span",{className:"text-success/80/70",children:["winner: ",a.winnerRole]})]})]},a.id))})]})}const lt=[{label:"Overview",tabs:[{id:"Dashboard",label:"Dashboard",icon:ne}]},{label:"Operations",tabs:[{id:"Social",label:"Social",icon:H},{id:"Inbox",label:"Inbox",icon:Ve},{id:"Goals",label:"Goals",icon:xe},{id:"Work",label:"Work",icon:R},{id:"Sessions",label:"Sessions",icon:le}]},{label:"Governance",tabs:[{id:"Issues",label:"Issues",icon:H},{id:"Approvals",label:"Approvals",icon:ae},{id:"Org Chart",label:"Org Chart",icon:re},{id:"Agents",label:"Agents",icon:ue},{id:"Files",label:"Files",icon:Me},{id:"Debates",label:"Debates",icon:oe},{id:"Costs",label:"Costs",icon:K}]},{label:"System",tabs:[{id:"Traces",label:"Traces",icon:I},{id:"Console",label:"Console",icon:Ee}]}],ot=s.lazy(()=>A(()=>import("./WorkTab-iptofXO9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),it=s.lazy(()=>A(()=>import("./SessionsTab-B3eHV3jf.js"),__vite__mapDeps([10,1,2,3]))),ct=s.lazy(()=>A(()=>import("./CPInbox-ybe4r8LW.js"),__vite__mapDeps([11,1,2,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,5]))),dt=s.lazy(()=>A(()=>import("./CPFiles-BO73EZwJ.js"),__vite__mapDeps([28,1,2,14,15,29,30,31,32,33]))),xt=s.lazy(()=>A(()=>import("./TraceViewer-Bh8Jo3Dr.js"),__vite__mapDeps([34,1,2,35,36,22,37,31,38]))),ut=s.lazy(()=>A(()=>import("./CPSocial-Qw5rKy_4.js"),__vite__mapDeps([39,1,2,32,23,40,22,20]))),mt=s.lazy(()=>A(()=>import("./CPDashboard-CTlKGXXQ.js"),__vite__mapDeps([41,1,2,12,13,42,14,15,18,32,43,44]))),pt=s.lazy(()=>A(()=>import("./CPGoals-BNWhNP14.js"),__vite__mapDeps([45,1,2,12,13,42,14,15,16,46,3,18,6,8]))),ht=s.lazy(()=>A(()=>import("./CPAgents-BTZuGnki.js"),__vite__mapDeps([47,1,2,12,13,42,14,15,16,18])));function Bt(){const[t,x]=s.useState("Dashboard"),[l,b]=s.useState(null),[i,v]=s.useState([]),[m,c]=s.useState(!0),[g,p]=s.useState(null),[a,d]=s.useState([]),[f,j]=s.useState(!1),[o,u]=s.useState(null),r=s.useCallback(async()=>{try{const[n,h]=await Promise.allSettled([de(),te()]);n.status==="fulfilled"&&(b(n.value),d(n.value.recentActivity||[])),h.status==="fulfilled"&&v(h.value),p(null)}catch(n){p(n.message)}c(!1)},[]);if(s.useEffect(()=>{r()},[r]),s.useEffect(()=>{if(!l)return;const n=localStorage.getItem("titan-token"),h=n?`/api/command-post/stream?token=${n}`:"/api/command-post/stream",N=new EventSource(h);let z=0;return N.addEventListener("commandpost:activity",w=>{z=0;try{d(k=>[...k.slice(-49),JSON.parse(w.data)])}catch{}}),N.addEventListener("commandpost:agent:status",w=>{z=0;try{const k=JSON.parse(w.data);b(M=>M&&{...M,agents:M.agents.map(U=>U.id===k.agentId?{...U,status:k.status}:U)})}catch{}}),N.onerror=()=>{z++,z>5&&N.close()},()=>N.close()},[l]),s.useEffect(()=>{const n=setInterval(r,3e4);return()=>clearInterval(n)},[r]),m)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-accent/30 border-t-accent rounded-full animate-spin"}),e.jsx("span",{className:"text-sm text-text-muted",children:"Loading Command Post..."})]})});if(g)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center",children:[e.jsx(G,{className:"mx-auto mb-3 text-warning",size:32}),e.jsx("p",{className:"text-sm text-text-secondary mb-4",children:g}),e.jsx("button",{onClick:r,className:"px-4 py-2 text-sm bg-bg-tertiary rounded-lg hover:bg-border text-text-secondary transition-colors",children:"Retry"})]})});const y=l??{agents:[],totalAgents:0,activeAgents:0,activeCheckouts:0,budgetUtilization:0,recentActivity:[],checkouts:[],budgets:[],goalTree:[],companies:[]},C=lt.flatMap(n=>n.tabs.map(h=>({...h,group:n.label}))),S=()=>{switch(t){case"Dashboard":return e.jsx(s.Suspense,{fallback:e.jsx(T,{label:"dashboard"}),children:e.jsx(mt,{})});case"Social":return e.jsx(s.Suspense,{fallback:e.jsx(T,{label:"social"}),children:e.jsx(ut,{})});case"Inbox":return e.jsx(s.Suspense,{fallback:e.jsx(T,{label:"inbox"}),children:e.jsx(ct,{})});case"Goals":return e.jsx(s.Suspense,{fallback:e.jsx(T,{label:"goals"}),children:e.jsx(pt,{})});case"Work":return e.jsx(s.Suspense,{fallback:e.jsx(T,{label:"work"}),children:e.jsx(ot,{})});case"Sessions":return e.jsx(s.Suspense,{fallback:e.jsx(T,{label:"sessions"}),children:e.jsx(it,{})});case"Issues":return e.jsx(Ye,{agents:y.agents});case"Approvals":return e.jsx(rt,{});case"Org Chart":return e.jsx(Qe,{agents:y.agents});case"Agents":return e.jsx(s.Suspense,{fallback:e.jsx(T,{label:"agents"}),children:e.jsx(ht,{})});case"Files":return e.jsx(s.Suspense,{fallback:e.jsx(T,{label:"files"}),children:e.jsx(dt,{})});case"Debates":return e.jsx(nt,{});case"Costs":return e.jsx(et,{budgets:y.budgets,onRefresh:r});case"Traces":return e.jsx(s.Suspense,{fallback:e.jsx(T,{label:"traces"}),children:e.jsx(xt,{})});case"Console":return e.jsx(st,{dashboard:y});default:return null}};return e.jsxs("div",{className:"h-full flex overflow-hidden",children:[e.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",children:[e.jsx("div",{className:"sticky top-0 z-20 border-b border-border bg-bg/95 backdrop-blur",children:e.jsxs("div",{className:"flex items-center gap-3 px-4 md:px-6 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-sm font-bold text-text",children:"Command Post"}),e.jsx("p",{className:"text-[10px] text-text-muted",children:"Agent governance"})]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-x-auto",children:e.jsx("div",{className:"flex items-center gap-1",children:C.map(n=>{const h=t===n.id;return e.jsxs("button",{onClick:()=>x(n.id),title:`${n.group}: ${n.label}`,className:`shrink-0 flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-[12px] transition-all duration-150 ${h?"bg-accent/10 text-accent-light font-medium":"text-text-secondary hover:text-text hover:bg-bg-tertiary/50"}`,children:[e.jsx(n.icon,{size:14,className:h?"text-accent-light":"text-text-muted"}),e.jsx("span",{children:n.label})]},n.id)})})}),e.jsxs("button",{onClick:r,className:"shrink-0 flex items-center justify-center gap-1.5 px-2.5 py-1.5 text-[11px] text-text-muted bg-bg-tertiary/50 border border-border rounded-lg hover:bg-bg-tertiary transition-colors",children:[e.jsx(Le,{size:12,className:m?"animate-spin":""}),"Refresh"]})]})}),e.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-4 md:py-6",children:e.jsx(S,{})})]}),e.jsx(Ge,{collapsed:f,onToggle:()=>j(!f),agents:y.agents,runs:i,onAgentClick:n=>u(n)}),o&&e.jsx(Ke,{agent:o,onClose:()=>u(null)})]})}export{Bt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,aU as d,j as e,aV as m,aW as x}from"./index-CUgepw5Q.js";import{P as h}from"./PageHeader-bnc85wQN.js";import{R as f}from"./refresh-cw-CwDpzXUn.js";import{C as b}from"./clock-CF9BCIpL.js";import{T as g,a as p}from"./toggle-right-CHpzOIlj.js";import{T as u}from"./trash-2-B1C85ePK.js";import"./chevron-right-CQ1NTOtd.js";function k(){const[o,c]=t.useState([]),[r,l]=t.useState(!0),s=t.useCallback(async()=>{l(!0);try{const a=await d();c(a.jobs||[])}catch{}l(!1)},[]);t.useEffect(()=>{s()},[s]);const i=async a=>{try{await m(a),await s()}catch{}},n=async a=>{if(confirm("Delete this cron job?"))try{await x(a),await s()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(h,{title:"Cron Scheduler",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"Cron"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:s,disabled:r,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(f,{className:`w-4 h-4 ${r?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:o.map(a=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(b,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:a.name}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[a.schedule," • ",a.command]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>i(a.id),className:"p-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] hover:bg-[#3f3f46]",children:a.enabled?e.jsx(g,{className:"w-4 h-4 text-emerald-400"}):e.jsx(p,{className:"w-4 h-4 text-[#52525b]"})}),e.jsx("button",{onClick:()=>n(a.id),className:"p-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] hover:bg-[#3f3f46] hover:text-red-400",children:e.jsx(u,{className:"w-3.5 h-3.5"})})]})]},a.id))})]})}export{k as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./index-CUgepw5Q.js";import{B as a}from"./Input-CbrMbLgn.js";function i({icon:s,title:x,description:m,action:t,className:r}){return e.jsxs("div",{className:`titan-empty-state flex flex-col items-center justify-center px-6 py-14 text-center ${r??""}`,children:[s&&e.jsx("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-md border text-text-muted",children:s}),e.jsx("h3",{className:"text-sm font-semibold text-text",children:x}),m&&e.jsx("p",{className:"mt-2 max-w-sm text-xs leading-5 text-text-muted",children:m}),t&&e.jsx(a,{variant:"secondary",size:"sm",onClick:t.onClick,className:"mt-4",children:t.label})]})}export{i as E};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,aX as u,aY as p,aZ as j,j as e,i as N,K as v,a_ as y}from"./index-CUgepw5Q.js";import{P as T}from"./PageHeader-bnc85wQN.js";import{R as w}from"./refresh-cw-CwDpzXUn.js";import{P as k}from"./play-BjdwtYMk.js";import"./chevron-right-CQ1NTOtd.js";function E(){const[t,x]=a.useState(null),[r,o]=a.useState([]),[i,b]=a.useState([]),[d,n]=a.useState(!0),[c,m]=a.useState(!1),l=a.useCallback(async()=>{n(!0);try{const[s,h,f]=await Promise.all([u(),p(),j()]);x(s),o(h.tests||[]),b(f.tests||[])}catch{}n(!1)},[]);a.useEffect(()=>{l()},[l]);const g=async()=>{m(!0);try{await y(),await l()}catch{}m(!1)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(T,{title:"Test Lab",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Quality"},{label:"Tests"}]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:l,disabled:d,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(w,{className:`w-4 h-4 ${d?"animate-spin":""}`})," Refresh"]}),e.jsxs("button",{onClick:g,disabled:c,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#6366f1] text-white text-sm font-medium hover:bg-[#4f46e5] disabled:opacity-50",children:[e.jsx(k,{className:"w-4 h-4"})," ",c?"Running...":"Run Tests"]})]}),t&&e.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b]",children:"Total"}),e.jsx("div",{className:"text-sm font-semibold text-[#e4e4e7]",children:t.total})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b]",children:"Passing"}),e.jsx("div",{className:"text-sm font-semibold text-emerald-400",children:t.passing})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b]",children:"Failing"}),e.jsx("div",{className:"text-sm font-semibold text-red-400",children:t.failing})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b]",children:"Flaky"}),e.jsx("div",{className:"text-sm font-semibold text-amber-400",children:t.flaky})]})]}),r.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium text-[#e4e4e7] flex items-center gap-2",children:[e.jsx(N,{className:"w-4 h-4 text-red-400"})," Failing Tests"]}),r.map(s=>e.jsxs("div",{className:"p-2 rounded-lg bg-red-950/20 border border-red-900/50",children:[e.jsx("div",{className:"text-xs text-[#e4e4e7]",children:s.name}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.suite," • ",s.error.slice(0,60)]})]},s.name))]}),i.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium text-[#e4e4e7] flex items-center gap-2",children:[e.jsx(v,{className:"w-4 h-4 text-amber-400"})," Flaky Tests"]}),i.map(s=>e.jsxs("div",{className:"p-2 rounded-lg bg-amber-950/20 border border-amber-900/50",children:[e.jsx("div",{className:"text-xs text-[#e4e4e7]",children:s.name}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.suite," • ",s.passRate.toFixed(1),"% pass rate"]})]},s.name))]})]})}export{E as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as E,r as a,bk as me,bl as pe,j as e,X as O,H as ue,S as he,bm as ve,bn as fe,bo as I,bp as be,bq as ge}from"./index-CUgepw5Q.js";import{P as je}from"./plus-BSjTdepW.js";import{R as Ne}from"./refresh-cw-CwDpzXUn.js";import{C as U}from"./chevron-right-CQ1NTOtd.js";import{A as ye}from"./arrow-left-qA0Qer2h.js";import{C as we}from"./clock-CF9BCIpL.js";import{P as J}from"./pencil-D_YwQBeg.js";import{T as Z}from"./trash-2-B1C85ePK.js";import{S as ke}from"./save-CjTPAQM0.js";import{D as Ce}from"./download-BBNXvBO0.js";import{C as X}from"./check-DgyDEFtq.js";import{D as G}from"./TitanCanvas-TuYZSZO7.js";import{F as Q}from"./file-text-DrdTDEYp.js";import"./chevron-up-UyfdjRp6.js";import"./server-BE8W-AT4.js";import"./network-DaJ7ugwX.js";import"./terminal-B8IK4WsO.js";import"./book-open-DIxdPqmD.js";import"./rotate-ccw-7SQDTI0_.js";import"./search-BP7VlNxX.js";import"./send-C2XDuRPf.js";import"./message-square-D5VWlv-Q.js";import"./mic-Ddcc6Ann.js";import"./flask-conical-BGn5PgFX.js";import"./archive-gZFnGd5A.js";import"./radio-B7kX_yWE.js";import"./test-tube-Xfn9DJeg.js";import"./VoiceOverlay-B_ss7Zg_.js";import"./volume-2-DMaE91b5.js";import"./folder-BeZZUGnK.js";import"./shield-check-s7la2J2K.js";import"./external-link-D_ji4Bec.js";import"./bot-CvIF1uHi.js";import"./wifi-off-DR9h8HGA.js";import"./chart-column-BQiM-Td4.js";import"./link-CUpaumqr.js";/**
|
|
2
|
-
* @license lucide-react v0.513.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 ze=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],Fe=E("file",ze);/**
|
|
7
|
-
* @license lucide-react v0.513.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 Se=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],S=E("folder-open",Se);/**
|
|
12
|
-
* @license lucide-react v0.513.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 Ee=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],De=E("folder-plus",Ee);function pt(){var K;const[w,Y]=a.useState([]),[n,D]=a.useState(""),[o,P]=a.useState(""),[R,ee]=a.useState([]),[s,d]=a.useState(null),[te,$]=a.useState(!0),[re,L]=a.useState(!1),[k,x]=a.useState(!1),[b,C]=a.useState(""),[W,B]=a.useState(!1),[se,g]=a.useState(!1),[ae,j]=a.useState(!1),[l,m]=a.useState(""),[p,N]=a.useState(null),[v,T]=a.useState(""),z=a.useRef(null),[u,f]=a.useState(null),[M,i]=a.useState("");a.useEffect(()=>{me().then(t=>{Y(t.roots),t.roots.length>0&&!n&&D(t.roots[0].path)}).catch(()=>{})},[]);const h=a.useCallback(async t=>{$(!0);try{const r=await pe(t??o,n||void 0);ee(r.entries)}catch{}$(!1)},[o,n]);a.useEffect(()=>{n&&h(o)},[o,n]);const y=t=>{P(t),d(null),x(!1)},ne=()=>{const t=o.split("/").filter(Boolean);t.pop(),y(t.join("/"))},oe=async t=>{if(t.type==="directory"){y(t.path);return}L(!0),x(!1);try{const r=await fe(t.path,n||void 0);d(r)}catch{}L(!1)},ie=async()=>{if(s){B(!0),i("");try{await I(s.path,b,n||void 0),d({...s,content:b,size:new Blob([b]).size}),x(!1)}catch(t){i(t.message)}B(!1)}},A=async()=>{if(l.trim()){i("");try{const t=o?`${o}/${l.trim()}`:l.trim();await I(t,"",n||void 0),g(!1),m(""),h()}catch(t){i(t.message)}}},H=async()=>{if(l.trim()){i("");try{const t=o?`${o}/${l.trim()}`:l.trim();await be(t,n||void 0),j(!1),m(""),h()}catch(t){i(t.message)}}},_=async t=>{if(!v.trim()||v===t.name){N(null);return}i("");try{const r=t.path.split("/").slice(0,-1).join("/"),c=r?`${r}/${v.trim()}`:v.trim();await ve(t.path,c,n||void 0),N(null),h()}catch(r){i(r.message)}},le=async()=>{if(u){i("");try{await ge(u.path,n||void 0),f(null),(s==null?void 0:s.path)===u.path&&d(null),h()}catch(t){i(t.message),f(null)}}};a.useEffect(()=>{p&&z.current&&z.current.focus()},[p]);const V=t=>t===0?"0 B":t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`,ce=t=>{if(!t)return"";try{const r=new Date(t),c=Date.now()-r.getTime();return c<36e5?`${Math.round(c/6e4)}m ago`:c<864e5?`${Math.round(c/36e5)}h ago`:c<6048e5?`${Math.round(c/864e5)}d ago`:r.toLocaleDateString()}catch{return""}},q=t=>t.endsWith(".json")||t.endsWith(".jsonl")?e.jsx(G,{size:14,className:"text-yellow-400"}):t.endsWith(".md")?e.jsx(Q,{size:14,className:"text-blue-400"}):t.endsWith(".db")?e.jsx(G,{size:14,className:"text-purple-400"}):t.endsWith(".log")?e.jsx(Q,{size:14,className:"text-[var(--text-muted)]"}):t==="titan.json"?e.jsx(he,{size:14,className:"text-[var(--accent)]"}):e.jsx(Fe,{size:14,className:"text-[var(--text-muted)]"}),de=t=>t.endsWith(".json")||t.endsWith(".jsonl")?"json":t.endsWith(".md")?"markdown":t.endsWith(".ts")||t.endsWith(".tsx")?"typescript":t.endsWith(".js")?"javascript":t.endsWith(".yaml")||t.endsWith(".yml")?"yaml":"text",F=o?o.split("/").filter(Boolean):[],xe=((K=w.find(t=>t.path===n))==null?void 0:K.label)||"~/.titan";return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(S,{className:"w-6 h-6 text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-[var(--text)]",children:"File Manager"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Browse, edit, and manage TITAN files"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>{g(!0),m("")},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md border border-[var(--border)] text-xs text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",title:"New File",children:[e.jsx(je,{size:12})," File"]}),e.jsxs("button",{onClick:()=>{j(!0),m("")},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md border border-[var(--border)] text-xs text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",title:"New Folder",children:[e.jsx(De,{size:12})," Folder"]}),e.jsx("button",{onClick:()=>h(),className:"p-2 rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(Ne,{size:14})})]})]}),M&&e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-red-500/10 border border-red-500/20 rounded-lg text-sm text-red-400",children:[e.jsx("span",{children:M}),e.jsx("button",{onClick:()=>i(""),children:e.jsx(O,{size:14})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[w.length>1&&e.jsx("select",{value:n,onChange:t=>{D(t.target.value),P(""),d(null)},className:"px-2 py-1.5 rounded-md border border-[var(--border)] bg-[var(--bg-secondary)] text-[var(--text)] text-xs",children:w.map(t=>e.jsx("option",{value:t.path,children:t.label},t.path))}),e.jsxs("div",{className:"flex-1 flex items-center gap-1 bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg px-3 py-2 overflow-x-auto",children:[e.jsxs("button",{onClick:()=>y(""),className:"flex items-center gap-1 text-[var(--accent)] hover:underline flex-shrink-0",children:[e.jsx(ue,{size:14})," ",xe]}),F.map((t,r)=>e.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(U,{size:12,className:"text-[var(--text-muted)]"}),e.jsx("button",{onClick:()=>y(F.slice(0,r+1).join("/")),className:r===F.length-1?"text-[var(--text)] font-medium":"text-[var(--accent)] hover:underline",children:t})]},r))]})]}),e.jsxs("div",{className:"flex gap-4",style:{height:"calc(100vh - 280px)"},children:[e.jsxs("div",{className:`${s?"w-1/3":"w-full"} bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg overflow-hidden flex flex-col transition-all`,children:[o&&e.jsxs("button",{onClick:ne,className:"flex items-center gap-2 px-4 py-2 text-sm text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] border-b border-[var(--border)] transition-colors",children:[e.jsx(ye,{size:14})," Back"]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:te?e.jsx("div",{className:"p-4 text-[var(--text-muted)] text-sm",children:"Loading..."}):R.length===0?e.jsxs("div",{className:"p-8 text-center text-[var(--text-muted)]",children:[e.jsx(S,{className:"w-10 h-10 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"Empty directory"})]}):R.map(t=>e.jsxs("div",{className:`group w-full flex items-center gap-3 px-4 py-2.5 text-left hover:bg-[var(--bg-tertiary)] border-b border-[var(--border)]/30 transition-colors cursor-pointer ${(s==null?void 0:s.path)===t.path?"bg-[var(--accent)]/10 border-l-2 border-l-[var(--accent)]":""}`,onClick:()=>p!==t.path&&oe(t),children:[t.type==="directory"?e.jsx(S,{size:14,className:"text-[var(--accent)] flex-shrink-0"}):q(t.name),e.jsx("div",{className:"flex-1 min-w-0",children:p===t.path?e.jsx("input",{ref:z,value:v,onChange:r=>T(r.target.value),onKeyDown:r=>{r.key==="Enter"&&_(t),r.key==="Escape"&&N(null)},onBlur:()=>_(t),className:"text-sm bg-[var(--bg-tertiary)] border border-[var(--accent)] rounded px-1.5 py-0.5 text-[var(--text)] w-full outline-none",onClick:r=>r.stopPropagation()}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:`text-sm truncate ${t.type==="directory"?"text-[var(--accent)] font-medium":"text-[var(--text)]"}`,children:t.name}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-[var(--text-muted)]",children:[t.type==="file"&&e.jsx("span",{children:V(t.size)}),t.modified&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(we,{size:10})," ",ce(t.modified)]})]})]})}),p!==t.path&&e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:[e.jsx("button",{onClick:r=>{r.stopPropagation(),N(t.path),T(t.name)},className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--accent)] hover:bg-[var(--bg-secondary)]",title:"Rename",children:e.jsx(J,{size:12})}),e.jsx("button",{onClick:r=>{r.stopPropagation(),f(t)},className:"p-1 rounded text-[var(--text-muted)] hover:text-red-400 hover:bg-red-500/10",title:"Delete",children:e.jsx(Z,{size:12})})]}),t.type==="directory"&&p!==t.path&&e.jsx(U,{size:14,className:"text-[var(--text-muted)] flex-shrink-0"})]},t.path))})]}),s&&e.jsxs("div",{className:"flex-1 bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-[var(--border)] bg-[var(--bg-tertiary)]",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[q(s.path),e.jsx("span",{className:"text-sm font-medium text-[var(--text)] truncate",children:s.path.split("/").pop()}),e.jsx("span",{className:"text-[10px] text-[var(--text-muted)] flex-shrink-0",children:V(s.size)}),s.truncated&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-[var(--warning)]/15 text-[var(--warning)] border border-[var(--warning)]/20 flex-shrink-0",children:"Truncated (1MB limit)"}),k&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-[var(--accent)]/15 text-[var(--accent)] border border-[var(--accent)]/20 flex-shrink-0",children:"Editing"})]}),e.jsx("div",{className:"flex gap-1.5",children:k?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:ie,disabled:W,className:"flex items-center gap-1 px-2 py-1 rounded text-xs bg-[var(--accent)] text-white hover:opacity-90 disabled:opacity-50",children:[e.jsx(ke,{size:12})," ",W?"Saving...":"Save"]}),e.jsxs("button",{onClick:()=>{x(!1),C("")},className:"flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--bg-secondary)]",children:[e.jsx(O,{size:12})," Cancel"]})]}):e.jsxs(e.Fragment,{children:[!s.truncated&&e.jsx("button",{onClick:()=>{x(!0),C(s.content)},className:"flex items-center gap-1 p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--accent)] hover:bg-[var(--bg-secondary)] transition-colors",title:"Edit",children:e.jsx(J,{size:14})}),e.jsx("button",{onClick:()=>{const t=new Blob([s.content],{type:"text/plain"}),r=document.createElement("a");r.href=URL.createObjectURL(t),r.download=s.path.split("/").pop()||"file.txt",r.click()},className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--bg-secondary)] transition-colors",title:"Download",children:e.jsx(Ce,{size:14})}),e.jsx("button",{onClick:()=>{d(null),x(!1)},className:"text-xs text-[var(--text-muted)] hover:text-[var(--text)] px-1",children:"Close"})]})})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:re?e.jsx("div",{className:"p-4 text-[var(--text-muted)] text-sm",children:"Loading file..."}):k?e.jsx("textarea",{value:b,onChange:t=>C(t.target.value),className:"w-full h-full p-4 text-xs font-mono text-[var(--text-secondary)] bg-transparent resize-none outline-none leading-relaxed",spellCheck:!1}):de(s.path)==="json"?e.jsx("pre",{className:"p-4 text-xs font-mono text-[var(--text-secondary)] whitespace-pre-wrap break-words leading-relaxed",children:(()=>{try{return JSON.stringify(JSON.parse(s.content),null,2)}catch{return s.content}})()}):e.jsx("pre",{className:"p-4 text-xs font-mono text-[var(--text-secondary)] whitespace-pre-wrap break-words leading-relaxed",children:s.content})})]})]}),se&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:()=>g(!1),children:e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-xl p-5 w-80 space-y-4",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{className:"text-sm font-semibold text-[var(--text)]",children:"New File"}),e.jsx("input",{autoFocus:!0,value:l,onChange:t=>m(t.target.value),onKeyDown:t=>t.key==="Enter"&&A(),placeholder:"filename.txt",className:"w-full px-3 py-2 rounded-md border border-[var(--border)] bg-[var(--bg-tertiary)] text-sm text-[var(--text)] outline-none focus:border-[var(--accent)]"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>g(!1),className:"px-3 py-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text)]",children:"Cancel"}),e.jsxs("button",{onClick:A,className:"flex items-center gap-1 px-3 py-1.5 text-xs bg-[var(--accent)] text-white rounded-md hover:opacity-90",children:[e.jsx(X,{size:12})," Create"]})]})]})}),ae&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:()=>j(!1),children:e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-xl p-5 w-80 space-y-4",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{className:"text-sm font-semibold text-[var(--text)]",children:"New Folder"}),e.jsx("input",{autoFocus:!0,value:l,onChange:t=>m(t.target.value),onKeyDown:t=>t.key==="Enter"&&H(),placeholder:"folder-name",className:"w-full px-3 py-2 rounded-md border border-[var(--border)] bg-[var(--bg-tertiary)] text-sm text-[var(--text)] outline-none focus:border-[var(--accent)]"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>j(!1),className:"px-3 py-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text)]",children:"Cancel"}),e.jsxs("button",{onClick:H,className:"flex items-center gap-1 px-3 py-1.5 text-xs bg-[var(--accent)] text-white rounded-md hover:opacity-90",children:[e.jsx(X,{size:12})," Create"]})]})]})}),u&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:()=>f(null),children:e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-xl p-5 w-80 space-y-4",onClick:t=>t.stopPropagation(),children:[e.jsxs("h3",{className:"text-sm font-semibold text-[var(--text)]",children:["Delete ",u.type==="directory"?"Folder":"File","?"]}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["Are you sure you want to delete ",e.jsx("span",{className:"font-mono text-[var(--text)]",children:u.name}),"? This cannot be undone."]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>f(null),className:"px-3 py-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text)]",children:"Cancel"}),e.jsxs("button",{onClick:le,className:"flex items-center gap-1 px-3 py-1.5 text-xs bg-red-500 text-white rounded-md hover:opacity-90",children:[e.jsx(Z,{size:12})," Delete"]})]})]})})]})}export{pt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,aT as c,j as e}from"./index-CUgepw5Q.js";import{P as o}from"./PageHeader-bnc85wQN.js";import{R as m}from"./refresh-cw-CwDpzXUn.js";import{R as x}from"./radio-B7kX_yWE.js";import"./chevron-right-CQ1NTOtd.js";function h(){const[l,d]=a.useState([]),[r,i]=a.useState(!0),t=a.useCallback(async()=>{i(!0);try{const s=await c();d(s.nodes||[])}catch{}i(!1)},[]);return a.useEffect(()=>{t()},[t]),e.jsxs("div",{className:"space-y-4",children:[e.jsx(o,{title:"Fleet Router",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Mesh"},{label:"Fleet"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:t,disabled:r,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(m,{className:`w-4 h-4 ${r?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:l.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(x,{className:`w-4 h-4 ${s.status==="online"?"text-emerald-400":s.status==="busy"?"text-amber-400":"text-red-400"}`}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:s.name}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.address," • ",s.capabilities.join(", ")]})]})]}),e.jsx("div",{className:"text-xs text-[#52525b]",children:s.status})]},s.id))})]})}export{h as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomelabPanel-BZvN4LPM.js","assets/index-CUgepw5Q.js","assets/index-Dm6zcSTS.css","assets/PageHeader-bnc85wQN.js","assets/chevron-right-CQ1NTOtd.js","assets/StatCard-Djr487DV.js","assets/SkeletonLoader-Cax7YTqW.js","assets/clsx-B-dksMZM.js","assets/refresh-cw-CwDpzXUn.js","assets/clock-CF9BCIpL.js","assets/message-square-D5VWlv-Q.js","assets/server-BE8W-AT4.js","assets/chart-column-BQiM-Td4.js","assets/network-DaJ7ugwX.js","assets/circle-check-big-CAFcaPPH.js","assets/wifi-off-DR9h8HGA.js","assets/dollar-sign-LDRZBae6.js","assets/NvidiaPanel-4DlcQlyl.js","assets/save-CjTPAQM0.js","assets/external-link-D_ji4Bec.js","assets/search-BP7VlNxX.js","assets/FilesPanel-CaLPog2e.js","assets/plus-BSjTdepW.js","assets/arrow-left-qA0Qer2h.js","assets/pencil-D_YwQBeg.js","assets/trash-2-B1C85ePK.js","assets/download-BBNXvBO0.js","assets/check-DgyDEFtq.js","assets/TitanCanvas-TuYZSZO7.js","assets/chevron-up-UyfdjRp6.js","assets/file-text-DrdTDEYp.js","assets/terminal-B8IK4WsO.js","assets/book-open-DIxdPqmD.js","assets/rotate-ccw-7SQDTI0_.js","assets/send-C2XDuRPf.js","assets/mic-Ddcc6Ann.js","assets/flask-conical-BGn5PgFX.js","assets/archive-gZFnGd5A.js","assets/radio-B7kX_yWE.js","assets/test-tube-Xfn9DJeg.js","assets/VoiceOverlay-B_ss7Zg_.js","assets/volume-2-DMaE91b5.js","assets/folder-BeZZUGnK.js","assets/shield-check-s7la2J2K.js","assets/bot-CvIF1uHi.js","assets/link-CUpaumqr.js","assets/TitanCanvas-BfitWg9R.css","assets/LogsPanel-DbP3Mwnr.js","assets/TelemetryPanel-D4PXsd-X.js","assets/git-branch-BcXabeOs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as t,j as e,_ as a}from"./index-CUgepw5Q.js";import{c as i}from"./clsx-B-dksMZM.js";const r=t.lazy(()=>a(()=>import("./HomelabPanel-BZvN4LPM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),d=t.lazy(()=>a(()=>import("./NvidiaPanel-4DlcQlyl.js"),__vite__mapDeps([17,1,2,3,4,8,18,14,19,20]))),n=t.lazy(()=>a(()=>import("./FilesPanel-CaLPog2e.js"),__vite__mapDeps([21,1,2,22,8,4,23,9,24,25,18,26,27,28,29,30,11,13,31,32,33,20,34,10,35,36,37,38,39,40,41,42,43,19,44,15,12,45,46]))),c=t.lazy(()=>a(()=>import("./LogsPanel-DbP3Mwnr.js"),__vite__mapDeps([47,1,2,3,4,8]))),m=t.lazy(()=>a(()=>import("./TelemetryPanel-D4PXsd-X.js"),__vite__mapDeps([48,1,2,5,9,49,12,11]))),x=[{id:"homelab",label:"Homelab"},{id:"gpu",label:"GPU / NVIDIA"},{id:"files",label:"Files"},{id:"logs",label:"Logs"},{id:"telemetry",label:"Telemetry"}];function p(){const[l,o]=t.useState("homelab");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"shrink-0 px-5 pt-4 pb-0",children:[e.jsx("h1",{className:"text-sm font-semibold text-text mb-3",children:"Infrastructure"}),e.jsx("div",{className:"flex items-center gap-0.5 border-b border-border/50",children:x.map(s=>e.jsxs("button",{onClick:()=>o(s.id),className:i("px-3 py-2 text-xs font-medium transition-colors relative",l===s.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[s.label,l===s.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},s.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(t.Suspense,{fallback:e.jsx("div",{className:"skeleton-shimmer h-40 rounded-lg"}),children:[l==="homelab"&&e.jsx(r,{}),l==="gpu"&&e.jsx(d,{}),l==="files"&&e.jsx(n,{}),l==="logs"&&e.jsx(c,{}),l==="telemetry"&&e.jsx(m,{})]})})]})}export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as e,L as b}from"./index-CUgepw5Q.js";import{c as d}from"./clsx-B-dksMZM.js";const m={primary:"text-white shadow-sm glow-accent-hover bg-[image:var(--gradient-accent)] hover:brightness-110",secondary:"bg-bg-tertiary text-text border border-border hover:border-border-light hover:bg-bg-secondary",ghost:"text-text-secondary hover:text-text hover:bg-bg-tertiary",danger:"bg-error/10 text-error border border-error/20 hover:bg-error/20"},p={sm:"px-2.5 py-1 text-xs gap-1.5 rounded-md",md:"px-3.5 py-2 text-sm gap-2 rounded-lg",lg:"px-5 py-2.5 text-sm gap-2 rounded-lg"},g=n.forwardRef(({variant:r="primary",size:t="md",icon:o,loading:s,disabled:a,children:i,className:l,...c},x)=>e.jsxs("button",{ref:x,disabled:a||s,className:d("inline-flex items-center justify-center font-medium transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50","disabled:opacity-50 disabled:pointer-events-none",m[r],p[t],l),...c,children:[s?e.jsx(b,{size:t==="sm"?14:16,className:"animate-spin"}):o,i]}));g.displayName="Button";const u=n.forwardRef(({icon:r,error:t,className:o,...s},a)=>e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"relative",children:[r&&e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-muted pointer-events-none",children:r}),e.jsx("input",{ref:a,className:d("w-full rounded-lg border bg-bg py-2 text-sm text-text outline-none transition-colors","placeholder:text-text-muted",r?"pl-10 pr-3":"px-3",t?"border-error focus:border-error":"border-border focus:border-accent",o),...s})]}),t&&e.jsx("p",{className:"mt-1 text-xs text-error",children:t})]}));u.displayName="Input";export{g as B};
|