@datalayer/agent-runtimes 1.3.89 → 1.3.91

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 (265) 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/chat/words.d.ts +7 -0
  69. package/lib/chat/words.js +12 -0
  70. package/lib/components/a2ui/datalayer/Chart.js +4 -10
  71. package/lib/components/a2ui/datalayer/Chat.js +2 -10
  72. package/lib/components/a2ui/datalayer/Download.js +1 -1
  73. package/lib/components/a2ui/datalayer/Evidence.js +1 -15
  74. package/lib/components/a2ui/datalayer/FileUpload.js +1 -12
  75. package/lib/components/a2ui/datalayer/Table.js +9 -17
  76. package/lib/components/a2ui/datalayer/formWidgets.js +3 -2
  77. package/lib/components/a2ui/datalayer/parts.js +1 -16
  78. package/lib/components/a2ui/styles.js +16 -5
  79. package/lib/components/agents/AgentSummary.js +1 -51
  80. package/lib/components/cards/NotificationEventCard.js +6 -72
  81. package/lib/components/cards/OutputCard.js +4 -48
  82. package/lib/components/cards/ToolApprovalCard.js +2 -35
  83. package/lib/components/code-sandboxes/CodeSandboxCellVariables.js +1 -1
  84. package/lib/components/code-sandboxes/CodeSandboxEnvironmentSelect.js +4 -14
  85. package/lib/components/code-sandboxes/CodeSandboxPicker.js +16 -21
  86. package/lib/components/code-sandboxes/CodeSandboxVariables.js +2 -2
  87. package/lib/components/scheduler/ScheduleMenu.js +5 -10
  88. package/lib/components/specs/SpecPayloadPreview.js +1 -26
  89. package/lib/components/teams/A2ATeamGraph.d.ts +4 -3
  90. package/lib/components/teams/A2ATeamGraph.js +25 -71
  91. package/lib/components/teams/AnswerSurfacesView.js +2 -2
  92. package/lib/components/teams/NotebookPreview.js +1 -10
  93. package/lib/components/teams/NotebookPreviewView.js +2 -3
  94. package/lib/components/teams/SceneTranscript.js +3 -17
  95. package/lib/components/teams/SceneView.js +1 -8
  96. package/lib/components/teams/TeamNotebook.js +5 -13
  97. package/lib/components/teams/TeamNotebookView.js +2 -12
  98. package/lib/components/teams/index.d.ts +1 -0
  99. package/lib/components/teams/index.js +1 -0
  100. package/lib/components/teams/useBalloonRoom.d.ts +39 -0
  101. package/lib/components/teams/useBalloonRoom.js +89 -0
  102. package/lib/config/AgentConfiguration.js +22 -225
  103. package/lib/context/ContextDistribution.js +7 -41
  104. package/lib/context/ContextInspector.js +9 -107
  105. package/lib/context/ContextPanel.js +11 -86
  106. package/lib/context/ContextUsage.js +6 -34
  107. package/lib/context/CostTracker.js +7 -42
  108. package/lib/context/MessageHistory.js +3 -37
  109. package/lib/context/TurnGraphChart.js +9 -41
  110. package/lib/examples/A2UiAgentExample.js +6 -108
  111. package/lib/examples/A2UiComponentsGalleryExample.js +1 -1
  112. package/lib/examples/A2UiContactCardExample.js +1 -1
  113. package/lib/examples/A2UiJupyterOutputExample.js +25 -125
  114. package/lib/examples/A2UiRestaurantExample.js +1 -1
  115. package/lib/examples/A2UiViewerExample.js +1 -1
  116. package/lib/examples/AgUiAgenticExample.js +3 -35
  117. package/lib/examples/AgUiBackendToolRenderingExample.js +2 -25
  118. package/lib/examples/AgUiHaikuGenUiExample.js +2 -32
  119. package/lib/examples/AgUiHumanInTheLoopExample.js +5 -59
  120. package/lib/examples/AgUiSharedStateExample.js +6 -56
  121. package/lib/examples/AgUiToolsBasedGenUiExample.js +25 -120
  122. package/lib/examples/AgentA2AExample.js +1 -15
  123. package/lib/examples/AgentA2ATeamExample.js +6 -30
  124. package/lib/examples/AgentCheckpointsExample.js +11 -145
  125. package/lib/examples/AgentCodeSandboxExample.js +5 -108
  126. package/lib/examples/AgentCodeSandboxesExample.js +3 -30
  127. package/lib/examples/AgentCodemodeExample.js +9 -85
  128. package/lib/examples/AgentCompactionExample.js +3 -64
  129. package/lib/examples/AgentDecideExample.js +1 -13
  130. package/lib/examples/AgentEvalsExample.js +5 -60
  131. package/lib/examples/AgentGuardrailsExample.js +4 -28
  132. package/lib/examples/AgentHooksExample.js +1 -1
  133. package/lib/examples/AgentInferenceProviderExample.js +5 -96
  134. package/lib/examples/AgentMCPExample.js +7 -105
  135. package/lib/examples/AgentMemoryExample.js +5 -74
  136. package/lib/examples/AgentMonitoringExample.js +7 -53
  137. package/lib/examples/AgentNotificationsExample.js +3 -61
  138. package/lib/examples/AgentOtelExample.js +3 -72
  139. package/lib/examples/AgentOutputsExample.js +6 -81
  140. package/lib/examples/AgentParametersExample.js +2 -37
  141. package/lib/examples/AgentSkillsExample.js +3 -45
  142. package/lib/examples/AgentSubagentsExample.js +6 -56
  143. package/lib/examples/AgentToolApprovalsExample.js +1 -11
  144. package/lib/examples/AgentTriggersExample.js +29 -239
  145. package/lib/examples/AgentspecsExample.js +6 -60
  146. package/lib/examples/AssistantExample.js +5 -5
  147. package/lib/examples/AssistantGalleryExample.js +8 -65
  148. package/lib/examples/CellExample.js +1 -6
  149. package/lib/examples/ChatCustomExample.js +2 -31
  150. package/lib/examples/ChatExample.js +1 -9
  151. package/lib/examples/ChatStandaloneExample.js +3 -37
  152. package/lib/examples/CopilotKitLexicalExample.js +1 -24
  153. package/lib/examples/DecksAgent.js +1 -1
  154. package/lib/examples/DocumentPageAgent.js +1 -1
  155. package/lib/examples/HomeExample.js +14 -62
  156. package/lib/examples/Lexical2Example.js +3 -32
  157. package/lib/examples/LexicalAgentExample.js +2 -34
  158. package/lib/examples/LexicalAgentSidebarExample.js +3 -34
  159. package/lib/examples/LoopAppComputerExample.js +1 -1
  160. package/lib/examples/LoopShellExample.js +2 -2
  161. package/lib/examples/LoopStrategyExample.js +15 -87
  162. package/lib/examples/LoopWorkspaceEmbed.js +2 -18
  163. package/lib/examples/LoopWorkspaceExample.js +2 -2
  164. package/lib/examples/NotebookAgentExample.js +2 -33
  165. package/lib/examples/NotebookAgentSidebarExample.js +3 -46
  166. package/lib/examples/NotebookCollaborationExample.js +1 -31
  167. package/lib/examples/NotebookExample.js +1 -18
  168. package/lib/examples/NotebookPageAgent.js +1 -1
  169. package/lib/examples/ScenesExample.js +5 -24
  170. package/lib/examples/VoiceChatExample.js +1 -1
  171. package/lib/examples/components/AuthRequiredView.js +1 -7
  172. package/lib/examples/components/ErrorView.js +1 -8
  173. package/lib/examples/components/ExampleErrorBoundary.js +1 -14
  174. package/lib/examples/components/FooterMetrics.js +1 -7
  175. package/lib/examples/components/Header.js +12 -51
  176. package/lib/examples/components/HeaderControls.js +1 -9
  177. package/lib/examples/components/LexicalEditor.js +1 -8
  178. package/lib/examples/components/MainContent.js +1 -13
  179. package/lib/examples/components/MockFileBrowser.js +4 -40
  180. package/lib/examples/components/SessionTabs.js +1 -1
  181. package/lib/examples/components/TimeTravel.js +1 -13
  182. package/lib/examples/main.js +13 -81
  183. package/lib/examples/scenes/A2UiComponentsGalleryScene.js +3 -34
  184. package/lib/examples/scenes/A2UiContactCardScene.js +3 -35
  185. package/lib/examples/scenes/A2UiRestaurantScene.js +3 -53
  186. package/lib/examples/scenes/A2UiViewerScene.js +3 -34
  187. package/lib/examples/utils/AssistantGalleryGrid.js +6 -35
  188. package/lib/examples2/DatalayerNotebookExample.js +3 -33
  189. package/lib/examples2/NativeNavigationExample.js +4 -10
  190. package/lib/examples2/NotebookMutationsKernel.js +2 -1
  191. package/lib/examples2/NotebookMutationsServiceManager.js +2 -1
  192. package/lib/examples2/ReactRouterExample.js +14 -42
  193. package/lib/hooks/useToolApprovals.d.ts +2 -34
  194. package/lib/hooks/useToolApprovals.js +1 -64
  195. package/lib/identity/AgentIdentity.js +17 -62
  196. package/lib/identity/IdentityConnect.js +13 -59
  197. package/lib/identity/OAuthCallback.js +6 -44
  198. package/lib/lexical/ChatInlinePlugin.js +6 -14
  199. package/lib/loop/apps/AppFeedback.js +12 -3
  200. package/lib/loop/apps/AppRenderer.d.ts +4 -3
  201. package/lib/loop/apps/AppRenderer.js +11 -12
  202. package/lib/loop/apps/appspec.js +6 -3
  203. package/lib/loop/apps/feedback.d.ts +3 -2
  204. package/lib/loop/apps/feedback.js +4 -2
  205. package/lib/loop/core/index.d.ts +19 -0
  206. package/lib/loop/core/index.js +27 -0
  207. package/lib/loop/embed/AppEmbed.d.ts +1 -1
  208. package/lib/loop/embed/AppEmbed.js +2 -1
  209. package/lib/loop/embed/LoopEmbed.js +1 -7
  210. package/lib/loop/embed/embedConfig.d.ts +3 -3
  211. package/lib/loop/embed/embedConfig.js +2 -3
  212. package/lib/loop/embed/embedTheme.d.ts +4 -4
  213. package/lib/loop/embed/embedTheme.js +11 -7
  214. package/lib/loop/plugins/a2a-sidebar/A2ASidebar.js +7 -34
  215. package/lib/loop/plugins/a2ui/A2uiView.js +4 -12
  216. package/lib/loop/plugins/a2ui-surface/InlineSurface.js +1 -16
  217. package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.js +2 -12
  218. package/lib/loop/plugins/agents/AnonymousKeyBadge.js +3 -2
  219. package/lib/loop/plugins/agents/SandboxSelector.js +3 -7
  220. package/lib/loop/plugins/agents/SandboxView.js +4 -27
  221. package/lib/loop/plugins/agents/TeamMemberPicker.js +2 -2
  222. package/lib/loop/plugins/agentspecs/AgentspecPicker.js +3 -2
  223. package/lib/loop/plugins/app-activity/AppActivity.js +1 -1
  224. package/lib/loop/plugins/app-computer/AppComputer.js +32 -27
  225. package/lib/loop/plugins/app-elements/AppElements.js +2 -31
  226. package/lib/loop/plugins/app-page/AppPage.js +26 -8
  227. package/lib/loop/plugins/app-rules/AppRulesCard.js +4 -20
  228. package/lib/loop/plugins/assistant/index.js +1 -13
  229. package/lib/loop/plugins/chat/ChatView.js +89 -130
  230. package/lib/loop/plugins/checkpoints-sidebar/CheckpointsSidebar.js +2 -13
  231. package/lib/loop/plugins/decks/DeckSurface.js +2 -2
  232. package/lib/loop/plugins/document/DocumentView.js +4 -12
  233. package/lib/loop/plugins/document-toolbar/SandboxStatusItem.js +3 -8
  234. package/lib/loop/plugins/graph/GraphView.js +2 -2
  235. package/lib/loop/plugins/input-prompt/ComposerView.js +1 -1
  236. package/lib/loop/plugins/notebook/NotebookView.js +3 -11
  237. package/lib/loop/plugins/page-layout/SplitLayout.js +11 -34
  238. package/lib/loop/plugins/page-layout/TurnPanel.js +9 -35
  239. package/lib/loop/plugins/shell/useEditorPreviews.js +3 -2
  240. package/lib/loop/plugins/subagent-activity/SubagentPulse.js +1 -13
  241. package/lib/loop/plugins/window-frame/WindowFrame.js +10 -44
  242. package/lib/loop/plugins/window-frame/index.js +1 -1
  243. package/lib/loop/shell/LoopWorkspace.js +34 -77
  244. package/lib/loop/shell/PluginToggles.js +4 -15
  245. package/lib/loop/shell/SidebarRail.js +8 -40
  246. package/lib/loop/shell/ViewSwitcher.js +4 -24
  247. package/lib/loop-main.js +2 -3
  248. package/lib/mcp/McpServerManager.js +6 -37
  249. package/lib/portable/index.d.ts +11 -0
  250. package/lib/portable/index.js +20 -0
  251. package/lib/protocols/AGUIAdapter.js +2 -2
  252. package/lib/protocols/BaseProtocolAdapter.d.ts +2 -0
  253. package/lib/protocols/BaseProtocolAdapter.js +4 -0
  254. package/lib/specs/apps.js +6 -0
  255. package/lib/specs/appspecSchema.js +11 -4
  256. package/lib/stories/loop/ReferenceScreens.js +17 -91
  257. package/lib/stories/loop/pictures-main.js +1 -1
  258. package/lib/types/agentspecs.d.ts +5 -2
  259. package/lib/types/protocol.d.ts +2 -0
  260. package/lib/utils/approvals.d.ts +59 -0
  261. package/lib/utils/approvals.js +101 -0
  262. package/lib/voice/VoiceInput.js +3 -39
  263. package/package.json +2 -2
  264. package/lib/shims/primerAddonsBox.d.ts +0 -1
  265. package/lib/shims/primerAddonsBox.js +0 -7
