@mcp-b/react-components 0.27.0 → 0.29.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 (62) hide show
  1. package/dist/{AgentChat-B6sgfQ_q.d.ts → AgentChat-Dy3cKCd-.d.ts} +13 -5
  2. package/dist/{AgentChatStartScreen-DDZ25aax.d.ts → AgentChatStartScreen-DXZ0hAX0.d.ts} +23 -5
  3. package/dist/{PromptInput-CES0WO4u.d.ts → PromptInput-B75Np5VB.d.ts} +7 -1
  4. package/dist/SessionCompaction-DMa1vv6Y.d.ts +59 -0
  5. package/dist/{ThinkChat-DVhCEjq-.js → ThinkChat-Bp-nAnoW.js} +14 -2
  6. package/dist/{ThinkChatActivity-DawPYgga.d.ts → ThinkChatActivity-Dq0lOAgw.d.ts} +3 -3
  7. package/dist/{ThinkChatActivitySummary-kr5fE0wg.d.ts → ThinkChatActivitySummary-F062wneC.d.ts} +1 -1
  8. package/dist/{ThinkChatToolParts-CSzVwMXf.d.ts → ThinkChatToolParts-BfroXQ4F.d.ts} +19 -1
  9. package/dist/{Workspace-CIycQ4xE.d.ts → Workspace-Bn6In4wi.d.ts} +5 -1
  10. package/dist/{WorkspaceExplorer-BCipn7Vd.d.ts → WorkspaceExplorer-D0aiscG6.d.ts} +1 -1
  11. package/dist/components/ActionGuide.d.ts +23 -5
  12. package/dist/components/ActionGuide.js +18 -4
  13. package/dist/components/AgentChat.d.ts +1 -1
  14. package/dist/components/AgentChat.js +24 -11
  15. package/dist/components/AgentChatStartScreen.d.ts +2 -2
  16. package/dist/components/AgentChatStartScreen.js +16 -5
  17. package/dist/components/AgentConnection.d.ts +1 -1
  18. package/dist/components/AgentToolDetail.js +1 -1
  19. package/dist/components/ChatGptSignInScreen.d.ts +9 -1
  20. package/dist/components/ChatGptSignInScreen.js +15 -4
  21. package/dist/components/ConversationTabPicker.d.ts +31 -0
  22. package/dist/components/ConversationTabPicker.js +117 -0
  23. package/dist/components/Goal.d.ts +28 -1
  24. package/dist/components/Goal.js +76 -3
  25. package/dist/components/McpConnectionRequest.d.ts +11 -5
  26. package/dist/components/McpConnectionRequest.js +22 -16
  27. package/dist/components/McpPluginCatalog.d.ts +1 -1
  28. package/dist/components/McpServerPicker.d.ts +18 -3
  29. package/dist/components/McpServerPicker.js +38 -23
  30. package/dist/components/Plan.d.ts +18 -1
  31. package/dist/components/Plan.js +17 -1
  32. package/dist/components/PromptInput.d.ts +2 -2
  33. package/dist/components/PromptInput.js +43 -5
  34. package/dist/components/SessionCompaction.d.ts +1 -58
  35. package/dist/components/SettingsFormDialog.d.ts +43 -0
  36. package/dist/components/SettingsFormDialog.js +110 -0
  37. package/dist/components/ThinkChat.d.ts +13 -7
  38. package/dist/components/ThinkChat.js +3 -3
  39. package/dist/components/ThinkChatActivity.d.ts +3 -3
  40. package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
  41. package/dist/components/ThinkChatToolPanels.d.ts +1 -1
  42. package/dist/components/ThinkChatToolPanels.js +1 -1
  43. package/dist/components/ThinkChatToolParts.d.ts +1 -1
  44. package/dist/components/ThinkFullApp.d.ts +6 -12
  45. package/dist/components/ThinkFullApp.js +4 -4
  46. package/dist/components/ThinkThreadPicker.d.ts +4 -1
  47. package/dist/components/ThinkThreadPicker.js +6 -1
  48. package/dist/components/Workspace.d.ts +2 -2
  49. package/dist/components/Workspace.js +10 -6
  50. package/dist/components/WorkspaceBrowser.d.ts +1 -1
  51. package/dist/components/WorkspaceExplorer.d.ts +3 -3
  52. package/dist/components/WorkspaceExplorer.js +2 -2
  53. package/dist/components/WorkspaceMountManager.d.ts +32 -0
  54. package/dist/components/WorkspaceMountManager.js +89 -0
  55. package/dist/{mcp-server-catalog-BewjV7Eq.d.ts → mcp-server-catalog-CO7GAl1f.d.ts} +1 -1
  56. package/dist/styles/chatgpt-sign-in-screen.css +10 -1
  57. package/dist/styles/conversation-tab-picker.css +24 -0
  58. package/dist/styles/index.css +2 -0
  59. package/dist/styles/workspace-mount-manager.css +24 -0
  60. package/dist/utils/mcp-server-catalog.d.ts +1 -1
  61. package/dist/utils/mcp-server-catalog.js +1 -1
  62. package/package.json +13 -13
