@datalayer/agent-runtimes 1.3.88 → 1.3.90

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 (258) hide show
  1. package/lib/Agent.js +2 -18
  2. package/lib/AgentDocument.js +5 -55
  3. package/lib/AgentNode.js +31 -208
  4. package/lib/AgentNotebook.js +5 -59
  5. package/lib/agent-node/AgentNodeGallery.js +23 -111
  6. package/lib/agents/AgentDetails.js +36 -274
  7. package/lib/agents/AgentRuntimeChat.js +1 -8
  8. package/lib/chat/Chat.js +7 -46
  9. package/lib/chat/ChatFloating.js +15 -100
  10. package/lib/chat/ChatInline.js +5 -47
  11. package/lib/chat/ChatPopupStandalone.js +5 -53
  12. package/lib/chat/ChatSidebar.js +4 -51
  13. package/lib/chat/ChatStandalone.js +4 -45
  14. package/lib/chat/EphemeralSurfaceControl.js +5 -25
  15. package/lib/chat/assistant/AssistantContextMenu.d.ts +8 -0
  16. package/lib/chat/assistant/AssistantContextMenu.js +17 -1
  17. package/lib/chat/assistant/AssistantStage.js +6 -25
  18. package/lib/chat/assistant/BalloonParts.js +8 -40
  19. package/lib/chat/assistant/BalloonVisual.js +2 -2
  20. package/lib/chat/assistant/ConversationBalloon.js +2 -11
  21. package/lib/chat/assistant/DecisionAsk.js +3 -3
  22. package/lib/chat/assistant/SandboxDetailsDialog.js +3 -17
  23. package/lib/chat/assistant/SpeechBalloon.js +14 -78
  24. package/lib/chat/base/ChatBase.js +37 -172
  25. package/lib/chat/display/EmptyState.js +7 -35
  26. package/lib/chat/display/FloatingBrandButton.js +4 -34
  27. package/lib/chat/display/PoweredByTag.js +3 -14
  28. package/lib/chat/document/EphemeralDocument.js +3 -18
  29. package/lib/chat/header/ChatHeader.js +1 -17
  30. package/lib/chat/header/ChatHeaderBase.js +2 -24
  31. package/lib/chat/header/ChatViewModeToggle.js +7 -29
  32. package/lib/chat/indicators/McpStatusIndicator.js +3 -12
  33. package/lib/chat/indicators/SandboxStatusIndicator.js +6 -34
  34. package/lib/chat/indicators/SkillsStatusIndicator.js +3 -12
  35. package/lib/chat/indicators/TypingDots.js +1 -11
  36. package/lib/chat/messages/ChatMessageList.js +58 -185
  37. package/lib/chat/messages/ChatMessages.js +15 -79
  38. package/lib/chat/messages/FormSubmissionMessage.js +2 -33
  39. package/lib/chat/messages/NotebookToolSurfaces.js +12 -41
  40. package/lib/chat/messages/TurnFooter.js +4 -10
  41. package/lib/chat/notebook/EphemeralNotebook.js +2 -10
  42. package/lib/chat/parts/ReasoningPart.js +2 -16
  43. package/lib/chat/parts/TextPart.js +2 -12
  44. package/lib/chat/parts/ToolPart.js +16 -90
  45. package/lib/chat/presence/Presence.js +5 -33
  46. package/lib/chat/prompt/FloatingCard.js +1 -13
  47. package/lib/chat/prompt/InputPrompt.js +1 -6
  48. package/lib/chat/prompt/InputPromptBase.js +4 -17
  49. package/lib/chat/prompt/InputPromptLexical.js +44 -45
  50. package/lib/chat/prompt/InputPromptText.js +1 -1
  51. package/lib/chat/prompt/footer/InPromptFooter.js +1 -8
  52. package/lib/chat/prompt/menus/AgentsMenu.js +1 -1
  53. package/lib/chat/prompt/menus/InlineAgentsMenu.js +1 -1
  54. package/lib/chat/prompt/menus/ModelSelector.js +1 -5
  55. package/lib/chat/prompt/menus/SkillsMenu.js +3 -30
  56. package/lib/chat/prompt/menus/SuggestionsMenu.js +1 -1
  57. package/lib/chat/prompt/menus/ToolsMenu.js +4 -48
  58. package/lib/chat/prompt/plugins/AgentMentionPlugin.js +2 -9
  59. package/lib/chat/prompt/plugins/CommandPlugin.js +2 -9
  60. package/lib/chat/prompt/plugins/MentionChip.js +1 -15
  61. package/lib/chat/prompt/stack.js +1 -19
  62. package/lib/chat/tools/A2AAgentDialog.js +9 -42
  63. package/lib/chat/tools/SubagentActivity.js +5 -22
  64. package/lib/chat/tools/ToolApprovalBanner.js +4 -34
  65. package/lib/chat/tools/ToolApprovalDialog.js +4 -19
  66. package/lib/chat/tools/ToolCallDisplay.js +12 -97
  67. package/lib/chat/usage/ContextPie.js +4 -45
  68. package/lib/components/a2ui/datalayer/Chart.js +4 -10
  69. package/lib/components/a2ui/datalayer/Chat.js +2 -10
  70. package/lib/components/a2ui/datalayer/Download.js +1 -1
  71. package/lib/components/a2ui/datalayer/Evidence.js +1 -15
  72. package/lib/components/a2ui/datalayer/FileUpload.js +1 -12
  73. package/lib/components/a2ui/datalayer/Table.js +9 -17
  74. package/lib/components/a2ui/datalayer/formWidgets.js +3 -2
  75. package/lib/components/a2ui/datalayer/parts.js +1 -16
  76. package/lib/components/agents/AgentSummary.js +1 -51
  77. package/lib/components/cards/NotificationEventCard.js +6 -72
  78. package/lib/components/cards/OutputCard.js +4 -48
  79. package/lib/components/cards/ToolApprovalCard.js +2 -35
  80. package/lib/components/code-sandboxes/CodeSandboxCellVariables.js +1 -1
  81. package/lib/components/code-sandboxes/CodeSandboxEnvironmentSelect.js +4 -14
  82. package/lib/components/code-sandboxes/CodeSandboxPicker.js +16 -21
  83. package/lib/components/code-sandboxes/CodeSandboxVariables.js +2 -2
  84. package/lib/components/scheduler/ScheduleMenu.js +5 -10
  85. package/lib/components/specs/SpecPayloadPreview.js +1 -26
  86. package/lib/components/teams/A2ATeamGraph.d.ts +4 -3
  87. package/lib/components/teams/A2ATeamGraph.js +25 -71
  88. package/lib/components/teams/AnswerSurfacesView.js +2 -2
  89. package/lib/components/teams/NotebookPreview.js +1 -10
  90. package/lib/components/teams/NotebookPreviewView.js +2 -3
  91. package/lib/components/teams/SceneTranscript.js +3 -17
  92. package/lib/components/teams/SceneView.js +1 -8
  93. package/lib/components/teams/TeamNotebook.js +5 -13
  94. package/lib/components/teams/TeamNotebookView.js +2 -12
  95. package/lib/components/teams/index.d.ts +1 -0
  96. package/lib/components/teams/index.js +1 -0
  97. package/lib/components/teams/useBalloonRoom.d.ts +39 -0
  98. package/lib/components/teams/useBalloonRoom.js +89 -0
  99. package/lib/config/AgentConfiguration.js +22 -225
  100. package/lib/context/ContextDistribution.js +7 -41
  101. package/lib/context/ContextInspector.js +9 -107
  102. package/lib/context/ContextPanel.js +11 -86
  103. package/lib/context/ContextUsage.js +6 -34
  104. package/lib/context/CostTracker.js +7 -42
  105. package/lib/context/MessageHistory.js +3 -37
  106. package/lib/context/TurnGraphChart.js +9 -41
  107. package/lib/examples/A2UiAgentExample.js +6 -108
  108. package/lib/examples/A2UiComponentsGalleryExample.js +1 -1
  109. package/lib/examples/A2UiContactCardExample.js +1 -1
  110. package/lib/examples/A2UiJupyterOutputExample.js +25 -125
  111. package/lib/examples/A2UiRestaurantExample.js +1 -1
  112. package/lib/examples/A2UiViewerExample.js +1 -1
  113. package/lib/examples/AgUiAgenticExample.js +3 -35
  114. package/lib/examples/AgUiBackendToolRenderingExample.js +2 -25
  115. package/lib/examples/AgUiHaikuGenUiExample.js +2 -32
  116. package/lib/examples/AgUiHumanInTheLoopExample.js +5 -59
  117. package/lib/examples/AgUiSharedStateExample.js +6 -56
  118. package/lib/examples/AgUiToolsBasedGenUiExample.js +25 -120
  119. package/lib/examples/AgentA2AExample.js +1 -15
  120. package/lib/examples/AgentA2ATeamExample.js +6 -30
  121. package/lib/examples/AgentCheckpointsExample.js +11 -145
  122. package/lib/examples/AgentCodeSandboxExample.js +5 -108
  123. package/lib/examples/AgentCodeSandboxesExample.js +3 -30
  124. package/lib/examples/AgentCodemodeExample.js +9 -85
  125. package/lib/examples/AgentCompactionExample.js +3 -64
  126. package/lib/examples/AgentDecideExample.js +1 -13
  127. package/lib/examples/AgentEvalsExample.js +5 -60
  128. package/lib/examples/AgentGuardrailsExample.js +4 -28
  129. package/lib/examples/AgentHooksExample.js +1 -1
  130. package/lib/examples/AgentInferenceProviderExample.js +5 -96
  131. package/lib/examples/AgentMCPExample.js +7 -105
  132. package/lib/examples/AgentMemoryExample.js +5 -74
  133. package/lib/examples/AgentMonitoringExample.js +7 -53
  134. package/lib/examples/AgentNotificationsExample.js +3 -61
  135. package/lib/examples/AgentOtelExample.js +3 -72
  136. package/lib/examples/AgentOutputsExample.js +6 -81
  137. package/lib/examples/AgentParametersExample.js +2 -37
  138. package/lib/examples/AgentSkillsExample.js +3 -45
  139. package/lib/examples/AgentSubagentsExample.js +6 -56
  140. package/lib/examples/AgentToolApprovalsExample.js +1 -11
  141. package/lib/examples/AgentTriggersExample.js +29 -239
  142. package/lib/examples/AgentspecsExample.js +6 -60
  143. package/lib/examples/AssistantExample.js +5 -5
  144. package/lib/examples/AssistantGalleryExample.js +8 -65
  145. package/lib/examples/CellExample.js +1 -6
  146. package/lib/examples/ChatCustomExample.js +2 -31
  147. package/lib/examples/ChatExample.js +1 -9
  148. package/lib/examples/ChatStandaloneExample.js +3 -37
  149. package/lib/examples/CopilotKitLexicalExample.js +1 -24
  150. package/lib/examples/DecksAgent.js +1 -1
  151. package/lib/examples/DocumentPageAgent.js +1 -1
  152. package/lib/examples/HomeExample.js +14 -62
  153. package/lib/examples/Lexical2Example.js +3 -32
  154. package/lib/examples/LexicalAgentExample.js +2 -34
  155. package/lib/examples/LexicalAgentSidebarExample.js +3 -34
  156. package/lib/examples/LoopAppComputerExample.js +1 -1
  157. package/lib/examples/LoopShellExample.js +2 -2
  158. package/lib/examples/LoopStrategyExample.js +15 -87
  159. package/lib/examples/LoopWorkspaceEmbed.js +2 -18
  160. package/lib/examples/LoopWorkspaceExample.js +2 -2
  161. package/lib/examples/NotebookAgentExample.js +2 -33
  162. package/lib/examples/NotebookAgentSidebarExample.js +3 -46
  163. package/lib/examples/NotebookCollaborationExample.js +1 -31
  164. package/lib/examples/NotebookExample.js +1 -18
  165. package/lib/examples/NotebookPageAgent.js +1 -1
  166. package/lib/examples/ScenesExample.js +5 -24
  167. package/lib/examples/VoiceChatExample.js +1 -1
  168. package/lib/examples/components/AuthRequiredView.js +1 -7
  169. package/lib/examples/components/ErrorView.js +1 -8
  170. package/lib/examples/components/ExampleErrorBoundary.js +1 -14
  171. package/lib/examples/components/FooterMetrics.js +1 -7
  172. package/lib/examples/components/Header.js +12 -51
  173. package/lib/examples/components/HeaderControls.js +1 -9
  174. package/lib/examples/components/LexicalEditor.js +1 -8
  175. package/lib/examples/components/MainContent.js +1 -13
  176. package/lib/examples/components/MockFileBrowser.js +4 -40
  177. package/lib/examples/components/SessionTabs.js +1 -1
  178. package/lib/examples/components/TimeTravel.js +1 -13
  179. package/lib/examples/main.js +13 -81
  180. package/lib/examples/scenes/A2UiComponentsGalleryScene.js +3 -34
  181. package/lib/examples/scenes/A2UiContactCardScene.js +3 -35
  182. package/lib/examples/scenes/A2UiRestaurantScene.js +3 -53
  183. package/lib/examples/scenes/A2UiViewerScene.js +3 -34
  184. package/lib/examples/utils/AssistantGalleryGrid.js +6 -35
  185. package/lib/examples2/DatalayerNotebookExample.js +3 -33
  186. package/lib/examples2/NativeNavigationExample.js +4 -10
  187. package/lib/examples2/NotebookMutationsKernel.js +2 -1
  188. package/lib/examples2/NotebookMutationsServiceManager.js +2 -1
  189. package/lib/examples2/ReactRouterExample.js +14 -42
  190. package/lib/hooks/useToolApprovals.d.ts +2 -34
  191. package/lib/hooks/useToolApprovals.js +1 -64
  192. package/lib/identity/AgentIdentity.js +17 -62
  193. package/lib/identity/IdentityConnect.js +13 -59
  194. package/lib/identity/OAuthCallback.js +6 -44
  195. package/lib/lexical/ChatInlinePlugin.js +6 -14
  196. package/lib/loop/apps/AppRenderer.d.ts +4 -3
  197. package/lib/loop/apps/AppRenderer.js +11 -12
  198. package/lib/loop/apps/appspec.js +6 -3
  199. package/lib/loop/embed/AppEmbed.d.ts +1 -1
  200. package/lib/loop/embed/AppEmbed.js +2 -1
  201. package/lib/loop/embed/LoopEmbed.js +1 -7
  202. package/lib/loop/embed/embedConfig.d.ts +3 -3
  203. package/lib/loop/embed/embedConfig.js +2 -3
  204. package/lib/loop/embed/embedTheme.d.ts +4 -4
  205. package/lib/loop/embed/embedTheme.js +11 -7
  206. package/lib/loop/plugins/a2a-sidebar/A2ASidebar.js +7 -34
  207. package/lib/loop/plugins/a2ui/A2uiView.js +4 -12
  208. package/lib/loop/plugins/a2ui-surface/InlineSurface.js +1 -16
  209. package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.js +2 -12
  210. package/lib/loop/plugins/agents/AnonymousKeyBadge.js +3 -2
  211. package/lib/loop/plugins/agents/SandboxSelector.js +3 -7
  212. package/lib/loop/plugins/agents/SandboxView.js +4 -27
  213. package/lib/loop/plugins/agents/TeamMemberPicker.js +2 -2
  214. package/lib/loop/plugins/agentspecs/AgentspecPicker.js +3 -2
  215. package/lib/loop/plugins/app-activity/AppActivity.js +1 -1
  216. package/lib/loop/plugins/app-computer/AppComputer.js +5 -21
  217. package/lib/loop/plugins/app-elements/AppElements.js +2 -31
  218. package/lib/loop/plugins/app-page/AppPage.js +1 -1
  219. package/lib/loop/plugins/app-rules/AppRulesCard.js +4 -20
  220. package/lib/loop/plugins/assistant/index.js +1 -13
  221. package/lib/loop/plugins/chat/ChatView.js +40 -106
  222. package/lib/loop/plugins/checkpoints-sidebar/CheckpointsSidebar.js +2 -13
  223. package/lib/loop/plugins/decks/DeckSurface.js +2 -2
  224. package/lib/loop/plugins/document/DocumentView.js +4 -12
  225. package/lib/loop/plugins/document-toolbar/SandboxStatusItem.js +3 -8
  226. package/lib/loop/plugins/graph/GraphView.js +2 -2
  227. package/lib/loop/plugins/input-prompt/ComposerView.js +1 -1
  228. package/lib/loop/plugins/notebook/NotebookView.js +3 -11
  229. package/lib/loop/plugins/page-layout/SplitLayout.js +11 -34
  230. package/lib/loop/plugins/page-layout/TurnPanel.js +9 -35
  231. package/lib/loop/plugins/shell/useEditorPreviews.js +3 -2
  232. package/lib/loop/plugins/subagent-activity/SubagentPulse.js +1 -13
  233. package/lib/loop/plugins/window-frame/WindowFrame.js +10 -44
  234. package/lib/loop/plugins/window-frame/index.js +1 -1
  235. package/lib/loop/shell/LoopWorkspace.js +34 -77
  236. package/lib/loop/shell/PluginToggles.js +4 -15
  237. package/lib/loop/shell/SidebarRail.js +8 -40
  238. package/lib/loop/shell/ViewSwitcher.js +4 -24
  239. package/lib/loop-main.js +2 -3
  240. package/lib/mcp/McpServerManager.js +6 -37
  241. package/lib/portable/index.d.ts +11 -0
  242. package/lib/portable/index.js +20 -0
  243. package/lib/protocols/AGUIAdapter.js +2 -2
  244. package/lib/protocols/BaseProtocolAdapter.d.ts +2 -0
  245. package/lib/protocols/BaseProtocolAdapter.js +4 -0
  246. package/lib/specs/apps.js +6 -0
  247. package/lib/specs/appspecSchema.js +11 -4
  248. package/lib/stories/loop/ReferenceScreens.js +17 -91
  249. package/lib/stories/loop/pictures-main.js +1 -1
  250. package/lib/types/agentspecs.d.ts +5 -2
  251. package/lib/types/protocol.d.ts +2 -0
  252. package/lib/utils/approvals.d.ts +59 -0
  253. package/lib/utils/approvals.js +101 -0
  254. package/lib/voice/VoiceInput.js +3 -39
  255. package/package.json +2 -2
  256. package/scripts/codegen/generate_envvars.py +0 -1
  257. package/lib/shims/primerAddonsBox.d.ts +0 -1
  258. package/lib/shims/primerAddonsBox.js +0 -7
