@xenosystem/agent-interface-ui 0.1.183 → 0.1.185

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 (136) hide show
  1. package/dist/agent.css +824 -791
  2. package/dist/components/agent/AgentAuthGate.d.ts.map +1 -1
  3. package/dist/components/agent/AgentAuthGate.js +6 -6
  4. package/dist/components/agent/AgentAuthGate.js.map +1 -1
  5. package/dist/components/agent/AgentIdentityGenerator.js +1 -1
  6. package/dist/components/agent/AgentIdentityGenerator.js.map +1 -1
  7. package/dist/components/agent/AgentInterface.d.ts +1 -0
  8. package/dist/components/agent/AgentInterface.d.ts.map +1 -1
  9. package/dist/components/agent/AgentInterface.js +87 -92
  10. package/dist/components/agent/AgentInterface.js.map +1 -1
  11. package/dist/components/agent/AgentOnboarding.js +4 -4
  12. package/dist/components/agent/AgentOnboarding.js.map +1 -1
  13. package/dist/components/agent/AgentPreviewPanel.js +1 -1
  14. package/dist/components/agent/AgentPreviewPanel.js.map +1 -1
  15. package/dist/components/agent/AgentPtyTerminalPanel.js +3 -3
  16. package/dist/components/agent/AgentPtyTerminalPanel.js.map +1 -1
  17. package/dist/components/agent/AgentWorkbenchCliPanel.js +11 -11
  18. package/dist/components/agent/AgentWorkbenchCliPanel.js.map +1 -1
  19. package/dist/components/agent/AgentWorkbenchPanel.js +30 -30
  20. package/dist/components/agent/AgentWorkbenchPanel.js.map +1 -1
  21. package/dist/components/agent/AgentWorkspaceBrowserPanel.js +1 -1
  22. package/dist/components/agent/AgentWorkspaceBrowserPanel.js.map +1 -1
  23. package/dist/components/agent/AgentsWorkspaceView.d.ts.map +1 -1
  24. package/dist/components/agent/AgentsWorkspaceView.js +2 -9
  25. package/dist/components/agent/AgentsWorkspaceView.js.map +1 -1
  26. package/dist/components/agent/ArchivedConversationsDialog.js +1 -1
  27. package/dist/components/agent/ArchivedConversationsDialog.js.map +1 -1
  28. package/dist/components/agent/MissionControl.d.ts +51 -0
  29. package/dist/components/agent/MissionControl.d.ts.map +1 -0
  30. package/dist/components/agent/MissionControl.js +166 -0
  31. package/dist/components/agent/MissionControl.js.map +1 -0
  32. package/dist/components/agent/OwnedWorkforceView.d.ts.map +1 -1
  33. package/dist/components/agent/OwnedWorkforceView.js +11 -5
  34. package/dist/components/agent/OwnedWorkforceView.js.map +1 -1
  35. package/dist/components/agent/PermissionDialog.js +1 -1
  36. package/dist/components/agent/PluginManager.js +3 -3
  37. package/dist/components/agent/PluginManager.js.map +1 -1
  38. package/dist/components/agent/ProjectsWorkspaceView.d.ts.map +1 -1
  39. package/dist/components/agent/ProjectsWorkspaceView.js +45 -26
  40. package/dist/components/agent/ProjectsWorkspaceView.js.map +1 -1
  41. package/dist/components/agent/PublisherTrustPanel.js +1 -1
  42. package/dist/components/agent/PublisherTrustPanel.js.map +1 -1
  43. package/dist/components/agent/ScheduledWorkspaceView.js +4 -4
  44. package/dist/components/agent/ScheduledWorkspaceView.js.map +1 -1
  45. package/dist/components/agent/TeamsWorkspaceView.d.ts.map +1 -1
  46. package/dist/components/agent/TeamsWorkspaceView.js +3 -5
  47. package/dist/components/agent/TeamsWorkspaceView.js.map +1 -1
  48. package/dist/components/agent/WorkspacePersistenceNotice.js +2 -2
  49. package/dist/components/agent/WorkspacePersistenceNotice.js.map +1 -1
  50. package/dist/components/agent/acp/AcpAgentConfigForm.js +1 -1
  51. package/dist/components/agent/acp/AcpAgentConfigForm.js.map +1 -1
  52. package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js +2 -2
  53. package/dist/components/agent/acp/AcpAgentDiagnosticsPanel.js.map +1 -1
  54. package/dist/components/agent/acp/AcpAgentManager.js +12 -12
  55. package/dist/components/agent/acp/AcpAgentManager.js.map +1 -1
  56. package/dist/components/agent/acp/AcpAgentTestResultPanel.js +1 -1
  57. package/dist/components/agent/acp/AcpAgentTestResultPanel.js.map +1 -1
  58. package/dist/components/agent/acp/AcpApprovalPanel.js +2 -2
  59. package/dist/components/agent/acp/AcpApprovalPanel.js.map +1 -1
  60. package/dist/components/agent/acp/AcpCertificationPanel.js +2 -2
  61. package/dist/components/agent/acp/AcpCertificationPanel.js.map +1 -1
  62. package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js +1 -1
  63. package/dist/components/agent/acp/AcpLiveProviderWorkflowPanel.js.map +1 -1
  64. package/dist/components/agent/acp/AcpProviderManagerPanel.js +1 -1
  65. package/dist/components/agent/acp/AcpProviderManagerPanel.js.map +1 -1
  66. package/dist/components/agent/acp/AcpProviderModelsPanel.js +1 -1
  67. package/dist/components/agent/acp/AcpProviderModelsPanel.js.map +1 -1
  68. package/dist/components/agent/acp/AcpSupportBundlePanel.js +1 -1
  69. package/dist/components/agent/acp/AcpSupportBundlePanel.js.map +1 -1
  70. package/dist/components/agent/settings/EntitySettingsLayout.d.ts.map +1 -1
  71. package/dist/components/agent/settings/EntitySettingsLayout.js +17 -11
  72. package/dist/components/agent/settings/EntitySettingsLayout.js.map +1 -1
  73. package/dist/components/agent/settings/SettingsNavigation.d.ts +5 -1
  74. package/dist/components/agent/settings/SettingsNavigation.d.ts.map +1 -1
  75. package/dist/components/agent/settings/SettingsNavigation.js +16 -17
  76. package/dist/components/agent/settings/SettingsNavigation.js.map +1 -1
  77. package/dist/components/agent/settings/sections/AccountWorkspacePanel.js +1 -1
  78. package/dist/components/agent/settings/sections/AccountWorkspacePanel.js.map +1 -1
  79. package/dist/components/agent/settings/sections/AppearanceSection.d.ts +5 -0
  80. package/dist/components/agent/settings/sections/AppearanceSection.d.ts.map +1 -0
  81. package/dist/components/agent/settings/sections/AppearanceSection.js +17 -0
  82. package/dist/components/agent/settings/sections/AppearanceSection.js.map +1 -0
  83. package/dist/components/agent/settings/sections/DangerZoneSection.js +4 -4
  84. package/dist/components/agent/settings/sections/DangerZoneSection.js.map +1 -1
  85. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js +5 -5
  86. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js.map +1 -1
  87. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js +1 -1
  88. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js.map +1 -1
  89. package/dist/components/agent/settings/sections/ExportBackupSection.js +2 -2
  90. package/dist/components/agent/settings/sections/ExportBackupSection.js.map +1 -1
  91. package/dist/components/agent/settings/sections/GeneralSection.js +3 -3
  92. package/dist/components/agent/settings/sections/GeneralSection.js.map +1 -1
  93. package/dist/components/agent/settings/sections/IntegrationsSection.js +1 -1
  94. package/dist/components/agent/settings/sections/IntegrationsSection.js.map +1 -1
  95. package/dist/components/agent/settings/sections/NotificationsSection.js +1 -1
  96. package/dist/components/agent/settings/sections/NotificationsSection.js.map +1 -1
  97. package/dist/components/agent/settings/sections/ResourceLimitsSection.js +2 -2
  98. package/dist/components/agent/settings/sections/ResourceLimitsSection.js.map +1 -1
  99. package/dist/components/agent/settings/sections/SecurityComplianceSection.js +1 -1
  100. package/dist/components/agent/settings/sections/SecurityComplianceSection.js.map +1 -1
  101. package/dist/components/agent/settings/sections/UsageAnalyticsSection.js +1 -1
  102. package/dist/components/agent/settings/sections/UsageAnalyticsSection.js.map +1 -1
  103. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js +10 -10
  104. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js.map +1 -1
  105. package/dist/components/agent/settings/sections/WorkspaceKeysPanel.js +1 -1
  106. package/dist/components/agent/settings/sections/WorkspaceKeysPanel.js.map +1 -1
  107. package/dist/components/agent/settings/shared/CheckboxField.js +1 -1
  108. package/dist/components/agent/settings/shared/CheckboxField.js.map +1 -1
  109. package/dist/components/agent/settings/shared/InputField.js +2 -2
  110. package/dist/components/agent/settings/shared/InputField.js.map +1 -1
  111. package/dist/components/agent/settings/shared/MembersTable.js +1 -1
  112. package/dist/components/agent/settings/shared/MembersTable.js.map +1 -1
  113. package/dist/components/agent/settings/shared/SettingRow.js +1 -1
  114. package/dist/components/agent/settings/shared/SettingsCard.js +1 -1
  115. package/dist/components/agent/settings/shared/SettingsCard.js.map +1 -1
  116. package/dist/components/agent/settings/shared/ToggleSwitch.js +1 -1
  117. package/dist/components/agent/settings/shared/ToggleSwitch.js.map +1 -1
  118. package/dist/components/agent/settings/shared/UsageChart.js +2 -2
  119. package/dist/components/agent/settings/shared/UsageChart.js.map +1 -1
  120. package/dist/components/agent/settings/shared/WorkspaceRulesControl.js +1 -1
  121. package/dist/components/agent/settings/shared/WorkspaceRulesControl.js.map +1 -1
  122. package/dist/components/product/XenoAgentWorkspaceSelector.js +2 -2
  123. package/dist/components/product/XenoAgentWorkspaceSelector.js.map +1 -1
  124. package/dist/components/workspace/WorkspaceCreationWizard.js +1 -1
  125. package/dist/components/workspace/WorkspaceCreationWizard.js.map +1 -1
  126. package/dist/stores/appearanceStore.d.ts +26 -0
  127. package/dist/stores/appearanceStore.d.ts.map +1 -0
  128. package/dist/stores/appearanceStore.js +49 -0
  129. package/dist/stores/appearanceStore.js.map +1 -0
  130. package/dist/stores/entitySettingsStore.d.ts +3 -1
  131. package/dist/stores/entitySettingsStore.d.ts.map +1 -1
  132. package/dist/stores/entitySettingsStore.js +4 -3
  133. package/dist/stores/entitySettingsStore.js.map +1 -1
  134. package/package.json +9 -8
  135. package/src/agent.css +18 -27
  136. package/src/theme.css +91 -0