@@ -1,2 +1,2 @@
1
- import { $ as PromptInputDictationProps, A as PromptInputCommandDefinition, At as PromptInputTabProps, B as PromptInputCommandItemProps, Bt as TextInputContext, C as PromptInputBodyProps, Ct as PromptInputTab, D as PromptInputCommand, Dt as PromptInputTabItemProps, E as PromptInputButtonTooltip, Et as PromptInputTabItem, F as PromptInputCommandGroupLabelProps, Ft as PromptInputTools, G as PromptInputCommandSeparatorProps, Gt as usePromptInputAttachments, H as PromptInputCommandListProps, Ht as getApprovalRequestId, I as PromptInputCommandGroupProps, It as PromptInputToolsProps, J as PromptInputContextItem, K as PromptInputCommandTrigger, Kt as usePromptInputController, L as PromptInputCommandInput, Lt as PromptInputTooltipConfig, M as PromptInputCommandEmptyProps, Mt as PromptInputTabsListProps, N as PromptInputCommandGroup, Nt as PromptInputTextarea, O as PromptInputCommandComposer, Ot as PromptInputTabLabel, P as PromptInputCommandGroupLabel, Pt as PromptInputTextareaProps, Q as PromptInputDictation, R as PromptInputCommandInputProps, Rt as PromptInputTray, S as PromptInputBody, St as PromptInputSubmitProps, T as PromptInputButtonProps, Tt as PromptInputTabBodyProps, U as PromptInputCommandProps, Ut as getApprovalStateKey, V as PromptInputCommandList, Vt as TooltipSide, W as PromptInputCommandSeparator, Wt as getPendingToolApprovals, X as PromptInputContextSelectorProps, Y as PromptInputContextSelector, Z as PromptInputControllerProps, _ as PromptInputApprovalProps, _t as PromptInputReferences, a as PromptInputActionAddAttachmentsProps, at as PromptInputHoverCardContent, b as PromptInputAttachments, bt as PromptInputSelectProps, c as PromptInputActionMenu, ct as PromptInputHoverCardTrigger, d as PromptInputActionMenuItem, dt as PromptInputPermissionSelector, et as PromptInputFooter, f as PromptInputActionMenuItemProps, ft as PromptInputPermissionSelectorProps, g as PromptInputApproval, gt as PromptInputReference, h as PromptInputActionMenuTriggerProps, ht as PromptInputProviderProps, i as PromptInputActionAddAttachments, it as PromptInputHoverCard, j as PromptInputCommandEmpty, jt as PromptInputTabsList, k as PromptInputCommandComposerProps, kt as PromptInputTabLabelProps, l as PromptInputActionMenuContent, lt as PromptInputHoverCardTriggerProps, m as PromptInputActionMenuTrigger, mt as PromptInputProvider, n as PermissionMode, nt as PromptInputHeader, o as PromptInputActionAddScreenshot, ot as PromptInputHoverCardContentProps, p as PromptInputActionMenuProps, pt as PromptInputProps, q as PromptInputContextAction, qt as useProviderAttachments, r as PromptInput, rt as PromptInputHeaderProps, s as PromptInputActionAddScreenshotProps, st as PromptInputHoverCardProps, t as AttachmentsContext, tt as PromptInputFooterProps, u as PromptInputActionMenuContentProps, ut as PromptInputMessage, v as PromptInputAttachment, vt as PromptInputReferencesProps, w as PromptInputButton, wt as PromptInputTabBody, x as PromptInputAttachmentsProps, xt as PromptInputSubmit, y as PromptInputAttachmentProps, yt as PromptInputSelect, z as PromptInputCommandItem, zt as PromptInputTrayProps } from "../PromptInput-CES0WO4u.js";
2
- export { AttachmentsContext, PermissionMode, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputApproval, PromptInputApprovalProps, PromptInputAttachment, PromptInputAttachmentProps, PromptInputAttachments, PromptInputAttachmentsProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandComposer, PromptInputCommandComposerProps, PromptInputCommandDefinition, PromptInputCommandEmpty, PromptInputCommandEmptyProps, PromptInputCommandGroup, PromptInputCommandGroupLabel, PromptInputCommandGroupLabelProps, PromptInputCommandGroupProps, PromptInputCommandInput, PromptInputCommandInputProps, PromptInputCommandItem, PromptInputCommandItemProps, PromptInputCommandList, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparator, PromptInputCommandSeparatorProps, PromptInputCommandTrigger, PromptInputContextAction, PromptInputContextItem, PromptInputContextSelector, PromptInputContextSelectorProps, PromptInputControllerProps, PromptInputDictation, PromptInputDictationProps, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputPermissionSelector, PromptInputPermissionSelectorProps, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputReference, PromptInputReferences, PromptInputReferencesProps, PromptInputSelect, PromptInputSelectProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputTools, PromptInputToolsProps, PromptInputTooltipConfig, PromptInputTray, PromptInputTrayProps, TextInputContext, TooltipSide, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
1
+ import { $ as PromptInputDictationProps, A as PromptInputCommandDefinition, At as PromptInputTabProps, B as PromptInputCommandItemProps, Bt as TextInputContext, C as PromptInputBodyProps, Ct as PromptInputTab, D as PromptInputCommand, Dt as PromptInputTabItemProps, E as PromptInputButtonTooltip, Et as PromptInputTabItem, F as PromptInputCommandGroupLabelProps, Ft as PromptInputTools, G as PromptInputCommandSeparatorProps, Gt as mcpPromptInputCommands, H as PromptInputCommandListProps, Ht as getApprovalRequestId, I as PromptInputCommandGroupProps, It as PromptInputToolsProps, J as PromptInputContextItem, Jt as usePromptInputController, K as PromptInputCommandTrigger, Kt as skillPromptInputCommands, L as PromptInputCommandInput, Lt as PromptInputTooltipConfig, M as PromptInputCommandEmptyProps, Mt as PromptInputTabsListProps, N as PromptInputCommandGroup, Nt as PromptInputTextarea, O as PromptInputCommandComposer, Ot as PromptInputTabLabel, P as PromptInputCommandGroupLabel, Pt as PromptInputTextareaProps, Q as PromptInputDictation, R as PromptInputCommandInputProps, Rt as PromptInputTray, S as PromptInputBody, St as PromptInputSubmitProps, T as PromptInputButtonProps, Tt as PromptInputTabBodyProps, U as PromptInputCommandProps, Ut as getApprovalStateKey, V as PromptInputCommandList, Vt as TooltipSide, W as PromptInputCommandSeparator, Wt as getPendingToolApprovals, X as PromptInputContextSelectorProps, Y as PromptInputContextSelector, Yt as useProviderAttachments, Z as PromptInputControllerProps, _ as PromptInputApprovalProps, _t as PromptInputReferences, a as PromptInputActionAddAttachmentsProps, at as PromptInputHoverCardContent, b as PromptInputAttachments, bt as PromptInputSelectProps, c as PromptInputActionMenu, ct as PromptInputHoverCardTrigger, d as PromptInputActionMenuItem, dt as PromptInputPermissionSelector, et as PromptInputFooter, f as PromptInputActionMenuItemProps, ft as PromptInputPermissionSelectorProps, g as PromptInputApproval, gt as PromptInputReference, h as PromptInputActionMenuTriggerProps, ht as PromptInputProviderProps, i as PromptInputActionAddAttachments, it as PromptInputHoverCard, j as PromptInputCommandEmpty, jt as PromptInputTabsList, k as PromptInputCommandComposerProps, kt as PromptInputTabLabelProps, l as PromptInputActionMenuContent, lt as PromptInputHoverCardTriggerProps, m as PromptInputActionMenuTrigger, mt as PromptInputProvider, n as PermissionMode, nt as PromptInputHeader, o as PromptInputActionAddScreenshot, ot as PromptInputHoverCardContentProps, p as PromptInputActionMenuProps, pt as PromptInputProps, q as PromptInputContextAction, qt as usePromptInputAttachments, r as PromptInput, rt as PromptInputHeaderProps, s as PromptInputActionAddScreenshotProps, st as PromptInputHoverCardProps, t as AttachmentsContext, tt as PromptInputFooterProps, u as PromptInputActionMenuContentProps, ut as PromptInputMessage, v as PromptInputAttachment, vt as PromptInputReferencesProps, w as PromptInputButton, wt as PromptInputTabBody, x as PromptInputAttachmentsProps, xt as PromptInputSubmit, y as PromptInputAttachmentProps, yt as PromptInputSelect, z as PromptInputCommandItem, zt as PromptInputTrayProps } from "../PromptInput-B75Np5VB.js";
2
+ export { AttachmentsContext, PermissionMode, PromptInput, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputApproval, PromptInputApprovalProps, PromptInputAttachment, PromptInputAttachmentProps, PromptInputAttachments, PromptInputAttachmentsProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandComposer, PromptInputCommandComposerProps, PromptInputCommandDefinition, PromptInputCommandEmpty, PromptInputCommandEmptyProps, PromptInputCommandGroup, PromptInputCommandGroupLabel, PromptInputCommandGroupLabelProps, PromptInputCommandGroupProps, PromptInputCommandInput, PromptInputCommandInputProps, PromptInputCommandItem, PromptInputCommandItemProps, PromptInputCommandList, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparator, PromptInputCommandSeparatorProps, PromptInputCommandTrigger, PromptInputContextAction, PromptInputContextItem, PromptInputContextSelector, PromptInputContextSelectorProps, PromptInputControllerProps, PromptInputDictation, PromptInputDictationProps, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputMessage, PromptInputPermissionSelector, PromptInputPermissionSelectorProps, PromptInputProps, PromptInputProvider, PromptInputProviderProps, PromptInputReference, PromptInputReferences, PromptInputReferencesProps, PromptInputSelect, PromptInputSelectProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputTools, PromptInputToolsProps, PromptInputTooltipConfig, PromptInputTray, PromptInputTrayProps, TextInputContext, TooltipSide, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, mcpPromptInputCommands, skillPromptInputCommands, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
@@ -1,6 +1,6 @@
1
1
  import { n as mergeBaseClassName, t as cx } from "../class-names-BiMDVpUo.js";
2
2
  import { Button } from "./Button.js";
3
- import { C as FileIcon, F as MonitorIcon, H as PlusIcon, J as SpinnerIcon, N as MicrophoneIcon, R as PaperclipIcon, X as StopIcon, Y as SquareIcon, a as ArrowUpIcon, d as CheckIcon, f as ChevronDownIcon, nt as WrenchIcon, rt as XIcon, tt as WarningIcon, w as FolderIcon } from "../icons-B4mGvCvc.js";
3
+ import { C as FileIcon, F as MonitorIcon, H as PlusIcon, J as SpinnerIcon, N as MicrophoneIcon, R as PaperclipIcon, X as StopIcon, Y as SquareIcon, a as ArrowUpIcon, c as BoxIcon, d as CheckIcon, f as ChevronDownIcon, j as McpIcon, nt as WrenchIcon, rt as XIcon, tt as WarningIcon, w as FolderIcon } from "../icons-B4mGvCvc.js";
4
4
  import { Tooltip } from "./Tooltip.js";
5
5
  import { IconButton } from "./IconButton.js";
6
6
  import { t as AttachmentPreview } from "../attachment-preview-DIs50Q0h.js";
@@ -250,7 +250,7 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
250
250
  const text = controller?.textInput.value ?? textarea?.value.trim() ?? "";
251
251
  const submittedFiles = await Promise.all(files.map(resolveSubmittedFile));
252
252
  try {
253
- await onSubmit?.({
253
+ const submission = onSubmit?.({
254
254
  text,
255
255
  files: submittedFiles
256
256
  }, event);
@@ -260,6 +260,7 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
260
260
  }
261
261
  controller?.textInput.clear();
262
262
  clearAttachments();
263
+ await submission;
263
264
  } catch {}
264
265
  }, [
265
266
  clearAttachments,
@@ -521,20 +522,29 @@ function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ..
521
522
  React.useImperativeHandle(ref, () => buttonRef.current, []);
522
523
  React.useEffect(() => {
523
524
  const transcript = voice.transcript;
524
- if (!transcript) return;
525
+ if (!transcript) {
526
+ committedTranscriptRef.current = "";
527
+ return;
528
+ }
525
529
  const previous = committedTranscriptRef.current;
526
530
  const addition = transcript.startsWith(previous) ? transcript.slice(previous.length).trim() : transcript.trim();
527
531
  committedTranscriptRef.current = transcript;
528
532
  if (!addition) return;
529
533
  if (controller) {
530
534
  controller.textInput.setInput(appendDictationTranscript(controller.textInput.value, addition));
535
+ voice.clear();
531
536
  return;
532
537
  }
533
538
  const textarea = buttonRef.current?.form?.querySelector("textarea[data-prompt-input-textarea=\"true\"]");
534
539
  if (!textarea) return;
535
540
  Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set?.call(textarea, appendDictationTranscript(textarea.value, addition));
536
541
  textarea.dispatchEvent(new Event("input", { bubbles: true }));
537
- }, [controller, voice.transcript]);
542
+ voice.clear();
543
+ }, [
544
+ controller,
545
+ voice.clear,
546
+ voice.transcript
547
+ ]);
538
548
  React.useEffect(() => {
539
549
  if (!voice.isListening) {
540
550
  recordingStartedAtRef.current = null;
@@ -1057,6 +1067,34 @@ const PromptInputCommandGroup = Combobox.Group;
1057
1067
  const PromptInputCommandGroupLabel = Combobox.GroupLabel;
1058
1068
  const PromptInputCommandItem = Combobox.Item;
1059
1069
  const PromptInputCommandSeparator = Combobox.Separator;
1070
+ /** Project whole upstream Agents MCP state into composer mention commands. */
1071
+ function mcpPromptInputCommands(mcp) {
1072
+ return Object.entries(mcp.servers).flatMap(([id, server]) => server.state === "ready" ? [{
1073
+ id: `mcp:${id}`,
1074
+ value: id,
1075
+ label: server.name,
1076
+ description: server.server_url,
1077
+ icon: /* @__PURE__ */ jsx(McpIcon, {}),
1078
+ keywords: [id, server.server_url],
1079
+ group: "Connected MCP servers",
1080
+ meta: "Connected"
1081
+ }] : []);
1082
+ }
1083
+ /** Project whole upstream skill descriptors into composer slash commands. */
1084
+ function skillPromptInputCommands(skills) {
1085
+ return skills.map((skill) => ({
1086
+ id: `skill:${skill.sourceId ?? "built-in"}:${skill.name}`,
1087
+ value: skill.name,
1088
+ label: skill.name,
1089
+ description: skill.description,
1090
+ icon: /* @__PURE__ */ jsx(BoxIcon, {}),
1091
+ ...skill.sourceId ? {
1092
+ keywords: [skill.sourceId],
1093
+ meta: skill.sourceId
1094
+ } : {},
1095
+ group: "Skills"
1096
+ }));
1097
+ }
1060
1098
  /**
1061
1099
  * Controlled PromptInput textarea with slash-command discovery. The host owns
1062
1100
  * both the command catalog and the draft policy applied after selection.
@@ -1346,4 +1384,4 @@ function createId() {
1346
1384
  return globalThis.crypto?.randomUUID?.() ?? `prompt-input-${Date.now()}-${Math.random()}`;
1347
1385
  }
1348
1386
  //#endregion
1349
- export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandComposer, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandGroupLabel, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputReferences, PromptInputSelect, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, PromptInputTray, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
1387
+ export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandComposer, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandGroupLabel, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputReferences, PromptInputSelect, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, PromptInputTray, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, mcpPromptInputCommands, skillPromptInputCommands, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
@@ -1,59 +1,2 @@
1
- import { ChatStatus, UIMessage } from "ai";
2
-
3
- //#region src/components/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
- /**
11
- * Parse a raw websocket payload as a `cf_agent_session` status frame.
12
- * Returns null for every other frame on the connection.
13
- */
14
- declare function parseSessionStatusFrame(data: unknown): SessionStatusFrame | null;
15
- /**
16
- * Parse a raw websocket payload as a `cf_agent_session_error` frame,
17
- * returning its error text. Null for every other frame on the connection.
18
- */
19
- declare function parseSessionErrorFrame(data: unknown): string | null;
20
- /** The message-frame surface of a `useAgent` connection. */
21
- interface SessionFrameSource {
22
- addEventListener(type: "message", listener: (event: MessageEvent) => void): void;
23
- removeEventListener(type: "message", listener: (event: MessageEvent) => void): void;
24
- }
25
- interface UseSessionCompactionOptions<MessageT extends UIMessage> {
26
- /** The conversation agent's `useAgent` connection. */
27
- agent: SessionFrameSource;
28
- /** The conversation's `useAgentChat` value (status + local view setter). */
29
- chat: {
30
- status: ChatStatus;
31
- setMessages: (messages: MessageT[]) => void;
32
- };
33
- /** Server read used to reload the transcript after a compaction lands. */
34
- getMessages: () => Promise<MessageT[]>;
35
- }
36
- interface UseSessionCompactionResult {
37
- compacting: boolean;
38
- /**
39
- * Set when the post-compaction transcript reload rejected — the local view
40
- * is stale relative to the server until a retry succeeds. Surface it
41
- * ("Transcript may be out of date"); the hook retries on the next status
42
- * transition to `"ready"`.
43
- */
44
- reloadError: unknown;
45
- /**
46
- * Error text from the last `cf_agent_session_error` frame — the only signal
47
- * a user who ran /compact gets when the server-side compaction itself fails
48
- * (the phase just flips back to idle with no `compacted` payload). Cleared
49
- * when the next compaction starts.
50
- */
51
- sessionError: string | null;
52
- }
53
- declare function useSessionCompaction<MessageT extends UIMessage>({
54
- agent,
55
- chat,
56
- getMessages
57
- }: UseSessionCompactionOptions<MessageT>): UseSessionCompactionResult;
58
- //#endregion
1
+ import { a as UseSessionCompactionResult, c as useSessionCompaction, i as UseSessionCompactionOptions, n as SessionStatusFrame, o as parseSessionErrorFrame, r as SessionStatusPhase, s as parseSessionStatusFrame, t as SessionFrameSource } from "../SessionCompaction-DMa1vv6Y.js";
59
2
  export { SessionFrameSource, SessionStatusFrame, SessionStatusPhase, UseSessionCompactionOptions, UseSessionCompactionResult, parseSessionErrorFrame, parseSessionStatusFrame, useSessionCompaction };
@@ -0,0 +1,43 @@
1
+ import * as React from "react";
2
+
3
+ //#region src/components/SettingsFormDialog.d.ts
4
+ type SettingsFormFieldType = "email" | "password" | "search" | "tel" | "text" | "url";
5
+ interface SettingsFormField {
6
+ name: string;
7
+ label: string;
8
+ description?: React.ReactNode;
9
+ type?: SettingsFormFieldType;
10
+ placeholder?: string;
11
+ autoComplete?: string;
12
+ required?: boolean;
13
+ readOnly?: boolean;
14
+ }
15
+ type SettingsFormValues = Readonly<Record<string, string>>;
16
+ interface SettingsFormDialogProps {
17
+ open: boolean;
18
+ onOpenChange: (open: boolean) => void;
19
+ title: React.ReactNode;
20
+ description: React.ReactNode;
21
+ fields: readonly SettingsFormField[];
22
+ initialValues?: Readonly<Record<string, string | undefined>>;
23
+ submitLabel: string;
24
+ submittingLabel?: string;
25
+ removeLabel?: string;
26
+ removingLabel?: string;
27
+ externalError?: string;
28
+ onSubmit: (values: SettingsFormValues) => void | Promise<void>;
29
+ onRemove?: () => void | Promise<void>;
30
+ }
31
+ /**
32
+ * Uncontrolled, metadata-driven settings dialog with native validation and
33
+ * shared async submit/remove feedback. Product schemas remain in the host.
34
+ */
35
+ declare function SettingsFormDialog({
36
+ open,
37
+ onOpenChange,
38
+ title,
39
+ description,
40
+ ...contentProps
41
+ }: SettingsFormDialogProps): React.JSX.Element;
42
+ //#endregion
43
+ export { SettingsFormDialog, SettingsFormDialogProps, SettingsFormField, SettingsFormFieldType, SettingsFormValues };
@@ -0,0 +1,110 @@
1
+ import { Button } from "./Button.js";
2
+ import { Dialog } from "./Dialog.js";
3
+ import { Field } from "./Field.js";
4
+ import { Form } from "./Form.js";
5
+ import * as React from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/SettingsFormDialog.tsx
8
+ function readSettingsValues(data, fields) {
9
+ return Object.fromEntries(fields.map((field) => {
10
+ const value = data[field.name];
11
+ return [field.name, typeof value === "string" ? value.trim() : ""];
12
+ }));
13
+ }
14
+ function SettingsFormDialogContent({ fields, initialValues, submitLabel, submittingLabel = "Saving…", removeLabel, removingLabel = "Removing…", externalError, onSubmit, onRemove, onOpenChange }) {
15
+ const [submission, setSubmission] = React.useState(null);
16
+ const active = React.useRef(true);
17
+ const pending = submission === "submit" || submission === "remove";
18
+ const error = submission && typeof submission === "object" ? submission.error : null;
19
+ React.useEffect(() => {
20
+ active.current = true;
21
+ return () => {
22
+ active.current = false;
23
+ };
24
+ }, []);
25
+ async function submit(values) {
26
+ setSubmission("submit");
27
+ try {
28
+ await onSubmit(readSettingsValues(values, fields));
29
+ if (!active.current) return;
30
+ setSubmission(null);
31
+ onOpenChange(false);
32
+ } catch (cause) {
33
+ if (!active.current) return;
34
+ setSubmission({ error: cause instanceof Error ? cause.message : String(cause) });
35
+ }
36
+ }
37
+ async function remove() {
38
+ if (!onRemove) return;
39
+ setSubmission("remove");
40
+ try {
41
+ await onRemove();
42
+ if (!active.current) return;
43
+ setSubmission(null);
44
+ onOpenChange(false);
45
+ } catch (cause) {
46
+ if (!active.current) return;
47
+ setSubmission({ error: cause instanceof Error ? cause.message : String(cause) });
48
+ }
49
+ }
50
+ return /* @__PURE__ */ jsxs(Form, {
51
+ onFormSubmit: submit,
52
+ children: [
53
+ fields.map((field) => /* @__PURE__ */ jsxs(Field.Root, {
54
+ name: field.name,
55
+ children: [
56
+ /* @__PURE__ */ jsx(Field.Label, { children: field.label }),
57
+ /* @__PURE__ */ jsx(Field.Control, {
58
+ autoComplete: field.autoComplete,
59
+ defaultValue: initialValues?.[field.name],
60
+ placeholder: field.placeholder,
61
+ readOnly: field.readOnly,
62
+ required: field.required,
63
+ type: field.type
64
+ }),
65
+ field.description ? /* @__PURE__ */ jsx(Field.Description, { children: field.description }) : null,
66
+ field.required ? /* @__PURE__ */ jsxs(Field.Error, {
67
+ match: "valueMissing",
68
+ children: [field.label, " is required."]
69
+ }) : null,
70
+ field.type === "url" ? /* @__PURE__ */ jsx(Field.Error, {
71
+ match: "typeMismatch",
72
+ children: "Enter a valid URL."
73
+ }) : null
74
+ ]
75
+ }, field.name)),
76
+ error ? /* @__PURE__ */ jsx(Field.Errors, { errors: [error] }) : externalError ? /* @__PURE__ */ jsx(Field.Errors, { errors: [externalError] }) : null,
77
+ /* @__PURE__ */ jsxs(Dialog.Footer, { children: [onRemove && removeLabel ? /* @__PURE__ */ jsx(Button, {
78
+ type: "button",
79
+ variant: "ghost",
80
+ color: "destructive",
81
+ disabled: pending,
82
+ focusableWhenDisabled: pending,
83
+ onClick: () => void remove(),
84
+ children: submission === "remove" ? removingLabel : removeLabel
85
+ }) : null, /* @__PURE__ */ jsx(Button, {
86
+ type: "submit",
87
+ color: "primary",
88
+ disabled: pending,
89
+ focusableWhenDisabled: pending,
90
+ children: submission === "submit" ? submittingLabel : submitLabel
91
+ })] })
92
+ ]
93
+ });
94
+ }
95
+ /**
96
+ * Uncontrolled, metadata-driven settings dialog with native validation and
97
+ * shared async submit/remove feedback. Product schemas remain in the host.
98
+ */
99
+ function SettingsFormDialog({ open, onOpenChange, title, description, ...contentProps }) {
100
+ return /* @__PURE__ */ jsx(Dialog.Root, {
101
+ open,
102
+ onOpenChange,
103
+ children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Viewport, { children: /* @__PURE__ */ jsxs(Dialog.Popup, { children: [/* @__PURE__ */ jsxs(Dialog.Header, { children: [/* @__PURE__ */ jsx(Dialog.Title, { children: title }), /* @__PURE__ */ jsx(Dialog.Description, { children: description })] }), /* @__PURE__ */ jsx(SettingsFormDialogContent, {
104
+ ...contentProps,
105
+ onOpenChange
106
+ }, open ? "open" : "closed")] }) })] })
107
+ });
108
+ }
109
+ //#endregion
110
+ export { SettingsFormDialog };
@@ -1,16 +1,17 @@
1
1
  import { i as AgentMessageRenderPartContext } from "../AgentMessageParts-CyD2UB3V.js";
