titan-agent 5.4.2 β†’ 5.5.5

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 (296) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/agent.js +9 -5
  3. package/dist/agent/agent.js.map +1 -1
  4. package/dist/agent/agentLoop.js +7 -3
  5. package/dist/agent/agentLoop.js.map +1 -1
  6. package/dist/agent/checkpoint.js +2 -2
  7. package/dist/agent/checkpoint.js.map +1 -1
  8. package/dist/agent/commandPost.js +3 -3
  9. package/dist/agent/commandPost.js.map +1 -1
  10. package/dist/agent/goalProposer.js +2 -2
  11. package/dist/agent/goalProposer.js.map +1 -1
  12. package/dist/agent/goals.js +3 -3
  13. package/dist/agent/goals.js.map +1 -1
  14. package/dist/agent/planner.js +4 -4
  15. package/dist/agent/planner.js.map +1 -1
  16. package/dist/agent/userProfile.js +2 -2
  17. package/dist/agent/userProfile.js.map +1 -1
  18. package/dist/cli/doctor.js +33 -0
  19. package/dist/cli/doctor.js.map +1 -1
  20. package/dist/cli/onboard.js +4 -4
  21. package/dist/cli/onboard.js.map +1 -1
  22. package/dist/config/config.js +3 -3
  23. package/dist/config/config.js.map +1 -1
  24. package/dist/config/schema.js +8 -1
  25. package/dist/config/schema.js.map +1 -1
  26. package/dist/gateway/routes/adminRouter.js +500 -0
  27. package/dist/gateway/routes/adminRouter.js.map +1 -0
  28. package/dist/gateway/routes/agents.js +231 -0
  29. package/dist/gateway/routes/agents.js.map +1 -0
  30. package/dist/gateway/routes/agentsRouter.js +32 -0
  31. package/dist/gateway/routes/agentsRouter.js.map +1 -0
  32. package/dist/gateway/routes/checkpoints.js +41 -0
  33. package/dist/gateway/routes/checkpoints.js.map +1 -0
  34. package/dist/gateway/routes/commandPost.js +755 -0
  35. package/dist/gateway/routes/commandPost.js.map +1 -0
  36. package/dist/gateway/routes/companies.js +166 -0
  37. package/dist/gateway/routes/companies.js.map +1 -0
  38. package/dist/gateway/routes/files.js +295 -0
  39. package/dist/gateway/routes/files.js.map +1 -0
  40. package/dist/gateway/routes/hardwareRouter.js +151 -0
  41. package/dist/gateway/routes/hardwareRouter.js.map +1 -0
  42. package/dist/gateway/routes/mcpRouter.js +88 -0
  43. package/dist/gateway/routes/mcpRouter.js.map +1 -0
  44. package/dist/gateway/routes/mesh.js +464 -0
  45. package/dist/gateway/routes/mesh.js.map +1 -0
  46. package/dist/gateway/routes/metricsRouter.js +131 -0
  47. package/dist/gateway/routes/metricsRouter.js.map +1 -0
  48. package/dist/gateway/routes/organism.js +82 -0
  49. package/dist/gateway/routes/organism.js.map +1 -0
  50. package/dist/gateway/routes/paperclip.js +101 -0
  51. package/dist/gateway/routes/paperclip.js.map +1 -0
  52. package/dist/gateway/routes/sessions.js +227 -0
  53. package/dist/gateway/routes/sessions.js.map +1 -0
  54. package/dist/gateway/routes/skills.js +295 -0
  55. package/dist/gateway/routes/skills.js.map +1 -0
  56. package/dist/gateway/routes/socialRouter.js +145 -0
  57. package/dist/gateway/routes/socialRouter.js.map +1 -0
  58. package/dist/gateway/routes/systemRouter.js +220 -0
  59. package/dist/gateway/routes/systemRouter.js.map +1 -0
  60. package/dist/gateway/routes/teamsRecipes.js +297 -0
  61. package/dist/gateway/routes/teamsRecipes.js.map +1 -0
  62. package/dist/gateway/routes/tests.js +401 -0
  63. package/dist/gateway/routes/tests.js.map +1 -0
  64. package/dist/gateway/routes/traces.js +33 -0
  65. package/dist/gateway/routes/traces.js.map +1 -0
  66. package/dist/gateway/routes/voiceRouter.js +770 -0
  67. package/dist/gateway/routes/voiceRouter.js.map +1 -0
  68. package/dist/gateway/routes/watchRouter.js +131 -0
  69. package/dist/gateway/routes/watchRouter.js.map +1 -0
  70. package/dist/gateway/server.js +1179 -7379
  71. package/dist/gateway/server.js.map +1 -1
  72. package/dist/mcp/registry.js +2 -2
  73. package/dist/mcp/registry.js.map +1 -1
  74. package/dist/memory/episodic.js +2 -2
  75. package/dist/memory/episodic.js.map +1 -1
  76. package/dist/memory/learning.js +3 -3
  77. package/dist/memory/learning.js.map +1 -1
  78. package/dist/memory/memory.js +3 -3
  79. package/dist/memory/memory.js.map +1 -1
  80. package/dist/organism/drives.js +2 -2
  81. package/dist/organism/drives.js.map +1 -1
  82. package/dist/providers/errorTaxonomy.js +13 -0
  83. package/dist/providers/errorTaxonomy.js.map +1 -1
  84. package/dist/providers/ollama.js +3 -1
  85. package/dist/providers/ollama.js.map +1 -1
  86. package/dist/providers/openai_compat.js +4 -3
  87. package/dist/providers/openai_compat.js.map +1 -1
  88. package/dist/providers/router.js +13 -0
  89. package/dist/providers/router.js.map +1 -1
  90. package/dist/safety/killSwitch.js +2 -2
  91. package/dist/safety/killSwitch.js.map +1 -1
  92. package/dist/skills/builtin/agent_debate.js +2 -2
  93. package/dist/skills/builtin/agent_debate.js.map +1 -1
  94. package/dist/skills/builtin/apply_patch.js +3 -3
  95. package/dist/skills/builtin/apply_patch.js.map +1 -1
  96. package/dist/skills/builtin/shell.js +2 -2
  97. package/dist/skills/builtin/shell.js.map +1 -1
  98. package/dist/skills/builtin/voice_control.js +49 -0
  99. package/dist/skills/builtin/voice_control.js.map +1 -0
  100. package/dist/skills/builtin/widget_gallery.js +6 -1
  101. package/dist/skills/builtin/widget_gallery.js.map +1 -1
  102. package/dist/skills/registry.js +15 -4
  103. package/dist/skills/registry.js.map +1 -1
  104. package/dist/storage/JsonStorage.js +4 -4
  105. package/dist/storage/JsonStorage.js.map +1 -1
  106. package/dist/utils/constants.js +1 -1
  107. package/dist/utils/constants.js.map +1 -1
  108. package/dist/utils/helpers.js +3 -1
  109. package/dist/utils/helpers.js.map +1 -1
  110. package/dist/utils/lifecycle.js +86 -0
  111. package/dist/utils/lifecycle.js.map +1 -0
  112. package/dist/voice/bridge.js +136 -0
  113. package/dist/voice/bridge.js.map +1 -0
  114. package/docs/COO-MASTER-PLAN-2026-05-02.md +474 -0
  115. package/docs/HANDOFF/2026-04-29.md +141 -0
  116. package/docs/HANDOFF-2026-04-30.md +144 -0
  117. package/docs/HANDOFF-2026-05-03.md +114 -0
  118. package/docs/adr/2026-04-29-widget-pipeline-traceability.md +49 -0
  119. package/docs/agent-memory/README.md +45 -0
  120. package/docs/agent-memory/commands.md +100 -0
  121. package/docs/agent-memory/context-tree.md +101 -0
  122. package/docs/agent-memory/current-state.md +54 -0
  123. package/docs/agent-memory/decisions.md +78 -0
  124. package/docs/agent-memory/known-issues.md +76 -0
  125. package/docs/agent-memory/reflections.md +52 -0
  126. package/docs/agent-memory/skills-candidates.md +80 -0
  127. package/docs/superpowers/plans/2026-04-29-comprehensive-audit.md +256 -0
  128. package/docs/superpowers/plans/2026-04-29-comprehensive-test-plan.md +396 -0
  129. package/docs/superpowers/plans/2026-04-29-fix-all-prs.md +251 -0
  130. package/docs/superpowers/plans/2026-04-29-gitnexus-gap-remediation.md +969 -0
  131. package/package.json +5 -2
  132. package/ui/dist/assets/{AuditPanel-CM6Wg9hO.js β†’ AuditPanel-VzSndmDN.js} +2 -2
  133. package/ui/dist/assets/{AutonomyPanel-CESx3ANg.js β†’ AutonomyPanel-BiFouzAV.js} +2 -2
  134. package/ui/dist/assets/AutopilotPanel-fjOfM668.js +1 -0
  135. package/ui/dist/assets/{AutoresearchPanel-DR47NqT5.js β†’ AutoresearchPanel-CVCxzAH3.js} +2 -2
  136. package/ui/dist/assets/BackupPanel-CHVTG--q.js +1 -0
  137. package/ui/dist/assets/{BrowserPanel-C15x9bLn.js β†’ BrowserPanel-D5mvMKFU.js} +2 -2
  138. package/ui/dist/assets/CPActivity-B12mt35m.js +1 -0
  139. package/ui/dist/assets/CPAgentDetail-DsdShc-1.js +1 -0
  140. package/ui/dist/assets/CPAgents-j_7C-oQV.js +1 -0
  141. package/ui/dist/assets/CPApprovals-BShKSX9X.js +1 -0
  142. package/ui/dist/assets/CPCosts-CKPlhBDs.js +1 -0
  143. package/ui/dist/assets/CPDashboard-11c0nkxK.js +1 -0
  144. package/ui/dist/assets/CPFiles-BhLEOnXy.js +1 -0
  145. package/ui/dist/assets/CPGoals-Bi3t1b2P.js +1 -0
  146. package/ui/dist/assets/CPInbox-Bbr7khp6.js +11 -0
  147. package/ui/dist/assets/CPIssueDetail-DSdgNK8r.js +1 -0
  148. package/ui/dist/assets/CPIssues-DDEVKhX6.js +1 -0
  149. package/ui/dist/assets/CPLayout-DgPOfyGv.js +17 -0
  150. package/ui/dist/assets/CPOrg-Df73RrRJ.js +8 -0
  151. package/ui/dist/assets/CPRuns-ByioAz8w.js +1 -0
  152. package/ui/dist/assets/{CPSocial-nb-j7sOE.js β†’ CPSocial-Dlnr_w1X.js} +2 -2
  153. package/ui/dist/assets/ChannelsPanel-DQjQCTK5.js +1 -0
  154. package/ui/dist/assets/CheckpointsPanel-C4vKjlAJ.js +1 -0
  155. package/ui/dist/assets/CommandPostHub-C9pp5Giq.js +24 -0
  156. package/ui/dist/assets/CronPanel-C6bzUfrD.js +1 -0
  157. package/ui/dist/assets/DaemonPanel-BA5Tb_UO.js +1 -0
  158. package/ui/dist/assets/{DataTable-B2Ma8hfi.js β†’ DataTable-CH7IYJJh.js} +1 -1
  159. package/ui/dist/assets/{EmptyState-CcKyk5Yn.js β†’ EmptyState-jU6yNDnF.js} +1 -1
  160. package/ui/dist/assets/{EvalHarnessPanel-BqtMc1ZM.js β†’ EvalHarnessPanel-DnYqredY.js} +2 -2
  161. package/ui/dist/assets/EvalPanel-ChO7CD1r.js +1 -0
  162. package/ui/dist/assets/{FilesPanel-3QKvrWPo.js β†’ FilesPanel-CaUkv2is.js} +2 -2
  163. package/ui/dist/assets/FleetPanel-DC_5uj0N.js +1 -0
  164. package/ui/dist/assets/{HomelabPanel-DhrjTX9m.js β†’ HomelabPanel-CE5PGRpL.js} +2 -2
  165. package/ui/dist/assets/InfraView-C-uSlvb9.js +2 -0
  166. package/ui/dist/assets/InlineEditableField-BMQjiE6-.js +1 -0
  167. package/ui/dist/assets/Input-Bu_b3qmY.js +1 -0
  168. package/ui/dist/assets/IntegrationsPanel-DsYpAq43.js +1 -0
  169. package/ui/dist/assets/IntelligenceView-DUdIO1K7.js +2 -0
  170. package/ui/dist/assets/LearningPanel-UpQZC-mA.js +1 -0
  171. package/ui/dist/assets/LogsPanel-ClXJ4fcr.js +1 -0
  172. package/ui/dist/assets/McpPanel-JKgtIERQ.js +1 -0
  173. package/ui/dist/assets/{MemoryGraphPanel-Bzvjmzvk.js β†’ MemoryGraphPanel-Bo2OrvA6.js} +2 -2
  174. package/ui/dist/assets/MemoryWikiPanel-BqJ1AmYm.js +11 -0
  175. package/ui/dist/assets/{MeshPanel-C3LJSlht.js β†’ MeshPanel-BJVGYvwk.js} +2 -2
  176. package/ui/dist/assets/Modal-CAAooiZU.js +1 -0
  177. package/ui/dist/assets/NvidiaPanel-BtCg3G4w.js +1 -0
  178. package/ui/dist/assets/OrganismPanel-DgrTTzcF.js +1 -0
  179. package/ui/dist/assets/OverviewPanel-rVav1Hox.js +1 -0
  180. package/ui/dist/assets/{PageHeader-BimceqQo.js β†’ PageHeader-CnZtP8ek.js} +1 -1
  181. package/ui/dist/assets/PaperclipPanel-C-FKdhiF.js +1 -0
  182. package/ui/dist/assets/{PersonasPanel-L1j78p6H.js β†’ PersonasPanel-BmlxokfB.js} +1 -1
  183. package/ui/dist/assets/RecipesPanel-BNKKChis.js +1 -0
  184. package/ui/dist/assets/SecurityPanel-I7JRHiNy.js +1 -0
  185. package/ui/dist/assets/SelfImprovePanel-u9h0Lt3p.js +1 -0
  186. package/ui/dist/assets/{SelfProposalsPanel-lNmiDThB.js β†’ SelfProposalsPanel-DKl9iBjM.js} +2 -2
  187. package/ui/dist/assets/SessionsPanel-BhRiWI_g.js +1 -0
  188. package/ui/dist/assets/{SessionsTab-JQbltWww.js β†’ SessionsTab-Bk08wyeY.js} +1 -1
  189. package/ui/dist/assets/SettingsPanel-haLfmG2k.js +1 -0
  190. package/ui/dist/assets/SettingsView--gi3fxI8.js +2 -0
  191. package/ui/dist/assets/{SkeletonLoader-atQtpcF5.js β†’ SkeletonLoader-B5v09EF_.js} +1 -1
  192. package/ui/dist/assets/{SkillsPanel-DlFs2ih7.js β†’ SkillsPanel-BlAHFLcQ.js} +1 -1
  193. package/ui/dist/assets/SomaView-CExtS3zw.js +5 -0
  194. package/ui/dist/assets/{StatCard-DciE_Iqc.js β†’ StatCard-BIsyMybM.js} +1 -1
  195. package/ui/dist/assets/{StatusBadge-BtfSPoW2.js β†’ StatusBadge-D5nU7El8.js} +1 -1
  196. package/ui/dist/assets/Tabs-BBYZrBI8.js +1 -0
  197. package/ui/dist/assets/TeamsPanel-LPXJg823.js +1 -0
  198. package/ui/dist/assets/TelemetryPanel-EqpRBmOI.js +1 -0
  199. package/ui/dist/assets/TitanCanvas-BCbWnLMd.js +985 -0
  200. package/ui/dist/assets/ToolsView-CeP0Zz-N.js +2 -0
  201. package/ui/dist/assets/{Tooltip-70UK0E2I.js β†’ Tooltip-BSO2XVpF.js} +1 -1
  202. package/ui/dist/assets/TraceViewer-BKI7o5B0.js +1 -0
  203. package/ui/dist/assets/TrainingPanel-c-RhjdE1.js +1 -0
  204. package/ui/dist/assets/VoiceOverlay-D-gc58b0.js +27 -0
  205. package/ui/dist/assets/VramPanel-C6xc7zgd.js +1 -0
  206. package/ui/dist/assets/{WatchView-C-sGFpVy.js β†’ WatchView-dqBVCVH0.js} +1 -1
  207. package/ui/dist/assets/WorkTab-CBoLNrTM.js +1 -0
  208. package/ui/dist/assets/{WorkflowsPanel-CvgQU1xI.js β†’ WorkflowsPanel-BAnSTOYe.js} +2 -2
  209. package/ui/dist/assets/approvalHeadline-DB9SgR-9.js +1 -0
  210. package/ui/dist/assets/{arrow-left-DwqHtJiU.js β†’ arrow-left-5chqas7J.js} +1 -1
  211. package/ui/dist/assets/briefcase-D4vLzudp.js +6 -0
  212. package/ui/dist/assets/{chart-column-BtNO6sRy.js β†’ chart-column-CdFlBpoP.js} +1 -1
  213. package/ui/dist/assets/check-Bpm1IONe.js +6 -0
  214. package/ui/dist/assets/chevron-down-D7OLjvuD.js +6 -0
  215. package/ui/dist/assets/chevron-right-aQEw2mUW.js +6 -0
  216. package/ui/dist/assets/chevron-up-C5g6pEj8.js +6 -0
  217. package/ui/dist/assets/{circle-check-big-DZRE_MbN.js β†’ circle-check-big-fPhEdP88.js} +1 -1
  218. package/ui/dist/assets/clock-CTsgP_Sn.js +6 -0
  219. package/ui/dist/assets/{dollar-sign-aVG3a5eL.js β†’ dollar-sign-CudFVYFc.js} +1 -1
  220. package/ui/dist/assets/{download-BxiWJU4G.js β†’ download-DZRxDn67.js} +1 -1
  221. package/ui/dist/assets/external-link-BZ0y_Ahx.js +6 -0
  222. package/ui/dist/assets/{eye-off-CkgfFYhm.js β†’ eye-off-BmJF0YYx.js} +1 -1
  223. package/ui/dist/assets/folder-DA43TRCm.js +11 -0
  224. package/ui/dist/assets/{funnel-PkLdxKyC.js β†’ funnel-J3mULzrz.js} +1 -1
  225. package/ui/dist/assets/{git-branch-BM-Gw95X.js β†’ git-branch-oHibJqDq.js} +1 -1
  226. package/ui/dist/assets/{index-D0RJ8701.css β†’ index-BR0vfkIi.css} +1 -1
  227. package/ui/dist/assets/{index-CahJbWSR.js β†’ index-DzwowwSI.js} +20 -20
  228. package/ui/dist/assets/{layers-BuGf4FIJ.js β†’ layers-DsyEyu7z.js} +1 -1
  229. package/ui/dist/assets/{legacy-CR6o4t-y.js β†’ legacy-8ITl64sV.js} +1 -1
  230. package/ui/dist/assets/{lightbulb-n8gc_XAL.js β†’ lightbulb-C54Ske-p.js} +1 -1
  231. package/ui/dist/assets/list-todo-Cnd4rdoK.js +6 -0
  232. package/ui/dist/assets/loader-circle-1YOBsoQp.js +6 -0
  233. package/ui/dist/assets/network-DbGDAdrn.js +6 -0
  234. package/ui/dist/assets/{pause-DCV52koX.js β†’ pause-CYhO_uQo.js} +1 -1
  235. package/ui/dist/assets/{play-CcJ9BnCh.js β†’ play-DVY9c5Ck.js} +1 -1
  236. package/ui/dist/assets/{plug-CfWBXfCl.js β†’ plug-BcXjlPUL.js} +1 -1
  237. package/ui/dist/assets/plus-Csu2v9GN.js +6 -0
  238. package/ui/dist/assets/{proxy-CzZDfLmm.js β†’ proxy-DxS2_9D7.js} +1 -1
  239. package/ui/dist/assets/rotate-ccw-Co-_W04j.js +6 -0
  240. package/ui/dist/assets/save-Btx-kpoW.js +6 -0
  241. package/ui/dist/assets/search-0hXTwEZR.js +6 -0
  242. package/ui/dist/assets/send-TEpapzQR.js +6 -0
  243. package/ui/dist/assets/shield-check-DjBJXZUr.js +6 -0
  244. package/ui/dist/assets/{square-DJpUhlxi.js β†’ square-OweUvjP-.js} +1 -1
  245. package/ui/dist/assets/{target-DWcmM_9m.js β†’ target-BRW80Xer.js} +1 -1
  246. package/ui/dist/assets/terminal-BtiqJ628.js +16 -0
  247. package/ui/dist/assets/{toggle-right-YusFQ69L.js β†’ toggle-right-CKtSrl28.js} +1 -1
  248. package/ui/dist/assets/{trash-2-CK7yQ55V.js β†’ trash-2-DgWrHVax.js} +1 -1
  249. package/ui/dist/assets/{trending-up-DGjFyubC.js β†’ trending-up-MpIrE4j6.js} +1 -1
  250. package/ui/dist/assets/{trophy-uQv_NgDB.js β†’ trophy-CECuZNhX.js} +1 -1
  251. package/ui/dist/assets/users-dZgv4ePG.js +16 -0
  252. package/ui/dist/assets/wrench-CDz3xYve.js +11 -0
  253. package/ui/dist/index.html +2 -2
  254. package/ui/dist/assets/AutopilotPanel-DtEet1hJ.js +0 -1
  255. package/ui/dist/assets/BackupPanel-BGP8p3l3.js +0 -1
  256. package/ui/dist/assets/CPAgents-DYUtPzSq.js +0 -1
  257. package/ui/dist/assets/CPDashboard-Bf0-SyCh.js +0 -6
  258. package/ui/dist/assets/CPFiles-CxgxjQcO.js +0 -1
  259. package/ui/dist/assets/CPGoals-BsmCMTvT.js +0 -1
  260. package/ui/dist/assets/CPInbox-tMSbmQ9H.js +0 -11
  261. package/ui/dist/assets/ChannelsPanel-DP5C2OKd.js +0 -1
  262. package/ui/dist/assets/CheckpointsPanel-DlranVLZ.js +0 -1
  263. package/ui/dist/assets/CommandPostHub-BgxIa4Ev.js +0 -29
  264. package/ui/dist/assets/CronPanel-LoT5yKwJ.js +0 -1
  265. package/ui/dist/assets/DaemonPanel-DBGMqaE_.js +0 -1
  266. package/ui/dist/assets/EvalPanel-Bc33j0pN.js +0 -1
  267. package/ui/dist/assets/FleetPanel-CSsXuQYj.js +0 -1
  268. package/ui/dist/assets/InfraView-CR6HyrL6.js +0 -2
  269. package/ui/dist/assets/InlineEditableField-CnvF-yFR.js +0 -1
  270. package/ui/dist/assets/Input-GTHp2Rkr.js +0 -1
  271. package/ui/dist/assets/IntegrationsPanel-CymCRE3T.js +0 -1
  272. package/ui/dist/assets/IntelligenceView-C1IHxJRC.js +0 -2
  273. package/ui/dist/assets/LearningPanel-DOCES3lH.js +0 -1
  274. package/ui/dist/assets/LogsPanel-BLnAqEaZ.js +0 -1
  275. package/ui/dist/assets/McpPanel-ChUzmr3z.js +0 -1
  276. package/ui/dist/assets/MemoryWikiPanel-Dwk3Aqwd.js +0 -11
  277. package/ui/dist/assets/NvidiaPanel-CeZK_-CV.js +0 -1
  278. package/ui/dist/assets/OrganismPanel-BB6YOiQV.js +0 -1
  279. package/ui/dist/assets/OverviewPanel-BmtBhQnv.js +0 -1
  280. package/ui/dist/assets/PaperclipPanel-C-brgwA3.js +0 -1
  281. package/ui/dist/assets/RecipesPanel-34lCfynJ.js +0 -1
  282. package/ui/dist/assets/SecurityPanel-CBTPWLj6.js +0 -1
  283. package/ui/dist/assets/SelfImprovePanel-BrPbFHhG.js +0 -1
  284. package/ui/dist/assets/SessionsPanel-DAEYIn83.js +0 -1
  285. package/ui/dist/assets/SettingsPanel-CzRROAYQ.js +0 -1
  286. package/ui/dist/assets/SettingsView-CN7ii2uw.js +0 -2
  287. package/ui/dist/assets/SomaView-Ba642Oqb.js +0 -5
  288. package/ui/dist/assets/TeamsPanel-DKQ5z2Qe.js +0 -1
  289. package/ui/dist/assets/TelemetryPanel-B6KAc55Q.js +0 -1
  290. package/ui/dist/assets/TitanCanvas-C-s0A-lv.js +0 -1092
  291. package/ui/dist/assets/ToolsView-Dei0KMP0.js +0 -2
  292. package/ui/dist/assets/TraceViewer-BniolyBx.js +0 -1
  293. package/ui/dist/assets/TrainingPanel-Bz4CTPGW.js +0 -1
  294. package/ui/dist/assets/VoiceOverlay-CmNCrLcd.js +0 -37
  295. package/ui/dist/assets/VramPanel-Xh_OtRDR.js +0 -1
  296. package/ui/dist/assets/WorkTab-BjLNmgIK.js +0 -1
