@mcp-b/react-components 0.58.1 → 0.59.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/{CodeBlock-Bs_Z03eC.js → CodeBlock-B4K656LO.js} +1 -1
- package/dist/{EmployeeChrome-DsdIek0l.d.ts → EmployeeChrome-QSki0QT4.d.ts} +4 -4
- package/dist/{ExecutionResult-BSZsUbrL.js → ExecutionResult-Wd1sKAvD.js} +2 -2
- package/dist/{FileTree-DyLBn7O_.js → FileTree-BpCJuvji.js} +1 -1
- package/dist/{ManagerOffice-C8AQcaXs.js → ManagerOffice-BaHSBcSF.js} +4 -4
- package/dist/{ResponsiveSidebarShell-DoZlSP30.d.ts → ResponsiveSidebarShell-DzBGlRJF.d.ts} +23 -8
- package/dist/{SetupChecklist-CKQ-mKYt.js → SetupChecklist-BNK2XFaI.js} +2 -2
- package/dist/{ThinkChatActivity-BkGjTY4r.d.ts → ThinkChatActivity-C4_hPEmb.d.ts} +20 -4
- package/dist/{ThinkChatActivitySummary-DZVy3uQV.d.ts → ThinkChatActivitySummary-ChJ8Iu2T.d.ts} +3 -3
- package/dist/{ThinkChatToolParts-BucHi63O.d.ts → ThinkChatToolParts-BrntWlpa.d.ts} +29 -3
- package/dist/{WorkspaceConceptPanel-97ZyVpZI.js → WorkspaceConceptPanel-D21iRsWm.js} +7 -4
- package/dist/{WorkspaceFileView-M2jC2P4p.js → WorkspaceFileView-5SHsjamf.js} +84 -78
- package/dist/app-bar-outlet-CNfNzY4Y.js +6 -0
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.js +7 -7
- package/dist/components/agents-sdk/BrowserLiveScreen.js +50 -12
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
- package/dist/components/agents-sdk/EmployeeApp.d.ts +2 -3
- package/dist/components/agents-sdk/EmployeeApp.js +5 -5
- package/dist/components/agents-sdk/EmployeeChat.js +4 -4
- package/dist/components/agents-sdk/EmployeeChrome.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeChrome.js +219 -207
- package/dist/components/agents-sdk/EmployeeSchedules.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeSchedules.js +7 -7
- package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeStartScreen.js +3 -3
- package/dist/components/agents-sdk/ExecutionBoard.js +4 -4
- package/dist/components/agents-sdk/ManagerAccountActions.js +2 -2
- package/dist/components/agents-sdk/ManagerOffice.js +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.js +6 -19
- package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +2 -2
- package/dist/components/agents-sdk/McpServerPicker.js +2 -2
- package/dist/components/agents-sdk/ModelEndpointDialog.js +1 -1
- package/dist/components/agents-sdk/ModelSelector.js +5 -5
- package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
- package/dist/components/agents-sdk/SubagentRunPanel.d.ts +8 -9
- package/dist/components/agents-sdk/SubagentRunPanel.js +133 -122
- package/dist/components/agents-sdk/SubagentRunSelector.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChat.js +26 -3
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +110 -110
- package/dist/components/agents-sdk/ThinkChatActivitySummary.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatActivitySummary.js +183 -40
- package/dist/components/agents-sdk/ThinkChatToolPanels.d.ts +8 -4
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +310 -64
- package/dist/components/agents-sdk/ThinkChatToolParts.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkChatToolParts.js +71 -1
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +3 -4
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +8 -8
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkFullApp.js +6 -1
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineActions.js +15 -23
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +6 -6
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
- package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
- package/dist/components/agents-sdk/WorkbenchBack.js +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +7 -7
- package/dist/components/agents-sdk/WorkspaceExecution.js +146 -139
- package/dist/components/agents-sdk/WorkspaceExecutionTable.js +5 -5
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +27 -29
- package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
- package/dist/components/agents-sdk/WorkspaceProject.js +6 -6
- package/dist/components/agents-sdk/WorkspaceUserScript.js +6 -6
- package/dist/components/ai-sdk/Activity.d.ts +1 -1
- package/dist/components/ai-sdk/Activity.js +85 -7
- package/dist/components/ai-sdk/AgentChatMessageEditor.js +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +4 -3
- package/dist/components/ai-sdk/Artifact.js +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.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.js +2 -2
- package/dist/components/ai-sdk/ConnectedAppCards.js +66 -48
- package/dist/components/ai-sdk/Context.js +1 -1
- package/dist/components/ai-sdk/Conversation.js +2 -2
- package/dist/components/ai-sdk/ExpansionState.d.ts +16 -6
- package/dist/components/ai-sdk/ExpansionState.js +25 -7
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +2 -2
- package/dist/components/ai-sdk/Message.js +2 -2
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +99 -12
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.js +13 -9
- package/dist/components/ai-sdk/PromptInputComposerEditor.js +2 -2
- package/dist/components/ai-sdk/Queue.js +2 -2
- package/dist/components/ai-sdk/Reasoning.js +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/ai-sdk/ToolInvocation.d.ts +8 -0
- package/dist/components/ai-sdk/ToolInvocation.js +45 -19
- package/dist/components/extension/ChatGptSignInScreen.js +1 -1
- package/dist/components/extension/CodexModelSelector.js +2 -2
- package/dist/components/extension/ConversationTabPicker.js +2 -2
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/Collapsible.js +1 -1
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/ToggleGroup.js +1 -1
- package/dist/components/foundations/icons.js +1 -1
- package/dist/components/general-purpose/AccountSignInDialog.js +1 -1
- package/dist/components/general-purpose/Commit.js +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +163 -88
- package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/Terminal.js +3 -3
- package/dist/components/general-purpose/TestResults.js +1 -1
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.js +2 -2
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.d.ts +1 -3
- package/dist/components/nanites/AgentToolDetail.js +30 -39
- package/dist/{copy-button-M4sAp9xS.js → copy-button-BsmxSSeD.js} +1 -1
- package/dist/merge-refs-DAh6reu8.js +26 -0
- package/dist/styles/activity.css +74 -0
- package/dist/styles/agent-chat.css +8 -1
- package/dist/styles/agent-tool-detail.css +2 -17
- package/dist/styles/app-top-bar.css +6 -7
- package/dist/styles/base.css +1 -1
- package/dist/styles/employee-chrome.css +0 -7
- package/dist/styles/message.css +1 -1
- package/dist/styles/responsive-sidebar-shell.css +10 -25
- package/dist/styles/scroll-area.css +16 -0
- package/dist/styles/scrollbars.css +55 -41
- package/dist/styles/search-field.css +0 -1
- package/dist/styles/subagent-run.css +36 -196
- package/dist/styles/think-chat-tool-panels.css +38 -5
- package/dist/styles/think-execution-workbench.css +4 -0
- package/dist/styles/think-full-app.css +1 -6
- package/dist/styles/workspace-concepts.css +6 -39
- package/dist/styles/workspace-explorer.css +4 -11
- package/dist/{workspace-assets-DVn0d-fN.js → workspace-assets-RD6IhOyh.js} +1 -1
- package/dist/{workspace-delete-DfloiBWp.js → workspace-delete-CrNGUuBp.js} +1 -1
- package/package.json +2 -2
- package/dist/components/agents-sdk/SubagentRunDetails.d.ts +0 -40
- package/dist/components/agents-sdk/SubagentRunDetails.js +0 -98
- package/dist/merge-refs-DF_7w2x_.js +0 -18
- package/dist/{icons-DvlrWt54.js → icons-Cn3vWZRs.js} +1 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { B as PlusIcon, C as FolderIcon, G as SlackIcon, P as MonitorIcon, R as PencilIcon,
|
|
2
|
-
import { IconButton } from "../foundations/IconButton.js";
|
|
1
|
+
import { B as PlusIcon, C as FolderIcon, G as SlackIcon, P as MonitorIcon, R as PencilIcon, r as ArrowLeftIcon, tt as WarningIcon } from "../../icons-Cn3vWZRs.js";
|
|
3
2
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
4
3
|
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
5
4
|
import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
|
|
6
5
|
import { ThinkThreadPicker } from "./ThinkThreadPicker.js";
|
|
7
6
|
import { EmployeeChrome } from "./EmployeeChrome.js";
|
|
8
|
-
import { n as ManagerOfficeSidebar, r as ManagerOfficeSidebarAlert, t as ManagerOffice } from "../../ManagerOffice-
|
|
7
|
+
import { n as ManagerOfficeSidebar, r as ManagerOfficeSidebarAlert, t as ManagerOffice } from "../../ManagerOffice-BaHSBcSF.js";
|
|
9
8
|
import "react";
|
|
10
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
//#region src/components/agents-sdk/ManagerOfficeScreens.tsx
|
|
@@ -46,18 +45,12 @@ function ManagerWorkShell({ employees, employee, renderOfficeLink, officeActions
|
|
|
46
45
|
},
|
|
47
46
|
...chrome.workbenchNavigation ?? []
|
|
48
47
|
],
|
|
49
|
-
sidebar: ({
|
|
48
|
+
sidebar: ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ManagerOfficeSidebar, {
|
|
50
49
|
layout: "chat",
|
|
51
50
|
employees,
|
|
52
51
|
selectedEmployeeId: employee.id,
|
|
53
52
|
closeSidebarOnCompact,
|
|
54
|
-
officeActions
|
|
55
|
-
label: "Hide workforce",
|
|
56
|
-
variant: "ghost",
|
|
57
|
-
size: "sm",
|
|
58
|
-
onClick: closeSidebar,
|
|
59
|
-
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
60
|
-
})] }),
|
|
53
|
+
officeActions,
|
|
61
54
|
renderLink: (destination) => {
|
|
62
55
|
if (destination.kind === "employee" && "work" in destination.employee) {
|
|
63
56
|
const first = destination.employee.work[0];
|
|
@@ -143,18 +136,12 @@ function ManagerOfficeScreen({ employees, renderLink, view, emptyOfficeAction, o
|
|
|
143
136
|
className: "employee-shell__navigation",
|
|
144
137
|
sidebarLabel: "employees",
|
|
145
138
|
showMainLabel: "Show workforce",
|
|
146
|
-
sidebar: ({
|
|
139
|
+
sidebar: ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ManagerOfficeSidebar, {
|
|
147
140
|
employees,
|
|
148
141
|
renderLink,
|
|
149
142
|
selectedEmployeeId: employee?.id ?? null,
|
|
150
143
|
closeSidebarOnCompact,
|
|
151
|
-
officeActions
|
|
152
|
-
label: "Hide workforce",
|
|
153
|
-
variant: "ghost",
|
|
154
|
-
size: "sm",
|
|
155
|
-
onClick: closeSidebar,
|
|
156
|
-
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
157
|
-
})] })
|
|
144
|
+
officeActions
|
|
158
145
|
}),
|
|
159
146
|
bar: {
|
|
160
147
|
label: "Workforce controls",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { K as SpinnerIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-
|
|
2
|
+
import { K as SpinnerIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-Cn3vWZRs.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
|
-
import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
5
4
|
import { a as formatErrorMessage } from "../../format-CWaZEp5o.js";
|
|
6
5
|
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
7
6
|
import { McpServerIcon } from "./McpServerIcon.js";
|
|
8
7
|
import { t as getMcpServerProjection } from "../../mcp-server-mAErsxHU.js";
|
|
8
|
+
import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { getToolPartState } from "@cloudflare/think/react";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CUSTOM_MCP_SERVER_CARD } from "../../utils/mcp-server-catalog.js";
|
|
2
2
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
|
+
import { a as formatErrorMessage } from "../../format-CWaZEp5o.js";
|
|
4
5
|
import { Field } from "../foundations/Field.js";
|
|
5
6
|
import { Form } from "../foundations/Form.js";
|
|
6
|
-
import { a as formatErrorMessage } from "../../format-CWaZEp5o.js";
|
|
7
7
|
import { Fieldset } from "../foundations/Fieldset.js";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { CUSTOM_MCP_SERVER_CARD } from "../../utils/mcp-server-catalog.js";
|
|
2
2
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
|
-
import { B as PlusIcon, K as SpinnerIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon, y as EllipsisIcon } from "../../icons-
|
|
3
|
+
import { B as PlusIcon, K as SpinnerIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon, y as EllipsisIcon } from "../../icons-Cn3vWZRs.js";
|
|
4
4
|
import { Button } from "../foundations/Button.js";
|
|
5
|
-
import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
6
5
|
import { IconButton } from "../foundations/IconButton.js";
|
|
7
6
|
import { Dialog } from "../foundations/Dialog.js";
|
|
8
7
|
import { a as formatErrorMessage } from "../../format-CWaZEp5o.js";
|
|
@@ -12,6 +11,7 @@ import { McpServerIcon } from "./McpServerIcon.js";
|
|
|
12
11
|
import { SearchField } from "../foundations/SearchField.js";
|
|
13
12
|
import { t as getMcpServerProjection } from "../../mcp-server-mAErsxHU.js";
|
|
14
13
|
import { McpServerSetupDialog } from "./McpServerPicker.js";
|
|
14
|
+
import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
15
15
|
import * as React from "react";
|
|
16
16
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
//#region src/components/agents-sdk/McpPluginCatalog.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as mergeBaseClassName } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { K as SpinnerIcon, N as MinusIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-
|
|
2
|
+
import { K as SpinnerIcon, N as MinusIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-Cn3vWZRs.js";
|
|
3
3
|
import { buttonVariants } from "../foundations/Button.js";
|
|
4
|
-
import { Menu } from "../foundations/Menu.js";
|
|
5
4
|
import { Dialog } from "../foundations/Dialog.js";
|
|
6
5
|
import { a as formatErrorMessage } from "../../format-CWaZEp5o.js";
|
|
6
|
+
import { Menu } from "../foundations/Menu.js";
|
|
7
7
|
import { PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger } from "../ai-sdk/PromptInput.js";
|
|
8
8
|
import { McpServerIcon } from "./McpServerIcon.js";
|
|
9
9
|
import { t as getMcpServerProjection } from "../../mcp-server-mAErsxHU.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Field } from "../foundations/Field.js";
|
|
2
|
-
import { Select } from "../foundations/Select.js";
|
|
3
2
|
import { SettingsFormDialog } from "../general-purpose/SettingsFormDialog.js";
|
|
3
|
+
import { Select } from "../foundations/Select.js";
|
|
4
4
|
import { Checkbox } from "../foundations/Checkbox.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/agents-sdk/ModelEndpointDialog.tsx
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { U as SearchIcon, f as ChevronDownIcon } from "../../icons-
|
|
2
|
+
import { U as SearchIcon, f as ChevronDownIcon } from "../../icons-Cn3vWZRs.js";
|
|
3
|
+
import { ScrollArea } from "../foundations/ScrollArea.js";
|
|
3
4
|
import { Button } from "../foundations/Button.js";
|
|
4
|
-
import { Autocomplete } from "../foundations/Autocomplete.js";
|
|
5
5
|
import { Dialog } from "../foundations/Dialog.js";
|
|
6
6
|
import { c as titleCase } from "../../format-CWaZEp5o.js";
|
|
7
|
-
import {
|
|
8
|
-
import { ScrollArea } from "../foundations/ScrollArea.js";
|
|
9
|
-
import { t as ProviderLogo } from "../../provider-logos-DWYY8wNz.js";
|
|
7
|
+
import { Autocomplete } from "../foundations/Autocomplete.js";
|
|
10
8
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
9
|
+
import { t as ProviderLogo } from "../../provider-logos-DWYY8wNz.js";
|
|
10
|
+
import { Separator } from "../foundations/Separator.js";
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { createPortal } from "react-dom";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { ToolApproval } from "../ai-sdk/ToolApproval.js";
|
|
3
2
|
import { ThinkExecutionApproval, ThinkPendingApproval, getPausedExecution } from "./ThinkPendingApproval.js";
|
|
3
|
+
import { ToolApproval } from "../ai-sdk/ToolApproval.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { isToolUIPart } from "ai";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { composerLinkHref } from "../../utils/composer-link.js";
|
|
2
2
|
import { findCatalogMcpServerCard, getMcpServerIconSrc } from "../../utils/mcp-server-catalog.js";
|
|
3
|
-
import { A as McpIcon, c as BoxIcon } from "../../icons-
|
|
3
|
+
import { A as McpIcon, c as BoxIcon } from "../../icons-Cn3vWZRs.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/agents-sdk/PromptInputCommands.tsx
|
|
6
6
|
function mcpServerCommandIcon(server) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { K as SpinnerIcon, Y as StopIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-
|
|
2
|
+
import { K as SpinnerIcon, Y as StopIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-Cn3vWZRs.js";
|
|
3
3
|
import { r as firstLine, s as textLines } from "../../format-CWaZEp5o.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { n as AgentToolRunValue, t as AgentToolEventsValue } from "../../AgentToolRunsContext-DniwGn96.js";
|
|
2
|
-
import { ExpansionStore } from "../ai-sdk/ExpansionState.js";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { AgentToolRunPart } from "agents/agent-tools";
|
|
5
4
|
//#region src/components/agents-sdk/SubagentRunPanel.d.ts
|
|
@@ -19,22 +18,22 @@ export interface SubagentRunPanelProviderProps {
|
|
|
19
18
|
children: React.ReactNode;
|
|
20
19
|
}
|
|
21
20
|
interface SubagentRunPanelValue extends Pick<SubagentRunPanelProviderProps, "agentTools" | "selectedRunId" | "parentRunning"> {
|
|
22
|
-
open
|
|
23
|
-
|
|
24
|
-
hiddenCompleted: ReadonlySet<string>;
|
|
25
|
-
setHiddenCompleted: (ids: ReadonlySet<string>) => void;
|
|
26
|
-
reportDisclosures: ExpansionStore;
|
|
27
|
-
restoreFocusRunId: React.RefObject<string | undefined>;
|
|
21
|
+
/** Set while a run is open, so coming back lands on the pill that led there. */
|
|
22
|
+
restoreFocus: React.RefObject<boolean>;
|
|
28
23
|
commands: Readonly<Record<string, CommandState>>;
|
|
29
24
|
stopCurrentWork: () => Promise<void>;
|
|
30
25
|
stopRun: (runId: string) => Promise<void>;
|
|
31
26
|
}
|
|
32
|
-
/** A thread's transient
|
|
27
|
+
/** A thread's transient Stop commands and focus return; run facts remain in the SDK value. */
|
|
33
28
|
export declare function SubagentRunPanelProvider({ scopeKey, agentTools, selectedRunId, parentRunning, onStopCurrentWork, onStopRun, children }: SubagentRunPanelProviderProps): React.JSX.Element;
|
|
34
29
|
export declare function useOptionalSubagentRunPanel(): SubagentRunPanelValue | null;
|
|
35
30
|
export interface SubagentRunPanelProps {
|
|
36
31
|
renderRunLink: (run: AgentToolRunValue) => React.ReactElement;
|
|
37
32
|
}
|
|
38
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Parent-scoped delegated work, collapsed to one pill above the composer — the
|
|
35
|
+
* shipped Codex "N background agents" row. The runs open in a popover on
|
|
36
|
+
* demand, so the dock never grows with the roster.
|
|
37
|
+
*/
|
|
39
38
|
export declare function SubagentRunPanel({ renderRunLink }: SubagentRunPanelProps): React.JSX.Element | null;
|
|
40
39
|
//#endregion
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { J as SquareIcon, K as SpinnerIcon } from "../../icons-Cn3vWZRs.js";
|
|
2
|
+
import { buttonVariants } from "../foundations/Button.js";
|
|
3
|
+
import { Tooltip } from "../foundations/Tooltip.js";
|
|
4
|
+
import { IconButton } from "../foundations/IconButton.js";
|
|
5
|
+
import { SubagentRunIndicator, getSubagentRunName } from "./SubagentRunIndicator.js";
|
|
5
6
|
import { useOptionalAgentChatQueue } from "./AgentChatQueue.js";
|
|
6
|
-
import {
|
|
7
|
+
import { Queue, QueueItem, QueueItemActions, QueueItemContent, QueueItemDescription, QueueList } from "../ai-sdk/Queue.js";
|
|
8
|
+
import { AgentChatNotice } from "./AgentChat.js";
|
|
9
|
+
import { Popover } from "../foundations/Popover.js";
|
|
7
10
|
import { SubagentRunSelector } from "./SubagentRunSelector.js";
|
|
8
11
|
import * as React from "react";
|
|
9
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -14,30 +17,19 @@ const SubagentRunPanelContext = React.createContext(null);
|
|
|
14
17
|
function createPanelState(scopeKey, selectedRunId) {
|
|
15
18
|
return {
|
|
16
19
|
scopeKey,
|
|
17
|
-
open: true,
|
|
18
|
-
hiddenCompleted: /* @__PURE__ */ new Set(),
|
|
19
20
|
commands: {},
|
|
20
|
-
reportDisclosures: createExpansionStore(),
|
|
21
21
|
inFlight: /* @__PURE__ */ new Map(),
|
|
22
|
-
|
|
22
|
+
restoreFocus: { current: Boolean(selectedRunId) }
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
/** A thread's transient
|
|
25
|
+
/** A thread's transient Stop commands and focus return; run facts remain in the SDK value. */
|
|
26
26
|
function SubagentRunPanelProvider({ scopeKey, agentTools, selectedRunId, parentRunning, onStopCurrentWork, onStopRun, children }) {
|
|
27
27
|
const [state, setState] = React.useState(() => createPanelState(scopeKey, selectedRunId));
|
|
28
28
|
if (state.scopeKey !== scopeKey) setState(createPanelState(scopeKey, selectedRunId));
|
|
29
|
-
const {
|
|
30
|
-
const setOpen = React.useCallback((open) => setState((current) => current.inFlight === inFlight ? {
|
|
31
|
-
...current,
|
|
32
|
-
open
|
|
33
|
-
} : current), [inFlight]);
|
|
34
|
-
const setHiddenCompleted = React.useCallback((hiddenCompleted) => setState((current) => current.inFlight === inFlight ? {
|
|
35
|
-
...current,
|
|
36
|
-
hiddenCompleted
|
|
37
|
-
} : current), [inFlight]);
|
|
29
|
+
const { commands, inFlight, restoreFocus } = state;
|
|
38
30
|
React.useLayoutEffect(() => {
|
|
39
|
-
if (selectedRunId)
|
|
40
|
-
}, [
|
|
31
|
+
if (selectedRunId) restoreFocus.current = true;
|
|
32
|
+
}, [restoreFocus, selectedRunId]);
|
|
41
33
|
const execute = React.useCallback((key, command) => {
|
|
42
34
|
const pending = inFlight.get(key);
|
|
43
35
|
if (pending) return pending;
|
|
@@ -66,12 +58,7 @@ function SubagentRunPanelProvider({ scopeKey, agentTools, selectedRunId, parentR
|
|
|
66
58
|
agentTools,
|
|
67
59
|
selectedRunId,
|
|
68
60
|
parentRunning,
|
|
69
|
-
|
|
70
|
-
setOpen,
|
|
71
|
-
hiddenCompleted,
|
|
72
|
-
setHiddenCompleted,
|
|
73
|
-
reportDisclosures,
|
|
74
|
-
restoreFocusRunId,
|
|
61
|
+
restoreFocus,
|
|
75
62
|
commands,
|
|
76
63
|
stopCurrentWork,
|
|
77
64
|
stopRun
|
|
@@ -79,12 +66,7 @@ function SubagentRunPanelProvider({ scopeKey, agentTools, selectedRunId, parentR
|
|
|
79
66
|
agentTools,
|
|
80
67
|
selectedRunId,
|
|
81
68
|
parentRunning,
|
|
82
|
-
|
|
83
|
-
hiddenCompleted,
|
|
84
|
-
reportDisclosures,
|
|
85
|
-
restoreFocusRunId,
|
|
86
|
-
setOpen,
|
|
87
|
-
setHiddenCompleted,
|
|
69
|
+
restoreFocus,
|
|
88
70
|
commands,
|
|
89
71
|
stopCurrentWork,
|
|
90
72
|
stopRun
|
|
@@ -97,34 +79,28 @@ function SubagentRunPanelProvider({ scopeKey, agentTools, selectedRunId, parentR
|
|
|
97
79
|
function useOptionalSubagentRunPanel() {
|
|
98
80
|
return React.useContext(SubagentRunPanelContext);
|
|
99
81
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return
|
|
103
|
-
runs,
|
|
104
|
-
active: runs.filter(agentToolRunMayExecute),
|
|
105
|
-
completed: runs.filter((run) => !agentToolRunMayExecute(run)),
|
|
106
|
-
visible: runs.filter((run) => !panel.hiddenCompleted.has(run.runId) || agentToolRunMayExecute(run))
|
|
107
|
-
};
|
|
82
|
+
/** Runs that may still execute lead; each group keeps dispatch order. */
|
|
83
|
+
function sortSubagentRuns(panel) {
|
|
84
|
+
return Object.values(panel.agentTools.runsById).sort((a, b) => Number(!agentToolRunMayExecute(a)) - Number(!agentToolRunMayExecute(b)) || a.order - b.order);
|
|
108
85
|
}
|
|
109
|
-
function useSubagentRunFocus(panel,
|
|
86
|
+
function useSubagentRunFocus(panel, runs) {
|
|
87
|
+
const triggerRef = React.useRef(null);
|
|
110
88
|
const rootRef = React.useRef(null);
|
|
111
89
|
const focusedControl = React.useRef(null);
|
|
112
90
|
const [focusedOrder, setFocusedOrder] = React.useState(null);
|
|
113
91
|
const ranks = focusedOrder ? new Map(focusedOrder.map((id, index) => [id, index])) : null;
|
|
114
|
-
const ordered = ranks ?
|
|
92
|
+
const ordered = ranks ? runs.toSorted((a, b) => (ranks.get(a.runId) ?? Infinity) - (ranks.get(b.runId) ?? Infinity)) : runs;
|
|
115
93
|
React.useLayoutEffect(() => {
|
|
116
94
|
const previous = focusedControl.current;
|
|
117
|
-
|
|
118
|
-
(
|
|
95
|
+
const root = rootRef.current;
|
|
96
|
+
if (!previous || previous.element.isConnected || !root || document.activeElement !== document.body) return;
|
|
97
|
+
(Array.from(root.querySelectorAll("[data-run-id]")).find((element) => element.dataset.runId === previous.runId)?.querySelector("a") ?? root).focus({ preventScroll: true });
|
|
119
98
|
});
|
|
120
99
|
React.useEffect(() => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
(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 });
|
|
126
|
-
panel.restoreFocusRunId.current = void 0;
|
|
127
|
-
}, [panel.restoreFocusRunId, panel.selectedRunId]);
|
|
100
|
+
if (panel.selectedRunId || !panel.restoreFocus.current) return;
|
|
101
|
+
triggerRef.current?.focus({ preventScroll: true });
|
|
102
|
+
panel.restoreFocus.current = false;
|
|
103
|
+
}, [panel.restoreFocus, panel.selectedRunId]);
|
|
128
104
|
const onFocusCapture = (event) => {
|
|
129
105
|
focusedControl.current = {
|
|
130
106
|
element: event.target,
|
|
@@ -139,25 +115,23 @@ function useSubagentRunFocus(panel, visible) {
|
|
|
139
115
|
}
|
|
140
116
|
};
|
|
141
117
|
return {
|
|
118
|
+
triggerRef,
|
|
142
119
|
rootRef,
|
|
143
120
|
ordered,
|
|
144
121
|
onFocusCapture,
|
|
145
122
|
onBlurCapture
|
|
146
123
|
};
|
|
147
124
|
}
|
|
148
|
-
function
|
|
149
|
-
const counts = [active ? `${active} active` : null, completed ? `${completed} finished` : null].filter(Boolean).join(", ");
|
|
150
|
-
return `Delegated work${counts ? `, ${counts}` : ""}`;
|
|
151
|
-
}
|
|
152
|
-
function SubagentRunPanelControls({ panel, active }) {
|
|
125
|
+
function SubagentRunStopAll({ panel, active }) {
|
|
153
126
|
const queue = useOptionalAgentChatQueue();
|
|
154
127
|
const stop = panel.commands["current-work"] ?? IDLE;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
128
|
+
if (active < 2 && !stop.error && !stop.pending) return null;
|
|
129
|
+
return /* @__PURE__ */ jsx("div", {
|
|
130
|
+
className: "subagent-run__menu-header",
|
|
131
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
132
|
+
label: "Stop current work",
|
|
133
|
+
tooltip: stop.pending ? "Stopping current work…" : void 0,
|
|
134
|
+
size: "xs",
|
|
161
135
|
variant: "ghost",
|
|
162
136
|
color: "neutral",
|
|
163
137
|
disabled: stop.pending,
|
|
@@ -167,8 +141,8 @@ function SubagentRunPanelControls({ panel, active }) {
|
|
|
167
141
|
queue?.hold();
|
|
168
142
|
panel.stopCurrentWork().catch(() => void 0);
|
|
169
143
|
},
|
|
170
|
-
children: stop.pending ?
|
|
171
|
-
})
|
|
144
|
+
children: stop.pending ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(SquareIcon, {})
|
|
145
|
+
})
|
|
172
146
|
});
|
|
173
147
|
}
|
|
174
148
|
function SubagentRunRow({ panel, run, renderRunLink }) {
|
|
@@ -186,81 +160,118 @@ function SubagentRunRow({ panel, run, renderRunLink }) {
|
|
|
186
160
|
children: command.error
|
|
187
161
|
}) : null] }), actionable ? /* @__PURE__ */ jsx(QueueItemActions, {
|
|
188
162
|
persistent: true,
|
|
189
|
-
children: /* @__PURE__ */ jsx(
|
|
163
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
164
|
+
label: `Stop ${getSubagentRunName(run)}`,
|
|
165
|
+
tooltip: command.pending ? "Stopping…" : void 0,
|
|
166
|
+
size: "xs",
|
|
167
|
+
variant: "ghost",
|
|
168
|
+
color: "neutral",
|
|
190
169
|
disabled: command.pending,
|
|
191
170
|
focusableWhenDisabled: true,
|
|
192
171
|
"aria-busy": command.pending,
|
|
193
|
-
"aria-label": `Stop ${getSubagentRunName(run)}`,
|
|
194
172
|
onClick: () => {
|
|
195
173
|
panel.stopRun(run.runId).catch(() => void 0);
|
|
196
174
|
},
|
|
197
|
-
children: command.pending ?
|
|
175
|
+
children: command.pending ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(SquareIcon, {})
|
|
198
176
|
})
|
|
199
177
|
}) : null]
|
|
200
178
|
});
|
|
201
179
|
}
|
|
202
180
|
function SubagentRunPanelContent({ panel, renderRunLink }) {
|
|
203
|
-
const
|
|
204
|
-
const focus = useSubagentRunFocus(panel,
|
|
181
|
+
const runs = sortSubagentRuns(panel);
|
|
182
|
+
const focus = useSubagentRunFocus(panel, runs);
|
|
205
183
|
const stop = panel.commands["current-work"] ?? IDLE;
|
|
206
|
-
|
|
207
|
-
|
|
184
|
+
const [open, setOpen] = React.useState(false);
|
|
185
|
+
const lead = runs.find((run) => run.status !== "completed") ?? runs[0];
|
|
186
|
+
if (!lead) {
|
|
187
|
+
if (open) setOpen(false);
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
const active = runs.filter(agentToolRunMayExecute).length;
|
|
191
|
+
const finished = runs.length - active;
|
|
192
|
+
const counts = [active && `${active} active`, finished && `${finished} finished`].filter(Boolean).join(", ");
|
|
193
|
+
const { collection } = panel.agentTools;
|
|
194
|
+
return /* @__PURE__ */ jsx("div", {
|
|
195
|
+
className: "subagent-run__dock",
|
|
208
196
|
"data-subagent-run-panel": "",
|
|
209
|
-
children: /* @__PURE__ */
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
className: "subagent-run__panel-header",
|
|
219
|
-
children: [/* @__PURE__ */ jsx(QueueSectionTrigger, {
|
|
197
|
+
children: /* @__PURE__ */ jsxs(Popover.Root, {
|
|
198
|
+
open,
|
|
199
|
+
onOpenChange: setOpen,
|
|
200
|
+
children: [/* @__PURE__ */ jsxs(Tooltip.Root, {
|
|
201
|
+
disabled: open,
|
|
202
|
+
children: [/* @__PURE__ */ jsxs(Tooltip.Trigger, {
|
|
203
|
+
render: /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
204
|
+
unstyled: true,
|
|
205
|
+
ref: focus.triggerRef,
|
|
220
206
|
"data-slot": "subagent-run-panel-trigger",
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
size: "xs",
|
|
229
|
-
variant: "ghost",
|
|
230
|
-
color: "neutral",
|
|
231
|
-
onClick: () => panel.setHiddenCompleted(panel.hiddenCompleted.size ? /* @__PURE__ */ new Set() : new Set(completed.map((run) => run.runId))),
|
|
232
|
-
children: panel.hiddenCompleted.size ? `Show completed (${completed.length})` : "Hide completed"
|
|
233
|
-
}) : null]
|
|
234
|
-
}), /* @__PURE__ */ jsxs(QueueSectionContent, { children: [
|
|
235
|
-
stop.error ? /* @__PURE__ */ jsx(AgentChatNotice, {
|
|
236
|
-
"data-tone": "danger",
|
|
237
|
-
role: "alert",
|
|
238
|
-
children: stop.error
|
|
239
|
-
}) : null,
|
|
240
|
-
panel.agentTools.collection.status === "loading" ? /* @__PURE__ */ jsx(AgentChatNotice, { children: panel.agentTools.collection.stale ? "Reconnecting. Last known runs are shown." : "Loading delegated work…" }) : null,
|
|
241
|
-
panel.agentTools.collection.status === "error" ? /* @__PURE__ */ jsx(AgentChatNotice, {
|
|
242
|
-
"data-tone": "danger",
|
|
243
|
-
role: "alert",
|
|
244
|
-
children: panel.agentTools.collection.error ?? "Could not refresh delegated work. Last known runs are retained."
|
|
245
|
-
}) : null,
|
|
246
|
-
/* @__PURE__ */ jsx(QueueList, {
|
|
247
|
-
"aria-label": "Delegated work runs",
|
|
248
|
-
children: focus.ordered.map((run) => /* @__PURE__ */ jsx(SubagentRunRow, {
|
|
249
|
-
panel,
|
|
250
|
-
run,
|
|
251
|
-
renderRunLink
|
|
252
|
-
}, run.runId))
|
|
207
|
+
className: buttonVariants({
|
|
208
|
+
variant: "surface",
|
|
209
|
+
color: "neutral",
|
|
210
|
+
size: "xs",
|
|
211
|
+
className: "subagent-run__pill"
|
|
212
|
+
}),
|
|
213
|
+
"aria-description": counts
|
|
253
214
|
}),
|
|
254
|
-
/* @__PURE__ */ jsx(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
215
|
+
children: [/* @__PURE__ */ jsx(SubagentRunIndicator, { run: lead }), runs.length === 1 ? "1 agent" : `${runs.length} agents`]
|
|
216
|
+
}), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
217
|
+
side: "top",
|
|
218
|
+
sideOffset: 6,
|
|
219
|
+
children: /* @__PURE__ */ jsxs(Tooltip.Popup, { children: ["Delegated work · ", counts] })
|
|
220
|
+
}) })]
|
|
221
|
+
}), /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
222
|
+
side: "top",
|
|
223
|
+
align: "center",
|
|
224
|
+
sideOffset: 8,
|
|
225
|
+
children: /* @__PURE__ */ jsxs(Popover.Popup, {
|
|
226
|
+
ref: focus.rootRef,
|
|
227
|
+
"aria-label": "Delegated work",
|
|
228
|
+
className: "subagent-run__menu",
|
|
229
|
+
initialFocus: (openType) => openType === "keyboard" ? focus.rootRef.current?.querySelector("[data-run-id] a") ?? true : focus.rootRef.current,
|
|
230
|
+
onFocusCapture: focus.onFocusCapture,
|
|
231
|
+
onBlurCapture: focus.onBlurCapture,
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ jsx(SubagentRunStopAll, {
|
|
234
|
+
panel,
|
|
235
|
+
active
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ jsxs("div", {
|
|
238
|
+
className: "subagent-run__notices",
|
|
239
|
+
children: [
|
|
240
|
+
stop.error ? /* @__PURE__ */ jsx(AgentChatNotice, {
|
|
241
|
+
"data-tone": "danger",
|
|
242
|
+
role: "alert",
|
|
243
|
+
children: stop.error
|
|
244
|
+
}) : null,
|
|
245
|
+
collection.status === "loading" ? /* @__PURE__ */ jsx(AgentChatNotice, { children: collection.stale ? "Reconnecting. Last known runs are shown." : "Loading delegated work…" }) : null,
|
|
246
|
+
collection.status === "error" ? /* @__PURE__ */ jsx(AgentChatNotice, {
|
|
247
|
+
"data-tone": "danger",
|
|
248
|
+
role: "alert",
|
|
249
|
+
children: collection.error ?? "Could not refresh delegated work. Last known runs are retained."
|
|
250
|
+
}) : null
|
|
251
|
+
]
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ jsx(Queue, {
|
|
254
|
+
density: "compact",
|
|
255
|
+
children: /* @__PURE__ */ jsx(QueueList, {
|
|
256
|
+
"aria-label": "Delegated work runs",
|
|
257
|
+
children: focus.ordered.map((run) => /* @__PURE__ */ jsx(SubagentRunRow, {
|
|
258
|
+
panel,
|
|
259
|
+
run,
|
|
260
|
+
renderRunLink
|
|
261
|
+
}, run.runId))
|
|
262
|
+
})
|
|
263
|
+
})
|
|
264
|
+
]
|
|
265
|
+
})
|
|
266
|
+
}) })]
|
|
260
267
|
})
|
|
261
268
|
});
|
|
262
269
|
}
|
|
263
|
-
/**
|
|
270
|
+
/**
|
|
271
|
+
* Parent-scoped delegated work, collapsed to one pill above the composer — the
|
|
272
|
+
* shipped Codex "N background agents" row. The runs open in a popover on
|
|
273
|
+
* demand, so the dock never grows with the roster.
|
|
274
|
+
*/
|
|
264
275
|
function SubagentRunPanel({ renderRunLink }) {
|
|
265
276
|
const panel = useOptionalSubagentRunPanel();
|
|
266
277
|
return panel ? /* @__PURE__ */ jsx(SubagentRunPanelContent, {
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { J as PromptInputMessage } from "../../PromptInput-C3adKglc.js";
|
|
2
2
|
import { i as AgentMessageRenderPartContext } from "../../AgentMessageParts-BtWwiE4f.js";
|
|
3
3
|
import { AgentChatMessageContentProps, AgentChatRootProps } from "./AgentChat.js";
|
|
4
|
-
import { o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, t as ThinkChatActivity } from "../../ThinkChatActivity-
|
|
4
|
+
import { o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, t as ThinkChatActivity } from "../../ThinkChatActivity-C4_hPEmb.js";
|
|
5
5
|
import { i as ThinkChatValue } from "../../ThinkChatContext-DQ6M2VlJ.js";
|
|
6
6
|
import { n as WorkspaceFileRenderer } from "../../WorkspaceMessageResponse-D8FGgIQU.js";
|
|
7
7
|
import * as React from "react";
|
|
@@ -7,7 +7,7 @@ import { n as WorkspaceMessageResponse, t as WorkspaceFileRendererProvider } fro
|
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import { isTextUIPart } from "ai";
|
|
10
|
-
import { queryOptions, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
10
|
+
import { queryOptions, replaceEqualDeep, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
11
11
|
//#region src/components/agents-sdk/ThinkChat.tsx
|
|
12
12
|
const EMPTY_PENDING_APPROVALS = [];
|
|
13
13
|
const STREAMED_TEXT_ANIMATION = {
|
|
@@ -129,10 +129,33 @@ function ThinkChatRoot({ chat, children, ...props }) {
|
|
|
129
129
|
function normalizeThinkPrompt({ text, references }) {
|
|
130
130
|
return parseComposerLinks(text).length ? composerDraftToPrompt(text) : [...references?.map(({ trigger, value }) => trigger ? `${trigger}${value}` : value) ?? [], text.trim()].filter(Boolean).join(" ");
|
|
131
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Agents' stream state assigns part fields in place and re-emits the same part
|
|
134
|
+
* objects, so the shared snapshot keeps its own shallow copies to compare against.
|
|
135
|
+
*/
|
|
136
|
+
function detachParts(message) {
|
|
137
|
+
return {
|
|
138
|
+
...message,
|
|
139
|
+
parts: message.parts.map((part) => ({ ...part }))
|
|
140
|
+
};
|
|
141
|
+
}
|
|
132
142
|
/** Think activity/workspace rendering, independent of transcript layout and message actions. */
|
|
133
143
|
function ThinkChatMessageContent({ message, renderPart, excludeTools, renderAgentToolRunLink, toolRenderers, renderWorkspaceFile }) {
|
|
144
|
+
const [snapshot, setSnapshot] = React.useState(() => ({
|
|
145
|
+
input: message,
|
|
146
|
+
shared: detachParts(message)
|
|
147
|
+
}));
|
|
148
|
+
let sharedMessage = snapshot.shared;
|
|
149
|
+
if (snapshot.input !== message) {
|
|
150
|
+
const detached = detachParts(message);
|
|
151
|
+
sharedMessage = snapshot.shared.id === message.id ? replaceEqualDeep(snapshot.shared, detached) : detached;
|
|
152
|
+
setSnapshot({
|
|
153
|
+
input: message,
|
|
154
|
+
shared: sharedMessage
|
|
155
|
+
});
|
|
156
|
+
}
|
|
134
157
|
const { lastMessageId, status } = useAgentChatControls();
|
|
135
|
-
const isLiveMessage =
|
|
158
|
+
const isLiveMessage = sharedMessage.role === "assistant" && sharedMessage.id === lastMessageId && status === "streaming";
|
|
136
159
|
const activity = React.useMemo(() => createThinkChatActivityRenderer({
|
|
137
160
|
excludeTools,
|
|
138
161
|
renderAgentToolRunLink,
|
|
@@ -166,7 +189,7 @@ function ThinkChatMessageContent({ message, renderPart, excludeTools, renderAgen
|
|
|
166
189
|
return /* @__PURE__ */ jsx(WorkspaceFileRendererProvider, {
|
|
167
190
|
renderWorkspaceFile,
|
|
168
191
|
children: /* @__PURE__ */ jsx(AgentChat.MessageContent, {
|
|
169
|
-
message,
|
|
192
|
+
message: sharedMessage,
|
|
170
193
|
renderPart: resolved
|
|
171
194
|
})
|
|
172
195
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../../ThinkChatActivity-
|
|
1
|
+
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../../ThinkChatActivity-C4_hPEmb.js";
|
|
2
2
|
export { ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatToolRenderer, ThinkChatToolRenderers, createThinkChatActivityRenderer, renderThinkChatActivityPart };
|