@mcp-b/react-components 0.31.7 → 0.33.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 (98) hide show
  1. package/dist/AgentToolRunsContext-BCVqCtJ1.d.ts +44 -0
  2. package/dist/{CodeBlock-B5I7wje1.js → CodeBlock-CM5gfmdq.js} +1 -1
  3. package/dist/{FileTree-DbQMpvxV.js → FileTree-4WP4Uc_m.js} +1 -1
  4. package/dist/{ModelSelector-DZcpUBgn.js → ModelSelector-DzdEs2fX.js} +1 -1
  5. package/dist/{ThinkChat-BUoXVfrn.js → ThinkChat-en0UbkVv.js} +4 -15
  6. package/dist/{WorkspaceFileView-BeUpr6TU.js → WorkspaceFileView-BtzVKAed.js} +2 -2
  7. package/dist/components/agents-sdk/AgentActivity.js +1 -1
  8. package/dist/components/agents-sdk/AgentActivityPreview.js +3 -3
  9. package/dist/components/agents-sdk/AgentChat.js +23 -14
  10. package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +2 -2
  11. package/dist/components/agents-sdk/AgentToolRunsContext.js +20 -1
  12. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  13. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  14. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
  15. package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
  16. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  17. package/dist/components/agents-sdk/McpPluginCatalog.js +3 -3
  18. package/dist/components/agents-sdk/McpServerPicker.js +2 -2
  19. package/dist/components/agents-sdk/ModelSelector.js +1 -1
  20. package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
  21. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  22. package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
  23. package/dist/components/agents-sdk/SubagentRunSelector.js +2 -2
  24. package/dist/components/agents-sdk/ThinkChat.d.ts +3 -3
  25. package/dist/components/agents-sdk/ThinkChat.js +3 -3
  26. package/dist/components/agents-sdk/ThinkChatActivity.js +1 -1
  27. package/dist/components/agents-sdk/ThinkChatToolPanels.js +1 -1
  28. package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
  29. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  30. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
  31. package/dist/components/agents-sdk/ThinkFullApp.d.ts +8 -0
  32. package/dist/components/agents-sdk/ThinkFullApp.js +3 -4
  33. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
  34. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
  35. package/dist/components/agents-sdk/ThinkRoutineForm.js +3 -3
  36. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +3 -3
  37. package/dist/components/agents-sdk/ThinkRoutineRuns.js +2 -2
  38. package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
  39. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  40. package/dist/components/agents-sdk/WorkspaceExplorer.js +1 -1
  41. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  42. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  43. package/dist/components/agents-sdk/WorkspaceMountManager.js +2 -2
  44. package/dist/components/ai-sdk/Activity.js +1 -1
  45. package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
  46. package/dist/components/ai-sdk/Approval.js +1 -1
  47. package/dist/components/ai-sdk/Artifact.js +1 -1
  48. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  49. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  50. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  51. package/dist/components/ai-sdk/Conversation.js +1 -1
  52. package/dist/components/ai-sdk/Goal.js +1 -1
  53. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  54. package/dist/components/ai-sdk/Message.js +3 -3
  55. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  56. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  57. package/dist/components/ai-sdk/Plan.d.ts +2 -2
  58. package/dist/components/ai-sdk/Plan.js +3 -3
  59. package/dist/components/ai-sdk/PromptInput.js +3 -3
  60. package/dist/components/ai-sdk/Queue.js +1 -1
  61. package/dist/components/ai-sdk/Reasoning.d.ts +3 -2
  62. package/dist/components/ai-sdk/Reasoning.js +7 -16
  63. package/dist/components/ai-sdk/Sources.js +1 -1
  64. package/dist/components/ai-sdk/Task.js +1 -1
  65. package/dist/components/extension/ChatGptSignInScreen.js +2 -2
  66. package/dist/components/extension/CodexModelSelector.js +2 -2
  67. package/dist/components/extension/ConversationTabPicker.js +3 -3
  68. package/dist/components/foundations/Checkbox.js +1 -1
  69. package/dist/components/foundations/Collapsible.js +1 -1
  70. package/dist/components/foundations/ContextMenu.js +1 -1
  71. package/dist/components/foundations/Menubar.js +1 -1
  72. package/dist/components/foundations/SearchField.js +1 -1
  73. package/dist/components/foundations/Select.js +1 -1
  74. package/dist/components/foundations/Stepper.js +1 -1
  75. package/dist/components/foundations/Toast.js +1 -1
  76. package/dist/components/foundations/icons.js +1 -1
  77. package/dist/components/general-purpose/Commit.js +3 -3
  78. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  79. package/dist/components/general-purpose/FileTree.js +1 -1
  80. package/dist/components/general-purpose/PricingPlanCard.js +2 -2
  81. package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
  82. package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
  83. package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
  84. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  85. package/dist/components/general-purpose/Terminal.js +2 -2
  86. package/dist/components/general-purpose/TestResults.js +1 -1
  87. package/dist/components/general-purpose/ThemeModeControl.js +1 -1
  88. package/dist/components/general-purpose/WebPreview.js +2 -2
  89. package/dist/components/nanites/AgentConnection.js +2 -2
  90. package/dist/components/nanites/AgentToolDetail.d.ts +14 -1
  91. package/dist/components/nanites/AgentToolDetail.js +19 -11
  92. package/dist/{copy-button-4YvddK4e.js → copy-button-CsNSSKYG.js} +1 -1
  93. package/dist/styles/activity.css +2 -0
  94. package/dist/styles/message.css +32 -2
  95. package/dist/styles/reasoning.css +6 -0
  96. package/package.json +2 -2
  97. package/dist/AgentToolRunsContext-Cgve-Upx.d.ts +0 -21
  98. package/dist/{icons-B4mGvCvc.js → icons-B1Qw05te.js} +1 -1
