titan-agent 6.1.0-beta.2 → 6.1.0-beta.21
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/LICENSE +1 -29
- package/README.md +1 -1
- package/dist/agent/agentLessons.js +2 -2
- package/dist/agent/agentLessons.js.map +1 -1
- package/dist/agent/autoModeClassifier.js +95 -0
- package/dist/agent/autoModeClassifier.js.map +1 -0
- package/dist/agent/durableJournal.js +2 -2
- package/dist/agent/durableJournal.js.map +1 -1
- package/dist/agent/goalDriver.js +67 -0
- package/dist/agent/goalDriver.js.map +1 -1
- package/dist/agent/goalPlanFile.js +3 -3
- package/dist/agent/goalPlanFile.js.map +1 -1
- package/dist/agent/missionLifecycle.js +2 -2
- package/dist/agent/missionLifecycle.js.map +1 -1
- package/dist/agent/subAgent.js +41 -0
- package/dist/agent/subAgent.js.map +1 -1
- package/dist/agent/toolContract.js +49 -0
- package/dist/agent/toolContract.js.map +1 -0
- package/dist/agent/toolRunner.js +72 -11
- package/dist/agent/toolRunner.js.map +1 -1
- package/dist/agent/trajectoryRecorder.js +185 -0
- package/dist/agent/trajectoryRecorder.js.map +1 -0
- package/dist/agent/verification.js +164 -0
- package/dist/agent/verification.js.map +1 -0
- package/dist/agent/worktreeExecutor.js +207 -0
- package/dist/agent/worktreeExecutor.js.map +1 -0
- package/dist/config/schema.js +28 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/gateway/server.js +54 -0
- package/dist/gateway/server.js.map +1 -1
- package/dist/memory/facade.js +137 -0
- package/dist/memory/facade.js.map +1 -0
- package/dist/migrations/003-soma-profile-default.js +2 -2
- package/dist/migrations/003-soma-profile-default.js.map +1 -1
- package/dist/migrations/005-route-redirects.js +3 -1
- package/dist/migrations/005-route-redirects.js.map +1 -1
- package/dist/migrations/runner.js +2 -2
- package/dist/migrations/runner.js.map +1 -1
- package/dist/providers/defaultModel.js +14 -0
- package/dist/providers/defaultModel.js.map +1 -1
- package/dist/providers/router.js +4 -0
- package/dist/providers/router.js.map +1 -1
- package/dist/providers/stub.js +185 -0
- package/dist/providers/stub.js.map +1 -0
- package/dist/skills/builtin/backup.js +1 -2
- package/dist/skills/builtin/backup.js.map +1 -1
- package/dist/skills/builtin/contracts.js +254 -0
- package/dist/skills/builtin/contracts.js.map +1 -0
- package/dist/skills/builtin/download_image.js +9 -0
- package/dist/skills/builtin/download_image.js.map +1 -1
- package/dist/skills/builtin/filesystem.js +70 -20
- package/dist/skills/builtin/filesystem.js.map +1 -1
- package/dist/skills/registry.js +7 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/storage/patterns.js +2 -2
- package/dist/storage/patterns.js.map +1 -1
- package/dist/storage/personalGallery.js +2 -2
- package/dist/storage/personalGallery.js.map +1 -1
- package/dist/storage/somaProfile.js +2 -2
- package/dist/storage/somaProfile.js.map +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/package.json +2 -2
- package/ui/dist/assets/{AuditPanel-DrDvXZ9u.js → AuditPanel-RNrvKmfX.js} +1 -1
- package/ui/dist/assets/{AutonomyPanel-BfhW-PRX.js → AutonomyPanel-D0nmt79R.js} +2 -2
- package/ui/dist/assets/{AutopilotPanel-C3yQBxAp.js → AutopilotPanel-DlcdfRRy.js} +1 -1
- package/ui/dist/assets/{AutoresearchPanel-BgpR3EcK.js → AutoresearchPanel-CXeO6kGK.js} +2 -2
- package/ui/dist/assets/BackupPanel-CKb-cDsk.js +1 -0
- package/ui/dist/assets/{BrowserPanel-BNaKZOnn.js → BrowserPanel-CDaoF6n5.js} +1 -1
- package/ui/dist/assets/CPActivity-BZbeztg1.js +1 -0
- package/ui/dist/assets/CPAgentDetail-C9fvLxKi.js +1 -0
- package/ui/dist/assets/CPAgents-BsBA9kb2.js +1 -0
- package/ui/dist/assets/CPApprovals-Di5itVIK.js +1 -0
- package/ui/dist/assets/CPCosts-DmgckHli.js +1 -0
- package/ui/dist/assets/CPDashboard-CmSb7woK.js +1 -0
- package/ui/dist/assets/{CPFiles-CUpP5I82.js → CPFiles-Dd0NGcpX.js} +1 -1
- package/ui/dist/assets/CPGoals-DeILFq0A.js +1 -0
- package/ui/dist/assets/{CPInbox-DUW_hntB.js → CPInbox-DAtidZez.js} +2 -2
- package/ui/dist/assets/CPIssueDetail-BvwoGI57.js +1 -0
- package/ui/dist/assets/CPIssues-CZ1hIKDP.js +1 -0
- package/ui/dist/assets/{CPLayout-J0fa-it4.js → CPLayout-luPwhNpA.js} +3 -3
- package/ui/dist/assets/CPOrg-BlYp_KP6.js +8 -0
- package/ui/dist/assets/CPRuns-D0HMCjIo.js +1 -0
- package/ui/dist/assets/{CPSocial-By_FStZ4.js → CPSocial-CZaGi14s.js} +2 -2
- package/ui/dist/assets/ChannelsPanel-khiBHwx3.js +1 -0
- package/ui/dist/assets/{CheckpointsPanel-DvKUd2VF.js → CheckpointsPanel-n2y3jzzT.js} +1 -1
- package/ui/dist/assets/{CommandPostHub-CQqRYBjf.js → CommandPostHub-iWf-zt5p.js} +4 -4
- package/ui/dist/assets/{CronPanel-Brmnnu8_.js → CronPanel-BkRJl8u6.js} +1 -1
- package/ui/dist/assets/{DataTable-seaktPzB.js → DataTable-DZ2cG3Cv.js} +1 -1
- package/ui/dist/assets/{DreamPanel-CO7iSdjn.js → DreamPanel-DF6l0WB-.js} +1 -1
- package/ui/dist/assets/{EmptyState-CmK9fywh.js → EmptyState-D7xwm8hA.js} +1 -1
- package/ui/dist/assets/{EvalHarnessPanel-2RVBKbym.js → EvalHarnessPanel-BHabu49z.js} +2 -2
- package/ui/dist/assets/{EvalPanel-CqAwhFQ5.js → EvalPanel-yAesMLSP.js} +1 -1
- package/ui/dist/assets/{FileViewer-D98m-vF5.js → FileViewer-DOWUQccc.js} +52 -14
- package/ui/dist/assets/{FilesPanel-dRQM0apb.js → FilesPanel-BjuDhqaX.js} +2 -2
- package/ui/dist/assets/FleetPanel-B0ZhS2XX.js +1 -0
- package/ui/dist/assets/{HomelabPanel-DjMUrO2B.js → HomelabPanel-D373ddvj.js} +1 -1
- package/ui/dist/assets/InfraView-CI99NZbI.js +2 -0
- package/ui/dist/assets/InlineEditableField-fDk3eGVo.js +1 -0
- package/ui/dist/assets/Input-j10hONMY.js +1 -0
- package/ui/dist/assets/IntegrationsPanel-kPa5Qq-f.js +1 -0
- package/ui/dist/assets/IntelligenceView-DeKBaAlY.js +2 -0
- package/ui/dist/assets/LearningPanel-B8tqHeEZ.js +1 -0
- package/ui/dist/assets/{LogsPanel-Bs9IsTCH.js → LogsPanel-sXc__trb.js} +1 -1
- package/ui/dist/assets/McpPanel-DEr8pZwB.js +1 -0
- package/ui/dist/assets/{MemoryGraphPanel-F1P9COyY.js → MemoryGraphPanel-DZl7USJ6.js} +1 -1
- package/ui/dist/assets/MemoryWikiPanel-DTNVWvVT.js +11 -0
- package/ui/dist/assets/{MeshPanel-CgIAh5ZX.js → MeshPanel-b77zyQx4.js} +1 -1
- package/ui/dist/assets/MissionCanvas-D_quSl5F.js +69 -0
- package/ui/dist/assets/MissionChat-rQ5rUPAt.js +7 -0
- package/ui/dist/assets/MissionLibrary-Cxw7sLxv.js +5 -0
- package/ui/dist/assets/MissionStart-ChMWO1rr.js +1 -0
- package/ui/dist/assets/Modal-Dl5b6Yaj.js +1 -0
- package/ui/dist/assets/NvidiaPanel-D7qFbbeJ.js +1 -0
- package/ui/dist/assets/{OrganismPanel-CNZM3eof.js → OrganismPanel-EiQ9Gfqx.js} +1 -1
- package/ui/dist/assets/OverviewPanel-Bectj1Z5.js +1 -0
- package/ui/dist/assets/{PageHeader-llOXO43Z.js → PageHeader-CiuoyvDR.js} +1 -1
- package/ui/dist/assets/{PersonaProfilesPanel-CfsQTMra.js → PersonaProfilesPanel-BO87DSVG.js} +1 -1
- package/ui/dist/assets/{PersonasPanel-DIac_kZ3.js → PersonasPanel-BNogLwM0.js} +1 -1
- package/ui/dist/assets/RecipesPanel-DyqfWlaY.js +1 -0
- package/ui/dist/assets/{SecurityPanel-_gqMk8hJ.js → SecurityPanel-OMC-Tvbz.js} +1 -1
- package/ui/dist/assets/SelfImprovePanel-DXIfG_df.js +1 -0
- package/ui/dist/assets/{SelfProposalsPanel-DuA0zsGH.js → SelfProposalsPanel-CmgEz1TQ.js} +2 -2
- package/ui/dist/assets/SessionsPanel-gJXosEGf.js +1 -0
- package/ui/dist/assets/{SessionsTab-bFYaFvTZ.js → SessionsTab-BOVzzjTO.js} +1 -1
- package/ui/dist/assets/SettingsPanel-DifFGEvi.js +1 -0
- package/ui/dist/assets/SettingsView-BNpj0iym.js +2 -0
- package/ui/dist/assets/SkeletonLoader-CNSsfH3f.js +1 -0
- package/ui/dist/assets/{SkillsPanel-D08WcRGp.js → SkillsPanel-6fbRov-m.js} +1 -1
- package/ui/dist/assets/{SomaView-CYukE7Fp.js → SomaView-D3boPl5D.js} +1 -1
- package/ui/dist/assets/{StatCard-DT4Bx1mY.js → StatCard-2BmOlamJ.js} +1 -1
- package/ui/dist/assets/StatusBadge-CdVHF1nG.js +1 -0
- package/ui/dist/assets/Tabs-DW9ytf9H.js +1 -0
- package/ui/dist/assets/{TeamsPanel-DOBe72TK.js → TeamsPanel-CNaQ8Dbw.js} +1 -1
- package/ui/dist/assets/TelemetryPanel-DL81QlAW.js +1 -0
- package/ui/dist/assets/TitanCanvas-DLIN_wV3.js +1152 -0
- package/ui/dist/assets/ToolsView-BlChEE4n.js +2 -0
- package/ui/dist/assets/Tooltip-oR5JnwoN.js +6 -0
- package/ui/dist/assets/{TraceViewer-0bCz0x_a.js → TraceViewer-DtJXjCXV.js} +1 -1
- package/ui/dist/assets/TrainingPanel-4XMGaRN_.js +1 -0
- package/ui/dist/assets/{VoiceOverlay-B08Sw918.js → VoiceOverlay-B3fXJ-EC.js} +1 -1
- package/ui/dist/assets/{VramPanel-CJiic8y4.js → VramPanel-HisAYiqI.js} +1 -1
- package/ui/dist/assets/{WatchView-CaQMDEAy.js → WatchView-C92y0hU7.js} +1 -1
- package/ui/dist/assets/{WorkTab-D5bi2WRi.js → WorkTab-BYAWcvA1.js} +1 -1
- package/ui/dist/assets/{WorkflowsPanel-DdY6E93C.js → WorkflowsPanel-D2DiOBLA.js} +1 -1
- package/ui/dist/assets/{arrow-left-CHJyrO8S.js → arrow-left-thXQMJQ6.js} +1 -1
- package/ui/dist/assets/{briefcase-ROIEmiah.js → briefcase-ByMhDqlL.js} +1 -1
- package/ui/dist/assets/{chart-column-wFkjV3Ni.js → chart-column-CYHJVuxN.js} +1 -1
- package/ui/dist/assets/{check-BcOm5jPO.js → check-ChWLFWCx.js} +1 -1
- package/ui/dist/assets/{chevron-down-CM11GPpR.js → chevron-down-CU_O_5h3.js} +1 -1
- package/ui/dist/assets/{chevron-right-aFDDgFsL.js → chevron-right-DAiXsK24.js} +1 -1
- package/ui/dist/assets/{chevron-up-D6g7FB6i.js → chevron-up-BudRYwvy.js} +1 -1
- package/ui/dist/assets/{circle-check-big-DPz64kZW.js → circle-check-big-gkA-V2JW.js} +1 -1
- package/ui/dist/assets/{clock-BbCCaukN.js → clock-qO5kIED9.js} +1 -1
- package/ui/dist/assets/clsx-B-dksMZM.js +1 -0
- package/ui/dist/assets/{dollar-sign-Dy5-qkg3.js → dollar-sign-1gQNJK3V.js} +1 -1
- package/ui/dist/assets/{download-DjheLEns.js → download-DMD1m87c.js} +1 -1
- package/ui/dist/assets/{external-link-BgxGF7ZQ.js → external-link-ByafQkZ7.js} +1 -1
- package/ui/dist/assets/{folder-DY4eeMdo.js → folder-DeG4RuOD.js} +1 -1
- package/ui/dist/assets/{funnel-LWmcwhj-.js → funnel-wE8i5V9Y.js} +1 -1
- package/ui/dist/assets/{git-branch-CPZciK10.js → git-branch-BWSuK1LU.js} +1 -1
- package/ui/dist/assets/index-B8YEFBRH.js +277 -0
- package/ui/dist/assets/index-Cb5bSxRB.css +1 -0
- package/ui/dist/assets/{layers-Bn7bgu2Z.js → layers-tN-wIpE0.js} +1 -1
- package/ui/dist/assets/{legacy-BVPeht6t.js → legacy-BSZBdyop.js} +2 -2
- package/ui/dist/assets/{lightbulb-tzuCyEQk.js → lightbulb-TUHKCda3.js} +1 -1
- package/ui/dist/assets/{list-todo-say4NbSw.js → list-todo-DtxcUGz2.js} +1 -1
- package/ui/dist/assets/{missions-DbC8UmMc.js → missions-C3EC4uKT.js} +1 -1
- package/ui/dist/assets/{network-v9O7MmZT.js → network-ephW7nah.js} +1 -1
- package/ui/dist/assets/{pause-CZo33QlA.js → pause-DeggUVZc.js} +1 -1
- package/ui/dist/assets/{play-DbCJhc5H.js → play-Dfc0ia6v.js} +1 -1
- package/ui/dist/assets/{plug-CtpCZg2z.js → plug-Bl_6i_9u.js} +1 -1
- package/ui/dist/assets/{plus-O61rB_YF.js → plus-CQwCh7WY.js} +1 -1
- package/ui/dist/assets/{proxy-BAUTNyg6.js → proxy-BjQ4lsww.js} +1 -1
- package/ui/dist/assets/{rotate-ccw-n5WkWR51.js → rotate-ccw-CUuN2ebi.js} +1 -1
- package/ui/dist/assets/{save-D2Qh8KyN.js → save-PlTUvsN5.js} +1 -1
- package/ui/dist/assets/{search-C9SdcZJq.js → search-BHgLDT-j.js} +1 -1
- package/ui/dist/assets/{send-DZ_5M5QQ.js → send-pflQNBoT.js} +1 -1
- package/ui/dist/assets/{shield-check-DyP5PmaY.js → shield-check-CrD-s89i.js} +1 -1
- package/ui/dist/assets/{target-CWfn705s.js → target-D4oh8GME.js} +1 -1
- package/ui/dist/assets/{terminal-CdhfA0Kr.js → terminal-BvJZ1R3x.js} +1 -1
- package/ui/dist/assets/{toggle-right-CmYQLQRS.js → toggle-right-Dl7x_ed7.js} +1 -1
- package/ui/dist/assets/{trash-2-TQcEJEv4.js → trash-2-lPcFwnW5.js} +1 -1
- package/ui/dist/assets/{trending-up-Cw22bM4J.js → trending-up-DqUbZfDe.js} +1 -1
- package/ui/dist/assets/{trophy-DUF8Bcas.js → trophy-Dv6zFfKM.js} +1 -1
- package/ui/dist/assets/{users-BX_ZaByZ.js → users-NPyAWbs5.js} +1 -1
- package/ui/dist/assets/{wrench-Cfp7nYhG.js → wrench-BCKgeHj3.js} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/BackupPanel-BNxMlNIP.js +0 -1
- package/ui/dist/assets/CPActivity-CjIgehOq.js +0 -1
- package/ui/dist/assets/CPAgentDetail-oaymYRNI.js +0 -1
- package/ui/dist/assets/CPAgents-CWQ6iJfO.js +0 -1
- package/ui/dist/assets/CPApprovals-DzATBhtM.js +0 -1
- package/ui/dist/assets/CPCosts-xVQR148_.js +0 -1
- package/ui/dist/assets/CPDashboard-Dt6Jr7Zw.js +0 -1
- package/ui/dist/assets/CPGoals-Bt1a3C9T.js +0 -1
- package/ui/dist/assets/CPIssueDetail-DHxqtiuh.js +0 -1
- package/ui/dist/assets/CPIssues-D0l3fgUs.js +0 -1
- package/ui/dist/assets/CPOrg-DQ3tbYld.js +0 -8
- package/ui/dist/assets/CPRuns-0vncicUW.js +0 -1
- package/ui/dist/assets/ChannelsPanel-CiJs4gyw.js +0 -1
- package/ui/dist/assets/FleetPanel-Bg-f3_ip.js +0 -1
- package/ui/dist/assets/InfraView-CHYaZqMK.js +0 -2
- package/ui/dist/assets/InlineEditableField-BOLRKQq1.js +0 -1
- package/ui/dist/assets/Input-4pNffAw-.js +0 -1
- package/ui/dist/assets/IntegrationsPanel-CFucvr-Q.js +0 -1
- package/ui/dist/assets/IntelligenceView-Dh-Wuf13.js +0 -2
- package/ui/dist/assets/LearningPanel-CtlougkF.js +0 -1
- package/ui/dist/assets/McpPanel-BobqpLsh.js +0 -1
- package/ui/dist/assets/MemoryWikiPanel-BfYksjoI.js +0 -11
- package/ui/dist/assets/MissionCanvas-0V_vtqiu.js +0 -50
- package/ui/dist/assets/MissionChat-9hGhc9Zw.js +0 -7
- package/ui/dist/assets/MissionLibrary-dFkT8pGp.js +0 -5
- package/ui/dist/assets/MissionStart-CZSEie0Q.js +0 -1
- package/ui/dist/assets/Modal-V2yNnkKk.js +0 -1
- package/ui/dist/assets/NvidiaPanel-qLJysI9M.js +0 -1
- package/ui/dist/assets/OverviewPanel-Be6LukJ_.js +0 -1
- package/ui/dist/assets/RecipesPanel-DDYOCx3w.js +0 -1
- package/ui/dist/assets/SelfImprovePanel-B8o_fO30.js +0 -1
- package/ui/dist/assets/SessionsPanel-DeCBkSgY.js +0 -1
- package/ui/dist/assets/SettingsPanel-BlsRDAt7.js +0 -1
- package/ui/dist/assets/SettingsView-Dsa7Zr4e.js +0 -2
- package/ui/dist/assets/SkeletonLoader-BkQoZllJ.js +0 -1
- package/ui/dist/assets/StatusBadge-BFEHCdgi.js +0 -1
- package/ui/dist/assets/Tabs-g2Gs9sK0.js +0 -1
- package/ui/dist/assets/TelemetryPanel-DXAGuV0R.js +0 -1
- package/ui/dist/assets/TitanCanvas-DCl3gxSl.js +0 -1072
- package/ui/dist/assets/ToolsView-CnUjq0Js.js +0 -2
- package/ui/dist/assets/Tooltip-DJ99YlFF.js +0 -6
- package/ui/dist/assets/TrainingPanel-BLf_KMaE.js +0 -1
- package/ui/dist/assets/eye-off-CYR4nH5I.js +0 -6
- package/ui/dist/assets/index-PwwKjgT3.css +0 -1
- package/ui/dist/assets/index-slWylU2o.js +0 -244
- package/ui/dist/assets/loader-circle-E8aLxmMz.js +0 -6
package/ui/dist/index.html
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<link rel="manifest" href="/manifest.json" />
|
|
10
10
|
<link rel="apple-touch-icon" href="/titan-logo.png" />
|
|
11
11
|
<title>TITAN Mission Control</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-B8YEFBRH.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cb5bSxRB.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body class="bg-zinc-950 text-zinc-100">
|
|
16
16
|
<div id="root"></div>
|
package/ui/dist/sw.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* but a default falls back to the source-controlled value here.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
const CACHE_NAME = 'titan-' + ('
|
|
23
|
+
const CACHE_NAME = 'titan-' + ('1778976639114');
|
|
24
24
|
const ASSETS_PREFIX = '/assets/';
|
|
25
25
|
|
|
26
26
|
self.addEventListener('install', (event) => {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,a$ as f,j as e,b0 as u,b1 as h}from"./index-slWylU2o.js";import{P as g}from"./PageHeader-llOXO43Z.js";import{P as b}from"./plus-O61rB_YF.js";import{R as y}from"./terminal-CdhfA0Kr.js";import{A as j}from"./TitanCanvas-DCl3gxSl.js";import{C as v}from"./circle-check-big-DPz64kZW.js";import"./chevron-right-aFDDgFsL.js";import"./chevron-up-D6g7FB6i.js";import"./users-BX_ZaByZ.js";import"./wrench-Cfp7nYhG.js";import"./network-v9O7MmZT.js";import"./save-D2Qh8KyN.js";import"./rotate-ccw-n5WkWR51.js";import"./search-C9SdcZJq.js";import"./send-DZ_5M5QQ.js";import"./VoiceOverlay-B08Sw918.js";import"./chevron-down-CM11GPpR.js";import"./folder-DY4eeMdo.js";import"./clock-BbCCaukN.js";import"./check-BcOm5jPO.js";import"./shield-check-DyP5PmaY.js";import"./external-link-BgxGF7ZQ.js";import"./loader-circle-E8aLxmMz.js";function O(){const[r,p]=t.useState([]),[i,c]=t.useState(!0),[l,o]=t.useState(!1),[n,m]=t.useState(null),s=t.useCallback(async()=>{c(!0);try{const a=await f();p(a.backups||[])}catch{}c(!1)},[]);t.useEffect(()=>{s()},[s]);const d=async()=>{o(!0);try{await u(),await s()}catch{}o(!1)},x=async a=>{m(a);try{await h(a),alert("Backup verified successfully")}catch{alert("Backup verification failed")}m(null)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{title:"Backup Manager",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"Backups"}]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:d,disabled:l,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(b,{className:"w-4 h-4"})," ",l?"Creating...":"Create Backup"]}),e.jsxs("button",{onClick:s,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(y,{className:`w-4 h-4 ${i?"animate-spin":""}`})," Refresh"]})]}),r.length===0&&!i&&e.jsx("div",{className:"text-sm text-[#52525b]",children:"No backups found."}),e.jsx("div",{className:"space-y-2",children:r.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(j,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:new Date(a.createdAt).toLocaleString()}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[(a.sizeBytes/1024/1024).toFixed(1)," MB"]})]})]}),e.jsxs("button",{onClick:()=>x(a.path),disabled:n===a.path,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] text-xs hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(v,{className:"w-3.5 h-3.5"})," ",n===a.path?"Verifying...":"Verify"]})]},a.path))})]})}export{O as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,bs as y,j as e,A as u,Z as j,T as S}from"./index-slWylU2o.js";import"./Input-4pNffAw-.js";import{P as A}from"./PageHeader-llOXO43Z.js";import{E as T}from"./EmptyState-CmK9fywh.js";import{T as E}from"./Tabs-g2Gs9sK0.js";import{S as N}from"./SkeletonLoader-BkQoZllJ.js";import{W as C,B as w}from"./wrench-Cfp7nYhG.js";import{S as P}from"./shield-check-DyP5PmaY.js";import{D as $}from"./dollar-sign-Dy5-qkg3.js";import{T as k}from"./target-CWfn705s.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.js";function I(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`}const D={agent:w,goal:k,budget:$,approval:P,error:S,tool:C,system:j},M={agent:"text-accent",goal:"text-success",budget:"text-warning",approval:"text-info",error:"text-error",tool:"text-text-secondary",system:"text-text-muted"};function q(){const[s,r]=a.useState([]),[i,f]=a.useState(!0),[o,x]=a.useState(null),[n,h]=a.useState("all"),l=a.useRef(null),c=a.useCallback(async()=>{try{const t=await y(100);r(t),x(null)}catch(t){x(t instanceof Error?t.message:"Failed to load activity")}f(!1)},[]);a.useEffect(()=>(c(),l.current=setInterval(c,1e4),()=>{l.current&&clearInterval(l.current)}),[c]);const p=Array.from(new Set(s.map(t=>t.type))),g=[{id:"all",label:"All",count:s.length},...p.map(t=>({id:t,label:t.charAt(0).toUpperCase()+t.slice(1),count:s.filter(d=>d.type===t).length}))],m=n==="all"?s:s.filter(t=>t.type===n);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(A,{title:"Activity",subtitle:"Auto-refreshes every 10s",breadcrumbs:[{label:"Command Post"},{label:"Activity"}]}),p.length>0&&e.jsx(E,{tabs:g,activeTab:n,onChange:h}),i&&e.jsx(N,{variant:"row",count:8}),o&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:o}),!i&&!o&&m.length===0&&e.jsx(T,{icon:e.jsx(u,{size:32}),title:"No activity",description:"Agent activity will appear here as events occur."}),!i&&!o&&m.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:m.map((t,d)=>{const v=D[t.type]??u,b=M[t.type]??"text-text-muted";return e.jsxs("div",{className:"flex items-start gap-3 px-4 py-2.5",children:[e.jsx(v,{size:14,className:`${b} mt-0.5 flex-shrink-0`}),e.jsx("span",{className:"flex-1 text-sm text-text-secondary",children:t.message}),t.agentId&&e.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:t.agentId}),e.jsx("span",{className:"text-xs text-text-muted flex-shrink-0",children:I(t.timestamp)})]},`${t.id}-${d}`)})})]})}export{q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as K,u as O,r as s,bq as G,y as J,K as Q,q as V,j as e,L as A,a5 as W}from"./index-slWylU2o.js";import{B as T}from"./Input-4pNffAw-.js";import{S as c}from"./StatusBadge-BFEHCdgi.js";import{P as x}from"./PageHeader-llOXO43Z.js";import{E as X}from"./EmptyState-CmK9fywh.js";import{T as Y}from"./Tabs-g2Gs9sK0.js";import{S as Z}from"./SkeletonLoader-BkQoZllJ.js";import{A as _}from"./arrow-left-CHJyrO8S.js";import{C as ee}from"./circle-check-big-DPz64kZW.js";import{D as te}from"./dollar-sign-Dy5-qkg3.js";import{C as se}from"./clock-BbCCaukN.js";import{S as ae}from"./save-D2Qh8KyN.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.js";function k(a){const o=Math.floor((Date.now()-new Date(a).getTime())/1e3);return o<60?`${o}s`:o<3600?`${Math.floor(o/60)}m`:o<86400?`${Math.floor(o/3600)}h`:`${Math.floor(o/86400)}d`}function re(a){return a?a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`:"-"}function je(){const{id:a}=K(),o=O(),[r,m]=s.useState(null),[n,E]=s.useState([]),[u,M]=s.useState([]),[P,b]=s.useState(!0),[p,i]=s.useState(null),[d,z]=s.useState("overview"),[h,g]=s.useState(""),[f,j]=s.useState(""),[v,N]=s.useState(""),[y,S]=s.useState(""),[D,C]=s.useState(!1),[R,$]=s.useState([]),w=s.useCallback(async()=>{if(a){try{const l=(await G()).find(U=>U.id===a);if(!l){i("Agent not found"),b(!1);return}m(l),g(l.role),j(l.reportsTo??""),N(l.title??""),S(l.model??"");const[F,H]=await Promise.all([J(a),Q({assignee:a})]);E(F),M(H),i(null)}catch(t){i(t instanceof Error?t.message:"Failed to load agent")}b(!1)}},[a]);s.useEffect(()=>{w()},[w]),s.useEffect(()=>{V().then(t=>$(t)).catch(()=>{})},[]);const B=async()=>{if(a){C(!0);try{const t=await W(a,{role:h,reportsTo:f||void 0,title:v||void 0,model:y||void 0});m(t)}catch{}C(!1)}},L=[{id:"overview",label:"Overview"},{id:"runs",label:"Runs",count:n.length},{id:"config",label:"Config"}];if(P)return e.jsxs("div",{className:"space-y-6",children:[e.jsx(x,{title:"Agent",breadcrumbs:[{label:"Command Post"},{label:"Agents",href:"/command-post/agents"},{label:"..."}]}),e.jsx(Z,{variant:"card",count:1})]});if(p||!r)return e.jsxs("div",{className:"space-y-6",children:[e.jsx(x,{title:"Agent",breadcrumbs:[{label:"Command Post"},{label:"Agents",href:"/command-post/agents"},{label:"Error"}]}),e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-error text-sm mb-4",children:p??"Agent not found"}),e.jsx(T,{variant:"secondary",size:"sm",onClick:()=>o("/command-post/agents"),children:"Back to Agents"})]})]});const I=Date.now()-new Date(r.createdAt).getTime(),q=Math.floor(I/36e5);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{title:r.name,subtitle:r.title??r.role,breadcrumbs:[{label:"Command Post"},{label:"Agents",href:"/command-post/agents"},{label:r.name}],actions:e.jsxs(A,{to:"/command-post/agents",className:"flex items-center gap-1 text-xs text-text-muted hover:text-text",children:[e.jsx(_,{size:14})," Back"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(c,{status:r.status}),e.jsxs("span",{className:"text-xs text-text-muted",children:["Last heartbeat: ",k(r.lastHeartbeat)," ago"]})]}),e.jsx(Y,{tabs:L,activeTab:d,onChange:z}),d==="overview"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4 text-center",children:[e.jsx(ee,{size:16,className:"text-success mx-auto mb-1"}),e.jsx("div",{className:"text-xl font-bold text-text",children:r.totalTasksCompleted}),e.jsx("div",{className:"text-[10px] text-text-muted",children:"Tasks Completed"})]}),e.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4 text-center",children:[e.jsx(te,{size:16,className:"text-warning mx-auto mb-1"}),e.jsxs("div",{className:"text-xl font-bold text-text",children:["$",r.totalCostUsd.toFixed(4)]}),e.jsx("div",{className:"text-[10px] text-text-muted",children:"Total Cost"})]}),e.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4 text-center",children:[e.jsx(se,{size:16,className:"text-accent mx-auto mb-1"}),e.jsxs("div",{className:"text-xl font-bold text-text",children:[q,"h"]}),e.jsx("div",{className:"text-[10px] text-text-muted",children:"Uptime"})]})]}),e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border",children:e.jsx("h3",{className:"text-sm font-semibold text-text",children:"Assigned Issues"})}),u.length===0?e.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No assigned issues"}):e.jsx("div",{className:"divide-y divide-border",children:u.map(t=>e.jsxs(A,{to:`/command-post/issues/${t.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[e.jsx(c,{status:t.status,variant:"dot",size:"sm"}),e.jsx("span",{className:"text-xs text-text flex-1 truncate",children:t.title}),e.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:t.identifier})]},t.id))})]})]}),d==="runs"&&e.jsx("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:n.length===0?e.jsx(X,{title:"No runs",description:"This agent has not executed any runs yet."}):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 text-text-muted font-medium",children:"Source"}),e.jsx("th",{className:"px-4 py-2 text-text-muted font-medium",children:"Status"}),e.jsx("th",{className:"px-4 py-2 text-text-muted font-medium",children:"Duration"}),e.jsx("th",{className:"px-4 py-2 text-text-muted font-medium",children:"Tools"}),e.jsx("th",{className:"px-4 py-2 text-text-muted font-medium",children:"Started"})]})}),e.jsx("tbody",{className:"divide-y divide-border",children:n.map(t=>e.jsxs("tr",{className:"hover:bg-bg-tertiary/50 transition-colors",children:[e.jsx("td",{className:"px-4 py-2 text-text-secondary capitalize",children:t.source}),e.jsx("td",{className:"px-4 py-2",children:e.jsx(c,{status:t.status,size:"sm"})}),e.jsx("td",{className:"px-4 py-2 text-text-secondary",children:re(t.durationMs)}),e.jsx("td",{className:"px-4 py-2 text-text-muted",children:t.toolsUsed.length}),e.jsxs("td",{className:"px-4 py-2 text-text-muted",children:[k(t.startedAt)," ago"]})]},t.id))})]})})}),d==="config"&&e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-4 space-y-4 max-w-md",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Role"}),e.jsx("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:h,onChange:t=>g(t.target.value),children:["ceo","manager","engineer","researcher","general"].map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Reports To"}),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:"Agent ID...",value:f,onChange:t=>j(t.target.value)})]}),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:"e.g. Senior Engineer",value:v,onChange:t=>N(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Model"}),e.jsx("input",{list:"cp-agent-models",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:"e.g. ollama/qwen3.5:cloud",value:y,onChange:t=>S(t.target.value)}),e.jsx("datalist",{id:"cp-agent-models",children:R.map(t=>e.jsx("option",{value:t.id,children:t.name??t.id},t.id))})]}),e.jsx(T,{size:"sm",icon:e.jsx(ae,{size:14}),onClick:B,loading:D,children:"Save"})]})]})}export{je as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,bq as m,j as e,L as p,X as u,b as h}from"./index-slWylU2o.js";import"./Input-4pNffAw-.js";import{S as j}from"./StatusBadge-BFEHCdgi.js";import{P as f}from"./PageHeader-llOXO43Z.js";import{E as g}from"./EmptyState-CmK9fywh.js";import{S as b}from"./SkeletonLoader-BkQoZllJ.js";import{U as N}from"./users-BX_ZaByZ.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.js";function y(a){const s=Math.floor((Date.now()-new Date(a).getTime())/1e3);return s<60?`${s}s`:s<3600?`${Math.floor(s/60)}m`:s<86400?`${Math.floor(s/3600)}h`:`${Math.floor(s/86400)}d`}function v(a){const s=a.split("/");return s[s.length-1]}function D(){const[a,s]=r.useState([]),[c,d]=r.useState(!0),[o,l]=r.useState(null),i=r.useCallback(async()=>{try{const t=await m();s(t),l(null)}catch(t){l(t instanceof Error?t.message:"Failed to load agents")}d(!1)},[]);r.useEffect(()=>{i()},[i]);const x=async(t,n)=>{n.preventDefault(),n.stopPropagation();try{await h(`/api/command-post/agents/${t}`,{method:"DELETE"}),await i()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(f,{title:"Agents",breadcrumbs:[{label:"Command Post"},{label:"Agents"}]}),c&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.jsx(b,{variant:"card",count:6})}),o&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:o}),!c&&!o&&a.length===0&&e.jsx(g,{icon:e.jsx(N,{size:32}),title:"No agents registered",description:"Agents will appear here once they connect to Command Post."}),!c&&!o&&a.length>0&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:a.map(t=>e.jsxs(p,{to:`/command-post/agents/${t.id}`,className:"relative bg-bg-secondary border border-border rounded-xl p-4 hover:border-border-light transition-colors group",children:[t.role!=="ceo"&&e.jsx("button",{onClick:n=>x(t.id,n),className:"absolute top-3 right-3 p-1 rounded-md text-text-muted hover:text-error hover:bg-error/10 opacity-0 group-hover:opacity-100 transition-all",title:"Remove agent",children:e.jsx(u,{size:14})}),e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-sm font-semibold text-text",children:t.name}),e.jsx(j,{status:t.status,size:"sm"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Role"}),e.jsx("span",{className:"text-xs text-text-secondary capitalize",children:t.role})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Model"}),e.jsx("span",{className:"text-xs text-text-secondary truncate max-w-[140px]",children:v(t.model)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Last Heartbeat"}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[y(t.lastHeartbeat)," ago"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Tasks Done"}),e.jsx("span",{className:"text-xs text-text-secondary",children:t.totalTasksCompleted})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Cost"}),e.jsxs("span",{className:"text-xs text-text-secondary",children:["$",t.totalCostUsd.toFixed(4)]})]})]})]},t.id))})]})}export{D as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,br as B,J as P,j as t,T as z,X as R,V as $,Y as _}from"./index-slWylU2o.js";import{B as A}from"./Input-4pNffAw-.js";import{S as D}from"./StatusBadge-BFEHCdgi.js";import{P as M}from"./PageHeader-llOXO43Z.js";import{E as L}from"./EmptyState-CmK9fywh.js";import{T as W}from"./Tabs-g2Gs9sK0.js";import{S as F}from"./SkeletonLoader-BkQoZllJ.js";import{e as H}from"./approvalHeadline-DB9SgR-9.js";import{S as I}from"./shield-check-DyP5PmaY.js";import{C as U}from"./check-BcOm5jPO.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.js";function q(r){const o=Math.floor((Date.now()-new Date(r).getTime())/1e3);return o<60?`${o}s`:o<3600?`${Math.floor(o/60)}m`:o<86400?`${Math.floor(o/3600)}h`:`${Math.floor(o/86400)}d`}function J(r){return r==="high"?"text-error bg-error/10 border-error/30":r==="medium"?"text-warn bg-warn/10 border-warn/30":"text-text-muted bg-bg-tertiary border-border"}const K=[{id:"all",label:"All"},{id:"pending",label:"Pending"},{id:"approved",label:"Approved"},{id:"rejected",label:"Rejected"}];function ae(){const[r,o]=a.useState([]),[m,k]=a.useState(!0),[i,d]=a.useState(null),[l,w]=a.useState("all"),[h,c]=a.useState(null),[b,v]=a.useState({}),[u,j]=a.useState(null),{toast:p}=B(),x=a.useCallback(async()=>{try{const e=await P();o(e),d(null)}catch(e){d(e instanceof Error?e.message:"Failed to load approvals")}k(!1)},[]);a.useEffect(()=>{x()},[x]);const y=async e=>{var s;c(e.id);try{const n=(s=b[e.id])==null?void 0:s.trim();await $(e.id,"user",n||void 0),await x();const f=e.type==="goal_proposal"||e.type==="soma_proposal",T=e.type==="custom"&&e.payload.kind==="driver_blocked";p("success",f?"Work approved — TITAN is starting…":T?"Unblocked — TITAN is resuming…":"Approved"),v(E=>{const N={...E};return delete N[e.id],N}),j(null)}catch(n){d(n instanceof Error?n.message:"Approve failed"),p("error","Approval failed")}c(null)},S=async e=>{c(e.id);try{await _(e.id,"user"),await x(),p("success","Rejected")}catch(s){d(s instanceof Error?s.message:"Reject failed"),p("error","Rejection failed")}c(null)},g=l==="all"?r:r.filter(e=>e.status===l),C=K.map(e=>({...e,count:e.id==="all"?r.length:r.filter(s=>s.status===e.id).length}));return t.jsxs("div",{className:"space-y-4",children:[t.jsx(M,{title:"Approvals",breadcrumbs:[{label:"Command Post"},{label:"Approvals"}]}),t.jsx(W,{tabs:C,activeTab:l,onChange:w}),m&&t.jsx(F,{variant:"row",count:5}),i&&t.jsx("div",{className:"text-center py-8 text-error text-sm",children:i}),!m&&!i&&g.length===0&&t.jsx(L,{icon:t.jsx(I,{size:32}),title:"No approvals",description:l==="pending"?"No pending approvals.":"No approvals to show."}),!m&&!i&&g.length>0&&t.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:g.map(e=>{const s=H(e);return t.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[t.jsxs("span",{className:`text-[10px] px-1.5 py-0.5 rounded border font-medium uppercase tracking-wide ${J(s.urgency)}`,children:[s.urgency==="high"&&t.jsx(z,{size:10,className:"inline mr-0.5"}),s.kindLabel]}),t.jsx(D,{status:e.status,size:"sm"}),t.jsxs("span",{className:"text-xs text-text-muted",children:["from ",t.jsx("span",{className:"font-medium text-text-secondary",children:e.requestedBy})]})]}),t.jsx("div",{className:"text-sm text-text font-medium leading-snug mb-0.5",children:s.headline}),s.detail&&t.jsx("div",{className:"text-xs text-text-secondary leading-snug",children:s.detail}),e.decidedBy&&t.jsxs("div",{className:"text-[10px] text-text-muted mt-1",children:["Decided by ",e.decidedBy,e.decisionNote?`: ${e.decisionNote}`:""]})]}),t.jsx("span",{className:"text-xs text-text-muted flex-shrink-0 pt-0.5",children:q(e.createdAt)}),e.status==="pending"&&t.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[e.type==="custom"&&e.payload.kind==="driver_blocked"&&t.jsx("button",{onClick:()=>j(u===e.id?null:e.id),className:"text-[10px] text-text-muted hover:text-text-secondary px-2 py-1 rounded hover:bg-bg-tertiary transition-colors",children:u===e.id?"Cancel":"Answer"}),t.jsx(A,{size:"sm",variant:"ghost",onClick:()=>y(e),loading:h===e.id,icon:t.jsx(U,{size:14}),children:"Approve"}),t.jsx(A,{size:"sm",variant:"ghost",onClick:()=>S(e),loading:h===e.id,icon:t.jsx(R,{size:14}),children:"Reject"})]}),u===e.id&&t.jsx("input",{type:"text",value:b[e.id]||"",onChange:n=>v(f=>({...f,[e.id]:n.target.value})),placeholder:"Type your answer...",className:"w-64 rounded-md border border-border bg-bg px-3 py-1.5 text-xs text-text outline-none focus:border-accent mt-1",onKeyDown:n=>{n.key==="Enter"&&y(e)},autoFocus:!0})]})]},e.id)})})]})}export{ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,bu as E,bv as A,j as e,O as L,a4 as W}from"./index-slWylU2o.js";import{B as u}from"./Input-4pNffAw-.js";import{S as C}from"./StatusBadge-BFEHCdgi.js";import{P as M}from"./PageHeader-llOXO43Z.js";import{E as R}from"./EmptyState-CmK9fywh.js";import{M as G}from"./Modal-V2yNnkKk.js";import{S as H}from"./SkeletonLoader-BkQoZllJ.js";import{P as O}from"./plus-O61rB_YF.js";import{D as q}from"./dollar-sign-Dy5-qkg3.js";import{T as J}from"./trash-2-TQcEJEv4.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.js";import"./proxy-BAUTNyg6.js";function K(a){const l=a.limitUsd>0?a.currentSpend/a.limitUsd*100:0;return l>=100?"exceeded":l>=a.warningThresholdPercent?"warning":"healthy"}function oe(){const[a,l]=s.useState([]),[m,S]=s.useState([]),[c,k]=s.useState(!0),[n,g]=s.useState(null),[P,r]=s.useState(!1),[B,p]=s.useState(!1),[o,h]=s.useState(""),[d,z]=s.useState("global"),[b,j]=s.useState(""),[f,T]=s.useState("monthly"),[v,N]=s.useState("10"),[y,I]=s.useState("80"),[w,U]=s.useState("warn"),i=s.useCallback(async()=>{try{const t=await E();l(t),g(null)}catch(t){g(t instanceof Error?t.message:"Failed to load budgets")}k(!1)},[]);s.useEffect(()=>{i(),A().then(S).catch(()=>{})},[i]);const D=async()=>{if(o.trim()){p(!0);try{await W({name:o.trim(),scope:{type:d,targetId:b||void 0},period:f,limitUsd:parseFloat(v)||10,warningThresholdPercent:parseInt(y)||80,action:w,enabled:!0}),r(!1),h(""),j(""),N("10"),await i()}catch{}p(!1)}},F=async t=>{try{await L(t),await i()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(M,{title:"Costs & Budgets",breadcrumbs:[{label:"Command Post"},{label:"Costs"}],actions:e.jsx(u,{size:"sm",icon:e.jsx(O,{size:14}),onClick:()=>r(!0),children:"Create Budget"})}),c&&e.jsx(H,{variant:"row",count:4}),n&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:n}),!c&&!n&&a.length===0&&e.jsx(R,{icon:e.jsx(q,{size:32}),title:"No budgets",description:"Create budget policies to control agent spending.",action:{label:"Create Budget",onClick:()=>r(!0)}}),!c&&!n&&a.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:a.map(t=>{const $=t.limitUsd>0?t.currentSpend/t.limitUsd*100:0,x=K(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(C,{status:x,size:"sm"}),!t.enabled&&e.jsx(C,{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,$)}%`}})})]}),e.jsx("button",{onClick:()=>F(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(J,{size:14})})]},t.id)})}),m.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border",children:e.jsx("h3",{className:"text-sm font-medium text-text",children:"Active Reservations"})}),e.jsx("div",{className:"divide-y divide-border",children:m.map(t=>e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm text-text",children:t.agentId}),t.goalId&&e.jsxs("span",{className:"text-xs text-text-muted ml-2",children:["Goal: ",t.goalId]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${t.status==="reserved"?"bg-warning/20 text-warning":t.status==="settled"?"bg-success/20 text-success":"bg-bg-tertiary text-text-muted"}`,children:t.status}),e.jsxs("span",{className:"text-sm font-mono text-text",children:["$",t.status==="settled"?(t.actualUsd??0).toFixed(4):t.estimatedUsd.toFixed(4)]})]})]},t.id))})]}),e.jsx(G,{open:P,onClose:()=>r(!1),title:"Create Budget Policy",footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",size:"sm",onClick:()=>r(!1),children:"Cancel"}),e.jsx(u,{size:"sm",onClick:D,loading:B,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=>h(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:d,onChange:t=>z(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:f,onChange:t=>T(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"})]})]})]}),d!=="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:`${d} ID...`,value:b,onChange:t=>j(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:v,onChange:t=>N(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=>I(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:w,onChange:t=>U(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{oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as g,j as t,B as se,bs as le,K as re,J as ae,A as q,L as U}from"./index-slWylU2o.js";import"./Input-4pNffAw-.js";import{S as ie}from"./StatusBadge-BFEHCdgi.js";import{P as V}from"./PageHeader-llOXO43Z.js";import{S as oe}from"./SkeletonLoader-BkQoZllJ.js";import{R as ne}from"./terminal-CdhfA0Kr.js";import{U as ce}from"./users-BX_ZaByZ.js";import{L as _}from"./list-todo-say4NbSw.js";import{D as de}from"./dollar-sign-Dy5-qkg3.js";import{T as xe}from"./target-CWfn705s.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.js";const J={idle:"var(--color-text-secondary)",active:"var(--color-success)",paused:"var(--color-warning)",error:"var(--color-error)",stopped:"var(--color-border-light)"},me={ceo:"C",manager:"M",engineer:"E",researcher:"R",general:"G"};function fe({agents:c,activity:d}){const u=g.useRef(null),R=g.useRef(c),p=g.useRef(d);return R.current=c,p.current=d,g.useEffect(()=>{const b=u.current;if(!b)return;const e=b.getContext("2d");if(!e)return;const w=window.devicePixelRatio||1;let C,L=0;const y=()=>{const o=b.clientWidth,x=b.clientHeight;b.width=o*w,b.height=x*w,e.setTransform(w,0,0,w,0,0)};y(),window.addEventListener("resize",y);const M=()=>{L++;const o=L/15,x=b.clientWidth,m=b.clientHeight,r=R.current,j=p.current;e.fillStyle="var(--color-bg)",e.fillRect(0,0,x,m),e.strokeStyle="#141418",e.lineWidth=.5;for(let s=0;s<x;s+=24)e.beginPath(),e.moveTo(s,m*.72),e.lineTo(s,m),e.stroke();for(let s=m*.72;s<m;s+=24)e.beginPath(),e.moveTo(0,s),e.lineTo(x,s),e.stroke();if(r.length===0){e.fillStyle="var(--color-bg-tertiary)",e.font="12px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("No agents registered",x/2,m/2-10),e.font="10px -apple-system, BlinkMacSystemFont, sans-serif",e.fillStyle="var(--color-border)",e.fillText("Spawn agents to see them here",x/2,m/2+10),e.textAlign="start",C=requestAnimationFrame(M);return}const I=Math.min(r.length,8),A=Math.min(120,(x-20)/I),Q=(x-A*I)/2+A/2;for(let s=0;s<I;s++){const k=r[s],l=Q+s*A,a=m*.55,f=k.status==="active"?"active":k.status,$=J[f]||J.idle,i=Math.sin(o*.8+s*1.5)*1.5,z=j.some(n=>n.agentId===k.id&&Date.now()-new Date(n.timestamp).getTime()<3e4),D=Math.min(70,A-10),P=10,B=l-D/2,S=a+16;e.fillStyle="var(--color-border)",e.fillRect(B,S,D,P),e.fillStyle="var(--color-border-light)",e.fillRect(B+1,S+1,D-2,P-2),e.fillStyle="var(--color-border)",e.fillRect(B+3,S+P,3,14),e.fillRect(B+D-6,S+P,3,14);const F=26,W=18,H=l-F/2,O=S-W;e.fillStyle="var(--color-bg-tertiary)",e.fillRect(H,O,F,W);const X=f==="error"?"var(--color-error)":f==="active"?"var(--color-success)":"var(--color-accent)";if(e.fillStyle=X+"30",e.fillRect(H+2,O+2,F-4,W-4),f==="active"||z){e.fillStyle=X+"60";const n=2+Math.floor(o%3);for(let h=0;h<n;h++){const T=6+Math.sin(o*2+h+s)*5;e.fillRect(H+3,O+3+h*4,T,1.5)}}e.fillStyle="var(--color-border)",e.fillRect(l-2,S-1,4,3),e.fillStyle="#1e1e22",e.fillRect(l-10,a+10+i,20,8),e.fillRect(l-11,a-2+i,3,20),e.fillStyle="var(--color-border)",e.fillRect(l-7,a+i,14,12);const v=f==="active"&&z?Math.sin(o*1.5+s)*1.5:0;e.fillStyle="var(--color-border-light)",e.fillRect(l-6,a-10+i+v,12,10);const Y=Math.sin(o*.3+s*2)>.95?1:2;if(e.fillStyle=$,f==="stopped"?(e.fillRect(l-4,a-7+i+v,2,1),e.fillRect(l-3,a-6+i+v,2,1),e.fillRect(l+1,a-7+i+v,2,1),e.fillRect(l+2,a-6+i+v,2,1)):(e.fillRect(l-4,a-7+i+v,2,Y),e.fillRect(l+2,a-7+i+v,2,Y)),e.fillStyle="var(--color-border-light)",e.fillRect(l-1,a-14+i+v,2,4),e.fillStyle=$,e.beginPath(),e.arc(l,a-15+i+v,2,0,Math.PI*2),e.fill(),f==="active"&&(e.globalAlpha=.3+Math.sin(o*3+s)*.2,e.beginPath(),e.arc(l,a-15+i+v,5,0,Math.PI*2),e.fill(),e.globalAlpha=1),f==="active"&&z){const n=Math.sin(o*6+s)*2,h=Math.sin(o*6+s+Math.PI)*2;e.fillStyle="var(--color-border)",e.fillRect(l-11,a+3+i+n,4,3),e.fillRect(l+7,a+3+i+h,4,3)}else e.fillStyle="var(--color-border)",e.fillRect(l-10,a+5+i,3,6),e.fillRect(l+7,a+5+i,3,6);if(f==="active"&&z){for(let n=0;n<2;n++){const h=o*1.5+n*Math.PI+s,T=14+Math.sin(o+n)*4,ee=l+Math.cos(h)*T,te=a-3+Math.sin(h)*T*.4+i;e.globalAlpha=.25+Math.sin(o*2+n)*.15,e.fillStyle=$,e.beginPath(),e.arc(ee,te,1,0,Math.PI*2),e.fill()}e.globalAlpha=1}if(f==="error"){for(let n=0;n<3;n++){const h=l+Math.sin(o*4+n*2)*12,T=a-5+Math.cos(o*3+n)*8+i;e.globalAlpha=.4+Math.sin(o+n)*.3,e.fillStyle="var(--color-error)",e.fillRect(h-1,T-1,2,2)}e.globalAlpha=1}e.fillStyle=f==="stopped"?"var(--color-border)":"var(--color-text-muted)",e.font="9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center";const G=Math.max(44,D+14);let N=k.name;if(e.measureText(N).width>G){for(;N.length>1&&e.measureText(N+"…").width>G;)N=N.slice(0,-1);N=N.trimEnd()+"…"}e.fillText(N,l,S+P+24);const Z=me[k.role]||"G";e.fillStyle=$+"60",e.font="bold 7px -apple-system, BlinkMacSystemFont, sans-serif",e.fillText(Z,l,S+P+33),e.textAlign="start"}if(e.fillStyle="var(--color-bg-tertiary)",e.font="bold 9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("COMMAND POST",x/2,m-6),e.textAlign="start",j.length>0){const s=j[j.length-1];if(Date.now()-new Date(s.timestamp).getTime()<6e4){e.fillStyle="var(--color-accent)40",e.fillRect(0,0,x,16),e.fillStyle="var(--color-accent-light)",e.font="8px -apple-system, BlinkMacSystemFont, sans-serif";const l=s.message.length>60?s.message.slice(0,57)+"...":s.message;e.textAlign="center",e.fillText(l,x/2,11),e.textAlign="start"}}C=requestAnimationFrame(M)};return M(),()=>{cancelAnimationFrame(C),window.removeEventListener("resize",y)}},[]),t.jsx("canvas",{ref:u,className:"w-full rounded-xl border border-border",style:{height:220,imageRendering:"pixelated"}})}function K(c){const d=Math.floor((Date.now()-new Date(c).getTime())/1e3);return d<60?`${d}s`:d<3600?`${Math.floor(d/60)}m`:d<86400?`${Math.floor(d/3600)}h`:`${Math.floor(d/86400)}d`}function E({icon:c,label:d,value:u,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(c,{size:14,className:p}),t.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:d})]}),t.jsx("div",{className:"text-2xl font-bold text-text",children:u}),R&&t.jsx("div",{className:"text-[11px] text-text-muted mt-1",children:R})]})}function Ae(){var m;const[c,d]=g.useState(null),[u,R]=g.useState([]),[p,b]=g.useState([]),[e,w]=g.useState(0),[C,L]=g.useState(!0),y=g.useCallback(async()=>{try{const[r,j,I,A]=await Promise.all([se(),le(20),re(),ae("pending")]);d(r),R(j),b(I),w(A.length)}catch{}L(!1)},[]);if(g.useEffect(()=>{y();const r=setInterval(y,15e3);return()=>clearInterval(r)},[y]),C)return t.jsxs("div",{className:"space-y-6",children:[t.jsx(V,{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(oe,{variant:"metric",count:4})})]});if(!c)return t.jsx("div",{className:"text-center py-12 text-text-muted",children:"Failed to load dashboard"});const M=c.budgetUtilization??0,o=p.filter(r=>r.status==="in_progress").length,x=p.filter(r=>r.status==="blocked").length;return t.jsxs("div",{className:"space-y-6",children:[t.jsx(V,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}],actions:t.jsx("button",{onClick:y,className:"p-1.5 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:t.jsx(ne,{size:16})})}),t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[t.jsx(E,{icon:ce,label:"Agents Enabled",value:c.totalAgents,sub:`${c.activeAgents} running, ${Math.max(0,c.totalAgents-c.activeAgents)} paused`,color:"text-info"}),t.jsx(E,{icon:_,label:"Tasks In Progress",value:o,sub:`${p.length} open, ${x} blocked`,color:"text-warning"}),t.jsx(E,{icon:de,label:"Budget Used",value:`${Math.round(M)}%`,sub:M>=80?"Nearing limit":"Healthy",color:M>=80?"text-error":"text-success"}),t.jsx(E,{icon:xe,label:"Goals",value:((m=c.goalTree)==null?void 0:m.length)??0,sub:"in hierarchy",color:"text-purple"})]}),c.agents.length>0&&t.jsx(fe,{agents:c.agents,activity:u}),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(U,{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:u.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No activity yet"}):[...u].reverse().slice(0,15).map((r,j)=>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:r.message}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:K(r.timestamp)})]},`${r.timestamp}-${j}`))})]}),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(_,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Issues"})]}),t.jsx(U,{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(r=>t.jsxs(U,{to:`/command-post/issues/${r.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[t.jsx(ie,{status:r.status,variant:"dot",size:"sm"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1 truncate",children:r.title}),r.assigneeAgentId&&t.jsx("span",{className:"text-[10px] text-text-muted",children:r.assigneeAgentId}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:K(r.updatedAt)})]},r.id))})]})]})]})}export{Ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,bt as D,j as e,X as $,b as N}from"./index-slWylU2o.js";import{B as j}from"./Input-4pNffAw-.js";import{S as T}from"./StatusBadge-BFEHCdgi.js";import{P as M}from"./PageHeader-llOXO43Z.js";import{E as O}from"./EmptyState-CmK9fywh.js";import{M as A}from"./Modal-V2yNnkKk.js";import{S as F}from"./SkeletonLoader-BkQoZllJ.js";import{P as L}from"./plus-O61rB_YF.js";import{T as y}from"./target-CWfn705s.js";import{C as B}from"./chevron-down-CM11GPpR.js";import{C as I}from"./chevron-right-aFDDgFsL.js";import{T as U}from"./trash-2-TQcEJEv4.js";import"./loader-circle-E8aLxmMz.js";import"./proxy-BAUTNyg6.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 N(`/api/goals/${r.id}`,{method:"DELETE"}),l(),a()}catch{}c(!1)},o=async n=>{m(!0);try{await N(`/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($,{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(B,{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(y,{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 le(){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 N("/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(M,{title:"Goals",breadcrumbs:[{label:"Command Post"},{label:"Goals"}],actions:e.jsx(j,{size:"sm",icon:e.jsx(L,{size:14}),onClick:()=>u(!0),children:"Create Goal"})}),l&&e.jsx(F,{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(O,{icon:e.jsx(y,{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(y,{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(A,{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{le as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as $,u as B,r,bo as D,b as S,bp as L,j as e,L as M,a0 as C}from"./index-slWylU2o.js";import{B as c}from"./Input-4pNffAw-.js";import{S as O}from"./StatusBadge-BFEHCdgi.js";import{P as h}from"./PageHeader-llOXO43Z.js";import{S as U}from"./SkeletonLoader-BkQoZllJ.js";import{A as R}from"./arrow-left-CHJyrO8S.js";import{M as _}from"./users-BX_ZaByZ.js";import{S as F}from"./send-DZ_5M5QQ.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.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 K={critical:"text-error",high:"text-warning",medium:"text-accent",low:"text-text-muted"},q=["backlog","todo","in_progress","in_review","done","blocked","cancelled"];function te(){const{id:a}=$(),i=B(),[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 D(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&&L(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(M,{to:"/command-post/issues",className:"flex items-center gap-1 text-xs text-text-muted hover:text-text",children:[e.jsx(R,{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:q.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(_,{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(F,{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 ${K[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,K as k,j as e,L as T,$ as P}from"./index-slWylU2o.js";import{B as u}from"./Input-4pNffAw-.js";import{S as L}from"./StatusBadge-BFEHCdgi.js";import{P as $}from"./PageHeader-llOXO43Z.js";import{E as z}from"./EmptyState-CmK9fywh.js";import{T as D}from"./Tabs-g2Gs9sK0.js";import{M as E}from"./Modal-V2yNnkKk.js";import{S as M}from"./SkeletonLoader-BkQoZllJ.js";import{P as A}from"./plus-O61rB_YF.js";import{L as B}from"./list-todo-say4NbSw.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.js";import"./proxy-BAUTNyg6.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,v]=s.useState("all"),[y,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($,{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(D,{tabs:S,activeTab:o,onChange:v}),c&&e.jsx(M,{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(z,{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(L,{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(E,{open:y,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,8 +0,0 @@
|
|
|
1
|
-
import{r as i,D as u,U as b,j as e}from"./index-slWylU2o.js";import"./Input-4pNffAw-.js";import{S as j}from"./StatusBadge-BFEHCdgi.js";import{P as f}from"./PageHeader-llOXO43Z.js";import{E as v}from"./EmptyState-CmK9fywh.js";import{S as y}from"./SkeletonLoader-BkQoZllJ.js";import{N}from"./network-v9O7MmZT.js";import{T as C}from"./trash-2-TQcEJEv4.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.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,bq as f,j as e}from"./index-slWylU2o.js";import"./Input-4pNffAw-.js";import{S as j}from"./StatusBadge-BFEHCdgi.js";import{P as g}from"./PageHeader-llOXO43Z.js";import{E as y}from"./EmptyState-CmK9fywh.js";import{S as b}from"./SkeletonLoader-BkQoZllJ.js";import{P as N}from"./play-DbCJhc5H.js";import"./loader-circle-E8aLxmMz.js";import"./chevron-right-aFDDgFsL.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 a,j as e,h as $,aM as E,aN as D,aO as F}from"./index-slWylU2o.js";import{P as R}from"./PageHeader-llOXO43Z.js";import{R as O}from"./terminal-CdhfA0Kr.js";import{C as W}from"./circle-check-big-DPz64kZW.js";import{C as _}from"./chevron-down-CM11GPpR.js";import{C as G}from"./chevron-right-aFDDgFsL.js";import{E as K}from"./eye-off-CYR4nH5I.js";import{E as I}from"./TitanCanvas-DCl3gxSl.js";import{S as H}from"./save-D2Qh8KyN.js";import"./chevron-up-D6g7FB6i.js";import"./plus-O61rB_YF.js";import"./users-BX_ZaByZ.js";import"./wrench-Cfp7nYhG.js";import"./network-v9O7MmZT.js";import"./rotate-ccw-n5WkWR51.js";import"./search-C9SdcZJq.js";import"./send-DZ_5M5QQ.js";import"./VoiceOverlay-B08Sw918.js";import"./folder-DY4eeMdo.js";import"./clock-BbCCaukN.js";import"./check-BcOm5jPO.js";import"./shield-check-DyP5PmaY.js";import"./external-link-BgxGF7ZQ.js";import"./loader-circle-E8aLxmMz.js";const M=[{id:"discord",label:"Discord",description:"Discord bot via discord.js",fields:[{key:"token",label:"Bot Token",placeholder:"Bot token from Discord Developer Portal"}]},{id:"telegram",label:"Telegram",description:"Telegram bot via Grammy",fields:[{key:"token",label:"Bot Token",placeholder:"Token from @BotFather"}]},{id:"slack",label:"Slack",description:"Slack workspace via Bolt SDK",fields:[{key:"token",label:"Bot Token",placeholder:"xoxb-..."},{key:"apiKey",label:"Signing Secret",placeholder:"Signing secret from Slack app settings"}]},{id:"whatsapp",label:"WhatsApp",description:"WhatsApp via Twilio",fields:[{key:"token",label:"Auth Token",placeholder:"Twilio auth token"},{key:"apiKey",label:"Account SID",placeholder:"Twilio account SID"}]},{id:"googlechat",label:"Google Chat",description:"Google Chat spaces",fields:[{key:"token",label:"Service Account Key",placeholder:"JSON key path or content"}]},{id:"matrix",label:"Matrix",description:"Matrix protocol (Element, etc.)",fields:[{key:"token",label:"Access Token",placeholder:"Matrix access token"}]},{id:"signal",label:"Signal",description:"Signal messenger",fields:[{key:"token",label:"API Token",placeholder:"Signal API token"}]},{id:"msteams",label:"Microsoft Teams",description:"MS Teams via Bot Framework",fields:[{key:"token",label:"App Password",placeholder:"Bot framework app password"},{key:"apiKey",label:"App ID",placeholder:"Bot framework app ID"}]},{id:"irc",label:"IRC",description:"Internet Relay Chat",fields:[{key:"token",label:"Password",placeholder:"NickServ password (optional)"}]},{id:"mattermost",label:"Mattermost",description:"Self-hosted team chat",fields:[{key:"token",label:"Bot Token",placeholder:"Mattermost bot access token"}]},{id:"lark",label:"Lark",description:"Lark/Feishu messaging",fields:[{key:"token",label:"App Token",placeholder:"Lark app token"},{key:"apiKey",label:"App Secret",placeholder:"Lark app secret"}]},{id:"email_inbound",label:"Email (Inbound)",description:"IMAP email webhook",fields:[{key:"token",label:"IMAP Password",placeholder:"IMAP password or app password"}]},{id:"line",label:"LINE",description:"LINE messaging platform",fields:[{key:"token",label:"Channel Access Token",placeholder:"LINE channel access token"},{key:"apiKey",label:"Channel Secret",placeholder:"LINE channel secret"}]},{id:"zulip",label:"Zulip",description:"Zulip team chat",fields:[{key:"apiKey",label:"API Key",placeholder:"Zulip API key"}]}],Z=[{value:"pairing",label:"Pairing",desc:"User must pair first"},{value:"open",label:"Open",desc:"Anyone can DM"},{value:"closed",label:"Closed",desc:"DMs disabled"}];function z({def:l,config:o,status:b,onSave:f,saving:v}){const[d,k]=a.useState(!1),[p,N]=a.useState(o.enabled),[x,i]=a.useState(""),[m,u]=a.useState(""),[g,w]=a.useState(o.dmPolicy),[y,t]=a.useState(!1),[n,h]=a.useState(!1),[r,c]=a.useState(!1),j=v===l.id,C=(b==null?void 0:b.status)==="connected",A=!!o.token,P=!!o.apiKey,L=()=>{N(!p),c(!0)},B=async()=>{const s={enabled:p,dmPolicy:g};x&&(s.token=x),m&&(s.apiKey=m),await f(l.id,s),i(""),u(""),c(!1)},S=l.fields.find(s=>s.key==="token"),T=l.fields.find(s=>s.key==="apiKey");return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary",children:[e.jsxs("button",{onClick:()=>k(!d),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[d?e.jsx(_,{className:"h-4 w-4 text-text-muted"}):e.jsx(G,{className:"h-4 w-4 text-text-muted"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-text",children:l.label}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:l.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[C&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Connected"]}),e.jsx("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${o.enabled?"bg-accent/10 text-accent-hover":"bg-border-light/20 text-text-muted"}`,children:o.enabled?"Enabled":"Disabled"})]})]}),d&&e.jsxs("div",{className:"border-t border-bg-tertiary px-4 py-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm text-text-secondary",children:"Enabled"}),e.jsx("button",{onClick:L,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${p?"bg-accent":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${p?"translate-x-6":"translate-x-1"}`})})]}),S&&e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:[S.label,A&&e.jsx("span",{className:"rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success",children:"set"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`channel-${l.id}-token`,name:`channel-${l.id}-token`,type:y?"text":"password",value:x,onChange:s=>{i(s.target.value),c(!0)},placeholder:A?"(configured — enter new value to change)":S.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>t(!y),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:y?e.jsx(K,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),T&&e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:[T.label,P&&e.jsx("span",{className:"rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success",children:"set"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`channel-${l.id}-api-key`,name:`channel-${l.id}-api-key`,type:n?"text":"password",value:m,onChange:s=>{u(s.target.value),c(!0)},placeholder:P?"(configured — enter new value to change)":T.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>h(!n),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:n?e.jsx(K,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"DM Policy"}),e.jsx("div",{className:"flex gap-2",children:Z.map(s=>e.jsx("button",{onClick:()=>{w(s.value),c(!0)},className:`rounded-lg border px-3 py-1.5 text-xs transition-colors ${g===s.value?"border-accent bg-accent/10 text-accent-hover":"border-border text-text-muted hover:border-border-light"}`,title:s.desc,children:s.label},s.value))})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:B,disabled:j||!r,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),j?"Saving...":"Save"]})})]})]})}function ge(){const[l,o]=a.useState([]),[b,f]=a.useState({}),[v,d]=a.useState(!0),[k,p]=a.useState(null),[N,x]=a.useState(null),[i,m]=a.useState(null),u=async()=>{try{const[t,n]=await Promise.all([E(),D()]);o(t),f(n)}catch(t){p(t instanceof Error?t.message:"Failed to fetch channels")}finally{d(!1)}};a.useEffect(()=>{u()},[]);const g=(t,n)=>{m({type:t,message:n}),setTimeout(()=>m(null),3e3)},w=async(t,n)=>{var h;x(t);try{await F(t,n);const[r,c]=await Promise.all([E(),D()]);o(r),f(c);const j=((h=M.find(C=>C.id===t))==null?void 0:h.label)??t;g("success",`${j} settings saved (restart gateway to apply)`)}catch(r){g("error",r instanceof Error?r.message:"Failed to save")}finally{x(null)}};if(v)return e.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((t,n)=>e.jsx("div",{className:"h-14 animate-pulse rounded-xl border border-border bg-bg-secondary"},n))});if(k)return e.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:k});const y={enabled:!1,allowFrom:[],dmPolicy:"pairing"};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(R,{title:"Channels",subtitle:`Configure messaging channels — ${l.filter(t=>t.status==="connected").length} connected`,breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Channels"}],actions:e.jsxs("button",{onClick:()=>{d(!0),u()},className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary hover:border-border-light hover:text-text",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),"Refresh"]})}),i&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${i.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[i.type==="success"?e.jsx(W,{className:"h-4 w-4"}):e.jsx($,{className:"h-4 w-4"}),i.message]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Built-in"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:"WebChat"}),e.jsx("span",{className:"text-xs text-text-muted",children:"HTTP/WebSocket — always enabled"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Connected"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Messaging Channels"}),e.jsx("div",{className:"space-y-2",children:M.map(t=>{const n=b[t.id]??y,h=l.find(r=>r.name===t.id||r.type===t.id);return e.jsx(z,{def:t,config:n,status:h,onSave:w,saving:N},t.id)})})]}),e.jsx("p",{className:"text-xs text-text-muted text-center",children:"Channel changes are saved to config. Restart the gateway to connect/disconnect channels."})]})}export{ge as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,bi as l,j as e}from"./index-slWylU2o.js";import{P as d}from"./PageHeader-llOXO43Z.js";import{R as c}from"./terminal-CdhfA0Kr.js";import{R as p}from"./TitanCanvas-DCl3gxSl.js";import"./chevron-right-aFDDgFsL.js";import"./chevron-up-D6g7FB6i.js";import"./plus-O61rB_YF.js";import"./users-BX_ZaByZ.js";import"./wrench-Cfp7nYhG.js";import"./network-v9O7MmZT.js";import"./save-D2Qh8KyN.js";import"./rotate-ccw-n5WkWR51.js";import"./search-C9SdcZJq.js";import"./send-DZ_5M5QQ.js";import"./VoiceOverlay-B08Sw918.js";import"./chevron-down-CM11GPpR.js";import"./folder-DY4eeMdo.js";import"./clock-BbCCaukN.js";import"./check-BcOm5jPO.js";import"./shield-check-DyP5PmaY.js";import"./external-link-BgxGF7ZQ.js";import"./loader-circle-E8aLxmMz.js";function L(){const[o,m]=s.useState([]),[r,i]=s.useState(!0),a=s.useCallback(async()=>{i(!0);try{const t=await l();m(t.nodes||[])}catch{}i(!1)},[]);return s.useEffect(()=>{a()},[a]),e.jsxs("div",{className:"space-y-4",children:[e.jsx(d,{title:"Fleet Router",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Mesh"},{label:"Fleet"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:a,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(c,{className:`w-4 h-4 ${r?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:o.map(t=>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(p,{className:`w-4 h-4 ${t.status==="online"?"text-emerald-400":t.status==="busy"?"text-amber-400":"text-red-400"}`}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:t.name}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[t.address," • ",t.capabilities.join(", ")]})]})]}),e.jsx("div",{className:"text-xs text-[#52525b]",children:t.status})]},t.id))})]})}export{L as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomelabPanel-DjMUrO2B.js","assets/index-slWylU2o.js","assets/index-PwwKjgT3.css","assets/PageHeader-llOXO43Z.js","assets/chevron-right-aFDDgFsL.js","assets/StatCard-DT4Bx1mY.js","assets/SkeletonLoader-BkQoZllJ.js","assets/terminal-CdhfA0Kr.js","assets/clock-BbCCaukN.js","assets/users-BX_ZaByZ.js","assets/TitanCanvas-DCl3gxSl.js","assets/chevron-up-D6g7FB6i.js","assets/plus-O61rB_YF.js","assets/wrench-Cfp7nYhG.js","assets/network-v9O7MmZT.js","assets/save-D2Qh8KyN.js","assets/rotate-ccw-n5WkWR51.js","assets/search-C9SdcZJq.js","assets/send-DZ_5M5QQ.js","assets/VoiceOverlay-B08Sw918.js","assets/chevron-down-CM11GPpR.js","assets/folder-DY4eeMdo.js","assets/check-BcOm5jPO.js","assets/shield-check-DyP5PmaY.js","assets/external-link-BgxGF7ZQ.js","assets/loader-circle-E8aLxmMz.js","assets/TitanCanvas-BfitWg9R.css","assets/chart-column-wFkjV3Ni.js","assets/circle-check-big-DPz64kZW.js","assets/dollar-sign-Dy5-qkg3.js","assets/NvidiaPanel-qLJysI9M.js","assets/eye-off-CYR4nH5I.js","assets/FilesPanel-dRQM0apb.js","assets/arrow-left-CHJyrO8S.js","assets/trash-2-TQcEJEv4.js","assets/download-DjheLEns.js","assets/LogsPanel-Bs9IsTCH.js","assets/TelemetryPanel-DXAGuV0R.js","assets/git-branch-CPZciK10.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as s,j as e,m as o,_ as a}from"./index-slWylU2o.js";const r=s.lazy(()=>a(()=>import("./HomelabPanel-DjMUrO2B.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,27,28,29]))),d=s.lazy(()=>a(()=>import("./NvidiaPanel-qLJysI9M.js"),__vite__mapDeps([30,1,2,7,15,28,24,17,31,10,11,12,9,13,14,16,18,19,4,20,21,8,22,23,25,26]))),n=s.lazy(()=>a(()=>import("./FilesPanel-dRQM0apb.js"),__vite__mapDeps([32,1,2,12,7,10,11,9,13,14,15,16,17,18,19,4,20,21,8,22,23,24,25,26,33,34,35]))),c=s.lazy(()=>a(()=>import("./LogsPanel-Bs9IsTCH.js"),__vite__mapDeps([36,1,2,7]))),m=s.lazy(()=>a(()=>import("./TelemetryPanel-DXAGuV0R.js"),__vite__mapDeps([37,1,2,5,8,38,27,10,11,12,9,13,14,7,15,16,17,18,19,4,20,21,22,23,24,25,26]))),x=[{id:"homelab",label:"Homelab"},{id:"gpu",label:"GPU / NVIDIA"},{id:"files",label:"Files"},{id:"logs",label:"Logs"},{id:"telemetry",label:"Telemetry"}];function u(){const[l,i]=s.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(t=>e.jsxs("button",{onClick:()=>i(t.id),className:o("px-3 py-2 text-xs font-medium transition-colors relative",l===t.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[t.label,l===t.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},t.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(s.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{u as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,m as g,j as t,X as N}from"./index-slWylU2o.js";import{C as w}from"./check-BcOm5jPO.js";import{P as S}from"./terminal-CdhfA0Kr.js";function R({value:s,onSave:h,placeholder:p,multiline:a=!1,className:k,displayValue:E,emptyLabel:j="—",hidePencil:C=!1,maxLength:x,title:v}){const[i,c]=r.useState(!1),[o,l]=r.useState(s),[f,y]=r.useState(!1),n=r.useRef(null);r.useEffect(()=>{i&&n.current&&(n.current.focus(),"select"in n.current&&n.current.select())},[i]),r.useEffect(()=>{i||l(s)},[s,i]);const u=async()=>{if(o===s){c(!1);return}y(!0);try{await h(o),c(!1)}catch{}finally{y(!1)}},b=()=>{l(s),c(!1)},m=e=>{e.key==="Enter"&&!a||e.key==="Enter"&&a&&e.metaKey?(e.preventDefault(),u()):e.key==="Escape"&&(e.preventDefault(),b())};if(i){const e=g("bg-bg-tertiary border border-accent/60 rounded px-2 py-1 text-sm text-text","focus:outline-none focus:border-accent","w-full",a&&"resize-none min-h-[60px]");return t.jsxs("span",{className:"inline-flex items-start gap-1 w-full",children:[a?t.jsx("textarea",{ref:n,value:o,onChange:d=>l(d.target.value),onKeyDown:m,placeholder:p,maxLength:x,className:e,disabled:f}):t.jsx("input",{ref:n,type:"text",value:o,onChange:d=>l(d.target.value),onKeyDown:m,placeholder:p,maxLength:x,className:e,disabled:f}),t.jsx("button",{onClick:u,disabled:f,className:"text-success hover:bg-success/10 rounded p-1 shrink-0",title:a?"Save (Cmd+Enter)":"Save (Enter)",type:"button",children:t.jsx(w,{size:14})}),t.jsx("button",{onClick:b,disabled:f,className:"text-text-muted hover:bg-bg-tertiary rounded p-1 shrink-0",title:"Cancel (Esc)",type:"button",children:t.jsx(N,{size:14})})]})}const D=E??(s&&s.length>0?s:j);return t.jsxs("span",{className:g("inline-flex items-center gap-1 cursor-pointer group","hover:bg-bg-tertiary rounded px-1 -mx-1",k),onClick:()=>c(!0),title:v??"Click to edit",role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),c(!0))},children:[t.jsx("span",{children:D}),!C&&t.jsx(S,{size:10,className:"text-text-muted opacity-0 group-hover:opacity-60 transition-opacity shrink-0"})]})}export{R as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as e,m as d}from"./index-slWylU2o.js";import{L as m}from"./loader-circle-E8aLxmMz.js";const b={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,...x},c)=>e.jsxs("button",{ref:c,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",b[r],p[t],l),...x,children:[s?e.jsx(m,{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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e,h as F,a8 as S,b as C,ag as K}from"./index-slWylU2o.js";import{P as A}from"./plug-CtpCZg2z.js";import{C as U}from"./circle-check-big-DPz64kZW.js";import{E as T}from"./eye-off-CYR4nH5I.js";import{E as I}from"./TitanCanvas-DCl3gxSl.js";import{S as O}from"./save-D2Qh8KyN.js";import{C as R}from"./chevron-down-CM11GPpR.js";import{C as q}from"./chevron-right-aFDDgFsL.js";import"./chevron-up-D6g7FB6i.js";import"./plus-O61rB_YF.js";import"./users-BX_ZaByZ.js";import"./wrench-Cfp7nYhG.js";import"./network-v9O7MmZT.js";import"./terminal-CdhfA0Kr.js";import"./rotate-ccw-n5WkWR51.js";import"./search-C9SdcZJq.js";import"./send-DZ_5M5QQ.js";import"./VoiceOverlay-B08Sw918.js";import"./folder-DY4eeMdo.js";import"./clock-BbCCaukN.js";import"./check-BcOm5jPO.js";import"./shield-check-DyP5PmaY.js";import"./external-link-BgxGF7ZQ.js";import"./loader-circle-E8aLxmMz.js";const k=[{id:"anthropic",label:"Anthropic",fieldKey:"anthropicKey",fieldType:"key",placeholder:"sk-ant-..."},{id:"openai",label:"OpenAI",fieldKey:"openaiKey",fieldType:"key",placeholder:"sk-..."},{id:"google",label:"Google AI",fieldKey:"googleKey",fieldType:"key",placeholder:"AIza..."},{id:"groq",label:"Groq",fieldKey:"groqKey",fieldType:"key",placeholder:"gsk_..."},{id:"mistral",label:"Mistral",fieldKey:"mistralKey",fieldType:"key",placeholder:"API key"},{id:"openrouter",label:"OpenRouter",fieldKey:"openrouterKey",fieldType:"key",placeholder:"sk-or-..."},{id:"fireworks",label:"Fireworks AI",fieldKey:"fireworksKey",fieldType:"key",placeholder:"API key"},{id:"xai",label:"xAI (Grok)",fieldKey:"xaiKey",fieldType:"key",placeholder:"xai-..."},{id:"together",label:"Together AI",fieldKey:"togetherKey",fieldType:"key",placeholder:"API key"},{id:"deepseek",label:"DeepSeek",fieldKey:"deepseekKey",fieldType:"key",placeholder:"sk-..."},{id:"perplexity",label:"Perplexity",fieldKey:"perplexityKey",fieldType:"key",placeholder:"pplx-..."},{id:"ollama",label:"Ollama",fieldKey:"ollamaUrl",fieldType:"url",placeholder:"http://localhost:11434"}];function P({configured:a}){return e.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${a?"bg-success/10 text-success":"bg-border-light/20 text-text-muted"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${a?"bg-success":"bg-border-light"}`}),a?"Configured":"Not configured"]})}function M({provider:a,configured:b,currentUrl:o,onSave:g,saving:v}){const[f,y]=l.useState(!1),[n,d]=l.useState(a.fieldType==="url"&&o||""),[x,m]=l.useState(!1),u=a.fieldType==="key",c=v===a.id;return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary",children:[e.jsxs("button",{onClick:()=>y(!f),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[f?e.jsx(R,{className:"h-4 w-4 text-text-muted"}):e.jsx(q,{className:"h-4 w-4 text-text-muted"}),e.jsx("span",{className:"text-sm font-medium text-text",children:a.label})]}),e.jsx(P,{configured:b})]}),f&&e.jsxs("div",{className:"border-t border-bg-tertiary px-4 py-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:u?"API Key":"Base URL"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`integration-${a.id}`,name:`integration-${a.id}`,type:u&&!x?"password":"text",value:n,onChange:j=>d(j.target.value),placeholder:a.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),u&&e.jsx("button",{type:"button",onClick:()=>m(!x),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:x?e.jsx(T,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>g(a.fieldKey,n),disabled:c||!n,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),c?"Saving...":"Save"]})})]})]})}function pe(){const[a,b]=l.useState({}),[o,g]=l.useState({clientIdSet:!1,clientSecretSet:!1}),[v,f]=l.useState(!0),[y,n]=l.useState(null),[d,x]=l.useState(null),[m,u]=l.useState(""),[c,j]=l.useState(""),[N,G]=l.useState(!1);l.useEffect(()=>{(async()=>{var t;try{const r=await S();if(r.providers&&b(r.providers),(t=r.oauth)!=null&&t.google){const h=r.oauth.google;try{const i=await(await C("/api/auth/google/status")).json();h.connected=i.connected,h.email=i.email}catch{}g(h)}}catch{}finally{f(!1)}})()},[]);const E=()=>{window.location.href="/api/auth/google/start"},D=async()=>{try{await C("/api/auth/google/disconnect",{method:"POST"}),g(s=>({...s,connected:!1,email:void 0})),p("success","Google account disconnected")}catch{p("error","Failed to disconnect")}},p=(s,t)=>{x({type:s,message:t}),setTimeout(()=>x(null),3e3)},$=async(s,t)=>{var h,w;const r=((h=k.find(i=>i.fieldKey===s))==null?void 0:h.id)||s;n(r);try{await K({[s]:t});const i=await S();i.providers&&b(i.providers),p("success",`${((w=k.find(B=>B.fieldKey===s))==null?void 0:w.label)||"Provider"} saved`)}catch(i){p("error",i instanceof Error?i.message:"Failed to save")}finally{n(null)}},L=async()=>{var s;n("oauth");try{const t={};m&&(t.googleOAuthClientId=m),c&&(t.googleOAuthClientSecret=c),await K(t);const r=await S();(s=r.oauth)!=null&&s.google&&g(r.oauth.google),p("success","Google OAuth settings saved"),u(""),j("")}catch(t){p("error",t instanceof Error?t.message:"Failed to save")}finally{n(null)}};return v?e.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((s,t)=>e.jsx("div",{className:"h-14 animate-pulse rounded-xl border border-border bg-bg-secondary"},t))}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-accent/10",children:e.jsx(A,{className:"h-4 w-4 text-accent-hover"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-text",children:"Integrations"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Configure LLM providers and external service connections"})]})]}),d&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${d.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[d.type==="success"?e.jsx(U,{className:"h-4 w-4"}):e.jsx(F,{className:"h-4 w-4"}),d.message]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"LLM Providers"}),e.jsx("div",{className:"space-y-2",children:k.map(s=>{const t=a[s.id],r=s.id==="ollama"?!!(t!=null&&t.baseUrl):!!(t!=null&&t.configured);return e.jsx(M,{provider:s,configured:r,currentUrl:s.fieldType==="url"?(t==null?void 0:t.baseUrl)||"":void 0,onSave:$,saving:y},s.id)})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Google Services (OAuth)"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"Google OAuth 2.0"}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:o.connected&&o.email?`Connected as ${o.email}`:"Gmail, Drive, Calendar, Docs, Sheets, Tasks"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{configured:!!o.connected}),o.clientIdSet&&!o.connected&&e.jsxs("button",{onClick:E,className:"flex items-center gap-1.5 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white hover:bg-accent/80 transition-colors",children:[e.jsx(A,{className:"h-3.5 w-3.5"}),"Connect Google"]}),o.connected&&e.jsx("button",{onClick:D,className:"flex items-center gap-1.5 rounded-lg border border-red-500/30 px-3 py-1.5 text-xs font-medium text-red-400 hover:bg-red-500/10 transition-colors",children:"Disconnect"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Client ID"}),e.jsx("input",{id:"integration-google-client-id",name:"integration-google-client-id",type:"text",value:m,onChange:s=>u(s.target.value),placeholder:o.clientIdSet?"(configured)":"your-client-id.apps.googleusercontent.com",className:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Client Secret"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"integration-google-client-secret",name:"integration-google-client-secret",type:N?"text":"password",value:c,onChange:s=>j(s.target.value),placeholder:o.clientSecretSet?"(configured)":"GOCSPX-...",className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>G(!N),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:N?e.jsx(T,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:L,disabled:y==="oauth"||!m&&!c,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),y==="oauth"?"Saving...":"Save OAuth Settings"]})})]})]})]})}export{pe as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AutopilotPanel-C3yQBxAp.js","assets/index-slWylU2o.js","assets/index-PwwKjgT3.css","assets/PageHeader-llOXO43Z.js","assets/chevron-right-aFDDgFsL.js","assets/WorkflowsPanel-DdY6E93C.js","assets/Input-4pNffAw-.js","assets/loader-circle-E8aLxmMz.js","assets/InlineEditableField-BOLRKQq1.js","assets/check-BcOm5jPO.js","assets/terminal-CdhfA0Kr.js","assets/target-CWfn705s.js","assets/plus-O61rB_YF.js","assets/chevron-down-CM11GPpR.js","assets/play-DbCJhc5H.js","assets/pause-CZo33QlA.js","assets/trash-2-TQcEJEv4.js","assets/clock-BbCCaukN.js","assets/toggle-right-CmYQLQRS.js","assets/TitanCanvas-DCl3gxSl.js","assets/chevron-up-D6g7FB6i.js","assets/users-BX_ZaByZ.js","assets/wrench-Cfp7nYhG.js","assets/network-v9O7MmZT.js","assets/save-D2Qh8KyN.js","assets/rotate-ccw-n5WkWR51.js","assets/search-C9SdcZJq.js","assets/send-DZ_5M5QQ.js","assets/VoiceOverlay-B08Sw918.js","assets/folder-DY4eeMdo.js","assets/shield-check-DyP5PmaY.js","assets/external-link-BgxGF7ZQ.js","assets/TitanCanvas-BfitWg9R.css","assets/LearningPanel-CtlougkF.js","assets/lightbulb-tzuCyEQk.js","assets/trending-up-Cw22bM4J.js","assets/MemoryGraphPanel-F1P9COyY.js","assets/SelfImprovePanel-B8o_fO30.js","assets/circle-check-big-DPz64kZW.js","assets/trophy-DUF8Bcas.js","assets/PersonasPanel-DIac_kZ3.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as s,j as e,m as a,_ as t}from"./index-slWylU2o.js";const i=s.lazy(()=>t(()=>import("./AutopilotPanel-C3yQBxAp.js"),__vite__mapDeps([0,1,2,3,4]))),n=s.lazy(()=>t(()=>import("./WorkflowsPanel-DdY6E93C.js"),__vite__mapDeps([5,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),d=s.lazy(()=>t(()=>import("./LearningPanel-CtlougkF.js"),__vite__mapDeps([33,1,2,3,4,10,19,20,12,21,22,23,24,25,26,27,28,13,29,17,9,30,31,7,32,34,35]))),c=s.lazy(()=>t(()=>import("./MemoryGraphPanel-F1P9COyY.js"),__vite__mapDeps([36,1,2,23,10,16,26]))),m=s.lazy(()=>t(()=>import("./SelfImprovePanel-B8o_fO30.js"),__vite__mapDeps([37,1,2,19,20,12,21,22,23,10,24,25,26,27,28,4,13,29,17,9,30,31,7,32,38,39,35,14,16]))),x=s.lazy(()=>t(()=>import("./PersonasPanel-DIac_kZ3.js"),__vite__mapDeps([40,1,2]))),p=[{id:"autopilot",label:"Autopilot"},{id:"workflows",label:"Workflows"},{id:"learning",label:"Learning"},{id:"memory",label:"Memory & Graph"},{id:"self-improve",label:"Self-Improve"},{id:"personas",label:"Personas"}];function u(){const[l,r]=s.useState("autopilot");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:"Intelligence"}),e.jsx("div",{className:"flex items-center gap-0.5 border-b border-border/50",children:p.map(o=>e.jsxs("button",{onClick:()=>r(o.id),className:a("px-3 py-2 text-xs font-medium transition-colors relative",l===o.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[o.label,l===o.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},o.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(s.Suspense,{fallback:e.jsx("div",{className:"skeleton-shimmer h-40 rounded-lg"}),children:[l==="autopilot"&&e.jsx(i,{}),l==="workflows"&&e.jsx(n,{}),l==="learning"&&e.jsx(d,{}),l==="memory"&&e.jsx(c,{}),l==="self-improve"&&e.jsx(m,{}),l==="personas"&&e.jsx(x,{})]})})]})}export{u as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e,T as g,b as x}from"./index-slWylU2o.js";import{P as j}from"./PageHeader-llOXO43Z.js";import{R as f}from"./terminal-CdhfA0Kr.js";import{B as p,D as N}from"./TitanCanvas-DCl3gxSl.js";import{W as v}from"./wrench-Cfp7nYhG.js";import{L as y}from"./lightbulb-tzuCyEQk.js";import{T as C}from"./trending-up-Cw22bM4J.js";import"./chevron-right-aFDDgFsL.js";import"./chevron-up-D6g7FB6i.js";import"./plus-O61rB_YF.js";import"./users-BX_ZaByZ.js";import"./network-v9O7MmZT.js";import"./save-D2Qh8KyN.js";import"./rotate-ccw-n5WkWR51.js";import"./search-C9SdcZJq.js";import"./send-DZ_5M5QQ.js";import"./VoiceOverlay-B08Sw918.js";import"./chevron-down-CM11GPpR.js";import"./folder-DY4eeMdo.js";import"./clock-BbCCaukN.js";import"./check-BcOm5jPO.js";import"./shield-check-DyP5PmaY.js";import"./external-link-BgxGF7ZQ.js";import"./loader-circle-E8aLxmMz.js";function w(t){return t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`:`${Math.floor(t/86400)}d ${Math.floor(t%86400/3600)}h`}function k(t){return t<1e3?String(t):t<1e6?`${(t/1e3).toFixed(1)}K`:`${(t/1e6).toFixed(2)}M`}function a({icon:t,label:d,value:r,color:i,sub:o}){return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-md",style:{backgroundColor:i+"15"},children:e.jsx(t,{className:"h-3.5 w-3.5",style:{color:i}})}),e.jsx("p",{className:"text-xs text-text-muted",children:d})]}),e.jsx("p",{className:"text-2xl font-bold text-text",children:r}),o&&e.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:o})]})}function V(){const[t,d]=l.useState(null),[r,i]=l.useState(null),[o,b]=l.useState(null),[h,m]=l.useState(!0),u=()=>{m(!0),Promise.all([x("/api/learning").then(s=>s.ok?s.json():null).catch(()=>null),x("/api/stats").then(s=>s.ok?s.json():null).catch(()=>null),x("/api/graphiti").then(s=>s.ok?s.json():null).catch(()=>null)]).then(([s,c,n])=>{d(s),i(c),b(n?{nodeCount:n.nodeCount||0,edgeCount:n.edgeCount||0,episodeCount:n.episodeCount||0}:null)}).finally(()=>m(!1))};return l.useEffect(()=>{u()},[]),h?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-10 animate-pulse rounded-xl bg-bg-secondary"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Array.from({length:8}).map((s,c)=>e.jsx("div",{className:"h-24 animate-pulse rounded-xl bg-bg-secondary"},c))})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(j,{title:"Learning",subtitle:"Knowledge base, tool mastery, and memory systems",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Memory"},{label:"Learning"}],actions:e.jsxs("button",{onClick:u,className:"flex items-center gap-1.5 rounded-lg bg-bg-tertiary px-3 py-1.5 text-xs text-text-secondary hover:bg-border hover:text-text transition-colors",children:[e.jsx(f,{className:"h-3.5 w-3.5"})," Refresh"]})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Knowledge Base"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(a,{icon:p,label:"Knowledge Entries",value:(t==null?void 0:t.knowledgeEntries)??0,color:"#6366f1",sub:"Facts, patterns, corrections"}),e.jsx(a,{icon:v,label:"Tools Tracked",value:(t==null?void 0:t.toolsTracked)??0,color:"#22d3ee",sub:"Success rates learned"}),e.jsx(a,{icon:g,label:"Error Patterns",value:(t==null?void 0:t.errorPatterns)??0,color:"#f59e0b",sub:"Known failure modes"}),e.jsx(a,{icon:y,label:"Corrections",value:(t==null?void 0:t.corrections)??0,color:"#34d399",sub:"User-taught improvements"})]})]}),o&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Memory Graph"}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx(a,{icon:N,label:"Entities",value:o.nodeCount,color:"#818cf8",sub:"People, topics, projects"}),e.jsx(a,{icon:C,label:"Relationships",value:o.edgeCount,color:"#22d3ee",sub:"Connections between entities"}),e.jsx(a,{icon:p,label:"Episodes",value:o.episodeCount,color:"#34d399",sub:"Conversation memories"})]})]}),r&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"System"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsx("p",{className:"text-xs text-text-muted",children:"Tokens Used"}),e.jsx("p",{className:"text-xl font-bold text-text",children:k(r.totalTokens)})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsx("p",{className:"text-xs text-text-muted",children:"Requests"}),e.jsx("p",{className:"text-xl font-bold text-text",children:r.totalRequests})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsx("p",{className:"text-xs text-text-muted",children:"Uptime"}),e.jsx("p",{className:"text-xl font-bold text-text",children:w(r.uptime)})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsx("p",{className:"text-xs text-text-muted",children:"Memory"}),e.jsxs("p",{className:"text-xl font-bold text-text",children:[r.memoryMB,"MB"]})]})]})]})]})}export{V as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,j as e,G as k,aG as z,aH as $,aI as b,aJ as I,aK as R,aL as E}from"./index-slWylU2o.js";import{P as h}from"./plug-CtpCZg2z.js";import{R as D}from"./terminal-CdhfA0Kr.js";import{P as L}from"./plus-O61rB_YF.js";import{b as g,T as G,P as H}from"./TitanCanvas-DCl3gxSl.js";import{T as B}from"./trash-2-TQcEJEv4.js";import"./chevron-up-D6g7FB6i.js";import"./users-BX_ZaByZ.js";import"./wrench-Cfp7nYhG.js";import"./network-v9O7MmZT.js";import"./save-D2Qh8KyN.js";import"./rotate-ccw-n5WkWR51.js";import"./search-C9SdcZJq.js";import"./send-DZ_5M5QQ.js";import"./VoiceOverlay-B08Sw918.js";import"./chevron-right-aFDDgFsL.js";import"./chevron-down-CM11GPpR.js";import"./folder-DY4eeMdo.js";import"./clock-BbCCaukN.js";import"./check-BcOm5jPO.js";import"./shield-check-DyP5PmaY.js";import"./external-link-BgxGF7ZQ.js";import"./loader-circle-E8aLxmMz.js";function ie(){const[l,j]=d.useState([]),[N,y]=d.useState([]),[f,x]=d.useState(!0),[m,c]=d.useState(!1),[v,p]=d.useState(null),[o,i]=d.useState(null),[s,a]=d.useState({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n=async()=>{x(!0);try{const[t,r]=await Promise.all([z(),$()]);j(t),y(r)}catch{}x(!1)};d.useEffect(()=>{n()},[]);const C=async()=>{try{await b({id:s.id,name:s.name,description:s.description,type:s.type,...s.type==="stdio"?{command:s.command,args:s.args.split(/\s+/).filter(Boolean)}:{url:s.url}}),c(!1),a({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n()}catch(t){alert(t.message)}},P=async t=>{try{await b({presetId:t}),n()}catch(r){alert(r.message)}},w=async t=>{confirm(`Remove MCP server "${t}"?`)&&(await E(t),n())},M=async(t,r)=>{await R(t,r),n()},T=async t=>{p(t),i(null);try{const r=await I(t);i({id:t,...r})}catch(r){i({id:t,ok:!1,tools:0,error:r.message})}p(null)},S=t=>t==="connected"?"text-[var(--success)]":t==="error"?"text-[var(--error)]":"text-[var(--text-muted)]",A=t=>t==="connected"?"bg-[var(--success)]":t==="error"?"bg-[var(--error)]":"bg-[var(--text-muted)]",u=N.filter(t=>!l.some(r=>r.id===t.id));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-6 h-6 text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-[var(--text)]",children:"MCP Connections"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connect to external tools via Model Context Protocol"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:n,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(D,{size:14})}),e.jsxs("button",{onClick:()=>c(!m),className:"flex items-center gap-2 px-3 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] transition-colors",children:[e.jsx(L,{size:14})," Add Server"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Configured Servers"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--text)]",children:l.length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connected"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--success)]",children:l.filter(t=>t.status==="connected").length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"External Tools"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--accent)]",children:l.reduce((t,r)=>t+r.toolCount,0)})]})]}),m&&e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)]",children:"Add MCP Server"}),u.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)] mb-2",children:"Quick Add Presets"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(t=>e.jsxs("button",{onClick:()=>P(t.id),className:"flex items-center gap-2 px-3 py-1.5 text-xs rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:[e.jsx(g,{size:12})," ",t.name]},t.id))})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"ID"}),e.jsx("input",{id:"mcp-server-id",name:"mcp-server-id",value:s.id,onChange:t=>a({...s,id:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"my-server"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Name"}),e.jsx("input",{id:"mcp-server-name",name:"mcp-server-name",value:s.name,onChange:t=>a({...s,name:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"My MCP Server"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Description"}),e.jsx("input",{id:"mcp-server-description",name:"mcp-server-description",value:s.description,onChange:t=>a({...s,description:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"What does this server do?"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Type"}),e.jsxs("select",{id:"mcp-server-type",name:"mcp-server-type",value:s.type,onChange:t=>a({...s,type:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",children:[e.jsx("option",{value:"stdio",children:"stdio (local process)"}),e.jsx("option",{value:"http",children:"HTTP (remote server)"})]})]}),s.type==="stdio"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Command"}),e.jsx("input",{id:"mcp-server-command",name:"mcp-server-command",value:s.command,onChange:t=>a({...s,command:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"npx @modelcontextprotocol/server-xxx"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Arguments (space-separated)"}),e.jsx("input",{id:"mcp-server-args",name:"mcp-server-args",value:s.args,onChange:t=>a({...s,args:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"--port 3000"})]})]}):e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Server URL"}),e.jsx("input",{id:"mcp-server-url",name:"mcp-server-url",value:s.url,onChange:t=>a({...s,url:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"http://localhost:3000/mcp"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:C,disabled:!s.id||!s.name,className:"px-4 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] disabled:opacity-40 transition-colors",children:"Add Server"}),e.jsx("button",{onClick:()=>c(!1),className:"px-4 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:"Cancel"})]})]}),f?e.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading MCP servers..."}):l.length===0?e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-8 text-center",children:[e.jsx(h,{className:"w-10 h-10 text-[var(--text-muted)] mx-auto mb-3"}),e.jsx("p",{className:"text-[var(--text-secondary)] mb-1",children:"No MCP servers configured"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Add an MCP server to connect TITAN to external tools like databases, APIs, and services."})]}):e.jsx("div",{className:"space-y-3",children:l.map(t=>e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:t.type==="stdio"?e.jsx(g,{size:18,className:"text-[var(--text-muted)]"}):e.jsx(k,{size:18,className:"text-[var(--text-muted)]"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-[var(--text)]",children:t.name}),e.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${A(t.status)}`}),e.jsx("span",{className:S(t.status),children:t.status})]}),t.toolCount>0&&e.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--accent)]/10 text-[var(--accent)]",children:[t.toolCount," tools"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:t.description}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-1 font-mono",children:t.type==="stdio"?`${t.command} ${(t.args||[]).join(" ")}`:t.url})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>T(t.id),disabled:v===t.id,title:"Test connection",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--bg-tertiary)] transition-colors disabled:opacity-40",children:e.jsx(G,{size:14,className:v===t.id?"animate-pulse":""})}),e.jsx("button",{onClick:()=>M(t.id,!t.enabled),title:t.enabled?"Disable":"Enable",className:`p-1.5 rounded-md transition-colors hover:bg-[var(--bg-tertiary)] ${t.enabled?"text-[var(--success)]":"text-[var(--text-muted)]"}`,children:e.jsx(H,{size:14})}),e.jsx("button",{onClick:()=>w(t.id),title:"Remove",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--error)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(B,{size:14})})]})]}),(o==null?void 0:o.id)===t.id&&e.jsx("div",{className:`mt-3 px-3 py-2 rounded-md text-xs ${o.ok?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:o.ok?`Connected successfully — ${o.tools} tools discovered`:`Connection failed: ${o.error}`})]},t.id))}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)] mb-2",children:"About MCP"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:["Model Context Protocol (MCP) is the universal standard for connecting AI agents to external tools. TITAN acts as both an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"server"})," (exposing its tools to other agents) and an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"client"})," (connecting to external MCP servers). Add any MCP-compatible server and its tools automatically become available in TITAN."]})]})]})}export{ie as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{c as g,r as n,b as h,j as e}from"./index-slWylU2o.js";import{P as u}from"./PageHeader-llOXO43Z.js";import{A as v}from"./arrow-left-CHJyrO8S.js";import{C as w}from"./clock-BbCCaukN.js";import{S as k}from"./search-C9SdcZJq.js";import{B as S}from"./TitanCanvas-DCl3gxSl.js";import"./chevron-right-aFDDgFsL.js";import"./chevron-up-D6g7FB6i.js";import"./plus-O61rB_YF.js";import"./users-BX_ZaByZ.js";import"./wrench-Cfp7nYhG.js";import"./network-v9O7MmZT.js";import"./terminal-CdhfA0Kr.js";import"./save-D2Qh8KyN.js";import"./rotate-ccw-n5WkWR51.js";import"./send-DZ_5M5QQ.js";import"./VoiceOverlay-B08Sw918.js";import"./chevron-down-CM11GPpR.js";import"./folder-DY4eeMdo.js";import"./check-BcOm5jPO.js";import"./shield-check-DyP5PmaY.js";import"./external-link-BgxGF7ZQ.js";import"./loader-circle-E8aLxmMz.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 C=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],M=g("link",C);/**
|
|
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 L=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],A=g("tag",L),E={person:"var(--color-accent-hover)",topic:"var(--color-cyan)",project:"var(--color-emerald)",place:"#fbbf24",company:"#facc15",technology:"#2dd4bf",event:"#fb7185"};function i(a){return E[a==null?void 0:a.toLowerCase()]??"#94a3b8"}function b(a){const l=Math.floor((Date.now()-new Date(a).getTime())/1e3);return l<60?"just now":l<3600?`${Math.floor(l/60)}m ago`:l<86400?`${Math.floor(l/3600)}h ago`:`${Math.floor(l/86400)}d ago`}function ee(){const[a,l]=n.useState([]),[s,d]=n.useState(null),[f,j]=n.useState(!0),[o,y]=n.useState(""),[c,N]=n.useState(""),x=n.useCallback(async()=>{try{const t=new URLSearchParams;o&&t.set("q",o),c&&t.set("type",c);const r=await h(`/api/wiki/entities?${t}`);r.ok&&l(await r.json())}catch{}finally{j(!1)}},[o,c]),m=async t=>{try{const r=await h(`/api/wiki/entity/${encodeURIComponent(t)}`);r.ok&&d(await r.json())}catch{}};n.useEffect(()=>{x()},[x]);const p=[...new Set(a.map(t=>t.type))].sort();return s?e.jsxs("div",{className:"space-y-4",children:[e.jsx(u,{title:s.name,breadcrumbs:[{label:"Memory"},{label:"Wiki",href:"/memory-wiki"},{label:s.name}],actions:e.jsxs("button",{onClick:()=>d(null),className:"flex items-center gap-1.5 rounded-lg bg-bg-tertiary px-3 py-1.5 text-xs text-text-secondary hover:text-text transition-colors",children:[e.jsx(v,{className:"h-3.5 w-3.5"})," Back to list"]})}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-5",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"h-4 w-4 rounded-full",style:{backgroundColor:i(s.type),boxShadow:`0 0 10px ${i(s.type)}50`}}),e.jsx("h2",{className:"text-xl font-bold text-text",children:s.name}),e.jsx("span",{className:"rounded-md bg-bg-tertiary px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-text-secondary",children:s.type})]}),s.summary&&e.jsx("p",{className:"text-sm text-text-secondary mb-2",children:s.summary}),s.aliases.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[e.jsx(A,{className:"h-3 w-3"})," Also known as: ",s.aliases.join(", ")]}),e.jsxs("div",{className:"flex gap-4 mt-3 text-[10px] text-text-muted",children:[e.jsxs("span",{children:["First seen: ",new Date(s.firstSeen).toLocaleDateString()]}),e.jsxs("span",{children:["Last seen: ",b(s.lastSeen)]})]})]}),s.facts.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted mb-3",children:["Facts (",s.facts.length,")"]}),e.jsx("div",{className:"space-y-2",children:s.facts.map((t,r)=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsx("span",{className:"text-accent mt-0.5",children:"•"}),e.jsx("span",{className:"text-text-secondary",children:t})]},r))})]}),s.related.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted mb-3",children:[e.jsx(M,{className:"h-3 w-3 inline mr-1"})," Related (",s.related.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.related.map(t=>e.jsxs("button",{onClick:()=>m(t.name),className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-bg px-3 py-1.5 text-xs hover:border-accent transition-colors",children:[e.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:i(t.type)}}),e.jsx("span",{className:"text-text",children:t.name}),e.jsxs("span",{className:"text-text-muted",children:["(",t.relation,")"]})]},t.id))})]}),s.episodes.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted mb-3",children:[e.jsx(w,{className:"h-3 w-3 inline mr-1"})," Episode History (",s.episodes.length,")"]}),e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:s.episodes.map(t=>e.jsxs("div",{className:"border-l-2 border-border pl-3 py-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-text-muted mb-0.5",children:[e.jsx("span",{children:new Date(t.createdAt).toLocaleString()}),e.jsx("span",{className:"rounded bg-bg-tertiary px-1.5 py-0.5",children:t.source})]}),e.jsx("p",{className:"text-xs text-text-secondary",children:t.content})]},t.id))})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(u,{title:"Memory Wiki",breadcrumbs:[{label:"Memory"},{label:"Wiki"}]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(k,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-text-muted"}),e.jsx("input",{type:"text",value:o,onChange:t=>y(t.target.value),placeholder:"Search entities, facts, summaries...",className:"w-full rounded-lg border border-border bg-bg-secondary py-2 pl-9 pr-4 text-sm text-text placeholder:text-text-muted focus:border-accent focus:outline-none"})]}),e.jsxs("select",{value:c,onChange:t=>N(t.target.value),className:"rounded-lg border border-border bg-bg-secondary px-3 py-2 text-sm text-text-secondary focus:border-accent focus:outline-none",children:[e.jsx("option",{value:"",children:"All types"}),p.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("div",{className:"flex gap-3 text-xs text-text-muted",children:[e.jsxs("span",{children:[a.length," entities"]}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:[p.length," types"]})]}),f?e.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:9}).map((t,r)=>e.jsx("div",{className:"h-24 animate-pulse rounded-xl border border-border bg-bg-secondary"},r))}):e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[a.map(t=>e.jsxs("button",{onClick:()=>m(t.name),className:"rounded-xl border border-border bg-bg-secondary p-4 text-left hover:border-accent transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:i(t.type)}}),e.jsx("span",{className:"font-medium text-sm text-text truncate",children:t.name})]}),e.jsx("p",{className:"text-xs text-text-secondary line-clamp-2 mb-2",children:t.summary||"No summary"}),e.jsxs("div",{className:"flex items-center justify-between text-[10px] text-text-muted",children:[e.jsx("span",{className:"capitalize",children:t.type}),e.jsxs("span",{children:[t.factCount," facts"]}),e.jsx("span",{children:b(t.lastSeen)})]})]},t.id)),a.length===0&&e.jsxs("div",{className:"col-span-full py-12 text-center",children:[e.jsx(S,{className:"h-8 w-8 text-text-muted mx-auto mb-2"}),e.jsx("p",{className:"text-text-muted",children:"No entities found"})]})]})]})}export{ee as default};
|