@@ -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);
@@ -19,10 +19,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  * @module components/a2ui/datalayer/formWidgets
20
20
  */
21
21
  import { useState } from 'react';
22
- import { Box, FormControl, Text, TextInputWithTokens, ToggleSwitch, } from '@primer/react';
22
+ import { Box } from '@datalayer/primer-addons';
23
+ import { FormControl, Text, TextInputWithTokens, ToggleSwitch, } from '@primer/react';
23
24
  /** A `boolean` as a toggle switch. */
24
25
  export function SwitchWidget({ id, value, label, disabled, readonly, onChange, }) {
25
- return (_jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1 }, children: [_jsx(Text, { as: "span", id: `${id}-label`, sx: { fontWeight: 'semibold' }, children: label }), _jsx(ToggleSwitch, { size: "small", "aria-labelledby": `${id}-label`, checked: Boolean(value), disabled: disabled || readonly, onClick: () => onChange(!value) })] }));
26
+ return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 1, children: [_jsx(Text, { as: "span", id: `${id}-label`, sx: { fontWeight: 'semibold' }, children: label }), _jsx(ToggleSwitch, { size: "small", "aria-labelledby": `${id}-label`, checked: Boolean(value), disabled: disabled || readonly, onClick: () => onChange(!value) })] }));
26
27
  }
