@mcp-b/react-components 0.14.0 → 0.14.2

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 (38) hide show
  1. package/dist/{AgentChat-Cgb1xuT7.d.ts → AgentChat-DQkqt82e.d.ts} +4 -2
  2. package/dist/{ModelSelector-DVgVBdvw.js → ModelSelector-CPCpFAUt.js} +15 -6
  3. package/dist/{ThinkChat-7DQ2CogF.js → ThinkChat-BPcehdbP.js} +3 -1
  4. package/dist/{ThinkChatActivity-m9orbdeI.d.ts → ThinkChatActivity-BmwuIigx.d.ts} +2 -2
  5. package/dist/{ThinkChatToolParts-Cv4o7j6F.d.ts → ThinkChatToolParts-CDEjqS6A.d.ts} +50 -1
  6. package/dist/components/AgentChat.d.ts +1 -1
  7. package/dist/components/AgentChat.js +8 -6
  8. package/dist/components/ChatGptSignInScreen.js +1 -1
  9. package/dist/components/McpServerPicker.d.ts +1 -1
  10. package/dist/components/McpServerPicker.js +6 -0
  11. package/dist/components/ModelSelector.d.ts +15 -3
  12. package/dist/components/ModelSelector.js +1 -1
  13. package/dist/components/NaniteScene.d.ts +10 -1
  14. package/dist/components/NaniteScene.js +36 -1
  15. package/dist/components/SubagentRun.d.ts +87 -0
  16. package/dist/components/SubagentRun.js +101 -0
  17. package/dist/components/SubagentRunDetails.d.ts +44 -0
  18. package/dist/components/SubagentRunDetails.js +48 -0
  19. package/dist/components/ThinkChat.d.ts +8 -4
  20. package/dist/components/ThinkChat.js +1 -1
  21. package/dist/components/ThinkChatActivity.d.ts +2 -2
  22. package/dist/components/ThinkChatActivity.js +30 -3
  23. package/dist/components/ThinkChatToolPanels.d.ts +10 -2
  24. package/dist/components/ThinkChatToolPanels.js +47 -2
  25. package/dist/components/ThinkChatToolParts.d.ts +2 -2
  26. package/dist/components/ThinkChatToolParts.js +17 -1
  27. package/dist/components/ThinkFullApp.js +1 -1
  28. package/dist/styles/activity.css +6 -0
  29. package/dist/styles/agent-chat.css +15 -1
  30. package/dist/styles/index.css +1 -0
  31. package/dist/styles/message-scroller.css +1 -1
  32. package/dist/styles/message.css +2 -0
  33. package/dist/styles/nanite-scene.css +16 -0
  34. package/dist/styles/streamdown.css +10 -0
  35. package/dist/styles/subagent-run.css +188 -0
  36. package/dist/styles/think-full-app.css +2 -0
  37. package/dist/styles/workspace-explorer.css +1 -0
  38. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
- import { a as AgentChatRenderPartContext, r as AgentChatProps } from "../AgentChat-Cgb1xuT7.js";
1
+ import { a as AgentChatRenderPartContext, r as AgentChatProps } from "../AgentChat-DQkqt82e.js";
2
2
  import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../BrowserLiveView-BV5qgFgI.js";
3
3
  import { n as BrowserReplayProps, t as BrowserReplay } from "../BrowserReplay-xWvRjRAC.js";
4
- import { _ as isThinkChatActivityPart } from "../ThinkChatToolParts-Cv4o7j6F.js";
5
- import { a as ThinkChatToolRenderers, c as renderThinkChatActivityPart, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as describeThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-m9orbdeI.js";
4
+ import { x as isThinkChatActivityPart } from "../ThinkChatToolParts-CDEjqS6A.js";
5
+ import { a as ThinkChatToolRenderers, c as renderThinkChatActivityPart, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as describeThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-BmwuIigx.js";
6
6
  import { n as ThinkChatValue } from "../ThinkChatContext-C3Eb1Xpi.js";
7
7
  import { FileInfo, UseWorkspaceOptions, WorkspaceExplorer, WorkspaceExplorerProps, WorkspaceFileState, WorkspaceInfo, WorkspaceSource, WorkspaceState, inferWorkspaceLanguage, useWorkspace } from "./WorkspaceExplorer.js";
8
8
  import * as React from "react";
@@ -29,6 +29,8 @@ interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends
29
29
  className?: string;
30
30
  /** Disable the composer (e.g. while the agent is unreachable). */
31
31
  disabled?: boolean;
32
+ /** Hide the composer while retaining the normal Think transcript rendering. */
33
+ showComposer?: AgentChatProps<MessageT>["showComposer"];
32
34
  /** Shown in place of the list while there are no messages. */
33
35
  emptyState?: React.ReactNode;
34
36
  /** Extra controls rendered inside the composer, next to the send button. */
@@ -104,7 +106,9 @@ declare function ThinkChatRoot<State = unknown, MessageT extends UIMessage = UIM
104
106
  * The full conversation surface — message list plus composer — with the
105
107
  * activity renderer as the default `renderPart`: runs of reasoning/tool parts
106
108
  * fold into one collapsed Activity block with derived labels and per-tool
107
- * panels. Extend for app-specific tools with `toolRenderers` (label/panel
109
+ * panels. Session-generated context/load/search tools are recognized from
110
+ * their upstream runtime schemas and keep their recorded inputs and outputs
111
+ * inspectable. Extend for app-specific tools with `toolRenderers` (label/panel
108
112
  * inside the log) or `excludeTools` + your own `renderPart` (standalone
109
113
  * card) — see README "App-specific tools" and the Custom Tool Panel story.
110
114
  */
@@ -2,6 +2,6 @@ import { BrowserLiveView } from "./BrowserLiveView.js";
2
2
  import { BrowserReplay } from "./BrowserReplay.js";
3
3
  import { isThinkChatActivityPart } from "./ThinkChatToolParts.js";
4
4
  import { ThinkChatActivity, createThinkChatActivityRenderer, describeThinkChatActivityPart, renderThinkChatActivityPart } from "./ThinkChatActivity.js";
5
- import { a as useThinkChat, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkPendingApprovals, r as ThinkChatProvider, t as ThinkChat } from "../ThinkChat-7DQ2CogF.js";
5
+ import { a as useThinkChat, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkPendingApprovals, r as ThinkChatProvider, t as ThinkChat } from "../ThinkChat-BPcehdbP.js";
6
6
  import { WorkspaceExplorer, inferWorkspaceLanguage, useWorkspace } from "./WorkspaceExplorer.js";
7
7
  export { BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, useThinkChat, useThinkPendingApprovals, useWorkspace };
@@ -1,3 +1,3 @@
1
- import { _ as isThinkChatActivityPart } from "../ThinkChatToolParts-Cv4o7j6F.js";
2
- import { a as ThinkChatToolRenderers, c as renderThinkChatActivityPart, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as describeThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-m9orbdeI.js";
1
+ import { x as isThinkChatActivityPart } from "../ThinkChatToolParts-CDEjqS6A.js";
2
+ import { a as ThinkChatToolRenderers, c as renderThinkChatActivityPart, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as describeThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-BmwuIigx.js";
3
3
  export { ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatToolRenderer, ThinkChatToolRenderers, createThinkChatActivityRenderer, describeThinkChatActivityPart, isThinkChatActivityPart, renderThinkChatActivityPart };
@@ -2,8 +2,8 @@ import { D as PencilIcon, I as TerminalIcon, L as WarningIcon, R as WrenchIcon,
2
2
  import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityText, ActivityTrigger } from "./Activity.js";
3
3
  import { t as summarizeToolInput } from "../summarize-tool-input-BUJsENSn.js";
4
4
  import { useOptionalThinkChatContext } from "./ThinkChatContext.js";
5
- import { displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart } from "./ThinkChatToolParts.js";
6
- import { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel } from "./ThinkChatToolPanels.js";
5
+ import { displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart } from "./ThinkChatToolParts.js";
6
+ import { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSessionContextPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel } from "./ThinkChatToolPanels.js";
7
7
  import * as React from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { getToolInput, getToolOutput } from "@cloudflare/think/react";
@@ -130,6 +130,7 @@ function activityPartIconKind(part) {
130
130
  case "tool-bash": return "command";
131
131
  }
132
132
  if (isSkillToolPart(part)) return "tool";
133
+ if (isSessionContextToolPart(part)) return part.type === "tool-search_context" || part.type === "tool-session_search" ? "search" : "tool";
133
134
  if (isFetchToolPart(part)) return "web";
134
135
  if (isBrowserToolPart(part)) return part.type === "tool-browser_execute" ? "browser" : "web";
135
136
  if (isExecuteToolPart(part)) return "command";
@@ -163,6 +164,7 @@ function describeThinkChatActivityPart(part, toolRenderers) {
163
164
  }
164
165
  if (isWorkspaceToolPart(part)) return describeWorkspaceToolPart(part);
165
166
  if (isSkillToolPart(part)) return describeSkillToolPart(part);
167
+ if (isSessionContextToolPart(part)) return describeSessionContextToolPart(part);
166
168
  if (isFetchToolPart(part)) return describeFetchToolPart(part);
167
169
  if (isBrowserToolPart(part)) return describeBrowserToolPart(part);
168
170
  if (isExecuteToolPart(part)) return describeExecuteToolPart(part);
@@ -212,6 +214,23 @@ function describeSkillToolPart(part) {
212
214
  })();
213
215
  return failed ? `${label} · failed` : label;
214
216
  }
217
+ function describeSessionContextToolPart(part) {
218
+ const working = isPartWorking(part);
219
+ const failed = isSessionContextToolFailure(part);
220
+ const label = (() => {
221
+ switch (part.type) {
222
+ case "tool-set_context": {
223
+ const target = part.input?.label ? ` ${part.input.label}` : " context";
224
+ return `${working ? "Updating" : "Updated"}${target}`;
225
+ }
226
+ case "tool-load_context": return `${working ? "Loading" : "Loaded"} ${part.input?.key ?? "context"}`;
227
+ case "tool-unload_context": return `${working ? "Unloading" : "Unloaded"} ${part.input?.key ?? "context"}`;
228
+ case "tool-search_context": return `${working ? "Searching" : "Searched"} ${part.input?.label ?? "context"}`;
229
+ case "tool-session_search": return `${working ? "Searching" : "Searched"} conversations`;
230
+ }
231
+ })();
232
+ return failed ? `${label} · failed` : label;
233
+ }
215
234
  function describeBrowserToolPart(part) {
216
235
  const working = isPartWorking(part);
217
236
  const failed = isPartFailed(part);
@@ -253,6 +272,7 @@ function summarizeActivitySteps(parts) {
253
272
  const skillNames = /* @__PURE__ */ new Set();
254
273
  let thoughts = 0;
255
274
  let skillParts = 0;
275
+ const sessionSegments = /* @__PURE__ */ new Set();
256
276
  let fetches = 0;
257
277
  let browses = 0;
258
278
  let codeRuns = 0;
@@ -263,7 +283,8 @@ function summarizeActivitySteps(parts) {
263
283
  } else if (isSkillToolPart(part)) {
264
284
  skillParts++;
265
285
  if (typeof part.input?.name === "string") skillNames.add(part.input.name);
266
- } else if (isFetchToolPart(part)) fetches++;
286
+ } else if (isSessionContextToolPart(part)) sessionSegments.add(part.type === "tool-search_context" || part.type === "tool-session_search" ? "searched context" : "updated context");
287
+ else if (isFetchToolPart(part)) fetches++;
267
288
  else if (isBrowserToolPart(part)) browses++;
268
289
  else if (isExecuteToolPart(part)) codeRuns++;
269
290
  else if (isToolUIPart(part)) genericSegments.add(genericToolLabels(getToolName(part), activityPartUrl(part) !== null).summary);
@@ -276,6 +297,7 @@ function summarizeActivitySteps(parts) {
276
297
  const segments = [];
277
298
  if (thoughts > 0) segments.push("thought");
278
299
  if (skillParts > 0) segments.push(skillNames.size === 1 ? `used the ${[...skillNames][0]} skill` : skillNames.size > 1 ? `used ${skillNames.size} skills` : "used a skill");
300
+ for (const segment of ["updated context", "searched context"]) if (sessionSegments.has(segment)) segments.push(segment);
279
301
  if (reads > 0) segments.push(`read ${files(reads)}`);
280
302
  if (edits > 0) segments.push(`edited ${files(edits)}`);
281
303
  if (deletes > 0) segments.push(`deleted ${files(deletes)}`);
@@ -362,6 +384,11 @@ function ThinkChatActivityStep({ text, part, toolRenderers }) {
362
384
  icon,
363
385
  children: /* @__PURE__ */ jsx(ThinkChatSkillPanel, { part })
364
386
  });
387
+ if (isSessionContextToolPart(part)) return /* @__PURE__ */ jsx(ActivityItemGroup, {
388
+ label: text,
389
+ icon,
390
+ children: /* @__PURE__ */ jsx(ThinkChatSessionContextPanel, { part })
391
+ });
365
392
  if (isFetchToolPart(part)) return /* @__PURE__ */ jsx(ActivityItemGroup, {
366
393
  label: text,
367
394
  icon,
@@ -1,4 +1,4 @@
1
- import { i as SkillToolPart, l as WorkspaceToolPart, n as ExecuteToolPart, r as FetchToolPart, t as BrowserToolPart } from "../ThinkChatToolParts-Cv4o7j6F.js";
1
+ import { a as SessionContextToolPart, d as WorkspaceToolPart, n as ExecuteToolPart, o as SkillToolPart, r as FetchToolPart, t as BrowserToolPart } from "../ThinkChatToolParts-CDEjqS6A.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/ThinkChatToolPanels.d.ts
@@ -18,6 +18,14 @@ declare function ThinkChatSkillPanel({
18
18
  }: {
19
19
  part: SkillToolPart;
20
20
  }): React.JSX.Element;
21
+ /** Session panels expose the durable context/search operation recorded in the
22
+ UIMessage. The session itself remains server-owned; this is transcript
23
+ rendering, not a client-side mirror of context state. */
24
+ declare function ThinkChatSessionContextPanel({
25
+ part
26
+ }: {
27
+ part: SessionContextToolPart;
28
+ }): React.JSX.Element;
21
29
  declare function ThinkChatFetchPanel({
22
30
  part
23
31
  }: {
@@ -36,4 +44,4 @@ declare function ThinkChatBrowserPanel({
36
44
  part: BrowserToolPart;
37
45
  }): React.JSX.Element;
38
46
  //#endregion
39
- export { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel };
47
+ export { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSessionContextPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel };
@@ -2,7 +2,7 @@ import { ActivityOutput, ActivityPanel } from "./Activity.js";
2
2
  import { Tabs } from "./Tabs.js";
3
3
  import { t as CodeBlock } from "../CodeBlock-BUFXG8HW.js";
4
4
  import { BrowserLiveView } from "./BrowserLiveView.js";
5
- import { displayUrl } from "./ThinkChatToolParts.js";
5
+ import { displayUrl, isSessionContextToolFailure } from "./ThinkChatToolParts.js";
6
6
  import * as React from "react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { getToolName } from "ai";
@@ -152,6 +152,51 @@ function ThinkChatSkillPanel({ part }) {
152
152
  }
153
153
  }
154
154
  }
155
+ /** Session panels expose the durable context/search operation recorded in the
156
+ UIMessage. The session itself remains server-owned; this is transcript
157
+ rendering, not a client-side mirror of context state. */
158
+ function ThinkChatSessionContextPanel({ part }) {
159
+ if (part.state === "output-error") return /* @__PURE__ */ jsx(ActivityPanel, {
160
+ label: getToolName(part),
161
+ text: part.errorText,
162
+ status: "error",
163
+ error: true
164
+ });
165
+ if (part.state === "output-denied") return renderDeniedPanel(getToolName(part), part.approval.reason);
166
+ const output = part.state === "output-available" ? part.output : void 0;
167
+ const outputIsError = isSessionContextToolFailure(part);
168
+ switch (part.type) {
169
+ case "tool-set_context": {
170
+ const input = part.input;
171
+ const title = input?.metadata?.title;
172
+ return /* @__PURE__ */ jsx(ActivityPanel, {
173
+ label: title ? `${input?.label ?? "context"} / ${title}` : input?.label ?? "context",
174
+ text: input?.content,
175
+ status: output,
176
+ error: outputIsError
177
+ });
178
+ }
179
+ case "tool-load_context":
180
+ case "tool-unload_context": return /* @__PURE__ */ jsx(ActivityPanel, {
181
+ label: `${part.input?.label ?? "context"} / ${part.input?.key ?? "entry"}`,
182
+ text: output,
183
+ status: outputIsError ? "error" : void 0,
184
+ error: outputIsError
185
+ });
186
+ case "tool-search_context": return /* @__PURE__ */ jsx(ActivityPanel, {
187
+ label: part.input?.query ?? "Context search",
188
+ text: output,
189
+ status: outputIsError ? "error" : part.input?.label,
190
+ error: outputIsError
191
+ });
192
+ case "tool-session_search": return /* @__PURE__ */ jsx(ActivityPanel, {
193
+ label: part.input?.query ?? "Conversation search",
194
+ text: output,
195
+ status: outputIsError ? "error" : void 0,
196
+ error: outputIsError
197
+ });
198
+ }
199
+ }
155
200
  function ThinkChatFetchPanel({ part }) {
156
201
  const label = part.input?.url ?? part.input?.path ?? "fetch";
157
202
  if (part.state === "output-error") return /* @__PURE__ */ jsx(ActivityPanel, {
@@ -364,4 +409,4 @@ function getBashStatusText(output, errorText, deniedReason) {
364
409
  return "success";
365
410
  }
366
411
  //#endregion
367
- export { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel };
412
+ export { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSessionContextPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel };
@@ -1,2 +1,2 @@
1
- import { _ as isThinkChatActivityPart, a as ThinkBashToolOutput, c as ThinkWorkspaceToolName, d as isBrowserToolPart, f as isExecuteToolPart, g as isSkillToolPart, h as isPartWorking, i as SkillToolPart, l as WorkspaceToolPart, m as isPartFailed, n as ExecuteToolPart, o as ThinkBashToolPart, p as isFetchToolPart, r as FetchToolPart, s as ThinkChatPart, t as BrowserToolPart, u as displayUrl, v as isWorkspaceToolPart } from "../ThinkChatToolParts-Cv4o7j6F.js";
2
- export { BrowserToolPart, ExecuteToolPart, FetchToolPart, SkillToolPart, ThinkBashToolOutput, ThinkBashToolPart, ThinkChatPart, ThinkWorkspaceToolName, WorkspaceToolPart, displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart };
1
+ import { S as isWorkspaceToolPart, _ as isPartWorking, a as SessionContextToolPart, b as isSkillToolPart, c as ThinkBashToolPart, d as WorkspaceToolPart, f as displayUrl, g as isPartFailed, h as isFetchToolPart, i as SessionContextToolName, l as ThinkChatPart, m as isExecuteToolPart, n as ExecuteToolPart, o as SkillToolPart, p as isBrowserToolPart, r as FetchToolPart, s as ThinkBashToolOutput, t as BrowserToolPart, u as ThinkWorkspaceToolName, v as isSessionContextToolFailure, x as isThinkChatActivityPart, y as isSessionContextToolPart } from "../ThinkChatToolParts-CDEjqS6A.js";
2
+ export { BrowserToolPart, ExecuteToolPart, FetchToolPart, SessionContextToolName, SessionContextToolPart, SkillToolPart, ThinkBashToolOutput, ThinkBashToolPart, ThinkChatPart, ThinkWorkspaceToolName, WorkspaceToolPart, displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart };
@@ -22,6 +22,22 @@ const SKILL_TOOL_NAMES = /* @__PURE__ */ new Set([
22
22
  function isSkillToolPart(part) {
23
23
  return isStaticToolUIPart(part) && SKILL_TOOL_NAMES.has(getStaticToolName(part));
24
24
  }
25
+ const SESSION_CONTEXT_TOOL_NAMES = /* @__PURE__ */ new Set([
26
+ "set_context",
27
+ "load_context",
28
+ "unload_context",
29
+ "search_context",
30
+ "session_search"
31
+ ]);
32
+ function isSessionContextToolPart(part) {
33
+ return isStaticToolUIPart(part) && SESSION_CONTEXT_TOOL_NAMES.has(getStaticToolName(part));
34
+ }
35
+ /** Session tools report provider failures as successful string outputs so the
36
+ model can recover. Treat that upstream `Error:` envelope as failed UI while
37
+ preserving the recorded tool state and output verbatim. */
38
+ function isSessionContextToolFailure(part) {
39
+ return isPartFailed(part) || part.state === "output-available" && part.output.startsWith("Error:");
40
+ }
25
41
  function isFetchToolPart(part) {
26
42
  return isStaticToolUIPart(part) && getStaticToolName(part).startsWith("fetch_");
27
43
  }
@@ -63,4 +79,4 @@ function displayUrl(url) {
63
79
  return url ? url.replace(/^https?:\/\//, "") : "";
64
80
  }
65
81
  //#endregion
66
- export { displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart };
82
+ export { displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart };
@@ -4,7 +4,7 @@ import { Separator } from "./Separator.js";
4
4
  import { Button } from "./Button.js";
5
5
  import { Tooltip } from "./Tooltip.js";
6
6
  import { ToggleGroup } from "./ToggleGroup.js";
7
- import { o as useThinkPendingApprovals, s as resolveThinkApprovalProps, t as ThinkChat } from "../ThinkChat-7DQ2CogF.js";
7
+ import { o as useThinkPendingApprovals, s as resolveThinkApprovalProps, t as ThinkChat } from "../ThinkChat-BPcehdbP.js";
8
8
  import { WorkspaceExplorer, useWorkspace } from "./WorkspaceExplorer.js";
9
9
  import { ThinkExecutionWorkbench } from "./ThinkExecutionWorkbench.js";
10
10
  import { ThinkThreadShell } from "./ThinkThreadShell.js";
@@ -4,11 +4,15 @@
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
  width: 100%;
7
+ min-width: 0;
7
8
  /* Hard cap, Codex-style, on the WHOLE unit — collapsed line and expanded
8
9
  log alike — so toggling never reflows the conversation width. Plain rem,
9
10
  not min(100%, …): percentages are ignored in intrinsic-size contributions,
10
11
  so the min() let wide nowrap rows inflate content-sized ancestors. */
11
12
  max-width: 36rem;
13
+ /* Live tool labels and panels must never contribute a wider intrinsic size
14
+ when Activity is inserted into a narrow chat transcript. */
15
+ contain: inline-size;
12
16
  /* Whitespace separates the work log from message prose around it */
13
17
  margin-block: 0.5rem;
14
18
  font-family: inherit;
@@ -17,6 +21,8 @@
17
21
 
18
22
  .activity__trigger {
19
23
  display: flex;
24
+ width: 100%;
25
+ min-width: 0;
20
26
  align-items: center;
21
27
  gap: var(--sigvelo-spacing-1-5);
22
28
  padding-block: var(--sigvelo-spacing-1-5);
@@ -3,6 +3,7 @@
3
3
  position: relative;
4
4
  width: 100%;
5
5
  height: 100%;
6
+ min-width: 0;
6
7
  min-height: 0;
7
8
  background-color: var(--sigvelo-color-surface);
8
9
  color: var(--sigvelo-color-text);
@@ -10,6 +11,7 @@
10
11
  }
11
12
 
12
13
  .agent-chat__conversation {
14
+ min-width: 0;
13
15
  height: 100%;
14
16
  min-height: 0;
15
17
  }
@@ -18,12 +20,18 @@
18
20
  --agent-chat-composer-size is set from a ResizeObserver in AgentChat. */
19
21
  .agent-chat__transcript-content {
20
22
  gap: 0.875rem;
23
+ min-inline-size: 0;
24
+ max-inline-size: 100%;
21
25
  inline-size: min(100%, var(--agent-chat-content-max-inline-size));
22
26
  margin-inline: auto;
23
27
  padding-block: 1rem calc(var(--agent-chat-composer-size, 5rem) + 0.5rem);
24
28
  padding-inline: 1rem;
25
29
  }
26
30
 
31
+ .agent-chat[data-composer-hidden] .agent-chat__transcript-content {
32
+ padding-block-end: var(--sigvelo-spacing-4);
33
+ }
34
+
27
35
  .agent-chat__empty-row {
28
36
  display: flex;
29
37
  flex: 1;
@@ -35,7 +43,13 @@
35
43
  }
36
44
 
37
45
  .agent-chat__scroll-button {
38
- inset-block-end: calc(var(--agent-chat-composer-size, 5rem) + 0.5rem);
46
+ --message-scroller-button-inset-block-end: calc(
47
+ var(--agent-chat-composer-size, 5rem) + var(--sigvelo-spacing-2)
48
+ );
49
+ }
50
+
51
+ .agent-chat[data-composer-hidden] .agent-chat__scroll-button {
52
+ --message-scroller-button-inset-block-end: var(--sigvelo-spacing-2);
39
53
  }
40
54
 
41
55
  /* Floating over the transcript: solid behind the controls, fading out
@@ -83,6 +83,7 @@
83
83
  @import "./queue.css" layer(components);
84
84
  @import "./reasoning.css" layer(components);
85
85
  @import "./sources.css" layer(components);
86
+ @import "./subagent-run.css" layer(components);
86
87
  @import "./task.css" layer(components);
87
88
  @import "./terminal.css" layer(components);
88
89
  @import "./test-results.css" layer(components);
@@ -60,7 +60,7 @@
60
60
  .message-scroller__button {
61
61
  position: absolute;
62
62
  inset-inline-start: 50%;
63
- inset-block-end: 1rem;
63
+ inset-block-end: var(--message-scroller-button-inset-block-end, 1rem);
64
64
  z-index: 1;
65
65
  translate: -50% 0;
66
66
  border-radius: 999rem;
@@ -3,6 +3,7 @@
3
3
  flex-direction: column;
4
4
  gap: 0.25rem;
5
5
  width: 100%;
6
+ min-width: 0;
6
7
  font-family: inherit;
7
8
  color: var(--sigvelo-color-text);
8
9
  }
@@ -20,6 +21,7 @@
20
21
  .message__content {
21
22
  display: inline-block;
22
23
  max-width: min(42rem, 85%);
24
+ min-width: 0;
23
25
  padding-block: 0.5rem;
24
26
  padding-inline: var(--sigvelo-spacing-3);
25
27
  border-radius: var(--sigvelo-radius-lg);
@@ -5,6 +5,22 @@
5
5
  line-height: 0;
6
6
  }
7
7
 
8
+ .nanite-mark {
9
+ display: inline-flex;
10
+ flex: 0 0 auto;
11
+ inline-size: 1.25rem;
12
+ block-size: 1.5rem;
13
+ align-items: center;
14
+ justify-content: center;
15
+ line-height: 0;
16
+ }
17
+
18
+ .nanite-mark svg {
19
+ display: block;
20
+ inline-size: 100%;
21
+ block-size: 100%;
22
+ }
23
+
8
24
  .nanite-scene--trio {
9
25
  inline-size: 200px;
10
26
  block-size: 68px;
@@ -21,6 +21,16 @@
21
21
  overflow-wrap: anywhere;
22
22
  }
23
23
 
24
+ .message[data-from="user"] [data-streamdown="link"] {
25
+ color: var(--sigvelo-color-primary-text-on-bg);
26
+ }
27
+
28
+ [data-streamdown="link"]:focus-visible {
29
+ outline: var(--sigvelo-focus-width) solid currentColor;
30
+ outline-offset: var(--sigvelo-focus-offset);
31
+ border-radius: var(--sigvelo-radius-xs);
32
+ }
33
+
24
34
  /* Links render as <button> when link safety is enabled. */
25
35
  button[data-streamdown="link"] {
26
36
  appearance: none;
@@ -0,0 +1,188 @@
1
+ .subagent-run {
2
+ display: inline-flex;
3
+ flex-direction: column;
4
+ max-inline-size: 100%;
5
+ color: var(--sigvelo-color-text);
6
+ font-family: inherit;
7
+ }
8
+
9
+ .subagent-run__trigger {
10
+ display: flex;
11
+ align-items: safe center;
12
+ gap: var(--sigvelo-spacing-1-5);
13
+ min-block-size: var(--sigvelo-control-height-md);
14
+ max-inline-size: 18rem;
15
+ padding-block: var(--sigvelo-spacing-1);
16
+ padding-inline: var(--sigvelo-spacing-2-5);
17
+ border: var(--sigvelo-border-style) var(--sigvelo-border-width)
18
+ var(--sigvelo-color-neutral-border-subtle);
19
+ border-radius: var(--sigvelo-radius-full);
20
+ background-color: var(--sigvelo-color-surface);
21
+ color: var(--sigvelo-color-text);
22
+ font: inherit;
23
+ text-align: start;
24
+ cursor: pointer;
25
+ transition:
26
+ background-color var(--sigvelo-duration-fast) var(--sigvelo-ease-standard),
27
+ border-color var(--sigvelo-duration-fast) var(--sigvelo-ease-standard);
28
+ }
29
+
30
+ .subagent-run__trigger:hover:not([data-disabled]) {
31
+ background-color: var(--sigvelo-color-neutral-bg-subtle);
32
+ border-color: var(--sigvelo-color-neutral-border-muted);
33
+ }
34
+
35
+ .subagent-run__trigger:focus-visible {
36
+ outline: none;
37
+ box-shadow: var(--sigvelo-recipe-focus-shadow);
38
+ }
39
+
40
+ .subagent-run__trigger[data-panel-open],
41
+ .subagent-run__trigger[aria-pressed="true"] {
42
+ border-color: var(--sigvelo-color-neutral-border-muted);
43
+ background-color: var(--sigvelo-color-neutral-bg-subtle);
44
+ }
45
+
46
+ .subagent-run__trigger[aria-pressed="true"] {
47
+ box-shadow: inset 0 0 0 var(--sigvelo-border-width) var(--sigvelo-color-neutral-border-subtle);
48
+ }
49
+
50
+ .subagent-run__trigger-content {
51
+ display: flex;
52
+ align-items: safe center;
53
+ flex: 1 1 0;
54
+ gap: var(--sigvelo-spacing-1-5);
55
+ min-inline-size: 0;
56
+ }
57
+
58
+ .subagent-run__trigger[data-slot="subagent-run-trigger"] .subagent-run__trigger-content {
59
+ align-items: stretch;
60
+ flex-direction: column;
61
+ gap: 0;
62
+ }
63
+
64
+ .subagent-run__heading {
65
+ display: flex;
66
+ align-items: safe center;
67
+ flex-wrap: nowrap;
68
+ gap: var(--sigvelo-spacing-1-5);
69
+ min-inline-size: 0;
70
+ }
71
+
72
+ .subagent-run__title {
73
+ min-inline-size: 0;
74
+ overflow: hidden;
75
+ color: var(--sigvelo-color-text);
76
+ font-size: var(--sigvelo-text-sm);
77
+ font-weight: var(--sigvelo-font-weight-semibold);
78
+ text-overflow: ellipsis;
79
+ white-space: nowrap;
80
+ }
81
+
82
+ .subagent-run__description {
83
+ display: block;
84
+ overflow: hidden;
85
+ color: var(--sigvelo-color-text-muted);
86
+ font-size: var(--sigvelo-text-compact);
87
+ line-height: 1.5;
88
+ text-overflow: ellipsis;
89
+ white-space: nowrap;
90
+ }
91
+
92
+ .subagent-run__description:empty {
93
+ display: none;
94
+ }
95
+
96
+ .subagent-run__status {
97
+ max-inline-size: 100%;
98
+ }
99
+
100
+ .subagent-run__content-inner {
101
+ display: flex;
102
+ flex-direction: column;
103
+ gap: var(--sigvelo-spacing-3);
104
+ padding-block: var(--sigvelo-spacing-3);
105
+ min-inline-size: min(30rem, calc(100vw - var(--sigvelo-spacing-8)));
106
+ margin-block-start: var(--sigvelo-spacing-2);
107
+ padding-inline: var(--sigvelo-spacing-3);
108
+ border: var(--sigvelo-border-style) var(--sigvelo-border-width)
109
+ var(--sigvelo-color-neutral-border-subtle);
110
+ border-radius: var(--sigvelo-radius-lg);
111
+ background-color: var(--sigvelo-color-surface);
112
+ }
113
+
114
+ .subagent-run__progress {
115
+ display: grid;
116
+ gap: var(--sigvelo-spacing-1-5);
117
+ }
118
+
119
+ .subagent-run__progress-label {
120
+ display: flex;
121
+ justify-content: space-between;
122
+ gap: var(--sigvelo-spacing-3);
123
+ color: var(--sigvelo-color-text-muted);
124
+ font-size: var(--sigvelo-text-xs);
125
+ line-height: 1.5;
126
+ }
127
+
128
+ .subagent-run__progress-label > :first-child {
129
+ min-inline-size: 0;
130
+ overflow-wrap: anywhere;
131
+ }
132
+
133
+ .subagent-run__progress-label > :last-child {
134
+ flex: 0 0 auto;
135
+ font-variant-numeric: tabular-nums;
136
+ }
137
+
138
+ .subagent-run__milestones {
139
+ display: grid;
140
+ gap: var(--sigvelo-spacing-1-5);
141
+ margin: 0;
142
+ padding: 0;
143
+ list-style: none;
144
+ }
145
+
146
+ .subagent-run__milestone {
147
+ display: flex;
148
+ align-items: baseline;
149
+ gap: var(--sigvelo-spacing-2);
150
+ color: var(--sigvelo-color-text-muted);
151
+ font-size: var(--sigvelo-text-compact);
152
+ line-height: 1.5;
153
+ }
154
+
155
+ .subagent-run__milestone::before {
156
+ content: "";
157
+ flex: 0 0 auto;
158
+ inline-size: var(--sigvelo-spacing-1-5);
159
+ block-size: var(--sigvelo-spacing-1-5);
160
+ border: var(--sigvelo-border-style) var(--sigvelo-border-width)
161
+ var(--sigvelo-color-neutral-border-muted);
162
+ border-radius: var(--sigvelo-radius-full);
163
+ background-color: var(--sigvelo-color-neutral-bg-subtle);
164
+ }
165
+
166
+ .subagent-run__actions {
167
+ display: flex;
168
+ flex-wrap: wrap;
169
+ gap: var(--sigvelo-spacing-2);
170
+ justify-content: flex-end;
171
+ }
172
+
173
+ @media (forced-colors: active) {
174
+ .subagent-run__trigger,
175
+ .subagent-run__content-inner {
176
+ border-color: CanvasText;
177
+ }
178
+
179
+ .subagent-run__trigger:focus-visible {
180
+ outline: 2px solid Highlight;
181
+ outline-offset: 2px;
182
+ box-shadow: none;
183
+ }
184
+
185
+ .subagent-run__milestone::before {
186
+ border-color: CanvasText;
187
+ }
188
+ }
@@ -46,6 +46,7 @@
46
46
  min-inline-size: 0;
47
47
  min-block-size: 0;
48
48
  display: grid;
49
+ grid-template-columns: minmax(0, 1fr);
49
50
  grid-template-rows: minmax(0, 1fr);
50
51
  overflow: hidden;
51
52
  background: var(--sigvelo-color-surface);
@@ -57,6 +58,7 @@
57
58
  min-inline-size: 0;
58
59
  min-block-size: 0;
59
60
  display: grid;
61
+ grid-template-columns: minmax(0, 1fr);
60
62
  grid-template-rows: minmax(0, 1fr);
61
63
  overflow: hidden;
62
64
  }
@@ -108,6 +108,7 @@
108
108
  }
109
109
 
110
110
  .workspace-explorer__tree .file-tree__name {
111
+ flex: 0 1 auto;
111
112
  line-height: 1.4;
112
113
  }
113
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-b/react-components",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
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": {
@@ -53,7 +53,7 @@
53
53
  "lucide-react": "^1.23.0",
54
54
  "shiki": "^3.23.0",
55
55
  "streamdown": "^2.5.0",
56
- "@mcp-b/design-tokens": "0.14.0"
56
+ "@mcp-b/design-tokens": "0.14.2"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@ai-sdk/react": "^3.0.222",