@@ -119,27 +119,27 @@ function isActiveSubagentRun(status) {
119
119
  }
120
120
  function subagentStatusClass(status) {
121
121
  if (status === 'completed')
122
- return 'bg-[#96e59d]';
122
+ return 'bg-xs-ok';
123
123
  if (status === 'failed')
124
- return 'bg-[#ff9a9a]';
124
+ return 'bg-xs-danger';
125
125
  if (status === 'cancelled')
126
126
  return 'bg-white/20';
127
127
  if (status === 'waiting-for-permission' || status === 'waiting-for-user')
128
- return 'bg-[#ffd38a]';
128
+ return 'bg-xs-warn';
129
129
  if (status === 'launch-requested')
130
- return 'bg-[#9fb7ff]';
131
- return 'bg-[#8ad7ff]';
130
+ return 'bg-xs-info';
131
+ return 'bg-xs-info';
132
132
  }
133
133
  function subagentAttemptStatusClass(status) {
134
134
  if (status === 'completed')
135
- return 'bg-[#96e59d]/12 text-[#96e59d]';
135
+ return 'bg-xs-ok/12 text-xs-ok';
136
136
  if (status === 'failed')
137
- return 'bg-[#ff9a9a]/12 text-[#ffb0b0]';
137
+ return 'bg-xs-danger/12 text-xs-danger';
138
138
  if (status === 'cancelled' || status === 'expired')
139
139
  return 'bg-white/[0.06] text-white/42';
140
140
  if (status === 'launch-requested')
141
- return 'bg-[#9fb7ff]/12 text-[#c5d0ff]';
142
- return 'bg-[#8ad7ff]/12 text-[#8ad7ff]';
141
+ return 'bg-xs-info/12 text-xs-info';
142
+ return 'bg-xs-info/12 text-xs-info';
143
143
  }