27
28
  /** An `array` of `string` items as tokens: typed, then Enter or a comma. */
28
29
  export function TagsWidget({ id, value, label, disabled, readonly, placeholder, onChange, }) {
@@ -5,22 +5,7 @@ import { Box } from '@datalayer/primer-addons';
5
5
  export const CARD_RADIUS = 'var(--theme-radius-card, 6px)';
6
6
  /** A block's frame: its title above, what it draws inside. */
7
7
  export function BlockFrame({ title, label, weight, children, testId, }) {
8
- return (_jsxs(Box, { as: "section", "aria-label": title || label, "data-testid": testId, sx: {
9
- display: 'flex',
10
- flexDirection: 'column',
11
- gap: 2,
12
- minWidth: 0,
13
- boxSizing: 'border-box',
14
- p: 3,
15
- border: '1px solid',
16
- borderColor: 'border.default',
17
- borderRadius: CARD_RADIUS,
18
- bg: 'canvas.default',
19
- color: 'fg.default',
20
- ...(typeof weight === 'number'
21
- ? { flex: `${weight}`, minHeight: 0 }
22
- : null),
23
- }, children: [title ? (_jsx(Heading, { as: "h3", sx: { fontSize: 2, m: 0 }, children: title })) : null, children] }));
8
+ return (_jsxs(Box, { as: "section", "aria-label": title || label, "data-testid": testId, display: "flex", flexDirection: "column", gap: 2, minWidth: 0, boxSizing: "border-box", p: 3, border: "1px solid", borderColor: "border.default", borderRadius: CARD_RADIUS, bg: "canvas.default", color: "fg.default", flex: typeof weight === 'number' ? `${weight}` : undefined, minHeight: typeof weight === 'number' ? 0 : undefined, children: [title ? (_jsx(Heading, { as: "h3", sx: { fontSize: 2, m: 0 }, children: title })) : null, children] }));
24
9
  }
25
10
  /** What a block says instead of what it was given, when that cannot be drawn. */
26
11
  export function Problem({ children }) {
@@ -36,21 +36,32 @@ export const A2UI_RENDER_SCOPE_SX = {
36
36
  '& .a2ui-caption': {
37
37
  color: 'var(--a2ui-text-caption-color, var(--a2ui-color-on-surface, #656d76))',
38
38
  },
39
+ /*
40
+ * A button is the theme's filled button (STUDIO P-04, T-30): its fill and
41
+ * its label are Primer's primary-button properties, which every theme and
42
+ * an application's accent set together (`themeAccentVars`), so the label
43
+ * is always the accent's own text on it. The label is a Text inside the
44
+ * button, which the `.a2ui-text` rule above paints in the surface's ink —
45
+ * a dark label on Spatial's dark accent — so it inherits the button's.
46
+ */
39
47
  '& .a2ui-button': {
40
48
  appearance: 'none',
41
49
  cursor: 'pointer',
42
- border: '1px solid var(--a2ui-color-primary, #1f883d)',
43
- background: 'var(--a2ui-color-primary, #1f883d)',
44
- color: 'var(--a2ui-color-on-primary, #ffffff)',
50
+ border: '1px solid var(--button-primary-bgColor-rest)',
51
+ background: 'var(--button-primary-bgColor-rest)',
52
+ color: 'var(--button-primary-fgColor-rest)',
45
53
  borderRadius: 'var(--a2ui-button-border-radius, 6px)',
46
54
  padding: 'var(--a2ui-button-padding, 5px 16px)',
47
55
  fontWeight: 'var(--a2ui-button-font-weight, 500)',
48
56
  boxShadow: 'var(--a2ui-button-box-shadow, none)',
49
57
  transition: 'background-color 0.15s ease, border-color 0.15s ease',
50
58
  },
59
+ '& .a2ui-button .a2ui-text': {
60
+ color: 'inherit',
61
+ },
51
62
  '& .a2ui-button:hover': {
52
- background: 'var(--a2ui-color-primary-hover, #1a7f37)',
53
- borderColor: 'var(--a2ui-color-primary-hover, #1a7f37)',
63
+ background: 'var(--button-primary-bgColor-hover)',
64
+ borderColor: 'var(--button-primary-bgColor-hover)',
54
65
  },
55
66
  '& .a2ui-button:disabled': {
56
67
  opacity: 0.6,
@@ -108,55 +108,5 @@ export const AgentSummary = ({ summary, title = 'Active Agent', }) => {
108
108
  const shortAgentName = strip(summary.agentName, MAX_AGENT_NAME_LENGTH);
109
109
  const badgeLabel = `${summary.agentName} · ${summary.location}`;
110
110
  const badgeLabelShort = `${shortAgentName} · ${summary.location}`;
111
- return (_jsxs(Box, { ref: badgeRef, sx: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsxs(Box, { as: "button", type: "button", title: badgeLabel, sx: {
112
- px: 2,
113
- py: '6px',
114
- maxWidth: 280,
115
- minWidth: 0,
116
- border: '1px solid',
117
- borderColor: hasError ? 'danger.emphasis' : 'border.default',
118
- borderRadius: 2,
119
- bg: hasError ? 'danger.subtle' : 'canvas.default',
120
- color: hasError ? 'danger.fg' : 'fg.default',
121
- fontSize: 0,
122
- cursor: 'default',
123
- display: 'flex',
124
- alignItems: 'center',
125
- gap: 1,
126
- }, children: [isCreating && _jsx(Spinner, { size: "small", sx: { width: 12, height: 12 } }), hasError && _jsx("span", { "aria-hidden": true, children: "\u26A0" }), _jsx(Box, { as: "span", sx: {
127
- display: 'block',
128
- minWidth: 0,
129
- overflow: 'hidden',
130
- textOverflow: 'ellipsis',
131
- whiteSpace: 'nowrap',
132
- }, children: badgeLabelShort })] }), isHovering && (_jsxs(Box, { sx: {
133
- position: 'absolute',
134
- top: 'calc(100% + 8px)',
135
- ...(opensLeftward ? { right: 0 } : { left: 0 }),
136
- width: OVERLAY_WIDTH,
137
- p: 2,
138
- border: '1px solid',
139
- borderColor: 'border.default',
140
- borderRadius: 2,
141
- bg: 'canvas.overlay',
142
- boxShadow: 'shadow.large',
143
- zIndex: 120,
144
- fontSize: 0,
145
- color: 'fg.default',
146
- }, children: [_jsx(Box, { sx: { mb: 1, fontWeight: 600 }, children: title }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Name: ", summary.agentName] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Location: ", summary.location] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Spec: ", summary.specId || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Harness: ", summary.harness || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Variant: ", summary.variant || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted' }, children: ["Status: ", isCreating ? 'creating' : summary.status || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted', wordBreak: 'break-all' }, children: ["Agent base URL: ", summary.baseUrl || '—'] }), _jsxs(Box, { sx: { color: 'fg.muted', wordBreak: 'break-all' }, children: ["Code sandbox base URL:", ' ', summary.sandboxBaseUrl ? (_jsx(Box, { as: "a", href: summary.sandboxBaseUrl, target: "_blank", rel: "noopener noreferrer", sx: { color: 'accent.fg', textDecoration: 'underline' }, children: summary.sandboxBaseUrl })) : ('—')] }), _jsxs(Box, { sx: {
147
- color: 'fg.muted',
148
- wordBreak: 'break-all',
149
- display: 'flex',
150
- alignItems: 'center',
151
- gap: 1,
152
- }, children: ["Agent ID:", ' ', summary.agentId ? (summary.agentId) : isCreating ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small", sx: { width: 12, height: 12 } }), "Creating\u2026"] })) : ('—')] }), _jsxs(Box, { sx: { color: 'fg.muted', wordBreak: 'break-all' }, children: ["Agent status:", ' ', hasAgent && agentStatusUrl ? (_jsx(Box, { as: "a", href: agentStatusUrl, target: "_blank", rel: "noopener noreferrer", sx: { color: 'accent.fg', textDecoration: 'underline' }, children: agentStatusUrl })) : ('n/a')] }), _jsxs(Box, { sx: { color: 'fg.muted', wordBreak: 'break-all' }, children: ["Code sandbox status:", ' ', sandboxStatusUrl ? (_jsx(Box, { as: "a", href: sandboxStatusUrl, target: "_blank", rel: "noopener noreferrer", sx: { color: 'accent.fg', textDecoration: 'underline' }, children: sandboxStatusUrl })) : ('n/a')] }), hasError && (_jsxs(Box, { sx: {
153
- mt: 1,
154
- p: 1,
155
- border: '1px solid',
156
- borderColor: 'danger.muted',
157
- borderRadius: 2,
158
- bg: 'danger.subtle',
159
- color: 'danger.fg',
160
- wordBreak: 'break-word',
161
- }, children: ["Error: ", summary.error] }))] }))] }));
111
+ return (_jsxs(Box, { ref: badgeRef, position: "relative", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsxs(Box, { as: "button", type: "button", title: badgeLabel, px: 2, py: "6px", maxWidth: 280, minWidth: 0, border: "1px solid", borderColor: hasError ? 'danger.emphasis' : 'border.default', borderRadius: 2, bg: hasError ? 'danger.subtle' : 'canvas.default', color: hasError ? 'danger.fg' : 'fg.default', fontSize: 0, cursor: "default", display: "flex", alignItems: "center", gap: 1, children: [isCreating && _jsx(Spinner, { size: "small", sx: { width: 12, height: 12 } }), hasError && _jsx("span", { "aria-hidden": true, children: "\u26A0" }), _jsx(Box, { as: "span", display: "block", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: badgeLabelShort })] }), isHovering && (_jsxs(Box, { position: "absolute", top: "calc(100% + 8px)", width: OVERLAY_WIDTH, p: 2, border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.overlay", boxShadow: "shadow.large", zIndex: 120, fontSize: 0, color: "fg.default", right: opensLeftward ? 0 : undefined, left: opensLeftward ? undefined : 0, children: [_jsx(Box, { mb: 1, fontWeight: 600, children: title }), _jsxs(Box, { color: "fg.muted", children: ["Name: ", summary.agentName] }), _jsxs(Box, { color: "fg.muted", children: ["Location: ", summary.location] }), _jsxs(Box, { color: "fg.muted", children: ["Spec: ", summary.specId || '—'] }), _jsxs(Box, { color: "fg.muted", children: ["Harness: ", summary.harness || '—'] }), _jsxs(Box, { color: "fg.muted", children: ["Variant: ", summary.variant || '—'] }), _jsxs(Box, { color: "fg.muted", children: ["Status: ", isCreating ? 'creating' : summary.status || '—'] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", children: ["Agent base URL: ", summary.baseUrl || '—'] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", children: ["Code sandbox base URL:", ' ', summary.sandboxBaseUrl ? (_jsx(Box, { as: "a", href: summary.sandboxBaseUrl, target: "_blank", rel: "noopener noreferrer", color: "accent.fg", textDecoration: "underline", children: summary.sandboxBaseUrl })) : ('—')] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", display: "flex", alignItems: "center", gap: 1, children: ["Agent ID:", ' ', summary.agentId ? (summary.agentId) : isCreating ? (_jsxs(_Fragment, { children: [_jsx(Spinner, { size: "small", sx: { width: 12, height: 12 } }), "Creating\u2026"] })) : ('—')] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", children: ["Agent status:", ' ', hasAgent && agentStatusUrl ? (_jsx(Box, { as: "a", href: agentStatusUrl, target: "_blank", rel: "noopener noreferrer", color: "accent.fg", textDecoration: "underline", children: agentStatusUrl })) : ('n/a')] }), _jsxs(Box, { color: "fg.muted", wordBreak: "break-all", children: ["Code sandbox status:", ' ', sandboxStatusUrl ? (_jsx(Box, { as: "a", href: sandboxStatusUrl, target: "_blank", rel: "noopener noreferrer", color: "accent.fg", textDecoration: "underline", children: sandboxStatusUrl })) : ('n/a')] }), hasError && (_jsxs(Box, { mt: 1, p: 1, border: "1px solid", borderColor: "danger.muted", borderRadius: 2, bg: "danger.subtle", color: "danger.fg", wordBreak: "break-word", children: ["Error: ", summary.error] }))] }))] }));
162
112
  };
@@ -74,35 +74,7 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
74
74
  }
75
75
  detailEntries.push({ label: `payload.${key}`, value: String(value) });
76
76
  });
77
- return (_jsxs(Box, { sx: {
78
- minWidth: 0,
79
- maxWidth: '100%',
80
- overflow: 'hidden',
81
- p: 3,
82
- borderRadius: 2,
83
- border: '1px solid',
84
- borderColor: event.read ? 'border.default' : 'accent.muted',
85
- bg: event.read ? 'canvas.default' : 'accent.subtle',
86
- }, children: [_jsxs(Box, { sx: {
87
- display: 'flex',
88
- justifyContent: 'space-between',
89
- alignItems: 'flex-start',
90
- gap: 2,
91
- mb: 1,
92
- minWidth: 0,
93
- }, children: [_jsxs(Box, { sx: {
94
- display: 'flex',
95
- alignItems: 'center',
96
- gap: 2,
97
- minWidth: 0,
98
- flex: 1,
99
- }, children: [_jsx(Label, { variant: EVENT_KIND_VARIANT[eventKind] ?? 'secondary', children: eventKind }), _jsx(Truncate, { maxWidth: "50%", title: String(eventTitle || ''), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: eventTitle }), eventKind === 'agent-output' && event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) })), eventOrigin && (_jsxs(Label, { variant: "secondary", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Origin: ", eventOrigin] }))] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [hasAgentRoute && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent?.(runtimeId), children: "View agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), event.payload && (_jsxs(Box, { sx: {
100
- fontSize: 0,
101
- color: 'fg.muted',
102
- mt: 1,
103
- minWidth: 0,
104
- overflowWrap: 'anywhere',
105
- }, children: [(startedAt ||
77
+ return (_jsxs(Box, { minWidth: 0, maxWidth: "100%", overflow: "hidden", p: 3, borderRadius: 2, border: "1px solid", borderColor: event.read ? 'border.default' : 'accent.muted', bg: event.read ? 'canvas.default' : 'accent.subtle', children: [_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 2, mb: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, minWidth: 0, flex: 1, children: [_jsx(Label, { variant: EVENT_KIND_VARIANT[eventKind] ?? 'secondary', children: eventKind }), _jsx(Truncate, { maxWidth: "50%", title: String(eventTitle || ''), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: eventTitle }), eventKind === 'agent-output' && event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) })), eventOrigin && (_jsxs(Label, { variant: "secondary", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Origin: ", eventOrigin] }))] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [hasAgentRoute && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent?.(runtimeId), children: "View agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), event.payload && (_jsxs(Box, { fontSize: 0, color: "fg.muted", mt: 1, minWidth: 0, overflowWrap: "anywhere", children: [(startedAt ||
106
78
  endedAt ||
107
79
  (eventKind === 'agent-output' &&
108
80
  event.payload.duration_ms != null)) && (_jsxs(Text, { as: "p", children: [startedAt ? `Started: ${formatRelativeTime(startedAt)}` : '', startedAt && endedAt ? ' · ' : '', endedAt ? `Ended: ${formatRelativeTime(endedAt)}` : '', (startedAt || endedAt) &&
@@ -111,14 +83,7 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
111
83
  ? ' · '
112
84
  : '', eventKind === 'agent-output' && event.payload.duration_ms != null
113
85
  ? `Duration: ${formatDurationMs(Number(event.payload.duration_ms))}`
114
- : ''] })), eventKind.includes('guardrail') && event.payload.message && (_jsx(Text, { as: "p", sx: { mb: 1 }, children: String(event.payload.message) })), eventKind.includes('guardrail') && event.payload.action_taken && (_jsxs(Text, { as: "p", children: ["Action: ", String(event.payload.action_taken)] })), eventKind === 'agent-started' && event.payload.trigger_type && (_jsxs(Text, { as: "p", children: ["Trigger: ", String(event.payload.trigger_type)] })), outputText && (_jsx(Box, { sx: {
115
- mt: 2,
116
- p: 2,
117
- borderRadius: 2,
118
- border: '1px solid',
119
- borderColor: 'border.muted',
120
- bg: 'canvas.subtle',
121
- }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'flex-start', gap: 1 }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
86
+ : ''] })), eventKind.includes('guardrail') && event.payload.message && (_jsx(Text, { as: "p", sx: { mb: 1 }, children: String(event.payload.message) })), eventKind.includes('guardrail') && event.payload.action_taken && (_jsxs(Text, { as: "p", children: ["Action: ", String(event.payload.action_taken)] })), eventKind === 'agent-started' && event.payload.trigger_type && (_jsxs(Text, { as: "p", children: ["Trigger: ", String(event.payload.trigger_type)] })), outputText && (_jsx(Box, { mt: 2, p: 2, borderRadius: 2, border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", children: _jsxs(Box, { display: "flex", alignItems: "flex-start", gap: 1, children: [_jsx(Box, { flex: 1, minWidth: 0, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
122
87
  e.preventDefault();
123
88
  setIsOutputExpanded(prev => !prev);
124
89
  }, style: {
@@ -126,23 +91,7 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
126
91
  display: 'flex',
127
92
  alignItems: 'center',
128
93
  minWidth: 0,
129
- }, children: _jsxs(Box, { sx: {
130
- display: 'flex',
131
- alignItems: 'center',
132
- gap: 2,
133
- minWidth: 0,
134
- width: '100%',
135
- flexWrap: 'nowrap',
136
- }, children: [_jsx(Box, { sx: {
137
- display: 'flex',
138
- alignItems: 'center',
139
- color: 'fg.muted',
140
- flexShrink: 0,
141
- transition: 'transform 0.15s ease',
142
- transform: isOutputExpanded
143
- ? 'rotate(180deg)'
144
- : 'rotate(0deg)',
145
- }, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
94
+ }, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, minWidth: 0, width: "100%", flexWrap: "nowrap", children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", flexShrink: 0, transition: "transform 0.15s ease", transform: isOutputExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
146
95
  fontSize: 0,
147
96
  fontWeight: 'semibold',
148
97
  flexShrink: 0,
@@ -151,31 +100,16 @@ export function NotificationEventCard({ event, onToggleRead, onDelete, onOpenAge
151
100
  color: 'fg.muted',
152
101
  minWidth: 0,
153
102
  flex: 1,
154
- }, children: outputText })] }) }), _jsx(Box, { sx: { mt: 2 }, children: _jsx(Box, { sx: streamdownMarkdownStyles, children: _jsx(Streamdown, { children: outputText }) }) })] }) }), _jsx(Button, { size: "small", variant: "invisible", sx: { p: 1, flexShrink: 0 }, title: "Download output markdown", "aria-label": "Download output markdown", onClick: () => {
103
+ }, children: outputText })] }) }), _jsx(Box, { mt: 2, children: _jsx(Box, { sx: streamdownMarkdownStyles, children: _jsx(Streamdown, { children: outputText }) }) })] }) }), _jsx(Button, { size: "small", variant: "invisible", sx: { p: 1, flexShrink: 0 }, title: "Download output markdown", "aria-label": "Download output markdown", onClick: () => {
155
104
  const payload = createMarkdownDownloadPayload(outputText, `${runtimeId}-output`);
156
105
  downloadTextPayload(payload);
157
- }, children: _jsx(DownloadIcon, { size: 12 }) })] }) })), _jsx(Box, { sx: {
158
- mt: 2,
159
- p: 2,
160
- borderRadius: 2,
161
- border: '1px solid',
162
- borderColor: 'border.muted',
163
- bg: 'canvas.subtle',
164
- }, children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
106
+ }, children: _jsx(DownloadIcon, { size: 12 }) })] }) })), _jsx(Box, { mt: 2, p: 2, borderRadius: 2, border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
165
107
  e.preventDefault();
166
108
  setIsDetailsExpanded(prev => !prev);
167
109
  }, style: {
168
110
  cursor: 'pointer',
169
111
  display: 'flex',
170
112
  alignItems: 'center',
171
- }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [_jsx(Box, { sx: {
172
- display: 'flex',
173
- alignItems: 'center',
174
- color: 'fg.muted',
175
- transition: 'transform 0.15s ease',
176
- transform: isDetailsExpanded
177
- ? 'rotate(180deg)'
178
- : 'rotate(0deg)',
179
- }, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsx(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: detailEntries.map(({ label, value }) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [label, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: value })] }, label))) })] }) })] }))] }));
113
+ }, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", transition: "transform 0.15s ease", transform: isDetailsExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsx(Box, { mt: 2, display: "grid", gap: 1, children: detailEntries.map(({ label, value }) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [label, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: value })] }, label))) })] }) })] }))] }));
180
114
  }
181
115
  export default NotificationEventCard;
@@ -23,37 +23,9 @@ export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
23
23
  const startedAt = event?.started_at || event?.payload?.started_at || null;
24
24
  const endedAt = event?.ended_at || event?.payload?.ended_at || null;
25
25
  const durationMs = event.kind === 'agent-output' ? event.payload?.duration_ms : null;
26
- return (_jsxs(Box, { sx: {
27
- minWidth: 0,
28
- maxWidth: '100%',
29
- overflow: 'hidden',
30
- p: 3,
31
- borderRadius: 2,
32
- border: '1px solid',
33
- borderColor: event.read ? 'border.default' : 'accent.muted',
34
- bg: event.read ? 'canvas.default' : 'accent.subtle',
35
- }, children: [_jsxs(Box, { sx: {
36
- display: 'flex',
37
- justifyContent: 'space-between',
38
- alignItems: 'flex-start',
39
- gap: 2,
40
- mb: 2,
41
- minWidth: 0,
42
- }, children: [_jsxs(Box, { sx: {
43
- display: 'flex',
44
- alignItems: 'center',
45
- gap: 2,
46
- minWidth: 0,
47
- flex: 1,
48
- }, children: [_jsx(Label, { variant: "success", children: "output" }), _jsx(Truncate, { maxWidth: "50%", title: String(event.title || runtimeId), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: event.title || runtimeId }), event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) }))] }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [event.agent_id && onOpenAgent && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent(String(event.agent_id)), children: "Open agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), (startedAt || endedAt || durationMs != null) && (_jsxs(Text, { as: "p", sx: { fontSize: 0, color: 'fg.muted', mb: 2 }, children: [startedAt ? `Started: ${formatRelativeTime(startedAt)}` : '', startedAt && endedAt ? ' · ' : '', endedAt ? `Ended: ${formatRelativeTime(endedAt)}` : '', (startedAt || endedAt) && durationMs != null ? ' · ' : '', durationMs != null
26
+ return (_jsxs(Box, { minWidth: 0, maxWidth: "100%", overflow: "hidden", p: 3, borderRadius: 2, border: "1px solid", borderColor: event.read ? 'border.default' : 'accent.muted', bg: event.read ? 'canvas.default' : 'accent.subtle', children: [_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 2, mb: 2, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, minWidth: 0, flex: 1, children: [_jsx(Label, { variant: "success", children: "output" }), _jsx(Truncate, { maxWidth: "50%", title: String(event.title || runtimeId), sx: { fontWeight: 'semibold', fontSize: 1, minWidth: 0 }, children: event.title || runtimeId }), event.payload?.exit_status && (_jsxs(Label, { variant: "success", sx: { fontSize: 0, whiteSpace: 'nowrap' }, children: ["Status: ", String(event.payload.exit_status)] })), event.agent_id && (_jsx(Truncate, { maxWidth: 240, title: String(event.agent_id), children: _jsx(Label, { variant: "secondary", sx: { fontSize: 0, maxWidth: '100%' }, children: event.agent_id }) }))] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [event.agent_id && onOpenAgent && (_jsx(Button, { size: "small", variant: "invisible", onClick: () => onOpenAgent(String(event.agent_id)), children: "Open agent" })), event.created_at && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', whiteSpace: 'nowrap' }, children: new Date(event.created_at).toLocaleString() })), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead(event), sx: { p: 1 }, children: event.read ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete(event), sx: { p: 1, color: 'danger.fg' }, children: _jsx(TrashIcon, { size: 12 }) })] })] }), (startedAt || endedAt || durationMs != null) && (_jsxs(Text, { as: "p", sx: { fontSize: 0, color: 'fg.muted', mb: 2 }, children: [startedAt ? `Started: ${formatRelativeTime(startedAt)}` : '', startedAt && endedAt ? ' · ' : '', endedAt ? `Ended: ${formatRelativeTime(endedAt)}` : '', (startedAt || endedAt) && durationMs != null ? ' · ' : '', durationMs != null
49
27
  ? `Duration: ${formatDurationMs(Number(durationMs))}`
50
- : ''] })), outputText && (_jsx(Box, { sx: {
51
- p: 2,
52
- borderRadius: 2,
53
- border: '1px solid',
54
- borderColor: 'border.muted',
55
- bg: 'canvas.subtle',
56
- }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'flex-start', gap: 1 }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0 }, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
28
+ : ''] })), outputText && (_jsx(Box, { p: 2, borderRadius: 2, border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", children: _jsxs(Box, { display: "flex", alignItems: "flex-start", gap: 1, children: [_jsx(Box, { flex: 1, minWidth: 0, children: _jsxs("details", { open: isOutputExpanded, children: [_jsx("summary", { onClick: e => {
57
29
  e.preventDefault();
58
30
  setIsOutputExpanded(prev => !prev);
59
31
  }, style: {
@@ -61,23 +33,7 @@ export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
61
33
  display: 'flex',
62
34
  alignItems: 'center',
63
35
  minWidth: 0,
64
- }, children: _jsxs(Box, { sx: {
65
- display: 'flex',
66
- alignItems: 'center',
67
- gap: 2,
68
- minWidth: 0,
69
- width: '100%',
70
- flexWrap: 'nowrap',
71
- }, children: [_jsx(Box, { sx: {
72
- display: 'flex',
73
- alignItems: 'center',
74
- color: 'fg.muted',
75
- flexShrink: 0,
76
- transition: 'transform 0.15s ease',
77
- transform: isOutputExpanded
78
- ? 'rotate(180deg)'
79
- : 'rotate(0deg)',
80
- }, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
36
+ }, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, minWidth: 0, width: "100%", flexWrap: "nowrap", children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", flexShrink: 0, transition: "transform 0.15s ease", transform: isOutputExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: {
81
37
  fontSize: 0,
82
38
  fontWeight: 'semibold',
83
39
  flexShrink: 0,
@@ -86,7 +42,7 @@ export function OutputCard({ event, onToggleRead, onDelete, onOpenAgent, }) {
86
42
  color: 'fg.muted',
87
43
  minWidth: 0,
88
44
  flex: 1,
89
- }, children: outputText })] }) }), _jsx(Box, { sx: { mt: 2 }, children: _jsx(Box, { sx: streamdownMarkdownStyles, children: _jsx(Streamdown, { children: outputText }) }) })] }) }), _jsx(Button, { size: "small", variant: "invisible", sx: { p: 1, flexShrink: 0 }, title: "Download output markdown", "aria-label": "Download output markdown", onClick: () => {
45
+ }, children: outputText })] }) }), _jsx(Box, { mt: 2, children: _jsx(Box, { sx: streamdownMarkdownStyles, children: _jsx(Streamdown, { children: outputText }) }) })] }) }), _jsx(Button, { size: "small", variant: "invisible", sx: { p: 1, flexShrink: 0 }, title: "Download output markdown", "aria-label": "Download output markdown", onClick: () => {
90
46
  const payload = createMarkdownDownloadPayload(outputText, `${runtimeId}-output`);
91
47
  downloadTextPayload(payload);
92
48
  }, children: _jsx(DownloadIcon, { size: 12 }) })] }) }))] }));
@@ -43,32 +43,7 @@ export function ToolApprovalCard({ approval, onApprove, onReject, onToggleRead,
43
43
  : approval.status === 'pending'
44
44
  ? ', review pending'
45
45
  : `, ${statusDescriptor}`;
46
- return (_jsx(Box, { sx: {
47
- p: 3,
48
- borderRadius: 2,
49
- border: '1px solid',
50
- borderColor: isRead ? 'transparent' : 'accent.muted',
51
- bg: isRead ? 'canvas.default' : 'accent.subtle',
52
- }, children: _jsxs(Box, { sx: {
53
- display: 'flex',
54
- justifyContent: 'space-between',
55
- alignItems: 'flex-start',
56
- gap: 3,
57
- }, children: [_jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [_jsxs(Box, { sx: {
58
- display: 'flex',
59
- alignItems: 'center',
60
- gap: 2,
61
- mb: 1,
62
- flexWrap: 'wrap',
63
- }, children: [_jsx(Text, { sx: { fontWeight: 'bold', fontSize: 2 }, children: approval.toolName }), _jsx(Label, { variant: statusConfig.variant, children: statusConfig.label }), _jsx(Label, { variant: riskConfig.variant, children: riskConfig.label }), !isRead && _jsx(Label, { variant: "accent", children: "Unread" })] }), _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: ["Requested by ", approval.requestedBy, ' ', formatRelativeTime(approval.requestedAt), reviewSummary] }), _jsx(Box, { sx: {
64
- mt: 2,
65
- width: '100%',
66
- p: 2,
67
- borderRadius: 2,
68
- border: '1px solid',
69
- borderColor: 'border.muted',
70
- bg: 'canvas.subtle',
71
- }, children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
46
+ return (_jsx(Box, { p: 3, borderRadius: 2, border: "1px solid", borderColor: isRead ? 'transparent' : 'accent.muted', bg: isRead ? 'canvas.default' : 'accent.subtle', children: _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 3, children: [_jsxs(Box, { flex: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 1, flexWrap: "wrap", children: [_jsx(Text, { sx: { fontWeight: 'bold', fontSize: 2 }, children: approval.toolName }), _jsx(Label, { variant: statusConfig.variant, children: statusConfig.label }), _jsx(Label, { variant: riskConfig.variant, children: riskConfig.label }), !isRead && _jsx(Label, { variant: "accent", children: "Unread" })] }), _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: ["Requested by ", approval.requestedBy, ' ', formatRelativeTime(approval.requestedAt), reviewSummary] }), _jsx(Box, { mt: 2, width: "100%", p: 2, borderRadius: 2, border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
72
47
  e.preventDefault();
73
48
  setIsDetailsExpanded(prev => !prev);
74
49
  }, style: {
@@ -76,14 +51,6 @@ export function ToolApprovalCard({ approval, onApprove, onReject, onToggleRead,
76
51
  display: 'flex',
77
52
  alignItems: 'center',
78
53
  minWidth: 0,
79
- }, children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [_jsx(Box, { sx: {
80
- display: 'flex',
81
- alignItems: 'center',
82
- color: 'fg.muted',
83
- transition: 'transform 0.15s ease',
84
- transform: isDetailsExpanded
85
- ? 'rotate(180deg)'
86
- : 'rotate(0deg)',
87
- }, children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsxs(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: [_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Source:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [approval.sourceName, " (", approval.sourceType, ")"] })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Request ID:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.id })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested at:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: new Date(approval.requestedAt).toLocaleString() })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested by:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.requestedBy })] }), approval.reviewedAt && (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reviewed at:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [new Date(approval.reviewedAt).toLocaleString(), " by", ' ', approval.reviewedBy || 'reviewer'] })] })), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Parameters:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: parameterCount })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reason:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.reason || approval.toolDescription })] })] }), parameterCount > 0 && (_jsx(Box, { sx: { mt: 2, display: 'grid', gap: 1 }, children: Object.entries(approval.parameters || {}).map(([key, value]) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [key, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: String(value) })] }, key))) }))] }) })] }), approval.status === 'pending' && (_jsxs(Box, { sx: { display: 'flex', gap: 2, flexShrink: 0 }, children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckCircleIcon, onClick: () => onApprove?.(approval.id), children: "Approve" }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => onReject?.(approval.id), children: "Reject" })] })), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1, flexShrink: 0 }, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead?.(approval.id, isRead), sx: { p: 1 }, title: `Mark as ${isRead ? 'unread' : 'read'}`, "aria-label": `Mark as ${isRead ? 'unread' : 'read'}`, children: isRead ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete?.(approval.id), sx: { p: 1, color: 'danger.fg' }, title: "Delete", "aria-label": "Delete", children: _jsx(TrashIcon, { size: 12 }) })] })] }) }));
54
+ }, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", transition: "transform 0.15s ease", transform: isDetailsExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsxs(Box, { mt: 2, display: "grid", gap: 1, children: [_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Source:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [approval.sourceName, " (", approval.sourceType, ")"] })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Request ID:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.id })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested at:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: new Date(approval.requestedAt).toLocaleString() })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested by:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.requestedBy })] }), approval.reviewedAt && (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reviewed at:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [new Date(approval.reviewedAt).toLocaleString(), " by", ' ', approval.reviewedBy || 'reviewer'] })] })), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Parameters:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: parameterCount })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reason:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.reason || approval.toolDescription })] })] }), parameterCount > 0 && (_jsx(Box, { mt: 2, display: "grid", gap: 1, children: Object.entries(approval.parameters || {}).map(([key, value]) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [key, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: String(value) })] }, key))) }))] }) })] }), approval.status === 'pending' && (_jsxs(Box, { display: "flex", gap: 2, flexShrink: 0, children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckCircleIcon, onClick: () => onApprove?.(approval.id), children: "Approve" }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => onReject?.(approval.id), children: "Reject" })] })), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead?.(approval.id, isRead), sx: { p: 1 }, title: `Mark as ${isRead ? 'unread' : 'read'}`, "aria-label": `Mark as ${isRead ? 'unread' : 'read'}`, children: isRead ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete?.(approval.id), sx: { p: 1, color: 'danger.fg' }, title: "Delete", "aria-label": "Delete", children: _jsx(TrashIcon, { size: 12 }) })] })] }) }));
88
55
  }
89
56
  export default ToolApprovalCard;
@@ -147,7 +147,7 @@ export function CodeSandboxCellVariables(props) {
147
147
  setWillSaveOutput(false);
148
148
  }
149
149
  }, [willSaveOutput]);
150
- return (_jsxs(Box, { as: "form", sx: { p: 3 }, children: [_jsxs(FormControl, { children: [_jsx(FormControl.Label, { id: "cell-input-variables", children: trans.__('Inputs') }), _jsxs(Autocomplete, { children: [_jsx(Autocomplete.Input, { as: TextInputWithTokens, tokens: inputsState.filter(item => item.selected), onTokenRemove: onTokenRemove, onChange: handleChange }), _jsx(Autocomplete.Overlay, { children: _jsx(Autocomplete.Menu, { addNewItem: filterVal &&
150
+ return (_jsxs(Box, { as: "form", p: 3, children: [_jsxs(FormControl, { children: [_jsx(FormControl.Label, { id: "cell-input-variables", children: trans.__('Inputs') }), _jsxs(Autocomplete, { children: [_jsx(Autocomplete.Input, { as: TextInputWithTokens, tokens: inputsState.filter(item => item.selected), onTokenRemove: onTokenRemove, onChange: handleChange }), _jsx(Autocomplete.Overlay, { children: _jsx(Autocomplete.Menu, { addNewItem: filterVal &&
151
151
  !inputsState.find(localItem => localItem.text === filterVal)
152
152
  ? {
153
153
  id: filterVal,
@@ -1,5 +1,6 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { ActionList, ActionMenu, Box, Label, Link, Text } from '@primer/react';
2
+ import { Box } from '@datalayer/primer-addons';
3
+ import { ActionList, ActionMenu, Label, Link, Text } from '@primer/react';
3
4
  /**
4
5
  * The labels of an option, on one line: cost, name, provider, where.
5
6
  *
@@ -9,12 +10,7 @@ import { ActionList, ActionMenu, Box, Label, Link, Text } from '@primer/react';
9
10
  */
10
11
  function OptionLabels(props) {
11
12
  const { option } = props;
12
- return (_jsxs(Box, { as: "span", sx: {
13
- display: 'inline-flex',
14
- alignItems: 'center',
15
- gap: 1,
16
- whiteSpace: 'nowrap',
17
- }, children: [option.burningRate ? (_jsxs(Label, { size: "small", variant: "sponsors", children: [option.burningRate, " credits/second"] })) : null, option.gpu ? (_jsx(Label, { size: "small", variant: "success", children: "GPU" })) : null, option.version ? (_jsx(Label, { size: "small", variant: "secondary", children: option.version })) : null, option.sizeClass ? (_jsx(Label, { size: "small", variant: "secondary", children: option.sizeClass })) : null, option.name ? _jsx(Label, { size: "small", children: option.name }) : null, option.providerTitle ? (_jsx(Label, { size: "small", variant: "accent", children: option.providerTitle })) : null, option.location ? (_jsx(Label, { size: "small", variant: "secondary", children: option.location })) : null] }));
13
+ return (_jsxs(Box, { as: "span", display: "inline-flex", alignItems: "center", gap: 1, whiteSpace: "nowrap", children: [option.burningRate ? (_jsxs(Label, { size: "small", variant: "sponsors", children: [option.burningRate, " credits/second"] })) : null, option.gpu ? (_jsx(Label, { size: "small", variant: "success", children: "GPU" })) : null, option.version ? (_jsx(Label, { size: "small", variant: "secondary", children: option.version })) : null, option.sizeClass ? (_jsx(Label, { size: "small", variant: "secondary", children: option.sizeClass })) : null, option.name ? _jsx(Label, { size: "small", children: option.name }) : null, option.providerTitle ? (_jsx(Label, { size: "small", variant: "accent", children: option.providerTitle })) : null, option.location ? (_jsx(Label, { size: "small", variant: "secondary", children: option.location })) : null] }));
18
14
  }
19
15
  export function CodeSandboxEnvironmentSelect(props) {
20
16
  const { disabled, onSelect, options, overlayWidth = 'xlarge', placeholder = 'Select an environment', selectedKey, } = props;
@@ -68,13 +64,7 @@ export function CodeSandboxEnvironmentSelect(props) {
68
64
  gridTemplateColumns: 'min-content minmax(0, 1fr) min-content',
69
65
  },
70
66
  '& [data-component="text"]': { width: '100%', textAlign: 'left' },
71
- }, children: selected ? (_jsxs(Box, { as: "span", sx: {
72
- display: 'flex',
73
- width: '100%',
74
- alignItems: 'center',
75
- justifyContent: 'space-between',
76
- gap: 2,
77
- }, children: [_jsx(Text, { children: selected.title }), _jsx(OptionLabels, { option: selected })] })) : (placeholder) }), _jsx(ActionMenu.Overlay, { width: overlayWidth, children: _jsx(ActionList, { selectionVariant: "single", children: grouped
67
+ }, children: selected ? (_jsxs(Box, { as: "span", display: "flex", width: "100%", alignItems: "center", justifyContent: "space-between", gap: 2, children: [_jsx(Text, { children: selected.title }), _jsx(OptionLabels, { option: selected })] })) : (placeholder) }), _jsx(ActionMenu.Overlay, { width: overlayWidth, children: _jsx(ActionList, { selectionVariant: "single", children: grouped
78
68
  ? groups.map(group => (_jsxs(ActionList.Group, { children: [group ? (_jsx(ActionList.GroupHeading, { children: group })) : null, rows(priceFirst(ordered.filter(option => (option.group ?? '') === group)))] }, group || 'ungrouped')))
79
69
  : rows(ordered) }) })] }));
80
70
  }
@@ -129,26 +129,21 @@ export function CodeSandboxPicker(props) {
129
129
  // then lists only environments to start, so it needs no group heading
130
130
  // of its own ("Assign a new Code Sandbox" already labels the control).
131
131
  .map(option => ({ ...option, group: undefined })), [dropdownDescs, dropdownOptions]);
132
- const radioSections = (entries) => (_jsx(RadioGroup, { name: "kernel-options", "aria-labelledby": "kernel-options", children: entries.map(([group, runtimeDescs]) => (_jsxs(Box, { children: [_jsx(Box, { as: "h4", sx: {
133
- /*
134
- * The type of a form label, not of a heading.
135
- *
136
- * "Assign an existing Code Sandbox" and "Assign a
137
- * new Code Sandbox" name the two ways of answering
138
- * one question, and the second is the label of the
139
- * dropdown; set in the larger, heavier type of an
140
- * `h4`, the first read as a section above it rather
141
- * than as its pair. The values are the ones Primer
142
- * gives `FormControl.Label` — taken as the variables
143
- * it resolves rather than through the Primer scale,
144
- * whose `semibold` the JupyterLab theme redefines.
145
- */
146
- margin: 0,
147
- marginBottom: 2,
148
- color: 'fg.default',
149
- fontSize: 'var(--text-body-size-medium, 0.875rem)',
150
- fontWeight: 'var(--base-text-weight-semibold, 600)',
151
- }, children: group }), runtimeDescs.map(k => {
132
+ const radioSections = (entries) => (_jsx(RadioGroup, { name: "kernel-options", "aria-labelledby": "kernel-options", children: entries.map(([group, runtimeDescs]) => (_jsxs(Box, { children: [_jsx(Box, { as: "h4",
133
+ /*
134
+ * The type of a form label, not of a heading.
135
+ *
136
+ * "Assign an existing Code Sandbox" and "Assign a
137
+ * new Code Sandbox" name the two ways of answering
138
+ * one question, and the second is the label of the
139
+ * dropdown; set in the larger, heavier type of an
140
+ * `h4`, the first read as a section above it rather
141
+ * than as its pair. The values are the ones Primer
142
+ * gives `FormControl.Label` — taken as the variables
143
+ * it resolves rather than through the Primer scale,
144
+ * whose `semibold` the JupyterLab theme redefines.
145
+ */
146
+ margin: 0, marginBottom: 2, color: "fg.default", fontSize: "var(--text-body-size-medium, 0.875rem)", fontWeight: "var(--base-text-weight-semibold, 600)", children: group }), runtimeDescs.map(k => {
152
147
  const choiceKey = codeSandboxDescKey(k);
153
148
  const displayId = codeSandboxDisplayId(k);
154
149
  return (
@@ -157,7 +152,7 @@ export function CodeSandboxPicker(props) {
157
152
  // by where it runs and what it runs.
158
153
  _jsxs(Box, { title: k.name, children: [_jsxs(FormControl, { children: [_jsx(Radio, { value: choiceKey, onChange: () => {
159
154
  setRuntimeDesc(k);
160
- }, checked: isSameCodeSandbox(k, runtimeDesc) }), _jsx(FormControl.Label, { children: _jsxs(Box, { display: "flex", sx: { alignItems: 'baseline' }, children: [_jsx(Box, { children: k.displayName }), displayId && (_jsx(Text, { sx: {
155
+ }, checked: isSameCodeSandbox(k, runtimeDesc) }), _jsx(FormControl.Label, { children: _jsxs(Box, { display: "flex", alignItems: "baseline", children: [_jsx(Box, { children: k.displayName }), displayId && (_jsx(Text, { sx: {
161
156
  ml: 2,
162
157
  fontSize: 0,
163
158
  color: 'fg.muted',