@mcp-b/react-components 0.42.0 → 0.44.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.
Files changed (134) hide show
  1. package/dist/{AgentChat-DVr2giwD.d.ts → AgentChat-Bibfj7u1.d.ts} +1 -1
  2. package/dist/{AgentChatStartScreen-CO49yepa.d.ts → AgentChatStartScreen-Bkv7Avni.d.ts} +6 -0
  3. package/dist/{CodeBlock-BjELA-_s.js → CodeBlock-Dl7a3Wqo.js} +1 -1
  4. package/dist/{FileTree-DMYRdT6R.js → FileTree-Uu3ZnW1u.js} +1 -1
  5. package/dist/McpPluginCatalog-mbGw8FTu.d.ts +92 -0
  6. package/dist/ResponsiveSidebarShell-DOXd5T-d.d.ts +111 -0
  7. package/dist/SetupChecklist-DOp-zqjh.js +77 -0
  8. package/dist/{ThinkChatActivity-CsDql-ER.d.ts → ThinkChatActivity-CgvmTXXB.d.ts} +1 -1
  9. package/dist/Workspace-F3raHdYV.d.ts +140 -0
  10. package/dist/{WorkspaceFileView-DwdXiKku.js → WorkspaceFileView-BublZXky.js} +2 -3
  11. package/dist/components/agents-sdk/AgentActivity.js +1 -1
  12. package/dist/components/agents-sdk/AgentChat.d.ts +1 -1
  13. package/dist/components/agents-sdk/AgentChat.js +10 -10
  14. package/dist/components/agents-sdk/BrowserLiveScreen.js +4 -1
  15. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  16. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  17. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
  18. package/dist/components/agents-sdk/ManagerOffice.js +4 -4
  19. package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
  20. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  21. package/dist/components/agents-sdk/McpPluginCatalog.d.ts +1 -91
  22. package/dist/components/agents-sdk/McpPluginCatalog.js +3 -3
  23. package/dist/components/agents-sdk/McpServerPicker.js +2 -2
  24. package/dist/components/agents-sdk/ModelSelector.js +3 -3
  25. package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
  26. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  27. package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
  28. package/dist/components/agents-sdk/SubagentRunSelector.js +1 -1
  29. package/dist/components/agents-sdk/ThinkChat.d.ts +2 -2
  30. package/dist/components/agents-sdk/ThinkChat.js +1 -1
  31. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  32. package/dist/components/agents-sdk/ThinkChatActivity.js +3 -3
  33. package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -2
  34. package/dist/components/agents-sdk/ThinkExecutionDetail.js +3 -3
  35. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  36. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
  37. package/dist/components/agents-sdk/ThinkFullApp.d.ts +20 -6
  38. package/dist/components/agents-sdk/ThinkFullApp.js +7 -6
  39. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +1 -1
  40. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +3 -2
  41. package/dist/components/agents-sdk/ThinkRoutine.d.ts +1 -7
  42. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
  43. package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
  44. package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +34 -18
  45. package/dist/components/agents-sdk/ThinkRoutineForm.js +395 -110
  46. package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +5 -4
  47. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +19 -33
  48. package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
  49. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +173 -0
  50. package/dist/components/agents-sdk/ThinkSidepanel.js +711 -0
  51. package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +4 -5
  52. package/dist/components/agents-sdk/ThinkThreadPicker.js +9 -9
  53. package/dist/components/agents-sdk/Workspace.d.ts +1 -139
  54. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  55. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  56. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +1 -1
  57. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
  58. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  59. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  60. package/dist/components/agents-sdk/WorkspaceMountManager.js +2 -2
  61. package/dist/components/ai-sdk/Activity.js +1 -1
  62. package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +1 -1
  63. package/dist/components/ai-sdk/AgentChatStartScreen.js +6 -3
  64. package/dist/components/ai-sdk/Approval.js +2 -2
  65. package/dist/components/ai-sdk/Artifact.js +1 -1
  66. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  67. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  68. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  69. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  70. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +106 -0
  71. package/dist/components/ai-sdk/ConnectedAppCards.js +416 -0
  72. package/dist/components/ai-sdk/Conversation.js +1 -1
  73. package/dist/components/ai-sdk/Goal.js +1 -1
  74. package/dist/components/ai-sdk/InlineCitation.js +1 -1
  75. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  76. package/dist/components/ai-sdk/Message.js +1 -1
  77. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  78. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  79. package/dist/components/ai-sdk/Plan.js +1 -1
  80. package/dist/components/ai-sdk/PromptInput.js +3 -3
  81. package/dist/components/ai-sdk/Queue.js +2 -2
  82. package/dist/components/ai-sdk/Reasoning.js +2 -2
  83. package/dist/components/ai-sdk/Sources.js +1 -1
  84. package/dist/components/ai-sdk/Task.js +1 -1
  85. package/dist/components/ai-sdk/ToolInvocation.js +1 -1
  86. package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -3
  87. package/dist/components/extension/ChatGptSignInScreen.js +7 -20
  88. package/dist/components/extension/CodexModelSelector.js +2 -2
  89. package/dist/components/extension/ConversationTabPicker.js +2 -2
  90. package/dist/components/foundations/Checkbox.js +1 -1
  91. package/dist/components/foundations/Collapsible.js +1 -1
  92. package/dist/components/foundations/ContextMenu.js +1 -1
  93. package/dist/components/foundations/DescriptionList.d.ts +3 -0
  94. package/dist/components/foundations/DescriptionList.js +2 -1
  95. package/dist/components/foundations/Menubar.js +1 -1
  96. package/dist/components/foundations/SearchField.js +1 -1
  97. package/dist/components/foundations/Select.js +1 -1
  98. package/dist/components/foundations/Stepper.js +1 -1
  99. package/dist/components/foundations/Toast.js +1 -1
  100. package/dist/components/foundations/ToggleGroup.d.ts +1 -1
  101. package/dist/components/foundations/ToggleGroup.js +1 -1
  102. package/dist/components/foundations/icons.d.ts +2 -2
  103. package/dist/components/foundations/icons.js +2 -2
  104. package/dist/components/general-purpose/Commit.js +2 -2
  105. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  106. package/dist/components/general-purpose/FileTree.js +1 -1
  107. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  108. package/dist/components/general-purpose/PricingPlanCard.js +1 -1
  109. package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
  110. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -104
  111. package/dist/components/general-purpose/ResponsiveSidebarShell.js +3 -3
  112. package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
  113. package/dist/components/general-purpose/SetupChecklist.js +1 -76
  114. package/dist/components/general-purpose/Terminal.js +2 -2
  115. package/dist/components/general-purpose/TestResults.js +1 -1
  116. package/dist/components/general-purpose/ThemeModeControl.js +2 -2
  117. package/dist/components/general-purpose/WebPreview.js +2 -2
  118. package/dist/components/nanites/AgentConnection.js +2 -2
  119. package/dist/components/nanites/AgentToolDetail.js +4 -4
  120. package/dist/{copy-button-lys9N_aI.js → copy-button-DHhf-J1d.js} +1 -1
  121. package/dist/{icons-0corjfxR.d.ts → icons-6ZnyZJiR.d.ts} +6 -1
  122. package/dist/{icons-CVFSeTJn.js → icons-Dw-im7lg.js} +4 -3
  123. package/dist/styles/agent-chat.css +20 -15
  124. package/dist/styles/browser-live-screen.css +3 -0
  125. package/dist/styles/button.css +1 -5
  126. package/dist/styles/chatgpt-sign-in-screen.css +87 -43
  127. package/dist/styles/connected-app-card.css +54 -0
  128. package/dist/styles/description-list.css +25 -0
  129. package/dist/styles/index.css +2 -0
  130. package/dist/styles/responsive-sidebar-shell.css +12 -9
  131. package/dist/styles/think-routine-library.css +28 -0
  132. package/dist/styles/think-sidepanel.css +74 -0
  133. package/package.json +2 -2
  134. package/dist/{ThinkChat-DkA4Wr71.js → ThinkChat-BES_3Mb-.js} +1 -1
