@xenosystem/agent-interface-ui 0.1.3

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 (384) hide show
  1. package/LICENSE +67 -0
  2. package/dist/adapters/agentHostPlatformBridge.d.ts +24 -0
  3. package/dist/adapters/agentHostPlatformBridge.d.ts.map +1 -0
  4. package/dist/adapters/agentHostPlatformBridge.js +1244 -0
  5. package/dist/adapters/agentHostPlatformBridge.js.map +1 -0
  6. package/dist/adapters/hubAgentPlatformBridge.d.ts +17 -0
  7. package/dist/adapters/hubAgentPlatformBridge.d.ts.map +1 -0
  8. package/dist/adapters/hubAgentPlatformBridge.js +109 -0
  9. package/dist/adapters/hubAgentPlatformBridge.js.map +1 -0
  10. package/dist/adapters/xenoAgentCompatibilityBridge.d.ts +14 -0
  11. package/dist/adapters/xenoAgentCompatibilityBridge.d.ts.map +1 -0
  12. package/dist/adapters/xenoAgentCompatibilityBridge.js +237 -0
  13. package/dist/adapters/xenoAgentCompatibilityBridge.js.map +1 -0
  14. package/dist/adapters/xenoAgentHostCatalog.d.ts +40 -0
  15. package/dist/adapters/xenoAgentHostCatalog.d.ts.map +1 -0
  16. package/dist/adapters/xenoAgentHostCatalog.js +228 -0
  17. package/dist/adapters/xenoAgentHostCatalog.js.map +1 -0
  18. package/dist/components/agent/AIStatusIndicator.d.ts +25 -0
  19. package/dist/components/agent/AIStatusIndicator.d.ts.map +1 -0
  20. package/dist/components/agent/AIStatusIndicator.js +85 -0
  21. package/dist/components/agent/AIStatusIndicator.js.map +1 -0
  22. package/dist/components/agent/AgentInterface.d.ts +21 -0
  23. package/dist/components/agent/AgentInterface.d.ts.map +1 -0
  24. package/dist/components/agent/AgentInterface.js +7586 -0
  25. package/dist/components/agent/AgentInterface.js.map +1 -0
  26. package/dist/components/agent/AgentOnboarding.d.ts +16 -0
  27. package/dist/components/agent/AgentOnboarding.d.ts.map +1 -0
  28. package/dist/components/agent/AgentOnboarding.js +423 -0
  29. package/dist/components/agent/AgentOnboarding.js.map +1 -0
  30. package/dist/components/agent/AgentPtyTerminalPanel.d.ts +13 -0
  31. package/dist/components/agent/AgentPtyTerminalPanel.d.ts.map +1 -0
  32. package/dist/components/agent/AgentPtyTerminalPanel.js +129 -0
  33. package/dist/components/agent/AgentPtyTerminalPanel.js.map +1 -0
  34. package/dist/components/agent/AgentView.d.ts +143 -0
  35. package/dist/components/agent/AgentView.d.ts.map +1 -0
  36. package/dist/components/agent/AgentView.js +7250 -0
  37. package/dist/components/agent/AgentView.js.map +1 -0
  38. package/dist/components/agent/AgentWorkbenchCliPanel.d.ts +15 -0
  39. package/dist/components/agent/AgentWorkbenchCliPanel.d.ts.map +1 -0
  40. package/dist/components/agent/AgentWorkbenchCliPanel.js +275 -0
  41. package/dist/components/agent/AgentWorkbenchCliPanel.js.map +1 -0
  42. package/dist/components/agent/AgentWorkbenchPanel.d.ts +791 -0
  43. package/dist/components/agent/AgentWorkbenchPanel.d.ts.map +1 -0
  44. package/dist/components/agent/AgentWorkbenchPanel.js +584 -0
  45. package/dist/components/agent/AgentWorkbenchPanel.js.map +1 -0
  46. package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts +11 -0
  47. package/dist/components/agent/AgentWorkspaceBrowserPanel.d.ts.map +1 -0
  48. package/dist/components/agent/AgentWorkspaceBrowserPanel.js +198 -0
  49. package/dist/components/agent/AgentWorkspaceBrowserPanel.js.map +1 -0
  50. package/dist/components/agent/AssistantTurnStatusNotice.d.ts +16 -0
  51. package/dist/components/agent/AssistantTurnStatusNotice.d.ts.map +1 -0
  52. package/dist/components/agent/AssistantTurnStatusNotice.js +54 -0
  53. package/dist/components/agent/AssistantTurnStatusNotice.js.map +1 -0
  54. package/dist/components/agent/CommandToolCard.d.ts +11 -0
  55. package/dist/components/agent/CommandToolCard.d.ts.map +1 -0
  56. package/dist/components/agent/CommandToolCard.js +29 -0
  57. package/dist/components/agent/CommandToolCard.js.map +1 -0
  58. package/dist/components/agent/FleetPanel.d.ts +28 -0
  59. package/dist/components/agent/FleetPanel.d.ts.map +1 -0
  60. package/dist/components/agent/FleetPanel.js +175 -0
  61. package/dist/components/agent/FleetPanel.js.map +1 -0
  62. package/dist/components/agent/GhostTextArea.d.ts +13 -0
  63. package/dist/components/agent/GhostTextArea.d.ts.map +1 -0
  64. package/dist/components/agent/GhostTextArea.js +21 -0
  65. package/dist/components/agent/GhostTextArea.js.map +1 -0
  66. package/dist/components/agent/IntakePanel.d.ts +29 -0
  67. package/dist/components/agent/IntakePanel.d.ts.map +1 -0
  68. package/dist/components/agent/IntakePanel.js +81 -0
  69. package/dist/components/agent/IntakePanel.js.map +1 -0
  70. package/dist/components/agent/KnowledgePanel.d.ts +25 -0
  71. package/dist/components/agent/KnowledgePanel.d.ts.map +1 -0
  72. package/dist/components/agent/KnowledgePanel.js +99 -0
  73. package/dist/components/agent/KnowledgePanel.js.map +1 -0
  74. package/dist/components/agent/MonacoDiffWorkbenchEditor.d.ts +9 -0
  75. package/dist/components/agent/MonacoDiffWorkbenchEditor.d.ts.map +1 -0
  76. package/dist/components/agent/MonacoDiffWorkbenchEditor.js +204 -0
  77. package/dist/components/agent/MonacoDiffWorkbenchEditor.js.map +1 -0
  78. package/dist/components/agent/MonacoWorkbenchEditor.d.ts +15 -0
  79. package/dist/components/agent/MonacoWorkbenchEditor.d.ts.map +1 -0
  80. package/dist/components/agent/MonacoWorkbenchEditor.js +380 -0
  81. package/dist/components/agent/MonacoWorkbenchEditor.js.map +1 -0
  82. package/dist/components/agent/PermissionDialog.d.ts +34 -0
  83. package/dist/components/agent/PermissionDialog.d.ts.map +1 -0
  84. package/dist/components/agent/PermissionDialog.js +67 -0
  85. package/dist/components/agent/PermissionDialog.js.map +1 -0
  86. package/dist/components/agent/PluginManager.d.ts +20 -0
  87. package/dist/components/agent/PluginManager.d.ts.map +1 -0
  88. package/dist/components/agent/PluginManager.js +506 -0
  89. package/dist/components/agent/PluginManager.js.map +1 -0
  90. package/dist/components/agent/RunReviewPanel.d.ts +52 -0
  91. package/dist/components/agent/RunReviewPanel.d.ts.map +1 -0
  92. package/dist/components/agent/RunReviewPanel.js +236 -0
  93. package/dist/components/agent/RunReviewPanel.js.map +1 -0
  94. package/dist/components/agent/SessionsPanel.d.ts +30 -0
  95. package/dist/components/agent/SessionsPanel.d.ts.map +1 -0
  96. package/dist/components/agent/SessionsPanel.js +247 -0
  97. package/dist/components/agent/SessionsPanel.js.map +1 -0
  98. package/dist/components/agent/acp/AcpAgentConfigForm.d.ts +19 -0
  99. package/dist/components/agent/acp/AcpAgentConfigForm.d.ts.map +1 -0
  100. package/dist/components/agent/acp/AcpAgentConfigForm.js +85 -0
  101. package/dist/components/agent/acp/AcpAgentConfigForm.js.map +1 -0
  102. package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.d.ts +10 -0
  103. package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.d.ts.map +1 -0
  104. package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js +80 -0
  105. package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js.map +1 -0
  106. package/dist/components/agent/acp/AcpAgentManager.d.ts +3 -0
  107. package/dist/components/agent/acp/AcpAgentManager.d.ts.map +1 -0
  108. package/dist/components/agent/acp/AcpAgentManager.js +152 -0
  109. package/dist/components/agent/acp/AcpAgentManager.js.map +1 -0
  110. package/dist/components/agent/acp/AcpAgentTestResultPanel.d.ts +9 -0
  111. package/dist/components/agent/acp/AcpAgentTestResultPanel.d.ts.map +1 -0
  112. package/dist/components/agent/acp/AcpAgentTestResultPanel.js +24 -0
  113. package/dist/components/agent/acp/AcpAgentTestResultPanel.js.map +1 -0
  114. package/dist/components/agent/acp/AcpApprovalPanel.d.ts +29 -0
  115. package/dist/components/agent/acp/AcpApprovalPanel.d.ts.map +1 -0
  116. package/dist/components/agent/acp/AcpApprovalPanel.js +37 -0
  117. package/dist/components/agent/acp/AcpApprovalPanel.js.map +1 -0
  118. package/dist/components/agent/acp/AcpCertificationPanel.d.ts +10 -0
  119. package/dist/components/agent/acp/AcpCertificationPanel.d.ts.map +1 -0
  120. package/dist/components/agent/acp/AcpCertificationPanel.js +41 -0
  121. package/dist/components/agent/acp/AcpCertificationPanel.js.map +1 -0
  122. package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.d.ts +11 -0
  123. package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.d.ts.map +1 -0
  124. package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js +32 -0
  125. package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js.map +1 -0
  126. package/dist/components/agent/acp/AcpProviderManagerPanel.d.ts +7 -0
  127. package/dist/components/agent/acp/AcpProviderManagerPanel.d.ts.map +1 -0
  128. package/dist/components/agent/acp/AcpProviderManagerPanel.js +69 -0
  129. package/dist/components/agent/acp/AcpProviderManagerPanel.js.map +1 -0
  130. package/dist/components/agent/acp/AcpProviderModelsPanel.d.ts +7 -0
  131. package/dist/components/agent/acp/AcpProviderModelsPanel.d.ts.map +1 -0
  132. package/dist/components/agent/acp/AcpProviderModelsPanel.js +108 -0
  133. package/dist/components/agent/acp/AcpProviderModelsPanel.js.map +1 -0
  134. package/dist/components/agent/acp/AcpSupportBundlePanel.d.ts +8 -0
  135. package/dist/components/agent/acp/AcpSupportBundlePanel.d.ts.map +1 -0
  136. package/dist/components/agent/acp/AcpSupportBundlePanel.js +56 -0
  137. package/dist/components/agent/acp/AcpSupportBundlePanel.js.map +1 -0
  138. package/dist/components/agent/compactionSummary.d.ts +28 -0
  139. package/dist/components/agent/compactionSummary.d.ts.map +1 -0
  140. package/dist/components/agent/compactionSummary.js +41 -0
  141. package/dist/components/agent/compactionSummary.js.map +1 -0
  142. package/dist/components/agent/monacoWorkbenchShared.d.ts +13 -0
  143. package/dist/components/agent/monacoWorkbenchShared.d.ts.map +1 -0
  144. package/dist/components/agent/monacoWorkbenchShared.js +226 -0
  145. package/dist/components/agent/monacoWorkbenchShared.js.map +1 -0
  146. package/dist/components/agent/settings/EntitySettingsLayout.d.ts +61 -0
  147. package/dist/components/agent/settings/EntitySettingsLayout.d.ts.map +1 -0
  148. package/dist/components/agent/settings/EntitySettingsLayout.js +72 -0
  149. package/dist/components/agent/settings/EntitySettingsLayout.js.map +1 -0
  150. package/dist/components/agent/settings/SettingsNavigation.d.ts +8 -0
  151. package/dist/components/agent/settings/SettingsNavigation.d.ts.map +1 -0
  152. package/dist/components/agent/settings/SettingsNavigation.js +39 -0
  153. package/dist/components/agent/settings/SettingsNavigation.js.map +1 -0
  154. package/dist/components/agent/settings/sections/AccessMembersSection.d.ts +3 -0
  155. package/dist/components/agent/settings/sections/AccessMembersSection.d.ts.map +1 -0
  156. package/dist/components/agent/settings/sections/AccessMembersSection.js +31 -0
  157. package/dist/components/agent/settings/sections/AccessMembersSection.js.map +1 -0
  158. package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.d.ts +25 -0
  159. package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.d.ts.map +1 -0
  160. package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.js +56 -0
  161. package/dist/components/agent/settings/sections/AgentPermissionRulesPanel.js.map +1 -0
  162. package/dist/components/agent/settings/sections/DangerZoneSection.d.ts +3 -0
  163. package/dist/components/agent/settings/sections/DangerZoneSection.d.ts.map +1 -0
  164. package/dist/components/agent/settings/sections/DangerZoneSection.js +19 -0
  165. package/dist/components/agent/settings/sections/DangerZoneSection.js.map +1 -0
  166. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.d.ts +3 -0
  167. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.d.ts.map +1 -0
  168. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js +66 -0
  169. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js.map +1 -0
  170. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.d.ts +3 -0
  171. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.d.ts.map +1 -0
  172. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js +87 -0
  173. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js.map +1 -0
  174. package/dist/components/agent/settings/sections/ExportBackupSection.d.ts +3 -0
  175. package/dist/components/agent/settings/sections/ExportBackupSection.d.ts.map +1 -0
  176. package/dist/components/agent/settings/sections/ExportBackupSection.js +23 -0
  177. package/dist/components/agent/settings/sections/ExportBackupSection.js.map +1 -0
  178. package/dist/components/agent/settings/sections/GeneralSection.d.ts +3 -0
  179. package/dist/components/agent/settings/sections/GeneralSection.d.ts.map +1 -0
  180. package/dist/components/agent/settings/sections/GeneralSection.js +15 -0
  181. package/dist/components/agent/settings/sections/GeneralSection.js.map +1 -0
  182. package/dist/components/agent/settings/sections/IntegrationsSection.d.ts +3 -0
  183. package/dist/components/agent/settings/sections/IntegrationsSection.d.ts.map +1 -0
  184. package/dist/components/agent/settings/sections/IntegrationsSection.js +40 -0
  185. package/dist/components/agent/settings/sections/IntegrationsSection.js.map +1 -0
  186. package/dist/components/agent/settings/sections/NotificationsSection.d.ts +3 -0
  187. package/dist/components/agent/settings/sections/NotificationsSection.d.ts.map +1 -0
  188. package/dist/components/agent/settings/sections/NotificationsSection.js +28 -0
  189. package/dist/components/agent/settings/sections/NotificationsSection.js.map +1 -0
  190. package/dist/components/agent/settings/sections/ResourceLimitsSection.d.ts +3 -0
  191. package/dist/components/agent/settings/sections/ResourceLimitsSection.d.ts.map +1 -0
  192. package/dist/components/agent/settings/sections/ResourceLimitsSection.js +17 -0
  193. package/dist/components/agent/settings/sections/ResourceLimitsSection.js.map +1 -0
  194. package/dist/components/agent/settings/sections/SecurityComplianceSection.d.ts +3 -0
  195. package/dist/components/agent/settings/sections/SecurityComplianceSection.d.ts.map +1 -0
  196. package/dist/components/agent/settings/sections/SecurityComplianceSection.js +28 -0
  197. package/dist/components/agent/settings/sections/SecurityComplianceSection.js.map +1 -0
  198. package/dist/components/agent/settings/sections/UsageAnalyticsSection.d.ts +3 -0
  199. package/dist/components/agent/settings/sections/UsageAnalyticsSection.d.ts.map +1 -0
  200. package/dist/components/agent/settings/sections/UsageAnalyticsSection.js +17 -0
  201. package/dist/components/agent/settings/sections/UsageAnalyticsSection.js.map +1 -0
  202. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.d.ts +54 -0
  203. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.d.ts.map +1 -0
  204. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js +333 -0
  205. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js.map +1 -0
  206. package/dist/components/agent/settings/shared/CheckboxField.d.ts +13 -0
  207. package/dist/components/agent/settings/shared/CheckboxField.d.ts.map +1 -0
  208. package/dist/components/agent/settings/shared/CheckboxField.js +8 -0
  209. package/dist/components/agent/settings/shared/CheckboxField.js.map +1 -0
  210. package/dist/components/agent/settings/shared/InputField.d.ts +15 -0
  211. package/dist/components/agent/settings/shared/InputField.d.ts.map +1 -0
  212. package/dist/components/agent/settings/shared/InputField.js +7 -0
  213. package/dist/components/agent/settings/shared/InputField.js.map +1 -0
  214. package/dist/components/agent/settings/shared/MembersTable.d.ts +11 -0
  215. package/dist/components/agent/settings/shared/MembersTable.d.ts.map +1 -0
  216. package/dist/components/agent/settings/shared/MembersTable.js +7 -0
  217. package/dist/components/agent/settings/shared/MembersTable.js.map +1 -0
  218. package/dist/components/agent/settings/shared/SettingRow.d.ts +11 -0
  219. package/dist/components/agent/settings/shared/SettingRow.d.ts.map +1 -0
  220. package/dist/components/agent/settings/shared/SettingRow.js +6 -0
  221. package/dist/components/agent/settings/shared/SettingRow.js.map +1 -0
  222. package/dist/components/agent/settings/shared/SettingsCard.d.ts +11 -0
  223. package/dist/components/agent/settings/shared/SettingsCard.d.ts.map +1 -0
  224. package/dist/components/agent/settings/shared/SettingsCard.js +8 -0
  225. package/dist/components/agent/settings/shared/SettingsCard.js.map +1 -0
  226. package/dist/components/agent/settings/shared/ToggleSwitch.d.ts +8 -0
  227. package/dist/components/agent/settings/shared/ToggleSwitch.d.ts.map +1 -0
  228. package/dist/components/agent/settings/shared/ToggleSwitch.js +6 -0
  229. package/dist/components/agent/settings/shared/ToggleSwitch.js.map +1 -0
  230. package/dist/components/agent/settings/shared/UsageChart.d.ts +12 -0
  231. package/dist/components/agent/settings/shared/UsageChart.d.ts.map +1 -0
  232. package/dist/components/agent/settings/shared/UsageChart.js +16 -0
  233. package/dist/components/agent/settings/shared/UsageChart.js.map +1 -0
  234. package/dist/components/agent/toolCardDisplay.d.ts +24 -0
  235. package/dist/components/agent/toolCardDisplay.d.ts.map +1 -0
  236. package/dist/components/agent/toolCardDisplay.js +85 -0
  237. package/dist/components/agent/toolCardDisplay.js.map +1 -0
  238. package/dist/components/product/XenoAgentProductHeader.d.ts +18 -0
  239. package/dist/components/product/XenoAgentProductHeader.d.ts.map +1 -0
  240. package/dist/components/product/XenoAgentProductHeader.js +25 -0
  241. package/dist/components/product/XenoAgentProductHeader.js.map +1 -0
  242. package/dist/components/product/XenoAgentSessionTabs.d.ts +18 -0
  243. package/dist/components/product/XenoAgentSessionTabs.d.ts.map +1 -0
  244. package/dist/components/product/XenoAgentSessionTabs.js +103 -0
  245. package/dist/components/product/XenoAgentSessionTabs.js.map +1 -0
  246. package/dist/components/ui/CodeBlock.d.ts +8 -0
  247. package/dist/components/ui/CodeBlock.d.ts.map +1 -0
  248. package/dist/components/ui/CodeBlock.js +89 -0
  249. package/dist/components/ui/CodeBlock.js.map +1 -0
  250. package/dist/components/ui/XenoLogo.d.ts +11 -0
  251. package/dist/components/ui/XenoLogo.d.ts.map +1 -0
  252. package/dist/components/ui/XenoLogo.js +9 -0
  253. package/dist/components/ui/XenoLogo.js.map +1 -0
  254. package/dist/index.d.ts +50 -0
  255. package/dist/index.d.ts.map +1 -0
  256. package/dist/index.js +127 -0
  257. package/dist/index.js.map +1 -0
  258. package/dist/platformApiTypes.d.ts +3992 -0
  259. package/dist/platformApiTypes.d.ts.map +1 -0
  260. package/dist/platformApiTypes.js +2 -0
  261. package/dist/platformApiTypes.js.map +1 -0
  262. package/dist/platformBridge.d.ts +9 -0
  263. package/dist/platformBridge.d.ts.map +1 -0
  264. package/dist/platformBridge.js +19 -0
  265. package/dist/platformBridge.js.map +1 -0
  266. package/dist/providerSelector.d.ts +28 -0
  267. package/dist/providerSelector.d.ts.map +1 -0
  268. package/dist/providerSelector.js +104 -0
  269. package/dist/providerSelector.js.map +1 -0
  270. package/dist/services/connectionMode.d.ts +13 -0
  271. package/dist/services/connectionMode.d.ts.map +1 -0
  272. package/dist/services/connectionMode.js +31 -0
  273. package/dist/services/connectionMode.js.map +1 -0
  274. package/dist/sessionTabs.d.ts +48 -0
  275. package/dist/sessionTabs.d.ts.map +1 -0
  276. package/dist/sessionTabs.js +106 -0
  277. package/dist/sessionTabs.js.map +1 -0
  278. package/dist/stores/acpAgentStore.d.ts +264 -0
  279. package/dist/stores/acpAgentStore.d.ts.map +1 -0
  280. package/dist/stores/acpAgentStore.js +825 -0
  281. package/dist/stores/acpAgentStore.js.map +1 -0
  282. package/dist/stores/agentChatStore.d.ts +529 -0
  283. package/dist/stores/agentChatStore.d.ts.map +1 -0
  284. package/dist/stores/agentChatStore.js +5309 -0
  285. package/dist/stores/agentChatStore.js.map +1 -0
  286. package/dist/stores/agentIdeStore.d.ts +9 -0
  287. package/dist/stores/agentIdeStore.d.ts.map +1 -0
  288. package/dist/stores/agentIdeStore.js +8 -0
  289. package/dist/stores/agentIdeStore.js.map +1 -0
  290. package/dist/stores/agentSearchStore.d.ts +174 -0
  291. package/dist/stores/agentSearchStore.d.ts.map +1 -0
  292. package/dist/stores/agentSearchStore.js +305 -0
  293. package/dist/stores/agentSearchStore.js.map +1 -0
  294. package/dist/stores/authStore.d.ts +26 -0
  295. package/dist/stores/authStore.d.ts.map +1 -0
  296. package/dist/stores/authStore.js +163 -0
  297. package/dist/stores/authStore.js.map +1 -0
  298. package/dist/stores/entitySettingsStore.d.ts +236 -0
  299. package/dist/stores/entitySettingsStore.d.ts.map +1 -0
  300. package/dist/stores/entitySettingsStore.js +916 -0
  301. package/dist/stores/entitySettingsStore.js.map +1 -0
  302. package/dist/stores/permissionStore.d.ts +25 -0
  303. package/dist/stores/permissionStore.d.ts.map +1 -0
  304. package/dist/stores/permissionStore.js +58 -0
  305. package/dist/stores/permissionStore.js.map +1 -0
  306. package/dist/stores/suggestionStore.d.ts +29 -0
  307. package/dist/stores/suggestionStore.d.ts.map +1 -0
  308. package/dist/stores/suggestionStore.js +160 -0
  309. package/dist/stores/suggestionStore.js.map +1 -0
  310. package/dist/stores/tabStore.d.ts +30 -0
  311. package/dist/stores/tabStore.d.ts.map +1 -0
  312. package/dist/stores/tabStore.js +252 -0
  313. package/dist/stores/tabStore.js.map +1 -0
  314. package/dist/stores/themeStore.d.ts +13 -0
  315. package/dist/stores/themeStore.d.ts.map +1 -0
  316. package/dist/stores/themeStore.js +77 -0
  317. package/dist/stores/themeStore.js.map +1 -0
  318. package/dist/stores/workspaceStore.d.ts +175 -0
  319. package/dist/stores/workspaceStore.d.ts.map +1 -0
  320. package/dist/stores/workspaceStore.js +694 -0
  321. package/dist/stores/workspaceStore.js.map +1 -0
  322. package/dist/stores/xenoChatStore.d.ts +88 -0
  323. package/dist/stores/xenoChatStore.d.ts.map +1 -0
  324. package/dist/stores/xenoChatStore.js +572 -0
  325. package/dist/stores/xenoChatStore.js.map +1 -0
  326. package/dist/toolCardProjection.d.ts +33 -0
  327. package/dist/toolCardProjection.d.ts.map +1 -0
  328. package/dist/toolCardProjection.js +62 -0
  329. package/dist/toolCardProjection.js.map +1 -0
  330. package/dist/types/agentEditor.d.ts +39 -0
  331. package/dist/types/agentEditor.d.ts.map +1 -0
  332. package/dist/types/agentEditor.js +2 -0
  333. package/dist/types/agentEditor.js.map +1 -0
  334. package/dist/types/agentRuntimeProvider.d.ts +2 -0
  335. package/dist/types/agentRuntimeProvider.d.ts.map +1 -0
  336. package/dist/types/agentRuntimeProvider.js +2 -0
  337. package/dist/types/agentRuntimeProvider.js.map +1 -0
  338. package/dist/utils/acpExecutionAuthority.d.ts +18 -0
  339. package/dist/utils/acpExecutionAuthority.d.ts.map +1 -0
  340. package/dist/utils/acpExecutionAuthority.js +22 -0
  341. package/dist/utils/acpExecutionAuthority.js.map +1 -0
  342. package/dist/utils/agentAttachedContextPrompt.d.ts +2 -0
  343. package/dist/utils/agentAttachedContextPrompt.d.ts.map +1 -0
  344. package/dist/utils/agentAttachedContextPrompt.js +2 -0
  345. package/dist/utils/agentAttachedContextPrompt.js.map +1 -0
  346. package/dist/utils/agentModelContext.d.ts +2 -0
  347. package/dist/utils/agentModelContext.d.ts.map +1 -0
  348. package/dist/utils/agentModelContext.js +2 -0
  349. package/dist/utils/agentModelContext.js.map +1 -0
  350. package/dist/utils/agentReasoningEffort.d.ts +3 -0
  351. package/dist/utils/agentReasoningEffort.d.ts.map +1 -0
  352. package/dist/utils/agentReasoningEffort.js +2 -0
  353. package/dist/utils/agentReasoningEffort.js.map +1 -0
  354. package/dist/utils/agentRuntimeProvider.d.ts +3 -0
  355. package/dist/utils/agentRuntimeProvider.d.ts.map +1 -0
  356. package/dist/utils/agentRuntimeProvider.js +2 -0
  357. package/dist/utils/agentRuntimeProvider.js.map +1 -0
  358. package/dist/utils/cloudModels.d.ts +3 -0
  359. package/dist/utils/cloudModels.d.ts.map +1 -0
  360. package/dist/utils/cloudModels.js +181 -0
  361. package/dist/utils/cloudModels.js.map +1 -0
  362. package/dist/utils/conversationRuntime.d.ts +3 -0
  363. package/dist/utils/conversationRuntime.d.ts.map +1 -0
  364. package/dist/utils/conversationRuntime.js +2 -0
  365. package/dist/utils/conversationRuntime.js.map +1 -0
  366. package/dist/utils/fileCreateIntent.d.ts +16 -0
  367. package/dist/utils/fileCreateIntent.d.ts.map +1 -0
  368. package/dist/utils/fileCreateIntent.js +123 -0
  369. package/dist/utils/fileCreateIntent.js.map +1 -0
  370. package/dist/utils/legacyAgentRuntimeEvents.d.ts +2 -0
  371. package/dist/utils/legacyAgentRuntimeEvents.d.ts.map +1 -0
  372. package/dist/utils/legacyAgentRuntimeEvents.js +2 -0
  373. package/dist/utils/legacyAgentRuntimeEvents.js.map +1 -0
  374. package/dist/utils/markdownWindowsPaths.d.ts +2 -0
  375. package/dist/utils/markdownWindowsPaths.d.ts.map +1 -0
  376. package/dist/utils/markdownWindowsPaths.js +2 -0
  377. package/dist/utils/markdownWindowsPaths.js.map +1 -0
  378. package/dist/utils/workspaceSelectionContinuation.d.ts +2 -0
  379. package/dist/utils/workspaceSelectionContinuation.d.ts.map +1 -0
  380. package/dist/utils/workspaceSelectionContinuation.js +2 -0
  381. package/dist/utils/workspaceSelectionContinuation.js.map +1 -0
  382. package/package.json +53 -0
  383. package/src/agent.css +1156 -0
  384. package/src/foundation.css +62 -0