@@ -1 +0,0 @@
1
- import{r,ab as v,j as e}from"./index-CahJbWSR.js";import{R as j}from"./TitanCanvas-C-s0A-lv.js";import"./VoiceOverlay-CmNCrLcd.js";const x={debug:"bg-text-muted/20 text-text-secondary",info:"bg-info/20 text-info",warn:"bg-warning/20 text-warning",warning:"bg-warning/20 text-warning",error:"bg-error/20 text-error"};function L(){const[c,u]=r.useState([]),[g,m]=r.useState(!0),[i,d]=r.useState(null),[a,b]=r.useState(""),[o,h]=r.useState(100),[l,p]=r.useState(!1),s=r.useRef(null),n=r.useCallback(async()=>{try{const t=await v(a||void 0,o);u(t),d(null)}catch(t){d(t instanceof Error?t.message:"Failed to fetch logs")}finally{m(!1)}},[a,o]);return r.useEffect(()=>{n()},[n]),r.useEffect(()=>(l?s.current=setInterval(n,5e3):s.current&&(clearInterval(s.current),s.current=null),()=>{s.current&&clearInterval(s.current)}),[l,n]),g?e.jsx("div",{className:"h-96 animate-pulse rounded-xl border border-border bg-bg-secondary"}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-text",children:"Logs"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("select",{value:a,onChange:t=>b(t.target.value),className:"rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent",children:[e.jsx("option",{value:"",children:"All levels"}),e.jsx("option",{value:"debug",children:"Debug"}),e.jsx("option",{value:"info",children:"Info"}),e.jsx("option",{value:"warn",children:"Warn"}),e.jsx("option",{value:"error",children:"Error"})]}),e.jsxs("select",{value:o,onChange:t=>h(Number(t.target.value)),className:"rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent",children:[e.jsx("option",{value:50,children:"50 entries"}),e.jsx("option",{value:100,children:"100 entries"}),e.jsx("option",{value:200,children:"200 entries"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-text-secondary",children:[e.jsx("input",{type:"checkbox",checked:l,onChange:t=>p(t.target.checked),className:"h-4 w-4 rounded border-border accent-accent"}),"Auto-refresh (5s)"]}),e.jsx("button",{onClick:n,className:"ml-auto rounded-lg p-2 text-text-secondary transition-colors hover:bg-bg-tertiary hover:text-text",title:"Refresh",children:e.jsx(j,{className:"h-4 w-4"})})]}),i&&e.jsx("div",{className:"rounded-lg border border-error/50 bg-bg-secondary px-4 py-2 text-sm text-error",children:i}),e.jsx("div",{className:"max-h-[600px] overflow-y-auto rounded-xl border border-border bg-bg-secondary",children:c.length===0?e.jsx("p",{className:"px-4 py-12 text-center text-text-muted",children:"No logs found"}):e.jsx("div",{className:"divide-y divide-border",children:c.map((t,f)=>e.jsxs("div",{className:"flex items-start gap-3 px-4 py-2.5",children:[e.jsx("span",{className:"shrink-0 font-mono text-xs text-text-muted",children:new Date(t.timestamp).toLocaleTimeString()}),e.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-xs font-medium uppercase ${x[t.level]??x.debug}`,children:t.level}),e.jsx("span",{className:"min-w-0 break-all text-sm text-text",children:t.message})]},f))})})]})}export{L as default};
@@ -1 +0,0 @@
1
- import{r as d,j as e,G as k,ai as z,aj as $,ak as b,al as R,am as I,an as E}from"./index-CahJbWSR.js";import{P as h}from"./plug-CfWBXfCl.js";import{R as D,P as L,h as g,l as G,m as B}from"./TitanCanvas-C-s0A-lv.js";import{T as F}from"./trash-2-CK7yQ55V.js";import"./VoiceOverlay-CmNCrLcd.js";function J(){const[n,j]=d.useState([]),[N,y]=d.useState([]),[f,x]=d.useState(!0),[m,c]=d.useState(!1),[v,p]=d.useState(null),[l,i]=d.useState(null),[s,a]=d.useState({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),o=async()=>{x(!0);try{const[t,r]=await Promise.all([z(),$()]);j(t),y(r)}catch{}x(!1)};d.useEffect(()=>{o()},[]);const C=async()=>{try{await b({id:s.id,name:s.name,description:s.description,type:s.type,...s.type==="stdio"?{command:s.command,args:s.args.split(/\s+/).filter(Boolean)}:{url:s.url}}),c(!1),a({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),o()}catch(t){alert(t.message)}},P=async t=>{try{await b({presetId:t}),o()}catch(r){alert(r.message)}},w=async t=>{confirm(`Remove MCP server "${t}"?`)&&(await E(t),o())},M=async(t,r)=>{await I(t,r),o()},T=async t=>{p(t),i(null);try{const r=await R(t);i({id:t,...r})}catch(r){i({id:t,ok:!1,tools:0,error:r.message})}p(null)},S=t=>t==="connected"?"text-[var(--success)]":t==="error"?"text-[var(--error)]":"text-[var(--text-muted)]",A=t=>t==="connected"?"bg-[var(--success)]":t==="error"?"bg-[var(--error)]":"bg-[var(--text-muted)]",u=N.filter(t=>!n.some(r=>r.id===t.id));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-6 h-6 text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-[var(--text)]",children:"MCP Connections"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connect to external tools via Model Context Protocol"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:o,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(D,{size:14})}),e.jsxs("button",{onClick:()=>c(!m),className:"flex items-center gap-2 px-3 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] transition-colors",children:[e.jsx(L,{size:14})," Add Server"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Configured Servers"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--text)]",children:n.length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connected"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--success)]",children:n.filter(t=>t.status==="connected").length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"External Tools"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--accent)]",children:n.reduce((t,r)=>t+r.toolCount,0)})]})]}),m&&e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)]",children:"Add MCP Server"}),u.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)] mb-2",children:"Quick Add Presets"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(t=>e.jsxs("button",{onClick:()=>P(t.id),className:"flex items-center gap-2 px-3 py-1.5 text-xs rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:[e.jsx(g,{size:12})," ",t.name]},t.id))})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"ID"}),e.jsx("input",{id:"mcp-server-id",name:"mcp-server-id",value:s.id,onChange:t=>a({...s,id:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"my-server"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Name"}),e.jsx("input",{id:"mcp-server-name",name:"mcp-server-name",value:s.name,onChange:t=>a({...s,name:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"My MCP Server"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Description"}),e.jsx("input",{id:"mcp-server-description",name:"mcp-server-description",value:s.description,onChange:t=>a({...s,description:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"What does this server do?"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Type"}),e.jsxs("select",{id:"mcp-server-type",name:"mcp-server-type",value:s.type,onChange:t=>a({...s,type:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",children:[e.jsx("option",{value:"stdio",children:"stdio (local process)"}),e.jsx("option",{value:"http",children:"HTTP (remote server)"})]})]}),s.type==="stdio"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Command"}),e.jsx("input",{id:"mcp-server-command",name:"mcp-server-command",value:s.command,onChange:t=>a({...s,command:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"npx @modelcontextprotocol/server-xxx"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Arguments (space-separated)"}),e.jsx("input",{id:"mcp-server-args",name:"mcp-server-args",value:s.args,onChange:t=>a({...s,args:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"--port 3000"})]})]}):e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Server URL"}),e.jsx("input",{id:"mcp-server-url",name:"mcp-server-url",value:s.url,onChange:t=>a({...s,url:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"http://localhost:3000/mcp"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:C,disabled:!s.id||!s.name,className:"px-4 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] disabled:opacity-40 transition-colors",children:"Add Server"}),e.jsx("button",{onClick:()=>c(!1),className:"px-4 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:"Cancel"})]})]}),f?e.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading MCP servers..."}):n.length===0?e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-8 text-center",children:[e.jsx(h,{className:"w-10 h-10 text-[var(--text-muted)] mx-auto mb-3"}),e.jsx("p",{className:"text-[var(--text-secondary)] mb-1",children:"No MCP servers configured"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Add an MCP server to connect TITAN to external tools like databases, APIs, and services."})]}):e.jsx("div",{className:"space-y-3",children:n.map(t=>e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:t.type==="stdio"?e.jsx(g,{size:18,className:"text-[var(--text-muted)]"}):e.jsx(k,{size:18,className:"text-[var(--text-muted)]"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-[var(--text)]",children:t.name}),e.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${A(t.status)}`}),e.jsx("span",{className:S(t.status),children:t.status})]}),t.toolCount>0&&e.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--accent)]/10 text-[var(--accent)]",children:[t.toolCount," tools"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:t.description}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-1 font-mono",children:t.type==="stdio"?`${t.command} ${(t.args||[]).join(" ")}`:t.url})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>T(t.id),disabled:v===t.id,title:"Test connection",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--bg-tertiary)] transition-colors disabled:opacity-40",children:e.jsx(G,{size:14,className:v===t.id?"animate-pulse":""})}),e.jsx("button",{onClick:()=>M(t.id,!t.enabled),title:t.enabled?"Disable":"Enable",className:`p-1.5 rounded-md transition-colors hover:bg-[var(--bg-tertiary)] ${t.enabled?"text-[var(--success)]":"text-[var(--text-muted)]"}`,children:e.jsx(B,{size:14})}),e.jsx("button",{onClick:()=>w(t.id),title:"Remove",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--error)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(F,{size:14})})]})]}),(l==null?void 0:l.id)===t.id&&e.jsx("div",{className:`mt-3 px-3 py-2 rounded-md text-xs ${l.ok?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:l.ok?`Connected successfully β€” ${l.tools} tools discovered`:`Connection failed: ${l.error}`})]},t.id))}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)] mb-2",children:"About MCP"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:["Model Context Protocol (MCP) is the universal standard for connecting AI agents to external tools. TITAN acts as both an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"server"})," (exposing its tools to other agents) and an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"client"})," (connecting to external MCP servers). Add any MCP-compatible server and its tools automatically become available in TITAN."]})]})]})}export{J as default};
@@ -1,11 +0,0 @@
1
- import{c as g,r as n,b as h,j as e}from"./index-CahJbWSR.js";import{P as u}from"./PageHeader-BimceqQo.js";import{A as v}from"./arrow-left-DwqHtJiU.js";import{C as w,a as k,d as S}from"./TitanCanvas-C-s0A-lv.js";import"./VoiceOverlay-CmNCrLcd.js";/**
2
- * @license lucide-react v0.513.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const C=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],M=g("link",C);/**
7
- * @license lucide-react v0.513.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const L=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],A=g("tag",L),E={person:"var(--color-accent-hover)",topic:"var(--color-cyan)",project:"var(--color-emerald)",place:"#fbbf24",company:"#facc15",technology:"#2dd4bf",event:"#fb7185"};function d(a){return E[a==null?void 0:a.toLowerCase()]??"#94a3b8"}function b(a){const l=Math.floor((Date.now()-new Date(a).getTime())/1e3);return l<60?"just now":l<3600?`${Math.floor(l/60)}m ago`:l<86400?`${Math.floor(l/3600)}h ago`:`${Math.floor(l/86400)}d ago`}function R(){const[a,l]=n.useState([]),[t,i]=n.useState(null),[f,j]=n.useState(!0),[c,y]=n.useState(""),[o,N]=n.useState(""),x=n.useCallback(async()=>{try{const s=new URLSearchParams;c&&s.set("q",c),o&&s.set("type",o);const r=await h(`/api/wiki/entities?${s}`);r.ok&&l(await r.json())}catch{}finally{j(!1)}},[c,o]),m=async s=>{try{const r=await h(`/api/wiki/entity/${encodeURIComponent(s)}`);r.ok&&i(await r.json())}catch{}};n.useEffect(()=>{x()},[x]);const p=[...new Set(a.map(s=>s.type))].sort();return t?e.jsxs("div",{className:"space-y-4",children:[e.jsx(u,{title:t.name,breadcrumbs:[{label:"Memory"},{label:"Wiki",href:"/memory-wiki"},{label:t.name}],actions:e.jsxs("button",{onClick:()=>i(null),className:"flex items-center gap-1.5 rounded-lg bg-bg-tertiary px-3 py-1.5 text-xs text-text-secondary hover:text-text transition-colors",children:[e.jsx(v,{className:"h-3.5 w-3.5"})," Back to list"]})}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-5",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"h-4 w-4 rounded-full",style:{backgroundColor:d(t.type),boxShadow:`0 0 10px ${d(t.type)}50`}}),e.jsx("h2",{className:"text-xl font-bold text-text",children:t.name}),e.jsx("span",{className:"rounded-md bg-bg-tertiary px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-text-secondary",children:t.type})]}),t.summary&&e.jsx("p",{className:"text-sm text-text-secondary mb-2",children:t.summary}),t.aliases.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[e.jsx(A,{className:"h-3 w-3"})," Also known as: ",t.aliases.join(", ")]}),e.jsxs("div",{className:"flex gap-4 mt-3 text-[10px] text-text-muted",children:[e.jsxs("span",{children:["First seen: ",new Date(t.firstSeen).toLocaleDateString()]}),e.jsxs("span",{children:["Last seen: ",b(t.lastSeen)]})]})]}),t.facts.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted mb-3",children:["Facts (",t.facts.length,")"]}),e.jsx("div",{className:"space-y-2",children:t.facts.map((s,r)=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsx("span",{className:"text-accent mt-0.5",children:"β€’"}),e.jsx("span",{className:"text-text-secondary",children:s})]},r))})]}),t.related.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted mb-3",children:[e.jsx(M,{className:"h-3 w-3 inline mr-1"})," Related (",t.related.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.related.map(s=>e.jsxs("button",{onClick:()=>m(s.name),className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-bg px-3 py-1.5 text-xs hover:border-accent transition-colors",children:[e.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:d(s.type)}}),e.jsx("span",{className:"text-text",children:s.name}),e.jsxs("span",{className:"text-text-muted",children:["(",s.relation,")"]})]},s.id))})]}),t.episodes.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted mb-3",children:[e.jsx(w,{className:"h-3 w-3 inline mr-1"})," Episode History (",t.episodes.length,")"]}),e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:t.episodes.map(s=>e.jsxs("div",{className:"border-l-2 border-border pl-3 py-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-text-muted mb-0.5",children:[e.jsx("span",{children:new Date(s.createdAt).toLocaleString()}),e.jsx("span",{className:"rounded bg-bg-tertiary px-1.5 py-0.5",children:s.source})]}),e.jsx("p",{className:"text-xs text-text-secondary",children:s.content})]},s.id))})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(u,{title:"Memory Wiki",breadcrumbs:[{label:"Memory"},{label:"Wiki"}]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(k,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-text-muted"}),e.jsx("input",{type:"text",value:c,onChange:s=>y(s.target.value),placeholder:"Search entities, facts, summaries...",className:"w-full rounded-lg border border-border bg-bg-secondary py-2 pl-9 pr-4 text-sm text-text placeholder:text-text-muted focus:border-accent focus:outline-none"})]}),e.jsxs("select",{value:o,onChange:s=>N(s.target.value),className:"rounded-lg border border-border bg-bg-secondary px-3 py-2 text-sm text-text-secondary focus:border-accent focus:outline-none",children:[e.jsx("option",{value:"",children:"All types"}),p.map(s=>e.jsx("option",{value:s,children:s},s))]})]}),e.jsxs("div",{className:"flex gap-3 text-xs text-text-muted",children:[e.jsxs("span",{children:[a.length," entities"]}),e.jsx("span",{children:"β€’"}),e.jsxs("span",{children:[p.length," types"]})]}),f?e.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:9}).map((s,r)=>e.jsx("div",{className:"h-24 animate-pulse rounded-xl border border-border bg-bg-secondary"},r))}):e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[a.map(s=>e.jsxs("button",{onClick:()=>m(s.name),className:"rounded-xl border border-border bg-bg-secondary p-4 text-left hover:border-accent transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:d(s.type)}}),e.jsx("span",{className:"font-medium text-sm text-text truncate",children:s.name})]}),e.jsx("p",{className:"text-xs text-text-secondary line-clamp-2 mb-2",children:s.summary||"No summary"}),e.jsxs("div",{className:"flex items-center justify-between text-[10px] text-text-muted",children:[e.jsx("span",{className:"capitalize",children:s.type}),e.jsxs("span",{children:[s.factCount," facts"]}),e.jsx("span",{children:b(s.lastSeen)})]})]},s.id)),a.length===0&&e.jsxs("div",{className:"col-span-full py-12 text-center",children:[e.jsx(S,{className:"h-8 w-8 text-text-muted mx-auto mb-2"}),e.jsx("p",{className:"text-text-muted",children:"No entities found"})]})]})]})}export{R as default};
@@ -1 +0,0 @@
1
- import{r as o,b as y,j as e,C as K,e as U,Z as O,A as B,d as E,K as G,$ as T}from"./index-CahJbWSR.js";import{R as D,c as L,E as V,a as $,i as M}from"./TitanCanvas-C-s0A-lv.js";import{C as F}from"./circle-check-big-DZRE_MbN.js";import{E as H}from"./eye-off-CkgfFYhm.js";import"./VoiceOverlay-CmNCrLcd.js";const _={enabled:!1,apiKey:"",cuopt:{enabled:!1,url:"http://localhost:5000"},asr:{enabled:!1,grpcUrl:"localhost:50051",healthUrl:"http://localhost:9000"},openshell:{enabled:!1,binaryPath:"openshell",policyPath:""}};function v({status:s}){const l={unknown:"bg-border-light",checking:"bg-[#eab308] animate-pulse",healthy:"bg-success",unhealthy:"bg-error"},d={unknown:"Not checked",checking:"Checking...",healthy:"Healthy",unhealthy:"Unreachable"};return e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-text-muted",children:[e.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l[s]}`}),d[s]]})}function f({title:s,description:l,icon:d,enabled:r,onToggle:h,children:p}){return e.jsxs("div",{className:`rounded-xl border bg-bg-secondary transition-colors ${r?"border-[#76b900]/30":"border-bg-tertiary"}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`flex h-9 w-9 items-center justify-center rounded-lg ${r?"bg-nvidia/15":"bg-bg-tertiary"}`,children:e.jsx(d,{className:`h-4.5 w-4.5 ${r?"text-nvidia":"text-text-muted"}`})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:s}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:l})]})]}),e.jsx("button",{onClick:h,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${r?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${r?"translate-x-6":"translate-x-1"}`})})]}),r&&e.jsx("div",{className:"border-t border-bg-tertiary px-5 py-4 space-y-3",children:p})]})}function u({id:s,label:l,value:d,onChange:r,placeholder:h,type:p="text",secret:x=!1}){const[m,b]=o.useState(!1);return e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:l}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:s,name:s,type:x&&!m?"password":p,value:d,onChange:n=>r(n.target.value),placeholder:h,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-[#76b900] transition-colors"}),x&&e.jsx("button",{type:"button",onClick:()=>b(!m),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:m?e.jsx(H,{className:"h-4 w-4"}):e.jsx(M,{className:"h-4 w-4"})})]})]})}function X(){const[s,l]=o.useState(_),[d,r]=o.useState(!0),[h,p]=o.useState(!1),[x,m]=o.useState(null),[b,n]=o.useState({cuopt:"unknown",asr:"unknown",nim:"unknown"}),[g,j]=o.useState(!1),N=o.useCallback((t,a)=>{m({type:t,message:a}),setTimeout(()=>m(null),3e3)},[]);o.useEffect(()=>{(async()=>{var a,c,w,k,S,A,I,C;try{const i=await G();i.nvidia&&(l({enabled:i.nvidia.enabled??!1,apiKey:"",cuopt:{enabled:((a=i.nvidia.cuopt)==null?void 0:a.enabled)??!1,url:((c=i.nvidia.cuopt)==null?void 0:c.url)??"http://localhost:5000"},asr:{enabled:((w=i.nvidia.asr)==null?void 0:w.enabled)??!1,grpcUrl:((k=i.nvidia.asr)==null?void 0:k.grpcUrl)??"localhost:50051",healthUrl:((S=i.nvidia.asr)==null?void 0:S.healthUrl)??"http://localhost:9000"},openshell:{enabled:((A=i.nvidia.openshell)==null?void 0:A.enabled)??!1,binaryPath:((I=i.nvidia.openshell)==null?void 0:I.binaryPath)??"openshell",policyPath:((C=i.nvidia.openshell)==null?void 0:C.policyPath)??""}}),j(i.nvidia.apiKeySet??!1))}catch{}finally{r(!1)}})()},[]);const P=o.useCallback(async()=>{if(s.cuopt.enabled){n(t=>({...t,cuopt:"checking"}));try{const a=await(await y("/api/nvidia/health/cuopt")).json();n(c=>({...c,cuopt:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,cuopt:"unhealthy"}))}}if(s.asr.enabled){n(t=>({...t,asr:"checking"}));try{const a=await(await y("/api/nvidia/health/asr")).json();n(c=>({...c,asr:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,asr:"unhealthy"}))}}if(g||s.apiKey){n(t=>({...t,nim:"checking"}));try{const a=await(await y("/api/nvidia/health/nim")).json();n(c=>({...c,nim:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,nim:"unhealthy"}))}}},[s.cuopt.enabled,s.asr.enabled,g,s.apiKey]),R=async()=>{p(!0);try{const t={nvidia:{enabled:s.enabled,cuopt:s.cuopt,asr:s.asr,openshell:s.openshell}};s.apiKey&&(t.nvidia.apiKey=s.apiKey),await T(t),N("success","NVIDIA configuration saved"),s.apiKey&&(j(!0),l(a=>({...a,apiKey:""})))}catch(t){N("error",t instanceof Error?t.message:"Failed to save")}finally{p(!1)}};return d?e.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((t,a)=>e.jsx("div",{className:"h-20 animate-pulse rounded-xl border border-border bg-bg-secondary"},a))}):e.jsxs("div",{className:"space-y-6 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-nvidia/15",children:e.jsx(K,{className:"h-5 w-5 text-nvidia"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-text",children:"NVIDIA"}),e.jsx("p",{className:"text-xs text-text-muted",children:"GPU-accelerated AI services β€” NIM, cuOpt, Nemotron-ASR, OpenShell"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:P,className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary hover:bg-bg-tertiary transition-colors",children:[e.jsx(D,{className:"h-3.5 w-3.5"}),"Check Health"]}),e.jsxs("button",{onClick:R,disabled:h,className:"flex items-center gap-2 rounded-lg bg-nvidia px-4 py-1.5 text-xs font-medium text-black transition-colors hover:bg-nvidia/80 disabled:opacity-50",children:[e.jsx(L,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save"]})]})]}),x&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${x.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[x.type==="success"?e.jsx(F,{className:"h-4 w-4"}):e.jsx(U,{className:"h-4 w-4"}),x.message]}),e.jsx("div",{className:`rounded-xl border p-5 transition-colors ${s.enabled?"border-[#76b900]/30 bg-nvidia/5":"border-bg-tertiary bg-bg-secondary"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-medium text-text",children:"Enable NVIDIA Skills"}),e.jsxs("p",{className:"text-xs text-text-muted mt-0.5",children:["Load NVIDIA GPU-accelerated skills (cuOpt, AI-Q Research, etc.) when TITAN starts. Equivalent to setting ",e.jsx("code",{className:"text-nvidia/70 bg-nvidia/10 px-1 rounded",children:"TITAN_NVIDIA=1"})]})]}),e.jsx("button",{onClick:()=>l(t=>({...t,enabled:!t.enabled})),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${s.enabled?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${s.enabled?"translate-x-6":"translate-x-1"}`})})]})}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(O,{className:"h-4 w-4 text-nvidia"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"NVIDIA NIM API"}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:"Cloud inference for Nemotron 3 Super and other NIM models"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{status:b.nim}),g&&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"}),"Key configured"]})]})]}),e.jsx(u,{id:"nvidia-api-key",label:"API Key",value:s.apiKey,onChange:t=>l(a=>({...a,apiKey:t})),placeholder:g?"(configured β€” enter new key to replace)":"nvapi-...",secret:!0}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Get your key at"," ",e.jsxs("a",{href:"https://build.nvidia.com",target:"_blank",rel:"noopener noreferrer",className:"text-nvidia hover:underline inline-flex items-center gap-0.5",children:["build.nvidia.com ",e.jsx(V,{className:"h-2.5 w-2.5"})]})]})]}),e.jsxs(f,{title:"cuOpt Optimization",description:"GPU-accelerated routing, scheduling, and mathematical programming (MILP/LP/QP)",icon:B,enabled:s.cuopt.enabled,onToggle:()=>l(t=>({...t,cuopt:{...t.cuopt,enabled:!t.cuopt.enabled}})),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Service Status"}),e.jsx(v,{status:b.cuopt})]}),e.jsx(u,{id:"nvidia-cuopt-url",label:"cuOpt Server URL",value:s.cuopt.url,onChange:t=>l(a=>({...a,cuopt:{...a.cuopt,url:t}})),placeholder:"http://localhost:5000"}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Start cuOpt: ",e.jsx("code",{className:"bg-bg-tertiary px-1.5 py-0.5 rounded text-text-secondary",children:"docker compose -f docker-compose.nvidia.yml --profile cuopt up -d"})]})]}),e.jsxs(f,{title:"Nemotron-ASR Streaming",description:"NVIDIA speech recognition with 24ms median finalization β€” replaces faster-whisper for voice chat",icon:$,enabled:s.asr.enabled,onToggle:()=>l(t=>({...t,asr:{...t.asr,enabled:!t.asr.enabled}})),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Service Status"}),e.jsx(v,{status:b.asr})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{id:"nvidia-asr-grpc-url",label:"gRPC Address",value:s.asr.grpcUrl,onChange:t=>l(a=>({...a,asr:{...a.asr,grpcUrl:t}})),placeholder:"localhost:50051"}),e.jsx(u,{id:"nvidia-asr-health-url",label:"Health Check URL",value:s.asr.healthUrl,onChange:t=>l(a=>({...a,asr:{...a.asr,healthUrl:t}})),placeholder:"http://localhost:9000"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Start ASR: ",e.jsx("code",{className:"bg-bg-tertiary px-1.5 py-0.5 rounded text-text-secondary",children:"docker compose -f docker-compose.nvidia.yml --profile asr up -d"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["VRAM: ~3-4 GB. Set ",e.jsx("code",{className:"bg-bg-tertiary px-1 rounded text-text-secondary",children:"STT_ENGINE=nemotron-asr"})," in voice agent env."]})]}),e.jsxs(f,{title:"OpenShell Sandbox",description:"NVIDIA secure sandbox runtime for code execution with declarative policy enforcement",icon:E,enabled:s.openshell.enabled,onToggle:()=>l(t=>({...t,openshell:{...t.openshell,enabled:!t.openshell.enabled}})),children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{id:"nvidia-openshell-binary-path",label:"Binary Path",value:s.openshell.binaryPath,onChange:t=>l(a=>({...a,openshell:{...a.openshell,binaryPath:t}})),placeholder:"openshell"}),e.jsx(u,{id:"nvidia-openshell-policy-path",label:"Policy File Path (optional)",value:s.openshell.policyPath,onChange:t=>l(a=>({...a,openshell:{...a.openshell,policyPath:t}})),placeholder:"Auto-detected"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["When enabled, code execution uses OpenShell instead of Docker. Set ",e.jsx("code",{className:"bg-bg-tertiary px-1 rounded text-text-secondary",children:'sandbox.engine: "openshell"'})," in config."]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:"VRAM Budget (RTX 5090, 32 GB)"}),e.jsxs("div",{className:"space-y-2",children:[[{label:"Nemotron 3 Nano 30B",vram:"~24 GB",note:"Full local inference"},{label:"Nemotron 3 Nano 4B",vram:"~3 GB",note:"Lightweight variant"},{label:"Nemotron-ASR",vram:"~3-4 GB",note:"Speech recognition"},{label:"cuOpt",vram:"~2-4 GB",note:"Optimization solver"}].map(({label:t,vram:a,note:c})=>e.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-text",children:t}),e.jsx("span",{className:"text-[10px] text-text-muted ml-2",children:c})]}),e.jsx("span",{className:"text-xs font-mono text-nvidia",children:a})]},t)),e.jsx("div",{className:"border-t border-bg-tertiary pt-2 mt-2",children:e.jsx("p",{className:"text-[10px] text-text-muted",children:"Recommended: Nano 4B + ASR + cuOpt = ~10 GB, leaving room for other models. Or use NIM cloud API for LLM inference (0 GB local)."})})]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-2",children:"Quick Start"}),e.jsxs("div",{className:"space-y-2 text-xs text-text-muted",children:[e.jsx("p",{children:"Start all NVIDIA services:"}),e.jsx("code",{className:"block bg-bg border border-bg-tertiary rounded-lg px-3 py-2 text-text-secondary font-mono text-xs",children:"docker compose -f docker-compose.nvidia.yml --profile all up -d"}),e.jsx("p",{className:"mt-2",children:"Or start individual services:"}),e.jsxs("div",{className:"space-y-1 font-mono text-[10px] text-text-muted",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"cuopt:"})," --profile cuopt"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"asr:"})," --profile asr (includes Riva bridge)"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"voice:"})," --profile voice (ASR + bridge)"]})]})]})]})]})}export{X as default};
@@ -1 +0,0 @@
1
- import{r as t,aX as g,aY as b,j as e,T as d,d as f,aZ as h}from"./index-CahJbWSR.js";import{P as p}from"./PageHeader-BimceqQo.js";import{R as j}from"./TitanCanvas-C-s0A-lv.js";import{C as u}from"./circle-check-big-DZRE_MbN.js";import"./VoiceOverlay-CmNCrLcd.js";function A(){const[n,m]=t.useState([]),[i,o]=t.useState({}),[l,c]=t.useState(!0),r=t.useCallback(async()=>{c(!0);try{const[s,a]=await Promise.all([g(),b()]);m(s.alerts||[]),o(a)}catch{}c(!1)},[]);t.useEffect(()=>{r()},[r]);const x=async s=>{try{await h(s),await r()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(p,{title:"Organism Monitor",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Safety"},{label:"Organism"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:r,disabled:l,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(j,{className:`w-4 h-4 ${l?"animate-spin":""}`})," Refresh"]})}),Object.keys(i).length>0&&e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Object.entries(i).map(([s,a])=>e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b] capitalize",children:s}),e.jsx("div",{className:"text-sm font-semibold text-[#e4e4e7]",children:typeof a=="number"?a.toFixed(2):a})]},s))}),e.jsx("div",{className:"space-y-2",children:n.map(s=>e.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${s.severity==="critical"?"bg-red-950/20 border-red-900/50":s.severity==="warning"?"bg-amber-950/20 border-amber-900/50":"bg-[#0a0a0f] border-[#27272a]"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[s.severity==="critical"?e.jsx(d,{className:"w-4 h-4 text-red-400"}):s.severity==="warning"?e.jsx(d,{className:"w-4 h-4 text-amber-400"}):e.jsx(f,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:s.message}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.source," β€’ ",new Date(s.timestamp).toLocaleString()]})]})]}),!s.acknowledged&&e.jsxs("button",{onClick:()=>x(s.id),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] text-xs hover:bg-[#3f3f46]",children:[e.jsx(u,{className:"w-3.5 h-3.5"})," Ack"]})]},s.id))})]})}export{A as default};
@@ -1 +0,0 @@
1
- import{r as o,j as e,Z as v,A as x,H as f,C as h,aB as g}from"./index-CahJbWSR.js";import{S as a}from"./StatCard-DciE_Iqc.js";import{P as c}from"./PageHeader-BimceqQo.js";import{S as j}from"./SkeletonLoader-atQtpcF5.js";import{C as p,M as b,h as y}from"./TitanCanvas-C-s0A-lv.js";import{L as S}from"./layers-BuGf4FIJ.js";import"./VoiceOverlay-CmNCrLcd.js";function w(t){const s=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);return s>0?`${s}d ${r}h ${i}m`:r>0?`${r}h ${i}m`:`${i}m`}function m(t){const s=t/1024/1024;return s>1024?`${(s/1024).toFixed(1)} GB`:`${s.toFixed(0)} MB`}function L(){const[t,s]=o.useState(null),[r,i]=o.useState(null),[d,u]=o.useState(!0),n=async()=>{try{const l=await g();s(l),i(null)}catch(l){i(l instanceof Error?l.message:"Failed to fetch stats")}finally{u(!1)}};return o.useEffect(()=>{n();const l=setInterval(n,1e4);return()=>clearInterval(l)},[]),d?e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsx(c,{title:"System Overview",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Monitoring"},{label:"Overview"}]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:e.jsx(j,{variant:"metric",count:8})})]}):r?e.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:r}):t?e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsx(c,{title:"System Overview",subtitle:"Real-time system health and metrics",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Monitoring"},{label:"Overview"}]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(a,{title:"Uptime",value:w(t.uptime),icon:e.jsx(p,{className:"h-5 w-5"})}),e.jsx(a,{title:"Total Requests",value:t.totalRequests.toLocaleString(),icon:e.jsx(v,{className:"h-5 w-5"})}),e.jsx(a,{title:"Active Agents",value:t.activeAgents,icon:e.jsx(x,{className:"h-5 w-5"})}),e.jsx(a,{title:"Active Sessions",value:t.activeSessions,icon:e.jsx(b,{className:"h-5 w-5"})}),e.jsx(a,{title:"Memory Usage",value:m(t.memoryUsage.heapUsed),icon:e.jsx(f,{className:"h-5 w-5"}),subtitle:`${m(t.memoryUsage.heapTotal)} total`}),e.jsx(a,{title:"Model",value:t.model,icon:e.jsx(h,{className:"h-5 w-5"})}),e.jsx(a,{title:"Provider",value:t.provider,icon:e.jsx(y,{className:"h-5 w-5"})}),e.jsx(a,{title:"Version",value:t.version,icon:e.jsx(S,{className:"h-5 w-5"})})]})]}):null}export{L as default};
@@ -1 +0,0 @@
1
- import{r as t,b0 as m,j as e,b1 as d,b2 as p}from"./index-CahJbWSR.js";import{P as x}from"./PageHeader-BimceqQo.js";import{R as u,p as f,q as h}from"./TitanCanvas-C-s0A-lv.js";import{P as b}from"./play-CcJ9BnCh.js";import{S as g}from"./square-DJpUhlxi.js";import"./VoiceOverlay-CmNCrLcd.js";function S(){const[a,n]=t.useState(null),[r,l]=t.useState(!0),s=t.useCallback(async()=>{l(!0);try{const o=await m();n(o)}catch{}l(!1)},[]);t.useEffect(()=>{s()},[s]);const i=async()=>{try{await d(),await s()}catch{}},c=async()=>{try{await p(),await s()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{title:"Paperclip",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Paperclip"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:s,disabled:r,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(u,{className:`w-4 h-4 ${r?"animate-spin":""}`})," Refresh"]})}),a&&e.jsxs("div",{className:"p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(f,{className:`w-4 h-4 ${a.running?"text-emerald-400":"text-[#52525b]"}`}),e.jsx("span",{className:"text-sm font-medium text-[#e4e4e7]",children:a.running?"Running":"Stopped"}),a.pid&&e.jsxs("span",{className:"text-xs text-[#52525b]",children:["PID ",a.pid]})]}),a.url&&e.jsx("div",{className:"text-xs text-[#52525b] mb-3",children:a.url}),e.jsxs("div",{className:"flex gap-2",children:[!a.running&&e.jsxs("button",{onClick:i,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#6366f1] text-white text-sm font-medium hover:bg-[#4f46e5]",children:[e.jsx(b,{className:"w-4 h-4"})," Start"]}),a.running&&e.jsxs("button",{onClick:c,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700",children:[e.jsx(g,{className:"w-4 h-4"})," Stop"]}),e.jsxs("button",{onClick:s,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46]",children:[e.jsx(h,{className:"w-4 h-4"})," Reset"]})]})]})]})}export{S as default};
@@ -1 +0,0 @@
1
- import{r as a,aM as p,j as e,aN as h,aO as f}from"./index-CahJbWSR.js";import{P as u}from"./PageHeader-BimceqQo.js";import{R as b,d as g}from"./TitanCanvas-C-s0A-lv.js";import{P as j}from"./play-CcJ9BnCh.js";import{T as N}from"./trash-2-CK7yQ55V.js";import"./VoiceOverlay-CmNCrLcd.js";function P(){const[d,o]=a.useState([]),[i,n]=a.useState(!0),[c,l]=a.useState(null),t=a.useCallback(async()=>{n(!0);try{const s=await p();o(s.recipes||[])}catch{}n(!1)},[]);a.useEffect(()=>{t()},[t]);const m=async s=>{l(s);try{await h(s)}catch{}l(null)},x=async s=>{if(confirm("Delete this recipe?"))try{await f(s),await t()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(u,{title:"Recipe Kitchen",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Recipes"}]}),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(b,{className:`w-4 h-4 ${i?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:d.map(s=>{var r;return 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 min-w-0",children:[e.jsx(g,{className:"w-4 h-4 text-[#6366f1] shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm text-[#e4e4e7] truncate",children:s.name}),e.jsx("div",{className:"text-xs text-[#52525b] truncate",children:s.description}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.steps.length," steps β€’ ",(r=s.tags)==null?void 0:r.join(", ")]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("button",{onClick:()=>m(s.id),disabled:c===s.id,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#6366f1] text-white text-xs hover:bg-[#4f46e5] disabled:opacity-50",children:[e.jsx(j,{className:"w-3.5 h-3.5"})," ",c===s.id?"Running...":"Run"]}),e.jsx("button",{onClick:()=>x(s.id),className:"p-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] hover:bg-[#3f3f46] hover:text-red-400",children:e.jsx(N,{className:"w-3.5 h-3.5"})})]})]},s.id)})})]})}export{P as default};
@@ -1 +0,0 @@
1
- import{r as t,b as n,j as e}from"./index-CahJbWSR.js";import{P as i}from"./PageHeader-BimceqQo.js";import"./VoiceOverlay-CmNCrLcd.js";function b(){const[a,d]=t.useState(null),[o,l]=t.useState(!0);if(t.useEffect(()=>{n("/api/config",{headers:{"Content-Type":"application/json"}}).then(s=>s.json()).then(s=>d(s.security||{})).catch(()=>d({})).finally(()=>l(!1))},[]),o)return e.jsx("div",{className:"text-[var(--text-muted)]",children:"Loading security config..."});const r=a||{};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(i,{title:"Security",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Settings"},{label:"Security"}]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Sandbox Mode"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:String(r.sandboxMode||"none")})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Shield"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:r.shield?"Enabled":"Disabled"})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Denied Tools"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:Array.isArray(r.deniedTools)?r.deniedTools.length:0})]})]}),Array.isArray(r.deniedTools)&&r.deniedTools.length>0&&e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("h2",{className:"text-sm font-medium text-[var(--text-secondary)] mb-2",children:"Denied Tools"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.deniedTools.map(s=>e.jsx("span",{className:"px-2 py-1 text-xs rounded bg-red-500/10 text-red-400 border border-red-500/20",children:s},s))})]})]})}export{b as default};
@@ -1 +0,0 @@
1
- import{r as a,K as Je,b as p,j as e,A as he,e as We,C as Ge,Z as be,h as Ve,$ as He}from"./index-CahJbWSR.js";import{e as Ke,R as k,C as Pe,W as Ue,B as Ze,f as ge,T as ze,g as Xe}from"./TitanCanvas-C-s0A-lv.js";import{C as je}from"./circle-check-big-DZRE_MbN.js";import{T as Ye}from"./trophy-uQv_NgDB.js";import{T as fe}from"./trending-up-DGjFyubC.js";import{a as I,C as Q}from"./VoiceOverlay-CmNCrLcd.js";import{P as ye}from"./play-CcJ9BnCh.js";import{T as et}from"./trash-2-CK7yQ55V.js";const D={prompts:"System Prompts","tool-selection":"Tool Selection","response-quality":"Response Quality","error-recovery":"Error Recovery"},J=[{label:"Once daily (2am)",value:["0 2 * * *"]},{label:"Twice daily (2am + 2pm)",value:["0 2 * * *","0 14 * * *"]},{label:"Three times (2am + 10am + 6pm)",value:["0 2 * * *","0 10 * * *","0 18 * * *"]}];function Ne({status:j}){const B={running:"bg-info/10 text-info",completed:"bg-success/10 text-success",failed:"bg-error/10 text-error",training:"bg-warning/10 text-warning",deployed:"bg-purple/10 text-purple"},f={running:"bg-info",completed:"bg-success",failed:"bg-error",training:"bg-warning",deployed:"bg-purple"};return e.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${B[j]||"bg-border-light/20 text-text-muted"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${f[j]||"bg-border-light"}`}),j]})}function ct(){var me,ue;const[j,B]=a.useState(null),[f,ve]=a.useState([]),[W,we]=a.useState([]),[h,Se]=a.useState([]),[r,ke]=a.useState(null),[Ce,Re]=a.useState(!0),[C,G]=a.useState(null),[R,V]=a.useState(null),[A,_e]=a.useState(!1),[N,Te]=a.useState(!0),[i,H]=a.useState("tool_router"),[E,Me]=a.useState(!1),[u,v]=a.useState({baseModel:"unsloth/Qwen2.5-32B-bnb-4bit",loraRank:32,learningRate:1e-4,epochs:2,timeBudgetMin:60,maxSeqLength:2048}),[b,$e]=a.useState([]),[x,De]=a.useState(null),[K,P]=a.useState(!1),[U,Z]=a.useState(!1),[z,X]=a.useState(!1),[g,Y]=a.useState([]),[S,Be]=a.useState(!0),[Ae,_]=a.useState(!1),L=a.useRef(null),O=a.useRef(null),ee=a.useRef(null),[F,te]=a.useState(1),[T,se]=a.useState(30),[q,ae]=a.useState(120),[M,re]=a.useState(!1),[$,ne]=a.useState(!1),[le,ie]=a.useState([]),[xe,ce]=a.useState(0),m=a.useCallback((t,s)=>{V({type:t,message:s}),setTimeout(()=>V(null),3e3)},[]),y=a.useCallback(async()=>{try{const s=(await Je()).selfImprove||{};B(s),te(s.runsPerDay||1),se(s.budgetMinutes||30),ae(s.maxDailyBudgetMinutes||120),re(s.autoApply||!1),ne(s.pauseOnWeekends||!1),ie(s.areas||["prompts","tool-selection","response-quality","error-recovery"]);const c=s.schedule||["0 2 * * *"],o=J.findIndex(n=>JSON.stringify(n.value)===JSON.stringify(c));ce(o>=0?o:0);try{const n=await p("/api/self-improve/history");if(n.ok){const d=await n.json();ve(d.sessions||[])}}catch{}try{const n=await p("/api/training/runs");if(n.ok){const d=await n.json();we(d.runs||[])}}catch{}try{const[n,d]=await Promise.all([p("/api/autoresearch/results"),p("/api/autoresearch/performance")]);if(n.ok){const l=await n.json();Se(l.runs||[])}if(d.ok){const l=await d.json();ke(l)}}catch{}try{const[n,d]=await Promise.all([p("/api/autoresearch/results?type=agent"),p("/api/autoresearch/performance?type=agent")]);if(n.ok){const l=await n.json();$e(l.runs||[])}if(d.ok){const l=await d.json();De(l)}}catch{}}catch{}finally{Re(!1)}},[]);a.useEffect(()=>{y()},[y]),a.useEffect(()=>(N&&(L.current=setInterval(y,1e4)),()=>{L.current&&clearInterval(L.current)}),[N,y]),a.useEffect(()=>{const t=new EventSource("/api/training/stream");return ee.current=t,t.onopen=()=>_(!0),t.onerror=()=>_(!1),t.onmessage=s=>{try{const c=JSON.parse(s.data);if(c.type==="connected"){_(!0);return}Y(o=>{const n=[...o,c];return n.length>200?n.slice(-200):n})}catch{}},()=>{t.close(),ee.current=null,_(!1)}},[]),a.useEffect(()=>{O.current&&S&&O.current.scrollIntoView({behavior:"smooth"})},[g,S]);const Ee=a.useCallback(async()=>{try{await p("/api/training/progress",{method:"DELETE"}),Y([])}catch{}},[]),Le=async()=>{var t;try{await He({selfImprove:{runsPerDay:F,budgetMinutes:T,maxDailyBudgetMinutes:q,autoApply:M,pauseOnWeekends:$,areas:le,schedule:((t=J[xe])==null?void 0:t.value)||["0 2 * * *"]}}),m("success","Self-improvement settings saved"),await y()}catch(s){m("error",s instanceof Error?s.message:"Failed to save")}},de=async t=>{G(t);try{(await p("/api/message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:`Run a self-improvement experiment on ${t} using self_improve_start with area="${t}" and budgetMinutes=${T}`,sessionId:"self-improve"})})).ok?(m("success",`Self-improvement started for ${D[t]||t}`),setTimeout(y,2e3)):m("error","Failed to start self-improvement")}catch(s){m("error",s instanceof Error?s.message:"Failed to start")}finally{G(null)}},Oe=t=>{ie(s=>s.includes(t)?s.filter(c=>c!==t):[...s,t])},Fe=async()=>{P(!0);try{(await p("/api/autoresearch/generate-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:i})})).ok?m("success",`Training data generation started for ${i==="main_agent"?"Main Agent":"Tool Router"}`):m("error","Failed to start data generation")}catch(t){m("error",t instanceof Error?t.message:"Failed")}finally{P(!1)}},qe=async()=>{Z(!0);try{(await p("/api/autoresearch/trigger",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:i,config:u})})).ok?m("success",`Training started for ${i==="main_agent"?"Main Agent":"Tool Router"}`):m("error","Failed to start training")}catch(t){m("error",t instanceof Error?t.message:"Failed")}finally{Z(!1)}},Ie=async()=>{X(!0);try{(await p("/api/autoresearch/deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:i})})).ok?m("success",`Model deployed as ${i==="main_agent"?"titan-agent":"titan-qwen"}`):m("error","Failed to deploy model")}catch(t){m("error",t instanceof Error?t.message:"Failed")}finally{X(!1)}};if(Ce)return e.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((t,s)=>e.jsx("div",{className:"h-20 animate-pulse rounded-xl border border-border bg-bg-secondary"},s))});const w=f.length,oe=w>0?(f.reduce((t,s)=>t+(s.bestScore-s.baselineScore),0)/w).toFixed(1):"0",Qe=w>0?(f.filter(t=>t.bestScore>t.baselineScore).length/w*100).toFixed(0):"0";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-purple/10",children:e.jsx(Ke,{className:"h-4 w-4 text-purple-light"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-text",children:"Self-Improvement"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Autonomous optimization of prompts, tool selection, and response quality"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>Te(!N),className:`flex items-center gap-1.5 rounded-lg border px-3 py-1.5 text-xs transition-colors ${N?"border-success/30 text-success bg-success/5":"border-border text-text-muted hover:bg-bg-tertiary"}`,children:[e.jsx(he,{className:`h-3.5 w-3.5 ${N?"animate-pulse":""}`}),N?"Live":"Paused"]}),e.jsxs("button",{onClick:y,className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary transition-colors hover:bg-bg-tertiary",children:[e.jsx(k,{className:"h-3.5 w-3.5"}),"Refresh"]})]})]}),R&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${R.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[R.type==="success"?e.jsx(je,{className:"h-4 w-4"}):e.jsx(We,{className:"h-4 w-4"}),R.message]}),e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Pe,{className:"h-3.5 w-3.5 text-text-muted"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Total Sessions"})]}),e.jsx("p",{className:"text-2xl font-bold text-text",children:w+((r==null?void 0:r.totalRuns)||0)}),r&&r.totalRuns>0&&e.jsxs("p",{className:"text-[10px] text-text-muted mt-0.5",children:[w," self-improve + ",r.totalRuns," autoresearch"]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Ye,{className:"h-3.5 w-3.5 text-warning"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Best Val Score"})]}),e.jsx("p",{className:"text-2xl font-bold text-warning",children:(r==null?void 0:r.bestScore)||"β€”"}),r&&r.baseline>0&&(()=>{const t=r.bestScore-r.baseline,s=t>=0?"+":"",c=t>=0?"text-success":"text-error";return e.jsxs("p",{className:`text-[10px] mt-0.5 ${c}`,children:[s,t.toFixed(1)," from ",r.baseline," baseline"]})})()]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(fe,{className:"h-3.5 w-3.5 text-success"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Success Rate"})]}),e.jsxs("p",{className:"text-2xl font-bold text-info",children:[Qe,"%"]}),e.jsxs("p",{className:"text-[10px] text-text-muted mt-0.5",children:["avg improvement: ",Number(oe)>=0?"+":"",oe]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Ge,{className:"h-3.5 w-3.5 text-purple"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Deployed Model"})]}),e.jsx("p",{className:"text-lg font-bold text-purple",children:"titan-qwen"}),e.jsxs("p",{className:"text-[10px] text-text-muted mt-0.5",children:["Q4_K_M β€’ 19GB β€’ ",(j==null?void 0:j.enabled)!==!1?"🟒 Active":"⚫ Off"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Model Training"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[e.jsxs("button",{onClick:()=>H("tool_router"),className:`rounded-xl border p-4 text-left transition-all ${i==="tool_router"?"border-purple bg-purple/5 ring-1 ring-purple/20":"border-bg-tertiary bg-bg-secondary hover:border-border"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-lg ${i==="tool_router"?"bg-purple/20":"bg-bg-tertiary"}`,children:e.jsx(Ue,{className:`h-3.5 w-3.5 ${i==="tool_router"?"text-purple-light":"text-text-muted"}`})}),e.jsx("span",{className:`text-sm font-medium ${i==="tool_router"?"text-text":"text-text-secondary"}`,children:"Tool Router"})]}),e.jsx("p",{className:"text-xs text-text-muted mb-1",children:"titan-qwen"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-success font-medium",children:["Score: ",(r==null?void 0:r.bestScore)||"β€”"]}),e.jsx("span",{className:"text-[10px] text-text-muted",children:"β€’"}),e.jsx("span",{className:"text-[10px] text-text-muted",children:h.length>0?`${((me=h[h.length-1])==null?void 0:me.num_examples)||0} examples`:"No data"})]}),e.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:"Brain / Tool Selection"})]}),e.jsxs("button",{onClick:()=>H("main_agent"),className:`rounded-xl border p-4 text-left transition-all ${i==="main_agent"?"border-purple bg-purple/5 ring-1 ring-purple/20":"border-bg-tertiary bg-bg-secondary hover:border-border"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-lg ${i==="main_agent"?"bg-purple/20":"bg-bg-tertiary"}`,children:e.jsx(Ze,{className:`h-3.5 w-3.5 ${i==="main_agent"?"text-purple-light":"text-text-muted"}`})}),e.jsx("span",{className:`text-sm font-medium ${i==="main_agent"?"text-text":"text-text-secondary"}`,children:"Main Agent"})]}),e.jsx("p",{className:"text-xs text-text-muted mb-1",children:"titan-agent"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-warning font-medium",children:["Score: ",(x==null?void 0:x.bestScore)||"β€”"]}),e.jsx("span",{className:"text-[10px] text-text-muted",children:"β€’"}),e.jsx("span",{className:"text-[10px] text-text-muted",children:b.length>0?`${((ue=b[b.length-1])==null?void 0:ue.num_examples)||0} examples`:"No data"})]}),e.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:"Primary LLM / Full Agent"})]})]}),e.jsxs("button",{onClick:()=>Me(!E),className:"flex w-full items-center gap-2 text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:[E?e.jsx(I,{className:"h-3.5 w-3.5"}):e.jsx(Q,{className:"h-3.5 w-3.5"}),e.jsx(ge,{className:"h-3.5 w-3.5"}),"Training Configuration"]}),E&&e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5 space-y-4 mb-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Base Model"}),e.jsxs("select",{id:"train-base-model",name:"train-base-model",value:u.baseModel,onChange:t=>v(s=>({...s,baseModel:t.target.value})),className:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none",children:[e.jsx("option",{value:"unsloth/Qwen2.5-32B-bnb-4bit",children:"Qwen 2.5 32B (4-bit)"}),e.jsx("option",{value:"unsloth/Qwen2.5-14B-bnb-4bit",children:"Qwen 2.5 14B (4-bit)"}),e.jsx("option",{value:"unsloth/Qwen2.5-7B-bnb-4bit",children:"Qwen 2.5 7B (4-bit)"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"LoRA Rank"}),e.jsx("span",{className:"text-sm font-medium text-text",children:u.loraRank})]}),e.jsx("input",{id:"train-lora-rank",name:"train-lora-rank",type:"range",min:4,max:64,step:4,value:u.loraRank,onChange:t=>v(s=>({...s,loraRank:Number(t.target.value)})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"4"}),e.jsx("span",{children:"32"}),e.jsx("span",{children:"64"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Learning Rate"}),e.jsx("span",{className:"text-sm font-medium text-text font-mono",children:u.learningRate.toExponential(0)})]}),e.jsx("input",{id:"train-learning-rate",name:"train-learning-rate",type:"range",min:-5,max:-3,step:.5,value:Math.log10(u.learningRate),onChange:t=>v(s=>({...s,learningRate:Math.pow(10,Number(t.target.value))})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"1e-5"}),e.jsx("span",{children:"1e-4"}),e.jsx("span",{children:"1e-3"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Epochs"}),e.jsx("span",{className:"text-sm font-medium text-text",children:u.epochs})]}),e.jsx("input",{id:"train-epochs",name:"train-epochs",type:"range",min:1,max:10,value:u.epochs,onChange:t=>v(s=>({...s,epochs:Number(t.target.value)})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"5"}),e.jsx("span",{children:"10"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Time Budget"}),e.jsxs("span",{className:"text-sm font-medium text-text",children:[u.timeBudgetMin," min"]})]}),e.jsx("input",{id:"train-time-budget",name:"train-time-budget",type:"range",min:5,max:120,step:5,value:u.timeBudgetMin,onChange:t=>v(s=>({...s,timeBudgetMin:Number(t.target.value)})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"5 min"}),e.jsx("span",{children:"60 min"}),e.jsx("span",{children:"120 min"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Max Sequence Length"}),e.jsx("span",{className:"text-sm font-medium text-text",children:u.maxSeqLength})]}),e.jsx("input",{id:"train-max-seq-length",name:"train-max-seq-length",type:"range",min:512,max:4096,step:256,value:u.maxSeqLength,onChange:t=>v(s=>({...s,maxSeqLength:Number(t.target.value)})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"512"}),e.jsx("span",{children:"2048"}),e.jsx("span",{children:"4096"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{onClick:Fe,disabled:K,className:"flex items-center justify-center gap-2 rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 text-xs font-medium text-text transition-colors hover:border-purple/50 hover:bg-bg-secondary disabled:opacity-50",children:[K?e.jsx(k,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(be,{className:"h-3.5 w-3.5 text-warning"}),"Generate Training Data"]}),e.jsxs("button",{onClick:qe,disabled:U,className:"flex items-center justify-center gap-2 rounded-xl bg-purple px-4 py-3 text-xs font-medium text-white transition-colors hover:bg-purple/80 disabled:opacity-50",children:[U?e.jsx(k,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ye,{className:"h-3.5 w-3.5"}),"Start Training"]}),e.jsxs("button",{onClick:Ie,disabled:z,className:"flex items-center justify-center gap-2 rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 text-xs font-medium text-text transition-colors hover:border-success/50 hover:bg-bg-secondary disabled:opacity-50",children:[z?e.jsx(k,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(je,{className:"h-3.5 w-3.5 text-success"}),"Deploy Best Model"]}),e.jsxs("button",{onClick:()=>de(i==="main_agent"?"agent-benchmark":"tool-benchmark"),disabled:C!==null,className:"flex items-center justify-center gap-2 rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 text-xs font-medium text-text transition-colors hover:border-[#3b82f6]/50 hover:bg-bg-secondary disabled:opacity-50",children:[e.jsx(fe,{className:"h-3.5 w-3.5 text-info"}),"Run Benchmark"]})]})]}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>Be(!S),className:"flex w-full items-center gap-2 text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:[S?e.jsx(I,{className:"h-3.5 w-3.5"}):e.jsx(Q,{className:"h-3.5 w-3.5"}),e.jsx(ze,{className:"h-3.5 w-3.5"}),"Live Training Activity",e.jsxs("span",{className:"ml-auto flex items-center gap-1.5",children:[Ae?e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-success",children:[e.jsx(Xe,{className:"h-3 w-3 animate-pulse"})," Connected"]}):e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-error",children:[e.jsx(Ve,{className:"h-3 w-3"})," Disconnected"]}),g.length>0&&e.jsx("span",{className:"rounded-full bg-purple/20 px-1.5 py-0.5 text-[10px] text-purple-light",children:g.length})]})]}),S&&e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg overflow-hidden",children:[g.length>0&&(()=>{var c,o,n;const t=[...g].reverse().find(d=>{var l;return((l=d.detail)==null?void 0:l.pct)!==void 0});if(!t||t.type==="complete")return null;const s=((c=t.detail)==null?void 0:c.pct)||0;return e.jsxs("div",{className:"border-b border-bg-tertiary px-4 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:t.message}),e.jsxs("span",{className:"text-xs font-medium text-purple",children:[s,"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-bg-tertiary overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-purple to-accent transition-all duration-500",style:{width:`${s}%`}})}),((o=t.detail)==null?void 0:o.current)!==void 0&&((n=t.detail)==null?void 0:n.total)!==void 0&&e.jsxs("div",{className:"flex items-center justify-between mt-1",children:[e.jsxs("span",{className:"text-[10px] text-text-muted",children:[t.detail.current," / ",t.detail.total," examples"]}),t.detail.category&&e.jsxs("span",{className:"text-[10px] text-text-muted",children:["Category: ",t.detail.category]})]})]})})(),e.jsxs("div",{className:"max-h-64 overflow-y-auto p-3 font-mono text-[11px] leading-5 scrollbar-thin",children:[g.length===0?e.jsxs("div",{className:"flex items-center justify-center py-8 text-text-muted",children:[e.jsx(he,{className:"h-4 w-4 mr-2"}),e.jsx("span",{children:"No training activity yet. Start training to see live progress."})]}):g.map((t,s)=>{var pe;const c={info:"text-info",progress:"text-purple",success:"text-success",error:"text-error",complete:"text-warning",connected:"text-success"},o={info:"●",progress:"β—†",success:"βœ“",error:"βœ—",complete:"β˜…",connected:"β—‰"},n=c[t.type]||"text-text-muted",d=o[t.type]||"Β·",l=t.timestamp?new Date(t.timestamp).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):"";return e.jsxs("div",{className:"flex items-start gap-2 hover:bg-bg-secondary/50 rounded px-1",children:[e.jsx("span",{className:"text-border shrink-0 select-none",children:l}),e.jsx("span",{className:`shrink-0 ${n}`,children:d}),e.jsxs("span",{className:`${t.type==="error"?"text-error":"text-text-secondary"}`,children:[t.message,((pe=t.detail)==null?void 0:pe.category)&&t.type==="progress"&&e.jsxs("span",{className:"text-text-muted",children:[" [",t.detail.category,"]"]})]})]},s)}),e.jsx("div",{ref:O})]}),g.length>0&&e.jsxs("div",{className:"border-t border-bg-tertiary px-3 py-2 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] text-text-muted",children:[g.filter(t=>t.type==="success"||t.type==="progress").length," successes"," Β· ",g.filter(t=>t.type==="error").length," errors"]}),e.jsxs("button",{onClick:Ee,className:"flex items-center gap-1 text-[10px] text-text-muted hover:text-text-secondary transition-colors",children:[e.jsx(et,{className:"h-3 w-3"}),"Clear"]})]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Run Now"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(D).map(([t,s])=>e.jsxs("button",{onClick:()=>de(t),disabled:C!==null,className:"flex items-center gap-3 rounded-xl border border-bg-tertiary bg-bg-secondary p-4 text-left transition-colors hover:border-purple/50 hover:bg-bg-secondary disabled:opacity-50",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-purple/10",children:C===t?e.jsx(k,{className:"h-4 w-4 text-purple-light animate-spin"}):e.jsx(ye,{className:"h-4 w-4 text-purple-light"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text",children:s}),e.jsx("p",{className:"text-xs text-text-muted",children:C===t?"Running...":"Start experiment"})]})]},t))})]}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>_e(!A),className:"flex w-full items-center gap-2 text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:[A?e.jsx(I,{className:"h-3.5 w-3.5"}):e.jsx(Q,{className:"h-3.5 w-3.5"}),e.jsx(ge,{className:"h-3.5 w-3.5"}),"Schedule Settings"]}),A&&e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-6 space-y-5",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Runs per day"}),e.jsx("span",{className:"text-sm font-medium text-text",children:F})]}),e.jsx("input",{id:"schedule-runs-per-day",name:"schedule-runs-per-day",type:"range",min:1,max:12,value:F,onChange:t=>te(Number(t.target.value)),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"6"}),e.jsx("span",{children:"12"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Schedule"}),e.jsx("select",{id:"schedule-preset",name:"schedule-preset",value:xe,onChange:t=>ce(Number(t.target.value)),className:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none",children:J.map((t,s)=>e.jsx("option",{value:s,children:t.label},s))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Budget per run (minutes)"}),e.jsxs("span",{className:"text-sm font-medium text-text",children:[T," min"]})]}),e.jsx("input",{id:"schedule-budget-minutes",name:"schedule-budget-minutes",type:"range",min:5,max:120,step:5,value:T,onChange:t=>se(Number(t.target.value)),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"5 min"}),e.jsx("span",{children:"60 min"}),e.jsx("span",{children:"120 min"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Max daily budget (minutes)"}),e.jsxs("span",{className:"text-sm font-medium text-text",children:[q," min"]})]}),e.jsx("input",{id:"schedule-max-daily-budget",name:"schedule-max-daily-budget",type:"range",min:30,max:480,step:30,value:q,onChange:t=>ae(Number(t.target.value)),className:"w-full accent-purple"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-xs text-text-muted",children:"Improvement areas"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(D).map(([t,s])=>e.jsx("button",{onClick:()=>Oe(t),className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${le.includes(t)?"bg-purple text-white":"bg-bg-tertiary text-text-muted hover:text-text-secondary"}`,children:s},t))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Auto-apply improvements"}),e.jsx("button",{onClick:()=>re(!M),className:`relative h-5 w-9 rounded-full transition-colors ${M?"bg-purple":"bg-border"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0.5 h-4 w-4 rounded-full bg-white transition-transform ${M?"translate-x-4":""}`})})]}),e.jsxs("label",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Pause on weekends"}),e.jsx("button",{onClick:()=>ne(!$),className:`relative h-5 w-9 rounded-full transition-colors ${$?"bg-purple":"bg-border"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0.5 h-4 w-4 rounded-full bg-white transition-transform ${$?"translate-x-4":""}`})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:Le,className:"flex items-center gap-2 rounded-lg bg-purple px-4 py-2 text-xs font-medium text-white transition-colors hover:bg-purple/80",children:"Save Settings"})})]})]}),f.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Session History"}),e.jsx("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary overflow-hidden",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-bg-tertiary",children:[e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Date"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Area"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Baseline"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Best"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"+Ξ”"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"K/D/C"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Status"})]})}),e.jsx("tbody",{children:f.slice().reverse().slice(0,10).map(t=>{const s=t.bestScore-t.baselineScore;return e.jsxs("tr",{className:"border-b border-bg-tertiary last:border-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-secondary",children:t.startedAt.slice(0,10)}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text",children:D[t.area]||t.area}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.baselineScore}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text font-medium",children:t.bestScore}),e.jsxs("td",{className:`px-4 py-2.5 text-xs font-medium ${s>0?"text-success":"text-text-muted"}`,children:[s>0?"+":"",s]}),e.jsxs("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:[t.keeps,"/",t.discards,"/",t.crashes]}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx(Ne,{status:t.applied?"deployed":t.status})})]},t.id)})})]})})]}),W.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Model Training"}),e.jsx("div",{className:"space-y-2",children:W.slice().reverse().slice(0,5).map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(be,{className:"h-4 w-4 text-warning"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text",children:t.id}),e.jsxs("p",{className:"text-xs text-text-muted",children:[t.baseModel," β€’ ",t.dataPoints," samples β€’ ",t.method]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[t.finalLoss!==void 0&&e.jsxs("span",{className:"text-xs text-text-muted",children:["loss: ",t.finalLoss.toFixed(4)]}),e.jsx(Ne,{status:t.status})]})]},t.id))})]}),h.length>0&&i==="tool_router"&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Autoresearch Experiments β€” Tool Router"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-bg-tertiary",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Val Score Over Time"}),e.jsxs("span",{className:"text-xs text-success font-medium",children:["Best: ",(r==null?void 0:r.bestScore)||Math.max(...h.map(t=>t.val_score))]})]}),e.jsx("div",{className:"h-16 flex items-end gap-1",children:h.map((t,s)=>{const c=Math.max(...h.map(l=>l.val_score),100),o=Math.min(...h.map(l=>l.val_score),0),n=c-o||1,d=(t.val_score-o)/n*100;return e.jsx("div",{className:"flex-1 rounded-t transition-all hover:opacity-80",style:{height:`${Math.max(d,4)}%`,backgroundColor:(r==null?void 0:r.baseline)!=null?t.val_score>=r.baseline?"var(--color-success)":"var(--color-error)":"var(--color-purple)"},title:`Run ${s+1}: ${t.val_score} (${new Date(t.timestamp).toLocaleDateString()})`},s)})}),e.jsxs("div",{className:"relative mt-1",children:[e.jsx("div",{className:"border-t border-dashed border-border-light/50 absolute w-full"}),e.jsx("span",{className:"text-[9px] text-text-muted relative -top-2",children:(r==null?void 0:r.baseline)!=null?`baseline: ${r.baseline}`:"baseline: β€”"})]})]}),e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-bg-tertiary",children:[e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"#"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Date"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Score"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"LR"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Rank"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Epochs"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Examples"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Duration"})]})}),e.jsx("tbody",{children:h.slice().reverse().slice(0,20).map((t,s)=>e.jsxs("tr",{className:"border-b border-bg-tertiary last:border-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:h.length-s}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-secondary",children:new Date(t.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),e.jsx("td",{className:`px-4 py-2.5 text-xs font-bold ${t.val_score>=((r==null?void 0:r.baseline)||78)?"text-success":"text-error"}`,children:t.val_score}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted font-mono",children:t.hyperparams.lr}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.hyperparams.rank}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.hyperparams.epochs}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.num_examples}),e.jsxs("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:[Math.round(t.training_time_s/60),"m ",Math.round(t.training_time_s%60),"s"]})]},s))})]})]})]}),b.length>0&&i==="main_agent"&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Autoresearch Experiments β€” Main Agent"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-bg-tertiary",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Val Score Over Time"}),e.jsxs("span",{className:"text-xs text-warning font-medium",children:["Best: ",(x==null?void 0:x.bestScore)||Math.max(...b.map(t=>t.val_score))]})]}),e.jsx("div",{className:"h-16 flex items-end gap-1",children:b.map((t,s)=>{const c=Math.max(...b.map(l=>l.val_score),100),o=Math.min(...b.map(l=>l.val_score),0),n=c-o||1,d=(t.val_score-o)/n*100;return e.jsx("div",{className:"flex-1 rounded-t transition-all hover:opacity-80",style:{height:`${Math.max(d,4)}%`,backgroundColor:(x==null?void 0:x.baseline)!=null?t.val_score>=x.baseline?"var(--color-warning)":"var(--color-error)":"var(--color-purple)"},title:`Run ${s+1}: ${t.val_score} (${new Date(t.timestamp).toLocaleDateString()})`},s)})}),e.jsxs("div",{className:"relative mt-1",children:[e.jsx("div",{className:"border-t border-dashed border-border-light/50 absolute w-full"}),e.jsx("span",{className:"text-[9px] text-text-muted relative -top-2",children:(x==null?void 0:x.baseline)!=null?`baseline: ${x.baseline}`:"baseline: β€”"})]})]}),e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-bg-tertiary",children:[e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"#"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Date"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Score"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"LR"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Rank"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Epochs"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Examples"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Duration"})]})}),e.jsx("tbody",{children:b.slice().reverse().slice(0,20).map((t,s)=>e.jsxs("tr",{className:"border-b border-bg-tertiary last:border-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:b.length-s}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-secondary",children:new Date(t.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),e.jsx("td",{className:`px-4 py-2.5 text-xs font-bold ${t.val_score>=((x==null?void 0:x.baseline)||70)?"text-warning":"text-error"}`,children:t.val_score}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted font-mono",children:t.hyperparams.lr}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.hyperparams.rank}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.hyperparams.epochs}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.num_examples}),e.jsxs("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:[Math.round(t.training_time_s/60),"m ",Math.round(t.training_time_s%60),"s"]})]},s))})]})]})]})]})}export{ct as default};
@@ -1 +0,0 @@
1
- import{r as a,j as s,X as k,aC as C,aD as M,aE as L,aF as E}from"./index-CahJbWSR.js";import{P as D}from"./PageHeader-BimceqQo.js";import"./Input-GTHp2Rkr.js";import{D as F}from"./DataTable-B2Ma8hfi.js";import{I as P}from"./InlineEditableField-CnvF-yFR.js";import{a as A}from"./TitanCanvas-C-s0A-lv.js";import{T as I}from"./trash-2-CK7yQ55V.js";import"./VoiceOverlay-CmNCrLcd.js";function z(){const[p,g]=a.useState([]),[b,f]=a.useState(!0),[c,n]=a.useState(null),[o,y]=a.useState(""),[l,i]=a.useState(null),[m,r]=a.useState([]),[j,x]=a.useState(!1),d=async()=>{try{const e=await C();g(e),n(null)}catch(e){n(e instanceof Error?e.message:"Failed to fetch sessions")}finally{f(!1)}};a.useEffect(()=>{d()},[]);const N=async e=>{i(e.id),x(!0);try{const t=await M(e.id);r(t)}catch{r([])}finally{x(!1)}},w=async e=>{try{await E(e),l===e&&(i(null),r([])),await d()}catch(t){n(t instanceof Error?t.message:"Failed to delete session")}},S=p.filter(e=>{var u,h;if(!o)return!0;const t=o.toLowerCase();return e.id.toLowerCase().includes(t)||((u=e.name)==null?void 0:u.toLowerCase().includes(t))||((h=e.lastMessage)==null?void 0:h.toLowerCase().includes(t))}),v=[{key:"id",header:"ID",render:e=>s.jsxs("span",{className:"font-mono text-xs",children:[e.id.slice(0,12),"..."]})},{key:"name",header:"Name",render:e=>s.jsx("span",{className:"text-sm text-text",children:s.jsx(P,{value:e.name??"",onSave:async t=>{await L(e.id,t),await d()},placeholder:"Session name",emptyLabel:"Untitled",hidePencil:!0})})},{key:"messageCount",header:"Messages"},{key:"lastMessage",header:"Last Message",render:e=>s.jsx("span",{className:"block max-w-xs truncate text-text-secondary",children:e.lastMessage??"-"})},{key:"createdAt",header:"Created",render:e=>s.jsx("span",{children:new Date(e.createdAt).toLocaleString()})},{key:"_actions",header:"",className:"w-16",render:e=>s.jsx("button",{onClick:t=>{t.stopPropagation(),w(e.id)},className:"rounded-md p-1.5 text-error transition-colors hover:bg-bg-tertiary",title:"Delete session",children:s.jsx(I,{className:"h-4 w-4"})})}];return b?s.jsx("div",{className:"h-64 animate-pulse rounded-xl border border-border bg-bg-secondary"}):s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("div",{className:`space-y-4 ${l?"flex-1":"w-full"}`,children:[s.jsx(D,{title:"Sessions",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Monitoring"},{label:"Sessions"}]}),s.jsxs("div",{className:"relative",children:[s.jsx(A,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted"}),s.jsx("input",{value:o,onChange:e=>y(e.target.value),placeholder:"Search sessions...",className:"w-full rounded-lg border border-border bg-bg py-2 pl-10 pr-3 text-sm text-text outline-none focus:border-accent"})]}),c&&s.jsx("div",{className:"rounded-lg border border-error/50 bg-bg-secondary px-4 py-2 text-sm text-error",children:c}),s.jsx(F,{columns:v,data:S,onRowClick:N,emptyMessage:"No sessions found"})]}),l&&s.jsxs("div",{className:"w-96 shrink-0 rounded-xl border border-border bg-bg-secondary",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[s.jsx("h3",{className:"text-sm font-medium text-text",children:"Messages"}),s.jsx("button",{onClick:()=>{i(null),r([])},className:"rounded-md p-1 text-text-muted hover:text-text",children:s.jsx(k,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"max-h-[600px] overflow-y-auto p-4",children:j?s.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((e,t)=>s.jsx("div",{className:"h-12 animate-pulse rounded-lg bg-bg-tertiary"},t))}):m.length===0?s.jsx("p",{className:"text-center text-sm text-text-muted",children:"No messages"}):s.jsx("div",{className:"space-y-3",children:m.map((e,t)=>s.jsxs("div",{className:`rounded-lg p-3 text-sm ${e.role==="user"?"bg-accent/10 text-text":e.role==="assistant"?"bg-bg-tertiary text-text":"bg-bg text-text-secondary"}`,children:[s.jsx("span",{className:"mb-1 block text-xs font-medium uppercase text-text-muted",children:e.role}),s.jsx("p",{className:"whitespace-pre-wrap",children:e.content})]},t))})})]})]})}export{z as default};
@@ -1 +0,0 @@
1
- import{r as a,b as B,J as fe,j as e,e as Z,W as je,K as ee,L as Ne,N as ye,O as we,P as Se,t as ke,Q as Ce,U as te,V as Ve,Y as Te,$ as Le}from"./index-CahJbWSR.js";import"./Input-GTHp2Rkr.js";import{P as Ue}from"./PageHeader-BimceqQo.js";import{H as se}from"./Tooltip-70UK0E2I.js";import{C as Ee}from"./circle-check-big-DZRE_MbN.js";import{M as D}from"./VoiceOverlay-CmNCrLcd.js";import{R as Pe,b as Ae,L as ae,c as Me}from"./TitanCanvas-C-s0A-lv.js";import{D as Ie}from"./download-BxiWJU4G.js";import{P as Fe}from"./play-CcJ9BnCh.js";const I=["ollama","lmstudio","localai"];function $e({ok:o}){return o?e.jsx("div",{className:"h-2 w-2 rounded-full bg-success shadow-[0_0_6px_rgba(34,197,94,0.4)]"}):e.jsx("div",{className:"h-2 w-2 rounded-full bg-border-light"})}function Re({models:o,selectedModel:j,onSelect:N,onSwitch:F,currentModel:m}){const S=m.includes("/")?m.split("/")[0]:"",[h,k]=a.useState(S);a.useEffect(()=>{k(S)},[S]);const u=a.useMemo(()=>[...new Set(o.map(i=>i.provider))].sort((i,d)=>{const n=I.includes(i.toLowerCase()),w=I.includes(d.toLowerCase());return n&&!w?-1:!n&&w?1:i.localeCompare(d)}),[o]),y=a.useMemo(()=>o.filter(c=>c.provider===h),[o,h]),U=c=>{k(c);const i=o.filter(n=>n.provider===c),d=i.find(n=>n.id===m);d?N(d.id):i.length>0&&N(i[0].id)},$=j!==m,g=I.includes(h.toLowerCase());return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx("label",{className:"text-xs text-text-muted",children:"Provider"}),e.jsx(se,{title:"AI Provider",description:"The company or service that hosts the AI model. Local providers (Ollama, LM Studio) run on your machine. Cloud providers (Anthropic, OpenAI) run remotely and require an API key."})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[e.jsx("select",{value:h,onChange:c=>U(c.target.value),className:"w-full rounded-lg border border-border bg-bg px-3 py-2.5 text-sm text-text outline-none transition-colors focus:border-accent min-h-[44px]",children:u.map(c=>{const i=I.includes(c.toLowerCase()),d=o.filter(n=>n.provider===c).length;return e.jsxs("option",{value:c,children:[i?`πŸ’» ${c} (local)`:c," β€” ",d," model",d!==1?"s":""]},c)})}),g&&e.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap rounded bg-success/15 px-2 py-1 text-xs font-medium text-success self-start mt-0.5 sm:self-auto sm:mt-0",children:[e.jsx(ye,{className:"h-3 w-3"})," Local"]}),!g&&h&&e.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap rounded bg-accent/15 px-2 py-1 text-xs font-medium text-accent-hover self-start mt-0.5 sm:self-auto sm:mt-0",children:[e.jsx(we,{className:"h-3 w-3"})," Cloud"]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx("label",{className:"text-xs text-text-muted",children:"Model"}),e.jsx(se,{title:"Model Selection",description:"The specific AI model TITAN uses to think and respond. Larger models are smarter but slower and cost more. You can switch anytime without losing conversation history."})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-2 md:gap-3",children:[e.jsxs("select",{value:j,onChange:c=>N(c.target.value),className:"w-full rounded-lg border border-border bg-bg px-3 py-2.5 text-sm text-text outline-none transition-colors focus:border-accent min-h-[44px]",children:[y.map(c=>e.jsxs("option",{value:c.id,disabled:!c.available,children:[c.name,c.id===m?" (active)":"",c.available?"":" β€” unavailable"]},c.id)),y.length===0&&e.jsx("option",{disabled:!0,children:"No models for this provider"})]}),e.jsx("button",{onClick:F,disabled:!$,className:"rounded-lg bg-accent px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50 min-h-[44px] w-full sm:w-auto active:scale-[0.98]",children:"Switch"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-bg px-3 py-2.5",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-success animate-pulse flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-muted",children:"Active:"}),e.jsx("span",{className:"text-xs text-text-secondary font-mono overflow-x-auto scrollbar-thin",children:m||"None"})]})]})}function at(){var G,X,Y;const[o,j]=a.useState(null),[N,F]=a.useState([]),[m,S]=a.useState(!0),[h,k]=a.useState(!1),[u,y]=a.useState(""),[U,$]=a.useState(null),[g,c]=a.useState(null),[i,d]=a.useState(!1),[n,w]=a.useState(""),[C,V]=a.useState("andrew"),[v,q]=a.useState("f5-tts"),[re,K]=a.useState("http://localhost:5006"),[ce,T]=a.useState(["andrew"]),[Oe,_e]=a.useState(null),[Be,De]=a.useState(!1),[qe,Ke]=a.useState(""),E=[{id:"f5-tts",name:"F5-TTS",desc:"Voice cloning with MLX (Apple Silicon)",defaultUrl:"http://localhost:5006",defaultVoices:["andrew"]}],[ze,oe]=a.useState(null),[ie,He]=a.useState(!1),[ne,We]=a.useState(""),[z,R]=a.useState([]),[H,W]=a.useState(!1),[b,le]=a.useState(null),[L,de]=a.useState(null),[O,Q]=a.useState(!1),P=t=>{var s;return((s=t==null?void 0:t.agent)==null?void 0:s.model)??(t==null?void 0:t.model)??""};a.useEffect(()=>{(async()=>{try{const[s,r]=await Promise.all([ee(),Ne()]);j(s),F(r),y(P(s));const l=(s==null?void 0:s.voice)??{};d(l.enabled??!1),w(l.livekitUrl??""),V(l.ttsVoice??"andrew"),q(l.ttsEngine??"f5-tts"),K(l.ttsUrl??"http://localhost:5006")}catch(s){const r=s instanceof Error?s.message:"Failed to load config";$(r),x("error",r)}finally{S(!1)}})()},[]),a.useEffect(()=>{(async()=>{var t;try{const s=await B("/api/voice/voices");if(s.ok){const r=await s.json();(t=r.voices)!=null&&t.length&&T(r.voices)}}catch{}})()},[]);const _=async()=>{Q(!0);try{const[t,s]=await Promise.allSettled([B("/api/voice/health").then(r=>r.json()),B("/api/voice/status").then(r=>r.json())]);t.status==="fulfilled"&&le(t.value),s.status==="fulfilled"&&(de(s.value),s.value.livekitUrl&&!n&&w(s.value.livekitUrl))}catch{}Q(!1)};a.useEffect(()=>{m||_()},[m]),a.useEffect(()=>{i&&fe().then(t=>{var s;oe({installed:t.installed,running:t.running,voices:t.voices}),R(t.voices.map(r=>({name:r,hasTranscript:!1,sizeBytes:0}))),(s=t.voices)!=null&&s.length&&T(["andrew",...t.voices])}).catch(()=>{})},[i]);const xe=async()=>{const t=document.createElement("input");t.type="file",t.accept="audio/wav,audio/mp3,audio/mpeg,audio/flac,.wav,.mp3,.flac",t.onchange=async()=>{var p;const s=(p=t.files)==null?void 0:p[0];if(!s)return;const r=prompt('Name this voice (e.g., "robin", "jarvis"):',s.name.replace(/\.[^.]+$/,""));if(!r)return;const l=prompt("(Optional) Transcript of the audio β€” improves cloning quality:","")||"";W(!0);try{const f=await s.arrayBuffer(),A=btoa(String.fromCharCode(...new Uint8Array(f))),M=await Ce(r,A,l),ge=M!=null&&M.duration?` Duration: ${M.duration}s,`:"";x("success",`Voice "${r}" uploaded!${ge} preprocessed and normalized.`);const J=await te();R(J.voices||[]),T(["default",...J.voices.map(ve=>ve.name)]),V(r)}catch(f){x("error",f instanceof Error?f.message:"Failed to upload voice")}finally{W(!1)}},t.click()},me=async t=>{try{x("success",`Generating preview for "${t}"...`);const s=["Hello, how can I help you today?","I am ready to assist you with anything you need.","Good morning. It is a pleasure to be of service."],r=s[Math.floor(Math.random()*s.length)],l=await Ve(t,r),p=new Blob([l],{type:"audio/wav"}),f=URL.createObjectURL(p),A=new Audio(f);A.onended=()=>URL.revokeObjectURL(f),A.play()}catch(s){x("error",s instanceof Error?s.message:"Failed to preview voice")}},ue=async t=>{if(confirm(`Delete voice "${t}"?`))try{await Te(t);const s=await te();R(s.voices||[]),T(["andrew",...s.voices.map(r=>r.name)]),C===t&&V("default"),x("success",`Voice "${t}" deleted`)}catch(s){x("error",s instanceof Error?s.message:"Failed to delete voice")}},x=(t,s)=>{c({type:t,message:s}),setTimeout(()=>c(null),3e3)},pe=async()=>{if(!(!u||u===P(o??{})))try{const t=N.find(r=>r.id===u);await Se(u,t==null?void 0:t.provider),ke("model_switched",{model:u,provider:t==null?void 0:t.provider});const s=await ee();j(s),y(P(s)),x("success",`Switched to ${u}`)}catch(t){x("error",t instanceof Error?t.message:"Failed to switch model")}},he=async()=>{var t,s,r,l;k(!0);try{const p=await Le({voice:{enabled:i,livekitUrl:n,ttsVoice:C,ttsEngine:v,ttsUrl:re||"http://localhost:5005",sttUrl:((t=o==null?void 0:o.voice)==null?void 0:t.sttUrl)??"http://localhost:48421",livekitApiKey:((s=o==null?void 0:o.voice)==null?void 0:s.livekitApiKey)??"",livekitApiSecret:((r=o==null?void 0:o.voice)==null?void 0:r.livekitApiSecret)??"",agentUrl:((l=o==null?void 0:o.voice)==null?void 0:l.agentUrl)??""}});j(p),x("success","Settings saved"),i&&_()}catch(p){x("error",p instanceof Error?p.message:"Failed to save settings")}finally{k(!1)}};if(m)return e.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((t,s)=>e.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"},s))});if(U)return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Ue,{title:"Settings",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Settings"},{label:"Settings"}]}),e.jsxs("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 text-error",children:[e.jsx(Z,{className:"h-5 w-5"}),e.jsx("p",{className:"text-sm font-medium",children:"Failed to load settings"})]}),e.jsx("p",{className:"mt-2 text-sm text-text-secondary",children:U}),e.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 rounded-lg bg-bg-tertiary px-4 py-2 text-sm text-text hover:bg-border transition-colors",children:"Retry"})]})]});const be=o?P(o):"";return e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsx("h2",{className:"text-base md:text-lg font-semibold text-text",children:"Settings"}),g&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-3 md:px-4 py-2.5 md:py-2 text-[11px] md:text-sm ${g.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[g.type==="success"?e.jsx(Ee,{className:"h-4 w-4"}):e.jsx(Z,{className:"h-4 w-4"}),g.message]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-3 md:p-6",children:[e.jsx("h3",{className:"mb-3 md:mb-4 text-[11px] md:text-sm font-medium text-text-secondary",children:"Model"}),e.jsx(Re,{models:N,selectedModel:u,onSelect:y,onSwitch:pe,currentModel:be})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-3 md:p-6",children:[e.jsxs("div",{className:"mb-3 md:mb-4 flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-4 w-4 text-accent-hover"}),e.jsx("h3",{className:"text-sm font-medium text-text-secondary",children:"Voice"}),e.jsx("span",{className:"rounded-full bg-accent/20 px-2 py-0.5 text-[9px] font-medium text-purple-light",children:((G=E.find(t=>t.id===v))==null?void 0:G.name)||v})]}),e.jsxs("button",{onClick:_,disabled:O,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-[10px] text-text-muted hover:bg-bg-tertiary hover:text-text-secondary transition-colors",children:[e.jsx(Pe,{className:`h-3 w-3 ${O?"animate-spin":""}`}),O?"Scanning...":"Scan Services"]})]}),e.jsxs("div",{className:"space-y-4",children:[b&&e.jsxs("div",{className:"rounded-lg border border-bg-tertiary bg-bg p-3",children:[e.jsx("p",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-text-muted",children:"Service Discovery"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{label:"LiveKit Server",ok:b.livekit},{label:"Voice Agent",ok:b.agent},{label:"STT",ok:b.stt},{label:`TTS (${((X=E.find(t=>t.id===v))==null?void 0:X.name)||"TTS"})`,ok:b.tts}].map(({label:t,ok:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{ok:s}),e.jsx("span",{className:`text-xs ${s?"text-text-secondary":"text-text-muted"}`,children:t}),s&&e.jsx("span",{className:"text-[9px] text-success",children:"Online"})]},t))}),(L==null?void 0:L.available)!==void 0&&e.jsx("div",{className:"mt-2 flex items-center gap-2 border-t border-bg-tertiary pt-2",children:L.available?e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"h-3.5 w-3.5 text-success"}),e.jsx("span",{className:"text-xs text-success",children:"Voice system ready"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ae,{className:"h-3.5 w-3.5 text-text-muted"}),e.jsx("span",{className:"text-xs text-text-muted",children:L.reason||"Voice not available"})]})})]}),e.jsxs("label",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:i,onChange:t=>d(t.target.checked),className:"h-4 w-4 rounded border-border accent-accent"}),e.jsx("span",{className:"text-sm text-text",children:"Enable Voice Chat"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-xs text-text-muted",children:"TTS Engine"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:E.map(t=>e.jsxs("button",{type:"button",onClick:()=>{q(t.id),K(t.defaultUrl),V(t.defaultVoices[0]||"default"),T(t.defaultVoices)},className:`rounded-lg border p-3 text-left transition-all min-h-[64px] active:scale-[0.98] sm:min-h-[56px] ${v===t.id?"border-accent bg-accent/10":"border-border hover:border-border-light"}`,children:[e.jsx("div",{className:"text-xs font-medium text-text",children:t.name}),e.jsx("div",{className:"mt-0.5 text-[10px] text-text-muted",children:t.desc})]},t.id))}),e.jsx("div",{className:"mt-3 rounded-xl border border-border bg-bg-secondary p-4 space-y-4",children:ie?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{className:"h-4 w-4 text-accent2 animate-spin"}),e.jsx("span",{className:"text-sm font-medium text-text",children:"Installing F5-TTS..."})]}),e.jsx("div",{className:"rounded-lg bg-bg border border-bg-tertiary p-3",children:e.jsx("p",{className:"text-xs text-text-secondary font-mono break-all",children:ne})})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-success shadow-[0_0_6px_rgba(34,197,94,0.4)]"}),e.jsx("span",{className:"text-sm text-text",children:"F5-TTS Running"})]})}),e.jsxs("div",{className:"rounded-lg border border-bg-tertiary bg-bg p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs font-medium text-text-secondary",children:"Cloned Voices"}),e.jsxs("button",{onClick:xe,disabled:H,className:"flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium text-accent2 border border-border hover:border-accent2/50 hover:bg-accent2/10 transition-colors disabled:opacity-50",children:[H?e.jsx(ae,{className:"h-3 w-3 animate-spin"}):e.jsx(Ie,{className:"h-3 w-3 rotate-180"}),"Upload Voice"]})]}),e.jsx("p",{className:"text-[10px] text-text-muted leading-relaxed",children:"Upload 5-10 seconds of clear speech. No background noise or music. Adding a transcript significantly improves quality."}),z.length>0?e.jsx("div",{className:"space-y-1.5",children:z.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-bg-tertiary px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-3.5 w-3.5 text-accent2"}),e.jsx("span",{className:"text-sm text-text capitalize",children:t.name}),e.jsxs("span",{className:"text-[9px] text-text-muted",children:[(t.sizeBytes/1024).toFixed(0),"KB"]}),t.hasTranscript&&e.jsx("span",{className:"rounded bg-success/15 px-1 py-0.5 text-[8px] text-success",children:"transcript"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>me(t.name),className:"text-text-muted hover:text-accent2 transition-colors",title:"Preview voice",children:e.jsx(Fe,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>ue(t.name),className:"text-text-muted hover:text-error transition-colors",title:"Delete voice",children:e.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})})})]})]},t.name))}):e.jsx("p",{className:"text-xs text-text-muted",children:"No cloned voices yet. Upload a 5-10 second WAV reference to clone any voice."})]})]})})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:["LiveKit URL",(b==null?void 0:b.livekit)&&e.jsx("span",{className:"rounded bg-success/15 px-1.5 py-0.5 text-[9px] font-medium text-success",children:"Connected"})]}),e.jsx("input",{value:n,onChange:t=>w(t.target.value),placeholder:"ws://localhost:7880",className:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-xs text-text-muted",children:"Voice"}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:ce.map(t=>e.jsx("button",{type:"button",onClick:()=>V(t),className:`rounded-lg border px-3 py-2 text-sm transition-all capitalize ${C===t?"border-accent bg-accent/10 text-text":"border-border text-text-secondary hover:border-border-light hover:text-text"}`,children:t},t))}),e.jsx("p",{className:"mt-2 text-xs text-text-muted",children:"F5-TTS voice cloning via MLX. Upload a 5-10 second reference audio to clone any voice."})]}),C&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-bg px-3 py-2",children:[e.jsx(D,{className:"h-3.5 w-3.5 text-accent-hover"}),e.jsx("span",{className:"text-xs text-text-muted",children:"Selected:"}),e.jsx("span",{className:"text-xs font-mono text-text-secondary",children:C}),e.jsx("span",{className:"ml-auto rounded bg-accent/15 px-1.5 py-0.5 text-[9px] font-medium text-purple-light",children:((Y=E.find(t=>t.id===v))==null?void 0:Y.name)||v})]})]})]}),e.jsxs("button",{onClick:he,disabled:h,className:"flex items-center gap-2 rounded-lg bg-accent px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(Me,{className:"h-4 w-4"}),h?"Saving...":"Save Settings"]})]})}export{at as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPanel-CzRROAYQ.js","assets/index-CahJbWSR.js","assets/index-D0RJ8701.css","assets/Input-GTHp2Rkr.js","assets/TitanCanvas-C-s0A-lv.js","assets/VoiceOverlay-CmNCrLcd.js","assets/TitanCanvas-BfitWg9R.css","assets/PageHeader-BimceqQo.js","assets/Tooltip-70UK0E2I.js","assets/circle-check-big-DZRE_MbN.js","assets/download-BxiWJU4G.js","assets/play-CcJ9BnCh.js","assets/SecurityPanel-CBTPWLj6.js","assets/AuditPanel-CM6Wg9hO.js","assets/funnel-PkLdxKyC.js","assets/AutonomyPanel-CESx3ANg.js"])))=>i.map(i=>d[i]);
2
- import{r as s,j as e,n as o,_ as i}from"./index-CahJbWSR.js";const r=s.lazy(()=>i(()=>import("./SettingsPanel-CzRROAYQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),n=s.lazy(()=>i(()=>import("./SecurityPanel-CBTPWLj6.js"),__vite__mapDeps([12,1,2,7,5]))),d=s.lazy(()=>i(()=>import("./AuditPanel-CM6Wg9hO.js"),__vite__mapDeps([13,1,2,4,5,6,14]))),c=s.lazy(()=>i(()=>import("./AutonomyPanel-CESx3ANg.js"),__vite__mapDeps([15,1,2,4,5,6,9,11]))),x=[{id:"general",label:"General"},{id:"autonomy",label:"Autonomy"},{id:"security",label:"Security"},{id:"audit",label:"Audit Log"}];function u(){const[t,a]=s.useState("general");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"shrink-0 px-5 pt-4 pb-0",children:[e.jsx("h1",{className:"text-sm font-semibold text-text mb-3",children:"Settings"}),e.jsx("div",{className:"flex items-center gap-0.5 border-b border-border/50",children:x.map(l=>e.jsxs("button",{onClick:()=>a(l.id),className:o("px-3 py-2 text-xs font-medium transition-colors relative",t===l.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[l.label,t===l.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},l.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(s.Suspense,{fallback:e.jsx("div",{className:"skeleton-shimmer h-40 rounded-lg"}),children:[t==="general"&&e.jsx(r,{}),t==="autonomy"&&e.jsx(c,{}),t==="security"&&e.jsx(n,{}),t==="audit"&&e.jsx(d,{})]})})]})}export{u as default};
@@ -1,5 +0,0 @@
1
- import{r as i,b as l,j as s}from"./index-CahJbWSR.js";import"./Input-GTHp2Rkr.js";import{H as M}from"./Tooltip-70UK0E2I.js";import"./TitanCanvas-C-s0A-lv.js";import"./VoiceOverlay-CmNCrLcd.js";const d={purpose:"var(--soma-purpose)",hunger:"var(--soma-hunger)",curiosity:"var(--soma-curiosity)",safety:"var(--soma-safety)",social:"var(--soma-social)",rest:"var(--soma-rest)"};function J(){var w,T;const[n,k]=i.useState(null),[_,$]=i.useState([]),[u,C]=i.useState([]),[x,v]=i.useState(null),[c,j]=i.useState(null),[f,N]=i.useState(!1),[m,S]=i.useState(null),h=i.useCallback((e,a="error")=>{S({message:e,type:a}),setTimeout(()=>S(null),4e3)},[]),r=i.useCallback(async()=>{try{const e=await l("/api/soma/state");if(e.ok){const a=await e.json();k(a)}}catch{}try{const e=await l("/api/soma/history?hours=24");if(e.ok){const a=await e.json();a.enabled&&$(a.history)}}catch{}try{const e=await l("/api/command-post/approvals?status=pending");if(e.ok){const a=await e.json();C(a.filter(o=>o.type==="soma_proposal"))}}catch{}},[]);i.useEffect(()=>{r();const e=setInterval(r,15e3),a=()=>r();return window.addEventListener("titan:soma:changed",a),()=>{clearInterval(e),window.removeEventListener("titan:soma:changed",a)}},[r]);const R=async e=>{try{const a=await l(`/api/command-post/approvals/${e}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decidedBy:"board"})});if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);r()}catch(a){h(`Approve failed: ${a.message}`)}},z=async e=>{try{const a=await l(`/api/command-post/approvals/${e}/reject`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decidedBy:"board"})});if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);r()}catch(a){h(`Reject failed: ${a.message}`)}},O=async()=>{if(!(!x||c===null)){N(!0);try{const e=await l("/api/soma/setpoints",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({[x]:c})});if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);j(null),r()}catch(e){h(`Setpoint update failed: ${e.message}`)}N(!1)}},P=async(e,a)=>{try{const o=await l("/api/soma/weights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:a})});if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);r()}catch(o){h(`Weight update failed: ${o.message}`)}},A=async(e,a)=>{try{const o=await l(`/api/soma/drives/${e}/disable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({disabled:a})});if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);r()}catch(o){h(`Drive toggle failed: ${o.message}`)}};if(!n)return s.jsx("div",{className:"soma-page",children:s.jsxs("div",{className:"soma-page__content",children:[s.jsx("div",{className:"soma-page__title",children:"TITAN-Soma"}),s.jsx("div",{className:"soma-page__subtitle",children:"Loading organism state…"})]})});if(!n.enabled)return s.jsx("div",{className:"soma-page",children:s.jsxs("div",{className:"soma-page__content",style:{maxWidth:640},children:[s.jsx("div",{className:"soma-page__title",children:"TITAN-Soma"}),s.jsx("div",{className:"soma-page__subtitle",children:"Homeostatic digital organism"}),s.jsxs("div",{style:{marginTop:32,padding:24,background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.06)",borderRadius:12},children:[s.jsx("div",{style:{fontSize:14,color:"rgba(255,255,255,0.8)",marginBottom:12},children:n.message||"Soma is not enabled on this gateway."}),s.jsxs("div",{style:{fontSize:12,color:"rgba(255,255,255,0.45)",lineHeight:1.7},children:["To turn on the organism layer, edit ",s.jsx("code",{style:{background:"rgba(255,255,255,0.04)",padding:"2px 6px",borderRadius:4},children:"~/.titan/titan.json"})," and add:",s.jsx("pre",{style:{marginTop:12,padding:12,background:"rgba(0,0,0,0.3)",borderRadius:6,color:"rgba(255,255,255,0.8)",fontSize:11},children:`{
2
- "organism": {
3
- "enabled": true
4
- }
5
- }`}),"Then restart the gateway. All other features keep working exactly as before β€” Soma is purely additive."]})]})]})});const b=n.drives||[],t=b.find(e=>e.id===x),D=((w=n.dominantDrives)==null?void 0:w[0])??null;return s.jsxs("div",{className:"soma-page",children:[s.jsx("div",{className:"soma-page__atmosphere","data-dominant":D||""}),s.jsxs("div",{className:"soma-page__content",children:[s.jsxs("div",{className:"soma-page__header",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"soma-page__title flex items-center gap-2",children:["Soma",s.jsx(M,{title:"TITAN-Soma",description:"TITAN's homeostatic core. Six internal drives (purpose, curiosity, hunger, safety, social, rest) drift over time. When a drive crosses its threshold, Soma proposes work to you. Every proposal still requires your approval."})]}),s.jsx("div",{className:"soma-page__subtitle",children:(T=n.hormonal)!=null&&T.elevated.length?`Body state: ${n.hormonal.elevated.map(e=>`${e.label.toLowerCase()} ${Math.round(e.satisfaction*100)}%`).join(" Β· ")}`:"All drives satiated β€” routine operation"})]}),s.jsxs("div",{style:{fontSize:11,color:"rgba(255,255,255,0.3)"},children:["total pressure: ",(n.totalPressure??0).toFixed(2)]})]}),m&&s.jsx("div",{style:{padding:"10px 14px",borderRadius:8,fontSize:12,marginBottom:12,background:m.type==="error"?"rgba(239,68,68,0.12)":"rgba(34,197,94,0.12)",border:`1px solid ${m.type==="error"?"rgba(239,68,68,0.25)":"rgba(34,197,94,0.25)"}`,color:m.type==="error"?"#fca5a5":"#86efac",transition:"opacity 0.3s ease"},children:m.message}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_380px] gap-6 lg:gap-8",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"soma-body",children:[s.jsx("div",{className:"soma-silhouette"}),b.map(e=>s.jsx("button",{className:`soma-region${e.pressure>0?" soma-region--elevated":""}${e.id===x?" soma-region--active":""}`,"data-drive":e.id,style:{color:d[e.id]||"#fff",animationDuration:e.pressure>0?`${1+e.satisfaction*1.5}s`:`${8+e.satisfaction*3}s`,opacity:.5+.5*e.satisfaction},onClick:()=>{v(e.id),j(null)},children:s.jsx("span",{className:"soma-region__label",children:e.label})},e.id))]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:10,marginTop:32},children:b.map(e=>s.jsxs("div",{onClick:()=>v(e.id),style:{padding:"10px 14px",border:`1px solid ${e.pressure>0?d[e.id]:"rgba(255,255,255,0.06)"}`,borderRadius:8,background:"rgba(255,255,255,0.015)",cursor:"pointer"},children:[s.jsx("div",{style:{fontSize:11,color:"rgba(255,255,255,0.5)",textTransform:"uppercase",letterSpacing:.5},children:e.label}),s.jsxs("div",{style:{fontSize:20,fontWeight:500,color:"rgba(255,255,255,0.92)",marginTop:2},children:[Math.round(e.satisfaction*100),"%"]}),s.jsx("div",{style:{fontSize:10,color:"rgba(255,255,255,0.4)",marginTop:4,minHeight:14},children:e.description})]},e.id))})]}),s.jsxs("div",{className:"soma-proposal-queue",children:[s.jsxs("div",{style:{fontSize:13,textTransform:"uppercase",letterSpacing:.8,color:"rgba(255,255,255,0.5)",marginBottom:12},children:["Pending Proposals (",u.length,")"]}),u.length===0?s.jsxs("div",{style:{fontSize:11,color:"rgba(255,255,255,0.3)",padding:24,textAlign:"center"},children:["No proposals in flight.",s.jsx("br",{}),"Soma only proposes when pressure crosses threshold."]}):u.map(e=>{const a=e.payload.shadowVerdict,p=e.requestedBy.split(":")[1];return s.jsxs("div",{className:"soma-proposal-card",children:[p&&s.jsx("div",{className:"soma-proposal-card__badges",children:s.jsx("span",{className:"soma-drive-badge",style:{background:d[p]},children:p})}),s.jsx("div",{className:"soma-proposal-card__title",children:e.payload.title||"(untitled)"}),e.payload.description&&s.jsx("div",{className:"soma-proposal-card__description",children:e.payload.description}),a&&s.jsxs("div",{className:"soma-proposal-card__shadow",children:[s.jsxs("div",{className:"soma-proposal-card__shadow-stat",children:[s.jsx("span",{className:"soma-proposal-card__shadow-label",children:"Cost"}),s.jsxs("span",{children:["$",a.estimatedCostUsd.toFixed(2)]})]}),s.jsxs("div",{className:"soma-proposal-card__shadow-stat",children:[s.jsx("span",{className:"soma-proposal-card__shadow-label",children:"Reversible"}),s.jsxs("span",{children:[Math.round(a.reversibilityScore*100),"%"]})]}),s.jsxs("div",{className:"soma-proposal-card__shadow-stat",children:[s.jsx("span",{className:"soma-proposal-card__shadow-label",children:"Risks"}),s.jsx("span",{children:a.breakRisks.length})]})]}),(a==null?void 0:a.breakRisks)&&a.breakRisks.length>0&&s.jsx("div",{style:{fontSize:10,color:"rgba(255,255,255,0.45)",marginBottom:6},children:a.breakRisks.slice(0,2).join(" Β· ")}),s.jsxs("div",{className:"soma-proposal-card__buttons",children:[s.jsx("button",{className:"soma-btn soma-btn--approve",onClick:()=>R(e.id),children:"Approve"}),s.jsx("button",{className:"soma-btn soma-btn--reject",onClick:()=>z(e.id),children:"Reject"})]})]},e.id)})]})]}),_.length>0&&s.jsxs("div",{style:{marginTop:48},children:[s.jsx("div",{style:{fontSize:13,textTransform:"uppercase",letterSpacing:.8,color:"rgba(255,255,255,0.5)",marginBottom:12},children:"Last 24h"}),Object.keys(d).map(e=>{const a=_.map(y=>{var g;return((g=y.satisfactions)==null?void 0:g[e])??1});if(a.length<2)return null;const o=800,p=28,E=o/Math.max(1,a.length-1),B=a.map((y,g)=>`${g===0?"M":"L"} ${(g*E).toFixed(1)} ${(p-y*p).toFixed(1)}`).join(" ");return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:4},children:[s.jsx("div",{style:{fontSize:10,color:"rgba(255,255,255,0.45)",width:60,textTransform:"capitalize"},children:e}),s.jsx("svg",{width:o,height:p,style:{opacity:.85},children:s.jsx("path",{d:B,stroke:d[e],strokeWidth:"1.5",fill:"none"})})]},e)})]})]}),t&&s.jsxs("div",{className:"soma-inspector",children:[s.jsx("button",{className:"soma-inspector__close",onClick:()=>v(null),"aria-label":"Close",children:"βœ•"}),s.jsx("div",{className:"soma-inspector__title",style:{color:d[t.id]},children:t.label}),s.jsx("div",{className:"soma-inspector__reason",children:t.description}),s.jsxs("div",{className:"soma-inspector__stat",children:[s.jsx("span",{className:"soma-inspector__stat-label",children:"Satisfaction"}),s.jsxs("span",{className:"soma-inspector__stat-value",children:[Math.round(t.satisfaction*100),"%"]})]}),s.jsxs("div",{className:"soma-inspector__stat",children:[s.jsx("span",{className:"soma-inspector__stat-label",children:"Setpoint"}),s.jsxs("span",{className:"soma-inspector__stat-value",children:[Math.round((c??t.setpoint)*100),"%"]})]}),s.jsxs("div",{className:"soma-inspector__stat",children:[s.jsx("span",{className:"soma-inspector__stat-label",children:"Pressure"}),s.jsx("span",{className:"soma-inspector__stat-value",children:t.pressure.toFixed(2)})]}),s.jsxs("div",{className:"soma-inspector__stat",children:[s.jsx("span",{className:"soma-inspector__stat-label",children:"Weight"}),s.jsxs("span",{className:"soma-inspector__stat-value",children:[t.weight.toFixed(1),"Γ—"]})]}),s.jsxs("div",{className:"soma-inspector__slider-row",children:[s.jsxs("div",{className:"soma-inspector__slider-label",children:[s.jsx("span",{children:"Adjust setpoint"}),s.jsxs("span",{children:[Math.round((c??t.setpoint)*100),"%"]})]}),s.jsx("input",{type:"range",className:"soma-inspector__slider",min:0,max:100,value:Math.round((c??t.setpoint)*100),onChange:e=>j(Number(e.target.value)/100),style:{color:d[t.id]}}),c!==null&&c!==t.setpoint&&s.jsx("button",{className:"soma-btn soma-btn--approve",onClick:O,disabled:f,style:{marginTop:12},children:f?"Saving...":"Save setpoint"})]}),s.jsxs("div",{className:"soma-inspector__slider-row",children:[s.jsxs("div",{className:"soma-inspector__slider-label",children:[s.jsx("span",{children:"Weight (pressure multiplier)"}),s.jsxs("span",{children:[t.weight.toFixed(1),"Γ—"]})]}),s.jsx("input",{type:"range",className:"soma-inspector__slider",min:1,max:30,step:1,value:Math.round(t.weight*10),onChange:e=>P(t.id,Number(e.target.value)/10),style:{color:d[t.id]},title:"Drag to adjust how much this drive contributes to total pressure. 1.0 is baseline."})]}),s.jsxs("div",{style:{marginTop:14,paddingTop:10,borderTop:"1px solid rgba(255,255,255,0.05)"},children:[s.jsxs("button",{onClick:()=>A(t.id,!0),style:{width:"100%",padding:"8px",fontSize:11,border:"1px solid rgba(239, 68, 68, 0.2)",background:"rgba(239, 68, 68, 0.08)",color:"var(--color-error)",borderRadius:6,cursor:"pointer"},title:"Skip this drive in pressure fusion. Soma stays on for the other drives.",children:["Disable ",t.label," drive"]}),s.jsxs("div",{style:{fontSize:10,color:"rgba(255,255,255,0.3)",marginTop:4,textAlign:"center"},children:["Re-enable by editing ",s.jsx("code",{style:{background:"rgba(255,255,255,0.06)",padding:"1px 4px",borderRadius:3},children:"organism.disabledDrives"})," in titan.json"]})]}),t.inputs&&s.jsxs("div",{style:{marginTop:20,paddingTop:14,borderTop:"1px solid rgba(255,255,255,0.05)"},children:[s.jsx("div",{className:"soma-inspector__slider-label",children:"Signals"}),Object.entries(t.inputs).map(([e,a])=>s.jsxs("div",{className:"soma-inspector__stat",children:[s.jsx("span",{className:"soma-inspector__stat-label",children:e}),s.jsx("span",{className:"soma-inspector__stat-value",children:String(a)})]},e))]})]})]})}export{J as default};
@@ -1 +0,0 @@
1
- import{r as t,aQ as d,j as e,aR as n}from"./index-CahJbWSR.js";import{P as o}from"./PageHeader-BimceqQo.js";import{R as x,U as f}from"./TitanCanvas-C-s0A-lv.js";import{T as h}from"./trash-2-CK7yQ55V.js";import"./VoiceOverlay-CmNCrLcd.js";function v(){const[l,c]=t.useState([]),[r,i]=t.useState(!0),s=t.useCallback(async()=>{i(!0);try{const a=await d();c(a.teams||[])}catch{}i(!1)},[]);t.useEffect(()=>{s()},[s]);const m=async a=>{if(confirm("Delete this team?"))try{await n(a),await s()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(o,{title:"Team Hub",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Security"},{label:"Teams"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:s,disabled:r,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(x,{className:`w-4 h-4 ${r?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:l.map(a=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(f,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:a.name}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[a.members.length," members β€’ ",a.description]})]})]}),e.jsx("button",{onClick:()=>m(a.id),className:"p-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] hover:bg-[#3f3f46] hover:text-red-400",children:e.jsx(h,{className:"w-3.5 h-3.5"})})]},a.id))})]})}export{v as default};
@@ -1 +0,0 @@
1
- import{r as o,j as e,A as G,Z as S,C as I,d as T,ac as V,p as B,ad as $,ae as F,af as q,ag as U}from"./index-CahJbWSR.js";import{S as l}from"./StatCard-DciE_Iqc.js";import{C as W,e as x,h as Z}from"./TitanCanvas-C-s0A-lv.js";import{G as O}from"./git-branch-BM-Gw95X.js";import{C as _}from"./chart-column-BtNO6sRy.js";import"./VoiceOverlay-CmNCrLcd.js";function Y(){var m,u,h,g,j,p,v;const[s,C]=o.useState(null),[i,w]=o.useState(null),[a,M]=o.useState(null),[R,A]=o.useState(0),[L,P]=o.useState(0),[n,k]=o.useState(null),[D,E]=o.useState(!0);return o.useEffect(()=>{const t=async()=>{try{const[c,d,f,N,y,b]=await Promise.allSettled([V(),B(1),$(),F(100),q(100),U()]);c.status==="fulfilled"&&C(c.value),d.status==="fulfilled"&&w(d.value.stats),f.status==="fulfilled"&&M(f.value),N.status==="fulfilled"&&A((N.value.alerts||[]).length),y.status==="fulfilled"&&P((y.value.violations||[]).length),b.status==="fulfilled"&&k(b.value)}catch{}E(!1)};t();const r=setInterval(t,15e3);return()=>clearInterval(r)},[]),D?e.jsx("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:Array.from({length:8}).map((t,r)=>e.jsx("div",{className:"h-28 animate-pulse rounded-xl border border-border bg-bg-secondary"},r))}):e.jsxs("div",{className:"space-y-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-text",children:"Telemetry & Monitoring"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(l,{title:"Total Requests",value:((m=s==null?void 0:s.totalRequests)==null?void 0:m.toLocaleString())??"0",icon:e.jsx(G,{className:"h-5 w-5"})}),e.jsx(l,{title:"Avg Latency",value:s!=null&&s.avgLatencyMs?`${Math.round(s.avgLatencyMs)}ms`:"β€”",icon:e.jsx(W,{className:"h-5 w-5"})}),e.jsx(l,{title:"Error Rate",value:(s==null?void 0:s.errorRate)!==void 0?`${(s.errorRate*100).toFixed(1)}%`:"0%",icon:e.jsx(S,{className:"h-5 w-5"})}),e.jsx(l,{title:"Total Tokens",value:(()=>{const t=s==null?void 0:s.totalTokens;return typeof t=="number"?t.toLocaleString():t&&typeof t=="object"?(t.total??(t.prompt??0)+(t.completion??0)).toLocaleString():"0"})(),icon:e.jsx(I,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(l,{title:"Traces",value:((u=i==null?void 0:i.totalTraces)==null?void 0:u.toString())??"0",icon:e.jsx(O,{className:"h-5 w-5"})}),e.jsx(l,{title:"Avg Rounds/Task",value:((h=i==null?void 0:i.avgRounds)==null?void 0:h.toFixed(1))??"β€”",icon:e.jsx(_,{className:"h-5 w-5"})}),e.jsx(l,{title:"Soul Tasks",value:((g=a==null?void 0:a.totalTasks)==null?void 0:g.toString())??"0",icon:e.jsx(x,{className:"h-5 w-5"})}),e.jsx(l,{title:"Confidence",value:a!=null&&a.avgConfidence?`${Math.round(a.avgConfidence*100)}%`:"β€”",icon:e.jsx(x,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(l,{title:"Alerts",value:R.toString(),icon:e.jsx(T,{className:"h-5 w-5"})}),e.jsx(l,{title:"Guardrail Violations",value:L.toString(),icon:e.jsx(T,{className:"h-5 w-5"})}),e.jsx(l,{title:"Total Errors",value:((j=s==null?void 0:s.totalErrors)==null?void 0:j.toString())??"0",icon:e.jsx(S,{className:"h-5 w-5"})}),e.jsx(l,{title:"Learned Patterns",value:((v=(p=a==null?void 0:a.patterns)==null?void 0:p.length)==null?void 0:v.toString())??"0",icon:e.jsx(x,{className:"h-5 w-5"})})]}),n&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-sm font-medium text-text-secondary mb-3 flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4"}),"System Profile"]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"OS"})," ",e.jsxs("span",{className:"text-text-secondary ml-1",children:[n.os," ",n.arch]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"CPU"})," ",e.jsxs("span",{className:"text-text-secondary ml-1",children:[n.cpuCores,"c β€” ",n.cpuModel.split("@")[0].trim()]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"RAM"})," ",e.jsxs("span",{className:"text-text-secondary ml-1",children:[Math.round(n.ramTotalMB/1024),"GB"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"GPU"})," ",e.jsx("span",{className:"text-text-secondary ml-1",children:n.gpuName})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"Node"})," ",e.jsx("span",{className:"text-text-secondary ml-1",children:n.nodeVersion})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"Install"})," ",e.jsx("span",{className:"text-text-secondary ml-1",children:n.installMethod})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"Version"})," ",e.jsx("span",{className:"text-text-secondary ml-1",children:n.version})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-text-muted",children:"ID"})," ",e.jsx("span",{className:"text-text-secondary ml-1 font-mono",children:n.installId.slice(0,8)})]})]})]}),(s==null?void 0:s.topTools)&&s.topTools.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text-secondary mb-3",children:"Top Tools"}),e.jsx("div",{className:"space-y-2",children:s.topTools.map((t,r)=>{const c=s.topTools[0].count,d=c>0?t.count/c*100:0;return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-text-secondary w-24 truncate font-mono",children:t.tool}),e.jsx("div",{className:"flex-1 h-2 rounded-full bg-bg-tertiary overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-accent/60",style:{width:`${d}%`}})}),e.jsx("span",{className:"text-xs text-text-muted w-10 text-right",children:t.count})]},r)})})]}),(a==null?void 0:a.patterns)&&a.patterns.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text-secondary mb-3",children:"Learned Task Patterns"}),e.jsx("div",{className:"grid grid-cols-1 gap-2 lg:grid-cols-2",children:a.patterns.slice(0,8).map((t,r)=>e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-bg-secondary border border-border text-xs",children:[e.jsx("span",{className:"text-text-secondary",children:t.taskType}),e.jsxs("div",{className:"flex items-center gap-3 text-text-muted",children:[e.jsx("span",{className:"font-mono",children:t.bestStrategy}),e.jsxs("span",{children:[t.avgRounds.toFixed(1)," rounds"]}),e.jsxs("span",{className:t.successRate>=.7?"text-success":"text-warning",children:[Math.round(t.successRate*100),"%"]})]})]},r))})]})]})}export{Y as default};