144
144
  function formatSubagentAttemptTime(timestamp) {
145
145
  if (typeof timestamp !== 'number' || !Number.isFinite(timestamp))
@@ -375,15 +375,15 @@ export function AgentWorkbenchPanel(props) {
375
375
  }, 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 === 'remote' && _jsx("div", { className: "h-full overflow-y-auto", children: _jsx(RemoteControlPanel, {}) }), 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) => {
376
376
  const toolCount = message.toolCalls?.length || 0;
377
377
  const selected = selectedTraceMessage?.id === message.id;
378
- 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));
379
- })) }), _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) => {
378
+ 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-xs-danger", children: "error" })] })] }, message.id));
379
+ })) }), _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-xs-danger' : '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-xs-danger-line bg-xs-danger-bg px-3 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-[11px] text-xs-danger 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-xs-danger/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) => {
380
380
  if (event.key === 'Enter') {
381
381
  event.preventDefault();
382
382
  onCodeSearch();
383
383
  }
384
384
  }, 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
385
385
  ? 'bg-[var(--xeno-accent-soft)] text-[color:var(--xeno-ink-primary)]'
386
- : '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
386
+ : '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-xs-danger-line bg-xs-danger-bg px-3 py-1.5 text-[11px] text-xs-danger", 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
387
387
  ? `${codeWorkbench.stats.fileCount || 0} files / ${codeWorkbench.stats.symbolCount || 0} symbols / ${codeWorkbench.stats.dependencyEdgeCount || 0} edges`