2
- import { r as AgentChatProps } from "../AgentChat-B6sgfQ_q.js";
2
+ import { r as AgentChatProps } from "../AgentChat-Dy3cKCd-.js";
3
3
  import { i as useOptionalAgentToolRuns, n as AgentToolRunsProvider, r as AgentToolRunsProviderProps, t as AgentToolEventsValue } from "../AgentToolRunsContext-BVe4stgw.js";
4
- import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-CSzVwMXf.js";
5
- import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-kr5fE0wg.js";
6
- import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-DawPYgga.js";
4
+ import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-BfroXQ4F.js";
5
+ import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-F062wneC.js";
6
+ import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-Dq0lOAgw.js";
7
7
  import { i as ThinkChatValue } from "../ThinkChatContext-B-Nk84Wi.js";
8
8
  import { n as ThinkRecoveryNoticeProps, t as ThinkRecoveryNotice } from "../ThinkRecoveryNotice-D6gYcBbr.js";
9
+ import { a as UseSessionCompactionResult } from "../SessionCompaction-DMa1vv6Y.js";
9
10
  import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../BrowserLiveView-BV5qgFgI.js";
10
11
  import { n as BrowserReplayProps, t as BrowserReplay } from "../BrowserReplay-xWvRjRAC.js";
11
12
  import { d as inferWorkspaceLanguage, i as WorkspaceFileState } from "../WorkspaceFile-DMtRMwVv.js";
