@mcp-b/react-components 0.34.0 → 0.35.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 (65) hide show
  1. package/dist/{AgentChat-CV-GuYA6.d.ts → AgentChat-mpacmRU1.d.ts} +21 -2
  2. package/dist/{ModelSelector-DzdEs2fX.js → ModelSelector-DtBxWqRn.js} +1 -1
  3. package/dist/{ThinkChat-en0UbkVv.js → ThinkChat-DbzqSTBt.js} +14 -5
  4. package/dist/{ThinkChatActivity-CgqpROz_.d.ts → ThinkChatActivity-BZyN5MBg.d.ts} +1 -1
  5. package/dist/{Workspace-EhvvlHOB.d.ts → Workspace-GTlqvcIn.d.ts} +1 -1
  6. package/dist/{WorkspaceExplorer-DygQnEyi.d.ts → WorkspaceExplorer-Cu044amt.d.ts} +1 -1
  7. package/dist/{WorkspaceFile-C8Riev9j.d.ts → WorkspaceFile-CVAzjTt6.d.ts} +17 -1
  8. package/dist/{WorkspaceFileView-BtzVKAed.js → WorkspaceFileView-BmxSbhRu.js} +2 -2
  9. package/dist/components/agents-sdk/AgentChat.d.ts +2 -2
  10. package/dist/components/agents-sdk/AgentChat.js +20 -5
  11. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  12. package/dist/components/agents-sdk/McpConnectionRequest.js +1 -1
  13. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  14. package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
  15. package/dist/components/agents-sdk/McpServerPicker.js +1 -1
  16. package/dist/components/agents-sdk/ModelSelector.js +1 -1
  17. package/dist/components/agents-sdk/SubagentRunDetails.js +1 -1
  18. package/dist/components/agents-sdk/ThinkChat.d.ts +18 -5
  19. package/dist/components/agents-sdk/ThinkChat.js +1 -1
  20. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  21. package/dist/components/agents-sdk/ThinkChatActivitySummary.js +1 -1
  22. package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -7
  23. package/dist/components/agents-sdk/ThinkExecutionDetail.js +5 -3
  24. package/dist/components/agents-sdk/ThinkExecutionRun.js +1 -1
  25. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +1 -1
  26. package/dist/components/agents-sdk/ThinkFullApp.d.ts +2 -2
  27. package/dist/components/agents-sdk/ThinkFullApp.js +6 -4
  28. package/dist/components/agents-sdk/ThinkPendingApproval.js +3 -3
  29. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +5 -4
  30. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +10 -14
  31. package/dist/components/agents-sdk/ThinkThreadPicker.js +1 -1
  32. package/dist/components/agents-sdk/Workspace.d.ts +1 -1
  33. package/dist/components/agents-sdk/Workspace.js +1 -1
  34. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  35. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +3 -3
  36. package/dist/components/agents-sdk/WorkspaceExplorer.js +1 -1
  37. package/dist/components/agents-sdk/WorkspaceFile.d.ts +2 -2
  38. package/dist/components/agents-sdk/WorkspaceFile.js +41 -4
  39. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
  40. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  41. package/dist/components/ai-sdk/Approval.d.ts +1 -2
  42. package/dist/components/ai-sdk/Approval.js +4 -7
  43. package/dist/components/ai-sdk/Context.js +1 -1
  44. package/dist/components/ai-sdk/Goal.js +1 -1
  45. package/dist/components/ai-sdk/Message.js +1 -1
  46. package/dist/components/ai-sdk/Plan.js +1 -1
  47. package/dist/components/ai-sdk/PromptInput.js +1 -1
  48. package/dist/components/ai-sdk/ToolInvocation.js +2 -2
  49. package/dist/components/extension/ChatGptSignInScreen.js +1 -1
  50. package/dist/components/extension/CodexModelSelector.js +1 -1
  51. package/dist/components/extension/ConversationTabPicker.js +1 -1
  52. package/dist/components/foundations/EmptyState.d.ts +5 -2
  53. package/dist/components/foundations/EmptyState.js +11 -7
  54. package/dist/components/general-purpose/ResizableSidePanel.js +1 -1
  55. package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
  56. package/dist/components/general-purpose/SettingsFormDialog.js +1 -1
  57. package/dist/components/nanites/AgentToolDetail.d.ts +13 -3
  58. package/dist/components/nanites/AgentToolDetail.js +12 -3
  59. package/dist/{format-CmopcfqJ.js → format-DB2mX9DA.js} +16 -1
  60. package/dist/{progress-ring-Dz_ztrW2.js → progress-ring-BEocM1e3.js} +1 -1
  61. package/dist/styles/agent-chat.css +16 -0
  62. package/dist/styles/field.css +2 -2
  63. package/dist/styles/think-execution-workbench.css +9 -13
  64. package/dist/styles/think-routine-library.css +2 -30
  65. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
1
+ import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
2
2
  import { getWorkspaceBasename, inferWorkspaceMedia } from "./WorkspaceFile.js";
3
3
  import { n as isWorkspacePathWithinRoot, t as canonicalizeAbsoluteWorkspacePath } from "../../workspace-path-L_KmjRjq.js";
