titan-agent 6.4.1 → 6.4.4

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 (151) hide show
  1. package/dist/agent/agent.js +61 -46
  2. package/dist/agent/agent.js.map +1 -1
  3. package/dist/agent/pipeline.js +11 -6
  4. package/dist/agent/pipeline.js.map +1 -1
  5. package/dist/skills/builtin/cron.js +7 -6
  6. package/dist/skills/builtin/cron.js.map +1 -1
  7. package/dist/utils/constants.js +1 -1
  8. package/dist/utils/constants.js.map +1 -1
  9. package/package.json +10 -2
  10. package/ui/dist/assets/{AuditPanel-B55jmQpR.js → AuditPanel-BOIeotPE.js} +1 -1
  11. package/ui/dist/assets/{AutonomyPanel-MP5tOLxX.js → AutonomyPanel-Dv8ClpL9.js} +1 -1
  12. package/ui/dist/assets/{AutopilotPanel-DB38vjfF.js → AutopilotPanel-Dv3-_6fZ.js} +1 -1
  13. package/ui/dist/assets/{AutoresearchPanel-CFvfx18N.js → AutoresearchPanel-DdLmfGpC.js} +1 -1
  14. package/ui/dist/assets/{BackupPanel-0a5SbfaS.js → BackupPanel-DYr6APwV.js} +1 -1
  15. package/ui/dist/assets/{BrowserPanel-CvOVGtTp.js → BrowserPanel-DMZf6mNn.js} +1 -1
  16. package/ui/dist/assets/{CPActivity-FlC0Ac-0.js → CPActivity-B2kmaYR9.js} +1 -1
  17. package/ui/dist/assets/{CPAgentDetail-CNiDw2g2.js → CPAgentDetail--ploJZFv.js} +1 -1
  18. package/ui/dist/assets/{CPAgents-2qeSr80C.js → CPAgents-ctC99jCR.js} +1 -1
  19. package/ui/dist/assets/{CPApprovals-D2m2dYBD.js → CPApprovals-BZHaJ6d_.js} +1 -1
  20. package/ui/dist/assets/{CPCosts-CbRtk5BJ.js → CPCosts--xJmtfEi.js} +1 -1
  21. package/ui/dist/assets/{CPDashboard-sGImoKeh.js → CPDashboard-rThYnRLi.js} +1 -1
  22. package/ui/dist/assets/{CPFiles-OVqWt7zC.js → CPFiles-IRzbOaxo.js} +1 -1
  23. package/ui/dist/assets/{CPGoals-wgG_oJF6.js → CPGoals-BQ4Kasli.js} +1 -1
  24. package/ui/dist/assets/{CPInbox-C4toHLIj.js → CPInbox-DYvoAJdg.js} +1 -1
  25. package/ui/dist/assets/{CPIssueDetail-CYVivz76.js → CPIssueDetail-D4JUVm7B.js} +1 -1
  26. package/ui/dist/assets/{CPIssues-CrYg3hHZ.js → CPIssues-C_K0zuiB.js} +1 -1
  27. package/ui/dist/assets/CPLayout-B3Lr8puc.js +2 -0
  28. package/ui/dist/assets/{CPOrg-BvU8zgIR.js → CPOrg-CAKwV8Kr.js} +1 -1
  29. package/ui/dist/assets/{CPRuns-tXHGoKnO.js → CPRuns-COUYpSBB.js} +1 -1
  30. package/ui/dist/assets/{CPSocial-Dxt58jcE.js → CPSocial-BCTgcO3V.js} +1 -1
  31. package/ui/dist/assets/{CPVoice-DBWsPDYo.js → CPVoice-D-wxXUGf.js} +1 -1
  32. package/ui/dist/assets/{ChannelsPanel-Cc1rpsDr.js → ChannelsPanel-Cx3dxaP9.js} +1 -1
  33. package/ui/dist/assets/{CheckpointsPanel-BMxuQIKg.js → CheckpointsPanel-D2ATiPXs.js} +1 -1
  34. package/ui/dist/assets/{CommandPostHub--U1dHmDw.js → CommandPostHub-DTs1EGm8.js} +3 -3
  35. package/ui/dist/assets/{CronPanel-C7uIoKAb.js → CronPanel-D0j9zDVW.js} +1 -1
  36. package/ui/dist/assets/{DataTable-DtjGbNj5.js → DataTable-CgeOprjv.js} +1 -1
  37. package/ui/dist/assets/{DreamPanel-DhjOkThA.js → DreamPanel-CJAI6Aka.js} +2 -2
  38. package/ui/dist/assets/{EmptyState-cLzelkoZ.js → EmptyState-NMpt-ODJ.js} +1 -1
  39. package/ui/dist/assets/{EvalHarnessPanel-Dm6DyPTs.js → EvalHarnessPanel-ZPXlKHaK.js} +1 -1
  40. package/ui/dist/assets/{EvalPanel-BDiX_uNI.js → EvalPanel-DpmEQQXh.js} +1 -1
  41. package/ui/dist/assets/{FileViewer-CHrDPOA5.js → FileViewer-B7Mm4cJL.js} +1 -1
  42. package/ui/dist/assets/{FilesPanel-CNCqxSjS.js → FilesPanel-CvrGQwh3.js} +1 -1
  43. package/ui/dist/assets/{FleetPanel-UOTqdrh3.js → FleetPanel-BDf9E7dQ.js} +1 -1
  44. package/ui/dist/assets/{HomelabPanel-8GyBOfWC.js → HomelabPanel-CKGR1kGN.js} +1 -1
  45. package/ui/dist/assets/InfraView-CreCQSNl.js +2 -0
  46. package/ui/dist/assets/{InlineEditableField-CFx4EOF1.js → InlineEditableField-JxqorUFO.js} +1 -1
  47. package/ui/dist/assets/{Input-CT_e2ZXD.js → Input-rfmX8eLw.js} +1 -1
  48. package/ui/dist/assets/{IntegrationsPanel-_MC_FcOZ.js → IntegrationsPanel-Ds5KCGUi.js} +1 -1
  49. package/ui/dist/assets/IntelligenceView-YcrYQTVO.js +2 -0
  50. package/ui/dist/assets/{LearningPanel-DIsuxMlC.js → LearningPanel-CZUd4UsW.js} +1 -1
  51. package/ui/dist/assets/{LogsPanel-hUcRe-Pt.js → LogsPanel-CmUBA-jG.js} +1 -1
  52. package/ui/dist/assets/{McpPanel-B2L9oapp.js → McpPanel-CVyjQ6H6.js} +1 -1
  53. package/ui/dist/assets/{MemoryGraphPanel-eVPWv4Fz.js → MemoryGraphPanel-BK-AbsbF.js} +1 -1
  54. package/ui/dist/assets/{MemoryWikiPanel-CDuJkatJ.js → MemoryWikiPanel-DkfHLaje.js} +1 -1
  55. package/ui/dist/assets/{MeshPanel-C42VpfJ5.js → MeshPanel-BCDzhBRO.js} +1 -1
  56. package/ui/dist/assets/{MissionCanvas-BMw2FCD5.js → MissionCanvas-GvSYEkjz.js} +1 -1
  57. package/ui/dist/assets/{MissionChat-C9HHYet2.js → MissionChat-DpyGbBhk.js} +1 -1
  58. package/ui/dist/assets/{MissionLibrary-D2yhbAJg.js → MissionLibrary-Dwn2vP2g.js} +1 -1
  59. package/ui/dist/assets/{MissionStart-BKeop9F5.js → MissionStart-DIYEotqX.js} +1 -1
  60. package/ui/dist/assets/{Modal-Bdo-V7t6.js → Modal-BFii_RIq.js} +1 -1
  61. package/ui/dist/assets/{NvidiaPanel-CEss--Dl.js → NvidiaPanel-BCmLv4bY.js} +1 -1
  62. package/ui/dist/assets/{OrganismPanel-CToPtDaz.js → OrganismPanel-CDMC8-yf.js} +1 -1
  63. package/ui/dist/assets/{OverviewPanel-D7IolCYo.js → OverviewPanel-C9ErRTB1.js} +1 -1
  64. package/ui/dist/assets/{PageHeader-CjDtUo8m.js → PageHeader-CawSrb9E.js} +1 -1
  65. package/ui/dist/assets/{PersonaProfilesPanel-Df5og1Sg.js → PersonaProfilesPanel-B_hx3sLQ.js} +1 -1
  66. package/ui/dist/assets/{PersonasPanel-DKr-x2AB.js → PersonasPanel-BhfAKQWd.js} +1 -1
  67. package/ui/dist/assets/{PhoneDeskPanel-CkEnpVrz.js → PhoneDeskPanel-Cew4jv5F.js} +1 -1
  68. package/ui/dist/assets/{RecipesPanel-CiQiYqpA.js → RecipesPanel-KSNQil0R.js} +1 -1
  69. package/ui/dist/assets/{SecurityPanel-nTFIdiqf.js → SecurityPanel-ojbdvuZR.js} +1 -1
  70. package/ui/dist/assets/{SelfImprovePanel-mPChEVjC.js → SelfImprovePanel-D743Dh0z.js} +1 -1
  71. package/ui/dist/assets/{SelfProposalsPanel-CXIGD8P3.js → SelfProposalsPanel-DHPrgGsJ.js} +1 -1
  72. package/ui/dist/assets/{SessionsPanel-C8nt7rxV.js → SessionsPanel-Bd8dAJQa.js} +1 -1
  73. package/ui/dist/assets/{SessionsTab-Bp5WaW_Q.js → SessionsTab-BjyOfaQ9.js} +1 -1
  74. package/ui/dist/assets/{SettingsPanel-Cg5tgqDO.js → SettingsPanel-CWvFc8MJ.js} +1 -1
  75. package/ui/dist/assets/SettingsView-Chh-hdRF.js +2 -0
  76. package/ui/dist/assets/{SkeletonLoader-DwBcLrhl.js → SkeletonLoader-sjDa7Y96.js} +1 -1
  77. package/ui/dist/assets/{SkillsPanel-CHnd8BmR.js → SkillsPanel-B0UwrZGA.js} +1 -1
  78. package/ui/dist/assets/{SomaView-1zShMywA.js → SomaView-CXfqpdNP.js} +1 -1
  79. package/ui/dist/assets/{StatCard-BUO6lNlX.js → StatCard-B4qf3WOB.js} +1 -1
  80. package/ui/dist/assets/{StatusBadge-CmSemYNT.js → StatusBadge-BtDtyL5L.js} +1 -1
  81. package/ui/dist/assets/{Tabs-Zo1JoN_G.js → Tabs-CeY7i2tk.js} +1 -1
  82. package/ui/dist/assets/{TeamsPanel-C96TIEna.js → TeamsPanel-BxFpHD58.js} +1 -1
  83. package/ui/dist/assets/{TelemetryPanel-DlI9vEZU.js → TelemetryPanel-D2L98GwC.js} +1 -1
  84. package/ui/dist/assets/{TitanCanvas-BewmO4FZ.js → TitanCanvas-D7TL368k.js} +4 -4
  85. package/ui/dist/assets/{ToolsView-BY73iyvj.js → ToolsView-BiW0mds2.js} +2 -2
  86. package/ui/dist/assets/{Tooltip-DHrJsv5K.js → Tooltip-C3exOcZa.js} +1 -1
  87. package/ui/dist/assets/{TraceViewer-BVH6WsWN.js → TraceViewer-z42wYVdE.js} +1 -1
  88. package/ui/dist/assets/{TrainingPanel-Beam9vXX.js → TrainingPanel-BPVftaSt.js} +1 -1
  89. package/ui/dist/assets/{VoiceOverlay-B03bLRa6.js → VoiceOverlay-DNzDqitY.js} +1 -1
  90. package/ui/dist/assets/{VramPanel-Cv48drRb.js → VramPanel-CF4l5fe_.js} +1 -1
  91. package/ui/dist/assets/{WatchView-VtZRF3Ah.js → WatchView-CewHUoxK.js} +1 -1
  92. package/ui/dist/assets/{WorkTab-gIgsVURN.js → WorkTab-ByC4niLi.js} +1 -1
  93. package/ui/dist/assets/{WorkflowsPanel-xGphoCgy.js → WorkflowsPanel-Bsyhjv87.js} +1 -1
  94. package/ui/dist/assets/{archive-B27XcT_v.js → archive-Cz-kvWW5.js} +1 -1
  95. package/ui/dist/assets/{arrow-left-DSU0t1ZF.js → arrow-left-CGVxTClf.js} +1 -1
  96. package/ui/dist/assets/{book-open-CCt4Gq9I.js → book-open-CrOs3smB.js} +1 -1
  97. package/ui/dist/assets/{bot-DK7dbBfX.js → bot-C0wiWyCT.js} +1 -1
  98. package/ui/dist/assets/{chart-column-CixcF9Pi.js → chart-column-Dcc3a8m5.js} +1 -1
  99. package/ui/dist/assets/{check-oX--Xdud.js → check-BhmlTEFk.js} +1 -1
  100. package/ui/dist/assets/{chevron-right-D1DyaeTm.js → chevron-right-DJCsUSwz.js} +1 -1
  101. package/ui/dist/assets/{chevron-up-uKeW050h.js → chevron-up-cs3cBR4O.js} +1 -1
  102. package/ui/dist/assets/{circle-check-big-C7KjulF6.js → circle-check-big-De2k5qVr.js} +1 -1
  103. package/ui/dist/assets/{circle-stop-DMMdkBs2.js → circle-stop-u0L9iQ69.js} +1 -1
  104. package/ui/dist/assets/{clipboard-list-C3GIPAT3.js → clipboard-list-DF1F3Vjf.js} +1 -1
  105. package/ui/dist/assets/{clock-BgvC0T_E.js → clock-Bc6IrFv8.js} +1 -1
  106. package/ui/dist/assets/{dollar-sign-DuP1ZChI.js → dollar-sign-BStL62ws.js} +1 -1
  107. package/ui/dist/assets/{download-CnPu926z.js → download-VXqww0Iy.js} +1 -1
  108. package/ui/dist/assets/{external-link-fIw1hJS5.js → external-link-BjN0VrNb.js} +1 -1
  109. package/ui/dist/assets/{file-text-kYsk6v9z.js → file-text-SIULFbzy.js} +1 -1
  110. package/ui/dist/assets/{flask-conical-CAMJ0Plo.js → flask-conical-CsShOfpS.js} +1 -1
  111. package/ui/dist/assets/{folder-Dq6luLP7.js → folder-DwOkgBGj.js} +1 -1
  112. package/ui/dist/assets/{funnel-hj2rC4MH.js → funnel-CDnA2Enn.js} +1 -1
  113. package/ui/dist/assets/{git-branch-DX_X3HtU.js → git-branch-BAFSlxgi.js} +1 -1
  114. package/ui/dist/assets/{index-BISxhHXP.js → index-BlFxPvdg.js} +2 -2
  115. package/ui/dist/assets/{layers-BseADaVO.js → layers-DKKOtsYx.js} +1 -1
  116. package/ui/dist/assets/{legacy-B7aW_gUV.js → legacy-YQ03_WIq.js} +1 -1
  117. package/ui/dist/assets/{lightbulb-DdDY0MbY.js → lightbulb-D4Syh7fA.js} +1 -1
  118. package/ui/dist/assets/{link-BZZB4JyS.js → link-C_6ueq0o.js} +1 -1
  119. package/ui/dist/assets/{list-todo-bSv3SQAa.js → list-todo-3Me4V-34.js} +1 -1
  120. package/ui/dist/assets/{message-square-D9n28WBl.js → message-square-Dv6Q3VRO.js} +1 -1
  121. package/ui/dist/assets/{mic-DsWOcLkn.js → mic-BInf3BDE.js} +1 -1
  122. package/ui/dist/assets/{missions-CmBxbp0k.js → missions-BUTRB5Lq.js} +1 -1
  123. package/ui/dist/assets/{network-CkgG0zu0.js → network-BsSfc5IE.js} +1 -1
  124. package/ui/dist/assets/{pause-CvgG1y4I.js → pause-CXCmPcHk.js} +1 -1
  125. package/ui/dist/assets/{pencil-c0GVcCA9.js → pencil-DAvceqn3.js} +1 -1
  126. package/ui/dist/assets/{play-CuwPKVSv.js → play-MuD1S1C5.js} +1 -1
  127. package/ui/dist/assets/{plug-D-b321IK.js → plug-Chv5y4No.js} +1 -1
  128. package/ui/dist/assets/{plus-IFwPqtUW.js → plus-SBD6A3Qb.js} +1 -1
  129. package/ui/dist/assets/{proxy-Dm6tNAsg.js → proxy-C5UuKDtU.js} +1 -1
  130. package/ui/dist/assets/{radio-BNdFCb41.js → radio-BySzBvYH.js} +1 -1
  131. package/ui/dist/assets/{refresh-cw-CFv1BDy9.js → refresh-cw-BdcqinTm.js} +1 -1
  132. package/ui/dist/assets/{rotate-ccw-iCpZfipQ.js → rotate-ccw-CRA_s5tz.js} +1 -1
  133. package/ui/dist/assets/{save-o5ciSOaB.js → save-BWhXC8Tv.js} +1 -1
  134. package/ui/dist/assets/{search-DmeBed-X.js → search-DF7UnWEk.js} +1 -1
  135. package/ui/dist/assets/{send-BoLKNmgS.js → send-CmvPtbvy.js} +1 -1
  136. package/ui/dist/assets/{server-Ov6rxCAc.js → server-1PubNLgw.js} +1 -1
  137. package/ui/dist/assets/{shield-check-CKPsc0rI.js → shield-check-BjuAv28a.js} +1 -1
  138. package/ui/dist/assets/{terminal-CcPGcWeJ.js → terminal-BvDfNOXl.js} +1 -1
  139. package/ui/dist/assets/{test-tube-564jDt0t.js → test-tube-CrzRsKdm.js} +1 -1
  140. package/ui/dist/assets/{toggle-right-B7gXrucx.js → toggle-right-BRJ_dULZ.js} +1 -1
  141. package/ui/dist/assets/{trash-2-B7yIJ8B5.js → trash-2-Dtxmn6GE.js} +1 -1
  142. package/ui/dist/assets/{trending-up-DdxHXTsD.js → trending-up-C7pfwW1S.js} +1 -1
  143. package/ui/dist/assets/{trophy-mttLLqgk.js → trophy-Dknrgn8P.js} +1 -1
  144. package/ui/dist/assets/{volume-2-DcpX5fnm.js → volume-2-ahkfEwxT.js} +1 -1
  145. package/ui/dist/assets/{wifi-off-B4cf3i9g.js → wifi-off-wACQ7wec.js} +1 -1
  146. package/ui/dist/index.html +1 -1
  147. package/ui/dist/sw.js +1 -1
  148. package/ui/dist/assets/CPLayout-BXcOZUo7.js +0 -2
  149. package/ui/dist/assets/InfraView-Ds53Fjni.js +0 -2
  150. package/ui/dist/assets/IntelligenceView-DHKwRkc_.js +0 -2
  151. package/ui/dist/assets/SettingsView-DosHEIoU.js +0 -2
