@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.
- package/lib/Agent.js +2 -18
- package/lib/AgentDocument.js +5 -55
- package/lib/AgentNode.js +31 -208
- package/lib/AgentNotebook.js +5 -59
- package/lib/agent-node/AgentNodeGallery.js +23 -111
- package/lib/agents/AgentDetails.js +36 -274
- package/lib/agents/AgentRuntimeChat.js +1 -8
- package/lib/chat/Chat.js +7 -46
- package/lib/chat/ChatFloating.js +15 -100
- package/lib/chat/ChatInline.js +5 -47
- package/lib/chat/ChatPopupStandalone.js +5 -53
- package/lib/chat/ChatSidebar.js +4 -51
- package/lib/chat/ChatStandalone.js +4 -45
- package/lib/chat/EphemeralSurfaceControl.js +5 -25
- package/lib/chat/assistant/AssistantContextMenu.d.ts +8 -0
- package/lib/chat/assistant/AssistantContextMenu.js +17 -1
- package/lib/chat/assistant/AssistantStage.js +6 -25
- package/lib/chat/assistant/BalloonParts.js +8 -40
- package/lib/chat/assistant/BalloonVisual.js +2 -2
- package/lib/chat/assistant/ConversationBalloon.js +2 -11
- package/lib/chat/assistant/DecisionAsk.js +3 -3
- package/lib/chat/assistant/SandboxDetailsDialog.js +3 -17
- package/lib/chat/assistant/SpeechBalloon.js +14 -78
- package/lib/chat/base/ChatBase.js +37 -172
- package/lib/chat/display/EmptyState.js +7 -35
- package/lib/chat/display/FloatingBrandButton.js +4 -34
- package/lib/chat/display/PoweredByTag.js +3 -14
- package/lib/chat/document/EphemeralDocument.js +3 -18
- package/lib/chat/header/ChatHeader.js +1 -17
- package/lib/chat/header/ChatHeaderBase.js +2 -24
- package/lib/chat/header/ChatViewModeToggle.js +7 -29
- package/lib/chat/indicators/McpStatusIndicator.js +3 -12
- package/lib/chat/indicators/SandboxStatusIndicator.js +6 -34
- package/lib/chat/indicators/SkillsStatusIndicator.js +3 -12
- package/lib/chat/indicators/TypingDots.js +1 -11
- package/lib/chat/messages/ChatMessageList.js +58 -185
- package/lib/chat/messages/ChatMessages.js +15 -79
- package/lib/chat/messages/FormSubmissionMessage.js +2 -33
- package/lib/chat/messages/NotebookToolSurfaces.js +12 -41
- package/lib/chat/messages/TurnFooter.js +4 -10
- package/lib/chat/notebook/EphemeralNotebook.js +2 -10
- package/lib/chat/parts/ReasoningPart.js +2 -16
- package/lib/chat/parts/TextPart.js +2 -12
- package/lib/chat/parts/ToolPart.js +16 -90
- package/lib/chat/presence/Presence.js +5 -33
- package/lib/chat/prompt/FloatingCard.js +1 -13
- package/lib/chat/prompt/InputPrompt.js +1 -6
- package/lib/chat/prompt/InputPromptBase.js +4 -17
- package/lib/chat/prompt/InputPromptLexical.js +44 -45
- package/lib/chat/prompt/InputPromptText.js +1 -1
- package/lib/chat/prompt/footer/InPromptFooter.js +1 -8
- package/lib/chat/prompt/menus/AgentsMenu.js +1 -1
- package/lib/chat/prompt/menus/InlineAgentsMenu.js +1 -1
- package/lib/chat/prompt/menus/ModelSelector.js +1 -5
- package/lib/chat/prompt/menus/SkillsMenu.js +3 -30
- package/lib/chat/prompt/menus/SuggestionsMenu.js +1 -1
- package/lib/chat/prompt/menus/ToolsMenu.js +4 -48
- package/lib/chat/prompt/plugins/AgentMentionPlugin.js +2 -9
- package/lib/chat/prompt/plugins/CommandPlugin.js +2 -9
- package/lib/chat/prompt/plugins/MentionChip.js +1 -15
- package/lib/chat/prompt/stack.js +1 -19
- package/lib/chat/tools/A2AAgentDialog.js +9 -42
- package/lib/chat/tools/SubagentActivity.js +5 -22
- package/lib/chat/tools/ToolApprovalBanner.js +4 -34
- package/lib/chat/tools/ToolApprovalDialog.js +4 -19
- package/lib/chat/tools/ToolCallDisplay.js +12 -97
- package/lib/chat/usage/ContextPie.js +4 -45
- package/lib/components/a2ui/datalayer/Chart.js +4 -10
- package/lib/components/a2ui/datalayer/Chat.js +2 -10
- package/lib/components/a2ui/datalayer/Download.js +1 -1
- package/lib/components/a2ui/datalayer/Evidence.js +1 -15
- package/lib/components/a2ui/datalayer/FileUpload.js +1 -12
- package/lib/components/a2ui/datalayer/Table.js +9 -17
- package/lib/components/a2ui/datalayer/formWidgets.js +3 -2
- package/lib/components/a2ui/datalayer/parts.js +1 -16
- package/lib/components/agents/AgentSummary.js +1 -51
- package/lib/components/cards/NotificationEventCard.js +6 -72
- package/lib/components/cards/OutputCard.js +4 -48
- package/lib/components/cards/ToolApprovalCard.js +2 -35
- package/lib/components/code-sandboxes/CodeSandboxCellVariables.js +1 -1
- package/lib/components/code-sandboxes/CodeSandboxEnvironmentSelect.js +4 -14
- package/lib/components/code-sandboxes/CodeSandboxPicker.js +16 -21
- package/lib/components/code-sandboxes/CodeSandboxVariables.js +2 -2
- package/lib/components/scheduler/ScheduleMenu.js +5 -10
- package/lib/components/specs/SpecPayloadPreview.js +1 -26
- package/lib/components/teams/A2ATeamGraph.d.ts +4 -3
- package/lib/components/teams/A2ATeamGraph.js +25 -71
- package/lib/components/teams/AnswerSurfacesView.js +2 -2
- package/lib/components/teams/NotebookPreview.js +1 -10
- package/lib/components/teams/NotebookPreviewView.js +2 -3
- package/lib/components/teams/SceneTranscript.js +3 -17
- package/lib/components/teams/SceneView.js +1 -8
- package/lib/components/teams/TeamNotebook.js +5 -13
- package/lib/components/teams/TeamNotebookView.js +2 -12
- package/lib/components/teams/index.d.ts +1 -0
- package/lib/components/teams/index.js +1 -0
- package/lib/components/teams/useBalloonRoom.d.ts +39 -0
- package/lib/components/teams/useBalloonRoom.js +89 -0
- package/lib/config/AgentConfiguration.js +22 -225
- package/lib/context/ContextDistribution.js +7 -41
- package/lib/context/ContextInspector.js +9 -107
- package/lib/context/ContextPanel.js +11 -86
- package/lib/context/ContextUsage.js +6 -34
- package/lib/context/CostTracker.js +7 -42
- package/lib/context/MessageHistory.js +3 -37
- package/lib/context/TurnGraphChart.js +9 -41
- package/lib/examples/A2UiAgentExample.js +6 -108
- package/lib/examples/A2UiComponentsGalleryExample.js +1 -1
- package/lib/examples/A2UiContactCardExample.js +1 -1
- package/lib/examples/A2UiJupyterOutputExample.js +25 -125
- package/lib/examples/A2UiRestaurantExample.js +1 -1
- package/lib/examples/A2UiViewerExample.js +1 -1
- package/lib/examples/AgUiAgenticExample.js +3 -35
- package/lib/examples/AgUiBackendToolRenderingExample.js +2 -25
- package/lib/examples/AgUiHaikuGenUiExample.js +2 -32
- package/lib/examples/AgUiHumanInTheLoopExample.js +5 -59
- package/lib/examples/AgUiSharedStateExample.js +6 -56
- package/lib/examples/AgUiToolsBasedGenUiExample.js +25 -120
- package/lib/examples/AgentA2AExample.js +1 -15
- package/lib/examples/AgentA2ATeamExample.js +6 -30
- package/lib/examples/AgentCheckpointsExample.js +11 -145
- package/lib/examples/AgentCodeSandboxExample.js +5 -108
- package/lib/examples/AgentCodeSandboxesExample.js +3 -30
- package/lib/examples/AgentCodemodeExample.js +9 -85
- package/lib/examples/AgentCompactionExample.js +3 -64
- package/lib/examples/AgentDecideExample.js +1 -13
- package/lib/examples/AgentEvalsExample.js +5 -60
- package/lib/examples/AgentGuardrailsExample.js +4 -28
- package/lib/examples/AgentHooksExample.js +1 -1
- package/lib/examples/AgentInferenceProviderExample.js +5 -96
- package/lib/examples/AgentMCPExample.js +7 -105
- package/lib/examples/AgentMemoryExample.js +5 -74
- package/lib/examples/AgentMonitoringExample.js +7 -53
- package/lib/examples/AgentNotificationsExample.js +3 -61
- package/lib/examples/AgentOtelExample.js +3 -72
- package/lib/examples/AgentOutputsExample.js +6 -81
- package/lib/examples/AgentParametersExample.js +2 -37
- package/lib/examples/AgentSkillsExample.js +3 -45
- package/lib/examples/AgentSubagentsExample.js +6 -56
- package/lib/examples/AgentToolApprovalsExample.js +1 -11
- package/lib/examples/AgentTriggersExample.js +29 -239
- package/lib/examples/AgentspecsExample.js +6 -60
- package/lib/examples/AssistantExample.js +5 -5
- package/lib/examples/AssistantGalleryExample.js +8 -65
- package/lib/examples/CellExample.js +1 -6
- package/lib/examples/ChatCustomExample.js +2 -31
- package/lib/examples/ChatExample.js +1 -9
- package/lib/examples/ChatStandaloneExample.js +3 -37
- package/lib/examples/CopilotKitLexicalExample.js +1 -24
- package/lib/examples/DecksAgent.js +1 -1
- package/lib/examples/DocumentPageAgent.js +1 -1
- package/lib/examples/HomeExample.js +14 -62
- package/lib/examples/Lexical2Example.js +3 -32
- package/lib/examples/LexicalAgentExample.js +2 -34
- package/lib/examples/LexicalAgentSidebarExample.js +3 -34
- package/lib/examples/LoopAppComputerExample.js +1 -1
- package/lib/examples/LoopShellExample.js +2 -2
- package/lib/examples/LoopStrategyExample.js +15 -87
- package/lib/examples/LoopWorkspaceEmbed.js +2 -18
- package/lib/examples/LoopWorkspaceExample.js +2 -2
- package/lib/examples/NotebookAgentExample.js +2 -33
- package/lib/examples/NotebookAgentSidebarExample.js +3 -46
- package/lib/examples/NotebookCollaborationExample.js +1 -31
- package/lib/examples/NotebookExample.js +1 -18
- package/lib/examples/NotebookPageAgent.js +1 -1
- package/lib/examples/ScenesExample.js +5 -24
- package/lib/examples/VoiceChatExample.js +1 -1
- package/lib/examples/components/AuthRequiredView.js +1 -7
- package/lib/examples/components/ErrorView.js +1 -8
- package/lib/examples/components/ExampleErrorBoundary.js +1 -14
- package/lib/examples/components/FooterMetrics.js +1 -7
- package/lib/examples/components/Header.js +12 -51
- package/lib/examples/components/HeaderControls.js +1 -9
- package/lib/examples/components/LexicalEditor.js +1 -8
- package/lib/examples/components/MainContent.js +1 -13
- package/lib/examples/components/MockFileBrowser.js +4 -40
- package/lib/examples/components/SessionTabs.js +1 -1
- package/lib/examples/components/TimeTravel.js +1 -13
- package/lib/examples/main.js +13 -81
- package/lib/examples/scenes/A2UiComponentsGalleryScene.js +3 -34
- package/lib/examples/scenes/A2UiContactCardScene.js +3 -35
- package/lib/examples/scenes/A2UiRestaurantScene.js +3 -53
- package/lib/examples/scenes/A2UiViewerScene.js +3 -34
- package/lib/examples/utils/AssistantGalleryGrid.js +6 -35
- package/lib/examples2/DatalayerNotebookExample.js +3 -33
- package/lib/examples2/NativeNavigationExample.js +4 -10
- package/lib/examples2/NotebookMutationsKernel.js +2 -1
- package/lib/examples2/NotebookMutationsServiceManager.js +2 -1
- package/lib/examples2/ReactRouterExample.js +14 -42
- package/lib/hooks/useToolApprovals.d.ts +2 -34
- package/lib/hooks/useToolApprovals.js +1 -64
- package/lib/identity/AgentIdentity.js +17 -62
- package/lib/identity/IdentityConnect.js +13 -59
- package/lib/identity/OAuthCallback.js +6 -44
- package/lib/lexical/ChatInlinePlugin.js +6 -14
- package/lib/loop/apps/AppRenderer.d.ts +4 -3
- package/lib/loop/apps/AppRenderer.js +11 -12
- package/lib/loop/apps/appspec.js +6 -3
- package/lib/loop/embed/AppEmbed.d.ts +1 -1
- package/lib/loop/embed/AppEmbed.js +2 -1
- package/lib/loop/embed/LoopEmbed.js +1 -7
- package/lib/loop/embed/embedConfig.d.ts +3 -3
- package/lib/loop/embed/embedConfig.js +2 -3
- package/lib/loop/embed/embedTheme.d.ts +4 -4
- package/lib/loop/embed/embedTheme.js +11 -7
- package/lib/loop/plugins/a2a-sidebar/A2ASidebar.js +7 -34
- package/lib/loop/plugins/a2ui/A2uiView.js +4 -12
- package/lib/loop/plugins/a2ui-surface/InlineSurface.js +1 -16
- package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.js +2 -12
- package/lib/loop/plugins/agents/AnonymousKeyBadge.js +3 -2
- package/lib/loop/plugins/agents/SandboxSelector.js +3 -7
- package/lib/loop/plugins/agents/SandboxView.js +4 -27
- package/lib/loop/plugins/agents/TeamMemberPicker.js +2 -2
- package/lib/loop/plugins/agentspecs/AgentspecPicker.js +3 -2
- package/lib/loop/plugins/app-activity/AppActivity.js +1 -1
- package/lib/loop/plugins/app-computer/AppComputer.js +5 -21
- package/lib/loop/plugins/app-elements/AppElements.js +2 -31
- package/lib/loop/plugins/app-page/AppPage.js +1 -1
- package/lib/loop/plugins/app-rules/AppRulesCard.js +4 -20
- package/lib/loop/plugins/assistant/index.js +1 -13
- package/lib/loop/plugins/chat/ChatView.js +40 -106
- package/lib/loop/plugins/checkpoints-sidebar/CheckpointsSidebar.js +2 -13
- package/lib/loop/plugins/decks/DeckSurface.js +2 -2
- package/lib/loop/plugins/document/DocumentView.js +4 -12
- package/lib/loop/plugins/document-toolbar/SandboxStatusItem.js +3 -8
- package/lib/loop/plugins/graph/GraphView.js +2 -2
- package/lib/loop/plugins/input-prompt/ComposerView.js +1 -1
- package/lib/loop/plugins/notebook/NotebookView.js +3 -11
- package/lib/loop/plugins/page-layout/SplitLayout.js +11 -34
- package/lib/loop/plugins/page-layout/TurnPanel.js +9 -35
- package/lib/loop/plugins/shell/useEditorPreviews.js +3 -2
- package/lib/loop/plugins/subagent-activity/SubagentPulse.js +1 -13
- package/lib/loop/plugins/window-frame/WindowFrame.js +10 -44
- package/lib/loop/plugins/window-frame/index.js +1 -1
- package/lib/loop/shell/LoopWorkspace.js +34 -77
- package/lib/loop/shell/PluginToggles.js +4 -15
- package/lib/loop/shell/SidebarRail.js +8 -40
- package/lib/loop/shell/ViewSwitcher.js +4 -24
- package/lib/loop-main.js +2 -3
- package/lib/mcp/McpServerManager.js +6 -37
- package/lib/portable/index.d.ts +11 -0
- package/lib/portable/index.js +20 -0
- package/lib/protocols/AGUIAdapter.js +2 -2
- package/lib/protocols/BaseProtocolAdapter.d.ts +2 -0
- package/lib/protocols/BaseProtocolAdapter.js +4 -0
- package/lib/specs/apps.js +6 -0
- package/lib/specs/appspecSchema.js +11 -4
- package/lib/stories/loop/ReferenceScreens.js +17 -91
- package/lib/stories/loop/pictures-main.js +1 -1
- package/lib/types/agentspecs.d.ts +5 -2
- package/lib/types/protocol.d.ts +2 -0
- package/lib/utils/approvals.d.ts +59 -0
- package/lib/utils/approvals.js +101 -0
- package/lib/voice/VoiceInput.js +3 -39
- package/package.json +2 -2
- package/lib/shims/primerAddonsBox.d.ts +0 -1
- package/lib/shims/primerAddonsBox.js +0 -7
|
@@ -268,54 +268,53 @@ function ReadOnlyPlugin({ readOnly }) {
|
|
|
268
268
|
}
|
|
269
269
|
export function InputPromptLexical({ value, onChange, placeholder = 'Ask anything…', disabled = false, readOnly = false, onSubmit, onHistory, autoFocus = false, focusSignal, mentionableAgents, promptCommands, }) {
|
|
270
270
|
const chatText = useChatWords();
|
|
271
|
-
return (_jsx(Box
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
271
|
+
return (_jsx(Box
|
|
272
|
+
/*
|
|
273
|
+
The placeholder is positioned against this box.
|
|
274
|
+
|
|
275
|
+
It is `position: absolute` and this was `static`, so it resolved
|
|
276
|
+
against whatever ancestor happened to be positioned — which put
|
|
277
|
+
"Type a message..." up in the header, nowhere near the box it
|
|
278
|
+
describes. A containing block is the whole fix.
|
|
279
|
+
*/
|
|
280
|
+
, {
|
|
281
|
+
/*
|
|
282
|
+
The placeholder is positioned against this box.
|
|
283
|
+
|
|
284
|
+
It is `position: absolute` and this was `static`, so it resolved
|
|
285
|
+
against whatever ancestor happened to be positioned — which put
|
|
286
|
+
"Type a message..." up in the header, nowhere near the box it
|
|
287
|
+
describes. A containing block is the whole fix.
|
|
288
|
+
*/
|
|
289
|
+
position: "relative", px: 2,
|
|
290
|
+
// A little more above than the 2px it had: the text sat hard against
|
|
291
|
+
// the edge of the box, which reads as clipped rather than as tight.
|
|
292
|
+
// Still less than below, where the footer's own padding follows.
|
|
293
|
+
pt: "6px", pb: 1,
|
|
294
|
+
/*
|
|
295
|
+
* Greyed while it cannot be typed in.
|
|
296
|
+
*
|
|
297
|
+
* `contenteditable=false` stops the caret and nothing else — the text
|
|
298
|
+
* kept the same weight and colour as a live prompt, so a person had to
|
|
299
|
+
* try typing to discover the box was inert. The colour is set on the
|
|
300
|
+
* container and inherited, because the editable element deliberately
|
|
301
|
+
* declares no colour of its own.
|
|
302
|
+
*/
|
|
303
|
+
color: disabled || readOnly ? 'fg.subtle' : undefined, cursor: disabled || readOnly ? 'not-allowed' : undefined, sx: {
|
|
298
304
|
'& .input-prompt-lexical-p': {
|
|
299
305
|
margin: 0,
|
|
300
306
|
},
|
|
301
|
-
}, children: _jsxs(LexicalExtensionComposer, { extension: EDITOR_EXTENSION, contentEditable: null, children: [_jsx(ContentEditable, { placeholder: _jsx(Box, {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
top: '8px',
|
|
313
|
-
left: '8px',
|
|
314
|
-
color: 'fg.subtle',
|
|
315
|
-
fontSize: 1,
|
|
316
|
-
pointerEvents: 'none',
|
|
317
|
-
userSelect: 'none',
|
|
318
|
-
}, children: placeholder }), "aria-placeholder": placeholder, className: "input-prompt-lexical-content", "aria-label": chatText.messageInput, style: {
|
|
307
|
+
}, children: _jsxs(LexicalExtensionComposer, { extension: EDITOR_EXTENSION, contentEditable: null, children: [_jsx(ContentEditable, { placeholder: _jsx(Box, { position: "absolute",
|
|
308
|
+
/*
|
|
309
|
+
Level with the first line of typing.
|
|
310
|
+
|
|
311
|
+
Relative to the box above, which establishes the containing
|
|
312
|
+
block. The editor's own `padding: 2px 0` sits inside this
|
|
313
|
+
box's `pt: 2px`, so the caret's first line starts 4px down —
|
|
314
|
+
matching it here is what stops the placeholder floating
|
|
315
|
+
above the text it stands in for.
|
|
316
|
+
*/
|
|
317
|
+
top: "8px", left: "8px", color: "fg.subtle", fontSize: 1, pointerEvents: "none", userSelect: "none", children: placeholder }), "aria-placeholder": placeholder, className: "input-prompt-lexical-content", "aria-label": chatText.messageInput, style: {
|
|
319
318
|
outline: 'none',
|
|
320
319
|
minHeight: 32,
|
|
321
320
|
maxHeight: 120,
|
|
@@ -65,7 +65,7 @@ export function InputPromptText({ value, onChange, placeholder = 'Ask anything
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}, [onSubmit, onHistory]);
|
|
68
|
-
return (_jsx(Box, {
|
|
68
|
+
return (_jsx(Box, { px: 2, py: 1, children: _jsx(Textarea, { ref: inputRef, value: value, onChange: e => onChange(e.target.value), onKeyDown: handleKeyDown, placeholder: placeholder, disabled: disabled, readOnly: readOnly, sx: {
|
|
69
69
|
width: '100%',
|
|
70
70
|
resize: 'none',
|
|
71
71
|
// Greyed while it cannot be typed in, so the state is legible
|
|
@@ -6,13 +6,6 @@ import { PromptStacks } from '../stack';
|
|
|
6
6
|
import { useChatWords } from '../../ChatLanguage';
|
|
7
7
|
export function InPromptFooter({ stacks, children, rightContent, isLoading = false, sendDisabled = false, isKernelBusy = false, onSend, onStop, }) {
|
|
8
8
|
const chatText = useChatWords();
|
|
9
|
-
return (_jsxs(_Fragment, { children: [stacks && stacks.length > 0 ? _jsx(PromptStacks, { stacks: stacks }) : null, _jsxs(Box, { "data-prompt-stack": "controls",
|
|
10
|
-
display: 'flex',
|
|
11
|
-
alignItems: 'center',
|
|
12
|
-
gap: 2,
|
|
13
|
-
px: 2,
|
|
14
|
-
pt: 1,
|
|
15
|
-
pb: 2,
|
|
16
|
-
}, children: [_jsx(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, flex: 1 }, children: children }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [rightContent, isLoading ? (_jsx(IconButton, { icon: SquareCircleIcon, "aria-label": chatText.stop, "data-prompt-action": "stop", onClick: onStop, size: "small", variant: "invisible" })) : isKernelBusy ? (_jsx(IconButton, { icon: PauseIcon, "aria-label": chatText.pauseKernelBusy, onClick: onStop, size: "small", variant: "invisible", disabled: !onStop })) : (_jsx(IconButton, { icon: PaperAirplaneIcon, "aria-label": chatText.send, onClick: onSend, disabled: sendDisabled, size: "small", variant: "invisible" }))] })] })] }));
|
|
9
|
+
return (_jsxs(_Fragment, { children: [stacks && stacks.length > 0 ? _jsx(PromptStacks, { stacks: stacks }) : null, _jsxs(Box, { "data-prompt-stack": "controls", display: "flex", alignItems: "center", gap: 2, px: 2, pt: 1, pb: 2, children: [_jsx(Box, { display: "flex", alignItems: "center", gap: 2, flex: 1, children: children }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [rightContent, isLoading ? (_jsx(IconButton, { icon: SquareCircleIcon, "aria-label": chatText.stop, "data-prompt-action": "stop", onClick: onStop, size: "small", variant: "invisible" })) : isKernelBusy ? (_jsx(IconButton, { icon: PauseIcon, "aria-label": chatText.pauseKernelBusy, onClick: onStop, size: "small", variant: "invisible", disabled: !onStop })) : (_jsx(IconButton, { icon: PaperAirplaneIcon, "aria-label": chatText.send, onClick: onSend, disabled: sendDisabled, size: "small", variant: "invisible" }))] })] })] }));
|
|
17
10
|
}
|
|
18
11
|
export default InPromptFooter;
|
|
@@ -28,7 +28,7 @@ export function AgentsMenu({ agents, selectedAgentId, onSelectAgent, }) {
|
|
|
28
28
|
active ? `Agent — ${active.name}` : 'Choose an agent',
|
|
29
29
|
`${agents.length} available`,
|
|
30
30
|
].join(' · ');
|
|
31
|
-
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: label, direction: "n", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": label, leadingVisual: ActiveIcon, children: _jsx(Text, { sx: { fontSize: 0 }, children: agents.length }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-top", align: "start", width: "large", children: _jsx(Box, {
|
|
31
|
+
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: label, direction: "n", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": label, leadingVisual: ActiveIcon, children: _jsx(Text, { sx: { fontSize: 0 }, children: agents.length }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-top", align: "start", width: "large", children: _jsx(Box, { width: 440, maxWidth: "calc(100vw - 16px)", children: _jsx(ActionList, { selectionVariant: "single", role: "listbox", "aria-label": "Agent", children: agents.map(agent => (_jsxs(ActionList.Item, { selected: agent.id === selectedAgentId, onSelect: () => onSelectAgent?.(agent.id), children: [_jsx(ActionList.LeadingVisual, { children: agent.icon ? _jsx(agent.icon, {}) : _jsx(AiAgentIcon, {}) }), agent.name, agent.description ? (_jsx(ActionList.Description, { variant: "block",
|
|
32
32
|
/* `minWidth: 0` is the load-bearing one: a grid item
|
|
33
33
|
defaults to `min-content`, so without it the description
|
|
34
34
|
refuses to be narrower than its longest unbroken run and
|
|
@@ -9,7 +9,7 @@ export function InlineAgentsMenu({ agents, selectedAgentId, onSelectAgent, }) {
|
|
|
9
9
|
active ? `Answering: ${active.name}` : 'Choose an agent',
|
|
10
10
|
`${agents.length} available`,
|
|
11
11
|
].join(' · ');
|
|
12
|
-
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: label, direction: "s", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": label, leadingVisual: ActiveIcon, sx: { px: 1, color: 'fg.muted' }, children: _jsx(Text, { sx: { fontSize: 0 }, children: agents.length }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-bottom", align: "start", width: "large", children: _jsx(Box, {
|
|
12
|
+
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: label, direction: "s", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": label, leadingVisual: ActiveIcon, sx: { px: 1, color: 'fg.muted' }, children: _jsx(Text, { sx: { fontSize: 0 }, children: agents.length }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-bottom", align: "start", width: "large", children: _jsx(Box, { width: 440, maxWidth: "calc(100vw - 16px)", children: _jsx(ActionList, { selectionVariant: "single", role: "listbox", "aria-label": "Agent", children: agents.map(agent => (_jsxs(ActionList.Item, { selected: agent.id === selectedAgentId, onSelect: () => onSelectAgent?.(agent.id), children: [_jsx(ActionList.LeadingVisual, { children: agent.icon ? _jsx(agent.icon, {}) : _jsx(AiAgentIcon, {}) }), agent.name, agent.description ? (_jsx(ActionList.Description, { variant: "block",
|
|
13
13
|
/* `minWidth: 0` is the load-bearing one: a grid item
|
|
14
14
|
defaults to `min-content`, so without it the description
|
|
15
15
|
refuses to be narrower than its longest unbroken run and
|
|
@@ -34,11 +34,7 @@ export function ModelSelector({ models, decisions, selectedModel, onModelSelect,
|
|
|
34
34
|
const summary = isA2AProtocol
|
|
35
35
|
? 'set by the agent config'
|
|
36
36
|
: `${active?.name ?? 'none selected'} · ${models.length} to choose from`;
|
|
37
|
-
return (_jsxs(Box, { sx:
|
|
38
|
-
display: 'flex',
|
|
39
|
-
flexDirection: 'column',
|
|
40
|
-
alignItems: 'flex-end',
|
|
41
|
-
}, children: [_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: `Model — ${summary}`, direction: "n", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": `Model — ${summary}`, leadingVisual: AiModelIcon, disabled: isA2AProtocol, sx: isA2AProtocol
|
|
37
|
+
return (_jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "flex-end", children: [_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: `Model — ${summary}`, direction: "n", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": `Model — ${summary}`, leadingVisual: AiModelIcon, disabled: isA2AProtocol, sx: isA2AProtocol
|
|
42
38
|
? { opacity: 0.5, cursor: 'not-allowed' }
|
|
43
39
|
: undefined, children: _jsx(Text, { sx: { fontSize: 0 }, children: models.length }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-top", align: "end", children: _jsxs(ActionList, { selectionVariant: "single", children: [models.map(modelItem => (_jsxs(ActionList.Item, { selected: selectedModel === modelItem.id, onSelect: () => onModelSelect(modelItem.id), disabled: modelItem.isAvailable === false || isA2AProtocol, sx: modelItem.isAvailable === false
|
|
44
40
|
? { color: 'fg.muted' }
|
|
@@ -20,28 +20,11 @@ export function SkillsMenu({ skills, skillsLoading, enabledSkills, onToggleSkill
|
|
|
20
20
|
: skills.length === 0
|
|
21
21
|
? 'none loaded'
|
|
22
22
|
: `${enabledSkills.size} of ${skills.length} enabled`;
|
|
23
|
-
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: `Skills — ${summary}`, direction: "n", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": `Skills — ${summary}`, leadingVisual: BriefcaseIcon, children: _jsx(Text, { sx: { fontSize: 0 }, children: skills.length }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-top", align: "start", width: "large", children: _jsx(Box, {
|
|
24
|
-
display: 'flex',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
justifyContent: 'space-between',
|
|
27
|
-
px: 3,
|
|
28
|
-
py: 2,
|
|
29
|
-
borderBottom: '1px solid',
|
|
30
|
-
borderColor: 'border.muted',
|
|
31
|
-
}, children: [_jsxs(Text, { id: "toggle-all-skills", sx: {
|
|
23
|
+
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: `Skills — ${summary}`, direction: "n", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": `Skills — ${summary}`, leadingVisual: BriefcaseIcon, children: _jsx(Text, { sx: { fontSize: 0 }, children: skills.length }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-top", align: "start", width: "large", children: _jsx(Box, { maxHeight: "60vh", overflowY: "auto", children: _jsx(ActionList, { children: skillsLoading ? (_jsx(ActionList.Item, { disabled: true, children: _jsx(Text, { sx: { color: 'fg.muted' }, children: "Loading skills..." }) })) : skills.length > 0 ? (_jsxs(_Fragment, { children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.muted", children: [_jsxs(Text, { id: "toggle-all-skills", sx: {
|
|
32
24
|
fontSize: 0,
|
|
33
25
|
fontWeight: 'semibold',
|
|
34
26
|
color: 'fg.muted',
|
|
35
|
-
}, children: ["Enable all (", enabledSkills.size, "/", skills.length, ")"] }), _jsx(ToggleSwitch, { size: "small", checked: enabledSkills.size === skills.length, onClick: () => onToggleAllSkills(skills.map(s => s.id), enabledSkills.size !== skills.length), "aria-labelledby": "toggle-all-skills" })] }), skills.map(skill => (_jsxs(Box, { sx: {
|
|
36
|
-
display: 'flex',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
justifyContent: 'space-between',
|
|
39
|
-
px: 3,
|
|
40
|
-
py: 2,
|
|
41
|
-
'&:hover': {
|
|
42
|
-
backgroundColor: 'canvas.subtle',
|
|
43
|
-
},
|
|
44
|
-
}, children: [_jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 1 }, children: [hasMark(marksOfSkill(skill.id)) && (_jsx(SpecMark, { ...marksOfSkill(skill.id), size: 16 })), _jsx(Text, { id: `toggle-skill-${skill.id}`, sx: { fontWeight: 'semibold' }, children: skill.name }), skill.status && (_jsx(Text, { sx: {
|
|
27
|
+
}, children: ["Enable all (", enabledSkills.size, "/", skills.length, ")"] }), _jsx(ToggleSwitch, { size: "small", checked: enabledSkills.size === skills.length, onClick: () => onToggleAllSkills(skills.map(s => s.id), enabledSkills.size !== skills.length), "aria-labelledby": "toggle-all-skills" })] }), skills.map(skill => (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 2, hover: { backgroundColor: 'canvas.subtle' }, children: [_jsxs(Box, { flex: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [hasMark(marksOfSkill(skill.id)) && (_jsx(SpecMark, { ...marksOfSkill(skill.id), size: 16 })), _jsx(Text, { id: `toggle-skill-${skill.id}`, sx: { fontWeight: 'semibold' }, children: skill.name }), skill.status && (_jsx(Text, { sx: {
|
|
45
28
|
fontSize: '10px',
|
|
46
29
|
px: 1,
|
|
47
30
|
borderRadius: 2,
|
|
@@ -62,15 +45,5 @@ export function SkillsMenu({ skills, skillsLoading, enabledSkills, onToggleSkill
|
|
|
62
45
|
overflow: 'hidden',
|
|
63
46
|
textOverflow: 'ellipsis',
|
|
64
47
|
whiteSpace: 'nowrap',
|
|
65
|
-
}, children: skill.description }))] }), _jsxs(Box, {
|
|
66
|
-
display: 'flex',
|
|
67
|
-
flexDirection: 'column',
|
|
68
|
-
alignItems: 'center',
|
|
69
|
-
gap: '2px',
|
|
70
|
-
}, children: [_jsx(Text, { sx: { fontSize: '10px', color: 'fg.muted' }, children: "Enabled" }), _jsx(ToggleSwitch, { size: "small", checked: enabledSkills.has(skill.id), onClick: () => onToggleSkill(skill.id), "aria-labelledby": `toggle-skill-${skill.id}` })] }), _jsxs(Box, { sx: {
|
|
71
|
-
display: 'flex',
|
|
72
|
-
flexDirection: 'column',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
gap: '2px',
|
|
75
|
-
}, children: [_jsx(Text, { sx: { fontSize: '10px', color: 'fg.muted' }, children: "Approved" }), _jsx(ToggleSwitch, { size: "small", checked: approvedSkills.has(skill.id), onClick: () => onToggleSkillApproval(skill.id), "aria-labelledby": `toggle-skill-${skill.id}` })] })] })] }, skill.id)))] })) : (_jsx(ActionList.Item, { disabled: true, children: _jsx(Text, { sx: { color: 'fg.muted', fontStyle: 'italic' }, children: "No skills available" }) })) }) }) })] }));
|
|
48
|
+
}, children: skill.description }))] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 3, children: [_jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: "2px", children: [_jsx(Text, { sx: { fontSize: '10px', color: 'fg.muted' }, children: "Enabled" }), _jsx(ToggleSwitch, { size: "small", checked: enabledSkills.has(skill.id), onClick: () => onToggleSkill(skill.id), "aria-labelledby": `toggle-skill-${skill.id}` })] }), _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: "2px", children: [_jsx(Text, { sx: { fontSize: '10px', color: 'fg.muted' }, children: "Approved" }), _jsx(ToggleSwitch, { size: "small", checked: approvedSkills.has(skill.id), onClick: () => onToggleSkillApproval(skill.id), "aria-labelledby": `toggle-skill-${skill.id}` })] })] })] }, skill.id)))] })) : (_jsx(ActionList.Item, { disabled: true, children: _jsx(Text, { sx: { color: 'fg.muted', fontStyle: 'italic' }, children: "No skills available" }) })) }) }) })] }));
|
|
76
49
|
}
|
|
@@ -22,7 +22,7 @@ import { LightBulbIcon } from '@primer/octicons-react';
|
|
|
22
22
|
import { groupSuggestions } from '../../display/groupSuggestions';
|
|
23
23
|
export function SuggestionsMenu({ suggestions, onPick, }) {
|
|
24
24
|
const summary = suggestions.length === 0 ? 'none' : `${suggestions.length} to choose from`;
|
|
25
|
-
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: `Suggestions — ${summary}`, direction: "n", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": `Suggestions — ${summary}`, leadingVisual: LightBulbIcon, children: _jsx(Text, { sx: { fontSize: 0 }, children: suggestions.length }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-top", align: "start", width: "large", children: _jsx(Box, {
|
|
25
|
+
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: `Suggestions — ${summary}`, direction: "n", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": `Suggestions — ${summary}`, leadingVisual: LightBulbIcon, children: _jsx(Text, { sx: { fontSize: 0 }, children: suggestions.length }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-top", align: "start", width: "large", children: _jsx(Box, { maxHeight: "60vh", overflowY: "auto", children: _jsx(ActionList, { children: suggestions.length === 0 ? (_jsx(ActionList.Item, { disabled: true, children: _jsx(Text, { sx: { color: 'fg.muted' }, children: "This agent offers no suggestions." }) })) : (
|
|
26
26
|
// In blocks: the team's openers, then the addressed member's
|
|
27
27
|
// own under its name — the same shape the empty state draws.
|
|
28
28
|
// No `as` on the heading: inside a menu Primer refuses one.
|
|
@@ -39,16 +39,7 @@ export function ToolsMenu({ codemodeEnabled, onToggleCodemode, mcpServers, enabl
|
|
|
39
39
|
.join(' · ');
|
|
40
40
|
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Tooltip, { text: `Tools — ${summary}`, direction: "n", children: _jsx(Button, { type: "button", variant: "invisible", size: "small", "aria-label": `Tools — ${summary}`, leadingVisual: ToolsIcon, children: _jsx(Text, { sx: { fontSize: 0 }, children: availableTools.length +
|
|
41
41
|
availableFrontendTools.length +
|
|
42
|
-
enabledMcpToolCount }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-top", align: "start", width: "large", children: _jsx(Box, {
|
|
43
|
-
display: 'flex',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
justifyContent: 'space-between',
|
|
46
|
-
px: 3,
|
|
47
|
-
py: 2,
|
|
48
|
-
borderBottom: '1px solid',
|
|
49
|
-
borderColor: 'border.muted',
|
|
50
|
-
gap: 2,
|
|
51
|
-
}, children: [_jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [_jsx(Text, { id: "toggle-codemode", sx: { fontWeight: 'semibold', display: 'block' }, children: "Enable Codemode" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: codemodeEnabled
|
|
42
|
+
enabledMcpToolCount }) }) }) }), _jsx(ActionMenu.Overlay, { side: "outside-top", align: "start", width: "large", children: _jsx(Box, { maxHeight: "60vh", overflowY: "auto", children: _jsxs(ActionList, { children: [_jsx(ActionList.Group, { title: "Codemode", children: _jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.muted", gap: 2, children: [_jsxs(Box, { flex: 1, minWidth: 0, children: [_jsx(Text, { id: "toggle-codemode", sx: { fontWeight: 'semibold', display: 'block' }, children: "Enable Codemode" }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: codemodeEnabled
|
|
52
43
|
? 'MCP tools accessible via meta-tools (search_tools, execute_code).'
|
|
53
44
|
: 'Expose MCP tools directly to the model.' })] }), _jsx(ToggleSwitch, { size: "small", checked: codemodeEnabled, disabled: !onToggleCodemode, onClick: () => {
|
|
54
45
|
if (onToggleCodemode) {
|
|
@@ -61,19 +52,7 @@ export function ToolsMenu({ codemodeEnabled, onToggleCodemode, mcpServers, enabl
|
|
|
61
52
|
const allEnabled = enabledCount === allToolNames.length &&
|
|
62
53
|
allToolNames.length > 0;
|
|
63
54
|
const serverMarks = marksOfMcpServer(server);
|
|
64
|
-
return (_jsxs(ActionList.Group, { title: `${server.name}${server.isAvailable ? '' : ' (unavailable)'}`, children: [server.isAvailable && server.tools.length > 0 && (_jsxs(Box, { sx: {
|
|
65
|
-
display: 'flex',
|
|
66
|
-
alignItems: 'center',
|
|
67
|
-
justifyContent: 'space-between',
|
|
68
|
-
px: 3,
|
|
69
|
-
py: 2,
|
|
70
|
-
borderBottom: '1px solid',
|
|
71
|
-
borderColor: 'border.muted',
|
|
72
|
-
}, children: [_jsxs(Box, { sx: {
|
|
73
|
-
display: 'flex',
|
|
74
|
-
alignItems: 'center',
|
|
75
|
-
gap: 2,
|
|
76
|
-
}, children: [hasMark(serverMarks) && (_jsx(SpecMark, { icon: serverMarks.icon, emoji: serverMarks.emoji, size: 16 })), _jsxs(Text, { id: `toggle-all-${server.id}`, sx: {
|
|
55
|
+
return (_jsxs(ActionList.Group, { title: `${server.name}${server.isAvailable ? '' : ' (unavailable)'}`, children: [server.isAvailable && server.tools.length > 0 && (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 2, borderBottom: "1px solid", borderColor: "border.muted", children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [hasMark(serverMarks) && (_jsx(SpecMark, { icon: serverMarks.icon, emoji: serverMarks.emoji, size: 16 })), _jsxs(Text, { id: `toggle-all-${server.id}`, sx: {
|
|
77
56
|
fontSize: 0,
|
|
78
57
|
fontWeight: 'semibold',
|
|
79
58
|
color: 'fg.muted',
|
|
@@ -83,37 +62,14 @@ export function ToolsMenu({ codemodeEnabled, onToggleCodemode, mcpServers, enabl
|
|
|
83
62
|
// Tools default to NOT approved — user must explicitly
|
|
84
63
|
// approve each one (matches the Skills approval UX).
|
|
85
64
|
const isApproved = serverApproved?.has(tool.name) ?? false;
|
|
86
|
-
return (_jsxs(Box, { sx: {
|
|
87
|
-
display: 'flex',
|
|
88
|
-
alignItems: 'center',
|
|
89
|
-
justifyContent: 'space-between',
|
|
90
|
-
px: 3,
|
|
91
|
-
py: 2,
|
|
92
|
-
'&:hover': {
|
|
93
|
-
backgroundColor: 'canvas.subtle',
|
|
94
|
-
},
|
|
95
|
-
}, children: [_jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [_jsx(Text, { id: `toggle-tool-${server.id}-${tool.name}`, sx: { fontWeight: 'semibold' }, children: tool.name }), tool.description && (_jsx(Text, { sx: {
|
|
65
|
+
return (_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 2, hover: { backgroundColor: 'canvas.subtle' }, children: [_jsxs(Box, { flex: 1, minWidth: 0, children: [_jsx(Text, { id: `toggle-tool-${server.id}-${tool.name}`, sx: { fontWeight: 'semibold' }, children: tool.name }), tool.description && (_jsx(Text, { sx: {
|
|
96
66
|
display: 'block',
|
|
97
67
|
fontSize: 0,
|
|
98
68
|
color: 'fg.muted',
|
|
99
69
|
overflow: 'hidden',
|
|
100
70
|
textOverflow: 'ellipsis',
|
|
101
71
|
whiteSpace: 'nowrap',
|
|
102
|
-
}, children: tool.description }))] }), _jsxs(Box, { sx: {
|
|
103
|
-
display: 'flex',
|
|
104
|
-
alignItems: 'center',
|
|
105
|
-
gap: 3,
|
|
106
|
-
}, children: [_jsxs(Box, { sx: {
|
|
107
|
-
display: 'flex',
|
|
108
|
-
flexDirection: 'column',
|
|
109
|
-
alignItems: 'center',
|
|
110
|
-
gap: '2px',
|
|
111
|
-
}, children: [_jsx(Text, { sx: { fontSize: '10px', color: 'fg.muted' }, children: "Enabled" }), _jsx(ToggleSwitch, { size: "small", checked: isEnabled, onClick: () => onToggleMcpTool(server.id, tool.name), "aria-labelledby": `toggle-tool-${server.id}-${tool.name}` })] }), _jsxs(Box, { sx: {
|
|
112
|
-
display: 'flex',
|
|
113
|
-
flexDirection: 'column',
|
|
114
|
-
alignItems: 'center',
|
|
115
|
-
gap: '2px',
|
|
116
|
-
}, children: [_jsx(Text, { sx: { fontSize: '10px', color: 'fg.muted' }, children: "Approved" }), _jsx(ToggleSwitch, { size: "small", checked: isApproved, onClick: () => onToggleMcpToolApproval(server.id, tool.name), "aria-labelledby": `toggle-tool-${server.id}-${tool.name}` })] })] })] }, `${server.id}-${tool.name}`));
|
|
72
|
+
}, children: tool.description }))] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 3, children: [_jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: "2px", children: [_jsx(Text, { sx: { fontSize: '10px', color: 'fg.muted' }, children: "Enabled" }), _jsx(ToggleSwitch, { size: "small", checked: isEnabled, onClick: () => onToggleMcpTool(server.id, tool.name), "aria-labelledby": `toggle-tool-${server.id}-${tool.name}` })] }), _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: "2px", children: [_jsx(Text, { sx: { fontSize: '10px', color: 'fg.muted' }, children: "Approved" }), _jsx(ToggleSwitch, { size: "small", checked: isApproved, onClick: () => onToggleMcpToolApproval(server.id, tool.name), "aria-labelledby": `toggle-tool-${server.id}-${tool.name}` })] })] })] }, `${server.id}-${tool.name}`));
|
|
117
73
|
})) : server.isAvailable ? (_jsx(ActionList.Item, { disabled: true, children: _jsx(Text, { sx: { color: 'fg.muted', fontStyle: 'italic' }, children: "No tools discovered" }) })) : (_jsx(ActionList.Item, { disabled: true, children: _jsx(Text, { sx: { color: 'fg.muted', fontStyle: 'italic' }, children: "Server unavailable" }) }))] }, server.id));
|
|
118
74
|
})) : (_jsx(ActionList.Group, { title: "No MCP Servers", children: _jsx(ActionList.Item, { disabled: true, children: _jsx(Text, { sx: { color: 'fg.muted', fontStyle: 'italic' }, children: "No MCP Servers" }) }) }))] }) }) })] }));
|
|
119
75
|
}
|
|
@@ -256,14 +256,7 @@ export function AgentMentionPlugin({ agents, }) {
|
|
|
256
256
|
if (!open || !query?.rect) {
|
|
257
257
|
return null;
|
|
258
258
|
}
|
|
259
|
-
return (_jsxs(_Fragment, { children: [_jsx(Box, { ref: anchorRef,
|
|
260
|
-
position: 'fixed',
|
|
261
|
-
left: query.rect.left,
|
|
262
|
-
top: query.rect.top,
|
|
263
|
-
width: 1,
|
|
264
|
-
height: query.rect.height || 16,
|
|
265
|
-
pointerEvents: 'none',
|
|
266
|
-
} }), _jsx(Overlay, { returnFocusRef: anchorRef, onEscape: () => setQuery(null), onClickOutside: () => setQuery(null), anchorSide: "outside-top",
|
|
259
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, { ref: anchorRef, position: "fixed", left: query.rect.left, top: query.rect.top, width: 1, height: query.rect.height || 16, pointerEvents: "none" }), _jsx(Overlay, { returnFocusRef: anchorRef, onEscape: () => setQuery(null), onClickOutside: () => setQuery(null), anchorSide: "outside-top",
|
|
267
260
|
// The caret already has focus and must keep it: a person is still
|
|
268
261
|
// typing, and the menu is a suggestion rather than a destination.
|
|
269
262
|
preventFocusOnOpen: true,
|
|
@@ -322,7 +315,7 @@ export function AgentMentionPlugin({ agents, }) {
|
|
|
322
315
|
maxHeight: MENU_MAX_HEIGHT,
|
|
323
316
|
overflowY: 'auto',
|
|
324
317
|
maxWidth: 'calc(100vw - 16px)',
|
|
325
|
-
}, children: _jsx(Box, {
|
|
318
|
+
}, children: _jsx(Box, { width: "100%", maxWidth: MENU_WIDTH, minWidth: 0, children: _jsx(ActionList, { selectionVariant: "single", children: matches.map(agent => {
|
|
326
319
|
const index = choosable.indexOf(agent);
|
|
327
320
|
return (_jsxs(ActionList.Item, { ref: element => {
|
|
328
321
|
if (element) {
|
|
@@ -245,14 +245,7 @@ export function CommandPlugin({ commands, }) {
|
|
|
245
245
|
if (!open || !query?.rect) {
|
|
246
246
|
return null;
|
|
247
247
|
}
|
|
248
|
-
return (_jsxs(_Fragment, { children: [_jsx(Box, { ref: anchorRef,
|
|
249
|
-
position: 'fixed',
|
|
250
|
-
left: query.rect.left,
|
|
251
|
-
top: query.rect.top,
|
|
252
|
-
width: 1,
|
|
253
|
-
height: query.rect.height || 16,
|
|
254
|
-
pointerEvents: 'none',
|
|
255
|
-
} }), _jsx(Overlay, { returnFocusRef: anchorRef, onEscape: () => setQuery(null), onClickOutside: () => setQuery(null), anchorSide: "outside-top",
|
|
248
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, { ref: anchorRef, position: "fixed", left: query.rect.left, top: query.rect.top, width: 1, height: query.rect.height || 16, pointerEvents: "none" }), _jsx(Overlay, { returnFocusRef: anchorRef, onEscape: () => setQuery(null), onClickOutside: () => setQuery(null), anchorSide: "outside-top",
|
|
256
249
|
// The caret already has focus and must keep it: a person is still
|
|
257
250
|
// typing, and the menu is a suggestion rather than a destination.
|
|
258
251
|
preventFocusOnOpen: true,
|
|
@@ -311,7 +304,7 @@ export function CommandPlugin({ commands, }) {
|
|
|
311
304
|
maxHeight: MENU_MAX_HEIGHT,
|
|
312
305
|
overflowY: 'auto',
|
|
313
306
|
maxWidth: 'calc(100vw - 16px)',
|
|
314
|
-
}, children: _jsx(Box, {
|
|
307
|
+
}, children: _jsx(Box, { width: "100%", maxWidth: MENU_WIDTH, minWidth: 0, children: _jsx(ActionList, { selectionVariant: "single", children: matches.map(command => {
|
|
315
308
|
const index = choosable.indexOf(command);
|
|
316
309
|
return (_jsxs(ActionList.Item, { ref: element => {
|
|
317
310
|
if (element) {
|
|
@@ -5,20 +5,6 @@ export function MentionChip({ name, icon: IconComponent, }) {
|
|
|
5
5
|
// `contentEditable={false}` is what stops the caret entering it: without
|
|
6
6
|
// it a person can put the cursor between the icon and the name and type
|
|
7
7
|
// into a mention.
|
|
8
|
-
contentEditable: false,
|
|
9
|
-
display: 'inline-flex',
|
|
10
|
-
alignItems: 'center',
|
|
11
|
-
gap: 1,
|
|
12
|
-
px: 1,
|
|
13
|
-
py: '1px',
|
|
14
|
-
mx: '1px',
|
|
15
|
-
borderRadius: 6,
|
|
16
|
-
bg: 'accent.subtle',
|
|
17
|
-
color: 'accent.fg',
|
|
18
|
-
fontSize: 1,
|
|
19
|
-
lineHeight: 1.4,
|
|
20
|
-
whiteSpace: 'nowrap',
|
|
21
|
-
userSelect: 'none',
|
|
22
|
-
}, children: [IconComponent ? _jsx(IconComponent, { size: 12 }) : null, name] }));
|
|
8
|
+
contentEditable: false, display: "inline-flex", alignItems: "center", gap: 1, px: 1, py: "1px", mx: "1px", borderRadius: 6, bg: "accent.subtle", color: "accent.fg", fontSize: 1, lineHeight: 1.4, whiteSpace: "nowrap", userSelect: "none", children: [IconComponent ? _jsx(IconComponent, { size: 12 }) : null, name] }));
|
|
23
9
|
}
|
|
24
10
|
export default MentionChip;
|
package/lib/chat/prompt/stack.js
CHANGED
|
@@ -17,25 +17,7 @@ export function PromptStacks({ stacks, disabled = false, }) {
|
|
|
17
17
|
}
|
|
18
18
|
return (_jsx(_Fragment, { children: visible.map(stack => {
|
|
19
19
|
const isDisabled = disabled || stack.disabled;
|
|
20
|
-
return (_jsx(Box, { "data-prompt-stack": stack.id, "aria-disabled": isDisabled || undefined,
|
|
21
|
-
...(stack.layout === 'block'
|
|
22
|
-
? null
|
|
23
|
-
: {
|
|
24
|
-
display: 'flex',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
gap: stack.gap ?? 2,
|
|
27
|
-
}),
|
|
28
|
-
px: stack.px ?? 2,
|
|
29
|
-
py: stack.py ?? 1,
|
|
30
|
-
...(stack.pt === undefined ? null : { pt: stack.pt }),
|
|
31
|
-
...(stack.pb === undefined ? null : { pb: stack.pb }),
|
|
32
|
-
minHeight: stack.minHeight,
|
|
33
|
-
...(stack.bordered
|
|
34
|
-
? { borderTop: '1px solid', borderColor: 'border.default' }
|
|
35
|
-
: null),
|
|
36
|
-
...(stack.subtle ? { bg: 'canvas.subtle' } : null),
|
|
37
|
-
...(isDisabled ? { opacity: 0.5, pointerEvents: 'none' } : null),
|
|
38
|
-
}, children: stack.content }, stack.id));
|
|
20
|
+
return (_jsx(Box, { "data-prompt-stack": stack.id, "aria-disabled": isDisabled || undefined, px: stack.px ?? 2, py: stack.py ?? 1, minHeight: stack.minHeight, display: stack.layout === 'block' ? undefined : 'flex', alignItems: stack.layout === 'block' ? undefined : 'center', gap: stack.layout === 'block' ? undefined : (stack.gap ?? 2), pt: stack.pt === undefined ? undefined : stack.pt, pb: stack.pb === undefined ? undefined : stack.pb, borderTop: stack.bordered ? '1px solid' : undefined, borderColor: stack.bordered ? 'border.default' : undefined, bg: stack.subtle ? 'canvas.subtle' : undefined, opacity: isDisabled ? 0.5 : undefined, pointerEvents: isDisabled ? 'none' : undefined, children: stack.content }, stack.id));
|
|
39
21
|
}) }));
|
|
40
22
|
}
|
|
41
23
|
export default PromptStacks;
|
|
@@ -104,16 +104,10 @@ const strings = (value) => Array.isArray(value)
|
|
|
104
104
|
// Pieces
|
|
105
105
|
// ---------------------------------------------------------------------------
|
|
106
106
|
function Section({ title, children, }) {
|
|
107
|
-
return (_jsxs(Box, {
|
|
107
|
+
return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 2, children: [_jsx(Heading, { as: "h4", sx: { fontSize: 1, m: 0 }, children: title }), children] }));
|
|
108
108
|
}
|
|
109
109
|
function Row({ label, children, }) {
|
|
110
|
-
return (_jsxs(Box, { sx: {
|
|
111
|
-
display: 'grid',
|
|
112
|
-
gridTemplateColumns: '112px 1fr',
|
|
113
|
-
gap: 2,
|
|
114
|
-
alignItems: 'baseline',
|
|
115
|
-
fontSize: 0,
|
|
116
|
-
}, children: [_jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: label }), _jsx(Box, { sx: { minWidth: 0, wordBreak: 'break-all' }, children: children })] }));
|
|
110
|
+
return (_jsxs(Box, { display: "grid", gridTemplateColumns: "112px 1fr", gap: 2, alignItems: "baseline", fontSize: 0, children: [_jsx(Text, { sx: { color: 'fg.muted', fontSize: 0 }, children: label }), _jsx(Box, { minWidth: 0, wordBreak: "break-all", children: children })] }));
|
|
117
111
|
}
|
|
118
112
|
function External({ href, children, }) {
|
|
119
113
|
return (_jsxs(Link, { href: href, target: "_blank", rel: "noreferrer", sx: {
|
|
@@ -164,21 +158,15 @@ function ValueView({ value, depth = 0, }) {
|
|
|
164
158
|
return _jsx(None, {});
|
|
165
159
|
}
|
|
166
160
|
if (value.every(item => typeof item !== 'object' || item === null)) {
|
|
167
|
-
return (_jsx(Box, {
|
|
161
|
+
return (_jsx(Box, { display: "flex", gap: 2, flexWrap: "wrap", children: value.map((item, index) => (_jsx(ValueView, { value: item, depth: depth + 1 }, index))) }));
|
|
168
162
|
}
|
|
169
|
-
return (_jsx(Box, {
|
|
163
|
+
return (_jsx(Box, { display: "flex", flexDirection: "column", gap: 2, children: value.map((item, index) => (_jsx(Box, { pl: 2, borderLeft: "2px solid", borderColor: "border.muted", children: _jsx(ValueView, { value: item, depth: depth + 1 }) }, index))) }));
|
|
170
164
|
}
|
|
171
165
|
const entries = Object.entries(value);
|
|
172
166
|
if (entries.length === 0) {
|
|
173
167
|
return _jsx(None, { word: "empty" });
|
|
174
168
|
}
|
|
175
|
-
return (_jsx(Box, { sx: {
|
|
176
|
-
display: 'grid',
|
|
177
|
-
gridTemplateColumns: 'max-content 1fr',
|
|
178
|
-
columnGap: 2,
|
|
179
|
-
rowGap: 1,
|
|
180
|
-
alignItems: 'baseline',
|
|
181
|
-
}, children: entries.map(([key, entry]) => (_jsxs(React.Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: humanize(key) }), _jsx(Box, { sx: { minWidth: 0, wordBreak: 'break-all' }, children: _jsx(ValueView, { value: entry, depth: depth + 1 }) })] }, key))) }));
|
|
169
|
+
return (_jsx(Box, { display: "grid", gridTemplateColumns: "max-content 1fr", columnGap: 2, rowGap: 1, alignItems: "baseline", children: entries.map(([key, entry]) => (_jsxs(React.Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: humanize(key) }), _jsx(Box, { minWidth: 0, wordBreak: "break-all", children: _jsx(ValueView, { value: entry, depth: depth + 1 }) })] }, key))) }));
|
|
182
170
|
}
|
|
183
171
|
/** The keys laid out by hand below; every other top-level key gets a row of its own. */
|
|
184
172
|
const HANDLED_KEYS = new Set([
|
|
@@ -211,21 +199,11 @@ function CardFields({ card, }) {
|
|
|
211
199
|
const inputs = strings(card.defaultInputModes);
|
|
212
200
|
const outputs = strings(card.defaultOutputModes);
|
|
213
201
|
const others = Object.entries(card).filter(([key]) => !HANDLED_KEYS.has(key));
|
|
214
|
-
return (_jsxs(Box, {
|
|
215
|
-
display: 'flex',
|
|
216
|
-
gap: 2,
|
|
217
|
-
alignItems: 'center',
|
|
218
|
-
flexWrap: 'wrap',
|
|
219
|
-
}, children: [_jsx(Label, { size: "small", children: text(entry.protocolBinding) ?? 'binding' }), text(entry.url) ? _jsx(Mono, { children: text(entry.url) }) : null, text(entry.protocolVersion) ? (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["v", text(entry.protocolVersion)] })) : null] }, index))) })) })) : null, capabilities !== undefined ? (_jsx(Row, { label: "Capabilities", children: capabilityEntries.length === 0 ? (_jsx(None, {})) : (_jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1 }, children: [_jsx(Box, { sx: { display: 'flex', gap: 1, flexWrap: 'wrap' }, children: capabilityEntries
|
|
202
|
+
return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 2, children: [_jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 1, fontWeight: 'bold' }, children: text(card.name) ?? 'Unnamed agent' }), text(card.version) ? (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', ml: 2 }, children: ["v", text(card.version)] })) : null, text(card.protocolVersion) ? (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted', ml: 2 }, children: ["A2A ", text(card.protocolVersion)] })) : null, text(card.description) ? (_jsx(Text, { as: "p", sx: { fontSize: 0, color: 'fg.muted', mt: 1, mb: 0 }, children: text(card.description) })) : null] }), text(card.url) ? (_jsx(Row, { label: "Endpoint", children: _jsx(External, { href: text(card.url) }) })) : null, text(card.documentationUrl) ? (_jsx(Row, { label: "Documentation", children: _jsx(External, { href: text(card.documentationUrl) }) })) : null, text(card.iconUrl) ? (_jsx(Row, { label: "Icon", children: _jsx(External, { href: text(card.iconUrl) }) })) : null, provider ? (_jsx(Row, { label: "Provider", children: _jsx(ValueView, { value: provider, depth: 1 }) })) : null, card.supportedInterfaces !== undefined ? (_jsx(Row, { label: "Interfaces", children: interfaces.length === 0 ? (_jsx(None, {})) : (_jsx(Box, { display: "flex", flexDirection: "column", gap: 1, children: interfaces.map((entry, index) => (_jsxs(Box, { display: "flex", gap: 2, alignItems: "center", flexWrap: "wrap", children: [_jsx(Label, { size: "small", children: text(entry.protocolBinding) ?? 'binding' }), text(entry.url) ? _jsx(Mono, { children: text(entry.url) }) : null, text(entry.protocolVersion) ? (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["v", text(entry.protocolVersion)] })) : null] }, index))) })) })) : null, capabilities !== undefined ? (_jsx(Row, { label: "Capabilities", children: capabilityEntries.length === 0 ? (_jsx(None, {})) : (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 1, children: [_jsx(Box, { display: "flex", gap: 1, flexWrap: "wrap", children: capabilityEntries
|
|
220
203
|
.filter(([, flag]) => typeof flag === 'boolean')
|
|
221
|
-
.map(([key, flag]) => (_jsxs(Label, { size: "small", variant: flag ? 'success' : 'secondary', children: [key, ": ", flag ? 'yes' : 'no'] }, key))) }), extensions.map((extension, index) => (_jsxs(Box, { sx: {
|
|
222
|
-
display: 'flex',
|
|
223
|
-
gap: 2,
|
|
224
|
-
alignItems: 'baseline',
|
|
225
|
-
flexWrap: 'wrap',
|
|
226
|
-
}, children: [_jsx(Mono, { children: text(extension.uri) ?? 'extension' }), extension.required === true ? (_jsx(Label, { size: "small", variant: "attention", children: "required" })) : null, text(extension.description) ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: text(extension.description) })) : null] }, index))), capabilityEntries
|
|
204
|
+
.map(([key, flag]) => (_jsxs(Label, { size: "small", variant: flag ? 'success' : 'secondary', children: [key, ": ", flag ? 'yes' : 'no'] }, key))) }), extensions.map((extension, index) => (_jsxs(Box, { display: "flex", gap: 2, alignItems: "baseline", flexWrap: "wrap", children: [_jsx(Mono, { children: text(extension.uri) ?? 'extension' }), extension.required === true ? (_jsx(Label, { size: "small", variant: "attention", children: "required" })) : null, text(extension.description) ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: text(extension.description) })) : null] }, index))), capabilityEntries
|
|
227
205
|
.filter(([key, entry]) => typeof entry !== 'boolean' && key !== 'extensions')
|
|
228
|
-
.map(([key, entry]) => (_jsxs(Box, {
|
|
206
|
+
.map(([key, entry]) => (_jsxs(Box, { display: "flex", gap: 2, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: humanize(key) }), _jsx(ValueView, { value: entry, depth: 1 })] }, key)))] })) })) : null, card.skills !== undefined ? (_jsx(Row, { label: "Skills", children: skills.length === 0 ? (_jsx(None, {})) : (_jsx(Box, { display: "flex", flexDirection: "column", gap: 1, children: skills.map((skill, index) => (_jsxs(Box, { children: [_jsx(Text, { sx: { fontSize: 0, fontWeight: 'bold' }, children: text(skill.name) ?? text(skill.id) ?? 'skill' }), text(skill.description) ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', ml: 2 }, children: text(skill.description) })) : null, strings(skill.tags).length > 0 ? (_jsx(Box, { display: "inline-flex", gap: 1, ml: 2, children: strings(skill.tags).map(tag => (_jsx(Label, { size: "small", children: tag }, tag))) })) : null] }, index))) })) })) : null, card.defaultInputModes !== undefined ? (_jsx(Row, { label: "Input modes", children: inputs.length ? _jsx(Mono, { children: inputs.join(', ') }) : _jsx(None, {}) })) : null, card.defaultOutputModes !== undefined ? (_jsx(Row, { label: "Output modes", children: outputs.length ? _jsx(Mono, { children: outputs.join(', ') }) : _jsx(None, {}) })) : null, others.map(([key, value]) => (_jsx(Row, { label: humanize(key), children: _jsx(ValueView, { value: value }) }, key)))] }));
|
|
229
207
|
}
|
|
230
208
|
const LAUNCH_LABEL = {
|
|
231
209
|
local: 'launched on the local agent-runtimes server',
|
|
@@ -249,17 +227,6 @@ export function A2AAgentDialog({ details, onClose, }) {
|
|
|
249
227
|
? [{ content: 'Open agent card', onClick: openCard }]
|
|
250
228
|
: []),
|
|
251
229
|
{ content: 'Close', onClick: onClose, buttonType: 'primary' },
|
|
252
|
-
], children: _jsxs(Box, { "data-a2a-agent-dialog": details.name, "data-a2a-card-status": fetched.status,
|
|
253
|
-
mt: 2,
|
|
254
|
-
p: 2,
|
|
255
|
-
bg: 'canvas.subtle',
|
|
256
|
-
border: '1px solid',
|
|
257
|
-
borderColor: 'border.default',
|
|
258
|
-
borderRadius: 2,
|
|
259
|
-
overflow: 'auto',
|
|
260
|
-
maxHeight: 280,
|
|
261
|
-
fontSize: 0,
|
|
262
|
-
m: 0,
|
|
263
|
-
}, children: JSON.stringify(fetched.card, null, 2) })] })] })) : null] }), details.card && fetched.status !== 'loaded' ? (_jsxs(Section, { title: "Card, as the server saw it at launch", children: [_jsx(Row, { label: "Name", children: _jsxs(Text, { sx: { fontSize: 0 }, children: [details.card.name ?? '—', details.card.version ? ` v${details.card.version}` : ''] }) }), details.card.description ? (_jsx(Row, { label: "Description", children: _jsx(Text, { sx: { fontSize: 0 }, children: details.card.description }) })) : null, details.card.skills && details.card.skills.length > 0 ? (_jsx(Row, { label: "Skills", children: _jsx(Text, { sx: { fontSize: 0 }, children: details.card.skills.join(', ') }) })) : null] })) : null] }) }));
|
|
230
|
+
], children: _jsxs(Box, { "data-a2a-agent-dialog": details.name, "data-a2a-card-status": fetched.status, display: "flex", flexDirection: "column", gap: 3, children: [_jsxs(Section, { title: "This run", children: [details.description ? (_jsx(Text, { as: "p", sx: { fontSize: 0, color: 'fg.muted', m: 0 }, children: details.description })) : null, _jsx(Row, { label: "Launch", children: _jsxs(Text, { sx: { fontSize: 0 }, children: [details.launch ?? 'auto', _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [' ', "\u2014 ", LAUNCH_LABEL[details.launch ?? 'auto'] ?? ''] })] }) }), details.ref ? (_jsx(Row, { label: "Agentspec", children: _jsx(Mono, { children: details.ref }) })) : null, _jsx(Row, { label: "State", children: _jsx(Text, { sx: { fontSize: 0 }, children: details.state ?? 'unknown' }) }), details.taskId ? (_jsx(Row, { label: "Task", children: _jsx(Mono, { children: details.taskId }) })) : null, details.runtimeUid ? (_jsx(Row, { label: "Runtime", children: _jsx(Mono, { children: details.runtimeUid }) })) : null, details.url ? (_jsx(Row, { label: "Endpoint", children: _jsx(External, { href: details.url }) })) : null, cardUrl ? (_jsx(Row, { label: "Agent card", children: _jsx(External, { href: cardUrl }) })) : null] }), _jsxs(Section, { title: "Agent card", children: [fetched.status === 'idle' ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "No endpoint known yet: the card can be fetched once the agent is launched." })) : null, fetched.status === 'loading' ? (_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx(Spinner, { size: "small" }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["Fetching ", cardUrl, "\u2026"] })] })) : null, fetched.status === 'error' ? (_jsxs(Text, { sx: { fontSize: 0, color: 'danger.fg' }, children: ["The card could not be fetched from here (", fetched.error, "). It may still open in a tab through the link above."] })) : null, fetched.status === 'loaded' ? (_jsxs(_Fragment, { children: [_jsx(CardFields, { card: fetched.card }), _jsxs(Box, { as: "details", fontSize: 0, children: [_jsx(Box, { as: "summary", cursor: "pointer", color: "fg.muted", children: "Raw JSON" }), _jsx(Box, { as: "pre", "data-a2a-card-json": true, mt: 2, p: 2, bg: "canvas.subtle", border: "1px solid", borderColor: "border.default", borderRadius: 2, overflow: "auto", maxHeight: 280, fontSize: 0, m: 0, children: JSON.stringify(fetched.card, null, 2) })] })] })) : null] }), details.card && fetched.status !== 'loaded' ? (_jsxs(Section, { title: "Card, as the server saw it at launch", children: [_jsx(Row, { label: "Name", children: _jsxs(Text, { sx: { fontSize: 0 }, children: [details.card.name ?? '—', details.card.version ? ` v${details.card.version}` : ''] }) }), details.card.description ? (_jsx(Row, { label: "Description", children: _jsx(Text, { sx: { fontSize: 0 }, children: details.card.description }) })) : null, details.card.skills && details.card.skills.length > 0 ? (_jsx(Row, { label: "Skills", children: _jsx(Text, { sx: { fontSize: 0 }, children: details.card.skills.join(', ') }) })) : null] })) : null] }) }));
|
|
264
231
|
}
|
|
265
232
|
export default A2AAgentDialog;
|