@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,168 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as AgentToolEventsValue } from "../../AgentToolRunsContext-jtmveaRE.js";
|
|
3
|
-
import { n as ResponsiveSidebarShell, t as AppBarSlots } from "../../ResponsiveSidebarShell-BTVPxLJK.js";
|
|
4
|
-
import { n as McpPluginCatalogProps } from "../../McpPluginCatalog-3qWu8oK1.js";
|
|
5
|
-
import { i as ThinkChatMessagesProps } from "../../ThinkChat-CwMdEum8.js";
|
|
6
|
-
import { o as ThinkThreadStatusSummary } from "../../ThinkThreadPicker-yFz4vvIf.js";
|
|
7
|
-
import { r as WorkspaceFileAssetResolver } from "../../WorkspaceFile-Dq-GC0_T.js";
|
|
8
|
-
import { y as WorkspaceSource } from "../../Workspace-LIoU30n7.js";
|
|
9
|
-
import { r as WorkspaceChangeSource } from "../../WorkspaceLive-DfjH1Ypm.js";
|
|
10
|
-
import { t as ThinkAgent } from "../../think-agent-Cip5KAPj.js";
|
|
1
|
+
import { ResizableSidePanelHandleProps } from "../general-purpose/ResizableSidePanel.js";
|
|
11
2
|
import * as React from "react";
|
|
12
|
-
import {
|
|
13
|
-
import { useAgentChat } from "@cloudflare/think/react";
|
|
14
|
-
import { useAgent } from "agents/react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
15
4
|
|
|
16
5
|
//#region src/components/agents-sdk/ThinkFullApp.d.ts
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* ThinkFullApp bar: the shared shell slots plus the workbench view switch.
|
|
21
|
-
* `views` omitted uses the built-in Files/Plugins switch. Pass `null` when
|
|
22
|
-
* the host already offers those destinations (an overflow menu). `primary`
|
|
23
|
-
* is always last.
|
|
24
|
-
*/
|
|
25
|
-
interface ThinkFullAppBarSlots extends AppBarSlots {
|
|
26
|
-
/**
|
|
27
|
-
* View-switch slot. Omit for the built-in switch. `null` omits it so the
|
|
28
|
-
* host can own Files/Plugins in `actions` instead of showing a second set
|
|
29
|
-
* of icons.
|
|
30
|
-
*/
|
|
31
|
-
views?: React.ReactNode | null;
|
|
6
|
+
interface ThinkFullAppRootProps extends React.ComponentPropsWithRef<"div"> {
|
|
7
|
+
/** Whether the host-selected workbench is visible. Route identity remains with the host. */
|
|
8
|
+
workbenchOpen: boolean;
|
|
32
9
|
}
|
|
33
10
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* `onViewChange` back into their router.
|
|
11
|
+
* Conversation/workbench layout, independent of routing and SDK connections.
|
|
12
|
+
* Compose navigation outside the root. The conversation remains mounted while
|
|
13
|
+
* compact layouts show the workbench; ResizableSidePanel owns desktop resizing.
|
|
38
14
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
revision?: string;
|
|
59
|
-
/** Leading workspace control, such as a host-owned Back to chat button. */
|
|
60
|
-
leading?: React.ReactNode;
|
|
61
|
-
actions?: React.ReactNode;
|
|
62
|
-
}
|
|
63
|
-
interface ThinkFullAppPanel {
|
|
64
|
-
/** Unique panel id used by `view`; custom panels should not reuse built-in ids. */
|
|
65
|
-
id: ThinkFullAppWorkbenchView;
|
|
66
|
-
label: string;
|
|
67
|
-
icon: React.ReactNode;
|
|
68
|
-
/** Panels are app-authored, so anything one needs is already in its scope. */
|
|
69
|
-
render: () => React.ReactNode;
|
|
70
|
-
}
|
|
71
|
-
/** The live conversation the chat lane and approvals belong to. */
|
|
72
|
-
interface ThinkFullAppConversation<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> {
|
|
73
|
-
/** The `useAgent` value from `agents/react`; its stub drives approvals and execution records. */
|
|
74
|
-
agent: ReturnType<typeof useAgent<AgentT, State>>;
|
|
75
|
-
/** The `useAgentChat` value from `@cloudflare/think/react` used by the chat surface. */
|
|
76
|
-
chat: ReturnType<typeof useAgentChat<State, MessageT>>;
|
|
77
|
-
/**
|
|
78
|
-
* The `useSourceScopedAgentToolEvents(agent)` value for this connection.
|
|
79
|
-
* The app owns the subscription — mounted beside the `useAgent` call, since
|
|
80
|
-
* the server replays retained runs once per socket connect — so a run-detail
|
|
81
|
-
* route can read the same projection. ThinkFullApp never subscribes itself.
|
|
82
|
-
*
|
|
83
|
-
* Omit it for a connection that spawns no runs — a delegated run's own
|
|
84
|
-
* socket carries none — rather than passing an empty stand-in projection.
|
|
85
|
-
*/
|
|
86
|
-
agentTools?: AgentToolEventsValue<MessageT["parts"][number]>;
|
|
87
|
-
}
|
|
88
|
-
interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> extends React.HTMLAttributes<HTMLDivElement> {
|
|
89
|
-
/**
|
|
90
|
-
* Omit it and supply `messages.draft` for the first turn of a conversation
|
|
91
|
-
* that does not exist yet. The approvals and background-agent surfaces wait
|
|
92
|
-
* for a conversation to belong to; everything else is unchanged.
|
|
93
|
-
*/
|
|
94
|
-
conversation?: ThinkFullAppConversation<AgentT, State, MessageT>;
|
|
95
|
-
/** Atomic workspace source, navigation, media, and header configuration. */
|
|
96
|
-
workspace?: ThinkFullAppWorkspaceConfig;
|
|
97
|
-
/** Plugin directory backed by the host's live Agents MCP state and connection callbacks. */
|
|
98
|
-
plugins?: McpPluginCatalogProps;
|
|
99
|
-
/** Application bar slots: back, leading, title, actions, views, primary. */
|
|
100
|
-
bar?: ThinkFullAppBarSlots;
|
|
101
|
-
/** Aggregate thread activity rendered beside the compact thread-title disclosure. */
|
|
102
|
-
threadStatusSummary?: ThinkThreadStatusSummary;
|
|
103
|
-
/**
|
|
104
|
-
* Stable, non-secret identity for the remote Think agent used by approvals.
|
|
105
|
-
* Include endpoint, account or tenant scope, and
|
|
106
|
-
* agent path so two sources cannot share cached data. The optional workspace
|
|
107
|
-
* has its own source identity.
|
|
108
|
-
*/
|
|
109
|
-
sourceKey: string;
|
|
110
|
-
/** Message rendering labels and approval overrides for ThinkChat. */
|
|
111
|
-
messages?: ThinkChatMessagesProps<MessageT>;
|
|
112
|
-
/** Extra workbench panels appended after the enabled built-in panels. */
|
|
113
|
-
workbenchPanels?: readonly ThinkFullAppPanel[];
|
|
114
|
-
/** Returns an application-authored TanStack Router Link and enables retained Agent Tool runs. */
|
|
115
|
-
renderAgentToolRunLink?: NonNullable<ThinkChatMessagesProps<MessageT>["renderAgentToolRunLink"]>;
|
|
116
|
-
/**
|
|
117
|
-
* Optional parent-owned thread picker/sidebar rendered beside the selected child app.
|
|
118
|
-
* Use the render form to close the compact drawer after selecting a thread.
|
|
119
|
-
*/
|
|
120
|
-
threadSidebar?: React.ComponentProps<typeof ResponsiveSidebarShell>["sidebar"];
|
|
121
|
-
/**
|
|
122
|
-
* Place the wide-layout thread toggle. The thread rail owns it by default;
|
|
123
|
-
* hosts that compose their own rail header may keep the shell fallback in
|
|
124
|
-
* the main bar and render `closeSidebar` themselves.
|
|
125
|
-
*/
|
|
126
|
-
sidebarTogglePlacement?: React.ComponentProps<typeof ResponsiveSidebarShell>["sidebarTogglePlacement"];
|
|
127
|
-
/**
|
|
128
|
-
* Visible surface. Omit for internal state. A controlled `view` naming a
|
|
129
|
-
* panel that does not exist renders the conversation alone — it is never
|
|
130
|
-
* silently substituted with another panel.
|
|
131
|
-
*/
|
|
132
|
-
view?: ThinkFullAppView;
|
|
133
|
-
/**
|
|
134
|
-
* Uncontrolled starting view. Ignored when `view` is set. Omit it to open
|
|
135
|
-
* Files beside the conversation on a wide app when a workspace exists, and
|
|
136
|
-
* to stay on chat at compact (extension) widths.
|
|
137
|
-
*/
|
|
138
|
-
defaultView?: ThinkFullAppView;
|
|
139
|
-
/** Called when the built-in switch (or a collapse) asks for another view. */
|
|
140
|
-
onViewChange?: (view: ThinkFullAppView) => void;
|
|
141
|
-
}
|
|
142
|
-
/** Combines ThinkChat with a resizable workbench. Wide apps with a workspace
|
|
143
|
-
* open Files beside the conversation; compact (extension) widths stay on chat
|
|
144
|
-
* until a view is selected. */
|
|
145
|
-
declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage>({
|
|
146
|
-
bar,
|
|
15
|
+
declare function ThinkFullAppRoot({
|
|
16
|
+
workbenchOpen,
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}: ThinkFullAppRootProps): React.JSX.Element;
|
|
21
|
+
interface ThinkFullAppConversationProps extends useRender.ComponentProps<"section"> {}
|
|
22
|
+
/** Persistent conversation lane. Its contents and SDK providers belong to the caller. */
|
|
23
|
+
declare function ThinkFullAppConversation({
|
|
24
|
+
render,
|
|
25
|
+
className,
|
|
26
|
+
ref,
|
|
27
|
+
...props
|
|
28
|
+
}: ThinkFullAppConversationProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
29
|
+
interface ThinkFullAppWorkbenchProps extends useRender.ComponentProps<"aside"> {}
|
|
30
|
+
/** The single raised output plane. Unmounts its content when the host closes it. */
|
|
31
|
+
declare function ThinkFullAppWorkbench({
|
|
32
|
+
render,
|
|
147
33
|
className,
|
|
148
|
-
conversation,
|
|
149
|
-
defaultView: defaultViewProp,
|
|
150
|
-
messages,
|
|
151
|
-
onViewChange,
|
|
152
|
-
plugins,
|
|
153
34
|
ref,
|
|
154
|
-
renderAgentToolRunLink,
|
|
155
|
-
sourceKey,
|
|
156
|
-
sidebarTogglePlacement,
|
|
157
|
-
style,
|
|
158
|
-
threadSidebar,
|
|
159
|
-
threadStatusSummary,
|
|
160
|
-
view,
|
|
161
|
-
workbenchPanels,
|
|
162
|
-
workspace,
|
|
163
35
|
...props
|
|
164
|
-
}:
|
|
165
|
-
|
|
166
|
-
|
|
36
|
+
}: ThinkFullAppWorkbenchProps): React.JSX.Element | null;
|
|
37
|
+
interface ThinkFullAppResizeHandleProps extends ResizableSidePanelHandleProps {}
|
|
38
|
+
/** Keyboard and pointer resize control; absent while the workbench is closed. */
|
|
39
|
+
declare function ThinkFullAppResizeHandle({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}: ThinkFullAppResizeHandleProps): React.JSX.Element | null;
|
|
43
|
+
declare const ThinkFullApp: {
|
|
44
|
+
Root: typeof ThinkFullAppRoot;
|
|
45
|
+
Conversation: typeof ThinkFullAppConversation;
|
|
46
|
+
Workbench: typeof ThinkFullAppWorkbench;
|
|
47
|
+
ResizeHandle: typeof ThinkFullAppResizeHandle;
|
|
48
|
+
};
|
|
167
49
|
//#endregion
|
|
168
|
-
export { ThinkFullApp,
|
|
50
|
+
export { ThinkFullApp, ThinkFullAppConversationProps, ThinkFullAppResizeHandleProps, ThinkFullAppRootProps, ThinkFullAppWorkbenchProps };
|
|
@@ -1,306 +1,87 @@
|
|
|
1
|
-
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { S as FileIcon, c as BoxIcon, r as ArrowLeftIcon, y as EllipsisIcon } from "../../icons-CeGfXO21.js";
|
|
3
|
-
import { IconButton } from "../foundations/IconButton.js";
|
|
4
|
-
import { Menu } from "../foundations/Menu.js";
|
|
5
|
-
import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
1
|
+
import { n as mergeBaseClassName, t as cx } from "../../class-names-BiMDVpUo.js";
|
|
6
2
|
import { ResizableSidePanel } from "../general-purpose/ResizableSidePanel.js";
|
|
7
|
-
import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
|
|
8
|
-
import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../../WorkspaceLink-B1d2GIGl.js";
|
|
9
|
-
import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-DiI6hhDP.js";
|
|
10
|
-
import { McpPluginCatalog } from "./McpPluginCatalog.js";
|
|
11
|
-
import { ThinkFullAppViewSwitch } from "./ThinkFullAppViewSwitch.js";
|
|
12
|
-
import { ThinkThreadStatusIndicators } from "./ThinkThreadPicker.js";
|
|
13
|
-
import { useWorkspace } from "./Workspace.js";
|
|
14
|
-
import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
|
|
15
|
-
import { useWorkspaceLiveQueries } from "./WorkspaceLive.js";
|
|
16
3
|
import * as React from "react";
|
|
17
|
-
import {
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
18
7
|
//#region src/components/agents-sdk/ThinkFullApp.tsx
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/** Keep in lockstep with --sigvelo-layout-break-compact / the 56rem @container. */
|
|
25
|
-
function compactBreakPx(el) {
|
|
26
|
-
const raw = getComputedStyle(el).getPropertyValue("--sigvelo-layout-break-compact").trim();
|
|
27
|
-
if (raw.endsWith("rem")) return Number.parseFloat(raw) * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
28
|
-
const px = Number.parseFloat(raw);
|
|
29
|
-
return Number.isFinite(px) ? px : 896;
|
|
30
|
-
}
|
|
31
|
-
function isCompactApp(el) {
|
|
32
|
-
return el.getBoundingClientRect().width <= compactBreakPx(el);
|
|
33
|
-
}
|
|
34
|
-
function ThinkFullAppCompactViewMenu({ activeView, onViewChange, views }) {
|
|
35
|
-
return /* @__PURE__ */ jsx("div", {
|
|
36
|
-
className: "think-full-app__compact-view-menu",
|
|
37
|
-
children: /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(IconButton, {
|
|
38
|
-
label: "More views",
|
|
39
|
-
tooltip: "More views",
|
|
40
|
-
render: /* @__PURE__ */ jsx(Menu.Trigger, { unstyled: true }),
|
|
41
|
-
variant: "ghost",
|
|
42
|
-
color: "neutral",
|
|
43
|
-
size: "sm",
|
|
44
|
-
children: /* @__PURE__ */ jsx(EllipsisIcon, {})
|
|
45
|
-
}), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
46
|
-
side: "bottom",
|
|
47
|
-
align: "end",
|
|
48
|
-
sideOffset: 4,
|
|
49
|
-
children: /* @__PURE__ */ jsx(Menu.Popup, { children: views.map((view) => /* @__PURE__ */ jsxs(Menu.Item, {
|
|
50
|
-
"aria-current": activeView === view.id ? "page" : void 0,
|
|
51
|
-
onClick: () => onViewChange(view.id),
|
|
52
|
-
children: [view.icon, view.label]
|
|
53
|
-
}, view.id)) })
|
|
54
|
-
}) })] })
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
function WorkspacePanel({ config }) {
|
|
58
|
-
const selectedPath = config.navigation.current.destination.kind === "file" ? config.navigation.current.destination.path : null;
|
|
59
|
-
return /* @__PURE__ */ jsx(WorkspaceExplorer, {
|
|
60
|
-
className: "think-full-app__workbench",
|
|
61
|
-
workspace: useWorkspace({
|
|
62
|
-
source: config.source,
|
|
63
|
-
sourceKey: config.sourceKey,
|
|
64
|
-
root: config.root,
|
|
65
|
-
selectedPath,
|
|
66
|
-
resolveFileAsset: config.resolveFileAsset,
|
|
67
|
-
maxInlineAssetBytes: config.maxInlineAssetBytes
|
|
68
|
-
}),
|
|
69
|
-
navigation: config.navigation,
|
|
70
|
-
leading: config.leading,
|
|
71
|
-
actions: config.actions
|
|
72
|
-
});
|
|
8
|
+
const WorkbenchOpenContext = React.createContext(null);
|
|
9
|
+
function useWorkbenchOpen() {
|
|
10
|
+
const open = React.useContext(WorkbenchOpenContext);
|
|
11
|
+
if (open === null) throw new Error("ThinkFullApp parts must be inside ThinkFullApp.Root.");
|
|
12
|
+
return open;
|
|
73
13
|
}
|
|
74
14
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
15
|
+
* Conversation/workbench layout, independent of routing and SDK connections.
|
|
16
|
+
* Compose navigation outside the root. The conversation remains mounted while
|
|
17
|
+
* compact layouts show the workbench; ResizableSidePanel owns desktop resizing.
|
|
77
18
|
*/
|
|
78
|
-
function
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
messages
|
|
99
|
-
]);
|
|
100
|
-
return /* @__PURE__ */ jsx(ThinkChat.Provider, {
|
|
101
|
-
chat,
|
|
102
|
-
agentTools,
|
|
103
|
-
children: /* @__PURE__ */ jsx(ThinkChat.Messages, {
|
|
104
|
-
...resolvedMessages,
|
|
105
|
-
renderAgentToolRunLink
|
|
19
|
+
function ThinkFullAppRoot({ workbenchOpen, children, className, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(WorkbenchOpenContext.Provider, {
|
|
21
|
+
value: workbenchOpen,
|
|
22
|
+
children: /* @__PURE__ */ jsx(ResizableSidePanel.Root, {
|
|
23
|
+
label: "conversation",
|
|
24
|
+
side: "start",
|
|
25
|
+
sizeVariable: "--think-full-app-conversation-size",
|
|
26
|
+
defaultSize: 392,
|
|
27
|
+
minSize: 320,
|
|
28
|
+
maxSize: 640,
|
|
29
|
+
keyboardStep: 24,
|
|
30
|
+
...props,
|
|
31
|
+
className: cx("think-full-app", className),
|
|
32
|
+
"data-has-workbench": workbenchOpen ? "true" : "false",
|
|
33
|
+
"data-mobile-view": workbenchOpen ? "workbench" : "chat",
|
|
34
|
+
"data-recipe": "fill-host",
|
|
35
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: "think-full-app__view-scope",
|
|
37
|
+
children
|
|
38
|
+
})
|
|
106
39
|
})
|
|
107
40
|
});
|
|
108
41
|
}
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
sourceKey: workspace?.sourceKey,
|
|
121
|
-
root: workspace?.root ?? "/",
|
|
122
|
-
revision: workspace?.revision
|
|
123
|
-
});
|
|
124
|
-
const appRef = React.useRef(null);
|
|
125
|
-
const workbenchPanelRef = React.useRef(null);
|
|
126
|
-
const pendingPanelFocusRef = React.useRef(null);
|
|
127
|
-
const [innerView, setInnerView] = React.useState(defaultViewProp ?? "chat");
|
|
128
|
-
const userChoseView = React.useRef(defaultViewProp !== void 0 || view !== void 0);
|
|
129
|
-
const requestedView = view ?? innerView;
|
|
130
|
-
const setView = React.useCallback((next) => {
|
|
131
|
-
userChoseView.current = true;
|
|
132
|
-
if (view === void 0) setInnerView(next);
|
|
133
|
-
onViewChange?.(next);
|
|
134
|
-
}, [onViewChange, view]);
|
|
135
|
-
React.useLayoutEffect(() => {
|
|
136
|
-
if (view !== void 0 || defaultViewProp !== void 0 || userChoseView.current) return;
|
|
137
|
-
if (workspace === void 0) return;
|
|
138
|
-
const el = appRef.current;
|
|
139
|
-
if (!el) return;
|
|
140
|
-
const syncViewToWidth = () => {
|
|
141
|
-
if (userChoseView.current) return;
|
|
142
|
-
const next = isCompactApp(el) ? "chat" : "files";
|
|
143
|
-
setInnerView((current) => current === next ? current : next);
|
|
144
|
-
};
|
|
145
|
-
syncViewToWidth();
|
|
146
|
-
const observer = new ResizeObserver(syncViewToWidth);
|
|
147
|
-
observer.observe(el);
|
|
148
|
-
return () => observer.disconnect();
|
|
149
|
-
}, [
|
|
150
|
-
defaultViewProp,
|
|
151
|
-
view,
|
|
152
|
-
workspace
|
|
153
|
-
]);
|
|
154
|
-
const availableWorkbenchPanels = [];
|
|
155
|
-
if (workspace !== void 0) availableWorkbenchPanels.push({
|
|
156
|
-
id: "files",
|
|
157
|
-
label: "Files",
|
|
158
|
-
icon: /* @__PURE__ */ jsx(FileIcon, {}),
|
|
159
|
-
render: () => /* @__PURE__ */ jsx(WorkspacePanel, { config: workspace })
|
|
42
|
+
/** Persistent conversation lane. Its contents and SDK providers belong to the caller. */
|
|
43
|
+
function ThinkFullAppConversation({ render, className, ref, ...props }) {
|
|
44
|
+
useWorkbenchOpen();
|
|
45
|
+
return useRender({
|
|
46
|
+
defaultTagName: "section",
|
|
47
|
+
render,
|
|
48
|
+
ref,
|
|
49
|
+
props: mergeProps({
|
|
50
|
+
"aria-label": "Conversation",
|
|
51
|
+
className: mergeBaseClassName("think-full-app__chat-surface", className)
|
|
52
|
+
}, props)
|
|
160
53
|
});
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
54
|
+
}
|
|
55
|
+
/** The single raised output plane. Unmounts its content when the host closes it. */
|
|
56
|
+
function ThinkFullAppWorkbench({ render, className, ref, ...props }) {
|
|
57
|
+
const open = useWorkbenchOpen();
|
|
58
|
+
const element = useRender({
|
|
59
|
+
defaultTagName: "aside",
|
|
60
|
+
render,
|
|
61
|
+
ref,
|
|
62
|
+
props: mergeProps({
|
|
63
|
+
"aria-label": "Workbench",
|
|
64
|
+
tabIndex: -1,
|
|
65
|
+
className: mergeBaseClassName("think-full-app__aside", className)
|
|
66
|
+
}, props)
|
|
166
67
|
});
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const activeMobileView = hasWorkbench ? "workbench" : "chat";
|
|
171
|
-
const hasAppBarRow = Boolean(bar?.back || bar?.leading || bar?.compactLeading || bar?.title || bar?.actions || bar?.primary || bar?.views || threadSidebar) || availableWorkbenchPanels.length > 0;
|
|
172
|
-
React.useLayoutEffect(() => {
|
|
173
|
-
const pendingFocus = pendingPanelFocusRef.current;
|
|
174
|
-
if (!pendingFocus || pendingFocus.id !== activePanel?.id) return;
|
|
175
|
-
pendingPanelFocusRef.current = null;
|
|
176
|
-
Array.from(workbenchPanelRef.current?.querySelectorAll("button") ?? []).find((button) => button.getAttribute("aria-label") === pendingFocus.label)?.focus({ preventScroll: true });
|
|
177
|
-
}, [activePanel?.id]);
|
|
178
|
-
const updateView = (next) => {
|
|
179
|
-
const activeElement = document.activeElement;
|
|
180
|
-
const restorePanelSwitchFocus = activeElement instanceof HTMLElement && workbenchPanelRef.current?.contains(activeElement);
|
|
181
|
-
const nextLabel = availableWorkbenchPanels.find((panel) => panel.id === next)?.label;
|
|
182
|
-
pendingPanelFocusRef.current = restorePanelSwitchFocus && nextLabel ? {
|
|
183
|
-
id: next,
|
|
184
|
-
label: nextLabel
|
|
185
|
-
} : null;
|
|
186
|
-
React.startTransition(() => setView(next));
|
|
187
|
-
};
|
|
188
|
-
const viewSwitch = bar?.views === void 0 && availableWorkbenchPanels.length ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
|
|
189
|
-
views: availableWorkbenchPanels,
|
|
190
|
-
value: activePanel?.id,
|
|
191
|
-
allowEmpty: true,
|
|
192
|
-
"aria-label": "App views",
|
|
193
|
-
onValueChange: (next) => updateView(next ?? "chat")
|
|
194
|
-
}) : bar?.views ?? null;
|
|
195
|
-
const compactViewMenu = bar?.views === void 0 && availableWorkbenchPanels.length ? /* @__PURE__ */ jsx(ThinkFullAppCompactViewMenu, {
|
|
196
|
-
activeView: activePanel?.id,
|
|
197
|
-
views: availableWorkbenchPanels,
|
|
198
|
-
onViewChange: updateView
|
|
68
|
+
return open ? /* @__PURE__ */ jsx(React.ViewTransition, {
|
|
69
|
+
default: "sigvelo-layout-transition",
|
|
70
|
+
children: element
|
|
199
71
|
}) : null;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
] }) : void 0;
|
|
205
|
-
const compactLeading = bar?.compactLeading !== void 0 ? bar.compactLeading : activePanel ? /* @__PURE__ */ jsx(IconButton, {
|
|
206
|
-
type: "button",
|
|
207
|
-
label: "Back to chat",
|
|
208
|
-
tooltip: "Back to chat",
|
|
209
|
-
variant: "ghost",
|
|
210
|
-
color: "neutral",
|
|
211
|
-
size: "sm",
|
|
212
|
-
onClick: () => updateView("chat"),
|
|
213
|
-
children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
|
|
214
|
-
}) : void 0;
|
|
215
|
-
const appContent = /* @__PURE__ */ jsxs(ResizableSidePanel.Root, {
|
|
216
|
-
ref: mergeRefs(appRef, ref),
|
|
217
|
-
className: cx("think-full-app", className),
|
|
218
|
-
label: "workbench",
|
|
219
|
-
side: "start",
|
|
220
|
-
sizeVariable: "--think-full-app-conversation-size",
|
|
221
|
-
defaultSize: conversationDefaultWidth,
|
|
222
|
-
minSize: conversationMinWidth,
|
|
223
|
-
maxSize: conversationMaxWidth,
|
|
224
|
-
keyboardStep: conversationKeyboardStep,
|
|
225
|
-
"data-has-workbench": hasWorkbench ? "true" : "false",
|
|
226
|
-
"data-mobile-view": activeMobileView,
|
|
227
|
-
style,
|
|
72
|
+
}
|
|
73
|
+
/** Keyboard and pointer resize control; absent while the workbench is closed. */
|
|
74
|
+
function ThinkFullAppResizeHandle({ className, ...props }) {
|
|
75
|
+
return useWorkbenchOpen() ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, {
|
|
228
76
|
...props,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
className: "think-full-app__view-scope",
|
|
232
|
-
"data-mobile-view": activeMobileView,
|
|
233
|
-
children: [/* @__PURE__ */ jsx("section", {
|
|
234
|
-
className: "think-full-app__chat-surface",
|
|
235
|
-
"data-workspace-restoration-scope": "chat",
|
|
236
|
-
"aria-label": "Chat",
|
|
237
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
238
|
-
className: "think-full-app__chat",
|
|
239
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
240
|
-
className: "think-full-app__chat-inner",
|
|
241
|
-
children: conversation ? /* @__PURE__ */ jsx(ThinkFullAppThreadChat, {
|
|
242
|
-
...conversation,
|
|
243
|
-
messages,
|
|
244
|
-
renderAgentToolRunLink,
|
|
245
|
-
sourceKey
|
|
246
|
-
}) : /* @__PURE__ */ jsx(ThinkChat.Messages, {
|
|
247
|
-
...messages,
|
|
248
|
-
renderAgentToolRunLink
|
|
249
|
-
})
|
|
250
|
-
})
|
|
251
|
-
})
|
|
252
|
-
}), activePanel ? /* @__PURE__ */ jsx("aside", {
|
|
253
|
-
className: "think-full-app__aside",
|
|
254
|
-
"aria-label": "Workbench",
|
|
255
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
256
|
-
className: "think-full-app__workbench-slot",
|
|
257
|
-
children: /* @__PURE__ */ jsx(React.ViewTransition, {
|
|
258
|
-
default: "sigvelo-layout-transition",
|
|
259
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
260
|
-
ref: workbenchPanelRef,
|
|
261
|
-
className: "think-full-app__workbench-panel",
|
|
262
|
-
tabIndex: -1,
|
|
263
|
-
children: activePanel.render()
|
|
264
|
-
})
|
|
265
|
-
})
|
|
266
|
-
})
|
|
267
|
-
}) : null]
|
|
268
|
-
}), activePanel ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "think-full-app__resizer" }) : null]
|
|
269
|
-
});
|
|
270
|
-
const app = workspace ? /* @__PURE__ */ jsx(WorkspaceNavigationProvider, {
|
|
271
|
-
root: workspace.root ?? "/",
|
|
272
|
-
base: {
|
|
273
|
-
kind: "directory",
|
|
274
|
-
path: workspace.root ?? "/"
|
|
275
|
-
},
|
|
276
|
-
navigation: workspace.navigation,
|
|
277
|
-
children: /* @__PURE__ */ jsxs(WorkspaceNavigationRestorationBoundary, { children: [/* @__PURE__ */ jsx(WorkspaceNavigationFocusRestorer, {
|
|
278
|
-
entryKey: workspace.navigation.current.key,
|
|
279
|
-
rootRef: appRef,
|
|
280
|
-
scope: "chat"
|
|
281
|
-
}), appContent] })
|
|
282
|
-
}) : appContent;
|
|
283
|
-
return /* @__PURE__ */ jsx(ResponsiveSidebarShell, {
|
|
284
|
-
className: "think-full-app-shell",
|
|
285
|
-
sidebar: threadSidebar,
|
|
286
|
-
sidebarLabel: "threads",
|
|
287
|
-
sidebarTogglePlacement,
|
|
288
|
-
showMainLabel: "Show selected thread",
|
|
289
|
-
bar: {
|
|
290
|
-
...bar,
|
|
291
|
-
actions: appBarActions,
|
|
292
|
-
compactLeading,
|
|
293
|
-
primary: bar?.primary,
|
|
294
|
-
className: "think-full-app__app-bar",
|
|
295
|
-
label: "Workbench controls",
|
|
296
|
-
hidden: !hasAppBarRow,
|
|
297
|
-
compactTitleTrigger: threadSidebar ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
298
|
-
className: "sigvelo-truncate",
|
|
299
|
-
children: bar?.title ?? "Threads"
|
|
300
|
-
}), threadStatusSummary ? /* @__PURE__ */ jsx(ThinkThreadStatusIndicators, { summary: threadStatusSummary }) : null] }) : void 0
|
|
301
|
-
},
|
|
302
|
-
children: app
|
|
303
|
-
});
|
|
77
|
+
className: mergeBaseClassName("think-full-app__resizer", className)
|
|
78
|
+
}) : null;
|
|
304
79
|
}
|
|
80
|
+
const ThinkFullApp = {
|
|
81
|
+
Root: ThinkFullAppRoot,
|
|
82
|
+
Conversation: ThinkFullAppConversation,
|
|
83
|
+
Workbench: ThinkFullAppWorkbench,
|
|
84
|
+
ResizeHandle: ThinkFullAppResizeHandle
|
|
85
|
+
};
|
|
305
86
|
//#endregion
|
|
306
87
|
export { ThinkFullApp };
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ThinkChatValue } from "./ThinkChatContext.js";
|
|
2
|
+
import { UIMessage } from "ai";
|
|
3
|
+
|
|
4
|
+
//#region src/components/agents-sdk/ThinkRecoveryNotice.d.ts
|
|
5
|
+
interface ThinkRecoveryNoticeProps<State = unknown, MessageT extends UIMessage = UIMessage> {
|
|
6
|
+
/** The complete `useAgentChat` value from `@cloudflare/think/react`. */
|
|
7
|
+
chat: ThinkChatValue<State, MessageT>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Native Think recovery, connection, and turn-error content for AgentChat's
|
|
11
|
+
* persistent polite notice region. Think exposes no recovery phase, progress,
|
|
12
|
+
* checkpoint, attempt count, or timeline to the browser, so this adapter does
|
|
13
|
+
* not claim those details.
|
|
14
|
+
*/
|
|
15
|
+
declare function ThinkRecoveryNotice<State = unknown, MessageT extends UIMessage = UIMessage>({
|
|
16
|
+
chat
|
|
17
|
+
}: ThinkRecoveryNoticeProps<State, MessageT>): import("react").JSX.Element | null;
|
|
18
|
+
//#endregion
|
|
2
19
|
export { ThinkRecoveryNotice, ThinkRecoveryNoticeProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AgentChatTurnError } from "../ai-sdk/AgentChatTurnError.js";
|
|
2
1
|
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
2
|
+
import { AgentChatTurnError } from "../ai-sdk/AgentChatTurnError.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/agents-sdk/ThinkRecoveryNotice.tsx
|
|
5
5
|
function connectionReason(error) {
|