4
4
  import * as React from "react";
@@ -1,4 +1,4 @@
1
- import { o as WorkspaceState } from "../../Workspace-EhvvlHOB.js";
1
+ import { o as WorkspaceState } from "../../Workspace-GTlqvcIn.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/agents-sdk/WorkspaceBrowser.d.ts
@@ -1,5 +1,5 @@
1
1
  import { a as WorkspaceFileLinkProps, c as WorkspaceLinkResolution, d as WorkspaceNavigationProvider, f as WorkspaceNavigationProviderProps, i as WorkspaceFileLink, l as WorkspaceNavigationAdapter, n as WorkspaceDestination, o as WorkspaceInvalidDestination, p as resolveWorkspaceLink, r as WorkspaceExternalDestination, s as WorkspaceLinkBase, t as ResolveWorkspaceLinkOptions, u as WorkspaceNavigationEntry } from "../../WorkspaceLink-DQogVe8E.js";
2
- import { a as WorkspaceMediaInfo, c as WorkspaceMediaTrackKind, d as inferWorkspaceLanguage, f as inferWorkspaceMedia, g as parseWorkspaceSkill, h as isWorkspaceSkillPath, i as WorkspaceFileState, l as WorkspaceSkillDocument, m as isWorkspaceMediaPath, n as WorkspaceFileAssetRequest, o as WorkspaceMediaKind, p as isWorkspaceMarkdownPath, r as WorkspaceFileAssetResolver, s as WorkspaceMediaTrack, t as WorkspaceFileAsset } from "../../WorkspaceFile-C8Riev9j.js";
3
- import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceDirectoryQueryPrefix, f as workspaceFileAssetQueryOptions, g as workspaceTextFileQueryOptions, h as workspaceQueryKey, i as WorkspaceQueryKey, l as workspaceDirectoryQueryKey, m as workspaceInfoQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceFileStatQueryOptions, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceDirectoryQueryOptions } from "../../Workspace-EhvvlHOB.js";
4
- import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../../WorkspaceExplorer-DygQnEyi.js";
2
+ import { _ as parseWorkspaceSkill, a as WorkspaceMediaInfo, c as WorkspaceMediaTrackKind, d as inferWorkspaceLanguage, f as inferWorkspaceMedia, g as isWorkspaceSkillPath, h as isWorkspaceMediaPath, i as WorkspaceFileState, l as WorkspaceSkillDocument, m as isWorkspaceMarkdownPath, n as WorkspaceFileAssetRequest, o as WorkspaceMediaKind, r as WorkspaceFileAssetResolver, s as WorkspaceMediaTrack, t as WorkspaceFileAsset } from "../../WorkspaceFile-CVAzjTt6.js";
3
+ import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceDirectoryQueryPrefix, f as workspaceFileAssetQueryOptions, g as workspaceTextFileQueryOptions, h as workspaceQueryKey, i as WorkspaceQueryKey, l as workspaceDirectoryQueryKey, m as workspaceInfoQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceFileStatQueryOptions, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceDirectoryQueryOptions } from "../../Workspace-GTlqvcIn.js";
4
+ import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../../WorkspaceExplorer-Cu044amt.js";
5
5
  export { type ResolveWorkspaceLinkOptions, type UseWorkspaceOptions, type WorkspaceDestination, WorkspaceExplorer, WorkspaceExplorerProps, type WorkspaceExternalDestination, type WorkspaceFileAsset, type WorkspaceFileAssetRequest, type WorkspaceFileAssetResolver, WorkspaceFileLink, type WorkspaceFileLinkProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceInvalidDestination, type WorkspaceLinkBase, type WorkspaceLinkResolution, type WorkspaceMediaInfo, type WorkspaceMediaKind, type WorkspaceMediaTrack, type WorkspaceMediaTrackKind, type WorkspaceNavigationAdapter, type WorkspaceNavigationEntry, WorkspaceNavigationProvider, type WorkspaceNavigationProviderProps, type WorkspaceQueryKey, type WorkspaceSkillDocument, type WorkspaceSource, type WorkspaceState, inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill, resolveWorkspaceLink, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
@@ -3,7 +3,7 @@ import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
3
3
  import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./WorkspaceFile.js";
4
4
  import { a as WorkspaceNavigationRestorationBoundary, n as WorkspaceNavigationProvider, o as useRequiredWorkspaceNavigationRestoration, r as resolveWorkspaceLink, t as WorkspaceFileLink } from "../../WorkspaceLink-DZeLe_jN.js";
5
5
  import { WorkspaceBrowser } from "./WorkspaceBrowser.js";
6
- import { t as WorkspaceFileView } from "../../WorkspaceFileView-BtzVKAed.js";
6
+ import { t as WorkspaceFileView } from "../../WorkspaceFileView-BmxSbhRu.js";
7
7
  import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
8
8
  import * as React from "react";
9
9
  import { jsx } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- import { a as WorkspaceMediaInfo, c as WorkspaceMediaTrackKind, d as inferWorkspaceLanguage, f as inferWorkspaceMedia, g as parseWorkspaceSkill, h as isWorkspaceSkillPath, i as WorkspaceFileState, l as WorkspaceSkillDocument, m as isWorkspaceMediaPath, n as WorkspaceFileAssetRequest, o as WorkspaceMediaKind, p as isWorkspaceMarkdownPath, r as WorkspaceFileAssetResolver, s as WorkspaceMediaTrack, t as WorkspaceFileAsset, u as getWorkspaceBasename } from "../../WorkspaceFile-C8Riev9j.js";
2
- export { WorkspaceFileAsset, WorkspaceFileAssetRequest, WorkspaceFileAssetResolver, WorkspaceFileState, WorkspaceMediaInfo, WorkspaceMediaKind, WorkspaceMediaTrack, WorkspaceMediaTrackKind, WorkspaceSkillDocument, getWorkspaceBasename, inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill };
1
+ import { _ as parseWorkspaceSkill, a as WorkspaceMediaInfo, c as WorkspaceMediaTrackKind, d as inferWorkspaceLanguage, f as inferWorkspaceMedia, g as isWorkspaceSkillPath, h as isWorkspaceMediaPath, i as WorkspaceFileState, l as WorkspaceSkillDocument, m as isWorkspaceMarkdownPath, n as WorkspaceFileAssetRequest, o as WorkspaceMediaKind, p as inferWorkspaceMimeType, r as WorkspaceFileAssetResolver, s as WorkspaceMediaTrack, t as WorkspaceFileAsset, u as getWorkspaceBasename } from "../../WorkspaceFile-CVAzjTt6.js";
2
+ export { WorkspaceFileAsset, WorkspaceFileAssetRequest, WorkspaceFileAssetResolver, WorkspaceFileState, WorkspaceMediaInfo, WorkspaceMediaKind, WorkspaceMediaTrack, WorkspaceMediaTrackKind, WorkspaceSkillDocument, getWorkspaceBasename, inferWorkspaceLanguage, inferWorkspaceMedia, inferWorkspaceMimeType, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill };
@@ -108,6 +108,21 @@ const MEDIA_BY_EXTENSION = {
108
108
  mimeType: "video/x-m4v"
109
109
  }
110
110
  };