@@ -0,0 +1,584 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { getAgentPlatformBridge } from '../../platformBridge';
3
+ import { RunReviewPanel } from './RunReviewPanel';
4
+ import { FleetPanel } from './FleetPanel';
5
+ import { SessionsPanel } from './SessionsPanel';
6
+ import { IntakePanel } from './IntakePanel';
7
+ import { KnowledgePanel } from './KnowledgePanel';
8
+ import React from 'react';
9
+ const AgentWorkbenchCliPanel = React.lazy(async () => {
10
+ const module = await import('./AgentWorkbenchCliPanel');
11
+ return { default: module.AgentWorkbenchCliPanel };
12
+ });
13
+ /**
14
+ * Every workbench tab, in the order they are offered to the user.
15
+ *
16
+ * 🔴 **This array IS the tab bar AND IS the type.** It used to be a literal
17
+ * hand-maintained beside a separately hand-maintained union, and the two drifted:
18
+ * `review`, `fleet`, `terminals`, `intake` and `learned` were added to the union,
19
+ * mounted, and unit-tested — while the bar never listed them, so no user could
20
+ * open any of them. Built, tested, unreachable: the same shape as xeno-workflow's
21
+ * 76 registered-nowhere nodes and xeno-tools' never-called `install`.
22
+ *
23
+ * Deriving the type from the array makes that unrepresentable. A tab absent here
24
+ * does not exist, so its render guard becomes a compile error rather than dead
25
+ * code that looks finished.
26
+ */
27
+ export const WORKBENCH_PANEL_TABS = [
28
+ 'trace',
29
+ 'output',
30
+ 'problems',
31
+ 'settings',
32
+ 'knowledge',
33
+ 'plugins',
34
+ 'code',
35
+ 'engineering',
36
+ 'diffs',
37
+ 'review',
38
+ 'fleet',
39
+ 'terminals',
40
+ 'intake',
41
+ 'learned',
42
+ 'checkpoints',
43
+ 'sessions',
44
+ 'runtime',
45
+ 'cli',
46
+ 'subagents',
47
+ 'policy',
48
+ 'support',
49
+ 'terminal',
50
+ ];
51
+ /**
52
+ * Tabs that render a dense surface and get the taller/wider shell.
53
+ *
54
+ * Expressed as the EXCEPTIONS rather than as a list of the wide ones: the wide
55
+ * list was two more hand-maintained copies of the union (one for height, one for
56
+ * width in AgentInterface), and every new panel had to remember all three.
57
+ */
58
+ const NARROW_WORKBENCH_TABS = ['trace', 'output', 'problems', 'terminal'];
59
+ export function isWideWorkbenchTab(tab) {
60
+ return !NARROW_WORKBENCH_TABS.includes(tab);
61
+ }
62
+ function formatCodeBytes(bytes) {
63
+ if (typeof bytes !== 'number' || !Number.isFinite(bytes))
64
+ return '';
65
+ if (bytes < 1024)
66
+ return `${bytes}B`;
67
+ if (bytes < 1024 * 1024)
68
+ return `${(bytes / 1024).toFixed(1)}KB`;
69
+ return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
70
+ }
71
+ function formatEngineeringDuration(durationMs) {
72
+ if (typeof durationMs !== 'number' || !Number.isFinite(durationMs))
73
+ return '';
74
+ return durationMs >= 1000 ? `${(durationMs / 1000).toFixed(1)}s` : `${Math.round(durationMs)}ms`;
75
+ }
76
+ function formatEngineeringTimestamp(timestamp) {
77
+ if (typeof timestamp !== 'number' || !Number.isFinite(timestamp))
78
+ return '';
79
+ return new Date(timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
80
+ }
81
+ function countTextLines(value) {
82
+ if (!value)
83
+ return 0;
84
+ return value.replace(/\r\n/g, '\n').split('\n').length;
85
+ }
86
+ function patchSnapshotToEditorDiff(patch, snapshot) {
87
+ const normalizedPath = (snapshot.path || snapshot.relativePath || patch.filesChanged[0] || patch.files[0] || patch.id).replace(/\//g, '\\');
88
+ const name = normalizedPath.split('\\').filter(Boolean).pop() || snapshot.relativePath || patch.title;
89
+ const extension = snapshot.language || (name.includes('.') ? name.split('.').pop() || '' : '');
90
+ return {
91
+ id: `${patch.id}:${snapshot.relativePath || normalizedPath}`,
92
+ path: normalizedPath,
93
+ name,
94
+ extension,
95
+ originalContent: snapshot.originalContent || '',
96
+ modifiedContent: snapshot.modifiedContent || '',
97
+ addedLines: typeof snapshot.addedLines === 'number' ? snapshot.addedLines : countTextLines(snapshot.modifiedContent || ''),
98
+ removedLines: typeof snapshot.removedLines === 'number' ? snapshot.removedLines : countTextLines(snapshot.originalContent || ''),
99
+ createdAt: patch.timestamp || patch.createdAt,
100
+ };
101
+ }
102
+ function patchHunkDecision(patch, hunkId) {
103
+ return [...(patch.decisions || [])].reverse().find((decision) => (decision.hunkId === hunkId
104
+ && decision.state === 'applied'
105
+ && (decision.action === 'accept' || decision.action === 'reject')));
106
+ }
107
+ function formatSubagentTimestamp(timestamp) {
108
+ if (typeof timestamp !== 'number' || !Number.isFinite(timestamp))
109
+ return '';
110
+ return new Date(timestamp).toLocaleString([], { month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' });
111
+ }
112
+ function formatSubagentDuration(run) {
113
+ const start = run.startedAt || run.createdAt;
114
+ const end = run.endedAt || (isActiveSubagentRun(run.status) ? Date.now() : run.updatedAt);
115
+ if (!start || !end || end < start)
116
+ return '';
117
+ return formatEngineeringDuration(end - start);
118
+ }
119
+ function isActiveSubagentRun(status) {
120
+ return status === 'queued'
121
+ || status === 'launch-requested'
122
+ || status === 'running'
123
+ || status === 'waiting-for-permission'
124
+ || status === 'waiting-for-user';
125
+ }
126
+ function subagentStatusClass(status) {
127
+ if (status === 'completed')
128
+ return 'bg-[#96e59d]';
129
+ if (status === 'failed')
130
+ return 'bg-[#ff9a9a]';
131
+ if (status === 'cancelled')
132
+ return 'bg-white/20';
133
+ if (status === 'waiting-for-permission' || status === 'waiting-for-user')
134
+ return 'bg-[#ffd38a]';
135
+ if (status === 'launch-requested')
136
+ return 'bg-[#9fb7ff]';
137
+ return 'bg-[#8ad7ff]';
138
+ }
139
+ function subagentAttemptStatusClass(status) {
140
+ if (status === 'completed')
141
+ return 'bg-[#96e59d]/12 text-[#96e59d]';
142
+ if (status === 'failed')
143
+ return 'bg-[#ff9a9a]/12 text-[#ffb0b0]';
144
+ if (status === 'cancelled' || status === 'expired')
145
+ return 'bg-white/[0.06] text-white/42';
146
+ if (status === 'launch-requested')
147
+ return 'bg-[#9fb7ff]/12 text-[#c5d0ff]';
148
+ return 'bg-[#8ad7ff]/12 text-[#8ad7ff]';
149
+ }
150
+ function formatSubagentAttemptTime(timestamp) {
151
+ if (typeof timestamp !== 'number' || !Number.isFinite(timestamp))
152
+ return '';
153
+ return new Date(timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' });
154
+ }
155
+ function asSupportRecord(value) {
156
+ return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
157
+ }
158
+ function formatSupportJson(value) {
159
+ try {
160
+ return JSON.stringify(redactSupportDisplayValue(value), null, 2).slice(0, 12_000);
161
+ }
162
+ catch {
163
+ return String(value);
164
+ }
165
+ }
166
+ function supportResultSummary(result) {
167
+ if (!result)
168
+ return [];
169
+ const record = asSupportRecord(result.raw);
170
+ const summary = asSupportRecord(record.summary);
171
+ const diagnostics = asSupportRecord(record.diagnostics);
172
+ const rows = [];
173
+ if (result.path)
174
+ rows.push({ label: 'Path', value: redactSupportDisplayString(result.path) });
175
+ if (typeof record.durationMs === 'number')
176
+ rows.push({ label: 'Duration', value: formatEngineeringDuration(record.durationMs) });
177
+ if (typeof summary.fileCount === 'number')
178
+ rows.push({ label: 'Files indexed in bundle', value: String(summary.fileCount) });
179
+ if (typeof summary.includedPluginMcp === 'boolean')
180
+ rows.push({ label: 'Plugin/MCP snapshot', value: summary.includedPluginMcp ? 'included' : 'not included' });
181
+ if (typeof summary.searchHealth === 'string')
182
+ rows.push({ label: 'Search health', value: summary.searchHealth });
183
+ if (typeof summary.subagentActiveRuns === 'number')
184
+ rows.push({ label: 'Active subagents', value: String(summary.subagentActiveRuns) });
185
+ if (typeof summary.cliEndpointCount === 'number')
186
+ rows.push({ label: 'CLI endpoints', value: String(summary.cliEndpointCount) });
187
+ if (typeof summary.cliReadyEndpointCount === 'number')
188
+ rows.push({ label: 'CLI ready endpoints', value: String(summary.cliReadyEndpointCount) });
189
+ if (typeof summary.cliWorkflowAvailableCount === 'number')
190
+ rows.push({ label: 'CLI workflows', value: String(summary.cliWorkflowAvailableCount) });
191
+ if (typeof summary.cliDashboardReadyCount === 'number')
192
+ rows.push({ label: 'CLI dashboards', value: String(summary.cliDashboardReadyCount) });
193
+ if (typeof summary.policyDeniedCount === 'number')
194
+ rows.push({ label: 'Policy denials', value: String(summary.policyDeniedCount) });
195
+ if (typeof summary.pluginMcpReviewRequired === 'number')
196
+ rows.push({ label: 'Plugin/MCP review', value: String(summary.pluginMcpReviewRequired) });
197
+ if (typeof summary.lspDegradedCount === 'number')
198
+ rows.push({ label: 'LSP degraded', value: String(summary.lspDegradedCount) });
199
+ if (typeof summary.utilityIpcGuardedHandlers === 'number')
200
+ rows.push({ label: 'Guarded IPC handlers', value: String(summary.utilityIpcGuardedHandlers) });
201
+ if (typeof summary.repairRecommendationCount === 'number')
202
+ rows.push({ label: 'Recommendations', value: String(summary.repairRecommendationCount) });
203
+ if (!rows.some((row) => row.label === 'Search health')) {
204
+ const searchLifecycle = asSupportRecord(diagnostics.searchLifecycle);
205
+ if (typeof searchLifecycle.health === 'string')
206
+ rows.push({ label: 'Search health', value: searchLifecycle.health });
207
+ }
208
+ if (Array.isArray(record.repaired))
209
+ rows.push({ label: 'Repair checks', value: String(record.repaired.length) });
210
+ if (Array.isArray(record.checks))
211
+ rows.push({ label: 'Migration checks', value: String(record.checks.length) });
212
+ return rows;
213
+ }
214
+ function supportResultRecommendations(result) {
215
+ if (!result)
216
+ return [];
217
+ const record = asSupportRecord(result.raw);
218
+ const recommendations = Array.isArray(record.repairRecommendations) ? record.repairRecommendations : [];
219
+ return recommendations.slice(0, 8).map((item, index) => {
220
+ const recommendation = asSupportRecord(item);
221
+ return {
222
+ id: String(recommendation.id || `recommendation-${index}`),
223
+ severity: String(recommendation.severity || 'info'),
224
+ title: String(recommendation.title || 'Support recommendation'),
225
+ detail: String(recommendation.detail || ''),
226
+ action: String(recommendation.action || ''),
227
+ };
228
+ });
229
+ }
230
+ function redactSupportDisplayValue(value) {
231
+ if (Array.isArray(value))
232
+ return value.map(redactSupportDisplayValue);
233
+ if (!value || typeof value !== 'object') {
234
+ return typeof value === 'string' ? redactSupportDisplayString(value) : value;
235
+ }
236
+ const out = {};
237
+ for (const [key, entry] of Object.entries(value)) {
238
+ out[key] = /token|secret|password|cookie|authorization|api[-_]?key|credential/i.test(key)
239
+ ? '[redacted]'
240
+ : redactSupportDisplayValue(entry);
241
+ }
242
+ return out;
243
+ }
244
+ function redactSupportDisplayString(value) {
245
+ return value
246
+ .replace(/Bearer\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer [redacted]')
247
+ .replace(/sk-[A-Za-z0-9_-]{20,}/g, '[redacted]')
248
+ .replace(/xai-[A-Za-z0-9_-]{20,}/g, '[redacted]')
249
+ .replace(/gh[pousr]_[A-Za-z0-9_]{20,}/g, '[redacted]')
250
+ .replace(/[A-Za-z]:[\\/][^\s"'`<>|]+/g, '[path]')
251
+ .replace(/(^|[\s"'=:(])\/(?:Users|home|tmp|var|private|mnt|Volumes|opt|workspace|code)\/[^\s"'`<>),]+/g, '$1[path]');
252
+ }
253
+ export function AgentWorkbenchPanel(props) {
254
+ const { tab, traceMessages, selectedTraceMessage, outputEntries, problemEntries, onSelectTab, onClose, onSelectTraceMessage, onOpenChatSettings, onOpenChatAcpAgents, onOpenChatPlugins, onOpenChatKnowledge, onOpenEditorPath, onOpenEditorDiff, terminalCapabilityEnabled, terminalReady, resolvedTerminalCwd, terminalDraftCwd, terminalDraftInput, onChangeTerminalCwd, onChangeTerminalInput, onResetTerminalCwd, onClearTerminalHistory, onRunTerminalCommand, terminalHistory, liveTerminalRuns, onReuseTerminalEntry, onStopTerminalRun, codeWorkbench, onCodeQueryChange, onCodeModeChange, onCodeIndex, onCodeSearch, onCodeOpenPath, onCodeToggleFile, onCodeToggleSymbol, onCodeCreateContextPack, onCodeMaterializeContextPack, onCodeAttachContextPack, onCodeRefreshContextPacks, onCodeRefreshChanges, onCodeRefreshActions, onCodeApplyAction, onCodeOrganizeImports, onCodeRenameSymbol, onCodeRefreshLanguageServices, onCodeControlLanguageService, onCodeRepairIndex, engineeringWorkbench, reviewRunId, onEngineeringRefresh, onEngineeringTogglePath, onEngineeringOpenPath, onEngineeringPreviewDiff, onEngineeringStage, onEngineeringUnstage, onEngineeringRunCheck, onEngineeringStartBackgroundCheck, onEngineeringStopBackgroundRun, onEngineeringReadBackgroundRunOutput, onEngineeringCommitMessageChange, onEngineeringCommit, onEngineeringQueuePatchReview, onEngineeringUpdatePatchReview, onEngineeringReviewPatchSelection, onEngineeringCompareCheckpoints, onEngineeringRestoreCheckpoint, cliControlPlane, cliControlPlaneCaller, cliControlPlaneConversationId, cliControlPlaneRemoteBackendId, onCliControlPlaneInspect, onCliControlPlaneInspectOperation, onCliControlPlaneRemoteRunOperation, subagentWorkbench, subagentDelegationTargets, subagentDelegationSourceName, subagentDelegationDisabledReason, onSubagentRefresh, onSubagentRecoverRuns, onSubagentSelectRun, onSubagentOpenConversation, onSubagentCancelRun, onCreateSubagentDelegation, policyWorkbench, onPolicyRefresh, } = props;
255
+ const [expandedLiveTerminalId, setExpandedLiveTerminalId] = React.useState(null);
256
+ const [expandedTerminalHistoryId, setExpandedTerminalHistoryId] = React.useState(null);
257
+ const [supportBusyAction, setSupportBusyAction] = React.useState(null);
258
+ const [supportResult, setSupportResult] = React.useState(null);
259
+ const [delegationTargetId, setDelegationTargetId] = React.useState('');
260
+ const [delegationObjective, setDelegationObjective] = React.useState('');
261
+ const [delegationContextNote, setDelegationContextNote] = React.useState('');
262
+ const [delegationExpectedArtifact, setDelegationExpectedArtifact] = React.useState('answer');
263
+ const [delegationMaxTokens, setDelegationMaxTokens] = React.useState('');
264
+ const [delegationMaxRuntimeSeconds, setDelegationMaxRuntimeSeconds] = React.useState('');
265
+ const [delegationSubmitting, setDelegationSubmitting] = React.useState(false);
266
+ const [delegationResult, setDelegationResult] = React.useState(null);
267
+ const [remoteRunId, setRemoteRunId] = React.useState('');
268
+ const selectedCodeFilePaths = React.useMemo(() => new Set(codeWorkbench.selectedFilePaths), [codeWorkbench.selectedFilePaths]);
269
+ const selectedCodeSymbolIds = React.useMemo(() => new Set(codeWorkbench.selectedSymbolIds), [codeWorkbench.selectedSymbolIds]);
270
+ const selectedCodeCount = selectedCodeFilePaths.size + selectedCodeSymbolIds.size;
271
+ const selectedCodeActionTarget = React.useMemo(() => {
272
+ if (codeWorkbench.selectedFilePaths[0])
273
+ return codeWorkbench.selectedFilePaths[0];
274
+ const selectedSymbol = codeWorkbench.symbols.find((symbol) => selectedCodeSymbolIds.has(symbol.id));
275
+ return selectedSymbol?.filePath || '';
276
+ }, [codeWorkbench.selectedFilePaths, codeWorkbench.symbols, selectedCodeSymbolIds]);
277
+ const selectedEngineeringPaths = React.useMemo(() => new Set(engineeringWorkbench.selectedPaths), [engineeringWorkbench.selectedPaths]);
278
+ const selectedSubagentRun = React.useMemo(() => (subagentWorkbench.runs.find((run) => run.id === subagentWorkbench.selectedRunId)
279
+ || subagentWorkbench.runs[0]
280
+ || null), [subagentWorkbench.runs, subagentWorkbench.selectedRunId]);
281
+ const supportApi = typeof window !== 'undefined' ? getAgentPlatformBridge()?.support : undefined;
282
+ const supportSummaryRows = React.useMemo(() => supportResultSummary(supportResult), [supportResult]);
283
+ const supportRecommendations = React.useMemo(() => supportResultRecommendations(supportResult), [supportResult]);
284
+ const activeSubagentRunCount = React.useMemo(() => subagentWorkbench.runs.filter((run) => isActiveSubagentRun(run.status)).length, [subagentWorkbench.runs]);
285
+ const enabledSubagentDelegationTargets = React.useMemo(() => subagentDelegationTargets.filter((target) => !target.disabledReason), [subagentDelegationTargets]);
286
+ React.useEffect(() => {
287
+ if (delegationTargetId && subagentDelegationTargets.some((target) => target.id === delegationTargetId && !target.disabledReason))
288
+ return;
289
+ setDelegationTargetId(enabledSubagentDelegationTargets[0]?.id || '');
290
+ }, [delegationTargetId, enabledSubagentDelegationTargets, subagentDelegationTargets]);
291
+ const selectedDelegationTarget = React.useMemo(() => subagentDelegationTargets.find((target) => target.id === delegationTargetId) || null, [delegationTargetId, subagentDelegationTargets]);
292
+ const submitSubagentDelegation = React.useCallback(async (event) => {
293
+ event.preventDefault();
294
+ const objective = delegationObjective.trim();
295
+ if (!delegationTargetId || !objective || subagentDelegationDisabledReason || selectedDelegationTarget?.disabledReason)
296
+ return;
297
+ const maxTokens = delegationMaxTokens.trim() ? Number(delegationMaxTokens) : undefined;
298
+ const maxRuntimeMs = delegationMaxRuntimeSeconds.trim() ? Number(delegationMaxRuntimeSeconds) * 1000 : undefined;
299
+ setDelegationSubmitting(true);
300
+ setDelegationResult(null);
301
+ try {
302
+ const result = await onCreateSubagentDelegation({
303
+ targetAgentId: delegationTargetId,
304
+ objective,
305
+ contextNote: delegationContextNote.trim() || undefined,
306
+ expectedArtifacts: [delegationExpectedArtifact],
307
+ maxTokens: typeof maxTokens === 'number' && Number.isFinite(maxTokens) && maxTokens > 0 ? Math.floor(maxTokens) : undefined,
308
+ maxRuntimeMs: typeof maxRuntimeMs === 'number' && Number.isFinite(maxRuntimeMs) && maxRuntimeMs > 0 ? Math.floor(maxRuntimeMs) : undefined,
309
+ });
310
+ if (!result.success) {
311
+ setDelegationResult({ ok: false, message: result.error || 'Delegation failed.' });
312
+ }
313
+ else {
314
+ setDelegationResult({ ok: true, message: `Queued ${result.subagentRunId || 'subagent run'} for ${selectedDelegationTarget?.name || 'target agent'}.` });
315
+ setDelegationObjective('');
316
+ setDelegationContextNote('');
317
+ }
318
+ }
319
+ catch (error) {
320
+ setDelegationResult({ ok: false, message: error instanceof Error ? error.message : 'Delegation failed.' });
321
+ }
322
+ finally {
323
+ setDelegationSubmitting(false);
324
+ }
325
+ }, [
326
+ delegationContextNote,
327
+ delegationExpectedArtifact,
328
+ delegationMaxRuntimeSeconds,
329
+ delegationMaxTokens,
330
+ delegationObjective,
331
+ delegationTargetId,
332
+ onCreateSubagentDelegation,
333
+ selectedDelegationTarget?.disabledReason,
334
+ selectedDelegationTarget?.name,
335
+ subagentDelegationDisabledReason,
336
+ ]);
337
+ const subagentSchedulerStatus = subagentWorkbench.schedulerStatus;
338
+ const subagentAdapterCount = subagentSchedulerStatus?.adapterIds.length || 0;
339
+ const subagentAdapterHealth = subagentWorkbench.schedulerStatusError
340
+ ? 'unavailable'
341
+ : subagentAdapterCount > 0
342
+ ? 'available'
343
+ : 'degraded';
344
+ const selectedSubagentLatestAttempt = selectedSubagentRun && selectedSubagentRun.executionAttempts.length > 0
345
+ ? selectedSubagentRun.executionAttempts[selectedSubagentRun.executionAttempts.length - 1]
346
+ : undefined;
347
+ const tabLabels = {
348
+ trace: 'trace',
349
+ output: 'output',
350
+ problems: 'problems',
351
+ settings: 'settings',
352
+ knowledge: 'knowledge',
353
+ plugins: 'plugins',
354
+ code: 'code',
355
+ engineering: 'eng',
356
+ diffs: 'diffs',
357
+ review: 'review',
358
+ fleet: 'fleet',
359
+ terminals: 'terminals',
360
+ intake: 'intake',
361
+ learned: 'learned',
362
+ checkpoints: 'ckpts',
363
+ sessions: 'sessions',
364
+ runtime: 'runtime',
365
+ cli: 'cli',
366
+ subagents: 'runs',
367
+ policy: 'policy',
368
+ support: 'support',
369
+ terminal: 'terminal',
370
+ };
371
+ const runSupportAction = React.useCallback(async (label, action) => {
372
+ setSupportBusyAction(label);
373
+ try {
374
+ const raw = await action();
375
+ const record = asSupportRecord(raw);
376
+ const success = record.success !== false;
377
+ setSupportResult({
378
+ label,
379
+ timestamp: Date.now(),
380
+ success,
381
+ path: typeof record.path === 'string' ? record.path : undefined,
382
+ error: typeof record.error === 'string' ? record.error : undefined,
383
+ raw,
384
+ });
385
+ }
386
+ catch (err) {
387
+ setSupportResult({
388
+ label,
389
+ timestamp: Date.now(),
390
+ success: false,
391
+ error: err instanceof Error ? err.message : String(err),
392
+ raw: { success: false, error: err instanceof Error ? err.message : String(err) },
393
+ });
394
+ }
395
+ finally {
396
+ setSupportBusyAction(null);
397
+ }
398
+ }, []);
399
+ const formatTerminalDuration = (durationMs) => (durationMs >= 1000 ? `${(durationMs / 1000).toFixed(1)}s` : `${durationMs}ms`);
400
+ return (_jsxs("div", { className: `xeno-panel-shell xeno-border-subtle flex-shrink-0 rounded-[6px] border overflow-hidden ${isWideWorkbenchTab(tab) ? 'h-[390px]' : 'h-[240px]'}`, children: [_jsxs("div", { className: "xeno-border-subtle h-9 border-b px-3 flex items-center justify-between gap-3", children: [_jsx("div", { className: "flex items-center gap-1.5 overflow-x-auto", children: WORKBENCH_PANEL_TABS.map((nextTab) => (_jsx("button", { onClick: () => onSelectTab(nextTab), className: `h-6 px-2.5 rounded-[4px] text-[10px] uppercase tracking-[0.12em] transition-colors ${tab === nextTab
401
+ ? 'bg-[var(--xeno-accent-soft)] text-[color:var(--xeno-ink-primary)]'
402
+ : 'xeno-text-faint hover:text-[color:var(--xeno-ink-secondary)] hover:bg-[var(--xeno-bg-subtle)]'}`, children: tabLabels[nextTab] }, nextTab))) }), _jsx("button", { onClick: onClose, className: "text-[10px] xeno-text-faint hover:text-[color:var(--xeno-ink-secondary)] transition-colors", children: "Close" })] }), _jsxs("div", { className: "h-[calc(100%-36px)] min-h-0", children: [tab === 'settings' && (_jsx("div", { className: "h-full overflow-y-auto px-3 py-3", children: _jsxs("div", { className: "grid grid-cols-3 gap-2", children: [_jsxs("button", { type: "button", onClick: onOpenChatSettings, disabled: !onOpenChatSettings, className: "rounded border border-white/[0.06] bg-white/[0.045] px-3 py-3 text-left transition-colors hover:bg-white/[0.075] disabled:opacity-35", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "Runtime settings" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Model, ACP, directories" })] }), _jsxs("button", { type: "button", onClick: onOpenChatAcpAgents, disabled: !onOpenChatAcpAgents, className: "rounded border border-white/[0.06] bg-white/[0.045] px-3 py-3 text-left transition-colors hover:bg-white/[0.075] disabled:opacity-35", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "ACP Agents" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Local provider readiness" })] }), _jsxs("button", { type: "button", onClick: () => onSelectTab('subagents'), className: "rounded border border-white/[0.06] bg-white/[0.045] px-3 py-3 text-left transition-colors hover:bg-white/[0.075]", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "Team routing" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Agents and handoffs" })] })] }) })), tab === 'knowledge' && (_jsx("div", { className: "h-full overflow-y-auto px-3 py-3", children: _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("button", { type: "button", onClick: () => {
403
+ if (onOpenChatKnowledge)
404
+ onOpenChatKnowledge();
405
+ else
406
+ onSelectTab('code');
407
+ }, className: "rounded border border-white/[0.06] bg-white/[0.045] px-3 py-3 text-left transition-colors hover:bg-white/[0.075]", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "Code context" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Files, symbols, context packs" })] }), _jsxs("button", { type: "button", onClick: () => onSelectTab('policy'), className: "rounded border border-white/[0.06] bg-white/[0.045] px-3 py-3 text-left transition-colors hover:bg-white/[0.075]", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "Policy memory" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Rules and artifacts" })] })] }) })), tab === 'plugins' && (_jsx("div", { className: "h-full overflow-y-auto px-3 py-3", children: _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("button", { type: "button", onClick: onOpenChatPlugins, disabled: !onOpenChatPlugins, className: "rounded border border-white/[0.06] bg-white/[0.045] px-3 py-3 text-left transition-colors hover:bg-white/[0.075] disabled:opacity-35", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "Plugin manager" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "MCP and tools" })] }), _jsxs("button", { type: "button", onClick: () => onSelectTab('cli'), className: "rounded border border-white/[0.06] bg-white/[0.045] px-3 py-3 text-left transition-colors hover:bg-white/[0.075]", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "CLI control" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Manifest and workflows" })] })] }) })), tab === 'trace' && (_jsxs("div", { className: "h-full grid grid-cols-[240px_minmax(0,1fr)]", children: [_jsx("div", { className: "border-r border-white/[0.06] overflow-y-auto", children: traceMessages.length === 0 ? (_jsx("div", { className: "px-3 py-3 text-[11px] text-white/28", children: "No traced turns yet." })) : (traceMessages.map((message) => {
408
+ const toolCount = message.toolCalls?.length || 0;
409
+ const selected = selectedTraceMessage?.id === message.id;
410
+ return (_jsxs("button", { onClick: () => onSelectTraceMessage(message.id), className: `w-full text-left px-3 py-2 border-b border-white/[0.04] transition-colors ${selected ? 'bg-white/[0.06]' : 'hover:bg-white/[0.03]'}`, children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[11px] text-white/68 truncate", children: message.toolCalls?.[0]?.summary || message.content || 'Assistant turn' }), _jsx("span", { className: "text-[10px] text-white/18 tabular-nums", children: new Date(message.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) })] }), _jsxs("div", { className: "flex items-center gap-2 mt-1", children: [_jsxs("span", { className: "text-[10px] text-white/24 tabular-nums", children: [toolCount, " tools"] }), message.error && _jsx("span", { className: "text-[10px] text-[#ff9a9a]", children: "error" })] })] }, message.id));
411
+ })) }), _jsx("div", { className: "overflow-y-auto px-3 py-3", children: !selectedTraceMessage ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Select a turn to inspect its tools and outputs." })) : (_jsx("div", { className: "space-y-2", children: (selectedTraceMessage.toolCalls || []).map((toolCall) => (_jsxs("div", { className: "rounded-[5px] border border-white/[0.06] bg-black/20 px-3 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[11px] text-white/72 truncate", children: toolCall.summary || toolCall.toolName }), _jsxs("p", { className: "text-[10px] text-white/22 mt-1", children: [toolCall.toolName, typeof toolCall.durationMs === 'number' && toolCall.durationMs >= 1000 ? ` - ${Math.round(toolCall.durationMs)}ms` : ''] })] }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [toolCall.diff && onOpenEditorDiff && (_jsx("button", { onClick: () => onOpenEditorDiff(toolCall.diff), className: "text-[10px] text-white/45 hover:text-white/78 transition-colors", children: "Open Diff" })), toolCall.artifacts?.find((artifact) => artifact.type === 'file' && artifact.openInEditor)?.value && onOpenEditorPath && (_jsx("button", { onClick: () => onOpenEditorPath(toolCall.artifacts.find((artifact) => artifact.type === 'file' && artifact.openInEditor).value), className: "text-[10px] text-white/30 hover:text-white/65 transition-colors", children: "Open File" }))] })] }), toolCall.result?.trim() && (_jsx("pre", { className: "mt-2 whitespace-pre-wrap break-words text-[11px] leading-relaxed text-white/52 font-mono", children: toolCall.result.trim() }))] }, toolCall.id))) })) })] })), tab === 'output' && (_jsx("div", { className: "h-full overflow-y-auto px-3 py-3", children: outputEntries.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No output captured for the selected turn." })) : (_jsx("div", { className: "space-y-2", children: outputEntries.map((entry) => (_jsxs("div", { className: "rounded-[5px] border border-white/[0.06] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-3 py-2 border-b border-white/[0.06] text-[10px] uppercase tracking-[0.12em] text-white/26", children: entry.label }), _jsx("pre", { className: `px-3 py-2 whitespace-pre-wrap break-words text-[11px] leading-relaxed font-mono ${entry.tone === 'error' ? 'text-[#ffaaaa]' : 'text-white/55'}`, children: entry.content })] }, entry.id))) })) })), tab === 'problems' && (_jsx("div", { className: "h-full overflow-y-auto px-3 py-3", children: problemEntries.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No problems in this conversation." })) : (_jsx("div", { className: "space-y-2", children: problemEntries.map((problem) => (_jsxs("div", { className: "rounded-[5px] border border-[#4b1f24] bg-[#1a0f12] px-3 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-[11px] text-[#ffb0b0] truncate", children: problem.label }), _jsx("span", { className: "text-[10px] text-white/20 tabular-nums", children: new Date(problem.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) })] }), _jsx("p", { className: "mt-1 text-[11px] leading-relaxed text-[#f0b7b7]/80 whitespace-pre-wrap break-words", children: problem.detail })] }, problem.id))) })) })), tab === 'code' && (_jsxs("div", { className: "h-full flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.06]", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/26", children: "Code intelligence" }), _jsx("p", { className: "text-[11px] text-white/34 truncate", children: codeWorkbench.rootDirectory || 'Open a workspace folder to build the code index.' })] }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: onCodeIndex, disabled: !codeWorkbench.rootDirectory || codeWorkbench.loading, className: "h-7 px-2.5 rounded-[4px] bg-white/[0.07] hover:bg-white/[0.11] text-[10px] uppercase tracking-[0.12em] text-white/62 transition-colors disabled:opacity-35", children: codeWorkbench.stats ? 'Refresh' : 'Index' }), _jsx("button", { type: "button", onClick: onCodeRefreshChanges, disabled: !codeWorkbench.rootDirectory || codeWorkbench.loading, className: "h-7 px-2.5 rounded-[4px] border border-white/[0.06] text-[10px] uppercase tracking-[0.12em] text-white/45 hover:text-white/72 hover:bg-white/[0.045] transition-colors disabled:opacity-35", children: "Changes" })] })] }), _jsxs("div", { className: "mt-2 grid grid-cols-[minmax(0,1fr)_auto] gap-2", children: [_jsx("input", { value: codeWorkbench.query, onChange: (event) => onCodeQueryChange(event.target.value), onKeyDown: (event) => {
412
+ if (event.key === 'Enter') {
413
+ event.preventDefault();
414
+ onCodeSearch();
415
+ }
416
+ }, placeholder: codeWorkbench.mode === 'text' ? 'Search file contents...' : codeWorkbench.mode === 'symbols' ? 'Search symbols...' : 'Filter files...', disabled: !codeWorkbench.rootDirectory, className: "h-8 rounded-[4px] border border-white/[0.06] bg-black/20 px-2.5 text-[11px] text-white/78 placeholder:text-white/18 outline-none focus:border-white/[0.12] disabled:opacity-35" }), _jsxs("div", { className: "flex items-center gap-1", children: [['files', 'text', 'symbols'].map((mode) => (_jsx("button", { type: "button", onClick: () => onCodeModeChange(mode), disabled: !codeWorkbench.rootDirectory, className: `h-8 px-2.5 rounded-[4px] text-[10px] uppercase tracking-[0.12em] transition-colors disabled:opacity-35 ${codeWorkbench.mode === mode
417
+ ? 'bg-[var(--xeno-accent-soft)] text-[color:var(--xeno-ink-primary)]'
418
+ : 'bg-white/[0.035] text-white/34 hover:text-white/65 hover:bg-white/[0.06]'}`, children: mode }, mode))), _jsx("button", { type: "button", onClick: onCodeSearch, disabled: !codeWorkbench.rootDirectory || codeWorkbench.loading, className: "h-8 px-3 rounded-[4px] bg-white/[0.08] hover:bg-white/[0.12] text-[10px] uppercase tracking-[0.12em] text-white/72 transition-colors disabled:opacity-35", children: "Search" })] })] })] }), codeWorkbench.error && (_jsx("div", { className: "border-b border-[#4b1f24] bg-[#1a0f12] px-3 py-1.5 text-[11px] text-[#ffb0b0]", children: codeWorkbench.error })), _jsxs("div", { className: "flex-1 min-h-0 grid grid-cols-[minmax(0,1.45fr)_minmax(260px,0.9fr)]", children: [_jsxs("div", { className: "min-w-0 min-h-0 border-r border-white/[0.06] flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: codeWorkbench.stats
419
+ ? `${codeWorkbench.stats.fileCount || 0} files / ${codeWorkbench.stats.symbolCount || 0} symbols / ${codeWorkbench.stats.dependencyEdgeCount || 0} edges`
420
+ : 'No index loaded' }), _jsx("p", { className: "text-[10px] text-white/20", children: codeWorkbench.loading
421
+ ? 'Working...'
422
+ : selectedCodeCount > 0
423
+ ? `${selectedCodeCount} selected`
424
+ : (codeWorkbench.stats?.durationMs ? `${Math.round(codeWorkbench.stats.durationMs)}ms` : '') })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3", children: !codeWorkbench.rootDirectory ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Open a folder for this conversation before indexing code." })) : codeWorkbench.mode === 'files' ? (codeWorkbench.files.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No file results yet. Index the workspace or run a file search." })) : (_jsx("div", { className: "space-y-1.5", children: codeWorkbench.files.map((file) => {
425
+ const selected = selectedCodeFilePaths.has(file.absolutePath);
426
+ return (_jsx("div", { className: `rounded border px-2.5 py-2 transition-colors ${selected ? 'border-white/[0.14] bg-white/[0.055]' : 'border-white/[0.05] bg-black/20'}`, children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("input", { type: "checkbox", checked: selected, onChange: () => onCodeToggleFile(file.absolutePath), className: "mt-[2px] h-3.5 w-3.5 accent-white/70" }), _jsxs("button", { type: "button", onClick: () => onCodeOpenPath(file.absolutePath), className: "min-w-0 flex-1 text-left", children: [_jsx("span", { className: "block text-[12px] text-white/66 truncate", children: file.relativePath || file.absolutePath }), _jsx("span", { className: "mt-1 block text-[10px] text-white/24 truncate", children: [file.language, formatCodeBytes(file.size), file.isTextIndexed ? 'text indexed' : file.ignoredReason || 'metadata only'].filter(Boolean).join(' / ') })] }), _jsx("button", { type: "button", onClick: () => onCodeOpenPath(file.absolutePath), className: "text-[10px] text-white/30 hover:text-white/65 transition-colors", children: "Open" })] }) }, file.id || file.absolutePath));
427
+ }) }))) : codeWorkbench.mode === 'text' ? (!codeWorkbench.query.trim() ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Enter a text query to search indexed file contents." })) : codeWorkbench.textResults.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No text matches." })) : (_jsx("div", { className: "space-y-1.5", children: codeWorkbench.textResults.map((result, index) => {
428
+ const selected = selectedCodeFilePaths.has(result.file.absolutePath);
429
+ return (_jsx("div", { className: `rounded border px-2.5 py-2 transition-colors ${selected ? 'border-white/[0.14] bg-white/[0.055]' : 'border-white/[0.05] bg-black/20'}`, children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("input", { type: "checkbox", checked: selected, onChange: () => onCodeToggleFile(result.file.absolutePath), className: "mt-[2px] h-3.5 w-3.5 accent-white/70" }), _jsxs("button", { type: "button", onClick: () => onCodeOpenPath(result.file.absolutePath), className: "min-w-0 flex-1 text-left", children: [_jsxs("span", { className: "block text-[11px] text-white/54 truncate", children: [result.file.relativePath || result.file.absolutePath, ":", result.line] }), _jsx("span", { className: "mt-1 block font-mono text-[11px] leading-relaxed text-white/44 whitespace-pre-wrap break-words", children: result.snippet })] })] }) }, `${result.file.absolutePath}:${result.line}:${result.column}:${index}`));
430
+ }) }))) : (codeWorkbench.symbols.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No symbol results yet. Index the workspace or search symbols." })) : (_jsx("div", { className: "space-y-1.5", children: codeWorkbench.symbols.map((symbol) => {
431
+ const selected = selectedCodeSymbolIds.has(symbol.id);
432
+ return (_jsx("div", { className: `rounded border px-2.5 py-2 transition-colors ${selected ? 'border-white/[0.14] bg-white/[0.055]' : 'border-white/[0.05] bg-black/20'}`, children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("input", { type: "checkbox", checked: selected, onChange: () => onCodeToggleSymbol(symbol.id), className: "mt-[2px] h-3.5 w-3.5 accent-white/70" }), _jsxs("button", { type: "button", onClick: () => onCodeOpenPath(symbol.filePath), className: "min-w-0 flex-1 text-left", children: [_jsx("span", { className: "block text-[12px] text-white/66 truncate", children: symbol.name }), _jsxs("span", { className: "mt-1 block text-[10px] text-white/24 truncate", children: [symbol.kind, " / ", symbol.relativePath, ":", symbol.line] }), symbol.signature && (_jsx("span", { className: "mt-1 block font-mono text-[10px] text-white/34 truncate", children: symbol.signature }))] })] }) }, symbol.id));
433
+ }) }))) })] }), _jsxs("aside", { className: "min-w-0 min-h-0 flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Context packs" }), _jsx("p", { className: "text-[10px] text-white/20 truncate", children: codeWorkbench.attachedPackIds.length > 0 ? `${codeWorkbench.attachedPackIds.length} attached to agent prompt` : 'Build selected context for the agent.' })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("button", { type: "button", onClick: onCodeCreateContextPack, disabled: !codeWorkbench.rootDirectory || selectedCodeCount === 0 || codeWorkbench.loading, className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] hover:text-white/78 transition-colors disabled:opacity-35", children: "Create" }), _jsx("button", { type: "button", onClick: onCodeRefreshContextPacks, disabled: !codeWorkbench.rootDirectory || codeWorkbench.loading, className: "h-7 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Reload" })] })] }), _jsxs("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3 space-y-3", children: [_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("span", { className: "block text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Project code actions" }), _jsx("span", { className: "block text-[10px] text-white/20 truncate", children: selectedCodeActionTarget ? selectedCodeActionTarget.replace(/\\/g, '/').split('/').slice(-3).join('/') : 'Select a TS/JS file or symbol' })] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: onCodeRefreshActions, disabled: !selectedCodeActionTarget || codeWorkbench.loading, className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Analyze" }), _jsx("button", { type: "button", onClick: onCodeOrganizeImports, disabled: !selectedCodeActionTarget || codeWorkbench.loading, className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Organize" }), _jsx("button", { type: "button", onClick: onCodeRenameSymbol, disabled: !selectedCodeActionTarget || codeWorkbench.loading, className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Rename" })] })] }), codeWorkbench.codeDiagnostics.length === 0 && codeWorkbench.codeActions.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No project-level diagnostics/actions loaded for the selected target." })) : (_jsxs("div", { className: "divide-y divide-white/[0.04]", children: [codeWorkbench.codeDiagnostics.slice(0, 5).map((diagnostic) => (_jsxs("button", { type: "button", onClick: () => onCodeOpenPath(diagnostic.filePath), className: "w-full min-w-0 px-2.5 py-2 text-left hover:bg-white/[0.025] transition-colors", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("span", { className: `text-[10px] uppercase tracking-[0.1em] ${diagnostic.severity === 'error' ? 'text-[#ff9a9a]' : diagnostic.severity === 'warning' ? 'text-[#ffd38a]' : 'text-[#8ad7ff]'}`, children: [diagnostic.severity, diagnostic.code ? ` ${diagnostic.code}` : ''] }), _jsxs("span", { className: "text-[10px] text-white/20 tabular-nums", children: [diagnostic.line, ":", diagnostic.column] })] }), _jsx("p", { className: "mt-1 text-[10px] text-white/38 truncate", children: diagnostic.relativePath }), _jsx("p", { className: "mt-1 text-[11px] leading-relaxed text-white/52", children: diagnostic.message })] }, diagnostic.id))), codeWorkbench.codeActions.slice(0, 5).map((action) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "min-w-0 text-[11px] text-white/62 truncate", children: action.title }), _jsxs("div", { className: "flex items-center gap-1.5 flex-shrink-0", children: [_jsx("span", { className: "text-[10px] text-white/20", children: action.kind }), action.supportsApply !== false && (_jsx("button", { type: "button", onClick: () => onCodeApplyAction(action), className: "h-6 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] hover:text-white/78 transition-colors", children: "Apply" }))] })] }), action.editPreview && (_jsx("pre", { className: "mt-1 max-h-[54px] overflow-y-auto whitespace-pre-wrap break-words text-[10px] leading-relaxed font-mono text-white/32", children: action.editPreview }))] }, action.id)))] }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Language services" }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: onCodeRepairIndex, disabled: !codeWorkbench.rootDirectory || codeWorkbench.loading, className: "text-[10px] text-white/30 hover:text-white/64 transition-colors disabled:opacity-35", children: "Repair" }), _jsx("button", { type: "button", onClick: onCodeRefreshLanguageServices, disabled: !codeWorkbench.rootDirectory || codeWorkbench.loading, className: "text-[10px] text-white/30 hover:text-white/64 transition-colors disabled:opacity-35", children: "Probe" })] })] }), codeWorkbench.languageServices.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "Probe language services to see embedded TypeScript and external LSP availability." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: codeWorkbench.languageServices.slice(0, 6).map((service) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "min-w-0 text-[11px] text-white/62 truncate", children: service.label }), _jsx("span", { className: `text-[10px] uppercase tracking-[0.1em] ${service.status === 'ready' || service.status === 'available' || service.status === 'running' ? 'text-[#96e59d]' : service.status === 'error' ? 'text-red-300/70' : 'text-white/24'}`, children: service.status })] }), _jsx("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [service.mode, service.command, service.version, service.pid ? `pid ${service.pid}` : '', service.languages.join(', ')].filter(Boolean).join(' / ') }), service.mode === 'external-lsp' && service.status !== 'missing' && (_jsx("div", { className: "mt-1.5 flex items-center gap-1", children: service.status === 'running' || service.status === 'starting' ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: () => onCodeControlLanguageService(service.id, 'restart'), className: "h-5 px-1.5 rounded-[3px] bg-white/[0.05] text-[9px] text-white/42 hover:text-white/70 transition-colors", children: "Restart" }), _jsx("button", { type: "button", onClick: () => onCodeControlLanguageService(service.id, 'stop'), className: "h-5 px-1.5 rounded-[3px] bg-white/[0.05] text-[9px] text-white/42 hover:text-white/70 transition-colors", children: "Stop" })] })) : (_jsx("button", { type: "button", onClick: () => onCodeControlLanguageService(service.id, 'start'), className: "h-5 px-1.5 rounded-[3px] bg-white/[0.05] text-[9px] text-white/42 hover:text-white/70 transition-colors", children: "Start" })) })), (service.detail || service.lastError) && (_jsx("p", { className: `mt-1 text-[10px] truncate ${service.lastError ? 'text-red-300/45' : 'text-white/24'}`, children: service.lastError || service.detail }))] }, service.id))) })), codeWorkbench.repairSummary && (_jsx("p", { className: "border-t border-white/[0.04] px-2.5 py-2 text-[10px] text-white/35", children: codeWorkbench.repairSummary }))] }), _jsx("div", { className: "space-y-1.5", children: codeWorkbench.contextPacks.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No context packs yet. Select files or symbols, then create one." })) : (codeWorkbench.contextPacks.map((pack) => {
434
+ const attached = codeWorkbench.attachedPackIds.includes(pack.id);
435
+ return (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-2.5 py-2", children: [_jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[11px] text-white/64 truncate", children: pack.name }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [(pack.items?.length || 0), " items / ~", pack.tokenEstimate || 0, " tokens"] })] }), attached && _jsx("span", { className: "text-[10px] text-[#96e59d]", children: "attached" })] }), pack.description && (_jsx("p", { className: "mt-1 text-[10px] leading-relaxed text-white/32", children: pack.description })), _jsxs("div", { className: "mt-2 flex items-center gap-2", children: [_jsx("button", { type: "button", onClick: () => onCodeMaterializeContextPack(pack.id), className: "text-[10px] text-white/35 hover:text-white/68 transition-colors", children: "Preview" }), _jsx("button", { type: "button", onClick: () => onCodeAttachContextPack(pack.id), className: "text-[10px] text-white/35 hover:text-white/68 transition-colors", children: "Attach" })] })] }, pack.id));
436
+ })) }), codeWorkbench.materializedContext && (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Context preview" }), _jsx("pre", { className: "max-h-[110px] overflow-y-auto whitespace-pre-wrap break-words px-2.5 py-2 text-[10px] leading-relaxed font-mono text-white/42", children: codeWorkbench.materializedContext })] })), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "What changed" }), _jsx("button", { type: "button", onClick: onCodeRefreshChanges, disabled: !codeWorkbench.rootDirectory || codeWorkbench.loading, className: "text-[10px] text-white/30 hover:text-white/64 transition-colors disabled:opacity-35", children: "Refresh" })] }), !codeWorkbench.changes ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No change summary loaded." })) : (_jsxs("div", { className: "px-2.5 py-2", children: [_jsx("p", { className: "text-[11px] leading-relaxed text-white/44", children: codeWorkbench.changes.summary }), codeWorkbench.changes.changedFiles.length > 0 && (_jsx("div", { className: "mt-2 space-y-1", children: codeWorkbench.changes.changedFiles.slice(0, 8).map((file) => (_jsxs("button", { type: "button", onClick: () => file.path && onCodeOpenPath(file.path), className: "w-full min-w-0 text-left text-[10px] text-white/32 hover:text-white/62 transition-colors truncate", children: [file.status, " / ", file.relativePath] }, `${file.status}:${file.relativePath}`))) }))] }))] })] })] })] })] })), tab === 'engineering' && (_jsxs("div", { className: "h-full flex flex-col", children: [_jsx("div", { className: "px-3 py-2 border-b border-white/[0.06]", children: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/26", children: "Engineering workbench" }), _jsx("p", { className: "text-[11px] text-white/34 truncate", children: engineeringWorkbench.rootDirectory || 'Open a workspace folder to inspect git, checks, and diagnostics.' })] }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: onEngineeringRefresh, disabled: !engineeringWorkbench.rootDirectory || engineeringWorkbench.loading, className: "h-7 px-2.5 rounded-[4px] bg-white/[0.07] hover:bg-white/[0.11] text-[10px] uppercase tracking-[0.12em] text-white/62 transition-colors disabled:opacity-35", children: "Refresh" }), _jsx("button", { type: "button", onClick: () => onEngineeringPreviewDiff(engineeringWorkbench.selectedPaths), disabled: !engineeringWorkbench.rootDirectory || engineeringWorkbench.loading || engineeringWorkbench.selectedPaths.length === 0, className: "h-7 px-2.5 rounded-[4px] border border-white/[0.06] text-[10px] uppercase tracking-[0.12em] text-white/45 hover:text-white/72 hover:bg-white/[0.045] transition-colors disabled:opacity-35", children: "Diff" })] })] }) }), engineeringWorkbench.error && (_jsx("div", { className: "border-b border-[#4b1f24] bg-[#1a0f12] px-3 py-1.5 text-[11px] text-[#ffb0b0]", children: engineeringWorkbench.error })), _jsxs("div", { className: "flex-1 min-h-0 grid grid-cols-[minmax(0,1fr)_minmax(330px,0.95fr)]", children: [_jsxs("div", { className: "min-w-0 min-h-0 border-r border-white/[0.06] flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Git status" }), _jsx("p", { className: "text-[10px] text-white/20 truncate", children: !engineeringWorkbench.git
437
+ ? 'No status loaded'
438
+ : !engineeringWorkbench.git.isGitRepo
439
+ ? 'Not a git repository'
440
+ : `${engineeringWorkbench.git.branch || 'detached'} / ${engineeringWorkbench.git.clean ? 'clean' : `${engineeringWorkbench.git.files.length} changed`}` })] }), _jsxs("div", { className: "flex items-center gap-1.5 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: () => onEngineeringStage(engineeringWorkbench.selectedPaths), disabled: engineeringWorkbench.loading || engineeringWorkbench.selectedPaths.length === 0, className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] hover:text-white/78 transition-colors disabled:opacity-35", children: "Stage" }), _jsx("button", { type: "button", onClick: () => onEngineeringUnstage(engineeringWorkbench.selectedPaths), disabled: engineeringWorkbench.loading || engineeringWorkbench.selectedPaths.length === 0, className: "h-7 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Unstage" })] })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3", children: !engineeringWorkbench.rootDirectory ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Open a folder for this conversation before using engineering tools." })) : !engineeringWorkbench.git ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Refresh to load git status, test scripts, and diagnostics." })) : !engineeringWorkbench.git.isGitRepo ? (_jsx("p", { className: "text-[11px] text-white/28", children: "This workspace is not currently inside a git repository." })) : engineeringWorkbench.git.files.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Git working tree is clean." })) : (_jsx("div", { className: "space-y-1.5", children: engineeringWorkbench.git.files.map((file) => {
441
+ const selected = selectedEngineeringPaths.has(file.path);
442
+ return (_jsx("div", { className: `rounded border px-2.5 py-2 transition-colors ${selected ? 'border-white/[0.14] bg-white/[0.055]' : 'border-white/[0.05] bg-black/20'}`, children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("input", { type: "checkbox", checked: selected, onChange: () => onEngineeringTogglePath(file.path), className: "mt-[2px] h-3.5 w-3.5 accent-white/70" }), _jsxs("button", { type: "button", onClick: () => onEngineeringOpenPath(file.path), className: "min-w-0 flex-1 text-left", children: [_jsx("span", { className: "block text-[12px] text-white/66 truncate", children: file.relativePath || file.path }), _jsx("span", { className: "mt-1 block text-[10px] text-white/24 truncate", children: [
443
+ file.status,
444
+ file.indexStatus !== ' ' ? `index ${file.indexStatus}` : null,
445
+ file.workTreeStatus !== ' ' ? `worktree ${file.workTreeStatus}` : null,
446
+ typeof file.additions === 'number' ? `+${file.additions}` : null,
447
+ typeof file.deletions === 'number' ? `-${file.deletions}` : null,
448
+ ].filter(Boolean).join(' / ') })] }), _jsx("button", { type: "button", onClick: () => onEngineeringPreviewDiff([file.path]), className: "text-[10px] text-white/30 hover:text-white/65 transition-colors", children: "Diff" })] }) }, `${file.status}:${file.path}`));
449
+ }) })) }), _jsx("div", { className: "border-t border-white/[0.06] px-3 py-2 bg-[#08080a]", children: _jsxs("div", { className: "grid grid-cols-[minmax(0,1fr)_auto_auto] gap-2", children: [_jsx("input", { value: engineeringWorkbench.commitMessage, onChange: (event) => onEngineeringCommitMessageChange(event.target.value), placeholder: "Commit message", disabled: !engineeringWorkbench.git?.isGitRepo, className: "h-8 rounded-[4px] border border-white/[0.06] bg-black/20 px-2.5 text-[11px] text-white/78 placeholder:text-white/18 outline-none focus:border-white/[0.12] disabled:opacity-35" }), _jsx("button", { type: "button", onClick: () => onEngineeringStage(undefined), disabled: !engineeringWorkbench.git?.isGitRepo || engineeringWorkbench.git.clean || engineeringWorkbench.loading, className: "h-8 px-3 rounded-[4px] border border-white/[0.06] text-[10px] uppercase tracking-[0.12em] text-white/45 hover:text-white/72 hover:bg-white/[0.045] transition-colors disabled:opacity-35", children: "Stage all" }), _jsx("button", { type: "button", onClick: onEngineeringCommit, disabled: !engineeringWorkbench.git?.isGitRepo || !engineeringWorkbench.commitMessage.trim() || engineeringWorkbench.loading, className: "h-8 px-3 rounded-[4px] bg-white/[0.08] hover:bg-white/[0.12] text-[10px] uppercase tracking-[0.12em] text-white/72 transition-colors disabled:opacity-35", children: "Commit" })] }) })] }), _jsxs("aside", { className: "min-w-0 min-h-0 flex flex-col", children: [_jsx("div", { className: "px-3 py-2 border-b border-white/[0.05]", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Checks and diagnostics" }), _jsx("p", { className: "text-[10px] text-white/20 truncate", children: engineeringWorkbench.diagnosticsSummary || `${engineeringWorkbench.checks.length} runnable checks detected` })] }), _jsx("button", { type: "button", onClick: () => onEngineeringPreviewDiff(undefined), disabled: !engineeringWorkbench.git?.isGitRepo || engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Full diff" })] }) }), _jsxs("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3 space-y-3", children: [_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Runnable checks" }), engineeringWorkbench.checks.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No npm test, typecheck, build, or lint scripts discovered yet." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.checks.map((check) => (_jsxs("div", { className: "px-2.5 py-2 flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[11px] text-white/62 truncate", children: check.name }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [check.kind, " / ", check.command, " ", check.args.join(' ')] })] }), _jsxs("div", { className: "flex items-center gap-1.5 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: () => onEngineeringRunCheck(check.id), disabled: engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] hover:text-white/78 transition-colors disabled:opacity-35", children: "Run" }), _jsx("button", { type: "button", onClick: () => onEngineeringStartBackgroundCheck(check.id), disabled: engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "BG" })] })] }, check.id))) }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Background checks" }), _jsxs("span", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.backgroundRuns.filter((run) => run.status === 'running').length, " active"] })] }), engineeringWorkbench.backgroundRuns.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No background checks yet. Use BG to run a check without blocking the interface." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.backgroundRuns.slice(0, 6).map((run) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[11px] text-white/62 truncate", children: run.check.name }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [run.status, " / ", formatEngineeringDuration(run.durationMs || (run.status === 'running' ? Date.now() - run.startedAt : 0)), " / ", formatEngineeringTimestamp(run.updatedAt)] })] }), _jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: () => onEngineeringReadBackgroundRunOutput(run.id), className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors", children: "Output" }), run.status === 'running' && (_jsx("button", { type: "button", onClick: () => onEngineeringStopBackgroundRun(run.id), className: "h-6 px-2 rounded-[4px] bg-[#3a1518] text-[10px] text-[#ffb0b0] hover:bg-[#4a1b20] transition-colors", children: "Stop" }))] })] }), (run.stdout.trim() || run.stderr.trim() || run.error) && (_jsx("pre", { className: "mt-1 max-h-[62px] overflow-y-auto whitespace-pre-wrap break-words text-[10px] leading-relaxed font-mono text-white/34", children: [run.error, run.stderr.trim(), run.stdout.trim()].filter(Boolean).join('\n\n') }))] }, run.id))) }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Parsed diagnostics" }), _jsxs("span", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.diagnosticIssues.length, " issues"] })] }), engineeringWorkbench.diagnosticIssues.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No parsed diagnostics from recent or background runs." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.diagnosticIssues.slice(0, 8).map((issue) => (_jsxs("button", { type: "button", onClick: () => issue.filePath && onEngineeringOpenPath(issue.filePath), className: "w-full text-left px-2.5 py-2 hover:bg-white/[0.025] transition-colors", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("span", { className: `text-[10px] uppercase tracking-[0.1em] ${issue.severity === 'error' ? 'text-[#ff9a9a]' : issue.severity === 'warning' ? 'text-[#ffd38a]' : 'text-[#8ad7ff]'}`, children: [issue.severity, issue.code ? ` ${issue.code}` : ''] }), _jsx("span", { className: "text-[10px] text-white/20 tabular-nums", children: issue.line ? `${issue.line}:${issue.column || 1}` : issue.source })] }), _jsx("p", { className: "mt-1 text-[10px] text-white/30 truncate", children: issue.relativePath || issue.filePath || issue.source }), _jsx("p", { className: "mt-1 text-[11px] leading-relaxed text-white/52", children: issue.message })] }, issue.id))) }))] }), engineeringWorkbench.diff && (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24 truncate", children: engineeringWorkbench.diffLabel || 'Diff preview' }), _jsxs("div", { className: "flex items-center gap-2", children: [engineeringWorkbench.diffTruncated && _jsx("span", { className: "text-[10px] text-[#ffd38a]", children: "truncated" }), _jsx("button", { type: "button", onClick: onEngineeringQueuePatchReview, disabled: engineeringWorkbench.loading, className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Queue review" })] })] }), _jsx("pre", { className: "max-h-[120px] overflow-y-auto whitespace-pre-wrap break-words px-2.5 py-2 text-[10px] leading-relaxed font-mono text-white/42", children: engineeringWorkbench.diff })] })), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Patch review queue" }), _jsxs("span", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.patchReviews.length, " items"] })] }), engineeringWorkbench.patchReviews.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No queued patch reviews. Preview a diff, then queue it for review." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.patchReviews.slice(0, 5).map((item) => (_jsx("div", { className: "px-2.5 py-2", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[11px] text-white/62 truncate", children: item.title }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [item.status, " / ", item.files.length, " files / ", formatEngineeringTimestamp(item.updatedAt)] })] }), _jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: () => onEngineeringUpdatePatchReview(item.id, 'approved'), disabled: engineeringWorkbench.loading || item.status === 'approved', className: "h-6 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] hover:text-white/78 transition-colors disabled:opacity-35", children: "Approve" }), _jsx("button", { type: "button", onClick: () => onEngineeringUpdatePatchReview(item.id, 'changes-requested'), disabled: engineeringWorkbench.loading, className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Changes" })] })] }) }, item.id))) }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Recent runs" }), engineeringWorkbench.runs.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No check runs recorded for this workspace." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.runs.slice(0, 6).map((run) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "min-w-0 truncate text-[11px] text-white/62", children: run.check.name }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [_jsx("span", { className: `text-[10px] ${run.success ? 'text-[#96e59d]' : 'text-[#ff9a9a]'}`, children: run.success ? 'pass' : 'fail' }), _jsx("span", { className: "text-[10px] text-white/20", children: formatEngineeringDuration(run.durationMs) }), _jsx("span", { className: "text-[10px] text-white/20", children: formatEngineeringTimestamp(run.endedAt) })] })] }), (run.stdout.trim() || run.stderr.trim() || run.error) && (_jsx("pre", { className: "mt-1 max-h-[70px] overflow-y-auto whitespace-pre-wrap break-words text-[10px] leading-relaxed font-mono text-white/34", children: [run.error, run.stderr.trim(), run.stdout.trim()].filter(Boolean).join('\n\n') }))] }, run.id))) }))] })] })] })] })] })), tab === 'learned' && (
450
+ /*
451
+ * ADE §5.8, MOUNTED.
452
+ *
453
+ * Knowledge is per WORKSPACE, not per conversation — that is the whole
454
+ * point of the pillar: a fact outlives the run and the provider that
455
+ * learned it. `runId` is recorded as provenance on anything added here.
456
+ */
457
+ _jsx(KnowledgePanel, { workspaceId: engineeringWorkbench.rootDirectory, runId: reviewRunId })), tab === 'intake' && (
458
+ /*
459
+ * ADE §5.1, MOUNTED.
460
+ *
461
+ * `clientId` is this SURFACE — exactly-once is decided per client, and
462
+ * two windows sharing an id would collapse into one claimant and hide
463
+ * a real contention. `runId` is what a dispatched item runs as; absent,
464
+ * the dispatch control is unavailable rather than inventing one.
465
+ */
466
+ _jsx(IntakePanel, { clientId: reviewRunId, runId: reviewRunId })), tab === 'terminals' && (
467
+ /*
468
+ * ADE §5.5, MOUNTED.
469
+ *
470
+ * `viewerId` is the HOST INSTANCE id, not the conversation: the write
471
+ * lease is held by a surface, and the same session must read as
472
+ * "yours" here and "someone else's" in another window. Passing a
473
+ * conversation id would make two windows of one app look like the
474
+ * same viewer and hide a real contention.
475
+ */
476
+ _jsx(SessionsPanel, { viewerId: reviewRunId })), tab === 'fleet' && (
477
+ /*
478
+ * ADE §9 step 6, MOUNTED.
479
+ *
480
+ * Takes no props: the fleet is every run the HOST knows about, not
481
+ * this conversation's. Scoping it to the active conversation would
482
+ * make it a second view of the review tab and lose the only thing it
483
+ * is for — seeing the runs you are not currently looking at.
484
+ */
485
+ _jsx(FleetPanel, {})), tab === 'review' && (
486
+ /*
487
+ * §2.9 review and §5.7 landing, MOUNTED.
488
+ *
489
+ * Exporting the panel and stopping would have repeated the defect this
490
+ * work exists to fix, one level up: a capability that is built, tested
491
+ * and reachable by nothing. `runReviewPanel.test.ts` asserts the
492
+ * bridge bindings; this is what puts it in front of a person.
493
+ *
494
+ * The run id is the CONVERSATION id because that is what the host's
495
+ * default `resolveRunId` uses (`subagentRunId ?? conversationId`).
496
+ * Diverging here would ask the host about a run it has never heard of
497
+ * and render "not observed" for every healthy run.
498
+ */
499
+ _jsx(RunReviewPanel, { runId: reviewRunId, rootDirectory: engineeringWorkbench.rootDirectory })), tab === 'diffs' && (_jsxs("div", { className: "h-full grid grid-cols-[320px_minmax(0,1fr)]", children: [_jsxs("div", { className: "border-r border-white/[0.06] overflow-y-auto", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05]", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Patch history" }), _jsxs("p", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.patchReviews.length, " persisted patches"] })] }), engineeringWorkbench.patchReviews.length === 0 ? (_jsx("p", { className: "px-3 py-3 text-[11px] text-white/28", children: "No persisted patches yet. Agent Write/Edit tools create patch records after successful file mutations." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.patchReviews.slice(0, 20).map((patch) => (_jsxs("div", { className: "px-3 py-2", children: [_jsx("p", { className: "text-[11px] text-white/64 truncate", children: patch.summary || patch.title }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [patch.source || 'patch', " / ", patch.filesChanged?.length || patch.files.length, " files / ", patch.checkpointId || 'no checkpoint'] }), _jsx("p", { className: "mt-1 text-[10px] text-white/18 truncate", children: patch.requestId || patch.id }), patch.fileSnapshots && patch.fileSnapshots.length > 0 && onOpenEditorDiff ? (_jsxs("div", { className: "mt-2 space-y-1.5", children: [patch.fileSnapshots.slice(0, 4).map((snapshot) => {
500
+ const relativePath = snapshot.relativePath || snapshot.path;
501
+ const hunks = (patch.hunks || []).filter((hunk) => hunk.relativePath === relativePath);
502
+ const unresolvedHunks = hunks.filter((hunk) => !patchHunkDecision(patch, hunk.id));
503
+ return (_jsxs("div", { className: "rounded-[4px] border border-white/[0.05] bg-black/15 px-1.5 py-1.5", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: () => onOpenEditorDiff(patchSnapshotToEditorDiff(patch, snapshot)), className: "h-6 min-w-0 flex-1 truncate rounded-[4px] border border-white/[0.06] px-2 text-left text-[10px] text-white/48 transition-colors hover:border-white/[0.12] hover:text-white/78", title: `Open Monaco diff for ${relativePath}`, children: relativePath }), _jsx("button", { type: "button", disabled: engineeringWorkbench.loading || unresolvedHunks.length === 0, onClick: () => onEngineeringReviewPatchSelection({ id: patch.id, relativePath, action: 'accept' }), className: "h-6 rounded-[4px] bg-emerald-400/[0.08] px-1.5 text-[9px] text-emerald-200/60 hover:bg-emerald-400/[0.14] disabled:opacity-30", children: "Accept" }), _jsx("button", { type: "button", disabled: engineeringWorkbench.loading || unresolvedHunks.length === 0, onClick: () => onEngineeringReviewPatchSelection({ id: patch.id, relativePath, action: 'reject' }), className: "h-6 rounded-[4px] bg-red-400/[0.07] px-1.5 text-[9px] text-red-200/55 hover:bg-red-400/[0.13] disabled:opacity-30", children: "Reject" })] }), hunks.slice(0, 8).map((hunk) => {
504
+ const decision = patchHunkDecision(patch, hunk.id);
505
+ return (_jsxs("div", { className: "mt-1 flex items-center gap-1 border-t border-white/[0.035] pt-1", children: [_jsxs("span", { className: "min-w-0 flex-1 truncate font-mono text-[9px] text-white/28", title: hunk.id, children: ["@@ -", hunk.originalStart, ",", hunk.originalLines, " +", hunk.modifiedStart, ",", hunk.modifiedLines] }), decision ? (_jsx("span", { className: `text-[9px] ${decision.action === 'accept' ? 'text-emerald-200/55' : 'text-red-200/55'}`, children: decision.action })) : (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", disabled: engineeringWorkbench.loading, onClick: () => onEngineeringReviewPatchSelection({ id: patch.id, relativePath, hunkId: hunk.id, action: 'accept' }), className: "text-[9px] text-emerald-200/45 hover:text-emerald-100/80 disabled:opacity-30", children: "Accept" }), _jsx("button", { type: "button", disabled: engineeringWorkbench.loading, onClick: () => onEngineeringReviewPatchSelection({ id: patch.id, relativePath, hunkId: hunk.id, action: 'reject' }), className: "text-[9px] text-red-200/45 hover:text-red-100/80 disabled:opacity-30", children: "Reject" })] })), _jsx("button", { type: "button", disabled: engineeringWorkbench.loading, onClick: () => {
506
+ const comment = window.prompt('Review comment for this hunk:')?.trim();
507
+ if (comment)
508
+ onEngineeringReviewPatchSelection({ id: patch.id, relativePath, hunkId: hunk.id, action: 'comment', comment });
509
+ }, className: "text-[9px] text-white/28 hover:text-white/68 disabled:opacity-30", children: "Comment" })] }, hunk.id));
510
+ }), hunks.length > 8 ? _jsxs("p", { className: "mt-1 text-[9px] text-white/18", children: ["+", hunks.length - 8, " more hunks"] }) : null] }, `${patch.id}:${relativePath}`));
511
+ }), patch.fileSnapshots.length > 4 ? (_jsxs("span", { className: "h-6 px-1.5 text-[10px] leading-6 text-white/20", children: ["+", patch.fileSnapshots.length - 4] })) : null] })) : null] }, patch.id))) }))] }), _jsxs("div", { className: "min-w-0 min-h-0 flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Diff viewer" }), _jsx("p", { className: "text-[10px] text-white/20 truncate", children: "Unified patch preview. Open file-specific diffs through the editor Monaco diff surface where available." })] }), _jsx("button", { type: "button", onClick: () => onEngineeringPreviewDiff(undefined), disabled: !engineeringWorkbench.git?.isGitRepo || engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Working tree" })] }), _jsx("pre", { className: "flex-1 min-h-0 overflow-y-auto whitespace-pre-wrap break-words px-3 py-3 text-[10px] leading-relaxed font-mono text-white/42", children: engineeringWorkbench.diff || engineeringWorkbench.patchReviews[0]?.diff || 'No diff loaded. Select files in Engineering or use Working tree.' })] })] })), tab === 'checkpoints' && (_jsxs("div", { className: "h-full grid grid-cols-[minmax(0,0.95fr)_minmax(360px,1fr)]", children: [_jsxs("div", { className: "min-w-0 border-r border-white/[0.06] overflow-y-auto", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsxs("div", { children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Checkpoint browser" }), _jsxs("p", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.checkpoints.length, " checkpoint summaries"] })] }), _jsx("button", { type: "button", onClick: onEngineeringRefresh, disabled: !engineeringWorkbench.rootDirectory || engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] transition-colors disabled:opacity-35", children: "Refresh" })] }), engineeringWorkbench.checkpoints.length === 0 ? (_jsx("p", { className: "px-3 py-3 text-[11px] text-white/28", children: "No patch-linked checkpoints yet." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: engineeringWorkbench.checkpoints.map((checkpoint) => (_jsxs("div", { className: "px-3 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[11px] text-white/64 truncate", children: checkpoint.checkpointId }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [checkpoint.patchCount, " patches / ", checkpoint.filesChanged.length, " files / ", formatEngineeringTimestamp(checkpoint.createdAt)] })] }), _jsx("button", { type: "button", onClick: () => onEngineeringRestoreCheckpoint(checkpoint.checkpointId), disabled: engineeringWorkbench.loading, className: "h-6 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Restore" })] }), _jsx("p", { className: "mt-1 text-[10px] leading-relaxed text-white/34", children: checkpoint.summary })] }, checkpoint.checkpointId))) }))] }), _jsxs("div", { className: "min-w-0 min-h-0 flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsxs("div", { children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Checkpoint compare" }), _jsx("p", { className: "text-[10px] text-white/20", children: "Compares the two newest checkpoints by persisted patch history." })] }), _jsx("button", { type: "button", onClick: () => {
512
+ const [to, from] = engineeringWorkbench.checkpoints;
513
+ if (from && to)
514
+ onEngineeringCompareCheckpoints(from.checkpointId, to.checkpointId);
515
+ }, disabled: engineeringWorkbench.loading || engineeringWorkbench.checkpoints.length < 2, className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] transition-colors disabled:opacity-35", children: "Compare newest" })] }), _jsxs("div", { className: "px-3 py-3 border-b border-white/[0.05]", children: [_jsx("p", { className: "text-[11px] text-white/54", children: engineeringWorkbench.checkpointCompare
516
+ ? `${engineeringWorkbench.checkpointCompare.filesChanged.length} changed files between ${engineeringWorkbench.checkpointCompare.from?.checkpointId || 'A'} and ${engineeringWorkbench.checkpointCompare.to?.checkpointId || 'B'}`
517
+ : 'No checkpoint comparison loaded.' }), engineeringWorkbench.checkpointCompare?.filesChanged.length ? (_jsx("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: engineeringWorkbench.checkpointCompare.filesChanged.join(' / ') })) : null] }), _jsx("pre", { className: "flex-1 min-h-0 overflow-y-auto whitespace-pre-wrap break-words px-3 py-3 text-[10px] leading-relaxed font-mono text-white/42", children: engineeringWorkbench.checkpointCompare?.diff || 'Run a comparison to inspect checkpoint patch diffs.' })] })] })), tab === 'sessions' && (_jsxs("div", { className: "h-full overflow-y-auto", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsxs("div", { children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Engineering sessions" }), _jsxs("p", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.sessions.length, " grouped conversations"] })] }), _jsx("button", { type: "button", onClick: onEngineeringRefresh, disabled: !engineeringWorkbench.rootDirectory || engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] transition-colors disabled:opacity-35", children: "Refresh" })] }), engineeringWorkbench.sessions.length === 0 ? (_jsx("p", { className: "px-3 py-3 text-[11px] text-white/28", children: "No engineering sessions yet. Agent patches with conversation ids will appear here." })) : (_jsx("div", { className: "grid grid-cols-2 gap-2 p-3", children: engineeringWorkbench.sessions.slice(0, 12).map((session) => (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-3 py-2", children: [_jsx("p", { className: "text-[11px] text-white/64 truncate", children: session.conversationId }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [session.patches.length, " patches / ", session.checkpoints.length, " checkpoints / ", session.testsRun.length, " checks"] }), _jsx("p", { className: "mt-2 text-[11px] leading-relaxed text-white/46", children: session.finalSummary }), _jsxs("p", { className: "mt-2 text-[10px] text-white/20", children: [formatEngineeringTimestamp(session.startedAt), " - ", formatEngineeringTimestamp(session.endedAt)] })] }, session.id))) }))] })), tab === 'runtime' && (_jsxs("div", { className: "h-full flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsxs("div", { children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Runtime timeline" }), _jsxs("p", { className: "text-[10px] text-white/20", children: [engineeringWorkbench.runtimeEvents.length, " projected persisted events"] })] }), _jsx("button", { type: "button", onClick: onEngineeringRefresh, disabled: !engineeringWorkbench.rootDirectory || engineeringWorkbench.loading, className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] transition-colors disabled:opacity-35", children: "Refresh" })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto divide-y divide-white/[0.04]", children: engineeringWorkbench.runtimeEvents.length === 0 ? (_jsx("p", { className: "px-3 py-3 text-[11px] text-white/28", children: "No runtime timeline loaded for this conversation." })) : engineeringWorkbench.runtimeEvents.map((event) => (_jsxs("div", { className: "px-3 py-2 grid grid-cols-[72px_180px_minmax(0,1fr)] gap-3 text-[10px]", children: [_jsxs("span", { className: "text-white/20 tabular-nums", children: ["#", event.sequence] }), _jsx("span", { className: "text-white/44 truncate", children: event.type }), _jsx("span", { className: "text-white/28 truncate", children: event.summary || event.requestId || event.timestamp || event.id })] }, event.id))) })] })), tab === 'cli' && (_jsx(React.Suspense, { fallback: _jsx("div", { className: "h-full px-3 py-3 text-[11px] text-white/28", children: "Loading CLI control plane..." }), children: _jsx(AgentWorkbenchCliPanel, { cliControlPlane: cliControlPlane, caller: cliControlPlaneCaller, conversationId: cliControlPlaneConversationId, remoteBackendId: cliControlPlaneRemoteBackendId, remoteRunId: remoteRunId, onRemoteRunIdChange: setRemoteRunId, onCliControlPlaneInspect: onCliControlPlaneInspect, onCliControlPlaneInspectOperation: onCliControlPlaneInspectOperation, onCliControlPlaneRemoteRunOperation: onCliControlPlaneRemoteRunOperation }) })), tab === 'subagents' && (_jsxs("div", { className: "h-full flex flex-col", children: [_jsx("div", { className: "px-3 py-2 border-b border-white/[0.06]", children: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/26", children: "Subagent runs" }), _jsx("p", { className: "text-[11px] text-white/34 truncate", children: subagentWorkbench.activeConversationId
518
+ ? `${subagentWorkbench.runs.length} linked runs / ${activeSubagentRunCount} active`
519
+ : 'Open a conversation to inspect delegated agent work.' })] }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [_jsx("span", { className: `h-2 w-2 rounded-full ${activeSubagentRunCount > 0 ? 'bg-[#8ad7ff] animate-pulse' : 'bg-white/16'}` }), _jsx("button", { type: "button", onClick: onSubagentRecoverRuns, disabled: subagentWorkbench.loading, title: "Recover expired leases, stale heartbeats, and timed-out subagent runs.", className: "h-7 px-2.5 rounded-[4px] border border-[#ffd38a]/18 bg-[#ffd38a]/8 hover:bg-[#ffd38a]/12 text-[10px] uppercase tracking-[0.12em] text-[#ffe1a6] transition-colors disabled:opacity-35", children: "Repair" }), _jsx("button", { type: "button", onClick: onSubagentRefresh, disabled: subagentWorkbench.loading, className: "h-7 px-2.5 rounded-[4px] bg-white/[0.07] hover:bg-white/[0.11] text-[10px] uppercase tracking-[0.12em] text-white/62 transition-colors disabled:opacity-35", children: subagentWorkbench.loading ? 'Syncing' : 'Refresh' })] })] }) }), subagentWorkbench.error && (_jsx("div", { className: "border-b border-[#4b1f24] bg-[#1a0f12] px-3 py-1.5 text-[11px] text-[#ffb0b0]", children: subagentWorkbench.error })), _jsxs("div", { className: "border-b border-white/[0.05] bg-black/20 px-3 py-2", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs("span", { className: `rounded px-2 py-1 text-[10px] uppercase tracking-[0.12em] ${subagentAdapterHealth === 'available'
520
+ ? 'bg-[#96e59d]/10 text-[#96e59d]'
521
+ : subagentAdapterHealth === 'unavailable'
522
+ ? 'bg-[#ff9a9a]/10 text-[#ffb0b0]'
523
+ : 'bg-[#ffd38a]/10 text-[#ffd38a]'}`, children: ["Adapter ", subagentAdapterHealth] }), _jsx("span", { className: "text-[10px] text-white/28", children: subagentWorkbench.schedulerStatusLoading
524
+ ? 'Loading scheduler status...'
525
+ : subagentSchedulerStatus
526
+ ? `Scheduler ${subagentSchedulerStatus.running ? 'running' : 'stopped'} / adapters ${subagentSchedulerStatus.adapterIds.join(', ') || 'none'}`
527
+ : 'Scheduler status unavailable' }), subagentSchedulerStatus?.lastError && (_jsx("span", { className: "text-[10px] text-[#ffb0b0]/80 truncate", children: subagentSchedulerStatus.lastError }))] }), (subagentAdapterHealth !== 'available' || subagentWorkbench.schedulerStatusError) && (_jsxs("p", { className: "mt-1 text-[10px] leading-relaxed text-white/30", children: ["No main-process execution adapter is registered. New delegated runs stay queued for scheduler recovery until a main adapter is available.", subagentWorkbench.schedulerStatusError ? ` Status bridge: ${subagentWorkbench.schedulerStatusError}` : ''] }))] }), _jsxs("form", { onSubmit: submitSubagentDelegation, className: "border-b border-white/[0.05] bg-black/10 px-3 py-2.5", children: [_jsxs("div", { className: "mb-2 flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Delegation composer" }), _jsx("p", { className: "text-[10px] text-white/22 truncate", children: subagentDelegationSourceName ? `Source ${subagentDelegationSourceName}` : 'No source agent selected' })] }), _jsx("button", { type: "submit", disabled: delegationSubmitting
528
+ || !!subagentDelegationDisabledReason
529
+ || !delegationTargetId
530
+ || !delegationObjective.trim()
531
+ || !!selectedDelegationTarget?.disabledReason, className: "h-7 px-2.5 rounded-[4px] bg-[#8ad7ff]/12 text-[10px] uppercase tracking-[0.12em] text-[#b9eaff] hover:bg-[#8ad7ff]/18 transition-colors disabled:opacity-35", children: delegationSubmitting ? 'Sending' : 'Delegate' })] }), _jsxs("div", { className: "grid grid-cols-[minmax(180px,0.9fr)_minmax(0,1.4fr)_118px_96px_96px] gap-2", children: [_jsxs("label", { className: "min-w-0", children: [_jsx("span", { className: "mb-1 block text-[10px] uppercase tracking-[0.12em] text-white/22", children: "Target" }), _jsx("select", { value: delegationTargetId, onChange: (event) => setDelegationTargetId(event.target.value), disabled: !!subagentDelegationDisabledReason || subagentDelegationTargets.length === 0, className: "h-8 w-full rounded-[4px] border border-white/[0.07] bg-black/30 px-2 text-[11px] text-white/64 outline-none focus:border-[#8ad7ff]/40 disabled:opacity-35", children: subagentDelegationTargets.length === 0 ? (_jsx("option", { value: "", children: "No teammate" })) : subagentDelegationTargets.map((target) => (_jsxs("option", { value: target.id, disabled: !!target.disabledReason, children: [target.name, target.activeRunCount ? ` (${target.activeRunCount} active)` : '', target.disabledReason ? ' - blocked' : ''] }, target.id))) })] }), _jsxs("label", { className: "min-w-0", children: [_jsx("span", { className: "mb-1 block text-[10px] uppercase tracking-[0.12em] text-white/22", children: "Objective" }), _jsx("textarea", { value: delegationObjective, onChange: (event) => setDelegationObjective(event.target.value), disabled: !!subagentDelegationDisabledReason, rows: 2, className: "h-[58px] w-full resize-none rounded-[4px] border border-white/[0.07] bg-black/30 px-2 py-1.5 text-[11px] leading-relaxed text-white/68 outline-none focus:border-[#8ad7ff]/40 disabled:opacity-35" })] }), _jsxs("label", { className: "min-w-0", children: [_jsx("span", { className: "mb-1 block text-[10px] uppercase tracking-[0.12em] text-white/22", children: "Output" }), _jsx("select", { value: delegationExpectedArtifact, onChange: (event) => setDelegationExpectedArtifact(event.target.value), disabled: !!subagentDelegationDisabledReason, className: "h-8 w-full rounded-[4px] border border-white/[0.07] bg-black/30 px-2 text-[11px] text-white/64 outline-none focus:border-[#8ad7ff]/40 disabled:opacity-35", children: ['answer', 'file', 'diff', 'diagnostic', 'report'].map((artifact) => (_jsx("option", { value: artifact, children: artifact }, artifact))) }), _jsx("input", { value: delegationContextNote, onChange: (event) => setDelegationContextNote(event.target.value), disabled: !!subagentDelegationDisabledReason, placeholder: "context note", className: "mt-2 h-8 w-full rounded-[4px] border border-white/[0.07] bg-black/30 px-2 text-[11px] text-white/64 outline-none placeholder:text-white/18 focus:border-[#8ad7ff]/40 disabled:opacity-35" })] }), _jsxs("label", { className: "min-w-0", children: [_jsx("span", { className: "mb-1 block text-[10px] uppercase tracking-[0.12em] text-white/22", children: "Tokens" }), _jsx("input", { value: delegationMaxTokens, onChange: (event) => setDelegationMaxTokens(event.target.value.replace(/[^\d]/g, '').slice(0, 7)), disabled: !!subagentDelegationDisabledReason, inputMode: "numeric", className: "h-8 w-full rounded-[4px] border border-white/[0.07] bg-black/30 px-2 text-[11px] text-white/64 outline-none focus:border-[#8ad7ff]/40 disabled:opacity-35" })] }), _jsxs("label", { className: "min-w-0", children: [_jsx("span", { className: "mb-1 block text-[10px] uppercase tracking-[0.12em] text-white/22", children: "Seconds" }), _jsx("input", { value: delegationMaxRuntimeSeconds, onChange: (event) => setDelegationMaxRuntimeSeconds(event.target.value.replace(/[^\d]/g, '').slice(0, 6)), disabled: !!subagentDelegationDisabledReason, inputMode: "numeric", className: "h-8 w-full rounded-[4px] border border-white/[0.07] bg-black/30 px-2 text-[11px] text-white/64 outline-none focus:border-[#8ad7ff]/40 disabled:opacity-35" }), selectedDelegationTarget && (_jsx("p", { className: "mt-2 truncate text-[10px] text-white/22", children: [selectedDelegationTarget.role, selectedDelegationTarget.model, selectedDelegationTarget.disabledReason].filter(Boolean).join(' / ') }))] })] }), (subagentDelegationDisabledReason || delegationResult) && (_jsx("p", { className: `mt-2 text-[10px] leading-relaxed ${delegationResult?.ok ? 'text-[#96e59d]/78' : 'text-[#ffb0b0]/78'}`, children: subagentDelegationDisabledReason || delegationResult?.message }))] }), _jsxs("div", { className: "flex-1 min-h-0 grid grid-cols-[minmax(0,1.05fr)_minmax(360px,0.95fr)]", children: [_jsxs("div", { className: "min-w-0 min-h-0 border-r border-white/[0.06] flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Run queue" }), _jsx("p", { className: "text-[10px] text-white/20 truncate", children: "Parent-child delegations for the active conversation and selected team." })] }), _jsx("p", { className: "text-[10px] text-white/20 tabular-nums", children: subagentWorkbench.runs.length })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3", children: subagentWorkbench.loading && subagentWorkbench.runs.length === 0 ? (_jsx("div", { className: "space-y-2", children: [0, 1, 2].map((index) => (_jsx("div", { className: "h-[54px] rounded border border-white/[0.04] bg-white/[0.025] overflow-hidden", children: _jsx("div", { className: "h-full w-1/2 bg-white/[0.035] animate-pulse" }) }, index))) })) : subagentWorkbench.runs.length === 0 ? (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-3 py-3", children: [_jsx("p", { className: "text-[11px] text-white/36", children: "No subagent runs are linked yet." }), _jsx("p", { className: "mt-1 text-[10px] leading-relaxed text-white/22", children: "Delegated ASK_AGENT calls will create durable child run records here, including tool policy, child trace, summaries, and artifacts." })] })) : (_jsx("div", { className: "space-y-1.5", children: subagentWorkbench.runs.map((run) => {
532
+ const selected = selectedSubagentRun?.id === run.id;
533
+ return (_jsx("button", { type: "button", onClick: () => onSubagentSelectRun(run), className: `w-full text-left rounded border px-2.5 py-2 transition-colors ${selected
534
+ ? 'border-white/[0.14] bg-white/[0.055]'
535
+ : 'border-white/[0.05] bg-black/20 hover:bg-white/[0.035]'}`, children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("span", { className: "mt-[3px] inline-flex h-3 w-3 flex-shrink-0 items-center justify-center", children: _jsx("span", { className: `block h-[7px] w-[7px] rounded-[2px] ${subagentStatusClass(run.status)} ${isActiveSubagentRun(run.status) ? 'animate-pulse' : ''}` }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block text-[12px] text-white/66 truncate", children: run.childAgentName || run.childAgentId }), _jsxs("span", { className: "mt-1 block text-[10px] text-white/24 truncate", children: [run.status, " / ", run.executionAdapterId || run.executionAttempts[0]?.adapterId || 'no-adapter', " / ", formatSubagentDuration(run), " / match ", Math.round(run.capabilityMatch.score * 100), "%"] }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/34 line-clamp-2", children: run.objective })] }), _jsx("span", { className: "text-[10px] text-white/18 tabular-nums flex-shrink-0", children: formatSubagentTimestamp(run.updatedAt) })] }) }, run.id));
536
+ }) })) })] }), _jsx("aside", { className: "min-w-0 min-h-0 flex flex-col", children: !selectedSubagentRun ? (_jsx("div", { className: "px-3 py-3 text-[11px] text-white/28", children: "Select a subagent run to inspect its lifecycle and handoff." })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "px-3 py-2 border-b border-white/[0.05]", children: _jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Run detail" }), _jsx("p", { className: "mt-1 text-[12px] text-white/70 truncate", children: selectedSubagentRun.childAgentName || selectedSubagentRun.childAgentId }), _jsxs("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [selectedSubagentRun.workspaceName || selectedSubagentRun.workspaceId, " / ", selectedSubagentRun.teamName || selectedSubagentRun.teamId] })] }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [_jsx("button", { type: "button", onClick: () => onSubagentOpenConversation(selectedSubagentRun), className: "h-7 px-2 rounded-[4px] bg-white/[0.07] text-[10px] text-white/58 hover:bg-white/[0.11] hover:text-white/78 transition-colors", children: "Open child" }), _jsx("button", { type: "button", onClick: () => onSubagentCancelRun(selectedSubagentRun), disabled: !isActiveSubagentRun(selectedSubagentRun.status), className: "h-7 px-2 rounded-[4px] border border-white/[0.06] text-[10px] text-white/38 hover:text-white/68 transition-colors disabled:opacity-35", children: "Stop" })] })] }) }), _jsxs("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3 space-y-3", children: [_jsxs("div", { className: "grid grid-cols-4 gap-2", children: [_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-2.5 py-2", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/22", children: "Status" }), _jsx("p", { className: "mt-1 text-[11px] text-white/62", children: selectedSubagentRun.status })] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-2.5 py-2", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/22", children: "Adapter" }), _jsx("p", { className: "mt-1 truncate text-[11px] text-white/62", children: selectedSubagentRun.executionAdapterId || selectedSubagentLatestAttempt?.adapterId || 'no adapter' })] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-2.5 py-2", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/22", children: "Match" }), _jsxs("p", { className: "mt-1 text-[11px] text-white/62", children: [Math.round(selectedSubagentRun.capabilityMatch.score * 100), "%"] })] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-2.5 py-2", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/22", children: "Elapsed" }), _jsx("p", { className: "mt-1 text-[11px] text-white/62", children: formatSubagentDuration(selectedSubagentRun) || 'n/a' })] })] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Objective" }), _jsx("p", { className: "px-2.5 py-2 text-[11px] leading-relaxed text-white/46 whitespace-pre-wrap break-words", children: selectedSubagentRun.objective })] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Parent-child trace" }), _jsxs("span", { className: "text-[10px] text-white/20", children: [subagentWorkbench.runtimeEvents.length, " events / ", selectedSubagentRun.artifacts.length, " artifacts"] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2 px-2.5 py-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/20", children: "Parent" }), _jsx("p", { className: "mt-1 truncate text-[10px] text-white/48", children: selectedSubagentRun.parentAgentName || selectedSubagentRun.parentAgentId }), _jsx("p", { className: "mt-1 truncate font-mono text-[10px] text-white/26", children: selectedSubagentRun.parentConversationId }), _jsx("p", { className: "mt-1 truncate font-mono text-[10px] text-white/22", children: selectedSubagentRun.parentRequestId || 'no parent request' })] }), _jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/20", children: "Child" }), _jsx("p", { className: "mt-1 truncate text-[10px] text-white/48", children: selectedSubagentRun.childAgentName || selectedSubagentRun.childAgentId }), _jsx("p", { className: "mt-1 truncate font-mono text-[10px] text-white/26", children: selectedSubagentRun.childConversationId }), _jsx("p", { className: "mt-1 truncate font-mono text-[10px] text-white/22", children: selectedSubagentRun.childRequestId || 'no child request' })] })] }), _jsx("p", { className: "border-t border-white/[0.04] px-2.5 py-2 text-[10px] leading-relaxed text-white/28", children: "Runtime events and artifacts are loaded through the durable subagent trace projection and remain openable from the child conversation." })] }), (selectedSubagentRun.summary || selectedSubagentRun.error) && (_jsxs("div", { className: `rounded border overflow-hidden ${selectedSubagentRun.error
537
+ ? 'border-[#4b1f24] bg-[#1a0f12]'
538
+ : 'border-white/[0.05] bg-black/20'}`, children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: selectedSubagentRun.error ? 'Failure' : 'Summary' }), _jsx("pre", { className: `px-2.5 py-2 max-h-[95px] overflow-y-auto whitespace-pre-wrap break-words text-[10px] leading-relaxed font-mono ${selectedSubagentRun.error ? 'text-[#f0b7b7]/80' : 'text-white/42'}`, children: selectedSubagentRun.error || selectedSubagentRun.summary })] })), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Execution attempts" }), _jsx("span", { className: "text-[10px] text-white/20", children: selectedSubagentRun.executionAttempts.length })] }), selectedSubagentRun.executionAttempts.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No launch-requested, running, or terminal attempt has been recorded yet." })) : (_jsx("div", { className: "max-h-[116px] overflow-y-auto divide-y divide-white/[0.04]", children: selectedSubagentRun.executionAttempts.map((attempt) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("p", { className: "min-w-0 truncate text-[11px] text-white/58", children: ["Attempt ", attempt.attempt, " / ", attempt.adapterId || 'no-adapter'] }), _jsx("span", { className: `shrink-0 rounded px-1.5 py-0.5 text-[9px] uppercase tracking-[0.1em] ${subagentAttemptStatusClass(attempt.status)}`, children: attempt.status })] }), _jsx("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [
539
+ `worker ${attempt.workerId}`,
540
+ attempt.childRequestId ? `request ${attempt.childRequestId}` : null,
541
+ attempt.runningAt ? `running ${formatSubagentAttemptTime(attempt.runningAt)}` : `launch ${formatSubagentAttemptTime(attempt.launchRequestedAt)}`,
542
+ attempt.endedAt ? `ended ${formatSubagentAttemptTime(attempt.endedAt)}` : null,
543
+ ].filter(Boolean).join(' / ') }), attempt.error && (_jsx("p", { className: "mt-1 text-[10px] leading-relaxed text-[#ffb0b0]/72 line-clamp-2", children: attempt.error }))] }, `${attempt.attempt}:${attempt.workerId}:${attempt.launchRequestedAt}`))) }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Cancellation propagation" }), selectedSubagentRun.cancellation ? (_jsxs("div", { className: "px-2.5 py-2 space-y-1.5", children: [_jsxs("p", { className: "text-[10px] text-white/30", children: ["Status: ", _jsx("span", { className: "text-white/58", children: selectedSubagentRun.cancellation.propagationStatus })] }), _jsxs("p", { className: "text-[10px] text-white/30", children: ["Propagate to child: ", _jsx("span", { className: "text-white/58", children: selectedSubagentRun.cancellation.propagateToChild ? 'yes' : 'no' })] }), _jsxs("p", { className: "text-[10px] text-white/30", children: ["Requested: ", _jsx("span", { className: "text-white/58", children: formatSubagentTimestamp(selectedSubagentRun.cancellation.requestedAt) || 'n/a' }), selectedSubagentRun.cancellation.propagatedAt ? _jsxs("span", { className: "text-white/30", children: [" / propagated ", formatSubagentTimestamp(selectedSubagentRun.cancellation.propagatedAt)] }) : null] }), selectedSubagentRun.cancellation.reason && (_jsx("p", { className: "text-[10px] leading-relaxed text-white/34", children: selectedSubagentRun.cancellation.reason }))] })) : (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No cancellation has been requested for this run." }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Runtime trace" }), _jsx("span", { className: "text-[10px] text-white/20", children: subagentWorkbench.runtimeEventsLoading
544
+ ? 'loading'
545
+ : `${subagentWorkbench.runtimeEvents.length} events` })] }), subagentWorkbench.runtimeEventsError ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-[#ffb0b0]", children: subagentWorkbench.runtimeEventsError })) : subagentWorkbench.runtimeEvents.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: subagentWorkbench.runtimeEventsLoading ? 'Loading child trace...' : 'No durable child runtime events recorded yet.' })) : (_jsx("div", { className: "max-h-[120px] overflow-y-auto divide-y divide-white/[0.04]", children: subagentWorkbench.runtimeEvents.slice(0, 18).map((event) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "min-w-0 truncate text-[11px] text-white/58", children: event.type }), _jsx("span", { className: "text-[10px] text-white/18 tabular-nums", children: event.sequence })] }), _jsx("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [event.source, formatSubagentTimestamp(Date.parse(event.timestamp))].filter(Boolean).join(' / ') }), event.summary && (_jsx("p", { className: "mt-1 text-[10px] leading-relaxed text-white/34 line-clamp-2", children: event.summary }))] }, event.id))) }))] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Tool policy" }), _jsxs("div", { className: "px-2.5 py-2 space-y-2", children: [_jsxs("p", { className: "text-[10px] text-white/28", children: ["Permission mode: ", _jsx("span", { className: "text-white/52", children: selectedSubagentRun.toolPolicy.permissionMode })] }), _jsxs("p", { className: "text-[10px] leading-relaxed text-white/28", children: ["Tools: ", _jsx("span", { className: "text-white/46", children: selectedSubagentRun.toolPolicy.allowedTools.join(', ') || 'none' })] }), _jsxs("p", { className: "text-[10px] leading-relaxed text-white/28", children: ["Directories: ", _jsx("span", { className: "text-white/46", children: selectedSubagentRun.toolPolicy.allowedDirectories.join(', ') || 'none' })] })] })] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Capability match" }), _jsxs("div", { className: "px-2.5 py-2 space-y-1.5", children: [(selectedSubagentRun.capabilityMatch.reasons.length > 0
546
+ ? selectedSubagentRun.capabilityMatch.reasons
547
+ : ['No matcher reasons were recorded.']).map((reason, index) => (_jsx("p", { className: "text-[10px] leading-relaxed text-white/34", children: reason }, `${reason}:${index}`))), selectedSubagentRun.capabilityMatch.missingCapabilities.length > 0 && (_jsxs("p", { className: "text-[10px] leading-relaxed text-[#ffd38a]/80", children: ["Missing: ", selectedSubagentRun.capabilityMatch.missingCapabilities.join(', ')] }))] })] }), _jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsx("div", { className: "px-2.5 py-1.5 border-b border-white/[0.05] text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Artifacts" }), selectedSubagentRun.artifacts.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-white/28", children: "No artifacts handed off yet." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: selectedSubagentRun.artifacts.map((artifact) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsx("p", { className: "text-[11px] text-white/58 truncate", children: artifact.title }), _jsx("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [artifact.type, artifact.path, artifact.conversationId].filter(Boolean).join(' / ') })] }, artifact.id))) }))] })] })] })) })] })] })), tab === 'policy' && (_jsxs("div", { className: "h-full flex flex-col", children: [_jsx("div", { className: "px-3 py-2 border-b border-white/[0.06]", children: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/26", children: "Workspace policy" }), _jsxs("p", { className: "text-[11px] text-white/34 truncate", children: [policyWorkbench.memory.length, " memories / ", policyWorkbench.artifacts.length, " artifacts / ", policyWorkbench.taskBoards.reduce((sum, board) => sum + board.tasks.length, 0), " tasks"] })] }), _jsx("button", { type: "button", onClick: onPolicyRefresh, disabled: policyWorkbench.loading, className: "h-7 px-2.5 rounded-[4px] bg-white/[0.07] hover:bg-white/[0.11] text-[10px] uppercase tracking-[0.12em] text-white/62 transition-colors disabled:opacity-35", children: policyWorkbench.loading ? 'Syncing' : 'Refresh' })] }) }), policyWorkbench.error && (_jsx("div", { className: "border-b border-[#4b1f24] bg-[#1a0f12] px-3 py-1.5 text-[11px] text-[#ffb0b0]", children: policyWorkbench.error })), _jsxs("div", { className: "flex-1 min-h-0 grid grid-cols-3", children: [_jsxs("section", { className: "min-w-0 min-h-0 border-r border-white/[0.06] flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Shared memory" }), _jsx("span", { className: "text-[10px] text-white/18 tabular-nums", children: policyWorkbench.memory.length })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3 space-y-1.5", children: policyWorkbench.loading && policyWorkbench.memory.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Loading memory..." })) : policyWorkbench.memory.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No shared memory visible for this scope." })) : (policyWorkbench.memory.slice(0, 30).map((entry) => (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("p", { className: "min-w-0 truncate text-[11px] text-white/58", children: [entry.scopeType, ":", entry.scopeId] }), _jsx("span", { className: "text-[10px] text-white/18", children: formatSubagentTimestamp(entry.createdAt) })] }), _jsx("p", { className: "mt-1 text-[10px] leading-relaxed text-white/38 line-clamp-3", children: entry.content }), entry.tags.length > 0 && (_jsx("p", { className: "mt-1 text-[10px] text-white/22 truncate", children: entry.tags.join(' / ') }))] }, entry.id)))) })] }), _jsxs("section", { className: "min-w-0 min-h-0 border-r border-white/[0.06] flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Artifacts" }), _jsx("span", { className: "text-[10px] text-white/18 tabular-nums", children: policyWorkbench.artifacts.length })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3 space-y-1.5", children: policyWorkbench.loading && policyWorkbench.artifacts.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Loading artifacts..." })) : policyWorkbench.artifacts.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No artifacts registered for this scope." })) : (policyWorkbench.artifacts.slice(0, 30).map((artifact) => (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "min-w-0 truncate text-[11px] text-white/58", children: artifact.title }), _jsx("span", { className: "text-[10px] text-white/18", children: artifact.type })] }), _jsx("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [artifact.path || artifact.uri, artifact.contentType, formatCodeBytes(artifact.sizeBytes)].filter(Boolean).join(' / ') }), _jsx("p", { className: "mt-1 text-[10px] text-white/18", children: formatSubagentTimestamp(artifact.createdAt) })] }, artifact.id)))) })] }), _jsxs("section", { className: "min-w-0 min-h-0 flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.05] flex items-center justify-between", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Task boards" }), _jsx("span", { className: "text-[10px] text-white/18 tabular-nums", children: policyWorkbench.taskBoards.length })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3 space-y-2", children: policyWorkbench.loading && policyWorkbench.taskBoards.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Loading boards..." })) : policyWorkbench.taskBoards.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No team or workspace task boards yet." })) : (policyWorkbench.taskBoards.slice(0, 12).map((board) => (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 overflow-hidden", children: [_jsxs("div", { className: "px-2.5 py-2 border-b border-white/[0.04]", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "min-w-0 truncate text-[11px] text-white/58", children: board.title }), _jsx("span", { className: "text-[10px] text-white/18", children: board.tasks.length })] }), _jsxs("p", { className: "mt-1 text-[10px] text-white/22", children: [board.scopeType, ":", board.scopeId] })] }), board.tasks.length === 0 ? (_jsx("p", { className: "px-2.5 py-2 text-[10px] text-white/24", children: "No tasks on this board." })) : (_jsx("div", { className: "divide-y divide-white/[0.04]", children: board.tasks.slice(0, 8).map((task) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "min-w-0 truncate text-[11px] text-white/52", children: task.title }), _jsx("span", { className: "text-[10px] text-white/18", children: task.priority })] }), _jsx("p", { className: "mt-1 text-[10px] text-white/24 truncate", children: [task.status, task.assigneeAgentId, task.labels.join(' / ')].filter(Boolean).join(' / ') })] }, task.id))) }))] }, board.id)))) })] })] })] })), tab === 'support' && (_jsxs("div", { className: "h-full flex flex-col", children: [_jsx("div", { className: "px-3 py-2 border-b border-white/[0.06]", children: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/26", children: "Support and repair" }), _jsx("p", { className: "text-[11px] text-white/34 truncate", children: "Production diagnostics, local schema repair, performance profile, and redacted support bundles." })] }), _jsx("span", { className: `h-5 rounded-[3px] px-2 text-[10px] leading-5 ${supportBusyAction ? 'bg-[#ffd38a]/15 text-[#ffd38a]' : supportApi ? 'bg-[#96e59d]/12 text-[#96e59d]' : 'bg-[#ff9a9a]/12 text-[#ffb0b0]'}`, children: supportBusyAction || (supportApi ? 'Ready' : 'Unavailable') })] }) }), _jsxs("div", { className: "flex-1 min-h-0 grid grid-cols-[290px_minmax(0,1fr)]", children: [_jsxs("section", { className: "border-r border-white/[0.06] px-3 py-3 space-y-2", children: [_jsxs("button", { type: "button", disabled: !supportApi || !!supportBusyAction, onClick: () => {
548
+ if (!supportApi)
549
+ return;
550
+ void runSupportAction('Create support bundle', () => supportApi.createBundle({
551
+ includeSearchStatus: true,
552
+ includeSearchProfile: true,
553
+ includeSearchWatcher: true,
554
+ includePluginMcpSnapshot: true,
555
+ includeRuntimeSummary: true,
556
+ includeSubagentSnapshot: true,
557
+ includeCliControlPlane: true,
558
+ cliControlPlaneSnapshot: cliControlPlane,
559
+ includeRecentLogs: false,
560
+ }));
561
+ }, className: "w-full rounded border border-white/[0.06] bg-white/[0.045] px-3 py-2 text-left transition-colors hover:bg-white/[0.075] disabled:opacity-35", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "Create support bundle" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Writes a redacted JSON bundle with search lifecycle, subagents, CLI/ACP readiness, policy audit, Plugin/MCP trust, LSP, IPC coverage, and repair guidance." })] }), _jsxs("button", { type: "button", disabled: !supportApi || !!supportBusyAction, onClick: () => {
562
+ if (!supportApi)
563
+ return;
564
+ void runSupportAction('Repair local systems', () => supportApi.repairAll({ forceSearchReindex: true }));
565
+ }, className: "w-full rounded border border-white/[0.06] bg-white/[0.045] px-3 py-2 text-left transition-colors hover:bg-white/[0.075] disabled:opacity-35", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "Repair indexes" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Runs schema checks and forces the conversation/code search index to rebuild from local sources." })] }), _jsxs("button", { type: "button", disabled: !supportApi || !!supportBusyAction, onClick: () => {
566
+ if (!supportApi)
567
+ return;
568
+ void runSupportAction('Run migrations', () => supportApi.runMigrations());
569
+ }, className: "w-full rounded border border-white/[0.06] bg-white/[0.045] px-3 py-2 text-left transition-colors hover:bg-white/[0.075] disabled:opacity-35", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "Run migrations" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Verifies persistent ~/.xeno directories and records local schema migration state." })] }), _jsxs("button", { type: "button", disabled: !supportApi || !!supportBusyAction, onClick: () => {
570
+ if (!supportApi)
571
+ return;
572
+ void runSupportAction('Capture profile', () => supportApi.profile());
573
+ }, className: "w-full rounded border border-white/[0.06] bg-white/[0.045] px-3 py-2 text-left transition-colors hover:bg-white/[0.075] disabled:opacity-35", children: [_jsx("span", { className: "block text-[11px] uppercase tracking-[0.12em] text-white/62", children: "Capture profile" }), _jsx("span", { className: "mt-1 block text-[10px] leading-relaxed text-white/30", children: "Captures process memory, CPU usage, host resources, and startup performance marks." })] }), !supportApi && (_jsx("p", { className: "rounded border border-[#4b1f24] bg-[#1a0f12] px-2.5 py-2 text-[11px] leading-relaxed text-[#ffb0b0]", children: "Support diagnostics are not exposed by this preload bridge. Restart the app after updating the main/preload bundle." }))] }), _jsxs("section", { className: "min-w-0 min-h-0 flex flex-col", children: [_jsx("div", { className: "border-b border-white/[0.05] px-3 py-2", children: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/24", children: "Last result" }), _jsx("p", { className: "text-[11px] text-white/38 truncate", children: supportResult
574
+ ? `${supportResult.label} / ${new Date(supportResult.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`
575
+ : 'No support operation has run in this panel yet.' })] }), supportResult && (_jsx("span", { className: `h-5 rounded-[3px] px-2 text-[10px] leading-5 ${supportResult.success ? 'bg-[#96e59d]/12 text-[#96e59d]' : 'bg-[#ff9a9a]/12 text-[#ffb0b0]'}`, children: supportResult.success ? 'success' : 'failed' }))] }) }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3", children: !supportResult ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Run a support operation to see a redacted result and the raw response payload." })) : (_jsxs("div", { className: "space-y-3", children: [supportResult.error && (_jsx("div", { className: "rounded border border-[#4b1f24] bg-[#1a0f12] px-2.5 py-2 text-[11px] text-[#ffb0b0]", children: supportResult.error })), supportSummaryRows.length > 0 && (_jsx("div", { className: "grid grid-cols-2 gap-2", children: supportSummaryRows.map((row) => (_jsxs("div", { className: "rounded border border-white/[0.05] bg-black/20 px-2.5 py-2", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/22", children: row.label }), _jsx("p", { className: "mt-1 truncate text-[11px] text-white/58", children: row.value })] }, `${row.label}:${row.value}`))) })), supportRecommendations.length > 0 && (_jsxs("div", { className: "rounded border border-[#5f4a22] bg-[#171309]", children: [_jsx("div", { className: "border-b border-[#5f4a22]/50 px-2.5 py-2", children: _jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-[#ffd38a]/80", children: "Repair recommendations" }) }), _jsx("div", { className: "divide-y divide-[#5f4a22]/35", children: supportRecommendations.map((recommendation) => (_jsxs("div", { className: "px-2.5 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "text-[11px] font-medium text-white/64", children: recommendation.title }), _jsx("span", { className: "shrink-0 rounded bg-[#ffd38a]/10 px-1.5 py-0.5 text-[9px] uppercase tracking-[0.1em] text-[#ffd38a]/70", children: recommendation.severity })] }), recommendation.detail && (_jsx("p", { className: "mt-1 text-[10px] leading-relaxed text-white/38", children: recommendation.detail })), recommendation.action && (_jsx("p", { className: "mt-1 text-[10px] leading-relaxed text-[#ffd38a]/58", children: recommendation.action }))] }, recommendation.id))) })] })), _jsx("pre", { className: "max-h-[230px] overflow-auto rounded border border-white/[0.05] bg-black/25 p-3 text-[10px] leading-relaxed text-white/40", children: formatSupportJson(supportResult.raw) })] })) })] })] })] })), tab === 'terminal' && (_jsxs("div", { className: "h-full flex flex-col", children: [_jsxs("div", { className: "px-3 py-2 border-b border-white/[0.06] flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-white/26", children: "Workspace terminal" }), _jsx("p", { className: "text-[11px] text-white/34 truncate", children: terminalCapabilityEnabled
576
+ ? (resolvedTerminalCwd || 'Open a folder to start running commands.')
577
+ : 'Terminal access is disabled for this agent.' })] }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [_jsx("button", { onClick: onResetTerminalCwd, disabled: !terminalCapabilityEnabled, className: "text-[10px] text-white/32 hover:text-white/62 transition-colors disabled:opacity-30", children: "Reset cwd" }), _jsx("button", { onClick: onClearTerminalHistory, disabled: terminalHistory.length === 0, className: "text-[10px] text-white/32 hover:text-white/62 transition-colors disabled:opacity-30", children: "Clear" })] })] }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-3 py-3", children: !terminalCapabilityEnabled ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Enable terminal capability for this agent to run commands from the dock." })) : !terminalReady ? (_jsx("p", { className: "text-[11px] text-white/28", children: "Open or choose a folder first. Terminal commands run inside the conversation workspace." })) : terminalHistory.length === 0 && liveTerminalRuns.length === 0 ? (_jsx("p", { className: "text-[11px] text-white/28", children: "No terminal commands yet. Run a command below and it will stay attached to this conversation." })) : (_jsxs("div", { className: "space-y-1.5", children: [liveTerminalRuns.map((run) => (_jsxs("div", { className: "rounded border border-white/[0.04] bg-black/20 overflow-hidden", children: [_jsx("div", { className: `px-1.5 py-[5px] rounded transition-colors ${expandedLiveTerminalId === run.terminalId ? 'bg-white/[0.03]' : 'hover:bg-white/[0.02]'}`, children: _jsxs("div", { className: "flex items-start gap-1.5", children: [_jsxs("button", { type: "button", onClick: () => setExpandedLiveTerminalId(expandedLiveTerminalId === run.terminalId ? null : run.terminalId), className: "min-w-0 flex-1 inline-flex items-start gap-1.5 text-left", children: [_jsx("span", { className: "mt-[2px] inline-flex h-3 w-3 flex-shrink-0 items-center justify-center", children: _jsx("svg", { className: "w-3 h-3 text-white/25 animate-spin", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { d: "M12 2v4m0 12v4m-7.07-3.93l2.83-2.83m8.48-8.48l2.83-2.83M2 12h4m12 0h4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83", strokeWidth: 1.5, strokeLinecap: "square" }) }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block text-[10px] uppercase tracking-[0.14em] text-white/20", children: "Terminal" }), _jsx("span", { className: "block truncate text-[12px] leading-3 font-mono text-white/50", children: run.command })] })] }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0 pt-[2px]", children: [_jsx("span", { className: "text-[10px] text-[#ffd38a]", children: "Running..." }), _jsx("button", { onClick: () => onStopTerminalRun(run.terminalId), className: "text-[10px] text-white/35 hover:text-white/65 transition-colors", children: "Stop" }), _jsx("button", { type: "button", onClick: () => setExpandedLiveTerminalId(expandedLiveTerminalId === run.terminalId ? null : run.terminalId), className: "flex-shrink-0", children: _jsx("svg", { className: `w-3 h-3 text-white/15 transition-transform ${expandedLiveTerminalId === run.terminalId ? 'rotate-90' : ''}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { d: "M9 6l6 6-6 6", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })] }) }), _jsx("div", { className: `grid transition-[grid-template-rows,opacity] duration-200 ease-out ${expandedLiveTerminalId === run.terminalId ? 'grid-rows-[1fr] opacity-100 mt-0.5' : 'grid-rows-[0fr] opacity-0 mt-0'}`, children: _jsxs("div", { className: "min-h-0 overflow-hidden", children: [_jsx("div", { className: "border-t border-white/[0.04] px-2.5 py-1.5 text-[10px] text-white/20 font-mono truncate", children: run.cwd }), run.stdout.trim() && (_jsxs("div", { className: "border-t border-white/[0.04]", children: [_jsx("div", { className: "px-2.5 py-1 text-[10px] uppercase tracking-[0.12em] text-white/20", children: "Stdout" }), _jsx("pre", { className: "px-2.5 pb-2 whitespace-pre-wrap break-words text-[11px] leading-relaxed font-mono text-white/40", children: run.stdout.trim() })] })), run.stderr.trim() && (_jsxs("div", { className: "border-t border-red-500/10", children: [_jsx("div", { className: "px-2.5 py-1 text-[10px] uppercase tracking-[0.12em] text-[#ffb0b0]/70", children: "Error" }), _jsx("pre", { className: "px-2.5 pb-2 whitespace-pre-wrap break-words text-[11px] leading-relaxed font-mono text-[#f0b7b7]/80", children: run.stderr.trim() })] }))] }) })] }, run.terminalId))), terminalHistory.map((entry) => (_jsxs("div", { className: "rounded border border-white/[0.04] bg-black/20 overflow-hidden", children: [_jsx("div", { className: `px-1.5 py-[5px] rounded transition-colors ${expandedTerminalHistoryId === entry.id ? 'bg-white/[0.03]' : 'hover:bg-white/[0.02]'}`, children: _jsxs("div", { className: "flex items-start gap-1.5", children: [_jsxs("button", { type: "button", onClick: () => setExpandedTerminalHistoryId(expandedTerminalHistoryId === entry.id ? null : entry.id), className: "min-w-0 flex-1 inline-flex items-start gap-1.5 text-left", children: [_jsx("span", { className: "mt-[2px] inline-flex h-3 w-3 flex-shrink-0 items-center justify-center", children: _jsx("span", { className: `block h-[6px] w-[6px] rounded-[2px] ${entry.success ? 'bg-white/[0.22]' : 'bg-[#ff9a9a]'}` }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block text-[10px] uppercase tracking-[0.14em] text-white/20", children: "Terminal" }), _jsx("span", { className: "block truncate text-[12px] leading-3 font-mono text-white/50", children: entry.command })] })] }), _jsxs("div", { className: "flex items-center gap-2 flex-shrink-0 pt-[2px]", children: [_jsx("span", { className: "text-[10px] text-white/20", children: new Date(entry.endedAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) }), _jsx("span", { className: "text-[10px] text-white/20 tabular-nums", children: formatTerminalDuration(entry.durationMs) }), _jsx("span", { className: `text-[10px] ${entry.success ? 'text-[#96e59d]' : 'text-[#ff9a9a]'}`, children: entry.success ? `exit ${entry.exitCode ?? 0}` : (entry.error ? 'failed' : `exit ${entry.exitCode ?? 'error'}`) }), _jsx("button", { onClick: () => onReuseTerminalEntry(entry), className: "text-[10px] text-white/35 hover:text-white/65 transition-colors", children: "Reuse" }), _jsx("button", { type: "button", onClick: () => setExpandedTerminalHistoryId(expandedTerminalHistoryId === entry.id ? null : entry.id), className: "flex-shrink-0", children: _jsx("svg", { className: `w-3 h-3 text-white/15 transition-transform ${expandedTerminalHistoryId === entry.id ? 'rotate-90' : ''}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { d: "M9 6l6 6-6 6", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })] }) }), _jsx("div", { className: `grid transition-[grid-template-rows,opacity] duration-200 ease-out ${expandedTerminalHistoryId === entry.id ? 'grid-rows-[1fr] opacity-100 mt-0.5' : 'grid-rows-[0fr] opacity-0 mt-0'}`, children: _jsxs("div", { className: "min-h-0 overflow-hidden", children: [_jsx("div", { className: "border-t border-white/[0.04] px-2.5 py-1.5 text-[10px] text-white/20 font-mono truncate", children: entry.cwd }), entry.stdout.trim() && (_jsxs("div", { className: "border-t border-white/[0.04]", children: [_jsx("div", { className: "px-2.5 py-1 text-[10px] uppercase tracking-[0.12em] text-white/20", children: "Stdout" }), _jsx("pre", { className: "px-2.5 pb-2 whitespace-pre-wrap break-words text-[11px] leading-relaxed font-mono text-white/40", children: entry.stdout.trim() })] })), (entry.stderr.trim() || entry.error?.trim()) && (_jsxs("div", { className: "border-t border-red-500/10", children: [_jsx("div", { className: "px-2.5 py-1 text-[10px] uppercase tracking-[0.12em] text-[#ffb0b0]/70", children: "Error" }), _jsx("pre", { className: "px-2.5 pb-2 whitespace-pre-wrap break-words text-[11px] leading-relaxed font-mono text-[#f0b7b7]/80", children: [entry.error?.trim(), entry.stderr.trim()].filter(Boolean).join('\n\n') })] }))] }) })] }, entry.id)))] })) }), _jsx("div", { className: "border-t border-white/[0.06] px-3 py-2 bg-[#08080a]", children: _jsxs("div", { className: "grid grid-cols-[minmax(0,220px)_minmax(0,1fr)_auto] gap-2", children: [_jsx("input", { value: terminalDraftCwd, onChange: (event) => onChangeTerminalCwd(event.target.value), placeholder: resolvedTerminalCwd || 'Working directory', className: "h-8 rounded-[4px] border border-white/[0.06] bg-black/20 px-2.5 text-[11px] text-white/70 placeholder:text-white/18 outline-none focus:border-white/[0.12]" }), _jsx("input", { value: terminalDraftInput, onChange: (event) => onChangeTerminalInput(event.target.value), onKeyDown: (event) => {
578
+ if (event.key === 'Enter' && !event.shiftKey) {
579
+ event.preventDefault();
580
+ onRunTerminalCommand();
581
+ }
582
+ }, placeholder: terminalReady ? 'Run a workspace command...' : 'Open a folder to use the terminal', disabled: !terminalCapabilityEnabled, className: "h-8 rounded-[4px] border border-white/[0.06] bg-black/20 px-2.5 text-[11px] text-white/78 placeholder:text-white/18 outline-none focus:border-white/[0.12] disabled:opacity-35" }), _jsx("button", { onClick: onRunTerminalCommand, disabled: !terminalReady || !terminalDraftInput.trim(), className: "h-8 px-3 rounded-[4px] bg-white/[0.08] hover:bg-white/[0.12] text-[10px] uppercase tracking-[0.12em] text-white/72 transition-colors disabled:opacity-35", children: "Run" })] }) })] }))] })] }));
583
+ }
584
+ //# sourceMappingURL=AgentWorkbenchPanel.js.map