@mcp-b/react-components 0.14.2 → 0.16.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/AgentActivity-BNUNrP9O.d.ts +36 -0
- package/dist/{AgentChat-DQkqt82e.d.ts → AgentChat-CrlpbvQJ.d.ts} +58 -6
- package/dist/{CodeBlock-DUh9WOGo.d.ts → CodeBlock-BRajW4QU.d.ts} +1 -1
- package/dist/{CodeBlock-BUFXG8HW.js → CodeBlock-BmB4Xaqq.js} +15 -4
- package/dist/{FileTree-mpEIcfzA.js → FileTree-CkVbIMWV.js} +82 -89
- package/dist/Message-BkMdE3bS.js +375 -0
- package/dist/{ModelSelector-CPCpFAUt.js → ModelSelector-SlJNgwKY.js} +2 -2
- package/dist/{PromptInput-ClNqBiIw.d.ts → PromptInput-BWTuXMOD.d.ts} +123 -5
- package/dist/ResponsiveSidebarShell-Dd9DCcBT.d.ts +67 -0
- package/dist/{Select-Dl_vF_Bt.d.ts → Select-BeEsefzh.d.ts} +12 -2
- package/dist/{ThinkChat-BPcehdbP.js → ThinkChat-CzC-zNGA.js} +24 -36
- package/dist/{ThinkChatActivity-BmwuIigx.d.ts → ThinkChatActivity-BFQnb2ct.d.ts} +3 -10
- package/dist/ThinkChatActivitySummary-BPmu9a-c.d.ts +39 -0
- package/dist/{ThinkChatToolParts-CDEjqS6A.d.ts → ThinkChatToolParts-CSzVwMXf.d.ts} +13 -3
- package/dist/ThinkExecutionRun-ChhWhOoU.d.ts +30 -0
- package/dist/Toggle-CAAlNl-M.d.ts +69 -0
- package/dist/ToggleGroup-8hPv-b69.d.ts +73 -0
- package/dist/Workspace-D39LxGvP.d.ts +62 -0
- package/dist/WorkspaceFile-DOZkPwzu.d.ts +106 -0
- package/dist/WorkspaceFileView-rSN_yT0L.js +744 -0
- package/dist/WorkspaceLink-DIPbXrUM.js +337 -0
- package/dist/WorkspaceLink-DK1DWMHe.d.ts +89 -0
- package/dist/components/Activity.d.ts +27 -1
- package/dist/components/Activity.js +33 -15
- package/dist/components/AgentActivity.d.ts +2 -0
- package/dist/components/AgentActivity.js +45 -0
- package/dist/components/AgentActivityPreview.d.ts +46 -0
- package/dist/components/AgentActivityPreview.js +94 -0
- package/dist/components/AgentAttention.d.ts +73 -0
- package/dist/components/AgentAttention.js +85 -0
- package/dist/components/AgentChat.d.ts +2 -2
- package/dist/components/AgentChat.js +224 -200
- package/dist/components/AgentChatMessageEditor.d.ts +29 -0
- package/dist/components/AgentChatMessageEditor.js +92 -0
- package/dist/components/AgentChatTurnError.d.ts +17 -0
- package/dist/components/AgentChatTurnError.js +40 -0
- package/dist/components/AgentConnection.d.ts +12 -17
- package/dist/components/AgentConnection.js +99 -91
- package/dist/components/AppFrame.d.ts +24 -0
- package/dist/components/AppFrame.js +25 -0
- package/dist/components/AppTopBar.d.ts +71 -0
- package/dist/components/AppTopBar.js +82 -0
- package/dist/components/Artifact.js +1 -1
- package/dist/components/BrowserLiveView.js +1 -1
- package/dist/components/BrowserReplay.js +1 -1
- package/dist/components/BrowserRunPanel.js +1 -1
- package/dist/components/Card.d.ts +3 -0
- package/dist/components/Card.js +2 -1
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +1 -1
- package/dist/components/ChatGptSignInScreen.js +2 -2
- package/dist/components/Checkbox.js +5 -13
- package/dist/components/CheckboxGroup.d.ts +58 -2
- package/dist/components/CheckboxGroup.js +59 -1
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.js +1 -1
- package/dist/components/Commit.js +2 -2
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Conversation.js +1 -1
- package/dist/components/DescriptionList.d.ts +12 -0
- package/dist/components/DescriptionList.js +11 -0
- package/dist/components/DescriptionListParts.d.ts +37 -0
- package/dist/components/DescriptionListParts.js +35 -0
- package/dist/components/EnvironmentVariables.js +2 -2
- package/dist/components/Fieldset.d.ts +13 -1
- package/dist/components/Fieldset.js +11 -2
- package/dist/components/FileTree.js +1 -1
- package/dist/components/IconButton.d.ts +33 -0
- package/dist/components/IconButton.js +27 -0
- package/dist/components/McpConnectionRequest.d.ts +44 -0
- package/dist/components/McpConnectionRequest.js +122 -0
- package/dist/components/McpServerPicker.d.ts +48 -23
- package/dist/components/McpServerPicker.js +238 -189
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.d.ts +1 -0
- package/dist/components/Message.js +1 -285
- package/dist/components/MessageScroller.js +1 -1
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/Pricing.d.ts +37 -0
- package/dist/components/Pricing.js +17 -0
- package/dist/components/PricingBillingToggle.d.ts +23 -0
- package/dist/components/PricingBillingToggle.js +86 -0
- package/dist/components/PricingConfirmationDialog.d.ts +25 -0
- package/dist/components/PricingConfirmationDialog.js +57 -0
- package/dist/components/PricingFAQ.d.ts +18 -0
- package/dist/components/PricingFAQ.js +27 -0
- package/dist/components/PricingPage.d.ts +2 -38
- package/dist/components/PricingPage.js +39 -359
- package/dist/components/PricingPlanCard.d.ts +22 -0
- package/dist/components/PricingPlanCard.js +109 -0
- package/dist/components/PricingUsageCalculator.d.ts +22 -0
- package/dist/components/PricingUsageCalculator.js +96 -0
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +210 -15
- package/dist/components/Queue.js +1 -1
- package/dist/components/Reasoning.d.ts +2 -1
- package/dist/components/Reasoning.js +14 -29
- package/dist/components/ResizableSidePanel.d.ts +57 -0
- package/dist/components/ResizableSidePanel.js +151 -0
- package/dist/components/ResponsiveSidebarShell.d.ts +2 -0
- package/dist/components/ResponsiveSidebarShell.js +129 -0
- package/dist/components/Select.d.ts +2 -2
- package/dist/components/Select.js +11 -2
- package/dist/components/Slider.d.ts +13 -1
- package/dist/components/Slider.js +11 -0
- package/dist/components/Sources.js +1 -1
- package/dist/components/Stepper.d.ts +4 -0
- package/dist/components/Stepper.js +5 -3
- package/dist/components/SubagentRun.d.ts +18 -19
- package/dist/components/SubagentRun.js +25 -18
- package/dist/components/SubagentRunIndicator.d.ts +22 -0
- package/dist/components/SubagentRunIndicator.js +33 -0
- package/dist/components/SubagentRunList.d.ts +25 -0
- package/dist/components/SubagentRunList.js +26 -0
- package/dist/components/SubagentRunSelector.d.ts +47 -0
- package/dist/components/SubagentRunSelector.js +55 -0
- package/dist/components/Task.js +1 -1
- package/dist/components/Terminal.js +2 -2
- package/dist/components/TestResults.js +1 -1
- package/dist/components/Textarea.d.ts +21 -0
- package/dist/components/Textarea.js +19 -0
- package/dist/components/ThemeModeControl.d.ts +24 -0
- package/dist/components/ThemeModeControl.js +52 -0
- package/dist/components/ThemeProvider.d.ts +38 -0
- package/dist/components/ThemeProvider.js +80 -0
- package/dist/components/ThinkChat.d.ts +29 -6
- package/dist/components/ThinkChat.js +7 -4
- package/dist/components/ThinkChatActivity.d.ts +3 -2
- package/dist/components/ThinkChatActivity.js +12 -318
- package/dist/components/ThinkChatActivitySummary.d.ts +2 -0
- package/dist/components/ThinkChatActivitySummary.js +421 -0
- package/dist/components/ThinkChatToolPanels.d.ts +7 -5
- package/dist/components/ThinkChatToolPanels.js +70 -8
- package/dist/components/ThinkChatToolParts.d.ts +2 -2
- package/dist/components/ThinkChatToolParts.js +36 -10
- package/dist/components/ThinkExecutionDetail.d.ts +20 -0
- package/dist/components/ThinkExecutionDetail.js +80 -0
- package/dist/components/ThinkExecutionRun.d.ts +2 -0
- package/dist/components/ThinkExecutionRun.js +72 -0
- package/dist/components/ThinkExecutionStatus.d.ts +22 -0
- package/dist/components/ThinkExecutionStatus.js +36 -0
- package/dist/components/ThinkExecutionWorkbench.d.ts +7 -0
- package/dist/components/ThinkExecutionWorkbench.js +69 -225
- package/dist/components/ThinkFullApp.d.ts +58 -14
- package/dist/components/ThinkFullApp.js +154 -160
- package/dist/components/ThinkFullAppViewSwitch.d.ts +31 -0
- package/dist/components/ThinkFullAppViewSwitch.js +34 -0
- package/dist/components/ThinkRoutine.d.ts +36 -0
- package/dist/components/ThinkRoutine.js +15 -0
- package/dist/components/ThinkRoutineBrowser.d.ts +25 -0
- package/dist/components/ThinkRoutineBrowser.js +156 -0
- package/dist/components/ThinkRoutineDetail.d.ts +24 -0
- package/dist/components/ThinkRoutineDetail.js +102 -0
- package/dist/components/ThinkRoutineForm.d.ts +32 -0
- package/dist/components/ThinkRoutineForm.js +151 -0
- package/dist/components/ThinkRoutineLibrary.d.ts +74 -0
- package/dist/components/ThinkRoutineLibrary.js +178 -0
- package/dist/components/ThinkRoutineRuns.d.ts +24 -0
- package/dist/components/ThinkRoutineRuns.js +68 -0
- package/dist/components/ThinkThreadPicker.d.ts +18 -1
- package/dist/components/ThinkThreadPicker.js +51 -5
- package/dist/components/ThinkThreadShell.d.ts +12 -9
- package/dist/components/ThinkThreadShell.js +17 -137
- package/dist/components/Toggle.d.ts +1 -68
- package/dist/components/ToggleGroup.d.ts +1 -72
- package/dist/components/Tooltip.d.ts +3 -1
- package/dist/components/Tooltip.js +4 -2
- package/dist/components/WebPreview.js +1 -1
- package/dist/components/Workspace.d.ts +2 -0
- package/dist/components/Workspace.js +424 -0
- package/dist/components/WorkspaceBrowser.d.ts +32 -0
- package/dist/components/WorkspaceBrowser.js +103 -0
- package/dist/components/WorkspaceExplorer.d.ts +12 -79
- package/dist/components/WorkspaceExplorer.js +116 -330
- package/dist/components/WorkspaceFile.d.ts +2 -0
- package/dist/components/WorkspaceFile.js +195 -0
- package/dist/components/WorkspaceFileView.d.ts +26 -0
- package/dist/components/WorkspaceFileView.js +2 -0
- package/dist/components/WorkspaceHeader.d.ts +35 -0
- package/dist/components/WorkspaceHeader.js +51 -0
- package/dist/components/WorkspaceLink.d.ts +2 -0
- package/dist/components/WorkspaceLink.js +2 -0
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-DUMLYdsk.js → copy-button-Dejn5heL.js} +1 -1
- package/dist/icons-CpfUer49.js +85 -0
- package/dist/{icons-CUCz_Sft.d.ts → icons-GQd1xF4e.d.ts} +51 -1
- package/dist/styles/activity-header.css +75 -0
- package/dist/styles/activity.css +49 -63
- package/dist/styles/agent-activity-preview-overlay.css +80 -0
- package/dist/styles/agent-activity-preview.css +233 -0
- package/dist/styles/agent-attention.css +128 -0
- package/dist/styles/agent-chat.css +133 -4
- package/dist/styles/agent-connection.css +9 -9
- package/dist/styles/alert-dialog.css +11 -11
- package/dist/styles/app-frame.css +15 -0
- package/dist/styles/app-top-bar.css +102 -0
- package/dist/styles/avatar.css +0 -1
- package/dist/styles/browser-control-overlay.css +184 -0
- package/dist/styles/card.css +29 -8
- package/dist/styles/chain-of-thought.css +5 -5
- package/dist/styles/checkbox-group.css +69 -0
- package/dist/styles/codex-model-selector.css +3 -3
- package/dist/styles/combobox.css +2 -1
- package/dist/styles/context-menu.css +1 -1
- package/dist/styles/description-list.css +50 -0
- package/dist/styles/dialog.css +11 -11
- package/dist/styles/field.css +14 -14
- package/dist/styles/fieldset.css +15 -4
- package/dist/styles/index.css +14 -2
- package/dist/styles/mcp-connection-request.css +60 -0
- package/dist/styles/mcp-server-picker.css +96 -68
- package/dist/styles/menu.css +1 -1
- package/dist/styles/message.css +4 -43
- package/dist/styles/model-selector.css +18 -12
- package/dist/styles/popover.css +9 -9
- package/dist/styles/preview-card.css +1 -1
- package/dist/styles/pricing-page.css +21 -27
- package/dist/styles/prompt-input.css +225 -32
- package/dist/styles/reasoning.css +1 -55
- package/dist/styles/recipes.css +50 -24
- package/dist/styles/resizable-side-panel.css +66 -0
- package/dist/styles/responsive-sidebar-shell.css +169 -0
- package/dist/styles/select.css +13 -3
- package/dist/styles/sources.css +6 -6
- package/dist/styles/stepper.css +13 -0
- package/dist/styles/streamdown.css +0 -4
- package/dist/styles/subagent-run.css +59 -42
- package/dist/styles/task.css +17 -10
- package/dist/styles/test-results.css +17 -10
- package/dist/styles/textarea.css +20 -0
- package/dist/styles/theme-mode-control.css +72 -0
- package/dist/styles/think-execution-status.css +49 -0
- package/dist/styles/think-execution-workbench.css +16 -80
- package/dist/styles/think-full-app.css +143 -128
- package/dist/styles/think-routine-library.css +491 -0
- package/dist/styles/think-thread-picker.css +47 -3
- package/dist/styles/toast.css +6 -6
- package/dist/styles/toggle-group.css +7 -0
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/workspace-explorer.css +516 -64
- package/dist/utils/mcp-server-catalog.d.ts +82 -78
- package/dist/utils/mcp-server-catalog.js +64 -41
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/utils/theme.d.ts +22 -0
- package/dist/utils/theme.js +55 -0
- package/package.json +34 -28
- package/dist/icons-Ba9THQKz.js +0 -64
- package/dist/styles/think-resize-handle.css +0 -33
- package/dist/styles/think-thread-shell.css +0 -219
|
@@ -1,181 +1,26 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityOutput, ActivityPanel, ActivityTrigger } from "./Activity.js";
|
|
2
|
+
import { L as RefreshIcon, h as EllipsisIcon } from "../icons-CpfUer49.js";
|
|
4
3
|
import { Button } from "./Button.js";
|
|
5
4
|
import { Tooltip } from "./Tooltip.js";
|
|
6
5
|
import { Menu } from "./Menu.js";
|
|
6
|
+
import { AppTopBar } from "./AppTopBar.js";
|
|
7
|
+
import { formatThinkExecutionRunProgress, getThinkExecutionRunAccessibleName, getThinkExecutionRunId, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, getThinkExecutionRunSubtitle, getThinkExecutionRunTitle, isSameThinkExecutionRun, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
|
|
8
|
+
import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
|
|
9
|
+
import { ThinkExecutionDetail } from "./ThinkExecutionDetail.js";
|
|
7
10
|
import * as React from "react";
|
|
8
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
12
|
//#region src/components/ThinkExecutionWorkbench.tsx
|
|
10
13
|
const executionPanelPageSize = 20;
|
|
11
|
-
function formatTimestamp(value) {
|
|
12
|
-
if (value == null) return "Not recorded";
|
|
13
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
14
|
-
return Number.isNaN(date.getTime()) ? "Not recorded" : date.toLocaleString();
|
|
15
|
-
}
|
|
16
|
-
function formatShortTimestamp(value) {
|
|
17
|
-
if (value == null) return "Not recorded";
|
|
18
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
19
|
-
return Number.isNaN(date.getTime()) ? "Not recorded" : date.toLocaleString(void 0, {
|
|
20
|
-
month: "short",
|
|
21
|
-
day: "numeric",
|
|
22
|
-
hour: "numeric",
|
|
23
|
-
minute: "2-digit"
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function formatJson(value) {
|
|
27
|
-
return JSON.stringify(value, null, 2);
|
|
28
|
-
}
|
|
29
14
|
function getErrorMessage(error) {
|
|
30
15
|
return error instanceof Error ? error.message : String(error);
|
|
31
16
|
}
|
|
32
|
-
function TooltipIcon({ children, className, label, status, tone }) {
|
|
33
|
-
return /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: /* @__PURE__ */ jsx("span", {
|
|
34
|
-
"aria-label": label,
|
|
35
|
-
className: cx("think-execution-workbench__icon", className),
|
|
36
|
-
"data-status": status,
|
|
37
|
-
"data-tone": tone,
|
|
38
|
-
role: "img",
|
|
39
|
-
children
|
|
40
|
-
}) }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
41
|
-
side: "top",
|
|
42
|
-
sideOffset: 6,
|
|
43
|
-
children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: label })
|
|
44
|
-
}) })] });
|
|
45
|
-
}
|
|
46
|
-
function runId(run) {
|
|
47
|
-
return run.kind === "submission" ? run.record.submissionId : run.record.workflowId;
|
|
48
|
-
}
|
|
49
|
-
function runTitle(run) {
|
|
50
|
-
return run.kind === "submission" ? run.record.submissionId : run.record.workflowName;
|
|
51
|
-
}
|
|
52
|
-
function runSubtitle(run) {
|
|
53
|
-
return run.kind === "workflow" ? run.record.workflowId : void 0;
|
|
54
|
-
}
|
|
55
|
-
function runCreatedAt(run) {
|
|
56
|
-
return run.record.createdAt;
|
|
57
|
-
}
|
|
58
|
-
function runProgressedAt(run) {
|
|
59
|
-
return run.kind === "submission" ? run.record.startedAt : run.record.updatedAt;
|
|
60
|
-
}
|
|
61
|
-
function runProgressedLabel(run) {
|
|
62
|
-
return run.kind === "submission" ? "Started" : "Updated";
|
|
63
|
-
}
|
|
64
|
-
function runCompletedAt(run) {
|
|
65
|
-
return run.record.completedAt;
|
|
66
|
-
}
|
|
67
|
-
function runStatus(run) {
|
|
68
|
-
return String(run.record.status);
|
|
69
|
-
}
|
|
70
|
-
function formatStatus(status) {
|
|
71
|
-
return status.charAt(0).toUpperCase() + status.slice(1);
|
|
72
|
-
}
|
|
73
|
-
function runListTimestamp(run) {
|
|
74
|
-
const progressedAt = runProgressedAt(run);
|
|
75
|
-
return `${progressedAt ? runProgressedLabel(run) : "Created"} ${formatShortTimestamp(progressedAt ?? runCreatedAt(run))}`;
|
|
76
|
-
}
|
|
77
|
-
function runAccessibleName(run) {
|
|
78
|
-
const subtitle = runSubtitle(run);
|
|
79
|
-
return `${runTitle(run)}${subtitle ? ` ${subtitle}` : ""}. ${formatStatus(runStatus(run))}. ${runListTimestamp(run)}`;
|
|
80
|
-
}
|
|
81
|
-
function runStatusTone(run) {
|
|
82
|
-
const status = runStatus(run);
|
|
83
|
-
if (status === "completed" || status === "complete") return "success";
|
|
84
|
-
if (status === "error" || status === "errored" || status === "terminated") return "danger";
|
|
85
|
-
if (status === "aborted" || status === "skipped" || status === "paused" || status === "waiting") return "warning";
|
|
86
|
-
if (status === "running") return "primary";
|
|
87
|
-
return "neutral";
|
|
88
|
-
}
|
|
89
|
-
function RunStatus({ run }) {
|
|
90
|
-
const status = runStatus(run);
|
|
91
|
-
const icon = status === "completed" || status === "complete" ? /* @__PURE__ */ jsx(CheckIcon, {}) : status === "error" || status === "errored" || status === "terminated" ? /* @__PURE__ */ jsx(XIcon, {}) : status === "aborted" || status === "skipped" || status === "paused" || status === "waiting" ? /* @__PURE__ */ jsx(PauseIcon, {}) : status === "running" ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(InfoIcon, {});
|
|
92
|
-
return /* @__PURE__ */ jsx(TooltipIcon, {
|
|
93
|
-
className: "think-execution-workbench__status",
|
|
94
|
-
label: `Status: ${status}`,
|
|
95
|
-
status,
|
|
96
|
-
tone: runStatusTone(run),
|
|
97
|
-
children: icon
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
function runMetadata(run) {
|
|
101
|
-
return run.record.metadata;
|
|
102
|
-
}
|
|
103
|
-
function runError(run) {
|
|
104
|
-
return run.kind === "submission" ? run.record.error : run.record.error ? `${run.record.error.name}: ${run.record.error.message}` : void 0;
|
|
105
|
-
}
|
|
106
|
-
function isSameRun(first, second) {
|
|
107
|
-
return first?.kind === second.kind && runId(first) === runId(second);
|
|
108
|
-
}
|
|
109
17
|
function isSubmissionCancelable(status) {
|
|
110
18
|
return status === "pending" || status === "running";
|
|
111
19
|
}
|
|
112
|
-
function isWorkflowTerminal(status) {
|
|
113
|
-
const value = String(status);
|
|
114
|
-
return value === "complete" || value === "errored" || value === "terminated";
|
|
115
|
-
}
|
|
116
|
-
function RunActivity({ run }) {
|
|
117
|
-
const progressedAt = runProgressedAt(run);
|
|
118
|
-
const completedAt = runCompletedAt(run);
|
|
119
|
-
const error = runError(run);
|
|
120
|
-
const metadata = runMetadata(run);
|
|
121
|
-
return /* @__PURE__ */ jsxs(Activity, {
|
|
122
|
-
defaultOpen: true,
|
|
123
|
-
children: [/* @__PURE__ */ jsx(ActivityTrigger, {
|
|
124
|
-
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
125
|
-
label: "Activity"
|
|
126
|
-
}), /* @__PURE__ */ jsxs(ActivityContent, { children: [
|
|
127
|
-
/* @__PURE__ */ jsx(ActivityItem, {
|
|
128
|
-
icon: /* @__PURE__ */ jsx(ArrowDownIcon, {}),
|
|
129
|
-
children: `Created ${formatTimestamp(runCreatedAt(run))}`
|
|
130
|
-
}),
|
|
131
|
-
progressedAt ? /* @__PURE__ */ jsx(ActivityItem, {
|
|
132
|
-
icon: /* @__PURE__ */ jsx(RefreshIcon, {}),
|
|
133
|
-
children: `${runProgressedLabel(run)} ${formatTimestamp(progressedAt)}`
|
|
134
|
-
}) : null,
|
|
135
|
-
completedAt ? /* @__PURE__ */ jsx(ActivityItem, {
|
|
136
|
-
icon: /* @__PURE__ */ jsx(CheckIcon, {}),
|
|
137
|
-
children: `Finished ${formatTimestamp(completedAt)}`
|
|
138
|
-
}) : null,
|
|
139
|
-
error ? /* @__PURE__ */ jsx(ActivityItemGroup, {
|
|
140
|
-
icon: /* @__PURE__ */ jsx(XIcon, {}),
|
|
141
|
-
label: "Failure",
|
|
142
|
-
children: /* @__PURE__ */ jsx(ActivityPanel, {
|
|
143
|
-
label: "Error",
|
|
144
|
-
text: error,
|
|
145
|
-
status: "error",
|
|
146
|
-
error: true
|
|
147
|
-
})
|
|
148
|
-
}) : null,
|
|
149
|
-
metadata ? /* @__PURE__ */ jsx(ActivityItemGroup, {
|
|
150
|
-
icon: /* @__PURE__ */ jsx(InfoIcon, {}),
|
|
151
|
-
label: "Metadata",
|
|
152
|
-
children: /* @__PURE__ */ jsx(ActivityOutput, { children: formatJson(metadata) })
|
|
153
|
-
}) : null,
|
|
154
|
-
/* @__PURE__ */ jsx(ActivityItemGroup, {
|
|
155
|
-
icon: /* @__PURE__ */ jsx(FileIcon, {}),
|
|
156
|
-
label: "Raw record",
|
|
157
|
-
children: /* @__PURE__ */ jsx(ActivityOutput, { children: formatJson(run.record) })
|
|
158
|
-
})
|
|
159
|
-
] })]
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
function RunDetail({ run }) {
|
|
163
|
-
if (!run) return /* @__PURE__ */ jsx("div", {
|
|
164
|
-
className: "think-execution-workbench__empty-detail",
|
|
165
|
-
role: "status",
|
|
166
|
-
children: /* @__PURE__ */ jsx("p", { children: "Select a run to view its activity." })
|
|
167
|
-
});
|
|
168
|
-
const id = runId(run);
|
|
169
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("header", {
|
|
170
|
-
className: "think-execution-workbench__detail-header",
|
|
171
|
-
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: runTitle(run) }), run.kind === "workflow" ? /* @__PURE__ */ jsx("code", { children: id }) : null] }), /* @__PURE__ */ jsxs("div", {
|
|
172
|
-
className: "think-execution-workbench__detail-status",
|
|
173
|
-
children: [/* @__PURE__ */ jsx(RunStatus, { run }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("strong", { children: formatStatus(runStatus(run)) }), /* @__PURE__ */ jsx("span", { children: runListTimestamp(run) })] })]
|
|
174
|
-
})]
|
|
175
|
-
}), /* @__PURE__ */ jsx(RunActivity, { run })] });
|
|
176
|
-
}
|
|
177
20
|
function RunActions({ busy, onAction, run, source }) {
|
|
178
|
-
const id =
|
|
21
|
+
const id = getThinkExecutionRunId(run);
|
|
22
|
+
const statusTone = getThinkExecutionRunStatusTone(run);
|
|
23
|
+
const kind = isThinkSubmissionRun(run) ? "submission" : "workflow";
|
|
179
24
|
const action = (key, callback) => () => onAction(key, callback);
|
|
180
25
|
return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
181
26
|
unstyled: true,
|
|
@@ -185,7 +30,7 @@ function RunActions({ busy, onAction, run, source }) {
|
|
|
185
30
|
color: "neutral",
|
|
186
31
|
size: "icon-xs",
|
|
187
32
|
className: "think-execution-workbench__run-actions",
|
|
188
|
-
"aria-label": `Actions for ${
|
|
33
|
+
"aria-label": `Actions for ${kind} ${id}`,
|
|
189
34
|
disabled: busy,
|
|
190
35
|
children: /* @__PURE__ */ jsx(EllipsisIcon, {})
|
|
191
36
|
})
|
|
@@ -195,8 +40,8 @@ function RunActions({ busy, onAction, run, source }) {
|
|
|
195
40
|
children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: "Run actions" })
|
|
196
41
|
}) })] }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
197
42
|
align: "end",
|
|
198
|
-
children: /* @__PURE__ */ jsx(Menu.Popup, { children: run
|
|
199
|
-
isSubmissionCancelable(run.
|
|
43
|
+
children: /* @__PURE__ */ jsx(Menu.Popup, { children: isThinkSubmissionRun(run) ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
|
+
isSubmissionCancelable(run.status) ? /* @__PURE__ */ jsx(Menu.Item, {
|
|
200
45
|
disabled: busy,
|
|
201
46
|
onClick: action(`cancel-submission:${id}`, () => source.cancelSubmission(id)),
|
|
202
47
|
children: "Cancel"
|
|
@@ -211,25 +56,25 @@ function RunActions({ busy, onAction, run, source }) {
|
|
|
211
56
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
212
57
|
/* @__PURE__ */ jsx(Menu.Item, {
|
|
213
58
|
disabled: busy,
|
|
214
|
-
onClick: action(`sync-workflow:${id}`, () => source.getWorkflowStatus(run.
|
|
59
|
+
onClick: action(`sync-workflow:${id}`, () => source.getWorkflowStatus(run.workflowName, id)),
|
|
215
60
|
children: "Refresh status"
|
|
216
61
|
}),
|
|
217
|
-
|
|
62
|
+
getThinkExecutionRunStatus(run) === "running" ? /* @__PURE__ */ jsx(Menu.Item, {
|
|
218
63
|
disabled: busy,
|
|
219
64
|
onClick: action(`pause-workflow:${id}`, () => source.pauseWorkflow(id)),
|
|
220
65
|
children: "Pause"
|
|
221
66
|
}) : null,
|
|
222
|
-
|
|
67
|
+
getThinkExecutionRunStatus(run) === "paused" ? /* @__PURE__ */ jsx(Menu.Item, {
|
|
223
68
|
disabled: busy,
|
|
224
69
|
onClick: action(`resume-workflow:${id}`, () => source.resumeWorkflow(id)),
|
|
225
70
|
children: "Resume"
|
|
226
71
|
}) : null,
|
|
227
|
-
|
|
72
|
+
statusTone === "success" || statusTone === "danger" ? /* @__PURE__ */ jsx(Menu.Item, {
|
|
228
73
|
disabled: busy,
|
|
229
74
|
onClick: action(`restart-workflow:${id}`, () => source.restartWorkflow(id)),
|
|
230
75
|
children: "Restart"
|
|
231
76
|
}) : null,
|
|
232
|
-
|
|
77
|
+
getThinkExecutionRunStatus(run) === "running" ? /* @__PURE__ */ jsx(Menu.Item, {
|
|
233
78
|
disabled: busy,
|
|
234
79
|
variant: "destructive",
|
|
235
80
|
onClick: action(`terminate-workflow:${id}`, () => source.terminateWorkflow(id)),
|
|
@@ -250,7 +95,7 @@ function RunActions({ busy, onAction, run, source }) {
|
|
|
250
95
|
* The workbench reads and acts through the whole upstream agent stub; it does
|
|
251
96
|
* not normalize execution records or own workflow authoring.
|
|
252
97
|
*/
|
|
253
|
-
function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPanelPageSize, ref, source, title = "Execution", ...props }) {
|
|
98
|
+
function ThinkExecutionWorkbench({ backButton, className, onSelectedRunChange, pageSize = executionPanelPageSize, ref, selectedRun: controlledSelectedRun, source, title = "Execution", ...props }) {
|
|
254
99
|
const runsId = React.useId();
|
|
255
100
|
const activeSourceRef = React.useRef(source);
|
|
256
101
|
const sourceGenerationRef = React.useRef(0);
|
|
@@ -260,14 +105,9 @@ function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPa
|
|
|
260
105
|
const [executionData, setExecutionData] = React.useState(null);
|
|
261
106
|
const [selection, setSelection] = React.useState(null);
|
|
262
107
|
const activeExecutionData = executionData?.source === source ? executionData : null;
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
record
|
|
267
|
-
})) ?? [], ...activeExecutionData?.workflows.workflows.map((record) => ({
|
|
268
|
-
kind: "workflow",
|
|
269
|
-
record
|
|
270
|
-
})) ?? []].sort((first, second) => Number(runCreatedAt(second)) - Number(runCreatedAt(first))), [activeExecutionData]);
|
|
108
|
+
const innerSelectedRun = selection?.source === source ? selection.run : null;
|
|
109
|
+
const selectedRun = controlledSelectedRun === void 0 ? innerSelectedRun : controlledSelectedRun;
|
|
110
|
+
const runs = React.useMemo(() => [...activeExecutionData?.submissions ?? [], ...activeExecutionData?.workflows.workflows ?? []].sort((first, second) => Number(second.createdAt) - Number(first.createdAt)), [activeExecutionData]);
|
|
271
111
|
const isCurrentOperation = React.useCallback((operation) => activeSourceRef.current === operation.source && sourceGenerationRef.current === operation.generation && operationSequenceRef.current === operation.sequence, []);
|
|
272
112
|
const beginOperation = React.useCallback(() => {
|
|
273
113
|
if (activeSourceRef.current !== source) return null;
|
|
@@ -328,30 +168,34 @@ function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPa
|
|
|
328
168
|
loadData
|
|
329
169
|
]);
|
|
330
170
|
const selectRun = React.useCallback((run) => {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
171
|
+
const kind = isThinkSubmissionRun(run) ? "submission" : "workflow";
|
|
172
|
+
runAction(`select-${kind}:${getThinkExecutionRunId(run)}`, async (operation) => {
|
|
173
|
+
if (isThinkSubmissionRun(run)) {
|
|
174
|
+
const inspection = await operation.source.inspectSubmission(run.submissionId);
|
|
334
175
|
if (!isCurrentOperation(operation)) return;
|
|
335
|
-
|
|
176
|
+
const selected = inspection ?? run;
|
|
177
|
+
if (controlledSelectedRun === void 0) setSelection({
|
|
336
178
|
source: operation.source,
|
|
337
|
-
run:
|
|
338
|
-
kind: "submission",
|
|
339
|
-
record: inspection
|
|
340
|
-
} : run
|
|
179
|
+
run: selected
|
|
341
180
|
});
|
|
181
|
+
onSelectedRunChange?.(selected);
|
|
342
182
|
return;
|
|
343
183
|
}
|
|
344
|
-
const workflow = await operation.source.getWorkflow(run.
|
|
184
|
+
const workflow = await operation.source.getWorkflow(run.workflowId);
|
|
345
185
|
if (!isCurrentOperation(operation)) return;
|
|
346
|
-
|
|
186
|
+
const selected = workflow ?? run;
|
|
187
|
+
if (controlledSelectedRun === void 0) setSelection({
|
|
347
188
|
source: operation.source,
|
|
348
|
-
run:
|
|
349
|
-
kind: "workflow",
|
|
350
|
-
record: workflow
|
|
351
|
-
} : run
|
|
189
|
+
run: selected
|
|
352
190
|
});
|
|
191
|
+
onSelectedRunChange?.(selected);
|
|
353
192
|
});
|
|
354
|
-
}, [
|
|
193
|
+
}, [
|
|
194
|
+
controlledSelectedRun,
|
|
195
|
+
isCurrentOperation,
|
|
196
|
+
onSelectedRunChange,
|
|
197
|
+
runAction
|
|
198
|
+
]);
|
|
355
199
|
React.useLayoutEffect(() => {
|
|
356
200
|
activeSourceRef.current = source;
|
|
357
201
|
sourceGenerationRef.current += 1;
|
|
@@ -375,29 +219,22 @@ function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPa
|
|
|
375
219
|
className: cx("think-execution-workbench", className),
|
|
376
220
|
...props,
|
|
377
221
|
children: [
|
|
378
|
-
/* @__PURE__ */ jsxs(
|
|
222
|
+
/* @__PURE__ */ jsxs(AppTopBar.Root, {
|
|
379
223
|
className: "think-execution-workbench__header",
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
224
|
+
"aria-label": "Run controls",
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ jsx(AppTopBar.Leading, { children: backButton }),
|
|
227
|
+
/* @__PURE__ */ jsx(AppTopBar.Title, { children: /* @__PURE__ */ jsx("h2", {
|
|
383
228
|
className: "think-execution-workbench__title",
|
|
384
229
|
children: title
|
|
385
|
-
})
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
disabled: busyAction !== null,
|
|
394
|
-
onClick: () => void refresh(),
|
|
395
|
-
children: /* @__PURE__ */ jsx(RefreshIcon, {})
|
|
396
|
-
}) }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
397
|
-
side: "bottom",
|
|
398
|
-
sideOffset: 6,
|
|
399
|
-
children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: "Refresh runs" })
|
|
400
|
-
}) })] })]
|
|
230
|
+
}) }),
|
|
231
|
+
/* @__PURE__ */ jsx(AppTopBar.Trailing, { children: /* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
232
|
+
label: "Refresh runs",
|
|
233
|
+
disabled: busyAction !== null,
|
|
234
|
+
onClick: () => void refresh(),
|
|
235
|
+
children: /* @__PURE__ */ jsx(RefreshIcon, {})
|
|
236
|
+
}) })
|
|
237
|
+
]
|
|
401
238
|
}),
|
|
402
239
|
error ? /* @__PURE__ */ jsx("div", {
|
|
403
240
|
className: "think-execution-workbench__error",
|
|
@@ -427,28 +264,35 @@ function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPa
|
|
|
427
264
|
className: "think-execution-workbench__list",
|
|
428
265
|
role: "list",
|
|
429
266
|
children: runs.map((run) => {
|
|
430
|
-
const id =
|
|
431
|
-
const
|
|
267
|
+
const id = getThinkExecutionRunId(run);
|
|
268
|
+
const kind = isThinkSubmissionRun(run) ? "submission" : "workflow";
|
|
269
|
+
const selected = isSameThinkExecutionRun(selectedRun, run);
|
|
432
270
|
return /* @__PURE__ */ jsxs("li", {
|
|
433
271
|
"data-selected": selected || void 0,
|
|
434
|
-
children: [/* @__PURE__ */ jsxs(
|
|
272
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
435
273
|
type: "button",
|
|
274
|
+
variant: "ghost",
|
|
275
|
+
color: "neutral",
|
|
276
|
+
size: "sm",
|
|
436
277
|
className: "think-execution-workbench__run",
|
|
437
|
-
"aria-label":
|
|
278
|
+
"aria-label": getThinkExecutionRunAccessibleName(run),
|
|
438
279
|
"aria-current": selected ? "page" : void 0,
|
|
439
280
|
disabled: busyAction !== null,
|
|
440
281
|
onClick: () => selectRun(run),
|
|
441
|
-
children: [/* @__PURE__ */ jsx(
|
|
282
|
+
children: [/* @__PURE__ */ jsx(ThinkExecutionStatus, {
|
|
283
|
+
run,
|
|
284
|
+
className: "think-execution-workbench__icon"
|
|
285
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
442
286
|
className: "think-execution-workbench__run-copy",
|
|
443
287
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
444
288
|
className: "think-execution-workbench__run-heading",
|
|
445
289
|
children: [/* @__PURE__ */ jsx("span", {
|
|
446
290
|
className: "think-execution-workbench__run-title",
|
|
447
|
-
children:
|
|
448
|
-
}),
|
|
291
|
+
children: getThinkExecutionRunTitle(run)
|
|
292
|
+
}), getThinkExecutionRunSubtitle(run) ? /* @__PURE__ */ jsx("code", { children: getThinkExecutionRunSubtitle(run) }) : null]
|
|
449
293
|
}), /* @__PURE__ */ jsx("span", {
|
|
450
294
|
className: "think-execution-workbench__run-summary",
|
|
451
|
-
children:
|
|
295
|
+
children: formatThinkExecutionRunProgress(run)
|
|
452
296
|
})]
|
|
453
297
|
})]
|
|
454
298
|
}), /* @__PURE__ */ jsx(RunActions, {
|
|
@@ -457,13 +301,13 @@ function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPa
|
|
|
457
301
|
source,
|
|
458
302
|
onAction: (key, action) => void runAction(key, () => action())
|
|
459
303
|
})]
|
|
460
|
-
}, `${
|
|
304
|
+
}, `${kind}:${id}`);
|
|
461
305
|
})
|
|
462
306
|
})]
|
|
463
307
|
}), /* @__PURE__ */ jsx("section", {
|
|
464
308
|
className: "think-execution-workbench__detail",
|
|
465
309
|
"aria-label": "Run detail",
|
|
466
|
-
children: /* @__PURE__ */ jsx(
|
|
310
|
+
children: /* @__PURE__ */ jsx(ThinkExecutionDetail, { run: selectedRun })
|
|
467
311
|
})]
|
|
468
312
|
})
|
|
469
313
|
]
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as WorkspaceNavigationAdapter } from "../WorkspaceLink-DK1DWMHe.js";
|
|
2
|
+
import { r as WorkspaceFileAssetResolver } from "../WorkspaceFile-DOZkPwzu.js";
|
|
3
|
+
import { r as WorkspaceSource } from "../Workspace-D39LxGvP.js";
|
|
2
4
|
import { ThinkChatMessagesProps } from "./ThinkChat.js";
|
|
5
|
+
import { t as ThinkExecutionRun } from "../ThinkExecutionRun-ChhWhOoU.js";
|
|
6
|
+
import { ThinkFullAppView } from "./ThinkFullAppViewSwitch.js";
|
|
7
|
+
import { ThinkThreadStatusSummary } from "./ThinkThreadPicker.js";
|
|
8
|
+
import { ThinkThreadShell } from "./ThinkThreadShell.js";
|
|
3
9
|
import * as React from "react";
|
|
4
10
|
import { useAgentChat } from "@cloudflare/think/react";
|
|
5
11
|
import { UIMessage } from "ai";
|
|
@@ -11,19 +17,27 @@ import { Think } from "@cloudflare/think";
|
|
|
11
17
|
type ThinkAgent<State = unknown> = Think<object, State>;
|
|
12
18
|
//#endregion
|
|
13
19
|
//#region src/components/ThinkFullApp.d.ts
|
|
20
|
+
type ThinkFullAppMobileView = "chat" | "workbench";
|
|
14
21
|
type ThinkFullAppAgent<State = unknown> = ThinkAgent<State>;
|
|
15
22
|
type ThinkFullAppWorkbenchView = "files" | "execution" | (string & {});
|
|
23
|
+
interface ThinkFullAppWorkspaceConfig {
|
|
24
|
+
source: WorkspaceSource;
|
|
25
|
+
root?: string;
|
|
26
|
+
navigation: WorkspaceNavigationAdapter;
|
|
27
|
+
resolveFileAsset?: WorkspaceFileAssetResolver;
|
|
28
|
+
maxInlineAssetBytes?: number;
|
|
29
|
+
/** Leading workspace control, such as a host-owned Back to chat button. */
|
|
30
|
+
leading?: React.ReactNode;
|
|
31
|
+
actions?: React.ReactNode;
|
|
32
|
+
}
|
|
16
33
|
interface ThinkFullAppPanelContext<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> {
|
|
17
34
|
agent: ReturnType<typeof useAgent<AgentT, State>>;
|
|
18
35
|
chat: ReturnType<typeof useAgentChat<State, MessageT>>;
|
|
19
|
-
workspace?:
|
|
20
|
-
workspaceRoot?: string;
|
|
36
|
+
workspace?: ThinkFullAppWorkspaceConfig;
|
|
21
37
|
}
|
|
22
|
-
interface ThinkFullAppPanel<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> {
|
|
38
|
+
interface ThinkFullAppPanel<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> extends ThinkFullAppView {
|
|
23
39
|
/** Unique panel id used by `workbenchView`; custom panels should not reuse built-in ids. */
|
|
24
40
|
id: ThinkFullAppWorkbenchView;
|
|
25
|
-
label: string;
|
|
26
|
-
icon: React.ReactNode;
|
|
27
41
|
render: (context: ThinkFullAppPanelContext<AgentT, State, MessageT>) => React.ReactNode;
|
|
28
42
|
}
|
|
29
43
|
interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -31,22 +45,43 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
|
|
|
31
45
|
agent: ReturnType<typeof useAgent<AgentT, State>>;
|
|
32
46
|
/** The `useAgentChat` value from `@cloudflare/think/react` used by the chat surface. */
|
|
33
47
|
chat: ReturnType<typeof useAgentChat<State, MessageT>>;
|
|
34
|
-
/**
|
|
35
|
-
workspace?:
|
|
36
|
-
/**
|
|
37
|
-
|
|
48
|
+
/** Atomic workspace source, navigation, media, and header configuration. */
|
|
49
|
+
workspace?: ThinkFullAppWorkspaceConfig;
|
|
50
|
+
/** Product-specific actions rendered in the application top bar. */
|
|
51
|
+
appBarActions?: React.ReactNode;
|
|
52
|
+
/** Product-specific navigation rendered after the built-in sidebar control. */
|
|
53
|
+
appBarLeading?: React.ReactNode;
|
|
54
|
+
/** Active conversation or page title rendered in the application top bar. */
|
|
55
|
+
appBarTitle?: React.ReactNode;
|
|
56
|
+
/** Aggregate thread activity rendered beside the compact thread-title disclosure. */
|
|
57
|
+
threadStatusSummary?: ThinkThreadStatusSummary;
|
|
58
|
+
/** Whether to include the built-in Execution workbench. Defaults to true. */
|
|
59
|
+
showExecutionWorkbench?: boolean;
|
|
60
|
+
/** Whole native execution selected by a parent-owned record. */
|
|
61
|
+
selectedExecutionRun?: ThinkExecutionRun | null;
|
|
62
|
+
/** Receives the whole native execution selected in the workbench. */
|
|
63
|
+
onSelectedExecutionRunChange?: (run: ThinkExecutionRun) => void;
|
|
38
64
|
/** Message rendering labels and approval overrides for ThinkChat. */
|
|
39
65
|
messages?: ThinkChatMessagesProps<MessageT>;
|
|
40
66
|
/** Extra workbench panels appended after the built-in Files and Execution panels. */
|
|
41
67
|
workbenchPanels?: readonly ThinkFullAppPanel<AgentT, State, MessageT>[];
|
|
42
|
-
/**
|
|
43
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Optional parent-owned thread picker/sidebar rendered beside the selected child app.
|
|
70
|
+
* Use the render form to close the compact drawer after selecting a thread.
|
|
71
|
+
*/
|
|
72
|
+
threadSidebar?: React.ComponentProps<typeof ThinkThreadShell>["sidebar"];
|
|
44
73
|
/** Whether the thread sidebar is open. Omit for internal state. */
|
|
45
74
|
threadSidebarOpen?: boolean;
|
|
46
75
|
/** Initial thread sidebar state when `threadSidebarOpen` is uncontrolled. */
|
|
47
76
|
defaultThreadSidebarOpen?: boolean;
|
|
48
77
|
/** Called when the thread sidebar is opened or closed. */
|
|
49
78
|
onThreadSidebarOpenChange?: (open: boolean) => void;
|
|
79
|
+
/** Visible surface at narrow widths. Omit for internal state. */
|
|
80
|
+
mobileView?: ThinkFullAppMobileView;
|
|
81
|
+
/** Initial narrow-width surface when `mobileView` is uncontrolled. */
|
|
82
|
+
defaultMobileView?: ThinkFullAppMobileView;
|
|
83
|
+
/** Called when narrow layouts switch between chat and the workbench. */
|
|
84
|
+
onMobileViewChange?: (view: ThinkFullAppMobileView) => void;
|
|
50
85
|
/** Selected workbench lane. Use this when the parent app stores the lane in route state. */
|
|
51
86
|
workbenchView?: ThinkFullAppWorkbenchView;
|
|
52
87
|
/** Initial workbench lane when `workbenchView` is uncontrolled. */
|
|
@@ -57,24 +92,33 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
|
|
|
57
92
|
/** Combines ThinkChat with an optional resizable workbench shell. */
|
|
58
93
|
declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage>({
|
|
59
94
|
agent,
|
|
95
|
+
appBarActions,
|
|
96
|
+
appBarLeading,
|
|
97
|
+
appBarTitle,
|
|
60
98
|
chat,
|
|
61
99
|
className,
|
|
100
|
+
defaultMobileView,
|
|
62
101
|
defaultWorkbenchView,
|
|
63
102
|
defaultThreadSidebarOpen,
|
|
64
103
|
messages,
|
|
104
|
+
mobileView,
|
|
105
|
+
onMobileViewChange,
|
|
106
|
+
onSelectedExecutionRunChange,
|
|
65
107
|
onThreadSidebarOpenChange,
|
|
66
108
|
onWorkbenchViewChange,
|
|
67
109
|
ref,
|
|
110
|
+
selectedExecutionRun,
|
|
111
|
+
showExecutionWorkbench,
|
|
68
112
|
style,
|
|
69
113
|
threadSidebar,
|
|
70
114
|
threadSidebarOpen,
|
|
115
|
+
threadStatusSummary,
|
|
71
116
|
workbenchPanels,
|
|
72
117
|
workbenchView,
|
|
73
118
|
workspace,
|
|
74
|
-
workspaceRoot,
|
|
75
119
|
...props
|
|
76
120
|
}: ThinkFullAppProps<AgentT, State, MessageT> & {
|
|
77
121
|
ref?: React.Ref<HTMLDivElement>;
|
|
78
122
|
}): React.JSX.Element;
|
|
79
123
|
//#endregion
|
|
80
|
-
export { ThinkFullApp, ThinkFullAppAgent, ThinkFullAppPanel, ThinkFullAppPanelContext, ThinkFullAppProps, ThinkFullAppWorkbenchView };
|
|
124
|
+
export { ThinkFullApp, ThinkFullAppAgent, ThinkFullAppMobileView, ThinkFullAppPanel, ThinkFullAppPanelContext, ThinkFullAppProps, ThinkFullAppWorkbenchView, ThinkFullAppWorkspaceConfig };
|