388
388
  : 'No index loaded' }), _jsx("p", { className: "text-[10px] text-white/20", children: codeWorkbench.loading
389
389
  ? 'Working...'
@@ -398,10 +398,10 @@ export function AgentWorkbenchPanel(props) {
398
398
  }) }))) : (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) => {
399
399
  const selected = selectedCodeSymbolIds.has(symbol.id);
400
400
  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));
401
- }) }))) })] }), _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) => {
401
+ }) }))) })] }), _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-xs-danger' : diagnostic.severity === 'warning' ? 'text-xs-warn' : 'text-xs-info'}`, 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-xs-ok' : 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) => {
402
402
  const attached = codeWorkbench.attachedPackIds.includes(pack.id);
403
- 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));
404
- })) }), 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
403
+ 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-xs-ok", 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));
404
+ })) }), 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-xs-danger-line bg-xs-danger-bg px-3 py-1.5 text-[11px] text-xs-danger", 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
405
405
  ? 'No status loaded'
406
406
  : !engineeringWorkbench.git.isGitRepo
407
407
  ? 'Not a git repository'
@@ -414,7 +414,7 @@ export function AgentWorkbenchPanel(props) {
414
414
  typeof file.additions === 'number' ? `+${file.additions}` : null,
415
415
  typeof file.deletions === 'number' ? `-${file.deletions}` : null,
416
416
  ].filter(Boolean).join(' / ') })] }), _jsx("button", { type: "button", onClick: () => onEngineeringPreviewDiff([file.relativePath]), className: "text-[10px] text-white/30 hover:text-white/65 transition-colors", children: "Diff" })] }) }, `${file.status}:${file.path}`));