@@ -87,24 +87,7 @@ export function SubagentActivity({ toolCallId, }) {
87
87
  : isDone
88
88
  ? 'success.fg'
89
89
  : 'accent.fg';
90
- return (_jsxs(Box, { sx: {
91
- mt: 1,
92
- ml: 2,
93
- borderLeft: '2px solid',
94
- borderColor: 'border.muted',
95
- pl: 2,
96
- }, children: [_jsxs(Box, { as: "button", onClick: () => setExpanded(prev => !prev), sx: {
97
- display: 'flex',
98
- alignItems: 'center',
99
- gap: 1,
100
- width: '100%',
101
- border: 'none',
102
- background: 'transparent',
103
- cursor: 'pointer',
104
- p: 0,
105
- color: 'fg.muted',
106
- textAlign: 'left',
107
- }, children: [expanded ? (_jsx(ChevronDownIcon, { size: 12 })) : (_jsx(ChevronRightIcon, { size: 12 })), _jsx(Box, { sx: { color: statusColor, display: 'flex' }, children: _jsx(StatusIcon, { size: 14 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: 'fg.default' }, children: subagentName }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: hasError ? 'failed' : isDone ? 'done' : 'working…' })] }), expanded && (_jsx(Box, { sx: { mt: 1, display: 'flex', flexDirection: 'column', gap: 1 }, children: segments.map((segment, index) => (_jsx(SubagentSegmentView, { segment: segment }, index))) }))] }));
90
+ return (_jsxs(Box, { mt: 1, ml: 2, borderLeft: "2px solid", borderColor: "border.muted", pl: 2, children: [_jsxs(Box, { as: "button", onClick: () => setExpanded(prev => !prev), display: "flex", alignItems: "center", gap: 1, width: "100%", border: "none", background: "transparent", cursor: "pointer", p: 0, color: "fg.muted", textAlign: "left", children: [expanded ? (_jsx(ChevronDownIcon, { size: 12 })) : (_jsx(ChevronRightIcon, { size: 12 })), _jsx(Box, { color: statusColor, display: "flex", children: _jsx(StatusIcon, { size: 14 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold', color: 'fg.default' }, children: subagentName }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: hasError ? 'failed' : isDone ? 'done' : 'working…' })] }), expanded && (_jsx(Box, { mt: 1, display: "flex", flexDirection: "column", gap: 1, children: segments.map((segment, index) => (_jsx(SubagentSegmentView, { segment: segment }, index))) }))] }));
108
91
  }
109
92
  function SubagentSegmentView({ segment, }) {
110
93
  switch (segment.kind) {
@@ -120,14 +103,14 @@ function SubagentSegmentView({ segment, }) {
120
103
  case 'thinking':
121
104
  if (!segment.text)
122
105
  return null;
123
- return (_jsxs(Box, { sx: { display: 'flex', gap: 1, color: 'fg.muted' }, children: [_jsx(Box, { sx: { mt: '2px', flexShrink: 0 }, children: _jsx(LightBulbIcon, { size: 12 }) }), _jsx(Text, { sx: {
106
+ return (_jsxs(Box, { display: "flex", gap: 1, color: "fg.muted", children: [_jsx(Box, { mt: "2px", flexShrink: 0, children: _jsx(LightBulbIcon, { size: 12 }) }), _jsx(Text, { sx: {
124
107
  fontSize: 0,
125
108
  fontStyle: 'italic',
126
109
  whiteSpace: 'pre-wrap',
127
110
  wordBreak: 'break-word',
128
111
  }, children: segment.text })] }));
129
112
  case 'tool_call':
130
- return (_jsxs(Box, { sx: { display: 'flex', gap: 1, color: 'fg.muted' }, children: [_jsx(Box, { sx: { mt: '2px', flexShrink: 0 }, children: _jsx(ToolsIcon, { size: 12 }) }), _jsxs(Box, { sx: { minWidth: 0 }, children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold' }, children: segment.toolName ?? 'tool' }), segment.toolArgs && Object.keys(segment.toolArgs).length > 0 && (_jsx(Text, { as: "pre", sx: {
113
+ return (_jsxs(Box, { display: "flex", gap: 1, color: "fg.muted", children: [_jsx(Box, { mt: "2px", flexShrink: 0, children: _jsx(ToolsIcon, { size: 12 }) }), _jsxs(Box, { minWidth: 0, children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold' }, children: segment.toolName ?? 'tool' }), segment.toolArgs && Object.keys(segment.toolArgs).length > 0 && (_jsx(Text, { as: "pre", sx: {
131
114
  fontSize: 0,
132
115
  fontFamily: 'mono',
133
116
  m: 0,
@@ -139,7 +122,7 @@ function SubagentSegmentView({ segment, }) {
139
122
  case 'tool_result':
140
123
  if (!segment.result)
141
124
  return null;
142
- return (_jsxs(Box, { sx: { display: 'flex', gap: 1, color: 'fg.muted' }, children: [_jsx(Box, { sx: { mt: '2px', flexShrink: 0, color: 'success.fg' }, children: _jsx(CheckCircleIcon, { size: 12 }) }), _jsx(Text, { as: "pre", sx: {
125
+ return (_jsxs(Box, { display: "flex", gap: 1, color: "fg.muted", children: [_jsx(Box, { mt: "2px", flexShrink: 0, color: "success.fg", children: _jsx(CheckCircleIcon, { size: 12 }) }), _jsx(Text, { as: "pre", sx: {
143
126
  fontSize: 0,
144
127
  fontFamily: 'mono',
145
128
  m: 0,
@@ -147,7 +130,7 @@ function SubagentSegmentView({ segment, }) {
147
130
  wordBreak: 'break-word',
148
131
  }, children: segment.result })] }));
149
132
  case 'error':
150
- return (_jsxs(Box, { sx: { display: 'flex', gap: 1, color: 'danger.fg' }, children: [_jsx(Box, { sx: { mt: '2px', flexShrink: 0 }, children: _jsx(AlertIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0 }, children: segment.error ?? 'Subagent failed' })] }));
133
+ return (_jsxs(Box, { display: "flex", gap: 1, color: "danger.fg", children: [_jsx(Box, { mt: "2px", flexShrink: 0, children: _jsx(AlertIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0 }, children: segment.error ?? 'Subagent failed' })] }));
151
134
  default:
152
135
  return null;
153
136
  }
@@ -13,7 +13,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  * @module chat/tools/ToolApprovalBanner
14
14
  */
15
15
  import { useState } from 'react';
16
- import { Box, Button, Text, CounterLabel } from '@primer/react';
16
+ import { Box } from '@datalayer/primer-addons';
17
+ import { Button, Text, CounterLabel } from '@primer/react';
17
18
  import { ShieldCheckIcon, AlertIcon, CheckIcon, XIcon, } from '@primer/octicons-react';
18
19
  import { useChatWords } from '../ChatLanguage';
19
20
  /**
@@ -26,39 +27,8 @@ export function ToolApprovalBanner({ pendingApprovals, onReview, onApproveAll, o
26
27
  return null;
27
28
  }
28
29
  if (collapsed) {
29
- return (_jsxs(Box, { sx: {
30
- display: 'flex',
31
- alignItems: 'center',
32
- gap: 2,
33
- px: 3,
34
- py: 2,
35
- bg: 'attention.subtle',
36
- borderBottom: '1px solid',
37
- borderColor: 'attention.muted',
38
- cursor: 'pointer',
39
- }, onClick: () => setCollapsed(false), children: [_jsx(ShieldCheckIcon, { size: 16 }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'semibold' }, children: chatText.toolApprovalsPending }), _jsx(CounterLabel, { children: pendingApprovals.length })] }));
30
+ return (_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, px: 3, py: 2, bg: "attention.subtle", borderBottom: "1px solid", borderColor: "attention.muted", cursor: "pointer", onClick: () => setCollapsed(false), children: [_jsx(ShieldCheckIcon, { size: 16 }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'semibold' }, children: chatText.toolApprovalsPending }), _jsx(CounterLabel, { children: pendingApprovals.length })] }));
40
31
  }
41
- return (_jsxs(Box, { sx: {
42
- borderBottom: '1px solid',
43
- borderColor: 'attention.muted',
44
- bg: 'attention.subtle',
45
- }, children: [_jsxs(Box, { sx: {
46
- display: 'flex',
47
- alignItems: 'center',
48
- justifyContent: 'space-between',
49
- px: 3,
50
- py: 2,
51
- }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(AlertIcon, { size: 16 }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'semibold' }, children: chatText.approvalsPending(pendingApprovals.length) })] }), _jsxs(Box, { sx: { display: 'flex', gap: 1 }, children: [onApproveAll && pendingApprovals.length >= 1 && (_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckIcon, onClick: onApproveAll, children: chatText.approveAll })), collapsible && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => setCollapsed(true), children: chatText.collapse })), onDismiss && (_jsx(Button, { size: "small", variant: "invisible", leadingVisual: XIcon, onClick: onDismiss, "aria-label": chatText.dismiss }))] })] }), _jsx(Box, { sx: { px: 3, pb: 2 }, children: pendingApprovals.map(approval => (_jsxs(Box, { sx: {
52
- display: 'flex',
53
- alignItems: 'center',
54
- justifyContent: 'space-between',
55
- py: 1,
56
- px: 2,
57
- mb: 1,
58
- bg: 'canvas.default',
59
- borderRadius: 2,
60
- border: '1px solid',
61
- borderColor: 'border.default',
62
- }, children: [_jsxs(Box, { children: [_jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 1 }, children: approval.toolName }), approval.toolDescription && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, ml: 2 }, children: approval.toolDescription }))] }), _jsx(Button, { size: "small", variant: "default", onClick: () => onReview(approval), children: chatText.review })] }, approval.id))) })] }));
32
+ return (_jsxs(Box, { borderBottom: "1px solid", borderColor: "attention.muted", bg: "attention.subtle", children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 2, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(AlertIcon, { size: 16 }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'semibold' }, children: chatText.approvalsPending(pendingApprovals.length) })] }), _jsxs(Box, { display: "flex", gap: 1, children: [onApproveAll && pendingApprovals.length >= 1 && (_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckIcon, onClick: onApproveAll, children: chatText.approveAll })), collapsible && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => setCollapsed(true), children: chatText.collapse })), onDismiss && (_jsx(Button, { size: "small", variant: "invisible", leadingVisual: XIcon, onClick: onDismiss, "aria-label": chatText.dismiss }))] })] }), _jsx(Box, { px: 3, pb: 2, children: pendingApprovals.map(approval => (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", py: 1, px: 2, mb: 1, bg: "canvas.default", borderRadius: 2, border: "1px solid", borderColor: "border.default", children: [_jsxs(Box, { children: [_jsx(Text, { sx: { fontWeight: 'semibold', fontSize: 1 }, children: approval.toolName }), approval.toolDescription && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, ml: 2 }, children: approval.toolDescription }))] }), _jsx(Button, { size: "small", variant: "default", onClick: () => onReview(approval), children: chatText.review })] }, approval.id))) })] }));
63
33
  }
64
34
  export default ToolApprovalBanner;
@@ -10,7 +10,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  * @module chat/tools/ToolApprovalDialog
11
11
  */
12
12
  import { useCallback, useState } from 'react';
13
- import { Box, Button, Text, Heading, FormControl, Checkbox, } from '@primer/react';
13
+ import { Box } from '@datalayer/primer-addons';
14
+ import { Button, Text, Heading, FormControl, Checkbox } from '@primer/react';
14
15
  import { Dialog } from '@primer/react/experimental';
15
16
  import { AlertIcon, ToolsIcon, CheckIcon, XIcon } from '@primer/octicons-react';
16
17
  import { useChatWords } from '../ChatLanguage';
@@ -29,28 +30,12 @@ export function ToolApprovalDialog({ isOpen, toolName, toolDescription, args, on
29
30
  if (!isOpen) {
30
31
  return null;
31
32
  }
32
- return (_jsxs(Dialog, { onClose: onClose, "aria-labelledby": "tool-approval-title", children: [_jsx(Dialog.Header, { children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(AlertIcon, { size: 16 }), chatText.approvalTitle] }) }), _jsxs(Box, { sx: { p: 3 }, children: [_jsxs(Box, { sx: { mb: 3 }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, mb: 2 }, children: [_jsx(ToolsIcon, { size: 20 }), _jsx(Heading, { as: "h4", sx: { fontSize: 2 }, children: toolName })] }), toolDescription && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: toolDescription }))] }), _jsxs(Box, { sx: { mb: 3 }, children: [_jsx(Text, { sx: {
33
+ return (_jsxs(Dialog, { onClose: onClose, "aria-labelledby": "tool-approval-title", children: [_jsx(Dialog.Header, { children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(AlertIcon, { size: 16 }), chatText.approvalTitle] }) }), _jsxs(Box, { p: 3, children: [_jsxs(Box, { mb: 3, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 2, children: [_jsx(ToolsIcon, { size: 20 }), _jsx(Heading, { as: "h4", sx: { fontSize: 2 }, children: toolName })] }), toolDescription && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: toolDescription }))] }), _jsxs(Box, { mb: 3, children: [_jsx(Text, { sx: {
33
34
  fontWeight: 'semibold',
34
35
  fontSize: 1,
35
36
  mb: 2,
36
37
  display: 'block',
37
- }, children: chatText.arguments }), _jsx(Box, { as: "pre", sx: {
38
- p: 3,
39
- bg: 'canvas.subtle',
40
- borderRadius: 2,
41
- border: '1px solid',
42
- borderColor: 'border.default',
43
- overflow: 'auto',
44
- maxHeight: 200,
45
- fontSize: 0,
46
- }, children: JSON.stringify(args, null, 2) })] }), _jsx(Box, { sx: {
47
- p: 3,
48
- bg: 'attention.subtle',
49
- borderRadius: 2,
50
- border: '1px solid',
51
- borderColor: 'attention.muted',
52
- mb: 3,
53
- }, children: _jsx(Text, { sx: { fontSize: 1 }, children: chatText.approvalWarning }) }), showRememberChoice && (_jsxs(FormControl, { sx: { mb: 3 }, children: [_jsx(Checkbox, { checked: rememberChoice, onChange: e => setRememberChoice(e.target.checked) }), _jsx(FormControl.Label, { children: chatText.rememberChoice })] })), _jsxs(Box, { sx: { display: 'flex', justifyContent: 'flex-end', gap: 2 }, children: [_jsx(Button, { variant: "danger", onClick: handleDeny, leadingVisual: XIcon, children: chatText.deny }), _jsx(Button, { variant: "primary", onClick: handleApprove, leadingVisual: CheckIcon, children: chatText.approve })] })] })] }));
38
+ }, children: chatText.arguments }), _jsx(Box, { as: "pre", p: 3, bg: "canvas.subtle", borderRadius: 2, border: "1px solid", borderColor: "border.default", overflow: "auto", maxHeight: 200, fontSize: 0, children: JSON.stringify(args, null, 2) })] }), _jsx(Box, { p: 3, bg: "attention.subtle", borderRadius: 2, border: "1px solid", borderColor: "attention.muted", mb: 3, children: _jsx(Text, { sx: { fontSize: 1 }, children: chatText.approvalWarning }) }), showRememberChoice && (_jsxs(FormControl, { sx: { mb: 3 }, children: [_jsx(Checkbox, { checked: rememberChoice, onChange: e => setRememberChoice(e.target.checked) }), _jsx(FormControl.Label, { children: chatText.rememberChoice })] })), _jsxs(Box, { display: "flex", justifyContent: "flex-end", gap: 2, children: [_jsx(Button, { variant: "danger", onClick: handleDeny, leadingVisual: XIcon, children: chatText.deny }), _jsx(Button, { variant: "primary", onClick: handleApprove, leadingVisual: CheckIcon, children: chatText.approve })] })] })] }));
54
39
  }
55
40
  /**
56
41
  * Hook to manage tool approval dialog state
@@ -171,43 +171,12 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
171
171
  result.stderr ??
172
172
  undefined)
173
173
  : undefined);
174
- return (_jsxs(Box, { "data-tool-call": toolName, "data-tool-call-status": status, sx: {
175
- width: '100%',
176
- border: '1px solid',
177
- borderColor: 'border.default',
178
- borderRadius: compact ? '8px' : '12px',
179
- overflow: 'hidden',
180
- backgroundColor: 'canvas.default',
181
- }, children: [_jsxs(Box, { as: "button", onClick: () => setIsExpanded(!isExpanded), sx: {
182
- width: '100%',
183
- display: 'flex',
184
- alignItems: 'center',
185
- gap: compact ? 1 : 2,
186
- padding: compact ? 1 : 2,
187
- backgroundColor: 'canvas.subtle',
188
- border: 'none',
189
- borderBottom: isExpanded ? '1px solid' : 'none',
190
- borderColor: 'border.default',
191
- cursor: 'pointer',
192
- textAlign: 'left',
193
- '&:hover': {
194
- backgroundColor: 'neutral.muted',
195
- },
196
- }, children: [_jsx(Box, { sx: { color: 'fg.muted', flexShrink: 0 }, children: isExpanded ? (_jsx(ChevronDownIcon, { size: 16 })) : (_jsx(ChevronRightIcon, { size: 16 })) }), hasMark(marks) && (_jsx(Box, { sx: { color: 'fg.muted', flexShrink: 0, display: 'flex' }, children: _jsx(SpecMark, { icon: marks?.icon, emoji: marks?.emoji, size: 16 }) })), _jsx(Text, { sx: {
174
+ return (_jsxs(Box, { "data-tool-call": toolName, "data-tool-call-status": status, width: "100%", border: "1px solid", borderColor: "border.default", borderRadius: compact ? '8px' : '12px', overflow: "hidden", backgroundColor: "canvas.default", children: [_jsxs(Box, { as: "button", onClick: () => setIsExpanded(!isExpanded), width: "100%", display: "flex", alignItems: "center", gap: compact ? 1 : 2, padding: compact ? 1 : 2, backgroundColor: "canvas.subtle", border: "none", borderBottom: isExpanded ? '1px solid' : 'none', borderColor: "border.default", cursor: "pointer", textAlign: "left", hover: { backgroundColor: 'neutral.muted' }, children: [_jsx(Box, { color: "fg.muted", flexShrink: 0, children: isExpanded ? (_jsx(ChevronDownIcon, { size: 16 })) : (_jsx(ChevronRightIcon, { size: 16 })) }), hasMark(marks) && (_jsx(Box, { color: "fg.muted", flexShrink: 0, display: "flex", children: _jsx(SpecMark, { icon: marks?.icon, emoji: marks?.emoji, size: 16 }) })), _jsx(Text, { sx: {
197
175
  fontWeight: 'semibold',
198
176
  fontSize: compact ? 0 : 1,
199
177
  color: 'fg.default',
200
178
  flexShrink: 0,
201
- }, children: displayName }), _jsxs(Box, { sx: {
202
- display: 'inline-flex',
203
- alignItems: 'center',
204
- gap: 1,
205
- px: 2,
206
- py: '2px',
207
- borderRadius: 2,
208
- backgroundColor: statusDisplay.bgColor,
209
- flexShrink: 0,
210
- }, children: [_jsx(Box, { sx: { color: statusDisplay.color, display: 'flex' }, children: statusDisplay.icon }), _jsx(Text, { sx: {
179
+ }, children: displayName }), _jsxs(Box, { display: "inline-flex", alignItems: "center", gap: 1, px: 2, py: "2px", borderRadius: 2, backgroundColor: statusDisplay.bgColor, flexShrink: 0, children: [_jsx(Box, { color: statusDisplay.color, display: "flex", children: statusDisplay.icon }), _jsx(Text, { sx: {
211
180
  fontSize: 0,
212
181
  fontWeight: 'medium',
213
182
  color: statusDisplay.color,
@@ -221,7 +190,7 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
221
190
  whiteSpace: 'nowrap',
222
191
  flex: 1,
223
192
  minWidth: 0,
224
- }, children: argsSummary }))] }), isExpanded && (_jsxs(Box, { sx: { p: 3 }, children: [_jsxs(Box, { sx: { mb: result !== undefined || error ? 3 : 0 }, children: [_jsx(Text, { sx: {
193
+ }, children: argsSummary }))] }), isExpanded && (_jsxs(Box, { p: 3, children: [_jsxs(Box, { mb: result !== undefined || error ? 3 : 0, children: [_jsx(Text, { sx: {
225
194
  display: 'block',
226
195
  fontSize: 0,
227
196
  fontWeight: 'semibold',
@@ -229,14 +198,7 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
229
198
  textTransform: 'uppercase',
230
199
  letterSpacing: '0.05em',
231
200
  mb: 2,
232
- }, children: chatText.parameters }), _jsx(Box, { sx: {
233
- backgroundColor: 'canvas.inset',
234
- borderRadius: 2,
235
- border: '1px solid',
236
- borderColor: 'border.default',
237
- overflow: 'auto',
238
- maxHeight: '200px',
239
- }, children: _jsx("pre", { style: {
201
+ }, children: chatText.parameters }), _jsx(Box, { backgroundColor: "canvas.inset", borderRadius: 2, border: "1px solid", borderColor: "border.default", overflow: "auto", maxHeight: "200px", children: _jsx("pre", { style: {
240
202
  margin: 0,
241
203
  padding: '12px',
242
204
  fontSize: '12px',
@@ -254,14 +216,7 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
254
216
  textTransform: 'uppercase',
255
217
  letterSpacing: '0.05em',
256
218
  mb: 2,
257
- }, children: chatText.result }), _jsx(Box, { sx: {
258
- backgroundColor: 'success.subtle',
259
- borderRadius: 2,
260
- border: '1px solid',
261
- borderColor: 'success.muted',
262
- overflow: 'auto',
263
- maxHeight: '300px',
264
- }, children: _jsx("pre", { style: {
219
+ }, children: chatText.result }), _jsx(Box, { backgroundColor: "success.subtle", borderRadius: 2, border: "1px solid", borderColor: "success.muted", overflow: "auto", maxHeight: "300px", children: _jsx("pre", { style: {
265
220
  margin: 0,
266
221
  padding: '12px',
267
222
  fontSize: '12px',
@@ -271,7 +226,7 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
271
226
  wordBreak: 'break-word',
272
227
  }, children: typeof result === 'string'
273
228
  ? result
274
- : JSON.stringify(result, null, 2) }) })] })), approvalRequired && (_jsx(Box, { sx: { mt: status === 'complete' && result !== undefined ? 3 : 0 }, children: approvalState === 'approved' ? (_jsxs(Box, { children: [_jsx(Text, { sx: { color: 'success.fg', fontSize: 1, display: 'block' }, children: chatText.approvedRunning }), approvalDecisionSource === 'external' && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: chatText.approvedElsewhere }))] })) : approvalState === 'denied' ? (_jsxs(Box, { children: [_jsx(Text, { sx: { color: 'danger.fg', fontSize: 1, display: 'block' }, children: chatText.deniedWontRun }), approvalDecisionSource === 'external' && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: chatText.decidedElsewhere }))] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.default' }, children: chatText.approvalNeeded }), _jsxs(Box, { sx: { mt: 2, display: 'flex', gap: 2 }, children: [_jsx(Button, { size: "small", onClick: onApprove, disabled: approvalLoading || !onApprove, children: chatText.approve }), _jsx(Button, { size: "small", variant: "danger", onClick: onDeny, disabled: approvalLoading || !onDeny, children: chatText.deny })] })] })) })), status === 'error' && effectiveExecutionError && (_jsxs(Box, { children: [_jsxs(Text, { sx: {
229
+ : JSON.stringify(result, null, 2) }) })] })), approvalRequired && (_jsx(Box, { mt: status === 'complete' && result !== undefined ? 3 : 0, children: approvalState === 'approved' ? (_jsxs(Box, { children: [_jsx(Text, { sx: { color: 'success.fg', fontSize: 1, display: 'block' }, children: chatText.approvedRunning }), approvalDecisionSource === 'external' && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: chatText.approvedElsewhere }))] })) : approvalState === 'denied' ? (_jsxs(Box, { children: [_jsx(Text, { sx: { color: 'danger.fg', fontSize: 1, display: 'block' }, children: chatText.deniedWontRun }), approvalDecisionSource === 'external' && (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: chatText.decidedElsewhere }))] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 1, color: 'fg.default' }, children: chatText.approvalNeeded }), _jsxs(Box, { mt: 2, display: "flex", gap: 2, children: [_jsx(Button, { size: "small", onClick: onApprove, disabled: approvalLoading || !onApprove, children: chatText.approve }), _jsx(Button, { size: "small", variant: "danger", onClick: onDeny, disabled: approvalLoading || !onDeny, children: chatText.deny })] })] })) })), status === 'error' && effectiveExecutionError && (_jsxs(Box, { children: [_jsxs(Text, { sx: {
275
230
  display: 'block',
276
231
  fontSize: 0,
277
232
  fontWeight: 'semibold',
@@ -279,13 +234,7 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
279
234
  textTransform: 'uppercase',
280
235
  letterSpacing: '0.05em',
281
236
  mb: 2,
282
- }, children: [_jsx(AlertIcon, { size: 12 }), " ", chatText.executionError] }), _jsxs(Box, { sx: {
283
- backgroundColor: 'danger.subtle',
284
- borderRadius: 2,
285
- border: '1px solid',
286
- borderColor: 'danger.muted',
287
- p: 2,
288
- }, children: [_jsx(Text, { sx: { fontSize: 1, color: 'danger.fg' }, children: effectiveExecutionError }), _jsx(Text, { sx: {
237
+ }, children: [_jsx(AlertIcon, { size: 12 }), " ", chatText.executionError] }), _jsxs(Box, { backgroundColor: "danger.subtle", borderRadius: 2, border: "1px solid", borderColor: "danger.muted", p: 2, children: [_jsx(Text, { sx: { fontSize: 1, color: 'danger.fg' }, children: effectiveExecutionError }), _jsx(Text, { sx: {
289
238
  display: 'block',
290
239
  fontSize: 0,
291
240
  color: 'fg.muted',
@@ -298,17 +247,7 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
298
247
  textTransform: 'uppercase',
299
248
  letterSpacing: '0.05em',
300
249
  mb: 2,
301
- }, children: [chatText.toolCodeError, ": ", effectiveCodeError.name] }), _jsxs(Box, { sx: {
302
- backgroundColor: 'severe.subtle',
303
- borderRadius: 2,
304
- border: '1px solid',
305
- borderColor: 'severe.muted',
306
- overflow: 'hidden',
307
- }, children: [_jsx(Box, { sx: { p: 2 }, children: _jsx(Text, { sx: { fontSize: 1, color: 'severe.fg' }, children: effectiveCodeError.value }) }), effectiveCodeError.traceback && (_jsx(Box, { sx: {
308
- borderTop: '1px solid',
309
- borderColor: 'severe.muted',
310
- backgroundColor: 'canvas.inset',
311
- }, children: _jsx("pre", { style: {
250
+ }, children: [chatText.toolCodeError, ": ", effectiveCodeError.name] }), _jsxs(Box, { backgroundColor: "severe.subtle", borderRadius: 2, border: "1px solid", borderColor: "severe.muted", overflow: "hidden", children: [_jsx(Box, { p: 2, children: _jsx(Text, { sx: { fontSize: 1, color: 'severe.fg' }, children: effectiveCodeError.value }) }), effectiveCodeError.traceback && (_jsx(Box, { borderTop: "1px solid", borderColor: "severe.muted", backgroundColor: "canvas.inset", children: _jsx("pre", { style: {
312
251
  margin: 0,
313
252
  padding: '8px 12px',
314
253
  fontSize: '11px',
@@ -330,13 +269,7 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
330
269
  textTransform: 'uppercase',
331
270
  letterSpacing: '0.05em',
332
271
  mb: 2,
333
- }, children: chatText.errorHeading }), _jsx(Box, { sx: {
334
- backgroundColor: 'danger.subtle',
335
- borderRadius: 2,
336
- border: '1px solid',
337
- borderColor: 'danger.muted',
338
- p: 2,
339
- }, children: _jsx(Text, { sx: { fontSize: 1, color: 'danger.fg' }, children: effectiveError }) })] })), hasNonZeroExit &&
272
+ }, children: chatText.errorHeading }), _jsx(Box, { backgroundColor: "danger.subtle", borderRadius: 2, border: "1px solid", borderColor: "danger.muted", p: 2, children: _jsx(Text, { sx: { fontSize: 1, color: 'danger.fg' }, children: effectiveError }) })] })), hasNonZeroExit &&
340
273
  !effectiveExecutionError &&
341
274
  !effectiveCodeError && (_jsxs(Box, { children: [_jsxs(Text, { sx: {
342
275
  display: 'block',
@@ -346,25 +279,12 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
346
279
  textTransform: 'uppercase',
347
280
  letterSpacing: '0.05em',
348
281
  mb: 2,
349
- }, children: [_jsx(AlertIcon, { size: 12 }), " ", chatText.processExited] }), _jsxs(Box, { sx: {
350
- backgroundColor: 'attention.subtle',
351
- borderRadius: 2,
352
- border: '1px solid',
353
- borderColor: 'attention.muted',
354
- p: 2,
355
- }, children: [_jsx(Text, { sx: { fontSize: 1, color: 'attention.fg' }, children: chatText.exitedWithCode(String(effectiveExitCode)) }), _jsx(Text, { sx: {
282
+ }, children: [_jsx(AlertIcon, { size: 12 }), " ", chatText.processExited] }), _jsxs(Box, { backgroundColor: "attention.subtle", borderRadius: 2, border: "1px solid", borderColor: "attention.muted", p: 2, children: [_jsx(Text, { sx: { fontSize: 1, color: 'attention.fg' }, children: chatText.exitedWithCode(String(effectiveExitCode)) }), _jsx(Text, { sx: {
356
283
  display: 'block',
357
284
  fontSize: 0,
358
285
  color: 'fg.muted',
359
286
  mt: 1,
360
- }, children: chatText.nonZeroExit })] }), effectiveExitOutput && (_jsx(Box, { sx: {
361
- mt: 2,
362
- backgroundColor: 'canvas.inset',
363
- borderRadius: 2,
364
- border: '1px solid',
365
- borderColor: 'attention.muted',
366
- overflow: 'auto',
367
- }, children: _jsx("pre", { style: {
287
+ }, children: chatText.nonZeroExit })] }), effectiveExitOutput && (_jsx(Box, { mt: 2, backgroundColor: "canvas.inset", borderRadius: 2, border: "1px solid", borderColor: "attention.muted", overflow: "auto", children: _jsx("pre", { style: {
368
288
  margin: 0,
369
289
  padding: '10px 12px',
370
290
  fontSize: '12px',
@@ -373,11 +293,6 @@ export function ToolCallDisplay({ toolCallId, toolName, args, result, status, er
373
293
  whiteSpace: 'pre-wrap',
374
294
  wordBreak: 'break-word',
375
295
  maxHeight: '200px',
376
- }, children: effectiveExitOutput }) }))] })), _jsx(Box, { sx: {
377
- mt: 3,
378
- pt: 2,
379
- borderTop: '1px solid',
380
- borderColor: 'border.muted',
381
- }, children: _jsxs(Text, { sx: { fontSize: 0, color: 'fg.subtle', fontFamily: 'monospace' }, children: ["ID: ", toolCallId] }) })] }))] }));
296
+ }, children: effectiveExitOutput }) }))] })), _jsx(Box, { mt: 3, pt: 2, borderTop: "1px solid", borderColor: "border.muted", children: _jsxs(Text, { sx: { fontSize: 0, color: 'fg.subtle', fontFamily: 'monospace' }, children: ["ID: ", toolCallId] }) })] }))] }));
382
297
  }
383
298
  export default ToolCallDisplay;
@@ -150,19 +150,7 @@ export function ContextPie({ agentUsage, padding, showContextRing = false, }) {
150
150
  },
151
151
  ],
152
152
  };
153
- return (_jsxs(Box, { sx: {
154
- display: 'flex',
155
- alignItems: 'center',
156
- justifyContent: 'flex-start',
157
- gap: 2,
158
- py: 1,
159
- px: padding,
160
- bg: 'canvas.subtle',
161
- flexWrap: 'nowrap',
162
- overflow: 'visible',
163
- whiteSpace: 'nowrap',
164
- minWidth: 0,
165
- }, children: [showContextRing && (_jsxs(Box, { sx: { position: 'relative', flexShrink: 0 }, onMouseEnter: () => {
153
+ return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "flex-start", gap: 2, py: 1, px: padding, bg: "canvas.subtle", flexWrap: "nowrap", overflow: "visible", whiteSpace: "nowrap", minWidth: 0, children: [showContextRing && (_jsxs(Box, { position: "relative", flexShrink: 0, onMouseEnter: () => {
166
154
  if (hoverTimeoutRef.current)
167
155
  clearTimeout(hoverTimeoutRef.current);
168
156
  hoverTimeoutRef.current = setTimeout(() => setContextOverlayOpen(true), 150);
@@ -170,30 +158,7 @@ export function ContextPie({ agentUsage, padding, showContextRing = false, }) {
170
158
  if (hoverTimeoutRef.current)
171
159
  clearTimeout(hoverTimeoutRef.current);
172
160
  hoverTimeoutRef.current = setTimeout(() => setContextOverlayOpen(false), 250);
173
- }, children: [_jsx(Box, { ref: contextAnchorRef, sx: {
174
- cursor: 'pointer',
175
- width: 20,
176
- height: 20,
177
- display: 'flex',
178
- alignItems: 'center',
179
- justifyContent: 'center',
180
- border: '1px solid',
181
- borderColor: 'border.default',
182
- borderRadius: '50%',
183
- }, children: _jsx(ReactECharts, { option: miniPieOption, style: { width: 18, height: 18 }, opts: { renderer: 'svg' } }) }), contextOverlayOpen && (_jsxs(Box, { sx: {
184
- position: 'absolute',
185
- bottom: '100%',
186
- left: 0,
187
- mb: 1,
188
- p: 3,
189
- width: 260,
190
- bg: 'canvas.overlay',
191
- borderRadius: 2,
192
- boxShadow: 'shadow.large',
193
- border: '1px solid',
194
- borderColor: 'border.default',
195
- zIndex: 100,
196
- }, children: [_jsx(Text, { sx: {
161
+ }, children: [_jsx(Box, { ref: contextAnchorRef, cursor: "pointer", width: 20, height: 20, display: "flex", alignItems: "center", justifyContent: "center", border: "1px solid", borderColor: "border.default", borderRadius: "50%", children: _jsx(ReactECharts, { option: miniPieOption, style: { width: 18, height: 18 }, opts: { renderer: 'svg' } }) }), contextOverlayOpen && (_jsxs(Box, { position: "absolute", bottom: "100%", left: 0, mb: 1, p: 3, width: 260, bg: "canvas.overlay", borderRadius: 2, boxShadow: "shadow.large", border: "1px solid", borderColor: "border.default", zIndex: 100, children: [_jsx(Text, { sx: {
197
162
  fontWeight: 'bold',
198
163
  fontSize: 1,
199
164
  color: 'fg.default',
@@ -214,15 +179,9 @@ export function ContextPie({ agentUsage, padding, showContextRing = false, }) {
214
179
  fontWeight: 'semibold',
215
180
  display: 'block',
216
181
  mb: 2,
217
- }, children: ['• ', pct.toFixed(0), "%"] }), _jsx(Box, { sx: { display: 'flex', justifyContent: 'center', mb: 2 }, children: _jsx(ReactECharts, { option: overlayPieOption, style: { width: 80, height: 80 }, opts: { renderer: 'svg' } }) }), _jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1 }, children: categories.map(cat => {
182
+ }, children: ['• ', pct.toFixed(0), "%"] }), _jsx(Box, { display: "flex", justifyContent: "center", mb: 2, children: _jsx(ReactECharts, { option: overlayPieOption, style: { width: 80, height: 80 }, opts: { renderer: 'svg' } }) }), _jsx(Box, { display: "flex", flexDirection: "column", gap: 1, children: categories.map(cat => {
218
183
  const catPct = usedTokens > 0 ? (cat.value / usedTokens) * 100 : 0;
219
- return (_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Box, { sx: {
220
- width: 8,
221
- height: 8,
222
- borderRadius: '50%',
223
- bg: cat.color,
224
- flexShrink: 0,
225
- } }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', flex: 1 }, children: cat.name }), _jsxs(Text, { sx: {
184
+ return (_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(Box, { width: 8, height: 8, borderRadius: "50%", bg: cat.color, flexShrink: 0 }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', flex: 1 }, children: cat.name }), _jsxs(Text, { sx: {
226
185
  fontSize: 0,
227
186
  color: 'fg.default',
228
187
  fontWeight: 'semibold',
@@ -152,16 +152,10 @@ export function ChartView({ props }) {
152
152
  const option = useMemo(() => chartOption(points, { kind, x, y, series }, colours), [points, kind, x, y, series, colours]);
153
153
  const columns = series ? [x, series, y] : [x, y];
154
154
  const label = `${title || 'Chart'}: ${y} by ${x}, as a ${kind}`;
155
- return (_jsx(BlockFrame, { title: title, label: "Chart", weight: props.weight, testId: "a2ui-chart", children: _jsx(Box, { ref: frame, children: 'problem' in read ? (_jsx(Problem, { children: read.problem })) : points.length === 0 ? (_jsx(Quiet, { children: "No points yet." })) : (_jsxs(Box, { as: "figure", "aria-label": label, sx: { m: 0 }, children: [_jsx("div", { "aria-hidden": "true", children: _jsx(ReactECharts, { option: option, style: { height: 240, width: '100%' }, opts: { renderer: 'svg' }, notMerge: true, lazyUpdate: true }) }), _jsxs(Box, { as: "details", sx: { fontSize: 1 }, children: [_jsx(Box, { as: "summary", sx: {
156
- cursor: 'pointer',
157
- color: 'fg.muted',
158
- '&:focus-visible': {
159
- outline: '2px solid',
160
- outlineColor: 'accent.fg',
161
- },
162
- }, children: _jsx(Text, { children: "The numbers" }) }), _jsxs(Box, { as: "table", sx: {
163
- mt: 1,
164
- borderCollapse: 'collapse',
155
+ return (_jsx(BlockFrame, { title: title, label: "Chart", weight: props.weight, testId: "a2ui-chart", children: _jsx(Box, { ref: frame, children: 'problem' in read ? (_jsx(Problem, { children: read.problem })) : points.length === 0 ? (_jsx(Quiet, { children: "No points yet." })) : (_jsxs(Box, { as: "figure", "aria-label": label, m: 0, children: [_jsx("div", { "aria-hidden": "true", children: _jsx(ReactECharts, { option: option, style: { height: 240, width: '100%' }, opts: { renderer: 'svg' }, notMerge: true, lazyUpdate: true }) }), _jsxs(Box, { as: "details", fontSize: 1, children: [_jsx(Box, { as: "summary", cursor: "pointer", color: "fg.muted", focusVisible: {
156
+ outline: '2px solid',
157
+ outlineColor: 'accent.fg',
158
+ }, children: _jsx(Text, { children: "The numbers" }) }), _jsxs(Box, { as: "table", mt: 1, borderCollapse: "collapse", sx: {
165
159
  '& th, & td': {
166
160
  textAlign: 'left',
167
161
  pr: 3,
@@ -100,17 +100,9 @@ export function ChatView({ props }) {
100
100
  action?.();
101
101
  setDraft('');
102
102
  };
103
- return (_jsxs(BlockFrame, { label: "Chat", weight: props.weight, testId: "a2ui-chat", children: ['problem' in read ? (_jsx(Problem, { children: read.problem })) : (_jsx(Box, { sx: {
104
- maxHeight: 420,
105
- overflowY: 'auto',
106
- borderRadius: CARD_RADIUS,
107
- }, children: _jsx(ChatMessageList, { displayItems: read.items, isLoading: false, isStreaming: false, showLoadingIndicator: false, hideMessagesAfterToolUI: false, avatarConfig: AVATARS, padding: 2, emptyContent: _jsx(ChatEmptyState, { description: "", emptyState: { title: welcome || 'Start a conversation' }, suggestions: starters.map(starter => ({
103
+ return (_jsxs(BlockFrame, { label: "Chat", weight: props.weight, testId: "a2ui-chat", children: ['problem' in read ? (_jsx(Problem, { children: read.problem })) : (_jsx(Box, { maxHeight: 420, overflowY: "auto", borderRadius: CARD_RADIUS, children: _jsx(ChatMessageList, { displayItems: read.items, isLoading: false, isStreaming: false, showLoadingIndicator: false, hideMessagesAfterToolUI: false, avatarConfig: AVATARS, padding: 2, emptyContent: _jsx(ChatEmptyState, { description: "", emptyState: { title: welcome || 'Start a conversation' }, suggestions: starters.map(starter => ({
108
104
  title: starter,
109
105
  message: starter,
110
- })), onSuggestionSubmit: suggestion => send(suggestion.message) }), messagesEndRef: messagesEnd, onRespond: async () => undefined }) })), _jsxs(Box, { sx: {
111
- display: 'flex',
112
- alignItems: 'flex-end',
113
- gap: 2,
114
- }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsx(InputPromptText, { value: draft, onChange: setDraft, placeholder: placeholder, onSubmit: () => send(draft), inputRef: inputRef }) }), _jsx(IconButton, { icon: PaperAirplaneIcon, "aria-label": "Send", variant: "primary", disabled: !draft.trim(), onClick: () => send(draft) })] })] }));
106
+ })), onSuggestionSubmit: suggestion => send(suggestion.message) }), messagesEndRef: messagesEnd, onRespond: async () => undefined }) })), _jsxs(Box, { display: "flex", alignItems: "flex-end", gap: 2, children: [_jsx(Box, { flex: 1, minWidth: 0, children: _jsx(InputPromptText, { value: draft, onChange: setDraft, placeholder: placeholder, onSubmit: () => send(draft), inputRef: inputRef }) }), _jsx(IconButton, { icon: PaperAirplaneIcon, "aria-label": "Send", variant: "primary", disabled: !draft.trim(), onClick: () => send(draft) })] })] }));
115
107
  }
116
108
  export const Chat = ownImplementation('Chat', ChatView);
@@ -61,6 +61,6 @@ export function DownloadView({ props }) {
61
61
  const said = [props.media_type, sizeInWords(props.size)]
62
62
  .filter(Boolean)
63
63
  .join(' · ');
64
- return (_jsx(BlockFrame, { label: "File to download", weight: props.weight, testId: "a2ui-download", children: 'problem' in offered ? (_jsx(Problem, { children: offered.problem })) : (_jsxs(Box, { sx: { display: 'flex', gap: 2, alignItems: 'flex-start' }, children: [_jsx(Box, { sx: { color: 'fg.muted', pt: '2px' }, children: _jsx(DownloadIcon, { size: 16, "aria-hidden": "true" }) }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', minWidth: 0 }, children: [_jsxs(Box, { children: [_jsx(Link, { href: offered.url, download: offered.name, target: "_blank", rel: "noreferrer noopener", onClick: () => action?.(), sx: { fontWeight: 'semibold', wordBreak: 'break-word' }, children: offered.name }), said ? (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1, ml: 2 }, children: said })) : null] }), props.description ? (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: props.description })) : null] })] })) }));
64
+ return (_jsx(BlockFrame, { label: "File to download", weight: props.weight, testId: "a2ui-download", children: 'problem' in offered ? (_jsx(Problem, { children: offered.problem })) : (_jsxs(Box, { display: "flex", gap: 2, alignItems: "flex-start", children: [_jsx(Box, { color: "fg.muted", pt: "2px", children: _jsx(DownloadIcon, { size: 16, "aria-hidden": "true" }) }), _jsxs(Box, { display: "flex", flexDirection: "column", minWidth: 0, children: [_jsxs(Box, { children: [_jsx(Link, { href: offered.url, download: offered.name, target: "_blank", rel: "noreferrer noopener", onClick: () => action?.(), sx: { fontWeight: 'semibold', wordBreak: 'break-word' }, children: offered.name }), said ? (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1, ml: 2 }, children: said })) : null] }), props.description ? (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: props.description })) : null] })] })) }));
65
65
  }
66
66
  export const Download = ownImplementation('Download', DownloadView);
@@ -54,20 +54,6 @@ export function EvidenceView({ props }) {
54
54
  const sources = 'sources' in read ? read.sources : [];
55
55
  const shown = all ? sources : sources.slice(0, maxItems);
56
56
  const hidden = sources.length - shown.length;
57
- return (_jsxs(BlockFrame, { title: title, label: "Evidence", weight: props.weight, testId: "a2ui-evidence", children: ['problem' in read ? (_jsx(Problem, { children: read.problem })) : sources.length === 0 ? (_jsx(Quiet, { children: "Nothing cited yet." })) : (_jsx(Box, { as: "ol", sx: {
58
- m: 0,
59
- pl: 3,
60
- display: 'flex',
61
- flexDirection: 'column',
62
- gap: 2,
63
- }, children: shown.map((source, index) => (_jsxs("li", { children: [source.url ? (_jsxs(Link, { href: source.url, target: "_blank", rel: "noreferrer noopener", onClick: () => action?.(), sx: { fontWeight: 'semibold' }, children: [source.title, ' ', _jsx(LinkExternalIcon, { size: 12, "aria-label": "opens in a new tab" })] })) : (_jsx(Text, { sx: { fontWeight: 'semibold' }, children: source.title })), showPassages && source.passage ? (_jsx(Box, { as: "blockquote", sx: {
64
- m: 0,
65
- mt: 1,
66
- pl: 2,
67
- borderLeft: '3px solid',
68
- borderColor: 'border.default',
69
- color: 'fg.muted',
70
- fontSize: 1,
71
- }, children: source.passage })) : null] }, `${source.url}-${index}`))) })), hidden > 0 ? (_jsx(Box, { children: _jsxs(Button, { size: "small", variant: "invisible", onClick: () => setAll(true), children: [hidden, " more"] }) })) : null] }));
57
+ return (_jsxs(BlockFrame, { title: title, label: "Evidence", weight: props.weight, testId: "a2ui-evidence", children: ['problem' in read ? (_jsx(Problem, { children: read.problem })) : sources.length === 0 ? (_jsx(Quiet, { children: "Nothing cited yet." })) : (_jsx(Box, { as: "ol", m: 0, pl: 3, display: "flex", flexDirection: "column", gap: 2, children: shown.map((source, index) => (_jsxs("li", { children: [source.url ? (_jsxs(Link, { href: source.url, target: "_blank", rel: "noreferrer noopener", onClick: () => action?.(), sx: { fontWeight: 'semibold' }, children: [source.title, ' ', _jsx(LinkExternalIcon, { size: 12, "aria-label": "opens in a new tab" })] })) : (_jsx(Text, { sx: { fontWeight: 'semibold' }, children: source.title })), showPassages && source.passage ? (_jsx(Box, { as: "blockquote", m: 0, mt: 1, pl: 2, borderLeft: "3px solid", borderColor: "border.default", color: "fg.muted", fontSize: 1, children: source.passage })) : null] }, `${source.url}-${index}`))) })), hidden > 0 ? (_jsx(Box, { children: _jsxs(Button, { size: "small", variant: "invisible", onClick: () => setAll(true), children: [hidden, " more"] }) })) : null] }));
72
58
  }
73
59
  export const Evidence = ownImplementation('Evidence', EvidenceView);
@@ -89,18 +89,7 @@ export function FileUploadView({ props }) {
89
89
  return (_jsxs(BlockFrame, { label: label, weight: props.weight, testId: "a2ui-fileupload", children: [_jsxs(Box, { onDragOver: (event) => {
90
90
  event.preventDefault();
91
91
  setOver(true);
92
- }, onDragLeave: () => setOver(false), onDrop: onDrop, "data-testid": "a2ui-fileupload-drop", sx: {
93
- display: 'flex',
94
- flexDirection: 'column',
95
- alignItems: 'center',
96
- gap: 2,
97
- p: 3,
98
- border: '1px dashed',
99
- borderColor: over ? 'accent.fg' : 'border.default',
100
- borderRadius: CARD_RADIUS,
101
- bg: over ? 'accent.subtle' : 'canvas.subtle',
102
- textAlign: 'center',
103
- }, children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: label }), _jsx(Button, { leadingVisual: UploadIcon, "aria-describedby": hintId, onClick: () => input.current?.click(), children: multiple ? 'Choose files' : 'Choose a file' }), _jsxs(Text, { id: hintId, sx: { fontSize: 0, color: 'fg.muted' }, children: ["or drop ", multiple ? 'them' : 'it', " here. ", hint, "."] }), _jsx("input", { ref: input, type: "file", hidden: true, "aria-label": label, accept: accept?.join(','), multiple: multiple, onChange: event => {
92
+ }, onDragLeave: () => setOver(false), onDrop: onDrop, "data-testid": "a2ui-fileupload-drop", display: "flex", flexDirection: "column", alignItems: "center", gap: 2, p: 3, border: "1px dashed", borderColor: over ? 'accent.fg' : 'border.default', borderRadius: CARD_RADIUS, bg: over ? 'accent.subtle' : 'canvas.subtle', textAlign: "center", children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: label }), _jsx(Button, { leadingVisual: UploadIcon, "aria-describedby": hintId, onClick: () => input.current?.click(), children: multiple ? 'Choose files' : 'Choose a file' }), _jsxs(Text, { id: hintId, sx: { fontSize: 0, color: 'fg.muted' }, children: ["or drop ", multiple ? 'them' : 'it', " here. ", hint, "."] }), _jsx("input", { ref: input, type: "file", hidden: true, "aria-label": label, accept: accept?.join(','), multiple: multiple, onChange: event => {
104
93
  if (event.target.files) {
105
94
  void give(event.target.files);
106
95
  }
@@ -65,10 +65,7 @@ export function TableView({ props }) {
65
65
  choose(row);
66
66
  }
67
67
  };
68
- return (_jsxs(BlockFrame, { title: title, label: "Table", weight: props.weight, testId: "a2ui-table", children: ['problem' in read ? (_jsx(Problem, { children: read.problem })) : (_jsxs(Box, { sx: { overflowX: 'auto' }, children: [_jsxs(Box, { as: "table", role: selectable ? 'grid' : undefined, "aria-label": title || 'Table', sx: {
69
- width: '100%',
70
- borderCollapse: 'collapse',
71
- fontSize: 1,
68
+ return (_jsxs(BlockFrame, { title: title, label: "Table", weight: props.weight, testId: "a2ui-table", children: ['problem' in read ? (_jsx(Problem, { children: read.problem })) : (_jsxs(Box, { overflowX: "auto", children: [_jsxs(Box, { as: "table", role: selectable ? 'grid' : undefined, "aria-label": title || 'Table', width: "100%", borderCollapse: "collapse", fontSize: 1, sx: {
72
69
  '& th, & td': {
73
70
  textAlign: 'left',
74
71
  px: 2,
@@ -86,18 +83,13 @@ export function TableView({ props }) {
86
83
  onClick: () => choose(row),
87
84
  onKeyDown: (event) => onKey(event, row),
88
85
  }
89
- : null), sx: {
90
- cursor: selectable ? 'pointer' : undefined,
91
- bg: isSelected ? 'accent.subtle' : undefined,
92
- '&:hover': selectable
93
- ? { bg: isSelected ? 'accent.subtle' : 'canvas.subtle' }
94
- : undefined,
95
- '&:focus-visible': {
96
- outline: '2px solid',
97
- outlineColor: 'accent.fg',
98
- outlineOffset: '-2px',
99
- },
100
- }, children: columns.map(column => (_jsx("td", { children: asWords(row[column]) }, column))) }, page * pageSize + index));
101
- }) })] }), all.length === 0 ? _jsx(Quiet, { children: "No rows yet." }) : null] })), pages > 1 ? (_jsxs(Box, { as: "nav", "aria-label": "Pages", sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Button, { size: "small", disabled: page === 0, onClick: () => setPage(page - 1), children: "Previous" }), _jsxs(Text, { sx: { fontSize: 1, color: 'fg.muted' }, "aria-live": "polite", children: ["Page ", page + 1, " of ", pages] }), _jsx(Button, { size: "small", disabled: page >= pages - 1, onClick: () => setPage(page + 1), children: "Next" })] })) : null] }));
86
+ : null), cursor: selectable ? 'pointer' : undefined, bg: isSelected ? 'accent.subtle' : undefined, focusVisible: {
87
+ outline: '2px solid',
88
+ outlineColor: 'accent.fg',
89
+ outlineOffset: '-2px',
90
+ }, hover: selectable
91
+ ? { bg: isSelected ? 'accent.subtle' : 'canvas.subtle' }
92
+ : undefined, children: columns.map(column => (_jsx("td", { children: asWords(row[column]) }, column))) }, page * pageSize + index));
93
+ }) })] }), all.length === 0 ? _jsx(Quiet, { children: "No rows yet." }) : null] })), pages > 1 ? (_jsxs(Box, { as: "nav", "aria-label": "Pages", display: "flex", alignItems: "center", gap: 2, children: [_jsx(Button, { size: "small", disabled: page === 0, onClick: () => setPage(page - 1), children: "Previous" }), _jsxs(Text, { sx: { fontSize: 1, color: 'fg.muted' }, "aria-live": "polite", children: ["Page ", page + 1, " of ", pages] }), _jsx(Button, { size: "small", disabled: page >= pages - 1, onClick: () => setPage(page + 1), children: "Next" })] })) : null] }));
102
94
  }
103
95
  export const Table = ownImplementation('Table', TableView);