12
- import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceFileStatQueryOptions, f as workspaceInfoQueryOptions, i as WorkspaceQueryKey, l as workspaceDirectoryQueryOptions, m as workspaceTextFileQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceQueryKey, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceFileAssetQueryOptions } from "../Workspace-CIycQ4xE.js";
13
- import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../WorkspaceExplorer-BCipn7Vd.js";
13
+ import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceDirectoryQueryPrefix, f as workspaceFileAssetQueryOptions, g as workspaceTextFileQueryOptions, h as workspaceQueryKey, i as WorkspaceQueryKey, l as workspaceDirectoryQueryKey, m as workspaceInfoQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceFileStatQueryOptions, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceDirectoryQueryOptions } from "../Workspace-Bn6In4wi.js";
14
+ import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../WorkspaceExplorer-D0aiscG6.js";
14
15
  import * as React from "react";
15
16
  import { UIMessage } from "ai";
16
17
  import { UseAgentOptions } from "agents/react";
@@ -75,6 +76,8 @@ interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends
75
76
  composerHeader?: AgentChatProps<MessageT>["composerHeader"];
76
77
  /** Persistent context (e.g. the Goal banner) in the tray above the composer. */
77
78
  composerTray?: AgentChatProps<MessageT>["composerTray"];
