@mcp-b/react-components 0.6.5 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/AgentChat-403mckDG.d.ts +101 -0
  2. package/dist/BrowserLiveView-ZktFZiMD.d.ts +47 -0
  3. package/dist/BrowserReplay-6G-mnwcn.d.ts +40 -0
  4. package/dist/{CodeBlock-BK0sOAbV.js → CodeBlock-D9koxDA7.js} +1 -1
  5. package/dist/{FileTree-BWQZ0FSi.js → FileTree-BdK93Uuu.js} +1 -1
  6. package/dist/ModelSelector-MQvK-pNb.js +306 -0
  7. package/dist/PromptInput-D6-G24p7.d.ts +528 -0
  8. package/dist/ThinkChatActivity-CeHzk6-K.d.ts +73 -0
  9. package/dist/ThinkChatContext-CC94HL4u.d.ts +28 -0
  10. package/dist/ThinkChatToolParts-DnUiZgCC.d.ts +83 -0
  11. package/dist/components/Activity.js +1 -1
  12. package/dist/components/AgentChat.d.ts +1 -103
  13. package/dist/components/AgentChat.js +77 -58
  14. package/dist/components/AgentConnection.d.ts +43 -2
  15. package/dist/components/AgentConnection.js +154 -3
  16. package/dist/components/Artifact.js +1 -1
  17. package/dist/components/BrowserLiveView.d.ts +1 -46
  18. package/dist/components/BrowserLiveView.js +1 -1
  19. package/dist/components/BrowserReplay.d.ts +1 -39
  20. package/dist/components/BrowserReplay.js +1 -1
  21. package/dist/components/ChainOfThought.d.ts +1 -1
  22. package/dist/components/ChainOfThought.js +1 -1
  23. package/dist/components/ChatGptSignInScreen.d.ts +38 -0
  24. package/dist/components/ChatGptSignInScreen.js +201 -0
  25. package/dist/components/CodeBlock.js +1 -1
  26. package/dist/components/Commit.js +1 -1
  27. package/dist/components/Context.d.ts +6 -10
  28. package/dist/components/Context.js +4 -2
  29. package/dist/components/ContextMenu.js +1 -1
  30. package/dist/components/Conversation.d.ts +28 -28
  31. package/dist/components/Conversation.js +36 -55
  32. package/dist/components/Dialog.js +1 -1
  33. package/dist/components/EnvironmentVariables.js +1 -1
  34. package/dist/components/FileTree.js +1 -1
  35. package/dist/components/Marker.d.ts +57 -0
  36. package/dist/components/Marker.js +89 -0
  37. package/dist/components/McpServerPicker.js +1 -1
  38. package/dist/components/Menubar.js +1 -1
  39. package/dist/components/Message.js +1 -1
  40. package/dist/components/MessageScroller.d.ts +52 -0
  41. package/dist/components/MessageScroller.js +62 -0
  42. package/dist/components/ModelSelector.js +1 -305
  43. package/dist/components/NavigationMenu.js +1 -1
  44. package/dist/components/PromptInput.d.ts +2 -534
  45. package/dist/components/PromptInput.js +18 -12
  46. package/dist/components/Queue.js +1 -1
  47. package/dist/components/Reasoning.js +1 -1
  48. package/dist/components/Select.js +1 -1
  49. package/dist/components/Sources.js +1 -1
  50. package/dist/components/Stepper.js +1 -1
  51. package/dist/components/Task.js +1 -1
  52. package/dist/components/Terminal.js +2 -2
  53. package/dist/components/TestResults.js +1 -1
  54. package/dist/components/ThinkChat.d.ts +23 -80
  55. package/dist/components/ThinkChat.js +60 -857
  56. package/dist/components/ThinkChatActivity.d.ts +3 -0
  57. package/dist/components/ThinkChatActivity.js +429 -0
  58. package/dist/components/ThinkChatContext.d.ts +2 -0
  59. package/dist/components/ThinkChatContext.js +10 -0
  60. package/dist/components/ThinkChatToolPanels.d.ts +39 -0
  61. package/dist/components/ThinkChatToolPanels.js +355 -0
  62. package/dist/components/ThinkChatToolParts.d.ts +2 -0
  63. package/dist/components/ThinkChatToolParts.js +66 -0
  64. package/dist/components/ThinkFullApp.d.ts +23 -0
  65. package/dist/components/ThinkFullApp.js +175 -0
  66. package/dist/components/WebPreview.js +1 -1
  67. package/dist/components/WorkspaceExplorer.d.ts +1 -1
  68. package/dist/components/WorkspaceExplorer.js +3 -3
  69. package/dist/components/icons.d.ts +2 -2
  70. package/dist/components/icons.js +2 -2
  71. package/dist/components/useStickToBottom.d.ts +5 -2
  72. package/dist/components/useStickToBottom.js +5 -2
  73. package/dist/{copy-button-CB2MWcau.js → copy-button-TVhDAroI.js} +1 -1
  74. package/dist/{icons-BCNawx-T.js → icons-BAlTbWWP.js} +27 -1
  75. package/dist/{icons-BYpJY6L2.d.ts → icons-BRI54ATJ.d.ts} +2 -1
  76. package/dist/styles/agent-chat.css +15 -3
  77. package/dist/styles/agent-connection.css +33 -4
  78. package/dist/styles/chatgpt-sign-in-screen.css +224 -0
  79. package/dist/styles/code-block.css +6 -4
  80. package/dist/styles/conversation.css +10 -0
  81. package/dist/styles/index.css +4 -0
  82. package/dist/styles/marker.css +95 -0
  83. package/dist/styles/message-scroller.css +113 -0
  84. package/dist/styles/message.css +2 -1
  85. package/dist/styles/prompt-input.css +1 -0
  86. package/dist/styles/scrollbars.css +10 -2
  87. package/dist/styles/streamdown.css +2 -0
  88. package/dist/styles/think-full-app.css +318 -0
  89. package/dist/utils/mcp-server-catalog.d.ts +23 -1
  90. package/dist/utils/mcp-server-catalog.js +27 -1
  91. package/package.json +3 -2