@@ -0,0 +1,44 @@
1
+ import * as React from "react";
2
+ import { UIMessage } from "ai";
3
+ import { useAgentToolEvents } from "agents/react";
4
+ import { AgentToolRunPart } from "agents/agent-tools";
5
+
6
+ //#region src/components/agents-sdk/AgentToolRunsContext.d.ts
7
+ /** The complete upstream retained-run hook result for one parent connection. */
8
+ type AgentToolEventsValue<Part extends AgentToolRunPart = UIMessage["parts"][number]> = ReturnType<typeof useAgentToolEvents<Part>>;
9
+ /** The live parent connection members the retained-run subscription reads. */
10
+ type AgentToolEventSource = Parameters<typeof useAgentToolEvents>[0]["agent"] & {
11
+ path: ReadonlyArray<{
12
+ agent: string;
13
+ name: string;
14
+ }>;
15
+ };
16
+ /**
17
+ * The one retained-run subscription for a parent connection: upstream
18
+ * `useAgentToolEvents` scoped to the connection's source identity, so runs
19
+ * from a previous thread cannot leak across a source swap. Call it beside the
20
+ * `useAgent` call that owns the connection — the server replays retained runs
21
+ * once per socket connect, so a later mount misses existing runs — and share
22
+ * the one value with every surface that reads runs (the chat shell and a
23
+ * run-detail route read the same projection, never two subscriptions).
24
+ */
25
+ declare function useSourceScopedAgentToolEvents<Part extends AgentToolRunPart = UIMessage["parts"][number]>(agent: AgentToolEventSource): {
26
+ runsById: Record<string, import("agents").AgentToolRunState<Part>>;
27
+ runsByToolCallId: Record<string, import("agents").AgentToolRunState<Part>[]>;
28
+ unboundRuns: import("agents").AgentToolRunState<Part>[];
29
+ getRunsForToolCall(toolCallId: string): import("agents").AgentToolRunState<Part>[];
30
+ resetLocalState(): void;
31
+ };
32
+ interface AgentToolRunsProviderProps<Part extends AgentToolRunPart = UIMessage["parts"][number]> {
33
+ /** Pass the whole `useAgentToolEvents({ agent })` result directly. */
34
+ agentTools: AgentToolEventsValue<Part>;
35
+ children: React.ReactNode;
36
+ }
37
+ /** Provides one parent connection's retained Agent Tool event projection. */
38
+ declare function AgentToolRunsProvider<Part extends AgentToolRunPart = UIMessage["parts"][number]>({
39
+ agentTools,
40
+ children
41
+ }: AgentToolRunsProviderProps<Part>): React.JSX.Element;
42
+ declare function useOptionalAgentToolRuns<Part extends AgentToolRunPart = UIMessage["parts"][number]>(): AgentToolEventsValue<Part> | null;
43
+ //#endregion
44
+ export { useOptionalAgentToolRuns as a, AgentToolRunsProviderProps as i, AgentToolEventsValue as n, useSourceScopedAgentToolEvents as o, AgentToolRunsProvider as r, AgentToolEventSource as t };
@@ -1,6 +1,6 @@
1
1
  import { t as cx } from "./class-names-BiMDVpUo.js";
2
2
  import { Select } from "./components/foundations/Select.js";
3
- import { t as CopyButton } from "./copy-button-4YvddK4e.js";
3
+ import { t as CopyButton } from "./copy-button-CsNSSKYG.js";
4
4
  import * as React from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { createHighlighter } from "shiki";
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "./class-names-BiMDVpUo.js";
2
- import { C as FileIcon, T as FolderOpenIcon, m as ChevronRightIcon, w as FolderIcon } from "./icons-B4mGvCvc.js";
2
+ import { C as FileIcon, T as FolderOpenIcon, m as ChevronRightIcon, w as FolderIcon } from "./icons-B1Qw05te.js";
3
3
  import { t as NavigationLink } from "./navigation-link-kqMa81v5.js";
4
4
  import * as React from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "./class-names-BiMDVpUo.js";
2
- import { G as SearchIcon, f as ChevronDownIcon } from "./icons-B4mGvCvc.js";
2
+ import { G as SearchIcon, f as ChevronDownIcon } from "./icons-B1Qw05te.js";
3
3
  import { Button } from "./components/foundations/Button.js";
4
4
  import { Dialog } from "./components/foundations/Dialog.js";
5
5
  import { a as titleCase } from "./format-CmopcfqJ.js";
@@ -1,7 +1,7 @@
1
- import { J as SpinnerIcon } from "./icons-B4mGvCvc.js";
1
+ import { J as SpinnerIcon } from "./icons-B1Qw05te.js";
2
2
  import { TransitionSurface } from "./components/foundations/TransitionSurface.js";
3
3
  import { AgentChat } from "./components/agents-sdk/AgentChat.js";
4
- import { AgentToolRunsProvider, useOptionalAgentToolRuns } from "./components/agents-sdk/AgentToolRunsContext.js";
4
+ import { AgentToolRunsProvider, useOptionalAgentToolRuns, useSourceScopedAgentToolEvents } from "./components/agents-sdk/AgentToolRunsContext.js";
5
5
  import { SubagentRunList } from "./components/agents-sdk/SubagentRunList.js";
6
6
  import { ThinkChatContext, ThinkChatLiveContext, useOptionalThinkChatContext, useThinkChatContext } from "./components/agents-sdk/ThinkChatContext.js";
7
7
  import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./components/agents-sdk/ThinkChatActivity.js";
@@ -11,19 +11,8 @@ import * as React from "react";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
12
  import { isTextUIPart } from "ai";
13
13
  import { useAgentChat } from "@cloudflare/think/react";
14
+ import { useAgent } from "agents/react";
14
15
  import { queryOptions, useQuery, useQueryClient } from "@tanstack/react-query";