79
+ /** Called when a submission is queued behind a busy turn; see AgentChat. */
80
+ onPromptQueued?: AgentChatProps<MessageT>["onPromptQueued"];
78
81
  /** Extra rows rendered in the built-in plus menu after files. */
79
82
  composerAddMenuItems?: AgentChatProps<MessageT>["composerAddMenuItems"];
80
83
  /** Composer placeholder text. */
@@ -93,6 +96,8 @@ interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends
93
96
  * `isRecovering`/`connectionError`) shown between transcript and composer.
94
97
  */
95
98
  notice?: AgentChatProps<MessageT>["notice"];
99
+ /** Whole `useSessionCompaction` result for built-in progress and error notices. */
100
+ sessionCompaction?: UseSessionCompactionResult;
96
101
  /**
97
102
  * Extends the built-in Think activity renderer. Returning `undefined` keeps
98
103
  * the built-in result; `defaultRender()` renders that same result on demand.
@@ -182,6 +187,7 @@ declare function ThinkChatMessages<State = unknown, MessageT extends UIMessage =
182
187
  onExecutionSettled,
183
188
  pendingApprovals,
184
189
  notice,
190
+ sessionCompaction,
185
191
  ...props
186
192
  }: ThinkChatMessagesProps<MessageT>): React.JSX.Element;
187
193
  /**
@@ -224,4 +230,4 @@ declare const ThinkChat: {
224
230
  createActivityRenderer: typeof createThinkChatActivityRenderer;
225
231
  };
226
232
  //#endregion
227
- export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, 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, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
233
+ export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, 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 };
@@ -5,8 +5,8 @@ import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
5
5
  import { describeThinkChatActivityPart } from "./ThinkChatActivitySummary.js";
6
6
  import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./ThinkChatActivity.js";
7
7
  import { ThinkRecoveryNotice } from "./ThinkRecoveryNotice.js";
8
- import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-DVhCEjq-.js";
8
+ import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-Bp-nAnoW.js";
9
9
  import { BrowserReplay } from "./BrowserReplay.js";
10
- import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
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, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
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 };
@@ -1,4 +1,4 @@
1
- import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-CSzVwMXf.js";
2
- import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-kr5fE0wg.js";
3
- import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-DawPYgga.js";
1
+ import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-BfroXQ4F.js";
2
+ import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-F062wneC.js";
3
+ import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-Dq0lOAgw.js";
4
4
  export { ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatToolRenderer, ThinkChatToolRenderers, createThinkChatActivityRenderer, describeThinkChatActivityPart, isThinkChatActivityPart, renderThinkChatActivityPart };
@@ -1,2 +1,2 @@
1
- import { a as ThinkChatToolLifecycleSnapshot, c as deriveThinkChatActivityHeader, d as summarizeActivitySteps, i as ThinkChatToolDescribers, l as deriveThinkChatToolLifecycleHeader, n as ThinkChatActivityHeader, o as activityPartIconKind, r as ThinkChatToolDescriber, s as activityPartUrl, t as ThinkChatActivityDescription, u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-kr5fE0wg.js";
1
+ import { a as ThinkChatToolLifecycleSnapshot, c as deriveThinkChatActivityHeader, d as summarizeActivitySteps, i as ThinkChatToolDescribers, l as deriveThinkChatToolLifecycleHeader, n as ThinkChatActivityHeader, o as activityPartIconKind, r as ThinkChatToolDescriber, s as activityPartUrl, t as ThinkChatActivityDescription, u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-F062wneC.js";
2
2
  export { ThinkChatActivityDescription, ThinkChatActivityHeader, ThinkChatToolDescriber, ThinkChatToolDescribers, ThinkChatToolLifecycleSnapshot, activityPartIconKind, activityPartUrl, deriveThinkChatActivityHeader, deriveThinkChatToolLifecycleHeader, describeThinkChatActivityPart, summarizeActivitySteps };
@@ -1,4 +1,4 @@
1
- import { a as SessionContextToolPart, d as WorkspaceToolPart, n as ExecuteToolPart, o as SkillToolPart, r as FetchToolPart, t as BrowserToolPart } from "../ThinkChatToolParts-CSzVwMXf.js";
1
+ import { a as SessionContextToolPart, d as WorkspaceToolPart, n as ExecuteToolPart, o as SkillToolPart, r as FetchToolPart, t as BrowserToolPart } from "../ThinkChatToolParts-BfroXQ4F.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/ThinkChatToolPanels.d.ts
@@ -110,7 +110,7 @@ function ThinkChatWorkspacePanel({ part }) {
110
110
  }
111
111
  case "tool-grep": {
112
112
  const output = part.state === "output-available" ? part.output : void 0;
113
- const matches = Array.isArray(output?.matches) ? output.matches.map((m) => typeof m === "string" ? m : m.context ?? JSON.stringify(m)) : [];
113
+ const matches = Array.isArray(output?.matches) ? output.matches.map((match) => typeof match === "string" ? match : match.context ?? JSON.stringify(match)) : [];
114
114
  const status = output && typeof output.totalMatches === "number" ? `${output.totalMatches} matches in ${String(output.filesWithMatches)} files` : void 0;
115
115
  return /* @__PURE__ */ jsx(ActivityPanel, {
116
116
  label: part.input?.query ?? "search",
@@ -1,2 +1,2 @@
1
- import { C as isToolPartFailed, S as isThinkChatActivityPart, T as isWorkspaceToolPart, _ as isPartFailed, a as SessionContextToolPart, b as isSessionContextToolPart, c as ThinkBashToolPart, d as WorkspaceToolPart, f as displayUrl, g as isFetchToolPart, h as isExecuteToolPart, i as SessionContextToolName, l as ThinkChatPart, m as isBrowserToolPart, n as ExecuteToolPart, o as SkillToolPart, p as getToolDisplayName, r as FetchToolPart, s as ThinkBashToolOutput, t as BrowserToolPart, u as ThinkWorkspaceToolName, v as isPartWorking, w as isToolPartWorking, x as isSkillToolPart, y as isSessionContextToolFailure } from "../ThinkChatToolParts-CSzVwMXf.js";
1
+ import { C as isToolPartFailed, S as isThinkChatActivityPart, T as isWorkspaceToolPart, _ as isPartFailed, a as SessionContextToolPart, b as isSessionContextToolPart, c as ThinkBashToolPart, d as WorkspaceToolPart, f as displayUrl, g as isFetchToolPart, h as isExecuteToolPart, i as SessionContextToolName, l as ThinkChatPart, m as isBrowserToolPart, n as ExecuteToolPart, o as SkillToolPart, p as getToolDisplayName, r as FetchToolPart, s as ThinkBashToolOutput, t as BrowserToolPart, u as ThinkWorkspaceToolName, v as isPartWorking, w as isToolPartWorking, x as isSkillToolPart, y as isSessionContextToolFailure } from "../ThinkChatToolParts-BfroXQ4F.js";
2
2
  export { BrowserToolPart, ExecuteToolPart, FetchToolPart, SessionContextToolName, SessionContextToolPart, SkillToolPart, ThinkBashToolOutput, ThinkBashToolPart, ThinkChatPart, ThinkWorkspaceToolName, WorkspaceToolPart, displayUrl, getToolDisplayName, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isToolPartFailed, isToolPartWorking, isWorkspaceToolPart };
@@ -1,6 +1,6 @@
1
1
  import { l as WorkspaceNavigationAdapter } from "../WorkspaceLink-O-EBKUJ8.js";
2
2
  import { r as WorkspaceFileAssetResolver } from "../WorkspaceFile-DMtRMwVv.js";
3
- import { a as WorkspaceSource } from "../Workspace-CIycQ4xE.js";
3
+ import { a as WorkspaceSource } from "../Workspace-Bn6In4wi.js";
4
4
  import { ThinkChatMessagesProps } from "./ThinkChat.js";
5
5
  import { t as ThinkAgent } from "../think-agent-Cip5KAPj.js";
6
6
  import { McpPluginCatalogProps } from "./McpPluginCatalog.js";
@@ -60,14 +60,12 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
60
60
  appBarTitle?: React.ReactNode;
61
61
  /** Aggregate thread activity rendered beside the compact thread-title disclosure. */
62
62
  threadStatusSummary?: ThinkThreadStatusSummary;
63
- /** Whether to include the built-in Execution workbench. Defaults to true. */
64
- showExecutionWorkbench?: boolean;
65
63
  /** Whether narrow layouts render the built-in chat/workbench switch. Defaults to true. */
66
64
  showMobileViewSwitch?: boolean;
67
65
  /** Hide the thread app bar when a narrow workbench supplies its own navigation. */
68
66
  hideAppBarInWorkbench?: boolean;
69
67
  /** Whole native execution selected by the application route. */
70
- selectedExecutionRun: ThinkExecutionRun | null;
68
+ selectedExecutionRun?: ThinkExecutionRun | null;
71
69
  /**
72
70
  * Stable, non-secret identity for the remote Think agent used by approvals
73
71
  * and execution queries. Include endpoint, account or tenant scope, and
@@ -75,16 +73,14 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
75
73
  * has its own source identity.
76
74
  */
77
75
  sourceKey: string;
78
- /** Returns an application-authored TanStack Router Link for an execution. */
79
- renderExecutionRunLink: ThinkExecutionWorkbenchProps["renderRunLink"];
76
+ /** Returns an application-authored TanStack Router Link and enables the Execution workbench. */
77
+ renderExecutionRunLink?: ThinkExecutionWorkbenchProps["renderRunLink"];
80
78
  /** Message rendering labels and approval overrides for ThinkChat. */
81
79
  messages?: ThinkChatMessagesProps<MessageT>;
82
80
  /** Extra workbench panels appended after the enabled built-in panels. */
83
81
  workbenchPanels?: readonly ThinkFullAppPanel<AgentT, State, MessageT>[];
84
- /** Show retained Agent Tool runs from the parent connection. Defaults to true. */
85
- showAgentTools?: boolean;
86
- /** Returns an application-authored TanStack Router Link for a retained child run. */
87
- renderAgentToolRunLink: NonNullable<ThinkChatMessagesProps<MessageT>["renderAgentToolRunLink"]>;
82
+ /** Returns an application-authored TanStack Router Link and enables retained Agent Tool runs. */
83
+ renderAgentToolRunLink?: NonNullable<ThinkChatMessagesProps<MessageT>["renderAgentToolRunLink"]>;
88
84
  /**
89
85
  * Optional parent-owned thread picker/sidebar rendered beside the selected child app.
90
86
  * Use the render form to close the compact drawer after selecting a thread.
@@ -134,8 +130,6 @@ declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = u
134
130
  renderAgentToolRunLink,
135
131
  renderExecutionRunLink,
136
132
  selectedExecutionRun,
137
- showAgentTools,
138
- showExecutionWorkbench,
139
133
  showMobileViewSwitch,
140
134
  sourceKey,
141
135
  style,
@@ -4,7 +4,7 @@ import { $ as TerminalIcon, C as FileIcon, J as SpinnerIcon, c as BoxIcon, f as
4
4
  import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../WorkspaceLink-BYYeTQLf.js";
5
5
  import { n as mergeRefs } from "../merge-refs-DF_7w2x_.js";
6
6
  import { AppTopBar } from "./AppTopBar.js";
7
- import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-DVhCEjq-.js";
7
+ import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-Bp-nAnoW.js";
8
8
  import { useWorkspace } from "./Workspace.js";
9
9
  import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
10
10
  import { ScrollArea } from "./ScrollArea.js";
@@ -46,7 +46,7 @@ function PluginsPanel({ config }) {
46
46
  });
47
47
  }
48
48
  /** Combines ThinkChat with an optional resizable workbench shell. */
49
- function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat, className, defaultMobileView, defaultWorkbenchView, defaultThreadSidebarOpen, hideAppBarInWorkbench = false, messages, mobileView, onMobileViewChange, onThreadSidebarOpenChange, onWorkbenchViewChange, plugins, ref, renderAgentToolRunLink, renderExecutionRunLink, selectedExecutionRun, showAgentTools = true, showExecutionWorkbench = true, showMobileViewSwitch = true, sourceKey, style, threadSidebar, threadSidebarOpen, threadStatusSummary, workbenchPanels, workbenchView, workspace, ...props }) {
49
+ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat, className, defaultMobileView, defaultWorkbenchView, defaultThreadSidebarOpen, hideAppBarInWorkbench = false, messages, mobileView, onMobileViewChange, onThreadSidebarOpenChange, onWorkbenchViewChange, plugins, ref, renderAgentToolRunLink, renderExecutionRunLink, selectedExecutionRun = null, showMobileViewSwitch = true, sourceKey, style, threadSidebar, threadSidebarOpen, threadStatusSummary, workbenchPanels, workbenchView, workspace, ...props }) {
50
50
  const appRef = React.useRef(null);
51
51
  const workbenchPanelRef = React.useRef(null);
52
52
  const pendingPanelFocusRef = React.useRef(null);
@@ -108,7 +108,7 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
108
108
  icon: /* @__PURE__ */ jsx(FileIcon, {}),
109
109
  render: () => /* @__PURE__ */ jsx(WorkspacePanel, { config: workspace })
110
110
  });