@@ -1,47 +1,2 @@
1
- import * as React from "react";
2
-
3
- //#region src/components/BrowserLiveView.d.ts
4
- interface BrowserLiveViewProps extends React.HTMLAttributes<HTMLDivElement> {
5
- /** Live View URL (Browser Run `devtoolsFrontendUrl`, e.g. live.browser.run). */
6
- url: string;
7
- /** Epoch ms after which the URL is dead (Browser Run mints ~5-minute links). */
8
- expiresAt?: number;
9
- /** The page the session was showing — used for the ended-state text. */
10
- pageTitle?: string;
11
- /**
12
- * Shown once the link expires — pass the last screenshot the agent took
13
- * (`<img>`) to keep the final frame on screen. Defaults to a quiet
14
- * "Live view ended" state.
15
- */
16
- fallback?: React.ReactNode;
17
- }
18
- /**
19
- * Embeds a Browser Run Live View — a real-time, interactive view of the
20
- * agent's browser session. Links expire (~5 minutes), so the iframe swaps to
21
- * `fallback` (e.g. the last screenshot) once `expiresAt` passes. While the
22
- * hosted viewer connects, a quiet loading overlay hides the frame; if it
23
- * never loads, the view degrades to `fallback` or an unavailable state. An
24
- * expand button opens the same view in a fullscreen dialog.
25
- *
26
- * Where URLs come from (upstream: `agents/browser` in
27
- * github.com/cloudflare/agents — `BrowserLiveViewUrl`): the model calls
28
- * `cdp.getLiveViewUrl()` inside a `browser_execute` tool run, or the host
29
- * calls `connector.liveView()`/`sessionInfo()`. This package's chat rendering
30
- * derives the component automatically from links found in tool results.
31
- *
32
- * Styling rides `@mcp-b/react-components/styles` (browser-live-view.css),
33
- * which think-chat consumers load anyway.
34
- *
35
- * The iframe is unsandboxed by design: the hosted Live View UI needs scripts
36
- * and its own origin to stream the session. Only pass trusted Live View URLs.
37
- */
38
- declare function BrowserLiveView({
39
- url,
40
- expiresAt,
41
- pageTitle,
42
- fallback,
43
- className,
44
- ...props
45
- }: BrowserLiveViewProps): React.JSX.Element;
46
- //#endregion
1
+ import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../BrowserLiveView-ZktFZiMD.js";
47
2
  export { BrowserLiveView, BrowserLiveViewProps };
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { A as SpinnerIcon, b as MaximizeIcon } from "../icons-BCNawx-T.js";
2
+ import { j as SpinnerIcon, x as MaximizeIcon } from "../icons-BAlTbWWP.js";
3
3
  import { Button } from "./Button.js";
4
4
  import { Dialog, DialogContent, DialogTitle } from "./Dialog.js";
5
5
  import { Badge } from "./Badge.js";
@@ -1,40 +1,2 @@
1
- import * as React from "react";
2
-
3
- //#region src/components/BrowserReplay.d.ts
4
- interface BrowserReplayProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
5
- /**
6
- * rrweb events for one tab, e.g. one
7
- * `BrowserRecording.events[targetId]` entry from Cloudflare Browser Run.
8
- */
9
- events: unknown[];
10
- /** Start playing on mount. */
11
- autoPlay?: boolean;
12
- }
13
- /**
14
- * Replays a completed Cloudflare Browser Run recording locally with rrweb.
15
- *
16
- * This is intentionally not derived from Think chat message parts. Live view
17
- * links and screenshots ride the `browser_execute` stream and belong to
18
- * `BrowserLiveView`; replay events are fetched after a session closes with
19
- * Browser Run's `getBrowserRecording()`. Upstream currently shapes those
20
- * recordings as `Record<targetId, unknown[]>`, where each array is plain rrweb
21
- * JSON for one tab. Playback happens in the viewer's browser through
22
- * `@rrweb/replay`; no replay service is contacted at playback time.
23
- *
24
- * Styling rides `@mcp-b/react-components/styles` (browser-replay.css), which
25
- * think-chat consumers load anyway.
26
- *
27
- * @see https://github.com/cloudflare/agents/tree/main/packages/agents/src/browser
28
- * @see https://github.com/rrweb-io/rrweb/tree/main/packages/%40rrweb/replay
29
- */
30
- declare function BrowserReplay({
31
- className,
32
- events,
33
- autoPlay,
34
- ref,
35
- ...props
36
- }: BrowserReplayProps & {
37
- ref?: React.Ref<HTMLDivElement>;
38
- }): React.JSX.Element;
39
- //#endregion
1
+ import { n as BrowserReplayProps, t as BrowserReplay } from "../BrowserReplay-6G-mnwcn.js";
40
2
  export { BrowserReplay, BrowserReplayProps };
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { E as PlayIcon, w as PauseIcon } from "../icons-BCNawx-T.js";
2
+ import { D as PlayIcon, T as PauseIcon } from "../icons-BAlTbWWP.js";
3
3
  import { Button } from "./Button.js";
4
4
  import { Slider, SliderControl, SliderIndicator, SliderThumb, SliderTrack } from "./Slider.js";
5
5
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  import { CollapsiblePanelProps, CollapsibleRootProps, CollapsibleTriggerProps } from "./Collapsible.js";
2
- import { _ as IconProps } from "../icons-BYpJY6L2.js";
2
+ import { v as IconProps } from "../icons-BRI54ATJ.js";
3
3
  import * as React from "react";
4
4
 
5
5
  //#region src/components/ChainOfThought.d.ts
@@ -1,6 +1,6 @@
1
1
  import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
2
2
  import { t as cx } from "../class-names-9UtZwb0J.js";
