@mcp-b/react-components 0.17.0 → 0.19.0
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/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
- package/dist/{AgentChat-CRuMi1Pb.d.ts → AgentChat-ClxViuUM.d.ts} +1 -20
- package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
- package/dist/{CodeBlock-Co1noLbC.js → CodeBlock-Bb-IPBc_.js} +9 -6
- package/dist/{CodeBlock-Dnpr88ZQ.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
- package/dist/{FileTree-B7bBsUyU.js → FileTree-CUlXfnmc.js} +42 -16
- package/dist/{Message-C4eYRogZ.js → Message-rZEaaD8Q.js} +13 -20
- package/dist/{ModelSelector-BNrZlY_Y.js → ModelSelector-4GsCWcZV.js} +15 -22
- package/dist/{PromptInput-OLfXPuHM.d.ts → PromptInput-Bdh9pqlo.d.ts} +4 -6
- package/dist/{Select-CwSqP07Y.d.ts → Select-B_13gg_J.d.ts} +2 -2
- package/dist/{Tabs-9zddXDQo.d.ts → Tabs-ColWK-XA.d.ts} +10 -2
- package/dist/{ThinkChat-DInElus-.js → ThinkChat-15EhfvYJ.js} +84 -61
- package/dist/{ThinkChatActivity-BgesTfZ4.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +4 -7
- package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
- package/dist/{Toggle-DaXpe1Lc.d.ts → Toggle-JKZ43D5S.d.ts} +1 -1
- package/dist/{ToggleGroup-yseEWkOC.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +2 -2
- package/dist/Workspace-Jez8ffUj.d.ts +274 -0
- package/dist/{WorkspaceExplorer-sZewzT2O.d.ts → WorkspaceExplorer-B9dQWNVK.d.ts} +2 -2
- package/dist/{WorkspaceFile-C8UzuSH4.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
- package/dist/{WorkspaceFileView-DNdGAEiX.js → WorkspaceFileView-CEdArlOT.js} +120 -127
- package/dist/{WorkspaceLink-B1ykV1dS.js → WorkspaceLink-BYYeTQLf.js} +6 -27
- package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
- package/dist/{class-names-Bk-QLWWI.js → class-names-BiMDVpUo.js} +4 -1
- package/dist/components/Accordion.js +7 -2
- package/dist/components/Activity.js +2 -2
- package/dist/components/AgentActivity.d.ts +1 -1
- package/dist/components/AgentActivity.js +4 -5
- package/dist/components/AgentActivityPreview.d.ts +9 -9
- package/dist/components/AgentActivityPreview.js +8 -12
- package/dist/components/AgentAttention.d.ts +1 -1
- package/dist/components/AgentAttention.js +1 -1
- package/dist/components/AgentChat.d.ts +1 -1
- package/dist/components/AgentChat.js +94 -62
- package/dist/components/AgentChatMessageEditor.js +2 -2
- package/dist/components/AgentChatTurnError.js +2 -2
- package/dist/components/AgentConnection.js +3 -3
- package/dist/components/AgentMessageParts.js +1 -1
- package/dist/components/AgentToolDetail.d.ts +6 -4
- package/dist/components/AgentToolDetail.js +12 -10
- package/dist/components/AlertDialog.js +1 -1
- package/dist/components/AppTopBar.d.ts +24 -7
- package/dist/components/AppTopBar.js +32 -8
- package/dist/components/Approval.js +4 -4
- package/dist/components/Artifact.d.ts +1 -1
- package/dist/components/Artifact.js +6 -4
- package/dist/components/Autocomplete.js +1 -1
- package/dist/components/Avatar.d.ts +1 -1
- package/dist/components/Avatar.js +2 -2
- package/dist/components/Badge.js +3 -0
- package/dist/components/BrowserLiveView.js +27 -12
- package/dist/components/BrowserReplay.js +4 -3
- package/dist/components/BrowserRunPanel.js +5 -5
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Button.js +14 -11
- package/dist/components/Card.d.ts +7 -8
- package/dist/components/Card.js +19 -10
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +2 -2
- package/dist/components/ChatGptSignInScreen.js +8 -8
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/CheckboxGroup.js +1 -1
- package/dist/components/Checkpoint.js +2 -2
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.js +35 -15
- package/dist/components/Collapsible.js +2 -2
- package/dist/components/Combobox.js +1 -1
- package/dist/components/Commit.d.ts +1 -1
- package/dist/components/Commit.js +3 -3
- package/dist/components/Context.js +1 -1
- package/dist/components/ContextMenu.js +2 -2
- package/dist/components/Conversation.d.ts +1 -1
- package/dist/components/Conversation.js +5 -4
- package/dist/components/DescriptionListParts.js +1 -1
- package/dist/components/Dialog.js +1 -1
- package/dist/components/EnvironmentVariables.d.ts +1 -1
- package/dist/components/EnvironmentVariables.js +3 -3
- package/dist/components/Field.js +5 -2
- package/dist/components/Fieldset.js +1 -1
- package/dist/components/FileTree.d.ts +6 -0
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Form.js +1 -1
- package/dist/components/GithubMotionMark.js +1 -1
- package/dist/components/IconButton.d.ts +2 -3
- package/dist/components/IconButton.js +2 -1
- package/dist/components/InlineCitation.js +1 -1
- package/dist/components/Input.js +1 -1
- package/dist/components/Marker.js +1 -1
- package/dist/components/McpConnectionRequest.js +2 -2
- package/dist/components/McpServerPicker.js +2 -2
- package/dist/components/MediaPreviewCard.d.ts +103 -0
- package/dist/components/MediaPreviewCard.js +193 -0
- package/dist/components/Menu.js +1 -1
- package/dist/components/Menubar.js +2 -2
- package/dist/components/Message.d.ts +4 -1
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.d.ts +1 -1
- package/dist/components/MessageScroller.js +5 -4
- package/dist/components/Meter.js +1 -1
- package/dist/components/ModelSelector.d.ts +4 -3
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/NumberField.js +1 -1
- package/dist/components/Plan.js +2 -2
- package/dist/components/Popover.js +1 -1
- package/dist/components/PreviewCard.js +1 -1
- package/dist/components/PricingBillingToggle.js +1 -1
- package/dist/components/PricingFAQ.js +1 -1
- package/dist/components/PricingPage.js +2 -1
- package/dist/components/PricingPlanCard.js +4 -3
- package/dist/components/PricingUsageCalculator.js +2 -2
- package/dist/components/Progress.js +1 -1
- package/dist/components/PromptInput.d.ts +1 -1
- package/dist/components/PromptInput.js +31 -18
- package/dist/components/Queue.d.ts +1 -1
- package/dist/components/Queue.js +2 -3
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/Reasoning.js +3 -6
- package/dist/components/ResizableSidePanel.js +1 -1
- package/dist/components/ResponsiveSidebarShell.js +16 -10
- package/dist/components/ScrollArea.js +2 -1
- package/dist/components/SearchField.d.ts +43 -0
- package/dist/components/SearchField.js +52 -0
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/Select.js +5 -6
- package/dist/components/Separator.js +1 -1
- package/dist/components/Slider.js +1 -1
- package/dist/components/Sources.js +2 -2
- package/dist/components/Stepper.js +16 -9
- package/dist/components/SubagentRunDetails.js +1 -1
- package/dist/components/SubagentRunIndicator.js +2 -2
- package/dist/components/SubagentRunList.d.ts +3 -5
- package/dist/components/SubagentRunList.js +3 -4
- package/dist/components/SubagentRunSelector.d.ts +8 -12
- package/dist/components/SubagentRunSelector.js +17 -20
- package/dist/components/Switch.d.ts +2 -2
- package/dist/components/Switch.js +4 -5
- package/dist/components/Tabs.d.ts +2 -2
- package/dist/components/Tabs.js +12 -3
- package/dist/components/Task.js +2 -2
- package/dist/components/Terminal.d.ts +2 -2
- package/dist/components/Terminal.js +5 -4
- package/dist/components/TestResults.js +10 -6
- package/dist/components/Textarea.js +1 -1
- package/dist/components/ThemeModeControl.js +1 -1
- package/dist/components/ThinkChat.d.ts +33 -20
- package/dist/components/ThinkChat.js +4 -4
- package/dist/components/ThinkChatActivity.d.ts +2 -2
- package/dist/components/ThinkChatActivity.js +8 -10
- package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
- package/dist/components/ThinkChatActivitySummary.js +7 -3
- package/dist/components/ThinkChatToolPanels.js +26 -16
- package/dist/components/ThinkExecutionDetail.js +2 -2
- package/dist/components/ThinkExecutionStatus.js +2 -2
- package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
- package/dist/components/ThinkExecutionWorkbench.js +70 -134
- package/dist/components/ThinkFullApp.d.ts +36 -35
- package/dist/components/ThinkFullApp.js +156 -109
- package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/ThinkFullAppViewSwitch.js +1 -1
- package/dist/components/ThinkRecoveryNotice.js +18 -12
- package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
- package/dist/components/ThinkRoutineBrowser.js +33 -40
- package/dist/components/ThinkRoutineDetail.d.ts +5 -2
- package/dist/components/ThinkRoutineDetail.js +4 -4
- package/dist/components/ThinkRoutineForm.d.ts +3 -2
- package/dist/components/ThinkRoutineForm.js +11 -10
- package/dist/components/ThinkRoutineLibrary.d.ts +24 -31
- package/dist/components/ThinkRoutineLibrary.js +57 -80
- package/dist/components/ThinkRoutineRuns.d.ts +3 -2
- package/dist/components/ThinkRoutineRuns.js +31 -24
- package/dist/components/ThinkThreadPicker.d.ts +17 -11
- package/dist/components/ThinkThreadPicker.js +163 -39
- package/dist/components/Toast.js +1 -1
- package/dist/components/Toggle.d.ts +1 -1
- package/dist/components/Toggle.js +9 -7
- package/dist/components/ToggleGroup.d.ts +1 -1
- package/dist/components/ToggleGroup.js +15 -13
- package/dist/components/ToolInvocation.js +1 -1
- package/dist/components/Toolbar.js +1 -1
- package/dist/components/Tooltip.d.ts +8 -1
- package/dist/components/Tooltip.js +11 -2
- package/dist/components/TransitionSurface.d.ts +27 -0
- package/dist/components/TransitionSurface.js +20 -0
- package/dist/components/WebPreview.d.ts +5 -5
- package/dist/components/WebPreview.js +68 -54
- package/dist/components/Workspace.d.ts +2 -2
- package/dist/components/Workspace.js +358 -328
- package/dist/components/WorkspaceBrowser.d.ts +4 -7
- package/dist/components/WorkspaceBrowser.js +15 -25
- package/dist/components/WorkspaceExplorer.d.ts +5 -5
- package/dist/components/WorkspaceExplorer.js +19 -32
- package/dist/components/WorkspaceFile.d.ts +1 -1
- package/dist/components/WorkspaceFileView.d.ts +14 -2
- package/dist/components/WorkspaceFileView.js +1 -1
- package/dist/components/WorkspaceHeader.d.ts +0 -8
- package/dist/components/WorkspaceHeader.js +3 -15
- package/dist/components/WorkspaceLink.d.ts +1 -1
- package/dist/components/WorkspaceLink.js +1 -1
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-cYsJBauI.js → copy-button-BtRwhRks.js} +3 -2
- package/dist/{copy-button-CQx3LQAC.d.ts → copy-button-D7aAYA-2.d.ts} +1 -1
- package/dist/{icons--FqCZEc3.js → icons-DKXiSepE.js} +7 -3
- package/dist/{icons-DpUqY8Mp.d.ts → icons-DkRtZmvT.d.ts} +22 -2
- package/dist/navigation-link-Cob7KBlM.js +19 -0
- package/dist/styles/accordion.css +4 -19
- package/dist/styles/activity.css +48 -56
- package/dist/styles/agent-activity-preview.css +2 -0
- package/dist/styles/agent-chat.css +14 -22
- package/dist/styles/alert-dialog.css +16 -18
- package/dist/styles/app-top-bar.css +17 -9
- package/dist/styles/approval.css +11 -6
- package/dist/styles/artifact.css +6 -6
- package/dist/styles/autocomplete.css +2 -1
- package/dist/styles/avatar.css +35 -30
- package/dist/styles/badge.css +10 -10
- package/dist/styles/base-ui-motion.css +94 -39
- package/dist/styles/browser-control-overlay.css +0 -1
- package/dist/styles/browser-live-view.css +39 -22
- package/dist/styles/browser-replay.css +1 -1
- package/dist/styles/browser-run-panel.css +8 -4
- package/dist/styles/button.css +36 -33
- package/dist/styles/card.css +5 -6
- package/dist/styles/chain-of-thought.css +22 -16
- package/dist/styles/checkbox.css +18 -5
- package/dist/styles/codex-model-selector.css +46 -8
- package/dist/styles/collapsible.css +10 -10
- package/dist/styles/combobox.css +3 -2
- package/dist/styles/commit.css +19 -18
- package/dist/styles/composition-motion.css +83 -0
- package/dist/styles/context-menu.css +3 -3
- package/dist/styles/context.css +11 -10
- package/dist/styles/conversation.css +18 -23
- package/dist/styles/dialog.css +15 -15
- package/dist/styles/field.css +32 -12
- package/dist/styles/file-tree.css +69 -9
- package/dist/styles/form.css +1 -1
- package/dist/styles/index.css +5 -0
- package/dist/styles/input.css +2 -2
- package/dist/styles/marker.css +14 -13
- package/dist/styles/mcp-server-picker.css +20 -17
- package/dist/styles/media-preview-card.css +160 -0
- package/dist/styles/menu.css +11 -11
- package/dist/styles/menubar.css +12 -11
- package/dist/styles/message.css +27 -21
- package/dist/styles/meter.css +2 -2
- package/dist/styles/model-selector.css +16 -14
- package/dist/styles/motion-reduction.css +29 -0
- package/dist/styles/navigation-menu.css +14 -30
- package/dist/styles/number-field.css +22 -4
- package/dist/styles/plan.css +5 -0
- package/dist/styles/popover.css +15 -16
- package/dist/styles/preview-card.css +2 -32
- package/dist/styles/progress.css +8 -3
- package/dist/styles/prompt-input.css +87 -70
- package/dist/styles/queue.css +48 -32
- package/dist/styles/radio.css +19 -12
- package/dist/styles/reasoning.css +2 -1
- package/dist/styles/recipes.css +109 -37
- package/dist/styles/resizable-side-panel.css +4 -10
- package/dist/styles/responsive-sidebar-shell.css +16 -15
- package/dist/styles/scroll-area.css +32 -15
- package/dist/styles/search-field.css +21 -0
- package/dist/styles/select.css +19 -12
- package/dist/styles/slider.css +25 -29
- package/dist/styles/sources.css +3 -3
- package/dist/styles/stepper.css +36 -26
- package/dist/styles/subagent-run.css +1 -1
- package/dist/styles/switch.css +32 -29
- package/dist/styles/tabs.css +79 -23
- package/dist/styles/task.css +13 -9
- package/dist/styles/test-results.css +29 -23
- package/dist/styles/theme-mode-control.css +8 -0
- package/dist/styles/think-execution-workbench.css +18 -15
- package/dist/styles/think-full-app.css +45 -68
- package/dist/styles/think-routine-library.css +43 -24
- package/dist/styles/think-thread-picker.css +193 -51
- package/dist/styles/toast.css +48 -27
- package/dist/styles/toggle-group.css +2 -36
- package/dist/styles/toggle.css +29 -5
- package/dist/styles/toolbar.css +25 -27
- package/dist/styles/tooltip.css +2 -32
- package/dist/styles/transition-surface.css +55 -0
- package/dist/styles/workspace-explorer.css +99 -44
- package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
- package/dist/utils/codex-model-catalog.d.ts +2 -8
- package/dist/utils/codex-model-catalog.js +2 -16
- package/dist/utils/mcp-server-catalog.d.ts +139 -0
- package/dist/utils/mcp-server-catalog.js +98 -0
- package/dist/utils/structured-code.d.ts +1 -1
- package/package.json +13 -7
- package/dist/Workspace-C9RFoxcu.d.ts +0 -62
- package/dist/summarize-tool-input-BUJsENSn.js +0 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Collapsible } from "./Collapsible.js";
|
|
3
|
-
import {
|
|
3
|
+
import { K as SpinnerIcon, et as XIcon, p as ChevronRightIcon, u as CheckIcon } from "../icons-DKXiSepE.js";
|
|
4
4
|
import { Badge } from "./Badge.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -45,6 +45,7 @@ const TestResultsContext = React.createContext({});
|
|
|
45
45
|
function TestResults({ className, summary, children, ref, ...props }) {
|
|
46
46
|
const overall = summary && summary.failed > 0 ? "failed" : "passed";
|
|
47
47
|
const contextValue = React.useMemo(() => ({ summary }), [summary]);
|
|
48
|
+
const isComposable = hasComposableTestResultsChildren(children);
|
|
48
49
|
return /* @__PURE__ */ jsx(TestResultsContext.Provider, {
|
|
49
50
|
value: contextValue,
|
|
50
51
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -53,7 +54,7 @@ function TestResults({ className, summary, children, ref, ...props }) {
|
|
|
53
54
|
"data-status": overall,
|
|
54
55
|
...props,
|
|
55
56
|
"data-recipe": "framed-panel",
|
|
56
|
-
children: children
|
|
57
|
+
children: isComposable ? children : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(TestResultsHeader, { children: [/* @__PURE__ */ jsx(TestResultsSummary, {}), /* @__PURE__ */ jsx(TestResultsProgress, {})] }), /* @__PURE__ */ jsx(TestResultsContent, { children })] })
|
|
57
58
|
})
|
|
58
59
|
});
|
|
59
60
|
}
|
|
@@ -85,7 +86,6 @@ function TestResultsSummary({ className, children, ref, ...props }) {
|
|
|
85
86
|
...props,
|
|
86
87
|
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Badge, {
|
|
87
88
|
color: STATUS_COLOR[overall],
|
|
88
|
-
className: "test-results__overall",
|
|
89
89
|
children: overall === "passed" ? "All tests passed" : `${summary.failed} failed`
|
|
90
90
|
}), /* @__PURE__ */ jsxs("span", {
|
|
91
91
|
className: "test-results__stats",
|
|
@@ -129,13 +129,14 @@ function TestResultsProgress({ className, children, ref, ...props }) {
|
|
|
129
129
|
"aria-valuenow": summary.passed,
|
|
130
130
|
"aria-valuetext": `${summary.passed}/${summary.total} tests passed, ${summary.failed} failed`,
|
|
131
131
|
className: "test-results__progress-track",
|
|
132
|
+
"data-slot": "progress-track",
|
|
132
133
|
role: "progressbar",
|
|
133
134
|
children: [/* @__PURE__ */ jsx("div", {
|
|
134
135
|
className: "test-results__progress-segment test-results__progress-segment--passed",
|
|
135
|
-
style: {
|
|
136
|
+
style: { inlineSize: `${passedPercent}%` }
|
|
136
137
|
}), /* @__PURE__ */ jsx("div", {
|
|
137
138
|
className: "test-results__progress-segment test-results__progress-segment--failed",
|
|
138
|
-
style: {
|
|
139
|
+
style: { inlineSize: `${failedPercent}%` }
|
|
139
140
|
})]
|
|
140
141
|
}), /* @__PURE__ */ jsxs("span", {
|
|
141
142
|
className: "test-results__progress-label",
|
|
@@ -158,6 +159,9 @@ function TestResultsContent({ className, children, ref, ...props }) {
|
|
|
158
159
|
children
|
|
159
160
|
});
|
|
160
161
|
}
|
|
162
|
+
function hasComposableTestResultsChildren(children) {
|
|
163
|
+
return React.Children.toArray(children).some((child) => React.isValidElement(child) && (child.type === TestResultsHeader || child.type === TestResultsSummary || child.type === TestResultsProgress || child.type === TestResultsContent));
|
|
164
|
+
}
|
|
161
165
|
const TestSuiteContext = React.createContext({
|
|
162
166
|
name: "",
|
|
163
167
|
status: "passed"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as MoonIcon, P as MonitorIcon, Y as SunIcon } from "../icons-DKXiSepE.js";
|
|
2
2
|
import { Radio, RadioGroup } from "./RadioGroup.js";
|
|
3
3
|
import { useTheme } from "./ThemeProvider.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { i as AgentMessageRenderPartContext } from "../AgentMessageParts-CyD2UB3V.js";
|
|
2
|
-
import { r as AgentChatProps } from "../AgentChat-
|
|
2
|
+
import { r as AgentChatProps } from "../AgentChat-ClxViuUM.js";
|
|
3
3
|
import { i as useOptionalAgentToolRuns, n as AgentToolRunsProvider, r as AgentToolRunsProviderProps, t as AgentToolEventsValue } from "../AgentToolRunsContext-BVe4stgw.js";
|
|
4
4
|
import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-CSzVwMXf.js";
|
|
5
|
-
import { l as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-
|
|
6
|
-
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-
|
|
5
|
+
import { l as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-D1xOrNrq.js";
|
|
6
|
+
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-Bzot45kX.js";
|
|
7
7
|
import { n as ThinkChatValue } from "../ThinkChatContext-DrsZqdaO.js";
|
|
8
8
|
import { n as ThinkRecoveryNoticeProps, t as ThinkRecoveryNotice } from "../ThinkRecoveryNotice-DFIcG9UX.js";
|
|
9
9
|
import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../BrowserLiveView-BV5qgFgI.js";
|
|
10
10
|
import { n as BrowserReplayProps, t as BrowserReplay } from "../BrowserReplay-xWvRjRAC.js";
|
|
11
|
-
import { d as inferWorkspaceLanguage, i as WorkspaceFileState } from "../WorkspaceFile-
|
|
12
|
-
import { a as
|
|
13
|
-
import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../WorkspaceExplorer-
|
|
11
|
+
import { d as inferWorkspaceLanguage, i as WorkspaceFileState } from "../WorkspaceFile-CzyHnESE.js";
|
|
12
|
+
import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceFileStatQueryOptions, f as workspaceInfoQueryOptions, i as WorkspaceQueryKey, l as workspaceDirectoryQueryOptions, m as workspaceTextFileQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceQueryKey, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceFileAssetQueryOptions } from "../Workspace-Jez8ffUj.js";
|
|
13
|
+
import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../WorkspaceExplorer-B9dQWNVK.js";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { UIMessage } from "ai";
|
|
16
16
|
import { UseAgentOptions } from "agents/react";
|
|
17
|
+
import { DataTag, UndefinedInitialDataOptions } from "@tanstack/react-query";
|
|
17
18
|
import { PendingApproval, Think } from "@cloudflare/think";
|
|
18
19
|
import { AgentStub } from "agents/client";
|
|
19
20
|
import { UseVoiceInputReturn } from "@cloudflare/voice/react";
|
|
20
21
|
|
|
21
22
|
//#region src/components/ThinkChat.d.ts
|
|
23
|
+
type ThinkPendingExecutionApprovalsQueryKey = readonly ["think", sourceKey: string, "pending-approvals"];
|
|
24
|
+
type ThinkPendingExecutionApprovalsQueryOptions = UndefinedInitialDataOptions<readonly PendingApproval[], Error, readonly PendingApproval[], ThinkPendingExecutionApprovalsQueryKey> & {
|
|
25
|
+
queryKey: DataTag<ThinkPendingExecutionApprovalsQueryKey, readonly PendingApproval[], Error>;
|
|
26
|
+
};
|
|
22
27
|
interface ThinkChatProviderProps<State = unknown, MessageT extends UIMessage = UIMessage> {
|
|
23
28
|
/** The `useAgentChat` value from `@cloudflare/think/react` that descendants read. */
|
|
24
29
|
chat: ThinkChatValue<State, MessageT>;
|
|
@@ -31,6 +36,11 @@ interface ThinkChatRootProps<State = unknown> {
|
|
|
31
36
|
agent: string | UseAgentOptions<State>;
|
|
32
37
|
/** Instance name (e.g. a session or room id). Wins over `agent.name`. */
|
|
33
38
|
name?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Stable, non-secret identity for the remote Think agent. Include endpoint,
|
|
41
|
+
* account or tenant scope, and agent path so sources cannot share cached data.
|
|
42
|
+
*/
|
|
43
|
+
sourceKey: string;
|
|
34
44
|
children: React.ReactNode;
|
|
35
45
|
}
|
|
36
46
|
interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends ThinkChatActivityRendererOptions<MessageT> {
|
|
@@ -43,12 +53,6 @@ interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends
|
|
|
43
53
|
emptyState?: React.ReactNode;
|
|
44
54
|
/** Extra controls rendered inside the composer, next to the send button. */
|
|
45
55
|
composerTools?: React.ReactNode;
|
|
46
|
-
/** Keep submitting composed follow-ups through `chat.sendMessage()` while busy. */
|
|
47
|
-
allowSubmitWhileBusy?: AgentChatProps<MessageT>["allowSubmitWhileBusy"];
|
|
48
|
-
/** Authoritative queued messages rendered outside the transcript. */
|
|
49
|
-
queuedMessages?: AgentChatProps<MessageT>["queuedMessages"];
|
|
50
|
-
onSteerQueuedMessage?: AgentChatProps<MessageT>["onSteerQueuedMessage"];
|
|
51
|
-
onRemoveQueuedMessage?: AgentChatProps<MessageT>["onRemoveQueuedMessage"];
|
|
52
56
|
/** Host-owned slash-command catalog and selection policy. */
|
|
53
57
|
slashCommands?: AgentChatProps<MessageT>["slashCommands"];
|
|
54
58
|
/** Controlled MCP catalog revealed by `@`; selections become composer references. */
|
|
@@ -100,7 +104,9 @@ interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends
|
|
|
100
104
|
*/
|
|
101
105
|
contextWindow?: AgentChatProps<MessageT>["contextWindow"];
|
|
102
106
|
}
|
|
103
|
-
|
|
107
|
+
/** Shared pending-approval options for components and TanStack Router loaders. */
|
|
108
|
+
declare function thinkPendingExecutionApprovalsQueryOptions(stub: AgentStub<Think>, sourceKey: string): ThinkPendingExecutionApprovalsQueryOptions;
|
|
109
|
+
declare function useThinkPendingExecutionApprovals(stub: AgentStub<Think>, sourceKey: string, refreshSignal?: unknown): {
|
|
104
110
|
pendingApprovals: readonly PendingApproval[];
|
|
105
111
|
refreshPendingApprovals: () => Promise<void>;
|
|
106
112
|
};
|
|
@@ -117,18 +123,26 @@ declare function ThinkChatProvider<State = unknown, MessageT extends UIMessage =
|
|
|
117
123
|
/**
|
|
118
124
|
* Batteries-included root: connects to the named Think agent (upstream's
|
|
119
125
|
* `useAgent` + `useAgentChat`) and provides the live chat to everything
|
|
120
|
-
* inside.
|
|
126
|
+
* inside. Render it beneath the app's `QueryClientProvider`. If the app
|
|
127
|
+
* already owns the chat hook, use `ThinkChat.Provider`.
|
|
121
128
|
*
|
|
122
129
|
* @example
|
|
123
130
|
* ```tsx
|
|
124
|
-
* <
|
|
125
|
-
* <ThinkChat.
|
|
126
|
-
*
|
|
131
|
+
* <QueryClientProvider client={queryClient}>
|
|
132
|
+
* <ThinkChat.Root
|
|
133
|
+
* agent="my-agent"
|
|
134
|
+
* name="session-1"
|
|
135
|
+
* sourceKey="api.example.com:account:acme:agent:session-1"
|
|
136
|
+
* >
|
|
137
|
+
* <ThinkChat.Messages />
|
|
138
|
+
* </ThinkChat.Root>
|
|
139
|
+
* </QueryClientProvider>
|
|
127
140
|
* ```
|
|
128
141
|
*/
|
|
129
142
|
declare function ThinkChatRoot<State = unknown, MessageT extends UIMessage = UIMessage>({
|
|
130
143
|
agent: agentOption,
|
|
131
144
|
name,
|
|
145
|
+
sourceKey,
|
|
132
146
|
children
|
|
133
147
|
}: ThinkChatRootProps<State>): React.JSX.Element;
|
|
134
148
|
/**
|
|
@@ -145,8 +159,7 @@ declare function ThinkChatMessages<State = unknown, MessageT extends UIMessage =
|
|
|
145
159
|
composerHeader,
|
|
146
160
|
renderPart,
|
|
147
161
|
excludeTools,
|
|
148
|
-
|
|
149
|
-
selectedAgentToolRunId,
|
|
162
|
+
renderAgentToolRunLink,
|
|
150
163
|
toolRenderers,
|
|
151
164
|
thinkStub,
|
|
152
165
|
onExecutionSettled,
|
|
@@ -194,4 +207,4 @@ declare const ThinkChat: {
|
|
|
194
207
|
createActivityRenderer: typeof createThinkChatActivityRenderer;
|
|
195
208
|
};
|
|
196
209
|
//#endregion
|
|
197
|
-
export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, ThinkRecoveryNotice, type ThinkRecoveryNoticeProps, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, useOptionalAgentToolRuns, useThinkChat,
|
|
210
|
+
export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, ThinkPendingExecutionApprovalsQueryKey, ThinkPendingExecutionApprovalsQueryOptions, ThinkRecoveryNotice, type ThinkRecoveryNoticeProps, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceQueryKey, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isThinkChatActivityPart } from "./ThinkChatToolParts.js";
|
|
2
2
|
import { AgentToolRunsProvider, useOptionalAgentToolRuns } from "./AgentToolRunsContext.js";
|
|
3
3
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
4
|
+
import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
|
|
4
5
|
import { describeThinkChatActivityPart } from "./ThinkChatActivitySummary.js";
|
|
5
6
|
import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./ThinkChatActivity.js";
|
|
6
7
|
import { ThinkRecoveryNotice } from "./ThinkRecoveryNotice.js";
|
|
7
|
-
import { a as
|
|
8
|
+
import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-15EhfvYJ.js";
|
|
8
9
|
import { BrowserReplay } from "./BrowserReplay.js";
|
|
9
|
-
import {
|
|
10
|
-
import { useWorkspace } from "./Workspace.js";
|
|
10
|
+
import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
|
|
11
11
|
import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
|
|
12
|
-
export { AgentToolRunsProvider, BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, ThinkRecoveryNotice, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, useOptionalAgentToolRuns, useThinkChat,
|
|
12
|
+
export { AgentToolRunsProvider, BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, ThinkRecoveryNotice, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-CSzVwMXf.js";
|
|
2
|
-
import { l as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-
|
|
3
|
-
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-
|
|
2
|
+
import { l as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-D1xOrNrq.js";
|
|
3
|
+
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-Bzot45kX.js";
|
|
4
4
|
export { ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatToolRenderer, ThinkChatToolRenderers, createThinkChatActivityRenderer, describeThinkChatActivityPart, isThinkChatActivityPart, renderThinkChatActivityPart };
|
|
@@ -105,28 +105,27 @@ function ThinkChatActivityStep({ text, part, toolRenderers }) {
|
|
|
105
105
|
children: text
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
function ThinkChatActivityGroup({ message,
|
|
108
|
+
function ThinkChatActivityGroup({ message, parts, renderAgentToolRunLink, isTrailing, toolRenderers }) {
|
|
109
109
|
const chat = useOptionalThinkChatContext();
|
|
110
110
|
const chatStillWorking = isTrailing && Boolean(chat?.isStreaming) && chat?.messages.at(-1)?.id === message.id;
|
|
111
111
|
const agentTools = useOptionalAgentToolRuns();
|
|
112
112
|
const runs = React.useMemo(() => {
|
|
113
|
-
if (!agentTools || !
|
|
113
|
+
if (!agentTools || !renderAgentToolRunLink) return [];
|
|
114
114
|
return parts.flatMap((part) => isToolUIPart(part) ? agentTools.getRunsForToolCall(part.toolCallId) : []);
|
|
115
115
|
}, [
|
|
116
116
|
agentTools,
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
parts,
|
|
118
|
+
renderAgentToolRunLink
|
|
119
119
|
]);
|
|
120
120
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ThinkChatActivity, {
|
|
121
121
|
parts,
|
|
122
122
|
isStreaming: parts.some(isPartWorking) || chatStillWorking,
|
|
123
123
|
toolRenderers
|
|
124
|
-
}), runs.length ? /* @__PURE__ */ jsx(SubagentRunList, {
|
|
124
|
+
}), runs.length && renderAgentToolRunLink ? /* @__PURE__ */ jsx(SubagentRunList, {
|
|
125
125
|
className: "subagent-run__list--adjacent",
|
|
126
126
|
"aria-label": "Delegated agent runs",
|
|
127
127
|
runs,
|
|
128
|
-
|
|
129
|
-
onSelect: onAgentToolRunSelect
|
|
128
|
+
renderRunLink: renderAgentToolRunLink
|
|
130
129
|
}) : null] });
|
|
131
130
|
}
|
|
132
131
|
/**
|
|
@@ -136,7 +135,7 @@ function ThinkChatActivityGroup({ message, onAgentToolRunSelect, parts, selected
|
|
|
136
135
|
* state. Excluded tools split the run and return undefined so your own
|
|
137
136
|
* renderPart (or AgentChat's generic activity row) takes over for them.
|
|
138
137
|
*/
|
|
139
|
-
function createThinkChatActivityRenderer({ excludeTools,
|
|
138
|
+
function createThinkChatActivityRenderer({ excludeTools, renderAgentToolRunLink, toolRenderers } = {}) {
|
|
140
139
|
const excluded = excludeTools?.length ? new Set(excludeTools) : void 0;
|
|
141
140
|
const isActivity = (part) => isThinkChatActivityPart(part, excluded);
|
|
142
141
|
return (context) => {
|
|
@@ -152,8 +151,7 @@ function createThinkChatActivityRenderer({ excludeTools, onAgentToolRunSelect, s
|
|
|
152
151
|
parts: message.parts.slice(start, end + 1),
|
|
153
152
|
isTrailing: end === message.parts.length - 1,
|
|
154
153
|
toolRenderers,
|
|
155
|
-
|
|
156
|
-
onAgentToolRunSelect
|
|
154
|
+
renderAgentToolRunLink
|
|
157
155
|
});
|
|
158
156
|
};
|
|
159
157
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as activityPartIconKind, c as deriveThinkChatToolLifecycleHeader, i as ThinkChatToolLifecycleSnapshot, l as describeThinkChatActivityPart, n as ThinkChatToolDescriber, o as activityPartUrl, r as ThinkChatToolDescribers, s as deriveThinkChatActivityHeader, t as ThinkChatActivityHeader, u as summarizeActivitySteps } from "../ThinkChatActivitySummary-
|
|
1
|
+
import { a as activityPartIconKind, c as deriveThinkChatToolLifecycleHeader, i as ThinkChatToolLifecycleSnapshot, l as describeThinkChatActivityPart, n as ThinkChatToolDescriber, o as activityPartUrl, r as ThinkChatToolDescribers, s as deriveThinkChatActivityHeader, t as ThinkChatActivityHeader, u as summarizeActivitySteps } from "../ThinkChatActivitySummary-D1xOrNrq.js";
|
|
2
2
|
export { ThinkChatActivityHeader, ThinkChatToolDescriber, ThinkChatToolDescribers, ThinkChatToolLifecycleSnapshot, activityPartIconKind, activityPartUrl, deriveThinkChatActivityHeader, deriveThinkChatToolLifecycleHeader, describeThinkChatActivityPart, summarizeActivitySteps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { displayUrl, getToolDisplayName, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isWorkspaceToolPart } from "./ThinkChatToolParts.js";
|
|
2
|
-
import { t as summarizeToolInput } from "../summarize-tool-input-
|
|
2
|
+
import { t as summarizeToolInput } from "../summarize-tool-input-CqTcGRYy.js";
|
|
3
3
|
import { getToolName, isReasoningUIPart, isToolUIPart } from "ai";
|
|
4
4
|
//#region src/components/ThinkChatActivitySummary.ts
|
|
5
5
|
const ACTIVITY_HEADER_LABEL_MAX_LENGTH = 240;
|
|
@@ -310,6 +310,7 @@ function summarizeActivitySteps(parts) {
|
|
|
310
310
|
if (browses > 0) segments.push("used the browser");
|
|
311
311
|
if (codeRuns > 0) segments.push("ran code");
|
|
312
312
|
if (commands > 0) segments.push(commands === 1 ? "ran a command" : `ran ${commands} commands`);
|
|
313
|
+
const includedSegments = new Set(segments);
|
|
313
314
|
for (const segment of [
|
|
314
315
|
"edited files",
|
|
315
316
|
"searched code",
|
|
@@ -318,8 +319,11 @@ function summarizeActivitySteps(parts) {
|
|
|
318
319
|
"ran a command",
|
|
319
320
|
"read files",
|
|
320
321
|
"used a tool"
|
|
321
|
-
]) if (genericSegments.has(segment))
|
|
322
|
-
|
|
322
|
+
]) if (genericSegments.has(segment)) {
|
|
323
|
+
segments.push(segment);
|
|
324
|
+
includedSegments.add(segment);
|
|
325
|
+
}
|
|
326
|
+
for (const segment of genericSegments) if (!includedSegments.has(segment)) segments.push(segment);
|
|
323
327
|
if (segments.length === 0) return "Worked";
|
|
324
328
|
const top = segments.slice(0, 3);
|
|
325
329
|
const joined = top.length === 1 ? top[0] : `${top.slice(0, -1).join(", ")} and ${top.at(-1)}`;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ActivityOutput, ActivityPanel } from "./Activity.js";
|
|
2
2
|
import { displayUrl, isSessionContextToolFailure } from "./ThinkChatToolParts.js";
|
|
3
3
|
import { Tabs } from "./Tabs.js";
|
|
4
|
-
import { t as CodeBlock } from "../CodeBlock-
|
|
4
|
+
import { t as CodeBlock } from "../CodeBlock-Bb-IPBc_.js";
|
|
5
5
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
6
|
+
import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
|
|
6
7
|
import * as React from "react";
|
|
7
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { getToolName } from "ai";
|
|
@@ -15,11 +16,6 @@ function renderDeniedPanel(label, reason) {
|
|
|
15
16
|
error: true
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
function numberLines(content, from = 1) {
|
|
19
|
-
const lines = content.split("\n");
|
|
20
|
-
const width = String(from + lines.length - 1).length;
|
|
21
|
-
return lines.map((line, i) => `${String(from + i).padStart(width)} ${line}`).join("\n");
|
|
22
|
-
}
|
|
23
19
|
function prefixLines(text, prefix) {
|
|
24
20
|
return text.split("\n").map((line) => `${prefix}${line}`).join("\n");
|
|
25
21
|
}
|
|
@@ -58,11 +54,19 @@ function ThinkChatWorkspacePanel({ part }) {
|
|
|
58
54
|
return /* @__PURE__ */ jsx(ActivityPanel, { label });
|
|
59
55
|
}
|
|
60
56
|
case "tool-write": {
|
|
57
|
+
const path = part.input?.path ?? "file";
|
|
58
|
+
const content = part.input?.content;
|
|
61
59
|
const output = part.state === "output-available" ? part.output : void 0;
|
|
62
60
|
return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
63
|
-
label:
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
label: path,
|
|
62
|
+
status: output ? `${output.lines} lines written` : void 0,
|
|
63
|
+
children: content !== void 0 ? /* @__PURE__ */ jsx(CodeBlock, {
|
|
64
|
+
className: "activity__code-block",
|
|
65
|
+
code: content,
|
|
66
|
+
isStreaming: part.state === "input-streaming",
|
|
67
|
+
language: inferWorkspaceLanguage(path),
|
|
68
|
+
showLineNumbers: true
|
|
69
|
+
}) : null
|
|
66
70
|
});
|
|
67
71
|
}
|
|
68
72
|
case "tool-edit": {
|
|
@@ -402,19 +406,25 @@ function ThinkChatBrowserPanel({ part }) {
|
|
|
402
406
|
children: [
|
|
403
407
|
/* @__PURE__ */ jsxs(Tabs.List, {
|
|
404
408
|
variant: "line",
|
|
405
|
-
children: [
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ jsx(Tabs.Tab, {
|
|
411
|
+
value: "browser",
|
|
412
|
+
children: "Preview"
|
|
413
|
+
}),
|
|
414
|
+
/* @__PURE__ */ jsx(Tabs.Tab, {
|
|
415
|
+
value: "code",
|
|
416
|
+
children: "Code"
|
|
417
|
+
}),
|
|
418
|
+
/* @__PURE__ */ jsx(Tabs.Indicator, {})
|
|
419
|
+
]
|
|
412
420
|
}),
|
|
413
421
|
/* @__PURE__ */ jsx(Tabs.Panel, {
|
|
422
|
+
className: "activity__browser-panel",
|
|
414
423
|
value: "browser",
|
|
415
424
|
children: browserView
|
|
416
425
|
}),
|
|
417
426
|
/* @__PURE__ */ jsx(Tabs.Panel, {
|
|
427
|
+
className: "activity__browser-panel",
|
|
418
428
|
value: "code",
|
|
419
429
|
children: codeView
|
|
420
430
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
2
|
-
import {
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { D as InfoIcon, S as FileIcon, U as RefreshIcon, X as TerminalIcon, et as XIcon, n as ArrowDownIcon, u as CheckIcon } from "../icons-DKXiSepE.js";
|
|
3
3
|
import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityOutput, ActivityPanel, ActivityTrigger } from "./Activity.js";
|
|
4
4
|
import { formatThinkExecutionRunProgress, formatThinkExecutionStatus, formatThinkExecutionTimestamp, getThinkExecutionRunError, getThinkExecutionRunId, getThinkExecutionRunProgressedAt, getThinkExecutionRunProgressedLabel, getThinkExecutionRunStatus, getThinkExecutionRunTitle, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
|
|
5
5
|
import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
2
|
-
import {
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { D as InfoIcon, K as SpinnerIcon, R as PauseIcon, et as XIcon, u as CheckIcon } from "../icons-DKXiSepE.js";
|
|
3
3
|
import { Tooltip } from "./Tooltip.js";
|
|
4
4
|
import { formatThinkExecutionStatus, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone } from "./ThinkExecutionRun.js";
|
|
5
5
|
import "react";
|
|
@@ -1,20 +1,41 @@
|
|
|
1
1
|
import { t as ThinkExecutionRun } from "../ThinkExecutionRun-ChhWhOoU.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { DataTag, UndefinedInitialDataOptions } from "@tanstack/react-query";
|
|
4
|
+
import { Think, ThinkSubmissionInspection } from "@cloudflare/think";
|
|
4
5
|
import { AgentStub } from "agents/client";
|
|
6
|
+
import { WorkflowPage } from "agents/workflows";
|
|
5
7
|
|
|
6
8
|
//#region src/components/ThinkExecutionWorkbench.d.ts
|
|
7
9
|
interface ThinkExecutionWorkbenchProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
8
10
|
/** Agents SDK client stub for a Think agent; this UI calls native submission/workflow methods. */
|
|
9
11
|
source: AgentStub<Think>;
|
|
12
|
+
/**
|
|
13
|
+
* Stable, serializable identity for the remote Think agent. It must change
|
|
14
|
+
* when `source` points at a different agent and must not contain credentials.
|
|
15
|
+
*/
|
|
16
|
+
sourceKey: string;
|
|
10
17
|
title?: React.ReactNode;
|
|
11
18
|
backButton?: React.ReactNode;
|
|
12
19
|
pageSize?: number;
|
|
13
|
-
/** Whole native execution selected by
|
|
14
|
-
selectedRun
|
|
15
|
-
/**
|
|
16
|
-
|
|
20
|
+
/** Whole native execution selected by the application route. */
|
|
21
|
+
selectedRun: ThinkExecutionRun | null;
|
|
22
|
+
/** Returns an application-authored TanStack Router Link for the run. */
|
|
23
|
+
renderRunLink: (run: ThinkExecutionRun) => React.ReactElement;
|
|
17
24
|
}
|
|
25
|
+
interface ThinkExecutionRunsData {
|
|
26
|
+
submissions: readonly ThinkSubmissionInspection[];
|
|
27
|
+
workflows: WorkflowPage;
|
|
28
|
+
}
|
|
29
|
+
type ThinkExecutionRunsQueryKey = readonly ["think", sourceKey: string, "execution-runs", {
|
|
30
|
+
readonly limit: number;
|
|
31
|
+
}];
|
|
32
|
+
type ThinkExecutionRunsQueryOptions = UndefinedInitialDataOptions<ThinkExecutionRunsData, Error, ThinkExecutionRunsData, ThinkExecutionRunsQueryKey> & {
|
|
33
|
+
queryKey: DataTag<ThinkExecutionRunsQueryKey, ThinkExecutionRunsData, Error>;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Shared list options for component reads and TanStack Router loaders.
|
|
37
|
+
*/
|
|
38
|
+
declare function thinkExecutionRunsQueryOptions(source: AgentStub<Think>, sourceKey: string, pageSize?: number): ThinkExecutionRunsQueryOptions;
|
|
18
39
|
/**
|
|
19
40
|
* Unified execution history for native Think submissions and Agents workflows.
|
|
20
41
|
* The workbench reads and acts through the whole upstream agent stub; it does
|
|
@@ -23,15 +44,16 @@ interface ThinkExecutionWorkbenchProps extends Omit<React.HTMLAttributes<HTMLDiv
|
|
|
23
44
|
declare function ThinkExecutionWorkbench({
|
|
24
45
|
backButton,
|
|
25
46
|
className,
|
|
26
|
-
onSelectedRunChange,
|
|
27
47
|
pageSize,
|
|
28
48
|
ref,
|
|
29
|
-
|
|
49
|
+
renderRunLink,
|
|
50
|
+
selectedRun,
|
|
30
51
|
source,
|
|
52
|
+
sourceKey,
|
|
31
53
|
title,
|
|
32
54
|
...props
|
|
33
55
|
}: ThinkExecutionWorkbenchProps & {
|
|
34
56
|
ref?: React.Ref<HTMLDivElement>;
|
|
35
57
|
}): React.JSX.Element;
|
|
36
58
|
//#endregion
|
|
37
|
-
export { ThinkExecutionWorkbench, ThinkExecutionWorkbenchProps };
|
|
59
|
+
export { ThinkExecutionRunsData, ThinkExecutionRunsQueryKey, ThinkExecutionRunsQueryOptions, ThinkExecutionWorkbench, ThinkExecutionWorkbenchProps, thinkExecutionRunsQueryOptions };
|