titan-agent 6.2.0 → 6.2.2

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.
Files changed (157) hide show
  1. package/README.md +4 -4
  2. package/dist/agent/commandPost.js +3 -2
  3. package/dist/agent/commandPost.js.map +1 -1
  4. package/dist/gateway/routes/telephony.js +75 -19
  5. package/dist/gateway/routes/telephony.js.map +1 -1
  6. package/dist/gateway/routes/update.js +100 -0
  7. package/dist/gateway/routes/update.js.map +1 -0
  8. package/dist/gateway/server.js +2 -65
  9. package/dist/gateway/server.js.map +1 -1
  10. package/dist/skills/builtin/phone_call.js +23 -1
  11. package/dist/skills/builtin/phone_call.js.map +1 -1
  12. package/dist/telephony/phonePolicy.js +19 -3
  13. package/dist/telephony/phonePolicy.js.map +1 -1
  14. package/dist/utils/constants.js +1 -1
  15. package/dist/utils/constants.js.map +1 -1
  16. package/package.json +1 -1
  17. package/ui/dist/assets/{AuditPanel-DuxwAH5U.js → AuditPanel-BmFAKA7p.js} +1 -1
  18. package/ui/dist/assets/{AutonomyPanel-VWBgurnv.js → AutonomyPanel-BzuCEsiG.js} +1 -1
  19. package/ui/dist/assets/{AutopilotPanel-Dw8MYOtj.js → AutopilotPanel-DA1vFEl4.js} +1 -1
  20. package/ui/dist/assets/{AutoresearchPanel-CpEX0Zub.js → AutoresearchPanel-BeUCXYtX.js} +1 -1
  21. package/ui/dist/assets/{BackupPanel-n41_6i6x.js → BackupPanel-B6N1pfMT.js} +1 -1
  22. package/ui/dist/assets/{BrowserPanel-DEBTIt6h.js → BrowserPanel-BGHaPi3O.js} +1 -1
  23. package/ui/dist/assets/{CPActivity-em82PTiQ.js → CPActivity-BUSwjFj2.js} +1 -1
  24. package/ui/dist/assets/{CPAgentDetail-Bd8lKqcL.js → CPAgentDetail-DlUEVujH.js} +1 -1
  25. package/ui/dist/assets/{CPAgents-GRBrDd6c.js → CPAgents-CnRmsSMo.js} +1 -1
  26. package/ui/dist/assets/{CPApprovals-DdLaCgJZ.js → CPApprovals-CXdkzebd.js} +1 -1
  27. package/ui/dist/assets/{CPCosts-Cm8Hv9fv.js → CPCosts-CfcyIUZg.js} +1 -1
  28. package/ui/dist/assets/{CPDashboard-Dm9vUKLu.js → CPDashboard-DHlfE1mT.js} +1 -1
  29. package/ui/dist/assets/{CPFiles-DxMn1x2m.js → CPFiles-DyV9vsjE.js} +1 -1
  30. package/ui/dist/assets/{CPGoals-Wr1tCn6y.js → CPGoals-C17G2F0e.js} +1 -1
  31. package/ui/dist/assets/{CPInbox-CGYpK1rG.js → CPInbox-D5A3ja_Q.js} +1 -1
  32. package/ui/dist/assets/{CPIssueDetail-dTU59sgQ.js → CPIssueDetail-CoPv27Ll.js} +1 -1
  33. package/ui/dist/assets/{CPIssues-wgjI2eqS.js → CPIssues-C9EdfW1J.js} +1 -1
  34. package/ui/dist/assets/CPLayout-CHrlktMs.js +2 -0
  35. package/ui/dist/assets/{CPOrg-eT6LNmyy.js → CPOrg-DzoVDLKI.js} +1 -1
  36. package/ui/dist/assets/{CPRuns-B3sdo5g2.js → CPRuns-BHAyFv0K.js} +1 -1
  37. package/ui/dist/assets/{CPSocial-B99Mfee_.js → CPSocial-CjHD8dKM.js} +1 -1
  38. package/ui/dist/assets/{CPVoice-D4J6yFWu.js → CPVoice-aybMotU5.js} +1 -1
  39. package/ui/dist/assets/{ChannelsPanel--lhZqYLD.js → ChannelsPanel-8KfvAEYM.js} +1 -1
  40. package/ui/dist/assets/{CheckpointsPanel-DaOIUcEi.js → CheckpointsPanel-BCyLRLcg.js} +1 -1
  41. package/ui/dist/assets/{CommandPostHub-Pq9lQMW5.js → CommandPostHub-Ce-mWsu2.js} +3 -3
  42. package/ui/dist/assets/{CronPanel-CywjWM7O.js → CronPanel-A9JHvU_O.js} +1 -1
  43. package/ui/dist/assets/{DataTable-Bt0cxehB.js → DataTable-ol6IZMRj.js} +1 -1
  44. package/ui/dist/assets/{DreamPanel-Ct7MuLzD.js → DreamPanel-ZiOF8ybh.js} +1 -1
  45. package/ui/dist/assets/{EmptyState-iLOrbdU7.js → EmptyState-B1i1ZK0x.js} +1 -1
  46. package/ui/dist/assets/{EvalHarnessPanel-7KKDzeXw.js → EvalHarnessPanel-DRGc1zbp.js} +1 -1
  47. package/ui/dist/assets/{EvalPanel-70LzkLDO.js → EvalPanel-B_fiFImG.js} +1 -1
  48. package/ui/dist/assets/{FileViewer-h6A7YYTm.js → FileViewer-D14G6MQq.js} +1 -1
  49. package/ui/dist/assets/{FilesPanel-l8qC6eLD.js → FilesPanel-BIsMoSfg.js} +1 -1
  50. package/ui/dist/assets/{FleetPanel-Z3ResHIb.js → FleetPanel-CSjOOsbX.js} +1 -1
  51. package/ui/dist/assets/{HomelabPanel-9QhrXzo1.js → HomelabPanel-XHMxqiHu.js} +1 -1
  52. package/ui/dist/assets/InfraView-DNYgRXkB.js +2 -0
  53. package/ui/dist/assets/{InlineEditableField-DsVfGRH2.js → InlineEditableField-AOS-LBh_.js} +1 -1
  54. package/ui/dist/assets/{Input-Bzh0-cXU.js → Input-CTK9oH9g.js} +1 -1
  55. package/ui/dist/assets/{IntegrationsPanel-DBOdLYJ8.js → IntegrationsPanel-BKuC_5El.js} +1 -1
  56. package/ui/dist/assets/IntelligenceView-BUKpVpDQ.js +2 -0
  57. package/ui/dist/assets/{LearningPanel-CiSLVxUX.js → LearningPanel-RpDaPvCj.js} +1 -1
  58. package/ui/dist/assets/{LogsPanel-CPAAItsq.js → LogsPanel-9zIJP1Xv.js} +1 -1
  59. package/ui/dist/assets/{McpPanel-MYWE2Zqs.js → McpPanel-CNE7MhDu.js} +1 -1
  60. package/ui/dist/assets/{MemoryGraphPanel-BFr51D_1.js → MemoryGraphPanel-9DEsbOZF.js} +1 -1
  61. package/ui/dist/assets/{MemoryWikiPanel-BA7GUxhg.js → MemoryWikiPanel-CqNen9A6.js} +1 -1
  62. package/ui/dist/assets/{MeshPanel-5BDbwBVR.js → MeshPanel-Bq3pHHIT.js} +1 -1
  63. package/ui/dist/assets/{MissionCanvas-CrDZIQX6.js → MissionCanvas-Ci0hbAF0.js} +1 -1
  64. package/ui/dist/assets/{MissionChat-BDTWMQjj.js → MissionChat-BDqlCplQ.js} +1 -1
  65. package/ui/dist/assets/{MissionLibrary-DEPH2eEu.js → MissionLibrary-9SMdJnfa.js} +1 -1
  66. package/ui/dist/assets/{MissionStart-COLFZLHB.js → MissionStart-Cm7C3kyo.js} +1 -1
  67. package/ui/dist/assets/{Modal-nvni-LGR.js → Modal-B9KCAwCK.js} +1 -1
  68. package/ui/dist/assets/{NvidiaPanel-BCgVrdWt.js → NvidiaPanel-CpGBj1sn.js} +1 -1
  69. package/ui/dist/assets/{OrganismPanel-Cab4MV9i.js → OrganismPanel-DBHyylxC.js} +1 -1
  70. package/ui/dist/assets/{OverviewPanel-isNUxBki.js → OverviewPanel-DII4H_R7.js} +1 -1
  71. package/ui/dist/assets/{PageHeader-BJ1jHtOy.js → PageHeader-Bzb_WXw0.js} +1 -1
  72. package/ui/dist/assets/{PersonaProfilesPanel-BGiDuDPj.js → PersonaProfilesPanel-CXZTZhjo.js} +1 -1
  73. package/ui/dist/assets/{PersonasPanel-4-USk8fm.js → PersonasPanel-BYbD8XiV.js} +1 -1
  74. package/ui/dist/assets/{PhoneDeskPanel-CUz5YVUY.js → PhoneDeskPanel-Bol7fCCN.js} +1 -1
  75. package/ui/dist/assets/{RecipesPanel-DJd6Otdy.js → RecipesPanel-BRbXRcEn.js} +1 -1
  76. package/ui/dist/assets/{SecurityPanel-CKqTnhNY.js → SecurityPanel-BR3BT7Rb.js} +1 -1
  77. package/ui/dist/assets/{SelfImprovePanel-BiCjKpTM.js → SelfImprovePanel-BX9xYBxl.js} +1 -1
  78. package/ui/dist/assets/{SelfProposalsPanel-BQCwEHdF.js → SelfProposalsPanel-BOoDEAYp.js} +1 -1
  79. package/ui/dist/assets/{SessionsPanel-MTMSODP7.js → SessionsPanel-BICnNmn0.js} +1 -1
  80. package/ui/dist/assets/{SessionsTab-CEFFZWMK.js → SessionsTab-X10FeDWA.js} +1 -1
  81. package/ui/dist/assets/{SettingsPanel-CniESkQQ.js → SettingsPanel-MuC32AXw.js} +1 -1
  82. package/ui/dist/assets/SettingsView-Cv9IZqiU.js +2 -0
  83. package/ui/dist/assets/{SkeletonLoader-IpWkLmoy.js → SkeletonLoader-fwI4Z-f0.js} +1 -1
  84. package/ui/dist/assets/{SkillsPanel-CCP-gCR4.js → SkillsPanel-CKFndekU.js} +1 -1
  85. package/ui/dist/assets/{SomaView-BK_thK9H.js → SomaView-Ch7WlmBy.js} +1 -1
  86. package/ui/dist/assets/{StatCard-I0fVw2CH.js → StatCard-Bj2Q_4WS.js} +1 -1
  87. package/ui/dist/assets/{StatusBadge-e3tFf05B.js → StatusBadge-NtdTQ8_L.js} +1 -1
  88. package/ui/dist/assets/{Tabs-vGpPiBzr.js → Tabs-CC9aTVuL.js} +1 -1
  89. package/ui/dist/assets/{TeamsPanel-AFIQBzRK.js → TeamsPanel-DjFcLsdR.js} +1 -1
  90. package/ui/dist/assets/{TelemetryPanel-DKZGVmcp.js → TelemetryPanel-k7gJbZyS.js} +1 -1
  91. package/ui/dist/assets/{TitanCanvas-CqvuuIjd.js → TitanCanvas-MzLkpZhp.js} +25 -25
  92. package/ui/dist/assets/{ToolsView-DnIkrUvP.js → ToolsView-DcxwuM2l.js} +2 -2
  93. package/ui/dist/assets/{Tooltip-DNc5AWi0.js → Tooltip-CFYHfpgQ.js} +1 -1
  94. package/ui/dist/assets/{TraceViewer-MD9YRFVc.js → TraceViewer-BfLO9vwI.js} +1 -1
  95. package/ui/dist/assets/{TrainingPanel-BfXoR7_N.js → TrainingPanel-DUl6qChY.js} +1 -1
  96. package/ui/dist/assets/{VoiceOverlay-Bl81c4yf.js → VoiceOverlay-Dj_cR5_Y.js} +1 -1
  97. package/ui/dist/assets/{VramPanel-Ba8H8Qs2.js → VramPanel-th0_Eo8o.js} +1 -1
  98. package/ui/dist/assets/{WatchView-CoLHPGd7.js → WatchView-DyGhpKbv.js} +1 -1
  99. package/ui/dist/assets/{WorkTab-UppfR_AF.js → WorkTab-BG5VBljJ.js} +1 -1
  100. package/ui/dist/assets/{WorkflowsPanel-CdN7Epxr.js → WorkflowsPanel-C1hVHqAc.js} +1 -1
  101. package/ui/dist/assets/{archive-DWgNklp0.js → archive-C2_hAJXj.js} +1 -1
  102. package/ui/dist/assets/{arrow-left-CW5NV7E0.js → arrow-left-DFCBXvKS.js} +1 -1
  103. package/ui/dist/assets/{book-open-DRI_Y6cW.js → book-open-BgDKDGcH.js} +1 -1
  104. package/ui/dist/assets/{bot-DSGZRM5O.js → bot-C4ICYImG.js} +1 -1
  105. package/ui/dist/assets/{chart-column-D6yK9tts.js → chart-column-BIFJOG_f.js} +1 -1
  106. package/ui/dist/assets/{check-Cxp-6q4k.js → check-CmCL8yzl.js} +1 -1
  107. package/ui/dist/assets/{chevron-right-DkIMxdwH.js → chevron-right-U0Ujye5i.js} +1 -1
  108. package/ui/dist/assets/{chevron-up-BbDu8x1d.js → chevron-up-B6uSBxbj.js} +1 -1
  109. package/ui/dist/assets/{circle-check-big-DnJPBAGU.js → circle-check-big-BFw1nom4.js} +1 -1
  110. package/ui/dist/assets/{circle-stop-DOe0OacY.js → circle-stop-DbtGpdaw.js} +1 -1
  111. package/ui/dist/assets/{clipboard-list-Dj5RQbT8.js → clipboard-list-Dd3_U8cK.js} +1 -1
  112. package/ui/dist/assets/{clock-BS8fh7Rt.js → clock-DpJIc30t.js} +1 -1
  113. package/ui/dist/assets/{dollar-sign-DMXBeaTj.js → dollar-sign-DlrOHVzA.js} +1 -1
  114. package/ui/dist/assets/{download-BykARpbG.js → download-CZ5kTONh.js} +1 -1
  115. package/ui/dist/assets/{external-link-BfXhMi9L.js → external-link-CX-GvMky.js} +1 -1
  116. package/ui/dist/assets/{file-text-CUkSytWL.js → file-text-BtTsNJbB.js} +1 -1
  117. package/ui/dist/assets/{flask-conical-BS4cuENu.js → flask-conical-BaPYppKH.js} +1 -1
  118. package/ui/dist/assets/{folder-BDwoUobN.js → folder-BOnpha2-.js} +1 -1
  119. package/ui/dist/assets/{funnel-xr6Dd1ub.js → funnel-DaNi6kwp.js} +1 -1
  120. package/ui/dist/assets/{git-branch-C0Qk52W8.js → git-branch-gs6g9dSe.js} +1 -1
  121. package/ui/dist/assets/{index-CmaGnHzR.js → index-Dbv5oKsp.js} +2 -2
  122. package/ui/dist/assets/{layers-DPHYdeRk.js → layers-BKZz8iD1.js} +1 -1
  123. package/ui/dist/assets/{legacy-DzagVk5C.js → legacy-DbwFsW2A.js} +1 -1
  124. package/ui/dist/assets/{lightbulb-Bj6cj6Xl.js → lightbulb-DX6YLtPe.js} +1 -1
  125. package/ui/dist/assets/{list-todo-Cm4jNFHV.js → list-todo-qdMNm4-Q.js} +1 -1
  126. package/ui/dist/assets/{message-square-BrWLAovN.js → message-square-Cwo5FOho.js} +1 -1
  127. package/ui/dist/assets/{mic-BXNK4d7X.js → mic-BzvwK4IS.js} +1 -1
  128. package/ui/dist/assets/{missions-DEjMYSre.js → missions-CYlXuJED.js} +1 -1
  129. package/ui/dist/assets/{network-CrQn1GKv.js → network-Dt-RBtO_.js} +1 -1
  130. package/ui/dist/assets/{pause-DS5xgDMT.js → pause-Do3XNLtx.js} +1 -1
  131. package/ui/dist/assets/{pencil-DAI6FtFQ.js → pencil-DAGs9RFs.js} +1 -1
  132. package/ui/dist/assets/{play-DxBy837b.js → play-CNElkzEq.js} +1 -1
  133. package/ui/dist/assets/{plug-D0Bstfm0.js → plug-DCgrVnB8.js} +1 -1
  134. package/ui/dist/assets/{plus-DxgNIt8h.js → plus-BnsXhqXc.js} +1 -1
  135. package/ui/dist/assets/{proxy-KYomRnLW.js → proxy-BXHdgwrk.js} +1 -1
  136. package/ui/dist/assets/{radio-2vniRFTO.js → radio-BPz7sHXW.js} +1 -1
  137. package/ui/dist/assets/{refresh-cw-BFBnnWj8.js → refresh-cw-Cs4oDMNE.js} +1 -1
  138. package/ui/dist/assets/{rotate-ccw-B9wWlKRc.js → rotate-ccw-DSpsA3Wr.js} +1 -1
  139. package/ui/dist/assets/{save--wCYre_u.js → save-BhGg2pZh.js} +1 -1
  140. package/ui/dist/assets/{search-DOD1aOm8.js → search-BtxlIgqN.js} +1 -1
  141. package/ui/dist/assets/{send-Bb57UxT7.js → send-BzKTXI3q.js} +1 -1
  142. package/ui/dist/assets/{server-CBsCfofY.js → server-B1gIgixS.js} +1 -1
  143. package/ui/dist/assets/{shield-check-B24N03VU.js → shield-check-C39B-Wi3.js} +1 -1
  144. package/ui/dist/assets/{terminal-CZ77Swtc.js → terminal-CubaeYlJ.js} +1 -1
  145. package/ui/dist/assets/{test-tube-CkkvIu5j.js → test-tube-CYYLfFIz.js} +1 -1
  146. package/ui/dist/assets/{toggle-right-DgphAedS.js → toggle-right-BQ3iDgLG.js} +1 -1
  147. package/ui/dist/assets/{trash-2-C5KNXS-O.js → trash-2-CSxfLiVB.js} +1 -1
  148. package/ui/dist/assets/{trending-up-B3H8xrGD.js → trending-up-DXxKT18Q.js} +1 -1
  149. package/ui/dist/assets/{trophy-C-xSgHD2.js → trophy-osEOm2Vi.js} +1 -1
  150. package/ui/dist/assets/{volume-2-BXwRjeve.js → volume-2-C1OkTurz.js} +1 -1
  151. package/ui/dist/assets/{wifi-off-DOm__Zn6.js → wifi-off-DAhvsjnD.js} +1 -1
  152. package/ui/dist/index.html +1 -1
  153. package/ui/dist/sw.js +1 -1
  154. package/ui/dist/assets/CPLayout-CBtGEYSs.js +0 -2
  155. package/ui/dist/assets/InfraView-G1q6vF0Q.js +0 -2
  156. package/ui/dist/assets/IntelligenceView-J8Nbh4zs.js +0 -2
  157. package/ui/dist/assets/SettingsView-2AwXqlvc.js +0 -2
