@mcp-b/react-components 0.58.1 → 0.59.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/{CodeBlock-Bs_Z03eC.js → CodeBlock-B4K656LO.js} +1 -1
- package/dist/{EmployeeChrome-DsdIek0l.d.ts → EmployeeChrome-QSki0QT4.d.ts} +4 -4
- package/dist/{ExecutionResult-BSZsUbrL.js → ExecutionResult-Wd1sKAvD.js} +2 -2
- package/dist/{FileTree-DyLBn7O_.js → FileTree-BpCJuvji.js} +1 -1
- package/dist/{ManagerOffice-C8AQcaXs.js → ManagerOffice-BaHSBcSF.js} +4 -4
- package/dist/{ResponsiveSidebarShell-DoZlSP30.d.ts → ResponsiveSidebarShell-DzBGlRJF.d.ts} +23 -8
- package/dist/{SetupChecklist-CKQ-mKYt.js → SetupChecklist-BNK2XFaI.js} +2 -2
- package/dist/{ThinkChatActivity-BkGjTY4r.d.ts → ThinkChatActivity-C4_hPEmb.d.ts} +20 -4
- package/dist/{ThinkChatActivitySummary-DZVy3uQV.d.ts → ThinkChatActivitySummary-ChJ8Iu2T.d.ts} +3 -3
- package/dist/{ThinkChatToolParts-BucHi63O.d.ts → ThinkChatToolParts-BrntWlpa.d.ts} +29 -3
- package/dist/{WorkspaceConceptPanel-97ZyVpZI.js → WorkspaceConceptPanel-D21iRsWm.js} +7 -4
- package/dist/{WorkspaceFileView-M2jC2P4p.js → WorkspaceFileView-5SHsjamf.js} +84 -78
- package/dist/app-bar-outlet-CNfNzY4Y.js +6 -0
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.js +7 -7
- package/dist/components/agents-sdk/BrowserLiveScreen.js +50 -12
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
- package/dist/components/agents-sdk/EmployeeApp.d.ts +2 -3
- package/dist/components/agents-sdk/EmployeeApp.js +5 -5
- package/dist/components/agents-sdk/EmployeeChat.js +4 -4
- package/dist/components/agents-sdk/EmployeeChrome.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeChrome.js +219 -207
- package/dist/components/agents-sdk/EmployeeSchedules.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeSchedules.js +7 -7
- package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeStartScreen.js +3 -3
- package/dist/components/agents-sdk/ExecutionBoard.js +4 -4
- package/dist/components/agents-sdk/ManagerAccountActions.js +2 -2
- package/dist/components/agents-sdk/ManagerOffice.js +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.js +6 -19
- package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +2 -2
- package/dist/components/agents-sdk/McpServerPicker.js +2 -2
- package/dist/components/agents-sdk/ModelEndpointDialog.js +1 -1
- package/dist/components/agents-sdk/ModelSelector.js +5 -5
- package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
- package/dist/components/agents-sdk/SubagentRunPanel.d.ts +8 -9
- package/dist/components/agents-sdk/SubagentRunPanel.js +133 -122
- package/dist/components/agents-sdk/SubagentRunSelector.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChat.js +26 -3
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +110 -110
- package/dist/components/agents-sdk/ThinkChatActivitySummary.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatActivitySummary.js +183 -40
- package/dist/components/agents-sdk/ThinkChatToolPanels.d.ts +8 -4
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +310 -64
- package/dist/components/agents-sdk/ThinkChatToolParts.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkChatToolParts.js +71 -1
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +3 -4
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +8 -8
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkFullApp.js +6 -1
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineActions.js +15 -23
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +6 -6
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
- package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
- package/dist/components/agents-sdk/WorkbenchBack.js +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +7 -7
- package/dist/components/agents-sdk/WorkspaceExecution.js +146 -139
- package/dist/components/agents-sdk/WorkspaceExecutionTable.js +5 -5
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +27 -29
- package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
- package/dist/components/agents-sdk/WorkspaceProject.js +6 -6
- package/dist/components/agents-sdk/WorkspaceUserScript.js +6 -6
- package/dist/components/ai-sdk/Activity.d.ts +1 -1
- package/dist/components/ai-sdk/Activity.js +85 -7
- package/dist/components/ai-sdk/AgentChatMessageEditor.js +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +4 -3
- package/dist/components/ai-sdk/Artifact.js +1 -1
- package/dist/components/ai-sdk/ChainOfThought.js +1 -1
- package/dist/components/ai-sdk/Checkpoint.js +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.js +2 -2
- package/dist/components/ai-sdk/ConnectedAppCards.js +66 -48
- package/dist/components/ai-sdk/Context.js +1 -1
- package/dist/components/ai-sdk/Conversation.js +2 -2
- package/dist/components/ai-sdk/ExpansionState.d.ts +16 -6
- package/dist/components/ai-sdk/ExpansionState.js +25 -7
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +2 -2
- package/dist/components/ai-sdk/Message.js +2 -2
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +99 -12
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.js +13 -9
- package/dist/components/ai-sdk/PromptInputComposerEditor.js +2 -2
- package/dist/components/ai-sdk/Queue.js +2 -2
- package/dist/components/ai-sdk/Reasoning.js +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/ai-sdk/ToolInvocation.d.ts +8 -0
- package/dist/components/ai-sdk/ToolInvocation.js +45 -19
- package/dist/components/extension/ChatGptSignInScreen.js +1 -1
- package/dist/components/extension/CodexModelSelector.js +2 -2
- package/dist/components/extension/ConversationTabPicker.js +2 -2
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/Collapsible.js +1 -1
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/ToggleGroup.js +1 -1
- package/dist/components/foundations/icons.js +1 -1
- package/dist/components/general-purpose/AccountSignInDialog.js +1 -1
- package/dist/components/general-purpose/Commit.js +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +163 -88
- package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/Terminal.js +3 -3
- package/dist/components/general-purpose/TestResults.js +1 -1
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.js +2 -2
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.d.ts +1 -3
- package/dist/components/nanites/AgentToolDetail.js +30 -39
- package/dist/{copy-button-M4sAp9xS.js → copy-button-BsmxSSeD.js} +1 -1
- package/dist/merge-refs-DAh6reu8.js +26 -0
- package/dist/styles/activity.css +74 -0
- package/dist/styles/agent-chat.css +8 -1
- package/dist/styles/agent-tool-detail.css +2 -17
- package/dist/styles/app-top-bar.css +6 -7
- package/dist/styles/base.css +1 -1
- package/dist/styles/employee-chrome.css +0 -7
- package/dist/styles/message.css +1 -1
- package/dist/styles/responsive-sidebar-shell.css +10 -25
- package/dist/styles/scroll-area.css +16 -0
- package/dist/styles/scrollbars.css +55 -41
- package/dist/styles/search-field.css +0 -1
- package/dist/styles/subagent-run.css +36 -196
- package/dist/styles/think-chat-tool-panels.css +38 -5
- package/dist/styles/think-execution-workbench.css +4 -0
- package/dist/styles/think-full-app.css +1 -6
- package/dist/styles/workspace-concepts.css +6 -39
- package/dist/styles/workspace-explorer.css +4 -11
- package/dist/{workspace-assets-DVn0d-fN.js → workspace-assets-RD6IhOyh.js} +1 -1
- package/dist/{workspace-delete-DfloiBWp.js → workspace-delete-CrNGUuBp.js} +1 -1
- package/package.json +2 -2
- package/dist/components/agents-sdk/SubagentRunDetails.d.ts +0 -40
- package/dist/components/agents-sdk/SubagentRunDetails.js +0 -98
- package/dist/merge-refs-DF_7w2x_.js +0 -18
- package/dist/{icons-DvlrWt54.js → icons-Cn3vWZRs.js} +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ExecuteToolPart, o as SessionContextToolPart, p as WorkspaceToolPart, r as FetchToolPart, s as SkillToolPart, t as BrowserToolPart } from "../../ThinkChatToolParts-BrntWlpa.js";
|
|
2
|
+
import { AnyToolUIPart } from "../ai-sdk/ToolPart.js";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
//#region src/components/agents-sdk/ThinkChatToolPanels.d.ts
|
|
4
5
|
/** Default panels for the Think workspace tools, Claude Code-style: read/write
|
|
@@ -23,11 +24,14 @@ export declare function ThinkChatFetchPanel({ part }: {
|
|
|
23
24
|
part: FetchToolPart;
|
|
24
25
|
}): React.JSX.Element;
|
|
25
26
|
export interface ThinkChatExecutePanelProps {
|
|
26
|
-
/** Whole
|
|
27
|
+
/** Whole AI SDK tool part; hosts may bind `execute` to different contracts. */
|
|
27
28
|
part: ExecuteToolPart;
|
|
28
29
|
}
|
|
29
|
-
/**
|
|
30
|
-
|
|
30
|
+
/** One-time follow-ups use the returned wake instant; list/cancel receipts stay distinct. */
|
|
31
|
+
export declare function ThinkChatFollowUpPanel({ part }: {
|
|
32
|
+
part: AnyToolUIPart;
|
|
33
|
+
}): React.JSX.Element;
|
|
34
|
+
/** Route only discriminable outputs; ambiguous contracts remain generic data. */
|
|
31
35
|
export declare function ThinkChatExecutePanel({ part }: ThinkChatExecutePanelProps): React.JSX.Element;
|
|
32
36
|
export declare function ThinkChatBrowserPanel({ part }: {
|
|
33
37
|
part: BrowserToolPart;
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import { ActivityOutput, ActivityPanel } from "../ai-sdk/Activity.js";
|
|
2
|
+
import { ToolInvocationDetails } from "../ai-sdk/ToolInvocation.js";
|
|
2
3
|
import { Tabs } from "../foundations/Tabs.js";
|
|
3
|
-
import { i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "../../CodeBlock-Bs_Z03eC.js";
|
|
4
4
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
5
|
+
import { i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "../../CodeBlock-B4K656LO.js";
|
|
5
6
|
import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
|
|
6
|
-
import { displayUrl, isSessionContextToolFailure } from "./ThinkChatToolParts.js";
|
|
7
|
+
import { displayUrl, isSessionContextToolFailure, readFollowUpReceipt, thinkToolOutcome } from "./ThinkChatToolParts.js";
|
|
7
8
|
import { t as executionErrorSummary } from "../../execution-result-DWVmm-bL.js";
|
|
8
|
-
import { t as
|
|
9
|
+
import { t as WorkspaceFileLink } from "../../WorkspaceLink-BeFAXpbI.js";
|
|
10
|
+
import { t as ExecutionResult } from "../../ExecutionResult-Wd1sKAvD.js";
|
|
11
|
+
import { formatThinkExecutionShortTimestamp } from "./ThinkExecutionRun.js";
|
|
9
12
|
import * as React from "react";
|
|
10
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
14
|
import { getToolName } from "ai";
|
|
12
15
|
//#region src/components/agents-sdk/ThinkChatToolPanels.tsx
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
/** Every tool family shows a failed or denied call the same way. */
|
|
17
|
+
function toolFailurePanel(part, label) {
|
|
18
|
+
if (part.state === "output-error") return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
19
|
+
label,
|
|
20
|
+
text: executionErrorSummary(part.errorText),
|
|
21
|
+
status: "error",
|
|
22
|
+
error: true
|
|
23
|
+
});
|
|
24
|
+
if (part.state === "output-denied" || part.state === "approval-responded" && !part.approval.approved) return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
15
25
|
label,
|
|
16
|
-
text: reason,
|
|
26
|
+
text: part.approval.reason,
|
|
17
27
|
status: "denied",
|
|
18
28
|
error: true
|
|
19
29
|
});
|
|
30
|
+
return null;
|
|
20
31
|
}
|
|
21
32
|
function prefixLines(text, prefix) {
|
|
22
33
|
return text.split("\n").map((line) => `${prefix}${line}`).join("\n");
|
|
@@ -27,13 +38,8 @@ show their result lists, bash gets the shell panel. Everything is typed by
|
|
|
27
38
|
the upstream tool contract. */
|
|
28
39
|
function ThinkChatWorkspacePanel({ part }) {
|
|
29
40
|
if (part.type === "tool-bash") return /* @__PURE__ */ jsx(ThinkChatShellPanel, { part });
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
text: executionErrorSummary(part.errorText),
|
|
33
|
-
status: "error",
|
|
34
|
-
error: true
|
|
35
|
-
});
|
|
36
|
-
if (part.state === "output-denied") return renderDeniedPanel(getToolName(part), part.approval.reason);
|
|
41
|
+
const failure = toolFailurePanel(part, getToolName(part));
|
|
42
|
+
if (failure) return failure;
|
|
37
43
|
switch (part.type) {
|
|
38
44
|
case "tool-read": return /* @__PURE__ */ jsx(WorkspaceReadPanel, { part });
|
|
39
45
|
case "tool-write": return /* @__PURE__ */ jsx(WorkspaceWritePanel, { part });
|
|
@@ -74,7 +80,6 @@ function WorkspaceWritePanel({ part }) {
|
|
|
74
80
|
children: content !== void 0 ? /* @__PURE__ */ jsx(CodeBlock, {
|
|
75
81
|
surface: "plain",
|
|
76
82
|
wrap: true,
|
|
77
|
-
className: "think-chat-tool-panels__code-block",
|
|
78
83
|
code: content,
|
|
79
84
|
isStreaming: part.state === "input-streaming",
|
|
80
85
|
language: inferWorkspaceLanguage(path),
|
|
@@ -138,13 +143,8 @@ function WorkspaceGrepPanel({ part }) {
|
|
|
138
143
|
/** Skill panels show what the model actually received: the activated skill's
|
|
139
144
|
body, the resource text, or the script result. */
|
|
140
145
|
function ThinkChatSkillPanel({ part }) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
text: executionErrorSummary(part.errorText),
|
|
144
|
-
status: "error",
|
|
145
|
-
error: true
|
|
146
|
-
});
|
|
147
|
-
if (part.state === "output-denied") return renderDeniedPanel(getToolName(part), part.approval.reason);
|
|
146
|
+
const failure = toolFailurePanel(part, getToolName(part));
|
|
147
|
+
if (failure) return failure;
|
|
148
148
|
switch (part.type) {
|
|
149
149
|
case "tool-activate_skill": {
|
|
150
150
|
const output = part.state === "output-available" ? part.output : void 0;
|
|
@@ -176,13 +176,8 @@ function ThinkChatSkillPanel({ part }) {
|
|
|
176
176
|
UIMessage. The session itself remains server-owned; this is transcript
|
|
177
177
|
rendering, not a client-side mirror of context state. */
|
|
178
178
|
function ThinkChatSessionContextPanel({ part }) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
text: executionErrorSummary(part.errorText),
|
|
182
|
-
status: "error",
|
|
183
|
-
error: true
|
|
184
|
-
});
|
|
185
|
-
if (part.state === "output-denied") return renderDeniedPanel(getToolName(part), part.approval.reason);
|
|
179
|
+
const failure = toolFailurePanel(part, getToolName(part));
|
|
180
|
+
if (failure) return failure;
|
|
186
181
|
return /* @__PURE__ */ jsx(SessionContextResultPanel, { part });
|
|
187
182
|
}
|
|
188
183
|
function SessionContextResultPanel({ part }) {
|
|
@@ -230,13 +225,8 @@ function SessionContextSearchPanel({ part, output, error }) {
|
|
|
230
225
|
}
|
|
231
226
|
function ThinkChatFetchPanel({ part }) {
|
|
232
227
|
const label = part.input?.url ?? part.input?.path ?? "fetch";
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
text: executionErrorSummary(part.errorText),
|
|
236
|
-
status: "error",
|
|
237
|
-
error: true
|
|
238
|
-
});
|
|
239
|
-
if (part.state === "output-denied") return renderDeniedPanel(label, part.approval.reason);
|
|
228
|
+
const failure = toolFailurePanel(part, label);
|
|
229
|
+
if (failure) return failure;
|
|
240
230
|
const output = part.state === "output-available" ? part.output : void 0;
|
|
241
231
|
if (!output) return /* @__PURE__ */ jsx(ActivityPanel, { label });
|
|
242
232
|
if (!output.ok) return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
@@ -292,15 +282,10 @@ function findBrowserResultMedia(value, depth = 0) {
|
|
|
292
282
|
function ExecuteCodeView({ code, output, hideResult, isStreaming }) {
|
|
293
283
|
const calls = output && "calls" in output ? output.calls : void 0;
|
|
294
284
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
295
|
-
|
|
296
|
-
surface: "plain",
|
|
297
|
-
wrap: true,
|
|
298
|
-
className: "think-chat-tool-panels__code-block",
|
|
285
|
+
/* @__PURE__ */ jsx(ExecutionCode, {
|
|
299
286
|
code,
|
|
300
|
-
isStreaming
|
|
301
|
-
|
|
302
|
-
children: /* @__PURE__ */ jsx(CodeBlockContainer, { children: /* @__PURE__ */ jsx(CodeBlockContent, {}) })
|
|
303
|
-
}) : null,
|
|
287
|
+
isStreaming
|
|
288
|
+
}),
|
|
304
289
|
calls?.length ? /* @__PURE__ */ jsx(ToolCallAudit, { calls }) : null,
|
|
305
290
|
output && "logs" in output && output.logs?.length ? /* @__PURE__ */ jsx(ExecutionResult, {
|
|
306
291
|
result: output.logs,
|
|
@@ -320,6 +305,17 @@ function ExecuteCodeView({ code, output, hideResult, isStreaming }) {
|
|
|
320
305
|
}) : null
|
|
321
306
|
] });
|
|
322
307
|
}
|
|
308
|
+
function ExecutionCode({ code, isStreaming }) {
|
|
309
|
+
if (!code) return null;
|
|
310
|
+
return /* @__PURE__ */ jsx(CodeBlock, {
|
|
311
|
+
surface: "plain",
|
|
312
|
+
wrap: true,
|
|
313
|
+
code,
|
|
314
|
+
isStreaming,
|
|
315
|
+
language: "ts",
|
|
316
|
+
children: /* @__PURE__ */ jsx(CodeBlockContainer, { children: /* @__PURE__ */ jsx(CodeBlockContent, {}) })
|
|
317
|
+
});
|
|
318
|
+
}
|
|
323
319
|
/** Durable connector calls emitted by Codemode 0.4.3. The ordered list keeps
|
|
324
320
|
execution order and state available to assistive technology without adding
|
|
325
321
|
another host-side activity protocol. */
|
|
@@ -373,37 +369,287 @@ function executeStatusText(output) {
|
|
|
373
369
|
if (output.status !== "paused") return output.status;
|
|
374
370
|
return output.pending.length > 0 && output.pending.every(isHumanWait) ? "paused · waiting for human" : "paused · needs approval";
|
|
375
371
|
}
|
|
376
|
-
|
|
377
|
-
|
|
372
|
+
function asRecord(value) {
|
|
373
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
374
|
+
}
|
|
375
|
+
function stringField(record, key) {
|
|
376
|
+
const value = record?.[key];
|
|
377
|
+
return typeof value === "string" ? value : void 0;
|
|
378
|
+
}
|
|
379
|
+
function isStringArray(value) {
|
|
380
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
381
|
+
}
|
|
382
|
+
function isPendingAction(value) {
|
|
383
|
+
const record = asRecord(value);
|
|
384
|
+
return record !== void 0 && typeof record.executionId === "string" && typeof record.seq === "number" && typeof record.connector === "string" && typeof record.method === "string";
|
|
385
|
+
}
|
|
386
|
+
function isToolLogEntry(value) {
|
|
387
|
+
const record = asRecord(value);
|
|
388
|
+
return record !== void 0 && typeof record.seq === "number" && typeof record.connector === "string" && typeof record.method === "string" && typeof record.requiresApproval === "boolean" && [
|
|
389
|
+
"executing",
|
|
390
|
+
"applied",
|
|
391
|
+
"pending",
|
|
392
|
+
"reverted",
|
|
393
|
+
"error"
|
|
394
|
+
].includes(String(record.state));
|
|
395
|
+
}
|
|
396
|
+
function isCodemodeOutput(value) {
|
|
397
|
+
const record = asRecord(value);
|
|
398
|
+
if (!record || typeof record.executionId !== "string") return false;
|
|
399
|
+
const callsValid = !Object.hasOwn(record, "calls") || Array.isArray(record.calls) && record.calls.every(isToolLogEntry);
|
|
400
|
+
const logsValid = !Object.hasOwn(record, "logs") || isStringArray(record.logs);
|
|
401
|
+
if (!callsValid || !logsValid) return false;
|
|
402
|
+
if (record.status === "completed") return Object.hasOwn(record, "result");
|
|
403
|
+
if (record.status === "paused") return Array.isArray(record.pending) && record.pending.every(isPendingAction);
|
|
404
|
+
return record.status === "error" && typeof record.error === "string";
|
|
405
|
+
}
|
|
406
|
+
/** `calls` and `paused/pending` are Codemode-specific; summary/code are not. */
|
|
407
|
+
function isCodemodePanelOutput(value) {
|
|
408
|
+
return isCodemodeOutput(value) && (value.status === "paused" || Object.hasOwn(value, "calls"));
|
|
409
|
+
}
|
|
410
|
+
const ROOK_EXECUTION_FAILURE_KINDS = /* @__PURE__ */ new Set([
|
|
411
|
+
"authoring",
|
|
412
|
+
"exception",
|
|
413
|
+
"timeout",
|
|
414
|
+
"abort",
|
|
415
|
+
"sandbox-exit",
|
|
416
|
+
"invalid-output"
|
|
417
|
+
]);
|
|
418
|
+
function isRookExecutionFiles(value) {
|
|
419
|
+
return Array.isArray(value) && value.every((file) => {
|
|
420
|
+
const record = asRecord(file);
|
|
421
|
+
return record !== void 0 && typeof record.label === "string" && record.label.length > 0 && typeof record.path === "string" && record.path.length > 0;
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
/** Minimal guard for Rook's checked-code output, pinned to code-contracts.ts. */
|
|
425
|
+
function isRookExecuteOutput(value) {
|
|
426
|
+
const record = asRecord(value);
|
|
427
|
+
if (!record || typeof record.executionId !== "string") return false;
|
|
428
|
+
if (record.status === "completed") return isRookExecutionFiles(record.files) && isStringArray(record.logs) && Object.hasOwn(record, "result") && (!Object.hasOwn(record, "path") || typeof record.path === "string") && (!Object.hasOwn(record, "saveError") || typeof record.saveError === "string") && !(typeof record.path === "string" && typeof record.saveError === "string");
|
|
429
|
+
if (record.status !== "error" || typeof record.error !== "string") return false;
|
|
430
|
+
const optionalFilesValid = !Object.hasOwn(record, "files") || isRookExecutionFiles(record.files);
|
|
431
|
+
const optionalLogsValid = !Object.hasOwn(record, "logs") || isStringArray(record.logs);
|
|
432
|
+
const kindValid = !Object.hasOwn(record, "kind") || typeof record.kind === "string" && ROOK_EXECUTION_FAILURE_KINDS.has(record.kind);
|
|
433
|
+
const rookMarker = Object.hasOwn(record, "files") || typeof record.kind === "string";
|
|
434
|
+
return optionalFilesValid && optionalLogsValid && kindValid && rookMarker;
|
|
435
|
+
}
|
|
436
|
+
const timeZoneNameFormat = new Intl.DateTimeFormat(void 0, { timeZoneName: "short" });
|
|
437
|
+
function formatFollowUpDateTime(value) {
|
|
438
|
+
const date = new Date(value);
|
|
439
|
+
return [formatThinkExecutionShortTimestamp(date, ""), timeZoneNameFormat.formatToParts(date).find((part) => part.type === "timeZoneName")?.value].filter(Boolean).join(" ");
|
|
440
|
+
}
|
|
441
|
+
function fileName(path) {
|
|
442
|
+
return path.split("/").filter(Boolean).at(-1) ?? path;
|
|
443
|
+
}
|
|
444
|
+
/** One-time follow-ups use the returned wake instant; list/cancel receipts stay distinct. */
|
|
445
|
+
function ThinkChatFollowUpPanel({ part }) {
|
|
446
|
+
const outcome = thinkToolOutcome(part);
|
|
447
|
+
const generic = () => /* @__PURE__ */ jsx(ToolInvocationDetails, {
|
|
448
|
+
part,
|
|
449
|
+
outputError: outcome === "failed"
|
|
450
|
+
});
|
|
451
|
+
if (part.state !== "output-available" || part.preliminary || outcome) return generic();
|
|
452
|
+
const receipt = readFollowUpReceipt(part);
|
|
453
|
+
if (!receipt) return generic();
|
|
454
|
+
if (receipt.operation === "schedule") return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
455
|
+
label: "Follow-up",
|
|
456
|
+
status: "Scheduled follow-up",
|
|
457
|
+
children: /* @__PURE__ */ jsxs("dl", {
|
|
458
|
+
className: "think-chat-tool-panels__follow-up-details",
|
|
459
|
+
children: [
|
|
460
|
+
/* @__PURE__ */ jsx("dt", { children: "Checkpoint" }),
|
|
461
|
+
/* @__PURE__ */ jsx("dd", { children: receipt.id }),
|
|
462
|
+
/* @__PURE__ */ jsx("dt", { children: "Scheduled for" }),
|
|
463
|
+
/* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx("time", {
|
|
464
|
+
dateTime: receipt.scheduledFor,
|
|
465
|
+
children: formatFollowUpDateTime(receipt.scheduledFor)
|
|
466
|
+
}) }),
|
|
467
|
+
/* @__PURE__ */ jsx("dt", { children: "Instructions" }),
|
|
468
|
+
/* @__PURE__ */ jsx("dd", { children: receipt.prompt })
|
|
469
|
+
]
|
|
470
|
+
})
|
|
471
|
+
});
|
|
472
|
+
if (receipt.operation === "list") return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
473
|
+
label: "Follow-ups",
|
|
474
|
+
status: receipt.followUps.length === 0 ? "No follow-ups scheduled" : `${receipt.followUps.length} scheduled`,
|
|
475
|
+
children: receipt.followUps.length ? /* @__PURE__ */ jsx("ol", {
|
|
476
|
+
className: "think-chat-tool-panels__follow-up-list",
|
|
477
|
+
children: receipt.followUps.map((item) => /* @__PURE__ */ jsxs("li", { children: [
|
|
478
|
+
/* @__PURE__ */ jsx("time", {
|
|
479
|
+
dateTime: item.scheduledFor,
|
|
480
|
+
children: formatFollowUpDateTime(item.scheduledFor)
|
|
481
|
+
}),
|
|
482
|
+
/* @__PURE__ */ jsx("span", { children: item.prompt }),
|
|
483
|
+
/* @__PURE__ */ jsx("span", { children: item.id })
|
|
484
|
+
] }, item.id))
|
|
485
|
+
}) : null
|
|
486
|
+
});
|
|
487
|
+
return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
488
|
+
label: "Follow-up",
|
|
489
|
+
status: receipt.cancelled ? "Cancelled follow-up" : "No follow-up cancelled",
|
|
490
|
+
children: /* @__PURE__ */ jsx(ActivityOutput, { children: `Checkpoint: ${receipt.id}` })
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
function RookExecutePanel({ inputValue, outputValue, isStreaming }) {
|
|
494
|
+
const input = asRecord(inputValue);
|
|
495
|
+
const output = asRecord(outputValue);
|
|
496
|
+
const failed = output?.status === "error";
|
|
497
|
+
return /* @__PURE__ */ jsxs(ActivityPanel, {
|
|
498
|
+
label: "Code",
|
|
499
|
+
status: failed ? "error" : output?.status === "completed" ? "completed" : void 0,
|
|
500
|
+
error: failed,
|
|
501
|
+
children: [
|
|
502
|
+
/* @__PURE__ */ jsx(ExecutionCode, {
|
|
503
|
+
code: stringField(input, "code") ?? "",
|
|
504
|
+
isStreaming
|
|
505
|
+
}),
|
|
506
|
+
input ? /* @__PURE__ */ jsx(RookExecuteInput, { input }) : null,
|
|
507
|
+
output ? /* @__PURE__ */ jsx(RookExecuteOutput, { output }) : null
|
|
508
|
+
]
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
function executionResultSection(label, result) {
|
|
512
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
513
|
+
className: "think-chat-tool-panels__execution-section",
|
|
514
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
515
|
+
className: "activity__shell-label",
|
|
516
|
+
children: label
|
|
517
|
+
}), /* @__PURE__ */ jsx(ExecutionResult, {
|
|
518
|
+
result,
|
|
519
|
+
showSummary: false
|
|
520
|
+
})]
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
function executionFileSection(label, filePath) {
|
|
524
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
525
|
+
className: "think-chat-tool-panels__execution-section",
|
|
526
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
527
|
+
className: "activity__shell-label",
|
|
528
|
+
children: label
|
|
529
|
+
}), /* @__PURE__ */ jsx(WorkspaceFileLink, {
|
|
530
|
+
href: filePath,
|
|
531
|
+
children: fileName(filePath)
|
|
532
|
+
})]
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
/** The saved program and the values the run was given. */
|
|
536
|
+
function RookExecuteInput({ input }) {
|
|
537
|
+
const path = stringField(input, "path");
|
|
538
|
+
const args = Object.hasOwn(input, "args") ? input.args : void 0;
|
|
539
|
+
const table = Object.hasOwn(input, "table") ? input.table : void 0;
|
|
540
|
+
const preview = Object.hasOwn(input, "preview") ? input.preview : void 0;
|
|
541
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
542
|
+
path ? executionFileSection("Saved program", path) : null,
|
|
543
|
+
args !== void 0 ? executionResultSection("Arguments", args) : null,
|
|
544
|
+
table !== void 0 ? executionResultSection("Table", table) : null,
|
|
545
|
+
preview !== void 0 ? executionResultSection("Preview", preview) : null
|
|
546
|
+
] });
|
|
547
|
+
}
|
|
548
|
+
/** The run's receipt, in the order a reader checks it. */
|
|
549
|
+
function RookExecuteOutput({ output }) {
|
|
550
|
+
const executionId = stringField(output, "executionId");
|
|
551
|
+
const error = stringField(output, "error");
|
|
552
|
+
const failureKind = output.status === "error" && typeof output.kind === "string" && ROOK_EXECUTION_FAILURE_KINDS.has(output.kind) ? output.kind : void 0;
|
|
553
|
+
const logs = isStringArray(output.logs) ? output.logs : void 0;
|
|
554
|
+
const files = isRookExecutionFiles(output.files) ? output.files : void 0;
|
|
555
|
+
const outputPath = stringField(output, "path");
|
|
556
|
+
const saveError = stringField(output, "saveError");
|
|
557
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
558
|
+
executionId ? /* @__PURE__ */ jsxs("section", {
|
|
559
|
+
className: "think-chat-tool-panels__execution-section",
|
|
560
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
561
|
+
className: "activity__shell-label",
|
|
562
|
+
children: "Execution"
|
|
563
|
+
}), /* @__PURE__ */ jsx(ActivityOutput, { children: executionId })]
|
|
564
|
+
}) : null,
|
|
565
|
+
error ? /* @__PURE__ */ jsxs("section", {
|
|
566
|
+
className: "think-chat-tool-panels__execution-section",
|
|
567
|
+
children: [
|
|
568
|
+
/* @__PURE__ */ jsx("span", {
|
|
569
|
+
className: "activity__shell-label",
|
|
570
|
+
children: "Error"
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ jsx(ActivityOutput, { children: executionErrorSummary(error) }),
|
|
573
|
+
/* @__PURE__ */ jsx("span", {
|
|
574
|
+
className: "activity__shell-status",
|
|
575
|
+
"data-error": "true",
|
|
576
|
+
children: "error"
|
|
577
|
+
})
|
|
578
|
+
]
|
|
579
|
+
}) : null,
|
|
580
|
+
failureKind ? /* @__PURE__ */ jsxs("section", {
|
|
581
|
+
className: "think-chat-tool-panels__execution-section",
|
|
582
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
583
|
+
className: "activity__shell-label",
|
|
584
|
+
children: "Failure kind"
|
|
585
|
+
}), /* @__PURE__ */ jsx(ActivityOutput, { children: failureKind })]
|
|
586
|
+
}) : null,
|
|
587
|
+
logs?.length ? executionResultSection("Logs", logs) : null,
|
|
588
|
+
files?.length ? executionResultSection("Files", files) : null,
|
|
589
|
+
outputPath ? executionFileSection("Saved script", outputPath) : null,
|
|
590
|
+
Object.hasOwn(output, "result") ? executionResultSection("Result", output.result) : null,
|
|
591
|
+
saveError ? /* @__PURE__ */ jsxs("section", {
|
|
592
|
+
className: "think-chat-tool-panels__execution-section",
|
|
593
|
+
children: [
|
|
594
|
+
/* @__PURE__ */ jsx("span", {
|
|
595
|
+
className: "activity__shell-label",
|
|
596
|
+
children: "Script save"
|
|
597
|
+
}),
|
|
598
|
+
/* @__PURE__ */ jsx(ActivityOutput, { children: executionErrorSummary(saveError) }),
|
|
599
|
+
/* @__PURE__ */ jsx("span", {
|
|
600
|
+
className: "activity__shell-status",
|
|
601
|
+
children: "not saved"
|
|
602
|
+
})
|
|
603
|
+
]
|
|
604
|
+
}) : null
|
|
605
|
+
] });
|
|
606
|
+
}
|
|
607
|
+
/** Route only discriminable outputs; ambiguous contracts remain generic data. */
|
|
378
608
|
function ThinkChatExecutePanel({ part }) {
|
|
379
|
-
|
|
609
|
+
const failure = toolFailurePanel(part, "Code");
|
|
610
|
+
if (failure) return failure;
|
|
611
|
+
const input = asRecord(part.input);
|
|
612
|
+
const code = stringField(input, "code") ?? "";
|
|
613
|
+
const outputValue = part.state === "output-available" ? part.output : void 0;
|
|
614
|
+
if (part.state === "output-available" && part.preliminary) return /* @__PURE__ */ jsx(ToolInvocationDetails, { part });
|
|
615
|
+
if (part.state === "output-available" && isCodemodePanelOutput(outputValue)) return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
380
616
|
label: "Code",
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
617
|
+
status: executeStatusText(outputValue),
|
|
618
|
+
error: outputValue.status === "error",
|
|
619
|
+
children: /* @__PURE__ */ jsx(ExecuteCodeView, {
|
|
620
|
+
code,
|
|
621
|
+
output: outputValue,
|
|
622
|
+
isStreaming: false
|
|
623
|
+
})
|
|
384
624
|
});
|
|
385
|
-
if (part.state === "output-
|
|
386
|
-
|
|
625
|
+
if (part.state === "output-available" && isRookExecuteOutput(outputValue)) return /* @__PURE__ */ jsx(RookExecutePanel, {
|
|
626
|
+
inputValue: part.input,
|
|
627
|
+
outputValue,
|
|
628
|
+
isStreaming: false
|
|
629
|
+
});
|
|
630
|
+
if (part.state !== "output-available" && typeof input?.path === "string") return /* @__PURE__ */ jsx(RookExecutePanel, {
|
|
631
|
+
inputValue: part.input,
|
|
632
|
+
outputValue: void 0,
|
|
633
|
+
isStreaming: part.state === "input-streaming"
|
|
634
|
+
});
|
|
635
|
+
if (part.state === "output-available") return /* @__PURE__ */ jsx(ToolInvocationDetails, {
|
|
636
|
+
part,
|
|
637
|
+
outputError: thinkToolOutcome(part) === "failed"
|
|
638
|
+
});
|
|
639
|
+
if (!code) return /* @__PURE__ */ jsx(ToolInvocationDetails, { part });
|
|
387
640
|
return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
388
641
|
label: "Code",
|
|
389
|
-
status: executeStatusText(output),
|
|
390
|
-
error: output?.status === "error",
|
|
391
642
|
children: /* @__PURE__ */ jsx(ExecuteCodeView, {
|
|
392
|
-
code
|
|
393
|
-
output,
|
|
643
|
+
code,
|
|
644
|
+
output: void 0,
|
|
394
645
|
isStreaming: part.state === "input-streaming"
|
|
395
646
|
})
|
|
396
647
|
});
|
|
397
648
|
}
|
|
398
649
|
function ThinkChatBrowserPanel({ part }) {
|
|
399
650
|
const [seenAt] = React.useState(() => Date.now());
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
text: executionErrorSummary(part.errorText),
|
|
403
|
-
status: "error",
|
|
404
|
-
error: true
|
|
405
|
-
});
|
|
406
|
-
if (part.state === "output-denied") return renderDeniedPanel("Browser", part.approval.reason);
|
|
651
|
+
const failure = toolFailurePanel(part, "Browser");
|
|
652
|
+
if (failure) return failure;
|
|
407
653
|
if (part.type === "tool-browser_execute") return /* @__PURE__ */ jsx(ThinkChatBrowserExecutePanel, {
|
|
408
654
|
part,
|
|
409
655
|
seenAt
|
|
@@ -485,7 +731,7 @@ function ThinkChatBrowserExecutePanel({ part, seenAt }) {
|
|
|
485
731
|
function ThinkChatShellPanel({ part }) {
|
|
486
732
|
const output = part.state === "output-available" ? part.output : void 0;
|
|
487
733
|
const errorText = part.state === "output-error" ? part.errorText : "";
|
|
488
|
-
const deniedReason = part.state === "output-denied" ? part.approval.reason ?? "denied" : "";
|
|
734
|
+
const deniedReason = part.state === "output-denied" || part.state === "approval-responded" && !part.approval.approved ? part.approval.reason ?? "denied" : "";
|
|
489
735
|
const failed = Boolean(errorText) || Boolean(deniedReason) || output !== void 0 && (output.exitCode !== 0 || Boolean(output.errors?.length));
|
|
490
736
|
const text = formatBashPanelText(part.input, output, errorText || deniedReason);
|
|
491
737
|
return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
@@ -525,4 +771,4 @@ function getBashStatusText(output, errorText, deniedReason) {
|
|
|
525
771
|
return "success";
|
|
526
772
|
}
|
|
527
773
|
//#endregion
|
|
528
|
-
export { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSessionContextPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel };
|
|
774
|
+
export { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatFollowUpPanel, ThinkChatSessionContextPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
export { BrowserToolPart, ExecuteToolPart, FetchToolPart, SessionContextToolName, SessionContextToolPart, SkillToolPart, ThinkBashToolOutput, ThinkBashToolPart, ThinkChatPart, ThinkWorkspaceToolName, WorkspaceToolPart, displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart };
|
|
1
|
+
import { C as isThinkChatActivityPart, E as thinkToolOutcome, S as isSkillToolPart, T as readFollowUpReceipt, _ as isFetchToolPart, a as SessionContextToolName, b as isSessionContextToolFailure, c as ThinkBashToolOutput, d as ThinkToolOutcome, f as ThinkWorkspaceToolName, g as isExecuteToolPart, h as isBrowserToolPart, i as FollowUpReceipt, l as ThinkBashToolPart, m as displayUrl, n as ExecuteToolPart, o as SessionContextToolPart, p as WorkspaceToolPart, r as FetchToolPart, s as SkillToolPart, t as BrowserToolPart, u as ThinkChatPart, v as isPartFailed, w as isWorkspaceToolPart, x as isSessionContextToolPart, y as isPartWorking } from "../../ThinkChatToolParts-BrntWlpa.js";
|
|
2
|
+
export { BrowserToolPart, ExecuteToolPart, FetchToolPart, FollowUpReceipt, SessionContextToolName, SessionContextToolPart, SkillToolPart, ThinkBashToolOutput, ThinkBashToolPart, ThinkChatPart, ThinkToolOutcome, ThinkWorkspaceToolName, WorkspaceToolPart, displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart, readFollowUpReceipt, thinkToolOutcome };
|
|
@@ -71,8 +71,78 @@ function isPartWorking(part) {
|
|
|
71
71
|
function isPartFailed(part) {
|
|
72
72
|
return isToolUIPart(part) && isToolPartFailed(part);
|
|
73
73
|
}
|
|
74
|
+
function isThinkActionError(value) {
|
|
75
|
+
if (!isRecord(value) || !isRecord(value.error)) return false;
|
|
76
|
+
return typeof value.error.name === "string" && typeof value.error.message === "string";
|
|
77
|
+
}
|
|
78
|
+
function isRecord(value) {
|
|
79
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
80
|
+
}
|
|
81
|
+
function isFollowUpDateTime(value) {
|
|
82
|
+
if (typeof value !== "string") return false;
|
|
83
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(Z|([+-])(\d{2}):(\d{2}))$/.exec(value);
|
|
84
|
+
if (!match) return false;
|
|
85
|
+
const [, year, month, day, hour, minute, second, , , offsetHour, offsetMinute] = match;
|
|
86
|
+
const yearNumber = Number(year);
|
|
87
|
+
const monthNumber = Number(month);
|
|
88
|
+
const dayNumber = Number(day);
|
|
89
|
+
return monthNumber >= 1 && monthNumber <= 12 && dayNumber >= 1 && dayNumber <= new Date(Date.UTC(yearNumber, monthNumber, 0)).getUTCDate() && Number(hour) <= 23 && Number(minute) <= 59 && Number(second) <= 59 && (offsetHour === void 0 || Number(offsetHour) <= 23) && (offsetMinute === void 0 || Number(offsetMinute) <= 59) && Number.isFinite(Date.parse(value));
|
|
90
|
+
}
|
|
91
|
+
/** Validated final receipt for the static Rook follow-up action only. */
|
|
92
|
+
function readFollowUpReceipt(part) {
|
|
93
|
+
if (!isStaticToolUIPart(part) || getStaticToolName(part) !== "follow_up" || part.state !== "output-available" || part.preliminary || thinkToolOutcome(part)) return;
|
|
94
|
+
const input = isRecord(part.input) ? part.input : void 0;
|
|
95
|
+
const output = part.output;
|
|
96
|
+
if (input?.operation === "schedule") {
|
|
97
|
+
if (isRecord(output) && typeof output.id === "string" && output.id.length > 0 && isFollowUpDateTime(output.scheduledFor) && typeof input.prompt === "string" && input.prompt.trim().length > 0) return {
|
|
98
|
+
operation: "schedule",
|
|
99
|
+
id: output.id,
|
|
100
|
+
scheduledFor: output.scheduledFor,
|
|
101
|
+
prompt: input.prompt
|
|
102
|
+
};
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (input?.operation === "list") {
|
|
106
|
+
if (!Array.isArray(output)) return void 0;
|
|
107
|
+
const followUps = [];
|
|
108
|
+
for (const item of output) {
|
|
109
|
+
if (!isRecord(item) || typeof item.id !== "string" || item.id.length === 0 || !isFollowUpDateTime(item.scheduledFor) || typeof item.prompt !== "string") return;
|
|
110
|
+
followUps.push({
|
|
111
|
+
id: item.id,
|
|
112
|
+
scheduledFor: item.scheduledFor,
|
|
113
|
+
prompt: item.prompt
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
operation: "list",
|
|
118
|
+
followUps
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
if (input?.operation === "cancel" && typeof input.id === "string" && input.id.length > 0 && isRecord(output) && typeof output.cancelled === "boolean") return {
|
|
122
|
+
operation: "cancel",
|
|
123
|
+
id: input.id,
|
|
124
|
+
cancelled: output.cancelled
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Interpret only contracts known to return error envelopes. Dynamic/MCP
|
|
129
|
+
* results may have an ordinary `error` field and remain generic data.
|
|
130
|
+
*/
|
|
131
|
+
function thinkToolOutcome(part) {
|
|
132
|
+
if (!isToolUIPart(part)) return void 0;
|
|
133
|
+
if (part.state === "output-error") return "failed";
|
|
134
|
+
if (part.state === "output-denied" || part.state === "approval-responded" && !part.approval.approved) return "denied";
|
|
135
|
+
if (!isStaticToolUIPart(part)) return void 0;
|
|
136
|
+
if (part.state !== "output-available" || part.preliminary) return void 0;
|
|
137
|
+
const name = getToolName(part);
|
|
138
|
+
const output = part.output;
|
|
139
|
+
if (!isRecord(output)) return void 0;
|
|
140
|
+
if (name === "execute" || name === "browser_execute") return output.status === "error" ? "failed" : void 0;
|
|
141
|
+
if (name === "read_active_tab") return typeof output.error === "string" ? "failed" : void 0;
|
|
142
|
+
if ((name === "follow_up" || name === "scheduled_tasks" || name === "search_history" || name === "set_thread_title") && isThinkActionError(output)) return "failed";
|
|
143
|
+
}
|
|
74
144
|
function displayUrl(url) {
|
|
75
145
|
return url ? url.replace(/^https?:\/\//, "") : "";
|
|
76
146
|
}
|
|
77
147
|
//#endregion
|
|
78
|
-
export { displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart };
|
|
148
|
+
export { displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart, readFollowUpReceipt, thinkToolOutcome };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
3
2
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
4
|
-
import {
|
|
3
|
+
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
4
|
+
import { t as ExecutionResult } from "../../ExecutionResult-Wd1sKAvD.js";
|
|
5
5
|
import { formatThinkExecutionTimestamp, getThinkExecutionRunError, getThinkExecutionRunKindLabel, getThinkExecutionRunProgressedAt, getThinkExecutionRunProgressedLabel, getThinkExecutionRunTitle } from "./ThinkExecutionRun.js";
|
|
6
6
|
import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
|
|
7
7
|
import "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { K as SpinnerIcon, L as PauseIcon, T as InfoIcon, d as CheckIcon, rt as XIcon } from "../../icons-
|
|
2
|
+
import { K as SpinnerIcon, L as PauseIcon, T as InfoIcon, d as CheckIcon, rt as XIcon } from "../../icons-Cn3vWZRs.js";
|
|
3
3
|
import { Tooltip } from "../foundations/Tooltip.js";
|
|
4
4
|
import { formatThinkExecutionRunProgress, formatThinkExecutionStatus, getThinkExecutionRunKindLabel, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, getThinkExecutionRunTitle } from "./ThinkExecutionRun.js";
|
|
5
5
|
import "react";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as AppTopBar } from "../../AppTopBar-DwzydmXu.js";
|
|
2
|
+
import { r as ResponsiveSidebarAppBarProps } from "../../ResponsiveSidebarShell-DzBGlRJF.js";
|
|
2
3
|
import { t as ThinkExecutionRun } from "../../ThinkExecutionRun-CPeYVneQ.js";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { useRender } from "@base-ui/react/use-render";
|
|
@@ -50,10 +51,8 @@ export declare function thinkExecutionRunsQueryOptions(source: AgentStub<Think>,
|
|
|
50
51
|
* uncached list read suspends to the consuming route's Suspense boundary.
|
|
51
52
|
*/
|
|
52
53
|
declare function ThinkExecutionWorkbenchRoot({ pageSize, render, ref, source, sourceKey, ...props }: ThinkExecutionWorkbenchRootProps): React.JSX.Element;
|
|
53
|
-
/**
|
|
54
|
-
declare function ThinkExecutionWorkbenchHeader({ className,
|
|
55
|
-
"aria-label"?: string;
|
|
56
|
-
}): React.JSX.Element;
|
|
54
|
+
/** Workbench controls composed into a standalone or host-owned application bar. */
|
|
55
|
+
declare function ThinkExecutionWorkbenchHeader({ className, label, ...props }: ResponsiveSidebarAppBarProps): React.JSX.Element;
|
|
57
56
|
declare function ThinkExecutionWorkbenchContent({ render, ref, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
58
57
|
/** Refresh control retaining the complete AppTopBar button render/ref/event contract. */
|
|
59
58
|
declare function ThinkExecutionWorkbenchRefresh({ label, ...props }: Omit<React.ComponentProps<typeof AppTopBar.Button>, "label"> & {
|