@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.
Files changed (251) hide show
  1. package/dist/AgentActivity-BNUNrP9O.d.ts +36 -0
  2. package/dist/{AgentChat-DQkqt82e.d.ts → AgentChat-CrlpbvQJ.d.ts} +58 -6
  3. package/dist/{CodeBlock-DUh9WOGo.d.ts → CodeBlock-BRajW4QU.d.ts} +1 -1
  4. package/dist/{CodeBlock-BUFXG8HW.js → CodeBlock-BmB4Xaqq.js} +15 -4
  5. package/dist/{FileTree-mpEIcfzA.js → FileTree-CkVbIMWV.js} +82 -89
  6. package/dist/Message-BkMdE3bS.js +375 -0
  7. package/dist/{ModelSelector-CPCpFAUt.js → ModelSelector-SlJNgwKY.js} +2 -2
  8. package/dist/{PromptInput-ClNqBiIw.d.ts → PromptInput-BWTuXMOD.d.ts} +123 -5
  9. package/dist/ResponsiveSidebarShell-Dd9DCcBT.d.ts +67 -0
  10. package/dist/{Select-Dl_vF_Bt.d.ts → Select-BeEsefzh.d.ts} +12 -2
  11. package/dist/{ThinkChat-BPcehdbP.js → ThinkChat-CzC-zNGA.js} +24 -36
  12. package/dist/{ThinkChatActivity-BmwuIigx.d.ts → ThinkChatActivity-BFQnb2ct.d.ts} +3 -10
  13. package/dist/ThinkChatActivitySummary-BPmu9a-c.d.ts +39 -0
  14. package/dist/{ThinkChatToolParts-CDEjqS6A.d.ts → ThinkChatToolParts-CSzVwMXf.d.ts} +13 -3
  15. package/dist/ThinkExecutionRun-ChhWhOoU.d.ts +30 -0
  16. package/dist/Toggle-CAAlNl-M.d.ts +69 -0
  17. package/dist/ToggleGroup-8hPv-b69.d.ts +73 -0
  18. package/dist/Workspace-D39LxGvP.d.ts +62 -0
  19. package/dist/WorkspaceFile-DOZkPwzu.d.ts +106 -0
  20. package/dist/WorkspaceFileView-rSN_yT0L.js +744 -0
  21. package/dist/WorkspaceLink-DIPbXrUM.js +337 -0
  22. package/dist/WorkspaceLink-DK1DWMHe.d.ts +89 -0
  23. package/dist/components/Activity.d.ts +27 -1
  24. package/dist/components/Activity.js +33 -15
  25. package/dist/components/AgentActivity.d.ts +2 -0
  26. package/dist/components/AgentActivity.js +45 -0
  27. package/dist/components/AgentActivityPreview.d.ts +46 -0
  28. package/dist/components/AgentActivityPreview.js +94 -0
  29. package/dist/components/AgentAttention.d.ts +73 -0
  30. package/dist/components/AgentAttention.js +85 -0
  31. package/dist/components/AgentChat.d.ts +2 -2
  32. package/dist/components/AgentChat.js +224 -200
  33. package/dist/components/AgentChatMessageEditor.d.ts +29 -0
  34. package/dist/components/AgentChatMessageEditor.js +92 -0
  35. package/dist/components/AgentChatTurnError.d.ts +17 -0
  36. package/dist/components/AgentChatTurnError.js +40 -0
  37. package/dist/components/AgentConnection.d.ts +12 -17
  38. package/dist/components/AgentConnection.js +99 -91
  39. package/dist/components/AppFrame.d.ts +24 -0
  40. package/dist/components/AppFrame.js +25 -0
  41. package/dist/components/AppTopBar.d.ts +71 -0
  42. package/dist/components/AppTopBar.js +82 -0
  43. package/dist/components/Artifact.js +1 -1
  44. package/dist/components/BrowserLiveView.js +1 -1
  45. package/dist/components/BrowserReplay.js +1 -1
  46. package/dist/components/BrowserRunPanel.js +1 -1
  47. package/dist/components/Card.d.ts +3 -0
  48. package/dist/components/Card.js +2 -1
  49. package/dist/components/ChainOfThought.d.ts +1 -1
  50. package/dist/components/ChainOfThought.js +1 -1
  51. package/dist/components/ChatGptSignInScreen.js +2 -2
  52. package/dist/components/Checkbox.js +5 -13
  53. package/dist/components/CheckboxGroup.d.ts +58 -2
  54. package/dist/components/CheckboxGroup.js +59 -1
  55. package/dist/components/CodeBlock.d.ts +1 -1
  56. package/dist/components/CodeBlock.js +1 -1
  57. package/dist/components/CodexModelSelector.js +1 -1
  58. package/dist/components/Commit.js +2 -2
  59. package/dist/components/ContextMenu.js +1 -1
  60. package/dist/components/Conversation.js +1 -1
  61. package/dist/components/DescriptionList.d.ts +12 -0
  62. package/dist/components/DescriptionList.js +11 -0
  63. package/dist/components/DescriptionListParts.d.ts +37 -0
  64. package/dist/components/DescriptionListParts.js +35 -0
  65. package/dist/components/EnvironmentVariables.js +2 -2
  66. package/dist/components/Fieldset.d.ts +13 -1
  67. package/dist/components/Fieldset.js +11 -2
  68. package/dist/components/FileTree.js +1 -1
  69. package/dist/components/IconButton.d.ts +33 -0
  70. package/dist/components/IconButton.js +27 -0
  71. package/dist/components/McpConnectionRequest.d.ts +44 -0
  72. package/dist/components/McpConnectionRequest.js +122 -0
  73. package/dist/components/McpServerPicker.d.ts +48 -23
  74. package/dist/components/McpServerPicker.js +238 -189
  75. package/dist/components/Menubar.js +1 -1
  76. package/dist/components/Message.d.ts +1 -0
  77. package/dist/components/Message.js +1 -285
  78. package/dist/components/MessageScroller.js +1 -1
  79. package/dist/components/ModelSelector.js +1 -1
  80. package/dist/components/Pricing.d.ts +37 -0
  81. package/dist/components/Pricing.js +17 -0
  82. package/dist/components/PricingBillingToggle.d.ts +23 -0
  83. package/dist/components/PricingBillingToggle.js +86 -0
  84. package/dist/components/PricingConfirmationDialog.d.ts +25 -0
  85. package/dist/components/PricingConfirmationDialog.js +57 -0
  86. package/dist/components/PricingFAQ.d.ts +18 -0
  87. package/dist/components/PricingFAQ.js +27 -0
  88. package/dist/components/PricingPage.d.ts +2 -38
  89. package/dist/components/PricingPage.js +39 -359
  90. package/dist/components/PricingPlanCard.d.ts +22 -0
  91. package/dist/components/PricingPlanCard.js +109 -0
  92. package/dist/components/PricingUsageCalculator.d.ts +22 -0
  93. package/dist/components/PricingUsageCalculator.js +96 -0
  94. package/dist/components/PromptInput.d.ts +2 -2
  95. package/dist/components/PromptInput.js +210 -15
  96. package/dist/components/Queue.js +1 -1
  97. package/dist/components/Reasoning.d.ts +2 -1
  98. package/dist/components/Reasoning.js +14 -29
  99. package/dist/components/ResizableSidePanel.d.ts +57 -0
  100. package/dist/components/ResizableSidePanel.js +151 -0
  101. package/dist/components/ResponsiveSidebarShell.d.ts +2 -0
  102. package/dist/components/ResponsiveSidebarShell.js +129 -0
  103. package/dist/components/Select.d.ts +2 -2
  104. package/dist/components/Select.js +11 -2
  105. package/dist/components/Slider.d.ts +13 -1
  106. package/dist/components/Slider.js +11 -0
  107. package/dist/components/Sources.js +1 -1
  108. package/dist/components/Stepper.d.ts +4 -0
  109. package/dist/components/Stepper.js +5 -3
  110. package/dist/components/SubagentRun.d.ts +18 -19
  111. package/dist/components/SubagentRun.js +25 -18
  112. package/dist/components/SubagentRunIndicator.d.ts +22 -0
  113. package/dist/components/SubagentRunIndicator.js +33 -0
  114. package/dist/components/SubagentRunList.d.ts +25 -0
  115. package/dist/components/SubagentRunList.js +26 -0
  116. package/dist/components/SubagentRunSelector.d.ts +47 -0
  117. package/dist/components/SubagentRunSelector.js +55 -0
  118. package/dist/components/Task.js +1 -1
  119. package/dist/components/Terminal.js +2 -2
  120. package/dist/components/TestResults.js +1 -1
  121. package/dist/components/Textarea.d.ts +21 -0
  122. package/dist/components/Textarea.js +19 -0
  123. package/dist/components/ThemeModeControl.d.ts +24 -0
  124. package/dist/components/ThemeModeControl.js +52 -0
  125. package/dist/components/ThemeProvider.d.ts +38 -0
  126. package/dist/components/ThemeProvider.js +80 -0
  127. package/dist/components/ThinkChat.d.ts +29 -6
  128. package/dist/components/ThinkChat.js +7 -4
  129. package/dist/components/ThinkChatActivity.d.ts +3 -2
  130. package/dist/components/ThinkChatActivity.js +12 -318
  131. package/dist/components/ThinkChatActivitySummary.d.ts +2 -0
  132. package/dist/components/ThinkChatActivitySummary.js +421 -0
  133. package/dist/components/ThinkChatToolPanels.d.ts +7 -5
  134. package/dist/components/ThinkChatToolPanels.js +70 -8
  135. package/dist/components/ThinkChatToolParts.d.ts +2 -2
  136. package/dist/components/ThinkChatToolParts.js +36 -10
  137. package/dist/components/ThinkExecutionDetail.d.ts +20 -0
  138. package/dist/components/ThinkExecutionDetail.js +80 -0
  139. package/dist/components/ThinkExecutionRun.d.ts +2 -0
  140. package/dist/components/ThinkExecutionRun.js +72 -0
  141. package/dist/components/ThinkExecutionStatus.d.ts +22 -0
  142. package/dist/components/ThinkExecutionStatus.js +36 -0
  143. package/dist/components/ThinkExecutionWorkbench.d.ts +7 -0
  144. package/dist/components/ThinkExecutionWorkbench.js +69 -225
  145. package/dist/components/ThinkFullApp.d.ts +58 -14
  146. package/dist/components/ThinkFullApp.js +154 -160
  147. package/dist/components/ThinkFullAppViewSwitch.d.ts +31 -0
  148. package/dist/components/ThinkFullAppViewSwitch.js +34 -0
  149. package/dist/components/ThinkRoutine.d.ts +36 -0
  150. package/dist/components/ThinkRoutine.js +15 -0
  151. package/dist/components/ThinkRoutineBrowser.d.ts +25 -0
  152. package/dist/components/ThinkRoutineBrowser.js +156 -0
  153. package/dist/components/ThinkRoutineDetail.d.ts +24 -0
  154. package/dist/components/ThinkRoutineDetail.js +102 -0
  155. package/dist/components/ThinkRoutineForm.d.ts +32 -0
  156. package/dist/components/ThinkRoutineForm.js +151 -0
  157. package/dist/components/ThinkRoutineLibrary.d.ts +74 -0
  158. package/dist/components/ThinkRoutineLibrary.js +178 -0
  159. package/dist/components/ThinkRoutineRuns.d.ts +24 -0
  160. package/dist/components/ThinkRoutineRuns.js +68 -0
  161. package/dist/components/ThinkThreadPicker.d.ts +18 -1
  162. package/dist/components/ThinkThreadPicker.js +51 -5
  163. package/dist/components/ThinkThreadShell.d.ts +12 -9
  164. package/dist/components/ThinkThreadShell.js +17 -137
  165. package/dist/components/Toggle.d.ts +1 -68
  166. package/dist/components/ToggleGroup.d.ts +1 -72
  167. package/dist/components/Tooltip.d.ts +3 -1
  168. package/dist/components/Tooltip.js +4 -2
  169. package/dist/components/WebPreview.js +1 -1
  170. package/dist/components/Workspace.d.ts +2 -0
  171. package/dist/components/Workspace.js +424 -0
  172. package/dist/components/WorkspaceBrowser.d.ts +32 -0
  173. package/dist/components/WorkspaceBrowser.js +103 -0
  174. package/dist/components/WorkspaceExplorer.d.ts +12 -79
  175. package/dist/components/WorkspaceExplorer.js +116 -330
  176. package/dist/components/WorkspaceFile.d.ts +2 -0
  177. package/dist/components/WorkspaceFile.js +195 -0
  178. package/dist/components/WorkspaceFileView.d.ts +26 -0
  179. package/dist/components/WorkspaceFileView.js +2 -0
  180. package/dist/components/WorkspaceHeader.d.ts +35 -0
  181. package/dist/components/WorkspaceHeader.js +51 -0
  182. package/dist/components/WorkspaceLink.d.ts +2 -0
  183. package/dist/components/WorkspaceLink.js +2 -0
  184. package/dist/components/icons.d.ts +2 -2
  185. package/dist/components/icons.js +2 -2
  186. package/dist/{copy-button-DUMLYdsk.js → copy-button-Dejn5heL.js} +1 -1
  187. package/dist/icons-CpfUer49.js +85 -0
  188. package/dist/{icons-CUCz_Sft.d.ts → icons-GQd1xF4e.d.ts} +51 -1
  189. package/dist/styles/activity-header.css +75 -0
  190. package/dist/styles/activity.css +49 -63
  191. package/dist/styles/agent-activity-preview-overlay.css +80 -0
  192. package/dist/styles/agent-activity-preview.css +233 -0
  193. package/dist/styles/agent-attention.css +128 -0
  194. package/dist/styles/agent-chat.css +133 -4
  195. package/dist/styles/agent-connection.css +9 -9
  196. package/dist/styles/alert-dialog.css +11 -11
  197. package/dist/styles/app-frame.css +15 -0
  198. package/dist/styles/app-top-bar.css +102 -0
  199. package/dist/styles/avatar.css +0 -1
  200. package/dist/styles/browser-control-overlay.css +184 -0
  201. package/dist/styles/card.css +29 -8
  202. package/dist/styles/chain-of-thought.css +5 -5
  203. package/dist/styles/checkbox-group.css +69 -0
  204. package/dist/styles/codex-model-selector.css +3 -3
  205. package/dist/styles/combobox.css +2 -1
  206. package/dist/styles/context-menu.css +1 -1
  207. package/dist/styles/description-list.css +50 -0
  208. package/dist/styles/dialog.css +11 -11
  209. package/dist/styles/field.css +14 -14
  210. package/dist/styles/fieldset.css +15 -4
  211. package/dist/styles/index.css +14 -2
  212. package/dist/styles/mcp-connection-request.css +60 -0
  213. package/dist/styles/mcp-server-picker.css +96 -68
  214. package/dist/styles/menu.css +1 -1
  215. package/dist/styles/message.css +4 -43
  216. package/dist/styles/model-selector.css +18 -12
  217. package/dist/styles/popover.css +9 -9
  218. package/dist/styles/preview-card.css +1 -1
  219. package/dist/styles/pricing-page.css +21 -27
  220. package/dist/styles/prompt-input.css +225 -32
  221. package/dist/styles/reasoning.css +1 -55
  222. package/dist/styles/recipes.css +50 -24
  223. package/dist/styles/resizable-side-panel.css +66 -0
  224. package/dist/styles/responsive-sidebar-shell.css +169 -0
  225. package/dist/styles/select.css +13 -3
  226. package/dist/styles/sources.css +6 -6
  227. package/dist/styles/stepper.css +13 -0
  228. package/dist/styles/streamdown.css +0 -4
  229. package/dist/styles/subagent-run.css +59 -42
  230. package/dist/styles/task.css +17 -10
  231. package/dist/styles/test-results.css +17 -10
  232. package/dist/styles/textarea.css +20 -0
  233. package/dist/styles/theme-mode-control.css +72 -0
  234. package/dist/styles/think-execution-status.css +49 -0
  235. package/dist/styles/think-execution-workbench.css +16 -80
  236. package/dist/styles/think-full-app.css +143 -128
  237. package/dist/styles/think-routine-library.css +491 -0
  238. package/dist/styles/think-thread-picker.css +47 -3
  239. package/dist/styles/toast.css +6 -6
  240. package/dist/styles/toggle-group.css +7 -0
  241. package/dist/styles/tooltip.css +1 -1
  242. package/dist/styles/workspace-explorer.css +516 -64
  243. package/dist/utils/mcp-server-catalog.d.ts +82 -78
  244. package/dist/utils/mcp-server-catalog.js +64 -41
  245. package/dist/utils/structured-code.d.ts +1 -1
  246. package/dist/utils/theme.d.ts +22 -0
  247. package/dist/utils/theme.js +55 -0
  248. package/package.json +34 -28
  249. package/dist/icons-Ba9THQKz.js +0 -64
  250. package/dist/styles/think-resize-handle.css +0 -33
  251. package/dist/styles/think-thread-shell.css +0 -219