@@ -1 +1 @@
1
- import{r as i,j as e,b as f,X as j}from"./index-CmaGnHzR.js";import{F as N}from"./folder-BDwoUobN.js";import{F as y}from"./flask-conical-BS4cuENu.js";import{S as v}from"./search-DOD1aOm8.js";import{R as p}from"./refresh-cw-BFBnnWj8.js";import{F as w}from"./file-text-CUkSytWL.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
+ import{r as i,j as e,b as f,X as j}from"./index-Dbv5oKsp.js";import{F as N}from"./folder-BOnpha2-.js";import{F as y}from"./flask-conical-BaPYppKH.js";import{S as v}from"./search-BtxlIgqN.js";import{R as p}from"./refresh-cw-Cs4oDMNE.js";import{F as w}from"./file-text-BtTsNJbB.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-CmaGnHzR.js";import{B as j}from"./Input-Bzh0-cXU.js";import{S as T}from"./StatusBadge-e3tFf05B.js";import{P as O}from"./PageHeader-BJ1jHtOy.js";import{E as A}from"./EmptyState-iLOrbdU7.js";import{M as F}from"./Modal-nvni-LGR.js";import{S as L}from"./SkeletonLoader-IpWkLmoy.js";import{P as B}from"./plus-DxgNIt8h.js";import{C as I}from"./chevron-right-DkIMxdwH.js";import{T as U}from"./trash-2-C5KNXS-O.js";import"./clsx-B-dksMZM.js";import"./proxy-KYomRnLW.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
+ import{r as i,Q as D,j as e,T as N,V as $,X as M,b as y}from"./index-Dbv5oKsp.js";import{B as j}from"./Input-CTK9oH9g.js";import{S as T}from"./StatusBadge-NtdTQ8_L.js";import{P as O}from"./PageHeader-Bzb_WXw0.js";import{E as A}from"./EmptyState-B1i1ZK0x.js";import{M as F}from"./Modal-B9KCAwCK.js";import{S as L}from"./SkeletonLoader-fwI4Z-f0.js";import{P as B}from"./plus-BnsXhqXc.js";import{C as I}from"./chevron-right-U0Ujye5i.js";import{T as U}from"./trash-2-CSxfLiVB.js";import"./clsx-B-dksMZM.js";import"./proxy-BXHdgwrk.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-CmaGnHzR.js";import{B as m}from"./Input-Bzh0-cXU.js";import{P as ce}from"./PageHeader-BJ1jHtOy.js";import{E as xe}from"./EmptyState-iLOrbdU7.js";import{T as ue}from"./Tabs-vGpPiBzr.js";import{S as pe}from"./SkeletonLoader-IpWkLmoy.js";import{e as he}from"./approvalHeadline-DB9SgR-9.js";import{M as U}from"./message-square-BrWLAovN.js";import{B as q}from"./bot-DSGZRM5O.js";import{C}from"./clock-BS8fh7Rt.js";import{S as me}from"./send-Bb57UxT7.js";import{S as ge}from"./shield-check-B24N03VU.js";import{C as D}from"./check-Cxp-6q4k.js";import{F as fe}from"./funnel-xr6Dd1ub.js";import{C as be}from"./chevron-up-BbDu8x1d.js";import{R as ve}from"./rotate-ccw-B9wWlKRc.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DkIMxdwH.js";/**
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-Dbv5oKsp.js";import{B as m}from"./Input-CTK9oH9g.js";import{P as ce}from"./PageHeader-Bzb_WXw0.js";import{E as xe}from"./EmptyState-B1i1ZK0x.js";import{T as ue}from"./Tabs-CC9aTVuL.js";import{S as pe}from"./SkeletonLoader-fwI4Z-f0.js";import{e as he}from"./approvalHeadline-DB9SgR-9.js";import{M as U}from"./message-square-Cwo5FOho.js";import{B as q}from"./bot-C4ICYImG.js";import{C}from"./clock-DpJIc30t.js";import{S as me}from"./send-BzKTXI3q.js";import{S as ge}from"./shield-check-C39B-Wi3.js";import{C as D}from"./check-CmCL8yzl.js";import{F as fe}from"./funnel-DaNi6kwp.js";import{C as be}from"./chevron-up-B6uSBxbj.js";import{R as ve}from"./rotate-ccw-DSpsA3Wr.js";import"./clsx-B-dksMZM.js";import"./chevron-right-U0Ujye5i.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-CmaGnHzR.js";import{B as c}from"./Input-Bzh0-cXU.js";import{S as O}from"./StatusBadge-e3tFf05B.js";import{P as h}from"./PageHeader-BJ1jHtOy.js";import{S as U}from"./SkeletonLoader-IpWkLmoy.js";import{A as R}from"./arrow-left-CW5NV7E0.js";import{M as _}from"./message-square-BrWLAovN.js";import{S as F}from"./send-Bb57UxT7.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DkIMxdwH.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
+ 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-Dbv5oKsp.js";import{B as c}from"./Input-CTK9oH9g.js";import{S as O}from"./StatusBadge-NtdTQ8_L.js";import{P as h}from"./PageHeader-Bzb_WXw0.js";import{S as U}from"./SkeletonLoader-fwI4Z-f0.js";import{A as R}from"./arrow-left-DFCBXvKS.js";import{M as _}from"./message-square-Cwo5FOho.js";import{S as F}from"./send-BzKTXI3q.js";import"./clsx-B-dksMZM.js";import"./chevron-right-U0Ujye5i.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-CmaGnHzR.js";import{B as u}from"./Input-Bzh0-cXU.js";import{S as D}from"./StatusBadge-e3tFf05B.js";import{P as z}from"./PageHeader-BJ1jHtOy.js";import{E}from"./EmptyState-iLOrbdU7.js";import{T as L}from"./Tabs-vGpPiBzr.js";import{M}from"./Modal-nvni-LGR.js";import{S as $}from"./SkeletonLoader-IpWkLmoy.js";import{P as A}from"./plus-DxgNIt8h.js";import{L as B}from"./list-todo-Cm4jNFHV.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DkIMxdwH.js";import"./proxy-KYomRnLW.js";function R(a){const r=Math.floor((Date.now()-new Date(a).getTime())/1e3);return r<60?`${r}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}const _={critical:"text-error",high:"text-warning",medium:"text-accent",low:"text-text-muted"},F=[{id:"all",label:"All"},{id:"backlog",label:"Backlog"},{id:"todo",label:"Todo"},{id:"in_progress",label:"In Progress"},{id:"in_review",label:"In Review"},{id:"done",label:"Done"},{id:"blocked",label:"Blocked"}];function ee(){const[a,r]=s.useState([]),[c,w]=s.useState(!0),[l,m]=s.useState(null),[o,y]=s.useState("all"),[v,i]=s.useState(!1),[n,h]=s.useState(""),[p,b]=s.useState("medium"),[f,g]=s.useState(""),[C,j]=s.useState(!1),d=s.useCallback(async()=>{try{const t=await k();r(t),m(null)}catch(t){m(t instanceof Error?t.message:"Failed to load issues")}w(!1)},[]);s.useEffect(()=>{d()},[d]);const N=async()=>{if(n.trim()){j(!0);try{await P({title:n,description:f,priority:p}),i(!1),h(""),g(""),b("medium"),await d()}catch{}j(!1)}},x=o==="all"?a:a.filter(t=>t.status===o),S=F.map(t=>({...t,count:t.id==="all"?a.length:a.filter(I=>I.status===t.id).length}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx(z,{title:"Issues",breadcrumbs:[{label:"Command Post"},{label:"Issues"}],actions:e.jsx(u,{size:"sm",icon:e.jsx(A,{size:14}),onClick:()=>i(!0),children:"New Issue"})}),e.jsx(L,{tabs:S,activeTab:o,onChange:y}),c&&e.jsx($,{variant:"row",count:6}),l&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:l}),!c&&!l&&x.length===0&&e.jsx(E,{icon:e.jsx(B,{size:32}),title:"No issues",description:o==="all"?"Create your first issue to get started.":`No ${o.replace(/_/g," ")} issues.`,action:{label:"New Issue",onClick:()=>i(!0)}}),!c&&!l&&x.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:x.map(t=>e.jsxs(T,{to:`/command-post/issues/${t.id}`,className:"flex items-center gap-3 px-4 py-3 hover:bg-bg-tertiary/50 transition-colors",children:[e.jsx(D,{status:t.status,variant:"dot",size:"sm"}),e.jsx("span",{className:"text-sm text-text flex-1 truncate",children:t.title}),e.jsx("span",{className:`text-xs font-medium uppercase ${_[t.priority]??"text-text-muted"}`,children:t.priority}),t.assigneeAgentId&&e.jsx("span",{className:"text-xs text-text-muted truncate max-w-[100px]",children:t.assigneeAgentId}),e.jsx("span",{className:"text-xs text-text-muted font-mono",children:t.identifier}),e.jsx("span",{className:"text-xs text-text-muted flex-shrink-0",children:R(t.updatedAt)})]},t.id))}),e.jsx(M,{open:v,onClose:()=>i(!1),title:"New Issue",footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",size:"sm",onClick:()=>i(!1),children:"Cancel"}),e.jsx(u,{size:"sm",onClick:N,loading:C,disabled:!n.trim(),children:"Create"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Title"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:"Issue title...",value:n,onChange:t=>h(t.target.value),autoFocus:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Priority"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:p,onChange:t=>b(t.target.value),children:[e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"critical",children:"Critical"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Description"}),e.jsx("textarea",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent min-h-[80px] resize-y",placeholder:"Describe the issue...",value:f,onChange:t=>g(t.target.value)})]})]})})]})}export{ee as default};
1
+ import{r as s,y as k,j as e,D as T,F as P}from"./index-Dbv5oKsp.js";import{B as u}from"./Input-CTK9oH9g.js";import{S as D}from"./StatusBadge-NtdTQ8_L.js";import{P as z}from"./PageHeader-Bzb_WXw0.js";import{E}from"./EmptyState-B1i1ZK0x.js";import{T as L}from"./Tabs-CC9aTVuL.js";import{M}from"./Modal-B9KCAwCK.js";import{S as $}from"./SkeletonLoader-fwI4Z-f0.js";import{P as A}from"./plus-BnsXhqXc.js";import{L as B}from"./list-todo-qdMNm4-Q.js";import"./clsx-B-dksMZM.js";import"./chevron-right-U0Ujye5i.js";import"./proxy-BXHdgwrk.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-Ce-mWsu2.js","assets/index-Dbv5oKsp.js","assets/index-OZm1iJy9.css","assets/Input-CTK9oH9g.js","assets/clsx-B-dksMZM.js","assets/Modal-B9KCAwCK.js","assets/proxy-BXHdgwrk.js","assets/InlineEditableField-AOS-LBh_.js","assets/check-CmCL8yzl.js","assets/pencil-DAGs9RFs.js","assets/Tooltip-CFYHfpgQ.js","assets/approvalHeadline-DB9SgR-9.js","assets/chevron-right-U0Ujye5i.js","assets/bot-C4ICYImG.js","assets/pause-Do3XNLtx.js","assets/dollar-sign-DlrOHVzA.js","assets/git-branch-gs6g9dSe.js","assets/chart-column-BIFJOG_f.js","assets/clock-DpJIc30t.js","assets/message-square-Cwo5FOho.js","assets/file-text-BtTsNJbB.js","assets/terminal-CubaeYlJ.js","assets/refresh-cw-Cs4oDMNE.js","assets/circle-stop-DbtGpdaw.js","assets/send-BzKTXI3q.js","assets/plus-BnsXhqXc.js","assets/trash-2-CSxfLiVB.js","assets/CPIssues-C9EdfW1J.js","assets/StatusBadge-NtdTQ8_L.js","assets/PageHeader-Bzb_WXw0.js","assets/EmptyState-B1i1ZK0x.js","assets/Tabs-CC9aTVuL.js","assets/SkeletonLoader-fwI4Z-f0.js","assets/list-todo-qdMNm4-Q.js","assets/CPIssueDetail-CoPv27Ll.js","assets/arrow-left-DFCBXvKS.js","assets/CPAgents-CnRmsSMo.js","assets/CPAgentDetail-DlUEVujH.js","assets/circle-check-big-BFw1nom4.js","assets/save-BhGg2pZh.js","assets/CPApprovals-CXdkzebd.js","assets/shield-check-C39B-Wi3.js","assets/CPActivity-BUSwjFj2.js","assets/CPGoals-C17G2F0e.js","assets/CPRuns-BHAyFv0K.js","assets/play-CNElkzEq.js","assets/CPCosts-CfcyIUZg.js","assets/CPOrg-DzoVDLKI.js","assets/network-Dt-RBtO_.js","assets/CPFiles-DyV9vsjE.js","assets/folder-BOnpha2-.js","assets/flask-conical-BaPYppKH.js","assets/search-BtxlIgqN.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-Dbv5oKsp.js";const a=s.lazy(()=>o(()=>import("./CommandPostHub-Ce-mWsu2.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-C9EdfW1J.js"),__vite__mapDeps([27,1,2,3,4,28,29,12,30,31,5,6,32,25,33]))),r=s.lazy(()=>o(()=>import("./CPIssueDetail-CoPv27Ll.js"),__vite__mapDeps([34,1,2,3,4,28,29,12,32,35,19,24]))),n=s.lazy(()=>o(()=>import("./CPAgents-CnRmsSMo.js"),__vite__mapDeps([36,1,2,3,4,28,29,12,30,32]))),x=s.lazy(()=>o(()=>import("./CPAgentDetail-DlUEVujH.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-CXdkzebd.js"),__vite__mapDeps([40,1,2,3,4,28,29,12,30,31,32,11,41,8]))),j=s.lazy(()=>o(()=>import("./CPActivity-BUSwjFj2.js"),__vite__mapDeps([42,1,2,3,4,29,12,30,31,32,41,15,13]))),p=s.lazy(()=>o(()=>import("./CPGoals-C17G2F0e.js"),__vite__mapDeps([43,1,2,3,4,28,29,12,30,5,6,32,25,26]))),u=s.lazy(()=>o(()=>import("./CPRuns-BHAyFv0K.js"),__vite__mapDeps([44,1,2,3,4,28,29,12,30,32,45]))),c=s.lazy(()=>o(()=>import("./CPCosts-CfcyIUZg.js"),__vite__mapDeps([46,1,2,3,4,28,29,12,30,5,6,32,25,15,26]))),d=s.lazy(()=>o(()=>import("./CPOrg-DzoVDLKI.js"),__vite__mapDeps([47,1,2,3,4,28,29,12,30,32,48,26]))),P=s.lazy(()=>o(()=>import("./CPFiles-DyV9vsjE.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-CmaGnHzR.js";import"./Input-Bzh0-cXU.js";import{S as j}from"./StatusBadge-e3tFf05B.js";import{P as f}from"./PageHeader-BJ1jHtOy.js";import{E as v}from"./EmptyState-iLOrbdU7.js";import{S as y}from"./SkeletonLoader-IpWkLmoy.js";import{N}from"./network-CrQn1GKv.js";import{T as C}from"./trash-2-C5KNXS-O.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DkIMxdwH.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}"?
1
+ import{r as i,a0 as u,a1 as b,j as e}from"./index-Dbv5oKsp.js";import"./Input-CTK9oH9g.js";import{S as j}from"./StatusBadge-NtdTQ8_L.js";import{P as f}from"./PageHeader-Bzb_WXw0.js";import{E as v}from"./EmptyState-B1i1ZK0x.js";import{S as y}from"./SkeletonLoader-fwI4Z-f0.js";import{N}from"./network-Dt-RBtO_.js";import{T as C}from"./trash-2-CSxfLiVB.js";import"./clsx-B-dksMZM.js";import"./chevron-right-U0Ujye5i.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-CmaGnHzR.js";import"./Input-Bzh0-cXU.js";import{S as j}from"./StatusBadge-e3tFf05B.js";import{P as g}from"./PageHeader-BJ1jHtOy.js";import{E as y}from"./EmptyState-iLOrbdU7.js";import{S as b}from"./SkeletonLoader-IpWkLmoy.js";import{P as N}from"./play-DxBy837b.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DkIMxdwH.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
+ import{r as a,Y as h,$ as f,j as e}from"./index-Dbv5oKsp.js";import"./Input-CTK9oH9g.js";import{S as j}from"./StatusBadge-NtdTQ8_L.js";import{P as g}from"./PageHeader-Bzb_WXw0.js";import{E as y}from"./EmptyState-B1i1ZK0x.js";import{S as b}from"./SkeletonLoader-fwI4Z-f0.js";import{P as N}from"./play-CNElkzEq.js";import"./clsx-B-dksMZM.js";import"./chevron-right-U0Ujye5i.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-CmaGnHzR.js";import{R as b}from"./refresh-cw-BFBnnWj8.js";import{S as G}from"./send-Bb57UxT7.js";import{L as H}from"./lightbulb-Bj6cj6Xl.js";import{C as F}from"./clock-BS8fh7Rt.js";import{M as Q}from"./message-square-BrWLAovN.js";/**
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-Dbv5oKsp.js";import{R as b}from"./refresh-cw-Cs4oDMNE.js";import{S as G}from"./send-BzKTXI3q.js";import{L as H}from"./lightbulb-DX6YLtPe.js";import{C as F}from"./clock-DpJIc30t.js";import{M as Q}from"./message-square-Cwo5FOho.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 i,j as t,b as N}from"./index-CmaGnHzR.js";import"./Input-Bzh0-cXU.js";import{P as k}from"./PageHeader-BJ1jHtOy.js";import{C as S}from"./circle-stop-DOe0OacY.js";import{M as C}from"./mic-BXNK4d7X.js";import{V as b}from"./volume-2-BXwRjeve.js";import{S as T}from"./send-Bb57UxT7.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DkIMxdwH.js";async function R(o,l){const c=await N(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!c.ok)throw new Error(`HTTP ${c.status}`);return c.json()}function I(){const[o,l]=i.useState(""),[c,u]=i.useState([]),[h,d]=i.useState(!1),[p,j]=i.useState(!0),m=i.useRef(null),a=i.useRef(null);i.useEffect(()=>{const e=window.SpeechRecognition||window.webkitSpeechRecognition;if(e){const s=new e;s.lang="en-US",s.continuous=!1,s.interimResults=!1,s.onresult=r=>{var n,g;const x=((g=(n=r.results[0])==null?void 0:n[0])==null?void 0:g.transcript)||"";l(x),d(!1)},s.onerror=()=>d(!1),s.onend=()=>d(!1),m.current=s}},[]);const f=async()=>{const e=o.trim();if(!e)return;const s={id:`e-${Date.now()}`,question:e,loading:!0,at:new Date().toISOString()};u(r=>[s,...r].slice(0,20)),l("");try{const r=await R("/api/voice/ask",{question:e,voice:"default",speak:p});u(x=>x.map(n=>n.id===s.id?{...n,loading:!1,answer:r.answer,activeDrivers:r.activeDrivers,ttsUrl:r.ttsUrl}:n)),r.ttsUrl&&p&&a.current&&(a.current.src=r.ttsUrl,a.current.play().catch(()=>{}))}catch(r){u(x=>x.map(n=>n.id===s.id?{...n,loading:!1,error:r.message}:n))}},v=()=>{const e=m.current;if(!e){alert("Speech recognition not supported in this browser. Use Chrome.");return}try{e.start(),d(!0)}catch{}},w=()=>{const e=m.current;e&&e.stop(),d(!1)},y=!!(window.SpeechRecognition||window.webkitSpeechRecognition);return t.jsxs("div",{className:"space-y-4 flex flex-col h-[calc(100vh-180px)]",children:[t.jsx(k,{title:"Voice Ask",breadcrumbs:[{label:"Command Post"},{label:"Voice"}]}),t.jsx("audio",{ref:a}),t.jsxs("div",{className:"flex items-center gap-2 bg-bg-secondary border border-border rounded-xl px-3 py-2",children:[y&&(h?t.jsx("button",{onClick:w,className:"p-2 rounded bg-error/20 text-error hover:bg-error/30",title:"Stop listening",children:t.jsx(S,{size:18})}):t.jsx("button",{onClick:v,className:"p-2 rounded hover:bg-bg-tertiary text-text-muted",title:"Voice input (Chrome only)",children:t.jsx(C,{size:18})})),t.jsx("input",{value:o,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),f())},placeholder:h?"Listening…":'Ask TITAN — "What are you working on?" or give it instructions',className:"flex-1 bg-transparent text-sm outline-none"}),t.jsx("button",{onClick:()=>j(e=>!e),className:`p-2 rounded hover:bg-bg-tertiary ${p?"text-accent":"text-text-muted"}`,title:`TTS ${p?"ON":"OFF"}`,children:t.jsx(b,{size:16})}),t.jsxs("button",{onClick:f,disabled:!o.trim(),className:"px-3 py-1.5 rounded bg-accent/20 border border-accent/40 text-accent text-sm hover:bg-accent/30 disabled:opacity-50 flex items-center gap-1",children:[t.jsx(T,{size:14})," Ask"]})]}),t.jsxs("div",{className:"flex-1 overflow-auto space-y-3",children:[c.length===0&&t.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:'Ask a question to start. TITAN has driver-aware chat, so "what are you doing?" gets a real answer.'}),c.map(e=>t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-xs text-text-muted mt-1 flex-shrink-0 w-10",children:"You"}),t.jsx("div",{className:"text-sm text-text",children:e.question})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-xs text-accent mt-1 flex-shrink-0 w-10",children:"TITAN"}),t.jsxs("div",{className:"text-sm text-text-secondary flex-1",children:[e.loading&&t.jsx("span",{className:"text-text-muted",children:"thinking…"}),e.error&&t.jsxs("span",{className:"text-error",children:["error: ",e.error]}),e.answer&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"whitespace-pre-wrap",children:e.answer}),t.jsxs("div",{className:"text-[11px] text-text-muted flex items-center gap-2",children:[t.jsxs("span",{children:["drivers: ",e.activeDrivers??"?"]}),e.ttsUrl&&t.jsxs("button",{onClick:()=>{a.current&&(a.current.src=e.ttsUrl,a.current.play().catch(()=>{}))},className:"text-accent hover:underline flex items-center gap-0.5",children:[t.jsx(b,{size:10})," play"]})]})]})]})]})]},e.id))]})]})}export{I as default};
1
+ import{r as i,j as t,b as N}from"./index-Dbv5oKsp.js";import"./Input-CTK9oH9g.js";import{P as k}from"./PageHeader-Bzb_WXw0.js";import{C as S}from"./circle-stop-DbtGpdaw.js";import{M as C}from"./mic-BzvwK4IS.js";import{V as b}from"./volume-2-C1OkTurz.js";import{S as T}from"./send-BzKTXI3q.js";import"./clsx-B-dksMZM.js";import"./chevron-right-U0Ujye5i.js";async function R(o,l){const c=await N(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!c.ok)throw new Error(`HTTP ${c.status}`);return c.json()}function I(){const[o,l]=i.useState(""),[c,u]=i.useState([]),[h,d]=i.useState(!1),[p,j]=i.useState(!0),m=i.useRef(null),a=i.useRef(null);i.useEffect(()=>{const e=window.SpeechRecognition||window.webkitSpeechRecognition;if(e){const s=new e;s.lang="en-US",s.continuous=!1,s.interimResults=!1,s.onresult=r=>{var n,g;const x=((g=(n=r.results[0])==null?void 0:n[0])==null?void 0:g.transcript)||"";l(x),d(!1)},s.onerror=()=>d(!1),s.onend=()=>d(!1),m.current=s}},[]);const f=async()=>{const e=o.trim();if(!e)return;const s={id:`e-${Date.now()}`,question:e,loading:!0,at:new Date().toISOString()};u(r=>[s,...r].slice(0,20)),l("");try{const r=await R("/api/voice/ask",{question:e,voice:"default",speak:p});u(x=>x.map(n=>n.id===s.id?{...n,loading:!1,answer:r.answer,activeDrivers:r.activeDrivers,ttsUrl:r.ttsUrl}:n)),r.ttsUrl&&p&&a.current&&(a.current.src=r.ttsUrl,a.current.play().catch(()=>{}))}catch(r){u(x=>x.map(n=>n.id===s.id?{...n,loading:!1,error:r.message}:n))}},v=()=>{const e=m.current;if(!e){alert("Speech recognition not supported in this browser. Use Chrome.");return}try{e.start(),d(!0)}catch{}},w=()=>{const e=m.current;e&&e.stop(),d(!1)},y=!!(window.SpeechRecognition||window.webkitSpeechRecognition);return t.jsxs("div",{className:"space-y-4 flex flex-col h-[calc(100vh-180px)]",children:[t.jsx(k,{title:"Voice Ask",breadcrumbs:[{label:"Command Post"},{label:"Voice"}]}),t.jsx("audio",{ref:a}),t.jsxs("div",{className:"flex items-center gap-2 bg-bg-secondary border border-border rounded-xl px-3 py-2",children:[y&&(h?t.jsx("button",{onClick:w,className:"p-2 rounded bg-error/20 text-error hover:bg-error/30",title:"Stop listening",children:t.jsx(S,{size:18})}):t.jsx("button",{onClick:v,className:"p-2 rounded hover:bg-bg-tertiary text-text-muted",title:"Voice input (Chrome only)",children:t.jsx(C,{size:18})})),t.jsx("input",{value:o,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),f())},placeholder:h?"Listening…":'Ask TITAN — "What are you working on?" or give it instructions',className:"flex-1 bg-transparent text-sm outline-none"}),t.jsx("button",{onClick:()=>j(e=>!e),className:`p-2 rounded hover:bg-bg-tertiary ${p?"text-accent":"text-text-muted"}`,title:`TTS ${p?"ON":"OFF"}`,children:t.jsx(b,{size:16})}),t.jsxs("button",{onClick:f,disabled:!o.trim(),className:"px-3 py-1.5 rounded bg-accent/20 border border-accent/40 text-accent text-sm hover:bg-accent/30 disabled:opacity-50 flex items-center gap-1",children:[t.jsx(T,{size:14})," Ask"]})]}),t.jsxs("div",{className:"flex-1 overflow-auto space-y-3",children:[c.length===0&&t.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:'Ask a question to start. TITAN has driver-aware chat, so "what are you doing?" gets a real answer.'}),c.map(e=>t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-xs text-text-muted mt-1 flex-shrink-0 w-10",children:"You"}),t.jsx("div",{className:"text-sm text-text",children:e.question})]}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-xs text-accent mt-1 flex-shrink-0 w-10",children:"TITAN"}),t.jsxs("div",{className:"text-sm text-text-secondary flex-1",children:[e.loading&&t.jsx("span",{className:"text-text-muted",children:"thinking…"}),e.error&&t.jsxs("span",{className:"text-error",children:["error: ",e.error]}),e.answer&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"whitespace-pre-wrap",children:e.answer}),t.jsxs("div",{className:"text-[11px] text-text-muted flex items-center gap-2",children:[t.jsxs("span",{children:["drivers: ",e.activeDrivers??"?"]}),e.ttsUrl&&t.jsxs("button",{onClick:()=>{a.current&&(a.current.src=e.ttsUrl,a.current.play().catch(()=>{}))},className:"text-accent hover:underline flex items-center gap-0.5",children:[t.jsx(b,{size:10})," play"]})]})]})]})]})]},e.id))]})]})}export{I as default};
@@ -1 +1 @@
1
- import{r as a,j as e,i as $,ao as E,ap as D,V as F,an as K,E as I,aq as R}from"./index-CmaGnHzR.js";import{P as O}from"./PageHeader-BJ1jHtOy.js";import{R as W}from"./refresh-cw-BFBnnWj8.js";import{C as _}from"./circle-check-big-DnJPBAGU.js";import{C as G}from"./chevron-right-DkIMxdwH.js";import{S as H}from"./save--wCYre_u.js";const L=[{id:"discord",label:"Discord",description:"Discord bot via discord.js",fields:[{key:"token",label:"Bot Token",placeholder:"Bot token from Discord Developer Portal"}]},{id:"telegram",label:"Telegram",description:"Telegram bot via Grammy",fields:[{key:"token",label:"Bot Token",placeholder:"Token from @BotFather"}]},{id:"slack",label:"Slack",description:"Slack workspace via Bolt SDK",fields:[{key:"token",label:"Bot Token",placeholder:"xoxb-..."},{key:"apiKey",label:"Signing Secret",placeholder:"Signing secret from Slack app settings"}]},{id:"whatsapp",label:"WhatsApp",description:"WhatsApp via Twilio",fields:[{key:"token",label:"Auth Token",placeholder:"Twilio auth token"},{key:"apiKey",label:"Account SID",placeholder:"Twilio account SID"}]},{id:"googlechat",label:"Google Chat",description:"Google Chat spaces",fields:[{key:"token",label:"Service Account Key",placeholder:"JSON key path or content"}]},{id:"matrix",label:"Matrix",description:"Matrix protocol (Element, etc.)",fields:[{key:"token",label:"Access Token",placeholder:"Matrix access token"}]},{id:"signal",label:"Signal",description:"Signal messenger",fields:[{key:"token",label:"API Token",placeholder:"Signal API token"}]},{id:"msteams",label:"Microsoft Teams",description:"MS Teams via Bot Framework",fields:[{key:"token",label:"App Password",placeholder:"Bot framework app password"},{key:"apiKey",label:"App ID",placeholder:"Bot framework app ID"}]},{id:"irc",label:"IRC",description:"Internet Relay Chat",fields:[{key:"token",label:"Password",placeholder:"NickServ password (optional)"}]},{id:"mattermost",label:"Mattermost",description:"Self-hosted team chat",fields:[{key:"token",label:"Bot Token",placeholder:"Mattermost bot access token"}]},{id:"lark",label:"Lark",description:"Lark/Feishu messaging",fields:[{key:"token",label:"App Token",placeholder:"Lark app token"},{key:"apiKey",label:"App Secret",placeholder:"Lark app secret"}]},{id:"email_inbound",label:"Email (Inbound)",description:"IMAP email webhook",fields:[{key:"token",label:"IMAP Password",placeholder:"IMAP password or app password"}]},{id:"line",label:"LINE",description:"LINE messaging platform",fields:[{key:"token",label:"Channel Access Token",placeholder:"LINE channel access token"},{key:"apiKey",label:"Channel Secret",placeholder:"LINE channel secret"}]},{id:"zulip",label:"Zulip",description:"Zulip team chat",fields:[{key:"apiKey",label:"API Key",placeholder:"Zulip API key"}]}],Z=[{value:"pairing",label:"Pairing",desc:"User must pair first"},{value:"open",label:"Open",desc:"Anyone can DM"},{value:"closed",label:"Closed",desc:"DMs disabled"}];function q({def:l,config:o,status:b,onSave:f,saving:v}){const[d,k]=a.useState(!1),[x,N]=a.useState(o.enabled),[p,c]=a.useState(""),[m,u]=a.useState(""),[g,w]=a.useState(o.dmPolicy),[y,t]=a.useState(!1),[n,h]=a.useState(!1),[r,i]=a.useState(!1),j=v===l.id,S=(b==null?void 0:b.status)==="connected",A=!!o.token,P=!!o.apiKey,M=()=>{N(!x),i(!0)},B=async()=>{const s={enabled:x,dmPolicy:g};p&&(s.token=p),m&&(s.apiKey=m),await f(l.id,s),c(""),u(""),i(!1)},C=l.fields.find(s=>s.key==="token"),T=l.fields.find(s=>s.key==="apiKey");return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary",children:[e.jsxs("button",{onClick:()=>k(!d),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[d?e.jsx(F,{className:"h-4 w-4 text-text-muted"}):e.jsx(G,{className:"h-4 w-4 text-text-muted"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-text",children:l.label}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:l.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[S&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Connected"]}),e.jsx("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${o.enabled?"bg-accent/10 text-accent-hover":"bg-border-light/20 text-text-muted"}`,children:o.enabled?"Enabled":"Disabled"})]})]}),d&&e.jsxs("div",{className:"border-t border-bg-tertiary px-4 py-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm text-text-secondary",children:"Enabled"}),e.jsx("button",{onClick:M,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${x?"bg-accent":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${x?"translate-x-6":"translate-x-1"}`})})]}),C&&e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:[C.label,A&&e.jsx("span",{className:"rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success",children:"set"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`channel-${l.id}-token`,name:`channel-${l.id}-token`,type:y?"text":"password",value:p,onChange:s=>{c(s.target.value),i(!0)},placeholder:A?"(configured — enter new value to change)":C.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>t(!y),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:y?e.jsx(K,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),T&&e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:[T.label,P&&e.jsx("span",{className:"rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success",children:"set"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`channel-${l.id}-api-key`,name:`channel-${l.id}-api-key`,type:n?"text":"password",value:m,onChange:s=>{u(s.target.value),i(!0)},placeholder:P?"(configured — enter new value to change)":T.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>h(!n),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:n?e.jsx(K,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"DM Policy"}),e.jsx("div",{className:"flex gap-2",children:Z.map(s=>e.jsx("button",{onClick:()=>{w(s.value),i(!0)},className:`rounded-lg border px-3 py-1.5 text-xs transition-colors ${g===s.value?"border-accent bg-accent/10 text-accent-hover":"border-border text-text-muted hover:border-border-light"}`,title:s.desc,children:s.label},s.value))})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:B,disabled:j||!r,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),j?"Saving...":"Save"]})})]})]})}function Y(){const[l,o]=a.useState([]),[b,f]=a.useState({}),[v,d]=a.useState(!0),[k,x]=a.useState(null),[N,p]=a.useState(null),[c,m]=a.useState(null),u=async()=>{try{const[t,n]=await Promise.all([E(),D()]);o(t),f(n)}catch(t){x(t instanceof Error?t.message:"Failed to fetch channels")}finally{d(!1)}};a.useEffect(()=>{u()},[]);const g=(t,n)=>{m({type:t,message:n}),setTimeout(()=>m(null),3e3)},w=async(t,n)=>{var h;p(t);try{await R(t,n);const[r,i]=await Promise.all([E(),D()]);o(r),f(i);const j=((h=L.find(S=>S.id===t))==null?void 0:h.label)??t;g("success",`${j} settings saved (restart gateway to apply)`)}catch(r){g("error",r instanceof Error?r.message:"Failed to save")}finally{p(null)}};if(v)return e.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((t,n)=>e.jsx("div",{className:"h-14 animate-pulse rounded-xl border border-border bg-bg-secondary"},n))});if(k)return e.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:k});const y={enabled:!1,allowFrom:[],dmPolicy:"pairing"};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(O,{title:"Channels",subtitle:`Configure messaging channels — ${l.filter(t=>t.status==="connected").length} connected`,breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Channels"}],actions:e.jsxs("button",{onClick:()=>{d(!0),u()},className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary hover:border-border-light hover:text-text",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),"Refresh"]})}),c&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${c.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[c.type==="success"?e.jsx(_,{className:"h-4 w-4"}):e.jsx($,{className:"h-4 w-4"}),c.message]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Built-in"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:"WebChat"}),e.jsx("span",{className:"text-xs text-text-muted",children:"HTTP/WebSocket — always enabled"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Connected"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Messaging Channels"}),e.jsx("div",{className:"space-y-2",children:L.map(t=>{const n=b[t.id]??y,h=l.find(r=>r.name===t.id||r.type===t.id);return e.jsx(q,{def:t,config:n,status:h,onSave:w,saving:N},t.id)})})]}),e.jsx("p",{className:"text-xs text-text-muted text-center",children:"Channel changes are saved to config. Restart the gateway to connect/disconnect channels."})]})}export{Y as default};
1
+ import{r as a,j as e,i as $,ao as E,ap as D,V as F,an as K,E as I,aq as R}from"./index-Dbv5oKsp.js";import{P as O}from"./PageHeader-Bzb_WXw0.js";import{R as W}from"./refresh-cw-Cs4oDMNE.js";import{C as _}from"./circle-check-big-BFw1nom4.js";import{C as G}from"./chevron-right-U0Ujye5i.js";import{S as H}from"./save-BhGg2pZh.js";const L=[{id:"discord",label:"Discord",description:"Discord bot via discord.js",fields:[{key:"token",label:"Bot Token",placeholder:"Bot token from Discord Developer Portal"}]},{id:"telegram",label:"Telegram",description:"Telegram bot via Grammy",fields:[{key:"token",label:"Bot Token",placeholder:"Token from @BotFather"}]},{id:"slack",label:"Slack",description:"Slack workspace via Bolt SDK",fields:[{key:"token",label:"Bot Token",placeholder:"xoxb-..."},{key:"apiKey",label:"Signing Secret",placeholder:"Signing secret from Slack app settings"}]},{id:"whatsapp",label:"WhatsApp",description:"WhatsApp via Twilio",fields:[{key:"token",label:"Auth Token",placeholder:"Twilio auth token"},{key:"apiKey",label:"Account SID",placeholder:"Twilio account SID"}]},{id:"googlechat",label:"Google Chat",description:"Google Chat spaces",fields:[{key:"token",label:"Service Account Key",placeholder:"JSON key path or content"}]},{id:"matrix",label:"Matrix",description:"Matrix protocol (Element, etc.)",fields:[{key:"token",label:"Access Token",placeholder:"Matrix access token"}]},{id:"signal",label:"Signal",description:"Signal messenger",fields:[{key:"token",label:"API Token",placeholder:"Signal API token"}]},{id:"msteams",label:"Microsoft Teams",description:"MS Teams via Bot Framework",fields:[{key:"token",label:"App Password",placeholder:"Bot framework app password"},{key:"apiKey",label:"App ID",placeholder:"Bot framework app ID"}]},{id:"irc",label:"IRC",description:"Internet Relay Chat",fields:[{key:"token",label:"Password",placeholder:"NickServ password (optional)"}]},{id:"mattermost",label:"Mattermost",description:"Self-hosted team chat",fields:[{key:"token",label:"Bot Token",placeholder:"Mattermost bot access token"}]},{id:"lark",label:"Lark",description:"Lark/Feishu messaging",fields:[{key:"token",label:"App Token",placeholder:"Lark app token"},{key:"apiKey",label:"App Secret",placeholder:"Lark app secret"}]},{id:"email_inbound",label:"Email (Inbound)",description:"IMAP email webhook",fields:[{key:"token",label:"IMAP Password",placeholder:"IMAP password or app password"}]},{id:"line",label:"LINE",description:"LINE messaging platform",fields:[{key:"token",label:"Channel Access Token",placeholder:"LINE channel access token"},{key:"apiKey",label:"Channel Secret",placeholder:"LINE channel secret"}]},{id:"zulip",label:"Zulip",description:"Zulip team chat",fields:[{key:"apiKey",label:"API Key",placeholder:"Zulip API key"}]}],Z=[{value:"pairing",label:"Pairing",desc:"User must pair first"},{value:"open",label:"Open",desc:"Anyone can DM"},{value:"closed",label:"Closed",desc:"DMs disabled"}];function q({def:l,config:o,status:b,onSave:f,saving:v}){const[d,k]=a.useState(!1),[x,N]=a.useState(o.enabled),[p,c]=a.useState(""),[m,u]=a.useState(""),[g,w]=a.useState(o.dmPolicy),[y,t]=a.useState(!1),[n,h]=a.useState(!1),[r,i]=a.useState(!1),j=v===l.id,S=(b==null?void 0:b.status)==="connected",A=!!o.token,P=!!o.apiKey,M=()=>{N(!x),i(!0)},B=async()=>{const s={enabled:x,dmPolicy:g};p&&(s.token=p),m&&(s.apiKey=m),await f(l.id,s),c(""),u(""),i(!1)},C=l.fields.find(s=>s.key==="token"),T=l.fields.find(s=>s.key==="apiKey");return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary",children:[e.jsxs("button",{onClick:()=>k(!d),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[d?e.jsx(F,{className:"h-4 w-4 text-text-muted"}):e.jsx(G,{className:"h-4 w-4 text-text-muted"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-text",children:l.label}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:l.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[S&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Connected"]}),e.jsx("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${o.enabled?"bg-accent/10 text-accent-hover":"bg-border-light/20 text-text-muted"}`,children:o.enabled?"Enabled":"Disabled"})]})]}),d&&e.jsxs("div",{className:"border-t border-bg-tertiary px-4 py-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm text-text-secondary",children:"Enabled"}),e.jsx("button",{onClick:M,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${x?"bg-accent":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${x?"translate-x-6":"translate-x-1"}`})})]}),C&&e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:[C.label,A&&e.jsx("span",{className:"rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success",children:"set"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`channel-${l.id}-token`,name:`channel-${l.id}-token`,type:y?"text":"password",value:p,onChange:s=>{c(s.target.value),i(!0)},placeholder:A?"(configured — enter new value to change)":C.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>t(!y),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:y?e.jsx(K,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),T&&e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:[T.label,P&&e.jsx("span",{className:"rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success",children:"set"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`channel-${l.id}-api-key`,name:`channel-${l.id}-api-key`,type:n?"text":"password",value:m,onChange:s=>{u(s.target.value),i(!0)},placeholder:P?"(configured — enter new value to change)":T.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>h(!n),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:n?e.jsx(K,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"DM Policy"}),e.jsx("div",{className:"flex gap-2",children:Z.map(s=>e.jsx("button",{onClick:()=>{w(s.value),i(!0)},className:`rounded-lg border px-3 py-1.5 text-xs transition-colors ${g===s.value?"border-accent bg-accent/10 text-accent-hover":"border-border text-text-muted hover:border-border-light"}`,title:s.desc,children:s.label},s.value))})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:B,disabled:j||!r,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),j?"Saving...":"Save"]})})]})]})}function Y(){const[l,o]=a.useState([]),[b,f]=a.useState({}),[v,d]=a.useState(!0),[k,x]=a.useState(null),[N,p]=a.useState(null),[c,m]=a.useState(null),u=async()=>{try{const[t,n]=await Promise.all([E(),D()]);o(t),f(n)}catch(t){x(t instanceof Error?t.message:"Failed to fetch channels")}finally{d(!1)}};a.useEffect(()=>{u()},[]);const g=(t,n)=>{m({type:t,message:n}),setTimeout(()=>m(null),3e3)},w=async(t,n)=>{var h;p(t);try{await R(t,n);const[r,i]=await Promise.all([E(),D()]);o(r),f(i);const j=((h=L.find(S=>S.id===t))==null?void 0:h.label)??t;g("success",`${j} settings saved (restart gateway to apply)`)}catch(r){g("error",r instanceof Error?r.message:"Failed to save")}finally{p(null)}};if(v)return e.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((t,n)=>e.jsx("div",{className:"h-14 animate-pulse rounded-xl border border-border bg-bg-secondary"},n))});if(k)return e.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:k});const y={enabled:!1,allowFrom:[],dmPolicy:"pairing"};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(O,{title:"Channels",subtitle:`Configure messaging channels — ${l.filter(t=>t.status==="connected").length} connected`,breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Channels"}],actions:e.jsxs("button",{onClick:()=>{d(!0),u()},className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary hover:border-border-light hover:text-text",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),"Refresh"]})}),c&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${c.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[c.type==="success"?e.jsx(_,{className:"h-4 w-4"}):e.jsx($,{className:"h-4 w-4"}),c.message]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Built-in"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:"WebChat"}),e.jsx("span",{className:"text-xs text-text-muted",children:"HTTP/WebSocket — always enabled"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Connected"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Messaging Channels"}),e.jsx("div",{className:"space-y-2",children:L.map(t=>{const n=b[t.id]??y,h=l.find(r=>r.name===t.id||r.type===t.id);return e.jsx(q,{def:t,config:n,status:h,onSave:w,saving:N},t.id)})})]}),e.jsx("p",{className:"text-xs text-text-muted text-center",children:"Channel changes are saved to config. Restart the gateway to connect/disconnect channels."})]})}export{Y as default};
@@ -1 +1 @@
1
- import{r as a,bD as l,j as e,bE as d}from"./index-CmaGnHzR.js";import{P as m}from"./PageHeader-BJ1jHtOy.js";import{R as h}from"./refresh-cw-BFBnnWj8.js";import{S as x}from"./save--wCYre_u.js";import{T as p}from"./trash-2-C5KNXS-O.js";import"./chevron-right-DkIMxdwH.js";function k(){const[c,n]=a.useState([]),[i,r]=a.useState(!0),t=a.useCallback(async()=>{r(!0);try{const s=await l();n(s.checkpoints||[])}catch{}r(!1)},[]);a.useEffect(()=>{t()},[t]);const o=async s=>{if(confirm("Delete this checkpoint?"))try{await d(s),await t()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(m,{title:"Checkpoints",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"Checkpoints"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:t,disabled:i,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(h,{className:`w-4 h-4 ${i?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:c.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(x,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm text-[#e4e4e7]",children:[s.sessionId.slice(0,16),"..."]}),e.jsx("div",{className:"text-xs text-[#52525b]",children:new Date(s.createdAt).toLocaleString()})]})]}),e.jsx("button",{onClick:()=>o(s.sessionId),className:"p-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] hover:bg-[#3f3f46] hover:text-red-400",children:e.jsx(p,{className:"w-3.5 h-3.5"})})]},s.sessionId))})]})}export{k as default};
1
+ import{r as a,bD as l,j as e,bE as d}from"./index-Dbv5oKsp.js";import{P as m}from"./PageHeader-Bzb_WXw0.js";import{R as h}from"./refresh-cw-Cs4oDMNE.js";import{S as x}from"./save-BhGg2pZh.js";import{T as p}from"./trash-2-CSxfLiVB.js";import"./chevron-right-U0Ujye5i.js";function k(){const[c,n]=a.useState([]),[i,r]=a.useState(!0),t=a.useCallback(async()=>{r(!0);try{const s=await l();n(s.checkpoints||[])}catch{}r(!1)},[]);a.useEffect(()=>{t()},[t]);const o=async s=>{if(confirm("Delete this checkpoint?"))try{await d(s),await t()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(m,{title:"Checkpoints",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"Checkpoints"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:t,disabled:i,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(h,{className:`w-4 h-4 ${i?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:c.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(x,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm text-[#e4e4e7]",children:[s.sessionId.slice(0,16),"..."]}),e.jsx("div",{className:"text-xs text-[#52525b]",children:new Date(s.createdAt).toLocaleString()})]})]}),e.jsx("button",{onClick:()=>o(s.sessionId),className:"p-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] hover:bg-[#3f3f46] hover:text-red-400",children:e.jsx(p,{className:"w-3.5 h-3.5"})})]},s.sessionId))})]})}export{k as default};