417
- }) })) }), _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' && (
417
+ }) })) }), _jsx("div", { className: "border-t border-white/[0.06] px-3 py-2 bg-xs-frame", 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-xs-danger-bg text-[10px] text-xs-danger hover:bg-xs-danger-line 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-xs-danger' : issue.severity === 'warning' ? 'text-xs-warn' : 'text-xs-info'}`, 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-xs-warn", 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-xs-ok' : 'text-xs-danger'}`, 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' && (
418
418
  /*
419
419
  * ADE §5.8, MOUNTED.
420
420
  *
@@ -497,19 +497,19 @@ export function AgentWorkbenchPanel(props) {
497
497
  ? `${engineeringWorkbench.checkpointCompare.filesChanged.length} changed files between ${engineeringWorkbench.checkpointCompare.from?.checkpointId || 'A'} and ${engineeringWorkbench.checkpointCompare.to?.checkpointId || 'B'}`
498
498
  : '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"] }), formatContextPressure(engineeringWorkbench.contextPressure) && (_jsx("p", { className: "text-[10px] text-white/28 tabular-nums", children: formatContextPressure(engineeringWorkbench.contextPressure) }))] }), _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, 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
499
499
  ? `${subagentWorkbench.runs.length} linked runs / ${activeSubagentRunCount} active`
500
- : '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", { "aria-label": "Subagent adapter status", className: `rounded px-2 py-1 text-[10px] uppercase tracking-[0.12em] ${subagentAdapterHealth === 'available'
501
- ? 'bg-[#96e59d]/10 text-[#96e59d]'
500
+ : '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-xs-info 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-xs-warn/18 bg-xs-warn/8 hover:bg-xs-warn/12 text-[10px] uppercase tracking-[0.12em] text-xs-warn 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-xs-danger-line bg-xs-danger-bg px-3 py-1.5 text-[11px] text-xs-danger", 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", { "aria-label": "Subagent adapter status", className: `rounded px-2 py-1 text-[10px] uppercase tracking-[0.12em] ${subagentAdapterHealth === 'available'
501
+ ? 'bg-xs-ok/10 text-xs-ok'
502
502
  : subagentAdapterHealth === 'unavailable'
503
- ? 'bg-[#ff9a9a]/10 text-[#ffb0b0]'
504
- : 'bg-[#ffd38a]/10 text-[#ffd38a]'}`, children: ["Adapter ", subagentAdapterHealth] }), _jsx("span", { className: "text-[10px] text-white/28", children: subagentWorkbench.schedulerStatusLoading
503
+ ? 'bg-xs-danger/10 text-xs-danger'
504
+ : 'bg-xs-warn/10 text-xs-warn'}`, children: ["Adapter ", subagentAdapterHealth] }), _jsx("span", { className: "text-[10px] text-white/28", children: subagentWorkbench.schedulerStatusLoading
505
505
  ? 'Loading scheduler status...'
506
506
  : subagentSchedulerStatus
507
507
  ? `Scheduler ${subagentSchedulerStatus.running ? 'running' : 'stopped'} / adapters ${subagentSchedulerStatus.adapterIds.join(', ') || 'none'}`
508
- : '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
508
+ : 'Scheduler status unavailable' }), subagentSchedulerStatus?.lastError && (_jsx("span", { className: "text-[10px] text-xs-danger/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
509
509
  || !!subagentDelegationDisabledReason
510
510
  || !delegationTargetId
511
511
  || !delegationObjective.trim()
512
- || !!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: buildSubagentRunTree(subagentWorkbench.runs).map(({ run, depth, hasChildren }) => {
512
+ || !!selectedDelegationTarget?.disabledReason, className: "h-7 px-2.5 rounded-[4px] bg-xs-info/12 text-[10px] uppercase tracking-[0.12em] text-xs-info hover:bg-xs-info/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-xs-info/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-xs-info/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-xs-info/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-xs-info/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-xs-info/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-xs-info/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-xs-ok/78' : 'text-xs-danger/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: buildSubagentRunTree(subagentWorkbench.runs).map(({ run, depth, hasChildren }) => {
513
513
  const selected = selectedSubagentRun?.id === run.id;
514
514
  return (_jsx("button", { type: "button", onClick: () => onSubagentSelectRun(run), onDoubleClick: () => onSubagentOpenConversation(run), onKeyDown: (event) => {
515
515
  if (event.key !== 'Enter')
@@ -520,17 +520,17 @@ export function AgentWorkbenchPanel(props) {
520
520
  ? 'border-white/[0.14] bg-white/[0.055]'
521
521
  : '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: [_jsxs("span", { className: "block text-[12px] text-white/66 truncate", children: [depth > 0 ? '\u2514\u2500 ' : '', run.childAgentName || run.childAgentId, hasChildren ? ' \u25b8' : ''] }), _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));
522
522
  }) })) })] }), _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: selectedSubagentRun.status === 'cancellation-requested' ? 'Retry stop' : '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