111
- if (showExecutionWorkbench) availableWorkbenchPanels.push({
111
+ if (renderExecutionRunLink) availableWorkbenchPanels.push({
112
112
  id: "execution",
113
113
  label: "Execution",
114
114
  icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
@@ -252,7 +252,7 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
252
252
  agentTools,
253
253
  children: /* @__PURE__ */ jsx(ThinkChat.Messages, {
254
254
  ...resolvedMessages,
255
- renderAgentToolRunLink: showAgentTools ? renderAgentToolRunLink : void 0
255
+ renderAgentToolRunLink
256
256
  })
257
257
  })
258
258
  })
@@ -31,7 +31,7 @@ interface ThinkThreadStatusIndicatorsProps {
31
31
  summary: ThinkThreadStatusSummary;
32
32
  className?: string;
33
33
  }
34
- interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
34
+ interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect" | "title"> {
35
35
  /** Threads from the parent agent, already sorted in the order the app wants to show. */
36
36
  threads: readonly ThinkThreadItem[];
37
37
  /**
@@ -43,6 +43,8 @@ interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>,
43
43
  renderThreadLink: (thread: ThinkThreadItem) => React.ReactElement;
44
44
  /** Optional parent-agent create action, usually `parent.stub.createThread()`. */
45
45
  onCreate?: () => void | Promise<void>;