111
+ /**
112
+ * Source extensions whose registry answer is wrong for a workspace. `.ts` and
113
+ * `.mts` are MPEG-2 transport stream to both the IANA registry and a browser's
114
+ * own `File.type`, so a store that reports either verbatim describes every
115
+ * TypeScript file as a video. Those two are the registry's only collisions with
116
+ * a source extension — `.cts` and `.tsx` are simply absent from it, and `.svg`
117
+ * is a genuine image — so this table stays a short list of known-wrong names
118
+ * rather than an allowlist that would refuse real media it has not heard of.
119
+ */
120
+ const SOURCE_MIME_BY_EXTENSION = {
121
+ ts: "text/typescript",
122
+ mts: "text/typescript",
123
+ cts: "text/typescript",
124
+ tsx: "text/tsx"
125
+ };
111
126
  const SUPPORTED_IMAGE_MIME_TYPES = /* @__PURE__ */ new Set([
112
127
  "image/png",
113
128
  "image/jpeg",
@@ -147,6 +162,9 @@ function inferWorkspaceMediaFromMime(mimeType) {
147
162
  function getWorkspaceBasename(path) {
148
163
  return path.split("/").filter(Boolean).at(-1) ?? path;
149
164
  }
165
+ function workspaceExtension(path) {
166
+ return getWorkspaceBasename(path).split(".").at(-1)?.toLowerCase() ?? "";
167
+ }
150
168
  function isWorkspaceMarkdownPath(path) {
151
169
  return getWorkspaceBasename(path).toLowerCase().endsWith(".md");
152
170
  }
@@ -159,15 +177,35 @@ function isWorkspaceSkillPath(path) {
159
177
  * that report generic values such as `application/octet-stream`.
160
178
  */
161
179
  function inferWorkspaceMedia(path, mimeType) {
180
+ const extension = workspaceExtension(path);
181
+ if (SOURCE_MIME_BY_EXTENSION[extension]) return null;
162
182
  const byMimeType = inferWorkspaceMediaFromMime(mimeType);
163
183
  if (byMimeType) return byMimeType;
164
184
  const normalizedMimeType = normalizeWorkspaceMimeType(mimeType);
165
185
  if (normalizedMimeType && !GENERIC_MEDIA_MIME_TYPES.has(normalizedMimeType)) return null;
166
- const extension = getWorkspaceBasename(path).split(".").at(-1)?.toLowerCase() ?? "";
167
186
  const byExtension = MEDIA_BY_EXTENSION[extension];
168
187
  if (byExtension) return byExtension;
169
188
  return null;
170
189
  }
190
+ /**
191
+ * The mime type this vocabulary fixes for a file name, or `null` where it has
192
+ * no opinion and the caller's own answer stands.
193
+ *
194
+ * A workspace that derives mime types from names needs this for the reason
195
+ * `inferWorkspaceMedia` distrusts them: the platform registries call `.ts`
196
+ * MPEG-2 transport stream, and every downstream media check believes it. Media
197
+ * extensions answer their canonical type here too, so a host has one call
198
+ * instead of a copy of the table this module already keeps.
199
+ *
200
+ * @example
201
+ * ```ts
202
+ * const mimeType = inferWorkspaceMimeType(name) ?? lookup(name) ?? "application/octet-stream";
203
+ * ```
204
+ */
205
+ function inferWorkspaceMimeType(path) {
206
+ const extension = workspaceExtension(path);
207
+ return SOURCE_MIME_BY_EXTENSION[extension] ?? MEDIA_BY_EXTENSION[extension]?.mimeType ?? null;
208
+ }
171
209
  function isWorkspaceMediaPath(path, mimeType) {
172
210
  return inferWorkspaceMedia(path, mimeType) !== null;
173
211
  }
@@ -188,8 +226,7 @@ function parseWorkspaceSkill(content) {
188
226
  }
189
227
  /** Best-effort syntax-highlighting language from a file path; unknown extensions render as plain text. */
190
228
  function inferWorkspaceLanguage(path) {
191
- const extension = getWorkspaceBasename(path).split(".").at(-1)?.toLowerCase() ?? "";
192
- return LANGUAGE_BY_EXTENSION[extension] ?? "text";
229
+ return LANGUAGE_BY_EXTENSION[workspaceExtension(path)] ?? "text";
193
230
  }
194
231
  //#endregion
195
- export { getWorkspaceBasename, inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill };
232
+ export { getWorkspaceBasename, inferWorkspaceLanguage, inferWorkspaceMedia, inferWorkspaceMimeType, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill };
@@ -1,4 +1,4 @@
1
- import { i as WorkspaceFileState } from "../../WorkspaceFile-C8Riev9j.js";
1
+ import { i as WorkspaceFileState } from "../../WorkspaceFile-CVAzjTt6.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/agents-sdk/WorkspaceFileView.d.ts
@@ -1,2 +1,2 @@
1
- import { t as WorkspaceFileView } from "../../WorkspaceFileView-BtzVKAed.js";
1
+ import { t as WorkspaceFileView } from "../../WorkspaceFileView-BmxSbhRu.js";
2
2
  export { WorkspaceFileView };
@@ -62,7 +62,6 @@ declare function ApprovalPreviewRow({
62
62
  }: ApprovalPreviewRowProps & {
63
63
  ref?: React.Ref<HTMLDivElement>;
64
64
  }): React.JSX.Element;
65
- declare function formatApprovalValue(value: unknown): string;
66
65
  interface ApprovalInputPreviewProps {
67
66
  input: unknown;
68
67
  }
@@ -99,4 +98,4 @@ declare function ApprovalDecision({
99
98
  ref?: React.Ref<HTMLDivElement>;
100
99
  }): React.JSX.Element;
101
100
  //#endregion
102
- export { Approval, ApprovalCount, ApprovalCountProps, ApprovalDecision, ApprovalDecisionProps, ApprovalDecisionValue, ApprovalHeader, ApprovalHeaderProps, ApprovalInputPreview, ApprovalInputPreviewProps, ApprovalPreview, ApprovalPreviewProps, ApprovalPreviewRow, ApprovalPreviewRowProps, ApprovalProps, ApprovalQuestion, ApprovalQuestionProps, formatApprovalValue };
101
+ export { Approval, ApprovalCount, ApprovalCountProps, ApprovalDecision, ApprovalDecisionProps, ApprovalDecisionValue, ApprovalHeader, ApprovalHeaderProps, ApprovalInputPreview, ApprovalInputPreviewProps, ApprovalPreview, ApprovalPreviewProps, ApprovalPreviewRow, ApprovalPreviewRowProps, ApprovalProps, ApprovalQuestion, ApprovalQuestionProps };
@@ -1,6 +1,7 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { B as PencilIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Button } from "../foundations/Button.js";
4
+ import { a as formatUnknownValue } from "../../format-DB2mX9DA.js";
4
5
  import { Kbd } from "../foundations/Kbd.js";
5
6
  import * as React from "react";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -68,17 +69,13 @@ function ApprovalPreviewRow({ children, className, label, ref, ...props }) {
68
69
  ]
69
70
  });
70
71
  }
71
- function formatApprovalValue(value) {
72
- if (typeof value === "string") return value;
73
- return JSON.stringify(value) ?? String(value);
74
- }
75
72
  /** Renders unknown upstream input without changing or normalizing its shape. */
76
73
  function ApprovalInputPreview({ input }) {
77
74
  const entries = input && typeof input === "object" && !Array.isArray(input) ? Object.entries(input) : void 0;
78
75
  return /* @__PURE__ */ jsx(ApprovalPreview, { children: entries ? entries.map(([key, value]) => /* @__PURE__ */ jsx(ApprovalPreviewRow, {
79
76
  label: key,
80
- children: formatApprovalValue(value)
81
- }, key)) : /* @__PURE__ */ jsx(ApprovalPreviewRow, { children: formatApprovalValue(input) }) });
77
+ children: formatUnknownValue(value)
78
+ }, key)) : /* @__PURE__ */ jsx(ApprovalPreviewRow, { children: formatUnknownValue(input) }) });
82
79
  }
