titan-agent 6.2.2 → 6.3.1
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/dist/agent/goalDriver.js +154 -4
- package/dist/agent/goalDriver.js.map +1 -1
- package/dist/agent/orchestrator.js +9 -10
- package/dist/agent/orchestrator.js.map +1 -1
- package/dist/agent/planner.js +42 -10
- package/dist/agent/planner.js.map +1 -1
- package/dist/agent/systemPromptParts.js +13 -16
- package/dist/agent/systemPromptParts.js.map +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/package.json +1 -1
- package/ui/dist/assets/{AuditPanel-BmFAKA7p.js → AuditPanel-TdDAyJUQ.js} +1 -1
- package/ui/dist/assets/{AutonomyPanel-BzuCEsiG.js → AutonomyPanel-B6EIpuFt.js} +1 -1
- package/ui/dist/assets/{AutopilotPanel-DA1vFEl4.js → AutopilotPanel-CLe14-eq.js} +1 -1
- package/ui/dist/assets/{AutoresearchPanel-BeUCXYtX.js → AutoresearchPanel-C14q_kh7.js} +1 -1
- package/ui/dist/assets/{BackupPanel-B6N1pfMT.js → BackupPanel-CoEbryip.js} +1 -1
- package/ui/dist/assets/{BrowserPanel-BGHaPi3O.js → BrowserPanel-CRTJOXQV.js} +1 -1
- package/ui/dist/assets/{CPActivity-BUSwjFj2.js → CPActivity-DjT8p5Dn.js} +1 -1
- package/ui/dist/assets/{CPAgentDetail-DlUEVujH.js → CPAgentDetail-CR1ciISN.js} +1 -1
- package/ui/dist/assets/{CPAgents-CnRmsSMo.js → CPAgents-DIYCdpQR.js} +1 -1
- package/ui/dist/assets/{CPApprovals-CXdkzebd.js → CPApprovals-DAKmaSkN.js} +1 -1
- package/ui/dist/assets/{CPCosts-CfcyIUZg.js → CPCosts-CCCh_VY0.js} +1 -1
- package/ui/dist/assets/{CPDashboard-DHlfE1mT.js → CPDashboard-CyKZGlHB.js} +1 -1
- package/ui/dist/assets/{CPFiles-DyV9vsjE.js → CPFiles-CI252ucO.js} +1 -1
- package/ui/dist/assets/{CPGoals-C17G2F0e.js → CPGoals-BtcgDUY5.js} +1 -1
- package/ui/dist/assets/{CPInbox-D5A3ja_Q.js → CPInbox-igQoKOuB.js} +1 -1
- package/ui/dist/assets/{CPIssueDetail-CoPv27Ll.js → CPIssueDetail-DD5iL5mT.js} +1 -1
- package/ui/dist/assets/{CPIssues-C9EdfW1J.js → CPIssues-C1XUjgdv.js} +1 -1
- package/ui/dist/assets/CPLayout-VXhuxAHd.js +2 -0
- package/ui/dist/assets/{CPOrg-DzoVDLKI.js → CPOrg-JyXp44DB.js} +1 -1
- package/ui/dist/assets/{CPRuns-BHAyFv0K.js → CPRuns-C-gZX28e.js} +1 -1
- package/ui/dist/assets/{CPSocial-CjHD8dKM.js → CPSocial-sMl4vqmX.js} +1 -1
- package/ui/dist/assets/{CPVoice-aybMotU5.js → CPVoice-BXTY3vl7.js} +1 -1
- package/ui/dist/assets/{ChannelsPanel-8KfvAEYM.js → ChannelsPanel-rF_yHmYD.js} +1 -1
- package/ui/dist/assets/{CheckpointsPanel-BCyLRLcg.js → CheckpointsPanel-DO0QSjuz.js} +1 -1
- package/ui/dist/assets/{CommandPostHub-Ce-mWsu2.js → CommandPostHub-BLnNTvBO.js} +3 -3
- package/ui/dist/assets/{CronPanel-A9JHvU_O.js → CronPanel-DELTcCV-.js} +1 -1
- package/ui/dist/assets/{DataTable-ol6IZMRj.js → DataTable-BmbYppBc.js} +1 -1
- package/ui/dist/assets/{DreamPanel-ZiOF8ybh.js → DreamPanel-B28qIraZ.js} +1 -1
- package/ui/dist/assets/{EmptyState-B1i1ZK0x.js → EmptyState-CxJGUl_w.js} +1 -1
- package/ui/dist/assets/{EvalHarnessPanel-DRGc1zbp.js → EvalHarnessPanel-DvI-dsqQ.js} +1 -1
- package/ui/dist/assets/{EvalPanel-B_fiFImG.js → EvalPanel-DKdn69V8.js} +1 -1
- package/ui/dist/assets/{FileViewer-D14G6MQq.js → FileViewer-Deg5Z7ng.js} +1 -1
- package/ui/dist/assets/{FilesPanel-BIsMoSfg.js → FilesPanel-DDRjQukY.js} +1 -1
- package/ui/dist/assets/{FleetPanel-CSjOOsbX.js → FleetPanel-eEudyOkP.js} +1 -1
- package/ui/dist/assets/{HomelabPanel-XHMxqiHu.js → HomelabPanel-Dov1f68P.js} +1 -1
- package/ui/dist/assets/InfraView-DgasEqoR.js +2 -0
- package/ui/dist/assets/{InlineEditableField-AOS-LBh_.js → InlineEditableField-4ZA-KEfv.js} +1 -1
- package/ui/dist/assets/{Input-CTK9oH9g.js → Input-C7lzcGqx.js} +1 -1
- package/ui/dist/assets/{IntegrationsPanel-BKuC_5El.js → IntegrationsPanel-BmnWsnvF.js} +1 -1
- package/ui/dist/assets/IntelligenceView-DXYSyS1a.js +2 -0
- package/ui/dist/assets/{LearningPanel-RpDaPvCj.js → LearningPanel-BsKhgbeS.js} +1 -1
- package/ui/dist/assets/{LogsPanel-9zIJP1Xv.js → LogsPanel-C-H_axtp.js} +1 -1
- package/ui/dist/assets/{McpPanel-CNE7MhDu.js → McpPanel-BizAlt2h.js} +1 -1
- package/ui/dist/assets/{MemoryGraphPanel-9DEsbOZF.js → MemoryGraphPanel-Qle7Bodz.js} +1 -1
- package/ui/dist/assets/{MemoryWikiPanel-CqNen9A6.js → MemoryWikiPanel-CKY4HY4k.js} +1 -1
- package/ui/dist/assets/{MeshPanel-Bq3pHHIT.js → MeshPanel-D35hLDX4.js} +1 -1
- package/ui/dist/assets/MissionCanvas-BU6dvWdk.js +72 -0
- package/ui/dist/assets/{MissionChat-BDqlCplQ.js → MissionChat-BCxqk708.js} +1 -1
- package/ui/dist/assets/{MissionLibrary-9SMdJnfa.js → MissionLibrary-DtovbHf7.js} +1 -1
- package/ui/dist/assets/{MissionStart-Cm7C3kyo.js → MissionStart-DQCW6cLo.js} +1 -1
- package/ui/dist/assets/{Modal-B9KCAwCK.js → Modal-CpcFi-Gm.js} +1 -1
- package/ui/dist/assets/{NvidiaPanel-CpGBj1sn.js → NvidiaPanel-Dwvf8UD2.js} +1 -1
- package/ui/dist/assets/{OrganismPanel-DBHyylxC.js → OrganismPanel-mhCf2syl.js} +1 -1
- package/ui/dist/assets/{OverviewPanel-DII4H_R7.js → OverviewPanel-DiOrl6LB.js} +1 -1
- package/ui/dist/assets/{PageHeader-Bzb_WXw0.js → PageHeader-CPfyiZIM.js} +1 -1
- package/ui/dist/assets/{PersonaProfilesPanel-CXZTZhjo.js → PersonaProfilesPanel-BvQlozzS.js} +1 -1
- package/ui/dist/assets/{PersonasPanel-BYbD8XiV.js → PersonasPanel-G5Jz55AB.js} +1 -1
- package/ui/dist/assets/{PhoneDeskPanel-Bol7fCCN.js → PhoneDeskPanel-Cx4wlgRT.js} +1 -1
- package/ui/dist/assets/{RecipesPanel-BRbXRcEn.js → RecipesPanel-DB6Kuo1a.js} +1 -1
- package/ui/dist/assets/{SecurityPanel-BR3BT7Rb.js → SecurityPanel-BcnpsElV.js} +1 -1
- package/ui/dist/assets/{SelfImprovePanel-BX9xYBxl.js → SelfImprovePanel-do5xDzc8.js} +1 -1
- package/ui/dist/assets/{SelfProposalsPanel-BOoDEAYp.js → SelfProposalsPanel-DM4B-HLa.js} +1 -1
- package/ui/dist/assets/{SessionsPanel-BICnNmn0.js → SessionsPanel-Bl8h6Bfu.js} +1 -1
- package/ui/dist/assets/{SessionsTab-X10FeDWA.js → SessionsTab-hihe8Dc7.js} +1 -1
- package/ui/dist/assets/{SettingsPanel-MuC32AXw.js → SettingsPanel-Cp8decIS.js} +1 -1
- package/ui/dist/assets/SettingsView-BZIgBz0P.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-fwI4Z-f0.js → SkeletonLoader-DLzSaIMH.js} +1 -1
- package/ui/dist/assets/{SkillsPanel-CKFndekU.js → SkillsPanel-B0VL9cO1.js} +1 -1
- package/ui/dist/assets/{SomaView-Ch7WlmBy.js → SomaView-BejcfdMM.js} +1 -1
- package/ui/dist/assets/{StatCard-Bj2Q_4WS.js → StatCard-Bt-57DK2.js} +1 -1
- package/ui/dist/assets/{StatusBadge-NtdTQ8_L.js → StatusBadge-BE0SQNPu.js} +1 -1
- package/ui/dist/assets/{Tabs-CC9aTVuL.js → Tabs-dEteLxhl.js} +1 -1
- package/ui/dist/assets/{TeamsPanel-DjFcLsdR.js → TeamsPanel-7UwGxnbj.js} +1 -1
- package/ui/dist/assets/{TelemetryPanel-k7gJbZyS.js → TelemetryPanel-CqbkTW3V.js} +1 -1
- package/ui/dist/assets/{TitanCanvas-MzLkpZhp.js → TitanCanvas-RVuBEoV1.js} +4 -4
- package/ui/dist/assets/{ToolsView-DcxwuM2l.js → ToolsView-C97QnPeY.js} +2 -2
- package/ui/dist/assets/{Tooltip-CFYHfpgQ.js → Tooltip-BGe4ZrLD.js} +1 -1
- package/ui/dist/assets/{TraceViewer-BfLO9vwI.js → TraceViewer-CSj_fZou.js} +1 -1
- package/ui/dist/assets/{TrainingPanel-DUl6qChY.js → TrainingPanel-43gDnkVS.js} +1 -1
- package/ui/dist/assets/{VoiceOverlay-Dj_cR5_Y.js → VoiceOverlay-CvZcewVV.js} +1 -1
- package/ui/dist/assets/{VramPanel-th0_Eo8o.js → VramPanel-nadiVKRZ.js} +1 -1
- package/ui/dist/assets/{WatchView-DyGhpKbv.js → WatchView-CUGArdWk.js} +1 -1
- package/ui/dist/assets/{WorkTab-BG5VBljJ.js → WorkTab-iCDNyX60.js} +1 -1
- package/ui/dist/assets/{WorkflowsPanel-C1hVHqAc.js → WorkflowsPanel-Do5EOPQ-.js} +1 -1
- package/ui/dist/assets/{archive-C2_hAJXj.js → archive-96Jj-QYz.js} +1 -1
- package/ui/dist/assets/{arrow-left-DFCBXvKS.js → arrow-left-DvmiAV7y.js} +1 -1
- package/ui/dist/assets/{book-open-BgDKDGcH.js → book-open-DvAaokKW.js} +1 -1
- package/ui/dist/assets/{bot-C4ICYImG.js → bot-DFsTWhzD.js} +1 -1
- package/ui/dist/assets/{chart-column-BIFJOG_f.js → chart-column-BWW8khga.js} +1 -1
- package/ui/dist/assets/{check-CmCL8yzl.js → check-4bqUIREX.js} +1 -1
- package/ui/dist/assets/{chevron-right-U0Ujye5i.js → chevron-right-DhAaVOkv.js} +1 -1
- package/ui/dist/assets/{chevron-up-B6uSBxbj.js → chevron-up-DhONR6eV.js} +1 -1
- package/ui/dist/assets/{circle-check-big-BFw1nom4.js → circle-check-big-CrrpTfnZ.js} +1 -1
- package/ui/dist/assets/{circle-stop-DbtGpdaw.js → circle-stop-BOU58Urf.js} +1 -1
- package/ui/dist/assets/{clipboard-list-Dd3_U8cK.js → clipboard-list-GcIgVrYh.js} +1 -1
- package/ui/dist/assets/{clock-DpJIc30t.js → clock-D5MlrzQb.js} +1 -1
- package/ui/dist/assets/{dollar-sign-DlrOHVzA.js → dollar-sign-B9t2KmrG.js} +1 -1
- package/ui/dist/assets/{download-CZ5kTONh.js → download-DzgUP-io.js} +1 -1
- package/ui/dist/assets/{external-link-CX-GvMky.js → external-link--90_rW_r.js} +1 -1
- package/ui/dist/assets/{file-text-BtTsNJbB.js → file-text-C-9as3zm.js} +1 -1
- package/ui/dist/assets/{flask-conical-BaPYppKH.js → flask-conical-BJnD20AK.js} +1 -1
- package/ui/dist/assets/{folder-BOnpha2-.js → folder-BXotS0h-.js} +1 -1
- package/ui/dist/assets/{funnel-DaNi6kwp.js → funnel-BkW9zcis.js} +1 -1
- package/ui/dist/assets/{git-branch-gs6g9dSe.js → git-branch-D7pbvkyu.js} +1 -1
- package/ui/dist/assets/{index-Dbv5oKsp.js → index-DczEfArU.js} +2 -2
- package/ui/dist/assets/index-DmgXt1oB.css +1 -0
- package/ui/dist/assets/{layers-BKZz8iD1.js → layers-BgUh-m00.js} +1 -1
- package/ui/dist/assets/{legacy-DbwFsW2A.js → legacy-Wbf7An22.js} +1 -1
- package/ui/dist/assets/{lightbulb-DX6YLtPe.js → lightbulb-4Yox7P7Z.js} +1 -1
- package/ui/dist/assets/{list-todo-qdMNm4-Q.js → list-todo-JeleiL5r.js} +1 -1
- package/ui/dist/assets/{message-square-Cwo5FOho.js → message-square-C9bK5TAD.js} +1 -1
- package/ui/dist/assets/{mic-BzvwK4IS.js → mic-DwEnBcFd.js} +1 -1
- package/ui/dist/assets/{missions-CYlXuJED.js → missions-Jbe_PHaT.js} +1 -1
- package/ui/dist/assets/{network-Dt-RBtO_.js → network-BjQmrmO8.js} +1 -1
- package/ui/dist/assets/{pause-Do3XNLtx.js → pause-9vYiD-5Y.js} +1 -1
- package/ui/dist/assets/{pencil-DAGs9RFs.js → pencil-CygyIvE1.js} +1 -1
- package/ui/dist/assets/{play-CNElkzEq.js → play-7ImYx-M6.js} +1 -1
- package/ui/dist/assets/{plug-DCgrVnB8.js → plug-DXmJpsfC.js} +1 -1
- package/ui/dist/assets/{plus-BnsXhqXc.js → plus-LIrhsu2s.js} +1 -1
- package/ui/dist/assets/{proxy-BXHdgwrk.js → proxy-B72L9I2p.js} +1 -1
- package/ui/dist/assets/{radio-BPz7sHXW.js → radio-DN9FsrLZ.js} +1 -1
- package/ui/dist/assets/{refresh-cw-Cs4oDMNE.js → refresh-cw-DyPWslHB.js} +1 -1
- package/ui/dist/assets/{rotate-ccw-DSpsA3Wr.js → rotate-ccw-C7z7lzst.js} +1 -1
- package/ui/dist/assets/{save-BhGg2pZh.js → save-Bl0vY0Ur.js} +1 -1
- package/ui/dist/assets/{search-BtxlIgqN.js → search-DLl1kVch.js} +1 -1
- package/ui/dist/assets/{send-BzKTXI3q.js → send-BqZ0Qzz-.js} +1 -1
- package/ui/dist/assets/{server-B1gIgixS.js → server-DvPKxeOK.js} +1 -1
- package/ui/dist/assets/{shield-check-C39B-Wi3.js → shield-check-DMM8OpD5.js} +1 -1
- package/ui/dist/assets/{terminal-CubaeYlJ.js → terminal-DD6OAIa2.js} +1 -1
- package/ui/dist/assets/{test-tube-CYYLfFIz.js → test-tube-BoC1tTKm.js} +1 -1
- package/ui/dist/assets/{toggle-right-BQ3iDgLG.js → toggle-right-CrEdx-9K.js} +1 -1
- package/ui/dist/assets/{trash-2-CSxfLiVB.js → trash-2-Co50XYSn.js} +1 -1
- package/ui/dist/assets/{trending-up-DXxKT18Q.js → trending-up-SFD19agk.js} +1 -1
- package/ui/dist/assets/{trophy-osEOm2Vi.js → trophy-DLTd-oCR.js} +1 -1
- package/ui/dist/assets/{volume-2-C1OkTurz.js → volume-2-vQvjPYVu.js} +1 -1
- package/ui/dist/assets/{wifi-off-DAhvsjnD.js → wifi-off-DVwDeeLz.js} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/CPLayout-CHrlktMs.js +0 -2
- package/ui/dist/assets/InfraView-DNYgRXkB.js +0 -2
- package/ui/dist/assets/IntelligenceView-BUKpVpDQ.js +0 -2
- package/ui/dist/assets/MissionCanvas-Ci0hbAF0.js +0 -69
- package/ui/dist/assets/SettingsView-Cv9IZqiU.js +0 -2
- package/ui/dist/assets/index-OZm1iJy9.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as M,r as c,a8 as B,j as e,L as C,i as F,Z as E,a9 as O,t as T,b,f as g,B as q,U as G,G as V,h as I}from"./index-
|
|
1
|
+
import{c as M,r as c,a8 as B,j as e,L as C,i as F,Z as E,a9 as O,t as T,b,f as g,B as q,U as G,G as V,h as I}from"./index-DczEfArU.js";import{S as D}from"./save-Bl0vY0Ur.js";import{C as H}from"./circle-check-big-CrrpTfnZ.js";import{R as U}from"./refresh-cw-DyPWslHB.js";import{R}from"./rotate-ccw-C7z7lzst.js";import{R as J}from"./radio-DN9FsrLZ.js";import{B as Z}from"./bot-DFsTWhzD.js";import{S as W}from"./server-DvPKxeOK.js";import{N as K}from"./network-BjQmrmO8.js";import{P as Q}from"./play-7ImYx-M6.js";import{M as X}from"./message-square-C9bK5TAD.js";import{D as Y}from"./TitanCanvas-RVuBEoV1.js";import"./chevron-up-DhONR6eV.js";import"./plus-LIrhsu2s.js";import"./file-text-C-9as3zm.js";import"./terminal-DD6OAIa2.js";import"./book-open-DvAaokKW.js";import"./pencil-CygyIvE1.js";import"./search-DLl1kVch.js";import"./send-BqZ0Qzz-.js";import"./mic-DwEnBcFd.js";import"./flask-conical-BJnD20AK.js";import"./clock-D5MlrzQb.js";import"./archive-96Jj-QYz.js";import"./test-tube-BoC1tTKm.js";import"./VoiceOverlay-CvZcewVV.js";import"./chevron-right-DhAaVOkv.js";import"./volume-2-vQvjPYVu.js";import"./folder-BXotS0h-.js";import"./check-4bqUIREX.js";import"./shield-check-DMM8OpD5.js";import"./external-link--90_rW_r.js";import"./wifi-off-DVwDeeLz.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,b as n,j as e}from"./index-
|
|
1
|
+
import{r,b as n,j as e}from"./index-DczEfArU.js";import{P as c}from"./PageHeader-CPfyiZIM.js";import"./chevron-right-DhAaVOkv.js";function p(){const[t,s]=r.useState(null),[l,i]=r.useState(!0);return r.useEffect(()=>{n("/api/config",{headers:{"Content-Type":"application/json"}}).then(a=>a.json()).then(a=>{var o,d;return s({mode:((o=a.autonomy)==null?void 0:o.mode)||"supervised",interval:(d=a.autonomy)==null?void 0:d.autopilotIntervalMs})}).catch(()=>s({mode:"supervised"})).finally(()=>i(!1))},[]),l?e.jsx("div",{className:"text-[var(--text-muted)]",children:"Loading autopilot config..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(c,{title:"Autopilot",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Agent"},{label:"Autopilot"}]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 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:"Mode"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)] capitalize",children:t==null?void 0:t.mode})]}),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:"Interval"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:t!=null&&t.interval?`${Math.round(t.interval/6e4)} min`:"Not set"})]})]}),e.jsx("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:"Autopilot mode enables TITAN to run scheduled tasks automatically. Configure via titan.json."})})]})}export{p as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as q,r as p,b as T,j as e,a7 as O,V as W}from"./index-
|
|
1
|
+
import{c as q,r as p,b as T,j as e,a7 as O,V as W}from"./index-DczEfArU.js";import{F as A}from"./flask-conical-BJnD20AK.js";import{P as D}from"./play-7ImYx-M6.js";import{P as B}from"./pause-9vYiD-5Y.js";import{R as H}from"./refresh-cw-DyPWslHB.js";import{T as V}from"./trophy-DLTd-oCR.js";import{T as G}from"./trending-up-SFD19agk.js";import{C as U}from"./clock-D5MlrzQb.js";import{C as J}from"./chevron-right-DhAaVOkv.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,aN as p,j as e,aO as u,aP as h}from"./index-
|
|
1
|
+
import{r as s,aN as p,j as e,aO as u,aP as h}from"./index-DczEfArU.js";import{P as g}from"./PageHeader-CPfyiZIM.js";import{P as b}from"./plus-LIrhsu2s.js";import{R as y}from"./refresh-cw-DyPWslHB.js";import{A as j}from"./archive-96Jj-QYz.js";import{C as v}from"./circle-check-big-CrrpTfnZ.js";import"./chevron-right-DhAaVOkv.js";function A(){const[c,m]=s.useState([]),[i,r]=s.useState(!0),[l,n]=s.useState(!1),[d,o]=s.useState(null),t=s.useCallback(async()=>{r(!0);try{const a=await p();m(a.backups||[])}catch{}r(!1)},[]);s.useEffect(()=>{t()},[t]);const x=async()=>{n(!0);try{await u(),await t()}catch{}n(!1)},f=async a=>{o(a);try{await h(a),alert("Backup verified successfully")}catch{alert("Backup verification failed")}o(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:x,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:t,disabled:i,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(y,{className:`w-4 h-4 ${i?"animate-spin":""}`})," Refresh"]})]}),c.length===0&&!i&&e.jsx("div",{className:"text-sm text-[#52525b]",children:"No backups found."}),e.jsx("div",{className:"space-y-2",children:c.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:()=>f(a.path),disabled:d===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"})," ",d===a.path?"Verifying...":"Verify"]})]},a.path))})]})}export{A as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as i,r as s,j as e,G as m,aw as p}from"./index-
|
|
1
|
+
import{c as i,r as s,j as e,G as m,aw as p}from"./index-DczEfArU.js";import{P as h}from"./PageHeader-CPfyiZIM.js";import"./chevron-right-DhAaVOkv.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,x as b,j as e,A as u,Z as j,W as S,K as A,T as E}from"./index-
|
|
1
|
+
import{r as a,x as b,j as e,A as u,Z as j,W as S,K as A,T as E}from"./index-DczEfArU.js";import"./Input-C7lzcGqx.js";import{P as N}from"./PageHeader-CPfyiZIM.js";import{E as T}from"./EmptyState-CxJGUl_w.js";import{T as C}from"./Tabs-dEteLxhl.js";import{S as w}from"./SkeletonLoader-DLzSaIMH.js";import{S as P}from"./shield-check-DMM8OpD5.js";import{D as $}from"./dollar-sign-B9t2KmrG.js";import{B as k}from"./bot-DFsTWhzD.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.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:k,goal:E,budget:$,approval:P,error:A,tool:S,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 K(){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 b(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(N,{title:"Activity",subtitle:"Auto-refreshes every 10s",breadcrumbs:[{label:"Command Post"},{label:"Activity"}]}),p.length>0&&e.jsx(C,{tabs:g,activeTab:n,onChange:h}),i&&e.jsx(w,{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,y=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:`${y} 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{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as O,u as Y,r as s,$ as G,Y as J,y as K,aB as Q,j as e,D as A,be as V}from"./index-
|
|
1
|
+
import{p as O,u as Y,r as s,$ as G,Y as J,y as K,aB as Q,j as e,D as A,be as V}from"./index-DczEfArU.js";import{B as T}from"./Input-C7lzcGqx.js";import{S as c}from"./StatusBadge-BE0SQNPu.js";import{P as x}from"./PageHeader-CPfyiZIM.js";import{E as W}from"./EmptyState-CxJGUl_w.js";import{T as X}from"./Tabs-dEteLxhl.js";import{S as Z}from"./SkeletonLoader-DLzSaIMH.js";import{A as _}from"./arrow-left-DvmiAV7y.js";import{C as ee}from"./circle-check-big-CrrpTfnZ.js";import{D as te}from"./dollar-sign-B9t2KmrG.js";import{C as se}from"./clock-D5MlrzQb.js";import{S as ae}from"./save-Bl0vY0Ur.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.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}=O(),o=Y(),[r,m]=s.useState(null),[n,E]=s.useState([]),[u,M]=s.useState([]),[P,b]=s.useState(!0),[p,i]=s.useState(null),[d,D]=s.useState("overview"),[h,g]=s.useState(""),[f,j]=s.useState(""),[v,N]=s.useState(""),[y,S]=s.useState(""),[z,C]=s.useState(!1),[R,$]=s.useState([]),w=s.useCallback(async()=>{if(a){try{const l=(await G()).find(q=>q.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[H,U]=await Promise.all([J(a),K({assignee:a})]);E(H),M(U),i(null)}catch(t){i(t instanceof Error?t.message:"Failed to load agent")}b(!1)}},[a]);s.useEffect(()=>{w()},[w]),s.useEffect(()=>{Q().then(t=>$(t)).catch(()=>{})},[]);const B=async()=>{if(a){C(!0);try{const t=await V(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(),F=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(X,{tabs:L,activeTab:d,onChange:D}),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:[F,"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(W,{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:z,children:"Save"})]})]})}export{je as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,$ as m,j as e,U as p,D as u,X as h,b as j}from"./index-
|
|
1
|
+
import{r,$ as m,j as e,U as p,D as u,X as h,b as j}from"./index-DczEfArU.js";import"./Input-C7lzcGqx.js";import{S as g}from"./StatusBadge-BE0SQNPu.js";import{P as f}from"./PageHeader-CPfyiZIM.js";import{E as b}from"./EmptyState-CxJGUl_w.js";import{S as N}from"./SkeletonLoader-DLzSaIMH.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.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 j(`/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(N,{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(b,{icon:e.jsx(p,{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(u,{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(h,{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(g,{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 +1 @@
|
|
|
1
|
-
import{r as a,J as P,z,j as t,K as B,X as R,O as $,P as _}from"./index-
|
|
1
|
+
import{r as a,J as P,z,j as t,K as B,X as R,O as $,P as _}from"./index-DczEfArU.js";import{B as A}from"./Input-C7lzcGqx.js";import{S as D}from"./StatusBadge-BE0SQNPu.js";import{P as M}from"./PageHeader-CPfyiZIM.js";import{E as L}from"./EmptyState-CxJGUl_w.js";import{T as W}from"./Tabs-dEteLxhl.js";import{S as F}from"./SkeletonLoader-DLzSaIMH.js";import{e as H}from"./approvalHeadline-DB9SgR-9.js";import{S as I}from"./shield-check-DMM8OpD5.js";import{C as K}from"./check-4bqUIREX.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.js";function U(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 q(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 J=[{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}=P(),x=a.useCallback(async()=>{try{const e=await z();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=J.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 ${q(s.urgency)}`,children:[s.urgency==="high"&&t.jsx(B,{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:U(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(K,{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 +1 @@
|
|
|
1
|
-
import{r as s,a2 as F,j as e,a3 as I,a4 as $}from"./index-
|
|
1
|
+
import{r as s,a2 as F,j as e,a3 as I,a4 as $}from"./index-DczEfArU.js";import{B as u}from"./Input-C7lzcGqx.js";import{S as w}from"./StatusBadge-BE0SQNPu.js";import{P as A}from"./PageHeader-CPfyiZIM.js";import{E as L}from"./EmptyState-CxJGUl_w.js";import{M as W}from"./Modal-CpcFi-Gm.js";import{S as M}from"./SkeletonLoader-DLzSaIMH.js";import{P as G}from"./plus-LIrhsu2s.js";import{D as H}from"./dollar-sign-B9t2KmrG.js";import{T as R}from"./trash-2-Co50XYSn.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.js";import"./proxy-B72L9I2p.js";function q(r){const l=r.limitUsd>0?r.currentSpend/r.limitUsd*100:0;return l>=100?"exceeded":l>=r.warningThresholdPercent?"warning":"healthy"}function ae(){const[r,l]=s.useState([]),[c,C]=s.useState(!0),[n,m]=s.useState(null),[S,a]=s.useState(!1),[k,g]=s.useState(!1),[o,p]=s.useState(""),[i,P]=s.useState("global"),[h,b]=s.useState(""),[j,B]=s.useState("monthly"),[f,v]=s.useState("10"),[y,z]=s.useState("80"),[N,T]=s.useState("warn"),d=s.useCallback(async()=>{try{const t=await F();l(t),m(null)}catch(t){m(t instanceof Error?t.message:"Failed to load budgets")}C(!1)},[]);s.useEffect(()=>{d()},[d]);const D=async()=>{if(o.trim()){g(!0);try{await $({name:o.trim(),scope:{type:i,targetId:h||void 0},period:j,limitUsd:parseFloat(f)||10,warningThresholdPercent:parseInt(y)||80,action:N,enabled:!0}),a(!1),p(""),b(""),v("10"),await d()}catch{}g(!1)}},E=async t=>{try{await I(t),await d()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(A,{title:"Costs & Budgets",breadcrumbs:[{label:"Command Post"},{label:"Costs"}],actions:e.jsx(u,{size:"sm",icon:e.jsx(G,{size:14}),onClick:()=>a(!0),children:"Create Budget"})}),c&&e.jsx(M,{variant:"row",count:4}),n&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:n}),!c&&!n&&r.length===0&&e.jsx(L,{icon:e.jsx(H,{size:32}),title:"No budgets",description:"Create budget policies to control agent spending.",action:{label:"Create Budget",onClick:()=>a(!0)}}),!c&&!n&&r.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:r.map(t=>{const U=t.limitUsd>0?t.currentSpend/t.limitUsd*100:0,x=q(t);return e.jsxs("div",{className:"flex items-center gap-4 px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:t.name}),e.jsx(w,{status:x,size:"sm"}),!t.enabled&&e.jsx(w,{status:"disabled",size:"sm"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[e.jsxs("span",{className:"capitalize",children:[t.scope.type,t.scope.targetId?`: ${t.scope.targetId}`:""]}),e.jsx("span",{className:"capitalize",children:t.period}),e.jsxs("span",{children:["Action: ",t.action]})]})]}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsxs("div",{className:"text-sm font-medium text-text",children:["$",t.currentSpend.toFixed(2)," / $",t.limitUsd.toFixed(2)]}),e.jsx("div",{className:"w-24 h-1.5 bg-bg-tertiary rounded-full overflow-hidden mt-1",children:e.jsx("div",{className:`h-full rounded-full transition-all ${x==="exceeded"?"bg-error":x==="warning"?"bg-warning":"bg-success"}`,style:{width:`${Math.min(100,U)}%`}})})]}),e.jsx("button",{onClick:()=>E(t.id),className:"p-1.5 rounded-md text-text-muted hover:text-error hover:bg-error/10 transition-colors flex-shrink-0",title:"Delete budget",children:e.jsx(R,{size:14})})]},t.id)})}),e.jsx(W,{open:S,onClose:()=>a(!1),title:"Create Budget Policy",footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",size:"sm",onClick:()=>a(!1),children:"Cancel"}),e.jsx(u,{size:"sm",onClick:D,loading:k,disabled:!o.trim(),children:"Create"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Name"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:"Budget name...",value:o,onChange:t=>p(t.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Scope"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:i,onChange:t=>P(t.target.value),children:[e.jsx("option",{value:"global",children:"Global"}),e.jsx("option",{value:"agent",children:"Agent"}),e.jsx("option",{value:"goal",children:"Goal"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Period"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:j,onChange:t=>B(t.target.value),children:[e.jsx("option",{value:"daily",children:"Daily"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]})]})]}),i!=="global"&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Target ID"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:`${i} ID...`,value:h,onChange:t=>b(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Limit (USD)"}),e.jsx("input",{type:"number",className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:f,onChange:t=>v(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Warning %"}),e.jsx("input",{type:"number",className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:y,onChange:t=>z(t.target.value)})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Action on Threshold"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:N,onChange:t=>T(t.target.value),children:[e.jsx("option",{value:"warn",children:"Warn"}),e.jsx("option",{value:"pause",children:"Pause"}),e.jsx("option",{value:"stop",children:"Stop"})]})]})]})})]})}export{ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as g,j as t,w as ae,x as re,y as ie,z as ne,U as oe,T as ce,A as q,D as X}from"./index-Dbv5oKsp.js";import"./Input-CTK9oH9g.js";import{S as de}from"./StatusBadge-NtdTQ8_L.js";import{P as J}from"./PageHeader-Bzb_WXw0.js";import{S as xe}from"./SkeletonLoader-fwI4Z-f0.js";import{R as me}from"./refresh-cw-Cs4oDMNE.js";import{L as K}from"./list-todo-qdMNm4-Q.js";import{D as fe}from"./dollar-sign-DlrOHVzA.js";import"./clsx-B-dksMZM.js";import"./chevron-right-U0Ujye5i.js";const Q={idle:"textSecondary",active:"success",paused:"warning",error:"error",stopped:"borderLight"},he={ceo:"C",manager:"M",engineer:"E",researcher:"R",general:"G"};function ge({agents:x,activity:m}){const v=g.useRef(null),R=g.useRef(x),p=g.useRef(m);return R.current=x,p.current=m,g.useEffect(()=>{const b=v.current;if(!b)return;const e=b.getContext("2d");if(!e)return;const w=window.devicePixelRatio||1;let L,$=0;const A=()=>{const i=document.documentElement,c=getComputedStyle(i),s=(u,j,l)=>{const k=u?c.getPropertyValue(u).trim():"";return k||c.getPropertyValue(j).trim()||l};return{bg:s("--theme-bg-base","--color-bg","#09090b"),bgTertiary:s("--theme-bg-grain","--color-bg-tertiary","#27272a"),border:s("--theme-metal-dark","--color-border","#3f3f46"),borderLight:s("--theme-metal","--color-border-light","#52525b"),textMuted:s("--theme-ink-soft","--color-text-muted","#71717a"),textSecondary:s("--theme-paper-fg","--color-text-secondary","#a1a1aa"),accent:s("--theme-accent","--color-accent","#6366f1"),accentLight:s(null,"--color-accent-light","#a5b4fc"),success:s(null,"--color-success","#22c55e"),warning:s(null,"--color-warning","#f59e0b"),error:s(null,"--color-error","#ef4444")}},M=()=>{const i=b.clientWidth,c=b.clientHeight;b.width=i*w,b.height=c*w,e.setTransform(w,0,0,w,0,0)};M(),window.addEventListener("resize",M);const I=()=>{$++;const i=$/15,c=b.clientWidth,s=b.clientHeight,u=R.current,j=p.current,l=A();e.fillStyle=l.bg,e.fillRect(0,0,c,s),e.strokeStyle="#141418",e.lineWidth=.5;for(let a=0;a<c;a+=24)e.beginPath(),e.moveTo(a,s*.72),e.lineTo(a,s),e.stroke();for(let a=s*.72;a<s;a+=24)e.beginPath(),e.moveTo(0,a),e.lineTo(c,a),e.stroke();if(u.length===0){e.fillStyle=l.bgTertiary,e.font="12px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("No agents registered",c/2,s/2-10),e.font="10px -apple-system, BlinkMacSystemFont, sans-serif",e.fillStyle=l.border,e.fillText("Spawn agents to see them here",c/2,s/2+10),e.textAlign="start",L=requestAnimationFrame(I);return}const k=Math.min(u.length,8),D=Math.min(120,(c-20)/k),ee=(c-D*k)/2+D/2;for(let a=0;a<k;a++){const P=u[a],r=ee+a*D,n=s*.55,f=P.status==="active"?"active":P.status,z=l[Q[f]||Q.idle],o=Math.sin(i*.8+a*1.5)*1.5,F=j.some(d=>d.agentId===P.id&&Date.now()-new Date(d.timestamp).getTime()<3e4),E=Math.min(70,D-10),T=10,B=r-E/2,S=n+16;e.fillStyle=l.border,e.fillRect(B,S,E,T),e.fillStyle=l.borderLight,e.fillRect(B+1,S+1,E-2,T-2),e.fillStyle=l.border,e.fillRect(B+3,S+T,3,14),e.fillRect(B+E-6,S+T,3,14);const H=26,O=18,V=r-H/2,U=S-O;e.fillStyle=l.bgTertiary,e.fillRect(V,U,H,O);const Y=f==="error"?l.error:f==="active"?l.success:l.accent;if(e.fillStyle=Y+"30",e.fillRect(V+2,U+2,H-4,O-4),f==="active"||F){e.fillStyle=Y+"60";const d=2+Math.floor(i%3);for(let h=0;h<d;h++){const C=6+Math.sin(i*2+h+a)*5;e.fillRect(V+3,U+3+h*4,C,1.5)}}e.fillStyle=l.border,e.fillRect(r-2,S-1,4,3),e.fillStyle="#1e1e22",e.fillRect(r-10,n+10+o,20,8),e.fillRect(r-11,n-2+o,3,20),e.fillStyle=l.border,e.fillRect(r-7,n+o,14,12);const y=f==="active"&&F?Math.sin(i*1.5+a)*1.5:0;e.fillStyle=l.borderLight,e.fillRect(r-6,n-10+o+y,12,10);const G=Math.sin(i*.3+a*2)>.95?1:2;if(e.fillStyle=z,f==="stopped"?(e.fillRect(r-4,n-7+o+y,2,1),e.fillRect(r-3,n-6+o+y,2,1),e.fillRect(r+1,n-7+o+y,2,1),e.fillRect(r+2,n-6+o+y,2,1)):(e.fillRect(r-4,n-7+o+y,2,G),e.fillRect(r+2,n-7+o+y,2,G)),e.fillStyle=l.borderLight,e.fillRect(r-1,n-14+o+y,2,4),e.fillStyle=z,e.beginPath(),e.arc(r,n-15+o+y,2,0,Math.PI*2),e.fill(),f==="active"&&(e.globalAlpha=.3+Math.sin(i*3+a)*.2,e.beginPath(),e.arc(r,n-15+o+y,5,0,Math.PI*2),e.fill(),e.globalAlpha=1),f==="active"&&F){const d=Math.sin(i*6+a)*2,h=Math.sin(i*6+a+Math.PI)*2;e.fillStyle=l.border,e.fillRect(r-11,n+3+o+d,4,3),e.fillRect(r+7,n+3+o+h,4,3)}else e.fillStyle=l.border,e.fillRect(r-10,n+5+o,3,6),e.fillRect(r+7,n+5+o,3,6);if(f==="active"&&F){for(let d=0;d<2;d++){const h=i*1.5+d*Math.PI+a,C=14+Math.sin(i+d)*4,se=r+Math.cos(h)*C,le=n-3+Math.sin(h)*C*.4+o;e.globalAlpha=.25+Math.sin(i*2+d)*.15,e.fillStyle=z,e.beginPath(),e.arc(se,le,1,0,Math.PI*2),e.fill()}e.globalAlpha=1}if(f==="error"){for(let d=0;d<3;d++){const h=r+Math.sin(i*4+d*2)*12,C=n-5+Math.cos(i*3+d)*8+o;e.globalAlpha=.4+Math.sin(i+d)*.3,e.fillStyle=l.error,e.fillRect(h-1,C-1,2,2)}e.globalAlpha=1}e.fillStyle=f==="stopped"?l.border:l.textMuted,e.font="9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center";const _=Math.max(44,E+14);let N=P.name;if(e.measureText(N).width>_){for(;N.length>1&&e.measureText(N+"…").width>_;)N=N.slice(0,-1);N=N.trimEnd()+"…"}e.fillText(N,r,S+T+24);const te=he[P.role]||"G";e.fillStyle=z+"60",e.font="bold 7px -apple-system, BlinkMacSystemFont, sans-serif",e.fillText(te,r,S+T+33),e.textAlign="start"}if(e.fillStyle=l.bgTertiary,e.font="bold 9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("COMMAND POST",c/2,s-6),e.textAlign="start",j.length>0){const a=j[j.length-1];if(Date.now()-new Date(a.timestamp).getTime()<6e4){e.fillStyle=l.accent+"40",e.fillRect(0,0,c,16),e.fillStyle=l.accentLight,e.font="8px -apple-system, BlinkMacSystemFont, sans-serif";const r=a.message.length>60?a.message.slice(0,57)+"...":a.message;e.textAlign="center",e.fillText(r,c/2,11),e.textAlign="start"}}L=requestAnimationFrame(I)};return I(),()=>{cancelAnimationFrame(L),window.removeEventListener("resize",M)}},[]),t.jsx("canvas",{ref:v,className:"w-full rounded-xl border border-border",style:{height:220,imageRendering:"pixelated"}})}function Z(x){const m=Math.floor((Date.now()-new Date(x).getTime())/1e3);return m<60?`${m}s`:m<3600?`${Math.floor(m/60)}m`:m<86400?`${Math.floor(m/3600)}h`:`${Math.floor(m/86400)}d`}function W({icon:x,label:m,value:v,sub:R,color:p}){return t.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(x,{size:14,className:p}),t.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:m})]}),t.jsx("div",{className:"text-2xl font-bold text-text",children:v}),R&&t.jsx("div",{className:"text-[11px] text-text-muted mt-1",children:R})]})}function Ae(){var c;const[x,m]=g.useState(null),[v,R]=g.useState([]),[p,b]=g.useState([]),[e,w]=g.useState(0),[L,$]=g.useState(!0),A=g.useCallback(async()=>{try{const[s,u,j,l]=await Promise.all([ae(),re(20),ie(),ne("pending")]);m(s),R(u),b(j),w(l.length)}catch{}$(!1)},[]);if(g.useEffect(()=>{A();const s=setInterval(A,15e3);return()=>clearInterval(s)},[A]),L)return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}]}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:t.jsx(xe,{variant:"metric",count:4})})]});if(!x)return t.jsx("div",{className:"text-center py-12 text-text-muted",children:"Failed to load dashboard"});const M=x.budgetUtilization??0,I=p.filter(s=>s.status==="in_progress").length,i=p.filter(s=>s.status==="blocked").length;return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}],actions:t.jsx("button",{onClick:A,className:"p-1.5 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:t.jsx(me,{size:16})})}),t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[t.jsx(W,{icon:oe,label:"Agents Enabled",value:x.totalAgents,sub:`${x.activeAgents} running, ${Math.max(0,x.totalAgents-x.activeAgents)} paused`,color:"text-info"}),t.jsx(W,{icon:K,label:"Tasks In Progress",value:I,sub:`${p.length} open, ${i} blocked`,color:"text-warning"}),t.jsx(W,{icon:fe,label:"Budget Used",value:`${Math.round(M)}%`,sub:M>=80?"Nearing limit":"Healthy",color:M>=80?"text-error":"text-success"}),t.jsx(W,{icon:ce,label:"Goals",value:((c=x.goalTree)==null?void 0:c.length)??0,sub:"in hierarchy",color:"text-purple"})]}),x.agents.length>0&&t.jsx(ge,{agents:x.agents,activity:v}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(q,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Activity"})]}),t.jsx(X,{to:"/command-post/activity",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:v.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No activity yet"}):[...v].reverse().slice(0,15).map((s,u)=>t.jsxs("div",{className:"flex items-start gap-2 px-4 py-2",children:[t.jsx(q,{size:12,className:"text-text-muted mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1",children:s.message}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.timestamp)})]},`${s.timestamp}-${u}`))})]}),t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(K,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Issues"})]}),t.jsx(X,{to:"/command-post/issues",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:p.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No issues yet"}):p.slice(0,10).map(s=>t.jsxs(X,{to:`/command-post/issues/${s.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[t.jsx(de,{status:s.status,variant:"dot",size:"sm"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1 truncate",children:s.title}),s.assigneeAgentId&&t.jsx("span",{className:"text-[10px] text-text-muted",children:s.assigneeAgentId}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.updatedAt)})]},s.id))})]})]})]})}export{Ae as default};
|
|
1
|
+
import{r as g,j as t,w as ae,x as re,y as ie,z as ne,U as oe,T as ce,A as q,D as X}from"./index-DczEfArU.js";import"./Input-C7lzcGqx.js";import{S as de}from"./StatusBadge-BE0SQNPu.js";import{P as J}from"./PageHeader-CPfyiZIM.js";import{S as xe}from"./SkeletonLoader-DLzSaIMH.js";import{R as me}from"./refresh-cw-DyPWslHB.js";import{L as K}from"./list-todo-JeleiL5r.js";import{D as fe}from"./dollar-sign-B9t2KmrG.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.js";const Q={idle:"textSecondary",active:"success",paused:"warning",error:"error",stopped:"borderLight"},he={ceo:"C",manager:"M",engineer:"E",researcher:"R",general:"G"};function ge({agents:x,activity:m}){const v=g.useRef(null),R=g.useRef(x),p=g.useRef(m);return R.current=x,p.current=m,g.useEffect(()=>{const b=v.current;if(!b)return;const e=b.getContext("2d");if(!e)return;const w=window.devicePixelRatio||1;let L,$=0;const A=()=>{const i=document.documentElement,c=getComputedStyle(i),s=(u,j,l)=>{const k=u?c.getPropertyValue(u).trim():"";return k||c.getPropertyValue(j).trim()||l};return{bg:s("--theme-bg-base","--color-bg","#09090b"),bgTertiary:s("--theme-bg-grain","--color-bg-tertiary","#27272a"),border:s("--theme-metal-dark","--color-border","#3f3f46"),borderLight:s("--theme-metal","--color-border-light","#52525b"),textMuted:s("--theme-ink-soft","--color-text-muted","#71717a"),textSecondary:s("--theme-paper-fg","--color-text-secondary","#a1a1aa"),accent:s("--theme-accent","--color-accent","#6366f1"),accentLight:s(null,"--color-accent-light","#a5b4fc"),success:s(null,"--color-success","#22c55e"),warning:s(null,"--color-warning","#f59e0b"),error:s(null,"--color-error","#ef4444")}},M=()=>{const i=b.clientWidth,c=b.clientHeight;b.width=i*w,b.height=c*w,e.setTransform(w,0,0,w,0,0)};M(),window.addEventListener("resize",M);const I=()=>{$++;const i=$/15,c=b.clientWidth,s=b.clientHeight,u=R.current,j=p.current,l=A();e.fillStyle=l.bg,e.fillRect(0,0,c,s),e.strokeStyle="#141418",e.lineWidth=.5;for(let a=0;a<c;a+=24)e.beginPath(),e.moveTo(a,s*.72),e.lineTo(a,s),e.stroke();for(let a=s*.72;a<s;a+=24)e.beginPath(),e.moveTo(0,a),e.lineTo(c,a),e.stroke();if(u.length===0){e.fillStyle=l.bgTertiary,e.font="12px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("No agents registered",c/2,s/2-10),e.font="10px -apple-system, BlinkMacSystemFont, sans-serif",e.fillStyle=l.border,e.fillText("Spawn agents to see them here",c/2,s/2+10),e.textAlign="start",L=requestAnimationFrame(I);return}const k=Math.min(u.length,8),D=Math.min(120,(c-20)/k),ee=(c-D*k)/2+D/2;for(let a=0;a<k;a++){const P=u[a],r=ee+a*D,n=s*.55,f=P.status==="active"?"active":P.status,z=l[Q[f]||Q.idle],o=Math.sin(i*.8+a*1.5)*1.5,F=j.some(d=>d.agentId===P.id&&Date.now()-new Date(d.timestamp).getTime()<3e4),E=Math.min(70,D-10),T=10,B=r-E/2,S=n+16;e.fillStyle=l.border,e.fillRect(B,S,E,T),e.fillStyle=l.borderLight,e.fillRect(B+1,S+1,E-2,T-2),e.fillStyle=l.border,e.fillRect(B+3,S+T,3,14),e.fillRect(B+E-6,S+T,3,14);const H=26,O=18,V=r-H/2,U=S-O;e.fillStyle=l.bgTertiary,e.fillRect(V,U,H,O);const Y=f==="error"?l.error:f==="active"?l.success:l.accent;if(e.fillStyle=Y+"30",e.fillRect(V+2,U+2,H-4,O-4),f==="active"||F){e.fillStyle=Y+"60";const d=2+Math.floor(i%3);for(let h=0;h<d;h++){const C=6+Math.sin(i*2+h+a)*5;e.fillRect(V+3,U+3+h*4,C,1.5)}}e.fillStyle=l.border,e.fillRect(r-2,S-1,4,3),e.fillStyle="#1e1e22",e.fillRect(r-10,n+10+o,20,8),e.fillRect(r-11,n-2+o,3,20),e.fillStyle=l.border,e.fillRect(r-7,n+o,14,12);const y=f==="active"&&F?Math.sin(i*1.5+a)*1.5:0;e.fillStyle=l.borderLight,e.fillRect(r-6,n-10+o+y,12,10);const G=Math.sin(i*.3+a*2)>.95?1:2;if(e.fillStyle=z,f==="stopped"?(e.fillRect(r-4,n-7+o+y,2,1),e.fillRect(r-3,n-6+o+y,2,1),e.fillRect(r+1,n-7+o+y,2,1),e.fillRect(r+2,n-6+o+y,2,1)):(e.fillRect(r-4,n-7+o+y,2,G),e.fillRect(r+2,n-7+o+y,2,G)),e.fillStyle=l.borderLight,e.fillRect(r-1,n-14+o+y,2,4),e.fillStyle=z,e.beginPath(),e.arc(r,n-15+o+y,2,0,Math.PI*2),e.fill(),f==="active"&&(e.globalAlpha=.3+Math.sin(i*3+a)*.2,e.beginPath(),e.arc(r,n-15+o+y,5,0,Math.PI*2),e.fill(),e.globalAlpha=1),f==="active"&&F){const d=Math.sin(i*6+a)*2,h=Math.sin(i*6+a+Math.PI)*2;e.fillStyle=l.border,e.fillRect(r-11,n+3+o+d,4,3),e.fillRect(r+7,n+3+o+h,4,3)}else e.fillStyle=l.border,e.fillRect(r-10,n+5+o,3,6),e.fillRect(r+7,n+5+o,3,6);if(f==="active"&&F){for(let d=0;d<2;d++){const h=i*1.5+d*Math.PI+a,C=14+Math.sin(i+d)*4,se=r+Math.cos(h)*C,le=n-3+Math.sin(h)*C*.4+o;e.globalAlpha=.25+Math.sin(i*2+d)*.15,e.fillStyle=z,e.beginPath(),e.arc(se,le,1,0,Math.PI*2),e.fill()}e.globalAlpha=1}if(f==="error"){for(let d=0;d<3;d++){const h=r+Math.sin(i*4+d*2)*12,C=n-5+Math.cos(i*3+d)*8+o;e.globalAlpha=.4+Math.sin(i+d)*.3,e.fillStyle=l.error,e.fillRect(h-1,C-1,2,2)}e.globalAlpha=1}e.fillStyle=f==="stopped"?l.border:l.textMuted,e.font="9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center";const _=Math.max(44,E+14);let N=P.name;if(e.measureText(N).width>_){for(;N.length>1&&e.measureText(N+"…").width>_;)N=N.slice(0,-1);N=N.trimEnd()+"…"}e.fillText(N,r,S+T+24);const te=he[P.role]||"G";e.fillStyle=z+"60",e.font="bold 7px -apple-system, BlinkMacSystemFont, sans-serif",e.fillText(te,r,S+T+33),e.textAlign="start"}if(e.fillStyle=l.bgTertiary,e.font="bold 9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("COMMAND POST",c/2,s-6),e.textAlign="start",j.length>0){const a=j[j.length-1];if(Date.now()-new Date(a.timestamp).getTime()<6e4){e.fillStyle=l.accent+"40",e.fillRect(0,0,c,16),e.fillStyle=l.accentLight,e.font="8px -apple-system, BlinkMacSystemFont, sans-serif";const r=a.message.length>60?a.message.slice(0,57)+"...":a.message;e.textAlign="center",e.fillText(r,c/2,11),e.textAlign="start"}}L=requestAnimationFrame(I)};return I(),()=>{cancelAnimationFrame(L),window.removeEventListener("resize",M)}},[]),t.jsx("canvas",{ref:v,className:"w-full rounded-xl border border-border",style:{height:220,imageRendering:"pixelated"}})}function Z(x){const m=Math.floor((Date.now()-new Date(x).getTime())/1e3);return m<60?`${m}s`:m<3600?`${Math.floor(m/60)}m`:m<86400?`${Math.floor(m/3600)}h`:`${Math.floor(m/86400)}d`}function W({icon:x,label:m,value:v,sub:R,color:p}){return t.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(x,{size:14,className:p}),t.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:m})]}),t.jsx("div",{className:"text-2xl font-bold text-text",children:v}),R&&t.jsx("div",{className:"text-[11px] text-text-muted mt-1",children:R})]})}function Ae(){var c;const[x,m]=g.useState(null),[v,R]=g.useState([]),[p,b]=g.useState([]),[e,w]=g.useState(0),[L,$]=g.useState(!0),A=g.useCallback(async()=>{try{const[s,u,j,l]=await Promise.all([ae(),re(20),ie(),ne("pending")]);m(s),R(u),b(j),w(l.length)}catch{}$(!1)},[]);if(g.useEffect(()=>{A();const s=setInterval(A,15e3);return()=>clearInterval(s)},[A]),L)return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}]}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:t.jsx(xe,{variant:"metric",count:4})})]});if(!x)return t.jsx("div",{className:"text-center py-12 text-text-muted",children:"Failed to load dashboard"});const M=x.budgetUtilization??0,I=p.filter(s=>s.status==="in_progress").length,i=p.filter(s=>s.status==="blocked").length;return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}],actions:t.jsx("button",{onClick:A,className:"p-1.5 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:t.jsx(me,{size:16})})}),t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[t.jsx(W,{icon:oe,label:"Agents Enabled",value:x.totalAgents,sub:`${x.activeAgents} running, ${Math.max(0,x.totalAgents-x.activeAgents)} paused`,color:"text-info"}),t.jsx(W,{icon:K,label:"Tasks In Progress",value:I,sub:`${p.length} open, ${i} blocked`,color:"text-warning"}),t.jsx(W,{icon:fe,label:"Budget Used",value:`${Math.round(M)}%`,sub:M>=80?"Nearing limit":"Healthy",color:M>=80?"text-error":"text-success"}),t.jsx(W,{icon:ce,label:"Goals",value:((c=x.goalTree)==null?void 0:c.length)??0,sub:"in hierarchy",color:"text-purple"})]}),x.agents.length>0&&t.jsx(ge,{agents:x.agents,activity:v}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(q,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Activity"})]}),t.jsx(X,{to:"/command-post/activity",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:v.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No activity yet"}):[...v].reverse().slice(0,15).map((s,u)=>t.jsxs("div",{className:"flex items-start gap-2 px-4 py-2",children:[t.jsx(q,{size:12,className:"text-text-muted mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1",children:s.message}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.timestamp)})]},`${s.timestamp}-${u}`))})]}),t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(K,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Issues"})]}),t.jsx(X,{to:"/command-post/issues",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:p.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No issues yet"}):p.slice(0,10).map(s=>t.jsxs(X,{to:`/command-post/issues/${s.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[t.jsx(de,{status:s.status,variant:"dot",size:"sm"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1 truncate",children:s.title}),s.assigneeAgentId&&t.jsx("span",{className:"text-[10px] text-text-muted",children:s.assigneeAgentId}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.updatedAt)})]},s.id))})]})]})]})}export{Ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e,b as f,X as j}from"./index-
|
|
1
|
+
import{r as i,j as e,b as f,X as j}from"./index-DczEfArU.js";import{F as N}from"./folder-BXotS0h-.js";import{F as y}from"./flask-conical-BJnD20AK.js";import{S as v}from"./search-DLl1kVch.js";import{R as p}from"./refresh-cw-DyPWslHB.js";import{F as w}from"./file-text-C-9as3zm.js";async function h(t){const a=await f(t);if(!a.ok)throw new Error(`HTTP ${a.status}`);return a.json()}function b(t){return t===void 0?"—":t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}K`:`${(t/1024/1024).toFixed(1)}M`}function g(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`}function k({path:t,onClose:a}){const[r,c]=i.useState(null);return i.useEffect(()=>{c(null),h(`/api/files/content?path=${encodeURIComponent(t)}`).then(l=>c(l)).catch(l=>c({error:String(l)}))},[t]),e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 flex items-center justify-center p-4",onClick:a,children:e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl w-full max-w-5xl max-h-[90vh] flex flex-col shadow-2xl",onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-text truncate",children:t}),r&&"sizeBytes"in r&&e.jsxs("div",{className:"text-xs text-text-muted",children:[b(r.sizeBytes)," · ",r.encoding,r.truncated?" · truncated at 1MB":""]})]}),e.jsx("button",{onClick:a,className:"p-1 rounded hover:bg-bg-tertiary text-text-muted",title:"Close",children:e.jsx(j,{size:18})})]}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[r===null&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),r&&"error"in r&&e.jsx("div",{className:"text-error text-sm py-8 text-center",children:r.error}),r&&"content"in r&&e.jsx("pre",{className:"text-[12px] font-mono leading-snug whitespace-pre-wrap text-text-secondary",children:r.content})]})]})})}function C(){const[t,a]=i.useState([]),[r,c]=i.useState(!0),[l,m]=i.useState(""),[o,n]=i.useState(null),d=i.useCallback(async()=>{c(!0);try{const s=await h("/api/files/edited?limit=300");a(s.files||[])}catch{}c(!1)},[]);i.useEffect(()=>{d()},[d]);const x=l?t.filter(s=>s.path.toLowerCase().includes(l.toLowerCase())):t;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-bg-secondary",children:[e.jsx(v,{size:14,className:"text-text-muted"}),e.jsx("input",{type:"text",placeholder:"Filter by path…",value:l,onChange:s=>m(s.target.value),className:"flex-1 bg-transparent text-sm outline-none"})]}),e.jsxs("button",{onClick:d,className:"px-3 py-1.5 rounded-lg border border-border bg-bg-secondary text-sm hover:bg-bg-tertiary flex items-center gap-1.5",title:"Refresh",children:[e.jsx(p,{size:14,className:r?"animate-spin":""}),r?"Loading":"Refresh"]}),e.jsxs("div",{className:"text-xs text-text-muted",children:[x.length," / ",t.length]})]}),r&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),!r&&x.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:l?"No files match filter":"No file edits recorded yet"}),x.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:x.map(s=>e.jsxs("button",{onClick:()=>s.readable&&s.exists&&n(s.path),disabled:!s.readable||!s.exists,className:"w-full flex items-start gap-3 px-4 py-2.5 text-left hover:bg-bg-tertiary transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(w,{size:14,className:s.isSelfMod?"text-accent mt-0.5 flex-shrink-0":"text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-mono text-text truncate",children:s.path}),e.jsxs("div",{className:"text-xs text-text-muted mt-0.5 flex items-center gap-2 flex-wrap",children:[s.isSelfMod&&e.jsx("span",{className:"px-1 rounded bg-accent/15 text-accent text-[10px]",children:"self-mod"}),e.jsxs("span",{children:["×",s.writeCount]}),s.tools.length>0&&e.jsx("span",{children:s.tools.join("+")}),s.channels.length>0&&e.jsxs("span",{children:["via ",s.channels.join(", ")]}),!s.exists&&e.jsx("span",{className:"text-warn",children:"deleted"}),e.jsx("span",{children:b(s.sizeBytes)})]})]}),e.jsx("div",{className:"text-xs text-text-muted flex-shrink-0",children:g(s.lastWrittenAt)})]},s.path))}),o&&e.jsx(k,{path:o,onClose:()=>n(null)})]})}function S(){const[t,a]=i.useState([]),[r,c]=i.useState(!0),[l,m]=i.useState(null),o=i.useCallback(async()=>{c(!0);try{const n=await h("/api/research/recent?limit=50");a(n.research||[])}catch{}c(!1)},[]);return i.useEffect(()=>{o()},[o]),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:o,className:"px-3 py-1.5 rounded-lg border border-border bg-bg-secondary text-sm hover:bg-bg-tertiary flex items-center gap-1.5",children:[e.jsx(p,{size:14,className:r?"animate-spin":""}),r?"Loading":"Refresh"]}),e.jsxs("div",{className:"text-xs text-text-muted",children:[t.length," items"]})]}),r&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),!r&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"No research recorded yet. Complete a goal and results will appear here."}),e.jsx("div",{className:"space-y-2",children:t.map(n=>{var u;const d=l===n.id,x=n.content.slice(0,200),s=n.subtaskTitle?`${n.goalTitle} — ${n.subtaskTitle}`:((u=n.tags)==null?void 0:u.join(" · "))||n.kind;return e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary overflow-hidden",children:[e.jsxs("button",{onClick:()=>m(d?null:n.id),className:"w-full text-left px-4 py-3 hover:bg-bg-tertiary transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-bg-tertiary text-text-muted uppercase tracking-wide font-medium",children:n.kind.replace(/_/g," ")}),e.jsx("span",{className:"text-xs text-text-muted",children:g(n.at)})]}),e.jsx("div",{className:"text-sm font-medium text-text truncate",children:s}),!d&&e.jsxs("div",{className:"text-xs text-text-secondary mt-1 line-clamp-2",children:[x,n.content.length>200?"…":""]})]}),d&&e.jsx("div",{className:"px-4 pb-4",children:e.jsx("pre",{className:"text-[12px] font-mono leading-snug whitespace-pre-wrap text-text-secondary",children:n.content})})]},n.id)})})]})}function M(){const[t,a]=i.useState("files");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>a("files"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors ${t==="files"?"bg-accent/15 text-accent border border-accent/30":"text-text-secondary hover:text-text hover:bg-bg-tertiary border border-transparent"}`,children:[e.jsx(N,{size:14})," Files edited"]}),e.jsxs("button",{onClick:()=>a("research"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors ${t==="research"?"bg-accent/15 text-accent border border-accent/30":"text-text-secondary hover:text-text hover:bg-bg-tertiary border border-transparent"}`,children:[e.jsx(y,{size:14})," Research"]})]}),t==="files"?e.jsx(C,{}):e.jsx(S,{})]})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,Q as D,j as e,T as N,V as $,X as M,b as y}from"./index-
|
|
1
|
+
import{r as i,Q as D,j as e,T as N,V as $,X as M,b as y}from"./index-DczEfArU.js";import{B as j}from"./Input-C7lzcGqx.js";import{S as T}from"./StatusBadge-BE0SQNPu.js";import{P as O}from"./PageHeader-CPfyiZIM.js";import{E as A}from"./EmptyState-CxJGUl_w.js";import{M as F}from"./Modal-CpcFi-Gm.js";import{S as L}from"./SkeletonLoader-DLzSaIMH.js";import{P as B}from"./plus-LIrhsu2s.js";import{C as I}from"./chevron-right-DhAaVOkv.js";import{T as U}from"./trash-2-Co50XYSn.js";import"./clsx-B-dksMZM.js";import"./proxy-B72L9I2p.js";function _(t){const a=Math.floor((Date.now()-new Date(t).getTime())/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`}const H=["pending","in_progress","completed","blocked"];function J({node:t,onClose:a,onRefresh:l}){const[d,c]=i.useState(!1),[x,m]=i.useState(!1),r=t.goal,g=async()=>{c(!0);try{await y(`/api/goals/${r.id}`,{method:"DELETE"}),l(),a()}catch{}c(!1)},o=async n=>{m(!0);try{await y(`/api/goals/${r.id}`,{method:"PATCH",body:JSON.stringify({status:n})}),l()}catch{}m(!1)};return e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-text",children:r.title}),r.description&&e.jsx("p",{className:"text-sm text-text-secondary mt-1",children:r.description})]}),e.jsx("button",{onClick:a,className:"p-1 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:e.jsx(M,{size:16})})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 text-xs",children:[e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Status: "}),e.jsx(T,{status:r.status,size:"sm"})]}),r.progress>0&&e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Progress: "}),e.jsxs("span",{className:"text-text font-medium",children:[Math.round(r.progress),"%"]})]}),t.children.length>0&&e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Sub-goals: "}),e.jsxs("span",{className:"text-text font-medium",children:[t.children.filter(n=>n.goal.status==="completed"||n.goal.status==="done").length,"/",t.children.length," done"]})]}),e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Updated: "}),e.jsxs("span",{className:"text-text font-medium",children:[_(r.updatedAt||r.createdAt||new Date().toISOString())," ago"]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-2",children:"Change Status"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:H.map(n=>e.jsx("button",{disabled:x||r.status===n,onClick:()=>o(n),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${r.status===n?"bg-accent/20 text-accent border border-accent/30":"bg-bg-tertiary text-text-secondary hover:bg-bg-tertiary/80 border border-border"} disabled:opacity-50`,children:n.replace("_"," ")},n))})]}),e.jsx("div",{className:"pt-2 border-t border-border flex justify-end",children:e.jsxs("button",{onClick:g,disabled:d,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-error hover:bg-error/10 transition-colors disabled:opacity-50",children:[e.jsx(U,{size:12}),d?"Deleting...":"Delete Goal"]})})]})}function z({node:t,expanded:a,toggleExpand:l,selectedId:d,onSelect:c}){const x=t.children.length>0,m=a.has(t.goal.id),r=d===t.goal.id,g=t.children.filter(o=>o.goal.status==="completed"||o.goal.status==="done").length;return e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-2 py-2 px-3 rounded-lg transition-colors cursor-pointer group ${r?"bg-accent/10 border-l-2 border-accent":"hover:bg-bg-tertiary/50"}`,style:{paddingLeft:`${t.depth*24+12}px`},onClick:()=>c(t),children:[x?e.jsx("button",{onClick:o=>{o.stopPropagation(),l(t.goal.id)},className:"p-0.5 rounded hover:bg-bg-tertiary transition-colors",children:m?e.jsx($,{size:14,className:"text-text-muted"}):e.jsx(I,{size:14,className:"text-text-muted"})}):e.jsx("span",{className:"w-[18px] flex-shrink-0"}),e.jsx(N,{size:14,className:r?"text-accent":"text-text-muted"}),e.jsx("span",{className:"text-sm text-text flex-1 truncate",children:t.goal.title}),e.jsx(T,{status:t.goal.status,size:"sm"}),x&&e.jsxs("span",{className:"text-[10px] text-text-muted",children:[g,"/",t.children.length]}),t.goal.progress>0&&e.jsx("div",{className:"w-16 h-1.5 bg-bg-tertiary rounded-full overflow-hidden flex-shrink-0",children:e.jsx("div",{className:"h-full bg-accent rounded-full transition-all",style:{width:`${Math.min(100,t.goal.progress)}%`}})})]}),x&&m&&e.jsx("div",{children:t.children.map(o=>e.jsx(z,{node:o,expanded:a,toggleExpand:l,selectedId:d,onSelect:c},o.goal.id))})]})}function E(t,a){for(const l of t){if(l.goal.id===a)return l;const d=E(l.children,a);if(d)return d}return null}function ae(){const[t,a]=i.useState([]),[l,d]=i.useState(!0),[c,x]=i.useState(null),[m,r]=i.useState(new Set),[g,o]=i.useState(null),[n,u]=i.useState(!1),[p,v]=i.useState(""),[P,S]=i.useState(!1),b=i.useCallback(async()=>{try{const s=await D();a(s),r(new Set(s.map(h=>h.goal.id))),x(null)}catch(s){x(s instanceof Error?s.message:"Failed to load goals")}d(!1)},[]);i.useEffect(()=>{b()},[b]);const C=s=>{r(h=>{const f=new Set(h);return f.has(s)?f.delete(s):f.add(s),f})},G=s=>{o(h=>h===s.goal.id?null:s.goal.id),s.children.length>0&&!m.has(s.goal.id)&&C(s.goal.id)},w=async()=>{if(p.trim()){S(!0);try{await y("/api/command-post/goals",{method:"POST",body:JSON.stringify({title:p.trim()})}),u(!1),v(""),await b()}catch{}S(!1)}},k=g?E(t,g):null;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(O,{title:"Goals",breadcrumbs:[{label:"Command Post"},{label:"Goals"}],actions:e.jsx(j,{size:"sm",icon:e.jsx(B,{size:14}),onClick:()=>u(!0),children:"Create Goal"})}),l&&e.jsx(L,{variant:"row",count:5}),c&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:c}),!l&&!c&&t.length===0&&e.jsx(A,{icon:e.jsx(N,{size:32}),title:"No goals",description:"Create your first goal to start organizing agent work.",action:{label:"Create Goal",onClick:()=>u(!0)}}),!l&&!c&&t.length>0&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-border bg-bg-secondary overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-text-muted",children:[t.length," top-level goal",t.length!==1?"s":""]}),e.jsx("span",{className:"text-[10px] text-text-muted",children:"Click a goal to view details"})]}),e.jsx("div",{className:"divide-y divide-border",children:t.map(s=>e.jsx(z,{node:s,expanded:m,toggleExpand:C,selectedId:g,onSelect:G},s.goal.id))})]}),e.jsx("div",{className:"lg:col-span-1",children:k?e.jsx(J,{node:k,onClose:()=>o(null),onRefresh:b}):e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-8 text-center",children:[e.jsx(N,{size:24,className:"text-text-muted mx-auto mb-2"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Select a goal to view details"})]})})]}),e.jsx(F,{open:n,onClose:()=>u(!1),title:"Create Goal",footer:e.jsxs(e.Fragment,{children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:()=>u(!1),children:"Cancel"}),e.jsx(j,{size:"sm",onClick:w,loading:P,disabled:!p.trim(),children:"Create"})]}),children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Goal Title"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:"Enter goal title...",value:p,onChange:s=>v(s.target.value),onKeyDown:s=>s.key==="Enter"&&w(),autoFocus:!0})]})})]})}export{ae as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as A,r as d,J as P,j as e,bi as Y,bL as G,u as Q,z as Z,Y as ee,$ as te,y as se,l as re,K as I,X as E,V as ae,D as B,bM as ne,O as ie,P as oe,bN as le,b as de}from"./index-
|
|
1
|
+
import{c as A,r as d,J as P,j as e,bi as Y,bL as G,u as Q,z as Z,Y as ee,$ as te,y as se,l as re,K as I,X as E,V as ae,D as B,bM as ne,O as ie,P as oe,bN as le,b as de}from"./index-DczEfArU.js";import{B as m}from"./Input-C7lzcGqx.js";import{P as ce}from"./PageHeader-CPfyiZIM.js";import{E as xe}from"./EmptyState-CxJGUl_w.js";import{T as ue}from"./Tabs-dEteLxhl.js";import{S as pe}from"./SkeletonLoader-DLzSaIMH.js";import{e as he}from"./approvalHeadline-DB9SgR-9.js";import{M as U}from"./message-square-C9bK5TAD.js";import{B as q}from"./bot-DFsTWhzD.js";import{C}from"./clock-D5MlrzQb.js";import{S as me}from"./send-BqZ0Qzz-.js";import{S as ge}from"./shield-check-DMM8OpD5.js";import{C as D}from"./check-4bqUIREX.js";import{F as fe}from"./funnel-BkW9zcis.js";import{C as be}from"./chevron-up-DhONR6eV.js";import{R as ve}from"./rotate-ccw-C7z7lzst.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as D,u as $,r,bI as B,b as S,bJ as M,j as e,D as L,ba as C}from"./index-
|
|
1
|
+
import{p as D,u as $,r,bI as B,b as S,bJ as M,j as e,D as L,ba as C}from"./index-DczEfArU.js";import{B as c}from"./Input-C7lzcGqx.js";import{S as O}from"./StatusBadge-BE0SQNPu.js";import{P as h}from"./PageHeader-CPfyiZIM.js";import{S as U}from"./SkeletonLoader-DLzSaIMH.js";import{A as R}from"./arrow-left-DvmiAV7y.js";import{M as _}from"./message-square-C9bK5TAD.js";import{S as F}from"./send-BqZ0Qzz-.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.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"},J=["backlog","todo","in_progress","in_review","done","blocked","cancelled"];function te(){const{id:a}=D(),i=$(),[s,o]=r.useState(null),[l,k]=r.useState([]),[I,P]=r.useState(!0),[g,f]=r.useState(null),[A,x]=r.useState(!1),[m,u]=r.useState(""),[n,j]=r.useState(""),[E,y]=r.useState(!1),[v,T]=r.useState(""),p=r.useCallback(async()=>{if(a){try{const t=await B(a);o(t),u(t.title);try{const d=await S(`/api/command-post/issues/${a}/comments`);d.ok&&k(await d.json())}catch{}f(null)}catch(t){f(t instanceof Error?t.message:"Failed to load issue")}P(!1)}},[a]);r.useEffect(()=>{p()},[p]),r.useEffect(()=>{s!=null&&s.id&&M(s.id).then(t=>T(t.ancestry)).catch(()=>{})},[s==null?void 0:s.id]);const z=async t=>{if(!(!a||!s))try{const d=await C(a,{status:t});o(d)}catch{}},N=async()=>{if(!(!a||!s||!m.trim()))try{const t=await C(a,{title:m.trim()});o(t),x(!1)}catch{}},w=async()=>{if(!(!a||!n.trim())){y(!0);try{await S(`/api/command-post/issues/${a}/comments`,{method:"POST",body:JSON.stringify({body:n.trim()})}),j(""),await p()}catch{}y(!1)}};return I?e.jsxs("div",{className:"space-y-6",children:[e.jsx(h,{title:"Issue",breadcrumbs:[{label:"Command Post"},{label:"Issues",href:"/command-post/issues"},{label:"..."}]}),e.jsx(U,{variant:"card",count:1})]}):g||!s?e.jsxs("div",{className:"space-y-6",children:[e.jsx(h,{title:"Issue",breadcrumbs:[{label:"Command Post"},{label:"Issues",href:"/command-post/issues"},{label:"Error"}]}),e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-error text-sm mb-4",children:g??"Issue not found"}),e.jsx(c,{variant:"secondary",size:"sm",onClick:()=>i("/command-post/issues"),children:"Back to Issues"})]})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(h,{title:s.identifier,breadcrumbs:[{label:"Command Post"},{label:"Issues",href:"/command-post/issues"},{label:s.identifier}],actions:e.jsxs(L,{to:"/command-post/issues",className:"flex items-center gap-1 text-xs text-text-muted hover:text-text",children:[e.jsx(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:J.map(t=>e.jsx("button",{onClick:()=>z(t),disabled:s.status===t,className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors border ${s.status===t?"border-accent bg-accent/10 text-accent":"border-border bg-bg-tertiary text-text-muted hover:text-text hover:border-border-light"}`,children:t.replace(/_/g," ")},t))}),e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[e.jsx(_,{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 +1 @@
|
|
|
1
|
-
import{r as s,y as k,j as e,D as T,F as P}from"./index-
|
|
1
|
+
import{r as s,y as k,j as e,D as T,F as P}from"./index-DczEfArU.js";import{B as u}from"./Input-C7lzcGqx.js";import{S as D}from"./StatusBadge-BE0SQNPu.js";import{P as z}from"./PageHeader-CPfyiZIM.js";import{E}from"./EmptyState-CxJGUl_w.js";import{T as L}from"./Tabs-dEteLxhl.js";import{M}from"./Modal-CpcFi-Gm.js";import{S as $}from"./SkeletonLoader-DLzSaIMH.js";import{P as A}from"./plus-LIrhsu2s.js";import{L as B}from"./list-todo-JeleiL5r.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.js";import"./proxy-B72L9I2p.js";function R(a){const r=Math.floor((Date.now()-new Date(a).getTime())/1e3);return r<60?`${r}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}const _={critical:"text-error",high:"text-warning",medium:"text-accent",low:"text-text-muted"},F=[{id:"all",label:"All"},{id:"backlog",label:"Backlog"},{id:"todo",label:"Todo"},{id:"in_progress",label:"In Progress"},{id:"in_review",label:"In Review"},{id:"done",label:"Done"},{id:"blocked",label:"Blocked"}];function ee(){const[a,r]=s.useState([]),[c,w]=s.useState(!0),[l,m]=s.useState(null),[o,y]=s.useState("all"),[v,i]=s.useState(!1),[n,h]=s.useState(""),[p,b]=s.useState("medium"),[f,g]=s.useState(""),[C,j]=s.useState(!1),d=s.useCallback(async()=>{try{const t=await k();r(t),m(null)}catch(t){m(t instanceof Error?t.message:"Failed to load issues")}w(!1)},[]);s.useEffect(()=>{d()},[d]);const N=async()=>{if(n.trim()){j(!0);try{await P({title:n,description:f,priority:p}),i(!1),h(""),g(""),b("medium"),await d()}catch{}j(!1)}},x=o==="all"?a:a.filter(t=>t.status===o),S=F.map(t=>({...t,count:t.id==="all"?a.length:a.filter(I=>I.status===t.id).length}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx(z,{title:"Issues",breadcrumbs:[{label:"Command Post"},{label:"Issues"}],actions:e.jsx(u,{size:"sm",icon:e.jsx(A,{size:14}),onClick:()=>i(!0),children:"New Issue"})}),e.jsx(L,{tabs:S,activeTab:o,onChange:y}),c&&e.jsx($,{variant:"row",count:6}),l&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:l}),!c&&!l&&x.length===0&&e.jsx(E,{icon:e.jsx(B,{size:32}),title:"No issues",description:o==="all"?"Create your first issue to get started.":`No ${o.replace(/_/g," ")} issues.`,action:{label:"New Issue",onClick:()=>i(!0)}}),!c&&!l&&x.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:x.map(t=>e.jsxs(T,{to:`/command-post/issues/${t.id}`,className:"flex items-center gap-3 px-4 py-3 hover:bg-bg-tertiary/50 transition-colors",children:[e.jsx(D,{status:t.status,variant:"dot",size:"sm"}),e.jsx("span",{className:"text-sm text-text flex-1 truncate",children:t.title}),e.jsx("span",{className:`text-xs font-medium uppercase ${_[t.priority]??"text-text-muted"}`,children:t.priority}),t.assigneeAgentId&&e.jsx("span",{className:"text-xs text-text-muted truncate max-w-[100px]",children:t.assigneeAgentId}),e.jsx("span",{className:"text-xs text-text-muted font-mono",children:t.identifier}),e.jsx("span",{className:"text-xs text-text-muted flex-shrink-0",children:R(t.updatedAt)})]},t.id))}),e.jsx(M,{open:v,onClose:()=>i(!1),title:"New Issue",footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",size:"sm",onClick:()=>i(!1),children:"Cancel"}),e.jsx(u,{size:"sm",onClick:N,loading:C,disabled:!n.trim(),children:"Create"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Title"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:"Issue title...",value:n,onChange:t=>h(t.target.value),autoFocus:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Priority"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:p,onChange:t=>b(t.target.value),children:[e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"critical",children:"Critical"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Description"}),e.jsx("textarea",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent min-h-[80px] resize-y",placeholder:"Describe the issue...",value:f,onChange:t=>g(t.target.value)})]})]})})]})}export{ee as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CommandPostHub-BLnNTvBO.js","assets/index-DczEfArU.js","assets/index-DmgXt1oB.css","assets/Input-C7lzcGqx.js","assets/clsx-B-dksMZM.js","assets/Modal-CpcFi-Gm.js","assets/proxy-B72L9I2p.js","assets/InlineEditableField-4ZA-KEfv.js","assets/check-4bqUIREX.js","assets/pencil-CygyIvE1.js","assets/Tooltip-BGe4ZrLD.js","assets/approvalHeadline-DB9SgR-9.js","assets/chevron-right-DhAaVOkv.js","assets/bot-DFsTWhzD.js","assets/pause-9vYiD-5Y.js","assets/dollar-sign-B9t2KmrG.js","assets/git-branch-D7pbvkyu.js","assets/chart-column-BWW8khga.js","assets/clock-D5MlrzQb.js","assets/message-square-C9bK5TAD.js","assets/file-text-C-9as3zm.js","assets/terminal-DD6OAIa2.js","assets/refresh-cw-DyPWslHB.js","assets/circle-stop-BOU58Urf.js","assets/send-BqZ0Qzz-.js","assets/plus-LIrhsu2s.js","assets/trash-2-Co50XYSn.js","assets/CPIssues-C1XUjgdv.js","assets/StatusBadge-BE0SQNPu.js","assets/PageHeader-CPfyiZIM.js","assets/EmptyState-CxJGUl_w.js","assets/Tabs-dEteLxhl.js","assets/SkeletonLoader-DLzSaIMH.js","assets/list-todo-JeleiL5r.js","assets/CPIssueDetail-DD5iL5mT.js","assets/arrow-left-DvmiAV7y.js","assets/CPAgents-DIYCdpQR.js","assets/CPAgentDetail-CR1ciISN.js","assets/circle-check-big-CrrpTfnZ.js","assets/save-Bl0vY0Ur.js","assets/CPApprovals-DAKmaSkN.js","assets/shield-check-DMM8OpD5.js","assets/CPActivity-DjT8p5Dn.js","assets/CPGoals-BtcgDUY5.js","assets/CPRuns-C-gZX28e.js","assets/play-7ImYx-M6.js","assets/CPCosts-CCCh_VY0.js","assets/CPOrg-JyXp44DB.js","assets/network-BjQmrmO8.js","assets/CPFiles-CI252ucO.js","assets/folder-BXotS0h-.js","assets/flask-conical-BJnD20AK.js","assets/search-DLl1kVch.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as t,r as s,q as _,v as e,N as l,_ as o}from"./index-DczEfArU.js";const a=s.lazy(()=>o(()=>import("./CommandPostHub-BLnNTvBO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]))),i=s.lazy(()=>o(()=>import("./CPIssues-C1XUjgdv.js"),__vite__mapDeps([27,1,2,3,4,28,29,12,30,31,5,6,32,25,33]))),r=s.lazy(()=>o(()=>import("./CPIssueDetail-DD5iL5mT.js"),__vite__mapDeps([34,1,2,3,4,28,29,12,32,35,19,24]))),n=s.lazy(()=>o(()=>import("./CPAgents-DIYCdpQR.js"),__vite__mapDeps([36,1,2,3,4,28,29,12,30,32]))),x=s.lazy(()=>o(()=>import("./CPAgentDetail-CR1ciISN.js"),__vite__mapDeps([37,1,2,3,4,28,29,12,30,31,32,35,38,15,18,39]))),m=s.lazy(()=>o(()=>import("./CPApprovals-DAKmaSkN.js"),__vite__mapDeps([40,1,2,3,4,28,29,12,30,31,32,11,41,8]))),j=s.lazy(()=>o(()=>import("./CPActivity-DjT8p5Dn.js"),__vite__mapDeps([42,1,2,3,4,29,12,30,31,32,41,15,13]))),p=s.lazy(()=>o(()=>import("./CPGoals-BtcgDUY5.js"),__vite__mapDeps([43,1,2,3,4,28,29,12,30,5,6,32,25,26]))),u=s.lazy(()=>o(()=>import("./CPRuns-C-gZX28e.js"),__vite__mapDeps([44,1,2,3,4,28,29,12,30,32,45]))),c=s.lazy(()=>o(()=>import("./CPCosts-CCCh_VY0.js"),__vite__mapDeps([46,1,2,3,4,28,29,12,30,5,6,32,25,15,26]))),d=s.lazy(()=>o(()=>import("./CPOrg-JyXp44DB.js"),__vite__mapDeps([47,1,2,3,4,28,29,12,30,32,48,26]))),P=s.lazy(()=>o(()=>import("./CPFiles-CI252ucO.js"),__vite__mapDeps([49,1,2,50,51,52,22,20])));function E(){return t.jsx("div",{className:"flex items-center justify-center h-full text-sm",style:{color:"#c4b49a"},children:"Loading..."})}function h(){return t.jsx("div",{className:"h-full overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(s.Suspense,{fallback:t.jsx(E,{}),children:t.jsxs(_,{children:[t.jsx(e,{index:!0,element:t.jsx(a,{})}),t.jsx(e,{path:"dashboard",element:t.jsx(a,{})}),t.jsx(e,{path:"issues",element:t.jsx(i,{})}),t.jsx(e,{path:"issues/:id",element:t.jsx(r,{})}),t.jsx(e,{path:"agents",element:t.jsx(n,{})}),t.jsx(e,{path:"agents/:id",element:t.jsx(x,{})}),t.jsx(e,{path:"approvals",element:t.jsx(m,{})}),t.jsx(e,{path:"activity",element:t.jsx(j,{})}),t.jsx(e,{path:"goals",element:t.jsx(p,{})}),t.jsx(e,{path:"runs",element:t.jsx(u,{})}),t.jsx(e,{path:"costs",element:t.jsx(c,{})}),t.jsx(e,{path:"org",element:t.jsx(d,{})}),t.jsx(e,{path:"files",element:t.jsx(P,{})}),t.jsx(e,{path:"*",element:t.jsx(l,{to:"/command-post",replace:!0})})]})})})})}export{h as CPLayout,h as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,a0 as u,a1 as b,j as e}from"./index-
|
|
1
|
+
import{r as i,a0 as u,a1 as b,j as e}from"./index-DczEfArU.js";import"./Input-C7lzcGqx.js";import{S as j}from"./StatusBadge-BE0SQNPu.js";import{P as f}from"./PageHeader-CPfyiZIM.js";import{E as v}from"./EmptyState-CxJGUl_w.js";import{S as y}from"./SkeletonLoader-DLzSaIMH.js";import{N}from"./network-BjQmrmO8.js";import{T as C}from"./trash-2-Co50XYSn.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.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
2
|
|
|
3
3
|
This will:
|
|
4
4
|
• Stop the heartbeat runner
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,Y as h,$ as f,j as e}from"./index-
|
|
1
|
+
import{r as a,Y as h,$ as f,j as e}from"./index-DczEfArU.js";import"./Input-C7lzcGqx.js";import{S as j}from"./StatusBadge-BE0SQNPu.js";import{P as g}from"./PageHeader-CPfyiZIM.js";import{E as y}from"./EmptyState-CxJGUl_w.js";import{S as b}from"./SkeletonLoader-DLzSaIMH.js";import{P as N}from"./play-7ImYx-M6.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DhAaVOkv.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,4 +1,4 @@
|
|
|
1
|
-
import{c as v,r as n,bP as A,bQ as M,j as e,i as D,k as L,l as q,bR as _,bS as I,bT as O,bU as z}from"./index-
|
|
1
|
+
import{c as v,r as n,bP as A,bQ as M,j as e,i as D,k as L,l as q,bR as _,bS as I,bT as O,bU as z}from"./index-DczEfArU.js";import{R as b}from"./refresh-cw-DyPWslHB.js";import{S as G}from"./send-BqZ0Qzz-.js";import{L as H}from"./lightbulb-4Yox7P7Z.js";import{C as F}from"./clock-D5MlrzQb.js";import{M as Q}from"./message-square-C9bK5TAD.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|