@mcp-b/react-components 0.55.0 → 0.56.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 (130) hide show
  1. package/dist/{AgentToolRunsContext-GMe_hSnD.d.ts → AgentToolRunsContext-DT50htHj.d.ts} +4 -17
  2. package/dist/{CodeBlock-Bl-q7wMc.js → CodeBlock-Dw1z6jc8.js} +1 -1
  3. package/dist/{EmployeeChrome-B605rpVz.d.ts → EmployeeChrome-B7Gt2Hpk.d.ts} +1 -1
  4. package/dist/{FileTree-DruTQ-oa.js → FileTree-okaLnS5j.js} +1 -1
  5. package/dist/{ManagerOffice-CMJ7laGe.js → ManagerOffice-D4L_xO4i.js} +5 -5
  6. package/dist/{SetupChecklist-BiWQkKEq.js → SetupChecklist-DWyifWWg.js} +2 -2
  7. package/dist/{ThinkChatActivity-DENkintt.d.ts → ThinkChatActivity-B6dh3n0-.d.ts} +1 -1
  8. package/dist/{WorkspaceFileView-DXgTljKV.js → WorkspaceFileView-DQDWUpAH.js} +2 -2
  9. package/dist/components/agents-sdk/AgentActivity.js +1 -1
  10. package/dist/components/agents-sdk/AgentChat.js +10 -10
  11. package/dist/components/agents-sdk/AgentEvent.js +2 -2
  12. package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +1 -1
  13. package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
  14. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  15. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  16. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
  17. package/dist/components/agents-sdk/EmployeeApp.d.ts +1 -1
  18. package/dist/components/agents-sdk/EmployeeApp.js +2 -2
  19. package/dist/components/agents-sdk/EmployeeChat.js +5 -5
  20. package/dist/components/agents-sdk/EmployeeChrome.d.ts +1 -1
  21. package/dist/components/agents-sdk/EmployeeChrome.js +10 -10
  22. package/dist/components/agents-sdk/EmployeeSchedules.d.ts +1 -1
  23. package/dist/components/agents-sdk/EmployeeSchedules.js +3 -3
  24. package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +1 -1
  25. package/dist/components/agents-sdk/EmployeeStartScreen.js +4 -4
  26. package/dist/components/agents-sdk/ManagerAccountActions.js +3 -3
  27. package/dist/components/agents-sdk/ManagerOffice.js +1 -1
  28. package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
  29. package/dist/components/agents-sdk/ManagerOfficeScreens.js +2 -2
  30. package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
  31. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  32. package/dist/components/agents-sdk/McpPluginCatalog.js +3 -3
  33. package/dist/components/agents-sdk/McpServerPicker.js +2 -2
  34. package/dist/components/agents-sdk/ModelEndpointDialog.js +1 -1
  35. package/dist/components/agents-sdk/ModelSelector.js +4 -4
  36. package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
  37. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  38. package/dist/components/agents-sdk/SubagentRunDetails.d.ts +1 -1
  39. package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +1 -1
  40. package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
  41. package/dist/components/agents-sdk/SubagentRunList.d.ts +1 -1
  42. package/dist/components/agents-sdk/SubagentRunPanel.d.ts +3 -14
  43. package/dist/components/agents-sdk/SubagentRunPanel.js +12 -15
  44. package/dist/components/agents-sdk/SubagentRunSelector.d.ts +1 -1
  45. package/dist/components/agents-sdk/SubagentRunSelector.js +1 -1
  46. package/dist/components/agents-sdk/ThinkChat.d.ts +2 -9
  47. package/dist/components/agents-sdk/ThinkChat.js +3 -36
  48. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  49. package/dist/components/agents-sdk/ThinkChatActivity.js +3 -3
  50. package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -2
  51. package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
  52. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  53. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
  54. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
  55. package/dist/components/agents-sdk/ThinkRoutineActions.js +2 -2
  56. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
  57. package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
  58. package/dist/components/agents-sdk/ThinkRoutineForm.js +4 -4
  59. package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
  60. package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
  61. package/dist/components/agents-sdk/WorkbenchBack.js +1 -1
  62. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  63. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +6 -6
  64. package/dist/components/agents-sdk/WorkspaceExecution.js +7 -7
  65. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
  66. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  67. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  68. package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
  69. package/dist/components/agents-sdk/WorkspaceProject.js +4 -4
  70. package/dist/components/agents-sdk/WorkspaceUserScript.js +4 -4
  71. package/dist/components/ai-sdk/Activity.js +1 -1
  72. package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
  73. package/dist/components/ai-sdk/Approval.js +2 -2
  74. package/dist/components/ai-sdk/Artifact.js +1 -1
  75. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  76. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  77. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  78. package/dist/components/ai-sdk/ComposerLink.js +1 -1
  79. package/dist/components/ai-sdk/ConnectedAppCards.js +3 -3
  80. package/dist/components/ai-sdk/Context.js +1 -1
  81. package/dist/components/ai-sdk/Conversation.js +1 -1
  82. package/dist/components/ai-sdk/Goal.js +1 -1
  83. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  84. package/dist/components/ai-sdk/Message.js +2 -2
  85. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  86. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  87. package/dist/components/ai-sdk/Plan.js +1 -1
  88. package/dist/components/ai-sdk/PromptInput.js +6 -6
  89. package/dist/components/ai-sdk/Queue.js +1 -1
  90. package/dist/components/ai-sdk/Reasoning.js +1 -1
  91. package/dist/components/ai-sdk/Sources.js +1 -1
  92. package/dist/components/ai-sdk/Task.js +1 -1
  93. package/dist/components/extension/ChatGptSignInScreen.js +1 -1
  94. package/dist/components/extension/CodexModelSelector.js +2 -2
  95. package/dist/components/extension/ConversationTabPicker.js +2 -2
  96. package/dist/components/foundations/Checkbox.js +1 -1
  97. package/dist/components/foundations/Collapsible.js +1 -1
  98. package/dist/components/foundations/ContextMenu.js +1 -1
  99. package/dist/components/foundations/Menubar.js +1 -1
  100. package/dist/components/foundations/SearchField.js +1 -1
  101. package/dist/components/foundations/Select.js +1 -1
  102. package/dist/components/foundations/Stepper.js +1 -1
  103. package/dist/components/foundations/Toast.js +1 -1
  104. package/dist/components/foundations/ToggleGroup.d.ts +1 -1
  105. package/dist/components/foundations/ToggleGroup.js +1 -1
  106. package/dist/components/foundations/icons.js +1 -1
  107. package/dist/components/general-purpose/AccountSignInDialog.js +1 -1
  108. package/dist/components/general-purpose/Commit.js +2 -2
  109. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  110. package/dist/components/general-purpose/FileTree.js +1 -1
  111. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  112. package/dist/components/general-purpose/PricingPlanCard.js +2 -2
  113. package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
  114. package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
  115. package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
  116. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  117. package/dist/components/general-purpose/Terminal.js +2 -2
  118. package/dist/components/general-purpose/TestResults.js +1 -1
  119. package/dist/components/general-purpose/ThemeModeControl.js +2 -2
  120. package/dist/components/general-purpose/WebPreview.js +2 -2
  121. package/dist/components/nanites/AgentConnection.js +2 -2
  122. package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
  123. package/dist/components/nanites/AgentToolDetail.js +5 -5
  124. package/dist/{copy-button-CSDuDfdP.js → copy-button-Dk2vRe9j.js} +1 -1
  125. package/dist/{workspace-assets-Bg7XhPsk.js → workspace-assets-wW_lQLYK.js} +2 -2
  126. package/package.json +6 -6
  127. package/dist/SessionCompaction-CmTJFpzj.d.ts +0 -89
  128. package/dist/components/agents-sdk/SessionCompaction.d.ts +0 -2
  129. package/dist/components/agents-sdk/SessionCompaction.js +0 -140
  130. package/dist/{icons-cuEtsgj9.js → icons-CeGfXO21.js} +1 -1
@@ -1,89 +0,0 @@
1
- import { ChatStatus, UIMessage } from "ai";
2
-
3
- //#region src/components/agents-sdk/SessionCompaction.d.ts
4
- type SessionStatusPhase = "idle" | "compacting";
5
- interface SessionStatusFrame {
6
- phase: SessionStatusPhase;
7
- /** Present on the idle frame that follows a successful compaction. */
8
- compacted: boolean;
9
- /**
10
- * Session's own estimate for the history this frame describes, or null when
11
- * the frame omits it or carries a non-finite value. Not provider-reported
12
- * usage — never render it as an exact token count, and never feed it to the
13
- * `Context` ring, which reads `metadata.usage`.
14
- */
15
- tokenEstimate: number | null;
16
- /**
17
- * The same estimate taken before the compaction this frame reports, from its
18
- * `compacted` payload. Null on every other frame. Both numbers come from one
19
- * estimator over one history, so their difference is a meaningful size even
20
- * though neither is exact.
21
- */
22
- tokensBefore: number | null;
23
- }
24
- /**
25
- * Parse a raw websocket payload as a `cf_agent_session` status frame.
26
- * Returns null for every other frame on the connection.
27
- */
28
- declare function parseSessionStatusFrame(data: unknown): SessionStatusFrame | null;
29
- /**
30
- * Parse a raw websocket payload as a `cf_agent_session_error` frame,
31
- * returning its error text. Null for every other frame on the connection.
32
- */
33
- declare function parseSessionErrorFrame(data: unknown): string | null;
34
- /** The message-frame surface of a `useAgent` connection. */
35
- interface SessionFrameSource {
36
- addEventListener(type: "message", listener: (event: MessageEvent) => void): void;
37
- removeEventListener(type: "message", listener: (event: MessageEvent) => void): void;
38
- }
39
- interface UseSessionCompactionOptions<MessageT extends UIMessage> {
40
- /** The conversation agent's `useAgent` connection. */
41
- agent: SessionFrameSource;
42
- /** The conversation's `useAgentChat` value (status + local view setter). */
43
- chat: {
44
- status: ChatStatus;
45
- setMessages: (messages: MessageT[]) => void;
46
- };
47
- /** Server read used to reload the transcript after a compaction lands. */
48
- getMessages: () => Promise<MessageT[]>;
49
- }
50
- /**
51
- * How much a landed compaction shortened the history, per Session's own
52
- * estimator. A UI may show the difference as an approximate size; it must not
53
- * present either number as exact usage.
54
- */
55
- interface SessionCompactionSize {
56
- tokensBefore: number;
57
- tokensAfter: number;
58
- }
59
- interface UseSessionCompactionResult {
60
- compacting: boolean;
61
- /**
62
- * Size of the compaction that landed most recently on this connection, or
63
- * null when none has landed or the frames carried no usable estimates. A new
64
- * object per compaction, so a consumer can dismiss one acknowledgement by
65
- * identity and still show the next. Cleared when the next compaction starts.
66
- */
67
- lastCompaction: SessionCompactionSize | null;
68
- /**
69
- * Set when the post-compaction transcript reload rejected — the local view
70
- * is stale relative to the server until a retry succeeds. Surface it
71
- * ("Transcript may be out of date"); the hook retries on the next status
72
- * transition to `"ready"`.
73
- */
74
- reloadError: unknown;
75
- /**
76
- * Error text from the last `cf_agent_session_error` frame — the only signal
77
- * a user who ran /compact gets when the server-side compaction itself fails
78
- * (the phase just flips back to idle with no `compacted` payload). Cleared
79
- * when the next compaction starts.
80
- */
81
- sessionError: string | null;
82
- }
83
- declare function useSessionCompaction<MessageT extends UIMessage>({
84
- agent,
85
- chat,
86
- getMessages
87
- }: UseSessionCompactionOptions<MessageT>): UseSessionCompactionResult;
88
- //#endregion
89
- export { UseSessionCompactionOptions as a, parseSessionStatusFrame as c, SessionStatusPhase as i, useSessionCompaction as l, SessionFrameSource as n, UseSessionCompactionResult as o, SessionStatusFrame as r, parseSessionErrorFrame as s, SessionCompactionSize as t };
@@ -1,2 +0,0 @@
1
- import { a as UseSessionCompactionOptions, c as parseSessionStatusFrame, i as SessionStatusPhase, l as useSessionCompaction, n as SessionFrameSource, o as UseSessionCompactionResult, r as SessionStatusFrame, s as parseSessionErrorFrame, t as SessionCompactionSize } from "../../SessionCompaction-CmTJFpzj.js";
2
- export { SessionCompactionSize, SessionFrameSource, SessionStatusFrame, SessionStatusPhase, UseSessionCompactionOptions, UseSessionCompactionResult, parseSessionErrorFrame, parseSessionStatusFrame, useSessionCompaction };
@@ -1,140 +0,0 @@
1
- import * as React from "react";
2
- //#region src/components/agents-sdk/SessionCompaction.ts
3
- /**
4
- * Client-side session-compaction plumbing for Think conversations.
5
- *
6
- * The Agents Session broadcasts `cf_agent_session` status frames to every
7
- * connected client: `phase` flips to `"compacting"` while a compaction runs
8
- * and back to `"idle"` when it settles, with a `compacted` payload on the
9
- * idle frame when an overlay was actually written. Think refreshes only its
10
- * server-side message cache after a compaction (`_syncMessages()` does not
11
- * push to clients), so a connected transcript keeps showing the uncompacted
12
- * history until its next `getMessages()`. `useSessionCompaction` closes that
13
- * gap: it tracks the live phase for a "Compacting context…" affordance and
14
- * reloads the transcript once a compaction lands — deferring the reload to
15
- * the end of the turn when one is streaming, so a mid-turn proactive
16
- * compaction never clobbers streamed state.
17
- *
18
- * Compose the command with `useAgentChatCompaction`: supply the app's
19
- * compaction callable, then place its command and notice explicitly.
20
- *
21
- * This module is the "local adapter … documented runtime-only mirror" that
22
- * docs/think-session-ui.md calls for: upstream exports no payload types or
23
- * client hook for these frames. The doc records the complete frame shapes;
24
- * this adapter consumes `phase`, the presence of `compacted`, the error string
25
- * of `cf_agent_session_error`, and the two estimates that size a landed
26
- * compaction (`tokenEstimate` and `compacted.tokensBefore`). Every field but
27
- * `phase` degrades to null rather than throwing, so an upstream field change
28
- * costs detail, never the UI. Per that doc, `tokenThreshold` is the
29
- * auto-compaction threshold, not the model context window — it stays unread
30
- * here, and neither estimate may drive the `Context` ring, which reads
31
- * provider-reported `metadata.usage`.
32
- *
33
- * @see ../../docs/think-session-ui.md
34
- * @see https://github.com/cloudflare/agents/blob/main/docs/agents/sessions.md#compaction
35
- */
36
- /** Finite numbers only — an absent or malformed field degrades to null. */
37
- function finiteNumber(value) {
38
- return typeof value === "number" && Number.isFinite(value) ? value : null;
39
- }
40
- /**
41
- * Parse a raw websocket payload as a `cf_agent_session` status frame.
42
- * Returns null for every other frame on the connection.
43
- */
44
- function parseSessionStatusFrame(data) {
45
- if (typeof data !== "string") return null;
46
- let message;
47
- try {
48
- message = JSON.parse(data);
49
- } catch {
50
- return null;
51
- }
52
- if (typeof message !== "object" || message === null || !("type" in message) || message.type !== "cf_agent_session" || !("phase" in message) || message.phase !== "idle" && message.phase !== "compacting") return null;
53
- const compacted = "compacted" in message && message.compacted != null ? message.compacted : null;
54
- return {
55
- phase: message.phase,
56
- compacted: compacted !== null,
57
- tokenEstimate: finiteNumber("tokenEstimate" in message ? message.tokenEstimate : void 0),
58
- tokensBefore: typeof compacted === "object" && compacted !== null && "tokensBefore" in compacted ? finiteNumber(compacted.tokensBefore) : null
59
- };
60
- }
61
- /**
62
- * Parse a raw websocket payload as a `cf_agent_session_error` frame,
63
- * returning its error text. Null for every other frame on the connection.
64
- */
65
- function parseSessionErrorFrame(data) {
66
- if (typeof data !== "string") return null;
67
- let message;
68
- try {
69
- message = JSON.parse(data);
70
- } catch {
71
- return null;
72
- }
73
- if (typeof message !== "object" || message === null || !("type" in message) || message.type !== "cf_agent_session_error" || !("error" in message) || typeof message.error !== "string") return null;
74
- return message.error;
75
- }
76
- function useSessionCompaction({ agent, chat, getMessages }) {
77
- const [compacting, setCompacting] = React.useState(false);
78
- const [refreshPending, setRefreshPending] = React.useState(false);
79
- const [reloadError, setReloadError] = React.useState(null);
80
- const [sessionError, setSessionError] = React.useState(null);
81
- const [lastCompaction, setLastCompaction] = React.useState(null);
82
- React.useEffect(() => {
83
- setCompacting(false);
84
- setSessionError(null);
85
- setRefreshPending(false);
86
- setReloadError(null);
87
- setLastCompaction(null);
88
- const onMessage = (event) => {
89
- const frame = parseSessionStatusFrame(event.data);
90
- if (frame) {
91
- setCompacting(frame.phase === "compacting");
92
- if (frame.phase === "compacting") {
93
- setSessionError(null);
94
- setLastCompaction(null);
95
- }
96
- if (frame.compacted) {
97
- setRefreshPending(true);
98
- setLastCompaction(frame.tokensBefore !== null && frame.tokenEstimate !== null ? {
99
- tokensAfter: frame.tokenEstimate,
100
- tokensBefore: frame.tokensBefore
101
- } : null);
102
- }
103
- return;
104
- }
105
- const error = parseSessionErrorFrame(event.data);
106
- if (error !== null) {
107
- setCompacting(false);
108
- setSessionError(error);
109
- }
110
- };
111
- agent.addEventListener("message", onMessage);
112
- return () => agent.removeEventListener("message", onMessage);
113
- }, [agent]);
114
- const { status, setMessages } = chat;
115
- React.useEffect(() => {
116
- if (!refreshPending || status !== "ready") return;
117
- let stale = false;
118
- getMessages().then((messages) => {
119
- if (stale) return;
120
- setRefreshPending(false);
121
- setReloadError(null);
122
- setMessages(messages);
123
- }, (error) => {
124
- if (stale) return;
125
- console.error("Transcript reload after compaction failed", error);
126
- setReloadError(error);
127
- });
128
- return () => {
129
- stale = true;
130
- };
131
- }, [refreshPending, status]);
132
- return {
133
- compacting,
134
- lastCompaction,
135
- reloadError,
136
- sessionError
137
- };
138
- }
139
- //#endregion
140
- export { parseSessionErrorFrame, parseSessionStatusFrame, useSessionCompaction };
@@ -1,7 +1,7 @@
1
1
  import { t as cx } from "./class-names-BiMDVpUo.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import { Archive, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpRight, Bookmark, Box, Brain, CalendarDays, Check, ChevronDown, ChevronRight, CircleStop, CodeXml, Copy, Dot, Download, Ellipsis, Eye, EyeOff, File, Folder, FolderOpen, Info, Keyboard, Link2, ListRestart, LoaderCircle, Mail, Maximize2, MessageSquare, Mic, Minus, Monitor, Moon, PanelLeft, Paperclip, Pause, Pencil, Play, Plus, RefreshCw, Search, Square, Sun, Target, Terminal, Trash2, TriangleAlert, User, Wrench, X } from "lucide-react";
3
4
  import { SiDiscord, SiModelcontextprotocol } from "react-icons/si";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/_internal/icons.tsx
6
6
  function icon(Component) {
7
7
  return function DesignSystemIcon({ size = 16, strokeWidth = 1.75, ...props }) {