@@ -1,4 +1,4 @@
1
- import{c as l,r as n,j as e,as as y,at as j,au as N,av as f,aw as v}from"./index-BISxhHXP.js";import{D as k}from"./DataTable-DtjGbNj5.js";import{P as w}from"./PageHeader-CjDtUo8m.js";import{R as P}from"./refresh-cw-CFv1BDy9.js";import{S as C}from"./shield-check-CKPsc0rI.js";import"./chevron-right-D1DyaeTm.js";/**
1
+ import{c as l,r as n,j as e,as as y,at as j,au as N,av as f,aw as v}from"./index-BlFxPvdg.js";import{D as k}from"./DataTable-CgeOprjv.js";import{P as w}from"./PageHeader-CawSrb9E.js";import{R as P}from"./refresh-cw-BdcqinTm.js";import{S as C}from"./shield-check-BjuAv28a.js";import"./chevron-right-DJCsUSwz.js";/**
2
2
  * @license lucide-react v0.513.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as o,j as e,p as Ne,u as Se,aC as Ce}from"./index-BISxhHXP.js";import{p as ee,f as Me,h as $e,i as De,g as Te,a as de,s as Ae,b as ze,d as Oe,e as Fe}from"./missions-CmBxbp0k.js";import{F as Le}from"./FileViewer-CHrDPOA5.js";function Ee({member:t,room:a,anchor:r,availableModels:s,onClose:d,onTalkInChat:u}){const p=o.useRef(null),[l,v]=o.useState("main"),[y,h]=o.useState(""),[b,c]=o.useState(!1),[m,f]=o.useState(!1),[w,j]=o.useState(null);o.useEffect(()=>{const g=E=>{E.key==="Escape"&&d()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[d]);const A=320,T=360,C=Re(r,A,T);async function S(){f(!0),j(null);try{await ee(a.id,`@${t.name} quick check-in — how's it going? Anything I can clear for you?`),d()}catch(g){j(g.message)}finally{f(!1)}}async function L(g){const E=y.trim();if(!(!E||b)){c(!0),j(null);try{await ee(a.id,`@${t.name} ${g}${E}`),h(""),d()}catch(W){j(W.message)}finally{c(!1)}}}async function z(g){f(!0),j(null);try{await De(a.id,t.agentId,g),v("main")}catch(E){j(E.message)}finally{f(!1)}}async function k(){f(!0),j(null);try{await Me(a.id,t.agentId,!t.paused)}catch(g){j(g.message)}finally{f(!1)}}async function R(){f(!0),j(null);try{await $e(a.id,!a.longRunningMode)}catch(g){j(g.message)}finally{f(!1)}}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[60]",onClick:d,"aria-hidden":!0}),e.jsxs("div",{ref:p,className:"absolute z-[61] flex flex-col titan-modal-surface overflow-hidden",style:{left:C.x,top:C.y,width:A,maxHeight:T,borderRadius:12},onClick:g=>g.stopPropagation(),children:[e.jsx("div",{className:"h-1.5",style:{background:`linear-gradient(90deg, ${t.color}, ${ue(t.color,-25)})`}}),e.jsxs("div",{className:"px-4 pt-3 pb-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center text-white font-bold text-[14px]",style:{background:`linear-gradient(135deg, ${t.color}, ${ue(t.color,-25)})`},children:t.name[0]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm",children:t.name}),e.jsxs("div",{className:"text-[11px] text-text-muted",children:[t.role," · ",Pe(t)]})]}),e.jsx("button",{onClick:d,"aria-label":"Close",className:"titan-close-btn w-7 h-7 rounded-full flex items-center justify-center text-sm",style:{border:"1px solid var(--theme-menu-border)"},children:"✕"})]}),t.currentActivity&&e.jsxs("div",{className:"px-4 pb-2 text-[11px] text-text-secondary italic leading-snug border-b border-border/60",children:['"',t.currentActivity,'"']}),w&&e.jsx("div",{className:"px-4 py-2 text-[11px] text-error bg-error/10 border-b border-error/30",children:w}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l==="main"&&e.jsxs("div",{className:"p-2 grid grid-cols-2 gap-2",children:[e.jsx(H,{icon:"👋",label:"Nudge",hint:"A friendly check-in",onClick:S,disabled:m}),e.jsx(H,{icon:"💬",label:"Talk to them",hint:"Send a message just to them",onClick:()=>{u?(u(t.agentId,`@${t.name} `),d()):v("talk")},disabled:m}),e.jsx(H,{icon:"🧭",label:"Steer",hint:"Redirect them mid-task",onClick:()=>v("steer"),disabled:m}),e.jsx(H,{icon:"🧠",label:"Model",hint:t.modelOverride?Ie(t.modelOverride):"default",onClick:()=>v("model"),disabled:m}),e.jsx(H,{icon:t.paused?"▶":"⏸",label:t.paused?"Resume agent":"Pause agent",hint:t.paused?"Bring them back":"Skip them for now",onClick:k,disabled:m,wide:!1}),e.jsx(H,{icon:"🏃",label:a.longRunningMode?"Marathon ON":"Marathon mode",hint:a.longRunningMode?"running 72h goal":"72h auto-run",onClick:R,disabled:m,active:!!a.longRunningMode})]}),(l==="talk"||l==="steer")&&e.jsxs("div",{className:"p-3 flex flex-col gap-2",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-muted",children:l==="talk"?`Message ${t.name}`:`Steer ${t.name}`}),e.jsx("textarea",{autoFocus:!0,value:y,onChange:g=>h(g.target.value),rows:4,onKeyDown:g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),L(l==="steer"?"steer: ":""))},placeholder:l==="steer"?'e.g. "skip the chart, focus on cost comparison"':"Type a private note to them…",className:"bg-bg-tertiary border border-border rounded-lg p-2 text-sm text-text outline-none focus:border-accent resize-none"}),l==="steer"&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["Slow down","Be thorough","Wrap it up","Skip the chart"].map(g=>e.jsx("button",{onClick:()=>h(g.toLowerCase()),className:"px-2 py-0.5 text-[11px] bg-bg-tertiary border border-border rounded-full text-text-muted hover:text-text",children:g},g))}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("button",{onClick:()=>v("main"),className:"text-xs text-text-muted hover:text-text",children:"← Back"}),e.jsx("button",{onClick:()=>L(l==="steer"?"steer: ":""),disabled:!y.trim()||b,className:"px-3 py-1.5 rounded-lg font-bold text-bg-deep bg-gradient-to-br from-accent to-accent2 disabled:opacity-50 text-xs",children:b?"Sending…":"Send ⌘↵"})]})]}),l==="model"&&e.jsxs("div",{className:"p-3 flex flex-col gap-2",children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-text-muted",children:[t.name,"'s brain"]}),e.jsx("div",{className:"text-[11px] text-text-secondary leading-snug",children:"Pick a specific model for this agent on this mission. Empty = the role's default."}),t.modelOverride&&e.jsxs("div",{className:"px-2.5 py-1.5 rounded-lg bg-accent/10 border border-accent/40 text-[12px] text-text flex items-center justify-between",children:[e.jsxs("span",{className:"truncate",children:["Now: ",e.jsx("b",{children:t.modelOverride})]}),e.jsx("button",{onClick:()=>z(null),className:"text-[11px] text-text-muted hover:text-text shrink-0",children:"clear"})]}),e.jsx("div",{className:"flex flex-col gap-1 max-h-48 overflow-y-auto",children:s.length===0?e.jsx("div",{className:"text-[11px] text-text-muted italic",children:"No models discovered. /api/models returned empty."}):s.map(g=>{const E=t.modelOverride===g.id;return e.jsxs("button",{onClick:()=>z(g.id),disabled:m,className:`flex items-center justify-between px-2.5 py-1.5 rounded-lg text-[12px] border text-left ${E?"bg-accent/10 border-accent/60 text-text":"bg-bg-tertiary/40 border-border text-text-secondary hover:text-text hover:border-border-light"}`,children:[e.jsx("span",{className:"truncate",children:g.id}),e.jsx("span",{className:"text-[10px] text-text-muted ml-2 shrink-0",children:g.provider})]},g.id)})}),e.jsx("button",{onClick:()=>v("main"),className:"text-xs text-text-muted hover:text-text self-start mt-1",children:"← Back"})]})]})]})]})}function H({icon:t,label:a,hint:r,onClick:s,disabled:d,wide:u,active:p}){return e.jsxs("button",{onClick:s,disabled:d,className:`text-left p-2.5 rounded-xl border transition-colors ${p?"bg-accent/15 border-accent/50 text-text":"bg-bg-tertiary/40 border-border text-text-secondary hover:text-text hover:border-border-light"} ${u?"col-span-2":""} disabled:opacity-50`,children:[e.jsx("div",{className:"text-lg leading-none mb-1",children:t}),e.jsx("div",{className:"text-[12px] font-semibold leading-tight",children:a}),r&&e.jsx("div",{className:"text-[10px] text-text-muted leading-snug mt-0.5 truncate",children:r})]})}function Re({x:t,y:a},r,s){const d=window.innerWidth,u=window.innerHeight;return{x:Math.max(8,Math.min(t,d-r-8)),y:Math.max(8,Math.min(a,u-s-8))}}function Pe(t){return t.paused?"paused (by you)":t.state==="working"?"working":t.state==="editing"?"editing":t.state==="blocked"?"needs you":t.state==="done"?"done":"idle"}function Ie(t){return t.length<=24?t:t.slice(0,22)+"…"}function ue(t,a){const r=t.replace("#","");if(r.length!==6)return t;const s=parseInt(r,16);let d=s>>16&255,u=s>>8&255,p=s&255;const l=Math.round(255*(a/100));return d=Math.max(0,Math.min(255,d+l)),u=Math.max(0,Math.min(255,u+l)),p=Math.max(0,Math.min(255,p+l)),"#"+(d<<16|u<<8|p).toString(16).padStart(6,"0")}const Be=12;function Ye(t){const a=new Map;for(const s of t){const d=s.activityLog??[];for(const u of d){const p=`${s.agentId}::${u.activity}`,l=a.get(p);if(!l){a.set(p,{id:p,agentId:s.agentId,agentName:s.name,agentColor:s.color,icon:u.icon,activity:u.activity,detail:u.detail,at:u.at,count:1,recentDetails:u.detail?[u.detail]:[]});continue}l.count+=1,u.at>l.at&&(l.at=u.at,l.icon=u.icon,u.detail&&(l.detail=u.detail)),u.detail&&(l.recentDetails=[u.detail,...l.recentDetails.filter(v=>v!==u.detail)].slice(0,3))}}return Array.from(a.values()).sort((s,d)=>s.at<d.at?1:-1).slice(0,Be)}const We=[{cmd:"/slow down",label:"Slow down",hint:"be more careful"},{cmd:"/be thorough",label:"Be thorough",hint:"dig deeper"},{cmd:"/wrap it up",label:"Wrap it up",hint:"finish what you have"},{cmd:"/pause",label:"Pause",hint:"pause the team"}];function He(t){try{const a=localStorage.getItem(he(t));return a?JSON.parse(a):{}}catch{return{}}}function Ge(t,a){try{localStorage.setItem(he(t),JSON.stringify(a))}catch{}}function he(t){return`titan-desk:${t}`}function fe(t){return`titan-desk-furniture:${t}`}function Ke(t){const a={cabinet:[],trash:[],permanentlyHidden:[],cabinetOpen:!1,trashOpen:!1};try{const r=localStorage.getItem(fe(t));if(!r)return a;const s=JSON.parse(r);return{cabinet:Array.isArray(s.cabinet)?s.cabinet:[],trash:Array.isArray(s.trash)?s.trash:[],permanentlyHidden:Array.isArray(s.permanentlyHidden)?s.permanentlyHidden:[],cabinetOpen:!!s.cabinetOpen,trashOpen:!!s.trashOpen}}catch{return a}}function _e(t,a){try{localStorage.setItem(fe(t),JSON.stringify(a))}catch{}}function $t(){const{id:t}=Ne(),a=Se(),[r,s]=o.useState(null),[d,u]=o.useState(!0),[p,l]=o.useState(null),[v,y]=o.useState(""),[h,b]=o.useState(!1),[c,m]=o.useState(!1),f=o.useRef(null),[w,j]=o.useState(()=>({width:typeof window>"u"?1400:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}));o.useLayoutEffect(()=>{const n=f.current;if(!n)return;const i=()=>{const M=n.getBoundingClientRect();j($=>{const P=Math.max(320,Math.round(M.width)),N=Math.max(320,Math.round(M.height));return $.width===P&&$.height===N?$:{width:P,height:N}})};i();const x=typeof ResizeObserver<"u"?new ResizeObserver(i):null;return x==null||x.observe(n),window.addEventListener("resize",i),()=>{x==null||x.disconnect(),window.removeEventListener("resize",i)}},[d,r==null?void 0:r.id]);const A=o.useCallback(()=>{var i;const n=(i=f.current)==null?void 0:i.getBoundingClientRect();return n||{left:0,top:0,width:typeof window>"u"?1400:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}},[]),T=o.useCallback((n,i)=>{const x=A();return{x:n-x.left,y:i-x.top}},[A]),C=o.useCallback((n,i)=>{const x=T(n,i);return{x:Math.max(8,Math.min(x.x,w.width-328)),y:Math.max(8,Math.min(x.y,w.height-368))}},[w,T]),[S,L]=o.useState({});o.useEffect(()=>{t&&L(He(t))},[t]);const z=o.useCallback(n=>{L(n),t&&Ge(t,n)},[t]),[k,R]=o.useState({cabinet:[],trash:[],permanentlyHidden:[],cabinetOpen:!1,trashOpen:!1});o.useEffect(()=>{t&&R(Ke(t))},[t]);const g=o.useCallback(n=>{R(n),t&&_e(t,n)},[t]),[E,W]=o.useState([]);o.useEffect(()=>{Ce().then(W).catch(()=>W([]))},[]);const[B,G]=o.useState(null),[J,V]=o.useState(null),te=o.useCallback(async n=>{if(t){V({ref:n,loading:!0});try{const i=await Te(t,n);V({ref:n,loading:!1,file:i})}catch(i){V({ref:n,loading:!1,error:i.message})}}},[t]);o.useEffect(()=>{if(!t)return;let n=!0;return u(!0),de(t).then(({mission:i})=>{n&&(s(i),u(!1))}).catch(i=>{n&&(l(i.message),u(!1))}),()=>{n=!1}},[t]),o.useEffect(()=>t?Ae(t,i=>{if(i.kind==="mission_deleted"){a("/mission");return}i.kind!=="hello"&&de(t).then(({mission:x})=>s(x)).catch(()=>{})}):void 0,[t,a]);const ae=o.useCallback(async n=>{if(!(!r||!n.trim()||h)){b(!0);try{await ee(r.id,n.trim()),y("")}catch(i){l(i.message)}finally{b(!1)}}},[r,h]),me=o.useCallback(async(n,i)=>{if(r)try{await ze(r.id,n,i)}catch(x){l(x.message)}},[r]),ge=o.useCallback(async()=>{if(!r)return;const n=r.status==="paused"?"working":"paused";try{await Oe(r.id,n)}catch(i){l(i.message)}},[r]),be=o.useCallback(async()=>{if(!(!r||!window.confirm(`Delete this mission?
1
+ import{r as o,j as e,p as Ne,u as Se,aC as Ce}from"./index-BlFxPvdg.js";import{p as ee,f as Me,h as $e,i as De,g as Te,a as de,s as Ae,b as ze,d as Oe,e as Fe}from"./missions-BUTRB5Lq.js";import{F as Le}from"./FileViewer-B7Mm4cJL.js";function Ee({member:t,room:a,anchor:r,availableModels:s,onClose:d,onTalkInChat:u}){const p=o.useRef(null),[l,v]=o.useState("main"),[y,h]=o.useState(""),[b,c]=o.useState(!1),[m,f]=o.useState(!1),[w,j]=o.useState(null);o.useEffect(()=>{const g=E=>{E.key==="Escape"&&d()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[d]);const A=320,T=360,C=Re(r,A,T);async function S(){f(!0),j(null);try{await ee(a.id,`@${t.name} quick check-in — how's it going? Anything I can clear for you?`),d()}catch(g){j(g.message)}finally{f(!1)}}async function L(g){const E=y.trim();if(!(!E||b)){c(!0),j(null);try{await ee(a.id,`@${t.name} ${g}${E}`),h(""),d()}catch(W){j(W.message)}finally{c(!1)}}}async function z(g){f(!0),j(null);try{await De(a.id,t.agentId,g),v("main")}catch(E){j(E.message)}finally{f(!1)}}async function k(){f(!0),j(null);try{await Me(a.id,t.agentId,!t.paused)}catch(g){j(g.message)}finally{f(!1)}}async function R(){f(!0),j(null);try{await $e(a.id,!a.longRunningMode)}catch(g){j(g.message)}finally{f(!1)}}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[60]",onClick:d,"aria-hidden":!0}),e.jsxs("div",{ref:p,className:"absolute z-[61] flex flex-col titan-modal-surface overflow-hidden",style:{left:C.x,top:C.y,width:A,maxHeight:T,borderRadius:12},onClick:g=>g.stopPropagation(),children:[e.jsx("div",{className:"h-1.5",style:{background:`linear-gradient(90deg, ${t.color}, ${ue(t.color,-25)})`}}),e.jsxs("div",{className:"px-4 pt-3 pb-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center text-white font-bold text-[14px]",style:{background:`linear-gradient(135deg, ${t.color}, ${ue(t.color,-25)})`},children:t.name[0]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm",children:t.name}),e.jsxs("div",{className:"text-[11px] text-text-muted",children:[t.role," · ",Pe(t)]})]}),e.jsx("button",{onClick:d,"aria-label":"Close",className:"titan-close-btn w-7 h-7 rounded-full flex items-center justify-center text-sm",style:{border:"1px solid var(--theme-menu-border)"},children:"✕"})]}),t.currentActivity&&e.jsxs("div",{className:"px-4 pb-2 text-[11px] text-text-secondary italic leading-snug border-b border-border/60",children:['"',t.currentActivity,'"']}),w&&e.jsx("div",{className:"px-4 py-2 text-[11px] text-error bg-error/10 border-b border-error/30",children:w}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l==="main"&&e.jsxs("div",{className:"p-2 grid grid-cols-2 gap-2",children:[e.jsx(H,{icon:"👋",label:"Nudge",hint:"A friendly check-in",onClick:S,disabled:m}),e.jsx(H,{icon:"💬",label:"Talk to them",hint:"Send a message just to them",onClick:()=>{u?(u(t.agentId,`@${t.name} `),d()):v("talk")},disabled:m}),e.jsx(H,{icon:"🧭",label:"Steer",hint:"Redirect them mid-task",onClick:()=>v("steer"),disabled:m}),e.jsx(H,{icon:"🧠",label:"Model",hint:t.modelOverride?Ie(t.modelOverride):"default",onClick:()=>v("model"),disabled:m}),e.jsx(H,{icon:t.paused?"▶":"⏸",label:t.paused?"Resume agent":"Pause agent",hint:t.paused?"Bring them back":"Skip them for now",onClick:k,disabled:m,wide:!1}),e.jsx(H,{icon:"🏃",label:a.longRunningMode?"Marathon ON":"Marathon mode",hint:a.longRunningMode?"running 72h goal":"72h auto-run",onClick:R,disabled:m,active:!!a.longRunningMode})]}),(l==="talk"||l==="steer")&&e.jsxs("div",{className:"p-3 flex flex-col gap-2",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-muted",children:l==="talk"?`Message ${t.name}`:`Steer ${t.name}`}),e.jsx("textarea",{autoFocus:!0,value:y,onChange:g=>h(g.target.value),rows:4,onKeyDown:g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),L(l==="steer"?"steer: ":""))},placeholder:l==="steer"?'e.g. "skip the chart, focus on cost comparison"':"Type a private note to them…",className:"bg-bg-tertiary border border-border rounded-lg p-2 text-sm text-text outline-none focus:border-accent resize-none"}),l==="steer"&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["Slow down","Be thorough","Wrap it up","Skip the chart"].map(g=>e.jsx("button",{onClick:()=>h(g.toLowerCase()),className:"px-2 py-0.5 text-[11px] bg-bg-tertiary border border-border rounded-full text-text-muted hover:text-text",children:g},g))}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("button",{onClick:()=>v("main"),className:"text-xs text-text-muted hover:text-text",children:"← Back"}),e.jsx("button",{onClick:()=>L(l==="steer"?"steer: ":""),disabled:!y.trim()||b,className:"px-3 py-1.5 rounded-lg font-bold text-bg-deep bg-gradient-to-br from-accent to-accent2 disabled:opacity-50 text-xs",children:b?"Sending…":"Send ⌘↵"})]})]}),l==="model"&&e.jsxs("div",{className:"p-3 flex flex-col gap-2",children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-text-muted",children:[t.name,"'s brain"]}),e.jsx("div",{className:"text-[11px] text-text-secondary leading-snug",children:"Pick a specific model for this agent on this mission. Empty = the role's default."}),t.modelOverride&&e.jsxs("div",{className:"px-2.5 py-1.5 rounded-lg bg-accent/10 border border-accent/40 text-[12px] text-text flex items-center justify-between",children:[e.jsxs("span",{className:"truncate",children:["Now: ",e.jsx("b",{children:t.modelOverride})]}),e.jsx("button",{onClick:()=>z(null),className:"text-[11px] text-text-muted hover:text-text shrink-0",children:"clear"})]}),e.jsx("div",{className:"flex flex-col gap-1 max-h-48 overflow-y-auto",children:s.length===0?e.jsx("div",{className:"text-[11px] text-text-muted italic",children:"No models discovered. /api/models returned empty."}):s.map(g=>{const E=t.modelOverride===g.id;return e.jsxs("button",{onClick:()=>z(g.id),disabled:m,className:`flex items-center justify-between px-2.5 py-1.5 rounded-lg text-[12px] border text-left ${E?"bg-accent/10 border-accent/60 text-text":"bg-bg-tertiary/40 border-border text-text-secondary hover:text-text hover:border-border-light"}`,children:[e.jsx("span",{className:"truncate",children:g.id}),e.jsx("span",{className:"text-[10px] text-text-muted ml-2 shrink-0",children:g.provider})]},g.id)})}),e.jsx("button",{onClick:()=>v("main"),className:"text-xs text-text-muted hover:text-text self-start mt-1",children:"← Back"})]})]})]})]})}function H({icon:t,label:a,hint:r,onClick:s,disabled:d,wide:u,active:p}){return e.jsxs("button",{onClick:s,disabled:d,className:`text-left p-2.5 rounded-xl border transition-colors ${p?"bg-accent/15 border-accent/50 text-text":"bg-bg-tertiary/40 border-border text-text-secondary hover:text-text hover:border-border-light"} ${u?"col-span-2":""} disabled:opacity-50`,children:[e.jsx("div",{className:"text-lg leading-none mb-1",children:t}),e.jsx("div",{className:"text-[12px] font-semibold leading-tight",children:a}),r&&e.jsx("div",{className:"text-[10px] text-text-muted leading-snug mt-0.5 truncate",children:r})]})}function Re({x:t,y:a},r,s){const d=window.innerWidth,u=window.innerHeight;return{x:Math.max(8,Math.min(t,d-r-8)),y:Math.max(8,Math.min(a,u-s-8))}}function Pe(t){return t.paused?"paused (by you)":t.state==="working"?"working":t.state==="editing"?"editing":t.state==="blocked"?"needs you":t.state==="done"?"done":"idle"}function Ie(t){return t.length<=24?t:t.slice(0,22)+"…"}function ue(t,a){const r=t.replace("#","");if(r.length!==6)return t;const s=parseInt(r,16);let d=s>>16&255,u=s>>8&255,p=s&255;const l=Math.round(255*(a/100));return d=Math.max(0,Math.min(255,d+l)),u=Math.max(0,Math.min(255,u+l)),p=Math.max(0,Math.min(255,p+l)),"#"+(d<<16|u<<8|p).toString(16).padStart(6,"0")}const Be=12;function Ye(t){const a=new Map;for(const s of t){const d=s.activityLog??[];for(const u of d){const p=`${s.agentId}::${u.activity}`,l=a.get(p);if(!l){a.set(p,{id:p,agentId:s.agentId,agentName:s.name,agentColor:s.color,icon:u.icon,activity:u.activity,detail:u.detail,at:u.at,count:1,recentDetails:u.detail?[u.detail]:[]});continue}l.count+=1,u.at>l.at&&(l.at=u.at,l.icon=u.icon,u.detail&&(l.detail=u.detail)),u.detail&&(l.recentDetails=[u.detail,...l.recentDetails.filter(v=>v!==u.detail)].slice(0,3))}}return Array.from(a.values()).sort((s,d)=>s.at<d.at?1:-1).slice(0,Be)}const We=[{cmd:"/slow down",label:"Slow down",hint:"be more careful"},{cmd:"/be thorough",label:"Be thorough",hint:"dig deeper"},{cmd:"/wrap it up",label:"Wrap it up",hint:"finish what you have"},{cmd:"/pause",label:"Pause",hint:"pause the team"}];function He(t){try{const a=localStorage.getItem(he(t));return a?JSON.parse(a):{}}catch{return{}}}function Ge(t,a){try{localStorage.setItem(he(t),JSON.stringify(a))}catch{}}function he(t){return`titan-desk:${t}`}function fe(t){return`titan-desk-furniture:${t}`}function Ke(t){const a={cabinet:[],trash:[],permanentlyHidden:[],cabinetOpen:!1,trashOpen:!1};try{const r=localStorage.getItem(fe(t));if(!r)return a;const s=JSON.parse(r);return{cabinet:Array.isArray(s.cabinet)?s.cabinet:[],trash:Array.isArray(s.trash)?s.trash:[],permanentlyHidden:Array.isArray(s.permanentlyHidden)?s.permanentlyHidden:[],cabinetOpen:!!s.cabinetOpen,trashOpen:!!s.trashOpen}}catch{return a}}function _e(t,a){try{localStorage.setItem(fe(t),JSON.stringify(a))}catch{}}function $t(){const{id:t}=Ne(),a=Se(),[r,s]=o.useState(null),[d,u]=o.useState(!0),[p,l]=o.useState(null),[v,y]=o.useState(""),[h,b]=o.useState(!1),[c,m]=o.useState(!1),f=o.useRef(null),[w,j]=o.useState(()=>({width:typeof window>"u"?1400:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}));o.useLayoutEffect(()=>{const n=f.current;if(!n)return;const i=()=>{const M=n.getBoundingClientRect();j($=>{const P=Math.max(320,Math.round(M.width)),N=Math.max(320,Math.round(M.height));return $.width===P&&$.height===N?$:{width:P,height:N}})};i();const x=typeof ResizeObserver<"u"?new ResizeObserver(i):null;return x==null||x.observe(n),window.addEventListener("resize",i),()=>{x==null||x.disconnect(),window.removeEventListener("resize",i)}},[d,r==null?void 0:r.id]);const A=o.useCallback(()=>{var i;const n=(i=f.current)==null?void 0:i.getBoundingClientRect();return n||{left:0,top:0,width:typeof window>"u"?1400:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}},[]),T=o.useCallback((n,i)=>{const x=A();return{x:n-x.left,y:i-x.top}},[A]),C=o.useCallback((n,i)=>{const x=T(n,i);return{x:Math.max(8,Math.min(x.x,w.width-328)),y:Math.max(8,Math.min(x.y,w.height-368))}},[w,T]),[S,L]=o.useState({});o.useEffect(()=>{t&&L(He(t))},[t]);const z=o.useCallback(n=>{L(n),t&&Ge(t,n)},[t]),[k,R]=o.useState({cabinet:[],trash:[],permanentlyHidden:[],cabinetOpen:!1,trashOpen:!1});o.useEffect(()=>{t&&R(Ke(t))},[t]);const g=o.useCallback(n=>{R(n),t&&_e(t,n)},[t]),[E,W]=o.useState([]);o.useEffect(()=>{Ce().then(W).catch(()=>W([]))},[]);const[B,G]=o.useState(null),[J,V]=o.useState(null),te=o.useCallback(async n=>{if(t){V({ref:n,loading:!0});try{const i=await Te(t,n);V({ref:n,loading:!1,file:i})}catch(i){V({ref:n,loading:!1,error:i.message})}}},[t]);o.useEffect(()=>{if(!t)return;let n=!0;return u(!0),de(t).then(({mission:i})=>{n&&(s(i),u(!1))}).catch(i=>{n&&(l(i.message),u(!1))}),()=>{n=!1}},[t]),o.useEffect(()=>t?Ae(t,i=>{if(i.kind==="mission_deleted"){a("/mission");return}i.kind!=="hello"&&de(t).then(({mission:x})=>s(x)).catch(()=>{})}):void 0,[t,a]);const ae=o.useCallback(async n=>{if(!(!r||!n.trim()||h)){b(!0);try{await ee(r.id,n.trim()),y("")}catch(i){l(i.message)}finally{b(!1)}}},[r,h]),me=o.useCallback(async(n,i)=>{if(r)try{await ze(r.id,n,i)}catch(x){l(x.message)}},[r]),ge=o.useCallback(async()=>{if(!r)return;const n=r.status==="paused"?"working":"paused";try{await Oe(r.id,n)}catch(i){l(i.message)}},[r]),be=o.useCallback(async()=>{if(!(!r||!window.confirm(`Delete this mission?
2
2
 
3
3
  "${r.goal.slice(0,120)}${r.goal.length>120?"…":""}"
4
4
 
@@ -1,4 +1,4 @@
1
- import{r as o,j as e,R as E,p as q,u as W}from"./index-BISxhHXP.js";import{g as G,a as R,s as K,p as V,b as Y,d as Q,e as X}from"./missions-CmBxbp0k.js";import{F as J}from"./FileViewer-CHrDPOA5.js";const Z=/\bhttps?:\/\/[^\s<>()[\]"']+[^\s<>()[\]"',.!?;:]/gi;function ee(t){if(!t)return[];const a=[];let r=0;for(const s of t.matchAll(Z))s.index!==void 0&&(s.index>r&&a.push(t.slice(r,s.index)),a.push({url:s[0]}),r=s.index+s[0].length);return r<t.length&&a.push(t.slice(r)),a}function v(t){try{const a=new URL(t),r=a.host.replace(/^www\./,""),s=(a.pathname+a.search+a.hash).replace(/^\//,"");if(s.length===0)return r;const i=`${r}/${s}`;return i.length<=60?i:i.slice(0,57)+"…"}catch{return t.length<=60?t:t.slice(0,57)+"…"}}function te({text:t,sources:a,onOpenFile:r}){const s=o.useMemo(()=>ee(t),[t]),i=o.useMemo(()=>(a??[]).filter(n=>n.type==="url"),[a]),u=o.useMemo(()=>(a??[]).filter(n=>n.type!=="url"),[a]),d=o.useMemo(()=>{const n=new Set;for(const c of s)typeof c!="string"&&n.add(c.url);return n},[s]),m=o.useMemo(()=>i.filter(n=>!d.has(n.ref)),[i,d]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"whitespace-pre-wrap",children:s.map((n,c)=>typeof n=="string"?e.jsx(E.Fragment,{children:n},c):e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),className:"text-accent hover:text-accent2 underline underline-offset-2 break-all",children:v(n.url)},c))}),(m.length>0||u.length>0)&&e.jsxs("div",{className:"mt-3 pt-2.5 border-t border-border/50",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-muted mb-1.5",children:"Sources"}),m.length>0&&e.jsx("ul",{className:"space-y-1 mb-1.5",children:m.map((n,c)=>e.jsxs("li",{className:"text-[12px] leading-snug",children:[e.jsx("span",{className:"mr-1.5",children:"🔗"}),e.jsx("a",{href:n.ref,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),className:"text-accent hover:text-accent2 underline underline-offset-2 break-all",title:n.ref,children:n.description??v(n.ref)}),n.description&&e.jsxs("span",{className:"text-text-muted ml-2 text-[11px]",children:["(",v(n.ref),")"]})]},`u-${c}`))}),u.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:u.map((n,c)=>{const p=n.type==="file"?"📄":n.type==="fact"?"💡":"📊",f=n.ref.length>50?n.ref.slice(0,47)+"…":n.ref;return(n.type==="file"||n.type==="report")&&!!r?e.jsxs("button",{type:"button",onClick:j=>{j.stopPropagation(),r(n.ref,n.type)},className:"inline-flex items-center gap-1.5 px-2 py-0.5 bg-bg-tertiary/60 border border-border rounded-full text-[11px] text-text-secondary hover:bg-accent/15 hover:text-text hover:border-accent/40 transition-colors cursor-pointer",title:`Open ${n.ref}${n.description?" — "+n.description:""}`,children:[p," ",e.jsx("b",{className:"text-text font-medium",children:f}),e.jsx("span",{className:"text-text-muted text-[10px]",children:"↗"})]},`o-${c}`):e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 bg-bg-tertiary/60 border border-border rounded-full text-[11px] text-text-secondary",title:n.description??n.ref,children:[p," ",e.jsx("b",{className:"text-text font-medium",children:f})]},`o-${c}`)})})]})]})}function ge(){const{id:t}=q(),a=W(),[r,s]=o.useState(null),[i,u]=o.useState(!0),[d,m]=o.useState(null),[n,c]=o.useState(""),[p,f]=o.useState(!1),[k,j]=o.useState(!1),[I,S]=o.useState(!1),[A,L]=o.useState(new Set),U=o.useCallback(l=>{L(x=>{const h=new Set(x);return h.has(l)?h.delete(l):h.add(l),h})},[]),C=o.useRef(null),$=o.useRef(null),F=o.useRef(!0),[T,b]=o.useState(null),B=o.useCallback(async l=>{if(t){b({ref:l,loading:!0});try{const x=await G(t,l);b({ref:l,loading:!1,file:x})}catch(x){b({ref:l,loading:!1,error:x.message})}}},[t]),O=o.useCallback(()=>b(null),[]);o.useEffect(()=>{if(!t)return;let l=!0;return u(!0),R(t).then(({mission:x})=>{l&&(s(x),u(!1))}).catch(x=>{l&&(m(x.message),u(!1))}),()=>{l=!1}},[t]),o.useEffect(()=>t?K(t,x=>{if(x.kind==="mission_deleted"){a("/mission");return}x.kind!=="hello"&&R(t).then(({mission:h})=>s(h)).catch(()=>{})}):void 0,[t,a]),o.useEffect(()=>{const l=C.current;if(!l)return;const x=()=>{F.current=l.scrollHeight-l.scrollTop-l.clientHeight<100};return x(),l.addEventListener("scroll",x,{passive:!0}),()=>{l.removeEventListener("scroll",x)}},[r==null?void 0:r.id]),o.useEffect(()=>{if(!F.current)return;const l=$.current;l&&l.scrollIntoView({behavior:"smooth",block:"end"})},[r==null?void 0:r.messages.length]);const P=o.useCallback(async()=>{if(!(!r||!n.trim()||p)){f(!0);try{await V(r.id,n.trim()),c("")}catch(l){m(l.message)}finally{f(!1)}}},[r,n,p]),_=o.useCallback(async(l,x)=>{if(r)try{await Y(r.id,l,x)}catch(h){m(h.message)}},[r]),z=o.useCallback(async()=>{if(!r)return;const l=r.status==="paused"?"working":"paused";try{await Q(r.id,l)}catch(x){m(x.message)}},[r]),H=o.useCallback(async()=>{if(!(!r||!window.confirm(`Delete this mission?
1
+ import{r as o,j as e,R as E,p as q,u as W}from"./index-BlFxPvdg.js";import{g as G,a as R,s as K,p as V,b as Y,d as Q,e as X}from"./missions-BUTRB5Lq.js";import{F as J}from"./FileViewer-B7Mm4cJL.js";const Z=/\bhttps?:\/\/[^\s<>()[\]"']+[^\s<>()[\]"',.!?;:]/gi;function ee(t){if(!t)return[];const a=[];let r=0;for(const s of t.matchAll(Z))s.index!==void 0&&(s.index>r&&a.push(t.slice(r,s.index)),a.push({url:s[0]}),r=s.index+s[0].length);return r<t.length&&a.push(t.slice(r)),a}function v(t){try{const a=new URL(t),r=a.host.replace(/^www\./,""),s=(a.pathname+a.search+a.hash).replace(/^\//,"");if(s.length===0)return r;const i=`${r}/${s}`;return i.length<=60?i:i.slice(0,57)+"…"}catch{return t.length<=60?t:t.slice(0,57)+"…"}}function te({text:t,sources:a,onOpenFile:r}){const s=o.useMemo(()=>ee(t),[t]),i=o.useMemo(()=>(a??[]).filter(n=>n.type==="url"),[a]),u=o.useMemo(()=>(a??[]).filter(n=>n.type!=="url"),[a]),d=o.useMemo(()=>{const n=new Set;for(const c of s)typeof c!="string"&&n.add(c.url);return n},[s]),m=o.useMemo(()=>i.filter(n=>!d.has(n.ref)),[i,d]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"whitespace-pre-wrap",children:s.map((n,c)=>typeof n=="string"?e.jsx(E.Fragment,{children:n},c):e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),className:"text-accent hover:text-accent2 underline underline-offset-2 break-all",children:v(n.url)},c))}),(m.length>0||u.length>0)&&e.jsxs("div",{className:"mt-3 pt-2.5 border-t border-border/50",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-muted mb-1.5",children:"Sources"}),m.length>0&&e.jsx("ul",{className:"space-y-1 mb-1.5",children:m.map((n,c)=>e.jsxs("li",{className:"text-[12px] leading-snug",children:[e.jsx("span",{className:"mr-1.5",children:"🔗"}),e.jsx("a",{href:n.ref,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),className:"text-accent hover:text-accent2 underline underline-offset-2 break-all",title:n.ref,children:n.description??v(n.ref)}),n.description&&e.jsxs("span",{className:"text-text-muted ml-2 text-[11px]",children:["(",v(n.ref),")"]})]},`u-${c}`))}),u.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:u.map((n,c)=>{const p=n.type==="file"?"📄":n.type==="fact"?"💡":"📊",f=n.ref.length>50?n.ref.slice(0,47)+"…":n.ref;return(n.type==="file"||n.type==="report")&&!!r?e.jsxs("button",{type:"button",onClick:j=>{j.stopPropagation(),r(n.ref,n.type)},className:"inline-flex items-center gap-1.5 px-2 py-0.5 bg-bg-tertiary/60 border border-border rounded-full text-[11px] text-text-secondary hover:bg-accent/15 hover:text-text hover:border-accent/40 transition-colors cursor-pointer",title:`Open ${n.ref}${n.description?" — "+n.description:""}`,children:[p," ",e.jsx("b",{className:"text-text font-medium",children:f}),e.jsx("span",{className:"text-text-muted text-[10px]",children:"↗"})]},`o-${c}`):e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 bg-bg-tertiary/60 border border-border rounded-full text-[11px] text-text-secondary",title:n.description??n.ref,children:[p," ",e.jsx("b",{className:"text-text font-medium",children:f})]},`o-${c}`)})})]})]})}function ge(){const{id:t}=q(),a=W(),[r,s]=o.useState(null),[i,u]=o.useState(!0),[d,m]=o.useState(null),[n,c]=o.useState(""),[p,f]=o.useState(!1),[k,j]=o.useState(!1),[I,S]=o.useState(!1),[A,L]=o.useState(new Set),U=o.useCallback(l=>{L(x=>{const h=new Set(x);return h.has(l)?h.delete(l):h.add(l),h})},[]),C=o.useRef(null),$=o.useRef(null),F=o.useRef(!0),[T,b]=o.useState(null),B=o.useCallback(async l=>{if(t){b({ref:l,loading:!0});try{const x=await G(t,l);b({ref:l,loading:!1,file:x})}catch(x){b({ref:l,loading:!1,error:x.message})}}},[t]),O=o.useCallback(()=>b(null),[]);o.useEffect(()=>{if(!t)return;let l=!0;return u(!0),R(t).then(({mission:x})=>{l&&(s(x),u(!1))}).catch(x=>{l&&(m(x.message),u(!1))}),()=>{l=!1}},[t]),o.useEffect(()=>t?K(t,x=>{if(x.kind==="mission_deleted"){a("/mission");return}x.kind!=="hello"&&R(t).then(({mission:h})=>s(h)).catch(()=>{})}):void 0,[t,a]),o.useEffect(()=>{const l=C.current;if(!l)return;const x=()=>{F.current=l.scrollHeight-l.scrollTop-l.clientHeight<100};return x(),l.addEventListener("scroll",x,{passive:!0}),()=>{l.removeEventListener("scroll",x)}},[r==null?void 0:r.id]),o.useEffect(()=>{if(!F.current)return;const l=$.current;l&&l.scrollIntoView({behavior:"smooth",block:"end"})},[r==null?void 0:r.messages.length]);const P=o.useCallback(async()=>{if(!(!r||!n.trim()||p)){f(!0);try{await V(r.id,n.trim()),c("")}catch(l){m(l.message)}finally{f(!1)}}},[r,n,p]),_=o.useCallback(async(l,x)=>{if(r)try{await Y(r.id,l,x)}catch(h){m(h.message)}},[r]),z=o.useCallback(async()=>{if(!r)return;const l=r.status==="paused"?"working":"paused";try{await Q(r.id,l)}catch(x){m(x.message)}},[r]),H=o.useCallback(async()=>{if(!(!r||!window.confirm(`Delete this mission?
2
2
 
3
3
  "${r.goal.slice(0,120)}${r.goal.length>120?"…":""}"
4
4
 
@@ -1,4 +1,4 @@
1
- import{u as M,r as m,j as e}from"./index-BISxhHXP.js";import{l as j,e as D}from"./missions-CmBxbp0k.js";const T=258;function z(){const a=M(),[r,s]=m.useState(null),[o,i]=m.useState(null),[l,c]=m.useState("all"),[d,F]=m.useState("");m.useEffect(()=>{let t=!0;return j().then(({missions:n})=>{t&&s(n)}).catch(n=>{t&&i(n.message)}),()=>{t=!1}},[]);const S=m.useCallback(()=>{s(null),j().then(({missions:t})=>s(t)).catch(t=>i(t.message))},[]),p=m.useCallback(async(t,n)=>{if(window.confirm(`Delete this mission?
1
+ import{u as M,r as m,j as e}from"./index-BlFxPvdg.js";import{l as j,e as D}from"./missions-BUTRB5Lq.js";const T=258;function z(){const a=M(),[r,s]=m.useState(null),[o,i]=m.useState(null),[l,c]=m.useState("all"),[d,F]=m.useState("");m.useEffect(()=>{let t=!0;return j().then(({missions:n})=>{t&&s(n)}).catch(n=>{t&&i(n.message)}),()=>{t=!1}},[]);const S=m.useCallback(()=>{s(null),j().then(({missions:t})=>s(t)).catch(t=>i(t.message))},[]),p=m.useCallback(async(t,n)=>{if(window.confirm(`Delete this mission?
2
2
 
3
3
  "${n.slice(0,120)}${n.length>120?"…":""}"
4
4
 
@@ -1 +1 @@
1
- import{r as b,u as W,j as e}from"./index-BISxhHXP.js";import{c as _}from"./missions-CmBxbp0k.js";const G={id:"hourly",label:"Every hour",cron:"0 * * * *",cadence:"24 runs/day"},L={id:"every4h",label:"Every 4 hours",cron:"0 */4 * * *",cadence:"6 runs/day"},A={id:"every6h",label:"Every 6 hours",cron:"0 */6 * * *",cadence:"4 runs/day"},I={id:"daily7",label:"Daily at 7am",cron:"0 7 * * *",cadence:"once/day"},M={id:"weekly",label:"Weekly (Mon 9am)",cron:"0 9 * * 1",cadence:"once/week"},H={id:"nightly",label:"Nightly at 11pm",cron:"0 23 * * *",cadence:"once/day"},D={id:"twice",label:"Twice daily (7am + 7pm)",cron:"0 7,19 * * *",cadence:"2 runs/day"},V=[{id:"research-digest",icon:"📰",title:"Daily research digest",blurb:"Scout researches your topic and writes a fresh briefing for the first run.",goalTemplate:'Research the latest developments on "{{topic}}" and produce a clear HTML briefing (write_file with a .html extension) with 5 highlights, an inline SVG chart of the most important trend, and clickable source links throughout.',suggestedPlayId:"research",fields:[{key:"topic",label:"Your topic",hint:"What you want a fresh briefing on each morning",defaultValue:"AI agents in business",placeholder:"AI agents in business"}],schedules:[I,D,M],whatItDoes:"Scout searches the web for fresh developments on your topic, reads the top 5 sources end-to-end, and writes a one-page briefing. The briefing lands on your desk as a paper sheet, and the chat thread captures every URL Scout looked at so you can dig in further if anything catches your eye.",accent:{from:"#6366f1",to:"#8b5cf6"}},{id:"inbox-triage",icon:"📬",title:"Inbox triage",blurb:"Sage sorts and summarizes incoming email so important threads stay visible.",goalTemplate:'Read my inbox and produce a triaged summary: "needs reply within 24h", "informational", "newsletters", and "junk". Cap at 30 messages per run.',suggestedPlayId:"inbox",fields:[],schedules:[L,A,I],whatItDoes:"Sage opens your inbox, classifies up to 30 recent threads into four buckets (urgent / informational / newsletters / junk), and pins the urgent ones to the desk as sticky notes. The full triage lands as a paper sheet you can scan in under a minute.",accent:{from:"#06b6d4",to:"#0ea5e9"}},{id:"code-review",icon:"🔍",title:"Code review",blurb:"Builder reviews your repo changes and reports only meaningful findings.",goalTemplate:"Review the diff in {{repoPath}} since the last review. Flag bugs, regressions, and obvious improvements. Don't nitpick formatting.",suggestedPlayId:"code-review",fields:[{key:"repoPath",label:"Repo path or URL",hint:"Local path on the host, or a GitHub repo URL",defaultValue:"~/Desktop/MyProject",placeholder:"~/projects/repo"}],schedules:[H,D],whatItDoes:"Builder pulls the latest changes from your repo and writes a concise review focused on real defects (logic bugs, regressions, security smells). Formatting nits are skipped. Findings land as a paper sheet; if there's nothing to report, Builder closes silently.",accent:{from:"#22c55e",to:"#10b981"}},{id:"lead-scout",icon:"🎯",title:"Lead scout",blurb:"Scout scans freelance + opportunity boards and surfaces matches for your skills.",goalTemplate:'Scan Upwork, Indeed, and HackerNews "who is hiring" for new postings matching: {{skills}}. Filter to budget >= ${{minBudget}} and remote OK.',suggestedPlayId:"lead-scout",fields:[{key:"skills",label:"Skills to match",hint:"Comma-separated keywords. Scout fuzzy-matches.",defaultValue:"TypeScript, Node.js, AI agents",placeholder:"React, Python, design"},{key:"minBudget",label:"Minimum budget (USD)",hint:"Skip postings paying less.",defaultValue:"500"}],schedules:[L,A,I],whatItDoes:"Scout sweeps the boards you care about for postings that match your skill keywords and budget floor. New matches land as sticky notes; the running log of every posting seen sits as a paper sheet you can browse anytime.",accent:{from:"#f59e0b",to:"#eab308"}},{id:"market-watch",icon:"📈",title:"Market watch",blurb:"Analyst tracks tickers + crypto and writes a brief if anything moves >3%.",goalTemplate:"Check the latest price + 24h move for: {{tickers}}. If any moved more than 3% (up or down) since the last run, produce an HTML brief (write_file with a .html extension) with a sparkline SVG per ticker and a one-paragraph explanation with 2 source links.",suggestedPlayId:"analyst",fields:[{key:"tickers",label:"Tickers / coins",hint:"Comma-separated. Stocks or crypto.",defaultValue:"BTC, ETH, NVDA, AAPL",placeholder:"TSLA, SPY, BTC"}],schedules:[G,L,A],whatItDoes:"Each cycle, Analyst pulls the latest price and 24-hour move for every ticker you listed. If anything jumped or dropped more than 3%, it writes a one-paragraph explanation with 2 source links. Quiet runs close silently — your desk only fills up when something actually moved.",accent:{from:"#ef4444",to:"#f97316"}},{id:"creative-prompts",icon:"🎨",title:"Daily creative prompt",blurb:"Writer creates a fresh writing, sketching, or music prompt for the first run.",goalTemplate:"Generate a fresh {{discipline}} prompt for me today. Make it specific enough to start in 5 minutes but open enough to take in any direction. Include a 1-line warm-up exercise.",fields:[{key:"discipline",label:"Discipline",hint:"What kind of prompt you want.",defaultValue:"songwriting",placeholder:"short fiction · songwriting · sketching"}],schedules:[I,M],whatItDoes:"Writer creates one fresh creative prompt tailored to the discipline you chose, with a quick warm-up exercise to get started. The prompt lands as a sticky note on the desk so you can grab it when you need it.",accent:{from:"#ec4899",to:"#8b5cf6"}}];function Y(s,n){return s.goalTemplate.replace(/\{\{(\w+)\}\}/g,(i,r)=>{const u=n[r];return u&&u.trim().length>0?u.trim():r})}const z=["Plan my mom's 70th birthday party","Write a thank-you note to my landlord","Summarize this long email I got","Draft the Q1 investor update","Review a code change"],x="var(--theme-font-display, 'Iowan Old Style', 'Charter', Georgia, serif)",d="var(--theme-font-mono, 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace)",c="var(--theme-paper, #f3e9d0)",o="var(--theme-ink-soft, #a0a8d0)",t="var(--theme-metal, #c4a35a)",g="var(--theme-metal-bright, #f3d27a)",m="var(--theme-metal-dark, #8a6a3a)",F="var(--theme-bolt, #2a1808)",E="var(--theme-leather, #4a2818)",v="var(--theme-leather-edge, #2a1408)",U="var(--theme-leather-stitch, #d4a060)",h="var(--theme-bg-base, #1a1235)",R="var(--theme-bg-grain, #0e0820)",K="var(--theme-bg-vignette, rgba(0,0,0,0.6))",j="var(--theme-shadow, rgba(0,0,0,0.55))",Q="var(--theme-accent, #c45a30)";function ee(){const[s,n]=b.useState(""),[i,r]=b.useState(!1),[u,N]=b.useState(null),[$,k]=b.useState(null),S=W();async function y(a,p){const f=a.trim();if(!(!f||i)){r(!0),N(null);try{const{mission:w}=await _(f,p);S(`/mission/${w.id}`)}catch(w){N(w.message),r(!1)}}}return e.jsxs("div",{className:"min-h-full w-full flex flex-col items-center",style:{color:c,fontFamily:x,background:`radial-gradient(120% 80% at 50% -10%, ${R} 0%, ${h} 60%, ${h} 100%)`},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:`radial-gradient(circle at 50% 12%, ${Q}22 0%, transparent 55%)`}}),e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{boxShadow:`inset 0 0 240px 60px ${K}`}}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-8 w-full max-w-5xl px-6 pt-10 pb-28 md:py-14",children:[e.jsxs("div",{className:"w-full flex items-center",style:{paddingRight:260},children:[e.jsxs("div",{className:"flex items-center gap-3 text-[11px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:[e.jsx("span",{style:{color:g,fontWeight:700},children:"TITAN"}),e.jsx("span",{style:{opacity:.6},children:"·"}),e.jsx("span",{children:"MISSION CONTROL"})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx(P,{onClick:()=>S("/mission/library"),title:"See your past missions",children:"Past missions →"}),e.jsx(P,{onClick:()=>S("/space/home"),title:"Back to the canvas spaces",children:"🌌 Canvas"})]})]}),e.jsxs("section",{className:"relative w-full max-w-3xl rounded-3xl overflow-hidden",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${v}`,boxShadow:`0 30px 80px ${j}, inset 0 1px 0 ${t}33`,padding:"36px 36px 28px"},children:[e.jsx(C,{position:"tl"}),e.jsx(C,{position:"tr"}),e.jsx(C,{position:"bl"}),e.jsx(C,{position:"br"}),e.jsx("div",{className:"text-[10px] uppercase tracking-[0.4em] mb-3",style:{color:t,fontFamily:d,fontWeight:600},children:"◆ New Mission"}),e.jsx("h1",{className:"text-4xl md:text-5xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600,letterSpacing:0,textShadow:`0 2px 12px ${j}`},children:"What's the mission?"}),e.jsx("p",{className:"mt-3 text-[15px] leading-relaxed max-w-xl",style:{color:o},children:"Tell me anything — a thank-you note, a birthday plan, a Q1 report. I’ll assemble a small team of AI specialists and we’ll work it out together."}),e.jsxs("form",{onSubmit:a=>{a.preventDefault(),y(s)},className:"mt-6 flex flex-col gap-3",children:[e.jsx("textarea",{autoFocus:!0,value:s,onChange:a=>n(a.target.value),placeholder:"Try: Help me write a birthday speech for my mom",rows:3,disabled:i,className:"w-full resize-none outline-none rounded-2xl px-5 py-4 text-base leading-relaxed",style:{background:`${h}80`,color:c,border:`1px solid ${t}44`,fontFamily:x,boxShadow:`inset 0 2px 8px ${j}`},onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&(a.preventDefault(),y(s))}}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"⌘↵ to dispatch · voice coming soon"}),e.jsxs("div",{className:"flex w-full items-center gap-2 sm:w-auto",children:[e.jsx("button",{type:"button",disabled:!0,title:"Voice is coming next release",className:"w-11 h-11 rounded-full flex items-center justify-center cursor-not-allowed",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o,opacity:.55},children:"🎤"}),e.jsx("button",{type:"submit",disabled:!s.trim()||i,className:"h-11 flex-1 rounded-xl px-5 text-sm font-bold tracking-wide transition-transform sm:flex-none",style:{background:s.trim()&&!i?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}66`,color:s.trim()&&!i?F:o,border:`1px solid ${m}`,boxShadow:s.trim()&&!i?`0 6px 18px ${j}, inset 0 1px 0 ${g}`:"none",cursor:s.trim()&&!i?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},onMouseDown:a=>{s.trim()&&!i&&(a.currentTarget.style.transform="translateY(1px)")},onMouseUp:a=>{a.currentTarget.style.transform=""},onMouseLeave:a=>{a.currentTarget.style.transform=""},children:i?"Dispatching…":"Start mission →"})]})]})]}),u&&e.jsx("div",{className:"mt-4 text-sm rounded-lg px-3 py-2",style:{color:"#ffb4a8",background:"#5a1a1a55",border:"1px solid #8a3a3a"},children:u})]}),e.jsxs("div",{className:"w-full max-w-3xl flex flex-col items-center gap-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.35em]",style:{color:o,fontFamily:d},children:"— or try a one-shot —"}),e.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:z.map(a=>e.jsx("button",{type:"button",onClick:()=>y(a),disabled:i,className:"px-3 py-1.5 text-xs rounded-full transition-colors disabled:opacity-50",style:{background:`${v}99`,color:c,border:`1px solid ${t}33`,fontFamily:x},onMouseEnter:p=>{p.currentTarget.style.borderColor=`${t}88`,p.currentTarget.style.background=`${E}`},onMouseLeave:p=>{p.currentTarget.style.borderColor=`${t}33`,p.currentTarget.style.background=`${v}99`},children:a},a))})]}),e.jsxs("section",{className:"w-full mt-4 flex flex-col gap-4",children:[e.jsxs("header",{className:"flex items-baseline justify-between pb-3",style:{borderBottom:`1px solid ${t}33`},children:[e.jsxs("h2",{className:"text-xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600},children:["Mission starters",e.jsx("span",{className:"ml-3 text-[10px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:"saved cadence"})]}),e.jsx("span",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"click → 3 steps → launch"})]}),e.jsx("p",{className:"text-sm leading-relaxed max-w-2xl",style:{color:o},children:"Pick a starter recipe, customize it, and launch the first run. TITAN saves the cadence with the mission request."}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3 mt-2",children:V.map(a=>e.jsx(J,{template:a,onClick:()=>k(a)},a.id))})]}),e.jsx("div",{className:"h-20"})]}),$&&e.jsx(q,{template:$,onClose:()=>k(null),onLaunch:async(a,p,f)=>{try{const w=JSON.parse(localStorage.getItem("titan-pending-schedules")??"[]");w.push({at:new Date().toISOString(),templateId:$.id,goal:a,scheduleId:p}),localStorage.setItem("titan-pending-schedules",JSON.stringify(w))}catch{}k(null),await y(a,f)}})]})}function P({onClick:s,title:n,children:i}){return e.jsx("button",{onClick:s,title:n,className:"px-3 py-1 text-[10px] uppercase tracking-[0.2em] rounded-full transition-colors",style:{color:o,border:`1px solid ${t}33`,background:"transparent",fontFamily:d},onMouseEnter:r=>{r.currentTarget.style.color=c,r.currentTarget.style.borderColor=`${t}99`},onMouseLeave:r=>{r.currentTarget.style.color=o,r.currentTarget.style.borderColor=`${t}33`},children:i})}function C({position:s}){const n={position:"absolute"};return s==="tl"&&(n.top=10,n.left=10),s==="tr"&&(n.top=10,n.right=10),s==="bl"&&(n.bottom=10,n.left=10),s==="br"&&(n.bottom=10,n.right=10),e.jsx("div",{style:{...n,width:6,height:6,borderRadius:"50%",background:t,boxShadow:`0 0 6px ${g}, inset 0 1px 0 ${g}`,opacity:.7,pointerEvents:"none"}})}function J({template:s,onClick:n}){const[i,r]=b.useState(!1);return e.jsxs("button",{type:"button",onClick:n,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),className:"text-left rounded-2xl relative overflow-hidden transition-all",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${i?t:v}`,boxShadow:i?`0 14px 36px ${j}, inset 0 1px 0 ${t}55`:`0 6px 18px ${j}, inset 0 1px 0 ${t}22`,transform:i?"translateY(-2px)":"translateY(0)",padding:"14px 16px 14px"},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md mb-3",style:{background:`linear-gradient(180deg, ${g} 0%, ${t} 55%, ${m} 100%)`,border:`1px solid ${m}`,boxShadow:`inset 0 1px 0 ${g}aa, 0 1px 3px ${j}`,color:F},children:[e.jsx("span",{className:"text-base leading-none",children:s.icon}),e.jsx("span",{className:"text-xs uppercase tracking-[0.16em] truncate",style:{fontFamily:x,fontWeight:700,letterSpacing:"0.12em"},children:s.title})]}),e.jsx("p",{className:"text-[13px] leading-snug mb-3",style:{color:c,opacity:.88},children:s.blurb}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.schedules.slice(0,2).map(u=>e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full",style:{background:`${v}cc`,color:c,border:`1px solid ${U}55`,fontFamily:d,opacity:.85},children:u.label},u.id)),e.jsx("span",{className:"ml-auto text-[10px] uppercase tracking-[0.2em] transition-opacity",style:{color:g,fontFamily:d,opacity:i?1:0},children:"Set up →"})]})]})}function q({template:s,onClose:n,onLaunch:i}){const[r,u]=b.useState(1),[N,$]=b.useState(()=>Object.fromEntries(s.fields.map(l=>[l.key,l.defaultValue]))),[k,S]=b.useState(s.schedules[0]),[y,a]=b.useState(!1),p=Y(s,N),f=r!==1||s.fields.every(l=>(N[l.key]??"").trim().length>0);async function w(){if(!y){a(!0);try{await i(p,k.id,s.suggestedPlayId)}finally{a(!1)}}}const B={background:`${h}aa`,color:c,border:`1px solid ${t}33`,fontFamily:x};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center backdrop-blur-sm p-4 md:p-8",style:{background:`${R}cc`},onClick:n,children:e.jsxs("div",{className:"relative w-full max-w-2xl rounded-2xl overflow-hidden flex flex-col",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${t}55`,boxShadow:`0 40px 100px ${j}, inset 0 1px 0 ${t}55`,color:c,fontFamily:x},onClick:l=>l.stopPropagation(),children:[e.jsx("div",{style:{height:4,background:`linear-gradient(90deg, ${m}, ${g}, ${m})`}}),e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",style:{borderBottom:`1px solid ${t}22`},children:[e.jsx("span",{className:"text-2xl leading-none",children:s.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm truncate",style:{color:c},children:s.title}),e.jsxs("div",{className:"text-[11px]",style:{color:o,fontFamily:d},children:["Step ",r," of 3 · ",r===1?"Customize":r===2?"Cadence":"Launch"]})]}),e.jsx("button",{onClick:n,className:"w-8 h-8 rounded-full flex items-center justify-center text-sm",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o},title:"Close",children:"✕"})]}),e.jsx("div",{className:"px-5 py-2 flex items-center gap-2",style:{borderBottom:`1px solid ${t}11`},children:[1,2,3].map(l=>e.jsx("div",{className:"h-1 flex-1 rounded-full transition-colors",style:{background:l<=r?`linear-gradient(90deg, ${t}, ${g})`:`${h}66`}},l))}),e.jsxs("div",{className:"p-5 max-h-[60vh] overflow-y-auto",children:[r===1&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:s.blurb}),s.fields.length===0&&e.jsxs("div",{className:"text-sm italic",style:{color:o},children:["This template runs as-is — no setup needed. Click ",e.jsx("b",{style:{color:c},children:"Next"})," to pick a cadence."]}),s.fields.map(l=>e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em]",style:{color:t,fontFamily:d,fontWeight:600},children:l.label}),e.jsx("input",{value:N[l.key]??"",onChange:T=>$(O=>({...O,[l.key]:T.target.value})),placeholder:l.placeholder??l.defaultValue,className:"px-3 py-2 rounded-lg text-sm outline-none",style:B}),l.hint&&e.jsx("span",{className:"text-[11px]",style:{color:o},children:l.hint})]},l.key)),e.jsxs("div",{className:"mt-2 px-3 py-2.5 rounded-lg",style:{background:`${h}66`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Preview goal"}),e.jsx("div",{className:"text-sm leading-snug",style:{color:c},children:p})]})]}),r===2&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Which cadence should TITAN remember?"}),s.schedules.map(l=>{const T=l.id===k.id;return e.jsxs("button",{onClick:()=>S(l),className:"flex items-center justify-between p-3 rounded-xl text-left transition-colors",style:{background:T?`${t}1f`:`${h}55`,border:`1px solid ${T?t:`${t}22`}`,color:T?c:o},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-sm",style:{color:c},children:l.label}),e.jsx("span",{className:"text-[11px]",style:{color:o,fontFamily:d},children:l.cadence})]}),e.jsx("code",{className:"text-[10px]",style:{color:o,fontFamily:d},children:l.cron})]},l.id)}),e.jsx("div",{className:"text-[11px] italic px-1 pt-1",style:{color:o},children:"This starts the first run immediately and saves the cadence selection for recurring mission support."})]}),r===3&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Quick recap before we kick off."}),e.jsxs("div",{className:"rounded-xl p-4",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"What I'll do"}),e.jsx("div",{className:"text-sm leading-relaxed",style:{color:c},children:s.whatItDoes})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[12px]",children:[e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Goal"}),e.jsx("div",{className:"leading-snug",style:{color:c},children:p})]}),e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Cadence"}),e.jsx("div",{className:"font-semibold",style:{color:c},children:k.label}),e.jsx("div",{className:"text-[11px] mt-0.5",style:{color:o,fontFamily:d},children:k.cadence})]})]})]})]}),e.jsxs("div",{className:"px-5 py-3 flex items-center justify-between",style:{borderTop:`1px solid ${t}22`,background:`${v}66`},children:[e.jsx("button",{onClick:()=>r>1?u(l=>l-1):n(),className:"px-4 py-2 text-sm",style:{color:o,background:"transparent",fontFamily:x},children:r>1?"← Back":"Cancel"}),r<3?e.jsx("button",{onClick:()=>u(l=>l+1),disabled:!f,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:f?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}55`,color:F,border:`1px solid ${m}`,opacity:f?1:.5,cursor:f?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},children:"Next →"}):e.jsx("button",{onClick:w,disabled:y,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:y?`${m}55`:`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`,color:F,border:`1px solid ${m}`,opacity:y?.6:1,cursor:y?"wait":"pointer",fontFamily:x,letterSpacing:"0.04em"},children:y?"Launching…":"Launch first run 🚀"})]})]})})}export{ee as default};
1
+ import{r as b,u as W,j as e}from"./index-BlFxPvdg.js";import{c as _}from"./missions-BUTRB5Lq.js";const G={id:"hourly",label:"Every hour",cron:"0 * * * *",cadence:"24 runs/day"},L={id:"every4h",label:"Every 4 hours",cron:"0 */4 * * *",cadence:"6 runs/day"},A={id:"every6h",label:"Every 6 hours",cron:"0 */6 * * *",cadence:"4 runs/day"},I={id:"daily7",label:"Daily at 7am",cron:"0 7 * * *",cadence:"once/day"},M={id:"weekly",label:"Weekly (Mon 9am)",cron:"0 9 * * 1",cadence:"once/week"},H={id:"nightly",label:"Nightly at 11pm",cron:"0 23 * * *",cadence:"once/day"},D={id:"twice",label:"Twice daily (7am + 7pm)",cron:"0 7,19 * * *",cadence:"2 runs/day"},V=[{id:"research-digest",icon:"📰",title:"Daily research digest",blurb:"Scout researches your topic and writes a fresh briefing for the first run.",goalTemplate:'Research the latest developments on "{{topic}}" and produce a clear HTML briefing (write_file with a .html extension) with 5 highlights, an inline SVG chart of the most important trend, and clickable source links throughout.',suggestedPlayId:"research",fields:[{key:"topic",label:"Your topic",hint:"What you want a fresh briefing on each morning",defaultValue:"AI agents in business",placeholder:"AI agents in business"}],schedules:[I,D,M],whatItDoes:"Scout searches the web for fresh developments on your topic, reads the top 5 sources end-to-end, and writes a one-page briefing. The briefing lands on your desk as a paper sheet, and the chat thread captures every URL Scout looked at so you can dig in further if anything catches your eye.",accent:{from:"#6366f1",to:"#8b5cf6"}},{id:"inbox-triage",icon:"📬",title:"Inbox triage",blurb:"Sage sorts and summarizes incoming email so important threads stay visible.",goalTemplate:'Read my inbox and produce a triaged summary: "needs reply within 24h", "informational", "newsletters", and "junk". Cap at 30 messages per run.',suggestedPlayId:"inbox",fields:[],schedules:[L,A,I],whatItDoes:"Sage opens your inbox, classifies up to 30 recent threads into four buckets (urgent / informational / newsletters / junk), and pins the urgent ones to the desk as sticky notes. The full triage lands as a paper sheet you can scan in under a minute.",accent:{from:"#06b6d4",to:"#0ea5e9"}},{id:"code-review",icon:"🔍",title:"Code review",blurb:"Builder reviews your repo changes and reports only meaningful findings.",goalTemplate:"Review the diff in {{repoPath}} since the last review. Flag bugs, regressions, and obvious improvements. Don't nitpick formatting.",suggestedPlayId:"code-review",fields:[{key:"repoPath",label:"Repo path or URL",hint:"Local path on the host, or a GitHub repo URL",defaultValue:"~/Desktop/MyProject",placeholder:"~/projects/repo"}],schedules:[H,D],whatItDoes:"Builder pulls the latest changes from your repo and writes a concise review focused on real defects (logic bugs, regressions, security smells). Formatting nits are skipped. Findings land as a paper sheet; if there's nothing to report, Builder closes silently.",accent:{from:"#22c55e",to:"#10b981"}},{id:"lead-scout",icon:"🎯",title:"Lead scout",blurb:"Scout scans freelance + opportunity boards and surfaces matches for your skills.",goalTemplate:'Scan Upwork, Indeed, and HackerNews "who is hiring" for new postings matching: {{skills}}. Filter to budget >= ${{minBudget}} and remote OK.',suggestedPlayId:"lead-scout",fields:[{key:"skills",label:"Skills to match",hint:"Comma-separated keywords. Scout fuzzy-matches.",defaultValue:"TypeScript, Node.js, AI agents",placeholder:"React, Python, design"},{key:"minBudget",label:"Minimum budget (USD)",hint:"Skip postings paying less.",defaultValue:"500"}],schedules:[L,A,I],whatItDoes:"Scout sweeps the boards you care about for postings that match your skill keywords and budget floor. New matches land as sticky notes; the running log of every posting seen sits as a paper sheet you can browse anytime.",accent:{from:"#f59e0b",to:"#eab308"}},{id:"market-watch",icon:"📈",title:"Market watch",blurb:"Analyst tracks tickers + crypto and writes a brief if anything moves >3%.",goalTemplate:"Check the latest price + 24h move for: {{tickers}}. If any moved more than 3% (up or down) since the last run, produce an HTML brief (write_file with a .html extension) with a sparkline SVG per ticker and a one-paragraph explanation with 2 source links.",suggestedPlayId:"analyst",fields:[{key:"tickers",label:"Tickers / coins",hint:"Comma-separated. Stocks or crypto.",defaultValue:"BTC, ETH, NVDA, AAPL",placeholder:"TSLA, SPY, BTC"}],schedules:[G,L,A],whatItDoes:"Each cycle, Analyst pulls the latest price and 24-hour move for every ticker you listed. If anything jumped or dropped more than 3%, it writes a one-paragraph explanation with 2 source links. Quiet runs close silently — your desk only fills up when something actually moved.",accent:{from:"#ef4444",to:"#f97316"}},{id:"creative-prompts",icon:"🎨",title:"Daily creative prompt",blurb:"Writer creates a fresh writing, sketching, or music prompt for the first run.",goalTemplate:"Generate a fresh {{discipline}} prompt for me today. Make it specific enough to start in 5 minutes but open enough to take in any direction. Include a 1-line warm-up exercise.",fields:[{key:"discipline",label:"Discipline",hint:"What kind of prompt you want.",defaultValue:"songwriting",placeholder:"short fiction · songwriting · sketching"}],schedules:[I,M],whatItDoes:"Writer creates one fresh creative prompt tailored to the discipline you chose, with a quick warm-up exercise to get started. The prompt lands as a sticky note on the desk so you can grab it when you need it.",accent:{from:"#ec4899",to:"#8b5cf6"}}];function Y(s,n){return s.goalTemplate.replace(/\{\{(\w+)\}\}/g,(i,r)=>{const u=n[r];return u&&u.trim().length>0?u.trim():r})}const z=["Plan my mom's 70th birthday party","Write a thank-you note to my landlord","Summarize this long email I got","Draft the Q1 investor update","Review a code change"],x="var(--theme-font-display, 'Iowan Old Style', 'Charter', Georgia, serif)",d="var(--theme-font-mono, 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace)",c="var(--theme-paper, #f3e9d0)",o="var(--theme-ink-soft, #a0a8d0)",t="var(--theme-metal, #c4a35a)",g="var(--theme-metal-bright, #f3d27a)",m="var(--theme-metal-dark, #8a6a3a)",F="var(--theme-bolt, #2a1808)",E="var(--theme-leather, #4a2818)",v="var(--theme-leather-edge, #2a1408)",U="var(--theme-leather-stitch, #d4a060)",h="var(--theme-bg-base, #1a1235)",R="var(--theme-bg-grain, #0e0820)",K="var(--theme-bg-vignette, rgba(0,0,0,0.6))",j="var(--theme-shadow, rgba(0,0,0,0.55))",Q="var(--theme-accent, #c45a30)";function ee(){const[s,n]=b.useState(""),[i,r]=b.useState(!1),[u,N]=b.useState(null),[$,k]=b.useState(null),S=W();async function y(a,p){const f=a.trim();if(!(!f||i)){r(!0),N(null);try{const{mission:w}=await _(f,p);S(`/mission/${w.id}`)}catch(w){N(w.message),r(!1)}}}return e.jsxs("div",{className:"min-h-full w-full flex flex-col items-center",style:{color:c,fontFamily:x,background:`radial-gradient(120% 80% at 50% -10%, ${R} 0%, ${h} 60%, ${h} 100%)`},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:`radial-gradient(circle at 50% 12%, ${Q}22 0%, transparent 55%)`}}),e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{boxShadow:`inset 0 0 240px 60px ${K}`}}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-8 w-full max-w-5xl px-6 pt-10 pb-28 md:py-14",children:[e.jsxs("div",{className:"w-full flex items-center",style:{paddingRight:260},children:[e.jsxs("div",{className:"flex items-center gap-3 text-[11px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:[e.jsx("span",{style:{color:g,fontWeight:700},children:"TITAN"}),e.jsx("span",{style:{opacity:.6},children:"·"}),e.jsx("span",{children:"MISSION CONTROL"})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx(P,{onClick:()=>S("/mission/library"),title:"See your past missions",children:"Past missions →"}),e.jsx(P,{onClick:()=>S("/space/home"),title:"Back to the canvas spaces",children:"🌌 Canvas"})]})]}),e.jsxs("section",{className:"relative w-full max-w-3xl rounded-3xl overflow-hidden",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${v}`,boxShadow:`0 30px 80px ${j}, inset 0 1px 0 ${t}33`,padding:"36px 36px 28px"},children:[e.jsx(C,{position:"tl"}),e.jsx(C,{position:"tr"}),e.jsx(C,{position:"bl"}),e.jsx(C,{position:"br"}),e.jsx("div",{className:"text-[10px] uppercase tracking-[0.4em] mb-3",style:{color:t,fontFamily:d,fontWeight:600},children:"◆ New Mission"}),e.jsx("h1",{className:"text-4xl md:text-5xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600,letterSpacing:0,textShadow:`0 2px 12px ${j}`},children:"What's the mission?"}),e.jsx("p",{className:"mt-3 text-[15px] leading-relaxed max-w-xl",style:{color:o},children:"Tell me anything — a thank-you note, a birthday plan, a Q1 report. I’ll assemble a small team of AI specialists and we’ll work it out together."}),e.jsxs("form",{onSubmit:a=>{a.preventDefault(),y(s)},className:"mt-6 flex flex-col gap-3",children:[e.jsx("textarea",{autoFocus:!0,value:s,onChange:a=>n(a.target.value),placeholder:"Try: Help me write a birthday speech for my mom",rows:3,disabled:i,className:"w-full resize-none outline-none rounded-2xl px-5 py-4 text-base leading-relaxed",style:{background:`${h}80`,color:c,border:`1px solid ${t}44`,fontFamily:x,boxShadow:`inset 0 2px 8px ${j}`},onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&(a.preventDefault(),y(s))}}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"⌘↵ to dispatch · voice coming soon"}),e.jsxs("div",{className:"flex w-full items-center gap-2 sm:w-auto",children:[e.jsx("button",{type:"button",disabled:!0,title:"Voice is coming next release",className:"w-11 h-11 rounded-full flex items-center justify-center cursor-not-allowed",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o,opacity:.55},children:"🎤"}),e.jsx("button",{type:"submit",disabled:!s.trim()||i,className:"h-11 flex-1 rounded-xl px-5 text-sm font-bold tracking-wide transition-transform sm:flex-none",style:{background:s.trim()&&!i?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}66`,color:s.trim()&&!i?F:o,border:`1px solid ${m}`,boxShadow:s.trim()&&!i?`0 6px 18px ${j}, inset 0 1px 0 ${g}`:"none",cursor:s.trim()&&!i?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},onMouseDown:a=>{s.trim()&&!i&&(a.currentTarget.style.transform="translateY(1px)")},onMouseUp:a=>{a.currentTarget.style.transform=""},onMouseLeave:a=>{a.currentTarget.style.transform=""},children:i?"Dispatching…":"Start mission →"})]})]})]}),u&&e.jsx("div",{className:"mt-4 text-sm rounded-lg px-3 py-2",style:{color:"#ffb4a8",background:"#5a1a1a55",border:"1px solid #8a3a3a"},children:u})]}),e.jsxs("div",{className:"w-full max-w-3xl flex flex-col items-center gap-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.35em]",style:{color:o,fontFamily:d},children:"— or try a one-shot —"}),e.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:z.map(a=>e.jsx("button",{type:"button",onClick:()=>y(a),disabled:i,className:"px-3 py-1.5 text-xs rounded-full transition-colors disabled:opacity-50",style:{background:`${v}99`,color:c,border:`1px solid ${t}33`,fontFamily:x},onMouseEnter:p=>{p.currentTarget.style.borderColor=`${t}88`,p.currentTarget.style.background=`${E}`},onMouseLeave:p=>{p.currentTarget.style.borderColor=`${t}33`,p.currentTarget.style.background=`${v}99`},children:a},a))})]}),e.jsxs("section",{className:"w-full mt-4 flex flex-col gap-4",children:[e.jsxs("header",{className:"flex items-baseline justify-between pb-3",style:{borderBottom:`1px solid ${t}33`},children:[e.jsxs("h2",{className:"text-xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600},children:["Mission starters",e.jsx("span",{className:"ml-3 text-[10px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:"saved cadence"})]}),e.jsx("span",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"click → 3 steps → launch"})]}),e.jsx("p",{className:"text-sm leading-relaxed max-w-2xl",style:{color:o},children:"Pick a starter recipe, customize it, and launch the first run. TITAN saves the cadence with the mission request."}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3 mt-2",children:V.map(a=>e.jsx(J,{template:a,onClick:()=>k(a)},a.id))})]}),e.jsx("div",{className:"h-20"})]}),$&&e.jsx(q,{template:$,onClose:()=>k(null),onLaunch:async(a,p,f)=>{try{const w=JSON.parse(localStorage.getItem("titan-pending-schedules")??"[]");w.push({at:new Date().toISOString(),templateId:$.id,goal:a,scheduleId:p}),localStorage.setItem("titan-pending-schedules",JSON.stringify(w))}catch{}k(null),await y(a,f)}})]})}function P({onClick:s,title:n,children:i}){return e.jsx("button",{onClick:s,title:n,className:"px-3 py-1 text-[10px] uppercase tracking-[0.2em] rounded-full transition-colors",style:{color:o,border:`1px solid ${t}33`,background:"transparent",fontFamily:d},onMouseEnter:r=>{r.currentTarget.style.color=c,r.currentTarget.style.borderColor=`${t}99`},onMouseLeave:r=>{r.currentTarget.style.color=o,r.currentTarget.style.borderColor=`${t}33`},children:i})}function C({position:s}){const n={position:"absolute"};return s==="tl"&&(n.top=10,n.left=10),s==="tr"&&(n.top=10,n.right=10),s==="bl"&&(n.bottom=10,n.left=10),s==="br"&&(n.bottom=10,n.right=10),e.jsx("div",{style:{...n,width:6,height:6,borderRadius:"50%",background:t,boxShadow:`0 0 6px ${g}, inset 0 1px 0 ${g}`,opacity:.7,pointerEvents:"none"}})}function J({template:s,onClick:n}){const[i,r]=b.useState(!1);return e.jsxs("button",{type:"button",onClick:n,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),className:"text-left rounded-2xl relative overflow-hidden transition-all",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${i?t:v}`,boxShadow:i?`0 14px 36px ${j}, inset 0 1px 0 ${t}55`:`0 6px 18px ${j}, inset 0 1px 0 ${t}22`,transform:i?"translateY(-2px)":"translateY(0)",padding:"14px 16px 14px"},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md mb-3",style:{background:`linear-gradient(180deg, ${g} 0%, ${t} 55%, ${m} 100%)`,border:`1px solid ${m}`,boxShadow:`inset 0 1px 0 ${g}aa, 0 1px 3px ${j}`,color:F},children:[e.jsx("span",{className:"text-base leading-none",children:s.icon}),e.jsx("span",{className:"text-xs uppercase tracking-[0.16em] truncate",style:{fontFamily:x,fontWeight:700,letterSpacing:"0.12em"},children:s.title})]}),e.jsx("p",{className:"text-[13px] leading-snug mb-3",style:{color:c,opacity:.88},children:s.blurb}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.schedules.slice(0,2).map(u=>e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full",style:{background:`${v}cc`,color:c,border:`1px solid ${U}55`,fontFamily:d,opacity:.85},children:u.label},u.id)),e.jsx("span",{className:"ml-auto text-[10px] uppercase tracking-[0.2em] transition-opacity",style:{color:g,fontFamily:d,opacity:i?1:0},children:"Set up →"})]})]})}function q({template:s,onClose:n,onLaunch:i}){const[r,u]=b.useState(1),[N,$]=b.useState(()=>Object.fromEntries(s.fields.map(l=>[l.key,l.defaultValue]))),[k,S]=b.useState(s.schedules[0]),[y,a]=b.useState(!1),p=Y(s,N),f=r!==1||s.fields.every(l=>(N[l.key]??"").trim().length>0);async function w(){if(!y){a(!0);try{await i(p,k.id,s.suggestedPlayId)}finally{a(!1)}}}const B={background:`${h}aa`,color:c,border:`1px solid ${t}33`,fontFamily:x};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center backdrop-blur-sm p-4 md:p-8",style:{background:`${R}cc`},onClick:n,children:e.jsxs("div",{className:"relative w-full max-w-2xl rounded-2xl overflow-hidden flex flex-col",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${t}55`,boxShadow:`0 40px 100px ${j}, inset 0 1px 0 ${t}55`,color:c,fontFamily:x},onClick:l=>l.stopPropagation(),children:[e.jsx("div",{style:{height:4,background:`linear-gradient(90deg, ${m}, ${g}, ${m})`}}),e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",style:{borderBottom:`1px solid ${t}22`},children:[e.jsx("span",{className:"text-2xl leading-none",children:s.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm truncate",style:{color:c},children:s.title}),e.jsxs("div",{className:"text-[11px]",style:{color:o,fontFamily:d},children:["Step ",r," of 3 · ",r===1?"Customize":r===2?"Cadence":"Launch"]})]}),e.jsx("button",{onClick:n,className:"w-8 h-8 rounded-full flex items-center justify-center text-sm",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o},title:"Close",children:"✕"})]}),e.jsx("div",{className:"px-5 py-2 flex items-center gap-2",style:{borderBottom:`1px solid ${t}11`},children:[1,2,3].map(l=>e.jsx("div",{className:"h-1 flex-1 rounded-full transition-colors",style:{background:l<=r?`linear-gradient(90deg, ${t}, ${g})`:`${h}66`}},l))}),e.jsxs("div",{className:"p-5 max-h-[60vh] overflow-y-auto",children:[r===1&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:s.blurb}),s.fields.length===0&&e.jsxs("div",{className:"text-sm italic",style:{color:o},children:["This template runs as-is — no setup needed. Click ",e.jsx("b",{style:{color:c},children:"Next"})," to pick a cadence."]}),s.fields.map(l=>e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em]",style:{color:t,fontFamily:d,fontWeight:600},children:l.label}),e.jsx("input",{value:N[l.key]??"",onChange:T=>$(O=>({...O,[l.key]:T.target.value})),placeholder:l.placeholder??l.defaultValue,className:"px-3 py-2 rounded-lg text-sm outline-none",style:B}),l.hint&&e.jsx("span",{className:"text-[11px]",style:{color:o},children:l.hint})]},l.key)),e.jsxs("div",{className:"mt-2 px-3 py-2.5 rounded-lg",style:{background:`${h}66`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Preview goal"}),e.jsx("div",{className:"text-sm leading-snug",style:{color:c},children:p})]})]}),r===2&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Which cadence should TITAN remember?"}),s.schedules.map(l=>{const T=l.id===k.id;return e.jsxs("button",{onClick:()=>S(l),className:"flex items-center justify-between p-3 rounded-xl text-left transition-colors",style:{background:T?`${t}1f`:`${h}55`,border:`1px solid ${T?t:`${t}22`}`,color:T?c:o},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-sm",style:{color:c},children:l.label}),e.jsx("span",{className:"text-[11px]",style:{color:o,fontFamily:d},children:l.cadence})]}),e.jsx("code",{className:"text-[10px]",style:{color:o,fontFamily:d},children:l.cron})]},l.id)}),e.jsx("div",{className:"text-[11px] italic px-1 pt-1",style:{color:o},children:"This starts the first run immediately and saves the cadence selection for recurring mission support."})]}),r===3&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Quick recap before we kick off."}),e.jsxs("div",{className:"rounded-xl p-4",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"What I'll do"}),e.jsx("div",{className:"text-sm leading-relaxed",style:{color:c},children:s.whatItDoes})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[12px]",children:[e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Goal"}),e.jsx("div",{className:"leading-snug",style:{color:c},children:p})]}),e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Cadence"}),e.jsx("div",{className:"font-semibold",style:{color:c},children:k.label}),e.jsx("div",{className:"text-[11px] mt-0.5",style:{color:o,fontFamily:d},children:k.cadence})]})]})]})]}),e.jsxs("div",{className:"px-5 py-3 flex items-center justify-between",style:{borderTop:`1px solid ${t}22`,background:`${v}66`},children:[e.jsx("button",{onClick:()=>r>1?u(l=>l-1):n(),className:"px-4 py-2 text-sm",style:{color:o,background:"transparent",fontFamily:x},children:r>1?"← Back":"Cancel"}),r<3?e.jsx("button",{onClick:()=>u(l=>l+1),disabled:!f,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:f?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}55`,color:F,border:`1px solid ${m}`,opacity:f?1:.5,cursor:f?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},children:"Next →"}):e.jsx("button",{onClick:w,disabled:y,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:y?`${m}55`:`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`,color:F,border:`1px solid ${m}`,opacity:y?.6:1,cursor:y?"wait":"pointer",fontFamily:x,letterSpacing:"0.04em"},children:y?"Launching…":"Launch first run 🚀"})]})]})})}export{ee as default};
@@ -1 +1 @@
1
- import{r,j as e,X as x}from"./index-BISxhHXP.js";import{c as y}from"./clsx-B-dksMZM.js";import{A as p,m as l}from"./proxy-Dm6tNAsg.js";const u={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl"};function j({open:s,onClose:t,title:i,children:m,footer:n,size:o="md",hideCloseButton:c=!1}){const a=r.useCallback(d=>{d.key==="Escape"&&t()},[t]);return r.useEffect(()=>{if(s)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s,a]),e.jsx(p,{children:s&&e.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",children:[e.jsx(l.div,{className:"absolute inset-0 titan-menu-overlay",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15}}),e.jsxs(l.div,{className:y("relative w-full mx-4 titan-modal-surface",u[o]),initial:{opacity:0,y:-16,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-16,scale:.97},transition:{duration:.2,ease:"easeOut"},children:[i&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--theme-menu-border)"},children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:i}),!c&&e.jsx("button",{type:"button",onClick:t,className:"titan-close-btn","aria-label":"Close",children:e.jsx(x,{size:16})})]}),e.jsx("div",{className:"px-4 py-4",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:m}),n&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-3",style:{borderTop:"1px solid var(--theme-menu-border)"},children:n})]})]})})}export{j as M};
1
+ import{r,j as e,X as x}from"./index-BlFxPvdg.js";import{c as y}from"./clsx-B-dksMZM.js";import{A as p,m as l}from"./proxy-C5UuKDtU.js";const u={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl"};function j({open:s,onClose:t,title:i,children:m,footer:n,size:o="md",hideCloseButton:c=!1}){const a=r.useCallback(d=>{d.key==="Escape"&&t()},[t]);return r.useEffect(()=>{if(s)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s,a]),e.jsx(p,{children:s&&e.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",children:[e.jsx(l.div,{className:"absolute inset-0 titan-menu-overlay",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15}}),e.jsxs(l.div,{className:y("relative w-full mx-4 titan-modal-surface",u[o]),initial:{opacity:0,y:-16,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-16,scale:.97},transition:{duration:.2,ease:"easeOut"},children:[i&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--theme-menu-border)"},children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:i}),!c&&e.jsx("button",{type:"button",onClick:t,className:"titan-close-btn","aria-label":"Close",children:e.jsx(x,{size:16})})]}),e.jsx("div",{className:"px-4 py-4",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:m}),n&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-3",style:{borderTop:"1px solid var(--theme-menu-border)"},children:n})]})]})})}export{j as M};
@@ -1 +1 @@
1
- import{r as c,b as y,j as e,i as U,Z as K,A as O,h as G,a8 as B,a9 as E,ao as T,E as D}from"./index-BISxhHXP.js";import{P as L}from"./PageHeader-CjDtUo8m.js";import{R as V}from"./refresh-cw-CFv1BDy9.js";import{S as $}from"./save-o5ciSOaB.js";import{C as F}from"./circle-check-big-C7KjulF6.js";import{E as M}from"./external-link-fIw1hJS5.js";import{S as H}from"./search-DmeBed-X.js";import"./chevron-right-D1DyaeTm.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:i,onToggle:h,children:p}){return e.jsxs("div",{className:`rounded-xl border bg-bg-secondary transition-colors ${i?"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 ${i?"bg-nvidia/15":"bg-bg-tertiary"}`,children:e.jsx(d,{className:`h-4.5 w-4.5 ${i?"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 ${i?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${i?"translate-x-6":"translate-x-1"}`})})]}),i&&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:i,placeholder:h,type:p="text",secret:x=!1}){const[m,b]=c.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=>i(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(T,{className:"h-4 w-4"}):e.jsx(D,{className:"h-4 w-4"})})]})]})}function ee(){const[s,l]=c.useState(_),[d,i]=c.useState(!0),[h,p]=c.useState(!1),[x,m]=c.useState(null),[b,n]=c.useState({cuopt:"unknown",asr:"unknown",nim:"unknown"}),[g,j]=c.useState(!1),N=c.useCallback((t,a)=>{m({type:t,message:a}),setTimeout(()=>m(null),3e3)},[]);c.useEffect(()=>{(async()=>{var a,o,w,S,k,A,I,C;try{const r=await B();r.nvidia&&(l({enabled:r.nvidia.enabled??!1,apiKey:"",cuopt:{enabled:((a=r.nvidia.cuopt)==null?void 0:a.enabled)??!1,url:((o=r.nvidia.cuopt)==null?void 0:o.url)??"http://localhost:5000"},asr:{enabled:((w=r.nvidia.asr)==null?void 0:w.enabled)??!1,grpcUrl:((S=r.nvidia.asr)==null?void 0:S.grpcUrl)??"localhost:50051",healthUrl:((k=r.nvidia.asr)==null?void 0:k.healthUrl)??"http://localhost:9000"},openshell:{enabled:((A=r.nvidia.openshell)==null?void 0:A.enabled)??!1,binaryPath:((I=r.nvidia.openshell)==null?void 0:I.binaryPath)??"openshell",policyPath:((C=r.nvidia.openshell)==null?void 0:C.policyPath)??""}}),j(r.nvidia.apiKeySet??!1))}catch{}finally{i(!1)}})()},[]);const P=c.useCallback(async()=>{if(s.cuopt.enabled){n(t=>({...t,cuopt:"checking"}));try{const a=await(await y("/api/nvidia/health/cuopt")).json();n(o=>({...o,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(o=>({...o,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(o=>({...o,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 E(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.jsx(L,{title:"NVIDIA",subtitle:"GPU-accelerated AI services — NIM, cuOpt, Nemotron-ASR, OpenShell",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"GPU"}],actions:e.jsxs(e.Fragment,{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(V,{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($,{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(K,{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(M,{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:O,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:H,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:G,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:o})=>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:o})]}),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{ee as default};
1
+ import{r as c,b as y,j as e,i as U,Z as K,A as O,h as G,a8 as B,a9 as E,ao as T,E as D}from"./index-BlFxPvdg.js";import{P as L}from"./PageHeader-CawSrb9E.js";import{R as V}from"./refresh-cw-BdcqinTm.js";import{S as $}from"./save-BWhXC8Tv.js";import{C as F}from"./circle-check-big-De2k5qVr.js";import{E as M}from"./external-link-BjN0VrNb.js";import{S as H}from"./search-DF7UnWEk.js";import"./chevron-right-DJCsUSwz.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:i,onToggle:h,children:p}){return e.jsxs("div",{className:`rounded-xl border bg-bg-secondary transition-colors ${i?"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 ${i?"bg-nvidia/15":"bg-bg-tertiary"}`,children:e.jsx(d,{className:`h-4.5 w-4.5 ${i?"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 ${i?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${i?"translate-x-6":"translate-x-1"}`})})]}),i&&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:i,placeholder:h,type:p="text",secret:x=!1}){const[m,b]=c.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=>i(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(T,{className:"h-4 w-4"}):e.jsx(D,{className:"h-4 w-4"})})]})]})}function ee(){const[s,l]=c.useState(_),[d,i]=c.useState(!0),[h,p]=c.useState(!1),[x,m]=c.useState(null),[b,n]=c.useState({cuopt:"unknown",asr:"unknown",nim:"unknown"}),[g,j]=c.useState(!1),N=c.useCallback((t,a)=>{m({type:t,message:a}),setTimeout(()=>m(null),3e3)},[]);c.useEffect(()=>{(async()=>{var a,o,w,S,k,A,I,C;try{const r=await B();r.nvidia&&(l({enabled:r.nvidia.enabled??!1,apiKey:"",cuopt:{enabled:((a=r.nvidia.cuopt)==null?void 0:a.enabled)??!1,url:((o=r.nvidia.cuopt)==null?void 0:o.url)??"http://localhost:5000"},asr:{enabled:((w=r.nvidia.asr)==null?void 0:w.enabled)??!1,grpcUrl:((S=r.nvidia.asr)==null?void 0:S.grpcUrl)??"localhost:50051",healthUrl:((k=r.nvidia.asr)==null?void 0:k.healthUrl)??"http://localhost:9000"},openshell:{enabled:((A=r.nvidia.openshell)==null?void 0:A.enabled)??!1,binaryPath:((I=r.nvidia.openshell)==null?void 0:I.binaryPath)??"openshell",policyPath:((C=r.nvidia.openshell)==null?void 0:C.policyPath)??""}}),j(r.nvidia.apiKeySet??!1))}catch{}finally{i(!1)}})()},[]);const P=c.useCallback(async()=>{if(s.cuopt.enabled){n(t=>({...t,cuopt:"checking"}));try{const a=await(await y("/api/nvidia/health/cuopt")).json();n(o=>({...o,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(o=>({...o,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(o=>({...o,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 E(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.jsx(L,{title:"NVIDIA",subtitle:"GPU-accelerated AI services — NIM, cuOpt, Nemotron-ASR, OpenShell",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"GPU"}],actions:e.jsxs(e.Fragment,{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(V,{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($,{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(K,{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(M,{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:O,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:H,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:G,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:o})=>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:o})]}),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{ee as default};
@@ -1 +1 @@
1
- import{r as t,bG as b,bH as g,j as e,K as d,h,bI as f}from"./index-BISxhHXP.js";import{P as p}from"./PageHeader-CjDtUo8m.js";import{R as j}from"./refresh-cw-CFv1BDy9.js";import{C as u}from"./circle-check-big-C7KjulF6.js";import"./chevron-right-D1DyaeTm.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([b(),g()]);m(s.alerts||[]),o(a)}catch{}c(!1)},[]);t.useEffect(()=>{r()},[r]);const x=async s=>{try{await f(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(h,{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
+ import{r as t,bG as b,bH as g,j as e,K as d,h,bI as f}from"./index-BlFxPvdg.js";import{P as p}from"./PageHeader-CawSrb9E.js";import{R as j}from"./refresh-cw-BdcqinTm.js";import{C as u}from"./circle-check-big-De2k5qVr.js";import"./chevron-right-DJCsUSwz.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([b(),g()]);m(s.alerts||[]),o(a)}catch{}c(!1)},[]);t.useEffect(()=>{r()},[r]);const x=async s=>{try{await f(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(h,{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 +1 @@
1
- import{r as l,j as e,Z as v,A as x,n as f,C as h,bw as p}from"./index-BISxhHXP.js";import{S as a}from"./StatCard-BUO6lNlX.js";import{P as c}from"./PageHeader-CjDtUo8m.js";import{S as g}from"./SkeletonLoader-DwBcLrhl.js";import{C as j}from"./clock-BgvC0T_E.js";import{M as b}from"./message-square-D9n28WBl.js";import{S}from"./server-Ov6rxCAc.js";import{L as w}from"./layers-BseADaVO.js";import"./chevron-right-D1DyaeTm.js";import"./clsx-B-dksMZM.js";function y(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 R(){const[t,s]=l.useState(null),[r,i]=l.useState(null),[d,u]=l.useState(!0),n=async()=>{try{const o=await p();s(o),i(null)}catch(o){i(o instanceof Error?o.message:"Failed to fetch stats")}finally{u(!1)}};return l.useEffect(()=>{n();const o=setInterval(n,1e4);return()=>clearInterval(o)},[]),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(g,{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:y(t.uptime),icon:e.jsx(j,{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(S,{className:"h-5 w-5"})}),e.jsx(a,{title:"Version",value:t.version,icon:e.jsx(w,{className:"h-5 w-5"})})]})]}):null}export{R as default};
1
+ import{r as l,j as e,Z as v,A as x,n as f,C as h,bw as p}from"./index-BlFxPvdg.js";import{S as a}from"./StatCard-B4qf3WOB.js";import{P as c}from"./PageHeader-CawSrb9E.js";import{S as g}from"./SkeletonLoader-sjDa7Y96.js";import{C as j}from"./clock-Bc6IrFv8.js";import{M as b}from"./message-square-Dv6Q3VRO.js";import{S}from"./server-1PubNLgw.js";import{L as w}from"./layers-DKKOtsYx.js";import"./chevron-right-DJCsUSwz.js";import"./clsx-B-dksMZM.js";function y(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 R(){const[t,s]=l.useState(null),[r,i]=l.useState(null),[d,u]=l.useState(!0),n=async()=>{try{const o=await p();s(o),i(null)}catch(o){i(o instanceof Error?o.message:"Failed to fetch stats")}finally{u(!1)}};return l.useEffect(()=>{n();const o=setInterval(n,1e4);return()=>clearInterval(o)},[]),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(g,{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:y(t.uptime),icon:e.jsx(j,{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(S,{className:"h-5 w-5"})}),e.jsx(a,{title:"Version",value:t.version,icon:e.jsx(w,{className:"h-5 w-5"})})]})]}):null}export{R as default};
@@ -1 +1 @@
1
- import{j as e,D as i}from"./index-BISxhHXP.js";import{C as r}from"./chevron-right-D1DyaeTm.js";function c({title:x,subtitle:l,breadcrumbs:s,actions:n}){return e.jsxs("header",{className:"titan-window-titlebar mb-4 md:mb-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s&&s.length>0&&e.jsx("nav",{className:"flex items-center gap-1 overflow-x-auto pb-1 text-[10px] text-text-muted scrollbar-thin md:text-xs","aria-label":"Breadcrumb",children:s.map((a,t)=>e.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[t>0&&e.jsx(r,{size:12,className:"opacity-50 flex-shrink-0"}),a.href?e.jsx(i,{to:a.href,className:"whitespace-nowrap transition-colors hover:text-text",children:a.label}):e.jsx("span",{className:t===s.length-1?"text-text-secondary whitespace-nowrap":"",children:a.label})]},t))}),e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsxs("div",{className:"mt-1 hidden h-3.5 w-11 shrink-0 items-center gap-1.5 md:flex","aria-hidden":"true",children:[e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-error/80"}),e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-warning/80"}),e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-success/80"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"truncate text-lg font-semibold text-text md:text-xl",children:x}),l&&e.jsx("p",{className:"mt-1 max-w-3xl text-[11px] leading-5 text-text-muted md:text-sm",children:l})]})]})]}),n&&e.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2 sm:justify-end",children:n})]})}export{c as P};
1
+ import{j as e,D as i}from"./index-BlFxPvdg.js";import{C as r}from"./chevron-right-DJCsUSwz.js";function c({title:x,subtitle:l,breadcrumbs:s,actions:n}){return e.jsxs("header",{className:"titan-window-titlebar mb-4 md:mb-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[s&&s.length>0&&e.jsx("nav",{className:"flex items-center gap-1 overflow-x-auto pb-1 text-[10px] text-text-muted scrollbar-thin md:text-xs","aria-label":"Breadcrumb",children:s.map((a,t)=>e.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[t>0&&e.jsx(r,{size:12,className:"opacity-50 flex-shrink-0"}),a.href?e.jsx(i,{to:a.href,className:"whitespace-nowrap transition-colors hover:text-text",children:a.label}):e.jsx("span",{className:t===s.length-1?"text-text-secondary whitespace-nowrap":"",children:a.label})]},t))}),e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsxs("div",{className:"mt-1 hidden h-3.5 w-11 shrink-0 items-center gap-1.5 md:flex","aria-hidden":"true",children:[e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-error/80"}),e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-warning/80"}),e.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-success/80"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"truncate text-lg font-semibold text-text md:text-xl",children:x}),l&&e.jsx("p",{className:"mt-1 max-w-3xl text-[11px] leading-5 text-text-muted md:text-sm",children:l})]})]})]}),n&&e.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2 sm:justify-end",children:n})]})}export{c as P};
@@ -1,4 +1,4 @@
1
- import{c as f,r,bh as j,bi as g,j as e,bj as N}from"./index-BISxhHXP.js";import{P as u}from"./PageHeader-CjDtUo8m.js";import{R as v}from"./refresh-cw-CFv1BDy9.js";import{C as m}from"./check-oX--Xdud.js";import{P as h}from"./pause-CvgG1y4I.js";import{V as w}from"./volume-2-DcpX5fnm.js";import{C as y}from"./clock-BgvC0T_E.js";import"./chevron-right-D1DyaeTm.js";/**
1
+ import{c as f,r,bh as j,bi as g,j as e,bj as N}from"./index-BlFxPvdg.js";import{P as u}from"./PageHeader-CawSrb9E.js";import{R as v}from"./refresh-cw-BdcqinTm.js";import{C as m}from"./check-BhmlTEFk.js";import{P as h}from"./pause-CXCmPcHk.js";import{V as w}from"./volume-2-ahkfEwxT.js";import{C as y}from"./clock-Bc6IrFv8.js";import"./chevron-right-DJCsUSwz.js";/**
2
2
  * @license lucide-react v0.513.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as a,j as s,a5 as y,a6 as j}from"./index-BISxhHXP.js";function w(){const[r,g]=a.useState([]),[c,l]=a.useState("default"),[h,f]=a.useState(!0),[o,d]=a.useState(null),[n,x]=a.useState(null),[i,b]=a.useState("all");a.useEffect(()=>{(async()=>{try{const t=await y();g(t.personas),l(t.active)}catch(t){d(t instanceof Error?t.message:"Failed to fetch personas")}finally{f(!1)}})()},[]);const p=a.useMemo(()=>{const e=new Set(r.map(t=>t.division));return["all",...Array.from(e).sort()]},[r]),m=a.useMemo(()=>i==="all"?r:r.filter(e=>e.division===i),[r,i]),v=async e=>{if(!(e===c||n)){x(e);try{const t=await j(e);l(t.active)}catch(t){d(t instanceof Error?t.message:"Failed to switch persona")}finally{x(null)}}};return h?s.jsx("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-3",children:Array.from({length:6}).map((e,t)=>s.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"},t))}):o?s.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:o}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-lg font-semibold text-text",children:"Personas"}),s.jsxs("span",{className:"text-sm text-text-muted",children:[r.length," available"]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(e=>s.jsx("button",{onClick:()=>b(e),className:`rounded-lg px-3 py-1.5 text-sm font-medium capitalize transition-colors ${i===e?"bg-accent text-white":"bg-bg-tertiary text-text-secondary hover:text-text"}`,children:e},e))}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[m.map(e=>{const t=e.id===c,u=e.id===n;return s.jsxs("button",{onClick:()=>v(e.id),disabled:t||!!n,className:`rounded-xl border p-4 text-left transition-all ${t?"border-accent bg-accent/10 ring-1 ring-accent/30":"border-border bg-bg-secondary hover:border-border-light hover:bg-bg-secondary"} ${u?"opacity-60":""} disabled:cursor-default`,children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("h3",{className:"font-medium text-text",children:e.name}),t&&s.jsx("span",{className:"rounded-full bg-accent/20 px-2 py-0.5 text-xs font-medium text-accent-hover",children:"Active"}),u&&s.jsx("span",{className:"text-xs text-text-secondary",children:"Switching..."})]}),s.jsx("p",{className:"text-sm text-text-secondary line-clamp-2",children:e.description}),s.jsx("p",{className:"mt-2 text-xs capitalize text-text-muted",children:e.division})]},e.id)}),m.length===0&&s.jsx("p",{className:"col-span-full py-12 text-center text-text-muted",children:"No personas in this division"})]})]})}export{w as default};
1
+ import{r as a,j as s,a5 as y,a6 as j}from"./index-BlFxPvdg.js";function w(){const[r,g]=a.useState([]),[c,l]=a.useState("default"),[h,f]=a.useState(!0),[o,d]=a.useState(null),[n,x]=a.useState(null),[i,b]=a.useState("all");a.useEffect(()=>{(async()=>{try{const t=await y();g(t.personas),l(t.active)}catch(t){d(t instanceof Error?t.message:"Failed to fetch personas")}finally{f(!1)}})()},[]);const p=a.useMemo(()=>{const e=new Set(r.map(t=>t.division));return["all",...Array.from(e).sort()]},[r]),m=a.useMemo(()=>i==="all"?r:r.filter(e=>e.division===i),[r,i]),v=async e=>{if(!(e===c||n)){x(e);try{const t=await j(e);l(t.active)}catch(t){d(t instanceof Error?t.message:"Failed to switch persona")}finally{x(null)}}};return h?s.jsx("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-3",children:Array.from({length:6}).map((e,t)=>s.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"},t))}):o?s.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:o}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-lg font-semibold text-text",children:"Personas"}),s.jsxs("span",{className:"text-sm text-text-muted",children:[r.length," available"]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(e=>s.jsx("button",{onClick:()=>b(e),className:`rounded-lg px-3 py-1.5 text-sm font-medium capitalize transition-colors ${i===e?"bg-accent text-white":"bg-bg-tertiary text-text-secondary hover:text-text"}`,children:e},e))}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[m.map(e=>{const t=e.id===c,u=e.id===n;return s.jsxs("button",{onClick:()=>v(e.id),disabled:t||!!n,className:`rounded-xl border p-4 text-left transition-all ${t?"border-accent bg-accent/10 ring-1 ring-accent/30":"border-border bg-bg-secondary hover:border-border-light hover:bg-bg-secondary"} ${u?"opacity-60":""} disabled:cursor-default`,children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("h3",{className:"font-medium text-text",children:e.name}),t&&s.jsx("span",{className:"rounded-full bg-accent/20 px-2 py-0.5 text-xs font-medium text-accent-hover",children:"Active"}),u&&s.jsx("span",{className:"text-xs text-text-secondary",children:"Switching..."})]}),s.jsx("p",{className:"text-sm text-text-secondary line-clamp-2",children:e.description}),s.jsx("p",{className:"mt-2 text-xs capitalize text-text-muted",children:e.division})]},e.id)}),m.length===0&&s.jsx("p",{className:"col-span-full py-12 text-center text-text-muted",children:"No personas in this division"})]})]})}export{w as default};
@@ -1,4 +1,4 @@
1
- import{c as I,r as o,J as B,a$ as H,b0 as F,b1 as J,b2 as K,j as e,b3 as U}from"./index-BISxhHXP.js";import"./Input-CT_e2ZXD.js";import{S}from"./StatusBadge-CmSemYNT.js";import{P as G}from"./PageHeader-CjDtUo8m.js";import{R as Q}from"./refresh-cw-CFv1BDy9.js";import{R as V}from"./radio-BNdFCb41.js";import{S as X}from"./shield-check-CKPsc0rI.js";import{C as P}from"./clipboard-list-C3GIPAT3.js";import"./clsx-B-dksMZM.js";import"./chevron-right-D1DyaeTm.js";/**
1
+ import{c as I,r as o,J as B,a$ as H,b0 as F,b1 as J,b2 as K,j as e,b3 as U}from"./index-BlFxPvdg.js";import"./Input-rfmX8eLw.js";import{S}from"./StatusBadge-BtDtyL5L.js";import{P as G}from"./PageHeader-CawSrb9E.js";import{R as Q}from"./refresh-cw-BdcqinTm.js";import{R as V}from"./radio-BySzBvYH.js";import{S as X}from"./shield-check-BjuAv28a.js";import{C as P}from"./clipboard-list-DF1F3Vjf.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DJCsUSwz.js";/**
2
2
  * @license lucide-react v0.513.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as a,ay as p,j as e,az as h,aA as f}from"./index-BISxhHXP.js";import{P as u}from"./PageHeader-CjDtUo8m.js";import{R as b}from"./refresh-cw-CFv1BDy9.js";import{B as g}from"./book-open-CCt4Gq9I.js";import{P as j}from"./play-CuwPKVSv.js";import{T as N}from"./trash-2-B7yIJ8B5.js";import"./chevron-right-D1DyaeTm.js";function E(){const[d,o]=a.useState([]),[i,n]=a.useState(!0),[c,r]=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=>{r(s);try{await h(s)}catch{}r(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 l;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 • ",(l=s.tags)==null?void 0:l.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{E as default};
1
+ import{r as a,ay as p,j as e,az as h,aA as f}from"./index-BlFxPvdg.js";import{P as u}from"./PageHeader-CawSrb9E.js";import{R as b}from"./refresh-cw-BdcqinTm.js";import{B as g}from"./book-open-CrOs3smB.js";import{P as j}from"./play-MuD1S1C5.js";import{T as N}from"./trash-2-Dtxmn6GE.js";import"./chevron-right-DJCsUSwz.js";function E(){const[d,o]=a.useState([]),[i,n]=a.useState(!0),[c,r]=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=>{r(s);try{await h(s)}catch{}r(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 l;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 • ",(l=s.tags)==null?void 0:l.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{E as default};
@@ -1 +1 @@
1
- import{r as t,b as n,j as e}from"./index-BISxhHXP.js";import{P as i}from"./PageHeader-CjDtUo8m.js";import"./chevron-right-D1DyaeTm.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
+ import{r as t,b as n,j as e}from"./index-BlFxPvdg.js";import{P as i}from"./PageHeader-CawSrb9E.js";import"./chevron-right-DJCsUSwz.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};