83
80
  function getErrorMessage(error) {
84
81
  if (error instanceof Error && error.message.trim()) return error.message;
@@ -223,4 +220,4 @@ function ApprovalDecision({ className, onDecision, onSkip, subject = "this actio
223
220
  });
224
221
  }
225
222
  //#endregion
226
- export { Approval, ApprovalCount, ApprovalDecision, ApprovalHeader, ApprovalInputPreview, ApprovalPreview, ApprovalPreviewRow, ApprovalQuestion, formatApprovalValue };
223
+ export { Approval, ApprovalCount, ApprovalDecision, ApprovalHeader, ApprovalInputPreview, ApprovalPreview, ApprovalPreviewRow, ApprovalQuestion };
@@ -1,7 +1,7 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { Popover } from "../foundations/Popover.js";
3
3
  import { Separator } from "../foundations/Separator.js";
4
- import { t as ProgressRing } from "../../progress-ring-Dz_ztrW2.js";
4
+ import { t as ProgressRing } from "../../progress-ring-BEocM1e3.js";
5
5
  import * as React from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/components/ai-sdk/Context.tsx
@@ -1,7 +1,7 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { Q as TargetIcon, V as PlayIcon, et as TrashIcon, z as PauseIcon } from "../../icons-B1Qw05te.js";
3
3
  import { IconButton } from "../foundations/IconButton.js";