@@ -0,0 +1,711 @@
1
+ import { t as cx } from "../../class-names-BiMDVpUo.js";
2
+ import { A as McpIcon, C as FolderIcon, H as QueueIcon, J as SquareIcon, K as SlackIcon, L as PaperclipIcon, Q as TerminalIcon, S as FileIcon, T as InfoIcon, b as EyeIcon, c as BoxIcon, et as WarningIcon, g as DiscordIcon, o as ArrowUpRightIcon, q as SpinnerIcon, r as ArrowLeftIcon, y as EllipsisIcon, z as PencilIcon } from "../../icons-Dw-im7lg.js";
3
+ import { Button } from "../foundations/Button.js";
4
+ import { Tooltip } from "../foundations/Tooltip.js";
5
+ import { Dialog } from "../foundations/Dialog.js";
6
+ import { EmptyState } from "../foundations/EmptyState.js";
7
+ import { Menu } from "../foundations/Menu.js";
8
+ import { Avatar } from "../foundations/Avatar.js";
9
+ import { AppIcon } from "../foundations/AppIcon.js";
10
+ import "../foundations/icons.js";
11
+ import { AppTopBar } from "../general-purpose/AppTopBar.js";
12
+ import { DescriptionList } from "../foundations/DescriptionList.js";
13
+ import { McpServerPickerAction, McpServerPickerItems } from "./McpServerPicker.js";
14
+ import { NaniteMark } from "../nanites/NaniteScene.js";
15
+ import { getThinkExecutionRunId } from "./ThinkExecutionRun.js";
16
+ import { ThinkThreadPicker, summarizeThinkThreads } from "./ThinkThreadPicker.js";
17
+ import { ThinkFullApp } from "./ThinkFullApp.js";
18
+ import { Switch } from "../foundations/Switch.js";
19
+ import { ThinkRoutineLibrary } from "./ThinkRoutineLibrary.js";
20
+ import { ActionGuide } from "../general-purpose/ActionGuide.js";
21
+ import { t as SetupChecklistAction } from "../../SetupChecklist-DOp-zqjh.js";
22
+ import { useTheme } from "../foundations/ThemeProvider.js";
23
+ import { ChatGptSignInScreen } from "../extension/ChatGptSignInScreen.js";
24
+ import * as React from "react";
25
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
26
+ //#region src/components/agents-sdk/ThinkSidepanel.tsx
27
+ const EMPTY_THREADS = [];
28
+ function AppearanceMenu() {
29
+ const { preference, setPreference } = useTheme();
30
+ return /* @__PURE__ */ jsxs(Menu.RadioGroup, {
31
+ value: preference,
32
+ onValueChange: (value) => {
33
+ if (value === "light" || value === "dark" || value === "system") setPreference(value);
34
+ },
35
+ children: [
36
+ /* @__PURE__ */ jsxs(Menu.RadioItem, {
37
+ value: "light",
38
+ children: [/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {}), "Light"]
39
+ }),
40
+ /* @__PURE__ */ jsxs(Menu.RadioItem, {
41
+ value: "dark",
42
+ children: [/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {}), "Dark"]
43
+ }),
44
+ /* @__PURE__ */ jsxs(Menu.RadioItem, {
45
+ value: "system",
46
+ children: [/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {}), "System"]
47
+ })
48
+ ]
49
+ });
50
+ }
51
+ function MenuGroupLabel({ hint, label }) {
52
+ return /* @__PURE__ */ jsxs(Menu.GroupLabel, {
53
+ className: "think-sidepanel__menu-group-label",
54
+ children: [label, /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, {
55
+ render: /* @__PURE__ */ jsx("span", { className: "think-sidepanel__menu-hint" }),
56
+ children: /* @__PURE__ */ jsx(InfoIcon, {})
57
+ }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, { children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: hint }) }) })] })]
58
+ });
59
+ }
60
+ /** Keep in lockstep with --sigvelo-layout-break-compact / the 56rem @container. */
61
+ function compactBreakPx(el) {
62
+ const raw = getComputedStyle(el).getPropertyValue("--sigvelo-layout-break-compact").trim();
63
+ if (raw.endsWith("rem")) return Number.parseFloat(raw) * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
64
+ const px = Number.parseFloat(raw);
65
+ return Number.isFinite(px) ? px : 896;
66
+ }
67
+ function useCompactApp() {
68
+ const ref = React.useRef(null);
69
+ const [compact, setCompact] = React.useState(true);
70
+ React.useLayoutEffect(() => {
71
+ const el = ref.current;
72
+ if (!el) return;
73
+ const sync = () => {
74
+ const next = el.getBoundingClientRect().width <= compactBreakPx(el);
75
+ setCompact((current) => current === next ? current : next);
76
+ };
77
+ sync();
78
+ if (typeof ResizeObserver === "undefined") return;
79
+ const observer = new ResizeObserver(sync);
80
+ observer.observe(el);
81
+ return () => observer.disconnect();
82
+ }, []);
83
+ return [ref, compact];
84
+ }
85
+ function WorkspaceLinks({ renderLink, view }) {
86
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AppTopBar.Link, {
87
+ label: "Files",
88
+ "aria-current": view === "files" ? "page" : void 0,
89
+ "data-pressed": view === "files" ? "" : void 0,
90
+ render: renderLink({
91
+ kind: "view",
92
+ view: "files"
93
+ }),
94
+ children: /* @__PURE__ */ jsx(FileIcon, {})
95
+ }), /* @__PURE__ */ jsx(AppTopBar.Link, {
96
+ label: "Plugins",
97
+ "aria-current": view === "plugins" ? "page" : void 0,
98
+ "data-pressed": view === "plugins" ? "" : void 0,
99
+ render: renderLink({
100
+ kind: "view",
101
+ view: "plugins"
102
+ }),
103
+ children: /* @__PURE__ */ jsx(BoxIcon, {})
104
+ })] });
105
+ }
106
+ function OverflowMenu({ companion, follow, identityEmail, onIdentity, onModel, onSignOut, passkeyVault, renderLink, workbenchInMenu }) {
107
+ return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
108
+ label: "More actions",
109
+ tooltip: identityEmail ? `Signed in as ${identityEmail}` : void 0,
110
+ render: /* @__PURE__ */ jsx(Menu.Trigger, {}),
111
+ children: identityEmail ? /* @__PURE__ */ jsx(Avatar.Root, {
112
+ size: "sm",
113
+ children: /* @__PURE__ */ jsx(Avatar.Fallback, { children: identityEmail[0]?.toUpperCase() })
114
+ }) : /* @__PURE__ */ jsx(EllipsisIcon, {})
115
+ }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
116
+ side: "bottom",
117
+ align: "end",
118
+ sideOffset: 4,
119
+ children: /* @__PURE__ */ jsxs(Menu.Popup, { children: [
120
+ workbenchInMenu ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Menu.Item, {
121
+ render: renderLink({
122
+ kind: "view",
123
+ view: "files"
124
+ }),
125
+ children: [/* @__PURE__ */ jsx(FileIcon, {}), "Files"]
126
+ }), /* @__PURE__ */ jsxs(Menu.Item, {
127
+ render: renderLink({
128
+ kind: "view",
129
+ view: "plugins"
130
+ }),
131
+ children: [/* @__PURE__ */ jsx(BoxIcon, {}), "Plugins"]
132
+ })] }) : null,
133
+ /* @__PURE__ */ jsxs(Menu.Item, {
134
+ render: renderLink({
135
+ kind: "view",
136
+ view: "schedules"
137
+ }),
138
+ children: [/* @__PURE__ */ jsx(QueueIcon, {}), "Routines"]
139
+ }),
140
+ follow ? /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
141
+ checked: follow.followed,
142
+ onCheckedChange: follow.onCheckedChange,
143
+ children: [/* @__PURE__ */ jsx(EyeIcon, {}), "Follow this conversation"]
144
+ }) : null,
145
+ onIdentity ? /* @__PURE__ */ jsxs(Menu.Item, {
146
+ onClick: onIdentity,
147
+ children: [/* @__PURE__ */ jsx(InfoIcon, {}), "Identity"]
148
+ }) : null,
149
+ onModel ? /* @__PURE__ */ jsxs(Menu.Item, {
150
+ onClick: onModel,
151
+ children: [/* @__PURE__ */ jsx(TerminalIcon, {}), "Model"]
152
+ }) : null,
153
+ companion ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsxs(Menu.Group, { children: [
154
+ /* @__PURE__ */ jsx(MenuGroupLabel, {
155
+ label: "Companion app",
156
+ hint: "Connecting lets this employee chat with the browser and watch it work from anywhere."
157
+ }),
158
+ /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
159
+ className: "think-sidepanel__menu-switch-item",
160
+ checked: companion.enabled,
161
+ onCheckedChange: companion.setEnabled,
162
+ children: ["Connect this browser", /* @__PURE__ */ jsx(Switch.Root, {
163
+ "aria-hidden": true,
164
+ readOnly: true,
165
+ size: "sm",
166
+ checked: companion.enabled,
167
+ children: /* @__PURE__ */ jsx(Switch.Thumb, {})
168
+ })]
169
+ }),
170
+ /* @__PURE__ */ jsxs(Menu.Item, {
171
+ render: /* @__PURE__ */ jsx("a", {
172
+ href: companion.origin,
173
+ target: "_blank",
174
+ rel: "noreferrer",
175
+ "aria-label": companion.origin.replace(/^https?:\/\//, "")
176
+ }),
177
+ children: [/* @__PURE__ */ jsx(ArrowUpRightIcon, {}), companion.origin.replace(/^https?:\/\//, "")]
178
+ })
179
+ ] })] }) : null,
180
+ passkeyVault ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsx(MenuGroupLabel, {
181
+ label: "Passkeys",
182
+ hint: "The employee saves and uses its own passkeys instead of the browser's."
183
+ }), /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
184
+ className: "think-sidepanel__menu-switch-item",
185
+ checked: passkeyVault.enabled,
186
+ onCheckedChange: passkeyVault.setEnabled,
187
+ children: ["Use its own passkeys", /* @__PURE__ */ jsx(Switch.Root, {
188
+ "aria-hidden": true,
189
+ readOnly: true,
190
+ size: "sm",
191
+ checked: passkeyVault.enabled,
192
+ children: /* @__PURE__ */ jsx(Switch.Thumb, {})
193
+ })]
194
+ })] })] }) : null,
195
+ /* @__PURE__ */ jsx(Menu.Separator, {}),
196
+ /* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsx(Menu.GroupLabel, { children: "Appearance" }), /* @__PURE__ */ jsx(AppearanceMenu, {})] }),
197
+ onSignOut ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsxs(Menu.Item, {
198
+ onClick: onSignOut,
199
+ children: [/* @__PURE__ */ jsx(ArrowUpRightIcon, {}), "Sign out"]
200
+ })] }) : null
201
+ ] })
202
+ }) })] });
203
+ }
204
+ function GateScreen({ brand, connectingLabel, identity, modelSetup, status }) {
205
+ if (status === "connecting") return /* @__PURE__ */ jsx("div", {
206
+ className: "think-sidepanel__gate",
207
+ role: "status",
208
+ children: /* @__PURE__ */ jsx(EmptyState, {
209
+ icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
210
+ description: connectingLabel ?? "Connecting…"
211
+ })
212
+ });
213
+ if (status === "offline") return /* @__PURE__ */ jsx("main", {
214
+ className: "think-sidepanel__gate",
215
+ role: "status",
216
+ children: /* @__PURE__ */ jsx(EmptyState, {
217
+ icon: /* @__PURE__ */ jsx(WarningIcon, {}),
218
+ title: `${brand.name} is offline`,
219
+ description: "Open the browser and turn the companion connection on. This screen reconnects on its own."
220
+ })
221
+ });
222
+ if (status === "identity-blocked" && identity) return /* @__PURE__ */ jsxs("div", {
223
+ className: "think-sidepanel__gate",
224
+ role: "alert",
225
+ children: [/* @__PURE__ */ jsx(EmptyState, {
226
+ icon: /* @__PURE__ */ jsx(WarningIcon, {}),
227
+ title: "Wrong browser profile",
228
+ description: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", { children: [
229
+ "This installation is assigned to ",
230
+ /* @__PURE__ */ jsx("strong", { children: identity.assignedAccount }),
231
+ ", but the live profile is ",
232
+ /* @__PURE__ */ jsx("strong", { children: identity.liveProfile }),
233
+ "."
234
+ ] }), /* @__PURE__ */ jsx("p", { children: identity.managed ? "Open the assigned profile. Organization policy controls this assignment." : "Open the assigned profile, or remove the binding." })] })
235
+ }), identity.managed || !identity.onUnbind ? null : /* @__PURE__ */ jsx(Button, {
236
+ type: "button",
237
+ variant: "ghost",
238
+ color: "destructive",
239
+ onClick: identity.onUnbind,
240
+ children: "Remove binding"
241
+ })]
242
+ });
243
+ if (status === "needs-model") return /* @__PURE__ */ jsx(ChatGptSignInScreen, {
244
+ busy: modelSetup?.busy,
245
+ error: modelSetup?.error,
246
+ label: modelSetup?.label,
247
+ title: `Meet ${brand.name}`,
248
+ brandName: "SigVelo",
249
+ brandLogo: brand.logo,
250
+ onSignIn: modelSetup?.onSignIn,
251
+ secondaryAction: modelSetup?.onCustomEndpoint ? {
252
+ label: "Set up a custom model endpoint",
253
+ onSelect: modelSetup.onCustomEndpoint
254
+ } : void 0
255
+ });
256
+ return null;
257
+ }
258
+ function IdentityDialog({ identity, onOpenChange, open }) {
259
+ return /* @__PURE__ */ jsx(Dialog.Root, {
260
+ open,
261
+ onOpenChange,
262
+ children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Viewport, { children: /* @__PURE__ */ jsxs(Dialog.Popup, { children: [
263
+ /* @__PURE__ */ jsxs(Dialog.Header, { children: [/* @__PURE__ */ jsx(Dialog.Title, { children: "Operating identity" }), /* @__PURE__ */ jsx(Dialog.Description, { children: "This employee operates the live browser profile as its own identity. Assigning the account keeps it from signing in with another profile." })] }),
264
+ /* @__PURE__ */ jsxs(DescriptionList.Root, {
265
+ variant: "divided",
266
+ children: [/* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Live profile" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: identity.liveProfile })] }), /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Assigned account" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: identity.managed ? `${identity.assignedAccount} (managed by your organization)` : identity.assignedAccount })] })]
267
+ }),
268
+ /* @__PURE__ */ jsx(Dialog.Footer, { children: identity.managed ? /* @__PURE__ */ jsx("p", { children: "Organization policy controls this binding." }) : identity.onUnbind && identity.assignedAccount ? /* @__PURE__ */ jsx(Button, {
269
+ type: "button",
270
+ variant: "ghost",
271
+ color: "destructive",
272
+ onClick: () => {
273
+ Promise.resolve(identity.onUnbind?.()).then(() => onOpenChange(false));
274
+ },
275
+ children: "Remove binding"
276
+ }) : /* @__PURE__ */ jsx(Button, {
277
+ type: "button",
278
+ color: "primary",
279
+ disabled: !identity.canBind || !identity.onBind,
280
+ onClick: () => {
281
+ Promise.resolve(identity.onBind?.()).then(() => onOpenChange(false));
282
+ },
283
+ children: "Assign this profile"
284
+ }) })
285
+ ] }) })] })
286
+ });
287
+ }
288
+ function CapabilityGuide({ brandName, start }) {
289
+ const send = (text) => void start.onSubmit({
290
+ text,
291
+ files: []
292
+ });
293
+ return /* @__PURE__ */ jsx(ActionGuide, {
294
+ title: `${brandName} can work across your browser.`,
295
+ description: "They can act in signed-in tabs, keep workspace files, connect plugins, and run recurring work after this panel closes.",
296
+ sections: [
297
+ {
298
+ id: "quick-browser-job",
299
+ title: "Start with a quick browser job",
300
+ layout: "compact",
301
+ actions: [{
302
+ id: "organize-tabs",
303
+ icon: /* @__PURE__ */ jsx(BoxIcon, {}),
304
+ label: "Organize this window’s tabs by task"
305
+ }, {
306
+ id: "close-duplicate-tabs",
307
+ icon: /* @__PURE__ */ jsx(EyeIcon, {}),
308
+ label: "Close duplicate tabs in this window"
309
+ }]
310
+ },
311
+ {
312
+ id: "ongoing-work",
313
+ title: "Set up ongoing work",
314
+ layout: "cards",
315
+ actions: [
316
+ {
317
+ id: "create-routine",
318
+ icon: /* @__PURE__ */ jsx(QueueIcon, {}),
319
+ label: "Create a recurring task"
320
+ },
321
+ ...start.slack && !start.slack.configured ? [{
322
+ id: "connect-slack",
323
+ icon: /* @__PURE__ */ jsx(SlackIcon, {}),
324
+ label: "Connect Slack"
325
+ }] : [],
326
+ ...start.discord && !start.discord.configured ? [{
327
+ id: "connect-discord",
328
+ icon: /* @__PURE__ */ jsx(DiscordIcon, {}),
329
+ label: "Connect Discord"
330
+ }] : [],
331
+ ...start.onAttachFolder ? [{
332
+ id: "attach-local-folder",
333
+ icon: /* @__PURE__ */ jsx(FolderIcon, {}),
334
+ label: "Attach a local folder"
335
+ }] : [],
336
+ {
337
+ id: "connections",
338
+ icon: /* @__PURE__ */ jsx(McpIcon, {}),
339
+ label: start.hasConnectedApps ? "Use my connected apps" : "Connect another app"
340
+ }
341
+ ]
342
+ },
343
+ {
344
+ id: "larger-workflow",
345
+ title: "Build a larger workflow",
346
+ layout: "list",
347
+ actions: [
348
+ {
349
+ id: "automate-browser",
350
+ icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
351
+ label: "Automate work across signed-in tabs",
352
+ variant: "ghost"
353
+ },
354
+ {
355
+ id: "move-workspace-files",
356
+ icon: /* @__PURE__ */ jsx(FolderIcon, {}),
357
+ label: "Move files between a website and the workspace",
358
+ variant: "ghost"
359
+ },
360
+ {
361
+ id: "record-browser-workflow",
362
+ icon: /* @__PURE__ */ jsx(EyeIcon, {}),
363
+ label: "Record a browser workflow as an MP4",
364
+ variant: "ghost"
365
+ }
366
+ ]
367
+ }
368
+ ],
369
+ onAction: (action) => {
370
+ switch (action.id) {
371
+ case "organize-tabs": return send("Organize this window’s tabs by task.");
372
+ case "close-duplicate-tabs": return send("Close duplicate tabs in this window.");
373
+ case "create-routine": return send("Help me create a recurring task that runs on a schedule.");
374
+ case "connect-slack": return start.slack?.onSelect();
375
+ case "connect-discord": return start.discord?.onSelect();
376
+ case "connections": return send(start.hasConnectedApps ? "Show me useful work I can do across my connected apps." : "Help me connect another app I use.");
377
+ case "automate-browser": return send("Automate a workflow across my signed-in browser tabs.");
378
+ case "move-workspace-files": return send("Move files between a signed-in website and the workspace.");
379
+ case "record-browser-workflow": return send("Record a browser workflow as an MP4.");
380
+ case "attach-local-folder": return start.onAttachFolder?.();
381
+ }
382
+ }
383
+ });
384
+ }
385
+ function StartComposerTray({ plugins, renderLink, start }) {
386
+ const hasPluginMenu = Boolean(plugins || start.slack || start.discord);
387
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
388
+ start.personalization ? /* @__PURE__ */ jsx(SetupChecklistAction, {
389
+ actionLabel: "Prompts",
390
+ label: "Prompts",
391
+ entries: start.personalization.entries,
392
+ onSelect: start.personalization.onSelect
393
+ }) : null,
394
+ start.onAttachFolder ? /* @__PURE__ */ jsxs(Button, {
395
+ type: "button",
396
+ variant: "ghost",
397
+ color: "neutral",
398
+ size: "md",
399
+ disabled: start.attachFolderBusy,
400
+ onClick: start.onAttachFolder,
401
+ "aria-label": "Connect a local folder",
402
+ children: [/* @__PURE__ */ jsx(PaperclipIcon, {}), /* @__PURE__ */ jsx("span", { children: "Connect a local folder" })]
403
+ }) : null,
404
+ hasPluginMenu ? /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Button, {
405
+ type: "button",
406
+ variant: "ghost",
407
+ color: "neutral",
408
+ size: "md",
409
+ render: /* @__PURE__ */ jsx(Menu.Trigger, { unstyled: true }),
410
+ "aria-label": "Connect plugins",
411
+ children: [/* @__PURE__ */ jsx("span", { children: "Connect plugins" }), /* @__PURE__ */ jsxs(AppIcon.Stack, {
412
+ "aria-hidden": "true",
413
+ children: [/* @__PURE__ */ jsx(AppIcon.Root, {
414
+ size: "sm",
415
+ variant: "surface",
416
+ children: /* @__PURE__ */ jsx(SlackIcon, {})
417
+ }), /* @__PURE__ */ jsx(AppIcon.Root, {
418
+ size: "sm",
419
+ variant: "surface",
420
+ children: /* @__PURE__ */ jsx(DiscordIcon, {})
421
+ })]
422
+ })]
423
+ }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
424
+ side: "bottom",
425
+ align: "start",
426
+ sideOffset: 4,
427
+ children: /* @__PURE__ */ jsxs(Menu.Popup, {
428
+ "aria-label": "Plugins",
429
+ "data-recipe": "wide-scroll-picker",
430
+ children: [/* @__PURE__ */ jsx(McpServerPickerItems, {
431
+ actions: [...start.discord ? [{
432
+ id: "discord",
433
+ icon: /* @__PURE__ */ jsx(DiscordIcon, {}),
434
+ label: start.discord.configured ? "Discord" : "Connect Discord",
435
+ description: start.discord.description ?? (start.discord.configured ? "Connected" : "Talk to this employee from Discord"),
436
+ onSelect: start.discord.onSelect
437
+ }] : [], ...start.slack ? [{
438
+ id: "slack",
439
+ icon: /* @__PURE__ */ jsx(SlackIcon, {}),
440
+ label: start.slack.configured ? "Slack" : "Connect Slack",
441
+ description: start.slack.description ?? (start.slack.configured ? "Connected" : "Talk to this employee from Slack"),
442
+ onSelect: start.slack.onSelect
443
+ }] : []],
444
+ servers: plugins?.servers ?? [],
445
+ mcp: plugins?.mcp,
446
+ onConnect: plugins?.onConnect,
447
+ onDisconnect: plugins?.onDisconnect
448
+ }), /* @__PURE__ */ jsx(McpServerPickerAction, {
449
+ icon: /* @__PURE__ */ jsx(BoxIcon, {}),
450
+ label: "Browse plugins",
451
+ description: plugins?.onConnect ? "Find and connect supported tools" : "See what this browser is connected to",
452
+ render: renderLink({
453
+ kind: "view",
454
+ view: "plugins"
455
+ })
456
+ })]
457
+ })
458
+ }) })] }) : null
459
+ ] });
460
+ }
461
+ function startStarters(brandName, start, onShowGuide) {
462
+ return {
463
+ "aria-label": "Suggested prompts",
464
+ items: [
465
+ {
466
+ id: "capability-guide",
467
+ label: `See what ${brandName} can do`,
468
+ icon: /* @__PURE__ */ jsx(InfoIcon, {}),
469
+ muted: true
470
+ },
471
+ ...start.suggestionsError ? [{
472
+ id: "retry-suggestions",
473
+ label: "Try generating suggestions again",
474
+ icon: /* @__PURE__ */ jsx(InfoIcon, {}),
475
+ muted: true
476
+ }] : [],
477
+ ...start.suggestions?.map((suggestion, index) => ({
478
+ id: `suggestion:${index}:${suggestion.value}:${suggestion.label}`,
479
+ label: suggestion.label,
480
+ icon: suggestion.value.startsWith("/") ? /* @__PURE__ */ jsx(BoxIcon, {}) : suggestion.value.startsWith("@") ? /* @__PURE__ */ jsx(McpIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
481
+ })) ?? []
482
+ ],
483
+ onSelect: (item) => {
484
+ if (item.id === "capability-guide") {
485
+ onShowGuide();
486
+ return;
487
+ }
488
+ if (item.id === "retry-suggestions") {
489
+ start.onRetrySuggestions?.();
490
+ return;
491
+ }
492
+ const suggestion = start.suggestions?.find((candidate, index) => item.id === `suggestion:${index}:${candidate.value}:${candidate.label}`);
493
+ if (suggestion) start.onSubmit({
494
+ text: suggestion.value,
495
+ files: []
496
+ });
497
+ }
498
+ };
499
+ }
500
+ function BackToChat({ renderLink }) {
501
+ return /* @__PURE__ */ jsx(AppTopBar.Link, {
502
+ label: "Back to chat",
503
+ render: renderLink({
504
+ kind: "view",
505
+ view: "chat"
506
+ }),
507
+ children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
508
+ });
509
+ }
510
+ function employeeMessages({ agentRun, brandName, guideOpen, hasConversation, hostMessages, onShowGuide, plugins, renderLink, start }) {
511
+ const onSubmit = hostMessages?.draft?.onSubmit ?? start?.onSubmit;
512
+ const draft = hasConversation ? hostMessages?.draft : onSubmit ? {
513
+ messages: hostMessages?.draft?.messages ?? [],
514
+ onSubmit,
515
+ status: hostMessages?.draft?.status
516
+ } : hostMessages?.draft;
517
+ return {
518
+ placeholder: "How can I help you today?",
519
+ approvalsEnabled: false,
520
+ ...hostMessages,
521
+ startScreen: start ? {
522
+ lead: guideOpen ? /* @__PURE__ */ jsx(CapabilityGuide, {
523
+ brandName,
524
+ start
525
+ }) : void 0,
526
+ composerTray: /* @__PURE__ */ jsx(StartComposerTray, {
527
+ plugins,
528
+ renderLink,
529
+ start
530
+ }),
531
+ starters: guideOpen ? void 0 : startStarters(brandName, start, onShowGuide)
532
+ } : hostMessages?.startScreen,
533
+ draft,
534
+ showComposer: agentRun ? false : hostMessages?.showComposer
535
+ };
536
+ }
537
+ /**
538
+ * The employee side panel: icon-and-tooltip chrome, start screen, schedules,
539
+ * conversation plus workbench. Hosts hydrate conversation, workspace,
540
+ * plugins, and callables. Storybook is the place to iterate the chrome.
541
+ */
542
+ function ThinkSidepanel({ agentRun, appBarLeading, brand, className, companion, connectingLabel, conversation, follow, identity, live, messages, modelSetup, onDeleteThread, onModel, onSignOut, passkeyVault, plugins, renderLink, schedules, sourceKey, start, status = "ready", thread, threads = EMPTY_THREADS, view, workspace, ...props }) {
543
+ const [identityOpen, setIdentityOpen] = React.useState(false);
544
+ const [guideOpen, setGuideOpen] = React.useState(false);
545
+ const [rootRef, compact] = useCompactApp();
546
+ if (status !== "ready") return /* @__PURE__ */ jsx("div", {
547
+ ref: rootRef,
548
+ className: cx("think-sidepanel", className),
549
+ "data-status": status,
550
+ ...props,
551
+ children: /* @__PURE__ */ jsx(GateScreen, {
552
+ brand,
553
+ connectingLabel,
554
+ identity,
555
+ modelSetup,
556
+ status
557
+ })
558
+ });
559
+ const overflow = /* @__PURE__ */ jsx(OverflowMenu, {
560
+ companion,
561
+ follow: thread && !agentRun ? follow : void 0,
562
+ identityEmail: identity?.email,
563
+ onIdentity: identity ? () => setIdentityOpen(true) : void 0,
564
+ onModel,
565
+ onSignOut,
566
+ passkeyVault,
567
+ renderLink,
568
+ workbenchInMenu: compact
569
+ });
570
+ const workspaceLinks = compact || agentRun ? void 0 : /* @__PURE__ */ jsx(WorkspaceLinks, {
571
+ renderLink,
572
+ view
573
+ });
574
+ const identityDialog = identity ? /* @__PURE__ */ jsx(IdentityDialog, {
575
+ identity,
576
+ open: identityOpen,
577
+ onOpenChange: setIdentityOpen
578
+ }) : null;
579
+ const newThread = thread && !agentRun ? /* @__PURE__ */ jsx(AppTopBar.Link, {
580
+ label: "New thread",
581
+ render: renderLink({ kind: "new-thread" }),
582
+ children: /* @__PURE__ */ jsx(PencilIcon, {})
583
+ }) : void 0;
584
+ const workbenchLeading = view === "files" || view === "plugins" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BackToChat, { renderLink }), appBarLeading] }) : newThread || view === "chat" && appBarLeading ? /* @__PURE__ */ jsxs(Fragment, { children: [newThread, view === "chat" ? appBarLeading : null] }) : void 0;
585
+ const chatMessages = employeeMessages({
586
+ agentRun,
587
+ brandName: brand.name,
588
+ guideOpen,
589
+ hasConversation: Boolean(conversation),
590
+ hostMessages: messages,
591
+ onShowGuide: () => setGuideOpen(true),
592
+ plugins,
593
+ renderLink,
594
+ start
595
+ });
596
+ if (view === "live") return /* @__PURE__ */ jsxs("div", {
597
+ ref: rootRef,
598
+ className: cx("think-sidepanel", className),
599
+ "data-view": "live",
600
+ ...props,
601
+ children: [/* @__PURE__ */ jsxs("div", {
602
+ className: "think-sidepanel__live",
603
+ children: [/* @__PURE__ */ jsxs(AppTopBar.Root, {
604
+ "aria-label": "Live view controls",
605
+ children: [/* @__PURE__ */ jsx(AppTopBar.Leading, { children: /* @__PURE__ */ jsx(BackToChat, { renderLink }) }), /* @__PURE__ */ jsx(AppTopBar.Title, { children: "Live view" })]
606
+ }), live]
607
+ }), identityDialog]
608
+ });
609
+ if (view === "schedules") return /* @__PURE__ */ jsxs("div", {
610
+ ref: rootRef,
611
+ className: cx("think-sidepanel", className),
612
+ "data-view": "schedules",
613
+ ...props,
614
+ children: [schedules?.editor ? /* @__PURE__ */ jsx("div", {
615
+ className: "think-sidepanel__editor",
616
+ children: schedules.editor
617
+ }) : schedules ? /* @__PURE__ */ jsx(ThinkRoutineLibrary, {
618
+ bar: {
619
+ leading: /* @__PURE__ */ jsx(BackToChat, { renderLink }),
620
+ actions: workspaceLinks,
621
+ primary: overflow
622
+ },
623
+ routines: schedules.routines,
624
+ showOwner: false,
625
+ selectedRoutineId: schedules.selectedRoutineId,
626
+ error: schedules.error,
627
+ renderRoutineLink: (routine) => renderLink({
628
+ kind: "routine",
629
+ routineId: routine.id
630
+ }),
631
+ createRoutineLink: renderLink({ kind: "create-routine" }),
632
+ renderEditRoutineLink: (routine) => renderLink({
633
+ kind: "edit-routine",
634
+ routineId: routine.id
635
+ }),
636
+ renderRunLink: (routine, run) => renderLink({
637
+ kind: "routine-run",
638
+ routineId: routine.id,
639
+ runId: getThinkExecutionRunId(run)
640
+ }),
641
+ onRunRoutine: schedules.onRunRoutine,
642
+ onRoutineEnabledChange: schedules.onRoutineEnabledChange,
643
+ onDeleteRoutine: schedules.onDeleteRoutine
644
+ }) : /* @__PURE__ */ jsx("div", {
645
+ className: "think-sidepanel__gate",
646
+ children: /* @__PURE__ */ jsx(EmptyState, {
647
+ title: "Schedules",
648
+ description: "No schedules to show."
649
+ })
650
+ }), identityDialog]
651
+ });
652
+ const workbenchView = view === "plugins" ? "plugins" : view === "files" ? "files" : "chat";
653
+ return /* @__PURE__ */ jsxs("div", {
654
+ ref: rootRef,
655
+ className: cx("think-sidepanel", className),
656
+ "data-view": view,
657
+ ...props,
658
+ children: [/* @__PURE__ */ jsx(ThinkFullApp, {
659
+ conversation,
660
+ renderAgentToolRunLink: (run) => renderLink({
661
+ kind: "agent-run",
662
+ runId: run.runId
663
+ }),
664
+ bar: {
665
+ title: agentRun ? /* @__PURE__ */ jsxs("span", {
666
+ className: "think-sidepanel__run-title",
667
+ children: [/* @__PURE__ */ jsx(NaniteMark, {}), /* @__PURE__ */ jsx("span", {
668
+ className: "sigvelo-truncate",
669
+ children: agentRun.title
670
+ })]
671
+ }) : thread?.title ?? "New chat",
672
+ leading: agentRun ? /* @__PURE__ */ jsx(AppTopBar.Link, {
673
+ label: "Back to parent conversation",
674
+ render: thread ? renderLink({
675
+ kind: "thread",
676
+ threadId: thread.id
677
+ }) : renderLink({
678
+ kind: "view",
679
+ view: "chat"
680
+ }),
681
+ children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
682
+ }) : workbenchLeading,
683
+ actions: agentRun?.running && agentRun.onCancel ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
684
+ label: "Cancel run",
685
+ onClick: agentRun.onCancel,
686
+ children: /* @__PURE__ */ jsx(SquareIcon, {})
687
+ }), workspaceLinks] }) : workspaceLinks,
688
+ primary: overflow,
689
+ views: null
690
+ },
691
+ threadStatusSummary: agentRun ? void 0 : summarizeThinkThreads(threads),
692
+ sourceKey,
693
+ workspace: agentRun ? void 0 : workspace,
694
+ plugins: agentRun ? void 0 : plugins,
695
+ view: workbenchView,
696
+ threadSidebar: agentRun ? void 0 : ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ThinkThreadPicker, {
697
+ threads,
698
+ renderThreadLink: (item) => renderLink({
699
+ kind: "thread",
700
+ threadId: item.id
701
+ }),
702
+ createThreadLink: renderLink({ kind: "new-thread" }),
703
+ onSelect: closeSidebarOnCompact,
704
+ onDelete: onDeleteThread
705
+ }),
706
+ messages: chatMessages
707
+ }), identityDialog]
708
+ });
709
+ }
710
+ //#endregion
711
+ export { ThinkSidepanel };