523
- ? 'border-[#4b1f24] bg-[#1a0f12]'
524
- : '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: [
523
+ ? 'border-xs-danger-line bg-xs-danger-bg'
524
+ : '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-xs-danger/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: [
525
525
  `worker ${attempt.workerId}`,
526
526
  attempt.childRequestId ? `request ${attempt.childRequestId}` : null,
527
527
  attempt.runningAt ? `running ${formatSubagentAttemptTime(attempt.runningAt)}` : `launch ${formatSubagentAttemptTime(attempt.launchRequestedAt)}`,
528
528
  attempt.endedAt ? `ended ${formatSubagentAttemptTime(attempt.endedAt)}` : null,
529
- ].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
529
+ ].filter(Boolean).join(' / ') }), attempt.error && (_jsx("p", { className: "mt-1 text-[10px] leading-relaxed text-xs-danger/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
530
530
  ? 'loading'
531
- : `${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
531
+ : `${subagentWorkbench.runtimeEvents.length} events` })] }), subagentWorkbench.runtimeEventsError ? (_jsx("p", { className: "px-2.5 py-2 text-[11px] text-xs-danger", 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
532
532
  ? selectedSubagentRun.capabilityMatch.reasons
533
- : ['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: () => {
533
+ : ['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-xs-warn/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-xs-danger-line bg-xs-danger-bg px-3 py-1.5 text-[11px] text-xs-danger", 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-xs-warn/15 text-xs-warn' : supportApi ? 'bg-xs-ok/12 text-xs-ok' : 'bg-xs-danger/12 text-xs-danger'}`, 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: () => {
534
534
  if (!supportApi)
535
535
  return;
536
536
  void runSupportAction('Create support bundle', () => supportApi.createBundle({
@@ -556,11 +556,11 @@ export function AgentWorkbenchPanel(props) {
556
556
  if (!supportApi)
557
557
  return;
558
558
  void runSupportAction('Capture profile', () => supportApi.profile());
559
- }, 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
559
+ }, 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-xs-danger-line bg-xs-danger-bg px-2.5 py-2 text-[11px] leading-relaxed text-xs-danger", 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
560
560
  ? `${supportResult.label} / ${new Date(supportResult.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`
561
- : '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
561
+ : '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-xs-ok/12 text-xs-ok' : 'bg-xs-danger/12 text-xs-danger'}`, 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-xs-danger-line bg-xs-danger-bg px-2.5 py-2 text-[11px] text-xs-danger", 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-xs-warn-line bg-xs-warn-bg", children: [_jsx("div", { className: "border-b border-xs-warn-line/50 px-2.5 py-2", children: _jsx("p", { className: "text-[10px] uppercase tracking-[0.12em] text-xs-warn/80", children: "Repair recommendations" }) }), _jsx("div", { className: "divide-y divide-xs-warn-line/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-xs-warn/10 px-1.5 py-0.5 text-[9px] uppercase tracking-[0.1em] text-xs-warn/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-xs-warn/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
562
562
  ? (resolvedTerminalCwd || (terminalReady ? 'Conversation workspace (managed)' : 'Open a folder to start running commands.'))
563
- : '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) => {
563
+ : '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-xs-warn", 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-xs-danger/70", children: "Error" }), _jsx("pre", { className: "px-2.5 pb-2 whitespace-pre-wrap break-words text-[11px] leading-relaxed font-mono text-xs-danger/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-xs-danger'}` }) }), _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-xs-ok' : 'text-xs-danger'}`, 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-xs-danger/70", children: "Error" }), _jsx("pre", { className: "px-2.5 pb-2 whitespace-pre-wrap break-words text-[11px] leading-relaxed font-mono text-xs-danger/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-xs-frame", 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) => {
564
564
  if (event.key === 'Enter' && !event.shiftKey) {
565
565
  event.preventDefault();
566
566
  onRunTerminalCommand();