@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
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
import { findCatalogMcpServerCard } from "../../utils/mcp-server-catalog.js";
|
|
2
|
+
import { A as McpIcon, C as FolderIcon, K as SpinnerIcon, R as PencilIcon, S as FileIcon, T as InfoIcon, V as QueueIcon, Z as TerminalIcon, b as EyeIcon, c as BoxIcon, et as WarningIcon, o as ArrowUpRightIcon, q as SquareIcon, r as ArrowLeftIcon, y as EllipsisIcon } from "../../icons-cuEtsgj9.js";
|
|
3
|
+
import { Button } from "../foundations/Button.js";
|
|
4
|
+
import { Tooltip } from "../foundations/Tooltip.js";
|
|
5
|
+
import { Dialog } from "../foundations/Dialog.js";
|
|
6
|
+
import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
|
|
7
|
+
import { SubagentRunLabel, getSubagentRunName } from "./SubagentRunIndicator.js";
|
|
8
|
+
import { Menu } from "../foundations/Menu.js";
|
|
9
|
+
import { EmptyState } from "../foundations/EmptyState.js";
|
|
10
|
+
import { AgentChat } from "./AgentChat.js";
|
|
11
|
+
import { Avatar } from "../foundations/Avatar.js";
|
|
12
|
+
import { McpServerIcon } from "./McpServerIcon.js";
|
|
13
|
+
import { ThinkThreadPicker } from "./ThinkThreadPicker.js";
|
|
14
|
+
import { AgentChatStartScreen, AgentChatStartScreenComposer, AgentChatStartScreenPrimary, AgentChatStartScreenSuggestions, AgentChatStartScreenTray, AgentChatStarterList } from "../ai-sdk/AgentChatStartScreen.js";
|
|
15
|
+
import { ChatGptSignInScreen } from "../extension/ChatGptSignInScreen.js";
|
|
16
|
+
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
17
|
+
import { Switch } from "../foundations/Switch.js";
|
|
18
|
+
import { useTheme } from "../foundations/ThemeProvider.js";
|
|
19
|
+
import "../foundations/icons.js";
|
|
20
|
+
import { ActionGuide, ActionGuideAction, ActionGuideList, ActionGuideSection } from "../general-purpose/ActionGuide.js";
|
|
21
|
+
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
22
|
+
import { ResponsiveSidebarShell, useResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
|
|
23
|
+
import * as React from "react";
|
|
24
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
//#region src/components/agents-sdk/EmployeeChrome.tsx
|
|
26
|
+
const WORKBENCH_NAVIGATION = [{
|
|
27
|
+
id: "files",
|
|
28
|
+
label: "Files",
|
|
29
|
+
icon: /* @__PURE__ */ jsx(FileIcon, {})
|
|
30
|
+
}, {
|
|
31
|
+
id: "plugins",
|
|
32
|
+
label: "Plugins",
|
|
33
|
+
icon: /* @__PURE__ */ jsx(BoxIcon, {})
|
|
34
|
+
}];
|
|
35
|
+
function MenuGroupLabel({ label, hint }) {
|
|
36
|
+
return /* @__PURE__ */ jsxs(Menu.GroupLabel, {
|
|
37
|
+
className: "employee-menu__group-label",
|
|
38
|
+
children: [label, /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
39
|
+
render: /* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: "employee-menu__hint",
|
|
41
|
+
tabIndex: 0,
|
|
42
|
+
"aria-label": label + " help"
|
|
43
|
+
}),
|
|
44
|
+
children: /* @__PURE__ */ jsx(InfoIcon, { "aria-hidden": "true" })
|
|
45
|
+
}), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, { children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: hint }) }) })] })]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function MenuSwitchItem({ label, checked, onCheckedChange }) {
|
|
49
|
+
return /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
|
|
50
|
+
className: "employee-menu__switch",
|
|
51
|
+
checked,
|
|
52
|
+
onCheckedChange,
|
|
53
|
+
children: [label, /* @__PURE__ */ jsx(Switch.Root, {
|
|
54
|
+
"aria-hidden": true,
|
|
55
|
+
tabIndex: -1,
|
|
56
|
+
readOnly: true,
|
|
57
|
+
size: "sm",
|
|
58
|
+
checked,
|
|
59
|
+
children: /* @__PURE__ */ jsx(Switch.Thumb, {})
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** Employee settings are host-owned state; the menu stores only dialog visibility. */
|
|
64
|
+
function EmployeeMenu({ renderLink, identity, onModel, onSignOut, companion, passkeys, follow, workbenchNavigation = [] }) {
|
|
65
|
+
const { compact } = useResponsiveSidebarShell();
|
|
66
|
+
const { preference, setPreference } = useTheme();
|
|
67
|
+
const [identityOpen, setIdentityOpen] = React.useState(false);
|
|
68
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
69
|
+
label: "More actions",
|
|
70
|
+
tooltip: identity?.email ? "Signed in as " + identity.email : void 0,
|
|
71
|
+
render: /* @__PURE__ */ jsx(Menu.Trigger, {}),
|
|
72
|
+
children: identity?.email ? /* @__PURE__ */ jsx(Avatar.Root, {
|
|
73
|
+
size: "sm",
|
|
74
|
+
children: /* @__PURE__ */ jsx(Avatar.Fallback, { children: identity.email[0]?.toUpperCase() })
|
|
75
|
+
}) : /* @__PURE__ */ jsx(EllipsisIcon, {})
|
|
76
|
+
}), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
77
|
+
side: "bottom",
|
|
78
|
+
align: "end",
|
|
79
|
+
sideOffset: 4,
|
|
80
|
+
children: /* @__PURE__ */ jsxs(Menu.Popup, { children: [
|
|
81
|
+
compact ? [...WORKBENCH_NAVIGATION, ...workbenchNavigation].map((item) => /* @__PURE__ */ jsxs(Menu.Item, {
|
|
82
|
+
render: renderLink({
|
|
83
|
+
kind: "view",
|
|
84
|
+
view: item.id
|
|
85
|
+
}),
|
|
86
|
+
children: [item.icon, item.label]
|
|
87
|
+
}, item.id)) : null,
|
|
88
|
+
/* @__PURE__ */ jsxs(Menu.Item, {
|
|
89
|
+
render: renderLink({
|
|
90
|
+
kind: "view",
|
|
91
|
+
view: "schedules"
|
|
92
|
+
}),
|
|
93
|
+
children: [/* @__PURE__ */ jsx(QueueIcon, {}), "Routines"]
|
|
94
|
+
}),
|
|
95
|
+
follow ? /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
|
|
96
|
+
checked: follow.followed,
|
|
97
|
+
onCheckedChange: follow.onCheckedChange,
|
|
98
|
+
children: [/* @__PURE__ */ jsx(EyeIcon, {}), "Follow this conversation"]
|
|
99
|
+
}) : null,
|
|
100
|
+
identity ? /* @__PURE__ */ jsxs(Menu.Item, {
|
|
101
|
+
onClick: () => setIdentityOpen(true),
|
|
102
|
+
children: [/* @__PURE__ */ jsx(InfoIcon, {}), "Identity"]
|
|
103
|
+
}) : null,
|
|
104
|
+
onModel ? /* @__PURE__ */ jsxs(Menu.Item, {
|
|
105
|
+
onClick: onModel,
|
|
106
|
+
children: [/* @__PURE__ */ jsx(TerminalIcon, {}), "Model"]
|
|
107
|
+
}) : null,
|
|
108
|
+
companion ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsxs(Menu.Group, { children: [
|
|
109
|
+
/* @__PURE__ */ jsx(MenuGroupLabel, {
|
|
110
|
+
label: "Companion app",
|
|
111
|
+
hint: "Connecting lets this employee chat with the browser and watch it work from anywhere."
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ jsx(MenuSwitchItem, {
|
|
114
|
+
label: "Connect this browser",
|
|
115
|
+
checked: companion.enabled,
|
|
116
|
+
onCheckedChange: companion.setEnabled
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ jsxs(Menu.Item, {
|
|
119
|
+
render: /* @__PURE__ */ jsx("a", {
|
|
120
|
+
href: companion.origin,
|
|
121
|
+
target: "_blank",
|
|
122
|
+
rel: "noreferrer",
|
|
123
|
+
"aria-label": companion.origin.replace(/^https?:\/\//, "")
|
|
124
|
+
}),
|
|
125
|
+
children: [/* @__PURE__ */ jsx(ArrowUpRightIcon, {}), companion.origin.replace(/^https?:\/\//, "")]
|
|
126
|
+
})
|
|
127
|
+
] })] }) : null,
|
|
128
|
+
passkeys ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsx(MenuGroupLabel, {
|
|
129
|
+
label: "Passkeys",
|
|
130
|
+
hint: "The employee saves and uses its own passkeys instead of the browser's."
|
|
131
|
+
}), /* @__PURE__ */ jsx(MenuSwitchItem, {
|
|
132
|
+
label: "Use its own passkeys",
|
|
133
|
+
checked: passkeys.enabled,
|
|
134
|
+
onCheckedChange: passkeys.setEnabled
|
|
135
|
+
})] })] }) : null,
|
|
136
|
+
/* @__PURE__ */ jsx(Menu.Separator, {}),
|
|
137
|
+
/* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsx(Menu.GroupLabel, { children: "Appearance" }), /* @__PURE__ */ jsxs(Menu.RadioGroup, {
|
|
138
|
+
value: preference,
|
|
139
|
+
onValueChange: (value) => {
|
|
140
|
+
if (value === "light" || value === "dark" || value === "system") setPreference(value);
|
|
141
|
+
},
|
|
142
|
+
children: [
|
|
143
|
+
/* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
144
|
+
value: "light",
|
|
145
|
+
children: [/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {}), "Light"]
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
148
|
+
value: "dark",
|
|
149
|
+
children: [/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {}), "Dark"]
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
152
|
+
value: "system",
|
|
153
|
+
children: [/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {}), "System"]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
})] }),
|
|
157
|
+
onSignOut ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsxs(Menu.Item, {
|
|
158
|
+
onClick: onSignOut,
|
|
159
|
+
children: [/* @__PURE__ */ jsx(ArrowUpRightIcon, {}), "Sign out"]
|
|
160
|
+
})] }) : null
|
|
161
|
+
] })
|
|
162
|
+
}) })] }), identity ? /* @__PURE__ */ jsx(IdentityDialog, {
|
|
163
|
+
identity,
|
|
164
|
+
open: identityOpen,
|
|
165
|
+
onOpenChange: setIdentityOpen
|
|
166
|
+
}) : null] });
|
|
167
|
+
}
|
|
168
|
+
function IdentityDialog({ identity, open, onOpenChange }) {
|
|
169
|
+
const [busy, setBusy] = React.useState(false);
|
|
170
|
+
const [error, setError] = React.useState();
|
|
171
|
+
const changeBinding = async (action) => {
|
|
172
|
+
setBusy(true);
|
|
173
|
+
setError(void 0);
|
|
174
|
+
try {
|
|
175
|
+
await action();
|
|
176
|
+
onOpenChange(false);
|
|
177
|
+
} catch (cause) {
|
|
178
|
+
setError(formatErrorMessage(cause));
|
|
179
|
+
} finally {
|
|
180
|
+
setBusy(false);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
184
|
+
open,
|
|
185
|
+
onOpenChange: (next) => {
|
|
186
|
+
setError(void 0);
|
|
187
|
+
onOpenChange(next);
|
|
188
|
+
},
|
|
189
|
+
children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Viewport, { children: /* @__PURE__ */ jsxs(Dialog.Popup, { children: [
|
|
190
|
+
/* @__PURE__ */ jsxs(Dialog.Header, { children: [/* @__PURE__ */ jsx(Dialog.Title, { children: "Operating identity" }), /* @__PURE__ */ jsx(Dialog.Description, { children: "This employee operates the live browser profile as its own identity. Assigning the account keeps it from signing in with another profile." })] }),
|
|
191
|
+
/* @__PURE__ */ jsxs(DescriptionList.Root, {
|
|
192
|
+
variant: "divided",
|
|
193
|
+
children: [/* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Live profile" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: identity.liveProfile })] }), /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Assigned account" }), /* @__PURE__ */ jsxs(DescriptionList.Details, { children: [identity.assignedAccount, identity.managed ? " (managed by your organization)" : null] })] })]
|
|
194
|
+
}),
|
|
195
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
196
|
+
role: "alert",
|
|
197
|
+
children: error
|
|
198
|
+
}) : null,
|
|
199
|
+
/* @__PURE__ */ jsx(Dialog.Footer, { children: identity.managed ? /* @__PURE__ */ jsx("p", { children: "Organization policy controls this binding." }) : identity.onUnbind ? /* @__PURE__ */ jsx(Button, {
|
|
200
|
+
type: "button",
|
|
201
|
+
variant: "ghost",
|
|
202
|
+
color: "destructive",
|
|
203
|
+
disabled: busy,
|
|
204
|
+
onClick: () => identity.onUnbind && void changeBinding(identity.onUnbind),
|
|
205
|
+
children: "Remove binding"
|
|
206
|
+
}) : /* @__PURE__ */ jsx(Button, {
|
|
207
|
+
type: "button",
|
|
208
|
+
color: "primary",
|
|
209
|
+
disabled: busy || !identity.canBind || !identity.onBind,
|
|
210
|
+
onClick: () => identity.onBind && void changeBinding(identity.onBind),
|
|
211
|
+
children: "Assign this profile"
|
|
212
|
+
}) })
|
|
213
|
+
] }) })] })
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
/** Bar links to Files, Plugins, and host views; the compact overflow carries them instead. */
|
|
217
|
+
function EmployeeWorkbenchLinks({ view, renderLink, workbenchNavigation = [] }) {
|
|
218
|
+
const { compact } = useResponsiveSidebarShell();
|
|
219
|
+
if (compact) return null;
|
|
220
|
+
return /* @__PURE__ */ jsx(Fragment, { children: [...WORKBENCH_NAVIGATION, ...workbenchNavigation].map((item) => /* @__PURE__ */ jsx(AppTopBar.Link, {
|
|
221
|
+
label: item.label,
|
|
222
|
+
"aria-current": view === item.id ? "page" : void 0,
|
|
223
|
+
"data-pressed": view === item.id ? "" : void 0,
|
|
224
|
+
render: renderLink({
|
|
225
|
+
kind: "view",
|
|
226
|
+
view: item.id
|
|
227
|
+
}),
|
|
228
|
+
children: item.icon
|
|
229
|
+
}, item.id)) });
|
|
230
|
+
}
|
|
231
|
+
function useEmployeeRunStopFocus() {
|
|
232
|
+
const backRef = React.useRef(null);
|
|
233
|
+
const focusedStop = React.useRef(null);
|
|
234
|
+
React.useLayoutEffect(() => {
|
|
235
|
+
const stop = focusedStop.current;
|
|
236
|
+
if (!stop || stop.isConnected) return;
|
|
237
|
+
focusedStop.current = null;
|
|
238
|
+
if (document.activeElement === document.body) backRef.current?.focus({ preventScroll: true });
|
|
239
|
+
});
|
|
240
|
+
return {
|
|
241
|
+
backRef,
|
|
242
|
+
focusedStop
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function employeeShellTitle({ agentRun, threadTitle }) {
|
|
246
|
+
if (!agentRun) return threadTitle ?? "New chat";
|
|
247
|
+
return /* @__PURE__ */ jsx("span", {
|
|
248
|
+
"data-slot": "employee-run-title",
|
|
249
|
+
className: "employee-shell__run-title",
|
|
250
|
+
children: agentRun.state === "ready" ? /* @__PURE__ */ jsx(SubagentRunLabel, { run: agentRun.run }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
251
|
+
className: "sigvelo-truncate",
|
|
252
|
+
children: "Delegated run"
|
|
253
|
+
})] })
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function employeeShellLeading({ agentRun, view, hasThread, appBarLeading, back, renderLink }) {
|
|
257
|
+
if (agentRun) return back;
|
|
258
|
+
let navigation;
|
|
259
|
+
if (view !== "chat") navigation = back;
|
|
260
|
+
else if (hasThread) navigation = /* @__PURE__ */ jsx(AppTopBar.Link, {
|
|
261
|
+
label: "New thread",
|
|
262
|
+
render: renderLink({ kind: "new-thread" }),
|
|
263
|
+
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
264
|
+
});
|
|
265
|
+
if (!navigation && !appBarLeading) return null;
|
|
266
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [navigation, appBarLeading] });
|
|
267
|
+
}
|
|
268
|
+
function employeeShellActions({ agentRun, view, renderLink, workbenchNavigation, focusedStop }) {
|
|
269
|
+
if (!agentRun) return /* @__PURE__ */ jsx(EmployeeWorkbenchLinks, {
|
|
270
|
+
view,
|
|
271
|
+
renderLink,
|
|
272
|
+
workbenchNavigation
|
|
273
|
+
});
|
|
274
|
+
if (agentRun.state !== "ready" || !agentRun.onCancel) return null;
|
|
275
|
+
return /* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
276
|
+
label: "Stop " + getSubagentRunName(agentRun.run),
|
|
277
|
+
onClick: agentRun.onCancel,
|
|
278
|
+
disabled: agentRun.cancelPending,
|
|
279
|
+
onFocus: (event) => {
|
|
280
|
+
focusedStop.current = event.currentTarget;
|
|
281
|
+
},
|
|
282
|
+
onBlur: () => {
|
|
283
|
+
focusedStop.current = null;
|
|
284
|
+
},
|
|
285
|
+
children: /* @__PURE__ */ jsx(SquareIcon, {})
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
function EmployeeShell({ view, threads, threadId, agentRun, renderLink, appBarLeading, onDeleteThread, children, ...menu }) {
|
|
289
|
+
const history = threads ?? EMPTY_THREADS;
|
|
290
|
+
const thread = history.find((candidate) => candidate.id === threadId);
|
|
291
|
+
const { backRef, focusedStop } = useEmployeeRunStopFocus();
|
|
292
|
+
const back = /* @__PURE__ */ jsx(AppTopBar.Link, {
|
|
293
|
+
ref: backRef,
|
|
294
|
+
label: agentRun ? "Back to parent conversation" : "Back to chat",
|
|
295
|
+
render: agentRun && threadId ? renderLink({
|
|
296
|
+
kind: "thread",
|
|
297
|
+
threadId
|
|
298
|
+
}) : renderLink({
|
|
299
|
+
kind: "view",
|
|
300
|
+
view: "chat"
|
|
301
|
+
}),
|
|
302
|
+
children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
|
|
303
|
+
});
|
|
304
|
+
if (view === "live") return /* @__PURE__ */ jsx("div", {
|
|
305
|
+
className: "employee-shell",
|
|
306
|
+
"data-view": view,
|
|
307
|
+
children: /* @__PURE__ */ jsx(ResponsiveSidebarShell, {
|
|
308
|
+
bar: {
|
|
309
|
+
label: "Live view controls",
|
|
310
|
+
title: "Live view",
|
|
311
|
+
leading: back
|
|
312
|
+
},
|
|
313
|
+
children
|
|
314
|
+
})
|
|
315
|
+
});
|
|
316
|
+
return /* @__PURE__ */ jsx("div", {
|
|
317
|
+
className: "employee-shell",
|
|
318
|
+
"data-view": view,
|
|
319
|
+
children: /* @__PURE__ */ jsx(ResponsiveSidebarShell, {
|
|
320
|
+
sidebarLabel: "threads",
|
|
321
|
+
sidebarTogglePlacement: "sidebar",
|
|
322
|
+
showMainLabel: "Show selected thread",
|
|
323
|
+
bar: {
|
|
324
|
+
label: "Workbench controls",
|
|
325
|
+
title: employeeShellTitle({
|
|
326
|
+
agentRun,
|
|
327
|
+
threadTitle: thread?.title
|
|
328
|
+
}),
|
|
329
|
+
compactTitleTrigger: agentRun ? void 0 : /* @__PURE__ */ jsx("span", { children: thread?.title ?? "New chat" }),
|
|
330
|
+
leading: employeeShellLeading({
|
|
331
|
+
agentRun,
|
|
332
|
+
view,
|
|
333
|
+
hasThread: Boolean(thread),
|
|
334
|
+
appBarLeading,
|
|
335
|
+
back,
|
|
336
|
+
renderLink
|
|
337
|
+
}),
|
|
338
|
+
actions: employeeShellActions({
|
|
339
|
+
agentRun,
|
|
340
|
+
view,
|
|
341
|
+
renderLink,
|
|
342
|
+
workbenchNavigation: menu.workbenchNavigation,
|
|
343
|
+
focusedStop
|
|
344
|
+
}),
|
|
345
|
+
primary: /* @__PURE__ */ jsx(EmployeeMenu, {
|
|
346
|
+
...menu,
|
|
347
|
+
renderLink,
|
|
348
|
+
follow: agentRun ? void 0 : menu.follow
|
|
349
|
+
})
|
|
350
|
+
},
|
|
351
|
+
sidebar: agentRun ? void 0 : ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ThinkThreadPicker, {
|
|
352
|
+
threads: history,
|
|
353
|
+
renderThreadLink: (item) => renderLink({
|
|
354
|
+
kind: "thread",
|
|
355
|
+
threadId: item.id
|
|
356
|
+
}),
|
|
357
|
+
createThreadLink: renderLink({ kind: "new-thread" }),
|
|
358
|
+
onSelect: closeSidebarOnCompact,
|
|
359
|
+
onDelete: onDeleteThread
|
|
360
|
+
}),
|
|
361
|
+
children
|
|
362
|
+
})
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
const EMPTY_THREADS = [];
|
|
366
|
+
/** Policy and connection gates are host facts, not design-system presets. */
|
|
367
|
+
function EmployeeGate({ status, connectingLabel, identity, brand, modelSetup }) {
|
|
368
|
+
switch (status) {
|
|
369
|
+
case "ready": return null;
|
|
370
|
+
case "needs-model": return /* @__PURE__ */ jsx(ChatGptSignInScreen, {
|
|
371
|
+
busy: modelSetup?.busy,
|
|
372
|
+
error: modelSetup?.error,
|
|
373
|
+
label: modelSetup?.label,
|
|
374
|
+
title: "Meet " + brand.name,
|
|
375
|
+
brandName: "SigVelo",
|
|
376
|
+
brandLogo: brand.logo,
|
|
377
|
+
onSignIn: modelSetup?.onSignIn,
|
|
378
|
+
secondaryAction: modelSetup?.onCustomEndpoint ? {
|
|
379
|
+
label: "Set up a custom model endpoint",
|
|
380
|
+
onSelect: modelSetup.onCustomEndpoint
|
|
381
|
+
} : void 0
|
|
382
|
+
});
|
|
383
|
+
case "connecting": return /* @__PURE__ */ jsx("div", {
|
|
384
|
+
className: "employee-gate",
|
|
385
|
+
role: "status",
|
|
386
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
387
|
+
icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
|
|
388
|
+
description: connectingLabel ?? "Connecting…"
|
|
389
|
+
})
|
|
390
|
+
});
|
|
391
|
+
case "offline": return /* @__PURE__ */ jsx("div", {
|
|
392
|
+
className: "employee-gate",
|
|
393
|
+
role: "status",
|
|
394
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
395
|
+
icon: /* @__PURE__ */ jsx(WarningIcon, {}),
|
|
396
|
+
title: brand.name + " is offline",
|
|
397
|
+
description: "Open the browser and turn the companion connection on. This screen reconnects on its own."
|
|
398
|
+
})
|
|
399
|
+
});
|
|
400
|
+
case "identity-blocked":
|
|
401
|
+
if (!identity) return null;
|
|
402
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
403
|
+
className: "employee-gate",
|
|
404
|
+
role: "alert",
|
|
405
|
+
children: [/* @__PURE__ */ jsx(EmptyState, {
|
|
406
|
+
icon: /* @__PURE__ */ jsx(WarningIcon, {}),
|
|
407
|
+
title: "Wrong browser profile",
|
|
408
|
+
description: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
409
|
+
"This installation is assigned to ",
|
|
410
|
+
/* @__PURE__ */ jsx("strong", { children: identity.assignedAccount }),
|
|
411
|
+
", but the live profile is ",
|
|
412
|
+
/* @__PURE__ */ jsx("strong", { children: identity.liveProfile }),
|
|
413
|
+
"."
|
|
414
|
+
] }), /* @__PURE__ */ jsx("p", { children: identity.managed ? "Open the assigned profile. Organization policy controls this assignment." : "Open the assigned profile, or remove the binding." })] })
|
|
415
|
+
}), !identity.managed && identity.onUnbind ? /* @__PURE__ */ jsx(Button, {
|
|
416
|
+
type: "button",
|
|
417
|
+
variant: "ghost",
|
|
418
|
+
color: "destructive",
|
|
419
|
+
onClick: identity.onUnbind,
|
|
420
|
+
children: "Remove binding"
|
|
421
|
+
}) : null]
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function suggestionIcon(value) {
|
|
426
|
+
if (value.startsWith("/")) return /* @__PURE__ */ jsx(BoxIcon, {});
|
|
427
|
+
if (!value.startsWith("@")) return /* @__PURE__ */ jsx(EyeIcon, {});
|
|
428
|
+
const token = value.match(/^@([^\s]+)/)?.[1];
|
|
429
|
+
const server = token ? findCatalogMcpServerCard({
|
|
430
|
+
id: token,
|
|
431
|
+
name: token
|
|
432
|
+
}) : void 0;
|
|
433
|
+
return server ? /* @__PURE__ */ jsx(McpServerIcon, {
|
|
434
|
+
server,
|
|
435
|
+
size: "xs"
|
|
436
|
+
}) : /* @__PURE__ */ jsx(McpIcon, {});
|
|
437
|
+
}
|
|
438
|
+
/** Identifies a starter row by its position and its content, so a refetch cannot mismatch. */
|
|
439
|
+
function suggestionItemId(suggestion, index) {
|
|
440
|
+
return [
|
|
441
|
+
"suggestion",
|
|
442
|
+
index,
|
|
443
|
+
suggestion.value,
|
|
444
|
+
suggestion.label
|
|
445
|
+
].join(":");
|
|
446
|
+
}
|
|
447
|
+
/** The composer remains under its existing prompt provider; connection controls are explicit slots. */
|
|
448
|
+
function EmployeeWelcome({ brand, children, suggestions, suggestionsError, onRetrySuggestions, onSubmit, tray, setupActions, hasConnectedApps }) {
|
|
449
|
+
const [guideOpen, setGuideOpen] = React.useState(false);
|
|
450
|
+
const send = (text) => void onSubmit({
|
|
451
|
+
text,
|
|
452
|
+
files: []
|
|
453
|
+
});
|
|
454
|
+
return /* @__PURE__ */ jsxs(AgentChatStartScreen, { children: [/* @__PURE__ */ jsx(AgentChatStartScreenPrimary, { children: /* @__PURE__ */ jsxs(AgentChatStartScreenComposer, { children: [/* @__PURE__ */ jsx(AgentChat.Dock, { children }), tray ? /* @__PURE__ */ jsx(AgentChatStartScreenTray, { children: tray }) : null] }) }), /* @__PURE__ */ jsx(AgentChatStartScreenSuggestions, { children: guideOpen ? /* @__PURE__ */ jsxs(ActionGuide, {
|
|
455
|
+
title: brand.name + " can work across your browser.",
|
|
456
|
+
description: "They can act in signed-in tabs, keep workspace files, connect plugins, and run recurring work after this panel closes.",
|
|
457
|
+
children: [
|
|
458
|
+
/* @__PURE__ */ jsx(ActionGuideSection, {
|
|
459
|
+
title: "Start with a quick browser job",
|
|
460
|
+
children: /* @__PURE__ */ jsxs(ActionGuideList, { children: [/* @__PURE__ */ jsx(ActionGuideAction, {
|
|
461
|
+
icon: /* @__PURE__ */ jsx(BoxIcon, {}),
|
|
462
|
+
onClick: () => send("Organize this window’s tabs by task."),
|
|
463
|
+
children: "Organize this window’s tabs by task"
|
|
464
|
+
}), /* @__PURE__ */ jsx(ActionGuideAction, {
|
|
465
|
+
icon: /* @__PURE__ */ jsx(EyeIcon, {}),
|
|
466
|
+
onClick: () => send("Close duplicate tabs in this window."),
|
|
467
|
+
children: "Close duplicate tabs in this window"
|
|
468
|
+
})] })
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ jsx(ActionGuideSection, {
|
|
471
|
+
title: "Set up ongoing work",
|
|
472
|
+
children: /* @__PURE__ */ jsxs(ActionGuideList, {
|
|
473
|
+
layout: "cards",
|
|
474
|
+
children: [
|
|
475
|
+
/* @__PURE__ */ jsx(ActionGuideAction, {
|
|
476
|
+
icon: /* @__PURE__ */ jsx(QueueIcon, {}),
|
|
477
|
+
onClick: () => send("Help me create a recurring task that runs on a schedule."),
|
|
478
|
+
children: "Create a recurring task"
|
|
479
|
+
}),
|
|
480
|
+
setupActions,
|
|
481
|
+
/* @__PURE__ */ jsx(ActionGuideAction, {
|
|
482
|
+
icon: /* @__PURE__ */ jsx(McpIcon, {}),
|
|
483
|
+
onClick: () => send(hasConnectedApps ? "Show me useful work I can do across my connected apps." : "Help me connect another app I use."),
|
|
484
|
+
children: hasConnectedApps ? "Use my connected apps" : "Connect another app"
|
|
485
|
+
})
|
|
486
|
+
]
|
|
487
|
+
})
|
|
488
|
+
}),
|
|
489
|
+
/* @__PURE__ */ jsx(ActionGuideSection, {
|
|
490
|
+
title: "Build a larger workflow",
|
|
491
|
+
children: /* @__PURE__ */ jsxs(ActionGuideList, {
|
|
492
|
+
layout: "list",
|
|
493
|
+
children: [
|
|
494
|
+
/* @__PURE__ */ jsx(ActionGuideAction, {
|
|
495
|
+
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
496
|
+
variant: "ghost",
|
|
497
|
+
onClick: () => send("Automate a workflow across my signed-in browser tabs."),
|
|
498
|
+
children: "Automate work across signed-in tabs"
|
|
499
|
+
}),
|
|
500
|
+
/* @__PURE__ */ jsx(ActionGuideAction, {
|
|
501
|
+
icon: /* @__PURE__ */ jsx(FolderIcon, {}),
|
|
502
|
+
variant: "ghost",
|
|
503
|
+
onClick: () => send("Move files between a signed-in website and the workspace."),
|
|
504
|
+
children: "Move files between a website and the workspace"
|
|
505
|
+
}),
|
|
506
|
+
/* @__PURE__ */ jsx(ActionGuideAction, {
|
|
507
|
+
icon: /* @__PURE__ */ jsx(EyeIcon, {}),
|
|
508
|
+
variant: "ghost",
|
|
509
|
+
onClick: () => send("Record a browser workflow as an MP4."),
|
|
510
|
+
children: "Record a browser workflow as an MP4"
|
|
511
|
+
})
|
|
512
|
+
]
|
|
513
|
+
})
|
|
514
|
+
})
|
|
515
|
+
]
|
|
516
|
+
}) : /* @__PURE__ */ jsx(AgentChatStarterList, {
|
|
517
|
+
"aria-label": "Suggested prompts",
|
|
518
|
+
items: [
|
|
519
|
+
{
|
|
520
|
+
id: "capability-guide",
|
|
521
|
+
label: "See what " + brand.name + " can do",
|
|
522
|
+
icon: /* @__PURE__ */ jsx(InfoIcon, {}),
|
|
523
|
+
muted: true
|
|
524
|
+
},
|
|
525
|
+
...suggestionsError ? [{
|
|
526
|
+
id: "retry-suggestions",
|
|
527
|
+
label: "Try generating suggestions again",
|
|
528
|
+
icon: /* @__PURE__ */ jsx(InfoIcon, {}),
|
|
529
|
+
muted: true
|
|
530
|
+
}] : [],
|
|
531
|
+
...suggestions?.map((suggestion, index) => ({
|
|
532
|
+
id: suggestionItemId(suggestion, index),
|
|
533
|
+
label: suggestion.label,
|
|
534
|
+
icon: suggestionIcon(suggestion.value)
|
|
535
|
+
})) ?? []
|
|
536
|
+
],
|
|
537
|
+
onSelect: (item) => {
|
|
538
|
+
if (item.id === "capability-guide") setGuideOpen(true);
|
|
539
|
+
else if (item.id === "retry-suggestions") onRetrySuggestions?.();
|
|
540
|
+
else {
|
|
541
|
+
const suggestion = suggestions?.find((candidate, index) => item.id === suggestionItemId(candidate, index));
|
|
542
|
+
if (suggestion) send(suggestion.value);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}) })] });
|
|
546
|
+
}
|
|
547
|
+
const EmployeeChrome = {
|
|
548
|
+
Shell: EmployeeShell,
|
|
549
|
+
Menu: EmployeeMenu,
|
|
550
|
+
WorkbenchLinks: EmployeeWorkbenchLinks,
|
|
551
|
+
Gate: EmployeeGate,
|
|
552
|
+
Welcome: EmployeeWelcome
|
|
553
|
+
};
|
|
554
|
+
//#endregion
|
|
555
|
+
export { EmployeeChrome };
|