3
- import { A as SpinnerIcon, a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-BCNawx-T.js";
3
+ import { a as CheckIcon, c as ChevronRightIcon, j as SpinnerIcon, u as DotIcon } from "../icons-BAlTbWWP.js";
4
4
  import "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/ChainOfThought.tsx
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+
3
+ //#region src/components/ChatGptSignInScreen.d.ts
4
+ interface ChatGptSignInScreenProps extends React.HTMLAttributes<HTMLElement> {
5
+ /** Whether the sign-in request is currently opening ChatGPT. */
6
+ busy?: boolean;
7
+ /** Shows the sign-in action in its error state. */
8
+ error?: boolean;
9
+ /** Button label for the ChatGPT sign-in action. */
10
+ label?: string;
11
+ /** Main heading shown above the sign-in button. */
12
+ title?: string;
13
+ /** Brand name displayed under the heading. */
14
+ brandName?: string;
15
+ /** Brand mark displayed next to the brand name. */
16
+ brandLogo?: React.ReactNode;
17
+ /** Called when the user clicks the sign-in action. */
18
+ onSignIn?: () => void;
19
+ }
20
+ /** Full-screen ChatGPT authentication prompt for MCP-B onboarding. */
21
+ declare function ChatGptSignInScreen({
22
+ busy,
23
+ error,
24
+ label,
25
+ title,
26
+ brandName,
27
+ brandLogo,
28
+ className,
29
+ onPointerLeave,
30
+ onPointerMove,
31
+ onSignIn,
32
+ ref,
33
+ ...props
34
+ }: ChatGptSignInScreenProps & {
35
+ ref?: React.Ref<HTMLElement>;
36
+ }): React.JSX.Element;
37
+ //#endregion
38
+ export { ChatGptSignInScreen, ChatGptSignInScreenProps };
@@ -0,0 +1,201 @@
1
+ import { t as cx } from "../class-names-9UtZwb0J.js";
2
+ import { j as SpinnerIcon } from "../icons-BAlTbWWP.js";
3
+ import { Button } from "./Button.js";
4
+ import { l as ModelSelectorLogo } from "../ModelSelector-MQvK-pNb.js";
5
+ import "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/ChatGptSignInScreen.tsx
8
+ /** Full-screen ChatGPT authentication prompt for MCP-B onboarding. */
9
+ function ChatGptSignInScreen({ busy = false, error = false, label = "Sign in with ChatGPT", title = "Welcome to MCP-B", brandName = "SigVelo", brandLogo = /* @__PURE__ */ jsx(SigVeloMark, {}), className, onPointerLeave, onPointerMove, onSignIn, ref, ...props }) {
10
+ const handlePointerMove = (event) => {
11
+ onPointerMove?.(event);
12
+ setPointerPosition(event.currentTarget, event, "chatgpt-sign-in-pointer");
13
+ event.currentTarget.dataset.pointerActive = "true";
14
+ };
15
+ const handlePointerLeave = (event) => {
16
+ onPointerLeave?.(event);
17
+ delete event.currentTarget.dataset.pointerActive;
18
+ };
19
+ const handleButtonPointerMove = (event) => {
20
+ setPointerPosition(event.currentTarget, event, "chatgpt-sign-in-button");
21
+ };
22
+ return /* @__PURE__ */ jsx("main", {
23
+ ref,
24
+ className: cx("chatgpt-sign-in", className),
25
+ "aria-label": "ChatGPT authentication",
26
+ onPointerLeave: handlePointerLeave,
27
+ onPointerMove: handlePointerMove,
28
+ ...props,
29
+ children: /* @__PURE__ */ jsxs("div", {
30
+ className: "chatgpt-sign-in__panel",
31
+ children: [/* @__PURE__ */ jsxs("div", {
32
+ className: "chatgpt-sign-in__brand",
33
+ children: [/* @__PURE__ */ jsx("h1", { children: title }), /* @__PURE__ */ jsxs("p", { children: [
34
+ "by ",
35
+ brandLogo ? /* @__PURE__ */ jsx("span", {
36
+ className: "chatgpt-sign-in__brand-mark",
37
+ children: brandLogo
38
+ }) : null,
39
+ /* @__PURE__ */ jsx("span", { children: brandName })
40
+ ] })]
41
+ }), /* @__PURE__ */ jsxs(Button, {
42
+ type: "button",
43
+ variant: "default",
44
+ color: error ? "destructive" : "primary",
45
+ size: "lg",
46
+ className: "chatgpt-sign-in__button",
47
+ "data-busy": busy ? "true" : void 0,
48
+ disabled: busy,
49
+ onClick: onSignIn,
50
+ onPointerMove: handleButtonPointerMove,
51
+ children: [/* @__PURE__ */ jsx("span", {
52
+ className: "chatgpt-sign-in__button-icon",
53
+ children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, { size: 16 }) : /* @__PURE__ */ jsx(ModelSelectorLogo, {
54
+ provider: "openai",
55
+ className: "chatgpt-sign-in__logo"
56
+ })
57
+ }), /* @__PURE__ */ jsx("span", {
58
+ className: "chatgpt-sign-in__button-label",
59
+ children: label
60
+ })]
61
+ })]
62
+ })
63
+ });
64
+ }
65
+ function setPointerPosition(element, event, name) {
66
+ const rect = element.getBoundingClientRect();
67
+ if (rect.width === 0 || rect.height === 0) return;
68
+ element.style.setProperty(`--${name}-x`, `${(event.clientX - rect.left) / rect.width * 100}%`);
69
+ element.style.setProperty(`--${name}-y`, `${(event.clientY - rect.top) / rect.height * 100}%`);
70
+ }
71
+ function SigVeloMark() {
72
+ return /* @__PURE__ */ jsxs("svg", {
73
+ viewBox: "430 310 360 400",
74
+ fill: "none",
75
+ "aria-hidden": "true",
76
+ focusable: "false",
77
+ children: [
78
+ /* @__PURE__ */ jsxs("defs", { children: [/* @__PURE__ */ jsxs("linearGradient", {
79
+ id: "chatgpt-sign-in-mark-a",
80
+ x1: "756.23",
81
+ y1: "475.14",
82
+ x2: "608.29",
83
+ y2: "352.58",
84
+ gradientUnits: "userSpaceOnUse",
85
+ children: [
86
+ /* @__PURE__ */ jsx("stop", {
87
+ offset: "0",
88
+ stopColor: "#00ebff"
89
+ }),
90
+ /* @__PURE__ */ jsx("stop", {
91
+ offset: ".17",
92
+ stopColor: "#00e7fe"
93
+ }),
94
+ /* @__PURE__ */ jsx("stop", {
95
+ offset: ".32",
96
+ stopColor: "#01dcfd"
97
+ }),
98
+ /* @__PURE__ */ jsx("stop", {
99
+ offset: ".46",
100
+ stopColor: "#04cbfa"
101
+ }),
102
+ /* @__PURE__ */ jsx("stop", {
103
+ offset: ".59",
104
+ stopColor: "#08b2f6"
105
+ }),
106
+ /* @__PURE__ */ jsx("stop", {
107
+ offset: ".72",
108
+ stopColor: "#0c91f2"
109
+ }),
110
+ /* @__PURE__ */ jsx("stop", {
111
+ offset: ".85",
112
+ stopColor: "#1269ec"
113
+ }),
114
+ /* @__PURE__ */ jsx("stop", {
115
+ offset: ".98",
116
+ stopColor: "#183be6"
117
+ }),
118
+ /* @__PURE__ */ jsx("stop", {
119
+ offset: "1",
120
+ stopColor: "#1a32e5"
121
+ })
122
+ ]
123
+ }), /* @__PURE__ */ jsxs("linearGradient", {
124
+ id: "chatgpt-sign-in-mark-b",
125
+ x1: "452.57",
126
+ y1: "524.29",
127
+ x2: "583.8",
128
+ y2: "641.28",
129
+ gradientUnits: "userSpaceOnUse",
130
+ children: [
131
+ /* @__PURE__ */ jsx("stop", {
132
+ offset: "0",
133
+ stopColor: "#00ebff"
134
+ }),
135
+ /* @__PURE__ */ jsx("stop", {
136
+ offset: ".24",
137
+ stopColor: "#00e8ff"
138
+ }),
139
+ /* @__PURE__ */ jsx("stop", {
140
+ offset: ".38",
141
+ stopColor: "#00e0ff"
142
+ }),
143
+ /* @__PURE__ */ jsx("stop", {
144
+ offset: ".5",
145
+ stopColor: "#00d1ff"
146
+ }),
147
+ /* @__PURE__ */ jsx("stop", {
148
+ offset: ".61",
149
+ stopColor: "#00bdff"
150
+ }),
151
+ /* @__PURE__ */ jsx("stop", {
152
+ offset: ".71",
153
+ stopColor: "#00a3ff"
154
+ }),
155
+ /* @__PURE__ */ jsx("stop", {
156
+ offset: ".8",
157
+ stopColor: "#0082ff"
158
+ }),
159
+ /* @__PURE__ */ jsx("stop", {
160
+ offset: ".88",
161
+ stopColor: "#005cff"
162
+ }),
163
+ /* @__PURE__ */ jsx("stop", {
164
+ offset: ".96",
165
+ stopColor: "#0030ff"
166
+ }),
167
+ /* @__PURE__ */ jsx("stop", {
168
+ offset: "1",
169
+ stopColor: "#0118ff"
170
+ })
171
+ ]
172
+ })] }),
173
+ /* @__PURE__ */ jsx("path", {
174
+ fill: "url(#chatgpt-sign-in-mark-a)",
175
+ d: "M746.99,482.75l-145.57-84.52,60.02-34.87,71.05,41.28c8.95,5.2,14.47,14.78,14.47,25.13l.03,52.97Z"
176
+ }),
177
+ /* @__PURE__ */ jsx("path", {
178
+ fill: "url(#chatgpt-sign-in-mark-b)",
179
+ d: "M602.51,601.74l-60.02,34.87-29.12-16.94-45.85-26.63c-8.96-5.2-14.47-14.78-14.48-25.14l-.03-53,59.5,34.57.79.46,89.21,51.8Z"
180
+ }),
181
+ /* @__PURE__ */ jsx("path", {
182
+ fill: "#00e4ff",
183
+ d: "M732.58,595.89l-115.46,67.09c-9.03,5.25-20.19,5.25-29.22,0l-45.41-26.38,60.02-34.87,84.29-48.96-.07-84.18,60.29,35.03.03,67.1c0,10.37-5.51,19.95-14.47,25.16Z"
184
+ }),
185
+ /* @__PURE__ */ jsx("path", {
186
+ fill: "#00e4ff",
187
+ d: "M661.44,363.37l-60.02,34.87-88.19,51.21.07,79.61-60.32-35.03-.03-62.5c0-10.37,5.51-19.95,14.48-25.16l119.39-69.35c9.03-5.24,20.17-5.25,29.2,0l45.42,26.36Z"
188
+ }),
189
+ /* @__PURE__ */ jsx("path", {
190
+ fill: "#00e4ff",
191
+ d: "M599.5,506.65c0-2.14.02-4.27.03-6.41,0-.21,0-.43-.03-.63-.11-1.25-.63-2.14-1.85-2.84-3.45-1.98-6.85-4.04-10.25-6.1-.82-.5-1.5-.12-2.26.09-1.72.49-3.28.23-4.49-1.21-1.1-1.33-1.22-3.27-.35-4.81.81-1.43,2.46-2.17,4.23-1.89,1.63.23,3.07,1.5,3.3,3.23.15,1.31.81,1.98,1.88,2.59,2.55,1.46,5.07,3.04,7.6,4.56.52.31,1.04.92,1.68.61.75-.35.5-1.19.5-1.85.02-16.68,0-33.35,0-50.03v-4.62l-2.5-1.4c-.21-.08-.47-.2-.79-.38-2.06-1.16-4.1-2.32-6.16-3.48l-.9-.5c-1.75-.99-3.49-2-5.23-3.01-.88-.52-1.57-.55-2.49-.03-4.81,2.7-9.63,5.34-14.48,7.95-1.1.6-1.54,1.34-1.53,2.58.05,3.8.06,7.61.03,11.41-.02,1.17.31,2,1.25,2.78,1.94,1.6,2.03,4.52.34,6.18-1.62,1.6-4.36,1.54-5.98-.14-1.57-1.63-1.39-4.5.52-6.06.84-.69,1.14-1.45,1.13-2.49-.03-3.36.05-6.7-.27-10.04-.12-1.28-.53-1.43-1.6-.84-4.1,2.29-8.22,4.61-12.39,6.79-1.43.75-1.86,1.74-1.8,3.27.2,4.88.31,9.76.38,14.65.02,1.11.5,1.77,1.4,2.32,4.85,2.94,9.7,5.9,14.51,8.91.96.59,1.72.58,2.67.06,4.46-2.4,8.91-4.79,13.4-7.11,1.27-.66,1.77-1.56,1.79-2.98.05-4.36-.15-8.74.18-13.11.06-.87-.44-1.34-1.02-1.83-2.11-1.83-2.32-4.39-.55-6.29,1.51-1.65,4.38-1.62,5.97.05,1.72,1.8,1.56,4.41-.47,6.15-.72.63-1.04,1.25-1.05,2.18-.09,4.88-.29,9.76-.29,14.63.02,1.71-.67,2.52-2.11,3.25-4.91,2.5-9.75,5.13-14.63,7.69-.82.43-1.31.99-1.36,1.97-.21,4.99-.44,9.98-.72,14.97-.09,1.37.44,2.17,1.62,2.85,5.61,3.23,11.15,6.58,16.75,9.81,1.22.7,1.8,1.51,1.79,2.96-.06,6.03-.05,12.05.03,18.07.02,1.37-.49,2.2-1.66,2.87-4.68,2.67-9.31,5.43-13.98,8.13-.87.5-1.39,1.1-1.46,2.12-.12,1.33-.73,2.36-1.97,2.99-1.68.84-3.69.53-4.87-.75-1.28-1.37-1.59-3.25-.76-4.7,1.01-1.77,2.93-2.56,4.97-1.98.84.23,1.56.53,2.43.02,4.44-2.64,8.91-5.23,13.38-7.83.82-.47,1.19-1.11,1.19-2.08-.05-5.17-.06-10.34-.06-15.52,0-1.01-.38-1.71-1.27-2.23-5.57-3.28-11.15-6.58-16.71-9.89-.67-.4-1.24-.38-1.91.03-4.67,2.79-9.35,5.58-14.04,8.35-.88.53-1.42,1.19-1.59,2.26-.23,1.43-1.08,2.49-2.52,2.96-1.79.6-3.77.03-4.76-1.33-1.05-1.45-1.08-3.54-.06-4.94,1.04-1.43,2.9-2.04,4.73-1.45.93.32,1.71.6,2.7-.02,4.5-2.76,9.05-5.45,13.61-8.12.92-.53,1.4-1.19,1.46-2.27.26-5.05.58-10.09.9-15.12.08-1.1-.35-1.77-1.31-2.35-4.9-2.96-9.8-5.95-14.65-8.99-.87-.55-1.57-.47-2.38-.03-5.39,2.94-10.77,5.87-16.16,8.8-1.05.56-1.59,1.36-1.59,2.58.03,4.55-.02,9.09.02,13.64.02,1.68.4,1.86,2,1.08,2.72-1.3,5.42-2.62,8.15-3.89,1.04-.47,1.66-1.1,1.94-2.32.56-2.53,3.1-3.88,5.36-3.08,2.21.78,3.33,3.02,2.61,5.2-.72,2.18-3.17,3.36-5.57,2.49-.93-.32-1.68-.4-2.58.05-3.36,1.68-6.73,3.31-10.13,4.88-1.31.61-1.83,1.5-1.8,2.93.05,4.71.11,9.43-.03,14.14-.06,1.98.7,3.11,2.32,4.1,4.64,2.88,9.2,5.86,13.75,8.88,1.02.67,1.89.81,2.98.23,3.04-1.66,6.1-3.3,9.17-4.9.79-.43,1.08-1.02,1.17-1.91.24-2.44,2.33-4.15,4.53-3.81,2.43.38,4.01,2.65,3.48,4.97-.55,2.38-2.79,3.72-5.2,3.01-.96-.29-1.75-.21-2.61.24-3.05,1.65-6.12,3.27-9.19,4.87-.98.5-1.39,1.24-1.31,2.33.15,2.15.21,4.3.4,6.45.26,3.28.61,6.55.9,9.83.08.93.5,1.59,1.31,2.04,4.97,2.85,9.95,5.72,14.91,8.59.81.46,1.57.5,2.41.03,3.1-1.79,6.21-3.57,9.34-5.28,1.17-.66,1.92-1.45,2.2-2.82.26-1.36,1.13-2.35,2.56-2.65,1.98-.43,3.78.21,4.62,1.74.82,1.51.81,3.07-.2,4.5-1.02,1.46-2.79,2-4.73,1.27-1.16-.44-2.08-.31-3.07.27-2.4,1.4-4.84,2.76-7.23,4.17-1.48.88-1.46,1.34.05,2.23,4.13,2.38,8.3,4.71,12.42,7.11,1.08.63,2.04.7,3.17.06,4.46-2.52,8.93-4.97,13.41-7.42.84-.46,1.28-1.07,1.4-1.92.03-.18.03-.35.03-.55-.02-1.51-.03-3.02-.03-4.53v-50.29Z"
192
+ }),
193
+ /* @__PURE__ */ jsx("path", {
194
+ fill: "#00e4ff",
195
+ d: "M655.42,487.9c-1.16,1.43-1.05,3.68,0,5.11,1.05,1.45,3.16,2.2,5.05,1.53,1.14-.41,2.04-.26,3.07.26,2.88,1.45,5.8,2.85,8.74,4.21,1.17.53,1.68,1.31,1.66,2.64-.06,4.71-.05,9.43-.02,14.14,0,1.16-.29,2.08-1.33,2.75-4.59,2.91-9.19,5.87-13.75,8.85-.85.56-1.57.63-2.5.11-2.27-1.28-4.59-2.49-6.93-3.66-1.42-.72-2.47-1.53-2.81-3.28-.37-1.89-1.89-2.93-3.78-3.23-1.75-.27-3.08.58-4.1,1.91-1.24,1.6-1.25,3.4-.11,5.05,1.14,1.66,3.11,2.53,4.87,1.91,1.05-.37,1.86-.18,2.75.29,2.75,1.48,5.49,2.96,8.27,4.39.95.49,1.25,1.08,1.14,2.17-.44,4.75-.84,9.49-1.14,14.25-.09,1.53-.66,2.5-2,3.25-3.98,2.2-7.93,4.42-11.81,6.79-1.82,1.11-3.36,1.21-5.17.02-2.08-1.37-4.29-2.56-6.5-3.71-1.3-.67-2.09-1.53-2.61-2.93-.87-2.41-3.08-3.54-5.25-2.99-2.35.6-3.74,2.53-3.51,4.94.24,2.59,3.01,4.62,5.54,3.84,1.45-.44,2.61-.27,3.84.5,1.79,1.11,3.65,2.09,5.48,3.11,1.11.63,1.07,1.19,0,1.82-3.91,2.21-7.8,4.44-11.69,6.67-.6.34-1.14.35-1.77.02-4.42-2.43-8.86-4.85-13.3-7.25-.82-.44-1.04-1.13-1.04-1.98,0-5.42,0-10.86-.02-16.28v-21.09c0-7.37.02-14.75-.03-22.12,0-1.24.44-2.01,1.5-2.62,2.94-1.71,5.86-3.48,8.76-5.26,1.02-.63,1.92-.84,3.17-.47,2.32.7,4.52-.52,5.39-2.72.75-1.89-.17-4.24-2.11-5.42-1.77-1.07-4.26-.55-5.65,1.21-.24.31-.6.67-.6,1.01-.02,2.24-1.74,3.01-3.3,3.92-1.57.92-3.11,1.88-4.68,2.78-.67.38-1.36,1.3-2.08.9-.82-.46-.37-1.57-.37-2.38-.03-15.61.08-31.23-.11-46.86-.05-3.23.7-5.2,3.78-6.61,3.71-1.68,7.17-3.91,10.71-5.97.93-.55,1.71-.61,2.67-.06,4.5,2.52,9.03,5,13.56,7.48.95.52,1.42,1.19,1.42,2.3,0,3.86-.11,7.72-.34,11.57-.06.82-.47,1.36-.99,1.91-2.09,2.18-2.12,4.59-.15,6.44,1.89,1.79,4.47,1.71,6.23-.17,1.86-1.98,1.72-4.55-.38-6.47-.47-.44-.9-.84-.93-1.54-.14-3.3.11-6.58.32-9.87.09-1.36.96-.76,1.57-.44,3.05,1.65,5.97,3.6,9.14,4.93,3.11,1.31,3.89,3.34,3.62,6.48-.35,3.77-.31,7.58-.38,11.4-.02,1.14-.5,1.89-1.46,2.47-4.47,2.7-8.93,5.42-13.37,8.18-.99.63-1.8.63-2.84.06-4.13-2.26-8.3-4.47-12.48-6.62-1.11-.56-1.56-1.27-1.57-2.52-.03-4.2.2-8.41-.15-12.6-.09-1.02.72-1.46,1.27-2.09,1.43-1.63,1.68-3.72.61-5.34-1.21-1.85-3.3-2.58-5.34-1.88-2.87.96-3.89,4.71-1.69,6.94,1.31,1.34,1.59,2.73,1.56,4.44-.05,3.92.15,7.84-.02,11.75-.11,2.21.84,3.23,2.65,4.13,4.47,2.24,8.83,4.68,13.27,6.97,1.21.63,1.79,1.51,1.79,2.82.03,4.65.29,9.31.66,13.95.06.99-.58,1.39-1.28,1.8-5.52,3.25-11.03,6.56-16.59,9.76-1.16.67-1.79,1.43-1.8,2.81-.05,5.89.06,11.81-.34,17.7-.11,1.4.41,2.32,1.68,3.04,4.33,2.47,8.61,5.07,12.92,7.57,1.19.69,1.98,1.51,2.35,2.93.61,2.38,2.88,3.63,5.28,3.16,2.11-.41,3.8-2.65,3.6-4.75-.24-2.43-2.21-4.53-4.59-4.01-2.91.63-4.9-.78-7.08-2.03-2.81-1.6-5.57-3.3-8.41-4.87-1.22-.69-1.75-1.56-1.71-3.01.12-4.7-.08-9.41.32-14.13.08-.95.38-1.57,1.22-2.04,5.05-2.94,10.09-5.92,15.12-8.9.88-.52,1.68-.49,2.55.03,4.27,2.59,8.56,5.16,12.85,7.72.79.47,1.17,1.11,1.4,2.01.67,2.64,3.11,3.98,5.66,3.23,2.18-.63,3.65-3.22,3.04-5.4-.67-2.47-3.07-3.94-5.57-3.16-1.42.43-2.46.14-3.65-.58-3.78-2.32-7.58-4.58-11.43-6.79-1.21-.69-1.68-1.56-1.79-2.98-.38-4.64-.5-9.29-.78-13.93-.05-.85.2-1.4.9-1.85,4.7-2.88,9.38-5.78,14.05-8.68.64-.4,1.22-.46,1.91-.08,5.08,2.79,10.18,5.55,15.27,8.28,1.24.66,1.8,1.56,1.74,3.01-.15,3.97-.21,7.93-.27,11.9-.02,1.13-.31,1.63-1.51,1.04-2.44-1.21-4.9-2.38-7.37-3.52-.84-.4-1.3-.98-1.6-1.85-.95-2.79-2.53-3.84-5.37-3.54-.96.11-1.57-.05-1.79-1.11.18,1.27-.11,2.17-.87,3.08Z"
196
+ })
197
+ ]
198
+ });
199
+ }
200
+ //#endregion
201
+ export { ChatGptSignInScreen };
@@ -1,2 +1,2 @@
1
- import { a as CodeBlockCopyButton, c as CodeBlockLanguageSelector, d as CodeBlockLanguageSelectorTrigger, f as CodeBlockLanguageSelectorValue, h as CODE_BLOCK_LANGUAGES, i as CodeBlockContent, l as CodeBlockLanguageSelectorContent, m as highlightCode, n as CodeBlockActions, o as CodeBlockFilename, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock, u as CodeBlockLanguageSelectorItem } from "../CodeBlock-BK0sOAbV.js";
1
+ import { a as CodeBlockCopyButton, c as CodeBlockLanguageSelector, d as CodeBlockLanguageSelectorTrigger, f as CodeBlockLanguageSelectorValue, h as CODE_BLOCK_LANGUAGES, i as CodeBlockContent, l as CodeBlockLanguageSelectorContent, m as highlightCode, n as CodeBlockActions, o as CodeBlockFilename, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock, u as CodeBlockLanguageSelectorItem } from "../CodeBlock-D9koxDA7.js";
2
2
  export { CODE_BLOCK_LANGUAGES, CodeBlock, CodeBlockActions, CodeBlockContainer, CodeBlockContent, CodeBlockCopyButton, CodeBlockFilename, CodeBlockHeader, CodeBlockLanguageSelector, CodeBlockLanguageSelectorContent, CodeBlockLanguageSelectorItem, CodeBlockLanguageSelectorTrigger, CodeBlockLanguageSelectorValue, CodeBlockTitle, highlightCode };