4
- import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
4
+ import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
5
5
  import * as React from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/components/ai-sdk/Goal.tsx
@@ -3,7 +3,7 @@ import { C as FileIcon, i as ArrowRightIcon, r as ArrowLeftIcon } from "../../ic
3
3
  import { Button } from "../foundations/Button.js";
4
4
  import { IconButton } from "../foundations/IconButton.js";
5
5
  import { t as AttachmentPreview } from "../../attachment-preview-1CXJvrmb.js";
6
- import { n as clamp } from "../../format-CmopcfqJ.js";
6
+ import { n as clamp } from "../../format-DB2mX9DA.js";
7
7
  import * as React from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { cjk } from "@streamdown/cjk";
@@ -1,7 +1,7 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { d as CheckIcon, i as ArrowRightIcon, v as DotIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Popover } from "../foundations/Popover.js";
4
- import { t as ProgressRing } from "../../progress-ring-Dz_ztrW2.js";
4
+ import { t as ProgressRing } from "../../progress-ring-BEocM1e3.js";
5
5
  import * as React from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/components/ai-sdk/Plan.tsx
@@ -4,7 +4,7 @@ import { Button } from "../foundations/Button.js";
4
4
  import { Tooltip } from "../foundations/Tooltip.js";
5
5
  import { IconButton } from "../foundations/IconButton.js";
6
6
  import { t as AttachmentPreview } from "../../attachment-preview-1CXJvrmb.js";
7
- import { i as formatErrorMessage, n as clamp, r as formatClock } from "../../format-CmopcfqJ.js";
7
+ import { i as formatErrorMessage, n as clamp, r as formatClock } from "../../format-DB2mX9DA.js";
8
8
  import { Combobox } from "../foundations/Combobox.js";
9
9
  import { Kbd } from "../foundations/Kbd.js";
10
10
  import { Menu } from "../foundations/Menu.js";
@@ -1,12 +1,12 @@
1
1
  import { Activity, ActivityContent, ActivityPanel, ActivityTrigger } from "./Activity.js";
2
+ import { a as formatUnknownValue } from "../../format-DB2mX9DA.js";
2
3
  import { getToolDisplayName, isToolPartFailed, isToolPartWorking } from "./ToolPart.js";
3
4
  import { t as summarizeToolInput } from "../../summarize-tool-input-CqTcGRYy.js";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { getToolName } from "ai";
6
7
  //#region src/components/ai-sdk/ToolInvocation.tsx
7
8
  function formatToolValue(value) {
8
- if (value === void 0) return void 0;
9
- return typeof value === "string" ? value : JSON.stringify(value, null, 2);
9
+ return value === void 0 ? void 0 : formatUnknownValue(value, 2);
10
10
  }