46
+ /** Handles unmodified primary activation while preserving link modifier behavior. */
47
+ onSelect?: (thread: ThinkThreadItem) => void;
46
48
  /** Optional parent-agent delete action, usually `parent.stub.deleteThread(thread.id)`. */
47
49
  onDelete?: (thread: ThinkThreadItem) => void | Promise<void>;
48
50
  /** Visible heading for the roster. */
@@ -68,6 +70,7 @@ declare function ThinkThreadPicker({
68
70
  threads,
69
71
  renderThreadLink,
70
72
  onCreate,
73
+ onSelect,
71
74
  onDelete,
72
75
  className,
73
76
  title,
@@ -110,7 +110,7 @@ function ThinkThreadStatusIndicators({ summary, className }) {
110
110
  * notes beside the parent Think agent because
111
111
  * `listThreads()`/`createThread()`/`deleteThread()` are app-owned.
112
112
  */
113
- function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onDelete, className, title = "Recents", "aria-label": ariaLabel = "Threads", ref, ...props }) {
113
+ function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onSelect, onDelete, className, title = "Recents", "aria-label": ariaLabel = "Threads", ref, ...props }) {
114
114
  const statusSummary = summarizeThinkThreads(threads);
115
115
  const [query, setQuery] = React.useState("");
116
116
  const [deleteOpen, setDeleteOpen] = React.useState(false);
@@ -210,6 +210,11 @@ function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onDelete, clas
210
210
  className: "think-thread-picker__thread"
211
211
  }),