@@ -1,6 +1,6 @@
1
1
  import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
2
2
  import { t as cx } from "../class-names-9UtZwb0J.js";
3
- import { a as CheckIcon, c as ChevronRightIcon, l as CopyIcon, m as FileIcon } from "../icons-BCNawx-T.js";
3
+ import { a as CheckIcon, c as ChevronRightIcon, h as FileIcon, l as CopyIcon } from "../icons-BAlTbWWP.js";
4
4
  import { Button } from "./Button.js";
5
5
  import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
6
6
  import { Avatar } from "./Avatar.js";
@@ -3,19 +3,13 @@ import * as React from "react";
3
3
  import { LanguageModelUsage, UIMessage } from "ai";
4
4
 
5
5
  //#region src/components/Context.d.ts
6
- /**
7
- * The AI SDK's `LanguageModelUsage`, taken whole. `Partial` only relaxes the
8
- * required-but-`undefined`able keys for fixtures/JSX literals — key names and
9
- * meanings are upstream's.
10
- */
11
- type ContextTokenUsage = Partial<LanguageModelUsage>;
12
6
  interface ContextProps extends React.HTMLAttributes<HTMLDivElement> {
13
7
  /** Tokens currently used. */
14
8
  usedTokens: number;
15
9
  /** Maximum context window size. */
16
10
  maxTokens: number;
17
11
  /** Optional usage breakdown. */
18
- usage?: ContextTokenUsage;
12
+ usage?: LanguageModelUsage;
19
13
  /** Optional model identifier shown in the header. */
20
14
  modelId?: string;
21
15
  /** Optional total cost in USD. */
@@ -31,11 +25,13 @@ interface ContextProps extends React.HTMLAttributes<HTMLDivElement> {
31
25
  *
32
26
  * @example
33
27
  * ```tsx
28
+ * const usage = getContextUsage(messages);
29
+ *
34
30
  * <Context
35
- * usedTokens={42_300}
31
+ * usedTokens={getContextUsedTokens(usage)}
36
32
  * maxTokens={200_000}
37
33
  * modelId="claude-opus-4-6"
38
- * usage={{ inputTokens: 30000, outputTokens: 12300 }}
34
+ * usage={usage}
39
35
  * totalCostUsd={0.42}
40
36
  * >
41
37
  * <ContextTrigger />
@@ -127,4 +123,4 @@ declare function getContextUsage(messages: readonly UIMessage[]): LanguageModelU
127
123
  /** Tokens occupying the context window: `totalTokens`, or input + output. */
128
124
  declare function getContextUsedTokens(usage: LanguageModelUsage | undefined): number;
129
125
  //#endregion
130
- export { Context, ContextCacheUsage, ContextCacheUsageProps, ContextContent, ContextContentBody, ContextContentBodyProps, ContextContentFooter, ContextContentFooterProps, ContextContentHeader, ContextContentHeaderProps, ContextContentProps, ContextInputUsage, ContextInputUsageProps, ContextOutputUsage, ContextOutputUsageProps, ContextProps, ContextReasoningUsage, ContextReasoningUsageProps, ContextTokenUsage, ContextTrigger, ContextTriggerProps, ContextUsageRowProps, getContextUsage, getContextUsedTokens };
126
+ export { Context, ContextCacheUsage, ContextCacheUsageProps, ContextContent, ContextContentBody, ContextContentBodyProps, ContextContentFooter, ContextContentFooterProps, ContextContentHeader, ContextContentHeaderProps, ContextContentProps, ContextInputUsage, ContextInputUsageProps, ContextOutputUsage, ContextOutputUsageProps, ContextProps, ContextReasoningUsage, ContextReasoningUsageProps, ContextTrigger, ContextTriggerProps, ContextUsageRowProps, getContextUsage, getContextUsedTokens };
@@ -17,11 +17,13 @@ function useContextContext() {
17
17
  *
18
18
  * @example
19
19
  * ```tsx
20
+ * const usage = getContextUsage(messages);
21
+ *
20
22
  * <Context
21
- * usedTokens={42_300}
23
+ * usedTokens={getContextUsedTokens(usage)}
22
24
  * maxTokens={200_000}
23
25
  * modelId="claude-opus-4-6"
24
- * usage={{ inputTokens: 30000, outputTokens: 12300 }}
26
+ * usage={usage}
25
27
  * totalCostUsd={0.42}
26
28
  * >
27
29
  * <ContextTrigger />
@@ -1,4 +1,4 @@
1
- import { a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-BCNawx-T.js";
1
+ import { a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-BAlTbWWP.js";
2
2
  import "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
@@ -1,23 +1,15 @@
1
1
  import { t as Button } from "../Button-Ct5I6aTu.js";
2
+ import { MessageScrollerButtonProps, MessageScrollerItemProps } from "./MessageScroller.js";
2
3
  import * as React from "react";
4
+ import { UIMessage } from "ai";
3
5
 
4
6
  //#region src/components/Conversation.d.ts
5
- /**
6
- * Minimum message shape accepted by {@link ConversationDownload} and
7
- * {@link messagesToMarkdown}. Structurally compatible with the AI SDK
8
- * `UIMessage` type so consumers can pass those directly.
9
- */
10
- interface ConversationMessage {
7
+ /** AI SDK `UIMessage`, or a plain text fallback for non-chat exports. */
8
+ type ConversationMessage = UIMessage | {
11
9
  id?: string;
12
10
  role: string;
13
- /** AI SDK-style parts array. The text types are concatenated for export. */
14
- parts?: Array<{
15
- type: string;
16
- text?: string;
17
- }>;
18
- /** Plain-text content; used as a fallback when `parts` is not provided. */
19
11
  content?: string;
20
- }
12
+ };
21
13
  interface ConversationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
22
14
  /** Additional class names for layout only; do not override scroll behavior from apps. */
23
15
  className?: string;
@@ -25,16 +17,17 @@ interface ConversationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "
25
17
  children?: React.ReactNode;
26
18
  }
27
19
  /**
28
- * Scrollable container for a chat conversation. Sticks the viewport to the
29
- * bottom as new content arrives, unless the user has scrolled up. Adapted
30
- * from Vercel AI Elements and restyled with Sigvelo CSS tokens.
20
+ * Compatibility wrapper around {@link MessageScroller} for existing
21
+ * conversation imports. Prefer MessageScroller directly for new chat
22
+ * transcript surfaces.
31
23
  *
32
24
  * Use for assistant/user message streams. Do not use for static lists or
33
25
  * logs that should not auto-stick to the latest item.
34
26
  *
35
27
  * Sigvelo changes: removed Tailwind classes, uses a native scroll region with
36
- * the local stick-to-bottom hook, emits `role="log"` with polite updates, and
37
- * keeps transcript export in a separate ConversationDownload action.
28
+ * the shared MessageScroller primitive, emits `role="log"` with polite
29
+ * updates, and keeps transcript export in a separate ConversationDownload
30
+ * action.
38
31
  *
39
32
  * Styling consumes Sigvelo canvas, surface, border, spacing, radius, shadow,
40
33
  * and motion tokens. Add new behavior in this package when multiple apps need
@@ -48,7 +41,11 @@ interface ConversationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "
48
41
  * ```tsx
49
42
  * <Conversation>
50
43
  * <ConversationContent>
51
- * {messages.map((m) => <Message key={m.id} {...m} />)}
44
+ * {messages.map((m) => (
45
+ * <ConversationItem key={m.id} messageId={m.id} scrollAnchor={m.role === "user"}>
46
+ * <Message {...m} />
47
+ * </ConversationItem>
48
+ * ))}
52
49
  * </ConversationContent>
53
50
  * <ConversationScrollButton />
54
51
  * </Conversation>
@@ -72,11 +69,17 @@ interface ConversationContentProps extends React.HTMLAttributes<HTMLDivElement>
72
69
  declare function ConversationContent({
73
70
  className,
74
71
  children,
75
- ref,
76
72
  ...props
77
73
  }: ConversationContentProps & {
78
74
  ref?: React.Ref<HTMLDivElement>;
79
75
  }): React.JSX.Element;
76
+ type ConversationItemProps = MessageScrollerItemProps;
77
+ /** Optional wrapper for one turn/message. Enables upstream scroll anchoring and visibility tracking. */
78
+ declare function ConversationItem({
79
+ className,
80
+ scrollAnchor,
81
+ ...props
82
+ }: ConversationItemProps): React.JSX.Element;
80
83
  interface ConversationEmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
81
84
  title?: React.ReactNode;
82
85
  description?: React.ReactNode;
@@ -98,30 +101,27 @@ declare function ConversationEmptyState({
98
101
  }: ConversationEmptyStateProps & {
99
102
  ref?: React.Ref<HTMLDivElement>;
100
103
  }): React.JSX.Element;
101
- interface ConversationScrollButtonProps extends Omit<React.ComponentProps<typeof Button>, "onClick" | "className"> {
104
+ interface ConversationScrollButtonProps extends Omit<MessageScrollerButtonProps, "children" | "className"> {
102
105
  className?: string;
103
- /** Optional click handler; runs before the default scroll-to-bottom action. */
104
- onClick?: React.MouseEventHandler<HTMLButtonElement>;
105
106
  /** Accessible label for the button. */
106
107
  label?: string;
108
+ children?: React.ReactNode;
107
109
  }
108
110
  /**
109
111
  * Floating button that scrolls the conversation to the latest message.
110
- * Hidden while the viewport is already pinned to the bottom.
112
+ * Hidden from view and tab order while the viewport is already at the end.
111
113
  */
112
114
  declare function ConversationScrollButton({
113
115
  className,
114
116
  variant,
115
117
  color,
116
118
  size,
117
- onClick,
118
119
  label,
119
120
  children,
120
- ref,
121
121
  ...props
122
122
  }: ConversationScrollButtonProps & {
123
123
  ref?: React.Ref<HTMLButtonElement>;
124
- }): React.JSX.Element | null;
124
+ }): React.JSX.Element;
125
125
  /**
126
126
  * Converts a conversation to a Markdown document with a heading per message.
127
127
  *
@@ -163,4 +163,4 @@ declare function ConversationDownload({
163
163
  ref?: React.Ref<HTMLButtonElement>;
164
164
  }): React.JSX.Element | null;
165
165
  //#endregion
166
- export { Conversation, ConversationContent, ConversationContentProps, ConversationDownload, ConversationDownloadProps, ConversationEmptyState, ConversationEmptyStateProps, ConversationMessage, ConversationProps, ConversationScrollButton, ConversationScrollButtonProps, messagesToMarkdown };
166
+ export { Conversation, ConversationContent, ConversationContentProps, ConversationDownload, ConversationDownloadProps, ConversationEmptyState, ConversationEmptyStateProps, ConversationItem, ConversationItemProps, ConversationMessage, ConversationProps, ConversationScrollButton, ConversationScrollButtonProps, messagesToMarkdown };