@mcp-b/react-components 0.23.0 → 0.25.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/{AgentChat-Bm1qYbOo.d.ts → AgentChat-DHxdTjwF.d.ts} +34 -7
- package/dist/{CodeBlock-Cp67Njo3.js → CodeBlock-B3RLU3ez.js} +1 -1
- package/dist/{FileTree-DW60q1w7.js → FileTree-CYr5og0q.js} +1 -1
- package/dist/{Message-_-bEYLAO.js → Message-KlK8tlBZ.js} +1 -1
- package/dist/{ModelSelector-Brvj9Cab.js → ModelSelector-YTlqkIjs.js} +1 -1
- package/dist/{ThinkChat-E_HrfH76.js → ThinkChat-DVhCEjq-.js} +11 -2
- package/dist/{ThinkChatActivity-2BobmuvR.d.ts → ThinkChatActivity-DMTHKWrI.d.ts} +11 -9
- package/dist/{ThinkChatContext-DrsZqdaO.d.ts → ThinkChatContext-B-Nk84Wi.d.ts} +13 -1
- package/dist/{ThinkRecoveryNotice-DFIcG9UX.d.ts → ThinkRecoveryNotice-D6gYcBbr.d.ts} +1 -1
- package/dist/{WorkspaceFileView-rUEN2iox.js → WorkspaceFileView-CuMjXYQn.js} +3 -3
- package/dist/components/Activity.d.ts +11 -0
- package/dist/components/Activity.js +16 -4
- package/dist/components/AgentActivity.js +1 -1
- package/dist/components/AgentActivityPreview.js +1 -1
- package/dist/components/AgentChat.d.ts +1 -1
- package/dist/components/AgentChat.js +174 -94
- package/dist/components/AgentChatStartScreen.js +1 -1
- package/dist/components/AgentConnection.js +2 -2
- package/dist/components/AgentMessageParts.js +6 -2
- package/dist/components/AgentToolDetail.d.ts +1 -1
- package/dist/components/AgentToolDetail.js +2 -2
- package/dist/components/Approval.js +1 -1
- 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/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +1 -1
- package/dist/components/ChatGptSignInScreen.js +2 -2
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/Checkpoint.js +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/EnvironmentVariables.js +2 -2
- package/dist/components/ExpansionState.d.ts +51 -0
- package/dist/components/ExpansionState.js +46 -0
- package/dist/components/FileTree.js +1 -1
- package/dist/components/FormattedDate.d.ts +21 -0
- package/dist/components/FormattedDate.js +20 -0
- package/dist/components/Goal.d.ts +87 -0
- package/dist/components/Goal.js +92 -0
- package/dist/components/LinkButton.d.ts +46 -0
- package/dist/components/LinkButton.js +28 -0
- package/dist/components/McpConnectionRequest.js +1 -1
- package/dist/components/McpPluginCatalog.js +1 -1
- package/dist/components/McpServerPicker.js +1 -1
- package/dist/components/MediaPreviewCard.js +13 -2
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.js +1 -1
- package/dist/components/MessageScrollerVirtual.d.ts +72 -0
- package/dist/components/MessageScrollerVirtual.js +110 -0
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/Plan.js +1 -1
- package/dist/components/PricingPlanCard.js +1 -1
- package/dist/components/PromptInput.js +1 -1
- package/dist/components/Queue.js +1 -1
- package/dist/components/Reasoning.js +2 -2
- package/dist/components/ResponsiveSidebarShell.js +1 -1
- package/dist/components/SearchField.js +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/components/SessionCompaction.d.ts +58 -0
- package/dist/components/SessionCompaction.js +117 -0
- package/dist/components/Shell.d.ts +149 -0
- package/dist/components/Shell.js +116 -0
- package/dist/components/Sources.js +1 -1
- package/dist/components/Stepper.js +1 -1
- package/dist/components/SubagentRunIndicator.js +1 -1
- package/dist/components/Task.js +1 -1
- package/dist/components/Terminal.js +2 -2
- package/dist/components/TestResults.js +1 -1
- package/dist/components/ThemeModeControl.js +1 -1
- package/dist/components/ThinkChat.d.ts +6 -6
- package/dist/components/ThinkChat.js +1 -1
- package/dist/components/ThinkChatActivity.d.ts +1 -1
- package/dist/components/ThinkChatActivity.js +68 -14
- package/dist/components/ThinkChatContext.d.ts +2 -2
- package/dist/components/ThinkChatContext.js +5 -1
- package/dist/components/ThinkChatToolPanels.js +1 -1
- package/dist/components/ThinkExecutionDetail.js +1 -1
- package/dist/components/ThinkExecutionStatus.js +1 -1
- package/dist/components/ThinkExecutionWorkbench.d.ts +4 -3
- package/dist/components/ThinkExecutionWorkbench.js +7 -10
- package/dist/components/ThinkFullApp.js +65 -54
- package/dist/components/ThinkRecoveryNotice.d.ts +1 -1
- package/dist/components/ThinkRoutineBrowser.js +1 -1
- package/dist/components/ThinkRoutineForm.js +1 -1
- package/dist/components/ThinkRoutineLibrary.js +1 -1
- package/dist/components/ThinkThreadPicker.js +1 -1
- package/dist/components/Toast.js +1 -1
- package/dist/components/ToolInvocation.d.ts +8 -1
- package/dist/components/ToolInvocation.js +3 -2
- package/dist/components/WebPreview.js +1 -1
- package/dist/components/WorkspaceBrowser.js +1 -1
- package/dist/components/WorkspaceExplorer.js +1 -1
- package/dist/components/WorkspaceFileView.js +1 -1
- package/dist/components/WorkspaceHeader.js +1 -1
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-TWq8nZhc.js → copy-button-Buxmtmp9.js} +1 -1
- package/dist/{icons-wP1yFUXF.d.ts → icons-Cih3W-zM.d.ts} +6 -1
- package/dist/{icons-ua6f_GH3.js → icons-w5PpKGRz.js} +3 -2
- package/dist/styles/activity.css +6 -0
- package/dist/styles/agent-chat.css +20 -4
- package/dist/styles/composition-motion.css +13 -23
- package/dist/styles/goal.css +57 -0
- package/dist/styles/index.css +2 -0
- package/dist/styles/message-scroller.css +25 -0
- package/dist/styles/responsive-sidebar-shell.css +12 -0
- package/dist/styles/shell.css +122 -0
- package/dist/styles/think-full-app.css +22 -14
- package/package.json +7 -6
- package/dist/view-transitions-DyUP0lSg.js +0 -77
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { Button } from "./Button.js";
|
|
2
|
+
import { useExpansionState } from "./ExpansionState.js";
|
|
1
3
|
import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityText, ActivityTrigger } from "./Activity.js";
|
|
2
4
|
import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
|
|
3
|
-
import { f as MessageResponse } from "../Message-
|
|
5
|
+
import { f as MessageResponse } from "../Message-KlK8tlBZ.js";
|
|
4
6
|
import { isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartWorking, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart } from "./ThinkChatToolParts.js";
|
|
5
7
|
import { useOptionalAgentToolRuns } from "./AgentToolRunsContext.js";
|
|
6
8
|
import { SubagentRunList } from "./SubagentRunList.js";
|
|
7
|
-
import {
|
|
9
|
+
import { useOptionalThinkChatLive } from "./ThinkChatContext.js";
|
|
8
10
|
import { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSessionContextPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel } from "./ThinkChatToolPanels.js";
|
|
9
11
|
import { activityPartIconKind, activityPartUrl, deriveThinkChatActivityHeader, describeThinkChatActivityPart } from "./ThinkChatActivitySummary.js";
|
|
10
12
|
import * as React from "react";
|
|
@@ -22,7 +24,15 @@ function activityPartIcon(part) {
|
|
|
22
24
|
* with per-tool panels. Normally reached through `ThinkChat.Messages`;
|
|
23
25
|
* exported for apps that lay out messages themselves.
|
|
24
26
|
*/
|
|
25
|
-
|
|
27
|
+
/**
|
|
28
|
+
* An expanded run shows at most this many trailing steps before a "show
|
|
29
|
+
* earlier" reveal. Steps inside the live message get new identities on every
|
|
30
|
+
* streamed delta (the AI SDK clones the streaming message), so memoization
|
|
31
|
+
* can't bound an open log — capping the mounted rows is what keeps a
|
|
32
|
+
* thousands-of-tools run expandable.
|
|
33
|
+
*/
|
|
34
|
+
const VISIBLE_STEP_LIMIT = 100;
|
|
35
|
+
function ThinkChatActivity({ parts, defaultOpen, isStreaming, toolRenderers, stateKey }) {
|
|
26
36
|
const steps = parts.flatMap((part, index) => {
|
|
27
37
|
const description = describeThinkChatActivityPart(part, toolRenderers);
|
|
28
38
|
if (!description) return [];
|
|
@@ -32,7 +42,11 @@ function ThinkChatActivity({ parts, defaultOpen, isStreaming, toolRenderers }) {
|
|
|
32
42
|
part
|
|
33
43
|
}];
|
|
34
44
|
});
|
|
45
|
+
const scope = `run:${stateKey ?? steps[0]?.key}`;
|
|
46
|
+
const [showAllSteps, setShowAllSteps] = useExpansionState(steps.length ? `${scope}:all-steps` : void 0, false);
|
|
35
47
|
if (steps.length === 0) return null;
|
|
48
|
+
const hiddenStepCount = showAllSteps ? 0 : Math.max(0, steps.length - VISIBLE_STEP_LIMIT);
|
|
49
|
+
const visibleSteps = hiddenStepCount ? steps.slice(hiddenStepCount) : steps;
|
|
36
50
|
const streaming = isStreaming ?? parts.some(isPartWorking);
|
|
37
51
|
const header = deriveThinkChatActivityHeader(parts, {
|
|
38
52
|
isStreaming: streaming,
|
|
@@ -42,18 +56,31 @@ function ThinkChatActivity({ parts, defaultOpen, isStreaming, toolRenderers }) {
|
|
|
42
56
|
return /* @__PURE__ */ jsxs(Activity, {
|
|
43
57
|
isStreaming: streaming,
|
|
44
58
|
defaultOpen,
|
|
59
|
+
stateKey: scope,
|
|
45
60
|
children: [/* @__PURE__ */ jsx(ActivityTrigger, {
|
|
46
61
|
icon: header.url ? /* @__PURE__ */ jsx(AgentActivityFavicon, { url: header.url }) : /* @__PURE__ */ jsx(AgentActivityIcon, { kind: header.iconKind }),
|
|
47
62
|
action: header.action,
|
|
48
63
|
detail: header.detail
|
|
49
|
-
}), /* @__PURE__ */
|
|
64
|
+
}), /* @__PURE__ */ jsxs(ActivityContent, { children: [hiddenStepCount > 0 ? /* @__PURE__ */ jsxs(Button, {
|
|
65
|
+
size: "sm",
|
|
66
|
+
variant: "ghost",
|
|
67
|
+
className: "activity__show-earlier",
|
|
68
|
+
onClick: () => setShowAllSteps(true),
|
|
69
|
+
children: [
|
|
70
|
+
"Show ",
|
|
71
|
+
hiddenStepCount,
|
|
72
|
+
" earlier ",
|
|
73
|
+
hiddenStepCount === 1 ? "step" : "steps"
|
|
74
|
+
]
|
|
75
|
+
}) : null, visibleSteps.map((step) => /* @__PURE__ */ jsx(ThinkChatActivityStep, {
|
|
76
|
+
stateKey: `${scope}:${step.key}`,
|
|
50
77
|
description: step.description,
|
|
51
78
|
part: step.part,
|
|
52
79
|
toolRenderers
|
|
53
|
-
}, step.key)) })]
|
|
80
|
+
}, step.key))] })]
|
|
54
81
|
});
|
|
55
82
|
}
|
|
56
|
-
function ThinkChatActivityStep({ description, part, toolRenderers }) {
|
|
83
|
+
function ThinkChatActivityStep({ description, part, stateKey, toolRenderers }) {
|
|
57
84
|
const icon = activityPartIcon(part);
|
|
58
85
|
const { action: text, detail } = description;
|
|
59
86
|
if (isToolUIPart(part)) {
|
|
@@ -67,6 +94,7 @@ function ThinkChatActivityStep({ description, part, toolRenderers }) {
|
|
|
67
94
|
action: text,
|
|
68
95
|
detail,
|
|
69
96
|
icon,
|
|
97
|
+
stateKey,
|
|
70
98
|
children: customPanel
|
|
71
99
|
});
|
|
72
100
|
}
|
|
@@ -74,42 +102,49 @@ function ThinkChatActivityStep({ description, part, toolRenderers }) {
|
|
|
74
102
|
action: text,
|
|
75
103
|
detail,
|
|
76
104
|
icon,
|
|
105
|
+
stateKey,
|
|
77
106
|
children: /* @__PURE__ */ jsx(ActivityText, { children: /* @__PURE__ */ jsx(MessageResponse, { children: part.text }) })
|
|
78
107
|
});
|
|
79
108
|
if (isWorkspaceToolPart(part) && part.type !== "tool-delete") return /* @__PURE__ */ jsx(ActivityItemGroup, {
|
|
80
109
|
action: text,
|
|
81
110
|
detail,
|
|
82
111
|
icon,
|
|
112
|
+
stateKey,
|
|
83
113
|
children: /* @__PURE__ */ jsx(ThinkChatWorkspacePanel, { part })
|
|
84
114
|
});
|
|
85
115
|
if (isSkillToolPart(part)) return /* @__PURE__ */ jsx(ActivityItemGroup, {
|
|
86
116
|
action: text,
|
|
87
117
|
detail,
|
|
88
118
|
icon,
|
|
119
|
+
stateKey,
|
|
89
120
|
children: /* @__PURE__ */ jsx(ThinkChatSkillPanel, { part })
|
|
90
121
|
});
|
|
91
122
|
if (isSessionContextToolPart(part)) return /* @__PURE__ */ jsx(ActivityItemGroup, {
|
|
92
123
|
action: text,
|
|
93
124
|
detail,
|
|
94
125
|
icon,
|
|
126
|
+
stateKey,
|
|
95
127
|
children: /* @__PURE__ */ jsx(ThinkChatSessionContextPanel, { part })
|
|
96
128
|
});
|
|
97
129
|
if (isFetchToolPart(part)) return /* @__PURE__ */ jsx(ActivityItemGroup, {
|
|
98
130
|
action: text,
|
|
99
131
|
detail,
|
|
100
132
|
icon,
|
|
133
|
+
stateKey,
|
|
101
134
|
children: /* @__PURE__ */ jsx(ThinkChatFetchPanel, { part })
|
|
102
135
|
});
|
|
103
136
|
if (isBrowserToolPart(part)) return /* @__PURE__ */ jsx(ActivityItemGroup, {
|
|
104
137
|
action: text,
|
|
105
138
|
detail,
|
|
106
139
|
icon,
|
|
140
|
+
stateKey,
|
|
107
141
|
children: /* @__PURE__ */ jsx(ThinkChatBrowserPanel, { part })
|
|
108
142
|
});
|
|
109
143
|
if (isExecuteToolPart(part)) return /* @__PURE__ */ jsx(ActivityItemGroup, {
|
|
110
144
|
action: text,
|
|
111
145
|
detail,
|
|
112
146
|
icon,
|
|
147
|
+
stateKey,
|
|
113
148
|
children: /* @__PURE__ */ jsx(ThinkChatExecutePanel, { part })
|
|
114
149
|
});
|
|
115
150
|
return /* @__PURE__ */ jsx(ActivityItem, {
|
|
@@ -118,9 +153,9 @@ function ThinkChatActivityStep({ description, part, toolRenderers }) {
|
|
|
118
153
|
children: text
|
|
119
154
|
});
|
|
120
155
|
}
|
|
121
|
-
function ThinkChatActivityGroup({ message, parts, renderAgentToolRunLink, isTrailing, toolRenderers }) {
|
|
122
|
-
const
|
|
123
|
-
const
|
|
156
|
+
function ThinkChatActivityGroup({ message, parts, renderAgentToolRunLink, isTrailing, toolRenderers, stateKey }) {
|
|
157
|
+
const live = useOptionalThinkChatLive();
|
|
158
|
+
const streaming = isTrailing && (live ? live.isStreaming && live.lastMessageId === message.id : parts.some(isPartWorking));
|
|
124
159
|
const agentTools = useOptionalAgentToolRuns();
|
|
125
160
|
const runs = React.useMemo(() => {
|
|
126
161
|
if (!agentTools || !renderAgentToolRunLink) return [];
|
|
@@ -132,8 +167,9 @@ function ThinkChatActivityGroup({ message, parts, renderAgentToolRunLink, isTrai
|
|
|
132
167
|
]);
|
|
133
168
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ThinkChatActivity, {
|
|
134
169
|
parts,
|
|
135
|
-
isStreaming:
|
|
136
|
-
toolRenderers
|
|
170
|
+
isStreaming: streaming,
|
|
171
|
+
toolRenderers,
|
|
172
|
+
stateKey
|
|
137
173
|
}), runs.length && renderAgentToolRunLink ? /* @__PURE__ */ jsx(SubagentRunList, {
|
|
138
174
|
className: "subagent-run__list--adjacent",
|
|
139
175
|
"aria-label": "Delegated agent runs",
|
|
@@ -151,17 +187,35 @@ function ThinkChatActivityGroup({ message, parts, renderAgentToolRunLink, isTrai
|
|
|
151
187
|
function createThinkChatActivityRenderer({ excludeTools, renderAgentToolRunLink, toolRenderers } = {}) {
|
|
152
188
|
const excluded = excludeTools?.length ? new Set(excludeTools) : void 0;
|
|
153
189
|
const isActivity = (part) => isThinkChatActivityPart(part, excluded);
|
|
190
|
+
const runStartsCache = /* @__PURE__ */ new WeakMap();
|
|
191
|
+
const runStartsFor = (parts) => {
|
|
192
|
+
let starts = runStartsCache.get(parts);
|
|
193
|
+
if (!starts) {
|
|
194
|
+
starts = Array.from({ length: parts.length }, () => -1);
|
|
195
|
+
let runStart = -1;
|
|
196
|
+
for (let index = 0; index < parts.length; index++) if (isActivity(parts[index])) {
|
|
197
|
+
if (runStart === -1) runStart = index;
|
|
198
|
+
starts[index] = runStart;
|
|
199
|
+
} else {
|
|
200
|
+
starts[index] = -1;
|
|
201
|
+
runStart = -1;
|
|
202
|
+
}
|
|
203
|
+
runStartsCache.set(parts, starts);
|
|
204
|
+
}
|
|
205
|
+
return starts;
|
|
206
|
+
};
|
|
154
207
|
return (context) => {
|
|
155
208
|
const { message, part, partIndex } = context;
|
|
156
209
|
if (!isActivity(part)) return void 0;
|
|
157
|
-
|
|
158
|
-
|
|
210
|
+
const runStarts = runStartsFor(message.parts);
|
|
211
|
+
const start = runStarts[partIndex] ?? partIndex;
|
|
159
212
|
if (partIndex !== start) return null;
|
|
160
213
|
let end = partIndex;
|
|
161
|
-
while (end + 1 < message.parts.length &&
|
|
214
|
+
while (end + 1 < message.parts.length && runStarts[end + 1] === start) end++;
|
|
162
215
|
return /* @__PURE__ */ jsx(ThinkChatActivityGroup, {
|
|
163
216
|
message,
|
|
164
217
|
parts: message.parts.slice(start, end + 1),
|
|
218
|
+
stateKey: `${message.id}:${start}`,
|
|
165
219
|
isTrailing: end === message.parts.length - 1,
|
|
166
220
|
toolRenderers,
|
|
167
221
|
renderAgentToolRunLink
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
export { ThinkChatContext, ThinkChatValue, useOptionalThinkChatContext, useThinkChatContext };
|
|
1
|
+
import { a as useOptionalThinkChatContext, i as ThinkChatValue, n as ThinkChatLiveContext, o as useOptionalThinkChatLive, r as ThinkChatLiveValue, s as useThinkChatContext, t as ThinkChatContext } from "../ThinkChatContext-B-Nk84Wi.js";
|
|
2
|
+
export { ThinkChatContext, ThinkChatLiveContext, ThinkChatLiveValue, ThinkChatValue, useOptionalThinkChatContext, useOptionalThinkChatLive, useThinkChatContext };
|
|
@@ -13,5 +13,9 @@ function useThinkChatContext(component) {
|
|
|
13
13
|
if (!context) throw new Error(`${component} must be used inside <ThinkChat.Provider> or <ThinkChat.Root>.`);
|
|
14
14
|
return context;
|
|
15
15
|
}
|
|
16
|
+
const ThinkChatLiveContext = React.createContext(null);
|
|
17
|
+
function useOptionalThinkChatLive() {
|
|
18
|
+
return React.useContext(ThinkChatLiveContext);
|
|
19
|
+
}
|
|
16
20
|
//#endregion
|
|
17
|
-
export { ThinkChatContext, useOptionalThinkChatContext, useThinkChatContext };
|
|
21
|
+
export { ThinkChatContext, ThinkChatLiveContext, useOptionalThinkChatContext, useOptionalThinkChatLive, useThinkChatContext };
|
|
@@ -1,7 +1,7 @@
|
|
|
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-B3RLU3ez.js";
|
|
5
5
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
6
6
|
import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
|
|
7
7
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
-
import { C as FileIcon, O as InfoIcon,
|
|
2
|
+
import { C as FileIcon, O as InfoIcon, Q as TerminalIcon, W as RefreshIcon, d as CheckIcon, n as ArrowDownIcon, nt as XIcon } from "../icons-w5PpKGRz.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
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
-
import { O as InfoIcon, d as CheckIcon,
|
|
2
|
+
import { O as InfoIcon, d as CheckIcon, nt as XIcon, q as SpinnerIcon, z as PauseIcon } from "../icons-w5PpKGRz.js";
|
|
3
3
|
import { Tooltip } from "./Tooltip.js";
|
|
4
4
|
import { formatThinkExecutionStatus, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone } from "./ThinkExecutionRun.js";
|
|
5
5
|
import "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ThinkExecutionRun } from "../ThinkExecutionRun-ChhWhOoU.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { DataTag,
|
|
3
|
+
import { DataTag, UnusedSkipTokenOptions } from "@tanstack/react-query";
|
|
4
4
|
import { Think, ThinkSubmissionInspection } from "@cloudflare/think";
|
|
5
5
|
import { AgentStub } from "agents/client";
|
|
6
6
|
import { WorkflowPage } from "agents/workflows";
|
|
@@ -29,7 +29,7 @@ interface ThinkExecutionRunsData {
|
|
|
29
29
|
type ThinkExecutionRunsQueryKey = readonly ["think", sourceKey: string, "execution-runs", {
|
|
30
30
|
readonly limit: number;
|
|
31
31
|
}];
|
|
32
|
-
type ThinkExecutionRunsQueryOptions =
|
|
32
|
+
type ThinkExecutionRunsQueryOptions = UnusedSkipTokenOptions<ThinkExecutionRunsData, Error, ThinkExecutionRunsData, ThinkExecutionRunsQueryKey> & {
|
|
33
33
|
queryKey: DataTag<ThinkExecutionRunsQueryKey, ThinkExecutionRunsData, Error>;
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
@@ -39,7 +39,8 @@ declare function thinkExecutionRunsQueryOptions(source: AgentStub<Think>, source
|
|
|
39
39
|
/**
|
|
40
40
|
* Unified execution history for native Think submissions and Agents workflows.
|
|
41
41
|
* The workbench reads and acts through the whole upstream agent stub; it does
|
|
42
|
-
* not normalize execution records or own workflow authoring.
|
|
42
|
+
* not normalize execution records or own workflow authoring. Its first
|
|
43
|
+
* uncached list read suspends to the consuming route's Suspense boundary.
|
|
43
44
|
*/
|
|
44
45
|
declare function ThinkExecutionWorkbench({
|
|
45
46
|
backButton,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { buttonVariants } from "./Button.js";
|
|
3
|
-
import { W as RefreshIcon, b as EllipsisIcon } from "../icons-
|
|
3
|
+
import { W as RefreshIcon, b as EllipsisIcon } from "../icons-w5PpKGRz.js";
|
|
4
4
|
import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
|
|
5
5
|
import { IconButton } from "./IconButton.js";
|
|
6
6
|
import { EmptyState } from "./EmptyState.js";
|
|
@@ -11,7 +11,7 @@ import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
|
|
|
11
11
|
import { ThinkExecutionDetail } from "./ThinkExecutionDetail.js";
|
|
12
12
|
import * as React from "react";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { queryOptions, useMutation,
|
|
14
|
+
import { queryOptions, useMutation, useSuspenseQuery } from "@tanstack/react-query";
|
|
15
15
|
//#region src/components/ThinkExecutionWorkbench.tsx
|
|
16
16
|
const executionPanelPageSize = 20;
|
|
17
17
|
function getErrorMessage(error) {
|
|
@@ -116,13 +116,14 @@ function thinkExecutionRunsQueryOptions(source, sourceKey, pageSize = executionP
|
|
|
116
116
|
/**
|
|
117
117
|
* Unified execution history for native Think submissions and Agents workflows.
|
|
118
118
|
* The workbench reads and acts through the whole upstream agent stub; it does
|
|
119
|
-
* not normalize execution records or own workflow authoring.
|
|
119
|
+
* not normalize execution records or own workflow authoring. Its first
|
|
120
|
+
* uncached list read suspends to the consuming route's Suspense boundary.
|
|
120
121
|
*/
|
|
121
122
|
function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPanelPageSize, ref, renderRunLink, selectedRun, source, sourceKey, title = "Execution", ...props }) {
|
|
122
123
|
const runsId = React.useId();
|
|
123
124
|
const runsOptions = thinkExecutionRunsQueryOptions(source, sourceKey, pageSize);
|
|
124
125
|
const runsQueryKey = thinkExecutionRunsScopeQueryKey(sourceKey);
|
|
125
|
-
const runsQuery =
|
|
126
|
+
const runsQuery = useSuspenseQuery(runsOptions);
|
|
126
127
|
const actionMutation = useMutation({
|
|
127
128
|
mutationFn: ({ action }) => action(),
|
|
128
129
|
onSuccess: (_result, action, _onMutateResult, context) => context.client.invalidateQueries({ queryKey: action.runsQueryKey })
|
|
@@ -131,7 +132,7 @@ function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPa
|
|
|
131
132
|
const actionIsPending = currentAction !== null && actionMutation.isPending;
|
|
132
133
|
const busyAction = actionIsPending ? currentAction.key : runsQuery.isFetching ? "refresh" : null;
|
|
133
134
|
const error = currentAction && actionMutation.isError ? actionMutation.error : runsQuery.error;
|
|
134
|
-
const runs = React.useMemo(() => [...runsQuery.data
|
|
135
|
+
const runs = React.useMemo(() => [...runsQuery.data.submissions, ...runsQuery.data.workflows.workflows].sort((first, second) => Number(second.createdAt) - Number(first.createdAt)), [runsQuery.data]);
|
|
135
136
|
const runAction = (key, action) => {
|
|
136
137
|
actionMutation.mutate({
|
|
137
138
|
action,
|
|
@@ -182,11 +183,7 @@ function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPa
|
|
|
182
183
|
id: runsId,
|
|
183
184
|
children: "Runs"
|
|
184
185
|
})
|
|
185
|
-
}),
|
|
186
|
-
className: "think-execution-workbench__empty",
|
|
187
|
-
role: "status",
|
|
188
|
-
description: "Loading runs..."
|
|
189
|
-
}) : runs.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
186
|
+
}), runs.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
190
187
|
className: "think-execution-workbench__empty",
|
|
191
188
|
description: "No runs yet."
|
|
192
189
|
}) : /* @__PURE__ */ jsx("ul", {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Button } from "./Button.js";
|
|
3
|
-
import { C as FileIcon,
|
|
3
|
+
import { C as FileIcon, Q as TerminalIcon, c as BoxIcon, f as ChevronDownIcon, q as SpinnerIcon } from "../icons-w5PpKGRz.js";
|
|
4
4
|
import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../WorkspaceLink-BYYeTQLf.js";
|
|
5
5
|
import { n as mergeRefs } from "../merge-refs-DF_7w2x_.js";
|
|
6
6
|
import { AppTopBar } from "./AppTopBar.js";
|
|
7
|
-
import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-
|
|
7
|
+
import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-DVhCEjq-.js";
|
|
8
8
|
import { useWorkspace } from "./Workspace.js";
|
|
9
9
|
import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
|
|
10
10
|
import { ScrollArea } from "./ScrollArea.js";
|
|
11
11
|
import { McpPluginCatalog } from "./McpPluginCatalog.js";
|
|
12
|
-
import { n as runViewTransition } from "../view-transitions-DyUP0lSg.js";
|
|
13
12
|
import { ResizableSidePanel } from "./ResizableSidePanel.js";
|
|
14
13
|
import { ThinkExecutionWorkbench } from "./ThinkExecutionWorkbench.js";
|
|
15
14
|
import { ThinkFullAppViewSwitch } from "./ThinkFullAppViewSwitch.js";
|
|
@@ -49,8 +48,8 @@ function PluginsPanel({ config }) {
|
|
|
49
48
|
/** Combines ThinkChat with an optional resizable workbench shell. */
|
|
50
49
|
function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat, className, defaultMobileView, defaultWorkbenchView, defaultThreadSidebarOpen, hideAppBarInWorkbench = false, messages, mobileView, onMobileViewChange, onThreadSidebarOpenChange, onWorkbenchViewChange, plugins, ref, renderAgentToolRunLink, renderExecutionRunLink, selectedExecutionRun, showAgentTools = true, showExecutionWorkbench = true, showMobileViewSwitch = true, sourceKey, style, threadSidebar, threadSidebarOpen, threadStatusSummary, workbenchPanels, workbenchView, workspace, ...props }) {
|
|
51
50
|
const appRef = React.useRef(null);
|
|
52
|
-
const viewScopeRef = React.useRef(null);
|
|
53
51
|
const workbenchPanelRef = React.useRef(null);
|
|
52
|
+
const pendingPanelFocusRef = React.useRef(null);
|
|
54
53
|
const approvals = useThinkPendingExecutionApprovals(agent.stub, sourceKey, `${chat.messages.length}:${chat.status}`, messages?.approvalsEnabled !== false);
|
|
55
54
|
const resolvedMessages = React.useMemo(() => {
|
|
56
55
|
const approvalProps = resolveThinkApprovalProps({
|
|
@@ -91,10 +90,7 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
|
|
|
91
90
|
onMobileViewChange?.(next);
|
|
92
91
|
}, [mobileView, onMobileViewChange]);
|
|
93
92
|
const updateAppView = React.useCallback((update) => {
|
|
94
|
-
|
|
95
|
-
scope: viewScopeRef.current,
|
|
96
|
-
update
|
|
97
|
-
});
|
|
93
|
+
React.startTransition(update);
|
|
98
94
|
}, []);
|
|
99
95
|
const panelContext = React.useMemo(() => ({
|
|
100
96
|
agent,
|
|
@@ -116,12 +112,20 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
|
|
|
116
112
|
id: "execution",
|
|
117
113
|
label: "Execution",
|
|
118
114
|
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
119
|
-
render: ({ agent }) => /* @__PURE__ */ jsx(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
115
|
+
render: ({ agent }) => /* @__PURE__ */ jsx(React.Suspense, {
|
|
116
|
+
fallback: /* @__PURE__ */ jsx("div", {
|
|
117
|
+
className: "think-full-app__workbench",
|
|
118
|
+
role: "status",
|
|
119
|
+
"aria-label": "Loading execution",
|
|
120
|
+
children: /* @__PURE__ */ jsx(SpinnerIcon, {})
|
|
121
|
+
}),
|
|
122
|
+
children: /* @__PURE__ */ jsx(ThinkExecutionWorkbench, {
|
|
123
|
+
source: agent.stub,
|
|
124
|
+
sourceKey,
|
|
125
|
+
title: "Execution",
|
|
126
|
+
selectedRun: selectedExecutionRun,
|
|
127
|
+
renderRunLink: renderExecutionRunLink
|
|
128
|
+
})
|
|
125
129
|
})
|
|
126
130
|
});
|
|
127
131
|
if (plugins) availableWorkbenchPanels.push({
|
|
@@ -139,20 +143,21 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
|
|
|
139
143
|
const workbenchViews = availableWorkbenchPanels;
|
|
140
144
|
const shouldRenderInlineAppBar = !threadSidebar && (Boolean(appBarActions || appBarLeading || appBarTitle || threadSidebar) || hasWorkbench);
|
|
141
145
|
const hasAppBarRow = shouldRenderInlineAppBar;
|
|
146
|
+
React.useLayoutEffect(() => {
|
|
147
|
+
const pendingFocus = pendingPanelFocusRef.current;
|
|
148
|
+
if (!pendingFocus || pendingFocus.id !== activeWorkbenchView) return;
|
|
149
|
+
pendingPanelFocusRef.current = null;
|
|
150
|
+
Array.from(workbenchPanelRef.current?.querySelectorAll("button") ?? []).find((button) => button.getAttribute("aria-label") === pendingFocus.label)?.focus({ preventScroll: true });
|
|
151
|
+
}, [activeWorkbenchView]);
|
|
142
152
|
const updateWorkbenchPanel = (next) => {
|
|
143
153
|
const activeElement = document.activeElement;
|
|
144
154
|
const restorePanelSwitchFocus = activeElement instanceof HTMLElement && workbenchPanelRef.current?.contains(activeElement);
|
|
145
155
|
const nextLabel = availableWorkbenchPanels.find((panel) => panel.id === next)?.label;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
scope: workbenchPanelRef.current,
|
|
152
|
-
update: () => setWorkbenchView(next)
|
|
153
|
-
});
|
|
154
|
-
if (transition) transition.updateCallbackDone.then(restoreFocus, restoreFocus);
|
|
155
|
-
else requestAnimationFrame(restoreFocus);
|
|
156
|
+
pendingPanelFocusRef.current = restorePanelSwitchFocus && nextLabel ? {
|
|
157
|
+
id: next,
|
|
158
|
+
label: nextLabel
|
|
159
|
+
} : null;
|
|
160
|
+
React.startTransition(() => setWorkbenchView(next));
|
|
156
161
|
};
|
|
157
162
|
const renderAppTopBar = (sidebarControls) => /* @__PURE__ */ jsxs(AppTopBar.Root, {
|
|
158
163
|
className: "think-full-app__app-bar",
|
|
@@ -230,42 +235,48 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
|
|
|
230
235
|
...props,
|
|
231
236
|
children: [
|
|
232
237
|
shouldRenderInlineAppBar ? renderAppTopBar() : null,
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
238
|
+
/* @__PURE__ */ jsx(React.ViewTransition, {
|
|
239
|
+
default: "sigvelo-layout-transition",
|
|
240
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
241
|
+
className: "think-full-app__view-scope",
|
|
242
|
+
"data-recipe": "application-plane",
|
|
243
|
+
"data-mobile-view": activeMobileView,
|
|
244
|
+
children: [/* @__PURE__ */ jsx("section", {
|
|
245
|
+
className: "think-full-app__chat-surface",
|
|
246
|
+
"data-workspace-restoration-scope": "chat",
|
|
247
|
+
"aria-label": "Chat",
|
|
243
248
|
children: /* @__PURE__ */ jsx("div", {
|
|
244
|
-
className: "think-full-app__chat
|
|
245
|
-
children: /* @__PURE__ */ jsx(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
className: "think-full-app__chat",
|
|
250
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
251
|
+
className: "think-full-app__chat-inner",
|
|
252
|
+
children: /* @__PURE__ */ jsx(ThinkChat.Provider, {
|
|
253
|
+
chat,
|
|
254
|
+
agentTools,
|
|
255
|
+
children: /* @__PURE__ */ jsx(ThinkChat.Messages, {
|
|
256
|
+
...resolvedMessages,
|
|
257
|
+
renderAgentToolRunLink: showAgentTools ? renderAgentToolRunLink : void 0
|
|
258
|
+
})
|
|
251
259
|
})
|
|
252
260
|
})
|
|
253
261
|
})
|
|
254
|
-
})
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
"aria-label": "Workbench",
|
|
258
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
259
|
-
className: "think-full-app__workbench-slot",
|
|
262
|
+
}), activePanel ? /* @__PURE__ */ jsx("aside", {
|
|
263
|
+
className: "think-full-app__aside",
|
|
264
|
+
"aria-label": "Workbench",
|
|
260
265
|
children: /* @__PURE__ */ jsx("div", {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
+
className: "think-full-app__workbench-slot",
|
|
267
|
+
children: /* @__PURE__ */ jsx(React.ViewTransition, {
|
|
268
|
+
default: "sigvelo-layout-transition",
|
|
269
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
270
|
+
ref: workbenchPanelRef,
|
|
271
|
+
className: "think-full-app__workbench-panel",
|
|
272
|
+
"data-view": activeWorkbenchView,
|
|
273
|
+
tabIndex: -1,
|
|
274
|
+
children: activePanel.render(panelContext)
|
|
275
|
+
})
|
|
276
|
+
})
|
|
266
277
|
})
|
|
267
|
-
})
|
|
268
|
-
})
|
|
278
|
+
}) : null]
|
|
279
|
+
})
|
|
269
280
|
}),
|
|
270
281
|
activePanel ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "think-full-app__resizer" }) : null
|
|
271
282
|
]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ThinkRecoveryNoticeProps, t as ThinkRecoveryNotice } from "../ThinkRecoveryNotice-
|
|
1
|
+
import { n as ThinkRecoveryNoticeProps, t as ThinkRecoveryNotice } from "../ThinkRecoveryNotice-D6gYcBbr.js";
|
|
2
2
|
export { ThinkRecoveryNotice, ThinkRecoveryNoticeProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { buttonVariants } from "./Button.js";
|
|
3
|
-
import { H as PlusIcon } from "../icons-
|
|
3
|
+
import { H as PlusIcon } from "../icons-w5PpKGRz.js";
|
|
4
4
|
import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
|
|
5
5
|
import { Tooltip } from "./Tooltip.js";
|
|
6
6
|
import { t as capitalize } from "../format-S6uWyoSb.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Button, buttonVariants } from "./Button.js";
|
|
3
|
-
import { q as SpinnerIcon } from "../icons-
|
|
3
|
+
import { q as SpinnerIcon } from "../icons-w5PpKGRz.js";
|
|
4
4
|
import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
|
|
5
5
|
import { Select } from "./Select.js";
|
|
6
6
|
import { Field } from "./Field.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Button, buttonVariants } from "./Button.js";
|
|
3
|
-
import {
|
|
3
|
+
import { V as PlayIcon, b as EllipsisIcon, et as WarningIcon, f as ChevronDownIcon, q as SpinnerIcon } from "../icons-w5PpKGRz.js";
|
|
4
4
|
import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
|
|
5
5
|
import { Menu } from "./Menu.js";
|
|
6
6
|
import { AppTopBar } from "./AppTopBar.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Button, buttonVariants } from "./Button.js";
|
|
3
|
-
import {
|
|
3
|
+
import { H as PlusIcon, et as WarningIcon, q as SpinnerIcon, t as ArchiveIcon, v as DotIcon } from "../icons-w5PpKGRz.js";
|
|
4
4
|
import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
|
|
5
5
|
import { EmptyState } from "./EmptyState.js";
|
|
6
6
|
import { SearchField } from "./SearchField.js";
|
package/dist/components/Toast.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { buttonVariants } from "./Button.js";
|
|
3
|
-
import {
|
|
3
|
+
import { nt as XIcon } from "../icons-w5PpKGRz.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { Toast as Toast$1 } from "@base-ui/react/toast";
|
|
@@ -8,6 +8,12 @@ interface ToolInvocationProps {
|
|
|
8
8
|
part: ToolInvocationPart;
|
|
9
9
|
/** Render the existing Activity disclosure expanded initially. */
|
|
10
10
|
defaultOpen?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Overrides the part-derived shimmer. Callers that know the run has settled
|
|
13
|
+
* pass false so a part stuck in a working state (denied approval, aborted
|
|
14
|
+
* stream) doesn't shimmer forever.
|
|
15
|
+
*/
|
|
16
|
+
isStreaming?: boolean;
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
13
19
|
* Read-only generic disclosure for one upstream AI SDK tool invocation.
|
|
@@ -20,7 +26,8 @@ interface ToolInvocationProps {
|
|
|
20
26
|
*/
|
|
21
27
|
declare function ToolInvocation({
|
|
22
28
|
part,
|
|
23
|
-
defaultOpen
|
|
29
|
+
defaultOpen,
|
|
30
|
+
isStreaming
|
|
24
31
|
}: ToolInvocationProps): import("react").JSX.Element;
|
|
25
32
|
//#endregion
|
|
26
33
|
export { ToolInvocation, ToolInvocationPart, ToolInvocationProps };
|
|
@@ -45,7 +45,7 @@ function describeToolPart(part) {
|
|
|
45
45
|
* transcript renderer. ThinkChat may replace this fallback with richer panels
|
|
46
46
|
* for known workspace, browser, fetch, session, skill, and execute tools.
|
|
47
47
|
*/
|
|
48
|
-
function ToolInvocation({ part, defaultOpen }) {
|
|
48
|
+
function ToolInvocation({ part, defaultOpen, isStreaming }) {
|
|
49
49
|
const state = getToolPartState(part);
|
|
50
50
|
const failed = isToolPartFailed(part);
|
|
51
51
|
const deniedReason = part.state === "output-denied" ? part.approval.reason : void 0;
|
|
@@ -53,8 +53,9 @@ function ToolInvocation({ part, defaultOpen }) {
|
|
|
53
53
|
const inputStatus = part.state === "approval-requested" ? "awaiting approval" : part.state === "approval-responded" ? part.approval.approved ? "approved" : "denied" : void 0;
|
|
54
54
|
const outputStatus = state === "denied" ? "denied" : failed ? "error" : part.state === "output-available" && part.preliminary ? "preliminary" : void 0;
|
|
55
55
|
return /* @__PURE__ */ jsxs(Activity, {
|
|
56
|
-
isStreaming: isToolPartWorking(part),
|
|
56
|
+
isStreaming: isStreaming ?? isToolPartWorking(part),
|
|
57
57
|
defaultOpen,
|
|
58
|
+
stateKey: part.toolCallId,
|
|
58
59
|
children: [/* @__PURE__ */ jsx(ActivityTrigger, { action: describeToolPart(part) }), /* @__PURE__ */ jsxs(ActivityContent, { children: [/* @__PURE__ */ jsx(ActivityPanel, {
|
|
59
60
|
label: part.title ?? getToolName(part),
|
|
60
61
|
text: formatToolValue(getToolInput(part)),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Collapsible } from "./Collapsible.js";
|
|
3
|
-
import { W as RefreshIcon, f as ChevronDownIcon, i as ArrowRightIcon, r as ArrowLeftIcon } from "../icons-
|
|
3
|
+
import { W as RefreshIcon, f as ChevronDownIcon, i as ArrowRightIcon, r as ArrowLeftIcon } from "../icons-w5PpKGRz.js";
|
|
4
4
|
import { IconButton } from "./IconButton.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
6
6
|
import { Input } from "./Input.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as FileTreeFolder, r as FileTreeFile, t as FileTree } from "../FileTree-
|
|
1
|
+
import { i as FileTreeFolder, r as FileTreeFile, t as FileTree } from "../FileTree-CYr5og0q.js";
|
|
2
2
|
import { SearchField } from "./SearchField.js";
|
|
3
3
|
import { WorkspaceHeader } from "./WorkspaceHeader.js";
|
|
4
4
|
import * as React from "react";
|
|
@@ -3,7 +3,7 @@ import { a as WorkspaceNavigationRestorationBoundary, n as WorkspaceNavigationPr
|
|
|
3
3
|
import { n as mergeRefs } from "../merge-refs-DF_7w2x_.js";
|
|
4
4
|
import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./WorkspaceFile.js";
|
|
5
5
|
import { WorkspaceBrowser } from "./WorkspaceBrowser.js";
|
|
6
|
-
import { t as WorkspaceFileView } from "../WorkspaceFileView-
|
|
6
|
+
import { t as WorkspaceFileView } from "../WorkspaceFileView-CuMjXYQn.js";
|
|
7
7
|
import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WorkspaceFileView } from "../WorkspaceFileView-
|
|
1
|
+
import { t as WorkspaceFileView } from "../WorkspaceFileView-CuMjXYQn.js";
|
|
2
2
|
export { WorkspaceFileView };
|