@@ -0,0 +1,80 @@
1
+ import { t as cx } from "../class-names-9UtZwb0J.js";
2
+ import { G as TerminalIcon, L as RefreshIcon, S as InfoIcon, Y as XIcon, o as CheckIcon, t as ArrowDownIcon, v as FileIcon } from "../icons-CpfUer49.js";
3
+ import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityOutput, ActivityPanel, ActivityTrigger } from "./Activity.js";
4
+ import { formatThinkExecutionRunProgress, formatThinkExecutionStatus, formatThinkExecutionTimestamp, getThinkExecutionRunError, getThinkExecutionRunId, getThinkExecutionRunProgressedAt, getThinkExecutionRunProgressedLabel, getThinkExecutionRunStatus, getThinkExecutionRunTitle, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
5
+ import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
6
+ import "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/ThinkExecutionDetail.tsx
9
+ function formatJson(value) {
10
+ return JSON.stringify(value, null, 2);
11
+ }
12
+ /** Native Think submission or Agents Workflow detail, reusable outside the execution workbench. */
13
+ function ThinkExecutionDetail({ className, emptyState = "Select a run to view its activity.", ref, run, ...props }) {
14
+ if (!run) return /* @__PURE__ */ jsx("section", {
15
+ ref,
16
+ className: cx("think-execution-detail", "think-execution-workbench__empty-detail", className),
17
+ role: "status",
18
+ ...props,
19
+ children: /* @__PURE__ */ jsx("p", { children: emptyState })
20
+ });
21
+ const id = getThinkExecutionRunId(run);
22
+ const progressedAt = getThinkExecutionRunProgressedAt(run);
23
+ const error = getThinkExecutionRunError(run);
24
+ return /* @__PURE__ */ jsxs("section", {
25
+ ref,
26
+ className: cx("think-execution-detail", className),
27
+ ...props,
28
+ children: [/* @__PURE__ */ jsxs("header", {
29
+ className: "think-execution-workbench__detail-header",
30
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", { children: getThinkExecutionRunTitle(run) }), !isThinkSubmissionRun(run) ? /* @__PURE__ */ jsx("code", { children: id }) : null] }), /* @__PURE__ */ jsxs("div", {
31
+ className: "think-execution-workbench__detail-status",
32
+ children: [/* @__PURE__ */ jsx(ThinkExecutionStatus, {
33
+ run,
34
+ className: "think-execution-workbench__icon"
35
+ }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("strong", { children: formatThinkExecutionStatus(getThinkExecutionRunStatus(run)) }), /* @__PURE__ */ jsx("span", { children: formatThinkExecutionRunProgress(run) })] })]
36
+ })]
37
+ }), /* @__PURE__ */ jsxs(Activity, {
38
+ defaultOpen: true,
39
+ children: [/* @__PURE__ */ jsx(ActivityTrigger, {
40
+ icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
41
+ label: "Activity"
42
+ }), /* @__PURE__ */ jsxs(ActivityContent, { children: [
43
+ /* @__PURE__ */ jsx(ActivityItem, {
44
+ icon: /* @__PURE__ */ jsx(ArrowDownIcon, {}),
45
+ children: `Created ${formatThinkExecutionTimestamp(run.createdAt)}`
46
+ }),
47
+ progressedAt ? /* @__PURE__ */ jsx(ActivityItem, {
48
+ icon: /* @__PURE__ */ jsx(RefreshIcon, {}),
49
+ children: `${getThinkExecutionRunProgressedLabel(run)} ${formatThinkExecutionTimestamp(progressedAt)}`
50
+ }) : null,
51
+ run.completedAt ? /* @__PURE__ */ jsx(ActivityItem, {
52
+ icon: /* @__PURE__ */ jsx(CheckIcon, {}),
53
+ children: `Finished ${formatThinkExecutionTimestamp(run.completedAt)}`
54
+ }) : null,
55
+ error ? /* @__PURE__ */ jsx(ActivityItemGroup, {
56
+ icon: /* @__PURE__ */ jsx(XIcon, {}),
57
+ label: "Failure",
58
+ children: /* @__PURE__ */ jsx(ActivityPanel, {
59
+ label: "Error",
60
+ text: error,
61
+ status: "error",
62
+ error: true
63
+ })
64
+ }) : null,
65
+ run.metadata ? /* @__PURE__ */ jsx(ActivityItemGroup, {
66
+ icon: /* @__PURE__ */ jsx(InfoIcon, {}),
67
+ label: "Metadata",
68
+ children: /* @__PURE__ */ jsx(ActivityOutput, { children: formatJson(run.metadata) })
69
+ }) : null,
70
+ /* @__PURE__ */ jsx(ActivityItemGroup, {
71
+ icon: /* @__PURE__ */ jsx(FileIcon, {}),
72
+ label: "Raw record",
73
+ children: /* @__PURE__ */ jsx(ActivityOutput, { children: formatJson(run) })
74
+ })
75
+ ] })]
76
+ })]
77
+ });
78
+ }
79
+ //#endregion
80
+ export { ThinkExecutionDetail };
@@ -0,0 +1,2 @@
1
+ import { _ as isThinkSubmissionRun, a as formatThinkExecutionStatus, c as getThinkExecutionRunError, d as getThinkExecutionRunProgressedLabel, f as getThinkExecutionRunStatus, g as isSameThinkExecutionRun, h as getThinkExecutionRunTitle, i as formatThinkExecutionShortTimestamp, l as getThinkExecutionRunId, m as getThinkExecutionRunSubtitle, n as ThinkExecutionStatusTone, o as formatThinkExecutionTimestamp, p as getThinkExecutionRunStatusTone, r as formatThinkExecutionRunProgress, s as getThinkExecutionRunAccessibleName, t as ThinkExecutionRun, u as getThinkExecutionRunProgressedAt } from "../ThinkExecutionRun-ChhWhOoU.js";
2
+ export { ThinkExecutionRun, ThinkExecutionStatusTone, formatThinkExecutionRunProgress, formatThinkExecutionShortTimestamp, formatThinkExecutionStatus, formatThinkExecutionTimestamp, getThinkExecutionRunAccessibleName, getThinkExecutionRunError, getThinkExecutionRunId, getThinkExecutionRunProgressedAt, getThinkExecutionRunProgressedLabel, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, getThinkExecutionRunSubtitle, getThinkExecutionRunTitle, isSameThinkExecutionRun, isThinkSubmissionRun };
@@ -0,0 +1,72 @@
1
+ //#region src/components/ThinkExecutionRun.ts
2
+ /** Narrows the direct upstream execution union without wrapping either record. */
3
+ function isThinkSubmissionRun(run) {
4
+ return "submissionId" in run;
5
+ }
6
+ function getThinkExecutionRunId(run) {
7
+ return isThinkSubmissionRun(run) ? run.submissionId : run.workflowId;
8
+ }
9
+ function getThinkExecutionRunTitle(run) {
10
+ return isThinkSubmissionRun(run) ? run.submissionId : run.workflowName;
11
+ }
12
+ function getThinkExecutionRunSubtitle(run) {
13
+ return isThinkSubmissionRun(run) ? void 0 : run.workflowId;
14
+ }
15
+ function getThinkExecutionRunProgressedAt(run) {
16
+ return isThinkSubmissionRun(run) ? run.startedAt : run.updatedAt;
17
+ }
18
+ function getThinkExecutionRunProgressedLabel(run) {
19
+ return isThinkSubmissionRun(run) ? "Started" : "Updated";
20
+ }
21
+ /**
22
+ * WorkflowInfo.status resolves through the Workers-only InstanceStatus ambient
23
+ * type, so browser consumers format the whole upstream record's runtime value
24
+ * instead of exporting a local mirror of that union.
25
+ */
26
+ function getThinkExecutionRunStatus(run) {
27
+ return String(run.status);
28
+ }
29
+ function getThinkExecutionRunStatusTone(run) {
30
+ const status = getThinkExecutionRunStatus(run);
31
+ if (status === "completed" || status === "complete") return "success";
32
+ if (status === "error" || status === "errored" || status === "terminated") return "danger";
33
+ if (status === "aborted" || status === "skipped" || status === "paused" || status === "waiting") return "warning";
34
+ if (status === "running" || status === "pending" || status === "queued" || status === "waitingForPause" || status === "rollingBack") return "primary";
35
+ return "neutral";
36
+ }
37
+ function formatThinkExecutionStatus(status) {
38
+ const words = status.replaceAll(/([a-z])([A-Z])/g, "$1 $2");
39
+ return words.charAt(0).toUpperCase() + words.slice(1);
40
+ }
41
+ function formatThinkExecutionTimestamp(value, fallback = "Not recorded") {
42
+ if (value == null) return fallback;
43
+ const date = value instanceof Date ? value : new Date(value);
44
+ return Number.isNaN(date.getTime()) ? fallback : date.toLocaleString();
45
+ }
46
+ function formatThinkExecutionShortTimestamp(value, fallback = "Not recorded") {
47
+ if (value == null) return fallback;
48
+ const date = value instanceof Date ? value : new Date(value);
49
+ return Number.isNaN(date.getTime()) ? fallback : date.toLocaleString(void 0, {
50
+ month: "short",
51
+ day: "numeric",
52
+ hour: "numeric",
53
+ minute: "2-digit"
54
+ });
55
+ }
56
+ function formatThinkExecutionRunProgress(run) {
57
+ const progressedAt = getThinkExecutionRunProgressedAt(run);
58
+ return `${progressedAt ? getThinkExecutionRunProgressedLabel(run) : "Created"} ${formatThinkExecutionShortTimestamp(progressedAt ?? run.createdAt)}`;
59
+ }
60
+ function getThinkExecutionRunAccessibleName(run) {
61
+ const subtitle = getThinkExecutionRunSubtitle(run);
62
+ return `${getThinkExecutionRunTitle(run)}${subtitle ? ` ${subtitle}` : ""}. ${formatThinkExecutionStatus(getThinkExecutionRunStatus(run))}. ${formatThinkExecutionRunProgress(run)}`;
63
+ }
64
+ function getThinkExecutionRunError(run) {
65
+ return isThinkSubmissionRun(run) ? run.error : run.error ? `${run.error.name}: ${run.error.message}` : void 0;
66
+ }
67
+ function isSameThinkExecutionRun(first, second) {
68
+ if (!first || isThinkSubmissionRun(first) !== isThinkSubmissionRun(second)) return false;
69
+ return getThinkExecutionRunId(first) === getThinkExecutionRunId(second);
70
+ }
71
+ //#endregion
72
+ export { formatThinkExecutionRunProgress, formatThinkExecutionShortTimestamp, formatThinkExecutionStatus, formatThinkExecutionTimestamp, getThinkExecutionRunAccessibleName, getThinkExecutionRunError, getThinkExecutionRunId, getThinkExecutionRunProgressedAt, getThinkExecutionRunProgressedLabel, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, getThinkExecutionRunSubtitle, getThinkExecutionRunTitle, isSameThinkExecutionRun, isThinkSubmissionRun };
@@ -0,0 +1,22 @@
1
+ import { t as ThinkExecutionRun } from "../ThinkExecutionRun-ChhWhOoU.js";
2
+ import * as React from "react";
3
+
4
+ //#region src/components/ThinkExecutionStatus.d.ts
5
+ interface ThinkExecutionStatusProps extends React.HTMLAttributes<HTMLSpanElement> {
6
+ /** Whole upstream Think submission or Agents workflow record. */
7
+ run: ThinkExecutionRun;
8
+ /** Accessible status label; derived from the run when omitted. */
9
+ label?: string;
10
+ }
11
+ /** Shared status icon for whole upstream Think submission and Agents workflow records. */
12
+ declare function ThinkExecutionStatus({
13
+ className,
14
+ label,
15
+ run,
16
+ ref,
17
+ ...props
18
+ }: ThinkExecutionStatusProps & {
19
+ ref?: React.Ref<HTMLSpanElement>;
20
+ }): React.JSX.Element;
21
+ //#endregion
22
+ export { ThinkExecutionStatus, ThinkExecutionStatusProps };
@@ -0,0 +1,36 @@
1
+ import { t as cx } from "../class-names-9UtZwb0J.js";
2
+ import { B as SpinnerIcon, M as PauseIcon, S as InfoIcon, Y as XIcon, o as CheckIcon } from "../icons-CpfUer49.js";
3
+ import { Tooltip } from "./Tooltip.js";
4
+ import { formatThinkExecutionStatus, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone } from "./ThinkExecutionRun.js";
5
+ import "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/ThinkExecutionStatus.tsx
8
+ function statusIcon(tone) {
9
+ if (tone === "success") return /* @__PURE__ */ jsx(CheckIcon, {});
10
+ if (tone === "danger") return /* @__PURE__ */ jsx(XIcon, {});
11
+ if (tone === "warning") return /* @__PURE__ */ jsx(PauseIcon, {});
12
+ if (tone === "primary") return /* @__PURE__ */ jsx(SpinnerIcon, {});
13
+ return /* @__PURE__ */ jsx(InfoIcon, {});
14
+ }
15
+ /** Shared status icon for whole upstream Think submission and Agents workflow records. */
16
+ function ThinkExecutionStatus({ className, label, run, ref, ...props }) {
17
+ const status = getThinkExecutionRunStatus(run);
18
+ const tone = getThinkExecutionRunStatusTone(run);
19
+ const accessibleLabel = label ?? `Status: ${formatThinkExecutionStatus(status)}`;
20
+ return /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: /* @__PURE__ */ jsx("span", {
21
+ ref,
22
+ "aria-label": accessibleLabel,
23
+ className: cx("think-execution-status", className),
24
+ "data-status": status,
25
+ "data-tone": tone,
26
+ role: "img",
27
+ ...props,
28
+ children: statusIcon(tone)
29
+ }) }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
30
+ side: "top",
31
+ sideOffset: 6,
32
+ children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: accessibleLabel })
33
+ }) })] });
34
+ }
35
+ //#endregion
36
+ export { ThinkExecutionStatus };
@@ -1,3 +1,4 @@
1
+ import { t as ThinkExecutionRun } from "../ThinkExecutionRun-ChhWhOoU.js";
1
2
  import * as React from "react";
2
3
  import { Think } from "@cloudflare/think";
3
4
  import { AgentStub } from "agents/client";
@@ -9,6 +10,10 @@ interface ThinkExecutionWorkbenchProps extends Omit<React.HTMLAttributes<HTMLDiv
9
10
  title?: React.ReactNode;
10
11
  backButton?: React.ReactNode;
11
12
  pageSize?: number;
13
+ /** Whole native execution selected by a parent-owned route or product record. */
14
+ selectedRun?: ThinkExecutionRun | null;
15
+ /** Receives the fully inspected native execution after a user selects a row. */
16
+ onSelectedRunChange?: (run: ThinkExecutionRun) => void;
12
17
  }
13
18
  /**
14
19
  * Unified execution history for native Think submissions and Agents workflows.
@@ -18,8 +23,10 @@ interface ThinkExecutionWorkbenchProps extends Omit<React.HTMLAttributes<HTMLDiv
18
23
  declare function ThinkExecutionWorkbench({
19
24
  backButton,
20
25
  className,
26
+ onSelectedRunChange,
21
27
  pageSize,
22
28
  ref,
29
+ selectedRun: controlledSelectedRun,
23
30
  source,
24
31
  title,
25
32
  ...props