11
11
  function describeToolPart(part) {
12
12
  const name = getToolDisplayName(part);
@@ -1,7 +1,7 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { J as SpinnerIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Button } from "../foundations/Button.js";
4
- import { u as ModelSelectorLogo } from "../../ModelSelector-DzdEs2fX.js";
4
+ import { u as ModelSelectorLogo } from "../../ModelSelector-DtBxWqRn.js";
5
5
  import "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/components/extension/ChatGptSignInScreen.tsx
@@ -1,7 +1,7 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { W as RefreshIcon, d as CheckIcon, f as ChevronDownIcon, l as BrainIcon, m as ChevronRightIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Tooltip } from "../foundations/Tooltip.js";
4
- import { a as titleCase } from "../../format-CmopcfqJ.js";
4
+ import { o as titleCase } from "../../format-DB2mX9DA.js";
5
5
  import { Menu } from "../foundations/Menu.js";
6
6
  import "react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { tt as WarningIcon } from "../../icons-B1Qw05te.js";
2
2
  import { Avatar } from "../foundations/Avatar.js";
3
3
  import { Button } from "../foundations/Button.js";
4
- import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
4
+ import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
5
5
  import { Menu } from "../foundations/Menu.js";
6
6
  import * as React from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -18,7 +18,8 @@ interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "ti
18
18
  * region is the container's job, not this component's; set
19
19
  * `--sigvelo-recipe-empty-state-padding-block` where a roomier well is wanted.
20
20
  *
21
- * `children` replaces the whole stack, for the cases that need an action.
21
+ * `children` land under the description, for the action that makes the region
22
+ * non-empty.
22
23
  *
23
24
  * @example
24
25
  * ```tsx
@@ -28,7 +29,9 @@ interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "ti
28
29
  * icon={<MessageIcon />}
29
30
  * title="Start a conversation"
30
31
  * description="Ask the agent to inspect, plan, or build."
31
- * />
32
+ * >
33
+ * <Button size="sm">New thread</Button>
34
+ * </EmptyState>
32
35
  * ```
33
36
  */
34
37
  declare function EmptyState({
@@ -1,6 +1,6 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import "react";
3
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/foundations/EmptyState.tsx
5
5
  /**
6
6
  * Placeholder for a region that has nothing in it yet.
@@ -11,7 +11,8 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
11
  * region is the container's job, not this component's; set
12
12
  * `--sigvelo-recipe-empty-state-padding-block` where a roomier well is wanted.
13
13
  *
14
- * `children` replaces the whole stack, for the cases that need an action.
14
+ * `children` land under the description, for the action that makes the region
15
+ * non-empty.
15
16
  *
16
17
  * @example
17
18
  * ```tsx
@@ -21,15 +22,17 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
22
  * icon={<MessageIcon />}
22
23
  * title="Start a conversation"
23
24
  * description="Ask the agent to inspect, plan, or build."
24
- * />
25
+ * >
26
+ * <Button size="sm">New thread</Button>
27
+ * </EmptyState>
25
28
  * ```
26
29
  */
27
30
  function EmptyState({ className, icon, title, description, children, ref, ...props }) {
28
- return /* @__PURE__ */ jsx("div", {
31
+ return /* @__PURE__ */ jsxs("div", {
29
32
  ref,
30
33
  className: cx("empty-state", className),
31
34
  ...props,
32
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
35
+ children: [
33
36
  icon ? /* @__PURE__ */ jsx("span", {
34
37
  className: "empty-state__icon",
35
38
  "aria-hidden": "true",
@@ -42,8 +45,9 @@ function EmptyState({ className, icon, title, description, children, ref, ...pro
42
45
  description ? /* @__PURE__ */ jsx("div", {
43
46
  className: "empty-state__description",
44
47
  children: description
45
- }) : null
46
- ] })
48
+ }) : null,
49
+ children
50
+ ]
47
51
  });
48
52
  }
49
53
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { n as mergeBaseClassName, t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { n as clamp } from "../../format-CmopcfqJ.js";
2
+ import { n as clamp } from "../../format-DB2mX9DA.js";
3
3
  import { Separator } from "../foundations/Separator.js";
4
4
  import * as React from "react";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { K as SidebarIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Button } from "../foundations/Button.js";
4
- import { t as capitalize } from "../../format-CmopcfqJ.js";
4
+ import { t as capitalize } from "../../format-DB2mX9DA.js";
5
5
  import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
6
6
  import { AppTopBar } from "./AppTopBar.js";
7
7
  import { ResizableSidePanel } from "./ResizableSidePanel.js";
@@ -1,6 +1,6 @@
1
1
  import { Button } from "../foundations/Button.js";
2
2
  import { Dialog } from "../foundations/Dialog.js";
3
- import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
3
+ import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
4
4
  import { Field } from "../foundations/Field.js";
5
5
  import { Form } from "../foundations/Form.js";
6
6
  import * as React from "react";
@@ -10,8 +10,13 @@ import { AgentToolRunState } from "agents/agent-tools";
10
10
  interface AgentToolDetailProps<State = unknown, MessageT extends UIMessage = UIMessage> extends React.HTMLAttributes<HTMLDivElement> {
11
11
  /** Whole retained run selected from the parent `useAgentToolEvents` result. */
12
12
  run: AgentToolRunState<MessageT["parts"][number]>;
13
- /** Whole child Think chat hook result; it owns the stored child transcript. */
14
- chat: ThinkChatValue<State, MessageT>;
13
+ /**
14
+ * Whole child Think chat hook result; it owns the stored child transcript.
15
+ * Optional because the run's chrome is parent-side data: while the child
16
+ * transcript is still loading, the detail renders without it and the chat
17
+ * region shows a loading status instead.
18
+ */
19
+ chat?: ThinkChatValue<State, MessageT>;
15
20
  messages?: ThinkChatMessagesProps<MessageT>;
16
21
  /** App-authored TanStack Router Link to the parent conversation. */
17
22
  backLink?: React.ReactElement;
@@ -57,7 +62,12 @@ interface SelectedAgentToolChildProps<ParentAgentT extends ThinkAgent<ParentStat
57
62
  messages?: ThinkChatMessagesProps<MessageT>;
58
63
  /** App-authored TanStack Router Link to the parent conversation. */
59
64
  backLink?: React.ReactElement;
60
- /** Rendered while the child transcript loads (the internal Suspense fallback). */
65
+ /**
66
+ * Replaces the whole detail while the child transcript loads. Defaults to
67
+ * the detail surface itself with a loading chat region, so the run's chrome
68
+ * — back link, run state, and pinned actions such as cancel — is available
69
+ * the moment the route opens.
70
+ */
61
71
  fallback?: React.ReactNode;
62
72
  /** Route-owned run controls, forwarded to `AgentToolDetail`'s pinned actions bar. */
63
73
  actions?: React.ReactNode;
@@ -3,7 +3,7 @@ import { r as ArrowLeftIcon } from "../../icons-B1Qw05te.js";
3
3
  import { TransitionSurface } from "../foundations/TransitionSurface.js";
4
4
  import { SubagentRunActions, SubagentRunMilestone, SubagentRunMilestones, SubagentRunProgress } from "../agents-sdk/SubagentRunDetails.js";
5
5
  import { SubagentRunIndicator, getSubagentRunName } from "../agents-sdk/SubagentRunIndicator.js";
6
- import { t as ThinkChat } from "../../ThinkChat-en0UbkVv.js";
6
+ import { t as ThinkChat } from "../../ThinkChat-DbzqSTBt.js";
7
7
  import { AppTopBar } from "../general-purpose/AppTopBar.js";
8
8
  import { NaniteMark } from "./NaniteScene.js";
9
9
  import * as React from "react";
@@ -69,12 +69,16 @@ function AgentToolDetail({ actions, backLink, chat, className, messages, ref, ru
69
69
  }) : null,
70
70
  /* @__PURE__ */ jsx("div", {
71
71
  className: "agent-tool-detail__chat",
72
- children: /* @__PURE__ */ jsx(ThinkChat.Provider, {
72
+ children: chat ? /* @__PURE__ */ jsx(ThinkChat.Provider, {
73
73
  chat,
74
74
  children: /* @__PURE__ */ jsx(ThinkChat.Messages, {
75
75
  ...messages,
76
76
  showComposer: false
77
77
  })
78
+ }) : /* @__PURE__ */ jsx(ThinkChat.Messages, {
79
+ ...messages,
80
+ showComposer: false,
81
+ loading: true
78
82
  })
79
83
  }),
80
84
  actions ? /* @__PURE__ */ jsx(SubagentRunActions, { children: actions }) : null
@@ -109,7 +113,12 @@ function selectedAgentToolChildOptions(parentAgent, run, connectionOptions) {
109
113
  function SelectedAgentToolChild({ actions, backLink, connectionOptions, fallback, getInitialMessages, messages, parentAgent, run }) {
110
114
  const childAgent = useAgent(selectedAgentToolChildOptions(parentAgent, run, connectionOptions));
111
115
  return /* @__PURE__ */ jsx(React.Suspense, {
112
- fallback: fallback ?? null,
116
+ fallback: fallback ?? /* @__PURE__ */ jsx(AgentToolDetail, {
117
+ run,
118
+ messages,
119
+ backLink,
120
+ actions
121
+ }),
113
122
  children: /* @__PURE__ */ jsx(SelectedAgentToolChildChat, {
114
123
  actions,
115
124
  backLink,
@@ -37,5 +37,20 @@ function formatClock(totalSeconds) {
37
37
  function formatErrorMessage(error) {
38
38
  return error instanceof Error ? error.message : String(error);
39
39
  }
40
+ /**
41
+ * Renders an unknown upstream value as display text. Tool arguments, results,
42
+ * and audit records arrive in shapes this package never declared, so a bigint,
43
+ * a cycle, or a value `JSON.stringify` has no answer for is an ordinary input
44
+ * here rather than a thrown render. `space` is `JSON.stringify`'s, so a block
45
+ * panel passes `2` and an inline row passes nothing.
46
+ */
47
+ function formatUnknownValue(value, space) {
48
+ if (typeof value === "string") return value;
49
+ try {
50
+ return JSON.stringify(value, (_key, item) => typeof item === "bigint" ? `${item}n` : item, space) ?? String(value);
51
+ } catch {
52
+ return String(value);
53
+ }
54
+ }
40
55
  //#endregion
41
- export { titleCase as a, formatErrorMessage as i, clamp as n, formatClock as r, capitalize as t };
56
+ export { formatUnknownValue as a, formatErrorMessage as i, clamp as n, titleCase as o, formatClock as r, capitalize as t };
@@ -1,4 +1,4 @@
1
- import { n as clamp } from "./format-CmopcfqJ.js";
1
+ import { n as clamp } from "./format-DB2mX9DA.js";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  //#region src/components/_internal/progress-ring.tsx
4
4
  /**
@@ -57,6 +57,22 @@
57
57
  --message-scroller-button-inset-block-end: var(--sigvelo-spacing-2);
58
58
  }
59
59
 
60
+ /* Takes the whole transcript region, the way the scroller it stands in for
61
+ does, so nothing moves when the rows arrive. The composer floats over its
62
+ lower edge, so the spinner sits slightly high rather than under it. */
63
+ .agent-chat__transcript-loading {
64
+ display: grid;
65
+ block-size: 100%;
66
+ min-block-size: 0;
67
+ place-items: center;
68
+ padding-block-end: var(--agent-chat-composer-size, 5rem);
69
+ color: var(--sigvelo-color-text-muted);
70
+ }
71
+
72
+ .agent-chat[data-composer-hidden] .agent-chat__transcript-loading {
73
+ padding-block-end: 0;
74
+ }
75
+
60
76
  .agent-chat-start-screen {
61
77
  block-size: 100%;
62
78
  min-block-size: 0;
@@ -8,7 +8,7 @@
8
8
 
9
9
  .field[data-invalid] .field__label,
10
10
  .field[data-invalid] .field-title {
11
- color: var(--sigvelo-color-danger-bg);
11
+ color: var(--sigvelo-color-danger-text);
12
12
  }
13
13
 
14
14
  .field--horizontal {
@@ -103,7 +103,7 @@
103
103
  font-family: inherit;
104
104
  font-size: var(--sigvelo-text-xs);
105
105
  line-height: var(--sigvelo-leading-snug);
106
- color: var(--sigvelo-color-danger-bg);
106
+ color: var(--sigvelo-color-danger-text);
107
107
  margin: 0;
108
108
  opacity: 1;
109
109
  translate: 0;
@@ -58,6 +58,15 @@
58
58
  min-inline-size: 0;
59
59
  }
60
60
 
61
+ /* Only the container concerns — the block inside is `EmptyState`, and this
62
+ component is documented as reusable outside the workbench, so it does not
63
+ reach for a workbench class to fill itself. */
64
+ .think-execution-detail--empty {
65
+ align-content: center;
66
+ justify-items: center;
67
+ min-block-size: 12rem;
68
+ }
69
+
61
70
  .think-execution-workbench__run-list {
62
71
  border-block-end: var(--sigvelo-border-style) var(--sigvelo-border-width)
63
72
  var(--sigvelo-color-neutral-border-subtle);
@@ -187,19 +196,6 @@
187
196
  line-height: var(--sigvelo-leading-tight);
188
197
  }
189
198
 
190
- .think-execution-workbench__empty-detail {
191
- min-block-size: 12rem;
192
- display: grid;
193
- place-items: center;
194
- color: var(--sigvelo-color-text-muted);
195
- font-size: var(--sigvelo-text-compact);
196
- text-align: center;
197
- }
198
-
199
- .think-execution-workbench__empty-detail p {
200
- margin: 0;
201
- }
202
-
203
199
  @container (width >= 44rem) {
204
200
  .think-execution-workbench__content {
205
201
  grid-template-rows: minmax(0, 1fr);
@@ -355,38 +355,10 @@
355
355
  var(--sigvelo-color-neutral-border-subtle);
356
356
  }
357
357
 
358
- .think-routine-library__empty-list,
359
- .think-routine-library__empty-detail {
360
- color: var(--sigvelo-color-text-muted);
361
- text-align: center;
362
- }
363
-
364
- .think-routine-library__empty-list {
365
- padding: var(--sigvelo-spacing-4) var(--sigvelo-spacing-3);
366
- }
367
-
368
- .think-routine-library__empty-list p,
369
- .think-routine-library__empty-detail p {
370
- margin: var(--sigvelo-spacing-1) 0 0;
371
- font-size: var(--sigvelo-text-compact);
372
- }
373
-
358
+ /* Filling the pane is all this adds — the muted, centred anatomy inside it is
359
+ `EmptyState`, which already centres itself and spaces its own action. */
374
360
  .think-routine-library__empty-detail {
375
361
  min-block-size: 100%;
376
- display: grid;
377
- place-content: center;
378
- padding: var(--sigvelo-spacing-4);
379
- }
380
-
381
- .think-routine-library__empty-detail h1 {
382
- margin: 0;
383
- color: var(--sigvelo-color-text);
384
- font-size: var(--sigvelo-text-lg);
385
- }
386
-
387
- .think-routine-library__empty-action {
388
- justify-self: center;
389
- margin-block-start: var(--sigvelo-spacing-4);
390
362
  }
391
363
 
392
364
  .think-routine-library__create {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-b/react-components",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "MCP-B React components built on Base UI and shared design tokens, including Cloudflare Think chat primitives.",
5
5
  "homepage": "https://design-system.sigvelo.com",
6
6
  "bugs": {
@@ -58,7 +58,7 @@
58
58
  "streamdown": "^2.5.0",
59
59
  "unist-util-visit": "^5.1.0",
60
60
  "yet-another-react-lightbox": "^3.32.1",
61
- "@mcp-b/design-tokens": "0.34.0"
61
+ "@mcp-b/design-tokens": "0.35.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@ai-sdk/react": "^3.0.230",