@datalayer/agent-runtimes 1.3.89 → 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 (257) 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/lib/shims/primerAddonsBox.d.ts +0 -1
  257. package/lib/shims/primerAddonsBox.js +0 -7
@@ -483,55 +483,23 @@ export const TurnGraphChart = ({ serviceName, agentId, otelUrl, apiKey, autoRefr
483
483
  if (!otelUrl || !apiKey)
484
484
  return null;
485
485
  if (loading && runs.length === 0) {
486
- return (_jsx(Box, { sx: { color: 'fg.muted', fontSize: 1, py: 2 }, children: "Loading OTEL traces\u2026" }));
486
+ return (_jsx(Box, { color: "fg.muted", fontSize: 1, py: 2, children: "Loading OTEL traces\u2026" }));
487
487
  }
488
488
  if (error && runs.length === 0) {
489
- return (_jsxs(Box, { sx: { color: 'danger.fg', fontSize: 0, py: 1 }, children: ["OTEL trace fetch failed: ", error] }));
489
+ return (_jsxs(Box, { color: "danger.fg", fontSize: 0, py: 1, children: ["OTEL trace fetch failed: ", error] }));
490
490
  }
491
491
  if (!option) {
492
- return (_jsx(Box, { sx: { color: 'fg.muted', fontSize: 1, py: 2 }, children: "No graph trace data yet \u2014 run a pydantic-graph agent to see execution turns here." }));
492
+ return (_jsx(Box, { color: "fg.muted", fontSize: 1, py: 2, children: "No graph trace data yet \u2014 run a pydantic-graph agent to see execution turns here." }));
493
493
  }
494
- return (_jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1 }, children: [runs.length > 1 && (_jsx(Box, { sx: {
495
- display: 'flex',
496
- gap: 1,
497
- flexWrap: 'wrap',
498
- mb: 1,
499
- }, children: runs.slice(0, 8).map((run, idx) => (_jsxs(Box, { onClick: () => setSelectedIdx(idx), sx: {
500
- px: 2,
501
- py: '2px',
502
- borderRadius: 2,
503
- fontSize: 0,
504
- cursor: 'pointer',
505
- border: '1px solid',
506
- borderColor: idx === selectedIdx ? 'accent.emphasis' : 'border.default',
507
- bg: idx === selectedIdx ? 'accent.subtle' : 'canvas.subtle',
508
- color: idx === selectedIdx ? 'accent.fg' : 'fg.muted',
509
- userSelect: 'none',
510
- whiteSpace: 'nowrap',
511
- }, children: ["#", runs.length - idx, " \u00A0", run.startTime.toLocaleTimeString([], {
494
+ return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 1, children: [runs.length > 1 && (_jsx(Box, { display: "flex", gap: 1, flexWrap: "wrap", mb: 1, children: runs.slice(0, 8).map((run, idx) => (_jsxs(Box, { onClick: () => setSelectedIdx(idx), px: 2, py: "2px", borderRadius: 2, fontSize: 0, cursor: "pointer", border: "1px solid", borderColor: idx === selectedIdx ? 'accent.emphasis' : 'border.default', bg: idx === selectedIdx ? 'accent.subtle' : 'canvas.subtle', color: idx === selectedIdx ? 'accent.fg' : 'fg.muted', userSelect: "none", whiteSpace: "nowrap", children: ["#", runs.length - idx, " \u00A0", run.startTime.toLocaleTimeString([], {
512
495
  hour: '2-digit',
513
496
  minute: '2-digit',
514
497
  second: '2-digit',
515
- }), run.durationMs ? ` (${formatDur(run.durationMs)})` : ''] }, run.traceId))) })), _jsx(Box, { sx: {
516
- display: 'flex',
517
- gap: 2,
518
- flexWrap: 'wrap',
519
- alignItems: 'center',
520
- fontSize: 0,
521
- color: 'fg.muted',
522
- px: 1,
523
- py: '2px',
524
- }, "aria-label": "Graph node legend", children: LEGEND_ENTRIES.map(entry => (_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, title: entry.description, children: [_jsx(Box, { "aria-hidden": true, sx: {
525
- width: 10,
526
- height: 10,
527
- borderRadius: entry.type === 'decision'
528
- ? 0
529
- : entry.type === 'broadcast' || entry.type === 'spread'
530
- ? '2px'
531
- : '50%',
532
- transform: entry.type === 'decision' ? 'rotate(45deg)' : 'none',
533
- bg: NODE_COLORS[entry.type] ?? NODE_COLORS.default,
534
- } }), _jsx(Text, { sx: { fontSize: 0 }, children: entry.label })] }, entry.type))) }), _jsx(ReactECharts, { option: option, style: { height, width: '100%', ...style }, opts: { renderer: 'svg' }, notMerge: false }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [selectedRun.spans.length - 1, " node(s)", selectedRun.durationMs
498
+ }), run.durationMs ? ` (${formatDur(run.durationMs)})` : ''] }, run.traceId))) })), _jsx(Box, { display: "flex", gap: 2, flexWrap: "wrap", alignItems: "center", fontSize: 0, color: "fg.muted", px: 1, py: "2px", "aria-label": "Graph node legend", children: LEGEND_ENTRIES.map(entry => (_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, title: entry.description, children: [_jsx(Box, { "aria-hidden": true, width: 10, height: 10, borderRadius: entry.type === 'decision'
499
+ ? 0
500
+ : entry.type === 'broadcast' || entry.type === 'spread'
501
+ ? '2px'
502
+ : '50%', transform: entry.type === 'decision' ? 'rotate(45deg)' : 'none', bg: NODE_COLORS[entry.type] ?? NODE_COLORS.default }), _jsx(Text, { sx: { fontSize: 0 }, children: entry.label })] }, entry.type))) }), _jsx(ReactECharts, { option: option, style: { height, width: '100%', ...style }, opts: { renderer: 'svg' }, notMerge: false }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [selectedRun.spans.length - 1, " node(s)", selectedRun.durationMs
535
503
  ? ` · ${formatDur(selectedRun.durationMs)} total`
536
504
  : '', wsConnected ? ' · ws live' : ' · ws disconnected', wsError ? ` · ws error: ${wsError}` : '', loading ? ' · refreshing…' : '', error ? ` · fetch error: ${error}` : ''] })] }));
537
505
  };
@@ -142,119 +142,17 @@ const A2UiAgentExample = () => {
142
142
  setSurfaceTitle(null);
143
143
  setValidationError(null);
144
144
  }, [resetSurfaces]);
145
- return (_jsx(ThemedProvider, { children: _jsx(A2uiMarkdownProvider, { children: _jsxs(Box, { sx: {
146
- minHeight: '100vh',
147
- height: ['auto', 'auto', '100dvh'],
148
- boxSizing: 'border-box',
149
- overflow: ['visible', 'visible', 'hidden'],
150
- display: 'grid',
151
- gridTemplateColumns: [
152
- '1fr',
153
- '1fr',
154
- 'minmax(360px, 1fr) minmax(360px, 460px)',
155
- ],
156
- gap: 3,
157
- p: 3,
158
- bg: 'canvas.default',
159
- }, children: [_jsxs(Box, { sx: {
160
- display: 'flex',
161
- flexDirection: 'column',
162
- gap: 3,
163
- minHeight: 0,
164
- overflowY: ['visible', 'visible', 'auto'],
165
- }, children: [_jsxs(Box, { sx: {
166
- border: '1px solid',
167
- borderColor: 'border.default',
168
- borderRadius: 2,
169
- overflow: 'hidden',
170
- }, children: [_jsxs(Box, { sx: {
171
- px: 3,
172
- py: 2,
173
- borderBottom: '1px solid',
174
- borderColor: 'border.default',
175
- bg: 'canvas.default',
176
- display: 'flex',
177
- justifyContent: 'space-between',
178
- alignItems: 'center',
179
- }, children: [_jsxs(Box, { children: [_jsx(Text, { as: "h1", sx: { fontSize: 2, fontWeight: 'bold' }, children: "A2UI Agent" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Ask the agent to build a UI \u2014 it renders a live A2UI surface." })] }), surfaces.length > 0 && (_jsx(Button, { size: "small", variant: "invisible", onClick: clearCanvas, children: "Clear" }))] }), _jsx(Box, { style: themeStyle, sx: {
145
+ return (_jsx(ThemedProvider, { children: _jsx(A2uiMarkdownProvider, { children: _jsxs(Box, { minHeight: "100vh", height: ['auto', 'auto', '100dvh'], boxSizing: "border-box", overflow: ['visible', 'visible', 'hidden'], display: "grid", gridTemplateColumns: [
146
+ '1fr',
147
+ '1fr',
148
+ 'minmax(360px, 1fr) minmax(360px, 460px)',
149
+ ], gap: 3, p: 3, bg: "canvas.default", children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: 3, minHeight: 0, overflowY: ['visible', 'visible', 'auto'], children: [_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, overflow: "hidden", children: [_jsxs(Box, { px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", bg: "canvas.default", display: "flex", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Box, { children: [_jsx(Text, { as: "h1", sx: { fontSize: 2, fontWeight: 'bold' }, children: "A2UI Agent" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Ask the agent to build a UI \u2014 it renders a live A2UI surface." })] }), surfaces.length > 0 && (_jsx(Button, { size: "small", variant: "invisible", onClick: clearCanvas, children: "Clear" }))] }), _jsx(Box, { style: themeStyle, sx: {
180
150
  ...A2UI_RENDER_SCOPE_SX,
181
151
  p: 3,
182
152
  display: 'flex',
183
153
  flexDirection: 'column',
184
154
  gap: 3,
185
- }, children: surfaces.length === 0 ? (_jsxs(Box, { sx: {
186
- textAlign: 'center',
187
- py: 6,
188
- px: 3,
189
- color: 'fg.muted',
190
- border: '2px dashed',
191
- borderColor: 'border.muted',
192
- borderRadius: 2,
193
- }, children: [_jsx(Text, { sx: { fontSize: 4, display: 'block', mb: 2 }, children: "\uD83C\uDF9B\uFE0F" }), _jsxs(Text, { sx: { fontSize: 1, display: 'block' }, children: ["No surface yet. Try a suggestion in the chat, e.g.", ' ', _jsxs(Text, { as: "span", sx: { fontStyle: 'italic' }, children: ["\"", SUGGESTIONS[0].message, "\""] })] })] })) : (_jsxs(_Fragment, { children: [surfaceTitle && (_jsx(Text, { sx: { fontWeight: 'bold', color: 'fg.default' }, children: surfaceTitle })), validationError && (_jsx(Box, { role: "alert", sx: {
194
- px: 3,
195
- py: 2,
196
- borderRadius: 2,
197
- bg: 'danger.subtle',
198
- border: '1px solid',
199
- borderColor: 'danger.muted',
200
- color: 'danger.fg',
201
- fontSize: 1,
202
- }, children: validationError.message })), surfaces.map(surface => (_jsx(Box, { sx: {
203
- border: '1px solid',
204
- borderColor: 'border.default',
205
- borderRadius: 2,
206
- p: 3,
207
- bg: 'canvas.default',
208
- }, children: _jsx(A2uiSurfaceComposed, { surface: surface }) }, surface.id)))] })) })] }), submissions.length > 0 && (_jsxs(Box, { sx: {
209
- border: '1px solid',
210
- borderColor: 'border.default',
211
- borderRadius: 2,
212
- overflow: 'hidden',
213
- }, children: [_jsxs(Box, { sx: {
214
- px: 3,
215
- py: 2,
216
- borderBottom: '1px solid',
217
- borderColor: 'border.default',
218
- bg: 'success.subtle',
219
- display: 'flex',
220
- justifyContent: 'space-between',
221
- alignItems: 'center',
222
- }, children: [_jsx(Text, { sx: { fontWeight: 'bold' }, children: "Submitted values" }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => setSubmissions([]), children: "Clear" })] }), _jsx(Box, { sx: {
223
- p: 3,
224
- display: 'flex',
225
- flexDirection: 'column',
226
- gap: 2,
227
- }, children: submissions.map(record => (_jsx(Box, { as: "pre", sx: {
228
- m: 0,
229
- p: 2,
230
- borderRadius: 2,
231
- bg: 'canvas.default',
232
- border: '1px solid',
233
- borderColor: 'border.default',
234
- fontSize: 0,
235
- overflow: 'auto',
236
- whiteSpace: 'pre-wrap',
237
- }, children: JSON.stringify(record.values, null, 2) }, record.id))) })] }))] }), _jsx(Box, { sx: {
238
- position: ['static', 'static', 'sticky'],
239
- top: [0, 0, 3],
240
- alignSelf: ['auto', 'auto', 'start'],
241
- border: '1px solid',
242
- borderColor: 'border.default',
243
- borderRadius: 2,
244
- display: 'flex',
245
- flexDirection: 'column',
246
- height: ['auto', 'auto', 'calc(100vh - 48px)'],
247
- minHeight: [420, 520, 0],
248
- overflow: 'hidden',
249
- bg: 'canvas.default',
250
- }, children: isCreatingChat ? (_jsxs(Box, { sx: {
251
- display: 'flex',
252
- flexDirection: 'column',
253
- alignItems: 'center',
254
- justifyContent: 'center',
255
- height: '100%',
256
- gap: 3,
257
- }, children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Creating A2UI agent..." })] })) : chatError || !agentId ? (_jsx(Box, { sx: { p: 3 }, children: _jsxs(Text, { sx: { color: 'danger.fg' }, children: ["Failed to initialize chat:", ' ', chatError || 'No agent id returned'] }) })) : (_jsx(LoopEmbed, { serverUrl: baseUrl, target: "local",
155
+ }, children: surfaces.length === 0 ? (_jsxs(Box, { textAlign: "center", py: 6, px: 3, color: "fg.muted", border: "2px dashed", borderColor: "border.muted", borderRadius: 2, children: [_jsx(Text, { sx: { fontSize: 4, display: 'block', mb: 2 }, children: "\uD83C\uDF9B\uFE0F" }), _jsxs(Text, { sx: { fontSize: 1, display: 'block' }, children: ["No surface yet. Try a suggestion in the chat, e.g.", ' ', _jsxs(Text, { as: "span", sx: { fontStyle: 'italic' }, children: ["\"", SUGGESTIONS[0].message, "\""] })] })] })) : (_jsxs(_Fragment, { children: [surfaceTitle && (_jsx(Text, { sx: { fontWeight: 'bold', color: 'fg.default' }, children: surfaceTitle })), validationError && (_jsx(Box, { role: "alert", px: 3, py: 2, borderRadius: 2, bg: "danger.subtle", border: "1px solid", borderColor: "danger.muted", color: "danger.fg", fontSize: 1, children: validationError.message })), surfaces.map(surface => (_jsx(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, p: 3, bg: "canvas.default", children: _jsx(A2uiSurfaceComposed, { surface: surface }) }, surface.id)))] })) })] }), submissions.length > 0 && (_jsxs(Box, { border: "1px solid", borderColor: "border.default", borderRadius: 2, overflow: "hidden", children: [_jsxs(Box, { px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", bg: "success.subtle", display: "flex", justifyContent: "space-between", alignItems: "center", children: [_jsx(Text, { sx: { fontWeight: 'bold' }, children: "Submitted values" }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => setSubmissions([]), children: "Clear" })] }), _jsx(Box, { p: 3, display: "flex", flexDirection: "column", gap: 2, children: submissions.map(record => (_jsx(Box, { as: "pre", m: 0, p: 2, borderRadius: 2, bg: "canvas.default", border: "1px solid", borderColor: "border.default", fontSize: 0, overflow: "auto", whiteSpace: "pre-wrap", children: JSON.stringify(record.values, null, 2) }, record.id))) })] }))] }), _jsx(Box, { position: ['static', 'static', 'sticky'], top: [0, 0, 3], alignSelf: ['auto', 'auto', 'start'], border: "1px solid", borderColor: "border.default", borderRadius: 2, display: "flex", flexDirection: "column", height: ['auto', 'auto', 'calc(100vh - 48px)'], minHeight: [420, 520, 0], overflow: "hidden", bg: "canvas.default", children: isCreatingChat ? (_jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%", gap: 3, children: [_jsx(Spinner, { size: "large" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Creating A2UI agent..." })] })) : chatError || !agentId ? (_jsx(Box, { p: 3, children: _jsxs(Text, { sx: { color: 'danger.fg' }, children: ["Failed to initialize chat:", ' ', chatError || 'No agent id returned'] }) })) : (_jsx(LoopEmbed, { serverUrl: baseUrl, target: "local",
258
156
  // What lets the target take: without the choice the agents
259
157
  // plugin pins the sandbox to the page, whatever `target` says,
260
158
  // and the chat then turns in-page, where the server's tools
@@ -27,6 +27,6 @@ const ScenePlugin = defineA2uiScenePlugin({
27
27
  });
28
28
  const A2UiComponentsGalleryExample = () => {
29
29
  const plugins = useMemo(() => [ScenePlugin], []);
30
- return (_jsx(ThemedProvider, { children: _jsx(Box, { sx: { height: '100vh', minHeight: 0 }, children: _jsx(LoopEmbed, { target: "browser", agentId: "loop-shell", defaultEditor: "none", showHeader: true, plugins: plugins }) }) }));
30
+ return (_jsx(ThemedProvider, { children: _jsx(Box, { height: "100vh", minHeight: 0, children: _jsx(LoopEmbed, { target: "browser", agentId: "loop-shell", defaultEditor: "none", showHeader: true, plugins: plugins }) }) }));
31
31
  };
32
32
  export default A2UiComponentsGalleryExample;
@@ -27,6 +27,6 @@ const ScenePlugin = defineA2uiScenePlugin({
27
27
  });
28
28
  const A2UiContactCardExample = () => {
29
29
  const plugins = useMemo(() => [ScenePlugin], []);
30
- return (_jsx(ThemedProvider, { children: _jsx(Box, { sx: { height: '100vh', minHeight: 0 }, children: _jsx(LoopEmbed, { target: "browser", agentId: "loop-shell", defaultEditor: "none", showHeader: true, plugins: plugins }) }) }));
30
+ return (_jsx(ThemedProvider, { children: _jsx(Box, { height: "100vh", minHeight: 0, children: _jsx(LoopEmbed, { target: "browser", agentId: "loop-shell", defaultEditor: "none", showHeader: true, plugins: plugins }) }) }));
31
31
  };
32
32
  export default A2UiContactCardExample;
@@ -299,35 +299,7 @@ function JupyterOutputs({ execution, }) {
299
299
  }) }) }));
300
300
  }
301
301
  function Panel({ title, caption, children, style, sx, }) {
302
- return (_jsxs(Box, { sx: {
303
- flex: '1 1 0',
304
- height: '100%',
305
- minWidth: 0,
306
- minHeight: 0,
307
- display: 'flex',
308
- flexDirection: 'column',
309
- border: '1px solid',
310
- borderColor: 'border.default',
311
- borderRadius: 2,
312
- bg: 'canvas.default',
313
- color: 'fg.default',
314
- overflow: 'hidden',
315
- }, children: [_jsxs(Box, { sx: {
316
- px: 3,
317
- py: 2,
318
- borderBottom: '1px solid',
319
- borderColor: 'border.default',
320
- bg: 'canvas.default',
321
- color: 'fg.default',
322
- }, children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: title }), _jsx(Text, { sx: { display: 'block', fontSize: 0, color: 'fg.muted' }, children: caption })] }), _jsx(Box, { style: style, sx: {
323
- flex: '1 1 0',
324
- minHeight: 0,
325
- overflow: 'auto',
326
- p: 3,
327
- bg: 'canvas.default',
328
- color: 'fg.default',
329
- ...sx,
330
- }, children: children })] }));
302
+ return (_jsxs(Box, { flex: "1 1 0", height: "100%", minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column", border: "1px solid", borderColor: "border.default", borderRadius: 2, bg: "canvas.default", color: "fg.default", overflow: "hidden", children: [_jsxs(Box, { px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.default", bg: "canvas.default", color: "fg.default", children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: title }), _jsx(Text, { sx: { display: 'block', fontSize: 0, color: 'fg.muted' }, children: caption })] }), _jsx(Box, { style: style, flex: "1 1 0", minHeight: 0, overflow: "auto", p: 3, bg: "canvas.default", color: "fg.default", sx: sx, children: children })] }));
331
303
  }
332
304
  const A2UiJupyterOutputExample = () => {
333
305
  const { label: targetLabel } = useRuntimeTarget();
@@ -606,7 +578,7 @@ const A2UiJupyterOutputExample = () => {
606
578
  return defaultUI;
607
579
  }
608
580
  const demoActions = SNIPPETS.find(entry => entry.id === kind)?.actions ?? [];
609
- return (_jsxs(_Fragment, { children: [defaultUI, demoActions.length > 0 ? (_jsxs(Box, { sx: { mt: 2 }, children: [_jsx(Text, { sx: { display: 'block', mb: 1, fontSize: 0, color: 'fg.muted' }, children: "Choose an action" }), _jsx(Box, { sx: { display: 'flex', flexWrap: 'wrap', gap: 2 }, children: demoActions.map((action, index) => (_jsx(Button, { size: "small", variant: index === 0 ? 'primary' : 'default', onClick: () =>
581
+ return (_jsxs(_Fragment, { children: [defaultUI, demoActions.length > 0 ? (_jsxs(Box, { mt: 2, children: [_jsx(Text, { sx: { display: 'block', mb: 1, fontSize: 0, color: 'fg.muted' }, children: "Choose an action" }), _jsx(Box, { display: "flex", flexWrap: "wrap", gap: 2, children: demoActions.map((action, index) => (_jsx(Button, { size: "small", variant: index === 0 ? 'primary' : 'default', onClick: () =>
610
582
  // A real client action, not a cast: the same shape the
611
583
  // surface's own buttons emit, so the round-trip cannot
612
584
  // tell the two apart. `sourceComponentId` says which
@@ -643,15 +615,10 @@ const A2UiJupyterOutputExample = () => {
643
615
  ...previous,
644
616
  [toolCallId]: isOpen,
645
617
  }));
646
- }, sx: { mt: 2 }, children: [_jsx(Box, { as: "summary", sx: {
647
- cursor: 'pointer',
648
- fontSize: 0,
649
- color: 'fg.muted',
650
- // The marker is the affordance; without a list-style the
651
- // triangle disappears in some browsers.
652
- listStyle: 'revert',
653
- '&:hover': { color: 'fg.default' },
654
- }, children: "A2UI surface" }), _jsx(Box, { sx: { mt: 2, ...A2UI_RENDER_SCOPE_SX }, style: themeStyle, children: surfaces.map(surface => (_jsx(A2uiSurfaceComposed, { surface: surface }, surface.id))) })] })) : null, _jsxs(Box, { sx: { mt: 2 }, children: [_jsx(Text, { sx: { display: 'block', mb: 1, fontSize: 0, color: 'fg.muted' }, children: "Jupyter output" }), _jsx(JupyterOutputs, { execution: executed })] })] }));
618
+ }, mt: 2, children: [_jsx(Box, { as: "summary", cursor: "pointer", fontSize: 0, color: "fg.muted",
619
+ // The marker is the affordance; without a list-style the
620
+ // triangle disappears in some browsers.
621
+ listStyle: "revert", hover: { color: 'fg.default' }, children: "A2UI surface" }), _jsx(Box, { mt: 2, sx: A2UI_RENDER_SCOPE_SX, style: themeStyle, children: surfaces.map(surface => (_jsx(A2uiSurfaceComposed, { surface: surface }, surface.id))) })] })) : null, _jsxs(Box, { mt: 2, children: [_jsx(Text, { sx: { display: 'block', mb: 1, fontSize: 0, color: 'fg.muted' }, children: "Jupyter output" }), _jsx(JupyterOutputs, { execution: executed })] })] }));
655
622
  }, [executionsByKind, handleAction, openSurfaces, surfaces, themeStyle]);
656
623
  const runDemoTool = useMemo(() => ({
657
624
  name: 'run_jupyter_output_demo',
@@ -697,75 +664,26 @@ const A2UiJupyterOutputExample = () => {
697
664
  useEffect(() => {
698
665
  setExtras({ frontendTools: [runDemoTool], renderToolResult });
699
666
  }, [runDemoTool, renderToolResult, setExtras]);
700
- const outputPanels = (_jsxs(Box, { sx: {
701
- flex: '1 1 0',
702
- minHeight: 0,
703
- height: '100%',
704
- display: 'grid',
705
- gridTemplateColumns: [
706
- 'minmax(0, 1fr)',
707
- 'minmax(0, 1fr)',
708
- 'repeat(2, minmax(0, 1fr))',
709
- ],
710
- gridTemplateRows: [
711
- 'repeat(2, minmax(280px, auto))',
712
- 'repeat(2, minmax(280px, auto))',
713
- 'minmax(0, 1fr)',
714
- ],
715
- gap: 3,
716
- alignItems: 'stretch',
717
- overflow: ['auto', 'auto', 'hidden'],
718
- }, children: [_jsx(Panel, { title: "A2UI Surface", caption: "The outputs read by the server-side converter.", style: themeStyle, sx: A2UI_RENDER_SCOPE_SX, children: surfaces.length === 0 ? (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: snippet.chat
667
+ const outputPanels = (_jsxs(Box, { flex: "1 1 0", minHeight: 0, height: "100%", display: "grid", gridTemplateColumns: [
668
+ 'minmax(0, 1fr)',
669
+ 'minmax(0, 1fr)',
670
+ 'repeat(2, minmax(0, 1fr))',
671
+ ], gridTemplateRows: [
672
+ 'repeat(2, minmax(280px, auto))',
673
+ 'repeat(2, minmax(280px, auto))',
674
+ 'minmax(0, 1fr)',
675
+ ], gap: 3, alignItems: "stretch", overflow: ['auto', 'auto', 'hidden'], children: [_jsx(Panel, { title: "A2UI Surface", caption: "The outputs read by the server-side converter.", style: themeStyle, sx: A2UI_RENDER_SCOPE_SX, children: surfaces.length === 0 ? (_jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: snippet.chat
719
676
  ? 'Choose a chat suggestion to see the surface.'
720
677
  : 'Press Run to see the surface.' })) : (surfaces.map(surface => (_jsx(A2uiSurfaceComposed, { surface: surface }, surface.id)))) }), _jsx(Panel, { title: "Jupyter Output", caption: "The sandbox result rendered by jupyter-react Output.", children: _jsx(JupyterOutputs, { execution: execution }) })] }));
721
- return (_jsx(ThemedProvider, { children: _jsx(A2uiMarkdownProvider, { children: _jsxs(Box, { sx: {
722
- height: '100%',
723
- display: 'flex',
724
- flexDirection: 'column',
725
- minHeight: 0,
726
- overflow: 'hidden',
727
- bg: 'canvas.default',
728
- color: 'fg.default',
729
- }, children: [_jsxs(Box, { sx: {
730
- px: 3,
731
- py: 3,
732
- borderBottom: '1px solid',
733
- borderColor: 'border.default',
734
- bg: 'canvas.default',
735
- color: 'fg.default',
736
- }, children: [_jsx(Text, { as: "h1", sx: { fontSize: 3, fontWeight: 'bold' }, children: "\uD83D\uDCD3 Jupyter Output as a A2UI Surface" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "One execution, twice: what the kernel said, and what the A2UI converter made of it. The conversion runs on the server, so a terminal and a JupyterLab panel get the same surface from the same code." })] }), !hasAgent || unavailableReason || agentError ? (_jsx(Box, { sx: { p: 3, bg: 'canvas.default', color: 'fg.default' }, children: _jsx(Text, { sx: { color: 'fg.muted' }, children: unavailableReason || agentError || (_jsxs(_Fragment, { children: ["This example converts on the server, and the", ' ', _jsx("strong", { children: targetLabel }), " target has no agent-runtimes server beside its sandbox. Switch to ", _jsx("strong", { children: "Local" }), ' ', "or ", _jsx("strong", { children: "Datalayer" }), " in the header to run it."] })) }) })) : (_jsxs(Box, { sx: {
737
- flex: '1 1 0',
738
- minHeight: 0,
739
- display: 'flex',
740
- flexDirection: 'column',
741
- gap: 3,
742
- p: 3,
743
- bg: 'canvas.default',
744
- color: 'fg.default',
745
- }, children: [_jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 2 }, children: [_jsx(SegmentedControl, { "aria-label": "Output kind", fullWidth: true, children: SNIPPETS.map(entry => (_jsx(SegmentedControl.Button, { selected: entry.id === snippetId, onClick: () => chooseSnippet(entry), children: entry.label }, entry.id))) }), _jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: snippet.about })] }), snippet.chat ? (_jsxs(Box, { sx: {
746
- flex: '1 1 0',
747
- minHeight: 0,
748
- display: 'grid',
749
- gridTemplateColumns: [
750
- 'minmax(0, 1fr)',
751
- 'minmax(0, 1fr)',
752
- 'minmax(320px, 0.7fr) minmax(0, 1.3fr)',
753
- ],
754
- gridTemplateRows: [
755
- 'minmax(420px, auto) minmax(560px, auto)',
756
- 'minmax(420px, auto) minmax(560px, auto)',
757
- 'minmax(0, 1fr)',
758
- ],
759
- gap: 3,
760
- overflow: ['auto', 'auto', 'hidden'],
761
- }, children: [_jsx(Box, { sx: {
762
- minHeight: 0,
763
- border: '1px solid',
764
- borderColor: 'border.default',
765
- borderRadius: 2,
766
- overflow: 'hidden',
767
- bg: 'canvas.default',
768
- }, children: agentReady && agentId ? (_jsx(LoopEmbed, { serverUrl: serverUrl, target: "local",
678
+ return (_jsx(ThemedProvider, { children: _jsx(A2uiMarkdownProvider, { children: _jsxs(Box, { height: "100%", display: "flex", flexDirection: "column", minHeight: 0, overflow: "hidden", bg: "canvas.default", color: "fg.default", children: [_jsxs(Box, { px: 3, py: 3, borderBottom: "1px solid", borderColor: "border.default", bg: "canvas.default", color: "fg.default", children: [_jsx(Text, { as: "h1", sx: { fontSize: 3, fontWeight: 'bold' }, children: "\uD83D\uDCD3 Jupyter Output as a A2UI Surface" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "One execution, twice: what the kernel said, and what the A2UI converter made of it. The conversion runs on the server, so a terminal and a JupyterLab panel get the same surface from the same code." })] }), !hasAgent || unavailableReason || agentError ? (_jsx(Box, { p: 3, bg: "canvas.default", color: "fg.default", children: _jsx(Text, { sx: { color: 'fg.muted' }, children: unavailableReason || agentError || (_jsxs(_Fragment, { children: ["This example converts on the server, and the", ' ', _jsx("strong", { children: targetLabel }), " target has no agent-runtimes server beside its sandbox. Switch to ", _jsx("strong", { children: "Local" }), ' ', "or ", _jsx("strong", { children: "Datalayer" }), " in the header to run it."] })) }) })) : (_jsxs(Box, { flex: "1 1 0", minHeight: 0, display: "flex", flexDirection: "column", gap: 3, p: 3, bg: "canvas.default", color: "fg.default", children: [_jsxs(Box, { display: "flex", flexDirection: "column", gap: 2, children: [_jsx(SegmentedControl, { "aria-label": "Output kind", fullWidth: true, children: SNIPPETS.map(entry => (_jsx(SegmentedControl.Button, { selected: entry.id === snippetId, onClick: () => chooseSnippet(entry), children: entry.label }, entry.id))) }), _jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: snippet.about })] }), snippet.chat ? (_jsxs(Box, { flex: "1 1 0", minHeight: 0, display: "grid", gridTemplateColumns: [
679
+ 'minmax(0, 1fr)',
680
+ 'minmax(0, 1fr)',
681
+ 'minmax(320px, 0.7fr) minmax(0, 1.3fr)',
682
+ ], gridTemplateRows: [
683
+ 'minmax(420px, auto) minmax(560px, auto)',
684
+ 'minmax(420px, auto) minmax(560px, auto)',
685
+ 'minmax(0, 1fr)',
686
+ ], gap: 3, overflow: ['auto', 'auto', 'hidden'], children: [_jsx(Box, { minHeight: 0, border: "1px solid", borderColor: "border.default", borderRadius: 2, overflow: "hidden", bg: "canvas.default", children: agentReady && agentId ? (_jsx(LoopEmbed, { serverUrl: serverUrl, target: "local",
769
687
  // No `showAgentVariants` on purpose: without the choice the
770
688
  // agents plugin pins the sandbox to the page, and this chat is
771
689
  // meant to turn in the page. The server agent above speaks
@@ -775,25 +693,7 @@ const A2UiJupyterOutputExample = () => {
775
693
  // calls it.
776
694
  agentId: agentId, defaultEditor: "none", showHeader: true,
777
695
  // A reader asks for one demonstration after another: `+` starts over.
778
- chatHeaderButtons: true, plugins: chatPlugins })) : (_jsxs(Box, { sx: {
779
- height: '100%',
780
- display: 'flex',
781
- alignItems: 'center',
782
- justifyContent: 'center',
783
- gap: 2,
784
- }, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Starting Jupyter output agent\u2026" })] })) }), outputPanels] })) : (_jsxs(_Fragment, { children: [_jsx(Box, { as: "textarea", value: code, onChange: (event) => setCode(event.target.value), spellCheck: false, "aria-label": "Code to run", sx: {
785
- width: '100%',
786
- minHeight: '150px',
787
- p: 2,
788
- fontFamily: 'mono',
789
- fontSize: 1,
790
- borderRadius: 2,
791
- border: '1px solid',
792
- borderColor: 'border.default',
793
- bg: 'canvas.default',
794
- color: 'fg.default',
795
- resize: 'vertical',
796
- } }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(Button, { variant: "primary", leadingVisual: PlayIcon, disabled: running || !agentReady || !agentId, onClick: () => void run(code, undefined, snippet.actions ?? []), children: running
696
+ chatHeaderButtons: true, plugins: chatPlugins })) : (_jsxs(Box, { height: "100%", display: "flex", alignItems: "center", justifyContent: "center", gap: 2, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { color: 'fg.muted' }, children: "Starting Jupyter output agent\u2026" })] })) }), outputPanels] })) : (_jsxs(_Fragment, { children: [_jsx(Box, { as: "textarea", value: code, onChange: (event) => setCode(event.target.value), spellCheck: false, "aria-label": "Code to run", width: "100%", minHeight: "150px", p: 2, fontFamily: "mono", fontSize: 1, borderRadius: 2, border: "1px solid", borderColor: "border.default", bg: "canvas.default", color: "fg.default", resize: "vertical" }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(Button, { variant: "primary", leadingVisual: PlayIcon, disabled: running || !agentReady || !agentId, onClick: () => void run(code, undefined, snippet.actions ?? []), children: running
797
697
  ? 'Running…'
798
698
  : !agentReady
799
699
  ? 'Starting Jupyter…'
@@ -27,6 +27,6 @@ const ScenePlugin = defineA2uiScenePlugin({
27
27
  });
28
28
  const A2UiRestaurantExample = () => {
29
29
  const plugins = useMemo(() => [ScenePlugin], []);
30
- return (_jsx(ThemedProvider, { children: _jsx(Box, { sx: { height: '100vh', minHeight: 0 }, children: _jsx(LoopEmbed, { target: "browser", agentId: "loop-shell", defaultEditor: "none", showHeader: true, plugins: plugins }) }) }));
30
+ return (_jsx(ThemedProvider, { children: _jsx(Box, { height: "100vh", minHeight: 0, children: _jsx(LoopEmbed, { target: "browser", agentId: "loop-shell", defaultEditor: "none", showHeader: true, plugins: plugins }) }) }));
31
31
  };
32
32
  export default A2UiRestaurantExample;
@@ -46,7 +46,7 @@ const A2UiViewerExample = () => {
46
46
  // The header's choice; the shell remounts this example when it changes.
47
47
  const target = useRuntimeTargetStore(state => state.target);
48
48
  const serverUrl = useExampleAgentRuntimesUrl();
49
- return (_jsx(ThemedProvider, { children: _jsx(Box, { sx: { height: '100vh', minHeight: 0 }, children: _jsx(LoopEmbed, { target: target,
49
+ return (_jsx(ThemedProvider, { children: _jsx(Box, { height: "100vh", minHeight: 0, children: _jsx(LoopEmbed, { target: target,
50
50
  // An in-page agent has no server to ask; the others need to know
51
51
  // where theirs is.
52
52
  serverUrl: target === 'browser' ? undefined : serverUrl, agentId: AGENTSPEC_ID,
@@ -47,14 +47,7 @@ const AgUiAgenticExample = () => {
47
47
  });
48
48
  const agenticChatEndpoint = agentId != null ? `${baseUrl}/api/v1/ag-ui/${agentId}/` : undefined;
49
49
  const isLoading = !isReady && status !== 'error';
50
- return (_jsx(ThemedProvider, { children: _jsxs(Box, { sx: {
51
- minHeight: '100vh',
52
- backgroundColor: 'canvas.default',
53
- padding: 4,
54
- }, children: [_jsxs(Box, { sx: {
55
- maxWidth: '800px',
56
- margin: '0 auto',
57
- }, children: [_jsx(Text, { as: "h1", sx: {
50
+ return (_jsx(ThemedProvider, { children: _jsxs(Box, { minHeight: "100vh", backgroundColor: "canvas.default", padding: 4, children: [_jsxs(Box, { maxWidth: "800px", margin: "0 auto", children: [_jsx(Text, { as: "h1", sx: {
58
51
  fontSize: 4,
59
52
  fontWeight: 'bold',
60
53
  marginBottom: 2,
@@ -62,36 +55,11 @@ const AgUiAgenticExample = () => {
62
55
  fontSize: 2,
63
56
  color: 'fg.muted',
64
57
  marginBottom: 4,
65
- }, children: "Click the chat button in the bottom-right corner to start a conversation with an AI agent. The runtime target (local or cloud) follows your selection in the examples header." }), isLoading && (_jsxs(Box, { sx: {
66
- display: 'flex',
67
- alignItems: 'center',
68
- gap: 2,
69
- marginBottom: 3,
70
- }, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Starting managed agent runtime..." })] })), error && (_jsx(Box, { sx: {
71
- padding: 3,
72
- marginBottom: 3,
73
- backgroundColor: 'danger.subtle',
74
- borderRadius: 2,
75
- border: '1px solid',
76
- borderColor: 'danger.muted',
77
- }, children: _jsxs(Text, { sx: { color: 'danger.fg', fontSize: 1 }, children: ["Failed to initialize managed agent runtime: ", error] }) })), _jsxs(Box, { sx: {
78
- padding: 4,
79
- backgroundColor: 'canvas.default',
80
- borderRadius: 2,
81
- border: '1px solid',
82
- borderColor: 'border.default',
83
- }, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "Runtime Mode" }), _jsx(Box, { as: "ul", sx: { paddingLeft: 3 }, children: _jsxs(Box, { as: "li", sx: { marginBottom: 1 }, children: [_jsx(Text, { sx: { fontFamily: 'mono', fontSize: 1 }, children: "managed runtime + managed agent" }), _jsxs(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: [' ', "- Launches on cloud when the header target is set to cloud"] })] }) }), _jsx(Text, { as: "p", sx: {
58
+ }, children: "Click the chat button in the bottom-right corner to start a conversation with an AI agent. The runtime target (local or cloud) follows your selection in the examples header." }), isLoading && (_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, marginBottom: 3, children: [_jsx(Spinner, { size: "small" }), _jsx(Text, { sx: { color: 'fg.muted', fontSize: 1 }, children: "Starting managed agent runtime..." })] })), error && (_jsx(Box, { padding: 3, marginBottom: 3, backgroundColor: "danger.subtle", borderRadius: 2, border: "1px solid", borderColor: "danger.muted", children: _jsxs(Text, { sx: { color: 'danger.fg', fontSize: 1 }, children: ["Failed to initialize managed agent runtime: ", error] }) })), _jsxs(Box, { padding: 4, backgroundColor: "canvas.default", borderRadius: 2, border: "1px solid", borderColor: "border.default", children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "Runtime Mode" }), _jsx(Box, { as: "ul", paddingLeft: 3, children: _jsxs(Box, { as: "li", marginBottom: 1, children: [_jsx(Text, { sx: { fontFamily: 'mono', fontSize: 1 }, children: "managed runtime + managed agent" }), _jsxs(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: [' ', "- Launches on cloud when the header target is set to cloud"] })] }) }), _jsx(Text, { as: "p", sx: {
84
59
  fontSize: 1,
85
60
  color: 'fg.muted',
86
61
  marginTop: 3,
87
- }, children: "Try asking: \"hi\" or \"what can you help with?\"" })] }), _jsxs(Box, { sx: {
88
- marginTop: 4,
89
- padding: 4,
90
- backgroundColor: 'canvas.default',
91
- borderRadius: 2,
92
- border: '1px solid',
93
- borderColor: 'border.default',
94
- }, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "About This Example" }), _jsx(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted' }, children: "This example demonstrates the AG-UI (Agent User Interface) protocol for streaming AI interactions. The agent uses SSE (Server-Sent Events) to stream responses and tool calls in real-time." }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted', marginTop: 2 }, children: [_jsx("strong", { children: "Protocol Events:" }), " TEXT_MESSAGE_START, TEXT_MESSAGE_CONTENT, TEXT_MESSAGE_END, TOOL_CALL_START, TOOL_CALL_END"] })] })] }), agenticChatEndpoint && (_jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: agenticChatEndpoint, title: "Agentic Chat", description: "Chat with a managed AG-UI agent runtime.", position: "bottom-right", defaultOpen: true, suggestions: [
62
+ }, children: "Try asking: \"hi\" or \"what can you help with?\"" })] }), _jsxs(Box, { marginTop: 4, padding: 4, backgroundColor: "canvas.default", borderRadius: 2, border: "1px solid", borderColor: "border.default", children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "About This Example" }), _jsx(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted' }, children: "This example demonstrates the AG-UI (Agent User Interface) protocol for streaming AI interactions. The agent uses SSE (Server-Sent Events) to stream responses and tool calls in real-time." }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted', marginTop: 2 }, children: [_jsx("strong", { children: "Protocol Events:" }), " TEXT_MESSAGE_START, TEXT_MESSAGE_CONTENT, TEXT_MESSAGE_END, TOOL_CALL_START, TOOL_CALL_END"] })] })] }), agenticChatEndpoint && (_jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: agenticChatEndpoint, title: "Agentic Chat", description: "Chat with a managed AG-UI agent runtime.", position: "bottom-right", defaultOpen: true, suggestions: [
95
63
  {
96
64
  title: 'What time is it?',
97
65
  message: 'What is the current time?',
@@ -72,14 +72,7 @@ const AgUiBackendToolRenderingExample = () => {
72
72
  // State updates are still available if needed for other purposes
73
73
  // Uncomment to debug: console.log('[WeatherExample] State update:', _state);
74
74
  }, []);
75
- return (_jsx(ThemedProvider, { children: _jsxs(Box, { sx: {
76
- minHeight: '100vh',
77
- backgroundColor: 'canvas.default',
78
- padding: 4,
79
- }, children: [_jsxs(Box, { sx: {
80
- maxWidth: '800px',
81
- margin: '0 auto',
82
- }, children: [_jsx(Text, { as: "h1", sx: {
75
+ return (_jsx(ThemedProvider, { children: _jsxs(Box, { minHeight: "100vh", backgroundColor: "canvas.default", padding: 4, children: [_jsxs(Box, { maxWidth: "800px", margin: "0 auto", children: [_jsx(Text, { as: "h1", sx: {
83
76
  fontSize: 4,
84
77
  fontWeight: 'bold',
85
78
  marginBottom: 2,
@@ -87,23 +80,7 @@ const AgUiBackendToolRenderingExample = () => {
87
80
  fontSize: 2,
88
81
  color: 'fg.muted',
89
82
  marginBottom: 4,
90
- }, children: ["Ask about the weather anywhere in the world. Weather cards are rendered ", _jsx("strong", { children: "inline in the chat" }), " with dynamic theming!"] }), _jsxs(Box, { sx: {
91
- padding: 4,
92
- backgroundColor: 'canvas.default',
93
- borderRadius: 2,
94
- border: '1px solid',
95
- borderColor: 'border.default',
96
- }, children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "About This Example" }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted' }, children: ["This demonstrates ", _jsx("strong", { children: "inline backend tool rendering" }), ' ', "with AG-UI. When the agent calls the ", _jsx("code", { children: "get_weather" }), ' ', "tool, the result is rendered as a beautiful weather card directly in the chat conversation, similar to the AG-UI Dojo implementation."] }), _jsxs(Box, { sx: { marginTop: 3 }, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 'medium' }, children: "Features:" }), _jsxs(Box, { as: "ul", sx: {
97
- paddingLeft: 3,
98
- marginTop: 1,
99
- fontSize: 1,
100
- color: 'fg.muted',
101
- }, children: [_jsx("li", { children: "\uD83C\uDF24\uFE0F Dynamic background colors based on weather conditions" }), _jsx("li", { children: "\uD83C\uDFA8 Weather icons (sun, rain, cloud)" }), _jsx("li", { children: "\uD83C\uDF21\uFE0F Temperature in both Celsius and Fahrenheit" }), _jsx("li", { children: "\uD83D\uDCA8 Humidity, wind speed, and feels-like stats" }), _jsx("li", { children: "\u23F3 Loading spinner while fetching data" })] })] }), _jsxs(Box, { sx: { marginTop: 3 }, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 'medium' }, children: "Try these prompts:" }), _jsxs(Box, { as: "ul", sx: {
102
- paddingLeft: 3,
103
- marginTop: 1,
104
- fontSize: 1,
105
- color: 'fg.muted',
106
- }, children: [_jsx("li", { children: "\"What's the weather in New York?\"" }), _jsx("li", { children: "\"Weather in London and Paris\"" }), _jsx("li", { children: "\"Is it sunny in Sydney?\"" }), _jsx("li", { children: "\"How's the weather in Tokyo today?\"" })] })] })] })] }), backendToolRenderingEndpoint && (_jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: backendToolRenderingEndpoint, title: "Weather Assistant", description: "Ask me about the weather anywhere in the world!", position: "bottom-right", brandColor: brandColor, defaultOpen: true, onStateUpdate: handleStateUpdate, renderToolResult: renderToolResult, suggestions: [
83
+ }, children: ["Ask about the weather anywhere in the world. Weather cards are rendered ", _jsx("strong", { children: "inline in the chat" }), " with dynamic theming!"] }), _jsxs(Box, { padding: 4, backgroundColor: "canvas.default", borderRadius: 2, border: "1px solid", borderColor: "border.default", children: [_jsx(Text, { as: "h2", sx: { fontSize: 2, fontWeight: 'semibold', marginBottom: 2 }, children: "About This Example" }), _jsxs(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted' }, children: ["This demonstrates ", _jsx("strong", { children: "inline backend tool rendering" }), ' ', "with AG-UI. When the agent calls the ", _jsx("code", { children: "get_weather" }), ' ', "tool, the result is rendered as a beautiful weather card directly in the chat conversation, similar to the AG-UI Dojo implementation."] }), _jsxs(Box, { marginTop: 3, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 'medium' }, children: "Features:" }), _jsxs(Box, { as: "ul", paddingLeft: 3, marginTop: 1, fontSize: 1, color: "fg.muted", children: [_jsx("li", { children: "\uD83C\uDF24\uFE0F Dynamic background colors based on weather conditions" }), _jsx("li", { children: "\uD83C\uDFA8 Weather icons (sun, rain, cloud)" }), _jsx("li", { children: "\uD83C\uDF21\uFE0F Temperature in both Celsius and Fahrenheit" }), _jsx("li", { children: "\uD83D\uDCA8 Humidity, wind speed, and feels-like stats" }), _jsx("li", { children: "\u23F3 Loading spinner while fetching data" })] })] }), _jsxs(Box, { marginTop: 3, children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 'medium' }, children: "Try these prompts:" }), _jsxs(Box, { as: "ul", paddingLeft: 3, marginTop: 1, fontSize: 1, color: "fg.muted", children: [_jsx("li", { children: "\"What's the weather in New York?\"" }), _jsx("li", { children: "\"Weather in London and Paris\"" }), _jsx("li", { children: "\"Is it sunny in Sydney?\"" }), _jsx("li", { children: "\"How's the weather in Tokyo today?\"" })] })] })] })] }), backendToolRenderingEndpoint && (_jsx(ChatFloating, { kernelIndicatorPlacement: "right", protocol: "ag-ui", endpoint: backendToolRenderingEndpoint, title: "Weather Assistant", description: "Ask me about the weather anywhere in the world!", position: "bottom-right", brandColor: brandColor, defaultOpen: true, onStateUpdate: handleStateUpdate, renderToolResult: renderToolResult, suggestions: [
107
84
  {
108
85
  title: 'Paris weather',
109
86
  message: "What's the weather like in Paris?",