212
212
  "data-thread-status": thread.status,
213
+ onClick: onSelect ? (event) => {
214
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
215
+ event.preventDefault();
216
+ onSelect(thread);
217
+ } : void 0,
213
218
  children: [/* @__PURE__ */ jsx("span", {
214
219
  className: "think-thread-picker__thread-title sigvelo-truncate",
215
220
  children: thread.title
@@ -1,2 +1,2 @@
1
- import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceFileStatQueryOptions, f as workspaceInfoQueryOptions, i as WorkspaceQueryKey, l as workspaceDirectoryQueryOptions, m as workspaceTextFileQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceQueryKey, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceFileAssetQueryOptions } from "../Workspace-CIycQ4xE.js";
2
- export { UseWorkspaceOptions, WorkspaceFileReadTarget, WorkspaceInfo, WorkspaceQueryKey, WorkspaceSource, WorkspaceState, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
1
+ import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceDirectoryQueryPrefix, f as workspaceFileAssetQueryOptions, g as workspaceTextFileQueryOptions, h as workspaceQueryKey, i as WorkspaceQueryKey, l as workspaceDirectoryQueryKey, m as workspaceInfoQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceFileStatQueryOptions, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceDirectoryQueryOptions } from "../Workspace-Bn6In4wi.js";
2
+ export { UseWorkspaceOptions, WorkspaceFileReadTarget, WorkspaceInfo, WorkspaceQueryKey, WorkspaceSource, WorkspaceState, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };