@mcp-b/react-components 0.48.0 → 0.49.1
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/dist/AgentChatQueue-v5890eA1.d.ts +48 -0
- package/dist/AgentToolRunsContext-GMe_hSnD.d.ts +35 -0
- package/dist/Avatar-o2NO1fCG.d.ts +124 -0
- package/dist/{Button-CZt3yywF.d.ts → Button-DjONW5UW.d.ts} +1 -1
- package/dist/{CodeBlock-C380GD5t.d.ts → CodeBlock--r6GS8YV.d.ts} +8 -2
- package/dist/{CodeBlock-BSJl682D.js → CodeBlock-g8sADidM.js} +8 -8
- package/dist/{FileTree-DvE0hNZu.js → FileTree-DruTQ-oa.js} +38 -36
- package/dist/{IconButton-BAUFhUk8.d.ts → IconButton-ByiyjkYE.d.ts} +2 -2
- package/dist/{Menu-yb6QXWA3.d.ts → Menu-CgfUZhZd.d.ts} +1 -1
- package/dist/{Message-D_vCVEGB.d.ts → Message-DyaTBiV7.d.ts} +17 -4
- package/dist/MessageScrollerVirtual-D4afYwVB.d.ts +84 -0
- package/dist/{PromptInput-DtJHyp0S.d.ts → PromptInput-4kCz3T9P.d.ts} +45 -32
- package/dist/PromptInputApproval-D2hpn54U.d.ts +44 -0
- package/dist/Separator-CzhtLYE1.d.ts +41 -0
- package/dist/Toolbar-CGY004u0.d.ts +155 -0
- package/dist/{Workspace-LIoU30n7.d.ts → Workspace-HzGrWDX3.d.ts} +1 -1
- package/dist/{WorkspaceFile-Dq-GC0_T.d.ts → WorkspaceFile-Bouauobc.d.ts} +1 -1
- package/dist/{WorkspaceFileView-C_WnYm-a.js → WorkspaceFileView-DYPtRVpM.js} +5 -4
- package/dist/{WorkspaceLink-B1d2GIGl.js → WorkspaceLink-BYZG-V_I.js} +8 -91
- package/dist/{WorkspaceMessageResponse-BqOezptB.js → WorkspaceMessageResponse-CUJk9_P5.js} +2 -2
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.d.ts +198 -2
- package/dist/components/agents-sdk/AgentChat.js +527 -672
- package/dist/components/agents-sdk/AgentChatQueue.d.ts +2 -0
- package/dist/components/agents-sdk/AgentChatQueue.js +206 -0
- package/dist/components/agents-sdk/AgentEvent.js +2 -2
- package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +2 -2
- package/dist/components/agents-sdk/AgentToolRunsContext.js +1 -36
- package/dist/components/agents-sdk/BrowserLiveScreen.js +22 -14
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.d.ts +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.d.ts +3 -0
- package/dist/components/agents-sdk/BrowserRunPanel.js +32 -31
- package/dist/components/agents-sdk/EmployeeChrome.d.ts +212 -0
- package/dist/components/agents-sdk/EmployeeChrome.js +555 -0
- package/dist/components/agents-sdk/ManagerOffice.d.ts +79 -40
- package/dist/components/agents-sdk/ManagerOffice.js +291 -281
- package/dist/components/agents-sdk/McpConnectionRequest.d.ts +4 -4
- package/dist/components/agents-sdk/McpConnectionRequest.js +4 -3
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +38 -1
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +93 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +5 -4
- package/dist/components/agents-sdk/McpServerIcon.d.ts +17 -0
- package/dist/components/agents-sdk/McpServerIcon.js +25 -0
- package/dist/components/agents-sdk/McpServerPicker.d.ts +5 -4
- package/dist/components/agents-sdk/McpServerPicker.js +4 -3
- package/dist/components/agents-sdk/ModelSelector.d.ts +4 -4
- package/dist/components/agents-sdk/ModelSelector.js +4 -4
- package/dist/components/agents-sdk/PromptInputApproval.d.ts +1 -43
- package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +2 -3
- package/dist/components/agents-sdk/SessionCompaction.d.ts +88 -1
- package/dist/components/agents-sdk/SessionCompaction.js +2 -2
- package/dist/components/agents-sdk/SubagentRunDetails.d.ts +30 -1
- package/dist/components/agents-sdk/SubagentRunDetails.js +57 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +9 -9
- package/dist/components/agents-sdk/SubagentRunIndicator.js +19 -24
- package/dist/components/agents-sdk/SubagentRunList.d.ts +6 -3
- package/dist/components/agents-sdk/SubagentRunList.js +4 -2
- package/dist/components/agents-sdk/SubagentRunPanel.d.ts +60 -0
- package/dist/components/agents-sdk/SubagentRunPanel.js +255 -0
- package/dist/components/agents-sdk/SubagentRunSelector.d.ts +8 -4
- package/dist/components/agents-sdk/SubagentRunSelector.js +5 -3
- package/dist/components/agents-sdk/ThinkChat.d.ts +102 -2
- package/dist/components/agents-sdk/ThinkChat.js +233 -2
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +76 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +18 -10
- package/dist/components/agents-sdk/ThinkChatContext.d.ts +27 -1
- package/dist/components/agents-sdk/ThinkChatContext.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +24 -19
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
- package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +85 -28
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +159 -102
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +40 -158
- package/dist/components/agents-sdk/ThinkFullApp.js +71 -290
- package/dist/components/agents-sdk/ThinkRecoveryNotice.d.ts +18 -1
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +51 -0
- package/dist/components/agents-sdk/ThinkRoutineActions.js +201 -0
- package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +4 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +17 -15
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +11 -11
- package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +2 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +14 -14
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +7 -7
- package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +90 -1
- package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
- package/dist/components/agents-sdk/Workspace.d.ts +1 -1
- package/dist/components/agents-sdk/Workspace.js +7 -13
- package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceConcept.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +10 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +10 -7
- package/dist/components/agents-sdk/WorkspaceExecution.d.ts +5 -14
- package/dist/components/agents-sdk/WorkspaceExecution.js +24 -38
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +5 -2
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -2
- package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +60 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +47 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.d.ts +3 -2
- package/dist/components/agents-sdk/WorkspaceMountManager.js +6 -9
- package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +38 -0
- package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +86 -0
- package/dist/components/agents-sdk/WorkspaceProject.d.ts +5 -14
- package/dist/components/agents-sdk/WorkspaceProject.js +21 -35
- package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceUserScript.js +8 -5
- package/dist/components/ai-sdk/Activity.d.ts +1 -1
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentAttention.d.ts +2 -2
- package/dist/components/ai-sdk/AgentChatMessageEditor.js +5 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +89 -2
- package/dist/components/ai-sdk/AgentChatStartScreen.js +64 -43
- package/dist/components/ai-sdk/AgentMessageParts.d.ts +45 -1
- package/dist/components/ai-sdk/Approval.d.ts +1 -1
- package/dist/components/ai-sdk/Approval.js +2 -2
- package/dist/components/ai-sdk/Artifact.d.ts +2 -2
- package/dist/components/ai-sdk/Artifact.js +1 -1
- package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
- package/dist/components/ai-sdk/ChainOfThought.js +1 -1
- package/dist/components/ai-sdk/Checkpoint.js +1 -1
- package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.js +2 -3
- package/dist/components/ai-sdk/ConnectedAppCards.d.ts +9 -1
- package/dist/components/ai-sdk/ConnectedAppCards.js +28 -21
- package/dist/components/ai-sdk/Context.d.ts +7 -3
- package/dist/components/ai-sdk/Context.js +7 -17
- package/dist/components/ai-sdk/Conversation.d.ts +2 -2
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.d.ts +3 -3
- package/dist/components/ai-sdk/Goal.js +3 -3
- package/dist/components/ai-sdk/InlineCitation.d.ts +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
- package/dist/components/ai-sdk/Message.d.ts +2 -2
- package/dist/components/ai-sdk/Message.js +12 -3
- package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +2 -76
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +40 -5
- package/dist/components/ai-sdk/Plan.d.ts +1 -1
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
- package/dist/components/ai-sdk/PromptInput.js +175 -231
- package/dist/components/ai-sdk/PromptInputComposerEditor.js +32 -9
- package/dist/components/ai-sdk/Queue.d.ts +28 -5
- package/dist/components/ai-sdk/Queue.js +20 -5
- package/dist/components/ai-sdk/Reasoning.d.ts +1 -1
- package/dist/components/ai-sdk/Reasoning.js +5 -5
- package/dist/components/ai-sdk/Sources.d.ts +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.d.ts +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -1
- package/dist/components/extension/ChatGptSignInScreen.js +1 -1
- package/dist/components/extension/CodexModelSelector.d.ts +6 -1
- package/dist/components/extension/CodexModelSelector.js +3 -3
- package/dist/components/extension/ConversationTabPicker.d.ts +1 -0
- package/dist/components/extension/ConversationTabPicker.js +2 -2
- package/dist/components/foundations/AlertDialog.d.ts +1 -1
- package/dist/components/foundations/AppIcon.d.ts +3 -2
- package/dist/components/foundations/Autocomplete.js +6 -1
- package/dist/components/foundations/Avatar.d.ts +1 -121
- package/dist/components/foundations/Button.d.ts +1 -1
- package/dist/components/foundations/Card.d.ts +22 -27
- package/dist/components/foundations/Card.js +51 -32
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/CheckboxGroup.d.ts +1 -1
- package/dist/components/foundations/Collapsible.d.ts +1 -1
- package/dist/components/foundations/Collapsible.js +1 -1
- package/dist/components/foundations/Combobox.js +6 -1
- package/dist/components/foundations/ContextMenu.d.ts +10 -23
- package/dist/components/foundations/ContextMenu.js +3 -2
- package/dist/components/foundations/Dialog.d.ts +106 -1
- package/dist/components/foundations/EmptyState.d.ts +1 -1
- package/dist/components/foundations/Field.d.ts +2 -1
- package/dist/components/foundations/Fieldset.d.ts +1 -1
- package/dist/components/foundations/Form.d.ts +4 -4
- package/dist/components/foundations/IconButton.d.ts +1 -1
- package/dist/components/foundations/Label.d.ts +1 -1
- package/dist/components/foundations/LinkButton.d.ts +2 -2
- package/dist/components/foundations/Menu.d.ts +1 -1
- package/dist/components/foundations/Menubar.d.ts +1 -1
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/Meter.d.ts +1 -1
- package/dist/components/foundations/NumberField.d.ts +1 -1
- package/dist/components/foundations/PreviewCard.d.ts +1 -1
- package/dist/components/foundations/ScrollArea.d.ts +1 -1
- package/dist/components/foundations/SearchField.d.ts +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +7 -2
- package/dist/components/foundations/Separator.d.ts +1 -40
- package/dist/components/foundations/Stepper.d.ts +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Textarea.d.ts +1 -1
- package/dist/components/foundations/Toast.d.ts +5 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/Toggle.d.ts +70 -1
- package/dist/components/foundations/ToggleGroup.d.ts +4 -3
- package/dist/components/foundations/ToggleGroup.js +1 -1
- package/dist/components/foundations/Toolbar.d.ts +1 -151
- package/dist/components/foundations/Tooltip.d.ts +1 -1
- package/dist/components/foundations/TransitionSurface.d.ts +1 -1
- package/dist/components/foundations/icons.js +1 -1
- package/dist/components/general-purpose/ActionGuide.d.ts +10 -26
- package/dist/components/general-purpose/ActionGuide.js +4 -18
- package/dist/components/general-purpose/AppTopBar.d.ts +4 -2
- package/dist/components/general-purpose/Commit.d.ts +2 -2
- package/dist/components/general-purpose/Commit.js +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.d.ts +1 -7
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.d.ts +4 -0
- package/dist/components/general-purpose/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
- package/dist/components/general-purpose/ResizableSidePanel.d.ts +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +128 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +120 -102
- package/dist/components/general-purpose/SettingsFormDialog.d.ts +14 -27
- package/dist/components/general-purpose/SettingsFormDialog.js +42 -72
- package/dist/components/general-purpose/SetupChecklist.d.ts +1 -0
- package/dist/components/general-purpose/SetupChecklist.js +76 -1
- package/dist/components/general-purpose/Terminal.d.ts +3 -3
- package/dist/components/general-purpose/Terminal.js +11 -6
- package/dist/components/general-purpose/TestResults.d.ts +23 -11
- package/dist/components/general-purpose/TestResults.js +49 -51
- package/dist/components/general-purpose/ThemeModeControl.d.ts +2 -0
- package/dist/components/general-purpose/ThemeModeControl.js +2 -2
- package/dist/components/general-purpose/WebPreview.d.ts +29 -4
- package/dist/components/general-purpose/WebPreview.js +39 -14
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.d.ts +13 -11
- package/dist/components/nanites/AgentToolDetail.js +21 -42
- package/dist/{copy-button-Dk2vRe9j.js → copy-button-CSDuDfdP.js} +1 -1
- package/dist/{copy-button-C0JyjClr.d.ts → copy-button-OUwOdgEm.d.ts} +1 -1
- package/dist/mcp-server-mAErsxHU.js +27 -0
- package/dist/styles/accessibility.css +20 -0
- package/dist/styles/activity.css +1 -96
- package/dist/styles/agent-chat.css +75 -102
- package/dist/styles/agent-tool-detail.css +0 -16
- package/dist/styles/base.css +1 -9
- package/dist/styles/browser-run-panel.css +1 -15
- package/dist/styles/button.css +7 -1
- package/dist/styles/code-block.css +12 -0
- package/dist/styles/codex-model-selector.css +4 -0
- package/dist/styles/color-contrast.test.ts +212 -0
- package/dist/styles/composition-motion.css +0 -2
- package/dist/styles/employee-chrome.css +43 -0
- package/dist/styles/file-tree.css +10 -1
- package/dist/styles/index.css +4 -2
- package/dist/styles/manager-office.css +5 -5
- package/dist/styles/message.css +2 -10
- package/dist/styles/queue.css +71 -0
- package/dist/styles/responsive-sidebar-shell.css +1 -1
- package/dist/styles/subagent-run.css +122 -6
- package/dist/styles/test-results.css +2 -5
- package/dist/styles/think-chat-activity.css +13 -0
- package/dist/styles/think-chat-tool-panels.css +81 -0
- package/dist/styles/think-execution-workbench.css +2 -8
- package/dist/styles/think-full-app.css +42 -251
- package/dist/styles/{think-routine-library.css → think-routine.css} +64 -80
- package/dist/styles/web-preview.css +15 -1
- package/dist/utils/codex-model-catalog.d.ts +25 -6
- package/dist/utils/codex-model-catalog.js +22 -5
- package/dist/utils/mcp-server-catalog.d.ts +1112 -2
- package/dist/utils/mcp-server-catalog.js +28 -9
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/{workspace-assets-GqsCYxqT.js → workspace-assets-Bg7XhPsk.js} +2 -2
- package/package.json +8 -4
- package/dist/AgentChat-BLmQghkt.d.ts +0 -327
- package/dist/AgentChatStartScreen-Bkv7Avni.d.ts +0 -84
- package/dist/AgentMessageParts-C7L-Mv9U.d.ts +0 -46
- package/dist/AgentToolRunsContext-jtmveaRE.d.ts +0 -57
- package/dist/Dialog-B_FhRWaz.d.ts +0 -107
- package/dist/McpConnectorForm-CeYNY0MI.d.ts +0 -39
- package/dist/McpPluginCatalog-3qWu8oK1.d.ts +0 -92
- package/dist/ResponsiveSidebarShell-BTVPxLJK.d.ts +0 -123
- package/dist/SessionCompaction-CmTJFpzj.d.ts +0 -89
- package/dist/SetupChecklist-DeTU9YpW.js +0 -77
- package/dist/ThinkChat-CwMdEum8.d.ts +0 -185
- package/dist/ThinkChat-DiI6hhDP.js +0 -332
- package/dist/ThinkChatActivity-B3lGVS-6.d.ts +0 -77
- package/dist/ThinkChatContext-COIgzkYp.d.ts +0 -28
- package/dist/ThinkRecoveryNotice-DGWr94rk.d.ts +0 -19
- package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +0 -91
- package/dist/Toggle-DLrIf5YH.d.ts +0 -69
- package/dist/WorkspaceLive-DfjH1Ypm.d.ts +0 -61
- package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +0 -48
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +0 -31
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +0 -34
- package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +0 -80
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +0 -159
- package/dist/components/agents-sdk/ThinkSidepanel.d.ts +0 -200
- package/dist/components/agents-sdk/ThinkSidepanel.js +0 -775
- package/dist/mcp-server-7NR24ASj.js +0 -69
- package/dist/mcp-server-catalog-C_g7C-9o.d.ts +0 -1108
- package/dist/styles/think-sidepanel.css +0 -78
- package/dist/think-agent-Cip5KAPj.d.ts +0 -7
- package/dist/{icons-CeGfXO21.js → icons-cuEtsgj9.js} +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { n as AgentToolRunValue } from "../../AgentToolRunsContext-GMe_hSnD.js";
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
import { AgentToolRunPart
|
|
3
|
+
import { AgentToolRunPart } from "agents/agent-tools";
|
|
3
4
|
|
|
4
5
|
//#region src/components/agents-sdk/SubagentRunIndicator.d.ts
|
|
5
|
-
declare function getSubagentRunName(run:
|
|
6
|
+
declare function getSubagentRunName(run: AgentToolRunValue): string;
|
|
6
7
|
/**
|
|
7
8
|
* One line of status for a retained run, derived from upstream's whole
|
|
8
9
|
* record: the latest progress report or streamed text while it runs, the
|
|
@@ -11,10 +12,10 @@ declare function getSubagentRunName(run: AgentToolRunState): string;
|
|
|
11
12
|
* source is cut in one place here, because a host's progress message, error,
|
|
12
13
|
* and report are all unbounded prose.
|
|
13
14
|
*/
|
|
14
|
-
declare function getSubagentRunStatusText(run:
|
|
15
|
+
declare function getSubagentRunStatusText(run: AgentToolRunValue): string;
|
|
15
16
|
interface SubagentRunIndicatorProps<Part extends AgentToolRunPart = AgentToolRunPart> extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
16
17
|
/** Complete retained-run state returned by `useAgentToolEvents()`. */
|
|
17
|
-
run:
|
|
18
|
+
run: AgentToolRunValue<Part>;
|
|
18
19
|
}
|
|
19
20
|
/** Decorative status mark derived from a whole upstream retained-run record. */
|
|
20
21
|
declare function SubagentRunIndicator<Part extends AgentToolRunPart = AgentToolRunPart>({
|
|
@@ -26,15 +27,14 @@ declare function SubagentRunIndicator<Part extends AgentToolRunPart = AgentToolR
|
|
|
26
27
|
ref?: React.Ref<HTMLSpanElement>;
|
|
27
28
|
}): React.JSX.Element;
|
|
28
29
|
/**
|
|
29
|
-
* How a run labels itself anywhere it appears:
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* same. The caller owns the surrounding row (a link, a bar title).
|
|
30
|
+
* How a run labels itself anywhere it appears: one status mark followed by its
|
|
31
|
+
* name and live status line. The selector and drill-in bar share this so what a
|
|
32
|
+
* person clicks and what they land on read the same.
|
|
33
33
|
*/
|
|
34
34
|
declare function SubagentRunLabel<Part extends AgentToolRunPart = AgentToolRunPart>({
|
|
35
35
|
run
|
|
36
36
|
}: {
|
|
37
|
-
/** Complete retained-run state returned by `useAgentToolEvents()`. */run:
|
|
37
|
+
/** Complete retained-run state returned by `useAgentToolEvents()`. */run: AgentToolRunValue<Part>;
|
|
38
38
|
}): React.JSX.Element;
|
|
39
39
|
//#endregion
|
|
40
40
|
export { SubagentRunIndicator, SubagentRunIndicatorProps, SubagentRunLabel, getSubagentRunName, getSubagentRunStatusText };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { J as StopIcon, K as SpinnerIcon, d as CheckIcon, et as WarningIcon } from "../../icons-
|
|
2
|
+
import { J as StopIcon, K as SpinnerIcon, d as CheckIcon, et as WarningIcon } from "../../icons-cuEtsgj9.js";
|
|
3
3
|
import { r as firstLine, s as textLines } from "../../format-COCyV98Z.js";
|
|
4
|
-
import { NaniteMark } from "../nanites/NaniteScene.js";
|
|
5
4
|
import "react";
|
|
6
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/agents-sdk/SubagentRunIndicator.tsx
|
|
@@ -25,11 +24,12 @@ function lastStreamedLine(run) {
|
|
|
25
24
|
/** Where a run's status line comes from, before it is cut to one line. */
|
|
26
25
|
function statusSource(run) {
|
|
27
26
|
switch (run.status) {
|
|
27
|
+
case "starting": return "Starting";
|
|
28
28
|
case "running": return run.progress?.message ?? run.progress?.phase ?? lastStreamedLine(run) ?? "Running";
|
|
29
29
|
case "completed": return run.summary ?? "Completed";
|
|
30
30
|
case "error": return run.error ?? "Agent run failed";
|
|
31
|
-
case "aborted": return run.error ?? "Agent run stopped";
|
|
32
|
-
case "interrupted": return run.
|
|
31
|
+
case "aborted": return run.childStillRunning !== false ? `Stop requested; child may still be running${run.error ? `. ${run.error}` : ""}` : run.error ?? "Agent run stopped";
|
|
32
|
+
case "interrupted": return `${run.childStillRunning !== false ? "Interrupted; child may still be running" : "Interrupted"}${run.error ? `. ${run.error}` : ""}`;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -45,7 +45,7 @@ function getSubagentRunStatusText(run) {
|
|
|
45
45
|
}
|
|
46
46
|
/** Decorative status mark derived from a whole upstream retained-run record. */
|
|
47
47
|
function SubagentRunIndicator({ className, run, ref, ...props }) {
|
|
48
|
-
const icon = run.status === "running" ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : run.status === "completed" ? /* @__PURE__ */ jsx(CheckIcon, {}) : run.status === "aborted" ? /* @__PURE__ */ jsx(StopIcon, {}) : /* @__PURE__ */ jsx(WarningIcon, {});
|
|
48
|
+
const icon = run.status === "running" || run.status === "starting" ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : run.status === "completed" ? /* @__PURE__ */ jsx(CheckIcon, {}) : run.status === "aborted" && run.childStillRunning === false ? /* @__PURE__ */ jsx(StopIcon, {}) : /* @__PURE__ */ jsx(WarningIcon, {});
|
|
49
49
|
return /* @__PURE__ */ jsx("span", {
|
|
50
50
|
ref,
|
|
51
51
|
"data-slot": "subagent-run-indicator",
|
|
@@ -57,27 +57,22 @@ function SubagentRunIndicator({ className, run, ref, ...props }) {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
* How a run labels itself anywhere it appears:
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* same. The caller owns the surrounding row (a link, a bar title).
|
|
60
|
+
* How a run labels itself anywhere it appears: one status mark followed by its
|
|
61
|
+
* name and live status line. The selector and drill-in bar share this so what a
|
|
62
|
+
* person clicks and what they land on read the same.
|
|
64
63
|
*/
|
|
65
64
|
function SubagentRunLabel({ run }) {
|
|
66
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
children:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})]
|
|
78
|
-
}),
|
|
79
|
-
/* @__PURE__ */ jsx(SubagentRunIndicator, { run })
|
|
80
|
-
] });
|
|
65
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SubagentRunIndicator, { run }), /* @__PURE__ */ jsxs("span", {
|
|
66
|
+
className: "subagent-run__text",
|
|
67
|
+
"data-status": run.status,
|
|
68
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: "subagent-run__title sigvelo-truncate",
|
|
70
|
+
children: getSubagentRunName(run)
|
|
71
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "subagent-run__status sigvelo-truncate",
|
|
73
|
+
children: getSubagentRunStatusText(run)
|
|
74
|
+
})]
|
|
75
|
+
})] });
|
|
81
76
|
}
|
|
82
77
|
//#endregion
|
|
83
78
|
export { SubagentRunIndicator, SubagentRunLabel, getSubagentRunName, getSubagentRunStatusText };
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
+
import { n as AgentToolRunValue } from "../../AgentToolRunsContext-GMe_hSnD.js";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { UIMessage } from "ai";
|
|
3
|
-
import { AgentToolRunPart
|
|
4
|
+
import { AgentToolRunPart } from "agents/agent-tools";
|
|
4
5
|
|
|
5
6
|
//#region src/components/agents-sdk/SubagentRunList.d.ts
|
|
6
7
|
interface SubagentRunListProps<Part extends AgentToolRunPart = UIMessage["parts"][number]> extends Omit<React.HTMLAttributes<HTMLUListElement>, "children" | "onSelect"> {
|
|
7
8
|
/** Complete retained runs returned by `useAgentToolEvents()`, in display order. */
|
|
8
|
-
runs: readonly
|
|
9
|
+
runs: readonly AgentToolRunValue<Part>[];
|
|
9
10
|
/** App-authored TanStack Router Link for every retained run destination. */
|
|
10
|
-
renderRunLink: (run:
|
|
11
|
+
renderRunLink: (run: AgentToolRunValue<Part>) => React.ReactElement;
|
|
12
|
+
selectedRunId?: string;
|
|
11
13
|
}
|
|
12
14
|
/** Semantic, wrapping list of retained-run selectors. */
|
|
13
15
|
declare function SubagentRunList<Part extends AgentToolRunPart = UIMessage["parts"][number]>({
|
|
14
16
|
className,
|
|
15
17
|
renderRunLink,
|
|
18
|
+
selectedRunId,
|
|
16
19
|
runs,
|
|
17
20
|
ref,
|
|
18
21
|
...props
|
|
@@ -4,7 +4,7 @@ import "react";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/agents-sdk/SubagentRunList.tsx
|
|
6
6
|
/** Semantic, wrapping list of retained-run selectors. */
|
|
7
|
-
function SubagentRunList({ className, renderRunLink, runs, ref, ...props }) {
|
|
7
|
+
function SubagentRunList({ className, renderRunLink, selectedRunId, runs, ref, ...props }) {
|
|
8
8
|
return /* @__PURE__ */ jsx("ul", {
|
|
9
9
|
ref,
|
|
10
10
|
"data-slot": "subagent-run-list",
|
|
@@ -13,9 +13,11 @@ function SubagentRunList({ className, renderRunLink, runs, ref, ...props }) {
|
|
|
13
13
|
role: "list",
|
|
14
14
|
children: runs.map((run) => /* @__PURE__ */ jsx("li", {
|
|
15
15
|
className: "subagent-run__list-item",
|
|
16
|
+
"data-run-id": run.runId,
|
|
16
17
|
children: /* @__PURE__ */ jsx(SubagentRunSelector, {
|
|
17
18
|
run,
|
|
18
|
-
render: renderRunLink(run)
|
|
19
|
+
render: renderRunLink(run),
|
|
20
|
+
"aria-current": run.runId === selectedRunId ? "page" : void 0
|
|
19
21
|
})
|
|
20
22
|
}, run.runId))
|
|
21
23
|
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { n as AgentToolRunValue, t as AgentToolEventsValue } from "../../AgentToolRunsContext-GMe_hSnD.js";
|
|
2
|
+
import { ExpansionStore } from "../ai-sdk/ExpansionState.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { AgentToolRunPart } from "agents/agent-tools";
|
|
5
|
+
|
|
6
|
+
//#region src/components/agents-sdk/SubagentRunPanel.d.ts
|
|
7
|
+
interface CommandState {
|
|
8
|
+
pending: boolean;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Controlled collection facts supplied by the connection owner. */
|
|
12
|
+
interface SubagentRunCollectionState {
|
|
13
|
+
status: "loading" | "ready" | "error";
|
|
14
|
+
stale: boolean;
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
interface SubagentRunPanelProviderProps {
|
|
18
|
+
/** The one upstream event-hook value from the parent connection. */
|
|
19
|
+
agentTools: AgentToolEventsValue<AgentToolRunPart>;
|
|
20
|
+
collection: SubagentRunCollectionState;
|
|
21
|
+
/** The host's native execution predicate; presentation does not own cancellation policy. */
|
|
22
|
+
mayExecute: (run: AgentToolRunValue) => boolean;
|
|
23
|
+
selectedRunId?: string;
|
|
24
|
+
parentRunning: boolean;
|
|
25
|
+
onStopCurrentWork: () => Promise<void>;
|
|
26
|
+
onStopRun: (runId: string) => Promise<void>;
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
interface SubagentRunPanelValue extends Pick<SubagentRunPanelProviderProps, "agentTools" | "collection" | "mayExecute" | "selectedRunId" | "parentRunning"> {
|
|
30
|
+
open: boolean;
|
|
31
|
+
setOpen: (open: boolean) => void;
|
|
32
|
+
hiddenCompleted: ReadonlySet<string>;
|
|
33
|
+
setHiddenCompleted: (ids: ReadonlySet<string>) => void;
|
|
34
|
+
reportDisclosures: ExpansionStore;
|
|
35
|
+
restoreFocusRunId: React.RefObject<string | undefined>;
|
|
36
|
+
commands: Readonly<Record<string, CommandState>>;
|
|
37
|
+
stopCurrentWork: () => Promise<void>;
|
|
38
|
+
stopRun: (runId: string) => Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
/** A thread's transient controls/disclosure state; run facts remain in the SDK value. */
|
|
41
|
+
declare function SubagentRunPanelProvider({
|
|
42
|
+
agentTools,
|
|
43
|
+
collection,
|
|
44
|
+
mayExecute,
|
|
45
|
+
selectedRunId,
|
|
46
|
+
parentRunning,
|
|
47
|
+
onStopCurrentWork,
|
|
48
|
+
onStopRun,
|
|
49
|
+
children
|
|
50
|
+
}: SubagentRunPanelProviderProps): React.JSX.Element;
|
|
51
|
+
declare function useOptionalSubagentRunPanel(): SubagentRunPanelValue | null;
|
|
52
|
+
interface SubagentRunPanelProps {
|
|
53
|
+
renderRunLink: (run: AgentToolRunValue) => React.ReactElement;
|
|
54
|
+
}
|
|
55
|
+
/** Parent-scoped run queue composed beside queued prompts above the parent composer. */
|
|
56
|
+
declare function SubagentRunPanel({
|
|
57
|
+
renderRunLink
|
|
58
|
+
}: SubagentRunPanelProps): React.JSX.Element | null;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { SubagentRunCollectionState, SubagentRunPanel, SubagentRunPanelProps, SubagentRunPanelProvider, SubagentRunPanelProviderProps, useOptionalSubagentRunPanel };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { createExpansionStore } from "../ai-sdk/ExpansionState.js";
|
|
2
|
+
import { Button } from "../foundations/Button.js";
|
|
3
|
+
import { getSubagentRunName } from "./SubagentRunIndicator.js";
|
|
4
|
+
import { useOptionalAgentChatQueue } from "./AgentChatQueue.js";
|
|
5
|
+
import { Queue, QueueItem, QueueItemAction, QueueItemActions, QueueItemContent, QueueItemDescription, QueueList, QueueSection, QueueSectionActions, QueueSectionContent, QueueSectionLabel, QueueSectionTrigger } from "../ai-sdk/Queue.js";
|
|
6
|
+
import { AgentChatNotice, AgentChatPromptTray } from "./AgentChat.js";
|
|
7
|
+
import { SubagentRunSelector } from "./SubagentRunSelector.js";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/agents-sdk/SubagentRunPanel.tsx
|
|
11
|
+
const IDLE = { pending: false };
|
|
12
|
+
const SubagentRunPanelContext = React.createContext(null);
|
|
13
|
+
/** A thread's transient controls/disclosure state; run facts remain in the SDK value. */
|
|
14
|
+
function SubagentRunPanelProvider({ agentTools, collection, mayExecute, selectedRunId, parentRunning, onStopCurrentWork, onStopRun, children }) {
|
|
15
|
+
const [open, setOpen] = React.useState(true);
|
|
16
|
+
const [reportDisclosures] = React.useState(createExpansionStore);
|
|
17
|
+
const [hiddenCompleted, setHiddenCompleted] = React.useState(/* @__PURE__ */ new Set());
|
|
18
|
+
const [commands, setCommands] = React.useState({});
|
|
19
|
+
const inFlight = React.useRef(/* @__PURE__ */ new Map());
|
|
20
|
+
const restoreFocusRunId = React.useRef(selectedRunId);
|
|
21
|
+
React.useLayoutEffect(() => {
|
|
22
|
+
if (selectedRunId) restoreFocusRunId.current = selectedRunId;
|
|
23
|
+
}, [selectedRunId]);
|
|
24
|
+
const execute = React.useCallback((key, command) => {
|
|
25
|
+
const pending = inFlight.current.get(key);
|
|
26
|
+
if (pending) return pending;
|
|
27
|
+
setCommands((current) => ({
|
|
28
|
+
...current,
|
|
29
|
+
[key]: { pending: true }
|
|
30
|
+
}));
|
|
31
|
+
const operation = Promise.resolve().then(command).then(() => setCommands((current) => ({
|
|
32
|
+
...current,
|
|
33
|
+
[key]: IDLE
|
|
34
|
+
})), (cause) => {
|
|
35
|
+
const error = cause instanceof Error ? cause.message : "Stop could not be confirmed. Try again.";
|
|
36
|
+
setCommands((current) => ({
|
|
37
|
+
...current,
|
|
38
|
+
[key]: {
|
|
39
|
+
pending: false,
|
|
40
|
+
error
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
throw cause;
|
|
44
|
+
}).finally(() => inFlight.current.delete(key));
|
|
45
|
+
inFlight.current.set(key, operation);
|
|
46
|
+
return operation;
|
|
47
|
+
}, []);
|
|
48
|
+
const stopCurrentWork = React.useCallback(() => execute("current-work", onStopCurrentWork), [execute, onStopCurrentWork]);
|
|
49
|
+
const stopRun = React.useCallback((id) => execute(id, () => onStopRun(id)), [execute, onStopRun]);
|
|
50
|
+
const value = React.useMemo(() => ({
|
|
51
|
+
agentTools,
|
|
52
|
+
collection,
|
|
53
|
+
mayExecute,
|
|
54
|
+
selectedRunId,
|
|
55
|
+
parentRunning,
|
|
56
|
+
open,
|
|
57
|
+
setOpen,
|
|
58
|
+
hiddenCompleted,
|
|
59
|
+
setHiddenCompleted,
|
|
60
|
+
reportDisclosures,
|
|
61
|
+
restoreFocusRunId,
|
|
62
|
+
commands,
|
|
63
|
+
stopCurrentWork,
|
|
64
|
+
stopRun
|
|
65
|
+
}), [
|
|
66
|
+
agentTools,
|
|
67
|
+
collection,
|
|
68
|
+
mayExecute,
|
|
69
|
+
selectedRunId,
|
|
70
|
+
parentRunning,
|
|
71
|
+
open,
|
|
72
|
+
hiddenCompleted,
|
|
73
|
+
reportDisclosures,
|
|
74
|
+
commands,
|
|
75
|
+
stopCurrentWork,
|
|
76
|
+
stopRun
|
|
77
|
+
]);
|
|
78
|
+
return /* @__PURE__ */ jsx(SubagentRunPanelContext.Provider, {
|
|
79
|
+
value,
|
|
80
|
+
children
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function useOptionalSubagentRunPanel() {
|
|
84
|
+
return React.useContext(SubagentRunPanelContext);
|
|
85
|
+
}
|
|
86
|
+
function getSubagentRunRows(panel) {
|
|
87
|
+
const runs = Object.values(panel.agentTools.runsById).sort((a, b) => Number(!panel.mayExecute(a)) - Number(!panel.mayExecute(b)) || a.order - b.order);
|
|
88
|
+
return {
|
|
89
|
+
runs,
|
|
90
|
+
active: runs.filter(panel.mayExecute),
|
|
91
|
+
completed: runs.filter((run) => !panel.mayExecute(run)),
|
|
92
|
+
visible: runs.filter((run) => !panel.hiddenCompleted.has(run.runId) || panel.mayExecute(run))
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function useSubagentRunFocus(panel, visible) {
|
|
96
|
+
const rootRef = React.useRef(null);
|
|
97
|
+
const focusedControl = React.useRef(null);
|
|
98
|
+
const [focusedOrder, setFocusedOrder] = React.useState(null);
|
|
99
|
+
const ranks = focusedOrder ? new Map(focusedOrder.map((id, index) => [id, index])) : null;
|
|
100
|
+
const ordered = ranks ? visible.toSorted((a, b) => (ranks.get(a.runId) ?? Infinity) - (ranks.get(b.runId) ?? Infinity)) : visible;
|
|
101
|
+
React.useLayoutEffect(() => {
|
|
102
|
+
const previous = focusedControl.current;
|
|
103
|
+
if (!previous || previous.element.isConnected || document.activeElement !== document.body) return;
|
|
104
|
+
(Array.from(rootRef.current?.querySelectorAll("[data-run-id]") ?? []).find((element) => element.dataset.runId === previous.runId)?.querySelector("a") ?? rootRef.current?.querySelector("[data-slot=\"subagent-run-panel-trigger\"]"))?.focus({ preventScroll: true });
|
|
105
|
+
});
|
|
106
|
+
React.useEffect(() => {
|
|
107
|
+
const focusId = panel.restoreFocusRunId.current;
|
|
108
|
+
const root = rootRef.current;
|
|
109
|
+
if (panel.selectedRunId || !root) return;
|
|
110
|
+
if (!focusId) return;
|
|
111
|
+
(Array.from(root.querySelectorAll("[data-run-id]")).find((element) => element.dataset.runId === focusId)?.querySelector("a") ?? root.querySelector("[data-slot=\"subagent-run-panel-trigger\"]"))?.focus({ preventScroll: true });
|
|
112
|
+
panel.restoreFocusRunId.current = void 0;
|
|
113
|
+
}, [panel.restoreFocusRunId, panel.selectedRunId]);
|
|
114
|
+
const onFocusCapture = (event) => {
|
|
115
|
+
focusedControl.current = {
|
|
116
|
+
element: event.target,
|
|
117
|
+
runId: event.target.closest("[data-run-id]")?.dataset.runId
|
|
118
|
+
};
|
|
119
|
+
if (!focusedOrder && event.target.closest("[data-run-id]")) setFocusedOrder(ordered.map((run) => run.runId));
|
|
120
|
+
};
|
|
121
|
+
const onBlurCapture = (event) => {
|
|
122
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
123
|
+
focusedControl.current = null;
|
|
124
|
+
setFocusedOrder(null);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
return {
|
|
128
|
+
rootRef,
|
|
129
|
+
ordered,
|
|
130
|
+
onFocusCapture,
|
|
131
|
+
onBlurCapture
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function delegatedWorkLabel(active, completed) {
|
|
135
|
+
const counts = [active ? `${active} active` : null, completed ? `${completed} finished` : null].filter(Boolean).join(", ");
|
|
136
|
+
return `Delegated work${counts ? `, ${counts}` : ""}`;
|
|
137
|
+
}
|
|
138
|
+
function SubagentRunPanelControls({ panel, active, completed }) {
|
|
139
|
+
const queue = useOptionalAgentChatQueue();
|
|
140
|
+
const stop = panel.commands["current-work"] ?? IDLE;
|
|
141
|
+
const canStop = panel.parentRunning || active > 1 || panel.collection.status !== "ready";
|
|
142
|
+
if (!canStop && !stop.error && !stop.pending && !completed.length) return null;
|
|
143
|
+
return /* @__PURE__ */ jsxs(QueueSectionActions, {
|
|
144
|
+
"aria-label": "Delegated work controls",
|
|
145
|
+
children: [canStop || stop.error || stop.pending ? /* @__PURE__ */ jsx(Button, {
|
|
146
|
+
size: "xs",
|
|
147
|
+
variant: "ghost",
|
|
148
|
+
color: "neutral",
|
|
149
|
+
disabled: stop.pending,
|
|
150
|
+
focusableWhenDisabled: true,
|
|
151
|
+
"aria-busy": stop.pending,
|
|
152
|
+
onClick: () => {
|
|
153
|
+
queue?.hold();
|
|
154
|
+
panel.stopCurrentWork().catch(() => void 0);
|
|
155
|
+
},
|
|
156
|
+
children: stop.pending ? "Stopping current work…" : "Stop current work"
|
|
157
|
+
}) : null, completed.length ? /* @__PURE__ */ jsx(Button, {
|
|
158
|
+
size: "xs",
|
|
159
|
+
variant: "ghost",
|
|
160
|
+
color: "neutral",
|
|
161
|
+
onClick: () => panel.setHiddenCompleted(panel.hiddenCompleted.size ? /* @__PURE__ */ new Set() : new Set(completed.map((run) => run.runId))),
|
|
162
|
+
children: panel.hiddenCompleted.size ? `Show completed (${completed.length})` : "Hide completed"
|
|
163
|
+
}) : null]
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function SubagentRunRow({ panel, run, renderRunLink }) {
|
|
167
|
+
const command = panel.commands[run.runId] ?? IDLE;
|
|
168
|
+
const actionable = panel.mayExecute(run) || command.error || command.pending;
|
|
169
|
+
return /* @__PURE__ */ jsxs(QueueItem, {
|
|
170
|
+
"data-run-id": run.runId,
|
|
171
|
+
children: [/* @__PURE__ */ jsxs(QueueItemContent, { children: [/* @__PURE__ */ jsx(SubagentRunSelector, {
|
|
172
|
+
run,
|
|
173
|
+
render: renderRunLink(run),
|
|
174
|
+
surface: "plain",
|
|
175
|
+
"aria-current": run.runId === panel.selectedRunId ? "page" : void 0
|
|
176
|
+
}), command.error ? /* @__PURE__ */ jsx(QueueItemDescription, {
|
|
177
|
+
role: "alert",
|
|
178
|
+
children: command.error
|
|
179
|
+
}) : null] }), actionable ? /* @__PURE__ */ jsx(QueueItemActions, {
|
|
180
|
+
persistent: true,
|
|
181
|
+
children: /* @__PURE__ */ jsx(QueueItemAction, {
|
|
182
|
+
disabled: command.pending,
|
|
183
|
+
focusableWhenDisabled: true,
|
|
184
|
+
"aria-busy": command.pending,
|
|
185
|
+
"aria-label": `Stop ${getSubagentRunName(run)}`,
|
|
186
|
+
onClick: () => {
|
|
187
|
+
panel.stopRun(run.runId).catch(() => void 0);
|
|
188
|
+
},
|
|
189
|
+
children: command.pending ? "Stopping…" : "Stop"
|
|
190
|
+
})
|
|
191
|
+
}) : null]
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function SubagentRunPanelContent({ panel, renderRunLink }) {
|
|
195
|
+
const { runs, active, completed, visible } = getSubagentRunRows(panel);
|
|
196
|
+
const focus = useSubagentRunFocus(panel, visible);
|
|
197
|
+
const stop = panel.commands["current-work"] ?? IDLE;
|
|
198
|
+
if (panel.collection.status === "ready" && !runs.length && !panel.parentRunning) return null;
|
|
199
|
+
return /* @__PURE__ */ jsx(AgentChatPromptTray, {
|
|
200
|
+
"data-subagent-run-panel": "",
|
|
201
|
+
children: /* @__PURE__ */ jsx(Queue, {
|
|
202
|
+
density: "compact",
|
|
203
|
+
children: /* @__PURE__ */ jsxs(QueueSection, {
|
|
204
|
+
ref: focus.rootRef,
|
|
205
|
+
open: panel.open,
|
|
206
|
+
onOpenChange: panel.setOpen,
|
|
207
|
+
onFocusCapture: focus.onFocusCapture,
|
|
208
|
+
onBlurCapture: focus.onBlurCapture,
|
|
209
|
+
children: [/* @__PURE__ */ jsx(QueueSectionTrigger, {
|
|
210
|
+
"data-slot": "subagent-run-panel-trigger",
|
|
211
|
+
"aria-label": delegatedWorkLabel(active.length, completed.length),
|
|
212
|
+
children: /* @__PURE__ */ jsx(QueueSectionLabel, {
|
|
213
|
+
count: runs.length || void 0,
|
|
214
|
+
children: "Delegated work"
|
|
215
|
+
})
|
|
216
|
+
}), /* @__PURE__ */ jsxs(QueueSectionContent, { children: [
|
|
217
|
+
stop.error ? /* @__PURE__ */ jsx(AgentChatNotice, {
|
|
218
|
+
"data-tone": "danger",
|
|
219
|
+
role: "alert",
|
|
220
|
+
children: stop.error
|
|
221
|
+
}) : null,
|
|
222
|
+
panel.collection.status === "loading" ? /* @__PURE__ */ jsx(AgentChatNotice, { children: panel.collection.stale ? "Reconnecting. Last known runs are shown." : "Loading delegated work…" }) : null,
|
|
223
|
+
panel.collection.status === "error" ? /* @__PURE__ */ jsx(AgentChatNotice, {
|
|
224
|
+
"data-tone": "danger",
|
|
225
|
+
role: "alert",
|
|
226
|
+
children: panel.collection.error ?? "Could not refresh delegated work. Last known runs are retained."
|
|
227
|
+
}) : null,
|
|
228
|
+
/* @__PURE__ */ jsx(QueueList, {
|
|
229
|
+
"aria-label": "Delegated work runs",
|
|
230
|
+
children: focus.ordered.map((run) => /* @__PURE__ */ jsx(SubagentRunRow, {
|
|
231
|
+
panel,
|
|
232
|
+
run,
|
|
233
|
+
renderRunLink
|
|
234
|
+
}, run.runId))
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ jsx(SubagentRunPanelControls, {
|
|
237
|
+
panel,
|
|
238
|
+
active: active.length,
|
|
239
|
+
completed
|
|
240
|
+
})
|
|
241
|
+
] })]
|
|
242
|
+
})
|
|
243
|
+
})
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
/** Parent-scoped run queue composed beside queued prompts above the parent composer. */
|
|
247
|
+
function SubagentRunPanel({ renderRunLink }) {
|
|
248
|
+
const panel = useOptionalSubagentRunPanel();
|
|
249
|
+
return panel ? /* @__PURE__ */ jsx(SubagentRunPanelContent, {
|
|
250
|
+
panel,
|
|
251
|
+
renderRunLink
|
|
252
|
+
}) : null;
|
|
253
|
+
}
|
|
254
|
+
//#endregion
|
|
255
|
+
export { SubagentRunPanel, SubagentRunPanelProvider, useOptionalSubagentRunPanel };
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
+
import { n as AgentToolRunValue } from "../../AgentToolRunsContext-GMe_hSnD.js";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { UIMessage } from "ai";
|
|
3
|
-
import { AgentToolRunPart
|
|
4
|
+
import { AgentToolRunPart } from "agents/agent-tools";
|
|
4
5
|
|
|
5
6
|
//#region src/components/agents-sdk/SubagentRunSelector.d.ts
|
|
6
7
|
interface SubagentRunSelectorProps<Part extends AgentToolRunPart = UIMessage["parts"][number]> extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "children"> {
|
|
7
8
|
/** Complete retained-run state returned by `useAgentToolEvents()`. */
|
|
8
|
-
run:
|
|
9
|
+
run: AgentToolRunValue<Part>;
|
|
9
10
|
/** App-authored TanStack Router Link for this retained run. */
|
|
10
11
|
render: React.ReactElement;
|
|
11
12
|
/** Short supplementary status shown on hover and keyboard focus. `false` disables it. */
|
|
12
13
|
tooltip?: React.ReactNode | false;
|
|
14
|
+
/** Plain navigation rows sit on the containing panel's existing surface. */
|
|
15
|
+
surface?: "raised" | "plain";
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* Compact selector for a retained Cloudflare Agent Tool run.
|
|
16
19
|
*
|
|
17
|
-
* The component consumes `
|
|
20
|
+
* The component consumes `AgentToolRunValue` whole and derives its label and
|
|
18
21
|
* status from upstream fields. The application-authored Link routes
|
|
19
22
|
* `run.subAgent` to a run surface that replaces the conversation — the
|
|
20
23
|
* workspace drill-in pattern — with the top bar's back link as the way out;
|
|
@@ -26,11 +29,12 @@ declare function SubagentRunSelector<Part extends AgentToolRunPart = UIMessage["
|
|
|
26
29
|
render,
|
|
27
30
|
run,
|
|
28
31
|
tooltip,
|
|
32
|
+
surface,
|
|
29
33
|
ref,
|
|
30
34
|
"aria-label": ariaLabel,
|
|
31
35
|
...props
|
|
32
36
|
}: SubagentRunSelectorProps<Part> & {
|
|
33
|
-
ref?: React.Ref<HTMLAnchorElement>;
|
|
37
|
+
/** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLAnchorElement>;
|
|
34
38
|
}): React.JSX.Element;
|
|
35
39
|
//#endregion
|
|
36
40
|
export { SubagentRunSelector, SubagentRunSelectorProps };
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { buttonVariants } from "../foundations/Button.js";
|
|
3
3
|
import { Tooltip } from "../foundations/Tooltip.js";
|
|
4
|
-
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
5
4
|
import { SubagentRunLabel, getSubagentRunName, getSubagentRunStatusText } from "./SubagentRunIndicator.js";
|
|
5
|
+
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/agents-sdk/SubagentRunSelector.tsx
|
|
9
9
|
/**
|
|
10
10
|
* Compact selector for a retained Cloudflare Agent Tool run.
|
|
11
11
|
*
|
|
12
|
-
* The component consumes `
|
|
12
|
+
* The component consumes `AgentToolRunValue` whole and derives its label and
|
|
13
13
|
* status from upstream fields. The application-authored Link routes
|
|
14
14
|
* `run.subAgent` to a run surface that replaces the conversation — the
|
|
15
15
|
* workspace drill-in pattern — with the top bar's back link as the way out;
|
|
16
16
|
* this component never invents a second transcript or expands child content
|
|
17
17
|
* inline.
|
|
18
18
|
*/
|
|
19
|
-
function SubagentRunSelector({ className, render, run, tooltip, ref, "aria-label": ariaLabel, ...props }) {
|
|
19
|
+
function SubagentRunSelector({ className, render, run, tooltip, surface = "raised", ref, "aria-label": ariaLabel, ...props }) {
|
|
20
20
|
const name = getSubagentRunName(run);
|
|
21
21
|
const link = /* @__PURE__ */ jsx(NavigationLink, {
|
|
22
22
|
ref,
|
|
23
23
|
render,
|
|
24
24
|
"data-slot": "subagent-run-selector",
|
|
25
25
|
"data-status": run.status,
|
|
26
|
+
"data-surface": surface,
|
|
26
27
|
className: cx(buttonVariants({
|
|
27
28
|
variant: "ghost",
|
|
28
29
|
color: "neutral",
|
|
29
30
|
size: "sm"
|
|
30
31
|
}), "subagent-run__selector", className),
|
|
31
32
|
"aria-label": ariaLabel ?? `Open ${name}, ${run.status}`,
|
|
33
|
+
"aria-description": getSubagentRunStatusText(run),
|
|
32
34
|
...props,
|
|
33
35
|
children: /* @__PURE__ */ jsx(SubagentRunLabel, { run })
|
|
34
36
|
});
|