15
- import { useAgent, useAgentToolEvents } from "agents/react";
16
- //#region src/components/_internal/use-agent-tool-events.ts
17
- function useSourceScopedAgentToolEvents(agent) {
18
- const agentTools = useAgentToolEvents({ agent });
19
- const sourceIdentity = JSON.stringify(agent.path);
20
- const resetAgentTools = React.useEffectEvent(() => agentTools.resetLocalState());
21
- React.useEffect(() => {
22
- resetAgentTools();
23
- }, [sourceIdentity]);
24
- return agentTools;
25
- }
26
- //#endregion
27
16
  //#region src/components/_internal/think-approvals.ts
28
17
  /**
29
18
  * Ambient approvals belong to their stub. An explicit different stub may only
@@ -343,4 +332,4 @@ const ThinkChat = {
343
332
  createActivityRenderer: createThinkChatActivityRenderer
344
333
  };
345
334
  //#endregion
346
- export { thinkPendingExecutionApprovalsQueryOptions as a, resolveThinkApprovalProps as c, ThinkChatRoot as i, useSourceScopedAgentToolEvents as l, ThinkChatMessages as n, useThinkChat as o, ThinkChatProvider as r, useThinkPendingExecutionApprovals as s, ThinkChat as t };
335
+ export { thinkPendingExecutionApprovalsQueryOptions as a, resolveThinkApprovalProps as c, ThinkChatRoot as i, ThinkChatMessages as n, useThinkChat as o, ThinkChatProvider as r, useThinkPendingExecutionApprovals as s, ThinkChat as t };
@@ -1,6 +1,6 @@
1
- import { A as MaximizeIcon, d as CheckIcon, h as CodeIcon, r as ArrowLeftIcon, tt as WarningIcon, x as EyeIcon, y as DownloadIcon } from "./icons-B4mGvCvc.js";
1
+ import { A as MaximizeIcon, d as CheckIcon, h as CodeIcon, r as ArrowLeftIcon, tt as WarningIcon, x as EyeIcon, y as DownloadIcon } from "./icons-B1Qw05te.js";
2
2
  import { r as formatClock } from "./format-CmopcfqJ.js";
3
- import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-B5I7wje1.js";
3
+ import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-CM5gfmdq.js";
4
4
  import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./components/agents-sdk/WorkspaceFile.js";
5
5
  import { c as useWorkspaceNavigationContext, s as useWorkspaceNavigationRestoration } from "./WorkspaceLink-DZeLe_jN.js";
6
6
  import { n as createWorkspaceRehypePlugins, t as WorkspaceMessageResponse } from "./WorkspaceMessageResponse-BWbkIELl.js";
@@ -1,5 +1,5 @@
1
1
  import { inferFaviconUrl } from "../../utils/favicon.js";
2
- import { $ as TerminalIcon, B as PencilIcon, C as FileIcon, F as MonitorIcon, G as SearchIcon, O as InfoIcon, k as LinkIcon, nt as WrenchIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
2
+ import { $ as TerminalIcon, B as PencilIcon, C as FileIcon, F as MonitorIcon, G as SearchIcon, O as InfoIcon, k as LinkIcon, nt as WrenchIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
3
3
  import * as React from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/components/agents-sdk/AgentActivity.tsx
@@ -1,10 +1,10 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { C as FileIcon, J as SpinnerIcon, j as McpIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
3
- import { ActivityHeader } from "../ai-sdk/Activity.js";
4
- import { Button } from "../foundations/Button.js";
2
+ import { C as FileIcon, J as SpinnerIcon, j as McpIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
5
3
  import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
4
+ import { ActivityHeader } from "../ai-sdk/Activity.js";
6
5
  import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
7
6
  import { AppIcon } from "../foundations/AppIcon.js";
7
+ import { Button } from "../foundations/Button.js";
8
8
  import "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  //#region src/components/agents-sdk/AgentActivityPreview.tsx
@@ -1,25 +1,25 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
+ import { B as PencilIcon, H as PlusIcon, J as SpinnerIcon, L as MoveToFrontIcon, U as QueueIcon, W as RefreshIcon, et as TrashIcon, t as ArchiveIcon } from "../../icons-B1Qw05te.js";
2
3
  import { ExpansionStateProvider } from "../ai-sdk/ExpansionState.js";
3
- import { B as PencilIcon, H as PlusIcon, J as SpinnerIcon, L as MoveToFrontIcon, U as QueueIcon, W as RefreshIcon, et as TrashIcon, t as ArchiveIcon } from "../../icons-B4mGvCvc.js";
4
4
  import { Button } from "../foundations/Button.js";
5
- import { AgentChatMessageEditor } from "../ai-sdk/AgentChatMessageEditor.js";
6
5
  import { IconButton } from "../foundations/IconButton.js";
7
- import { Menu } from "../foundations/Menu.js";
8
- import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommandComposer, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputPermissionSelector, PromptInputReferences, PromptInputSubmit, PromptInputTextarea, PromptInputTools, PromptInputTray, usePromptInputAttachments } from "../ai-sdk/PromptInput.js";
9
- import { AgentChatStartScreen } from "../ai-sdk/AgentChatStartScreen.js";
10
6
  import { Message, MessageAction, MessageActions } from "../ai-sdk/Message.js";
11
7
  import { AgentMessageParts } from "../ai-sdk/AgentMessageParts.js";
12
- import { Marker, MarkerContent } from "../foundations/Marker.js";
13
- import { t as CopyButton } from "../../copy-button-4YvddK4e.js";
14
8
  import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "../ai-sdk/Context.js";
15
- import { VirtualMessageScroller } from "../ai-sdk/MessageScrollerVirtual.js";
16
9
  import { EmptyState } from "../foundations/EmptyState.js";
10
+ import { VirtualMessageScroller } from "../ai-sdk/MessageScrollerVirtual.js";
11
+ import { Menu } from "../foundations/Menu.js";
12
+ import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommandComposer, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputPermissionSelector, PromptInputReferences, PromptInputSubmit, PromptInputTextarea, PromptInputTools, PromptInputTray, usePromptInputAttachments } from "../ai-sdk/PromptInput.js";
13
+ import { AgentChatStartScreen } from "../ai-sdk/AgentChatStartScreen.js";
14
+ import { AgentChatMessageEditor } from "../ai-sdk/AgentChatMessageEditor.js";
15
+ import { Marker, MarkerContent } from "../foundations/Marker.js";
17
16
  import { TransitionSurface } from "../foundations/TransitionSurface.js";
18
17
  import { PromptInputApproval, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals } from "./PromptInputApproval.js";
18
+ import { t as CopyButton } from "../../copy-button-CsNSSKYG.js";
19
19
  import * as React from "react";
20
20
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
- import { isTextUIPart } from "ai";
22
21
  import { isCompactionMessage } from "agents/experimental/memory/utils";
22
+ import { isTextUIPart } from "ai";
23
23
  //#region src/components/agents-sdk/AgentChat.tsx
24
24
  /**
25
25
  * Agents exports this helper from `agents/sessions` after cloudflare/agents#1896;
@@ -113,10 +113,14 @@ function getCopyableResponseText(message) {
113
113
  }
114
114
  function AgentChatAssistantActions({ message, responseNumber, showCopy, showRetry, onRegenerate, onCopyStatus }) {
115
115
  const copyText = getCopyableResponseText(message);
116
- if ((!showCopy || !copyText) && !showRetry) return null;
116
+ const hasCopy = showCopy && copyText !== void 0;
117
+ const hasRetry = showRetry && onRegenerate !== void 0;
118
+ const hasActions = hasCopy || hasRetry;
117
119
  return /* @__PURE__ */ jsxs(MessageActions, {
118
120
  "aria-label": `Actions for response ${responseNumber}`,
119
- children: [showCopy && copyText ? /* @__PURE__ */ jsx(CopyButton, {
121
+ "aria-hidden": hasActions ? void 0 : true,
122
+ className: "message__actions--reserved",
123
+ children: [hasCopy ? /* @__PURE__ */ jsx(CopyButton, {
120
124
  className: "message__action",
121
125
  label: `Copy response ${responseNumber}`,
122
126
  tooltip: "Copy response",
@@ -124,7 +128,7 @@ function AgentChatAssistantActions({ message, responseNumber, showCopy, showRetr
124
128
  size: "sm",
125
129
  onCopy: () => onCopyStatus(`Response ${responseNumber} copied.`),
126
130
  onError: () => onCopyStatus(`Could not copy response ${responseNumber}. Try again.`)
127
- }) : null, showRetry && onRegenerate ? /* @__PURE__ */ jsx(MessageAction, {
131
+ }) : null, hasRetry ? /* @__PURE__ */ jsx(MessageAction, {
128
132
  label: "Retry",
129
133
  tooltip: "Regenerate response",
130
134
  onClick: () => onRegenerate(message.id),
@@ -151,7 +155,7 @@ function isCompactedPart(message, partIndex) {
151
155
  * referentially stable across updates (AI SDK chat state does); see
152
156
  * "Transcript rendering performance" in docs/think-chat.md.
153
157
  */
154
- function AgentChatTranscriptRowBodyImpl({ message, messageIndex, status, renderPart, renderMessageAfter, editing, canEdit, onEditAndResend, onStartEdit, onCancelEdit, onFinishEdit, editButtonRef, responseNumber, showAssistantActions, showCopy, showRetry, onRegenerate, onCopyStatus }) {
158
+ function AgentChatTranscriptRowBodyImpl({ message, messageIndex, status, renderPart, renderMessageAfter, editing, canEdit, editDisabled, onEditAndResend, onStartEdit, onCancelEdit, onFinishEdit, editButtonRef, responseNumber, showAssistantActions, showCopy, showRetry, onRegenerate, onCopyStatus }) {
155
159
  return /* @__PURE__ */ jsx(Fragment, { children: isCompactionMessage(message) ? /* @__PURE__ */ jsx(Marker, {
156
160
  variant: "separator",
157
161
  children: /* @__PURE__ */ jsx(MarkerContent, { children: "Context compacted" })
@@ -183,8 +187,12 @@ function AgentChatTranscriptRowBodyImpl({ message, messageIndex, status, renderP
183
187
  }),
184
188
  canEdit && getEditableUserText(message) !== void 0 ? /* @__PURE__ */ jsx(MessageActions, {
185
189
  "aria-label": "Message actions",
190
+ "aria-hidden": editDisabled || void 0,
191
+ className: "message__actions--inline",
192
+ "data-unavailable": editDisabled || void 0,
186
193
  children: /* @__PURE__ */ jsx(MessageAction, {
187
194
  ref: editButtonRef,
195
+ disabled: editDisabled,
188
196
  label: "Edit message",
189
197
  tooltip: "Edit and resend",
190
198
  onClick: () => onStartEdit(message.id),
@@ -444,7 +452,7 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
444
452
  const contextUsage = contextWindow ? getContextUsage(messages) : void 0;
445
453
  const newestAssistantIndex = messages.findLastIndex((message) => message.role === "assistant" && !isCompactionMessage(message));
446
454
  const lastAssistantIndex = onRegenerate && status !== "streaming" && status !== "submitted" ? newestAssistantIndex : -1;
447
- const lastUserIndex = onEditAndResend && !disabled && status !== "streaming" && status !== "submitted" ? messages.findLastIndex((message) => message.role === "user") : -1;
455
+ const lastUserIndex = onEditAndResend ? messages.findLastIndex((message) => message.role === "user") : -1;
448
456
  const [editingMessageId, setEditingMessageId] = React.useState();
449
457
  const restoreEditFocus = React.useRef(false);
450
458
  const editButtonRef = React.useRef(null);
@@ -479,6 +487,7 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
479
487
  renderMessageAfter,
480
488
  editing: editingMessageId === message.id,
481
489
  canEdit: messageIndex === lastUserIndex,
490
+ editDisabled: disabled || busy,
482
491
  onEditAndResend,
483
492
  onStartEdit: handleStartEdit,
484
493
  onCancelEdit: handleCancelEdit,
@@ -1,2 +1,2 @@
1
- import { i as useOptionalAgentToolRuns, n as AgentToolRunsProvider, r as AgentToolRunsProviderProps, t as AgentToolEventsValue } from "../../AgentToolRunsContext-Cgve-Upx.js";
2
- export { AgentToolEventsValue, AgentToolRunsProvider, AgentToolRunsProviderProps, useOptionalAgentToolRuns };
1
+ import { a as useOptionalAgentToolRuns, i as AgentToolRunsProviderProps, n as AgentToolEventsValue, o as useSourceScopedAgentToolEvents, r as AgentToolRunsProvider, t as AgentToolEventSource } from "../../AgentToolRunsContext-BCVqCtJ1.js";
2
+ export { AgentToolEventSource, AgentToolEventsValue, AgentToolRunsProvider, AgentToolRunsProviderProps, useOptionalAgentToolRuns, useSourceScopedAgentToolEvents };
@@ -1,6 +1,25 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { useAgentToolEvents } from "agents/react";
3
4
  //#region src/components/agents-sdk/AgentToolRunsContext.tsx
5
+ /**
6
+ * The one retained-run subscription for a parent connection: upstream
7
+ * `useAgentToolEvents` scoped to the connection's source identity, so runs
8
+ * from a previous thread cannot leak across a source swap. Call it beside the
9
+ * `useAgent` call that owns the connection — the server replays retained runs
10
+ * once per socket connect, so a later mount misses existing runs — and share
11
+ * the one value with every surface that reads runs (the chat shell and a
12
+ * run-detail route read the same projection, never two subscriptions).
13
+ */
14
+ function useSourceScopedAgentToolEvents(agent) {
15
+ const agentTools = useAgentToolEvents({ agent });
16
+ const sourceIdentity = JSON.stringify(agent.path);
17
+ const resetAgentTools = React.useEffectEvent(() => agentTools.resetLocalState());
18
+ React.useEffect(() => {
19
+ resetAgentTools();
20
+ }, [sourceIdentity]);
21
+ return agentTools;
22
+ }
4
23
  const AgentToolRunsContext = React.createContext(null);
5
24
  /** Provides one parent connection's retained Agent Tool event projection. */
6
25
  function AgentToolRunsProvider({ agentTools, children }) {
@@ -13,4 +32,4 @@ function useOptionalAgentToolRuns() {
13
32
  return React.useContext(AgentToolRunsContext);
14
33
  }
15
34
  //#endregion
16
- export { AgentToolRunsProvider, useOptionalAgentToolRuns };
35
+ export { AgentToolRunsProvider, useOptionalAgentToolRuns, useSourceScopedAgentToolEvents };
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { A as MaximizeIcon, J as SpinnerIcon } from "../../icons-B4mGvCvc.js";
2
+ import { A as MaximizeIcon, J as SpinnerIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Button } from "../foundations/Button.js";
4
4
  import { Dialog } from "../foundations/Dialog.js";
5
5
  import { TransitionSurface } from "../foundations/TransitionSurface.js";
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { V as PlayIcon, z as PauseIcon } from "../../icons-B4mGvCvc.js";
2
+ import { V as PlayIcon, z as PauseIcon } from "../../icons-B1Qw05te.js";
3
3
  import { IconButton } from "../foundations/IconButton.js";
4
4
  import { r as formatClock } from "../../format-CmopcfqJ.js";
5
5
  import { EmptyState } from "../foundations/EmptyState.js";
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { J as SpinnerIcon, rt as XIcon } from "../../icons-B4mGvCvc.js";
2
+ import { J as SpinnerIcon, rt as XIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Button } from "../foundations/Button.js";
4
4
  import { Tabs } from "../foundations/Tabs.js";
5
5
  import { BrowserLiveView } from "./BrowserLiveView.js";
@@ -1,9 +1,9 @@
1
1
  import { getMcpServerEntry, getMcpServerRuntimeState } from "../../utils/mcp-server-catalog.js";
2
2
  import { t as cx } from "../../class-names-BiMDVpUo.js";
3
- import { J as SpinnerIcon, d as CheckIcon, j as McpIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
3
+ import { J as SpinnerIcon, d as CheckIcon, j as McpIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
4
4
  import { Button } from "../foundations/Button.js";
5
- import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
6
5
  import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
6
+ import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
7
7
  import { DescriptionList } from "../foundations/DescriptionList.js";
8
8
  import { n as getMcpServerConnectionKind } from "../../mcp-server-U71zhxFF.js";
9
9
  import * as React from "react";
@@ -1,9 +1,9 @@
1
1
  import { CUSTOM_MCP_SERVER_CARD } from "../../utils/mcp-server-catalog.js";
2
2
  import { t as cx } from "../../class-names-BiMDVpUo.js";
3
3
  import { Button } from "../foundations/Button.js";
4
+ import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
4
5
  import { Field } from "../foundations/Field.js";
5
6
  import { Form } from "../foundations/Form.js";
6
- import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
7
7
  import { Fieldset } from "../foundations/Fieldset.js";
8
8
  import * as React from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,13 +1,13 @@
1
1
  import { getMcpServerEntry } from "../../utils/mcp-server-catalog.js";
2
2
  import { t as cx } from "../../class-names-BiMDVpUo.js";
3
- import { H as PlusIcon, J as SpinnerIcon, b as EllipsisIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
3
+ import { H as PlusIcon, J as SpinnerIcon, b as EllipsisIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
4
+ import { AppIcon } from "../foundations/AppIcon.js";
4
5
  import { Button } from "../foundations/Button.js";
5
- import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
6
6
  import { IconButton } from "../foundations/IconButton.js";
7
7
  import { Dialog } from "../foundations/Dialog.js";
8
8
  import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
9
9
  import { Separator } from "../foundations/Separator.js";
10
- import { AppIcon } from "../foundations/AppIcon.js";
10
+ import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
11
11
  import { n as getMcpServerConnectionKind, t as McpServerIcon } from "../../mcp-server-U71zhxFF.js";
12
12
  import { SearchField } from "../foundations/SearchField.js";
13
13
  import * as React from "react";
@@ -1,10 +1,10 @@
1
1
  import { getMcpServerEntry, getMcpServerRuntimeState } from "../../utils/mcp-server-catalog.js";
2
2
  import { n as mergeBaseClassName } from "../../class-names-BiMDVpUo.js";
3
- import { J as SpinnerIcon, P as MinusIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
3
+ import { J as SpinnerIcon, P as MinusIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
4
4
  import { buttonVariants } from "../foundations/Button.js";
5
- import { Menu } from "../foundations/Menu.js";
6
5
  import { Dialog } from "../foundations/Dialog.js";
7
6
  import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
7
+ import { Menu } from "../foundations/Menu.js";
8
8
  import { PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger } from "../ai-sdk/PromptInput.js";
9
9
  import { n as getMcpServerConnectionKind, t as McpServerIcon } from "../../mcp-server-U71zhxFF.js";
10
10
  import { McpConnectorForm } from "./McpConnectorForm.js";
@@ -1,2 +1,2 @@
1
- import { _ as getCloudflareModelProvider, a as ModelSelectorEmpty, b as normalizeCloudflareModelSelectorModels, c as ModelSelectorItem, d as ModelSelectorLogoGroup, f as ModelSelectorName, g as formatCloudflareModelProvider, h as ModelSelectorTrigger, i as ModelSelectorDialog, l as ModelSelectorList, m as ModelSelectorSource, n as ModelSelector, o as ModelSelectorGroup, p as ModelSelectorSeparator, r as ModelSelectorContent, s as ModelSelectorInput, t as CloudflareModelSelector, u as ModelSelectorLogo, v as isCloudflareRunnableModelId, x as readCloudflareModelId, y as listCloudflareModelSelectorOptions } from "../../ModelSelector-DZcpUBgn.js";
1
+ import { _ as getCloudflareModelProvider, a as ModelSelectorEmpty, b as normalizeCloudflareModelSelectorModels, c as ModelSelectorItem, d as ModelSelectorLogoGroup, f as ModelSelectorName, g as formatCloudflareModelProvider, h as ModelSelectorTrigger, i as ModelSelectorDialog, l as ModelSelectorList, m as ModelSelectorSource, n as ModelSelector, o as ModelSelectorGroup, p as ModelSelectorSeparator, r as ModelSelectorContent, s as ModelSelectorInput, t as CloudflareModelSelector, u as ModelSelectorLogo, v as isCloudflareRunnableModelId, x as readCloudflareModelId, y as listCloudflareModelSelectorOptions } from "../../ModelSelector-DzdEs2fX.js";
2
2
  export { CloudflareModelSelector, ModelSelector, ModelSelectorContent, ModelSelectorDialog, ModelSelectorEmpty, ModelSelectorGroup, ModelSelectorInput, ModelSelectorItem, ModelSelectorList, ModelSelectorLogo, ModelSelectorLogoGroup, ModelSelectorName, ModelSelectorSeparator, ModelSelectorSource, ModelSelectorTrigger, formatCloudflareModelProvider, getCloudflareModelProvider, isCloudflareRunnableModelId, listCloudflareModelSelectorOptions, normalizeCloudflareModelSelectorModels, readCloudflareModelId };
@@ -1,6 +1,6 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { ToolApproval } from "../ai-sdk/ToolApproval.js";
3
2
  import { ThinkExecutionApproval, ThinkPendingApproval, getPausedExecution } from "./ThinkPendingApproval.js";
3
+ import { ToolApproval } from "../ai-sdk/ToolApproval.js";
4
4
  import "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { isToolUIPart } from "ai";
@@ -1,4 +1,4 @@
1
- import { c as BoxIcon, j as McpIcon } from "../../icons-B4mGvCvc.js";
1
+ import { c as BoxIcon, j as McpIcon } from "../../icons-B1Qw05te.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  //#region src/components/agents-sdk/PromptInputCommands.tsx
4
4
  /** Project whole upstream Agents MCP state into composer mention commands. */
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { J as SpinnerIcon, X as StopIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
2
+ import { J as SpinnerIcon, X as StopIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
3
3
  import "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/components/agents-sdk/SubagentRunIndicator.tsx
@@ -1,8 +1,8 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { l as BrainIcon } from "../../icons-B4mGvCvc.js";
2
+ import { l as BrainIcon } from "../../icons-B1Qw05te.js";
3
+ import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
3
4
  import { buttonVariants } from "../foundations/Button.js";
4
5
  import { Tooltip } from "../foundations/Tooltip.js";
5
- import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
6
6
  import { SubagentRunIndicator, getSubagentRunName, getSubagentRunTooltip } from "./SubagentRunIndicator.js";
7
7
  import "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { i as AgentMessageRenderPartContext } from "../../AgentMessageParts-C7L-Mv9U.js";
2
2
  import { ct as PromptInputMessage } from "../../PromptInput-DOyee1kM.js";
3
3
  import { r as AgentChatProps } from "../../AgentChat-CV-GuYA6.js";
4
- import { i as useOptionalAgentToolRuns, n as AgentToolRunsProvider, r as AgentToolRunsProviderProps, t as AgentToolEventsValue } from "../../AgentToolRunsContext-Cgve-Upx.js";
4
+ import { a as useOptionalAgentToolRuns, i as AgentToolRunsProviderProps, n as AgentToolEventsValue, o as useSourceScopedAgentToolEvents, r as AgentToolRunsProvider, t as AgentToolEventSource } from "../../AgentToolRunsContext-BCVqCtJ1.js";
5
5
  import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../../BrowserLiveView-tJTWkoyu.js";
6
6
  import { n as BrowserReplayProps, t as BrowserReplay } from "../../BrowserReplay-B0BQZr-N.js";
7
7
  import { o as UseSessionCompactionResult } from "../../SessionCompaction-CmTJFpzj.js";
@@ -15,8 +15,8 @@ import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as worksp
15
15
  import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../../WorkspaceExplorer-DygQnEyi.js";
16
16
  import * as React from "react";
17
17
  import { UIMessage } from "ai";
18
- import { DataTag, UndefinedInitialDataOptions } from "@tanstack/react-query";
19
18
  import { UseAgentOptions } from "agents/react";
19
+ import { DataTag, UndefinedInitialDataOptions } from "@tanstack/react-query";
20
20
  import { PendingApproval, Think } from "@cloudflare/think";
21
21
  import { AgentStub } from "agents/client";
22
22
  import { UseVoiceInputReturn } from "@cloudflare/voice/react";
@@ -253,4 +253,4 @@ declare const ThinkChat: {
253
253
  createActivityRenderer: typeof createThinkChatActivityRenderer;
254
254
  };
255
255
  //#endregion
256
- export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatDraft, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, ThinkPendingExecutionApprovalsQueryKey, ThinkPendingExecutionApprovalsQueryOptions, ThinkRecoveryNotice, type ThinkRecoveryNoticeProps, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceQueryKey, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
256
+ export { type AgentToolEventSource, type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatDraft, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, ThinkPendingExecutionApprovalsQueryKey, ThinkPendingExecutionApprovalsQueryOptions, ThinkRecoveryNotice, type ThinkRecoveryNoticeProps, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceQueryKey, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useSourceScopedAgentToolEvents, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
@@ -1,4 +1,4 @@
1
- import { AgentToolRunsProvider, useOptionalAgentToolRuns } from "./AgentToolRunsContext.js";
1
+ import { AgentToolRunsProvider, useOptionalAgentToolRuns, useSourceScopedAgentToolEvents } from "./AgentToolRunsContext.js";
2
2
  import { BrowserLiveView } from "./BrowserLiveView.js";
3
3
  import { BrowserReplay } from "./BrowserReplay.js";
4
4
  import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
@@ -6,7 +6,7 @@ import { isThinkChatActivityPart } from "./ThinkChatToolParts.js";
6
6
  import { describeThinkChatActivityPart } from "./ThinkChatActivitySummary.js";
7
7
  import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./ThinkChatActivity.js";
8
8
  import { ThinkRecoveryNotice } from "./ThinkRecoveryNotice.js";
9
- import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-BUoXVfrn.js";
9
+ import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-en0UbkVv.js";
10
10
  import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
11
11
  import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
12
- export { AgentToolRunsProvider, BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, ThinkRecoveryNotice, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
12
+ export { AgentToolRunsProvider, BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, ThinkRecoveryNotice, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useSourceScopedAgentToolEvents, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
@@ -1,8 +1,8 @@
1
+ import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
1
2
  import { useExpansionState } from "../ai-sdk/ExpansionState.js";
2
3
  import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityText, ActivityTrigger } from "../ai-sdk/Activity.js";
3
4
  import { Button } from "../foundations/Button.js";
4
5
  import { MessageResponse } from "../ai-sdk/Message.js";
5
- import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
6
6
  import { useOptionalAgentToolRuns } from "./AgentToolRunsContext.js";
7
7
  import { SubagentRunList } from "./SubagentRunList.js";
8
8
  import { useOptionalThinkChatLive } from "./ThinkChatContext.js";
@@ -1,7 +1,7 @@
1
1
  import { ActivityOutput, ActivityPanel } from "../ai-sdk/Activity.js";
2
2
  import { Tabs } from "../foundations/Tabs.js";
3
- import { t as CodeBlock } from "../../CodeBlock-B5I7wje1.js";
4
3
  import { BrowserLiveView } from "./BrowserLiveView.js";
4
+ import { t as CodeBlock } from "../../CodeBlock-CM5gfmdq.js";
5
5
  import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
6
6
  import { displayUrl, isSessionContextToolFailure } from "./ThinkChatToolParts.js";
7
7
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { $ as TerminalIcon, C as FileIcon, O as InfoIcon, W as RefreshIcon, d as CheckIcon, n as ArrowDownIcon, rt as XIcon } from "../../icons-B4mGvCvc.js";
2
+ import { $ as TerminalIcon, C as FileIcon, O as InfoIcon, W as RefreshIcon, d as CheckIcon, n as ArrowDownIcon, rt as XIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityOutput, ActivityPanel, ActivityTrigger } from "../ai-sdk/Activity.js";
4
4
  import { formatThinkExecutionRunProgress, formatThinkExecutionStatus, formatThinkExecutionTimestamp, getThinkExecutionRunError, getThinkExecutionRunId, getThinkExecutionRunProgressedAt, getThinkExecutionRunProgressedLabel, getThinkExecutionRunStatus, getThinkExecutionRunTitle, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
5
5
  import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { J as SpinnerIcon, O as InfoIcon, d as CheckIcon, rt as XIcon, z as PauseIcon } from "../../icons-B4mGvCvc.js";
2
+ import { J as SpinnerIcon, O as InfoIcon, d as CheckIcon, rt as XIcon, z as PauseIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Tooltip } from "../foundations/Tooltip.js";
4
4
  import { formatThinkExecutionRunProgress, formatThinkExecutionStatus, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, getThinkExecutionRunSubtitle, getThinkExecutionRunTitle } from "./ThinkExecutionRun.js";
5
5
  import "react";
@@ -1,11 +1,11 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { W as RefreshIcon, b as EllipsisIcon } from "../../icons-B4mGvCvc.js";
2
+ import { W as RefreshIcon, b as EllipsisIcon } from "../../icons-B1Qw05te.js";
3
+ import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
3
4
  import { buttonVariants } from "../foundations/Button.js";
4
5
  import { IconButton } from "../foundations/IconButton.js";
5
- import { Menu } from "../foundations/Menu.js";
6
6
  import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
7
- import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
8
7
  import { EmptyState } from "../foundations/EmptyState.js";
8
+ import { Menu } from "../foundations/Menu.js";
9
9
  import { AppTopBar } from "../general-purpose/AppTopBar.js";
10
10
  import { getThinkExecutionRunAccessibleName, getThinkExecutionRunId, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, isSameThinkExecutionRun, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
11
11
  import { ThinkExecutionRunSummary } from "./ThinkExecutionStatus.js";
@@ -1,4 +1,5 @@
1
1
  import { l as WorkspaceNavigationAdapter } from "../../WorkspaceLink-DQogVe8E.js";
2
+ import { n as AgentToolEventsValue } from "../../AgentToolRunsContext-BCVqCtJ1.js";
2
3
  import { McpPluginCatalogProps } from "./McpPluginCatalog.js";
3
4
  import { r as WorkspaceFileAssetResolver } from "../../WorkspaceFile-C8Riev9j.js";
4
5
  import { a as WorkspaceSource } from "../../Workspace-EhvvlHOB.js";
@@ -45,6 +46,13 @@ interface ThinkFullAppConversation<AgentT extends ThinkFullAppAgent<State>, Stat
45
46
  agent: ReturnType<typeof useAgent<AgentT, State>>;
46
47
  /** The `useAgentChat` value from `@cloudflare/think/react` used by the chat surface. */
47
48
  chat: ReturnType<typeof useAgentChat<State, MessageT>>;
49
+ /**
50
+ * The `useSourceScopedAgentToolEvents(agent)` value for this connection.
51
+ * The app owns the subscription — mounted beside the `useAgent` call, since
52
+ * the server replays retained runs once per socket connect — so a run-detail
53
+ * route can read the same projection. ThinkFullApp never subscribes itself.
54
+ */
55
+ agentTools: AgentToolEventsValue<MessageT["parts"][number]>;
48
56
  }
49
57
  interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> extends React.HTMLAttributes<HTMLDivElement> {
50
58
  /**
@@ -1,11 +1,11 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { $ as TerminalIcon, C as FileIcon, J as SpinnerIcon, c as BoxIcon, f as ChevronDownIcon } from "../../icons-B4mGvCvc.js";
2
+ import { $ as TerminalIcon, C as FileIcon, J as SpinnerIcon, c as BoxIcon, f as ChevronDownIcon } from "../../icons-B1Qw05te.js";
3
3
  import { Button } from "../foundations/Button.js";
4
4
  import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
5
5
  import { ScrollArea } from "../foundations/ScrollArea.js";
6
6
  import { McpPluginCatalog } from "./McpPluginCatalog.js";
7
- import { c as resolveThinkApprovalProps, l as useSourceScopedAgentToolEvents, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-BUoXVfrn.js";
8
7
  import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../../WorkspaceLink-DZeLe_jN.js";
8
+ import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-en0UbkVv.js";
9
9
  import { AppTopBar } from "../general-purpose/AppTopBar.js";
10
10
  import { useWorkspace } from "./Workspace.js";
11
11
  import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
@@ -49,8 +49,7 @@ function PluginsPanel({ config }) {
49
49
  * Approval discovery and background-agent events need a live connection, so they
50
50
  * live here rather than in the shell, which also renders before there is one.
51
51
  */
52
- function ThinkFullAppThreadChat({ agent, chat, messages, renderAgentToolRunLink, sourceKey }) {
53
- const agentTools = useSourceScopedAgentToolEvents(agent);
52
+ function ThinkFullAppThreadChat({ agent, agentTools, chat, messages, renderAgentToolRunLink, sourceKey }) {
54
53
  const approvals = useThinkPendingExecutionApprovals(agent.stub, sourceKey, `${chat.messages.length}:${chat.status}`, messages?.approvalsEnabled !== false);
55
54
  const resolvedMessages = React.useMemo(() => {
56
55
  const approvalProps = resolveThinkApprovalProps({
@@ -1,5 +1,5 @@
1
- import { AgentChatTurnError } from "../ai-sdk/AgentChatTurnError.js";
2
1
  import { TransitionSurface } from "../foundations/TransitionSurface.js";
2
+ import { AgentChatTurnError } from "../ai-sdk/AgentChatTurnError.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/agents-sdk/ThinkRecoveryNotice.tsx
5
5
  function connectionReason(error) {
@@ -1,9 +1,9 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { H as PlusIcon } from "../../icons-B4mGvCvc.js";
2
+ import { H as PlusIcon } from "../../icons-B1Qw05te.js";
3
+ import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
3
4
  import { buttonVariants } from "../foundations/Button.js";
4
5
  import { Tooltip } from "../foundations/Tooltip.js";
5
6
  import { t as capitalize } from "../../format-CmopcfqJ.js";
6
- import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
7
7
  import { SearchField } from "../foundations/SearchField.js";
8
8
  import { ToggleGroup } from "../foundations/ToggleGroup.js";
9
9
  import { getThinkRoutineNextRun } from "./ThinkRoutine.js";
@@ -1,11 +1,11 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { J as SpinnerIcon } from "../../icons-B4mGvCvc.js";
2
+ import { J as SpinnerIcon } from "../../icons-B1Qw05te.js";
3
+ import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
3
4
  import { Button, buttonVariants } from "../foundations/Button.js";
5
+ import { Select } from "../foundations/Select.js";
4
6
  import { Field } from "../foundations/Field.js";
5
7
  import { Form } from "../foundations/Form.js";
6
8
  import { Textarea } from "../foundations/Textarea.js";
7
- import { Select } from "../foundations/Select.js";
8
- import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
9
9
  import * as React from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  //#region src/components/agents-sdk/ThinkRoutineForm.tsx